From d83a420f0517d7fc47aeb288a6a0cf4891784fcc Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Mon, 22 Jun 2026 12:03:44 +0200 Subject: New upstream version 3.0.2+dfsg --- Configuration.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'Configuration.cpp') diff --git a/Configuration.cpp b/Configuration.cpp index 185b3e4b..bf598688 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -500,7 +500,7 @@ public: void transceiver_ptt (bool); void transceiver_audio (bool); void transceiver_tune (bool); - void transceiver_period (double); + void transceiver_period (double, bool = false); void transceiver_blocksize (qint32); void transceiver_modulator_start (QString, unsigned, double, double, double, bool, bool, double, double); void transceiver_modulator_stop (bool); @@ -1262,13 +1262,13 @@ void Configuration::transceiver_tune (bool on) m_->transceiver_tune (on); } -void Configuration::transceiver_period (double period) +void Configuration::transceiver_period (double period, bool force) { #if WSJT_TRACE_CAT qDebug () << "Configuration::transceiver_period:" << period << m_->cached_rig_state_; #endif - m_->transceiver_period (period); + m_->transceiver_period (period, force); } void Configuration::transceiver_blocksize (qint32 blocksize) @@ -4979,7 +4979,7 @@ void Configuration::impl::on_voices_combo_box_currentIndexChanged (int /* index void Configuration::impl::read_voices () { - QString audioPath = QCoreApplication::applicationDirPath() + "/sounds/"; + QString audioPath = app_sounds_directory (); QString voiceList = audioPath + "voices.dat"; // load the content of voices.dat file to the voices combo box QFile file2 {voiceList}; QStringList wordList; @@ -5009,7 +5009,7 @@ void Configuration::impl::on_pb_test_alerts_clicked (bool) read_voicesPath(); #ifdef WIN32 QAudioOutput info(QAudioDeviceInfo::defaultOutputDevice()); - QString audioPath = QCoreApplication::applicationDirPath() + "/sounds" + voicesPath_ + "/"; + QString audioPath = app_sounds_directory (voicesPath_); QAudioFormat format; format.setCodec("audio/pcm"); format.setSampleRate (48000); @@ -5023,7 +5023,7 @@ void Configuration::impl::on_pb_test_alerts_clicked (bool) effect->open(QIODevice::ReadOnly); audio->start(effect); #else - QString audioPath = QCoreApplication::applicationDirPath() + "/sounds" + voicesPath_ + "/"; + QString audioPath = app_sounds_directory (voicesPath_); QSound::play(audioPath + "Testing123.wav"); // for Linux and macOS #endif } @@ -5217,11 +5217,14 @@ void Configuration::impl::transceiver_tune (bool on) } -void Configuration::impl::transceiver_period (double period) +void Configuration::impl::transceiver_period (double period, bool force) { cached_rig_state_.online (true); // we want the rig online set_cached_mode (); - if (cached_rig_state_.period() != period) + // force bypasses the de-dup so a caller can re-assert the period even when + // the cache already holds it but the rig never actually applied it (e.g. a + // period set that was emitted while the TCI rig was still offline). + if (force || cached_rig_state_.period() != period) { // printf("%s(%0.1f) Configuration #:%d period: %0.1f cached: %0.1f\n",QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),transceiver_command_number_+1,period,cached_rig_state_.period()); cached_rig_state_.period (period); -- cgit v1.2.3 From 059831534c7e884f0a607ed86b582fd00d821731 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Sat, 26 Sep 2026 23:24:03 +0200 Subject: New upstream version 3.2.0~rc1+dfsg --- .github/ISSUE_TEMPLATE/bug_report.md | 44 + .github/actions/build-linux-payload/action.yml | 457 + .github/actions/build-linux-sanitizers/action.yml | 277 + .github/actions/build-windows-deps/action.yml | 174 + .github/actions/warm-macos-deps/action.yml | 330 + .github/cmake/armhf-toolchain.cmake | 60 + .github/images/linux-ci/Dockerfile.armhf-cross | 121 + .github/images/linux-ci/Dockerfile.armhf-runtime | 48 + .github/images/linux-ci/Dockerfile.bookworm | 51 + .github/images/linux-ci/Dockerfile.noble | 89 + .github/images/linux-ci/README.md | 110 + .../images/linux-ci/armhf-cross-toolchain.config | 30 + .../linux-ci/install-armhf-runtime-packages.sh | 21 + .github/images/linux-ci/install-packages.sh | 63 + .github/images/linux-ci/write-manifest.sh | 77 + .github/scripts/armhf-ci-image-config.sh | 41 + .github/scripts/armhf-static-ldd.sh | 98 + .github/scripts/audit-armhf-cross-build.sh | 104 + .../scripts/audit-staged-dll-imports-windows.sh | 17 + .github/scripts/build-armhf-toolchain-smoke.sh | 83 + .github/scripts/build-boost-macos.sh | 29 +- .github/scripts/build-boost-tsan-linux.sh | 55 + .github/scripts/build-boost-windows.sh | 87 + .github/scripts/build-hamlib-armhf-cross.sh | 65 + .github/scripts/build-hamlib-linux.sh | 32 + .github/scripts/build-hamlib-macos.sh | 9 +- .github/scripts/build-hamlib-tsan-linux.sh | 52 + .github/scripts/build-hamlib-windows.sh | 24 + .github/scripts/build-linux-armhf-cross.sh | 62 + .github/scripts/build-pfunit-linux.sh | 29 + .github/scripts/build-pfunit-macos.sh | 48 + .github/scripts/build-pfunit-windows.sh | 21 + .github/scripts/build-qt-macos.sh | 5 +- .github/scripts/build-qt-tsan-linux.sh | 135 + .github/scripts/check-candidate-tag.sh | 32 + .github/scripts/deploy-macos-app.sh | 243 + .github/scripts/deploy-macos-cli-tools.sh | 259 + .github/scripts/generate-quick-downloads.py | 122 + .github/scripts/ghcr_retention.py | 234 + .github/scripts/is-linux-ci-image-input.sh | 127 + .github/scripts/linux-artifact-validation.sh | 290 + .github/scripts/linux-ccache-compiler-signature.sh | 157 + .github/scripts/linux-ci-image-config.sh | 17 + .github/scripts/linux-ci-image-fingerprint.sh | 17 + .github/scripts/linux-ci-image-inputs.sh | 75 + .github/scripts/list-release-assets.sh | 20 + .../scripts/normalize-armhf-sysroot-symlinks.sh | 30 + .github/scripts/package-linux-armhf.sh | 137 + .github/scripts/release-policy.py | 406 + .github/scripts/resolve-linux-ci-image-tag.py | 124 + .github/scripts/run-apt-get.sh | 96 + .github/scripts/select-ccache-key-suffix.sh | 55 + .github/scripts/select-linux-ccache-save.sh | 70 + .github/scripts/select-linux-packaging.sh | 97 + .github/scripts/should-refresh-linux-ci-images.py | 62 + .github/scripts/smoke-launch-windows.sh | 62 + .../test-linux-ccache-compiler-signature.sh | 87 + .github/scripts/test-verify-linux-ci-image.sh | 160 + .github/scripts/tests/test_armhf_ci_manifest.py | 90 + .../tests/test_armhf_cross_configuration.py | 176 + .github/scripts/tests/test_armhf_static_ldd.py | 123 + .../scripts/tests/test_armhf_sysroot_symlinks.py | 42 + .github/scripts/tests/test_check_candidate_tag.py | 81 + .github/scripts/tests/test_ghcr_retention.py | 143 + .../tests/test_linux_artifact_validation.py | 230 + .github/scripts/tests/test_linux_ccache_policy.py | 99 + .../tests/test_linux_image_publication_policy.py | 181 + .github/scripts/tests/test_release_policy.py | 383 + .../tests/test_resolve_linux_ci_image_tag.py | 125 + .../tests/test_should_refresh_linux_ci_images.py | 63 + .github/scripts/tsan-linux-deps-config.sh | 210 + .github/scripts/validate-ci-inputs.sh | 177 + .github/scripts/validate-linux-armhf-runtime.sh | 66 + .github/scripts/validate-workflow-timeouts.py | 76 + .github/scripts/verify-armhf-ci-image.sh | 253 + .github/scripts/verify-linux-ci-image.sh | 268 + .github/scripts/verify-macos-artifacts.sh | 11 +- .github/scripts/verify-macos-static-archives.sh | 11 +- .../scripts/verify-sanitizer-instrumentation.py | 136 + .github/scripts/verify-tsan-deps-linux.sh | 138 + .github/scripts/write-armhf-ci-manifest.sh | 121 + .github/workflows/build-linux-sanitizers.yml | 93 + .github/workflows/build-linux.yml | 769 +- .github/workflows/build-macos.yml | 1540 +- .github/workflows/build-selected-artifacts.yml | 181 + .github/workflows/build-windows.yml | 348 +- .github/workflows/ci.yml | 248 +- .github/workflows/hamlib-upstream-check.yml | 15 +- .github/workflows/prepare-macos-qt.yml | 73 - .github/workflows/promote-release.yml | 190 + .github/workflows/public-release.yml | 389 + .github/workflows/publish-linux-ci-images.yml | 632 + .github/workflows/release-tag-helper.yml | 126 + .github/workflows/release.yml | 428 +- .github/workflows/sign-windows-release.yml | 142 + .github/workflows/signpath-smoke.yml | 74 + .github/workflows/warm-dependency-caches.yml | 443 + ActiveStationList.cpp | 19 + ActiveStationList.hpp | 19 + Audio/Audio.pri | 5 - Audio/AudioInputSource.hpp | 71 + Audio/AudioStreamClock.hpp | 59 + Audio/AudioStreamDescriptor.cpp | 64 + Audio/AudioStreamDescriptor.hpp | 98 + Audio/FixtureAudioInput.cpp | 468 + Audio/FixtureAudioInput.hpp | 89 + Audio/FixtureSoundOutput.cpp | 298 + Audio/FixtureSoundOutput.hpp | 93 + Audio/TxAudioQueue.cpp | 124 + Audio/TxAudioQueue.hpp | 93 + Audio/TxAudioQueueEpochSnapshot.hpp | 23 + Audio/TxIdentity.hpp | 99 + Audio/TxPlaybackDiagnostics.cpp | 443 + Audio/TxPlaybackDiagnostics.hpp | 70 + Audio/TxPlaybackEvidence.hpp | 144 + Audio/TxRequest.hpp | 73 + Audio/WavFile.cpp | 147 + Audio/WavFile.hpp | 37 + Audio/WavInputLoader.cpp | 78 + Audio/WavInputLoader.hpp | 25 + Audio/WavLoadCoordinator.cpp | 82 + Audio/WavLoadCoordinator.hpp | 40 + Audio/soundin.cpp | 44 +- Audio/soundin.h | 24 +- Audio/soundout.cpp | 125 +- Audio/soundout.h | 31 +- AutoRespondPeriod.cpp | 101 + AutoRespondPeriod.hpp | 37 + AutoRespondPolicy.hpp | 21 + AutoRespondScoring.hpp | 43 + AutoRespondSelectionLatch.cpp | 25 + AutoRespondSelectionLatch.hpp | 23 + BeaconTxController.cpp | 496 + BeaconTxController.hpp | 184 + CMake/CompilerFlags.cmake | 282 + CMake/Dependencies.cmake | 150 + CMake/Install.cmake | 255 + CMake/Modules/GetGitRevisionDescription.cmake | 15 +- CMake/Modules/GetGitRevisionDescription.cmake.in | 8 +- CMake/Modules/NSIS.template.in | 2 +- CMake/Modules/QtAxMacros.cmake | 7 +- CMake/Modules/generate_version_info.cmake | 6 +- CMake/Modules/read_release_state.cmake | 85 + CMake/Modules/set_build_type.cmake | 7 +- CMake/Sources.cmake | 908 ++ CMake/Utils.cmake | 185 + CMake/getsvn.cmake | 10 +- CMakeCPackOptions.cmake.in | 4 +- CMakeLists.txt | 2260 +-- CMakeLists_wsjtx.txt | 2030 --- CONTRIBUTING.md | 234 +- Configuration.cpp | 1865 ++- Configuration.hpp | 60 +- Configuration.ui | 1191 +- CountryNames.cpp | 28 + CountryNames.hpp | 15 + DOCS-LICENSE.md | 30 + Darwin/ReadMe.txt | 274 +- DecDataMutex.cpp | 29 + DecDataMutex.hpp | 10 + DecodeOperatingContext.hpp | 68 + DecodeOutputPlan.cpp | 467 + DecodeOutputPlan.hpp | 205 + DecodedMessageReaction.cpp | 875 ++ DecodedMessageReaction.hpp | 210 + Decoder/decodedtext.cpp | 55 +- Decoder/decodedtext.h | 9 + Decoder/decodedtext.pri | 3 - DecoderIpc.cpp | 248 + DecoderIpc.hpp | 52 + DecoderIpcProtocol.h | 22 + DecoderOutputFramer.cpp | 52 + DecoderOutputFramer.hpp | 41 + Detector/Detector.cpp | 166 +- Detector/Detector.hpp | 13 +- Detector/Detector.pri | 3 - FastDecode.cpp | 42 + FastDecode.hpp | 18 + FoxGuardBands.cpp | 54 + FoxGuardBands.hpp | 30 + FoxOperatorActions.hpp | 71 + Ft8MtdDecodeCoordinator.cpp | 74 + Ft8MtdDecodeCoordinator.hpp | 75 + Ft8MtdDecodeScheduler.cpp | 153 + Ft8MtdDecodeScheduler.hpp | 66 + Ft8TxLoopbackTestController.cpp | 393 + Ft8TxLoopbackTestController.hpp | 60 + HelpText.cpp | 209 + HelpText.hpp | 17 + HighlightingRules.cpp | 53 + HighlightingRules.hpp | 28 + HoundTransmissionPolicy.cpp | 54 + HoundTransmissionPolicy.hpp | 83 + INSTALL | 376 - JttyReplay.hpp | 26 + JttyTxLoopbackTestController.cpp | 400 + JttyTxLoopbackTestController.hpp | 63 + LiveAudioTestController.cpp | 825 ++ LiveAudioTestController.hpp | 103 + MessageFilter.cpp | 21 + MessageFilter.hpp | 14 + MessageFilterLogic.cpp | 55 + MessageFilterLogic.hpp | 63 + MessageFilterRules.cpp | 72 + MessageFilterRules.hpp | 19 + MetaDataRegistry.cpp | 14 + Modulator/JttyPcmFifo.cpp | 245 + Modulator/JttyPcmFifo.hpp | 81 + Modulator/JttyTxStream.cpp | 120 + Modulator/JttyTxStream.hpp | 60 + Modulator/Modulator.cpp | 180 +- Modulator/Modulator.hpp | 14 +- Modulator/Modulator.pri | 3 - MultiSettings.cpp | 29 +- Network/Cloudlog.cpp | 965 +- Network/Cloudlog.hpp | 119 +- Network/CloudlogConfiguration.hpp | 16 + Network/DecodedTime.cpp | 65 + Network/DecodedTime.hpp | 13 + Network/FileDownload.cpp | 8 +- Network/FoxVerifier.cpp | 3 +- Network/MessageClient.cpp | 468 +- Network/MessageClient.hpp | 15 + Network/Network.pri | 21 - Network/NetworkMessage.hpp | 70 + Network/PSKReporter.cpp | 11 +- Network/PSKReporter.hpp | 2 + Network/eqsl.cpp | 2 +- Network/tests/PSKReporter/PSKReporter.IESpec | 12 - Network/tests/PSKReporter/listener.py | 94 - Network/tests/PSKReporter/python-ipfix.patch | 64 - Network/wsprnet.cpp | 699 +- Network/wsprnet.h | 137 +- NonInheritingProcess.cpp | 44 +- OperatingFrequency.cpp | 73 + OperatingFrequency.hpp | 65 + PerformanceTrace.cpp | 197 + PerformanceTrace.hpp | 54 + PrefixSuffix.cpp | 65 + PrefixSuffix.hpp | 17 + QsoProgress.hpp | 16 + README | 107 - README.md | 49 +- Radio.cpp | 21 +- ReceiveAudio.hpp | 135 + ReceiveHandoffTestController.cpp | 265 + ReceiveHandoffTestController.hpp | 66 + ReferenceSpectrum.hpp | 33 + Release_Notes.txt | 270 +- RigFrequencyChangePolicy.hpp | 110 + Rr73Policy.cpp | 15 + Rr73Policy.hpp | 11 + SpecialOperatingActivity.hpp | 18 + SuperFoxTxPlanner.cpp | 154 + SuperFoxTxPlanner.h | 86 + TRADEMARK.md | 33 + Transceiver/EmulateSplitTransceiver.cpp | 3 + Transceiver/HamlibMode.cpp | 109 + Transceiver/HamlibMode.hpp | 16 + Transceiver/HamlibTransceiver.cpp | 245 +- Transceiver/HamlibTransceiver.hpp | 6 +- Transceiver/HamlibVfoRoleState.hpp | 43 + Transceiver/TCIProtocol.hpp | 41 + Transceiver/TCIStream.hpp | 170 + Transceiver/TCITransceiver.cpp | 736 +- Transceiver/TCITransceiver.hpp | 116 +- Transceiver/Transceiver.cpp | 26 +- Transceiver/Transceiver.hpp | 86 +- Transceiver/TransceiverBase.cpp | 19 +- Transceiver/TransceiverBase.hpp | 5 +- Transceiver/TransceiverFactory.cpp | 10 + Transceiver/TransceiverFactory.hpp | 6 + Transceiver/TxInhibitTransceiver.cpp | 255 + Transceiver/TxInhibitTransceiver.hpp | 67 + TxStartPolicy.hpp | 46 + UDPExamples/MessageServer.cpp | 1 + UnitTests.txt | 91 + WFPalette.cpp | 26 +- WSJTXLogging.cpp | 6 +- WSPR/WSPRBandHopping.cpp | 5 +- WaitFeaturePolicy.hpp | 105 + bundle_fixup/CMakeLists.txt | 14 +- ci-cd/DEPLOYMENT_PLAYBOOK.md | 878 ++ ci-cd/DEVELOPMENT_WORKFLOW.md | 721 + commons.h | 40 +- displayWidgets.txt | 69 - doc/CMakeLists.txt | 5 + doc/building on MS Windows.txt | 245 - doc/building-Boost-libs.txt | 243 - doc/common/links.adoc | 2 - doc/user_guide/en/acknowledgements.adoc | 12 +- doc/user_guide/en/controls-functions-center.adoc | 19 +- doc/user_guide/en/controls-functions-left.adoc | 6 +- doc/user_guide/en/controls-functions-messages.adoc | 11 +- .../en/controls-functions-status-bar.adoc | 10 +- .../en/controls-functions-wide-graph.adoc | 8 +- doc/user_guide/en/docinfo.html | 19 + doc/user_guide/en/images/FST4_center.png | Bin 4437 -> 3693 bytes doc/user_guide/en/images/VHF_controls.png | Bin 4541 -> 3110 bytes doc/user_guide/en/images/active_stations_QMAP.png | Bin 30394 -> 115496 bytes doc/user_guide/en/images/jtty.png | Bin 0 -> 252535 bytes doc/user_guide/en/images/main-ui-controls.png | Bin 15143 -> 5360 bytes doc/user_guide/en/images/map65_icon.png | Bin 0 -> 19853 bytes doc/user_guide/en/images/misc-controls-center.png | Bin 34372 -> 2774 bytes doc/user_guide/en/images/misc-main-ui.png | Bin 38778 -> 9659 bytes doc/user_guide/en/images/qmap_all.png | Bin 0 -> 596537 bytes doc/user_guide/en/images/qmap_icon.png | Bin 0 -> 19344 bytes doc/user_guide/en/images/wsjtx_icon.png | Bin 0 -> 20281 bytes doc/user_guide/en/install-from-source.adoc | 584 +- doc/user_guide/en/install-mac.adoc | 8 +- doc/user_guide/en/install-windows.adoc | 2 +- doc/user_guide/en/intro_subsections.adoc | 39 +- doc/user_guide/en/introduction.adoc | 27 +- doc/user_guide/en/jtty.adoc | 52 + doc/user_guide/en/jtty_n1mm_integration.adoc | 41 + doc/user_guide/en/keyboard_mouse.adoc | 16 + doc/user_guide/en/make-qso.adoc | 35 +- doc/user_guide/en/measurement_tools.adoc | 24 +- doc/user_guide/en/modes.adoc | 13 +- doc/user_guide/en/new_features.adoc | 177 +- doc/user_guide/en/protocols.adoc | 12 +- doc/user_guide/en/qmap.adoc | 70 + doc/user_guide/en/settings-colors.adoc | 13 +- doc/user_guide/en/settings-radio.adoc | 25 + doc/user_guide/en/support.adoc | 18 +- doc/user_guide/en/system-requirements.adoc | 2 +- doc/user_guide/en/vhf-features.adoc | 11 +- doc/user_guide/en/wsjtx-main.adoc | 26 +- entitlements.plist | 45 +- .../wsjtx_log_config.ini.rig_control | 4 +- icons/Darwin/wsjtx.iconset/icon_128x128.png | Bin 17659 -> 20281 bytes icons/Darwin/wsjtx.iconset/icon_128x128@2x.png | Bin 43423 -> 49901 bytes icons/Darwin/wsjtx.iconset/icon_16x16.png | Bin 1084 -> 938 bytes icons/Darwin/wsjtx.iconset/icon_16x16@2x.png | Bin 2448 -> 2705 bytes icons/Darwin/wsjtx.iconset/icon_256x256.png | Bin 43423 -> 49901 bytes icons/Darwin/wsjtx.iconset/icon_256x256@2x.png | Bin 104868 -> 105280 bytes icons/Darwin/wsjtx.iconset/icon_32x32.png | Bin 2448 -> 2705 bytes icons/Darwin/wsjtx.iconset/icon_32x32@2x.png | Bin 5864 -> 7528 bytes icons/Darwin/wsjtx.iconset/icon_512x512.png | Bin 104868 -> 105280 bytes icons/Darwin/wsjtx.iconset/icon_512x512@2x.png | Bin 251432 -> 91820 bytes icons/Unix/wsjtx_icon.png | Bin 17659 -> 20281 bytes icons/windows-icons/wsjtx.ico | Bin 550870 -> 106980 bytes item_delegates/FrequencyDelegate.cpp | 8 +- item_delegates/FrequencyDeltaDelegate.cpp | 7 +- item_delegates/item_delegates.pri | 13 - lib/77bit/77bit.txt | 36 +- lib/77bit/encode77.f90 | 103 +- lib/77bit/packjt77.f90 | 4482 +++--- lib/77bit/packjt77_grammar.f90 | 1530 ++ lib/77bit/packjt77_schema.f90 | 871 ++ lib/EchoCallSim.f90 | 35 +- lib/addit.f90 | 1 + lib/afc9.f90 | 6 +- lib/allsim.f90 | 4 +- lib/astro.f90 | 31 +- lib/astro0.f90 | 97 +- lib/astrosub.f90 | 19 +- lib/avecho.f90 | 8 +- lib/blanker.f90 | 1 + lib/ccf2.f90 | 2 +- lib/cwsim.f90 | 100 +- lib/decode_completion.f90 | 90 + lib/decode_echo.f90 | 2 +- lib/decode_msk144.f90 | 69 +- lib/decoder.f90 | 1498 +- lib/decoder_callbacks.f90 | 718 + lib/decoder_ipc_atomic.f90 | 49 + lib/decoder_ipc_control.cpp | 191 + lib/decoder_ipc_control.h | 40 + lib/digi-contest.txt | 3 +- lib/echo_snr.f90 | 10 +- lib/echosim.f90 | 77 +- lib/emedop.f90 | 47 +- lib/ephem.f90 | 213 +- lib/fil4.f90 | 19 +- lib/flat4.f90 | 3 +- lib/fst4/fastosd240_74.f90 | 1 + lib/fst4/fst4sim.f90 | 37 +- lib/fst4/gen_fst4wave.f90 | 54 +- lib/fst4/genfst4.f90 | 32 +- lib/fst4/get_fst4_bitmetrics.f90 | 2 +- lib/fst4/ldpcsim240_101.f90 | 14 +- lib/fst4/osd240_101.f90 | 4 +- lib/fst4/osd240_74.f90 | 4 +- lib/fst4_decode.f90 | 10 +- lib/ft2/cdatetime.f90 | 6 - lib/ft2/ft2.f90 | 279 - lib/ft2/ft2.ini | 2 - lib/ft2/ft2_decode.f90 | 298 - lib/ft2/ft2_gfsk_iwave.f90 | 88 - lib/ft2/ft2_iwave.f90 | 64 - lib/ft2/ft2_params.f90 | 12 - lib/ft2/ft2audio.c | 347 - lib/ft2/g4.cmd | 7 - lib/ft2/gcom1.f90 | 34 - lib/ft2/genft2.f90 | 86 - lib/ft2/getcandidates2a.f90 | 64 - lib/ft2/gfsk_pulse.f90 | 6 - lib/ft2/libportaudio.a | Bin 1065188 -> 0 bytes lib/ft2/libwsjt_cxx.a | Bin 192392 -> 0 bytes lib/ft2/libwsjt_fort.a | Bin 1699980 -> 0 bytes lib/ft2/portaudio.h | 1123 -- lib/ft2/ptt.c | 58 - lib/ft2/ptt_unix.c | 341 - lib/ft4/ft4code.f90 | 13 +- lib/ft4/ft4sim.f90 | 16 +- lib/ft4/ft4sim_mult.f90 | 2 +- lib/ft4/gen_ft4wave.f90 | 4 +- lib/ft4/genft4.f90 | 7 +- lib/ft4_decode.f90 | 9 +- lib/ft8/compress.f90 | 1 + lib/ft8/foxgen.f90 | 2 +- lib/ft8/ft8_a7.f90 | 11 +- lib/ft8/ft8_a8_test.f90 | 2 +- lib/ft8/ft8_a8d.f90 | 6 +- lib/ft8/ft8b.f90 | 13 +- lib/ft8/ft8c.f90 | 7 +- lib/ft8/ft8sim.f90 | 13 +- lib/ft8/genft8.f90 | 8 +- lib/ft8/ldpcsim174_91.f90 | 2 +- lib/ft8/sync8.f90 | 4 +- lib/ft8_decode.f90 | 3 +- lib/ft8var/agccft8.f90 | 2 +- lib/ft8var/cwfilter.f90 | 11 +- lib/ft8var/fillhashvar.f90 | 65 +- lib/ft8var/four2avar.f90 | 13 +- lib/ft8var/ft4_mod1.f90 | 3 +- lib/ft8var/ft8_decode_ranges.f90 | 38 + lib/ft8var/ft8_decodevar.f90 | 135 +- lib/ft8var/ft8_downsamplevar.f90 | 26 +- lib/ft8var/ft8_mod1.f90 | 9 + lib/ft8var/ft8_mtd_residual.f90 | 459 + lib/ft8var/ft8_tsan.c | 30 + lib/ft8var/ft8apsetvar.f90 | 77 +- lib/ft8var/ft8bvar.f90 | 94 +- lib/ft8var/ft8mf1var.f90 | 3 +- lib/ft8var/ft8mfcqvar.f90 | 7 +- lib/ft8var/ft8sd1var.f90 | 7 +- lib/ft8var/ft8sdvar.f90 | 7 +- lib/ft8var/ft8svar.f90 | 30 +- lib/ft8var/gen_ft8wavevar.f90 | 1 + lib/ft8var/genft8sdvar.f90 | 14 +- lib/ft8var/genft8var.f90 | 12 +- lib/ft8var/jt65_mod9.f90 | 2 + lib/ft8var/osd174_91var.f90 | 20 +- lib/ft8var/packjt77sdvar.f90 | 558 - lib/ft8var/subtractft8var.f90 | 27 +- lib/ft8var/sync8dvar.f90 | 20 +- lib/ft8var/sync8var.f90 | 58 +- lib/ft8var/tone8.f90 | 64 +- lib/ft8var/tonesdvar.f90 | 37 +- lib/gen_cw_wave.f90 | 1 + lib/genmsk_128_90.f90 | 13 +- lib/get_q3list.f90 | 101 +- lib/gfsk_pulse.f90 | 6 + lib/hspec.f90 | 3 +- lib/jpl_ephemeris_status.f90 | 29 + lib/jplsubs.f | 322 +- lib/jt4.f90 | 3 + lib/jt49sim.f90 | 2 +- lib/jt4_decode.f90 | 3 +- lib/jt4sim.f90 | 2 +- lib/jt65.f90 | 25 +- lib/jt65_decode.f90 | 19 +- lib/jt65_mod.f90 | 2 + lib/jt65sim.f90 | 2 +- lib/jt9.f90 | 304 +- lib/jt9_input_validation.f90 | 158 + lib/jt9_params_init.f90 | 241 + lib/jt9_version.c | 20 + lib/jt9a.f90 | 152 +- lib/jt9a_stub.f90 | 12 + lib/jt9com.f90 | 22 +- lib/jt9sim.f90 | 2 +- lib/jtty/JTTY Messages.mc | 44 + lib/jtty/ana64a.f90 | 19 + lib/jtty/c_funcs.f90 | 13 + lib/jtty/cdatetime.f90 | 6 + lib/jtty/decodes.txt | 463 + lib/jtty/gen_jttywave.f90 | 110 + lib/jtty/gen_syncwave.f90 | 26 + lib/jtty/genjtty.f90 | 161 + lib/jtty/jtty.f90 | 60 + lib/jtty/jtty.ini | 3 + lib/jtty/jtty_block_pow.f90 | 101 + lib/jtty/jtty_codewords.f90 | 16 + lib/jtty/jtty_decode.f90 | 192 + lib/jtty/jtty_design.md | 145 + lib/jtty/jtty_design.txt | 231 + lib/jtty/jtty_fec_mod.f90 | 19 + lib/jtty/jtty_mdecode.f90 | 1228 ++ lib/jtty/jtty_mod.f90 | 447 + lib/jtty/jtty_msgs.txt | 23 + lib/jtty/jtty_n1mm_integration.md | 140 + lib/jtty/jtty_payload_correlators.f90 | 108 + lib/jtty/jtty_peakup.f90 | 146 + lib/jtty/jtty_source_codec.f90 | 470 + lib/jtty/jtty_source_encoding.txt | 380 + lib/jtty/jtty_spec.f90 | 40 + lib/jtty/jtty_tbcc_code_profile.f90 | 106 + lib/jtty/jtty_tbcc_decoder.f90 | 151 + lib/jtty/jtty_tbcc_list_decoder.f90 | 1168 ++ lib/jtty/jtty_tx_manual_checks.md | 65 + lib/jtty/jttyaudio.c | 376 + lib/jtty/jttycom.f90 | 31 + lib/jtty/portaudio.h | 1123 ++ lib/jtty/rjtty.f90 | 85 + lib/jtty/rjtty_sub.f90 | 102 + lib/jtty/sjtty.f90 | 258 + lib/jtty/sjtty_qrm.f90 | 238 + lib/jtty/subtract_jtty.f90 | 99 + lib/jtty/tbcc.f90 | 422 + lib/jtty/transmit.f90 | 55 + lib/jtty/update.f90 | 144 + lib/jtty/wava/plot_results.py | 57 + lib/jtty/wava/rcu_bound_4fsk.f90 | 217 + lib/jtty/wava/tbcc_4fsk_simulation.f90 | 167 + lib/jtty/wava/tbcc_performance_curves.png | Bin 0 -> 263436 bytes lib/lookup3.c | 305 + lib/lookup3.h | 18 + lib/map65_mmdec.f90 | 89 +- lib/moondopjpl.f90 | 24 +- lib/morse.f90 | 50 +- lib/msk144_freq_search.f90 | 20 +- lib/msk144code.f90 | 13 +- lib/msk144sim.f90 | 2 +- lib/msk144spd.f90 | 36 +- lib/msk144sync.f90 | 2 +- lib/msk40_freq_search.f90 | 20 +- lib/msk40spd.f90 | 36 +- lib/msk40sync.f90 | 12 +- lib/msk_spectrum.f90 | 59 + lib/options.f90 | 4 +- lib/osd128_90.f90 | 3 +- lib/packjt.f90 | 20 +- lib/plotsave.f90 | 20 +- lib/print_version.c | 16 + lib/ptt.c | 7 +- lib/q65_decode.f90 | 32 +- lib/qra/q65/genq65.f90 | 20 +- lib/qra/q65/normrnd.c | 2 +- lib/qra/q65/q65.c | 10 +- lib/qra/q65/q65.f90 | 8 +- lib/qra/q65/q65.h | 5 +- lib/qra/q65/q65_ap.f90 | 32 +- lib/qra/q65/q65_encoding_modules.f90 | 31 +- lib/qra/q65/q65_ftn_test.f90 | 9 +- lib/qra/q65/q65_loops.f90 | 24 +- lib/qra/q65/q65_set_list.f90 | 2 +- lib/qra/q65/q65_set_list2.f90 | 36 +- lib/qra/q65/q65_workspace.f90 | 43 + lib/qra/q65/q65code.f90 | 11 +- lib/qra/q65/q65sim.f90 | 14 +- lib/qso50/g0 | 4 +- lib/readwav.f90 | 142 +- lib/refspectrum.f90 | 37 +- lib/rig_control.c | 7 +- lib/rtty_spec.f90 | 2 +- lib/save_dxbase.f90 | 9 - lib/savec2.f90 | 33 +- lib/sec_midn.f90 | 5 +- lib/sh65.f90 | 2 + lib/shmem.cpp | 2 - lib/shmem.f90 | 10 - lib/sleep_msec.f90 | 3 +- lib/spec64.f90 | 11 +- lib/spec_qra65.f90 | 4 +- lib/stdmsg.f90 | 34 + lib/stream_setmode.c | 24 + lib/stream_stdin.c | 49 + lib/streaming_apply.f90 | 328 + lib/streaming_control.f90 | 1779 +++ lib/streaming_emit.f90 | 288 + lib/streaming_io.f90 | 466 + lib/subtract65.f90 | 2 +- lib/sumsim.f90 | 2 +- lib/superfox/qpc/nhash2.c | 382 +- lib/superfox/qpc/nhash2.h | 7 +- lib/superfox/qpc/np_rnd.c | 2 +- lib/superfox/qpc_decode2.f90 | 6 +- lib/superfox/qpc_sync.f90 | 23 +- lib/superfox/ran1.f90 | 18 +- lib/superfox/sfox_pack.f90 | 249 +- lib/superfox/sfox_remove_ft8.f90 | 7 +- lib/superfox/sfox_remove_tone.f90 | 1 + lib/superfox/sfox_unpack.f90 | 31 +- lib/superfox/sfoxsim.f90 | 7 +- lib/superfox/sfrx_sub.f90 | 5 +- lib/superfox/sftx.f90 | 21 +- lib/superfox/sftx_sub.f90 | 15 +- lib/superfox/superfox_qpc_2.txt | 5 +- lib/symspec.f90 | 1 - lib/testEchoCall.f90 | 108 +- lib/tweak1.f90 | 5 +- lib/twkfreq.f90 | 9 + lib/types.f90 | 1 - lib/vit213.c | 6 +- lib/wav12.f90 | 1 + lib/wqencode.f90 | 4 +- lib/wsprcode/go.sh | 2 +- lib/wsprcode/nhash.c | 389 +- lib/wsprcode/wspr_old_subs.f90 | 10 +- lib/wsprd/Makefile | 9 +- lib/wsprd/Makefile.MinGW | 8 +- lib/wsprd/Makefile.win32 | 11 +- lib/wsprd/nhash.c | 383 +- lib/wsprd/osdwspr.f90 | 2 + lib/wsprd/wsprd.c | 180 +- lib/wsprd/wsprd_stream.c | 571 + lib/wsprd/wsprd_stream.h | 33 + lib/wsprd/wsprd_utils.c | 156 +- lib/wsprd/wsprd_utils.h | 10 + lib/wsprd/wsprsimf.f90 | 4 +- lib/xcor.f90 | 3 +- logbook/AD1CCty.cpp | 50 +- logbook/AD1CCty.hpp | 1 + logbook/AdifQso.cpp | 143 + logbook/AdifQso.hpp | 29 + logbook/WorkedBefore.cpp | 88 +- logbook/WorkedBefore.hpp | 2 + logbook/WorkedBeforeLoadState.hpp | 70 + logbook/logbook.cpp | 119 +- logbook/logbook.pri | 13 - main.cpp | 672 +- manpages/man1/message_aggregator.1.txt | 46 +- manpages/man1/udp_daemon.1.txt | 69 +- manpages/man1/wsjtx.1.txt | 134 +- map65/CMakeLists.txt | 19 +- map65/about.cpp | 15 +- map65/about.qrc | 6 + map65/about.ui | 22 +- map65/about_icon.png | Bin 0 -> 19853 bytes map65/commons.cpp | 3 + map65/commons.h | 20 +- map65/devsetup.cpp | 94 +- map65/devsetup.h | 10 +- map65/devsetup.ui | 277 +- map65/globals.h | 1 + map65/half_symbol_scheduler.h | 36 + map65/libm65/CMakeLists.txt | 145 +- map65/libm65/afc65b.f90 | 190 +- map65/libm65/astro.f90 | 78 +- map65/libm65/astro0.f90 | 34 +- map65/libm65/ccf65.f90 | 123 +- map65/libm65/cgen65.f90 | 4 +- map65/libm65/datcom_ptrs_mod.f90 | 41 + map65/libm65/debug_log.f90 | 4 +- map65/libm65/decode0.f90 | 143 +- map65/libm65/decode1a.f90 | 85 +- map65/libm65/decode65b.f90 | 23 +- map65/libm65/decode_request_mutex.cpp | 15 + map65/libm65/decodes_mod.f90 | 50 +- map65/libm65/deep65.f90 | 300 +- map65/libm65/display.f90 | 43 +- map65/libm65/extract.f90 | 23 +- map65/libm65/fchisq.f90 | 76 +- map65/libm65/filbig.f90 | 126 +- map65/libm65/four2a.f90 | 3 +- map65/libm65/four2a_legacy_wrap.f90 | 51 +- map65/libm65/ftnquit.f90 | 4 +- map65/libm65/ftrsd2.c | 19 +- map65/libm65/ftrsd2_mod.f90 | 6 +- map65/libm65/gen65.f90 | 2 +- map65/libm65/gen_q65_cwave.f90 | 32 +- map65/libm65/gen_q65_wave.f90 | 16 +- map65/libm65/getdphi.f90 | 8 +- map65/libm65/getpfx1.f90 | 1 + map65/libm65/indexx.f90 | 25 +- map65/libm65/init_rs.c | 2 +- map65/libm65/m65_mod.f90 | 47 +- map65/libm65/m65a.f90 | 4 +- map65/libm65/map65_polarization_score.f90 | 74 + map65/libm65/map65a.f90 | 854 +- map65/libm65/mapsim.f90 | 122 +- map65/libm65/nchar.f90 | 1 + map65/libm65/npar_ptrs_mod.f90 | 515 +- map65/libm65/packjt.f90 | 37 +- map65/libm65/ptt.c | 4 +- map65/libm65/ptt_unix.c | 17 +- map65/libm65/q65b.F90 | 262 +- map65/libm65/recvpkt.f90 | 74 +- map65/libm65/run_m65.f90 | 72 +- map65/libm65/s3avg.f90 | 31 +- map65/libm65/stdout_channel_mod.f90 | 22 +- map65/libm65/stdout_shared_layout.h | 5 +- map65/libm65/stdout_shared_memory.cpp | 2 +- map65/libm65/symspec.f90 | 69 +- map65/libm65/test_astro_pipeline.f90 | 32 - map65/libm65/tmoonsub.c | 6 +- map65/libm65/trimlist.f90 | 70 +- map65/libm65/wideband_sync.f90 | 325 +- map65/main.cpp | 60 +- map65/mainwindow.cpp | 489 +- map65/mainwindow.h | 23 +- map65/mainwindow.ui | 27 +- map65/map65.pro | 73 - map65/map65_decode_display_filter.cpp | 95 + map65/map65_decode_display_filter.h | 40 + map65/map65_decode_lifecycle.txt | 453 +- map65/messages.cpp | 260 +- map65/messages.h | 13 +- map65/plotter.cpp | 112 +- map65/plotter.h | 9 +- map65/pskreporter_decode.cpp | 120 + map65/pskreporter_decode.h | 23 + map65/pskreporter_settings.cpp | 11 + map65/pskreporter_settings.h | 14 + map65/runtime_paths.cpp | 132 + map65/runtime_paths.h | 24 + map65/soundin.cpp | 74 +- map65/soundin.h | 5 +- map65/soundout.cpp | 62 +- map65/widegraph.cpp | 122 +- map65/widegraph.h | 7 +- map65/widegraph.ui | 28 +- map65/wsjt.ico | Bin 1078 -> 104774 bytes models/DecodeHighlightingModel.cpp | 17 +- models/FrequencyList.cpp | 36 +- models/Modes.cpp | 3 +- models/Modes.hpp | 1 + models/StationList.cpp | 5 +- models/models.pri | 20 - qcustomplot-source/qcustomplot.cpp | 18 +- qmake_only/scs_version.h | 4 - qmake_only/svnversion.h | 4 - qmap/CMakeLists.txt | 13 +- qmap/about.cpp | 17 +- qmap/about.qrc | 6 + qmap/about.ui | 22 +- qmap/about_icon.png | Bin 0 -> 19344 bytes qmap/commons.h | 17 +- qmap/decode_click_coalescer.cpp | 50 + qmap/decode_click_coalescer.h | 38 + qmap/decode_ipc.h | 53 + qmap/decode_label.h | 38 + qmap/getfile.cpp | 78 +- qmap/libqmap/CMakeLists.txt | 13 +- qmap/libqmap/decode0.f90 | 4 +- qmap/libqmap/getcand2.f90 | 1 + qmap/libqmap/q65b.f90 | 15 +- qmap/libqmap/q65c.f90 | 6 +- qmap/libqmap/qmap_decode_ipc.f90 | 18 + qmap/libqmap/qmapa.f90 | 6 +- qmap/libqmap/read_qm.f90 | 11 +- qmap/libqmap/save_qm.f90 | 2 +- qmap/livecq_parser.cpp | 95 + qmap/livecq_parser.h | 21 + qmap/main.cpp | 16 +- qmap/mainwindow.cpp | 418 +- qmap/mainwindow.h | 10 +- qmap/mainwindow.ui | 98 +- qmap/plotter.cpp | 270 +- qmap/plotter.h | 128 +- qmap/qmap.pro | 44 - qmap/qmap_click_policy.h | 25 + qmap/qmap_decode_record.cpp | 41 + qmap/qmap_decode_record.h | 28 + qmap/qmap_ipc.h | 107 + qmap/shared_memory_key.h | 15 + qmap/soundin.cpp | 2 +- qmap/vertwaterfall.cpp | 85 + qmap/vertwaterfall.h | 47 + qmap/vertwaterfall.ui | 78 + qmap/vplotter.cpp | 367 + qmap/vplotter.h | 103 + qmap/widegraph.cpp | 37 +- qmap/widegraph.h | 15 + qmap/wsjt.ico | Bin 1078 -> 102827 bytes qt_helpers.cpp | 245 +- qt_helpers.hpp | 33 +- release-state.txt | 5 + revision_utils.cpp | 38 +- revision_utils.hpp | 6 + revision_utils_wsjtx.cpp | 85 - samples/CMakeLists.txt | 67 + samples/FST4+FST4W/201230_0300.wav | Bin 0 -> 43200254 bytes samples/FST4+FST4W/210115_0058.wav | Bin 0 -> 1440250 bytes samples/FT4/000000_000002.wav | Bin 0 -> 145196 bytes samples/FT8/210703_133430.wav | Bin 0 -> 360246 bytes samples/ISCAT/ISCAT-A/VK7MO_110401_235515.wav | Bin 0 -> 327724 bytes samples/ISCAT/ISCAT-B/K0AWU_100714_115000.wav | Bin 0 -> 661544 bytes samples/JT4/JT4A/DF2ZC_070926_040700.WAV | Bin 0 -> 1146924 bytes samples/JT4/JT4F/OK1KIR_141105_175700.WAV | Bin 0 -> 1146924 bytes samples/JT65/JT65B/000000_0001.wav | Bin 0 -> 1296044 bytes samples/JT65/JT65B/000000_0002.wav | Bin 0 -> 1296044 bytes samples/JT65/JT65B/000000_0003.wav | Bin 0 -> 1296044 bytes samples/JT65/JT65B/000000_0004.wav | Bin 0 -> 1296044 bytes samples/JT65/JT65B/000000_0005.wav | Bin 0 -> 1296044 bytes samples/JT65/JT65B/000000_0006.wav | Bin 0 -> 1296044 bytes samples/JT65/JT65B/000000_0007.wav | Bin 0 -> 1296044 bytes samples/JT65/JT65B/DL7UAE_040308_002400.wav | Bin 0 -> 584369 bytes samples/JT9/130418_1742.wav | Bin 0 -> 1440044 bytes samples/JTTY/260807_134110.wav | Bin 0 -> 725992 bytes samples/MSK144/181211_120500.wav | Bin 0 -> 360214 bytes samples/MSK144/181211_120800.wav | Bin 0 -> 360214 bytes .../Q65/120D_Rainscatter_10_GHz/210117_0920.wav | Bin 0 -> 2880256 bytes samples/Q65/120E_Ionoscatter_6m/210130_1438.wav | Bin 0 -> 2880252 bytes samples/Q65/120E_Ionoscatter_6m/210130_1442.wav | Bin 0 -> 2880252 bytes samples/Q65/300A_Optical_Scatter/201210_0505.wav | Bin 0 -> 7200236 bytes samples/Q65/30A_Ionoscatter_6m/201203_022700.wav | Bin 0 -> 720234 bytes samples/Q65/30A_Ionoscatter_6m/201203_022800.wav | Bin 0 -> 720234 bytes samples/Q65/30A_Ionoscatter_6m/201203_022900.wav | Bin 0 -> 720234 bytes samples/Q65/30A_Ionoscatter_6m/201203_024000.wav | Bin 0 -> 720234 bytes samples/Q65/60A_EME_6m/210106_1621.wav | Bin 0 -> 1440256 bytes samples/Q65/60B_1296_Troposcatter/210109_0007.wav | Bin 0 -> 1440238 bytes samples/Q65/60B_1296_Troposcatter/210109_0147.wav | Bin 0 -> 1440238 bytes samples/Q65/60B_1296_Troposcatter/210109_0151.wav | Bin 0 -> 1440238 bytes samples/Q65/60D_EME_10GHz/201212_1838.wav | Bin 0 -> 1440238 bytes samples/QMAP/241019_0403.qm | Bin 0 -> 11520142 bytes samples/README | 20 + samples/WSPR/150426_0918.wav | Bin 0 -> 2880044 bytes samples/make_contents.cmake | 107 + test/apply_routing_test.f90 | 630 + test/fixtures/README.md | 47 + test/fixtures/fst4_210115_0058.expected.txt | 4 + test/fixtures/fst4w_201230_0300.expected.txt | 2 + test/fixtures/ft4_000000_000002.expected.txt | 20 + test/fixtures/ft8_210703_133430.expected.txt | 15 + test/fixtures/ft8_210703_133430_mtd.expected.txt | 21 + .../fixtures/jt4_OK1KIR_141105_175700.expected.txt | 2 + test/fixtures/jt65_000000_0004.expected.txt | 2 + test/fixtures/jt9_130418_1742.expected.txt | 7 + test/fixtures/msk144_181211_120800.expected.txt | 3 + test/fixtures/q65_300a_201210_0505.expected.txt | 2 + test/fixtures/q65_30a_201203_024000.expected.txt | 2 + test/fixtures/q65_60d_201212_1838.expected.txt | 2 + test/fixtures/wspr_150426_0918.expected.txt | 10 + test/phase4_parse_test.f90 | 206 + test/phase5_parse_test.f90 | 246 + test/phase6_parse_test.f90 | 216 + test/phase7_parse_test.f90 | 182 + test/phase8_parse_test.f90 | 299 + test/phase9_parse_test.f90 | 355 + test/run-apply-routing-unit.sh | 67 + test/run-golden-fixtures.sh | 137 + test/run-phase4-parse-unit.sh | 61 + test/run-phase5-parse-unit.sh | 66 + test/run-phase6-parse-unit.sh | 61 + test/run-phase7-parse-unit.sh | 61 + test/run-phase8-parse-unit.sh | 61 + test/run-phase9-parse-unit.sh | 62 + test/run-pr3-fixtures.sh | 92 + test/run-schema-v1-fixtures.sh | 698 + test/run-stream-wav-parity.sh | 126 + test/run-streaming-fixtures-no-configure.sh | 77 + test/run-streaming-fixtures.sh | 114 + test/run-wsjtx-startup-macos.sh | 131 + test/run-wsprd-streaming-fixtures.sh | 64 + test/wav_to_stream_harness.py | 966 ++ test/wav_to_stream_no_configure.py | 115 + test/wav_to_wsprd_stream_harness.py | 148 + tests/CMakeLists.txt | 64 +- tests/fixtures/jtty/jtty_msgs.txt | 40 + tests/integration/ft8/run_tx_loopback.cmake | 86 + tests/integration/ft8/tx_loopback.expected.txt | 2 + tests/integration/jt9/compare_decoder_output.cmake | 44 + tests/integration/jt9/compare_mtd_messages.cmake | 133 + tests/integration/jt9/smoke_decoder_callback.cmake | 47 + tests/integration/jt9/verify_elf_stack.cmake | 30 + .../jt9/verify_jt4_12000_read_extent.cmake | 67 + tests/integration/jtty/live_audio.expected.txt | 1 + tests/integration/jtty/run_live_audio.cmake | 66 + tests/integration/jtty/run_tx_loopback.cmake | 84 + tests/integration/jtty/tx_loopback.expected.txt | 2 + .../run-live-audio-parallel-experiment.sh | 194 + tests/integration/wsprd/compare_wsprd_output.cmake | 41 + tests/manual/pskreporter/PSKReporter.IESpec | 12 + tests/manual/pskreporter/listener.py | 94 + tests/manual/pskreporter/python-ipfix.patch | 64 + tests/release/test_git_archive.cmake | 84 + tests/release/test_release_state.cmake | 123 + tests/release/validate_release_state_fixture.cmake | 6 + tests/sanitizers/tsan-fortran.supp | 7 + tests/sanitizers/tsan-gui.supp | 56 + tests/sanitizers/tsan-network.supp | 48 + tests/sanitizers/tsan.supp | 57 + tests/test_bwf_file.cpp | 354 - tests/test_emulate_split_transceiver.cpp | 113 - tests/test_http_user_agent.cpp | 33 - tests/test_qt_helpers.cpp | 212 - tests/unit/audio/CMakeLists.txt | 134 + tests/unit/audio/receive_reference_probe.f90 | 43 + .../audio/test_audio_input_stream_descriptor.cpp | 411 + tests/unit/audio/test_bwf_file.cpp | 423 + tests/unit/audio/test_echosim_wav_trailer.cpp | 96 + tests/unit/audio/test_fast_decode_ownership.cpp | 336 + tests/unit/audio/test_receive_audio_handoff.cpp | 535 + tests/unit/audio/test_tx_audio_queue.cpp | 209 + tests/unit/audio/test_tx_playback_diagnostics.cpp | 261 + tests/unit/audio/test_tx_request.cpp | 125 + tests/unit/audio/test_wav_input_loading.cpp | 203 + tests/unit/audio/test_wav_load_coordinator.cpp | 117 + tests/unit/band_hopping/CMakeLists.txt | 6 + tests/unit/band_hopping/test_band_hopping.cpp | 52 + tests/unit/common/CMakeLists.txt | 303 + tests/unit/common/QsoReactionTestSupport.hpp | 71 + tests/unit/common/test_active_station_list.cpp | 67 + tests/unit/common/test_active_stations.cpp | 86 + tests/unit/common/test_auto_respond_period.cpp | 217 + tests/unit/common/test_auto_respond_scoring.cpp | 65 + .../common/test_auto_respond_selection_latch.cpp | 36 + tests/unit/common/test_auto_sequence_reaction.cpp | 203 + tests/unit/common/test_beacon_tx_controller.cpp | 586 + tests/unit/common/test_callsign_validator.cpp | 48 + .../common/test_configuration_dialog_layout.cpp | 521 + tests/unit/common/test_decode_output_plan.cpp | 1146 ++ tests/unit/common/test_decoded_message_fields.cpp | 58 + .../unit/common/test_decoded_message_reaction.cpp | 385 + tests/unit/common/test_decoded_time.cpp | 54 + tests/unit/common/test_displaytext.cpp | 397 + .../unit/common/test_emulate_split_transceiver.cpp | 129 + tests/unit/common/test_fox_guard_bands.cpp | 92 + tests/unit/common/test_fox_operator_actions.cpp | 124 + tests/unit/common/test_frequency_editors.cpp | 273 + tests/unit/common/test_hamlib_mode.cpp | 78 + tests/unit/common/test_hamlib_vfo_role_state.cpp | 83 + tests/unit/common/test_highlighting_rules.cpp | 86 + .../unit/common/test_hound_transmission_policy.cpp | 179 + tests/unit/common/test_http_user_agent.cpp | 53 + tests/unit/common/test_livecq_callsign.cpp | 39 + .../common/test_mainwindow_compact_controls.cpp | 114 + tests/unit/common/test_operating_frequency.cpp | 211 + tests/unit/common/test_qso_reaction.cpp | 712 + tests/unit/common/test_qsy_message_parser.cpp | 316 + tests/unit/common/test_qt_helpers.cpp | 586 + .../common/test_rig_frequency_change_policy.cpp | 246 + tests/unit/common/test_round_robin_selection.cpp | 103 + tests/unit/common/test_rr73_policy.cpp | 43 + tests/unit/common/test_spec_op_label.cpp | 55 + tests/unit/common/test_superfox_tx_planner.cpp | 125 + tests/unit/common/test_tx_inhibit_transceiver.cpp | 485 + tests/unit/common/test_tx_start_policy.cpp | 108 + tests/unit/common/test_wait_feature_policy.cpp | 162 + tests/unit/common/test_waterfall_scale.cpp | 267 + tests/unit/common/test_wf_palette.cpp | 113 + tests/unit/decoder_ipc/CMakeLists.txt | 42 + .../unit/decoder_ipc/decoder_ipc_fortran_probe.f90 | 23 + .../decoder_ipc/test_decode_operating_context.cpp | 152 + .../unit/decoder_ipc/test_decoder_ipc_protocol.cpp | 396 + .../decoder_ipc/test_decoder_output_framer.cpp | 281 + tests/unit/echo/CMakeLists.txt | 16 + tests/unit/echo/test_avecho_disk_metadata.f90 | 52 + tests/unit/echo/test_avecho_silence.f90 | 53 + tests/unit/echo/test_echo_morse.f90 | 89 + tests/unit/echo/test_echocall_input.cmake | 131 + tests/unit/fst4/CMakeLists.txt | 13 + tests/unit/fst4/test_fst4_generator.f90 | 140 + tests/unit/fst4/test_fst4_osd_depth.f90 | 78 + tests/unit/ft8/CMakeLists.txt | 51 + tests/unit/ft8/test_ft8_decode_ranges.f90 | 68 + tests/unit/ft8/test_ft8_mtd_decode_coordinator.cpp | 327 + tests/unit/ft8/test_ft8_mtd_decode_scheduler.cpp | 137 + tests/unit/ft8/test_ft8_mtd_residual.f90 | 281 + .../ft8/test_ft8_mtd_transaction_concurrent.f90 | 195 + tests/unit/hash/CMakeLists.txt | 8 + tests/unit/hash/test_lookup3.c | 111 + tests/unit/jpl/CMakeLists.txt | 48 + tests/unit/jpl/emedop_cross_date.txt | 8 + tests/unit/jpl/emedop_invalid_start.txt | 8 + tests/unit/jpl/test_jpl_resilience.f90 | 693 + tests/unit/jpl/test_jpl_setup.f90 | 18 + tests/unit/jt65/CMakeLists.txt | 33 + tests/unit/jt65/jt65_test_fixture.f90 | 82 + tests/unit/jt65/jt65_test_vectors.f90 | 43 + tests/unit/jt65/test_ccf65_correlator.f90 | 118 + tests/unit/jt65/test_jt65_decode_pipeline.f90 | 293 + tests/unit/jt65/test_jt65_source_encoding.f90 | 201 + tests/unit/jt65/test_jt65_xcor_silence.f90 | 34 + .../jt65/test_map65_jt65_candidate_consistency.f90 | 39 + tests/unit/jt65/test_map65_jt65_handoff.f90 | 150 + .../unit/jt65/test_map65_jt65_message_validity.f90 | 77 + tests/unit/jt65/test_map65_s3avg_contracts.f90 | 137 + tests/unit/jt9/CMakeLists.txt | 11 + tests/unit/jt9/test_jt9_cli_validation.cmake | 17 + tests/unit/jt9/test_jt9_input_validation.f90 | 63 + tests/unit/jt9/test_readwav_validation.f90 | 162 + tests/unit/jtty/CMakeLists.txt | 198 + tests/unit/jtty/jtty_cpp_n1mm_smoke.cpp | 78 + tests/unit/jtty/test_jtty_adjacent_decode.f90 | 105 + tests/unit/jtty/test_jtty_block_pow.f90 | 144 + tests/unit/jtty/test_jtty_draft_acceptance.cpp | 128 + tests/unit/jtty/test_jtty_frequency_window.f90 | 89 + tests/unit/jtty/test_jtty_gap_merge.f90 | 135 + tests/unit/jtty/test_jtty_get_updates.f90 | 113 + tests/unit/jtty/test_jtty_message_matching.f90 | 99 + tests/unit/jtty/test_jtty_messages.cpp | 938 ++ tests/unit/jtty/test_jtty_n1mm.cpp | 245 + tests/unit/jtty/test_jtty_overlap_decode.f90 | 202 + tests/unit/jtty/test_jtty_pack.f90 | 460 + tests/unit/jtty/test_jtty_payload_correlators.f90 | 107 + tests/unit/jtty/test_jtty_receive_state.f90 | 201 + tests/unit/jtty/test_jtty_replay_ownership.cpp | 107 + tests/unit/jtty/test_jtty_source_codec.f90 | 202 + tests/unit/jtty/test_jtty_sticky_retry.f90 | 155 + tests/unit/jtty/test_jtty_structured_decode.f90 | 330 + tests/unit/jtty/test_jtty_surface_ranges.f90 | 98 + tests/unit/jtty/test_jtty_tbcc_code_profile.f90 | 115 + tests/unit/jtty/test_jtty_tbcc_decoder.f90 | 143 + tests/unit/jtty/test_jtty_tbcc_list_decoder.f90 | 300 + tests/unit/jtty/test_jtty_txstream.cpp | 487 + tests/unit/jtty/test_jtty_windowed_decode.f90 | 160 + tests/unit/jtty/test_mmttyif.cpp | 265 + tests/unit/jtty/test_tbcc.f90 | 141 + tests/unit/legacy72/CMakeLists.txt | 5 + tests/unit/legacy72/test_packjt_legacy72.f90 | 107 + tests/unit/logbook/CMakeLists.txt | 10 + tests/unit/logbook/test_logbook_adif.cpp | 254 + .../unit/logbook/test_worked_before_load_state.cpp | 69 + tests/unit/map65/CMakeLists.txt | 22 + tests/unit/map65/decode_history/CMakeLists.txt | 18 + .../map65/decode_history/decode_history_stubs.f90 | 159 + .../decode_history/test_map65_decode_history.f90 | 90 + tests/unit/map65/test_map65_astro.f90 | 62 + .../map65/test_map65_decode_display_filter.cpp | 94 + tests/unit/map65/test_map65_decode_requests.f90 | 112 + tests/unit/map65/test_map65_deep_search_cache.f90 | 188 + .../map65/test_map65_half_symbol_scheduler.cpp | 61 + tests/unit/map65/test_map65_q65_dphi.f90 | 126 + tests/unit/map65/test_map65_q65b_timeout.f90 | 46 + tests/unit/map65/test_map65_result_selection.f90 | 96 + tests/unit/map65/test_map65_runtime_paths.cpp | 225 + tests/unit/message_filter/CMakeLists.txt | 14 + tests/unit/message_filter/test_message_filter.cpp | 37 + .../message_filter/test_msk144_filter_rules.cpp | 99 + tests/unit/msk/CMakeLists.txt | 15 + tests/unit/msk/test_hspec_committed_boundary.f90 | 69 + tests/unit/msk/test_msk_spectrum_edges.f90 | 297 + tests/unit/network/CMakeLists.txt | 77 + .../network/test_cloudlog_connection_check.cpp | 650 + tests/unit/network/test_cloudlog_revision_stub.cpp | 6 + .../unit/network/test_map65_pskreporter_decode.cpp | 166 + .../network/test_map65_pskreporter_settings.cpp | 49 + .../network/test_message_client_inhibit_status.cpp | 315 + tests/unit/network/test_message_client_replay.cpp | 326 + tests/unit/network/test_message_server.cpp | 96 + tests/unit/network/test_pskreporter_ipfix.cpp | 222 + tests/unit/network/test_pskreporter_transport.cpp | 179 + tests/unit/network/test_wsprnet_upload.cpp | 749 + tests/unit/packjt77/CMakeLists.txt | 136 +- tests/unit/packjt77/encode77_test_messages.txt | 3 + tests/unit/packjt77/lint_packjt77_idioms.sh | 88 + tests/unit/packjt77/packjt77_test_helpers.f90 | 1576 ++ tests/unit/packjt77/silent_rewrite_corpus.txt | 54 + tests/unit/packjt77/test_encode77.cmake | 39 + .../unit/packjt77/test_pack77_cli_fallbacks.cmake | 75 + .../packjt77/test_packjt77_concurrent_unpack.f90 | 101 + .../unit/packjt77/test_packjt77_domain_sweeps.f90 | 333 + tests/unit/packjt77/test_packjt77_grammar_gate.f90 | 73 + tests/unit/packjt77/test_packjt77_hash_state.f90 | 1293 ++ tests/unit/packjt77/test_packjt77_hash_vectors.f90 | 77 - tests/unit/packjt77/test_packjt77_invariants.f90 | 150 + .../unit/packjt77/test_packjt77_mutation_sweep.f90 | 280 + tests/unit/packjt77/test_packjt77_pack28_sweep.f90 | 231 + .../packjt77/test_packjt77_protocol_vectors.f90 | 228 + .../unit/packjt77/test_packjt77_schema_decoder.f90 | 205 + .../unit/packjt77/test_packjt77_schema_encoder.f90 | 99 + .../test_packjt77_silent_rewrite_corpus.f90 | 206 + .../packjt77/test_packjt77sdvar_invariants.f90 | 234 + .../unit/packjt77/test_packjt77var_invariants.f90 | 93 + tests/unit/q65/CMakeLists.txt | 35 + tests/unit/q65/q65_test_fixture.f90 | 44 + tests/unit/q65/test_map65_polarization_score.f90 | 100 + tests/unit/q65/test_map65_wideband_sync_rows.f90 | 108 + tests/unit/q65/test_q65_decode_pipeline.f90 | 209 + tests/unit/q65/test_q65_llh_contracts.c | 42 + tests/unit/q65/test_q65_source_encoding.f90 | 194 + tests/unit/q65/test_q65_waveform_generator.f90 | 163 + tests/unit/q65/test_q65_workspace.f90 | 44 + tests/unit/q65/test_q65code.cmake | 25 + tests/unit/qmap/CMakeLists.txt | 45 + tests/unit/qmap/test_decode_click_coalescer.cpp | 95 + tests/unit/qmap/test_livecq_parser.cpp | 84 + tests/unit/qmap/test_plotter_initialization.cpp | 127 + tests/unit/qmap/test_qmap_decode_record.cpp | 97 + tests/unit/qmap/test_qmap_ipc.cpp | 98 + tests/unit/streaming/CMakeLists.txt | 16 + tests/unit/streaming/test_streaming_consumers.cpp | 373 + tests/unit/superfox/CMakeLists.txt | 31 + tests/unit/superfox/test_superfox_pack.f90 | 456 + tests/unit/superfox/test_superfox_tx_handoff.f90 | 121 + tests/unit/superfox/test_superfox_unpack.f90 | 28 + .../superfox/test_superfox_unpack_unsupported.f90 | 35 + tests/unit/tci/CMakeLists.txt | 55 + tests/unit/tci/TciSimScript.cpp | 416 + tests/unit/tci/TciSimScript.hpp | 116 + tests/unit/tci/TciSimServer.cpp | 328 + tests/unit/tci/TciSimServer.hpp | 111 + tests/unit/tci/test_tci_protocol.cpp | 110 + tests/unit/tci/test_tci_receive_ownership.cpp | 451 + tests/unit/tci/test_tci_sim_smoke.cpp | 387 + tests/unit/tci/test_tci_stream.cpp | 204 + .../tci/test_tci_transceiver_characterization.cpp | 912 ++ tests/unit/tci/test_transceiver_base_period.cpp | 164 + tests/unit/wsprd/CMakeLists.txt | 7 + tests/unit/wsprd/test_wsprd_utils.c | 253 + translations/wsjtx_ca.ts | 6749 ++++++--- translations/wsjtx_da.ts | 6254 +++++--- translations/wsjtx_de.ts | 9953 +++++++++++++ translations/wsjtx_en.ts | 7871 ++++++---- translations/wsjtx_en_GB.ts | 7873 ++++++---- translations/wsjtx_es.ts | 8014 ++++++---- translations/wsjtx_hu.ts | 12113 +++++++++++---- translations/wsjtx_it.ts | 6317 +++++--- translations/wsjtx_ja.ts | 6127 +++++--- translations/wsjtx_pl.ts | 10048 +++++++++++++ translations/wsjtx_ru.ts | 6815 ++++++--- translations/wsjtx_uk.ts | 12170 ++++++++++++++++ translations/wsjtx_zh.ts | 6155 +++++--- translations/wsjtx_zh_TW.ts | 11018 +++++++++----- validators/CallsignValidator.cpp | 11 + validators/CallsignValidator.hpp | 2 + validators/LiveCQCallsign.cpp | 64 + validators/LiveCQCallsign.hpp | 11 + validators/LiveFrequencyValidator.cpp | 16 +- validators/LiveFrequencyValidator.hpp | 1 + validators/validators.pri | 7 - widgets/BandHopping.cpp | 18 + widgets/BandHopping.hpp | 8 + widgets/CompactButtonSize.hpp | 22 + widgets/CurrentPageHeightStackedWidget.hpp | 38 + widgets/DecodeHighlightingListView.cpp | 24 +- widgets/FrequencyDeltaLineEdit.cpp | 39 +- widgets/FrequencyDeltaLineEdit.hpp | 7 + widgets/FrequencyLineEdit.cpp | 38 +- widgets/FrequencyLineEdit.hpp | 7 + widgets/JttyDraftAcceptanceTracker.hpp | 56 + widgets/JttyMessages.hpp | 950 ++ widgets/JttyN1mm.hpp | 247 + widgets/JttyN1mmOutput.hpp | 57 + widgets/MMTTYIF.cpp | 257 + widgets/MMTTYIF.hpp | 63 + widgets/QSYMessage.cpp | 321 +- widgets/QSYMessageCreator.cpp | 63 +- widgets/QSYMessageParser.cpp | 250 + widgets/QSYMessageParser.h | 62 + widgets/RoundRobinSelection.cpp | 48 + widgets/RoundRobinSelection.hpp | 16 + widgets/SettingsDialogLayout.cpp | 264 + widgets/SettingsDialogLayout.hpp | 24 + widgets/SpecOpLabel.cpp | 27 + widgets/SpecOpLabel.h | 13 + widgets/SplashScreen.cpp | 32 +- widgets/SplashScreen.hpp | 5 + widgets/TxDriveSlider.cpp | 132 + widgets/TxDriveSlider.hpp | 21 + widgets/WaterfallScale.hpp | 129 + widgets/about.cpp | 11 +- widgets/about.ui | 2 +- widgets/activeStations.cpp | 77 +- widgets/activeStations.h | 8 +- widgets/astro.cpp | 82 +- widgets/astro.h | 7 +- widgets/displaytext.cpp | 411 +- widgets/displaytext.h | 41 +- widgets/echograph.cpp | 2 + widgets/echoplot.cpp | 45 +- widgets/fastgraph.cpp | 2 + widgets/logqso.cpp | 40 +- widgets/mainwindow.cpp | 14602 +++++++++---------- widgets/mainwindow.h | 814 +- widgets/mainwindow.ui | 1344 +- widgets/mainwindow_arrl_digi.cpp | 160 + widgets/mainwindow_bandhopping.cpp | 236 + widgets/mainwindow_jtty.cpp | 1176 ++ widgets/mainwindow_settings.cpp | 637 + widgets/mainwindow_show_messages.cpp | 67 + widgets/mainwindow_slots.cpp | 1093 ++ widgets/plotter.cpp | 414 +- widgets/plotter.h | 34 +- widgets/qsymonitor.cpp | 276 +- widgets/widegraph.cpp | 32 +- widgets/widegraph.h | 6 +- widgets/widegraph.ui | 2 +- widgets/widgets.pri | 48 - wsjtx.iss | 30 - wsjtx.pro | 142 - wsjtx_config.h.in | 2 + wsjtx_icon.webp | Bin 0 -> 16872 bytes wsjtx_opti.iss | 23 - wsjtx_update.iss | 18 - 1180 files changed, 221830 insertions(+), 58578 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/actions/build-linux-payload/action.yml create mode 100644 .github/actions/build-linux-sanitizers/action.yml create mode 100644 .github/actions/build-windows-deps/action.yml create mode 100644 .github/actions/warm-macos-deps/action.yml create mode 100644 .github/cmake/armhf-toolchain.cmake create mode 100644 .github/images/linux-ci/Dockerfile.armhf-cross create mode 100644 .github/images/linux-ci/Dockerfile.armhf-runtime create mode 100644 .github/images/linux-ci/Dockerfile.bookworm create mode 100644 .github/images/linux-ci/Dockerfile.noble create mode 100644 .github/images/linux-ci/README.md create mode 100644 .github/images/linux-ci/armhf-cross-toolchain.config create mode 100755 .github/images/linux-ci/install-armhf-runtime-packages.sh create mode 100755 .github/images/linux-ci/install-packages.sh create mode 100755 .github/images/linux-ci/write-manifest.sh create mode 100755 .github/scripts/armhf-ci-image-config.sh create mode 100755 .github/scripts/armhf-static-ldd.sh create mode 100755 .github/scripts/audit-armhf-cross-build.sh create mode 100755 .github/scripts/build-armhf-toolchain-smoke.sh create mode 100755 .github/scripts/build-boost-tsan-linux.sh create mode 100755 .github/scripts/build-boost-windows.sh create mode 100755 .github/scripts/build-hamlib-armhf-cross.sh create mode 100755 .github/scripts/build-hamlib-linux.sh create mode 100755 .github/scripts/build-hamlib-tsan-linux.sh create mode 100755 .github/scripts/build-hamlib-windows.sh create mode 100755 .github/scripts/build-linux-armhf-cross.sh create mode 100755 .github/scripts/build-pfunit-linux.sh create mode 100755 .github/scripts/build-pfunit-macos.sh create mode 100755 .github/scripts/build-pfunit-windows.sh create mode 100755 .github/scripts/build-qt-tsan-linux.sh create mode 100755 .github/scripts/check-candidate-tag.sh create mode 100755 .github/scripts/deploy-macos-app.sh create mode 100755 .github/scripts/deploy-macos-cli-tools.sh create mode 100755 .github/scripts/generate-quick-downloads.py create mode 100755 .github/scripts/ghcr_retention.py create mode 100755 .github/scripts/is-linux-ci-image-input.sh create mode 100644 .github/scripts/linux-artifact-validation.sh create mode 100755 .github/scripts/linux-ccache-compiler-signature.sh create mode 100755 .github/scripts/linux-ci-image-config.sh create mode 100755 .github/scripts/linux-ci-image-fingerprint.sh create mode 100644 .github/scripts/linux-ci-image-inputs.sh create mode 100755 .github/scripts/list-release-assets.sh create mode 100755 .github/scripts/normalize-armhf-sysroot-symlinks.sh create mode 100755 .github/scripts/package-linux-armhf.sh create mode 100644 .github/scripts/release-policy.py create mode 100755 .github/scripts/resolve-linux-ci-image-tag.py create mode 100755 .github/scripts/run-apt-get.sh create mode 100755 .github/scripts/select-ccache-key-suffix.sh create mode 100755 .github/scripts/select-linux-ccache-save.sh create mode 100755 .github/scripts/select-linux-packaging.sh create mode 100644 .github/scripts/should-refresh-linux-ci-images.py create mode 100755 .github/scripts/smoke-launch-windows.sh create mode 100755 .github/scripts/test-linux-ccache-compiler-signature.sh create mode 100755 .github/scripts/test-verify-linux-ci-image.sh create mode 100644 .github/scripts/tests/test_armhf_ci_manifest.py create mode 100644 .github/scripts/tests/test_armhf_cross_configuration.py create mode 100644 .github/scripts/tests/test_armhf_static_ldd.py create mode 100644 .github/scripts/tests/test_armhf_sysroot_symlinks.py create mode 100644 .github/scripts/tests/test_check_candidate_tag.py create mode 100755 .github/scripts/tests/test_ghcr_retention.py create mode 100644 .github/scripts/tests/test_linux_artifact_validation.py create mode 100644 .github/scripts/tests/test_linux_ccache_policy.py create mode 100644 .github/scripts/tests/test_linux_image_publication_policy.py create mode 100644 .github/scripts/tests/test_release_policy.py create mode 100755 .github/scripts/tests/test_resolve_linux_ci_image_tag.py create mode 100644 .github/scripts/tests/test_should_refresh_linux_ci_images.py create mode 100755 .github/scripts/tsan-linux-deps-config.sh create mode 100755 .github/scripts/validate-ci-inputs.sh create mode 100755 .github/scripts/validate-linux-armhf-runtime.sh create mode 100755 .github/scripts/validate-workflow-timeouts.py create mode 100755 .github/scripts/verify-armhf-ci-image.sh create mode 100755 .github/scripts/verify-linux-ci-image.sh create mode 100755 .github/scripts/verify-sanitizer-instrumentation.py create mode 100755 .github/scripts/verify-tsan-deps-linux.sh create mode 100755 .github/scripts/write-armhf-ci-manifest.sh create mode 100644 .github/workflows/build-linux-sanitizers.yml create mode 100644 .github/workflows/build-selected-artifacts.yml delete mode 100644 .github/workflows/prepare-macos-qt.yml create mode 100644 .github/workflows/promote-release.yml create mode 100644 .github/workflows/public-release.yml create mode 100644 .github/workflows/publish-linux-ci-images.yml create mode 100644 .github/workflows/release-tag-helper.yml create mode 100644 .github/workflows/sign-windows-release.yml create mode 100644 .github/workflows/signpath-smoke.yml create mode 100644 .github/workflows/warm-dependency-caches.yml create mode 100644 ActiveStationList.cpp create mode 100644 ActiveStationList.hpp delete mode 100644 Audio/Audio.pri create mode 100644 Audio/AudioInputSource.hpp create mode 100644 Audio/AudioStreamClock.hpp create mode 100644 Audio/AudioStreamDescriptor.cpp create mode 100644 Audio/AudioStreamDescriptor.hpp create mode 100644 Audio/FixtureAudioInput.cpp create mode 100644 Audio/FixtureAudioInput.hpp create mode 100644 Audio/FixtureSoundOutput.cpp create mode 100644 Audio/FixtureSoundOutput.hpp create mode 100644 Audio/TxAudioQueue.cpp create mode 100644 Audio/TxAudioQueue.hpp create mode 100644 Audio/TxAudioQueueEpochSnapshot.hpp create mode 100644 Audio/TxIdentity.hpp create mode 100644 Audio/TxPlaybackDiagnostics.cpp create mode 100644 Audio/TxPlaybackDiagnostics.hpp create mode 100644 Audio/TxPlaybackEvidence.hpp create mode 100644 Audio/TxRequest.hpp create mode 100644 Audio/WavFile.cpp create mode 100644 Audio/WavFile.hpp create mode 100644 Audio/WavInputLoader.cpp create mode 100644 Audio/WavInputLoader.hpp create mode 100644 Audio/WavLoadCoordinator.cpp create mode 100644 Audio/WavLoadCoordinator.hpp create mode 100644 AutoRespondPeriod.cpp create mode 100644 AutoRespondPeriod.hpp create mode 100644 AutoRespondPolicy.hpp create mode 100644 AutoRespondScoring.hpp create mode 100644 AutoRespondSelectionLatch.cpp create mode 100644 AutoRespondSelectionLatch.hpp create mode 100644 BeaconTxController.cpp create mode 100644 BeaconTxController.hpp create mode 100644 CMake/CompilerFlags.cmake create mode 100644 CMake/Dependencies.cmake create mode 100644 CMake/Install.cmake create mode 100644 CMake/Modules/read_release_state.cmake create mode 100644 CMake/Sources.cmake create mode 100644 CMake/Utils.cmake delete mode 100644 CMakeLists_wsjtx.txt create mode 100644 CountryNames.cpp create mode 100644 CountryNames.hpp create mode 100644 DOCS-LICENSE.md create mode 100644 DecDataMutex.cpp create mode 100644 DecDataMutex.hpp create mode 100644 DecodeOperatingContext.hpp create mode 100644 DecodeOutputPlan.cpp create mode 100644 DecodeOutputPlan.hpp create mode 100644 DecodedMessageReaction.cpp create mode 100644 DecodedMessageReaction.hpp delete mode 100644 Decoder/decodedtext.pri create mode 100644 DecoderIpc.cpp create mode 100644 DecoderIpc.hpp create mode 100644 DecoderIpcProtocol.h create mode 100644 DecoderOutputFramer.cpp create mode 100644 DecoderOutputFramer.hpp delete mode 100644 Detector/Detector.pri create mode 100644 FastDecode.cpp create mode 100644 FastDecode.hpp create mode 100644 FoxGuardBands.cpp create mode 100644 FoxGuardBands.hpp create mode 100644 FoxOperatorActions.hpp create mode 100644 Ft8MtdDecodeCoordinator.cpp create mode 100644 Ft8MtdDecodeCoordinator.hpp create mode 100644 Ft8MtdDecodeScheduler.cpp create mode 100644 Ft8MtdDecodeScheduler.hpp create mode 100644 Ft8TxLoopbackTestController.cpp create mode 100644 Ft8TxLoopbackTestController.hpp create mode 100644 HelpText.cpp create mode 100644 HelpText.hpp create mode 100644 HighlightingRules.cpp create mode 100644 HighlightingRules.hpp create mode 100644 HoundTransmissionPolicy.cpp create mode 100644 HoundTransmissionPolicy.hpp delete mode 100644 INSTALL create mode 100644 JttyReplay.hpp create mode 100644 JttyTxLoopbackTestController.cpp create mode 100644 JttyTxLoopbackTestController.hpp create mode 100644 LiveAudioTestController.cpp create mode 100644 LiveAudioTestController.hpp create mode 100644 MessageFilter.cpp create mode 100644 MessageFilter.hpp create mode 100644 MessageFilterLogic.cpp create mode 100644 MessageFilterLogic.hpp create mode 100644 MessageFilterRules.cpp create mode 100644 MessageFilterRules.hpp create mode 100644 Modulator/JttyPcmFifo.cpp create mode 100644 Modulator/JttyPcmFifo.hpp create mode 100644 Modulator/JttyTxStream.cpp create mode 100644 Modulator/JttyTxStream.hpp delete mode 100644 Modulator/Modulator.pri create mode 100644 Network/CloudlogConfiguration.hpp create mode 100644 Network/DecodedTime.cpp create mode 100644 Network/DecodedTime.hpp delete mode 100644 Network/Network.pri delete mode 100644 Network/tests/PSKReporter/PSKReporter.IESpec delete mode 100644 Network/tests/PSKReporter/listener.py delete mode 100644 Network/tests/PSKReporter/python-ipfix.patch create mode 100644 OperatingFrequency.cpp create mode 100644 OperatingFrequency.hpp create mode 100644 PerformanceTrace.cpp create mode 100644 PerformanceTrace.hpp create mode 100644 PrefixSuffix.cpp create mode 100644 PrefixSuffix.hpp create mode 100644 QsoProgress.hpp delete mode 100644 README create mode 100644 ReceiveAudio.hpp create mode 100644 ReceiveHandoffTestController.cpp create mode 100644 ReceiveHandoffTestController.hpp create mode 100644 ReferenceSpectrum.hpp create mode 100644 RigFrequencyChangePolicy.hpp create mode 100644 Rr73Policy.cpp create mode 100644 Rr73Policy.hpp create mode 100644 SpecialOperatingActivity.hpp create mode 100644 SuperFoxTxPlanner.cpp create mode 100644 SuperFoxTxPlanner.h create mode 100644 TRADEMARK.md create mode 100644 Transceiver/HamlibMode.cpp create mode 100644 Transceiver/HamlibMode.hpp create mode 100644 Transceiver/HamlibVfoRoleState.hpp create mode 100644 Transceiver/TCIProtocol.hpp create mode 100644 Transceiver/TCIStream.hpp create mode 100644 Transceiver/TxInhibitTransceiver.cpp create mode 100644 Transceiver/TxInhibitTransceiver.hpp create mode 100644 TxStartPolicy.hpp create mode 100644 WaitFeaturePolicy.hpp create mode 100644 ci-cd/DEPLOYMENT_PLAYBOOK.md create mode 100644 ci-cd/DEVELOPMENT_WORKFLOW.md delete mode 100644 displayWidgets.txt delete mode 100644 doc/building on MS Windows.txt delete mode 100644 doc/building-Boost-libs.txt create mode 100644 doc/user_guide/en/images/jtty.png create mode 100644 doc/user_guide/en/images/map65_icon.png create mode 100644 doc/user_guide/en/images/qmap_all.png create mode 100644 doc/user_guide/en/images/qmap_icon.png create mode 100644 doc/user_guide/en/images/wsjtx_icon.png create mode 100644 doc/user_guide/en/jtty.adoc create mode 100644 doc/user_guide/en/jtty_n1mm_integration.adoc create mode 100644 doc/user_guide/en/qmap.adoc delete mode 100644 item_delegates/item_delegates.pri create mode 100644 lib/77bit/packjt77_grammar.f90 create mode 100644 lib/77bit/packjt77_schema.f90 create mode 100644 lib/decode_completion.f90 create mode 100644 lib/decoder_callbacks.f90 create mode 100644 lib/decoder_ipc_atomic.f90 create mode 100644 lib/decoder_ipc_control.cpp create mode 100644 lib/decoder_ipc_control.h delete mode 100644 lib/ft2/cdatetime.f90 delete mode 100644 lib/ft2/ft2.f90 delete mode 100644 lib/ft2/ft2.ini delete mode 100644 lib/ft2/ft2_decode.f90 delete mode 100644 lib/ft2/ft2_gfsk_iwave.f90 delete mode 100644 lib/ft2/ft2_iwave.f90 delete mode 100644 lib/ft2/ft2_params.f90 delete mode 100644 lib/ft2/ft2audio.c delete mode 100644 lib/ft2/g4.cmd delete mode 100644 lib/ft2/gcom1.f90 delete mode 100644 lib/ft2/genft2.f90 delete mode 100644 lib/ft2/getcandidates2a.f90 delete mode 100644 lib/ft2/gfsk_pulse.f90 delete mode 100644 lib/ft2/libportaudio.a delete mode 100644 lib/ft2/libwsjt_cxx.a delete mode 100644 lib/ft2/libwsjt_fort.a delete mode 100644 lib/ft2/portaudio.h delete mode 100644 lib/ft2/ptt.c delete mode 100644 lib/ft2/ptt_unix.c create mode 100644 lib/ft8var/ft8_decode_ranges.f90 create mode 100644 lib/ft8var/ft8_mtd_residual.f90 create mode 100644 lib/ft8var/ft8_tsan.c delete mode 100644 lib/ft8var/packjt77sdvar.f90 create mode 100644 lib/gfsk_pulse.f90 create mode 100644 lib/jpl_ephemeris_status.f90 create mode 100644 lib/jt9_input_validation.f90 create mode 100644 lib/jt9_params_init.f90 create mode 100644 lib/jt9_version.c create mode 100644 lib/jt9a_stub.f90 create mode 100644 lib/jtty/JTTY Messages.mc create mode 100644 lib/jtty/ana64a.f90 create mode 100644 lib/jtty/c_funcs.f90 create mode 100644 lib/jtty/cdatetime.f90 create mode 100644 lib/jtty/decodes.txt create mode 100644 lib/jtty/gen_jttywave.f90 create mode 100644 lib/jtty/gen_syncwave.f90 create mode 100644 lib/jtty/genjtty.f90 create mode 100644 lib/jtty/jtty.f90 create mode 100644 lib/jtty/jtty.ini create mode 100644 lib/jtty/jtty_block_pow.f90 create mode 100644 lib/jtty/jtty_codewords.f90 create mode 100644 lib/jtty/jtty_decode.f90 create mode 100644 lib/jtty/jtty_design.md create mode 100644 lib/jtty/jtty_design.txt create mode 100644 lib/jtty/jtty_fec_mod.f90 create mode 100644 lib/jtty/jtty_mdecode.f90 create mode 100644 lib/jtty/jtty_mod.f90 create mode 100644 lib/jtty/jtty_msgs.txt create mode 100644 lib/jtty/jtty_n1mm_integration.md create mode 100644 lib/jtty/jtty_payload_correlators.f90 create mode 100644 lib/jtty/jtty_peakup.f90 create mode 100644 lib/jtty/jtty_source_codec.f90 create mode 100644 lib/jtty/jtty_source_encoding.txt create mode 100644 lib/jtty/jtty_spec.f90 create mode 100644 lib/jtty/jtty_tbcc_code_profile.f90 create mode 100644 lib/jtty/jtty_tbcc_decoder.f90 create mode 100644 lib/jtty/jtty_tbcc_list_decoder.f90 create mode 100644 lib/jtty/jtty_tx_manual_checks.md create mode 100644 lib/jtty/jttyaudio.c create mode 100644 lib/jtty/jttycom.f90 create mode 100644 lib/jtty/portaudio.h create mode 100644 lib/jtty/rjtty.f90 create mode 100644 lib/jtty/rjtty_sub.f90 create mode 100644 lib/jtty/sjtty.f90 create mode 100644 lib/jtty/sjtty_qrm.f90 create mode 100644 lib/jtty/subtract_jtty.f90 create mode 100644 lib/jtty/tbcc.f90 create mode 100644 lib/jtty/transmit.f90 create mode 100644 lib/jtty/update.f90 create mode 100644 lib/jtty/wava/plot_results.py create mode 100644 lib/jtty/wava/rcu_bound_4fsk.f90 create mode 100644 lib/jtty/wava/tbcc_4fsk_simulation.f90 create mode 100644 lib/jtty/wava/tbcc_performance_curves.png create mode 100644 lib/lookup3.c create mode 100644 lib/lookup3.h create mode 100644 lib/msk_spectrum.f90 create mode 100644 lib/print_version.c create mode 100644 lib/qra/q65/q65_workspace.f90 delete mode 100644 lib/save_dxbase.f90 create mode 100644 lib/stream_setmode.c create mode 100644 lib/stream_stdin.c create mode 100644 lib/streaming_apply.f90 create mode 100644 lib/streaming_control.f90 create mode 100644 lib/streaming_emit.f90 create mode 100644 lib/streaming_io.f90 create mode 100644 lib/wsprd/wsprd_stream.c create mode 100644 lib/wsprd/wsprd_stream.h create mode 100644 logbook/AdifQso.cpp create mode 100644 logbook/AdifQso.hpp create mode 100644 logbook/WorkedBeforeLoadState.hpp delete mode 100644 logbook/logbook.pri create mode 100644 map65/about.qrc create mode 100644 map65/about_icon.png create mode 100644 map65/globals.h create mode 100644 map65/half_symbol_scheduler.h create mode 100644 map65/libm65/decode_request_mutex.cpp create mode 100644 map65/libm65/map65_polarization_score.f90 delete mode 100644 map65/libm65/test_astro_pipeline.f90 delete mode 100644 map65/map65.pro create mode 100644 map65/map65_decode_display_filter.cpp create mode 100644 map65/map65_decode_display_filter.h create mode 100644 map65/pskreporter_decode.cpp create mode 100644 map65/pskreporter_decode.h create mode 100644 map65/pskreporter_settings.cpp create mode 100644 map65/pskreporter_settings.h create mode 100644 map65/runtime_paths.cpp create mode 100644 map65/runtime_paths.h delete mode 100644 models/models.pri delete mode 100644 qmake_only/scs_version.h delete mode 100644 qmake_only/svnversion.h create mode 100644 qmap/about.qrc create mode 100644 qmap/about_icon.png create mode 100644 qmap/decode_click_coalescer.cpp create mode 100644 qmap/decode_click_coalescer.h create mode 100644 qmap/decode_ipc.h create mode 100644 qmap/decode_label.h create mode 100644 qmap/libqmap/qmap_decode_ipc.f90 create mode 100644 qmap/livecq_parser.cpp create mode 100644 qmap/livecq_parser.h delete mode 100644 qmap/qmap.pro create mode 100644 qmap/qmap_click_policy.h create mode 100644 qmap/qmap_decode_record.cpp create mode 100644 qmap/qmap_decode_record.h create mode 100644 qmap/qmap_ipc.h create mode 100644 qmap/shared_memory_key.h create mode 100644 qmap/vertwaterfall.cpp create mode 100644 qmap/vertwaterfall.h create mode 100644 qmap/vertwaterfall.ui create mode 100644 qmap/vplotter.cpp create mode 100644 qmap/vplotter.h create mode 100644 release-state.txt delete mode 100644 revision_utils_wsjtx.cpp create mode 100644 samples/CMakeLists.txt create mode 100644 samples/FST4+FST4W/201230_0300.wav create mode 100644 samples/FST4+FST4W/210115_0058.wav create mode 100644 samples/FT4/000000_000002.wav create mode 100644 samples/FT8/210703_133430.wav create mode 100644 samples/ISCAT/ISCAT-A/VK7MO_110401_235515.wav create mode 100644 samples/ISCAT/ISCAT-B/K0AWU_100714_115000.wav create mode 100644 samples/JT4/JT4A/DF2ZC_070926_040700.WAV create mode 100644 samples/JT4/JT4F/OK1KIR_141105_175700.WAV create mode 100644 samples/JT65/JT65B/000000_0001.wav create mode 100644 samples/JT65/JT65B/000000_0002.wav create mode 100644 samples/JT65/JT65B/000000_0003.wav create mode 100644 samples/JT65/JT65B/000000_0004.wav create mode 100644 samples/JT65/JT65B/000000_0005.wav create mode 100644 samples/JT65/JT65B/000000_0006.wav create mode 100644 samples/JT65/JT65B/000000_0007.wav create mode 100644 samples/JT65/JT65B/DL7UAE_040308_002400.wav create mode 100644 samples/JT9/130418_1742.wav create mode 100644 samples/JTTY/260807_134110.wav create mode 100644 samples/MSK144/181211_120500.wav create mode 100644 samples/MSK144/181211_120800.wav create mode 100644 samples/Q65/120D_Rainscatter_10_GHz/210117_0920.wav create mode 100644 samples/Q65/120E_Ionoscatter_6m/210130_1438.wav create mode 100644 samples/Q65/120E_Ionoscatter_6m/210130_1442.wav create mode 100644 samples/Q65/300A_Optical_Scatter/201210_0505.wav create mode 100644 samples/Q65/30A_Ionoscatter_6m/201203_022700.wav create mode 100644 samples/Q65/30A_Ionoscatter_6m/201203_022800.wav create mode 100644 samples/Q65/30A_Ionoscatter_6m/201203_022900.wav create mode 100644 samples/Q65/30A_Ionoscatter_6m/201203_024000.wav create mode 100644 samples/Q65/60A_EME_6m/210106_1621.wav create mode 100644 samples/Q65/60B_1296_Troposcatter/210109_0007.wav create mode 100644 samples/Q65/60B_1296_Troposcatter/210109_0147.wav create mode 100644 samples/Q65/60B_1296_Troposcatter/210109_0151.wav create mode 100644 samples/Q65/60D_EME_10GHz/201212_1838.wav create mode 100644 samples/QMAP/241019_0403.qm create mode 100644 samples/README create mode 100644 samples/WSPR/150426_0918.wav create mode 100644 samples/make_contents.cmake create mode 100644 test/apply_routing_test.f90 create mode 100644 test/fixtures/README.md create mode 100644 test/fixtures/fst4_210115_0058.expected.txt create mode 100644 test/fixtures/fst4w_201230_0300.expected.txt create mode 100644 test/fixtures/ft4_000000_000002.expected.txt create mode 100644 test/fixtures/ft8_210703_133430.expected.txt create mode 100644 test/fixtures/ft8_210703_133430_mtd.expected.txt create mode 100644 test/fixtures/jt4_OK1KIR_141105_175700.expected.txt create mode 100644 test/fixtures/jt65_000000_0004.expected.txt create mode 100644 test/fixtures/jt9_130418_1742.expected.txt create mode 100644 test/fixtures/msk144_181211_120800.expected.txt create mode 100644 test/fixtures/q65_300a_201210_0505.expected.txt create mode 100644 test/fixtures/q65_30a_201203_024000.expected.txt create mode 100644 test/fixtures/q65_60d_201212_1838.expected.txt create mode 100644 test/fixtures/wspr_150426_0918.expected.txt create mode 100644 test/phase4_parse_test.f90 create mode 100644 test/phase5_parse_test.f90 create mode 100644 test/phase6_parse_test.f90 create mode 100644 test/phase7_parse_test.f90 create mode 100644 test/phase8_parse_test.f90 create mode 100644 test/phase9_parse_test.f90 create mode 100755 test/run-apply-routing-unit.sh create mode 100755 test/run-golden-fixtures.sh create mode 100755 test/run-phase4-parse-unit.sh create mode 100755 test/run-phase5-parse-unit.sh create mode 100755 test/run-phase6-parse-unit.sh create mode 100755 test/run-phase7-parse-unit.sh create mode 100755 test/run-phase8-parse-unit.sh create mode 100755 test/run-phase9-parse-unit.sh create mode 100755 test/run-pr3-fixtures.sh create mode 100755 test/run-schema-v1-fixtures.sh create mode 100755 test/run-stream-wav-parity.sh create mode 100755 test/run-streaming-fixtures-no-configure.sh create mode 100755 test/run-streaming-fixtures.sh create mode 100755 test/run-wsjtx-startup-macos.sh create mode 100755 test/run-wsprd-streaming-fixtures.sh create mode 100755 test/wav_to_stream_harness.py create mode 100755 test/wav_to_stream_no_configure.py create mode 100755 test/wav_to_wsprd_stream_harness.py create mode 100644 tests/fixtures/jtty/jtty_msgs.txt create mode 100644 tests/integration/ft8/run_tx_loopback.cmake create mode 100644 tests/integration/ft8/tx_loopback.expected.txt create mode 100644 tests/integration/jt9/compare_decoder_output.cmake create mode 100644 tests/integration/jt9/compare_mtd_messages.cmake create mode 100644 tests/integration/jt9/smoke_decoder_callback.cmake create mode 100644 tests/integration/jt9/verify_elf_stack.cmake create mode 100644 tests/integration/jt9/verify_jt4_12000_read_extent.cmake create mode 100644 tests/integration/jtty/live_audio.expected.txt create mode 100644 tests/integration/jtty/run_live_audio.cmake create mode 100644 tests/integration/jtty/run_tx_loopback.cmake create mode 100644 tests/integration/jtty/tx_loopback.expected.txt create mode 100755 tests/integration/run-live-audio-parallel-experiment.sh create mode 100644 tests/integration/wsprd/compare_wsprd_output.cmake create mode 100644 tests/manual/pskreporter/PSKReporter.IESpec create mode 100644 tests/manual/pskreporter/listener.py create mode 100644 tests/manual/pskreporter/python-ipfix.patch create mode 100644 tests/release/test_git_archive.cmake create mode 100644 tests/release/test_release_state.cmake create mode 100644 tests/release/validate_release_state_fixture.cmake create mode 100644 tests/sanitizers/tsan-fortran.supp create mode 100644 tests/sanitizers/tsan-gui.supp create mode 100644 tests/sanitizers/tsan-network.supp create mode 100644 tests/sanitizers/tsan.supp delete mode 100644 tests/test_bwf_file.cpp delete mode 100644 tests/test_emulate_split_transceiver.cpp delete mode 100644 tests/test_http_user_agent.cpp delete mode 100644 tests/test_qt_helpers.cpp create mode 100644 tests/unit/audio/CMakeLists.txt create mode 100644 tests/unit/audio/receive_reference_probe.f90 create mode 100644 tests/unit/audio/test_audio_input_stream_descriptor.cpp create mode 100644 tests/unit/audio/test_bwf_file.cpp create mode 100644 tests/unit/audio/test_echosim_wav_trailer.cpp create mode 100644 tests/unit/audio/test_fast_decode_ownership.cpp create mode 100644 tests/unit/audio/test_receive_audio_handoff.cpp create mode 100644 tests/unit/audio/test_tx_audio_queue.cpp create mode 100644 tests/unit/audio/test_tx_playback_diagnostics.cpp create mode 100644 tests/unit/audio/test_tx_request.cpp create mode 100644 tests/unit/audio/test_wav_input_loading.cpp create mode 100644 tests/unit/audio/test_wav_load_coordinator.cpp create mode 100644 tests/unit/band_hopping/CMakeLists.txt create mode 100644 tests/unit/band_hopping/test_band_hopping.cpp create mode 100644 tests/unit/common/CMakeLists.txt create mode 100644 tests/unit/common/QsoReactionTestSupport.hpp create mode 100644 tests/unit/common/test_active_station_list.cpp create mode 100644 tests/unit/common/test_active_stations.cpp create mode 100644 tests/unit/common/test_auto_respond_period.cpp create mode 100644 tests/unit/common/test_auto_respond_scoring.cpp create mode 100644 tests/unit/common/test_auto_respond_selection_latch.cpp create mode 100644 tests/unit/common/test_auto_sequence_reaction.cpp create mode 100644 tests/unit/common/test_beacon_tx_controller.cpp create mode 100644 tests/unit/common/test_callsign_validator.cpp create mode 100644 tests/unit/common/test_configuration_dialog_layout.cpp create mode 100644 tests/unit/common/test_decode_output_plan.cpp create mode 100644 tests/unit/common/test_decoded_message_fields.cpp create mode 100644 tests/unit/common/test_decoded_message_reaction.cpp create mode 100644 tests/unit/common/test_decoded_time.cpp create mode 100644 tests/unit/common/test_displaytext.cpp create mode 100644 tests/unit/common/test_emulate_split_transceiver.cpp create mode 100644 tests/unit/common/test_fox_guard_bands.cpp create mode 100644 tests/unit/common/test_fox_operator_actions.cpp create mode 100644 tests/unit/common/test_frequency_editors.cpp create mode 100644 tests/unit/common/test_hamlib_mode.cpp create mode 100644 tests/unit/common/test_hamlib_vfo_role_state.cpp create mode 100644 tests/unit/common/test_highlighting_rules.cpp create mode 100644 tests/unit/common/test_hound_transmission_policy.cpp create mode 100644 tests/unit/common/test_http_user_agent.cpp create mode 100644 tests/unit/common/test_livecq_callsign.cpp create mode 100644 tests/unit/common/test_mainwindow_compact_controls.cpp create mode 100644 tests/unit/common/test_operating_frequency.cpp create mode 100644 tests/unit/common/test_qso_reaction.cpp create mode 100644 tests/unit/common/test_qsy_message_parser.cpp create mode 100644 tests/unit/common/test_qt_helpers.cpp create mode 100644 tests/unit/common/test_rig_frequency_change_policy.cpp create mode 100644 tests/unit/common/test_round_robin_selection.cpp create mode 100644 tests/unit/common/test_rr73_policy.cpp create mode 100644 tests/unit/common/test_spec_op_label.cpp create mode 100644 tests/unit/common/test_superfox_tx_planner.cpp create mode 100644 tests/unit/common/test_tx_inhibit_transceiver.cpp create mode 100644 tests/unit/common/test_tx_start_policy.cpp create mode 100644 tests/unit/common/test_wait_feature_policy.cpp create mode 100644 tests/unit/common/test_waterfall_scale.cpp create mode 100644 tests/unit/common/test_wf_palette.cpp create mode 100644 tests/unit/decoder_ipc/CMakeLists.txt create mode 100644 tests/unit/decoder_ipc/decoder_ipc_fortran_probe.f90 create mode 100644 tests/unit/decoder_ipc/test_decode_operating_context.cpp create mode 100644 tests/unit/decoder_ipc/test_decoder_ipc_protocol.cpp create mode 100644 tests/unit/decoder_ipc/test_decoder_output_framer.cpp create mode 100644 tests/unit/echo/CMakeLists.txt create mode 100644 tests/unit/echo/test_avecho_disk_metadata.f90 create mode 100644 tests/unit/echo/test_avecho_silence.f90 create mode 100644 tests/unit/echo/test_echo_morse.f90 create mode 100644 tests/unit/echo/test_echocall_input.cmake create mode 100644 tests/unit/fst4/CMakeLists.txt create mode 100644 tests/unit/fst4/test_fst4_generator.f90 create mode 100644 tests/unit/fst4/test_fst4_osd_depth.f90 create mode 100644 tests/unit/ft8/CMakeLists.txt create mode 100644 tests/unit/ft8/test_ft8_decode_ranges.f90 create mode 100644 tests/unit/ft8/test_ft8_mtd_decode_coordinator.cpp create mode 100644 tests/unit/ft8/test_ft8_mtd_decode_scheduler.cpp create mode 100644 tests/unit/ft8/test_ft8_mtd_residual.f90 create mode 100644 tests/unit/ft8/test_ft8_mtd_transaction_concurrent.f90 create mode 100644 tests/unit/hash/CMakeLists.txt create mode 100644 tests/unit/hash/test_lookup3.c create mode 100644 tests/unit/jpl/CMakeLists.txt create mode 100644 tests/unit/jpl/emedop_cross_date.txt create mode 100644 tests/unit/jpl/emedop_invalid_start.txt create mode 100644 tests/unit/jpl/test_jpl_resilience.f90 create mode 100644 tests/unit/jpl/test_jpl_setup.f90 create mode 100644 tests/unit/jt65/CMakeLists.txt create mode 100644 tests/unit/jt65/jt65_test_fixture.f90 create mode 100644 tests/unit/jt65/jt65_test_vectors.f90 create mode 100644 tests/unit/jt65/test_ccf65_correlator.f90 create mode 100644 tests/unit/jt65/test_jt65_decode_pipeline.f90 create mode 100644 tests/unit/jt65/test_jt65_source_encoding.f90 create mode 100644 tests/unit/jt65/test_jt65_xcor_silence.f90 create mode 100644 tests/unit/jt65/test_map65_jt65_candidate_consistency.f90 create mode 100644 tests/unit/jt65/test_map65_jt65_handoff.f90 create mode 100644 tests/unit/jt65/test_map65_jt65_message_validity.f90 create mode 100644 tests/unit/jt65/test_map65_s3avg_contracts.f90 create mode 100644 tests/unit/jt9/CMakeLists.txt create mode 100644 tests/unit/jt9/test_jt9_cli_validation.cmake create mode 100644 tests/unit/jt9/test_jt9_input_validation.f90 create mode 100644 tests/unit/jt9/test_readwav_validation.f90 create mode 100644 tests/unit/jtty/CMakeLists.txt create mode 100644 tests/unit/jtty/jtty_cpp_n1mm_smoke.cpp create mode 100644 tests/unit/jtty/test_jtty_adjacent_decode.f90 create mode 100644 tests/unit/jtty/test_jtty_block_pow.f90 create mode 100644 tests/unit/jtty/test_jtty_draft_acceptance.cpp create mode 100644 tests/unit/jtty/test_jtty_frequency_window.f90 create mode 100644 tests/unit/jtty/test_jtty_gap_merge.f90 create mode 100644 tests/unit/jtty/test_jtty_get_updates.f90 create mode 100644 tests/unit/jtty/test_jtty_message_matching.f90 create mode 100644 tests/unit/jtty/test_jtty_messages.cpp create mode 100644 tests/unit/jtty/test_jtty_n1mm.cpp create mode 100644 tests/unit/jtty/test_jtty_overlap_decode.f90 create mode 100644 tests/unit/jtty/test_jtty_pack.f90 create mode 100644 tests/unit/jtty/test_jtty_payload_correlators.f90 create mode 100644 tests/unit/jtty/test_jtty_receive_state.f90 create mode 100644 tests/unit/jtty/test_jtty_replay_ownership.cpp create mode 100644 tests/unit/jtty/test_jtty_source_codec.f90 create mode 100644 tests/unit/jtty/test_jtty_sticky_retry.f90 create mode 100644 tests/unit/jtty/test_jtty_structured_decode.f90 create mode 100644 tests/unit/jtty/test_jtty_surface_ranges.f90 create mode 100644 tests/unit/jtty/test_jtty_tbcc_code_profile.f90 create mode 100644 tests/unit/jtty/test_jtty_tbcc_decoder.f90 create mode 100644 tests/unit/jtty/test_jtty_tbcc_list_decoder.f90 create mode 100644 tests/unit/jtty/test_jtty_txstream.cpp create mode 100644 tests/unit/jtty/test_jtty_windowed_decode.f90 create mode 100644 tests/unit/jtty/test_mmttyif.cpp create mode 100644 tests/unit/jtty/test_tbcc.f90 create mode 100644 tests/unit/legacy72/CMakeLists.txt create mode 100644 tests/unit/legacy72/test_packjt_legacy72.f90 create mode 100644 tests/unit/logbook/CMakeLists.txt create mode 100644 tests/unit/logbook/test_logbook_adif.cpp create mode 100644 tests/unit/logbook/test_worked_before_load_state.cpp create mode 100644 tests/unit/map65/CMakeLists.txt create mode 100644 tests/unit/map65/decode_history/CMakeLists.txt create mode 100644 tests/unit/map65/decode_history/decode_history_stubs.f90 create mode 100644 tests/unit/map65/decode_history/test_map65_decode_history.f90 create mode 100644 tests/unit/map65/test_map65_astro.f90 create mode 100644 tests/unit/map65/test_map65_decode_display_filter.cpp create mode 100644 tests/unit/map65/test_map65_decode_requests.f90 create mode 100644 tests/unit/map65/test_map65_deep_search_cache.f90 create mode 100644 tests/unit/map65/test_map65_half_symbol_scheduler.cpp create mode 100644 tests/unit/map65/test_map65_q65_dphi.f90 create mode 100644 tests/unit/map65/test_map65_q65b_timeout.f90 create mode 100644 tests/unit/map65/test_map65_result_selection.f90 create mode 100644 tests/unit/map65/test_map65_runtime_paths.cpp create mode 100644 tests/unit/message_filter/CMakeLists.txt create mode 100644 tests/unit/message_filter/test_message_filter.cpp create mode 100644 tests/unit/message_filter/test_msk144_filter_rules.cpp create mode 100644 tests/unit/msk/CMakeLists.txt create mode 100644 tests/unit/msk/test_hspec_committed_boundary.f90 create mode 100644 tests/unit/msk/test_msk_spectrum_edges.f90 create mode 100644 tests/unit/network/CMakeLists.txt create mode 100644 tests/unit/network/test_cloudlog_connection_check.cpp create mode 100644 tests/unit/network/test_cloudlog_revision_stub.cpp create mode 100644 tests/unit/network/test_map65_pskreporter_decode.cpp create mode 100644 tests/unit/network/test_map65_pskreporter_settings.cpp create mode 100644 tests/unit/network/test_message_client_inhibit_status.cpp create mode 100644 tests/unit/network/test_message_client_replay.cpp create mode 100644 tests/unit/network/test_message_server.cpp create mode 100644 tests/unit/network/test_pskreporter_ipfix.cpp create mode 100644 tests/unit/network/test_pskreporter_transport.cpp create mode 100644 tests/unit/network/test_wsprnet_upload.cpp create mode 100644 tests/unit/packjt77/encode77_test_messages.txt create mode 100755 tests/unit/packjt77/lint_packjt77_idioms.sh create mode 100644 tests/unit/packjt77/packjt77_test_helpers.f90 create mode 100644 tests/unit/packjt77/silent_rewrite_corpus.txt create mode 100644 tests/unit/packjt77/test_encode77.cmake create mode 100644 tests/unit/packjt77/test_pack77_cli_fallbacks.cmake create mode 100644 tests/unit/packjt77/test_packjt77_concurrent_unpack.f90 create mode 100644 tests/unit/packjt77/test_packjt77_domain_sweeps.f90 create mode 100644 tests/unit/packjt77/test_packjt77_grammar_gate.f90 create mode 100644 tests/unit/packjt77/test_packjt77_hash_state.f90 delete mode 100644 tests/unit/packjt77/test_packjt77_hash_vectors.f90 create mode 100644 tests/unit/packjt77/test_packjt77_invariants.f90 create mode 100644 tests/unit/packjt77/test_packjt77_mutation_sweep.f90 create mode 100644 tests/unit/packjt77/test_packjt77_pack28_sweep.f90 create mode 100644 tests/unit/packjt77/test_packjt77_protocol_vectors.f90 create mode 100644 tests/unit/packjt77/test_packjt77_schema_decoder.f90 create mode 100644 tests/unit/packjt77/test_packjt77_schema_encoder.f90 create mode 100644 tests/unit/packjt77/test_packjt77_silent_rewrite_corpus.f90 create mode 100644 tests/unit/packjt77/test_packjt77sdvar_invariants.f90 create mode 100644 tests/unit/packjt77/test_packjt77var_invariants.f90 create mode 100644 tests/unit/q65/CMakeLists.txt create mode 100644 tests/unit/q65/q65_test_fixture.f90 create mode 100644 tests/unit/q65/test_map65_polarization_score.f90 create mode 100644 tests/unit/q65/test_map65_wideband_sync_rows.f90 create mode 100644 tests/unit/q65/test_q65_decode_pipeline.f90 create mode 100644 tests/unit/q65/test_q65_llh_contracts.c create mode 100644 tests/unit/q65/test_q65_source_encoding.f90 create mode 100644 tests/unit/q65/test_q65_waveform_generator.f90 create mode 100644 tests/unit/q65/test_q65_workspace.f90 create mode 100644 tests/unit/q65/test_q65code.cmake create mode 100644 tests/unit/qmap/CMakeLists.txt create mode 100644 tests/unit/qmap/test_decode_click_coalescer.cpp create mode 100644 tests/unit/qmap/test_livecq_parser.cpp create mode 100644 tests/unit/qmap/test_plotter_initialization.cpp create mode 100644 tests/unit/qmap/test_qmap_decode_record.cpp create mode 100644 tests/unit/qmap/test_qmap_ipc.cpp create mode 100644 tests/unit/streaming/CMakeLists.txt create mode 100644 tests/unit/streaming/test_streaming_consumers.cpp create mode 100644 tests/unit/superfox/CMakeLists.txt create mode 100644 tests/unit/superfox/test_superfox_pack.f90 create mode 100644 tests/unit/superfox/test_superfox_tx_handoff.f90 create mode 100644 tests/unit/superfox/test_superfox_unpack.f90 create mode 100644 tests/unit/superfox/test_superfox_unpack_unsupported.f90 create mode 100644 tests/unit/tci/CMakeLists.txt create mode 100644 tests/unit/tci/TciSimScript.cpp create mode 100644 tests/unit/tci/TciSimScript.hpp create mode 100644 tests/unit/tci/TciSimServer.cpp create mode 100644 tests/unit/tci/TciSimServer.hpp create mode 100644 tests/unit/tci/test_tci_protocol.cpp create mode 100644 tests/unit/tci/test_tci_receive_ownership.cpp create mode 100644 tests/unit/tci/test_tci_sim_smoke.cpp create mode 100644 tests/unit/tci/test_tci_stream.cpp create mode 100644 tests/unit/tci/test_tci_transceiver_characterization.cpp create mode 100644 tests/unit/tci/test_transceiver_base_period.cpp create mode 100644 tests/unit/wsprd/CMakeLists.txt create mode 100644 tests/unit/wsprd/test_wsprd_utils.c create mode 100644 translations/wsjtx_de.ts create mode 100644 translations/wsjtx_pl.ts create mode 100644 translations/wsjtx_uk.ts create mode 100644 validators/LiveCQCallsign.cpp create mode 100644 validators/LiveCQCallsign.hpp delete mode 100644 validators/validators.pri create mode 100644 widgets/BandHopping.cpp create mode 100644 widgets/BandHopping.hpp create mode 100644 widgets/CompactButtonSize.hpp create mode 100644 widgets/CurrentPageHeightStackedWidget.hpp create mode 100644 widgets/JttyDraftAcceptanceTracker.hpp create mode 100644 widgets/JttyMessages.hpp create mode 100644 widgets/JttyN1mm.hpp create mode 100644 widgets/JttyN1mmOutput.hpp create mode 100644 widgets/MMTTYIF.cpp create mode 100644 widgets/MMTTYIF.hpp create mode 100644 widgets/QSYMessageParser.cpp create mode 100644 widgets/QSYMessageParser.h create mode 100644 widgets/RoundRobinSelection.cpp create mode 100644 widgets/RoundRobinSelection.hpp create mode 100644 widgets/SettingsDialogLayout.cpp create mode 100644 widgets/SettingsDialogLayout.hpp create mode 100644 widgets/SpecOpLabel.cpp create mode 100644 widgets/SpecOpLabel.h create mode 100644 widgets/TxDriveSlider.cpp create mode 100644 widgets/TxDriveSlider.hpp create mode 100644 widgets/WaterfallScale.hpp create mode 100644 widgets/mainwindow_arrl_digi.cpp create mode 100644 widgets/mainwindow_bandhopping.cpp create mode 100644 widgets/mainwindow_jtty.cpp create mode 100644 widgets/mainwindow_settings.cpp create mode 100644 widgets/mainwindow_show_messages.cpp create mode 100644 widgets/mainwindow_slots.cpp delete mode 100644 widgets/widgets.pri delete mode 100644 wsjtx.iss delete mode 100644 wsjtx.pro create mode 100644 wsjtx_icon.webp delete mode 100644 wsjtx_opti.iss delete mode 100644 wsjtx_update.iss (limited to 'Configuration.cpp') diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..131106dc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,44 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**WSJT-X Version** +What version manifests this behavior? +- [ ] WSJT-X 2.7 +- [ ] WSJT-X 3.0.0-rc1 + +**Operating System** +What Operating System, Version, CPU (if applicable) are you using (e.g. Windows 11, MacOs 15.7/M1, Linux Debian 13) + +**What Radio and interface?** +(e.g. Elecraft K3s via USB, Flex 6400 tcpip, QDX+ via USB) + +**Does this happen WITHOUT Transmitting?** +Yes/No + +**Does this happen when transmitting with ZERO power output?** +Yes/No + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. PLEASE, PLEASE, PLEASE use a screenshot tool intead of a phone picture. Windows: Use the Windows Snipping Tool + +**Additional context** +Add any other context about the problem here. For example, if being used with N1MM Logger+, or JTAlert, information about those versions. diff --git a/.github/actions/build-linux-payload/action.yml b/.github/actions/build-linux-payload/action.yml new file mode 100644 index 00000000..f5ce1e0b --- /dev/null +++ b/.github/actions/build-linux-payload/action.yml @@ -0,0 +1,457 @@ +name: "Build Linux payload" +description: >- + Build and test wsjtx for one Linux architecture, with optional package and + artifact production. The caller decides job-container versus explicit Docker + execution; this action runs the shared native pipeline. + +inputs: + arch: + description: "Native Linux target architecture: x86_64 or aarch64" + required: true + version: + description: "WSJT-X version string" + required: true + hamlib_branch: + description: "Hamlib branch to build" + required: true + runtime_base: + description: >- + Runtime profile used to select the GCC 13.4 Bookworm toolchain. + required: false + default: "host" + recache: + description: "Manual ccache refresh; ordinary source changes do not enable it" + required: false + default: "false" + save_ccache: + description: "Save compiled objects for trusted builds" + required: false + default: "false" + validate_fortran_fallback: + description: "Build the x86_64 non-OpenMP common-library sentinel graph" + required: false + default: "false" + build_packages: + description: "Build, validate, and upload Linux packages and executable artifacts" + required: false + default: "true" + release_channel: + description: "Build release channel: DEVEL, RC, or GA" + required: false + default: "DEVEL" + rc_number: + description: "Release candidate number when release_channel is RC" + required: false + default: "" + allow_stale_image: + description: "Allow a previously promoted image when a dependency refresh changed the recipe" + required: false + default: "false" + +runs: + using: "composite" + steps: + - name: Validate workflow inputs + shell: bash + env: + WSJTX_VERSION: ${{ inputs.version }} + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + WSJT_RELEASE_CHANNEL: ${{ inputs.release_channel }} + WSJT_RC_NUMBER: ${{ inputs.rc_number }} + ARCH: ${{ inputs.arch }} + VALIDATE_FORTRAN_FALLBACK: ${{ inputs.validate_fortran_fallback }} + run: .github/scripts/validate-ci-inputs.sh + + - name: Verify Linux CI image + id: image + shell: bash + env: + WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH: ${{ inputs.allow_stale_image }} + run: >- + .github/scripts/verify-linux-ci-image.sh + normal "${{ inputs.arch }}" "${{ inputs.hamlib_branch }}" + + - name: Select Noble toolchain + if: inputs.runtime_base == 'host' + shell: bash + run: | + { + echo "CC=gcc" + echo "CXX=g++" + echo "FC=gfortran" + } >> "$GITHUB_ENV" + + - name: Select GCC 13.4 Bookworm toolchain + if: inputs.runtime_base == 'bookworm-gcc13.4' + shell: bash + run: | + CC=/usr/local/bin/gcc + CXX=/usr/local/bin/g++ + FC=/usr/local/bin/gfortran + + for compiler in "$CC" "$CXX" "$FC"; do + if [ ! -x "$compiler" ]; then + echo "::error::Expected compiler not found at $compiler" + exit 1 + fi + version=$("$compiler" -dumpfullversion -dumpversion) + echo "$compiler: $version" + if [ "$version" != "13.4.0" ]; then + echo "::error::Expected GCC 13.4.0, found $version at $compiler" + exit 1 + fi + done + + echo "CC=$CC" >> "$GITHUB_ENV" + echo "CXX=$CXX" >> "$GITHUB_ENV" + echo "FC=$FC" >> "$GITHUB_ENV" + + # Run-unique keys let a refreshed archive become the newest prefix match + # even when an immutable cache already exists for the same commit SHA. + - name: Select ccache key + id: ccache-key + shell: bash + env: + RECACHE: ${{ inputs.recache }} + run: .github/scripts/select-ccache-key-suffix.sh + + - name: Restore ccache + id: ccache + uses: actions/cache/restore@v5 + with: + path: .ccache + key: ccache-linux-${{ inputs.arch }}-${{ steps.image.outputs.ccache_compatibility_id }}-${{ steps.image.outputs.generation }}-${{ github.sha }}${{ steps.ccache-key.outputs.suffix }} + restore-keys: | + ccache-linux-${{ inputs.arch }}-${{ steps.image.outputs.ccache_compatibility_id }}-${{ steps.image.outputs.generation }}- + ccache-linux-${{ inputs.arch }}-${{ steps.image.outputs.ccache_compatibility_id }}- + + - name: Configure ccache + shell: bash + run: | + export CCACHE_DIR="${GITHUB_WORKSPACE}/.ccache" + export CCACHE_COMPILERCHECK="${{ steps.image.outputs.ccache_compiler_check }}" + { + echo "CCACHE_DIR=$CCACHE_DIR" + echo "CCACHE_COMPILERCHECK=$CCACHE_COMPILERCHECK" + } >> "$GITHUB_ENV" + echo "ccache recache: ${{ inputs.recache }}" + if [ "${{ inputs.recache }}" = "true" ]; then + echo "CCACHE_RECACHE=1" >> "$GITHUB_ENV" + echo "Forcing ccache recache for this run" + fi + mkdir -p "${GITHUB_WORKSPACE}/.ccache" + ccache --version + ccache --show-config + ccache --zero-stats + + # Exercise the public CMake default without duplicating its compile graph. + # AUTO resolves to BOTH on the OpenMP-capable Linux x86_64 toolchain. + - name: Configure default Fortran graph + if: inputs.arch == 'x86_64' + shell: bash + run: | + cmake -S . -B cfgmatrix-default \ + -DCMAKE_PREFIX_PATH="${{ steps.image.outputs.hamlib_prefix }};/opt/wsjtx/pfunit" \ + -DWSJT_SKIP_MANPAGES=ON \ + -DPFUNIT_DIR="${{ steps.image.outputs.pfunit_dir }}" \ + -Wno-dev + + - name: Configure build and tests + shell: bash + env: + WSJT_RELEASE_CHANNEL: ${{ inputs.release_channel }} + WSJT_RC_NUMBER: ${{ inputs.rc_number }} + run: | + cmake -S . -B wsjtx-build \ + -DCMAKE_PREFIX_PATH="${{ steps.image.outputs.hamlib_prefix }};/opt/wsjtx/pfunit" \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DWSJT_SKIP_MANPAGES=ON \ + -DWSJT_ENABLE_TESTS=ON \ + -DWSJT_ENABLE_GUI_SMOKE_TESTS=ON \ + -DWSJT_FORTRAN_LIBRARY_VARIANTS=OPENMP_ONLY \ + -DWSJT_RELEASE_CHANNEL="${WSJT_RELEASE_CHANNEL}" \ + -DWSJT_RC_NUMBER="${WSJT_RC_NUMBER}" \ + -DPFUNIT_DIR="${{ steps.image.outputs.pfunit_dir }}" \ + -Wno-dev + + - name: Build and test targets + shell: bash + run: cmake --build wsjtx-build -j$(nproc) + + - name: Show ccache stats + if: always() + shell: bash + run: ccache --show-stats + + # MAP65 retains target-local OpenMP while the shared WSJT Fortran library + # uses its serial variant. Run this fallback graph only on the native leg. + - name: Build non-OpenMP common-library sentinels + if: inputs.arch == 'x86_64' && inputs.validate_fortran_fallback == 'true' + shell: bash + run: | + cmake -S . -B cfgmatrix-NON_OPENMP_ONLY \ + -DCMAKE_PREFIX_PATH="${{ steps.image.outputs.hamlib_prefix }};/opt/wsjtx/pfunit" \ + -DWSJT_SKIP_MANPAGES=ON \ + -DWSJT_FORTRAN_LIBRARY_VARIANTS=NON_OPENMP_ONLY \ + -DPFUNIT_DIR="${{ steps.image.outputs.pfunit_dir }}" \ + -Wno-dev + cmake --build cfgmatrix-NON_OPENMP_ONLY \ + --target jt65sim m65impl qmap_impl test_jtty_pack \ + -j$(nproc) + + - name: Run tests + id: ctest + shell: bash + run: xvfb-run -a -s "-screen 0 1280x1024x24" ctest --parallel 3 --output-on-failure --output-junit ctest-results.xml + working-directory: wsjtx-build + env: + QT_QPA_PLATFORM: xcb + + - name: Publish test summary + if: always() && steps.ctest.conclusion != 'skipped' + shell: bash + working-directory: wsjtx-build + run: python3 ../.github/scripts/publish-ctest-summary.py "Linux ${{ inputs.arch }}" >> "$GITHUB_STEP_SUMMARY" + + - name: Upload test results + if: always() && steps.ctest.conclusion != 'skipped' + uses: actions/upload-artifact@v7 + with: + name: ctest-results-linux-${{ inputs.arch }} + path: wsjtx-build/ctest-results.xml + if-no-files-found: ignore + + - name: Verify binary + shell: bash + env: + ARCH: ${{ inputs.arch }} + run: | + source .github/scripts/linux-artifact-validation.sh + validate_linux_build_executables wsjtx-build "$ARCH" + + # CMakeLists.txt:1989-2012 enables CPack's DEB generator when + # dpkg-buildpackage is on the path (provided by dpkg-dev, installed + # above). The DEB generator ignores CPACK_PACKAGE_FILE_NAME and + # uses its own CPACK_DEBIAN_FILE_NAME (default __.deb + # → wsjtx_3.0.1_amd64.deb regardless). Override that variable to + # align the filename with the AppImage/installer naming used by + # the rest of the pipeline. + - name: Package .deb + if: inputs.build_packages == 'true' + shell: bash + env: + VERSION: ${{ inputs.version }} + ARCH: ${{ inputs.arch }} + run: | + cd wsjtx-build + cpack -G DEB \ + -D "CPACK_DEBIAN_FILE_NAME=wsjtx-${VERSION}-linux-${ARCH}.deb" + DEB="wsjtx-${VERSION}-linux-${ARCH}.deb" + if [ ! -f "$DEB" ]; then + echo "::error::cpack -G DEB produced no .deb at expected path: $DEB" + ls -la *.deb 2>/dev/null || true + exit 1 + fi + ls -lh "$DEB" + file "$DEB" + # sed instead of `| head -20` so dpkg-deb doesn't get SIGPIPE'd by + # head's early close — interacts badly with `bash -o pipefail` under + # Bookworm's dpkg-deb (observed exit 141 on first container run). + dpkg-deb --info "$DEB" | sed -n '1,20p' + source ../.github/scripts/linux-artifact-validation.sh + validate_deb_package "$DEB" + + - name: Upload .deb + if: inputs.build_packages == 'true' + uses: actions/upload-artifact@v7 + with: + name: wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }}-deb + path: wsjtx-build/wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }}.deb + if-no-files-found: error + compression-level: 0 + + # RPM builds via the same CPack scaffolding the .deb step above + # uses. CMakeLists.txt:2014-2026 already auto-detects rpmbuild and + # sets the Fedora-style dependency list (qt5-qtbase >= 5.9, fftw- + # libs-single, boost-log, etc.); only the workflow side was + # missing. `-G RPM` is explicit so this step doesn't accidentally + # rebuild the .deb already produced above. + - name: Package RPM + if: inputs.build_packages == 'true' + shell: bash + working-directory: wsjtx-build + run: | + cpack -G RPM + ls -lh *.rpm + + - name: Smoke-test RPM + if: inputs.build_packages == 'true' + shell: bash + working-directory: wsjtx-build + run: | + rpms=(*.rpm) + RPM=${rpms[0]} + echo "Querying $RPM" + rpm -qpi "$RPM" + rpm -qpR "$RPM" + source ../.github/scripts/linux-artifact-validation.sh + validate_rpm_package "$RPM" + + - name: Upload RPM + if: inputs.build_packages == 'true' + uses: actions/upload-artifact@v7 + with: + name: wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }}-rpm + path: wsjtx-build/*.rpm + if-no-files-found: error + compression-level: 0 + + - name: Install to AppDir + if: inputs.build_packages == 'true' + shell: bash + env: + ARCH: ${{ inputs.arch }} + run: | + cmake --install wsjtx-build --prefix "${GITHUB_WORKSPACE}/AppDir/usr" + source .github/scripts/linux-artifact-validation.sh + validate_linux_application_tree AppDir appdir "$ARCH" + + - name: Package AppImage + if: inputs.build_packages == 'true' + shell: bash + env: + VERSION: ${{ inputs.version }} + ARCH: ${{ inputs.arch }} + # Core linuxdeploy is pinned to a dated release. The Qt5 plugin + # stays on the rolling "continuous" channel because upstream has + # not cut a dated release since 1-alpha-20250213-1, which carries + # a filesystem_error bug on ubuntu-24.04 / Qt5.15. + LINUXDEPLOY_TAG: "1-alpha-20251107-1" + # Force every AppImage spawned by linuxdeploy (the qt plugin and + # appimagetool, both invoked as AppImages internally) to use + # `--appimage-extract-and-run` instead of expecting FUSE to be + # available. The host runner has libfuse2 installed by default so + # the plain `./linuxdeploy.AppImage --appimage-extract-and-run` + # was enough for x86_64; the Bookworm container has no FUSE and the + # plugin AppImage's first call (`--plugin-api-version`) exits 127 + # without this env var. APPIMAGE_EXTRACT_AND_RUN=1 is the + # AppImage runtime's documented FUSE-less escape hatch. + APPIMAGE_EXTRACT_AND_RUN: "1" + run: | + curl_flags=(--fail --show-error --silent --location --retry 5 --retry-delay 5) + github_api_token='${{ github.token }}' + github_api_curl() { + local api_headers=(-H "User-Agent: wsjtx-ci") + if [ -n "$github_api_token" ]; then + api_headers+=(-H "Authorization: Bearer ${github_api_token}") + env GITHUB_TOKEN="$github_api_token" curl "${curl_flags[@]}" "${api_headers[@]}" "$@" + else + curl "${curl_flags[@]}" "${api_headers[@]}" "$@" + fi + } + case "$ARCH" in + x86_64) + LINUXDEPLOY_SHA256="c20cd71e3a4e3b80c3483cef793cda3f4e990aca14014d23c544ca3ce1270b4d" + ;; + aarch64) + LINUXDEPLOY_SHA256="620095110d693282b8ebeb244a95b5e911cf8f65f76c88b4b47d16ae6346fcff" + ;; + *) echo "::error::Unknown linuxdeploy arch: $ARCH"; exit 1 ;; + esac + + QT_PLUGIN_ASSET_NAME="linuxdeploy-plugin-qt-${ARCH}.AppImage" + QT_PLUGIN_ASSET_ID="$( + github_api_curl -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/linuxdeploy/linuxdeploy-plugin-qt/releases/tags/continuous" | + python3 -c 'import json, sys; name = sys.argv[1]; matches = [asset for asset in json.load(sys.stdin)["assets"] if asset["name"] == name]; print(matches[0]["id"]) if matches else sys.exit("asset not found: " + name)' "$QT_PLUGIN_ASSET_NAME" + )" + + # Resolve the current asset ID because the Qt plugin intentionally + # follows upstream's rolling continuous release. + curl "${curl_flags[@]}" -o linuxdeploy.AppImage \ + "https://github.com/linuxdeploy/linuxdeploy/releases/download/${LINUXDEPLOY_TAG}/linuxdeploy-${ARCH}.AppImage" + github_api_curl -H "Accept: application/octet-stream" -o linuxdeploy-plugin-qt.AppImage \ + "https://api.github.com/repos/linuxdeploy/linuxdeploy-plugin-qt/releases/assets/${QT_PLUGIN_ASSET_ID}" + echo "${LINUXDEPLOY_SHA256} linuxdeploy.AppImage" | sha256sum -c - + chmod +x linuxdeploy.AppImage linuxdeploy-plugin-qt.AppImage + + # --appimage-extract-and-run on linuxdeploy itself + the env-var + # above on every child AppImage means the whole pipeline runs + # FUSE-free. + export OUTPUT="wsjtx-${VERSION}-linux-${ARCH}.AppImage" + env -u GITHUB_TOKEN ./linuxdeploy.AppImage --appimage-extract-and-run \ + --appdir AppDir \ + --plugin qt \ + --output appimage \ + --desktop-file AppDir/usr/share/applications/wsjtx.desktop \ + --icon-file AppDir/usr/share/pixmaps/wsjtx_icon.png + + ls -lh "$OUTPUT" + file "$OUTPUT" + + - name: Smoke-test AppImage payload + if: inputs.build_packages == 'true' + shell: bash + env: + VERSION: ${{ inputs.version }} + ARCH: ${{ inputs.arch }} + run: | + APPIMAGE="wsjtx-${VERSION}-linux-${ARCH}.AppImage" + ./"$APPIMAGE" --appimage-extract >/dev/null + source .github/scripts/linux-artifact-validation.sh + validate_linux_application_tree squashfs-root appimage "$ARCH" + rm -rf squashfs-root + + - name: Runtime-smoke-test AppImage + if: inputs.build_packages == 'true' + id: appimage_runtime_smoke + shell: bash + env: + VERSION: ${{ inputs.version }} + ARCH: ${{ inputs.arch }} + run: | + APPIMAGE="wsjtx-${VERSION}-linux-${ARCH}.AppImage" + LOG="wsjtx-build/appimage-startup-smoke.log" + source .github/scripts/linux-artifact-validation.sh + run_packaged_appimage_startup_smoke "./$APPIMAGE" "$LOG" + + - name: Upload AppImage startup diagnostics + if: inputs.build_packages == 'true' && failure() && steps.appimage_runtime_smoke.outcome == 'failure' + uses: actions/upload-artifact@v7 + with: + name: wsjtx-startup-smoke-linux-${{ inputs.arch }} + path: wsjtx-build/appimage-startup-smoke.log + if-no-files-found: ignore + retention-days: 7 + + - name: Upload AppImage + if: inputs.build_packages == 'true' + uses: actions/upload-artifact@v7 + with: + name: wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }}-AppImage + path: wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }}.AppImage + if-no-files-found: error + compression-level: 0 + + - name: Upload build artifacts + if: inputs.build_packages == 'true' + uses: actions/upload-artifact@v7 + with: + name: wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }} + path: | + wsjtx-build/jt9 + wsjtx-build/wsprd + wsjtx-build/wsjtx + + - name: Report suppressed ccache save + if: inputs.save_ccache == 'true' && steps.image.outputs.recipe_match != 'true' + shell: bash + run: echo "::notice::Not saving ccache because this build used a stale Linux CI image recipe" + + - name: Save ccache + if: inputs.save_ccache == 'true' && steps.image.outputs.recipe_match == 'true' && steps.ccache.outputs.cache-hit != 'true' + uses: actions/cache/save@v5 + with: + path: .ccache + key: ${{ steps.ccache.outputs.cache-primary-key }} diff --git a/.github/actions/build-linux-sanitizers/action.yml b/.github/actions/build-linux-sanitizers/action.yml new file mode 100644 index 00000000..a9a6de6e --- /dev/null +++ b/.github/actions/build-linux-sanitizers/action.yml @@ -0,0 +1,277 @@ +name: "Build Linux sanitizers" +description: >- + Build and test WSJT-X with GCC sanitizers on Linux x86_64. + +inputs: + hamlib_branch: + description: "Hamlib branch to build" + required: true + sanitizer: + description: "Sanitizer mode: asan-ubsan or tsan" + required: false + default: "asan-ubsan" + recache: + description: "Force ccache to recompile and refresh cached objects" + required: false + default: "false" + save_ccache: + description: "Save compiled objects for trusted builds" + required: false + default: "false" + allow_stale_image: + description: "Allow a previously promoted image when a dependency refresh changed the recipe" + required: false + default: "false" + +runs: + using: "composite" + steps: + - name: Validate workflow inputs + shell: bash + env: + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + run: .github/scripts/validate-ci-inputs.sh + + - name: Resolve sanitizer configuration + id: sanitizer + shell: bash + env: + SANITIZER: ${{ inputs.sanitizer }} + run: | + case "$SANITIZER" in + asan-ubsan) + echo "build_dir=wsjtx-sanitizer-build" >> "$GITHUB_OUTPUT" + echo "ccache_dir=.ccache-sanitizers" >> "$GITHUB_OUTPUT" + echo "cache_key=asan-ubsan-gcc" >> "$GITHUB_OUTPUT" + echo "cmake_option=WSJT_ENABLE_ASAN_UBSAN" >> "$GITHUB_OUTPUT" + echo "summary_name=Linux x86_64 ASan + UBSan" >> "$GITHUB_OUTPUT" + echo "artifact_name=ctest-results-linux-x86_64-asan-ubsan" >> "$GITHUB_OUTPUT" + echo "asan_options=detect_leaks=0:detect_stack_use_after_return=1:halt_on_error=1:abort_on_error=1" >> "$GITHUB_OUTPUT" + echo "ubsan_options=halt_on_error=1:print_stacktrace=1" >> "$GITHUB_OUTPUT" + echo "tsan_options=" >> "$GITHUB_OUTPUT" + ;; + tsan) + echo "build_dir=wsjtx-tsan-build" >> "$GITHUB_OUTPUT" + echo "ccache_dir=.ccache-tsan" >> "$GITHUB_OUTPUT" + echo "cache_key=tsan-gcc" >> "$GITHUB_OUTPUT" + echo "cmake_option=WSJT_ENABLE_TSAN" >> "$GITHUB_OUTPUT" + echo "summary_name=Linux x86_64 TSan" >> "$GITHUB_OUTPUT" + echo "artifact_name=ctest-results-linux-x86_64-tsan" >> "$GITHUB_OUTPUT" + echo "asan_options=" >> "$GITHUB_OUTPUT" + echo "ubsan_options=" >> "$GITHUB_OUTPUT" + tsan_suppressions="${GITHUB_WORKSPACE}/tests/sanitizers/tsan.supp" + if [ ! -f "$tsan_suppressions" ]; then + echo "::error::TSan suppressions file not found: $tsan_suppressions" + exit 1 + fi + echo "tsan_options=halt_on_error=0:second_deadlock_stack=1:suppressions=${tsan_suppressions}" >> "$GITHUB_OUTPUT" + ;; + *) + echo "::error::Unsupported sanitizer mode: $SANITIZER" + exit 1 + ;; + esac + + - name: Verify Linux CI image + id: image + shell: bash + env: + WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH: ${{ inputs.allow_stale_image }} + run: | + flavor=normal + if [ "${{ inputs.sanitizer }}" = tsan ]; then + flavor=tsan + fi + .github/scripts/verify-linux-ci-image.sh \ + "$flavor" x86_64 "${{ inputs.hamlib_branch }}" + + - name: Export TSan dependency environment + if: inputs.sanitizer == 'tsan' + shell: bash + run: | + { + echo "CC=gcc-13" + echo "CXX=g++-13" + echo "FC=gfortran-13" + echo "TSAN_QT_PREFIX=${{ steps.image.outputs.qt_prefix }}" + echo "TSAN_BOOST_PREFIX=${{ steps.image.outputs.boost_prefix }}" + echo "TSAN_HAMLIB_PREFIX=${{ steps.image.outputs.hamlib_prefix }}" + echo "TSAN_CMAKE_PREFIX_PATH=${{ steps.image.outputs.qt_prefix }};${{ steps.image.outputs.boost_prefix }};${{ steps.image.outputs.hamlib_prefix }}" + echo "LD_LIBRARY_PATH=${{ steps.image.outputs.qt_prefix }}/lib:${{ steps.image.outputs.boost_prefix }}/lib:${LD_LIBRARY_PATH:-}" + echo "PKG_CONFIG_PATH=${{ steps.image.outputs.qt_prefix }}/lib/pkgconfig:${{ steps.image.outputs.boost_prefix }}/lib/pkgconfig:${{ steps.image.outputs.hamlib_prefix }}/lib/pkgconfig:${PKG_CONFIG_PATH:-}" + echo "QT_PLUGIN_PATH=${{ steps.image.outputs.qt_prefix }}/plugins" + } >> "$GITHUB_ENV" + echo "${{ steps.image.outputs.qt_prefix }}/bin" >> "$GITHUB_PATH" + + - name: Select ccache key + id: ccache-key + shell: bash + env: + RECACHE: ${{ inputs.recache }} + run: .github/scripts/select-ccache-key-suffix.sh + + - name: Restore sanitizer objects + id: ccache + uses: actions/cache/restore@v5 + with: + path: ${{ steps.sanitizer.outputs.ccache_dir }} + key: ccache-linux-x86_64-${{ steps.sanitizer.outputs.cache_key }}-${{ steps.image.outputs.ccache_compatibility_id }}-${{ steps.image.outputs.generation }}-${{ github.sha }}${{ steps.ccache-key.outputs.suffix }} + restore-keys: | + ccache-linux-x86_64-${{ steps.sanitizer.outputs.cache_key }}-${{ steps.image.outputs.ccache_compatibility_id }}-${{ steps.image.outputs.generation }}- + ccache-linux-x86_64-${{ steps.sanitizer.outputs.cache_key }}-${{ steps.image.outputs.ccache_compatibility_id }}- + + - name: Configure ccache + shell: bash + run: | + export CCACHE_DIR="${GITHUB_WORKSPACE}/${{ steps.sanitizer.outputs.ccache_dir }}" + export CCACHE_COMPILERCHECK="${{ steps.image.outputs.ccache_compiler_check }}" + { + echo "CCACHE_DIR=$CCACHE_DIR" + echo "CCACHE_COMPILERCHECK=$CCACHE_COMPILERCHECK" + } >> "$GITHUB_ENV" + echo "ccache recache: ${{ inputs.recache }}" + if [ "${{ inputs.recache }}" = "true" ]; then + echo "CCACHE_RECACHE=1" >> "$GITHUB_ENV" + echo "Forcing ccache recache for this run" + fi + mkdir -p "$CCACHE_DIR" + ccache --version + ccache --show-config + ccache --zero-stats + + - name: Configure sanitizer build + shell: bash + run: | + prefix_path="${{ steps.image.outputs.hamlib_prefix }}" + compiler_args=() + boost_args=() + if [ "${{ inputs.sanitizer }}" = "tsan" ]; then + prefix_path="$TSAN_CMAKE_PREFIX_PATH" + compiler_args=( + -DCMAKE_C_COMPILER="$CC" + -DCMAKE_CXX_COMPILER="$CXX" + -DCMAKE_Fortran_COMPILER="$FC" + ) + boost_args=( + -DBOOST_ROOT="$TSAN_BOOST_PREFIX" + -DBoost_NO_SYSTEM_PATHS=ON + ) + fi + + cmake -S . -B "${{ steps.sanitizer.outputs.build_dir }}" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ + -DCMAKE_PREFIX_PATH="$prefix_path" \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ + -DWSJT_GENERATE_DOCS=OFF \ + -DWSJT_SKIP_MANPAGES=ON \ + -DWSJT_ENABLE_TESTS=ON \ + -DWSJT_ENABLE_GUI_SMOKE_TESTS=ON \ + -D${{ steps.sanitizer.outputs.cmake_option }}=ON \ + -DWSJT_BUILD_UTILS=OFF \ + -DWSJT_FORTRAN_LIBRARY_VARIANTS=OPENMP_ONLY \ + "${compiler_args[@]}" \ + "${boost_args[@]}" \ + -Wno-dev + + - name: Verify configured TSan dependency resolution + if: inputs.sanitizer == 'tsan' + shell: bash + run: >- + .github/scripts/verify-tsan-deps-linux.sh + "$TSAN_QT_PREFIX" + "$TSAN_BOOST_PREFIX" + "$TSAN_HAMLIB_PREFIX" + "${{ steps.sanitizer.outputs.build_dir }}/CMakeCache.txt" + + - name: Build sanitizer targets + shell: bash + run: cmake --build "${{ steps.sanitizer.outputs.build_dir }}" -j"$(nproc)" + + - name: Show ccache stats + if: always() + shell: bash + run: ccache --show-stats + + - name: Verify sanitizer instrumentation + shell: bash + run: >- + python3 .github/scripts/verify-sanitizer-instrumentation.py + "${{ steps.sanitizer.outputs.build_dir }}" + --sanitizer "${{ inputs.sanitizer }}" + + - name: Verify linked TSan dependency runtime + if: inputs.sanitizer == 'tsan' + shell: bash + run: >- + .github/scripts/verify-tsan-deps-linux.sh + "$TSAN_QT_PREFIX" + "$TSAN_BOOST_PREFIX" + "$TSAN_HAMLIB_PREFIX" + "${{ steps.sanitizer.outputs.build_dir }}/CMakeCache.txt" + "${{ steps.sanitizer.outputs.build_dir }}/wsjtx" + + - name: Prepare test scratch directory + shell: bash + run: mkdir -p "${GITHUB_WORKSPACE}/${{ steps.sanitizer.outputs.build_dir }}/tmp" + + - name: Run tests + id: ctest + continue-on-error: true + shell: bash + working-directory: ${{ steps.sanitizer.outputs.build_dir }} + env: + ASAN_OPTIONS: ${{ steps.sanitizer.outputs.asan_options }} + UBSAN_OPTIONS: ${{ steps.sanitizer.outputs.ubsan_options }} + TSAN_OPTIONS: ${{ steps.sanitizer.outputs.tsan_options }} + QT_QPA_PLATFORM: xcb + TMPDIR: ${{ github.workspace }}/${{ steps.sanitizer.outputs.build_dir }}/tmp + run: >- + xvfb-run -a -s "-screen 0 1280x1024x24" + ctest --parallel 1 --output-on-failure --output-junit ctest-results.xml + + - name: Publish test summary + if: always() && steps.ctest.outcome != 'skipped' + shell: bash + working-directory: ${{ steps.sanitizer.outputs.build_dir }} + run: >- + python3 ../.github/scripts/publish-ctest-summary.py + "${{ steps.sanitizer.outputs.summary_name }}" >> "$GITHUB_STEP_SUMMARY" + + - name: Upload test results + if: always() && steps.ctest.outcome != 'skipped' + uses: actions/upload-artifact@v7 + with: + name: ${{ steps.sanitizer.outputs.artifact_name }} + path: | + ${{ steps.sanitizer.outputs.build_dir }}/ctest-results.xml + ${{ steps.sanitizer.outputs.build_dir }}/Testing/Temporary/LastTest.log + ${{ steps.sanitizer.outputs.build_dir }}/Testing/Golden/test_jt9_mtd_ft8_210703_133430*/stderr.txt + if-no-files-found: ignore + + - name: Require sanitizer tests to pass + if: always() + shell: bash + run: | + failed=false + if [ "${{ steps.ctest.outcome }}" != "success" ]; then + echo "::error::CTest failed under ${{ steps.sanitizer.outputs.summary_name }}" + failed=true + fi + if [ "$failed" = "true" ]; then + exit 1 + fi + + - name: Report suppressed sanitizer ccache save + if: inputs.save_ccache == 'true' && steps.image.outputs.recipe_match != 'true' + shell: bash + run: echo "::notice::Not saving sanitizer ccache because this build used a stale Linux CI image recipe" + + - name: Save sanitizer objects + if: inputs.save_ccache == 'true' && steps.image.outputs.recipe_match == 'true' && steps.ccache.outputs.cache-hit != 'true' + uses: actions/cache/save@v5 + with: + path: ${{ steps.sanitizer.outputs.ccache_dir }} + key: ${{ steps.ccache.outputs.cache-primary-key }} diff --git a/.github/actions/build-windows-deps/action.yml b/.github/actions/build-windows-deps/action.yml new file mode 100644 index 00000000..9f1d2d07 --- /dev/null +++ b/.github/actions/build-windows-deps/action.yml @@ -0,0 +1,174 @@ +name: "Build Windows dependencies" +description: "Restore or populate Windows Boost, pFUnit, and Hamlib dependency caches." + +inputs: + boost_version: + description: "Boost version to build" + required: false + default: "1.91.0" + boost_source_sha256: + description: "Expected SHA-256 for the Boost source archive" + required: false + default: "de5e6b0e4913395c6bdfa90537febd9028ea4c0735d2cdb0cd9b45d5f51264f5" + windows_api_floor: + description: "Windows API floor used for Boost and WSJT-X builds" + required: false + default: "0x0601" + hamlib_branch: + description: "Hamlib branch to build" + required: true + save_caches: + description: "Whether to save dependency caches on misses" + required: false + default: "true" + +outputs: + boost_prefix: + description: "MSYS path to the Boost prefix" + value: ${{ steps.paths.outputs.boost_prefix }} + hamlib_prefix: + description: "MSYS path to the Hamlib prefix" + value: ${{ steps.paths.outputs.hamlib_prefix }} + pfunit_dir: + description: "Directory containing PFUNITConfig.cmake" + value: ${{ steps.pfunit.outputs.pfunit_dir }} + gftl_dir: + description: "Directory containing GFTLConfig.cmake" + value: ${{ steps.pfunit.outputs.gftl_dir }} + gftl_shared_dir: + description: "Directory containing GFTL_SHAREDConfig.cmake" + value: ${{ steps.pfunit.outputs.gftl_shared_dir }} + fargparse_dir: + description: "Directory containing FARGPARSEConfig.cmake" + value: ${{ steps.pfunit.outputs.fargparse_dir }} + +runs: + using: "composite" + steps: + - name: Validate workflow inputs + shell: bash + env: + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + run: .github/scripts/validate-ci-inputs.sh + + - name: Resolve dependency prefixes + id: paths + shell: msys2 {0} + run: | + WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") + { + echo "boost_prefix=${WORKSPACE}/boost-prefix" + echo "hamlib_prefix=${WORKSPACE}/hamlib-prefix" + echo "pfunit_prefix=${WORKSPACE}/pfunit-prefix" + } >> "$GITHUB_OUTPUT" + + - name: Restore Boost cache + id: boost-cache + uses: actions/cache/restore@v6 + with: + path: boost-prefix + key: boost-windows-windows-latest-mingw64-${{ inputs.boost_version }}-${{ inputs.boost_source_sha256 }}-winapi${{ inputs.windows_api_floor }}-epoch1-${{ hashFiles('.github/scripts/build-boost-windows.sh') }} + + - name: Build Boost + if: steps.boost-cache.outputs.cache-hit != 'true' + shell: msys2 {0} + run: .github/scripts/build-boost-windows.sh "${{ inputs.boost_version }}" "${{ inputs.boost_source_sha256 }}" "${{ inputs.windows_api_floor }}" "${{ steps.paths.outputs.boost_prefix }}" + + - name: Save Boost cache + if: inputs.save_caches == 'true' && steps.boost-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: boost-prefix + key: ${{ steps.boost-cache.outputs.cache-primary-key }} + + - name: Verify Boost Windows API floor + shell: msys2 {0} + run: | + boost_dlls=("${{ steps.paths.outputs.boost_prefix }}"/lib/libboost_*.dll) + if [ ! -e "${boost_dlls[0]}" ]; then + echo "::error::Boost DLLs not found under ${{ steps.paths.outputs.boost_prefix }}/lib" + ls -la "${{ steps.paths.outputs.boost_prefix }}/lib" || true + exit 1 + fi + bad=0 + for boost_dll in "${boost_dlls[@]}"; do + echo "Inspecting ${boost_dll}" + objdump -p "$boost_dll" | awk '/DLL Name:/ {print " " $3}' | sort -u + if objdump -p "$boost_dll" | awk '/WaitOnAddress|WakeByAddressSingle|WakeByAddressAll|api-ms-win-core-synch-l1-2-0\.dll/ { found=1; print } END { exit found ? 0 : 1 }'; then + echo "::error::${boost_dll} imports Windows 8+ synchronization APIs" + bad=1 + fi + done + exit "$bad" + + - name: Locate gfortran + id: fc + shell: msys2 {0} + run: echo "version=$(gfortran -dumpfullversion -dumpversion)" >> "$GITHUB_OUTPUT" + + - name: Restore pFUnit cache + id: pfunit-cache + uses: actions/cache/restore@v6 + with: + path: pfunit-prefix + key: pfunit-windows-windows-latest-mingw64-v4.14.0-gfortran${{ steps.fc.outputs.version }}-epoch1-${{ hashFiles('.github/scripts/build-pfunit-windows.sh') }} + + - name: Build pFUnit + if: steps.pfunit-cache.outputs.cache-hit != 'true' + shell: msys2 {0} + run: .github/scripts/build-pfunit-windows.sh v4.14.0 "${{ steps.paths.outputs.pfunit_prefix }}" + + - name: Locate pFUnit config + id: pfunit + shell: msys2 {0} + run: | + for pkg in PFUNIT GFTL GFTL_SHARED FARGPARSE; do + CONFIG=$(find "${{ steps.paths.outputs.pfunit_prefix }}" -name ${pkg}Config.cmake | head -1) + if [ -z "$CONFIG" ]; then + echo "ERROR: ${pkg}Config.cmake not found under pfunit-prefix" + find "${{ steps.paths.outputs.pfunit_prefix }}" -maxdepth 3 -type d + exit 1 + fi + DIR="$(dirname "$CONFIG")" + echo "Found ${pkg}Config.cmake at: $CONFIG" + echo "$(echo $pkg | tr '[:upper:]' '[:lower:]')_dir=${DIR}" >> "$GITHUB_OUTPUT" + done + + - name: Save pFUnit cache + if: inputs.save_caches == 'true' && steps.pfunit-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: pfunit-prefix + key: ${{ steps.pfunit-cache.outputs.cache-primary-key }} + + - name: Restore Hamlib cache + id: hamlib-cache + uses: actions/cache/restore@v6 + with: + path: hamlib-prefix + key: hamlib-windows-windows-latest-mingw64-${{ inputs.hamlib_branch }}-epoch2-${{ hashFiles('.github/scripts/build-hamlib-windows.sh') }} + + - name: Build Hamlib + if: steps.hamlib-cache.outputs.cache-hit != 'true' + shell: msys2 {0} + env: + MSYS2_PATH_TYPE: inherit + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + run: .github/scripts/build-hamlib-windows.sh "$HAMLIB_BRANCH" "${{ steps.paths.outputs.hamlib_prefix }}" + + - name: Verify Hamlib prefix + shell: msys2 {0} + run: | + test -f "${{ steps.paths.outputs.hamlib_prefix }}/bin/libhamlib-4.dll" + test -f "${{ steps.paths.outputs.hamlib_prefix }}/bin/rigctl.exe" + test -f "${{ steps.paths.outputs.hamlib_prefix }}/bin/rigctld.exe" + test -f "${{ steps.paths.outputs.hamlib_prefix }}/bin/rigctlcom.exe" + test -f "${{ steps.paths.outputs.hamlib_prefix }}/include/hamlib/rig.h" + test -f "${{ steps.paths.outputs.hamlib_prefix }}/lib/libhamlib.dll.a" + + - name: Save Hamlib cache + if: inputs.save_caches == 'true' && steps.hamlib-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: hamlib-prefix + key: ${{ steps.hamlib-cache.outputs.cache-primary-key }} diff --git a/.github/actions/warm-macos-deps/action.yml b/.github/actions/warm-macos-deps/action.yml new file mode 100644 index 00000000..74ef9423 --- /dev/null +++ b/.github/actions/warm-macos-deps/action.yml @@ -0,0 +1,330 @@ +name: "Warm macOS dependency caches" +description: "Restore or populate macOS Qt and pinned dependency caches without building WSJT-X." + +inputs: + arch: + description: "Target architecture: arm64 or x86_64" + required: true + runner: + description: "GitHub Actions runner label" + required: true + deployment_target: + description: "macOS deployment target version" + required: true + hamlib_branch: + description: "Hamlib branch to build" + required: true + +runs: + using: "composite" + steps: + - name: Validate workflow inputs + shell: bash + env: + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + ARCH: ${{ inputs.arch }} + DEPLOYMENT_TARGET: ${{ inputs.deployment_target }} + RUNNER: ${{ inputs.runner }} + run: .github/scripts/validate-ci-inputs.sh + + - name: Verify macOS build tuple + shell: bash + run: | + case "${{ inputs.arch }}:${{ inputs.runner }}:${{ inputs.deployment_target }}" in + arm64:macos-15:11.0|x86_64:macos-15-intel:10.13) + echo "Using supported macOS dependency tuple: ${{ inputs.arch }} on ${{ inputs.runner }} targeting ${{ inputs.deployment_target }}" + ;; + *) + echo "::error::Unsupported macOS dependency tuple: arch=${{ inputs.arch }}, runner=${{ inputs.runner }}, deployment_target=${{ inputs.deployment_target }}" + exit 1 + ;; + esac + + - name: Set Homebrew prefix + shell: bash + run: echo "HOMEBREW_PREFIX=$(brew --prefix)" >> "$GITHUB_ENV" + + - name: Install dependencies + shell: bash + run: brew install cmake autoconf automake libtool pkg-config + + - name: Compute Qt cache key + id: qt-key + shell: bash + run: | + .github/scripts/macos-qt-cache-key.sh \ + --arch "${{ inputs.arch }}" \ + --runner "${{ inputs.runner }}" \ + --deployment-target "${{ inputs.deployment_target }}" \ + --github-output + + - name: Restore Qt cache + id: qt-cache + uses: actions/cache/restore@v5 + with: + path: qt-prefix + key: ${{ steps.qt-key.outputs.key }} + + - name: Build Qt + if: steps.qt-cache.outputs.cache-hit != 'true' + shell: bash + run: | + .github/scripts/build-qt-macos.sh \ + --arch "${{ inputs.arch }}" \ + --deployment-target "${{ inputs.deployment_target }}" \ + --prefix "${GITHUB_WORKSPACE}/qt-prefix" + + - name: Save Qt cache + if: steps.qt-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v5 + with: + path: qt-prefix + key: ${{ steps.qt-cache.outputs.cache-primary-key }} + + - name: Verify Qt prefix + shell: bash + run: | + .github/scripts/verify-macos-artifacts.sh \ + --target "${{ inputs.deployment_target }}" \ + --arch "${{ inputs.arch }}" \ + --allow-prefix "${GITHUB_WORKSPACE}/qt-prefix" \ + "${GITHUB_WORKSPACE}/qt-prefix" + + - name: Install controlled ARM gfortran + id: controlled-arm-fc + if: inputs.arch == 'arm64' + shell: bash + run: | + .github/scripts/install-r-macos-gfortran.sh \ + --target "${{ inputs.deployment_target }}" \ + --arch "${{ inputs.arch }}" \ + --work-dir "${RUNNER_TEMP}/r-macos-gfortran" \ + --prefix "${GITHUB_WORKSPACE}/gfortran-prefix" \ + --github-output + + - name: Install controlled Intel gfortran + id: controlled-intel-fc + if: inputs.arch == 'x86_64' + shell: bash + run: | + .github/scripts/install-xpack-gfortran-macos.sh \ + --target "${{ inputs.deployment_target }}" \ + --arch "${{ inputs.arch }}" \ + --work-dir "${RUNNER_TEMP}/xpack-gfortran" \ + --prefix "${GITHUB_WORKSPACE}/gfortran-prefix" \ + --github-output + + - name: Select gfortran + id: fc + shell: bash + run: | + if [ "${{ inputs.arch }}" = "x86_64" ]; then + echo "Using controlled gfortran: ${{ steps.controlled-intel-fc.outputs.path }}" + { + echo "path=${{ steps.controlled-intel-fc.outputs.path }}" + echo "runtime_lib_dir=${{ steps.controlled-intel-fc.outputs.runtime_lib_dir }}" + echo "runtime_archives=${{ steps.controlled-intel-fc.outputs.runtime_archives }}" + echo "cache_key=${{ steps.controlled-intel-fc.outputs.cache_key }}" + } >> "$GITHUB_OUTPUT" + exit 0 + fi + + echo "Using controlled gfortran: ${{ steps.controlled-arm-fc.outputs.path }}" + { + echo "path=${{ steps.controlled-arm-fc.outputs.path }}" + echo "runtime_lib_dir=${{ steps.controlled-arm-fc.outputs.runtime_lib_dir }}" + echo "runtime_archives=${{ steps.controlled-arm-fc.outputs.runtime_archives }}" + echo "cache_key=${{ steps.controlled-arm-fc.outputs.cache_key }}" + } >> "$GITHUB_OUTPUT" + + - name: Verify static Fortran runtime + shell: bash + run: | + .github/scripts/verify-macos-static-archives.sh \ + --target "${{ inputs.deployment_target }}" \ + --arch "${{ inputs.arch }}" \ + --mode error \ + ${{ steps.fc.outputs.runtime_archives }} + + - name: Restore libusb cache + id: libusb-cache + uses: actions/cache/restore@v5 + with: + path: libusb-prefix + key: libusb-macos-${{ inputs.arch }}-${{ inputs.runner }}-1.0.27-min${{ inputs.deployment_target }}-epoch1-${{ hashFiles('.github/scripts/build-libusb-macos.sh') }} + + - name: Build libusb + if: steps.libusb-cache.outputs.cache-hit != 'true' + shell: bash + run: | + .github/scripts/build-libusb-macos.sh \ + 1.0.27 \ + "${{ inputs.deployment_target }}" \ + "${GITHUB_WORKSPACE}/libusb-prefix" + + - name: Save libusb cache + if: steps.libusb-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v5 + with: + path: libusb-prefix + key: ${{ steps.libusb-cache.outputs.cache-primary-key }} + + - name: Restore PortAudio cache + id: portaudio-cache + uses: actions/cache/restore@v5 + with: + path: portaudio-prefix + key: portaudio-macos-${{ inputs.arch }}-${{ inputs.runner }}-19.7.0-min${{ inputs.deployment_target }}-epoch1-${{ hashFiles('.github/scripts/build-portaudio-macos.sh') }} + + - name: Build PortAudio + if: steps.portaudio-cache.outputs.cache-hit != 'true' + shell: bash + run: | + .github/scripts/build-portaudio-macos.sh \ + 19.7.0 \ + "${{ inputs.deployment_target }}" \ + "${GITHUB_WORKSPACE}/portaudio-prefix" + + - name: Save PortAudio cache + if: steps.portaudio-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v5 + with: + path: portaudio-prefix + key: ${{ steps.portaudio-cache.outputs.cache-primary-key }} + + - name: Restore FFTW cache + id: fftw-cache + uses: actions/cache/restore@v5 + with: + path: fftw-prefix + key: fftw-macos-${{ inputs.arch }}-${{ inputs.runner }}-3.3.10-min${{ inputs.deployment_target }}-epoch1-${{ hashFiles('.github/scripts/build-fftw-macos.sh') }} + + - name: Build FFTW + if: steps.fftw-cache.outputs.cache-hit != 'true' + shell: bash + run: | + .github/scripts/build-fftw-macos.sh \ + 3.3.10 \ + "${{ inputs.deployment_target }}" \ + "${GITHUB_WORKSPACE}/fftw-prefix" + + - name: Save FFTW cache + if: steps.fftw-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v5 + with: + path: fftw-prefix + key: ${{ steps.fftw-cache.outputs.cache-primary-key }} + + - name: Restore Boost cache + id: boost-cache + uses: actions/cache/restore@v5 + with: + path: boost-prefix + key: boost-macos-${{ inputs.arch }}-${{ inputs.runner }}-1.85.0-7009fe1faa1697476bdc7027703a2badb84e849b7b0baad5086b087b971f8617-min${{ inputs.deployment_target }}-epoch1-${{ hashFiles('.github/scripts/build-boost-macos.sh') }} + + - name: Build Boost + if: steps.boost-cache.outputs.cache-hit != 'true' + shell: bash + run: | + .github/scripts/build-boost-macos.sh \ + 1.85.0 \ + 7009fe1faa1697476bdc7027703a2badb84e849b7b0baad5086b087b971f8617 \ + "${{ inputs.arch }}" \ + "${{ inputs.deployment_target }}" \ + "${GITHUB_WORKSPACE}/boost-prefix" + + - name: Save Boost cache + if: steps.boost-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v5 + with: + path: boost-prefix + key: ${{ steps.boost-cache.outputs.cache-primary-key }} + + - name: Verify pinned runtime prefixes + shell: bash + run: | + .github/scripts/verify-macos-artifacts.sh \ + --target "${{ inputs.deployment_target }}" \ + --arch "${{ inputs.arch }}" \ + --allow-prefix "${GITHUB_WORKSPACE}/libusb-prefix" \ + --allow-prefix "${GITHUB_WORKSPACE}/portaudio-prefix" \ + --allow-prefix "${GITHUB_WORKSPACE}/fftw-prefix" \ + --allow-prefix "${GITHUB_WORKSPACE}/boost-prefix" \ + "${GITHUB_WORKSPACE}/libusb-prefix" \ + "${GITHUB_WORKSPACE}/portaudio-prefix" \ + "${GITHUB_WORKSPACE}/fftw-prefix" \ + "${GITHUB_WORKSPACE}/boost-prefix" + + - name: Restore Hamlib cache + id: hamlib-cache + uses: actions/cache/restore@v5 + with: + path: hamlib-prefix + key: hamlib-macos-${{ inputs.arch }}-${{ inputs.runner }}-${{ inputs.hamlib_branch }}-libusb1.0.27-min${{ inputs.deployment_target }}-epoch1-${{ hashFiles('.github/scripts/build-hamlib-macos.sh', '.github/scripts/build-libusb-macos.sh') }} + + - name: Build Hamlib + if: steps.hamlib-cache.outputs.cache-hit != 'true' + shell: bash + env: + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + DEPLOYMENT_TARGET: ${{ inputs.deployment_target }} + run: | + .github/scripts/build-hamlib-macos.sh \ + "$HAMLIB_BRANCH" \ + "$DEPLOYMENT_TARGET" \ + "${GITHUB_WORKSPACE}/hamlib-prefix" \ + "${GITHUB_WORKSPACE}/libusb-prefix" + + - name: Verify Hamlib prefix + shell: bash + run: | + test -f "${GITHUB_WORKSPACE}/hamlib-prefix/lib/libhamlib.a" + .github/scripts/verify-macos-static-archives.sh \ + --target "${{ inputs.deployment_target }}" \ + --arch "${{ inputs.arch }}" \ + --mode error \ + "${GITHUB_WORKSPACE}/hamlib-prefix/lib/libhamlib.a" + + - name: Save Hamlib cache + if: steps.hamlib-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v5 + with: + path: hamlib-prefix + key: ${{ steps.hamlib-cache.outputs.cache-primary-key }} + + - name: Restore pFUnit cache + id: pfunit-cache + uses: actions/cache/restore@v5 + with: + path: pfunit-prefix + key: pfunit-macos-${{ inputs.arch }}-${{ inputs.runner }}-v4.14.0-${{ steps.fc.outputs.cache_key }}-min${{ inputs.deployment_target }}-epoch3-${{ hashFiles('.github/scripts/build-pfunit-macos.sh') }} + + - name: Build pFUnit + if: steps.pfunit-cache.outputs.cache-hit != 'true' + shell: bash + env: + DYLD_LIBRARY_PATH: ${{ steps.fc.outputs.runtime_lib_dir }} + run: | + .github/scripts/build-pfunit-macos.sh \ + v4.14.0 \ + "${{ steps.fc.outputs.path }}" \ + "${{ inputs.deployment_target }}" \ + "${GITHUB_WORKSPACE}/pfunit-prefix" + + - name: Locate pFUnit config + shell: bash + run: | + config=$(find "${GITHUB_WORKSPACE}/pfunit-prefix" -name PFUNITConfig.cmake -print -quit) + if [ -z "$config" ]; then + echo "ERROR: PFUNITConfig.cmake not found under pfunit-prefix" + find "${GITHUB_WORKSPACE}/pfunit-prefix" -maxdepth 3 -type d + exit 1 + fi + echo "Found PFUNITConfig.cmake at: $config" + + - name: Save pFUnit cache + if: steps.pfunit-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v5 + with: + path: pfunit-prefix + key: ${{ steps.pfunit-cache.outputs.cache-primary-key }} diff --git a/.github/cmake/armhf-toolchain.cmake b/.github/cmake/armhf-toolchain.cmake new file mode 100644 index 00000000..5a0e568e --- /dev/null +++ b/.github/cmake/armhf-toolchain.cmake @@ -0,0 +1,60 @@ +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_PROCESSOR armv7l) + +set(WSJT_ARMHF_TOOLCHAIN_PREFIX "/opt/wsjtx/armhf-toolchain" + CACHE PATH "ARMHF cross-toolchain prefix") +set(WSJT_ARMHF_SYSROOT "/opt/wsjtx/armhf-sysroot" + CACHE PATH "Debian Bookworm ARMHF sysroot") +set(WSJT_QT_HOST_PATH "/usr/lib/qt5/bin" + CACHE PATH "Native Qt 5 tools used while cross-compiling") +set(WSJT_QT_TARGET_TRANSLATIONS_DIR + "${WSJT_ARMHF_SYSROOT}/usr/share/qt5/translations" + CACHE PATH "Qt 5 target translations directory") + +set(_wsjt_armhf_triplet arm-linux-gnueabihf) +set(_wsjt_armhf_bin "${WSJT_ARMHF_TOOLCHAIN_PREFIX}/bin") +set(CMAKE_C_COMPILER "${_wsjt_armhf_bin}/${_wsjt_armhf_triplet}-gcc") +set(CMAKE_CXX_COMPILER "${_wsjt_armhf_bin}/${_wsjt_armhf_triplet}-g++") +set(CMAKE_Fortran_COMPILER "${_wsjt_armhf_bin}/${_wsjt_armhf_triplet}-gfortran") +set(CMAKE_AR "${_wsjt_armhf_bin}/${_wsjt_armhf_triplet}-ar") +set(CMAKE_NM "${_wsjt_armhf_bin}/${_wsjt_armhf_triplet}-nm") +set(CMAKE_OBJCOPY "${_wsjt_armhf_bin}/${_wsjt_armhf_triplet}-objcopy") +set(CMAKE_OBJDUMP "${_wsjt_armhf_bin}/${_wsjt_armhf_triplet}-objdump") +set(CMAKE_RANLIB "${_wsjt_armhf_bin}/${_wsjt_armhf_triplet}-ranlib") +# GNU readelf is architecture-independent, and this stable path exists in +# both the builder and ARMv7 runtime containers for CTest commands. +set(CMAKE_READELF "/usr/bin/readelf") +set(CMAKE_STRIP "${_wsjt_armhf_bin}/${_wsjt_armhf_triplet}-strip") + +set(CMAKE_SYSROOT "${WSJT_ARMHF_SYSROOT}") +set(CMAKE_LIBRARY_ARCHITECTURE "${_wsjt_armhf_triplet}") +set(CMAKE_FIND_ROOT_PATH "${WSJT_ARMHF_SYSROOT}") +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) + +# crosstool-NG uses a conventional sysroot layout. Debian keeps ARMHF +# headers and start files in triplet-qualified directories instead. +set(_wsjt_armhf_include "${WSJT_ARMHF_SYSROOT}/usr/include/${_wsjt_armhf_triplet}") +set(_wsjt_armhf_lib "${WSJT_ARMHF_SYSROOT}/usr/lib/${_wsjt_armhf_triplet}") +set(_wsjt_armhf_base_lib "${WSJT_ARMHF_SYSROOT}/lib/${_wsjt_armhf_triplet}") +set(CMAKE_C_FLAGS_INIT "-isystem ${_wsjt_armhf_include}") +set(CMAKE_CXX_FLAGS_INIT "-isystem ${_wsjt_armhf_include}") +set(_wsjt_armhf_link_flags + "-B${_wsjt_armhf_lib}/ -L${_wsjt_armhf_lib} -Wl,-rpath-link,${_wsjt_armhf_lib} -Wl,-rpath-link,${_wsjt_armhf_base_lib}") +set(CMAKE_EXE_LINKER_FLAGS_INIT "${_wsjt_armhf_link_flags}") +set(CMAKE_SHARED_LINKER_FLAGS_INIT "${_wsjt_armhf_link_flags}") +set(CMAKE_MODULE_LINKER_FLAGS_INIT "${_wsjt_armhf_link_flags}") + +set(ENV{PKG_CONFIG_SYSROOT_DIR} "${WSJT_ARMHF_SYSROOT}") +set(ENV{PKG_CONFIG_PATH} "") +set(ENV{PKG_CONFIG_LIBDIR} + "${_wsjt_armhf_lib}/pkgconfig:${WSJT_ARMHF_SYSROOT}/usr/share/pkgconfig") + +# These are target programs installed from the cross-built Hamlib staging tree. +set(RIGCTL_EXE "${WSJT_ARMHF_SYSROOT}/usr/bin/rigctl" CACHE FILEPATH "" FORCE) +set(RIGCTLD_EXE "${WSJT_ARMHF_SYSROOT}/usr/bin/rigctld" CACHE FILEPATH "" FORCE) +set(RIGCTLCOM_EXE "${WSJT_ARMHF_SYSROOT}/usr/bin/rigctlcom" CACHE FILEPATH "" FORCE) +set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE armhf CACHE STRING "" FORCE) +set(CPACK_RPM_PACKAGE_ARCHITECTURE armv7l CACHE STRING "" FORCE) diff --git a/.github/images/linux-ci/Dockerfile.armhf-cross b/.github/images/linux-ci/Dockerfile.armhf-cross new file mode 100644 index 00000000..f37d1928 --- /dev/null +++ b/.github/images/linux-ci/Dockerfile.armhf-cross @@ -0,0 +1,121 @@ +FROM debian:bookworm + +ARG IMAGE_REFRESH_EPOCH + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +ENV DEBIAN_FRONTEND=noninteractive + +COPY .github/scripts/run-apt-get.sh /usr/local/bin/run-apt-get +RUN chmod +x /usr/local/bin/run-apt-get \ + && test -n "$IMAGE_REFRESH_EPOCH" \ + && run-apt-get update \ + && run-apt-get install -y --no-install-recommends \ + asciidoctor autoconf automake binutils bison build-essential \ + ca-certificates ccache cmake curl dpkg-dev file flex gawk git gperf \ + help2man libncurses-dev libtool libtool-bin mmdebstrap patch pkg-config \ + python3 python3-dev qt5-qmake-bin qtbase5-dev-tools qttools5-dev-tools \ + qemu-user-static rsync texinfo unzip wget xz-utils \ + && run-apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +COPY .github/scripts/linux-ci-image-config.sh \ + .github/scripts/armhf-ci-image-config.sh \ + /usr/local/share/wsjtx-ci/ +COPY .github/images/linux-ci/armhf-cross-toolchain.config \ + /usr/local/share/wsjtx-ci/armhf-cross-toolchain.config + +RUN set -eux; \ + . /usr/local/share/wsjtx-ci/armhf-ci-image-config.sh; \ + curl --fail --show-error --silent --location --retry 5 \ + -o /tmp/crosstool-ng.tar.xz "$ARMHF_CROSSTOOL_NG_URL"; \ + echo "$ARMHF_CROSSTOOL_NG_SHA256 /tmp/crosstool-ng.tar.xz" | sha256sum -c -; \ + mkdir /tmp/crosstool-ng; \ + tar -xf /tmp/crosstool-ng.tar.xz -C /tmp/crosstool-ng --strip-components=1; \ + cd /tmp/crosstool-ng; \ + ./configure --prefix=/usr/local; \ + make -j"$(nproc)"; \ + make install; \ + cd /; \ + rm -rf /tmp/crosstool-ng /tmp/crosstool-ng.tar.xz; \ + useradd --create-home --shell /bin/bash wsjtx; \ + mkdir -p /tmp/wsjtx-ctng-build /var/cache/wsjtx-ctng /opt/wsjtx; \ + chown -R wsjtx:wsjtx /tmp/wsjtx-ctng-build /var/cache/wsjtx-ctng /opt/wsjtx + +ARG IMAGE_RECIPE_SHA256 +USER wsjtx +RUN --mount=type=cache,id=wsjtx-armhf-ctng-downloads,target=/var/cache/wsjtx-ctng,uid=1000,gid=1000 \ + --mount=type=cache,id=wsjtx-armhf-ctng-build-${IMAGE_RECIPE_SHA256},target=/tmp/wsjtx-ctng-build,uid=1000,gid=1000 \ + set -eux; \ + cd /tmp/wsjtx-ctng-build; \ + cp /usr/local/share/wsjtx-ci/armhf-cross-toolchain.config .config; \ + ct-ng olddefconfig; \ + # crosstool-NG prints only a summary on failure; expose the detailed compiler \ + # tail so hosted image failures can be diagnosed without reproducing locally. \ + if ! ct-ng build; then \ + tail -n 300 build.log >&2; \ + exit 1; \ + fi + +USER root +COPY .github/scripts/linux-ccache-compiler-signature.sh \ + .github/scripts/build-hamlib-armhf-cross.sh \ + .github/scripts/build-armhf-toolchain-smoke.sh \ + .github/scripts/normalize-armhf-sysroot-symlinks.sh \ + .github/scripts/write-armhf-ci-manifest.sh \ + .github/scripts/verify-armhf-ci-image.sh \ + /usr/local/share/wsjtx-ci/ +RUN set -eux; \ + chmod +x /usr/local/share/wsjtx-ci/*.sh; \ + . /usr/local/share/wsjtx-ci/armhf-ci-image-config.sh; \ + test "$("$ARMHF_TOOLCHAIN_PREFIX/bin/$ARMHF_TARGET_TRIPLET-gcc" -dumpfullversion -dumpversion)" = "$ARMHF_GCC_VERSION"; \ + test "$("$ARMHF_TOOLCHAIN_PREFIX/bin/$ARMHF_TARGET_TRIPLET-gcc" -dumpmachine)" = "$ARMHF_TARGET_TRIPLET"; \ + package_csv="$(IFS=,; echo "${ARMHF_SYSROOT_PACKAGES[*]}")"; \ + mmdebstrap --variant=extract --architectures=armhf \ + --include="$package_csv" --skip=cleanup/apt/cache \ + bookworm "$ARMHF_SYSROOT" http://deb.debian.org/debian; \ + /usr/local/share/wsjtx-ci/normalize-armhf-sysroot-symlinks.sh \ + "$ARMHF_SYSROOT"; \ + mkdir -p /opt/wsjtx-ci; \ + : > /opt/wsjtx-ci/armhf-sysroot-packages.unsorted; \ + while IFS= read -r -d '' package; do \ + dpkg-deb -f "$package" '${binary:Package}=${Version}\n' \ + >> /opt/wsjtx-ci/armhf-sysroot-packages.unsorted; \ + done < <(find "$ARMHF_SYSROOT/var/cache/apt/archives" -type f -name '*.deb' -print0); \ + LC_ALL=C sort -u /opt/wsjtx-ci/armhf-sysroot-packages.unsorted \ + > /opt/wsjtx-ci/armhf-sysroot-packages.txt; \ + rm /opt/wsjtx-ci/armhf-sysroot-packages.unsorted; \ + rm -rf "$ARMHF_SYSROOT/var/cache/apt/archives" \ + "$ARMHF_SYSROOT/var/lib/apt/lists"; \ + mkdir -p /tmp/wsjtx-hamlib-build; \ + cd /tmp/wsjtx-hamlib-build; \ + /usr/local/share/wsjtx-ci/build-hamlib-armhf-cross.sh \ + "$LINUX_HAMLIB_COMMIT" "$ARMHF_SYSROOT" "$ARMHF_TOOLCHAIN_PREFIX"; \ + mkdir -p "$ARMHF_RUNTIME_PREFIX"; \ + for library in "${ARMHF_GCC_RUNTIME_LIBRARIES[@]}"; do \ + source_path="$("$ARMHF_TOOLCHAIN_PREFIX/bin/$ARMHF_TARGET_TRIPLET-gcc" -print-file-name="$library")"; \ + test "$source_path" != "$library"; \ + cp -L "$source_path" "$ARMHF_RUNTIME_PREFIX/$library"; \ + done; \ + test "$("$ARMHF_TOOLCHAIN_PREFIX/bin/$ARMHF_TARGET_TRIPLET-gcc" -print-file-name=libquadmath.so.0)" = libquadmath.so.0; \ + /usr/local/share/wsjtx-ci/build-armhf-toolchain-smoke.sh \ + "$ARMHF_TOOLCHAIN_PREFIX" "$ARMHF_SYSROOT" /opt/wsjtx-ci/toolchain-smoke; \ + rm -rf /tmp/wsjtx-hamlib-build /home/wsjtx + +ARG IMAGE_CREATED +ARG IMAGE_GENERATION=local +ARG IMAGE_REVISION +LABEL org.opencontainers.image.created="${IMAGE_CREATED}" \ + org.opencontainers.image.revision="${IMAGE_REVISION}" \ + org.opencontainers.image.source="https://github.com/WSJTX/wsjtx-internal" \ + org.opencontainers.image.title="WSJT-X ARMHF cross-builder" \ + org.opencontainers.image.description="Native x86_64 GCC 13.4 cross-builder with a Debian Bookworm ARMHF sysroot" +RUN set -eux; \ + . /usr/local/share/wsjtx-ci/armhf-ci-image-config.sh; \ + /usr/local/share/wsjtx-ci/write-armhf-ci-manifest.sh \ + cross-builder armhf "$IMAGE_GENERATION" "$IMAGE_RECIPE_SHA256"; \ + IMAGE_RECIPE_SHA256="$IMAGE_RECIPE_SHA256" \ + /usr/local/share/wsjtx-ci/verify-armhf-ci-image.sh \ + cross-builder armhf "$LINUX_HAMLIB_REF" + +ENV PATH="/opt/wsjtx/armhf-toolchain/bin:${PATH}" +WORKDIR /work diff --git a/.github/images/linux-ci/Dockerfile.armhf-runtime b/.github/images/linux-ci/Dockerfile.armhf-runtime new file mode 100644 index 00000000..85404f0f --- /dev/null +++ b/.github/images/linux-ci/Dockerfile.armhf-runtime @@ -0,0 +1,48 @@ +ARG CROSS_BUILDER_IMAGE=wsjtx-armhf-cross:missing-build-arg +ARG CROSS_BUILDER_PLATFORM=linux/amd64 +FROM --platform=${CROSS_BUILDER_PLATFORM} ${CROSS_BUILDER_IMAGE} AS cross_builder + +FROM arm32v7/debian:bookworm + +ARG IMAGE_REFRESH_EPOCH + +ENV DEBIAN_FRONTEND=noninteractive + +COPY .github/scripts/run-apt-get.sh /usr/local/bin/run-apt-get +COPY .github/images/linux-ci/install-armhf-runtime-packages.sh \ + /usr/local/bin/install-armhf-runtime-packages +RUN chmod +x /usr/local/bin/run-apt-get /usr/local/bin/install-armhf-runtime-packages \ + && test -n "$IMAGE_REFRESH_EPOCH" \ + && /usr/local/bin/install-armhf-runtime-packages + +COPY .github/scripts/linux-ci-image-config.sh \ + .github/scripts/armhf-ci-image-config.sh \ + .github/scripts/write-armhf-ci-manifest.sh \ + .github/scripts/verify-armhf-ci-image.sh \ + /usr/local/share/wsjtx-ci/ +COPY --from=cross_builder /opt/wsjtx/armhf-runtime /opt/wsjtx/armhf-runtime +COPY --from=cross_builder /opt/wsjtx-ci/toolchain-smoke /opt/wsjtx-ci/toolchain-smoke +COPY --from=cross_builder /opt/wsjtx-ci/image.env \ + /usr/local/share/wsjtx-ci/cross-builder.env +COPY --from=cross_builder /usr/bin/qemu-arm-static /usr/local/bin/qemu-arm-static + +ARG IMAGE_CREATED +ARG IMAGE_GENERATION=local +ARG IMAGE_REVISION +ARG IMAGE_RECIPE_SHA256 +LABEL org.opencontainers.image.created="${IMAGE_CREATED}" \ + org.opencontainers.image.revision="${IMAGE_REVISION}" \ + org.opencontainers.image.source="https://github.com/WSJTX/wsjtx-internal" \ + org.opencontainers.image.title="WSJT-X ARMHF runtime validator" \ + org.opencontainers.image.description="Debian Bookworm ARMv7 packaging and runtime validation under QEMU" +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN set -eux; \ + chmod +x /usr/local/share/wsjtx-ci/*.sh; \ + . /usr/local/share/wsjtx-ci/armhf-ci-image-config.sh; \ + /usr/local/share/wsjtx-ci/write-armhf-ci-manifest.sh \ + runtime armhf "$IMAGE_GENERATION" "$IMAGE_RECIPE_SHA256"; \ + IMAGE_RECIPE_SHA256="$IMAGE_RECIPE_SHA256" \ + /usr/local/share/wsjtx-ci/verify-armhf-ci-image.sh \ + runtime armhf "$LINUX_HAMLIB_REF" + +WORKDIR /work diff --git a/.github/images/linux-ci/Dockerfile.bookworm b/.github/images/linux-ci/Dockerfile.bookworm new file mode 100644 index 00000000..f919a032 --- /dev/null +++ b/.github/images/linux-ci/Dockerfile.bookworm @@ -0,0 +1,51 @@ +ARG BASE_IMAGE=gcc:13.4.0-bookworm +FROM ${BASE_IMAGE} + +ARG IMAGE_ARCH +ARG IMAGE_CREATED +ARG IMAGE_GENERATION=local +ARG IMAGE_REVISION +ARG IMAGE_RECIPE_SHA256 +ARG IMAGE_REFRESH_EPOCH + +LABEL org.opencontainers.image.created="${IMAGE_CREATED}" \ + org.opencontainers.image.revision="${IMAGE_REVISION}" \ + org.opencontainers.image.source="https://github.com/WSJTX/wsjtx-internal" \ + org.opencontainers.image.title="WSJT-X Bookworm Linux CI" \ + org.opencontainers.image.description="GCC 13.4 Debian Bookworm environment for WSJT-X ARM CI" + +ENV DEBIAN_FRONTEND=noninteractive + +COPY .github/scripts/run-apt-get.sh /usr/local/bin/run-apt-get +COPY .github/images/linux-ci/install-packages.sh /usr/local/bin/install-packages +RUN chmod +x /usr/local/bin/run-apt-get /usr/local/bin/install-packages \ + && test -n "$IMAGE_REFRESH_EPOCH" \ + && /usr/local/bin/install-packages normal + +COPY .github/scripts/linux-ci-image-config.sh \ + .github/scripts/build-pfunit-linux.sh \ + .github/scripts/build-hamlib-linux.sh \ + .github/scripts/linux-ccache-compiler-signature.sh \ + .github/scripts/verify-linux-ci-image.sh \ + /usr/local/share/wsjtx-ci/ +COPY .github/images/linux-ci/write-manifest.sh /usr/local/bin/write-wsjtx-ci-manifest + +RUN set -eux; \ + test -n "$IMAGE_ARCH"; \ + chmod +x /usr/local/bin/write-wsjtx-ci-manifest; \ + . /usr/local/share/wsjtx-ci/linux-ci-image-config.sh; \ + mkdir -p /tmp/wsjtx-pfunit-build; \ + cd /tmp/wsjtx-pfunit-build; \ + /usr/local/share/wsjtx-ci/build-pfunit-linux.sh \ + "$LINUX_PFUNIT_COMMIT" "$LINUX_PFUNIT_PREFIX"; \ + mkdir -p /tmp/wsjtx-hamlib-build; \ + cd /tmp/wsjtx-hamlib-build; \ + /usr/local/share/wsjtx-ci/build-hamlib-linux.sh \ + "$LINUX_HAMLIB_COMMIT" "$LINUX_HAMLIB_PREFIX"; \ + cd /; \ + rm -rf /tmp/wsjtx-pfunit-build /tmp/wsjtx-hamlib-build; \ + /usr/local/bin/write-wsjtx-ci-manifest \ + normal "$IMAGE_ARCH" "$IMAGE_GENERATION" "$IMAGE_RECIPE_SHA256"; \ + IMAGE_RECIPE_SHA256="$IMAGE_RECIPE_SHA256" \ + /usr/local/share/wsjtx-ci/verify-linux-ci-image.sh \ + normal "$IMAGE_ARCH" "$LINUX_HAMLIB_REF" diff --git a/.github/images/linux-ci/Dockerfile.noble b/.github/images/linux-ci/Dockerfile.noble new file mode 100644 index 00000000..b93abc37 --- /dev/null +++ b/.github/images/linux-ci/Dockerfile.noble @@ -0,0 +1,89 @@ +ARG BASE_IMAGE=ubuntu:24.04 +FROM ${BASE_IMAGE} AS common + +ARG IMAGE_CREATED +ARG IMAGE_GENERATION=local +ARG IMAGE_REVISION +ARG IMAGE_RECIPE_SHA256 + +LABEL org.opencontainers.image.created="${IMAGE_CREATED}" \ + org.opencontainers.image.revision="${IMAGE_REVISION}" \ + org.opencontainers.image.source="https://github.com/WSJTX/wsjtx-internal" + +ENV DEBIAN_FRONTEND=noninteractive + +COPY .github/scripts/run-apt-get.sh /usr/local/bin/run-apt-get +COPY .github/images/linux-ci/install-packages.sh /usr/local/bin/install-packages +RUN chmod +x /usr/local/bin/run-apt-get /usr/local/bin/install-packages + +FROM common AS normal + +ARG IMAGE_REFRESH_EPOCH + +LABEL org.opencontainers.image.title="WSJT-X Noble Linux CI" \ + org.opencontainers.image.description="Ubuntu 24.04 build environment for WSJT-X normal and ASan/UBSan CI" + +RUN test -n "$IMAGE_REFRESH_EPOCH" && /usr/local/bin/install-packages normal + +COPY .github/scripts/linux-ci-image-config.sh \ + .github/scripts/build-pfunit-linux.sh \ + .github/scripts/build-hamlib-linux.sh \ + .github/scripts/linux-ccache-compiler-signature.sh \ + .github/scripts/verify-linux-ci-image.sh \ + /usr/local/share/wsjtx-ci/ +COPY .github/images/linux-ci/write-manifest.sh /usr/local/bin/write-wsjtx-ci-manifest + +RUN set -eux; \ + chmod +x /usr/local/bin/write-wsjtx-ci-manifest; \ + . /usr/local/share/wsjtx-ci/linux-ci-image-config.sh; \ + mkdir -p /tmp/wsjtx-pfunit-build; \ + cd /tmp/wsjtx-pfunit-build; \ + /usr/local/share/wsjtx-ci/build-pfunit-linux.sh \ + "$LINUX_PFUNIT_COMMIT" "$LINUX_PFUNIT_PREFIX"; \ + mkdir -p /tmp/wsjtx-hamlib-build; \ + cd /tmp/wsjtx-hamlib-build; \ + /usr/local/share/wsjtx-ci/build-hamlib-linux.sh \ + "$LINUX_HAMLIB_COMMIT" "$LINUX_HAMLIB_PREFIX"; \ + cd /; \ + rm -rf /tmp/wsjtx-pfunit-build /tmp/wsjtx-hamlib-build; \ + /usr/local/bin/write-wsjtx-ci-manifest \ + normal x86_64 "$IMAGE_GENERATION" "$IMAGE_RECIPE_SHA256"; \ + IMAGE_RECIPE_SHA256="$IMAGE_RECIPE_SHA256" \ + /usr/local/share/wsjtx-ci/verify-linux-ci-image.sh \ + normal x86_64 "$LINUX_HAMLIB_REF" + +FROM common AS tsan + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +ARG IMAGE_GENERATION=local +ARG IMAGE_RECIPE_SHA256 +ARG IMAGE_REFRESH_EPOCH + +LABEL org.opencontainers.image.title="WSJT-X Noble TSan CI" \ + org.opencontainers.image.description="Ubuntu 24.04 environment with TSan-instrumented WSJT-X dependencies" + +RUN test -n "$IMAGE_REFRESH_EPOCH" && /usr/local/bin/install-packages tsan + +COPY .github/scripts/linux-ci-image-config.sh \ + .github/scripts/tsan-linux-deps-config.sh \ + .github/scripts/build-qt-tsan-linux.sh \ + .github/scripts/build-boost-tsan-linux.sh \ + .github/scripts/build-hamlib-tsan-linux.sh \ + .github/scripts/linux-ccache-compiler-signature.sh \ + .github/scripts/verify-tsan-deps-linux.sh \ + .github/scripts/verify-linux-ci-image.sh \ + /usr/local/share/wsjtx-ci/ +COPY .github/images/linux-ci/write-manifest.sh /usr/local/bin/write-wsjtx-ci-manifest + +RUN set -eux; \ + chmod +x /usr/local/bin/write-wsjtx-ci-manifest; \ + . /usr/local/share/wsjtx-ci/tsan-linux-deps-config.sh; \ + /usr/local/share/wsjtx-ci/build-qt-tsan-linux.sh /opt/wsjtx/tsan/qt; \ + /usr/local/share/wsjtx-ci/build-boost-tsan-linux.sh /opt/wsjtx/tsan/boost; \ + /usr/local/share/wsjtx-ci/build-hamlib-tsan-linux.sh /opt/wsjtx/tsan/hamlib; \ + /usr/local/bin/write-wsjtx-ci-manifest \ + tsan x86_64 "$IMAGE_GENERATION" "$IMAGE_RECIPE_SHA256"; \ + IMAGE_RECIPE_SHA256="$IMAGE_RECIPE_SHA256" \ + /usr/local/share/wsjtx-ci/verify-linux-ci-image.sh \ + tsan x86_64 "$TSAN_HAMLIB_REF" diff --git a/.github/images/linux-ci/README.md b/.github/images/linux-ci/README.md new file mode 100644 index 00000000..5c3cd01a --- /dev/null +++ b/.github/images/linux-ci/README.md @@ -0,0 +1,110 @@ +# Linux CI images + +WSJT-X publishes five private, single-platform build environments to GHCR: + +| Package | Platform | CI consumers | +| --- | --- | --- | +| `wsjtx-internal/linux-noble` | `linux/amd64` | Normal and ASan/UBSan | +| `wsjtx-internal/linux-tsan-noble` | `linux/amd64` | TSan | +| `wsjtx-internal/linux-arm64-bookworm` | `linux/arm64` | aarch64 | +| `wsjtx-internal/linux-armhf-cross-bookworm` | `linux/amd64` | Native armhf cross-build | +| `wsjtx-internal/linux-armv7-bookworm` | `linux/arm/v7` | armhf tests and packaging under QEMU | + +The normal images contain the compiler, development and packaging closure, and +the slow-moving pFUnit and Hamlib prefixes. The TSan image instead contains the +pinned, instrumented Qt, Boost, and Hamlib tuple. The armhf cross-builder pairs +a native x86-64 GCC 13.4 cross-toolchain with a Debian Bookworm armhf sysroot; +its runtime partner contains only the target execution and packaging closure. +WSJT-X objects and binaries are never baked into these images. + +The Ubuntu and GCC base tags intentionally follow their maintained upstream +security updates. Each published generation records the resolved package set, +compiler identity, dependency pins, and recipe fingerprint. Normal-image +promotion is gated by image construction, the image-level checks, and a full +WSJT-X build using the exact immutable candidate. That build also publishes the +candidate generation's ccache snapshot before `stable` moves. TSan publication +is an explicit image cohort and verifies its pinned closure during the image +build; the current code-level TSan suite is not part of image promotion. + +## Publication + +`publish-linux-ci-images.yml` pushes unique candidate and immutable `build-*` +tags for the selected image cohort. Each Docker build verifies the image +manifest, dependency metadata, and a representative compile/link smoke test. +Before a normal candidate is promoted, the standard x64 WSJT-X build and test +pipeline runs against its exact `build-*` tag and saves a generation-specific +ccache archive. This prevents a new image from becoming stable without a cache +that pull requests can restore. Successful generations also receive +`validated-build-*` tags. The secondary normal-image `stable` tags move first +and `linux-noble:stable` moves last within that cohort. Consumers resolve that +pointer to its immutable `build-*` tag and use the same generation for every +normal Linux leg. + +The armhf image pair is published explicitly with `include_armhf: true`. It is +excluded from routine weekly/monthly refreshes because toolchain construction +is expensive. The pair is built, promoted, and rolled back as one generation. +Opt-in full-ci, release, and standalone armhf builds resolve the last promoted +runtime generation once and require the matching cross-builder tag; a missing +member fails explicitly. Manual full-ci can instead name an immutable candidate +generation for pre-promotion acceptance testing. + +The TSan workflow resolves `linux-tsan-noble:stable` independently when its +optional label is used. A missing TSan generation fails explicitly instead of +silently using the normal image. A TSan-only publication builds, promotes, or +rolls back only that package; it does not rebuild or retag normal or ARM images. + +Ordinary non-TSan PR and `develop` jobs may overlap a dependency refresh. They +pin the image generation resolved at job start and allow a recipe-fingerprint +mismatch with a warning, so the last known-good stable generation remains a +usable fallback while the refresh completes. Image publication, release, and +TSan jobs keep strict fingerprint checks; if no promoted generation exists, the +resolver still fails explicitly. + +The dependency refresh workflow runs image publication monthly and when image +recipes change on `develop`. Changed paths are classified from the same profile +membership used to calculate the recipe fingerprints, so normal-only and +TSan-only inputs refresh only their affected cohort while shared inputs refresh +both. The monthly refresh includes TSan; weekly and `all` refreshes omit it. +The `linux-tsan` manual target selects only TSan, while `linux` and +`linux-images` select normal and ARM64 without armhf. Use the direct publisher +workflow when explicit armhf validation is needed. A monthly epoch invalidates the +package-install layer so repository security updates are not hidden by +BuildKit's cache. The direct publisher workflow also supports +retagging a retained `validated-build-*` generation as `stable` for rollback. +Promotion and rollback are restricted to `develop`; non-promoting candidate +builds may be run from another ref. + +## ccache compatibility + +The image recipe and ccache compatibility identities intentionally answer +different questions. The recipe and legacy `toolchain_id` describe the complete +image for verification and provenance. Actions-cache keys instead use the +architecture, sanitizer profile when applicable, a `gcc-v2` +compatibility ID, and the immutable image generation. + +Within that archive, ccache uses a verified content signature covering the C +and C++ drivers, GCC frontends and LTO executable, assembler, their resolved +runtime-library closure, the target, and GCC specs. Compiler changes therefore +miss safely inside the compatible archive. +Source, flags, generated sources, and included header contents retain ccache's +normal per-object invalidation. Changes to unrelated image packages do not +discard otherwise compatible objects. + +A new generation first restores its own snapshot and then falls back to any +compatible older generation. The candidate build recompiles only genuine +misses and saves an augmented generation-specific snapshot before promotion. +Recipe-stale fallback builds may restore caches but are not allowed to save +them. + +## Retention + +The weekly retention job keeps `stable`, preserves unrecognized and untagged +versions, retains at least the newest three recognized package versions, and +deletes only recognized build, validated-build, and candidate versions older +than 60 days. Manual retention runs are dry-run only; scheduled runs apply the +printed plan. + +The Buildx jobs deliberately disable provenance and SBOM attachment. Even a +single-platform attestation is represented through an image index with +untagged child manifests, which cannot be safely classified from GitHub's +package-version REST response alone. diff --git a/.github/images/linux-ci/armhf-cross-toolchain.config b/.github/images/linux-ci/armhf-cross-toolchain.config new file mode 100644 index 00000000..e318e28a --- /dev/null +++ b/.github/images/linux-ci/armhf-cross-toolchain.config @@ -0,0 +1,30 @@ +CT_CONFIG_VERSION="4" +CT_LOCAL_TARBALLS_DIR="/var/cache/wsjtx-ctng" +CT_PREFIX_DIR="/opt/wsjtx/armhf-toolchain" +# CT_LOG_PROGRESS_BAR is not set +# CT_LOG_FILE_COMPRESS is not set +# Hosted x86_64 runners have 8 GiB; serializing the final GCC runtime-library +# build prevents libstdc++ and libgfortran from exhausting memory together. +CT_PARALLEL_JOBS=1 +# CI does not ship toolchain debug symbols, and omitting them further bounds the +# memory and image size of the slow, immutable toolchain-generation step. +CT_TARGET_CFLAGS="-g0" +CT_ARCH_ARM=y +CT_ARCH_ARM_MODE_THUMB=y +CT_OMIT_TARGET_VENDOR=y +CT_ARCH_ARCH="armv7-a+fp" +CT_ARCH_FLOAT_HW=y +CT_KERNEL_LINUX=y +CT_LINUX_V_6_1=y +CT_BINUTILS_V_2_40=y +CT_BINUTILS_LINKER_LD_GOLD=y +CT_BINUTILS_GOLD_THREADS=y +CT_BINUTILS_LD_WRAPPER=y +CT_BINUTILS_PLUGINS=y +CT_GLIBC_V_2_36=y +CT_GLIBC_KERNEL_VERSION_CHOSEN=y +CT_GLIBC_MIN_KERNEL_VERSION="3.2.0" +CT_GCC_V_13=y +CT_CC_GCC_LIBGOMP=y +CT_CC_LANG_CXX=y +CT_CC_LANG_FORTRAN=y diff --git a/.github/images/linux-ci/install-armhf-runtime-packages.sh b/.github/images/linux-ci/install-armhf-runtime-packages.sh new file mode 100755 index 00000000..a7a18e2e --- /dev/null +++ b/.github/images/linux-ci/install-armhf-runtime-packages.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -euo pipefail + +packages=( + ca-certificates curl file git python3 xz-utils + binutils cmake dpkg-dev rpm + libatomic1 libstdc++6 libgfortran5 libgomp1 + libfftw3-single3 + libboost-atomic1.74.0 libboost-chrono1.74.0 libboost-filesystem1.74.0 + libboost-log1.74.0 libboost-regex1.74.0 libboost-thread1.74.0 + libqt5widgets5 libqt5network5 libqt5multimedia5 libqt5printsupport5 libqt5test5 + libqt5multimedia5-plugins libqt5serialport5 libqt5sql5-sqlite + libqt5websockets5 qt5-qmake-bin qtbase5-dev-tools + libusb-1.0-0 libudev1 libportaudio2 + xauth xvfb +) + +/usr/local/bin/run-apt-get update +/usr/local/bin/run-apt-get install -y --no-install-recommends "${packages[@]}" +/usr/local/bin/run-apt-get clean +rm -rf /var/lib/apt/lists/* diff --git a/.github/images/linux-ci/install-packages.sh b/.github/images/linux-ci/install-packages.sh new file mode 100755 index 00000000..ed10940b --- /dev/null +++ b/.github/images/linux-ci/install-packages.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 1 ]; then + echo "Usage: install-packages.sh normal|tsan" >&2 + exit 2 +fi + +normal_packages=( + ca-certificates curl git + build-essential cmake ccache + libfftw3-dev libboost-log-dev + qtbase5-dev qttools5-dev qtmultimedia5-dev libqt5serialport5-dev + libqt5sql5-sqlite libqt5websockets5-dev + libqt5multimedia5-plugins + libusb-1.0-0-dev libudev-dev + autoconf automake libtool pkg-config + texinfo + dpkg-dev + asciidoctor + rpm + python3 + file xz-utils xauth xvfb + portaudio19-dev +) + +tsan_packages=( + ca-certificates curl git xz-utils bzip2 perl python3 + build-essential binutils cmake ccache file make pkg-config xauth xvfb + gcc-13 g++-13 gfortran-13 + autoconf automake libtool texinfo + libfftw3-dev libreadline-dev libusb-1.0-0-dev portaudio19-dev + libasound2-dev libcups2-dev libdbus-1-dev libegl1-mesa-dev + libfontconfig1-dev libfreetype-dev libgl1-mesa-dev + libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev + libpulse-dev libssl-dev libudev-dev + libx11-dev libx11-xcb-dev libxcb1-dev libxcb-glx0-dev + libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev + libxcb-randr0-dev libxcb-render-util0-dev libxcb-shape0-dev + libxcb-shm0-dev libxcb-sync-dev libxcb-xfixes0-dev + libxcb-xinerama0-dev libxcb-xkb-dev + libxext-dev libxfixes-dev libxi-dev libxrender-dev + libxkbcommon-dev libxkbcommon-x11-dev +) + +case "$1" in + normal) + packages=("${normal_packages[@]}") + if ! command -v gfortran >/dev/null 2>&1; then + packages+=(gfortran) + fi + ;; + tsan) packages=("${tsan_packages[@]}") ;; + *) + echo "Unsupported Linux CI image package profile: $1" >&2 + exit 2 + ;; +esac + +/usr/local/bin/run-apt-get update +/usr/local/bin/run-apt-get install -y --no-install-recommends "${packages[@]}" +/usr/local/bin/run-apt-get clean +rm -rf /var/lib/apt/lists/* diff --git a/.github/images/linux-ci/write-manifest.sh b/.github/images/linux-ci/write-manifest.sh new file mode 100755 index 00000000..7a28887b --- /dev/null +++ b/.github/images/linux-ci/write-manifest.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 4 ]; then + echo "Usage: write-manifest.sh FLAVOR ARCH GENERATION RECIPE_SHA256" >&2 + exit 2 +fi + +flavor=$1 +arch=$2 +generation=$3 +recipe_sha256=$4 + +# shellcheck source=.github/scripts/linux-ci-image-config.sh +. /usr/local/share/wsjtx-ci/linux-ci-image-config.sh +compiler_signature_helper=/usr/local/share/wsjtx-ci/linux-ccache-compiler-signature.sh + +case "$flavor" in + normal) + compiler=gcc + ;; + tsan) + # shellcheck source=.github/scripts/tsan-linux-deps-config.sh + . /usr/local/share/wsjtx-ci/tsan-linux-deps-config.sh + compiler=gcc-13 + ;; + *) + echo "Unsupported Linux CI image flavor: $flavor" >&2 + exit 2 + ;; +esac + +IFS=$'\t' read -r compiler_version compiler_target compiler_sha256 \ + ccache_compatibility_id compiler_signature_sha256 \ + < <("$compiler_signature_helper" "$compiler") +dpkg_arch="$(dpkg --print-architecture)" +case "$arch:$dpkg_arch" in + x86_64:amd64|aarch64:arm64|armhf:armhf) ;; + *) + echo "Image architecture mismatch: requested $arch, dpkg reports $dpkg_arch" >&2 + exit 1 + ;; +esac +package_sha256="$(dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort | sha256sum | awk '{print $1}')" +identity="$recipe_sha256:$compiler_target:$compiler_sha256:$package_sha256" +toolchain_sha256="$(printf '%s' "$identity" | sha256sum | awk '{print $1}')" +toolchain_id="gcc${compiler_version}-${arch}-${toolchain_sha256:0:20}" + +mkdir -p /opt/wsjtx-ci +{ + printf 'schema=%s\n' "$LINUX_CI_IMAGE_SCHEMA" + printf 'flavor=%s\n' "$flavor" + printf 'architecture=%s\n' "$arch" + printf 'generation=%s\n' "$generation" + printf 'compiler=%s\n' "$compiler" + printf 'compiler_version=%s\n' "$compiler_version" + printf 'compiler_sha256=%s\n' "$compiler_sha256" + printf 'compiler_target=%s\n' "$compiler_target" + printf 'dpkg_arch=%s\n' "$dpkg_arch" + printf 'package_sha256=%s\n' "$package_sha256" + printf 'recipe_sha256=%s\n' "$recipe_sha256" + printf 'toolchain_id=%s\n' "$toolchain_id" + printf 'ccache_compatibility_id=%s\n' "$ccache_compatibility_id" + printf 'compiler_signature_sha256=%s\n' "$compiler_signature_sha256" + if [ "$flavor" = normal ]; then + printf 'hamlib_ref=%s\n' "$LINUX_HAMLIB_REF" + printf 'hamlib_commit=%s\n' "$LINUX_HAMLIB_COMMIT" + printf 'pfunit_version=%s\n' "$LINUX_PFUNIT_VERSION" + printf 'pfunit_commit=%s\n' "$LINUX_PFUNIT_COMMIT" + else + printf 'hamlib_ref=%s\n' "$TSAN_HAMLIB_REF" + printf 'hamlib_commit=%s\n' "$TSAN_HAMLIB_COMMIT" + printf 'hamlib_patch_commit=%s\n' "$TSAN_HAMLIB_PATCH_COMMIT" + printf 'qt_version=%s\n' "$TSAN_QT_VERSION" + printf 'boost_version=%s\n' "$TSAN_BOOST_VERSION" + fi +} > /opt/wsjtx-ci/image.env diff --git a/.github/scripts/armhf-ci-image-config.sh b/.github/scripts/armhf-ci-image-config.sh new file mode 100755 index 00000000..6e97c2f0 --- /dev/null +++ b/.github/scripts/armhf-ci-image-config.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +# Pinned inputs shared by the ARMHF cross-builder and runtime image pair. +# shellcheck disable=SC2034 + +_armhf_config_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +# shellcheck source=.github/scripts/linux-ci-image-config.sh +. "$_armhf_config_dir/linux-ci-image-config.sh" +unset _armhf_config_dir + +ARMHF_CI_IMAGE_SCHEMA=1 +ARMHF_CROSSTOOL_NG_VERSION=1.28.0 +ARMHF_CROSSTOOL_NG_SHA256=5750e29a2bda5cd8d67900592576b1670a1987a4dcd5e4f6beae09138a1f5699 +ARMHF_CROSSTOOL_NG_URL="https://github.com/crosstool-ng/crosstool-ng/releases/download/crosstool-ng-${ARMHF_CROSSTOOL_NG_VERSION}/crosstool-ng-${ARMHF_CROSSTOOL_NG_VERSION}.tar.xz" + +ARMHF_TARGET_TRIPLET=arm-linux-gnueabihf +ARMHF_TOOLCHAIN_PREFIX=/opt/wsjtx/armhf-toolchain +ARMHF_SYSROOT=/opt/wsjtx/armhf-sysroot +ARMHF_RUNTIME_PREFIX=/opt/wsjtx/armhf-runtime +ARMHF_QEMU_EXECUTABLE=/usr/local/bin/qemu-arm-static +ARMHF_GCC_VERSION=13.4.0 +ARMHF_GLIBC_VERSION=2.36 +ARMHF_BINUTILS_VERSION=2.40 +ARMHF_LINUX_HEADERS_VERSION=6.1.147 +ARMHF_MIN_KERNEL_VERSION=3.2.0 + +ARMHF_SYSROOT_PACKAGES=( + libc6-dev libstdc++6 libgfortran5 libgomp1 libatomic1 + libfftw3-dev libboost-log-dev + qtbase5-dev qttools5-dev qtmultimedia5-dev libqt5serialport5-dev + libqt5sql5-sqlite libqt5websockets5-dev libqt5multimedia5-plugins + libusb-1.0-0-dev libudev-dev portaudio19-dev +) + +ARMHF_GCC_RUNTIME_LIBRARIES=( + libatomic.so.1 + libgcc_s.so.1 + libgfortran.so.5 + libgomp.so.1 + libstdc++.so.6 +) diff --git a/.github/scripts/armhf-static-ldd.sh b/.github/scripts/armhf-static-ldd.sh new file mode 100755 index 00000000..bb85e6f3 --- /dev/null +++ b/.github/scripts/armhf-static-ldd.sh @@ -0,0 +1,98 @@ +#!/usr/bin/env bash +set -euo pipefail + +# linuxdeploy's ldd probe crashes when an ARM loader is nested under user-mode +# QEMU. Resolve DT_NEEDED entries from the clean ARMHF runtime without executing +# the target; packaged runtime behavior is still proved by the QEMU smoke test. + +if [ "$#" -ne 1 ]; then + echo "Usage: armhf-static-ldd.sh ELF" >&2 + exit 2 +fi + +target=$1 +runtime_prefix=${WSJT_ARMHF_RUNTIME_PREFIX:-/opt/wsjtx/armhf-runtime} +search_path=${ARMHF_STATIC_LDD_LIBRARY_PATH:-} + +base_search_directories=("$runtime_prefix") +if [ -n "$search_path" ]; then + IFS=: read -r -a configured_directories <<< "$search_path" + base_search_directories+=("${configured_directories[@]}") +fi + +status=0 +declare -A resolved_libraries=() + +resolve_dependencies() { + local elf=$1 dynamic origin line directory library resolved metadata + local -a needed=() encoded_directories=() search_directories=() + + dynamic="$(readelf -dW -- "$elf")" || exit + origin="$(dirname -- "$elf")" + while IFS= read -r line; do + if [[ "$line" =~ \(NEEDED\).*Shared[[:space:]]library:[[:space:]]\[([^]]+)\] ]]; then + needed+=("${BASH_REMATCH[1]}") + elif [[ "$line" =~ \((RUNPATH|RPATH)\).*Library[[:space:]](runpath|rpath):[[:space:]]\[([^]]+)\] ]]; then + IFS=: read -r -a encoded <<< "${BASH_REMATCH[3]}" + for directory in "${encoded[@]}"; do + # shellcheck disable=SC2016 # expand the loader's literal ORIGIN token + directory=${directory//'${ORIGIN}'/$origin} + # shellcheck disable=SC2016 # expand the loader's literal ORIGIN token + directory=${directory//'$ORIGIN'/$origin} + encoded_directories+=("$directory") + done + fi + done <<< "$dynamic" + search_directories=( + "${base_search_directories[@]}" + "${encoded_directories[@]}" + /lib/arm-linux-gnueabihf + /usr/lib/arm-linux-gnueabihf + /lib + /usr/lib + ) + + for library in "${needed[@]}"; do + if [[ "$library" == libquadmath.so* ]]; then + echo "$elf unexpectedly depends on unavailable ARMHF runtime $library" >&2 + exit 1 + fi + if [ -n "${resolved_libraries[$library]:-}" ]; then + continue + fi + + resolved= + if [[ "$library" == */* ]] && [ -f "$library" ]; then + resolved=$library + else + for directory in "${search_directories[@]}"; do + if [ -f "$directory/$library" ]; then + resolved=$directory/$library + break + fi + done + fi + + if [ -z "$resolved" ]; then + printf '%s => not found (0x00000000)\n' "$library" + status=1 + continue + fi + + metadata="$(file -L -- "$resolved")" || exit + case "$metadata" in + *"ELF 32-bit"*"ARM, EABI5"*) ;; + *) + echo "$elf resolves $library to a non-ARMHF ELF: $metadata" >&2 + exit 1 + ;; + esac + resolved_libraries[$library]=$resolved + printf '%s => %s (0x00000000)\n' "$library" "$resolved" + resolve_dependencies "$resolved" + done +} + +resolve_dependencies "$target" + +exit "$status" diff --git a/.github/scripts/audit-armhf-cross-build.sh b/.github/scripts/audit-armhf-cross-build.sh new file mode 100755 index 00000000..d8088612 --- /dev/null +++ b/.github/scripts/audit-armhf-cross-build.sh @@ -0,0 +1,104 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 1 ]; then + echo "Usage: audit-armhf-cross-build.sh BUILD_DIR" >&2 + exit 2 +fi + +build_dir=$1 +toolchain_prefix=${WSJT_ARMHF_TOOLCHAIN_PREFIX:-/opt/wsjtx/armhf-toolchain} +sysroot=${WSJT_ARMHF_SYSROOT:-/opt/wsjtx/armhf-sysroot} +runtime_prefix=${WSJT_ARMHF_RUNTIME_PREFIX:-/opt/wsjtx/armhf-runtime} +triplet=arm-linux-gnueabihf +readelf="$toolchain_prefix/bin/$triplet-readelf" +object_count=0 + +while IFS= read -r -d '' object; do + headers="$("$readelf" -hW "$object")" + case "$headers" in + *"Class:"*"ELF32"*"Machine:"*"ARM"*"Version5 EABI"*) ;; + *) + echo "Target build contains a non-ARMHF object: $object" >&2 + exit 1 + ;; + esac + object_count=$((object_count + 1)) +done < <(find "$build_dir" -type f -name '*.o' -print0) +if [ "$object_count" -eq 0 ]; then + echo "No target objects found below $build_dir" >&2 + exit 1 +fi + +for tool in qmake moc uic rcc lrelease lconvert; do + metadata="$(file -L "/usr/lib/qt5/bin/$tool")" + case "$metadata" in + *"ELF 64-bit"*"x86-64"*) ;; + *) echo "Qt host tool is not x86-64: $metadata" >&2; exit 1 ;; + esac +done +for target in \ + "$sysroot/usr/lib/$triplet/libQt5Core.so.5" \ + "$sysroot/usr/lib/$triplet/libQt5Widgets.so.5" \ + "$sysroot/usr/lib/$triplet/qt5/plugins/platforms/libqxcb.so" \ + "$sysroot/usr/bin/rigctl" \ + "$sysroot/usr/bin/rigctld" \ + "$sysroot/usr/bin/rigctlcom"; do + metadata="$(file -L "$target")" + case "$metadata" in + *"ELF 32-bit"*"ARM, EABI5"*) ;; + *) echo "Target dependency has the wrong architecture: $metadata" >&2; exit 1 ;; + esac +done + +binary_count=0 +while IFS= read -r -d '' target_file; do + metadata="$(file -L "$target_file")" + case "$metadata" in + *"ELF 32-bit"*"ARM, EABI5"*) ;; + *"ELF"*) + echo "Target build contains a non-ARMHF binary: $metadata" >&2 + exit 1 + ;; + *) continue ;; + esac + dynamic="$($readelf -dW "$target_file" 2>/dev/null || true)" + if [[ "$dynamic" == *"Shared library: [libquadmath.so"* ]]; then + echo "$target_file unexpectedly depends on libquadmath" >&2 + exit 1 + fi + versions="$($readelf --version-info -W "$target_file" 2>/dev/null || true)" + if [[ "$versions" == *"GLIBC_PRIVATE"* ]]; then + echo "$target_file unexpectedly depends on a private glibc symbol" >&2 + exit 1 + fi + binary_count=$((binary_count + 1)) +done < <(find "$build_dir" -type f \( -perm /111 -o -name '*.so*' \) -print0) +if [ "$binary_count" -eq 0 ]; then + echo "No target executables or shared libraries found below $build_dir" >&2 + exit 1 +fi + +for executable in wsjtx jt9 qmap/qmap map65/map65 ft8code wsprd; do + versions="$("$readelf" --version-info -W "$build_dir/$executable")" + remaining=$versions + maximum=0 + while [[ "$remaining" =~ GLIBC_([0-9]+\.[0-9]+) ]]; do + version=${BASH_REMATCH[1]} + if dpkg --compare-versions "$version" gt "$maximum"; then + maximum=$version + fi + remaining=${remaining#*"${BASH_REMATCH[0]}"} + done + if dpkg --compare-versions "$maximum" gt 2.36; then + echo "$build_dir/$executable requires GLIBC_$maximum, newer than Bookworm" >&2 + exit 1 + fi + for runtime in libstdc++.so.6 libgcc_s.so.1 libgfortran.so.5 libgomp.so.1; do + if [[ "$versions" == *"${runtime%%.so*}"* ]]; then + test -f "$runtime_prefix/$runtime" + fi + done + echo "$executable: maximum GLIBC_$maximum" +done +echo "Audited $object_count ARMHF objects and $binary_count target binaries; Qt host tools are x86-64" diff --git a/.github/scripts/audit-staged-dll-imports-windows.sh b/.github/scripts/audit-staged-dll-imports-windows.sh index b16adaca..ca8b75f2 100644 --- a/.github/scripts/audit-staged-dll-imports-windows.sh +++ b/.github/scripts/audit-staged-dll-imports-windows.sh @@ -50,6 +50,23 @@ for exe in "$@"; do echo "(none)" fi + win7_blocked_imports=$( + objdump -p "$exe" | + awk ' + /DLL Name:/ { dll=tolower($3) } + /api-ms-win-core-synch-l1-2-0\.dll/ { print "api-ms-win-core-synch-l1-2-0.dll" } + /WaitOnAddress/ { print dll "::WaitOnAddress" } + /WakeByAddressSingle/ { print dll "::WakeByAddressSingle" } + ' | + sort -u + ) + + if [ -n "$win7_blocked_imports" ]; then + echo "::error::$exe imports Windows 8+ synchronization APIs that block Windows 7 compatibility:" + echo "$win7_blocked_imports" + fail=1 + fi + high_risk=$( echo "$imports" | awk '{ lower=tolower($0); if (lower ~ /^(libgomp|libgfortran|libgcc_s|libquadmath|libportaudio|libhamlib|libfftw|qt5.*\.dll)/) print lower }' | diff --git a/.github/scripts/build-armhf-toolchain-smoke.sh b/.github/scripts/build-armhf-toolchain-smoke.sh new file mode 100755 index 00000000..3cfaa4d2 --- /dev/null +++ b/.github/scripts/build-armhf-toolchain-smoke.sh @@ -0,0 +1,83 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 3 ]; then + echo "Usage: build-armhf-toolchain-smoke.sh TOOLCHAIN_PREFIX SYSROOT OUTPUT_DIR" >&2 + exit 2 +fi + +toolchain_prefix=$1 +sysroot=$2 +output_dir=$3 +triplet=arm-linux-gnueabihf +compiler_prefix="$toolchain_prefix/bin/$triplet" +target_include="$sysroot/usr/include/$triplet" +target_lib="$sysroot/usr/lib/$triplet" +target_base_lib="$sysroot/lib/$triplet" +common_flags=( + "--sysroot=$sysroot" + -isystem "$target_include" + "-B$target_lib/" + "-L$target_lib" + "-Wl,-rpath-link,$target_lib" + "-Wl,-rpath-link,$target_base_lib" +) + +mkdir -p "$output_dir" +source_dir="$(mktemp -d)" +trap 'rm -rf "$source_dir"' EXIT + +cat > "$source_dir/c.c" <<'EOF' +#include +#include +int main(void) { + _Atomic long long value = 41; + printf("c atomic: %lld\n", atomic_fetch_add(&value, 1) + 1); + return 0; +} +EOF +cat > "$source_dir/cxx.cpp" <<'EOF' +#include +#include +#include +int main() { + std::vector values{1, 2, 3, 4}; + std::cout << "c++ standard library: " + << std::accumulate(values.begin(), values.end(), 0) << '\n'; + return 0; +} +EOF +cat > "$source_dir/fortran.f90" <<'EOF' +program fortran_smoke + use omp_lib + implicit none + integer :: i, total + total = 0 + !$omp parallel do reduction(+:total) + do i = 1, 4 + total = total + i + end do + !$omp end parallel do + print '(A,I0)', 'fortran openmp: ', total +end program fortran_smoke +EOF + +"${compiler_prefix}-gcc" "${common_flags[@]}" "$source_dir/c.c" -latomic \ + -o "$output_dir/c-smoke" +"${compiler_prefix}-g++" "${common_flags[@]}" "$source_dir/cxx.cpp" \ + -o "$output_dir/cxx-smoke" +"${compiler_prefix}-gfortran" "${common_flags[@]}" -fopenmp \ + "$source_dir/fortran.f90" -o "$output_dir/fortran-smoke" + +for executable in "$output_dir"/*-smoke; do + metadata="$(file "$executable")" + headers="$("${compiler_prefix}-readelf" -hW "$executable")" + programs="$("${compiler_prefix}-readelf" -lW "$executable")" + case "$metadata:$headers:$programs" in + *"ELF 32-bit"*"ARM, EABI5"*"hard-float ABI"*"/lib/ld-linux-armhf.so.3"*) ;; + *) + echo "ARMHF toolchain smoke output has invalid ABI metadata: $executable" >&2 + exit 1 + ;; + esac +done diff --git a/.github/scripts/build-boost-macos.sh b/.github/scripts/build-boost-macos.sh index 06e9de1a..c3b876f0 100755 --- a/.github/scripts/build-boost-macos.sh +++ b/.github/scripts/build-boost-macos.sh @@ -1,15 +1,16 @@ #!/usr/bin/env bash set -euo pipefail -if [ "$#" -ne 4 ]; then - echo "Usage: build-boost-macos.sh VERSION ARCH DEPLOYMENT_TARGET PREFIX" >&2 +if [ "$#" -ne 5 ]; then + echo "Usage: build-boost-macos.sh VERSION SOURCE_SHA256 ARCH DEPLOYMENT_TARGET PREFIX" >&2 exit 2 fi version="$1" -arch="$2" -deployment_target="$3" -prefix="$4" +source_sha256="$2" +arch="$3" +deployment_target="$4" +prefix="$5" version_underscores=${version//./_} boost_arch=x86 @@ -17,7 +18,25 @@ if [ "$arch" = "arm64" ]; then boost_arch=arm fi +sha256_file() { + if command -v shasum >/dev/null 2>&1; then + shasum -a 256 "$1" | awk '{print $1}' + elif command -v sha256sum >/dev/null 2>&1; then + sha256sum "$1" | awk '{print $1}' + else + echo "No SHA-256 tool found; expected shasum or sha256sum" >&2 + return 1 + fi +} + curl -L --fail --retry 5 --retry-delay 10 -o boost.tar.bz2 "https://archives.boost.io/release/${version}/source/boost_${version_underscores}.tar.bz2" +actual_sha256="$(sha256_file boost.tar.bz2)" +if [ "$actual_sha256" != "$source_sha256" ]; then + echo "::error::Boost source SHA-256 mismatch" >&2 + echo "Expected: ${source_sha256}" >&2 + echo "Actual: ${actual_sha256}" >&2 + exit 1 +fi tar -xjf boost.tar.bz2 cd "boost_${version_underscores}" diff --git a/.github/scripts/build-boost-tsan-linux.sh b/.github/scripts/build-boost-tsan-linux.sh new file mode 100755 index 00000000..3139b370 --- /dev/null +++ b/.github/scripts/build-boost-tsan-linux.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 1 ]; then + echo "Usage: build-boost-tsan-linux.sh PREFIX" >&2 + exit 2 +fi + +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +# shellcheck source=.github/scripts/tsan-linux-deps-config.sh +. "${script_dir}/tsan-linux-deps-config.sh" + +prefix=$1 +tsan_require_toolchain + +if [ -e "$prefix" ] && [ -n "$(ls -A "$prefix")" ]; then + echo "Boost TSan prefix already exists and is not empty: $prefix" >&2 + exit 1 +fi + +build_root="$(mktemp -d "${RUNNER_TEMP:-/tmp}/wsjtx-boost-tsan.XXXXXX")" +archive="${build_root}/boost.tar.bz2" +version_underscores=${TSAN_BOOST_VERSION//./_} + +mkdir -p "$prefix" +curl -L --fail --retry 5 --retry-delay 10 \ + -o "$archive" "$TSAN_BOOST_SOURCE_URL" + +actual_sha256="$(sha256sum "$archive" | awk '{print $1}')" +if [ "$actual_sha256" != "$TSAN_BOOST_SOURCE_SHA256" ]; then + echo "Boost source SHA-256 mismatch" >&2 + echo "Expected: $TSAN_BOOST_SOURCE_SHA256" >&2 + echo "Actual: $actual_sha256" >&2 + exit 1 +fi + +tar -xjf "$archive" -C "$build_root" +cd "${build_root}/boost_${version_underscores}" + +printf 'using gcc : %s : %s ;\n' "$TSAN_GCC_SUFFIX" "$TSAN_CXX" > user-config.jam +./bootstrap.sh --prefix="$prefix" --with-libraries=log +./b2 -j"$(nproc)" \ + --user-config="${PWD}/user-config.jam" \ + toolset="gcc-${TSAN_GCC_SUFFIX}" \ + variant=release \ + link=shared \ + runtime-link=shared \ + threading=multi \ + cxxstd=11 \ + cxxflags="$TSAN_SANITIZER_FLAGS" \ + linkflags="$TSAN_LINK_FLAGS" \ + --layout=system \ + install + +tsan_write_dependency_manifest boost "$prefix" diff --git a/.github/scripts/build-boost-windows.sh b/.github/scripts/build-boost-windows.sh new file mode 100755 index 00000000..0e56b920 --- /dev/null +++ b/.github/scripts/build-boost-windows.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 4 ]; then + echo "Usage: build-boost-windows.sh VERSION SOURCE_SHA256 WIN32_WINNT PREFIX" >&2 + exit 2 +fi + +version="$1" +source_sha256="$2" +win32_winnt="$3" +prefix="$4" +version_underscores=${version//./_} +api_floor_flags="-D_WIN32_WINNT=${win32_winnt} -DWINVER=${win32_winnt} -DBOOST_USE_WINAPI_VERSION=${win32_winnt}" +install_prefix=$(cygpath -m "$prefix") + +sha256_file() { + if command -v sha256sum >/dev/null 2>&1; then + sha256sum "$1" | awk '{print $1}' + elif command -v shasum >/dev/null 2>&1; then + shasum -a 256 "$1" | awk '{print $1}' + else + echo "No SHA-256 tool found; expected sha256sum or shasum" >&2 + return 1 + fi +} + +curl -L --fail --retry 5 --retry-delay 10 -o boost.tar.bz2 "https://archives.boost.io/release/${version}/source/boost_${version_underscores}.tar.bz2" +actual_sha256="$(sha256_file boost.tar.bz2)" +if [ "$actual_sha256" != "$source_sha256" ]; then + echo "::error::Boost source SHA-256 mismatch" >&2 + echo "Expected: ${source_sha256}" >&2 + echo "Actual: ${actual_sha256}" >&2 + exit 1 +fi +tar -xjf boost.tar.bz2 +cd "boost_${version_underscores}" + +python3 - <<'PY' +from pathlib import Path + +platform = Path("boost/atomic/detail/platform.hpp") +text = platform.read_text() +old = """#if defined(BOOST_WINDOWS) + +#define BOOST_ATOMIC_DETAIL_WAIT_BACKEND windows + +#else // defined(BOOST_WINDOWS) +""" +new = """#if defined(BOOST_WINDOWS) + +#include +#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN8 +#define BOOST_ATOMIC_DETAIL_WAIT_BACKEND windows +#endif + +#else // defined(BOOST_WINDOWS) +""" +if old not in text: + raise SystemExit("Boost.Atomic Windows wait backend block not found") +platform.write_text(text.replace(old, new, 1)) + +jamfile = Path("libs/atomic/build/Jamfile.v2") +text = jamfile.read_text() +for line in ( + " windows:synchronization\n", + " gcc,windows:_WIN32_WINNT=0x0A00\n", +): + if line not in text: + raise SystemExit(f"Boost.Atomic Jamfile line not found: {line.rstrip()}") + text = text.replace(line, "", 2) +jamfile.write_text(text) +PY + +./bootstrap.sh --prefix="$install_prefix" --with-libraries=log +./b2 --with-log -j"$(nproc)" \ + toolset=gcc \ + variant=release \ + link=shared \ + runtime-link=shared \ + threading=multi \ + cxxstd=11 \ + address-model=64 \ + --layout=tagged \ + cflags="${api_floor_flags}" \ + cxxflags="${api_floor_flags}" \ + install diff --git a/.github/scripts/build-hamlib-armhf-cross.sh b/.github/scripts/build-hamlib-armhf-cross.sh new file mode 100755 index 00000000..00e80453 --- /dev/null +++ b/.github/scripts/build-hamlib-armhf-cross.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 3 ]; then + echo "Usage: build-hamlib-armhf-cross.sh COMMIT SYSROOT TOOLCHAIN_PREFIX" >&2 + exit 2 +fi + +commit=$1 +sysroot=$2 +toolchain_prefix=$3 +triplet=arm-linux-gnueabihf +target_include="$sysroot/usr/include/$triplet" +target_lib="$sysroot/usr/lib/$triplet" +target_base_lib="$sysroot/lib/$triplet" + +export PATH="$toolchain_prefix/bin:$PATH" +export PKG_CONFIG_SYSROOT_DIR="$sysroot" +export PKG_CONFIG_PATH= +export PKG_CONFIG_LIBDIR="$target_lib/pkgconfig:$sysroot/usr/share/pkgconfig" + +git init hamlib-src +git -C hamlib-src remote add origin https://github.com/Hamlib/Hamlib.git +git -C hamlib-src fetch --depth 1 origin "$commit" +git -C hamlib-src checkout --detach FETCH_HEAD +actual_commit="$(git -C hamlib-src rev-parse HEAD)" +if [ "$actual_commit" != "$commit" ]; then + echo "Hamlib source mismatch: expected $commit, got $actual_commit" >&2 + exit 1 +fi + +cd hamlib-src +./bootstrap +./configure \ + --build=x86_64-pc-linux-gnu \ + --host="$triplet" \ + --prefix=/usr \ + --disable-shared --enable-static \ + --without-cxx-binding \ + --without-readline \ + --without-indi \ + CC="${triplet}-gcc" \ + CXX="${triplet}-g++" \ + AR="${triplet}-ar" \ + NM="${triplet}-nm" \ + OBJDUMP="${triplet}-objdump" \ + RANLIB="${triplet}-ranlib" \ + STRIP="${triplet}-strip" \ + CFLAGS="--sysroot=$sysroot -isystem $target_include -g -O2 -fPIC -fdata-sections -ffunction-sections" \ + CXXFLAGS="--sysroot=$sysroot -isystem $target_include -g -O2 -fPIC -fdata-sections -ffunction-sections" \ + LDFLAGS="--sysroot=$sysroot -B$target_lib/ -L$target_lib -Wl,-rpath-link,$target_lib -Wl,-rpath-link,$target_base_lib -Wl,--gc-sections" +make -j"$(nproc)" +make DESTDIR="$sysroot" install + +for utility in rigctl rigctld rigctlcom; do + metadata="$(file "$sysroot/usr/bin/$utility")" + case "$metadata" in + *"ELF 32-bit"*"ARM, EABI5"*) ;; + *) + echo "Cross-built Hamlib utility has the wrong architecture: $metadata" >&2 + exit 1 + ;; + esac +done +test -f "$sysroot/usr/lib/libhamlib.a" diff --git a/.github/scripts/build-hamlib-linux.sh b/.github/scripts/build-hamlib-linux.sh new file mode 100755 index 00000000..11676c56 --- /dev/null +++ b/.github/scripts/build-hamlib-linux.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 2 ]; then + echo "Usage: build-hamlib-linux.sh REF PREFIX" >&2 + exit 2 +fi + +ref="$1" +prefix="$2" + +git init hamlib-src +git -C hamlib-src remote add origin https://github.com/Hamlib/Hamlib.git +git -C hamlib-src fetch --depth 1 origin "$ref" +git -C hamlib-src checkout --detach FETCH_HEAD +actual_commit="$(git -C hamlib-src rev-parse HEAD)" +if [[ "$ref" =~ ^[0-9a-f]{40}$ ]] && [ "$actual_commit" != "$ref" ]; then + echo "Hamlib source mismatch: expected $ref, got $actual_commit" >&2 + exit 1 +fi +cd hamlib-src +./bootstrap +./configure \ + --prefix="$prefix" \ + --disable-shared --enable-static \ + --without-cxx-binding \ + --without-readline \ + --without-indi \ + CFLAGS="-g -O2 -fPIC -fdata-sections -ffunction-sections" \ + LDFLAGS="-Wl,--gc-sections" +make -j"$(nproc)" +make install diff --git a/.github/scripts/build-hamlib-macos.sh b/.github/scripts/build-hamlib-macos.sh index 637492e4..525f3ebf 100755 --- a/.github/scripts/build-hamlib-macos.sh +++ b/.github/scripts/build-hamlib-macos.sh @@ -1,14 +1,15 @@ #!/usr/bin/env bash set -euo pipefail -if [ "$#" -ne 3 ]; then - echo "Usage: build-hamlib-macos.sh BRANCH DEPLOYMENT_TARGET PREFIX" >&2 +if [ "$#" -ne 4 ]; then + echo "Usage: build-hamlib-macos.sh BRANCH DEPLOYMENT_TARGET PREFIX LIBUSB_PREFIX" >&2 exit 2 fi branch="$1" deployment_target="$2" prefix="$3" +libusb_prefix="$4" git clone --depth 1 --branch "$branch" \ https://github.com/Hamlib/Hamlib.git hamlib-src @@ -18,7 +19,9 @@ cd hamlib-src --prefix="$prefix" \ --disable-shared --enable-static \ --without-cxx-binding \ + PKG_CONFIG_PATH="${libusb_prefix}/lib/pkgconfig" \ + CPPFLAGS="-I${libusb_prefix}/include" \ CFLAGS="-mmacosx-version-min=${deployment_target}" \ - LDFLAGS="-mmacosx-version-min=${deployment_target}" + LDFLAGS="-L${libusb_prefix}/lib -mmacosx-version-min=${deployment_target} -Wl,-headerpad_max_install_names" make -j"$(sysctl -n hw.ncpu)" make install diff --git a/.github/scripts/build-hamlib-tsan-linux.sh b/.github/scripts/build-hamlib-tsan-linux.sh new file mode 100755 index 00000000..d3b37d57 --- /dev/null +++ b/.github/scripts/build-hamlib-tsan-linux.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 1 ]; then + echo "Usage: build-hamlib-tsan-linux.sh PREFIX" >&2 + exit 2 +fi + +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +# shellcheck source=.github/scripts/tsan-linux-deps-config.sh +. "${script_dir}/tsan-linux-deps-config.sh" + +prefix=$1 +tsan_require_toolchain + +if [ -e "$prefix" ] && [ -n "$(ls -A "$prefix")" ]; then + echo "Hamlib TSan prefix already exists and is not empty: $prefix" >&2 + exit 1 +fi + +build_root="$(mktemp -d "${RUNNER_TEMP:-/tmp}/wsjtx-hamlib-tsan.XXXXXX")" +source_dir="${build_root}/hamlib-src" +mkdir -p "$prefix" "$source_dir" + +git -C "$source_dir" init +git -C "$source_dir" remote add origin https://github.com/Hamlib/Hamlib.git +git -C "$source_dir" fetch --depth 1 origin "$TSAN_HAMLIB_COMMIT" +git -C "$source_dir" checkout --detach FETCH_HEAD + +actual_commit="$(git -C "$source_dir" rev-parse HEAD)" +if [ "$actual_commit" != "$TSAN_HAMLIB_COMMIT" ]; then + echo "Hamlib source commit mismatch: expected $TSAN_HAMLIB_COMMIT, got $actual_commit" >&2 + exit 1 +fi + +git -C "$source_dir" fetch --depth 2 origin "$TSAN_HAMLIB_PATCH_COMMIT" +git -C "$source_dir" cherry-pick --no-commit "$TSAN_HAMLIB_PATCH_COMMIT" + +cd "$source_dir" +./bootstrap +./configure \ + --prefix="$prefix" \ + --disable-shared --enable-static \ + --without-indi \ + --without-cxx-binding \ + CC="$TSAN_CC" \ + CFLAGS="${TSAN_SANITIZER_FLAGS} -fPIC -fdata-sections -ffunction-sections" \ + LDFLAGS="${TSAN_LINK_FLAGS} -Wl,--gc-sections" +make -j"$(nproc)" +make install + +tsan_write_dependency_manifest hamlib "$prefix" diff --git a/.github/scripts/build-hamlib-windows.sh b/.github/scripts/build-hamlib-windows.sh new file mode 100755 index 00000000..a4240998 --- /dev/null +++ b/.github/scripts/build-hamlib-windows.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 2 ]; then + echo "Usage: build-hamlib-windows.sh BRANCH PREFIX" >&2 + exit 2 +fi + +branch="$1" +prefix="$2" + +git clone --depth 1 --branch "$branch" \ + https://github.com/Hamlib/Hamlib.git hamlib-src +cd hamlib-src +./bootstrap +./configure \ + --prefix="$prefix" \ + --enable-shared --disable-static \ + --without-cxx-binding \ + --without-readline \ + CFLAGS="-DNDEBUG -g -O2 -fdata-sections -ffunction-sections" \ + LDFLAGS="-Wl,--gc-sections" +make -j"$(nproc)" +make install-strip diff --git a/.github/scripts/build-linux-armhf-cross.sh b/.github/scripts/build-linux-armhf-cross.sh new file mode 100755 index 00000000..cfbb2f03 --- /dev/null +++ b/.github/scripts/build-linux-armhf-cross.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +set -euo pipefail + +VERSION="${VERSION:?missing}" +ARCH="${ARCH:?missing}" +HAMLIB_BRANCH="${HAMLIB_BRANCH:?missing}" +WSJT_RELEASE_CHANNEL="${WSJT_RELEASE_CHANNEL:-DEVEL}" +WSJT_RC_NUMBER="${WSJT_RC_NUMBER:-}" +if [ "$ARCH" != armhf ]; then + echo "build-linux-armhf-cross.sh supports only arch=armhf" >&2 + exit 2 +fi + +unset GITHUB_TOKEN +cd /work +# shellcheck source=.github/scripts/armhf-ci-image-config.sh +source .github/scripts/armhf-ci-image-config.sh +# shellcheck source=.github/scripts/linux-artifact-validation.sh +source .github/scripts/linux-artifact-validation.sh +.github/scripts/verify-armhf-ci-image.sh cross-builder "$ARCH" "$HAMLIB_BRANCH" + +export CC="$ARMHF_TOOLCHAIN_PREFIX/bin/$ARMHF_TARGET_TRIPLET-gcc" +export CXX="$ARMHF_TOOLCHAIN_PREFIX/bin/$ARMHF_TARGET_TRIPLET-g++" +export FC="$ARMHF_TOOLCHAIN_PREFIX/bin/$ARMHF_TARGET_TRIPLET-gfortran" +for compiler in "$CC" "$CXX" "$FC"; do + version="$("$compiler" -dumpfullversion -dumpversion)" + if [ "$version" != "$ARMHF_GCC_VERSION" ]; then + echo "Expected GCC $ARMHF_GCC_VERSION, found $version at $compiler" >&2 + exit 1 + fi +done + +export CCACHE_DIR="${CCACHE_DIR:-/work/.ccache-armhf}" +mkdir -p "$CCACHE_DIR" +ccache --zero-stats +started="$(date +%s)" +cmake -S . -B wsjtx-build \ + -DCMAKE_TOOLCHAIN_FILE=/work/.github/cmake/armhf-toolchain.cmake \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DWSJT_SKIP_MANPAGES=ON \ + -DWSJT_ENABLE_TESTS=ON \ + -DWSJT_FORTRAN_LIBRARY_VARIANTS=OPENMP_ONLY \ + -DWSJT_RELEASE_CHANNEL="$WSJT_RELEASE_CHANNEL" \ + -DWSJT_RC_NUMBER="$WSJT_RC_NUMBER" \ + -Wno-dev +cmake --build wsjtx-build --parallel "$(nproc)" +ended="$(date +%s)" +{ + printf 'started_epoch=%s\n' "$started" + printf 'ended_epoch=%s\n' "$ended" + printf 'duration_seconds=%s\n' "$((ended - started))" +} > wsjtx-build/armhf-cross-build-timing.env +ccache --show-stats + +validate_linux_build_executables wsjtx-build "$ARCH" +.github/scripts/audit-armhf-cross-build.sh wsjtx-build +echo "::group::Prepare ARMHF AppDir" +cmake --install wsjtx-build --prefix /work/AppDir/usr +validate_linux_application_tree AppDir appdir "$ARCH" +echo "::endgroup::" +echo "ARMHF cross-build complete for version=$VERSION" diff --git a/.github/scripts/build-pfunit-linux.sh b/.github/scripts/build-pfunit-linux.sh new file mode 100755 index 00000000..4020fca8 --- /dev/null +++ b/.github/scripts/build-pfunit-linux.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 2 ]; then + echo "Usage: build-pfunit-linux.sh REF PREFIX" >&2 + exit 2 +fi + +ref="$1" +prefix="$2" + +git init pfunit-src +git -C pfunit-src remote add origin \ + https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git +git -C pfunit-src fetch --depth 1 origin "$ref" +git -C pfunit-src checkout --detach FETCH_HEAD +actual_commit="$(git -C pfunit-src rev-parse HEAD)" +if [[ "$ref" =~ ^[0-9a-f]{40}$ ]] && [ "$actual_commit" != "$ref" ]; then + echo "pFUnit source mismatch: expected $ref, got $actual_commit" >&2 + exit 1 +fi +git -C pfunit-src submodule update --init --recursive --depth 1 +cmake -S pfunit-src -B pfunit-build \ + -DSKIP_MPI=YES \ + -DSKIP_OPENMP=YES \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ + -DCMAKE_INSTALL_PREFIX="$prefix" +cmake --build pfunit-build -j"$(nproc)" +cmake --install pfunit-build diff --git a/.github/scripts/build-pfunit-macos.sh b/.github/scripts/build-pfunit-macos.sh new file mode 100755 index 00000000..0b53fdf8 --- /dev/null +++ b/.github/scripts/build-pfunit-macos.sh @@ -0,0 +1,48 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -lt 4 ] || [ "$#" -gt 6 ]; then + echo "Usage: build-pfunit-macos.sh TAG FORTRAN_COMPILER DEPLOYMENT_TARGET PREFIX [FORTRAN_FLAGS] [LINKER_FLAGS]" >&2 + exit 2 +fi + +tag="$1" +fortran_compiler="$2" +deployment_target="$3" +prefix="$4" +fortran_flags="${5:-}" +linker_flags="${6:-}" + +git clone --depth 1 --branch "$tag" --recursive \ + https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git pfunit-src + +gftl_shared_v1_cmake="pfunit-src/extern/fArgParse/extern/gFTL-shared/src/v1/CMakeLists.txt" +if [ -f "$gftl_shared_v1_cmake" ]; then + gftl_shared_v1_cmake_tmp="${gftl_shared_v1_cmake}.tmp" + awk ' + $0 == "add_executable (demo.x demo.F90)" { + print "add_executable (demo.x EXCLUDE_FROM_ALL demo.F90)" + replaced = 1 + next + } + { print } + END { if (!replaced) exit 42 } + ' "$gftl_shared_v1_cmake" > "$gftl_shared_v1_cmake_tmp" || { + echo "::error::Could not exclude gFTL-shared demo.x from the pFUnit dependency build" + exit 1 + } + mv "$gftl_shared_v1_cmake_tmp" "$gftl_shared_v1_cmake" +fi + +cmake -S pfunit-src -B pfunit-build \ + -DSKIP_MPI=YES \ + -DSKIP_OPENMP=YES \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ + -DCMAKE_C_COMPILER=/usr/bin/cc \ + -DCMAKE_Fortran_COMPILER="$fortran_compiler" \ + -DCMAKE_Fortran_FLAGS="$fortran_flags" \ + -DCMAKE_EXE_LINKER_FLAGS="$linker_flags" \ + -DCMAKE_OSX_DEPLOYMENT_TARGET="$deployment_target" \ + -DCMAKE_INSTALL_PREFIX="$prefix" +cmake --build pfunit-build -j"$(sysctl -n hw.ncpu)" +cmake --install pfunit-build diff --git a/.github/scripts/build-pfunit-windows.sh b/.github/scripts/build-pfunit-windows.sh new file mode 100755 index 00000000..90504e01 --- /dev/null +++ b/.github/scripts/build-pfunit-windows.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 2 ]; then + echo "Usage: build-pfunit-windows.sh TAG PREFIX" >&2 + exit 2 +fi + +tag="$1" +prefix="$2" + +git config --global core.longpaths true +git clone --depth 1 --branch "$tag" --recursive \ + https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git pfunit-src +cmake -S pfunit-src -B pfunit-build -G "MSYS Makefiles" \ + -DSKIP_MPI=YES \ + -DSKIP_OPENMP=YES \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ + -DCMAKE_INSTALL_PREFIX="$prefix" +cmake --build pfunit-build -j"$(nproc)" +cmake --install pfunit-build diff --git a/.github/scripts/build-qt-macos.sh b/.github/scripts/build-qt-macos.sh index 3bc0434b..f60f821e 100755 --- a/.github/scripts/build-qt-macos.sh +++ b/.github/scripts/build-qt-macos.sh @@ -161,9 +161,8 @@ jobs="$(sysctl -n hw.ncpu)" make -j"$jobs" make install -"${prefix}/bin/qmake" -query -"${prefix}/bin/qmake" -query QT_VERSION | awk -v expected="$QT_VERSION" ' +"${prefix}/bin/qtpaths" --qt-version | awk -v expected="$QT_VERSION" ' $0 != expected { - printf "Expected qmake QT_VERSION %s, got %s\n", expected, $0 > "/dev/stderr" + printf "Expected Qt version %s, got %s\n", expected, $0 > "/dev/stderr" exit 1 }' diff --git a/.github/scripts/build-qt-tsan-linux.sh b/.github/scripts/build-qt-tsan-linux.sh new file mode 100755 index 00000000..d2c3d756 --- /dev/null +++ b/.github/scripts/build-qt-tsan-linux.sh @@ -0,0 +1,135 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 1 ]; then + echo "Usage: build-qt-tsan-linux.sh PREFIX" >&2 + exit 2 +fi + +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +# shellcheck source=.github/scripts/tsan-linux-deps-config.sh +. "${script_dir}/tsan-linux-deps-config.sh" + +prefix=$1 +tsan_require_toolchain + +if [ -e "$prefix" ] && [ -n "$(ls -A "$prefix")" ]; then + echo "Qt TSan prefix already exists and is not empty: $prefix" >&2 + exit 1 +fi + +build_root="$(mktemp -d "${RUNNER_TEMP:-/tmp}/wsjtx-qt-tsan.XXXXXX")" +archive="${build_root}/qt-everywhere-opensource-src-${TSAN_QT_VERSION}.tar.xz" + +cleanup_build_root() { + local expected_root=${RUNNER_TEMP:-/tmp} + if [[ $build_root != "$expected_root"/wsjtx-qt-tsan.* ]]; then + echo "Refusing to remove unexpected Qt build directory: $build_root" >&2 + return 1 + fi + rm -rf -- "$build_root" +} + +trap cleanup_build_root EXIT +mkdir -p "$prefix" + +curl -L --fail --retry 5 --retry-delay 10 \ + -o "$archive" "$TSAN_QT_SOURCE_URL" + +actual_sha256="$(sha256sum "$archive" | awk '{print $1}')" +if [ "$actual_sha256" != "$TSAN_QT_SOURCE_SHA256" ]; then + echo "Qt source SHA-256 mismatch" >&2 + echo "Expected: $TSAN_QT_SOURCE_SHA256" >&2 + echo "Actual: $actual_sha256" >&2 + exit 1 +fi + +tar -xf "$archive" -C "$build_root" +rm -f "$archive" +source_dir="${build_root}/qt-everywhere-src-${TSAN_QT_VERSION}" +if [ ! -d "$source_dir" ]; then + source_dir="${build_root}/qt-everywhere-opensource-src-${TSAN_QT_VERSION}" +fi +if [ ! -d "$source_dir" ]; then + echo "Could not locate extracted Qt source under $build_root" >&2 + exit 1 +fi + +cd "$source_dir" +export CC="$TSAN_CC" +export CXX="$TSAN_CXX" +export CFLAGS="$TSAN_SANITIZER_FLAGS" +export CXXFLAGS="$TSAN_SANITIZER_FLAGS" +export LDFLAGS="$TSAN_LINK_FLAGS" + +configure_args=( + -opensource + -confirm-license + -release + -shared + -prefix "$prefix" + -sanitize thread + -force-debug-info + -no-strip + "QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO=-O1 -g1" + "QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO=-O1 -g1" + -nomake examples + -nomake tests + -qt-zlib + -qt-libpng + -qt-libjpeg + -qt-pcre + -qt-harfbuzz + -qt-sqlite + -no-sql-mysql + -no-sql-psql + -openssl-runtime + -skip qt3d + -skip qtactiveqt + -skip qtandroidextras + -skip qtcharts + -skip qtconnectivity + -skip qtdatavis3d + -skip qtdeclarative + -skip qtdoc + -skip qtgamepad + -skip qtgraphicaleffects + -skip qtimageformats + -skip qtlocation + -skip qtlottie + -skip qtmacextras + -skip qtnetworkauth + -skip qtpurchasing + -skip qtquick3d + -skip qtquickcontrols + -skip qtquickcontrols2 + -skip qtquicktimeline + -skip qtremoteobjects + -skip qtscript + -skip qtscxml + -skip qtsensors + -skip qtserialbus + -skip qtspeech + -skip qtvirtualkeyboard + -skip qtwayland + -skip qtwebchannel + -skip qtwebengine + -skip qtwebglplugin + -skip qtwebview + -skip qtx11extras + -skip qtxmlpatterns +) + +./configure "${configure_args[@]}" +make -j"$(nproc)" +make install + +actual_version="$("${prefix}/bin/qtpaths" --qt-version)" +if [ "$actual_version" != "$TSAN_QT_VERSION" ]; then + echo "Qt version mismatch: expected $TSAN_QT_VERSION, got $actual_version" >&2 + exit 1 +fi + +tsan_write_dependency_manifest qt "$prefix" +cleanup_build_root +trap - EXIT diff --git a/.github/scripts/check-candidate-tag.sh b/.github/scripts/check-candidate-tag.sh new file mode 100755 index 00000000..860f91f2 --- /dev/null +++ b/.github/scripts/check-candidate-tag.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if [ "$#" -ne 2 ]; then + echo "Usage: check-candidate-tag.sh TAG EXPECTED_SHA" >&2 + exit 2 +fi + +tag=$1 +expected_sha=$2 +ref="refs/tags/$tag" + +if git show-ref --verify --quiet "$ref"; then + if ! current=$(git rev-parse --verify --quiet "$ref^{commit}"); then + echo "::error::$tag does not identify a commit" >&2 + exit 1 + fi + if [ "$current" != "$expected_sha" ]; then + echo "::error::$tag already exists at $current; release tags are never moved" >&2 + exit 1 + fi + printf 'exists=true\n' + printf '%s already identifies %s; creation is idempotently satisfied.\n' "$tag" "$expected_sha" >&2 +else + status=$? + if [ "$status" -ne 1 ]; then + echo "::error::Could not inspect $ref (git show-ref exited $status)" >&2 + exit "$status" + fi + printf 'exists=false\n' +fi diff --git a/.github/scripts/deploy-macos-app.sh b/.github/scripts/deploy-macos-app.sh new file mode 100755 index 00000000..f4eaaae7 --- /dev/null +++ b/.github/scripts/deploy-macos-app.sh @@ -0,0 +1,243 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +usage() { + cat <<'USAGE' +Usage: deploy-macos-app.sh --app PATH --workspace-prefix PATH --qt-prefix PATH --boost-prefix PATH --fftw-prefix PATH --libusb-prefix PATH --portaudio-prefix PATH --fortran-prefix PATH --gcc-lib PATH [--fortran-original-prefix PATH] [--homebrew-prefix PATH] +USAGE +} + +APP="" +WORKSPACE_PREFIX="${GITHUB_WORKSPACE:-}" +QT_PREFIX="" +BOOST_PREFIX="" +FFTW_PREFIX="" +LIBUSB_PREFIX="" +PORTAUDIO_PREFIX="" +FORTRAN_PREFIX="" +FORTRAN_ORIGINAL_PREFIX="" +GCC_LIB="" +HOMEBREW_PREFIX="${HOMEBREW_PREFIX:-}" + +while [ "$#" -gt 0 ]; do + case "$1" in + --app) APP="$2"; shift 2 ;; + --workspace-prefix) WORKSPACE_PREFIX="$2"; shift 2 ;; + --qt-prefix) QT_PREFIX="$2"; shift 2 ;; + --boost-prefix) BOOST_PREFIX="$2"; shift 2 ;; + --fftw-prefix) FFTW_PREFIX="$2"; shift 2 ;; + --libusb-prefix) LIBUSB_PREFIX="$2"; shift 2 ;; + --portaudio-prefix) PORTAUDIO_PREFIX="$2"; shift 2 ;; + --fortran-prefix) FORTRAN_PREFIX="$2"; shift 2 ;; + --fortran-original-prefix) FORTRAN_ORIGINAL_PREFIX="$2"; shift 2 ;; + --gcc-lib) GCC_LIB="$2"; shift 2 ;; + --homebrew-prefix) HOMEBREW_PREFIX="$2"; shift 2 ;; + --help|-h) usage; exit 0 ;; + *) echo "Unknown argument: $1" >&2; usage >&2; exit 2 ;; + esac +done + +for value_name in APP WORKSPACE_PREFIX QT_PREFIX BOOST_PREFIX FFTW_PREFIX LIBUSB_PREFIX PORTAUDIO_PREFIX FORTRAN_PREFIX GCC_LIB HOMEBREW_PREFIX; do + if [ -z "${!value_name}" ]; then + echo "Missing required argument or environment: ${value_name}" >&2 + usage >&2 + exit 2 + fi +done + +FRAMEWORKS="${APP}/Contents/Frameworks" +mkdir -p "${FRAMEWORKS}" + +dump_bundle_context() { + local status="$1" + local line="$2" + local command="$3" + echo "::error::deploy-macos-app failed at line ${line} with status ${status}: ${command}" + echo "APP=${APP}" + echo "FRAMEWORKS=${FRAMEWORKS}" + echo "FORTRAN_PREFIX=${FORTRAN_PREFIX}" + echo "FORTRAN_ORIGINAL_PREFIX=${FORTRAN_ORIGINAL_PREFIX}" + echo "GCC_LIB=${GCC_LIB}" + echo "HOMEBREW_PREFIX=${HOMEBREW_PREFIX}" + echo "App executable contents:" + ls -la "${APP}/Contents/MacOS" || true + echo "Framework contents:" + ls -la "${FRAMEWORKS}" || true + echo "External references in app executables:" + find "${APP}/Contents/MacOS" -type f -perm +111 -print -exec otool -L {} \; 2>/dev/null || true + if [ -f macdeployqt.log ]; then + echo "macdeployqt.log:" + cat macdeployqt.log + fi +} +trap 'status=$?; dump_bundle_context "$status" "$LINENO" "$BASH_COMMAND"; exit "$status"' ERR + +run_logged() { + echo "+ $*" + "$@" +} + +echo "Running macdeployqt..." +set +e +"${QT_PREFIX}/bin/macdeployqt" "${APP}" -verbose=2 > macdeployqt.log 2>&1 +status=$? +set -e +if [ "$status" -ne 0 ]; then + echo "::error::macdeployqt failed with status ${status}" + dump_bundle_context "$status" "$LINENO" "macdeployqt" + exit "$status" +fi +cat macdeployqt.log + +resolve_lib() { + local lib="$1" + if [ -n "$FORTRAN_ORIGINAL_PREFIX" ] && [[ "$lib" == "$FORTRAN_ORIGINAL_PREFIX"/* ]]; then + local original_prefix="${FORTRAN_ORIGINAL_PREFIX}/" + local relocated="${FORTRAN_PREFIX}/${lib:${#original_prefix}}" + [ -f "$relocated" ] && echo "$relocated" && return 0 + fi + if [[ "$lib" == $HOMEBREW_PREFIX/* ]]; then + echo "$lib" + return 0 + elif [[ "$lib" == "$WORKSPACE_PREFIX"/* ]]; then + echo "$lib" + return 0 + elif [[ "$lib" == @rpath/* ]]; then + local name="${lib#@rpath/}" + for dir in \ + "$FRAMEWORKS" \ + "${BOOST_PREFIX}/lib" \ + "${FFTW_PREFIX}/lib" \ + "${LIBUSB_PREFIX}/lib" \ + "${PORTAUDIO_PREFIX}/lib" \ + "${FORTRAN_PREFIX}/lib" \ + "$GCC_LIB" \ + "${HOMEBREW_PREFIX}/lib" + do + [ -f "$dir/$name" ] && echo "$dir/$name" && return + done + fi + return 0 +} + +should_bundle_ref() { + local ref="$1" + if [ -n "$FORTRAN_ORIGINAL_PREFIX" ] && [[ "$ref" == "$FORTRAN_ORIGINAL_PREFIX"/* ]]; then + return 0 + fi + case "$ref" in + *Qt*.framework/*) + return 1 + ;; + "$HOMEBREW_PREFIX"/*|"$WORKSPACE_PREFIX"/*|@rpath/*) + return 0 + ;; + *) + return 1 + ;; + esac +} + +bundle_dylib() { + local binary="$1" + local lib + while IFS= read -r lib; do + should_bundle_ref "$lib" || continue + local resolved + resolved=$(resolve_lib "$lib") + if [ -z "$resolved" ]; then + echo "::error::Could not resolve ${lib} required by ${binary}" + exit 1 + fi + local libname + libname=$(basename "$resolved") + case "$libname" in + libgomp*.dylib) + echo "::error::Refusing to bundle ${resolved}; libgomp must be linked statically for deployable macOS artifacts." + exit 1 + ;; + esac + if [ ! -f "${FRAMEWORKS}/${libname}" ]; then + echo " Bundling: $resolved -> ${FRAMEWORKS}/${libname}" + run_logged cp "$resolved" "${FRAMEWORKS}/${libname}" + run_logged chmod 644 "${FRAMEWORKS}/${libname}" + run_logged install_name_tool -id "@rpath/${libname}" "${FRAMEWORKS}/${libname}" + bundle_dylib "${FRAMEWORKS}/${libname}" + fi + if [ "$lib" != "@rpath/${libname}" ]; then + run_logged install_name_tool -change "$lib" "@rpath/${libname}" "$binary" + fi + done < <(otool -L "$binary" | awk 'NR > 1 {print $1}' || true) +} + +ensure_app_rpath() { + local binary="$1" + local rpath + + while IFS= read -r rpath; do + [ -n "$rpath" ] || continue + case "$rpath" in + "$WORKSPACE_PREFIX"/*|"$HOMEBREW_PREFIX"/*) + run_logged install_name_tool -delete_rpath "$rpath" "$binary" + ;; + esac + done < <(otool -l "$binary" | awk '/LC_RPATH/{getline; getline; print $2}' || true) + + local rpaths + rpaths=$(otool -l "$binary" | awk '/LC_RPATH/{getline; getline; print $2}' || true) + case $'\n'"$rpaths"$'\n' in + *$'\n''@executable_path/../Frameworks'$'\n'*) ;; + *) + run_logged install_name_tool -add_rpath "@executable_path/../Frameworks" "$binary" + ;; + esac +} + +for exe in "${APP}/Contents/MacOS/"*; do + [ -f "$exe" ] && [ -x "$exe" ] && { + ensure_app_rpath "$exe" + bundle_dylib "$exe" + for fw in $(otool -L "$exe" | awk '{print $1}' | grep '\.framework/' || true); do + fwname=$(basename "$fw") + bundled=$(find "${FRAMEWORKS}" -name "${fwname}" -path "*.framework/*" -print -quit 2>/dev/null) + if [ -n "$bundled" ]; then + app_contents="${APP}/Contents/" + fwrel="${bundled:${#app_contents}}" + if [ "$fw" != "@executable_path/../${fwrel}" ]; then + run_logged install_name_tool -change "$fw" "@executable_path/../${fwrel}" "$exe" + fi + fi + done + } +done + +for fw in "${FRAMEWORKS}"/*.dylib; do + [ -f "$fw" ] && bundle_dylib "$fw" +done + +for exe in "${APP}/Contents/MacOS/"*; do + [ -f "$exe" ] && [ -x "$exe" ] && bundle_dylib "$exe" +done + +echo "Checking for remaining external references..." +remaining_refs="${RUNNER_TEMP:-/tmp}/wsjtx-app-remaining-refs.txt" +: > "$remaining_refs" +while IFS= read -r binary; do + while IFS= read -r ref; do + case "$ref" in + "$HOMEBREW_PREFIX"/*|"$WORKSPACE_PREFIX"/*) + echo "${binary}: ${ref}" >> "$remaining_refs" + ;; + esac + if [ -n "$FORTRAN_ORIGINAL_PREFIX" ] && [[ "$ref" == "$FORTRAN_ORIGINAL_PREFIX"/* ]]; then + echo "${binary}: ${ref}" >> "$remaining_refs" + fi + done < <(otool -L "$binary" | awk 'NR > 1 {print $1}' || true) +done < <(find "${APP}/Contents/MacOS" -type f -perm +111 -print 2>/dev/null) +if [ -s "$remaining_refs" ]; then + echo "::error::External build-time paths still present:" + cat "$remaining_refs" + exit 1 +fi + +echo "All dylibs bundled successfully" diff --git a/.github/scripts/deploy-macos-cli-tools.sh b/.github/scripts/deploy-macos-cli-tools.sh new file mode 100755 index 00000000..d8603599 --- /dev/null +++ b/.github/scripts/deploy-macos-cli-tools.sh @@ -0,0 +1,259 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +usage() { + cat <<'USAGE' +Usage: deploy-macos-cli-tools.sh --assets PATH --stage PATH --workspace-prefix PATH --boost-prefix PATH --fftw-prefix PATH --libusb-prefix PATH --portaudio-prefix PATH --fortran-prefix PATH --gcc-lib PATH [--fortran-original-prefix PATH] [--homebrew-prefix PATH] +USAGE +} + +ASSETS="" +STAGE="" +WORKSPACE_PREFIX="${GITHUB_WORKSPACE:-}" +BOOST_PREFIX="" +FFTW_PREFIX="" +LIBUSB_PREFIX="" +PORTAUDIO_PREFIX="" +FORTRAN_PREFIX="" +FORTRAN_ORIGINAL_PREFIX="" +GCC_LIB="" +HOMEBREW_PREFIX="${HOMEBREW_PREFIX:-}" + +while [ "$#" -gt 0 ]; do + case "$1" in + --assets) ASSETS="$2"; shift 2 ;; + --stage) STAGE="$2"; shift 2 ;; + --workspace-prefix) WORKSPACE_PREFIX="$2"; shift 2 ;; + --boost-prefix) BOOST_PREFIX="$2"; shift 2 ;; + --fftw-prefix) FFTW_PREFIX="$2"; shift 2 ;; + --libusb-prefix) LIBUSB_PREFIX="$2"; shift 2 ;; + --portaudio-prefix) PORTAUDIO_PREFIX="$2"; shift 2 ;; + --fortran-prefix) FORTRAN_PREFIX="$2"; shift 2 ;; + --fortran-original-prefix) FORTRAN_ORIGINAL_PREFIX="$2"; shift 2 ;; + --gcc-lib) GCC_LIB="$2"; shift 2 ;; + --homebrew-prefix) HOMEBREW_PREFIX="$2"; shift 2 ;; + --help|-h) usage; exit 0 ;; + *) echo "Unknown argument: $1" >&2; usage >&2; exit 2 ;; + esac +done + +for value_name in ASSETS STAGE WORKSPACE_PREFIX BOOST_PREFIX FFTW_PREFIX LIBUSB_PREFIX PORTAUDIO_PREFIX FORTRAN_PREFIX GCC_LIB HOMEBREW_PREFIX; do + if [ -z "${!value_name}" ]; then + echo "Missing required argument or environment: ${value_name}" >&2 + usage >&2 + exit 2 + fi +done + +LIBDIR="${ASSETS}/lib" +mkdir -p "${LIBDIR}" + +dump_cli_context() { + local status="$1" + local line="$2" + local command="$3" + echo "::error::deploy-macos-cli-tools failed at line ${line} with status ${status}: ${command}" + echo "ASSETS=${ASSETS}" + echo "LIBDIR=${LIBDIR}" + echo "FORTRAN_PREFIX=${FORTRAN_PREFIX}" + echo "FORTRAN_ORIGINAL_PREFIX=${FORTRAN_ORIGINAL_PREFIX}" + echo "GCC_LIB=${GCC_LIB}" + echo "HOMEBREW_PREFIX=${HOMEBREW_PREFIX}" + echo "Asset contents:" + ls -la "${ASSETS}" || true + echo "Library contents:" + ls -la "${LIBDIR}" || true + echo "External references in CLI assets:" + for bin in "${ASSETS}"/*; do + [ -f "$bin" ] && [ -x "$bin" ] && [ "$(basename "$bin")" != "lib" ] || continue + echo "== $bin ==" + otool -L "$bin" || true + done +} +trap 'status=$?; dump_cli_context "$status" "$LINENO" "$BASH_COMMAND"; exit "$status"' ERR + +run_logged() { + echo "+ $*" + "$@" +} + +resolve_cli_ref() { + local ref="$1" + local name="" suffix="" + + if [ -n "$FORTRAN_ORIGINAL_PREFIX" ] && [[ "$ref" == "$FORTRAN_ORIGINAL_PREFIX"/* ]]; then + local original_prefix="${FORTRAN_ORIGINAL_PREFIX}/" + local relocated="${FORTRAN_PREFIX}/${ref:${#original_prefix}}" + [ -f "$relocated" ] && echo "$relocated" + return 0 + fi + + case "$ref" in + /usr/lib/*|/System/Library/*) + return 0 + ;; + @loader_path/lib/*) + name="${ref#@loader_path/lib/}" + [ -f "${LIBDIR}/${name}" ] && echo "${LIBDIR}/${name}" + return 0 + ;; + @loader_path/*) + name="${ref#@loader_path/}" + [ -f "${LIBDIR}/${name}" ] && echo "${LIBDIR}/${name}" + return 0 + ;; + "$WORKSPACE_PREFIX"/*|"$HOMEBREW_PREFIX"/*) + echo "$ref" + return 0 + ;; + esac + + if [[ "$ref" == @rpath/* ]]; then + suffix="${ref#@rpath/}" + if [[ "$suffix" == *.framework/* ]]; then + for dir in \ + "${STAGE}/wsjtx.app/Contents/Frameworks" \ + "${WORKSPACE_PREFIX}/qt-prefix/lib" + do + [ -f "${dir}/${suffix}" ] && echo "${dir}/${suffix}" && return 0 + done + else + name="${suffix}" + for dir in \ + "${LIBDIR}" \ + "${STAGE}/wsjtx.app/Contents/Frameworks" \ + "${BOOST_PREFIX}/lib" \ + "${FFTW_PREFIX}/lib" \ + "${LIBUSB_PREFIX}/lib" \ + "${PORTAUDIO_PREFIX}/lib" \ + "${FORTRAN_PREFIX}/lib" \ + "${GCC_LIB}" \ + "${HOMEBREW_PREFIX}/lib" + do + [ -f "${dir}/${name}" ] && echo "${dir}/${name}" && return 0 + done + fi + fi + + return 0 +} + +bundle_cli_deps() { + local binary="$1" + local change_prefix="$2" + local ref resolved out name target + + while IFS= read -r ref; do + resolved=$(resolve_cli_ref "$ref") + if [ -z "$resolved" ]; then + case "$ref" in + @rpath/*|@loader_path/*|"$WORKSPACE_PREFIX"/*|"$HOMEBREW_PREFIX"/*) + echo "::error::Could not resolve ${ref} required by ${binary}" + exit 1 + ;; + *) + continue + ;; + esac + fi + + name="$(basename "$resolved")" + case "$name" in + libgomp*.dylib) + echo "::error::Refusing to bundle ${resolved}; libgomp must be linked statically for deployable macOS artifacts." + exit 1 + ;; + esac + + out="${LIBDIR}/${name}" + if [ ! -f "$out" ]; then + echo " Bundling: ${resolved} -> ${out}" + run_logged cp "$resolved" "$out" + run_logged chmod 644 "$out" + run_logged install_name_tool -id "@rpath/${name}" "$out" + bundle_cli_deps "$out" "@rpath" + fi + + target="${change_prefix}/${name}" + if [ "$ref" != "$target" ]; then + run_logged install_name_tool -change "$ref" "$target" "$binary" + fi + done < <(otool -L "$binary" | awk 'NR > 1 {print $1}' | grep -E "($WORKSPACE_PREFIX|$HOMEBREW_PREFIX|@rpath|@loader_path)" || true) +} + +ensure_cli_rpath() { + local binary="$1" + local rpath + local bad_rpaths=() + local unique_bad_rpaths=() + + while IFS= read -r rpath; do + [ -n "$rpath" ] || continue + case "$rpath" in + "$WORKSPACE_PREFIX"/*|"$HOMEBREW_PREFIX"/*) + bad_rpaths+=("$rpath") + ;; + esac + done < <(otool -l "$binary" | awk '/LC_RPATH/{getline; getline; print $2}' || true) + + if [ "${#bad_rpaths[@]}" -gt 0 ]; then + for rpath in "${bad_rpaths[@]}"; do + local found=0 + local u + if [ "${#unique_bad_rpaths[@]}" -gt 0 ]; then + for u in "${unique_bad_rpaths[@]}"; do + [ "$u" = "$rpath" ] && found=1 && break + done + fi + [ "$found" -eq 0 ] && unique_bad_rpaths+=("$rpath") + done + fi + + if [ "${#unique_bad_rpaths[@]}" -gt 0 ]; then + for rpath in "${unique_bad_rpaths[@]}"; do + run_logged install_name_tool -delete_rpath "$rpath" "$binary" + done + fi + + local rpaths + rpaths=$(otool -l "$binary" | awk '/LC_RPATH/{getline; getline; print $2}' || true) + case $'\n'"$rpaths"$'\n' in + *$'\n''@loader_path/lib'$'\n'*) ;; + *) + run_logged install_name_tool -add_rpath "@loader_path/lib" "$binary" + ;; + esac +} + +for bin in "${ASSETS}"/*; do + [ -f "$bin" ] && [ -x "$bin" ] && [ "$(basename "$bin")" != "lib" ] || continue + ensure_cli_rpath "$bin" + bundle_cli_deps "$bin" "@rpath" + run_logged codesign --force --sign - "$bin" +done + +for lib in "${LIBDIR}"/*; do + [ -f "$lib" ] || continue + bundle_cli_deps "$lib" "@rpath" + run_logged codesign --force --sign - "$lib" +done + +echo "Verifying CLI tools..." +for bin in "${ASSETS}"/*; do + [ -f "$bin" ] && [ -x "$bin" ] && [ "$(basename "$bin")" != "lib" ] && { + BAD=$(otool -L "$bin" | grep "$HOMEBREW_PREFIX" || true) + if [ -n "$BAD" ]; then + echo "ERROR: $(basename "$bin") still has Homebrew refs:" + echo "$BAD" + exit 1 + fi + } +done +echo "All CLI tools are self-contained" + +cp -R "${LIBDIR}" "${STAGE}/lib" +for bin in "${ASSETS}"/*; do + [ -f "$bin" ] && [ -x "$bin" ] && [ "$(basename "$bin")" != "lib" ] && { + cp "$bin" "${STAGE}/$(basename "$bin")" + } +done diff --git a/.github/scripts/generate-quick-downloads.py b/.github/scripts/generate-quick-downloads.py new file mode 100755 index 00000000..6706292d --- /dev/null +++ b/.github/scripts/generate-quick-downloads.py @@ -0,0 +1,122 @@ +#!/usr/bin/env python3 +"""Generate the "Quick Downloads" markdown block for a WSJT-X GitHub Release. + +The release workflow attaches every build artifact to the Release, which makes +the assets list long and hard for an end user to navigate (installers sit among +standalone command-line utilities, raw binaries, and source). This emits a +short, curated per-platform installer picker to prepend to the auto-generated +release notes. + +It is *asset-driven*: platforms and architectures are derived from the asset +filenames passed in, not hard-coded. New build variants (for example an added +Linux architecture such as armhf) therefore appear in Quick Downloads +automatically, with no edit to this script. + +The block is emitted on stdout, ending at the last platform line (no trailing +separator); the caller joins it to the auto-generated notes. + +Usage: + generate-quick-downloads.py ... + +Only installer-grade assets are listed (.pkg / win64.exe / .deb / .rpm / +.AppImage) plus the source tarball. Per-mode utility tarballs and raw +command-line binaries are intentionally omitted; they remain in the full +assets list below the notes. +""" +import os +import re +import sys + +# Architectures listed first, in this order; any others are appended sorted. +ARCH_ORDER = ["x86_64", "aarch64", "armhf", "armv7l", "arm64", "i686"] + + +def main(argv): + if len(argv) < 4: + sys.stderr.write( + "usage: generate-quick-downloads.py ...\n" + ) + return 2 + + repo, tag = argv[1], argv[2] + names = sorted({os.path.basename(p) for p in argv[3:] if p.strip()}) + + def url(name): + return f"https://github.com/{repo}/releases/download/{tag}/{name}" + + macos = {} # label -> filename + windows = {} # label -> filename + deb = {} # arch -> filename + rpm = {} # arch -> filename + appimage = {} # arch -> filename + source = None + + for n in names: + if n.endswith("-arm64-macOS.pkg"): + macos["Apple Silicon"] = n + elif n.endswith("-x86_64-macOS.pkg"): + macos["Intel"] = n + elif re.search(r"-win\d+\.exe$", n): # installer, not raw jt9.exe + windows["64-bit"] = n + elif n.endswith("-src.tar.gz"): + source = n + elif (m := re.search(r"-linux-([A-Za-z0-9_]+)\.deb$", n)): + deb[m.group(1)] = n + elif (m := re.search(r"-linux-([A-Za-z0-9_]+)\.AppImage$", n)): + appimage[m.group(1)] = n + elif (m := re.search(r"\.([A-Za-z0-9_]+)\.rpm$", n)): + rpm[m.group(1)] = n + # Anything else (utility tarballs, raw binaries) is intentionally + # excluded; it stays in the full assets list. + + def arches(d): + known = [a for a in ARCH_ORDER if a in d] + extra = sorted(a for a in d if a not in ARCH_ORDER) + return known + extra + + def arch_line(label, d): + return f"- {label}: " + " · ".join( + f"[{a}]({url(d[a])})" for a in arches(d) + ) + + out = [ + "## Quick Downloads", + "", + "Choose the installer for your platform. The full assets list below also", + "includes standalone command-line utilities and source code for developers.", + ] + + if macos: + out += ["", "### macOS"] + if "Apple Silicon" in macos: + out.append(f"- Apple Silicon: [{macos['Apple Silicon']}]({url(macos['Apple Silicon'])})") + if "Intel" in macos: + out.append(f"- Intel: [{macos['Intel']}]({url(macos['Intel'])})") + + if windows: + out += ["", "### Windows"] + out.append(f"- 64-bit: [{windows['64-bit']}]({url(windows['64-bit'])})") + + if deb or rpm or appimage: + out += ["", "### Linux"] + if deb: + out.append(arch_line("Debian / Ubuntu (.deb)", deb)) + if rpm: + out.append(arch_line("Fedora / RHEL (.rpm)", rpm)) + if appimage: + out.append(arch_line("AppImage (universal)", appimage)) + + if source: + out += ["", "### Source", f"- [{source}]({url(source)})"] + + # If nothing matched (no installer-grade assets), emit nothing so the + # caller leaves the auto-generated notes untouched. + if len(out) == 4: + return 0 + + sys.stdout.write("\n".join(out) + "\n") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main(sys.argv)) diff --git a/.github/scripts/ghcr_retention.py b/.github/scripts/ghcr_retention.py new file mode 100755 index 00000000..ac0881f6 --- /dev/null +++ b/.github/scripts/ghcr_retention.py @@ -0,0 +1,234 @@ +#!/usr/bin/env python3 +"""Plan and apply conservative retention for WSJT-X GHCR build images.""" + +from __future__ import annotations + +import argparse +import json +import os +import re +import sys +import urllib.error +import urllib.parse +import urllib.request +from dataclasses import dataclass +from datetime import datetime, timedelta, timezone +from typing import Iterable + + +API_VERSION = "2022-11-28" +BUILD_TAG = re.compile( + r"^(?:build-\d{8}-\d+-\d+|validated-build-\d{8}-\d+-\d+|candidate-\d+-\d+)$" +) + + +@dataclass(frozen=True) +class Version: + id: int + digest: str + created_at: datetime + tags: tuple[str, ...] + + +@dataclass(frozen=True) +class Decision: + version: Version + delete: bool + reason: str + + +def parse_timestamp(value: object) -> datetime: + if not isinstance(value, str): + raise ValueError("created_at must be a string") + parsed = datetime.fromisoformat(value.replace("Z", "+00:00")) + if parsed.tzinfo is None: + raise ValueError("created_at must include a timezone") + return parsed.astimezone(timezone.utc) + + +def parse_version(raw: object) -> Version: + if not isinstance(raw, dict): + raise ValueError("package version must be an object") + version_id = raw.get("id") + digest = raw.get("name") + metadata = raw.get("metadata") + if not isinstance(version_id, int) or not isinstance(digest, str): + raise ValueError("package version requires integer id and string name") + if not isinstance(metadata, dict) or metadata.get("package_type") != "container": + raise ValueError(f"package version {version_id} is not a container") + container = metadata.get("container") + tags = container.get("tags") if isinstance(container, dict) else None + if not isinstance(tags, list) or not all(isinstance(tag, str) for tag in tags): + raise ValueError(f"package version {version_id} has invalid tags") + return Version( + id=version_id, + digest=digest, + created_at=parse_timestamp(raw.get("created_at")), + tags=tuple(sorted(tags)), + ) + + +def is_retirable(version: Version) -> bool: + return bool(version.tags) and all( + tag == "stable" or BUILD_TAG.fullmatch(tag) for tag in version.tags + ) + + +def plan_retention( + versions: Iterable[Version], now: datetime, max_age_days: int, keep: int +) -> list[Decision]: + ordered = sorted(versions, key=lambda item: (item.created_at, item.id), reverse=True) + retirable = [version for version in ordered if is_retirable(version)] + kept_ids = {version.id for version in retirable[:keep]} + cutoff = now.astimezone(timezone.utc) - timedelta(days=max_age_days) + decisions: list[Decision] = [] + for version in ordered: + if "stable" in version.tags: + decisions.append(Decision(version, False, "stable")) + elif not is_retirable(version): + decisions.append(Decision(version, False, "unknown-or-untagged")) + elif version.id in kept_ids: + decisions.append(Decision(version, False, "newest-generation")) + elif version.created_at >= cutoff: + decisions.append(Decision(version, False, "within-retention-window")) + else: + decisions.append(Decision(version, True, "expired")) + return decisions + + +class GitHubPackagesClient: + def __init__(self, token: str, api_url: str = "https://api.github.com") -> None: + self.api_url = api_url.rstrip("/") + self.headers = { + "Accept": "application/vnd.github+json", + "Authorization": f"Bearer {token}", + "X-GitHub-Api-Version": API_VERSION, + "User-Agent": "wsjtx-ghcr-retention", + } + + def request(self, method: str, path: str) -> object | None: + request = urllib.request.Request( + f"{self.api_url}{path}", headers=self.headers, method=method + ) + try: + with urllib.request.urlopen(request, timeout=30) as response: + if method == "DELETE": + if response.status != 204: + raise RuntimeError(f"DELETE {path} returned HTTP {response.status}") + return None + return json.load(response) + except urllib.error.HTTPError as error: + request_id = error.headers.get("x-github-request-id", "unknown") + raise RuntimeError( + f"{method} {path} failed with HTTP {error.code} " + f"(GitHub request {request_id})" + ) from error + + @staticmethod + def package_path(owner: str, package: str) -> str: + encoded = urllib.parse.quote(package, safe="") + return f"/orgs/{owner}/packages/container/{encoded}" + + def list_versions(self, owner: str, package: str) -> list[Version]: + base = self.package_path(owner, package) + versions: list[Version] = [] + page = 1 + while True: + raw = self.request( + "GET", f"{base}/versions?state=active&per_page=100&page={page}" + ) + if not isinstance(raw, list): + raise RuntimeError(f"GitHub returned a non-list for package {package}") + versions.extend(parse_version(item) for item in raw) + if len(raw) < 100: + return versions + page += 1 + + def get_version(self, owner: str, package: str, version_id: int) -> Version: + raw = self.request( + "GET", f"{self.package_path(owner, package)}/versions/{version_id}" + ) + return parse_version(raw) + + def delete_version(self, owner: str, package: str, version_id: int) -> None: + self.request( + "DELETE", f"{self.package_path(owner, package)}/versions/{version_id}" + ) + + +def process_package( + client: GitHubPackagesClient, + owner: str, + package: str, + now: datetime, + max_age_days: int, + keep: int, + apply: bool, +) -> int: + decisions = plan_retention(client.list_versions(owner, package), now, max_age_days, keep) + deleted = 0 + for decision in decisions: + version = decision.version + action = "delete" if decision.delete else "keep" + print( + f"{package} id={version.id} digest={version.digest} " + f"created={version.created_at.isoformat()} tags={','.join(version.tags) or '-'} " + f"action={action} reason={decision.reason}" + ) + if not apply or not decision.delete: + continue + refreshed = client.get_version(owner, package, version.id) + refreshed_decision = next( + item + for item in plan_retention([refreshed], now, max_age_days, 0) + if item.version.id == version.id + ) + if not refreshed_decision.delete: + print( + f"{package} id={version.id} action=keep " + f"reason=changed-before-delete-{refreshed_decision.reason}" + ) + continue + client.delete_version(owner, package, version.id) + deleted += 1 + return deleted + + +def parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser() + parser.add_argument("--owner", required=True) + parser.add_argument("--package", action="append", required=True) + parser.add_argument("--max-age-days", type=int, default=60) + parser.add_argument("--keep", type=int, default=3) + parser.add_argument("--apply", action="store_true") + return parser.parse_args() + + +def main() -> int: + args = parse_args() + if args.max_age_days < 1 or args.keep < 1: + print("max-age-days and keep must be positive", file=sys.stderr) + return 2 + token = os.environ.get("GITHUB_TOKEN") + if not token: + print("GITHUB_TOKEN is required", file=sys.stderr) + return 2 + client = GitHubPackagesClient(token) + now = datetime.now(timezone.utc) + deleted = 0 + for package in args.package: + deleted += process_package( + client, + args.owner, + package, + now, + args.max_age_days, + args.keep, + args.apply, + ) + print(f"total_deleted={deleted} apply={str(args.apply).lower()}") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/.github/scripts/is-linux-ci-image-input.sh b/.github/scripts/is-linux-ci-image-input.sh new file mode 100755 index 00000000..23a76e1b --- /dev/null +++ b/.github/scripts/is-linux-ci-image-input.sh @@ -0,0 +1,127 @@ +#!/usr/bin/env bash + +set -euo pipefail + +. .github/scripts/linux-ci-image-inputs.sh + +is_linux_ci_image_input() { + local profile=$1 + local path=$2 + local input inputs + + if ! inputs="$(linux_ci_image_inputs "$profile")"; then + return 2 + fi + + while IFS= read -r input; do + if [ "$path" = "$input" ]; then + return 0 + fi + done <<< "$inputs" + return 1 +} + +linux_ci_image_set_for_inputs() { + local normal=false tsan=false path + + for path in "$@"; do + if is_linux_ci_image_input normal-noble "$path" || + is_linux_ci_image_input normal-bookworm "$path" || + is_linux_ci_image_input armhf-cross-bookworm "$path" || + is_linux_ci_image_input armhf-runtime-bookworm "$path"; then + normal=true + fi + if is_linux_ci_image_input tsan-noble "$path"; then + tsan=true + fi + done + + if [ "$normal" = true ] && [ "$tsan" = true ]; then + echo normal-and-tsan + elif [ "$normal" = true ]; then + echo normal + elif [ "$tsan" = true ]; then + echo tsan + else + echo none + fi +} + +expect_input() { + if ! is_linux_ci_image_input "$1" "$2"; then + echo "self-test failed: expected $1 image input: $2" >&2 + exit 1 + fi +} + +expect_non_input() { + if is_linux_ci_image_input "$1" "$2"; then + echo "self-test failed: unexpected $1 image input: $2" >&2 + exit 1 + fi +} + +expect_image_set() { + local expected=$1 + shift + local actual + actual="$(linux_ci_image_set_for_inputs "$@")" + if [ "$actual" != "$expected" ]; then + echo "self-test failed: expected image set $expected, got $actual" >&2 + exit 1 + fi +} + +if [ "${1:-}" = "--self-test" ]; then + expect_input normal-noble ".github/images/linux-ci/Dockerfile.noble" + expect_input tsan-noble ".github/images/linux-ci/Dockerfile.noble" + expect_input normal-bookworm ".github/images/linux-ci/Dockerfile.bookworm" + expect_input armhf-cross-bookworm ".github/images/linux-ci/Dockerfile.armhf-cross" + expect_input armhf-runtime-bookworm ".github/images/linux-ci/Dockerfile.armhf-runtime" + expect_input armhf-runtime-bookworm ".github/images/linux-ci/install-armhf-runtime-packages.sh" + expect_non_input normal-noble ".github/images/linux-ci/install-armhf-runtime-packages.sh" + expect_input armhf-cross-bookworm ".github/images/linux-ci/armhf-cross-toolchain.config" + expect_non_input armhf-runtime-bookworm ".github/images/linux-ci/armhf-cross-toolchain.config" + expect_input normal-noble ".github/scripts/build-hamlib-linux.sh" + expect_non_input tsan-noble ".github/scripts/build-hamlib-linux.sh" + expect_input tsan-noble ".github/scripts/build-qt-tsan-linux.sh" + expect_non_input normal-noble ".github/scripts/build-qt-tsan-linux.sh" + expect_input normal-noble ".github/scripts/verify-linux-ci-image.sh" + expect_input tsan-noble ".github/scripts/verify-linux-ci-image.sh" + + expect_non_input normal-noble ".github/workflows/build-linux.yml" + expect_non_input tsan-noble "CMake/Sources.cmake" + expect_non_input normal-bookworm ".github/scripts/build-boost-macos.sh" + expect_image_set normal ".github/scripts/build-hamlib-linux.sh" + expect_image_set tsan ".github/scripts/build-qt-tsan-linux.sh" + expect_image_set normal-and-tsan ".github/scripts/verify-linux-ci-image.sh" + expect_image_set normal-and-tsan \ + ".github/scripts/build-hamlib-linux.sh" \ + ".github/scripts/build-qt-tsan-linux.sh" + expect_image_set none "CMake/Sources.cmake" + if is_linux_ci_image_input unsupported ".github/images/linux-ci/Dockerfile.noble" 2>/dev/null; then + echo "self-test failed: unsupported image profile was accepted" >&2 + exit 1 + elif [ "$?" -ne 2 ]; then + echo "self-test failed: unsupported image profile did not return status 2" >&2 + exit 1 + fi + exit 0 +fi + +if [ "${1:-}" = "--classify" ]; then + shift + if [ "$#" -eq 0 ]; then + echo "Usage: is-linux-ci-image-input.sh --classify PATH [PATH ...]" >&2 + exit 2 + fi + linux_ci_image_set_for_inputs "$@" + exit 0 +fi + +if [ "$#" -ne 2 ]; then + echo "Usage: is-linux-ci-image-input.sh PROFILE PATH | --classify PATH [PATH ...]" >&2 + exit 2 +fi + +is_linux_ci_image_input "$1" "$2" diff --git a/.github/scripts/linux-artifact-validation.sh b/.github/scripts/linux-artifact-validation.sh new file mode 100644 index 00000000..01a607f6 --- /dev/null +++ b/.github/scripts/linux-artifact-validation.sh @@ -0,0 +1,290 @@ +#!/bin/bash +# Shared acceptance checks for Linux build products. + +linux_validation_error() { + echo "::error::$*" >&2 + return 1 +} + +validate_elf_metadata() { + local arch="$1" + local path="$2" + local file_output="$3" + local header_output="$4" + local program_output="$5" + + case "$arch" in + armhf) + [[ "$file_output" == *"ELF 32-bit"* ]] || { + linux_validation_error "$path is not ELF32" + return 1 + } + [[ "$file_output" == *"ARM, EABI5"* ]] || { + linux_validation_error "$path is not ARM EABI5" + return 1 + } + [[ "$header_output" == *"Class:"*"ELF32"* ]] || { + linux_validation_error "$path has the wrong ELF class for armhf" + return 1 + } + [[ "$header_output" == *"Machine:"*"ARM"* ]] || { + linux_validation_error "$path has the wrong ELF machine for armhf" + return 1 + } + [[ "$header_output" == *"Version5 EABI"* ]] || { + linux_validation_error "$path does not use EABI5" + return 1 + } + [[ "$header_output" == *"hard-float ABI"* ]] || { + linux_validation_error "$path does not use the ARM hard-float ABI" + return 1 + } + if [[ "$file_output" == *"dynamically linked"* ]] && + [[ "$program_output" != *"/lib/ld-linux-armhf.so.3"* ]]; then + linux_validation_error "$path does not request /lib/ld-linux-armhf.so.3" + return 1 + fi + ;; + x86_64) + [[ "$file_output" == *"ELF 64-bit"* && "$file_output" == *"x86-64"* ]] || { + linux_validation_error "$path is not a 64-bit x86-64 ELF" + return 1 + } + ;; + aarch64) + [[ "$file_output" == *"ELF 64-bit"* && "$file_output" == *"ARM aarch64"* ]] || { + linux_validation_error "$path is not a 64-bit AArch64 ELF" + return 1 + } + ;; + *) + linux_validation_error "Unsupported Linux architecture: $arch" + return 2 + ;; + esac +} + +validate_elf_executable() { + local arch="$1" + local path="$2" + local file_output + local header_output + local program_output + + if [ ! -x "$path" ]; then + linux_validation_error "Required executable is missing: $path" + return 1 + fi + + file_output=$(file -- "$path") || return + header_output=$(readelf -hW -- "$path") || return + program_output=$(readelf -lW -- "$path") || return + echo "$file_output" + validate_elf_metadata "$arch" "$path" "$file_output" "$header_output" "$program_output" +} + +validate_linux_build_executables() { + local build_dir="$1" + local arch="$2" + local executable + + for executable in wsjtx jt9 qmap/qmap map65/map65 ft8code wsprd; do + validate_elf_executable "$arch" "$build_dir/$executable" || return + done +} + +linux_manifest_has_path() { + local manifest="$1" + local path="$2" + case $'\n'"$manifest"$'\n' in + *"$path"$'\n'*) return 0 ;; + *) return 1 ;; + esac +} + +validate_linux_package_manifest() { + local manifest="$1" + local label="$2" + local path + + for path in \ + /usr/bin/wsjtx \ + /usr/bin/jt9 \ + /usr/bin/qmap \ + /usr/bin/map65 \ + /usr/share/wsjtx/ALLCALL7.TXT \ + /usr/share/wsjtx/CALL3.TXT \ + /usr/share/wsjtx/sounds/Message.wav \ + /usr/share/wsjtx/sounds/Testing123.wav; do + if ! linux_manifest_has_path "$manifest" "$path"; then + linux_validation_error "$label is missing expected package path: $path" + return 1 + fi + done + + case $'\n'"$manifest"$'\n' in + *"/usr/bin/sounds"$'\n'* | *"/usr/bin/sounds/"*) + linux_validation_error "$label contains unexpected package path: /usr/bin/sounds" + return 1 + ;; + esac +} + +validate_deb_package() { + local package="$1" + local manifest + + manifest=$(dpkg-deb --fsys-tarfile "$package" | tar -tf -) || return + validate_linux_package_manifest "$manifest" "DEB $package" +} + +validate_rpm_package() { + local package="$1" + local manifest + + manifest=$(rpm -qpl "$package") || return + printf '%s\n' "$manifest" | sed -n '1,40p' + validate_linux_package_manifest "$manifest" "RPM $package" +} + +linux_require_executable() { + local path="$1" + if [ ! -x "$path" ]; then + linux_validation_error "Required executable is missing: $path" + return 1 + fi +} + +linux_require_file() { + local path="$1" + if [ ! -f "$path" ]; then + linux_validation_error "Required file is missing: $path" + return 1 + fi +} + +validate_linux_application_layout() { + local root="$1" + local kind="$2" + local path + + for path in wsjtx jt9 qmap map65 ft8code; do + linux_require_executable "$root/usr/bin/$path" || return + done + if [ "$kind" = appimage ]; then + linux_require_executable "$root/usr/bin/wsprd" || return + elif [ "$kind" != appdir ]; then + linux_validation_error "Unknown application tree kind: $kind" + return 2 + fi + + for path in \ + usr/share/wsjtx/ALLCALL7.TXT \ + usr/share/wsjtx/CALL3.TXT \ + usr/share/wsjtx/sounds/Message.wav \ + usr/share/wsjtx/sounds/Testing123.wav; do + linux_require_file "$root/$path" || return + done + if [ -e "$root/usr/bin/sounds" ] || [ -L "$root/usr/bin/sounds" ]; then + linux_validation_error "Unexpected executable-adjacent sounds path is present: $root/usr/bin/sounds" + return 1 + fi + + if [ "$kind" = appdir ]; then + linux_require_file "$root/usr/share/applications/wsjtx.desktop" || return + linux_require_file "$root/usr/share/pixmaps/wsjtx_icon.png" || return + return 0 + fi + + for path in \ + usr/bin/qt.conf \ + usr/plugins/platforms/libqxcb.so \ + usr/plugins/sqldrivers/libqsqlite.so; do + linux_require_file "$root/$path" || return + done + if ! grep -Eq '^[[:space:]]*Plugins[[:space:]]*=[[:space:]]*plugins[[:space:]]*$' \ + "$root/usr/bin/qt.conf"; then + linux_validation_error "AppImage qt.conf must set Plugins = plugins" + echo "AppImage qt.conf contents:" + cat "$root/usr/bin/qt.conf" + return 1 + fi + + for path in libQt5Core.so libQt5Widgets.so libQt5Multimedia.so; do + if [ -z "$(find "$root/usr/lib" -maxdepth 1 -name "$path*" -print -quit 2>/dev/null)" ]; then + linux_validation_error "Required AppImage Qt library is missing: $path" + return 1 + fi + done + + if [ -z "$(find "$root" -path '*/plugins/audio/*.so' -print -quit 2>/dev/null)" ]; then + linux_validation_error "No Qt audio backend plugin is bundled in the AppImage" + echo "AppImage plugin tree:" + find "$root" -path '*/plugins/*' -name '*.so' -print 2>/dev/null | sed -n '1,20p' + return 1 + fi +} + +validate_linux_application_tree() { + local root="$1" + local kind="$2" + local arch="$3" + local executable + + validate_linux_application_layout "$root" "$kind" || return + for executable in wsjtx jt9 qmap map65 ft8code; do + validate_elf_executable "$arch" "$root/usr/bin/$executable" || return + done + if [ "$kind" = appimage ]; then + validate_elf_executable "$arch" "$root/usr/bin/wsprd" || return + echo "Qt audio plugins bundled:" + find "$root" -path '*/plugins/audio/*.so' -print 2>/dev/null + fi +} + +run_packaged_appimage_startup_smoke() { + local appimage="$1" + local log="$2" + local status + local runner=() + if [ -n "${LINUX_APPIMAGE_RUNNER:-}" ]; then + runner=("$LINUX_APPIMAGE_RUNNER") + fi + + mkdir -p "$(dirname "$log")" + if env \ + -u LD_LIBRARY_PATH \ + -u LD_PRELOAD \ + -u LD_AUDIT \ + -u QT_PLUGIN_PATH \ + -u QT_QPA_PLATFORM_PLUGIN_PATH \ + -u QML_IMPORT_PATH \ + -u QML2_IMPORT_PATH \ + APPIMAGE_EXTRACT_AND_RUN=1 \ + QT_QPA_PLATFORM=xcb \ + timeout --kill-after=5s 45s \ + xvfb-run -a -s "-screen 0 1280x1024x24" \ + "${runner[@]}" \ + "$appimage" \ + --startup-smoke-test \ + --rig-name CI-APPIMAGE-STARTUP \ + >"$log" 2>&1; then + status=0 + else + status=$? + fi + + cat "$log" + if [ "$status" -eq 124 ]; then + linux_validation_error "AppImage startup smoke test timed out after 45 seconds" + return 1 + fi + if [ "$status" -ne 0 ]; then + linux_validation_error "AppImage startup smoke test exited with status $status" + return 1 + fi + if ! grep -Fq "WSJT-X startup smoke test passed" "$log"; then + linux_validation_error "AppImage exited successfully without the startup-smoke success marker" + return 1 + fi +} diff --git a/.github/scripts/linux-ccache-compiler-signature.sh b/.github/scripts/linux-ccache-compiler-signature.sh new file mode 100755 index 00000000..02d3270b --- /dev/null +++ b/.github/scripts/linux-ccache-compiler-signature.sh @@ -0,0 +1,157 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 1 ]; then + echo "Usage: linux-ccache-compiler-signature.sh C_COMPILER" >&2 + exit 2 +fi + +c_compiler=$1 +case "$(basename "$c_compiler")" in + gcc) + cxx_compiler=g++ + ;; + gcc-*) + cxx_compiler="g++-${c_compiler##*-}" + ;; + *-gcc) + cxx_compiler="${c_compiler%-gcc}-g++" + ;; + *) + echo "Unsupported C compiler for Linux ccache identity: $c_compiler" >&2 + exit 2 + ;; +esac + +resolve_executable() { + local executable=$1 resolved + if [[ "$executable" == */* ]]; then + resolved=$executable + else + resolved="$(command -v "$executable" || true)" + fi + if [ -z "$resolved" ] || [ ! -f "$resolved" ]; then + echo "Compiler component not found: $executable" >&2 + exit 1 + fi + readlink -f "$resolved" +} + +hash_file() { + sha256sum "$1" | awk '{print $1}' +} + +c_path="$(resolve_executable "$(command -v "$c_compiler")")" +cxx_path="$(resolve_executable "$(command -v "$cxx_compiler")")" +compiler_version="$($c_compiler -dumpfullversion -dumpversion)" +cxx_version="$($cxx_compiler -dumpfullversion -dumpversion)" +compiler_target="$($c_compiler -dumpmachine)" +cxx_target="$($cxx_compiler -dumpmachine)" + +if [ "$cxx_version" != "$compiler_version" ]; then + echo "C and C++ compiler version mismatch: $compiler_version != $cxx_version" >&2 + exit 1 +fi +if [ "$cxx_target" != "$compiler_target" ]; then + echo "C and C++ compiler target mismatch: $compiler_target != $cxx_target" >&2 + exit 1 +fi +if [[ ! "$compiler_version" =~ ^[0-9]+([.][0-9]+)*$ ]]; then + echo "Invalid GCC version: $compiler_version" >&2 + exit 1 +fi +if [[ ! "$compiler_target" =~ ^[A-Za-z0-9][A-Za-z0-9._-]*$ ]]; then + echo "Invalid GCC target: $compiler_target" >&2 + exit 1 +fi + +cc1_path="$(resolve_executable "$($c_compiler -print-prog-name=cc1)")" +cc1plus_path="$(resolve_executable "$($cxx_compiler -print-prog-name=cc1plus)")" +lto1_path="$(resolve_executable "$($c_compiler -print-prog-name=lto1)")" +assembler_path="$(resolve_executable "$($c_compiler -print-prog-name=as)")" +dumpspecs_sha256="$($c_compiler -dumpspecs | sha256sum | awk '{print $1}')" + +if ! command -v ldd >/dev/null 2>&1; then + echo "ldd is required to identify compiler runtime dependencies" >&2 + exit 1 +fi + +runtime_dependency_records() { + local role=$1 executable=$2 output dependencies name dependency + + if ! output="$(LC_ALL=C ldd "$executable" 2>&1)"; then + case "$output" in + *"not a dynamic executable"*|*"statically linked"*) return 0 ;; + *) + echo "Could not inspect runtime dependencies for $executable: $output" >&2 + return 1 + ;; + esac + fi + if [[ "$output" == *"=> not found"* ]]; then + echo "Unresolved runtime dependency for $executable: $output" >&2 + return 1 + fi + + dependencies="$(printf '%s\n' "$output" | awk ' + /=> \/[^ ]+/ { print $1 "\t" $(NF - 1) } + $1 ~ /^\// { + name = $1 + sub(/^.*\//, "", name) + print name "\t" $1 + } + ')" + if [ -z "$dependencies" ]; then + case "$output" in + *"statically linked"*|*"not a dynamic executable"*) return 0 ;; + *) + echo "No runtime dependencies could be parsed for $executable: $output" >&2 + return 1 + ;; + esac + fi + + while IFS=$'\t' read -r name dependency; do + dependency="$(readlink -f "$dependency")" + if [ ! -f "$dependency" ]; then + echo "Runtime dependency not found for $executable: $dependency" >&2 + return 1 + fi + printf '%s:%s:%s\n' "$role" "$name" "$(hash_file "$dependency")" + done <<< "$dependencies" +} + +runtime_dependencies="$({ + runtime_dependency_records c_driver "$c_path" + runtime_dependency_records cxx_driver "$cxx_path" + runtime_dependency_records cc1 "$cc1_path" + runtime_dependency_records cc1plus "$cc1plus_path" + runtime_dependency_records lto1 "$lto1_path" + runtime_dependency_records assembler "$assembler_path" +} | LC_ALL=C sort)" + +signature_record="$({ + printf 'format=wsjtx-linux-ccache-compiler-signature-v2\n' + printf 'c_driver_sha256=%s\n' "$(hash_file "$c_path")" + printf 'cxx_driver_sha256=%s\n' "$(hash_file "$cxx_path")" + printf 'cc1_sha256=%s\n' "$(hash_file "$cc1_path")" + printf 'cc1plus_sha256=%s\n' "$(hash_file "$cc1plus_path")" + printf 'lto1_sha256=%s\n' "$(hash_file "$lto1_path")" + printf 'assembler_sha256=%s\n' "$(hash_file "$assembler_path")" + printf 'target=%s\n' "$compiler_target" + printf 'dumpspecs_sha256=%s\n' "$dumpspecs_sha256" + while IFS= read -r dependency_record; do + if [ -n "$dependency_record" ]; then + printf 'runtime_dependency=%s\n' "$dependency_record" + fi + done <<< "$runtime_dependencies" +})" +compiler_signature_sha256="$(printf '%s\n' "$signature_record" | sha256sum | awk '{print $1}')" +compiler_major=${compiler_version%%.*} + +printf '%s\t%s\t%s\t%s\t%s\n' \ + "$compiler_version" \ + "$compiler_target" \ + "$(hash_file "$c_path")" \ + "gcc${compiler_major}-v2" \ + "$compiler_signature_sha256" diff --git a/.github/scripts/linux-ci-image-config.sh b/.github/scripts/linux-ci-image-config.sh new file mode 100755 index 00000000..d9742d96 --- /dev/null +++ b/.github/scripts/linux-ci-image-config.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +# Shared dependency tuple embedded in the normal and ARM Linux CI images. +# shellcheck disable=SC2034 + +LINUX_CI_IMAGE_SCHEMA=1 + +LINUX_PFUNIT_VERSION=4.14.0 +LINUX_PFUNIT_REF=v${LINUX_PFUNIT_VERSION} +LINUX_PFUNIT_COMMIT=29ddfad16e10958bbe4a685d1fde17678296c19a + +LINUX_HAMLIB_REF=4.7.2 +LINUX_HAMLIB_COMMIT=40f63488fe0bd751b147f48d62fd217bf53713a0 + +LINUX_CI_PREFIX=/opt/wsjtx +LINUX_PFUNIT_PREFIX=${LINUX_CI_PREFIX}/pfunit +LINUX_HAMLIB_PREFIX=${LINUX_CI_PREFIX}/hamlib diff --git a/.github/scripts/linux-ci-image-fingerprint.sh b/.github/scripts/linux-ci-image-fingerprint.sh new file mode 100755 index 00000000..02920299 --- /dev/null +++ b/.github/scripts/linux-ci-image-fingerprint.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 1 ]; then + echo "Usage: linux-ci-image-fingerprint.sh normal-noble|normal-bookworm|tsan-noble|armhf-cross-bookworm|armhf-runtime-bookworm" >&2 + exit 2 +fi + +profile=$1 +. .github/scripts/linux-ci-image-inputs.sh +files=() +inputs="$(linux_ci_image_inputs "$profile")" +while IFS= read -r file; do + files+=("$file") +done <<< "$inputs" + +sha256sum "${files[@]}" | sha256sum | awk '{print $1}' diff --git a/.github/scripts/linux-ci-image-inputs.sh b/.github/scripts/linux-ci-image-inputs.sh new file mode 100644 index 00000000..bc3e43af --- /dev/null +++ b/.github/scripts/linux-ci-image-inputs.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash + +# Prints the files whose contents define a Linux CI image profile. +linux_ci_image_inputs() { + local profile=$1 + local common=( + .github/images/linux-ci/install-packages.sh + .github/images/linux-ci/write-manifest.sh + .github/scripts/linux-ci-image-fingerprint.sh + .github/scripts/linux-ci-image-inputs.sh + .github/scripts/linux-ci-image-config.sh + .github/scripts/linux-ccache-compiler-signature.sh + .github/scripts/run-apt-get.sh + .github/scripts/verify-linux-ci-image.sh + ) + + case "$profile" in + normal-noble) + printf '%s\n' \ + "${common[@]}" \ + .github/images/linux-ci/Dockerfile.noble \ + .github/scripts/build-pfunit-linux.sh \ + .github/scripts/build-hamlib-linux.sh + ;; + normal-bookworm) + printf '%s\n' \ + "${common[@]}" \ + .github/images/linux-ci/Dockerfile.bookworm \ + .github/scripts/build-pfunit-linux.sh \ + .github/scripts/build-hamlib-linux.sh + ;; + armhf-cross-bookworm) + printf '%s\n' \ + .github/images/linux-ci/Dockerfile.armhf-cross \ + .github/images/linux-ci/armhf-cross-toolchain.config \ + .github/scripts/armhf-ci-image-config.sh \ + .github/scripts/build-armhf-toolchain-smoke.sh \ + .github/scripts/build-hamlib-armhf-cross.sh \ + .github/scripts/linux-ccache-compiler-signature.sh \ + .github/scripts/linux-ci-image-config.sh \ + .github/scripts/linux-ci-image-fingerprint.sh \ + .github/scripts/linux-ci-image-inputs.sh \ + .github/scripts/normalize-armhf-sysroot-symlinks.sh \ + .github/scripts/run-apt-get.sh \ + .github/scripts/verify-armhf-ci-image.sh \ + .github/scripts/write-armhf-ci-manifest.sh + ;; + armhf-runtime-bookworm) + printf '%s\n' \ + .github/images/linux-ci/Dockerfile.armhf-runtime \ + .github/images/linux-ci/install-armhf-runtime-packages.sh \ + .github/scripts/armhf-ci-image-config.sh \ + .github/scripts/linux-ci-image-config.sh \ + .github/scripts/linux-ci-image-fingerprint.sh \ + .github/scripts/linux-ci-image-inputs.sh \ + .github/scripts/run-apt-get.sh \ + .github/scripts/verify-armhf-ci-image.sh \ + .github/scripts/write-armhf-ci-manifest.sh + ;; + tsan-noble) + printf '%s\n' \ + "${common[@]}" \ + .github/images/linux-ci/Dockerfile.noble \ + .github/scripts/tsan-linux-deps-config.sh \ + .github/scripts/build-qt-tsan-linux.sh \ + .github/scripts/build-boost-tsan-linux.sh \ + .github/scripts/build-hamlib-tsan-linux.sh \ + .github/scripts/verify-tsan-deps-linux.sh + ;; + *) + echo "Unsupported Linux CI image profile: $profile" >&2 + return 2 + ;; + esac +} diff --git a/.github/scripts/list-release-assets.sh b/.github/scripts/list-release-assets.sh new file mode 100755 index 00000000..28c62c95 --- /dev/null +++ b/.github/scripts/list-release-assets.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 2 ]; then + echo "Usage: $0 ARTIFACTS_DIRECTORY VERSION" >&2 + exit 2 +fi + +artifacts_directory="$1" +version="$2" + +find "$artifacts_directory" -maxdepth 2 -type f \ + \( -path "$artifacts_directory/wsjtx-${version}-arm64-macOS.pkg/*.pkg" \ + -o -path "$artifacts_directory/wsjtx-${version}-x86_64-macOS.pkg/*.pkg" \ + -o -path "$artifacts_directory/wsjtx-${version}-linux-*-AppImage/*.AppImage" \ + -o -path "$artifacts_directory/wsjtx-${version}-linux-*-deb/*.deb" \ + -o -path "$artifacts_directory/wsjtx-${version}-linux-*-rpm/*.rpm" \ + -o -path "$artifacts_directory/wsjtx-${version}-windows-x86_64-installer/*.exe" \ + -o -path "$artifacts_directory/wsjtx-${version}-src.tar.gz" \ + \) -print | sort diff --git a/.github/scripts/normalize-armhf-sysroot-symlinks.sh b/.github/scripts/normalize-armhf-sysroot-symlinks.sh new file mode 100755 index 00000000..09a0403b --- /dev/null +++ b/.github/scripts/normalize-armhf-sysroot-symlinks.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 1 ]; then + echo "Usage: normalize-armhf-sysroot-symlinks.sh SYSROOT" >&2 + exit 2 +fi + +sysroot=${1%/} +if [ ! -d "$sysroot" ]; then + echo "ARMHF sysroot does not exist: $sysroot" >&2 + exit 1 +fi + +# Debian packages may contain absolute library links. Make them relative so an +# x86 linker cannot follow them into the builder host instead of the sysroot. +count=0 +while IFS= read -r -d '' link; do + target="$(readlink -- "$link")" + case "$target" in + /*) + relative="$(realpath --canonicalize-missing \ + --relative-to="$(dirname -- "$link")" "$sysroot$target")" + ln -sfn -- "$relative" "$link" + count=$((count + 1)) + ;; + esac +done < <(find "$sysroot" -type l -print0) + +echo "Normalized $count absolute ARMHF sysroot symlinks" diff --git a/.github/scripts/package-linux-armhf.sh b/.github/scripts/package-linux-armhf.sh new file mode 100755 index 00000000..abef3284 --- /dev/null +++ b/.github/scripts/package-linux-armhf.sh @@ -0,0 +1,137 @@ +#!/usr/bin/env bash +set -euo pipefail + +VERSION="${VERSION:?missing}" +ARCH="${ARCH:?missing}" +if [ "$ARCH" != armhf ]; then + echo "package-linux-armhf.sh supports only arch=armhf" >&2 + exit 2 +fi + +github_api_token="${GITHUB_TOKEN:-}" +unset GITHUB_TOKEN +cd /work +# shellcheck source=.github/scripts/armhf-ci-image-config.sh +source .github/scripts/armhf-ci-image-config.sh +# shellcheck source=.github/scripts/linux-artifact-validation.sh +source .github/scripts/linux-artifact-validation.sh +export LD_LIBRARY_PATH="$ARMHF_RUNTIME_PREFIX" +export ARMHF_QEMU_EXECUTABLE +export LINUX_APPIMAGE_RUNNER="$ARMHF_QEMU_EXECUTABLE" + +echo "::group::Package .deb" +( + cd wsjtx-build + cpack -G DEB \ + -D "CPACK_DEBIAN_FILE_NAME=wsjtx-${VERSION}-linux-${ARCH}.deb" \ + -D "CPACK_INSTALL_CMAKE_PROJECTS=" \ + -D "CPACK_INSTALLED_DIRECTORIES=/work/AppDir;/" +) +DEB="wsjtx-build/wsjtx-${VERSION}-linux-${ARCH}.deb" +if [ ! -f "$DEB" ]; then + echo "::error::cpack -G DEB produced no package at $DEB" + exit 1 +fi +dpkg-deb --info "$DEB" | sed -n '1,20p' +deb_arch="$(dpkg-deb -f "$DEB" Architecture)" +if [ "$deb_arch" != armhf ]; then + echo "::error::DEB architecture is $deb_arch, expected armhf" + exit 1 +fi +validate_deb_package "$DEB" +echo "::endgroup::" + +echo "::group::Package RPM" +( + cd wsjtx-build + cpack -G RPM \ + -D "CPACK_INSTALL_CMAKE_PROJECTS=" \ + -D "CPACK_INSTALLED_DIRECTORIES=/work/AppDir;/" +) +rpms=(wsjtx-build/*.rpm) +if [ ! -f "${rpms[0]}" ]; then + echo "::error::cpack -G RPM produced no package" + exit 1 +fi +RPM=${rpms[0]} +rpm_arch="$(rpm -qp --qf '%{ARCH}' "$RPM")" +case "$rpm_arch" in + armv7hl|armv7l) ;; + *) echo "::error::RPM architecture is $rpm_arch, expected armv7"; exit 1 ;; +esac +rpm -qpi "$RPM" +rpm -qpR "$RPM" +validate_rpm_package "$RPM" +echo "::endgroup::" + +echo "::group::Validate AppDir" +validate_linux_application_tree AppDir appdir "$ARCH" +echo "::endgroup::" + +echo "::group::Package AppImage" +LINUXDEPLOY_TAG=1-alpha-20251107-1 +LINUXDEPLOY_SHA256=e359161979fa4bee50b92ce7102fb510299caebf34f711d983fba7a8f4bb1c2e +QT_PLUGIN_ASSET_NAME=linuxdeploy-plugin-qt-armhf.AppImage +curl_flags=(--fail --show-error --silent --location --retry 5 --retry-delay 5) +github_api_curl() { + local api_headers=(-H "User-Agent: wsjtx-ci") + if [ -n "$github_api_token" ]; then + api_headers+=(-H "Authorization: Bearer ${github_api_token}") + env GITHUB_TOKEN="$github_api_token" curl "${curl_flags[@]}" "${api_headers[@]}" "$@" + else + curl "${curl_flags[@]}" "${api_headers[@]}" "$@" + fi +} +QT_PLUGIN_ASSET_ID="$( + github_api_curl -H "Accept: application/vnd.github+json" \ + "https://api.github.com/repos/linuxdeploy/linuxdeploy-plugin-qt/releases/tags/continuous" | + python3 -c 'import json, sys; name = sys.argv[1]; matches = [asset for asset in json.load(sys.stdin)["assets"] if asset["name"] == name]; print(matches[0]["id"]) if matches else sys.exit("asset not found: " + name)' "$QT_PLUGIN_ASSET_NAME" +)" +curl "${curl_flags[@]}" -o linuxdeploy.AppImage \ + "https://github.com/linuxdeploy/linuxdeploy/releases/download/${LINUXDEPLOY_TAG}/linuxdeploy-armhf.AppImage" +mkdir -p wsjtx-build/appimage-tools +github_api_curl -H "Accept: application/octet-stream" \ + -o wsjtx-build/appimage-tools/qt-plugin.AppImage \ + "https://api.github.com/repos/linuxdeploy/linuxdeploy-plugin-qt/releases/assets/${QT_PLUGIN_ASSET_ID}" +echo "$LINUXDEPLOY_SHA256 linuxdeploy.AppImage" | sha256sum -c - +chmod +x linuxdeploy.AppImage wsjtx-build/appimage-tools/qt-plugin.AppImage +# shellcheck disable=SC2016 # variables expand when the generated wrapper runs +printf '%s\n' \ + '#!/bin/sh' \ + 'exec "${ARMHF_QEMU_EXECUTABLE:?}" /work/wsjtx-build/appimage-tools/qt-plugin.AppImage "$@"' \ + > linuxdeploy-plugin-qt.AppImage +chmod +x linuxdeploy-plugin-qt.AppImage +# Supply linuxdeploy with the non-executing ARMHF resolver; native ldd cannot +# safely enter the target loader from this already-emulated container. +ln -sfn /work/.github/scripts/armhf-static-ldd.sh wsjtx-build/appimage-tools/ldd + +for target in AppDir/usr/bin/wsjtx AppDir/usr/bin/jt9 AppDir/usr/bin/qmap \ + AppDir/usr/bin/map65; do + wsjtx-build/appimage-tools/ldd "$target" +done + +export APPIMAGE_EXTRACT_AND_RUN=1 +export OUTPUT="wsjtx-${VERSION}-linux-${ARCH}.AppImage" +env -u GITHUB_TOKEN PATH="/work/wsjtx-build/appimage-tools:$PATH" \ + "$ARMHF_QEMU_EXECUTABLE" \ + ./linuxdeploy.AppImage --appimage-extract-and-run \ + --appdir AppDir \ + --plugin qt \ + --output appimage \ + --desktop-file AppDir/usr/share/applications/wsjtx.desktop \ + --icon-file AppDir/usr/share/pixmaps/wsjtx_icon.png +file "$OUTPUT" +echo "::endgroup::" + +echo "::group::Validate AppImage payload" +"$ARMHF_QEMU_EXECUTABLE" ./"$OUTPUT" --appimage-extract >/dev/null +validate_linux_application_tree squashfs-root appimage "$ARCH" +rm -rf /work/squashfs-root +echo "::endgroup::" + +echo "::group::AppImage startup smoke" +run_packaged_appimage_startup_smoke \ + "./$OUTPUT" wsjtx-build/appimage-startup-smoke.log +echo "::endgroup::" + +echo "ARMHF package phase complete for version=$VERSION" diff --git a/.github/scripts/release-policy.py b/.github/scripts/release-policy.py new file mode 100644 index 00000000..ec7abe09 --- /dev/null +++ b/.github/scripts/release-policy.py @@ -0,0 +1,406 @@ +#!/usr/bin/env python3 +"""Validate release identity and installer artifact policy.""" + +from __future__ import annotations + +import argparse +import hashlib +import json +import re +import sys +import tarfile +import zipfile +from pathlib import Path + + +VERSION_RE = re.compile(r"^(?P\d+\.\d+\.\d+)(?:-rc(?P[1-9]\d*))?$") +MACOS_MODES = ("validation", "distribution") +WINDOWS_MODES = ("signpath", "unsigned") + + +def classify(version: str) -> dict[str, str]: + match = VERSION_RE.fullmatch(version) + if not match: + raise ValueError("version must be X.Y.Z or X.Y.Z-rcN") + rc = match.group("rc") or "" + numeric = match.group("numeric") + major, minor, _ = numeric.split(".") + return { + "version": version, + "numeric": numeric, + "channel": "RC" if rc else "GA", + "rc_number": rc, + "release_branch": f"release/{major}.{minor}", + } + + +def parse_state(contents: str, *, expected_revision: str | None = None) -> dict[str, str]: + state = {} + for line in contents.splitlines(): + key, separator, value = line.partition("=") + if not separator or key in state: + raise ValueError("release-state.txt must contain unique key=value lines") + state[key] = value + required_keys = {"version", "channel", "rc", "revision"} + if not required_keys <= set(state) or set(state) - required_keys - {"windows_signing"}: + raise ValueError("release-state.txt must define version, channel, rc, revision, and optionally windows_signing") + state.setdefault("windows_signing", "signpath") + if state["windows_signing"] not in WINDOWS_MODES: + raise ValueError("release-state.txt windows_signing must be signpath or unsigned") + if state["channel"] not in {"DEVEL", "RC", "GA"}: + raise ValueError("release-state.txt channel must be DEVEL, RC, or GA") + if not re.fullmatch(r"\d+\.\d+\.\d+", state["version"]): + raise ValueError("release-state.txt version must be X.Y.Z") + if state["channel"] == "RC": + if not re.fullmatch(r"[1-9]\d*", state["rc"]): + raise ValueError("RC release state requires a positive RC number") + elif state["rc"]: + raise ValueError("DEVEL and GA release states require an empty RC number") + required_revision = expected_revision or "$Format:%H$" + if state["revision"].lower() != required_revision.lower(): + raise ValueError(f"release-state.txt revision must be {required_revision}") + return state + + +def read_state(root: Path, *, expected_revision: str | None = None) -> dict[str, str]: + return parse_state( + (root / "release-state.txt").read_text(encoding="utf-8"), + expected_revision=expected_revision, + ) + + +def validate_source(root: Path, version: str) -> dict[str, str]: + identity = classify(version) + state = read_state(root) + errors = [] + if state["version"] != identity["numeric"]: + errors.append(f"release-state version {state['version']} does not match {identity['numeric']}") + if state["channel"] != identity["channel"]: + errors.append(f"release channel {state['channel']} does not match {identity['channel']}") + if state["rc"] != identity["rc_number"]: + errors.append(f"RC number {state['rc'] or ''} does not match {identity['rc_number'] or ''}") + if errors: + raise ValueError("; ".join(errors)) + identity["windows_signing"] = state["windows_signing"] + return identity + + +def validate_archive(path: Path, version: str, commit: str) -> None: + if not re.fullmatch(r"[0-9a-f]{40}|[0-9a-f]{64}", commit): + raise ValueError("archive commit must be a full lowercase Git object ID") + names: list[str] + release_state_contents: str + if zipfile.is_zipfile(path): + with zipfile.ZipFile(path) as archive: + names = archive.namelist() + matches = [name for name in names if name.count("/") == 1 and name.endswith("/release-state.txt")] + if len(matches) != 1: + raise ValueError("source archive must contain one top-level release-state.txt") + release_state_contents = archive.read(matches[0]).decode("utf-8") + else: + with tarfile.open(path, "r:*") as archive: + names = archive.getnames() + matches = [name for name in names if name.count("/") == 1 and name.endswith("/release-state.txt")] + if len(matches) != 1: + raise ValueError("source archive must contain one top-level release-state.txt") + member = archive.extractfile(matches[0]) + if member is None: + raise ValueError("source archive release-state.txt is not a regular file") + release_state_contents = member.read().decode("utf-8") + if any(part == ".git" for name in names for part in Path(name).parts): + raise ValueError("source archive must not contain .git metadata") + identity = classify(version) + state = parse_state(release_state_contents, expected_revision=commit) + if state["version"] != identity["numeric"] or state["channel"] != identity["channel"] or state["rc"] != identity["rc_number"]: + raise ValueError("source archive release identity does not match its tag") + + +def expected_assets(version: str, distribution: bool) -> list[str]: + mac_suffix = "macOS.pkg" if distribution else "macOS-unsigned.pkg" + return [ + f"wsjtx-{version}-arm64-{mac_suffix}", + f"wsjtx-{version}-x86_64-{mac_suffix}", + f"wsjtx-{version}-linux-x86_64-AppImage", + f"wsjtx-{version}-linux-aarch64-AppImage", + f"wsjtx-{version}-linux-armhf-AppImage", + f"wsjtx-{version}-windows-x86_64-installer-signed" if distribution else f"wsjtx-{version}-windows-x86_64-installer", + ] + + +def public_expected_assets(version: str, macos_mode: str, windows_mode: str = "signpath") -> list[str]: + if macos_mode not in MACOS_MODES: + raise ValueError(f"unsupported macOS release mode: {macos_mode}") + if windows_mode not in WINDOWS_MODES: + raise ValueError(f"unsupported Windows release mode: {windows_mode}") + mac_suffix = "macOS.pkg" if macos_mode == "distribution" else "macOS-unsigned.pkg" + return [ + f"wsjtx-{version}-arm64-{mac_suffix}", + f"wsjtx-{version}-x86_64-{mac_suffix}", + f"wsjtx-{version}-linux-x86_64-AppImage", + f"wsjtx-{version}-linux-aarch64-AppImage", + f"wsjtx-{version}-linux-armhf-AppImage", + f"wsjtx-{version}-windows-x86_64-installer{'-signed' if windows_mode == 'signpath' else ''}", + ] + + +def collect_asset_files(root: Path, expected: list[str]) -> list[Path]: + files: list[Path] = [] + for artifact in expected: + directory = root / artifact + if not directory.is_dir(): + raise ValueError(f"missing artifact directory: {artifact}") + suffix = ".pkg" if "macOS" in artifact else ".AppImage" if "linux" in artifact else ".exe" + matches = sorted(path for path in directory.rglob(f"*{suffix}") if path.is_file()) + if len(matches) != 1: + raise ValueError(f"{artifact} must contain exactly one {suffix} file; found {len(matches)}") + if matches[0].stat().st_size == 0: + raise ValueError(f"artifact is empty: {matches[0]}") + files.append(matches[0]) + return files + + +def find_asset_files(root: Path, version: str, distribution: bool) -> list[Path]: + files = collect_asset_files(root, expected_assets(version, distribution)) + if distribution: + unsigned = sorted(root.rglob("*-unsigned.pkg")) + if unsigned: + raise ValueError(f"unsigned macOS packages cannot be published: {unsigned[0]}") + return files + + +def find_public_asset_files( + root: Path, version: str, macos_mode: str, windows_mode: str = "signpath" +) -> list[Path]: + files = collect_asset_files(root, public_expected_assets(version, macos_mode, windows_mode)) + if macos_mode == "distribution": + unsigned = sorted(root.rglob("*-unsigned.pkg")) + if unsigned: + raise ValueError(f"unsigned macOS packages cannot be published: {unsigned[0]}") + if windows_mode == "unsigned": + installer = files[-1] + if installer.name != f"wsjtx-{version}-win64.exe": + raise ValueError(f"unexpected unsigned Windows installer: {installer.name}") + if (root / f"wsjtx-{version}-windows-x86_64-installer-signed").exists(): + raise ValueError("signed Windows installer cannot accompany unsigned release") + return files + + +def release_files( + root: Path, version: str, macos_mode: str = "distribution", windows_mode: str = "signpath" +) -> list[Path]: + files = find_public_asset_files(root, version, macos_mode, windows_mode) + for arch in ("x86_64", "aarch64", "armhf"): + for package_type, suffix in (("deb", ".deb"), ("rpm", ".rpm")): + directory = root / f"wsjtx-{version}-linux-{arch}-{package_type}" + if not directory.is_dir(): + raise ValueError(f"missing artifact directory: {directory.name}") + matches = sorted(path for path in directory.rglob(f"*{suffix}") if path.is_file()) + if len(matches) != 1 or matches[0].stat().st_size == 0: + raise ValueError(f"{directory.name} must contain exactly one non-empty {suffix} file") + files.append(matches[0]) + source = root / f"wsjtx-{version}-src.tar.gz" + if not source.is_file() or source.stat().st_size == 0: + raise ValueError(f"missing source archive: {source.name}") + files.append(source) + names = [path.name for path in files] + if len(names) != len(set(names)): + raise ValueError("release assets must have unique filenames") + return sorted(files, key=lambda item: item.name) + + +def hash_file(path: Path) -> str: + digest = hashlib.sha256() + with path.open("rb") as stream: + for chunk in iter(lambda: stream.read(1024 * 1024), b""): + digest.update(chunk) + return digest.hexdigest() + + +def read_single_json(directory: Path) -> dict: + matches = sorted(directory.glob("*.json")) + if len(matches) != 1: + raise ValueError(f"{directory.name} must contain exactly one JSON report") + return json.loads(matches[0].read_text(encoding="utf-8")) + + +def verify_signing_reports( + root: Path, version: str, commit: str, tag: str, macos_mode: str = "distribution", + windows_mode: str = "signpath", +) -> None: + if macos_mode not in MACOS_MODES: + raise ValueError(f"unsupported macOS release mode: {macos_mode}") + if windows_mode not in WINDOWS_MODES: + raise ValueError(f"unsupported Windows release mode: {windows_mode}") + for arch in ("arm64", "x86_64"): + report = read_single_json(root / f"macos-signing-report-{version}-{arch}") + if report.get("mode") != macos_mode or report.get("git_sha") != commit: + raise ValueError(f"macOS {arch} report does not bind {macos_mode} packaging to {commit}") + if macos_mode == "distribution": + if report.get("notarization", {}).get("status") != "Accepted": + raise ValueError(f"macOS {arch} notarization was not accepted") + if report.get("stapled") is not True or report.get("gatekeeper_accepted") is not True: + raise ValueError(f"macOS {arch} trust verification is incomplete") + if not re.fullmatch(r"[A-Z0-9]{10}", report.get("team_id", "")): + raise ValueError(f"macOS {arch} report has no verified Apple Team ID") + for field in ("application_certificate_sha1", "installer_certificate_sha1"): + if not re.fullmatch(r"[0-9A-F]{40}", report.get(field, "")): + raise ValueError(f"macOS {arch} report has no verified {field}") + artifact_dir = f"wsjtx-{version}-{arch}-macOS.pkg" + else: + if any(report.get(field) is not False for field in ("signed", "notarized", "publishable")): + raise ValueError(f"macOS {arch} validation report does not describe an unsigned package") + artifact_dir = f"wsjtx-{version}-{arch}-macOS-unsigned.pkg" + package = root / artifact_dir / report.get("artifact", "") + if not package.is_file() or report.get("sha256") != hash_file(package): + raise ValueError(f"macOS {arch} report hash does not match its package") + + if windows_mode == "unsigned": + for suffix in ("windows-signing-request", "windows-signing-verification"): + if (root / f"wsjtx-{version}-{suffix}").exists(): + raise ValueError(f"Windows signing report cannot accompany unsigned release: {suffix}") + return + + request = read_single_json(root / f"wsjtx-{version}-windows-signing-request") + verification = read_single_json(root / f"wsjtx-{version}-windows-signing-verification") + if request.get("policy") != "release-signing" or request.get("commit") != commit: + raise ValueError("Windows signing request does not match the release commit and policy") + if request.get("tag") != tag: + raise ValueError("Windows signing request does not match the release tag") + if verification.get("commit") != commit or verification.get("tag") != tag: + raise ValueError("Windows verification report does not match the release ref") + if verification.get("status") != "Valid" or not verification.get("timestamp_thumbprint"): + raise ValueError("Windows signature or timestamp is not trusted") + if verification.get("identity_verified") is not True: + raise ValueError("Windows signer identity was not verified against the release allowlist") + if not verification.get("signer_subject") or not verification.get("signer_thumbprint"): + raise ValueError("Windows signer identity is missing from the verification report") + installer = root / f"wsjtx-{version}-windows-x86_64-installer-signed" / verification.get("artifact", "") + if not installer.is_file() or verification.get("sha256") != hash_file(installer): + raise ValueError("Windows verification report hash does not match its installer") + + +def write_manifest(args: argparse.Namespace) -> None: + root = Path(args.artifacts) + digests = { + "x86_64": args.linux_x86_64_digest, + "aarch64": args.linux_aarch64_digest, + "armhf_cross": args.linux_armhf_cross_digest, + "armhf_runtime": args.linux_armhf_digest, + } + for arch, digest in digests.items(): + if not re.fullmatch(r"sha256:[0-9a-f]{64}", digest): + raise ValueError(f"Linux {arch} builder digest is not an immutable sha256 digest") + files = release_files(root, args.version, args.macos_mode, args.windows_mode) + replaceable_macos = ( + {f"wsjtx-{args.version}-{arch}-macOS.pkg" for arch in ("arm64", "x86_64")} + if args.macos_mode == "validation" + else set() + ) + entries = [ + {"name": path.name, "sha256": hash_file(path), "size": path.stat().st_size} + for path in sorted(files, key=lambda item: item.name) + if path.name not in replaceable_macos + ] + manifest = { + "schema": 1, + "repository": args.repository, + "tag": f"v{args.version}", + "commit": args.commit, + "workflow_run": args.run_id, + "linux_builders": digests, + "macos_signing": { + "mode": "manual" if args.macos_mode == "validation" else "distribution", + "replaceable_assets": sorted(replaceable_macos), + }, + "windows_signing": {"mode": args.windows_mode}, + "assets": entries, + } + output = root / "release-manifest.json" + output.write_text(json.dumps(manifest, indent=2) + "\n", encoding="utf-8") + checksums = root / "SHA256SUMS" + checksums.write_text( + "".join(f"{entry['sha256']} {entry['name']}\n" for entry in entries), + encoding="utf-8", + ) + + +def main() -> int: + parser = argparse.ArgumentParser() + subparsers = parser.add_subparsers(dest="command", required=True) + classify_parser = subparsers.add_parser("classify") + classify_parser.add_argument("version") + state_parser = subparsers.add_parser("read-state") + state_parser.add_argument("--root", default=".") + validate_parser = subparsers.add_parser("validate-source") + validate_parser.add_argument("version") + validate_parser.add_argument("--root", default=".") + archive_parser = subparsers.add_parser("validate-archive") + archive_parser.add_argument("version") + archive_parser.add_argument("archive") + archive_parser.add_argument("--commit", required=True) + assets_parser = subparsers.add_parser("verify-assets") + assets_parser.add_argument("version") + assets_parser.add_argument("artifacts") + assets_parser.add_argument("--distribution", action="store_true") + assets_parser.add_argument("--macos-mode", choices=MACOS_MODES) + assets_parser.add_argument("--windows-mode", choices=WINDOWS_MODES, default="signpath") + files_parser = subparsers.add_parser("release-files") + files_parser.add_argument("version") + files_parser.add_argument("artifacts") + files_parser.add_argument("--macos-mode", choices=MACOS_MODES, default="distribution") + files_parser.add_argument("--windows-mode", choices=WINDOWS_MODES, default="signpath") + reports_parser = subparsers.add_parser("verify-signing-reports") + reports_parser.add_argument("version") + reports_parser.add_argument("artifacts") + reports_parser.add_argument("--commit", required=True) + reports_parser.add_argument("--tag", required=True) + reports_parser.add_argument("--macos-mode", choices=MACOS_MODES, default="distribution") + reports_parser.add_argument("--windows-mode", choices=WINDOWS_MODES, default="signpath") + manifest_parser = subparsers.add_parser("write-manifest") + manifest_parser.add_argument("version") + manifest_parser.add_argument("artifacts") + manifest_parser.add_argument("--repository", required=True) + manifest_parser.add_argument("--commit", required=True) + manifest_parser.add_argument("--run-id", required=True) + manifest_parser.add_argument("--linux-x86-64-digest", required=True) + manifest_parser.add_argument("--linux-aarch64-digest", required=True) + manifest_parser.add_argument("--linux-armhf-cross-digest", required=True) + manifest_parser.add_argument("--linux-armhf-digest", required=True) + manifest_parser.add_argument("--macos-mode", choices=MACOS_MODES, default="distribution") + manifest_parser.add_argument("--windows-mode", choices=WINDOWS_MODES, default="signpath") + args = parser.parse_args() + try: + if args.command == "classify": + print(json.dumps(classify(args.version))) + elif args.command == "read-state": + print(json.dumps(read_state(Path(args.root)))) + elif args.command == "validate-source": + print(json.dumps(validate_source(Path(args.root), args.version))) + elif args.command == "validate-archive": + validate_archive(Path(args.archive), args.version, args.commit) + elif args.command == "verify-assets": + files = ( + find_public_asset_files(Path(args.artifacts), args.version, args.macos_mode, args.windows_mode) + if args.macos_mode + else find_asset_files(Path(args.artifacts), args.version, args.distribution) + ) + for path in files: + print(path) + elif args.command == "release-files": + for path in release_files(Path(args.artifacts), args.version, args.macos_mode, args.windows_mode): + print(path) + elif args.command == "verify-signing-reports": + verify_signing_reports( + Path(args.artifacts), args.version, args.commit, args.tag, args.macos_mode, + args.windows_mode, + ) + else: + write_manifest(args) + except (OSError, ValueError, tarfile.TarError, zipfile.BadZipFile) as error: + print(f"release policy error: {error}", file=sys.stderr) + return 1 + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/.github/scripts/resolve-linux-ci-image-tag.py b/.github/scripts/resolve-linux-ci-image-tag.py new file mode 100755 index 00000000..8f67bc0e --- /dev/null +++ b/.github/scripts/resolve-linux-ci-image-tag.py @@ -0,0 +1,124 @@ +#!/usr/bin/env python3 +"""Resolve the coherent immutable generation selected by linux-noble:stable.""" + +from __future__ import annotations + +import os +import re +import sys +from pathlib import Path + + +sys.path.insert(0, str(Path(__file__).parent)) +from ghcr_retention import GitHubPackagesClient, Version # noqa: E402, F401 + + +OWNER = "WSJTX" +NORMAL_PACKAGE = "wsjtx-internal/linux-noble" +TSAN_PACKAGE = "wsjtx-internal/linux-tsan-noble" +ARM64_PACKAGE = "wsjtx-internal/linux-arm64-bookworm" +ARMHF_PACKAGE = "wsjtx-internal/linux-armv7-bookworm" +ARMHF_CROSS_PACKAGE = "wsjtx-internal/linux-armhf-cross-bookworm" +ROUTINE_PACKAGES = (ARM64_PACKAGE,) +BUILD_TAG = re.compile(r"^build-\d{8}-\d+-\d+$") + + +def resolve(client: GitHubPackagesClient, *, require_armhf: bool = False) -> str: + versions = client.list_versions(OWNER, NORMAL_PACKAGE) + stable = [version for version in versions if "stable" in version.tags] + if not stable: + raise RuntimeError( + "No promoted Linux CI image generation is available: " + "linux-noble:stable is missing. Bootstrap the GHCR images with " + "warm-dependency-caches.yml before running Linux CI." + ) + if len(stable) != 1: + raise RuntimeError(f"expected one linux-noble:stable version, found {len(stable)}") + build_tags = [tag for tag in stable[0].tags if BUILD_TAG.fullmatch(tag)] + if len(build_tags) != 1: + raise RuntimeError( + "linux-noble:stable must share a version with exactly one immutable build tag" + ) + generation = build_tags[0] + required_packages = ROUTINE_PACKAGES + ((ARMHF_PACKAGE,) if require_armhf else ()) + for package in required_packages: + if not any(generation in version.tags for version in client.list_versions(OWNER, package)): + raise RuntimeError(f"{package}:{generation} does not exist") + return generation + + +def resolve_armhf(client: GitHubPackagesClient) -> str: + versions = client.list_versions(OWNER, ARMHF_PACKAGE) + stable = [version for version in versions if "stable" in version.tags] + if not stable: + raise RuntimeError( + "No promoted armhf Linux CI image generation is available: " + "linux-armv7-bookworm:stable is missing. Publish an armhf image " + "with include_armhf=true before running the armhf build." + ) + if len(stable) != 1: + raise RuntimeError( + "expected one linux-armv7-bookworm:stable version, " + f"found {len(stable)}" + ) + build_tags = [tag for tag in stable[0].tags if BUILD_TAG.fullmatch(tag)] + if len(build_tags) != 1: + raise RuntimeError( + "linux-armv7-bookworm:stable must share a version with exactly " + "one immutable build tag" + ) + generation = build_tags[0] + if not any( + generation in version.tags + for version in client.list_versions(OWNER, ARMHF_CROSS_PACKAGE) + ): + raise RuntimeError(f"{ARMHF_CROSS_PACKAGE}:{generation} does not exist") + return generation + + +def resolve_tsan(client: GitHubPackagesClient) -> str: + versions = client.list_versions(OWNER, TSAN_PACKAGE) + stable = [version for version in versions if "stable" in version.tags] + if not stable: + raise RuntimeError( + "No promoted TSan Linux CI image generation is available: " + "linux-tsan-noble:stable is missing. Publish an image with " + "image_set=tsan before running the TSan workflow." + ) + if len(stable) != 1: + raise RuntimeError( + "expected one linux-tsan-noble:stable version, " + f"found {len(stable)}" + ) + build_tags = [tag for tag in stable[0].tags if BUILD_TAG.fullmatch(tag)] + if len(build_tags) != 1: + raise RuntimeError( + "linux-tsan-noble:stable must share a version with exactly one " + "immutable build tag" + ) + return build_tags[0] + + +def main() -> int: + token = os.environ.get("GITHUB_TOKEN") + if not token: + print("GITHUB_TOKEN is required", file=sys.stderr) + return 2 + client = GitHubPackagesClient(token) + if os.environ.get("RESOLVE_ARMHF") == "true": + generation = resolve_armhf(client) + elif os.environ.get("RESOLVE_TSAN") == "true": + generation = resolve_tsan(client) + else: + require_armhf = os.environ.get("REQUIRE_ARMHF") == "true" + generation = resolve(client, require_armhf=require_armhf) + print(f"Resolved Linux CI image generation: {generation}") + output = os.environ.get("GITHUB_OUTPUT") + if output: + with open(output, "a", encoding="utf-8") as stream: + stream.write(f"image_tag={generation}\n") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/.github/scripts/run-apt-get.sh b/.github/scripts/run-apt-get.sh new file mode 100755 index 00000000..0e7c363e --- /dev/null +++ b/.github/scripts/run-apt-get.sh @@ -0,0 +1,96 @@ +#!/bin/bash + +set -euo pipefail + +if [ "$#" -eq 0 ]; then + echo "usage: $0 " >&2 + exit 2 +fi + +apt_options=( + -o Acquire::Retries=3 + -o Acquire::http::Timeout=30 + -o Acquire::https::Timeout=30 + -o DPkg::Lock::Timeout=60 +) + +run_privileged() { + if [ "$(id -u)" = "0" ]; then + "$@" + else + sudo "$@" + fi +} + +run_with_timeout() { + local timeout_limit="$1" + shift + run_privileged timeout --signal=TERM --kill-after=30s "$timeout_limit" "$@" +} + +is_timeout_status() { + [ "$1" -eq 124 ] || [ "$1" -eq 137 ] +} + +case "$1" in + update) + timeout_limit="${APT_UPDATE_TIMEOUT:-15m}" + status=0 + run_with_timeout "$timeout_limit" apt-get \ + "${apt_options[@]}" -o APT::Update::Error-Mode=any "$@" || status=$? + if is_timeout_status "$status"; then + echo "::error::apt-get update exceeded or was killed while enforcing its ${timeout_limit} wall-clock limit" + fi + exit "$status" + ;; + install) + download_timeout="${APT_DOWNLOAD_TIMEOUT:-${APT_INSTALL_TIMEOUT:-20m}}" + download_attempts="${APT_DOWNLOAD_ATTEMPTS:-2}" + case "$download_attempts" in + ''|*[!0-9]*|0) + echo "::error::APT_DOWNLOAD_ATTEMPTS must be a positive integer" >&2 + exit 2 + ;; + esac + + for ((attempt = 1; attempt <= download_attempts; ++attempt)); do + echo "::group::APT package acquisition attempt ${attempt}/${download_attempts}" + status=0 + run_with_timeout "$download_timeout" apt-get \ + "${apt_options[@]}" --download-only "$@" || status=$? + echo "::endgroup::" + + if [ "$status" -eq 0 ]; then + break + fi + if ! is_timeout_status "$status"; then + echo "::error::apt-get install failed during package acquisition with status ${status}" + exit "$status" + fi + if [ "$attempt" -eq "$download_attempts" ]; then + echo "::error::apt-get install package acquisition exceeded or was killed while enforcing its ${download_timeout} wall-clock limit" + exit "$status" + fi + echo "::warning::apt-get install package acquisition exceeded its ${download_timeout} wall-clock limit; retrying with cached partial downloads" + done + + echo "::group::APT package installation from local cache" + status=0 + run_privileged apt-get "${apt_options[@]}" --no-download "$@" || status=$? + echo "::endgroup::" + if [ "$status" -ne 0 ]; then + echo "::error::apt-get install failed during package unpacking or configuration with status ${status}" + run_privileged dpkg --audit || true + fi + exit "$status" + ;; + *) + timeout_limit="${APT_COMMAND_TIMEOUT:-20m}" + status=0 + run_with_timeout "$timeout_limit" apt-get "${apt_options[@]}" "$@" || status=$? + if is_timeout_status "$status"; then + echo "::error::apt-get $1 exceeded or was killed while enforcing its ${timeout_limit} wall-clock limit" + fi + exit "$status" + ;; +esac diff --git a/.github/scripts/select-ccache-key-suffix.sh b/.github/scripts/select-ccache-key-suffix.sh new file mode 100755 index 00000000..f4f501ef --- /dev/null +++ b/.github/scripts/select-ccache-key-suffix.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +set -euo pipefail + +# GitHub cache entries cannot be replaced. Per-attempt refresh keys let a +# forced rebuild supersede an older archive for the same SHA through prefix +# restoration without duplicating caches for ordinary reruns. +cache_key_suffix() { + local recache=$1 + local run_id=$2 + local run_attempt=$3 + + case "$recache" in + false) + return 0 + ;; + true) + if [ -z "$run_id" ] || [ -z "$run_attempt" ]; then + echo "GITHUB_RUN_ID and GITHUB_RUN_ATTEMPT are required for a ccache refresh key" >&2 + return 2 + fi + printf '%s' "-refresh-${run_id}-${run_attempt}" + ;; + *) + echo "RECACHE must be true or false" >&2 + return 2 + ;; + esac +} + +if [ "${1:-}" = --self-test ]; then + test -z "$(cache_key_suffix false 123 1)" + test -z "$(cache_key_suffix false '' '')" + test "$(cache_key_suffix true 123 1)" = "-refresh-123-1" + test "$(cache_key_suffix true 123 2)" = "-refresh-123-2" + if cache_key_suffix true "" 1 >/dev/null 2>&1; then + echo "self-test failed: empty run ID was accepted" >&2 + exit 1 + fi + if cache_key_suffix invalid 123 1 >/dev/null 2>&1; then + echo "self-test failed: invalid recache value was accepted" >&2 + exit 1 + fi + echo "select-ccache-key-suffix.sh self-test passed" + exit 0 +fi + +suffix="$(cache_key_suffix \ + "${RECACHE:-false}" \ + "${GITHUB_RUN_ID:-}" \ + "${GITHUB_RUN_ATTEMPT:-}")" + +echo "ccache key suffix: ${suffix:-}" +if [ -n "${GITHUB_OUTPUT:-}" ]; then + echo "suffix=$suffix" >> "$GITHUB_OUTPUT" +fi diff --git a/.github/scripts/select-linux-ccache-save.sh b/.github/scripts/select-linux-ccache-save.sh new file mode 100755 index 00000000..730c3a2e --- /dev/null +++ b/.github/scripts/select-linux-ccache-save.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Base-branch caches are visible to pull requests. Keep publication limited to +# automatic develop builds and explicit maintainer requests on develop. +should_save_linux_ccache() { + local event_name=$1 + local ref=$2 + local requested_save=$3 + local recache=$4 + + if [ "$ref" != "refs/heads/develop" ]; then + return 1 + fi + + case "$event_name" in + push) + return 0 + ;; + workflow_dispatch) + [ "$requested_save" = true ] || [ "$recache" = true ] + ;; + *) + return 1 + ;; + esac +} + +expect_save() { + if ! should_save_linux_ccache "$@"; then + echo "self-test failed: expected cache save for $*" >&2 + exit 1 + fi +} + +expect_no_save() { + if should_save_linux_ccache "$@"; then + echo "self-test failed: expected no cache save for $*" >&2 + exit 1 + fi +} + +if [ "${1:-}" = --self-test ]; then + expect_save push refs/heads/develop false false + expect_save workflow_dispatch refs/heads/develop true false + expect_save workflow_dispatch refs/heads/develop false true + expect_save workflow_dispatch refs/heads/develop true true + + expect_no_save pull_request refs/pull/421/merge true true + expect_no_save workflow_dispatch refs/heads/topic true false + expect_no_save workflow_dispatch refs/heads/develop false false + expect_no_save schedule refs/heads/develop true true + + echo "select-linux-ccache-save.sh self-test passed" + exit 0 +fi + +save_ccache=false +if should_save_linux_ccache \ + "${EVENT_NAME:-}" \ + "${GITHUB_REF:-}" \ + "${REQUEST_SAVE_CCACHE:-false}" \ + "${RECACHE:-false}"; then + save_ccache=true +fi + +echo "Linux ccache save: $save_ccache" +if [ -n "${GITHUB_OUTPUT:-}" ]; then + echo "save_ccache=$save_ccache" >> "$GITHUB_OUTPUT" +fi diff --git a/.github/scripts/select-linux-packaging.sh b/.github/scripts/select-linux-packaging.sh new file mode 100755 index 00000000..371ea4fb --- /dev/null +++ b/.github/scripts/select-linux-packaging.sh @@ -0,0 +1,97 @@ +#!/usr/bin/env bash +# Decide whether a Linux CI build should create and upload packages. + +set -euo pipefail + +path_triggers_packaging() { + case "$1" in + CMakeLists.txt|*/CMakeLists.txt|CMake/*|cmake/*|CMakeCPackOptions.cmake.in|package_description.txt|\ + debian/*|bundle_fixup/*|artwork/*|icons/*|sounds/*|data/*|Palettes/*|translations/*|\ + example_log_configurations/*|contrib/Ephemeris/*|contrib/gpl-v3-logo.svg|*.desktop|\ + ALLCALL7.TXT|CALL3.TXT|cty.dat|cty.dat_copyright.txt|grid.dat|sat.dat|eclipse.txt|\ + COPYING|AUTHORS|THANKS|NEWS|BUGS|README.md|\ + .github/actions/build-linux-payload/*|\ + .github/workflows/ci.yml|.github/workflows/build-linux.yml|.github/workflows/build-selected-artifacts.yml|.github/workflows/release.yml|\ + .github/scripts/select-linux-packaging.sh|.github/scripts/linux-artifact-validation.sh|.github/scripts/package-linux-armhf.sh|\ + .github/scripts/validate-linux-armhf-runtime.sh|.github/scripts/build-linux-armhf-cross.sh|\ + .github/cmake/*|.github/images/linux-ci/*) + return 0 + ;; + *) + return 1 + ;; + esac +} + +expect_trigger() { + if ! path_triggers_packaging "$1"; then + echo "self-test failed: expected packaging for $1" >&2 + exit 1 + fi +} + +expect_no_trigger() { + if path_triggers_packaging "$1"; then + echo "self-test failed: did not expect packaging for $1" >&2 + exit 1 + fi +} + +if [ "${1:-}" = "--self-test" ]; then + expect_trigger "CMakeLists.txt" + expect_trigger "tests/unit/audio/CMakeLists.txt" + expect_trigger "CMake/Install.cmake" + expect_trigger "debian/postinst" + expect_trigger "sounds/73.wav" + expect_trigger "cty.dat" + expect_trigger "contrib/Ephemeris/JPLEPH" + expect_trigger "wsjtx.desktop" + expect_trigger ".github/actions/build-linux-payload/action.yml" + expect_trigger ".github/workflows/build-linux.yml" + expect_trigger ".github/scripts/select-linux-packaging.sh" + expect_trigger ".github/scripts/linux-artifact-validation.sh" + expect_trigger ".github/images/linux-ci/install-packages.sh" + + expect_no_trigger "widgets/mainwindow.cpp" + expect_no_trigger "tests/unit/audio/test_tx_request.cpp" + expect_no_trigger ".github/workflows/build-macos.yml" + expect_no_trigger "doc/user_guide/en/wsjtx-main.adoc" + + echo "select-linux-packaging.sh self-test passed" + exit 0 +fi + +build_packages=true +reason="${EVENT_NAME:-unknown} event" + +if [ "${EVENT_NAME:-}" = "pull_request" ] && [ "${FULL_CI:-false}" != "true" ]; then + base="${PR_BASE_SHA:-}" + head="${CURRENT_SHA:-}" + build_packages=false + reason="ordinary pull request" + + if ! git cat-file -e "${base}^{commit}" 2>/dev/null; then + git fetch --no-tags --depth=1 origin "$base" || true + fi + + if git cat-file -e "${base}^{commit}" 2>/dev/null && + git cat-file -e "${head}^{commit}" 2>/dev/null; then + while IFS= read -r path; do + [ -z "$path" ] && continue + if path_triggers_packaging "$path"; then + build_packages=true + reason="$path" + break + fi + done < <(git diff --name-only "$base" "$head") + else + build_packages=true + reason="unreadable ${base}..${head}" + fi +fi + +echo "Build Linux packages: $build_packages" +echo "Packaging policy reason: $reason" +if [ -n "${GITHUB_OUTPUT:-}" ]; then + echo "build_packages=$build_packages" >> "$GITHUB_OUTPUT" +fi diff --git a/.github/scripts/should-refresh-linux-ci-images.py b/.github/scripts/should-refresh-linux-ci-images.py new file mode 100644 index 00000000..44026a96 --- /dev/null +++ b/.github/scripts/should-refresh-linux-ci-images.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python3 +"""Decide whether the promoted Linux CI image is old enough to refresh.""" + +from __future__ import annotations + +import argparse +import os +import sys +from datetime import datetime, timedelta, timezone +from pathlib import Path + + +sys.path.insert(0, str(Path(__file__).parent)) +from ghcr_retention import GitHubPackagesClient, Version # noqa: E402 + + +OWNER = "WSJTX" +PACKAGE = "wsjtx-internal/linux-noble" +# Stable is a promoted pointer; age-gate scheduled refreshes to avoid image churn. + + +def stable_version(versions: list[Version]) -> Version: + stable = [version for version in versions if "stable" in version.tags] + if len(stable) != 1: + raise RuntimeError(f"expected one stable Linux CI image, found {len(stable)}") + return stable[0] + + +def should_refresh( + versions: list[Version], *, now: datetime, max_age_days: int +) -> tuple[bool, int]: + version = stable_version(versions) + age = now.astimezone(timezone.utc) - version.created_at + age_days = max(0, age.days) + return age >= timedelta(days=max_age_days), age_days + + +def main() -> int: + parser = argparse.ArgumentParser() + parser.add_argument("--max-age-days", type=int, default=30) + args = parser.parse_args() + if args.max_age_days < 1: + parser.error("--max-age-days must be positive") + + token = os.environ.get("GITHUB_TOKEN") + if not token: + print("GITHUB_TOKEN is required", file=sys.stderr) + return 2 + + client = GitHubPackagesClient(token) + refresh, age_days = should_refresh( + client.list_versions(OWNER, PACKAGE), + now=datetime.now(timezone.utc), + max_age_days=args.max_age_days, + ) + decision = "refresh" if refresh else "keep" + print(f"Linux CI stable image age: {age_days} days; decision: {decision}") + return 0 if refresh else 1 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/.github/scripts/smoke-launch-windows.sh b/.github/scripts/smoke-launch-windows.sh new file mode 100755 index 00000000..e6dda339 --- /dev/null +++ b/.github/scripts/smoke-launch-windows.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +# Launch a Windows executable with the MinGW runtime directory removed from +# PATH and assert it does NOT fail with STATUS_DLL_NOT_FOUND (0xC0000135). +# +# This reproduces the failure class behind "map65.exe won't start": a missing +# runtime DLL (libgomp-1.dll, libportaudio-2.dll, libgfortran-5.dll, ...) makes +# the process exit at load time, before main(), with exit code 0xC0000135. A +# build that links and packages correctly survives a launch from a clean PATH; +# one that relies on the dev shell's /mingw64/bin does not. +# +# The launched command must exit on its own. A bounded timeout turns a hung +# process or modal startup error into a test failure. +# +# Usage: smoke-launch-windows.sh [args...] +set -u + +# 0xC0000135 as a bash exit status. Windows returns the 32-bit NTSTATUS; MSYS2 +# bash surfaces it as 3221225781 (unsigned) for processes that exit on their +# own. The 128+signal form does not apply here — this is a real process exit. +readonly STATUS_DLL_NOT_FOUND=3221225781 +readonly TIMEOUT_SECS=20 + +exe="${1:?usage: smoke-launch-windows.sh [args...]}" +shift || true + +if [ ! -f "$exe" ]; then + echo "::error::smoke-launch: executable not found: $exe" + exit 1 +fi + +# Strip the MinGW runtime dir from PATH so only DLLs the build/packaging step +# placed beside the exe (or in still-present system dirs) can resolve. +cleaned_path=$(echo "$PATH" | tr ':' '\n' | grep -ivE '(^|/)mingw64/bin/?$' | paste -sd: -) +echo "smoke-launch: $exe $* (PATH cleaned of /mingw64/bin)" + +# timeout returns 124 when it had to kill the process. +PATH="$cleaned_path" timeout "${TIMEOUT_SECS}s" "$exe" "$@" >launch.out 2>&1 +code=$? + +if [ "$code" -eq "$STATUS_DLL_NOT_FOUND" ]; then + echo "::error::smoke-launch: $exe exited 0xC0000135 (STATUS_DLL_NOT_FOUND) — a runtime DLL is missing from the clean-PATH launch context" + echo "----- output -----"; cat launch.out || true + exit 1 +fi + +if [ "$code" -eq 124 ]; then + echo "::error::smoke-launch: $exe did not exit within ${TIMEOUT_SECS}s" + echo "----- output -----"; cat launch.out || true + exit 1 +fi + +if [ "$code" -eq 0 ]; then + cat launch.out || true + echo "smoke-launch OK: $exe loaded and exited cleanly" + exit 0 +fi + +# Any other non-zero code is a real fault (a missing DLL is the thing we guard +# against; a usage/help non-zero exit would also surface here, so print it). +echo "::error::smoke-launch: $exe exited with code $code" +echo "----- output -----"; cat launch.out || true +exit 1 diff --git a/.github/scripts/test-linux-ccache-compiler-signature.sh b/.github/scripts/test-linux-ccache-compiler-signature.sh new file mode 100755 index 00000000..0ec48b24 --- /dev/null +++ b/.github/scripts/test-linux-ccache-compiler-signature.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash +set -euo pipefail + +fixture="$(mktemp -d)" +trap 'rm -rf "$fixture"' EXIT +mkdir -p "$fixture/bin" "$fixture/libexec" + +for component in cc1 cc1plus lto1 as; do + printf '%s\n' "$component fixture contents" > "$fixture/libexec/$component" +done +printf '%s\n' 'fixture specs' > "$fixture/specs" +printf '%s\n' 'x86_64-fixture-linux-gnu' > "$fixture/target" +printf '%s\n' 'fixture runtime library' > "$fixture/libexec/libcompiler-runtime.so" + +cat > "$fixture/bin/gcc-99" <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +root="$(cd "$(dirname "$0")/.." && pwd)" +case "$1" in + -dumpfullversion) echo 99.1.0 ;; + -dumpmachine) cat "$root/target" ;; + -dumpspecs) cat "$root/specs" ;; + -print-prog-name=*) echo "$root/libexec/${1#*=}" ;; + *) exit 2 ;; +esac +EOF +cp "$fixture/bin/gcc-99" "$fixture/bin/g++-99" +cat > "$fixture/bin/ldd" <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +root="$(cd "$(dirname "$0")/.." && pwd)" +printf 'libcompiler-runtime.so => %s/libexec/libcompiler-runtime.so (0x00000000)\n' "$root" +EOF +chmod +x "$fixture/bin/gcc-99" "$fixture/bin/g++-99" "$fixture/bin/ldd" +cp "$fixture/bin/gcc-99" "$fixture/bin/arm-linux-gnueabihf-gcc" +cp "$fixture/bin/gcc-99" "$fixture/bin/arm-linux-gnueabihf-g++" + +signature() { + PATH="$fixture/bin:$PATH" \ + .github/scripts/linux-ccache-compiler-signature.sh gcc-99 +} + +first="$(signature)" +IFS=$'\t' read -r version target driver_sha compatibility_id signature_sha <<< "$first" +test "$version" = 99.1.0 +test "$target" = x86_64-fixture-linux-gnu +test "$compatibility_id" = gcc99-v2 +[[ "$driver_sha" =~ ^[0-9a-f]{64}$ ]] +[[ "$signature_sha" =~ ^[0-9a-f]{64}$ ]] + +cross_signature="$( + PATH="$fixture/bin:$PATH" \ + .github/scripts/linux-ccache-compiler-signature.sh \ + "$fixture/bin/arm-linux-gnueabihf-gcc" +)" +IFS=$'\t' read -r cross_version cross_target _ cross_compatibility_id _ \ + <<< "$cross_signature" +test "$cross_version" = 99.1.0 +test "$cross_target" = x86_64-fixture-linux-gnu +test "$cross_compatibility_id" = gcc99-v2 + +touch "$fixture/bin/gcc-99" "$fixture/libexec/cc1" +test "$(signature)" = "$first" + +previous=$first +for input in \ + "$fixture/bin/gcc-99" \ + "$fixture/bin/g++-99" \ + "$fixture/libexec/cc1" \ + "$fixture/libexec/cc1plus" \ + "$fixture/libexec/lto1" \ + "$fixture/libexec/as" \ + "$fixture/libexec/libcompiler-runtime.so" \ + "$fixture/specs"; do + printf '%s\n' '# signature change' >> "$input" + current="$(signature)" + if [ "$current" = "$previous" ]; then + echo "Expected compiler signature to change after modifying $input" >&2 + exit 1 + fi + previous=$current +done + +printf '%s\n' 'aarch64-fixture-linux-gnu' > "$fixture/target" +test "$(signature)" != "$previous" + +echo "linux-ccache-compiler-signature.sh self-test passed" diff --git a/.github/scripts/test-verify-linux-ci-image.sh b/.github/scripts/test-verify-linux-ci-image.sh new file mode 100755 index 00000000..38348f5d --- /dev/null +++ b/.github/scripts/test-verify-linux-ci-image.sh @@ -0,0 +1,160 @@ +#!/usr/bin/env bash +set -euo pipefail + +fixture="$(mktemp -d)" +trap 'rm -rf "$fixture"' EXIT +mkdir -p "$fixture/prefix/pfunit/cmake" "$fixture/prefix/hamlib/lib" +touch "$fixture/prefix/pfunit/cmake/PFUNITConfig.cmake" +touch "$fixture/prefix/hamlib/lib/libhamlib.a" + +# shellcheck source=.github/scripts/linux-ci-image-config.sh +. .github/scripts/linux-ci-image-config.sh +# shellcheck source=.github/scripts/tsan-linux-deps-config.sh +. .github/scripts/tsan-linux-deps-config.sh +recipe="$(.github/scripts/linux-ci-image-fingerprint.sh normal-noble)" +tsan_recipe="$(.github/scripts/linux-ci-image-fingerprint.sh tsan-noble)" +manifest="$fixture/image.env" +compiler=gcc +compiler_path="$(readlink -f "$(command -v "$compiler")")" +compiler_version="$($compiler -dumpfullversion -dumpversion)" +compiler_sha256="$(sha256sum "$compiler_path" | awk '{print $1}')" +compiler_target="$($compiler -dumpmachine)" +if command -v dpkg-query >/dev/null 2>&1; then + package_sha256="$(dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort | sha256sum | awk '{print $1}')" + toolchain_identity="$recipe:$compiler_target:$compiler_sha256:$package_sha256" + toolchain_sha256="$(printf '%s' "$toolchain_identity" | sha256sum | awk '{print $1}')" + toolchain_id="gcc${compiler_version}-x86_64-${toolchain_sha256:0:20}" +else + package_sha256=0000000000000000000000000000000000000000000000000000000000000000 + toolchain_id=fixture +fi +compiler_major=${compiler_version%%.*} +ccache_compatibility_id="gcc${compiler_major}-v2" +compiler_signature_sha256=1111111111111111111111111111111111111111111111111111111111111111 + +write_manifest() { + local hamlib_commit=${1:-$LINUX_HAMLIB_COMMIT} + local recipe_sha=${2:-$recipe} + local include_ccache_identity=${3:-true} + { + echo "schema=1" + echo "flavor=normal" + echo "architecture=x86_64" + echo "generation=build-20260818-1-1" + echo "compiler=$compiler" + echo "compiler_version=$compiler_version" + echo "compiler_sha256=$compiler_sha256" + echo "compiler_target=$compiler_target" + echo "package_sha256=$package_sha256" + echo "toolchain_id=$toolchain_id" + if [ "$include_ccache_identity" = true ]; then + echo "ccache_compatibility_id=$ccache_compatibility_id" + echo "compiler_signature_sha256=$compiler_signature_sha256" + fi + echo "hamlib_ref=$LINUX_HAMLIB_REF" + echo "hamlib_commit=$hamlib_commit" + echo "pfunit_version=$LINUX_PFUNIT_VERSION" + echo "pfunit_commit=$LINUX_PFUNIT_COMMIT" + echo "recipe_sha256=$recipe_sha" + } > "$manifest" +} + +run_verify() { + local allow_stale_image=${1:-false} + WSJTX_CI_IMAGE_MANIFEST="$manifest" \ + WSJTX_CI_PREFIX_OVERRIDE="$fixture/prefix" \ + WSJTX_CI_IMAGE_SKIP_RUNTIME_CHECKS=true \ + WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH="$allow_stale_image" \ + .github/scripts/verify-linux-ci-image.sh normal x86_64 "$LINUX_HAMLIB_REF" +} + +write_manifest +run_verify >/dev/null + +output="$fixture/output" +GITHUB_OUTPUT="$output" run_verify >/dev/null +grep -qx 'recipe_match=true' "$output" +grep -qx "ccache_compatibility_id=$ccache_compatibility_id" "$output" +grep -qx "ccache_compiler_check=string:$compiler_signature_sha256" "$output" + +write_manifest "$LINUX_HAMLIB_COMMIT" "$recipe" false +if run_verify >/dev/null 2>&1; then + echo "Expected a current image without ccache identity fields to fail" >&2 + exit 1 +fi + +write_manifest +printf '%s\n' 'compiler_signature_sha256=invalid' >> "$manifest" +if run_verify >/dev/null 2>&1; then + echo "Expected an invalid compiler signature to fail" >&2 + exit 1 +fi + +write_manifest 0000000000000000000000000000000000000000 +if run_verify >/dev/null 2>&1; then + echo "Expected a mismatched Hamlib commit to fail" >&2 + exit 1 +fi + +write_manifest "$LINUX_HAMLIB_COMMIT" 0000000000000000000000000000000000000000000000000000000000000000 false +if run_verify >/dev/null 2>&1; then + echo "Expected a mismatched recipe fingerprint to fail" >&2 + exit 1 +fi +if ! run_verify true >/dev/null 2>&1; then + echo "Expected stale image allowance to accept a mismatched recipe fingerprint" >&2 + exit 1 +fi +output="$fixture/stale-output" +GITHUB_OUTPUT="$output" run_verify true >/dev/null 2>&1 +grep -qx 'recipe_match=false' "$output" +grep -qx "ccache_compatibility_id=$toolchain_id" "$output" +grep -qx 'ccache_compiler_check=mtime' "$output" + +tsan_config_dir="$fixture/tsan-config" +mkdir -p "$tsan_config_dir" "$fixture/prefix/tsan/boost/cmake" +cp .github/scripts/verify-linux-ci-image.sh \ + .github/scripts/linux-ccache-compiler-signature.sh \ + .github/scripts/linux-ci-image-config.sh \ + .github/scripts/tsan-linux-deps-config.sh \ + "$tsan_config_dir/" +cp .github/scripts/linux-ci-image-fingerprint.sh "$tsan_config_dir/" +cat > "$tsan_config_dir/verify-tsan-deps-linux.sh" <<'EOF' +#!/usr/bin/env bash +set -euo pipefail +EOF +chmod +x "$tsan_config_dir/verify-tsan-deps-linux.sh" +touch "$fixture/prefix/tsan/boost/cmake/BoostConfig.cmake" + +tsan_manifest="$fixture/tsan-image.env" +cat > "$tsan_manifest" </dev/null; then + echo "Expected TSan image verification to load its dependency configuration" >&2 + exit 1 +fi + +echo "verify-linux-ci-image.sh self-test passed" diff --git a/.github/scripts/tests/test_armhf_ci_manifest.py b/.github/scripts/tests/test_armhf_ci_manifest.py new file mode 100644 index 00000000..c438d62d --- /dev/null +++ b/.github/scripts/tests/test_armhf_ci_manifest.py @@ -0,0 +1,90 @@ +import hashlib +import os +import pathlib +import subprocess +import tempfile +import unittest + + +ROOT = pathlib.Path(__file__).resolve().parents[3] +WRITER = ROOT / ".github/scripts/write-armhf-ci-manifest.sh" + + +class ArmhfCiManifestTests(unittest.TestCase): + def test_runtime_manifest_preserves_requested_image_identity(self): + with tempfile.TemporaryDirectory() as temporary: + fixture = pathlib.Path(temporary) + config = fixture / "config" + output = fixture / "output" + runtime = fixture / "runtime" + fixture_bin = fixture / "bin" + config.mkdir() + output.mkdir() + runtime.mkdir() + fixture_bin.mkdir() + + dpkg_query = fixture_bin / "dpkg-query" + dpkg_query.write_text( + "#!/bin/sh\nprintf '%s\\n' fixture-package=1.0\n", + encoding="utf-8", + ) + dpkg_query.chmod(0o755) + + library = runtime / "libgcc_s.so.1" + library.write_bytes(b"fixture GCC runtime\n") + library_sha = hashlib.sha256(library.read_bytes()).hexdigest() + runtime_records = f"libgcc_s.so.1={library_sha}\n".encode() + runtime_sha = hashlib.sha256(runtime_records).hexdigest() + + (config / "armhf-ci-image-config.sh").write_text( + "ARMHF_CI_IMAGE_SCHEMA=1\n" + f"ARMHF_RUNTIME_PREFIX={runtime}\n" + "ARMHF_GCC_RUNTIME_LIBRARIES=(libgcc_s.so.1)\n" + "ARMHF_GLIBC_VERSION=2.36\n", + encoding="utf-8", + ) + (config / "cross-builder.env").write_text( + "role=cross-builder\n" + "generation=build-20260901-10-1\n" + f"recipe_sha256={'1' * 64}\n" + "toolchain_id=gcc13.4.0-armhf-fixture\n" + f"runtime_sha256={runtime_sha}\n" + "hamlib_ref=4.7.2\n" + f"hamlib_commit={'2' * 40}\n", + encoding="utf-8", + ) + + environment = os.environ.copy() + environment.update( + PATH=f"{fixture_bin}:{environment['PATH']}", + WSJTX_ARMHF_CONFIG_DIR=str(config), + WSJTX_CI_MANIFEST_DIR=str(output), + ) + subprocess.run( + [ + str(WRITER), + "runtime", + "armhf", + "build-20260901-20-1", + "3" * 64, + ], + cwd=ROOT, + env=environment, + check=True, + ) + + fields = dict( + line.split("=", 1) + for line in (output / "image.env").read_text().splitlines() + ) + self.assertEqual(fields["role"], "runtime") + self.assertEqual(fields["architecture"], "armhf") + self.assertEqual(fields["generation"], "build-20260901-20-1") + self.assertEqual(fields["recipe_sha256"], "3" * 64) + self.assertEqual(fields["cross_generation"], "build-20260901-10-1") + self.assertEqual(fields["cross_recipe_sha256"], "1" * 64) + self.assertEqual(fields["runtime_sha256"], runtime_sha) + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/scripts/tests/test_armhf_cross_configuration.py b/.github/scripts/tests/test_armhf_cross_configuration.py new file mode 100644 index 00000000..0893e99a --- /dev/null +++ b/.github/scripts/tests/test_armhf_cross_configuration.py @@ -0,0 +1,176 @@ +import pathlib +import unittest + + +ROOT = pathlib.Path(__file__).resolve().parents[3] + + +class ArmhfCrossConfigurationTests(unittest.TestCase): + def read(self, relative_path): + return (ROOT / relative_path).read_text(encoding="utf-8") + + def test_cross_toolchain_pins_armv7_hard_float_and_bookworm_abi(self): + config = self.read(".github/images/linux-ci/armhf-cross-toolchain.config") + for setting in ( + "CT_ARCH_ARM=y", + "CT_ARCH_ARM_MODE_THUMB=y", + 'CT_ARCH_ARCH="armv7-a+fp"', + "CT_ARCH_FLOAT_HW=y", + "CT_LINUX_V_6_1=y", + "CT_BINUTILS_V_2_40=y", + "CT_GLIBC_V_2_36=y", + 'CT_GLIBC_MIN_KERNEL_VERSION="3.2.0"', + "CT_GCC_V_13=y", + "CT_CC_GCC_LIBGOMP=y", + "CT_CC_LANG_CXX=y", + "CT_CC_LANG_FORTRAN=y", + "CT_PARALLEL_JOBS=1", + 'CT_TARGET_CFLAGS="-g0"', + ): + self.assertIn(setting, config) + self.assertNotIn("CT_CC_GCC_LIBQUADMATH=y", config) + + image_config = self.read(".github/scripts/armhf-ci-image-config.sh") + self.assertIn("ARMHF_GCC_VERSION=13.4.0", image_config) + self.assertIn("ARMHF_GLIBC_VERSION=2.36", image_config) + self.assertIn("ARMHF_TARGET_TRIPLET=arm-linux-gnueabihf", image_config) + + verifier = self.read(".github/scripts/verify-armhf-ci-image.sh") + audit = self.read(".github/scripts/audit-armhf-cross-build.sh") + self.assertIn("reject_quadmath_dependency", verifier) + self.assertIn("unexpectedly depends on libquadmath", audit) + self.assertIn("reject_private_glibc_dependency", verifier) + self.assertIn("private glibc symbol", audit) + + def test_armhf_cache_identity_parsing_fails_closed(self): + workflow = self.read(".github/workflows/build-linux.yml") + self.assertIn( + '''ccache_compatibility_id=$(awk -F= '$1 == "cross_ccache_compatibility_id" { print $2 }' "$output_file")''', + workflow, + ) + self.assertIn( + 'if [ -z "$ccache_compatibility_id" ] || ' + '[ -z "$ccache_compiler_check" ]; then', + workflow, + ) + self.assertNotIn('\\"cross_ccache_compatibility_id\\"', workflow) + + def test_armhf_qemu_registration_uses_one_immutable_release(self): + expected = ( + "image: tonistiigi/binfmt:qemu-v10.2.3-68@sha256:" + "400a4873b838d1b89194d982c45e5fb3cda4593fbfd7e08a02e76b03b21166f0" + ) + for path in ( + ".github/workflows/build-linux.yml", + ".github/workflows/publish-linux-ci-images.yml", + ): + self.assertIn(expected, self.read(path)) + + def test_cmake_separates_host_programs_from_target_dependencies(self): + toolchain = self.read(".github/cmake/armhf-toolchain.cmake") + self.assertIn("set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)", toolchain) + self.assertIn("set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)", toolchain) + self.assertIn("set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)", toolchain) + self.assertIn("set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)", toolchain) + self.assertIn("set(_wsjt_armhf_triplet arm-linux-gnueabihf)", toolchain) + self.assertIn("${_wsjt_armhf_triplet}-gfortran", toolchain) + self.assertIn("set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE armhf", toolchain) + self.assertIn("set(CPACK_RPM_PACKAGE_ARCHITECTURE armv7l", toolchain) + + dependencies = self.read("CMake/Dependencies.cmake") + self.assertIn("WSJT_QT_HOST_PATH", dependencies) + self.assertIn("IMPORTED_LOCATION", dependencies) + + def test_builder_and_runtime_keep_distinct_native_architectures(self): + builder = self.read(".github/images/linux-ci/Dockerfile.armhf-cross") + runtime = self.read(".github/images/linux-ci/Dockerfile.armhf-runtime") + self.assertTrue(builder.startswith("FROM debian:bookworm\n")) + self.assertIn("--architectures=armhf", builder) + self.assertIn("qemu-user-static", builder) + self.assertIn("normalize-armhf-sysroot-symlinks.sh", builder) + self.assertIn("tail -n 300 build.log", builder) + self.assertIn("ARG CROSS_BUILDER_PLATFORM=linux/amd64", runtime) + self.assertIn( + "FROM --platform=${CROSS_BUILDER_PLATFORM} ${CROSS_BUILDER_IMAGE}", + runtime, + ) + self.assertIn("FROM arm32v7/debian:bookworm", runtime) + self.assertIn("install-armhf-runtime-packages", runtime) + self.assertIn( + "COPY --from=cross_builder /usr/bin/qemu-arm-static", runtime + ) + + cross_build = self.read(".github/scripts/build-linux-armhf-cross.sh") + runtime_package = self.read(".github/scripts/package-linux-armhf.sh") + self.assertNotIn("qemu", cross_build.lower()) + self.assertIn("cmake --install wsjtx-build", cross_build) + self.assertIn("cpack -G DEB", runtime_package) + self.assertIn("cpack -G RPM", runtime_package) + self.assertIn("CPACK_INSTALL_CMAKE_PROJECTS=", runtime_package) + self.assertIn("CPACK_INSTALLED_DIRECTORIES=/work/AppDir;/", runtime_package) + self.assertIn('"$ARMHF_QEMU_EXECUTABLE"', runtime_package) + self.assertIn( + 'LINUX_APPIMAGE_RUNNER="$ARMHF_QEMU_EXECUTABLE"', runtime_package + ) + self.assertIn("armhf-static-ldd.sh", runtime_package) + self.assertIn('PATH="/work/wsjtx-build/appimage-tools:$PATH"', runtime_package) + + def test_hybrid_is_the_only_armhf_build_implementation(self): + workflow = self.read(".github/workflows/build-linux.yml") + native_action = self.read( + ".github/actions/build-linux-payload/action.yml" + ) + self.assertFalse( + (ROOT / ".github/scripts/build-linux-payload.sh").exists() + ) + self.assertNotIn("build-linux-payload.sh", workflow) + self.assertEqual(workflow.count("build-linux-armhf-cross.sh"), 1) + self.assertIn("docker run --rm --platform linux/amd64", workflow) + self.assertNotIn("inputs.arch != 'armhf'", native_action) + self.assertNotIn("linuxdeploy-armhf", native_action) + + def test_armhf_joins_only_the_opt_in_full_ci_matrix(self): + workflow = self.read(".github/workflows/ci.yml") + prepare = workflow.split(" prepare:\n", 1)[1].split("\n macos:\n", 1)[0] + armhf_job = workflow.split(" linux-armhf:\n", 1)[1].split( + "\n windows:\n", 1 + )[0] + + self.assertIn("RESOLVE_ARMHF=true", prepare) + self.assertIn("inputs.armhf_image_tag", prepare) + self.assertIn( + "contains(github.event.pull_request.labels.*.name, 'full-ci')", + armhf_job, + ) + self.assertIn("github.event_name == 'workflow_dispatch'", armhf_job) + self.assertIn('arch: \"armhf\"', armhf_job) + self.assertIn( + "image_tag: ${{ needs.prepare.outputs.armhf_image_tag }}", + armhf_job, + ) + + def test_slow_decoder_timeouts_are_at_most_four_minutes(self): + jtty = self.read("tests/unit/jtty/CMakeLists.txt") + for test_name, timeout in ( + ("test_jtty_adjacent_decode", 180), + ("test_jtty_structured_decode", 240), + ("test_jtty_overlap_decode", 180), + ("test_jtty_overlap_decode_480", 240), + ("test_jtty_windowed_decode", 180), + ("test_jtty_gap_merge", 180), + ("test_jtty_surface_ranges", 180), + ): + properties = jtty.split( + f"set_tests_properties ({test_name}", 1 + )[1].split(")", 1)[0] + self.assertIn(f"TIMEOUT {timeout}", properties) + + q65 = self.read("tests/unit/q65/CMakeLists.txt") + properties = q65.split( + "set_tests_properties (test_q65_decode_pipeline", 1 + )[1].split(")", 1)[0] + self.assertIn("TIMEOUT 180", properties) + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/scripts/tests/test_armhf_static_ldd.py b/.github/scripts/tests/test_armhf_static_ldd.py new file mode 100644 index 00000000..a1db1618 --- /dev/null +++ b/.github/scripts/tests/test_armhf_static_ldd.py @@ -0,0 +1,123 @@ +import os +import pathlib +import subprocess +import tempfile +import unittest + + +ROOT = pathlib.Path(__file__).resolve().parents[3] +VALIDATOR = ROOT / ".github/scripts/armhf-static-ldd.sh" + + +class ArmhfStaticLddTests(unittest.TestCase): + def run_validator(self, needed, libraries, runpath=None, transitive=None): + with tempfile.TemporaryDirectory() as temporary: + fixture = pathlib.Path(temporary) + fixture_bin = fixture / "bin" + fixture_lib = fixture / "lib" + fixture_bin.mkdir() + fixture_lib.mkdir() + target = fixture / "program" + target.write_text("target\n", encoding="utf-8") + + transitive = transitive or {} + dynamic_output = "".join( + f"printf '%s\\n' ' 0x00000001 (NEEDED) Shared library: [{library}]'\n" + for library in needed + ) + if runpath is not None: + dynamic_output += ( + "printf '%s\\n' ' 0x0000001d (RUNPATH) " + f"Library runpath: [{runpath}]'\n" + ) + transitive_cases = "".join( + " *" + parent + "*)\n" + + "".join( + f" printf '%s\\n' ' 0x00000001 (NEEDED) Shared library: [{library}]'\n" + for library in dependencies + ) + + " ;;\n" + for parent, dependencies in transitive.items() + ) + (fixture_bin / "readelf").write_text( + "#!/bin/sh\n" + "case \"$*\" in\n" + + transitive_cases + + " *)\n" + + "".join(f" {line}\n" for line in dynamic_output.splitlines()) + + " ;;\n" + "esac\n", + encoding="utf-8", + ) + (fixture_bin / "file").write_text( + "#!/bin/sh\n" + "case \"$*\" in\n" + " *libhost.so*) echo \"$*: ELF 64-bit LSB shared object, x86-64\" ;;\n" + " *) echo \"$*: ELF 32-bit LSB shared object, ARM, EABI5\" ;;\n" + "esac\n", + encoding="utf-8", + ) + for tool in (fixture_bin / "readelf", fixture_bin / "file"): + tool.chmod(0o755) + for library in libraries: + library_path = fixture_lib / library + library_path.parent.mkdir(parents=True, exist_ok=True) + library_path.write_text("fixture\n", encoding="utf-8") + + environment = os.environ.copy() + environment.update( + PATH=f"{fixture_bin}:{environment['PATH']}", + WSJT_ARMHF_RUNTIME_PREFIX=str(fixture / "empty-runtime"), + ARMHF_STATIC_LDD_LIBRARY_PATH=str(fixture_lib), + ) + return subprocess.run( + ["bash", str(VALIDATOR), str(target)], + cwd=ROOT, + env=environment, + text=True, + capture_output=True, + check=False, + ) + + def test_resolves_armhf_dependency_without_executing_target(self): + result = self.run_validator(["libfixture.so.1"], ["libfixture.so.1"]) + self.assertEqual(result.returncode, 0, result.stderr) + self.assertIn("libfixture.so.1 => ", result.stdout) + + def test_rejects_missing_dependency(self): + result = self.run_validator(["libmissing.so.1"], []) + self.assertNotEqual(result.returncode, 0) + self.assertIn("libmissing.so.1 => not found", result.stdout) + + def test_rejects_quadmath_dependency(self): + result = self.run_validator(["libquadmath.so.0"], ["libquadmath.so.0"]) + self.assertNotEqual(result.returncode, 0) + self.assertIn("unavailable ARMHF runtime", result.stderr) + + def test_rejects_host_library(self): + result = self.run_validator(["libhost.so.1"], ["libhost.so.1"]) + self.assertNotEqual(result.returncode, 0) + self.assertIn("non-ARMHF ELF", result.stderr) + + def test_resolves_origin_relative_runpath(self): + result = self.run_validator( + ["libpulsecommon-fixture.so"], + ["pulseaudio/libpulsecommon-fixture.so"], + runpath="$ORIGIN/lib/pulseaudio", + ) + self.assertEqual(result.returncode, 0, result.stderr) + self.assertIn("pulseaudio/libpulsecommon-fixture.so", result.stdout) + + def test_resolves_transitive_dependency_closure(self): + result = self.run_validator( + ["libparent.so.1"], + ["libparent.so.1", "libchild.so.1"], + transitive={"libparent.so.1": ["libchild.so.1"]}, + ) + self.assertEqual(result.returncode, 0, result.stderr) + self.assertIn("libparent.so.1 => ", result.stdout) + self.assertIn("libchild.so.1 => ", result.stdout) + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/scripts/tests/test_armhf_sysroot_symlinks.py b/.github/scripts/tests/test_armhf_sysroot_symlinks.py new file mode 100644 index 00000000..991971f6 --- /dev/null +++ b/.github/scripts/tests/test_armhf_sysroot_symlinks.py @@ -0,0 +1,42 @@ +import os +import pathlib +import subprocess +import tempfile +import unittest + + +ROOT = pathlib.Path(__file__).resolve().parents[3] +NORMALIZER = ROOT / ".github/scripts/normalize-armhf-sysroot-symlinks.sh" + + +class ArmhfSysrootSymlinkTests(unittest.TestCase): + def test_absolute_links_are_rebased_inside_sysroot(self): + with tempfile.TemporaryDirectory() as temporary: + sysroot = pathlib.Path(temporary) + target = sysroot / "lib/arm-linux-gnueabihf/libm.so.6" + target.parent.mkdir(parents=True) + target.write_text("fixture\n", encoding="utf-8") + link = sysroot / "usr/lib/arm-linux-gnueabihf/libm.so" + link.parent.mkdir(parents=True) + link.symlink_to("/lib/arm-linux-gnueabihf/libm.so.6") + + subprocess.run(["bash", str(NORMALIZER), str(sysroot)], check=True) + + self.assertFalse(os.readlink(link).startswith("/")) + self.assertEqual(link.resolve(), target) + + def test_relative_links_remain_unchanged(self): + with tempfile.TemporaryDirectory() as temporary: + sysroot = pathlib.Path(temporary) + directory = sysroot / "usr/lib" + directory.mkdir(parents=True) + link = directory / "libfixture.so" + link.symlink_to("libfixture.so.1") + + subprocess.run(["bash", str(NORMALIZER), str(sysroot)], check=True) + + self.assertEqual(os.readlink(link), "libfixture.so.1") + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/scripts/tests/test_check_candidate_tag.py b/.github/scripts/tests/test_check_candidate_tag.py new file mode 100644 index 00000000..cf44ccf4 --- /dev/null +++ b/.github/scripts/tests/test_check_candidate_tag.py @@ -0,0 +1,81 @@ +import subprocess +import tempfile +import unittest +from pathlib import Path + + +SCRIPT = Path(__file__).resolve().parents[1] / "check-candidate-tag.sh" +TAG = "build/v3.2.0-rc1" + + +class CheckCandidateTagTest(unittest.TestCase): + def setUp(self): + self.directory = tempfile.TemporaryDirectory() + self.addCleanup(self.directory.cleanup) + self.repo = Path(self.directory.name) + self.git("init", "-q") + self.git( + "-c", "user.name=Test", "-c", "user.email=test@example.com", + "commit", "--allow-empty", "-qm", "first", + ) + self.first = self.git("rev-parse", "HEAD").stdout.strip() + self.git( + "-c", "user.name=Test", "-c", "user.email=test@example.com", + "commit", "--allow-empty", "-qm", "second", + ) + self.second = self.git("rev-parse", "HEAD").stdout.strip() + + def git(self, *args, input=None): + return subprocess.run( + ["git", *args], cwd=self.repo, input=input, text=True, + capture_output=True, check=True, + ) + + def check_tag(self, expected_sha=None, cwd=None): + return subprocess.run( + ["bash", SCRIPT, TAG, expected_sha or self.second], + cwd=cwd or self.repo, text=True, capture_output=True, + ) + + def test_missing_tag_allows_creation(self): + result = self.check_tag() + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual(result.stdout, "exists=false\n") + + def test_matching_lightweight_tag_is_idempotent(self): + self.git("tag", TAG, self.second) + result = self.check_tag() + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual(result.stdout, "exists=true\n") + + def test_matching_annotated_tag_is_idempotent(self): + self.git( + "-c", "user.name=Test", "-c", "user.email=test@example.com", + "tag", "-am", "candidate", TAG, self.second, + ) + result = self.check_tag() + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual(result.stdout, "exists=true\n") + + def test_different_commit_is_rejected(self): + self.git("tag", TAG, self.first) + result = self.check_tag() + self.assertNotEqual(result.returncode, 0) + self.assertIn("release tags are never moved", result.stderr) + + def test_noncommit_tag_is_rejected(self): + blob = self.git("hash-object", "-w", "--stdin", input="not a commit").stdout.strip() + self.git("update-ref", f"refs/tags/{TAG}", blob) + result = self.check_tag() + self.assertNotEqual(result.returncode, 0) + self.assertIn("does not identify a commit", result.stderr) + + def test_git_failure_is_not_treated_as_missing_tag(self): + with tempfile.TemporaryDirectory() as directory: + result = self.check_tag(cwd=directory) + self.assertNotEqual(result.returncode, 0) + self.assertIn("Could not inspect", result.stderr) + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/scripts/tests/test_ghcr_retention.py b/.github/scripts/tests/test_ghcr_retention.py new file mode 100755 index 00000000..9bffad2d --- /dev/null +++ b/.github/scripts/tests/test_ghcr_retention.py @@ -0,0 +1,143 @@ +#!/usr/bin/env python3 + +import importlib.util +import sys +import unittest +from datetime import datetime, timedelta, timezone +from pathlib import Path + + +SCRIPT = Path(__file__).parents[1] / "ghcr_retention.py" +SPEC = importlib.util.spec_from_file_location("ghcr_retention", SCRIPT) +MODULE = importlib.util.module_from_spec(SPEC) +sys.modules[SPEC.name] = MODULE +SPEC.loader.exec_module(MODULE) + + +def version(version_id, age_days, tags, now): + return MODULE.Version( + id=version_id, + digest=f"sha256:{version_id:064x}", + created_at=now - timedelta(days=age_days), + tags=tuple(tags), + ) + + +class RetentionPlanTests(unittest.TestCase): + def setUp(self): + self.now = datetime(2026, 8, 18, tzinfo=timezone.utc) + + def plan(self, versions, keep=3): + return { + item.version.id: item + for item in MODULE.plan_retention(versions, self.now, 60, keep) + } + + def test_deletes_only_expired_recognized_versions_outside_keep_set(self): + versions = [ + version(1, 90, ("build-20260101-1-1",), self.now), + version(2, 10, ("build-20260808-2-1",), self.now), + version(3, 20, ("build-20260729-3-1",), self.now), + version(4, 30, ("build-20260719-4-1",), self.now), + ] + plan = self.plan(versions) + self.assertTrue(plan[1].delete) + self.assertFalse(plan[2].delete) + self.assertFalse(plan[3].delete) + self.assertFalse(plan[4].delete) + + def test_stable_unknown_and_untagged_versions_are_protected(self): + versions = [ + version(1, 100, ("stable", "build-20260101-1-1"), self.now), + version(2, 100, ("debug",), self.now), + version(3, 100, (), self.now), + ] + plan = self.plan(versions, keep=1) + self.assertEqual(plan[1].reason, "stable") + self.assertEqual(plan[2].reason, "unknown-or-untagged") + self.assertEqual(plan[3].reason, "unknown-or-untagged") + + def test_exact_sixty_day_boundary_is_kept(self): + plan = self.plan([version(1, 60, ("candidate-1-1",), self.now)], keep=1) + self.assertFalse(plan[1].delete) + + def test_equal_timestamps_use_id_as_tiebreaker(self): + versions = [ + version(1, 90, ("candidate-1-1",), self.now), + version(2, 90, ("candidate-2-1",), self.now), + ] + plan = self.plan(versions, keep=1) + self.assertTrue(plan[1].delete) + self.assertFalse(plan[2].delete) + + def test_nested_package_name_is_encoded(self): + path = MODULE.GitHubPackagesClient.package_path( + "WSJTX", "wsjtx-internal/linux-noble" + ) + self.assertEqual( + path, + "/orgs/WSJTX/packages/container/wsjtx-internal%2Flinux-noble", + ) + + def test_malformed_version_fails_closed(self): + with self.assertRaises(ValueError): + MODULE.parse_version({"id": 1, "name": "sha256:x", "metadata": {}}) + + +class FakeClient: + def __init__(self, versions, refreshed=None): + self.versions = versions + self.refreshed = refreshed or {} + self.deleted = [] + + def list_versions(self, owner, package): + return list(self.versions) + + def get_version(self, owner, package, version_id): + return self.refreshed.get( + version_id, + next(item for item in self.versions if item.id == version_id), + ) + + def delete_version(self, owner, package, version_id): + self.deleted.append(version_id) + + +class RetentionApplicationTests(unittest.TestCase): + def setUp(self): + self.now = datetime(2026, 8, 18, tzinfo=timezone.utc) + self.versions = [ + version(1, 100, ("candidate-1-1",), self.now), + version(2, 30, ("candidate-2-1",), self.now), + ] + + def run_process(self, client, apply): + return MODULE.process_package( + client, + "WSJTX", + "wsjtx-internal/linux-noble", + self.now, + 60, + 1, + apply, + ) + + def test_dry_run_never_deletes(self): + client = FakeClient(self.versions) + self.assertEqual(self.run_process(client, False), 0) + self.assertEqual(client.deleted, []) + + def test_apply_deletes_planned_version(self): + client = FakeClient(self.versions) + self.assertEqual(self.run_process(client, True), 1) + self.assertEqual(client.deleted, [1]) + + def test_refetch_protects_new_stable_tag(self): + stable = version(1, 100, ("stable", "candidate-1-1"), self.now) + client = FakeClient(self.versions, {1: stable}) + self.assertEqual(self.run_process(client, True), 0) + self.assertEqual(client.deleted, []) + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/scripts/tests/test_linux_artifact_validation.py b/.github/scripts/tests/test_linux_artifact_validation.py new file mode 100644 index 00000000..655d0d24 --- /dev/null +++ b/.github/scripts/tests/test_linux_artifact_validation.py @@ -0,0 +1,230 @@ +import os +import subprocess +import tempfile +import unittest +from pathlib import Path + + +REPO_ROOT = Path(__file__).resolve().parents[3] +HELPER = REPO_ROOT / ".github/scripts/linux-artifact-validation.sh" + + +class LinuxArtifactValidationTests(unittest.TestCase): + def run_helper(self, command, **environment): + env = os.environ.copy() + env["VALIDATION_HELPER"] = str(HELPER) + env.update({name: str(value) for name, value in environment.items()}) + return subprocess.run( + ["bash", "-c", f'source "$VALIDATION_HELPER"; {command}'], + check=False, + capture_output=True, + env=env, + text=True, + ) + + def make_application_tree(self, kind="appimage"): + temporary = tempfile.TemporaryDirectory() + root = Path(temporary.name) + executables = ["wsjtx", "jt9", "qmap", "map65", "ft8code"] + if kind == "appimage": + executables.append("wsprd") + for executable in executables: + path = root / "usr/bin" / executable + path.parent.mkdir(parents=True, exist_ok=True) + path.touch(mode=0o755) + for relative in ( + "usr/share/wsjtx/ALLCALL7.TXT", + "usr/share/wsjtx/CALL3.TXT", + "usr/share/wsjtx/sounds/Message.wav", + "usr/share/wsjtx/sounds/Testing123.wav", + ): + path = root / relative + path.parent.mkdir(parents=True, exist_ok=True) + path.touch() + + if kind == "appdir": + for relative in ( + "usr/share/applications/wsjtx.desktop", + "usr/share/pixmaps/wsjtx_icon.png", + ): + path = root / relative + path.parent.mkdir(parents=True, exist_ok=True) + path.touch() + else: + qt_conf = root / "usr/bin/qt.conf" + qt_conf.write_text("[Paths]\nPlugins = plugins\n", encoding="utf-8") + for relative in ( + "usr/plugins/platforms/libqxcb.so", + "usr/plugins/sqldrivers/libqsqlite.so", + "usr/plugins/audio/libqtaudio_alsa.so", + "usr/lib/libQt5Core.so.5", + "usr/lib/libQt5Widgets.so.5", + "usr/lib/libQt5Multimedia.so.5", + ): + path = root / relative + path.parent.mkdir(parents=True, exist_ok=True) + path.touch() + return temporary, root + + def test_package_manifest_accepts_expected_payload(self): + manifest = "\n".join( + ( + "/usr/bin/wsjtx", + "/usr/bin/jt9", + "/usr/bin/qmap", + "/usr/bin/map65", + "/usr/share/wsjtx/ALLCALL7.TXT", + "/usr/share/wsjtx/CALL3.TXT", + "/usr/share/wsjtx/sounds/Message.wav", + "/usr/share/wsjtx/sounds/Testing123.wav", + ) + ) + result = self.run_helper( + 'validate_linux_package_manifest "$MANIFEST" fixture', MANIFEST=manifest + ) + self.assertEqual(result.returncode, 0, result.stderr) + + def test_package_manifest_rejects_missing_executable_data_or_sound(self): + required = [ + "/usr/bin/wsjtx", + "/usr/bin/jt9", + "/usr/bin/qmap", + "/usr/bin/map65", + "/usr/share/wsjtx/ALLCALL7.TXT", + "/usr/share/wsjtx/CALL3.TXT", + "/usr/share/wsjtx/sounds/Message.wav", + "/usr/share/wsjtx/sounds/Testing123.wav", + ] + for missing in ( + "/usr/bin/map65", + "/usr/share/wsjtx/ALLCALL7.TXT", + "/usr/share/wsjtx/sounds/Message.wav", + ): + with self.subTest(missing=missing): + manifest = "\n".join(path for path in required if path != missing) + result = self.run_helper( + 'validate_linux_package_manifest "$MANIFEST" fixture', + MANIFEST=manifest, + ) + self.assertNotEqual(result.returncode, 0) + self.assertIn(missing, result.stderr) + + def test_package_manifest_rejects_executable_adjacent_sounds(self): + manifest = "\n".join( + ( + "/usr/bin/wsjtx", + "/usr/bin/jt9", + "/usr/bin/qmap", + "/usr/bin/map65", + "/usr/bin/sounds/Message.wav", + "/usr/share/wsjtx/ALLCALL7.TXT", + "/usr/share/wsjtx/CALL3.TXT", + "/usr/share/wsjtx/sounds/Message.wav", + "/usr/share/wsjtx/sounds/Testing123.wav", + ) + ) + result = self.run_helper( + 'validate_linux_package_manifest "$MANIFEST" fixture', MANIFEST=manifest + ) + self.assertNotEqual(result.returncode, 0) + self.assertIn("/usr/bin/sounds", result.stderr) + + def test_application_layout_rejects_missing_executable_data_or_sound(self): + for relative in ( + "usr/bin/map65", + "usr/share/wsjtx/ALLCALL7.TXT", + "usr/share/wsjtx/sounds/Message.wav", + ): + with self.subTest(relative=relative): + temporary, root = self.make_application_tree("appdir") + self.addCleanup(temporary.cleanup) + (root / relative).unlink() + result = self.run_helper( + 'validate_linux_application_layout "$TREE" appdir', TREE=root + ) + self.assertNotEqual(result.returncode, 0) + self.assertIn(str(root / relative), result.stderr) + + def test_application_layout_rejects_executable_adjacent_sounds(self): + temporary, root = self.make_application_tree("appdir") + self.addCleanup(temporary.cleanup) + (root / "usr/bin/sounds").mkdir() + result = self.run_helper( + 'validate_linux_application_layout "$TREE" appdir', TREE=root + ) + self.assertNotEqual(result.returncode, 0) + self.assertIn("usr/bin/sounds", result.stderr) + + def test_appimage_layout_requires_qt_runtime_payload(self): + for relative in ( + "usr/bin/qt.conf", + "usr/plugins/platforms/libqxcb.so", + "usr/plugins/sqldrivers/libqsqlite.so", + "usr/plugins/audio/libqtaudio_alsa.so", + "usr/lib/libQt5Core.so.5", + ): + with self.subTest(relative=relative): + temporary, root = self.make_application_tree() + self.addCleanup(temporary.cleanup) + (root / relative).unlink() + result = self.run_helper( + 'validate_linux_application_layout "$TREE" appimage', TREE=root + ) + self.assertNotEqual(result.returncode, 0) + + def test_armhf_elf_metadata_accepts_eabi5_hard_float_loader(self): + result = self.run_helper( + 'validate_elf_metadata armhf fixture "$FILE_OUT" "$HEADER_OUT" "$PROGRAM_OUT"', + FILE_OUT=( + "fixture: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 " + "(SYSV), dynamically linked" + ), + HEADER_OUT=( + "Class: ELF32\nMachine: ARM\n" + "Flags: 0x5000400, Version5 EABI, hard-float ABI" + ), + PROGRAM_OUT=( + "INTERP 0x000174 [Requesting program interpreter: " + "/lib/ld-linux-armhf.so.3]" + ), + ) + self.assertEqual(result.returncode, 0, result.stderr) + + def test_armhf_elf_metadata_rejects_wrong_abi_properties(self): + good = { + "FILE_OUT": ( + "fixture: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 " + "(SYSV), dynamically linked" + ), + "HEADER_OUT": ( + "Class: ELF32\nMachine: ARM\n" + "Flags: 0x5000400, Version5 EABI, hard-float ABI" + ), + "PROGRAM_OUT": ( + "INTERP 0x000174 [Requesting program interpreter: " + "/lib/ld-linux-armhf.so.3]" + ), + } + mutations = { + "class": {"HEADER_OUT": good["HEADER_OUT"].replace("ELF32", "ELF64")}, + "machine": { + "HEADER_OUT": good["HEADER_OUT"].replace("Machine: ARM", "Machine: X86-64") + }, + "eabi": {"HEADER_OUT": good["HEADER_OUT"].replace("Version5", "Version4")}, + "hard_float": { + "HEADER_OUT": good["HEADER_OUT"].replace("hard-float", "soft-float") + }, + "loader": {"PROGRAM_OUT": good["PROGRAM_OUT"].replace("armhf", "arm")}, + } + for fault, mutation in mutations.items(): + with self.subTest(fault=fault): + environment = good | mutation + result = self.run_helper( + 'validate_elf_metadata armhf fixture "$FILE_OUT" "$HEADER_OUT" "$PROGRAM_OUT"', + **environment, + ) + self.assertNotEqual(result.returncode, 0) + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/scripts/tests/test_linux_ccache_policy.py b/.github/scripts/tests/test_linux_ccache_policy.py new file mode 100644 index 00000000..42c97e01 --- /dev/null +++ b/.github/scripts/tests/test_linux_ccache_policy.py @@ -0,0 +1,99 @@ +import pathlib +import unittest + + +REPOSITORY = pathlib.Path(__file__).resolve().parents[3] + + +class LinuxCcachePolicyTests(unittest.TestCase): + def read(self, relative_path): + return (REPOSITORY / relative_path).read_text(encoding="utf-8") + + def assert_cache_tiers(self, text, prefix): + primary = ( + f"{prefix}${{{{ steps.image.outputs.ccache_compatibility_id }}}}-" + "${{ steps.image.outputs.generation }}-${{ github.sha }}" + "${{ steps.ccache-key.outputs.suffix }}" + ) + generation = ( + f"{prefix}${{{{ steps.image.outputs.ccache_compatibility_id }}}}-" + "${{ steps.image.outputs.generation }}-" + ) + compatible = ( + f"{prefix}${{{{ steps.image.outputs.ccache_compatibility_id }}}}-" + ) + self.assertIn(f"key: {primary}", text) + generation_index = text.index(f" {generation}") + compatible_index = text.index(f" {compatible}", generation_index + 1) + self.assertLess(generation_index, compatible_index) + + def test_normal_cache_prefers_current_image_generation(self): + action = self.read(".github/actions/build-linux-payload/action.yml") + self.assert_cache_tiers(action, "ccache-linux-${{ inputs.arch }}-") + self.assertIn( + 'export CCACHE_COMPILERCHECK="${{ steps.image.outputs.ccache_compiler_check }}"', + action, + ) + self.assertIn('if: inputs.runtime_base == \'host\'', action) + self.assertIn('echo "CC=gcc"', action) + self.assertIn('echo "CXX=g++"', action) + self.assertIn( + "if: inputs.save_ccache == 'true' && steps.image.outputs.recipe_match == 'true' && steps.ccache.outputs.cache-hit != 'true'", + action, + ) + + def test_sanitizer_cache_keeps_profile_and_generation(self): + action = self.read(".github/actions/build-linux-sanitizers/action.yml") + self.assert_cache_tiers( + action, + "ccache-linux-x86_64-${{ steps.sanitizer.outputs.cache_key }}-", + ) + self.assertIn( + 'export CCACHE_COMPILERCHECK="${{ steps.image.outputs.ccache_compiler_check }}"', + action, + ) + self.assertIn( + "if: inputs.save_ccache == 'true' && steps.image.outputs.recipe_match == 'true' && steps.ccache.outputs.cache-hit != 'true'", + action, + ) + + def test_armhf_verifies_and_forwards_cache_identity(self): + workflow = self.read(".github/workflows/build-linux.yml") + self.assert_cache_tiers(workflow, "ccache-linux-armhf-") + self.assertIn( + "verify-armhf-ci-image.sh cross-builder armhf", workflow + ) + self.assertIn("verify-armhf-ci-image.sh runtime armhf", workflow) + self.assertIn( + "CROSS_BUILDER_IMAGE: ${{ needs.resolve-image.outputs.cross_image_reference }}", + workflow, + ) + self.assertEqual( + workflow.count( + "RUNTIME_IMAGE: ${{ needs.resolve-image.outputs.image_reference }}" + ), + 2, + ) + self.assertIn("build-linux-armhf-cross.sh", workflow) + self.assertIn("validate-linux-armhf-runtime.sh", workflow) + self.assertIn("HAMLIB_BRANCH: ${{ inputs.hamlib_branch }}", workflow) + self.assertIn("CCACHE_COMPILERCHECK: ${{ steps.image.outputs.ccache_compiler_check }}", workflow) + self.assertIn("-e CCACHE_COMPILERCHECK", workflow) + self.assertIn("-e WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH", workflow) + self.assertIn("cross_recipe_match", workflow) + self.assertIn("runtime_recipe_match", workflow) + self.assertIn( + "if: inputs.save_ccache && steps.image.outputs.recipe_match == 'true' && steps.ccache.outputs.cache-hit != 'true'", + workflow, + ) + + def test_release_accepts_separately_promoted_armhf_recipe(self): + workflow = self.read(".github/workflows/release.yml") + armhf_job = workflow.split(" linux-armhf:\n", 1)[1].split( + "\n windows:\n", 1 + )[0] + self.assertIn("allow_stale_image: true", armhf_job) + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/scripts/tests/test_linux_image_publication_policy.py b/.github/scripts/tests/test_linux_image_publication_policy.py new file mode 100644 index 00000000..cb88ac95 --- /dev/null +++ b/.github/scripts/tests/test_linux_image_publication_policy.py @@ -0,0 +1,181 @@ +import pathlib +import re +import unittest + + +ROOT = pathlib.Path(__file__).resolve().parents[3] +PUBLISH = (ROOT / ".github/workflows/publish-linux-ci-images.yml").read_text() +BUILD = (ROOT / ".github/workflows/build-linux.yml").read_text() +WARM = (ROOT / ".github/workflows/warm-dependency-caches.yml").read_text() +CLASSIFIER = (ROOT / ".github/scripts/is-linux-ci-image-input.sh").read_text() + + +def job(name: str) -> str: + match = re.search( + rf"^ {re.escape(name)}:\n(?P.*?)(?=^ [a-z][a-z0-9-]*:\n|\Z)", + PUBLISH, + re.MULTILINE | re.DOTALL, + ) + if not match: + raise AssertionError(f"job not found: {name}") + return match.group("body") + + +class LinuxImagePublicationPolicyTests(unittest.TestCase): + def test_public_release_publication_is_tag_scoped_and_complete(self): + validate = job("validate-inputs") + self.assertIn('[ "$REQUEST_REPOSITORY" != WSJTX/wsjtx ]', validate) + self.assertIn("^refs/tags/v[0-9]+\\.[0-9]+\\.[0-9]+", validate) + self.assertIn('[ "$PROMOTE" != false ]', validate) + self.assertIn('[ "$IMAGE_SET" != normal ]', validate) + self.assertIn('[ "$INCLUDE_ARMHF" != true ]', validate) + + def test_public_release_images_use_release_tag_and_public_package_root(self): + metadata = job("metadata") + public_block = re.search( + r'if \[ "\$PUBLICATION_TARGET" = public-release \]; then(?P.*?)else', + metadata, + re.DOTALL, + ).group("body") + self.assertIn( + 'release-${GITHUB_REF_NAME}-${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}', + public_block, + ) + self.assertIn("package_root=ghcr.io/wsjtx/wsjtx", public_block) + self.assertNotIn(":stable", public_block) + self.assertIn("type=gha", public_block) + self.assertEqual( + PUBLISH.count( + "labels: ${{ inputs.publication_target == 'public-release' && 'org.opencontainers.image.source=https://github.com/WSJTX/wsjtx' || '' }}" + ), + 5, + ) + + def test_reusable_publisher_exports_all_release_image_digests(self): + self.assertIn("x86_64_digest:", PUBLISH) + self.assertIn("value: ${{ jobs.build-normal.outputs.digest }}", PUBLISH) + self.assertIn("aarch64_digest:", PUBLISH) + self.assertIn("value: ${{ jobs.build-arm64.outputs.digest }}", PUBLISH) + self.assertIn("armhf_digest:", PUBLISH) + self.assertIn("value: ${{ jobs.build-armhf-runtime.outputs.digest }}", PUBLISH) + self.assertIn("armhf_cross_digest:", PUBLISH) + self.assertIn("value: ${{ jobs.build-armhf-cross.outputs.digest }}", PUBLISH) + + def test_public_release_builds_require_and_consume_digest_references(self): + self.assertIn("^sha256:[0-9a-f]{64}$", BUILD) + self.assertIn("public-release images require an immutable sha256 digest", BUILD) + self.assertIn( + 'image_reference=${package_root}/${package}@${IMAGE_DIGEST}', BUILD + ) + self.assertIn( + 'cross_image_reference=${package_root}/${cross_package}@${ARMHF_CROSS_IMAGE_DIGEST}', + BUILD, + ) + self.assertEqual( + BUILD.count("image: ${{ needs.resolve-image.outputs.image_reference }}"), 2 + ) + self.assertIn( + "CROSS_BUILDER_IMAGE: ${{ needs.resolve-image.outputs.cross_image_reference }}", + BUILD, + ) + self.assertIn( + "RUNTIME_IMAGE: ${{ needs.resolve-image.outputs.image_reference }}", BUILD + ) + + def test_manual_target_mapping_keeps_tsan_independent(self): + self.assertRegex(WARM, r"linux\|linux-images\)\n\s+normal_images=true") + self.assertRegex(WARM, r"linux-tsan\)\n\s+tsan_images=true") + all_case = re.search(r"all\)\n(?P.*?);;", WARM, re.DOTALL).group("body") + self.assertIn("enable_all", all_case) + self.assertNotIn("tsan_images=true", all_case) + self.assertIn("image_set: ${{ needs.detect.outputs.image_set }}", WARM) + self.assertRegex( + WARM, + r'if \[ "\$SCHEDULE" = "17 9 1 \* \*" \][\s\S]*?normal_images=true\s+tsan_images=true', + ) + + def test_push_selection_uses_tested_profile_classifier(self): + self.assertIn('is-linux-ci-image-input.sh --classify "$path"', WARM) + self.assertIn("expect_image_set normal ", CLASSIFIER) + self.assertIn("expect_image_set tsan ", CLASSIFIER) + self.assertIn("expect_image_set normal-and-tsan ", CLASSIFIER) + self.assertIn('expect_image_set none "CMake/Sources.cmake"', CLASSIFIER) + self.assertIn("armhf-cross-bookworm", CLASSIFIER) + self.assertIn("armhf-runtime-bookworm", CLASSIFIER) + self.assertIn('include_armhf: true', WARM) + + def test_candidate_warm_uses_exact_tag_and_publishes_without_recache(self): + warm = job("warm-normal-ccache") + self.assertIn("- build-normal", warm) + self.assertIn("uses: ./.github/workflows/build-linux.yml", warm) + self.assertIn("image_tag: ${{ needs.metadata.outputs.build_tag }}", warm) + self.assertIn("allow_stale_image: false", warm) + self.assertIn("recache: false", warm) + self.assertIn("save_ccache: true", warm) + + promote = job("promote") + self.assertIn("needs.warm-normal-ccache.result == 'success'", promote) + self.assertIn("- warm-normal-ccache", promote) + + def test_metadata_loads_only_the_selected_image_cohort(self): + metadata = job("metadata") + self.assertIn('if [ "$IMAGE_SET" != tsan ]; then', metadata) + self.assertIn(". .github/scripts/linux-ci-image-config.sh", metadata) + self.assertIn("linux-ci-image-fingerprint.sh armhf-cross-bookworm", metadata) + self.assertIn("linux-ci-image-fingerprint.sh armhf-runtime-bookworm", metadata) + self.assertIn('if [ "$IMAGE_SET" != normal ]; then', metadata) + self.assertIn(". .github/scripts/tsan-linux-deps-config.sh", metadata) + + def test_armhf_images_are_built_and_promoted_as_one_generation(self): + cross = job("build-armhf-cross") + runtime = job("build-armhf-runtime") + promote = job("promote") + + self.assertIn("platforms: linux/amd64", cross) + self.assertIn("Dockerfile.armhf-cross", cross) + self.assertIn("/usr/local/lib/android /usr/share/dotnet /opt/ghc", cross) + self.assertNotIn("/usr/local/lib/android", job("build-normal")) + self.assertIn("- build-armhf-cross", runtime) + self.assertIn("platforms: linux/arm/v7", runtime) + self.assertIn("Dockerfile.armhf-runtime", runtime) + self.assertIn( + "CROSS_BUILDER_IMAGE=${{ needs.metadata.outputs.package_root }}/" + "linux-armhf-cross-bookworm:${{ needs.metadata.outputs.build_tag }}", + runtime, + ) + self.assertIn("linux-armhf-cross-bookworm:${VALIDATED_TAG}", promote) + self.assertIn("linux-armv7-bookworm:${VALIDATED_TAG}", promote) + self.assertIn("linux-armhf-cross-bookworm:stable", promote) + self.assertIn("linux-armv7-bookworm:stable", promote) + + def test_publication_mutations_require_develop(self): + validate = job("validate-inputs") + self.assertIn('[ "$MODE" = rollback ] || [ "$PROMOTE" = true ]', validate) + self.assertIn('[ "$REQUEST_REF" != refs/heads/develop ]', validate) + + def test_tsan_only_jobs_and_tag_moves_exclude_normal_images(self): + validate = job("validate-inputs") + self.assertIn("normal|tsan|normal-and-tsan", validate) + self.assertIn('[ "$IMAGE_SET" = tsan ] && [ "$INCLUDE_ARMHF" = true ]', validate) + self.assertIn("inputs.image_set == 'tsan'", job("build-tsan")) + self.assertIn("inputs.image_set == 'normal'", job("build-normal")) + self.assertIn('if [ "$IMAGE_SET" != tsan ]; then', job("promote")) + self.assertIn('if [ "$IMAGE_SET" != normal ]; then', job("promote")) + self.assertIn('if [ "$IMAGE_SET" != tsan ]; then', job("rollback")) + self.assertIn('if [ "$IMAGE_SET" != normal ]; then', job("rollback")) + + def test_rollback_uses_only_explicitly_selected_packages(self): + rollback = job("rollback") + self.assertNotIn("tsan_available", rollback) + self.assertNotIn("armhf_available", rollback) + self.assertIn("packages+=(linux-noble linux-arm64-bookworm)", rollback) + self.assertIn( + "packages+=(linux-armhf-cross-bookworm linux-armv7-bookworm)", + rollback, + ) + self.assertIn("packages+=(linux-tsan-noble)", rollback) + self.assertIn("stable_packages+=(linux-noble)", rollback) + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/scripts/tests/test_release_policy.py b/.github/scripts/tests/test_release_policy.py new file mode 100644 index 00000000..a7929484 --- /dev/null +++ b/.github/scripts/tests/test_release_policy.py @@ -0,0 +1,383 @@ +import importlib.util +import json +import io +import shutil +import subprocess +import sys +import tarfile +import tempfile +import unittest +import zipfile +from pathlib import Path + + +SCRIPT = Path(__file__).parents[1] / "release-policy.py" +SPEC = importlib.util.spec_from_file_location("release_policy", SCRIPT) +release_policy = importlib.util.module_from_spec(SPEC) +assert SPEC.loader +SPEC.loader.exec_module(release_policy) + + +class ReleasePolicyTest(unittest.TestCase): + def test_classifies_ga_and_rc(self): + self.assertEqual(release_policy.classify("3.2.0")["channel"], "GA") + identity = release_policy.classify("3.2.0-rc2") + self.assertEqual(identity["channel"], "RC") + self.assertEqual(identity["rc_number"], "2") + self.assertEqual(identity["release_branch"], "release/3.2") + + def test_rejects_non_release_versions(self): + for version in ("v3.2.0", "3.2.0-beta1", "3.2", "3.2.0-rc0"): + with self.subTest(version=version), self.assertRaises(ValueError): + release_policy.classify(version) + + def test_validates_tracked_release_state(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + (root / "release-state.txt").write_text( + "version=3.2.0\n" + "channel=RC\n" + "rc=1\n" + "revision=$Format:%H$\n" + ) + identity = release_policy.validate_source(root, "3.2.0-rc1") + self.assertEqual(identity["channel"], "RC") + self.assertEqual(identity["windows_signing"], "signpath") + with self.assertRaisesRegex(ValueError, "release channel"): + release_policy.validate_source(root, "3.2.0") + (root / "release-state.txt").write_text( + "version=3.2.0\nchannel=RC\nrc=1\nrevision=" + "a" * 40 + "\n" + ) + with self.assertRaisesRegex(ValueError, "revision"): + release_policy.validate_source(root, "3.2.0-rc1") + + def test_read_state_cli_accepts_single_digit_rc(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + (root / "release-state.txt").write_text( + "version=3.2.0\n" + "channel=RC\n" + "rc=1\n" + "revision=$Format:%H$\n" + ) + result = subprocess.run( + [sys.executable, SCRIPT, "read-state", "--root", root], + check=True, + capture_output=True, + text=True, + ) + self.assertEqual( + json.loads(result.stdout), + { + "version": "3.2.0", + "channel": "RC", + "rc": "1", + "revision": "$Format:%H$", + "windows_signing": "signpath", + }, + ) + + (root / "release-state.txt").write_text( + "version=3.2.0\n" + "channel=RC\n" + "rc=1beta\n" + "revision=$Format:%H$\n" + ) + result = subprocess.run( + [sys.executable, SCRIPT, "read-state", "--root", root], + capture_output=True, + text=True, + ) + self.assertNotEqual(result.returncode, 0) + self.assertIn("positive RC number", result.stderr) + + def test_source_pins_unsigned_mode_and_rejects_unknown_mode(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + state = ( + "version=3.2.0\nchannel=RC\nrc=1\n" + "revision=$Format:%H$\nwindows_signing=unsigned\n" + ) + (root / "release-state.txt").write_text(state) + self.assertEqual( + release_policy.validate_source(root, "3.2.0-rc1")["windows_signing"], + "unsigned", + ) + archive = root / "source.zip" + commit = "c" * 40 + with zipfile.ZipFile(archive, "w") as output: + output.writestr( + "wsjtx-3.2.0-rc1/release-state.txt", + state.replace("$Format:%H$", commit), + ) + release_policy.validate_archive(archive, "3.2.0-rc1", commit) + with self.assertRaisesRegex(ValueError, "windows_signing"): + release_policy.parse_state(state.replace("unsigned", "ephemeral")) + + def test_validates_exported_tar_and_zip_identity(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + commit = "b" * 40 + state = f"version=3.2.0\nchannel=RC\nrc=1\nrevision={commit}\n".encode() + tar_path = root / "source.tar.gz" + with tarfile.open(tar_path, "w:gz") as archive: + info = tarfile.TarInfo("wsjtx-3.2.0-rc1/release-state.txt") + info.size = len(state) + archive.addfile(info, io.BytesIO(state)) + zip_path = root / "source.zip" + with zipfile.ZipFile(zip_path, "w") as archive: + archive.writestr("wsjtx-3.2.0-rc1/release-state.txt", state) + release_policy.validate_archive(tar_path, "3.2.0-rc1", commit) + release_policy.validate_archive(zip_path, "3.2.0-rc1", commit) + with self.assertRaisesRegex(ValueError, "revision"): + release_policy.validate_archive(tar_path, "3.2.0-rc1", "c" * 40) + + def test_distribution_gate_rejects_unsigned_package(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + version = "3.2.0-rc1" + for name in release_policy.expected_assets(version, True): + target = root / name + target.mkdir() + suffix = ".pkg" if "macOS" in name else ".AppImage" if "linux" in name else ".exe" + (target / f"artifact{suffix}").write_bytes(b"signed") + (root / "extra").mkdir() + (root / "extra" / "unexpected-unsigned.pkg").write_bytes(b"unsigned") + with self.assertRaisesRegex(ValueError, "unsigned macOS"): + release_policy.find_asset_files(root, version, True) + + def test_manifest_binds_assets_to_tag_and_commit(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + version = "3.2.0" + for name in release_policy.expected_assets(version, True): + target = root / name + target.mkdir() + suffix = ".pkg" if "macOS" in name else ".AppImage" if "linux" in name else ".exe" + (target / f"{name}{suffix}" if not name.endswith(suffix) else target / name).write_bytes(name.encode()) + for arch in ("x86_64", "aarch64", "armhf"): + for package_type in ("deb", "rpm"): + target = root / f"wsjtx-{version}-linux-{arch}-{package_type}" + target.mkdir() + (target / f"wsjtx-{arch}.{package_type}").write_bytes(arch.encode()) + (root / f"wsjtx-{version}-src.tar.gz").write_bytes(b"source") + args = type("Args", (), { + "artifacts": str(root), "version": version, "repository": "WSJTX/wsjtx", + "commit": "a" * 40, "run_id": "123", + "linux_x86_64_digest": "sha256:" + "1" * 64, + "linux_aarch64_digest": "sha256:" + "2" * 64, + "linux_armhf_cross_digest": "sha256:" + "3" * 64, + "linux_armhf_digest": "sha256:" + "4" * 64, + "macos_mode": "distribution", + "windows_mode": "signpath", + })() + release_policy.write_manifest(args) + manifest = json.loads((root / "release-manifest.json").read_text()) + self.assertEqual(manifest["tag"], "v3.2.0") + self.assertEqual(manifest["commit"], "a" * 40) + self.assertEqual(manifest["linux_builders"]["armhf_cross"], "sha256:" + "3" * 64) + self.assertEqual(manifest["linux_builders"]["armhf_runtime"], "sha256:" + "4" * 64) + self.assertEqual(manifest["macos_signing"]["mode"], "distribution") + self.assertEqual(manifest["macos_signing"]["replaceable_assets"], []) + self.assertEqual(manifest["windows_signing"]["mode"], "signpath") + self.assertEqual(len(manifest["assets"]), 13) + + def test_manual_macos_assets_keep_release_names_without_immutable_hashes(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + version = "3.2.0" + for name in release_policy.public_expected_assets(version, "validation"): + target = root / name + target.mkdir() + if "macOS" in name: + filename = name.replace("-unsigned", "") + elif "linux" in name: + filename = f"{name}.AppImage" + else: + filename = "wsjtx-win64.exe" + (target / filename).write_bytes(name.encode()) + for arch in ("x86_64", "aarch64", "armhf"): + for package_type in ("deb", "rpm"): + target = root / f"wsjtx-{version}-linux-{arch}-{package_type}" + target.mkdir() + (target / f"wsjtx-{arch}.{package_type}").write_bytes(arch.encode()) + (root / f"wsjtx-{version}-src.tar.gz").write_bytes(b"source") + args = type("Args", (), { + "artifacts": str(root), "version": version, "repository": "WSJTX/wsjtx", + "commit": "a" * 40, "run_id": "123", + "linux_x86_64_digest": "sha256:" + "1" * 64, + "linux_aarch64_digest": "sha256:" + "2" * 64, + "linux_armhf_cross_digest": "sha256:" + "3" * 64, + "linux_armhf_digest": "sha256:" + "4" * 64, + "macos_mode": "validation", + "windows_mode": "signpath", + })() + + release_policy.write_manifest(args) + + manifest = json.loads((root / "release-manifest.json").read_text()) + replaceable = { + f"wsjtx-{version}-arm64-macOS.pkg", + f"wsjtx-{version}-x86_64-macOS.pkg", + } + release_names = {path.name for path in release_policy.release_files(root, version, "validation")} + immutable_names = {entry["name"] for entry in manifest["assets"]} + checksum_names = { + line.split(" ", 1)[1] + for line in (root / "SHA256SUMS").read_text().splitlines() + } + self.assertEqual(manifest["macos_signing"]["mode"], "manual") + self.assertEqual(set(manifest["macos_signing"]["replaceable_assets"]), replaceable) + self.assertTrue(replaceable <= release_names) + self.assertTrue(replaceable.isdisjoint(immutable_names)) + self.assertTrue(replaceable.isdisjoint(checksum_names)) + self.assertIn("wsjtx-win64.exe", immutable_names) + + def test_unsigned_windows_manifest_selects_and_hashes_installer(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + version = "3.2.0-rc1" + for name in release_policy.public_expected_assets(version, "validation", "unsigned"): + target = root / name + target.mkdir() + if "macOS" in name: + filename = name.replace("-unsigned", "") + elif "linux" in name: + filename = f"{name}.AppImage" + else: + filename = f"wsjtx-{version}-win64.exe" + (target / filename).write_bytes(name.encode()) + for arch in ("x86_64", "aarch64", "armhf"): + for package_type in ("deb", "rpm"): + target = root / f"wsjtx-{version}-linux-{arch}-{package_type}" + target.mkdir() + (target / f"wsjtx-{arch}.{package_type}").write_bytes(arch.encode()) + (root / f"wsjtx-{version}-src.tar.gz").write_bytes(b"source") + args = type("Args", (), { + "artifacts": str(root), "version": version, "repository": "WSJTX/wsjtx", + "commit": "a" * 40, "run_id": "123", + "linux_x86_64_digest": "sha256:" + "1" * 64, + "linux_aarch64_digest": "sha256:" + "2" * 64, + "linux_armhf_cross_digest": "sha256:" + "3" * 64, + "linux_armhf_digest": "sha256:" + "4" * 64, + "macos_mode": "validation", "windows_mode": "unsigned", + })() + release_policy.write_manifest(args) + manifest = json.loads((root / "release-manifest.json").read_text()) + installer = f"wsjtx-{version}-win64.exe" + self.assertEqual(manifest["windows_signing"]["mode"], "unsigned") + self.assertIn(installer, {entry["name"] for entry in manifest["assets"]}) + self.assertIn(installer, (root / "SHA256SUMS").read_text()) + installer_path = root / f"wsjtx-{version}-windows-x86_64-installer" / installer + installer_path.rename(installer_path.with_name("unexpected.exe")) + with self.assertRaisesRegex(ValueError, "unexpected unsigned Windows installer"): + release_policy.find_public_asset_files(root, version, "validation", "unsigned") + installer_path.with_name("unexpected.exe").rename(installer_path) + signed_dir = root / f"wsjtx-{version}-windows-x86_64-installer-signed" + signed_dir.mkdir() + with self.assertRaisesRegex(ValueError, "signed Windows installer"): + release_policy.find_public_asset_files(root, version, "validation", "unsigned") + + def test_signing_reports_bind_hashes_and_source(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + version = "3.2.0-rc1" + commit = "b" * 40 + tag = f"v{version}" + for arch in ("arm64", "x86_64"): + package_dir = root / f"wsjtx-{version}-{arch}-macOS.pkg" + package_dir.mkdir() + package = package_dir / f"wsjtx-{version}-{arch}-macOS.pkg" + package.write_bytes(arch.encode()) + report_dir = root / f"macos-signing-report-{version}-{arch}" + report_dir.mkdir() + (report_dir / "macos-signing-report.json").write_text(json.dumps({ + "mode": "distribution", "git_sha": commit, "artifact": package.name, + "sha256": release_policy.hash_file(package), "notarization": {"status": "Accepted"}, + "stapled": True, "gatekeeper_accepted": True, "team_id": "ABCDE12345", + "application_certificate_sha1": "A" * 40, + "installer_certificate_sha1": "B" * 40, + })) + installer_dir = root / f"wsjtx-{version}-windows-x86_64-installer-signed" + installer_dir.mkdir() + installer = installer_dir / "wsjtx.exe" + installer.write_bytes(b"windows") + request_dir = root / f"wsjtx-{version}-windows-signing-request" + request_dir.mkdir() + (request_dir / "request.json").write_text(json.dumps({ + "policy": "release-signing", "commit": commit, "tag": tag, + })) + verification_dir = root / f"wsjtx-{version}-windows-signing-verification" + verification_dir.mkdir() + (verification_dir / "verification.json").write_text(json.dumps({ + "commit": commit, "tag": tag, "artifact": installer.name, + "sha256": release_policy.hash_file(installer), "status": "Valid", + "timestamp_thumbprint": "1234", "signer_subject": "WSJT-X", + "signer_thumbprint": "5678", "identity_verified": True, + })) + release_policy.verify_signing_reports(root, version, commit, tag) + (verification_dir / "verification.json").write_text("{}") + with self.assertRaisesRegex(ValueError, "release ref"): + release_policy.verify_signing_reports(root, version, commit, tag) + + def test_validation_reports_allow_unsigned_macos_with_signed_windows(self): + with tempfile.TemporaryDirectory() as directory: + root = Path(directory) + version = "3.2.0-rc1" + commit = "b" * 40 + tag = f"v{version}" + for arch in ("arm64", "x86_64"): + package_dir = root / f"wsjtx-{version}-{arch}-macOS-unsigned.pkg" + package_dir.mkdir() + package = package_dir / f"wsjtx-{version}-{arch}-macOS.pkg" + package.write_bytes(arch.encode()) + report_dir = root / f"macos-signing-report-{version}-{arch}" + report_dir.mkdir() + (report_dir / "macos-signing-report.json").write_text(json.dumps({ + "mode": "validation", "git_sha": commit, "artifact": package.name, + "sha256": release_policy.hash_file(package), "signed": False, + "notarized": False, "publishable": False, + })) + installer_dir = root / f"wsjtx-{version}-windows-x86_64-installer-signed" + installer_dir.mkdir() + installer = installer_dir / "wsjtx.exe" + installer.write_bytes(b"windows") + request_dir = root / f"wsjtx-{version}-windows-signing-request" + request_dir.mkdir() + (request_dir / "request.json").write_text(json.dumps({ + "policy": "release-signing", "commit": commit, "tag": tag, + })) + verification_dir = root / f"wsjtx-{version}-windows-signing-verification" + verification_dir.mkdir() + (verification_dir / "verification.json").write_text(json.dumps({ + "commit": commit, "tag": tag, "artifact": installer.name, + "sha256": release_policy.hash_file(installer), "status": "Valid", + "timestamp_thumbprint": "1234", "signer_subject": "WSJT-X", + "signer_thumbprint": "5678", "identity_verified": True, + })) + + release_policy.verify_signing_reports(root, version, commit, tag, "validation") + + report = json.loads( + (root / f"macos-signing-report-{version}-arm64" / "macos-signing-report.json").read_text() + ) + report["signed"] = True + (root / f"macos-signing-report-{version}-arm64" / "macos-signing-report.json").write_text( + json.dumps(report) + ) + with self.assertRaisesRegex(ValueError, "unsigned package"): + release_policy.verify_signing_reports(root, version, commit, tag, "validation") + + report["signed"] = False + (root / f"macos-signing-report-{version}-arm64" / "macos-signing-report.json").write_text( + json.dumps(report) + ) + with self.assertRaisesRegex(ValueError, "Windows signing report"): + release_policy.verify_signing_reports(root, version, commit, tag, "validation", "unsigned") + shutil.rmtree(request_dir) + shutil.rmtree(verification_dir) + release_policy.verify_signing_reports(root, version, commit, tag, "validation", "unsigned") + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/scripts/tests/test_resolve_linux_ci_image_tag.py b/.github/scripts/tests/test_resolve_linux_ci_image_tag.py new file mode 100755 index 00000000..b8a3c1bd --- /dev/null +++ b/.github/scripts/tests/test_resolve_linux_ci_image_tag.py @@ -0,0 +1,125 @@ +#!/usr/bin/env python3 + +import importlib.util +import sys +import unittest +from datetime import datetime, timezone +from pathlib import Path + + +SCRIPT = Path(__file__).parents[1] / "resolve-linux-ci-image-tag.py" +SPEC = importlib.util.spec_from_file_location("resolve_linux_ci_image_tag", SCRIPT) +MODULE = importlib.util.module_from_spec(SPEC) +sys.modules[SPEC.name] = MODULE +SPEC.loader.exec_module(MODULE) + + +def version(version_id, tags): + return MODULE.Version( + id=version_id, + digest=f"sha256:{version_id:064x}", + created_at=datetime(2026, 8, 18, tzinfo=timezone.utc), + tags=tuple(tags), + ) + + +class FakeClient: + def __init__(self, packages): + self.packages = packages + + def list_versions(self, owner, package): + return self.packages.get(package, []) + + +class ResolveTests(unittest.TestCase): + def coherent(self): + tag = "build-20260818-123-1" + return tag, { + package: [ + version( + index, + (tag, "stable") + if package in (MODULE.NORMAL_PACKAGE, MODULE.ARMHF_PACKAGE) + else (tag,), + ) + ] + for index, package in enumerate( + ( + MODULE.NORMAL_PACKAGE, + *MODULE.ROUTINE_PACKAGES, + MODULE.ARMHF_PACKAGE, + MODULE.ARMHF_CROSS_PACKAGE, + ), + start=1, + ) + } + + def test_resolves_build_tag_attached_to_stable_pointer(self): + tag, packages = self.coherent() + self.assertEqual(MODULE.resolve(FakeClient(packages)), tag) + + def test_rejects_missing_generation_member(self): + _, packages = self.coherent() + packages[MODULE.ARM64_PACKAGE] = [] + with self.assertRaisesRegex(RuntimeError, "does not exist"): + MODULE.resolve(FakeClient(packages)) + + def test_strict_resolution_rejects_missing_armhf(self): + _, packages = self.coherent() + packages[MODULE.ARMHF_PACKAGE] = [] + with self.assertRaisesRegex(RuntimeError, "does not exist"): + MODULE.resolve(FakeClient(packages), require_armhf=True) + + def test_routine_resolution_does_not_require_armhf(self): + tag, packages = self.coherent() + packages.pop(MODULE.ARMHF_PACKAGE) + self.assertEqual(MODULE.resolve(FakeClient(packages)), tag) + + def test_armhf_resolution_uses_armhf_stable_pointer(self): + tag, packages = self.coherent() + self.assertEqual(MODULE.resolve_armhf(FakeClient(packages)), tag) + + def test_armhf_resolution_requires_armhf_stable_pointer(self): + _, packages = self.coherent() + packages[MODULE.ARMHF_PACKAGE] = [] + with self.assertRaisesRegex(RuntimeError, "armhf.*stable is missing"): + MODULE.resolve_armhf(FakeClient(packages)) + + def test_armhf_resolution_requires_matching_cross_builder(self): + _, packages = self.coherent() + packages[MODULE.ARMHF_CROSS_PACKAGE] = [] + with self.assertRaisesRegex(RuntimeError, "linux-armhf-cross-bookworm"): + MODULE.resolve_armhf(FakeClient(packages)) + + def test_tsan_resolution_uses_tsan_stable_pointer(self): + tag, packages = self.coherent() + packages[MODULE.TSAN_PACKAGE] = [version(8, (tag, "stable"))] + self.assertEqual(MODULE.resolve_tsan(FakeClient(packages)), tag) + + def test_tsan_resolution_requires_tsan_stable_pointer(self): + _, packages = self.coherent() + packages[MODULE.TSAN_PACKAGE] = [] + with self.assertRaisesRegex(RuntimeError, "TSan.*stable is missing"): + MODULE.resolve_tsan(FakeClient(packages)) + + def test_rejects_ambiguous_stable_pointer(self): + _, packages = self.coherent() + packages[MODULE.NORMAL_PACKAGE].append(version(9, ("stable",))) + with self.assertRaisesRegex(RuntimeError, "expected one"): + MODULE.resolve(FakeClient(packages)) + + def test_reports_missing_promoted_generation(self): + _, packages = self.coherent() + packages[MODULE.NORMAL_PACKAGE] = [] + with self.assertRaisesRegex(RuntimeError, "No promoted Linux CI image generation"): + MODULE.resolve(FakeClient(packages)) + + def test_rejects_stable_without_build_tag(self): + _, packages = self.coherent() + packages[MODULE.NORMAL_PACKAGE] = [version(1, ("stable", "candidate-123-1"))] + with self.assertRaisesRegex(RuntimeError, "exactly one"): + MODULE.resolve(FakeClient(packages)) + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/scripts/tests/test_should_refresh_linux_ci_images.py b/.github/scripts/tests/test_should_refresh_linux_ci_images.py new file mode 100644 index 00000000..0b589dac --- /dev/null +++ b/.github/scripts/tests/test_should_refresh_linux_ci_images.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python3 + +import importlib.util +import sys +import unittest +from datetime import datetime, timedelta, timezone +from pathlib import Path + + +SCRIPT = Path(__file__).parents[1] / "should-refresh-linux-ci-images.py" +SPEC = importlib.util.spec_from_file_location("should_refresh_linux_ci_images", SCRIPT) +MODULE = importlib.util.module_from_spec(SPEC) +sys.modules[SPEC.name] = MODULE +SPEC.loader.exec_module(MODULE) + + +def version(version_id, age_days, tags, now): + return MODULE.Version( + id=version_id, + digest=f"sha256:{version_id:064x}", + created_at=now - timedelta(days=age_days), + tags=tuple(tags), + ) + + +class RefreshDecisionTests(unittest.TestCase): + def setUp(self): + self.now = datetime(2026, 8, 25, tzinfo=timezone.utc) + + def test_keeps_recent_stable_image(self): + refresh, age_days = MODULE.should_refresh( + [version(1, 29, ("stable", "build-20260801-1-1"), self.now)], + now=self.now, + max_age_days=30, + ) + self.assertFalse(refresh) + self.assertEqual(age_days, 29) + + def test_refreshes_old_stable_image(self): + refresh, age_days = MODULE.should_refresh( + [version(1, 30, ("stable", "build-20260726-1-1"), self.now)], + now=self.now, + max_age_days=30, + ) + self.assertTrue(refresh) + self.assertEqual(age_days, 30) + + def test_rejects_missing_or_ambiguous_stable_image(self): + with self.assertRaisesRegex(RuntimeError, "found 0"): + MODULE.should_refresh([], now=self.now, max_age_days=30) + with self.assertRaisesRegex(RuntimeError, "found 2"): + MODULE.should_refresh( + [ + version(1, 1, ("stable",), self.now), + version(2, 2, ("stable",), self.now), + ], + now=self.now, + max_age_days=30, + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/.github/scripts/tsan-linux-deps-config.sh b/.github/scripts/tsan-linux-deps-config.sh new file mode 100755 index 00000000..0f4118f8 --- /dev/null +++ b/.github/scripts/tsan-linux-deps-config.sh @@ -0,0 +1,210 @@ +#!/usr/bin/env bash + +# Shared, pinned build tuple for Linux ThreadSanitizer dependencies. +# shellcheck disable=SC2034 + +TSAN_CACHE_EPOCH=1 +TSAN_RUNTIME_BASE=ubuntu24.04 +TSAN_ARCH=x86_64 + +TSAN_GCC_SUFFIX=13 +TSAN_GCC_VERSION=13.3.0 +TSAN_CC=gcc-${TSAN_GCC_SUFFIX} +TSAN_CXX=g++-${TSAN_GCC_SUFFIX} +TSAN_FC=gfortran-${TSAN_GCC_SUFFIX} +TSAN_SANITIZER_FLAGS="-fsanitize=thread -fno-omit-frame-pointer -g1 -O1" +TSAN_LINK_FLAGS="-fsanitize=thread" + +TSAN_QT_VERSION=5.15.18 +TSAN_QT_SOURCE_SHA256=cea1fbabf02455f3f0e8eaa839f5d6f45cdb56b62c8a83af5c1d00ac05f912ea +TSAN_QT_SOURCE_URL="https://download.qt.io/archive/qt/5.15/${TSAN_QT_VERSION}/single/qt-everywhere-opensource-src-${TSAN_QT_VERSION}.tar.xz" + +TSAN_BOOST_VERSION=1.83.0 +TSAN_BOOST_SOURCE_SHA256=6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e +TSAN_BOOST_SOURCE_URL="https://archives.boost.io/release/${TSAN_BOOST_VERSION}/source/boost_1_83_0.tar.bz2" + +TSAN_HAMLIB_REF=4.7.2 +TSAN_HAMLIB_COMMIT=40f63488fe0bd751b147f48d62fd217bf53713a0 +TSAN_HAMLIB_PATCH_COMMIT=141e1b19a0e2d65571e5b0783c43ab2615c0cdf7 + +tsan_config_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" + +tsan_sha256_files() { + local file digest hashes= + + for file in "$@"; do + if [ ! -f "$file" ]; then + echo "Cannot hash missing file: $file" >&2 + return 1 + fi + digest="$(sha256sum "$file" | awk '{print $1}')" + hashes+="${digest}"$'\n' + done + printf '%s' "$hashes" | sha256sum | awk '{print $1}' +} + +tsan_require_toolchain() { + local compiler actual_version linker_path + + for compiler in "$TSAN_CC" "$TSAN_CXX" "$TSAN_FC"; do + if ! command -v "$compiler" >/dev/null 2>&1; then + echo "Pinned TSan compiler not found: $compiler" >&2 + return 1 + fi + actual_version="$($compiler -dumpfullversion -dumpversion)" + if [ "$actual_version" != "$TSAN_GCC_VERSION" ]; then + echo "Pinned TSan compiler mismatch for $compiler: expected $TSAN_GCC_VERSION, got $actual_version" >&2 + return 1 + fi + done + + TSAN_TARGET="$($TSAN_CC -dumpmachine)" + TSAN_CC_PATH="$(readlink -f "$(command -v "$TSAN_CC")")" + TSAN_CXX_PATH="$(readlink -f "$(command -v "$TSAN_CXX")")" + TSAN_FC_PATH="$(readlink -f "$(command -v "$TSAN_FC")")" + linker_path="$($TSAN_CC -print-prog-name=ld)" + if [[ "$linker_path" != */* ]]; then + linker_path="$(command -v "$linker_path")" + fi + TSAN_LINKER_PATH="$(readlink -f "$linker_path")" + TSAN_LIBTSAN_PATH="$(readlink -f "$($TSAN_CC -print-file-name=libtsan.so)")" + TSAN_LIBSTDCXX_PATH="$(readlink -f "$($TSAN_CXX -print-file-name=libstdc++.so)")" + TSAN_LIBGCC_PATH="$(readlink -f "$($TSAN_CC -print-file-name=libgcc_s.so)")" + + for compiler in \ + "$TSAN_CC_PATH" "$TSAN_CXX_PATH" "$TSAN_FC_PATH" "$TSAN_LINKER_PATH" \ + "$TSAN_LIBTSAN_PATH" "$TSAN_LIBSTDCXX_PATH" "$TSAN_LIBGCC_PATH"; do + if [ ! -f "$compiler" ]; then + echo "Pinned TSan toolchain component not found: $compiler" >&2 + return 1 + fi + done + + TSAN_GLIBC_VERSION="$(getconf GNU_LIBC_VERSION | tr ' ' '-')" + TSAN_COMPILER_SHA256="$(tsan_sha256_files \ + "$TSAN_CC_PATH" "$TSAN_CXX_PATH" "$TSAN_FC_PATH" "$TSAN_LINKER_PATH")" + TSAN_RUNTIME_SHA256="$({ + printf '%s\n' "$TSAN_GCC_VERSION" "$TSAN_TARGET" "$TSAN_GLIBC_VERSION" + sha256sum "$TSAN_LIBTSAN_PATH" "$TSAN_LIBSTDCXX_PATH" "$TSAN_LIBGCC_PATH" + } | sha256sum | awk '{print $1}')" + TSAN_TOOLCHAIN_ID="gcc${TSAN_GCC_VERSION}-${TSAN_TARGET}-${TSAN_COMPILER_SHA256:0:12}-${TSAN_RUNTIME_SHA256:0:12}" +} + +tsan_dependency_recipe_hash() { + local dependency=$1 build_script + + case "$dependency" in + qt) build_script=build-qt-tsan-linux.sh ;; + boost) build_script=build-boost-tsan-linux.sh ;; + hamlib) build_script=build-hamlib-tsan-linux.sh ;; + *) + echo "Unsupported TSan dependency: $dependency" >&2 + return 2 + ;; + esac + + tsan_sha256_files \ + "${tsan_config_dir}/tsan-linux-deps-config.sh" \ + "${tsan_config_dir}/${build_script}" \ + "${tsan_config_dir}/verify-tsan-deps-linux.sh" +} + +tsan_dependency_version() { + case "$1" in + qt) printf '%s\n' "$TSAN_QT_VERSION" ;; + boost) printf '%s\n' "$TSAN_BOOST_VERSION" ;; + hamlib) printf '%s\n' "$TSAN_HAMLIB_REF" ;; + *) return 2 ;; + esac +} + +tsan_dependency_source_id() { + case "$1" in + qt) printf '%s\n' "$TSAN_QT_SOURCE_SHA256" ;; + boost) printf '%s\n' "$TSAN_BOOST_SOURCE_SHA256" ;; + hamlib) printf '%s+%s\n' "$TSAN_HAMLIB_COMMIT" "$TSAN_HAMLIB_PATCH_COMMIT" ;; + *) return 2 ;; + esac +} + +tsan_dependency_cache_key() { + local dependency=$1 version source_id recipe_hash + + if [ -z "${TSAN_TOOLCHAIN_ID:-}" ]; then + tsan_require_toolchain + fi + version="$(tsan_dependency_version "$dependency")" + source_id="$(tsan_dependency_source_id "$dependency")" + recipe_hash="$(tsan_dependency_recipe_hash "$dependency")" + printf '%s\n' "${dependency}-tsan-linux-${TSAN_ARCH}-${TSAN_RUNTIME_BASE}-${TSAN_TOOLCHAIN_ID}-${version}-${source_id}-epoch${TSAN_CACHE_EPOCH}-${recipe_hash}" +} + +tsan_write_dependency_manifest() { + local dependency=$1 prefix=$2 version source_id recipe_hash cache_key manifest + + tsan_require_toolchain + version="$(tsan_dependency_version "$dependency")" + source_id="$(tsan_dependency_source_id "$dependency")" + recipe_hash="$(tsan_dependency_recipe_hash "$dependency")" + cache_key="$(tsan_dependency_cache_key "$dependency")" + manifest="${prefix}/.wsjtx-tsan-manifest" + + { + printf 'schema=%s\n' "$TSAN_CACHE_EPOCH" + printf 'dependency=%s\n' "$dependency" + printf 'version=%s\n' "$version" + printf 'source_id=%s\n' "$source_id" + printf 'runtime_base=%s\n' "$TSAN_RUNTIME_BASE" + printf 'architecture=%s\n' "$TSAN_ARCH" + printf 'compiler=%s\n' "$TSAN_CC" + printf 'compiler_version=%s\n' "$TSAN_GCC_VERSION" + printf 'compiler_target=%s\n' "$TSAN_TARGET" + printf 'compiler_sha256=%s\n' "$TSAN_COMPILER_SHA256" + printf 'glibc_version=%s\n' "$TSAN_GLIBC_VERSION" + printf 'runtime_sha256=%s\n' "$TSAN_RUNTIME_SHA256" + printf 'recipe_sha256=%s\n' "$recipe_hash" + printf 'cache_key=%s\n' "$cache_key" + printf 'sanitizer_flags=%s\n' "$TSAN_SANITIZER_FLAGS" + printf 'link_flags=%s\n' "$TSAN_LINK_FLAGS" + } > "$manifest" +} + +tsan_emit_github_output() { + if [ -z "${GITHUB_OUTPUT:-}" ]; then + echo "GITHUB_OUTPUT is required for --github-output" >&2 + return 2 + fi + + tsan_require_toolchain + { + printf 'cc=%s\n' "$TSAN_CC" + printf 'cxx=%s\n' "$TSAN_CXX" + printf 'fc=%s\n' "$TSAN_FC" + printf 'gcc_version=%s\n' "$TSAN_GCC_VERSION" + printf 'toolchain_id=%s\n' "$TSAN_TOOLCHAIN_ID" + printf 'qt_key=%s\n' "$(tsan_dependency_cache_key qt)" + printf 'boost_key=%s\n' "$(tsan_dependency_cache_key boost)" + printf 'hamlib_key=%s\n' "$(tsan_dependency_cache_key hamlib)" + printf 'hamlib_ref=%s\n' "$TSAN_HAMLIB_REF" + } >> "$GITHUB_OUTPUT" +} + +if [ "${BASH_SOURCE[0]}" = "$0" ]; then + set -euo pipefail + case "${1:-}" in + --github-output) + tsan_emit_github_output + ;; + --print) + tsan_require_toolchain + printf 'toolchain_id=%s\n' "$TSAN_TOOLCHAIN_ID" + printf 'qt_key=%s\n' "$(tsan_dependency_cache_key qt)" + printf 'boost_key=%s\n' "$(tsan_dependency_cache_key boost)" + printf 'hamlib_key=%s\n' "$(tsan_dependency_cache_key hamlib)" + ;; + *) + echo "Usage: $0 --github-output|--print" >&2 + exit 2 + ;; + esac +fi diff --git a/.github/scripts/validate-ci-inputs.sh b/.github/scripts/validate-ci-inputs.sh new file mode 100755 index 00000000..e801a6eb --- /dev/null +++ b/.github/scripts/validate-ci-inputs.sh @@ -0,0 +1,177 @@ +#!/usr/bin/env bash +# Validate CI string inputs passed through environment variables. +# +# GitHub Actions expands ${{ }} expressions before the shell parses a +# `run:` script. Quoting in YAML does not stop command substitution or +# quote-breaking payloads in those expansions. Callers must pass +# workflow inputs through `env:` (which is not shell-parsed) and invoke +# this script before any later step interpolates the same values. +# +# Only variables that are set are checked, so each workflow can pass +# the subset it uses. Empty values are rejected except for +# WSJT_RC_NUMBER, which is optional. +# +# Usage: +# WSJTX_VERSION=... HAMLIB_BRANCH=... .github/scripts/validate-ci-inputs.sh +# .github/scripts/validate-ci-inputs.sh --self-test + +set -euo pipefail + +fail() { + echo "::error::$*" >&2 + exit 1 +} + +# POSIX case patterns keep this working on bash 3.2 (macOS) and MSYS2. +require_nonempty() { + if [ -z "$2" ]; then + fail "Invalid $1: value must not be empty" + fi +} + +require_boolean() { + case "$2" in + true|false) ;; + *) fail "Invalid $1 '$2': use true or false" ;; + esac +} + +validate_inputs() { + if [ -n "${WSJTX_VERSION+x}" ]; then + require_nonempty "version" "$WSJTX_VERSION" + case "$WSJTX_VERSION" in + *[!A-Za-z0-9._+-]*) + fail "Invalid version '${WSJTX_VERSION}': use only letters, numbers, '.', '_', '+', and '-'" + ;; + esac + fi + + if [ -n "${HAMLIB_BRANCH+x}" ]; then + require_nonempty "hamlib_branch" "$HAMLIB_BRANCH" + case "$HAMLIB_BRANCH" in + *[!A-Za-z0-9._/-]*) + fail "Invalid hamlib_branch '${HAMLIB_BRANCH}': use only letters, numbers, '.', '_', '/', and '-'" + ;; + esac + fi + + if [ -n "${WSJT_RELEASE_CHANNEL+x}" ]; then + case "$WSJT_RELEASE_CHANNEL" in + DEVEL|RC|GA) ;; + *) + fail "Invalid release_channel '${WSJT_RELEASE_CHANNEL}': use DEVEL, RC, or GA" + ;; + esac + fi + + if [ -n "${WSJT_RC_NUMBER+x}" ]; then + case "$WSJT_RC_NUMBER" in + ''|*[!0-9]*) + if [ -n "$WSJT_RC_NUMBER" ]; then + fail "Invalid rc_number '${WSJT_RC_NUMBER}': use digits only" + fi + ;; + esac + fi + + if [ -n "${ARCH+x}" ]; then + case "$ARCH" in + x86_64|aarch64|armhf|arm64) ;; + *) + fail "Invalid arch '${ARCH}': use x86_64, aarch64, armhf, or arm64" + ;; + esac + fi + + if [ -n "${VALIDATE_FORTRAN_FALLBACK+x}" ]; then + require_boolean "validate_fortran_fallback" "$VALIDATE_FORTRAN_FALLBACK" + fi + + if [ -n "${IMAGE_TAG+x}" ]; then + require_nonempty "image_tag" "$IMAGE_TAG" + if [ "${#IMAGE_TAG}" -gt 128 ]; then + fail "Invalid image_tag: value exceeds the 128-character container tag limit" + fi + case "$IMAGE_TAG" in + *[!A-Za-z0-9._-]*) + fail "Invalid image_tag '${IMAGE_TAG}': use a letter or number followed by letters, numbers, '.', '_', or '-'" + ;; + esac + case "$IMAGE_TAG" in + [A-Za-z0-9]*) ;; + *) fail "Invalid image_tag '${IMAGE_TAG}': the first character must be a letter or number" ;; + esac + fi + + if [ -n "${DEPLOYMENT_TARGET+x}" ]; then + case "$DEPLOYMENT_TARGET" in + ''|*[!0-9.]*) + fail "Invalid deployment_target '${DEPLOYMENT_TARGET}': use a dotted numeric version such as 10.13 or 11.0" + ;; + esac + fi + + if [ -n "${RUNNER+x}" ]; then + require_nonempty "runner" "$RUNNER" + case "$RUNNER" in + *[!A-Za-z0-9._-]*) + fail "Invalid runner '${RUNNER}': use only letters, numbers, '.', '_', and '-'" + ;; + esac + fi +} + +run_isolated() { + env -u WSJTX_VERSION -u HAMLIB_BRANCH -u WSJT_RELEASE_CHANNEL \ + -u WSJT_RC_NUMBER -u ARCH -u IMAGE_TAG -u DEPLOYMENT_TARGET -u RUNNER \ + -u VALIDATE_FORTRAN_FALLBACK \ + "$@" "$0" +} + +expect_failure() { + local label="$1" + shift + if run_isolated env "$@" >/dev/null 2>&1; then + echo "self-test failed: expected rejection of ${label}" >&2 + exit 1 + fi +} + +if [ "${1:-}" = "--self-test" ]; then + run_isolated \ + env WSJTX_VERSION="3.2.0-devel" HAMLIB_BRANCH="4.7.2" \ + WSJT_RELEASE_CHANNEL="DEVEL" WSJT_RC_NUMBER="" \ + >/dev/null + run_isolated \ + env WSJTX_VERSION="3.0.1-rc1" HAMLIB_BRANCH="4.7.2" \ + WSJT_RELEASE_CHANNEL="RC" WSJT_RC_NUMBER="1" \ + ARCH="x86_64" DEPLOYMENT_TARGET="10.13" RUNNER="macos-15-intel" \ + IMAGE_TAG="candidate-123-1" \ + VALIDATE_FORTRAN_FALLBACK="true" \ + >/dev/null + run_isolated env HAMLIB_BRANCH="integration/4.7" VALIDATE_FORTRAN_FALLBACK="false" >/dev/null + + expect_failure 'command substitution in version' WSJTX_VERSION='3.1.0$(id)' + expect_failure 'backticks in version' WSJTX_VERSION='3.1.0`id`' + expect_failure 'quote break in version' WSJTX_VERSION='3.1.0"; echo pwned #' + expect_failure 'command substitution in hamlib_branch' HAMLIB_BRANCH='4.7.2$(touch /tmp/x)' + expect_failure 'shell metacharacters in hamlib_branch' HAMLIB_BRANCH='4.7.2; id' + expect_failure 'invalid channel' WSJT_RELEASE_CHANNEL='dev' + expect_failure 'non-numeric rc' WSJT_RC_NUMBER='1a' + expect_failure 'empty version' WSJTX_VERSION='' + expect_failure 'invalid arch' ARCH='x86_64; id' + expect_failure 'slash in image tag' IMAGE_TAG='candidate/unsafe' + expect_failure 'leading punctuation in image tag' IMAGE_TAG='-candidate' + expect_failure 'empty image tag' IMAGE_TAG='' + expect_failure 'overlong image tag' IMAGE_TAG="$(printf 'a%.0s' {1..129})" + expect_failure 'command substitution in deployment_target' DEPLOYMENT_TARGET='11.0$(id)' + expect_failure 'empty fallback boolean' VALIDATE_FORTRAN_FALLBACK='' + expect_failure 'uppercase fallback boolean' VALIDATE_FORTRAN_FALLBACK='TRUE' + expect_failure 'numeric fallback boolean' VALIDATE_FORTRAN_FALLBACK='1' + expect_failure 'shell payload in fallback boolean' VALIDATE_FORTRAN_FALLBACK='true$(id)' + + echo "validate-ci-inputs.sh self-test passed" + exit 0 +fi + +validate_inputs diff --git a/.github/scripts/validate-linux-armhf-runtime.sh b/.github/scripts/validate-linux-armhf-runtime.sh new file mode 100755 index 00000000..0909d512 --- /dev/null +++ b/.github/scripts/validate-linux-armhf-runtime.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash +set -euo pipefail + +VERSION="${VERSION:?missing}" +ARCH="${ARCH:?missing}" +HAMLIB_BRANCH="${HAMLIB_BRANCH:?missing}" +phase=${ARMHF_RUNTIME_PHASE:-all} +if [ "$ARCH" != armhf ]; then + echo "validate-linux-armhf-runtime.sh supports only arch=armhf" >&2 + exit 2 +fi +case "$phase" in + all|test|package) ;; + *) echo "Unsupported ARMHF runtime phase: $phase" >&2; exit 2 ;; +esac + +github_api_token="${GITHUB_TOKEN:-}" +unset GITHUB_TOKEN +cd /work +# shellcheck source=.github/scripts/armhf-ci-image-config.sh +source .github/scripts/armhf-ci-image-config.sh +.github/scripts/verify-armhf-ci-image.sh runtime "$ARCH" "$HAMLIB_BRANCH" + +if [ "$phase" = all ] || [ "$phase" = test ]; then + echo "::group::ARMHF CTest under QEMU" + started="$(date +%s)" + set +e + ( + cd wsjtx-build + LD_LIBRARY_PATH="$ARMHF_RUNTIME_PREFIX" \ + QT_QPA_PLATFORM=xcb \ + xvfb-run -a -s "-screen 0 1280x1024x24" \ + ctest --output-on-failure --output-junit ctest-results.xml + ) 2>&1 | tee wsjtx-build/ctest-armhf.log + status=${PIPESTATUS[0]} + set -e + ended="$(date +%s)" + { + printf 'started_epoch=%s\n' "$started" + printf 'ended_epoch=%s\n' "$ended" + printf 'duration_seconds=%s\n' "$((ended - started))" + printf 'status=%s\n' "$status" + } > wsjtx-build/armhf-ctest-timing.env + echo "::endgroup::" + if [ "$status" -ne 0 ]; then + exit "$status" + fi +fi + +if [ "$phase" = all ] || [ "$phase" = package ]; then + started="$(date +%s)" + set +e + GITHUB_TOKEN="$github_api_token" .github/scripts/package-linux-armhf.sh + status=$? + set -e + ended="$(date +%s)" + { + printf 'started_epoch=%s\n' "$started" + printf 'ended_epoch=%s\n' "$ended" + printf 'duration_seconds=%s\n' "$((ended - started))" + printf 'status=%s\n' "$status" + } > wsjtx-build/armhf-package-timing.env + if [ "$status" -ne 0 ]; then + exit "$status" + fi +fi diff --git a/.github/scripts/validate-workflow-timeouts.py b/.github/scripts/validate-workflow-timeouts.py new file mode 100755 index 00000000..256f5782 --- /dev/null +++ b/.github/scripts/validate-workflow-timeouts.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python3 + +import re +import sys +from pathlib import Path + + +JOB_PATTERN = re.compile( + r"^ (?P[\"']?)(?P[A-Za-z_][A-Za-z0-9_-]*)(?P=quote):" + r"(?:\s+&[A-Za-z_][A-Za-z0-9_-]*)?(?:\s*#.*)?$" +) + + +def unbounded_jobs(path: Path) -> list[str]: + failures: list[str] = [] + in_jobs = False + job_name: str | None = None + job_line = 0 + has_runner = False + has_timeout = False + + def finish_job() -> None: + if job_name is not None and has_runner and not has_timeout: + failures.append(f"{path}:{job_line}: job '{job_name}' has runs-on but no timeout-minutes") + + for line_number, line in enumerate(path.read_text().splitlines(), start=1): + if line == "jobs:": + in_jobs = True + continue + if not in_jobs: + continue + if line and not line[0].isspace() and not line.startswith("#"): + finish_job() + break + + match = JOB_PATTERN.match(line) + if match: + finish_job() + job_name = match.group("name") + job_line = line_number + has_runner = False + has_timeout = False + elif ( + line.startswith(" ") + and not line.startswith(" ") + and line.strip() + and not line.lstrip().startswith("#") + ): + finish_job() + failures.append(f"{path}:{line_number}: unsupported job declaration; timeout cannot be verified") + job_name = None + has_runner = False + has_timeout = False + elif job_name is not None: + has_runner = has_runner or line.startswith(" runs-on:") + has_timeout = has_timeout or line.startswith(" timeout-minutes:") + else: + finish_job() + + return failures + + +def main() -> int: + workflow_dir = Path(".github/workflows") + workflows = sorted((*workflow_dir.glob("*.yml"), *workflow_dir.glob("*.yaml"))) + failures = [failure for path in workflows for failure in unbounded_jobs(path)] + if failures: + print("Every runner-backed GitHub Actions job must define timeout-minutes:", file=sys.stderr) + print("\n".join(failures), file=sys.stderr) + return 1 + print(f"Validated explicit timeouts for runner-backed jobs in {len(workflows)} workflows") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/.github/scripts/verify-armhf-ci-image.sh b/.github/scripts/verify-armhf-ci-image.sh new file mode 100755 index 00000000..b6746269 --- /dev/null +++ b/.github/scripts/verify-armhf-ci-image.sh @@ -0,0 +1,253 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 3 ]; then + echo "Usage: verify-armhf-ci-image.sh ROLE ARCH HAMLIB_REF" >&2 + exit 2 +fi + +expected_role=$1 +expected_arch=$2 +expected_hamlib_ref=$3 +manifest=${WSJTX_CI_IMAGE_MANIFEST:-/opt/wsjtx-ci/image.env} +config_dir=/usr/local/share/wsjtx-ci +if [ ! -f "$config_dir/armhf-ci-image-config.sh" ]; then + config_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +fi +# shellcheck source=.github/scripts/armhf-ci-image-config.sh +. "$config_dir/armhf-ci-image-config.sh" + +if [ ! -f "$manifest" ]; then + echo "ARMHF CI image manifest not found: $manifest" >&2 + exit 1 +fi +declare schema='' role='' architecture='' generation='' recipe_sha256='' +declare compiler_version='' compiler_target='' compiler_sha256='' +declare compiler_signature_sha256='' ccache_compatibility_id='' toolchain_id='' +declare host_dpkg_arch='' package_sha256='' sysroot_package_sha256='' runtime_sha256='' +declare hamlib_ref='' hamlib_commit='' hamlib_sha256='' glibc_version='' +declare binutils_version='' linux_headers_version='' minimum_kernel_version='' +declare quadmath_runtime='' cross_generation='' cross_recipe_sha256='' cross_toolchain_id='' +# shellcheck disable=SC1090 +. "$manifest" + +require_equal() { + local field=$1 expected=$2 actual=$3 + if [ "$actual" != "$expected" ]; then + echo "ARMHF CI image $field mismatch: expected $expected, got $actual" >&2 + exit 1 + fi +} + +require_sha256() { + local field=$1 value=$2 + if [[ ! "$value" =~ ^[0-9a-f]{64}$ ]]; then + echo "ARMHF CI image $field is not a SHA-256 value: ${value:-missing}" >&2 + exit 1 + fi +} + +hash_package_set() { + dpkg-query -W -f='${binary:Package}=${Version}\n' | + LC_ALL=C sort | + sha256sum | + awk '{print $1}' +} + +hash_runtime_set() { + local library records="" + for library in "${ARMHF_GCC_RUNTIME_LIBRARIES[@]}"; do + test -f "$ARMHF_RUNTIME_PREFIX/$library" + records+="$library=$(sha256sum "$ARMHF_RUNTIME_PREFIX/$library" | awk '{print $1}')"$'\n' + done + printf '%s' "$records" | sha256sum | awk '{print $1}' +} + +require_armhf_elf() { + local path=$1 metadata headers attributes + metadata="$(file -L "$path")" + headers="$(readelf -hW "$path")" + attributes="$(readelf -AW "$path")" + case "$metadata:$headers:$attributes" in + *"ELF 32-bit"*"ARM, EABI5"*"hard-float ABI"*"Tag_ABI_VFP_args: VFP registers"*) ;; + *) + echo "Expected ARM EABI5 hard-float ELF: $path" >&2 + echo "$metadata" >&2 + exit 1 + ;; + esac +} + +verify_glibc_ceiling() { + local path=$1 versions maximum + versions="$(readelf --version-info -W "$path")" + maximum="$( + awk ' + { + remaining = $0 + while (match(remaining, /GLIBC_[0-9]+\.[0-9]+/)) { + version = substr(remaining, RSTART + 6, RLENGTH - 6) + split(version, parts, ".") + if (parts[1] > major || (parts[1] == major && parts[2] > minor)) { + major = parts[1] + minor = parts[2] + } + remaining = substr(remaining, RSTART + RLENGTH) + } + } + END { printf "%d.%d\n", major, minor } + ' <<< "$versions" + )" + if dpkg --compare-versions "$maximum" gt "$ARMHF_GLIBC_VERSION"; then + echo "$path requires GLIBC_$maximum, newer than Bookworm GLIBC_$ARMHF_GLIBC_VERSION" >&2 + exit 1 + fi +} + +reject_quadmath_dependency() { + local path=$1 dynamic + dynamic="$(readelf -dW "$path")" + if [[ "$dynamic" == *"Shared library: [libquadmath.so"* ]]; then + echo "$path unexpectedly depends on libquadmath" >&2 + exit 1 + fi +} + +reject_private_glibc_dependency() { + local path=$1 versions + versions="$(readelf --version-info -W "$path")" + if [[ "$versions" == *"GLIBC_PRIVATE"* ]]; then + echo "$path unexpectedly depends on a private glibc symbol" >&2 + exit 1 + fi +} + +require_equal schema "$ARMHF_CI_IMAGE_SCHEMA" "${schema:-}" +require_equal role "$expected_role" "${role:-}" +require_equal architecture "$expected_arch" "${architecture:-}" +require_equal hamlib_ref "$expected_hamlib_ref" "${hamlib_ref:-}" +require_equal glibc_version "$ARMHF_GLIBC_VERSION" "${glibc_version:-}" +require_equal quadmath_runtime unavailable-on-arm "${quadmath_runtime:-}" +require_sha256 recipe_sha256 "${recipe_sha256:-}" +require_sha256 package_sha256 "${package_sha256:-}" +require_sha256 runtime_sha256 "${runtime_sha256:-}" + +profile=armhf-cross-bookworm +if [ "$expected_role" = runtime ]; then + profile=armhf-runtime-bookworm +fi +if [ -n "${IMAGE_RECIPE_SHA256:-}" ]; then + expected_recipe=$IMAGE_RECIPE_SHA256 +else + expected_recipe="$(.github/scripts/linux-ci-image-fingerprint.sh "$profile")" +fi +recipe_match=true +if [ "${WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH:-false}" = true ] && + [ "$recipe_sha256" != "$expected_recipe" ]; then + echo "::warning::ARMHF $expected_role image recipe differs from this checkout; using its retained immutable generation" >&2 + recipe_match=false +else + require_equal recipe_sha256 "$expected_recipe" "$recipe_sha256" +fi + +actual_package_sha256="$(hash_package_set)" +require_equal package_sha256 "$package_sha256" "$actual_package_sha256" +require_equal runtime_sha256 "$runtime_sha256" "$(hash_runtime_set)" +for library in "${ARMHF_GCC_RUNTIME_LIBRARIES[@]}"; do + require_armhf_elf "$ARMHF_RUNTIME_PREFIX/$library" + verify_glibc_ceiling "$ARMHF_RUNTIME_PREFIX/$library" + reject_quadmath_dependency "$ARMHF_RUNTIME_PREFIX/$library" + reject_private_glibc_dependency "$ARMHF_RUNTIME_PREFIX/$library" +done + +case "$expected_role" in + cross-builder) + compiler="$ARMHF_TOOLCHAIN_PREFIX/bin/$ARMHF_TARGET_TRIPLET-gcc" + require_equal host_dpkg_arch amd64 "${host_dpkg_arch:-}" + require_equal compiler_version "$ARMHF_GCC_VERSION" "${compiler_version:-}" + require_equal compiler_target "$ARMHF_TARGET_TRIPLET" "${compiler_target:-}" + require_equal binutils_version "$ARMHF_BINUTILS_VERSION" "${binutils_version:-}" + require_equal linux_headers_version "$ARMHF_LINUX_HEADERS_VERSION" "${linux_headers_version:-}" + require_equal minimum_kernel_version "$ARMHF_MIN_KERNEL_VERSION" "${minimum_kernel_version:-}" + require_equal compiler_version "$compiler_version" "$($compiler -dumpfullversion -dumpversion)" + require_equal compiler_target "$compiler_target" "$($compiler -dumpmachine)" + compiler_metadata="$(file -L "$compiler")" + case "$compiler_metadata" in + *"ELF 64-bit"*"x86-64"*) ;; + *) echo "Cross compiler is not a native x86-64 executable: $compiler_metadata" >&2; exit 1 ;; + esac + signature_helper="$config_dir/linux-ccache-compiler-signature.sh" + IFS=$'\t' read -r actual_version actual_target actual_sha256 \ + actual_ccache_id actual_signature < <("$signature_helper" "$compiler") + require_equal compiler_version "$compiler_version" "$actual_version" + require_equal compiler_target "$compiler_target" "$actual_target" + require_equal compiler_sha256 "$compiler_sha256" "$actual_sha256" + require_equal ccache_compatibility_id "$ccache_compatibility_id" "$actual_ccache_id" + require_equal compiler_signature_sha256 "$compiler_signature_sha256" "$actual_signature" + require_equal sysroot_package_sha256 "$sysroot_package_sha256" \ + "$(sha256sum /opt/wsjtx-ci/armhf-sysroot-packages.txt | awk '{print $1}')" + require_equal hamlib_commit "$LINUX_HAMLIB_COMMIT" "${hamlib_commit:-}" + require_equal hamlib_sha256 "$hamlib_sha256" \ + "$(sha256sum "$ARMHF_SYSROOT/usr/lib/libhamlib.a" | awk '{print $1}')" + for target_file in \ + "$ARMHF_SYSROOT/usr/bin/rigctl" \ + "$ARMHF_SYSROOT/usr/bin/rigctld" \ + "$ARMHF_SYSROOT/usr/bin/rigctlcom" \ + "$ARMHF_SYSROOT/usr/lib/$ARMHF_TARGET_TRIPLET/libQt5Core.so.5" \ + "$ARMHF_SYSROOT/usr/lib/$ARMHF_TARGET_TRIPLET/qt5/plugins/platforms/libqxcb.so"; do + require_armhf_elf "$target_file" + reject_quadmath_dependency "$target_file" + reject_private_glibc_dependency "$target_file" + done + for smoke in /opt/wsjtx-ci/toolchain-smoke/*-smoke; do + require_armhf_elf "$smoke" + reject_quadmath_dependency "$smoke" + reject_private_glibc_dependency "$smoke" + done + ;; + runtime) + require_equal host_dpkg_arch armhf "$(dpkg --print-architecture)" + require_equal cross_generation "$generation" "${cross_generation:-}" + require_sha256 cross_recipe_sha256 "${cross_recipe_sha256:-}" + if [ -e /opt/wsjtx/hamlib ]; then + echo "ARMHF runtime image must not provide the build-image Hamlib prefix" >&2 + exit 1 + fi + qemu_metadata="$(file -L "$ARMHF_QEMU_EXECUTABLE")" + case "$qemu_metadata" in + *"ELF 64-bit"*"x86-64"*) ;; + *) echo "ARMHF AppImage QEMU helper is not x86-64: $qemu_metadata" >&2; exit 1 ;; + esac + for plugin in \ + /usr/lib/arm-linux-gnueabihf/qt5/plugins/platforms/libqxcb.so \ + /usr/lib/arm-linux-gnueabihf/qt5/plugins/sqldrivers/libqsqlite.so; do + require_armhf_elf "$plugin" + done + for smoke in /opt/wsjtx-ci/toolchain-smoke/*-smoke; do + require_armhf_elf "$smoke" + reject_quadmath_dependency "$smoke" + reject_private_glibc_dependency "$smoke" + LD_LIBRARY_PATH="$ARMHF_RUNTIME_PREFIX" OMP_NUM_THREADS=2 "$smoke" + done + ;; + *) + echo "Unsupported ARMHF image role: $expected_role" >&2 + exit 2 + ;; +esac + +echo "ARMHF CI image: $role ${generation:-unknown} (${toolchain_id:-${cross_toolchain_id:-unknown}})" +if [ -n "${GITHUB_OUTPUT:-}" ]; then + output_prefix=${WSJTX_CI_OUTPUT_PREFIX:-} + { + printf '%sgeneration=%s\n' "$output_prefix" "$generation" + printf '%srecipe_match=%s\n' "$output_prefix" "$recipe_match" + if [ "$expected_role" = cross-builder ]; then + printf '%stoolchain_id=%s\n' "$output_prefix" "$toolchain_id" + printf '%sccache_compatibility_id=%s\n' "$output_prefix" "$ccache_compatibility_id" + printf '%sccache_compiler_check=string:%s\n' "$output_prefix" "$compiler_signature_sha256" + else + printf '%stoolchain_id=%s\n' "$output_prefix" "$cross_toolchain_id" + fi + } >> "$GITHUB_OUTPUT" +fi diff --git a/.github/scripts/verify-linux-ci-image.sh b/.github/scripts/verify-linux-ci-image.sh new file mode 100755 index 00000000..dc03dbe4 --- /dev/null +++ b/.github/scripts/verify-linux-ci-image.sh @@ -0,0 +1,268 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 3 ]; then + echo "Usage: verify-linux-ci-image.sh FLAVOR ARCH HAMLIB_REF" >&2 + exit 2 +fi + +expected_flavor=$1 +expected_arch=$2 +expected_hamlib_ref=$3 +manifest=${WSJTX_CI_IMAGE_MANIFEST:-/opt/wsjtx-ci/image.env} +image_prefix=${WSJTX_CI_PREFIX_OVERRIDE:-/opt/wsjtx} + +config_dir=/usr/local/share/wsjtx-ci +if [ ! -f "$config_dir/linux-ci-image-config.sh" ]; then + config_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +fi +# shellcheck source=.github/scripts/linux-ci-image-config.sh +. "$config_dir/linux-ci-image-config.sh" +if [ "$expected_flavor" = tsan ]; then + # shellcheck source=.github/scripts/tsan-linux-deps-config.sh + . "$config_dir/tsan-linux-deps-config.sh" +fi + +if [ ! -f "$manifest" ]; then + echo "Linux CI image manifest not found: $manifest" >&2 + exit 1 +fi + +# shellcheck disable=SC1090 +. "$manifest" + +require_equal() { + local field=$1 expected=$2 actual=$3 + if [ "$actual" != "$expected" ]; then + echo "Linux CI image $field mismatch: expected $expected, got $actual" >&2 + exit 1 + fi +} + +require_sha256() { + local field=$1 value=$2 + if [[ ! "$value" =~ ^[0-9a-f]{64}$ ]]; then + echo "Linux CI image $field is not a SHA-256 value: ${value:-missing}" >&2 + exit 1 + fi +} + +require_key_component() { + local field=$1 value=$2 + if [[ ! "$value" =~ ^[A-Za-z0-9][A-Za-z0-9._-]*$ ]]; then + echo "Linux CI image $field is not a safe cache-key component: ${value:-missing}" >&2 + exit 1 + fi +} + +require_equal schema 1 "${schema:-}" +require_equal flavor "$expected_flavor" "${flavor:-}" +require_equal architecture "$expected_arch" "${architecture:-}" +require_equal hamlib_ref "$expected_hamlib_ref" "${hamlib_ref:-}" +require_key_component generation "${generation:-}" + +case "$expected_flavor" in + normal) + expected_compiler=gcc + require_equal hamlib_commit "$LINUX_HAMLIB_COMMIT" "${hamlib_commit:-}" + require_equal pfunit_version "$LINUX_PFUNIT_VERSION" "${pfunit_version:-}" + require_equal pfunit_commit "$LINUX_PFUNIT_COMMIT" "${pfunit_commit:-}" + profile=normal-noble + if [ "$expected_arch" != x86_64 ]; then + profile=normal-bookworm + fi + pfunit_config="$(find "$image_prefix/pfunit" -name PFUNITConfig.cmake -print -quit)" + if [ -z "$pfunit_config" ]; then + echo "PFUNITConfig.cmake not found in the Linux CI image" >&2 + exit 1 + fi + test -f "$image_prefix/hamlib/lib/libhamlib.a" + if [ "${WSJTX_CI_IMAGE_SKIP_RUNTIME_CHECKS:-false}" != true ]; then + qt_core_config="$(find /usr -path '*/cmake/Qt5Core/Qt5CoreConfig.cmake' -print -quit)" + qt_multimedia_config="$(find /usr -path '*/cmake/Qt5Multimedia/Qt5MultimediaConfig.cmake' -print -quit)" + qt_plugin="$(find /usr -path '*/plugins/platforms/*' -type f -print -quit)" + test -n "$qt_core_config" + test -n "$qt_multimedia_config" + test -n "$qt_plugin" + fi + pfunit_dir="$(dirname "$pfunit_config")" + hamlib_prefix=$image_prefix/hamlib + ;; + tsan) + expected_compiler=gcc-13 + profile=tsan-noble + hamlib_prefix=$image_prefix/tsan/hamlib + require_equal hamlib_commit "$TSAN_HAMLIB_COMMIT" "${hamlib_commit:-}" + require_equal hamlib_patch_commit "$TSAN_HAMLIB_PATCH_COMMIT" "${hamlib_patch_commit:-}" + require_equal qt_version "$TSAN_QT_VERSION" "${qt_version:-}" + require_equal boost_version "$TSAN_BOOST_VERSION" "${boost_version:-}" + "$config_dir/verify-tsan-deps-linux.sh" \ + "$image_prefix/tsan/qt" "$image_prefix/tsan/boost" "$image_prefix/tsan/hamlib" + boost_config="$(find "$image_prefix/tsan/boost" -name BoostConfig.cmake -print -quit)" + test -n "$boost_config" + if [ "${WSJTX_CI_IMAGE_SKIP_RUNTIME_CHECKS:-false}" != true ]; then + test -d "$image_prefix/tsan/qt/plugins" + test -n "$(find "$image_prefix/tsan/qt/plugins" -type f -print -quit)" + fi + ;; + *) + echo "Unsupported Linux CI image flavor: $expected_flavor" >&2 + exit 2 + ;; +esac + +if [ -n "${IMAGE_RECIPE_SHA256:-}" ]; then + expected_recipe=$IMAGE_RECIPE_SHA256 +else + expected_recipe="$(.github/scripts/linux-ci-image-fingerprint.sh "$profile")" +fi +toolchain_recipe=$expected_recipe +recipe_match=true +if [ "${WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH:-false}" = true ] && + [ "${recipe_sha256:-}" != "$expected_recipe" ]; then + echo "::warning::Linux CI image recipe fingerprint differs from this checkout; using the last known-good image generation" >&2 + if [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then + { + echo "### Linux CI image fallback" + echo + echo "This job used a previously promoted image while the dependency refresh was in progress." + echo + echo "- Image recipe in the image: \`${recipe_sha256:-missing}\`" + echo "- Recipe in this checkout: \`$expected_recipe\`" + } >> "$GITHUB_STEP_SUMMARY" + fi + toolchain_recipe=${recipe_sha256:-} + recipe_match=false +else + require_equal recipe_sha256 "$expected_recipe" "${recipe_sha256:-}" +fi +require_equal compiler "$expected_compiler" "${compiler:-}" +test -n "${compiler:-}" +test -n "${compiler_version:-}" +test -n "${compiler_sha256:-}" +test -n "${compiler_target:-}" +test -n "${package_sha256:-}" +require_key_component toolchain_id "${toolchain_id:-}" +if [[ ! "${compiler_version:-}" =~ ^[0-9]+([.][0-9]+)*$ ]]; then + echo "Linux CI image compiler_version is invalid: ${compiler_version:-missing}" >&2 + exit 1 +fi +require_key_component compiler_target "${compiler_target:-}" +require_sha256 compiler_sha256 "${compiler_sha256:-}" +require_sha256 package_sha256 "${package_sha256:-}" +require_sha256 recipe_sha256 "${recipe_sha256:-}" + +if [ "$recipe_match" = true ]; then + compiler_major=${compiler_version%%.*} + require_equal ccache_compatibility_id \ + "gcc${compiler_major}-v2" "${ccache_compatibility_id:-}" + require_key_component ccache_compatibility_id "$ccache_compatibility_id" + require_sha256 compiler_signature_sha256 "${compiler_signature_sha256:-}" + verified_ccache_compatibility_id=$ccache_compatibility_id + verified_ccache_compiler_check="string:$compiler_signature_sha256" +else + verified_ccache_compatibility_id=$toolchain_id + verified_ccache_compiler_check=mtime +fi + +if [ "${WSJTX_CI_IMAGE_SKIP_RUNTIME_CHECKS:-false}" != true ]; then + compiler_path="$(readlink -f "$(command -v "$compiler")")" + require_equal dpkg_arch "$(dpkg --print-architecture)" "${dpkg_arch:-}" + require_equal compiler_version "$compiler_version" "$($compiler -dumpfullversion -dumpversion)" + require_equal compiler_target "$compiler_target" "$($compiler -dumpmachine)" + require_equal compiler_sha256 "$compiler_sha256" "$(sha256sum "$compiler_path" | awk '{print $1}')" + actual_package_sha256="$(dpkg-query -W -f='${binary:Package}=${Version}\n' | LC_ALL=C sort | sha256sum | awk '{print $1}')" + require_equal package_sha256 "$package_sha256" "$actual_package_sha256" + toolchain_identity="$toolchain_recipe:$compiler_target:$compiler_sha256:$package_sha256" + toolchain_sha256="$(printf '%s' "$toolchain_identity" | sha256sum | awk '{print $1}')" + require_equal toolchain_id "$toolchain_id" "gcc${compiler_version}-${expected_arch}-${toolchain_sha256:0:20}" + + if [ "$recipe_match" = true ]; then + signature_helper="$config_dir/linux-ccache-compiler-signature.sh" + if [ ! -x "$signature_helper" ]; then + echo "Linux ccache compiler signature helper not found: $signature_helper" >&2 + exit 1 + fi + IFS=$'\t' read -r actual_compiler_version actual_compiler_target \ + actual_compiler_sha256 actual_ccache_compatibility_id \ + actual_compiler_signature_sha256 \ + < <("$signature_helper" "$compiler") + require_equal compiler_version "$compiler_version" "$actual_compiler_version" + require_equal compiler_target "$compiler_target" "$actual_compiler_target" + require_equal compiler_sha256 "$compiler_sha256" "$actual_compiler_sha256" + require_equal ccache_compatibility_id "$ccache_compatibility_id" \ + "$actual_ccache_compatibility_id" + require_equal compiler_signature_sha256 "$compiler_signature_sha256" \ + "$actual_compiler_signature_sha256" + fi +fi + +if [ "${WSJTX_CI_IMAGE_SKIP_RUNTIME_CHECKS:-false}" != true ]; then + smoke_dir="$(mktemp -d)" + cat > "$smoke_dir/CMakeLists.txt" <<'EOF' +cmake_minimum_required(VERSION 3.16) +project(wsjt_ci_image_smoke LANGUAGES CXX) + +find_package(Qt5 REQUIRED COMPONENTS Core) +find_package(Boost REQUIRED COMPONENTS log_setup log) +find_package(PkgConfig REQUIRED) +set(PKG_CONFIG_USE_STATIC_LIBS TRUE) +pkg_check_modules(HAMLIB REQUIRED IMPORTED_TARGET hamlib) + +add_executable(wsjt_ci_image_smoke main.cpp) +target_include_directories(wsjt_ci_image_smoke PRIVATE "${WSJTX_HAMLIB_PREFIX}/include") +target_link_libraries(wsjt_ci_image_smoke PRIVATE Qt5::Core Boost::log_setup Boost::log PkgConfig::HAMLIB) +EOF + cat > "$smoke_dir/main.cpp" <<'EOF' +#include +#include +#include + +int main(int argc, char **argv) +{ + QCoreApplication application(argc, argv); + BOOST_LOG_TRIVIAL(info) << "WSJT-X CI image smoke test"; + return 0; +} +EOF + + cmake_args=( + -S "$smoke_dir" + -B "$smoke_dir/build" + -DCMAKE_BUILD_TYPE=Release + "-DWSJTX_HAMLIB_PREFIX=$hamlib_prefix" + ) + if [ "$expected_flavor" = tsan ]; then + cmake_args+=( + "-DCMAKE_PREFIX_PATH=$image_prefix/tsan/qt;$image_prefix/tsan/boost;$image_prefix/tsan/hamlib" + "-DBOOST_ROOT=$image_prefix/tsan/boost" + -DBoost_NO_SYSTEM_PATHS=ON + -DCMAKE_CXX_FLAGS=-fsanitize=thread + -DCMAKE_EXE_LINKER_FLAGS=-fsanitize=thread + ) + fi + export PKG_CONFIG_PATH="$hamlib_prefix/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" + cmake "${cmake_args[@]}" + cmake --build "$smoke_dir/build" --parallel "$(nproc)" + rm -rf "$smoke_dir" +fi + +echo "Linux CI image: ${generation:-unknown} (${toolchain_id:-unknown}; ccache ${verified_ccache_compatibility_id:-unknown})" + +if [ -n "${GITHUB_OUTPUT:-}" ]; then + { + printf 'generation=%s\n' "$generation" + printf 'toolchain_id=%s\n' "$toolchain_id" + printf 'ccache_compatibility_id=%s\n' "$verified_ccache_compatibility_id" + printf 'ccache_compiler_check=%s\n' "$verified_ccache_compiler_check" + printf 'recipe_match=%s\n' "$recipe_match" + if [ "$expected_flavor" = normal ]; then + printf 'pfunit_dir=%s\n' "$pfunit_dir" + printf 'hamlib_prefix=%s\n' "$hamlib_prefix" + else + printf 'qt_prefix=%s\n' "$image_prefix/tsan/qt" + printf 'boost_prefix=%s\n' "$image_prefix/tsan/boost" + printf 'hamlib_prefix=%s\n' "$image_prefix/tsan/hamlib" + fi + } >> "$GITHUB_OUTPUT" +fi diff --git a/.github/scripts/verify-macos-artifacts.sh b/.github/scripts/verify-macos-artifacts.sh index 954c54e9..981e60d6 100755 --- a/.github/scripts/verify-macos-artifacts.sh +++ b/.github/scripts/verify-macos-artifacts.sh @@ -88,7 +88,9 @@ version_gt() { is_macho() { local file="$1" - file "$file" 2>/dev/null | grep -Eq 'Mach-O|universal binary' + local file_type + file_type=$(file "$file" 2>/dev/null || true) + [[ "$file_type" == *"Mach-O"* || "$file_type" == *"universal binary"* ]] } is_allowed_reference() { @@ -124,10 +126,13 @@ check_file() { echo "::error file=${file}::Could not determine Mach-O architecture" return 1 fi - if ! printf '%s\n' "$archs" | tr ' ' '\n' | grep -qx "$arch"; then + case " ${archs} " in + *" ${arch} "*) ;; + *) echo "::error file=${file}::Expected architecture ${arch}, found: ${archs}" return 1 - fi + ;; + esac minos=$(otool -arch "$arch" -l "$file" 2>/dev/null | awk ' /LC_BUILD_VERSION/ { in_build = 1; next } diff --git a/.github/scripts/verify-macos-static-archives.sh b/.github/scripts/verify-macos-static-archives.sh index 2c20875e..419e0674 100755 --- a/.github/scripts/verify-macos-static-archives.sh +++ b/.github/scripts/verify-macos-static-archives.sh @@ -116,9 +116,14 @@ check_archive() { fi archs=$(lipo -archs "$archive" 2>/dev/null || true) - if [ -n "$archs" ] && ! printf '%s\n' "$archs" | tr ' ' '\n' | grep -qx "$arch"; then - echo "::error file=${archive}::Expected architecture ${arch}, found: ${archs}" - structural_fail=1 + if [ -n "$archs" ]; then + case " ${archs} " in + *" ${arch} "*) ;; + *) + echo "::error file=${archive}::Expected architecture ${arch}, found: ${archs}" + structural_fail=1 + ;; + esac fi while IFS= read -r line; do diff --git a/.github/scripts/verify-sanitizer-instrumentation.py b/.github/scripts/verify-sanitizer-instrumentation.py new file mode 100755 index 00000000..6f5279b9 --- /dev/null +++ b/.github/scripts/verify-sanitizer-instrumentation.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python3 + +import argparse +import json +import subprocess +from pathlib import Path + + +SANITIZERS = { + "asan-ubsan": { + "flag": "-fsanitize=address,undefined", + "symbols": ("__asan_", "__ubsan_"), + "runtimes": ("libasan.so", "libubsan.so"), + }, + "tsan": { + "flag": "-fsanitize=thread", + "symbols": ("__tsan_",), + "runtimes": ("libtsan.so",), + }, +} +LANGUAGE_SUFFIXES = { + "C": {".c"}, + "C++": {".cc", ".cpp", ".cxx"}, + "Fortran": {".f", ".f03", ".f08", ".f90", ".f95", ".for", ".ftn"}, +} + + +def fail(message): + raise SystemExit(f"ERROR: {message}") + + +def command_text(entry): + if "command" in entry: + return entry["command"] + return " ".join(entry.get("arguments", [])) + + +def require_file(path): + if not path.is_file(): + fail(f"expected build artifact is missing: {path}") + + +def tool_output(*arguments): + result = subprocess.run( + arguments, + check=True, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + text=True, + ) + return result.stdout + + +def verify_compile_commands(build_dir, sanitizer_flag): + commands_path = build_dir / "compile_commands.json" + require_file(commands_path) + commands = json.loads(commands_path.read_text(encoding="utf-8")) + + language_counts = {language: 0 for language in LANGUAGE_SUFFIXES} + uninstrumented = [] + for entry in commands: + suffix = Path(entry.get("file", "")).suffix.lower() + for language, suffixes in LANGUAGE_SUFFIXES.items(): + if suffix not in suffixes: + continue + language_counts[language] += 1 + if sanitizer_flag not in command_text(entry): + uninstrumented.append(entry.get("file", "")) + + missing_languages = [ + language for language, count in language_counts.items() if count == 0 + ] + if missing_languages: + fail( + "no compile commands were found for: " + ", ".join(missing_languages) + ) + if uninstrumented: + examples = ", ".join(uninstrumented[:10]) + suffix = "" if len(uninstrumented) <= 10 else ", ..." + fail(f"compile commands without sanitizer instrumentation: {examples}{suffix}") + return language_counts + + +def verify_archive(path, symbol): + require_file(path) + symbols = tool_output("nm", "-A", "--undefined-only", str(path)) + if symbol not in symbols: + fail(f"{path.name} has no reference to {symbol}") + + +def verify_link(build_dir, target, sanitizer_flag, runtimes): + link_command_path = build_dir / "CMakeFiles" / f"{target}.dir" / "link.txt" + executable_path = build_dir / target + require_file(link_command_path) + require_file(executable_path) + + if sanitizer_flag not in link_command_path.read_text(encoding="utf-8"): + fail(f"{target} final link command does not contain {sanitizer_flag}") + + dynamic_section = tool_output("readelf", "-d", str(executable_path)) + for runtime in runtimes: + if runtime not in dynamic_section: + fail(f"{target} does not declare a dependency on {runtime}") + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("build_dir", type=Path) + parser.add_argument( + "--sanitizer", choices=SANITIZERS, default="asan-ubsan" + ) + args = parser.parse_args() + + build_dir = args.build_dir.resolve() + if not build_dir.is_dir(): + fail(f"build directory does not exist: {build_dir}") + + sanitizer = SANITIZERS[args.sanitizer] + language_counts = verify_compile_commands(build_dir, sanitizer["flag"]) + for symbol in sanitizer["symbols"]: + verify_archive(build_dir / "libwsjt_cxx.a", symbol) + verify_archive(build_dir / "libwsjt_fort_omp.a", symbol) + verify_link(build_dir, "jt9", sanitizer["flag"], sanitizer["runtimes"]) + verify_link(build_dir, "wsjtx", sanitizer["flag"], sanitizer["runtimes"]) + + print("Sanitizer instrumentation verified") + compile_summary = ", ".join( + f"{language}={count}" for language, count in language_counts.items() + ) + print(f" compile commands: {compile_summary}") + print(" static archives: libwsjt_cxx.a, libwsjt_fort_omp.a") + print(" final executables: jt9, wsjtx") + + +if __name__ == "__main__": + main() diff --git a/.github/scripts/verify-tsan-deps-linux.sh b/.github/scripts/verify-tsan-deps-linux.sh new file mode 100755 index 00000000..54e2ed2f --- /dev/null +++ b/.github/scripts/verify-tsan-deps-linux.sh @@ -0,0 +1,138 @@ +#!/usr/bin/env bash +set -euo pipefail + +usage() { + echo "Usage: verify-tsan-deps-linux.sh QT_PREFIX BOOST_PREFIX HAMLIB_PREFIX [CMAKE_CACHE [BINARY]]" >&2 +} + +if [ "$#" -lt 3 ] || [ "$#" -gt 5 ]; then + usage + exit 2 +fi + +script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" +# shellcheck source=.github/scripts/tsan-linux-deps-config.sh +. "${script_dir}/tsan-linux-deps-config.sh" + +qt_prefix=$1 +boost_prefix=$2 +hamlib_prefix=$3 +cmake_cache=${4:-} +binary=${5:-} + +manifest_value() { + local manifest=$1 key=$2 + awk -F= -v key="$key" '$1 == key {sub(/^[^=]*=/, ""); print; exit}' "$manifest" +} + +cmake_cache_value() { + local cache=$1 key=$2 + awk -F= -v key="$key" '$1 ~ ("^" key ":[^=]+$") {sub(/^[^=]*=/, ""); print; exit}' "$cache" +} + +verify_cmake_cache_prefix() { + local cache=$1 key=$2 prefix=$3 value + value="$(cmake_cache_value "$cache" "$key")" + if [[ "$value" != "$prefix"/* ]]; then + echo "CMake resolved $key outside $prefix: ${value:-}" >&2 + return 1 + fi +} + +verify_manifest() { + local dependency=$1 prefix=$2 manifest expected_key actual_key + manifest="${prefix}/.wsjtx-tsan-manifest" + if [ ! -f "$manifest" ]; then + echo "Missing $dependency TSan manifest: $manifest" >&2 + return 1 + fi + if [ "$(manifest_value "$manifest" dependency)" != "$dependency" ]; then + echo "Unexpected dependency identity in $manifest" >&2 + return 1 + fi + expected_key="$(tsan_dependency_cache_key "$dependency")" + actual_key="$(manifest_value "$manifest" cache_key)" + if [ "$actual_key" != "$expected_key" ]; then + echo "$dependency TSan cache manifest mismatch" >&2 + echo "Expected: $expected_key" >&2 + echo "Actual: $actual_key" >&2 + return 1 + fi +} + +verify_dynamic_tsan_symbols() { + local label=$1 library=$2 + if [ ! -f "$library" ]; then + echo "Missing $label library: $library" >&2 + return 1 + fi + if ! nm -D "$library" | awk '$0 ~ /__tsan_/ {found=1} END {exit !found}'; then + echo "$label does not reference the TSan runtime: $library" >&2 + return 1 + fi +} + +verify_manifest qt "$qt_prefix" +verify_manifest boost "$boost_prefix" +verify_manifest hamlib "$hamlib_prefix" + +qt_core="${qt_prefix}/lib/libQt5Core.so.5" +boost_candidates=("${boost_prefix}"/lib/libboost_log.so*) +boost_log=${boost_candidates[0]} +hamlib_archive="${hamlib_prefix}/lib/libhamlib.a" + +verify_dynamic_tsan_symbols Qt5Core "$qt_core" +verify_dynamic_tsan_symbols Boost.Log "$boost_log" + +if [ ! -f "$hamlib_archive" ]; then + echo "Missing Hamlib archive: $hamlib_archive" >&2 + exit 1 +fi +if ! nm -A "$hamlib_archive" | awk '$0 ~ /__tsan_/ {found=1} END {exit !found}'; then + echo "Hamlib does not reference the TSan runtime: $hamlib_archive" >&2 + exit 1 +fi + +for required in \ + "${qt_prefix}/lib/cmake/Qt5Core/Qt5CoreConfig.cmake" \ + "${qt_prefix}/lib/cmake/Qt5Test/Qt5TestConfig.cmake" \ + "${qt_prefix}/lib/cmake/Qt5Multimedia/Qt5MultimediaConfig.cmake" \ + "${qt_prefix}/lib/cmake/Qt5SerialPort/Qt5SerialPortConfig.cmake" \ + "${qt_prefix}/lib/cmake/Qt5WebSockets/Qt5WebSocketsConfig.cmake" \ + "${boost_prefix}/include/boost/log/core.hpp"; do + if [ ! -e "$required" ]; then + echo "Missing cached TSan dependency file: $required" >&2 + exit 1 + fi +done + +if [ -n "$cmake_cache" ]; then + if [ ! -f "$cmake_cache" ]; then + echo "CMake cache not found: $cmake_cache" >&2 + exit 1 + fi + verify_cmake_cache_prefix "$cmake_cache" Qt5Core_DIR "$qt_prefix" + verify_cmake_cache_prefix "$cmake_cache" Boost_INCLUDE_DIR "$boost_prefix" + verify_cmake_cache_prefix "$cmake_cache" Boost_LOG_LIBRARY_RELEASE "$boost_prefix" + verify_cmake_cache_prefix "$cmake_cache" Boost_LOG_SETUP_LIBRARY_RELEASE "$boost_prefix" + verify_cmake_cache_prefix "$cmake_cache" Hamlib_INCLUDE_DIR "$hamlib_prefix" + verify_cmake_cache_prefix "$cmake_cache" Hamlib_LIBRARY "$hamlib_prefix" +fi + +if [ -n "$binary" ]; then + if [ ! -x "$binary" ]; then + echo "TSan binary not found or not executable: $binary" >&2 + exit 1 + fi + linked="$(ldd "$binary")" + if ! printf '%s\n' "$linked" | awk -v prefix="$qt_prefix" '$0 ~ /libQt5Core/ && index($0, prefix) {found=1} END {exit !found}'; then + echo "Binary is not using cached TSan Qt: $binary" >&2 + exit 1 + fi + if ! printf '%s\n' "$linked" | awk -v prefix="$boost_prefix" '$0 ~ /libboost_log/ && index($0, prefix) {found=1} END {exit !found}'; then + echo "Binary is not using cached TSan Boost.Log: $binary" >&2 + exit 1 + fi +fi + +echo "Verified pinned TSan Qt, Boost, and Hamlib prefixes" diff --git a/.github/scripts/write-armhf-ci-manifest.sh b/.github/scripts/write-armhf-ci-manifest.sh new file mode 100755 index 00000000..93ea9e77 --- /dev/null +++ b/.github/scripts/write-armhf-ci-manifest.sh @@ -0,0 +1,121 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 4 ]; then + echo "Usage: write-armhf-ci-manifest.sh ROLE ARCH GENERATION RECIPE_SHA256" >&2 + exit 2 +fi + +requested_role=$1 +requested_arch=$2 +requested_generation=$3 +requested_recipe_sha256=$4 +role=$requested_role +arch=$requested_arch +generation=$requested_generation +recipe_sha256=$requested_recipe_sha256 +config_dir=${WSJTX_ARMHF_CONFIG_DIR:-/usr/local/share/wsjtx-ci} +manifest_dir=${WSJTX_CI_MANIFEST_DIR:-/opt/wsjtx-ci} +declare toolchain_id='' runtime_sha256='' hamlib_ref='' hamlib_commit='' + +# shellcheck source=.github/scripts/armhf-ci-image-config.sh +. "$config_dir/armhf-ci-image-config.sh" + +hash_package_set() { + dpkg-query -W -f='${binary:Package}=${Version}\n' | + LC_ALL=C sort | + sha256sum | + awk '{print $1}' +} + +hash_runtime_set() { + local library records="" + for library in "${ARMHF_GCC_RUNTIME_LIBRARIES[@]}"; do + records+="$library=$(sha256sum "$ARMHF_RUNTIME_PREFIX/$library" | awk '{print $1}')"$'\n' + done + printf '%s' "$records" | sha256sum | awk '{print $1}' +} + +mkdir -p "$manifest_dir" +case "$role" in + cross-builder) + compiler="$ARMHF_TOOLCHAIN_PREFIX/bin/$ARMHF_TARGET_TRIPLET-gcc" + signature_helper="$config_dir/linux-ccache-compiler-signature.sh" + IFS=$'\t' read -r compiler_version compiler_target compiler_sha256 \ + ccache_compatibility_id compiler_signature_sha256 \ + < <("$signature_helper" "$compiler") + sysroot_package_sha256="$(sha256sum "$manifest_dir/armhf-sysroot-packages.txt" | awk '{print $1}')" + runtime_sha256="$(hash_runtime_set)" + hamlib_sha256="$(sha256sum "$ARMHF_SYSROOT/usr/lib/libhamlib.a" | awk '{print $1}')" + package_sha256="$(hash_package_set)" + identity="$recipe_sha256:$compiler_target:$compiler_sha256:$sysroot_package_sha256:$runtime_sha256:$hamlib_sha256" + identity_sha256="$(printf '%s' "$identity" | sha256sum | awk '{print $1}')" + toolchain_id="gcc${compiler_version}-${arch}-${identity_sha256:0:20}" + { + printf 'schema=%s\n' "$ARMHF_CI_IMAGE_SCHEMA" + printf 'role=%s\n' "$role" + printf 'architecture=%s\n' "$arch" + printf 'generation=%s\n' "$generation" + printf 'recipe_sha256=%s\n' "$recipe_sha256" + printf 'compiler_version=%s\n' "$compiler_version" + printf 'compiler_target=%s\n' "$compiler_target" + printf 'compiler_sha256=%s\n' "$compiler_sha256" + printf 'compiler_signature_sha256=%s\n' "$compiler_signature_sha256" + printf 'ccache_compatibility_id=%s\n' "$ccache_compatibility_id" + printf 'toolchain_id=%s\n' "$toolchain_id" + printf 'host_dpkg_arch=%s\n' "$(dpkg --print-architecture)" + printf 'package_sha256=%s\n' "$package_sha256" + printf 'sysroot_package_sha256=%s\n' "$sysroot_package_sha256" + printf 'runtime_sha256=%s\n' "$runtime_sha256" + printf 'hamlib_ref=%s\n' "$LINUX_HAMLIB_REF" + printf 'hamlib_commit=%s\n' "$LINUX_HAMLIB_COMMIT" + printf 'hamlib_sha256=%s\n' "$hamlib_sha256" + printf 'glibc_version=%s\n' "$ARMHF_GLIBC_VERSION" + printf 'binutils_version=%s\n' "$ARMHF_BINUTILS_VERSION" + printf 'linux_headers_version=%s\n' "$ARMHF_LINUX_HEADERS_VERSION" + printf 'minimum_kernel_version=%s\n' "$ARMHF_MIN_KERNEL_VERSION" + printf 'quadmath_runtime=%s\n' unavailable-on-arm + } > "$manifest_dir/image.env" + ;; + runtime) + cross_manifest="$config_dir/cross-builder.env" + if [ ! -f "$cross_manifest" ]; then + echo "Cross-builder manifest is missing: $cross_manifest" >&2 + exit 1 + fi + # shellcheck disable=SC1090 + . "$cross_manifest" + cross_generation=$generation + cross_recipe_sha256=$recipe_sha256 + cross_toolchain_id=$toolchain_id + cross_runtime_sha256=$runtime_sha256 + cross_hamlib_ref=$hamlib_ref + cross_hamlib_commit=$hamlib_commit + runtime_package_sha256="$(hash_package_set)" + runtime_sha256="$(hash_runtime_set)" + if [ "$runtime_sha256" != "$cross_runtime_sha256" ]; then + echo "Runtime GCC library set differs from the cross-builder" >&2 + exit 1 + fi + { + printf 'schema=%s\n' "$ARMHF_CI_IMAGE_SCHEMA" + printf 'role=%s\n' "$requested_role" + printf 'architecture=%s\n' "$requested_arch" + printf 'generation=%s\n' "$requested_generation" + printf 'recipe_sha256=%s\n' "$requested_recipe_sha256" + printf 'cross_generation=%s\n' "$cross_generation" + printf 'cross_recipe_sha256=%s\n' "$cross_recipe_sha256" + printf 'cross_toolchain_id=%s\n' "$cross_toolchain_id" + printf 'runtime_sha256=%s\n' "$runtime_sha256" + printf 'package_sha256=%s\n' "$runtime_package_sha256" + printf 'hamlib_ref=%s\n' "$cross_hamlib_ref" + printf 'hamlib_commit=%s\n' "$cross_hamlib_commit" + printf 'glibc_version=%s\n' "$ARMHF_GLIBC_VERSION" + printf 'quadmath_runtime=%s\n' unavailable-on-arm + } > "$manifest_dir/image.env" + ;; + *) + echo "Unsupported ARMHF image role: $role" >&2 + exit 2 + ;; +esac diff --git a/.github/workflows/build-linux-sanitizers.yml b/.github/workflows/build-linux-sanitizers.yml new file mode 100644 index 00000000..1db5293e --- /dev/null +++ b/.github/workflows/build-linux-sanitizers.yml @@ -0,0 +1,93 @@ +name: Build Linux Sanitizers + +on: + workflow_call: + inputs: + hamlib_branch: + description: "Hamlib version baked into the CI image" + required: false + type: string + default: "4.7.2" + sanitizer: + description: "Sanitizer mode: asan-ubsan or tsan" + required: true + type: string + image_tag: + description: "Immutable GHCR image tag; empty resolves the current validated generation" + required: false + type: string + default: "" + recache: + description: "Force ccache to recompile" + required: false + type: boolean + default: false + save_ccache: + description: "Save compiled objects for trusted builds" + required: false + type: boolean + default: false + advisory: + description: "Allow sanitizer failures without failing the caller" + required: false + type: boolean + default: false + allow_stale_image: + description: "Allow a previously promoted image when a dependency refresh changed the recipe" + required: false + type: boolean + default: false + +permissions: + contents: read + packages: read + +jobs: + resolve-image: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + outputs: + image_tag: ${{ steps.resolve.outputs.image_tag }} + steps: + - uses: actions/checkout@v7 + - id: resolve + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REQUESTED_TAG: ${{ inputs.image_tag }} + RESOLVE_TSAN: ${{ inputs.sanitizer == 'tsan' }} + shell: bash + run: | + if [ -n "$REQUESTED_TAG" ]; then + IMAGE_TAG="$REQUESTED_TAG" .github/scripts/validate-ci-inputs.sh + echo "image_tag=$REQUESTED_TAG" >> "$GITHUB_OUTPUT" + elif [ "$RESOLVE_TSAN" = true ]; then + RESOLVE_TSAN=true .github/scripts/resolve-linux-ci-image-tag.py + else + .github/scripts/resolve-linux-ci-image-tag.py + fi + + build: + needs: resolve-image + name: ${{ inputs.sanitizer == 'tsan' && 'Linux x86_64 TSan' || 'Linux x86_64 ASan + UBSan' }} + runs-on: ubuntu-24.04 + timeout-minutes: ${{ inputs.sanitizer == 'tsan' && 180 || 40 }} + continue-on-error: ${{ inputs.advisory }} + container: + image: ${{ inputs.sanitizer == 'tsan' && format('ghcr.io/wsjtx/wsjtx-internal/linux-tsan-noble:{0}', needs.resolve-image.outputs.image_tag) || format('ghcr.io/wsjtx/wsjtx-internal/linux-noble:{0}', needs.resolve-image.outputs.image_tag) }} + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v7 + - name: Validate workflow inputs + env: + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + IMAGE_TAG: ${{ needs.resolve-image.outputs.image_tag }} + run: .github/scripts/validate-ci-inputs.sh + - uses: ./.github/actions/build-linux-sanitizers + with: + hamlib_branch: ${{ inputs.hamlib_branch }} + sanitizer: ${{ inputs.sanitizer }} + recache: ${{ inputs.recache }} + save_ccache: ${{ inputs.save_ccache }} + allow_stale_image: ${{ inputs.allow_stale_image }} diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 10c44630..8535f8b3 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -11,12 +11,57 @@ on: description: "Hamlib branch to build" required: false type: string - default: "4.7.0" + default: "4.7.2" arch: - description: "Linux target architecture: x86_64 or aarch64" + description: "Linux target architecture: x86_64, aarch64, or armhf" required: false type: string default: "x86_64" + recache: + description: "Force ccache to recompile and refresh cached objects" + required: false + type: boolean + default: false + image_tag: + description: "Immutable GHCR image tag; empty resolves the current validated generation" + required: false + type: string + default: "" + image_source: + description: "Builder image source: internal or public-release" + required: false + type: string + default: "internal" + image_digest: + description: "Required sha256 digest for a public-release builder image" + required: false + type: string + default: "" + armhf_cross_image_digest: + description: "Required sha256 digest for the public-release ARMHF cross-builder" + required: false + type: string + default: "" + allow_stale_image: + description: "Allow a previously promoted image when a dependency refresh changed the recipe" + required: false + type: boolean + default: false + save_ccache: + description: "Save compiled objects for trusted builds" + required: false + type: boolean + default: false + validate_fortran_fallback: + description: "Build the x86_64 non-OpenMP common-library sentinel graph" + required: false + type: boolean + default: false + build_packages: + description: "Build, validate, and upload Linux packages and executable artifacts" + required: false + type: boolean + default: true release_channel: description: "Build release channel: DEVEL, RC, or GA" required: false @@ -27,289 +72,525 @@ on: required: false type: string default: "" + # Also runnable on its own ("Run workflow" / gh workflow run) to build a single + # Linux arch without dispatching the full ci.yml matrix. GitHub only exposes + # workflow_dispatch when the trigger is on the default branch (develop), so this + # must be merged before it can be dispatched. This entry point supports focused + # single-architecture diagnosis and candidate-image validation; ARMHF also joins + # ci.yml's opt-in full-ci matrix. Inputs mirror workflow_call with standalone + # defaults: hamlib_branch matches what ci.yml / release.yml pass (4.7.2), and + # version is overridable via `-f version=...`. + workflow_dispatch: + inputs: + version: + description: "WSJT-X version string (artifact + package names)" + required: false + type: string + default: "3.2.0-devel" + hamlib_branch: + description: "Hamlib branch to build" + required: false + type: string + default: "4.7.2" + arch: + description: "Linux target architecture" + required: false + type: choice + options: + - x86_64 + - aarch64 + - armhf + default: "x86_64" + recache: + description: "Force ccache to recompile and refresh cached objects" + required: false + type: boolean + default: false + image_tag: + description: "Immutable GHCR image tag; empty resolves the current validated generation" + required: false + type: string + default: "" + image_source: + description: "Builder image source" + required: false + type: choice + options: + - internal + - public-release + default: internal + image_digest: + description: "sha256 digest required with public-release image source" + required: false + type: string + default: "" + armhf_cross_image_digest: + description: "sha256 digest required for the public-release ARMHF cross-builder" + required: false + type: string + default: "" + allow_stale_image: + description: "Allow a previously promoted image when a dependency refresh changed the recipe" + required: false + type: boolean + default: false + save_ccache: + description: "Save compiled objects" + required: false + type: boolean + default: false + validate_fortran_fallback: + description: "Build the x86_64 non-OpenMP common-library sentinel graph" + required: false + type: boolean + default: false + build_packages: + description: "Build, validate, and upload Linux packages and executable artifacts" + required: false + type: boolean + default: true + release_channel: + description: "Build release channel" + required: false + type: choice + options: + - DEVEL + - RC + - GA + default: "DEVEL" + rc_number: + description: "Release candidate number when release_channel is RC" + required: false + type: string + default: "" + +# Architecture jobs are gated on `inputs.arch`. Each call from ci.yml / +# release.yml passes a single target, so exactly one build job runs per call. +# Splitting on arch +# keeps the per-arch runtime profile explicit at the job level: +# +# x86_64 — validated Noble container on ubuntu-24.04. +# aarch64 — validated GCC 13.4 Bookworm container on ubuntu-24.04-arm. This keeps the +# Bookworm glibc 2.36 + pre-t64 library baseline while using GCC 13 +# (issue #49). +# armhf — native x86_64-to-ARMHF GCC 13.4 cross-build followed by target +# tests and packaging in a Bookworm arm/v7 container under QEMU +# (issue #51). DigiPi / Pi Zero 2W class. +# +# The native jobs use the build-linux-payload composite action. ARMHF needs +# separate host-build and target-runtime phases, but shares their artifact +# validators and external artifact contracts. + +permissions: + contents: read + packages: read jobs: - build: - runs-on: ${{ inputs.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }} + resolve-image: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + outputs: + image_tag: ${{ steps.resolve.outputs.image_tag }} + image_reference: ${{ steps.resolve.outputs.image_reference }} + cross_image_reference: ${{ steps.resolve.outputs.cross_image_reference }} steps: - - uses: actions/checkout@v6 - - - name: Install dependencies + - uses: actions/checkout@v7 + - id: resolve + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REQUESTED_TAG: ${{ inputs.image_tag }} + ARMHF_BUILD: ${{ inputs.arch == 'armhf' }} + ARCH: ${{ inputs.arch }} + IMAGE_SOURCE: ${{ inputs.image_source }} + IMAGE_DIGEST: ${{ inputs.image_digest }} + ARMHF_CROSS_IMAGE_DIGEST: ${{ inputs.armhf_cross_image_digest }} + REQUEST_REPOSITORY: ${{ github.repository }} + shell: bash run: | - sudo apt-get update - sudo apt-get install -y \ - build-essential cmake gfortran \ - libfftw3-dev libboost-all-dev \ - qtbase5-dev qttools5-dev qtmultimedia5-dev libqt5serialport5-dev \ - libqt5sql5-sqlite libqt5websockets5-dev \ - libqt5multimedia5-plugins \ - libusb-1.0-0-dev libudev-dev libreadline-dev portaudio19-dev \ - autoconf automake libtool pkg-config \ - texinfo \ - dpkg-dev fakeroot \ - asciidoctor \ - rpm + case "$ARCH" in + x86_64) package=linux-noble; cross_package= ;; + aarch64) package=linux-arm64-bookworm; cross_package= ;; + armhf) package=linux-armv7-bookworm; cross_package=linux-armhf-cross-bookworm ;; + *) + echo "::error::Unsupported Linux architecture: $ARCH" + exit 2 + ;; + esac - - name: Cache pFUnit - id: pfunit-cache - uses: actions/cache@v5 - with: - path: pfunit-prefix - key: pfunit-linux-${{ inputs.arch }}-v4.9.0-${{ hashFiles('.github/workflows/build-linux.yml') }} + case "$IMAGE_SOURCE" in + internal) + if [ -n "$IMAGE_DIGEST" ] || [ -n "$ARMHF_CROSS_IMAGE_DIGEST" ]; then + echo "::error::image digests are valid only for public-release images" + exit 2 + fi + package_root=ghcr.io/wsjtx/wsjtx-internal + ;; + public-release) + if [ "$REQUEST_REPOSITORY" != WSJTX/wsjtx ]; then + echo "::error::Public release images may only be used by WSJTX/wsjtx" + exit 2 + fi + if [[ ! "$IMAGE_DIGEST" =~ ^sha256:[0-9a-f]{64}$ ]]; then + echo "::error::public-release images require an immutable sha256 digest" + exit 2 + fi + if [ "$ARCH" = armhf ]; then + if [[ ! "$ARMHF_CROSS_IMAGE_DIGEST" =~ ^sha256:[0-9a-f]{64}$ ]]; then + echo "::error::public-release ARMHF builds require an immutable cross-builder sha256 digest" + exit 2 + fi + elif [ -n "$ARMHF_CROSS_IMAGE_DIGEST" ]; then + echo "::error::armhf_cross_image_digest is valid only for ARMHF builds" + exit 2 + fi + if [ -z "$REQUESTED_TAG" ]; then + echo "::error::public-release images require their release-specific image_tag" + exit 2 + fi + package_root=ghcr.io/wsjtx/wsjtx + ;; + *) + echo "::error::Unsupported image_source: $IMAGE_SOURCE" + exit 2 + ;; + esac - - name: Build pFUnit - if: steps.pfunit-cache.outputs.cache-hit != 'true' - run: | - git clone --depth 1 --branch v4.9.0 --recursive \ - https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git pfunit-src - cmake -S pfunit-src -B pfunit-build \ - -DSKIP_MPI=YES \ - -DSKIP_OPENMP=YES \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ - -DCMAKE_INSTALL_PREFIX="${GITHUB_WORKSPACE}/pfunit-prefix" - cmake --build pfunit-build -j$(nproc) - cmake --install pfunit-build + if [ -n "$REQUESTED_TAG" ]; then + IMAGE_TAG="$REQUESTED_TAG" .github/scripts/validate-ci-inputs.sh + echo "image_tag=$REQUESTED_TAG" >> "$GITHUB_OUTPUT" + elif [ "$ARMHF_BUILD" = true ]; then + RESOLVE_ARMHF=true .github/scripts/resolve-linux-ci-image-tag.py + else + .github/scripts/resolve-linux-ci-image-tag.py + fi - - name: Locate pFUnit config - id: pfunit - run: | - CONFIG=$(find "${GITHUB_WORKSPACE}/pfunit-prefix" -name PFUNITConfig.cmake | head -1) - if [ -z "$CONFIG" ]; then - echo "ERROR: PFUNITConfig.cmake not found under pfunit-prefix" - find "${GITHUB_WORKSPACE}/pfunit-prefix" -maxdepth 3 -type d - exit 1 + if [ "$IMAGE_SOURCE" = public-release ]; then + echo "image_reference=${package_root}/${package}@${IMAGE_DIGEST}" >> "$GITHUB_OUTPUT" + if [ "$ARCH" = armhf ]; then + echo "cross_image_reference=${package_root}/${cross_package}@${ARMHF_CROSS_IMAGE_DIGEST}" >> "$GITHUB_OUTPUT" + fi + else + image_tag="$(awk -F= '$1 == "image_tag" { print $2 }' "$GITHUB_OUTPUT" | tail -n 1)" + echo "image_reference=${package_root}/${package}:${image_tag}" >> "$GITHUB_OUTPUT" + if [ "$ARCH" = armhf ]; then + echo "cross_image_reference=${package_root}/${cross_package}:${image_tag}" >> "$GITHUB_OUTPUT" + fi fi - PFUNIT_DIR="$(dirname "$CONFIG")" - echo "Found PFUNITConfig.cmake at: $CONFIG" - echo "dir=${PFUNIT_DIR}" >> "$GITHUB_OUTPUT" - - name: Cache Hamlib - id: hamlib-cache - uses: actions/cache@v5 + build-x86_64: + needs: resolve-image + if: inputs.arch == 'x86_64' + runs-on: ubuntu-24.04 + timeout-minutes: 65 + container: + image: ${{ needs.resolve-image.outputs.image_reference }} + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v7 + - name: Validate workflow inputs + env: + WSJTX_VERSION: ${{ inputs.version }} + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + WSJT_RELEASE_CHANNEL: ${{ inputs.release_channel }} + WSJT_RC_NUMBER: ${{ inputs.rc_number }} + ARCH: ${{ inputs.arch }} + IMAGE_TAG: ${{ needs.resolve-image.outputs.image_tag }} + VALIDATE_FORTRAN_FALLBACK: ${{ inputs.validate_fortran_fallback }} + run: .github/scripts/validate-ci-inputs.sh + - uses: ./.github/actions/build-linux-payload with: - path: hamlib-prefix - key: hamlib-linux-${{ inputs.arch }}-${{ inputs.hamlib_branch }}-${{ hashFiles('.github/workflows/build-linux.yml') }} + arch: x86_64 + version: ${{ inputs.version }} + hamlib_branch: ${{ inputs.hamlib_branch }} + runtime_base: host + recache: ${{ inputs.recache }} + save_ccache: ${{ inputs.save_ccache }} + validate_fortran_fallback: ${{ inputs.validate_fortran_fallback }} + build_packages: ${{ inputs.build_packages }} + release_channel: ${{ inputs.release_channel }} + rc_number: ${{ inputs.rc_number }} + allow_stale_image: ${{ inputs.allow_stale_image }} - - name: Build Hamlib - if: steps.hamlib-cache.outputs.cache-hit != 'true' - run: | - git clone --depth 1 --branch "${{ inputs.hamlib_branch }}" \ - https://github.com/Hamlib/Hamlib.git hamlib-src - cd hamlib-src - ./bootstrap - ./configure \ - --prefix="${GITHUB_WORKSPACE}/hamlib-prefix" \ - --disable-shared --enable-static \ - --without-cxx-binding \ - CFLAGS="-g -O2 -fPIC -fdata-sections -ffunction-sections" \ - LDFLAGS="-Wl,--gc-sections" - make -j$(nproc) - make install + build-aarch64: + needs: resolve-image + if: inputs.arch == 'aarch64' + runs-on: ubuntu-24.04-arm + timeout-minutes: 45 + # The official GCC image adds GCC 13.4 without moving off the Bookworm + # glibc 2.36 and pre-t64 runtime baseline (issue #49). + container: + image: ${{ needs.resolve-image.outputs.image_reference }} + credentials: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v7 + - name: Validate workflow inputs + env: + WSJTX_VERSION: ${{ inputs.version }} + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + WSJT_RELEASE_CHANNEL: ${{ inputs.release_channel }} + WSJT_RC_NUMBER: ${{ inputs.rc_number }} + ARCH: ${{ inputs.arch }} + IMAGE_TAG: ${{ needs.resolve-image.outputs.image_tag }} + VALIDATE_FORTRAN_FALLBACK: ${{ inputs.validate_fortran_fallback }} + run: .github/scripts/validate-ci-inputs.sh + - uses: ./.github/actions/build-linux-payload + with: + arch: aarch64 + version: ${{ inputs.version }} + hamlib_branch: ${{ inputs.hamlib_branch }} + runtime_base: bookworm-gcc13.4 + recache: ${{ inputs.recache }} + save_ccache: ${{ inputs.save_ccache }} + validate_fortran_fallback: ${{ inputs.validate_fortran_fallback }} + build_packages: ${{ inputs.build_packages }} + release_channel: ${{ inputs.release_channel }} + rc_number: ${{ inputs.rc_number }} + allow_stale_image: ${{ inputs.allow_stale_image }} - - name: Configure - run: | - cmake -S . -B wsjtx-build \ - -DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/hamlib-prefix;${GITHUB_WORKSPACE}/pfunit-prefix" \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ - -DWSJT_SKIP_MANPAGES=ON \ - -DWSJT_BUILD_TESTS=ON \ - -DWSJT_RELEASE_CHANNEL="${{ inputs.release_channel }}" \ - -DWSJT_RC_NUMBER="${{ inputs.rc_number }}" \ - -DPFUNIT_DIR="${{ steps.pfunit.outputs.dir }}" \ - -Wno-dev + build-armhf: + needs: resolve-image + if: inputs.arch == 'armhf' + runs-on: ubuntu-24.04 + timeout-minutes: 160 + # Compile natively on x86_64 with a pinned GCC 13.4 cross-toolchain, then + # execute target tests and packaging in a clean Bookworm ARMv7 runtime. + # + # Keep JavaScript actions on the host: the runner's x86_64 Node runtime + # cannot execute in the ARMv7 container. Both explicit containers mount + # the checkout at /work so CTest paths remain stable across phases. + env: + VERSION: ${{ inputs.version }} + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + WSJT_RELEASE_CHANNEL: ${{ inputs.release_channel }} + WSJT_RC_NUMBER: ${{ inputs.rc_number }} + steps: + # setup-qemu-action runs on the host (job has no `container:`), + # mutating the host kernel's binfmt_misc table. With arm/v7 + # registered, subsequent `docker run --platform linux/arm/v7` + # invocations execute the container's arm/v7 init + binaries via + # qemu-arm-static. + - uses: docker/setup-qemu-action@v4 + with: + image: tonistiigi/binfmt:qemu-v10.2.3-68@sha256:400a4873b838d1b89194d982c45e5fb3cda4593fbfd7e08a02e76b03b21166f0 + platforms: linux/arm/v7 + - uses: actions/checkout@v7 + - name: Validate workflow inputs + env: + WSJTX_VERSION: ${{ inputs.version }} + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + WSJT_RELEASE_CHANNEL: ${{ inputs.release_channel }} + WSJT_RC_NUMBER: ${{ inputs.rc_number }} + ARCH: armhf + IMAGE_TAG: ${{ needs.resolve-image.outputs.image_tag }} + VALIDATE_FORTRAN_FALLBACK: ${{ inputs.validate_fortran_fallback }} + run: .github/scripts/validate-ci-inputs.sh - - name: Build - run: cmake --build wsjtx-build -j$(nproc) + - uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - - name: Run tests - id: ctest - run: ctest --output-on-failure --output-junit ctest-results.xml - working-directory: wsjtx-build + - name: Inspect ARMHF image pair + id: image env: - QT_QPA_PLATFORM: offscreen + CROSS_BUILDER_IMAGE: ${{ needs.resolve-image.outputs.cross_image_reference }} + RUNTIME_IMAGE: ${{ needs.resolve-image.outputs.image_reference }} + ALLOW_STALE_IMAGE: ${{ inputs.allow_stale_image }} + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + run: | + docker pull --platform linux/amd64 "$CROSS_BUILDER_IMAGE" + docker pull --platform linux/arm/v7 "$RUNTIME_IMAGE" + output_file=.armhf-image-verification-output + trap 'rm -f "$output_file"' EXIT + docker run --rm --platform linux/amd64 \ + -v "${GITHUB_WORKSPACE}:/work" \ + -w /work \ + -e GITHUB_OUTPUT=/work/$output_file \ + -e WSJTX_CI_OUTPUT_PREFIX=cross_ \ + -e WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH="$ALLOW_STALE_IMAGE" \ + "$CROSS_BUILDER_IMAGE" \ + bash .github/scripts/verify-armhf-ci-image.sh cross-builder armhf "$HAMLIB_BRANCH" + docker run --rm --platform linux/arm/v7 \ + -v "${GITHUB_WORKSPACE}:/work" \ + -w /work \ + -e GITHUB_OUTPUT=/work/$output_file \ + -e WSJTX_CI_OUTPUT_PREFIX=runtime_ \ + -e WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH="$ALLOW_STALE_IMAGE" \ + "$RUNTIME_IMAGE" \ + bash .github/scripts/verify-armhf-ci-image.sh runtime armhf "$HAMLIB_BRANCH" - - name: Publish test summary - if: always() && steps.ctest.conclusion != 'skipped' - working-directory: wsjtx-build - run: python3 ../.github/scripts/publish-ctest-summary.py "Linux ${{ inputs.arch }}" >> "$GITHUB_STEP_SUMMARY" + cross_generation=$(awk -F= '$1 == "cross_generation" { print $2 }' "$output_file") + runtime_generation=$(awk -F= '$1 == "runtime_generation" { print $2 }' "$output_file") + cross_toolchain_id=$(awk -F= '$1 == "cross_toolchain_id" { print $2 }' "$output_file") + runtime_toolchain_id=$(awk -F= '$1 == "runtime_toolchain_id" { print $2 }' "$output_file") + if [ "$cross_generation" != "$runtime_generation" ]; then + echo "ARMHF image generation mismatch: $cross_generation != $runtime_generation" >&2 + exit 1 + fi + if [ "$cross_toolchain_id" != "$runtime_toolchain_id" ]; then + echo "ARMHF toolchain identity mismatch: $cross_toolchain_id != $runtime_toolchain_id" >&2 + exit 1 + fi + cross_recipe_match=$(awk -F= '$1 == "cross_recipe_match" { print $2 }' "$output_file") + runtime_recipe_match=$(awk -F= '$1 == "runtime_recipe_match" { print $2 }' "$output_file") + recipe_match=false + if [ "$cross_recipe_match" = true ] && [ "$runtime_recipe_match" = true ]; then + recipe_match=true + fi + ccache_compatibility_id=$(awk -F= '$1 == "cross_ccache_compatibility_id" { print $2 }' "$output_file") + ccache_compiler_check=$(awk -F= '$1 == "cross_ccache_compiler_check" { print $2 }' "$output_file") + # Empty manifest values could coalesce caches from incompatible + # toolchains, so reject them before constructing any cache key. + if [ -z "$ccache_compatibility_id" ] || [ -z "$ccache_compiler_check" ]; then + echo "ARMHF image verification returned incomplete ccache identity" >&2 + exit 1 + fi + { + echo "generation=$cross_generation" + echo "recipe_match=$recipe_match" + echo "ccache_compatibility_id=$ccache_compatibility_id" + echo "ccache_compiler_check=$ccache_compiler_check" + } >> "$GITHUB_OUTPUT" - - name: Upload test results - if: always() && steps.ctest.conclusion != 'skipped' - uses: actions/upload-artifact@v7 + - name: Select armhf ccache key + id: ccache-key + env: + RECACHE: ${{ inputs.recache }} + run: .github/scripts/select-ccache-key-suffix.sh + + - name: Restore armhf ccache + id: ccache + uses: actions/cache/restore@v6 with: - name: ctest-results-linux-${{ inputs.arch }} - path: wsjtx-build/ctest-results.xml - if-no-files-found: ignore + path: .ccache-armhf + key: ccache-linux-armhf-${{ steps.image.outputs.ccache_compatibility_id }}-${{ steps.image.outputs.generation }}-${{ github.sha }}${{ steps.ccache-key.outputs.suffix }} + restore-keys: | + ccache-linux-armhf-${{ steps.image.outputs.ccache_compatibility_id }}-${{ steps.image.outputs.generation }}- + ccache-linux-armhf-${{ steps.image.outputs.ccache_compatibility_id }}- - - name: Verify binary + - name: Cross-build ARMHF binaries + env: + ARCH: armhf + CROSS_BUILDER_IMAGE: ${{ needs.resolve-image.outputs.cross_image_reference }} + RECACHE: ${{ inputs.recache }} + CCACHE_COMPILERCHECK: ${{ steps.image.outputs.ccache_compiler_check }} + WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH: ${{ inputs.allow_stale_image }} run: | - file wsjtx-build/jt9 - file wsjtx-build/jt9 | grep -q "ELF 64-bit" + ccache_args=() + if [ "$RECACHE" = true ]; then + ccache_args=(-e CCACHE_RECACHE=1) + fi + docker run --rm --platform linux/amd64 \ + -v "${GITHUB_WORKSPACE}:/work" \ + -w /work \ + -e VERSION \ + -e HAMLIB_BRANCH \ + -e ARCH \ + -e WSJT_RELEASE_CHANNEL \ + -e WSJT_RC_NUMBER \ + -e CCACHE_DIR=/work/.ccache-armhf \ + -e CCACHE_COMPILERCHECK \ + -e WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH \ + "${ccache_args[@]}" \ + "$CROSS_BUILDER_IMAGE" \ + bash .github/scripts/build-linux-armhf-cross.sh - # CMakeLists.txt:1989-2012 enables CPack's DEB generator when - # dpkg-buildpackage is on the path (provided by dpkg-dev, installed - # above). The DEB generator ignores CPACK_PACKAGE_FILE_NAME and - # uses its own CPACK_DEBIAN_FILE_NAME (default __.deb - # → wsjtx_3.0.1_amd64.deb regardless). Override that variable to - # align the filename with the AppImage/installer naming used by - # the rest of the pipeline. - - name: Package .deb + - name: Test and package under ARMv7 QEMU + id: armhf-runtime env: - VERSION: ${{ inputs.version }} - ARCH: ${{ inputs.arch }} + ARCH: armhf + RUNTIME_IMAGE: ${{ needs.resolve-image.outputs.image_reference }} + WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH: ${{ inputs.allow_stale_image }} + ARMHF_RUNTIME_PHASE: ${{ inputs.build_packages && 'all' || 'test' }} run: | - cd wsjtx-build - cpack -G DEB \ - -D "CPACK_DEBIAN_FILE_NAME=wsjtx-${VERSION}-linux-${ARCH}.deb" - DEB="wsjtx-${VERSION}-linux-${ARCH}.deb" - if [ ! -f "$DEB" ]; then - echo "::error::cpack -G DEB produced no .deb at expected path: $DEB" - ls -la *.deb 2>/dev/null || true - exit 1 - fi - ls -lh "$DEB" - file "$DEB" - dpkg-deb --info "$DEB" | head -20 - dpkg-deb -c "$DEB" | grep -qE '/usr/bin/map65$' - dpkg-deb -f "$DEB" Depends | grep -Eq 'libportaudio|portaudio' + GITHUB_TOKEN="${{ github.token }}" docker run --rm --platform linux/arm/v7 \ + -v "${GITHUB_WORKSPACE}:/work" \ + -w /work \ + -e VERSION \ + -e HAMLIB_BRANCH \ + -e ARCH \ + -e WSJT_RELEASE_CHANNEL \ + -e WSJT_RC_NUMBER \ + -e GITHUB_TOKEN \ + -e ARMHF_RUNTIME_PHASE \ + -e WSJTX_CI_IMAGE_ALLOW_RECIPE_MISMATCH \ + "$RUNTIME_IMAGE" \ + bash .github/scripts/validate-linux-armhf-runtime.sh + - name: Publish armhf test summary + if: always() + run: >- + python3 .github/scripts/publish-ctest-summary.py + "Linux armhf" wsjtx-build/ctest-results.xml + >> "$GITHUB_STEP_SUMMARY" + + - name: Upload armhf AppImage startup diagnostics + if: inputs.build_packages && failure() && steps.armhf-runtime.outcome == 'failure' + uses: actions/upload-artifact@v7 + with: + name: wsjtx-startup-smoke-linux-armhf + path: wsjtx-build/appimage-startup-smoke.log + if-no-files-found: ignore + retention-days: 7 + + # Artifacts produced inside the container land in $GITHUB_WORKSPACE + # via the bind-mount. Upload from the host where actions/upload- + # artifact runs natively. Same artifact names as the composite + # action's uploads so release.yml's all-platforms-ready gate + # pattern works unchanged. - name: Upload .deb + if: inputs.build_packages uses: actions/upload-artifact@v7 with: - name: wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }}-deb - path: wsjtx-build/wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }}.deb + name: wsjtx-${{ inputs.version }}-linux-armhf-deb + path: wsjtx-build/wsjtx-${{ inputs.version }}-linux-armhf.deb if-no-files-found: error - - # RPM builds via the same CPack scaffolding the .deb step above - # uses. CMakeLists.txt:2014-2026 already auto-detects rpmbuild and - # sets the Fedora-style dependency list (qt5-qtbase >= 5.9, fftw- - # libs-single, boost-log, etc.); only the workflow side was - # missing. `-G RPM` is explicit so this step doesn't accidentally - # rebuild the .deb already produced above. - - name: Package RPM - working-directory: wsjtx-build - run: | - cpack -G RPM - ls -lh *.rpm - - - name: Smoke-test RPM - working-directory: wsjtx-build - run: | - RPM=$(ls *.rpm | head -1) - echo "Querying $RPM" - rpm -qpi "$RPM" - rpm -qpR "$RPM" - rpm -qpl "$RPM" | head -40 - # Confirm the core binaries are in the package. - rpm -qpl "$RPM" | grep -qE '/bin/wsjtx$' - rpm -qpl "$RPM" | grep -qE '/bin/jt9$' - rpm -qpl "$RPM" | grep -qE '/bin/map65$' - rpm -qpR "$RPM" | grep -Eq 'libportaudio|portaudio' - + compression-level: 0 - name: Upload RPM + if: inputs.build_packages uses: actions/upload-artifact@v7 with: - name: wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }}-rpm + name: wsjtx-${{ inputs.version }}-linux-armhf-rpm path: wsjtx-build/*.rpm if-no-files-found: error - - - name: Install to AppDir - run: | - cmake --install wsjtx-build --prefix "${GITHUB_WORKSPACE}/AppDir/usr" - # linuxdeploy's desktop/icon integration needs these exact paths. - test -x AppDir/usr/bin/wsjtx - test -x AppDir/usr/bin/jt9 - test -x AppDir/usr/bin/map65 - test -x AppDir/usr/bin/ft8code - test -f AppDir/usr/share/applications/wsjtx.desktop - test -f AppDir/usr/share/pixmaps/wsjtx_icon.png - - - name: Package AppImage - env: - VERSION: ${{ inputs.version }} - ARCH: ${{ inputs.arch }} - # Core linuxdeploy is pinned to a dated release + SHA256 verify - # so an undetected upstream change fails the build instead of - # shipping. The Qt5 plugin stays on the rolling "continuous" - # channel because upstream has not cut a dated release since - # 1-alpha-20250213-1, which carries a filesystem_error bug on - # ubuntu-24.04 / Qt5.15 (missing qt5/plugins/mediaservice dir). - # When upstream publishes a newer dated plugin release, pin + - # verify it here too. - LINUXDEPLOY_TAG: "1-alpha-20251107-1" - run: | - case "$ARCH" in - x86_64) LINUXDEPLOY_SHA256="c20cd71e3a4e3b80c3483cef793cda3f4e990aca14014d23c544ca3ce1270b4d" ;; - aarch64) LINUXDEPLOY_SHA256="620095110d693282b8ebeb244a95b5e911cf8f65f76c88b4b47d16ae6346fcff" ;; - *) echo "::error::Unknown linuxdeploy arch: $ARCH"; exit 1 ;; - esac - curl -fsSL -o linuxdeploy.AppImage \ - "https://github.com/linuxdeploy/linuxdeploy/releases/download/${LINUXDEPLOY_TAG}/linuxdeploy-${ARCH}.AppImage" - curl -fsSL -o linuxdeploy-plugin-qt.AppImage \ - "https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-${ARCH}.AppImage" - echo "${LINUXDEPLOY_SHA256} linuxdeploy.AppImage" | sha256sum -c - - chmod +x linuxdeploy.AppImage linuxdeploy-plugin-qt.AppImage - - # --appimage-extract-and-run avoids FUSE on the hosted runner. - export OUTPUT="wsjtx-${VERSION}-linux-${ARCH}.AppImage" - ./linuxdeploy.AppImage --appimage-extract-and-run \ - --appdir AppDir \ - --plugin qt \ - --output appimage \ - --desktop-file AppDir/usr/share/applications/wsjtx.desktop \ - --icon-file AppDir/usr/share/pixmaps/wsjtx_icon.png - - ls -lh "$OUTPUT" - file "$OUTPUT" - - - name: Smoke-test AppImage payload - env: - VERSION: ${{ inputs.version }} - ARCH: ${{ inputs.arch }} - run: | - APPIMAGE="wsjtx-${VERSION}-linux-${ARCH}.AppImage" - ./"$APPIMAGE" --appimage-extract >/dev/null - test -x squashfs-root/usr/bin/wsjtx - test -x squashfs-root/usr/bin/jt9 - test -x squashfs-root/usr/bin/map65 - test -x squashfs-root/usr/bin/ft8code - test -x squashfs-root/usr/bin/wsprd - file squashfs-root/usr/bin/wsjtx | grep -q "ELF 64-bit" - # Qt5 libs should have been bundled by linuxdeploy-plugin-qt. - ls squashfs-root/usr/lib/ | grep -q "^libQt5Core\.so" - ls squashfs-root/usr/lib/ | grep -q "^libQt5Widgets\.so" - ls squashfs-root/usr/lib/ | grep -q "^libQt5Multimedia\.so" - # Verify Qt audio backend plugins were bundled. Without them, - # QAudioDeviceInfo::availableDevices() returns empty at runtime - # and the user sees "no audio devices" — observed in v3.0.1 on - # Linux Lite. linuxdeploy-plugin-qt only WARNS when these are - # absent on the build host, it doesn't fail. - # Linux shared objects are conventionally `lib*.so` so the - # bundled plugins are libqtaudio_alsa.so and libqtmedia_pulse.so. - audio_plugins=$(find squashfs-root -path '*/plugins/audio/*.so' 2>/dev/null) - if [ -z "$audio_plugins" ]; then - echo "::error::No Qt audio backend plugins (qtaudio_alsa/qtaudio_pulse) bundled in AppImage." - echo "::error::Install libqt5multimedia5-plugins on the build host so linuxdeploy-plugin-qt can find them." - echo "AppImage plugin tree:" - find squashfs-root -path '*/plugins/*' -name '*.so' 2>/dev/null | head -20 - exit 1 - fi - echo "Qt audio plugins bundled:" - echo "$audio_plugins" - rm -rf squashfs-root - + compression-level: 0 - name: Upload AppImage + if: inputs.build_packages uses: actions/upload-artifact@v7 with: - name: wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }}-AppImage - path: wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }}.AppImage + name: wsjtx-${{ inputs.version }}-linux-armhf-AppImage + path: wsjtx-${{ inputs.version }}-linux-armhf.AppImage if-no-files-found: error - + compression-level: 0 - name: Upload build artifacts + if: inputs.build_packages uses: actions/upload-artifact@v7 with: - name: wsjtx-${{ inputs.version }}-linux-${{ inputs.arch }} + name: wsjtx-${{ inputs.version }}-linux-armhf path: | wsjtx-build/jt9 wsjtx-build/wsprd wsjtx-build/wsjtx + - name: Upload test results + if: always() + uses: actions/upload-artifact@v7 + with: + name: ctest-results-linux-armhf + path: wsjtx-build/ctest-results.xml + if-no-files-found: ignore + + - name: Report suppressed armhf ccache save + if: inputs.save_ccache && steps.image.outputs.recipe_match != 'true' + run: echo "::notice::Not saving armhf ccache because this build used a stale Linux CI image recipe" + + - name: Save armhf ccache + if: inputs.save_ccache && steps.image.outputs.recipe_match == 'true' && steps.ccache.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: .ccache-armhf + key: ${{ steps.ccache.outputs.cache-primary-key }} diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 295ab743..274270d3 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -1,5 +1,8 @@ name: Build macOS +permissions: + contents: read + on: workflow_call: inputs: @@ -11,7 +14,7 @@ on: description: "Hamlib branch to build" required: false type: string - default: "4.7.1" + default: "4.7.2" arch: description: "Target architecture (arm64 or x86_64)" required: true @@ -24,6 +27,16 @@ on: description: "macOS deployment target version" required: true type: string + recache: + description: "Force ccache to recompile and refresh cached objects" + required: false + type: boolean + default: false + save_ccache: + description: "Persist compiler objects from a trusted develop build" + required: false + type: boolean + default: false release_channel: description: "Build release channel: DEVEL, RC, or GA" required: false @@ -34,74 +47,239 @@ on: required: false type: string default: "" + signing_mode: + description: "Package signing policy: validation or distribution" + required: false + type: string + default: "validation" + apple_team_id: + description: "Expected Apple Developer Team ID for distribution signing" + required: false + type: string + default: "" + application_certificate_sha1: + description: "Expected Developer ID Application certificate SHA-1" + required: false + type: string + default: "" + installer_certificate_sha1: + description: "Expected Developer ID Installer certificate SHA-1" + required: false + type: string + default: "" + secrets: + DEVELOPER_ID_CERTIFICATE_P12: + description: "Base64-encoded Developer ID Application PKCS#12" + required: false + DEVELOPER_ID_CERTIFICATE_PASSWORD: + description: "Password for the Application PKCS#12" + required: false + DEVELOPER_ID_INSTALLER_P12: + description: "Base64-encoded Developer ID Installer PKCS#12" + required: false + DEVELOPER_ID_INSTALLER_PASSWORD: + description: "Password for the Installer PKCS#12" + required: false + APP_STORE_CONNECT_KEY_ID: + description: "App Store Connect API key ID" + required: false + APP_STORE_CONNECT_ISSUER_ID: + description: "App Store Connect API issuer ID" + required: false + APP_STORE_CONNECT_PRIVATE_KEY_P8_BASE64: + description: "Base64-encoded App Store Connect API private key" + required: false + # Standalone dispatch builds one architecture. Derive its runner and deployment + # target from that architecture so unsupported tuples cannot be selected. + workflow_dispatch: + inputs: + version: + description: "WSJT-X version string (artifact + package names)" + required: false + type: string + default: "3.2.0-devel" + hamlib_branch: + description: "Hamlib branch to build" + required: false + type: string + default: "4.7.2" + arch: + description: "Target architecture" + required: false + type: choice + options: + - arm64 + - x86_64 + default: "arm64" + recache: + description: "Force ccache to recompile and refresh cached objects" + required: false + type: boolean + default: false + save_ccache: + description: "Persist compiler objects when dispatching on develop" + required: false + type: boolean + default: true + release_channel: + description: "Build release channel" + required: false + type: choice + options: + - DEVEL + - RC + - GA + default: "DEVEL" + rc_number: + description: "Release candidate number when release_channel is RC" + required: false + type: string + default: "" + signing_mode: + description: "Package signing policy" + required: false + type: choice + options: + - validation + - distribution + default: validation + apple_team_id: + description: "Expected Apple Developer Team ID (distribution only)" + required: false + type: string + default: "" + application_certificate_sha1: + description: "Expected Developer ID Application certificate SHA-1" + required: false + type: string + default: "" + installer_certificate_sha1: + description: "Expected Developer ID Installer certificate SHA-1" + required: false + type: string + default: "" jobs: build: - runs-on: ${{ inputs.runner }} + # runs-on cannot reference job-level env, so keep this expression and RUNNER + # aligned. RUNNER also keeps cache keys consistent across both triggers. + runs-on: ${{ inputs.runner || (inputs.arch == 'x86_64' && 'macos-15-intel' || 'macos-15') }} + timeout-minutes: 45 + env: + RUNNER: ${{ inputs.runner || (inputs.arch == 'x86_64' && 'macos-15-intel' || 'macos-15') }} + DEPLOYMENT_TARGET: ${{ inputs.deployment_target || (inputs.arch == 'x86_64' && '10.13' || '11.0') }} + VERSION: ${{ inputs.version }} + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + WSJT_RELEASE_CHANNEL: ${{ inputs.release_channel }} + WSJT_RC_NUMBER: ${{ inputs.rc_number }} + SIGNING_MODE: ${{ inputs.signing_mode }} + ARCH: ${{ inputs.arch }} + BOOST_VERSION: 1.85.0 + BOOST_SOURCE_SHA256: 7009fe1faa1697476bdc7027703a2badb84e849b7b0baad5086b087b971f8617 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 - - name: Resolve source revision - id: source_revision - run: | - source_revision="${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}" - if [ -z "$source_revision" ]; then - source_revision="$(git rev-parse HEAD)" - fi - echo "sha=${source_revision}" >> "$GITHUB_OUTPUT" + - name: Validate workflow inputs + env: + WSJTX_VERSION: ${{ inputs.version }} + run: .github/scripts/validate-ci-inputs.sh - name: Verify macOS build tuple run: | - case "${{ inputs.arch }}:${{ inputs.runner }}:${{ inputs.deployment_target }}" in + case "${ARCH}:${RUNNER}:${DEPLOYMENT_TARGET}" in arm64:macos-15:11.0|x86_64:macos-15-intel:10.13) - echo "Using supported macOS build tuple: ${{ inputs.arch }} on ${{ inputs.runner }} targeting ${{ inputs.deployment_target }}" + echo "Using supported macOS build tuple: ${ARCH} on ${RUNNER} targeting ${DEPLOYMENT_TARGET}" ;; *) - echo "::error::Unsupported macOS build tuple: arch=${{ inputs.arch }}, runner=${{ inputs.runner }}, deployment_target=${{ inputs.deployment_target }}" - echo "::error::Use arm64:macos-15:11.0 or x86_64:macos-15-intel:10.13. Do not use macos-latest for release artifacts." + echo "::error::Unsupported macOS build tuple: arch=${ARCH}, runner=${RUNNER}, deployment_target=${DEPLOYMENT_TARGET}" + echo "::error::Use arm64:macos-15:11.0 or x86_64:macos-15-intel:10.13 for deployable macOS artifacts." exit 1 ;; esac - - name: Check signing secrets - id: check_secrets - env: - APP_P12: ${{ secrets.DEVELOPER_ID_CERTIFICATE_P12 }} + - name: Validate signing policy run: | - if [ -n "$APP_P12" ]; then - echo "signing_enabled=true" >> "$GITHUB_OUTPUT" - else - echo "signing_enabled=false" >> "$GITHUB_OUTPUT" - echo "::notice::macOS signing skipped — secrets unavailable (Dependabot or fork PR context). Compile + tests + dylib bundling still validated." - fi + case "$SIGNING_MODE" in + validation) + echo "macOS signing mode: validation (ad-hoc app signature and explicitly unsigned package)" + ;; + distribution) + echo "macOS signing mode: distribution (build job remains secretless; a fresh job performs signing)" + ;; + *) + echo "::error::signing_mode must be validation or distribution, got: ${SIGNING_MODE}" + exit 1 + ;; + esac - name: Set Homebrew prefix run: echo "HOMEBREW_PREFIX=$(brew --prefix)" >> "$GITHUB_ENV" - name: Install dependencies - run: brew install cmake autoconf automake libtool asciidoctor + run: brew install cmake autoconf automake libtool asciidoctor ccache pkg-config + + - name: Select ccache key + id: ccache-key + env: + RECACHE: ${{ inputs.recache }} + run: .github/scripts/select-ccache-key-suffix.sh + + - name: Restore ccache + id: ccache + uses: actions/cache/restore@v6 + with: + path: .ccache + key: ccache-macos-${{ inputs.arch }}-appleclang-${{ github.sha }}${{ steps.ccache-key.outputs.suffix }} + restore-keys: | + ccache-macos-${{ inputs.arch }}-appleclang- + + - name: Configure ccache + run: | + echo "CCACHE_DIR=${GITHUB_WORKSPACE}/.ccache" >> "$GITHUB_ENV" + echo "ccache recache: ${{ inputs.recache }}" + if [ "${{ inputs.recache }}" = "true" ]; then + echo "CCACHE_RECACHE=1" >> "$GITHUB_ENV" + echo "Forcing ccache recache for this run" + fi + mkdir -p "${GITHUB_WORKSPACE}/.ccache" + ccache --version + ccache --zero-stats - name: Compute Qt cache key id: qt-key run: | .github/scripts/macos-qt-cache-key.sh \ --arch "${{ inputs.arch }}" \ - --runner "${{ inputs.runner }}" \ - --deployment-target "${{ inputs.deployment_target }}" \ + --runner "${{ env.RUNNER }}" \ + --deployment-target "${{ env.DEPLOYMENT_TARGET }}" \ --github-output - name: Restore Qt cache id: qt-cache - uses: actions/cache/restore@v5 + uses: actions/cache/restore@v6 with: path: qt-prefix key: ${{ steps.qt-key.outputs.key }} - fail-on-cache-miss: true - - name: Verify cached Qt deployment target + - name: Build Qt + if: steps.qt-cache.outputs.cache-hit != 'true' + run: | + .github/scripts/build-qt-macos.sh \ + --arch "${{ inputs.arch }}" \ + --deployment-target "${{ env.DEPLOYMENT_TARGET }}" \ + --prefix "${GITHUB_WORKSPACE}/qt-prefix" + + - name: Save Qt cache + if: steps.qt-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: qt-prefix + key: ${{ steps.qt-cache.outputs.cache-primary-key }} + + - name: Verify Qt prefix run: | .github/scripts/verify-macos-artifacts.sh \ - --target "${{ inputs.deployment_target }}" \ + --target "${{ env.DEPLOYMENT_TARGET }}" \ --arch "${{ inputs.arch }}" \ --allow-prefix "${GITHUB_WORKSPACE}/qt-prefix" \ "${GITHUB_WORKSPACE}/qt-prefix" @@ -111,7 +289,7 @@ jobs: if: inputs.arch == 'arm64' run: | .github/scripts/install-r-macos-gfortran.sh \ - --target "${{ inputs.deployment_target }}" \ + --target "${{ env.DEPLOYMENT_TARGET }}" \ --arch "${{ inputs.arch }}" \ --work-dir "${RUNNER_TEMP}/r-macos-gfortran" \ --prefix "${GITHUB_WORKSPACE}/gfortran-prefix" \ @@ -122,7 +300,7 @@ jobs: if: inputs.arch == 'x86_64' run: | .github/scripts/install-xpack-gfortran-macos.sh \ - --target "${{ inputs.deployment_target }}" \ + --target "${{ env.DEPLOYMENT_TARGET }}" \ --arch "${{ inputs.arch }}" \ --work-dir "${RUNNER_TEMP}/xpack-gfortran" \ --prefix "${GITHUB_WORKSPACE}/gfortran-prefix" \ @@ -162,206 +340,263 @@ jobs: echo "cache_key=${{ steps.controlled-arm-fc.outputs.cache_key }}" } >> "$GITHUB_OUTPUT" - - name: Verify static Fortran runtime deployment targets + - name: Verify static Fortran runtime run: | .github/scripts/verify-macos-static-archives.sh \ - --target "${{ inputs.deployment_target }}" \ + --target "${{ env.DEPLOYMENT_TARGET }}" \ --arch "${{ inputs.arch }}" \ --mode error \ ${{ steps.fc.outputs.runtime_archives }} - - name: Cache libusb + - name: Restore libusb cache id: libusb-cache - uses: actions/cache/restore@v5 + uses: actions/cache/restore@v6 with: path: libusb-prefix - key: libusb-macos-${{ inputs.arch }}-${{ inputs.runner }}-1.0.27-min${{ inputs.deployment_target }}-${{ hashFiles('.github/scripts/build-libusb-macos.sh') }} + key: libusb-macos-${{ inputs.arch }}-${{ env.RUNNER }}-1.0.27-min${{ env.DEPLOYMENT_TARGET }}-epoch1-${{ hashFiles('.github/scripts/build-libusb-macos.sh') }} - name: Build libusb if: steps.libusb-cache.outputs.cache-hit != 'true' run: | .github/scripts/build-libusb-macos.sh \ 1.0.27 \ - "${{ inputs.deployment_target }}" \ + "${{ env.DEPLOYMENT_TARGET }}" \ "${GITHUB_WORKSPACE}/libusb-prefix" - name: Save libusb cache if: steps.libusb-cache.outputs.cache-hit != 'true' - continue-on-error: true - uses: actions/cache/save@v5 + uses: actions/cache/save@v6 with: path: libusb-prefix - key: libusb-macos-${{ inputs.arch }}-${{ inputs.runner }}-1.0.27-min${{ inputs.deployment_target }}-${{ hashFiles('.github/scripts/build-libusb-macos.sh') }} - - - name: Cache Hamlib - id: hamlib-cache - uses: actions/cache/restore@v5 - with: - path: hamlib-prefix - key: hamlib-macos-${{ inputs.arch }}-${{ inputs.runner }}-${{ inputs.hamlib_branch }}-min${{ inputs.deployment_target }}-${{ hashFiles('.github/scripts/build-hamlib-macos.sh') }} + key: ${{ steps.libusb-cache.outputs.cache-primary-key }} - - name: Build Hamlib - if: steps.hamlib-cache.outputs.cache-hit != 'true' - env: - PKG_CONFIG_PATH: ${{ github.workspace }}/libusb-prefix/lib/pkgconfig - run: | - .github/scripts/build-hamlib-macos.sh \ - "${{ inputs.hamlib_branch }}" \ - "${{ inputs.deployment_target }}" \ - "${GITHUB_WORKSPACE}/hamlib-prefix" - - - name: Save Hamlib cache - if: steps.hamlib-cache.outputs.cache-hit != 'true' - continue-on-error: true - uses: actions/cache/save@v5 - with: - path: hamlib-prefix - key: hamlib-macos-${{ inputs.arch }}-${{ inputs.runner }}-${{ inputs.hamlib_branch }}-min${{ inputs.deployment_target }}-${{ hashFiles('.github/scripts/build-hamlib-macos.sh') }} - - - name: Cache PortAudio + - name: Restore PortAudio cache id: portaudio-cache - uses: actions/cache/restore@v5 + uses: actions/cache/restore@v6 with: path: portaudio-prefix - key: portaudio-macos-${{ inputs.arch }}-${{ inputs.runner }}-19.7.0-min${{ inputs.deployment_target }}-${{ hashFiles('.github/scripts/build-portaudio-macos.sh') }} + key: portaudio-macos-${{ inputs.arch }}-${{ env.RUNNER }}-19.7.0-min${{ env.DEPLOYMENT_TARGET }}-epoch1-${{ hashFiles('.github/scripts/build-portaudio-macos.sh') }} - name: Build PortAudio if: steps.portaudio-cache.outputs.cache-hit != 'true' run: | .github/scripts/build-portaudio-macos.sh \ 19.7.0 \ - "${{ inputs.deployment_target }}" \ + "${{ env.DEPLOYMENT_TARGET }}" \ "${GITHUB_WORKSPACE}/portaudio-prefix" - name: Save PortAudio cache if: steps.portaudio-cache.outputs.cache-hit != 'true' - continue-on-error: true - uses: actions/cache/save@v5 + uses: actions/cache/save@v6 with: path: portaudio-prefix - key: portaudio-macos-${{ inputs.arch }}-${{ inputs.runner }}-19.7.0-min${{ inputs.deployment_target }}-${{ hashFiles('.github/scripts/build-portaudio-macos.sh') }} + key: ${{ steps.portaudio-cache.outputs.cache-primary-key }} - - name: Cache FFTW + - name: Restore FFTW cache id: fftw-cache - uses: actions/cache/restore@v5 + uses: actions/cache/restore@v6 with: path: fftw-prefix - key: fftw-macos-${{ inputs.arch }}-${{ inputs.runner }}-3.3.10-min${{ inputs.deployment_target }}-${{ hashFiles('.github/scripts/build-fftw-macos.sh') }} + key: fftw-macos-${{ inputs.arch }}-${{ env.RUNNER }}-3.3.10-min${{ env.DEPLOYMENT_TARGET }}-epoch1-${{ hashFiles('.github/scripts/build-fftw-macos.sh') }} - name: Build FFTW if: steps.fftw-cache.outputs.cache-hit != 'true' run: | .github/scripts/build-fftw-macos.sh \ 3.3.10 \ - "${{ inputs.deployment_target }}" \ + "${{ env.DEPLOYMENT_TARGET }}" \ "${GITHUB_WORKSPACE}/fftw-prefix" - name: Save FFTW cache if: steps.fftw-cache.outputs.cache-hit != 'true' - continue-on-error: true - uses: actions/cache/save@v5 + uses: actions/cache/save@v6 with: path: fftw-prefix - key: fftw-macos-${{ inputs.arch }}-${{ inputs.runner }}-3.3.10-min${{ inputs.deployment_target }}-${{ hashFiles('.github/scripts/build-fftw-macos.sh') }} + key: ${{ steps.fftw-cache.outputs.cache-primary-key }} - - name: Cache Boost + - name: Restore Boost cache id: boost-cache - uses: actions/cache/restore@v5 + uses: actions/cache/restore@v6 with: path: boost-prefix - key: boost-macos-${{ inputs.arch }}-${{ inputs.runner }}-1.85.0-min${{ inputs.deployment_target }}-${{ hashFiles('.github/scripts/build-boost-macos.sh') }} + key: boost-macos-${{ inputs.arch }}-${{ env.RUNNER }}-${{ env.BOOST_VERSION }}-${{ env.BOOST_SOURCE_SHA256 }}-min${{ env.DEPLOYMENT_TARGET }}-epoch1-${{ hashFiles('.github/scripts/build-boost-macos.sh') }} - name: Build Boost if: steps.boost-cache.outputs.cache-hit != 'true' run: | .github/scripts/build-boost-macos.sh \ - 1.85.0 \ + "${BOOST_VERSION}" \ + "${BOOST_SOURCE_SHA256}" \ "${{ inputs.arch }}" \ - "${{ inputs.deployment_target }}" \ + "${{ env.DEPLOYMENT_TARGET }}" \ "${GITHUB_WORKSPACE}/boost-prefix" - name: Save Boost cache if: steps.boost-cache.outputs.cache-hit != 'true' - continue-on-error: true - uses: actions/cache/save@v5 + uses: actions/cache/save@v6 with: path: boost-prefix - key: boost-macos-${{ inputs.arch }}-${{ inputs.runner }}-1.85.0-min${{ inputs.deployment_target }}-${{ hashFiles('.github/scripts/build-boost-macos.sh') }} - - - name: Configure - env: - PKG_CONFIG_PATH: ${{ github.workspace }}/qt-prefix/lib/pkgconfig:${{ github.workspace }}/boost-prefix/lib/pkgconfig:${{ github.workspace }}/fftw-prefix/lib/pkgconfig:${{ github.workspace }}/libusb-prefix/lib/pkgconfig:${{ github.workspace }}/portaudio-prefix/lib/pkgconfig:${{ github.workspace }}/hamlib-prefix/lib/pkgconfig - run: | - cmake -S . -B wsjtx-build \ - -DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/qt-prefix;${GITHUB_WORKSPACE}/boost-prefix;${GITHUB_WORKSPACE}/fftw-prefix;${GITHUB_WORKSPACE}/libusb-prefix;${GITHUB_WORKSPACE}/portaudio-prefix;${GITHUB_WORKSPACE}/hamlib-prefix" \ - -DCMAKE_Fortran_COMPILER="${{ steps.fc.outputs.path }}" \ - -DCMAKE_Fortran_FLAGS="${{ steps.fc.outputs.fortran_runtime_flags }}" \ - -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ inputs.deployment_target }} \ - -DCMAKE_EXE_LINKER_FLAGS="-Wl,-headerpad_max_install_names ${{ steps.fc.outputs.runtime_link_flags }}" \ - -DWSJT_MACOS_LIBGOMP_LIBRARY="${{ steps.fc.outputs.libgomp }}" \ - -DWSJT_SOURCE_REVISION="${{ steps.source_revision.outputs.sha }}" \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ - -DWSJT_SKIP_MANPAGES=ON \ - -DWSJT_SKIP_BUNDLE_FIXUP=ON \ - -DWSJT_BUILD_TESTS=ON \ - -DWSJT_RELEASE_CHANNEL="${{ inputs.release_channel }}" \ - -DWSJT_RC_NUMBER="${{ inputs.rc_number }}" \ - -Wno-dev + key: ${{ steps.boost-cache.outputs.cache-primary-key }} - - name: Verify resolved dependency prefixes - run: | - CACHE=wsjtx-build/CMakeCache.txt - BAD=$(awk -F= ' - /^(Boost_DIR|Boost_INCLUDE_DIR|Boost_LOG_LIBRARY_RELEASE|Boost_LOG_SETUP_LIBRARY_RELEASE|FFTW3F_LIBRARY|FFTW3F_THREADS_LIBRARY|FFTW3_INCLUDE_DIR|Hamlib_INCLUDE_DIR|Hamlib_LIBRARY|Portaudio_INCLUDE_DIR|Portaudio_LIBRARY|Usb_INCLUDE_DIR|Usb_LIBRARY|Qt5[^:]*_DIR|Qt5[^:]*_EXECUTABLE):/ && $2 ~ /^(\/opt\/homebrew|\/usr\/local\/Cellar|\/usr\/local\/opt|\/opt\/local)/ { - print - } - ' "$CACHE") - if [ -n "$BAD" ]; then - echo "::error::Deployable macOS build resolved bundled dependencies from a package-manager prefix:" - echo "$BAD" - exit 1 - fi - - QT_BAD=$(awk -F= -v prefix="${GITHUB_WORKSPACE}/qt-prefix" ' - /^Qt5[^:]*_(DIR|EXECUTABLE):/ && index($2, prefix) != 1 { - print - } - ' "$CACHE") - if [ -n "$QT_BAD" ]; then - echo "::error::Deployable macOS build did not resolve Qt from the cached qt-prefix:" - echo "$QT_BAD" - exit 1 - fi - - - name: Verify built dependency deployment targets + - name: Verify pinned runtime prefixes run: | .github/scripts/verify-macos-artifacts.sh \ - --target "${{ inputs.deployment_target }}" \ + --target "${{ env.DEPLOYMENT_TARGET }}" \ --arch "${{ inputs.arch }}" \ - --allow-prefix "${GITHUB_WORKSPACE}/boost-prefix" \ - --allow-prefix "${GITHUB_WORKSPACE}/fftw-prefix" \ --allow-prefix "${GITHUB_WORKSPACE}/libusb-prefix" \ --allow-prefix "${GITHUB_WORKSPACE}/portaudio-prefix" \ - "${GITHUB_WORKSPACE}/boost-prefix" \ - "${GITHUB_WORKSPACE}/fftw-prefix" \ + --allow-prefix "${GITHUB_WORKSPACE}/fftw-prefix" \ + --allow-prefix "${GITHUB_WORKSPACE}/boost-prefix" \ "${GITHUB_WORKSPACE}/libusb-prefix" \ - "${GITHUB_WORKSPACE}/portaudio-prefix" + "${GITHUB_WORKSPACE}/portaudio-prefix" \ + "${GITHUB_WORKSPACE}/fftw-prefix" \ + "${GITHUB_WORKSPACE}/boost-prefix" - - name: Verify Hamlib static archive deployment targets + - name: Restore Hamlib cache + id: hamlib-cache + uses: actions/cache/restore@v6 + with: + path: hamlib-prefix + key: hamlib-macos-${{ inputs.arch }}-${{ env.RUNNER }}-${{ inputs.hamlib_branch }}-libusb1.0.27-min${{ env.DEPLOYMENT_TARGET }}-epoch1-${{ hashFiles('.github/scripts/build-hamlib-macos.sh', '.github/scripts/build-libusb-macos.sh') }} + + - name: Build Hamlib + if: steps.hamlib-cache.outputs.cache-hit != 'true' + run: | + .github/scripts/build-hamlib-macos.sh \ + "${HAMLIB_BRANCH}" \ + "${DEPLOYMENT_TARGET}" \ + "${GITHUB_WORKSPACE}/hamlib-prefix" \ + "${GITHUB_WORKSPACE}/libusb-prefix" + + - name: Verify Hamlib prefix run: | - hamlib_archives=( "${GITHUB_WORKSPACE}/hamlib-prefix/lib/"*.a ) + test -f "${GITHUB_WORKSPACE}/hamlib-prefix/lib/libhamlib.a" .github/scripts/verify-macos-static-archives.sh \ - --target "${{ inputs.deployment_target }}" \ + --target "${{ env.DEPLOYMENT_TARGET }}" \ --arch "${{ inputs.arch }}" \ --mode error \ - "${hamlib_archives[@]}" + "${GITHUB_WORKSPACE}/hamlib-prefix/lib/libhamlib.a" + + - name: Save Hamlib cache + if: steps.hamlib-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: hamlib-prefix + key: ${{ steps.hamlib-cache.outputs.cache-primary-key }} + + - name: Restore pFUnit cache + id: pfunit-cache + uses: actions/cache/restore@v6 + with: + path: pfunit-prefix + key: pfunit-macos-${{ inputs.arch }}-${{ env.RUNNER }}-v4.14.0-${{ steps.fc.outputs.cache_key }}-min${{ env.DEPLOYMENT_TARGET }}-epoch3-${{ hashFiles('.github/scripts/build-pfunit-macos.sh') }} + + - name: Build pFUnit + if: steps.pfunit-cache.outputs.cache-hit != 'true' + env: + # pFUnit configure uses try_run probes; expose only the controlled + # compiler runtime for those probes, not for the final test binaries. + DYLD_LIBRARY_PATH: ${{ steps.fc.outputs.runtime_lib_dir }} + run: | + .github/scripts/build-pfunit-macos.sh \ + v4.14.0 \ + "${{ steps.fc.outputs.path }}" \ + "${{ env.DEPLOYMENT_TARGET }}" \ + "${GITHUB_WORKSPACE}/pfunit-prefix" + + - name: Locate pFUnit config + id: pfunit + run: | + CONFIG=$(find "${GITHUB_WORKSPACE}/pfunit-prefix" -name PFUNITConfig.cmake -print -quit) + if [ -z "$CONFIG" ]; then + echo "ERROR: PFUNITConfig.cmake not found under pfunit-prefix" + find "${GITHUB_WORKSPACE}/pfunit-prefix" -maxdepth 3 -type d + exit 1 + fi + PFUNIT_DIR="$(dirname "$CONFIG")" + echo "Found PFUNITConfig.cmake at: $CONFIG" + echo "dir=${PFUNIT_DIR}" >> "$GITHUB_OUTPUT" + + - name: Save pFUnit cache + if: steps.pfunit-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: pfunit-prefix + key: ${{ steps.pfunit-cache.outputs.cache-primary-key }} - - name: Build + - name: Configure build and tests + env: + PKG_CONFIG_PATH: ${{ github.workspace }}/qt-prefix/lib/pkgconfig:${{ github.workspace }}/boost-prefix/lib/pkgconfig:${{ github.workspace }}/fftw-prefix/lib/pkgconfig:${{ github.workspace }}/libusb-prefix/lib/pkgconfig:${{ github.workspace }}/portaudio-prefix/lib/pkgconfig:${{ github.workspace }}/hamlib-prefix/lib/pkgconfig:${{ github.workspace }}/pfunit-prefix/lib/pkgconfig + run: | + cmake -S . -B wsjtx-build \ + -DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/qt-prefix;${GITHUB_WORKSPACE}/boost-prefix;${GITHUB_WORKSPACE}/fftw-prefix;${GITHUB_WORKSPACE}/libusb-prefix;${GITHUB_WORKSPACE}/portaudio-prefix;${GITHUB_WORKSPACE}/hamlib-prefix;${GITHUB_WORKSPACE}/pfunit-prefix" \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_Fortran_COMPILER="${{ steps.fc.outputs.path }}" \ + -DCMAKE_Fortran_FLAGS="${{ steps.fc.outputs.fortran_runtime_flags }}" \ + -DCMAKE_EXE_LINKER_FLAGS="${{ steps.fc.outputs.runtime_link_flags }}" \ + -DCMAKE_INSTALL_RPATH="${GITHUB_WORKSPACE}/qt-prefix/lib;${GITHUB_WORKSPACE}/boost-prefix/lib;${GITHUB_WORKSPACE}/fftw-prefix/lib;${GITHUB_WORKSPACE}/libusb-prefix/lib;${GITHUB_WORKSPACE}/portaudio-prefix/lib;${GITHUB_WORKSPACE}/hamlib-prefix/lib" \ + -DCMAKE_OSX_DEPLOYMENT_TARGET=${{ env.DEPLOYMENT_TARGET }} \ + -DWSJT_SKIP_MANPAGES=ON \ + -DWSJT_ENABLE_TESTS=ON \ + -DWSJT_ENABLE_GUI_SMOKE_TESTS=ON \ + -DWSJT_MACOS_LIBGOMP_LIBRARY="${{ steps.fc.outputs.libgomp }}" \ + -DPFUNIT_DIR="${{ steps.pfunit.outputs.dir }}" \ + -DWSJT_SOURCE_REVISION="${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || '' }}" \ + -DWSJT_RELEASE_CHANNEL="${WSJT_RELEASE_CHANNEL}" \ + -DWSJT_RC_NUMBER="${WSJT_RC_NUMBER}" \ + -Wno-dev + + - name: Build and test targets run: cmake --build wsjtx-build -j"$(sysctl -n hw.ncpu)" + - name: Report suppressed ccache save + if: ${{ (inputs.save_ccache || inputs.recache) && github.ref != 'refs/heads/develop' }} + run: echo "::notice::Not saving ccache because shared compiler caches are published only from develop" + + - name: Save ccache + if: ${{ success() && (inputs.save_ccache || inputs.recache) && github.ref == 'refs/heads/develop' && steps.ccache.outputs.cache-hit != 'true' }} + uses: actions/cache/save@v6 + with: + path: .ccache + key: ${{ steps.ccache.outputs.cache-primary-key }} + + - name: Apply WSJT-X shared memory limits + run: | + python3 - <<'PY' + import plistlib + import subprocess + + expected_arguments = [ + "/usr/sbin/sysctl", + "kern.sysv.shmmax=52428800", + "kern.sysv.shmall=25600", + ] + + with open("Darwin/com.wsjtx.sysctl.plist", "rb") as source: + configuration = plistlib.load(source) + + if ( + configuration.get("Program") != expected_arguments[0] + or configuration.get("ProgramArguments") != expected_arguments + ): + raise SystemExit("shared memory plist does not match CI expectations") + + subprocess.run(["/usr/bin/sudo", *expected_arguments], check=True) + subprocess.run( + [expected_arguments[0], "kern.sysv.shmmax", "kern.sysv.shmall"], check=True + ) + PY + + - name: Raise shared memory total for parallel GUI tests + run: | + # Three decoder segments require 35,359 pages; leave headroom for other IPC. + sudo /usr/sbin/sysctl kern.sysv.shmall=40960 + /usr/sbin/sysctl kern.sysv.shmmax kern.sysv.shmall + - name: Run tests id: ctest - run: ctest --output-on-failure --output-junit ctest-results.xml + run: ctest --parallel 3 --output-on-failure --output-junit ctest-results.xml working-directory: wsjtx-build - name: Publish test summary @@ -371,23 +606,42 @@ jobs: - name: Upload test results if: always() && steps.ctest.conclusion != 'skipped' - continue-on-error: true uses: actions/upload-artifact@v7 with: name: ctest-results-macos-${{ inputs.arch }} path: wsjtx-build/ctest-results.xml if-no-files-found: ignore + - name: Upload WSJT-X startup diagnostics + if: failure() && steps.ctest.outcome == 'failure' + uses: actions/upload-artifact@v7 + with: + name: wsjtx-startup-smoke-macos-${{ inputs.arch }} + path: wsjtx-build/startup-smoke-diagnostics + if-no-files-found: ignore + retention-days: 7 + + - name: Show ccache stats + if: always() + run: ccache --show-stats + - name: Verify architecture run: | file wsjtx-build/jt9 - lipo -archs wsjtx-build/jt9 | grep -q ${{ inputs.arch }} + ARCHS=$(lipo -archs wsjtx-build/jt9) + case " ${ARCHS} " in + *" ${{ inputs.arch }} "*) ;; + *) + echo "::error::Expected ${{ inputs.arch }} in jt9 architectures, found: ${ARCHS}" + exit 1 + ;; + esac - name: Install app bundle and collect CLI assets id: collect run: | BUILD=wsjtx-build - STAGE=stage/wsjtx-${{ inputs.version }}-${{ inputs.arch }} + STAGE="stage/wsjtx-${VERSION}-${ARCH}" ASSETS=assets mkdir -p "${ASSETS}" @@ -398,10 +652,13 @@ jobs: echo "::error::CMake install did not create ${APP}" exit 1 fi - if [ ! -x "${APP}/Contents/MacOS/map65" ]; then - echo "::error::CMake install did not create executable MAP65 companion app binary at ${APP}/Contents/MacOS/map65" - exit 1 - fi + + for bin in qmap map65; do + if [ ! -x "${APP}/Contents/MacOS/${bin}" ]; then + echo "::error::Expected app companion binary is missing after install: ${APP}/Contents/MacOS/${bin}" + exit 1 + fi + done for bin in jt9 wsprd wsprcode jt65code jt4code ft8code q65code encode77 fcal hash22calc; do [ -f "${BUILD}/${bin}" ] && cp "${BUILD}/${bin}" "${ASSETS}/" @@ -440,10 +697,6 @@ jobs: echo "::error::Expected CMake-installed alert sound is missing: ${SOUNDDIR}/Wanted.wav" exit 1 fi - if [ ! -x "${APP}/Contents/MacOS/map65" ]; then - echo "::error::Expected CMake-installed MAP65 binary is missing: ${APP}/Contents/MacOS/map65" - exit 1 - fi if [ -e "${APP}/Contents/MacOS/sounds" ]; then echo "::error::Alert sounds must not be installed under Contents/MacOS; codesign treats them as unsigned code." @@ -455,547 +708,114 @@ jobs: printf ' %s\n' "$@" echo "Verified CMake-installed alert sounds in ${SOUNDDIR}" - - name: Bundle dylibs into app - run: | - set -Eeuo pipefail - STAGE="${{ steps.collect.outputs.stage_dir }}" - APP="${STAGE}/wsjtx.app" - FRAMEWORKS="${APP}/Contents/Frameworks" - FORTRAN_PREFIX="${{ steps.fc.outputs.prefix }}" - FORTRAN_ORIGINAL_PREFIX="${{ steps.fc.outputs.original_prefix }}" - GCC_LIB="${{ steps.fc.outputs.runtime_lib_dir }}" - mkdir -p "${FRAMEWORKS}" - - dump_bundle_context() { - local status="$1" - local line="$2" - local command="$3" - echo "::error::Bundle dylibs into app failed at line ${line} with status ${status}: ${command}" - echo "APP=${APP}" - echo "FRAMEWORKS=${FRAMEWORKS}" - echo "FORTRAN_PREFIX=${FORTRAN_PREFIX}" - echo "FORTRAN_ORIGINAL_PREFIX=${FORTRAN_ORIGINAL_PREFIX}" - echo "GCC_LIB=${GCC_LIB}" - echo "HOMEBREW_PREFIX=${HOMEBREW_PREFIX}" - echo "App executable contents:" - ls -la "${APP}/Contents/MacOS" || true - echo "Framework contents:" - ls -la "${FRAMEWORKS}" || true - echo "External references in app executables:" - find "${APP}/Contents/MacOS" -type f -perm +111 -print -exec otool -L {} \; 2>/dev/null || true - if [ -f macdeployqt.log ]; then - echo "macdeployqt.log:" - cat macdeployqt.log - fi - } - trap 'status=$?; dump_bundle_context "$status" "$LINENO" "$BASH_COMMAND"; exit "$status"' ERR - - run_logged() { - echo "+ $*" - "$@" - } - - echo "Running macdeployqt..." - set +e - "${GITHUB_WORKSPACE}/qt-prefix/bin/macdeployqt" "${APP}" -verbose=2 > macdeployqt.log 2>&1 - status=$? - set -e - if [ "$status" -ne 0 ]; then - echo "::error::macdeployqt failed with status ${status}" - dump_bundle_context "$status" "$LINENO" "macdeployqt" - exit "$status" - fi - cat macdeployqt.log - - resolve_lib() { - local lib="$1" - if [ -n "$FORTRAN_ORIGINAL_PREFIX" ] && [[ "$lib" == "$FORTRAN_ORIGINAL_PREFIX"/* ]]; then - local original_prefix="${FORTRAN_ORIGINAL_PREFIX}/" - local relocated="${FORTRAN_PREFIX}/${lib:${#original_prefix}}" - [ -f "$relocated" ] && echo "$relocated" && return 0 - fi - if [[ "$lib" == $HOMEBREW_PREFIX/* ]]; then - echo "$lib" - return 0 - elif [[ "$lib" == $GITHUB_WORKSPACE/* ]]; then - echo "$lib" - return 0 - elif [[ "$lib" == @rpath/* ]]; then - local name="${lib#@rpath/}" - for dir in \ - "$FRAMEWORKS" \ - "$GITHUB_WORKSPACE/boost-prefix/lib" \ - "$GITHUB_WORKSPACE/fftw-prefix/lib" \ - "$GITHUB_WORKSPACE/libusb-prefix/lib" \ - "$GITHUB_WORKSPACE/portaudio-prefix/lib" \ - "$FORTRAN_PREFIX/lib" \ - "$GCC_LIB" \ - "$HOMEBREW_PREFIX/lib" - do - [ -f "$dir/$name" ] && echo "$dir/$name" && return - done - fi - return 0 - } - - should_bundle_ref() { - local ref="$1" - case "$ref" in - *Qt*.framework/*) - return 1 - ;; - "$FORTRAN_ORIGINAL_PREFIX"/*|"$HOMEBREW_PREFIX"/*|"$GITHUB_WORKSPACE"/*|@rpath/*) - return 0 - ;; - *) - return 1 - ;; - esac - } - - bundle_dylib() { - local binary="$1" - local lib - while IFS= read -r lib; do - should_bundle_ref "$lib" || continue - local resolved - resolved=$(resolve_lib "$lib") - if [ -z "$resolved" ]; then - echo "::error::Could not resolve ${lib} required by ${binary}" - exit 1 - fi - local libname - libname=$(basename "$resolved") - case "$libname" in - libgomp*.dylib) - echo "::error::Refusing to bundle ${resolved}; libgomp must be linked statically for deployable macOS artifacts." - exit 1 - ;; - esac - if [ ! -f "${FRAMEWORKS}/${libname}" ]; then - echo " Bundling: $resolved -> ${FRAMEWORKS}/${libname}" - run_logged cp "$resolved" "${FRAMEWORKS}/${libname}" - run_logged chmod 644 "${FRAMEWORKS}/${libname}" - run_logged install_name_tool -id "@rpath/${libname}" "${FRAMEWORKS}/${libname}" - bundle_dylib "${FRAMEWORKS}/${libname}" - fi - if [ "$lib" != "@rpath/${libname}" ]; then - run_logged install_name_tool -change "$lib" "@rpath/${libname}" "$binary" - fi - done < <(otool -L "$binary" | awk 'NR > 1 {print $1}' || true) - } - - ensure_app_rpath() { - local binary="$1" - local rpath - - while IFS= read -r rpath; do - [ -n "$rpath" ] || continue - case "$rpath" in - "$GITHUB_WORKSPACE"/*|"$HOMEBREW_PREFIX"/*) - run_logged install_name_tool -delete_rpath "$rpath" "$binary" - ;; - esac - done < <(otool -l "$binary" | awk '/LC_RPATH/{getline; getline; print $2}' || true) - - if ! otool -l "$binary" | awk '/LC_RPATH/{getline; getline; print $2}' | grep -Fxq "@executable_path/../Frameworks"; then - run_logged install_name_tool -add_rpath "@executable_path/../Frameworks" "$binary" - fi - } - - for exe in "${APP}/Contents/MacOS/"*; do - [ -f "$exe" ] && [ -x "$exe" ] && { - ensure_app_rpath "$exe" - bundle_dylib "$exe" - for fw in $(otool -L "$exe" | awk '{print $1}' | grep '\.framework/' || true); do - fwname=$(basename "$fw") - bundled=$(find "${FRAMEWORKS}" -name "${fwname}" -path "*.framework/*" 2>/dev/null | head -1) - if [ -n "$bundled" ]; then - app_contents="${APP}/Contents/" - fwrel="${bundled:${#app_contents}}" - if [ "$fw" != "@executable_path/../${fwrel}" ]; then - run_logged install_name_tool -change "$fw" "@executable_path/../${fwrel}" "$exe" - fi - fi - done - } - done - - for fw in "${FRAMEWORKS}"/*.dylib; do - [ -f "$fw" ] && bundle_dylib "$fw" - done - - for exe in "${APP}/Contents/MacOS/"*; do - [ -f "$exe" ] && [ -x "$exe" ] && bundle_dylib "$exe" - done - - echo "Checking for remaining external references..." - remaining_refs="${RUNNER_TEMP:-/tmp}/wsjtx-app-remaining-refs.txt" - : > "$remaining_refs" - while IFS= read -r binary; do - while IFS= read -r ref; do - case "$ref" in - "$FORTRAN_ORIGINAL_PREFIX"/*|"$HOMEBREW_PREFIX"/*|"$GITHUB_WORKSPACE"/*) - echo "${binary}: ${ref}" >> "$remaining_refs" - ;; - esac - done < <(otool -L "$binary" | awk 'NR > 1 {print $1}' || true) - done < <(find "${APP}/Contents/MacOS" -type f -perm +111 -print 2>/dev/null) - if [ -s "$remaining_refs" ]; then - echo "::error::External build-time paths still present:" - cat "$remaining_refs" - exit 1 - else - echo "All dylibs bundled successfully" - fi - - - name: Bundle dylibs into CLI tools + - name: Deploy macOS app dependencies run: | - set -Eeuo pipefail - ASSETS="${{ steps.collect.outputs.assets_dir }}" - STAGE="${{ steps.collect.outputs.stage_dir }}" - LIBDIR="${ASSETS}/lib" - FORTRAN_PREFIX="${{ steps.fc.outputs.prefix }}" - FORTRAN_ORIGINAL_PREFIX="${{ steps.fc.outputs.original_prefix }}" - GCC_LIB="${{ steps.fc.outputs.runtime_lib_dir }}" - mkdir -p "${LIBDIR}" - - dump_cli_context() { - local status="$1" - local line="$2" - local command="$3" - echo "::error::Bundle dylibs into CLI tools failed at line ${line} with status ${status}: ${command}" - echo "ASSETS=${ASSETS}" - echo "LIBDIR=${LIBDIR}" - echo "FORTRAN_PREFIX=${FORTRAN_PREFIX}" - echo "FORTRAN_ORIGINAL_PREFIX=${FORTRAN_ORIGINAL_PREFIX}" - echo "GCC_LIB=${GCC_LIB}" - echo "HOMEBREW_PREFIX=${HOMEBREW_PREFIX}" - echo "Asset contents:" - ls -la "${ASSETS}" || true - echo "Library contents:" - ls -la "${LIBDIR}" || true - echo "External references in CLI assets:" - for bin in "${ASSETS}"/*; do - [ -f "$bin" ] && [ -x "$bin" ] && [ "$(basename "$bin")" != "lib" ] || continue - echo "== $bin ==" - otool -L "$bin" || true - done - } - trap 'status=$?; dump_cli_context "$status" "$LINENO" "$BASH_COMMAND"; exit "$status"' ERR - - run_logged() { - echo "+ $*" - "$@" - } - - resolve_cli_ref() { - local ref="$1" - local name="" suffix="" - - if [ -n "$FORTRAN_ORIGINAL_PREFIX" ] && [[ "$ref" == "$FORTRAN_ORIGINAL_PREFIX"/* ]]; then - local original_prefix="${FORTRAN_ORIGINAL_PREFIX}/" - local relocated="${FORTRAN_PREFIX}/${ref:${#original_prefix}}" - [ -f "$relocated" ] && echo "$relocated" - return 0 - fi - - case "$ref" in - /usr/lib/*|/System/Library/*) - return 0 - ;; - @loader_path/lib/*) - name="${ref#@loader_path/lib/}" - [ -f "${LIBDIR}/${name}" ] && echo "${LIBDIR}/${name}" - return 0 - ;; - @loader_path/*) - name="${ref#@loader_path/}" - [ -f "${LIBDIR}/${name}" ] && echo "${LIBDIR}/${name}" - return 0 - ;; - "$GITHUB_WORKSPACE"/*|"$HOMEBREW_PREFIX"/*) - echo "$ref" - return 0 - ;; - esac - - if [[ "$ref" == @rpath/* ]]; then - suffix="${ref#@rpath/}" - if [[ "$suffix" == *.framework/* ]]; then - for dir in \ - "${STAGE}/wsjtx.app/Contents/Frameworks" \ - "${GITHUB_WORKSPACE}/qt-prefix/lib" - do - [ -f "${dir}/${suffix}" ] && echo "${dir}/${suffix}" && return 0 - done - else - name="${suffix}" - for dir in \ - "${LIBDIR}" \ - "${STAGE}/wsjtx.app/Contents/Frameworks" \ - "${GITHUB_WORKSPACE}/boost-prefix/lib" \ - "${GITHUB_WORKSPACE}/fftw-prefix/lib" \ - "${GITHUB_WORKSPACE}/libusb-prefix/lib" \ - "${GITHUB_WORKSPACE}/portaudio-prefix/lib" \ - "${FORTRAN_PREFIX}/lib" \ - "${GCC_LIB}" \ - "${HOMEBREW_PREFIX}/lib" - do - [ -f "${dir}/${name}" ] && echo "${dir}/${name}" && return 0 - done - fi - fi + .github/scripts/deploy-macos-app.sh \ + --app "${{ steps.collect.outputs.stage_dir }}/wsjtx.app" \ + --workspace-prefix "${GITHUB_WORKSPACE}" \ + --qt-prefix "${GITHUB_WORKSPACE}/qt-prefix" \ + --boost-prefix "${GITHUB_WORKSPACE}/boost-prefix" \ + --fftw-prefix "${GITHUB_WORKSPACE}/fftw-prefix" \ + --libusb-prefix "${GITHUB_WORKSPACE}/libusb-prefix" \ + --portaudio-prefix "${GITHUB_WORKSPACE}/portaudio-prefix" \ + --fortran-prefix "${{ steps.fc.outputs.prefix }}" \ + --fortran-original-prefix "${{ steps.fc.outputs.original_prefix }}" \ + --gcc-lib "${{ steps.fc.outputs.runtime_lib_dir }}" \ + --homebrew-prefix "${HOMEBREW_PREFIX}" - return 0 - } - - bundle_cli_deps() { - local binary="$1" - local change_prefix="$2" - local ref resolved out name target - - while IFS= read -r ref; do - resolved=$(resolve_cli_ref "$ref") - if [ -z "$resolved" ]; then - case "$ref" in - @rpath/*|@loader_path/*|"$GITHUB_WORKSPACE"/*|"$HOMEBREW_PREFIX"/*) - echo "::error::Could not resolve ${ref} required by ${binary}" - exit 1 - ;; - *) - continue - ;; - esac - fi - - name="$(basename "$resolved")" - case "$name" in - libgomp*.dylib) - echo "::error::Refusing to bundle ${resolved}; libgomp must be linked statically for deployable macOS artifacts." - exit 1 - ;; - esac - - out="${LIBDIR}/${name}" - if [ ! -f "$out" ]; then - echo " Bundling: ${resolved} -> ${out}" - run_logged cp "$resolved" "$out" - run_logged chmod 644 "$out" - run_logged install_name_tool -id "@rpath/${name}" "$out" - bundle_cli_deps "$out" "@rpath" - fi - - target="${change_prefix}/${name}" - if [ "$ref" != "$target" ]; then - run_logged install_name_tool -change "$ref" "$target" "$binary" - fi - done < <(otool -L "$binary" | awk 'NR > 1 {print $1}' | grep -E "($HOMEBREW_PREFIX|$GITHUB_WORKSPACE|@rpath|@loader_path)" || true) - } - - ensure_cli_rpath() { - local binary="$1" - local rpath - local bad_rpaths=() - local unique_bad_rpaths=() - - while IFS= read -r rpath; do - [ -n "$rpath" ] || continue - case "$rpath" in - "$GITHUB_WORKSPACE"/*|"$HOMEBREW_PREFIX"/*) - bad_rpaths+=("$rpath") - ;; - esac - done < <(otool -l "$binary" | awk '/LC_RPATH/{getline; getline; print $2}' || true) - - # Deduplicate bad rpaths (compatible with macOS Bash 3.2) - if [ "${#bad_rpaths[@]}" -gt 0 ]; then - for rpath in "${bad_rpaths[@]}"; do - local found=0 - local u - if [ "${#unique_bad_rpaths[@]}" -gt 0 ]; then - for u in "${unique_bad_rpaths[@]}"; do - [ "$u" = "$rpath" ] && found=1 && break - done - fi - [ "$found" -eq 0 ] && unique_bad_rpaths+=("$rpath") - done - fi - - if [ "${#unique_bad_rpaths[@]}" -gt 0 ]; then - for rpath in "${unique_bad_rpaths[@]}"; do - run_logged install_name_tool -delete_rpath "$rpath" "$binary" - done - fi - - if ! otool -l "$binary" | awk '/LC_RPATH/{getline; getline; print $2}' | grep -Fxq "@loader_path/lib"; then - run_logged install_name_tool -add_rpath "@loader_path/lib" "$binary" + APP="${{ steps.collect.outputs.stage_dir }}/wsjtx.app" + for file in \ + "${APP}/Contents/PlugIns/platforms/libqcocoa.dylib" \ + "${APP}/Contents/Resources/qt.conf" + do + if [ ! -f "$file" ]; then + echo "::error::Expected macOS app deployment file is missing: ${file}" + exit 1 fi - } - - for bin in "${ASSETS}"/*; do - [ -f "$bin" ] && [ -x "$bin" ] && [ "$(basename "$bin")" != "lib" ] || continue - ensure_cli_rpath "$bin" - bundle_cli_deps "$bin" "@rpath" - run_logged codesign --force --sign - "$bin" - done - - for lib in "${LIBDIR}"/*; do - [ -f "$lib" ] || continue - bundle_cli_deps "$lib" "@rpath" - run_logged codesign --force --sign - "$lib" done - echo "Verifying CLI tools..." - for bin in "${ASSETS}"/*; do - [ -f "$bin" ] && [ -x "$bin" ] && [ "$(basename "$bin")" != "lib" ] && { - BAD=$(otool -L "$bin" | grep "$HOMEBREW_PREFIX" || true) - if [ -n "$BAD" ]; then - echo "ERROR: $(basename "$bin") still has Homebrew refs:" - echo "$BAD" - exit 1 - fi - } - done - echo "All CLI tools are self-contained" - - cp -R "${LIBDIR}" "${STAGE}/lib" - for bin in "${ASSETS}"/*; do - [ -f "$bin" ] && [ -x "$bin" ] && [ "$(basename "$bin")" != "lib" ] && { - cp "$bin" "${STAGE}/$(basename "$bin")" - } - done + - name: Deploy macOS CLI tool dependencies + run: | + .github/scripts/deploy-macos-cli-tools.sh \ + --assets "${{ steps.collect.outputs.assets_dir }}" \ + --stage "${{ steps.collect.outputs.stage_dir }}" \ + --workspace-prefix "${GITHUB_WORKSPACE}" \ + --boost-prefix "${GITHUB_WORKSPACE}/boost-prefix" \ + --fftw-prefix "${GITHUB_WORKSPACE}/fftw-prefix" \ + --libusb-prefix "${GITHUB_WORKSPACE}/libusb-prefix" \ + --portaudio-prefix "${GITHUB_WORKSPACE}/portaudio-prefix" \ + --fortran-prefix "${{ steps.fc.outputs.prefix }}" \ + --fortran-original-prefix "${{ steps.fc.outputs.original_prefix }}" \ + --gcc-lib "${{ steps.fc.outputs.runtime_lib_dir }}" \ + --homebrew-prefix "${HOMEBREW_PREFIX}" - name: Verify bundled macOS deployment targets run: | STAGE="${{ steps.collect.outputs.stage_dir }}" .github/scripts/verify-macos-artifacts.sh \ - --target "${{ inputs.deployment_target }}" \ + --target "${{ env.DEPLOYMENT_TARGET }}" \ --arch "${{ inputs.arch }}" \ "$STAGE" - - name: Import signing certificates - if: steps.check_secrets.outputs.signing_enabled == 'true' - env: - APP_P12: ${{ secrets.DEVELOPER_ID_CERTIFICATE_P12 }} - APP_P12_PW: ${{ secrets.DEVELOPER_ID_CERTIFICATE_PASSWORD }} - INST_P12: ${{ secrets.DEVELOPER_ID_INSTALLER_P12 }} - INST_P12_PW: ${{ secrets.DEVELOPER_ID_INSTALLER_PASSWORD }} - run: | - KEYCHAIN_PATH="$RUNNER_TEMP/signing.keychain-db" - KEYCHAIN_PASSWORD="$(openssl rand -hex 16)" - - security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" - security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH" - security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" - - echo "$APP_P12" | base64 --decode > "$RUNNER_TEMP/app.p12" - security import "$RUNNER_TEMP/app.p12" -P "$APP_P12_PW" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH" - - echo "$INST_P12" | base64 --decode > "$RUNNER_TEMP/installer.p12" - security import "$RUNNER_TEMP/installer.p12" -P "$INST_P12_PW" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH" - - security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" - security list-keychains -d user -s "$KEYCHAIN_PATH" login.keychain-db - - APP_IDENTITY=$(security find-identity -v -p codesigning "$KEYCHAIN_PATH" | grep "Developer ID Application" | head -1 | awk -F'"' '{print $2}') - INST_IDENTITY=$(security find-identity -v "$KEYCHAIN_PATH" | grep "Developer ID Installer" | head -1 | awk -F'"' '{print $2}') - echo "App identity: $APP_IDENTITY" - echo "Installer identity: $INST_IDENTITY" - echo "identity=$APP_IDENTITY" >> "$GITHUB_OUTPUT" - echo "installer_identity=$INST_IDENTITY" >> "$GITHUB_OUTPUT" - id: keychain - - # ALWAYS runs. Real Developer ID when secrets are present, ad-hoc - # signing (-) otherwise. Mirrors the Windows self-signed-sandbox - # pattern in build-windows.yml: prove the signing step is wired, - # rely on a real cert in production. Ad-hoc signing produces a - # structurally-valid signature with no Apple trust chain — pkg - # will not pass Gatekeeper without right-click→Open, but is - # well-formed and the all-platforms-ready gate in release.yml - # finds the artifact at the expected path. - - name: Code sign binaries + - name: Ad-hoc sign binaries for build validation run: | STAGE="${{ steps.collect.outputs.stage_dir }}" ASSETS="${{ steps.collect.outputs.assets_dir }}" APP="${STAGE}/wsjtx.app" ENTITLEMENTS="${GITHUB_WORKSPACE}/entitlements.plist" - if [ "${{ steps.check_secrets.outputs.signing_enabled }}" = "true" ]; then - IDENTITY="${{ steps.keychain.outputs.identity }}" - TS="--timestamp" - echo "Code signing mode: Developer ID (real)" - else - IDENTITY="-" - TS="" - echo "Code signing mode: ad-hoc (no Apple trust chain; pkg will be unsigned)" - fi + IDENTITY="-" + echo "Code signing mode: ad-hoc (no Apple trust chain; pkg will be unsigned)" - # entitlements.plist declares com.apple.security.cs.disable- - # library-validation, which is required for any app bundling - # its own non-system frameworks (Qt, etc.) under hardened - # runtime — otherwise dyld refuses to load them. Applied on - # both signing paths: the real-cert path needs it for - # notarization-friendly distribution; the ad-hoc path needs - # it because each ad-hoc signature has its own pseudo-Team-ID - # so the main binary and bundled frameworks never match. - # (The plist is non-empty, so macos-15-intel's codesign now - # parses it cleanly — no need for the conditional that PR #23 - # introduced as a workaround for the empty-plist parser bug.) + # Sign nested code before the containing bundle. Executable + # entitlements are defined in the repository-root plist. find "${APP}/Contents/Frameworks" -type f \( -name "*.dylib" -o -perm +111 \) \ - -exec codesign --force --options runtime $TS --sign "$IDENTITY" {} \; + -exec codesign --force --options runtime --sign "$IDENTITY" {} \; find "${APP}/Contents/Frameworks" -name "*.framework" -type d | while read -r fw; do - codesign --force --options runtime $TS --sign "$IDENTITY" "$fw" + codesign --force --options runtime --sign "$IDENTITY" "$fw" done - if [ -d "${APP}/Contents/PlugIns" ]; then - find "${APP}/Contents/PlugIns" -type f -name "*.dylib" \ - -exec codesign --force --options runtime $TS --sign "$IDENTITY" {} \; - fi + find "${APP}/Contents/PlugIns" -type f -name "*.dylib" \ + -exec codesign --force --options runtime --sign "$IDENTITY" {} \; 2>/dev/null || true find "${APP}/Contents/MacOS" -type f -perm +111 \ - -exec codesign --force --options runtime --entitlements "$ENTITLEMENTS" $TS --sign "$IDENTITY" {} \; - # Bundle-level codesign re-signs the main executable. --force - # without --entitlements would WIPE the entitlements applied - # in the previous step (PR #27 missed this — rc1 shipped with - # an unentitled wsjtx binary, so disable-library-validation - # never took effect and the dyld load of QtSerialPort still - # failed with mismatched Team IDs). - codesign --force --options runtime --entitlements "$ENTITLEMENTS" $TS --sign "$IDENTITY" "${APP}" + -exec codesign --force --options runtime --entitlements "$ENTITLEMENTS" --sign "$IDENTITY" {} \; + # Bundle signing re-signs the main executable, so it must receive the + # entitlement file again. + codesign --force --options runtime --entitlements "$ENTITLEMENTS" --sign "$IDENTITY" "${APP}" codesign --verify --deep --strict --verbose=2 "${APP}" - # Defensive: confirm the entitlement actually made it onto - # the main binary. `codesign --verify` doesn't check - # entitlement presence — it only validates the signature - # itself — so a re-sign that wipes entitlements would still - # pass verify (that's how rc1 shipped broken). + # codesign --verify validates the signature, not required entitlement + # presence. MAIN_BIN="${APP}/Contents/MacOS/wsjtx" - if ! codesign -d --entitlements - "$MAIN_BIN" 2>/dev/null | grep -q "disable-library-validation"; then + ENTITLEMENTS_OUT=$(codesign -d --entitlements - "$MAIN_BIN" 2>/dev/null) + if [[ "$ENTITLEMENTS_OUT" != *"disable-library-validation"* ]]; then echo "::error::wsjtx binary is missing com.apple.security.cs.disable-library-validation entitlement." echo "::error::Bundled Qt frameworks will fail to load under hardened runtime." codesign -d --entitlements - "$MAIN_BIN" || true exit 1 fi echo "Confirmed disable-library-validation entitlement on $MAIN_BIN" + if [[ "$ENTITLEMENTS_OUT" == *"allow-unsigned-executable-memory"* ]]; then + echo "::error::${MAIN_BIN} must not grant unsigned executable memory." + exit 1 + fi + echo "Confirmed no unsigned executable memory entitlement on $MAIN_BIN" for dir in "${STAGE}" "${ASSETS}"; do find "${dir}" -maxdepth 1 -type f -perm +111 \ - -exec codesign --force --options runtime --entitlements "$ENTITLEMENTS" $TS --sign "$IDENTITY" {} \; + -exec codesign --force --options runtime --entitlements "$ENTITLEMENTS" --sign "$IDENTITY" {} \; done for dir in "${STAGE}/lib" "${ASSETS}/lib"; do [ -d "$dir" ] && find "$dir" -type f \ - -exec codesign --force --options runtime $TS --sign "$IDENTITY" {} \; + -exec codesign --force --options runtime --sign "$IDENTITY" {} \; done - # ALWAYS runs. productbuild signs with the Developer ID Installer - # cert when secrets are present; produces an unsigned .pkg - # otherwise. Either way the artifact is named identically and - # satisfies the all-platforms-ready gate in release.yml. - - name: Build and verify installer pkg + - name: Prepare installer package run: | STAGE="${{ steps.collect.outputs.stage_dir }}" - PKG_ID="org.k1jt.wsjtx.${{ inputs.arch }}" - PKG_VERSION="${{ inputs.version }}" + PKG_ID="org.k1jt.wsjtx.${ARCH}" + PKG_VERSION="${VERSION}" PAYLOAD="$RUNNER_TEMP/pkg-payload" SCRIPTS="$RUNNER_TEMP/pkg-scripts" @@ -1036,134 +856,103 @@ jobs: --install-location / \ "$RUNNER_TEMP/wsjtx-component.pkg" - PKG_OUT="wsjtx-${{ inputs.version }}-${{ inputs.arch }}-macOS.pkg" - if [ "${{ steps.check_secrets.outputs.signing_enabled }}" = "true" ]; then - INST_IDENTITY="${{ steps.keychain.outputs.installer_identity }}" - productbuild \ - --package "$RUNNER_TEMP/wsjtx-component.pkg" \ - --sign "$INST_IDENTITY" \ - "$PKG_OUT" - else - productbuild \ - --package "$RUNNER_TEMP/wsjtx-component.pkg" \ - "$PKG_OUT" - fi - + - name: Build unsigned validation package + if: inputs.signing_mode == 'validation' + id: package + run: | + PKG_OUT="wsjtx-${VERSION}-${ARCH}-macOS.pkg" + productbuild \ + --package "$RUNNER_TEMP/wsjtx-component.pkg" \ + "$PKG_OUT" + echo "path=$PKG_OUT" >> "$GITHUB_OUTPUT" + echo "artifact_name=wsjtx-${VERSION}-${ARCH}-macOS-unsigned.pkg" >> "$GITHUB_OUTPUT" + + - name: Verify unsigned validation package + if: inputs.signing_mode == 'validation' + run: | + PKG_OUT="${{ steps.package.outputs.path }}" CHECK_PAYLOAD="$RUNNER_TEMP/pkg-check" - rm -rf "$CHECK_PAYLOAD" pkgutil --expand-full "$PKG_OUT" "$CHECK_PAYLOAD" [ "$(/usr/libexec/PlistBuddy -c "Print :0:BundleIsRelocatable" "$RUNNER_TEMP/components.plist")" = "false" ] [ "$(/usr/libexec/PlistBuddy -c "Print :0:BundleIsVersionChecked" "$RUNNER_TEMP/components.plist")" = "false" ] [ "$(/usr/libexec/PlistBuddy -c "Print :0:BundleOverwriteAction" "$RUNNER_TEMP/components.plist")" = "upgrade" ] - + test -x "$CHECK_PAYLOAD/wsjtx-component.pkg/Payload/Applications/wsjtx.app/Contents/MacOS/qmap" + test -x "$CHECK_PAYLOAD/wsjtx-component.pkg/Payload/Applications/wsjtx.app/Contents/MacOS/map65" APP_PAYLOAD="$CHECK_PAYLOAD/wsjtx-component.pkg/Payload/Applications/wsjtx.app" - DATADIR="${APP_PAYLOAD}/Contents/Resources/wsjtx" - DOCDIR="${APP_PAYLOAD}/Contents/Resources/doc/wsjtx" SOUNDDIR="${APP_PAYLOAD}/Contents/Resources/sounds" - - for file in cty.dat cty.dat_copyright.txt grid.dat sat.dat eclipse.txt ALLCALL7.TXT JPLEPH; do - if [ ! -f "${DATADIR}/${file}" ]; then - echo "::error::Expected packaged data file is missing: ${DATADIR}/${file}" - exit 1 - fi - done - - set -- "${DOCDIR}/wsjtx-main"*.html + set -- "${APP_PAYLOAD}/Contents/Resources/doc/wsjtx/wsjtx-main"*.html if [ "$#" -lt 1 ] || [ ! -f "$1" ]; then echo "::error::Expected at least one local user guide in the packaged app bundle." printf 'Matched paths:\n' printf ' %s\n' "$@" exit 1 fi - if [ ! -f "${SOUNDDIR}/Wanted.wav" ]; then echo "::error::Expected packaged alert sound is missing: ${SOUNDDIR}/Wanted.wav" exit 1 fi - if [ ! -x "${APP_PAYLOAD}/Contents/MacOS/map65" ]; then - echo "::error::Expected packaged MAP65 binary is missing: ${APP_PAYLOAD}/Contents/MacOS/map65" - exit 1 - fi - if [ -e "${APP_PAYLOAD}/Contents/MacOS/sounds" ]; then echo "::error::Packaged alert sounds must not be under Contents/MacOS." exit 1 fi - - echo "Verified packaged local user guides:" - printf ' %s\n' "$@" echo "Verified packaged alert sounds in ${SOUNDDIR}" + .github/scripts/verify-macos-artifacts.sh \ + --target "${{ env.DEPLOYMENT_TARGET }}" \ + --arch "${{ inputs.arch }}" \ + "$CHECK_PAYLOAD/wsjtx-component.pkg/Payload" - - name: Notarize pkg - if: steps.check_secrets.outputs.signing_enabled == 'true' - env: - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_ID_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + - name: Stage distribution signing input + if: inputs.signing_mode == 'distribution' run: | - notarize_and_staple() { - local file="$1" - echo "Notarizing: $file" - xcrun notarytool submit "$file" \ - --apple-id "$APPLE_ID" \ - --password "$APPLE_ID_PASSWORD" \ - --team-id "$APPLE_TEAM_ID" \ - --wait 2>&1 | tee notarize.log - - if grep -q "status: Invalid" notarize.log; then - SUBMISSION_ID=$(grep "id:" notarize.log | head -1 | awk '{print $2}') - xcrun notarytool log "$SUBMISSION_ID" \ - --apple-id "$APPLE_ID" \ - --password "$APPLE_ID_PASSWORD" \ - --team-id "$APPLE_TEAM_ID" || true - exit 1 - fi - - xcrun stapler staple "$file" - } + mkdir -p distribution-signing-input + cp "${{ runner.temp }}/wsjtx-component.pkg" distribution-signing-input/ + cp "${{ runner.temp }}/components.plist" distribution-signing-input/ + cp entitlements.plist distribution-signing-input/ - notarize_and_staple "wsjtx-${{ inputs.version }}-${{ inputs.arch }}-macOS.pkg" + - name: Upload distribution signing input + if: inputs.signing_mode == 'distribution' + uses: actions/upload-artifact@v7 + with: + name: macos-signing-input-${{ inputs.version }}-${{ inputs.arch }} + path: distribution-signing-input + retention-days: 1 - - name: Notarize CLI tools - if: steps.check_secrets.outputs.signing_enabled == 'true' - env: - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_ID_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} - APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} + - name: Write validation signing report + if: inputs.signing_mode == 'validation' run: | - ASSETS="${{ steps.collect.outputs.assets_dir }}" - zip -r cli-tools.zip "${ASSETS}"/ - xcrun notarytool submit cli-tools.zip \ - --apple-id "$APPLE_ID" \ - --password "$APPLE_ID_PASSWORD" \ - --team-id "$APPLE_TEAM_ID" \ - --wait 2>&1 | tee notarize-cli.log - - if grep -q "status: Invalid" notarize-cli.log; then - SUBMISSION_ID=$(grep "id:" notarize-cli.log | head -1 | awk '{print $2}') - xcrun notarytool log "$SUBMISSION_ID" \ - --apple-id "$APPLE_ID" \ - --password "$APPLE_ID_PASSWORD" \ - --team-id "$APPLE_TEAM_ID" || true + PKG_OUT="${{ steps.package.outputs.path }}" + PKG_SIGNATURE=$(pkgutil --check-signature "$PKG_OUT" 2>&1 || true) + printf '%s\n' "$PKG_SIGNATURE" + if [[ "$PKG_SIGNATURE" != *"Status: no signature"* ]]; then + echo "::error::Validation package did not report the expected unsigned status." exit 1 fi - rm cli-tools.zip - - - name: Clean up keychain - if: always() && steps.check_secrets.outputs.signing_enabled == 'true' - run: security delete-keychain "$RUNNER_TEMP/signing.keychain-db" 2>/dev/null || true + SHA256=$(shasum -a 256 "$PKG_OUT" | awk '{print $1}') + jq -n \ + --arg mode validation \ + --arg artifact "$PKG_OUT" \ + --arg sha256 "$SHA256" \ + --arg git_sha "$GITHUB_SHA" \ + '{schema_version: 1, mode: $mode, artifact: $artifact, sha256: $sha256, git_sha: $git_sha, signed: false, notarized: false, publishable: false}' \ + > macos-signing-report.json - name: Upload pkg + if: inputs.signing_mode == 'validation' + uses: actions/upload-artifact@v7 + with: + name: ${{ steps.package.outputs.artifact_name }} + path: ${{ steps.package.outputs.path }} + + - name: Upload signing report + if: inputs.signing_mode == 'validation' uses: actions/upload-artifact@v7 with: - name: wsjtx-${{ inputs.version }}-${{ inputs.arch }}-macOS.pkg - path: wsjtx-${{ inputs.version }}-${{ inputs.arch }}-macOS.pkg + name: macos-signing-report-${{ inputs.version }}-${{ inputs.arch }} + path: macos-signing-report.json - name: Package individual binaries run: | - # Tarball and inner-dir names include the arch suffix so arm64 - # and x86_64 per-binary artifacts can coexist in a single - # GitHub Release without ReleaseAsset.name collisions (#24). + # Architecture-qualified names prevent release-asset collisions. ASSETS="${{ steps.collect.outputs.assets_dir }}" ARCH="${{ inputs.arch }}" PKGS=packages @@ -1185,3 +974,260 @@ jobs: with: name: individual-binaries-macos-${{ inputs.arch }} path: packages/*.tar.gz + + # Keep repository-built code after signing, notarization, cleanup, and + # artifact publication so a detached child cannot reach later secrets. + - name: Smoke-launch deployed WSJT-X app + id: deployed_wsjtx_smoke + timeout-minutes: 1 + run: | + APP="${GITHUB_WORKSPACE}/${{ steps.collect.outputs.stage_dir }}/wsjtx.app" + DIAGNOSTICS="${GITHUB_WORKSPACE}/wsjtx-build/deployed-startup-smoke-diagnostics" + + unset DYLD_LIBRARY_PATH + unset DYLD_FRAMEWORK_PATH + unset DYLD_INSERT_LIBRARIES + unset DYLD_ROOT_PATH + unset DYLD_IMAGE_SUFFIX + unset QT_PLUGIN_PATH + unset QT_QPA_PLATFORM_PLUGIN_PATH + unset QML_IMPORT_PATH + unset QML2_IMPORT_PATH + + export DYLD_FALLBACK_LIBRARY_PATH="/usr/lib" + export DYLD_FALLBACK_FRAMEWORK_PATH="/System/Library/Frameworks" + export QT_QPA_PLATFORM="cocoa" + export PATH="/usr/bin:/bin:/usr/sbin:/sbin" + + cd "$RUNNER_TEMP" + /bin/bash "${GITHUB_WORKSPACE}/test/run-wsjtx-startup-macos.sh" \ + "$DIAGNOSTICS" \ + "${APP}/Contents/MacOS/wsjtx" \ + --startup-smoke-test \ + --rig-name CI-DEPLOYED-STARTUP + + - name: Upload deployed WSJT-X startup diagnostics + if: failure() && steps.deployed_wsjtx_smoke.outcome == 'failure' + uses: actions/upload-artifact@v7 + with: + name: wsjtx-deployed-startup-smoke-macos-${{ inputs.arch }} + path: wsjtx-build/deployed-startup-smoke-diagnostics + if-no-files-found: ignore + retention-days: 7 + + sign_distribution: + if: inputs.signing_mode == 'distribution' + needs: build + runs-on: ${{ inputs.runner || (inputs.arch == 'x86_64' && 'macos-15-intel' || 'macos-15') }} + timeout-minutes: 30 + environment: apple-release-signing + env: + VERSION: ${{ inputs.version }} + ARCH: ${{ inputs.arch }} + APPLE_TEAM_ID: ${{ inputs.apple_team_id || vars.APPLE_TEAM_ID }} + APP_CERT_SHA1: ${{ inputs.application_certificate_sha1 || vars.APPLE_APPLICATION_CERTIFICATE_SHA1 }} + INST_CERT_SHA1: ${{ inputs.installer_certificate_sha1 || vars.APPLE_INSTALLER_CERTIFICATE_SHA1 }} + steps: + - name: Validate distribution credentials + env: + APP_P12: ${{ secrets.DEVELOPER_ID_CERTIFICATE_P12 }} + APP_P12_PW: ${{ secrets.DEVELOPER_ID_CERTIFICATE_PASSWORD }} + INST_P12: ${{ secrets.DEVELOPER_ID_INSTALLER_P12 }} + INST_P12_PW: ${{ secrets.DEVELOPER_ID_INSTALLER_PASSWORD }} + ASC_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }} + ASC_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} + ASC_PRIVATE_KEY_P8_BASE64: ${{ secrets.APP_STORE_CONNECT_PRIVATE_KEY_P8_BASE64 }} + run: | + missing=() + for name in APP_P12 APP_P12_PW INST_P12 INST_P12_PW ASC_KEY_ID ASC_ISSUER_ID ASC_PRIVATE_KEY_P8_BASE64 APPLE_TEAM_ID APP_CERT_SHA1 INST_CERT_SHA1; do + [ -n "${!name}" ] || missing+=("$name") + done + if [ "${#missing[@]}" -ne 0 ]; then + printf '::error::Distribution signing is missing required credentials or identity configuration: %s\n' "${missing[*]}" + exit 1 + fi + + - name: Download unsigned component package + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + with: + name: macos-signing-input-${{ inputs.version }}-${{ inputs.arch }} + path: signing-input + + - name: Expand signing input without executing it + run: | + pkgutil --expand-full signing-input/wsjtx-component.pkg "$RUNNER_TEMP/expanded-component" + test -d "$RUNNER_TEMP/expanded-component/Payload/Applications/wsjtx.app" + test -d "$RUNNER_TEMP/expanded-component/Payload/usr/local/wsjtx" + + - name: Import and verify Developer ID identities + id: identities + env: + APP_P12: ${{ secrets.DEVELOPER_ID_CERTIFICATE_P12 }} + APP_P12_PW: ${{ secrets.DEVELOPER_ID_CERTIFICATE_PASSWORD }} + INST_P12: ${{ secrets.DEVELOPER_ID_INSTALLER_P12 }} + INST_P12_PW: ${{ secrets.DEVELOPER_ID_INSTALLER_PASSWORD }} + run: | + KEYCHAIN_PATH="$RUNNER_TEMP/release-signing.keychain-db" + KEYCHAIN_PASSWORD="$(openssl rand -hex 16)" + security create-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" + security set-keychain-settings -lut 1800 "$KEYCHAIN_PATH" + security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" + printf '%s' "$APP_P12" | base64 --decode > "$RUNNER_TEMP/app.p12" + printf '%s' "$INST_P12" | base64 --decode > "$RUNNER_TEMP/installer.p12" + security import "$RUNNER_TEMP/app.p12" -P "$APP_P12_PW" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH" + security import "$RUNNER_TEMP/installer.p12" -P "$INST_P12_PW" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH" + rm -f "$RUNNER_TEMP/app.p12" "$RUNNER_TEMP/installer.p12" + security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" + security list-keychains -d user -s "$KEYCHAIN_PATH" login.keychain-db + + APP_IDENTITY=$(security find-identity -v -p codesigning "$KEYCHAIN_PATH" | awk -F'"' '/Developer ID Application/ {print $2; exit}') + INST_IDENTITY=$(security find-identity -v "$KEYCHAIN_PATH" | awk -F'"' '/Developer ID Installer/ {print $2; exit}') + [ -n "$APP_IDENTITY" ] || { echo "::error::No Developer ID Application identity was imported."; exit 1; } + [ -n "$INST_IDENTITY" ] || { echo "::error::No Developer ID Installer identity was imported."; exit 1; } + [[ "$APP_IDENTITY" == *"(${APPLE_TEAM_ID})"* ]] || { echo "::error::Application identity is not owned by the expected team."; exit 1; } + [[ "$INST_IDENTITY" == *"(${APPLE_TEAM_ID})"* ]] || { echo "::error::Installer identity is not owned by the expected team."; exit 1; } + + app_actual=$(security find-certificate -c "$APP_IDENTITY" -Z "$KEYCHAIN_PATH" | awk '/SHA-1 hash:/ {print toupper($3); exit}') + inst_actual=$(security find-certificate -c "$INST_IDENTITY" -Z "$KEYCHAIN_PATH" | awk '/SHA-1 hash:/ {print toupper($3); exit}') + app_expected=$(printf '%s' "$APP_CERT_SHA1" | tr -d ': ' | tr '[:lower:]' '[:upper:]') + inst_expected=$(printf '%s' "$INST_CERT_SHA1" | tr -d ': ' | tr '[:lower:]' '[:upper:]') + [ "$app_actual" = "$app_expected" ] || { echo "::error::Application certificate fingerprint mismatch."; exit 1; } + [ "$inst_actual" = "$inst_expected" ] || { echo "::error::Installer certificate fingerprint mismatch."; exit 1; } + echo "application=$APP_IDENTITY" >> "$GITHUB_OUTPUT" + echo "installer=$INST_IDENTITY" >> "$GITHUB_OUTPUT" + + - name: Sign staged application and command-line tools + env: + APP_IDENTITY: ${{ steps.identities.outputs.application }} + run: | + PAYLOAD="$RUNNER_TEMP/expanded-component/Payload" + APP="$PAYLOAD/Applications/wsjtx.app" + ENTITLEMENTS="$GITHUB_WORKSPACE/signing-input/entitlements.plist" + test -f "$ENTITLEMENTS" + + find "$APP/Contents/Frameworks" -type f \( -name "*.dylib" -o -perm +111 \) \ + -exec codesign --force --options runtime --timestamp --sign "$APP_IDENTITY" {} \; + find "$APP/Contents/Frameworks" -name "*.framework" -type d | while read -r framework; do + codesign --force --options runtime --timestamp --sign "$APP_IDENTITY" "$framework" + done + find "$APP/Contents/PlugIns" -type f -name "*.dylib" \ + -exec codesign --force --options runtime --timestamp --sign "$APP_IDENTITY" {} \; + find "$APP/Contents/MacOS" -type f -perm +111 \ + -exec codesign --force --options runtime --entitlements "$ENTITLEMENTS" --timestamp --sign "$APP_IDENTITY" {} \; + codesign --force --options runtime --entitlements "$ENTITLEMENTS" --timestamp --sign "$APP_IDENTITY" "$APP" + + find "$PAYLOAD/usr/local/wsjtx" -maxdepth 1 -type f -perm +111 \ + -exec codesign --force --options runtime --entitlements "$ENTITLEMENTS" --timestamp --sign "$APP_IDENTITY" {} \; + [ ! -d "$PAYLOAD/usr/local/wsjtx/lib" ] || find "$PAYLOAD/usr/local/wsjtx/lib" -type f \ + -exec codesign --force --options runtime --timestamp --sign "$APP_IDENTITY" {} \; + codesign --verify --deep --strict --verbose=2 "$APP" + + - name: Build signed distribution package + id: package + env: + INST_IDENTITY: ${{ steps.identities.outputs.installer }} + run: | + COMPONENT="$RUNNER_TEMP/wsjtx-signed-component.pkg" + pkgbuild \ + --root "$RUNNER_TEMP/expanded-component/Payload" \ + --scripts "$RUNNER_TEMP/expanded-component/Scripts" \ + --component-plist "$GITHUB_WORKSPACE/signing-input/components.plist" \ + --identifier "org.k1jt.wsjtx.${ARCH}" \ + --version "$VERSION" \ + --install-location / \ + "$COMPONENT" + pkgutil --payload-files "$COMPONENT" >/dev/null + PKG_OUT="wsjtx-${VERSION}-${ARCH}-macOS.pkg" + productbuild \ + --package "$COMPONENT" \ + --sign "$INST_IDENTITY" \ + "$PKG_OUT" + echo "path=$PKG_OUT" >> "$GITHUB_OUTPUT" + + - name: Verify rebuilt distribution package + run: | + PKG_OUT="${{ steps.package.outputs.path }}" + CHECK_PACKAGE="$RUNNER_TEMP/signed-package-check" + pkgutil --expand-full "$PKG_OUT" "$CHECK_PACKAGE" + COMPONENT="$CHECK_PACKAGE/wsjtx-signed-component.pkg" + PAYLOAD="$COMPONENT/Payload" + APP="$PAYLOAD/Applications/wsjtx.app" + test -x "$APP/Contents/MacOS/qmap" + test -x "$APP/Contents/MacOS/map65" + test -x "$COMPONENT/Scripts/postinstall" + test -d "$PAYLOAD/usr/local/wsjtx" + codesign --verify --deep --strict --verbose=2 "$APP" + + - name: Notarize and staple distribution package + id: notarize + env: + ASC_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }} + ASC_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }} + ASC_PRIVATE_KEY_P8_BASE64: ${{ secrets.APP_STORE_CONNECT_PRIVATE_KEY_P8_BASE64 }} + run: | + KEY_PATH="$RUNNER_TEMP/AuthKey_${ASC_KEY_ID}.p8" + printf '%s' "$ASC_PRIVATE_KEY_P8_BASE64" | base64 --decode > "$KEY_PATH" + chmod 600 "$KEY_PATH" + xcrun notarytool submit "${{ steps.package.outputs.path }}" \ + --key "$KEY_PATH" \ + --key-id "$ASC_KEY_ID" \ + --issuer "$ASC_ISSUER_ID" \ + --wait --output-format json > notarization.json + SUBMISSION_ID=$(jq -r '.id // empty' notarization.json) + STATUS=$(jq -r '.status // empty' notarization.json) + if [ "$STATUS" != "Accepted" ] || [ -z "$SUBMISSION_ID" ]; then + echo "::error::Apple notarization did not return Accepted (status=${STATUS:-missing})." + [ -n "$SUBMISSION_ID" ] && xcrun notarytool log "$SUBMISSION_ID" \ + --key "$KEY_PATH" --key-id "$ASC_KEY_ID" --issuer "$ASC_ISSUER_ID" || true + exit 1 + fi + xcrun stapler staple "${{ steps.package.outputs.path }}" + xcrun stapler validate "${{ steps.package.outputs.path }}" + echo "submission_id=$SUBMISSION_ID" >> "$GITHUB_OUTPUT" + echo "status=$STATUS" >> "$GITHUB_OUTPUT" + rm -f "$KEY_PATH" + + - name: Verify distribution trust and write signing report + run: | + PKG_OUT="${{ steps.package.outputs.path }}" + COMPONENT="$RUNNER_TEMP/signed-package-check/wsjtx-signed-component.pkg" + APP="$COMPONENT/Payload/Applications/wsjtx.app" + codesign --verify --deep --strict --verbose=2 "$APP" + codesign -dv --verbose=4 "$APP" 2> codesign-details.txt + grep -F "TeamIdentifier=${APPLE_TEAM_ID}" codesign-details.txt + pkgutil --check-signature "$PKG_OUT" | tee pkg-signature.txt + grep -F "Developer ID Installer:" pkg-signature.txt + grep -F "(${APPLE_TEAM_ID})" pkg-signature.txt + xcrun stapler validate "$PKG_OUT" + spctl --assess --type install --verbose=4 "$PKG_OUT" + SHA256=$(shasum -a 256 "$PKG_OUT" | awk '{print $1}') + jq -n \ + --arg mode distribution \ + --arg artifact "$PKG_OUT" \ + --arg sha256 "$SHA256" \ + --arg git_sha "$GITHUB_SHA" \ + --arg team_id "$APPLE_TEAM_ID" \ + --arg app_certificate_sha1 "$(printf '%s' "$APP_CERT_SHA1" | tr -d ': ' | tr '[:lower:]' '[:upper:]')" \ + --arg installer_certificate_sha1 "$(printf '%s' "$INST_CERT_SHA1" | tr -d ': ' | tr '[:lower:]' '[:upper:]')" \ + --arg notarization_id "${{ steps.notarize.outputs.submission_id }}" \ + --arg notarization_status "${{ steps.notarize.outputs.status }}" \ + '{schema_version: 1, mode: $mode, artifact: $artifact, sha256: $sha256, git_sha: $git_sha, team_id: $team_id, application_certificate_sha1: $app_certificate_sha1, installer_certificate_sha1: $installer_certificate_sha1, notarization: {id: $notarization_id, status: $notarization_status}, stapled: true, gatekeeper_accepted: true, isolated_signing_job: true}' \ + > macos-signing-report.json + + - name: Remove signing credentials + if: always() + run: | + rm -f "$RUNNER_TEMP/app.p12" "$RUNNER_TEMP/installer.p12" "$RUNNER_TEMP"/AuthKey_*.p8 + security delete-keychain "$RUNNER_TEMP/release-signing.keychain-db" 2>/dev/null || true + + - name: Upload signed distribution package + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: ${{ steps.package.outputs.path }} + path: ${{ steps.package.outputs.path }} + + - name: Upload distribution signing report + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: macos-signing-report-${{ inputs.version }}-${{ inputs.arch }} + path: macos-signing-report.json diff --git a/.github/workflows/build-selected-artifacts.yml b/.github/workflows/build-selected-artifacts.yml new file mode 100644 index 00000000..71e33737 --- /dev/null +++ b/.github/workflows/build-selected-artifacts.yml @@ -0,0 +1,181 @@ +name: Build Selected Artifacts + +on: + workflow_dispatch: + inputs: + targets: + description: "Artifact set to build" + required: true + type: choice + options: + - macos-arm64 + - windows-x64 + - macos-arm64-windows-x64 + - linux-x64 + - linux-arm64 + - macos-x64 + - all + default: macos-arm64 + mode: + description: "Build selected artifacts immediately or gate them on Linux x64 first" + required: true + type: choice + options: + - artifact-now + - linux-smoke-first + default: artifact-now + recache: + description: "Force ccache to recompile and refresh cached objects" + required: false + type: boolean + default: false + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.targets }}-${{ inputs.mode }} + cancel-in-progress: false + +permissions: + contents: read + packages: read + +jobs: + prepare: + runs-on: ubuntu-latest + timeout-minutes: 10 + outputs: + version: ${{ steps.v.outputs.version }} + release_channel: ${{ steps.v.outputs.release_channel }} + rc_number: ${{ steps.v.outputs.rc_number }} + linux_image_tag: ${{ steps.linux-image.outputs.image_tag }} + steps: + - uses: actions/checkout@v7 + - id: v + run: | + STATE=$(python3 .github/scripts/release-policy.py read-state) + VERSION=$(jq -r .version <<<"$STATE") + CHANNEL=$(jq -r .channel <<<"$STATE") + RC_NUMBER=$(jq -r .rc <<<"$STATE") + echo "Derived version from release-state.txt: $VERSION" + { + echo "version=$VERSION" + echo "release_channel=$CHANNEL" + echo "rc_number=$RC_NUMBER" + } >> "$GITHUB_OUTPUT" + - id: linux-image + name: Resolve Linux CI image generation + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: .github/scripts/resolve-linux-ci-image-tag.py + + # In linux-smoke-first mode, this is both the cheap gate and a normal Linux + # x64 artifact build. Do not also run linux-x64 for the same dispatch. + linux-smoke-x64: + needs: [prepare] + if: inputs.mode == 'linux-smoke-first' + uses: ./.github/workflows/build-linux.yml + with: + version: ${{ needs.prepare.outputs.version }} + hamlib_branch: "4.7.2" + arch: "x86_64" + image_tag: ${{ needs.prepare.outputs.linux_image_tag }} + save_ccache: true + recache: ${{ inputs.recache }} + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} + + linux-x64: + needs: [prepare] + if: >- + inputs.mode != 'linux-smoke-first' && + (inputs.targets == 'linux-x64' || inputs.targets == 'all') + uses: ./.github/workflows/build-linux.yml + with: + version: ${{ needs.prepare.outputs.version }} + hamlib_branch: "4.7.2" + arch: "x86_64" + image_tag: ${{ needs.prepare.outputs.linux_image_tag }} + save_ccache: true + recache: ${{ inputs.recache }} + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} + + linux-arm64: + needs: [prepare, linux-smoke-x64] + if: >- + always() && + !cancelled() && + needs.prepare.result == 'success' && + (needs.linux-smoke-x64.result == 'success' || needs.linux-smoke-x64.result == 'skipped') && + (inputs.targets == 'linux-arm64' || inputs.targets == 'all') + uses: ./.github/workflows/build-linux.yml + with: + version: ${{ needs.prepare.outputs.version }} + hamlib_branch: "4.7.2" + arch: "aarch64" + image_tag: ${{ needs.prepare.outputs.linux_image_tag }} + save_ccache: true + recache: ${{ inputs.recache }} + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} + + macos-arm64: + needs: [prepare, linux-smoke-x64] + if: >- + always() && + !cancelled() && + needs.prepare.result == 'success' && + (needs.linux-smoke-x64.result == 'success' || needs.linux-smoke-x64.result == 'skipped') && + ( + inputs.targets == 'macos-arm64' || + inputs.targets == 'macos-arm64-windows-x64' || + inputs.targets == 'all' + ) + uses: ./.github/workflows/build-macos.yml + with: + version: ${{ needs.prepare.outputs.version }} + hamlib_branch: "4.7.2" + arch: "arm64" + runner: "macos-15" + deployment_target: "11.0" + recache: ${{ inputs.recache }} + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} + + macos-x64: + needs: [prepare, linux-smoke-x64] + if: >- + always() && + !cancelled() && + needs.prepare.result == 'success' && + (needs.linux-smoke-x64.result == 'success' || needs.linux-smoke-x64.result == 'skipped') && + (inputs.targets == 'macos-x64' || inputs.targets == 'all') + uses: ./.github/workflows/build-macos.yml + with: + version: ${{ needs.prepare.outputs.version }} + hamlib_branch: "4.7.2" + arch: "x86_64" + runner: "macos-15-intel" + deployment_target: "10.13" + recache: ${{ inputs.recache }} + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} + + windows-x64: + needs: [prepare, linux-smoke-x64] + if: >- + always() && + !cancelled() && + needs.prepare.result == 'success' && + (needs.linux-smoke-x64.result == 'success' || needs.linux-smoke-x64.result == 'skipped') && + ( + inputs.targets == 'windows-x64' || + inputs.targets == 'macos-arm64-windows-x64' || + inputs.targets == 'all' + ) + uses: ./.github/workflows/build-windows.yml + with: + version: ${{ needs.prepare.outputs.version }} + hamlib_branch: "4.7.2" + recache: ${{ inputs.recache }} + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 1d6f8ec9..c2dca58d 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -11,7 +11,17 @@ on: description: "Hamlib branch to build" required: false type: string - default: "4.7.0" + default: "4.7.2" + recache: + description: "Force ccache to recompile and refresh cached objects" + required: false + type: boolean + default: false + save_ccache: + description: "Persist compiler objects from a trusted develop build" + required: false + type: boolean + default: false release_channel: description: "Build release channel: DEVEL, RC, or GA" required: false @@ -22,10 +32,69 @@ on: required: false type: string default: "" + outputs: + installer-artifact-id: + description: "Installer artifact id, for the SignPath submit step" + value: ${{ jobs.build.outputs.installer-artifact-id }} + # Also runnable on its own ("Run workflow" / gh workflow run) to build just + # the Windows installer, at ~1/6 the cost of the full ci.yml matrix. GitHub + # only exposes workflow_dispatch when the trigger is present on the default + # branch, so this must be merged to develop before it can be dispatched. + # Inputs mirror workflow_call with standalone defaults: hamlib_branch matches + # what ci.yml / release.yml actually pass (4.7.2, not the workflow_call legacy + # default), and version defaults to a clearly-marked devel string -- overridable + # via `-f version=...` -- so a manual build is never mistaken for a release. + workflow_dispatch: + inputs: + version: + description: "WSJT-X version string (installer filename + artifact names)" + required: false + type: string + default: "3.2.0-devel" + hamlib_branch: + description: "Hamlib branch to build" + required: false + type: string + default: "4.7.2" + recache: + description: "Force ccache to recompile and refresh cached objects" + required: false + type: boolean + default: false + save_ccache: + description: "Persist compiler objects when dispatching on develop" + required: false + type: boolean + default: true + release_channel: + description: "Build release channel" + required: false + type: choice + options: + - DEVEL + - RC + - GA + default: "DEVEL" + rc_number: + description: "Release candidate number when release_channel is RC" + required: false + type: string + default: "" jobs: build: runs-on: windows-latest + timeout-minutes: 100 + outputs: + installer-artifact-id: ${{ steps.upload_installer.outputs.artifact-id }} + env: + BOOST_VERSION: 1.91.0 + BOOST_SOURCE_SHA256: de5e6b0e4913395c6bdfa90537febd9028ea4c0735d2cdb0cd9b45d5f51264f5 + WSJT_WINDOWS_API_FLOOR: "0x0601" + VERSION: ${{ inputs.version }} + HAMLIB_BRANCH: ${{ inputs.hamlib_branch }} + WSJT_RELEASE_CHANNEL: ${{ inputs.release_channel }} + WSJT_RC_NUMBER: ${{ inputs.rc_number }} defaults: run: shell: msys2 {0} @@ -41,8 +110,16 @@ jobs: shell: pwsh run: git config --global core.autocrlf false - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 + - name: Validate workflow inputs + shell: bash + env: + WSJTX_VERSION: ${{ inputs.version }} + run: .github/scripts/validate-ci-inputs.sh + + # Boost is source-built by build-windows-deps so the Windows 7 API floor + # and Boost.Atomic patch stay pinned; do not install MSYS2 Boost here. - uses: msys2/setup-msys2@v2 with: msystem: MINGW64 @@ -52,6 +129,7 @@ jobs: git make tar mingw-w64-x86_64-gcc mingw-w64-x86_64-gcc-fortran + mingw-w64-x86_64-ccache mingw-w64-x86_64-cmake mingw-w64-x86_64-qt5-base mingw-w64-x86_64-qt5-multimedia @@ -61,12 +139,10 @@ jobs: mingw-w64-x86_64-qt5-websockets mingw-w64-x86_64-qt5-activeqt mingw-w64-x86_64-fftw - mingw-w64-x86_64-boost mingw-w64-x86_64-libusb mingw-w64-x86_64-portaudio mingw-w64-x86_64-pkg-config mingw-w64-x86_64-nsis - mingw-w64-x86_64-osslsigncode mingw-w64-x86_64-ruby autoconf automake libtool @@ -76,73 +152,44 @@ jobs: - name: Install asciidoctor (Ruby gem) run: gem install asciidoctor --no-document - - name: Cache pFUnit - id: pfunit-cache - uses: actions/cache@v5 - with: - path: pfunit-prefix - key: pfunit-windows-v4.9.0-${{ hashFiles('.github/workflows/build-windows.yml') }} + - name: Select ccache key + id: ccache-key + shell: bash + env: + RECACHE: ${{ inputs.recache }} + run: .github/scripts/select-ccache-key-suffix.sh - - name: Build pFUnit - if: steps.pfunit-cache.outputs.cache-hit != 'true' - run: | - WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") - git config --global core.longpaths true - git clone --depth 1 --branch v4.9.0 --recursive \ - https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git pfunit-src - cmake -S pfunit-src -B pfunit-build -G "MSYS Makefiles" \ - -DSKIP_MPI=YES \ - -DSKIP_OPENMP=YES \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ - -DCMAKE_INSTALL_PREFIX="${WORKSPACE}/pfunit-prefix" - cmake --build pfunit-build -j$(nproc) - cmake --install pfunit-build + - name: Restore ccache + id: ccache + uses: actions/cache/restore@v6 + with: + path: .ccache + key: ccache-windows-x86_64-gcc-${{ github.sha }}${{ steps.ccache-key.outputs.suffix }} + restore-keys: | + ccache-windows-x86_64-gcc- - - name: Locate pFUnit config - id: pfunit + - name: Configure ccache run: | WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") - # Locate each sub-package's config directly — MSYS2 pkg-config - # interacts badly with multi-entry CMAKE_PREFIX_PATH, so we pass - # explicit _DIR hints instead. - for pkg in PFUNIT GFTL GFTL_SHARED FARGPARSE; do - CONFIG=$(find "${WORKSPACE}/pfunit-prefix" -name ${pkg}Config.cmake | head -1) - if [ -z "$CONFIG" ]; then - echo "ERROR: ${pkg}Config.cmake not found under pfunit-prefix" - find "${WORKSPACE}/pfunit-prefix" -maxdepth 3 -type d - exit 1 - fi - DIR="$(dirname "$CONFIG")" - echo "Found ${pkg}Config.cmake at: $CONFIG" - echo "$(echo $pkg | tr '[:upper:]' '[:lower:]')_dir=${DIR}" >> "$GITHUB_OUTPUT" - done + echo "CCACHE_DIR=${WORKSPACE}/.ccache" >> "$GITHUB_ENV" + echo "ccache recache: ${{ inputs.recache }}" + if [ "${{ inputs.recache }}" = "true" ]; then + echo "CCACHE_RECACHE=1" >> "$GITHUB_ENV" + echo "Forcing ccache recache for this run" + fi + mkdir -p "${WORKSPACE}/.ccache" + ccache --version + ccache --zero-stats - - name: Cache Hamlib - id: hamlib-cache - uses: actions/cache@v5 + - name: Build Windows dependencies + id: windows-deps + uses: ./.github/actions/build-windows-deps with: - path: hamlib-prefix - key: hamlib-windows-${{ inputs.hamlib_branch }}-${{ hashFiles('.github/workflows/build-windows.yml') }} - - - name: Build Hamlib - if: steps.hamlib-cache.outputs.cache-hit != 'true' - env: - MSYS2_PATH_TYPE: inherit - run: | - WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") - git clone --depth 1 --branch "${{ inputs.hamlib_branch }}" \ - https://github.com/Hamlib/Hamlib.git hamlib-src - cd hamlib-src - ./bootstrap - ./configure \ - --prefix="${WORKSPACE}/hamlib-prefix" \ - --enable-shared --disable-static \ - --without-cxx-binding \ - --without-readline \ - CFLAGS="-DNDEBUG -g -O2 -fdata-sections -ffunction-sections" \ - LDFLAGS="-Wl,--gc-sections" - make -j$(nproc) - make install-strip + boost_version: ${{ env.BOOST_VERSION }} + boost_source_sha256: ${{ env.BOOST_SOURCE_SHA256 }} + windows_api_floor: ${{ env.WSJT_WINDOWS_API_FLOOR }} + hamlib_branch: ${{ inputs.hamlib_branch }} + save_caches: ${{ github.event_name != 'pull_request' }} - name: Install OmniRig shell: pwsh @@ -159,35 +206,71 @@ jobs: if (-not $omnirig) { throw "OmniRig install failed — OmniRig.exe not found" } echo "OMNIRIG_PATH=$($omnirig.FullName)" >> $env:GITHUB_ENV - - name: Fix dumpcpp name (MSYS2 ships dumpcpp-qt5, CMake expects dumpcpp) - run: | - ln -sf /mingw64/bin/dumpcpp-qt5.exe /mingw64/bin/dumpcpp.exe - - - name: Configure + - name: Configure build and tests run: | WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") OMNIRIG=$(cygpath "${OMNIRIG_PATH}") + BOOST_PREFIX="${{ steps.windows-deps.outputs.boost_prefix }}" + HAMLIB_PREFIX="${{ steps.windows-deps.outputs.hamlib_prefix }}" cmake -G "MSYS Makefiles" -S . -B wsjtx-build \ - -DCMAKE_PREFIX_PATH="${WORKSPACE}/hamlib-prefix" \ + -DCMAKE_PREFIX_PATH="${BOOST_PREFIX};${HAMLIB_PREFIX}" \ + -DBOOST_ROOT="${BOOST_PREFIX}" \ + -DBOOST_INCLUDEDIR="${BOOST_PREFIX}/include" \ + -DBOOST_LIBRARYDIR="${BOOST_PREFIX}/lib" \ + -DHamlib_INCLUDE_DIR="${HAMLIB_PREFIX}/include" \ + -DHamlib_LIBRARY="${HAMLIB_PREFIX}/lib/libhamlib.dll.a" \ + -DRIGCTL_EXE="${HAMLIB_PREFIX}/bin/rigctl.exe" \ + -DRIGCTLD_EXE="${HAMLIB_PREFIX}/bin/rigctld.exe" \ + -DRIGCTLCOM_EXE="${HAMLIB_PREFIX}/bin/rigctlcom.exe" \ + -DCMAKE_C_FLAGS="-D_WIN32_WINNT=${WSJT_WINDOWS_API_FLOOR} -DWINVER=${WSJT_WINDOWS_API_FLOOR}" \ + -DCMAKE_CXX_FLAGS="-D_WIN32_WINNT=${WSJT_WINDOWS_API_FLOOR} -DWINVER=${WSJT_WINDOWS_API_FLOOR} -DBOOST_USE_WINAPI_VERSION=${WSJT_WINDOWS_API_FLOOR}" \ + -DBoost_NO_SYSTEM_PATHS=ON \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ -DOMNIRIG_TYPE_LIB="${OMNIRIG}" \ -DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch -std=legacy" \ - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ -DWSJT_SKIP_MANPAGES=ON \ - -DWSJT_BUILD_TESTS=ON \ - -DWSJT_RELEASE_CHANNEL="${{ inputs.release_channel }}" \ - -DWSJT_RC_NUMBER="${{ inputs.rc_number }}" \ - -DPFUNIT_DIR="${{ steps.pfunit.outputs.pfunit_dir }}" \ - -DGFTL_DIR="${{ steps.pfunit.outputs.gftl_dir }}" \ - -DGFTL_SHARED_DIR="${{ steps.pfunit.outputs.gftl_shared_dir }}" \ - -DFARGPARSE_DIR="${{ steps.pfunit.outputs.fargparse_dir }}" \ + -DWSJT_ENABLE_TESTS=ON \ + -DWSJT_FORTRAN_LIBRARY_VARIANTS=OPENMP_ONLY \ + -DWSJT_RELEASE_CHANNEL="${WSJT_RELEASE_CHANNEL}" \ + -DWSJT_RC_NUMBER="${WSJT_RC_NUMBER}" \ + -DPFUNIT_DIR="${{ steps.windows-deps.outputs.pfunit_dir }}" \ + -DGFTL_DIR="${{ steps.windows-deps.outputs.gftl_dir }}" \ + -DGFTL_SHARED_DIR="${{ steps.windows-deps.outputs.gftl_shared_dir }}" \ + -DFARGPARSE_DIR="${{ steps.windows-deps.outputs.fargparse_dir }}" \ -Wno-dev - - name: Build + - name: Build and test targets run: cmake --build wsjtx-build -j$(nproc) + - name: Show ccache stats + if: always() + run: ccache --show-stats + + - name: Report suppressed ccache save + if: ${{ (inputs.save_ccache || inputs.recache) && github.ref != 'refs/heads/develop' }} + run: echo "::notice::Not saving ccache because shared compiler caches are published only from develop" + + - name: Save ccache + if: ${{ success() && (inputs.save_ccache || inputs.recache) && github.ref == 'refs/heads/develop' && steps.ccache.outputs.cache-hit != 'true' }} + uses: actions/cache/save@v6 + with: + path: .ccache + key: ${{ steps.ccache.outputs.cache-primary-key }} + - name: Run tests id: ctest - run: ctest --output-on-failure --output-junit ctest-results.xml + run: | + # Tests that link wsjt_qt (e.g. test_jtty_txstream) pull in the + # rig-control code, so their exe imports libhamlib-4.dll. Hamlib is + # built --enable-shared into hamlib-prefix, so hamlib-prefix/bin must + # be on PATH for the test to load — the mingw runtime DLLs are already + # reachable via /mingw64/bin, but hamlib-prefix is not. Without this + # the test exits 0xc0000135 (STATUS_DLL_NOT_FOUND) at launch. The + # packaged installer is unaffected: cpack's bundle_fixup copies + # libhamlib-4.dll in. + export PATH="${{ steps.windows-deps.outputs.boost_prefix }}/lib:${{ steps.windows-deps.outputs.hamlib_prefix }}/bin:${PATH}" + ctest --output-on-failure --output-junit ctest-results.xml working-directory: wsjtx-build - name: Publish test summary @@ -203,12 +286,22 @@ jobs: path: wsjtx-build/ctest-results.xml if-no-files-found: ignore + # MAP65 builds by default again. Under OPENMP_ONLY, m65impl resolves + # wsjt_fort_common to wsjt_fort_omp, so this keeps the Windows Fortran + # linkage covered by CI. - name: Verify binary run: | file wsjtx-build/jt9.exe - test -x wsjtx-build/map65/map65.exe + file wsjtx-build/map65/map65.exe + test -f wsjtx-build/map65/map65.exe - - name: Stage install + # Install to a staging prefix so bundle_fixup runs: its install(CODE) + # step copies Qt and dependent runtime DLLs next to the installed + # executables, making bin/ self-contained. Build-tree binaries are NOT + # self-contained (they resolve Qt/libgfortran/libgomp via /mingw64/bin), + # so the launch check below must run against the staged install, not the + # build tree — otherwise it would fail for binaries that ship fine. + - name: Stage install (runs bundle_fixup) run: | WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") cmake --install wsjtx-build --prefix "${WORKSPACE}/stage-main" @@ -219,17 +312,35 @@ jobs: WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") test -f "${WORKSPACE}/stage-main/bin/map65.exe" test -f "${WORKSPACE}/stage-main/bin/qmap.exe" - test -f "${WORKSPACE}/stage-main/bin/wsjtx.exe" - test -f "${WORKSPACE}/stage-main/bin/jt9.exe" bash .github/scripts/audit-staged-dll-imports-windows.sh \ "${WORKSPACE}/stage-main/bin" \ - "${WORKSPACE}/stage-main/bin/map65.exe" \ - "${WORKSPACE}/stage-main/bin/qmap.exe" \ + "${WORKSPACE}"/stage-main/bin/*.exe \ + "${WORKSPACE}"/stage-main/bin/*.dll + + - name: Smoke-launch staged WSJT-X (clean PATH) + id: wsjtx_smoke + run: | + WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") + .github/scripts/smoke-launch-windows.sh \ "${WORKSPACE}/stage-main/bin/wsjtx.exe" \ - "${WORKSPACE}/stage-main/bin/jt9.exe" + --startup-smoke-test --rig-name CI-STARTUP - # Emit an NSIS installer containing the full CLI tool set - # (wsjtx.exe, jt9, wsprd, fmtave, fcal, fmeasure + WSJT_BUILD_UTILS + - name: Upload WSJT-X startup diagnostics + if: failure() && steps.wsjtx_smoke.outcome == 'failure' + uses: actions/upload-artifact@v7 + with: + name: wsjtx-startup-smoke-windows + path: launch.out + if-no-files-found: ignore + retention-days: 7 + + - name: Smoke-launch staged jt9 (clean PATH) + run: | + WORKSPACE=$(cygpath "${GITHUB_WORKSPACE}") + .github/scripts/smoke-launch-windows.sh "${WORKSPACE}/stage-main/bin/jt9.exe" --help + + # Emit an NSIS installer containing the full executable set + # (wsjtx.exe, map65.exe, jt9, wsprd, fmtave, fcal, fmeasure + WSJT_BUILD_UTILS # ft8code/jt65code/... + rigctl wrappers + Qt runtime via bundle_fixup). # CMakeLists.txt:1989-1990 sets CPACK_GENERATOR=NSIS on WIN32 and # CPACK_MONOLITHIC_INSTALL=1 packages every install() target. @@ -246,50 +357,28 @@ jobs: # wsjtx--win64.exe. release.yml's prepare job # enforces numeric-base parity; this override covers the # suffix gap. - cpack -G NSIS -V \ - -D CPACK_PACKAGE_VERSION="${{ inputs.version }}" \ - -D CPACK_PACKAGE_FILE_NAME="wsjtx-${{ inputs.version }}-win64" + cpack_args=( + -G NSIS + -D CPACK_PACKAGE_VERSION="${VERSION}" + -D CPACK_PACKAGE_FILE_NAME="wsjtx-${VERSION}-win64" + ) + if [ "${CPACK_VERBOSE:-0}" = "1" ]; then + cpack_args+=(-V) + fi + cpack "${cpack_args[@]}" ls -la *.exe - test -x map65/map65.exe - # Self-signed ephemeral signing — the signing step is wired into the - # pipeline, but the signature does NOT chain to a trusted root. This - # is intentional: Authenticode certification is a separate decision - # (CI/CD adoption decision #5). Generates an ephemeral cert per-run. - - name: Sign installer with self-signed ephemeral cert + - name: Verify installer has no Authenticode signature + shell: pwsh run: | - cd wsjtx-build - INSTALLER=$(ls wsjtx-${{ inputs.version }}-*.exe | head -1) - if [ -z "$INSTALLER" ]; then - echo "ERROR: no NSIS installer produced by cpack" - ls -la - exit 1 - fi - echo "Unsigned installer: $INSTALLER" - # MSYS2 auto-converts arguments starting with '/' into Windows paths - # (e.g., '/CN=...' becomes 'D:/a/_temp/msys64/CN=...'). - # MSYS2_ARG_CONV_EXCL="*" disables that conversion for this command. - MSYS2_ARG_CONV_EXCL="*" openssl req -x509 -newkey rsa:2048 \ - -keyout ephemeral-key.pem -out ephemeral-cert.pem \ - -days 365 -nodes \ - -subj "/CN=WSJT-X Ephemeral Dev Signing/O=WSJTX/C=US" - SIGNED="${INSTALLER%.exe}-signed.exe" - osslsigncode sign \ - -certs ephemeral-cert.pem -key ephemeral-key.pem \ - -n "WSJT-X Installer" \ - -i "https://github.com/WSJTX/wsjtx-internal" \ - -h sha256 \ - -in "$INSTALLER" -out "$SIGNED" - mv "$SIGNED" "$INSTALLER" - rm -f ephemeral-key.pem ephemeral-cert.pem - echo "Signed installer: $INSTALLER" - osslsigncode verify "$INSTALLER" || true - # Exit 0: osslsigncode verify returns non-zero on CA-untrust even - # when the signature itself is structurally valid. The ephemeral - # cert is self-signed by design; the "|| true" keeps CI green. - # Structural presence is proven by the sign step succeeding above. + $installer = Get-Item "wsjtx-build/wsjtx-${{ inputs.version }}-win64.exe" + $signature = Get-AuthenticodeSignature $installer.FullName + if ($signature.Status -ne 'NotSigned') { + throw "Installer Authenticode status is $($signature.Status), expected NotSigned" + } - name: Upload installer artifact + id: upload_installer uses: actions/upload-artifact@v7 with: name: wsjtx-${{ inputs.version }}-windows-x86_64-installer @@ -301,6 +390,5 @@ jobs: name: wsjtx-${{ inputs.version }}-windows-x86_64 path: | wsjtx-build/jt9.exe - wsjtx-build/map65/map65.exe wsjtx-build/wsprd.exe wsjtx-build/wsjtx.exe diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a1bf639a..70ce9fe4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,92 +2,262 @@ name: CI on: push: - branches: [develop] + branches: [develop, "release/**"] pull_request: - branches: [develop] + branches: [develop, "release/**"] + # `labeled` is added to the defaults (opened/synchronize/reopened) so + # that applying `full-ci`, `sanitizers`, or `thread-sanitizer` to an + # already-open PR triggers + # a fresh run that includes the requested opt-in jobs (see the gates below). + types: [opened, synchronize, reopened, labeled] workflow_dispatch: + inputs: + recache: + description: "Force recompilation and persist refreshed ccache objects on develop" + required: false + type: boolean + default: false + save_ccache: + description: "Persist Linux ccache objects without forcing recompilation on develop" + required: false + type: boolean + default: false + armhf_image_tag: + description: "Immutable paired ARMHF image tag; empty resolves the promoted generation" + required: false + type: string + default: "" + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +permissions: + contents: read + packages: read jobs: # Single source of truth for the project version string: read it from - # CMakeLists.txt so CI and release.yml cannot disagree. Strip the + # release-state.txt so CI and release builds cannot disagree. Strip the # optional fourth tweak segment (3.0.0.0 → 3.0.0) to match the 3-part # shape release.yml derives from build/v tags. prepare: runs-on: ubuntu-latest + timeout-minutes: 10 outputs: version: ${{ steps.v.outputs.version }} + release_channel: ${{ steps.v.outputs.release_channel }} + rc_number: ${{ steps.v.outputs.rc_number }} + linux_image_tag: ${{ steps.linux-image.outputs.image_tag }} + armhf_image_tag: ${{ steps.armhf-image.outputs.image_tag }} + save_linux_ccache: ${{ steps.ccache-policy.outputs.save_ccache }} + build_linux_packages: ${{ steps.packaging-policy.outputs.build_packages }} steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 + - name: Validate workflow job timeouts + run: .github/scripts/validate-workflow-timeouts.py + - name: Run CI policy self-tests + run: | + .github/scripts/validate-ci-inputs.sh --self-test + .github/scripts/is-linux-ci-image-input.sh --self-test + .github/scripts/select-ccache-key-suffix.sh --self-test + .github/scripts/select-linux-ccache-save.sh --self-test + .github/scripts/select-linux-packaging.sh --self-test + .github/scripts/test-linux-ccache-compiler-signature.sh + .github/scripts/test-verify-linux-ci-image.sh + python3 -m unittest discover -s .github/scripts/tests -p 'test_*.py' - id: v run: | - VERSION=$(grep -E '^\s*VERSION\s+[0-9]' CMakeLists.txt | head -1 | awk '{print $2}' | cut -d. -f1-3) - if [ -z "$VERSION" ]; then - echo "::error::Could not derive VERSION from CMakeLists.txt" - exit 1 + STATE=$(python3 .github/scripts/release-policy.py read-state) + VERSION=$(jq -r .version <<<"$STATE") + CHANNEL=$(jq -r .channel <<<"$STATE") + RC_NUMBER=$(jq -r .rc <<<"$STATE") + echo "Derived version from release-state.txt: $VERSION" + { + echo "version=$VERSION" + echo "release_channel=$CHANNEL" + echo "rc_number=$RC_NUMBER" + } >> "$GITHUB_OUTPUT" + # PRs can consume develop caches, so only trusted develop executions may + # publish the Linux cache shared with later pull-request builds. + - id: ccache-policy + name: Select Linux ccache save policy + env: + EVENT_NAME: ${{ github.event_name }} + REQUEST_SAVE_CCACHE: ${{ inputs.save_ccache || false }} + RECACHE: ${{ inputs.recache || false }} + run: .github/scripts/select-linux-ccache-save.sh + - id: packaging-policy + name: Select Linux packaging policy + env: + EVENT_NAME: ${{ github.event_name }} + PR_BASE_SHA: ${{ github.event.pull_request.base.sha }} + CURRENT_SHA: ${{ github.sha }} + FULL_CI: ${{ contains(github.event.pull_request.labels.*.name, 'full-ci') }} + run: .github/scripts/select-linux-packaging.sh + - id: linux-image + name: Resolve Linux CI image generation + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: .github/scripts/resolve-linux-ci-image-tag.py + - id: armhf-image + name: Resolve ARMHF CI image generation + if: >- + github.event_name == 'workflow_dispatch' || + contains(github.event.pull_request.labels.*.name, 'full-ci') + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REQUESTED_TAG: ${{ inputs.armhf_image_tag || '' }} + run: | + if [[ -n "$REQUESTED_TAG" ]]; then + echo "Using requested ARMHF CI image generation: $REQUESTED_TAG" + echo "image_tag=$REQUESTED_TAG" >> "$GITHUB_OUTPUT" + else + RESOLVE_ARMHF=true .github/scripts/resolve-linux-ci-image-tag.py fi - echo "Derived version from CMakeLists.txt: $VERSION" - echo "version=$VERSION" >> "$GITHUB_OUTPUT" - - macos-arm64-qt: - needs: prepare - uses: ./.github/workflows/prepare-macos-qt.yml - with: - arch: "arm64" - runner: "macos-15" - deployment_target: "11.0" - - macos-intel-qt: - needs: prepare - uses: ./.github/workflows/prepare-macos-qt.yml - with: - arch: "x86_64" - runner: "macos-15-intel" - deployment_target: "10.13" + # Two-tier CI to conserve Actions minutes. The default path runs one Linux + # x86_64 smoke leg; sanitizer and broader platform coverage are opt-in. + # + # * Default (every push / PR to develop): Linux x86_64 only -- `linux`. + # * ASan + UBSan: runs on PRs carrying `sanitizers` or `full-ci`. + # * TSan: runs only on PRs carrying `thread-sanitizer`. + # * Opt-in matrix (`linux-arm`, `linux-armhf`, macos, macos-intel, windows): runs when a + # PR carries the `full-ci` label, or when the workflow is started manually + # ("Run workflow" / workflow_dispatch). Release builds are unaffected -- + # they run the full matrix via release.yml on build/v* tags. + # + # Every non-prepare leg also `needs: linux`, so a break that fails + # everywhere fails fast on the cheapest runner before any costly leg + # starts, instead of burning them in parallel. `prepare` stays in `needs` + # for its version output. macos: - needs: [prepare, macos-arm64-qt] + needs: [prepare, linux] + # Opt-in only -- see the two-tier note above. + if: >- + github.event_name == 'workflow_dispatch' || + contains(github.event.pull_request.labels.*.name, 'full-ci') uses: ./.github/workflows/build-macos.yml with: version: ${{ needs.prepare.outputs.version }} - hamlib_branch: "4.7.1" + hamlib_branch: "4.7.2" arch: "arm64" runner: "macos-15" deployment_target: "11.0" - secrets: inherit + recache: ${{ inputs.recache || false }} + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} macos-intel: - needs: [prepare, macos-intel-qt] + needs: [prepare, linux] + # Opt-in only -- see the two-tier note above. + if: >- + github.event_name == 'workflow_dispatch' || + contains(github.event.pull_request.labels.*.name, 'full-ci') uses: ./.github/workflows/build-macos.yml with: version: ${{ needs.prepare.outputs.version }} - hamlib_branch: "4.7.1" + hamlib_branch: "4.7.2" arch: "x86_64" runner: "macos-15-intel" deployment_target: "10.13" - secrets: inherit + recache: ${{ inputs.recache || false }} + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} linux: - needs: prepare + needs: [prepare] uses: ./.github/workflows/build-linux.yml with: version: ${{ needs.prepare.outputs.version }} - hamlib_branch: "4.7.1" + hamlib_branch: "4.7.2" arch: "x86_64" + image_tag: ${{ needs.prepare.outputs.linux_image_tag }} + allow_stale_image: true + recache: ${{ inputs.recache || false }} + save_ccache: ${{ needs.prepare.outputs.save_linux_ccache == 'true' }} + validate_fortran_fallback: ${{ github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'full-ci') }} + build_packages: ${{ needs.prepare.outputs.build_linux_packages == 'true' }} + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} secrets: inherit + linux-sanitizers: + name: Linux x86_64 ASan + UBSan + needs: [prepare, linux] + if: >- + contains(github.event.pull_request.labels.*.name, 'full-ci') || + contains(github.event.pull_request.labels.*.name, 'sanitizers') + uses: ./.github/workflows/build-linux-sanitizers.yml + with: + hamlib_branch: "4.7.2" + sanitizer: asan-ubsan + image_tag: ${{ needs.prepare.outputs.linux_image_tag }} + allow_stale_image: true + recache: ${{ inputs.recache || false }} + advisory: true + + linux-tsan: + name: Linux x86_64 TSan + needs: [prepare, linux] + if: contains(github.event.pull_request.labels.*.name, 'thread-sanitizer') + uses: ./.github/workflows/build-linux-sanitizers.yml + with: + hamlib_branch: "4.7.2" + sanitizer: tsan + recache: ${{ inputs.recache || false }} + advisory: true + linux-arm: - needs: prepare + needs: [prepare, linux] + # Opt-in only -- see the two-tier note above. + if: >- + github.event_name == 'workflow_dispatch' || + contains(github.event.pull_request.labels.*.name, 'full-ci') uses: ./.github/workflows/build-linux.yml with: version: ${{ needs.prepare.outputs.version }} - hamlib_branch: "4.7.1" + hamlib_branch: "4.7.2" arch: "aarch64" + image_tag: ${{ needs.prepare.outputs.linux_image_tag }} + allow_stale_image: true + recache: ${{ inputs.recache || false }} + save_ccache: ${{ needs.prepare.outputs.save_linux_ccache == 'true' }} + build_packages: ${{ needs.prepare.outputs.build_linux_packages == 'true' }} + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} + secrets: inherit + + linux-armhf: + needs: [prepare, linux] + # Opt-in only -- target tests and runtime validation execute under QEMU. + if: >- + github.event_name == 'workflow_dispatch' || + contains(github.event.pull_request.labels.*.name, 'full-ci') + uses: ./.github/workflows/build-linux.yml + with: + version: ${{ needs.prepare.outputs.version }} + hamlib_branch: "4.7.2" + arch: "armhf" + image_tag: ${{ needs.prepare.outputs.armhf_image_tag }} + allow_stale_image: true + recache: ${{ inputs.recache || false }} + save_ccache: ${{ needs.prepare.outputs.save_linux_ccache == 'true' }} + build_packages: ${{ needs.prepare.outputs.build_linux_packages == 'true' }} + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} secrets: inherit windows: - needs: prepare + needs: [prepare, linux] + # Opt-in only -- see the two-tier note above. + if: >- + github.event_name == 'workflow_dispatch' || + contains(github.event.pull_request.labels.*.name, 'full-ci') uses: ./.github/workflows/build-windows.yml with: version: ${{ needs.prepare.outputs.version }} - hamlib_branch: "4.7.1" - secrets: inherit + hamlib_branch: "4.7.2" + recache: ${{ inputs.recache || false }} + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} diff --git a/.github/workflows/hamlib-upstream-check.yml b/.github/workflows/hamlib-upstream-check.yml index 01add999..121babd1 100644 --- a/.github/workflows/hamlib-upstream-check.yml +++ b/.github/workflows/hamlib-upstream-check.yml @@ -12,9 +12,12 @@ permissions: jobs: check: + # Mirrored to the public repo at GA; upstream watch runs internal-only. + if: github.repository == 'WSJTX/wsjtx-internal' runs-on: ubuntu-latest + timeout-minutes: 10 steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@v7 with: persist-credentials: false @@ -90,10 +93,14 @@ jobs: Update \`hamlib_branch\` in: - - \`.github/workflows/ci.yml\` (five jobs) - - \`.github/workflows/release.yml\` (five jobs) + - \`.github/workflows/ci.yml\` (six target jobs) + - \`.github/workflows/release.yml\` (six target jobs) + - \`.github/scripts/linux-ci-image-config.sh\` + - \`.github/scripts/tsan-linux-deps-config.sh\` - Open a PR against \`develop\`, let CI run on all five platforms, then merge. + Update both exact commits, publish and validate a candidate Linux + image generation, update the remaining platform pins, then let CI run + on all six targets. ## Notes diff --git a/.github/workflows/prepare-macos-qt.yml b/.github/workflows/prepare-macos-qt.yml deleted file mode 100644 index de9f5fe5..00000000 --- a/.github/workflows/prepare-macos-qt.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Prepare macOS Qt - -on: - workflow_call: - inputs: - arch: - description: "Target architecture (arm64 or x86_64)" - required: true - type: string - runner: - description: "GitHub Actions runner label" - required: true - type: string - deployment_target: - description: "macOS deployment target version" - required: true - type: string - -jobs: - qt-cache-key: - runs-on: ubuntu-latest - outputs: - key: ${{ steps.qt-key.outputs.key }} - steps: - - uses: actions/checkout@v6 - - - name: Compute Qt cache key - id: qt-key - run: | - .github/scripts/macos-qt-cache-key.sh \ - --arch "${{ inputs.arch }}" \ - --runner "${{ inputs.runner }}" \ - --deployment-target "${{ inputs.deployment_target }}" \ - --github-output - - prepare: - needs: qt-cache-key - runs-on: ${{ inputs.runner }} - concurrency: - group: ${{ needs.qt-cache-key.outputs.key }} - cancel-in-progress: false - steps: - - uses: actions/checkout@v6 - - - name: Restore Qt cache - id: qt-cache - uses: actions/cache/restore@v5 - with: - path: qt-prefix - key: ${{ needs.qt-cache-key.outputs.key }} - - - name: Build Qt - if: steps.qt-cache.outputs.cache-hit != 'true' - run: | - .github/scripts/build-qt-macos.sh \ - --arch "${{ inputs.arch }}" \ - --deployment-target "${{ inputs.deployment_target }}" \ - --prefix "${GITHUB_WORKSPACE}/qt-prefix" - - - name: Verify Qt prefix - run: | - .github/scripts/verify-macos-artifacts.sh \ - --target "${{ inputs.deployment_target }}" \ - --arch "${{ inputs.arch }}" \ - --allow-prefix "${GITHUB_WORKSPACE}/qt-prefix" \ - "${GITHUB_WORKSPACE}/qt-prefix" - - - name: Save Qt cache - if: steps.qt-cache.outputs.cache-hit != 'true' - uses: actions/cache/save@v5 - with: - path: qt-prefix - key: ${{ needs.qt-cache-key.outputs.key }} diff --git a/.github/workflows/promote-release.yml b/.github/workflows/promote-release.yml new file mode 100644 index 00000000..9a3ccf6d --- /dev/null +++ b/.github/workflows/promote-release.yml @@ -0,0 +1,190 @@ +name: Promote Release Source + +on: + workflow_dispatch: + inputs: + version: + description: "Version without v (X.Y.Z or X.Y.Z-rcN)" + required: true + type: string + candidate_run_id: + description: "Successful Prepare Release Candidate workflow run" + required: true + type: string + operation: + description: "Validate only, or copy the exact source tag to the public repository" + required: true + type: choice + options: [validate, promote] + default: validate + +permissions: + actions: read + contents: read + +jobs: + validate: + runs-on: ubuntu-latest + timeout-minutes: 20 + outputs: + sha: ${{ steps.candidate.outputs.sha }} + public_tag: ${{ steps.candidate.outputs.public_tag }} + channel: ${{ steps.candidate.outputs.channel }} + prior_master: ${{ steps.public.outputs.prior_master }} + tag_exists: ${{ steps.public.outputs.tag_exists }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + fetch-depth: 0 + persist-credentials: false + - name: Validate candidate run and immutable tag + id: candidate + env: + GH_TOKEN: ${{ github.token }} + VERSION: ${{ inputs.version }} + RUN_ID: ${{ inputs.candidate_run_id }} + run: | + set -euo pipefail + if [[ ! "$RUN_ID" =~ ^[0-9]+$ ]]; then + echo "::error::candidate_run_id must be numeric" + exit 1 + fi + IDENTITY=$(python3 .github/scripts/release-policy.py classify "$VERSION") + BRANCH=$(jq -r .release_branch <<<"$IDENTITY") + CHANNEL=$(jq -r .channel <<<"$IDENTITY") + TAG="build/v$VERSION" + + RUN=$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$RUN_ID") + if [ "$(jq -r .path <<<"$RUN")" != ".github/workflows/release-tag-helper.yml" ] || \ + [ "$(jq -r .conclusion <<<"$RUN")" != success ]; then + echo "::error::Run $RUN_ID must be a successful release-tag-helper.yml run" + exit 1 + fi + RUN_SHA=$(jq -r .head_sha <<<"$RUN") + git fetch origin "+refs/tags/$TAG:refs/tags/$TAG" "+refs/heads/$BRANCH:refs/remotes/origin/$BRANCH" + TAG_SHA=$(git rev-parse "$TAG^{commit}") + if [ "$GITHUB_SHA" != "$TAG_SHA" ]; then + echo "::error::Run this workflow from $BRANCH at $TAG_SHA" + exit 1 + fi + if [ "$TAG_SHA" != "$RUN_SHA" ]; then + echo "::error::$TAG resolves to $TAG_SHA but run $RUN_ID built $RUN_SHA" + exit 1 + fi + BRANCH_SHA=$(git rev-parse "origin/$BRANCH^{commit}") + if [ "$TAG_SHA" != "$BRANCH_SHA" ]; then + echo "::error::$TAG is $TAG_SHA but the current $BRANCH tip is $BRANCH_SHA" + exit 1 + fi + git checkout --detach "$TAG_SHA" + python3 .github/scripts/release-policy.py validate-source "$VERSION" + + CANDIDATE_DIR="$RUNNER_TEMP/release-candidate" + gh run download "$RUN_ID" --name "release-candidate-$VERSION" --dir "$CANDIDATE_DIR" + PROVENANCE=$(find "$CANDIDATE_DIR" -name candidate-provenance.json -type f -print -quit) + if [ -z "$PROVENANCE" ]; then + echo "::error::Candidate provenance was not found in run $RUN_ID" + exit 1 + fi + test "$(jq -r .tag "$PROVENANCE")" = "$TAG" + test "$(jq -r .commit "$PROVENANCE")" = "$TAG_SHA" + test "$(jq -r .version "$PROVENANCE")" = "$VERSION" + { + echo "sha=$TAG_SHA" + echo "tag=$TAG" + echo "public_tag=v$VERSION" + echo "branch=$BRANCH" + echo "channel=$CHANNEL" + } >> "$GITHUB_OUTPUT" + + - name: Validate public ref state + id: public + env: + PUBLIC_TAG: ${{ steps.candidate.outputs.public_tag }} + SHA: ${{ steps.candidate.outputs.sha }} + run: | + set -euo pipefail + git remote add public https://github.com/WSJTX/wsjtx.git + PUBLIC_TAG_SHA=$(git ls-remote public "refs/tags/$PUBLIC_TAG^{}" | awk '{print $1}') + if [ -z "$PUBLIC_TAG_SHA" ]; then + PUBLIC_TAG_SHA=$(git ls-remote public "refs/tags/$PUBLIC_TAG" | awk '{print $1}') + fi + if [ -n "$PUBLIC_TAG_SHA" ] && [ "$PUBLIC_TAG_SHA" != "$SHA" ]; then + echo "::error::Public $PUBLIC_TAG already exists at $PUBLIC_TAG_SHA; tags are never moved" + exit 1 + fi + PRIOR_MASTER=$(git ls-remote public refs/heads/master | awk '{print $1}') + echo "tag_exists=$([ "$PUBLIC_TAG_SHA" = "$SHA" ] && echo true || echo false)" >> "$GITHUB_OUTPUT" + echo "prior_master=$PRIOR_MASTER" >> "$GITHUB_OUTPUT" + + - name: Summarize validation + env: + VERSION: ${{ inputs.version }} + RUN_ID: ${{ inputs.candidate_run_id }} + SHA: ${{ steps.candidate.outputs.sha }} + CHANNEL: ${{ steps.candidate.outputs.channel }} + PRIOR_MASTER: ${{ steps.public.outputs.prior_master }} + run: | + { + echo "## Public source validation" + echo + echo "- Version: \`$VERSION\` ($CHANNEL)" + echo "- Candidate run: [\`$RUN_ID\`]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$RUN_ID)" + echo "- Exact commit: \`$SHA\`" + echo "- Public tag: \`v$VERSION\`" + echo "- Prior public master: \`${PRIOR_MASTER:-}\`" + } >> "$GITHUB_STEP_SUMMARY" + + promote: + if: inputs.operation == 'promote' + needs: validate + runs-on: ubuntu-latest + timeout-minutes: 10 + environment: source-promotion + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + fetch-depth: 0 + ref: ${{ needs.validate.outputs.sha }} + persist-credentials: false + - name: Promote exact source commit + env: + TOKEN: ${{ secrets.CROSS_REPO_TOKEN }} + PUBLIC_TAG: ${{ needs.validate.outputs.public_tag }} + SHA: ${{ needs.validate.outputs.sha }} + CHANNEL: ${{ needs.validate.outputs.channel }} + PRIOR_MASTER: ${{ needs.validate.outputs.prior_master }} + TAG_EXISTS: ${{ needs.validate.outputs.tag_exists }} + run: | + set -euo pipefail + if [ -z "$TOKEN" ]; then + echo "::error::CROSS_REPO_TOKEN is required for source promotion" + exit 1 + fi + git remote add public "https://x-access-token:${TOKEN}@github.com/WSJTX/wsjtx.git" + CURRENT_TAG=$(git ls-remote public "refs/tags/$PUBLIC_TAG" | awk '{print $1}') + CURRENT_MASTER=$(git ls-remote public refs/heads/master | awk '{print $1}') + test "$CURRENT_MASTER" = "$PRIOR_MASTER" + if [ -n "$CURRENT_TAG" ] && [ "$CURRENT_TAG" != "$SHA" ]; then + echo "::error::$PUBLIC_TAG was created at a different commit after validation" + exit 1 + fi + if [ "$CHANNEL" = GA ] && [ -n "$PRIOR_MASTER" ]; then + git cat-file -e "$PRIOR_MASTER^{commit}" 2>/dev/null || git fetch public master + git merge-base --is-ancestor "$PRIOR_MASTER" "$SHA" || { + echo "::error::GA promotion must advance public master" + exit 1 + } + fi + if [ "$CHANNEL" = GA ] && [ -z "$CURRENT_TAG" ]; then + git push --atomic public \ + "$SHA:refs/heads/master" "$SHA:refs/tags/$PUBLIC_TAG" \ + --force-with-lease="refs/heads/master:$PRIOR_MASTER" + elif [ "$CHANNEL" = GA ]; then + git push public "$SHA:refs/heads/master" \ + --force-with-lease="refs/heads/master:$PRIOR_MASTER" + elif [ -z "$CURRENT_TAG" ]; then + git push public "$SHA:refs/tags/$PUBLIC_TAG" + else + echo "$PUBLIC_TAG already points to $SHA; promotion is idempotently satisfied." + fi diff --git a/.github/workflows/public-release.yml b/.github/workflows/public-release.yml new file mode 100644 index 00000000..14d4e611 --- /dev/null +++ b/.github/workflows/public-release.yml @@ -0,0 +1,389 @@ +name: Build and Publish Public Release + +on: + push: + tags: ["v*"] + +permissions: + contents: read + +concurrency: + group: public-release-${{ github.ref }} + cancel-in-progress: false + +jobs: + prepare: + if: github.repository == 'WSJTX/wsjtx' + runs-on: ubuntu-latest + timeout-minutes: 10 + outputs: + version: ${{ steps.identity.outputs.version }} + release_channel: ${{ steps.identity.outputs.channel }} + rc_number: ${{ steps.identity.outputs.rc_number }} + macos_sign_mode: ${{ steps.identity.outputs.macos_sign_mode }} + windows_signing: ${{ steps.identity.outputs.windows_signing }} + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + - name: Validate public release tag and source identity + id: identity + env: + MACOS_DISTRIBUTION_SIGNING_ENABLED: ${{ vars.MACOS_DISTRIBUTION_SIGNING_ENABLED }} + run: | + set -euo pipefail + if [[ ! "$GITHUB_REF_NAME" =~ ^v(.+)$ ]]; then + echo "::error::Expected vX.Y.Z or vX.Y.Z-rcN" + exit 1 + fi + VERSION="${GITHUB_REF_NAME#v}" + IDENTITY=$(python3 .github/scripts/release-policy.py validate-source "$VERSION") + { + echo "version=$(jq -r .version <<<"$IDENTITY")" + echo "channel=$(jq -r .channel <<<"$IDENTITY")" + echo "rc_number=$(jq -r .rc_number <<<"$IDENTITY")" + echo "windows_signing=$(jq -r .windows_signing <<<"$IDENTITY")" + } >> "$GITHUB_OUTPUT" + if [ "$MACOS_DISTRIBUTION_SIGNING_ENABLED" = true ]; then + echo "macos_sign_mode=distribution" >> "$GITHUB_OUTPUT" + else + echo "macos_sign_mode=validation" >> "$GITHUB_OUTPUT" + echo "::notice::macOS distribution signing is disabled. Validated packages will be published for manual replacement." + fi + + linux-images: + needs: prepare + uses: ./.github/workflows/publish-linux-ci-images.yml + permissions: + contents: read + packages: write + with: + publication_target: public-release + mode: refresh + promote: false + image_set: normal + include_armhf: true + + macos: + needs: prepare + uses: ./.github/workflows/build-macos.yml + permissions: + actions: read + contents: read + with: + version: ${{ needs.prepare.outputs.version }} + hamlib_branch: "4.7.2" + arch: arm64 + runner: macos-15 + deployment_target: "11.0" + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} + signing_mode: ${{ needs.prepare.outputs.macos_sign_mode }} + + macos-intel: + needs: prepare + uses: ./.github/workflows/build-macos.yml + permissions: + actions: read + contents: read + with: + version: ${{ needs.prepare.outputs.version }} + hamlib_branch: "4.7.2" + arch: x86_64 + runner: macos-15-intel + deployment_target: "10.13" + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} + signing_mode: ${{ needs.prepare.outputs.macos_sign_mode }} + + linux: + needs: [prepare, linux-images] + uses: ./.github/workflows/build-linux.yml + permissions: + actions: read + contents: read + packages: read + with: + version: ${{ needs.prepare.outputs.version }} + hamlib_branch: "4.7.2" + arch: x86_64 + image_source: public-release + image_tag: ${{ needs.linux-images.outputs.image_tag }} + image_digest: ${{ needs.linux-images.outputs.x86_64_digest }} + build_packages: true + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} + + linux-arm: + needs: [prepare, linux-images] + uses: ./.github/workflows/build-linux.yml + permissions: + actions: read + contents: read + packages: read + with: + version: ${{ needs.prepare.outputs.version }} + hamlib_branch: "4.7.2" + arch: aarch64 + image_source: public-release + image_tag: ${{ needs.linux-images.outputs.image_tag }} + image_digest: ${{ needs.linux-images.outputs.aarch64_digest }} + build_packages: true + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} + + linux-armhf: + needs: [prepare, linux-images] + uses: ./.github/workflows/build-linux.yml + permissions: + actions: read + contents: read + packages: read + with: + version: ${{ needs.prepare.outputs.version }} + hamlib_branch: "4.7.2" + arch: armhf + image_source: public-release + image_tag: ${{ needs.linux-images.outputs.image_tag }} + image_digest: ${{ needs.linux-images.outputs.armhf_digest }} + armhf_cross_image_digest: ${{ needs.linux-images.outputs.armhf_cross_digest }} + build_packages: true + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} + + windows: + needs: prepare + uses: ./.github/workflows/sign-windows-release.yml + permissions: + actions: read + contents: read + with: + version: ${{ needs.prepare.outputs.version }} + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} + windows_signing: ${{ needs.prepare.outputs.windows_signing }} + + assemble: + needs: [prepare, linux-images, macos, macos-intel, linux, linux-arm, linux-armhf, windows] + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + actions: read + contents: read + packages: read + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + - uses: actions/download-artifact@v8 + with: + path: artifacts + - name: Build corresponding source archive + env: + VERSION: ${{ needs.prepare.outputs.version }} + run: | + set -euo pipefail + git archive --format=tar --prefix="wsjtx-$VERSION/" "$GITHUB_SHA" | + gzip -n > "artifacts/wsjtx-$VERSION-src.tar.gz" + test -s "artifacts/wsjtx-$VERSION-src.tar.gz" + python3 .github/scripts/release-policy.py validate-archive "$VERSION" \ + "artifacts/wsjtx-$VERSION-src.tar.gz" --commit "$GITHUB_SHA" + - name: Verify GitHub automatic source archives + env: + VERSION: ${{ needs.prepare.outputs.version }} + run: | + set -euo pipefail + curl --fail --location --retry 3 \ + "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/archive/refs/tags/$GITHUB_REF_NAME.tar.gz" \ + --output "$RUNNER_TEMP/github-source.tar.gz" + curl --fail --location --retry 3 \ + "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/archive/refs/tags/$GITHUB_REF_NAME.zip" \ + --output "$RUNNER_TEMP/github-source.zip" + python3 .github/scripts/release-policy.py validate-archive "$VERSION" \ + "$RUNNER_TEMP/github-source.tar.gz" --commit "$GITHUB_SHA" + python3 .github/scripts/release-policy.py validate-archive "$VERSION" \ + "$RUNNER_TEMP/github-source.zip" --commit "$GITHUB_SHA" + - name: Verify public artifacts and signing reports + env: + VERSION: ${{ needs.prepare.outputs.version }} + MACOS_MODE: ${{ needs.prepare.outputs.macos_sign_mode }} + WINDOWS_MODE: ${{ needs.prepare.outputs.windows_signing }} + run: | + set -euo pipefail + python3 .github/scripts/release-policy.py verify-assets "$VERSION" artifacts \ + --macos-mode "$MACOS_MODE" --windows-mode "$WINDOWS_MODE" + python3 .github/scripts/release-policy.py verify-signing-reports "$VERSION" artifacts \ + --commit "$GITHUB_SHA" --tag "$GITHUB_REF_NAME" \ + --macos-mode "$MACOS_MODE" --windows-mode "$WINDOWS_MODE" + - name: Generate checksums and release manifest + env: + VERSION: ${{ needs.prepare.outputs.version }} + MACOS_MODE: ${{ needs.prepare.outputs.macos_sign_mode }} + WINDOWS_MODE: ${{ needs.prepare.outputs.windows_signing }} + run: | + python3 .github/scripts/release-policy.py write-manifest "$VERSION" artifacts \ + --repository "$GITHUB_REPOSITORY" \ + --commit "$GITHUB_SHA" \ + --run-id "$GITHUB_RUN_ID" \ + --linux-x86-64-digest "${{ needs.linux-images.outputs.x86_64_digest }}" \ + --linux-aarch64-digest "${{ needs.linux-images.outputs.aarch64_digest }}" \ + --linux-armhf-cross-digest "${{ needs.linux-images.outputs.armhf_cross_digest }}" \ + --linux-armhf-digest "${{ needs.linux-images.outputs.armhf_digest }}" \ + --macos-mode "$MACOS_MODE" --windows-mode "$WINDOWS_MODE" + - name: Assemble publication bundle + env: + VERSION: ${{ needs.prepare.outputs.version }} + MACOS_MODE: ${{ needs.prepare.outputs.macos_sign_mode }} + WINDOWS_MODE: ${{ needs.prepare.outputs.windows_signing }} + run: | + set -euo pipefail + mkdir -p release-bundle/verification + while IFS= read -r file; do + cp "$file" release-bundle/ + done < <(python3 .github/scripts/release-policy.py release-files "$VERSION" artifacts \ + --macos-mode "$MACOS_MODE" --windows-mode "$WINDOWS_MODE") + cp artifacts/SHA256SUMS artifacts/release-manifest.json release-bundle/ + cp -R artifacts/macos-signing-report-* release-bundle/verification/ + if [ "$WINDOWS_MODE" = signpath ]; then + cp -R artifacts/wsjtx-*-windows-signing-request \ + artifacts/wsjtx-*-windows-signing-verification \ + release-bundle/verification/ + fi + - name: Upload publication bundle for approval + uses: actions/upload-artifact@v7 + with: + name: release-bundle-${{ needs.prepare.outputs.version }} + path: release-bundle + if-no-files-found: error + retention-days: 30 + + publish: + needs: [prepare, assemble] + runs-on: ubuntu-latest + timeout-minutes: 20 + environment: public-release + permissions: + actions: read + contents: write + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + - uses: actions/download-artifact@v8 + with: + name: release-bundle-${{ needs.prepare.outputs.version }} + path: release-bundle + - name: Recheck bundle and immutable public tag + env: + VERSION: ${{ needs.prepare.outputs.version }} + MACOS_MODE: ${{ needs.prepare.outputs.macos_sign_mode }} + WINDOWS_MODE: ${{ needs.prepare.outputs.windows_signing }} + run: | + set -euo pipefail + (cd release-bundle && sha256sum --check SHA256SUMS) + test "$(jq -r .repository release-bundle/release-manifest.json)" = "$GITHUB_REPOSITORY" + test "$(jq -r .tag release-bundle/release-manifest.json)" = "$GITHUB_REF_NAME" + test "$(jq -r .commit release-bundle/release-manifest.json)" = "$GITHUB_SHA" + test "$(jq -r '.assets | length' release-bundle/release-manifest.json)" -gt 0 + EXPECTED_MACOS_MODE=distribution + if [ "$MACOS_MODE" = validation ]; then + EXPECTED_MACOS_MODE=manual + fi + test "$(jq -r .macos_signing.mode release-bundle/release-manifest.json)" = "$EXPECTED_MACOS_MODE" + test "$(jq -r .windows_signing.mode release-bundle/release-manifest.json)" = "$WINDOWS_MODE" + python3 .github/scripts/release-policy.py classify "$VERSION" >/dev/null + TAG_SHA=$(git ls-remote origin "refs/tags/$GITHUB_REF_NAME" | awk '{print $1}') + if [ "$TAG_SHA" != "$GITHUB_SHA" ]; then + echo "::error::$GITHUB_REF_NAME now resolves to ${TAG_SHA:-missing}, expected $GITHUB_SHA" + exit 1 + fi + - name: Publish public GitHub Release + env: + GH_TOKEN: ${{ github.token }} + VERSION: ${{ needs.prepare.outputs.version }} + CHANNEL: ${{ needs.prepare.outputs.release_channel }} + MACOS_MODE: ${{ needs.prepare.outputs.macos_sign_mode }} + run: | + set -euo pipefail + mapfile -t FILES < <(find release-bundle -maxdepth 1 -type f -print | sort) + mapfile -t EXPECTED_NAMES < <(printf '%s\n' "${FILES[@]}" | xargs -n1 basename | sort) + CREATED=false + if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then + RELEASE=$(gh release view "$GITHUB_REF_NAME" --json isDraft,isPrerelease,assets) + if [ "$(jq -r .isDraft <<<"$RELEASE")" != false ]; then + echo "::error::Existing release $GITHUB_REF_NAME is unexpectedly a draft." + exit 1 + fi + EXPECTED_PRERELEASE=false + if [ "$CHANNEL" = RC ]; then + EXPECTED_PRERELEASE=true + fi + if [ "$(jq -r .isPrerelease <<<"$RELEASE")" != "$EXPECTED_PRERELEASE" ]; then + echo "::error::Existing release $GITHUB_REF_NAME has the wrong prerelease state." + exit 1 + fi + mapfile -t ACTUAL_NAMES < <(jq -r '.assets[].name' <<<"$RELEASE" | sort) + EXTRA=$(comm -13 \ + <(printf '%s\n' "${EXPECTED_NAMES[@]}") \ + <(printf '%s\n' "${ACTUAL_NAMES[@]}") || true) + if [ -n "$EXTRA" ]; then + echo "::error::Existing release contains assets outside the publication bundle:" + printf '%s\n' "$EXTRA" + exit 1 + fi + mkdir -p "$RUNNER_TEMP/existing-assets" + MISSING=() + for file in "${FILES[@]}"; do + name=$(basename "$file") + if [ "$MACOS_MODE" = validation ] && [[ "$name" == wsjtx-*-macOS.pkg ]]; then + if printf '%s\n' "${ACTUAL_NAMES[@]}" | grep -Fxq "$name"; then + echo "Preserving manually replaceable macOS asset: $name" + else + MISSING+=("$file") + fi + continue + fi + if gh release download "$GITHUB_REF_NAME" --pattern "$name" --dir "$RUNNER_TEMP/existing-assets"; then + cmp "$file" "$RUNNER_TEMP/existing-assets/$name" || { + echo "::error::Published asset $name differs; automatic replacement is forbidden." + exit 1 + } + else + MISSING+=("$file") + fi + done + if [ "${#MISSING[@]}" -gt 0 ]; then + gh release upload "$GITHUB_REF_NAME" "${MISSING[@]}" + fi + mapfile -t FINAL_NAMES < <(gh release view "$GITHUB_REF_NAME" --json assets --jq '.assets[].name' | sort) + if ! diff -u \ + <(printf '%s\n' "${EXPECTED_NAMES[@]}") \ + <(printf '%s\n' "${FINAL_NAMES[@]}"); then + echo "::error::Published asset set does not match the publication bundle." + exit 1 + fi + echo "Existing assets satisfy the publication bundle policy." + else + FLAGS=() + if [ "$CHANNEL" = RC ]; then + FLAGS+=(--prerelease) + fi + gh release create "$GITHUB_REF_NAME" \ + --verify-tag \ + --title "WSJT-X $VERSION" \ + --generate-notes \ + "${FLAGS[@]}" \ + "${FILES[@]}" + CREATED=true + fi + if [ "$CREATED" = true ]; then + QUICK_DOWNLOADS=$(python3 .github/scripts/generate-quick-downloads.py \ + "$GITHUB_REPOSITORY" "$GITHUB_REF_NAME" "${FILES[@]}" || true) + if [ -n "$QUICK_DOWNLOADS" ]; then + GENERATED_NOTES=$(gh release view "$GITHUB_REF_NAME" --json body --jq .body) + printf '%s\n\n---\n\n%s\n' "$QUICK_DOWNLOADS" "$GENERATED_NOTES" > "$RUNNER_TEMP/release-notes.md" + gh release edit "$GITHUB_REF_NAME" --notes-file "$RUNNER_TEMP/release-notes.md" + else + echo "::warning::Quick Downloads picker was empty; generated notes were left unchanged." + fi + fi diff --git a/.github/workflows/publish-linux-ci-images.yml b/.github/workflows/publish-linux-ci-images.yml new file mode 100644 index 00000000..e1bc4c30 --- /dev/null +++ b/.github/workflows/publish-linux-ci-images.yml @@ -0,0 +1,632 @@ +name: Publish Linux CI Images + +on: + workflow_call: + inputs: + publication_target: + description: "Image destination: internal or public-release" + required: false + type: string + default: "internal" + mode: + description: "Refresh or rollback" + required: false + type: string + default: "refresh" + promote: + description: "Promote candidates after every validation succeeds" + required: false + type: boolean + default: true + rollback_tag: + description: "Retained validated-build-* tag to promote when mode is rollback" + required: false + type: string + default: "" + include_armhf: + description: "Build and validate the ARMHF cross-builder/runtime pair" + required: false + type: boolean + default: false + image_set: + description: "Image cohort: normal, tsan, or normal-and-tsan" + required: false + type: string + default: "normal" + outputs: + image_tag: + description: "Immutable tag shared by the published image cohort" + value: ${{ jobs.metadata.outputs.build_tag }} + x86_64_digest: + description: "Digest of the linux-noble release image" + value: ${{ jobs.build-normal.outputs.digest }} + aarch64_digest: + description: "Digest of the linux-arm64-bookworm release image" + value: ${{ jobs.build-arm64.outputs.digest }} + armhf_digest: + description: "Digest of the linux-armv7-bookworm release image" + value: ${{ jobs.build-armhf-runtime.outputs.digest }} + armhf_cross_digest: + description: "Digest of the linux-armhf-cross-bookworm release image" + value: ${{ jobs.build-armhf-cross.outputs.digest }} + workflow_dispatch: + inputs: + mode: + description: "Build a new generation or roll stable back to a retained tag" + required: true + type: choice + options: + - refresh + - rollback + default: refresh + promote: + description: "Promote candidates after every validation succeeds" + required: false + type: boolean + default: true + rollback_tag: + description: "Retained validated-build-* tag to promote when mode is rollback" + required: false + type: string + default: "" + include_armhf: + description: "Build and validate the ARMHF cross-builder/runtime pair" + required: false + type: boolean + default: false + image_set: + description: "Images to publish or roll back" + required: true + type: choice + options: + - normal + - tsan + - normal-and-tsan + default: normal + publication_target: + description: "Image destination" + required: true + type: choice + options: + - internal + - public-release + default: internal + +permissions: + contents: read + packages: write + +concurrency: + group: linux-ci-image-publishing + cancel-in-progress: false + +jobs: + validate-inputs: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - name: Validate publication request + env: + MODE: ${{ inputs.mode }} + ROLLBACK_TAG: ${{ inputs.rollback_tag }} + IMAGE_SET: ${{ inputs.image_set }} + INCLUDE_ARMHF: ${{ inputs.include_armhf }} + PROMOTE: ${{ inputs.promote }} + REQUEST_REF: ${{ github.ref }} + REQUEST_REPOSITORY: ${{ github.repository }} + PUBLICATION_TARGET: ${{ inputs.publication_target }} + shell: bash + run: | + case "$MODE" in + refresh) + if [ -n "$ROLLBACK_TAG" ]; then + echo "::error::rollback_tag must be empty in refresh mode" + exit 2 + fi + ;; + rollback) + if [[ ! "$ROLLBACK_TAG" =~ ^validated-build-[0-9]{8}-[0-9]+-[0-9]+$ ]]; then + echo "::error::rollback_tag must identify a validated retained generation" + exit 2 + fi + ;; + *) + echo "::error::Unsupported publication mode: $MODE" + exit 2 + ;; + esac + + case "$IMAGE_SET" in + normal|tsan|normal-and-tsan) ;; + *) + echo "::error::Unsupported image_set: $IMAGE_SET" + exit 2 + ;; + esac + + case "$PUBLICATION_TARGET" in + internal) ;; + public-release) + if [ "$REQUEST_REPOSITORY" != WSJTX/wsjtx ]; then + echo "::error::Public release images may only be published by WSJTX/wsjtx" + exit 2 + fi + if [[ ! "$REQUEST_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+(-rc[1-9][0-9]*)?$ ]]; then + echo "::error::Public release images require an exact vX.Y.Z or vX.Y.Z-rcN tag" + exit 2 + fi + if [ "$MODE" != refresh ] || [ "$PROMOTE" != false ] || \ + [ "$IMAGE_SET" != normal ] || [ "$INCLUDE_ARMHF" != true ]; then + echo "::error::Public release images require refresh, promote=false, image_set=normal, and include_armhf=true" + exit 2 + fi + ;; + *) + echo "::error::Unsupported publication_target: $PUBLICATION_TARGET" + exit 2 + ;; + esac + + if [ "$IMAGE_SET" = tsan ] && [ "$INCLUDE_ARMHF" = true ]; then + echo "::error::include_armhf is valid only when normal images are selected" + exit 2 + fi + + if { [ "$MODE" = rollback ] || [ "$PROMOTE" = true ]; } && \ + [ "$REQUEST_REF" != refs/heads/develop ]; then + echo "::error::Promotion and rollback must run from refs/heads/develop" + exit 2 + fi + + metadata: + if: inputs.mode != 'rollback' + needs: validate-inputs + runs-on: ubuntu-24.04 + timeout-minutes: 10 + outputs: + build_tag: ${{ steps.metadata.outputs.build_tag }} + candidate_tag: ${{ steps.metadata.outputs.candidate_tag }} + created: ${{ steps.metadata.outputs.created }} + version: ${{ steps.metadata.outputs.version }} + normal_hamlib_ref: ${{ steps.metadata.outputs.normal_hamlib_ref }} + tsan_hamlib_ref: ${{ steps.metadata.outputs.tsan_hamlib_ref }} + normal_noble_recipe: ${{ steps.metadata.outputs.normal_noble_recipe }} + normal_bookworm_recipe: ${{ steps.metadata.outputs.normal_bookworm_recipe }} + armhf_cross_recipe: ${{ steps.metadata.outputs.armhf_cross_recipe }} + armhf_runtime_recipe: ${{ steps.metadata.outputs.armhf_runtime_recipe }} + tsan_noble_recipe: ${{ steps.metadata.outputs.tsan_noble_recipe }} + refresh_epoch: ${{ steps.metadata.outputs.refresh_epoch }} + package_root: ${{ steps.metadata.outputs.package_root }} + normal_cache_from: ${{ steps.metadata.outputs.normal_cache_from }} + arm64_cache_from: ${{ steps.metadata.outputs.arm64_cache_from }} + armhf_cross_cache_from: ${{ steps.metadata.outputs.armhf_cross_cache_from }} + armhf_cache_from: ${{ steps.metadata.outputs.armhf_cache_from }} + steps: + - uses: actions/checkout@v7 + - id: metadata + env: + IMAGE_SET: ${{ inputs.image_set }} + PUBLICATION_TARGET: ${{ inputs.publication_target }} + shell: bash + run: | + created="$(date -u +%Y-%m-%dT%H:%M:%SZ)" + date_tag="$(date -u +%Y%m%d)" + version="$(awk -F= '$1 == "version" {print $2; exit}' release-state.txt)" + if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "::error::Could not derive a numeric version from release-state.txt" + exit 1 + fi + { + if [ "$PUBLICATION_TARGET" = public-release ]; then + release_tag="release-${GITHUB_REF_NAME}-${GITHUB_SHA}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" + echo "build_tag=$release_tag" + echo "candidate_tag=candidate-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" + echo "package_root=ghcr.io/wsjtx/wsjtx" + echo "normal_cache_from=type=gha,scope=public-release-linux-noble" + echo "arm64_cache_from=type=gha,scope=public-release-linux-arm64-bookworm" + echo "armhf_cross_cache_from=type=gha,scope=public-release-linux-armhf-cross-bookworm" + echo "armhf_cache_from=type=gha,scope=public-release-linux-armv7-bookworm" + else + echo "build_tag=build-${date_tag}-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" + echo "candidate_tag=candidate-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" + echo "package_root=ghcr.io/wsjtx/wsjtx-internal" + echo "normal_cache_from=type=registry,ref=ghcr.io/wsjtx/wsjtx-internal/linux-noble:stable" + echo "arm64_cache_from=type=registry,ref=ghcr.io/wsjtx/wsjtx-internal/linux-arm64-bookworm:stable" + echo "armhf_cross_cache_from=type=registry,ref=ghcr.io/wsjtx/wsjtx-internal/linux-armhf-cross-bookworm:stable" + echo "armhf_cache_from=type=registry,ref=ghcr.io/wsjtx/wsjtx-internal/linux-armv7-bookworm:stable" + fi + echo "created=$created" + echo "version=$version" + echo "refresh_epoch=$(date -u +%Y-%m)" + if [ "$IMAGE_SET" != tsan ]; then + . .github/scripts/linux-ci-image-config.sh + echo "normal_hamlib_ref=$LINUX_HAMLIB_REF" + echo "normal_noble_recipe=$(.github/scripts/linux-ci-image-fingerprint.sh normal-noble)" + echo "normal_bookworm_recipe=$(.github/scripts/linux-ci-image-fingerprint.sh normal-bookworm)" + echo "armhf_cross_recipe=$(.github/scripts/linux-ci-image-fingerprint.sh armhf-cross-bookworm)" + echo "armhf_runtime_recipe=$(.github/scripts/linux-ci-image-fingerprint.sh armhf-runtime-bookworm)" + fi + if [ "$IMAGE_SET" != normal ]; then + . .github/scripts/tsan-linux-deps-config.sh + echo "tsan_hamlib_ref=$TSAN_HAMLIB_REF" + echo "tsan_noble_recipe=$(.github/scripts/linux-ci-image-fingerprint.sh tsan-noble)" + fi + } >> "$GITHUB_OUTPUT" + + build-normal: + if: inputs.image_set == 'normal' || inputs.image_set == 'normal-and-tsan' + needs: metadata + runs-on: ubuntu-24.04 + timeout-minutes: 120 + outputs: + digest: ${{ steps.build.outputs.digest }} + steps: + - uses: actions/checkout@v7 + - uses: docker/setup-buildx-action@v4 + - uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - id: build + uses: docker/build-push-action@v7 + with: + context: . + file: .github/images/linux-ci/Dockerfile.noble + target: normal + platforms: linux/amd64 + push: true + provenance: false + sbom: false + labels: ${{ inputs.publication_target == 'public-release' && 'org.opencontainers.image.source=https://github.com/WSJTX/wsjtx' || '' }} + tags: | + ${{ needs.metadata.outputs.package_root }}/linux-noble:${{ needs.metadata.outputs.candidate_tag }} + ${{ needs.metadata.outputs.package_root }}/linux-noble:${{ needs.metadata.outputs.build_tag }} + build-args: | + IMAGE_CREATED=${{ needs.metadata.outputs.created }} + IMAGE_GENERATION=${{ needs.metadata.outputs.build_tag }} + IMAGE_REVISION=${{ github.sha }} + IMAGE_RECIPE_SHA256=${{ needs.metadata.outputs.normal_noble_recipe }} + IMAGE_REFRESH_EPOCH=${{ needs.metadata.outputs.refresh_epoch }} + cache-from: ${{ needs.metadata.outputs.normal_cache_from }} + cache-to: type=inline + + build-tsan: + if: inputs.image_set == 'tsan' || inputs.image_set == 'normal-and-tsan' + needs: metadata + runs-on: ubuntu-24.04 + timeout-minutes: 240 + outputs: + digest: ${{ steps.build.outputs.digest }} + steps: + - uses: actions/checkout@v7 + - uses: docker/setup-buildx-action@v4 + - uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - id: build + uses: docker/build-push-action@v7 + with: + context: . + file: .github/images/linux-ci/Dockerfile.noble + target: tsan + platforms: linux/amd64 + push: true + provenance: false + sbom: false + labels: ${{ inputs.publication_target == 'public-release' && 'org.opencontainers.image.source=https://github.com/WSJTX/wsjtx' || '' }} + tags: | + ghcr.io/wsjtx/wsjtx-internal/linux-tsan-noble:${{ needs.metadata.outputs.candidate_tag }} + ghcr.io/wsjtx/wsjtx-internal/linux-tsan-noble:${{ needs.metadata.outputs.build_tag }} + build-args: | + IMAGE_CREATED=${{ needs.metadata.outputs.created }} + IMAGE_GENERATION=${{ needs.metadata.outputs.build_tag }} + IMAGE_REVISION=${{ github.sha }} + IMAGE_RECIPE_SHA256=${{ needs.metadata.outputs.tsan_noble_recipe }} + IMAGE_REFRESH_EPOCH=${{ needs.metadata.outputs.refresh_epoch }} + cache-from: type=registry,ref=ghcr.io/wsjtx/wsjtx-internal/linux-tsan-noble:stable + cache-to: type=inline + + build-arm64: + if: inputs.image_set == 'normal' || inputs.image_set == 'normal-and-tsan' + needs: metadata + runs-on: ubuntu-24.04-arm + timeout-minutes: 120 + outputs: + digest: ${{ steps.build.outputs.digest }} + steps: + - uses: actions/checkout@v7 + - uses: docker/setup-buildx-action@v4 + - uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - id: build + uses: docker/build-push-action@v7 + with: + context: . + file: .github/images/linux-ci/Dockerfile.bookworm + platforms: linux/arm64 + push: true + provenance: false + sbom: false + labels: ${{ inputs.publication_target == 'public-release' && 'org.opencontainers.image.source=https://github.com/WSJTX/wsjtx' || '' }} + tags: | + ${{ needs.metadata.outputs.package_root }}/linux-arm64-bookworm:${{ needs.metadata.outputs.candidate_tag }} + ${{ needs.metadata.outputs.package_root }}/linux-arm64-bookworm:${{ needs.metadata.outputs.build_tag }} + build-args: | + IMAGE_ARCH=aarch64 + IMAGE_CREATED=${{ needs.metadata.outputs.created }} + IMAGE_GENERATION=${{ needs.metadata.outputs.build_tag }} + IMAGE_REVISION=${{ github.sha }} + IMAGE_RECIPE_SHA256=${{ needs.metadata.outputs.normal_bookworm_recipe }} + IMAGE_REFRESH_EPOCH=${{ needs.metadata.outputs.refresh_epoch }} + cache-from: ${{ needs.metadata.outputs.arm64_cache_from }} + cache-to: type=inline + + build-armhf-cross: + if: >- + inputs.include_armhf && + (inputs.image_set == 'normal' || inputs.image_set == 'normal-and-tsan') + needs: metadata + runs-on: ubuntu-24.04 + timeout-minutes: 180 + outputs: + digest: ${{ steps.build.outputs.digest }} + steps: + - uses: actions/checkout@v7 + - name: Reclaim disk for the ARMHF cross-toolchain + run: | + # crosstool-NG needs about 8 GiB of transient build storage. Remove + # unused hosted-runner SDKs so the Actions worker retains log space. + df -h / + sudo rm -rf -- /usr/local/lib/android /usr/share/dotnet /opt/ghc + df -h / + - uses: docker/setup-buildx-action@v4 + - uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - id: build + uses: docker/build-push-action@v7 + with: + context: . + file: .github/images/linux-ci/Dockerfile.armhf-cross + platforms: linux/amd64 + push: true + provenance: false + sbom: false + labels: ${{ inputs.publication_target == 'public-release' && 'org.opencontainers.image.source=https://github.com/WSJTX/wsjtx' || '' }} + tags: | + ${{ needs.metadata.outputs.package_root }}/linux-armhf-cross-bookworm:${{ needs.metadata.outputs.candidate_tag }} + ${{ needs.metadata.outputs.package_root }}/linux-armhf-cross-bookworm:${{ needs.metadata.outputs.build_tag }} + build-args: | + IMAGE_CREATED=${{ needs.metadata.outputs.created }} + IMAGE_GENERATION=${{ needs.metadata.outputs.build_tag }} + IMAGE_REVISION=${{ github.sha }} + IMAGE_RECIPE_SHA256=${{ needs.metadata.outputs.armhf_cross_recipe }} + IMAGE_REFRESH_EPOCH=${{ needs.metadata.outputs.refresh_epoch }} + cache-from: ${{ needs.metadata.outputs.armhf_cross_cache_from }} + cache-to: type=inline + + build-armhf-runtime: + if: >- + inputs.include_armhf && + (inputs.image_set == 'normal' || inputs.image_set == 'normal-and-tsan') + needs: + - metadata + - build-armhf-cross + runs-on: ubuntu-24.04-arm + timeout-minutes: 180 + outputs: + digest: ${{ steps.build.outputs.digest }} + steps: + - uses: actions/checkout@v7 + - uses: docker/setup-qemu-action@v4 + with: + image: tonistiigi/binfmt:qemu-v10.2.3-68@sha256:400a4873b838d1b89194d982c45e5fb3cda4593fbfd7e08a02e76b03b21166f0 + platforms: linux/arm/v7 + - uses: docker/setup-buildx-action@v4 + - uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - id: build + uses: docker/build-push-action@v7 + with: + context: . + file: .github/images/linux-ci/Dockerfile.armhf-runtime + platforms: linux/arm/v7 + push: true + provenance: false + sbom: false + labels: ${{ inputs.publication_target == 'public-release' && 'org.opencontainers.image.source=https://github.com/WSJTX/wsjtx' || '' }} + tags: | + ${{ needs.metadata.outputs.package_root }}/linux-armv7-bookworm:${{ needs.metadata.outputs.candidate_tag }} + ${{ needs.metadata.outputs.package_root }}/linux-armv7-bookworm:${{ needs.metadata.outputs.build_tag }} + build-args: | + CROSS_BUILDER_IMAGE=${{ needs.metadata.outputs.package_root }}/linux-armhf-cross-bookworm:${{ needs.metadata.outputs.build_tag }} + IMAGE_CREATED=${{ needs.metadata.outputs.created }} + IMAGE_GENERATION=${{ needs.metadata.outputs.build_tag }} + IMAGE_REVISION=${{ github.sha }} + IMAGE_RECIPE_SHA256=${{ needs.metadata.outputs.armhf_runtime_recipe }} + IMAGE_REFRESH_EPOCH=${{ needs.metadata.outputs.refresh_epoch }} + cache-from: ${{ needs.metadata.outputs.armhf_cache_from }} + cache-to: type=inline + + warm-normal-ccache: + if: >- + inputs.promote && + (inputs.image_set == 'normal' || inputs.image_set == 'normal-and-tsan') + needs: + - metadata + - build-normal + uses: ./.github/workflows/build-linux.yml + permissions: + contents: read + packages: read + with: + version: ${{ needs.metadata.outputs.version }} + hamlib_branch: ${{ needs.metadata.outputs.normal_hamlib_ref }} + arch: x86_64 + image_tag: ${{ needs.metadata.outputs.build_tag }} + allow_stale_image: false + recache: false + save_ccache: true + + warm-arm64-ccache: + if: >- + inputs.promote && + (inputs.image_set == 'normal' || inputs.image_set == 'normal-and-tsan') + needs: + - metadata + - build-arm64 + uses: ./.github/workflows/build-linux.yml + permissions: + contents: read + packages: read + with: + version: ${{ needs.metadata.outputs.version }} + hamlib_branch: ${{ needs.metadata.outputs.normal_hamlib_ref }} + arch: aarch64 + image_tag: ${{ needs.metadata.outputs.build_tag }} + allow_stale_image: false + recache: false + save_ccache: true + + promote: + if: >- + always() && inputs.mode == 'refresh' && inputs.promote && + (inputs.image_set == 'tsan' || + (needs.build-normal.result == 'success' && + needs.build-arm64.result == 'success' && + needs.warm-normal-ccache.result == 'success' && + needs.warm-arm64-ccache.result == 'success' && + (inputs.include_armhf == false || + (needs.build-armhf-cross.result == 'success' && needs.build-armhf-runtime.result == 'success')))) && + (inputs.image_set == 'normal' || needs.build-tsan.result == 'success') + needs: + - metadata + - build-normal + - build-tsan + - build-arm64 + - build-armhf-cross + - build-armhf-runtime + - warm-normal-ccache + - warm-arm64-ccache + runs-on: ubuntu-24.04 + timeout-minutes: 15 + steps: + - uses: docker/setup-buildx-action@v4 + - uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Promote validated image digests + env: + VALIDATED_TAG: validated-${{ needs.metadata.outputs.build_tag }} + INCLUDE_ARMHF: ${{ inputs.include_armhf }} + IMAGE_SET: ${{ inputs.image_set }} + shell: bash + run: | + if [ "$IMAGE_SET" != tsan ]; then + docker buildx imagetools create --prefer-index=false \ + --tag "ghcr.io/wsjtx/wsjtx-internal/linux-noble:${VALIDATED_TAG}" \ + ghcr.io/wsjtx/wsjtx-internal/linux-noble@${{ needs.build-normal.outputs.digest }} + docker buildx imagetools create --prefer-index=false \ + --tag "ghcr.io/wsjtx/wsjtx-internal/linux-arm64-bookworm:${VALIDATED_TAG}" \ + ghcr.io/wsjtx/wsjtx-internal/linux-arm64-bookworm@${{ needs.build-arm64.outputs.digest }} + if [ "$INCLUDE_ARMHF" = true ]; then + docker buildx imagetools create --prefer-index=false \ + --tag "ghcr.io/wsjtx/wsjtx-internal/linux-armhf-cross-bookworm:${VALIDATED_TAG}" \ + ghcr.io/wsjtx/wsjtx-internal/linux-armhf-cross-bookworm@${{ needs.build-armhf-cross.outputs.digest }} + docker buildx imagetools create --prefer-index=false \ + --tag "ghcr.io/wsjtx/wsjtx-internal/linux-armv7-bookworm:${VALIDATED_TAG}" \ + ghcr.io/wsjtx/wsjtx-internal/linux-armv7-bookworm@${{ needs.build-armhf-runtime.outputs.digest }} + fi + fi + if [ "$IMAGE_SET" != normal ]; then + docker buildx imagetools create --prefer-index=false \ + --tag "ghcr.io/wsjtx/wsjtx-internal/linux-tsan-noble:${VALIDATED_TAG}" \ + ghcr.io/wsjtx/wsjtx-internal/linux-tsan-noble@${{ needs.build-tsan.outputs.digest }} + fi + + if [ "$IMAGE_SET" != normal ]; then + docker buildx imagetools create --prefer-index=false \ + --tag ghcr.io/wsjtx/wsjtx-internal/linux-tsan-noble:stable \ + ghcr.io/wsjtx/wsjtx-internal/linux-tsan-noble@${{ needs.build-tsan.outputs.digest }} + fi + if [ "$IMAGE_SET" != tsan ]; then + docker buildx imagetools create --prefer-index=false \ + --tag ghcr.io/wsjtx/wsjtx-internal/linux-arm64-bookworm:stable \ + ghcr.io/wsjtx/wsjtx-internal/linux-arm64-bookworm@${{ needs.build-arm64.outputs.digest }} + if [ "$INCLUDE_ARMHF" = true ]; then + docker buildx imagetools create --prefer-index=false \ + --tag ghcr.io/wsjtx/wsjtx-internal/linux-armhf-cross-bookworm:stable \ + ghcr.io/wsjtx/wsjtx-internal/linux-armhf-cross-bookworm@${{ needs.build-armhf-cross.outputs.digest }} + docker buildx imagetools create --prefer-index=false \ + --tag ghcr.io/wsjtx/wsjtx-internal/linux-armv7-bookworm:stable \ + ghcr.io/wsjtx/wsjtx-internal/linux-armv7-bookworm@${{ needs.build-armhf-runtime.outputs.digest }} + fi + # linux-noble:stable moves last within the normal image cohort. + docker buildx imagetools create --prefer-index=false \ + --tag ghcr.io/wsjtx/wsjtx-internal/linux-noble:stable \ + ghcr.io/wsjtx/wsjtx-internal/linux-noble@${{ needs.build-normal.outputs.digest }} + fi + + rollback: + if: inputs.mode == 'rollback' + needs: validate-inputs + runs-on: ubuntu-24.04 + timeout-minutes: 15 + steps: + - uses: docker/setup-buildx-action@v4 + - uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Restore retained generation + env: + ROLLBACK_TAG: ${{ inputs.rollback_tag }} + INCLUDE_ARMHF: ${{ inputs.include_armhf }} + IMAGE_SET: ${{ inputs.image_set }} + shell: bash + run: | + packages=() + stable_packages=() + if [ "$IMAGE_SET" != tsan ]; then + packages+=(linux-noble linux-arm64-bookworm) + stable_packages+=(linux-arm64-bookworm) + if [ "$INCLUDE_ARMHF" = true ]; then + packages+=(linux-armhf-cross-bookworm linux-armv7-bookworm) + stable_packages+=(linux-armhf-cross-bookworm linux-armv7-bookworm) + fi + # linux-noble:stable moves last within the normal image cohort. + stable_packages+=(linux-noble) + fi + if [ "$IMAGE_SET" != normal ]; then + packages+=(linux-tsan-noble) + if [ "$IMAGE_SET" = tsan ]; then + stable_packages=(linux-tsan-noble) + else + stable_packages=(linux-tsan-noble "${stable_packages[@]}") + fi + fi + + for package in "${packages[@]}"; do + docker buildx imagetools inspect \ + "ghcr.io/wsjtx/wsjtx-internal/${package}:${ROLLBACK_TAG}" >/dev/null + done + + for package in "${stable_packages[@]}"; do + docker buildx imagetools create --prefer-index=false \ + --tag "ghcr.io/wsjtx/wsjtx-internal/${package}:stable" \ + "ghcr.io/wsjtx/wsjtx-internal/${package}:${ROLLBACK_TAG}" + done diff --git a/.github/workflows/release-tag-helper.yml b/.github/workflows/release-tag-helper.yml new file mode 100644 index 00000000..c8cc375e --- /dev/null +++ b/.github/workflows/release-tag-helper.yml @@ -0,0 +1,126 @@ +name: Prepare Release Candidate + +on: + workflow_dispatch: + inputs: + version: + description: "Version without v (X.Y.Z or X.Y.Z-rcN)" + required: true + type: string + expected_sha: + description: "Full SHA at the tip of release/X.Y" + required: true + type: string + operation: + description: "Validate only, or create the immutable candidate tag and start its build" + required: true + type: choice + options: [validate, create] + default: validate + +permissions: + actions: read + contents: write + +jobs: + prepare: + runs-on: ubuntu-latest + timeout-minutes: 15 + environment: candidate-tagging + outputs: + candidate_tag: ${{ steps.validate.outputs.candidate_tag }} + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + - name: Fetch release branches and tags + run: git fetch origin '+refs/heads/release/*:refs/remotes/origin/release/*' '+refs/tags/*:refs/tags/*' + - name: Validate release commit + id: validate + env: + GH_TOKEN: ${{ github.token }} + VERSION: ${{ inputs.version }} + EXPECTED_SHA: ${{ inputs.expected_sha }} + run: | + set -euo pipefail + if [[ ! "$EXPECTED_SHA" =~ ^[0-9a-f]{40}$ ]]; then + echo "::error::expected_sha must be a full 40-character lowercase commit SHA" + exit 1 + fi + IDENTITY=$(python3 .github/scripts/release-policy.py classify "$VERSION") + BRANCH=$(jq -r .release_branch <<<"$IDENTITY") + if [ "$GITHUB_SHA" != "$EXPECTED_SHA" ]; then + echo "::error::Run this workflow from $BRANCH at $EXPECTED_SHA" + exit 1 + fi + BRANCH_SHA=$(git rev-parse --verify --quiet "refs/remotes/origin/$BRANCH^{commit}" || true) + if [ "$BRANCH_SHA" != "$EXPECTED_SHA" ]; then + echo "::error::$BRANCH tip is ${BRANCH_SHA:-missing}, expected $EXPECTED_SHA" + exit 1 + fi + git checkout --detach "$EXPECTED_SHA" + python3 .github/scripts/release-policy.py validate-source "$VERSION" + + CI_RUN=$(gh api "repos/$GITHUB_REPOSITORY/actions/workflows/ci.yml/runs?head_sha=$EXPECTED_SHA&status=completed&per_page=20" \ + --jq '.workflow_runs | sort_by(.created_at) | reverse | .[0]') + if [ -z "$CI_RUN" ] || [ "$CI_RUN" = null ]; then + echo "::error::No completed ci.yml run found for $EXPECTED_SHA" + exit 1 + fi + CI_ID=$(jq -r .id <<<"$CI_RUN") + CI_CONCLUSION=$(jq -r .conclusion <<<"$CI_RUN") + if [ "$CI_CONCLUSION" != success ]; then + echo "::error::Latest ci.yml run $CI_ID concluded $CI_CONCLUSION" + exit 1 + fi + { + echo "branch=$BRANCH" + echo "ci_run_id=$CI_ID" + echo "candidate_tag=build/v$VERSION" + } >> "$GITHUB_OUTPUT" + + - name: Verify candidate tag is create-only + id: tag + env: + VERSION: ${{ inputs.version }} + EXPECTED_SHA: ${{ inputs.expected_sha }} + run: | + .github/scripts/check-candidate-tag.sh "build/v$VERSION" "$EXPECTED_SHA" >> "$GITHUB_OUTPUT" + + - name: Create candidate tag + if: inputs.operation == 'create' && steps.tag.outputs.exists != 'true' + env: + VERSION: ${{ inputs.version }} + EXPECTED_SHA: ${{ inputs.expected_sha }} + run: | + git tag "build/v$VERSION" "$EXPECTED_SHA" + git push origin "refs/tags/build/v$VERSION:refs/tags/build/v$VERSION" + + - name: Summarize candidate preparation + env: + VERSION: ${{ inputs.version }} + EXPECTED_SHA: ${{ inputs.expected_sha }} + OPERATION: ${{ inputs.operation }} + BRANCH: ${{ steps.validate.outputs.branch }} + CI_RUN_ID: ${{ steps.validate.outputs.ci_run_id }} + run: | + { + echo "## Release candidate preparation" + echo + echo "- Version: \`$VERSION\`" + echo "- Commit: \`$EXPECTED_SHA\`" + echo "- Release branch: \`$BRANCH\`" + echo "- CI run: [\`$CI_RUN_ID\`]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$CI_RUN_ID)" + echo "- Operation: \`$OPERATION\`" + } >> "$GITHUB_STEP_SUMMARY" + + candidate: + if: inputs.operation == 'create' + needs: prepare + permissions: + contents: read + packages: read + uses: ./.github/workflows/release.yml + with: + candidate_tag: ${{ needs.prepare.outputs.candidate_tag }} + expected_sha: ${{ inputs.expected_sha }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a8b9bd42..bde30629 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,359 +1,191 @@ -name: Release +name: Build Release Candidate on: - push: - tags: ["build/v*"] + workflow_call: + inputs: + candidate_tag: + description: "Immutable internal tag (build/vX.Y.Z or build/vX.Y.Z-rcN)" + required: true + type: string + expected_sha: + description: "Full commit SHA selected by the release tag helper" + required: true + type: string + +permissions: + contents: read + packages: read + +concurrency: + group: release-candidate-${{ inputs.candidate_tag }} + cancel-in-progress: false jobs: - # ── Derive the version string once from the pushed tag ──────────── - # Strips the "build/v" prefix so artifacts are named "wsjtx-3.0.1-rc1-*" - # rather than "wsjtx-build/v3.0.1-rc1-*". RC/beta suffixes (e.g. - # build/v3.0.1-rc1 → 3.0.1-rc1) are preserved so pre-release artifacts - # are distinguishable from GA. All downstream jobs consume this - # single output so the five platform artifacts cannot disagree. prepare: runs-on: ubuntu-latest + timeout-minutes: 10 outputs: - version: ${{ steps.v.outputs.version }} - release_channel: ${{ steps.v.outputs.release_channel }} - rc_number: ${{ steps.v.outputs.rc_number }} + version: ${{ steps.identity.outputs.version }} + release_channel: ${{ steps.identity.outputs.channel }} + rc_number: ${{ steps.identity.outputs.rc_number }} + windows_signing: ${{ steps.identity.outputs.windows_signing }} + linux_image_tag: ${{ steps.linux-image.outputs.image_tag }} + armhf_image_tag: ${{ steps.armhf-image.outputs.image_tag }} + env: + CANDIDATE_TAG: ${{ inputs.candidate_tag }} + EXPECTED_SHA: ${{ inputs.expected_sha }} steps: - - uses: actions/checkout@v6 - - id: v + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + ref: ${{ env.CANDIDATE_TAG }} + - name: Verify immutable candidate identity + id: identity run: | - VERSION="${GITHUB_REF_NAME#build/v}" - if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - RELEASE_CHANNEL=GA - RC_NUMBER="" - elif [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-rc([1-9][0-9]*)$ ]]; then - RELEASE_CHANNEL=RC - RC_NUMBER="${BASH_REMATCH[1]}" - else - echo "::error::Unsupported release tag version: $VERSION" - echo "::error::Supported release tags are build/vX.Y.Z and build/vX.Y.Z-rcN." + set -euo pipefail + if [[ ! "$CANDIDATE_TAG" =~ ^build/v(.+)$ ]]; then + echo "::error::Expected build/vX.Y.Z or build/vX.Y.Z-rcN, got $CANDIDATE_TAG" exit 1 fi - - { - echo "version=$VERSION" - echo "release_channel=$RELEASE_CHANNEL" - echo "rc_number=$RC_NUMBER" - } >> "$GITHUB_OUTPUT" - - # Enforce that the pushed tag's numeric version base - # matches CMakeLists.txt:55 VERSION (first 3 components). CMake's - # VERSION field is numeric-only and cannot carry pre-release - # suffixes like -rc1 or -beta1, so this check compares the tag - # version stripped of any `-` against the first three - # dotted components of CMakeLists.txt VERSION. Mismatch means the - # release commit forgot to bump CMakeLists.txt in lockstep with - # the tag; fail fast here before five platform builds burn ~30 - # minutes of CI. - - name: Verify tag ↔ CMakeLists.txt version parity - run: | - TAG_VERSION="${GITHUB_REF_NAME#build/v}" - TAG_NUMERIC="${TAG_VERSION%%-*}" - CMAKE_VERSION=$(sed -nE 's/^[[:space:]]*VERSION[[:space:]]+([0-9][0-9.]*).*/\1/p' CMakeLists.txt | head -1) - CMAKE_NUMERIC=$(echo "$CMAKE_VERSION" | awk -F. '{printf "%s.%s.%s", $1, $2, $3}') - echo "Tag version: $TAG_VERSION (numeric base: $TAG_NUMERIC)" - echo "CMakeLists.txt VER: $CMAKE_VERSION (first 3 components: $CMAKE_NUMERIC)" - if [ "$TAG_NUMERIC" != "$CMAKE_NUMERIC" ]; then - echo "::error::Tag numeric base ($TAG_NUMERIC) != CMakeLists.txt VERSION first 3 components ($CMAKE_NUMERIC)." - echo "::error::Bump CMakeLists.txt:55 VERSION in the same commit that gets tagged, then retry." + ACTUAL_SHA=$(git rev-parse HEAD) + if [ "$ACTUAL_SHA" != "$EXPECTED_SHA" ]; then + echo "::error::Candidate tag resolves to $ACTUAL_SHA, expected $EXPECTED_SHA" exit 1 fi - echo "Parity check PASSED." - - # ── Build all five platforms ─────────────────────────────────────── - macos-arm64-qt: - needs: prepare - uses: ./.github/workflows/prepare-macos-qt.yml - with: - arch: "arm64" - runner: "macos-15" - deployment_target: "11.0" - - macos-intel-qt: - needs: prepare - uses: ./.github/workflows/prepare-macos-qt.yml - with: - arch: "x86_64" - runner: "macos-15-intel" - deployment_target: "10.13" + VERSION="${CANDIDATE_TAG#build/v}" + IDENTITY=$(python3 .github/scripts/release-policy.py validate-source "$VERSION") + { + echo "version=$(jq -r .version <<<"$IDENTITY")" + echo "channel=$(jq -r .channel <<<"$IDENTITY")" + echo "rc_number=$(jq -r .rc_number <<<"$IDENTITY")" + echo "windows_signing=$(jq -r .windows_signing <<<"$IDENTITY")" + } >> "$GITHUB_OUTPUT" + - id: linux-image + name: Resolve Linux CI image generation + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: .github/scripts/resolve-linux-ci-image-tag.py + - id: armhf-image + name: Resolve armhf CI image generation + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RESOLVE_ARMHF: true + run: .github/scripts/resolve-linux-ci-image-tag.py macos: - needs: [prepare, macos-arm64-qt] + needs: prepare uses: ./.github/workflows/build-macos.yml with: version: ${{ needs.prepare.outputs.version }} - hamlib_branch: "4.7.1" - arch: "arm64" - runner: "macos-15" + hamlib_branch: "4.7.2" + arch: arm64 + runner: macos-15 deployment_target: "11.0" release_channel: ${{ needs.prepare.outputs.release_channel }} rc_number: ${{ needs.prepare.outputs.rc_number }} - secrets: inherit + signing_mode: validation macos-intel: - needs: [prepare, macos-intel-qt] + needs: prepare uses: ./.github/workflows/build-macos.yml with: version: ${{ needs.prepare.outputs.version }} - hamlib_branch: "4.7.1" - arch: "x86_64" + hamlib_branch: "4.7.2" + arch: x86_64 + runner: macos-15-intel + deployment_target: "10.13" release_channel: ${{ needs.prepare.outputs.release_channel }} rc_number: ${{ needs.prepare.outputs.rc_number }} - runner: "macos-15-intel" - deployment_target: "10.13" - secrets: inherit + signing_mode: validation linux: needs: prepare uses: ./.github/workflows/build-linux.yml with: version: ${{ needs.prepare.outputs.version }} - hamlib_branch: "4.7.1" - arch: "x86_64" + hamlib_branch: "4.7.2" + arch: x86_64 + image_tag: ${{ needs.prepare.outputs.linux_image_tag }} + save_ccache: true + build_packages: true release_channel: ${{ needs.prepare.outputs.release_channel }} rc_number: ${{ needs.prepare.outputs.rc_number }} - secrets: inherit linux-arm: needs: prepare uses: ./.github/workflows/build-linux.yml with: version: ${{ needs.prepare.outputs.version }} - hamlib_branch: "4.7.1" - arch: "aarch64" + hamlib_branch: "4.7.2" + arch: aarch64 + image_tag: ${{ needs.prepare.outputs.linux_image_tag }} + save_ccache: true + build_packages: true + release_channel: ${{ needs.prepare.outputs.release_channel }} + rc_number: ${{ needs.prepare.outputs.rc_number }} + + # Cross-compile on x86_64, then run target tests, packaging, and AppImage + # validation in the paired ARMv7 runtime image under QEMU. + linux-armhf: + needs: prepare + uses: ./.github/workflows/build-linux.yml + with: + version: ${{ needs.prepare.outputs.version }} + hamlib_branch: "4.7.2" + arch: armhf + image_tag: ${{ needs.prepare.outputs.armhf_image_tag }} + allow_stale_image: true + save_ccache: true + build_packages: true release_channel: ${{ needs.prepare.outputs.release_channel }} rc_number: ${{ needs.prepare.outputs.rc_number }} - secrets: inherit windows: needs: prepare uses: ./.github/workflows/build-windows.yml with: version: ${{ needs.prepare.outputs.version }} - hamlib_branch: "4.7.1" + hamlib_branch: "4.7.2" release_channel: ${{ needs.prepare.outputs.release_channel }} rc_number: ${{ needs.prepare.outputs.rc_number }} - secrets: inherit - # ── Publish release + sync to public repo ────────────────────────── - release: - needs: [prepare, macos, macos-intel, linux, linux-arm, windows] + candidate-ready: + needs: [prepare, macos, macos-intel, linux, linux-arm, linux-armhf, windows] runs-on: ubuntu-latest - permissions: - contents: write + timeout-minutes: 15 steps: - - uses: actions/checkout@v6 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Download all artifacts - uses: actions/download-artifact@v8 + - uses: actions/checkout@v7 + - uses: actions/download-artifact@v8 with: path: artifacts - - # Source tarball is published on GA releases only, not on RC (-rc*, - # -beta*, etc.) pre-releases. Rationale: RCs may carry code for features - # that are not yet intended for open source distribution (limited-access - # field testing). GA releases always include a source tarball per the - # CI/CD adoption decision on platform-matrix assets. - - name: Build source tarball (GA only) - if: ${{ !contains(github.ref_name, '-') }} - env: - VERSION: ${{ needs.prepare.outputs.version }} - run: | - # This repo has no git submodules, so git archive's default - # single-tree output captures the full source. If submodules - # are ever added, this step must be revisited — git archive - # does not recurse into submodules on its own. - git archive \ - --format=tar.gz \ - --prefix="wsjtx-${VERSION}/" \ - -o "artifacts/wsjtx-${VERSION}-src.tar.gz" \ - "${GITHUB_REF_NAME}" - ls -lh "artifacts/wsjtx-${VERSION}-src.tar.gz" - - - name: List artifacts - run: find artifacts -type f | sort - - # ── All-platforms-ready gate ─────────────────────────────────────── - # Refuse to publish unless every platform produced an installer-grade - # artifact. The release job's `needs:` already enforces structural - # success (all 5 builds ran and exited 0), but a build can exit 0 - # without actually packaging — e.g. a packaging step behind an `if:` - # that evaluated false, or an upload-artifact step that silently - # matched zero files. This gate fails the release job BEFORE any - # asset upload so partial releases never reach GitHub Releases or - # the public mirror. - # - # Expected artifact layout (one installer per platform, per the - # five build-*.yml upload-artifact steps): - # artifacts/wsjtx--arm64-macOS.pkg/*.pkg - # artifacts/wsjtx--x86_64-macOS.pkg/*.pkg - # artifacts/wsjtx--linux-x86_64-AppImage/*.AppImage - # artifacts/wsjtx--linux-aarch64-AppImage/*.AppImage - # artifacts/wsjtx--windows-x86_64-installer/*.exe - # - # Policy: publish only when all five platforms have produced an - # installer-grade artifact. Adjust or remove this step if the - # policy evolves (e.g. to publish any-platform-ready). - - name: Verify installer-grade artifacts (all-platforms-ready gate) - env: - VERSION: ${{ needs.prepare.outputs.version }} - run: | - shopt -s nullglob - labels=( - "macOS arm64 .pkg" - "macOS x86_64 .pkg" - "Linux x86_64 .AppImage" - "Linux aarch64 .AppImage" - "Windows x86_64 .exe" - ) - patterns=( - "artifacts/wsjtx-${VERSION}-arm64-macOS.pkg/*.pkg" - "artifacts/wsjtx-${VERSION}-x86_64-macOS.pkg/*.pkg" - "artifacts/wsjtx-${VERSION}-linux-x86_64-AppImage/*.AppImage" - "artifacts/wsjtx-${VERSION}-linux-aarch64-AppImage/*.AppImage" - "artifacts/wsjtx-${VERSION}-windows-x86_64-installer/*.exe" - ) - missing=0 - echo "Installer-grade artifact gate — checking 5 platforms…" - for i in "${!labels[@]}"; do - # shellcheck disable=SC2206 # word-split is intentional; nullglob makes it safe. - matches=( ${patterns[$i]} ) - if [ ${#matches[@]} -eq 0 ]; then - echo "::error::MISSING ${labels[$i]} — no match for ${patterns[$i]}" - missing=$((missing + 1)) - else - size=$(stat --printf '%s' "${matches[0]}") - printf ' ok %-22s %s (%s bytes)\n' "${labels[$i]}" "${matches[0]}" "$size" - fi - done - if [ "$missing" -gt 0 ]; then - echo "::error::All-platforms-ready gate FAILED — $missing of 5 platform(s) missing installer-grade artifact." - echo "::error::Refusing to publish a partial release. Fix the failing build job(s) and retry the tag." - exit 1 - fi - echo "All-platforms-ready gate PASSED — all 5 installer-grade artifacts present. Proceeding to publish." - - - name: Create GitHub Release - env: - GH_TOKEN: ${{ github.token }} - run: | - TAG="${GITHUB_REF_NAME}" - # Filter to user-facing release assets. `find artifacts -type f` - # without filtering pulls in 5× ctest-results.xml (one per - # platform) and per-binary tarballs from individual-binaries-* - # that collide on basename across architectures — `gh release - # create` uses basenames as asset names and duplicates cause - # upload failures. - mapfile -t files < <(find artifacts -maxdepth 2 -type f \ - \( -name "*.pkg" -o -name "*.AppImage" -o -name "*.deb" \ - -o -name "*.exe" -o -name "*.tar.gz" -o -name "*.rpm" \)) - # SemVer pre-release tags contain a hyphen after the version - # (e.g., v3.0.1-rc1, v3.0.1-rc2, v3.0.1-beta1). Flag those as - # GitHub pre-releases so they don't appear as the latest stable. - PRERELEASE_FLAG="" - if [[ "$TAG" == *-* ]]; then - PRERELEASE_FLAG="--prerelease" - fi - gh release create "$TAG" \ - --title "WSJT-X ${{ needs.prepare.outputs.version }}" \ - --generate-notes \ - $PRERELEASE_FLAG \ - "${files[@]}" - - # ── Public mirror: GA only ───────────────────────────────────────── - # RC/beta tags (any tag carrying a '-' in the version, e.g. - # build/v3.0.1-rc1) stay internal — the public WSJTX/wsjtx repo is - # for stable releases only. The Build source tarball step above - # uses the same predicate; mirror logic must too. - - # Defense-in-depth: the workflow trigger already constrains - # github.ref_name to tags matching build/v*, but if this job - # ever runs outside that trigger (workflow_dispatch, manual - # re-run with a fork ref, misconfiguration) the force-push - # below would overwrite WSJTX/wsjtx:master with arbitrary content. - # Abort here if the ref doesn't match the expected release-tag - # shape. - - name: Verify release tag format (GA only) - if: ${{ !contains(github.ref_name, '-') }} - run: | - if [[ "$GITHUB_REF_TYPE" != "tag" || "$GITHUB_REF_NAME" != build/v* ]]; then - echo "::error::Refusing to sync — expected tag build/v*, got $GITHUB_REF_TYPE:$GITHUB_REF_NAME" - exit 1 - fi - - - name: Push to public repo (GA only) - if: ${{ !contains(github.ref_name, '-') }} - env: - TOKEN: ${{ secrets.CROSS_REPO_TOKEN }} + - name: Verify all candidate artifacts + run: python3 .github/scripts/release-policy.py verify-assets "${{ needs.prepare.outputs.version }}" artifacts + - name: Verify candidate packaging reports run: | - # A "successful" release that silently skips the mirror sync is - # the worst failure mode — it looks green in Actions but leaves - # users unable to download. Fail loud instead. - if [ -z "$TOKEN" ]; then - echo "::error::CROSS_REPO_TOKEN not set — refusing to publish without public-mirror sync" - exit 1 - fi - # Use CROSS_REPO_TOKEN (PAT with Contents:write on WSJTX/wsjtx) - # over HTTPS. Idempotent: on job re-run the remote already exists, - # so skip add. - if ! git remote get-url public >/dev/null 2>&1; then - git remote add public "https://x-access-token:${TOKEN}@github.com/WSJTX/wsjtx.git" - fi - - # Strip "build/" prefix per public release convention. Public - # users search for "v3.0.1", not "build/v3.0.1". Internal tag - # stays as-is for the wsjtx-internal release. - PUBLIC_TAG="${GITHUB_REF_NAME#build/}" - - # Derive the bare-prefix tag locally so the workflow doesn't - # depend on the team having pushed both tag forms. -f overwrites - # any pre-existing local tag at a stale SHA. - git tag -f "$PUBLIC_TAG" "$GITHUB_REF_NAME" - - # Human-auditable record of what the force-push is overwriting. - # If public master doesn't exist yet, ls-remote returns empty — - # still safe, just logs "no prior SHA". - PRIOR_SHA=$(git ls-remote public master | awk '{print $1}') - LOCAL_SHA=$(git rev-parse HEAD) - echo "Public mirror force-push audit:" - echo " internal tag: $GITHUB_REF_NAME" - echo " public tag: $PUBLIC_TAG" - echo " prior SHA: ${PRIOR_SHA:-}" - echo " new SHA: $LOCAL_SHA" - - # --force retained per CI/CD adoption decision #3 (option a): - # automate the existing sync pattern. The v3.0.0 tag SHAs already - # match on both repos, so the force-push aligns history rather - # than rewrites it in the normal release case. - git push public HEAD:master --force - git push public "refs/tags/${PUBLIC_TAG}:refs/tags/${PUBLIC_TAG}" - - # Create the public-side GitHub Release with installer assets - # attached. Without this step, public-side Releases page is empty - # after a mirror push (source + tag, no downloadables) and end users - # can't find the artifacts. - - name: Create public GitHub Release (GA only) - if: ${{ !contains(github.ref_name, '-') }} + python3 .github/scripts/release-policy.py verify-signing-reports \ + "${{ needs.prepare.outputs.version }}" artifacts \ + --commit "${{ inputs.expected_sha }}" --tag "${{ inputs.candidate_tag }}" \ + --macos-mode validation --windows-mode unsigned + - name: Record candidate provenance env: - GH_TOKEN: ${{ secrets.CROSS_REPO_TOKEN }} VERSION: ${{ needs.prepare.outputs.version }} + CANDIDATE_TAG: ${{ inputs.candidate_tag }} + CANDIDATE_SHA: ${{ inputs.expected_sha }} + WINDOWS_RELEASE_MODE: ${{ needs.prepare.outputs.windows_signing }} run: | - PUBLIC_TAG="${GITHUB_REF_NAME#build/}" - # Same asset filter as the internal release. Re-find rather than - # carrying a list — keeps the all-platforms-ready gate, internal - # release, and public release mechanically aligned on one filter. - mapfile -t files < <(find artifacts -maxdepth 2 -type f \ - \( -name "*.pkg" -o -name "*.AppImage" -o -name "*.deb" \ - -o -name "*.exe" -o -name "*.tar.gz" -o -name "*.rpm" \)) - gh release create "$PUBLIC_TAG" \ - -R WSJTX/wsjtx \ - --title "WSJT-X ${VERSION}" \ - --generate-notes \ - "${files[@]}" + jq -n \ + --arg version "$VERSION" \ + --arg tag "$CANDIDATE_TAG" \ + --arg commit "$CANDIDATE_SHA" \ + --arg repository "$GITHUB_REPOSITORY" \ + --arg run_id "$GITHUB_RUN_ID" \ + --arg windows_release_mode "$WINDOWS_RELEASE_MODE" \ + '{schema: 1, version: $version, tag: $tag, commit: $commit, repository: $repository, workflow_run: $run_id, windows_release_signing: $windows_release_mode, candidate_signing: {windows: "unsigned", macos: "validation"}}' \ + > artifacts/candidate-provenance.json + - name: Upload complete candidate + uses: actions/upload-artifact@v7 + with: + name: release-candidate-${{ needs.prepare.outputs.version }} + path: artifacts + if-no-files-found: error + retention-days: 30 diff --git a/.github/workflows/sign-windows-release.yml b/.github/workflows/sign-windows-release.yml new file mode 100644 index 00000000..a040ab43 --- /dev/null +++ b/.github/workflows/sign-windows-release.yml @@ -0,0 +1,142 @@ +name: Sign Windows Release + +on: + workflow_call: + inputs: + version: + required: true + type: string + release_channel: + required: true + type: string + rc_number: + required: false + type: string + default: "" + windows_signing: + required: false + type: string + default: signpath +permissions: + actions: read + contents: read + +jobs: + build: + uses: ./.github/workflows/build-windows.yml + with: + version: ${{ inputs.version }} + hamlib_branch: "4.7.2" + release_channel: ${{ inputs.release_channel }} + rc_number: ${{ inputs.rc_number }} + + sign: + if: inputs.windows_signing != 'unsigned' + needs: build + runs-on: ubuntu-latest + timeout-minutes: 90 + environment: windows-release-signing + permissions: + actions: read + contents: read + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + - name: Require a public RC or GA invocation + env: + VERSION: ${{ inputs.version }} + CHANNEL: ${{ inputs.release_channel }} + RC_NUMBER: ${{ inputs.rc_number }} + run: | + set -euo pipefail + IDENTITY=$(python3 .github/scripts/release-policy.py classify "$VERSION") + test "$(jq -r .channel <<<"$IDENTITY")" = "$CHANNEL" + test "$(jq -r .rc_number <<<"$IDENTITY")" = "$RC_NUMBER" + test "$GITHUB_REPOSITORY" = WSJTX/wsjtx + - name: Submit release signing request to SignPath + id: signpath + uses: signpath/github-action-submit-signing-request@v3 + with: + api-token: ${{ secrets.SIGNPATH_API_TOKEN }} + organization-id: "4c211821-e011-48a2-8a84-2cc29a76a8bf" + project-slug: wsjtx + signing-policy-slug: release-signing + github-artifact-id: ${{ needs.build.outputs.installer-artifact-id }} + wait-for-completion: true + wait-for-completion-timeout-in-seconds: "3600" + output-artifact-directory: signed + - name: Record signing request + env: + REQUEST_URL: ${{ steps.signpath.outputs.signing-request-web-url }} + run: | + printf '{"schema":1,"provider":"SignPath","policy":"release-signing","request_url":"%s","tag":"%s","commit":"%s"}\n' \ + "$REQUEST_URL" "$GITHUB_REF_NAME" "$GITHUB_SHA" > windows-signing-request.json + - name: Upload signed installer + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: wsjtx-${{ inputs.version }}-windows-x86_64-installer-signed + path: signed/*.exe + if-no-files-found: error + - name: Upload signing request report + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: wsjtx-${{ inputs.version }}-windows-signing-request + path: windows-signing-request.json + if-no-files-found: error + + verify: + needs: sign + runs-on: windows-latest + timeout-minutes: 15 + environment: windows-release-signing + steps: + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 + with: + name: wsjtx-${{ inputs.version }}-windows-x86_64-installer-signed + path: signed + - name: Verify trusted Authenticode signature and timestamp + shell: pwsh + env: + EXPECTED_SIGNER_SUBJECT: ${{ vars.WINDOWS_SIGNER_SUBJECT }} + EXPECTED_SIGNER_THUMBPRINTS: ${{ vars.WINDOWS_SIGNER_THUMBPRINTS }} + run: | + $exe = Get-ChildItem signed -Filter *.exe + if ($exe.Count -ne 1) { throw "Expected exactly one signed installer" } + $signtool = Get-ChildItem "C:\Program Files (x86)\Windows Kits\10\bin\*\x64\signtool.exe" | + Sort-Object FullName | Select-Object -Last 1 + if (-not $signtool) { throw "signtool.exe not found" } + & $signtool.FullName verify /pa /all /v $exe.FullName + if ($LASTEXITCODE -ne 0) { throw "Authenticode trust verification failed" } + $signature = Get-AuthenticodeSignature $exe.FullName + if ($signature.Status -ne 'Valid') { throw "Authenticode status is $($signature.Status)" } + if (-not $signature.TimeStamperCertificate) { throw "Installer signature has no trusted timestamp" } + if (-not $env:EXPECTED_SIGNER_SUBJECT) { throw "WINDOWS_SIGNER_SUBJECT is not configured" } + if ($signature.SignerCertificate.Subject -ne $env:EXPECTED_SIGNER_SUBJECT) { + throw "Unexpected Authenticode signer subject: $($signature.SignerCertificate.Subject)" + } + $allowedThumbprints = $env:EXPECTED_SIGNER_THUMBPRINTS.Split(',') | + ForEach-Object { $_.Replace(' ', '').ToUpperInvariant() } | + Where-Object { $_ } + $actualThumbprint = $signature.SignerCertificate.Thumbprint.ToUpperInvariant() + if ($allowedThumbprints.Count -eq 0 -or $actualThumbprint -notin $allowedThumbprints) { + throw "Unexpected Authenticode signer thumbprint: $actualThumbprint" + } + $sha256 = (Get-FileHash -Algorithm SHA256 $exe.FullName).Hash.ToLowerInvariant() + [ordered]@{ + schema = 1 + tag = $env:GITHUB_REF_NAME + commit = $env:GITHUB_SHA + artifact = $exe.Name + sha256 = $sha256 + status = $signature.Status.ToString() + signer_subject = $signature.SignerCertificate.Subject + signer_thumbprint = $signature.SignerCertificate.Thumbprint + identity_verified = $true + timestamp_subject = $signature.TimeStamperCertificate.Subject + timestamp_thumbprint = $signature.TimeStamperCertificate.Thumbprint + } | ConvertTo-Json | Set-Content windows-signing-verification.json + - name: Upload verification report + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: wsjtx-${{ inputs.version }}-windows-signing-verification + path: windows-signing-verification.json + if-no-files-found: error diff --git a/.github/workflows/signpath-smoke.yml b/.github/workflows/signpath-smoke.yml new file mode 100644 index 00000000..b6aa3a41 --- /dev/null +++ b/.github/workflows/signpath-smoke.yml @@ -0,0 +1,74 @@ +name: SignPath Smoke Test + +# Signs a trivial PE through the full SignPath round trip (token, slugs, +# artifact configuration, trusted build system) without building or +# exposing WSJT source. + +on: + workflow_dispatch: + inputs: + signing-policy-slug: + description: "SignPath signing policy to exercise" + required: false + type: choice + options: + - test-signing + - release-signing + default: test-signing + +jobs: + smoke: + if: github.repository == 'WSJTX/wsjtx' + runs-on: ubuntu-latest + timeout-minutes: 90 + environment: windows-release-signing + permissions: + actions: read + contents: read + steps: + - name: Build trivial PE file + run: | + # Keep this job independent of the dispatched repository ref. It + # submits an executable with the SignPath API token below. + sudo apt-get update -q + sudo apt-get install -y -q gcc-mingw-w64-x86-64 + cat > smoke.c <<'EOF' + #include + int main(void) { puts("WSJT SignPath smoke test"); return 0; } + EOF + x86_64-w64-mingw32-gcc smoke.c -o signpath-smoke.exe + file signpath-smoke.exe + + - name: Upload unsigned artifact + id: upload + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: signpath-smoke + path: signpath-smoke.exe + + - name: Submit signing request to SignPath + id: signpath + uses: signpath/github-action-submit-signing-request@v3 + with: + api-token: ${{ secrets.SIGNPATH_API_TOKEN }} + organization-id: "4c211821-e011-48a2-8a84-2cc29a76a8bf" + project-slug: "wsjtx" + signing-policy-slug: ${{ inputs.signing-policy-slug }} + github-artifact-id: ${{ steps.upload.outputs.artifact-id }} + wait-for-completion: true + wait-for-completion-timeout-in-seconds: "3600" + output-artifact-directory: signed + + - name: Verify returned signature + run: | + echo "Signing request: ${{ steps.signpath.outputs.signing-request-web-url }}" + sudo apt-get install -y -q osslsigncode + ls -la signed/ + # The test cert never chains to a trusted root, so chain + # verification can't gate here. Require instead that an + # Authenticode signature is present and parses as PKCS#7 — + # both commands hard-fail on an unsigned or malformed exe. + osslsigncode extract-signature -in signed/signpath-smoke.exe -out smoke-sig.der + openssl pkcs7 -inform DER -in smoke-sig.der -print_certs -noout + # Chain status, informational only: + osslsigncode verify signed/signpath-smoke.exe || true diff --git a/.github/workflows/warm-dependency-caches.yml b/.github/workflows/warm-dependency-caches.yml new file mode 100644 index 00000000..db9f6593 --- /dev/null +++ b/.github/workflows/warm-dependency-caches.yml @@ -0,0 +1,443 @@ +name: Refresh Build Caches + +on: + push: + branches: [develop] + paths: + - ".github/workflows/ci.yml" + - ".github/workflows/release.yml" + - ".github/workflows/build-linux.yml" + - ".github/workflows/warm-dependency-caches.yml" + - ".github/actions/build-linux-payload/**" + - ".github/images/linux-ci/**" + - ".github/scripts/linux-ci-image-config.sh" + - ".github/scripts/linux-ci-image-fingerprint.sh" + - ".github/scripts/linux-ci-image-inputs.sh" + - ".github/scripts/linux-ccache-compiler-signature.sh" + - ".github/scripts/select-ccache-key-suffix.sh" + - ".github/scripts/select-linux-ccache-save.sh" + - ".github/scripts/run-apt-get.sh" + - ".github/scripts/build-pfunit-linux.sh" + - ".github/scripts/build-hamlib-linux.sh" + - ".github/scripts/tsan-linux-deps-config.sh" + - ".github/scripts/build-qt-tsan-linux.sh" + - ".github/scripts/build-boost-tsan-linux.sh" + - ".github/scripts/build-hamlib-tsan-linux.sh" + - ".github/scripts/verify-linux-ci-image.sh" + - ".github/scripts/verify-tsan-deps-linux.sh" + - ".github/workflows/build-macos.yml" + - ".github/workflows/build-windows.yml" + - ".github/actions/warm-macos-deps/**" + - ".github/actions/build-windows-deps/**" + - ".github/scripts/build-*-macos.sh" + - ".github/scripts/build-*-windows.sh" + - ".github/scripts/*armhf*" + - ".github/scripts/install-*-macos*.sh" + - ".github/scripts/macos-qt-cache-key.sh" + - ".github/scripts/verify-macos-*.sh" + schedule: + - cron: "23 10 * * 1" + - cron: "17 9 1 * *" + workflow_dispatch: + inputs: + targets: + description: "Platform caches to warm" + required: false + type: choice + options: + - macos-arm64 + - macos-x86_64 + - macos + - windows + - linux + - linux-arm64 + - linux-tsan + - linux-images + - linux-retention + - all + default: macos-arm64 + hamlib_branch: + description: "Hamlib branch to build" + required: false + type: string + default: "4.7.2" + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false + +jobs: + detect: + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + packages: read + outputs: + linux_images: ${{ steps.detect.outputs.linux_images }} + linux_arm64: ${{ steps.detect.outputs.linux_arm64 }} + retention: ${{ steps.detect.outputs.retention }} + windows: ${{ steps.detect.outputs.windows }} + macos_arm64: ${{ steps.detect.outputs.macos_arm64 }} + macos_x86_64: ${{ steps.detect.outputs.macos_x86_64 }} + image_set: ${{ steps.detect.outputs.image_set }} + hamlib_branch: ${{ steps.detect.outputs.hamlib_branch }} + version: ${{ steps.detect.outputs.version }} + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 2 + + - id: detect + name: Select cache warmers + shell: bash + env: + EVENT_NAME: ${{ github.event_name }} + SCHEDULE: ${{ github.event.schedule }} + BEFORE_SHA: ${{ github.event.before }} + CURRENT_SHA: ${{ github.sha }} + TARGETS: ${{ inputs.targets || '' }} + HAMLIB_BRANCH: ${{ inputs.hamlib_branch || '4.7.2' }} + run: | + set -euo pipefail + .github/scripts/validate-ci-inputs.sh + + normal_images=false + tsan_images=false + retention=false + linux_arm64=false + windows=false + macos_arm64=false + macos_x86_64=false + + enable_cache_all() { + linux_arm64=true + windows=true + macos_arm64=true + macos_x86_64=true + } + + enable_all() { + normal_images=true + retention=true + enable_cache_all + } + + case "$EVENT_NAME" in + schedule) + retention=true + # Refresh the promoted image monthly only when no newer refresh occurred. + if [ "$SCHEDULE" = "17 9 1 * *" ] && \ + python3 .github/scripts/should-refresh-linux-ci-images.py --max-age-days 30; then + normal_images=true + tsan_images=true + elif [ "$SCHEDULE" = "23 10 * * 1" ]; then + enable_cache_all + fi + ;; + workflow_dispatch) + case "$TARGETS" in + all) + enable_all + ;; + linux|linux-images) + normal_images=true + linux_arm64=true + ;; + linux-arm64) + linux_arm64=true + ;; + linux-tsan) + tsan_images=true + ;; + linux-retention) + retention=true + ;; + windows) + windows=true + ;; + macos) + macos_arm64=true + macos_x86_64=true + ;; + macos-arm64) + macos_arm64=true + ;; + macos-x86_64) + macos_x86_64=true + ;; + *) + echo "::error::Unsupported targets input: $TARGETS" + exit 2 + ;; + esac + ;; + push) + if [ -n "$BEFORE_SHA" ] && [ "$BEFORE_SHA" != "0000000000000000000000000000000000000000" ]; then + base="$BEFORE_SHA" + else + base="${CURRENT_SHA}^" + fi + + if ! git cat-file -e "${base}^{commit}" 2>/dev/null; then + git fetch --no-tags --depth=1 origin "$base" || true + fi + + if git cat-file -e "${base}^{commit}" 2>/dev/null; then + changed="$(git diff --name-only "$base" "$CURRENT_SHA")" + else + echo "::notice::Could not compare $base..$CURRENT_SHA; warming all dependency caches" + changed="" + enable_all + tsan_images=true + fi + + while IFS= read -r path; do + [ -n "$path" ] || continue + case "$path" in + .github/workflows/ci.yml|.github/workflows/release.yml|.github/workflows/warm-dependency-caches.yml|.github/scripts/select-ccache-key-suffix.sh) + enable_cache_all + ;; + .github/workflows/build-linux.yml|.github/actions/build-linux-payload/*|.github/scripts/select-linux-ccache-save.sh) + linux_arm64=true + ;; + .github/workflows/build-windows.yml|.github/actions/build-windows-deps/*|.github/scripts/build-boost-windows.sh|.github/scripts/build-pfunit-windows.sh|.github/scripts/build-hamlib-windows.sh) + windows=true + ;; + .github/workflows/build-macos.yml|.github/actions/warm-macos-deps/*|.github/scripts/build-*-macos.sh|.github/scripts/install-*-macos*.sh|.github/scripts/macos-qt-cache-key.sh|.github/scripts/verify-macos-*.sh) + macos_arm64=true + macos_x86_64=true + ;; + *) + case "$(.github/scripts/is-linux-ci-image-input.sh --classify "$path")" in + normal) + normal_images=true + ;; + tsan) + tsan_images=true + ;; + normal-and-tsan) + normal_images=true + tsan_images=true + ;; + esac + ;; + esac + done <<< "$changed" + ;; + *) + echo "::error::Unsupported event: $EVENT_NAME" + exit 2 + ;; + esac + + if [ "$normal_images" = true ] && [ "$tsan_images" = true ]; then + image_set=normal-and-tsan + elif [ "$normal_images" = true ]; then + image_set=normal + elif [ "$tsan_images" = true ]; then + image_set=tsan + else + image_set=none + fi + linux_images=false + if [ "$image_set" != none ]; then + linux_images=true + fi + + VERSION=$(awk -F= '$1 == "version" {print $2; exit}' release-state.txt) + if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "::error::Could not derive VERSION from release-state.txt" + exit 1 + fi + + { + echo "linux_images=$linux_images" + echo "linux_arm64=$linux_arm64" + echo "retention=$retention" + echo "windows=$windows" + echo "macos_arm64=$macos_arm64" + echo "macos_x86_64=$macos_x86_64" + echo "image_set=$image_set" + echo "hamlib_branch=$HAMLIB_BRANCH" + echo "version=$VERSION" + } >> "$GITHUB_OUTPUT" + + { + echo "## Build cache warmer selection" + echo + echo "| Target | Enabled |" + echo "| --- | --- |" + echo "| Linux GHCR image set | $image_set |" + echo "| Linux arm64 ccache | $linux_arm64 |" + echo "| Linux GHCR retention | $retention |" + echo "| Windows x86_64 | $windows |" + echo "| macOS arm64 | $macos_arm64 |" + echo "| macOS x86_64 | $macos_x86_64 |" + } >> "$GITHUB_STEP_SUMMARY" + + refresh-linux-images: + needs: detect + if: needs.detect.outputs.linux_images == 'true' + uses: ./.github/workflows/publish-linux-ci-images.yml + permissions: + contents: read + packages: write + with: + # ARMHF is part of the normal Linux image cohort. The reusable publisher + # validates and promotes its paired images before dependent builds resolve them. + promote: true + include_armhf: true + image_set: ${{ needs.detect.outputs.image_set }} + + retain-linux-images: + needs: [detect, refresh-linux-images] + if: >- + always() && + needs.detect.outputs.retention == 'true' && + (needs.refresh-linux-images.result == 'success' || + needs.refresh-linux-images.result == 'skipped') + runs-on: ubuntu-24.04 + timeout-minutes: 10 + permissions: + contents: read + packages: write + concurrency: + group: linux-ci-image-publishing + cancel-in-progress: false + steps: + - uses: actions/checkout@v7 + - name: Apply GHCR retention + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + APPLY: ${{ github.event_name == 'schedule' }} + shell: bash + run: | + args=( + --owner WSJTX + --max-age-days 60 + --keep 3 + --package wsjtx-internal/linux-noble + --package wsjtx-internal/linux-tsan-noble + --package wsjtx-internal/linux-arm64-bookworm + --package wsjtx-internal/linux-armhf-cross-bookworm + --package wsjtx-internal/linux-armv7-bookworm + ) + if [ "$APPLY" = true ]; then + args+=(--apply) + fi + .github/scripts/ghcr_retention.py "${args[@]}" + + warm-linux-arm64-ccache: + needs: detect + if: >- + github.ref == 'refs/heads/develop' && + needs.detect.outputs.linux_arm64 == 'true' && + needs.detect.outputs.image_set != 'normal' && + needs.detect.outputs.image_set != 'normal-and-tsan' + uses: ./.github/workflows/build-linux.yml + permissions: + contents: read + packages: read + with: + version: ${{ needs.detect.outputs.version }} + hamlib_branch: ${{ needs.detect.outputs.hamlib_branch }} + arch: aarch64 + save_ccache: true + + warm-windows-x86_64-deps: + needs: detect + if: needs.detect.outputs.windows == 'true' + runs-on: windows-latest + timeout-minutes: 60 + steps: + - name: Disable core.autocrlf before checkout + shell: pwsh + run: git config --global core.autocrlf false + + - uses: actions/checkout@v7 + + # Boost is source-built by build-windows-deps so the Windows 7 API floor + # and Boost.Atomic patch stay pinned; do not install MSYS2 Boost here. + - uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + update: true + cache: true + install: >- + git make tar curl + mingw-w64-x86_64-gcc + mingw-w64-x86_64-gcc-fortran + mingw-w64-x86_64-cmake + mingw-w64-x86_64-python + mingw-w64-x86_64-pkg-config + autoconf automake libtool + + - uses: ./.github/actions/build-windows-deps + with: + hamlib_branch: ${{ needs.detect.outputs.hamlib_branch }} + save_caches: "true" + + warm-windows-ccache: + needs: [detect, warm-windows-x86_64-deps] + if: needs.detect.outputs.windows == 'true' + uses: ./.github/workflows/build-windows.yml + with: + version: ${{ needs.detect.outputs.version }} + hamlib_branch: ${{ needs.detect.outputs.hamlib_branch }} + save_ccache: true + + warm-macos-arm64-deps: + needs: detect + if: needs.detect.outputs.macos_arm64 == 'true' + runs-on: macos-15 + timeout-minutes: 40 + steps: + - uses: actions/checkout@v7 + - uses: ./.github/actions/warm-macos-deps + with: + arch: arm64 + runner: macos-15 + deployment_target: "11.0" + hamlib_branch: ${{ needs.detect.outputs.hamlib_branch }} + + warm-macos-x86_64-deps: + needs: detect + if: needs.detect.outputs.macos_x86_64 == 'true' + runs-on: macos-15-intel + timeout-minutes: 100 + steps: + - uses: actions/checkout@v7 + - uses: ./.github/actions/warm-macos-deps + with: + arch: x86_64 + runner: macos-15-intel + deployment_target: "10.13" + hamlib_branch: ${{ needs.detect.outputs.hamlib_branch }} + + warm-macos-arm64-ccache: + needs: [detect, warm-macos-arm64-deps] + if: needs.detect.outputs.macos_arm64 == 'true' + uses: ./.github/workflows/build-macos.yml + with: + version: ${{ needs.detect.outputs.version }} + hamlib_branch: ${{ needs.detect.outputs.hamlib_branch }} + arch: arm64 + runner: macos-15 + deployment_target: "11.0" + save_ccache: true + + warm-macos-x86_64-ccache: + needs: [detect, warm-macos-x86_64-deps] + if: needs.detect.outputs.macos_x86_64 == 'true' + uses: ./.github/workflows/build-macos.yml + with: + version: ${{ needs.detect.outputs.version }} + hamlib_branch: ${{ needs.detect.outputs.hamlib_branch }} + arch: x86_64 + runner: macos-15-intel + deployment_target: "10.13" + save_ccache: true diff --git a/ActiveStationList.cpp b/ActiveStationList.cpp new file mode 100644 index 00000000..3f140b0f --- /dev/null +++ b/ActiveStationList.cpp @@ -0,0 +1,19 @@ +#include "ActiveStationList.hpp" + +#include + +QVector sorted_limited_active_station_items( + QVector items, + int limit, + bool descending) +{ + if(limit <= 0) return {}; + + std::stable_sort(items.begin(), items.end(), + [descending](ActiveStationListItem const& lhs, ActiveStationListItem const& rhs) { + return descending ? lhs.sort_key > rhs.sort_key : lhs.sort_key < rhs.sort_key; + }); + + if(items.size() > limit) items.resize(limit); + return items; +} diff --git a/ActiveStationList.hpp b/ActiveStationList.hpp new file mode 100644 index 00000000..a33df167 --- /dev/null +++ b/ActiveStationList.hpp @@ -0,0 +1,19 @@ +// -*- Mode: C++ -*- +#ifndef ACTIVE_STATION_LIST_HPP +#define ACTIVE_STATION_LIST_HPP + +#include +#include + +struct ActiveStationListItem +{ + float sort_key; + QString text; +}; + +QVector sorted_limited_active_station_items( + QVector items, + int limit, + bool descending); + +#endif diff --git a/Audio/Audio.pri b/Audio/Audio.pri deleted file mode 100644 index e2237bbd..00000000 --- a/Audio/Audio.pri +++ /dev/null @@ -1,5 +0,0 @@ -SOURCES += Audio/AudioDevice.cpp Audio/BWFFile.cpp Audio/soundin.cpp \ - Audio/soundout.cpp - -HEADERS += Audio/AudioDevice.hpp Audio/BWFFile.hpp Audio/soundin.h \ - Audio/soundout.h diff --git a/Audio/AudioInputSource.hpp b/Audio/AudioInputSource.hpp new file mode 100644 index 00000000..220e1309 --- /dev/null +++ b/Audio/AudioInputSource.hpp @@ -0,0 +1,71 @@ +// -*- Mode: C++ -*- +#ifndef AUDIO_INPUT_SOURCE_HPP__ +#define AUDIO_INPUT_SOURCE_HPP__ + +#include +#include +#include +#include + +#include "Audio/AudioDevice.hpp" +#include "Audio/AudioStreamDescriptor.hpp" + +class QAudioDeviceInfo; + +class AudioInputSource + : public QObject +{ + Q_OBJECT + +public: + explicit AudioInputSource (QObject * parent = nullptr) + : QObject {parent} + { + } + + ~AudioInputSource () override = default; + + // Return a consistent snapshot that is safe to read from another thread. + AudioStreamDescriptor streamDescriptor () const + { + QMutexLocker locker {&stream_descriptor_mutex_}; + return stream_descriptor_; + } + + Q_SLOT virtual void start (QAudioDeviceInfo const&, int framesPerBuffer, + AudioDevice * sink, unsigned downSampleFactor, + AudioDevice::Channel = AudioDevice::Mono) = 0; + Q_SLOT virtual void suspend () = 0; + Q_SLOT virtual void resume () = 0; + Q_SLOT virtual void stop () = 0; + Q_SLOT virtual void reset (bool reportDroppedFrames) = 0; + + Q_SIGNAL void error (QString message) const; + Q_SIGNAL void status (QString message) const; + Q_SIGNAL void streamDescriptorChanged (AudioStreamDescriptor descriptor) const; + +protected: + void setStreamDescriptor (AudioStreamDescriptor descriptor) + { + { + QMutexLocker locker {&stream_descriptor_mutex_}; + if (descriptor == stream_descriptor_) + { + return; + } + stream_descriptor_ = descriptor; + } + Q_EMIT streamDescriptorChanged (descriptor); + } + + void clearStreamDescriptor () + { + setStreamDescriptor ({}); + } + +private: + mutable QMutex stream_descriptor_mutex_; + AudioStreamDescriptor stream_descriptor_; +}; + +#endif diff --git a/Audio/AudioStreamClock.hpp b/Audio/AudioStreamClock.hpp new file mode 100644 index 00000000..65e5b1e1 --- /dev/null +++ b/Audio/AudioStreamClock.hpp @@ -0,0 +1,59 @@ +// -*- Mode: C++ -*- +#ifndef AUDIO_STREAM_CLOCK_HPP__ +#define AUDIO_STREAM_CLOCK_HPP__ + +#include + +#include "Audio/AudioStreamDescriptor.hpp" + +class AudioStreamClock +{ +public: + enum class Reference + { + ArrivalWallClock, + CaptureAnchor + }; + + void setDescriptor (AudioStreamDescriptor descriptor) noexcept + { + descriptor_ = descriptor; + captured_frames_ = 0; + } + + Reference reference () const noexcept + { + return descriptor_.isValid () + && descriptor_.clock_domain + == AudioStreamDescriptor::ClockDomain::SystemClock + && descriptor_.timing_evidence + == AudioStreamDescriptor::TimingEvidence::CaptureTimeAnchored + && descriptor_.capture_anchor_utc_ms > 0 + ? Reference::CaptureAnchor : Reference::ArrivalWallClock; + } + + qint64 timestamp (qint64 arrival_utc_ms) const noexcept + { + if (Reference::CaptureAnchor != reference ()) + { + return arrival_utc_ms; + } + + return descriptor_.capture_anchor_utc_ms + + captured_frames_ * 1000 / descriptor_.sample_rate_hz; + } + + void advance (qint64 frames) noexcept + { + if (Reference::CaptureAnchor == reference () && frames > 0) + { + captured_frames_ += frames; + } + } + +private: + AudioStreamDescriptor descriptor_; + qint64 captured_frames_ {0}; +}; + +#endif diff --git a/Audio/AudioStreamDescriptor.cpp b/Audio/AudioStreamDescriptor.cpp new file mode 100644 index 00000000..6baaf76a --- /dev/null +++ b/Audio/AudioStreamDescriptor.cpp @@ -0,0 +1,64 @@ +#include "Audio/AudioStreamDescriptor.hpp" + +#include + +AudioStreamDescriptor audioStreamDescriptorFromQAudioFormat ( + QAudioFormat const& format) +{ + AudioStreamDescriptor descriptor; + if (!format.isValid () || format.codec () != "audio/pcm" + || format.sampleSize () <= 0 || format.sampleSize () % 8) + { + return descriptor; + } + + descriptor.sample_rate_hz = format.sampleRate (); + descriptor.sample_size_bits = format.sampleSize (); + descriptor.channel_count = format.channelCount (); + + switch (format.sampleType ()) + { + case QAudioFormat::SignedInt: + descriptor.sample_encoding = + AudioStreamDescriptor::SampleEncoding::SignedInteger; + break; + + case QAudioFormat::UnSignedInt: + descriptor.sample_encoding = + AudioStreamDescriptor::SampleEncoding::UnsignedInteger; + break; + + case QAudioFormat::Float: + descriptor.sample_encoding = + AudioStreamDescriptor::SampleEncoding::FloatingPoint; + break; + + case QAudioFormat::Unknown: + break; + } + + if (format.sampleSize () > 8) + { + switch (format.byteOrder ()) + { + case QAudioFormat::LittleEndian: + descriptor.byte_order = AudioStreamDescriptor::ByteOrder::LittleEndian; + break; + + case QAudioFormat::BigEndian: + descriptor.byte_order = AudioStreamDescriptor::ByteOrder::BigEndian; + break; + } + } + + if (1 == descriptor.channel_count) + { + descriptor.channel_layout = AudioStreamDescriptor::ChannelLayout::Mono; + } + else if (2 == descriptor.channel_count) + { + descriptor.channel_layout = AudioStreamDescriptor::ChannelLayout::Stereo; + } + + return descriptor.isValid () ? descriptor : AudioStreamDescriptor {}; +} diff --git a/Audio/AudioStreamDescriptor.hpp b/Audio/AudioStreamDescriptor.hpp new file mode 100644 index 00000000..9193c321 --- /dev/null +++ b/Audio/AudioStreamDescriptor.hpp @@ -0,0 +1,98 @@ +// -*- Mode: C++ -*- +#ifndef AUDIO_STREAM_DESCRIPTOR_HPP__ +#define AUDIO_STREAM_DESCRIPTOR_HPP__ + +#include + +class QAudioFormat; + +struct AudioStreamDescriptor +{ + enum class SampleEncoding + { + Unknown, + SignedInteger, + UnsignedInteger, + FloatingPoint + }; + + enum class ByteOrder + { + Unknown, + LittleEndian, + BigEndian + }; + + enum class ChannelLayout + { + Unknown, + Mono, + Stereo + }; + + enum class ClockDomain + { + Unknown, + DeviceClock, + SystemClock + }; + + enum class TimingEvidence + { + Unavailable, + PositionCountable, + CaptureTimeAnchored + }; + + int sample_rate_hz {0}; + SampleEncoding sample_encoding {SampleEncoding::Unknown}; + int sample_size_bits {0}; + ByteOrder byte_order {ByteOrder::Unknown}; + int channel_count {0}; + ChannelLayout channel_layout {ChannelLayout::Unknown}; + ClockDomain clock_domain {ClockDomain::Unknown}; + TimingEvidence timing_evidence {TimingEvidence::Unavailable}; + + // UTC timestamp for the first frame in this descriptor epoch, when anchored. + qint64 capture_anchor_utc_ms {0}; + + // True only when the source has a mechanism for reporting discontinuities. + bool can_report_discontinuities {false}; + + bool isValid () const noexcept + { + return sample_rate_hz > 0 + && SampleEncoding::Unknown != sample_encoding + && sample_size_bits > 0 + && (sample_size_bits <= 8 || ByteOrder::Unknown != byte_order) + && channel_count > 0; + } +}; + +inline bool operator== (AudioStreamDescriptor const& lhs, + AudioStreamDescriptor const& rhs) noexcept +{ + return lhs.sample_rate_hz == rhs.sample_rate_hz + && lhs.sample_encoding == rhs.sample_encoding + && lhs.sample_size_bits == rhs.sample_size_bits + && lhs.byte_order == rhs.byte_order + && lhs.channel_count == rhs.channel_count + && lhs.channel_layout == rhs.channel_layout + && lhs.clock_domain == rhs.clock_domain + && lhs.timing_evidence == rhs.timing_evidence + && lhs.capture_anchor_utc_ms == rhs.capture_anchor_utc_ms + && lhs.can_report_discontinuities == rhs.can_report_discontinuities; +} + +inline bool operator!= (AudioStreamDescriptor const& lhs, + AudioStreamDescriptor const& rhs) noexcept +{ + return !(lhs == rhs); +} + +AudioStreamDescriptor audioStreamDescriptorFromQAudioFormat ( + QAudioFormat const& format); + +Q_DECLARE_METATYPE (AudioStreamDescriptor) + +#endif diff --git a/Audio/FixtureAudioInput.cpp b/Audio/FixtureAudioInput.cpp new file mode 100644 index 00000000..e72118ef --- /dev/null +++ b/Audio/FixtureAudioInput.cpp @@ -0,0 +1,468 @@ +#include "Audio/FixtureAudioInput.hpp" + +#include "Audio/BWFFile.hpp" +#include "Detector/Detector.hpp" + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "moc_FixtureAudioInput.cpp" + +FixtureAudioInput::FixtureAudioInput (QString path, Profile profile, + QObject * parent) + : AudioInputSource {parent} + , m_path {std::move (path)} + , m_profile {profile} + , m_timer {new QTimer {this}} +{ + m_timer->setSingleShot (true); + m_timer->setTimerType (Qt::PreciseTimer); + connect (m_timer, &QTimer::timeout, this, &FixtureAudioInput::emitNextChunk); +} + +void FixtureAudioInput::start (QAudioDeviceInfo const&, int, AudioDevice * sink, + unsigned downSampleFactor, AudioDevice::Channel channel) +{ + stop (); + if (!sink) + { + fail (tr ("Synthetic audio input has no detector sink.")); + return; + } + if (Profile::Ft8 == m_profile + && downSampleFactor != 1 && downSampleFactor != 4) + { + fail (tr ("Synthetic FT8 audio input requires a downsample factor of 1 or 4.")); + return; + } + if (Profile::Jtty == m_profile + && downSampleFactor != 1 && downSampleFactor != 4) + { + fail (tr ("Synthetic JTTY audio input requires a downsample factor of 1 or 4.")); + return; + } + if (channel != AudioDevice::Mono) + { + fail (tr ("Synthetic audio input requires the mono input channel.")); + return; + } + + if (Profile::ReceiveHandoff == m_profile) + { + if (downSampleFactor != 1) + { + fail (tr ("Receive handoff fixture requires a downsample factor of 1.")); + return; + } + if (!sink->initialize (QIODevice::WriteOnly, channel)) + { + fail (tr ("Unable to initialize the detector for receive handoff input.")); + return; + } + constexpr qint64 periodFrames = 15 * detectorSampleRate; + m_pcm.resize (static_cast (2 * periodFrames * bytesPerFrame)); + auto * samples = reinterpret_cast (m_pcm.data ()); + for (qint64 frame = 0; frame < 2 * periodFrames; ++frame) + samples[frame] = handoffSample (frame / periodFrames, frame % periodFrames); + m_sink = sink; + m_inputSampleRate = detectorSampleRate; + m_chunkFrames = {3456}; + m_started = true; + m_suspended = false; + AudioStreamDescriptor descriptor; + descriptor.sample_rate_hz = detectorSampleRate; + descriptor.sample_encoding = AudioStreamDescriptor::SampleEncoding::SignedInteger; + descriptor.sample_size_bits = 16; + descriptor.byte_order = AudioStreamDescriptor::ByteOrder::LittleEndian; + descriptor.channel_count = 1; + descriptor.channel_layout = AudioStreamDescriptor::ChannelLayout::Mono; + descriptor.clock_domain = AudioStreamDescriptor::ClockDomain::SystemClock; + descriptor.timing_evidence = + AudioStreamDescriptor::TimingEvidence::CaptureTimeAnchored; + setStreamDescriptor (descriptor); + Q_EMIT status (tr ("Synthetic receive handoff fixture ready")); + maybeSchedule (); + return; + } + + BWFFile file {QAudioFormat {}, m_path}; + if (!file.open (BWFFile::ReadOnly)) + { + fail (tr ("Unable to open synthetic audio fixture %1: %2") + .arg (m_path, file.errorString ())); + return; + } + + auto const& format = file.format (); + if (format.codec () != "audio/pcm" || format.channelCount () != 1 + || format.sampleSize () != 16 + || format.sampleType () != QAudioFormat::SignedInt + || format.byteOrder () != QAudioFormat::LittleEndian) + { + fail (tr ("Synthetic audio fixture must be mono, signed 16-bit little-endian PCM.")); + return; + } + auto const expectedSampleRate = detectorSampleRate + * static_cast (downSampleFactor); + if (format.sampleRate () != expectedSampleRate) + { + fail (tr ("Synthetic audio fixture must be %1 Hz for downsample factor %2; found %3 Hz.") + .arg (expectedSampleRate).arg (downSampleFactor).arg (format.sampleRate ())); + return; + } + + if (Profile::Ft8 == m_profile) + { + auto const expectedFrames = qint64 {15} * format.sampleRate (); + if (file.size () != expectedFrames * bytesPerFrame) + { + fail (tr ("Synthetic FT8 audio fixture must contain exactly %1 frames; found %2.") + .arg (expectedFrames).arg (file.size () / bytesPerFrame)); + return; + } + } + else if (file.size () <= 0 || file.size () % bytesPerFrame) + { + fail (tr ("Synthetic JTTY audio fixture must contain complete PCM frames.")); + return; + } + + m_pcm = file.readAll (); + if (m_pcm.size () != file.size ()) + { + fail (tr ("Unable to read all PCM data from synthetic audio fixture.")); + return; + } + if (QSysInfo::ByteOrder != QSysInfo::LittleEndian) + { + fail (tr ("Synthetic audio input does not yet support big-endian hosts.")); + return; + } + if (!sink->initialize (QIODevice::WriteOnly, channel)) + { + fail (tr ("Unable to initialize the detector for synthetic audio input.")); + return; + } + + m_sink = sink; + m_inputSampleRate = format.sampleRate (); + if (Profile::Jtty == m_profile) + { + m_leadInFrames = m_inputSampleRate / 2; + m_tailFrames = 2 * m_inputSampleRate; + } + m_started = true; + auto descriptor = audioStreamDescriptorFromQAudioFormat (format); + if (descriptor.isValid ()) + { + descriptor.clock_domain = AudioStreamDescriptor::ClockDomain::SystemClock; + descriptor.timing_evidence = + AudioStreamDescriptor::TimingEvidence::CaptureTimeAnchored; + descriptor.can_report_discontinuities = false; + setStreamDescriptor (descriptor); + } + else + { + qWarning () << "Opened fixture audio stream has an unrecognized format"; + } + Q_EMIT status (tr ("Synthetic audio fixture ready")); + maybeSchedule (); +} + +void FixtureAudioInput::suspend () +{ + m_suspended = true; + m_timer->stop (); + Q_EMIT status (tr ("Synthetic audio input suspended")); +} + +void FixtureAudioInput::resume () +{ + if (m_sink) + { + m_sink->reset (); + } + m_suspended = false; + if (m_emitting && m_framesEmitted) + { + m_periodStartMs = QDateTime::currentMSecsSinceEpoch () + - (m_framesEmitted * 1000 / m_inputSampleRate); + publishCaptureAnchor (m_framesEmitted); + } + Q_EMIT status (tr ("Synthetic audio input receiving")); + maybeSchedule (); +} + +qint64 FixtureAudioInput::captureTimestamp (qint64 frameIndex) const +{ + return m_periodStartMs + frameIndex * 1000 / m_inputSampleRate; +} + +void FixtureAudioInput::publishCaptureAnchor (qint64 firstFrame) +{ + auto descriptor = streamDescriptor (); + if (descriptor.isValid () && m_periodStartMs > 0) + { + descriptor.capture_anchor_utc_ms = captureTimestamp (firstFrame); + setStreamDescriptor (descriptor); + } +} + +void FixtureAudioInput::stop () +{ + m_timer->stop (); + m_sink.clear (); + m_pcm.clear (); + m_leadInFrames = 0; + m_tailFrames = 0; + m_framesEmitted = 0; + m_periodStartMs = 0; + m_jttyAcknowledgedInputFrames = 0; + m_chunkIndex = 0; + m_started = false; + m_suspended = true; + m_emitting = false; + m_jttyDecoderReady = false; + m_waitingForJttyDecoder = false; + clearStreamDescriptor (); +} + +void FixtureAudioInput::reset (bool) +{ +} + +void FixtureAudioInput::arm () +{ + if (Profile::ReceiveHandoff == m_profile) m_suspended = false; + m_armed = true; + maybeSchedule (); +} + +void FixtureAudioInput::acknowledgeJttyFrames (qint64 detectorFrames) +{ + if (Profile::Jtty != m_profile || detectorFrames < 0) return; + + auto const inputFrames = detectorFrames * m_inputSampleRate / detectorSampleRate; + m_jttyAcknowledgedInputFrames = std::max ( + m_jttyAcknowledgedInputFrames, inputFrames); + m_jttyDecoderReady = true; + if (m_waitingForJttyDecoder) + { + m_waitingForJttyDecoder = false; + scheduleNextChunk (); + } +} + +void FixtureAudioInput::advanceHandoff (qint64 captureFrames, bool fresh, bool flush) +{ + if (m_profile != Profile::ReceiveHandoff || !m_started || !m_sink + || captureFrames < 0 || captureFrames > totalFrames ()) + { + fail (tr ("Invalid receive handoff checkpoint %1.").arg (captureFrames)); + return; + } + if (!m_emitting) + { + m_armed = true; + m_suspended = false; + maybeSchedule (); + } + if (fresh) + { + m_framesEmitted = 0; + m_chunkIndex = 0; + m_periodStartMs += 45000; + publishCaptureAnchor (0); + } + if (captureFrames < m_framesEmitted) + { + fail (tr ("Receive handoff capture moved backwards: %1 to %2.") + .arg (m_framesEmitted).arg (captureFrames)); + return; + } + constexpr qint64 periodFrames = 15 * detectorSampleRate; + while (m_framesEmitted < captureFrames) + { + auto const frames = std::min ({qint64 {3456}, captureFrames - m_framesEmitted, + periodFrames - m_framesEmitted % periodFrames}); + auto const bytes = frames * bytesPerFrame; + if (m_sink->write (m_pcm.constData () + m_framesEmitted * bytesPerFrame, bytes) + != bytes) + { + fail (tr ("Detector did not accept handoff audio at %1.") + .arg (m_framesEmitted)); + return; + } + m_framesEmitted += frames; + } + if (flush) + { + auto * detector = qobject_cast (m_sink.data ()); + if (!detector) + { + fail (tr ("Receive handoff sink is not a Detector.")); + return; + } + detector->flushBufferedFrames (captureFrames % periodFrames); + } + Q_EMIT handoffCheckpoint (m_framesEmitted); +} + +QString FixtureAudioInput::emitFt8RolloverPrefix () +{ + if (Profile::Ft8 != m_profile || !m_sink || m_emitting + || m_framesEmitted != 15 * m_inputSampleRate) + { + return tr ("FT8 rollover requires exhausted period A: frames=%1 emitting=%2.") + .arg (m_framesEmitted).arg (m_emitting); + } + auto const frames = ft8RolloverFrames () * m_inputSampleRate / detectorSampleRate; + QByteArray prefix (frames * bytesPerFrame, '\0'); + std::fill_n (reinterpret_cast (prefix.data ()), frames, + ft8RolloverSample ()); + auto const written = m_sink->write (prefix.constData (), prefix.size ()); + if (written != prefix.size ()) + { + return tr ("FT8 rollover accepted %1 of %2 bytes.") + .arg (written).arg (prefix.size ()); + } + m_framesEmitted += frames; + return {}; +} + +void FixtureAudioInput::fail (QString const& message) +{ + stop (); + Q_EMIT error (message); +} + +void FixtureAudioInput::maybeSchedule () +{ + if (!m_started || !m_armed || m_suspended || m_emitting) + { + return; + } + + auto const now = QDateTime::currentMSecsSinceEpoch (); + if (Profile::Ft8 == m_profile || Profile::ReceiveHandoff == m_profile) + { + constexpr qint64 periodMs = 15000; + m_periodStartMs = ((now / periodMs) + 1) * periodMs; + } + else + { + constexpr qint64 periodMs = 180000; + auto const fixtureDurationMs = (totalFrames () * 1000 + m_inputSampleRate - 1) + / m_inputSampleRate; + auto const periodOffsetMs = now % periodMs; + m_periodStartMs = periodOffsetMs + fixtureDurationMs <= periodMs + ? now : ((now / periodMs) + 1) * periodMs; + } + m_emitting = true; + publishCaptureAnchor (m_framesEmitted); + if (Profile::ReceiveHandoff == m_profile) return; + auto const delay = Profile::ReceiveHandoff == m_profile ? qint64 {0} + : std::max (0, m_periodStartMs - now); + m_timer->start (static_cast (delay)); +} + +void FixtureAudioInput::scheduleNextChunk () +{ + if (Profile::ReceiveHandoff == m_profile) + { + m_timer->start (0); + return; + } + auto const target = captureTimestamp (m_framesEmitted); + auto const delay = std::max (0, target - QDateTime::currentMSecsSinceEpoch ()); + m_timer->start (static_cast (delay)); +} + +void FixtureAudioInput::emitNextChunk () +{ + if (!m_emitting || m_suspended || !m_sink) + { + return; + } + + auto const target = captureTimestamp (m_framesEmitted); + auto const now = QDateTime::currentMSecsSinceEpoch (); + if (Profile::ReceiveHandoff != m_profile && now < target) + { + m_timer->start (static_cast (target - now)); + return; + } + + if (!m_framesEmitted) + { + Q_EMIT emissionStarted (m_periodStartMs); + } + + auto remainingFrames = totalFrames () - m_framesEmitted; + if (Profile::Jtty == m_profile) + { + constexpr qint64 maxDetectorLeadFrames = 10240; + auto const maxInputLeadFrames = + maxDetectorLeadFrames * m_inputSampleRate / detectorSampleRate; + auto const allowedFrames = m_jttyDecoderReady + ? m_jttyAcknowledgedInputFrames + maxInputLeadFrames + : m_leadInFrames; + remainingFrames = std::min ( + remainingFrames, allowedFrames - m_framesEmitted); + if (remainingFrames <= 0) + { + m_waitingForJttyDecoder = true; + return; + } + } + auto chunkFrames = std::min ( + remainingFrames, m_chunkFrames.at (m_chunkIndex % m_chunkFrames.size ())); + if (Profile::ReceiveHandoff == m_profile) + { + constexpr qint64 periodFrames = 15 * detectorSampleRate; + auto const untilBoundary = periodFrames - m_framesEmitted % periodFrames; + chunkFrames = std::min (chunkFrames, untilBoundary); + } + auto const chunkBytes = chunkFrames * bytesPerFrame; + QByteArray chunk (static_cast (chunkBytes), '\0'); + auto const chunkStart = m_framesEmitted; + auto const chunkEnd = chunkStart + chunkFrames; + auto const fixtureStart = m_leadInFrames; + auto const fixtureEnd = fixtureStart + fixtureFrames (); + auto const copyStart = std::max (chunkStart, fixtureStart); + auto const copyEnd = std::min (chunkEnd, fixtureEnd); + if (copyStart < copyEnd) + { + auto const sourceOffset = (copyStart - fixtureStart) * bytesPerFrame; + auto const targetOffset = (copyStart - chunkStart) * bytesPerFrame; + auto const copyBytes = (copyEnd - copyStart) * bytesPerFrame; + std::memcpy (chunk.data () + targetOffset, + m_pcm.constData () + sourceOffset, + static_cast (copyBytes)); + } + auto const written = m_sink->write (chunk.constData (), chunkBytes); + if (written != chunkBytes) + { + fail (tr ("Detector accepted %1 of %2 synthetic PCM bytes.") + .arg (written).arg (chunkBytes)); + return; + } + + m_framesEmitted += chunkFrames; + ++m_chunkIndex; + if (m_framesEmitted == totalFrames ()) + { + m_emitting = false; + Q_EMIT status (tr ("Synthetic audio fixture exhausted")); + Q_EMIT emissionFinished (m_framesEmitted); + return; + } + scheduleNextChunk (); +} diff --git a/Audio/FixtureAudioInput.hpp b/Audio/FixtureAudioInput.hpp new file mode 100644 index 00000000..8bca1af9 --- /dev/null +++ b/Audio/FixtureAudioInput.hpp @@ -0,0 +1,89 @@ +// -*- Mode: C++ -*- +#ifndef FIXTURE_AUDIO_INPUT_HPP__ +#define FIXTURE_AUDIO_INPUT_HPP__ + +#include "Audio/AudioInputSource.hpp" + +#include +#include +#include +#include + +class QTimer; + +class FixtureAudioInput final + : public AudioInputSource +{ + Q_OBJECT + +public: + enum class Profile + { + Ft8, + Jtty, + ReceiveHandoff + }; + + explicit FixtureAudioInput (QString path, Profile profile = Profile::Ft8, + QObject * parent = nullptr); + + Q_SLOT void start (QAudioDeviceInfo const&, int framesPerBuffer, + AudioDevice * sink, unsigned downSampleFactor, + AudioDevice::Channel channel = AudioDevice::Mono) override; + Q_SLOT void suspend () override; + Q_SLOT void resume () override; + Q_SLOT void stop () override; + Q_SLOT void reset (bool reportDroppedFrames) override; + Q_SLOT void arm (); + Q_SLOT void acknowledgeJttyFrames (qint64 detectorFrames); + QString emitFt8RolloverPrefix (); + static constexpr int ft8RolloverFrames () {return 6912;} + static constexpr qint16 ft8RolloverSample () {return -12345;} + Q_SLOT void advanceHandoff (qint64 captureFrames, bool fresh, bool flush); + static qint16 handoffSample (qint64 period, qint64 offset) + { + return static_cast ((period ? -1 : 1) * (1000 + offset % 7001)); + } + + Q_SIGNAL void emissionStarted (qint64 utcStartMilliseconds) const; + Q_SIGNAL void emissionFinished (qint64 frames) const; + Q_SIGNAL void handoffCheckpoint (qint64 captureFrames) const; + +private: + qint64 fixtureFrames () const {return m_pcm.size () / bytesPerFrame;} + qint64 totalFrames () const + { + return m_leadInFrames + fixtureFrames () + m_tailFrames; + } + void fail (QString const& message); + qint64 captureTimestamp (qint64 frameIndex) const; + void publishCaptureAnchor (qint64 firstFrame); + void maybeSchedule (); + void scheduleNextChunk (); + Q_SLOT void emitNextChunk (); + + static constexpr int detectorSampleRate = 12000; + static constexpr int bytesPerFrame = 2; + + QString m_path; + Profile m_profile; + QByteArray m_pcm; + QPointer m_sink; + QTimer * m_timer; + QVector m_chunkFrames {257, 509, 1021, 2039}; + int m_inputSampleRate {detectorSampleRate}; + qint64 m_leadInFrames {0}; + qint64 m_tailFrames {0}; + qint64 m_framesEmitted {0}; + qint64 m_periodStartMs {0}; + qint64 m_jttyAcknowledgedInputFrames {0}; + int m_chunkIndex {0}; + bool m_started {false}; + bool m_armed {false}; + bool m_suspended {true}; + bool m_emitting {false}; + bool m_jttyDecoderReady {false}; + bool m_waitingForJttyDecoder {false}; +}; + +#endif diff --git a/Audio/FixtureSoundOutput.cpp b/Audio/FixtureSoundOutput.cpp new file mode 100644 index 00000000..ce5ca1ca --- /dev/null +++ b/Audio/FixtureSoundOutput.cpp @@ -0,0 +1,298 @@ +#include "Audio/FixtureSoundOutput.hpp" + +#include "Audio/AudioDevice.hpp" +#include "Audio/BWFFile.hpp" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "moc_FixtureSoundOutput.cpp" + +FixtureSoundOutput::FixtureSoundOutput (QString capturePath, Profile profile, + QObject * parent) + : SoundOutput {parent} + , m_capturePath {std::move (capturePath)} + , m_profile {profile} + , m_timer {new QTimer {this}} +{ + m_timer->setSingleShot (true); + connect (m_timer, &QTimer::timeout, this, &FixtureSoundOutput::pullAudio); +} + +FixtureSoundOutput::~FixtureSoundOutput () +{ + finishCapture (); +} + +int FixtureSoundOutput::bufferSize () const +{ + return simulatedBufferBytes; +} + +void FixtureSoundOutput::setFormat (QAudioDeviceInfo const&, unsigned, int) +{ +} + +void FixtureSoundOutput::restart (QIODevice * source) +{ + restart (source, -1); +} + +void FixtureSoundOutput::restart (QIODevice * source, qint64 periodOffsetMs) +{ + ++m_restartCount; + finishCapture (); + + if (!source || !source->isReadable ()) + { + fail (tr ("Synthetic audio output requires a readable source.")); + return; + } + if (m_capturePath.isEmpty ()) + { + fail (tr ("Synthetic audio output requires a capture path.")); + return; + } + if (QSysInfo::ByteOrder != QSysInfo::LittleEndian) + { + fail (tr ("Synthetic audio output does not yet support big-endian hosts.")); + return; + } + + m_sourceBytesPerFrame = bytesPerCapturedFrame; + m_sourceSampleOffset = 0; + if (auto const audioSource = dynamic_cast (source)) + { + m_sourceBytesPerFrame = static_cast (audioSource->bytesPerFrame ()); + if (audioSource->channel () == AudioDevice::Right) + { + m_sourceSampleOffset = bytesPerCapturedFrame; + } + } + if (m_sourceBytesPerFrame != bytesPerCapturedFrame + && m_sourceBytesPerFrame != 2 * bytesPerCapturedFrame) + { + fail (tr ("Synthetic audio output received an unsupported source frame size.")); + return; + } + + QAudioFormat format; + format.setByteOrder (QAudioFormat::LittleEndian); + format.setChannelCount (1); + format.setCodec ("audio/pcm"); + format.setSampleRate (sampleRate); + format.setSampleSize (16); + format.setSampleType (QAudioFormat::SignedInt); + m_capture.reset (new BWFFile {format, m_capturePath}); + if (!m_capture->open (BWFFile::WriteOnly)) + { + auto const detail = m_capture->errorString (); + m_capture.reset (); + fail (tr ("Unable to open synthetic audio output capture %1: %2") + .arg (m_capturePath, detail)); + return; + } + + m_source = source; + m_framesPulled = 0; + m_scheduleOriginFrame = 0; + m_capturedFrames.store (0); + m_maxInternalSilentFrames.store (0); + m_chunkIndex = 0; + m_silentFrames = 0; + m_nonSilentAudioSeen = false; + m_active = true; + m_elapsed.start (); + if (Profile::Ft8Period == m_profile) + { + constexpr qint64 periodMs = 15000; + auto const capturedOffsetMs = periodOffsetMs >= 0 + ? periodOffsetMs : QDateTime::currentMSecsSinceEpoch () % periodMs; + auto const prefixFrames = capturedOffsetMs * sampleRate / 1000; + if (!appendSilence (prefixFrames)) return; + m_framesPulled = prefixFrames; + m_scheduleOriginFrame = prefixFrames; + } + Q_EMIT captureStarted (m_capturePath); + Q_EMIT audioOutputActive (); + m_timer->start (0); +} + +void FixtureSoundOutput::stop () +{ + if (!m_active) + { + return; + } + ++m_stopCount; + finishCapture (); +} + +void FixtureSoundOutput::finishCapture () +{ + if (!m_active) + { + return; + } + + m_active = false; + m_timer->stop (); + m_source.clear (); + if (Profile::Ft8Period == m_profile && m_capture + && m_capturedFrames.load () < ft8PeriodFrames) + { + if (!appendSilence (ft8PeriodFrames - m_capturedFrames.load ())) return; + m_framesPulled = ft8PeriodFrames; + } + if (m_capture) + { + m_capture->close (); + m_capture.reset (); + } + auto const frames = m_capturedFrames.load (); + Q_EMIT audioOutputIdle (); + Q_EMIT captureStopped (m_capturePath, frames); +} + +bool FixtureSoundOutput::appendCapturedPcm (QByteArray const& pcm) +{ + auto const frames = pcm.size () / bytesPerCapturedFrame; + if (pcm.size () % bytesPerCapturedFrame) + { + fail (tr ("Synthetic audio output received a partial captured frame.")); + return false; + } + if (Profile::Ft8Period == m_profile + && m_capturedFrames.load () + frames > ft8PeriodFrames) + { + fail (tr ("Synthetic FT8 audio output exceeded its 15-second capture period.")); + return false; + } + auto const written = m_capture->write (pcm); + if (written != pcm.size ()) + { + fail (tr ("Synthetic audio output wrote %1 of %2 capture bytes: %3") + .arg (written).arg (pcm.size ()).arg (m_capture->errorString ())); + return false; + } + m_capturedFrames.store (m_capturedFrames.load () + frames); + return true; +} + +bool FixtureSoundOutput::appendSilence (qint64 frames) +{ + while (frames > 0) + { + auto const chunkFrames = static_cast (std::min (frames, 4096)); + if (!appendCapturedPcm (QByteArray {chunkFrames * bytesPerCapturedFrame, '\0'})) + { + return false; + } + frames -= chunkFrames; + } + return true; +} + +void FixtureSoundOutput::fail (QString const& message) +{ + Q_EMIT captureFailed (message); + Q_EMIT error (message); + finishCapture (); +} + +void FixtureSoundOutput::scheduleNextPull () +{ + auto const targetMs = (m_framesPulled - m_scheduleOriginFrame) * 1000 + / sampleRate; + auto const delayMs = std::max (0, targetMs - m_elapsed.elapsed ()); + m_timer->start (static_cast (delayMs)); +} + +void FixtureSoundOutput::pullAudio () +{ + if (!m_active || !m_source || !m_capture) + { + if (m_active) + { + fail (tr ("Synthetic audio output source disappeared during capture.")); + } + return; + } + + if (Profile::Ft8Period == m_profile + && m_capturedFrames.load () == ft8PeriodFrames) + { + fail (tr ("Synthetic FT8 audio output continued beyond its 15-second capture period.")); + return; + } + + auto frames = m_chunkFrames.at (m_chunkIndex % m_chunkFrames.size ()); + if (Profile::Ft8Period == m_profile) + { + frames = static_cast (std::min ( + frames, ft8PeriodFrames - m_capturedFrames.load ())); + } + auto const requestedBytes = qint64 (frames) * m_sourceBytesPerFrame; + auto const sourcePcm = m_source->read (requestedBytes); + if (Profile::JttyStrict == m_profile && sourcePcm.size () != requestedBytes) + { + fail (tr ("Synthetic audio output received %1 of %2 source bytes.") + .arg (sourcePcm.size ()).arg (requestedBytes)); + return; + } + if (sourcePcm.size () < 0 || sourcePcm.size () > requestedBytes + || sourcePcm.size () % m_sourceBytesPerFrame) + { + fail (tr ("Synthetic audio output received an invalid source byte count.")); + return; + } + + QByteArray capturedPcm (frames * bytesPerCapturedFrame, '\0'); + auto const sourceFrames = sourcePcm.size () / m_sourceBytesPerFrame; + for (int frame = 0; frame < frames; ++frame) + { + qint16 sample {0}; + if (frame < sourceFrames) + { + std::memcpy (&sample, + sourcePcm.constData () + frame * m_sourceBytesPerFrame + + m_sourceSampleOffset, + sizeof sample); + } + if (!m_nonSilentAudioSeen && sample) + { + m_nonSilentAudioSeen = true; + Q_EMIT nonSilentAudioStarted (m_framesPulled + frame); + } + if (sample) + { + if (m_nonSilentAudioSeen) + { + m_maxInternalSilentFrames.store ( + std::max (m_maxInternalSilentFrames.load (), m_silentFrames)); + } + m_silentFrames = 0; + } + else if (m_nonSilentAudioSeen) + { + ++m_silentFrames; + } + auto const littleEndianSample = qToLittleEndian (sample); + std::memcpy (capturedPcm.data () + frame * bytesPerCapturedFrame, + &littleEndianSample, sizeof littleEndianSample); + } + + if (!appendCapturedPcm (capturedPcm)) return; + + m_framesPulled += frames; + ++m_chunkIndex; + scheduleNextPull (); +} diff --git a/Audio/FixtureSoundOutput.hpp b/Audio/FixtureSoundOutput.hpp new file mode 100644 index 00000000..762502cf --- /dev/null +++ b/Audio/FixtureSoundOutput.hpp @@ -0,0 +1,93 @@ +// -*- Mode: C++ -*- +#ifndef FIXTURE_SOUND_OUTPUT_HPP__ +#define FIXTURE_SOUND_OUTPUT_HPP__ + +#include "Audio/soundout.h" + +#include +#include + +#include +#include +#include +#include + +class AudioDevice; +class BWFFile; +class QIODevice; +class QTimer; + +class FixtureSoundOutput final + : public SoundOutput +{ + Q_OBJECT + +public: + enum class Profile + { + JttyStrict, + Ft8Period + }; + + explicit FixtureSoundOutput (QString capturePath, + Profile profile = Profile::JttyStrict, + QObject * parent = nullptr); + ~FixtureSoundOutput () override; + + int bufferSize () const override; + qint64 capturedFrames () const {return m_capturedFrames.load ();} + qint64 maxInternalSilentFrames () const + { + return m_maxInternalSilentFrames.load (); + } + int restartCount () const {return m_restartCount.load ();} + int stopCount () const {return m_stopCount.load ();} + QString const& capturePath () const {return m_capturePath;} + +public Q_SLOTS: + void setFormat (QAudioDeviceInfo const&, unsigned, int = 0) override; + void restart (QIODevice * source) override; + void restart (QIODevice * source, qint64 periodOffsetMs) override; + void stop () override; + +Q_SIGNALS: + void captureStarted (QString path) const; + void nonSilentAudioStarted (qint64 frame) const; + void captureStopped (QString path, qint64 frames) const; + void captureFailed (QString message) const; + +private: + bool appendCapturedPcm (QByteArray const& pcm); + bool appendSilence (qint64 frames); + void finishCapture (); + void fail (QString const& message); + void scheduleNextPull (); + Q_SLOT void pullAudio (); + + static constexpr int sampleRate = 48000; + static constexpr qint64 ft8PeriodFrames = 15 * sampleRate; + static constexpr int bytesPerCapturedFrame = 2; + static constexpr int simulatedBufferBytes = 9600; + + QString m_capturePath; + Profile m_profile; + QPointer m_source; + std::unique_ptr m_capture; + QTimer * m_timer; + QElapsedTimer m_elapsed; + QVector m_chunkFrames {257, 509, 1021, 2039}; + qint64 m_framesPulled {0}; + qint64 m_scheduleOriginFrame {0}; + std::atomic m_capturedFrames {0}; + std::atomic m_maxInternalSilentFrames {0}; + std::atomic m_restartCount {0}; + std::atomic m_stopCount {0}; + int m_chunkIndex {0}; + int m_sourceBytesPerFrame {bytesPerCapturedFrame}; + int m_sourceSampleOffset {0}; + qint64 m_silentFrames {0}; + bool m_active {false}; + bool m_nonSilentAudioSeen {false}; +}; + +#endif diff --git a/Audio/TxAudioQueue.cpp b/Audio/TxAudioQueue.cpp new file mode 100644 index 00000000..9217d199 --- /dev/null +++ b/Audio/TxAudioQueue.cpp @@ -0,0 +1,124 @@ +#include "TxAudioQueue.hpp" + +#include + +#include "TxAudioQueueEpochSnapshot.hpp" +#include "Modulator/JttyPcmFifo.hpp" + +class TxAudioQueue::Impl +{ +public: + explicit Impl (qint64 capacity_samples) + : fifo {capacity_samples} + { + } + + bool tryEpoch (TxAudioQueueEpoch& result) const noexcept + { + auto const before = epoch_sequence.load (std::memory_order_acquire); + if (before & 1) + { + return false; + } + + auto const current_epoch = epoch.load (std::memory_order_relaxed); + // Keep payload reads ahead of the sequence validation load. + std::atomic_thread_fence (std::memory_order_acquire); + auto const after = epoch_sequence.load (std::memory_order_relaxed); + return TxAudioQueueDetail::tryMakeEpochSnapshot ( + before, current_epoch, after, result); + } + + void clear (TxAudioQueueEpoch value) + { + epoch_sequence.fetch_add (1, std::memory_order_acq_rel); + fifo.clear (value.value ()); + epoch.store (value.value (), std::memory_order_relaxed); + epoch_sequence.fetch_add (1, std::memory_order_release); + } + + JttyPcmFifo fifo; + std::atomic epoch {0}; + std::atomic epoch_sequence {0}; +}; + +TxAudioQueue::TxAudioQueue () + : TxAudioQueue {defaultCapacity ()} +{ +} + +TxAudioQueue::TxAudioQueue (qint64 capacity_samples) + : impl_ {new Impl {capacity_samples}} +{ +} + +TxAudioQueue::~TxAudioQueue () = default; + +TxAudioQueueEnqueueResult TxAudioQueue::enqueue ( + QVector const& samples, TxAudioQueueEpoch epoch) +{ + return enqueue (samples.constData (), samples.size (), epoch); +} + +TxAudioQueueEnqueueResult TxAudioQueue::enqueue ( + qint16 const * samples, qint64 count, TxAudioQueueEpoch epoch) +{ + bool accepted {false}; + TxAudioQueueEpoch current_epoch; + if (impl_->tryEpoch (current_epoch) && epoch == current_epoch) + { + accepted = impl_->fifo.enqueue (samples, count, epoch.value ()); + } + return TxAudioQueueEnqueueResult {accepted, progress ()}; +} + +void TxAudioQueue::clear (TxAudioQueueEpoch epoch) +{ + impl_->clear (epoch); +} + +void TxAudioQueue::applyPendingReset () noexcept +{ + impl_->fifo.applyPendingReset (); +} + +qint16 TxAudioQueue::pullSample (qint64 drain_guard) noexcept +{ + return impl_->fifo.pullSample (drain_guard); +} + +TxAudioQueueDrainState TxAudioQueue::takeDrainReady () noexcept +{ + TxAudioQueueEpoch epoch_before; + if (!impl_->tryEpoch (epoch_before)) + { + return TxAudioQueueDrainState {}; + } + + auto const raw = impl_->fifo.takeDrainReady (); + TxAudioQueueEpoch epoch; + if (!impl_->tryEpoch (epoch) || !raw.ready + || epoch_before != epoch + || raw.epoch != epoch.value ()) + { + return TxAudioQueueDrainState {false, epoch, 0}; + } + return TxAudioQueueDrainState {true, epoch, raw.totalAtDrain}; +} + +TxAudioQueueProgress TxAudioQueue::progress () const noexcept +{ + TxAudioQueueEpoch epoch; + impl_->tryEpoch (epoch); + return TxAudioQueueProgress { + epoch, + impl_->fifo.queuedReal (), + impl_->fifo.servedReal (), + impl_->fifo.totalReal () + }; +} + +qint64 TxAudioQueue::capacity () const noexcept +{ + return impl_->fifo.capacity (); +} diff --git a/Audio/TxAudioQueue.hpp b/Audio/TxAudioQueue.hpp new file mode 100644 index 00000000..8e1a4710 --- /dev/null +++ b/Audio/TxAudioQueue.hpp @@ -0,0 +1,93 @@ +#ifndef TX_AUDIO_QUEUE_HPP_ +#define TX_AUDIO_QUEUE_HPP_ + +#include + +#include +#include +#include + +struct TxAudioQueueEpoch +{ + constexpr TxAudioQueueEpoch () noexcept : value_ {0} {} + explicit constexpr TxAudioQueueEpoch (qint64 value) noexcept : value_ {value} {} + + static constexpr TxAudioQueueEpoch invalid () noexcept {return TxAudioQueueEpoch {};} + constexpr bool isValid () const noexcept {return value_ > 0;} + constexpr qint64 value () const noexcept {return value_;} + +private: + qint64 value_; +}; + +inline constexpr bool operator == (TxAudioQueueEpoch lhs, + TxAudioQueueEpoch rhs) noexcept +{ + return lhs.value () == rhs.value (); +} + +inline constexpr bool operator != (TxAudioQueueEpoch lhs, + TxAudioQueueEpoch rhs) noexcept +{ + return !(lhs == rhs); +} + +struct TxAudioQueueProgress +{ + TxAudioQueueEpoch epoch {}; + qint64 queued_samples {0}; + qint64 served_samples {0}; + qint64 total_samples {0}; +}; + +struct TxAudioQueueDrainState +{ + bool ready {false}; + TxAudioQueueEpoch epoch {}; + qint64 total_at_drain {0}; +}; + +struct TxAudioQueueEnqueueResult +{ + bool accepted {false}; + TxAudioQueueProgress progress {}; +}; + +class TxAudioQueue +{ +public: + // One serialized producer owns clear/enqueue; one consumer owns reset/pull/drain. + static constexpr qint64 defaultCapacity () noexcept {return 60 * 48000;} + + TxAudioQueue (); + explicit TxAudioQueue (qint64 capacity_samples); + ~TxAudioQueue (); + + TxAudioQueue (TxAudioQueue const&) = delete; + TxAudioQueue& operator = (TxAudioQueue const&) = delete; + + TxAudioQueueEnqueueResult enqueue (QVector const& samples, + TxAudioQueueEpoch epoch); + TxAudioQueueEnqueueResult enqueue (qint16 const * samples, qint64 count, + TxAudioQueueEpoch epoch); + void clear (TxAudioQueueEpoch epoch); + void applyPendingReset () noexcept; + + qint16 pullSample (qint64 drain_guard) noexcept; + TxAudioQueueDrainState takeDrainReady () noexcept; + + // A concurrent clear may produce progress with an invalid epoch. + TxAudioQueueProgress progress () const noexcept; + qint64 capacity () const noexcept; + +private: + class Impl; + std::unique_ptr impl_; +}; + +Q_DECLARE_METATYPE (TxAudioQueueEpoch) +Q_DECLARE_METATYPE (TxAudioQueueProgress) +Q_DECLARE_METATYPE (TxAudioQueueDrainState) +Q_DECLARE_METATYPE (TxAudioQueueEnqueueResult) + +#endif diff --git a/Audio/TxAudioQueueEpochSnapshot.hpp b/Audio/TxAudioQueueEpochSnapshot.hpp new file mode 100644 index 00000000..21b6d052 --- /dev/null +++ b/Audio/TxAudioQueueEpochSnapshot.hpp @@ -0,0 +1,23 @@ +#ifndef TX_AUDIO_QUEUE_EPOCH_SNAPSHOT_HPP_ +#define TX_AUDIO_QUEUE_EPOCH_SNAPSHOT_HPP_ + +#include "TxAudioQueue.hpp" + +namespace TxAudioQueueDetail +{ + inline bool tryMakeEpochSnapshot (quint64 sequence_before, + qint64 epoch, + quint64 sequence_after, + TxAudioQueueEpoch& result) noexcept + { + if ((sequence_before & 1) || sequence_before != sequence_after) + { + return false; + } + + result = TxAudioQueueEpoch {epoch}; + return true; + } +} + +#endif diff --git a/Audio/TxIdentity.hpp b/Audio/TxIdentity.hpp new file mode 100644 index 00000000..b0c00b49 --- /dev/null +++ b/Audio/TxIdentity.hpp @@ -0,0 +1,99 @@ +#ifndef TX_IDENTITY_HPP_ +#define TX_IDENTITY_HPP_ + +#include +#include + +namespace TxEvidence +{ + struct TxSessionId + { + constexpr TxSessionId () noexcept : value_ {0} {} + explicit constexpr TxSessionId (qint64 value) noexcept : value_ {value} {} + + static constexpr TxSessionId invalid () noexcept {return TxSessionId {};} + constexpr bool isValid () const noexcept {return value_ > 0;} + constexpr qint64 value () const noexcept {return value_;} + + private: + qint64 value_; + }; + + struct TxGeneration + { + constexpr TxGeneration () noexcept : value_ {0} {} + explicit constexpr TxGeneration (qint64 value) noexcept : value_ {value} {} + + static constexpr TxGeneration invalid () noexcept {return TxGeneration {};} + constexpr bool isValid () const noexcept {return value_ > 0;} + constexpr qint64 value () const noexcept {return value_;} + + private: + qint64 value_; + }; + + inline constexpr bool operator == (TxSessionId lhs, TxSessionId rhs) noexcept + { + return lhs.value () == rhs.value (); + } + + inline constexpr bool operator != (TxSessionId lhs, TxSessionId rhs) noexcept + { + return !(lhs == rhs); + } + + inline constexpr bool operator < (TxSessionId lhs, TxSessionId rhs) noexcept + { + return lhs.value () < rhs.value (); + } + + inline constexpr bool operator <= (TxSessionId lhs, TxSessionId rhs) noexcept + { + return !(rhs < lhs); + } + + inline constexpr bool operator > (TxSessionId lhs, TxSessionId rhs) noexcept + { + return rhs < lhs; + } + + inline constexpr bool operator >= (TxSessionId lhs, TxSessionId rhs) noexcept + { + return !(lhs < rhs); + } + + inline constexpr bool operator == (TxGeneration lhs, TxGeneration rhs) noexcept + { + return lhs.value () == rhs.value (); + } + + inline constexpr bool operator != (TxGeneration lhs, TxGeneration rhs) noexcept + { + return !(lhs == rhs); + } + + inline constexpr bool operator < (TxGeneration lhs, TxGeneration rhs) noexcept + { + return lhs.value () < rhs.value (); + } + + inline constexpr bool operator <= (TxGeneration lhs, TxGeneration rhs) noexcept + { + return !(rhs < lhs); + } + + inline constexpr bool operator > (TxGeneration lhs, TxGeneration rhs) noexcept + { + return rhs < lhs; + } + + inline constexpr bool operator >= (TxGeneration lhs, TxGeneration rhs) noexcept + { + return !(lhs < rhs); + } +} + +Q_DECLARE_METATYPE (TxEvidence::TxSessionId) +Q_DECLARE_METATYPE (TxEvidence::TxGeneration) + +#endif diff --git a/Audio/TxPlaybackDiagnostics.cpp b/Audio/TxPlaybackDiagnostics.cpp new file mode 100644 index 00000000..5e99b6ca --- /dev/null +++ b/Audio/TxPlaybackDiagnostics.cpp @@ -0,0 +1,443 @@ +#include "Audio/TxPlaybackDiagnostics.hpp" + +#include + +#include + +namespace +{ + std::atomic next_session_id {1}; + std::atomic next_generation {1}; + + qint64 framesFromUsecs (qint64 usecs, int sampleRateHz) + { + if (usecs < 0 || sampleRateHz <= 0) + { + return -1; + } + return usecs * sampleRateHz / 1000000; + } + + QString reasonName (TxEvidence::TxStopReason reason) + { + switch (reason) + { + case TxEvidence::TxStopReason::NormalEnd: return "normal-end"; + case TxEvidence::TxStopReason::UserHalt: return "user-halt"; + case TxEvidence::TxStopReason::Watchdog: return "watchdog"; + case TxEvidence::TxStopReason::Error: return "error"; + case TxEvidence::TxStopReason::ModeChange: return "mode-change"; + } + return "unknown"; + } + + QString tierName (TxEvidence::TxPlayoutTier tier) + { + switch (tier) + { + case TxEvidence::TxPlayoutTier::DeviceClock: return "device-clock"; + case TxEvidence::TxPlayoutTier::DeadReckoning: return "dead-reckoning"; + case TxEvidence::TxPlayoutTier::Unavailable: return "unavailable"; + } + return "unavailable"; + } + + int tierStrength (TxEvidence::TxPlayoutTier tier) + { + switch (tier) + { + case TxEvidence::TxPlayoutTier::Unavailable: return 0; + case TxEvidence::TxPlayoutTier::DeadReckoning: return 1; + case TxEvidence::TxPlayoutTier::DeviceClock: return 2; + } + return 0; + } + + QString combinedDiagnostic (QString const& source, QString const& playout) + { + if (source.isEmpty () || source == playout) return playout; + if (playout.isEmpty ()) return source; + return source + QStringLiteral (" | ") + playout; + } +} + +namespace TxEvidence +{ + TxPlaybackDiagnostics::TxPlaybackDiagnostics () = default; + TxPlaybackDiagnostics::~TxPlaybackDiagnostics () = default; + + TxSessionId TxPlaybackDiagnostics::allocateSessionId () + { + return TxSessionId {next_session_id.fetch_add (1, std::memory_order_relaxed)}; + } + + TxGeneration TxPlaybackDiagnostics::allocateGeneration () + { + return TxGeneration {next_generation.fetch_add (1, std::memory_order_relaxed)}; + } + + TxStopDecision TxPlaybackDiagnostics::decisionFor (TxStopReason reason, + bool zeroTailMode) + { + TxStopDecision decision; + decision.reason = reason; + decision.tail_ms = zeroTailMode ? 0 : 200; + return decision; + } + + TxSessionId TxPlaybackDiagnostics::beginSession (QString const& mode, + int sampleRateHz, + qint64 committedEndSample, + bool targetKnown, + QString const& diagnostic) + { + auto const sessionId = allocateSessionId (); + TxStartSnapshot snapshot; + snapshot.session_id = sessionId; + snapshot.generation = allocateGeneration (); + snapshot.mode = mode; + snapshot.sample_rate_hz = sampleRateHz; + snapshot.committed_end_sample = committedEndSample; + snapshot.target_known = targetKnown; + snapshot.diagnostic = diagnostic; + if (!commitStart (snapshot)) return TxSessionId::invalid (); + findActive (sessionId, snapshot.generation)->claimed = false; + return sessionId; + } + + TxGeneration TxPlaybackDiagnostics::beginGeneration (TxSessionId sessionId) + { + for (auto& active : active_) + { + if (active.start.session_id == sessionId && !active.stopped) + { + if (!active.claimed) + { + active.claimed = true; + return active.start.generation; + } + TxStartSnapshot next = active.start; + next.generation = allocateGeneration (); + commitStart (next); + return next.generation; + } + } + return TxGeneration::invalid (); + } + + bool TxPlaybackDiagnostics::commitStart (TxStartSnapshot const& snapshot) + { + if (!snapshot.session_id.isValid () || !snapshot.generation.isValid () || + snapshot.sample_rate_hz <= 0) + { + return false; + } + if (findActive (snapshot.session_id, snapshot.generation)) + { + return false; + } + ActiveSession active; + active.start = snapshot; + active.playout.session_id = snapshot.session_id; + active.playout.generation = snapshot.generation; + active_.append (active); + return true; + } + + bool TxPlaybackDiagnostics::commitTarget (TxSessionId sessionId, + TxGeneration generation, + qint64 committedEndSample, + bool targetKnown, + QString const& diagnostic) + { + auto * active = findActive (sessionId, generation); + if (!active || committedEndSample < -1 || + (active->start.committed_end_sample >= 0 && + committedEndSample >= 0 && + committedEndSample < active->start.committed_end_sample)) + { + return false; + } + active->start.committed_end_sample = committedEndSample; + active->start.target_known = targetKnown; + if (!diagnostic.isEmpty ()) active->start.diagnostic = diagnostic; + active->playout = normalize (active->start, active->raw); + if (active->stopped) + { + for (auto& item : terminal_) + { + if (item.session_id == sessionId && item.generation == generation) + { + item = terminal (*active); + break; + } + } + } + return true; + } + + bool TxPlaybackDiagnostics::observeSourceProgress (TxSessionId sessionId, + TxGeneration generation, + qint64 servedSamples, + qint64 totalSamples, + QString const& diagnostic) + { + auto * active = findActive (sessionId, generation); + if (!active || servedSamples < 0 || totalSamples < servedSamples || + (active->source_served_frames >= 0 && + servedSamples < active->source_served_frames) || + (active->source_total_frames >= 0 && + totalSamples < active->source_total_frames)) + { + return false; + } + active->source_served_frames = servedSamples; + active->source_total_frames = totalSamples; + if (!diagnostic.isEmpty ()) active->source_progress_diagnostic = diagnostic; + if (active->stopped) + { + for (auto& item : terminal_) + { + if (item.session_id == sessionId && item.generation == generation) + { + item = terminal (*active); + break; + } + } + } + return true; + } + + bool TxPlaybackDiagnostics::observe (TxSessionId sessionId, + TxGeneration generation, + TxRawPlayoutSnapshot const& raw) + { + auto * active = findActive (sessionId, generation); + if (!active) + { + return false; + } + if (raw.start_event) + { + if (raw.backend_start_sequence <= 0 || + (active->bound && raw.backend_start_sequence <= active->backend_start_sequence)) + { + return false; + } + active->bound = true; + active->backend_start_sequence = raw.backend_start_sequence; + } + else if (!active->bound || raw.backend_start_sequence != active->backend_start_sequence) + { + return false; + } + if ((active->raw.processed_usecs >= 0 && raw.processed_usecs >= 0 && + raw.processed_usecs < active->raw.processed_usecs) || + (active->raw.successfully_written_frames >= 0 && + raw.successfully_written_frames >= 0 && + raw.successfully_written_frames < active->raw.successfully_written_frames)) + { + return false; + } + if (!raw.start_event && tierStrength (raw.tier) < tierStrength (active->raw.tier)) + { + return false; + } + if (raw.source_served_frames >= 0 && + raw.source_total_frames >= raw.source_served_frames && + (active->source_served_frames < 0 || + raw.source_served_frames >= active->source_served_frames) && + (active->source_total_frames < 0 || + raw.source_total_frames >= active->source_total_frames)) + { + active->source_served_frames = raw.source_served_frames; + active->source_total_frames = raw.source_total_frames; + } + active->raw = raw; + active->underrun = active->underrun || raw.error == TxBackendError::Underrun; + active->playout = normalize (active->start, raw); + if (active->stopped) + { + for (auto& item : terminal_) + { + if (item.session_id == sessionId && item.generation == generation) + { + item = terminal (*active); + break; + } + } + } + return true; + } + + TxStopDecision TxPlaybackDiagnostics::stop (TxSessionId sessionId, + TxGeneration generation, + TxStopReason reason, + int legacyTailMs) + { + TxStopDecision decision; + decision.reason = reason; + decision.tail_ms = legacyTailMs; + auto * active = findActive (sessionId, generation); + if (!active) + { + return decision; + } + active->stopped = true; + active->stop = decision; + terminal_.append (terminal (*active)); + if (terminal_.size () > 16) + { + int const removeCount = terminal_.size () - 16; + for (int index = 0; index != removeCount; ++index) + { + auto const expired = terminal_.at (index); + for (int activeIndex = 0; activeIndex != active_.size (); ++activeIndex) + { + if (active_[activeIndex].start.session_id == expired.session_id && + active_[activeIndex].start.generation == expired.generation) + { + active_.remove (activeIndex); + break; + } + } + } + terminal_.remove (0, removeCount); + } + return decision; + } + + QVector TxPlaybackDiagnostics::terminalSessions () const + { + return terminal_; + } + + QString TxPlaybackDiagnostics::diagnosticDump () const + { + QStringList entries; + for (auto const& active : active_) + { + if (active.stopped) + { + continue; + } + auto entry = QString ("active session=%1 generation=%2 mode=%3 tier=%4 " + "target_known=%5 committed_end=%6 consumed=%7 " + "served=%8 underrun=%9 sequence=%10") + .arg (active.start.session_id.value ()) + .arg (active.start.generation.value ()) + .arg (active.start.mode) + .arg (tierName (active.raw.tier)) + .arg (active.start.target_known ? "true" : "false") + .arg (active.start.committed_end_sample) + .arg (active.playout.consumed_samples) + .arg (active.source_served_frames) + .arg (active.underrun ? "true" : "false") + .arg (active.backend_start_sequence); + entry += QString (" source_diagnostic=\"%1\" playout_diagnostic=\"%2\"") + .arg (combinedDiagnostic (active.start.diagnostic, + active.source_progress_diagnostic), + active.raw.diagnostic); + entries.append (entry); + } + for (auto const& item : terminal_) + { + auto entry = QString ("terminal session=%1 generation=%2 mode=%3 tier=%4 " + "reason=%5 tail_ms=%6 target_known=%7 committed_end=%8 " + "consumed=%9 served=%10 underrun=%11 truncated=%12") + .arg (item.session_id.value ()) + .arg (item.generation.value ()) + .arg (item.mode) + .arg (tierName (item.tier)) + .arg (reasonName (item.stop.reason)) + .arg (item.stop.tail_ms) + .arg (item.target_known ? "true" : "false") + .arg (item.committed_end_sample) + .arg (item.consumed_samples) + .arg (item.source_served_samples) + .arg (item.underrun ? "true" : "false") + .arg (item.truncated_known ? (item.truncated ? "true" : "false") : "unknown"); + entry += QString (" diagnostic=\"%1\"").arg (item.diagnostic); + entries.append (entry); + } + return entries.join ('\n'); + } + + TxPlaybackDiagnostics::ActiveSession * TxPlaybackDiagnostics::findActive ( + TxSessionId sessionId, TxGeneration generation) + { + for (auto& active : active_) + { + if (active.start.session_id == sessionId && active.start.generation == generation) + { + return &active; + } + } + return nullptr; + } + + TxPlaybackDiagnostics::ActiveSession const * TxPlaybackDiagnostics::findActive ( + TxSessionId sessionId, TxGeneration generation) const + { + for (auto const& active : active_) + { + if (active.start.session_id == sessionId && active.start.generation == generation) + { + return &active; + } + } + return nullptr; + } + + TxPlayoutSnapshot TxPlaybackDiagnostics::normalize (TxStartSnapshot const& start, + TxRawPlayoutSnapshot const& raw) + { + TxPlayoutSnapshot result; + result.session_id = start.session_id; + result.generation = start.generation; + result.raw = raw; + int const rate = raw.sample_rate_hz > 0 ? raw.sample_rate_hz : start.sample_rate_hz; + if (raw.tier == TxPlayoutTier::DeviceClock) + { + result.consumed_samples = framesFromUsecs (raw.processed_usecs, rate); + } + else if (raw.tier == TxPlayoutTier::DeadReckoning) + { + result.consumed_samples = raw.successfully_written_frames; + } + if (result.consumed_samples >= 0 && raw.report_interval_ms > 0 && rate > 0) + { + result.uncertainty_samples = qint64 (raw.report_interval_ms) * rate / 1000; + } + return result; + } + + TxTerminalSession TxPlaybackDiagnostics::terminal (ActiveSession const& active) + { + TxTerminalSession result; + result.session_id = active.start.session_id; + result.generation = active.start.generation; + result.mode = active.start.mode; + result.tier = active.raw.tier; + result.target_known = active.start.target_known; + result.committed_end_sample = active.start.committed_end_sample; + result.source_served_samples = active.source_served_frames; + result.consumed_samples = active.playout.consumed_samples; + result.uncertainty_samples = active.playout.uncertainty_samples; + result.underrun = active.underrun; + qint64 const observedSamples = result.consumed_samples >= 0 + ? result.consumed_samples : result.source_served_samples; + result.truncated_known = result.target_known && observedSamples >= 0; + result.truncated = result.truncated_known && + observedSamples <= result.committed_end_sample; + result.terminal_playout_observed = active.bound && active.raw.available && + active.raw.tier != TxPlayoutTier::Unavailable; + result.backend_start_sequence = active.backend_start_sequence; + result.stop = active.stop; + result.diagnostic = combinedDiagnostic ( + combinedDiagnostic (active.start.diagnostic, + active.source_progress_diagnostic), + active.raw.diagnostic); + return result; + } +} diff --git a/Audio/TxPlaybackDiagnostics.hpp b/Audio/TxPlaybackDiagnostics.hpp new file mode 100644 index 00000000..d40ab2d8 --- /dev/null +++ b/Audio/TxPlaybackDiagnostics.hpp @@ -0,0 +1,70 @@ +#ifndef TX_PLAYBACK_DIAGNOSTICS_HPP_ +#define TX_PLAYBACK_DIAGNOSTICS_HPP_ + +#include + +#include "Audio/TxPlaybackEvidence.hpp" + +namespace TxEvidence +{ + class TxPlaybackDiagnostics + { + public: + TxPlaybackDiagnostics (); + ~TxPlaybackDiagnostics (); + + static TxSessionId allocateSessionId (); + static TxGeneration allocateGeneration (); + static TxStopDecision decisionFor (TxStopReason reason, bool zeroTailMode); + + TxSessionId beginSession (QString const& mode, int sampleRateHz, + qint64 committedEndSample = -1, + bool targetKnown = false, + QString const& diagnostic = QString ()); + TxGeneration beginGeneration (TxSessionId sessionId); + bool commitStart (TxStartSnapshot const& snapshot); + bool commitTarget (TxSessionId sessionId, TxGeneration generation, + qint64 committedEndSample, bool targetKnown = true, + QString const& diagnostic = QString ()); + bool observeSourceProgress (TxSessionId sessionId, TxGeneration generation, + qint64 servedSamples, qint64 totalSamples, + QString const& diagnostic = QString ()); + bool observe (TxSessionId sessionId, TxGeneration generation, + TxRawPlayoutSnapshot const& raw); + TxStopDecision stop (TxSessionId sessionId, TxGeneration generation, + TxStopReason reason, int legacyTailMs = 0); + + QVector terminalSessions () const; + QString diagnosticDump () const; + + private: + struct ActiveSession + { + TxStartSnapshot start; + TxRawPlayoutSnapshot raw; + TxPlayoutSnapshot playout; + qint64 source_served_frames {-1}; + qint64 source_total_frames {-1}; + QString source_progress_diagnostic; + bool claimed {true}; + bool bound {false}; + bool underrun {false}; + qint64 backend_start_sequence {0}; + bool stopped {false}; + TxStopDecision stop; + }; + + ActiveSession * findActive (TxSessionId sessionId, + TxGeneration generation); + ActiveSession const * findActive (TxSessionId sessionId, + TxGeneration generation) const; + static TxPlayoutSnapshot normalize (TxStartSnapshot const& start, + TxRawPlayoutSnapshot const& raw); + static TxTerminalSession terminal (ActiveSession const& active); + + QVector active_; + QVector terminal_; + }; +} + +#endif diff --git a/Audio/TxPlaybackEvidence.hpp b/Audio/TxPlaybackEvidence.hpp new file mode 100644 index 00000000..568a0c91 --- /dev/null +++ b/Audio/TxPlaybackEvidence.hpp @@ -0,0 +1,144 @@ +#ifndef TX_PLAYBACK_EVIDENCE_HPP_ +#define TX_PLAYBACK_EVIDENCE_HPP_ + +#include +#include +#include + +#include "Audio/TxIdentity.hpp" + +namespace TxEvidence +{ + inline qint64 boundedCommittedEndSample (qint64 leadingSilentFrames, + qint64 firstSourceSample, + qint64 lastSourceSample) noexcept + { + if (leadingSilentFrames < 0 || firstSourceSample < 0 || + lastSourceSample < firstSourceSample) + { + return -1; + } + return leadingSilentFrames + lastSourceSample - firstSourceSample; + } + + inline qint64 interleavedFrameCount (qint64 scalarCount, + int channelCount) noexcept + { + if (scalarCount < 0 || channelCount <= 0 || scalarCount % channelCount) + { + return -1; + } + return scalarCount / channelCount; + } + + enum class TxPlayoutTier + { + Unavailable, + DeadReckoning, + DeviceClock + }; + + enum class TxBackendState + { + Unavailable, + Active, + Idle, + Suspended, + Stopped, + Interrupted, + Unknown + }; + + enum class TxBackendError + { + None, + Open, + Io, + Underrun, + Fatal, + Unknown + }; + + enum class TxStopReason + { + NormalEnd, + UserHalt, + Watchdog, + Error, + ModeChange + }; + + struct TxStartSnapshot + { + TxSessionId session_id; + TxGeneration generation; + QString mode; + int sample_rate_hz {0}; + qint64 committed_end_sample {-1}; + bool target_known {false}; + QString diagnostic; + }; + + struct TxRawPlayoutSnapshot + { + TxPlayoutTier tier {TxPlayoutTier::Unavailable}; + qint64 backend_start_sequence {0}; + bool start_event {false}; + bool available {false}; + TxBackendState state {TxBackendState::Unavailable}; + TxBackendError error {TxBackendError::None}; + qint64 available_bytes {-1}; + qint64 buffered_bytes {-1}; + qint64 capacity_bytes {-1}; + qint64 processed_usecs {-1}; + qint64 elapsed_usecs {-1}; + qint64 successfully_written_frames {-1}; + qint64 source_served_frames {-1}; + qint64 source_total_frames {-1}; + int channel_count {0}; + int bytes_per_frame {0}; + int sample_rate_hz {0}; + int report_interval_ms {0}; + QString diagnostic; + }; + + struct TxPlayoutSnapshot + { + TxSessionId session_id; + TxGeneration generation; + TxRawPlayoutSnapshot raw; + qint64 consumed_samples {-1}; + qint64 uncertainty_samples {-1}; + }; + + struct TxStopDecision + { + int tail_ms {0}; + TxStopReason reason {TxStopReason::NormalEnd}; + }; + + struct TxTerminalSession + { + TxSessionId session_id; + TxGeneration generation; + QString mode; + TxPlayoutTier tier {TxPlayoutTier::Unavailable}; + bool target_known {false}; + qint64 committed_end_sample {-1}; + qint64 source_served_samples {-1}; + qint64 consumed_samples {-1}; + qint64 uncertainty_samples {-1}; + bool underrun {false}; + bool truncated_known {false}; + bool truncated {false}; + bool terminal_playout_observed {false}; + qint64 backend_start_sequence {0}; + TxStopDecision stop; + QString diagnostic; + }; +} + +Q_DECLARE_METATYPE (TxEvidence::TxStartSnapshot) +Q_DECLARE_METATYPE (TxEvidence::TxRawPlayoutSnapshot) + +#endif diff --git a/Audio/TxRequest.hpp b/Audio/TxRequest.hpp new file mode 100644 index 00000000..ccb736b0 --- /dev/null +++ b/Audio/TxRequest.hpp @@ -0,0 +1,73 @@ +#ifndef TX_REQUEST_HPP_ +#define TX_REQUEST_HPP_ + +#include +#include +#include +#include + +#include "AudioDevice.hpp" +#include "TxAudioQueue.hpp" +#include "TxIdentity.hpp" + +namespace TxEvidence +{ + struct TxRequest + { + QString mode {"FT8"}; + unsigned symbols_length {79}; + double frames_per_symbol {1920.0}; + double frequency_hz {1500.0}; + double tone_spacing {-3.0}; + AudioDevice::Channel channel {AudioDevice::Mono}; + bool synchronize {true}; + bool fast_mode {false}; + double snr_db {99.0}; + double tr_period_s {60.0}; + TxSessionId session_id {}; + TxGeneration generation {}; + TxAudioQueueEpoch queue_epoch {}; + bool tuning {false}; + QVector cw_id; + qint64 start_window_open_ms {-1}; + qint64 start_window_close_ms {-1}; + }; + + inline bool operator == (TxRequest const& lhs, TxRequest const& rhs) + { + return lhs.mode == rhs.mode + && lhs.symbols_length == rhs.symbols_length + && lhs.frames_per_symbol == rhs.frames_per_symbol + && lhs.frequency_hz == rhs.frequency_hz + && lhs.tone_spacing == rhs.tone_spacing + && lhs.channel == rhs.channel + && lhs.synchronize == rhs.synchronize + && lhs.fast_mode == rhs.fast_mode + && lhs.snr_db == rhs.snr_db + && lhs.tr_period_s == rhs.tr_period_s + && lhs.session_id == rhs.session_id + && lhs.generation == rhs.generation + && lhs.queue_epoch == rhs.queue_epoch + && lhs.tuning == rhs.tuning + && lhs.cw_id == rhs.cw_id + && lhs.start_window_open_ms == rhs.start_window_open_ms + && lhs.start_window_close_ms == rhs.start_window_close_ms; + } + + inline bool operator != (TxRequest const& lhs, TxRequest const& rhs) + { + return !(lhs == rhs); + } +} + +Q_DECLARE_METATYPE (TxEvidence::TxRequest) + +namespace TxEvidence +{ + inline int register_tx_request_type () + { + return qRegisterMetaType ("TxEvidence::TxRequest"); + } +} + +#endif diff --git a/Audio/WavFile.cpp b/Audio/WavFile.cpp new file mode 100644 index 00000000..b1c6bb55 --- /dev/null +++ b/Audio/WavFile.cpp @@ -0,0 +1,147 @@ +#include "WavFile.hpp" +#include +#include +#include +#include +#include "Audio/BWFFile.hpp" +#include "revision_utils.hpp" + +namespace +{ +bool has_native_byte_order (QAudioFormat const& format) +{ +#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN + return QAudioFormat::LittleEndian == format.byteOrder (); +#else + return QAudioFormat::BigEndian == format.byteOrder (); +#endif +} + +bool is_supported_decode_format (QAudioFormat const& format) +{ + if ("audio/pcm" != format.codec () || 1 != format.channelCount ()) + { + return false; + } + + if (11025 == format.sampleRate () && 8 == format.sampleSize ()) + { + return QAudioFormat::UnSignedInt == format.sampleType (); + } + + return (11025 == format.sampleRate () || 12000 == format.sampleRate ()) + && 16 == format.sampleSize () + && QAudioFormat::SignedInt == format.sampleType () + && has_native_byte_order (format); +} +} + +namespace Radio +{ + +WavFile::LoadResult WavFile::load (QString const& name, int max_frames) +{ + LoadResult result; + if (max_frames <= 0) + { + result.error = name + ": invalid WAV frame limit"; + return result; + } + + BWFFile file {QAudioFormat {}, name}; + if (!file.open (BWFFile::ReadOnly)) + { + result.error = name + ": " + file.errorString (); + return result; + } + + result.format = file.format (); + auto const bytes_per_frame = result.format.bytesPerFrame (); + if (!is_supported_decode_format (result.format) || bytes_per_frame <= 0) + { + result.error = name + ": unsupported WAV format"; + return result; + } + + auto max_bytes = std::min ( + static_cast (max_frames) * bytes_per_frame, + (std::numeric_limits::max) ()); + max_bytes -= max_bytes % bytes_per_frame; + auto bytes_to_read = std::min (max_bytes, file.size ()); + bytes_to_read -= bytes_to_read % bytes_per_frame; + + result.samples.resize (static_cast (bytes_to_read)); + qint64 bytes_read {0}; + if (bytes_to_read > 0) + { + bytes_read = file.read (result.samples.data (), bytes_to_read); + if (bytes_read < 0) + { + result.samples.clear (); + result.error = name + ": " + file.errorString (); + return result; + } + } + + bytes_read -= bytes_read % bytes_per_frame; + result.samples.resize (static_cast (bytes_read)); + result.frames = static_cast (bytes_read / bytes_per_frame); + return result; +} + +QString WavFile::save (QString const& name, short const * data, int samples, + QString const& my_callsign, QString const& my_grid, + QString const& mode, qint32 sub_mode, + Frequency frequency, QString const& his_call, + QString const& his_grid, QString const& dgrd) +{ + QAudioFormat format; + format.setCodec ("audio/pcm"); + format.setSampleRate (12000); + format.setChannelCount (1); + format.setSampleSize (16); + format.setSampleType (QAudioFormat::SignedInt); + auto source = QString {"%1; %2"}.arg (my_callsign).arg (my_grid); + auto comment = QString {"Mode=%1%2; Freq=%3%4"} + .arg (mode) + .arg (QString {(mode.contains ('J') && !mode.contains ('+')) + || mode.startsWith ("FST4") || mode.startsWith ('Q') + ? QString {"; Sub Mode="} + QString::number (int (samples / 12000)) + QChar {'A' + sub_mode} + : QString {}}) + .arg (Radio::frequency_MHz_string (frequency)) + .arg (QString {mode!="WSPR" ? QString {"; DXCall=%1; DXGrid=%2"} + .arg (his_call) + .arg (his_grid).toLocal8Bit () : ""}); + BWFFile::InfoDictionary list_info { + {{{'I','S','R','C'}}, source.toLocal8Bit ()}, + {{{'I','S','F','T'}}, program_title (revision ()).simplified ().toLocal8Bit ()}, + {{{'I','C','R','D'}}, QDateTime::currentDateTimeUtc () + .toString ("yyyy-MM-ddTHH:mm:ss.zzzZ").toLocal8Bit ()}, + {{{'I','C','M','T'}}, comment.toLocal8Bit ()}, + {{{'D','G','R','D'}}, dgrd.toLocal8Bit()}, //added for Bob KA1GT + }; + auto file_name = name + ".wav"; + BWFFile wav {format, file_name, list_info}; + if (!wav.open (BWFFile::WriteOnly) + || 0 > wav.write (reinterpret_cast (data) + , sizeof (short) * samples)) + { + return file_name + ": " + wav.errorString (); + } + return QString {}; +} + +void WavFile::killWaveFile (QString const& name, bool saveAll, bool saveDecoded, + bool bDecoded, QString const& mode) +{ + if (name.size () && !(saveAll || (saveDecoded && bDecoded))) { + QFile f1 {name + ".wav"}; + if (f1.exists ()) f1.remove (); + if (mode == "WSPR" || mode == "FST4W") { + QFile f2 {name + ".c2"}; + if (f2.exists ()) f2.remove (); + } + } +} + +} diff --git a/Audio/WavFile.hpp b/Audio/WavFile.hpp new file mode 100644 index 00000000..05c82820 --- /dev/null +++ b/Audio/WavFile.hpp @@ -0,0 +1,37 @@ +#ifndef WAVFILE_HPP +#define WAVFILE_HPP + +#include +#include +#include +#include "Radio.hpp" + +namespace Radio +{ + +class WavFile +{ +public: + struct LoadResult + { + QByteArray samples; + QAudioFormat format; + QString error; + int frames {0}; + + bool isValid () const {return error.isEmpty ();} + }; + + static LoadResult load (QString const& name, int max_frames); + static QString save (QString const& name, short const * data, int samples, + QString const& my_callsign, QString const& my_grid, + QString const& mode, qint32 sub_mode, + Frequency frequency, QString const& his_call, + QString const& his_grid, QString const& dgrd); + static void killWaveFile (QString const& name, bool saveAll, bool saveDecoded, + bool bDecoded, QString const& mode); +}; + +} + +#endif // WAVFILE_HPP diff --git a/Audio/WavInputLoader.cpp b/Audio/WavInputLoader.cpp new file mode 100644 index 00000000..b28125c5 --- /dev/null +++ b/Audio/WavInputLoader.cpp @@ -0,0 +1,78 @@ +#include "WavInputLoader.hpp" + +#include +#include +#include + +#include "Audio/WavFile.hpp" + +extern "C" +{ + void wav12_ (short d2[], short d1[], int * frames, short * sample_size); +} + +namespace +{ +int constexpr wav12_output_capacity = 60 * 12000; +std::mutex wav12_mutex; +} + +namespace Radio +{ + +WavInputResult load_wav_input (QString const& name, int sample_limit) +{ + WavInputResult result; + auto const basename = name.mid (name.lastIndexOf ('/') + 1); + auto const wav_position = name.indexOf (".wav", 0, Qt::CaseInsensitive); + auto const case_sensitive_position = name.indexOf (".wav"); + auto const directory_position = name.lastIndexOf ('/'); + if (wav_position > 0) + { + if (case_sensitive_position - directory_position > 13) + { + result.nutc = basename.mid (7, 6).toInt (); + result.fileDateTime = basename.mid (0, 13); + } + else if (wav_position == name.indexOf ('_', -11) + 7) + { + result.nutc = name.mid (wav_position - 6, 6).toInt (); + result.fileDateTime = name.mid (wav_position - 13, 13); + } + else + { + result.nutc = 100 * name.mid (wav_position - 4, 4).toInt (); + result.fileDateTime = name.mid (wav_position - 11, 11); + } + } + + auto const wav = WavFile::load (name, sample_limit); + if (wav.isValid ()) + { + result.samples.assign (sample_limit, 0); + if (!wav.samples.isEmpty ()) + { + std::memcpy (result.samples.data (), wav.samples.constData (), wav.samples.size ()); + } + + auto frames_read = wav.frames; + if (11025 == wav.format.sampleRate ()) + { + result.samples.resize (std::max (sample_limit, wav12_output_capacity), 0); + short sample_size = wav.format.sampleSize (); + { + std::lock_guard lock {wav12_mutex}; + wav12_ (result.samples.data (), result.samples.data (), &frames_read, &sample_size); + } + frames_read = std::min (frames_read, sample_limit); + result.samples.resize (sample_limit); + } + result.frames = frames_read; + result.valid = true; + } + + result.yymmdd = basename.left (6).toInt (); + return result; +} + +} diff --git a/Audio/WavInputLoader.hpp b/Audio/WavInputLoader.hpp new file mode 100644 index 00000000..8071ea9f --- /dev/null +++ b/Audio/WavInputLoader.hpp @@ -0,0 +1,25 @@ +#ifndef WAV_INPUT_LOADER_HPP +#define WAV_INPUT_LOADER_HPP + +#include + +#include + +namespace Radio +{ + +struct WavInputResult +{ + std::vector samples; + QString fileDateTime; + int frames {0}; + int nutc {0}; + int yymmdd {0}; + bool valid {false}; +}; + +WavInputResult load_wav_input (QString const& name, int sample_limit); + +} + +#endif // WAV_INPUT_LOADER_HPP diff --git a/Audio/WavLoadCoordinator.cpp b/Audio/WavLoadCoordinator.cpp new file mode 100644 index 00000000..3069f67e --- /dev/null +++ b/Audio/WavLoadCoordinator.cpp @@ -0,0 +1,82 @@ +#include "WavLoadCoordinator.hpp" + +#include + +#include +#include + +#include "DecDataMutex.hpp" + +WavLoadCoordinator::WavLoadCoordinator (QObject * parent) + : QObject {parent} +{ + connect (&watcher_, &QFutureWatcher::finished, + this, &WavLoadCoordinator::handleFinished); +} + +WavLoadCoordinator::~WavLoadCoordinator () +{ + waitForFinished (); + if (loading_) + { + set_dec_data_input_blocked (false); + loading_ = false; + } +} + +bool WavLoadCoordinator::start (Work work) +{ + if (loading_ || !work) + { + return false; + } + + result_.reset (); + loading_ = true; + set_dec_data_input_blocked (true); + QPointer guard {this}; + Q_EMIT loadingChanged (true); + if (!guard) + { + return false; + } + watcher_.setFuture (QtConcurrent::run (std::move (work))); + return true; +} + +bool WavLoadCoordinator::isLoading () const +{ + return loading_; +} + +WavLoadCoordinator::Result WavLoadCoordinator::result () const +{ + return result_; +} + +void WavLoadCoordinator::waitForFinished () +{ + watcher_.waitForFinished (); +} + +void WavLoadCoordinator::handleFinished () +{ + try + { + result_ = watcher_.result (); + } + catch (...) + { + result_ = std::make_shared (); + } + + QPointer guard {this}; + Q_EMIT resultReady (); + if (!guard) + { + return; + } + set_dec_data_input_blocked (false); + loading_ = false; + Q_EMIT loadingChanged (false); +} diff --git a/Audio/WavLoadCoordinator.hpp b/Audio/WavLoadCoordinator.hpp new file mode 100644 index 00000000..9f4204d7 --- /dev/null +++ b/Audio/WavLoadCoordinator.hpp @@ -0,0 +1,40 @@ +#ifndef WAV_LOAD_COORDINATOR_HPP +#define WAV_LOAD_COORDINATOR_HPP + +#include +#include + +#include +#include + +#include "Audio/WavInputLoader.hpp" + +class WavLoadCoordinator : public QObject +{ + Q_OBJECT + +public: + using Result = std::shared_ptr; + using Work = std::function; + + explicit WavLoadCoordinator (QObject * parent = nullptr); + ~WavLoadCoordinator () override; + + bool start (Work work); + bool isLoading () const; + Result result () const; + void waitForFinished (); + +Q_SIGNALS: + void loadingChanged (bool loading); + void resultReady (); + +private: + void handleFinished (); + + bool loading_ {false}; + Result result_; + QFutureWatcher watcher_; +}; + +#endif // WAV_LOAD_COORDINATOR_HPP diff --git a/Audio/soundin.cpp b/Audio/soundin.cpp index 89d86782..24844864 100644 --- a/Audio/soundin.cpp +++ b/Audio/soundin.cpp @@ -21,10 +21,12 @@ bool SoundInput::checkStream () switch (m_stream->error ()) { case QAudio::OpenError: + if (!m_destroying) clearStreamDescriptor (); Q_EMIT error (tr ("An error opening the audio input device has occurred.")); break; case QAudio::IOError: + if (!m_destroying) clearStreamDescriptor (); Q_EMIT error (tr ("An error occurred during read from the audio input device.")); break; @@ -33,6 +35,7 @@ bool SoundInput::checkStream () // break; case QAudio::FatalError: + if (!m_destroying) clearStreamDescriptor (); Q_EMIT error (tr ("Non-recoverable error, audio input device not usable at this time.")); break; @@ -46,6 +49,29 @@ bool SoundInput::checkStream () return result; } +void SoundInput::publishStreamDescriptor () +{ + if (!m_stream) + { + return; + } + + auto descriptor = audioStreamDescriptorFromQAudioFormat (m_stream->format ()); + if (descriptor.isValid ()) + { + descriptor.clock_domain = + AudioStreamDescriptor::ClockDomain::DeviceClock; + descriptor.timing_evidence = + AudioStreamDescriptor::TimingEvidence::PositionCountable; + descriptor.can_report_discontinuities = false; + setStreamDescriptor (descriptor); + } + else + { + LOG_WARN ("Opened input audio stream has an unrecognized format"); + } +} + void SoundInput::start(QAudioDeviceInfo const& device, int framesPerBuffer, AudioDevice * sink , unsigned downSampleFactor, AudioDevice::Channel channel) { @@ -53,6 +79,11 @@ void SoundInput::start(QAudioDeviceInfo const& device, int framesPerBuffer, Audi stop (); + if (device.isNull ()) + { + return; + } + m_sink = sink; QAudioFormat format (device.preferredFormat()); @@ -95,8 +126,12 @@ void SoundInput::start(QAudioDeviceInfo const& device, int framesPerBuffer, Audi if (m_sink->initialize (QIODevice::WriteOnly, channel)) { m_stream->start (sink); - checkStream (); + auto const stream_ok = checkStream (); cummulative_lost_usec_ = -1; + if (stream_ok) + { + publishStreamDescriptor (); + } // LOG_DEBUG ("Selected buffer size (bytes): " << m_stream->bufferSize () << " period size: " << m_stream->periodSize ()); } else @@ -127,7 +162,10 @@ void SoundInput::resume () { // m_stream->resume (); m_stream->start (m_sink); // better stop and restart audio (fixes issues on Linux and macOS) - checkStream (); + if (checkStream ()) + { + publishStreamDescriptor (); + } } } @@ -208,9 +246,11 @@ void SoundInput::stop() m_stream->stop (); } m_stream.reset (); + if (!m_destroying) clearStreamDescriptor (); } SoundInput::~SoundInput () { + m_destroying = true; stop (); } diff --git a/Audio/soundin.h b/Audio/soundin.h index 823993c6..752338ee 100644 --- a/Audio/soundin.h +++ b/Audio/soundin.h @@ -3,53 +3,51 @@ #define SOUNDIN_H__ #include -#include #include #include #include #include #include -#include "Audio/AudioDevice.hpp" +#include "Audio/AudioInputSource.hpp" class QAudioDeviceInfo; class QAudioInput; // Gets audio data from sound sample source and passes it to a sink device class SoundInput - : public QObject + final : public AudioInputSource { Q_OBJECT; public: SoundInput (QObject * parent = nullptr) - : QObject {parent} + : AudioInputSource {parent} , cummulative_lost_usec_ {std::numeric_limits::min ()} { } - ~SoundInput (); + ~SoundInput () override; // sink must exist from the start call until the next start call or // stop call - Q_SLOT void start(QAudioDeviceInfo const&, int framesPerBuffer, AudioDevice * sink, unsigned downSampleFactor, AudioDevice::Channel = AudioDevice::Mono); - Q_SLOT void suspend (); - Q_SLOT void resume (); - Q_SLOT void stop (); - Q_SLOT void reset (bool report_dropped_frames); - - Q_SIGNAL void error (QString message) const; - Q_SIGNAL void status (QString message) const; + Q_SLOT void start(QAudioDeviceInfo const&, int framesPerBuffer, AudioDevice * sink, unsigned downSampleFactor, AudioDevice::Channel = AudioDevice::Mono) override; + Q_SLOT void suspend () override; + Q_SLOT void resume () override; + Q_SLOT void stop () override; + Q_SLOT void reset (bool report_dropped_frames) override; private: // used internally Q_SLOT void handleStateChanged (QAudio::State); bool checkStream (); + void publishStreamDescriptor (); QScopedPointer m_stream; QPointer m_sink; qint64 cummulative_lost_usec_; + bool m_destroying {false}; }; #endif diff --git a/Audio/soundout.cpp b/Audio/soundout.cpp index 8a5d6d30..55a0104a 100644 --- a/Audio/soundout.cpp +++ b/Audio/soundout.cpp @@ -12,6 +12,37 @@ #include "moc_soundout.cpp" +namespace +{ + TxEvidence::TxBackendState txBackendState (QAudio::State state) noexcept + { + switch (state) + { + case QAudio::ActiveState: return TxEvidence::TxBackendState::Active; + case QAudio::IdleState: return TxEvidence::TxBackendState::Idle; + case QAudio::SuspendedState: return TxEvidence::TxBackendState::Suspended; + case QAudio::StoppedState: return TxEvidence::TxBackendState::Stopped; +#if QT_VERSION >= QT_VERSION_CHECK (5, 10, 0) + case QAudio::InterruptedState: return TxEvidence::TxBackendState::Interrupted; +#endif + } + return TxEvidence::TxBackendState::Unknown; + } + + TxEvidence::TxBackendError txBackendError (QAudio::Error error) noexcept + { + switch (error) + { + case QAudio::NoError: return TxEvidence::TxBackendError::None; + case QAudio::OpenError: return TxEvidence::TxBackendError::Open; + case QAudio::IOError: return TxEvidence::TxBackendError::Io; + case QAudio::UnderrunError: return TxEvidence::TxBackendError::Underrun; + case QAudio::FatalError: return TxEvidence::TxBackendError::Fatal; + } + return TxEvidence::TxBackendError::Unknown; + } +} + bool SoundOutput::checkStream () const { bool result {false}; @@ -54,6 +85,8 @@ void SoundOutput::setFormat (QAudioDeviceInfo const& device, unsigned channels, void SoundOutput::restart (QIODevice * source) { + ++m_backendStartSequence; + bool failed {false}; if (!m_device.isNull ()) { QAudioFormat format (m_device.preferredFormat ()); @@ -67,10 +100,12 @@ void SoundOutput::restart (QIODevice * source) if (!format.isValid ()) { Q_EMIT error (tr ("Requested output audio format is not valid.")); + failed = true; } else if (!m_device.isFormatSupported (format)) { Q_EMIT error (tr ("Requested output audio format is not supported on device.")); + failed = true; } else { @@ -82,11 +117,22 @@ void SoundOutput::restart (QIODevice * source) error_ = false; connect (m_stream.data(), &QAudioOutput::stateChanged, this, &SoundOutput::handleStateChanged); - connect (m_stream.data(), &QAudioOutput::notify, [this] () {checkStream ();}); + connect (m_stream.data(), &QAudioOutput::notify, [this] () { + checkStream (); + publishRawTxPlayoutSnapshot (); + }); // qDebug() << "A" << m_volume << m_stream->notifyInterval(); } } + else + { + failed = true; + } + if (failed) + { + publishUnavailableTxPlayoutSnapshot (true, tr ("Audio output restart attempt failed.")); + } if (!m_stream) { if (!error_) @@ -94,6 +140,10 @@ void SoundOutput::restart (QIODevice * source) error_ = true; // only signal error once Q_EMIT error (tr ("No audio output device configured.")); } + if (!failed) + { + publishUnavailableTxPlayoutSnapshot (true, tr ("No audio output device configured.")); + } return; } else @@ -111,6 +161,7 @@ void SoundOutput::restart (QIODevice * source) } m_stream->setCategory ("production"); m_stream->start (source); + publishRawTxPlayoutSnapshot (true); // LOG_DEBUG ("Selected buffer size (bytes): " << m_stream->bufferSize () << " period size: " << m_stream->periodSize ()); } @@ -120,6 +171,7 @@ void SoundOutput::suspend () { m_stream->suspend (); checkStream (); + publishRawTxPlayoutSnapshot (); } } @@ -129,6 +181,7 @@ void SoundOutput::resume () { m_stream->resume (); checkStream (); + publishRawTxPlayoutSnapshot (); } } @@ -136,8 +189,15 @@ void SoundOutput::reset () { if (m_stream) { + auto const beforeReset = makeRawTxPlayoutSnapshot (); m_stream->reset (); checkStream (); + Q_EMIT rawTxPlayoutSnapshot (beforeReset); + publishRawTxPlayoutSnapshot (); + } + else + { + publishRawTxPlayoutSnapshot (); } } @@ -145,8 +205,15 @@ void SoundOutput::stop () { if (m_stream) { + auto const beforeStop = makeRawTxPlayoutSnapshot (); m_stream->reset (); m_stream->stop (); + Q_EMIT rawTxPlayoutSnapshot (beforeStop); + publishRawTxPlayoutSnapshot (); + } + else + { + publishRawTxPlayoutSnapshot (); } #ifdef __APPLE__ // this code is here to help certain rigs not drop audio, however on Sequoia this causes audio to drop, so we don't do it! @@ -160,6 +227,59 @@ qreal SoundOutput::attenuation () const return -(20. * qLn (m_volume) / qLn (10.)); } +int SoundOutput::bufferSize () const +{ + return m_stream ? m_stream->bufferSize () : 0; +} + +TxEvidence::TxRawPlayoutSnapshot SoundOutput::makeRawTxPlayoutSnapshot (bool startEvent) const +{ + TxEvidence::TxRawPlayoutSnapshot snapshot; + if (!m_stream) return snapshot; + + QAudioFormat const format {m_stream->format ()}; + qint64 const capacity {m_stream->bufferSize ()}; + qint64 const available {m_stream->bytesFree ()}; + snapshot.tier = TxEvidence::TxPlayoutTier::DeviceClock; + snapshot.backend_start_sequence = m_backendStartSequence; + snapshot.start_event = startEvent; + snapshot.available = true; + snapshot.state = txBackendState (m_stream->state ()); + snapshot.error = txBackendError (m_stream->error ()); + snapshot.available_bytes = available; + snapshot.buffered_bytes = capacity >= 0 && available >= 0 ? qMax (0, capacity - available) : -1; + snapshot.capacity_bytes = capacity; + snapshot.processed_usecs = m_stream->processedUSecs (); + snapshot.elapsed_usecs = m_stream->elapsedUSecs (); + snapshot.channel_count = format.channelCount (); + snapshot.bytes_per_frame = format.bytesPerFrame (); + snapshot.sample_rate_hz = format.sampleRate (); + snapshot.report_interval_ms = m_stream->notifyInterval (); + return snapshot; +} + +void SoundOutput::publishRawTxPlayoutSnapshot (bool startEvent) const +{ + if (!m_stream) + { + publishUnavailableTxPlayoutSnapshot (startEvent, tr ("No audio output stream is active.")); + return; + } + auto const snapshot = makeRawTxPlayoutSnapshot (startEvent); + Q_EMIT rawTxPlayoutSnapshot (snapshot); +} + +void SoundOutput::publishUnavailableTxPlayoutSnapshot (bool startEvent, QString const& diagnostic) const +{ + TxEvidence::TxRawPlayoutSnapshot snapshot; + snapshot.backend_start_sequence = m_backendStartSequence; + snapshot.start_event = startEvent; + snapshot.state = TxEvidence::TxBackendState::Unavailable; + snapshot.error = TxEvidence::TxBackendError::Open; + snapshot.diagnostic = diagnostic; + Q_EMIT rawTxPlayoutSnapshot (snapshot); +} + void SoundOutput::setAttenuation (qreal a) { Q_ASSERT (0. <= a && a <= 999.); @@ -186,10 +306,12 @@ void SoundOutput::handleStateChanged (QAudio::State newState) { case QAudio::IdleState: Q_EMIT status (tr ("Idle")); + Q_EMIT audioOutputIdle (); break; case QAudio::ActiveState: Q_EMIT status (tr ("Sending")); + Q_EMIT audioOutputActive (); break; case QAudio::SuspendedState: @@ -213,4 +335,5 @@ void SoundOutput::handleStateChanged (QAudio::State newState) } break; } + publishRawTxPlayoutSnapshot (); } diff --git a/Audio/soundout.h b/Audio/soundout.h index 387c1b0f..ad72ea82 100644 --- a/Audio/soundout.h +++ b/Audio/soundout.h @@ -8,6 +8,8 @@ #include #include +#include "Audio/TxPlaybackEvidence.hpp" + class QIODevice; class QAudioDeviceInfo; @@ -19,31 +21,49 @@ class SoundOutput Q_OBJECT; public: - SoundOutput () - : m_framesBuffered {0} + explicit SoundOutput (QObject * parent = nullptr) + : QObject {parent} + , m_framesBuffered {0} , m_volume {1.0} , error_ {false} + , m_backendStartSequence {0} { } qreal attenuation () const; + // Device buffer size in bytes, or 0 when no stream is active. Call only on the + // audio thread (this object's thread); QAudioOutput is not cross-thread safe. + virtual int bufferSize () const; + public Q_SLOTS: - void setFormat (QAudioDeviceInfo const& device, unsigned channels, int frames_buffered = 0); - void restart (QIODevice *); + virtual void setFormat (QAudioDeviceInfo const& device, unsigned channels, + int frames_buffered = 0); + virtual void restart (QIODevice *); + virtual void restart (QIODevice * source, qint64 period_offset_ms) + { + Q_UNUSED (period_offset_ms); + restart (source); + } void suspend (); void resume (); void reset (); - void stop (); + virtual void stop (); void setAttenuation (qreal); /* unsigned */ void resetAttenuation (); /* to zero */ Q_SIGNALS: void error (QString message) const; void status (QString message) const; + void audioOutputActive () const; + void audioOutputIdle () const; + void rawTxPlayoutSnapshot (TxEvidence::TxRawPlayoutSnapshot snapshot) const; private: bool checkStream () const; + TxEvidence::TxRawPlayoutSnapshot makeRawTxPlayoutSnapshot (bool startEvent = false) const; + void publishRawTxPlayoutSnapshot (bool startEvent = false) const; + void publishUnavailableTxPlayoutSnapshot (bool startEvent, QString const& diagnostic) const; private Q_SLOTS: void handleStateChanged (QAudio::State); @@ -55,6 +75,7 @@ private: int m_framesBuffered; qreal m_volume; bool error_; + qint64 m_backendStartSequence; }; #endif diff --git a/AutoRespondPeriod.cpp b/AutoRespondPeriod.cpp new file mode 100644 index 00000000..fa289a1a --- /dev/null +++ b/AutoRespondPeriod.cpp @@ -0,0 +1,101 @@ +#include "AutoRespondPeriod.hpp" + +#include +#include + +#include "Decoder/decodedtext.h" +#include "Radio.hpp" + +namespace +{ + QRegularExpression const continuingExchange {R"(^(?:R(?:[-+]\d+)?|RRR|RR73|73)$)"}; +} + +bool isDirectAutoRespondCandidate(DecodedText const& message, QString const& myCall) +{ + if (!message.isStandardMessage() || myCall.isEmpty()) return false; + + auto const words = message.messageWords(); + if (words.size() < 5) return false; + + auto const recipient = words.at(2); + auto const sender = words.at(3); + auto const exchange = words.at(4); + auto const myBaseCall = Radio::base_callsign(myCall); + bool const addressedToUs = myCall == myBaseCall ? recipient == myBaseCall : recipient == myCall; + + return addressedToUs + && Radio::is_callsign(sender) + && Radio::base_callsign(sender) != myBaseCall + && !exchange.isEmpty() + && !exchange.contains(continuingExchange); +} + +bool AutoRespondPeriodState::setEnableTx(bool enabled) +{ + if (enabled == m_enableTx) return false; + + m_enableTx = enabled; + if (!enabled) disarm(); + return true; +} + +bool AutoRespondPeriodState::observePeriod(QDateTime const& periodStart, bool receivePeriod, + bool pendingCq, AutoRespondPolicy policy) +{ + if (!periodStart.isValid() || periodStart == m_lastObservedPeriod) return false; + + m_lastObservedPeriod = periodStart; + m_currentPeriodIsReceive = receivePeriod; + if (!receivePeriod) return false; + + m_receivePeriod = periodStart; + m_firstClaimed = false; + m_policy = AutoRespondPolicy::None; + m_open = m_enableTx + && pendingCq + && AutoRespondPolicy::None != policy; + if (m_open) m_policy = policy; + return m_open; +} + +bool AutoRespondPeriodState::armCurrentReceivePeriod(bool pendingCq, + AutoRespondPolicy policy) +{ + if (m_open || !m_enableTx || !m_currentPeriodIsReceive || !pendingCq + || AutoRespondPolicy::None == policy) return false; + + m_open = true; + m_policy = policy; + m_firstClaimed = false; + return true; +} + +void AutoRespondPeriodState::disarm() +{ + m_open = false; + m_policy = AutoRespondPolicy::None; + m_firstClaimed = false; +} + +void AutoRespondPeriodState::close() +{ + disarm(); +} + +bool AutoRespondPeriodState::accepts(QDateTime const& decodePeriodStart) const +{ + return m_open && decodePeriodStart.isValid() && decodePeriodStart == m_receivePeriod; +} + +bool AutoRespondPeriodState::claimFirst(QDateTime const& decodePeriodStart) +{ + if (!accepts(decodePeriodStart) || m_firstClaimed) return false; + m_firstClaimed = true; + return true; +} + +AutoRespondPolicy AutoRespondPeriodState::policy() const +{ + return m_policy; +} diff --git a/AutoRespondPeriod.hpp b/AutoRespondPeriod.hpp new file mode 100644 index 00000000..0056bba7 --- /dev/null +++ b/AutoRespondPeriod.hpp @@ -0,0 +1,37 @@ +#ifndef AUTORESPONDPERIOD_HPP +#define AUTORESPONDPERIOD_HPP + +#include +#include + +#include "AutoRespondPolicy.hpp" + +class DecodedText; + +bool isDirectAutoRespondCandidate(DecodedText const& message, QString const& myCall); + +class AutoRespondPeriodState final +{ +public: + bool setEnableTx(bool enabled); + bool observePeriod(QDateTime const& periodStart, bool receivePeriod, bool pendingCq, + AutoRespondPolicy policy); + bool armCurrentReceivePeriod(bool pendingCq, AutoRespondPolicy policy); + void disarm(); + void close(); + + bool accepts(QDateTime const& decodePeriodStart) const; + bool claimFirst(QDateTime const& decodePeriodStart); + AutoRespondPolicy policy() const; + +private: + QDateTime m_lastObservedPeriod; + QDateTime m_receivePeriod; + AutoRespondPolicy m_policy {AutoRespondPolicy::None}; + bool m_enableTx {false}; + bool m_currentPeriodIsReceive {false}; + bool m_open {false}; + bool m_firstClaimed {false}; +}; + +#endif diff --git a/AutoRespondPolicy.hpp b/AutoRespondPolicy.hpp new file mode 100644 index 00000000..e2502947 --- /dev/null +++ b/AutoRespondPolicy.hpp @@ -0,0 +1,21 @@ +#ifndef AUTORESPONDPOLICY_HPP +#define AUTORESPONDPOLICY_HPP + +// Values match the historical RespondCQ combo indices stored in QSettings. +enum class AutoRespondPolicy +{ + None = 0, + First = 1, + MaxDistance = 2, + MaxSignal = 3, + MinSignal = 4 +}; + +constexpr bool isScoringAutoRespondPolicy (AutoRespondPolicy policy) +{ + return policy == AutoRespondPolicy::MaxDistance + || policy == AutoRespondPolicy::MaxSignal + || policy == AutoRespondPolicy::MinSignal; +} + +#endif diff --git a/AutoRespondScoring.hpp b/AutoRespondScoring.hpp new file mode 100644 index 00000000..495b60c0 --- /dev/null +++ b/AutoRespondScoring.hpp @@ -0,0 +1,43 @@ +#ifndef AUTORESPONDSCORING_HPP +#define AUTORESPONDSCORING_HPP + +#include + +class AutoRespondScores final +{ +public: + void reset() + { + m_maximumDistance = std::numeric_limits::lowest(); + m_maximumDb = std::numeric_limits::lowest(); + m_minimumDb = std::numeric_limits::max(); + } + + bool considerDistance(int candidate) + { + if (candidate <= m_maximumDistance) return false; + m_maximumDistance = candidate; + return true; + } + + bool considerMaximumDb(int candidate) + { + if (candidate <= m_maximumDb) return false; + m_maximumDb = candidate; + return true; + } + + bool considerMinimumDb(int candidate) + { + if (candidate >= m_minimumDb) return false; + m_minimumDb = candidate; + return true; + } + +private: + int m_maximumDistance {std::numeric_limits::lowest()}; + int m_maximumDb {std::numeric_limits::lowest()}; + int m_minimumDb {std::numeric_limits::max()}; +}; + +#endif diff --git a/AutoRespondSelectionLatch.cpp b/AutoRespondSelectionLatch.cpp new file mode 100644 index 00000000..9693b89d --- /dev/null +++ b/AutoRespondSelectionLatch.cpp @@ -0,0 +1,25 @@ +#include "AutoRespondSelectionLatch.hpp" + +AutoRespondSelectionLatch::AutoRespondSelectionLatch(QObject * parent) + : QObject {parent} +{ + m_resetTimer.setSingleShot(true); + connect(&m_resetTimer, &QTimer::timeout, this, [this] { clear(); }); +} + +bool AutoRespondSelectionLatch::isSelected() const +{ + return m_selected; +} + +void AutoRespondSelectionLatch::selectFor(int delayMs) +{ + m_selected = true; + m_resetTimer.start(delayMs); +} + +void AutoRespondSelectionLatch::clear() +{ + m_resetTimer.stop(); + m_selected = false; +} diff --git a/AutoRespondSelectionLatch.hpp b/AutoRespondSelectionLatch.hpp new file mode 100644 index 00000000..9ecbb4d3 --- /dev/null +++ b/AutoRespondSelectionLatch.hpp @@ -0,0 +1,23 @@ +#ifndef AUTORESPONDSELECTIONLATCH_HPP +#define AUTORESPONDSELECTIONLATCH_HPP + +#include +#include + +class AutoRespondSelectionLatch : public QObject +{ +public: + enum { DefaultResetDelayMs = 6000 }; + + explicit AutoRespondSelectionLatch(QObject * parent = nullptr); + + bool isSelected() const; + void selectFor(int delayMs = DefaultResetDelayMs); + void clear(); + +private: + QTimer m_resetTimer; + bool m_selected {false}; +}; + +#endif diff --git a/BeaconTxController.cpp b/BeaconTxController.cpp new file mode 100644 index 00000000..61992de0 --- /dev/null +++ b/BeaconTxController.cpp @@ -0,0 +1,496 @@ +#include "BeaconTxController.hpp" + +#include +#include + +namespace BeaconTx +{ + // Non-fixed text falls back to Random for compatibility with previously + // persisted translated Random labels. + RoundRobinPolicy parseRoundRobinPolicy (std::string const& text) + { + std::istringstream input {text}; + input.imbue (std::locale::classic ()); + int selected; + int count; + char separator; + if (!(input >> selected >> separator >> count) || separator != '/' + || selected <= 0 || count <= 0 || selected > count) + { + return RoundRobinPolicy::random (); + } + input >> std::ws; + if (!input.eof ()) return RoundRobinPolicy::random (); + return RoundRobinPolicy::fixed (selected - 1, count); + } + + std::string formatRoundRobinPolicy (RoundRobinPolicy const& policy) + { + if (policy.kind == RoundRobinPolicy::Kind::Random) return "random"; + return std::to_string (policy.selectedSlot + 1) + "/" + std::to_string (policy.slotCount); + } + + Action Action::setTransmitWindow (PlanId id, bool enabled) + { + Action result; + result.kind = ActionKind::SetTransmitWindow; + result.planId = id; + result.enabled = enabled; + return result; + } + + Action Action::forPlan (ActionKind kind, PlanId id) + { + Action result; + result.kind = kind; + result.planId = id; + return result; + } + + Controller::Actions Controller::enterMode (std::int64_t periodMilliseconds, + RoundRobinPolicy policy) + { + m_active = true; + m_roundRobinPolicy = policy; + return setPeriod (periodMilliseconds); + } + + Controller::Actions Controller::exitMode () + { + Actions actions; + m_active = false; + m_initialized = false; + m_currentCompleted = false; + m_preparationSuppressed = false; + m_currentFromTxNext = false; + clearFuturePlan (); + if (m_transmitWindow) + { + m_transmitWindow = false; + actions.push_back (Action::setTransmitWindow (m_currentPlanId, false)); + } + if (!m_messageSessionActive) + { + m_txLifecycle = TxLifecycle::None; + m_txStartAccepted = false; + m_txPlanId = {}; + m_currentPlanId = {}; + } + return actions; + } + + Controller::Actions Controller::setPeriod (std::int64_t periodMilliseconds) + { + Actions actions; + if (periodMilliseconds == m_periodMilliseconds && m_initialized) return actions; + + m_periodMilliseconds = periodMilliseconds; + m_initialized = false; + m_currentCompleted = false; + m_preparationSuppressed = false; + m_currentFromTxNext = false; + clearFuturePlan (); + if (m_transmitWindow) + { + m_transmitWindow = false; + actions.push_back (Action::setTransmitWindow (m_currentPlanId, false)); + } + if (!m_messageSessionActive) + { + m_txLifecycle = TxLifecycle::None; + m_txStartAccepted = false; + m_txPlanId = {}; + } + return actions; + } + + void Controller::setAutoEnabled (bool enabled, bool explicitOperatorChange) + { + m_autoEnabled = enabled; + if (!enabled && explicitOperatorChange) m_restoreAuto = false; + } + + void Controller::setRoundRobinPolicy (RoundRobinPolicy policy) + { + m_roundRobinPolicy = policy; + } + + // Tx Next overlays a prepared decision without replacing it; if preparation was + // suppressed, withdrawing Tx Next leaves that target period as Receive. + Controller::Actions Controller::setTxNext (bool enabled) + { + Actions actions; + if (m_txNextPending == enabled) return actions; + m_txNextPending = enabled; + if (!enabled && m_currentFromTxNext + && (m_txLifecycle == TxLifecycle::Decided + || m_txLifecycle == TxLifecycle::StartRequested)) + { + m_currentFromTxNext = false; + auto const transmit = m_txNextUnderlyingDisposition == Disposition::Transmit; + m_currentPlanSource = m_txNextUnderlyingSource; + if (!transmit) + { + if (m_txLifecycle == TxLifecycle::StartRequested) + { + m_currentCompleted = true; + } + else + { + m_txLifecycle = TxLifecycle::None; + m_txStartAccepted = false; + m_txPlanId = {}; + } + } + m_transmitWindow = transmit; + actions.push_back (Action::setTransmitWindow (m_currentPlanId, transmit)); + } + return actions; + } + + // Initialization and clock discontinuities receive through the observed partial + // period; preparation resumes only after that period completes normally. + Controller::Actions Controller::resynchronize (std::int64_t periodSerial) + { + Actions actions; + ++m_epoch; + if (m_epoch == 0) ++m_epoch; + m_initialized = true; + m_currentPeriodSerial = periodSerial; + m_currentPlanId = {m_epoch, periodSerial}; + m_currentCompleted = false; + m_preparationSuppressed = false; + m_currentFromTxNext = false; + clearFuturePlan (); + if (!m_messageSessionActive) + { + m_txLifecycle = TxLifecycle::None; + m_txStartAccepted = false; + m_txPlanId = {}; + } + m_transmitWindow = false; + actions.push_back (Action::setTransmitWindow (m_currentPlanId, false)); + return actions; + } + + Controller::Actions Controller::observeUtc (std::int64_t utcMilliseconds) + { + Actions actions; + if (!m_active || m_periodMilliseconds <= 0 || utcMilliseconds < 0) return actions; + + auto const periodSerial = utcMilliseconds / m_periodMilliseconds; + if (!m_initialized) + { + m_lastObservedUtc = utcMilliseconds; + return resynchronize (periodSerial); + } + + if (m_lastObservedUtc >= 0 && utcMilliseconds < m_lastObservedUtc) + { + m_lastObservedUtc = utcMilliseconds; + return resynchronize (periodSerial); + } + + auto const delta = periodSerial - m_currentPeriodSerial; + m_lastObservedUtc = utcMilliseconds; + if (delta == 0) return actions; + if (delta != 1) return resynchronize (periodSerial); + + auto const failedPreviousStart = !m_messageSessionActive + && (m_txLifecycle == TxLifecycle::Decided + || m_txLifecycle == TxLifecycle::StartRequested); + if (failedPreviousStart) + { + m_txLifecycle = TxLifecycle::None; + m_txStartAccepted = false; + m_txPlanId = {}; + } + m_currentPeriodSerial = periodSerial; + m_currentPlanId = {m_epoch, periodSerial}; + m_currentCompleted = false; + m_preparationSuppressed = false; + + auto underlyingDisposition = Disposition::Receive; + auto underlyingSource = PlanSource::Percentage; + if (m_autoEnabled && m_tuneKind == TuneKind::None) + { + if (m_roundRobinPolicy.kind == RoundRobinPolicy::Kind::Fixed) + { + underlyingDisposition = fixedRoundRobinTransmits (utcMilliseconds) + ? Disposition::Transmit : Disposition::Receive; + } + else if (m_hasFuturePlan && m_futurePlan.id == m_currentPlanId + && m_futurePlan.applicationStatus != ApplicationStatus::AwaitingProposal + && m_futurePlan.applicationStatus != ApplicationStatus::Applying) + { + underlyingDisposition = m_futurePlan.disposition; + underlyingSource = m_futurePlan.source; + } + } + + auto disposition = m_txNextPending && m_autoEnabled + && m_tuneKind == TuneKind::None + ? Disposition::Transmit : underlyingDisposition; + if (m_messageSessionActive) disposition = Disposition::Receive; + m_currentFromTxNext = disposition == Disposition::Transmit && m_txNextPending; + m_txNextUnderlyingDisposition = underlyingDisposition; + m_txNextUnderlyingSource = underlyingSource; + m_currentPlanSource = m_currentFromTxNext ? PlanSource::TxNext : underlyingSource; + + clearFuturePlan (); + m_transmitWindow = disposition == Disposition::Transmit; + if (!m_messageSessionActive) + { + m_txLifecycle = m_transmitWindow ? TxLifecycle::Decided : TxLifecycle::None; + } + actions.push_back (Action::setTransmitWindow (m_currentPlanId, m_transmitWindow)); + if (failedPreviousStart) + { + m_currentCompleted = true; + appendPreparation (actions); + } + return actions; + } + + bool Controller::fixedRoundRobinTransmits (std::int64_t utcMilliseconds) const + { + if (m_roundRobinPolicy.slotCount <= 0 || m_roundRobinPolicy.selectedSlot < 0 + || m_roundRobinPolicy.selectedSlot >= m_roundRobinPolicy.slotCount) + { + return false; + } + static std::int64_t const dayMilliseconds = 86400000; + auto const millisecondsOfDay = utcMilliseconds % dayMilliseconds; + auto const slotOfDay = millisecondsOfDay / m_periodMilliseconds; + return slotOfDay % m_roundRobinPolicy.slotCount == m_roundRobinPolicy.selectedSlot; + } + + void Controller::appendPreparation (Actions& actions) + { + if (!m_active || !m_initialized || m_tuneKind != TuneKind::None) return; + + PlanId const target {m_epoch, m_currentPeriodSerial + 1}; + if ((m_hasFuturePlan && m_futurePlan.id == target) + || (m_preparationSuppressed && target.periodSerial == m_currentPeriodSerial + 1)) + { + return; + } + if (m_txNextPending) + { + m_preparationSuppressed = true; + return; + } + if (m_roundRobinPolicy.kind == RoundRobinPolicy::Kind::Fixed) return; + + m_futurePlan = {}; + m_futurePlan.id = target; + m_futurePlan.applicationStatus = ApplicationStatus::AwaitingProposal; + m_hasFuturePlan = true; + actions.push_back (Action::forPlan (ActionKind::RequestScheduleProposal, target)); + } + + Controller::Actions Controller::receiveCompleted () + { + Actions actions; + if (!m_active || !m_initialized || m_transmitWindow || m_currentCompleted) return actions; + m_currentCompleted = true; + appendPreparation (actions); + return actions; + } + + Controller::Actions Controller::tuneStarted (TuneKind kind, PlanId planId) + { + Actions actions; + if (!m_active || kind == TuneKind::None || m_tuneKind != TuneKind::None) return actions; + if (kind == TuneKind::Automatic + && (!m_hasFuturePlan || m_futurePlan.id != planId + || m_futurePlan.applicationStatus != ApplicationStatus::Applied)) + { + return actions; + } + m_tuneKind = kind; + m_tunePlanId = kind == TuneKind::Manual ? m_currentPlanId : planId; + m_restoreAuto = m_autoEnabled; + if (m_transmitWindow) + { + m_transmitWindow = false; + actions.push_back (Action::setTransmitWindow (m_currentPlanId, false)); + } + return actions; + } + + Controller::Actions Controller::tuneCompleted (PlanId planId) + { + Actions actions; + if (m_tuneKind == TuneKind::None || planId != m_tunePlanId) return actions; + m_tuneKind = TuneKind::None; + m_tunePlanId = {}; + if (m_restoreAuto && m_active) + { + m_autoEnabled = true; + actions.push_back (Action::forPlan (ActionKind::RestoreAuto, m_currentPlanId)); + } + m_restoreAuto = false; + + if (m_hasFuturePlan && m_futurePlan.id.periodSerial <= m_currentPeriodSerial) + { + clearFuturePlan (); + } + if (m_currentCompleted || !m_hasFuturePlan) appendPreparation (actions); + return actions; + } + + Controller::Actions Controller::txStartRequested () + { + Actions actions; + if (m_active && m_transmitWindow && m_txLifecycle == TxLifecycle::Decided) + { + m_txLifecycle = TxLifecycle::StartRequested; + m_txPlanId = m_currentPlanId; + m_txStartAccepted = false; + } + return actions; + } + + Controller::Actions Controller::txStartResult (PlanId planId, bool accepted) + { + Actions actions; + if (planId != m_txPlanId || m_txLifecycle != TxLifecycle::StartRequested) return actions; + if (m_txStartAccepted) return actions; + if (accepted) + { + m_txStartAccepted = true; + return actions; + } + + if (m_currentCompleted) return actions; + m_transmitWindow = false; + m_currentCompleted = true; + actions.push_back (Action::setTransmitWindow (planId, false)); + return actions; + } + + Controller::Actions Controller::messageStarted (PlanId planId) + { + Actions actions; + if (planId != m_txPlanId || m_txLifecycle != TxLifecycle::StartRequested + || !m_txStartAccepted) return actions; + m_txLifecycle = TxLifecycle::MessageStarted; + m_messageSessionActive = true; + if (m_txNextPending) + { + m_txNextPending = false; + actions.push_back (Action::forPlan (ActionKind::ClearTxNextUi, planId)); + } + actions.push_back (Action::forPlan (ActionKind::RecordBeaconTransmission, planId)); + return actions; + } + + Controller::Actions Controller::transmitWindowEnded () + { + Actions actions; + if (!m_transmitWindow) return actions; + m_transmitWindow = false; + actions.push_back (Action::setTransmitWindow (m_currentPlanId, false)); + if (m_txLifecycle == TxLifecycle::Decided + || (m_txLifecycle == TxLifecycle::StartRequested && !m_txStartAccepted)) + { + m_txLifecycle = TxLifecycle::None; + m_txStartAccepted = false; + m_txPlanId = {}; + m_currentCompleted = true; + appendPreparation (actions); + } + return actions; + } + + Controller::Actions Controller::txStopped (PlanId planId) + { + Actions actions; + if (!planId.isValid () || planId != m_txPlanId + || m_txLifecycle == TxLifecycle::None) + { + return actions; + } + auto const sameEpoch = planId.epoch == m_epoch; + m_messageSessionActive = false; + m_txPlanId = {}; + m_txStartAccepted = false; + if (m_transmitWindow) + { + m_transmitWindow = false; + actions.push_back (Action::setTransmitWindow (planId, false)); + } + if (m_txLifecycle == TxLifecycle::MessageStarted + || m_txLifecycle == TxLifecycle::StartRequested + || m_txLifecycle == TxLifecycle::Decided) + { + m_txLifecycle = TxLifecycle::None; + if (sameEpoch) + { + m_currentCompleted = true; + if (m_active) appendPreparation (actions); + } + } + return actions; + } + + Controller::Actions Controller::proposalDelivered ( + PlanId planId, ScheduleProposal const& proposal) + { + Actions actions; + if (!m_active || !m_hasFuturePlan || m_futurePlan.id != planId + || m_futurePlan.applicationStatus != ApplicationStatus::AwaitingProposal) + { + return actions; + } + + m_futurePlan.disposition = proposal.disposition; + m_futurePlan.source = proposal.source; + m_futurePlan.hasHoppingProposal = proposal.hasHoppingProposal; + m_futurePlan.hopping = proposal.hopping; + if (proposal.hasHoppingProposal && proposal.hopping.frequenciesIndex >= 0) + { + m_futurePlan.applicationStatus = ApplicationStatus::Applying; + Action action = Action::forPlan (ActionKind::ApplyBandChange, planId); + action.hopping = proposal.hopping; + actions.push_back (action); + } + else + { + m_futurePlan.applicationStatus = ApplicationStatus::Ready; + } + return actions; + } + + Controller::Actions Controller::bandChangeOutcome (PlanId planId, bool succeeded) + { + Actions actions; + if (!m_active || !m_hasFuturePlan || m_futurePlan.id != planId + || m_futurePlan.applicationStatus != ApplicationStatus::Applying) + { + return actions; + } + + if (!succeeded) + { + m_futurePlan.disposition = Disposition::Receive; + m_futurePlan.applicationStatus = ApplicationStatus::Failed; + return actions; + } + + m_futurePlan.applicationStatus = ApplicationStatus::Applied; + if (m_futurePlan.hopping.tuneRequired) + { + actions.push_back (Action::forPlan (ActionKind::StartAutomaticTune, planId)); + } + return actions; + } + + void Controller::clearFuturePlan () + { + m_hasFuturePlan = false; + m_futurePlan = {}; + } + +} diff --git a/BeaconTxController.hpp b/BeaconTxController.hpp new file mode 100644 index 00000000..02dabb30 --- /dev/null +++ b/BeaconTxController.hpp @@ -0,0 +1,184 @@ +#ifndef BEACONTXCONTROLLER_HPP +#define BEACONTXCONTROLLER_HPP + +#include +#include +#include + +namespace BeaconTx +{ + // Identifies one UTC period within a scheduling epoch so delayed outcomes from + // an earlier mode, period, or clock timeline cannot affect the current schedule. + struct PlanId + { + std::uint64_t epoch {0}; + std::int64_t periodSerial {-1}; + + bool isValid () const {return epoch != 0 && periodSerial >= 0;} + }; + + inline bool operator== (PlanId const& lhs, PlanId const& rhs) + { + return lhs.epoch == rhs.epoch && lhs.periodSerial == rhs.periodSerial; + } + + inline bool operator!= (PlanId const& lhs, PlanId const& rhs) + { + return !(lhs == rhs); + } + + enum class Disposition {Receive, Transmit}; + enum class PlanSource {Percentage, BandHop, TxNext}; + enum class ApplicationStatus {AwaitingProposal, Ready, Applying, Applied, Failed}; + // A requested and accepted start is not yet a beacon transmission. MessageStarted + // means the audio source committed, which is when Tx Next and history may change. + enum class TxLifecycle {None, Decided, StartRequested, MessageStarted}; + enum class TuneKind {None, Manual, Automatic}; + + struct RoundRobinPolicy + { + enum class Kind {Random, Fixed}; + + Kind kind {Kind::Random}; + int selectedSlot {0}; + int slotCount {0}; + + static RoundRobinPolicy random () {return {};} + static RoundRobinPolicy fixed (int selected, int count) + { + RoundRobinPolicy result; + result.kind = Kind::Fixed; + result.selectedSlot = selected; + result.slotCount = count; + return result; + } + }; + + RoundRobinPolicy parseRoundRobinPolicy (std::string const& text); + std::string formatRoundRobinPolicy (RoundRobinPolicy const& policy); + + struct HoppingProposal + { + int frequenciesIndex {-1}; + bool tuneRequired {false}; + std::string periodName; + }; + + // A provider's scheduling choice, containing no rig or UI effects. BeaconPlan + // is the controller-owned copy tied to a target period and tracks application. + struct ScheduleProposal + { + Disposition disposition {Disposition::Receive}; + PlanSource source {PlanSource::Percentage}; + bool hasHoppingProposal {false}; + HoppingProposal hopping; + }; + + struct BeaconPlan + { + PlanId id; + Disposition disposition {Disposition::Receive}; + PlanSource source {PlanSource::Percentage}; + bool hasHoppingProposal {false}; + HoppingProposal hopping; + ApplicationStatus applicationStatus {ApplicationStatus::AwaitingProposal}; + }; + + enum class ActionKind + { + SetTransmitWindow, + RequestScheduleProposal, + ApplyBandChange, + StartAutomaticTune, + RestoreAuto, + ClearTxNextUi, + RecordBeaconTransmission + }; + + struct Action + { + ActionKind kind {ActionKind::SetTransmitWindow}; + PlanId planId; + bool enabled {false}; + HoppingProposal hopping; + + static Action setTransmitWindow (PlanId id, bool enabled); + static Action forPlan (ActionKind kind, PlanId id); + }; + + // Owns WSPR/FST4W period plans and Tx/Tune lifecycle state. It reads no clock and + // performs no UI or rig I/O; callers supply events, apply actions, and report + // outcomes by PlanId. + class Controller final + { + public: + using Actions = std::vector; + + Actions enterMode (std::int64_t periodMilliseconds, + RoundRobinPolicy policy = RoundRobinPolicy::random ()); + Actions exitMode (); + Actions setPeriod (std::int64_t periodMilliseconds); + void setAutoEnabled (bool enabled, bool explicitOperatorChange = true); + void setRoundRobinPolicy (RoundRobinPolicy policy); + Actions setTxNext (bool enabled); + + Actions observeUtc (std::int64_t utcMilliseconds); + Actions receiveCompleted (); + Actions tuneStarted (TuneKind kind, PlanId planId = {}); + Actions tuneCompleted (PlanId planId); + Actions txStartRequested (); + Actions txStartResult (PlanId planId, bool accepted); + Actions messageStarted (PlanId planId); + Actions transmitWindowEnded (); + Actions txStopped (PlanId planId); + Actions proposalDelivered (PlanId planId, ScheduleProposal const& proposal); + Actions bandChangeOutcome (PlanId planId, bool succeeded); + + bool active () const {return m_active;} + bool autoEnabled () const {return m_autoEnabled;} + bool txNextPending () const {return m_txNextPending;} + bool transmitWindow () const {return m_transmitWindow;} + TuneKind tuneKind () const {return m_tuneKind;} + TxLifecycle txLifecycle () const {return m_txLifecycle;} + PlanSource currentPlanSource () const {return m_currentPlanSource;} + PlanId currentPlanId () const {return m_currentPlanId;} + PlanId txPlanId () const {return m_txPlanId;} + PlanId tunePlanId () const {return m_tunePlanId;} + BeaconPlan const * futurePlan () const {return m_hasFuturePlan ? &m_futurePlan : nullptr;} + + private: + Actions resynchronize (std::int64_t periodSerial); + void appendPreparation (Actions& actions); + bool fixedRoundRobinTransmits (std::int64_t utcMilliseconds) const; + void clearFuturePlan (); + + bool m_active {false}; + bool m_autoEnabled {false}; + bool m_txNextPending {false}; + bool m_initialized {false}; + bool m_transmitWindow {false}; + bool m_currentCompleted {false}; + bool m_hasFuturePlan {false}; + bool m_preparationSuppressed {false}; + bool m_restoreAuto {false}; + bool m_messageSessionActive {false}; + bool m_txStartAccepted {false}; + bool m_currentFromTxNext {false}; + std::uint64_t m_epoch {0}; + std::int64_t m_periodMilliseconds {0}; + std::int64_t m_currentPeriodSerial {-1}; + std::int64_t m_lastObservedUtc {-1}; + RoundRobinPolicy m_roundRobinPolicy; + Disposition m_txNextUnderlyingDisposition {Disposition::Receive}; + PlanSource m_txNextUnderlyingSource {PlanSource::Percentage}; + PlanSource m_currentPlanSource {PlanSource::Percentage}; + BeaconPlan m_futurePlan; + PlanId m_currentPlanId; + PlanId m_txPlanId; + TxLifecycle m_txLifecycle {TxLifecycle::None}; + TuneKind m_tuneKind {TuneKind::None}; + PlanId m_tunePlanId; + }; +} + +#endif diff --git a/CMake/CompilerFlags.cmake b/CMake/CompilerFlags.cmake new file mode 100644 index 00000000..efc6a328 --- /dev/null +++ b/CMake/CompilerFlags.cmake @@ -0,0 +1,282 @@ +# +# Compiler/linker flags, Fortran-C interop, RPATH, and Qt install paths +# -- included from the top-level CMakeLists.txt at the equivalent +# point. Included (not add_subdirectory'd), so CMAKE_CURRENT_SOURCE_DIR +# stays the project root; depends on package/compiler results from +# CMake/Dependencies.cmake, included immediately before this. +# +# +# C & C++ setup +# +set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") + +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -fexceptions -frtti") + +if (NOT APPLE) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas") + if (${OPENMP_FOUND}) + if (OpenMP_C_FLAGS) + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_C_FLAGS}") + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") + endif () + endif () + set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fdata-sections -ffunction-sections") + set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -fdata-sections -ffunction-sections") + set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fdata-sections -ffunction-sections") + set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -fdata-sections -ffunction-sections") +endif (NOT APPLE) + +if (WIN32) + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") +endif (WIN32) + +if (APPLE AND ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") +else () + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") + set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") +endif () + + +# +# Fortran setup +# +set (General_FFLAGS "-Wall -Wno-conversion -Wno-c-binding-type -fno-second-underscore") + +# FFLAGS depend on the compiler +get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME) + +if (Fortran_COMPILER_NAME MATCHES "gfortran.*") + # gfortran + + # Procedure trampolines require executable stack memory on affected targets. + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Werror=trampolines") + + # CMake compiler test is supposed to do this but doesn't yet + if (CMAKE_OSX_DEPLOYMENT_TARGET) + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}") + endif (CMAKE_OSX_DEPLOYMENT_TARGET) + if (CMAKE_OSX_SYSROOT) + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -isysroot ${CMAKE_OSX_SYSROOT}") + endif (CMAKE_OSX_SYSROOT) + + # Decoder callbacks are module procedures, so all gfortran builds can keep + # the process stack non-executable. + if (UNIX AND NOT APPLE AND Fortran_COMPILER_NAME MATCHES "gfortran.*") + set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wa,--noexecstack") + endif () + + set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -funroll-loops -fno-f2c -ffpe-summary=invalid,zero,overflow,underflow ${General_FFLAGS}") + + set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -ggdb -O0 -fbacktrace -fcheck=all -fbounds-check -fno-f2c -ffpe-summary=invalid,zero,overflow,underflow ${General_FFLAGS}") + + # FPE traps currently disabled in Debug configuration builds until + # we decide if they are meaningful, without these FP instructions + # run in nonstop mode and do not trap + #set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${CMAKE_Fortran_FLAGS_DEBUG} -ffpe-trap=invalid,zero,overflow") + +elseif (Fortran_COMPILER_NAME MATCHES "ifort.*") + # ifort (untested) + set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -f77rtl ${General_FFLAGS}") + set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -f77rtl ${General_FFLAGS}") +elseif (Fortran_COMPILER_NAME MATCHES "g77") + # g77 + set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -funroll-all-loops -fno-f2c -m32 ${General_FFLAGS}") + set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fbounds-check -fno-f2c -m32 ${General_FFLAGS}") + +else() + message ("CMAKE_Fortran_COMPILER full path: ${CMAKE_Fortran_COMPILER}") + message ("Fortran compiler: ${Fortran_COMPILER_NAME}") + message ("No optimized Fortran compiler flags are known, we just try -O3...") + set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O3 ${General_FFLAGS}") + set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -g -fbacktrace -fcheck=all -fbounds-check ${General_FFLAGS}") +endif() + +# +# Linker setup +# +if (NOT APPLE) + set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Wl,--gc-sections") + set (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} -Wl,--gc-sections") +endif (NOT APPLE) + + +# +# setup and test Fortran C/C++ interaction +# + +include (FortranCInterface) +FortranCInterface_VERIFY (CXX) +FortranCInterface_HEADER (FC.h MACRO_NAMESPACE "FC_" SYMBOL_NAMESPACE "FC_" + SYMBOLS + grayline + ) + +if (WSJT_ENABLE_ASAN_UBSAN AND WSJT_ENABLE_TSAN) + message (FATAL_ERROR + "WSJT_ENABLE_ASAN_UBSAN and WSJT_ENABLE_TSAN cannot be enabled together.") +endif () + +if (WSJT_ENABLE_ASAN_UBSAN) + if (NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") + message (FATAL_ERROR "WSJT_ENABLE_ASAN_UBSAN is supported only on Linux.") + endif () + if (NOT CMAKE_C_COMPILER_ID STREQUAL "GNU" OR + NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR + NOT CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") + message (FATAL_ERROR + "WSJT_ENABLE_ASAN_UBSAN requires GNU C, C++, and Fortran compilers.") + endif () + + include (CheckCCompilerFlag) + include (CheckCXXCompilerFlag) + include (CheckFortranCompilerFlag) + set (_wsjt_sanitizer_probe_flags + "-fsanitize=address,undefined;-fno-sanitize-recover=all") + set (_wsjt_saved_required_libraries "${CMAKE_REQUIRED_LIBRARIES}") + list (APPEND CMAKE_REQUIRED_LIBRARIES "-fsanitize=address,undefined") + check_c_compiler_flag ( + "${_wsjt_sanitizer_probe_flags}" WSJT_C_ASAN_UBSAN_SUPPORTED) + check_cxx_compiler_flag ( + "${_wsjt_sanitizer_probe_flags}" WSJT_CXX_ASAN_UBSAN_SUPPORTED) + check_fortran_compiler_flag ( + "${_wsjt_sanitizer_probe_flags}" WSJT_FORTRAN_ASAN_UBSAN_SUPPORTED) + set (CMAKE_REQUIRED_LIBRARIES "${_wsjt_saved_required_libraries}") + if (NOT WSJT_C_ASAN_UBSAN_SUPPORTED OR + NOT WSJT_CXX_ASAN_UBSAN_SUPPORTED OR + NOT WSJT_FORTRAN_ASAN_UBSAN_SUPPORTED) + message (FATAL_ERROR + "The selected GNU toolchain cannot compile and link ASan+UBSan code in every project language.") + endif () + + add_library (wsjt_sanitizers INTERFACE) + target_compile_options (wsjt_sanitizers INTERFACE + $<$:-fsanitize=address,undefined> + $<$:-fsanitize=address,undefined> + $<$:-fsanitize=address,undefined> + -fno-sanitize-recover=all + -fno-omit-frame-pointer + -g + -O1 + ) + target_link_libraries (wsjt_sanitizers INTERFACE + "-fsanitize=address,undefined") + link_libraries (wsjt_sanitizers) + message (STATUS "AddressSanitizer and UndefinedBehaviorSanitizer enabled") +elseif (WSJT_ENABLE_TSAN) + if (NOT CMAKE_SYSTEM_NAME STREQUAL "Linux") + message (FATAL_ERROR "WSJT_ENABLE_TSAN is supported only on Linux.") + endif () + if (NOT CMAKE_C_COMPILER_ID STREQUAL "GNU" OR + NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR + NOT CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") + message (FATAL_ERROR + "WSJT_ENABLE_TSAN requires GNU C, C++, and Fortran compilers.") + endif () + + include (CheckCCompilerFlag) + include (CheckCXXCompilerFlag) + include (CheckFortranCompilerFlag) + set (_wsjt_sanitizer_probe_flags "-fsanitize=thread") + set (_wsjt_saved_required_libraries "${CMAKE_REQUIRED_LIBRARIES}") + list (APPEND CMAKE_REQUIRED_LIBRARIES "-fsanitize=thread") + check_c_compiler_flag ( + "${_wsjt_sanitizer_probe_flags}" WSJT_C_TSAN_SUPPORTED) + check_cxx_compiler_flag ( + "${_wsjt_sanitizer_probe_flags}" WSJT_CXX_TSAN_SUPPORTED) + check_fortran_compiler_flag ( + "${_wsjt_sanitizer_probe_flags}" WSJT_FORTRAN_TSAN_SUPPORTED) + set (CMAKE_REQUIRED_LIBRARIES "${_wsjt_saved_required_libraries}") + if (NOT WSJT_C_TSAN_SUPPORTED OR + NOT WSJT_CXX_TSAN_SUPPORTED OR + NOT WSJT_FORTRAN_TSAN_SUPPORTED) + message (FATAL_ERROR + "The selected GNU toolchain cannot compile and link TSan code in every project language.") + endif () + + add_library (wsjt_sanitizers INTERFACE) + target_compile_options (wsjt_sanitizers INTERFACE + $<$:-fsanitize=thread> + $<$:-fsanitize=thread> + $<$:-fsanitize=thread> + $<$:-Wno-error=tsan> + -fno-omit-frame-pointer + -g1 + -O1 + ) + target_link_libraries (wsjt_sanitizers INTERFACE "-fsanitize=thread") + link_libraries (wsjt_sanitizers) + message (STATUS "ThreadSanitizer enabled") +endif () + + +# +# sort out pre-requisites +# + +# +# Setup RPATH so that built executable targets will run in both the +# build tree and the install location without having to set a +# (DYLD|LD)_LIBRARY_PATH override. +# + +# use the full RPATH of the build tree +set (CMAKE_SKIP_BUILD_RPATH FALSE) + +# when building, don't use the install RPATH, it will still be used +# later on in the install phase +set (CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + +# set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") + +# add the automaticaly determined parts of the RPATH which point to +# directories outside of the build tree to the install RPATH +set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) + +# the RPATH to be used when installing, but only if it's not a system +# directory +# list (FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" isSystemDir) +# if ("${isSystemDir}" STREQUAL "-1") +# set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") +# endif ("${isSystemDir}" STREQUAL "-1") + +set (QT_NEED_RPATH FALSE) +if (NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64") + set (QT_NEED_RPATH TRUE) +endif () + +get_target_property (LCONVERT_EXECUTABLE Qt5::lconvert LOCATION) + +if (NOT Qt5Gui_PLUGINS) + message (FATAL_ERROR "Qt did not provide any imported GUI plugin targets") +endif () +list (GET Qt5Gui_PLUGINS 0 qt_plugin_target_) +get_target_property (qt_plugin_file_ ${qt_plugin_target_} LOCATION) +get_filename_component (qt_plugin_type_dir_ "${qt_plugin_file_}" DIRECTORY) +get_filename_component (QT_PLUGINS_DIR "${qt_plugin_type_dir_}" DIRECTORY) +message (STATUS "Qt plugins directory: ${QT_PLUGINS_DIR}") + +# A native qmake reports native paths, so the target location is explicit +# when cross-compiling. Native builds continue querying their own qmake. +if (CMAKE_CROSSCOMPILING) + if (NOT WSJT_QT_TARGET_TRANSLATIONS_DIR) + message (FATAL_ERROR + "WSJT_QT_TARGET_TRANSLATIONS_DIR is required when cross-compiling") + endif () + set (QT_TRANSLATIONS_DIR "${WSJT_QT_TARGET_TRANSLATIONS_DIR}") +else () + get_target_property (QMAKE_EXECUTABLE Qt5::qmake LOCATION) + execute_process ( + COMMAND "${QMAKE_EXECUTABLE}" -query QT_INSTALL_TRANSLATIONS + RESULT_VARIABLE qt_translations_query_result_ + OUTPUT_VARIABLE QT_TRANSLATIONS_DIR + ERROR_VARIABLE qt_translations_query_error_ + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if (NOT "${qt_translations_query_result_}" STREQUAL "0" OR NOT QT_TRANSLATIONS_DIR) + message (FATAL_ERROR + "Unable to determine the Qt translations directory: ${qt_translations_query_error_}") + endif () +endif () +file (TO_CMAKE_PATH "${QT_TRANSLATIONS_DIR}" QT_TRANSLATIONS_DIR) +message (STATUS "Qt translations directory: ${QT_TRANSLATIONS_DIR}") diff --git a/CMake/Dependencies.cmake b/CMake/Dependencies.cmake new file mode 100644 index 00000000..302e3196 --- /dev/null +++ b/CMake/Dependencies.cmake @@ -0,0 +1,150 @@ +# +# Dependency detection -- included from the top-level CMakeLists.txt +# at the equivalent point. Included (not add_subdirectory'd), so +# CMAKE_CURRENT_SOURCE_DIR stays the project root and results (found +# packages, RIGCTL*_EXE, LIBM_LIBRARIES, etc.) remain visible to the +# rest of the top-level file exactly as when this was inline. +# +# +# find some useful tools +# +include (CheckTypeSize) +include (CheckCSourceCompiles) +include (CheckIncludeFiles) +include (CheckSymbolExists) +include (generate_version_info) + +find_program(CTAGS ctags) +find_program(ETAGS etags) + +# +# Platform checks +# +check_include_files ("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS) +check_include_files (stdio.h HAVE_STDIO_H) +check_include_files (stdlib.h HAVE_STDLIB_H) +check_include_files (unistd.h HAVE_UNISTD_H) +check_include_files (sys/ioctl.h HAVE_SYS_IOCTL_H) +check_include_files (sys/types.h HAVE_SYS_TYPES_H) +check_include_files (fcntl.h HAVE_FCNTL_H) +check_include_files (sys/stat.h HAVE_SYS_STAT_H) +check_include_files ("linux/ppdev.h;linux/parport.h" HAVE_LINUX_PPDEV_H) +check_include_files ("dev/ppbus/ppi.h;dev/ppbus/ppbconf.h" HAVE_DEV_PPBUS_PPI_H) + +# +# Standard C Math Library +# +set (LIBM_TEST_SOURCE "#include\nfloat f; int main(){sqrt(f);return 0;}") +check_c_source_compiles ("${LIBM_TEST_SOURCE}" HAVE_MATH) +if (HAVE_MATH) + set (LIBM_LIBRARIES) +else () + set (CMAKE_REQUIRED_LIBRARIES m) + check_c_source_compiles ("${LIBM_TEST_SOURCE}" HAVE_LIBM_MATH) + unset (CMAKE_REQUIRED_LIBRARIES) + if (NOT HAVE_LIBM_MATH) + message (FATAL_ERROR "Unable to use C math library functions") + endif () + set (LIBM_LIBRARIES m) +endif () + +# +# Boost +# +if (WIN32) + set (Boost_USE_STATIC_LIBS OFF) +endif () +find_package (Boost 1.62 REQUIRED COMPONENTS log_setup log) + +# +# OpenMP +# +find_package (OpenMP) + +if (APPLE) + set (WSJT_MACOS_LIBGOMP_LIBRARY "" CACHE FILEPATH "Path to the static GNU OpenMP runtime archive") + if (NOT WSJT_MACOS_LIBGOMP_LIBRARY) + execute_process ( + COMMAND ${CMAKE_Fortran_COMPILER} -print-file-name=libgomp.a + OUTPUT_VARIABLE WSJT_MACOS_LIBGOMP_LIBRARY + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + endif () + if (NOT WSJT_MACOS_LIBGOMP_LIBRARY OR NOT EXISTS "${WSJT_MACOS_LIBGOMP_LIBRARY}") + message (FATAL_ERROR "Static GNU OpenMP runtime archive not found. Set WSJT_MACOS_LIBGOMP_LIBRARY to libgomp.a for deployable macOS builds.") + endif () +endif () + +# +# fftw3 single precision library +# +find_package (FFTW3 COMPONENTS single threads REQUIRED) + +# +# hamlib setup +# +find_package (Hamlib REQUIRED) +find_program (RIGCTL_EXE rigctl) +find_program (RIGCTLD_EXE rigctld) +find_program (RIGCTLCOM_EXE rigctlcom) + +check_type_size (CACHE_ALL HAMLIB_OLD_CACHING) +check_symbol_exists (rig_set_cache_timeout_ms "hamlib/rig.h" HAVE_HAMLIB_CACHING) +set (CMAKE_REQUIRED_INCLUDES ${Hamlib_INCLUDE_DIR}) +check_c_source_compiles (" +#include +int main(void) { return sizeof(&rig_get_conf2) > 0 ? 0 : 1; } +" HAVE_HAMLIB_GET_CONF2) +unset (CMAKE_REQUIRED_INCLUDES) + +find_package (Usb REQUIRED) + +if (WSJT_FOX_OTP) + add_definitions (-DFOX_OTP) +endif () + +# +# Qt5 setup +# + +# Widgets finds its own dependencies. +find_package (Qt5 COMPONENTS Widgets SerialPort Multimedia PrintSupport Sql LinguistTools WebSockets REQUIRED) + +if (CMAKE_CROSSCOMPILING) + if (NOT WSJT_QT_HOST_PATH) + message (FATAL_ERROR + "WSJT_QT_HOST_PATH is required when cross-compiling with Qt 5") + endif () + foreach (_qt_tool IN ITEMS qmake moc uic rcc lrelease lupdate lconvert) + if (TARGET Qt5::${_qt_tool}) + set (_qt_host_tool "${WSJT_QT_HOST_PATH}/${_qt_tool}${CMAKE_HOST_EXECUTABLE_SUFFIX}") + if (NOT EXISTS "${_qt_host_tool}") + message (FATAL_ERROR "Native Qt tool not found: ${_qt_host_tool}") + endif () + set_property (TARGET Qt5::${_qt_tool} PROPERTY IMPORTED_LOCATION "${_qt_host_tool}") + foreach (_qt_config IN ITEMS DEBUG RELEASE RELWITHDEBINFO MINSIZEREL) + set_property (TARGET Qt5::${_qt_tool} PROPERTY + IMPORTED_LOCATION_${_qt_config} "${_qt_host_tool}") + endforeach () + endif () + endforeach () + unset (_qt_config) + unset (_qt_host_tool) + unset (_qt_tool) +endif () + +if (WIN32) + add_definitions (-DQT_NEEDS_QTMAIN) + find_package (Qt5AxContainer REQUIRED) +endif (WIN32) + +# +# Library building setup +# +include (GenerateExportHeader) +set (CMAKE_CXX_VISIBILITY_PRESET hidden) +set (CMAKE_C_VISIBILITY_PRESET hidden) +set (CMAKE_Fortran_VISIBILITY_PRESET hidden) +set (CMAKE_VISIBILITY_INLINES_HIDDEN ON) +#set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) diff --git a/CMake/Install.cmake b/CMake/Install.cmake new file mode 100644 index 00000000..7fb8d9d0 --- /dev/null +++ b/CMake/Install.cmake @@ -0,0 +1,255 @@ +# +# Install rules -- included from the top-level CMakeLists.txt at the +# equivalent point. Included (not add_subdirectory'd), so +# CMAKE_CURRENT_SOURCE_DIR/CMAKE_CURRENT_BINARY_DIR stay the project +# root/build-dir, matching configure_file() and install() paths below +# that were written assuming that. Covers install(TARGETS/FILES/ +# PROGRAMS/DIRECTORY) rules, Windows OpenSSL runtime DLL bundling, +# macOS installer files, and the uninstall target. Versioning/ +# packaging (CPack, revisiontag) stays in the top-level file. +# +install (TARGETS wsjtx + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + BUNDLE DESTINATION . COMPONENT runtime + ) + +# install (TARGETS wsjtx_udp EXPORT udp +# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} +# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} +# PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/wsjtx +# ) +# install (TARGETS wsjtx_udp-static EXPORT udp-static +# DESTINATION ${CMAKE_INSTALL_LIBDIR} +# ) + +# install (EXPORT udp NAMESPACE wsjtx:: +# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wsjtx +# ) +# install (EXPORT udp-static NAMESPACE wsjtx:: +# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wsjtx +# ) + +install (TARGETS udp_daemon message_aggregator wsjtx_app_version + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + ) + +install (TARGETS jt9 wsprd fmtave fcal fmeasure + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + ) + +if (WSJT_BUILD_JT9STREAM) + install (TARGETS jt9stream + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + ) +endif (WSJT_BUILD_JT9STREAM) + +if (NOT WSJT_SKIP_QMAP) + install (TARGETS qmap + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + ) +endif () + +install (TARGETS map65 + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + ) + +if(WSJT_BUILD_UTILS) +install (TARGETS ft8code jt65code jt9code jt4code msk144code + q65code fst4sim ft8sim q65sim EchoCallSim testEchoCall echosim + hash22calc cablog sjtty rjtty + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime + ) + +endif(WSJT_BUILD_UTILS) + +install (PROGRAMS + ${RIGCTL_EXE} + DESTINATION ${CMAKE_INSTALL_BINDIR} + #COMPONENT runtime + RENAME rigctl-wsjtx${CMAKE_EXECUTABLE_SUFFIX} + ) + +install (PROGRAMS + ${RIGCTLD_EXE} + DESTINATION ${CMAKE_INSTALL_BINDIR} + #COMPONENT runtime + RENAME rigctld-wsjtx${CMAKE_EXECUTABLE_SUFFIX} + ) + +install (PROGRAMS + ${RIGCTLCOM_EXE} + DESTINATION ${CMAKE_INSTALL_BINDIR} + #COMPONENT runtime + RENAME rigctlcom-wsjtx${CMAKE_EXECUTABLE_SUFFIX} + ) + +install (FILES + README.md + DESTINATION ${CMAKE_INSTALL_DOCDIR} + RENAME README + #COMPONENT runtime + ) + +install (FILES + COPYING + AUTHORS + THANKS + NEWS + BUGS + DESTINATION ${CMAKE_INSTALL_DOCDIR} + #COMPONENT runtime + ) + +install (FILES + ${WSJTX_DATA_FILES} + DESTINATION ${WSJT_DATA_DESTINATION} + #COMPONENT runtime + ) + +install (DIRECTORY + example_log_configurations + DESTINATION ${CMAKE_INSTALL_DOCDIR} + FILES_MATCHING REGEX "^.*[^~]$" + #COMPONENT runtime + ) + +if (APPLE) + set (WSJT_SOUND_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}) +elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux") + set (WSJT_SOUND_DESTINATION ${WSJT_DATA_DESTINATION}) +else () + set (WSJT_SOUND_DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif () +install (DIRECTORY + ${PROJECT_SOURCE_DIR}/sounds + DESTINATION ${WSJT_SOUND_DESTINATION} + #COMPONENT runtime + ) + +if (WIN32) + # Bundle OpenSSL runtime DLLs from the build environment. + # Qt's QSslSocket loads OpenSSL by filename at runtime; the names depend + # on what Qt was built against (libssl-1_1*.dll for older Qt-on-OpenSSL-1.1, + # libssl-3-x64.dll for current MSYS2 Qt-on-OpenSSL-3). Search the runtime + # directories CMake can infer from Qt, MinGW, MSYS2, or JTSDK so SuperFox + # verification, Update Hamlib, LotW download, and eQSL keep working across + # supported build environments. + set (WSJT_OPENSSL_RUNTIME_DIR "" CACHE PATH + "Directory containing OpenSSL runtime DLLs to bundle on Windows.") + option (WSJT_ALLOW_MISSING_OPENSSL_RUNTIME_DLLS + "Allow Windows installs without bundled OpenSSL runtime DLLs." OFF) + + set (_openssl_runtime_dirs) + macro (_add_openssl_runtime_dir _dir) + if (NOT "${_dir}" STREQUAL "") + file (TO_CMAKE_PATH "${_dir}" _openssl_candidate_dir) + if (NOT _openssl_candidate_dir MATCHES "(^|.*/)usr/bin/?$") + list (FIND _openssl_runtime_dirs "${_openssl_candidate_dir}" _openssl_candidate_index) + if (_openssl_candidate_index EQUAL -1) + list (APPEND _openssl_runtime_dirs "${_openssl_candidate_dir}") + endif () + endif () + endif () + endmacro () + + _add_openssl_runtime_dir ("${WSJT_OPENSSL_RUNTIME_DIR}") + + if (TARGET Qt5::Core) + get_target_property (_qt_core_runtime Qt5::Core LOCATION) + if (_qt_core_runtime) + get_filename_component (_qt_core_runtime_dir "${_qt_core_runtime}" DIRECTORY) + _add_openssl_runtime_dir ("${_qt_core_runtime_dir}") + endif () + endif () + + if (CMAKE_CXX_COMPILER) + get_filename_component (_cxx_compiler_dir "${CMAKE_CXX_COMPILER}" DIRECTORY) + _add_openssl_runtime_dir ("${_cxx_compiler_dir}") + endif () + + foreach (_openssl_env_prefix IN ITEMS MINGW_PREFIX MSYSTEM_PREFIX) + if (NOT "$ENV{${_openssl_env_prefix}}" STREQUAL "") + file (TO_CMAKE_PATH "$ENV{${_openssl_env_prefix}}" _openssl_env_path) + if (NOT _openssl_env_path MATCHES "(^|.*/)usr/?$") + _add_openssl_runtime_dir ("${_openssl_env_path}/bin") + endif () + endif () + endforeach () + + if (NOT "$ENV{JTSDK_TOOLS}" STREQUAL "") + file (TO_CMAKE_PATH "$ENV{JTSDK_TOOLS}" _jtsdk_tools_path) + _add_openssl_runtime_dir ("${_jtsdk_tools_path}/msys64/mingw64/bin") + endif () + + _add_openssl_runtime_dir ("/mingw64/bin") + + set (_openssl_runtime_dlls) + foreach (_openssl_runtime_dir IN LISTS _openssl_runtime_dirs) + file (GLOB _openssl_ssl_dlls "${_openssl_runtime_dir}/libssl-*.dll") + file (GLOB _openssl_crypto_dlls "${_openssl_runtime_dir}/libcrypto-*.dll") + if (_openssl_ssl_dlls AND _openssl_crypto_dlls) + list (APPEND _openssl_runtime_dlls + ${_openssl_ssl_dlls} + ${_openssl_crypto_dlls} + ) + set (_openssl_runtime_source_dir "${_openssl_runtime_dir}") + break () + endif () + endforeach () + + if (_openssl_runtime_dlls) + message (STATUS "Using OpenSSL runtime DLLs from ${_openssl_runtime_source_dir}") + install (FILES ${_openssl_runtime_dlls} + DESTINATION ${CMAKE_INSTALL_BINDIR} + #COMPONENT runtime + ) + elseif (WSJT_ALLOW_MISSING_OPENSSL_RUNTIME_DLLS) + message (WARNING + "OpenSSL runtime DLLs not found in: ${_openssl_runtime_dirs}. " + "TLS features (SuperFox, Update Hamlib, LotW, eQSL) will fail on " + "installs without OpenSSL in PATH." + ) + else () + message (FATAL_ERROR + "OpenSSL runtime DLLs were not found for the Windows install image.\n" + "TLS features (SuperFox, Update Hamlib, LotW, eQSL) require bundled " + "OpenSSL DLLs.\n" + "Searched: ${_openssl_runtime_dirs}\n" + "Install the MinGW OpenSSL package, for example:\n" + " pacman -S mingw-w64-x86_64-openssl\n" + "Or point CMake at the DLL directory:\n" + " -DWSJT_OPENSSL_RUNTIME_DIR=/path/to/mingw64/bin\n" + "To build without bundling TLS runtime DLLs:\n" + " -DWSJT_ALLOW_MISSING_OPENSSL_RUNTIME_DLLS=ON" + ) + endif () +endif (WIN32) + +# +# Mac installer files +# +if (APPLE) + install (FILES + Darwin/ReadMe.txt + Darwin/com.wsjtx.sysctl.plist + DESTINATION . + #COMPONENT runtime + ) +endif (APPLE) + +# +# uninstall support +# +configure_file ( + "${CMAKE_CURRENT_SOURCE_DIR}/CMake/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" + @ONLY) +add_custom_target (uninstall + "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") diff --git a/CMake/Modules/GetGitRevisionDescription.cmake b/CMake/Modules/GetGitRevisionDescription.cmake index 7d75ff0b..0184d983 100644 --- a/CMake/Modules/GetGitRevisionDescription.cmake +++ b/CMake/Modules/GetGitRevisionDescription.cmake @@ -63,8 +63,19 @@ function(get_git_head_revision _source_dir _refspecvar _hashvar) if(NOT IS_DIRECTORY ${GIT_DIR}) file(READ ${GIT_DIR} submodule) string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule}) - get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH) - get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE) + if(IS_ABSOLUTE "${GIT_DIR_RELATIVE}") + set(GIT_DIR "${GIT_DIR_RELATIVE}") + else() + get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH) + get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE) + endif() + endif() + set(GIT_COMMON_DIR "${GIT_DIR}") + if(EXISTS "${GIT_DIR}/commondir") + file(READ "${GIT_DIR}/commondir" GIT_COMMON_DIR_RELATIVE) + string(STRIP "${GIT_COMMON_DIR_RELATIVE}" GIT_COMMON_DIR_RELATIVE) + get_filename_component(GIT_COMMON_DIR + "${GIT_DIR}/${GIT_COMMON_DIR_RELATIVE}" ABSOLUTE) endif() set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data") if(NOT EXISTS "${GIT_DATA}") diff --git a/CMake/Modules/GetGitRevisionDescription.cmake.in b/CMake/Modules/GetGitRevisionDescription.cmake.in index 6d8b708e..ac1d2653 100644 --- a/CMake/Modules/GetGitRevisionDescription.cmake.in +++ b/CMake/Modules/GetGitRevisionDescription.cmake.in @@ -21,10 +21,10 @@ string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) if(HEAD_CONTENTS MATCHES "ref") # named branch string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") - if(EXISTS "@GIT_DIR@/${HEAD_REF}") - configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) - else() - configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) + if(EXISTS "@GIT_COMMON_DIR@/${HEAD_REF}") + configure_file("@GIT_COMMON_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) + elseif(EXISTS "@GIT_COMMON_DIR@/packed-refs") + configure_file("@GIT_COMMON_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") set(HEAD_HASH "${CMAKE_MATCH_1}") diff --git a/CMake/Modules/NSIS.template.in b/CMake/Modules/NSIS.template.in index b14a8623..1d90c653 100644 --- a/CMake/Modules/NSIS.template.in +++ b/CMake/Modules/NSIS.template.in @@ -976,7 +976,7 @@ Function .onInit ; (built into every supported Windows version) so no NSIS plugin is ; required. wsjtx_running_check: - nsExec::Exec '"$SYSDIR\cmd.exe" /c tasklist /FI "IMAGENAME eq wsjtx.exe" 2>NUL | $SYSDIR\findstr.exe /I "wsjtx.exe" >NUL' + nsExec::Exec '"$SYSDIR\cmd.exe" /c ""$SYSDIR\tasklist.exe" /FI "IMAGENAME eq wsjtx.exe" 2>NUL | "$SYSDIR\findstr.exe" /I "wsjtx.exe" >NUL"' Pop $0 ${If} $0 == "0" MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION \ diff --git a/CMake/Modules/QtAxMacros.cmake b/CMake/Modules/QtAxMacros.cmake index ee9f88a1..a6ee98d1 100644 --- a/CMake/Modules/QtAxMacros.cmake +++ b/CMake/Modules/QtAxMacros.cmake @@ -5,7 +5,10 @@ if (WIN32) include (CMakeParseArguments) - find_program (DUMPCPP_Executable dumpcpp.exe) + find_program (DUMPCPP_Executable NAMES dumpcpp-qt5 dumpcpp) + if (NOT DUMPCPP_Executable) + message (FATAL_ERROR "dumpcpp tool not found") + endif () # wrap_ax_server (outfiles inputfile ...) @@ -33,4 +36,4 @@ if (WIN32) set(${outfiles} ${${outfiles}} PARENT_SCOPE) endfunction () -endif (WIN32) \ No newline at end of file +endif (WIN32) diff --git a/CMake/Modules/generate_version_info.cmake b/CMake/Modules/generate_version_info.cmake index 4fc6c4a4..e309ef51 100644 --- a/CMake/Modules/generate_version_info.cmake +++ b/CMake/Modules/generate_version_info.cmake @@ -167,14 +167,16 @@ set_source_files_properties("${CMAKE_BINARY_DIR}/${_VersionInfoFile}" PROPERTIES # generate_version_info.cmake if(WIN32) - # Emit a short, unambiguous name in the current target's binary dir - set(_RC_SHORT "wsprd.rc") + set(_RC_SHORT "${PRODUCT_NAME}.rc") configure_file( ${_THIS_MODULE_BASE_DIR}/VersionResource.rc.in ${CMAKE_CURRENT_BINARY_DIR}/${_RC_SHORT} @ONLY ) file(TO_CMAKE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${_RC_SHORT}" _RC_FWD) + # windres doesn't track the ICON directive configure_file wrote into this .rc as a dependency, so an icon-only edit needs this to trigger a rebuild. + get_filename_component(_PRODUCT_ICON_ABS "${PRODUCT_ICON}" ABSOLUTE BASE_DIR "${CMAKE_SOURCE_DIR}") + set_source_files_properties("${_RC_FWD}" PROPERTIES OBJECT_DEPENDS "${_PRODUCT_ICON_ABS}") set(${outfiles} "${_RC_FWD}" PARENT_SCOPE) else() set(${outfiles} "" PARENT_SCOPE) diff --git a/CMake/Modules/read_release_state.cmake b/CMake/Modules/read_release_state.cmake new file mode 100644 index 00000000..5084a0a8 --- /dev/null +++ b/CMake/Modules/read_release_state.cmake @@ -0,0 +1,85 @@ +function (wsjt_read_release_state state_file version_out channel_out rc_out revision_out) + if (NOT EXISTS "${state_file}") + message (FATAL_ERROR "Release state file not found: ${state_file}") + endif () + + file (STRINGS "${state_file}" _wsjt_release_state_lines ENCODING UTF-8) + list (LENGTH _wsjt_release_state_lines _wsjt_release_state_line_count) + if (NOT _wsjt_release_state_line_count EQUAL 4 + AND NOT _wsjt_release_state_line_count EQUAL 5) + message (FATAL_ERROR "${state_file} must contain four or five metadata lines") + endif () + + set (_wsjt_release_state_keys version channel rc revision) + set (_wsjt_release_state_allowed_keys ${_wsjt_release_state_keys} windows_signing) + foreach (_wsjt_release_state_line IN LISTS _wsjt_release_state_lines) + if (NOT _wsjt_release_state_line MATCHES "^([a-z_]+)=(.*)$") + message (FATAL_ERROR "Invalid release metadata line: ${_wsjt_release_state_line}") + endif () + + set (_wsjt_release_state_key "${CMAKE_MATCH_1}") + set (_wsjt_release_state_value "${CMAKE_MATCH_2}") + if (NOT _wsjt_release_state_key IN_LIST _wsjt_release_state_allowed_keys) + message (FATAL_ERROR "Unknown release metadata key: ${_wsjt_release_state_key}") + endif () + if (DEFINED _wsjt_release_state_${_wsjt_release_state_key}) + message (FATAL_ERROR "Duplicate release metadata key: ${_wsjt_release_state_key}") + endif () + set (_wsjt_release_state_${_wsjt_release_state_key} "${_wsjt_release_state_value}") + endforeach () + + if (DEFINED _wsjt_release_state_windows_signing + AND NOT _wsjt_release_state_windows_signing MATCHES "^(signpath|unsigned)$") + message (FATAL_ERROR "Windows signing mode must be signpath or unsigned") + endif () + + foreach (_wsjt_release_state_key IN LISTS _wsjt_release_state_keys) + if (NOT DEFINED _wsjt_release_state_${_wsjt_release_state_key}) + message (FATAL_ERROR "Missing release metadata key: ${_wsjt_release_state_key}") + endif () + endforeach () + + if (NOT _wsjt_release_state_version MATCHES "^[0-9]+[.][0-9]+[.][0-9]+$") + message (FATAL_ERROR "Release version must have the form X.Y.Z") + endif () + if (NOT _wsjt_release_state_channel MATCHES "^(DEVEL|RC|GA)$") + message (FATAL_ERROR "Release channel must be DEVEL, RC, or GA") + endif () + if (_wsjt_release_state_channel STREQUAL "RC") + if (NOT _wsjt_release_state_rc MATCHES "^[1-9][0-9]*$") + message (FATAL_ERROR "RC release state requires a positive rc number") + endif () + elseif (NOT _wsjt_release_state_rc STREQUAL "") + message (FATAL_ERROR "The rc value must be empty for DEVEL and GA release states") + endif () + + if (NOT _wsjt_release_state_revision STREQUAL "$Format:%H$") + string (LENGTH "${_wsjt_release_state_revision}" _wsjt_release_state_revision_length) + if (NOT _wsjt_release_state_revision MATCHES "^[0-9a-fA-F]+$" + OR (NOT _wsjt_release_state_revision_length EQUAL 40 + AND NOT _wsjt_release_state_revision_length EQUAL 64)) + message (FATAL_ERROR "Archive revision must be a full Git object ID") + endif () + endif () + + set (${version_out} "${_wsjt_release_state_version}" PARENT_SCOPE) + set (${channel_out} "${_wsjt_release_state_channel}" PARENT_SCOPE) + set (${rc_out} "${_wsjt_release_state_rc}" PARENT_SCOPE) + if (_wsjt_release_state_revision STREQUAL "$Format:%H$") + set (${revision_out} "" PARENT_SCOPE) + else () + string (TOLOWER "${_wsjt_release_state_revision}" _wsjt_release_state_revision) + set (${revision_out} "${_wsjt_release_state_revision}" PARENT_SCOPE) + endif () +endfunction () + +function (wsjt_set_source_default_cache variable source_default description) + set (_previous_default "_WSJT_PREVIOUS_SOURCE_DEFAULT_${variable}") + if (NOT DEFINED ${variable}) + set (${variable} "${source_default}" CACHE STRING "${description}" FORCE) + elseif (DEFINED ${_previous_default} + AND "${${variable}}" STREQUAL "${${_previous_default}}") + set (${variable} "${source_default}" CACHE STRING "${description}" FORCE) + endif () + set (${_previous_default} "${source_default}" CACHE INTERNAL "Previous source default for ${variable}" FORCE) +endfunction () diff --git a/CMake/Modules/set_build_type.cmake b/CMake/Modules/set_build_type.cmake index 9305c0e7..69dd90b4 100644 --- a/CMake/Modules/set_build_type.cmake +++ b/CMake/Modules/set_build_type.cmake @@ -37,7 +37,7 @@ macro (set_build_type) endif () string (TOUPPER "${WSJT_RELEASE_CHANNEL}" _WSJT_RELEASE_CHANNEL) - if (ARGC GREATER 0) + if (${ARGC} GREATER 0) if (BUILD_TYPE_GA) set (_WSJT_RELEASE_CHANNEL "GA") elseif (BUILD_TYPE_RC) @@ -58,12 +58,17 @@ macro (set_build_type) set (BUILD_TYPE_REVISION "") if (_WSJT_RELEASE_CHANNEL STREQUAL "DEVEL") + if (NOT WSJT_RC_NUMBER STREQUAL "") + message (FATAL_ERROR "WSJT_RC_NUMBER must be empty when WSJT_RELEASE_CHANNEL is DEVEL.") + endif () set (BUILD_TYPE_REVISION "-devel") elseif (_WSJT_RELEASE_CHANNEL STREQUAL "RC") if (NOT WSJT_RC_NUMBER MATCHES "^[1-9][0-9]*$") message (FATAL_ERROR "WSJT_RC_NUMBER must be a positive integer when WSJT_RELEASE_CHANNEL is RC.") endif () set (BUILD_TYPE_REVISION "-rc${WSJT_RC_NUMBER}") + elseif (NOT WSJT_RC_NUMBER STREQUAL "") + message (FATAL_ERROR "WSJT_RC_NUMBER must be empty when WSJT_RELEASE_CHANNEL is GA.") endif () set (WSJT_RELEASE_CHANNEL "${_WSJT_RELEASE_CHANNEL}" CACHE STRING "Build release channel: DEVEL, RC, or GA." FORCE) message (STATUS "Building ${PROJECT_NAME} v${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${BUILD_TYPE_REVISION}") diff --git a/CMake/Sources.cmake b/CMake/Sources.cmake new file mode 100644 index 00000000..32fc5aa1 --- /dev/null +++ b/CMake/Sources.cmake @@ -0,0 +1,908 @@ +# +# Project sources -- included from the top-level CMakeLists.txt at the +# equivalent point in the file. This is included (not add_subdirectory'd), +# so CMAKE_CURRENT_SOURCE_DIR stays the project root and all paths below +# remain relative to it, exactly as when this content was inline. +# +set (fort_qt_CXXSRCS + lib/shmem.cpp + ) + +set (wsjt_qt_CXXSRCS + ActiveStationList.cpp + DecDataMutex.cpp + helper_functions.cpp + qt_helpers.cpp + widgets/MessageBox.cpp + MetaDataRegistry.cpp + Network/NetworkServerLookup.cpp + Network/DecodedTime.cpp + revision_utils.cpp + L10nLoader.cpp + WFPalette.cpp + Radio.cpp + RadioMetaType.cpp + NonInheritingProcess.cpp + models/IARURegions.cpp + models/Bands.cpp + models/Modes.cpp + models/FrequencyList.cpp + models/StationList.cpp + widgets/FrequencyLineEdit.cpp + widgets/FrequencyDeltaLineEdit.cpp + item_delegates/CandidateKeyFilter.cpp + item_delegates/ForeignKeyDelegate.cpp + item_delegates/MessageItemDelegate.cpp + validators/LiveFrequencyValidator.cpp + validators/LiveCQCallsign.cpp + GetUserId.cpp + Audio/AudioDevice.cpp + Audio/TxPlaybackDiagnostics.cpp + Audio/TxAudioQueue.cpp + Modulator/JttyPcmFifo.cpp + Transceiver/Transceiver.cpp + Transceiver/TransceiverBase.cpp + Transceiver/EmulateSplitTransceiver.cpp + Transceiver/TxInhibitTransceiver.cpp + Transceiver/TransceiverFactory.cpp + Transceiver/PollingTransceiver.cpp + Transceiver/HamlibMode.cpp + Transceiver/HamlibTransceiver.cpp + Transceiver/TCITransceiver.cpp + Transceiver/HRDMessage.cpp + Transceiver/HRDTransceiver.cpp + Transceiver/DXLabSuiteCommanderTransceiver.cpp + Network/NetworkMessage.cpp + Network/MessageClient.cpp + widgets/LettersSpinBox.cpp + widgets/HintedSpinBox.cpp + widgets/RestrictedSpinBox.cpp + widgets/HelpTextWindow.cpp + widgets/SettingsDialogLayout.cpp + SampleDownloader.cpp + SampleDownloader/DirectoryDelegate.cpp + SampleDownloader/Directory.cpp + SampleDownloader/FileNode.cpp + SampleDownloader/RemoteFile.cpp + DisplayManual.cpp + PerformanceTrace.cpp + WSJTXLogging.cpp + Decoder/decodedtext.cpp + qmap/qmap_decode_record.cpp + Configuration.cpp + logbook/logbook.cpp + logbook/AdifQso.cpp + MultiSettings.cpp + validators/MaidenheadLocatorValidator.cpp + validators/CallsignValidator.cpp + widgets/SplashScreen.cpp + EqualizationToolsDialog.cpp + widgets/DoubleClickablePushButton.cpp + widgets/DoubleClickableRadioButton.cpp + mycustomspinbox.cpp + Network/LotWUsers.cpp + Network/FileDownload.cpp + Network/FoxVerifier.cpp + Network/Cloudlog.cpp + Network/eqsl.cpp + models/DecodeHighlightingModel.cpp + widgets/DecodeHighlightingListView.cpp + models/FoxLog.cpp + widgets/AbstractLogWindow.cpp + widgets/FoxLogWindow.cpp + widgets/CabrilloLogWindow.cpp + item_delegates/CallsignDelegate.cpp + item_delegates/MaidenheadLocatorDelegate.cpp + item_delegates/FrequencyDelegate.cpp + item_delegates/FrequencyDeltaDelegate.cpp + item_delegates/SQLiteDateTimeDelegate.cpp + models/CabrilloLog.cpp + logbook/AD1CCty.cpp + logbook/WorkedBefore.cpp + logbook/Multiplier.cpp + Network/NetworkAccessManager.cpp + widgets/LazyFillComboBox.cpp + widgets/CheckableItemComboBox.cpp + widgets/BandComboBox.cpp + widgets/BandHopping.cpp + otpgenerator.cpp + MessageFilter.cpp + MessageFilterRules.cpp + MessageFilterLogic.cpp + DecodeOutputPlan.cpp + DecodedMessageReaction.cpp + PrefixSuffix.cpp + CountryNames.cpp + HelpText.cpp + FoxGuardBands.cpp + ) + +set (wsjt_qtmm_CXXSRCS + Audio/AudioStreamDescriptor.cpp + Audio/BWFFile.cpp + Audio/WavFile.cpp + ) + +set (jt9_FSRCS + lib/jt9.f90 + lib/jt9a.f90 + lib/streaming_io.f90 + lib/stream_setmode.c # Windows stdin binary-mode helper (no-op on POSIX) + lib/stream_stdin.c # portable stdin read-fully helper (all platforms) + lib/jt9_version.c + ) + +# jt9stream sources: the Qt-free streaming decoder (B2). Same jt9.f90 main as +# jt9 but ALWAYS the jt9a stub (hard-coded, not jt9a.f90) so it links zero Qt. +set (jt9stream_FSRCS + lib/jt9.f90 + lib/jt9a_stub.f90 + lib/streaming_io.f90 + lib/stream_setmode.c # Windows stdin binary-mode helper (no-op on POSIX) + lib/stream_stdin.c # portable stdin read-fully helper (all platforms) + lib/jt9_version.c + ) + +set (wsjtx_CXXSRCS + Audio/AudioInputSource.hpp + Audio/AudioStreamClock.hpp + DecoderOutputFramer.cpp + Network/PSKReporter.cpp + Network/PSKReporterConfiguration.cpp + Network/PSKReporterIPFIX.cpp + Audio/WavLoadCoordinator.cpp + Audio/WavInputLoader.cpp + Modulator/Modulator.cpp + Detector/Detector.cpp + widgets/logqso.cpp + widgets/displaytext.cpp + getfile.cpp + Audio/soundout.cpp + Audio/soundin.cpp + widgets/meterwidget.cpp + widgets/signalmeter.cpp + widgets/TxDriveSlider.cpp + widgets/plotter.cpp + widgets/widegraph.cpp + widgets/echograph.cpp + widgets/echoplot.cpp + widgets/fastgraph.cpp + widgets/fastplot.cpp + widgets/about.cpp + widgets/astro.cpp + widgets/messageaveraging.cpp + widgets/activeStations.cpp + widgets/colorhighlighting.cpp + WSPR/WsprTxScheduler.cpp + BeaconTxController.cpp + AutoRespondPeriod.cpp + AutoRespondSelectionLatch.cpp + HighlightingRules.cpp + Rr73Policy.cpp + HoundTransmissionPolicy.cpp + SuperFoxTxPlanner.cpp + DecoderIpc.cpp + Ft8MtdDecodeScheduler.cpp + OperatingFrequency.cpp + Ft8MtdDecodeCoordinator.cpp + FastDecode.cpp + widgets/SpecOpLabel.cpp + widgets/mainwindow.cpp + widgets/mainwindow_jtty.cpp + Modulator/JttyTxStream.cpp + widgets/mainwindow_settings.cpp + widgets/mainwindow_show_messages.cpp + widgets/mainwindow_arrl_digi.cpp + widgets/mainwindow_bandhopping.cpp + widgets/mainwindow_slots.cpp + widgets/RoundRobinSelection.cpp + main.cpp + Network/wsprnet.cpp + WSPR/WSPRBandHopping.cpp + widgets/ExportCabrillo.cpp + widgets/QSYMessage.cpp + widgets/QSYMessageParser.cpp + widgets/QSYMessageCreator.cpp + widgets/qsymonitor.cpp + widgets/MMTTYIF.cpp + ) + +if (WSJT_ENABLE_TESTS) + list (APPEND wsjtx_CXXSRCS + Audio/FixtureAudioInput.cpp + Audio/FixtureSoundOutput.cpp + Ft8TxLoopbackTestController.cpp + JttyTxLoopbackTestController.cpp + LiveAudioTestController.cpp + ReceiveHandoffTestController.cpp + ) +endif () + +set (wsjt_CXXSRCS + Logger.cpp + lib/decoder_ipc_control.cpp + lib/crc10.cpp + lib/crc13.cpp + lib/crc14.cpp + ${wsjt_fox_CXXSRCS} + ) +# deal with a GCC v6 UB error message +set_source_files_properties ( + lib/crc10.cpp + lib/crc13.cpp + lib/crc14.cpp + PROPERTIES COMPILE_FLAGS -fpermissive) + +if (WIN32) + set (wsjt_CXXSRCS + ${wsjt_CXXSRCS} + killbyname.cpp + ) + + set (wsjt_qt_CXXSRCS + ${wsjt_qt_CXXSRCS} + Transceiver/OmniRigTransceiver.cpp + ) +endif (WIN32) + +set (wsjt_FSRCS + # put module sources first in the hope that they get rebuilt before use + lib/types.f90 + lib/C_interface_module.f90 + lib/decoder_ipc_atomic.f90 + lib/decode_completion.f90 + lib/jt9_input_validation.f90 + lib/msk_spectrum.f90 + lib/jpl_ephemeris_status.f90 + lib/shmem.f90 + lib/crc.f90 + lib/fftw3mod.f90 + lib/hashing.f90 + lib/iso_c_utilities.f90 + lib/streaming_emit.f90 + lib/streaming_control.f90 + lib/jt9_params_init.f90 + lib/streaming_apply.f90 + lib/jt4.f90 + lib/jt4_decode.f90 + lib/jt65_decode.f90 + lib/jt65_mod.f90 + lib/jt65_mod6.f90 #ft8md + lib/ft8_decode.f90 + lib/ft4_decode.f90 + lib/fst4_decode.f90 + lib/get_q3list.f90 + lib/jt9_decode.f90 + lib/options.f90 + lib/packjt.f90 + lib/77bit/packjt77_schema.f90 + lib/77bit/packjt77_grammar.f90 + lib/77bit/packjt77.f90 + lib/qra/q65/q65_workspace.f90 + lib/qra/q65/q65.f90 + lib/q65_decode.f90 + lib/readwav.f90 + lib/timer_C_wrapper.f90 + lib/timer_impl.f90 + lib/timer_module.f90 + lib/wavhdr.f90 + lib/qra/q65/q65_encoding_modules.f90 + lib/ft8/ft8_a7.f90 + lib/ft8/ft8_a8d.f90 + lib/superfox/sfox_mod.f90 + lib/superfox/julian.f90 + lib/superfox/popen_module.f90 + lib/superfox/qpc/qpc_mod.f90 + lib/ft8var/ft8_decode_ranges.f90 + lib/ft8var/ft8_mtd_residual.f90 + lib/ft8var/ft8_decodevar.f90 + lib/jtty/jtty_source_codec.f90 + lib/jtty/jtty_mod.f90 + lib/jtty/jtty_tbcc_code_profile.f90 + lib/jtty/jtty_tbcc_list_decoder.f90 + lib/jtty/tbcc.f90 + lib/jtty/jtty_tbcc_decoder.f90 + lib/jtty/jtty_payload_correlators.f90 + lib/jtty/jtty_fec_mod.f90 + lib/jtty/jttycom.f90 + lib/jtty/jtty_mdecode.f90 + + # remaining non-module sources + lib/addit.f90 + lib/afc65b.f90 + lib/afc9.f90 + lib/ana64.f90 + lib/ana932.f90 + lib/analytic.f90 + lib/astro.f90 + lib/astrosub.f90 + lib/astro0.f90 + lib/avecho.f90 + lib/averms.f90 + lib/azdist.f90 + lib/ft8/baseline.f90 + lib/ft4/ft4_baseline.f90 + lib/blanker.f90 + lib/bpdecode40.f90 + lib/bpdecode128_90.f90 + lib/ft8/bpdecode174_91.f90 + lib/baddata.f90 + lib/cablog.f90 + lib/calibrate.f90 + lib/ccf2.f90 + lib/ccf65.f90 + lib/ft8/chkcrc13a.f90 + lib/ft8/chkcrc14a.f90 + lib/chkcall.f90 + lib/chkhist.f90 + lib/chkmsg.f90 + lib/chkss2.f90 + lib/ft4/clockit.f90 + lib/ft8/compress.f90 + lib/coord.f90 + lib/db.f90 + lib/decode4.f90 + lib/decode65a.f90 + lib/decode65b.f90 + lib/decode9w.f90 + lib/decode_echo.f90 + lib/ft8/decode174_91.f90 + lib/decoder_callbacks.f90 + lib/decoder.f90 + lib/env_module.f90 + lib/deep4.f90 + lib/deg2grid.f90 + lib/degrade_snr.f90 + lib/demod64a.f90 + lib/determ.f90 + lib/downsam9.f90 + lib/echosim.f90 + lib/echo_snr.f90 + lib/encode232.f90 + lib/encode4.f90 + lib/encode_msk40.f90 + lib/encode_128_90.f90 + lib/ft8/encode174_91.f90 + lib/ft8/encode174_91_nocrc.f90 + lib/entail.f90 + lib/ephem.f90 + lib/extract.f90 + lib/extract4.f90 + lib/extractmessage77.f90 + lib/fano232.f90 + lib/fast9.f90 + lib/fast_decode.f90 + lib/fchisq.f90 + lib/fchisq0.f90 + lib/fchisq65.f90 + lib/fil3.f90 + lib/fil3c.f90 + lib/fil4.f90 + lib/fil6521.f90 + lib/filbig.f90 + lib/ft8/filt8.f90 + lib/fitcal.f90 + lib/flat1.f90 + lib/flat1a.f90 + lib/flat1b.f90 + lib/flat2.f90 + lib/flat4.f90 + lib/flat65.f90 + lib/fmtmsg.f90 + lib/foldspec9f.f90 + lib/four2a.f90 + lib/fspread_lorentz.f90 + lib/ft8/foxfilt.f90 + lib/ft8/foxgen.f90 +# lib/ft8/foxgen_wrap.f90 + lib/freqcal.f90 + lib/ft8/ft8apset.f90 + lib/ft8/ft8b.f90 + lib/ft8/ft8code.f90 + lib/ft8/ft8_downsample.f90 + lib/ft8/ft8sim.f90 + lib/gen4.f90 + lib/gen65.f90 + lib/gen9.f90 + lib/gen_cw_wave.f90 + lib/gen_echocall.f90 + lib/genwave.f90 + lib/ft8/genft8.f90 + lib/qra/q65/genq65.f90 + lib/genmsk_128_90.f90 + lib/genmsk40.f90 + lib/ft4/ft4code.f90 + lib/ft4/genft4.f90 + lib/ft4/gen_ft4wave.f90 + lib/ft8/gen_ft8wave.f90 + lib/ft8/genft8refsig.f90 + lib/genwspr.f90 + lib/geodist.f90 + lib/ft8/get_crc14.f90 + lib/getlags.f90 + lib/getmet4.f90 + lib/ft8/get_spectrum_baseline.f90 + lib/gfsk_pulse.f90 + lib/graycode.f90 + lib/graycode65.f90 + lib/grayline.f90 + lib/grid2deg.f90 + lib/ft8/h1.f90 + lib/hash.f90 + lib/hint65.f90 + lib/hspec.f90 + lib/indexx.f90 + lib/init_random_seed.f90 + lib/interleave4.f90 + lib/interleave63.f90 + lib/interleave9.f90 + lib/inter_wspr.f90 + lib/jplsubs.f + lib/jt9fano.f90 + lib/libration.f90 + lib/lorentzian.f90 + lib/fst4/lorentzian_fading.f90 + lib/lpf1.f90 + lib/map65_mmdec.f90 + lib/mixlpf.f90 + lib/makepings.f90 + lib/moondopjpl.f90 + lib/morse.f90 + lib/move.f90 + lib/msk40decodeframe.f90 + lib/msk144decodeframe.f90 + lib/msk40spd.f90 + lib/msk144spd.f90 + lib/msk40sync.f90 + lib/msk144sync.f90 + lib/msk40_freq_search.f90 + lib/msk144_freq_search.f90 + lib/mskrtd.f90 + lib/msk144signalquality.f90 + lib/msk144sim.f90 + lib/mskrtd.f90 + lib/nuttal_window.f90 + lib/decode_msk144.f90 + lib/ft4/ft4sim.f90 + lib/ft4/ft4sim_mult.f90 + lib/ft4/ft4_downsample.f90 + lib/77bit/my_hash.f90 + lib/wsprd/osdwspr.f90 + lib/ft8/osd174_91.f90 + lib/osd128_90.f90 + lib/pctile.f90 + lib/peakdt9.f90 + lib/peakup.f90 + lib/plotsave.f90 + lib/platanh.f90 + lib/pltanh.f90 + lib/polyfit.f90 + lib/prog_args.f90 + lib/ps4.f90 + lib/qra/q65/q65_ap.f90 + lib/qra/q65/q65_loops.f90 + lib/qra/q65/q65_set_list.f90 + lib/qra/q65/q65_set_list2.f90 + lib/refspectrum.f90 + lib/savec2.f90 + lib/save_echo_params.f90 + lib/sec0.f90 + lib/sec_midn.f90 + lib/setup65.f90 + lib/sh65.f90 + lib/sh65snr.f90 + lib/slasubs.f + lib/sleep_msec.f90 + lib/slope.f90 + lib/smo.f90 + lib/smo121.f90 + lib/softsym.f90 + lib/softsym9f.f90 + lib/softsym9w.f90 + lib/shell.f90 + lib/spec64.f90 + lib/spec9f.f90 + lib/stdmsg.f90 + lib/subtract65.f90 + lib/ft8/subtractft8.f90 + lib/ft4/subtractft4.f90 + lib/sun.f90 + lib/symspec.f90 + lib/symspec2.f90 + lib/symspec65.f90 + lib/sync4.f90 + lib/sync65.f90 + lib/ft4/getcandidates4.f90 + lib/ft4/get_ft4_bitmetrics.f90 + lib/ft8/sync8.f90 + lib/ft8/sync8d.f90 + lib/ft4/sync4d.f90 + lib/sync9.f90 + lib/sync9f.f90 + lib/sync9w.f90 + lib/test_snr.f90 + lib/timf2.f90 + lib/tweak1.f90 + lib/twkfreq.f90 + lib/ft8/twkfreq1.f90 + lib/twkfreq65.f90 + lib/update_recent_calls.f90 + lib/update_msk40_hasharray.f90 + lib/ft8/watterson.f90 + lib/wav11.f90 + lib/wav12.f90 + lib/xcor.f90 + lib/xcor4.f90 + lib/wqdecode.f90 + lib/wqencode.f90 + lib/wspr_downsample.f90 + lib/zplot9.f90 + lib/fst4/decode240_101.f90 + lib/fst4/decode240_74.f90 + lib/fst4/encode240_101.f90 + lib/fst4/encode240_74.f90 + lib/fst4/fst4sim.f90 + lib/fst4/gen_fst4wave.f90 + lib/fst4/genfst4.f90 + lib/fst4/get_fst4_bitmetrics.f90 + lib/fst4/get_fst4_bitmetrics2.f90 + lib/fst4/ldpcsim240_101.f90 + lib/fst4/ldpcsim240_74.f90 + lib/fst4/osd240_101.f90 + lib/fst4/osd240_74.f90 + lib/fst4/fastosd240_74.f90 + lib/fst4/get_crc24.f90 + lib/fst4/fst4_baseline.f90 + lib/77bit/hash22calc.f90 + lib/ft8var/agccft8.f90 + lib/ft8var/baddatavar.f90 + lib/ft8var/bpdecode174_91var.f90 + lib/ft8var/chkfalse8var.f90 + lib/ft8var/chkflscallvar.f90 + lib/ft8var/chkgridvar.f90 + lib/ft8var/chklong8.f90 + lib/ft8var/chkspecial8var.f90 + lib/ft8var/cwfilter.f90 + lib/ft8var/datacor.f90 + lib/ft8var/encode174_91var.f90 + lib/ft8var/extract_callvar.f90 + lib/ft8var/filbigvar.f90 + lib/ft8var/fillhashvar.f90 + lib/ft8var/filtersfreevar.f90 + lib/ft8var/four2avar.f90 + lib/ft8var/ft4_mod1.f90 + lib/ft8var/ft8apsetvar.f90 + lib/ft8var/ft8bvar.f90 + lib/ft8var/ft8_downsamplevar.f90 + lib/ft8var/ft8_mod1.f90 + lib/ft8var/ft8mf1var.f90 + lib/ft8var/ft8mfcqvar.f90 + lib/ft8var/ft8svar.f90 + lib/ft8var/ft8sdvar.f90 + lib/ft8var/ft8sd1var.f90 + lib/ft8var/genft8var.f90 + lib/ft8var/gen_ft8wavevar.f90 + lib/ft8var/genft8sdvar.f90 + lib/ft8var/jt65_mod2var.f90 + lib/ft8var/jt65_mod5.f90 + lib/ft8var/jt65_mod9.f90 + lib/ft8var/msgparservar.f90 + lib/ft8var/osd174_91var.f90 + lib/ft8var/partint.f90 + lib/ft8var/partintft8.f90 + lib/ft8var/rms_augapvar.f90 + lib/ft8var/searchcallsvar.f90 + lib/ft8var/subtractft8var.f90 + lib/ft8var/sync8var.f90 + lib/ft8var/sync8dvar.f90 + lib/ft8var/tone8.f90 + lib/ft8var/tone8myc.f90 + lib/ft8var/tonesdvar.f90 + lib/ft8var/twkfreq1var.f90 + lib/superfox/foxgen2.f90 + lib/superfox/qpc_decode2.f90 + lib/superfox/qpc_likelihoods2.f90 + lib/superfox/qpc_snr.f90 + lib/superfox/qpc_sync.f90 + lib/superfox/sfox_ana.f90 + lib/superfox/sfox_assemble.f90 + lib/superfox/sfox_demod.f90 + lib/superfox/sfox_pack.f90 + lib/superfox/sfox_remove_ft8.f90 + lib/superfox/sfox_remove_tone.f90 + lib/superfox/sfox_unpack.f90 + lib/superfox/sfox_wave.f90 + lib/superfox/sfox_wave_gfsk.f90 + lib/superfox/sfrx_sub.f90 + lib/superfox/sftx_sub.f90 + lib/superfox/twkfreq2.f90 + lib/superfox/sfox_gen_gfsk.f90 + lib/superfox/ran1.f90 + lib/superfox/sfoxsim.f90 + lib/jtty/jtty_decode.f90 + lib/jtty/rjtty_sub.f90 + lib/jtty/jtty_peakup.f90 + lib/jtty/jtty_block_pow.f90 + lib/jtty/ana64a.f90 + lib/jtty/genjtty.f90 + lib/jtty/gen_jttywave.f90 + lib/jtty/gen_syncwave.f90 + lib/jtty/subtract_jtty.f90 + ) + +# temporary workaround for a gfortran v7.3 ICE on Fedora 27 64-bit +set_source_files_properties (lib/slasubs.f PROPERTIES COMPILE_FLAGS -O2) + +set (ka9q_CSRCS + lib/ftrsd/decode_rs.c + lib/ftrsd/encode_rs.c + lib/ftrsd/init_rs.c + ) +set_source_files_properties (${ka9q_CSRCS} PROPERTIES COMPILE_FLAGS -Wno-sign-compare) + +set (qra_CSRCS + lib/qra/qracodes/qra12_63_64_irr_b.c + lib/qra/qracodes/qra13_64_64_irr_e.c + lib/qra/q65/npfwht.c + lib/qra/q65/pdmath.c + lib/qra/q65/qracodes.c + lib/qra/q65/normrnd.c + lib/qra/q65/qra15_65_64_irr_e23.c + lib/qra/q65/q65.c + lib/qra/q65/q65_subs.c + ) + +set (wsjt_CSRCS + ${ka9q_CSRCS} + lib/lookup3.c + lib/ft8var/ft8_tsan.c + lib/ftrsd/ftrsdap.c + lib/sgran.c + lib/golay24_table.c + lib/gran.c + lib/igray.c + lib/init_random_seed.c + lib/ldpc32_table.c + lib/wsprd/nhash.c + lib/tab.c + lib/tmoonsub.c + lib/usleep.c + lib/vit213.c + lib/wisdom.c + lib/wrapkarn.c + ${ldpc_CSRCS} + ${qra_CSRCS} + + lib/superfox/qpc/dbgprintf.c + lib/superfox/qpc/nhash2.c + lib/superfox/qpc/np_qpc.c + lib/superfox/qpc/np_rnd.c + lib/superfox/qpc/qpc_fwht.c + lib/superfox/qpc/qpc_n127k50q128.c + lib/superfox/qpc/qpc_subs.c + + ) + +set (wsjt_qt_UISRCS + wf_palette_design_dialog.ui + widgets/FoxLogWindow.ui + widgets/CabrilloLogWindow.ui + Configuration.ui + ) + +set (wsprsim_CSRCS + lib/lookup3.c + lib/wsprd/wsprsim.c + lib/wsprd/wsprsim_utils.c + lib/wsprd/wsprd_utils.c + lib/wsprd/fano.c + lib/wsprd/tab.c + lib/wsprd/nhash.c + ) + +set (wsprd_CSRCS + lib/lookup3.c + lib/wsprd/wsprd.c + lib/wsprd/wsprsim_utils.c + lib/wsprd/wsprd_utils.c + lib/wsprd/fano.c + lib/wsprd/jelinek.c + lib/wsprd/tab.c + lib/wsprd/nhash.c + lib/init_random_seed.c + lib/wsprd/wsprd_stream.c + ) + +set (wsjtx_UISRCS + widgets/mainwindow.ui + widgets/about.ui + widgets/astro.ui + widgets/colorhighlighting.ui + widgets/echograph.ui + widgets/fastgraph.ui + widgets/messageaveraging.ui + widgets/activeStations.ui + widgets/widegraph.ui + widgets/logqso.ui + widgets/ExportCabrillo.ui + widgets/QSYMessage.ui + widgets/QSYMessageCreator.ui + widgets/qsymonitor.ui + ) + +set (UDP_library_CXXSRCS + Radio.cpp + RadioMetaType.cpp + Network/NetworkMessage.cpp + UDPExamples/MessageServer.cpp + ) + +set (UDP_library_HEADERS + Radio.hpp + UDPExamples/MessageServer.hpp + ${PROJECT_BINARY_DIR}/udp_export.h + ) + +set (message_aggregator_CXXSRCS + UDPExamples/MessageAggregator.cpp + UDPExamples/MessageAggregatorMainWindow.cpp + UDPExamples/DecodesModel.cpp + UDPExamples/BeaconsModel.cpp + UDPExamples/ClientWidget.cpp + validators/MaidenheadLocatorValidator.cpp + ) + +set (message_aggregator_STYLESHEETS + UDPExamples/qss/default.qss + ) + +set (qcp_CXXSRCS + qcustomplot-source/qcustomplot.cpp + ) + +set (all_CXXSRCS + ${wsjt_CXXSRCS} + ${fort_qt_CXXSRCS} + ${wsjt_qt_CXXSRCS} + ${wsjt_qtmm_CXXSRCS} + ${wsjtx_CXXSRCS} + ${qcp_CXXSRCS} + ) + +set (all_C_and_CXXSRCS + ${wsjt_CSRCS} + ${wsprsim_CSRCS} + ${wsprd_CSRCS} + ${all_CXXSRCS} + ) + +set (TOP_LEVEL_RESOURCES + icons/Darwin/wsjtx.iconset/icon_128x128.png + contrib/gpl-v3-logo.svg + artwork/splash.png + ) + +set (WSJTX_DATA_FILES + cty.dat + cty.dat_copyright.txt + grid.dat + sat.dat + contrib/Ephemeris/JPLEPH + eclipse.txt + ALLCALL7.TXT + CALL3.TXT + ) + +set (PALETTE_FILES + Palettes/Banana.pal + Palettes/Blue1.pal + Palettes/Blue2.pal + Palettes/Blue3.pal + Palettes/Brown.pal + Palettes/Cyan1.pal + Palettes/Cyan2.pal + Palettes/Cyan3.pal + Palettes/Default.pal + Palettes/Digipan.pal + Palettes/Fldigi.pal + Palettes/Gray1.pal + Palettes/Gray2.pal + Palettes/Green1.pal + Palettes/Green2.pal + Palettes/Jungle.pal + Palettes/Linrad.pal + Palettes/W9MDB.pal + Palettes/Negative.pal + Palettes/Orange.pal + Palettes/Pink.pal + Palettes/Rainbow.pal + Palettes/Scope.pal + Palettes/Sunburst.pal + Palettes/VK4BDJ.pal + Palettes/YL2KF.pal + Palettes/Yellow1.pal + Palettes/Yellow2.pal + Palettes/ZL1FZ.pal +) + +if (APPLE) + set (WSJTX_ICON_FILE ${CMAKE_PROJECT_NAME}.icns) + set (wsjtx_BUNDLE_DATA_FILES ${WSJTX_DATA_FILES}) + set_source_files_properties (${wsjtx_BUNDLE_DATA_FILES} + PROPERTIES MACOSX_PACKAGE_LOCATION Resources/wsjtx) + set (ICONSRCS + icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_16x16.png + icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_16x16@2x.png + icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_32x32.png + icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_32x32@2x.png + icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_128x128.png + icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_128x128@2x.png + icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_256x256.png + icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_256x256@2x.png + icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_512x512.png + icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_512x512@2x.png + ) + add_custom_command ( + OUTPUT ${WSJTX_ICON_FILE} + COMMAND iconutil -c icns --output "${CMAKE_BINARY_DIR}/${WSJTX_ICON_FILE}" "${CMAKE_SOURCE_DIR}/icons/Darwin/${CMAKE_PROJECT_NAME}.iconset" + DEPENDS ${ICONSRCS} + COMMENT "Building Icons" + ) +else () + set (WSJTX_ICON_FILE icons/windows-icons/wsjtx.ico) +endif (APPLE) + +set_source_files_properties (${WSJTX_ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) + +# suppress intransigent compiler diagnostics +set_source_files_properties (lib/decoder_callbacks.f90 PROPERTIES COMPILE_FLAGS "-Wno-unused-dummy-argument") +set_source_files_properties ( + lib/filbig.f90 + lib/ft8var/filbigvar.f90 + PROPERTIES COMPILE_FLAGS "-Wno-aliasing") + +# foxgen.f90's fname is genuine C++-supplied state (see mainwindow.cpp +# call sites) that the current Fortran implementation doesn't happen to +# reference; removing it would mean touching those call sites too, so we +# suppress the warning here instead, matching lib/decoder_callbacks.f90 above. The +# equivalent qmap/libqmap and map65/libm65 cases are set in those +# subdirectories' own CMakeLists.txt -- set_source_files_properties() is +# scoped to the directory it's called from, so it can't be done from here. +set_source_files_properties (lib/ft8/foxgen.f90 PROPERTIES COMPILE_FLAGS "-Wno-unused-dummy-argument") + +if (NOT WSJT_QDEBUG_IN_RELEASE) + set_property (DIRECTORY APPEND PROPERTY + COMPILE_DEFINITIONS $<$>:QT_NO_DEBUG_OUTPUT> + ) +endif () + +set_property (SOURCE ${all_C_and_CXXSRCS} APPEND_STRING PROPERTY COMPILE_FLAGS " -include wsjtx_config.h") +set_property (SOURCE ${all_C_and_CXXSRCS} APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/wsjtx_config.h) + +if (WIN32) + # generate the OmniRig COM interface source + if (OMNIRIG_TYPE_LIB) + # CI / headless build: type library path provided directly. Bypasses + # COM registration which is not available in CI. Pass via + # -DOMNIRIG_TYPE_LIB=. + file (TO_CMAKE_PATH "${OMNIRIG_TYPE_LIB}" AXSERVERSRCS) + message (STATUS "Using OmniRig type library: ${AXSERVERSRCS}") + else () + # Normal local build: query the COM registry for the type library. + find_program (DUMPCPP NAMES dumpcpp-qt5 dumpcpp) + if (NOT DUMPCPP) + message (FATAL_ERROR "dumpcpp tool not found") + endif () + execute_process ( + COMMAND ${DUMPCPP} -getfile {4FE359C5-A58F-459D-BE95-CA559FB4F270} + OUTPUT_VARIABLE AXSERVER + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + string (STRIP "${AXSERVER}" AXSERVER) + if (NOT AXSERVER) + message (FATAL_ERROR "You need to install OmniRig on this computer, or pass -DOMNIRIG_TYPE_LIB=") + endif (NOT AXSERVER) + string (REPLACE "\"" "" AXSERVER ${AXSERVER}) + file (TO_CMAKE_PATH ${AXSERVER} AXSERVERSRCS) + endif () +endif () diff --git a/CMake/Utils.cmake b/CMake/Utils.cmake new file mode 100644 index 00000000..7b3b0fa8 --- /dev/null +++ b/CMake/Utils.cmake @@ -0,0 +1,185 @@ +# +# Simulator / code-demonstrator executables (WSJT_BUILD_UTILS) -- +# included from the top-level CMakeLists.txt at the equivalent point. +# Included (not add_subdirectory'd), so CMAKE_CURRENT_SOURCE_DIR stays +# the project root; relies on wsjt_link_common_fortran() and +# wsjt_add_simulator_usage_test(), both defined earlier in the +# top-level file. +# + +# The Linux live-audio smoke tests synthesize their fixture at test time. Keep +# this one generator in the build graph even in lean CI configurations where +# the rest of the simulator utilities are disabled. +set (wsjt_jtty_live_audio_tests FALSE) +if (WSJT_ENABLE_TESTS AND WSJT_BUILD_FORTRAN_OPENMP + AND CMAKE_SYSTEM_NAME STREQUAL "Linux" + AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64)$") + set (wsjt_jtty_live_audio_tests TRUE) +endif () + +if (WSJT_BUILD_UTILS OR wsjt_jtty_live_audio_tests) + add_executable (sjtty lib/jtty/sjtty.f90) + wsjt_link_common_fortran (sjtty) +endif () + +if(WSJT_BUILD_UTILS) + +add_executable (jt4sim lib/jt4sim.f90) +wsjt_link_common_fortran (jt4sim) + +add_executable (jt65sim lib/jt65sim.f90) +wsjt_link_common_fortran (jt65sim) + +add_executable (sjtty_qrm lib/jtty/sjtty_qrm.f90) +wsjt_link_common_fortran (sjtty_qrm) + +add_executable (rjtty lib/jtty/rjtty.f90) +wsjt_link_common_fortran (rjtty) + +add_executable (sumsim lib/sumsim.f90) +wsjt_link_common_fortran (sumsim) + +add_executable (cablog lib/cablog.f90) +target_link_libraries (cablog) + +add_executable (test_snr lib/test_snr.f90) +wsjt_link_common_fortran (test_snr) + +add_executable (q65sim lib/qra/q65/q65sim.f90) +wsjt_link_common_fortran (q65sim) +wsjt_add_simulator_usage_test (q65sim "Usage:[ ]+q65sim") + +add_executable (EchoCallSim lib/EchoCallSim.f90) +wsjt_link_common_fortran (EchoCallSim) +wsjt_add_simulator_usage_test (EchoCallSim "Usage:[ ]+EchoCallSim") + +add_executable (testEchoCall lib/testEchoCall.f90) +wsjt_link_common_fortran (testEchoCall) +if (WSJT_ENABLE_TESTS) + add_test ( + NAME test_echocall_filename + COMMAND ${CMAKE_COMMAND} + -DECHOCALLSIM=$ + -DTESTECHOCALL=$ + -DTEST_DIR=${CMAKE_CURRENT_BINARY_DIR}/test_echocall_filename + -P ${CMAKE_SOURCE_DIR}/tests/unit/echo/test_echocall_input.cmake + ) + set_tests_properties (test_echocall_filename PROPERTIES TIMEOUT 30) +endif () + +add_executable (cwsim lib/cwsim.f90) +wsjt_link_common_fortran (cwsim) + +add_executable (q65code lib/qra/q65/q65code.f90) +wsjt_link_common_fortran (q65code) +add_test ( + NAME test_q65code + COMMAND ${CMAKE_COMMAND} + -DQ65CODE=$ + -P ${CMAKE_SOURCE_DIR}/tests/unit/q65/test_q65code.cmake +) + +add_executable (test_q65 lib/test_q65.f90) +wsjt_link_common_fortran (test_q65) + +add_executable (q65_ftn_test lib/qra/q65/q65_ftn_test.f90) +wsjt_link_common_fortran (q65_ftn_test) + +add_executable (jt49sim lib/jt49sim.f90) +wsjt_link_common_fortran (jt49sim) + +#add_executable (allsim lib/allsim.f90) +#target_link_libraries (allsim wsjt_fort wsjt_cxx) + +add_executable (rtty_spec lib/rtty_spec.f90) +wsjt_link_common_fortran (rtty_spec) + +add_executable (jt65code lib/jt65code.f90) +wsjt_link_common_fortran (jt65code) + +add_executable (jt9code lib/jt9code.f90) +wsjt_link_common_fortran (jt9code) + +add_executable (wsprcode + lib/wsprcode/wsprcode.f90 + lib/wsprcode/nhash.c + lib/lookup3.c) +wsjt_link_common_fortran (wsprcode) + +add_executable (encode77 lib/77bit/encode77.f90) +wsjt_link_common_fortran (encode77) +add_test ( + NAME test_encode77 + COMMAND ${CMAKE_COMMAND} + -DENCODE77=$ + -DINPUT_DIR=${CMAKE_SOURCE_DIR}/tests/unit/packjt77 + -DINPUT_FILE=encode77_test_messages.txt + -P ${CMAKE_SOURCE_DIR}/tests/unit/packjt77/test_encode77.cmake +) + +add_executable (hash22calc lib/77bit/hash22calc.f90) +wsjt_link_common_fortran (hash22calc) + +add_executable (wsprsim ${wsprsim_CSRCS}) +target_link_libraries (wsprsim ${LIBM_LIBRARIES}) + +add_executable (jt4code lib/jt4code.f90) +wsjt_link_common_fortran (jt4code) + +add_executable (msk144code lib/msk144code.f90) +wsjt_link_common_fortran (msk144code) + +add_executable (ft8code lib/ft8/ft8code.f90) +wsjt_link_common_fortran (ft8code) + +add_executable (ft4code lib/ft4/ft4code.f90) +wsjt_link_common_fortran (ft4code) + +add_executable (echosim lib/echosim.f90) +wsjt_link_common_fortran (echosim) +wsjt_add_simulator_usage_test (echosim "Usage 1:[ ]+echosim") + +add_executable (sfoxsim lib/superfox/sfoxsim.f90) +wsjt_link_common_fortran (sfoxsim) + +add_executable (sfrx lib/superfox/sfrx.f90) +wsjt_link_common_fortran (sfrx) + +add_executable (sftx lib/superfox/sftx.f90) +wsjt_link_common_fortran (sftx) + +add_executable (msk144sim lib/msk144sim.f90) +wsjt_link_common_fortran (msk144sim) + +add_executable (ft4sim lib/ft4/ft4sim.f90) +wsjt_link_common_fortran (ft4sim) + +add_executable (ft4sim_mult lib/ft4/ft4sim_mult.f90) +wsjt_link_common_fortran (ft4sim_mult) + +add_executable (fst4sim lib/fst4/fst4sim.f90) +wsjt_link_common_fortran (fst4sim) +wsjt_add_simulator_usage_test (fst4sim "Usage:[ ]+fst4sim") +if (WIN32) + set_target_properties (fst4sim PROPERTIES + LINK_FLAGS -Wl,--stack,0x4000000,--heap,0x6000000 + ) +endif () + +add_executable (ldpcsim240_101 lib/fst4/ldpcsim240_101.f90) +wsjt_link_common_fortran (ldpcsim240_101) +add_test ( + NAME test_pack77_cli_fallbacks + COMMAND ${CMAKE_COMMAND} + -DFT4CODE=$ + -DFT4SIM=$ + -DFST4SIM=$ + -DLDPCSIM240_101=$ + -DMSK144CODE=$ + -P ${CMAKE_SOURCE_DIR}/tests/unit/packjt77/test_pack77_cli_fallbacks.cmake +) + +add_executable (ldpcsim240_74 lib/fst4/ldpcsim240_74.f90) +wsjt_link_common_fortran (ldpcsim240_74) + +endif(WSJT_BUILD_UTILS) diff --git a/CMake/getsvn.cmake b/CMake/getsvn.cmake index 92b5b415..d6af3312 100644 --- a/CMake/getsvn.cmake +++ b/CMake/getsvn.cmake @@ -65,7 +65,7 @@ elseif (EXISTS "${SOURCE_DIR}/.git") message (STATUS "Source tree based on revision ${GIT_REFSPEC} ${SCS_VERSION} appears to have local changes") file (APPEND ${__scs_header_file} "#define SCS_VERSION_IS_DIRTY 1\n") set (SCS_VERSION_STR "${SCS_VERSION}-dirty") - execute_process (COMMAND ${GIT_EXECUTABLE} --git-dir=${SOURCE_DIR}/.git --work-tree=${SOURCE_DIR} status + execute_process (COMMAND ${GIT_EXECUTABLE} -C ${SOURCE_DIR} status ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) else () @@ -74,7 +74,13 @@ elseif (EXISTS "${SOURCE_DIR}/.git") message (STATUS "refspec: ${GIT_REFSPEC} - SHA1: ${SCS_VERSION}") endif () else() - message (STATUS "No SCS found") + if (SOURCE_REVISION) + string (SUBSTRING "${SOURCE_REVISION}" 0 6 SCS_VERSION) + set (SCS_VERSION_STR "${SCS_VERSION}") + message (STATUS "Using archived source revision ${SCS_VERSION}") + else () + message (STATUS "No SCS found") + endif () endif () file (APPEND ${__scs_header_file} "#define SCS_VERSION ${SCS_VERSION}\n") file (APPEND ${__scs_header_file} "#define SCS_VERSION_STR \"${SCS_VERSION_STR}\"\n") diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index eceae4ed..cf49f974 100644 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -30,14 +30,14 @@ if (CPACK_GENERATOR MATCHES "NSIS") set (CPACK_PACKAGE_ICON "@PROJECT_SOURCE_DIR@/icons/windows-icons\\installer_logo.bmp") # tell cpack to create links to the doc files set (CPACK_NSIS_MENU_LINKS - "@PROJECT_MANUAL_DIRECTORY_URL@/@PROJECT_MANUAL@" "@PROJECT_NAME@ Documentation" + "@PROJECT_ONLINE_MANUAL_URL@" "@PROJECT_NAME@ Documentation" "@PROJECT_HOMEPAGE@" "@PROJECT_NAME@ Web Site" ) # Use the icon from wsjtx for add-remove programs set (CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\wsjtx.exe") set (CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}") - set (CPACK_NSIS_HELP_LINK "@PROJECT_MANUAL_DIRECTORY_URL@/@PROJECT_MANUAL@") + set (CPACK_NSIS_HELP_LINK "@PROJECT_ONLINE_MANUAL_URL@") set (CPACK_NSIS_URL_INFO_ABOUT "@PROJECT_HOMEPAGE@") set (CPACK_NSIS_CONTACT "${CPACK_PACKAGE_CONTACT}") set (CPACK_NSIS_MUI_FINISHPAGE_RUN "wsjtx.exe") diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b725654..9279ee95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.7.2 FATAL_ERROR) +cmake_minimum_required (VERSION 3.12 FATAL_ERROR) if (APPLE) # @@ -10,6 +10,15 @@ if (APPLE) # # otool -l | grep -A3 LC_VERSION_MIN_MACOSX # + if (NOT CMAKE_OSX_SYSROOT) + execute_process (COMMAND xcrun --show-sdk-path + OUTPUT_VARIABLE _SDK_PATH + OUTPUT_STRIP_TRAILING_WHITESPACE) + set (CMAKE_OSX_SYSROOT ${_SDK_PATH} CACHE STRING "Path to macOS SDK") + endif () + + # CI and release builds pass this explicitly. For local macOS builds, choose + # the default deployment target from the target architecture. if (NOT CMAKE_OSX_DEPLOYMENT_TARGET) if (DEFINED ENV{MACOSX_DEPLOYMENT_TARGET} AND NOT "$ENV{MACOSX_DEPLOYMENT_TARGET}" STREQUAL "") set (_WSJTX_MACOS_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}") @@ -31,8 +40,14 @@ if (APPLE) set (CMAKE_OSX_DEPLOYMENT_TARGET "${_WSJTX_MACOS_DEPLOYMENT_TARGET}" CACHE STRING "Earliest macOS version supported by the target architecture") endif () + + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-headerpad_max_install_names") endif (APPLE) +if(APPLE) + add_compile_definitions(FORTRAN_APPLE) +endif() + # # CMake policies # @@ -60,13 +75,32 @@ if (POLICY CMP0075) cmake_policy (SET CMP0075 NEW) # honour CMAKE_REQUIRED_LIBRARIES in config checks endif () +include ("${CMAKE_CURRENT_LIST_DIR}/CMake/Modules/read_release_state.cmake") +wsjt_read_release_state ( + "${CMAKE_CURRENT_LIST_DIR}/release-state.txt" + WSJT_SOURCE_VERSION + WSJT_SOURCE_RELEASE_CHANNEL + WSJT_SOURCE_RC_NUMBER + WSJT_ARCHIVE_SOURCE_REVISION) + project (wsjtx - VERSION 3.0.2.0 + VERSION ${WSJT_SOURCE_VERSION}.0 LANGUAGES C CXX Fortran ) + +set (CMAKE_CXX_STANDARD 17) +set (CMAKE_CXX_STANDARD_REQUIRED ON) +set (CMAKE_CXX_EXTENSIONS ON) + set (PROJECT_DESCRIPTION "WSJT-X: Digital Modes for Weak Signal Communications in Amateur Radio") set (CMAKE_PROJECT_DESCRIPTION ${PROJECT_DESCRIPTION}) -set (CMAKE_AUTOUIC ON) +set (CMAKE_AUTOMOC OFF) +set (CMAKE_AUTOUIC OFF) +set (CMAKE_AUTORCC OFF) + +function (wsjt_enable_qt_automoc target) + set_target_properties (${target} PROPERTIES AUTOMOC ON) +endfunction () # Align windres with the active MinGW gcc to prevent MSYS path mangling if(MINGW) @@ -107,7 +141,8 @@ message (STATUS "Building for for: ${CMAKE_SYSTEM_NAME}-${PROJECT_ARCHITECTURE}" message (STATUS "******************************************************") include (set_build_type) -# Default is a development build; release jobs pass RC or GA explicitly. +wsjt_set_source_default_cache (WSJT_RELEASE_CHANNEL "${WSJT_SOURCE_RELEASE_CHANNEL}" "Build release channel: DEVEL, RC, or GA.") +wsjt_set_source_default_cache (WSJT_RC_NUMBER "${WSJT_SOURCE_RC_NUMBER}" "Release candidate number used when WSJT_RELEASE_CHANNEL is RC.") set_build_type () set (wsjtx_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${BUILD_TYPE_REVISION}") @@ -116,11 +151,11 @@ set (wsjtx_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_ # set (PROJECT_BUNDLE_NAME "WSJT-X") set (PROJECT_VENDOR "WSJT Development Group") -set (PROJECT_CONTACT "joe@princetion.edu") +set (PROJECT_CONTACT "jtaylor@princeton.edu") set (PROJECT_COPYRIGHT "Copyright (C) 2001-2026 by Joe Taylor, K1JT") -set (PROJECT_HOMEPAGE https://wsjt.sourceforge.io/wsjtx.html) +set (PROJECT_HOMEPAGE https://wsjtx.github.io/wsjtx/) set (PROJECT_MANUAL wsjtx-main) -set (PROJECT_MANUAL_DIRECTORY_URL https://wsjt.sourceforge.io/wsjtx-doc/) +set (PROJECT_ONLINE_MANUAL_URL https://wsjtx.github.io/wsjtx/guide-full.html) set (PROJECT_SAMPLES_URL http://downloads.sourceforge.net/project/wsjt/) set (PROJECT_SAMPLES_UPLOAD_DEST frs.sourceforge.net:/home/frs/project/wsjt/) @@ -150,7 +185,16 @@ include (CMakeDependentOption) OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) # Set the LIB_TYPE variable to STATIC SET (LIB_TYPE STATIC) -set (WSJT_SOURCE_REVISION "" CACHE STRING "Source revision associated with this build") +wsjt_set_source_default_cache (WSJT_SOURCE_REVISION "${WSJT_ARCHIVE_SOURCE_REVISION}" "Source revision associated with this build") +if (WSJT_SOURCE_REVISION) + string (LENGTH "${WSJT_SOURCE_REVISION}" _WSJT_SOURCE_REVISION_LENGTH) + if (NOT WSJT_SOURCE_REVISION MATCHES "^[0-9a-fA-F]+$" + OR (NOT _WSJT_SOURCE_REVISION_LENGTH EQUAL 40 + AND NOT _WSJT_SOURCE_REVISION_LENGTH EQUAL 64)) + message (FATAL_ERROR "WSJT_SOURCE_REVISION must be a full Git object ID") + endif () + string (TOLOWER "${WSJT_SOURCE_REVISION}" WSJT_SOURCE_REVISION) +endif () if (BUILD_SHARED_LIBS) # User wants to build Dynamic Libraries, so change the LIB_TYPE variable to CMake keyword 'SHARED' set (LIB_TYPE SHARED) @@ -168,10 +212,21 @@ option (WSJT_GENERATE_DOCS "Generate documentation files." ON) option (WSJT_RIG_NONE_CAN_SPLIT "Allow split operation with \"None\" as rig.") option (WSJT_TRACE_UDP "Debugging option that turns on UDP message protocol diagnostics.") option (WSJT_BUILD_UTILS "Build simulators and code demonstrators." ON) -option (WSJT_BUILD_TESTS "Build test programs." ON) option (WSJT_FOX_OTP "Enable Fox OTP Verification Messages." ON) option (WSJT_SKIP_BUNDLE_FIXUP "Skip install-time bundle dependency fixup." OFF) -option (WSJT_SKIP_MAP65 "Skip building MAP65 EME decoder (legacy Fortran; fails on GCC 15)." OFF) +option (WSJT_MACOS_INSTALL_TIME_FIXUP + "Run legacy install-time BundleUtilities fixup for macOS bundles." OFF) +option (WSJT_SKIP_QMAP "Skip building QMAP." OFF) +option (WSJT_ENABLE_TESTS "Enable developer tests." ON) +option (WSJT_ENABLE_GUI_SMOKE_TESTS + "Register GUI-driven smoke tests with CTest." OFF) +option (WSJT_ENABLE_ASAN_UBSAN "Instrument in-tree code with AddressSanitizer and UndefinedBehaviorSanitizer." OFF) +option (WSJT_ENABLE_TSAN "Instrument in-tree code with ThreadSanitizer." OFF) +option (WSJT_BUILD_JT9STREAM "Build the Qt-free streaming decoder jt9stream alongside jt9 (uses the jt9a stub, never links fort_qt)." ON) +set (WSJT_FORTRAN_LIBRARY_VARIANTS "AUTO" CACHE STRING + "Fortran library variants to build: AUTO, BOTH, OPENMP_ONLY, or NON_OPENMP_ONLY.") +set_property (CACHE WSJT_FORTRAN_LIBRARY_VARIANTS PROPERTY STRINGS + AUTO BOTH OPENMP_ONLY NON_OPENMP_ONLY) CMAKE_DEPENDENT_OPTION (WSJT_QDEBUG_IN_RELEASE "Leave Qt debugging statements in Release configuration." OFF "NOT is_debug_build" OFF) CMAKE_DEPENDENT_OPTION (WSJT_ENABLE_EXPERIMENTAL_FEATURES "Enable features not fully ready for public releases." ON @@ -195,6 +250,8 @@ endif () include (GNUInstallDirs) +set (WSJT_DATA_DESTINATION "${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME}") + set (PLUGIN_DESTINATION ${CMAKE_INSTALL_LIBDIR}/plugins) set (QT_CONF_DESTINATION ${CMAKE_INSTALL_BINDIR}) if (WIN32) @@ -213,775 +270,38 @@ if (WSJT_FOX_OTP) message (STATUS "Including Fox verification code feature") endif () -# -# Project sources -# -set (fort_qt_CXXSRCS - lib/shmem.cpp - ) - -set (wsjt_qt_CXXSRCS - helper_functions.cpp - qt_helpers.cpp - widgets/MessageBox.cpp - MetaDataRegistry.cpp - Network/NetworkServerLookup.cpp - revision_utils.cpp - L10nLoader.cpp - WFPalette.cpp - Radio.cpp - RadioMetaType.cpp - NonInheritingProcess.cpp - models/IARURegions.cpp - models/Bands.cpp - models/Modes.cpp - models/FrequencyList.cpp - models/StationList.cpp - widgets/FrequencyLineEdit.cpp - widgets/FrequencyDeltaLineEdit.cpp - item_delegates/CandidateKeyFilter.cpp - item_delegates/ForeignKeyDelegate.cpp - item_delegates/MessageItemDelegate.cpp - validators/LiveFrequencyValidator.cpp - GetUserId.cpp - Audio/AudioDevice.cpp - Transceiver/Transceiver.cpp - Transceiver/TransceiverBase.cpp - Transceiver/EmulateSplitTransceiver.cpp - Transceiver/TransceiverFactory.cpp - Transceiver/PollingTransceiver.cpp - Transceiver/HamlibTransceiver.cpp - Transceiver/TCITransceiver.cpp - Transceiver/HRDMessage.cpp - Transceiver/HRDTransceiver.cpp - Transceiver/DXLabSuiteCommanderTransceiver.cpp - Network/NetworkMessage.cpp - Network/MessageClient.cpp - widgets/LettersSpinBox.cpp - widgets/HintedSpinBox.cpp - widgets/RestrictedSpinBox.cpp - widgets/HelpTextWindow.cpp - SampleDownloader.cpp - SampleDownloader/DirectoryDelegate.cpp - SampleDownloader/Directory.cpp - SampleDownloader/FileNode.cpp - SampleDownloader/RemoteFile.cpp - DisplayManual.cpp - MultiSettings.cpp - validators/MaidenheadLocatorValidator.cpp - validators/CallsignValidator.cpp - widgets/SplashScreen.cpp - EqualizationToolsDialog.cpp - widgets/DoubleClickablePushButton.cpp - widgets/DoubleClickableRadioButton.cpp - mycustomspinbox.cpp - Network/LotWUsers.cpp - Network/FileDownload.cpp - Network/FoxVerifier.cpp - Network/Cloudlog.cpp - Network/eqsl.cpp - models/DecodeHighlightingModel.cpp - widgets/DecodeHighlightingListView.cpp - models/FoxLog.cpp - widgets/AbstractLogWindow.cpp - widgets/FoxLogWindow.cpp - widgets/CabrilloLogWindow.cpp - item_delegates/CallsignDelegate.cpp - item_delegates/MaidenheadLocatorDelegate.cpp - item_delegates/FrequencyDelegate.cpp - item_delegates/FrequencyDeltaDelegate.cpp - item_delegates/SQLiteDateTimeDelegate.cpp - models/CabrilloLog.cpp - logbook/AD1CCty.cpp - logbook/WorkedBefore.cpp - logbook/Multiplier.cpp - Network/NetworkAccessManager.cpp - widgets/LazyFillComboBox.cpp - widgets/CheckableItemComboBox.cpp - widgets/BandComboBox.cpp - otpgenerator.cpp - ) - -set (wsjt_qtmm_CXXSRCS - Audio/BWFFile.cpp - ) - -set (jt9_FSRCS - lib/jt9.f90 - lib/jt9a.f90 - ) - -set (wsjtx_CXXSRCS - WSJTXLogging.cpp - logbook/logbook.cpp - Network/PSKReporter.cpp - Network/PSKReporterConfiguration.cpp - Network/PSKReporterIPFIX.cpp - Modulator/Modulator.cpp - Detector/Detector.cpp - widgets/logqso.cpp - widgets/displaytext.cpp - Decoder/decodedtext.cpp - getfile.cpp - Audio/soundout.cpp - Audio/soundin.cpp - widgets/meterwidget.cpp - widgets/signalmeter.cpp - widgets/plotter.cpp - widgets/widegraph.cpp - widgets/echograph.cpp - widgets/echoplot.cpp - widgets/fastgraph.cpp - widgets/fastplot.cpp - widgets/about.cpp - widgets/astro.cpp - widgets/messageaveraging.cpp - widgets/activeStations.cpp - widgets/colorhighlighting.cpp - WSPR/WsprTxScheduler.cpp - widgets/mainwindow.cpp - Configuration.cpp - main.cpp - Network/wsprnet.cpp - WSPR/WSPRBandHopping.cpp - widgets/ExportCabrillo.cpp - widgets/QSYMessage.cpp - widgets/QSYMessageCreator.cpp - widgets/qsymonitor.cpp - ) - -if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") - set_source_files_properties ( - widgets/plotter.cpp - widgets/mainwindow.cpp - PROPERTIES COMPILE_FLAGS "-Wno-vla-extension") -endif () - -set (wsjt_CXXSRCS - Logger.cpp - lib/crc10.cpp - lib/crc13.cpp - lib/crc14.cpp - ${wsjt_fox_CXXSRCS} - ) -# deal with a GCC v6 UB error message -set_source_files_properties ( - lib/crc10.cpp - lib/crc13.cpp - lib/crc14.cpp - PROPERTIES COMPILE_FLAGS -fpermissive) - -if (WIN32) - set (wsjt_CXXSRCS - ${wsjt_CXXSRCS} - killbyname.cpp - ) - - set (wsjt_qt_CXXSRCS - ${wsjt_qt_CXXSRCS} - Transceiver/OmniRigTransceiver.cpp - ) -endif (WIN32) - -set (wsjt_FSRCS - # put module sources first in the hope that they get rebuilt before use - lib/types.f90 - lib/C_interface_module.f90 - lib/shmem.f90 - lib/crc.f90 - lib/fftw3mod.f90 - lib/hashing.f90 - lib/iso_c_utilities.f90 - lib/jt4.f90 - lib/jt4_decode.f90 - lib/jt65_decode.f90 - lib/jt65_mod.f90 - lib/jt65_mod6.f90 #ft8md - lib/ft8_decode.f90 - lib/ft4_decode.f90 - lib/fst4_decode.f90 - lib/get_q3list.f90 - lib/jt9_decode.f90 - lib/options.f90 - lib/packjt.f90 - lib/77bit/packjt77.f90 - lib/qra/q65/q65.f90 - lib/q65_decode.f90 - lib/readwav.f90 - lib/timer_C_wrapper.f90 - lib/timer_impl.f90 - lib/timer_module.f90 - lib/wavhdr.f90 - lib/qra/q65/q65_encoding_modules.f90 - lib/ft8/ft8_a7.f90 - lib/ft8/ft8_a8d.f90 - lib/superfox/sfox_mod.f90 - lib/superfox/julian.f90 - lib/superfox/popen_module.f90 - lib/superfox/qpc/qpc_mod.f90 - lib/ft8var/ft8_decodevar.f90 - - # remaining non-module sources - lib/addit.f90 - lib/afc65b.f90 - lib/afc9.f90 - lib/ana64.f90 - lib/ana932.f90 - lib/analytic.f90 - lib/astro.f90 - lib/astrosub.f90 - lib/astro0.f90 - lib/avecho.f90 - lib/averms.f90 - lib/azdist.f90 - lib/ft8/baseline.f90 - lib/ft4/ft4_baseline.f90 - lib/blanker.f90 - lib/bpdecode40.f90 - lib/bpdecode128_90.f90 - lib/ft8/bpdecode174_91.f90 - lib/baddata.f90 - lib/cablog.f90 - lib/calibrate.f90 - lib/ccf2.f90 - lib/ccf65.f90 - lib/ft8/chkcrc13a.f90 - lib/ft8/chkcrc14a.f90 - lib/chkcall.f90 - lib/chkhist.f90 - lib/chkmsg.f90 - lib/chkss2.f90 - lib/ft4/clockit.f90 - lib/ft8/compress.f90 - lib/coord.f90 - lib/db.f90 - lib/decode4.f90 - lib/decode65a.f90 - lib/decode65b.f90 - lib/decode9w.f90 - lib/decode_echo.f90 - lib/ft8/decode174_91.f90 - lib/decoder.f90 - lib/env_module.f90 - lib/deep4.f90 - lib/deg2grid.f90 - lib/degrade_snr.f90 - lib/demod64a.f90 - lib/determ.f90 - lib/downsam9.f90 - lib/echosim.f90 - lib/echo_snr.f90 - lib/encode232.f90 - lib/encode4.f90 - lib/encode_msk40.f90 - lib/encode_128_90.f90 - lib/ft8/encode174_91.f90 - lib/ft8/encode174_91_nocrc.f90 - lib/entail.f90 - lib/ephem.f90 - lib/extract.f90 - lib/extract4.f90 - lib/extractmessage77.f90 - lib/fano232.f90 - lib/fast9.f90 - lib/fast_decode.f90 - lib/fchisq.f90 - lib/fchisq0.f90 - lib/fchisq65.f90 - lib/fil3.f90 - lib/fil3c.f90 - lib/fil4.f90 - lib/fil6521.f90 - lib/filbig.f90 - lib/ft8/filt8.f90 - lib/fitcal.f90 - lib/flat1.f90 - lib/flat1a.f90 - lib/flat1b.f90 - lib/flat2.f90 - lib/flat4.f90 - lib/flat65.f90 - lib/fmtmsg.f90 - lib/foldspec9f.f90 - lib/four2a.f90 - lib/fspread_lorentz.f90 - lib/ft8/foxfilt.f90 - lib/ft8/foxgen.f90 -# lib/ft8/foxgen_wrap.f90 - lib/freqcal.f90 - lib/ft8/ft8apset.f90 - lib/ft8/ft8b.f90 - lib/ft8/ft8code.f90 - lib/ft8/ft8_downsample.f90 - lib/ft8/ft8sim.f90 - lib/gen4.f90 - lib/gen65.f90 - lib/gen9.f90 - lib/gen_cw_wave.f90 - lib/gen_echocall.f90 - lib/genwave.f90 - lib/ft8/genft8.f90 - lib/qra/q65/genq65.f90 - lib/genmsk_128_90.f90 - lib/genmsk40.f90 - lib/ft4/ft4code.f90 - lib/ft4/genft4.f90 - lib/ft4/gen_ft4wave.f90 - lib/ft8/gen_ft8wave.f90 - lib/ft8/genft8refsig.f90 - lib/genwspr.f90 - lib/geodist.f90 - lib/ft8/get_crc14.f90 - lib/getlags.f90 - lib/getmet4.f90 - lib/ft8/get_spectrum_baseline.f90 - lib/ft2/gfsk_pulse.f90 - lib/graycode.f90 - lib/graycode65.f90 - lib/grayline.f90 - lib/grid2deg.f90 - lib/ft8/h1.f90 - lib/hash.f90 - lib/hint65.f90 - lib/hspec.f90 - lib/indexx.f90 - lib/init_random_seed.f90 - lib/interleave4.f90 - lib/interleave63.f90 - lib/interleave9.f90 - lib/inter_wspr.f90 - lib/jplsubs.f - lib/jt9fano.f90 - lib/libration.f90 - lib/lorentzian.f90 - lib/fst4/lorentzian_fading.f90 - lib/lpf1.f90 - lib/map65_mmdec.f90 - lib/mixlpf.f90 - lib/makepings.f90 - lib/moondopjpl.f90 - lib/morse.f90 - lib/move.f90 - lib/msk40decodeframe.f90 - lib/msk144decodeframe.f90 - lib/msk40spd.f90 - lib/msk144spd.f90 - lib/msk40sync.f90 - lib/msk144sync.f90 - lib/msk40_freq_search.f90 - lib/msk144_freq_search.f90 - lib/mskrtd.f90 - lib/msk144signalquality.f90 - lib/msk144sim.f90 - lib/mskrtd.f90 - lib/nuttal_window.f90 - lib/decode_msk144.f90 - lib/ft4/ft4sim.f90 - lib/ft4/ft4sim_mult.f90 - lib/ft4/ft4_downsample.f90 - lib/77bit/my_hash.f90 - lib/wsprd/osdwspr.f90 - lib/ft8/osd174_91.f90 - lib/osd128_90.f90 - lib/pctile.f90 - lib/peakdt9.f90 - lib/peakup.f90 - lib/plotsave.f90 - lib/platanh.f90 - lib/pltanh.f90 - lib/polyfit.f90 - lib/prog_args.f90 - lib/ps4.f90 - lib/qra/q65/q65_ap.f90 - lib/qra/q65/q65_loops.f90 - lib/qra/q65/q65_set_list.f90 - lib/qra/q65/q65_set_list2.f90 - lib/refspectrum.f90 - lib/savec2.f90 - lib/save_dxbase.f90 - lib/save_echo_params.f90 - lib/sec0.f90 - lib/sec_midn.f90 - lib/setup65.f90 - lib/sh65.f90 - lib/sh65snr.f90 - lib/slasubs.f - lib/sleep_msec.f90 - lib/slope.f90 - lib/smo.f90 - lib/smo121.f90 - lib/softsym.f90 - lib/softsym9f.f90 - lib/softsym9w.f90 - lib/shell.f90 - lib/spec64.f90 - lib/spec9f.f90 - lib/stdmsg.f90 - lib/subtract65.f90 - lib/ft8/subtractft8.f90 - lib/ft4/subtractft4.f90 - lib/sun.f90 - lib/symspec.f90 - lib/symspec2.f90 - lib/symspec65.f90 - lib/sync4.f90 - lib/sync65.f90 - lib/ft4/getcandidates4.f90 - lib/ft4/get_ft4_bitmetrics.f90 - lib/ft8/sync8.f90 - lib/ft8/sync8d.f90 - lib/ft4/sync4d.f90 - lib/sync9.f90 - lib/sync9f.f90 - lib/sync9w.f90 - lib/test_snr.f90 - lib/timf2.f90 - lib/tweak1.f90 - lib/twkfreq.f90 - lib/ft8/twkfreq1.f90 - lib/twkfreq65.f90 - lib/update_recent_calls.f90 - lib/update_msk40_hasharray.f90 - lib/ft8/watterson.f90 - lib/wav11.f90 - lib/wav12.f90 - lib/xcor.f90 - lib/xcor4.f90 - lib/wqdecode.f90 - lib/wqencode.f90 - lib/wspr_downsample.f90 - lib/zplot9.f90 - lib/fst4/decode240_101.f90 - lib/fst4/decode240_74.f90 - lib/fst4/encode240_101.f90 - lib/fst4/encode240_74.f90 - lib/fst4/fst4sim.f90 - lib/fst4/gen_fst4wave.f90 - lib/fst4/genfst4.f90 - lib/fst4/get_fst4_bitmetrics.f90 - lib/fst4/get_fst4_bitmetrics2.f90 - lib/fst4/ldpcsim240_101.f90 - lib/fst4/ldpcsim240_74.f90 - lib/fst4/osd240_101.f90 - lib/fst4/osd240_74.f90 - lib/fst4/fastosd240_74.f90 - lib/fst4/get_crc24.f90 - lib/fst4/fst4_baseline.f90 - lib/77bit/hash22calc.f90 - lib/ft8var/agccft8.f90 - lib/ft8var/baddatavar.f90 - lib/ft8var/bpdecode174_91var.f90 - lib/ft8var/chkfalse8var.f90 - lib/ft8var/chkflscallvar.f90 - lib/ft8var/chkgridvar.f90 - lib/ft8var/chklong8.f90 - lib/ft8var/chkspecial8var.f90 - lib/ft8var/cwfilter.f90 - lib/ft8var/datacor.f90 - lib/ft8var/encode174_91var.f90 - lib/ft8var/extract_callvar.f90 - lib/ft8var/filbigvar.f90 - lib/ft8var/fillhashvar.f90 - lib/ft8var/filtersfreevar.f90 - lib/ft8var/four2avar.f90 - lib/ft8var/ft4_mod1.f90 - lib/ft8var/ft8apsetvar.f90 - lib/ft8var/ft8bvar.f90 - lib/ft8var/ft8_downsamplevar.f90 - lib/ft8var/ft8_mod1.f90 - lib/ft8var/ft8mf1var.f90 - lib/ft8var/ft8mfcqvar.f90 - lib/ft8var/ft8svar.f90 - lib/ft8var/ft8sdvar.f90 - lib/ft8var/ft8sd1var.f90 - lib/ft8var/genft8var.f90 - lib/ft8var/gen_ft8wavevar.f90 - lib/ft8var/genft8sdvar.f90 - lib/ft8var/jt65_mod2var.f90 - lib/ft8var/jt65_mod5.f90 - lib/ft8var/jt65_mod9.f90 - lib/ft8var/msgparservar.f90 - lib/ft8var/osd174_91var.f90 - lib/ft8var/packjt77sdvar.f90 - lib/ft8var/partint.f90 - lib/ft8var/partintft8.f90 - lib/ft8var/rms_augapvar.f90 - lib/ft8var/searchcallsvar.f90 - lib/ft8var/subtractft8var.f90 - lib/ft8var/sync8var.f90 - lib/ft8var/sync8dvar.f90 - lib/ft8var/tone8.f90 - lib/ft8var/tone8myc.f90 - lib/ft8var/tonesdvar.f90 - lib/ft8var/twkfreq1var.f90 - lib/superfox/foxgen2.f90 - lib/superfox/qpc_decode2.f90 - lib/superfox/qpc_likelihoods2.f90 - lib/superfox/qpc_snr.f90 - lib/superfox/qpc_sync.f90 - lib/superfox/sfox_ana.f90 - lib/superfox/sfox_assemble.f90 - lib/superfox/sfox_demod.f90 - lib/superfox/sfox_pack.f90 - lib/superfox/sfox_remove_ft8.f90 - lib/superfox/sfox_remove_tone.f90 - lib/superfox/sfox_unpack.f90 - lib/superfox/sfox_wave.f90 - lib/superfox/sfox_wave_gfsk.f90 - lib/superfox/sfrx_sub.f90 - lib/superfox/sftx_sub.f90 - lib/superfox/twkfreq2.f90 - lib/superfox/sfox_gen_gfsk.f90 - lib/superfox/ran1.f90 - lib/superfox/sfoxsim.f90 - ) - -# temporary workaround for a gfortran v7.3 ICE on Fedora 27 64-bit -set_source_files_properties (lib/slasubs.f PROPERTIES COMPILE_FLAGS -O2) - -set (ka9q_CSRCS - lib/ftrsd/decode_rs.c - lib/ftrsd/encode_rs.c - lib/ftrsd/init_rs.c - ) -set_source_files_properties (${ka9q_CSRCS} PROPERTIES COMPILE_FLAGS -Wno-sign-compare) - -set (qra_CSRCS - lib/qra/qracodes/qra12_63_64_irr_b.c - lib/qra/qracodes/qra13_64_64_irr_e.c - lib/qra/q65/npfwht.c - lib/qra/q65/pdmath.c - lib/qra/q65/qracodes.c - lib/qra/q65/normrnd.c - lib/qra/q65/qra15_65_64_irr_e23.c - lib/qra/q65/q65.c - lib/qra/q65/q65_subs.c - ) - -set (wsjt_CSRCS - ${ka9q_CSRCS} - lib/ftrsd/ftrsdap.c - lib/sgran.c - lib/golay24_table.c - lib/gran.c - lib/igray.c - lib/init_random_seed.c - lib/ldpc32_table.c - lib/wsprd/nhash.c - lib/tab.c - lib/tmoonsub.c - lib/usleep.c - lib/vit213.c - lib/wisdom.c - lib/wrapkarn.c - ${ldpc_CSRCS} - ${qra_CSRCS} - - lib/superfox/qpc/dbgprintf.c - lib/superfox/qpc/nhash2.c - lib/superfox/qpc/np_qpc.c - lib/superfox/qpc/np_rnd.c - lib/superfox/qpc/qpc_fwht.c - lib/superfox/qpc/qpc_n127k50q128.c - lib/superfox/qpc/qpc_subs.c - - ) - -set (wsjt_qt_UISRCS - wf_palette_design_dialog.ui - widgets/FoxLogWindow.ui - widgets/CabrilloLogWindow.ui - ) - -set (wsprsim_CSRCS - lib/wsprd/wsprsim.c - lib/wsprd/wsprsim_utils.c - lib/wsprd/wsprd_utils.c - lib/wsprd/fano.c - lib/wsprd/tab.c - lib/wsprd/nhash.c - ) - -set (wsprd_CSRCS - lib/wsprd/wsprd.c - lib/wsprd/wsprsim_utils.c - lib/wsprd/wsprd_utils.c - lib/wsprd/fano.c - lib/wsprd/jelinek.c - lib/wsprd/tab.c - lib/wsprd/nhash.c - lib/init_random_seed.c - ) - -set (wsjtx_UISRCS - widgets/mainwindow.ui - widgets/about.ui - widgets/astro.ui - widgets/colorhighlighting.ui - widgets/echograph.ui - widgets/fastgraph.ui - widgets/messageaveraging.ui - widgets/activeStations.ui - widgets/widegraph.ui - widgets/logqso.ui - Configuration.ui - widgets/ExportCabrillo.ui - widgets/QSYMessage.ui - widgets/QSYMessageCreator.ui - widgets/qsymonitor.ui - ) - -set (UDP_library_CXXSRCS - Radio.cpp - RadioMetaType.cpp - Network/NetworkMessage.cpp - UDPExamples/MessageServer.cpp - ) - -set (UDP_library_HEADERS - Radio.hpp - UDPExamples/MessageServer.hpp - ${PROJECT_BINARY_DIR}/udp_export.h - ) - -set (message_aggregator_CXXSRCS - UDPExamples/MessageAggregator.cpp - UDPExamples/MessageAggregatorMainWindow.cpp - UDPExamples/DecodesModel.cpp - UDPExamples/BeaconsModel.cpp - UDPExamples/ClientWidget.cpp - validators/MaidenheadLocatorValidator.cpp - ) - -set (message_aggregator_STYLESHEETS - UDPExamples/qss/default.qss - ) - -set (qcp_CXXSRCS - qcustomplot-source/qcustomplot.cpp - ) - -set (all_CXXSRCS - ${wsjt_CXXSRCS} - ${fort_qt_CXXSRCS} - ${wsjt_qt_CXXSRCS} - ${wsjt_qtmm_CXXSRCS} - ${wsjtx_CXXSRCS} - ${qcp_CXXSRCS} - ) - -set (all_C_and_CXXSRCS - ${wsjt_CSRCS} - ${wsprsim_CSRCS} - ${wsprd_CSRCS} - ${all_CXXSRCS} - ) - -set (TOP_LEVEL_RESOURCES - icons/Darwin/wsjtx.iconset/icon_128x128.png - contrib/gpl-v3-logo.svg - artwork/splash.png - ) - -set (PALETTE_FILES - Palettes/Banana.pal - Palettes/Blue1.pal - Palettes/Blue2.pal - Palettes/Blue3.pal - Palettes/Brown.pal - Palettes/Cyan1.pal - Palettes/Cyan2.pal - Palettes/Cyan3.pal - Palettes/Default.pal - Palettes/Digipan.pal - Palettes/Fldigi.pal - Palettes/Gray1.pal - Palettes/Gray2.pal - Palettes/Green1.pal - Palettes/Green2.pal - Palettes/Jungle.pal - Palettes/Linrad.pal - Palettes/W9MDB.pal - Palettes/Negative.pal - Palettes/Orange.pal - Palettes/Pink.pal - Palettes/Rainbow.pal - Palettes/Scope.pal - Palettes/Sunburst.pal - Palettes/VK4BDJ.pal - Palettes/YL2KF.pal - Palettes/Yellow1.pal - Palettes/Yellow2.pal - Palettes/ZL1FZ.pal -) - -if (APPLE) - set (WSJTX_ICON_FILE ${CMAKE_PROJECT_NAME}.icns) - set (ICONSRCS - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_16x16.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_16x16@2x.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_32x32.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_32x32@2x.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_128x128.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_128x128@2x.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_256x256.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_256x256@2x.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_512x512.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_512x512@2x.png - ) - add_custom_command ( - OUTPUT ${WSJTX_ICON_FILE} - COMMAND iconutil -c icns --output "${CMAKE_BINARY_DIR}/${WSJTX_ICON_FILE}" "${CMAKE_SOURCE_DIR}/icons/Darwin/${CMAKE_PROJECT_NAME}.iconset" - DEPENDS ${ICONSRCS} - COMMENT "Building Icons" - ) -else () - set (WSJTX_ICON_FILE icons/windows-icons/wsjtx.ico) -endif (APPLE) - -set_source_files_properties (${WSJTX_ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - -# suppress intransigent compiler diagnostics -set_source_files_properties (lib/decoder.f90 PROPERTIES COMPILE_FLAGS "-Wno-unused-dummy-argument") -set_source_files_properties (lib/filbig.f90 PROPERTIES COMPILE_FLAGS "-Wno-aliasing") - -## disable Qt trace and warning messages from release configurations -# set_property (DIRECTORY APPEND PROPERTY -# COMPILE_DEFINITIONS $<$>:QT_NO_DEBUG_OUTPUT;QT_NO_WARNING_OUTPUT> -# ) - -set_property (SOURCE ${all_C_and_CXXSRCS} APPEND_STRING PROPERTY COMPILE_FLAGS " -include wsjtx_config.h") -set_property (SOURCE ${all_C_and_CXXSRCS} APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/wsjtx_config.h) - -if (WIN32) - # generate the OmniRig COM interface source - if (OMNIRIG_TYPE_LIB) - # CI / headless build: type library path provided directly. Bypasses - # COM registration which is not available in CI. Pass via - # -DOMNIRIG_TYPE_LIB=. - file (TO_CMAKE_PATH "${OMNIRIG_TYPE_LIB}" AXSERVERSRCS) - message (STATUS "Using OmniRig type library: ${AXSERVERSRCS}") - else () - # Normal local build: query the COM registry for the type library. - find_program (DUMPCPP dumpcpp) - if (DUMPCPP-NOTFOUND) - message (FATAL_ERROR "dumpcpp tool not found") - endif (DUMPCPP-NOTFOUND) - execute_process ( - COMMAND ${DUMPCPP} -getfile {4FE359C5-A58F-459D-BE95-CA559FB4F270} - OUTPUT_VARIABLE AXSERVER - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - string (STRIP "${AXSERVER}" AXSERVER) - if (NOT AXSERVER) - message (FATAL_ERROR "You need to install OmniRig on this computer, or pass -DOMNIRIG_TYPE_LIB=") - endif (NOT AXSERVER) - string (REPLACE "\"" "" AXSERVER ${AXSERVER}) - file (TO_CMAKE_PATH ${AXSERVER} AXSERVERSRCS) - endif () +if (WSJT_ENABLE_TESTS) + enable_testing () + message (STATUS "Including tests") + endif() + +# Fresh build trees have no timing history. Give stable tests taking roughly +# 10 seconds or longer a representative COST so parallel CTest runs start them +# early; relative ordering matters more than an exact duration. + +if (WSJT_ENABLE_TSAN) + # A CTest ENVIRONMENT assignment replaces the inherited TSAN_OPTIONS. Build + # complete per-family suppression files from the cross-cutting baseline so + # scoped tests retain the same TSan controls and classified Hamlib/Boost + # suppressions as the rest of the suite. + set (wsjt_tsan_suppression_directory + "${CMAKE_BINARY_DIR}/tsan-suppressions") + file (MAKE_DIRECTORY "${wsjt_tsan_suppression_directory}") + file (READ "${CMAKE_SOURCE_DIR}/tests/sanitizers/tsan.supp" + wsjt_tsan_base_suppressions) + foreach (wsjt_tsan_scope IN ITEMS fortran network gui) + file (READ + "${CMAKE_SOURCE_DIR}/tests/sanitizers/tsan-${wsjt_tsan_scope}.supp" + wsjt_tsan_scope_suppressions) + file (GENERATE + OUTPUT "${wsjt_tsan_suppression_directory}/tsan-${wsjt_tsan_scope}.supp" + CONTENT "${wsjt_tsan_base_suppressions}\n${wsjt_tsan_scope_suppressions}") + set (wsjt_tsan_${wsjt_tsan_scope}_options + "halt_on_error=0:second_deadlock_stack=1:suppressions=${wsjt_tsan_suppression_directory}/tsan-${wsjt_tsan_scope}.supp") + endforeach () endif () - +include (CMake/Sources.cmake) # # decide on platform specifc packing and fixing up # @@ -998,291 +318,8 @@ if (APPLE) endif (APPLE) -# -# find some useful tools -# -include (CheckTypeSize) -include (CheckCSourceCompiles) -include (CheckIncludeFiles) -include (CheckSymbolExists) -include (generate_version_info) - -find_program(CTAGS ctags) -find_program(ETAGS etags) - -# -# Platform checks -# -check_include_files ("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS) -check_include_files (stdio.h HAVE_STDIO_H) -check_include_files (stdlib.h HAVE_STDLIB_H) -check_include_files (unistd.h HAVE_UNISTD_H) -check_include_files (sys/ioctl.h HAVE_SYS_IOCTL_H) -check_include_files (sys/types.h HAVE_SYS_TYPES_H) -check_include_files (fcntl.h HAVE_FCNTL_H) -check_include_files (sys/stat.h HAVE_SYS_STAT_H) -check_include_files ("linux/ppdev.h;linux/parport.h" HAVE_LINUX_PPDEV_H) -check_include_files ("dev/ppbus/ppi.h;dev/ppbus/ppbconf.h" HAVE_DEV_PPBUS_PPI_H) - -# -# Standard C Math Library -# -set (LIBM_TEST_SOURCE "#include\nfloat f; int main(){sqrt(f);return 0;}") -check_c_source_compiles ("${LIBM_TEST_SOURCE}" HAVE_MATH) -if (HAVE_MATH) - set (LIBM_LIBRARIES) -else () - set (CMAKE_REQUIRED_LIBRARIES m) - check_c_source_compiles ("${LIBM_TEST_SOURCE}" HAVE_LIBM_MATH) - unset (CMAKE_REQUIRED_LIBRARIES) - if (NOT HAVE_LIBM_MATH) - message (FATAL_ERROR "Unable to use C math library functions") - endif () - set (LIBM_LIBRARIES m) -endif () - -# -# Boost -# -if (WIN32) - set (Boost_USE_STATIC_LIBS OFF) -endif () -find_package (Boost 1.62 REQUIRED COMPONENTS log_setup log) - -# -# OpenMP -# -find_package (OpenMP) - -if (APPLE) - set (WSJT_MACOS_LIBGOMP_LIBRARY "" CACHE FILEPATH "Path to the static GNU OpenMP runtime archive") - if (NOT WSJT_MACOS_LIBGOMP_LIBRARY) - execute_process ( - COMMAND ${CMAKE_Fortran_COMPILER} -print-file-name=libgomp.a - OUTPUT_VARIABLE WSJT_MACOS_LIBGOMP_LIBRARY - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET - ) - endif () - if (NOT WSJT_MACOS_LIBGOMP_LIBRARY OR NOT EXISTS "${WSJT_MACOS_LIBGOMP_LIBRARY}") - message (FATAL_ERROR "Static GNU OpenMP runtime archive not found. Install a GNU Fortran/OpenMP runtime that provides libgomp.a, or set WSJT_MACOS_LIBGOMP_LIBRARY to the archive path. Deployable macOS builds intentionally link libgomp statically instead of bundling a package-manager libgomp dylib.") - endif () -endif () - -# -# fftw3 single precision library -# -find_package (FFTW3 COMPONENTS single threads REQUIRED) - -# -# hamlib setup -# -find_package (Hamlib REQUIRED) -find_program (RIGCTL_EXE rigctl) -find_program (RIGCTLD_EXE rigctld) -find_program (RIGCTLCOM_EXE rigctlcom) - -check_type_size (CACHE_ALL HAMLIB_OLD_CACHING) -check_symbol_exists (rig_set_cache_timeout_ms "hamlib/rig.h" HAVE_HAMLIB_CACHING) - -find_package (Usb REQUIRED) - -if (WSJT_FOX_OTP) - add_definitions (-DFOX_OTP) -endif () - -# -# Qt5 setup -# - -# Widgets finds its own dependencies. -find_package (Qt5 COMPONENTS Widgets SerialPort Multimedia PrintSupport Sql LinguistTools WebSockets REQUIRED) - -if (WIN32) - add_definitions (-DQT_NEEDS_QTMAIN) - find_package (Qt5AxContainer REQUIRED) -endif (WIN32) - -# -# Library building setup -# -include (GenerateExportHeader) -set (CMAKE_CXX_VISIBILITY_PRESET hidden) -set (CMAKE_C_VISIBILITY_PRESET hidden) -set (CMAKE_Fortran_VISIBILITY_PRESET hidden) -set (CMAKE_VISIBILITY_INLINES_HIDDEN ON) -#set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) - - -# -# C & C++ setup -# -set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") - -set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -fexceptions -frtti") - -# MinGW gcc 16.x (MSYS2 rolled forward 2026-05) raises false-positive -# -Wmaybe-uninitialized on the placement-new'd HRDMessage flexible-array -# struct in Transceiver/HRDTransceiver.cpp. Demote to a warning on Windows -# + gcc 16+ until upstream gcc tightens the analysis or HRDMessage is -# refactored. Scoped narrowly so other platforms keep -Werror discipline. -if (WIN32 - AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" - AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "16.0") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=maybe-uninitialized") -endif () - -if (NOT APPLE) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas") - if (${OPENMP_FOUND}) - if (OpenMP_C_FLAGS) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") - endif () - endif () - set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fdata-sections -ffunction-sections") - set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -fdata-sections -ffunction-sections") - set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fdata-sections -ffunction-sections") - set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -fdata-sections -ffunction-sections") -endif (NOT APPLE) - -if (WIN32) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") -endif (WIN32) - -if (APPLE AND ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++") -else () - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=gnu++11 -pthread") -endif () - - -# -# Fortran setup -# -set (General_FFLAGS "-Wall -Wno-conversion -Wno-c-binding-type -fno-second-underscore") - -# FFLAGS depend on the compiler -get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME) - -if (Fortran_COMPILER_NAME MATCHES "gfortran.*") - # gfortran - - # CMake compiler test is supposed to do this but doesn't yet - if (CMAKE_OSX_DEPLOYMENT_TARGET) - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}") - endif (CMAKE_OSX_DEPLOYMENT_TARGET) - if (CMAKE_OSX_SYSROOT) - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -isysroot ${CMAKE_OSX_SYSROOT}") - endif (CMAKE_OSX_SYSROOT) - - # Add assembler flag to disable executable stack - if (UNIX AND NOT APPLE AND Fortran_COMPILER_NAME MATCHES "gfortran.*") - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wa,--noexecstack") - endif() - - set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -fbounds-check -funroll-all-loops -fno-f2c -ffpe-summary=invalid,zero,overflow,underflow ${General_FFLAGS}") - - set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -ggdb -O0 -fbacktrace -fcheck=all -fbounds-check -fno-f2c -ffpe-summary=invalid,zero,overflow,underflow ${General_FFLAGS}") - - # FPE traps currently disabled in Debug configuration builds until - # we decide if they are meaningful, without these FP instructions - # run in nonstop mode and do not trap - #set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${CMAKE_Fortran_FLAGS_DEBUG} -ffpe-trap=invalid,zero,overflow") - -elseif (Fortran_COMPILER_NAME MATCHES "ifort.*") - # ifort (untested) - set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -f77rtl ${General_FFLAGS}") - set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -f77rtl ${General_FFLAGS}") -elseif (Fortran_COMPILER_NAME MATCHES "g77") - # g77 - set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -funroll-all-loops -fno-f2c -m32 ${General_FFLAGS}") - set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fbounds-check -fno-f2c -m32 ${General_FFLAGS}") - -else() - message ("CMAKE_Fortran_COMPILER full path: ${CMAKE_Fortran_COMPILER}") - message ("Fortran compiler: ${Fortran_COMPILER_NAME}") - message ("No optimized Fortran compiler flags are known, we just try -O3...") - set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O3 ${General_FFLAGS}") - set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -g -fbacktrace -fcheck=all -fbounds-check ${General_FFLAGS}") -endif() - -# -# Linker setup -# -if (NOT APPLE) - set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Wl,--gc-sections") - set (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} -Wl,--gc-sections") -endif (NOT APPLE) - - -# -# setup and test Fortran C/C++ interaction -# - -include (FortranCInterface) -FortranCInterface_VERIFY (CXX) -FortranCInterface_HEADER (FC.h MACRO_NAMESPACE "FC_" SYMBOL_NAMESPACE "FC_" - SYMBOLS - grayline - ) - - -# -# sort out pre-requisites -# - -# -# Setup RPATH so that built executable targets will run in both the -# build tree and the install location without having to set a -# (DYLD|LD)_LIBRARY_PATH override. -# - -# use the full RPATH of the build tree -set (CMAKE_SKIP_BUILD_RPATH FALSE) - -# when building, don't use the install RPATH, it will still be used -# later on in the install phase -set (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) - -# set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") - -# add the automaticaly determined parts of the RPATH which point to -# directories outside of the build tree to the install RPATH -set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - -# the RPATH to be used when installing, but only if it's not a system -# directory -# list (FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" isSystemDir) -# if ("${isSystemDir}" STREQUAL "-1") -# set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") -# endif ("${isSystemDir}" STREQUAL "-1") - -set (QT_NEED_RPATH FALSE) -if (NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64") - set (QT_NEED_RPATH TRUE) -endif () - -# -# stuff only qmake can tell us -# -get_target_property (QMAKE_EXECUTABLE Qt5::qmake LOCATION) -get_target_property (LCONVERT_EXECUTABLE Qt5::lconvert LOCATION) -function (QUERY_QMAKE VAR RESULT) - exec_program (${QMAKE_EXECUTABLE} ARGS "-query ${VAR}" RETURN_VALUE return_code OUTPUT_VARIABLE output) - if (NOT return_code) - file (TO_CMAKE_PATH "${output}" output) - set (${RESULT} ${output} PARENT_SCOPE) - endif (NOT return_code) - message (STATUS "Asking qmake for ${RESULT} and got ${output}") -endfunction (QUERY_QMAKE) - -query_qmake (QT_INSTALL_PLUGINS QT_PLUGINS_DIR) -query_qmake (QT_INSTALL_TRANSLATIONS QT_TRANSLATIONS_DIR) -query_qmake (QT_INSTALL_IMPORTS QT_IMPORTS_DIR) -query_qmake (QT_HOST_DATA QT_DATA_DIR) -set (QT_MKSPECS_DIR ${QT_DATA_DIR}/mkspecs) +include (CMake/Dependencies.cmake) +include (CMake/CompilerFlags.cmake) # project definitions add_definitions (-DQT5 -DCMAKE_BUILD -DBIGSYM=1 -DBOOST_ALL_DYN_LINK) @@ -1301,166 +338,178 @@ endif () if (WSJT_GENERATE_DOCS) add_subdirectory (doc) endif (WSJT_GENERATE_DOCS) -if (WSJT_BUILD_TESTS AND EXISTS ${CMAKE_SOURCE_DIR}/tests AND IS_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) - enable_testing () - add_subdirectory (tests) +set (WSJT_OPENMP_FORTRAN_AVAILABLE FALSE) +set (WSJT_OPENMP_FORTRAN_FLAGS "") +# C/C++ OpenMP and Fortran OpenMP can resolve to different runtimes, +# especially on macOS where Apple Clang and GNU Fortran are mixed. +if (OpenMP_Fortran_FOUND) + set (WSJT_OPENMP_FORTRAN_AVAILABLE TRUE) + set (WSJT_OPENMP_FORTRAN_FLAGS "${OpenMP_Fortran_FLAGS}") +elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") + set (WSJT_OPENMP_FORTRAN_AVAILABLE TRUE) + set (WSJT_OPENMP_FORTRAN_FLAGS "-fopenmp") +endif () + +string (TOUPPER "${WSJT_FORTRAN_LIBRARY_VARIANTS}" WSJT_FORTRAN_LIBRARY_VARIANTS) +if (NOT WSJT_FORTRAN_LIBRARY_VARIANTS MATCHES "^(AUTO|BOTH|OPENMP_ONLY|NON_OPENMP_ONLY)$") + message (FATAL_ERROR + "WSJT_FORTRAN_LIBRARY_VARIANTS must be AUTO, BOTH, OPENMP_ONLY, or NON_OPENMP_ONLY") +endif () + +set (WSJT_EFFECTIVE_FORTRAN_LIBRARY_VARIANTS ${WSJT_FORTRAN_LIBRARY_VARIANTS}) +if (WSJT_EFFECTIVE_FORTRAN_LIBRARY_VARIANTS STREQUAL "AUTO") + if (APPLE) + set (WSJT_EFFECTIVE_FORTRAN_LIBRARY_VARIANTS BOTH) + elseif (WSJT_OPENMP_FORTRAN_AVAILABLE) + set (WSJT_EFFECTIVE_FORTRAN_LIBRARY_VARIANTS BOTH) + else () + set (WSJT_EFFECTIVE_FORTRAN_LIBRARY_VARIANTS NON_OPENMP_ONLY) + endif () +endif () + +if (APPLE AND WSJT_EFFECTIVE_FORTRAN_LIBRARY_VARIANTS STREQUAL "OPENMP_ONLY") + # The macOS app links the non-OpenMP Fortran library while jt9 carries + # the GNU OpenMP runtime separately, so OPENMP_ONLY would change the + # runtime boundary that keeps Apple Clang libomp out of the bundle. + message (FATAL_ERROR "WSJT_FORTRAN_LIBRARY_VARIANTS=OPENMP_ONLY is not supported on macOS") +endif () +if (WSJT_EFFECTIVE_FORTRAN_LIBRARY_VARIANTS MATCHES "^(BOTH|OPENMP_ONLY)$" + AND NOT WSJT_OPENMP_FORTRAN_AVAILABLE) + message (FATAL_ERROR + "WSJT_FORTRAN_LIBRARY_VARIANTS=${WSJT_FORTRAN_LIBRARY_VARIANTS} requires OpenMP support") +endif () + +set (WSJT_BUILD_FORTRAN_NON_OPENMP FALSE) +set (WSJT_BUILD_FORTRAN_OPENMP FALSE) +if (WSJT_EFFECTIVE_FORTRAN_LIBRARY_VARIANTS MATCHES "^(BOTH|NON_OPENMP_ONLY)$") + set (WSJT_BUILD_FORTRAN_NON_OPENMP TRUE) +endif () +if (WSJT_EFFECTIVE_FORTRAN_LIBRARY_VARIANTS MATCHES "^(BOTH|OPENMP_ONLY)$") + set (WSJT_BUILD_FORTRAN_OPENMP TRUE) +endif () + +# The concrete Fortran library that non-app consumers (utilities, qmap_impl, +# m65impl, tests) should link. These consumers use the non-OpenMP library when +# it exists and the OpenMP one only when it is the single variant built. +# Consumers link the wsjt_fort_common interface target (created once both +# libraries exist) rather than naming this. +set (WSJT_COMMON_FORT_TARGET wsjt_fort) +if (WSJT_EFFECTIVE_FORTRAN_LIBRARY_VARIANTS STREQUAL "OPENMP_ONLY") + set (WSJT_COMMON_FORT_TARGET wsjt_fort_omp) +endif () +message (STATUS "Fortran library variants: requested=${WSJT_FORTRAN_LIBRARY_VARIANTS}, effective=${WSJT_EFFECTIVE_FORTRAN_LIBRARY_VARIANTS}") +message (STATUS "Common Fortran target: ${WSJT_COMMON_FORT_TARGET}") +message (STATUS "QMAP: skip=${WSJT_SKIP_QMAP}") + +# Internal usage requirements for targets whose own Fortran sources contain +# OpenMP directives. Static libraries keep the runtime dependency link- +# transitive without exporting the compile option to their consumers. +if (WSJT_OPENMP_FORTRAN_AVAILABLE) + add_library (wsjt_fortran_openmp INTERFACE) + if (TARGET OpenMP::OpenMP_Fortran AND NOT APPLE) + target_link_libraries (wsjt_fortran_openmp + INTERFACE OpenMP::OpenMP_Fortran) + elseif (WSJT_OPENMP_FORTRAN_FLAGS) + target_compile_options (wsjt_fortran_openmp INTERFACE + $<$:${WSJT_OPENMP_FORTRAN_FLAGS}>) + if (APPLE) + target_link_libraries (wsjt_fortran_openmp INTERFACE + "${WSJT_MACOS_LIBGOMP_LIBRARY}") + else () + target_link_libraries (wsjt_fortran_openmp INTERFACE + ${WSJT_OPENMP_FORTRAN_FLAGS}) + endif () + endif () endif () # build a library of package functionality (without and optionally with OpenMP support) add_library (wsjt_cxx STATIC ${wsjt_CSRCS} ${wsjt_CXXSRCS}) target_link_libraries (wsjt_cxx ${LIBM_LIBRARIES} Boost::log_setup ${LIBM_LIBRARIES}) -# build an OpenMP variant of the Fortran library routines -add_library (wsjt_fort STATIC ${wsjt_FSRCS}) -target_link_libraries (wsjt_fort ${FFTW3_LIBRARIES}) -if (${OPENMP_FOUND} OR APPLE) +# build Fortran library routines without and optionally with OpenMP support +if (WSJT_BUILD_FORTRAN_NON_OPENMP) + set (WSJT_FORTRAN_MODULE_DIR ${CMAKE_BINARY_DIR}/fortran_modules) + file (MAKE_DIRECTORY ${WSJT_FORTRAN_MODULE_DIR}) + add_library (wsjt_fort STATIC ${wsjt_FSRCS}) + set_target_properties (wsjt_fort + PROPERTIES + Fortran_MODULE_DIRECTORY ${WSJT_FORTRAN_MODULE_DIR} + ) + target_include_directories (wsjt_fort INTERFACE + $ + ) + target_link_libraries (wsjt_fort PUBLIC wsjt_cxx ${FFTW3_LIBRARIES}) +endif () +if (WSJT_BUILD_FORTRAN_OPENMP) + set (WSJT_FORTRAN_OPENMP_MODULE_DIR ${CMAKE_BINARY_DIR}/fortran_modules_omp) + file (MAKE_DIRECTORY ${WSJT_FORTRAN_OPENMP_MODULE_DIR}) add_library (wsjt_fort_omp STATIC ${wsjt_FSRCS}) - target_link_libraries (wsjt_fort_omp ${FFTW3_LIBRARIES}) - if (OpenMP_C_FLAGS AND NOT APPLE) - set_target_properties (wsjt_fort_omp - PROPERTIES - COMPILE_FLAGS "${OpenMP_C_FLAGS}" - ) - endif () set_target_properties (wsjt_fort_omp PROPERTIES - Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/fortran_modules_omp + Fortran_MODULE_DIRECTORY ${WSJT_FORTRAN_OPENMP_MODULE_DIR} ) - file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/fortran_modules_omp) - if (APPLE) - # On Mac we don't have working OpenMP support in the C/C++ - # compilers so we have to manually set the correct flags to get - # OpenMP support in jt9. - target_compile_options (wsjt_fort_omp - PRIVATE - $<$:-fopenmp> # assumes GNU style Fortran compiler - ) - endif (APPLE) -endif (${OPENMP_FOUND} OR APPLE) + target_include_directories (wsjt_fort_omp INTERFACE + $ + ) + target_link_libraries (wsjt_fort_omp + PUBLIC wsjt_cxx ${FFTW3_LIBRARIES} + PRIVATE wsjt_fortran_openmp) +endif () +# Naming a missing target in target_link_libraries does not fail at configure +# time — CMake passes -l to the linker and the failure surfaces later as +# a cryptic link error. Fail loudly here instead, naming the cause. +if (NOT TARGET wsjt_fort AND NOT TARGET wsjt_fort_omp) + message (FATAL_ERROR + "No Fortran variant was built (WSJT_FORTRAN_LIBRARY_VARIANTS='${WSJT_FORTRAN_LIBRARY_VARIANTS}', " + "effective='${WSJT_EFFECTIVE_FORTRAN_LIBRARY_VARIANTS}'). This is an internal build " + "configuration error.") +endif () +if (NOT TARGET ${WSJT_COMMON_FORT_TARGET}) + message (FATAL_ERROR + "Selected common Fortran target '${WSJT_COMMON_FORT_TARGET}' was not built. " + "This is an internal build configuration error.") +endif () + +# Interface target for non-app consumers. The concrete Fortran archive carries +# its module path plus the C/C++ helper archive it calls into, preserving static +# link order without every consumer repeating wsjt_cxx. add_library (wsjt_fort_common INTERFACE) -target_link_libraries (wsjt_fort_common INTERFACE wsjt_fort wsjt_cxx) +target_link_libraries (wsjt_fort_common INTERFACE ${WSJT_COMMON_FORT_TARGET}) function (wsjt_link_common_fortran tgt) target_link_libraries (${tgt} PUBLIC wsjt_fort_common) endfunction () -if(WSJT_BUILD_UTILS) - -add_executable (jt4sim lib/jt4sim.f90) -target_link_libraries (jt4sim wsjt_fort wsjt_cxx) - -add_executable (jt65sim lib/jt65sim.f90) -target_link_libraries (jt65sim wsjt_fort wsjt_cxx) - -add_executable (sumsim lib/sumsim.f90) -target_link_libraries (sumsim wsjt_fort wsjt_cxx) - -add_executable (cablog lib/cablog.f90) -target_link_libraries (cablog) - -add_executable (test_snr lib/test_snr.f90) -target_link_libraries (test_snr wsjt_fort) - -add_executable (q65sim lib/qra/q65/q65sim.f90) -target_link_libraries (q65sim wsjt_fort wsjt_cxx) - -add_executable (EchoCallSim lib/EchoCallSim.f90) -target_link_libraries (EchoCallSim wsjt_fort wsjt_cxx) - -add_executable (testEchoCall lib/testEchoCall.f90) -target_link_libraries (testEchoCall wsjt_fort wsjt_cxx) - -add_executable (cwsim lib/cwsim.f90) -target_link_libraries (cwsim wsjt_fort wsjt_cxx) - -add_executable (q65code lib/qra/q65/q65code.f90) -target_link_libraries (q65code wsjt_fort wsjt_cxx) - -add_executable (test_q65 lib/test_q65.f90) -target_link_libraries (test_q65 wsjt_fort wsjt_cxx) - -add_executable (q65_ftn_test lib/qra/q65/q65_ftn_test.f90) -target_link_libraries (q65_ftn_test wsjt_fort wsjt_cxx) - -add_executable (jt49sim lib/jt49sim.f90) -target_link_libraries (jt49sim wsjt_fort wsjt_cxx) - -#add_executable (allsim lib/allsim.f90) -#target_link_libraries (allsim wsjt_fort wsjt_cxx) - -add_executable (rtty_spec lib/rtty_spec.f90) -target_link_libraries (rtty_spec wsjt_fort wsjt_cxx) - -add_executable (jt65code lib/jt65code.f90) -target_link_libraries (jt65code wsjt_fort wsjt_cxx) - -add_executable (jt9code lib/jt9code.f90) -target_link_libraries (jt9code wsjt_fort wsjt_cxx) - -add_executable (wsprcode lib/wsprcode/wsprcode.f90 lib/wsprcode/nhash.c) -target_link_libraries (wsprcode wsjt_fort wsjt_cxx) - -add_executable (encode77 lib/77bit/encode77.f90) -target_link_libraries (encode77 wsjt_fort wsjt_cxx) - -add_executable (hash22calc lib/77bit/hash22calc.f90) -target_link_libraries (hash22calc wsjt_fort wsjt_cxx) - -add_executable (wsprsim ${wsprsim_CSRCS}) -target_link_libraries (wsprsim ${LIBM_LIBRARIES}) - -add_executable (jt4code lib/jt4code.f90) -target_link_libraries (jt4code wsjt_fort wsjt_cxx) - -add_executable (msk144code lib/msk144code.f90) -target_link_libraries (msk144code wsjt_fort wsjt_cxx) - -add_executable (ft8code lib/ft8/ft8code.f90) -target_link_libraries (ft8code wsjt_fort wsjt_cxx) - -add_executable (ft4code lib/ft4/ft4code.f90) -target_link_libraries (ft4code wsjt_fort wsjt_cxx) - -add_executable (echosim lib/echosim.f90) -target_link_libraries (echosim wsjt_fort wsjt_cxx) - -add_executable (ft8sim lib/ft8/ft8sim.f90) -target_link_libraries (ft8sim wsjt_fort wsjt_cxx) - -add_executable (sfoxsim lib/superfox/sfoxsim.f90) -target_link_libraries (sfoxsim wsjt_fort wsjt_cxx) - -add_executable (sfrx lib/superfox/sfrx.f90) -target_link_libraries (sfrx wsjt_fort wsjt_cxx) - -add_executable (sftx lib/superfox/sftx.f90) -target_link_libraries (sftx wsjt_fort wsjt_cxx) - -add_executable (msk144sim lib/msk144sim.f90) -target_link_libraries (msk144sim wsjt_fort wsjt_cxx) - -add_executable (ft4sim lib/ft4/ft4sim.f90) -target_link_libraries (ft4sim wsjt_fort wsjt_cxx) +function (wsjt_add_simulator_usage_test tgt usage_pattern) + if (WSJT_ENABLE_TESTS) + string (TOLOWER "${tgt}" test_target) + add_test ( + NAME test_${test_target}_usage + COMMAND $ + ) + set_tests_properties (test_${test_target}_usage PROPERTIES + PASS_REGULAR_EXPRESSION "${usage_pattern}" + TIMEOUT 10 + ) + endif () +endfunction () -add_executable (ft4sim_mult lib/ft4/ft4sim_mult.f90) -target_link_libraries (ft4sim_mult wsjt_fort wsjt_cxx) +# Link the OpenMP Fortran variant onto an app target (jt9, wsjtx). +# Per-app stack/heap sizing stays at the call site. +function (wsjt_link_fortran_openmp tgt) + target_link_libraries (${tgt} wsjt_fort_omp) + set_target_properties (${tgt} PROPERTIES + Fortran_MODULE_DIRECTORY ${WSJT_FORTRAN_OPENMP_MODULE_DIR}) +endfunction () -add_executable (fst4sim lib/fst4/fst4sim.f90) -target_link_libraries (fst4sim wsjt_fort wsjt_cxx) -if (WIN32) - set_target_properties (fst4sim PROPERTIES - LINK_FLAGS -Wl,--stack,0x4000000,--heap,0x6000000 - ) +if (WSJT_ENABLE_TESTS AND EXISTS ${CMAKE_SOURCE_DIR}/tests AND IS_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) + add_subdirectory (tests) endif () -add_executable (ldpcsim240_101 lib/fst4/ldpcsim240_101.f90) -target_link_libraries (ldpcsim240_101 wsjt_fort wsjt_cxx) +include (CMake/Utils.cmake) -add_executable (ldpcsim240_74 lib/fst4/ldpcsim240_74.f90) -target_link_libraries (ldpcsim240_74 wsjt_fort wsjt_cxx) -endif(WSJT_BUILD_UTILS) add_executable (fmtave lib/fmtave.f90) @@ -1494,14 +543,9 @@ endif() target_include_directories (wsprd PRIVATE ${FFTW3_INCLUDE_DIRS}) target_link_libraries (wsprd ${FFTW3_LIBRARIES} ${LIBM_LIBRARIES}) -# Tell CMake to run moc when necessary -set (CMAKE_AUTOMOC ON) -include_directories (${CMAKE_CURRENT_BINARY_DIR}) -# don't use Qt "keywords" signal, slot, emit in generated files to -# avoid compatability issue with other libraries -# ADD_DEFINITIONS (-DQT_NO_KEYWORDS) -# ADD_DEFINITIONS (-DUNICODE) #as per qmake + +include_directories (${CMAKE_CURRENT_BINARY_DIR}) # As moc files are generated in the binary dir, tell CMake to always # look for includes there: @@ -1523,21 +567,24 @@ add_custom_target (etags COMMAND ${ETAGS} -o ${CMAKE_SOURCE_DIR}/TAGS -R ${sourc set (LANGUAGES ca # Catalan da # Danish + de # German en # English (we need this to stop # translation loaders loading the # second preference UI languge, it # doesn't need to be populated) en_GB # English UK es # Spanish + hu # Hungarian it # Italian ja # Japanese #no # Norwegian + pl # Polish #pt # Portuguese ru # Russian #sv # Swedish + uk # Ukrainian zh # Chinese zh_TW # Chinese traditional - it # Italian ) foreach (lang_ ${LANGUAGES}) file (TO_NATIVE_PATH ${CMAKE_SOURCE_DIR}/translations/wsjtx_${lang_}.ts ts_) @@ -1608,24 +655,27 @@ endif (WIN32) # build a library for the QCustomPlot widget add_library (qcp STATIC ${qcp_CXXSRCS}) +wsjt_enable_qt_automoc (qcp) target_include_directories (qcp PUBLIC $) target_link_libraries (qcp Qt5::Widgets Qt5::PrintSupport) # build a library of package Qt functionality add_library (wsjt_qt STATIC ${wsjt_qt_CXXSRCS} ${wsjt_qt_GENUISRCS} ${GENAXSRCS}) +wsjt_enable_qt_automoc (wsjt_qt) # set wsjtx_udp exports to static variants target_compile_definitions (wsjt_qt PUBLIC UDP_STATIC_DEFINE) -target_link_libraries (wsjt_qt Hamlib::Hamlib Boost::log qcp Qt5::Widgets Qt5::Network Qt5::Sql Qt5::WebSockets) +target_link_libraries (wsjt_qt Hamlib::Hamlib Boost::log qcp Qt5::Widgets Qt5::Network Qt5::Multimedia Qt5::SerialPort Qt5::Sql Qt5::WebSockets) if (WIN32) target_link_libraries (wsjt_qt Qt5::AxContainer Qt5::AxBase) endif (WIN32) # build a library of package Qt functionality used in Fortran utilities add_library (fort_qt STATIC ${fort_qt_CXXSRCS}) -target_link_libraries (fort_qt Qt5::Core) +target_link_libraries (fort_qt PRIVATE Qt5::Core) # build a library of WSJT Qt multimedia components add_library (wsjt_qtmm STATIC ${wsjt_qtmm_CXXSRCS} ${wsjt_qtmm_GENUISRCS}) +wsjt_enable_qt_automoc (wsjt_qtmm) target_link_libraries (wsjt_qtmm Qt5::Multimedia) # build the jt9 slow mode decoder driver @@ -1637,60 +687,320 @@ generate_version_info (jt9_VERSION_RESOURCES ) add_executable (record_time_signal Audio/tools/record_time_signal.cpp) +wsjt_enable_qt_automoc (record_time_signal) target_link_libraries (record_time_signal wsjt_cxx wsjt_qtmm wsjt_qt) add_executable (jt9 ${jt9_FSRCS} ${jt9_VERSION_RESOURCES}) -if (${OPENMP_FOUND} OR APPLE) - if (APPLE) - # On Mac we don't have working OpenMP support in the C/C++ - # compilers so we have to manually set the correct flags to get - # OpenMP support in jt9. - set_target_properties (jt9 - PROPERTIES - Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/fortran_modules_omp - ) - target_compile_options (jt9 - PRIVATE - $<$:-fopenmp> # assumes GNU style Fortran compiler - ) - else (APPLE) - if (OpenMP_C_FLAGS) - set_target_properties (jt9 - PROPERTIES - COMPILE_FLAGS "${OpenMP_C_FLAGS}" - LINK_FLAGS "${OpenMP_C_FLAGS}" - ) + +if (TARGET test_streaming_consumers) + add_dependencies (test_streaming_consumers jt9 wsprd) +endif () + +if (WSJT_BUILD_UTILS) + add_executable (ft8sim lib/ft8/ft8sim.f90 lib/print_version.c ${jt9_VERSION_RESOURCES}) + wsjt_link_common_fortran (ft8sim) + wsjt_add_simulator_usage_test (ft8sim "Usage:[ ]+ft8sim") +endif () + +if (WSJT_ENABLE_TESTS) + add_test (NAME test_jt9_version COMMAND $ --version) + set_tests_properties (test_jt9_version PROPERTIES + PASS_REGULAR_EXPRESSION "^jt9 [0-9]+\\.[0-9]+\\.[0-9]+[^ ]* \\(revision ([0-9a-f]+(-dirty)?|unavailable)\\)" + ) + add_test (NAME test_jt9_cli_validation + COMMAND ${CMAKE_COMMAND} -DJT9=$ + -P ${CMAKE_SOURCE_DIR}/tests/unit/jt9/test_jt9_cli_validation.cmake) + + # Golden output is pinned to the required GNU/Linux x86-64 decoder path. + if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND + CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64)$") + # mode_args is one or more jt9 flags (e.g. -8, or --q65 -p 30 -f 1000 -d 3). + # $ protects the list separators through the single -DMODE=... + # COMMAND argument; compare_decoder_output.cmake expands ${MODE} unquoted + # so it splits back into separate jt9 arguments on the far side. + function (wsjt_add_jt9_golden_test test_name sample expected) + set (mode_args ${ARGN}) + string (REPLACE ";" "$" mode_args "${mode_args}") + set (work_dir "${CMAKE_BINARY_DIR}/Testing/Golden/${test_name}") + file (MAKE_DIRECTORY "${work_dir}") + add_test (NAME ${test_name} + COMMAND ${CMAKE_COMMAND} + -DJT9=$ + "-DMODE=${mode_args}" + -DSAMPLE=${CMAKE_SOURCE_DIR}/${sample} + -DEXPECTED=${CMAKE_SOURCE_DIR}/${expected} + -DWORK_DIR=${work_dir} + -DSOURCE_DIR=${CMAKE_SOURCE_DIR} + -P ${CMAKE_SOURCE_DIR}/tests/integration/jt9/compare_decoder_output.cmake) + set_tests_properties (${test_name} PROPERTIES + LABELS "decoder;golden;integration" + TIMEOUT 120) + if (WSJT_ENABLE_TSAN) + set_tests_properties (${test_name} PROPERTIES + ENVIRONMENT "TSAN_OPTIONS=${wsjt_tsan_fortran_options}") + endif () + endfunction () + + wsjt_add_jt9_golden_test ( + test_jt9_golden_ft8_210703_133430 + samples/FT8/210703_133430.wav + test/fixtures/ft8_210703_133430.expected.txt + -8) + if (WSJT_BUILD_FORTRAN_OPENMP) + function (wsjt_add_jt9_mtd_golden_test test_name processors mtd_workers + decode_cycles fft_threads) + set (options CONSECUTIVE_PERIODS) + set (one_value_args MY_CALL DX_CALL QSO_FREQUENCY QSO_PROGRESS) + cmake_parse_arguments (MTD_TEST "${options}" "${one_value_args}" "" ${ARGN}) + set (work_dir "${CMAKE_BINARY_DIR}/Testing/Golden/${test_name}") + file (MAKE_DIRECTORY "${work_dir}") + add_test (NAME ${test_name} + COMMAND ${CMAKE_COMMAND} + -DJT9=$ + -DSAMPLE=${CMAKE_SOURCE_DIR}/samples/FT8/210703_133430.wav + -DEXPECTED=${CMAKE_SOURCE_DIR}/test/fixtures/ft8_210703_133430_mtd.expected.txt + -DWORK_DIR=${work_dir} + -DSOURCE_DIR=${CMAKE_SOURCE_DIR} + -DMTD_WORKERS=${mtd_workers} + -DDECODE_CYCLES=${decode_cycles} + -DFFT_THREADS=${fft_threads} + -DCONSECUTIVE_PERIODS=${MTD_TEST_CONSECUTIVE_PERIODS} + -DMY_CALL=${MTD_TEST_MY_CALL} + -DDX_CALL=${MTD_TEST_DX_CALL} + -DQSO_FREQUENCY=${MTD_TEST_QSO_FREQUENCY} + -DQSO_PROGRESS=${MTD_TEST_QSO_PROGRESS} + -P ${CMAKE_SOURCE_DIR}/tests/integration/jt9/compare_mtd_messages.cmake) + set_tests_properties (${test_name} PROPERTIES + LABELS "decoder;golden;integration;mtd" + PROCESSORS ${processors} + TIMEOUT 120) + if (WSJT_ENABLE_TSAN) + set_tests_properties (${test_name} PROPERTIES + ENVIRONMENT "TSAN_OPTIONS=${wsjt_tsan_fortran_options}") + endif () + endfunction () + + if (WSJT_ENABLE_TSAN) + # One decode cycle covers the same full sample and golden message set + # while keeping the instrumented two-worker synchronization bounded. + wsjt_add_jt9_mtd_golden_test ( + test_jt9_mtd_ft8_210703_133430_tsan 2 2 1 1) + # Reusing the sample in one process carries decoded messages into the + # next period and exercises signal-directed and QSO-state concurrency. + wsjt_add_jt9_mtd_golden_test ( + test_jt9_mtd_ft8_prior_period_qso_tsan 2 2 1 1 + CONSECUTIVE_PERIODS + MY_CALL K1JT + DX_CALL HA0DU + QSO_FREQUENCY 590 + QSO_PROGRESS 1) + set_tests_properties (test_jt9_mtd_ft8_prior_period_qso_tsan PROPERTIES + TIMEOUT 360) + else () + wsjt_add_jt9_mtd_golden_test ( + test_jt9_mtd_ft8_210703_133430 4 4 3 3) + # Keep the stateful path covered in ordinary OpenMP builds as well as + # sanitizer builds. + wsjt_add_jt9_mtd_golden_test ( + test_jt9_mtd_ft8_prior_period_qso 4 4 1 1 + CONSECUTIVE_PERIODS + MY_CALL K1JT + DX_CALL HA0DU + QSO_FREQUENCY 590 + QSO_PROGRESS 1) + wsjt_add_jt9_mtd_golden_test ( + test_jt9_mtd_ft8_210703_133430_limited_team 2 4 3 3) + # The -N 4 request requires at least three visible processors for this + # limit to reduce the runtime team. + set_tests_properties (test_jt9_mtd_ft8_210703_133430_limited_team PROPERTIES + ENVIRONMENT "OMP_THREAD_LIMIT=2") + endif () endif () - set_target_properties (jt9 - PROPERTIES - Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/fortran_modules_omp - ) - endif (APPLE) + wsjt_add_jt9_golden_test ( + test_jt9_golden_jt9_130418_1742 + samples/JT9/130418_1742.wav + test/fixtures/jt9_130418_1742.expected.txt + -9) + wsjt_add_jt9_golden_test ( + test_jt9_golden_q65_30a_201203_024000 + samples/Q65/30A_Ionoscatter_6m/201203_024000.wav + test/fixtures/q65_30a_201203_024000.expected.txt + --q65 -p 30 -f 1000 -d 3) + wsjt_add_jt9_golden_test ( + test_jt9_golden_q65_300a_201210_0505 + samples/Q65/300A_Optical_Scatter/201210_0505.wav + test/fixtures/q65_300a_201210_0505.expected.txt + --q65 -p 300 -f 1000 -d 3) + set_tests_properties (test_jt9_golden_q65_300a_201210_0505 PROPERTIES + COST 18) + wsjt_add_jt9_golden_test ( + test_jt9_golden_q65_60d_201212_1838 + samples/Q65/60D_EME_10GHz/201212_1838.wav + test/fixtures/q65_60d_201212_1838.expected.txt + --q65 -b D -p 60 -f 1000 -d 3) + wsjt_add_jt9_golden_test ( + test_jt9_golden_msk144_181211_120800 + samples/MSK144/181211_120800.wav + test/fixtures/msk144_181211_120800.expected.txt + --msk144 -p 15 -f 1500 -F 50 -d 3) + wsjt_add_jt9_golden_test ( + test_jt9_golden_fst4_210115_0058 + samples/FST4+FST4W/210115_0058.wav + test/fixtures/fst4_210115_0058.expected.txt + --fst4 -p 60 -f 1331 -L 1000 -H 1400 -d 3) + wsjt_add_jt9_golden_test ( + test_jt9_golden_fst4w_201230_0300 + samples/FST4+FST4W/201230_0300.wav + test/fixtures/fst4w_201230_0300.expected.txt + --fst4w -p 1800 -f 1433 -F 100 -d 3) + wsjt_add_jt9_golden_test ( + test_jt9_golden_ft4_000000_000002 + samples/FT4/000000_000002.wav + test/fixtures/ft4_000000_000002.expected.txt + --ft4 -d 3) + wsjt_add_jt9_golden_test ( + test_jt9_golden_jt65_000000_0004 + samples/JT65/JT65B/000000_0004.wav + test/fixtures/jt65_000000_0004.expected.txt + --jt65 -b B -f 1700 -d 3) + wsjt_add_jt9_golden_test ( + test_jt9_golden_jt4_OK1KIR_141105_175700 + samples/JT4/JT4F/OK1KIR_141105_175700.WAV + test/fixtures/jt4_OK1KIR_141105_175700.expected.txt + --jt4 -b F -f 1200 -d 3) + if (TARGET jt4sim) + set (jt4_read_extent_work_dir + "${CMAKE_BINARY_DIR}/Testing/JT4/test_jt4_12000_read_extent") + add_test (NAME test_jt4_12000_read_extent + COMMAND ${CMAKE_COMMAND} + -DJT9=$ + -DJT4SIM=$ + -DWORK_DIR=${jt4_read_extent_work_dir} + -P ${CMAKE_SOURCE_DIR}/tests/integration/jt9/verify_jt4_12000_read_extent.cmake) + set_tests_properties (test_jt4_12000_read_extent PROPERTIES + LABELS "decoder;jt4;integration" + TIMEOUT 120) + endif () + + # WSPR decodes via the standalone wsprd binary, not jt9. -a isolates its + # writable side files (wspr_wisdom.dat, ALL_WSPR.TXT, wspr_spots.txt, + # wspr_timer.out, hashtable.txt) in the per-test work dir; confirmed this + # doesn't affect stdout. + function (wsjt_add_wsprd_golden_test test_name sample expected) + set (work_dir "${CMAKE_BINARY_DIR}/Testing/Golden/${test_name}") + file (MAKE_DIRECTORY "${work_dir}") + add_test (NAME ${test_name} + COMMAND ${CMAKE_COMMAND} + -DWSPRD=$ + -DSAMPLE=${CMAKE_SOURCE_DIR}/${sample} + -DEXPECTED=${CMAKE_SOURCE_DIR}/${expected} + -DWORK_DIR=${work_dir} + -P ${CMAKE_SOURCE_DIR}/tests/integration/wsprd/compare_wsprd_output.cmake) + set_tests_properties (${test_name} PROPERTIES + LABELS "decoder;golden;integration" + TIMEOUT 120) + endfunction () + + wsjt_add_wsprd_golden_test ( + test_wsprd_golden_150426_0918 + samples/WSPR/150426_0918.wav + test/fixtures/wspr_150426_0918.expected.txt) + else () + set (jt9_smoke_work_dir + "${CMAKE_BINARY_DIR}/Testing/Smoke/test_jt9_ft8_callback_smoke") + file (MAKE_DIRECTORY "${jt9_smoke_work_dir}") + add_test (NAME test_jt9_ft8_callback_smoke + COMMAND ${CMAKE_COMMAND} + -DJT9=$ + -DSAMPLE=${CMAKE_SOURCE_DIR}/samples/FT8/210703_133430.wav + -DEXPECTED_MESSAGE=CQ\ F5RXL\ IN94 + -DWORK_DIR=${jt9_smoke_work_dir} + -DSOURCE_DIR=${CMAKE_SOURCE_DIR} + -P ${CMAKE_SOURCE_DIR}/tests/integration/jt9/smoke_decoder_callback.cmake) + set_tests_properties (test_jt9_ft8_callback_smoke PROPERTIES + LABELS "decoder;ft8;integration" + TIMEOUT 120) + endif () + + if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + set (WSJT_READELF "${CMAKE_READELF}") + if (NOT WSJT_READELF) + find_program (WSJT_READELF NAMES readelf llvm-readelf) + endif () + if (NOT WSJT_READELF) + message (FATAL_ERROR + "readelf is required to verify that jt9 has a non-executable stack") + endif () + add_test (NAME test_jt9_non_executable_stack + COMMAND ${CMAKE_COMMAND} + -DREADELF=${WSJT_READELF} + -DEXECUTABLE=$ + -P ${CMAKE_SOURCE_DIR}/tests/integration/jt9/verify_elf_stack.cmake) + set_tests_properties (test_jt9_non_executable_stack PROPERTIES + LABELS "build;elf;security" + TIMEOUT 30) + endif () +endif () + +if (WSJT_BUILD_FORTRAN_OPENMP) + wsjt_link_fortran_openmp (jt9) + target_link_libraries (jt9 wsjt_cxx fort_qt) if (WIN32) - set_target_properties (jt9 PROPERTIES - LINK_FLAGS -Wl,--stack,16777216 - ) + set_property (TARGET jt9 APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,--stack,16777216") endif () - if (APPLE) - target_link_libraries (jt9 wsjt_fort_omp wsjt_cxx fort_qt "${WSJT_MACOS_LIBGOMP_LIBRARY}" gcc_s.1) +else () + target_link_libraries (jt9 wsjt_fort wsjt_cxx fort_qt) +endif () + +# build jt9stream: the Qt-free streaming decoder (B2). Same jt9.f90 main as jt9, +# but ALWAYS compiled with the jt9a stub and NEVER linked against fort_qt, so it +# links zero Qt. Mirrors develop's jt9 OpenMP/APPLE/WIN32 structure exactly. +if (WSJT_BUILD_JT9STREAM) + generate_version_info (jt9stream_VERSION_RESOURCES + NAME jt9stream + BUNDLE ${PROJECT_BUNDLE_NAME} + ICON ${WSJTX_ICON_FILE} + FILE_DESCRIPTION "jt9stream - WSJT-X Qt-free streaming decoder" + ) + add_executable (jt9stream ${jt9stream_FSRCS} ${jt9stream_VERSION_RESOURCES}) + target_compile_definitions (jt9stream PRIVATE JT9_PROGRAM_NAME=\"jt9stream\") + # jt9stream shares jt9's Fortran module directory (fortran_modules_omp) so it + # can READ the modules emitted by wsjt_fort_omp (streaming_emit, etc.). jt9.f90 + # is a program and streaming_io.f90's jt9_stream is a bare subroutine, so this + # target emits no .mod of its own — sharing the dir is collision-free. + if (WSJT_BUILD_FORTRAN_OPENMP) + wsjt_link_fortran_openmp (jt9stream) + if (WIN32) + set_property (TARGET jt9stream APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,--stack,16777216") + endif () + target_link_libraries (jt9stream wsjt_cxx) else () - target_link_libraries (jt9 wsjt_fort_omp wsjt_cxx fort_qt) + target_link_libraries (jt9stream wsjt_fort wsjt_cxx) endif () -else (${OPENMP_FOUND} OR APPLE) - target_link_libraries (jt9 wsjt_fort wsjt_cxx fort_qt) -endif (${OPENMP_FOUND} OR APPLE) + # jt9stream NEVER links fort_qt — that is the Qt-free guarantee. +endif (WSJT_BUILD_JT9STREAM) -if (NOT WSJT_SKIP_MAP65) - find_package (Portaudio REQUIRED) - add_subdirectory (map65) +find_package (Portaudio REQUIRED) +add_subdirectory (map65) +if (TARGET map65) + wsjt_enable_qt_automoc (map65) +endif () + +if (NOT WSJT_SKIP_QMAP) + add_subdirectory (qmap) +endif () +if (TARGET qmap) + wsjt_enable_qt_automoc (qmap) endif () -add_subdirectory (qmap) # build the main application generate_version_info (wsjtx_VERSION_RESOURCES NAME wsjtx BUNDLE ${PROJECT_BUNDLE_NAME} ICON ${WSJTX_ICON_FILE} + FILE_DESCRIPTION "WSJT-X" ) # Embed a Windows application manifest declaring per-monitor V2 DPI @@ -1717,8 +1027,26 @@ add_executable (wsjtx MACOSX_BUNDLE ${wsjtx_RESOURCES_RCC} ${wsjtx_VERSION_RESOURCES} ${wsjtx_PLATFORM_RESOURCES} + ${wsjtx_BUNDLE_DATA_FILES} ) +wsjt_enable_qt_automoc (wsjtx) + +if (WSJT_ENABLE_TESTS) + target_compile_definitions (wsjtx PRIVATE WSJT_ENABLE_LIVE_AUDIO_TEST=1) +endif () + +if (APPLE) + add_custom_command( + TARGET wsjtx + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_BINARY_DIR}/jt9" + "$" + COMMENT "Copying $ into the Contents/MacOS/ directory" + ) +endif (APPLE) + if (WSJT_CREATE_WINMAIN) set_target_properties (wsjtx PROPERTIES WIN32_EXECUTABLE ON) endif (WSJT_CREATE_WINMAIN) @@ -1737,30 +1065,204 @@ set_target_properties (wsjtx PROPERTIES ) target_include_directories (wsjtx PRIVATE ${FFTW3_INCLUDE_DIRS}) -if ((NOT ${OPENMP_FOUND}) OR APPLE) +# On macOS the app links the non-OpenMP variant while jt9 carries the GNU +# OpenMP runtime separately; this keeps Apple Clang libomp out of the bundle. +if ((NOT WSJT_BUILD_FORTRAN_OPENMP) OR APPLE) target_link_libraries (wsjtx wsjt_fort) else () - target_link_libraries (wsjtx wsjt_fort_omp) - if (OpenMP_C_FLAGS) - set_target_properties (wsjtx PROPERTIES - COMPILE_FLAGS "${OpenMP_C_FLAGS}" - LINK_FLAGS "${OpenMP_C_FLAGS}" - ) + wsjt_link_fortran_openmp (wsjtx) + if (WIN32) + set_property (TARGET wsjtx APPEND_STRING PROPERTY + LINK_FLAGS " -Wl,--stack,0x1000000,--heap,0x20000000") + endif () +endif () +target_link_libraries (wsjtx Qt5::SerialPort Qt5::Network wsjt_cxx wsjt_qt wsjt_qtmm ${FFTW3_LIBRARIES} ${LIBM_LIBRARIES}) + +if (WSJT_ENABLE_TSAN) + target_compile_definitions (wsjtx PRIVATE WSJT_TSAN_TEST_PROFILE) +endif () + +if (WSJT_ENABLE_TESTS AND NOT WIN32) + set (wsjtx_startup_test_root + "${CMAKE_BINARY_DIR}/Testing/Startup/test_wsjtx_startup") + file (MAKE_DIRECTORY + "${wsjtx_startup_test_root}/config" + "${wsjtx_startup_test_root}/data" + "${wsjtx_startup_test_root}/cache" + "${wsjtx_startup_test_root}/tmp") + set (wsjtx_startup_test_environment + "XDG_CONFIG_HOME=${wsjtx_startup_test_root}/config" + "XDG_DATA_HOME=${wsjtx_startup_test_root}/data" + "XDG_CACHE_HOME=${wsjtx_startup_test_root}/cache" + "WSJT_QMAP_SHARED_MEMORY_KEY=mem_qmap-test_wsjtx_startup") + if (NOT APPLE) + list (APPEND wsjtx_startup_test_environment + "TMPDIR=${wsjtx_startup_test_root}/tmp") endif () - set_target_properties (wsjtx PROPERTIES - Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/fortran_modules_omp + if (APPLE) + add_test ( + NAME test_wsjtx_startup + COMMAND /bin/bash "${CMAKE_SOURCE_DIR}/test/run-wsjtx-startup-macos.sh" + "${CMAKE_BINARY_DIR}/startup-smoke-diagnostics" + "$" --startup-smoke-test --rig-name CTEST-STARTUP ) - if (WIN32) - set_target_properties (wsjtx PROPERTIES - LINK_FLAGS -Wl,--stack,0x1000000,--heap,0x20000000 - ) + set (wsjtx_startup_test_timeout 45) + else () + add_test ( + NAME test_wsjtx_startup + COMMAND $ --startup-smoke-test --rig-name CTEST-STARTUP + ) + set (wsjtx_startup_test_timeout 20) + endif () + set_tests_properties (test_wsjtx_startup PROPERTIES + ENVIRONMENT "${wsjtx_startup_test_environment}" + PROCESSORS 1 + TIMEOUT ${wsjtx_startup_test_timeout} + ) + if (WSJT_ENABLE_TSAN) + set_tests_properties (test_wsjtx_startup PROPERTIES + ENVIRONMENT "TSAN_OPTIONS=${wsjt_tsan_gui_options}") + endif () +endif () + +if (WSJT_ENABLE_TESTS AND WSJT_ENABLE_GUI_SMOKE_TESTS + AND WSJT_BUILD_FORTRAN_OPENMP + AND (APPLE OR + (CMAKE_SYSTEM_NAME STREQUAL "Linux" + AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64|AMD64)$"))) + add_dependencies (wsjtx sjtty) + + # Each full WSJT-X process allocates about 48 MiB of System V shared memory. + # The macOS CI pool is sized for three concurrent instances, so keep GUI + # process concurrency at three unless that limit is raised as well. + + set (wsjtx_live_audio_test_root + "${CMAKE_BINARY_DIR}/Testing/LiveAudio/test_wsjtx_live_audio_ft8") + file (MAKE_DIRECTORY + "${wsjtx_live_audio_test_root}/config" + "${wsjtx_live_audio_test_root}/data" + "${wsjtx_live_audio_test_root}/cache" + "${wsjtx_live_audio_test_root}/tmp") + set (wsjtx_live_audio_test_environment + "XDG_CONFIG_HOME=${wsjtx_live_audio_test_root}/config" + "XDG_DATA_HOME=${wsjtx_live_audio_test_root}/data" + "XDG_CACHE_HOME=${wsjtx_live_audio_test_root}/cache" + "WSJT_QMAP_SHARED_MEMORY_KEY=mem_qmap-test_wsjtx_live_audio_ft8") + if (NOT APPLE) + list (APPEND wsjtx_live_audio_test_environment + "TMPDIR=${wsjtx_live_audio_test_root}/tmp") + endif () + if (WSJT_ENABLE_TSAN) + list (APPEND wsjtx_live_audio_test_environment + "TSAN_OPTIONS=${wsjt_tsan_gui_options}") + endif () + add_test ( + NAME test_wsjtx_live_audio_ft8 + COMMAND $ + --live-audio-test + "${CMAKE_SOURCE_DIR}/samples/FT8/210703_133430.wav" + --live-audio-expected + "${CMAKE_SOURCE_DIR}/test/fixtures/ft8_210703_133430_mtd.expected.txt" + --live-audio-data-dir + "${CMAKE_SOURCE_DIR}" + --rig-name CTEST-LIVE-AUDIO) + set_tests_properties (test_wsjtx_live_audio_ft8 PROPERTIES + COST 25 + ENVIRONMENT "${wsjtx_live_audio_test_environment}" + LABELS "gui;audio;decoder;integration" + PROCESSORS 1 + TIMEOUT 120) + + set (wsjtx_receive_handoff_test_root + "${CMAKE_BINARY_DIR}/Testing/LiveAudio/test_wsjtx_receive_handoff") + file (MAKE_DIRECTORY + "${wsjtx_receive_handoff_test_root}/config" + "${wsjtx_receive_handoff_test_root}/data" + "${wsjtx_receive_handoff_test_root}/cache" + "${wsjtx_receive_handoff_test_root}/tmp") + set (wsjtx_receive_handoff_test_environment + "XDG_CONFIG_HOME=${wsjtx_receive_handoff_test_root}/config" + "XDG_DATA_HOME=${wsjtx_receive_handoff_test_root}/data" + "XDG_CACHE_HOME=${wsjtx_receive_handoff_test_root}/cache" + "WSJT_QMAP_SHARED_MEMORY_KEY=mem_qmap-test_wsjtx_receive_handoff") + if (NOT APPLE) + list (APPEND wsjtx_receive_handoff_test_environment + "TMPDIR=${wsjtx_receive_handoff_test_root}/tmp") + endif () + if (WSJT_ENABLE_TSAN) + list (APPEND wsjtx_receive_handoff_test_environment + "TSAN_OPTIONS=${wsjt_tsan_gui_options}") + endif () + add_test ( + NAME test_wsjtx_receive_handoff + COMMAND $ + --receive-handoff-test + --rig-name CTEST-RECEIVE-HANDOFF) + set_tests_properties (test_wsjtx_receive_handoff PROPERTIES + ENVIRONMENT "${wsjtx_receive_handoff_test_environment}" + LABELS "gui;audio;integration;receive-handoff" + PROCESSORS 1 + TIMEOUT 30) + + set (wsjtx_jtty_live_audio_test_root + "${CMAKE_BINARY_DIR}/Testing/LiveAudio/test_wsjtx_live_audio_jtty") + add_test ( + NAME test_wsjtx_live_audio_jtty + COMMAND ${CMAKE_COMMAND} + "-DSJTTY=$" + "-DWSJTX=$" + "-DWORK_DIR=${wsjtx_jtty_live_audio_test_root}" + "-DEXPECTED=${CMAKE_SOURCE_DIR}/tests/integration/jtty/live_audio.expected.txt" + -P ${CMAKE_SOURCE_DIR}/tests/integration/jtty/run_live_audio.cmake) + set_tests_properties (test_wsjtx_live_audio_jtty PROPERTIES + COST 21 + LABELS "gui;audio;jtty;integration" + PROCESSORS 1 + TIMEOUT 120) + + set (wsjtx_jtty_tx_loopback_test_root + "${CMAKE_BINARY_DIR}/Testing/LiveAudio/test_wsjtx_jtty_tx_loopback") + add_test ( + NAME test_wsjtx_jtty_tx_loopback + COMMAND ${CMAKE_COMMAND} + "-DWSJTX=$" + "-DWORK_DIR=${wsjtx_jtty_tx_loopback_test_root}" + "-DEXPECTED=${CMAKE_SOURCE_DIR}/tests/integration/jtty/tx_loopback.expected.txt" + -P ${CMAKE_SOURCE_DIR}/tests/integration/jtty/run_tx_loopback.cmake) + set_tests_properties (test_wsjtx_jtty_tx_loopback PROPERTIES + COST 37 + LABELS "gui;audio;jtty;integration" + PROCESSORS 1 + TIMEOUT 180) + + set (wsjtx_ft8_tx_loopback_test_root + "${CMAKE_BINARY_DIR}/Testing/LiveAudio/test_wsjtx_ft8_tx_loopback") + add_test ( + NAME test_wsjtx_ft8_tx_loopback + COMMAND ${CMAKE_COMMAND} + "-DWSJTX=$" + "-DWORK_DIR=${wsjtx_ft8_tx_loopback_test_root}" + "-DEXPECTED=${CMAKE_SOURCE_DIR}/tests/integration/ft8/tx_loopback.expected.txt" + "-DDATA_DIR=${CMAKE_SOURCE_DIR}" + -P ${CMAKE_SOURCE_DIR}/tests/integration/ft8/run_tx_loopback.cmake) + set_tests_properties (test_wsjtx_ft8_tx_loopback PROPERTIES + COST 43 + LABELS "gui;audio;decoder;ft8;integration" + PROCESSORS 2 + TIMEOUT 150) + if (WSJT_ENABLE_TSAN) + set_tests_properties ( + test_wsjtx_live_audio_jtty + test_wsjtx_jtty_tx_loopback + test_wsjtx_ft8_tx_loopback + PROPERTIES ENVIRONMENT "TSAN_OPTIONS=${wsjt_tsan_gui_options}") endif () endif () -target_link_libraries (wsjtx Qt5::SerialPort wsjt_cxx wsjt_qt wsjt_qtmm ${FFTW3_LIBRARIES} ${LIBM_LIBRARIES}) # make a library for WSJT-X UDP servers # add_library (wsjtx_udp SHARED ${UDP_library_CXXSRCS}) add_library (wsjtx_udp-static STATIC ${UDP_library_CXXSRCS}) +wsjt_enable_qt_automoc (wsjtx_udp-static) #target_include_directories (wsjtx_udp # INTERFACE # $ @@ -1786,6 +1288,7 @@ generate_version_info (udp_daemon_VERSION_RESOURCES FILE_DESCRIPTION "Example WSJT-X UDP Message Protocol daemon" ) add_executable (udp_daemon UDPExamples/UDPDaemon.cpp ${udp_daemon_VERSION_RESOURCES}) +wsjt_enable_qt_automoc (udp_daemon) target_link_libraries (udp_daemon wsjtx_udp-static) generate_version_info (wsjtx_app_version_VERSION_RESOURCES @@ -1814,6 +1317,7 @@ add_executable (message_aggregator ${message_aggregator_RESOURCES_RCC} ${message_aggregator_VERSION_RESOURCES} ) +wsjt_enable_qt_automoc (message_aggregator) target_link_libraries (message_aggregator wsjt_qt Qt5::Widgets wsjtx_udp-static) if (WSJT_CREATE_WINMAIN) @@ -1831,173 +1335,7 @@ if (UNIX) endif (NOT APPLE) endif (UNIX) -# -# installation -# -install (TARGETS wsjtx - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - BUNDLE DESTINATION . COMPONENT runtime - ) - -# install (TARGETS wsjtx_udp EXPORT udp -# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -# PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/wsjtx -# ) -# install (TARGETS wsjtx_udp-static EXPORT udp-static -# DESTINATION ${CMAKE_INSTALL_LIBDIR} -# ) - -# install (EXPORT udp NAMESPACE wsjtx:: -# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wsjtx -# ) -# install (EXPORT udp-static NAMESPACE wsjtx:: -# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wsjtx -# ) - -install (TARGETS udp_daemon message_aggregator wsjtx_app_version - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - ) - -install (TARGETS jt9 wsprd fmtave fcal fmeasure - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - ) - -install (TARGETS qmap - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - ) - -if (NOT WSJT_SKIP_MAP65) - install (TARGETS map65 - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - ) -endif () - -if(WSJT_BUILD_UTILS) -install (TARGETS ft8code jt65code jt9code jt4code msk144code - q65code fst4sim ft8sim q65sim EchoCallSim testEchoCall echosim hash22calc cablog - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - ) -endif(WSJT_BUILD_UTILS) - -install (PROGRAMS - ${RIGCTL_EXE} - DESTINATION ${CMAKE_INSTALL_BINDIR} - #COMPONENT runtime - RENAME rigctl-wsjtx${CMAKE_EXECUTABLE_SUFFIX} - ) - -install (PROGRAMS - ${RIGCTLD_EXE} - DESTINATION ${CMAKE_INSTALL_BINDIR} - #COMPONENT runtime - RENAME rigctld-wsjtx${CMAKE_EXECUTABLE_SUFFIX} - ) - -install (PROGRAMS - ${RIGCTLCOM_EXE} - DESTINATION ${CMAKE_INSTALL_BINDIR} - #COMPONENT runtime - RENAME rigctlcom-wsjtx${CMAKE_EXECUTABLE_SUFFIX} - ) - -install (FILES - README - COPYING - AUTHORS - THANKS - NEWS - BUGS - DESTINATION ${CMAKE_INSTALL_DOCDIR} - #COMPONENT runtime - ) - -install (FILES - cty.dat - cty.dat_copyright.txt - grid.dat - sat.dat - contrib/Ephemeris/JPLEPH - eclipse.txt - ALLCALL7.TXT - DESTINATION ${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME} - #COMPONENT runtime - ) - -install (DIRECTORY - example_log_configurations - DESTINATION ${CMAKE_INSTALL_DOCDIR} - FILES_MATCHING REGEX "^.*[^~]$" - #COMPONENT runtime - ) - -if (APPLE) - set (WSJT_SOUND_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}) -else () - set (WSJT_SOUND_DESTINATION ${CMAKE_INSTALL_BINDIR}) -endif () -install (DIRECTORY - ${PROJECT_SOURCE_DIR}/sounds - DESTINATION ${WSJT_SOUND_DESTINATION} - #COMPONENT runtime - ) - -if (WIN32) - # Bundle OpenSSL runtime DLLs from the build environment. - # Qt's QSslSocket loads OpenSSL by filename at runtime; the names depend - # on what Qt was built against (libssl-1_1*.dll for older Qt-on-OpenSSL-1.1, - # libssl-3-x64.dll for current MSYS2 Qt-on-OpenSSL-3). Glob whatever the - # runner provides so SuperFox verification, Update Hamlib, LotW download, - # and eQSL keep working as the build environment advances. - set (_openssl_msys_prefix "$ENV{MSYSTEM_PREFIX}") - if (NOT _openssl_msys_prefix) - set (_openssl_msys_prefix "/mingw64") - endif () - file (GLOB _openssl_runtime_dlls - "${_openssl_msys_prefix}/bin/libssl-*.dll" - "${_openssl_msys_prefix}/bin/libcrypto-*.dll" - ) - if (_openssl_runtime_dlls) - install (FILES ${_openssl_runtime_dlls} - DESTINATION ${CMAKE_INSTALL_BINDIR} - #COMPONENT runtime - ) - else () - message (WARNING - "OpenSSL runtime DLLs not found at ${_openssl_msys_prefix}/bin — " - "TLS features (SuperFox, Update Hamlib, LotW, eQSL) will fail on " - "installs without OpenSSL in PATH." - ) - endif () -endif (WIN32) - -# -# Mac installer files -# -if (APPLE) - install (FILES - Darwin/ReadMe.txt - Darwin/com.wsjtx.sysctl.plist - DESTINATION . - #COMPONENT runtime - ) -endif (APPLE) - -# -# uninstall support -# -configure_file ( - "${CMAKE_CURRENT_SOURCE_DIR}/CMake/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - @ONLY) -add_custom_target (uninstall - "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") +include (CMake/Install.cmake) # creates or updates ${PROJECT_BINARY_DIR}/scs_version.h using cmake script @@ -2006,6 +1344,7 @@ add_custom_target (revisiontag -D SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -D BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -D OUTPUT_DIR=${PROJECT_BINARY_DIR} + -D SOURCE_REVISION=${WSJT_SOURCE_REVISION} -P ${CMAKE_CURRENT_SOURCE_DIR}/CMake/getsvn.cmake VERBATIM BYPRODUCTS scs_version.h @@ -2052,13 +1391,26 @@ if (APPLE) "${CMAKE_POSTFLIGHT_SCRIPT}") configure_file ("${wsjtx_SOURCE_DIR}/Darwin/postupgrade.sh.in" "${CMAKE_POSTUPGRADE_SCRIPT}") + add_custom_command( + TARGET wsjtx POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + $ + $/MacOS/ + COMMENT "Copying jt9 into WSJT-X bundle" + ) endif () -# -# bundle fixup only done in non-Debug configurations -# -if (NOT is_debug_build AND NOT WSJT_SKIP_BUNDLE_FIXUP) +set (wsjt_enable_bundle_fixup FALSE) +if (NOT is_debug_build) + if (WIN32 AND NOT WSJT_SKIP_BUNDLE_FIXUP) + set (wsjt_enable_bundle_fixup TRUE) + elseif (APPLE AND WSJT_MACOS_INSTALL_TIME_FIXUP AND NOT WSJT_SKIP_BUNDLE_FIXUP) + set (wsjt_enable_bundle_fixup TRUE) + endif () +endif () + +if (wsjt_enable_bundle_fixup) # add this sub-sirectory after all install steps and other # sub-directories to ensure that all executables are in-place before # any fixup is done @@ -2087,16 +1439,18 @@ else () # Derive the correct filename for a Debian package because the DEB # generator doesn't do this correctly at present. # - find_program (DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems") - if (DPKG_PROGRAM) - execute_process ( - COMMAND ${DPKG_PROGRAM} --print-architecture - OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - else (DPKG_PROGRAM) - set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE noarch) - endif (DPKG_PROGRAM) + if (NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE) + find_program (DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems") + if (DPKG_PROGRAM) + execute_process ( + COMMAND ${DPKG_PROGRAM} --print-architecture + OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + else (DPKG_PROGRAM) + set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE noarch) + endif (DPKG_PROGRAM) + endif () list (APPEND CPACK_GENERATOR "DEB") endif (DPKG_BUILDER) @@ -2108,17 +1462,23 @@ else () endif () set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "${PROJECT_HOMEPAGE}") +set (CPACK_DEBIAN_PACKAGE_SECTION "hamradio") set (CPACK_DEBIAN_PACKAGE_DEPENDS "libgfortran5 (>=8.3) | libgfortran4 (>=7.3) | libgfortran3 (>=6.3), libfftw3-single3 (>=3.3), libgomp1 (>=6), libqt5serialport5 (>=5.7), libqt5multimedia5-plugins (>=5.7), libqt5widgets5 (>=5.7), libqt5network5 (>=5.7), libqt5printsupport5 (>=5.7), libqt5websockets5 (>=5.7), libqt5sql5-sqlite (>=5.7), libusb-1.0-0 (>=1.0.21), libboost-log1.62.0 (>=1.62.0) | libboost-log1.65.1 (>=1.65.1) | libboost-log1.67.0 (>=1.67.0) | libboost-log1.71.0 (>=1.71.0) | libboost-log1.74.0 (>=1.74.0) | libboost-log1.81.0 (>=1.81.0) | libboost-log1.83.0 (>=1.83.0) | libboost-log1.85.0 (>=1.85.0)") set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) -# Take over data files (icon, samples, docs) from the distro `wsjtx-data`, -# `wsjtx-doc`, `wsjtx-improved-data`, and `wsjtx-improved-doc` binary packages -# so installing this .deb on a system carrying any of them doesn't fail with a -# file conflict and doesn't cascade-remove `js8call` or other consumers. +# The downstream WSJT-X Improved fork uses the same executable, data, and doc +# paths as mainline. Replace its packages so the installations cannot mix, +# while preserving dependencies such as `js8call` through virtual packages. set (CPACK_DEBIAN_PACKAGE_PROVIDES "wsjtx-data (= ${wsjtx_VERSION}), wsjtx-doc (= ${wsjtx_VERSION}), wsjtx-improved-data (= ${wsjtx_VERSION}), wsjtx-improved-doc (= ${wsjtx_VERSION})") -set (CPACK_DEBIAN_PACKAGE_REPLACES "wsjtx-data, wsjtx-doc, wsjtx-improved-data, wsjtx-improved-doc") -set (CPACK_DEBIAN_PACKAGE_CONFLICTS "wsjtx-data (<< ${wsjtx_VERSION}), wsjtx-doc (<< ${wsjtx_VERSION}), wsjtx-improved-data (<< ${wsjtx_VERSION}), wsjtx-improved-doc (<< ${wsjtx_VERSION})") - -set (CPACK_RPM_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) +set (CPACK_DEBIAN_PACKAGE_REPLACES "wsjtx-improved, wsjtx-data, wsjtx-doc, wsjtx-improved-data, wsjtx-improved-doc") +# WSJT-X Improved is a downstream fork, not a versioned upgrade. +# Its packages can compare newer than mainline despite incompatible binaries +# and shared files, so these relationships must not be version-qualified. +set (CPACK_DEBIAN_PACKAGE_BREAKS "wsjtx-improved, wsjtx-improved-data, wsjtx-improved-doc") +set (CPACK_DEBIAN_PACKAGE_CONFLICTS "wsjtx-data (<< ${wsjtx_VERSION}), wsjtx-doc (<< ${wsjtx_VERSION})") + +if (NOT CPACK_RPM_PACKAGE_ARCHITECTURE) + set (CPACK_RPM_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) +endif () set (CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.9, qt5-qtserialport >= 5.9, qt5-qtmultimedia >= 5.9, qt5-qtwebsockets >= 5.9, qt5-qtsvg >= 5.9, libusbx >= 1.0.22, libgfortran >= 7, libgomp >= 7, fftw-libs-single >= 3.3, boost-log >= 1.62") set (CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/share/pixmaps /usr/share/applications /usr/share/man /usr/share/man1) diff --git a/CMakeLists_wsjtx.txt b/CMakeLists_wsjtx.txt deleted file mode 100644 index 8276ad59..00000000 --- a/CMakeLists_wsjtx.txt +++ /dev/null @@ -1,2030 +0,0 @@ -cmake_minimum_required (VERSION 3.7.2 FATAL_ERROR) - -if (APPLE) - # - # The following variables define the portability and compatability attributes of the Mac macOS build - # they are choosen with care and should not be changed without good cause. - # - # Among other things these options are chosen to match the portability and compatability options of the - # Qt framework dylibs which can be checked as follows: - # - # otool -l | grep -A3 LC_VERSION_MIN_MACOSX - # - set (CMAKE_OSX_DEPLOYMENT_TARGET 10.12 - CACHE STRING "Earliest version of macOS supported - -Earliest version we can support with Qt 5.12, C++11 & libc++ is 10.12. -Do not override this if you intend to build an official deployable installer.") -endif (APPLE) - -# -# CMake policies -# -if (POLICY CMP0020) - cmake_policy (SET CMP0020 NEW) # link to Qt winmain on Windows -endif () - -if (POLICY CMP0043) - cmake_policy (SET CMP0043 NEW) # ignore COMPILE_DEFINITIONS_ -endif () - -if (POLICY CMP0048) - cmake_policy (SET CMP0048 NEW) # clear PROJECT_Version_* variables if not set in project() command -endif () - -if (POLICY CMP0063) - cmake_policy (SET CMP0063 NEW) # honour visibility properties for all library types -endif () - -if (POLICY CMP0071) - cmake_policy (SET CMP0071 NEW) # run automoc and autouic on generated sources -endif () - -if (POLICY CMP0075) - cmake_policy (SET CMP0075 NEW) # honour CMAKE_REQUIRED_LIBRARIES in config checks -endif () - -project (wsjtx - VERSION 3.0.0.0 - LANGUAGES C CXX Fortran - ) -set (PROJECT_DESCRIPTION "WSJT-X: Digital Modes for Weak Signal Communications in Amateur Radio") -set (CMAKE_PROJECT_DESCRIPTION ${PROJECT_DESCRIPTION}) -set (CMAKE_AUTOUIC ON) - -# Align windres with the active MinGW gcc to prevent MSYS path mangling -if(MINGW) - # Derive windres.exe from the C compiler's directory (Qt MinGW toolchain) - get_filename_component(_CC_DIR "${CMAKE_C_COMPILER}" DIRECTORY) - find_program(WINDRES_EXECUTABLE NAMES windres.exe windres PATHS "${_CC_DIR}" NO_DEFAULT_PATH) - if(NOT WINDRES_EXECUTABLE) - # Fallback to normal PATH if not found beside gcc - find_program(WINDRES_EXECUTABLE NAMES windres.exe windres) - endif() - if(NOT WINDRES_EXECUTABLE) - message(FATAL_ERROR "windres not found; ensure MinGW bin dir is on PATH") - endif() - - # Use MinGW windres directly; feed it forward-slash paths; avoid bash and MSYS gcc - set(CMAKE_RC_COMPILER "${WINDRES_EXECUTABLE}") - set(CMAKE_RC_COMPILE_OBJECT - " -E env MSYS2_ARG_CONV_EXCL='*' \"\" -O coff \"\" \"\"" - ) -endif() - -# -# Local CMake modules and support files -# -set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake/Modules ${CMAKE_MODULE_PATH}) - -set (PROJECT_ARCHITECTURE "${CMAKE_SYSTEM_PROCESSOR}") -if (NOT PROJECT_ARCHITECTURE) - # This is supposed to happen already on Windows - if (CMAKE_SIZEOF_VOID_P MATCHES 8) - set (PROJECT_ARCHITECTURE "x64") - else () - set (PROJECT_ARCHITECTURE "$ENV{PROCESSOR_ARCHITECTURE}") - endif () -endif () -message (STATUS "******************************************************") -message (STATUS "Building for for: ${CMAKE_SYSTEM_NAME}-${PROJECT_ARCHITECTURE}") -message (STATUS "******************************************************") - -include (set_build_type) -# RC 0 or omitted is a development build, GA is a General Availability release build -set_build_type (RC 1) -set (wsjtx_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${BUILD_TYPE_REVISION}") - -# -# project information -# -set (PROJECT_BUNDLE_NAME "WSJT-X") -set (PROJECT_VENDOR "Joe Taylor, K1JT") -set (PROJECT_CONTACT "Joe Taylor ") -set (PROJECT_COPYRIGHT "Copyright (C) 2001-2025 by Joe Taylor, K1JT") -set (PROJECT_HOMEPAGE https://wsjt.sourceforge.io/wsjtx.html) -set (PROJECT_MANUAL wsjtx-main) -set (PROJECT_MANUAL_DIRECTORY_URL https://wsjt.sourceforge.io/wsjtx-doc/) -set (PROJECT_SAMPLES_URL http://downloads.sourceforge.net/project/wsjt/) -set (PROJECT_SAMPLES_UPLOAD_DEST frs.sourceforge.net:/home/frs/project/wsjt/) - -# make sure that the default configuration is a RELEASE -if (NOT CMAKE_BUILD_TYPE) - set (CMAKE_BUILD_TYPE RELEASE CACHE STRING - "Choose the type of build, options are: None Debug Release." - FORCE) -endif (NOT CMAKE_BUILD_TYPE) -if (CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]") - set (is_debug_build 1) -endif () - -#uncomment line below to test for Qt 5.15.2 and later deprecations -#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050F00) - -# -# Options & features -# -# Some of these directly effect compilation by being defined in -# wsjtx_config.h.in which makes them available to the C/C++ -# pre-processor. -# -include (CMakeDependentOption) - -# Allow the developer to select if Dynamic or Static libraries are built -OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" OFF) -# Set the LIB_TYPE variable to STATIC -SET (LIB_TYPE STATIC) -if (BUILD_SHARED_LIBS) - # User wants to build Dynamic Libraries, so change the LIB_TYPE variable to CMake keyword 'SHARED' - set (LIB_TYPE SHARED) -endif (BUILD_SHARED_LIBS) - -option (UPDATE_TRANSLATIONS "Update source translation translations/*.ts -files (WARNING: make clean will delete the source .ts files! Danger!)") -option (WSJT_SHARED_RUNTIME "Debugging option that allows running from a shared Cloud directory.") -option (WSJT_QDEBUG_TO_FILE "Redirect Qt debuging messages to a trace file.") -option (WSJT_TRACE_CAT "Debugging option that turns on CAT diagnostics.") -option (WSJT_TRACE_CAT_POLLS "Debugging option that turns on CAT diagnostics during polling.") -option (WSJT_SOFT_KEYING "Apply a ramp to CW keying envelope to reduce transients." ON) -option (WSJT_SKIP_MANPAGES "Skip *nix manpage generation.") -option (WSJT_GENERATE_DOCS "Generate documentation files." ON) -option (WSJT_RIG_NONE_CAN_SPLIT "Allow split operation with \"None\" as rig.") -option (WSJT_TRACE_UDP "Debugging option that turns on UDP message protocol diagnostics.") -option (WSJT_BUILD_UTILS "Build simulators and code demonstrators." ON) -option (WSJT_FOX_OTP "Enable Fox OTP Verification Messages." ON) -CMAKE_DEPENDENT_OPTION (WSJT_QDEBUG_IN_RELEASE "Leave Qt debugging statements in Release configuration." OFF - "NOT is_debug_build" OFF) -CMAKE_DEPENDENT_OPTION (WSJT_ENABLE_EXPERIMENTAL_FEATURES "Enable features not fully ready for public releases." ON - is_debug_build OFF) -CMAKE_DEPENDENT_OPTION (WSJT_CREATE_WINMAIN - "The wsjtx target is normally built as GUI executable with a WinMain entry point on Windows, -if you want a console application instead then set this option to OFF. - -If you just want to see the debug output from the application then the easiest way is to -attach a debugger which will then receive the console output inside its console." ON - "WIN32" OFF) - -# -# install locations -# - -if (APPLE) - set (CMAKE_INSTALL_BINDIR ${CMAKE_PROJECT_NAME}.app/Contents/MacOS) - set (CMAKE_INSTALL_DATAROOTDIR ${CMAKE_PROJECT_NAME}.app/Contents/Resources) -endif () - -include (GNUInstallDirs) - -set (PLUGIN_DESTINATION ${CMAKE_INSTALL_LIBDIR}/plugins) -set (QT_CONF_DESTINATION ${CMAKE_INSTALL_BINDIR}) -if (WIN32) - set (PLUGIN_DESTINATION plugins) -elseif (APPLE) - set (PLUGIN_DESTINATION ${CMAKE_INSTALL_BINDIR}/../PlugIns) - set (QT_CONF_DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}) -endif () - -set (WSJT_PLUGIN_DESTINATION ${PLUGIN_DESTINATION} CACHE PATH "Path for plugins") -set (WSJT_QT_CONF_DESTINATION ${QT_CONF_DESTINATION} CACHE PATH "Path for the qt.conf file") - -if (WSJT_FOX_OTP) - set (wsjt_fox_CXXSRCS - ) - message (STATUS "Including Fox verification code feature") -endif () - -# -# Project sources -# -set (fort_qt_CXXSRCS - lib/shmem.cpp - ) - -set (wsjt_qt_CXXSRCS - helper_functions.cpp - qt_helpers.cpp - widgets/MessageBox.cpp - MetaDataRegistry.cpp - Network/NetworkServerLookup.cpp - revision_utils.cpp - L10nLoader.cpp - WFPalette.cpp - Radio.cpp - RadioMetaType.cpp - NonInheritingProcess.cpp - models/IARURegions.cpp - models/Bands.cpp - models/Modes.cpp - models/FrequencyList.cpp - models/StationList.cpp - widgets/FrequencyLineEdit.cpp - widgets/FrequencyDeltaLineEdit.cpp - item_delegates/CandidateKeyFilter.cpp - item_delegates/ForeignKeyDelegate.cpp - item_delegates/MessageItemDelegate.cpp - validators/LiveFrequencyValidator.cpp - GetUserId.cpp - Audio/AudioDevice.cpp - Transceiver/Transceiver.cpp - Transceiver/TransceiverBase.cpp - Transceiver/EmulateSplitTransceiver.cpp - Transceiver/TransceiverFactory.cpp - Transceiver/PollingTransceiver.cpp - Transceiver/HamlibTransceiver.cpp - Transceiver/TCITransceiver.cpp - Transceiver/HRDTransceiver.cpp - Transceiver/DXLabSuiteCommanderTransceiver.cpp - Network/NetworkMessage.cpp - Network/MessageClient.cpp - widgets/LettersSpinBox.cpp - widgets/HintedSpinBox.cpp - widgets/RestrictedSpinBox.cpp - widgets/HelpTextWindow.cpp - SampleDownloader.cpp - SampleDownloader/DirectoryDelegate.cpp - SampleDownloader/Directory.cpp - SampleDownloader/FileNode.cpp - SampleDownloader/RemoteFile.cpp - DisplayManual.cpp - MultiSettings.cpp - validators/MaidenheadLocatorValidator.cpp - validators/CallsignValidator.cpp - widgets/SplashScreen.cpp - EqualizationToolsDialog.cpp - widgets/DoubleClickablePushButton.cpp - widgets/DoubleClickableRadioButton.cpp - mycustomspinbox.cpp - Network/LotWUsers.cpp - Network/FileDownload.cpp - Network/FoxVerifier.cpp - Network/Cloudlog.cpp - Network/eqsl.cpp - models/DecodeHighlightingModel.cpp - widgets/DecodeHighlightingListView.cpp - models/FoxLog.cpp - widgets/AbstractLogWindow.cpp - widgets/FoxLogWindow.cpp - widgets/CabrilloLogWindow.cpp - item_delegates/CallsignDelegate.cpp - item_delegates/MaidenheadLocatorDelegate.cpp - item_delegates/FrequencyDelegate.cpp - item_delegates/FrequencyDeltaDelegate.cpp - item_delegates/SQLiteDateTimeDelegate.cpp - models/CabrilloLog.cpp - logbook/AD1CCty.cpp - logbook/WorkedBefore.cpp - logbook/Multiplier.cpp - Network/NetworkAccessManager.cpp - widgets/LazyFillComboBox.cpp - widgets/CheckableItemComboBox.cpp - widgets/BandComboBox.cpp - otpgenerator.cpp - ) - -set (wsjt_qtmm_CXXSRCS - Audio/BWFFile.cpp - ) - -set (jt9_FSRCS - lib/jt9.f90 - lib/jt9a.f90 - ) - -set (wsjtx_CXXSRCS - WSJTXLogging.cpp - logbook/logbook.cpp - Network/PSKReporter.cpp - Modulator/Modulator.cpp - Detector/Detector.cpp - widgets/logqso.cpp - widgets/displaytext.cpp - Decoder/decodedtext.cpp - getfile.cpp - Audio/soundout.cpp - Audio/soundin.cpp - widgets/meterwidget.cpp - widgets/signalmeter.cpp - widgets/plotter.cpp - widgets/widegraph.cpp - widgets/echograph.cpp - widgets/echoplot.cpp - widgets/fastgraph.cpp - widgets/fastplot.cpp - widgets/about.cpp - widgets/astro.cpp - widgets/messageaveraging.cpp - widgets/activeStations.cpp - widgets/colorhighlighting.cpp - WSPR/WsprTxScheduler.cpp - widgets/mainwindow.cpp - Configuration.cpp - main.cpp - Network/wsprnet.cpp - WSPR/WSPRBandHopping.cpp - widgets/ExportCabrillo.cpp - widgets/QSYMessage.cpp - widgets/QSYMessageCreator.cpp - widgets/qsymonitor.cpp - ) - -if (${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") - set_source_files_properties ( - widgets/plotter.cpp - widgets/mainwindow.cpp - PROPERTIES COMPILE_FLAGS "-Wno-vla-extension") -endif () - -set (wsjt_CXXSRCS - Logger.cpp - lib/crc10.cpp - lib/crc13.cpp - lib/crc14.cpp - ${wsjt_fox_CXXSRCS} - ) -# deal with a GCC v6 UB error message -set_source_files_properties ( - lib/crc10.cpp - lib/crc13.cpp - lib/crc14.cpp - PROPERTIES COMPILE_FLAGS -fpermissive) - -if (WIN32) - set (wsjt_CXXSRCS - ${wsjt_CXXSRCS} - killbyname.cpp - ) - - set (wsjt_qt_CXXSRCS - ${wsjt_qt_CXXSRCS} - Transceiver/OmniRigTransceiver.cpp - ) -endif (WIN32) - -set (wsjt_FSRCS - # put module sources first in the hope that they get rebuilt before use - lib/types.f90 - lib/C_interface_module.f90 - lib/shmem.f90 - lib/crc.f90 - lib/fftw3mod.f90 - lib/hashing.f90 - lib/iso_c_utilities.f90 - lib/jt4.f90 - lib/jt4_decode.f90 - lib/jt65_decode.f90 - lib/jt65_mod.f90 - lib/jt65_mod6.f90 #ft8md - lib/ft8_decode.f90 - lib/ft4_decode.f90 - lib/fst4_decode.f90 - lib/get_q3list.f90 - lib/jt9_decode.f90 - lib/options.f90 - lib/packjt.f90 - lib/77bit/packjt77.f90 - lib/qra/q65/q65.f90 - lib/q65_decode.f90 - lib/readwav.f90 - lib/timer_C_wrapper.f90 - lib/timer_impl.f90 - lib/timer_module.f90 - lib/wavhdr.f90 - lib/qra/q65/q65_encoding_modules.f90 - lib/ft8/ft8_a7.f90 - lib/ft8/ft8_a8d.f90 - lib/superfox/sfox_mod.f90 - lib/superfox/julian.f90 - lib/superfox/popen_module.f90 - lib/superfox/qpc/qpc_mod.f90 - lib/ft8var/ft8_decodevar.f90 - - # remaining non-module sources - lib/addit.f90 - lib/afc65b.f90 - lib/afc9.f90 - lib/ana64.f90 - lib/ana932.f90 - lib/analytic.f90 - lib/astro.f90 - lib/astrosub.f90 - lib/astro0.f90 - lib/avecho.f90 - lib/averms.f90 - lib/azdist.f90 - lib/ft8/baseline.f90 - lib/ft4/ft4_baseline.f90 - lib/blanker.f90 - lib/bpdecode40.f90 - lib/bpdecode128_90.f90 - lib/ft8/bpdecode174_91.f90 - lib/baddata.f90 - lib/cablog.f90 - lib/calibrate.f90 - lib/ccf2.f90 - lib/ccf65.f90 - lib/ft8/chkcrc13a.f90 - lib/ft8/chkcrc14a.f90 - lib/chkcall.f90 - lib/chkhist.f90 - lib/chkmsg.f90 - lib/chkss2.f90 - lib/ft4/clockit.f90 - lib/ft8/compress.f90 - lib/coord.f90 - lib/db.f90 - lib/decode4.f90 - lib/decode65a.f90 - lib/decode65b.f90 - lib/decode9w.f90 - lib/decode_echo.f90 - lib/ft8/decode174_91.f90 - lib/decoder.f90 - lib/env_module.f90 - lib/deep4.f90 - lib/deg2grid.f90 - lib/degrade_snr.f90 - lib/demod64a.f90 - lib/determ.f90 - lib/downsam9.f90 - lib/echosim.f90 - lib/echo_snr.f90 - lib/encode232.f90 - lib/encode4.f90 - lib/encode_msk40.f90 - lib/encode_128_90.f90 - lib/ft8/encode174_91.f90 - lib/ft8/encode174_91_nocrc.f90 - lib/entail.f90 - lib/ephem.f90 - lib/extract.f90 - lib/extract4.f90 - lib/extractmessage77.f90 - lib/fano232.f90 - lib/fast9.f90 - lib/fast_decode.f90 - lib/fchisq.f90 - lib/fchisq0.f90 - lib/fchisq65.f90 - lib/fil3.f90 - lib/fil3c.f90 - lib/fil4.f90 - lib/fil6521.f90 - lib/filbig.f90 - lib/ft8/filt8.f90 - lib/fitcal.f90 - lib/flat1.f90 - lib/flat1a.f90 - lib/flat1b.f90 - lib/flat2.f90 - lib/flat4.f90 - lib/flat65.f90 - lib/fmtmsg.f90 - lib/foldspec9f.f90 - lib/four2a.f90 - lib/fspread_lorentz.f90 - lib/ft8/foxfilt.f90 - lib/ft8/foxgen.f90 -# lib/ft8/foxgen_wrap.f90 - lib/freqcal.f90 - lib/ft8/ft8apset.f90 - lib/ft8/ft8b.f90 - lib/ft8/ft8code.f90 - lib/ft8/ft8_downsample.f90 - lib/ft8/ft8sim.f90 - lib/gen4.f90 - lib/gen65.f90 - lib/gen9.f90 - lib/gen_cw_wave.f90 - lib/gen_echocall.f90 - lib/genwave.f90 - lib/ft8/genft8.f90 - lib/qra/q65/genq65.f90 - lib/genmsk_128_90.f90 - lib/genmsk40.f90 - lib/ft4/ft4code.f90 - lib/ft4/genft4.f90 - lib/ft4/gen_ft4wave.f90 - lib/ft8/gen_ft8wave.f90 - lib/ft8/genft8refsig.f90 - lib/genwspr.f90 - lib/geodist.f90 - lib/ft8/get_crc14.f90 - lib/getlags.f90 - lib/getmet4.f90 - lib/ft8/get_spectrum_baseline.f90 - lib/ft2/gfsk_pulse.f90 - lib/graycode.f90 - lib/graycode65.f90 - lib/grayline.f90 - lib/grid2deg.f90 - lib/ft8/h1.f90 - lib/hash.f90 - lib/hint65.f90 - lib/hspec.f90 - lib/indexx.f90 - lib/init_random_seed.f90 - lib/interleave4.f90 - lib/interleave63.f90 - lib/interleave9.f90 - lib/inter_wspr.f90 - lib/jplsubs.f - lib/jt9fano.f90 - lib/libration.f90 - lib/lorentzian.f90 - lib/fst4/lorentzian_fading.f90 - lib/lpf1.f90 - lib/map65_mmdec.f90 - lib/mixlpf.f90 - lib/makepings.f90 - lib/moondopjpl.f90 - lib/morse.f90 - lib/move.f90 - lib/msk40decodeframe.f90 - lib/msk144decodeframe.f90 - lib/msk40spd.f90 - lib/msk144spd.f90 - lib/msk40sync.f90 - lib/msk144sync.f90 - lib/msk40_freq_search.f90 - lib/msk144_freq_search.f90 - lib/mskrtd.f90 - lib/msk144signalquality.f90 - lib/msk144sim.f90 - lib/mskrtd.f90 - lib/nuttal_window.f90 - lib/decode_msk144.f90 - lib/ft4/ft4sim.f90 - lib/ft4/ft4sim_mult.f90 - lib/ft4/ft4_downsample.f90 - lib/77bit/my_hash.f90 - lib/wsprd/osdwspr.f90 - lib/ft8/osd174_91.f90 - lib/osd128_90.f90 - lib/pctile.f90 - lib/peakdt9.f90 - lib/peakup.f90 - lib/plotsave.f90 - lib/platanh.f90 - lib/pltanh.f90 - lib/polyfit.f90 - lib/prog_args.f90 - lib/ps4.f90 - lib/qra/q65/q65_ap.f90 - lib/qra/q65/q65_loops.f90 - lib/qra/q65/q65_set_list.f90 - lib/qra/q65/q65_set_list2.f90 - lib/refspectrum.f90 - lib/savec2.f90 - lib/save_dxbase.f90 - lib/save_echo_params.f90 - lib/sec0.f90 - lib/sec_midn.f90 - lib/setup65.f90 - lib/sh65.f90 - lib/sh65snr.f90 - lib/slasubs.f - lib/sleep_msec.f90 - lib/slope.f90 - lib/smo.f90 - lib/smo121.f90 - lib/softsym.f90 - lib/softsym9f.f90 - lib/softsym9w.f90 - lib/shell.f90 - lib/spec64.f90 - lib/spec9f.f90 - lib/stdmsg.f90 - lib/subtract65.f90 - lib/ft8/subtractft8.f90 - lib/ft4/subtractft4.f90 - lib/sun.f90 - lib/symspec.f90 - lib/symspec2.f90 - lib/symspec65.f90 - lib/sync4.f90 - lib/sync65.f90 - lib/ft4/getcandidates4.f90 - lib/ft4/get_ft4_bitmetrics.f90 - lib/ft8/sync8.f90 - lib/ft8/sync8d.f90 - lib/ft4/sync4d.f90 - lib/sync9.f90 - lib/sync9f.f90 - lib/sync9w.f90 - lib/test_snr.f90 - lib/timf2.f90 - lib/tweak1.f90 - lib/twkfreq.f90 - lib/ft8/twkfreq1.f90 - lib/twkfreq65.f90 - lib/update_recent_calls.f90 - lib/update_msk40_hasharray.f90 - lib/ft8/watterson.f90 - lib/wav11.f90 - lib/wav12.f90 - lib/xcor.f90 - lib/xcor4.f90 - lib/wqdecode.f90 - lib/wqencode.f90 - lib/wspr_downsample.f90 - lib/zplot9.f90 - lib/fst4/decode240_101.f90 - lib/fst4/decode240_74.f90 - lib/fst4/encode240_101.f90 - lib/fst4/encode240_74.f90 - lib/fst4/fst4sim.f90 - lib/fst4/gen_fst4wave.f90 - lib/fst4/genfst4.f90 - lib/fst4/get_fst4_bitmetrics.f90 - lib/fst4/get_fst4_bitmetrics2.f90 - lib/fst4/ldpcsim240_101.f90 - lib/fst4/ldpcsim240_74.f90 - lib/fst4/osd240_101.f90 - lib/fst4/osd240_74.f90 - lib/fst4/fastosd240_74.f90 - lib/fst4/get_crc24.f90 - lib/fst4/fst4_baseline.f90 - lib/77bit/hash22calc.f90 - lib/ft8var/agccft8.f90 - lib/ft8var/baddatavar.f90 - lib/ft8var/bpdecode174_91var.f90 - lib/ft8var/chkfalse8var.f90 - lib/ft8var/chkflscallvar.f90 - lib/ft8var/chkgridvar.f90 - lib/ft8var/chklong8.f90 - lib/ft8var/chkspecial8var.f90 - lib/ft8var/cwfilter.f90 - lib/ft8var/datacor.f90 - lib/ft8var/encode174_91var.f90 - lib/ft8var/extract_callvar.f90 - lib/ft8var/filbigvar.f90 - lib/ft8var/fillhashvar.f90 - lib/ft8var/filtersfreevar.f90 - lib/ft8var/four2avar.f90 - lib/ft8var/ft4_mod1.f90 - lib/ft8var/ft8apsetvar.f90 - lib/ft8var/ft8bvar.f90 - lib/ft8var/ft8_downsamplevar.f90 - lib/ft8var/ft8_mod1.f90 - lib/ft8var/ft8mf1var.f90 - lib/ft8var/ft8mfcqvar.f90 - lib/ft8var/ft8svar.f90 - lib/ft8var/ft8sdvar.f90 - lib/ft8var/ft8sd1var.f90 - lib/ft8var/genft8var.f90 - lib/ft8var/gen_ft8wavevar.f90 - lib/ft8var/genft8sdvar.f90 - lib/ft8var/jt65_mod2var.f90 - lib/ft8var/jt65_mod5.f90 - lib/ft8var/jt65_mod9.f90 - lib/ft8var/msgparservar.f90 - lib/ft8var/osd174_91var.f90 - lib/ft8var/packjt77sdvar.f90 - lib/ft8var/partint.f90 - lib/ft8var/partintft8.f90 - lib/ft8var/rms_augapvar.f90 - lib/ft8var/searchcallsvar.f90 - lib/ft8var/subtractft8var.f90 - lib/ft8var/sync8var.f90 - lib/ft8var/sync8dvar.f90 - lib/ft8var/tone8.f90 - lib/ft8var/tone8myc.f90 - lib/ft8var/tonesdvar.f90 - lib/ft8var/twkfreq1var.f90 - lib/superfox/foxgen2.f90 - lib/superfox/qpc_decode2.f90 - lib/superfox/qpc_likelihoods2.f90 - lib/superfox/qpc_snr.f90 - lib/superfox/qpc_sync.f90 - lib/superfox/sfox_ana.f90 - lib/superfox/sfox_assemble.f90 - lib/superfox/sfox_demod.f90 - lib/superfox/sfox_pack.f90 - lib/superfox/sfox_remove_ft8.f90 - lib/superfox/sfox_remove_tone.f90 - lib/superfox/sfox_unpack.f90 - lib/superfox/sfox_wave.f90 - lib/superfox/sfox_wave_gfsk.f90 - lib/superfox/sfrx_sub.f90 - lib/superfox/sftx_sub.f90 - lib/superfox/twkfreq2.f90 - lib/superfox/sfox_gen_gfsk.f90 - lib/superfox/ran1.f90 - lib/superfox/sfoxsim.f90 - ) - -# temporary workaround for a gfortran v7.3 ICE on Fedora 27 64-bit -set_source_files_properties (lib/slasubs.f PROPERTIES COMPILE_FLAGS -O2) - -set (ka9q_CSRCS - lib/ftrsd/decode_rs.c - lib/ftrsd/encode_rs.c - lib/ftrsd/init_rs.c - ) -set_source_files_properties (${ka9q_CSRCS} PROPERTIES COMPILE_FLAGS -Wno-sign-compare) - -set (qra_CSRCS - lib/qra/qracodes/qra12_63_64_irr_b.c - lib/qra/qracodes/qra13_64_64_irr_e.c - lib/qra/q65/npfwht.c - lib/qra/q65/pdmath.c - lib/qra/q65/qracodes.c - lib/qra/q65/normrnd.c - lib/qra/q65/qra15_65_64_irr_e23.c - lib/qra/q65/q65.c - lib/qra/q65/q65_subs.c - ) - -set (wsjt_CSRCS - ${ka9q_CSRCS} - lib/ftrsd/ftrsdap.c - lib/sgran.c - lib/golay24_table.c - lib/gran.c - lib/igray.c - lib/init_random_seed.c - lib/ldpc32_table.c - lib/wsprd/nhash.c - lib/tab.c - lib/tmoonsub.c - lib/usleep.c - lib/vit213.c - lib/wisdom.c - lib/wrapkarn.c - ${ldpc_CSRCS} - ${qra_CSRCS} - - lib/superfox/qpc/dbgprintf.c - lib/superfox/qpc/nhash2.c - lib/superfox/qpc/np_qpc.c - lib/superfox/qpc/np_rnd.c - lib/superfox/qpc/qpc_fwht.c - lib/superfox/qpc/qpc_n127k50q128.c - lib/superfox/qpc/qpc_subs.c - - ) - -set (wsjt_qt_UISRCS - wf_palette_design_dialog.ui - widgets/FoxLogWindow.ui - widgets/CabrilloLogWindow.ui - ) - -set (wsprsim_CSRCS - lib/wsprd/wsprsim.c - lib/wsprd/wsprsim_utils.c - lib/wsprd/wsprd_utils.c - lib/wsprd/fano.c - lib/wsprd/tab.c - lib/wsprd/nhash.c - ) - -set (wsprd_CSRCS - lib/wsprd/wsprd.c - lib/wsprd/wsprsim_utils.c - lib/wsprd/wsprd_utils.c - lib/wsprd/fano.c - lib/wsprd/jelinek.c - lib/wsprd/tab.c - lib/wsprd/nhash.c - lib/init_random_seed.c - ) - -set (wsjtx_UISRCS - widgets/mainwindow.ui - widgets/about.ui - widgets/astro.ui - widgets/colorhighlighting.ui - widgets/echograph.ui - widgets/fastgraph.ui - widgets/messageaveraging.ui - widgets/activeStations.ui - widgets/widegraph.ui - widgets/logqso.ui - Configuration.ui - widgets/ExportCabrillo.ui - widgets/QSYMessage.ui - widgets/QSYMessageCreator.ui - widgets/qsymonitor.ui - ) - -set (UDP_library_CXXSRCS - Radio.cpp - RadioMetaType.cpp - Network/NetworkMessage.cpp - UDPExamples/MessageServer.cpp - ) - -set (UDP_library_HEADERS - Radio.hpp - UDPExamples/MessageServer.hpp - ${PROJECT_BINARY_DIR}/udp_export.h - ) - -set (message_aggregator_CXXSRCS - UDPExamples/MessageAggregator.cpp - UDPExamples/MessageAggregatorMainWindow.cpp - UDPExamples/DecodesModel.cpp - UDPExamples/BeaconsModel.cpp - UDPExamples/ClientWidget.cpp - validators/MaidenheadLocatorValidator.cpp - ) - -set (message_aggregator_STYLESHEETS - UDPExamples/qss/default.qss - ) - -set (qcp_CXXSRCS - qcustomplot-source/qcustomplot.cpp - ) - -set (all_CXXSRCS - ${wsjt_CXXSRCS} - ${fort_qt_CXXSRCS} - ${wsjt_qt_CXXSRCS} - ${wsjt_qtmm_CXXSRCS} - ${wsjtx_CXXSRCS} - ${qcp_CXXSRCS} - ) - -set (all_C_and_CXXSRCS - ${wsjt_CSRCS} - ${wsprsim_CSRCS} - ${wsprd_CSRCS} - ${all_CXXSRCS} - ) - -set (TOP_LEVEL_RESOURCES - icons/Darwin/wsjtx.iconset/icon_128x128.png - contrib/gpl-v3-logo.svg - artwork/splash.png - ) - -set (PALETTE_FILES - Palettes/Banana.pal - Palettes/Blue1.pal - Palettes/Blue2.pal - Palettes/Blue3.pal - Palettes/Brown.pal - Palettes/Cyan1.pal - Palettes/Cyan2.pal - Palettes/Cyan3.pal - Palettes/Default.pal - Palettes/Digipan.pal - Palettes/Fldigi.pal - Palettes/Gray1.pal - Palettes/Gray2.pal - Palettes/Green1.pal - Palettes/Green2.pal - Palettes/Jungle.pal - Palettes/Linrad.pal - Palettes/W9MDB.pal - Palettes/Negative.pal - Palettes/Orange.pal - Palettes/Pink.pal - Palettes/Rainbow.pal - Palettes/Scope.pal - Palettes/Sunburst.pal - Palettes/VK4BDJ.pal - Palettes/YL2KF.pal - Palettes/Yellow1.pal - Palettes/Yellow2.pal - Palettes/ZL1FZ.pal -) - -if (APPLE) - set (WSJTX_ICON_FILE ${CMAKE_PROJECT_NAME}.icns) - set (ICONSRCS - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_16x16.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_16x16@2x.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_32x32.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_32x32@2x.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_128x128.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_128x128@2x.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_256x256.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_256x256@2x.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_512x512.png - icons/Darwin/${CMAKE_PROJECT_NAME}.iconset/icon_512x512@2x.png - ) - add_custom_command ( - OUTPUT ${WSJTX_ICON_FILE} - COMMAND iconutil -c icns --output "${CMAKE_BINARY_DIR}/${WSJTX_ICON_FILE}" "${CMAKE_SOURCE_DIR}/icons/Darwin/${CMAKE_PROJECT_NAME}.iconset" - DEPENDS ${ICONSRCS} - COMMENT "Building Icons" - ) -else () - set (WSJTX_ICON_FILE icons/windows-icons/wsjtx.ico) -endif (APPLE) - -set_source_files_properties (${WSJTX_ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - -# suppress intransigent compiler diagnostics -set_source_files_properties (lib/decoder.f90 PROPERTIES COMPILE_FLAGS "-Wno-unused-dummy-argument") -set_source_files_properties (lib/filbig.f90 PROPERTIES COMPILE_FLAGS "-Wno-aliasing") - -## disable Qt trace and warning messages from release configurations -# set_property (DIRECTORY APPEND PROPERTY -# COMPILE_DEFINITIONS $<$>:QT_NO_DEBUG_OUTPUT;QT_NO_WARNING_OUTPUT> -# ) - -set_property (SOURCE ${all_C_and_CXXSRCS} APPEND_STRING PROPERTY COMPILE_FLAGS " -include wsjtx_config.h") -set_property (SOURCE ${all_C_and_CXXSRCS} APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/wsjtx_config.h) - -if (WIN32) - # generate the OmniRig COM interface source - find_program (DUMPCPP dumpcpp) - if (DUMPCPP-NOTFOUND) - message (FATAL_ERROR "dumpcpp tool not found") - endif (DUMPCPP-NOTFOUND) - execute_process ( - COMMAND ${DUMPCPP} -getfile {4FE359C5-A58F-459D-BE95-CA559FB4F270} - OUTPUT_VARIABLE AXSERVER - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - string (STRIP "${AXSERVER}" AXSERVER) - if (NOT AXSERVER) - message (FATAL_ERROR "You need to install OmniRig on this computer") - endif (NOT AXSERVER) - string (REPLACE "\"" "" AXSERVER ${AXSERVER}) - file (TO_CMAKE_PATH ${AXSERVER} AXSERVERSRCS) -endif () - - -# -# decide on platform specifc packing and fixing up -# -if (APPLE) - set (WSJTX_BUNDLE_VERSION ${wsjtx_VERSION}) - - # make sure CMAKE_INSTALL_PREFIX ends in / - string (LENGTH "${CMAKE_INSTALL_PREFIX}" LEN) - math (EXPR LEN "${LEN} -1" ) - string (SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH) - if (NOT "${ENDCH}" STREQUAL "/") - set (CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/") - endif () -endif (APPLE) - - -# -# find some useful tools -# -include (CheckTypeSize) -include (CheckCSourceCompiles) -include (CheckIncludeFiles) -include (CheckSymbolExists) -include (generate_version_info) - -find_program(CTAGS ctags) -find_program(ETAGS etags) - -# -# Platform checks -# -check_include_files ("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS) -check_include_files (stdio.h HAVE_STDIO_H) -check_include_files (stdlib.h HAVE_STDLIB_H) -check_include_files (unistd.h HAVE_UNISTD_H) -check_include_files (sys/ioctl.h HAVE_SYS_IOCTL_H) -check_include_files (sys/types.h HAVE_SYS_TYPES_H) -check_include_files (fcntl.h HAVE_FCNTL_H) -check_include_files (sys/stat.h HAVE_SYS_STAT_H) -check_include_files ("linux/ppdev.h;linux/parport.h" HAVE_LINUX_PPDEV_H) -check_include_files ("dev/ppbus/ppi.h;dev/ppbus/ppbconf.h" HAVE_DEV_PPBUS_PPI_H) - -# -# Standard C Math Library -# -set (LIBM_TEST_SOURCE "#include\nfloat f; int main(){sqrt(f);return 0;}") -check_c_source_compiles ("${LIBM_TEST_SOURCE}" HAVE_MATH) -if (HAVE_MATH) - set (LIBM_LIBRARIES) -else () - set (CMAKE_REQUIRED_LIBRARIES m) - check_c_source_compiles ("${LIBM_TEST_SOURCE}" HAVE_LIBM_MATH) - unset (CMAKE_REQUIRED_LIBRARIES) - if (NOT HAVE_LIBM_MATH) - message (FATAL_ERROR "Unable to use C math library functions") - endif () - set (LIBM_LIBRARIES m) -endif () - -# -# Boost -# -if (WIN32) - set (Boost_USE_STATIC_LIBS OFF) -endif () -find_package (Boost 1.62 REQUIRED COMPONENTS log_setup log) - -# -# OpenMP -# -find_package (OpenMP) - -# -# fftw3 single precision library -# -find_package (FFTW3 COMPONENTS single threads REQUIRED) - -# -# hamlib setup -# -find_package (Hamlib REQUIRED) -find_program (RIGCTL_EXE rigctl) -find_program (RIGCTLD_EXE rigctld) -find_program (RIGCTLCOM_EXE rigctlcom) - -check_type_size (CACHE_ALL HAMLIB_OLD_CACHING) -check_symbol_exists (rig_set_cache_timeout_ms "hamlib/rig.h" HAVE_HAMLIB_CACHING) - -find_package (Usb REQUIRED) - -if (WSJT_FOX_OTP) - add_definitions (-DFOX_OTP) -endif () - -# -# Qt5 setup -# - -# Widgets finds its own dependencies. -find_package (Qt5 COMPONENTS Widgets SerialPort Multimedia PrintSupport Sql LinguistTools WebSockets REQUIRED) - -if (WIN32) - add_definitions (-DQT_NEEDS_QTMAIN) - find_package (Qt5AxContainer REQUIRED) -endif (WIN32) - -# -# Library building setup -# -include (GenerateExportHeader) -set (CMAKE_CXX_VISIBILITY_PRESET hidden) -set (CMAKE_C_VISIBILITY_PRESET hidden) -set (CMAKE_Fortran_VISIBILITY_PRESET hidden) -set (CMAKE_VISIBILITY_INLINES_HIDDEN ON) -#set (CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) - - -# -# C & C++ setup -# -set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra") - -set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -fexceptions -frtti") - -if (NOT APPLE) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragmas") - if (${OPENMP_FOUND}) - if (OpenMP_C_FLAGS) - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_C_FLAGS}") - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") - endif () - endif () - set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fdata-sections -ffunction-sections") - set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -fdata-sections -ffunction-sections") - set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fdata-sections -ffunction-sections") - set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -fdata-sections -ffunction-sections") -endif (NOT APPLE) - -if (WIN32) - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") -endif (WIN32) - -if (APPLE AND ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++") -else () - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=gnu++11 -pthread") -endif () - - -# -# Fortran setup -# -set (General_FFLAGS "-Wall -Wno-conversion -Wno-c-binding-type -fno-second-underscore") - -# FFLAGS depend on the compiler -get_filename_component (Fortran_COMPILER_NAME ${CMAKE_Fortran_COMPILER} NAME) - -if (Fortran_COMPILER_NAME MATCHES "gfortran.*") - # gfortran - - # CMake compiler test is supposed to do this but doesn't yet - if (CMAKE_OSX_DEPLOYMENT_TARGET) - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}") - endif (CMAKE_OSX_DEPLOYMENT_TARGET) - if (CMAKE_OSX_SYSROOT) - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -isysroot ${CMAKE_OSX_SYSROOT}") - endif (CMAKE_OSX_SYSROOT) - - # Add assembler flag to disable executable stack - if (UNIX AND NOT APPLE AND Fortran_COMPILER_NAME MATCHES "gfortran.*") - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -Wa,--noexecstack") - endif() - - set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -fbounds-check -funroll-all-loops -fno-f2c -ffpe-summary=invalid,zero,overflow,underflow ${General_FFLAGS}") - - set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -ggdb -O0 -fbacktrace -fcheck=all -fbounds-check -fno-f2c -ffpe-summary=invalid,zero,overflow,underflow ${General_FFLAGS}") - - # FPE traps currently disabled in Debug configuration builds until - # we decide if they are meaningful, without these FP instructions - # run in nonstop mode and do not trap - #set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} ${CMAKE_Fortran_FLAGS_DEBUG} -ffpe-trap=invalid,zero,overflow") - -elseif (Fortran_COMPILER_NAME MATCHES "ifort.*") - # ifort (untested) - set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -f77rtl ${General_FFLAGS}") - set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -f77rtl ${General_FFLAGS}") -elseif (Fortran_COMPILER_NAME MATCHES "g77") - # g77 - set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -funroll-all-loops -fno-f2c -m32 ${General_FFLAGS}") - set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fbounds-check -fno-f2c -m32 ${General_FFLAGS}") - -else() - message ("CMAKE_Fortran_COMPILER full path: ${CMAKE_Fortran_COMPILER}") - message ("Fortran compiler: ${Fortran_COMPILER_NAME}") - message ("No optimized Fortran compiler flags are known, we just try -O3...") - set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -O3 ${General_FFLAGS}") - set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -g -fbacktrace -fcheck=all -fbounds-check ${General_FFLAGS}") -endif() - -# -# Linker setup -# -if (NOT APPLE) - set (CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Wl,--gc-sections") - set (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL} -Wl,--gc-sections") -endif (NOT APPLE) - - -# -# setup and test Fortran C/C++ interaction -# - -include (FortranCInterface) -FortranCInterface_VERIFY (CXX) -FortranCInterface_HEADER (FC.h MACRO_NAMESPACE "FC_" SYMBOL_NAMESPACE "FC_" - SYMBOLS - grayline - ) - - -# -# sort out pre-requisites -# - -# -# Setup RPATH so that built executable targets will run in both the -# build tree and the install location without having to set a -# (DYLD|LD)_LIBRARY_PATH override. -# - -# use the full RPATH of the build tree -set (CMAKE_SKIP_BUILD_RPATH FALSE) - -# when building, don't use the install RPATH, it will still be used -# later on in the install phase -set (CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) - -# set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") - -# add the automaticaly determined parts of the RPATH which point to -# directories outside of the build tree to the install RPATH -set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - -# the RPATH to be used when installing, but only if it's not a system -# directory -# list (FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}" isSystemDir) -# if ("${isSystemDir}" STREQUAL "-1") -# set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") -# endif ("${isSystemDir}" STREQUAL "-1") - -set (QT_NEED_RPATH FALSE) -if (NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64") - set (QT_NEED_RPATH TRUE) -endif () - -# -# stuff only qmake can tell us -# -get_target_property (QMAKE_EXECUTABLE Qt5::qmake LOCATION) -get_target_property (LCONVERT_EXECUTABLE Qt5::lconvert LOCATION) -function (QUERY_QMAKE VAR RESULT) - exec_program (${QMAKE_EXECUTABLE} ARGS "-query ${VAR}" RETURN_VALUE return_code OUTPUT_VARIABLE output) - if (NOT return_code) - file (TO_CMAKE_PATH "${output}" output) - set (${RESULT} ${output} PARENT_SCOPE) - endif (NOT return_code) - message (STATUS "Asking qmake for ${RESULT} and got ${output}") -endfunction (QUERY_QMAKE) - -query_qmake (QT_INSTALL_PLUGINS QT_PLUGINS_DIR) -query_qmake (QT_INSTALL_TRANSLATIONS QT_TRANSLATIONS_DIR) -query_qmake (QT_INSTALL_IMPORTS QT_IMPORTS_DIR) -query_qmake (QT_HOST_DATA QT_DATA_DIR) -set (QT_MKSPECS_DIR ${QT_DATA_DIR}/mkspecs) - -# project definitions -add_definitions (-DQT5 -DCMAKE_BUILD -DBIGSYM=1 -DBOOST_ALL_DYN_LINK) -if (CMAKE_HOST_UNIX) - add_definitions (-DUNIX) -elseif (CMAKE_HOST_WIN32) - add_definitions (-DWIN32) -endif () - -# -# sub-directories -# -if (EXISTS ${CMAKE_SOURCE_DIR}/samples AND IS_DIRECTORY ${CMAKE_SOURCE_DIR}/samples) - add_subdirectory (samples) -endif () -if (WSJT_GENERATE_DOCS) - add_subdirectory (doc) -endif (WSJT_GENERATE_DOCS) -if (EXISTS ${CMAKE_SOURCE_DIR}/tests AND IS_DIRECTORY ${CMAKE_SOURCE_DIR}/tests) - add_subdirectory (tests) -endif () - -# build a library of package functionality (without and optionally with OpenMP support) -add_library (wsjt_cxx STATIC ${wsjt_CSRCS} ${wsjt_CXXSRCS}) -target_link_libraries (wsjt_cxx ${LIBM_LIBRARIES} Boost::log_setup ${LIBM_LIBRARIES}) - -# build an OpenMP variant of the Fortran library routines -add_library (wsjt_fort STATIC ${wsjt_FSRCS}) -target_link_libraries (wsjt_fort ${FFTW3_LIBRARIES}) -if (${OPENMP_FOUND} OR APPLE) - add_library (wsjt_fort_omp STATIC ${wsjt_FSRCS}) - target_link_libraries (wsjt_fort_omp ${FFTW3_LIBRARIES}) - if (OpenMP_C_FLAGS AND NOT APPLE) - set_target_properties (wsjt_fort_omp - PROPERTIES - COMPILE_FLAGS "${OpenMP_C_FLAGS}" - ) - endif () - set_target_properties (wsjt_fort_omp - PROPERTIES - Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/fortran_modules_omp - ) - file (MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/fortran_modules_omp) - if (APPLE) - # On Mac we don't have working OpenMP support in the C/C++ - # compilers so we have to manually set the correct flags to get - # OpenMP support in jt9. - target_compile_options (wsjt_fort_omp - PRIVATE - $<$:-fopenmp> # assumes GNU style Fortran compiler - ) - endif (APPLE) -endif (${OPENMP_FOUND} OR APPLE) - -if(WSJT_BUILD_UTILS) - -add_executable (jt4sim lib/jt4sim.f90) -target_link_libraries (jt4sim wsjt_fort wsjt_cxx) - -add_executable (jt65sim lib/jt65sim.f90) -target_link_libraries (jt65sim wsjt_fort wsjt_cxx) - -add_executable (sumsim lib/sumsim.f90) -target_link_libraries (sumsim wsjt_fort wsjt_cxx) - -add_executable (cablog lib/cablog.f90) -target_link_libraries (cablog) - -add_executable (test_snr lib/test_snr.f90) -target_link_libraries (test_snr wsjt_fort) - -add_executable (q65sim lib/qra/q65/q65sim.f90) -target_link_libraries (q65sim wsjt_fort wsjt_cxx) - -add_executable (EchoCallSim lib/EchoCallSim.f90) -target_link_libraries (EchoCallSim wsjt_fort wsjt_cxx) - -add_executable (testEchoCall lib/testEchoCall.f90) -target_link_libraries (testEchoCall wsjt_fort wsjt_cxx) - -add_executable (cwsim lib/cwsim.f90) -target_link_libraries (cwsim wsjt_fort wsjt_cxx) - -add_executable (q65code lib/qra/q65/q65code.f90) -target_link_libraries (q65code wsjt_fort wsjt_cxx) - -add_executable (test_q65 lib/test_q65.f90) -target_link_libraries (test_q65 wsjt_fort wsjt_cxx) - -add_executable (q65_ftn_test lib/qra/q65/q65_ftn_test.f90) -target_link_libraries (q65_ftn_test wsjt_fort wsjt_cxx) - -add_executable (jt49sim lib/jt49sim.f90) -target_link_libraries (jt49sim wsjt_fort wsjt_cxx) - -#add_executable (allsim lib/allsim.f90) -#target_link_libraries (allsim wsjt_fort wsjt_cxx) - -add_executable (rtty_spec lib/rtty_spec.f90) -target_link_libraries (rtty_spec wsjt_fort wsjt_cxx) - -add_executable (jt65code lib/jt65code.f90) -target_link_libraries (jt65code wsjt_fort wsjt_cxx) - -add_executable (jt9code lib/jt9code.f90) -target_link_libraries (jt9code wsjt_fort wsjt_cxx) - -add_executable (wsprcode lib/wsprcode/wsprcode.f90 lib/wsprcode/nhash.c) -target_link_libraries (wsprcode wsjt_fort wsjt_cxx) - -add_executable (encode77 lib/77bit/encode77.f90) -target_link_libraries (encode77 wsjt_fort wsjt_cxx) - -add_executable (hash22calc lib/77bit/hash22calc.f90) -target_link_libraries (hash22calc wsjt_fort wsjt_cxx) - -add_executable (wsprsim ${wsprsim_CSRCS}) -target_link_libraries (wsprsim ${LIBM_LIBRARIES}) - -add_executable (jt4code lib/jt4code.f90) -target_link_libraries (jt4code wsjt_fort wsjt_cxx) - -add_executable (msk144code lib/msk144code.f90) -target_link_libraries (msk144code wsjt_fort wsjt_cxx) - -add_executable (ft8code lib/ft8/ft8code.f90) -target_link_libraries (ft8code wsjt_fort wsjt_cxx) - -add_executable (ft4code lib/ft4/ft4code.f90) -target_link_libraries (ft4code wsjt_fort wsjt_cxx) - -add_executable (echosim lib/echosim.f90) -target_link_libraries (echosim wsjt_fort wsjt_cxx) - -add_executable (ft8sim lib/ft8/ft8sim.f90) -target_link_libraries (ft8sim wsjt_fort wsjt_cxx) - -add_executable (sfoxsim lib/superfox/sfoxsim.f90) -target_link_libraries (sfoxsim wsjt_fort wsjt_cxx) - -add_executable (sfrx lib/superfox/sfrx.f90) -target_link_libraries (sfrx wsjt_fort wsjt_cxx) - -add_executable (sftx lib/superfox/sftx.f90) -target_link_libraries (sftx wsjt_fort wsjt_cxx) - -add_executable (msk144sim lib/msk144sim.f90) -target_link_libraries (msk144sim wsjt_fort wsjt_cxx) - -add_executable (ft4sim lib/ft4/ft4sim.f90) -target_link_libraries (ft4sim wsjt_fort wsjt_cxx) - -add_executable (ft4sim_mult lib/ft4/ft4sim_mult.f90) -target_link_libraries (ft4sim_mult wsjt_fort wsjt_cxx) - -add_executable (fst4sim lib/fst4/fst4sim.f90) -target_link_libraries (fst4sim wsjt_fort wsjt_cxx) -if (WIN32) - set_target_properties (fst4sim PROPERTIES - LINK_FLAGS -Wl,--stack,0x4000000,--heap,0x6000000 - ) -endif () - -add_executable (ldpcsim240_101 lib/fst4/ldpcsim240_101.f90) -target_link_libraries (ldpcsim240_101 wsjt_fort wsjt_cxx) - -add_executable (ldpcsim240_74 lib/fst4/ldpcsim240_74.f90) -target_link_libraries (ldpcsim240_74 wsjt_fort wsjt_cxx) - -endif(WSJT_BUILD_UTILS) - -add_executable (fmtave lib/fmtave.f90) - -add_executable (fcal lib/fcal.f90) - -add_executable (fmeasure lib/fmeasure.f90) - -# build the wsprd WSPR mode decoder driver -generate_version_info (wsprd_VERSION_RESOURCES - NAME wsprd - BUNDLE ${PROJECT_BUNDLE_NAME} - ICON ${WSJTX_ICON_FILE} - FILE_DESCRIPTION "WSPR mode decoder" -) -# message(STATUS "RC compiler: ${CMAKE_RC_COMPILER}") -# message(STATUS "RC rule: ${CMAKE_RC_COMPILE_OBJECT}") -# message(STATUS "wsprd_VERSION_RESOURCES: ${wsprd_VERSION_RESOURCES}") - -add_executable(wsprd - ${wsprd_CSRCS} - lib/indexx.f90 - lib/wsprd/osdwspr.f90 -) - -if(WIN32) - # Attach the generated rc file; the RC rule above will compile it - target_sources(wsprd PRIVATE ${wsprd_VERSION_RESOURCES}) -endif() - - -target_include_directories (wsprd PRIVATE ${FFTW3_INCLUDE_DIRS}) -target_link_libraries (wsprd ${FFTW3_LIBRARIES} ${LIBM_LIBRARIES}) - -# Tell CMake to run moc when necessary -set (CMAKE_AUTOMOC ON) -include_directories (${CMAKE_CURRENT_BINARY_DIR}) - -# don't use Qt "keywords" signal, slot, emit in generated files to -# avoid compatability issue with other libraries -# ADD_DEFINITIONS (-DQT_NO_KEYWORDS) -# ADD_DEFINITIONS (-DUNICODE) #as per qmake - -# As moc files are generated in the binary dir, tell CMake to always -# look for includes there: -set (CMAKE_INCLUDE_CURRENT_DIR ON) - -# -# source navigation -# -set (sources - ${CMAKE_SOURCE_DIR}/* - ${CMAKE_SOURCE_DIR}/logbook/* - ${CMAKE_SOURCE_DIR}/lib/* - ) -add_custom_target (ctags COMMAND ${CTAGS} -o ${CMAKE_SOURCE_DIR}/tags -R ${sources}) -add_custom_target (etags COMMAND ${ETAGS} -o ${CMAKE_SOURCE_DIR}/TAGS -R ${sources}) - - -# Qt i18n - always include the country generic if any regional variant is included -set (LANGUAGES - ca # Catalan - da # Danish - en # English (we need this to stop - # translation loaders loading the - # second preference UI languge, it - # doesn't need to be populated) - en_GB # English UK - es # Spanish - it # Italian - ja # Japanese - #no # Norwegian - #pt # Portuguese - ru # Russian - #sv # Swedish - zh # Chinese - zh_TW # Chinese traditional - it # Italian - ) -foreach (lang_ ${LANGUAGES}) - file (TO_NATIVE_PATH ${CMAKE_SOURCE_DIR}/translations/wsjtx_${lang_}.ts ts_) - list (APPEND TS_FILES ${ts_}) - set (qt_translations_ "${QT_TRANSLATIONS_DIR}/qtbase_${lang_}.qm") - if (EXISTS "${qt_translations_}") - add_custom_command ( - OUTPUT "${CMAKE_BINARY_DIR}/qt_${lang_}.qm" - COMMAND ${LCONVERT_EXECUTABLE} -o "${CMAKE_BINARY_DIR}/qt_${lang_}.qm" ${qt_translations_} - COMMENT "Building required Qt translations for language ${lang_}" - ) - list (APPEND QM_FILES "${CMAKE_BINARY_DIR}/qt_${lang_}.qm") - endif () -endforeach () -if (UPDATE_TRANSLATIONS) - message (STATUS "UPDATE_TRANSLATIONS option is set.") - qt5_create_translation ( - QM_FILES ${wsjt_qt_UISRCS} ${wsjtx_UISRCS} ${wsjt_qt_CXXSRCS} ${wsjtx_CXXSRCS} - ${TS_FILES} - OPTIONS -I${CMAKE_CURRENT_SOURCE_DIR} - ) -else () - qt5_add_translation (QM_FILES ${TS_FILES}) -endif () -add_custom_target (translations DEPENDS ${QM_FILES}) -set_property (DIRECTORY PROPERTY CLEAN_NO_CUSTOM TRUE) - -# embedded resources -function (add_resources resources path) - foreach (resource_file_ ${ARGN}) - get_filename_component (name_ ${resource_file_} NAME) - if (IS_ABSOLUTE "${resource_file_}") - file (TO_NATIVE_PATH ${resource_file_} source_) - else () - file (TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/${resource_file_} source_) - endif () - file (TO_NATIVE_PATH ${path}/${name_} dest_) - set (resources_ "${resources_}\n ${source_}") - set (${resources} ${${resources}}${resources_} PARENT_SCOPE) - endforeach (resource_file_ ${ARGN}) -endfunction (add_resources resources path) - -add_resources (wsjtx_RESOURCES "" ${TOP_LEVEL_RESOURCES}) -add_resources (wsjtx_RESOURCES /Palettes ${PALETTE_FILES}) -add_resources (wsjtx_RESOURCES /Translations ${QM_FILES}) - -configure_file (wsjtx.qrc.in wsjtx.qrc @ONLY) - -# UI generation -qt5_wrap_ui (wsjt_qt_GENUISRCS ${wsjt_qt_UISRCS}) -qt5_wrap_ui (wsjtx_GENUISRCS ${wsjtx_UISRCS}) - -# Resource generation -qt5_add_resources (wsjtx_RESOURCES_RCC - ${CMAKE_BINARY_DIR}/wsjtx.qrc - contrib/QDarkStyleSheet/qdarkstyle/style.qrc - ) - -# AX COM servers -if (WIN32) - include (QtAxMacros) - wrap_ax_server (GENAXSRCS ${AXSERVERSRCS}) -endif (WIN32) - -# -# targets dependent on Qt -# - -# build a library for the QCustomPlot widget -add_library (qcp STATIC ${qcp_CXXSRCS}) -target_include_directories (qcp PUBLIC $) -target_link_libraries (qcp Qt5::Widgets Qt5::PrintSupport) - -# build a library of package Qt functionality -add_library (wsjt_qt STATIC ${wsjt_qt_CXXSRCS} ${wsjt_qt_GENUISRCS} ${GENAXSRCS}) -# set wsjtx_udp exports to static variants -target_compile_definitions (wsjt_qt PUBLIC UDP_STATIC_DEFINE) -target_link_libraries (wsjt_qt Hamlib::Hamlib Boost::log qcp Qt5::Widgets Qt5::Network Qt5::Sql Qt5::WebSockets) -if (WIN32) - target_link_libraries (wsjt_qt Qt5::AxContainer Qt5::AxBase) -endif (WIN32) - -# build a library of package Qt functionality used in Fortran utilities -add_library (fort_qt STATIC ${fort_qt_CXXSRCS}) -target_link_libraries (fort_qt Qt5::Core) - -# build a library of WSJT Qt multimedia components -add_library (wsjt_qtmm STATIC ${wsjt_qtmm_CXXSRCS} ${wsjt_qtmm_GENUISRCS}) -target_link_libraries (wsjt_qtmm Qt5::Multimedia) - -# build the jt9 slow mode decoder driver -generate_version_info (jt9_VERSION_RESOURCES - NAME jt9 - BUNDLE ${PROJECT_BUNDLE_NAME} - ICON ${WSJTX_ICON_FILE} - FILE_DESCRIPTION "jt9 - WSJT-X slow mode decoder" - ) - -add_executable (record_time_signal Audio/tools/record_time_signal.cpp) -target_link_libraries (record_time_signal wsjt_cxx wsjt_qtmm wsjt_qt) - -add_executable (jt9 ${jt9_FSRCS} ${jt9_VERSION_RESOURCES}) -if (${OPENMP_FOUND} OR APPLE) - if (APPLE) - # On Mac we don't have working OpenMP support in the C/C++ - # compilers so we have to manually set the correct linking flags - # and libraries to get OpenMP support in jt9. - set_target_properties (jt9 - PROPERTIES - Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/fortran_modules_omp - LINK_LIBRARIES "gomp;gcc_s.1" # assume GNU libgcc OpenMP - ) - target_compile_options (jt9 - PRIVATE - $<$:-fopenmp> # assumes GNU style Fortran compiler - ) - else (APPLE) - if (OpenMP_C_FLAGS) - set_target_properties (jt9 - PROPERTIES - COMPILE_FLAGS "${OpenMP_C_FLAGS}" - LINK_FLAGS "${OpenMP_C_FLAGS}" - ) - endif () - set_target_properties (jt9 - PROPERTIES - Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/fortran_modules_omp - ) - endif (APPLE) - if (WIN32) - set_target_properties (jt9 PROPERTIES - LINK_FLAGS -Wl,--stack,16777216 - ) - endif () - target_link_libraries (jt9 wsjt_fort_omp wsjt_cxx fort_qt) -else (${OPENMP_FOUND} OR APPLE) - target_link_libraries (jt9 wsjt_fort wsjt_cxx fort_qt) -endif (${OPENMP_FOUND} OR APPLE) - -if (WIN32) - find_package (Portaudio REQUIRED) - add_subdirectory (map65) -endif () - add_subdirectory (qmap) - -# build the main application -generate_version_info (wsjtx_VERSION_RESOURCES - NAME wsjtx - BUNDLE ${PROJECT_BUNDLE_NAME} - ICON ${WSJTX_ICON_FILE} - ) - -add_executable (wsjtx MACOSX_BUNDLE - ${wsjtx_CXXSRCS} - ${wsjtx_GENUISRCS} - ${WSJTX_ICON_FILE} - ${wsjtx_RESOURCES_RCC} - ${wsjtx_VERSION_RESOURCES} - ) - -if (WSJT_CREATE_WINMAIN) - set_target_properties (wsjtx PROPERTIES WIN32_EXECUTABLE ON) -endif (WSJT_CREATE_WINMAIN) - -set_target_properties (wsjtx PROPERTIES - MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Darwin/Info.plist.in" - MACOSX_BUNDLE_INFO_STRING "${PROJECT_DESCRIPTION}" - MACOSX_BUNDLE_ICON_FILE "${WSJTX_ICON_FILE}" - MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} - MACOSX_BUNDLE_SHORT_VERSION_STRING "v${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}" - MACOSX_BUNDLE_LONG_VERSION_STRING "Version ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${SCS_VERSION_STR}" - MACOSX_BUNDLE_BUNDLE_NAME "${PROJECT_BUNDLE_NAME}" - MACOSX_BUNDLE_BUNDLE_EXECUTABLE_NAME "${PROJECT_NAME}" - MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT}" - MACOSX_BUNDLE_GUI_IDENTIFIER "org.k1jt.wsjtx" - ) - -target_include_directories (wsjtx PRIVATE ${FFTW3_INCLUDE_DIRS}) -if ((NOT ${OPENMP_FOUND}) OR APPLE) - target_link_libraries (wsjtx wsjt_fort) -else () - target_link_libraries (wsjtx wsjt_fort_omp) - if (OpenMP_C_FLAGS) - set_target_properties (wsjtx PROPERTIES - COMPILE_FLAGS "${OpenMP_C_FLAGS}" - LINK_FLAGS "${OpenMP_C_FLAGS}" - ) - endif () - set_target_properties (wsjtx PROPERTIES - Fortran_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/fortran_modules_omp - ) - if (WIN32) - set_target_properties (wsjtx PROPERTIES - LINK_FLAGS -Wl,--stack,0x1000000,--heap,0x20000000 - ) - endif () -endif () -target_link_libraries (wsjtx Qt5::SerialPort wsjt_cxx wsjt_qt wsjt_qtmm ${FFTW3_LIBRARIES} ${LIBM_LIBRARIES}) - -# make a library for WSJT-X UDP servers -# add_library (wsjtx_udp SHARED ${UDP_library_CXXSRCS}) -add_library (wsjtx_udp-static STATIC ${UDP_library_CXXSRCS}) -#target_include_directories (wsjtx_udp -# INTERFACE -# $ -# ) -target_include_directories (wsjtx_udp-static - INTERFACE - $ - ) -#set_target_properties (wsjtx_udp PROPERTIES -# PUBLIC_HEADER "${UDP_library_HEADERS}" -# ) -set_target_properties (wsjtx_udp-static PROPERTIES - OUTPUT_NAME wsjtx_udp - ) -target_compile_definitions (wsjtx_udp-static PUBLIC UDP_STATIC_DEFINE) -target_link_libraries (wsjtx_udp-static Qt5::Network Qt5::Gui) -generate_export_header (wsjtx_udp-static BASE_NAME udp) - -generate_version_info (udp_daemon_VERSION_RESOURCES - NAME udp_daemon - BUNDLE ${PROJECT_BUNDLE_NAME} - ICON ${WSJTX_ICON_FILE} - FILE_DESCRIPTION "Example WSJT-X UDP Message Protocol daemon" - ) -add_executable (udp_daemon UDPExamples/UDPDaemon.cpp ${udp_daemon_VERSION_RESOURCES}) -target_link_libraries (udp_daemon wsjtx_udp-static) - -generate_version_info (wsjtx_app_version_VERSION_RESOURCES - NAME wsjtx_app_version - BUNDLE ${PROJECT_BUNDLE_NAME} - ICON ${WSJTX_ICON_FILE} - FILE_DESCRIPTION "Display WSJT-X Application Version on console" - ) -add_executable (wsjtx_app_version AppVersion/AppVersion.cpp ${wsjtx_app_version_VERSION_RESOURCES}) -target_link_libraries (wsjtx_app_version wsjt_qt) - -generate_version_info (message_aggregator_VERSION_RESOURCES - NAME message_aggregator - BUNDLE ${PROJECT_BUNDLE_NAME} - ICON ${WSJTX_ICON_FILE} - FILE_DESCRIPTION "Example WSJT-X UDP Message Protocol application" - ) -add_resources (message_aggregator_RESOURCES /qss ${message_aggregator_STYLESHEETS}) -configure_file (UDPExamples/message_aggregator.qrc.in message_aggregator.qrc @ONLY) -qt5_add_resources (message_aggregator_RESOURCES_RCC - ${CMAKE_CURRENT_BINARY_DIR}/message_aggregator.qrc - contrib/QDarkStyleSheet/qdarkstyle/style.qrc - ) -add_executable (message_aggregator - ${message_aggregator_CXXSRCS} - ${message_aggregator_RESOURCES_RCC} - ${message_aggregator_VERSION_RESOURCES} - ) -target_link_libraries (message_aggregator wsjt_qt Qt5::Widgets wsjtx_udp-static) - -if (WSJT_CREATE_WINMAIN) - set_target_properties (message_aggregator PROPERTIES WIN32_EXECUTABLE ON) -endif (WSJT_CREATE_WINMAIN) - -if (UNIX) - if (NOT WSJT_SKIP_MANPAGES) - add_subdirectory (manpages) - add_dependencies (wsjtx manpages) - endif (NOT WSJT_SKIP_MANPAGES) - if (NOT APPLE) - add_subdirectory (debian) - add_dependencies (wsjtx debian) - endif (NOT APPLE) -endif (UNIX) - -# -# installation -# -install (TARGETS wsjtx - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - BUNDLE DESTINATION . COMPONENT runtime - ) - -# install (TARGETS wsjtx_udp EXPORT udp -# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -# PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/wsjtx -# ) -# install (TARGETS wsjtx_udp-static EXPORT udp-static -# DESTINATION ${CMAKE_INSTALL_LIBDIR} -# ) - -# install (EXPORT udp NAMESPACE wsjtx:: -# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wsjtx -# ) -# install (EXPORT udp-static NAMESPACE wsjtx:: -# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wsjtx -# ) - -install (TARGETS udp_daemon message_aggregator wsjtx_app_version - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - ) - -install (TARGETS jt9 wsprd fmtave fcal fmeasure - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - ) - -if(WSJT_BUILD_UTILS) -install (TARGETS ft8code jt65code jt9code jt4code msk144code - q65code fst4sim ft8sim q65sim EchoCallSim testEchoCall echosim hash22calc cablog - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime - ) -endif(WSJT_BUILD_UTILS) - -install (PROGRAMS - ${RIGCTL_EXE} - DESTINATION ${CMAKE_INSTALL_BINDIR} - #COMPONENT runtime - RENAME rigctl-wsjtx${CMAKE_EXECUTABLE_SUFFIX} - ) - -install (PROGRAMS - ${RIGCTLD_EXE} - DESTINATION ${CMAKE_INSTALL_BINDIR} - #COMPONENT runtime - RENAME rigctld-wsjtx${CMAKE_EXECUTABLE_SUFFIX} - ) - -install (PROGRAMS - ${RIGCTLCOM_EXE} - DESTINATION ${CMAKE_INSTALL_BINDIR} - #COMPONENT runtime - RENAME rigctlcom-wsjtx${CMAKE_EXECUTABLE_SUFFIX} - ) - -install (FILES - README - COPYING - AUTHORS - THANKS - NEWS - BUGS - DESTINATION ${CMAKE_INSTALL_DOCDIR} - #COMPONENT runtime - ) - -install (FILES - cty.dat - cty.dat_copyright.txt - grid.dat - sat.dat - contrib/Ephemeris/JPLEPH - eclipse.txt - DESTINATION ${CMAKE_INSTALL_DATADIR}/${CMAKE_PROJECT_NAME} - #COMPONENT runtime - ) - -install (FILES - ALLCALL7.TXT - DESTINATION ${CMAKE_INSTALL_BINDIR} - #COMPONENT runtime - ) - -install (DIRECTORY - example_log_configurations - DESTINATION ${CMAKE_INSTALL_DOCDIR} - FILES_MATCHING REGEX "^.*[^~]$" - #COMPONENT runtime - ) - -install (DIRECTORY - ${PROJECT_SOURCE_DIR}/sounds - DESTINATION ${CMAKE_INSTALL_BINDIR} - #COMPONENT runtime - ) - -if (WIN32) - # Bundle OpenSSL runtime DLLs from the build environment. - # Qt's QSslSocket loads OpenSSL by filename at runtime; the names depend - # on what Qt was built against (libssl-1_1*.dll for older Qt-on-OpenSSL-1.1, - # libssl-3-x64.dll for current MSYS2 Qt-on-OpenSSL-3). Glob whatever the - # runner provides so SuperFox verification, Update Hamlib, LotW download, - # and eQSL keep working as the build environment advances. - set (_openssl_msys_prefix "$ENV{MSYSTEM_PREFIX}") - if (NOT _openssl_msys_prefix) - set (_openssl_msys_prefix "/mingw64") - endif () - file (GLOB _openssl_runtime_dlls - "${_openssl_msys_prefix}/bin/libssl-*.dll" - "${_openssl_msys_prefix}/bin/libcrypto-*.dll" - ) - if (_openssl_runtime_dlls) - install (FILES ${_openssl_runtime_dlls} - DESTINATION ${CMAKE_INSTALL_BINDIR} - #COMPONENT runtime - ) - else () - message (WARNING - "OpenSSL runtime DLLs not found at ${_openssl_msys_prefix}/bin — " - "TLS features (SuperFox, Update Hamlib, LotW, eQSL) will fail on " - "installs without OpenSSL in PATH." - ) - endif () -endif (WIN32) - -# -# Mac installer files -# -if (APPLE) - install (FILES - Darwin/ReadMe.txt - Darwin/com.wsjtx.sysctl.plist - DESTINATION . - #COMPONENT runtime - ) -endif (APPLE) - -# -# uninstall support -# -configure_file ( - "${CMAKE_CURRENT_SOURCE_DIR}/CMake/cmake_uninstall.cmake.in" - "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" - @ONLY) -add_custom_target (uninstall - "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") - - -# creates or updates ${PROJECT_BINARY_DIR}/scs_version.h using cmake script -add_custom_target (revisiontag - COMMAND ${CMAKE_COMMAND} - -D SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} - -D BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} - -D OUTPUT_DIR=${PROJECT_BINARY_DIR} - -P ${CMAKE_CURRENT_SOURCE_DIR}/CMake/getsvn.cmake - VERBATIM - BYPRODUCTS scs_version.h - COMMENT "Getting source control system revision information" - ) -# explicitly say that the wsjt_qt depends on custom target, this is -# done indirectly so that the revisiontag target gets built exactly -# once per build -add_dependencies (wsjt_qt revisiontag) -add_dependencies (jt9 revisiontag) -add_dependencies (wsprd revisiontag) - - -# -# versioning and configuration -# -configure_file ( - "${CMAKE_CURRENT_SOURCE_DIR}/wsjtx_config.h.in" - "${CMAKE_CURRENT_BINARY_DIR}/wsjtx_config.h" - ) - - -if (NOT WIN32 AND NOT APPLE) - # install a desktop file so wsjtx appears in the application start - # menu with an icon - install ( - FILES wsjtx.desktop message_aggregator.desktop - DESTINATION share/applications - #COMPONENT runtime - ) - install ( - FILES icons/Unix/wsjtx_icon.png - DESTINATION share/pixmaps - #COMPONENT runtime - ) -endif (NOT WIN32 AND NOT APPLE) - -if (APPLE) - set (CMAKE_POSTFLIGHT_SCRIPT - "${wsjtx_BINARY_DIR}/postflight.sh") - set (CMAKE_POSTUPGRADE_SCRIPT - "${wsjtx_BINARY_DIR}/postupgrade.sh") - configure_file ("${wsjtx_SOURCE_DIR}/Darwin/postflight.sh.in" - "${CMAKE_POSTFLIGHT_SCRIPT}") - configure_file ("${wsjtx_SOURCE_DIR}/Darwin/postupgrade.sh.in" - "${CMAKE_POSTUPGRADE_SCRIPT}") -endif () - - -# -# bundle fixup only done in non-Debug configurations -# -if (NOT is_debug_build) - # add this sub-sirectory after all install steps and other - # sub-directories to ensure that all executables are in-place before - # any fixup is done - add_subdirectory (bundle_fixup) -endif () - - -# -# packaging -# -set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/package_description.txt") -set (CPACK_MONOLITHIC_INSTALL 1) -set (CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") -set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) -set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) -set (CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}${BUILD_TYPE_REVISION}") - -if (WIN32) - set (CPACK_GENERATOR "NSIS") -elseif (APPLE) - set (CPACK_GENERATOR "DragNDrop") -else () - find_program (DPKG_BUILDER dpkg-buildpackage DOC "Debian package builder") - if (DPKG_BUILDER) - # - # Derive the correct filename for a Debian package because the DEB - # generator doesn't do this correctly at present. - # - find_program (DPKG_PROGRAM dpkg DOC "dpkg program of Debian-based systems") - if (DPKG_PROGRAM) - execute_process ( - COMMAND ${DPKG_PROGRAM} --print-architecture - OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - else (DPKG_PROGRAM) - set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE noarch) - endif (DPKG_PROGRAM) - - list (APPEND CPACK_GENERATOR "DEB") - endif (DPKG_BUILDER) - - find_program (RPMBUILDER rpmbuild DOC "RPM package builder") - if (RPMBUILDER) - list (APPEND CPACK_GENERATOR "RPM") - endif (RPMBUILDER) -endif () - -set (CPACK_DEBIAN_PACKAGE_HOMEPAGE "${PROJECT_HOMEPAGE}") -set (CPACK_DEBIAN_PACKAGE_DEPENDS "libgfortran5 (>=8.3) | libgfortran4 (>=7.3) | libgfortran3 (>=6.3), libfftw3-single3 (>=3.3), libgomp1 (>=6), libqt5serialport5 (>=5.7), libqt5multimedia5-plugins (>=5.7), libqt5widgets5 (>=5.7), libqt5network5 (>=5.7), libqt5printsupport5 (>=5.7), libqt5websockets5 (>=5.7), libqt5sql5-sqlite (>=5.7), libusb-1.0-0 (>=1.0.21), libboost-log1.62.0 (>=1.62.0) | libboost-log1.65.1 (>=1.65.1) | libboost-log1.67.0 (>=1.67.0) | libboost-log1.71.0 (>=1.71.0) | libboost-log1.74.0 (>=1.74.0) | libboost-log1.81.0 (>=1.81.0) | libboost-log1.83.0 (>=1.83.0) | libboost-log1.85.0 (>=1.85.0)") -set (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) -# Take over data files (icon, samples, docs) from the distro `wsjtx-data`, -# `wsjtx-doc`, `wsjtx-improved-data`, and `wsjtx-improved-doc` binary packages -# so installing this .deb on a system carrying any of them doesn't fail with a -# file conflict and doesn't cascade-remove `js8call` or other consumers. -set (CPACK_DEBIAN_PACKAGE_PROVIDES "wsjtx-data (= ${wsjtx_VERSION}), wsjtx-doc (= ${wsjtx_VERSION}), wsjtx-improved-data (= ${wsjtx_VERSION}), wsjtx-improved-doc (= ${wsjtx_VERSION})") -set (CPACK_DEBIAN_PACKAGE_REPLACES "wsjtx-data, wsjtx-doc, wsjtx-improved-data, wsjtx-improved-doc") -set (CPACK_DEBIAN_PACKAGE_CONFLICTS "wsjtx-data (<< ${wsjtx_VERSION}), wsjtx-doc (<< ${wsjtx_VERSION}), wsjtx-improved-data (<< ${wsjtx_VERSION}), wsjtx-improved-doc (<< ${wsjtx_VERSION})") - -set (CPACK_RPM_PACKAGE_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR}) -set (CPACK_RPM_PACKAGE_REQUIRES "qt5-qtbase >= 5.9, qt5-qtserialport >= 5.9, qt5-qtmultimedia >= 5.9, qt5-qtwebsockets >= 5.9, qt5-qtsvg >= 5.9, libusbx >= 1.0.22, libgfortran >= 7, libgomp >= 7, fftw-libs-single >= 3.3, boost-log >= 1.62") -set (CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/share/pixmaps /usr/share/applications /usr/share/man /usr/share/man1) - -configure_file ("${PROJECT_SOURCE_DIR}/CMakeCPackOptions.cmake.in" - "${PROJECT_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY) -set (CPACK_PROJECT_CONFIG_FILE "${PROJECT_BINARY_DIR}/CMakeCPackOptions.cmake") - -include (CPack) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 67874f07..bd2c93ed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,143 +1,91 @@ -# Contributing to WSJT-X - -## Overview - -**WSJT-X** and its sister programs **MAP65** and **QMAP** are open-source applications designed to facilitate weak-signsl ham radio communication. The project was started in 2001 and became an open-source effort in 2005. Our core development team has grown slowly over time, and in May 2026 consists of seven members. - -We welcome contributions to these programs from outside the core development team. This document provides a brief summary of how the WSJT-X GitHub repositories are organized, how the development team operates, and how outside contributions can be made. - -## Repository Structure - -We use two GitHub repositories. Public site https://github.com/WSJTX/wsjtx receives updated code whenever a general availability (GA) program version is released. Anyone can submit [Issues](https://github.com/WSJTX/wsjtx/issues) to be raised and discussed, as well as Bug Reports and [Pull Requests](https://github.com/WSJTX/wsjtx/pulls). External contributors should fork the public repo and submit pull requests based on that code. - -Development work by team members, including acceptance testing of outside pull requests, takes place in a private repository. At any particular time team members may be developing or experimenting with program features that are not yet ready for distribution or general use. - -## Building from Source -Source code for WSJT-X, MAP65, and QMAP together amounts to more than 130,000 lines of C++, 75,000 lines of Fortran, and 18,000 lines of C. User interfaces use the Qt framework and are mostly written in C++, while signal processing and message encoding/decoding are done in Fortran. Required external libraries include FFTW3, Boost, libUSB, and Hamlib. The applications and related utility programs are multi-platform and can be built and used on the Windows, macOS, and Linux. We use CMake and Qt5, and we build Hamlib locally before building WSJT-X. - -### Prerequisites - -**All platforms:** -- CMake 3.16+ -- Qt 5.12+ (Core, Widgets, Multimedia, SerialPort, Network, Sql, LinguistTools) -- FFTW 3 (single precision — `libfftw3f`) -- Boost C++ libraries -- Compilers for C++ and FORTRAN, typically gcc and gfortran -- Git - -**Linux (Debian/Ubuntu):** -``` -sudo apt install build-essential cmake gfortran \ - qtbase5-dev qttools5-dev qtmultimedia5-dev libqt5serialport5-dev \ - libfftw3-dev libboost-all-dev libusb-1.0-0-dev libudev-dev \ - autoconf automake libtool pkg-config texinfo -``` - -**macOS:** -``` -brew install cmake gcc qt@5 fftw boost libusb autoconf automake libtool pkg-config texinfo -``` -Xcode command-line tools are also required (`xcode-select --install`). - -**Windows:** -Windows builds use the [Hamlib SDK](https://sourceforge.net/projects/hamlib-sdk/), which provides all prerequisite libraries and MinGW tooling. See the INSTALL file for detailed Windows instructions. - -### First Step: Build Hamlib - -WSJT-X requires a specific Hamlib version. Check `ci.yml` in `.github/workflows/` for the current `hamlib_branch` value — this is what CI builds against and what your local build should match. - -```bash -# Replace HAMLIB_BRANCH with the current value from ci.yml (e.g., "4.7.1"): -HAMLIB_BRANCH="4.7.1" - -mkdir -p ~/hamlib-prefix/build -cd ~/hamlib-prefix -git clone https://github.com/Hamlib/Hamlib src -cd src -git checkout $HAMLIB_BRANCH -./bootstrap -mkdir ../build && cd ../build -../src/configure --prefix=$HOME/hamlib-prefix \ - --disable-shared --enable-static \ - --without-cxx-binding --disable-winradio \ - CFLAGS="-g -O2 -fdata-sections -ffunction-sections" \ - LDFLAGS="-Wl,--gc-sections" -make -make install-strip -``` - -### Building WSJT-X - -Fork the public repo: -```bash -git clone https://github.com/YOUR_USERNAME/wsjtx.git ~/wsjtx-prefix/src -cd ~/wsjtx-prefix/src -git remote add upstream https://github.com/WSJTX/wsjtx.git -``` - -Then build: -```bash -mkdir -p ~/wsjtx-prefix/build && cd ~/wsjtx-prefix/build -cmake -DCMAKE_PREFIX_PATH="$HOME/hamlib-prefix" ../src -cmake --build . -``` - -On macOS, add Qt5 and other Homebrew paths to `CMAKE_PREFIX_PATH`: -```bash -cmake -DCMAKE_PREFIX_PATH="$HOME/hamlib-prefix;$(brew --prefix qt@5);$(brew --prefix fftw);$(brew --prefix boost)" \ - -DCMAKE_Fortran_COMPILER=$(brew --prefix gcc)/bin/gfortran ../src -``` - -### Updating and Rebuilding - -```bash -# Update Hamlib -cd ~/hamlib-prefix/src && git pull -cd ~/hamlib-prefix/build && make && make install-strip - -# Update WSJT-X -cd ~/wsjtx-prefix/src && git pull -cd ~/wsjtx-prefix/build && cmake --build . -``` -## Bug Reports - -Users and external contributors should file bug reports as Issues on the [public repo](https://github.com/WSJTX/wsjtx/issues). A team member will forward the Issue to `wsjtx-internal` if triage reveals development work to be done. - -When filing an Issue, please include: - -- WSJT-X version and operating system -- Steps to reproduce -- Expected vs. actual behavior -- Relevant log output or screenshots - -## Pull Requests - -### Basic steps for external contributors - -1. Fork `WSJTX/wsjtx` on GitHub. - -2. Create a branch, make your changes, push to your fork. - -3. Open a PR from your fork to `WSJTX/wsjtx` targeting `master`. - -4. A team member reviews the PR. If accepted, they port the change to wsjtx-internal where it enters the normal development flow and CI validation. - -5. The change reaches the public repo at the next tagged release. - -This indirection exists because the public repo only receives code at release time. Merging directly to `master` would put it out of sync with internal development. - -### General guidelines - -- **One PR per logical change.** Don't bundle unrelated fixes. -- **Test your changes.** Build on your platform and verify the application runs. If your change affects decoding, test with known `.wav` files. -- **Include in the PR description:** what the change does, why, which platforms you tested on, and related issue numbers. -- **Be patient.** The core developers are volunteers with other commitments. PRs may take days or weeks to review. - -### Coding Conventions - -- **C++:** Qt-style naming. Classes use `PascalCase`, methods use `camelCase`. Header guards use `FILENAME_HPP_` format. -- **Fortran:** Traditional Fortran style. Signal processing and codec code lives in `lib/`. -- **Indentation:** 2 spaces in C++, standard Fortran indentation in `.f90` files. -- **Comments:** Descriptive block comments above classes and functions. Inline comments where logic is non-obvious. -- **License:** All source files are GPL-3.0. New files should include the appropriate license header. - +# Contributing to WSJT-X + +WSJT-X, MAP65, and QMAP are open-source applications for weak-signal amateur +radio communication. Contributions to the programs and their documentation are +welcome. + +## Choose the correct repository + +WSJT-X development uses two repositories with different purposes: + +- The public [WSJTX/wsjtx](https://github.com/WSJTX/wsjtx) repository is + updated when a general-availability release is published. External + contributors should fork this repository and base pull requests on its + `master` branch. +- The core team develops and tests future releases in a private repository. + Its current source can be newer than the public repository and is not yet + distributed or supported as a release. + +A public clone therefore contains the latest published source, not a live copy +of the private development branch. A core team member will port an accepted +external contribution into the private repository for integration and CI +testing. + +## Build and test your change + +Read the [source-build guide](doc/user_guide/en/install-from-source.adoc) before +setting up a toolchain. It is the maintained source for dependencies and build +commands; build recipes are intentionally not duplicated here. + +WSJT-X is a mixed C++, C, and Fortran project built with CMake and Qt 5. A +normal developer cycle uses an out-of-source build directory: + +```bash +cmake -S . -B build # Add the options from the platform guide. +cmake --build build +ctest --test-dir build --output-on-failure +``` + +Reconfigure after changing CMake files or pulling changes that affect +dependencies. Use a fresh build directory after changing compiler, Qt +installation, MSYS2 runtime, or other foundational toolchain components; +CMake intentionally caches those choices. + +A local developer build shows whether a change compiles and passes tests on +your machine. + +## Report a bug + +File public bug reports in the +[issue tracker](https://github.com/WSJTX/wsjtx/issues). Include: + +- the WSJT-X version, operating system, and architecture; +- exact steps to reproduce the problem; +- expected and actual behavior; +- relevant logs or screenshots; and +- whether the problem occurs in an installed build or only in a build tree. + +A team member will move the investigation into the private repository when it +requires unreleased development work. + +## Submit a pull request + +1. Fork `WSJTX/wsjtx` and create a branch from public `master`. +2. Make one logical change and test it on the affected platform. +3. Push the branch to your fork and open a pull request against + `WSJTX/wsjtx:master`. +4. Explain what the change does, why it is needed, which platforms and tests + you used, and any related issue numbers. + +Merging an external contribution directly into public `master` would put the +public release snapshot out of sync with internal development. Instead, the +team reviews it publicly, integrates it privately, and publishes it with a +subsequent release. + +## Follow project conventions + +- Match the naming and formatting already used in the files you change. +- C++ code generally uses two-space indentation, `PascalCase` class names, and + `camelCase` method names. Preserve local conventions when a file differs. +- Preserve the established Fortran style in the signal-processing and codec + libraries. +- Write comments for non-obvious constraints or behavior, not to narrate code + that is already clear from its names and structure. +- Add the appropriate GPL-3.0 license header to new source files. + +## Keep changes reviewable + +- Keep each pull request to one logical change. +- Add or update tests when behavior changes. +- Test decoding changes with known sample files and report the cases used. +- Avoid broad formatting or cleanup mixed with a functional change. diff --git a/Configuration.cpp b/Configuration.cpp index bf598688..dd92ae11 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -148,10 +148,16 @@ #include #include #include +#include +#include +#include +#include +#include #include #include #include #include +#include #include #include #include @@ -165,6 +171,7 @@ #include #include #include +#include #include #include #include @@ -176,12 +183,16 @@ #include #include #include +#include +#include #include #include #include #include "pimpl_impl.hpp" #include "Logger.hpp" +#include "PerformanceTrace.hpp" +#include "Transceiver/TxInhibitTransceiver.hpp" #include "qt_helpers.hpp" #include "MetaDataRegistry.hpp" #include "SettingsGroup.hpp" @@ -202,6 +213,7 @@ #include "Network/NetworkServerLookup.hpp" #include "Network/FoxVerifier.hpp" #include "widgets/MessageBox.hpp" +#include "widgets/SettingsDialogLayout.hpp" #include "validators/MaidenheadLocatorValidator.hpp" #include "validators/CallsignValidator.hpp" #include "Network/LotWUsers.hpp" @@ -286,6 +298,26 @@ namespace constexpr quint32 qrg_magic {0xadbccbdb}; constexpr quint32 qrg_version {101}; // M.mm constexpr quint32 qrg_version_100 {100}; + + QString cloudlog_connection_check_style (Cloudlog::ConnectionCheckStatus status) + { + switch (status) + { + case Cloudlog::ConnectionCheckStatus::Success: + return QStringLiteral ("QPushButton {background-color: green;}"); + case Cloudlog::ConnectionCheckStatus::ReadOnlyKey: + return QStringLiteral ("QPushButton {background-color: orange;}"); + case Cloudlog::ConnectionCheckStatus::InvalidKey: + case Cloudlog::ConnectionCheckStatus::StationProfileUnavailable: + case Cloudlog::ConnectionCheckStatus::EndpointUnavailable: + case Cloudlog::ConnectionCheckStatus::UploadShapeRejected: + case Cloudlog::ConnectionCheckStatus::NetworkError: + case Cloudlog::ConnectionCheckStatus::UnexpectedResponse: + return QStringLiteral ("QPushButton {background-color: red;}"); + } + + return {}; + } } @@ -341,6 +373,7 @@ public: connect (button_box, &QDialogButtonBox::accepted, this, &FrequencyDialog::accept); connect (button_box, &QDialogButtonBox::rejected, this, &FrequencyDialog::reject); + connect (&frequency_line_edit_, &QLineEdit::textChanged, this, &FrequencyDialog::update_accept_button); connect (start_date_time_edit_, &QDateTimeEdit::dateTimeChanged, this, &FrequencyDialog::checkSaneDates); connect (end_date_time_edit_, &QDateTimeEdit::dateTimeChanged, this, &FrequencyDialog::checkSaneDates); connect (enable_dates_checkbox_, &QCheckBox::stateChanged, this, &FrequencyDialog::toggleValidity); @@ -356,16 +389,11 @@ public: void checkSaneDates() { - if (enable_dates_checkbox_->isChecked() && start_date_time_edit_->dateTime().isValid() && end_date_time_edit_->dateTime().isValid()) + if (!dates_are_sane ()) { - if (start_date_time_edit_->dateTime() > end_date_time_edit_->dateTime()) - { - QMessageBox::warning(this, tr("Invalid Date Range"), tr("Start date must be before end date")); - button_box->button(QDialogButtonBox::Ok)->setEnabled(false); - return; - } + QMessageBox::warning(this, tr("Invalid Date Range"), tr("Start date must be before end date")); } - button_box->button(QDialogButtonBox::Ok)->setEnabled(true); + update_accept_button (); } Item item () const @@ -384,6 +412,20 @@ public: } private: + bool dates_are_sane () const + { + return !enable_dates_checkbox_->isChecked () + || !start_date_time_edit_->dateTime ().isValid () + || !end_date_time_edit_->dateTime ().isValid () + || start_date_time_edit_->dateTime () <= end_date_time_edit_->dateTime (); + } + + void update_accept_button () + { + button_box->button (QDialogButtonBox::Ok)->setEnabled (frequency_line_edit_.hasAcceptableInput () + && dates_are_sane ()); + } + QComboBox region_combo_box_; QComboBox mode_combo_box_; QComboBox voices_combo_box_; @@ -423,16 +465,18 @@ public: auto main_layout = new QVBoxLayout (this); main_layout->addLayout (form_layout); - auto button_box = new QDialogButtonBox {QDialogButtonBox::Ok | QDialogButtonBox::Cancel}; - main_layout->addWidget (button_box); + button_box_ = new QDialogButtonBox {QDialogButtonBox::Ok | QDialogButtonBox::Cancel}; + main_layout->addWidget (button_box_); - connect (button_box, &QDialogButtonBox::accepted, this, &StationDialog::accept); - connect (button_box, &QDialogButtonBox::rejected, this, &StationDialog::reject); + connect (button_box_, &QDialogButtonBox::accepted, this, &StationDialog::accept); + connect (button_box_, &QDialogButtonBox::rejected, this, &StationDialog::reject); + connect (&delta_, &QLineEdit::textChanged, this, &StationDialog::update_accept_button); if (delta_.text ().isEmpty ()) { delta_.setText ("0"); } + update_accept_button (); } StationList::Station station () const @@ -447,11 +491,17 @@ public: } private: + void update_accept_button () + { + button_box_->button (QDialogButtonBox::Ok)->setEnabled (delta_.hasAcceptableInput ()); + } + QScopedPointer filtered_bands_; QComboBox band_; FrequencyDeltaLineEdit delta_; QLineEdit description_; + QDialogButtonBox * button_box_; }; class RearrangableMacrosModel @@ -493,22 +543,29 @@ public: ~impl (); bool have_rig (); - - void transceiver_frequency (Frequency); - void transceiver_tx_frequency (Frequency); + bool can_control_rig (char const * command) const; + void mark_rig_offline (); + static QString summarize_transceiver_failure (QString const& reason); + + RigFrequencyChangePolicy::Activity frequency_change_activity () const; + bool frequency_change_allowed (RigFrequencyChangePolicy::ChangeKind) const; + bool transceiver_frequency (Frequency, RigFrequencyChangePolicy::ChangeKind); + bool transceiver_tx_frequency (Frequency, RigFrequencyChangePolicy::ChangeKind); void transceiver_mode (MODE); void transceiver_ptt (bool); void transceiver_audio (bool); void transceiver_tune (bool); - void transceiver_period (double, bool = false); + void transceiver_period (double); void transceiver_blocksize (qint32); - void transceiver_modulator_start (QString, unsigned, double, double, double, bool, bool, double, double); + void transceiver_modulator_start (TxEvidence::TxRequest const&); + void transceiver_enqueue_jtty_pcm (QByteArray const&, TxAudioQueueEpoch, qint64); + void transceiver_clear_jtty_pcm (TxAudioQueueEpoch); void transceiver_modulator_stop (bool); void transceiver_spread (double); void transceiver_nsym (int); void transceiver_trfrequency (double); void transceiver_volume (double); - void transceiver_txvolume (double); + void transceiver_txvolume (double, bool = false); void sync_transceiver (bool force_signal); Q_SLOT int exec () override; @@ -518,6 +575,19 @@ public: private: typedef QList AudioDevices; + struct SettingsFocusPage + { + QWidget * page; + QList tab_stops; + }; + + bool eventFilter (QObject *, QEvent *) override; + void showEvent (QShowEvent *) override; + void register_settings_focus_page (QWidget * page, QList const& tab_stops); + QList current_settings_focus_path () const; + QList settings_dialog_buttons () const; + int settings_focus_index (QList const& path, QWidget * widget) const; + bool move_settings_focus (QList const& path, int current_index, bool reverse); void read_settings (); void write_settings (); @@ -544,8 +614,11 @@ private: } void set_cached_mode (); bool open_rig (bool force = false); + bool rig_restart_required (TransceiverFactory::ParameterPack const&, bool) const; + bool tx_inhibit_blocks_rig_restart (TransceiverFactory::ParameterPack const&, bool) const; + void warn_tx_inhibit_restart_blocked (); //bool set_mode (); - void close_rig (); + void close_rig (bool failed = false); TransceiverFactory::ParameterPack gather_rig_data (); void enumerate_rigs (); void set_rig_invariants (); @@ -566,22 +639,21 @@ private: void delete_stations (); void insert_station (); + void handle_cloudlog_connection_check_result (Cloudlog::ConnectionCheckResult const& result); + void set_cloudlog_station_profiles (QList const& profiles); + qint32 cloudlog_station_profile_id () const; Q_SLOT void on_font_push_button_clicked (); Q_SLOT void on_decoded_text_font_push_button_clicked (); Q_SLOT void on_PTT_port_combo_box_activated (int); Q_SLOT void on_CAT_port_combo_box_activated (int); Q_SLOT void on_CAT_serial_baud_combo_box_currentIndexChanged (int); - Q_SLOT void on_CAT_data_bits_button_group_buttonClicked (int); - Q_SLOT void on_CAT_stop_bits_button_group_buttonClicked (int); - Q_SLOT void on_CAT_handshake_button_group_buttonClicked (int); Q_SLOT void on_CAT_poll_interval_spin_box_valueChanged (int); - Q_SLOT void on_split_mode_button_group_buttonClicked (int); Q_SLOT void on_test_CAT_push_button_clicked (); Q_SLOT void on_test_PTT_push_button_clicked (bool checked); Q_SLOT void on_pbTestCloudlog_clicked (); - Q_SLOT void on_gbCloudlog_clicked (); - Q_SLOT void on_gbEQSL_clicked (); + Q_SLOT void on_cbCloudlog_toggled (bool checked); + Q_SLOT void on_cbEQSL_toggled (bool checked); Q_SLOT void on_force_DTR_combo_box_currentIndexChanged (int); Q_SLOT void on_force_RTS_combo_box_currentIndexChanged (int); Q_SLOT void on_rig_combo_box_currentIndexChanged (int); @@ -590,10 +662,13 @@ private: Q_SLOT void on_TCI_spin_box_valueChanged(double a); Q_SLOT void on_add_macro_push_button_clicked (bool = false); Q_SLOT void on_delete_macro_push_button_clicked (bool = false); - Q_SLOT void on_PTT_method_button_group_buttonClicked (int); + Q_SLOT void on_move_macro_up_push_button_clicked (bool = false); + Q_SLOT void on_move_macro_down_push_button_clicked (bool = false); Q_SLOT void on_add_macro_line_edit_editingFinished (); Q_SLOT void delete_macro (); void delete_selected_macros (QModelIndexList); + void move_selected_macros (int); + void move_selected_highlighting_rule (int); void after_CTY_downloaded(); void set_CTY_DAT_version(QString const& version); void error_during_CTY_download (QString const& reason); @@ -611,11 +686,14 @@ private: Q_SLOT void handle_transceiver_tci_mod_active (bool); Q_SLOT void handle_transceiver_update (TransceiverState const&, unsigned sequence_number); Q_SLOT void handle_transceiver_failure (QString const& reason); - Q_SLOT void on_DXCC_check_box_clicked(bool checked); - Q_SLOT void on_PWR_and_SWR_check_box_clicked(bool checked); - Q_SLOT void on_cbHighDPI_clicked(bool checked); + Q_SLOT void on_DXCC_check_box_toggled (bool); + void update_DXCC_control_availability (); + Q_SLOT void on_PWR_and_SWR_check_box_toggled (bool); + void update_PWR_and_SWR_control_availability (); Q_SLOT void on_reset_highlighting_to_defaults_push_button_clicked (bool); Q_SLOT void on_reset_highlighting_to_defaults2_push_button_clicked (bool); + Q_SLOT void on_move_highlighting_up_push_button_clicked (bool = false); + Q_SLOT void on_move_highlighting_down_push_button_clicked (bool = false); Q_SLOT void on_rescan_log_push_button_clicked (bool); Q_SLOT void on_CTY_download_button_clicked (bool); Q_SLOT void on_CALL3_download_button_clicked (bool); @@ -623,30 +701,16 @@ private: Q_SLOT void on_LotW_CSV_fetch_push_button_clicked (bool); Q_SLOT void on_hamlib_download_button_clicked (bool); Q_SLOT void on_revert_update_button_clicked (bool); - Q_SLOT void on_gbSpecialOpActivity_clicked (bool); - Q_SLOT void on_rbFox_clicked (bool); - Q_SLOT void on_rbHound_clicked (bool); - Q_SLOT void on_rbNA_VHF_Contest_clicked (bool); - Q_SLOT void on_rbEU_VHF_Contest_clicked (bool); - Q_SLOT void on_rbWW_DIGI_clicked (bool); - Q_SLOT void on_rbQ65pileup_clicked (bool); - Q_SLOT void on_rbField_Day_clicked (bool); - Q_SLOT void on_rbRTTY_Roundup_clicked (bool); - Q_SLOT void on_rbARRL_Digi_clicked (bool); - Q_SLOT void on_cbSuperFox_clicked (bool); - Q_SLOT void on_cbContestName_clicked (bool); - Q_SLOT void on_cbOTP_clicked (bool); - Q_SLOT void on_cbShowOTP_clicked (bool); - Q_SLOT void on_cb_NCCC_Sprint_clicked (bool); void error_during_hamlib_download (QString const& reason); void after_hamlib_downloaded(); void display_file_information(); void check_visibility(); - Q_SLOT void on_cbx2ToneSpacing_clicked(bool); - Q_SLOT void on_cbx4ToneSpacing_clicked(bool); - Q_SLOT void on_prompt_to_log_check_box_clicked(bool); - Q_SLOT void on_cbAutoLog_clicked(bool); + Q_SLOT void on_cbx2ToneSpacing_toggled (bool); + Q_SLOT void on_cbx4ToneSpacing_toggled (bool); + Q_SLOT void on_prompt_to_log_check_box_toggled (bool); + Q_SLOT void on_cbAutoLog_toggled (bool); + void update_logging_control_availability (); Q_SLOT void on_Field_Day_Exchange_editingFinished (); Q_SLOT void on_RTTY_Exchange_editingFinished (); Q_SLOT void on_OTPUrl_textEdited (QString const&); @@ -699,24 +763,29 @@ private: Q_SLOT void on_voices_combo_box_currentIndexChanged (int); Q_SLOT void on_pb_test_alerts_clicked (bool); void read_voices (); - void read_voicesPath (); + void read_voice_directory (); // typenames used as arguments must match registered type names :( Q_SIGNAL void start_transceiver (unsigned seqeunce_number) const; Q_SIGNAL void set_transceiver (Transceiver::TransceiverState const&, unsigned sequence_number) const; Q_SIGNAL void stop_transceiver () const; + Q_SIGNAL void enqueue_jtty_pcm (QByteArray const&, TxAudioQueueEpoch, qint64) const; + Q_SIGNAL void clear_jtty_pcm (TxAudioQueueEpoch) const; - Configuration * const self_; // back pointer to public interface + PerformanceTrace::Phase construction_trace_; + Configuration * const self_; // back pointer to public interface QThread * transceiver_thread_; TransceiverFactory transceiver_factory_; QList rig_connections_; QScopedPointer ui_; + QList settings_focus_pages_; QNetworkAccessManager * network_manager_; QSettings * settings_; + bool use_default_geometry_ {false}; LogBook * logbook_; QDir doc_dir_; @@ -790,6 +859,9 @@ private: bool rig_is_dummy_; bool is_tci_; bool rig_active_; + bool tx_inhibit_active_ {false}; + bool tx_inhibit_status_forwarded_ {false}; + quint64 tx_inhibit_generation_ {0}; bool have_rig_; bool rig_changed_; TransceiverState cached_rig_state_; @@ -797,6 +869,7 @@ private: CalibrationParams calibration_; bool frequency_calibration_disabled_; // not persistent unsigned transceiver_command_number_; + bool initializing_models_; QString dynamic_grid_; // configuration fields that we publish @@ -850,7 +923,7 @@ private: QString hamlib_backed_up_; QString cloudLogApiUrl_; QString cloudLogApiKey_; - QString voicesPath_; + QDir voice_directory_; bool send_to_eqsl_; QString eqsl_username_; QString eqsl_passwd_; @@ -876,7 +949,7 @@ private: double txDelay_; bool tci_audio_; bool id_after_73_; - bool tx_QSY_allowed_; + bool tx_frequency_corrections_allowed_; bool progressBar_red_; bool spot_to_psk_reporter_; bool psk_reporter_tcpip_; @@ -918,8 +991,6 @@ private: bool auto_astro_; bool single_decode_; bool twoPass_; - bool highDPI_; - bool largerTabWidget_; bool bSuperFox_; bool Individual_Contest_Name_; bool NCCC_Sprint_; @@ -986,7 +1057,9 @@ private: QAudioDeviceInfo next_audio_output_device_; AudioDevice::Channel audio_output_channel_; AudioDevice::Channel next_audio_output_channel_; - FileDownload cty_download; + FileDownload cty_download_; + FileDownload call3_download_; + FileDownload hamlib_download_; bool default_audio_input_device_selected_; bool default_audio_output_device_selected_; @@ -1038,7 +1111,7 @@ double Configuration::txDelay() const {return m_->txDelay_;} qint32 Configuration::RxBandwidth() const {return m_->RxBandwidth_;} bool Configuration::tci_audio () const {return m_->tci_audio_;} bool Configuration::id_after_73 () const {return m_->id_after_73_;} -bool Configuration::tx_QSY_allowed () const {return m_->tx_QSY_allowed_;} +bool Configuration::tx_frequency_corrections_allowed () const {return m_->tx_frequency_corrections_allowed_;} bool Configuration::progressBar_red () const {return m_->progressBar_red_;} bool Configuration::spot_to_psk_reporter () const { @@ -1092,8 +1165,6 @@ bool Configuration::repeat_Tx () const {return m_->repeat_Tx_;} bool Configuration::auto_astro () const {return m_->auto_astro_;} bool Configuration::single_decode () const {return m_->single_decode_;} bool Configuration::twoPass() const {return m_->twoPass_;} -bool Configuration::highDPI() const {return m_->highDPI_;} -bool Configuration::largerTabWidget() const {return m_->largerTabWidget_;} bool Configuration::superFox() const {return m_->bSuperFox_;} bool Configuration::Individual_Contest_Name() const {return m_->Individual_Contest_Name_;} bool Configuration::NCCC_Sprint() const {return m_->NCCC_Sprint_;} @@ -1191,7 +1262,8 @@ void Configuration::enable_calibration (bool on) { auto target_frequency = m_->remove_calibration (m_->cached_rig_state_.frequency ()) - m_->current_offset_; m_->frequency_calibration_disabled_ = !on; - transceiver_frequency (target_frequency); + transceiver_frequency ( + target_frequency, RigFrequencyChangePolicy::ChangeKind::TxPathCorrection); } bool Configuration::is_transceiver_online () const @@ -1226,49 +1298,58 @@ void Configuration::transceiver_offline () m_->close_rig (); } -void Configuration::transceiver_frequency (Frequency f) +bool Configuration::transceiver_frequency (Frequency f, RigFrequencyChangePolicy::ChangeKind kind) { LOG_TRACE (f << ' ' << m_->cached_rig_state_); - m_->transceiver_frequency (f); + if (!m_->frequency_change_allowed (kind)) return false; + if (!m_->can_control_rig ("transceiver_frequency")) return false; + return m_->transceiver_frequency (f, kind); } -void Configuration::transceiver_tx_frequency (Frequency f) +bool Configuration::transceiver_tx_frequency (Frequency f, RigFrequencyChangePolicy::ChangeKind kind) { LOG_TRACE (f << ' ' << m_->cached_rig_state_); - m_->transceiver_tx_frequency (f); + if (!m_->frequency_change_allowed (kind)) return false; + if (!m_->can_control_rig ("transceiver_tx_frequency")) return false; + return m_->transceiver_tx_frequency (f, kind); } void Configuration::transceiver_mode (MODE mode) { LOG_TRACE (mode << ' ' << m_->cached_rig_state_); + if (!m_->can_control_rig ("transceiver_mode")) return; m_->transceiver_mode (mode); } void Configuration::transceiver_ptt (bool on) { LOG_TRACE (on << ' ' << m_->cached_rig_state_); + if (!m_->can_control_rig ("transceiver_ptt")) return; m_->transceiver_ptt (on); } void Configuration::transceiver_audio (bool on) { LOG_TRACE (on << ' ' << m_->cached_rig_state_); + if (!m_->can_control_rig ("transceiver_audio")) return; m_->transceiver_audio (on); } void Configuration::transceiver_tune (bool on) { LOG_TRACE (on << ' ' << m_->cached_rig_state_); + if (!m_->can_control_rig ("transceiver_tune")) return; m_->transceiver_tune (on); } -void Configuration::transceiver_period (double period, bool force) +void Configuration::transceiver_period (double period) { #if WSJT_TRACE_CAT qDebug () << "Configuration::transceiver_period:" << period << m_->cached_rig_state_; #endif - m_->transceiver_period (period, force); + if (!m_->can_control_rig ("transceiver_period")) return; + m_->transceiver_period (period); } void Configuration::transceiver_blocksize (qint32 blocksize) @@ -1277,17 +1358,30 @@ void Configuration::transceiver_blocksize (qint32 blocksize) qDebug () << "Configuration::transceiver_blocksize:" << blocksize << m_->cached_rig_state_; #endif + if (!m_->can_control_rig ("transceiver_blocksize")) return; m_->transceiver_blocksize (blocksize); } -void Configuration::transceiver_modulator_start(QString jtmode, unsigned symbolslength, double framespersymbol, double trfrequency, - double tonespacing, bool synchronize, bool fastmode, double dbsnr, double trperiod) +void Configuration::transceiver_modulator_start (TxEvidence::TxRequest request) { #if WSJT_TRACE_CAT - qDebug () << "Configuration::transceiver_modulator_start:" << symbolslength << m_->cached_rig_state_; + qDebug () << "Configuration::transceiver_modulator_start:" << request.symbols_length << m_->cached_rig_state_; #endif - m_->transceiver_modulator_start(jtmode, symbolslength,framespersymbol,trfrequency,tonespacing,synchronize,fastmode,dbsnr,trperiod); + if (!m_->can_control_rig ("transceiver_modulator_start")) return; + m_->transceiver_modulator_start (request); +} + +void Configuration::transceiver_enqueue_jtty_pcm (QByteArray const& samples, + TxAudioQueueEpoch epoch, + qint64 enqueueId) +{ + m_->transceiver_enqueue_jtty_pcm (samples, epoch, enqueueId); +} + +void Configuration::transceiver_clear_jtty_pcm (TxAudioQueueEpoch epoch) +{ + m_->transceiver_clear_jtty_pcm (epoch); } void Configuration::transceiver_modulator_stop (bool on) @@ -1296,6 +1390,7 @@ void Configuration::transceiver_modulator_stop (bool on) qDebug () << "Configuration::transceiver_stop:" << on << m_->cached_rig_state_; #endif + if (!m_->can_control_rig ("transceiver_modulator_stop")) return; m_->transceiver_modulator_stop (on); } @@ -1305,6 +1400,7 @@ void Configuration::transceiver_spread (double spread) qDebug () << "Configuration::transceiver_spread:" << spread << m_->cached_rig_state_; #endif + if (!m_->can_control_rig ("transceiver_spread")) return; m_->transceiver_spread (spread); } @@ -1314,6 +1410,7 @@ void Configuration::transceiver_nsym (qint32 nsym) qDebug () << "Configuration::transceiver_nsym:" << nsym << m_->cached_rig_state_; #endif + if (!m_->can_control_rig ("transceiver_nsym")) return; m_->transceiver_nsym (nsym); } @@ -1323,16 +1420,18 @@ void Configuration::transceiver_trfrequency (double trfrequency) qDebug () << "Configuration::transceiver_trfrequency:" << trfrequency << m_->cached_rig_state_; #endif + if (!m_->can_control_rig ("transceiver_trfrequency")) return; m_->transceiver_trfrequency (trfrequency); } -void Configuration::transceiver_txvolume (qreal txvolume) +void Configuration::transceiver_txvolume (qreal txvolume, bool force) { #if WSJT_TRACE_CAT qDebug () << "Configuration::transceiver_txvolume:" << txvolume << m_->cached_rig_state_; #endif - m_->transceiver_txvolume (txvolume); + if (!m_->can_control_rig ("transceiver_txvolume")) return; + m_->transceiver_txvolume (txvolume, force); } void Configuration::transceiver_volume (qreal volume) @@ -1341,6 +1440,7 @@ void Configuration::transceiver_volume (qreal volume) qDebug () << "Configuration::transceiver_volume:" << volume << m_->cached_rig_state_; #endif + if (!m_->can_control_rig ("transceiver_volume")) return; m_->transceiver_volume (volume); } @@ -1348,10 +1448,11 @@ void Configuration::transceiver_volume (qreal volume) void Configuration::sync_transceiver (bool force_signal, bool enforce_mode_and_split) { LOG_TRACE ("force signal: " << force_signal << " enforce_mode_and_split: " << enforce_mode_and_split << ' ' << m_->cached_rig_state_); + if (!m_->can_control_rig ("sync_transceiver")) return; m_->sync_transceiver (force_signal); if (!enforce_mode_and_split) { - m_->transceiver_tx_frequency (0); + m_->transceiver_tx_frequency (0, RigFrequencyChangePolicy::ChangeKind::TxPathCorrection); } } @@ -1628,9 +1729,27 @@ QString Configuration::highlight_blue_callsigns() const return m_->highlight_blue_callsigns_; } -QString Configuration::voicesPath() const +QDir Configuration::voice_directory () const +{ + return m_->voice_directory_; +} + +QStringList Configuration::pass_keywords() const { - return m_->voicesPath_; + return {m_->Pass1_, m_->Pass2_, m_->Pass3_, m_->Pass4_, m_->Pass5_, m_->Pass6_, + m_->Pass7_, m_->Pass8_, m_->Pass9_, m_->Pass10_, m_->Pass11_, m_->Pass12_}; +} + +QStringList Configuration::blacklist_keywords() const +{ + return {m_->Blacklist1_, m_->Blacklist2_, m_->Blacklist3_, m_->Blacklist4_, m_->Blacklist5_, m_->Blacklist6_, + m_->Blacklist7_, m_->Blacklist8_, m_->Blacklist9_, m_->Blacklist10_, m_->Blacklist11_, m_->Blacklist12_}; +} + +QStringList Configuration::whitelist_keywords() const +{ + return {m_->Whitelist1_, m_->Whitelist2_, m_->Whitelist3_, m_->Whitelist4_, m_->Whitelist5_, m_->Whitelist6_, + m_->Whitelist7_, m_->Whitelist8_, m_->Whitelist9_, m_->Whitelist10_, m_->Whitelist11_, m_->Whitelist12_}; } auto Configuration::special_op_id () const -> SpecialOperatingActivity @@ -1648,7 +1767,7 @@ void Configuration::set_location (QString const& grid_descriptor) void Configuration::setSpecial_Q65_Pileup() { m_->bSpecialOp_=true; - m_->ui_->gbSpecialOpActivity->setChecked(m_->bSpecialOp_); + m_->ui_->cbSpecialOpActivity->setChecked(m_->bSpecialOp_); m_->ui_->rbQ65pileup->setChecked(true); m_->SelectedActivity_ = static_cast (SpecialOperatingActivity::Q65_PILEUP); m_->write_settings(); @@ -1657,7 +1776,7 @@ void Configuration::setSpecial_Q65_Pileup() void Configuration::setSpecial_Hound() { m_->bSpecialOp_=true; - m_->ui_->gbSpecialOpActivity->setChecked(m_->bSpecialOp_); + m_->ui_->cbSpecialOpActivity->setChecked(m_->bSpecialOp_); m_->ui_->rbHound->setChecked(true); m_->SelectedActivity_ = static_cast (SpecialOperatingActivity::HOUND); m_->write_settings(); @@ -1666,7 +1785,7 @@ void Configuration::setSpecial_Hound() void Configuration::setSpecial_Fox() { m_->bSpecialOp_=true; - m_->ui_->gbSpecialOpActivity->setChecked(m_->bSpecialOp_); + m_->ui_->cbSpecialOpActivity->setChecked(m_->bSpecialOp_); m_->ui_->rbFox->setChecked(true); m_->SelectedActivity_ = static_cast (SpecialOperatingActivity::FOX); m_->write_settings(); @@ -1675,14 +1794,14 @@ void Configuration::setSpecial_Fox() void Configuration::setSpecial_None() { m_->bSpecialOp_=false; - m_->ui_->gbSpecialOpActivity->setChecked(m_->bSpecialOp_); + m_->ui_->cbSpecialOpActivity->setChecked(m_->bSpecialOp_); m_->write_settings(); } void Configuration::setSpecial_On() { m_->bSpecialOp_=true; - m_->ui_->gbSpecialOpActivity->setChecked(m_->bSpecialOp_); + m_->ui_->cbSpecialOpActivity->setChecked(m_->bSpecialOp_); m_->write_settings(); } @@ -1742,24 +1861,174 @@ namespace #endif } - QString data_path () - { -#if CMAKE_BUILD - if (QDir::isRelativePath (CMAKE_INSTALL_DATADIR)) +} + +bool Configuration::impl::eventFilter (QObject *object, QEvent *event) +{ + if (event->type () == QEvent::KeyPress) + { + auto key_event = static_cast (event); + auto const navigation_modifiers = key_event->modifiers () + & (Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier); + auto const is_forward_tab = key_event->key () == Qt::Key_Tab + && navigation_modifiers == Qt::NoModifier; + auto const is_reverse_tab = (key_event->key () == Qt::Key_Tab + && navigation_modifiers == Qt::ShiftModifier) + || (key_event->key () == Qt::Key_Backtab + && (navigation_modifiers == Qt::NoModifier + || navigation_modifiers == Qt::ShiftModifier)); + auto const is_tab = is_forward_tab || is_reverse_tab; + if (is_tab) + { + auto const path = current_settings_focus_path (); + auto object_widget = qobject_cast (object); + auto current_index = settings_focus_index (path, QApplication::focusWidget ()); + if (current_index < 0) + { + current_index = settings_focus_index (path, object_widget); + } + if (current_index >= 0) + { + return move_settings_focus (path, current_index, is_reverse_tab); + } + } + } + + return QDialog::eventFilter (object, event); +} + +void Configuration::impl::register_settings_focus_page (QWidget * page, QList const& tab_stops) +{ + settings_focus_pages_.append ({page, tab_stops}); + + for (auto control : tab_stops) + { + control->setFocusPolicy (Qt::StrongFocus); + control->installEventFilter (this); + } +} + +void Configuration::impl::showEvent (QShowEvent * event) +{ + QDialog::showEvent (event); + + auto * window = windowHandle (); + auto * screen = window ? window->screen () : QGuiApplication::primaryScreen (); + if (!screen) + { + return; + } + + auto const requested_size = use_default_geometry_ + ? SettingsDialogLayout::preferredWindowSize (*this, *ui_) : size (); + use_default_geometry_ = false; + auto const bounded_size = SettingsDialogLayout::boundedWindowSize ( + requested_size, screen->availableGeometry ().size (), + window ? window->frameMargins () : QMargins {}); + if (bounded_size != size ()) + { + resize (bounded_size); + } +} + +QList Configuration::impl::current_settings_focus_path () const +{ + auto const current_page = ui_->configuration_tabs->currentWidget (); + for (auto const& focus_page : settings_focus_pages_) + { + if (focus_page.page == current_page) + { + auto path = QList {ui_->configuration_tabs}; + path.append (focus_page.tab_stops); + path.append (settings_dialog_buttons ()); + return path; + } + } + + return {}; +} + +QList Configuration::impl::settings_dialog_buttons () const +{ + QList buttons; + auto const button_box = ui_->configuration_dialog_button_box; + for (auto button : { + button_box->button (QDialogButtonBox::Ok), + button_box->button (QDialogButtonBox::Cancel), + }) + { + if (button) + { + buttons.append (button); + } + } + + std::sort (buttons.begin (), buttons.end (), [button_box] (QWidget * lhs, QWidget * rhs) { + auto const lhs_center = lhs->geometry ().center (); + auto const rhs_center = rhs->geometry ().center (); + if (button_box->orientation () == Qt::Vertical && lhs_center.y () != rhs_center.y ()) { - return QApplication::applicationDirPath () + app_root + CMAKE_INSTALL_DATADIR + QChar {'/'} + CMAKE_PROJECT_NAME; + return lhs_center.y () < rhs_center.y (); } - return CMAKE_INSTALL_DATADIR; -#else - return QApplication::applicationDirPath (); -#endif - } + + if (button_box->layoutDirection () == Qt::RightToLeft) + { + return lhs_center.x () > rhs_center.x (); + } + + return lhs_center.x () < rhs_center.x (); + }); + + return buttons; +} + +int Configuration::impl::settings_focus_index (QList const& path, QWidget * widget) const +{ + if (!widget) + { + return -1; + } + + auto const tab_bar = ui_->configuration_tabs->tabBar (); + for (int index = 0; index < path.size (); ++index) + { + if (path.at (index) == widget + || (path.at (index) == ui_->configuration_tabs && tab_bar == widget)) + { + return index; + } + } + + return -1; +} + +bool Configuration::impl::move_settings_focus (QList const& path, int current_index, bool reverse) +{ + if (current_index < 0 || path.isEmpty ()) + { + return false; + } + + auto const direction = reverse ? -1 : 1; + for (int offset = 1; offset <= path.size (); ++offset) + { + auto const next_index = (current_index + direction * offset + path.size ()) % path.size (); + auto next = path.at (next_index); + if (next->isEnabledTo (this) && next->isVisibleTo (this)) + { + next->setFocus (reverse ? Qt::BacktabFocusReason : Qt::TabFocusReason); + return true; + } + } + + return false; } Configuration::impl::impl (Configuration * self, QNetworkAccessManager * network_manager , QDir const& temp_directory, QSettings * settings, LogBook * logbook , QWidget * parent) : QDialog {parent} + , construction_trace_ {"configuration.construct"} , self_ {self} , transceiver_thread_ {nullptr} , ui_ {new Ui::configuration_dialog} @@ -1767,11 +2036,11 @@ Configuration::impl::impl (Configuration * self, QNetworkAccessManager * network , settings_ {settings} , logbook_ {logbook} , doc_dir_ {doc_path ()} - , data_dir_ {data_path ()} + , data_dir_ {installed_data_directory ()} , temp_dir_ {temp_directory} , writeable_data_dir_ {QStandardPaths::writableLocation (QStandardPaths::DataLocation)} , lotw_users_ {network_manager_} - , cloudlog_ {self} + , cloudlog_ {self, network_manager_} , restart_sound_input_device_ {false} , restart_sound_output_device_ {false} , restart_tci_device_ {false} @@ -1804,16 +2073,461 @@ Configuration::impl::impl (Configuration * self, QNetworkAccessManager * network , rig_resolution_ {0} , frequency_calibration_disabled_ {false} , transceiver_command_number_ {0} + , initializing_models_ {false} , degrade_ {0.} // initialize to zero each run, not // saved in settings , udp_server_name_edited_ {false} , dns_lookup_id_ {-1} + , audio_input_channel_ {AudioDevice::Mono} + , next_audio_input_channel_ {AudioDevice::Mono} + , audio_output_channel_ {AudioDevice::Mono} + , next_audio_output_channel_ {AudioDevice::Mono} , default_audio_input_device_selected_ {false} , default_audio_output_device_selected_ {false} { - ui_->setupUi (this); + { + PerformanceTrace::Phase ui_setup {"configuration.ui_setup"}; + ui_->setupUi (this); + } + + SettingsDialogLayout::install (*ui_); + + installEventFilter (this); + ui_->configuration_tabs->setFocusPolicy (Qt::StrongFocus); + ui_->configuration_tabs->installEventFilter (this); + ui_->configuration_tabs->tabBar ()->installEventFilter (this); + ui_->configuration_dialog_button_box->installEventFilter (this); + for (auto button : settings_dialog_buttons ()) + { + button->setFocusPolicy (Qt::StrongFocus); + button->installEventFilter (this); + } + + auto update_rig_invariants_when_checked = [this] (QButtonGroup *button_group) { +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + connect (button_group, QOverload::of (&QButtonGroup::buttonToggled), +#else + connect (button_group, &QButtonGroup::idToggled, +#endif + this, [this] (int, bool checked) { + if (checked && !initializing_models_) + { + set_rig_invariants (); + } + }); + }; + update_rig_invariants_when_checked (ui_->CAT_data_bits_button_group); + update_rig_invariants_when_checked (ui_->CAT_stop_bits_button_group); + update_rig_invariants_when_checked (ui_->CAT_handshake_button_group); + update_rig_invariants_when_checked (ui_->PTT_method_button_group); + update_rig_invariants_when_checked (ui_->split_mode_button_group); + + auto set_accessible_line_edit_names = [] (QList const& line_edits, + QString const& name_template) { + for (int index = 0; index < line_edits.size (); ++index) + { + line_edits.at (index)->setAccessibleName (name_template.arg (index + 1)); + } + }; + set_accessible_line_edit_names ({ + ui_->Territory1, + ui_->Territory2, + ui_->Territory3, + ui_->Territory4, + }, tr ("Wanted territory %1")); + set_accessible_line_edit_names ({ + ui_->Blacklist1, + ui_->Blacklist2, + ui_->Blacklist3, + ui_->Blacklist4, + ui_->Blacklist5, + ui_->Blacklist6, + ui_->Blacklist7, + ui_->Blacklist8, + ui_->Blacklist9, + ui_->Blacklist10, + ui_->Blacklist11, + ui_->Blacklist12, + }, tr ("Blacklist keyword %1")); + set_accessible_line_edit_names ({ + ui_->Whitelist1, + ui_->Whitelist2, + ui_->Whitelist3, + ui_->Whitelist4, + ui_->Whitelist5, + ui_->Whitelist6, + ui_->Whitelist7, + ui_->Whitelist8, + ui_->Whitelist9, + ui_->Whitelist10, + ui_->Whitelist11, + ui_->Whitelist12, + }, tr ("Whitelist keyword %1")); + set_accessible_line_edit_names ({ + ui_->Pass1, + ui_->Pass2, + ui_->Pass3, + ui_->Pass4, + ui_->Pass5, + ui_->Pass6, + ui_->Pass7, + ui_->Pass8, + ui_->Pass9, + ui_->Pass10, + ui_->Pass11, + ui_->Pass12, + }, tr ("Always pass keyword %1")); + + ui_->CAT_port_combo_box->setAccessibleName (tr ("CAT control port")); + ui_->CAT_serial_baud_combo_box->setAccessibleName (tr ("CAT baud rate")); + ui_->CAT_default_bit_radio_button->setAccessibleName (tr ("Default CAT data bits")); + ui_->CAT_7_bit_radio_button->setAccessibleName (tr ("Seven CAT data bits")); + ui_->CAT_8_bit_radio_button->setAccessibleName (tr ("Eight CAT data bits")); + ui_->CAT_default_stop_bit_radio_button->setAccessibleName (tr ("Default CAT stop bits")); + ui_->CAT_one_stop_bit_radio_button->setAccessibleName (tr ("One CAT stop bit")); + ui_->CAT_two_stop_bit_radio_button->setAccessibleName (tr ("Two CAT stop bits")); + ui_->CAT_handshake_default_radio_button->setAccessibleName (tr ("Default CAT handshake")); + ui_->CAT_handshake_none_radio_button->setAccessibleName (tr ("No CAT handshake")); + ui_->CAT_handshake_xon_radio_button->setAccessibleName (tr ("XON/XOFF CAT handshake")); + ui_->CAT_handshake_hardware_radio_button->setAccessibleName (tr ("Hardware CAT handshake")); + ui_->force_DTR_combo_box->setAccessibleName (tr ("Force DTR control line")); + ui_->force_RTS_combo_box->setAccessibleName (tr ("Force RTS control line")); + ui_->PTT_VOX_radio_button->setAccessibleName (tr ("VOX PTT method")); + ui_->PTT_DTR_radio_button->setAccessibleName (tr ("DTR PTT method")); + ui_->PTT_CAT_radio_button->setAccessibleName (tr ("CAT PTT method")); + ui_->PTT_RTS_radio_button->setAccessibleName (tr ("RTS PTT method")); + ui_->PTT_port_combo_box->setAccessibleName (tr ("PTT control port")); + ui_->TX_source_data_radio_button->setAccessibleName (tr ("Rear or data transmit audio source")); + ui_->TX_source_mic_radio_button->setAccessibleName (tr ("Front or mic transmit audio source")); + ui_->mode_none_radio_button->setAccessibleName (tr ("No radio mode control")); + ui_->mode_USB_radio_button->setAccessibleName (tr ("USB radio mode")); + ui_->mode_data_radio_button->setAccessibleName (tr ("Data or packet radio mode")); + ui_->split_none_radio_button->setAccessibleName (tr ("No split operation")); + ui_->split_rig_radio_button->setAccessibleName (tr ("Rig split operation")); + ui_->split_emulate_radio_button->setAccessibleName (tr ("Fake It split operation")); + ui_->CAT_poll_interval_spin_box->setAccessibleName (tr ("CAT poll interval")); + ui_->calibration_slope_ppm_spin_box->setAccessibleName (tr ("Frequency calibration slope")); + ui_->calibration_intercept_spin_box->setAccessibleName (tr ("Frequency calibration intercept")); + ui_->frequencies_table_view->setAccessibleName (tr ("Working frequencies table")); + ui_->stations_table_view->setAccessibleName (tr ("Station information table")); + ui_->highlighting_list_view->setAccessibleName (tr ("Decode highlighting rules")); + ui_->highlighting_list_view->setAccessibleDescription (tr ("Highlighting rules and priorities for decoded messages.")); + ui_->highlighting_actions_tool_button->setAccessibleName (tr ("Decode highlighting actions")); + ui_->highlighting_actions_tool_button->setAccessibleDescription (tr ("Change or reset colors for the selected highlighting rule.")); + ui_->move_highlighting_up_push_button->setAccessibleName (tr ("Move selected highlighting rule up")); + ui_->move_highlighting_up_push_button->setAccessibleDescription (tr ("Move the selected highlighting rule earlier in priority order.")); + ui_->move_highlighting_down_push_button->setAccessibleName (tr ("Move selected highlighting rule down")); + ui_->move_highlighting_down_push_button->setAccessibleDescription (tr ("Move the selected highlighting rule later in priority order.")); + ui_->highlight_orange_callsigns->setAccessibleName (tr ("Orange highlight callsigns and grids")); + ui_->highlight_blue_callsigns->setAccessibleName (tr ("Blue highlight callsigns and grids")); + + register_settings_focus_page (ui_->general_tab, { + ui_->callsign_line_edit, + ui_->grid_line_edit, + ui_->use_dynamic_grid, + ui_->region_combo_box, + ui_->type_2_msg_gen_combo_box, + ui_->decodes_from_top_check_box, + ui_->insert_blank_check_box, + ui_->cb_detailed_blank_line, + ui_->miles_check_box, + ui_->cbHighlightDXcall, + ui_->font_push_button, + ui_->TX_messages_check_box, + ui_->cbHighlightDXgrid, + ui_->decoded_text_font_push_button, + ui_->DXCC_check_box, + ui_->ppfx_check_box, + ui_->show_country_names_check_box, + ui_->monitor_off_check_box, + ui_->enable_VHF_features_check_box, + ui_->repeat_Tx_check_box, + ui_->monitor_last_used_check_box, + ui_->tx_frequency_corrections_check_box, + ui_->auto_astro_check_box, + ui_->quick_call_check_box, + ui_->decode_at_52s_check_box, + ui_->kHz_without_k_check_box, + ui_->disable_TX_on_73_check_box, + ui_->single_decode_check_box, + ui_->progress_bar_check_box, + ui_->force_call_1st_check_box, + ui_->CW_id_after_73_check_box, + ui_->CW_id_interval_spin_box, + ui_->alternate_bindings_check_box, + ui_->tune_watchdog_check_box, + ui_->tune_watchdog_spin_box, + ui_->tx_watchdog_spin_box, + ui_->Map_Grid_to_State, + ui_->cbEraseBandActivity, + ui_->alternate_erase_button_check_box, + ui_->Map_All_Messages, + ui_->cbRxToTxAfterQSO, + ui_->enable_Wait_features_check_box, + ui_->cbClearDXcall, + ui_->cbClearDXgrid, + ui_->disable_button_coloring_check_box, + ui_->cb_showDistance, + ui_->cb_showAzimuth, + ui_->cb_Align, + ui_->align_spin_box, + ui_->align_spin_box2, + }); + + register_settings_focus_page (ui_->radio_tab, { + ui_->rig_combo_box, + ui_->CAT_poll_interval_spin_box, + ui_->CAT_port_combo_box, + ui_->CAT_serial_baud_combo_box, + ui_->CAT_default_bit_radio_button, + ui_->CAT_7_bit_radio_button, + ui_->CAT_8_bit_radio_button, + ui_->CAT_default_stop_bit_radio_button, + ui_->CAT_one_stop_bit_radio_button, + ui_->CAT_two_stop_bit_radio_button, + ui_->CAT_handshake_default_radio_button, + ui_->CAT_handshake_none_radio_button, + ui_->CAT_handshake_xon_radio_button, + ui_->CAT_handshake_hardware_radio_button, + ui_->force_DTR_combo_box, + ui_->force_RTS_combo_box, + ui_->PTT_VOX_radio_button, + ui_->PTT_DTR_radio_button, + ui_->PTT_CAT_radio_button, + ui_->PTT_RTS_radio_button, + ui_->PTT_port_combo_box, + ui_->TX_source_data_radio_button, + ui_->TX_source_mic_radio_button, + ui_->mode_none_radio_button, + ui_->mode_USB_radio_button, + ui_->mode_data_radio_button, + ui_->split_none_radio_button, + ui_->split_rig_radio_button, + ui_->split_emulate_radio_button, + ui_->test_CAT_push_button, + ui_->test_PTT_push_button, + ui_->rbHamlib64, + ui_->rbHamlib32, + ui_->hamlib_download_button, + ui_->revert_update_button, + ui_->PWR_and_SWR_check_box, + ui_->check_SWR_check_box, + }); + + register_settings_focus_page (ui_->audio_tab, { + ui_->sound_input_combo_box, + ui_->sound_input_channel_combo_box, + ui_->sound_output_combo_box, + ui_->sound_output_channel_combo_box, + ui_->refresh_push_button, + ui_->tci_audio_check_box, + ui_->TCI_spin_box, + ui_->cbSortAlphabetically, + ui_->cbHideCARD, + ui_->save_path_select_push_button, + ui_->azel_path_select_push_button, + ui_->checkBoxAzElExtraLines, + ui_->checkBoxPwrBandTxMemory, + ui_->checkBoxPwrBandTuneMemory, + }); + + register_settings_focus_page (ui_->tx_macros_tab, { + ui_->add_macro_line_edit, + ui_->add_macro_push_button, + ui_->delete_macro_push_button, + ui_->move_macro_up_push_button, + ui_->move_macro_down_push_button, + ui_->macros_list_view, + }); + + register_settings_focus_page (ui_->reporting_tab, { + ui_->prompt_to_log_check_box, + ui_->opCallEntry, + ui_->cbAutoLog, + ui_->cbContestingOnly, + ui_->cbZZ00, + ui_->cbLog4digitGrids, + ui_->log_as_RTTY_check_box, + ui_->report_in_comments_check_box, + ui_->specOp_in_comments_check_box, + ui_->psk_reporter_check_box, + ui_->psk_reporter_tcpip_check_box, + ui_->udp_server_line_edit, + ui_->udp_server_port_spin_box, + ui_->udp_interfaces_combo_box, + ui_->udp_TTL_spin_box, + ui_->accept_udp_requests_check_box, + ui_->udpWindowToFront, + ui_->udpWindowRestore, + ui_->enable_n1mm_broadcast_check_box, + ui_->n1mm_server_name_line_edit, + ui_->n1mm_server_port_spin_box, + }); + + register_settings_focus_page (ui_->frequencies_tab, { + ui_->calibration_slope_ppm_spin_box, + ui_->calibration_intercept_spin_box, + ui_->frequencies_actions_tool_button, + ui_->frequencies_table_view, + ui_->stations_actions_tool_button, + ui_->stations_table_view, + }); + + register_settings_focus_page (ui_->colors_tab, { + ui_->highlighting_list_view, + ui_->highlighting_actions_tool_button, + ui_->move_highlighting_up_push_button, + ui_->move_highlighting_down_push_button, + ui_->reset_highlighting_to_defaults_push_button, + ui_->reset_highlighting_to_defaults2_push_button, + ui_->rescan_log_push_button, + ui_->highlight_by_mode_check_box, + ui_->highlight_orange_check_box, + ui_->highlight_orange_callsigns, + ui_->only_fields_check_box, + ui_->include_WAE_check_box, + ui_->highlight_blue_check_box, + ui_->highlight_blue_callsigns, + ui_->highlight_73_check_box, + ui_->LotW_CSV_URL_line_edit, + ui_->LotW_CSV_fetch_push_button, + ui_->LotW_days_since_upload_spin_box, + ui_->CTY_download_button, + ui_->CALL3_download_button, + ui_->CALL3_EME_download_button, + }); + + register_settings_focus_page (ui_->advanced_tab, { + ui_->sbNtrials, + ui_->sbAggressive, + ui_->cbTwoPass, + ui_->sbDegrade, + ui_->sbBandwidth, + ui_->sbTxDelay, + ui_->cbx2ToneSpacing, + ui_->cbx4ToneSpacing, + ui_->rbLowSidelobes, + ui_->rbMaxSensitivity, + ui_->cbSpecialOpActivity, + ui_->rbFox, + ui_->cbSuperFox, + ui_->rbHound, + ui_->cbOTP, + ui_->OTPSeed, + ui_->sbOTPinterval, + ui_->cbShowOTP, + ui_->OTPUrl, + ui_->rbNA_VHF_Contest, + ui_->cb_NCCC_Sprint, + ui_->rbField_Day, + ui_->Field_Day_Exchange, + ui_->rbEU_VHF_Contest, + ui_->rbRTTY_Roundup, + ui_->RTTY_Exchange, + ui_->rbWW_DIGI, + ui_->rbARRL_Digi, + ui_->rbQ65pileup, + ui_->cbContestName, + ui_->Contest_Name, + ui_->cbCloudlog, + ui_->leCloudlogApiUrl, + ui_->leCloudlogApiKey, + ui_->cbCloudlogStationProfile, + ui_->pbTestCloudlog, + ui_->cbEQSL, + ui_->eqsluser_edit, + ui_->eqslpasswd_edit, + ui_->eqslnick_edit, + }); + + register_settings_focus_page (ui_->alerts_tab, { + ui_->voices_combo_box, + ui_->pb_test_alerts, + ui_->cbContinent, + ui_->cbContinentOB, + ui_->cbDXCC, + ui_->cbDXCCOB, + ui_->cbCQZ, + ui_->cbCQZOB, + ui_->cbITUZ, + ui_->cbITUZOB, + ui_->cbGrid, + ui_->cbGridOB, + ui_->cbMyCall, + ui_->cbWanted, + ui_->cbDXcall, + ui_->cbQSYmessage, + ui_->cbCQ, + ui_->pbAlerts, + }); + + register_settings_focus_page (ui_->filters_tab, { + ui_->Territory1, + ui_->Territory2, + ui_->Territory3, + ui_->Territory4, + ui_->cbBlacklist, + ui_->Blacklist1, + ui_->Blacklist2, + ui_->Blacklist3, + ui_->Blacklist4, + ui_->Blacklist5, + ui_->Blacklist6, + ui_->Blacklist7, + ui_->Blacklist8, + ui_->Blacklist9, + ui_->Blacklist10, + ui_->Blacklist11, + ui_->Blacklist12, + ui_->cbWhitelist, + ui_->Whitelist1, + ui_->Whitelist2, + ui_->Whitelist3, + ui_->Whitelist4, + ui_->Whitelist5, + ui_->Whitelist6, + ui_->Whitelist7, + ui_->Whitelist8, + ui_->Whitelist9, + ui_->Whitelist10, + ui_->Whitelist11, + ui_->Whitelist12, + ui_->cbPass, + ui_->Pass1, + ui_->Pass2, + ui_->Pass3, + ui_->Pass4, + ui_->Pass5, + ui_->Pass6, + ui_->Pass7, + ui_->Pass8, + ui_->Pass9, + ui_->Pass10, + ui_->Pass11, + ui_->Pass12, + ui_->cb_filters_for_word2, + ui_->cb_filters_for_Wait_and_Pounce_only, + ui_->cb_twoDays, + }); + + auto update_visibility_when_toggled = [this] (QAbstractButton *button) { + connect (button, &QAbstractButton::toggled, this, &Configuration::impl::check_visibility); + }; + update_visibility_when_toggled (ui_->cbSpecialOpActivity); + update_visibility_when_toggled (ui_->rbFox); + update_visibility_when_toggled (ui_->rbHound); + update_visibility_when_toggled (ui_->rbNA_VHF_Contest); + update_visibility_when_toggled (ui_->rbEU_VHF_Contest); + update_visibility_when_toggled (ui_->rbField_Day); + update_visibility_when_toggled (ui_->rbRTTY_Roundup); + update_visibility_when_toggled (ui_->rbWW_DIGI); + update_visibility_when_toggled (ui_->rbARRL_Digi); + update_visibility_when_toggled (ui_->rbQ65pileup); + update_visibility_when_toggled (ui_->cbOTP); + update_visibility_when_toggled (ui_->cbContestName); { + PerformanceTrace::Phase data_directories {"configuration.data_directories"}; // Make sure the default save directory exists QString save_dir {"save"}; default_save_directory_ = writeable_data_dir_; @@ -1857,7 +2571,10 @@ Configuration::impl::impl (Configuration * self, QNetworkAccessManager * network } // this must be done after the default paths above are set - read_settings (); + { + PerformanceTrace::Phase settings_read {"configuration.settings_read"}; + read_settings (); + } // set up dynamic loading of audio devices connect (ui_->sound_input_combo_box, &LazyFillComboBox::about_to_show_popup, [this] () { @@ -1894,19 +2611,7 @@ Configuration::impl::impl (Configuration * self, QNetworkAccessManager * network lotw_users_.set_local_file_path (writeable_data_dir_.absoluteFilePath ("lotw-user-activity.csv")); - // set up Cloudlog API key test button - connect (&cloudlog_, &Cloudlog::apikey_ok, [this] () { - ui_->pbTestCloudlog->setStyleSheet ("QPushButton {background-color: green;}"); - ui_->pbTestCloudlog->setToolTip (tr ("API key OK")); - }); - connect (&cloudlog_, &Cloudlog::apikey_ro, [this] () { - ui_->pbTestCloudlog->setStyleSheet ("QPushButton {background-color: orange;}"); - ui_->pbTestCloudlog->setToolTip (tr ("API key read-only")); - }); - connect (&cloudlog_, &Cloudlog::apikey_invalid, [this] () { - ui_->pbTestCloudlog->setStyleSheet ("QPushButton {background-color: red;}"); - ui_->pbTestCloudlog->setToolTip (tr ("API key invalid")); - }); + connect (&cloudlog_, &Cloudlog::connection_check_finished, this, &Configuration::impl::handle_cloudlog_connection_check_result); // // validation @@ -1964,7 +2669,10 @@ Configuration::impl::impl (Configuration * self, QNetworkAccessManager * network // // setup PTT port combo box drop down content // - fill_port_combo_box (ui_->PTT_port_combo_box); + { + PerformanceTrace::Phase serial_ports {"configuration.serial_ports"}; + fill_port_combo_box (ui_->PTT_port_combo_box); + } ui_->PTT_port_combo_box->addItem ("CAT"); ui_->PTT_port_combo_box->setItemData (ui_->PTT_port_combo_box->count () - 1, "Delegate to proxy CAT service", Qt::ToolTipRole); @@ -1986,6 +2694,7 @@ Configuration::impl::impl (Configuration * self, QNetworkAccessManager * network // ui_->macros_list_view->setModel (&next_macros_); ui_->macros_list_view->setItemDelegate (new MessageItemDelegate {this}); + ui_->macros_list_view->setTabKeyNavigation (false); macro_delete_action_ = new QAction {tr ("&Delete"), ui_->macros_list_view}; ui_->macros_list_view->insertAction (nullptr, macro_delete_action_); @@ -2000,6 +2709,7 @@ Configuration::impl::impl (Configuration * self, QNetworkAccessManager * network frequencies_.sort (FrequencyList_v2_101::frequency_column); ui_->frequencies_table_view->setModel (&next_frequencies_); + ui_->frequencies_table_view->setTabKeyNavigation (false); ui_->frequencies_table_view->horizontalHeader ()->setSectionResizeMode (QHeaderView::ResizeToContents); ui_->frequencies_table_view->horizontalHeader ()->setResizeContentsPrecision (0); @@ -2040,11 +2750,23 @@ Configuration::impl::impl (Configuration * self, QNetworkAccessManager * network ui_->frequencies_table_view->insertAction (nullptr, reset_frequencies_action_); connect (reset_frequencies_action_, &QAction::triggered, this, &Configuration::impl::reset_frequencies); + auto frequencies_actions_menu = new QMenu {ui_->frequencies_actions_tool_button}; + frequencies_actions_menu->addAction (frequency_insert_action_); + frequencies_actions_menu->addAction (frequency_delete_action_); + frequencies_actions_menu->addSeparator (); + frequencies_actions_menu->addAction (load_frequencies_action_); + frequencies_actions_menu->addAction (save_frequencies_action_); + frequencies_actions_menu->addAction (merge_frequencies_action_); + frequencies_actions_menu->addSeparator (); + frequencies_actions_menu->addAction (reset_frequencies_action_); + ui_->frequencies_actions_tool_button->setMenu (frequencies_actions_menu); + // // setup stations table model & view // stations_.sort (StationList::band_column); ui_->stations_table_view->setModel (&next_stations_); + ui_->stations_table_view->setTabKeyNavigation (false); ui_->stations_table_view->horizontalHeader ()->setSectionResizeMode (QHeaderView::ResizeToContents); ui_->stations_table_view->horizontalHeader ()->setResizeContentsPrecision (0); ui_->stations_table_view->verticalHeader ()->setSectionResizeMode (QHeaderView::ResizeToContents); @@ -2062,13 +2784,35 @@ Configuration::impl::impl (Configuration * self, QNetworkAccessManager * network ui_->stations_table_view->addAction (&station_insert_action_); connect (&station_insert_action_, &QAction::triggered, this, &Configuration::impl::insert_station); + auto stations_actions_menu = new QMenu {ui_->stations_actions_tool_button}; + stations_actions_menu->addAction (&station_insert_action_); + stations_actions_menu->addAction (&station_delete_action_); + ui_->stations_actions_tool_button->setMenu (stations_actions_menu); + // // colours and highlighting setup // ui_->highlighting_list_view->setModel (&next_decode_highlighing_model_); + ui_->highlighting_list_view->setTabKeyNavigation (false); + auto highlighting_actions_menu = new QMenu {ui_->highlighting_actions_tool_button}; + highlighting_actions_menu->addActions (ui_->highlighting_list_view->actions ()); + connect (highlighting_actions_menu, &QMenu::aboutToShow, this, [this, highlighting_actions_menu] { + auto const has_current_rule = ui_->highlighting_list_view->currentIndex ().isValid (); + for (auto action : highlighting_actions_menu->actions ()) + { + action->setEnabled (has_current_rule); + } + }); + ui_->highlighting_actions_tool_button->setMenu (highlighting_actions_menu); - enumerate_rigs (); - initialize_models (); + { + PerformanceTrace::Phase rig_models {"configuration.rig_models"}; + enumerate_rigs (); + } + { + PerformanceTrace::Phase models {"configuration.models_initialize"}; + initialize_models (); + } restart_tci_device_ = false; audio_input_device_ = next_audio_input_device_; @@ -2095,17 +2839,26 @@ Configuration::impl::impl (Configuration * self, QNetworkAccessManager * network ui_->eqsluser_edit->setText (eqsl_username_); ui_->eqslpasswd_edit->setText (eqsl_passwd_); ui_->eqslnick_edit->setText (eqsl_nickname_); + construction_trace_.finish (); } Configuration::impl::~impl () { - transceiver_thread_->quit (); - transceiver_thread_->wait (); - write_settings (); + { + PerformanceTrace::Phase transceiver_thread {"transceiver_thread.shutdown"}; + transceiver_thread_->quit (); + transceiver_thread_->wait (); + } + { + PerformanceTrace::Phase settings_write {"configuration.settings_write"}; + write_settings (); + } } void Configuration::impl::initialize_models () { + QScopedValueRollback initializing_models {initializing_models_, true}; + next_audio_input_device_ = audio_input_device_; next_audio_input_channel_ = audio_input_channel_; next_audio_output_device_ = audio_output_device_; @@ -2145,11 +2898,11 @@ void Configuration::impl::initialize_models () ui_->PTT_method_button_group->button (rig_params_.ptt_type)->setChecked (true); ui_->PWR_and_SWR_check_box->setChecked (PWR_and_SWR_); ui_->check_SWR_check_box->setChecked (check_SWR_); - if (!ui_->PWR_and_SWR_check_box->isChecked()) ui_->check_SWR_check_box->setEnabled (false); + update_PWR_and_SWR_control_availability (); ui_->save_path_display_label->setText (save_directory_.absolutePath ()); ui_->azel_path_display_label->setText (azel_directory_.absolutePath ()); ui_->CW_id_after_73_check_box->setChecked (id_after_73_); - ui_->tx_QSY_check_box->setChecked (tx_QSY_allowed_); + ui_->tx_frequency_corrections_check_box->setChecked (tx_frequency_corrections_allowed_); ui_->progress_bar_check_box->setChecked (progressBar_red_); ui_->psk_reporter_check_box->setChecked (spot_to_psk_reporter_); ui_->psk_reporter_tcpip_check_box->setChecked (psk_reporter_tcpip_); @@ -2161,6 +2914,7 @@ void Configuration::impl::initialize_models () ui_->prompt_to_log_check_box->setChecked (prompt_to_log_); ui_->cbAutoLog->setChecked(autoLog_); ui_->cbContestingOnly->setChecked(contestingOnly_); + update_logging_control_availability (); ui_->cbZZ00->setChecked(ZZ00_); ui_->cbLog4digitGrids->setChecked(log4digitGrids_); ui_->decodes_from_top_check_box->setChecked (decodes_from_top_); @@ -2169,10 +2923,7 @@ void Configuration::impl::initialize_models () ui_->DXCC_check_box->setChecked (DXCC_); ui_->ppfx_check_box->setChecked (ppfx_); ui_->show_country_names_check_box->setChecked (show_country_names_); - if (!ui_->DXCC_check_box->isChecked()) { - ui_->ppfx_check_box->setEnabled (false); - ui_->show_country_names_check_box->setEnabled (false); - } + update_DXCC_control_availability (); ui_->Map_Grid_to_State->setChecked(gridMap_); ui_->Map_All_Messages->setChecked(gridMapAll_); ui_->miles_check_box->setChecked (miles_); @@ -2196,8 +2947,6 @@ void Configuration::impl::initialize_models () ui_->auto_astro_check_box->setChecked(auto_astro_); ui_->single_decode_check_box->setChecked(single_decode_); ui_->cbTwoPass->setChecked(twoPass_); - ui_->cbHighDPI->setChecked(highDPI_); - ui_->cbLargerTabWidget->setChecked(largerTabWidget_); ui_->cbSuperFox->setChecked(bSuperFox_); ui_->cbContestName->setChecked(Individual_Contest_Name_); ui_->cb_NCCC_Sprint->setChecked(NCCC_Sprint_); @@ -2207,12 +2956,18 @@ void Configuration::impl::initialize_models () ui_->cb_filters_for_Wait_and_Pounce_only->setChecked(filters_for_Wait_and_Pounce_only_); ui_->cb_filters_for_word2->setChecked(filters_for_word2_); ui_->cb_twoDays->setChecked(twoDays_); - ui_->gbSpecialOpActivity->setChecked(bSpecialOp_); - ui_->gbCloudlog->setChecked(bCloudLog_); - ui_->gbEQSL->setChecked(send_to_eqsl_); + ui_->cbSpecialOpActivity->setChecked(bSpecialOp_); + ui_->cbCloudlog->setChecked(bCloudLog_); + ui_->cbEQSL->setChecked(send_to_eqsl_); ui_->leCloudlogApiUrl->setText(cloudLogApiUrl_); ui_->leCloudlogApiKey->setText(cloudLogApiKey_); - ui_->sbCloudlogStationID->setValue (cloudLogStationID_); + ui_->cbCloudlogStationProfile->clear (); + if (cloudLogStationID_ > 0) + { + ui_->cbCloudlogStationProfile->addItem (QString::number (cloudLogStationID_), cloudLogStationID_); + } + on_cbCloudlog_toggled (ui_->cbCloudlog->isChecked ()); + on_cbEQSL_toggled (ui_->cbEQSL->isChecked ()); ui_->special_op_activity_button_group->button (SelectedActivity_)->setChecked (true); ui_->cbx2ToneSpacing->setChecked(x2ToneSpacing_); ui_->cbx4ToneSpacing->setChecked(x4ToneSpacing_); @@ -2344,7 +3099,11 @@ void Configuration::impl::read_settings () LOG_INFO(QString{"Configuration Settings (%1)"}.arg(settings_->fileName())); QStringList keys = settings_->allKeys(); - restoreGeometry (settings_->value ("window/geometry").toByteArray ()); + use_default_geometry_ = !settings_->contains ("window/geometry"); + if (!use_default_geometry_) + { + restoreGeometry (settings_->value ("window/geometry").toByteArray ()); + } my_callsign_ = settings_->value ("MyCall", QString {}).toString (); my_grid_ = settings_->value ("MyGrid", QString {}).toString (); @@ -2489,7 +3248,7 @@ void Configuration::impl::read_settings () save_directory_.setPath (settings_->value ("SaveDir", default_save_directory_.absolutePath ()).toString ()); azel_directory_.setPath (settings_->value ("AzElDir", default_azel_directory_.absolutePath ()).toString ()); - tci_audio_ = settings_->value ("TCIAudio", tci_audio_).toBool (); + tci_audio_ = settings_->value ("TCIAudio", false).toBool (); type_2_msg_gen_ = settings_->value ("Type2MsgGen", QVariant::fromValue (Configuration::type_2_msg_3_full)).value (); @@ -2502,7 +3261,7 @@ void Configuration::impl::read_settings () eqsl_nickname_ = settings_->value ("EQSLNick", "").toString (); send_to_eqsl_ = settings_->value ("EQSLSend", false).toBool (); id_after_73_ = settings_->value ("After73", false).toBool (); - tx_QSY_allowed_ = settings_->value ("TxQSYAllowed", false).toBool (); + tx_frequency_corrections_allowed_ = settings_->value ("TxQSYAllowed", false).toBool (); progressBar_red_ = settings_->value ("ProgressBarRed", true).toBool (); use_dynamic_grid_ = settings_->value ("AutoGrid", false).toBool (); @@ -2607,6 +3366,7 @@ void Configuration::impl::read_settings () bLowSidelobes_ = settings_->value("LowSidelobes",true).toBool(); prompt_to_log_ = settings_->value ("PromptToLog", false).toBool (); autoLog_ = settings_->value ("AutoLog", true).toBool (); + if (prompt_to_log_ && autoLog_) prompt_to_log_ = false; contestingOnly_ = settings_->value ("ContestingOnly", true).toBool (); ZZ00_ = settings_->value("ZZ00",false).toBool (); log4digitGrids_ = settings_->value ("Log4digitGrids", false).toBool (); @@ -2638,8 +3398,6 @@ void Configuration::impl::read_settings () auto_astro_ = settings_->value("AutoAstroWindow",false).toBool (); single_decode_ = settings_->value("SingleDecode",false).toBool (); twoPass_ = settings_->value("TwoPass",true).toBool (); - highDPI_ = settings_->value("HighDPI",true).toBool (); - largerTabWidget_ = settings_->value("LargerTabWidget",false).toBool (); bSuperFox_ = settings_->value("SuperFox",true).toBool (); Individual_Contest_Name_ = settings_->value("Individual_Contest_Name",false).toBool (); NCCC_Sprint_ = settings_->value("NCCC_Sprint",false).toBool (); @@ -2657,6 +3415,7 @@ void Configuration::impl::read_settings () SelectedActivity_ = settings_->value("SelectedActivity",1).toInt (); x2ToneSpacing_ = settings_->value("x2ToneSpacing",false).toBool (); x4ToneSpacing_ = settings_->value("x4ToneSpacing",false).toBool (); + if (x4ToneSpacing_) x2ToneSpacing_ = false; rig_params_.poll_interval = settings_->value ("Polling", 0).toInt (); rig_params_.split_mode = settings_->value ("SplitMode", QVariant::fromValue (TransceiverFactory::split_mode_none)).value (); opCall_ = settings_->value ("OpCall", "").toString (); @@ -2842,7 +3601,7 @@ void Configuration::impl::write_settings () settings_->setValue ("EQSLPasswd", eqsl_passwd_); settings_->setValue ("EQSLNick", eqsl_nickname_); settings_->setValue ("After73", id_after_73_); - settings_->setValue ("TxQSYAllowed", tx_QSY_allowed_); + settings_->setValue ("TxQSYAllowed", tx_frequency_corrections_allowed_); settings_->setValue ("ProgressBarRed", progressBar_red_); settings_->setValue ("Macros", macros_.stringList ()); settings_->setValue ("stations", QVariant::fromValue (stations_.station_list ())); @@ -2910,8 +3669,6 @@ void Configuration::impl::write_settings () settings_->setValue ("AutoAstroWindow", auto_astro_); settings_->setValue ("SingleDecode", single_decode_); settings_->setValue ("TwoPass", twoPass_); - settings_->setValue ("HighDPI", highDPI_); - settings_->setValue ("LargerTabWidget", largerTabWidget_); settings_->setValue ("SuperFox", bSuperFox_); settings_->setValue ("Individual_Contest_Name", Individual_Contest_Name_); settings_->setValue ("NCCC_Sprint", NCCC_Sprint_); @@ -3167,16 +3924,20 @@ bool Configuration::impl::validate () if (!ui_->PTT_method_button_group->checkedButton ()->isEnabled ()) { + find_tab (ui_->PTT_method_button_group->checkedButton ()); MessageBox::critical_message (this, tr ("Invalid PTT method")); return false; } auto ptt_method = static_cast (ui_->PTT_method_button_group->checkedId ()); auto ptt_port = ui_->PTT_port_combo_box->currentText (); + auto const ptt_port_index = ui_->PTT_port_combo_box->findText (ptt_port); if ((TransceiverFactory::PTT_method_DTR == ptt_method || TransceiverFactory::PTT_method_RTS == ptt_method) && (ptt_port.isEmpty () - || combo_box_item_disabled == ui_->PTT_port_combo_box->itemData (ui_->PTT_port_combo_box->findText (ptt_port), Qt::UserRole - 1))) + || (ptt_port_index >= 0 + && combo_box_item_disabled == ui_->PTT_port_combo_box->itemData (ptt_port_index, Qt::UserRole - 1)))) { + find_tab (ui_->PTT_port_combo_box); MessageBox::critical_message (this, tr ("Invalid PTT port")); return false; } @@ -3201,6 +3962,7 @@ bool Configuration::impl::validate () if (dns_lookup_id_ > -1) { + find_tab (ui_->udp_server_line_edit); MessageBox::information_message (this, tr ("Pending DNS lookup, please try again later")); return false; } @@ -3293,6 +4055,12 @@ void Configuration::impl::accept () // open_rig() uses values from models so we use it to validate the // Transceiver settings before agreeing to accept the configuration + if (temp_rig_params != rig_params_ + && tx_inhibit_blocks_rig_restart (temp_rig_params, false)) + { + warn_tx_inhibit_restart_blocked (); + return; + } if (temp_rig_params != rig_params_ && !open_rig ()) { return; // not accepting @@ -3436,7 +4204,7 @@ void Configuration::impl::accept () PWR_and_SWR_ = ui_->PWR_and_SWR_check_box->isChecked (); check_SWR_ = ui_->check_SWR_check_box->isChecked (); - read_voicesPath(); + read_voice_directory (); spot_to_psk_reporter_ = ui_->psk_reporter_check_box->isChecked (); psk_reporter_tcpip_ = ui_->psk_reporter_tcpip_check_box->isChecked (); @@ -3454,7 +4222,7 @@ void Configuration::impl::accept () RxBandwidth_ = ui_->sbBandwidth->value (); tci_audio_ = ui_->tci_audio_check_box->isChecked (); id_after_73_ = ui_->CW_id_after_73_check_box->isChecked (); - tx_QSY_allowed_ = ui_->tx_QSY_check_box->isChecked (); + tx_frequency_corrections_allowed_ = ui_->tx_frequency_corrections_check_box->isChecked (); progressBar_red_ = ui_->progress_bar_check_box->isChecked (); monitor_off_at_startup_ = ui_->monitor_off_check_box->isChecked (); monitor_last_used_ = ui_->monitor_last_used_check_box->isChecked (); @@ -3499,8 +4267,6 @@ void Configuration::impl::accept () auto_astro_ = ui_->auto_astro_check_box->isChecked (); single_decode_ = ui_->single_decode_check_box->isChecked (); twoPass_ = ui_->cbTwoPass->isChecked (); - highDPI_ = ui_->cbHighDPI->isChecked (); - largerTabWidget_ = ui_->cbLargerTabWidget->isChecked (); bSuperFox_ = ui_->cbSuperFox->isChecked (); Individual_Contest_Name_ = ui_->cbContestName->isChecked (); NCCC_Sprint_ = ui_->cb_NCCC_Sprint->isChecked (); @@ -3510,12 +4276,12 @@ void Configuration::impl::accept () filters_for_Wait_and_Pounce_only_ = ui_->cb_filters_for_Wait_and_Pounce_only->isChecked (); filters_for_word2_ = ui_->cb_filters_for_word2->isChecked (); twoDays_ = ui_->cb_twoDays->isChecked (); - bSpecialOp_ = ui_->gbSpecialOpActivity->isChecked (); - bCloudLog_ = ui_->gbCloudlog->isChecked (); - send_to_eqsl_ = ui_->gbEQSL->isChecked (); + bSpecialOp_ = ui_->cbSpecialOpActivity->isChecked (); + bCloudLog_ = ui_->cbCloudlog->isChecked (); + send_to_eqsl_ = ui_->cbEQSL->isChecked (); cloudLogApiUrl_ = ui_->leCloudlogApiUrl->text (); cloudLogApiKey_ = ui_->leCloudlogApiKey->text (); - cloudLogStationID_ = ui_->sbCloudlogStationID->value (); + cloudLogStationID_ = cloudlog_station_profile_id (); SelectedActivity_ = ui_->special_op_activity_button_group->checkedId(); x2ToneSpacing_ = ui_->cbx2ToneSpacing->isChecked (); x4ToneSpacing_ = ui_->cbx4ToneSpacing->isChecked (); @@ -3716,15 +4482,14 @@ void Configuration::impl::on_CTY_download_button_clicked (bool /*clicked*/) { ui_->CTY_download_button->setEnabled (false); // disable button until download is complete QDir dataPath {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}; - cty_download.configure(network_manager_, - "http://www.country-files.com/bigcty/cty.dat", - dataPath.absoluteFilePath("cty.dat"), - "WSJT-X CTY Downloader"); + cty_download_.configure(network_manager_, + "http://www.country-files.com/bigcty/cty.dat", + dataPath.absoluteFilePath("cty.dat"), + "WSJT-X CTY Downloader"); - // set up LoTW users CSV file fetching - connect (&cty_download, &FileDownload::complete, this, &Configuration::impl::after_CTY_downloaded, Qt::UniqueConnection); - connect (&cty_download, &FileDownload::error, this, &Configuration::impl::error_during_CTY_download, Qt::UniqueConnection); - cty_download.start_download(); + connect (&cty_download_, &FileDownload::complete, this, &Configuration::impl::after_CTY_downloaded, Qt::UniqueConnection); + connect (&cty_download_, &FileDownload::error, this, &Configuration::impl::error_during_CTY_download, Qt::UniqueConnection); + cty_download_.start_download(); } void Configuration::impl::set_CTY_DAT_version(QString const& version) @@ -3755,15 +4520,14 @@ void Configuration::impl::on_CALL3_download_button_clicked (bool /*clicked*/) if (g.exists()) QFile::rename(dataPath.absolutePath() + "/" + "CALL3_backup.TXT", dataPath.absolutePath() + "/" + "CALL3_backup.tmp"); QFile f {dataPath.absolutePath() + "/" + "CALL3.TXT"}; if (f.exists()) QFile::rename(dataPath.absolutePath() + "/" + "CALL3.TXT", dataPath.absolutePath() + "/" + "CALL3_backup.TXT"); - cty_download.configure(network_manager_, - "https://wsjt-x-improved.sourceforge.io/CALL3.TXT", - dataPath.absoluteFilePath("CALL3.TXT"), - "Downloading latest CALL3.TXT file"); - - // set up CALL3.TXT file fetching - connect (&cty_download, &FileDownload::complete, this, &Configuration::impl::after_CALL3_downloaded, Qt::UniqueConnection); - connect (&cty_download, &FileDownload::error, this, &Configuration::impl::error_during_CALL3_download, Qt::UniqueConnection); - cty_download.start_download(); + call3_download_.configure(network_manager_, + "https://wsjt-x-improved.sourceforge.io/CALL3.TXT", + dataPath.absoluteFilePath("CALL3.TXT"), + "Downloading latest CALL3.TXT file"); + + connect (&call3_download_, &FileDownload::complete, this, &Configuration::impl::after_CALL3_downloaded, Qt::UniqueConnection); + connect (&call3_download_, &FileDownload::error, this, &Configuration::impl::error_during_CALL3_download, Qt::UniqueConnection); + call3_download_.start_download(); ui_->CALL3_file_label->setText("Downloading ..."); } @@ -3775,15 +4539,14 @@ void Configuration::impl::on_CALL3_EME_download_button_clicked (bool /*clicked*/ if (g.exists()) QFile::rename(dataPath.absolutePath() + "/" + "CALL3_backup.TXT", dataPath.absolutePath() + "/" + "CALL3_backup.tmp"); QFile f {dataPath.absolutePath() + "/" + "CALL3.TXT"}; if (f.exists()) QFile::rename(dataPath.absolutePath() + "/" + "CALL3.TXT", dataPath.absolutePath() + "/" + "CALL3_backup.TXT"); - cty_download.configure(network_manager_, - "https://wsjt-x-improved.sourceforge.io/CALL3_EME.TXT", - dataPath.absoluteFilePath("CALL3.TXT"), - "Downloading latest CALL3.TXT file"); - - // set up CALL3.TXT file fetching - connect (&cty_download, &FileDownload::complete, this, &Configuration::impl::after_CALL3_downloaded, Qt::UniqueConnection); - connect (&cty_download, &FileDownload::error, this, &Configuration::impl::error_during_CALL3_download, Qt::UniqueConnection); - cty_download.start_download(); + call3_download_.configure(network_manager_, + "https://wsjt-x-improved.sourceforge.io/CALL3_EME.TXT", + dataPath.absoluteFilePath("CALL3.TXT"), + "Downloading latest CALL3.TXT file"); + + connect (&call3_download_, &FileDownload::complete, this, &Configuration::impl::after_CALL3_downloaded, Qt::UniqueConnection); + connect (&call3_download_, &FileDownload::error, this, &Configuration::impl::error_during_CALL3_download, Qt::UniqueConnection); + call3_download_.start_download(); ui_->CALL3_file_label->setText("Downloading ..."); } @@ -3871,21 +4634,21 @@ void Configuration::impl::on_hamlib_download_button_clicked (bool /*clicked*/) ui_->hamlib_download_button->setEnabled (false); ui_->revert_update_button->setEnabled (false); if (ui_->rbHamlib32->isChecked()) { - cty_download.configure(network_manager_, - "https://hamlib.sourceforge.net/snapshots-4.7/dll32/libhamlib-4.dll", // new hamlib download location - dataPath.absoluteFilePath("libhamlib-4_new.dll"), - "Downloading latest libhamlib-4.dll"); + hamlib_download_.configure(network_manager_, + "https://hamlib.sourceforge.net/snapshots-4.7/dll32/libhamlib-4.dll", + dataPath.absoluteFilePath("libhamlib-4_new.dll"), + "Downloading latest libhamlib-4.dll"); } else { - cty_download.configure(network_manager_, - "https://hamlib.sourceforge.net/snapshots-4.7/dll64/libhamlib-4.dll", // new hamlib download location - dataPath.absoluteFilePath("libhamlib-4_new.dll"), - "Downloading latest libhamlib-4.dll"); + hamlib_download_.configure(network_manager_, + "https://hamlib.sourceforge.net/snapshots-4.7/dll64/libhamlib-4.dll", + dataPath.absoluteFilePath("libhamlib-4_new.dll"), + "Downloading latest libhamlib-4.dll"); } - connect (&cty_download, &FileDownload::complete, this, &Configuration::impl::after_hamlib_downloaded, Qt::UniqueConnection); - connect (&cty_download, &FileDownload::error, this, &Configuration::impl::error_during_hamlib_download, Qt::UniqueConnection); + connect (&hamlib_download_, &FileDownload::complete, this, &Configuration::impl::after_hamlib_downloaded, Qt::UniqueConnection); + connect (&hamlib_download_, &FileDownload::error, this, &Configuration::impl::error_during_hamlib_download, Qt::UniqueConnection); ui_->in_use->setText("Downloading ..."); - cty_download.start_download(); + hamlib_download_.start_download(); #else MessageBox::warning_message (this, tr ("Hamlib update only available on Windows.")); #endif @@ -3974,33 +4737,29 @@ void Configuration::impl::display_file_information () #endif } -void Configuration::impl::on_DXCC_check_box_clicked(bool checked) +void Configuration::impl::on_DXCC_check_box_toggled (bool) { - if (checked) { - ui_->ppfx_check_box->setEnabled (true); - ui_->show_country_names_check_box->setEnabled (true); - } else { - ui_->ppfx_check_box->setEnabled (false); - ui_->show_country_names_check_box->setEnabled (false); - } + update_DXCC_control_availability (); } -void Configuration::impl::on_PTT_port_combo_box_activated (int /* index */) +void Configuration::impl::update_DXCC_control_availability () { - set_rig_invariants (); + auto const enabled = ui_->DXCC_check_box->isChecked (); + ui_->ppfx_check_box->setEnabled (enabled); + ui_->show_country_names_check_box->setEnabled (enabled); } -void Configuration::impl::on_CAT_port_combo_box_activated (int /* index */) +void Configuration::impl::on_PTT_port_combo_box_activated (int /* index */) { set_rig_invariants (); } -void Configuration::impl::on_CAT_serial_baud_combo_box_currentIndexChanged (int /* index */) +void Configuration::impl::on_CAT_port_combo_box_activated (int /* index */) { set_rig_invariants (); } -void Configuration::impl::on_CAT_handshake_button_group_buttonClicked (int /* id */) +void Configuration::impl::on_CAT_serial_baud_combo_box_currentIndexChanged (int /* index */) { set_rig_invariants (); } @@ -4019,37 +4778,14 @@ void Configuration::impl::on_rig_combo_box_currentIndexChanged (int /* index */) } } -void Configuration::impl::on_PWR_and_SWR_check_box_clicked(bool checked) -{ - if (checked) { - ui_->check_SWR_check_box->setEnabled (true); - } else { - ui_->check_SWR_check_box->setEnabled (false); - } -} - -void Configuration::impl::on_cbHighDPI_clicked(bool checked) -{ - if (checked) { - QFile::remove ("DisableHighDpiScaling"); - } else { - static QFile f("DisableHighDpiScaling"); - f.open(QIODevice::WriteOnly | QIODevice::Text); - QString EventConfig = ("DisableHighDpiScaling=\"true\""); - QTextStream out(&f); - out << EventConfig; - f.close(); - } -} - -void Configuration::impl::on_CAT_data_bits_button_group_buttonClicked (int /* id */) +void Configuration::impl::on_PWR_and_SWR_check_box_toggled (bool) { - set_rig_invariants (); + update_PWR_and_SWR_control_availability (); } -void Configuration::impl::on_CAT_stop_bits_button_group_buttonClicked (int /* id */) +void Configuration::impl::update_PWR_and_SWR_control_availability () { - set_rig_invariants (); + ui_->check_SWR_check_box->setEnabled (ui_->PWR_and_SWR_check_box->isChecked ()); } void Configuration::impl::on_CAT_poll_interval_spin_box_valueChanged (int /* value */) @@ -4057,11 +4793,6 @@ void Configuration::impl::on_CAT_poll_interval_spin_box_valueChanged (int /* val set_rig_invariants (); } -void Configuration::impl::on_split_mode_button_group_buttonClicked (int /* id */) -{ - set_rig_invariants (); -} - void Configuration::impl::on_test_CAT_push_button_clicked () { if (!validate ()) @@ -4080,26 +4811,123 @@ void Configuration::impl::on_test_CAT_push_button_clicked () void Configuration::impl::on_pbTestCloudlog_clicked () { - //fprintf(stderr, "API URL: %s\n", ui_->leCloudlogApiUrl->text().toStdString().c_str()); - cloudlog_.testApi(ui_->leCloudlogApiUrl->text(), ui_->leCloudlogApiKey->text()); + cloudlog_.checkConnection ({ui_->leCloudlogApiUrl->text (), + ui_->leCloudlogApiKey->text (), + cloudlog_station_profile_id ()}); +} + +void Configuration::impl::handle_cloudlog_connection_check_result (Cloudlog::ConnectionCheckResult const& result) +{ + if (!result.stationProfiles.isEmpty ()) + { + set_cloudlog_station_profiles (result.stationProfiles); + } + + ui_->pbTestCloudlog->setStyleSheet (cloudlog_connection_check_style (result.status)); + + auto tooltip = result.message; + if (!result.detail.isEmpty ()) + { + tooltip += QStringLiteral ("\n") + result.detail; + } + ui_->pbTestCloudlog->setToolTip (tooltip); +} + +void Configuration::impl::set_cloudlog_station_profiles (QList const& profiles) +{ + auto const current_id = cloudlog_station_profile_id (); + ui_->cbCloudlogStationProfile->clear (); + for (auto const& profile : profiles) + { + ui_->cbCloudlogStationProfile->addItem (Cloudlog::stationProfileDisplayText (profile), profile.id); + } + + if (current_id > 0) + { + auto const index = ui_->cbCloudlogStationProfile->findData (current_id); + if (index >= 0) + { + ui_->cbCloudlogStationProfile->setCurrentIndex (index); + } + else + { + ui_->cbCloudlogStationProfile->insertItem (0, QString::number (current_id), current_id); + ui_->cbCloudlogStationProfile->setCurrentIndex (0); + } + } + else if (ui_->cbCloudlogStationProfile->count () > 0) + { + ui_->cbCloudlogStationProfile->setCurrentIndex (0); + } +} + +qint32 Configuration::impl::cloudlog_station_profile_id () const +{ + bool ok {false}; + auto const current_text = ui_->cbCloudlogStationProfile->currentText ().trimmed (); + auto const current_index = ui_->cbCloudlogStationProfile->currentIndex (); + if (current_index >= 0 && ui_->cbCloudlogStationProfile->itemText (current_index).trimmed () == current_text) + { + auto const data = ui_->cbCloudlogStationProfile->itemData (current_index); + auto const id = data.toInt (&ok); + if (ok && id > 0) + { + return id; + } + } + + auto const prefix = current_text.section (QStringLiteral (" - "), 0, 0).trimmed (); + auto const text_id = prefix.toInt (&ok); + return ok && text_id > 0 ? text_id : 0; } -void Configuration::impl::on_gbCloudlog_clicked () +void Configuration::impl::on_cbCloudlog_toggled (bool checked) { + ui_->api_url_label->setEnabled (checked); + ui_->api_key_label->setEnabled (checked); + ui_->station_profile_label->setEnabled (checked); + ui_->leCloudlogApiUrl->setEnabled (checked); + ui_->leCloudlogApiKey->setEnabled (checked); + ui_->cbCloudlogStationProfile->setEnabled (checked); + ui_->pbTestCloudlog->setEnabled (checked); ui_->pbTestCloudlog->setStyleSheet ("QPushButton {background-color: none;}"); } -void Configuration::impl::on_gbEQSL_clicked () +void Configuration::impl::on_cbEQSL_toggled (bool checked) { - send_to_eqsl_ = ui_->gbEQSL->isChecked(); + ui_->eqsluser_label->setEnabled (checked); + ui_->eqslpasswd_label->setEnabled (checked); + ui_->eqslnick_label->setEnabled (checked); + ui_->eqsluser_edit->setEnabled (checked); + ui_->eqslpasswd_edit->setEnabled (checked); + ui_->eqslnick_edit->setEnabled (checked); } void Configuration::impl::on_test_PTT_push_button_clicked (bool checked) { - ui_->test_PTT_push_button->setChecked (!checked); // let status - // update check us + auto const showing_requested_ptt = tx_inhibit_active_; + if (!showing_requested_ptt) + { + ui_->test_PTT_push_button->setChecked (!checked); + } if (!validate ()) { + if (showing_requested_ptt) ui_->test_PTT_push_button->setChecked (!checked); + return; + } + + auto const rig_data = gather_rig_data (); + if (tx_inhibit_blocks_rig_restart (rig_data, false)) + { + ui_->test_PTT_push_button->setChecked (cached_rig_state_.ptt ()); + if (!showing_requested_ptt) + { + ui_->test_PTT_push_button->setChecked (!checked); + } + MessageBox::warning_message ( + this, tr ("Cannot test PTT while TX inhibit is active"), + tr ("Wait for the current inhibit hold to clear before testing " + "changed radio settings or changing PTT state.")); return; } @@ -4107,6 +4935,10 @@ void Configuration::impl::on_test_PTT_push_button_clicked (bool checked) { Q_EMIT self_->transceiver_ptt (checked); } + else if (showing_requested_ptt) + { + ui_->test_PTT_push_button->setChecked (!checked); + } } void Configuration::impl::on_force_DTR_combo_box_currentIndexChanged (int /* index */) @@ -4119,11 +4951,6 @@ void Configuration::impl::on_force_RTS_combo_box_currentIndexChanged (int /* ind set_rig_invariants (); } -void Configuration::impl::on_PTT_method_button_group_buttonClicked (int /* id */) -{ - set_rig_invariants (); -} - void Configuration::impl::on_refresh_push_button_clicked () { // @@ -4166,12 +4993,7 @@ void Configuration::impl::on_add_macro_line_edit_editingFinished () void Configuration::impl::on_delete_macro_push_button_clicked (bool /* checked */) { - auto selection_model = ui_->macros_list_view->selectionModel (); - if (selection_model->hasSelection ()) - { - // delete all selected items - delete_selected_macros (selection_model->selectedRows ()); - } + delete_macro (); } void Configuration::impl::delete_macro () @@ -4209,6 +5031,122 @@ void Configuration::impl::delete_selected_macros (QModelIndexList selected_rows) } } +void Configuration::impl::move_selected_macros (int delta) +{ + auto selection_model = ui_->macros_list_view->selectionModel (); + QModelIndexList selected_rows = selection_model->selectedRows (); + if (!selection_model->hasSelection () && selection_model->currentIndex ().isValid ()) + { + selected_rows.append (selection_model->currentIndex ()); + } + + QList rows; + Q_FOREACH (auto const& index, selected_rows) + { + if (index.isValid ()) + { + rows.append (index.row ()); + } + } + + std::sort (rows.begin (), rows.end ()); + rows.erase (std::unique (rows.begin (), rows.end ()), rows.end ()); + if (rows.isEmpty ()) + { + return; + } + + auto const row_count = next_macros_.rowCount (); + if ((delta < 0 && rows.first () == 0) + || (delta > 0 && rows.last () >= row_count - 1)) + { + return; + } + + auto messages = next_macros_.stringList (); + QList moved_rows; + if (delta < 0) + { + Q_FOREACH (auto row, rows) + { + qSwap (messages[row], messages[row - 1]); + moved_rows.append (row - 1); + } + } + else if (delta > 0) + { + for (auto row = rows.crbegin (); row != rows.crend (); ++row) + { + qSwap (messages[*row], messages[*row + 1]); + moved_rows.append (*row + 1); + } + std::sort (moved_rows.begin (), moved_rows.end ()); + } + else + { + return; + } + + next_macros_.setStringList (messages); + + selection_model = ui_->macros_list_view->selectionModel (); + selection_model->clearSelection (); + Q_FOREACH (auto row, moved_rows) + { + auto index = next_macros_.index (row); + selection_model->select (index, QItemSelectionModel::Select | QItemSelectionModel::Rows); + } + ui_->macros_list_view->setCurrentIndex (next_macros_.index (moved_rows.first ())); +} + +void Configuration::impl::on_move_macro_up_push_button_clicked (bool /* checked */) +{ + move_selected_macros (-1); +} + +void Configuration::impl::on_move_macro_down_push_button_clicked (bool /* checked */) +{ + move_selected_macros (1); +} + +void Configuration::impl::move_selected_highlighting_rule (int delta) +{ + auto const current_index = ui_->highlighting_list_view->currentIndex (); + if (!current_index.isValid () || 0 == delta) + { + return; + } + + auto items = next_decode_highlighing_model_.items (); + auto const row = current_index.row (); + auto const target_row = row + delta; + if (row < 0 || row >= items.size () || target_row < 0 || target_row >= items.size ()) + { + return; + } + + qSwap (items[row], items[target_row]); + next_decode_highlighing_model_.items (items); + + auto const moved_index = next_decode_highlighing_model_.index (target_row, 0); + ui_->highlighting_list_view->setCurrentIndex (moved_index); + if (auto selection_model = ui_->highlighting_list_view->selectionModel ()) + { + selection_model->clearSelection (); + selection_model->select (moved_index, QItemSelectionModel::Select | QItemSelectionModel::Rows); + } +} + +void Configuration::impl::on_move_highlighting_up_push_button_clicked (bool /* checked */) +{ + move_selected_highlighting_rule (-1); +} + +void Configuration::impl::on_move_highlighting_down_push_button_clicked (bool /* checked */) +{ + move_selected_highlighting_rule (1); +} + void Configuration::impl::on_add_macro_push_button_clicked (bool /* checked */) { if (next_macros_.insertRow (next_macros_.rowCount ())) @@ -4482,7 +5420,9 @@ void Configuration::impl::insert_frequency () { if (QDialog::Accepted == frequency_dialog_->exec ()) { - ui_->frequencies_table_view->setCurrentIndex (next_frequencies_.add (frequency_dialog_->item ())); + auto const index = next_frequencies_.add (frequency_dialog_->item ()); + ui_->frequencies_table_view->setCurrentIndex (index); + ui_->frequencies_table_view->selectionModel ()->select (index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); ui_->frequencies_table_view->resizeColumnToContents (FrequencyList_v2_101::mode_column); size_frequency_table_columns(); } @@ -4501,7 +5441,9 @@ void Configuration::impl::insert_station () { if (QDialog::Accepted == station_dialog_->exec ()) { - ui_->stations_table_view->setCurrentIndex (next_stations_.add (station_dialog_->station ())); + auto const index = next_stations_.add (station_dialog_->station ()); + ui_->stations_table_view->setCurrentIndex (index); + ui_->stations_table_view->selectionModel ()->select (index, QItemSelectionModel::ClearAndSelect | QItemSelectionModel::Rows); ui_->stations_table_view->resizeColumnToContents (StationList::band_column); ui_->stations_table_view->resizeColumnToContents (StationList::offset_column); } @@ -4543,113 +5485,77 @@ void Configuration::impl::on_calibration_slope_ppm_spin_box_valueChanged (double rig_active_ = false; // force reset } -void Configuration::impl::on_prompt_to_log_check_box_clicked(bool checked) -{ - if(checked) ui_->cbAutoLog->setChecked(false); - ui_->cbContestingOnly->setEnabled(false); -} - -void Configuration::impl::on_cbAutoLog_clicked(bool checked) -{ - ui_->cbContestingOnly->setEnabled(true); - if(checked) ui_->prompt_to_log_check_box->setChecked(false); -} - -void Configuration::impl::on_cbx2ToneSpacing_clicked(bool b) -{ - if(b) ui_->cbx4ToneSpacing->setChecked(false); -} - -void Configuration::impl::on_cbx4ToneSpacing_clicked(bool b) -{ - if(b) ui_->cbx2ToneSpacing->setChecked(false); -} - -void Configuration::impl::on_gbSpecialOpActivity_clicked (bool) -{ - check_visibility (); -} - -void Configuration::impl::on_rbFox_clicked (bool) +void Configuration::impl::on_prompt_to_log_check_box_toggled (bool checked) { - check_visibility (); + if (checked) ui_->cbAutoLog->setChecked (false); + update_logging_control_availability (); } -void Configuration::impl::on_rbHound_clicked (bool) +void Configuration::impl::on_cbAutoLog_toggled (bool checked) { - check_visibility (); + if (checked) ui_->prompt_to_log_check_box->setChecked (false); + update_logging_control_availability (); } -void Configuration::impl::on_rbNA_VHF_Contest_clicked (bool) +void Configuration::impl::update_logging_control_availability () { - check_visibility (); + ui_->cbContestingOnly->setEnabled (!ui_->prompt_to_log_check_box->isChecked ()); } -void Configuration::impl::on_rbEU_VHF_Contest_clicked (bool) +void Configuration::impl::on_cbx2ToneSpacing_toggled (bool checked) { - check_visibility (); + if (checked) ui_->cbx4ToneSpacing->setChecked (false); } -void Configuration::impl::on_rbWW_DIGI_clicked (bool) +void Configuration::impl::on_cbx4ToneSpacing_toggled (bool checked) { - check_visibility (); -} - -void Configuration::impl::on_rbQ65pileup_clicked (bool) -{ - check_visibility (); -} - -void Configuration::impl::on_rbField_Day_clicked (bool) -{ - check_visibility (); -} - -void Configuration::impl::on_rbRTTY_Roundup_clicked (bool) -{ - check_visibility (); -} - -void Configuration::impl::on_rbARRL_Digi_clicked (bool) -{ - check_visibility (); -} - -void Configuration::impl::on_cbSuperFox_clicked (bool) -{ - check_visibility (); -} - -void Configuration::impl::on_cbContestName_clicked (bool) -{ - check_visibility (); -} - -void Configuration::impl::on_cb_NCCC_Sprint_clicked (bool) -{ - check_visibility (); -} - -void Configuration::impl::on_cbOTP_clicked(bool) -{ - check_visibility(); -} - -void Configuration::impl::on_cbShowOTP_clicked(bool) -{ - check_visibility(); + if (checked) ui_->cbx2ToneSpacing->setChecked (false); } void Configuration::impl::check_visibility () { - if (ui_->rbField_Day->isChecked() and ui_->gbSpecialOpActivity->isChecked()) { + auto const special_op_enabled = ui_->cbSpecialOpActivity->isChecked (); + QWidget *activity_controls[] { + ui_->rbFox, + ui_->cbSuperFox, + ui_->rbHound, + ui_->cbOTP, + ui_->lblOTPSeed, + ui_->OTPSeed, + ui_->lblOTPEvery, + ui_->sbOTPinterval, + ui_->cbShowOTP, + ui_->lblOTPUrl, + ui_->OTPUrl, + ui_->rbNA_VHF_Contest, + ui_->cb_NCCC_Sprint, + ui_->rbField_Day, + ui_->labFD, + ui_->Field_Day_Exchange, + ui_->rbEU_VHF_Contest, + ui_->rbRTTY_Roundup, + ui_->labRTTY, + ui_->RTTY_Exchange, + ui_->rbWW_DIGI, + ui_->rbARRL_Digi, + ui_->rbQ65pileup, + ui_->cbContestName, + ui_->labCN, + ui_->Contest_Name, + }; + for (auto control : activity_controls) + { + control->setEnabled (special_op_enabled); + } + + if (ui_->rbField_Day->isChecked() and special_op_enabled) { ui_->labFD->setEnabled (true); ui_->Field_Day_Exchange->setEnabled (true); } else { ui_->labFD->setEnabled (false); ui_->Field_Day_Exchange->setEnabled (false); } - if (ui_->rbRTTY_Roundup->isChecked() and ui_->gbSpecialOpActivity->isChecked()) { + if (ui_->rbRTTY_Roundup->isChecked() and special_op_enabled) { ui_->labRTTY->setEnabled (true); ui_->RTTY_Exchange->setEnabled (true); } else { @@ -4657,14 +5563,14 @@ void Configuration::impl::check_visibility () ui_->RTTY_Exchange->setEnabled (false); } if (ui_->cbContestName->isChecked() and !ui_->rbFox->isChecked() and !ui_->rbHound->isChecked() - and !ui_->rbQ65pileup->isChecked() and ui_->gbSpecialOpActivity->isChecked()) { + and !ui_->rbQ65pileup->isChecked() and special_op_enabled) { ui_->labCN->setEnabled (true); ui_->Contest_Name->setEnabled (true); } else { ui_->labCN->setEnabled (false); ui_->Contest_Name->setEnabled (false); } - if ((ui_->rbFox->isChecked() or ui_->rbHound->isChecked()) and ui_->gbSpecialOpActivity->isChecked()) { + if ((ui_->rbFox->isChecked() or ui_->rbHound->isChecked()) and special_op_enabled) { ui_->cbSuperFox->setEnabled (true); ui_->cbOTP->setEnabled (true); } else { @@ -4673,17 +5579,17 @@ void Configuration::impl::check_visibility () ui_->cbShowOTP->setEnabled(false); } if (!ui_->rbFox->isChecked() and !ui_->rbHound->isChecked() and !ui_->rbQ65pileup->isChecked() - and ui_->gbSpecialOpActivity->isChecked()) { + and special_op_enabled) { ui_->cbContestName->setEnabled (true); } else { ui_->cbContestName->setEnabled (false); } - if (ui_->rbNA_VHF_Contest->isChecked() and ui_->gbSpecialOpActivity->isChecked()) { + if (ui_->rbNA_VHF_Contest->isChecked() and special_op_enabled) { ui_->cb_NCCC_Sprint->setEnabled (true); } else { ui_->cb_NCCC_Sprint->setEnabled (false); } - if (!ui_->cbOTP->isChecked() or !ui_->gbSpecialOpActivity->isChecked()) { + if (!ui_->cbOTP->isChecked() or !special_op_enabled) { ui_->OTPSeed->setEnabled(false); ui_->OTPUrl->setEnabled(false); ui_->sbOTPinterval->setEnabled(false); @@ -4974,42 +5880,55 @@ void Configuration::impl::on_highlight_blue_callsigns_editingFinished () void Configuration::impl::on_voices_combo_box_currentIndexChanged (int /* index */) { voice_ = ui_->voices_combo_box->currentIndex(); - read_voicesPath(); + read_voice_directory (); } void Configuration::impl::read_voices () { - QString audioPath = app_sounds_directory (); - QString voiceList = audioPath + "voices.dat"; // load the content of voices.dat file to the voices combo box + auto const base_sounds_directory = app_sounds_directory (); + if (ui_->voices_combo_box->count () > 0) + { + ui_->voices_combo_box->setItemData (0, base_sounds_directory.absolutePath ()); + } + + auto const voiceList = app_voice_manifest_path (); QFile file2 {voiceList}; - QStringList wordList; QTextStream stream2(&file2); - if(file2.open (QIODevice::ReadOnly | QIODevice::Text)) { + if(!voiceList.isEmpty () && file2.open (QIODevice::ReadOnly | QIODevice::Text)) { + auto const voice_root = QFileInfo {file2}.absoluteDir (); while (!stream2.atEnd()) { QString line = stream2.readLine(); - wordList = line.split('|'); - ui_->voices_combo_box->addItem (wordList[1], wordList[0]); + QString voicePath; + QString voiceName; + if (!parse_app_voice_entry (line, voicePath, voiceName)) + { + continue; + } + ui_->voices_combo_box->addItem (voiceName, sounds_subdirectory (voice_root, voicePath).absolutePath ()); } stream2.flush(); file2.close(); } else { voice_=0; } + if (voice_ < 0 || voice_ >= ui_->voices_combo_box->count ()) + { + voice_=0; + } ui_->voices_combo_box->setCurrentIndex (voice_); - read_voicesPath(); + read_voice_directory (); } -void Configuration::impl::read_voicesPath () +void Configuration::impl::read_voice_directory () { - voicesPath_ = ui_->voices_combo_box->currentData().toString().left('|'); + voice_directory_.setPath (ui_->voices_combo_box->currentData ().toString ()); } void Configuration::impl::on_pb_test_alerts_clicked (bool) { - read_voicesPath(); + read_voice_directory (); #ifdef WIN32 QAudioOutput info(QAudioDeviceInfo::defaultOutputDevice()); - QString audioPath = app_sounds_directory (voicesPath_); QAudioFormat format; format.setCodec("audio/pcm"); format.setSampleRate (48000); @@ -5019,12 +5938,11 @@ void Configuration::impl::on_pb_test_alerts_clicked (bool) QAudioOutput* audio; audio = new QAudioOutput(format, this); QFile *effect = new QFile(this); - effect->setFileName(QString("%1/%2").arg(audioPath, "Testing123.wav")); + effect->setFileName (voice_directory_.absoluteFilePath ("Testing123.wav")); effect->open(QIODevice::ReadOnly); audio->start(effect); #else - QString audioPath = app_sounds_directory (voicesPath_); - QSound::play(audioPath + "Testing123.wav"); // for Linux and macOS + QSound::play (voice_directory_.absoluteFilePath ("Testing123.wav")); // for Linux and macOS #endif } @@ -5038,27 +5956,79 @@ bool Configuration::impl::have_rig () return rig_active_; } +bool Configuration::impl::can_control_rig (char const * command) const +{ + if (rig_active_) return true; + + LOG_TRACE ("suppressing " << command << " because rig is not active"); + return false; +} + +void Configuration::impl::mark_rig_offline () +{ + cached_rig_state_.online (false); + cached_rig_state_.ptt (false); + cached_rig_state_.tune (false); + cached_rig_state_.audio (false); + cached_rig_state_.tx_audio (false); +} + +QString Configuration::impl::summarize_transceiver_failure (QString const& reason) +{ + auto lines = reason.split (QRegularExpression {"[\\r\\n]+"}, SkipEmptyParts); + for (auto& line: lines) + { + line = line.simplified (); + } + lines.removeAll (QString {}); + + auto summary = lines.isEmpty () ? reason.simplified () : lines.front (); + if (lines.size () > 1 && lines.back () != summary) + { + summary += " | " + lines.back (); + } + + constexpr int max_summary_length {500}; + if (summary.size () > max_summary_length) + { + summary = summary.left (max_summary_length - 3) + "..."; + } + return summary; +} + bool Configuration::impl::open_rig (bool force) { auto result = false; auto const rig_data = gather_rig_data (); - if (force || !rig_active_ || rig_data != saved_rig_params_) + if (tx_inhibit_blocks_rig_restart (rig_data, force)) + { + LOG_INFO ("refusing to restart the rig while TX inhibit is active"); + return false; + } + if (rig_restart_required (rig_data, force)) { try { if (is_tci_ && rig_active_ && tci_audio_) restart_tci_device_ = true; close_rig (); + auto const txvolume = cached_rig_state_.txvolume (); + // create a new Transceiver object auto rig = transceiver_factory_.create (rig_data, transceiver_thread_); cached_rig_state_ = Transceiver::TransceiverState {}; + cached_rig_state_.txvolume (txvolume); // hook up Configuration transceiver control signals to Transceiver slots // // these connections cross the thread boundary rig_connections_ << connect (this, &Configuration::impl::set_transceiver, rig.get (), &Transceiver::set); + rig_connections_ << connect (this, &Configuration::impl::enqueue_jtty_pcm, + rig.get (), &Transceiver::enqueue_jtty_pcm); + rig_connections_ << connect (this, &Configuration::impl::clear_jtty_pcm, + rig.get (), &Transceiver::clear_jtty_pcm); // hook up Transceiver signals to Configuration signals // @@ -5067,9 +6037,40 @@ bool Configuration::impl::open_rig (bool force) rig_resolution_ = resolution; }); rig_connections_ << connect (rig.get (), &Transceiver::tciframeswritten, this, &Configuration::impl::handle_transceiver_tciframeswritten); + rig_connections_ << connect (rig.get (), &Transceiver::receiveAudio, self_, &Configuration::transceiverReceiveAudio); rig_connections_ << connect (rig.get (), &Transceiver::tci_mod_active, this, &Configuration::impl::handle_transceiver_tci_mod_active); + rig_connections_ << connect (rig.get (), &Transceiver::txSourceCommitted, self_, &Configuration::txSourceCommitted); + rig_connections_ << connect (rig.get (), &Transceiver::rawTxPlayoutSnapshot, self_, &Configuration::rawTxPlayoutSnapshot); + rig_connections_ << connect (rig.get (), &Transceiver::jtty_drained, self_, &Configuration::transceiver_jtty_drained); + rig_connections_ << connect (rig.get (), &Transceiver::jtty_enqueue_accepted, self_, &Configuration::transceiver_jtty_enqueue_accepted); + rig_connections_ << connect (rig.get (), &Transceiver::jtty_enqueue_failed, self_, &Configuration::transceiver_jtty_enqueue_failed); rig_connections_ << connect (rig.get (), &Transceiver::update, this, &Configuration::impl::handle_transceiver_update); rig_connections_ << connect (rig.get (), &Transceiver::failure, this, &Configuration::impl::handle_transceiver_failure); + if (auto inhibit = qobject_cast (rig.get ())) + { + auto const generation = tx_inhibit_generation_; + rig_connections_ << connect (self_, &Configuration::tx_inhibit_command, + inhibit, &TxInhibitTransceiver::tx_inhibit_command, Qt::QueuedConnection); + rig_connections_ << connect (self_, &Configuration::tx_inhibit_invalid, + inhibit, &TxInhibitTransceiver::tx_inhibit_invalid, Qt::QueuedConnection); + rig_connections_ << connect ( + inhibit, &TxInhibitTransceiver::statusChanged, this, + [this, generation] (bool supported, bool inhibited, + QString const& holder, + quint32 hold_rx, quint32 release_rx, + quint32 expiries, quint32 invalid) { + if (generation != tx_inhibit_generation_) return; + tx_inhibit_active_ = inhibited; + if (inhibited) + { + ui_->test_PTT_push_button->setChecked (cached_rig_state_.ptt ()); + } + tx_inhibit_status_forwarded_ = true; + Q_EMIT self_->tx_inhibit_status_changed ( + supported, inhibited, holder, + hold_rx, release_rx, expiries, invalid); + }, Qt::QueuedConnection); + } // setup thread safe startup and close down semantics rig_connections_ << connect (this, &Configuration::impl::start_transceiver, rig.get (), &Transceiver::start); @@ -5099,7 +6100,6 @@ bool Configuration::impl::open_rig (bool force) } catch (std::exception const& e) { - qDebug() << "Configuration::impl::open_rig failed with error " << e.what(); handle_transceiver_failure (e.what ()); } @@ -5113,6 +6113,26 @@ bool Configuration::impl::open_rig (bool force) return result; } +bool Configuration::impl::rig_restart_required ( + TransceiverFactory::ParameterPack const& rig_data, bool force) const +{ + return force || !rig_active_ || rig_data != saved_rig_params_; +} + +bool Configuration::impl::tx_inhibit_blocks_rig_restart ( + TransceiverFactory::ParameterPack const& rig_data, bool force) const +{ + return tx_inhibit_active_ && rig_restart_required (rig_data, force); +} + +void Configuration::impl::warn_tx_inhibit_restart_blocked () +{ + MessageBox::warning_message ( + this, tr ("Cannot change radio settings while TX inhibit is active"), + tr ("Wait for the current inhibit hold to clear before applying " + "settings that require restarting the radio.")); +} + void Configuration::impl::set_cached_mode () { MODE mode {Transceiver::UNK}; @@ -5128,50 +6148,74 @@ void Configuration::impl::set_cached_mode () cached_rig_state_.mode (mode); } -void Configuration::impl::transceiver_frequency (Frequency f) +RigFrequencyChangePolicy::Activity Configuration::impl::frequency_change_activity () const { - cached_rig_state_.online (true); // we want the rig online - set_cached_mode (); - - // apply any offset & calibration - // we store the offset here for use in feedback from the rig, we - // cannot absolutely determine if the offset should apply but by - // simply picking an offset when the Rx frequency is set and - // sticking to it we get sane behaviour - current_offset_ = stations_.offset (f); - cached_rig_state_.frequency (apply_calibration (f + current_offset_)); + return {false, false, false, false, false, false, false, + cached_rig_state_.ptt (), cached_rig_state_.tune ()}; +} - // qDebug () << "Configuration::impl::transceiver_frequency: n:" << transceiver_command_number_ + 1 << "f:" << f; - LOG_TRACE ("emitting set_transceiver: requested state:" << cached_rig_state_); - Q_EMIT set_transceiver (cached_rig_state_, ++transceiver_command_number_); +bool Configuration::impl::frequency_change_allowed (RigFrequencyChangePolicy::ChangeKind kind) const +{ + return RigFrequencyChangePolicy::evaluate ( + kind, frequency_change_activity (), tx_frequency_corrections_allowed_).allowed; } -void Configuration::impl::transceiver_tx_frequency (Frequency f) +bool Configuration::impl::transceiver_frequency ( + Frequency f, RigFrequencyChangePolicy::ChangeKind kind) { - Q_ASSERT (!f || split_mode ()); - if (split_mode ()) - { + return RigFrequencyChangePolicy::applyIfAllowed ( + kind, frequency_change_activity (), tx_frequency_corrections_allowed_, [this, f] { cached_rig_state_.online (true); // we want the rig online set_cached_mode (); - cached_rig_state_.split (f); - cached_rig_state_.tx_frequency (f); - // lookup offset for tx and apply calibration - if (f) - { - // apply and offset and calibration - // we store the offset here for use in feedback from the - // rig, we cannot absolutely determine if the offset should - // apply but by simply picking an offset when the Rx - // frequency is set and sticking to it we get sane behaviour - current_tx_offset_ = stations_.offset (f); - cached_rig_state_.tx_frequency (apply_calibration (f + current_tx_offset_)); - } + // apply any offset & calibration + // we store the offset here for use in feedback from the rig, we + // cannot absolutely determine if the offset should apply but by + // simply picking an offset when the Rx frequency is set and + // sticking to it we get sane behaviour + current_offset_ = stations_.offset (f); + cached_rig_state_.frequency (apply_calibration (f + current_offset_)); - // qDebug () << "Configuration::impl::transceiver_tx_frequency: n:" << transceiver_command_number_ + 1 << "f:" << f; + // qDebug () << "Configuration::impl::transceiver_frequency: n:" << transceiver_command_number_ + 1 << "f:" << f; LOG_TRACE ("emitting set_transceiver: requested state:" << cached_rig_state_); Q_EMIT set_transceiver (cached_rig_state_, ++transceiver_command_number_); + }); +} + +bool Configuration::impl::transceiver_tx_frequency ( + Frequency f, RigFrequencyChangePolicy::ChangeKind kind) +{ + if (!RigFrequencyChangePolicy::tx_path_frequency_supported (f != 0, split_mode ())) + { + return false; } + return RigFrequencyChangePolicy::applyIfAllowed ( + kind, frequency_change_activity (), tx_frequency_corrections_allowed_, [this, f] { + Q_ASSERT (!f || split_mode ()); + if (split_mode ()) + { + cached_rig_state_.online (true); // we want the rig online + set_cached_mode (); + cached_rig_state_.split (f); + cached_rig_state_.tx_frequency (f); + + // lookup offset for tx and apply calibration + if (f) + { + // apply and offset and calibration + // we store the offset here for use in feedback from the rig, we + // cannot absolutely determine if the offset should apply but by + // simply picking an offset when the Rx frequency is set and + // sticking to it we get sane behaviour + current_tx_offset_ = stations_.offset (f); + cached_rig_state_.tx_frequency (apply_calibration (f + current_tx_offset_)); + } + + // qDebug () << "Configuration::impl::transceiver_tx_frequency: n:" << transceiver_command_number_ + 1 << "f:" << f; + LOG_TRACE ("emitting set_transceiver: requested state:" << cached_rig_state_); + Q_EMIT set_transceiver (cached_rig_state_, ++transceiver_command_number_); + } + }); } void Configuration::impl::transceiver_mode (MODE m) @@ -5217,19 +6261,13 @@ void Configuration::impl::transceiver_tune (bool on) } -void Configuration::impl::transceiver_period (double period, bool force) +void Configuration::impl::transceiver_period (double period) { cached_rig_state_.online (true); // we want the rig online set_cached_mode (); - // force bypasses the de-dup so a caller can re-assert the period even when - // the cache already holds it but the rig never actually applied it (e.g. a - // period set that was emitted while the TCI rig was still offline). - if (force || cached_rig_state_.period() != period) - { // printf("%s(%0.1f) Configuration #:%d period: %0.1f cached: %0.1f\n",QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),transceiver_command_number_+1,period,cached_rig_state_.period()); - cached_rig_state_.period (period); - Q_EMIT set_transceiver (cached_rig_state_, ++transceiver_command_number_); - } + cached_rig_state_.period (period); + Q_EMIT set_transceiver (cached_rig_state_, ++transceiver_command_number_); } void Configuration::impl::transceiver_blocksize (qint32 blocksize) @@ -5280,11 +6318,11 @@ void Configuration::impl::transceiver_trfrequency (double trfrequency) } } -void Configuration::impl::transceiver_txvolume (double txvolume) +void Configuration::impl::transceiver_txvolume (double txvolume, bool force) { cached_rig_state_.online (true); // we want the rig online set_cached_mode (); - if (cached_rig_state_.txvolume() != txvolume) + if (force || cached_rig_state_.txvolume() != txvolume) { // printf("%s(%0.1f) Configuration #:%d txvolume: %0.1f cached: %0.1f\n",QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),transceiver_command_number_+1,txvolume,cached_rig_state_.txvolume()); cached_rig_state_.txvolume (txvolume); @@ -5304,28 +6342,32 @@ void Configuration::impl::transceiver_volume (double volume) } } -void Configuration::impl::transceiver_modulator_start (QString jtmode, unsigned symbolslength, double framespersymbol, double frequency, double tonespacing, bool synchronize, bool fastmode, double dbsnr, double trperiod) +void Configuration::impl::transceiver_modulator_start (TxEvidence::TxRequest const& request) { cached_rig_state_.online (true); // we want the rig online set_cached_mode (); if (!cached_rig_state_.tx_audio()) { cached_rig_state_.tx_audio (true); - cached_rig_state_.symbolslength (symbolslength); - cached_rig_state_.framespersymbol (framespersymbol); - cached_rig_state_.trfrequency (frequency); - cached_rig_state_.tonespacing (tonespacing); - cached_rig_state_.synchronize (synchronize); - cached_rig_state_.dbsnr (dbsnr); - cached_rig_state_.trperiod (trperiod); - cached_rig_state_.jtmode(jtmode); - cached_rig_state_.fastmode(fastmode); + cached_rig_state_.tx_request (request); // printf("%s(%0.1f) Configuration #:%d modulator_start: symbolslength=%d framespersymbol=%0.1f frequency=%0.1f tonespacing=%0.1f synchronize= %d dbsnr=%0.1f trperiod=%0.1f\n",QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),transceiver_command_number_+1,symbolslength,framespersymbol,frequency,tonespacing,synchronize,dbsnr,trperiod); Q_EMIT set_transceiver (cached_rig_state_, ++transceiver_command_number_); } // else printf("%s(%0.1f) Configuration modulator_start: WAS ALLREADY RUNNING\n",QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str()); } +void Configuration::impl::transceiver_enqueue_jtty_pcm (QByteArray const& samples, + TxAudioQueueEpoch epoch, + qint64 enqueueId) +{ + Q_EMIT enqueue_jtty_pcm (samples, epoch, enqueueId); +} + +void Configuration::impl::transceiver_clear_jtty_pcm (TxAudioQueueEpoch epoch) +{ + Q_EMIT clear_jtty_pcm (epoch); +} + void Configuration::impl::transceiver_modulator_stop (bool on) { cached_rig_state_.online (true); // we want the rig online @@ -5374,7 +6416,8 @@ void Configuration::impl::handle_transceiver_update (TransceiverState const& sta if (state.online ()) { - ui_->test_PTT_push_button->setChecked (state.ptt ()); + ui_->test_PTT_push_button->setChecked ( + tx_inhibit_active_ ? cached_rig_state_.ptt () : state.ptt ()); if (isVisible ()) { @@ -5415,9 +6458,8 @@ void Configuration::impl::handle_transceiver_update (TransceiverState const& sta void Configuration::impl::handle_transceiver_failure (QString const& reason) { - LOG_ERROR ("handle_transceiver_failure: reason: " << reason); - qDebug() << "Configuration::impl::handle_transceiver_failure called with reason: " << reason << "\n"; - close_rig (); + LOG_ERROR ("handle_transceiver_failure: " << summarize_transceiver_failure (reason)); + close_rig (true); ui_->test_PTT_push_button->setChecked (false); if (isVisible ()) @@ -5431,13 +6473,14 @@ void Configuration::impl::handle_transceiver_failure (QString const& reason) } } -void Configuration::impl::close_rig () +void Configuration::impl::close_rig (bool failed) { ui_->test_PTT_push_button->setEnabled (false); // revert to no rig configured if (rig_active_) { + Q_EMIT self_->transceiver_closing (failed); ui_->test_CAT_push_button->setStyleSheet ("QPushButton {background-color: red;}"); LOG_TRACE ("emitting stop_transceiver"); Q_EMIT stop_transceiver (); @@ -5449,6 +6492,14 @@ void Configuration::impl::close_rig () rig_connections_.clear (); rig_active_ = false; } + mark_rig_offline (); + ++tx_inhibit_generation_; + tx_inhibit_active_ = false; + if (tx_inhibit_status_forwarded_) + { + Q_EMIT self_->tx_inhibit_status_changed (false, false, {}, 0, 0, 0, 0); + tx_inhibit_status_forwarded_ = false; + } } // find the audio device that matches the specified name, also diff --git a/Configuration.hpp b/Configuration.hpp index e8ccbc30..3b4a9da0 100644 --- a/Configuration.hpp +++ b/Configuration.hpp @@ -2,13 +2,26 @@ #define CONFIGURATION_HPP_ #include +#include #include #include +#include "SpecialOperatingActivity.hpp" #include "Radio.hpp" +#include "RigFrequencyChangePolicy.hpp" +#include "Audio/TxIdentity.hpp" +#include "Audio/TxPlaybackEvidence.hpp" +#include "Audio/TxRequest.hpp" #include "models/IARURegions.hpp" #include "Audio/AudioDevice.hpp" #include "Transceiver/Transceiver.hpp" +#include "Network/CloudlogConfiguration.hpp" + +// Qt 5 moc generates unqualified argument names for these value types. +using TxSessionId = TxEvidence::TxSessionId; +using TxGeneration = TxEvidence::TxGeneration; +using TxStartSnapshot = TxEvidence::TxStartSnapshot; +using TxRawPlayoutSnapshot = TxEvidence::TxRawPlayoutSnapshot; #include "otpgenerator.h" #include "pimpl_h.hpp" @@ -58,7 +71,7 @@ class LogBook; // descriptions. // class Configuration final - : public QObject + : public QObject, public CloudlogConfiguration { Q_OBJECT @@ -146,7 +159,10 @@ public: QString Territory4() const; QString highlight_orange_callsigns() const; QString highlight_blue_callsigns() const; - QString voicesPath() const; + QStringList pass_keywords () const; + QStringList blacklist_keywords () const; + QStringList whitelist_keywords () const; + QDir voice_directory () const; bool PWR_and_SWR() const; bool check_SWR() const; @@ -164,7 +180,7 @@ public: double txDelay() const; bool tci_audio() const; bool id_after_73 () const; - bool tx_QSY_allowed () const; + bool tx_frequency_corrections_allowed () const; bool progressBar_red () const; bool spot_to_psk_reporter () const; bool psk_reporter_tcpip () const; @@ -178,9 +194,9 @@ public: bool report_in_comments () const; bool specOp_in_comments () const; bool cloudlog_enabled () const; - QString cloudlog_api_url() const; - QString cloudlog_api_key() const; - qint32 cloudlog_api_station_id() const; + QString cloudlog_api_url () const override; + QString cloudlog_api_key () const override; + qint32 cloudlog_api_station_id () const override; bool prompt_to_log () const; bool autoLog() const; bool contestingOnly() const; @@ -215,8 +231,6 @@ public: bool auto_astro () const; bool single_decode () const; bool twoPass() const; - bool highDPI() const; - bool largerTabWidget() const; bool superFox() const; bool bFox() const; bool bHound() const; @@ -315,7 +329,7 @@ public: bool ShowOTP() const; unsigned int OTPinterval() const; // 0 1 2 3 4 5 6 7 8 9 - enum class SpecialOperatingActivity {NONE, NA_VHF, EU_VHF, FIELD_DAY, RTTY, WW_DIGI, FOX, HOUND, ARRL_DIGI, Q65_PILEUP}; + using SpecialOperatingActivity = ::SpecialOperatingActivity; SpecialOperatingActivity special_op_id () const; struct CalibrationParams @@ -372,11 +386,11 @@ public: void read_CALL3_version (); // Set transceiver frequency in Hertz. - Q_SLOT void transceiver_frequency (Frequency); + Q_SLOT bool transceiver_frequency (Frequency, RigFrequencyChangePolicy::ChangeKind); // Setting a non zero TX frequency means split operation // rationalise_mode means ensure TX uses same mode as RX. - Q_SLOT void transceiver_tx_frequency (Frequency = 0u); + Q_SLOT bool transceiver_tx_frequency (Frequency, RigFrequencyChangePolicy::ChangeKind); // Set transceiver mode. Q_SLOT void transceiver_mode (MODE); @@ -399,7 +413,7 @@ public: // Set period for TCI audio // - Q_SLOT void transceiver_period (double = 15.0, bool force = false); + Q_SLOT void transceiver_period (double = 15.0); // Set blocksize for TCI audio. // @@ -407,7 +421,10 @@ public: // Set modulation start TCI audio // - Q_SLOT void transceiver_modulator_start (QString="FT8", unsigned = 79, double = 1920.0, double = 1500.0, double = -3.0, bool = true, bool=false, double = 99., double = 60.0); + Q_SLOT void transceiver_modulator_start (TxEvidence::TxRequest request = {}); + + Q_SLOT void transceiver_enqueue_jtty_pcm (QByteArray const&, TxAudioQueueEpoch, qint64); + Q_SLOT void transceiver_clear_jtty_pcm (TxAudioQueueEpoch); // Set modulation start TCI audio // @@ -463,7 +480,22 @@ public: // signals a change in one of the TransceiverState members Q_SIGNAL void transceiver_update (Transceiver::TransceiverState const&) const; Q_SIGNAL void transceiver_TCIframesWritten (qint64) const; + Q_SIGNAL void transceiverReceiveAudio (ReceiveAudio) const; Q_SIGNAL void transceiver_TCImodActive (bool) const; + Q_SIGNAL void txSourceCommitted (TxEvidence::TxStartSnapshot) const; + Q_SIGNAL void rawTxPlayoutSnapshot (TxEvidence::TxRawPlayoutSnapshot) const; + Q_SIGNAL void transceiver_jtty_drained (TxAudioQueueDrainState drain) const; + Q_SIGNAL void transceiver_jtty_enqueue_accepted (qint64 enqueueId, qint64 sampleCount, + TxAudioQueueProgress progress) const; + Q_SIGNAL void transceiver_jtty_enqueue_failed (TxAudioQueueEpoch epoch, + qint64 enqueueId) const; + Q_SIGNAL void tx_inhibit_status_changed ( + bool supported, bool inhibited, QString const& holder, + quint32 hold_rx, quint32 release_rx, quint32 expiries, quint32 invalid) const; + Q_SIGNAL void tx_inhibit_command (QString const& controller, quint32 ttl_ms, + QString const& station) const; + Q_SIGNAL void tx_inhibit_invalid (quint64 count) const; + Q_SIGNAL void transceiver_closing (bool failed) const; Q_SIGNAL void leavingSettings (bool) const; // Signals a failure of a control rig CAT or PTT connection. @@ -482,7 +514,7 @@ public: public slots: Q_SLOT void transceiver_volume (double = 0); - Q_SLOT void transceiver_txvolume (double = 0); + Q_SLOT void transceiver_txvolume (double = 0, bool force = false); private: class impl; diff --git a/Configuration.ui b/Configuration.ui index d7b9c0a1..53bf84d1 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -11,7 +11,7 @@ - + 0 0 @@ -75,24 +75,28 @@ - - - <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> - - + + + + + <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> + + + + + + + Check to allow grid changes from external programs + + + AutoGrid + + + + - - - - Check to allow grid changes from external programs - - - AutoGrid - - - @@ -400,12 +404,12 @@ text message. - + - <html><head/><body><p>Some rigs are not able to process CAT commands while transmitting. This means that if you are operating in split mode you may have to uncheck this option.</p></body></html> + <html><head/><body><p>Allow automatic Doppler tracking and split/Fake It/XIT to correct the transmit frequency while transmitting, including corrections of tens of kHz on microwave bands.</p><p>This option does not allow nominal dial or band changes while transmitting or tuning. Leave it unchecked if your rig cannot accept frequency-setting CAT commands while transmitting; WSJT-X will then make one midpoint Doppler correction before transmission starts.</p></body></html> - Allow Tx frequency changes while transmitting + Allow Tx-frequency corrections while transmitting @@ -440,6 +444,9 @@ text message. <html><head/><body><p>Number of seconds before Tune is aborted</p></body></html> + + Tune watchdog timeout + seconds @@ -482,6 +489,9 @@ text message. <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> + + Tx watchdog timeout + Disabled @@ -534,6 +544,9 @@ This might be required under your countries licence regulations. It will not interfere with other users as it is always sent in the quiet period when decoding is done. + + CW ID interval + @@ -647,6 +660,9 @@ quiet period when decoding is done. <html><head/><body><p>Increase or decrease the space between message text and DXCC.</p></body></html> + + DXCC alignment spacing + -2 @@ -680,6 +696,9 @@ quiet period when decoding is done. <html><head/><body><p>Increase or decrease the space between DXCC and distance/azimuth.</p></body></html> + + Distance and azimuth alignment spacing + -8 @@ -698,6 +717,19 @@ quiet period when decoding is done. + + + + Qt::Vertical + + + + 0 + 0 + + + + @@ -1347,9 +1379,6 @@ radio interface behave as expected. 0 - - How this program activates the PTT on your radio? - PTT Method @@ -1488,7 +1517,7 @@ other hardware interface for PTT. - <html><head/><body><p>Download the latest libhamlib-4.dll file from https://n0nb.users.sourceforge.net/. </p><p>Note: This function is only available on Windows.</p></body></html> + <html><head/><body><p>Download the latest libhamlib-4.dll file from Hamlib SourceForge snapshots. </p><p>Note: This function is only available on Windows.</p></body></html> Update Hamlib @@ -1763,6 +1792,9 @@ Unless you have multiple radios connected on different channels; then you will usually want to select mono or both here. + + Output audio channel + Mono @@ -1790,6 +1822,9 @@ both here. Select the channel to use for receiving. + + Input audio channel + Mono @@ -1869,6 +1904,9 @@ transmitting periods. <html><head/><body><p>Rx audio level</p></body></html> + + TCI receive audio level + Qt::AlignCenter @@ -2103,24 +2141,79 @@ color: rgb(0, 0, 0); Canned free text messages setup - + + + + New &macro: + + + add_macro_line_edit + + + + &Add + + Add Tx macro + + + Adds the entered message to the saved Tx macro list. + - - + + + + New Tx macro message + + + Enter a saved free-text message for the Tx5 dropdown. Free-text messages are limited to 13 characters including spaces. + + - + &Delete + + Delete Tx macro + + + Deletes the selected Tx macro, or the focused macro if no row is selected. + + + + + + + Move &Up + + + Move Tx macro up + + + Moves the selected Tx macro one position earlier in the list. + + + + + + + Move D&own + + + Move Tx macro down + + + Moves the selected Tx macro one position later in the list. + - + Qt::ActionsContextMenu @@ -2128,7 +2221,13 @@ color: rgb(0, 0, 0); Drag and drop items to rearrange order Right click for item specific actions -Click, SHIFT+Click and, CRTL+Click to select items +Click, SHIFT+Click and, CTRL+Click to select items + + + Saved Tx macro messages + + + Saved free-text messages for the main window Tx5 dropdown. Use Move Up and Move Down or drag and drop to reorder messages. QListView { @@ -2139,6 +2238,15 @@ QListView::item:alternate { background: #EEEEEE; } +QListView:focus { + border: 2px solid palette(highlight); +} + +QListView::item:focus { + border: 2px solid palette(highlight); + padding: 1px; +} + QListView::item:selected { border: 1px solid #6a6ea9; } @@ -2674,7 +2782,52 @@ comments field. Working Frequencies - + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Insert, delete, load, save, merge, or reset working frequencies. + + + Working frequencies actions + + + Insert, delete, load, save, merge, or reset working frequencies. + + + Qt::StrongFocus + + + QToolButton:focus { + border: 2px solid palette(highlight); + padding: 2px; +} + + + Actions... + + + QToolButton::InstantPopup + + + + + @@ -2683,6 +2836,16 @@ comments field. 0 + + QTableView:focus { + border: 2px solid palette(highlight); +} + +QTableView::item:focus { + border: 2px solid palette(highlight); + padding: 1px; +} + Qt::ActionsContextMenu @@ -2717,9 +2880,64 @@ comments field. Station Information - + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Insert or delete station information rows. + + + Station information actions + + + Insert or delete station information rows. + + + Qt::StrongFocus + + + QToolButton:focus { + border: 2px solid palette(highlight); + padding: 2px; +} + + + Actions... + + + QToolButton::InstantPopup + + + + + + + QTableView:focus { + border: 2px solid palette(highlight); +} + +QTableView::item:focus { + border: 2px solid palette(highlight); + padding: 1px; +} + Qt::ActionsContextMenu @@ -2785,8 +3003,44 @@ Right click for insert and delete options. - - + + + 4 + + + + + Change or reset colors for the selected highlighting rule. + + + Actions... + + + QToolButton::InstantPopup + + + + + + + Move the selected highlighting rule earlier in priority order. + + + Move Up + + + + + + + Move the selected highlighting rule later in priority order. + + + Move Down + + + + <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> @@ -2796,14 +3050,14 @@ Right click for insert and delete options. - + Reset Highlighting to Default 2 - + <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> @@ -2818,7 +3072,7 @@ Right click for insert and delete options. - + 0 0 @@ -2826,6 +3080,9 @@ Right click for insert and delete options. Qt::ActionsContextMenu + + Qt::ScrollBarAlwaysOff + true @@ -2907,7 +3164,7 @@ Right click for insert and delete options. - <html><head/><body><p>Highlight callsigns or grids with orange background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with orange background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> Highlight orange: @@ -2917,7 +3174,7 @@ Right click for insert and delete options. - <html><head/><body><p>Highlight callsigns or grids with blue background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with blue background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> Highlight blue: @@ -2927,14 +3184,14 @@ Right click for insert and delete options. - <html><head/><body><p>Highlight callsigns or grids with orange background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with orange background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> - <html><head/><body><p>Highlight callsigns or grids with blue background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with blue background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> @@ -2970,7 +3227,7 @@ Right click for insert and delete options. <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> - URL + LotW users CSV URL http://lotw.arrl.org/lotw-user-activity.csv @@ -3151,16 +3408,23 @@ Right click for insert and delete options. <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> - Upload QSOs to Cloudlog or Wavelog - - - true - - - false + Cloudlog or Wavelog + + + <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> + + + Upload QSOs to Cloudlog or Wavelog + + + Upload QSOs to Cloudlog or Wavelog + + + + @@ -3170,6 +3434,9 @@ Right click for insert and delete options. API URL: + + leCloudlogApiUrl + @@ -3180,22 +3447,28 @@ Right click for insert and delete options. API Key: + + leCloudlogApiKey + - + - <html><head/><body><p>Your Station ID.</p></body></html> + <html><head/><body><p>Your Cloudlog or Wavelog station profile.</p></body></html> - Station ID: + Station profile: + + + cbCloudlogStationProfile - - + + - + 0 0 @@ -3213,13 +3486,13 @@ Right click for insert and delete options. - <html><head/><body><p>Your Station ID.</p></body></html> + <html><head/><body><p>Your Cloudlog or Wavelog station profile.</p></body></html> - - 1 + + true - - 999999 + + QComboBox::NoInsert @@ -3240,26 +3513,13 @@ Right click for insert and delete options. - <html><head/><body><p>Test the Cloudlog or Wavelog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> + <html><head/><body><p>Check the Cloudlog or Wavelog connection, API key, station profile, and upload path where safe.</p><p>The button will turn green if the connection can upload QSOs, orange if the key is valid but read-only, and red if the configuration is unusable.</p></body></html> - Test API Key + Check Connection - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -3360,11 +3620,11 @@ Right click for insert and delete options. - - - 0 - 50 - + + + 0 + 0 + Tone spacing @@ -3378,6 +3638,9 @@ Right click for insert and delete options. <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> + + 2x tone spacing + x 2 @@ -3391,6 +3654,9 @@ Right click for insert and delete options. <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> + + 4x tone spacing + x 4 @@ -3401,11 +3667,11 @@ Right click for insert and delete options. - - - 0 - 50 - + + + 0 + 0 + Waterfall spectra @@ -3523,25 +3789,35 @@ Right click for insert and delete options. <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> - Upload QSOs to eQSL.cc - - - true - - - false + eQSL.cc - - - - - <html><head/><body><p>Your username.</p></body></html> - + + + <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> + + + Upload QSOs to eQSL.cc + + + Upload QSOs to eQSL.cc + + + + + + + + + <html><head/><body><p>Your username.</p></body></html> + Username: + + eqsluser_edit + @@ -3552,6 +3828,9 @@ Right click for insert and delete options. Password: + + eqslpasswd_edit + @@ -3562,6 +3841,9 @@ Right click for insert and delete options. QTH: + + eqslnick_edit + @@ -3590,104 +3872,66 @@ Right click for insert and delete options. - - - - GUI tweaks for high-resolution monitors - - - - - - <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> - - - HighDPI scaling (restart required) - - - - - - - <html><head/><body><p>Increased height of some control elements.</p></body></html> - - - Increased height of the tab widget (restart required) - - - - - - Special operating activity - - true - - - false - - - - - <html><head/><body><p>ARRL International Digital Contest</p></body></html> + + + + Enable special operating activity - ARRL Digi Contest + Enable special operating activity - - special_op_activity_button_group - - - - - - 0 - 18 - - + + - <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> + <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> - WW Digital Contest + Fox - WW Digi Contest + Fox + + + false special_op_activity_button_group - - + + - <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> + <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> - NCCC Sprint + SuperFox mode - - + + - + - <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> + <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> - A R R L Field Day + Hound - ARRL Field Day + Hound + + + true special_op_activity_button_group @@ -3695,7 +3939,7 @@ Right click for insert and delete options. - + Qt::Horizontal @@ -3707,182 +3951,141 @@ Right click for insert and delete options. - - - - - - Field Day exchange - - - FD Exch: - - - Field_Day_Exchange - - - - - - - - 70 - 0 - - - - <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> - - - 6A SNJ - - - Qt::AlignCenter - - - - - - - + + - + + + false + - <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> + <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> - Hound + Enable OTP verification - Hound + OTP true - - special_op_activity_button_group - - + Qt::Horizontal + + QSizePolicy::Fixed + - 40 + 5 20 - - - - - - - <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> - + + + OTP key + + + Key: + + + OTPSeed + + + + + - R T T Y Roundup + OTP key + + + + 110 + 0 + + + + <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> - FT Roundup messages + M2ZUU5CW6EVOY2HU - - special_op_activity_button_group - - + Qt::Horizontal + + QSizePolicy::Fixed + - 40 + 10 20 - - - - - RTTY Roundup exchange - - - FT RU Exch: - - - RTTY_Exchange - - - - - - - - 70 - 0 - - - - <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> - - - NJ - - - Qt::AlignCenter - - - - + + + OTP interval + + + Interval + + + sbOTPinterval + + + + + + + OTP interval + + + <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> + + + 20 + + + 1 + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 10 + 20 + + + - - - - - 0 - 0 - - - - <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> - - - EU VHF Contest - - - EU VHF Contest - - - special_op_activity_button_group - - - - - - - <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> - - - SuperFox mode - - - - + @@ -3915,11 +4118,17 @@ Right click for insert and delete options. - - OTP URL: - - - + + OTP URL + + + OTP URL: + + + OTPUrl + + + @@ -3938,6 +4147,9 @@ Right click for insert and delete options. + + OTP URL + 110 @@ -3954,8 +4166,112 @@ Right click for insert and delete options. - - + + + + + 0 + 0 + + + + <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> + + + NA VHF Contest + + + NA VHF + + + special_op_activity_button_group + + + + + + + <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> + + + NCCC Sprint + + + + + + + + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> + + + ARRL Field Day + + + ARRL Field Day + + + special_op_activity_button_group + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Field Day exchange + + + FD Exch: + + + Field_Day_Exchange + + + + + + + Field Day exchange + + + + 70 + 0 + + + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> + + + 6A SNJ + + + Qt::AlignCenter + + + + + + + + + 0 @@ -3963,150 +4279,146 @@ Right click for insert and delete options. - <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> - - - NA VHF Contest - - - NA VHF - - - special_op_activity_button_group - - - - - - - <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> + <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> - Fox + EU VHF Contest - Fox - - - false + EU VHF Contest special_op_activity_button_group - - + + - - - false - + - <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> - - - OTP - - - true - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 5 - 20 - - - - - - - - Key: - - - - - - - - 110 - 0 - + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> - - <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> + + FT Roundup messages - M2ZUU5CW6EVOY2HU + FT Roundup messages + + special_op_activity_button_group + - + Qt::Horizontal - - QSizePolicy::Fixed - - 10 + 40 20 - - - Interval - - - - - - - <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> - - - 20 - - - 1 - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - + + + + + FT Roundup exchange + + + FT RU Exch: + + + RTTY_Exchange + + + + + + + FT Roundup exchange + + + + 70 + 0 + + + + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> + + + NJ + + + Qt::AlignCenter + + + + + + + + + 0 + 18 + + + + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> + + + WW Digi Contest + + + WW Digi Contest + + + special_op_activity_button_group + + + + + + <html><head/><body><p>ARRL International Digital Contest</p></body></html> + + + ARRL Digi Contest + + + special_op_activity_button_group + + + + + + + + 0 + 18 + + + + <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> + + + Q65 Pileup + + + special_op_activity_button_group + + + + @@ -4136,13 +4448,22 @@ Right click for insert and delete options. + + Contest name + Contest name: + + Contest_Name + + + Contest name + 70 @@ -4167,25 +4488,6 @@ Right click for insert and delete options. - - - - - 0 - 18 - - - - <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> - - - Q65 Pileup - - - special_op_activity_button_group - - - @@ -4497,6 +4799,9 @@ Right click for insert and delete options. Voices: + + voices_combo_box + @@ -5008,6 +5313,8 @@ Right click for insert and delete options. add_macro_line_edit add_macro_push_button delete_macro_push_button + move_macro_up_push_button + move_macro_down_push_button macros_list_view prompt_to_log_check_box log_as_RTTY_check_box @@ -5026,7 +5333,9 @@ Right click for insert and delete options. n1mm_server_port_spin_box calibration_slope_ppm_spin_box calibration_intercept_spin_box + frequencies_actions_tool_button frequencies_table_view + stations_actions_tool_button stations_table_view highlighting_list_view LotW_CSV_URL_line_edit @@ -5041,12 +5350,36 @@ Right click for insert and delete options. cbx4ToneSpacing rbLowSidelobes rbMaxSensitivity - gbSpecialOpActivity + cbSpecialOpActivity + rbFox + cbSuperFox + rbHound + cbOTP + OTPSeed + sbOTPinterval + cbShowOTP + OTPUrl + rbNA_VHF_Contest + cb_NCCC_Sprint rbField_Day + Field_Day_Exchange rbEU_VHF_Contest rbRTTY_Roundup - Field_Day_Exchange RTTY_Exchange + rbWW_DIGI + rbARRL_Digi + rbQ65pileup + cbContestName + Contest_Name + cbCloudlog + leCloudlogApiUrl + leCloudlogApiKey + cbCloudlogStationProfile + pbTestCloudlog + cbEQSL + eqsluser_edit + eqslpasswd_edit + eqslnick_edit Territory1 Territory2 Territory3 diff --git a/CountryNames.cpp b/CountryNames.cpp new file mode 100644 index 00000000..79828f36 --- /dev/null +++ b/CountryNames.cpp @@ -0,0 +1,28 @@ +#include "CountryNames.hpp" + +namespace Radio +{ + QString CountryNames::abbreviate(QString name) + { + name.replace ("Islands", "Is."); + name.replace ("Island", "Is."); + name.replace ("North ", "N. "); + name.replace ("Northern ", "N. "); + name.replace ("South ", "S. "); + name.replace ("East ", "E. "); + name.replace ("Eastern ", "E. "); + name.replace ("West ", "W. "); + name.replace ("Western ", "W. "); + name.replace ("Central ", "C. "); + name.replace (" and ", " & "); + name.replace ("Republic", "Rep."); + name.replace ("United States of America", "U.S.A."); + name.replace ("United States", "U.S.A."); + name.replace ("Fed. Rep. of ", ""); + name.replace ("French ", "Fr."); + name.replace ("Asiatic", "AS"); + name.replace ("European", "EU"); + name.replace ("African", "AF"); + return name; + } +} diff --git a/CountryNames.hpp b/CountryNames.hpp new file mode 100644 index 00000000..08b5c60c --- /dev/null +++ b/CountryNames.hpp @@ -0,0 +1,15 @@ +#ifndef COUNTRYNAMES_HPP +#define COUNTRYNAMES_HPP + +#include + +namespace Radio +{ + class CountryNames + { + public: + static QString abbreviate(QString countryName); + }; +} + +#endif // COUNTRYNAMES_HPP diff --git a/DOCS-LICENSE.md b/DOCS-LICENSE.md new file mode 100644 index 00000000..70247c33 --- /dev/null +++ b/DOCS-LICENSE.md @@ -0,0 +1,30 @@ +# Documentation License + +This policy covers the WSJT-X User Guide, the Quick Start Guides accessible from the Help menus of *WSJT-X*, *MAP65*, and *QMAP*, and other end-user documentation published by the WSJT Development Team. It does **not** cover the source code, which remains licensed under the GNU General Public License v3.0 (see [COPYING](COPYING)). Documentation is creative written work, not software, and we license it separately. + +Our documentation is © WSJT Development Team and licensed under [**CC BY-ND 4.0**](https://creativecommons.org/licenses/by-nd/4.0/) (Attribution–NoDerivatives). In short: you may copy and redistribute our documents in any medium or format, unmodified, with credit to us and a link back to [the originals](https://wsjtx.github.io/wsjtx/guide.html), but you may not distribute a modified version. + +## Why we care + +Our documentation is written to help users make the most effective use of our published open-source programs. We strongly and warmly encourage contributions to the project in the form of pull requests (see [CONTRIBUTING](CONTRIBUTING.md)), and accepted changes are suitably documented. Forks of our project are presumed to yield programs that behave or appear differently, and a modified copy of our documentation can describe protocol behavior, settings, or procedures that no longer match what such a fork actually does — misleading operators even beyond misrepresentation of authorship. Maintainers of forks should document them independently, without implying any endorsement or association with builds we haven't reviewed, don't control, and don't support. + +## Actions allowed + +- Redistributing or mirroring our documentation exactly as published, with attribution and a link back to the original. +- Linking to our published guides as references from your own project. +- Quoting short excerpts, with attribution, as you would from any copyrighted work. + +## Forbidden without permission + +- Publishing a modified or edited version of our documentation — including as documentation for a fork, under any name. +- Republishing our documentation, modified or not, with attribution to us removed. + +If you've built a fork with different behavior, appearance, or other characteristics, please write your own documentation for it. You're welcome to link to ours as a starting reference, or to contact us about permission for an adapted version. + +## Questions or concerns + +If you're unsure whether a planned use is fine, or want to flag a misuse you've found, please open an issue or contact the WSJT Development Team. + +--- + +*This is not a substitute for legal advice. It describes how we intend to use and enforce our documentation copyright in practice.* diff --git a/Darwin/ReadMe.txt b/Darwin/ReadMe.txt index 6484650b..45a05af2 100644 --- a/Darwin/ReadMe.txt +++ b/Darwin/ReadMe.txt @@ -1,132 +1,142 @@ - Notes on WSJT-X Installation for Mac OS X - ----------------------------------------- - -If you have already downloaded a previous version of WSJT-X then I suggest -you change the name in the Applications folder from WSJT-X to WSJT-X_previous -before proceeding. - -I recommend that you follow the installation instructions especially if you -are moving from v2.5 to v2.6 or later, of WSJT-X or you have upgraded macOS. - -Double-click on the wsjtx-...-Darwin.dmg file you have downloaded from the main web-site. -Make sure that you leave this window open for the remaining installation steps. - -Now open a Terminal window by going to Applications->Utilities and clicking on Terminal. - -Along with this ReadMe file there is a file: com.wsjtx.sysctl.plist which must be copied to a -system area by typing these lines in the Terminal window and then pressing the Return key after -each line. - - sudo cp /Volumes/WSJT-X/com.wsjtx.sysctl.plist /Library/LaunchDaemons - sudo chown root:wheel /Library/LaunchDaemons/com.wsjtx.sysctl.plist - -you will be asked for your normal password because authorisation is needed to copy this file. -(Your password will not be echoed but press the Return key when completed.) - -If your Mac is using Sonoma 14.6 or later then in addition to these two commands you must visit: - - System Settings > General > Login Items > sysctl and select ON for sysctl. - -IMPORTANT: Now re-boot your Mac otherwise these changes will not take effect. - -After the reboot you should re-open the Terminal window as before and you can check -that the change has been made by typing: - - sysctl -a | grep sysv.shm - -If shmmax is not shown as 52428800 then contact me since WSJT-X will fail to load with -an error message: "Unable to create shared memory segment". If the value of shmmax -is shown as 20971520 then it is probable that you have download JTDX. WSJT-X and JTDX -cannot both control the shmmax parameter. Contact me for advice. - -You can now close the Terminal window. It will not be necessary to repeat this procedure -again, even when you download an updated version of WSJT-X. It might be necessary if you -upgrade macOS. - -Drag the WSJT-X app to your preferred location, such as Applications, and close the window. - -You need to configure your sound card. Visit Applications > Utilities > Audio MIDI -Setup and select your sound card and then set Format to be "48000Hz 2ch-16bit" for -input and output. On rare occasions problems with audio output to your rig can be -corrected if you select 44100Hz for output format. - -Now double-click on the WSJT-X app and two windows will appear. Select Preferences -under the WSJT-X Menu and fill in various station details on the General panel. -I recommend checking the 4 boxes under the Display heading and the first 4 boxes under -the Behaviour heading. - -Depending on your macOS you might see a pop-up window suggesting that wsjtx wants to use the -microphone. What this means is that audio input must be allowed. Agree. - -Next visit the Audio panel and select the Audio Codec you use to communicate between -WSJT-X and your rig. There are so many audio interfaces available that it is not -possible to give detailed advice on selection. If you have difficulties contact me. -Note the location of the Save Directory. Decoded wave forms are located here. - -Look at the Reporting panel. If you check the "Prompt me" box, a logging panel will appear -at the end of the QSO. Visit Section 11 of the User Guide for information about log files -and how to access them. - -Finally, visit the Radio panel. WSJT-X is most effective when operated with CAT -control. You will need to install the relevant Mac device driver for your rig, -and then re-launch WSJT-X. Return to the Radio panel in Preferences and in -the "Serial port" panel select your driver from the list that is presented. - -You may need a device driver for your Mac. The USB/UART Bridge chip inside the Icom, -Yaesu and Kenwood radios is a Silicon Labs USB to UART Bridge Controller and the Mac -drivers are available here: - -https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers - -Visit the SiLabs site and download v6 for a Mac. Then in WSJT-X if you use the drop-down menu -for Serial Port you should see something like /dev/tty.SLAB_USBtoUART if the driver has been -installed correctly. Make sure you read the release notes that come with the driver. - -WSJT-X needs the Mac clock to be accurate. Visit System Preferences > Date & Time -and make sure that Date and Time are set automatically. The drop-down menu will -normally offer you several time servers to choose from. - -On the Help menu, have a look at the new Online User's Guide for operational hints -and tips and possible solutions to any problem you might have. - -Please email me if you have problems. - ---- John G4KLA (g4kla@rmnjmn.co.uk) - -Addendum: Information about com.wsjtx.sysctl.plist and multiple instances of WSJT-X. - -WSJT-X makes use of a block of memory which is shared between different parts of -the code. The normal allocation of shared memory on a Mac is insufficient and this -has to be increased. The com.wsjtx.sysctl.plist file is used for this purpose. You can -use a Mac editor to examine the file. (Do not use another editor - the file -would probably be corrupted.) - -It is possible to run two instances of WSJT-X simultaneously. See "Section 16.2 -Frequently asked Questions" in the User Guide. If you wish to run more than two instances -simultaneously, the shmall parameter in the com.wsjtx.sysctl.plist file needs to be modified as follows. - -The shmall parameter determines the amount of shared memory which is allocated in 4096 byte pages -with 50MB (52428800) required for each instance. The shmall parameter is calculated as: -(n * 52428800)/4096 where 'n' is the number of instances required to run simultaneously. -Replace your new version of this file in /Library/LaunchDaemons and remember to reboot your -Mac afterwards. - -Note that the shmmax parameter remains unchanged. This is the maximum amount of shared memory that -any one instance is allowed to request from the total shared memory allocation and should not -be changed. - -If two instances of WSJT-X are running, it is likely that you might need additional -audio devices, from two rigs for example. Visit Audio MIDI Setup and create an Aggregate Device -which will allow you to specify more than one interface. I recommend you consult Apple's guide -on combining multiple audio interfaces which is at https://support.apple.com/en-us/HT202000. - -2. Preventing WSJT-X from being put into 'sleep' mode (App Nap). - -In normal circumstances an application which has not been directly accessed for a while can be -subject to App Nap which means it is suspended until such time as its windows are accessed. If -you find that WSJT-X seems disabled check this by opening Applications > Utilities > Activity Monitor and -then select Energy and look at the column marked App Nap. If you see wsjtx marked "Yes" then you need -to disable App Nap by opening a Terminal window and typing: - defaults write NSGlobalDomain NSAppSleepDisabled -bool YES -This will disable App Nap for all applications. If you wish to reverse this type: - defaults delete NSGlobalDomain NSAppSleepDisabled +28Feb2026 Notes on WSJT-X Installation for Mac OS X + ----------------------------------------- + +If you have already downloaded a previous version of WSJT-X then I suggest +you change the name in the Applications folder from WSJT-X to WSJT-X_previous +before proceeding. + +I recommend that you follow the installation instructions especially if you +are moving from v2.7 to v3.0 or later, of WSJT-X or you have upgraded macOS. + +Double-click on the wsjtx-...-Darwin.dmg file you have downloaded from the main web-site. +NB: Make sure that you leave this window open for the remaining installation steps. + +Now open a Terminal window by going to Applications->Utilities and clicking on Terminal. + +Along with this ReadMe file there is a file: com.wsjtx.sysctl.plist which must be copied to a +system area by typing these lines in the Terminal window and then pressing the Return key after +each line. + + sudo cp /Volumes/WSJT-X/com.wsjtx.sysctl.plist /Library/LaunchDaemons + sudo chown root:wheel /Library/LaunchDaemons/com.wsjtx.sysctl.plist + +you will be asked for your normal password because authorisation is needed to copy this file. +(Your password will not be echoed but press the Return key when completed.) + +If your Mac is using Sonoma 14.6 or later then in addition to these two commands you must visit: + + System Settings > General > Login Items > sysctl and select ON for sysctl. + +or if using Sequoia then visit System Settings > General > Login Items & Extensions +and select ON for sysctl. + +IMPORTANT: Now re-boot your Mac otherwise these changes will not take effect. + +After the reboot you should re-open the Terminal window as before and you can check +that the change has been made by typing: + + sysctl -a | grep sysv.shm + +If shmmax is not shown as 52428800 then contact me since WSJT-X will fail to load with +an error message: "Unable to create shared memory segment". If the value of shmmax +is shown as 20971520 then it is probable that you have download JTDX. WSJT-X and JTDX +cannot both control the shmmax parameter. You will need to remove the JTDX plist. Open +a terminal window and type: + + sudo rm -i /Library/LaunchDaemons/com.jtdx.sysctl.plist + +you must agree to the deletion: type y and then reboot your Mac. JTDX and WSJT-X will both run. + +You can now close the Terminal window. It will not be necessary to repeat this procedure +again, even when you download an updated version of WSJT-X. It might be necessary if you +upgrade macOS. + +Drag the WSJT-X app to your preferred location, such as Applications, and close the window. + +You need to configure your sound card. Visit Applications > Utilities > Audio MIDI +Setup and select your sound card and then set Format to be "48000Hz 2ch-16bit" for +input and output. On rare occasions problems with audio output to your rig can be +corrected if you select 44100Hz for output format. + +Now double-click on the WSJT-X app and two windows will appear. Select Preferences +under the WSJT-X Menu and fill in various station details on the General panel. +I recommend checking the 4 boxes under the Display heading and the first 4 boxes under +the Behaviour heading. + +Depending on your macOS you might see a pop-up window suggesting that wsjtx wants to use the +microphone. What this means is that audio input must be allowed. Agree. + +Next visit the Audio panel and select the Audio Codec you use to communicate between +WSJT-X and your rig. There are so many audio interfaces available that it is not +possible to give detailed advice on selection. If you have difficulties contact me. +Note the location of the Save Directory. Decoded wave forms are located here. + +Look at the Reporting panel. If you check the "Prompt me" box, a logging panel will appear +at the end of the QSO. Visit Section 11 of the User Guide for information about log files +and how to access them. + +Finally, visit the Radio panel. WSJT-X is most effective when operated with CAT +control. You will need to install the relevant Mac device driver for your rig, +and then re-launch WSJT-X. Return to the Radio panel in Preferences and in +the "Serial port" panel select your driver from the list that is presented. + +You may need a device driver for your Mac. The USB/UART Bridge chip inside the Icom, +Yaesu and Kenwood radios is a Silicon Labs USB to UART Bridge Controller and the Mac +drivers are available here: + +https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers + +Visit the SiLabs site and download v6 for a Mac. Then in WSJT-X if you use the drop-down menu +for Serial Port you should see something like /dev/tty.SLAB_USBtoUART if the driver has been +installed correctly. Make sure you read the release notes that come with the driver. + +WSJT-X needs the Mac clock to be accurate. Visit System Preferences > Date & Time +and make sure that Date and Time are set automatically. The drop-down menu will +normally offer you several time servers to choose from. + +On the Help menu, have a look at the new Online User's Guide for operational hints +and tips and possible solutions to any problem you might have. + +Please email me if you have problems. + +--- John G4KLA (g4kla@rmnjmn.co.uk) + +Addendum: Information about com.wsjtx.sysctl.plist and multiple instances of WSJT-X. + +WSJT-X makes use of a block of memory which is shared between different parts of +the code. The normal allocation of shared memory on a Mac is insufficient and this +has to be increased. The com.wsjtx.sysctl.plist file is used for this purpose. You can +use a Mac editor to examine the file. (Do not use another editor - the file +would probably be corrupted.) + +It is possible to run two instances of WSJT-X simultaneously. See "Section 16.2 +Frequently asked Questions" in the User Guide. If you wish to run more than two instances +simultaneously, the shmall parameter in the com.wsjtx.sysctl.plist file needs to be modified as follows. + +The shmall (Shared Memory Allocation) parameter determines the amount of shared memory which +is allocated in 4096 byte pages with 50MB (52428800) required for each instance. The shmall +parameter is calculated as: (n * 52428800)/4096 where 'n' is the number of instances required to +run simultaneously. + +Replace your new version of this file in /Library/LaunchDaemons and remember to reboot your +Mac afterwards. + +Note that the shmmax parameter remains unchanged. This is the maximum amount of shared memory that +any one instance is allowed to request from the total shared memory allocation and should not +be changed. + +If two instances of WSJT-X are running, it is likely that you might need additional +audio devices, from two rigs for example. Visit Audio MIDI Setup and create an Aggregate Device +which will allow you to specify more than one interface. I recommend you consult Apple's guide +on combining multiple audio interfaces which is at https://support.apple.com/en-us/HT202000. + +2. Preventing WSJT-X from being put into 'sleep' mode (App Nap). + +In normal circumstances an application which has not been directly accessed for a while can be +subject to App Nap which means it is suspended until such time as its windows are accessed. If +you find that WSJT-X seems disabled check this by opening Applications > Utilities > Activity Monitor and +then select Energy and look at the column marked App Nap. If you see wsjtx marked "Yes" then you need +to disable App Nap by opening a Terminal window and typing: + defaults write NSGlobalDomain NSAppSleepDisabled -bool YES +This will disable App Nap for all applications. If you wish to reverse this type: + defaults delete NSGlobalDomain NSAppSleepDisabled diff --git a/DecDataMutex.cpp b/DecDataMutex.cpp new file mode 100644 index 00000000..20487e4a --- /dev/null +++ b/DecDataMutex.cpp @@ -0,0 +1,29 @@ +#include "DecDataMutex.hpp" + +#include +#include + +namespace +{ +std::atomic_bool& input_blocked () +{ + static std::atomic_bool blocked {false}; + return blocked; +} +} + +QMutex& dec_data_mutex() +{ + static QMutex mutex; + return mutex; +} + +bool dec_data_input_blocked () +{ + return input_blocked ().load (std::memory_order_acquire); +} + +void set_dec_data_input_blocked (bool blocked) +{ + input_blocked ().store (blocked, std::memory_order_release); +} diff --git a/DecDataMutex.hpp b/DecDataMutex.hpp new file mode 100644 index 00000000..68a49266 --- /dev/null +++ b/DecDataMutex.hpp @@ -0,0 +1,10 @@ +#ifndef DEC_DATA_MUTEX_HPP +#define DEC_DATA_MUTEX_HPP + +class QMutex; + +QMutex& dec_data_mutex(); +bool dec_data_input_blocked (); +void set_dec_data_input_blocked (bool blocked); + +#endif diff --git a/DecodeOperatingContext.hpp b/DecodeOperatingContext.hpp new file mode 100644 index 00000000..39530b77 --- /dev/null +++ b/DecodeOperatingContext.hpp @@ -0,0 +1,68 @@ +#ifndef DECODE_OPERATING_CONTEXT_HPP +#define DECODE_OPERATING_CONTEXT_HPP + +#include +#include + +#include "Radio.hpp" +#include "SpecialOperatingActivity.hpp" + +struct DecodeOperatingContext +{ + QString mode; + SpecialOperatingActivity specOp {SpecialOperatingActivity::NONE}; + Radio::Frequency periodFrequency {0}; + QString band; + QDateTime sequenceStart; + double trPeriod {0.0}; + int submode {0}; + bool diskData {false}; + bool multithreadFt8 {false}; + int ft8DecoderStart {0}; + int ft8ThreadCount {0}; + int decodeDepth {0}; + int ft8Cycles {0}; + int ft8Sensitivity {0}; + int ft8RxFrequencySensitivity {0}; + int decodeLowFrequency {0}; + int decodeHighFrequency {0}; + bool ft8WideDxCallSearch {false}; + bool hideFt8DuplicateMessages {false}; + bool ft8ApEnabled {false}; + bool superFox {false}; + QString myCall; + + bool hasSameDecodeIdentity (DecodeOperatingContext const& other) const + { + return mode == other.mode + && specOp == other.specOp + && periodFrequency == other.periodFrequency + && band == other.band + && trPeriod == other.trPeriod + && submode == other.submode + && diskData == other.diskData + && multithreadFt8 == other.multithreadFt8 + && ft8DecoderStart == other.ft8DecoderStart + && superFox == other.superFox + && myCall == other.myCall; + } + + bool hasSameFt8PendingIdentity (DecodeOperatingContext const& other) const + { + return "FT8" == mode + && "FT8" == other.mode + && hasSameDecodeIdentity (other) + && ft8ThreadCount == other.ft8ThreadCount + && decodeDepth == other.decodeDepth + && ft8Cycles == other.ft8Cycles + && ft8Sensitivity == other.ft8Sensitivity + && ft8RxFrequencySensitivity == other.ft8RxFrequencySensitivity + && decodeLowFrequency == other.decodeLowFrequency + && decodeHighFrequency == other.decodeHighFrequency + && ft8WideDxCallSearch == other.ft8WideDxCallSearch + && hideFt8DuplicateMessages == other.hideFt8DuplicateMessages + && ft8ApEnabled == other.ft8ApEnabled; + } +}; + +#endif diff --git a/DecodeOutputPlan.cpp b/DecodeOutputPlan.cpp new file mode 100644 index 00000000..9f472a69 --- /dev/null +++ b/DecodeOutputPlan.cpp @@ -0,0 +1,467 @@ +#include "DecodeOutputPlan.hpp" + +#include "MessageFilter.hpp" +#include "qt_helpers.hpp" + +#include +#include + +#include + +namespace +{ + using Action = DecodeOutputPlan::Action; + using ActionKind = DecodeOutputPlan::ActionKind; + using SpecOp = SpecialOperatingActivity; + + // Matches a standalone signal report token, e.g. " R-10"; shared by right-window + // routing and the competing-Fox alert so the two rules cannot drift. + QRegularExpression const fox_report_regexp {" R\\W\\d"}; + + void appendAction(QVector& actions, ActionKind kind, QString text = QString {}) + { + actions.append(Action {kind, text}); + } + + bool isFalseDecode(QByteArray const& line, DecodedText const& decoded, + QString const& message, DecodeOutputPlan::PreparationContext const& context, + QString& reason) + { + bool const rejectA7 = (context.noA7Decodes && line.contains("a7") && !context.diskData) + || (line.contains("a7") && SpecOp::NONE != context.specOp && !context.diskData + && !(line.contains(" R ") || line.contains("RR73") || line.contains("CQ "))); + if (rejectA7) { + reason = "a7 decode rejected"; + return true; + } + + bool const earlyMode = SpecOp::NONE == context.specOp + || (context.multithreadFt8 && context.ft8DecoderStart < 2); + // A blank key would match any accumulator via contains(""), silently + // swallowing lines shorter than 24 bytes. + QString const duplicateKey = QString::fromUtf8(line.mid(23, 19)); + bool const duplicate = context.mode == "FT8" + && ((context.multithreadFt8 && context.ft8DecoderStart < 2) + || context.nominalFrequency > 45000000) + && !duplicateKey.trimmed().isEmpty() + && context.earlyDecodes.contains(duplicateKey); + bool const suspiciousLowSnr = SpecOp::NONE == context.specOp && decoded.snr() < -12 + && (message.contains("> <") + || message.contains(QRegularExpression {"(\\w+)/P (\\w+)/P "}) + || message.contains(QRegularExpression {"(\\w+)/R (\\w+)/R "}) + || (message.contains("/R ") && message.contains("?")) + || (message.contains(";") && message.contains(" R "))); + if (earlyMode && (duplicate || suspiciousLowSnr)) { + reason = duplicate ? "early duplicate rejected" : "suspicious low-SNR decode rejected"; + return true; + } + + bool const suspiciousShape = (message.contains("/P ") && message.contains(" R ")) + || (message.contains(";") && message.contains("/R ")) + || (message.contains(";") && message.contains("/P ")) + || (message.contains("<...>") && message.contains(" R ")) + || (message.contains("<...>") && message.contains("/P ")) + || (message.contains("<...>") && message.contains(";")) + || message.contains(QRegularExpression {"\\w\\w\\w\\w\\w\\w\\w\\w"}) + || message.contains(QRegularExpression {"\\d\\d\\d \\d\\d\\d"}) + || message.contains("3.") || message.contains("2."); + bool const reduceFalseDecode = SpecOp::NONE == context.specOp && context.reduceFalseDecodes + && context.mode == "FT8" + && ((suspiciousShape && decoded.snr() < -15) + || ((message.contains("/R ") || message.contains(" R ")) && decoded.snr() < -18) + || ((message.contains("<...>") || message.contains(";") + || message.contains("? a") || message.contains("/R ") + || message.contains(" R ") || decoded.snr() < -20) + && (message.contains("3.") || message.contains("2.")))); + if (reduceFalseDecode) { + reason = "reduce-false-decodes rule rejected line"; + return true; + } + return false; + } + + void parseAveragingInfo(QByteArray const& line, QString const& mode, bool& averaged, int& count) + { + if (mode != "JT4" && mode != "JT65" && mode != "Q65") return; + + // Decoder suffixes f/d/a/q carry pass-specific averaging counts; + // '*' represents ten or more contributing decodes. + int const nf = line.indexOf("f"); + if (nf > 0) { + count = line.mid(nf + 1, 1).toInt(); + if (line.indexOf("f*") > 0) count = 10; + } + int nd = -1; + if (nf < 0) nd = line.indexOf("d"); + if (nd > 0) { + count = line.mid(nd + 2, 1).toInt(); + if (line.mid(nd + 2, 1) == "*") count = 10; + } + int na = -1; + if (nf < 0 && nd < 0) na = line.indexOf("a"); + if (na > 0) { + count = line.mid(na + 2, 1).toInt(); + if (line.mid(na + 2, 1) == "*") count = 10; + } + int nq = -1; + if (nf < 0 && nd < 0 && na < 0) nq = line.indexOf("q"); + if (nq > 0) { + count = line.mid(nq + 2, 1).toInt(); + if (line.mid(nq + 2, 1) == "*") count = 10; + } + averaged = count >= 2; + } + + bool shouldResetScores(DecodeOutputPlan::KeywordFilterContext const& context) + { + return context.pounce && isScoringAutoRespondPolicy (context.respondPolicy); + } + + bool hiddenByGeographyOrWorkedBefore( + DecodeOutputPlan::VisibilityFilterContext const& context, + QString const& deCall, QString const& deGrid) + { + if (context.bypass) return false; + bool const usesTerritory = (context.hideTerritory1 && !context.territory1.isEmpty()) + || (context.hideTerritory2 && !context.territory2.isEmpty()) + || (context.hideTerritory3 && !context.territory3.isEmpty()) + || (context.hideTerritory4 && !context.territory4.isEmpty()); + if (usesTerritory && context.countryName) { + auto const countryName = context.countryName(deCall); + if (context.hideTerritory1 && !context.territory1.isEmpty() + && countryName.contains(context.territory1)) return true; + if (context.hideTerritory2 && !context.territory2.isEmpty() + && countryName.contains(context.territory2)) return true; + if (context.hideTerritory3 && !context.territory3.isEmpty() + && countryName.contains(context.territory3)) return true; + if (context.hideTerritory4 && !context.territory4.isEmpty() + && countryName.contains(context.territory4)) return true; + } + if (context.hideWorkedBefore && context.workedBeforeOnBand + && context.workedBeforeOnBand(deCall, deGrid)) return true; + bool const usesContinent = context.hideEurope || context.hideAsia + || context.hideNorthAmerica || context.hideSouthAmerica || context.hideAfrica + || context.hideOceania || context.hideAntarctica; + if (usesContinent && context.continent) { + auto const continent = context.continent(deCall); + if (context.hideEurope && continent == "EU") return true; + if (context.hideAsia && continent == "AS") return true; + if (context.hideNorthAmerica && continent == "NA") return true; + if (context.hideSouthAmerica && continent == "SA") return true; + if (context.hideAfrica && continent == "AF") return true; + if (context.hideOceania && continent == "OC") return true; + if (context.hideAntarctica && continent == "AN") return true; + } + return false; + } +} + +namespace DecodeOutputPlan +{ + PreparedLine prepareLine(QByteArray const& rawLine, PreparationContext const& context) + { + PreparedLine result; + result.rawLine = rawLine; + result.normalizedLine = rawLine; + + if (context.qsyEnabled) appendAction(result.actions, ActionKind::ShowQsyMessage, + QString {rawLine}); + if (context.mode == "FT8" && context.specOp == SpecOp::FOX + && context.activeStationsAvailable + && (!context.activeStationsWantedOnly + || rawLine.contains(" " + context.myCall.toLocal8Bit() + " ") + || rawLine.contains(" <" + context.myCall.toLocal8Bit() + "> "))) { + appendAction(result.actions, ActionKind::AccumulateFoxActivity, QString {rawLine}); + } + + if (auto p = std::strpbrk(result.normalizedLine.constData(), "\n\r")) { + result.normalizedLine = result.normalizedLine.left(p - result.normalizedLine.constData()); + } + if (context.displayPoints) result.normalizedLine.replace("a7", " "); + + if (context.mode.startsWith("FST4")) { + auto const spreadText = result.normalizedLine.mid(64, 6).trimmed(); + if (!spreadText.isEmpty()) { + result.frequencySpread = spreadText.toFloat(&result.haveFrequencySpread); + result.normalizedLine = result.normalizedLine.left(64); + } + auto const ownCall = context.myCall.toLocal8Bit(); + if (context.mode == "FST4W" && context.noOwnCall + && (result.normalizedLine.contains(" " + ownCall + " ") + || result.normalizedLine.contains("<" + ownCall + ">"))) { + result.disposition = LineDisposition::Ignore; + result.reason = "FST4W own-call decode ignored"; + return result; + } + } + + // Classify batch completion before false-decode rejection so it can never + // be swallowed by a coincidental early-duplicate substring match. + if (result.normalizedLine.indexOf("") >= 0) { + result.disposition = LineDisposition::Finish; + // decoder.f90 emits nsynced, ndecoded, and navg0 after the marker; + // Q65 packs single/averaged counts as 1000*n0+n1. + result.batchHasDecodes = result.normalizedLine.mid(20, 4).toInt() > 0; + int const length = result.normalizedLine.trimmed().size(); + int const packedCounts = result.normalizedLine.trimmed().mid(length - 7).toInt(); + result.q65SingleDecodes = packedCounts / 1000; + result.q65AveragedDecodes = packedCounts % 1000; + return result; + } + + result.decodedOriginal = QString::fromUtf8(result.normalizedLine.constData()); + result.decodedForLogic = result.decodedOriginal; + result.decodedForLogic.remove("TU; "); + result.logicMessage = DecodedText {result.decodedForLogic}; + if (isFalseDecode(result.normalizedLine, result.logicMessage, result.decodedOriginal, + context, result.reason)) { + result.disposition = LineDisposition::Ignore; + return result; + } + + if (context.mode != "FT8" && context.mode != "FT4" && !context.mode.startsWith("FST4") + && context.mode != "Q65") { + // Expand legacy 22-character payloads to the 37-character display layout. + result.normalizedLine = result.normalizedLine.left(44) + " " + + result.normalizedLine.mid(44); + } + QString const actionLine = QString::fromUtf8(result.normalizedLine.constData()); + + parseAveragingInfo(result.normalizedLine, context.mode, result.averaged, result.averageCount); + appendAction(result.actions, ActionKind::IncrementDecodeCount); + appendAction(result.actions, ActionKind::WriteAll, actionLine.trimmed()); + if (context.mode == "FST4W") { + appendAction(result.actions, ActionKind::UploadWsprSpot, actionLine); + } + if (!result.averaged && !(context.mode == "FT8" && context.specOp == SpecOp::FOX) + && (context.mode == "FT4" || context.mode == "FT8") && context.displayPoints + && DecodedText {actionLine}.isStandardMessage()) { + appendAction(result.actions, ActionKind::UpdateArrlActivity); + } + return result; + } + + ExperimentalFilterDecision decideExperimentalFilter(DecodedText const& message, + ExperimentalFilterContext const& context) + { + ExperimentalFilterDecision decision; + decision.filtered = context.alreadyFiltered; + if (context.mode != "FT8" || context.multithreadFt8 || !context.reduceFalseDecodes + || message.snr() >= -20) return decision; + + QString deCall; + QString deGrid; + message.deCallAndGrid(deCall, deGrid); + QStringList const words = message.string().mid(24).replace("<", "").replace(">", "") + .replace("/P", "").replace("/R", "").replace("/QRP", "").replace("/5W", "") + .split(" ", SkipEmptyParts); + + bool notInAllCallsigns = deCall != "TNX" && deCall != "73" && deCall != "GL" + && deCall != "HNY" && deCall != "TU" && !deCall.left(4).contains("/") + && !message.string().contains("<...>") && !context.allCallsigns.contains(deCall); + if (!words.isEmpty() && !context.allCallsigns.contains(words[0]) + && !(message.string().contains(" CQ ") || message.string().contains("TNX") + || message.string().contains("...") || message.string().contains("HNY") + || message.string().contains("QSY") || message.string().contains("73 ") + || message.string().contains("GL ") || message.string().contains("PSE") + || message.string().contains("/") || message.string().contains("<...>"))) { + notInAllCallsigns = true; + } + if (!notInAllCallsigns) return decision; + + deCall = deCall.replace("<", "").replace(">", "").replace("/P", "").replace("/R", "") + .replace("/QRP", "").replace("/5W", ""); + auto const plausiblePrefix = [] (QString const& word) { + return word.left(3).contains(QRegularExpression {"\\w\\d\\w"}) + || word.left(3).contains(QRegularExpression {"\\d\\w\\d"}) + || word.left(3).contains(QRegularExpression {"\\w\\w\\d"}); + }; + if (deCall != "TNX" && deCall != "73" && deCall != "GL" && deCall != "HNY" + && !(plausiblePrefix(deCall) || deCall.left(4).contains("/") + || message.string().contains("<...>"))) { + decision.filtered = true; + decision.reason = "experimental FT8 callsign filter"; + } + if (!words.isEmpty() && words[0] != "CQ" && words[0] != "TNX" && words[0] != "73 " + && words[0] != "HNY" && words[0] != "QSY" && words[0] != "PSE" + && !(plausiblePrefix(words[0]) || message.string().contains("/") + || message.string().contains("<...>"))) { + decision.filtered = true; + decision.reason = "experimental FT8 payload filter"; + } + return decision; + } + + KeywordFilterDecision decideKeywordFilter(DecodedText const& message, + KeywordFilterContext const& context) + { + KeywordFilterDecision decision; + decision.filtered = context.alreadyFiltered; + QString const text = message.string().replace("<", "").replace(">", ""); + + QString selectedWord; + bool passMatch = false; + bool blacklistMatch = false; + bool whitelistMiss = false; + if (context.filterBySecondWord) { + int const payloadOffset = context.mode == "FT8" || context.mode == "FT4" + || context.mode == "Q65" || context.mode == "FST4" ? 24 : 22; + auto const words = text.mid(payloadOffset).split(" ", SkipEmptyParts); + if (words.size() < 2) { + selectedWord = "___"; + } else if (words[1].length() == 2 + && words[1].contains(QRegularExpression {"\\w\\w"})) { + selectedWord = words.size() > 2 ? words[2] : "___"; + } else if (text.contains(";")) { + selectedWord = words.size() > 3 ? words[3] : "___"; + } else { + selectedWord = words[1]; + } + passMatch = MessageFilter::startsWithAny(selectedWord, context.passKeywords); + blacklistMatch = MessageFilter::startsWithAny(selectedWord, context.blacklistKeywords); + whitelistMiss = !MessageFilter::startsWithAny(selectedWord, context.whitelistKeywords); + } else { + passMatch = MessageFilter::containsAny(text, context.passKeywords); + blacklistMatch = MessageFilter::containsAny(text, context.blacklistKeywords); + whitelistMiss = !MessageFilter::containsAny(text, context.whitelistKeywords); + } + decision.selectedWord = selectedWord; + + decision.alwaysPassed = context.specOp == SpecOp::NONE && context.alwaysPass && passMatch; + if (decision.alwaysPassed) return decision; + + bool rejectedByList = false; + if ((context.specOp == SpecOp::NONE || context.specOp == SpecOp::HOUND) + && context.blacklistEnabled && blacklistMatch) { + rejectedByList = true; + decision.reason = "blacklist matched"; + } else if ((context.specOp == SpecOp::NONE || context.specOp == SpecOp::HOUND) + && context.whitelistEnabled && whitelistMiss) { + rejectedByList = true; + decision.reason = "whitelist did not match"; + } + if (rejectedByList) { + if (!context.bypass) decision.filtered = true; + if (!context.waitAndPounceOnly && !context.bypass) { + decision.continueProcessing = false; + return decision; + } + if (shouldResetScores(context)) decision.resetPounceScores = true; + } + return decision; + } + + VisibilityFilterDecision decideVisibilityFilter(DecodedText const& message, + VisibilityFilterContext const& context) + { + VisibilityFilterDecision decision; + decision.filtered = context.alreadyFiltered; + + QString deCall; + QString deGrid; + message.deCallAndGrid(deCall, deGrid); + + if (!context.alwaysPassed && hiddenByGeographyOrWorkedBefore(context, deCall, deGrid)) { + decision.filtered = true; + decision.reason = "geography or worked-before filter"; + } + if (!context.bypass && context.hideIgnored && context.ignoreList.contains(deCall + ",")) { + decision.filtered = true; + if (decision.reason.isEmpty()) decision.reason = "ignore-list filter"; + } + if (!context.bypass && context.hideWorkedToday) { + QRegularExpression const today {context.today + ",[0-9][0-9]:[0-9][0-9]:[0-9][0-9]," + deCall + ","}; + QRegularExpression const yesterday {context.yesterday + ",[0-9][0-9]:[0-9][0-9]:[0-9][0-9]," + deCall + ","}; + if (context.txLog.contains(today) + || (context.includeYesterday && context.txLog.contains(yesterday))) { + decision.filtered = true; + if (decision.reason.isEmpty()) decision.reason = "recently-worked filter"; + } + } + return decision; + } + + bool shouldDisplayLeft(bool averaged, QString const& mode, SpecOp specOp, bool filtered, + bool filtersForWaitAndPounceOnly) + { + return !averaged && !(mode == "FT8" && specOp == SpecOp::FOX) + && (!filtered || filtersForWaitAndPounceOnly); + } + + RoutingDecision decideRouting(DecodedText const& originalMessage, DecodedText const& displayMessage, + bool averaged, RoutingContext const& context) + { + RoutingDecision decision; + bool displayRight = averaged; + int const audioFrequency = displayMessage.frequencyOffset(); + if (context.mode == "FT8" || context.mode == "FT4" || context.mode == "FST4" + || context.mode == "Q65") { + int const tolerance = context.mode == "Q65" ? context.q65Tolerance : 10; + auto const parts = QString {displayMessage.string()}.remove("<").remove(">") + .split(" ", SkipEmptyParts); + if (parts.size() > 6) { + decision.forUs = parts[5].contains(context.baseCall) + || (parts[5] == "DE" && qAbs(context.rxFrequency - audioFrequency) <= tolerance); + if (context.baseCall == context.myCall) { + if (context.baseCall != parts[5]) decision.forUs = false; + } else if (context.myCall != parts[5]) { + // A shared base call does not make another prefix/suffix ours, as can + // happen with multi-station special events. + decision.forUs = false; + } + // Compound Hounds address the Fox using DE plus their full callsign. + if (context.specOp == SpecOp::FOX && displayMessage.string().contains(" DE ")) { + decision.forUs = true; + } + if (context.specOp == SpecOp::FOX && decision.forUs + && displayMessage.string().contains(fox_report_regexp)) { + displayRight = true; + } + if (context.specOp != SpecOp::FOX + && (decision.forUs || qAbs(audioFrequency - context.wideGraphRxFrequency) <= 10)) { + displayRight = true; + } + if (context.specOp == SpecOp::HOUND && !decision.forUs) displayRight = false; + decision.competingFoxReport = context.specOp == SpecOp::FOX && audioFrequency < 1000 + && !decision.forUs && displayMessage.string().contains(fox_report_regexp); + } + } else if (qAbs(audioFrequency - context.wideGraphRxFrequency) <= 10 + && !context.enableVhfFeatures) { + displayRight = true; + } + if (context.mode == "Q65" && !averaged + && !displayMessage.string().contains(context.baseCall)) displayRight = false; + if ((context.mode == "JT4" || context.mode == "Q65" || context.mode == "JT65") + && displayMessage.string().contains(context.baseCall) && context.includeAveragingVisible + && !context.includeAveraging) displayRight = true; + QString unwrappedOriginal = originalMessage.string(); + unwrappedOriginal.replace("<", "").replace(">", ""); + // Keep messages involving our base call and current QSO partner in the Rx + // Frequency pane even when they are outside the passband. + if ((context.mode == "FT8" || context.mode == "FT4") && context.specOp != SpecOp::FOX + && !context.baseCall.isEmpty() && !context.hisCall.isEmpty() + && unwrappedOriginal.contains(context.baseCall + " " + context.hisCall)) { + displayRight = true; + } + + decision.displayRight = displayRight && !context.blockRightDisplay; + return decision; + } + + bool shouldPostPsk(QString const& mode, SpecOp specOp, bool superFox, + bool standardMessage, bool bandPostingAllowed) + { + bool const modeAllowed = mode != "FT8" || specOp != SpecOp::HOUND || superFox; + return modeAllowed && bandPostingAllowed && (mode == "FST4W" || standardMessage); + } + + QVector finishBatchActions(QString const& mode, SpecOp specOp, + bool activeStationsAvailable, QString const& accumulatedDecodes) + { + QVector actions; + if (mode == "FT8" && specOp == SpecOp::FOX && activeStationsAvailable) { + appendAction(actions, ActionKind::FlushFoxActivity, accumulatedDecodes); + } + return actions; + } +} diff --git a/DecodeOutputPlan.hpp b/DecodeOutputPlan.hpp new file mode 100644 index 00000000..153bb4e7 --- /dev/null +++ b/DecodeOutputPlan.hpp @@ -0,0 +1,205 @@ +#ifndef DECODEOUTPUTPLAN_HPP +#define DECODEOUTPUTPLAN_HPP + +#include "Decoder/decodedtext.h" +#include "AutoRespondPolicy.hpp" +#include "SpecialOperatingActivity.hpp" + +#include +#include +#include +#include + +#include + +namespace DecodeOutputPlan +{ + enum class ActionKind + { + ShowQsyMessage, + AccumulateFoxActivity, + IncrementDecodeCount, + WriteAll, + UploadWsprSpot, + UpdateArrlActivity, + FlushFoxActivity + }; + + struct Action + { + ActionKind kind; + QString text; + }; + + struct PreparationContext + { + QString mode; + SpecialOperatingActivity specOp {SpecialOperatingActivity::NONE}; + QString myCall; + bool qsyEnabled {false}; + bool activeStationsAvailable {false}; + bool activeStationsWantedOnly {false}; + bool displayPoints {false}; + bool noOwnCall {false}; + bool diskData {false}; + bool noA7Decodes {false}; + bool multithreadFt8 {false}; + int ft8DecoderStart {0}; + quint64 nominalFrequency {0}; + bool reduceFalseDecodes {false}; + QString earlyDecodes; + }; + + enum class LineDisposition + { + Decode, + Finish, + Ignore + }; + + struct PreparedLine + { + LineDisposition disposition {LineDisposition::Decode}; + QByteArray rawLine; + QByteArray normalizedLine; + QString decodedOriginal; + QString decodedForLogic; + DecodedText logicMessage {QString {}}; + bool averaged {false}; + int averageCount {0}; + bool haveFrequencySpread {false}; + float frequencySpread {0.0f}; + // Finish-disposition fields parsed from . + bool batchHasDecodes {false}; + int q65SingleDecodes {0}; + int q65AveragedDecodes {0}; + QString reason; + QVector actions; + }; + + struct KeywordFilterContext + { + QString mode; + SpecialOperatingActivity specOp {SpecialOperatingActivity::NONE}; + bool alreadyFiltered {false}; + bool filterBySecondWord {false}; + bool alwaysPass {false}; + QStringList passKeywords; + bool blacklistEnabled {false}; + QStringList blacklistKeywords; + bool whitelistEnabled {false}; + QStringList whitelistKeywords; + bool waitAndPounceOnly {false}; + bool bypass {false}; + bool pounce {false}; + AutoRespondPolicy respondPolicy {AutoRespondPolicy::None}; + }; + + struct KeywordFilterDecision + { + bool filtered {false}; + bool continueProcessing {true}; + bool alwaysPassed {false}; + bool resetPounceScores {false}; + QString selectedWord; + QString reason; + }; + + struct VisibilityFilterContext + { + bool alreadyFiltered {false}; + bool alwaysPassed {false}; + bool bypass {false}; + bool hideTerritory1 {false}; + bool hideTerritory2 {false}; + bool hideTerritory3 {false}; + bool hideTerritory4 {false}; + QString territory1; + QString territory2; + QString territory3; + QString territory4; + bool hideWorkedBefore {false}; + bool hideEurope {false}; + bool hideAsia {false}; + bool hideNorthAmerica {false}; + bool hideSouthAmerica {false}; + bool hideAfrica {false}; + bool hideOceania {false}; + bool hideAntarctica {false}; + bool hideIgnored {false}; + QString ignoreList; + bool hideWorkedToday {false}; + bool includeYesterday {false}; + QString txLog; + QString today; + QString yesterday; + // Lazy resolvers so expensive logbook lookups run only when a matching + // hide filter is enabled and the message was not always-passed. + std::function countryName; + std::function continent; + std::function workedBeforeOnBand; + }; + + struct VisibilityFilterDecision + { + bool filtered {false}; + QString reason; + }; + + struct ExperimentalFilterContext + { + QString mode; + bool multithreadFt8 {false}; + bool reduceFalseDecodes {false}; + // Contents of the shipped ALLCALL7.TXT callsign database. + QString allCallsigns; + bool alreadyFiltered {false}; + }; + + struct ExperimentalFilterDecision + { + bool filtered {false}; + QString reason; + }; + + struct RoutingContext + { + QString mode; + SpecialOperatingActivity specOp {SpecialOperatingActivity::NONE}; + QString myCall; + QString baseCall; + QString hisCall; + int rxFrequency {0}; + int wideGraphRxFrequency {0}; + int q65Tolerance {10}; + bool enableVhfFeatures {false}; + bool includeAveragingVisible {false}; + bool includeAveraging {false}; + bool blockRightDisplay {false}; + }; + + struct RoutingDecision + { + bool forUs {false}; + bool displayRight {false}; + bool competingFoxReport {false}; + }; + + PreparedLine prepareLine(QByteArray const& rawLine, PreparationContext const& context); + ExperimentalFilterDecision decideExperimentalFilter(DecodedText const& message, + ExperimentalFilterContext const& context); + KeywordFilterDecision decideKeywordFilter(DecodedText const& message, + KeywordFilterContext const& context); + VisibilityFilterDecision decideVisibilityFilter(DecodedText const& message, + VisibilityFilterContext const& context); + bool shouldDisplayLeft(bool averaged, QString const& mode, SpecialOperatingActivity specOp, + bool filtered, bool filtersForWaitAndPounceOnly); + RoutingDecision decideRouting(DecodedText const& originalMessage, DecodedText const& displayMessage, + bool averaged, RoutingContext const& context); + bool shouldPostPsk(QString const& mode, SpecialOperatingActivity specOp, bool superFox, + bool standardMessage, bool bandPostingAllowed); + QVector finishBatchActions(QString const& mode, SpecialOperatingActivity specOp, + bool activeStationsAvailable, QString const& accumulatedDecodes); +} + +#endif // DECODEOUTPUTPLAN_HPP diff --git a/DecodedMessageReaction.cpp b/DecodedMessageReaction.cpp new file mode 100644 index 00000000..276b89ea --- /dev/null +++ b/DecodedMessageReaction.cpp @@ -0,0 +1,875 @@ +#include "DecodedMessageReaction.hpp" + +#include "Decoder/decodedtext.h" +#include "WaitFeaturePolicy.hpp" +#include "qt_helpers.hpp" + +#include +#include + +namespace +{ + using DecodedMessageReaction::ContestHint; + using DecodedMessageReaction::QsoReactionEffect; + using DecodedMessageReaction::QsoReactionPlan; + using DecodedMessageReaction::QsoReactionSnapshot; + using DecodedMessageReaction::ReactionDisposition; + using SpecOp = SpecialOperatingActivity; + + constexpr int euVhfType5ReportMin {52}; + constexpr int euVhfType5ReportMax {59}; + constexpr int euVhfType5SerialMin {1}; + constexpr int euVhfType5SerialMax {2047}; + + QRegularExpression const& gridExpression() + { + static QRegularExpression const expression {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"}; + return expression; + } + + bool isSupportedModeMarker(QString const& appMode, QString const& decodeMarker) + { + if ("JT65" == appMode) return "#" == decodeMarker; + if ("JT9" == appMode) return "@" == decodeMarker; + if ("MSK144" == appMode) return "&" == decodeMarker || "^" == decodeMarker; + if ("Q65" == appMode) return ":" == decodeMarker.left(1); + return true; + } + + bool canContinueAfterTxFrequencyPick(QString const& mode) + { + return "JT4" == mode || "JT65" == mode || mode.startsWith("JT9") + || "Q65" == mode || "FT8" == mode || "FT4" == mode || "FST4" == mode; + } + + bool isEuVhfType5Exchange(int exchange) + { + auto const report = exchange / 10000; + auto const serial = exchange % 10000; + return report >= euVhfType5ReportMin + && report <= euVhfType5ReportMax + && serial >= euVhfType5SerialMin + && serial <= euVhfType5SerialMax; + } + + void appendEffect(QsoReactionPlan& plan, QsoReactionEffect::Kind kind) + { + QsoReactionEffect effect; + effect.kind = kind; + plan.effects.append(effect); + } + + void appendIntEffect(QsoReactionPlan& plan, QsoReactionEffect::Kind kind, int value) + { + QsoReactionEffect effect; + effect.kind = kind; + effect.intValue = value; + plan.effects.append(effect); + } + + void appendBoolEffect(QsoReactionPlan& plan, QsoReactionEffect::Kind kind, bool value) + { + QsoReactionEffect effect; + effect.kind = kind; + effect.boolValue = value; + plan.effects.append(effect); + } + + void appendTextEffect(QsoReactionPlan& plan, QsoReactionEffect::Kind kind, QString const& text) + { + QsoReactionEffect effect; + effect.kind = kind; + effect.text = text; + plan.effects.append(effect); + } + + void appendProgressEffect(QsoReactionPlan& plan, QsoProgress progress) + { + QsoReactionEffect effect; + effect.kind = QsoReactionEffect::Kind::SetQsoProgress; + effect.progress = progress; + plan.effects.append(effect); + } + + void appendContestHint(QsoReactionPlan& plan, ContestHint hint) + { + QsoReactionEffect effect; + effect.kind = QsoReactionEffect::Kind::QueueContestHint; + effect.contestHint = hint; + plan.effects.append(effect); + } + + void setProgress(QsoReactionPlan& plan, QsoProgress& progress, QsoProgress value) + { + appendProgressEffect(plan, value); + progress = value; + } + + void setTxMessageAndProgress(QsoReactionPlan& plan, QsoProgress& progress, + int message, QsoProgress value) + { + appendIntEffect(plan, QsoReactionEffect::Kind::SetTxMessage, message); + setProgress(plan, progress, value); + } + + void selectMessageWithProgressBetween(QsoReactionPlan& plan, QsoProgress& progress, + int message, QsoProgress value) + { + appendIntEffect(plan, QsoReactionEffect::Kind::SetTxMessageIndex, message); + setProgress(plan, progress, value); + appendIntEffect(plan, QsoReactionEffect::Kind::CheckTxMessage, message); + } + + void selectMessage(QsoReactionPlan& plan, int message) + { + appendIntEffect(plan, QsoReactionEffect::Kind::SetTxMessageIndex, message); + appendIntEffect(plan, QsoReactionEffect::Kind::CheckTxMessage, message); + } + + bool messageContainsCall(QStringList const& messageWords, QString const& call) + { + if (call.isEmpty()) return false; + return messageWords.contains(call) || messageWords.contains(Radio::base_callsign(call)); + } + + bool isSignoffForCurrentQso(DecodedText const& message, QsoReactionSnapshot const& snapshot) + { + QStringList const messageWords = message.messageWords(); + if (!messageWords.filter(QRegularExpression {"^(73|RR73)$"}).size()) return false; + + return messageContainsCall(messageWords, snapshot.baseCall) + && (messageContainsCall(messageWords, snapshot.dxCall) + || messageContainsCall(messageWords, snapshot.hisCall)); + } + + bool isAcceptableFreeText73(DecodedText const& message, QStringList const& messageWords, + QsoReactionSnapshot const& snapshot) + { + bool const is73 = messageWords.filter(QRegularExpression {"^(73|RR73)$"}).size(); + if (!is73 || snapshot.qsoProgress < QsoProgress::RogerReport) return false; + if (!message.isStandardMessage()) return snapshot.mode != "MSK144"; + + return messageWords.contains(snapshot.baseCall) + || messageWords.contains(snapshot.myCall) + || messageContainsCall(messageWords, snapshot.dxCall) + || messageWords.contains("DE"); + } + + struct EntryAnalysis + { + bool continueProcessing {false}; + QString reason; + QStringList messageWords; + QStringList payloadWords; + QString firstCall; + QString hisCall; + QString hisGrid; + QString qsoPartnerBaseCall; + QString hisBaseCall; + bool is73 {false}; + }; + + EntryAnalysis analyzeEntry(DecodedText const& message, QsoReactionSnapshot const& snapshot, + QsoReactionPlan& plan) + { + EntryAnalysis analysis; + if (snapshot.selectionOrigin == DecodedMessageReaction::SelectionOrigin::Udp + && snapshot.transmittingSignoff && isSignoffForCurrentQso(message, snapshot)) { + analysis.reason = "udp reply ignored while transmitting 73"; + return analysis; + } + + QStringList const parts = message.clean_string().split(' ', SkipEmptyParts); + if (parts.size() < 5) { + analysis.reason = "decode has too few fields"; + return analysis; + } + + if (!isSupportedModeMarker(snapshot.mode, parts.at(4).left(1))) { + analysis.reason = "decode mode marker does not match current mode"; + return analysis; + } + + int const frequency = message.frequencyOffset(); + if (message.isTX()) { + if (!snapshot.enableVhfFeatures) { + if (!snapshot.modifiers.shift) { + appendIntEffect(plan, QsoReactionEffect::Kind::SetRxFrequency, frequency); + } + if ((snapshot.modifiers.ctrl || snapshot.modifiers.shift) && !snapshot.holdTxFrequency) { + appendIntEffect(plan, QsoReactionEffect::Kind::SetTxFrequency, frequency); + } + } + analysis.reason = "transmitted decode only adjusts frequencies"; + return analysis; + } + + if (parts.size() >= 7 && snapshot.fastMode && parts[5] == "CQ" && snapshot.transceiverOnline) { + bool ok = false; + auto const kHz = parts[6].toUInt(&ok); + if (ok && kHz >= 10 && parts[6].size() == 3) { + if (snapshot.nominalQsyAllowed) { + auto const dialFrequency = snapshot.nominalFrequency / 1000000 * 1000000 + 1000 * kHz; + QsoReactionEffect effect; + effect.kind = QsoReactionEffect::Kind::ApplyFastCqQsy; + effect.frequency = dialFrequency; + effect.text = QString {"QSY %1"}.arg(snapshot.nominalFrequency / 1e6, 7, 'f', 3); + effect.boolValue = snapshot.mode == "MSK144"; + effect.userInitiated = snapshot.selectionOrigin != DecodedMessageReaction::SelectionOrigin::None; + plan.effects.append(effect); + } else if (snapshot.selectionOrigin != DecodedMessageReaction::SelectionOrigin::None) { + appendEffect(plan, QsoReactionEffect::Kind::RejectNominalQsy); + analysis.reason = "fast CQ requires a blocked nominal QSY"; + return analysis; + } + } + } + + int const nmod = fmod(double(message.timeInSeconds()), 2.0 * snapshot.trPeriod); + bool txFirst = nmod != 0; + if (snapshot.specOp == SpecOp::HOUND) txFirst = false; + if (snapshot.specOp == SpecOp::FOX) txFirst = true; + appendBoolEffect(plan, QsoReactionEffect::Kind::SetTxFirst, txFirst); + + analysis.messageWords = message.messageWords(); + if (analysis.messageWords.size() < 3) { + analysis.reason = "message has too few message words"; + return analysis; + } + + message.deCallAndGrid(analysis.hisCall, analysis.hisGrid); + if (snapshot.doubleClicked && analysis.hisCall == snapshot.baseCall) { + analysis.reason = "double-click would start QSO with own base call"; + return analysis; + } + + QString const cleanMessage = message.clean_string().remove("<").remove(">"); + if (snapshot.doubleClicked + && cleanMessage.contains(" " + snapshot.baseCall + " ") + && cleanMessage.contains(" " + analysis.hisCall + " ") + && message.clean_string().mid(22).contains(" 73")) { + analysis.reason = "double-click on final 73 from current QSO"; + return analysis; + } + + analysis.payloadWords = message.clean_string().mid(22).remove("<").remove(">").split(" ", SkipEmptyParts); + if (analysis.payloadWords.size() >= 4) { + if (analysis.messageWords.size() < 4) { + analysis.reason = "payload has contest shape but message words are incomplete"; + return analysis; + } + int const serial = analysis.payloadWords.at(analysis.payloadWords.size() - 2).toInt(); + if (isEuVhfType5Exchange(serial)) { + analysis.hisCall = analysis.payloadWords.at(1); + analysis.hisGrid = analysis.payloadWords.at(analysis.payloadWords.size() - 1); + } + } + + analysis.is73 = analysis.messageWords.filter(QRegularExpression {"^(73|RR73)$"}).size(); + if (!analysis.is73 && !message.isStandardMessage() && !message.clean_string().contains("<")) { + analysis.reason = "non-standard free text is not processable"; + return analysis; + } + + if ((message.isJT9() && snapshot.mode != "JT9" && snapshot.mode != "JT4") + || (message.isJT65() && snapshot.mode != "JT65" && snapshot.mode != "JT4")) { + analysis.reason = "JT9/JT65 decode not allowed in current mode"; + return analysis; + } + + if (snapshot.specOp == SpecOp::HOUND + && message.messageWords().indexOf(QRegularExpression {R"(R[-+][0-9]+)"}) >= 1) { + analysis.reason = "hound ignores other hounds"; + return analysis; + } + + analysis.firstCall = message.call(); + if (analysis.firstCall.length() >= 4 && analysis.firstCall.mid(0, 3) == "CQ ") { + analysis.firstCall = "CQ"; + } + if (!snapshot.fastMode + && (!snapshot.enableVhfFeatures || snapshot.mode == "FT8" + || snapshot.mode == "FT4" || snapshot.mode == "FST4")) { + bool const callOrCq = (Radio::is_callsign(analysis.firstCall) + && analysis.firstCall != snapshot.myCall + && analysis.firstCall != snapshot.baseCall + && analysis.firstCall != "DE") + || analysis.firstCall == "CQ" || analysis.firstCall == "QRZ" + || snapshot.modifiers.ctrl || snapshot.modifiers.shift; + if (callOrCq) { + if (((snapshot.specOp != SpecOp::HOUND) || snapshot.mode != "FT8") + && (!snapshot.holdTxFrequency || snapshot.modifiers.shift || snapshot.modifiers.ctrl)) { + appendIntEffect(plan, QsoReactionEffect::Kind::SetTxFrequency, frequency); + } + if (!canContinueAfterTxFrequencyPick(snapshot.mode)) { + analysis.reason = "frequency-pick-only mode"; + return analysis; + } + } + } + + analysis.qsoPartnerBaseCall = Radio::base_callsign(snapshot.dxCall); + analysis.hisBaseCall = Radio::base_callsign(analysis.hisCall); + analysis.continueProcessing = true; + return analysis; + } + + void appendReactedTail(DecodedText const& message, QsoReactionSnapshot const& snapshot, + EntryAnalysis const& analysis, QsoProgress progress, + QsoReactionPlan& plan) + { + if (snapshot.autoReply) { + appendBoolEffect(plan, QsoReactionEffect::Kind::SetCallingCq, progress == QsoProgress::Calling); + } + appendIntEffect(plan, QsoReactionEffect::Kind::SetMaxPoints, -1); + if (snapshot.rxFrequencyEnabled && snapshot.mode != "MSK144" && !snapshot.modifiers.shift) { + appendIntEffect(plan, QsoReactionEffect::Kind::SetRxFrequency, message.frequencyOffset()); + } + + QString const cleanMessage = message.clean_string().trimmed(); + if (snapshot.selectionOrigin != DecodedMessageReaction::SelectionOrigin::ManualRightPane) { + appendEffect(plan, QsoReactionEffect::Kind::RefreshQsoPaneIfChanged); + } + + if (Radio::is_callsign(analysis.hisCall) + && (analysis.hisBaseCall != analysis.qsoPartnerBaseCall + || analysis.hisBaseCall != analysis.hisCall)) { + if (analysis.qsoPartnerBaseCall != analysis.hisBaseCall) { + appendEffect(plan, QsoReactionEffect::Kind::ClearDxGrid); + } + bool const suppressCallChange = cleanMessage.contains(" " + snapshot.myCall + " ") + && cleanMessage.mid(22).contains(" 73") + && snapshot.respondPolicy == AutoRespondPolicy::MaxSignal; + if (!suppressCallChange) { + appendTextEffect(plan, QsoReactionEffect::Kind::SetDxCall, analysis.hisCall); + } + } + if (analysis.hisGrid.contains(gridExpression())) { + appendTextEffect(plan, QsoReactionEffect::Kind::SetDxGrid, analysis.hisGrid); + } + appendEffect(plan, QsoReactionEffect::Kind::Lookup); + appendEffect(plan, QsoReactionEffect::Kind::CaptureHisGrid); + + if (snapshot.doubleClicked) { + appendEffect(plan, QsoReactionEffect::Kind::ExtractReceivedReport); + } + + if (!snapshot.sentReport || analysis.hisBaseCall != analysis.qsoPartnerBaseCall + || snapshot.mode == "FT8" || snapshot.mode == "FT4" || snapshot.mode == "FST4") { + int report = message.report().toInt(); + if (snapshot.mode == "MSK144" && snapshot.shortMessages) { + if (report <= -2) report = -3; + if (report >= -1 && report <= 1) report = 0; + if (report >= 2 && report <= 4) report = 3; + if (report >= 5 && report <= 7) report = 6; + if (report >= 8 && report <= 11) report = 10; + if (report >= 12 && report <= 14) report = 13; + if (report >= 15) report = 16; + } + appendIntEffect(plan, QsoReactionEffect::Kind::SetReport, report); + } + + appendBoolEffect(plan, QsoReactionEffect::Kind::SetTuMessage, false); + if (!snapshot.tx73Count) { + appendEffect(plan, QsoReactionEffect::Kind::GenerateStandardMessages); + } + if (snapshot.transmitting) { + appendBoolEffect(plan, QsoReactionEffect::Kind::SetRestart, true); + } + if (snapshot.autoSequenceEnabled && !snapshot.doubleClicked && snapshot.mode != "FT4") return; + if (snapshot.quickCall && snapshot.doubleClicked) { + appendBoolEffect(plan, QsoReactionEffect::Kind::SetAutoEnabled, true); + } + appendBoolEffect(plan, QsoReactionEffect::Kind::SetDoubleClicked, false); + } +} + +namespace DecodedMessageReaction +{ + bool shouldDeferAutoTxStopAfterRrr(QString const& mode, bool repeatTx, bool sendRr73) + { + return !sendRr73 && (mode == "MSK144" || (mode == "Q65" && repeatTx)); + } + + void applyAutoTxStopAfterLogging(QString const& mode, bool repeatTx, bool sendRr73, + std::function stopAutoTx) + { + if (!shouldDeferAutoTxStopAfterRrr(mode, repeatTx, sendRr73)) { + stopAutoTx(); + } + } + + QsoReactionPlan planProcessMessage(DecodedText const& message, QsoReactionSnapshot const& snapshot) + { + QsoReactionPlan plan; + EntryAnalysis const analysis = analyzeEntry(message, snapshot, plan); + if (!analysis.continueProcessing) { + plan.reason = analysis.reason; + return plan; + } + + auto progress = snapshot.qsoProgress; + bool reacted = false; + QString dtext = " " + message.clean_string() + " "; + dtext = dtext.remove("<").remove(">"); + bool const addressed = dtext.contains(" " + snapshot.baseCall + " ") + || dtext.contains("<" + snapshot.baseCall + "> ") + || dtext.contains("/" + snapshot.baseCall + " ") + || dtext.contains(" " + snapshot.baseCall + "/") + || analysis.firstCall == "DE"; + + if (addressed) { + QString word2; + int const payloadSize = analysis.payloadWords.size(); + if (payloadSize >= 3) word2 = analysis.payloadWords.at(2); + int reportOrSerial = word2.toInt(); + QString finalPayloadWord; + if (payloadSize >= 4) { + reportOrSerial = analysis.payloadWords.at(payloadSize - 2).toInt(); + finalPayloadWord = analysis.payloadWords.at(payloadSize - 1); + } + bool const rttyReport = reportOrSerial >= 529 && reportOrSerial <= 599; + bool const euVhfExchange = isEuVhfType5Exchange(reportOrSerial); + bool hintShown = snapshot.contestHintShown; + if (!hintShown && euVhfExchange && snapshot.specOp != SpecOp::EU_VHF) { + appendContestHint(plan, ContestHint::EuVhf); + hintShown = true; + } + + QStringList fullWords = message.clean_string().split(' ', SkipEmptyParts); + int const fullWordCount = fullWords.size(); + if (fullWordCount < 2) { + plan.reason = "decode has too few full-line fields"; + return plan; + } + QString fieldDayLead = fullWords.at(fullWordCount - 2); + QString const fieldDayClass = fieldDayLead.right(1); + bool fieldDayMessage = fieldDayClass >= "A" && fieldDayClass <= "F" + && fieldDayLead.size() <= 3 && fullWordCount >= 9; + int const fieldDayNumber = fieldDayLead.remove(fieldDayClass).toInt(); + if (fieldDayNumber < 1) fieldDayMessage = false; + if (fieldDayMessage) { + appendTextEffect(plan, QsoReactionEffect::Kind::SetReceivedExchange, + fullWords.at(fullWordCount - 2) + " " + fullWords.at(fullWordCount - 1)); + fieldDayLead = fullWords.at(fullWordCount - 3); + } + if (!hintShown) { + if (fieldDayMessage && snapshot.specOp != SpecOp::FIELD_DAY) { + appendContestHint(plan, ContestHint::FieldDay); + hintShown = true; + } else if (rttyReport && snapshot.specOp != SpecOp::RTTY) { + appendContestHint(plan, ContestHint::Rtty); + hintShown = true; + } + } + + if ((snapshot.specOp == SpecOp::EU_VHF || snapshot.specOp == SpecOp::RTTY + || snapshot.specOp == SpecOp::FIELD_DAY) + && message.string().contains("<...>")) { + plan.reason = "contest message contains unresolved call"; + return plan; + } + if (snapshot.specOp == SpecOp::EU_VHF && analysis.messageWords.size() > 3 + && analysis.messageWords.at(2).contains(snapshot.baseCall) + && !analysis.messageWords.at(3).contains(analysis.qsoPartnerBaseCall) + && !snapshot.doubleClicked) { + plan.reason = "EU VHF message is from a different QSO partner"; + return plan; + } + + bool const contestCapable = snapshot.mode == "FT4" || snapshot.mode == "FT8" + || snapshot.mode == "Q65" || snapshot.mode == "MSK144"; + if (analysis.messageWords.size() > 4 + && (analysis.messageWords.at(2).contains(snapshot.baseCall) + || analysis.messageWords.at(2) == "DE") + && (analysis.messageWords.at(3).contains(analysis.qsoPartnerBaseCall) + || snapshot.doubleClicked || euVhfExchange || progress == QsoProgress::Calling)) { + reacted = true; + if (analysis.messageWords.at(4).contains(gridExpression()) && snapshot.specOp != SpecOp::EU_VHF) { + if ((snapshot.specOp == SpecOp::NA_VHF || snapshot.specOp == SpecOp::WW_DIGI + || snapshot.specOp == SpecOp::ARRL_DIGI || snapshot.specOp == SpecOp::Q65_PILEUP) + && contestCapable) { + setTxMessageAndProgress(plan, progress, 3, QsoProgress::RogerReport); + if (snapshot.specOp == SpecOp::NA_VHF && snapshot.mode == "FT4" && snapshot.ncccSprint) { + if (snapshot.autoEnabled && snapshot.loggingEnabled) { + appendEffect(plan, QsoReactionEffect::Kind::RequestLogQso); + } + appendIntEffect(plan, QsoReactionEffect::Kind::ScheduleNcccAutoReset, + int(850.0 * snapshot.trPeriod)); + if (snapshot.loggingEnabled) { + appendBoolEffect(plan, QsoReactionEffect::Kind::SetNoLogging, true); + appendIntEffect(plan, QsoReactionEffect::Kind::ScheduleNoLoggingReset, 20000); + } + } + } else if (snapshot.mode == "JT65" && analysis.messageWords.size() > 5 + && analysis.messageWords.at(5) == "OOO") { + setTxMessageAndProgress(plan, progress, 3, QsoProgress::RogerReport); + } else { + setTxMessageAndProgress(plan, progress, 2, QsoProgress::Report); + } + reacted = true; + } else if (finalPayloadWord.contains(gridExpression()) && snapshot.specOp == SpecOp::EU_VHF) { + if (!reportOrSerial) { + setTxMessageAndProgress(plan, progress, 2, QsoProgress::Report); + } else if (word2 == "R") { + setTxMessageAndProgress(plan, progress, 4, QsoProgress::Rogers); + } else { + setTxMessageAndProgress(plan, progress, 3, QsoProgress::RogerReport); + } + reacted = true; + } else if (snapshot.specOp == SpecOp::RTTY && rttyReport) { + if (word2 == "R") { + setTxMessageAndProgress(plan, progress, 4, QsoProgress::Rogers); + } else { + setTxMessageAndProgress(plan, progress, 3, QsoProgress::RogerReport); + } + appendTextEffect(plan, QsoReactionEffect::Kind::SetReceivedExchange, + fullWords[fullWordCount - 2] + " " + fullWords[fullWordCount - 1]); + reacted = true; + } else if (snapshot.specOp == SpecOp::FIELD_DAY && fieldDayMessage) { + if (fieldDayLead == "R") { + setTxMessageAndProgress(plan, progress, 4, QsoProgress::Rogers); + } else { + setTxMessageAndProgress(plan, progress, 3, QsoProgress::RogerReport); + } + reacted = true; + } else { + QString const word3 = analysis.messageWords.at(4); + int const word3Number = word3.toInt(); + bool const signoffLike = word3 == "RRR" + || (word3Number == 73 && progress == QsoProgress::Rogers) + || word3 == "RR73" || (word3 == "R" && progress != QsoProgress::Report); + if (signoffLike) { + if (snapshot.mode == "FT4" && word3 == "RR73") { + appendEffect(plan, QsoReactionEffect::Kind::RecordRr73Received); + } + appendBoolEffect(plan, QsoReactionEffect::Kind::SetTuMessage, false); + appendTextEffect(plan, QsoReactionEffect::Kind::SetNextCall, QString {}); + static QRegularExpression const leadingRReport {"^R(?!R73|RR)"}; + static QRegularExpression const rogerAck {"^RR(?:R|73)$"}; + if (word3.contains(leadingRReport) && progress != QsoProgress::RogerReport) { + selectMessage(plan, 4); + } else if ((progress > QsoProgress::Calling && progress < QsoProgress::Rogers) + || word3.contains(rogerAck)) { + selectMessage(plan, 5); + } else if (progress == QsoProgress::Rogers) { + if (snapshot.loggingEnabled) { + if (!(snapshot.mode == "FT4" && snapshot.specOp == SpecOp::NA_VHF + && snapshot.ncccSprint)) { + appendEffect(plan, QsoReactionEffect::Kind::RequestLogQso); + } + } else { + appendEffect(plan, QsoReactionEffect::Kind::CeaseAutoTx); + } + if (shouldDeferAutoTxStopAfterRrr(snapshot.mode, snapshot.repeatTx, snapshot.sendRr73)) { + appendIntEffect(plan, QsoReactionEffect::Kind::ClickTxMessage, 5); + appendIntEffect(plan, QsoReactionEffect::Kind::ScheduleAutoFlagOff, + int(1000.0 * snapshot.trPeriod)); + } else { + selectMessage(plan, 6); + } + } else if (snapshot.tx1Enabled) { + selectMessageWithProgressBetween(plan, progress, 1, QsoProgress::Replying); + } else { + selectMessageWithProgressBetween(plan, progress, 2, QsoProgress::Report); + } + if (progress >= QsoProgress::RogerReport) { + setProgress(plan, progress, QsoProgress::Signoff); + } + reacted = true; + } else if ((progress >= QsoProgress::Report + || (progress >= QsoProgress::Replying + && (snapshot.mode == "MSK144" || snapshot.mode == "FT8" + || snapshot.mode == "FT4" || snapshot.mode == "Q65"))) + && word3.startsWith('R')) { + appendIntEffect(plan, QsoReactionEffect::Kind::SetTxMessageIndex, 4); + setProgress(plan, progress, QsoProgress::Rogers); + if (snapshot.specOp == SpecOp::RTTY) { + int const rttyExchange = fullWords[fullWordCount - 2].toInt(); + if (rttyExchange >= 529 && rttyExchange <= 599) { + appendTextEffect(plan, QsoReactionEffect::Kind::SetReceivedExchange, + fullWords[fullWordCount - 2] + " " + fullWords[fullWordCount - 1]); + } + } + appendIntEffect(plan, QsoReactionEffect::Kind::CheckTxMessage, 4); + reacted = true; + } else if (progress >= QsoProgress::Calling + && ((word3Number >= -50 && word3Number <= 49) + || (word3Number >= 529 && word3Number <= 599))) { + if (snapshot.specOp == SpecOp::EU_VHF || snapshot.specOp == SpecOp::FIELD_DAY + || snapshot.specOp == SpecOp::RTTY) { + setTxMessageAndProgress(plan, progress, 2, QsoProgress::Report); + } else if (word3.startsWith("R-") || word3.startsWith("R+")) { + setTxMessageAndProgress(plan, progress, 4, QsoProgress::Rogers); + } else { + setTxMessageAndProgress(plan, progress, 3, QsoProgress::RogerReport); + } + reacted = true; + } + } + } else if (analysis.messageWords.size() == 5 + && snapshot.baseCall == analysis.messageWords.at(1)) { + if (snapshot.loggingEnabled) appendEffect(plan, QsoReactionEffect::Kind::RequestLogQso); + else appendEffect(plan, QsoReactionEffect::Kind::CeaseAutoTx); + selectMessage(plan, 6); + reacted = true; + } else if (progress >= QsoProgress::Rogers && analysis.messageWords.size() > 3 + && analysis.messageWords.at(2).contains(snapshot.baseCall) + && analysis.messageWords.at(3) == "73") { + selectMessage(plan, 5); + setProgress(plan, progress, QsoProgress::Signoff); + reacted = true; + } else if (!(snapshot.autoReply && progress > QsoProgress::Calling)) { + if (analysis.messageWords.size() > 5 + && analysis.messageWords.at(2).contains(snapshot.baseCall) + && analysis.messageWords.at(5) == "OOO") { + selectMessageWithProgressBetween(plan, progress, 3, QsoProgress::RogerReport); + reacted = true; + } else if (!analysis.is73) { + selectMessageWithProgressBetween(plan, progress, 2, QsoProgress::Report); + if (snapshot.doubleClickAfterCqFrequency && snapshot.transmitting) { + appendEffect(plan, QsoReactionEffect::Kind::StopTx); + appendIntEffect(plan, QsoReactionEffect::Kind::StartTxAgainTimer, 1500); + } + appendBoolEffect(plan, QsoReactionEffect::Kind::SetDoubleClickAfterCqFrequency, false); + reacted = true; + } + } + } else if (analysis.firstCall == "DE" && analysis.messageWords.size() > 4 + && analysis.messageWords.at(4) == "73") { + if (progress >= QsoProgress::Rogers + && analysis.hisBaseCall == analysis.qsoPartnerBaseCall && snapshot.currentMessageType) { + selectMessage(plan, 5); + setProgress(plan, progress, QsoProgress::Signoff); + } else if (snapshot.tx1Enabled) { + selectMessageWithProgressBetween(plan, progress, 1, QsoProgress::Replying); + } else { + selectMessageWithProgressBetween(plan, progress, 2, QsoProgress::Report); + } + reacted = true; + } else if (analysis.is73 && !message.isStandardMessage()) { + selectMessage(plan, 5); + setProgress(plan, progress, QsoProgress::Signoff); + reacted = true; + } else if (!(snapshot.autoEnabled && snapshot.selectedTxMessage == 3 + && message.string().contains("73 "))) { + if (snapshot.tx1Enabled) { + selectMessageWithProgressBetween(plan, progress, 1, QsoProgress::Replying); + } else { + selectMessageWithProgressBetween(plan, progress, 2, QsoProgress::Report); + } + reacted = true; + } else { + reacted = true; + } + + if (!reacted) { + plan.reason = "message does not require a response"; + return plan; + } + plan.disposition = ReactionDisposition::Reacted; + plan.reason = "message advances QSO reaction"; + appendReactedTail(message, snapshot, analysis, progress, plan); + return plan; + } + + QsoReactionPlan planAutoSequence(DecodedText const& message, QsoReactionSnapshot const& snapshot, + AutoSequencePhase phase, unsigned startTolerance, + unsigned stopTolerance) + { + QsoReactionPlan plan; + if (phase == AutoSequencePhase::LegacyShortMessage) { + if (qAbs(message.frequencyOffset() - snapshot.rxFrequency) > int(startTolerance)) { + plan.reason = "short message is out of tolerance"; + return plan; + } + QString const text = message.string(); + if (text.contains(" " + snapshot.myCall + " ") && text.contains(" OOO")) { + appendIntEffect(plan, QsoReactionEffect::Kind::SetTxMessage, 3); + } + if (text.contains(" RO")) appendIntEffect(plan, QsoReactionEffect::Kind::SetTxMessage, 4); + if (text.contains(" RRR")) appendIntEffect(plan, QsoReactionEffect::Kind::SetTxMessage, 5); + if (text.contains(" 73")) appendIntEffect(plan, QsoReactionEffect::Kind::SetTxMessage, 5); + if (!plan.effects.isEmpty()) { + plan.disposition = ReactionDisposition::Reacted; + plan.reason = "short message advances auto sequence"; + } else { + plan.reason = "short message does not advance auto sequence"; + } + return plan; + } + + QStringList const messageWords = message.messageWords(); + bool const is73 = messageWords.filter(QRegularExpression {"^(73|RR73)$"}).size(); + QString const messageWithoutHash = message.clean_string().mid(22).remove("<").remove(">"); + bool const mskRReport = snapshot.mode == "MSK144" + && messageWithoutHash.indexOf(snapshot.dxCall + " R ") > 0; + if (messageWords.size() <= 3 || !(message.isStandardMessage() || is73 || mskRReport)) { + plan.reason = "message is not an auto-sequence candidate"; + return plan; + } + + int const frequency = message.frequencyOffset(); + bool const withinTolerance = qAbs(snapshot.rxFrequency - frequency) <= int(startTolerance) + || qAbs(snapshot.txFrequency - frequency) <= int(startTolerance); + QStringList const words = messageWithoutHash.split(" ", SkipEmptyParts); + QString thirdPayloadWord; + int reportOrSerial = 0; + if (words.size() > 2) { + thirdPayloadWord = words.at(2); + if (words.size() > 3) { + reportOrSerial = thirdPayloadWord.toInt(); + if (thirdPayloadWord == "R") reportOrSerial = words.at(3).toInt(); + } + } + bool const euVhfSerial = isEuVhfType5Exchange(reportOrSerial); + if (euVhfSerial && message.clean_string().contains("<" + snapshot.myCall + "> ")) { + appendTextEffect(plan, QsoReactionEffect::Kind::SetReceivedExchange, + message.clean_string().trimmed().right(13)); + } + + if (snapshot.autoEnabled + && (snapshot.qsoProgress == QsoProgress::Replying + || (!snapshot.tx1Enabled && snapshot.qsoProgress == QsoProgress::Report)) + && snapshot.specOp != SpecOp::HOUND + && qAbs(snapshot.txFrequency - frequency) <= int(stopTolerance) + && messageWords.at(2) != "DE" + && !messageWords.at(2).contains(QRegularExpression {"(^(CQ|QRZ))|" + snapshot.baseCall}) + && messageWords.at(3).contains(Radio::base_callsign(snapshot.dxCall))) { + appendEffect(plan, QsoReactionEffect::Kind::ClickStopTx); + appendEffect(plan, QsoReactionEffect::Kind::LogStopped); + plan.disposition = ReactionDisposition::Reacted; + plan.reason = "reply from QSO partner appears directed to another caller"; + return plan; + } + + bool const acceptable73 = isAcceptableFreeText73(message, messageWords, snapshot); + bool const directlyForUs = messageWords.at(2).contains(snapshot.baseCall) + && (messageWords.at(3).contains(Radio::base_callsign(snapshot.dxCall)) || euVhfSerial); + bool const rr73Style = messageWords.at(1) == snapshot.baseCall; + bool const type2Or73 = withinTolerance + && (acceptable73 || (messageWords.at(2) == "DE" + && thirdPayloadWord.contains(Radio::base_callsign(snapshot.hisCall)))); + bool const autoReplyForUs = snapshot.callingCq && snapshot.autoReply + && ((withinTolerance && messageWords.at(2) == "DE") + || messageWords.at(2).contains(snapshot.baseCall)); + if (snapshot.specOp != SpecOp::FOX && snapshot.autoEnabled && snapshot.autoSequenceEnabled + && ((!snapshot.callingCq && !snapshot.sentFirst73 + && (directlyForUs || rr73Style || type2Or73)) + || autoReplyForUs)) { + appendEffect(plan, QsoReactionEffect::Kind::ProcessSyntheticMessageNow); + plan.disposition = ReactionDisposition::Reacted; + plan.reason = "message advances auto sequence"; + } else { + plan.reason = "message does not advance auto sequence"; + } + return plan; + } + + QsoReactionPlan planWaitReplyCall(DecodedText const& message, QsoReactionSnapshot const& snapshot, + WaitDecodeSource source) + { + QsoReactionPlan plan; + WaitFeatureContext const waitContext { + snapshot.mode, + snapshot.specOp, + snapshot.waitFeaturesEnabled, + snapshot.autoSequenceChecked, + !snapshot.hisCall.isEmpty(), + snapshot.ncccSprint + }; + bool const fastPolicy = source == WaitDecodeSource::Msk144FastDecoder + && snapshot.mode == "MSK144"; + bool const slowPolicy = source == WaitDecodeSource::SlowDecoder + && slow_wait_feature_mode_supported (snapshot.mode); + if ((!fastPolicy && !slowPolicy) || snapshot.hisCall.isEmpty()) { + plan.reason = "decoder source does not match Wait policy"; + return plan; + } + + bool const nccc = slowPolicy && nccc_sprint_auto_reply (waitContext); + if (!snapshot.waitFeaturesEnabled && !nccc + && !(fastPolicy && snapshot.waitAndCallControlChecked)) { + plan.reason = "Wait features are not active"; + return plan; + } + + QString text = message.string(); + text.replace("<", "").replace(">", ""); + bool const direct = text.contains(" " + snapshot.myCall + " " + snapshot.hisCall); + + if (nccc && !snapshot.hisGrid.isEmpty() + && text.contains(" " + snapshot.myCall + " " + snapshot.hisCall + + " R " + snapshot.hisGrid.left(4))) { + if (snapshot.loggingEnabled) appendEffect(plan, QsoReactionEffect::Kind::RequestLogQso); + appendIntEffect(plan, QsoReactionEffect::Kind::ScheduleStopTx, 500); + plan.disposition = ReactionDisposition::Reacted; + } + + bool waitAndCall = snapshot.waitAndCall; + if (fastPolicy && snapshot.waitAndCallControlChecked && direct) { + appendEffect(plan, QsoReactionEffect::Kind::StopWaitCallTimer); + appendEffect(plan, QsoReactionEffect::Kind::DisableWaitAndCallControl); + appendBoolEffect(plan, QsoReactionEffect::Kind::SetNoWaitAndCall, false); + waitAndCall = false; + plan.disposition = ReactionDisposition::Reacted; + } + + bool const fullDuplexBlocked = fastPolicy && snapshot.fullDuplexEnabled && snapshot.txing; + bool const reply = direct + && (((!text.contains("73 ") && snapshot.waitFeaturesEnabled + && !snapshot.autoButtonChecked && !fullDuplexBlocked)) || nccc); + + if (reply && slowPolicy && snapshot.specOp == SpecOp::HOUND + && (text.mid(4, 2).contains("15") || text.mid(4, 2).contains("45"))) { + plan.disposition = ReactionDisposition::IgnoreDecode; + plan.reason = "hound ignores slow decode from wrong time slot"; + return plan; + } + + if (reply) { + appendEffect(plan, QsoReactionEffect::Kind::ResetWatchdog); + appendBoolEffect(plan, QsoReactionEffect::Kind::SetDoubleClicked, true); + appendEffect(plan, QsoReactionEffect::Kind::ProcessSyntheticMessageNow); + appendBoolEffect(plan, QsoReactionEffect::Kind::SetAutoEnabled, true); + if (nccc) { + appendEffect(plan, QsoReactionEffect::Kind::RequestLogQsoUnlessSuppressed); + } else if (snapshot.waitFeaturesEnabled) { + appendIntEffect(plan, QsoReactionEffect::Kind::StartWaitReplyTimer, + int((fastPolicy ? 12000.0 : 8000.0) * snapshot.trPeriod)); + } + plan.disposition = ReactionDisposition::Reacted; + } + + bool call = false; + if (waitAndCall && snapshot.specOp != SpecOp::FOX && snapshot.autoSequenceChecked + && snapshot.waitFeaturesEnabled && (fastPolicy || !snapshot.noWaitAndCall)) { + bool const callTrigger = text.contains("CQ " + snapshot.hisCall) + || text.contains("CQ DX " + snapshot.hisCall) + || text.contains(snapshot.hisCall + " RR73") + || text.contains(snapshot.hisCall + " RRR") + || text.contains(snapshot.hisCall + " 73"); + call = callTrigger && !fullDuplexBlocked; + } + + if (call) { + if (slowPolicy && !direct) { + appendBoolEffect(plan, QsoReactionEffect::Kind::SetBlockRightDisplay, true); + } + appendBoolEffect(plan, QsoReactionEffect::Kind::SetDoubleClicked, true); + appendEffect(plan, QsoReactionEffect::Kind::ProcessSyntheticMessageNow); + appendBoolEffect(plan, QsoReactionEffect::Kind::SetAutoEnabled, true); + appendBoolEffect(plan, QsoReactionEffect::Kind::SetNoWaitAndCall, true); + appendIntEffect(plan, QsoReactionEffect::Kind::StartWaitCallTimer, + int(6200.0 * snapshot.trPeriod)); + plan.disposition = ReactionDisposition::Reacted; + } + + if (plan.disposition == ReactionDisposition::NoReaction) { + plan.reason = "message does not match Wait and Reply or Wait and Call"; + } else if (plan.reason.isEmpty()) { + plan.reason = "message triggers Wait and Reply or Wait and Call"; + } + return plan; + } +} diff --git a/DecodedMessageReaction.hpp b/DecodedMessageReaction.hpp new file mode 100644 index 00000000..53d83a22 --- /dev/null +++ b/DecodedMessageReaction.hpp @@ -0,0 +1,210 @@ +#ifndef DECODEDMESSAGEREACTION_HPP +#define DECODEDMESSAGEREACTION_HPP + +#include "QsoProgress.hpp" +#include "Radio.hpp" +#include "SpecialOperatingActivity.hpp" +#include "AutoRespondPolicy.hpp" + +#include +#include +#include + +class DecodedText; + +namespace DecodedMessageReaction +{ + enum class ReactionDisposition + { + NoReaction, + Reacted, + IgnoreDecode + }; + + enum class WaitDecodeSource + { + SlowDecoder, + Msk144FastDecoder + }; + + enum class AutoSequencePhase + { + StandardDecode, + LegacyShortMessage + }; + + enum class ContestHint + { + EuVhf, + FieldDay, + Rtty + }; + + enum class SelectionOrigin + { + None, + ManualLeftPane, + ManualRightPane, + Synthetic, + Udp + }; + + struct KeyboardModifiers + { + bool shift {false}; + bool ctrl {false}; + bool alt {false}; + }; + + struct QsoReactionSnapshot + { + QString mode; + SpecialOperatingActivity specOp {SpecialOperatingActivity::NONE}; + QString myCall; + QString baseCall; + QString dxCall; + QString hisCall; + QString hisGrid; + AutoRespondPolicy respondPolicy {AutoRespondPolicy::None}; + double trPeriod {60.0}; + Radio::Frequency nominalFrequency {0u}; + int rxFrequency {0}; + int txFrequency {0}; + + QsoProgress qsoProgress {QsoProgress::Calling}; + int selectedTxMessage {0}; + int currentMessageType {0}; + bool sentReport {false}; + bool shortMessages {false}; + bool sendRr73 {false}; + bool transmitting {false}; + bool transmittingSignoff {false}; + + bool doubleClicked {false}; + bool doubleClickAfterCqFrequency {false}; + SelectionOrigin selectionOrigin {SelectionOrigin::None}; + KeyboardModifiers modifiers; + + bool fastMode {false}; + bool transceiverOnline {false}; + bool nominalQsyAllowed {false}; + bool enableVhfFeatures {false}; + bool holdTxFrequency {false}; + bool rxFrequencyEnabled {true}; + bool tx1Enabled {true}; + + bool autoEnabled {false}; + bool autoButtonChecked {false}; + bool autoReply {false}; + bool callingCq {false}; + bool sentFirst73 {false}; + bool autoSequenceEnabled {false}; + bool autoSequenceChecked {false}; + bool quickCall {false}; + bool repeatTx {false}; + + bool loggingEnabled {false}; + bool contestHintShown {false}; + bool ncccSprint {false}; + int tx73Count {0}; + + bool waitFeaturesEnabled {false}; + bool waitAndCall {false}; + bool noWaitAndCall {false}; + bool waitAndCallControlChecked {false}; + bool fullDuplexEnabled {false}; + bool txing {false}; + + }; + + struct QsoReactionEffect + { + enum class Kind + { + SetRxFrequency, + SetTxFrequency, + ApplyFastCqQsy, + RejectNominalQsy, + SetTxFirst, + // Keep setTxMsg(), raw index assignment, checked-state changes, and clicks distinct; + // each has different synchronous signal behavior in MainWindow. + SetTxMessage, + SetTxMessageIndex, + CheckTxMessage, + ClickTxMessage, + SetQsoProgress, + SetDxCall, + ClearDxGrid, + SetDxGrid, + SetReport, + SetReceivedExchange, + SetCallingCq, + SetMaxPoints, + SetRestart, + SetDoubleClicked, + SetDoubleClickAfterCqFrequency, + SetTuMessage, + SetNextCall, + SetNoLogging, + SetNoWaitAndCall, + SetBlockRightDisplay, + SetAutoEnabled, + RefreshQsoPaneIfChanged, + Lookup, + CaptureHisGrid, + ExtractReceivedReport, + GenerateStandardMessages, + RecordRr73Received, + RequestLogQso, + RequestLogQsoUnlessSuppressed, + CeaseAutoTx, + StopTx, + ClickStopTx, + LogStopped, + StartTxAgainTimer, + ResetWatchdog, + StopWaitCallTimer, + DisableWaitAndCallControl, + StartWaitReplyTimer, + StartWaitCallTimer, + ScheduleStopTx, + ScheduleNcccAutoReset, + ScheduleNoLoggingReset, + ScheduleAutoFlagOff, + QueueContestHint, + ProcessSyntheticMessageNow + }; + + Kind kind; + int intValue {0}; + Radio::Frequency frequency {0u}; + QString text; + bool boolValue {false}; + bool userInitiated {false}; + QsoProgress progress {QsoProgress::Calling}; + ContestHint contestHint {ContestHint::EuVhf}; + }; + + struct QsoReactionPlan + { + // Plans are deterministic for their inputs, but are one-shot ordered imperative scripts. + // Effects must never be reordered, replayed, or batched. ProcessSyntheticMessageNow takes + // a fresh live snapshot after every preceding effect has been applied. + ReactionDisposition disposition {ReactionDisposition::NoReaction}; + QString reason; + QVector effects; + }; + + bool shouldDeferAutoTxStopAfterRrr(QString const& mode, bool repeatTx, bool sendRr73); + void applyAutoTxStopAfterLogging(QString const& mode, bool repeatTx, bool sendRr73, + std::function stopAutoTx); + + QsoReactionPlan planProcessMessage(DecodedText const& message, QsoReactionSnapshot const& snapshot); + QsoReactionPlan planAutoSequence(DecodedText const& message, QsoReactionSnapshot const& snapshot, + AutoSequencePhase phase, unsigned startTolerance, + unsigned stopTolerance); + QsoReactionPlan planWaitReplyCall(DecodedText const& message, QsoReactionSnapshot const& snapshot, + WaitDecodeSource source); +} + +#endif // DECODEDMESSAGEREACTION_HPP diff --git a/Decoder/decodedtext.cpp b/Decoder/decodedtext.cpp index 3c684f82..52780e02 100644 --- a/Decoder/decodedtext.cpp +++ b/Decoder/decodedtext.cpp @@ -7,6 +7,7 @@ extern "C" { bool stdmsg_(char const * msg, fortran_charlen_t); + bool stdmsg72_(char const * msg, bool * is_jt65, fortran_charlen_t); } namespace @@ -44,6 +45,32 @@ namespace )? )" , QRegularExpression::ExtendedPatternSyntaxOption}; + QRegularExpression const ap_suffix_re {R"(^(.*?)(?:\?\s)?[aq][0-9].*$)"}; + QRegularExpression const angle_bracket_re {"[<>]"}; + QRegularExpression const cq_qrz_re {"^(CQ|QRZ)\\s"}; + QRegularExpression const grid_re {R"(^(?!RR73$)[A-R]{2}[0-9]{2}(?:[A-X]{2})?$)"}; +} + +DecodedMessageFields parseDecodedMessage (QString message) +{ + message = message.trimmed ().remove (angle_bracket_re); + if (message.startsWith ("TU; ")) message.remove (0, 4); + auto const match = tokens_re.match (message); + if (!match.hasMatch ()) return {}; + + DecodedMessageFields fields; + fields.destination = match.captured ("word1"); + fields.sender = match.captured ("word2"); + fields.cq = fields.destination == "CQ" || fields.destination == "CQDX" + || fields.destination.startsWith ("CQ "); + for (auto const& name : {"word3", "word4", "word5"}) { + auto const candidate = match.captured (name); + if (grid_re.match (candidate).hasMatch ()) { + fields.grid = candidate; + break; + } + } + return fields; } DecodedText::DecodedText (QString const& the_string) @@ -55,7 +82,7 @@ DecodedText::DecodedText (QString const& the_string) , is_standard_ {false} { // discard appended AP info - clean_string_.replace (QRegularExpression {R"(^(.*?)(?:\?\s)?[aq][0-9].*$)"}, "\\1"); + clean_string_.replace (ap_suffix_re, "\\1"); // qDebug () << "DecodedText: the_string:" << the_string << "Nbsp pos:" << the_string.indexOf (QChar::Nbsp); if (message_.length() >= 1) @@ -63,13 +90,13 @@ DecodedText::DecodedText (QString const& the_string) // remove appended confidence (?) and ap designators before truncating the message message_ = clean_string_.mid (column_qsoText + padding_).trimmed (); message0_ = message_.left(37); - message_ = message_.left(37).remove (QRegularExpression {"[<>]"}); + message_ = message_.left(37).remove (angle_bracket_re); int i1 = message_.indexOf ('\r'); if (i1 > 0) { message_ = message_.left (i1 - 1); } - if (message_.contains (QRegularExpression {"^(CQ|QRZ)\\s"})) + if (message_.contains (cq_qrz_re)) { // TODO this magic position 16 is guaranteed to be after the // last space in a decoded CQ or QRZ message but before any @@ -80,11 +107,18 @@ DecodedText::DecodedText (QString const& the_string) // remove DXCC entity and worked B4 status. TODO need a better way to do this message_ = message_.left (eom_pos + 1); } - // stdmsg is a Fortran routine that packs the text, unpacks it - // and compares the result auto message_c_string = message0_.toLocal8Bit (); message_c_string += QByteArray {37 - message_c_string.size (), ' '}; - is_standard_ = stdmsg_(message_c_string.constData(),37); + auto const mode = string_.mid (column_mode + padding_, 1); + if (mode == "$" || mode == "@" || mode == "#") + { + bool is_jt65 = mode == "#"; + is_standard_ = stdmsg72_(message_c_string.constData(), &is_jt65, 37); + } + else + { + is_standard_ = stdmsg_(message_c_string.constData(), 37); + } } }; @@ -107,8 +141,10 @@ QStringList DecodedText::messageWords () const QString DecodedText::CQersCall() const { - QRegularExpression callsign_re {R"(^(CQ|DE|QRZ)(\s?DX|\s([A-Z]{1,4}|\d{3}))?\s(?[A-Z0-9/]{2,})(\s[A-R]{2}[0-9]{2})?)"}; - return callsign_re.match (message_).captured ("callsign"); + auto const fields = parseDecodedMessage (message_); + auto const callType = fields.destination.section (' ', 0, 0); + return callType == "CQ" || callType == "CQDX" || callType == "DE" || callType == "QRZ" + ? fields.sender : QString {}; } @@ -171,6 +207,7 @@ bool DecodedText::report(QString const& myBaseCall, QString const& dxBaseCall, / { offset = 2; } + if (w.size () <= offset + 2) return false; if (is_standard_ && (w[offset] == myBaseCall || w[offset].endsWith ("/" + myBaseCall) || w[offset].startsWith (myBaseCall + "/") @@ -205,7 +242,7 @@ bool DecodedText::report(QString const& myBaseCall, QString const& dxBaseCall, / // get the first text word, usually the call QString DecodedText::call() const { - return tokens_re.match (message_).captured ("word1"); + return parseDecodedMessage (message_).destination; } // get the second word, most likely the de call and the third word, most likely grid diff --git a/Decoder/decodedtext.h b/Decoder/decodedtext.h index 1e6706b5..d911c53a 100644 --- a/Decoder/decodedtext.h +++ b/Decoder/decodedtext.h @@ -11,7 +11,15 @@ #include +struct DecodedMessageFields +{ + QString destination; + QString sender; + QString grid; + bool cq {}; +}; +DecodedMessageFields parseDecodedMessage (QString message); /* 012345678901234567890123456789012345678901 @@ -33,6 +41,7 @@ public: QString string() const { return string_; }; QString clean_string() const { return clean_string_; }; + QString message() const { return message_; }; QStringList messageWords () const; int indexOf(QString s) const { return string_.indexOf(s); }; int indexOf(QString s, int i) const { return string_.indexOf(s,i); }; diff --git a/Decoder/decodedtext.pri b/Decoder/decodedtext.pri deleted file mode 100644 index 6aa33dc3..00000000 --- a/Decoder/decodedtext.pri +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES += Decoder/decodedtext.cpp - -HEADERS += Decoder/decodedtext.h diff --git a/DecoderIpc.cpp b/DecoderIpc.cpp new file mode 100644 index 00000000..814d68d6 --- /dev/null +++ b/DecoderIpc.cpp @@ -0,0 +1,248 @@ +#include "DecoderIpc.hpp" + +#include "lib/decoder_ipc_control.h" + +#include +#include +#include + +namespace +{ + int sampleCountToCopy (int period) + { + switch (period) + { + case 7: // FT4's 7.5-second period is stored as an integer. + case 15: + case 30: + case 60: + case 120: + case 300: + case 900: + case 1800: + // Legacy decoders read fixed windows beyond the received sample count. + return std::min (NTMAX, std::max (60, period)) * RX_SAMPLE_RATE; + default: + return NTMAX * RX_SAMPLE_RATE; + } + } + + bool hasCurrentProtocol (shared_dec_data_t const& shared) + { + return DECODER_IPC_VERSION == DecoderIpc::protocolVersion (shared); + } + + bool parseField (QByteArray const& field, qint32& value) + { + bool ok {false}; + auto const parsed = field.toInt (&ok); + if (!ok) return false; + value = parsed; + return true; + } + + bool parseGeneration (QByteArray const& text, qint32& generation) + { + if (text.isEmpty ()) return false; + for (auto const digit: text) + { + if (digit < '0' || digit > '9') return false; + } + return parseField (text, generation) && generation > 0; + } +} + +qint32 DecoderIpc::nextGeneration (qint32 current) +{ + return current <= 0 || current == std::numeric_limits::max () + ? 1 : current + 1; +} + +bool DecoderIpc::hasUsableSize (qint64 size) +{ + return size >= static_cast (sizeof (shared_dec_data_t)); +} + +bool DecoderIpc::hasShutdownControlSize (qint64 size) +{ + return size >= static_cast (offsetof (decoder_ipc_control_t, progress)); +} + +qint32 DecoderIpc::state (shared_dec_data_t const& shared) +{ + return decoder_ipc_atomic_load (&shared.control.state); +} + +qint32 DecoderIpc::generation (shared_dec_data_t const& shared) +{ + return decoder_ipc_atomic_load (&shared.control.generation); +} + +qint32 DecoderIpc::progress (shared_dec_data_t const& shared) +{ + return decoder_ipc_atomic_load (&shared.control.progress); +} + +qint32 DecoderIpc::protocolVersion (shared_dec_data_t const& shared) +{ + return decoder_ipc_atomic_load (&shared.control.version); +} + +void DecoderIpc::initialize (shared_dec_data_t& shared) +{ + std::memset (&shared, 0, sizeof (shared)); + decoder_ipc_control_initialize (&shared.control.generation, &shared.control.state, + &shared.control.version, &shared.control.progress); +} + +void DecoderIpc::shutdown (shared_dec_data_t& shared) +{ + shutdown (shared.control); +} + +void DecoderIpc::shutdown (decoder_ipc_control_t& control) +{ + shutdownControl (&control); +} + +void DecoderIpc::shutdownControl (void * control) +{ + auto * words = static_cast (control); + decoder_ipc_control_shutdown (words + 1, words + 2); +} + +bool DecoderIpc::publish (shared_dec_data_t& shared, dec_data_t const& payload, + bool copySamples, qint32 generation) +{ + if (!hasCurrentProtocol (shared) + || DECODER_IPC_IDLE != state (shared) + || generation <= 0) + { + return false; + } + + // A different mode or period must not reuse an incomplete sample snapshot. + bool const contextChanged = !copySamples + && (shared.payload.params.nmode != payload.params.nmode + || shared.payload.params.ntrperiod != payload.params.ntrperiod); + copySamples = copySamples || contextChanged; + if (copySamples) + { + std::memcpy (shared.payload.ss, payload.ss, sizeof payload.ss); + std::memcpy (shared.payload.savg, payload.savg, sizeof payload.savg); + std::memcpy (shared.payload.sred, payload.sred, sizeof payload.sred); + std::memcpy (shared.payload.d2, payload.d2, + sampleCountToCopy (payload.params.ntrperiod) * sizeof payload.d2[0]); + shared.payload.params = payload.params; + } + else + { + shared.payload.params = payload.params; + } + if (contextChanged) + { + shared.payload.params.newdat = true; + shared.payload.params.nagain = false; + } + return decoder_ipc_control_publish (&shared.control.generation, + &shared.control.state, + &shared.control.version, + &shared.control.progress, generation); +} + +bool DecoderIpc::publishFt8Mtd (shared_dec_data_t& shared, + Ft8MtdPayload const& payload, + qint32 generation) +{ + if (!hasCurrentProtocol (shared) + || DECODER_IPC_IDLE != state (shared) + || generation <= 0 + || 8 != payload.params.nmode + || !payload.params.lmultift8) + { + return false; + } + + shared.payload.params = payload.params; + std::memcpy (shared.payload.d2, payload.samples.data (), + sizeof payload.samples); + return decoder_ipc_control_publish (&shared.control.generation, + &shared.control.state, + &shared.control.version, + &shared.control.progress, generation); +} + +bool DecoderIpc::claim (shared_dec_data_t& shared, qint32& generation) +{ + return DECODER_IPC_CLAIMED == decoder_ipc_control_try_claim ( + &shared.control.generation, &shared.control.state, &shared.control.version, + &generation); +} + +bool DecoderIpc::finish (shared_dec_data_t& shared, qint32 generation) +{ + return decoder_ipc_control_finish (&shared.control.generation, + &shared.control.state, + &shared.control.version, generation); +} + +bool DecoderIpc::consume (shared_dec_data_t& shared, qint32 generation) +{ + return decoder_ipc_control_consume (&shared.control.generation, + &shared.control.state, + &shared.control.version, generation); +} + +bool DecoderIpc::parseStart (QByteArray line, qint32 * generation) +{ + if (!generation) return false; + if (line.endsWith ('\n')) line.chop (1); + if (line.endsWith ('\r')) line.chop (1); + + QByteArray const prefix {" gen="}; + if (!line.startsWith (prefix)) return false; + + qint32 parsed {0}; + if (!parseGeneration (line.mid (prefix.size ()), parsed)) return false; + *generation = parsed; + return true; +} + +bool DecoderIpc::parseCompletion (QByteArray line, Completion * completion) +{ + if (!completion) return false; + if (line.endsWith ('\n')) line.chop (1); + if (line.endsWith ('\r')) line.chop (1); + + QByteArray const prefix {""}; + QByteArray const generationPrefix {" gen="}; + constexpr int synchronizedWidth {4}; + constexpr int decodedWidth {4}; + constexpr int averageWidth {9}; + auto const synchronizedOffset = prefix.size (); + auto const decodedOffset = synchronizedOffset + synchronizedWidth; + auto const averageOffset = decodedOffset + decodedWidth; + auto const generationOffset = averageOffset + averageWidth; + if (!line.startsWith (prefix) + || line.mid (generationOffset, generationPrefix.size ()) != generationPrefix) + { + return false; + } + + Completion parsed {}; + if (!parseField (line.mid (synchronizedOffset, synchronizedWidth), + parsed.synchronized) + || !parseField (line.mid (decodedOffset, decodedWidth), parsed.decoded) + || !parseField (line.mid (averageOffset, averageWidth), parsed.average)) + { + return false; + } + + auto const generationText = line.mid (generationOffset + generationPrefix.size ()); + if (!parseGeneration (generationText, parsed.generation)) + { + return false; + } + *completion = parsed; + return true; +} diff --git a/DecoderIpc.hpp b/DecoderIpc.hpp new file mode 100644 index 00000000..775ec26c --- /dev/null +++ b/DecoderIpc.hpp @@ -0,0 +1,52 @@ +#ifndef DECODER_IPC_HPP +#define DECODER_IPC_HPP + +#include +#include + +#include + +#include "commons.h" + +namespace DecoderIpc +{ + // FT8 reads the complete 15-second buffer even when decoding starts earlier. + constexpr std::size_t Ft8SampleCount {15 * RX_SAMPLE_RATE}; + + struct Ft8MtdPayload + { + std::array samples {}; + decoder_params_t params {}; + }; + + struct Completion + { + qint32 synchronized; + qint32 decoded; + qint32 average; + qint32 generation; + }; + + qint32 nextGeneration (qint32 current); + bool hasUsableSize (qint64 size); + bool hasShutdownControlSize (qint64 size); + qint32 state (shared_dec_data_t const& shared); + qint32 generation (shared_dec_data_t const& shared); + qint32 progress (shared_dec_data_t const& shared); + qint32 protocolVersion (shared_dec_data_t const& shared); + void initialize (shared_dec_data_t& shared); + void shutdown (shared_dec_data_t& shared); + void shutdown (decoder_ipc_control_t& control); + void shutdownControl (void * control); + bool publish (shared_dec_data_t& shared, dec_data_t const& payload, + bool copySamples, qint32 generation); + bool publishFt8Mtd (shared_dec_data_t& shared, + Ft8MtdPayload const& payload, qint32 generation); + bool claim (shared_dec_data_t& shared, qint32& generation); + bool finish (shared_dec_data_t& shared, qint32 generation); + bool consume (shared_dec_data_t& shared, qint32 generation); + bool parseStart (QByteArray line, qint32 * generation); + bool parseCompletion (QByteArray line, Completion * completion); +} + +#endif diff --git a/DecoderIpcProtocol.h b/DecoderIpcProtocol.h new file mode 100644 index 00000000..ad6c2ead --- /dev/null +++ b/DecoderIpcProtocol.h @@ -0,0 +1,22 @@ +#ifndef DECODER_IPC_PROTOCOL_H +#define DECODER_IPC_PROTOCOL_H + +#define DECODER_IPC_VERSION 2 + +enum decoder_ipc_state +{ + DECODER_IPC_IDLE = 0, + DECODER_IPC_READY = 1, + DECODER_IPC_DECODING = 2, + DECODER_IPC_COMPLETE = 3, + DECODER_IPC_SHUTDOWN = 999 +}; + +typedef struct decoder_ipc_control { + int generation; + int state; + int version; + int progress; +} decoder_ipc_control_t; + +#endif diff --git a/DecoderOutputFramer.cpp b/DecoderOutputFramer.cpp new file mode 100644 index 00000000..92c9c1e9 --- /dev/null +++ b/DecoderOutputFramer.cpp @@ -0,0 +1,52 @@ +#include "DecoderOutputFramer.hpp" + +#include + +void DecoderOutputFramer::drain (QIODevice& device, + EventHandler const& handler) +{ + while (device.canReadLine ()) + { + auto const rawLine = device.readLine (); + Event event {EventType::Malformed, generation_, rawLine, {}}; + + if (rawLine.startsWith ("")) + { + qint32 generation {0}; + if (!generation_ && DecoderIpc::parseStart (rawLine, &generation)) + { + generation_ = generation; + event.type = EventType::Started; + event.generation = generation; + } + } + else if (rawLine.startsWith ("")) + { + DecoderIpc::Completion completion {}; + if (DecoderIpc::parseCompletion (rawLine, &completion) + && generation_ == completion.generation) + { + event.type = EventType::Finished; + event.generation = completion.generation; + event.completion = completion; + generation_ = 0; + } + } + else if (generation_) + { + event.type = EventType::Record; + } + + if (handler) handler (event); + } +} + +void DecoderOutputFramer::reset () +{ + generation_ = 0; +} + +qint32 DecoderOutputFramer::currentGeneration () const +{ + return generation_; +} diff --git a/DecoderOutputFramer.hpp b/DecoderOutputFramer.hpp new file mode 100644 index 00000000..ef020226 --- /dev/null +++ b/DecoderOutputFramer.hpp @@ -0,0 +1,41 @@ +#ifndef DECODER_OUTPUT_FRAMER_HPP +#define DECODER_OUTPUT_FRAMER_HPP + +#include + +#include + +#include "DecoderIpc.hpp" + +class QIODevice; + +class DecoderOutputFramer +{ +public: + enum class EventType + { + Started, + Record, + Finished, + Malformed + }; + + struct Event + { + EventType type; + qint32 generation; + QByteArray rawLine; + DecoderIpc::Completion completion; + }; + + using EventHandler = std::function; + + void drain (QIODevice& device, EventHandler const& handler); + void reset (); + qint32 currentGeneration () const; + +private: + qint32 generation_ {0}; +}; + +#endif diff --git a/Detector/Detector.cpp b/Detector/Detector.cpp index bb26a4b3..f75cb9a9 100644 --- a/Detector/Detector.cpp +++ b/Detector/Detector.cpp @@ -1,17 +1,23 @@ #include "Detector.hpp" +#include #include #include #include -#include +#include +#include +#include +#include +#include #include "commons.h" +#include "DecDataMutex.hpp" #include "moc_Detector.cpp" extern "C" { - void fil4_(qint16*, qint32*, qint16*, qint32*); + void fil4_state_(qint16*, qint32*, qint16*, qint32*, float*); } -extern dec_data_t dec_data; +#include "ReceiveAudio.hpp" Detector::Detector (unsigned frameRate, double periodLengthInSeconds, unsigned downSampleFactor, QObject * parent) @@ -33,6 +39,60 @@ void Detector::setBlockSize (unsigned n) m_samplesPerFFT = n; } +void Detector::setTRPeriod (double period) +{ + if (QThread::currentThread () != thread ()) + { + QMetaObject::invokeMethod (this, [this, period] { setTRPeriod (period); }, + Qt::QueuedConnection); + return; + } + if (m_period != period) + { + m_period = period; + m_last_period_offset_ms = -1; + clear (); + } +} + +void Detector::setStreamDescriptor (AudioStreamDescriptor descriptor) +{ + m_stream_clock.setDescriptor (descriptor); + m_last_period_offset_ms = -1; + clear (); +} + +void Detector::flushBufferedFrames (qint64 frameLimit) +{ + qint64 framesWritten {0}; + ReceiveAudio audio; + { + QMutexLocker lock {&dec_data_mutex ()}; + auto& producer = m_receiveAudioProducer.data (); + if (dec_data_input_blocked ()) return; + if (m_downSampleFactor > 1 && m_bufferPos + && m_receiveAudioProducer.frames () < frameLimit) + { + auto const blockFrames = m_samplesPerFFT * m_downSampleFactor; + std::fill (m_buffer.data () + m_bufferPos, + m_buffer.data () + blockFrames, 0); + qint32 framesToProcess = blockFrames; + qint32 framesAfterDownSample = m_samplesPerFFT; + fil4_state_ (m_buffer.data (), &framesToProcess, + &producer.d2[m_receiveAudioProducer.frames ()], + &framesAfterDownSample, m_downsampleState.data ()); + m_receiveAudioProducer.setFrames (std::min ( + frameLimit, m_receiveAudioProducer.frames () + framesAfterDownSample)); + } + framesWritten = std::min (frameLimit, m_receiveAudioProducer.frames ()); + if (framesWritten <= m_receiveAudioProducer.capturedEnd ()) return; + audio = m_receiveAudioProducer.capture (framesWritten, m_period); + m_bufferPos = 0; + } + Q_EMIT this->framesWritten (framesWritten); + Q_EMIT audioBlock (audio); +} + bool Detector::reset () { clear (); @@ -43,40 +103,55 @@ bool Detector::reset () void Detector::clear () { - // set index to roughly where we are in time (1ms resolution) - // qint64 now (QDateTime::currentMSecsSinceEpoch ()); - // unsigned msInPeriod ((now % 86400000LL) % (m_period * 1000)); - // dec_data.params.kin = qMin ((msInPeriod * m_frameRate) / 1000, static_cast (sizeof (dec_data.d2) / sizeof (dec_data.d2[0]))); - dec_data.params.kin = 0; + QMutexLocker lock {&dec_data_mutex ()}; m_bufferPos = 0; + if (dec_data_input_blocked ()) return; + + resetPeriodBuffer (); +} - // fill buffer with zeros (G4WJS commented out because it might cause decoder hangs) - // qFill (dec_data.d2, dec_data.d2 + sizeof (dec_data.d2) / sizeof (dec_data.d2[0]), 0); +void Detector::resetPeriodBuffer () +{ + m_receiveAudioProducer.reset (m_period); + m_bufferPos = 0; } qint64 Detector::writeData (char const * data, qint64 maxSize) { - static unsigned mstr0=999999; - qint64 ms0 = QDateTime::currentMSecsSinceEpoch() % 86400000; - unsigned mstr = ms0 % int(1000.0*m_period); // ms into the nominal Tx start time - if(mstr < mstr0) { //When mstr has wrapped around to 0, restart the buffer - dec_data.params.kin = 0; - m_bufferPos = 0; - } - mstr0=mstr; - - // no torn frames - Q_ASSERT (!(maxSize % static_cast (bytesPerFrame ()))); - // these are in terms of input frames (not down sampled) - size_t framesAcceptable ((sizeof (dec_data.d2) / - sizeof (dec_data.d2[0]) - dec_data.params.kin) * m_downSampleFactor); - size_t framesAccepted (qMin (static_cast (maxSize / - bytesPerFrame ()), framesAcceptable)); - - if (framesAccepted < static_cast (maxSize / bytesPerFrame ())) { - qDebug () << "dropped " << maxSize / bytesPerFrame () - framesAccepted - << " frames of data on the floor!" - << dec_data.params.kin << mstr; + auto const bytes_per_frame = static_cast (bytesPerFrame ()); + Q_ASSERT (!(maxSize % bytes_per_frame)); + qint64 const frames_received = maxSize / bytes_per_frame; + QVector frame_counts; + QVector audio; + qint64 const now_ms = m_stream_clock.timestamp ( + QDateTime::currentMSecsSinceEpoch ()); + m_stream_clock.advance (frames_received); + qint64 const period_ms = static_cast (1000.0 * m_period); + qint64 const day_ms = now_ms % 86400000; + qint64 const mstr = day_ms % period_ms; // ms into the nominal Tx start time + + if (dec_data_input_blocked ()) return maxSize; + + { + QMutexLocker lock {&dec_data_mutex ()}; + auto& producer = m_receiveAudioProducer.data (); + if (dec_data_input_blocked ()) return maxSize; + if(m_last_period_offset_ms >= 0 && mstr < m_last_period_offset_ms) { + resetPeriodBuffer (); + } + m_last_period_offset_ms = mstr; + + // these are in terms of input frames (not down sampled) + size_t framesAcceptable ((sizeof producer.d2 / + sizeof producer.d2[0] - m_receiveAudioProducer.frames ()) * m_downSampleFactor); + size_t framesAccepted (qMin (static_cast (frames_received), framesAcceptable)); + + if (framesAccepted < static_cast (frames_received)) { + auto const frames_dropped = frames_received + - static_cast (framesAccepted); + qDebug () << "dropped " << frames_dropped + << " frames of data on the floor!" + << m_receiveAudioProducer.frames () << mstr; } for (unsigned remaining = framesAccepted; remaining; ) { @@ -91,33 +166,42 @@ qint64 Detector::writeData (char const * data, qint64 maxSize) if(m_bufferPos==m_samplesPerFFT*m_downSampleFactor) { qint32 framesToProcess (m_samplesPerFFT * m_downSampleFactor); qint32 framesAfterDownSample (m_samplesPerFFT); - if(m_downSampleFactor > 1 && dec_data.params.kin>=0 && - dec_data.params.kin < (NTMAX*12000 - framesAfterDownSample)) { - fil4_(&m_buffer[0], &framesToProcess, &dec_data.d2[dec_data.params.kin], - &framesAfterDownSample); - dec_data.params.kin += framesAfterDownSample; + if(m_downSampleFactor > 1 && m_receiveAudioProducer.frames ()>=0 && + m_receiveAudioProducer.frames () < (NTMAX*12000 - framesAfterDownSample)) { + fil4_state_(&m_buffer[0], &framesToProcess, + &producer.d2[m_receiveAudioProducer.frames ()], + &framesAfterDownSample, m_downsampleState.data ()); + m_receiveAudioProducer.setFrames (m_receiveAudioProducer.frames () + framesAfterDownSample); } else { // qDebug() << "framesToProcess = " << framesToProcess; - // qDebug() << "dec_data.params.kin = " << dec_data.params.kin; + // qDebug() << "receive audio frames = " << m_receiveAudioProducer.frames (); // qDebug() << "secondInPeriod = " << secondInPeriod(); // qDebug() << "framesAfterDownSample" << framesAfterDownSample; } - Q_EMIT framesWritten (dec_data.params.kin); + frame_counts << m_receiveAudioProducer.frames (); + audio << m_receiveAudioProducer.capture (m_receiveAudioProducer.frames (), m_period); m_bufferPos = 0; } } else { store (&data[(framesAccepted - remaining) * bytesPerFrame ()], - numFramesProcessed, &dec_data.d2[dec_data.params.kin]); + numFramesProcessed, &producer.d2[m_receiveAudioProducer.frames ()]); m_bufferPos += numFramesProcessed; - dec_data.params.kin += numFramesProcessed; + m_receiveAudioProducer.setFrames (m_receiveAudioProducer.frames () + numFramesProcessed); if (m_bufferPos == static_cast (m_samplesPerFFT)) { - Q_EMIT framesWritten (dec_data.params.kin); + frame_counts << m_receiveAudioProducer.frames (); + audio << m_receiveAudioProducer.capture (m_receiveAudioProducer.frames (), m_period); m_bufferPos = 0; } } remaining -= numFramesProcessed; } + } + + for (auto frames : frame_counts) { + Q_EMIT framesWritten (frames); + } + for (auto const& block : audio) Q_EMIT audioBlock (block); // we drop any data past the end of the buffer on the floor until // the next period starts diff --git a/Detector/Detector.hpp b/Detector/Detector.hpp index 53723d43..c8480636 100644 --- a/Detector/Detector.hpp +++ b/Detector/Detector.hpp @@ -1,7 +1,10 @@ #ifndef DETECTOR_HPP__ #define DETECTOR_HPP__ #include "Audio/AudioDevice.hpp" +#include "Audio/AudioStreamClock.hpp" +#include "ReceiveAudio.hpp" #include +#include // // output device that distributes data in predefined chunks via a signal @@ -25,11 +28,14 @@ public: Detector (unsigned frameRate, double periodLengthInSeconds, unsigned downSampleFactor = 4u, QObject * parent = 0); - void setTRPeriod(double p) {m_period=p;} + void setTRPeriod (double period); bool reset () override; Q_SIGNAL void framesWritten (qint64) const; + Q_SIGNAL void audioBlock (ReceiveAudio) const; Q_SLOT void setBlockSize (unsigned); + Q_SLOT void flushBufferedFrames (qint64 frameLimit); + Q_SLOT void setStreamDescriptor (AudioStreamDescriptor); protected: qint64 readData (char * /* data */, qint64 /* maxSize */) override @@ -41,11 +47,16 @@ protected: private: void clear (); // discard buffer contents + void resetPeriodBuffer (); unsigned m_frameRate; double m_period; unsigned m_downSampleFactor; qint32 m_samplesPerFFT; // after any down sampling + AudioStreamClock m_stream_clock; + ReceiveAudioProducer m_receiveAudioProducer; + std::array m_downsampleState {}; + qint64 m_last_period_offset_ms {-1}; static size_t const max_buffer_size {7 * 512}; QScopedArrayPointer m_buffer; // de-interleaved sample buffer // big enough for all the diff --git a/Detector/Detector.pri b/Detector/Detector.pri deleted file mode 100644 index 53badba0..00000000 --- a/Detector/Detector.pri +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES += Detector/Detector.cpp - -HEADERS += Detector/Detector.hpp diff --git a/FastDecode.cpp b/FastDecode.cpp new file mode 100644 index 00000000..ad60f6e6 --- /dev/null +++ b/FastDecode.cpp @@ -0,0 +1,42 @@ +#include "FastDecode.hpp" +#include "wsjtx_config.h" +#include "DecDataMutex.hpp" + +#include +#include +#include +#include +#include +#include +#include + +extern "C" void fast_decode_ (short[], int[], double *, char[], char[], char[], + fortran_charlen_t, fortran_charlen_t, + fortran_charlen_t); + +QFuture startFastDecode (short const samples[], int const arguments[], + double period, char const myCall[], + char const hisCall[]) +{ + FastDecodeResult result; + std::copy_n (arguments, result.arguments.size (), result.arguments.begin ()); + std::array ownCall, dxCall; + std::copy_n (myCall, ownCall.size (), ownCall.begin ()); + std::copy_n (hisCall, dxCall.size (), dxCall.begin ()); + auto captured = std::make_shared> (360000, 0); + { + QMutexLocker lock {&dec_data_mutex ()}; + std::copy_n (samples, std::max (0, std::min (360000, arguments[1])), + captured->begin ()); + } + return QtConcurrent::run ([=] () mutable { + // fast_decode retains Fortran SAVE state between invocations. Independent + // sample ownership alone does not make concurrent decoder entry safe. + static QMutex decoderMutex; + QMutexLocker lock {&decoderMutex}; + fast_decode_ (captured->data (), result.arguments.data (), &period, + result.messages.data (), ownCall.data (), dxCall.data (), + fortran_charlen_t (8000), fortran_charlen_t (12), fortran_charlen_t (12)); + return result; + }); +} diff --git a/FastDecode.hpp b/FastDecode.hpp new file mode 100644 index 00000000..124dcfaa --- /dev/null +++ b/FastDecode.hpp @@ -0,0 +1,18 @@ +#ifndef FAST_DECODE_HPP +#define FAST_DECODE_HPP + +#include +#include + +struct FastDecodeResult +{ + std::array arguments {}; + std::array messages {}; +}; + +// Capture all inputs before returning; retrieve outputs only after completion. +QFuture startFastDecode (short const samples[], int const arguments[], + double period, char const myCall[], + char const hisCall[]); + +#endif diff --git a/FoxGuardBands.cpp b/FoxGuardBands.cpp new file mode 100644 index 00000000..18375e1f --- /dev/null +++ b/FoxGuardBands.cpp @@ -0,0 +1,54 @@ +#include "FoxGuardBands.hpp" + +#include + +namespace +{ + using Radio::Frequency; + + FoxGuardBands::Match no_match () + { + return {false, FoxGuardBands::GuardKind::None, 0}; + } +} + +namespace FoxGuardBands +{ + Match check (Frequency dial_frequency, + std::initializer_list standard_ft8_guards, + std::initializer_list wspr_guards) + { + for (auto guard_frequency : standard_ft8_guards) + { + auto const offset = static_cast (dial_frequency) - static_cast (guard_frequency); + if (qAbs (offset) < 3000) + { + return {true, GuardKind::StandardFT8, guard_frequency}; + } + } + + for (auto guard_frequency : wspr_guards) + { + auto const offset = static_cast (dial_frequency) - static_cast (guard_frequency); + if (offset > -3500 && offset < 300) + { + return {true, GuardKind::WSPR, guard_frequency}; + } + } + + return no_match (); + } + + Match check (Frequency dial_frequency) + { + return check (dial_frequency, + { + 1840000, 3573000, 7074000, 10136000, 14074000, 18100000, + 21074000, 24915000, 28074000, 50313000, 70154000 + }, + { + 1836600, 5364700, 3568600, 7038600, 10138700, 14095600, + 18104600, 21094600, 24924600, 28124600 + }); + } +} diff --git a/FoxGuardBands.hpp b/FoxGuardBands.hpp new file mode 100644 index 00000000..985e6bf3 --- /dev/null +++ b/FoxGuardBands.hpp @@ -0,0 +1,30 @@ +#ifndef FOX_GUARD_BANDS_HPP__ +#define FOX_GUARD_BANDS_HPP__ + +#include + +#include "Radio.hpp" + +namespace FoxGuardBands +{ + enum class GuardKind + { + None, + StandardFT8, + WSPR + }; + + struct Match + { + bool blocked; + GuardKind kind; + Radio::Frequency guard_frequency; + }; + + Match check (Radio::Frequency dial_frequency, + std::initializer_list standard_ft8_guards, + std::initializer_list wspr_guards); + Match check (Radio::Frequency dial_frequency); +} + +#endif diff --git a/FoxOperatorActions.hpp b/FoxOperatorActions.hpp new file mode 100644 index 00000000..d104b6a2 --- /dev/null +++ b/FoxOperatorActions.hpp @@ -0,0 +1,71 @@ +#ifndef FOX_OPERATOR_ACTIONS_HPP +#define FOX_OPERATOR_ACTIONS_HPP + +#include +#include + +namespace FoxOperatorActions +{ + inline QString callsign (QString const& line) + { + return line.left (12).trimmed (); + } + + inline int queuedHoundIndex (QQueue const& queue, QString const& line) + { + auto const target = callsign (line); + if (target.isEmpty ()) return -1; + + for (int index = 0; index < queue.size (); ++index) + { + if (callsign (queue.at (index)) == target) return index; + } + return -1; + } + + inline bool moveQueuedHoundToFront (QQueue& queue, QString const& line) + { + auto const index = queuedHoundIndex (queue, line); + if (index < 0) return false; + + if (index > 0) + { + auto const live_line = queue.takeAt (index); + queue.prepend (live_line); + } + return true; + } + + inline bool removeQueuedHound (QQueue& queue, QString const& line) + { + auto const target = callsign (line); + if (target.isEmpty ()) return false; + + bool removed {false}; + for (int index = queue.size () - 1; index >= 0; --index) + { + if (callsign (queue.at (index)) == target) + { + queue.removeAt (index); + removed = true; + } + } + return removed; + } + + template + bool timeoutIfActive (QQueue const& in_progress, QsoMap& qsos, + QString const& line, int timeout_value) + { + auto const target = callsign (line); + if (target.isEmpty () || !in_progress.contains (target)) return false; + + auto qso = qsos.find (target); + if (qso == qsos.end ()) return false; + + qso.value ().ncall = timeout_value; + return true; + } +} + +#endif // FOX_OPERATOR_ACTIONS_HPP diff --git a/Ft8MtdDecodeCoordinator.cpp b/Ft8MtdDecodeCoordinator.cpp new file mode 100644 index 00000000..f314f65a --- /dev/null +++ b/Ft8MtdDecodeCoordinator.cpp @@ -0,0 +1,74 @@ +#include "Ft8MtdDecodeCoordinator.hpp" + +Ft8MtdDecodeCoordinator::Decision Ft8MtdDecodeCoordinator::request ( + Stage stage, qint64 period, int earlyStageCount, bool decoderBusy) +{ + return scheduler_.request (stage, period, earlyStageCount, decoderBusy, + hasPending ()); +} + +bool Ft8MtdDecodeCoordinator::published (Stage stage, qint64 period) +{ + return scheduler_.published (stage, period); +} + +void Ft8MtdDecodeCoordinator::completed (Stage stage, qint64 period) +{ + scheduler_.completed (stage, period); +} + +void Ft8MtdDecodeCoordinator::publicationFailed (Stage stage, qint64 period) +{ + scheduler_.publicationFailed (stage, period); +} + +Ft8MtdDecodeCoordinator::Action Ft8MtdDecodeCoordinator::deferFinal ( + std::unique_ptr pending) +{ + Q_ASSERT (pending); + Q_ASSERT (8 == pending->payload.params.nmode); + Q_ASSERT (pending->payload.params.lmultift8); + auto const action = pending_ ? Action::ReplaceFinal : Action::DeferFinal; + pending_ = std::move (pending); + return action; +} + +Ft8MtdDecodeCoordinator::DrainOutcome Ft8MtdDecodeCoordinator::drainPending ( + PendingValidator const& validator, PendingPublisher const& publisher) +{ + if (!pending_) return {}; + + auto pending = std::move (pending_); + DrainOutcome outcome; + outcome.period = pending->period; + if (!validator (*pending)) + { + scheduler_.cancel (); + outcome.result = DrainResult::Obsolete; + return outcome; + } + + switch (publisher (*pending)) + { + case PendingPublishResult::Published: + outcome.result = DrainResult::Published; + outcome.recovered = scheduler_.published (Stage::Final, pending->period); + return outcome; + case PendingPublishResult::Unavailable: + pending_ = std::move (pending); + outcome.result = DrainResult::Retained; + return outcome; + case PendingPublishResult::Failed: + scheduler_.publicationFailed (Stage::Final, pending->period); + outcome.result = DrainResult::Failed; + return outcome; + } + + return outcome; +} + +void Ft8MtdDecodeCoordinator::cancel () +{ + scheduler_.cancel (); + pending_.reset (); +} diff --git a/Ft8MtdDecodeCoordinator.hpp b/Ft8MtdDecodeCoordinator.hpp new file mode 100644 index 00000000..56e6a70b --- /dev/null +++ b/Ft8MtdDecodeCoordinator.hpp @@ -0,0 +1,75 @@ +#ifndef FT8_MTD_DECODE_COORDINATOR_HPP +#define FT8_MTD_DECODE_COORDINATOR_HPP + +#include +#include + +#include + +#include "DecodeOperatingContext.hpp" +#include "DecoderIpc.hpp" +#include "Ft8MtdDecodeScheduler.hpp" + +class Ft8MtdDecodeCoordinator +{ +public: + using Stage = Ft8MtdDecodeScheduler::Stage; + using Action = Ft8MtdDecodeScheduler::Action; + using Decision = Ft8MtdDecodeScheduler::Decision; + + struct PendingMtdDecode + { + DecoderIpc::Ft8MtdPayload payload; + DecodeOperatingContext context; + qint64 period {0}; + }; + + enum class PendingPublishResult + { + Published, + Unavailable, + Failed + }; + + enum class DrainResult + { + NoPending, + Published, + Retained, + Obsolete, + Failed + }; + + struct DrainOutcome + { + DrainResult result {DrainResult::NoPending}; + qint64 period {0}; + bool recovered {false}; + }; + + using PendingValidator = std::function; + using PendingPublisher = + std::function; + + Decision request (Stage stage, qint64 period, int earlyStageCount, + bool decoderBusy); + bool published (Stage stage, qint64 period); + void completed (Stage stage, qint64 period); + void publicationFailed (Stage stage, qint64 period); + + Action deferFinal (std::unique_ptr pending); + DrainOutcome drainPending (PendingValidator const& validator, + PendingPublisher const& publisher); + void cancel (); + + bool hasPending () const {return bool {pending_};} + bool degraded () const {return scheduler_.degraded ();} + int skippedPeriods () const {return scheduler_.skippedPeriods ();} + qint64 nextProbePeriod () const {return scheduler_.nextProbePeriod ();} + +private: + Ft8MtdDecodeScheduler scheduler_; + std::unique_ptr pending_; +}; + +#endif diff --git a/Ft8MtdDecodeScheduler.cpp b/Ft8MtdDecodeScheduler.cpp new file mode 100644 index 00000000..875b2801 --- /dev/null +++ b/Ft8MtdDecodeScheduler.cpp @@ -0,0 +1,153 @@ +#include "Ft8MtdDecodeScheduler.hpp" + +#include + +constexpr int Ft8MtdDecodeScheduler::BackoffPeriods[]; + +Ft8MtdDecodeScheduler::Decision Ft8MtdDecodeScheduler::request ( + Stage stage, qint64 period, int earlyStageCount, bool decoderBusy, + bool finalAlreadyPending) +{ + Decision result; + recoverOnFinalPublish_ = false; + + if (Stage::None == stage) return result; + + if (Stage::Final == stage) + { + if (decoderBusy) + { + auto const wasDegraded = degraded_; + auto const failedProbe = probePeriod_ == period + && !probeComplete (period); + degrade (period, wasDegraded && failedProbe); + result.enteredDegraded = !wasDegraded; + result.action = finalAlreadyPending ? Action::ReplaceFinal + : Action::DeferFinal; + result.skippedPeriods = skippedPeriods (); + return result; + } + + recoverOnFinalPublish_ = degraded_ + && (0 == earlyStageCount || probeComplete (period)); + return result; + } + + if (!degraded_) + { + if (!decoderBusy) return result; + degrade (period, false); + result.enteredDegraded = true; + result.action = Action::SkipEarly; + result.skippedPeriods = skippedPeriods (); + return result; + } + + if (Stage::EarlyOne == stage) + { + if (period < nextProbePeriod_) + { + result.action = Action::SkipEarly; + result.skippedPeriods = skippedPeriods (); + return result; + } + if (decoderBusy) + { + degrade (period, true); + result.action = Action::SkipEarly; + result.skippedPeriods = skippedPeriods (); + return result; + } + probePeriod_ = period; + probeEarlyStageCount_ = std::max (earlyStageCount, 1); + completedEarlyStages_ = 0; + return result; + } + + auto const precedingStageCompleted = probePeriod_ == period + && completedEarlyStages_ >= 1; + if (!precedingStageCompleted || decoderBusy) + { + if (probePeriod_ == period) degrade (period, true); + result.action = Action::SkipEarly; + result.skippedPeriods = skippedPeriods (); + } + return result; +} + +bool Ft8MtdDecodeScheduler::published (Stage stage, qint64) +{ + if (Stage::Final != stage || !recoverOnFinalPublish_) return false; + + degraded_ = false; + backoffIndex_ = 0; + nextProbePeriod_ = 0; + recoverOnFinalPublish_ = false; + clearProbe (); + return true; +} + +void Ft8MtdDecodeScheduler::completed (Stage stage, qint64 period) +{ + if (period != probePeriod_) return; + if (Stage::EarlyOne == stage) + { + completedEarlyStages_ = std::max (completedEarlyStages_, 1); + } + else if (Stage::EarlyTwo == stage && completedEarlyStages_ >= 1) + { + completedEarlyStages_ = std::max (completedEarlyStages_, 2); + } +} + +void Ft8MtdDecodeScheduler::publicationFailed (Stage stage, qint64 period) +{ + if (period == probePeriod_ && Stage::Final != stage) + { + degrade (period, true); + } + recoverOnFinalPublish_ = false; +} + +void Ft8MtdDecodeScheduler::cancel () +{ + degraded_ = false; + backoffIndex_ = 0; + nextProbePeriod_ = 0; + recoverOnFinalPublish_ = false; + clearProbe (); +} + +int Ft8MtdDecodeScheduler::skippedPeriods () const +{ + return degraded_ ? BackoffPeriods[backoffIndex_] : 0; +} + +void Ft8MtdDecodeScheduler::degrade (qint64 period, bool advance) +{ + if (!degraded_) + { + degraded_ = true; + backoffIndex_ = 0; + } + else if (advance) + { + backoffIndex_ = std::min (backoffIndex_ + 1, BackoffCount - 1); + } + nextProbePeriod_ = period + BackoffPeriods[backoffIndex_] + 1; + recoverOnFinalPublish_ = false; + clearProbe (); +} + +bool Ft8MtdDecodeScheduler::probeComplete (qint64 period) const +{ + return probePeriod_ == period + && completedEarlyStages_ >= probeEarlyStageCount_; +} + +void Ft8MtdDecodeScheduler::clearProbe () +{ + probePeriod_ = -1; + probeEarlyStageCount_ = 0; + completedEarlyStages_ = 0; +} diff --git a/Ft8MtdDecodeScheduler.hpp b/Ft8MtdDecodeScheduler.hpp new file mode 100644 index 00000000..93f080aa --- /dev/null +++ b/Ft8MtdDecodeScheduler.hpp @@ -0,0 +1,66 @@ +#ifndef FT8_MTD_DECODE_SCHEDULER_HPP +#define FT8_MTD_DECODE_SCHEDULER_HPP + +#include + +class Ft8MtdDecodeScheduler +{ +public: + static bool supportsBackpressure (bool multithreadedFt8, + bool standardFinalRequired) + { + return multithreadedFt8 && !standardFinalRequired; + } + + enum class Stage + { + None, + EarlyOne, + EarlyTwo, + Final + }; + + enum class Action + { + Publish, + SkipEarly, + DeferFinal, + ReplaceFinal + }; + + struct Decision + { + Action action {Action::Publish}; + bool enteredDegraded {false}; + int skippedPeriods {0}; + }; + + Decision request (Stage stage, qint64 period, int earlyStageCount, + bool decoderBusy, bool finalAlreadyPending); + bool published (Stage stage, qint64 period); + void completed (Stage stage, qint64 period); + void publicationFailed (Stage stage, qint64 period); + void cancel (); + + bool degraded () const {return degraded_;} + int skippedPeriods () const; + qint64 nextProbePeriod () const {return nextProbePeriod_;} + +private: + static constexpr int BackoffCount {4}; + static constexpr int BackoffPeriods[BackoffCount] {1, 2, 4, 8}; + + void degrade (qint64 period, bool advance); + bool probeComplete (qint64 period) const; + void clearProbe (); + + bool degraded_ {false}; + int backoffIndex_ {0}; + qint64 nextProbePeriod_ {0}; + qint64 probePeriod_ {-1}; + int probeEarlyStageCount_ {0}; + int completedEarlyStages_ {0}; + bool recoverOnFinalPublish_ {false}; +}; + +#endif diff --git a/Ft8TxLoopbackTestController.cpp b/Ft8TxLoopbackTestController.cpp new file mode 100644 index 00000000..d2b855c9 --- /dev/null +++ b/Ft8TxLoopbackTestController.cpp @@ -0,0 +1,393 @@ +#include "Ft8TxLoopbackTestController.hpp" + +#include "Audio/BWFFile.hpp" +#include "Audio/FixtureSoundOutput.hpp" +#include "widgets/mainwindow.h" + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "moc_Ft8TxLoopbackTestController.cpp" + +namespace +{ + constexpr int sampleRate = 48000; + constexpr qint64 periodFrames = 15 * sampleRate; + constexpr qint64 expectedFirstAudioFrame = sampleRate / 2; + // Raised-cosine shaping can delay the first nonzero sample slightly. + constexpr qint64 firstAudioToleranceFrames = sampleRate / 100; + constexpr int bytesPerFrame = 2; + constexpr qint64 periodMs = 15000; + constexpr qint64 startTriggerOffsetMs = 25; +} + +Ft8TxLoopbackTestController::Ft8TxLoopbackTestController ( + MainWindow * window, FixtureSoundOutput * output, QString capturePath, + QObject * parent) + : QObject {parent} + , m_window {window} + , m_output {output} + , m_capturePath {std::move (capturePath)} +{ + m_timeout.setSingleShot (true); + m_timeout.setInterval (60000); + connect (&m_timeout, &QTimer::timeout, this, [this] { + fail (tr ("Timed out after 60 seconds.")); + }); + + m_prepareTimer.setSingleShot (true); + connect (&m_prepareTimer, &QTimer::timeout, + this, &Ft8TxLoopbackTestController::prepareWhenReady); + + m_startTimer.setSingleShot (true); + m_startTimer.setTimerType (Qt::PreciseTimer); + connect (&m_startTimer, &QTimer::timeout, + this, &Ft8TxLoopbackTestController::startWhenScheduled); + connect (m_window, &MainWindow::liveAudioTestFt8TransmitStartDecided, + this, &Ft8TxLoopbackTestController::handleStartDecision); + + m_modalTimer.setInterval (100); + connect (&m_modalTimer, &QTimer::timeout, + this, &Ft8TxLoopbackTestController::checkForUnexpectedModal); + + connect (m_output, &FixtureSoundOutput::captureStarted, + this, [this] (QString const& path) { + ++m_captureStartCount; + if (path != m_capturePath) + { + fail (tr ("Synthetic output opened the wrong capture path: %1") + .arg (path)); + return; + } + if (m_captureStartCount != 1 || m_output->restartCount () != 1) + { + fail (tr ("The FT8 output stream did not start exactly once.")); + return; + } + auto * autoButton = + m_window->findChild ("autoButton"); + if (!autoButton) + { + fail (tr ("The FT8 Auto control was not found.")); + return; + } + if (autoButton->isChecked ()) autoButton->click (); + m_autoDisabledDuringTransmit = !autoButton->isChecked () + && m_output->stopCount () == 0; + if (!m_autoDisabledDuringTransmit) + { + fail (tr ("Disabling Auto stopped the active FT8 transmission.")); + } + }); + connect (m_output, &FixtureSoundOutput::nonSilentAudioStarted, + this, [this] (qint64 frame) { + if (m_firstNonSilentFrame >= 0) + { + fail (tr ("Synthetic output reported non-silent FT8 audio more than once.")); + return; + } + m_firstNonSilentFrame = frame; + }); + connect (m_output, &FixtureSoundOutput::captureStopped, + this, [this] (QString const& path, qint64 frames) { + ++m_captureStopCount; + m_capturedFrames = frames; + if (path != m_capturePath || m_captureStopCount != 1) + { + fail (tr ("The FT8 capture did not stop exactly once at the requested path.")); + return; + } + maybeFinish (); + }); + connect (m_output, &FixtureSoundOutput::captureFailed, + this, [this] (QString const& reason) { + fail (tr ("Synthetic audio output failed: %1").arg (reason)); + }); +} + +void Ft8TxLoopbackTestController::begin () +{ + m_timeout.start (); + m_modalTimer.start (); + prepareWhenReady (); +} + +void Ft8TxLoopbackTestController::prepareWhenReady () +{ + if (m_finished || m_prepared) return; + + auto * ft8Action = m_window->findChild ("actionFT8"); + auto * txFrequency = m_window->findChild ("TxFreqSpinBox"); + auto * tx6 = m_window->findChild ("tx6"); + auto * txb6 = m_window->findChild ("txb6"); + auto * txFirst = m_window->findChild ("txFirstCheckBox"); + auto * autoButton = m_window->findChild ("autoButton"); + if (!ft8Action || !txFrequency || !tx6 || !txb6 || !txFirst || !autoButton) + { + fail (tr ("A required FT8 transmit GUI control was not found.")); + return; + } + if (!ft8Action->isEnabled () || !txb6->isEnabled () || !autoButton->isEnabled ()) + { + m_prepareTimer.start (50); + return; + } + + ft8Action->trigger (); + if (!ft8Action->isChecked ()) + { + fail (tr ("The application did not enter FT8 mode.")); + return; + } + if (autoButton->isChecked ()) autoButton->click (); + txFrequency->setValue (1500); + tx6->setText (QStringLiteral ("CQ KA1ABC FN42")); + QMetaObject::invokeMethod (tx6, "editingFinished", Qt::DirectConnection); + txb6->click (); + + auto const scheduleNow = QDateTime::currentMSecsSinceEpoch (); + auto const untilNextPeriod = periodMs - scheduleNow % periodMs; + if (untilNextPeriod < 1000) + { + m_prepareTimer.start (static_cast (untilNextPeriod + 50)); + return; + } + + auto const nextPeriod = scheduleNow / periodMs + 1; + txFirst->setChecked ((nextPeriod % 2) == 0); + autoButton->click (); + if (!autoButton->isChecked () || txFrequency->value () != 1500 + || tx6->text () != QStringLiteral ("CQ KA1ABC FN42")) + { + fail (tr ("Unable to configure the requested FT8 transmission.")); + return; + } + + m_targetPeriodStartMs = nextPeriod * periodMs; + auto const targetStart = m_targetPeriodStartMs + startTriggerOffsetMs; + auto const startDelay = targetStart + - QDateTime::currentMSecsSinceEpoch (); + if (startDelay <= 0) + { + if (autoButton->isChecked ()) autoButton->click (); + m_prepareTimer.start (50); + return; + } + m_startTimer.start (static_cast (startDelay)); + + m_prepared = true; + ++m_startAttemptCount; + std::cerr << "WSJT-X FT8 TX loopback test: GUI ready, message=\"CQ KA1ABC FN42\" " + "frequency=1500 next_period=" + << nextPeriod << " tx_first=" << txFirst->isChecked () << std::endl; +} + +void Ft8TxLoopbackTestController::startWhenScheduled () +{ + if (m_finished) return; + + m_startCallbackMs = QDateTime::currentMSecsSinceEpoch (); + if (m_startCallbackMs < m_targetPeriodStartMs) + { + m_startTimer.start (static_cast ( + m_targetPeriodStartMs - m_startCallbackMs)); + return; + } + + auto * tx6 = m_window->findChild ("tx6"); + auto * txb6 = m_window->findChild ("txb6"); + auto * autoButton = m_window->findChild ("autoButton"); + if (!tx6 || !txb6 || !autoButton) + { + fail (tr ("The FT8 transmit controls disappeared before transmission.")); + return; + } + tx6->setText (QStringLiteral ("CQ KA1ABC FN42")); + QMetaObject::invokeMethod (tx6, "editingFinished", Qt::DirectConnection); + txb6->click (); + + auto const request = m_window->startLiveAudioTestFt8Transmit ( + m_targetPeriodStartMs); + if (request.session_id < 0 || request.generation < 0) + { + fail (tr ("Unable to start the synthetic FT8 transmission.")); + return; + } + m_startSessionId = request.session_id; + m_startGeneration = request.generation; +} + +void Ft8TxLoopbackTestController::handleStartDecision ( + qint64 sessionId, qint64 generation, qint64 targetPeriodStartMs, + bool accepted, qint64 actualStartMs) +{ + if (m_finished || sessionId != m_startSessionId + || generation != m_startGeneration + || targetPeriodStartMs != m_targetPeriodStartMs) + { + return; + } + + m_startDecidedMs = actualStartMs; + if (accepted) + { + std::cerr << "WSJT-X FT8 TX loopback start: attempt=" + << m_startAttemptCount + << " callback_offset_ms=" + << m_startCallbackMs - m_targetPeriodStartMs + << " audio_decision_offset_ms=" + << m_startDecidedMs - m_targetPeriodStartMs << std::endl; + return; + } + + auto * autoButton = m_window->findChild ("autoButton"); + if (!autoButton) + { + fail (tr ("The FT8 Auto control disappeared before retry.")); + return; + } + if (autoButton->isChecked ()) autoButton->click (); + std::cerr << "WSJT-X FT8 TX loopback retry: attempt=" + << m_startAttemptCount + << " callback_offset_ms=" + << m_startCallbackMs - m_targetPeriodStartMs + << " audio_decision_offset_ms=" + << m_startDecidedMs - m_targetPeriodStartMs << std::endl; + m_prepared = false; + m_prepareTimer.start (50); +} + +void Ft8TxLoopbackTestController::maybeFinish () +{ + if (m_finished || m_captureStopCount != 1) return; + if (!m_prepared || m_captureStartCount != 1 || m_firstNonSilentFrame < 0 + || !m_autoDisabledDuringTransmit || m_output->restartCount () != 1 + || m_output->stopCount () != 1) + { + fail (tr ("The FT8 output lifecycle was not one start, non-silent transmission, and natural stop.")); + return; + } + if (qAbs (m_firstNonSilentFrame - expectedFirstAudioFrame) + > firstAudioToleranceFrames) + { + fail (tr ("FT8 audio began at frame %1; expected %2 +/- %3 frames.") + .arg (m_firstNonSilentFrame).arg (expectedFirstAudioFrame) + .arg (firstAudioToleranceFrames)); + return; + } + + QString captureError; + if (!validateCapture (&captureError)) + { + fail (captureError); + return; + } + + m_finished = true; + m_succeeded = true; + m_timeout.stop (); + m_prepareTimer.stop (); + m_startTimer.stop (); + m_modalTimer.stop (); + std::cout << "WSJT-X FT8 TX loopback capture passed: restarts=" + << m_output->restartCount () << " stops=" << m_output->stopCount () + << " first_non_silent_frame=" << m_firstNonSilentFrame + << " start_attempts=" << m_startAttemptCount + << " callback_offset_ms=" + << m_startCallbackMs - m_targetPeriodStartMs + << " audio_decision_offset_ms=" + << m_startDecidedMs - m_targetPeriodStartMs + << " frames=" << m_capturedFrames + << " capture=" << m_capturePath.toStdString () << std::endl; + m_window->close (); + QCoreApplication::exit (EXIT_SUCCESS); +} + +bool Ft8TxLoopbackTestController::validateCapture (QString * error) const +{ + QFileInfo const info {m_capturePath}; + if (!info.isFile () || info.size () <= 0) + { + *error = tr ("The FT8 capture file was not created or is empty: %1") + .arg (m_capturePath); + return false; + } + BWFFile capture {QAudioFormat {}, m_capturePath}; + if (!capture.open (BWFFile::ReadOnly)) + { + *error = tr ("Unable to reopen FT8 capture %1: %2") + .arg (m_capturePath, capture.errorString ()); + return false; + } + auto const& format = capture.format (); + if (format.codec () != QStringLiteral ("audio/pcm") + || format.sampleRate () != sampleRate || format.channelCount () != 1 + || format.sampleSize () != 16 + || format.sampleType () != QAudioFormat::SignedInt + || format.byteOrder () != QAudioFormat::LittleEndian) + { + *error = tr ("The FT8 capture is not 48 kHz mono signed 16-bit little-endian PCM."); + return false; + } + if (capture.size () != periodFrames * bytesPerFrame + || m_capturedFrames != periodFrames) + { + *error = tr ("The FT8 capture must contain exactly %1 frames; file=%2 reported=%3.") + .arg (periodFrames).arg (capture.size () / bytesPerFrame) + .arg (m_capturedFrames); + return false; + } + return true; +} + +void Ft8TxLoopbackTestController::fail (QString const& reason) +{ + if (m_finished) return; + m_finished = true; + m_timeout.stop (); + m_prepareTimer.stop (); + m_startTimer.stop (); + m_modalTimer.stop (); + std::cerr << "WSJT-X FT8 TX loopback capture failed: " << reason.toStdString () + << " capture_starts=" << m_captureStartCount + << " capture_stops=" << m_captureStopCount + << " restarts=" << m_output->restartCount () + << " stops=" << m_output->stopCount () + << " start_attempts=" << m_startAttemptCount + << " callback_offset_ms=" + << m_startCallbackMs - m_targetPeriodStartMs + << " audio_decision_offset_ms=" + << m_startDecidedMs - m_targetPeriodStartMs + << " frames=" << m_capturedFrames << std::endl; + if (auto * modal = QApplication::activeModalWidget ()) modal->close (); + m_window->close (); + QCoreApplication::exit (EXIT_FAILURE); +} + +void Ft8TxLoopbackTestController::checkForUnexpectedModal () +{ + if (auto * modal = QApplication::activeModalWidget ()) + { + auto detail = modal->windowTitle (); + if (auto const * messageBox = qobject_cast (modal)) + { + detail = messageBox->text (); + if (!messageBox->informativeText ().isEmpty ()) + { + detail += QStringLiteral (" ") + messageBox->informativeText (); + } + } + fail (tr ("Unexpected modal window: %1").arg (detail)); + } +} diff --git a/Ft8TxLoopbackTestController.hpp b/Ft8TxLoopbackTestController.hpp new file mode 100644 index 00000000..de80ac26 --- /dev/null +++ b/Ft8TxLoopbackTestController.hpp @@ -0,0 +1,60 @@ +// -*- Mode: C++ -*- +#ifndef FT8_TX_LOOPBACK_TEST_CONTROLLER_HPP__ +#define FT8_TX_LOOPBACK_TEST_CONTROLLER_HPP__ + +#include +#include +#include + +class FixtureSoundOutput; +class MainWindow; + +class Ft8TxLoopbackTestController final + : public QObject +{ + Q_OBJECT + +public: + Ft8TxLoopbackTestController (MainWindow * window, + FixtureSoundOutput * output, + QString capturePath, + QObject * parent = nullptr); + + void begin (); + bool succeeded () const {return m_succeeded;} + +private: + void prepareWhenReady (); + void startWhenScheduled (); + void handleStartDecision (qint64 sessionId, qint64 generation, + qint64 targetPeriodStartMs, bool accepted, + qint64 actualStartMs); + void maybeFinish (); + bool validateCapture (QString * error) const; + void fail (QString const& reason); + void checkForUnexpectedModal (); + + MainWindow * m_window; + FixtureSoundOutput * m_output; + QString m_capturePath; + QTimer m_timeout; + QTimer m_prepareTimer; + QTimer m_startTimer; + QTimer m_modalTimer; + qint64 m_targetPeriodStartMs {0}; + qint64 m_startSessionId {-1}; + qint64 m_startGeneration {-1}; + qint64 m_startCallbackMs {-1}; + qint64 m_startDecidedMs {-1}; + qint64 m_firstNonSilentFrame {-1}; + qint64 m_capturedFrames {0}; + int m_captureStartCount {0}; + int m_captureStopCount {0}; + int m_startAttemptCount {0}; + bool m_prepared {false}; + bool m_autoDisabledDuringTransmit {false}; + bool m_finished {false}; + bool m_succeeded {false}; +}; + +#endif diff --git a/HelpText.cpp b/HelpText.cpp new file mode 100644 index 00000000..d450c771 --- /dev/null +++ b/HelpText.cpp @@ -0,0 +1,209 @@ +#include "HelpText.hpp" +#include + +namespace Radio +{ + +QString HelpText::keyboardShortcuts() +{ + return QCoreApplication::translate("MainWindow", R"( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Esc Stop Tx, abort QSO, clear next-call queue
F1 Online User's Guide (Alt: transmit Tx6)
Shift+F1 Copyright Notice
Ctrl+F1 About WSJT-X
F2 Open settings window (Alt: transmit Tx2)
F3 Display keyboard shortcuts (Alt: transmit Tx3)
F4 Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)
Alt+F4 Exit program
F5 Display special mouse commands (Alt: transmit Tx5)
F6 Open next file in directory (Alt: cycle CQ response mode)
Shift+F6 Decode all remaining files in directory
F7 Display Message Averaging window
F11 Move Rx frequency down 1 Hz
Ctrl+F11 Move identical Rx and Tx frequencies down 1 Hz
Shift+F11 Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)
Ctrl+Shift+F11 Move dial frequency down 1000 Hz
F12 Move Rx frequency up 1 Hz
Ctrl+F12 Move identical Rx and Tx frequencies up 1 Hz
Shift+F12 Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)
Ctrl+Shift+F12 Move dial frequency up 1000 Hz
Alt+1-6 Set now transmission to this number on Tab 1
Ctl+1-6 Set next transmission to this number on Tab 1
Alt+A Clear Active Stations for QMAP
Alt+B Toggle "Best S+P" status
Alt+C Cycle CQ response mode
Alt+D Decode again at QSO frequency
Shift+D Full decode (both windows)
Ctrl+E Turn on TX even/1st
Shift+E Turn off TX even/1st
Alt+E Erase
Ctrl+F Edit the free text message box
Alt+G Generate standard messages
Alt+H Halt Tx
Ctrl+I Add Dx Call to the Ignore List
Ctrl+L Lookup callsign in database, generate standard messages
Alt+M Monitor
Alt+N Toggle "Enable Tx"
Ctrl+O Open a .wav file
Alt+O Change operator
Alt+Q Open "Log QSO" window
Ctrl+R Set Tx4 message to RRR (not in FT4)
Alt+R Set Tx4 message to RR73
Ctrl+Shift+R Refresh Active Stations window
Alt+S Stop monitoring
Alt+T Toggle Tune status
Ctrl+X Open next file in directory
Alt+x Decode all remaining files in directory
Alt+Z Clear hung decoder status
)"); +} + +QString HelpText::specialMouseCommands() +{ + return QCoreApplication::translate("MainWindow", R"( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Click onAction
Waterfall:Click to set Rx frequency.
+ Right-click to set Tx frequency.
+ Double-right-click to set Rx and Tx frequencies. +
Decoded text:Double-click to copy second callsign to Dx Call, locator to Dx Grid, change Rx
+ and Tx frequency to decoded signal's frequency, and generate standard messages.
+ Hold down Alt to prevent Tx from being enabled on double-click.
+ If Hold Tx Freq is checked or first callsign in message is your
+ own call, Tx frequency is not changed unless Ctrl is held down. +
Dial Frequency:Turn the mouse wheel to change the kHz values, or:
+ Right-click to increase frequency by 1 kHz.
+ Left-click to decrease frequency by 1 kHz.
+ The mouse pointer must be over the Dial Frequency indicator. +
H Button:Click to toggle FT8 Hound Mode On/Off.
+ Right-click to activate or deactivate SuperFox mode. +
FT8 Button:Click to switch to FT8 Hound Mode.
+ Right-click to toggle last used Special Operating Activity On/Off. +
Q65 Button:Click to switch to Q65 Mode.
+ Right-click to switch to Q65 Pileup Mode. +
JT65 Button:Click to switch to JT65 Mode.
+ Right-click to switch to JT9 Mode. +
Tx5 Button:Right-click to retain Tx5 free text. +
Tx Even/1st:Right-click to toggle the checkbox enabled/disabled.
+ Fox and Hound modes lock the required sequence. +
Enable Tx Button:Click to toggle Auto-Tx mode On/Off.
+ Right-click to toggle Wait & Pounce On/Off after selecting
+ any CQ response mode other than CQ: None. +
Erase button:Click to erase Rx Frequency window.
+ Double-click to erase Rx Frequency and Band Activity windows.
+ If Alternate Erase button behavior is checked:
+ Click to erase Band Activity window.
+ Right-click to erase Rx Frequency window.
+ Double-click to erase Rx Frequency and Band Activity windows. +
DX Call Button:Click to toggle Wait & Call On/Off.
+ Right-click to clear the Dx Call, Dx Grid and Std Msgs. +
Lookup Button:Click to search for callsign in database.
+ Right-click to search for Dx Call on qrz.com. +
Add Button:Click to add callsign and locator to database.
+ Right-click to search for Dx Call on hamqth.com. +
Ignore Button:Click to add callsign to the Ignore List.
+ Right-click to search for Dx Call on qrzcq.com. +
Band Buttons:Click to toggle band / mode default frequencies.
+ Right-click to toggle FT8 DXpedition frequencies. +
)"); +} + +QString HelpText::prefixes() +{ + return QCoreApplication::translate("MainWindow", R"(Type 1 Prefixes: + + 1A 1S 3A 3B6 3B8 3B9 3C 3C0 3D2 3D2C 3D2R 3DA 3V 3W 3X + 3Y 3YB 3YP 4J 4L 4S 4U1I 4U1U 4W 4X 5A 5B 5H 5N 5R + 5T 5U 5V 5W 5X 5Z 6W 6Y 7O 7P 7Q 7X 8P 8Q 8R + 9A 9G 9H 9J 9K 9L 9M2 9M6 9N 9Q 9U 9V 9X 9Y A2 + A3 A4 A5 A6 A7 A9 AP BS7 BV BV9 BY C2 C3 C5 C6 + C9 CE CE0X CE0Y CE0Z CE9 CM CN CP CT CT3 CU CX CY0 CY9 + D2 D4 D6 DL DU E3 E4 EA EA6 EA8 EA9 EI EK EL EP + ER ES ET EU EX EY EZ F FG FH FJ FK FKC FM FO + FOA FOC FOM FP FR FRG FRJ FRT FT5W FT5X FT5Z FW FY M MD + MI MJ MM MU MW H4 H40 HA HB HB0 HC HC8 HH HI HK + HK0A HK0M HL HM HP HR HS HV HZ I IS IS0 J2 J3 J5 + J6 J7 J8 JA JDM JDO JT JW JX JY K KG4 KH0 KH1 KH2 + KH3 KH4 KH5 KH5K KH6 KH7 KH8 KH9 KL KP1 KP2 KP4 KP5 LA LU + LX LY LZ OA OD OE OH OH0 OJ0 OK OM ON OX OY OZ + P2 P4 PA PJ2 PJ7 PY PY0F PT0S PY0T PZ R1F R1M S0 S2 S5 + S7 S9 SM SP ST SU SV SVA SV5 SV9 T2 T30 T31 T32 T33 + T5 T7 T8 T9 TA TF TG TI TI9 TJ TK TL TN TR TT + TU TY TZ UA UA2 UA9 UK UN UR V2 V3 V4 V5 V6 V7 + V8 VE VK VK0H VK0M VK9C VK9L VK9M VK9N VK9W VK9X VP2E VP2M VP2V VP5 + VP6 VP6D VP8 VP8G VP8H VP8O VP8S VP9 VQ9 VR VU VU4 VU7 XE XF4 + XT XU XW XX9 XZ YA YB YI YJ YK YL YN YO YS YU + YV YV0 Z2 Z3 ZA ZB ZC4 ZD7 ZD8 ZD9 ZF ZK1N ZK1S ZK2 ZK3 + ZL ZL7 ZL8 ZL9 ZP ZS ZS8 KC4 E5 + +Type 1 Suffixes: /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /P)"); +} + +} diff --git a/HelpText.hpp b/HelpText.hpp new file mode 100644 index 00000000..bbe5784b --- /dev/null +++ b/HelpText.hpp @@ -0,0 +1,17 @@ +#ifndef HELPTEXT_HPP +#define HELPTEXT_HPP + +#include + +namespace Radio +{ + class HelpText + { + public: + static QString keyboardShortcuts(); + static QString specialMouseCommands(); + static QString prefixes(); + }; +} + +#endif // HELPTEXT_HPP diff --git a/HighlightingRules.cpp b/HighlightingRules.cpp new file mode 100644 index 00000000..495fee42 --- /dev/null +++ b/HighlightingRules.cpp @@ -0,0 +1,53 @@ +#include "HighlightingRules.hpp" + +#include +#include + +namespace HighlightingRules +{ + namespace + { + // True if `token` + `delimiter` occurs in `entries` starting at the + // beginning of the string or right after a previous entry's own ',' + // or ';' terminator -- so an unrelated, longer configured entry (e.g. + // "AK1ABC,") can't spuriously match as a substring tail of a lookup + // for "K1ABC", and so the first entry in a list matches even when (per + // the documented format, e.g. "VK;ZL;T88;") it has no delimiter before it. + bool containsDelimitedToken (QString const& entries, QString const& token, QChar delimiter) + { + QRegularExpression const re (QStringLiteral ("(?:^|[,;])") + + QRegularExpression::escape (token) + QRegularExpression::escape (delimiter)); + return re.match (entries).hasMatch (); + } + } + + bool matchesDirectionalCall (QString const& configured_entries, + QString const& directional_call) + { + auto const wanted = directional_call.trimmed (); + if (wanted.isEmpty ()) return false; + + for (auto const& entry : configured_entries.split (',')) + { + if (entry.trimmed ().compare (wanted, Qt::CaseInsensitive) == 0) return true; + } + + return false; + } + + bool matchesCallsignPrefix (QString const& configured_entries, QString const& call) + { + if (call.size () < 3) return false; + + bool const matched = + containsDelimitedToken (configured_entries, call, ',') + || containsDelimitedToken (configured_entries, call.left (3), ';') + || containsDelimitedToken (configured_entries, call.left (2), ';') + || (containsDelimitedToken (configured_entries, call.left (1), ';') && call.at (1).isDigit ()) + || containsDelimitedToken (configured_entries, call.left (1) + "*", ';'); + if (!matched) return false; + + return !configured_entries.contains ("!" + call.left (2) + "!") + && !configured_entries.contains ("!" + call.left (3) + "!"); + } +} diff --git a/HighlightingRules.hpp b/HighlightingRules.hpp new file mode 100644 index 00000000..80fbed5f --- /dev/null +++ b/HighlightingRules.hpp @@ -0,0 +1,28 @@ +#ifndef HIGHLIGHTING_RULES_HPP__ +#define HIGHLIGHTING_RULES_HPP__ + +#include + +namespace HighlightingRules +{ + bool matchesDirectionalCall (QString const& configured_entries, + QString const& directional_call); + + // Matches a decoded callsign against a "Highlight orange/blue callsigns" + // entry list. Supported syntax: + // CALL, exact callsign + // ;PFX; 2- or 3-character prefix + // ;P; 1-character prefix -- only matches calls whose 2nd + // character is a digit (e.g. ";K;" matches K1ABC but + // not KH6ABC), unless... + // ;P*; ...a wildcard is used, which matches any call + // starting with that single-character prefix + // !PFX! excludes a 2- or 3-character prefix even when a + // broader wildcard would otherwise match it (e.g. + // ";K*;!KH6!KL!KP!" matches all K-calls except the + // compound-prefix entities normally split out as + // their own DXCC country) + bool matchesCallsignPrefix (QString const& configured_entries, QString const& call); +} + +#endif diff --git a/HoundTransmissionPolicy.cpp b/HoundTransmissionPolicy.cpp new file mode 100644 index 00000000..27990312 --- /dev/null +++ b/HoundTransmissionPolicy.cpp @@ -0,0 +1,54 @@ +#include "HoundTransmissionPolicy.hpp" + +namespace HoundTransmissionPolicy +{ + ReplyPlan planFoxReportReply (State const& state, ReplyInput const& input) + { + ReplyPlan plan; + plan.nextState = state; + plan.nextState.foxFrequency = input.decodedFoxFrequency; + + if (input.tune) + { + return plan; + } + + plan.applyReply = true; + plan.txMessage = TxMessage::Tx3; + plan.report = input.sentReport; + plan.enableAuto = !input.autoEnabled; + plan.timeoutMilliseconds = static_cast (11000.0 * input.trPeriod); + plan.nextState.replyState = ReplyState::FirstReplyPending; + if (Protocol::Classic == input.protocol) + { + plan.frequencyDecision.action = FrequencyAction::Set; + plan.frequencyDecision.frequency = input.decodedFoxFrequency; + } + return plan; + } + + TxStartPlan planClassicTxStart (State const& state, ClassicTxStartInput const& input) + { + TxStartPlan plan; + plan.nextState = state; + + if (input.autoEnabled && !input.tune && input.currentTxFrequency < 999 + && 3 != input.selectedTxMessage) + { + plan.frequencyDecision.action = FrequencyAction::RandomizeCalling; + } + + if (ReplyState::FirstReplySent == state.replyState && 3 == input.selectedTxMessage) + { + plan.frequencyDecision.action = FrequencyAction::Set; + plan.frequencyDecision.frequency = state.foxFrequency <= 600 + ? state.foxFrequency + 300 : state.foxFrequency - 300; + } + + if (ReplyState::FirstReplyPending == state.replyState) + { + plan.nextState.replyState = ReplyState::FirstReplySent; + } + return plan; + } +} diff --git a/HoundTransmissionPolicy.hpp b/HoundTransmissionPolicy.hpp new file mode 100644 index 00000000..052562c8 --- /dev/null +++ b/HoundTransmissionPolicy.hpp @@ -0,0 +1,83 @@ +#ifndef HOUND_TRANSMISSION_POLICY_HPP_ +#define HOUND_TRANSMISSION_POLICY_HPP_ + +namespace HoundTransmissionPolicy +{ + enum class Protocol + { + Classic, + SuperFox + }; + + enum class ReplyState + { + None, + FirstReplyPending, + FirstReplySent + }; + + enum class FrequencyAction + { + Keep, + RandomizeCalling, + Set + }; + + enum class TxMessage + { + None, + Tx3 + }; + + struct State + { + ReplyState replyState {ReplyState::None}; + int foxFrequency {0}; + }; + + struct FrequencyDecision + { + FrequencyAction action {FrequencyAction::Keep}; + int frequency {0}; + }; + + struct ReplyInput + { + Protocol protocol {Protocol::Classic}; + bool tune {false}; + bool autoEnabled {false}; + int sentReport {0}; + int decodedFoxFrequency {0}; + double trPeriod {0.0}; + }; + + struct ReplyPlan + { + bool applyReply {false}; + TxMessage txMessage {TxMessage::None}; + int report {0}; + bool enableAuto {false}; + FrequencyDecision frequencyDecision; + int timeoutMilliseconds {0}; + State nextState; + }; + + struct ClassicTxStartInput + { + bool autoEnabled {false}; + bool tune {false}; + int selectedTxMessage {0}; + int currentTxFrequency {0}; + }; + + struct TxStartPlan + { + FrequencyDecision frequencyDecision; + State nextState; + }; + + ReplyPlan planFoxReportReply (State const&, ReplyInput const&); + TxStartPlan planClassicTxStart (State const&, ClassicTxStartInput const&); +} + +#endif diff --git a/INSTALL b/INSTALL deleted file mode 100644 index 1948c858..00000000 --- a/INSTALL +++ /dev/null @@ -1,376 +0,0 @@ - - __ __ ______ _____ ________ __ __ -| \ _ | \ / \ | \| \ | \ | \ -| $$ / \ | $$| $$$$$$\ \$$$$$ \$$$$$$$$ | $$ | $$ -| $$/ $\| $$| $$___\$$ | $$ | $$ ______ \$$\/ $$ -| $$ $$$\ $$ \$$ \ __ | $$ | $$| \ >$$ $$ -| $$ $$\$$\$$ _\$$$$$$\| \ | $$ | $$ \$$$$$$/ $$$$\ -| $$$$ \$$$$| \__| $$| $$__| $$ | $$ | $$ \$$\ -| $$$ \$$$ \$$ $$ \$$ $$ | $$ | $$ | $$ - \$$ \$$ \$$$$$$ \$$$$$$ \$$ \$$ \$$ - --- I M P R O V E D b y D G 2 Y C B --- - -Installing WSJT-X -================= - -Binary packages of WSJT-X_IMPROVED are available from the project web -sites: - - https://wsjt-x-improved.sourceforge.io/ - https://sourceforge.net/projects/wsjt-x-improved/ - -Building from Source -==================== - -On Linux systems some of the prerequisite libraries are available in -the mainstream distribution repositories. They are Qt v5, FFTW v3, and -the Boost C++ libraries. For MS Windows see the section "Building -from Source on MS Windows" below. For Apple Mac see the section -"Building from Source on Apple Mac". - -Qt v5, preferably v5.12 or later is required to build WSJT-X. - -Qt v5 multimedia support, serial port, and Linguist is necessary as -well as the core Qt v5 components, normally installing the Qt -multimedia development, Qt serialport development packages, and the Qt -Linguist packages are sufficient to pull in all the required Qt -components and dependants as a single transaction. On some systems -the Qt multimedia plugin component is separate in the distribution -repository an it may also need installing. - -The single precision FFTW v3 library libfftw3f is required along with -the libfftw library development package. Normally installing the -library development package pulls in all the FFTW v3 libraries -including the single precision variant. - -The Hamlib library requires the readline development package and -optionally requires the libusb-1.0-1 library, if the development -version (libusb-1.0-0-dev) is available Hamlib will configure its -custom USB device back end drivers. Most rigs do not require this so -normally you can choose not to install libusb-1.0-dev but if you have -a SoftRock USB or similar SDR that uses a custom USB interface then it -is required. - -The Hamlib library is required. WSJT-X can be built with any version -of the Hamlib git master. To build Hamlib from sources something -like the following recipe should suffice: - -$ mkdir ~/hamlib-prefix -$ cd ~/hamlib-prefix -$ git clone https://github.com/Hamlib/Hamlib src -$ cd src -$ git checkout integration -$ ./bootstrap -$ mkdir ../build -$ cd ../build -$ ../src/configure --prefix=$HOME/hamlib-prefix \ - --disable-shared --enable-static \ - --without-cxx-binding --disable-winradio \ - CFLAGS="-g -O2 -fdata-sections -ffunction-sections" \ - LDFLAGS="-Wl,--gc-sections" -$ make -$ make install-strip - -This will build a binary hamlib package located at ~/hamlib-prefix so -you will need to add that to your CMAKE_PREFIX_PATH variable in your -WSJT-X build. On Linux that is probably the only path you have on -CMAKE_PREFIX_PATH unless you are using a locally installed Qt -installation. - -To get the sources either download and extract a source tarball from -the project web site or preferably fetch the sources directly from the -project's subversion repository. - -$ mkdir -p ~/wsjtx-prefix/build -$ cd ~/wsjtx-prefix -$ git clone git://git.code.sf.net/p/wsjt/wsjtx src - -To build WSJT-X you will need CMake and asciidoc installed. - -$ cd ~/wsjtx-prefix/build -$ cmake -D CMAKE_PREFIX_PATH=~/hamlib-prefix -DWSJT_SKIP_MANPAGES=ON \ - -DWSJT_GENERATE_DOCS=OFF ../src -$ cmake --build . -$ cmake --build . --target install - -The recipe above will install into /usr by default, if you wish to -install in you own directory you can add a prefix-path to the -configure step like: - -$ cd ~/wsjtx-prefix/build -$ cmake -D CMAKE_PREFIX_PATH=~/hamlib-prefix \ - -DWSJT_SKIP_MANPAGES=ON -DWSJT_GENERATE_DOCS=OFF \ - -D CMAKE_INSTALL_PREFIX=~/wsjtx-prefix ../src -$ cmake --build . -$ cmake --build . --target install - -this will install WSJT-X at ~/wsjtx-prefix. - - -Building from Source on MS Windows -================================== - -Because building on MS Windows is quite complicated there is an -Software Development Kit available that provides all the prerequisite -libraries and tools for building WSJT-X. This SDK is called HAMLIB SDK -which is documented here: - -https://sourceforge.net/projects/hamlib-sdk/ - -If you need to build Hamlib rather than use the Hamlib kit included in -the HAMLIB SDK the following recipe should help. Reasons for building -Hamlib from source might include picking up the very latest patches or -building a different branch that you wish to contribute to. - -Hamlib optionally depends upon libusb-1.0, see "Building from Source" -above for more details. If you wish to include support for the -optional custom USB Hamlib rig drivers then you must install -libusb-1.0 before building Hamlib. The package may be obtained from -http://libusb.info/, install it in a convenient location like -C:\Tools. - -On Windows there is a complication in that the compilers used to build -Qt and WSJT-X are the MinGW ones bundled with the Qt package but -Hamlib needs to be build from an MSYS shell with the tools required to -build an autotools project. This means that you need to tell the -Hamlib configuration to use the Qt bundled MinGW compilers (if you -don't then the thread support library use by Hamlib will be -incompatible with that used by Qt and WSJT-X). So on Windows the -Hamlib build recipe is something like: - -In an MSYS shell:- - -$ mkdir ~/hamib-prefix -$ cd ~/hamlib-prefix -$ git clone https://github.com/Hamlib/Hamlib src -$ cd src -$ git checkout integration -$ ./bootstrap -$ mkdir ../build -$ cd ../build - ../src/configure --prefix=$HOME/hamlib-prefix \ - --disable-shared --enable-static \ - --without-cxx-binding --disable-winradio \ - CC=/gcc \ - CXX=/g++ \ - CFLAGS="-g -O2 -fdata-sections -ffunction-sections -I/include" \ - LDFLAGS="-Wl,--gc-sections" \ - LIBUSB_LIBS="-L/MinGW32/dll -lusb-1.0" -$ make -$ make install - -NOTE: should be substituted with the actual -path to your Qt bundled tools e.g on my system it is -C:\Tools\Qt\Tools\mingw530_32\bin - -NOTE: should be substituted with the actual path -to your libusb-1.0 installation directory e.g. on my system it is -C:\Tools\libusb-1.0.20 - -This will leave a Hamlib binary package installed at -c:/Users//hamlib-prefix which is what needs to be on your -CMAKE_PREFIX_PATH. On Windows you almost certainly will be using a -CMake tool chain file and this is where you will need to specify the -Hamlib binary location as one of the paths in CMAKE_PREFIX_PATH. - - -Building from Source on Apple Mac -================================= - -There are several ways to get the required GNU and other open source -tools and libraries installed, my preference is MacPorts because it is -easy to use and does everything we need. - -You will need Xcode, MacPorts, CMake and, Qt. The Xcode install -instructions are included in the MacPorts documentation. - -MacPorts --------- -Install MacPorts from instructions here: - - http://www.macports.org/install.php - -More detailed instructions are available in the documentation: - - https://guide.macports.org - -The ports that need to be installed are: - -autoconf -automake -libtool -pkgconfig -texinfo -gcc5 -fftw-3-single +gcc5 -asciidoc -libusb-devel - -These are installed by typing: - -$ sudo port install autoconf automake \ - libtool pkgconfig texinfo gcc5 asciidoc \ - fftw-3-single +gcc5 libusb-devel - -Once complete you should have all the tools required to build WSJT-X. - -Uninstalling MacPorts ---------------------- -If at some point you wish to remove the ports from your machine. The -instructions are here: - - https://guide.macports.org/#installing.macports.uninstalling . - -Hamlib ------- -First fetch hamlib from the git master repository: - -$ mkdir -p ~/hamlib-prefix/build -$ cd ~/hamlib-prefix -$ git clone https://github.com/Hamlib/Hamlib src -$ cd src -$ git checkout integration -$ ./bootstrap - -The integration branch is my system testing branch which has all my -latest published changes. - -To build: - -$ cd ~/hamlib-prefix/build -$ ../src/configure \ - --enable-static \ - --disable-shared \ - --disable-winradio \ - --prefix=$HOME/hamlib-prefix \ - CFLAGS="-g -O2 -mmacosx-version-min=10.7 -I/opt/local/include" \ - LIBUSB_LIBS="-L/opt/local/lib -lusb-1.0" -$ make -$ make install-strip - -The above commands will build hamlib and install it into -~/hamlib-prefix. If `make install-strip` fails, try `make install`. - - -CMake ------ -Although CMake is available via MacPorts I prefer to use the binary -installer from cake.org as the MacPorts port doesn't include the -graphical CMake tool cmake-gui which I find quite useful. - -Fetch the latest CMake universal 64-bit DMG from -http://www.cmake.org/download/ open the DMG then drag and drop the -application bundle onto the supplied /Applications link. - -To complete the install process you need to run the CMake-gui -application as root from a terminal shell as follows: - -$ sudo "/Applications/CMake.app/Contents/MacOS/cmake" --install - -that installs the CMake command line tools which you can verify by -typing into a terminal window: - -$ cmake --version - -If the install command above fails with a "No such file or directory" -error, that probably means that /usr/local/bin does not exist. You can -create it correctly with the following commands: - -$ sudo mkdir -p /usr/local/bin -$ sudo chmod 755 /usr/local/bin -$ sudo chgrp wheel /usr/local/bin - -and then retry the install command. - - -Qt --- - -Download the latest on-line installer package from the Qt web site and -isntall the latest Qt stable version development package. - - -WSJT-X ------- -First fetch the source from the repository: - -$ mkdir -p ~/wsjtx-prefix/build -$ cd ~/wsjtx-prefix -$ git clone git://git.code.sf.net/p/wsjt/wsjtx src - -this links to the Subversion repository in a read-only fashion, if you -intend to contribute to the project then you probably want to get a -developer login and use a read-write checkout. Even if you don't it -can be upgraded at a later date. - -The checkout is of the latest code on the project trunk, i.e. the -development branch. You can easily switch the checkout to another -branch or even a tag if you want to build a prior published -generation. For now we will build the latest development sources. To -configure: - -$ cd ~/wsjtx-prefix/build -$ FC=gfortran-mp-5 \ - cmake \ - -D CMAKE_PREFIX_PATH="~/Qt/5.9/clang_64;~/hamlib-prefix;/opt/local" \ - -D CMAKE_INSTALL_PREFIX=~/wsjtx-prefix \ - -D CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk \ - ~/wsjtx-prefix/src - -Substitute the Mac OS X SDK version you have installed in the above -command if you have a different version from 10.11. - -The CMAKE_PREFIX_PATH variable specifies where CMake should look first -for other packages, the two elements may be different depending where -you have installed Qt and what version you have (~/local/qt-macx-clang -if you have built Qt from sources as described above in the Qt -section) and where you installed Hamlib (i.e. the --prefix configure -option above in the Hamlib section). - -If you already have the fftw3-dev package installed on your system it -may well get selected in preference to the one you built above in the -MacPorts installation. It is unlikely that a prior installation of -libfftw3f is correctly configured for use in a WSJT-X package, the -CMAKE_PREFIX_PATH above is augmented with the MacPorts installation -location (/opt/local) to ensure the correct libfftw3f.dylib and -headers are located. - -To build: - -$ cmake --build . -$ cmake --build . --target install - -which installs the WSJT-X application bundle into ~/wsjtx-prefix - - -Updating and Rebuilding Hamlib -============================== - -From time to time new fixes will be pushed to the Hamlib git -master repository. To pick them up type: - -$ cd ~/hamlib-prefix/src -$ git pull - -To rebuild hamlib with the changed sources: - -$ cd ~/hamlib-prefix/build -$ make -$ make install-strip - - -Updating and Rebuilding WSJT-X -============================== - -To update to the latest sources type: - -$ cd ~/wsjtx-prefix/src -$ git pull -$ cd ~/wsjtx-prefix/build -$ cmake --build . -$ cmake --build . --target install - - -73 -Bill -G4WJS. diff --git a/JttyReplay.hpp b/JttyReplay.hpp new file mode 100644 index 00000000..5a95ece2 --- /dev/null +++ b/JttyReplay.hpp @@ -0,0 +1,26 @@ +#ifndef JTTY_REPLAY_HPP +#define JTTY_REPLAY_HPP + +#include "DecDataMutex.hpp" +#include + +inline int snapshotJttyFrames (int const& liveFrames) +{ + QMutexLocker lock {&dec_data_mutex ()}; + return liveFrames; +} + +// Shared traversal used by manual replay and waterfall-picked replay. +// stopAfterFrame returns true for EOM or the picked replay's stop position. +// Snapshot once: newly arriving audio belongs to later live processing. +template +void replayJttyFrames (int const& liveFrames, StopAfterFrame stopAfterFrame) +{ + int const end = snapshotJttyFrames (liveFrames); + for (int k = 3456; k < end; k += 3456) + { + if (stopAfterFrame (k)) break; + } +} + +#endif diff --git a/JttyTxLoopbackTestController.cpp b/JttyTxLoopbackTestController.cpp new file mode 100644 index 00000000..77699377 --- /dev/null +++ b/JttyTxLoopbackTestController.cpp @@ -0,0 +1,400 @@ +#include "JttyTxLoopbackTestController.hpp" + +#include "Audio/BWFFile.hpp" +#include "Audio/FixtureSoundOutput.hpp" +#include "widgets/mainwindow.h" +#include "wsjtx_config.h" + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "moc_JttyTxLoopbackTestController.cpp" + +extern "C" void genjtty_ (char const * message, int tones[], int * symbols, + fortran_charlen_t); + +namespace +{ + constexpr int sampleRate = 48000; + constexpr int bytesPerFrame = 2; +} + +JttyTxLoopbackTestController::JttyTxLoopbackTestController ( + MainWindow * window, FixtureSoundOutput * output, QString capturePath, + QObject * parent) + : QObject {parent} + , m_window {window} + , m_output {output} + , m_capturePath {std::move (capturePath)} +{ + m_timeout.setSingleShot (true); + m_timeout.setInterval (60000); + connect (&m_timeout, &QTimer::timeout, this, [this] { + fail (tr ("Timed out after 60 seconds.")); + }); + + m_prepareTimer.setSingleShot (true); + connect (&m_prepareTimer, &QTimer::timeout, + this, &JttyTxLoopbackTestController::prepareWhenReady); + + m_modalTimer.setInterval (100); + connect (&m_modalTimer, &QTimer::timeout, + this, &JttyTxLoopbackTestController::checkForUnexpectedModal); + + connect (m_window, &MainWindow::jttyTextAccepted, + this, [this] (qint64 requestId) { + if (m_acceptedRequests.contains (requestId)) + { + fail (tr ("JTTY request %1 was accepted more than once.") + .arg (requestId)); + return; + } + m_acceptedRequests.insert (requestId); + m_acceptedOrder.append (requestId); + maybeFinish (); + }); + connect (m_window, &MainWindow::jttyTextRejected, + this, [this] (qint64 requestId, MainWindow::JttyTxRejectReason reason) { + fail (tr ("JTTY request %1 was rejected with reason %2.") + .arg (requestId).arg (static_cast (reason))); + }); + connect (m_window, &MainWindow::jttyTextCompleted, + this, [this] (qint64 requestId) { + if (m_completedRequests.contains (requestId)) + { + fail (tr ("JTTY request %1 completed more than once.") + .arg (requestId)); + return; + } + m_completedRequests.insert (requestId); + m_completedOrder.append (requestId); + maybeFinish (); + }); + connect (m_window, &MainWindow::jttySessionDrained, + this, [this] (qint64) { + ++m_sessionDrainCount; + if (m_sessionDrainCount > 1) + { + fail (tr ("More than one JTTY transmit session drained.")); + return; + } + maybeFinish (); + }); + + connect (m_output, &FixtureSoundOutput::captureStarted, + this, [this] (QString const& path) { + ++m_captureStartCount; + if (path != m_capturePath) + { + fail (tr ("Synthetic output opened the wrong capture path: %1") + .arg (path)); + return; + } + if (m_captureStartCount > 1 || m_output->restartCount () != 1) + { + fail (tr ("JTTY output stream restarted more than once.")); + } + }); + connect (m_output, &FixtureSoundOutput::nonSilentAudioStarted, + this, [this] (qint64 frame) { + if (m_nonSilentAudioSeen) + { + fail (tr ("Synthetic output reported non-silent playback more than once.")); + return; + } + m_nonSilentAudioSeen = true; + m_firstNonSilentFrame = frame; + QTimer::singleShot (1500, this, [this] { + submitSecondMessage (); + }); + }); + connect (m_output, &FixtureSoundOutput::captureStopped, + this, [this] (QString const& path, qint64 frames) { + ++m_captureStopCount; + m_capturedFrames = frames; + if (path != m_capturePath) + { + fail (tr ("Synthetic output stopped the wrong capture path: %1") + .arg (path)); + return; + } + if (m_captureStopCount > 1) + { + fail (tr ("JTTY output stream stopped more than once.")); + return; + } + maybeFinish (); + }); + connect (m_output, &FixtureSoundOutput::captureFailed, + this, [this] (QString const& reason) { + fail (tr ("Synthetic audio output failed: %1").arg (reason)); + }); +} + +QString JttyTxLoopbackTestController::contestExchangeMessage () +{ + return QStringLiteral ("WB9XYZ 599 0123"); +} + +QString JttyTxLoopbackTestController::adjacentStructuredFramesMessage () +{ + return QStringLiteral ("WB9XYZ TU CQ KA1ABC CQ"); +} + +qint64 JttyTxLoopbackTestController::encodedSampleFrames (QString const& message) +{ + int tones[2048]; + int symbols {0}; + QByteArray field (80, ' '); + auto const bytes = message.toLatin1 (); + std::copy (bytes.cbegin (), bytes.cend (), field.begin ()); + genjtty_ (field.constData (), tones, &symbols, 80); + return qint64 (symbols) * 384 * 4; +} + +void JttyTxLoopbackTestController::begin () +{ + m_timeout.start (); + m_modalTimer.start (); + prepareWhenReady (); +} + +void JttyTxLoopbackTestController::prepareWhenReady () +{ + if (m_finished || m_prepared) return; + + auto * jttyAction = m_window->findChild ("actionJTTY"); + if (!jttyAction) + { + fail (tr ("The JTTY mode action was not found.")); + return; + } + if (!jttyAction->isEnabled ()) + { + m_prepareTimer.start (50); + return; + } + + jttyAction->trigger (); + if (!jttyAction->isChecked ()) + { + fail (tr ("The application did not enter JTTY mode.")); + return; + } + + m_prepared = true; + m_expectedAudioFrames = encodedSampleFrames (contestExchangeMessage ()) + + encodedSampleFrames (adjacentStructuredFramesMessage ()); + if (m_expectedAudioFrames <= 0) + { + fail (tr ("The JTTY encoder did not produce a valid test waveform extent.")); + return; + } + m_firstRequestId = m_window->submitJttyText (contestExchangeMessage ()); + if (m_firstRequestId <= 0 || !m_acceptedRequests.contains (m_firstRequestId)) + { + fail (tr ("The first JTTY text request was not accepted synchronously.")); + return; + } + + std::cerr << "WSJT-X JTTY TX loopback test: first request accepted, " + "waiting for real audio consumption" + << std::endl; +} + +void JttyTxLoopbackTestController::submitSecondMessage () +{ + if (m_finished) return; + if (!m_prepared || m_firstRequestId <= 0 + || !m_acceptedRequests.contains (m_firstRequestId)) + { + fail (tr ("Non-silent playback began before the first request was accepted.")); + return; + } + if (m_captureStartCount != 1 || m_output->restartCount () != 1 + || m_output->stopCount () != 0) + { + fail (tr ("The output stream restarted or stopped before the gapless append.")); + return; + } + if (m_output->capturedFrames () - m_firstNonSilentFrame < sampleRate) + { + fail (tr ("The gapless append occurred before one second of real playback.")); + return; + } + + m_secondRequestId = m_window->submitJttyText ( + adjacentStructuredFramesMessage ()); + if (m_secondRequestId <= 0 || m_secondRequestId == m_firstRequestId + || !m_acceptedRequests.contains (m_secondRequestId)) + { + fail (tr ("The second JTTY text request was not accepted during playback.")); + return; + } + if (m_output->restartCount () != 1 || m_output->stopCount () != 0) + { + fail (tr ("Appending the second JTTY message restarted or stopped playback.")); + return; + } + + std::cerr << "WSJT-X JTTY TX loopback test: second request accepted after " + "non-silent playback began" + << std::endl; +} + +void JttyTxLoopbackTestController::maybeFinish () +{ + if (m_finished || !m_secondRequestId || m_sessionDrainCount != 1 + || m_captureStopCount != 1) + { + return; + } + + QSet const expectedRequests {m_firstRequestId, m_secondRequestId}; + QVector const expectedOrder {m_firstRequestId, m_secondRequestId}; + if (m_acceptedRequests != expectedRequests) + { + fail (tr ("The accepted-request set did not contain exactly both submitted messages.")); + return; + } + if (m_acceptedOrder != expectedOrder) + { + fail (tr ("JTTY text requests were not accepted in submission order.")); + return; + } + if (m_completedRequests != expectedRequests) + { + fail (tr ("The completed-request set did not contain exactly both submitted messages.")); + return; + } + if (m_completedOrder != expectedOrder) + { + fail (tr ("JTTY text requests did not complete in FIFO order.")); + return; + } + if (!m_nonSilentAudioSeen || m_captureStartCount != 1 + || m_output->restartCount () != 1 || m_output->stopCount () != 1) + { + fail (tr ("The output stream lifecycle was not one start, one drain, and one stop.")); + return; + } + if (m_output->maxInternalSilentFrames () > sampleRate / 100) + { + fail (tr ("The captured JTTY session contains an unexpected internal audio gap.")); + return; + } + + QString captureError; + if (!validateCapture (&captureError)) + { + fail (captureError); + return; + } + + m_finished = true; + m_succeeded = true; + m_timeout.stop (); + m_prepareTimer.stop (); + m_modalTimer.stop (); + std::cout << "WSJT-X JTTY TX loopback capture passed: requests=2 restarts=" + << m_output->restartCount () << " stops=" << m_output->stopCount () + << " drains=" << m_sessionDrainCount + << " frames=" << m_capturedFrames + << " capture=" << m_capturePath.toStdString () << std::endl; + m_window->close (); + QCoreApplication::exit (EXIT_SUCCESS); +} + +bool JttyTxLoopbackTestController::validateCapture (QString * error) const +{ + QFileInfo const info {m_capturePath}; + if (!info.isFile () || info.size () <= 0) + { + *error = tr ("The JTTY capture file was not created or is empty: %1") + .arg (m_capturePath); + return false; + } + + BWFFile capture {QAudioFormat {}, m_capturePath}; + if (!capture.open (BWFFile::ReadOnly)) + { + *error = tr ("Unable to reopen JTTY capture %1: %2") + .arg (m_capturePath, capture.errorString ()); + return false; + } + auto const& format = capture.format (); + if (format.codec () != QStringLiteral ("audio/pcm") + || format.sampleRate () != sampleRate || format.channelCount () != 1 + || format.sampleSize () != 16 + || format.sampleType () != QAudioFormat::SignedInt + || format.byteOrder () != QAudioFormat::LittleEndian) + { + *error = tr ("The JTTY capture is not 48 kHz mono signed 16-bit little-endian PCM."); + return false; + } + qint64 const minimumCapturedFrames = m_expectedAudioFrames + sampleRate / 5; + qint64 const maximumCapturedFrames = m_expectedAudioFrames + sampleRate / 2; + if (capture.size () % bytesPerFrame + || capture.size () / bytesPerFrame < minimumCapturedFrames + || capture.size () / bytesPerFrame > maximumCapturedFrames + || capture.size () / bytesPerFrame != m_capturedFrames) + { + *error = tr ("The JTTY capture has an invalid PCM extent: file frames=%1, expected audio frames=%2, reported frames=%3.") + .arg (capture.size () / bytesPerFrame) + .arg (m_expectedAudioFrames) + .arg (m_capturedFrames); + return false; + } + return true; +} + +void JttyTxLoopbackTestController::fail (QString const& reason) +{ + if (m_finished) return; + m_finished = true; + m_timeout.stop (); + m_prepareTimer.stop (); + m_modalTimer.stop (); + std::cerr << "WSJT-X JTTY TX loopback capture failed: " + << reason.toStdString () + << " first_request=" << m_firstRequestId + << " second_request=" << m_secondRequestId + << " accepted=" << m_acceptedRequests.size () + << " completed=" << m_completedRequests.size () + << " capture_starts=" << m_captureStartCount + << " capture_stops=" << m_captureStopCount + << " restarts=" << m_output->restartCount () + << " stops=" << m_output->stopCount () + << " drains=" << m_sessionDrainCount + << " frames=" << m_capturedFrames << std::endl; + if (auto * modal = QApplication::activeModalWidget ()) modal->close (); + m_window->close (); + QCoreApplication::exit (EXIT_FAILURE); +} + +void JttyTxLoopbackTestController::checkForUnexpectedModal () +{ + if (auto * modal = QApplication::activeModalWidget ()) + { + auto detail = modal->windowTitle (); + if (auto const * messageBox = qobject_cast (modal)) + { + detail = messageBox->text (); + if (!messageBox->informativeText ().isEmpty ()) + { + detail += QStringLiteral (" ") + messageBox->informativeText (); + } + } + fail (tr ("Unexpected modal window: %1").arg (detail)); + } +} diff --git a/JttyTxLoopbackTestController.hpp b/JttyTxLoopbackTestController.hpp new file mode 100644 index 00000000..69e43c8f --- /dev/null +++ b/JttyTxLoopbackTestController.hpp @@ -0,0 +1,63 @@ +// -*- Mode: C++ -*- +#ifndef JTTY_TX_LOOPBACK_TEST_CONTROLLER_HPP__ +#define JTTY_TX_LOOPBACK_TEST_CONTROLLER_HPP__ + +#include +#include +#include +#include +#include + +class FixtureSoundOutput; +class MainWindow; + +class JttyTxLoopbackTestController final + : public QObject +{ + Q_OBJECT + +public: + JttyTxLoopbackTestController (MainWindow * window, + FixtureSoundOutput * output, + QString capturePath, + QObject * parent = nullptr); + + void begin (); + bool succeeded () const {return m_succeeded;} + +private: + static QString contestExchangeMessage (); + static QString adjacentStructuredFramesMessage (); + static qint64 encodedSampleFrames (QString const& message); + void prepareWhenReady (); + void submitSecondMessage (); + void maybeFinish (); + bool validateCapture (QString * error) const; + void fail (QString const& reason); + void checkForUnexpectedModal (); + + MainWindow * m_window; + FixtureSoundOutput * m_output; + QString m_capturePath; + QSet m_acceptedRequests; + QSet m_completedRequests; + QVector m_acceptedOrder; + QVector m_completedOrder; + QTimer m_timeout; + QTimer m_prepareTimer; + QTimer m_modalTimer; + qint64 m_firstRequestId {0}; + qint64 m_secondRequestId {0}; + qint64 m_capturedFrames {0}; + qint64 m_expectedAudioFrames {0}; + qint64 m_firstNonSilentFrame {0}; + int m_captureStartCount {0}; + int m_captureStopCount {0}; + int m_sessionDrainCount {0}; + bool m_prepared {false}; + bool m_nonSilentAudioSeen {false}; + bool m_finished {false}; + bool m_succeeded {false}; +}; + +#endif diff --git a/LiveAudioTestController.cpp b/LiveAudioTestController.cpp new file mode 100644 index 00000000..f0feb22b --- /dev/null +++ b/LiveAudioTestController.cpp @@ -0,0 +1,825 @@ +#include "LiveAudioTestController.hpp" + +#include "Audio/FixtureAudioInput.hpp" +#include "DecoderIpc.hpp" +#include "Decoder/decodedtext.h" +#include "widgets/mainwindow.h" + +extern dec_data_t& dec_data; + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "moc_LiveAudioTestController.cpp" + +namespace +{ +#if defined(WSJT_TSAN_TEST_PROFILE) + constexpr int ft8TestThreadCount = 2; + constexpr int ft8TestCycleCount = 1; +#else + constexpr int ft8TestThreadCount = 4; + constexpr int ft8TestCycleCount = 3; +#endif +} + +LiveAudioTestController::LiveAudioTestController ( + MainWindow * window, FixtureAudioInput * fixture, QString expectedPath, + Mode mode, QObject * parent) + : QObject {parent} + , m_window {window} + , m_fixture {fixture} + , m_expectedPath {std::move (expectedPath)} + , m_mode {mode} +{ + if (Mode::Ft8 == m_mode) + { + m_expected = readExpectedMessages (m_expectedPath, &m_initializationError); + } + else + { + m_expectedJtty = readExpectedJttyMessages ( + m_expectedPath, &m_initializationError); + for (auto& message : m_expectedJtty) + { + message = message.simplified ().toUpper (); + } + if (!m_expectedJtty.isEmpty ()) + { + auto const& first = m_expectedJtty.constFirst (); + auto const prefixLength = std::max (4, first.size () / 2); + m_expectedJttyPrefix = first.left ( + std::min (prefixLength, std::max (0, first.size () - 1))); + } + } + + m_timeout.setSingleShot (true); + m_timeout.setInterval (Mode::Ft8 == m_mode ? 110000 : 100000); + connect (&m_timeout, &QTimer::timeout, this, [this] { + fail (Mode::Ft8 == m_mode + ? tr ("Timed out after 110 seconds.") + : tr ("Timed out after 100 seconds.")); + }); + + m_prepareTimer.setSingleShot (true); + connect (&m_prepareTimer, &QTimer::timeout, + this, &LiveAudioTestController::prepareWhenReady); + + m_modalTimer.setInterval (100); + connect (&m_modalTimer, &QTimer::timeout, + this, &LiveAudioTestController::checkForUnexpectedModal); + + m_jttyPollTimer.setInterval (50); + connect (&m_jttyPollTimer, &QTimer::timeout, + this, &LiveAudioTestController::pollJttyDisplay); + + connect (m_window, &MainWindow::decoderBackendStarted, + this, &LiveAudioTestController::prepareWhenReady); + connect (m_window, &MainWindow::decoderBackendStarted, + this, [this] { + if (m_submittedGeneration) + fail (tr ("Decoder backend restarted after FT8 publication.")); + }); + connect (m_window, &MainWindow::decodeCycleStarted, + this, [this] (quint64 cycle) { + if (m_submittedGeneration) + fail (tr ("Unexpected decoder cycle %1 after FT8 publication %2.") + .arg (cycle).arg (m_submittedGeneration)); + }); + connect (m_window, &MainWindow::decoderBackendFailed, + this, [this] (QString const& reason) { + if (Mode::Ft8 == m_mode) + { + fail (tr ("Decoder backend failed: %1").arg (reason)); + } + }); + connect (m_window, &MainWindow::decodedMessageProcessed, + this, [this] (QString const& message) { + if (message.isEmpty ()) return; + auto const normalized = message.simplified (); + m_observed.insert (normalized); + if (m_decoderStage == DecoderStage::EarlyStandard) + { + m_earlyObserved.insert (normalized); + } + else if (m_decoderStage == DecoderStage::Multithreaded) + { + m_multithreadedObserved.insert (normalized); + } + }); + connect (m_window, &MainWindow::decodedMessageDisplayed, + this, [this] (QString const& message) { + if (!message.isEmpty ()) m_displayed.insert (message.simplified ()); + }); + connect (m_window, &MainWindow::decodeCycleCompleted, + this, [this] (quint64 cycle) { + ++m_completedCycles; + if (m_submittedGeneration) + { + if (!m_rolloverVerified || cycle != m_submittedCycle + || ++m_submittedCompletions != 1) + { + fail (tr ("Submitted FT8 completion mismatch: cycle=%1 expected=%2 count=%3 rollover=%4.") + .arg (cycle).arg (m_submittedCycle) + .arg (m_submittedCompletions).arg (m_rolloverVerified)); + return; + } + } + if (m_decoderStage == DecoderStage::Multithreaded) + { + m_completedMultithreadedDecode = true; + } + maybeFinish (); + m_decoderStage = DecoderStage::None; + }); + connect (m_window, &MainWindow::decodeCycleAborted, + this, [this] { + fail (QStringLiteral ("Decoder generation aborted before completion.")); + }); + connect (m_window, &MainWindow::decoderOutputLine, + this, [this] (QByteArray const& line) { + auto const message = messageFromDecoderLine (line); + if (message.isEmpty ()) return; + if (m_decoderStage == DecoderStage::EarlyStandard) + { + m_earlyRaw.insert (message); + } + else if (m_decoderStage == DecoderStage::Multithreaded) + { + m_multithreadedRaw.insert (message); + } + }); + connect (m_window, &MainWindow::ft8DecoderInvocation, + this, [this] (bool multithreaded, int threadCount, int depth, + int cycles, bool subpass, int decoderStart, + int halfSymbols, int sampleCount, + int lowFrequency, int highFrequency) { + m_decoderStage = multithreaded + ? DecoderStage::Multithreaded : DecoderStage::EarlyStandard; + if (!multithreaded && halfSymbols == 41) + { + m_sawEarlyStandardDecode = true; + } + if (multithreaded && threadCount == ft8TestThreadCount && depth == 3 + && cycles == ft8TestCycleCount && subpass && decoderStart == 0 + && halfSymbols == 49 + && sampleCount == DecoderIpc::Ft8SampleCount + && lowFrequency == MainWindow::liveAudioTestDecodeLowFrequency () + && highFrequency == MainWindow::liveAudioTestDecodeHighFrequency ()) + { + m_sawConfiguredMultithreadedDecode = true; + } + std::cerr << "WSJT-X live audio test: decoder invocation MTD=" + << multithreaded << " threads=" << threadCount + << " depth=" << depth << " cycles=" << cycles + << " subpass=" << subpass << " start=" << decoderStart + << " half_symbols=" << halfSymbols + << " samples=" << sampleCount + << " nfa=" << lowFrequency + << " nfb=" << highFrequency << std::endl; + if (multithreaded) exerciseSubmittedFt8Rollover (); + }); + connect (m_window, &MainWindow::liveAudioTestReceiveRange, + this, [this] (quint64 epoch, int start, int end, bool accepted) { + if (!m_submittedGeneration || m_finished) return; + if (!accepted) + { + ++m_rolloverRejectedBlocks; + fail (tr ("Submitted FT8 rollover rejected epoch=%1 range=[%2,%3).") + .arg (epoch).arg (start).arg (end)); + return; + } + if (epoch != m_rolloverEpoch || start != m_rolloverAcceptedEnd + || end > int (m_rolloverSamples.size ()) + || !std::equal (m_rolloverSamples.begin () + start, + m_rolloverSamples.begin () + end, dec_data.d2 + start) + || m_window->liveAudioTestPublishedDecoderGeneration () != m_submittedGeneration) + { + fail (tr ("Submitted FT8 rollover mismatch: epoch=%1 expected_epoch=%2 range=[%3,%4) expected_start=%5 generation=%6.") + .arg (epoch).arg (m_rolloverEpoch).arg (start).arg (end) + .arg (m_rolloverAcceptedEnd).arg (m_submittedGeneration)); + return; + } + m_rolloverAcceptedEnd = end; + ++m_rolloverAcceptedBlocks; + }); + connect (m_window, &MainWindow::liveAudioTestReceiveBlock, + this, [this] (ReceiveAudio const& block) { + if (!m_submittedGeneration || m_finished + || block->epoch <= m_preRolloverEpoch) return; + if (!m_rolloverEpoch) m_rolloverEpoch = block->epoch; + if (block->epoch != m_rolloverEpoch + || block->start != int (m_rolloverSamples.size ())) return; + m_rolloverSamples.insert (m_rolloverSamples.end (), + block->samples.begin (), block->samples.end ()); + }); + connect (m_fixture, &FixtureAudioInput::emissionStarted, + this, [] (qint64 utcStartMilliseconds) { + std::cerr << "WSJT-X live audio test: PCM emission started at UTC epoch " + << utcStartMilliseconds << " ms" << std::endl; + }); + connect (m_fixture, &FixtureAudioInput::emissionFinished, + this, [this] (qint64 frames) { + m_emittedFrames = frames; + auto const completionError = Mode::Ft8 == m_mode + ? m_window->completeLiveAudioTestFt8Input (frames) : QString {}; + if (!completionError.isEmpty ()) + { + fail (completionError); + return; + } + m_fixtureFinished = true; + maybeFinish (); + if (Mode::Jtty == m_mode) + { + QTimer::singleShot (8000, this, [this] { + if (!m_finished) + { + fail (tr ("JTTY display did not settle to the expected text after input ended.")); + } + }); + } + }); + if (Mode::Jtty == m_mode) + { + connect (m_window, &MainWindow::liveAudioTestJttyFramesConsumed, + m_fixture, &FixtureAudioInput::acknowledgeJttyFrames, + Qt::QueuedConnection); + } + connect (m_fixture, &AudioInputSource::error, + this, [this] (QString const& reason) { + fail (tr ("Synthetic audio source failed: %1").arg (reason)); + }); +} + +void LiveAudioTestController::exerciseSubmittedFt8Rollover () +{ + if (m_submittedGeneration || m_window->liveAudioTestReceivingAudio ()) + { + fail (tr ("FT8 rollover requires one final publication outside receive DSP.")); + return; + } + m_submittedGeneration = m_window->liveAudioTestPublishedDecoderGeneration (); + m_submittedCycle = m_window->liveAudioTestDecodeCycleGeneration (); + auto const previousEpoch = m_window->liveAudioTestReceiveEpoch (); + m_preRolloverEpoch = previousEpoch; + if (!m_submittedGeneration || !m_window->decoderBusy ()) + { + fail (tr ("FT8 final invocation has no committed decoder publication.")); + return; + } + + struct Acknowledgement + { + std::mutex mutex; + std::condition_variable ready; + bool complete {false}; + QString error; + }; + auto acknowledgement = std::make_shared (); + auto * fixture = m_fixture; + if (!QMetaObject::invokeMethod (fixture, [fixture, acknowledgement] { + auto const error = fixture->emitFt8RolloverPrefix (); + { + std::lock_guard lock {acknowledgement->mutex}; + acknowledgement->error = error; + acknowledgement->complete = true; + } + acknowledgement->ready.notify_one (); + }, Qt::QueuedConnection)) + { + fail (tr ("Unable to queue the FT8 rollover prefix.")); + return; + } + { + std::unique_lock lock {acknowledgement->mutex}; + if (!acknowledgement->ready.wait_for (lock, std::chrono::seconds {10}, + [&] {return acknowledgement->complete;})) + { + lock.unlock (); + fail (tr ("Timed out awaiting FT8 rollover: generation=%1 previous_epoch=%2.") + .arg (m_submittedGeneration).arg (previousEpoch)); + return; + } + auto const error = acknowledgement->error; + lock.unlock (); + if (!error.isEmpty ()) + { + fail (error); + return; + } + } + // Deliver Detector's queued blocks while decoder readiness events remain pending. + QCoreApplication::sendPostedEvents (m_window, QEvent::MetaCall); + if (m_finished) return; + auto const lastSample = m_rolloverSamples.empty () ? 0 : m_rolloverSamples.back (); + m_rolloverVerified = m_rolloverAcceptedBlocks > 0 + && m_rolloverEpoch > previousEpoch + && m_rolloverSamples.size () == FixtureAudioInput::ft8RolloverFrames () + && lastSample < 0 + && m_rolloverAcceptedEnd == FixtureAudioInput::ft8RolloverFrames () + && m_window->liveAudioTestPublishedDecoderGeneration () == m_submittedGeneration + && m_window->decoderBusy () && !m_submittedCompletions; + if (!m_rolloverVerified) + { + fail (tr ("FT8 rollover did not preserve active publication: epoch=%1 accepted=%2 end=%3 rejected=%4 generation=%5 active=%6.") + .arg (m_rolloverEpoch).arg (m_rolloverAcceptedBlocks) + .arg (m_rolloverAcceptedEnd).arg (m_rolloverRejectedBlocks) + .arg (m_submittedGeneration) + .arg (m_window->liveAudioTestPublishedDecoderGeneration ())); + } +} + +void LiveAudioTestController::begin () +{ + m_timeout.start (); + m_modalTimer.start (); + if (!m_initializationError.isEmpty ()) + { + fail (m_initializationError); + return; + } + prepareWhenReady (); +} + +QSet LiveAudioTestController::readExpectedMessages ( + QString const& path, QString * error) +{ + QFile file {path}; + if (!file.open (QIODevice::ReadOnly | QIODevice::Text)) + { + *error = tr ("Unable to open expected decode file %1: %2") + .arg (path, file.errorString ()); + return {}; + } + + QSet messages; + QTextStream stream {&file}; + while (!stream.atEnd ()) + { + auto const message = messageFromDecoderLine (stream.readLine ().toUtf8 ()); + if (!message.isEmpty ()) messages.insert (message); + } + + if (messages.isEmpty ()) + { + *error = tr ("Expected decode file %1 contains no messages.").arg (path); + } + return messages; +} + +QStringList LiveAudioTestController::readExpectedJttyMessages ( + QString const& path, QString * error) +{ + QFile file {path}; + if (!file.open (QIODevice::ReadOnly | QIODevice::Text)) + { + *error = tr ("Unable to open expected JTTY text file %1: %2") + .arg (path, file.errorString ()); + return {}; + } + + QStringList messages; + QTextStream stream {&file}; + while (!stream.atEnd ()) + { + auto const line = stream.readLine ().simplified (); + if (!line.isEmpty () && !line.startsWith ('#')) messages.append (line); + } + if (messages.isEmpty ()) + { + *error = tr ("Expected JTTY text file %1 contains no messages.") + .arg (path); + } + return messages; +} + +QString LiveAudioTestController::messageFromDecoderLine (QByteArray const& rawLine) +{ + auto const line = QString::fromUtf8 (rawLine).simplified (); + if (line.isEmpty () || line.startsWith ('<')) return {}; + auto const fields = line.split (' ', Qt::SkipEmptyParts); + if (fields.size () < 5) return {}; + bool timeOk {false}; + bool snrOk {false}; + bool dtOk {false}; + bool frequencyOk {false}; + fields.at (0).toInt (&timeOk); + fields.at (1).toInt (&snrOk); + fields.at (2).toDouble (&dtOk); + fields.at (3).toInt (&frequencyOk); + if (!timeOk || !snrOk || !dtOk || !frequencyOk) return {}; + return DecodedText {QString::fromUtf8 (rawLine)}.message ().simplified (); +} + +void LiveAudioTestController::prepareWhenReady () +{ + if (Mode::Jtty == m_mode) + { + prepareJttyWhenReady (); + } + else + { + prepareFt8WhenReady (); + } +} + +void LiveAudioTestController::prepareFt8WhenReady () +{ + if (m_finished || m_armed) return; + if (!m_window->decoderBackendRunning ()) + { + m_prepareTimer.start (50); + return; + } + + auto * ft8Action = m_window->findChild ("actionFT8"); + auto * deepAction = m_window->findChild ("actionDeepestDecode"); + auto * multithreadedAction = + m_window->findChild ("actionUse_multithreaded_FT8_decoder"); + auto * threadCountAction = m_window->findChild ( + QStringLiteral ("actionMT%1").arg (ft8TestThreadCount)); + auto * cycleCountAction = m_window->findChild ( + QStringLiteral ("actionDecFT8cycles%1").arg (ft8TestCycleCount)); + auto * subpassAction = m_window->findChild ("actionFT8subpass"); + auto * twoStageAction = + m_window->findChild ("actionStartTwoStage"); + auto * monitorButton = m_window->findChild ("monitorButton"); + auto * autoButton = m_window->findChild ("autoButton"); + if (!ft8Action || !deepAction || !multithreadedAction + || !threadCountAction || !cycleCountAction || !subpassAction + || !twoStageAction || !monitorButton || !autoButton) + { + fail (tr ("A required FT8 decoder or monitoring GUI control was not found.")); + return; + } + if (!monitorButton->isEnabled ()) + { + m_prepareTimer.start (50); + return; + } + + ft8Action->trigger (); + deepAction->setChecked (true); + if (!multithreadedAction->isChecked ()) multithreadedAction->trigger (); + threadCountAction->trigger (); + cycleCountAction->trigger (); + subpassAction->setChecked (true); + twoStageAction->setChecked (true); + if (!m_window->configureLiveAudioTestDecodeRange ()) + { + fail (tr ("Unable to configure the %1-%2 Hz waterfall decode range.") + .arg (MainWindow::liveAudioTestDecodeLowFrequency ()) + .arg (MainWindow::liveAudioTestDecodeHighFrequency ())); + return; + } + if (!m_window->prepareLiveAudioTestFt8InputCompletion ()) + { + fail (tr ("Unable to prepare the complete FT8 fixture decode.")); + return; + } + + bool const decoderConfigurationMatches = + m_window->liveAudioTestMultithreadedFt8Enabled () + && m_window->liveAudioTestFt8ThreadCount () == ft8TestThreadCount + && m_window->liveAudioTestDecodeDepth () == 3 + && m_window->liveAudioTestFt8Cycles () == ft8TestCycleCount + && m_window->liveAudioTestFt8Sensitivity () == 3 + && m_window->liveAudioTestFt8DecoderStart () == 0; + if (!decoderConfigurationMatches) + { + fail (tr ("Unable to configure the FT8 multithreaded decoder as requested.")); + return; + } + + if (autoButton->isChecked ()) autoButton->click (); + if (!monitorButton->isChecked ()) monitorButton->click (); + if (!m_window->monitoringActive ()) + { + fail (tr ("Monitor did not enter the active state.")); + return; + } + if (m_window->diskDataActive ()) + { + fail (tr ("Synthetic input unexpectedly selected the disk-data path.")); + return; + } + + m_armed = QMetaObject::invokeMethod ( + m_fixture, "arm", Qt::QueuedConnection); + if (!m_armed) + { + fail (tr ("Unable to arm the synthetic audio source.")); + return; + } + std::cerr << "WSJT-X live audio test: GUI ready, FT8 monitoring active, " + << "MTD=1 threads=" << ft8TestThreadCount + << " depth=3 cycles=" << ft8TestCycleCount + << " sensitivity=3 start=0 decode_range=" + << MainWindow::liveAudioTestDecodeLowFrequency () << '-' + << MainWindow::liveAudioTestDecodeHighFrequency () + << std::endl; +} + +void LiveAudioTestController::prepareJttyWhenReady () +{ + if (m_finished || m_armed) return; + + auto * jttyAction = m_window->findChild ("actionJTTY"); + auto * monitorButton = m_window->findChild ("monitorButton"); + m_jttyAllDecodes = m_window->findChild ("decodedTextBrowser"); + m_jttyQsoFrequency = m_window->findChild ("decodedTextBrowser2"); + if (!jttyAction || !monitorButton || !m_jttyAllDecodes || !m_jttyQsoFrequency) + { + fail (tr ("A required JTTY mode, monitoring, or decode display control was not found.")); + return; + } + if (!jttyAction->isEnabled () || !monitorButton->isEnabled ()) + { + m_prepareTimer.start (50); + return; + } + + jttyAction->trigger (); + if (!jttyAction->isChecked ()) + { + fail (tr ("The JTTY GUI action did not select JTTY mode.")); + return; + } + if (!monitorButton->isChecked ()) monitorButton->click (); + if (!m_window->monitoringActive ()) + { + fail (tr ("Monitor did not enter the active state for JTTY.")); + return; + } + if (m_window->diskDataActive ()) + { + fail (tr ("Synthetic JTTY input unexpectedly selected the disk-data path.")); + return; + } + + m_armed = QMetaObject::invokeMethod ( + m_fixture, "arm", Qt::QueuedConnection); + if (!m_armed) + { + fail (tr ("Unable to arm the synthetic JTTY audio source.")); + return; + } + m_jttyPollTimer.start (); + std::cerr << "WSJT-X JTTY live audio test: GUI ready, monitoring active, " + << "expected=\"" << m_expectedJtty.join (QStringLiteral (" | ")).toStdString () << "\"" + << std::endl; +} + +void LiveAudioTestController::maybeFinish () +{ + if (Mode::Jtty == m_mode) + { + maybeFinishJtty (); + } + else + { + maybeFinishFt8 (); + } +} + +void LiveAudioTestController::maybeFinishFt8 () +{ + if (m_finished || !m_fixtureFinished || m_window->decoderBusy () + || !m_completedMultithreadedDecode) + { + return; + } + + if (!m_sawEarlyStandardDecode || !m_sawConfiguredMultithreadedDecode) + { + fail (tr ("The expected early standard and final configured MTD decoder " + "invocations were not both observed.")); + return; + } + if (m_multithreadedRaw.isEmpty ()) + { + fail (tr ("The configured MTD invocation produced no decoder output.")); + return; + } + + QStringList missingFromMultithreadedDecode; + QStringList missingAfterProcessing; + QStringList missingFromDisplay; + for (auto const& message : m_expected) + { + if (!m_multithreadedRaw.contains (message)) + { + missingFromMultithreadedDecode.append (message); + } + if (!m_observed.contains (message)) missingAfterProcessing.append (message); + if (!m_displayed.contains (message)) missingFromDisplay.append (message); + } + missingFromMultithreadedDecode.sort (); + missingAfterProcessing.sort (); + missingFromDisplay.sort (); + if (!missingFromMultithreadedDecode.isEmpty () + || !missingAfterProcessing.isEmpty () || !missingFromDisplay.isEmpty ()) + { + QStringList failures; + if (!missingFromMultithreadedDecode.isEmpty ()) + { + failures.append (tr ("live MTD missing: %1") + .arg (missingFromMultithreadedDecode.join (" | "))); + } + if (!missingAfterProcessing.isEmpty ()) + { + failures.append (tr ("processed missing: %1") + .arg (missingAfterProcessing.join (" | "))); + } + if (!missingFromDisplay.isEmpty ()) + { + failures.append (tr ("display missing: %1") + .arg (missingFromDisplay.join (" | "))); + } + auto multithreaded = m_multithreadedRaw.values (); + auto observed = m_observed.values (); + multithreaded.sort (); + observed.sort (); + fail (tr ("Reference-message validation failed: %1; live MTD output: %2; " + "processed output: %3") + .arg (failures.join ("; ")) + .arg (multithreaded.join (" | ")) + .arg (observed.join (" | "))); + return; + } + if (m_displayed.isEmpty ()) + { + fail (tr ("Decoder messages were processed but none reached the GUI display path.")); + return; + } + + m_finished = true; + m_succeeded = true; + m_timeout.stop (); + m_modalTimer.stop (); + std::cout << "WSJT-X live audio test passed: expected=" << m_expected.size () + << " matched_expected=" << m_expected.size () + << " observed=" << m_observed.size () + << " displayed=" << m_displayed.size () + << " raw_early=" << m_earlyRaw.size () + << " raw_mtd=" << m_multithreadedRaw.size () + << " frames=" << m_emittedFrames + << " rollover_epoch=" << m_rolloverEpoch + << " rollover_end=" << m_rolloverAcceptedEnd + << " rollover_accepted=" << m_rolloverAcceptedBlocks + << " rollover_rejected=" << m_rolloverRejectedBlocks + << " submitted_generation=" << m_submittedGeneration + << " submitted_completions=" << m_submittedCompletions + << " decode_cycles=" << m_completedCycles << std::endl; + m_window->close (); + QCoreApplication::exit (EXIT_SUCCESS); +} + +void LiveAudioTestController::pollJttyDisplay () +{ + if (m_finished || !m_jttyAllDecodes || !m_jttyQsoFrequency) return; + + auto const allText = m_jttyAllDecodes->toPlainText ().simplified ().toUpper (); + auto const qsoText = m_jttyQsoFrequency->toPlainText ().simplified ().toUpper (); + for (auto const& message : m_expectedJtty) + { + if (allText.contains (message)) m_jttyAllFinals.insert (message); + if (qsoText.contains (message)) m_jttyQsoFinals.insert (message); + } + + if (m_jttyAllFinals.isEmpty () && allText.contains (m_expectedJttyPrefix)) + { + m_jttyAllSawPrefix = true; + } + if (m_jttyQsoFinals.isEmpty () && qsoText.contains (m_expectedJttyPrefix)) + { + m_jttyQsoSawPrefix = true; + } + maybeFinishJtty (); +} + +void LiveAudioTestController::maybeFinishJtty () +{ + if (m_finished || !m_fixtureFinished + || m_jttyAllFinals.size () != m_expectedJtty.size () + || m_jttyQsoFinals.size () != m_expectedJtty.size ()) + { + return; + } + auto const messagesAppearInOrder = [this] (QString const& text) { + int offset = 0; + for (auto const& message : m_expectedJtty) + { + auto const index = text.indexOf (message, offset); + if (index < 0) return false; + offset = index + message.size (); + } + return true; + }; + auto const allText = m_jttyAllDecodes->toPlainText ().simplified ().toUpper (); + auto const qsoText = m_jttyQsoFrequency->toPlainText ().simplified ().toUpper (); + if (!messagesAppearInOrder (allText) || !messagesAppearInOrder (qsoText)) + { + fail (tr ("The expected JTTY messages did not reach both panes in FIFO order.")); + return; + } + if (m_expectedJtty.size () == 1 + && (!m_jttyAllSawPrefix || !m_jttyQsoSawPrefix)) + { + fail (tr ("The expected JTTY message reached both panes without an observed growing prefix.")); + return; + } + + m_finished = true; + m_succeeded = true; + m_timeout.stop (); + m_modalTimer.stop (); + m_jttyPollTimer.stop (); + std::cout << "WSJT-X JTTY live audio test passed: expected=" + << m_expectedJtty.size () + << " all_prefix=" << m_jttyAllSawPrefix + << " qso_prefix=" << m_jttyQsoSawPrefix + << " frames=" << m_emittedFrames << std::endl; + m_window->close (); + QCoreApplication::exit (EXIT_SUCCESS); +} + +void LiveAudioTestController::fail (QString const& reason) +{ + if (m_finished) return; + m_finished = true; + m_timeout.stop (); + m_prepareTimer.stop (); + m_modalTimer.stop (); + std::cerr << "WSJT-X live audio test failed: " << reason.toStdString () + << " expected=" << m_expected.size () + << " observed=" << m_observed.size () + << " displayed=" << m_displayed.size () + << " frames=" << m_emittedFrames + << " decode_cycles=" << m_completedCycles << std::endl; + if (Mode::Ft8 == m_mode) + { + std::cerr << "WSJT-X live audio test: submitted rollover epoch=" << m_rolloverEpoch + << " accepted=" << m_rolloverAcceptedBlocks + << " end=" << m_rolloverAcceptedEnd + << " rejected=" << m_rolloverRejectedBlocks + << " generation=" << m_submittedGeneration + << " active_generation=" << m_window->liveAudioTestPublishedDecoderGeneration () + << " completions=" << m_submittedCompletions << std::endl; + std::cerr << "WSJT-X live audio test: FT8 backpressure: " + << m_window->liveAudioTestFt8BackpressureDiagnostics ().toStdString () + << std::endl; + } + auto early = m_earlyObserved.values (); + auto multithreaded = m_multithreadedObserved.values (); + auto earlyRaw = m_earlyRaw.values (); + auto multithreadedRaw = m_multithreadedRaw.values (); + early.sort (); + multithreaded.sort (); + earlyRaw.sort (); + multithreadedRaw.sort (); + std::cerr << "WSJT-X live audio test: early messages: " + << early.join (" | ").toStdString () << std::endl; + std::cerr << "WSJT-X live audio test: MTD messages: " + << multithreaded.join (" | ").toStdString () << std::endl; + std::cerr << "WSJT-X live audio test: raw early messages: " + << earlyRaw.join (" | ").toStdString () << std::endl; + std::cerr << "WSJT-X live audio test: raw MTD messages: " + << multithreadedRaw.join (" | ").toStdString () << std::endl; + if (Mode::Jtty == m_mode && m_jttyAllDecodes && m_jttyQsoFrequency) + { + std::cerr << "WSJT-X JTTY live audio test: All Decodes text: " + << m_jttyAllDecodes->toPlainText ().simplified ().toStdString () + << std::endl; + std::cerr << "WSJT-X JTTY live audio test: QSO Frequency text: " + << m_jttyQsoFrequency->toPlainText ().simplified ().toStdString () + << std::endl; + } + if (auto * modal = QApplication::activeModalWidget ()) modal->close (); + m_window->close (); + QCoreApplication::exit (EXIT_FAILURE); +} + +void LiveAudioTestController::checkForUnexpectedModal () +{ + if (auto * modal = QApplication::activeModalWidget ()) + { + fail (tr ("Unexpected modal window: %1").arg (modal->windowTitle ())); + } +} diff --git a/LiveAudioTestController.hpp b/LiveAudioTestController.hpp new file mode 100644 index 00000000..b3fc9bdd --- /dev/null +++ b/LiveAudioTestController.hpp @@ -0,0 +1,103 @@ +// -*- Mode: C++ -*- +#ifndef LIVE_AUDIO_TEST_CONTROLLER_HPP__ +#define LIVE_AUDIO_TEST_CONTROLLER_HPP__ + +#include +#include +#include +#include +#include +#include + +class FixtureAudioInput; +class MainWindow; +class QTextEdit; + +class LiveAudioTestController final + : public QObject +{ + Q_OBJECT + +public: + enum class Mode + { + Ft8, + Jtty + }; + + LiveAudioTestController (MainWindow * window, FixtureAudioInput * fixture, + QString expectedPath, Mode mode = Mode::Ft8, + QObject * parent = nullptr); + + void begin (); + bool succeeded () const {return m_succeeded;} + +private: + enum class DecoderStage + { + None, + EarlyStandard, + Multithreaded + }; + + static QSet readExpectedMessages (QString const& path, QString * error); + static QStringList readExpectedJttyMessages (QString const& path, QString * error); + static QString messageFromDecoderLine (QByteArray const& line); + void prepareWhenReady (); + void prepareFt8WhenReady (); + void prepareJttyWhenReady (); + void maybeFinish (); + void maybeFinishFt8 (); + void maybeFinishJtty (); + void pollJttyDisplay (); + void fail (QString const& reason); + void checkForUnexpectedModal (); + void exerciseSubmittedFt8Rollover (); + + MainWindow * m_window; + FixtureAudioInput * m_fixture; + QString m_expectedPath; + Mode m_mode; + QSet m_expected; + QStringList m_expectedJtty; + QString m_expectedJttyPrefix; + QSet m_observed; + QSet m_displayed; + QSet m_earlyObserved; + QSet m_multithreadedObserved; + QSet m_earlyRaw; + QSet m_multithreadedRaw; + QString m_initializationError; + QTimer m_timeout; + QTimer m_prepareTimer; + QTimer m_modalTimer; + QTimer m_jttyPollTimer; + QTextEdit * m_jttyAllDecodes {nullptr}; + QTextEdit * m_jttyQsoFrequency {nullptr}; + qint64 m_emittedFrames {0}; + int m_completedCycles {0}; + quint64 m_submittedGeneration {0}; + quint64 m_submittedCycle {0}; + quint64 m_rolloverEpoch {0}; + quint64 m_preRolloverEpoch {0}; + int m_rolloverAcceptedEnd {0}; + int m_rolloverAcceptedBlocks {0}; + int m_rolloverRejectedBlocks {0}; + int m_submittedCompletions {0}; + std::vector m_rolloverSamples; + bool m_rolloverVerified {false}; + DecoderStage m_decoderStage {DecoderStage::None}; + bool m_sawEarlyStandardDecode {false}; + bool m_sawConfiguredMultithreadedDecode {false}; + bool m_completedMultithreadedDecode {false}; + bool m_fixtureFinished {false}; + bool m_armed {false}; + bool m_jttyAllSawPrefix {false}; + bool m_jttyQsoSawPrefix {false}; + QSet m_jttyAllFinals; + QSet m_jttyQsoFinals; + bool m_finished {false}; + bool m_succeeded {false}; +}; + +#endif diff --git a/MessageFilter.cpp b/MessageFilter.cpp new file mode 100644 index 00000000..2ed260a7 --- /dev/null +++ b/MessageFilter.cpp @@ -0,0 +1,21 @@ +#include "MessageFilter.hpp" + +bool MessageFilter::containsAny(const QString& text, const QStringList& keywords) +{ + for (const QString& keyword : keywords) { + if (!keyword.isEmpty() && text.contains(keyword)) { + return true; + } + } + return false; +} + +bool MessageFilter::startsWithAny(const QString& text, const QStringList& keywords) +{ + for (const QString& keyword : keywords) { + if (!keyword.isEmpty() && text.startsWith(keyword)) { + return true; + } + } + return false; +} diff --git a/MessageFilter.hpp b/MessageFilter.hpp new file mode 100644 index 00000000..c15cff6f --- /dev/null +++ b/MessageFilter.hpp @@ -0,0 +1,14 @@ +#ifndef MESSAGEFILTER_HPP +#define MESSAGEFILTER_HPP + +#include +#include + +class MessageFilter +{ +public: + static bool containsAny(const QString& text, const QStringList& keywords); + static bool startsWithAny(const QString& text, const QStringList& keywords); +}; + +#endif // MESSAGEFILTER_HPP diff --git a/MessageFilterLogic.cpp b/MessageFilterLogic.cpp new file mode 100644 index 00000000..0b5c686f --- /dev/null +++ b/MessageFilterLogic.cpp @@ -0,0 +1,55 @@ +#include "MessageFilterLogic.hpp" + +#include "MessageFilterRules.hpp" +#include "Decoder/decodedtext.h" +#include "logbook/logbook.h" +#include "CountryNames.hpp" +#include "logbook/AD1CCty.hpp" + +MessageFilterLogic::FilterResult MessageFilterLogic::evaluateMSK144(const DecodedText& decodedtext, const FilterContext& ctx, LogBook* logbook) +{ + auto evaluation = MessageFilterRules::evaluateMSK144Text(decodedtext.string(), ctx); + auto result = evaluation.result; + + if (result.shouldReturn || !evaluation.filtersApplied) return result; + + if (ctx.hideTerritory1 || ctx.hideTerritory2 || ctx.hideTerritory3 || ctx.hideTerritory4 || + ctx.hideB4 || ctx.hideEU || ctx.hideAS || ctx.hideNA || ctx.hideSA || ctx.hideAF || + ctx.hideOC || ctx.hideAN) { + + QString deCall; + QString deGrid; + decodedtext.deCallAndGrid(deCall, deGrid); + + if (ctx.hideTerritory1 || ctx.hideTerritory2 || ctx.hideTerritory3 || ctx.hideTerritory4) { + auto const& looked_up = logbook->countries()->lookup(deCall); + auto countryName = Radio::CountryNames::abbreviate(looked_up.entity_name); + if (ctx.hideTerritory1 && countryName.contains(ctx.territory1) && !ctx.territory1.isEmpty() && !ctx.bypass) result.filtered = true; + if (ctx.hideTerritory2 && countryName.contains(ctx.territory2) && !ctx.territory2.isEmpty() && !ctx.bypass) result.filtered = true; + if (ctx.hideTerritory3 && countryName.contains(ctx.territory3) && !ctx.territory3.isEmpty() && !ctx.bypass) result.filtered = true; + if (ctx.hideTerritory4 && countryName.contains(ctx.territory4) && !ctx.territory4.isEmpty() && !ctx.bypass) result.filtered = true; + } + + if (ctx.hideB4) { + bool callB4onBand, countryB4onBand, gridB4onBand, continentB4onBand, CQZoneB4onBand, ITUZoneB4onBand; + auto const& looked_up = logbook->countries()->lookup(deCall); + logbook->match(deCall, ctx.mode, deGrid, looked_up, callB4onBand, countryB4onBand, gridB4onBand, + continentB4onBand, CQZoneB4onBand, ITUZoneB4onBand, ctx.currentBand); + if (callB4onBand && !ctx.bypass) result.filtered = true; + } + + if (ctx.hideEU || ctx.hideAS || ctx.hideNA || ctx.hideSA || ctx.hideAF || ctx.hideOC || ctx.hideAN) { + auto const& looked_up = logbook->countries()->lookup(deCall); + QString continent = AD1CCty::continent(looked_up.continent); + if (ctx.hideEU && continent == "EU" && !ctx.bypass) result.filtered = true; + if (ctx.hideAS && continent == "AS" && !ctx.bypass) result.filtered = true; + if (ctx.hideNA && continent == "NA" && !ctx.bypass) result.filtered = true; + if (ctx.hideSA && continent == "SA" && !ctx.bypass) result.filtered = true; + if (ctx.hideAF && continent == "AF" && !ctx.bypass) result.filtered = true; + if (ctx.hideOC && continent == "OC" && !ctx.bypass) result.filtered = true; + if (ctx.hideAN && continent == "AN" && !ctx.bypass) result.filtered = true; + } + } + + return result; +} diff --git a/MessageFilterLogic.hpp b/MessageFilterLogic.hpp new file mode 100644 index 00000000..32cc2d6b --- /dev/null +++ b/MessageFilterLogic.hpp @@ -0,0 +1,63 @@ +#ifndef MESSAGEFILTERLOGIC_HPP +#define MESSAGEFILTERLOGIC_HPP + +#include +#include + +#include "AutoRespondPolicy.hpp" +#include "SpecialOperatingActivity.hpp" + +class DecodedText; +class LogBook; + +class MessageFilterLogic +{ +public: + struct FilterContext { + SpecialOperatingActivity specOp {SpecialOperatingActivity::NONE}; + bool bypass {false}; + bool filtersForWord2 {false}; + bool filtersForWaitAndPounceOnly {false}; + bool alwaysPass {false}; + bool blacklisted {false}; + bool whitelisted {false}; + QStringList passKeywords; + QStringList blacklistKeywords; + QStringList whitelistKeywords; + + // Geographical/B4 filters + bool hideTerritory1 {false}; + bool hideTerritory2 {false}; + bool hideTerritory3 {false}; + bool hideTerritory4 {false}; + bool hideB4 {false}; + bool hideEU {false}; + bool hideAS {false}; + bool hideNA {false}; + bool hideSA {false}; + bool hideAF {false}; + bool hideOC {false}; + bool hideAN {false}; + + QString territory1; + QString territory2; + QString territory3; + QString territory4; + + QString currentBand; + QString mode; + + bool pounce {false}; + AutoRespondPolicy respondPolicy {AutoRespondPolicy::None}; + }; + + struct FilterResult { + bool filtered {false}; + bool shouldReturn {false}; + bool resetPoints {false}; + }; + + static FilterResult evaluateMSK144(const DecodedText& decodedtext, const FilterContext& ctx, LogBook* logbook); +}; + +#endif // MESSAGEFILTERLOGIC_HPP diff --git a/MessageFilterRules.cpp b/MessageFilterRules.cpp new file mode 100644 index 00000000..6208d998 --- /dev/null +++ b/MessageFilterRules.cpp @@ -0,0 +1,72 @@ +#include "MessageFilterRules.hpp" + +#include "MessageFilter.hpp" + +#include +#include + +namespace +{ + using SpecOp = SpecialOperatingActivity; + +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + auto const SkipEmptyParts = Qt::SkipEmptyParts; +#else + auto const SkipEmptyParts = QString::SkipEmptyParts; +#endif + + QString msk144FilterText(QString const& text, MessageFilterLogic::FilterContext const& ctx) + { + if (!ctx.filtersForWord2) return text; + + QStringList const words = text.mid(24).split(" ", SkipEmptyParts); + if (words.size() < 2) return "___"; + if (words[1].length() == 2 && words[1].contains(QRegularExpression{"\\w\\w"})) { + return words.size() > 2 ? words[2] : "___"; + } + return words[1]; + } + + bool containsFilterMatch(QString const& filterText, QStringList const& keywords, bool startsWith) + { + return startsWith ? MessageFilter::startsWithAny(filterText, keywords) + : MessageFilter::containsAny(filterText, keywords); + } +} + +MessageFilterRules::Evaluation MessageFilterRules::evaluateMSK144Text(QString text, MessageFilterLogic::FilterContext const& ctx) +{ + Evaluation evaluation; + text = text.replace("<", "").replace(">", ""); + + bool const startsWith = ctx.filtersForWord2; + QString const filterText = msk144FilterText(text, ctx); + + if (SpecOp::NONE == ctx.specOp && ctx.alwaysPass && containsFilterMatch(filterText, ctx.passKeywords, startsWith)) { + return evaluation; + } + + evaluation.filtersApplied = true; + + if (SpecOp::NONE == ctx.specOp && ctx.blacklisted && containsFilterMatch(filterText, ctx.blacklistKeywords, startsWith)) { + if (!ctx.bypass) evaluation.result.filtered = true; + if (!(ctx.filtersForWaitAndPounceOnly || ctx.bypass)) { + evaluation.result.shouldReturn = true; + return evaluation; + } + if (ctx.pounce && isScoringAutoRespondPolicy (ctx.respondPolicy)) { + evaluation.result.resetPoints = true; + } + } else if (SpecOp::NONE == ctx.specOp && ctx.whitelisted && !containsFilterMatch(filterText, ctx.whitelistKeywords, startsWith)) { + if (!ctx.bypass) evaluation.result.filtered = true; + if (!(ctx.filtersForWaitAndPounceOnly || ctx.bypass)) { + evaluation.result.shouldReturn = true; + return evaluation; + } + if (ctx.pounce && isScoringAutoRespondPolicy (ctx.respondPolicy)) { + evaluation.result.resetPoints = true; + } + } + + return evaluation; +} diff --git a/MessageFilterRules.hpp b/MessageFilterRules.hpp new file mode 100644 index 00000000..88e0e618 --- /dev/null +++ b/MessageFilterRules.hpp @@ -0,0 +1,19 @@ +#ifndef MESSAGEFILTERRULES_HPP +#define MESSAGEFILTERRULES_HPP + +#include "MessageFilterLogic.hpp" + +#include + +namespace MessageFilterRules +{ + struct Evaluation + { + MessageFilterLogic::FilterResult result; + bool filtersApplied {false}; + }; + + Evaluation evaluateMSK144Text(QString text, MessageFilterLogic::FilterContext const& ctx); +} + +#endif // MESSAGEFILTERRULES_HPP diff --git a/MetaDataRegistry.cpp b/MetaDataRegistry.cpp index f6c50c1f..3c842c43 100644 --- a/MetaDataRegistry.cpp +++ b/MetaDataRegistry.cpp @@ -7,6 +7,11 @@ #include "Radio.hpp" #include "models/FrequencyList.hpp" #include "Audio/AudioDevice.hpp" +#include "Audio/AudioStreamDescriptor.hpp" +#include "Audio/TxAudioQueue.hpp" +#include "Audio/TxIdentity.hpp" +#include "Audio/TxPlaybackEvidence.hpp" +#include "Audio/TxRequest.hpp" #include "Configuration.hpp" #include "models/StationList.hpp" #include "Transceiver/Transceiver.hpp" @@ -67,6 +72,15 @@ void register_types () // Audio device qRegisterMetaType ("AudioDevice::Channel"); + qRegisterMetaType ("AudioStreamDescriptor"); + qRegisterMetaType ("TxEvidence::TxSessionId"); + qRegisterMetaType ("TxEvidence::TxGeneration"); + qRegisterMetaType ("TxAudioQueueEpoch"); + qRegisterMetaType ("TxAudioQueueProgress"); + qRegisterMetaType ("TxAudioQueueDrainState"); + TxEvidence::register_tx_request_type (); + qRegisterMetaType ("TxEvidence::TxStartSnapshot"); + qRegisterMetaType ("TxEvidence::TxRawPlayoutSnapshot"); // Configuration qRegisterMetaTypeStreamOperators ("Configuration::DataMode"); diff --git a/Modulator/JttyPcmFifo.cpp b/Modulator/JttyPcmFifo.cpp new file mode 100644 index 00000000..fd6d82d7 --- /dev/null +++ b/Modulator/JttyPcmFifo.cpp @@ -0,0 +1,245 @@ +#include "JttyPcmFifo.hpp" + +#include + +namespace +{ + qint64 advanceIndex (qint64 index, qint64 capacity) noexcept + { + ++index; + return index == capacity ? 0 : index; + } + + qint64 copyIntoRing (QVector& buffer, qint64 capacity, qint64 tail, + qint16 const * samples, qint64 count) + { + qint64 const first = std::min (count, capacity - tail); + std::copy_n (samples, first, buffer.data () + tail); + + qint64 const remaining = count - first; + if (remaining > 0) + { + std::copy_n (samples + first, remaining, buffer.data ()); + return remaining; + } + + tail += first; + return tail == capacity ? 0 : tail; + } +} + +JttyPcmFifo::JttyPcmFifo (qint64 capacitySamples) + : m_buffer (int (capacitySamples)) + , m_capacity {capacitySamples} + , m_head {0} + , m_tail {0} + , m_used {0} + , m_totalReal {0} + , m_servedReal {0} + , m_streamPos {0} + , m_realEndStreamPos {0} + , m_epoch {0} + , m_resetRequestedGeneration {0} + , m_resetAppliedGeneration {0} + , m_resetEpoch {0} + , m_resetTail {0} + , m_resetTotalBaseline {0} + , m_drainSignaled {false} + , m_drainReady {false} + , m_drainReadyEpoch {0} + , m_drainReadyTotal {0} +{ +} + +bool JttyPcmFifo::enqueue (QVector const& samples, qint64 epoch) +{ + if (samples.isEmpty ()) return true; + return enqueue (samples.constData (), samples.size (), epoch); +} + +bool JttyPcmFifo::enqueue (qint16 const * samples, qint64 count, qint64 epoch) +{ + if (!samples || count <= 0) return true; + + qint64 const used = m_used.load (std::memory_order_acquire); + if (!jttyPcmEnqueueFits (m_capacity, used, count)) return false; + + qint64 const tail = copyIntoRing (m_buffer, m_capacity, + m_tail.load (std::memory_order_relaxed), + samples, count); + + m_epoch.store (epoch, std::memory_order_release); + m_tail.store (tail, std::memory_order_release); + m_totalReal.fetch_add (count, std::memory_order_acq_rel); + m_drainSignaled.store (false, std::memory_order_release); + m_used.fetch_add (count, std::memory_order_release); + return true; +} + +void JttyPcmFifo::clear (qint64 epoch) +{ + qint64 const tail = m_tail.load (std::memory_order_acquire); + qint64 const total = m_totalReal.load (std::memory_order_acquire); + qint64 const generation = m_resetRequestedGeneration.load (std::memory_order_relaxed) + 1; + + m_resetEpoch.store (epoch, std::memory_order_release); + m_resetTail.store (tail, std::memory_order_release); + m_resetTotalBaseline.store (total, std::memory_order_release); + m_resetRequestedGeneration.store (generation, std::memory_order_release); +} + +void JttyPcmFifo::applyPendingReset () noexcept +{ + qint64 const requested = m_resetRequestedGeneration.load (std::memory_order_acquire); + qint64 const applied = m_resetAppliedGeneration.load (std::memory_order_acquire); + if (requested <= applied) return; + + qint64 const resetTail = m_resetTail.load (std::memory_order_acquire); + qint64 const resetTotal = m_resetTotalBaseline.load (std::memory_order_acquire); + qint64 const resetEpoch = m_resetEpoch.load (std::memory_order_acquire); + qint64 const served = m_servedReal.load (std::memory_order_acquire); + qint64 const used = m_used.load (std::memory_order_acquire); + qint64 skipped = resetTotal > served ? resetTotal - served : 0; + if (skipped > used) skipped = used; + + m_head.store (resetTail, std::memory_order_release); + if (skipped > 0) + { + m_used.fetch_sub (skipped, std::memory_order_acq_rel); + } + if (served < resetTotal) + { + m_servedReal.store (resetTotal, std::memory_order_release); + } + + m_streamPos.store (0, std::memory_order_release); + m_realEndStreamPos.store (0, std::memory_order_release); + m_epoch.store (resetEpoch, std::memory_order_release); + m_drainSignaled.store (false, std::memory_order_release); + m_drainReady.store (false, std::memory_order_release); + m_drainReadyEpoch.store (resetEpoch, std::memory_order_release); + m_drainReadyTotal.store (0, std::memory_order_release); + m_resetAppliedGeneration.store (requested, std::memory_order_release); +} + +qint16 JttyPcmFifo::pullSample (qint64 drainGuard) noexcept +{ + applyPendingReset (); + + qint16 sample {0}; + if (m_used.load (std::memory_order_acquire) > 0) + { + qint64 head = m_head.load (std::memory_order_relaxed); + sample = m_buffer[int (head)]; + head = advanceIndex (head, m_capacity); + m_head.store (head, std::memory_order_release); + m_used.fetch_sub (1, std::memory_order_release); + qint64 const streamPos = m_streamPos.fetch_add (1, std::memory_order_acq_rel) + 1; + m_servedReal.fetch_add (1, std::memory_order_acq_rel); + m_realEndStreamPos.store (streamPos, std::memory_order_release); + } + else + { + m_streamPos.fetch_add (1, std::memory_order_acq_rel); + } + + updateDrainState (drainGuard); + return sample; +} + +JttyPcmFifo::DrainState JttyPcmFifo::takeDrainReady () noexcept +{ + if (m_resetRequestedGeneration.load (std::memory_order_acquire) + > m_resetAppliedGeneration.load (std::memory_order_acquire)) + { + m_drainReady.exchange (false, std::memory_order_acq_rel); + return DrainState {false, 0, 0}; + } + + if (!m_drainReady.exchange (false, std::memory_order_acq_rel)) + { + return DrainState {false, 0, 0}; + } + + return DrainState { + true, + m_drainReadyEpoch.load (std::memory_order_acquire), + m_drainReadyTotal.load (std::memory_order_acquire) + }; +} + +qint64 JttyPcmFifo::queuedReal () const noexcept +{ + qint64 const used = m_used.load (std::memory_order_acquire); + qint64 const resetTotal = m_resetTotalBaseline.load (std::memory_order_acquire); + qint64 const served = m_servedReal.load (std::memory_order_acquire); + qint64 const abortedQueued = resetTotal > served ? resetTotal - served : 0; + return used > abortedQueued ? used - abortedQueued : 0; +} + +qint64 JttyPcmFifo::servedReal () const noexcept +{ + return logicalServedReal (); +} + +qint64 JttyPcmFifo::totalReal () const noexcept +{ + return logicalTotalReal (); +} + +void JttyPcmFifo::updateDrainState (qint64 drainGuard) noexcept +{ + if (m_drainSignaled.load (std::memory_order_acquire)) return; + + // Drain is based on consumed real samples plus backend tail coverage. This + // avoids trusting FIFO-empty alone, which would release PTT before queued + // audio has actually left the hardware or TCI transmit buffer. + qint64 const servedReal = logicalServedReal (); + qint64 const totalReal = logicalTotalReal (); + qint64 const streamPos = m_streamPos.load (std::memory_order_acquire); + qint64 const realEndStreamPos = m_realEndStreamPos.load (std::memory_order_acquire); + if (!jttyTxDrained (servedReal, totalReal, streamPos, realEndStreamPos, drainGuard)) + { + return; + } + + bool expected {false}; + if (m_drainSignaled.compare_exchange_strong (expected, true, std::memory_order_acq_rel)) + { + m_drainReadyEpoch.store (m_epoch.load (std::memory_order_acquire), std::memory_order_release); + m_drainReadyTotal.store (totalReal, std::memory_order_release); + m_drainReady.store (true, std::memory_order_release); + } +} + +qint64 JttyPcmFifo::logicalServedReal () const noexcept +{ + qint64 const served = m_servedReal.load (std::memory_order_acquire); + qint64 const resetTotal = m_resetTotalBaseline.load (std::memory_order_acquire); + return served > resetTotal ? served - resetTotal : 0; +} + +qint64 JttyPcmFifo::logicalTotalReal () const noexcept +{ + qint64 const total = m_totalReal.load (std::memory_order_acquire); + qint64 const resetTotal = m_resetTotalBaseline.load (std::memory_order_acquire); + return total > resetTotal ? total - resetTotal : 0; +} + +bool jttyTxDrained (qint64 servedReal, qint64 totalReal, + qint64 streamPos, qint64 realEndStreamPos, + qint64 drainGuard) +{ + if (totalReal <= 0) return false; + if (servedReal < totalReal) return false; + return (streamPos - realEndStreamPos) >= drainGuard; +} + +bool jttyPcmEnqueueFits (qint64 capacitySamples, qint64 usedSamples, + qint64 count) noexcept +{ + if (count <= 0) return true; + if (capacitySamples <= 0 || usedSamples < 0) return false; + if (usedSamples > capacitySamples) return false; + return count <= capacitySamples - usedSamples; +} diff --git a/Modulator/JttyPcmFifo.hpp b/Modulator/JttyPcmFifo.hpp new file mode 100644 index 00000000..f084a6ef --- /dev/null +++ b/Modulator/JttyPcmFifo.hpp @@ -0,0 +1,81 @@ +#ifndef JTTY_PCM_FIFO_HPP__ +#define JTTY_PCM_FIFO_HPP__ + +#include + +#include + +class JttyPcmFifo +{ +public: + // Lock-free SPSC PCM queue: one producer appends rendered messages, one + // backend thread pulls samples. clear() only publishes a reset generation; + // the consumer applies it so FIFO indices are not concurrently rewritten. + // The audio backend reports this edge later, outside the pull callback. The + // epoch/total pair lets MainWindow ignore a tail event that belonged to an + // older queue state. + struct DrainState + { + bool ready; + qint64 epoch; + qint64 totalAtDrain; + }; + + explicit JttyPcmFifo (qint64 capacitySamples); + + bool enqueue (QVector const& samples, qint64 epoch); + bool enqueue (qint16 const * samples, qint64 count, qint64 epoch); + void clear (qint64 epoch = 0); + void applyPendingReset () noexcept; + + qint16 pullSample (qint64 drainGuard) noexcept; + DrainState takeDrainReady () noexcept; + + qint64 capacity () const {return m_capacity;} + qint64 queuedReal () const noexcept; + qint64 servedReal () const noexcept; + qint64 totalReal () const noexcept; + +private: + // Single producer, single consumer: MainWindow appends complete rendered + // messages, and one audio pull path consumes frames. The pull side is kept to + // atomics and array access so it can run in a real-time-ish audio callback. + void updateDrainState (qint64 drainGuard) noexcept; + qint64 logicalServedReal () const noexcept; + qint64 logicalTotalReal () const noexcept; + + QVector m_buffer; + qint64 const m_capacity; + + std::atomic m_head; + std::atomic m_tail; + std::atomic m_used; + + std::atomic m_totalReal; + std::atomic m_servedReal; + std::atomic m_streamPos; + std::atomic m_realEndStreamPos; + std::atomic m_epoch; + + // clear() publishes a reset generation boundary; pullSample() and other + // consumer-owned entry points apply it. Enqueue, progress getters, and drain + // signaling must interpret this same generation baseline. + std::atomic m_resetRequestedGeneration; + std::atomic m_resetAppliedGeneration; + std::atomic m_resetEpoch; + std::atomic m_resetTail; + std::atomic m_resetTotalBaseline; + + std::atomic m_drainSignaled; + std::atomic m_drainReady; + std::atomic m_drainReadyEpoch; + std::atomic m_drainReadyTotal; +}; + +bool jttyTxDrained (qint64 servedReal, qint64 totalReal, + qint64 streamPos, qint64 realEndStreamPos, + qint64 drainGuard); +bool jttyPcmEnqueueFits (qint64 capacitySamples, qint64 usedSamples, + qint64 count) noexcept; + +#endif diff --git a/Modulator/JttyTxStream.cpp b/Modulator/JttyTxStream.cpp new file mode 100644 index 00000000..5e65c1cd --- /dev/null +++ b/Modulator/JttyTxStream.cpp @@ -0,0 +1,120 @@ +#include "JttyTxStream.hpp" + +#include "Audio/soundout.h" +#include "Logger.hpp" + +#include "moc_JttyTxStream.cpp" + +namespace +{ + // Trailing silence (samples) served past the last real sample before we trust + // the queue has physically played out, when the device buffer size is unknown. + // Generous by design: it only lengthens the PTT tail after the final message, + // never the gap between chained messages. + constexpr qint64 DEFAULT_DRAIN_GUARD = 9600; // 200 ms at 48 kHz + constexpr qint64 DRAIN_GUARD_MARGIN = 4800; // 100 ms safety margin +} + +TxEvidence::TxStartSnapshot makeJttyTxStartSnapshot (TxEvidence::TxRequest const& request, + qint64 committedEndSample) +{ + TxEvidence::TxStartSnapshot snapshot; + snapshot.session_id = request.session_id; + snapshot.generation = request.generation; + snapshot.mode = request.mode; + snapshot.sample_rate_hz = 48000; + snapshot.committed_end_sample = committedEndSample; + snapshot.target_known = false; + snapshot.diagnostic = "JTTY PCM extent may grow while messages are queued"; + return snapshot; +} + +JttyTxStream::JttyTxStream (TxAudioQueue& queue, QObject * parent) + : AudioDevice {parent} + , m_queue {queue} + , m_drainGuard {DEFAULT_DRAIN_GUARD} + , m_drainTimer {new QTimer {this}} + , m_active {false} +{ + m_drainTimer->setInterval (25); + connect (m_drainTimer, &QTimer::timeout, this, &JttyTxStream::pollDrain); +} + +void JttyTxStream::start (TxEvidence::TxRequest request, SoundOutput * stream) +{ + if (m_active) return; + auto progress = m_queue.progress (); + if (progress.epoch != request.queue_epoch) + { + LOG_DEBUG ("JTTY transmit stream start rejected before pending reset; " + "requested queue epoch=" << request.queue_epoch.value () + << " current epoch=" << progress.epoch.value ()); + return; + } + m_queue.applyPendingReset (); + progress = m_queue.progress (); + if (progress.epoch != request.queue_epoch) + { + LOG_DEBUG ("JTTY transmit stream start rejected after pending reset; " + "requested queue epoch=" << request.queue_epoch.value () + << " current epoch=" << progress.epoch.value ()); + return; + } + initialize (QIODevice::ReadOnly, request.channel); + m_active = true; + m_stream = stream; + if (m_stream) + { + m_stream->restart (this); + // Size the drain guard to the actual device buffer (now valid) plus a + // margin; same audio thread as SoundOutput, so this is not a cross-thread + // QAudioOutput access. + qint64 const bufFrames = bytesPerFrame () + ? qint64 (m_stream->bufferSize ()) / qint64 (bytesPerFrame ()) + : 0; + m_drainGuard.store (qMax (bufFrames, DEFAULT_DRAIN_GUARD) + DRAIN_GUARD_MARGIN, + std::memory_order_release); + } + if (!m_drainTimer->isActive ()) m_drainTimer->start (); + Q_EMIT txSourceCommitted (makeJttyTxStartSnapshot ( + request, progress.total_samples > 0 ? progress.total_samples - 1 : -1)); +} + +void JttyTxStream::stop () +{ + if (m_stream) + { + m_stream->stop (); + } + m_active = false; + m_drainTimer->stop (); + AudioDevice::close (); + // Do not drop queued PCM here. A GUI stop for the previous session can cross + // with the next enqueue; clear() is the explicit abort path. +} + +qint64 JttyTxStream::readData (char * data, qint64 maxSize) +{ + if (maxSize == 0) return 0; + Q_ASSERT (!(maxSize % qint64 (bytesPerFrame ()))); // no torn frames + + qint64 const numFrames {maxSize / qint64 (bytesPerFrame ())}; + qint16 * samples {reinterpret_cast (data)}; + + qint64 const drainGuard = m_drainGuard.load (std::memory_order_acquire); + for (qint64 frame = 0; frame < numFrames; ++frame) + { + samples = load (m_queue.pullSample (drainGuard), samples); + } + + return numFrames * qint64 (bytesPerFrame ()); +} + +void JttyTxStream::pollDrain () +{ + auto const drain = m_queue.takeDrainReady (); + if (drain.ready) + { + Q_EMIT drained (drain); + } +} diff --git a/Modulator/JttyTxStream.hpp b/Modulator/JttyTxStream.hpp new file mode 100644 index 00000000..1a1d8784 --- /dev/null +++ b/Modulator/JttyTxStream.hpp @@ -0,0 +1,60 @@ +#ifndef JTTY_TX_STREAM_HPP__ +#define JTTY_TX_STREAM_HPP__ + +#include +#include +#include +#include + +#include "Audio/AudioDevice.hpp" +#include "Audio/TxAudioQueue.hpp" +#include "Audio/TxPlaybackEvidence.hpp" +#include "Audio/TxRequest.hpp" + +class SoundOutput; + +TxEvidence::TxStartSnapshot makeJttyTxStartSnapshot ( + TxEvidence::TxRequest const& request, qint64 committedEndSample); + +// +// JTTY-only asynchronous transmit source. +// +// A QIODevice adapter around the shared JTTY PCM FIFO. readData() only serves +// samples and records drain readiness; drained() is emitted by a timer outside +// the audio pull path. +// +class JttyTxStream + : public AudioDevice +{ + Q_OBJECT; + +public: + explicit JttyTxStream (TxAudioQueue& queue, QObject * parent = nullptr); + + bool isActive () const {return m_active;} + + Q_SLOT void start (TxEvidence::TxRequest request, SoundOutput * stream); + Q_SLOT void stop (); + + Q_SIGNAL void drained (TxAudioQueueDrainState drain); + Q_SIGNAL void txSourceCommitted (TxEvidence::TxStartSnapshot snapshot); + +protected: + qint64 readData (char * data, qint64 maxSize) override; + qint64 writeData (char const * /* data */, qint64 /* maxSize */) override + { + return -1; // we don't consume data + } + +private: + Q_SLOT void pollDrain (); + + TxAudioQueue& m_queue; + std::atomic m_drainGuard; + + QPointer m_stream; + QTimer * m_drainTimer; + std::atomic m_active; +}; + +#endif diff --git a/Modulator/Modulator.cpp b/Modulator/Modulator.cpp index 0022b08c..0467a483 100644 --- a/Modulator/Modulator.cpp +++ b/Modulator/Modulator.cpp @@ -1,4 +1,5 @@ #include "Modulator.hpp" +#include #include #include #include @@ -25,6 +26,66 @@ extern float gran(); // Noise generator (for tests only) double constexpr Modulator::m_twoPi; +namespace +{ + TxEvidence::TxStartSnapshot txStartSnapshot (TxEvidence::TxSessionId sessionId, + TxEvidence::TxGeneration generation, + QString const& mode, int sampleRateHz, + qint64 silentFrames, unsigned initialSample, + bool tuning, bool fastMode, + bool hasCwId, + unsigned symbolsLength, + double framesPerSymbol, + double trPeriod) + { + TxEvidence::TxStartSnapshot snapshot; + snapshot.session_id = sessionId; + snapshot.generation = generation; + snapshot.mode = mode; + snapshot.sample_rate_hz = sampleRateHz; + if (mode == QStringLiteral ("JTTY")) + { + snapshot.diagnostic = QStringLiteral ("JTTY source commits its own target."); + return snapshot; + } + if (tuning) + { + snapshot.diagnostic = QStringLiteral ("Tune transmission has no bounded target."); + return snapshot; + } + if (hasCwId) + { + snapshot.diagnostic = QStringLiteral ("CW ID can extend the generated target."); + return snapshot; + } + if (symbolsLength == 0 || framesPerSymbol <= 0.0) + { + snapshot.diagnostic = QStringLiteral ("Generated target inputs are invalid."); + return snapshot; + } + + double const end = fastMode ? trPeriod * 48000.0 - 24000.0 + : symbolsLength * 4.0 * framesPerSymbol; + if (end < 0.0 || end > std::numeric_limits::max ()) + { + snapshot.diagnostic = QStringLiteral ("Generated target end is invalid."); + return snapshot; + } + unsigned const i1 {static_cast (end)}; + if (initialSample > i1) + { + snapshot.diagnostic = QStringLiteral ("Late start skipped the generated target."); + return snapshot; + } + + snapshot.target_known = true; + snapshot.committed_end_sample = TxEvidence::boundedCommittedEndSample ( + silentFrames, initialSample, i1); + snapshot.diagnostic = QStringLiteral ("Generated target committed."); + return snapshot; + } +} + // float wpm=20.0; // unsigned m_nspd=1.2*48000.0/wpm; // m_nspd=3072; //18.75 WPM @@ -46,41 +107,59 @@ Modulator::Modulator (unsigned frameRate, double periodLengthInSeconds, { } -void Modulator::start (QString mode, unsigned symbolsLength, double framesPerSymbol, - double frequency, double toneSpacing, - SoundOutput * stream, Channel channel, - bool synchronize, bool fastMode, double dBSNR, double TRperiod) +void Modulator::start (TxEvidence::TxRequest request, SoundOutput * stream) { - // qDebug () << "mode:" << mode << "symbolsLength:" << symbolsLength << "framesPerSymbol:" << framesPerSymbol << "frequency:" << frequency << "toneSpacing:" << toneSpacing << "channel:" << channel << "synchronize:" << synchronize << "fastMode:" << fastMode << "dBSNR:" << dBSNR << "TRperiod:" << TRperiod; +// qDebug () << request.mode << request.symbols_length << request.frames_per_symbol +// << request.frequency_hz << request.tone_spacing << request.channel +// << request.synchronize << request.fast_mode << request.snr_db +// << request.tr_period_s; Q_ASSERT (stream); // Time according to this computer which becomes our base time - qint64 ms0 = QDateTime::currentMSecsSinceEpoch() % 86400000; + auto const actualStartMs = QDateTime::currentMSecsSinceEpoch (); + qint64 ms0 = actualStartMs % 86400000; unsigned mstr = ms0 % int(1000.0*m_period); // ms into the nominal Tx start time + bool const constrained = request.start_window_open_ms >= 0 + && request.start_window_close_ms >= request.start_window_open_ms; + if (constrained + && (actualStartMs < request.start_window_open_ms + || actualStartMs > request.start_window_close_ms)) + { + Q_EMIT constrainedStartDecided (request.session_id.value (), + request.generation.value (), + request.start_window_open_ms, false, + actualStartMs); + return; + } + if(m_state != Idle) stop(); + m_mode = request.mode; m_quickClose = false; - m_symbolsLength = symbolsLength; + m_symbolsLength = request.symbols_length; m_isym0 = std::numeric_limits::max (); // big number m_frequency0 = 0.; m_phi = 0.; - m_addNoise = dBSNR < 0.; - m_nsps = framesPerSymbol; - m_frequency = frequency; + m_addNoise = request.snr_db < 0.; + m_nsps = request.frames_per_symbol; + m_frequency = request.frequency_hz; m_amp = std::numeric_limits::max (); - m_toneSpacing = toneSpacing; - m_bFastMode=fastMode; - m_TRperiod=TRperiod; + m_toneSpacing = request.tone_spacing; + m_bFastMode=request.fast_mode; + m_TRperiod=request.tr_period_s; + m_tuning=request.tuning; + m_cwId=request.cw_id; m_icmin=4294967295; m_icmax=0; unsigned delay_ms=1000; - if((mode=="FT8" and m_nsps==1920) or (mode=="FST4" and m_nsps==720)) delay_ms=500; //FT8, FST4-15 - if((mode=="FT8" and m_nsps==1024)) delay_ms=400; //SuperFox Qary Polar Code transmission - if(mode=="Q65" and m_nsps<=3600) delay_ms=500; //Q65-15 and Q65-30 - if(mode=="FT4") delay_ms=300; //FT4 + if((request.mode=="FT8" and m_nsps==1920) or (request.mode=="FST4" and m_nsps==720)) delay_ms=500; //FT8, FST4-15 + if((request.mode=="FT8" and m_nsps==1024)) delay_ms=400; //SuperFox Qary Polar Code transmission + if(request.mode=="Q65" and m_nsps<=3600) delay_ms=500; //Q65-15 and Q65-30 + if(request.mode=="FT4") delay_ms=300; //FT4 + if(request.mode=="JTTY")delay_ms=0; // noise generator parameters if (m_addNoise) { - m_snr = qPow (10.0, 0.05 * (dBSNR - 6.0)); + m_snr = qPow (10.0, 0.05 * (request.snr_db - 6.0)); m_fac = 3000.0; if (m_snr > 1.0) m_fac = 3000.0 / m_snr; } @@ -91,35 +170,52 @@ void Modulator::start (QString mode, unsigned symbolsLength, double framesPerSym { // calculate number of silent frames to send, so that audio will // start at the nominal time "delay_ms" into the Tx sequence. - if (synchronize) + if (request.synchronize) { - if(delay_ms > mstr) m_silentFrames = (delay_ms - mstr) * m_frameRate / 1000; + if(delay_ms > mstr) { + m_silentFrames = + std::uint64_t {delay_ms - mstr} * m_frameRate / 1000; + } } // adjust for late starts if(!m_silentFrames && mstr >= delay_ms) { - m_ic = (mstr - delay_ms) * m_frameRate / 1000; + auto const initialFrame = + std::uint64_t {mstr - delay_ms} * m_frameRate / 1000; + Q_ASSERT (initialFrame <= std::numeric_limits::max ()); + m_ic = static_cast (initialFrame); } } - if(mode=="Echo") m_ic=0; + if(request.mode=="Echo" or request.mode=="JTTY") m_ic=0; - initialize (QIODevice::ReadOnly, channel); - Q_EMIT stateChanged ((m_state = (synchronize && m_silentFrames) ? + initialize (QIODevice::ReadOnly, request.channel); + Q_EMIT stateChanged ((m_state = (request.synchronize && m_silentFrames) ? Synchronizing : Active)); - // qDebug() << "delay_ms:" << delay_ms << "mstr:" << mstr << "m_silentFrames:" // << m_silentFrames << "m_ic:" << m_ic << "m_state:" << m_state << synchronize; m_stream = stream; if (m_stream) { - m_stream->restart (this); + m_stream->restart (this, mstr); } else { qDebug () << "Modulator::start: no audio output stream assigned"; } + Q_EMIT txSourceCommitted (txStartSnapshot (request.session_id, request.generation, + m_mode, m_frameRate, + m_silentFrames, m_ic, m_tuning, m_bFastMode, + !m_cwId.isEmpty (), + m_symbolsLength, m_nsps, m_TRperiod)); + if (constrained) + { + Q_EMIT constrainedStartDecided (request.session_id.value (), + request.generation.value (), + request.start_window_open_ms, true, + actualStartMs); + } } void Modulator::tune (bool newState) @@ -201,13 +297,13 @@ qint64 Modulator::readData (char * data, qint64 maxSize) unsigned int isym=0; if(!m_tuning) isym=m_ic/(4.0*m_nsps); // Actual fsample=48000 - bool slowCwId=((isym >= m_symbolsLength) && (icw[0] > 0)) && (!m_bFastMode); + bool slowCwId=((isym >= m_symbolsLength) && !m_cwId.isEmpty ()) && (!m_bFastMode); if(m_TRperiod==3.0) slowCwId=false; bool fastCwId=false; static bool bCwId=false; qint64 ms = QDateTime::currentMSecsSinceEpoch(); float tsec=0.001*(ms % int(1000*m_TRperiod)); - if(m_bFastMode and (icw[0]>0) and (tsec > (m_TRperiod-5.0))) fastCwId=true; + if(m_bFastMode and !m_cwId.isEmpty () and (tsec > (m_TRperiod-5.0))) fastCwId=true; if(!m_bFastMode) m_nspd=2560; // 22.5 WPM @@ -220,7 +316,7 @@ qint64 Modulator::readData (char * data, qint64 maxSize) m_nsps=4096.0*12000.0/11025.0; m_ic=2246949; m_nspd=2560; // 22.5 WPM - if(icw[0]*m_nspd/48000.0 > 4.0) m_nspd=4.0*48000.0/icw[0]; //Faster CW for long calls + if(m_cwId.size ()*m_nspd/48000.0 > 4.0) m_nspd=4.0*48000.0/m_cwId.size (); //Faster CW for long calls } bCwId=true; unsigned ic0 = m_symbolsLength * 4 * m_nsps; @@ -228,7 +324,12 @@ qint64 Modulator::readData (char * data, qint64 maxSize) while (samples != end) { j = (m_ic - ic0)/m_nspd + 1; // symbol of this sample - bool level {bool (icw[j])}; + if (j == 0 || j > static_cast (m_cwId.size ())) + { + Q_EMIT stateChanged ((m_state = Idle)); + return framesGenerated * bytesPerFrame (); + } + bool level {bool (m_cwId.at (j - 1))}; m_phi += m_dphi; if (m_phi > m_twoPi) m_phi -= m_twoPi; qint16 sample=0; @@ -246,14 +347,9 @@ qint64 Modulator::readData (char * data, qint64 maxSize) sample=0; if(level) sample=32767.0*x; } - if (int (j) <= icw[0] && j < NUM_CW_SYMBOLS) { // stop condition - samples = load (postProcessSample (sample), samples); - ++framesGenerated; - ++m_ic; - } else { - Q_EMIT stateChanged ((m_state = Idle)); - return framesGenerated * bytesPerFrame (); - } + samples = load (postProcessSample (sample), samples); + ++framesGenerated; + ++m_ic; // adjust ramp if ((m_ramp != 0 && m_ramp != std::numeric_limits::min ()) || level != m_cwLevel) { @@ -340,16 +436,16 @@ qint64 Modulator::readData (char * data, qint64 maxSize) ++m_ic; } - if(m_TRperiod==3 and m_ic >i1) { + if((m_TRperiod==3 or m_mode=="JTTY") and m_ic >i1) { Q_EMIT stateChanged ((m_state = Idle)); return framesGenerated * bytesPerFrame (); } -// qDebug() << "dd" << QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz") -// << tsec << m_ic << i1; +// qDebug() << "dd" << m_mode << QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz") +// << tsec << m_TRperiod << m_ic << i1; if (m_amp == 0.0) { // TODO G4WJS: compare double with zero might not be wise - if (icw[0] == 0) { + if (m_cwId.isEmpty ()) { // no CW ID to send Q_EMIT stateChanged ((m_state = Idle)); return framesGenerated * bytesPerFrame (); diff --git a/Modulator/Modulator.hpp b/Modulator/Modulator.hpp index 272e0a33..024c4d5c 100644 --- a/Modulator/Modulator.hpp +++ b/Modulator/Modulator.hpp @@ -3,8 +3,11 @@ #include #include +#include #include "Audio/AudioDevice.hpp" +#include "Audio/TxRequest.hpp" +#include "Audio/TxPlaybackEvidence.hpp" class SoundOutput; @@ -35,14 +38,15 @@ public: void set_nsym(int n) {m_symbolsLength=n;} void set_ms0(qint64 ms) {m_ms0=ms;} - Q_SLOT void start (QString mode, unsigned symbolsLength, double framesPerSymbol, double frequency, - double toneSpacing, SoundOutput *, Channel = Mono, - bool synchronize = true, bool fastMode = false, - double dBSNR = 99., double TRperiod=60.0); + Q_SLOT void start (TxEvidence::TxRequest request, SoundOutput *); Q_SLOT void stop (bool quick = false); Q_SLOT void tune (bool newState = true); Q_SLOT void setFrequency (double newFrequency) {m_frequency = newFrequency;} Q_SIGNAL void stateChanged (ModulatorState) const; + Q_SIGNAL void txSourceCommitted (TxEvidence::TxStartSnapshot snapshot) const; + Q_SIGNAL void constrainedStartDecided (qint64 sessionId, qint64 generation, + qint64 windowOpenMs, bool accepted, + qint64 actualStartMs) const; protected: qint64 readData (char * data, qint64 maxSize) override; @@ -82,12 +86,14 @@ private: unsigned m_frameRate; ModulatorState m_state; + QString m_mode; bool m_tuning; bool m_addNoise; bool m_bFastMode; bool m_cwLevel; + QVector m_cwId; unsigned m_ic; unsigned m_icmin; unsigned m_icmax; diff --git a/Modulator/Modulator.pri b/Modulator/Modulator.pri deleted file mode 100644 index f353dece..00000000 --- a/Modulator/Modulator.pri +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES += Modulator/Modulator.cpp - -HEADERS += Modulator/Modulator.hpp diff --git a/MultiSettings.cpp b/MultiSettings.cpp index 55bad6f4..4217d105 100644 --- a/MultiSettings.cpp +++ b/MultiSettings.cpp @@ -28,10 +28,9 @@ #include #include "SettingsGroup.hpp" +#include "PerformanceTrace.hpp" #include "qt_helpers.hpp" -#include "SettingsGroup.hpp" #include "widgets/MessageBox.hpp" - #include "pimpl_impl.hpp" namespace @@ -195,7 +194,7 @@ private: // action to take on restart enum class RepositionType {unchanged, replace, save_and_replace}; - void restart (RepositionType); + void restart (RepositionType, PerformanceTrace::RunId run = 0); MultiSettings const * parent_; // required for emitting signals QMainWindow * main_window_; @@ -458,11 +457,20 @@ void MultiSettings::impl::create_menu_actions (QMainWindow * main_window, QMenu // main window really wants to quit or to run again with a new configuration bool MultiSettings::impl::exit () { + auto const run = PerformanceTrace::current_run (); + PerformanceTrace::milestone ("window.destroyed"); + PerformanceTrace::Phase settings_reposition {"settings.reposition"}; // ensure that configuration name changed signal gets fired on restart name_change_emit_pending_ = true; // do any configuration swap required and return exit flag - return reposition (); + auto const exit = reposition (); + settings_reposition.finish (); + if (exit) + { + PerformanceTrace::finish_run (run, "shutdown.complete"); + } + return exit; } QMenu * MultiSettings::impl::create_sub_menu (QMenu * parent_menu, @@ -577,6 +585,7 @@ void MultiSettings::impl::select_configuration (QString const& target_name) if (main_window_ && target_name != current_) { bool changed {false}; + PerformanceTrace::RunId restart_run {0}; { auto const& current_group = settings_.group (); if (current_group.size ()) settings_.endGroup (); @@ -584,10 +593,13 @@ void MultiSettings::impl::select_configuration (QString const& target_name) SettingsGroup alternatives {&settings_, multi_settings_root_group}; if (settings_.childGroups ().contains (target_name)) { + auto const run = PerformanceTrace::begin_run ("startup", "configuration_switch"); + PerformanceTrace::milestone (run, "switch.requested"); changed = true; // save the target settings SettingsGroup target_group {&settings_, target_name}; new_settings_ = get_settings (); + restart_run = run; } if (current_group.size ()) settings_.beginGroup (current_group); } @@ -596,7 +608,7 @@ void MultiSettings::impl::select_configuration (QString const& target_name) // and set up the restart current_ = target_name; Q_EMIT parent_->configurationNameChanged (unescape_ampersands (current_)); - restart (RepositionType::save_and_replace); + restart (RepositionType::save_and_replace, restart_run); } } } @@ -821,9 +833,14 @@ void MultiSettings::impl::delete_configuration (QMenu * menu) menu->deleteLater (); } -void MultiSettings::impl::restart (RepositionType type) +void MultiSettings::impl::restart (RepositionType type, PerformanceTrace::RunId run) { Q_ASSERT (main_window_); + if (!run) + { + run = PerformanceTrace::begin_run ("startup", "configuration_switch"); + PerformanceTrace::milestone (run, "switch.requested"); + } reposition_type_ = type; exit_flag_ = false; main_window_->close (); diff --git a/Network/Cloudlog.cpp b/Network/Cloudlog.cpp index 50e2fdee..1ebb6eea 100644 --- a/Network/Cloudlog.cpp +++ b/Network/Cloudlog.cpp @@ -1,37 +1,429 @@ #include "Cloudlog.hpp" -#include -#include +#include +#include +#include -#include -#include +#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "pimpl_impl.hpp" #include "moc_Cloudlog.cpp" -#include "Configuration.hpp" #include "revision_utils.hpp" namespace { - // Dictionary mapping call sign to date of last upload to LotW - using dictionary = QHash; + enum class EndpointLayout + { + DirectApi, + IndexPhpApi + }; + + enum class AuthStatus + { + Writable, + ReadOnly, + Invalid, + Unavailable, + Unexpected + }; + + enum class ServerProduct + { + Wavelog, + UnknownOrOther + }; + + struct AuthResult + { + AuthResult () = default; + AuthResult (AuthStatus status, QString const& detail) + : status {status} + , detail {detail} + { + } + + AuthStatus status {AuthStatus::Unavailable}; + QString detail; + }; + + QString endpointPath (EndpointLayout layout, QString const& apiPath) + { + return (EndpointLayout::DirectApi == layout ? QStringLiteral ("/api/") : QStringLiteral ("/index.php/api/")) + apiPath; + } + + QString encodedKey (QString const& apiKey) + { + return QString::fromLatin1 (QUrl::toPercentEncoding (apiKey)); + } + + QUrl endpointUrl (QString const& baseUrl, EndpointLayout layout, QString const& apiPath, QString const& apiKey) + { + return QUrl {baseUrl + endpointPath (layout, apiPath) + QLatin1Char ('/') + encodedKey (apiKey)}; + } + + QHash& uploadLayoutCache () + { + static QHash cache; + return cache; + } + + void applyCommonHeaders (QNetworkRequest& request, bool acceptJson) + { + request.setRawHeader ("User-Agent", http_user_agent ().toUtf8 ()); + if (acceptJson) + { + request.setRawHeader ("Accept", "application/json"); + } + } + + QNetworkRequest jsonPostRequest (QUrl const& url) + { + QNetworkRequest request {url}; + request.setHeader (QNetworkRequest::ContentTypeHeader, QVariant {QStringLiteral ("application/json")}); + applyCommonHeaders (request, true); + return request; + } + + QNetworkRequest connectionCheckGetRequest (QUrl const& url, bool acceptJson) + { + QNetworkRequest request {url}; + applyCommonHeaders (request, acceptJson); + return request; + } + + bool isTransportError (QNetworkReply const& reply) + { + return QNetworkReply::NoError != reply.error () + && !reply.attribute (QNetworkRequest::HttpStatusCodeAttribute).isValid (); + } + + int httpStatus (QNetworkReply const& reply) + { + return reply.attribute (QNetworkRequest::HttpStatusCodeAttribute).toInt (); + } + + QString lowerString (QJsonObject const& object, char const * key) + { + return object.value (QLatin1String {key}).toString ().trimmed ().toLower (); + } + + AuthResult parseJsonAuth (QByteArray const& body, int statusCode) + { + QJsonParseError error; + auto const document = QJsonDocument::fromJson (body, &error); + if (QJsonParseError::NoError != error.error || !document.isObject ()) + { + return {statusCode == 401 || statusCode == 403 ? AuthStatus::Invalid : AuthStatus::Unavailable, + QStringLiteral ("Authentication endpoint did not return JSON.")}; + } + + auto const object = document.object (); + auto const status = lowerString (object, "status"); + auto const rights = lowerString (object, "rights"); + + if (status == QLatin1String ("invalid") || status == QLatin1String ("failed") + || status == QLatin1String ("failure") || statusCode == 401 || statusCode == 403) + { + return {AuthStatus::Invalid, object.value (QStringLiteral ("message")).toString ()}; + } + + if (status != QLatin1String ("valid") && status != QLatin1String ("ok")) + { + return {AuthStatus::Unavailable, QStringLiteral ("Authentication endpoint did not report a valid status.")}; + } + + if (rights.isEmpty ()) + { + return {AuthStatus::Unexpected, QStringLiteral ("Authentication succeeded but did not include API key rights.")}; + } + + if (rights.startsWith (QLatin1String ("rw"))) + { + return {AuthStatus::Writable, QStringLiteral ("API key is writable.")}; + } + + if (rights.startsWith (QLatin1Char ('r'))) + { + return {AuthStatus::ReadOnly, QStringLiteral ("API key is read-only.")}; + } + + return {AuthStatus::Unexpected, QStringLiteral ("Authentication returned unrecognized API key rights: %1").arg (rights)}; + } + + AuthResult parseXmlAuth (QByteArray const& body) + { + QString status; + QString rights; + QXmlStreamReader xml; + xml.addData (QString::fromUtf8 (body)); + while (!xml.atEnd ()) + { + xml.readNext (); + if (xml.isStartElement ()) + { + if (xml.name () == QLatin1String ("status")) + { + status = xml.readElementText ().trimmed ().toLower (); + } + else if (xml.name () == QLatin1String ("rights")) + { + rights = xml.readElementText ().trimmed ().toLower (); + } + } + } + + if (xml.hasError ()) + { + return {AuthStatus::Unavailable, QStringLiteral ("Authentication endpoint did not return XML.")}; + } + + if (status != QLatin1String ("valid")) + { + return {AuthStatus::Invalid, QStringLiteral ("API key is invalid.")}; + } + + if (rights.isEmpty ()) + { + return {AuthStatus::Unexpected, QStringLiteral ("Authentication succeeded but did not include API key rights.")}; + } + + if (rights.startsWith (QLatin1String ("rw"))) + { + return {AuthStatus::Writable, QStringLiteral ("API key is writable.")}; + } + + if (rights.startsWith (QLatin1Char ('r'))) + { + return {AuthStatus::ReadOnly, QStringLiteral ("API key is read-only.")}; + } + + return {AuthStatus::Unexpected, QStringLiteral ("Authentication returned unrecognized API key rights: %1").arg (rights)}; + } + + int intValue (QJsonValue const& value) + { + if (value.isDouble ()) + { + return value.toInt (); + } + bool ok {false}; + auto const result = value.toString ().toInt (&ok); + return ok ? result : 0; + } + + QString stringValue (QJsonObject const& object, std::initializer_list keys) + { + for (auto const key : keys) + { + auto const value = object.value (QLatin1String {key}); + if (!value.isUndefined () && !value.isNull ()) + { + return value.toVariant ().toString ().trimmed (); + } + } + return {}; + } + + bool appendStationProfile (QJsonObject const& object, QList& profiles) + { + auto const id = intValue (object.value (QStringLiteral ("station_id"))); + auto const alternate_id = id ? id : intValue (object.value (QStringLiteral ("station_profile_id"))); + auto const profile_id = alternate_id ? alternate_id : intValue (object.value (QStringLiteral ("id"))); + if (!profile_id) + { + return false; + } + + profiles.append ({profile_id, + stringValue (object, {"station_profile_name", "profile_name", "name"}), + stringValue (object, {"station_callsign", "callsign", "call"})}); + return true; + } + + void collectStationProfiles (QJsonValue const& value, QList& profiles) + { + if (value.isArray ()) + { + auto const array = value.toArray (); + for (auto const& entry : array) + { + collectStationProfiles (entry, profiles); + } + return; + } + + if (!value.isObject ()) + { + return; + } + + auto const object = value.toObject (); + if (appendStationProfile (object, profiles)) + { + return; + } + + for (auto const& key : {QStringLiteral ("stations"), QStringLiteral ("station_profiles"), + QStringLiteral ("stationProfiles"), QStringLiteral ("profiles")}) + { + auto const child = object.value (key); + if (!child.isUndefined ()) + { + collectStationProfiles (child, profiles); + } + } + } + + QString stationProfileList (QList const& profiles) + { + QStringList entries; + for (auto const& profile : profiles) + { + entries.append (Cloudlog::stationProfileDisplayText (profile)); + } + return entries.join (QStringLiteral (", ")); + } + + QString jsonDiagnostic (QJsonValue const& value) + { + if (value.isString ()) + { + return value.toString (); + } + if (value.isArray ()) + { + QStringList values; + for (auto const& entry : value.toArray ()) + { + auto const text = jsonDiagnostic (entry); + if (!text.isEmpty ()) + { + values.append (text); + } + } + return values.join (QStringLiteral ("; ")); + } + if (value.isObject ()) + { + QStringList values; + auto const object = value.toObject (); + for (auto it = object.constBegin (); it != object.constEnd (); ++it) + { + auto const text = jsonDiagnostic (it.value ()); + if (!text.isEmpty ()) + { + values.append (it.key () + QStringLiteral (": ") + text); + } + } + return values.join (QStringLiteral ("; ")); + } + return value.toVariant ().toString (); + } + + QString responseFailureDetail (QJsonObject const& object, QString const& fallback) + { + for (auto const& key : {QStringLiteral ("reason"), QStringLiteral ("message"), QStringLiteral ("messages")}) + { + auto const detail = jsonDiagnostic (object.value (key)); + if (!detail.isEmpty ()) + { + return detail; + } + } + return fallback; + } + + ServerProduct parseProductManifest (QByteArray const& body) + { + QJsonParseError error; + auto const document = QJsonDocument::fromJson (body, &error); + if (QJsonParseError::NoError != error.error || !document.isObject ()) + { + return ServerProduct::UnknownOrOther; + } + + auto const object = document.object (); + for (auto const& key : {QStringLiteral ("name"), QStringLiteral ("short_name")}) + { + if (object.value (key).toString ().trimmed ().compare (QStringLiteral ("Wavelog"), Qt::CaseInsensitive) == 0) + { + return ServerProduct::Wavelog; + } + } + + return ServerProduct::UnknownOrOther; + } + + Cloudlog::UploadResult classifyQsoUploadReply (int httpStatusCode, QNetworkReply::NetworkError networkError, + QString const& errorString, QByteArray const& body) + { + if (QNetworkReply::NoError != networkError && httpStatusCode == 0) + { + return {Cloudlog::UploadStatus::NetworkError, + Cloudlog::tr ("QSO could not be sent to Cloudlog."), + errorString, + httpStatusCode}; + } + + QJsonParseError error; + auto const document = QJsonDocument::fromJson (body, &error); + if (QJsonParseError::NoError != error.error || !document.isObject ()) + { + if (httpStatusCode >= 400) + { + return {Cloudlog::UploadStatus::HttpError, + Cloudlog::tr ("QSO upload was rejected by Cloudlog."), + Cloudlog::tr ("HTTP status %1. Response was not JSON.").arg (httpStatusCode), + httpStatusCode}; + } + return {Cloudlog::UploadStatus::UnexpectedResponse, + Cloudlog::tr ("Cloudlog returned an unexpected upload response."), + error.errorString (), + httpStatusCode}; + } + + auto const object = document.object (); + auto const status = lowerString (object, "status"); + if (status == QLatin1String ("failed") || status == QLatin1String ("failure") || status == QLatin1String ("invalid")) + { + auto detail = responseFailureDetail (object, {}); + if (detail.isEmpty ()) + { + detail = Cloudlog::tr ("Cloudlog reported upload status: %1").arg (status); + } + return {Cloudlog::UploadStatus::Rejected, + Cloudlog::tr ("QSO could not be sent to Cloudlog."), + detail, + httpStatusCode}; + } + + if (httpStatusCode >= 400) + { + auto const detail = responseFailureDetail (object, Cloudlog::tr ("HTTP status %1.").arg (httpStatusCode)); + return {Cloudlog::UploadStatus::HttpError, + Cloudlog::tr ("QSO upload was rejected by Cloudlog."), + detail, + httpStatusCode}; + } + + return {Cloudlog::UploadStatus::Success, {}, {}, httpStatusCode}; + } } class Cloudlog::impl final @@ -40,138 +432,515 @@ class Cloudlog::impl final Q_OBJECT public: - impl (Cloudlog * self, Configuration const * config) + impl (Cloudlog * self, CloudlogConfiguration const * config, QNetworkAccessManager * network_manager) : self_ {self} , config_ {config} - , network_manager_ {new QNetworkAccessManager(this)} + , network_manager_ {network_manager} { } - void logQso (QByteArray ADIF) + void logQso (QByteArray const& ADIF) { - QByteArray data; - - QString str = QString("") + - "{" + - "\"key\":\""+ config_->cloudlog_api_key() +"\"," + - "\"station_profile_id\":\""+ QVariant(config_->cloudlog_api_station_id()).toString() +"\"," + - "\"type\":\"adif\"," + - "\"string\":\"" + ADIF + "" + "\"" + - "}"; - data = str.toUtf8(); - - QUrl u = QUrl(config_->cloudlog_api_url()+"/index.php/api/qso"); + if (!config_) + { + return; + } - QNetworkRequest request(u); - request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/json")); - request.setRawHeader ("User-Agent", http_user_agent ().toUtf8 ()); - reply_ = network_manager_->post(request, data); - connect (reply_.data (), &QNetworkReply::finished, this, &Cloudlog::impl::reply_logqso); + auto const base_url = Cloudlog::normalizeBaseUrl (config_->cloudlog_api_url ()); + auto const data = Cloudlog::qsoUploadPayload (config_->cloudlog_api_key (), config_->cloudlog_api_station_id (), ADIF); + auto const layout = uploadLayoutCache ().value (base_url, EndpointLayout::IndexPhpApi); + auto const path = EndpointLayout::DirectApi == layout ? QStringLiteral ("/api/qso") : QStringLiteral ("/index.php/api/qso"); + auto const u = QUrl {base_url + path}; + auto request = jsonPostRequest (u); + upload_reply_ = network_manager_->post (request, data); + connect (upload_reply_.data (), &QNetworkReply::finished, this, &Cloudlog::impl::reply_logqso); } - void testApi (QString const& url, QString const& apiKey) + void checkConnection (Cloudlog::ConnectionCheckRequest const& request) { - QString apiUrl = url.trimmed(); + abortCheckReply (); + check_request_ = request; + check_request_.url = Cloudlog::normalizeBaseUrl (request.url); + auth_layout_index_ = 0; + dry_run_layout_index_ = 0; + checked_station_profiles_.clear (); + #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) if (QNetworkAccessManager::Accessible != network_manager_->networkAccessible ()) { - // try and recover network access for QNAM network_manager_->setNetworkAccessible (QNetworkAccessManager::Accessible); } #endif - // Remove trailing slash if given - if (apiUrl.endsWith('/')) { - apiUrl.chop(1); - } - // Remove full path to API if given - if (apiUrl.endsWith("/index.php/api/qso")) { - apiUrl.chop(QStringLiteral("/index.php/api/qso").size()); - } + if (check_request_.url.isEmpty ()) + { + finish ({Cloudlog::ConnectionCheckStatus::EndpointUnavailable, + tr ("Enter a Cloudlog or Wavelog URL."), + tr ("The connection check needs a base URL before it can contact the API."), + check_request_.url}); + return; + } - QNetworkRequest request {apiUrl+"/index.php/api/auth/"+apiKey}; - request.setRawHeader ("User-Agent", http_user_agent ().toUtf8 ()); - request.setOriginatingObject (this); - reply_ = network_manager_->get (request); - connect (reply_.data (), &QNetworkReply::finished, this, &Cloudlog::impl::reply_apitest); + startJsonAuth (); } - void reply_apitest() +private: + using Layouts = std::array; + + void startJsonAuth () { - QString result; - if (reply_ && reply_->isFinished ()) + static Layouts const layouts {EndpointLayout::DirectApi, EndpointLayout::IndexPhpApi}; + if (auth_layout_index_ >= layouts.size ()) { - result = reply_->readAll(); - if (result.contains("Valid")) - { - if (result.contains("rw")) - { - // fprintf(stderr, "API key OK\n"); - Q_EMIT self_->apikey_ok (); - } else { - // fprintf(stderr, "API key not writable!\n"); - Q_EMIT self_->apikey_ro (); - } - } else { - // fprintf(stderr, "API key invalid!\n"); - Q_EMIT self_->apikey_invalid (); - } + startXmlAuth (); + return; } + + validated_auth_layout_ = layouts[auth_layout_index_++]; + auto request = connectionCheckGetRequest ( + endpointUrl (check_request_.url, validated_auth_layout_, QStringLiteral ("check_auth"), check_request_.apiKey), true); + check_reply_ = network_manager_->get (request); + connect (check_reply_.data (), &QNetworkReply::finished, this, &Cloudlog::impl::reply_json_auth); } - void reply_logqso() + void reply_json_auth () { - QString result; - if (reply_ && reply_->isFinished ()) + auto * reply = takeCheckReply (); + if (!reply) { - result = reply_->readAll(); - QJsonDocument data = QJsonDocument::fromJson(result.toUtf8()); - QJsonObject obj = data.object(); - if (obj["status"] == "failed") { - QMessageBox msgBox; - msgBox.setIcon(QMessageBox::Warning); - msgBox.setWindowTitle("Cloudlog Error!"); - msgBox.setText("QSO could not be sent to Cloudlog!\nPlease check your log."); - msgBox.setDetailedText("Reason: "+obj["reason"].toString()); - msgBox.exec(); - } + return; + } + + if (isTransportError (*reply)) + { + auto const detail = reply->errorString (); + reply->deleteLater (); + finishNetworkError (detail); + return; } + + auto const result = parseJsonAuth (reply->readAll (), httpStatus (*reply)); + reply->deleteLater (); + handleAuthResult (result, [this] { startJsonAuth (); }); + } + + void startXmlAuth () + { + validated_auth_layout_ = EndpointLayout::IndexPhpApi; + auto request = connectionCheckGetRequest ( + endpointUrl (check_request_.url, validated_auth_layout_, QStringLiteral ("auth"), check_request_.apiKey), false); + check_reply_ = network_manager_->get (request); + connect (check_reply_.data (), &QNetworkReply::finished, this, &Cloudlog::impl::reply_xml_auth); + } + + void reply_xml_auth () + { + auto * reply = takeCheckReply (); + if (!reply) + { + return; + } + + if (isTransportError (*reply)) + { + auto const detail = reply->errorString (); + reply->deleteLater (); + finishNetworkError (detail); + return; + } + + auto const result = parseXmlAuth (reply->readAll ()); + reply->deleteLater (); + handleAuthResult (result, [this] { + finish ({Cloudlog::ConnectionCheckStatus::EndpointUnavailable, + tr ("Cloudlog or Wavelog authentication endpoint was not found."), + tr ("Tried /api/check_auth, /index.php/api/check_auth, and /index.php/api/auth."), + check_request_.url}); + }); } - void abort () + template + void handleAuthResult (AuthResult const& result, Continue continueProbe) { - if (reply_ && reply_->isRunning ()) + switch (result.status) + { + case AuthStatus::Writable: + startStationInfo (); + break; + case AuthStatus::ReadOnly: + finish ({Cloudlog::ConnectionCheckStatus::ReadOnlyKey, + tr ("API key is valid but read-only."), + tr ("Generate a read/write API key before enabling QSO uploads."), + check_request_.url}); + break; + case AuthStatus::Invalid: + finish ({Cloudlog::ConnectionCheckStatus::InvalidKey, + tr ("API key is invalid."), + result.detail, + check_request_.url}); + break; + case AuthStatus::Unexpected: + finish ({Cloudlog::ConnectionCheckStatus::UnexpectedResponse, + tr ("Authentication response was not usable."), + result.detail, + check_request_.url}); + break; + case AuthStatus::Unavailable: + continueProbe (); + break; + } + } + + void startStationInfo () + { + auto request = connectionCheckGetRequest ( + endpointUrl (check_request_.url, validated_auth_layout_, QStringLiteral ("station_info"), check_request_.apiKey), true); + check_reply_ = network_manager_->get (request); + connect (check_reply_.data (), &QNetworkReply::finished, this, &Cloudlog::impl::reply_station_info); + } + + void reply_station_info () + { + auto * reply = takeCheckReply (); + if (!reply) + { + return; + } + + if (isTransportError (*reply)) + { + auto const detail = reply->errorString (); + reply->deleteLater (); + finishNetworkError (detail); + return; + } + + QJsonParseError error; + auto const document = QJsonDocument::fromJson (reply->readAll (), &error); + reply->deleteLater (); + if (QJsonParseError::NoError != error.error) { - reply_->abort (); + finish ({Cloudlog::ConnectionCheckStatus::UnexpectedResponse, + tr ("Station profile response was not JSON."), + error.errorString (), + check_request_.url}); + return; + } + + QList profiles; + collectStationProfiles (document.isArray () ? QJsonValue {document.array ()} : QJsonValue {document.object ()}, profiles); + checked_station_profiles_ = profiles; + auto const match = std::find_if (profiles.cbegin (), profiles.cend (), [this] (Cloudlog::StationProfile const& profile) { + return profile.id == check_request_.stationId; + }); + + if (match == profiles.cend ()) + { + auto const available = stationProfileList (profiles); + finish ({Cloudlog::ConnectionCheckStatus::StationProfileUnavailable, + tr ("Configured station profile was not found."), + available.isEmpty () + ? tr ("No station profiles were returned by the server.") + : tr ("Available station profiles: %1").arg (available), + check_request_.url}); + return; + } + + startProductProbe (); + } + + void startProductProbe () + { + auto request = connectionCheckGetRequest (QUrl {check_request_.url + QStringLiteral ("/manifest.json")}, true); + check_reply_ = network_manager_->get (request); + connect (check_reply_.data (), &QNetworkReply::finished, this, &Cloudlog::impl::reply_product_probe); + } + + void reply_product_probe () + { + auto * reply = takeCheckReply (); + if (!reply) + { + return; + } + + auto const status_code = httpStatus (*reply); + auto const body = reply->readAll (); + auto const has_transport_error = isTransportError (*reply); + reply->deleteLater (); + + if (!has_transport_error && status_code == 200 && ServerProduct::Wavelog == parseProductManifest (body)) + { + startDryRun (); + return; + } + + finishWithoutDryRun (); + } + + void startDryRun () + { + static Layouts const layouts {EndpointLayout::DirectApi, EndpointLayout::IndexPhpApi}; + if (dry_run_layout_index_ >= layouts.size ()) + { + finish ({Cloudlog::ConnectionCheckStatus::EndpointUnavailable, + tr ("Wavelog dry-run QSO endpoint was not found."), + tr ("Tried /api/qso/true and /index.php/api/qso/true after Wavelog was identified."), + check_request_.url}); + return; + } + + validated_dry_run_layout_ = layouts[dry_run_layout_index_++]; + auto const data = Cloudlog::qsoUploadPayload (check_request_.apiKey, check_request_.stationId, dryRunAdif ()); + auto request = jsonPostRequest (QUrl {check_request_.url + endpointPath (validated_dry_run_layout_, QStringLiteral ("qso/true"))}); + check_reply_ = network_manager_->post (request, data); + connect (check_reply_.data (), &QNetworkReply::finished, this, &Cloudlog::impl::reply_dry_run); + } + + void reply_dry_run () + { + auto * reply = takeCheckReply (); + if (!reply) + { + return; + } + + if (isTransportError (*reply)) + { + auto const detail = reply->errorString (); + reply->deleteLater (); + finishNetworkError (detail); + return; + } + + auto const status_code = httpStatus (*reply); + auto const body = reply->readAll (); + reply->deleteLater (); + if (status_code == 404 || status_code == 405) + { + startDryRun (); + return; + } + + QJsonParseError error; + auto const document = QJsonDocument::fromJson (body, &error); + if (QJsonParseError::NoError != error.error || !document.isObject ()) + { + finish ({Cloudlog::ConnectionCheckStatus::UnexpectedResponse, + tr ("Dry-run upload response was not usable."), + error.errorString (), + check_request_.url}); + return; + } + + auto const object = document.object (); + auto const status = lowerString (object, "status"); + + if (status_code == 201 && status == QLatin1String ("created")) + { + uploadLayoutCache ().insert (check_request_.url, validated_dry_run_layout_); + finish ({Cloudlog::ConnectionCheckStatus::Success, + tr ("Connection check passed."), + tr ("Writable API key, station profile, and dry-run QSO upload were validated."), + check_request_.url}); + return; + } + + if (status_code == 400 || status_code == 401 || status_code == 403) + { + finish ({Cloudlog::ConnectionCheckStatus::UploadShapeRejected, + tr ("Dry-run QSO upload was rejected."), + responseFailureDetail (object, tr ("The QSO dry-run upload was rejected.")), + check_request_.url}); + return; + } + + finish ({Cloudlog::ConnectionCheckStatus::UnexpectedResponse, + tr ("Dry-run QSO upload returned an unexpected response."), + responseFailureDetail (object, tr ("The QSO dry-run upload was rejected.")), + check_request_.url}); + } + + void finishWithoutDryRun () + { + uploadLayoutCache ().insert (check_request_.url, validated_auth_layout_); + finish ({Cloudlog::ConnectionCheckStatus::Success, + tr ("Connection check passed."), + tr ("Writable API key and station profile were validated. No safe dry-run QSO endpoint was identified, so no test QSO was uploaded."), + check_request_.url}); + } + + QByteArray dryRunAdif () const + { + auto const today = QDate::currentDate ().toString (QStringLiteral ("yyyyMMdd")).toLatin1 (); + return QByteArray {"WSJTX"} + today + + QByteArray {"00000020mFT8"}; + } + + void finishNetworkError (QString const& detail) + { + finish ({Cloudlog::ConnectionCheckStatus::NetworkError, + tr ("Network error while checking Cloudlog or Wavelog."), + detail, + check_request_.url}); + } + + void finish (Cloudlog::ConnectionCheckResult const& result) + { + check_reply_ = nullptr; + auto result_with_profiles = result; + if (result_with_profiles.stationProfiles.isEmpty ()) + { + result_with_profiles.stationProfiles = checked_station_profiles_; + } + Q_EMIT self_->connection_check_finished (result_with_profiles); + } + + void showUploadWarning (Cloudlog::UploadResult const& result) + { + if (Cloudlog::UploadStatus::Success == result.status || !qobject_cast (QCoreApplication::instance ())) + { + return; + } + + QMessageBox msgBox; + msgBox.setIcon (QMessageBox::Warning); + msgBox.setWindowTitle (tr ("Cloudlog Error!")); + msgBox.setText (result.message); + if (!result.detail.isEmpty ()) + { + msgBox.setDetailedText (tr ("Reason: %1").arg (result.detail)); + } + msgBox.exec (); + } + + void reply_logqso () + { + auto * reply = qobject_cast (sender ()); + if (!reply) + { + return; + } + + if (reply == upload_reply_) + { + upload_reply_ = nullptr; + } + + auto const result = classifyQsoUploadReply (httpStatus (*reply), reply->error (), reply->errorString (), reply->readAll ()); + Q_EMIT self_->qso_upload_finished (result); + showUploadWarning (result); + reply->deleteLater (); + } + + QNetworkReply * takeCheckReply () + { + auto * reply = qobject_cast (sender ()); + if (!reply || reply != check_reply_) + { + return nullptr; + } + check_reply_ = nullptr; + return reply; + } + + void abortCheckReply () + { + if (check_reply_) + { + auto * reply = check_reply_.data (); + check_reply_ = nullptr; + if (reply->isRunning ()) + { + reply->abort (); + } + reply->deleteLater (); } } Cloudlog * self_; - Configuration const * config_; + CloudlogConfiguration const * config_; QNetworkAccessManager * network_manager_; - QPointer reply_; + QPointer upload_reply_; + QPointer check_reply_; + Cloudlog::ConnectionCheckRequest check_request_; + EndpointLayout validated_auth_layout_ {EndpointLayout::IndexPhpApi}; + EndpointLayout validated_dry_run_layout_ {EndpointLayout::IndexPhpApi}; + std::size_t auth_layout_index_ {0}; + std::size_t dry_run_layout_index_ {0}; + QList checked_station_profiles_; }; #include "Cloudlog.moc" -Cloudlog::Cloudlog (Configuration const * config, - QObject * parent) +QString Cloudlog::normalizeBaseUrl (QString const& url) +{ + auto result = url.trimmed (); + while (result.endsWith (QLatin1Char ('/'))) + { + result.chop (1); + } + for (auto const& endpoint : {QStringLiteral ("/index.php/api/qso"), QStringLiteral ("/api/qso")}) + { + if (result.endsWith (endpoint)) + { + result.chop (endpoint.size ()); + break; + } + } + while (result.endsWith (QLatin1Char ('/'))) + { + result.chop (1); + } + return result; +} + +QByteArray Cloudlog::qsoUploadPayload (QString const& apiKey, qint32 stationId, QByteArray const& ADIF) +{ + QJsonObject object; + object.insert (QStringLiteral ("key"), apiKey); + object.insert (QStringLiteral ("station_profile_id"), QString::number (stationId)); + object.insert (QStringLiteral ("type"), QStringLiteral ("adif")); + object.insert (QStringLiteral ("string"), QString::fromUtf8 (ADIF + QByteArray {""})); + return QJsonDocument {object}.toJson (QJsonDocument::Compact); +} + +QString Cloudlog::stationProfileDisplayText (StationProfile const& profile) +{ + QStringList fields {QString::number (profile.id)}; + if (!profile.name.isEmpty ()) + { + fields.append (profile.name); + } + if (!profile.callsign.isEmpty ()) + { + fields.append (profile.callsign); + } + return fields.join (QStringLiteral (" - ")); +} + +Cloudlog::Cloudlog (CloudlogConfiguration const * config, QNetworkAccessManager * network_manager, QObject * parent) : QObject {parent} - , m_ {this, config} + , m_ {this, config, network_manager} { + qRegisterMetaType ("Cloudlog::ConnectionCheckResult"); + qRegisterMetaType ("ConnectionCheckResult"); + qRegisterMetaType ("Cloudlog::StationProfile"); + qRegisterMetaType ("Cloudlog::UploadResult"); + qRegisterMetaType ("UploadResult"); } Cloudlog::~Cloudlog () { } -void Cloudlog::testApi (QString const& url, QString const& apiKey) +void Cloudlog::checkConnection (ConnectionCheckRequest const& request) { - m_->testApi (url, apiKey); + m_->checkConnection (request); } void Cloudlog::logQso (QByteArray ADIF) { - m_->logQso(ADIF); + m_->logQso (ADIF); } diff --git a/Network/Cloudlog.hpp b/Network/Cloudlog.hpp index 61bb7a0e..5857a5a5 100644 --- a/Network/Cloudlog.hpp +++ b/Network/Cloudlog.hpp @@ -1,13 +1,15 @@ #ifndef CLOUDLOG_HPP_ #define CLOUDLOG_HPP_ -#include +#include +#include +#include #include +#include +#include "CloudlogConfiguration.hpp" #include "pimpl_h.hpp" -class QString; class QNetworkAccessManager; -class Configuration; // // Cloudlog @@ -18,19 +20,118 @@ class Cloudlog final Q_OBJECT public: - explicit Cloudlog (Configuration const * config, QObject * parent = nullptr); + enum class ConnectionCheckStatus + { + Success, + ReadOnlyKey, + InvalidKey, + StationProfileUnavailable, + EndpointUnavailable, + UploadShapeRejected, + NetworkError, + UnexpectedResponse + }; + Q_ENUM (ConnectionCheckStatus) + + enum class UploadStatus + { + Success, + Rejected, + NetworkError, + HttpError, + UnexpectedResponse + }; + Q_ENUM (UploadStatus) + + struct ConnectionCheckRequest + { + ConnectionCheckRequest () = default; + ConnectionCheckRequest (QString const& url, QString const& apiKey, qint32 stationId) + : url {url} + , apiKey {apiKey} + , stationId {stationId} + { + } + + QString url; + QString apiKey; + qint32 stationId {0}; + }; + + struct StationProfile + { + StationProfile () = default; + StationProfile (int id, QString const& name, QString const& callsign) + : id {id} + , name {name} + , callsign {callsign} + { + } + + int id {0}; + QString name; + QString callsign; + }; + + struct ConnectionCheckResult + { + ConnectionCheckResult () = default; + ConnectionCheckResult (ConnectionCheckStatus status, QString const& message, QString const& detail, + QString const& normalizedBaseUrl, QList const& stationProfiles = {}) + : status {status} + , message {message} + , detail {detail} + , normalizedBaseUrl {normalizedBaseUrl} + , stationProfiles {stationProfiles} + { + } + + ConnectionCheckStatus status {ConnectionCheckStatus::UnexpectedResponse}; + QString message; + QString detail; + QString normalizedBaseUrl; + QList stationProfiles; + }; + + struct UploadResult + { + UploadResult () = default; + UploadResult (UploadStatus status, QString const& message, QString const& detail, int httpStatusCode) + : status {status} + , message {message} + , detail {detail} + , httpStatusCode {httpStatusCode} + { + } + + UploadStatus status {UploadStatus::UnexpectedResponse}; + QString message; + QString detail; + int httpStatusCode {0}; + }; + + explicit Cloudlog (CloudlogConfiguration const * config, QNetworkAccessManager * network_manager, + QObject * parent = nullptr); ~Cloudlog (); - void logQso(QByteArray ADIF); - Q_SLOT void testApi (QString const& url, QString const& apiKey); + static QString normalizeBaseUrl (QString const& url); + static QString stationProfileDisplayText (StationProfile const& profile); + static QByteArray qsoUploadPayload (QString const& apiKey, qint32 stationId, QByteArray const& ADIF); + + void logQso (QByteArray ADIF); + Q_SLOT void checkConnection (ConnectionCheckRequest const& request); - Q_SIGNAL void apikey_ok () const; - Q_SIGNAL void apikey_ro () const; - Q_SIGNAL void apikey_invalid () const; + Q_SIGNAL void connection_check_finished (ConnectionCheckResult const& result) const; + Q_SIGNAL void qso_upload_finished (UploadResult const& result) const; private: class impl; pimpl m_; }; +Q_DECLARE_METATYPE (Cloudlog::ConnectionCheckResult) +Q_DECLARE_METATYPE (Cloudlog::StationProfile) +Q_DECLARE_METATYPE (Cloudlog::UploadStatus) +Q_DECLARE_METATYPE (Cloudlog::UploadResult) + #endif diff --git a/Network/CloudlogConfiguration.hpp b/Network/CloudlogConfiguration.hpp new file mode 100644 index 00000000..ff2876e3 --- /dev/null +++ b/Network/CloudlogConfiguration.hpp @@ -0,0 +1,16 @@ +#ifndef CLOUDLOG_CONFIGURATION_HPP_ +#define CLOUDLOG_CONFIGURATION_HPP_ + +#include + +class CloudlogConfiguration +{ +public: + virtual ~CloudlogConfiguration () = default; + + virtual QString cloudlog_api_url () const = 0; + virtual QString cloudlog_api_key () const = 0; + virtual qint32 cloudlog_api_station_id () const = 0; +}; + +#endif diff --git a/Network/DecodedTime.cpp b/Network/DecodedTime.cpp new file mode 100644 index 00000000..79572479 --- /dev/null +++ b/Network/DecodedTime.cpp @@ -0,0 +1,65 @@ +#include "DecodedTime.hpp" + +#include +#include + +namespace +{ + constexpr int secondsPerDay {24 * 60 * 60}; + + bool parseTime(QString const& encodedTime, QTime& time, int& secondsSinceMidnight) + { + if (encodedTime.size() != 4 && encodedTime.size() != 6) { + return false; + } + for (auto const character : encodedTime) { + if (!character.isDigit()) { + return false; + } + } + + bool ok = false; + auto const hours = encodedTime.mid(0, 2).toInt(&ok); + if (!ok) { + return false; + } + auto const minutes = encodedTime.mid(2, 2).toInt(&ok); + if (!ok) { + return false; + } + auto const seconds = encodedTime.size() == 6 + ? encodedTime.mid(4, 2).toInt(&ok) : 0; + if (!ok) { + return false; + } + + time = QTime {hours, minutes, seconds}; + if (!time.isValid()) { + return false; + } + secondsSinceMidnight = time.hour() * 60 * 60 + time.minute() * 60 + time.second(); + return true; + } +} + +namespace DecodedTime +{ + QDateTime spotTime(QString const& encodedTime, QDateTime const& nowUtc, + double periodSeconds) + { + QTime time; + int secondsSinceMidnight {0}; + if (!parseTime(encodedTime, time, secondsSinceMidnight) || !nowUtc.isValid()) { + return {}; + } + + auto const currentDate = nowUtc.toUTC().date(); + auto const spotDate = secondsSinceMidnight + qCeil(periodSeconds) >= secondsPerDay + ? currentDate.addDays(-1) : currentDate; +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + return {spotDate, time, QTimeZone::UTC}; +#else + return {spotDate, time, Qt::UTC}; +#endif + } +} diff --git a/Network/DecodedTime.hpp b/Network/DecodedTime.hpp new file mode 100644 index 00000000..e06eaf45 --- /dev/null +++ b/Network/DecodedTime.hpp @@ -0,0 +1,13 @@ +#ifndef DECODED_TIME_HPP +#define DECODED_TIME_HPP + +#include +#include + +namespace DecodedTime +{ + QDateTime spotTime (QString const& encodedTime, QDateTime const& nowUtc, + double periodSeconds); +} + +#endif diff --git a/Network/FileDownload.cpp b/Network/FileDownload.cpp index 3ab2a7c6..91b9048f 100644 --- a/Network/FileDownload.cpp +++ b/Network/FileDownload.cpp @@ -131,6 +131,11 @@ void FileDownload::replyComplete() void FileDownload::downloadComplete(QNetworkReply *data) { + if (data != reply_) + { + return; + } + // make a temp file in the same place as the file we're downloading. Needs to be on the same // filesystem as where we eventually want to 'mv' it. @@ -171,7 +176,8 @@ void FileDownload::download(QUrl qurl) LOG_INFO(QString{"FileDownload [%1]: Starting download of %2 to %3"}.arg(user_agent_).arg(source_url_).arg(destination_filename_)); - request_.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); + request_.setAttribute(QNetworkRequest::RedirectPolicyAttribute + , QNetworkRequest::NoLessSafeRedirectPolicy); request_.setRawHeader("Accept", "*/*"); request_.setRawHeader ("User-Agent", user_agent_.toLocal8Bit()); // Must have a UA for some sites, like country-files diff --git a/Network/FoxVerifier.cpp b/Network/FoxVerifier.cpp index 36e55442..072de2f6 100644 --- a/Network/FoxVerifier.cpp +++ b/Network/FoxVerifier.cpp @@ -25,7 +25,8 @@ FoxVerifier::FoxVerifier(QString user_agent, QNetworkAccessManager *manager,QStr request_ = QNetworkRequest(q_url_); request_.setRawHeader( "User-Agent" , user_agent.toUtf8()); request_.setRawHeader( "Accept" , "*/*" ); - request_.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); + request_.setAttribute(QNetworkRequest::RedirectPolicyAttribute + , QNetworkRequest::NoLessSafeRedirectPolicy); #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) request_.setTransferTimeout(FOXVERIFIER_DEFAULT_TIMEOUT_MSEC); diff --git a/Network/MessageClient.cpp b/Network/MessageClient.cpp index 58ebeaa0..df095508 100644 --- a/Network/MessageClient.cpp +++ b/Network/MessageClient.cpp @@ -9,10 +9,12 @@ #include #include #include +#include #include #include #include #include +#include #include "NetworkMessage.hpp" #include "qt_helpers.hpp" @@ -27,6 +29,34 @@ #define TRACE_UDP(MSG) #endif +namespace +{ + int constexpr replay_interval_ms {10}; + int constexpr replay_write_budget {10}; + int constexpr replay_message_budget {10}; + qint64 constexpr replay_work_budget_ms {2}; + int constexpr decode_history_limit {5000}; + int constexpr inhibit_message_limit {4096}; + + bool read_inhibit_text (QDataStream& in, QString& text, quint32 limit, bool identity) + { + quint32 length {0}; + in >> length; + if (length == 0xffffffff && !identity) length = 0; + if (in.status () != QDataStream::Ok || length > limit + || length > quint64 (in.device ()->bytesAvailable ())) return false; + QByteArray bytes (int (length), '\0'); + if (in.readRawData (bytes.data (), bytes.size ()) != bytes.size ()) return false; + text = QString::fromUtf8 (bytes); + if (text.toUtf8 () != bytes || (identity && text.isEmpty ())) return false; + for (auto character : text.toUcs4 ()) + { + if (!QChar::isPrint (character) || (identity && QChar::isSpace (character))) return false; + } + return true; + } +} + class MessageClient::impl : public QUdpSocket { @@ -44,10 +74,23 @@ public: , server_port_ {server_port} , TTL_ {TTL} , schema_ {2} // use 2 prior to negotiation not 1 which is broken + , replay_state_ {ReplayState::Idle} , heartbeat_timer_ {new QTimer {this}} + , replay_timer_ {new QTimer {this}} + , replay_generation_ {0} { connect (heartbeat_timer_, &QTimer::timeout, this, &impl::heartbeat); + replay_timer_->setSingleShot (true); + replay_timer_->setTimerType (Qt::PreciseTimer); + connect (replay_timer_, &QTimer::timeout, this, &impl::drain_replay); connect (this, &QIODevice::readyRead, this, &impl::pending_datagrams); + inhibit_invalid_timer_.setParent (this); + inhibit_invalid_timer_.setSingleShot (true); + connect (&inhibit_invalid_timer_, &QTimer::timeout, this, [this] { + auto const count = inhibit_invalid_count_; + inhibit_invalid_count_ = 0; + Q_EMIT self_->tx_inhibit_invalid (count); + }); heartbeat_timer_->start (NetworkMessage::pulse * 1000); } @@ -62,16 +105,76 @@ public: } enum StreamStatus {Fail, Short, OK}; + enum class ReplayState {Idle, Collecting, Draining}; + + struct PendingMessage + { + explicit PendingMessage (QByteArray const& contents) + : contents {contents} + , next_interface {0} + { + } + + QByteArray contents; + std::size_t next_interface; + }; + + struct InhibitStatusSnapshot + { + bool valid {false}; + bool supported {false}; + bool inhibited {false}; + QString source_station; + quint32 hold_rx {0}; + quint32 release_rx {0}; + quint32 expiries {0}; + quint32 invalid {0}; + }; + + struct DecodeIdentity + { + QTime time; + qint32 snr; + float delta_time; + quint32 delta_frequency; + QByteArray mode; + QByteArray message; + bool low_confidence; + + bool operator== (DecodeIdentity const& other) const + { + return time == other.time && snr == other.snr && delta_time == other.delta_time + && delta_frequency == other.delta_frequency && mode == other.mode + && message == other.message && low_confidence == other.low_confidence; + } + }; void set_server (QString const& server_name, QStringList const& network_interface_names); Q_SLOT void host_info_results (QHostInfo); void start (); void parse_message (QByteArray const&); + bool parse_tx_inhibit (QByteArray const&); + void invalid_inhibit (); void pending_datagrams (); void heartbeat (); void closedown (); + bool inhibit_available () const; + void set_enabled (bool); + void update_inhibit_status (bool supported, bool inhibited, + QString const& source_station, + quint32 hold_rx, quint32 release_rx, + quint32 expiries, quint32 invalid); + void send_inhibit_status (bool supported); + bool begin_replay (); + void end_replay (); + void cancel_replay (); + void drain_replay (); StreamStatus check_status (QDataStream const&) const; void send_message (QByteArray const&, bool queue_if_pending = true, bool allow_duplicates = false); + void send_message_immediately (QByteArray const&); + void remember_decode (DecodeIdentity const&); + bool is_prior_decode (DecodeIdentity const&) const; + void clear_decode_history (); void send_message (QDataStream const& out, QByteArray const& message, bool queue_if_pending = true, bool allow_duplicates = false) { if (OK == check_status (out)) @@ -86,6 +189,8 @@ public: MessageClient * self_; bool enabled_; + QTimer inhibit_invalid_timer_; + quint64 inhibit_invalid_count_ {0}; QString id_; QString version_; QString revision_; @@ -95,18 +200,30 @@ public: int TTL_; std::vector network_interfaces_; quint32 schema_; + ReplayState replay_state_; QTimer * heartbeat_timer_; + QTimer * replay_timer_; + quint64 replay_generation_; std::vector blocked_addresses_; // hold messages sent before host lookup completes asynchronously QQueue pending_messages_; + QQueue replay_messages_; + QQueue decode_history_; QByteArray last_message_; + InhibitStatusSnapshot inhibit_status_; }; #include "MessageClient.moc" void MessageClient::impl::set_server (QString const& server_name, QStringList const& network_interface_names) { + cancel_replay (); + if (dns_lookup_id_ != -1) + { + QHostInfo::abortHostLookup (dns_lookup_id_); + dns_lookup_id_ = -1; + } // qDebug () << "MessageClient server:" << server_name << "port:" << server_port_ << "interfaces:" << network_interface_names; server_.setAddress (server_name); network_interfaces_.clear (); @@ -176,7 +293,7 @@ void MessageClient::impl::start () TRACE_UDP ("Trying server:" << server_.toString ()); QHostAddress interface_addr {IPv6Protocol == server_.protocol () ? QHostAddress::AnyIPv6 : QHostAddress::AnyIPv4}; - if (localAddress () != interface_addr) + if (state () != BoundState || localAddress () != interface_addr) { if (UnconnectedState != state () || state ()) { @@ -184,7 +301,10 @@ void MessageClient::impl::start () } // bind to an ephemeral port on the selected interface and set // up for sending datagrams - bind (interface_addr); + if (!bind (interface_addr)) + { + return; + } // qDebug () << "Bound to UDP port:" << localPort () << "on:" << localAddress (); // set multicast TTL to limit scope when sending to multicast @@ -204,7 +324,8 @@ void MessageClient::impl::start () void MessageClient::impl::pending_datagrams () { - while (hasPendingDatagrams ()) + int budget {64}; + while (budget-- && hasPendingDatagrams ()) { QByteArray datagram; datagram.resize (pendingDatagramSize ()); @@ -216,10 +337,65 @@ void MessageClient::impl::pending_datagrams () parse_message (datagram); } } + if (hasPendingDatagrams ()) QTimer::singleShot (0, this, &impl::pending_datagrams); +} + +void MessageClient::impl::invalid_inhibit () +{ + ++inhibit_invalid_count_; + if (!inhibit_invalid_timer_.isActive ()) inhibit_invalid_timer_.start (100); +} + +bool MessageClient::impl::parse_tx_inhibit (QByteArray const& msg) +{ + if (msg.size () < 12 + || qFromBigEndian (reinterpret_cast (msg.constData () + 8)) + != NetworkMessage::TxInhibit) return false; + if (!enabled_) return true; + // Bound the envelope before Reader allocates its variable-length instance ID. + if (msg.size () < 16 || msg.size () > inhibit_message_limit + || qFromBigEndian (reinterpret_cast (msg.constData () + 12)) > 1024 + || qFromBigEndian (reinterpret_cast (msg.constData ())) != NetworkMessage::Builder::magic) + { + invalid_inhibit (); + return true; + } + try + { + NetworkMessage::Reader in {msg}; + if (in.status () != QDataStream::Ok || in.schema () < 2) + { + invalid_inhibit (); + return true; + } + auto const id_length = qFromBigEndian (reinterpret_cast (msg.constData () + 12)); + if (in.id ().toUtf8 () != msg.mid (16, int (id_length))) + { + invalid_inhibit (); + return true; + } + if (in.id () != id_) return true; + QString controller; + QString station; + quint32 ttl {0}; + bool valid = read_inhibit_text (in, controller, 128, true); + in >> ttl; + valid = valid && in.status () == QDataStream::Ok + && (!ttl || (ttl >= 100 && ttl <= 30000)) + && read_inhibit_text (in, station, 128, false); + if (!valid) invalid_inhibit (); + else Q_EMIT self_->tx_inhibit_command (controller, ttl, station); + } + catch (std::exception const&) + { + invalid_inhibit (); + } + return true; } void MessageClient::impl::parse_message (QByteArray const& msg) { + if (parse_tx_inhibit (msg)) return; try { // @@ -267,9 +443,19 @@ void MessageClient::impl::parse_message (QByteArray const& msg) << modifiers); if (check_status (in) != Fail) { - Q_EMIT self_->reply (time, snr, delta_time, delta_frequency - , QString::fromUtf8 (mode), QString::fromUtf8 (message) - , low_confidence, modifiers); + DecodeIdentity const decode {time, snr, delta_time, delta_frequency, + mode, message, low_confidence}; + if (is_prior_decode (decode)) + { + Q_EMIT self_->reply (time, snr, delta_time, delta_frequency + , QString::fromUtf8 (mode), QString::fromUtf8 (message) + , low_confidence, modifiers); + } + else + { + qDebug () << "process reply message ignored, decode not found:" + << time << snr << delta_time << delta_frequency << mode << message; + } } } break; @@ -281,6 +467,10 @@ void MessageClient::impl::parse_message (QByteArray const& msg) TRACE_UDP ("Clear window:" << window); if (check_status (in) != Fail) { + if (window == 0 || window == 2) + { + clear_decode_history (); + } Q_EMIT self_->clear_decodes (window); } } @@ -299,7 +489,6 @@ void MessageClient::impl::parse_message (QByteArray const& msg) TRACE_UDP ("Replay"); if (check_status (in) != Fail) { - last_message_.clear (); Q_EMIT self_->replay (); } break; @@ -436,6 +625,25 @@ void MessageClient::impl::parse_message (QByteArray const& msg) } } +void MessageClient::impl::remember_decode (DecodeIdentity const& decode) +{ + if (decode_history_.size () >= decode_history_limit) + { + decode_history_.dequeue (); + } + decode_history_.enqueue (decode); +} + +bool MessageClient::impl::is_prior_decode (DecodeIdentity const& decode) const +{ + return decode_history_.contains (decode); +} + +void MessageClient::impl::clear_decode_history () +{ + decode_history_.clear (); +} + void MessageClient::impl::heartbeat () { if (server_port_ && !server_.isNull ()) @@ -446,11 +654,70 @@ void MessageClient::impl::heartbeat () << version_.toUtf8 () << revision_.toUtf8 (); TRACE_UDP ("schema:" << schema_ << "max schema:" << NetworkMessage::Builder::schema_number << "version:" << version_ << "revision:" << revision_); send_message (out, message, false, true); + if (inhibit_available ()) send_inhibit_status (true); } } +bool MessageClient::impl::inhibit_available () const +{ + return enabled_ && inhibit_status_.valid && inhibit_status_.supported; +} + +void MessageClient::impl::set_enabled (bool enabled) +{ + if (enabled_ == enabled) return; + + auto const was_available = inhibit_available (); + enabled_ = enabled; + if (inhibit_available ()) + { + send_inhibit_status (true); + } + else if (was_available) + { + send_inhibit_status (false); + } +} + +void MessageClient::impl::update_inhibit_status ( + bool supported, bool inhibited, QString const& source_station, + quint32 hold_rx, quint32 release_rx, quint32 expiries, quint32 invalid) +{ + auto const was_available = inhibit_available (); + inhibit_status_ = { + true, supported, inhibited, source_station, + hold_rx, release_rx, expiries, invalid + }; + if (inhibit_available ()) + { + send_inhibit_status (true); + } + else if (was_available) + { + send_inhibit_status (false); + } +} + +void MessageClient::impl::send_inhibit_status (bool supported) +{ + if (!inhibit_status_.valid || !server_port_ || server_.isNull ()) return; + + QByteArray message; + NetworkMessage::Builder out {&message, NetworkMessage::InhibitStatus, + id_, schema_}; + out << supported << inhibit_status_.inhibited + << inhibit_status_.source_station.toUtf8 () + << inhibit_status_.hold_rx << inhibit_status_.release_rx + << inhibit_status_.expiries << inhibit_status_.invalid; + TRACE_UDP ("supported:" << supported + << "inhibited:" << inhibit_status_.inhibited + << "source:" << inhibit_status_.source_station); + send_message (out, message, false, true); +} + void MessageClient::impl::closedown () { + cancel_replay (); if (server_port_ && !server_.isNull ()) { QByteArray message; @@ -460,30 +727,137 @@ void MessageClient::impl::closedown () } } +bool MessageClient::impl::begin_replay () +{ + if (ReplayState::Idle != replay_state_) + { + return false; + } + + last_message_.clear (); + replay_state_ = ReplayState::Collecting; + return true; +} + +void MessageClient::impl::end_replay () +{ + if (ReplayState::Collecting != replay_state_) + { + return; + } + + if (replay_messages_.isEmpty ()) + { + replay_state_ = ReplayState::Idle; + return; + } + + replay_state_ = ReplayState::Draining; + replay_timer_->start (replay_interval_ms); +} + +void MessageClient::impl::cancel_replay () +{ + ++replay_generation_; + replay_timer_->stop (); + replay_messages_.clear (); + replay_state_ = ReplayState::Idle; +} + +void MessageClient::impl::drain_replay () +{ + if (ReplayState::Draining != replay_state_) + { + return; + } + + auto const generation = replay_generation_; + QElapsedTimer work_timer; + work_timer.start (); + int writes {0}; + int messages {0}; + + while (!replay_messages_.isEmpty () + && writes < replay_write_budget + && messages < replay_message_budget + && work_timer.elapsed () < replay_work_budget_ms) + { + auto const contents = replay_messages_.head ().contents; + if (is_multicast_address (server_)) + { + auto const next_interface = replay_messages_.head ().next_interface; + if (next_interface < network_interfaces_.size ()) + { + if (generation != replay_generation_ || ReplayState::Draining != replay_state_) + { + return; + } + setMulticastInterface (network_interfaces_[next_interface]); + writeDatagram (contents, server_, server_port_); + if (generation != replay_generation_ || ReplayState::Draining != replay_state_) + { + return; + } + ++replay_messages_.head ().next_interface; + ++writes; + } + + if (replay_messages_.head ().next_interface < network_interfaces_.size ()) + { + continue; + } + } + else + { + if (generation != replay_generation_ || ReplayState::Draining != replay_state_) + { + return; + } + writeDatagram (contents, server_, server_port_); + if (generation != replay_generation_ || ReplayState::Draining != replay_state_) + { + return; + } + ++writes; + } + + last_message_ = contents; + replay_messages_.dequeue (); + ++messages; + } + + if (replay_messages_.isEmpty ()) + { + replay_state_ = ReplayState::Idle; + } + else + { + replay_timer_->start (replay_interval_ms); + } + + if (messages) + { + Q_EMIT self_->replay_batch_processed (messages); + } +} + void MessageClient::impl::send_message (QByteArray const& message, bool queue_if_pending, bool allow_duplicates) { if (server_port_) { if (!server_.isNull ()) { - if (allow_duplicates || message != last_message_) // avoid duplicates + auto const& previous_message = replay_messages_.isEmpty () ? last_message_ : replay_messages_.back ().contents; + if (allow_duplicates || message != previous_message) // avoid duplicates { - if (is_multicast_address (server_)) + if (ReplayState::Idle != replay_state_) { - // send datagram on each selected network interface - std::for_each (network_interfaces_.begin (), network_interfaces_.end () - , [&] (QNetworkInterface const& net_if) { - setMulticastInterface (net_if); - // qDebug () << "Multicast UDP datagram sent to:" << server_ << "port:" << server_port_ << "on:" << multicastInterface ().humanReadableName (); - writeDatagram (message, server_, server_port_); - }); + replay_messages_.enqueue (PendingMessage {message}); } else { - // qDebug () << "Unicast UDP datagram sent to:" << server_ << "port:" << server_port_; - writeDatagram (message, server_, server_port_); + send_message_immediately (message); } - last_message_ = message; } } else if (queue_if_pending) @@ -493,6 +867,23 @@ void MessageClient::impl::send_message (QByteArray const& message, bool queue_if } } +void MessageClient::impl::send_message_immediately (QByteArray const& message) +{ + if (is_multicast_address (server_)) + { + for (auto const& net_if : network_interfaces_) + { + setMulticastInterface (net_if); + writeDatagram (message, server_, server_port_); + } + } + else + { + writeDatagram (message, server_, server_port_); + } + last_message_ = message; +} + auto MessageClient::impl::check_status (QDataStream const& stream) const -> StreamStatus { auto stat = stream.status (); @@ -546,6 +937,8 @@ MessageClient::MessageClient (QString const& id, QString const& version, QString m_->set_server (server_name, network_interface_names); } +MessageClient::~MessageClient () = default; + QHostAddress MessageClient::server_address () const { return m_->server_; @@ -563,7 +956,12 @@ void MessageClient::set_server (QString const& server_name, QStringList const& n void MessageClient::set_server_port (port_type server_port) { - m_->server_port_ = server_port; + if (m_->server_port_ != server_port) + { + m_->cancel_replay (); + m_->server_port_ = server_port; + if (m_->dns_lookup_id_ == -1 && !m_->server_.isNull ()) m_->start (); + } } void MessageClient::set_TTL (int TTL) @@ -574,7 +972,17 @@ void MessageClient::set_TTL (int TTL) void MessageClient::enable (bool flag) { - m_->enabled_ = flag; + m_->set_enabled (flag); +} + +bool MessageClient::begin_replay () +{ + return m_->begin_replay (); +} + +void MessageClient::end_replay () +{ + m_->end_replay (); } void MessageClient::status_update (Frequency f, QString const& mode, QString const& dx_call @@ -608,15 +1016,28 @@ void MessageClient::decode (bool is_new, QTime time, qint32 snr, float delta_tim { if (m_->server_port_ && !m_->server_.isNull ()) { + auto const mode_utf8 = mode.toUtf8 (); + auto const message_utf8 = message_text.toUtf8 (); + m_->remember_decode ({time, snr, delta_time, delta_frequency, mode_utf8, + message_utf8, low_confidence}); QByteArray message; NetworkMessage::Builder out {&message, NetworkMessage::Decode, m_->id_, m_->schema_}; - out << is_new << time << snr << delta_time << delta_frequency << mode.toUtf8 () - << message_text.toUtf8 () << low_confidence << off_air; + out << is_new << time << snr << delta_time << delta_frequency << mode_utf8 + << message_utf8 << low_confidence << off_air; TRACE_UDP ("new" << is_new << "time:" << time << "snr:" << snr << "dt:" << delta_time << "df:" << delta_frequency << "mode:" << mode << "text:" << message_text << "low conf:" << low_confidence << "off air:" << off_air); m_->send_message (out, message); } } +void MessageClient::inhibit_status (bool supported, bool inhibited, + QString const& source_station, + quint32 hold_rx, quint32 release_rx, + quint32 expiries, quint32 invalid) +{ + m_->update_inhibit_status (supported, inhibited, source_station, + hold_rx, release_rx, expiries, invalid); +} + void MessageClient::WSPR_decode (bool is_new, QTime time, qint32 snr, float delta_time, Frequency frequency , qint32 drift, QString const& callsign, QString const& grid, qint32 power , bool off_air) @@ -634,6 +1055,7 @@ void MessageClient::WSPR_decode (bool is_new, QTime time, qint32 snr, float delt void MessageClient::decodes_cleared () { + m_->clear_decode_history (); if (m_->server_port_ && !m_->server_.isNull ()) { QByteArray message; diff --git a/Network/MessageClient.hpp b/Network/MessageClient.hpp index 436f0203..c191b312 100644 --- a/Network/MessageClient.hpp +++ b/Network/MessageClient.hpp @@ -38,6 +38,7 @@ public: QString const& server_name, port_type server_port, QStringList const& network_interface_names, int TTL, QObject * parent = nullptr); + ~MessageClient () override; // query server details QHostAddress server_address () const; @@ -57,6 +58,13 @@ public: // enable incoming messages Q_SLOT void enable (bool); + Q_SIGNAL void tx_inhibit_command (QString const& controller, quint32 ttl_ms, QString const& station); + Q_SIGNAL void tx_inhibit_invalid (quint64 count); + + // bracket serialization of a paced replay transaction + bool begin_replay (); + void end_replay (); + // outgoing messages Q_SLOT void status_update (Frequency, QString const& mode, QString const& dx_call, QString const& report , QString const& tx_mode, bool tx_enabled, bool transmitting, bool decoding @@ -84,6 +92,10 @@ public: // ADIF_record argument should be valid ADIF excluding any end // of record marker Q_SLOT void logged_ADIF (QByteArray const& ADIF_record); + Q_SLOT void inhibit_status (bool supported, bool inhibited, + QString const& source_station, + quint32 hold_rx, quint32 release_rx, + quint32 expiries, quint32 invalid); // this signal is emitted if the server has requested a decode // window clear action @@ -102,6 +114,9 @@ public: // all decodes Q_SIGNAL void replay (); + // this signal is emitted after a paced replay batch has been processed + Q_SIGNAL void replay_batch_processed (int message_count); + // this signal is emitted if the server has requested immediate (or // auto Tx if auto_only is true) transmission to halt Q_SIGNAL void halt_tx (bool auto_only); diff --git a/Network/Network.pri b/Network/Network.pri deleted file mode 100644 index 723001e9..00000000 --- a/Network/Network.pri +++ /dev/null @@ -1,21 +0,0 @@ -SOURCES += \ -Network/FileDownload.cpp \ -Network/FoxVerifier.cpp \ -Network/LotWUsers.cpp \ -Network/MessageClient.cpp \ -Network/NetworkAccessManager.cpp \ -Network/NetworkMessage.cpp \ -Network/NetworkServerLookup.cpp \ -Network/PSKReporter.cpp \ -Network/wsprnet.cpp - -HEADERS += \ -Network/FileDownload.hpp \ -Network/FoxVerifier.hpp \ -Network/LotWUsers.hpp \ -Network/MessageClient.hpp \ -Network/NetworkAccessManager.hpp \ -Network/NetworkMessage.hpp \ -Network/NetworkServerLookup.hpp \ -Network/PSKReporter.hpp \ -Network/wsprnet.h diff --git a/Network/NetworkMessage.hpp b/Network/NetworkMessage.hpp index 74a268fa..fdb5cb91 100644 --- a/Network/NetworkMessage.hpp +++ b/Network/NetworkMessage.hpp @@ -50,6 +50,10 @@ * strings and null strings. Empty strings have a length of zero * whereas null strings have a length field of 0xffffffff. * + * Reference servers distinguish clients by sender address and Id and echo + * that Id in requests. The destination UDP endpoint selects the WSJT-X + * recipient; Id is not an authorization check. + * * * Schema Negotiation * ------------------ @@ -231,6 +235,9 @@ * validation. Off air decodes are those that result from playing * back a .WAV file. * + * Mode is the decoded-line marker ("~" for FT8, "+" for FT4), not + * the operating mode name carried by Status. + * * * Clear Out/In 3 quint32 * Id (unique key) utf8 @@ -279,6 +286,10 @@ * initiation the rest of the QSO is carried out manually using * the normal WSJT-X user interface. * + * Copy the fields from Time through Low confidence unchanged from + * Decode. Substituting a Status mode name such as "FT8" for the + * decoded-line marker "~" prevents matching. + * * The Modifiers field allows the equivalent of keyboard * modifiers to be sent "as if" those modifier keys where pressed * while double-clicking the specified decoded message. The @@ -529,6 +540,59 @@ * ffffffff will remove the sort-order value from the internal table. * Callsigns without a sort order will be valued at zero for sorting purposes * in the hound display. + * + * InhibitStatus Out 17 + * Id (unique key) utf8 + * Supported bool + * Inhibited bool + * Source station utf8 + * Hold rx quint32 + * Release rx quint32 + * Expiries quint32 + * Invalid quint32 + * + * Supported means the active transceiver uses DTR or RTS PTT and Accept + * UDP requests is enabled, so the instance can apply inhibit commands. + * A supported snapshot is sent on state changes and after each Heartbeat. + * A final unsupported snapshot withdraws availability; controllers should + * expire an advertisement after three missing Heartbeat intervals. + * Inhibited means at least one hold is active and may remain true in a + * withdrawal until existing leases expire. Source station summarizes + * active holders. Counters are cumulative for the current transceiver + * lifetime. + * + * TxInhibit In 18 + * Id (target unique key) utf8 + * Controller ID utf8 + * TTL milliseconds quint32 + * Station utf8 + * + * Send commands to the source address and ephemeral source port learned + * from ordinary WSJT-X traffic, using its exact Id and schema (2 or 3). + * Refresh the endpoint on subsequent traffic. Multicast allows multiple + * observers; unicast requires the controller to receive or relay the stream. + * + * Accept UDP requests authorizes this command. DTR or RTS PTT is required + * to apply holds. Disabling requests does not clear existing holds; they + * remain active until their leases expire. + * + * Controller ID is a stable, nonempty UTF-8 identity of at most 128 bytes, + * with no whitespace or nonprinting characters. Station is descriptive + * UTF-8 text of at most 128 bytes, without nonprinting characters; send an + * empty or null string when no label is needed. Both fields must be present. + * + * A zero TTL releases only this controller. A positive TTL from 100 through + * 30000 milliseconds creates or refreshes its hold. All unexpired holds + * combine with logical OR. Controller identity, not source port or Station, + * owns a hold. Id is required to match exactly. + * + * Up to 64 controllers are tracked individually. Additional identities + * extend an aggregate hold until its longest lease expires; releases + * cannot clear that aggregate. Its expiry counts as one expiry. + * + * Datagrams are limited to 4096 bytes and the target Id to 1024 bytes. + * Malformed commands are ignored and counted; other target IDs are ignored. + * Unknown trailing fields within the datagram limit are ignored as usual. */ #include @@ -561,10 +625,16 @@ namespace NetworkMessage SwitchConfiguration, Configure, AnnotationInfo, + InhibitStatus = 17, + TxInhibit = 18, maximum_message_type_ // ONLY add new message types // immediately before here }; + static_assert (InhibitStatus == 17, "TX-inhibit protocol type must remain 17"); + + static_assert (TxInhibit == 18, "TX-inhibit command type must remain 18"); + quint32 constexpr pulse {15}; // seconds // diff --git a/Network/PSKReporter.cpp b/Network/PSKReporter.cpp index 5a0eac26..b91713ee 100644 --- a/Network/PSKReporter.cpp +++ b/Network/PSKReporter.cpp @@ -32,10 +32,6 @@ namespace { - QLatin1String HOST {"report.pskreporter.info"}; - // QLatin1String HOST {"127.0.0.1"}; - quint16 SERVICE_PORT {4739}; - // quint16 SERVICE_PORT {14739}; int MIN_SEND_INTERVAL {120}; // in seconds int FLUSH_INTERVAL {MIN_SEND_INTERVAL + 5}; // in send intervals int MAX_PENDING_SPOTS {2048}; @@ -162,8 +158,11 @@ public: // use this for pseudo connection with UDP, allows us to use // QIODevice::write() instead of QUDPSocket::writeDatagram() - socket_->connectToHost (HOST, SERVICE_PORT, QAbstractSocket::WriteOnly); - LOG_LOG_LOCATION (logger_, debug, "remote host: " << HOST.latin1 () << " port: " << SERVICE_PORT); + socket_->connectToHost (options_.destination_host, options_.destination_port, + QAbstractSocket::WriteOnly); + LOG_LOG_LOCATION (logger_, debug, + "remote host: " << qPrintable (options_.destination_host) + << " port: " << options_.destination_port); if (!report_timer_.isActive ()) { diff --git a/Network/PSKReporter.hpp b/Network/PSKReporter.hpp index 46fe0a82..3b1f4f13 100644 --- a/Network/PSKReporter.hpp +++ b/Network/PSKReporter.hpp @@ -21,6 +21,8 @@ public: bool use_tcpip; QString eclipse_file_path; QString program_info; + QString destination_host {"report.pskreporter.info"}; + quint16 destination_port {4739}; }; explicit PSKReporter (Configuration const *, QString const& program_info); diff --git a/Network/eqsl.cpp b/Network/eqsl.cpp index 0f8b15df..5abcdadb 100644 --- a/Network/eqsl.cpp +++ b/Network/eqsl.cpp @@ -15,7 +15,7 @@ namespace { - char const * const EqslUrl = "http://www.eqsl.cc/qslcard/importADIF.cfm"; + char const * const EqslUrl = "https://www.eqsl.cc/qslcard/importADIF.cfm"; // char const * const wsprNetUrl = "http://127.0.0.1/post?"; }; diff --git a/Network/tests/PSKReporter/PSKReporter.IESpec b/Network/tests/PSKReporter/PSKReporter.IESpec deleted file mode 100644 index 8e95ffd0..00000000 --- a/Network/tests/PSKReporter/PSKReporter.IESpec +++ /dev/null @@ -1,12 +0,0 @@ -senderCallsign(30351/1)[65535] -receiverCallsign(30351/2)[65535] -senderLocator(30351/3)[65535] -receiverLocator(30351/4)[65535] -frequency(30351/5)[4] -sNR(30351/6)[1] -iMD(30351/7)[1] -decoderSoftware(30351/8)[65535] -antennaInformation(30351/9)[65535] -mode(30351/10)[65535] -informationSource(30351/11)[1] -persistentIdentifier(30351/12)[65535] diff --git a/Network/tests/PSKReporter/listener.py b/Network/tests/PSKReporter/listener.py deleted file mode 100644 index 4cc0e29c..00000000 --- a/Network/tests/PSKReporter/listener.py +++ /dev/null @@ -1,94 +0,0 @@ -from __future__ import unicode_literals -import sys -import argparse -import logging -import time -import threading -import ipfix.ie -import ipfix.reader -import ipfix.message -import socketserver -import socket - -class IPFixDatagramHandler (socketserver.DatagramRequestHandler): - - def handle (self): - logging.info (f'Connection from {self.client_address}') - try: - self.server.msg_buffer.from_bytes (self.packet) - for rec in self.server.msg_buffer.namedict_iterator (): - logging.info (f't: {self.server.msg_buffer.get_export_time()}: {rec}') - except: - logging.error ('Unexpected exception:', sys.exc_info ()[0]) - - -class IPFixUdpServer (socketserver.UDPServer): - - def __init__ (self, *args, **kwargs): - - self.msg_buffer = ipfix.message.MessageBuffer () - super ().__init__ (*args, **kwargs) - -class IPFixStreamHandler (socketserver.StreamRequestHandler): - - def handle (self): - logging.info (f'Connection from {self.client_address}') - try: - msg_reader = ipfix.reader.from_stream (self.rfile) - for rec in msg_reader.namedict_iterator (): - logging.info (f't: {msg_reader.msg.get_export_time()}: {rec}') - logging.info (f'{self.client_address} closed their connection') - except ConnectionResetError: - logging.info (f'{self.client_address} connection reset') - except TimeoutError: - logging.info (f'{self.client_address} connection timed out') - except: - logging.error ('Unexpected exception:', sys.exc_info ()[0]) - - -if __name__ == "__main__": - INTERFACE, PORT = '', 4739 - - ap = argparse.ArgumentParser (description='Dump IPFIX data collected over UDP') - ap.add_argument ('-l', '--log', metavar='loglevel', default='WARNING', help='logging level') - ap.add_argument ('-s', '--spec', metavar='specfile', help='iespec file to read') - args = ap.parse_args () - - log_level = getattr (logging, args.log.upper (), None) - if not isinstance (log_level, int): - raise ValueError (f'Invalif log level: {log_level}') - logging.basicConfig ( - level=log_level - , format='[%(levelname)s] (%(threadName)-10s) %(message)s' - , - ) - - logging.info (f'Starting IPFix servers on service port: {PORT}') - - ipfix.ie.use_iana_default () - ipfix.ie.use_5103_default () - if args.spec: - ipfix.ie.use_specfile (args.spec) - - udp_server = IPFixUdpServer ((INTERFACE, PORT), IPFixDatagramHandler) - udp_thread = threading.Thread (name='UDP Server', target=udp_server.serve_forever) - - tcp_server = socketserver.TCPServer ((INTERFACE, PORT), IPFixStreamHandler) - tcp_server.allow_reuse_address = True - tcp_server.socket.setsockopt (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) - tcp_thread = threading.Thread (name='TCP/IP Server', target=tcp_server.serve_forever) - - udp_thread.start () - tcp_thread.start () - - try: - while True: - time.sleep (1000) - except KeyboardInterrupt: - logging.warning ('Closing down servers') - udp_server.shutdown () - tcp_server.shutdown () - - udp_thread.join () - tcp_thread.join () - logging.info ('Servers closed') diff --git a/Network/tests/PSKReporter/python-ipfix.patch b/Network/tests/PSKReporter/python-ipfix.patch deleted file mode 100644 index cb679709..00000000 --- a/Network/tests/PSKReporter/python-ipfix.patch +++ /dev/null @@ -1,64 +0,0 @@ -The following changes since commit e487dfbead9965c1a251d110dc55039a7ba4afef: - - sphinx doc update (2017-09-20 16:07:22 +0200) - -are available in the Git repository at: - - git@github.com:g4wjs/python-ipfix.git varlen-and-padding - -for you to fetch changes up to 6dcc106f22d25ac21b27f8ccb9b82be12e7eb18e: - - Parse and emit data elements correctly when variable length items included (2020-06-19 19:53:33 +0100) - ----------------------------------------------------------------- -Bill Somerville (2): - Allow for alignment padding when parsing sets - Parse and emit data elements correctly when variable length items included - - ipfix/message.py | 3 ++- - ipfix/template.py | 4 ++-- - 2 files changed, 4 insertions(+), 3 deletions(-) - -diff --git a/ipfix/message.py b/ipfix/message.py -index 0af2fad..71c1328 100644 ---- a/ipfix/message.py -+++ b/ipfix/message.py -@@ -398,7 +398,7 @@ class MessageBuffer(object): - offset += _sethdr_st.size # skip set header in decode - if setid == template.TEMPLATE_SET_ID or\ - setid == template.OPTIONS_SET_ID: -- while offset < setend: -+ while offset + 4 < setend: # allow for padding up to 4 byte alignment - (tmpl, offset) = template.decode_template_from( - self.mbuf, offset, setid) - # FIXME handle withdrawal -@@ -431,6 +431,7 @@ class MessageBuffer(object): - # KeyError on template lookup - unknown data set - self.unknown_data_set_hook(self, - self.mbuf[offset-_sethdr_st.size:setend]) -+ offset = setend # real end may be greater that accumulated offset - - def namedict_iterator(self): - """ -diff --git a/ipfix/template.py b/ipfix/template.py -index 1203e55..26cd8c1 100644 ---- a/ipfix/template.py -+++ b/ipfix/template.py -@@ -187,7 +187,7 @@ class Template(object): - offset += packplan.st.size - - # short circuit on no varlen -- if not self.varlenslice: -+ if self.varlenslice is None: - return (vals, offset) - - # direct iteration over remaining IEs -@@ -239,7 +239,7 @@ class Template(object): - offset += packplan.st.size - - # shortcircuit no varlen -- if not self.varlenslice: -+ if self.varlenslice is None: - return offset - - # direct iteration over remaining IEs diff --git a/Network/wsprnet.cpp b/Network/wsprnet.cpp index 14dce13d..a785acd7 100644 --- a/Network/wsprnet.cpp +++ b/Network/wsprnet.cpp @@ -5,6 +5,7 @@ #include "wsprnet.h" #include +#include #include #include @@ -15,12 +16,45 @@ #include #include #include +#include +#include + +#if QT_VERSION >= QT_VERSION_CHECK (5, 10, 0) +#include +#endif #include "moc_wsprnet.cpp" namespace { + class QNetworkAccessManagerTransport final + : public QObject + , public WSPRNet::Transport + { + public: + explicit QNetworkAccessManagerTransport (QObject *parent = nullptr) + : QObject {parent} + , network_manager_ {new QNetworkAccessManager {this}} + { + } + + QNetworkReply *post (QNetworkRequest const& request, QByteArray const& body) override + { +#if QT_VERSION < QT_VERSION_CHECK (5, 15, 0) + if (QNetworkAccessManager::Accessible != network_manager_->networkAccessible ()) { + // try and recover network access for QNAM + network_manager_->setNetworkAccessible (QNetworkAccessManager::Accessible); + } +#endif + return network_manager_->post (request, body); + } + + private: + QNetworkAccessManager * network_manager_; + }; + char const * const wsprNetUrl = "http://wsprnet.org/post/"; + char const * const wsprNetUrl2 = "http://wsprnet.eu:3000/post/"; //char const * const wsprNetUrl = "http://127.0.0.1:5000/post/"; // @@ -62,151 +96,566 @@ with app.test_request_context (): }; WSPRNet::WSPRNet(QObject *parent) + : WSPRNet {nullptr, RetryPolicy {}, false, parent} +{ +} + +WSPRNet::WSPRNet (Transport *transport, RetryPolicy retry_policy, + bool take_transport_ownership, QObject *parent) : QObject {parent} - , network_manager_ {new QNetworkAccessManager(this)} - , spots_to_send_ {0} + , transport_ {transport ? transport : new QNetworkAccessManagerTransport {this}} + , owns_transport_ {transport && take_transport_ownership} + , retry_policy_ {retry_policy} + , TR_period_ {0.F} + , uploads_started_ {0} + , next_file_batch_id_ {1} + , next_logical_upload_id_ {1} + , upload_session_active_ {false} { + upload_timer_.setSingleShot (true); connect (&upload_timer_, &QTimer::timeout, this, &WSPRNet::work); } +WSPRNet::~WSPRNet () +{ + if (owns_transport_) + { + delete transport_; + } +} + void WSPRNet::upload (QString const& call, QString const& grid, QString const& rfreq, QString const& tfreq, QString const& mode, float TR_period, QString const& tpct, QString const& dbm, QString const& version, QString const& fileName) { - m_call = call; - m_grid = grid; - m_rfreq = rfreq; - m_tfreq = tfreq; - m_mode = mode; - TR_period_ = TR_period; - m_tpct = tpct; - m_dbm = dbm; - m_vers = version; - m_file = fileName; - - // Open the wsprd.out file - if (m_uploadType != 3) - { - QFile wsprdOutFile (fileName); - if (!wsprdOutFile.open (QIODevice::ReadOnly | QIODevice::Text) || !wsprdOutFile.size ()) - { - spot_queue_.enqueue (urlEncodeNoSpot ()); - m_uploadType = 1; - } - else + StationContext context {call, grid, rfreq, tfreq, mode, TR_period, tpct, dbm, version}; + queueWsprFile (context, fileName); + flush (context); +} + +void WSPRNet::queueWsprFile (StationContext const& context, QString const& file_name) +{ + applyContext (context); + auto const snapshot = snapshotFile (file_name); + auto const file_batch_id = beginFileBatch (snapshot); + + QFile wsprdOutFile (file_name); + if (!wsprdOutFile.open (QIODevice::ReadOnly | QIODevice::Text) || !wsprdOutFile.size ()) + { + enqueueUpload (urlEncodeNoSpot (), UploadSource::File, PayloadKind::Status, file_name, file_batch_id); + } + else + { + while (!wsprdOutFile.atEnd()) { - // Read the contents - while (!wsprdOutFile.atEnd()) + SpotQueue::value_type query; + if (decodeLine (wsprdOutFile.readLine(), query)) { - SpotQueue::value_type query; - if (decodeLine (wsprdOutFile.readLine(), query)) + // Prevent reporting data ouside of the current frequency band + float f = fabs (m_rfreq.toFloat() - query.queryItemValue ("tqrg", QUrl::FullyDecoded).toFloat()); + if (f < 0.01) // MHz { - // Prevent reporting data ouside of the current frequency band - float f = fabs (m_rfreq.toFloat() - query.queryItemValue ("tqrg", QUrl::FullyDecoded).toFloat()); - if (f < 0.01) // MHz - { - spot_queue_.enqueue(urlEncodeSpot (query)); - m_uploadType = 2; - } + enqueueUpload (urlEncodeSpot (query), UploadSource::File, PayloadKind::Spot, file_name, file_batch_id); } } } } - spots_to_send_ = spot_queue_.size (); - upload_timer_.start (200); + if (file_uploads_.value (file_batch_id).total == 0) + { + file_uploads_.remove (file_batch_id); + } } void WSPRNet::post (QString const& call, QString const& grid, QString const& rfreq, QString const& tfreq, QString const& mode, float TR_period, QString const& tpct, QString const& dbm, QString const& version, QString const& decode_text) { - m_call = call; - m_grid = grid; - m_rfreq = rfreq; - m_tfreq = tfreq; - m_mode = mode; - TR_period_ = TR_period; - m_tpct = tpct; - m_dbm = dbm; - m_vers = version; + StationContext context {call, grid, rfreq, tfreq, mode, TR_period, tpct, dbm, version}; if (!decode_text.size ()) { - if (!spot_queue_.size ()) + flush (context); + } + else + { + queueFst4wDecode (context, decode_text); + } +} + +void WSPRNet::queueFst4wDecode (StationContext const& context, QString const& decode_text) +{ + applyContext (context); + auto const& match = fst4_re.match (decode_text); + if (match.hasMatch ()) + { + SpotQueue::value_type query; + auto tqrg = match.captured ("freq").toInt (); + query.addQueryItem ("function", "wspr"); + // FST4W reports are intentionally not constrained to WSPR sub-bands. + auto const& date = QDateTime::currentDateTimeUtc ().addSecs (-context.TR_period * 3. / 4.).date (); + query.addQueryItem ("date", date.toString ("yyMMdd")); + query.addQueryItem ("time", match.captured ("time")); + query.addQueryItem ("sig", match.captured ("db")); + query.addQueryItem ("dt", match.captured ("dt")); + query.addQueryItem ("tqrg", QString::number (context.rfreq.toDouble () + (tqrg - 1500) / 1e6, 'f', 6)); + query.addQueryItem ("tcall", match.captured ("call")); + query.addQueryItem ("drift", "0"); + query.addQueryItem ("tgrid", match.captured ("grid")); + query.addQueryItem ("dbm", match.captured ("dBm")); + enqueueUpload (urlEncodeSpot (query), UploadSource::Direct, PayloadKind::Spot); + } +} + +void WSPRNet::flush (StationContext const& context) +{ + applyContext (context); + if (pending_primary_uploads_.isEmpty () && !hasOutstanding (UploadTarget::Primary)) + { + enqueueUpload (urlEncodeNoSpot (), UploadSource::Direct, PayloadKind::Status); + } + startUploadSession (); +} + +void WSPRNet::applyContext (StationContext const& context) +{ + m_call = context.call; + m_grid = context.grid; + m_rfreq = context.rfreq; + m_tfreq = context.tfreq; + m_mode = context.mode; + TR_period_ = context.TR_period; + m_tpct = context.tpct; + m_dbm = context.dbm; + m_vers = context.version; +} + +auto WSPRNet::snapshotFile (QString const& file_name) const -> FileSnapshot +{ + FileSnapshot snapshot; + snapshot.path = file_name; + + QFile file {file_name}; + if (!file.open (QIODevice::ReadOnly)) + { + return snapshot; + } + + auto const contents = file.readAll (); + snapshot.size = contents.size (); + snapshot.hash = QCryptographicHash::hash (contents, QCryptographicHash::Sha256); + return snapshot; +} + +bool WSPRNet::fileMatchesSnapshot (FileSnapshot const& snapshot) const +{ + if (snapshot.path.isEmpty () || snapshot.size < 0) + { + return false; + } + + QFile file {snapshot.path}; + if (!file.open (QIODevice::ReadOnly)) + { + return false; + } + + auto const contents = file.readAll (); + if (contents.size () != snapshot.size) + { + return false; + } + + return QCryptographicHash::hash (contents, QCryptographicHash::Sha256) == snapshot.hash; +} + +bool WSPRNet::hasPendingFileLeg (int file_batch_id, int logical_upload_id) const +{ + auto is_file_leg = [file_batch_id, logical_upload_id](PendingUpload const& upload) + { + return UploadSource::File == upload.source + && upload.file_batch_id == file_batch_id + && upload.logical_upload_id == logical_upload_id; + }; + + for (auto const& upload : pending_primary_uploads_) + { + if (is_file_leg (upload)) { - spot_queue_.enqueue (urlEncodeNoSpot ()); - m_uploadType = 3; + return true; } } - else + for (auto const& upload : pending_alternate_uploads_) { - auto const& match = fst4_re.match (decode_text); - if (match.hasMatch ()) + if (is_file_leg (upload)) { - SpotQueue::value_type query; - // Prevent reporting data ouside of the current frequency - // band - removed by G4WJS to accommodate FST4W spots - // outside of WSPR segments - auto tqrg = match.captured ("freq").toInt (); - // if (tqrg >= 1400 && tqrg <= 1600) - { - query.addQueryItem ("function", "wspr"); - // use time as at 3/4 of T/R period before current to - // ensure date is in Rx period - auto const& date = QDateTime::currentDateTimeUtc ().addSecs (-TR_period * 3. / 4.).date (); - query.addQueryItem ("date", date.toString ("yyMMdd")); - query.addQueryItem ("time", match.captured ("time")); - query.addQueryItem ("sig", match.captured ("db")); - query.addQueryItem ("dt", match.captured ("dt")); - query.addQueryItem ("tqrg", QString::number (rfreq.toDouble () + (tqrg - 1500) / 1e6, 'f', 6)); - query.addQueryItem ("tcall", match.captured ("call")); - query.addQueryItem ("drift", "0"); - query.addQueryItem ("tgrid", match.captured ("grid")); - query.addQueryItem ("dbm", match.captured ("dBm")); - spot_queue_.enqueue (urlEncodeSpot (query)); - m_uploadType = 2; - } + return true; + } + } + for (auto const& upload : outstanding_requests_) + { + if (is_file_leg (upload)) + { + return true; + } + } + return false; +} + +bool WSPRNet::hasOutstanding (UploadTarget target) const +{ + for (auto const& upload : outstanding_requests_) + { + if (upload.target == target) + { + return true; } } + return false; } void WSPRNet::networkReply (QNetworkReply * reply) { - // check if request was ours - if (m_outstandingRequests.removeOne (reply)) + if (!outstanding_requests_.contains (reply)) { + reply->deleteLater (); + return; + } + + auto upload = outstanding_requests_.take (reply); + QString server_response; + if (replyAccepted (upload, reply, server_response)) + { + markAccepted (upload); + } + else + { + auto const now = QDateTime::currentDateTimeUtc (); if (QNetworkReply::NoError != reply->error ()) { - Q_EMIT uploadStatus (QString {"Error: %1"}.arg (reply->error ())); - // not clearing queue or halting queuing as it may be a - // transient one off request error + Q_EMIT uploadStatus (QString {"Error: %1"}.arg (reply->errorString ())); + } + else + { + Q_EMIT uploadStatus (QString {"Upload Failed: %1"}.arg (server_response)); + } + + auto const retry_delay_ms = retryDelayMs (upload); + if (canRetry (upload, now, retry_delay_ms)) + { + retryUpload (upload, now, retry_delay_ms); } else { - QString serverResponse = reply->readAll (); - if (m_uploadType == 2) + markFailed (upload); + } + } + + qDebug () << QString {"WSPRnet.org %1 outstanding requests"}.arg (outstanding_requests_.size ()); + + // delete request object instance on return to the event loop otherwise it is leaked + reply->deleteLater (); + scheduleWork (); + maybeFinalize (); +} + +void WSPRNet::enqueueUpload (QUrlQuery const& query, UploadSource source, PayloadKind kind, QString const& source_file, int file_batch_id) +{ + auto const now = QDateTime::currentDateTimeUtc (); + auto const logical_upload_id = UploadSource::File == source ? next_logical_upload_id_++ : 0; + if (UploadSource::File == source) + { + auto& state = file_uploads_[file_batch_id]; + ++state.total; + } + auto enqueue_for_target = [this, &query, source, kind, &source_file, file_batch_id, + logical_upload_id, now](UploadTarget target) + { + auto& uploads = target == UploadTarget::Primary + ? pending_primary_uploads_ : pending_alternate_uploads_; + uploads.enqueue ({query, source, kind, source_file, file_batch_id, now, + now.addMSecs (retry_policy_.ttl_ms), now, 0, target, + logical_upload_id}); + }; + + enqueue_for_target (UploadTarget::Primary); + if (PayloadKind::Spot == kind + && !query.queryItemValue ("tgrid", QUrl::FullyDecoded).isEmpty ()) + { + enqueue_for_target (UploadTarget::Alternate); + } + pruneExpiredUploads (now); + enforcePendingLimit (); +} + +int WSPRNet::beginFileBatch (FileSnapshot const& snapshot) +{ + auto const file_batch_id = next_file_batch_id_++; + auto& state = file_uploads_[file_batch_id]; + state.snapshot = snapshot; + return file_batch_id; +} + +void WSPRNet::startUploadSession () +{ + upload_session_active_ = true; + uploads_started_ = outstanding_requests_.size (); + scheduleWork (); + maybeFinalize (); +} + +void WSPRNet::scheduleWork () +{ + if (!upload_session_active_) + { + return; + } + + auto const now = QDateTime::currentDateTimeUtc (); + pruneExpiredUploads (now); + QDateTime next_attempt_at; + auto have_next_attempt = false; + auto consider_queue = [this, &next_attempt_at, &have_next_attempt] + (QQueue const& uploads, UploadTarget target) + { + if (hasOutstanding (target)) + { + return; + } + for (auto const& upload : uploads) + { + if (!have_next_attempt || upload.next_attempt_at < next_attempt_at) + { + next_attempt_at = upload.next_attempt_at; + have_next_attempt = true; + } + } + }; + consider_queue (pending_primary_uploads_, UploadTarget::Primary); + consider_queue (pending_alternate_uploads_, UploadTarget::Alternate); + if (!have_next_attempt) + { + upload_timer_.stop (); + return; + } + + auto const delay = qMax (0, now.msecsTo (next_attempt_at)); + upload_timer_.start (static_cast (qMin (delay, std::numeric_limits::max ()))); +} + +void WSPRNet::pruneExpiredUploads (QDateTime const& now) +{ + int dropped = 0; + auto prune_queue = [this, &now, &dropped](QQueue& uploads) + { + for (int i = 0; i < uploads.size ();) + { + if (uploads[i].expires_at <= now) { - if (!serverResponse.contains(QRegExp("spot\\(s\\) added"))) - { - Q_EMIT uploadStatus (QString {"Upload Failed: %1"}.arg (serverResponse)); - spot_queue_.clear (); - upload_timer_.stop (); - } + markFailed (uploads.takeAt (i)); + ++dropped; + } + else + { + ++i; } + } + }; + prune_queue (pending_primary_uploads_); + prune_queue (pending_alternate_uploads_); + if (dropped) + { + Q_EMIT uploadStatus (QString {"Dropped %1 expired WSPRNet upload(s)"}.arg (dropped)); + } +} + +void WSPRNet::enforcePendingLimit () +{ + auto const max_pending = qMax (1, retry_policy_.max_pending); + auto const now = QDateTime::currentDateTimeUtc (); + pruneExpiredUploads (now); + + int dropped = 0; + auto enforce_queue_limit = [this, max_pending, &dropped](QQueue& uploads) + { + while (uploads.size () > max_pending) + { + markFailed (uploads.dequeue ()); + ++dropped; + } + }; + enforce_queue_limit (pending_primary_uploads_); + enforce_queue_limit (pending_alternate_uploads_); + if (dropped) + { + Q_EMIT uploadStatus (QString {"Dropped %1 oldest pending WSPRNet upload(s)"}.arg (dropped)); + } +} + +void WSPRNet::sendUpload (PendingUpload upload) +{ + auto const url = upload.target == UploadTarget::Primary ? wsprNetUrl : wsprNetUrl2; + QNetworkRequest request (QUrl {url}); + request.setHeader (QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); + if (!upload.attempts) + { + ++uploads_started_; + } + ++upload.attempts; + QNetworkReply *reply = transport_->post (request, upload.query.query (QUrl::FullyEncoded).toUtf8 ()); + connect (reply, &QNetworkReply::finished, this, [this, reply]() { networkReply (reply); }); + outstanding_requests_.insert (reply, upload); + Q_EMIT uploadStatus (QString {"Uploading Spot %1/%2"}.arg (uploads_started_).arg (uploadsToSend ())); +} + +bool WSPRNet::replyAccepted (PendingUpload const& upload, QNetworkReply *reply, QString& server_response) const +{ + if (QNetworkReply::NoError != reply->error ()) + { + return false; + } + server_response = reply->readAll (); + return PayloadKind::Status == upload.kind + || server_response.contains (QRegExp ("spot\\(s\\) added")); +} + +bool WSPRNet::canRetry (PendingUpload const& upload, QDateTime const& now, int retry_delay_ms) const +{ + return upload.attempts < retry_policy_.max_attempts + && now.addMSecs (retry_delay_ms) < upload.expires_at; +} + +int WSPRNet::retryDelayMs (PendingUpload const& upload) const +{ + int delay = 0; + if (!retry_policy_.retry_delays_ms.isEmpty ()) + { + auto const index = qMin (upload.attempts - 1, retry_policy_.retry_delays_ms.size () - 1); + delay = retry_policy_.retry_delays_ms[qMax (0, index)]; + } + if (delay <= 0 || retry_policy_.jitter_fraction <= 0.) + { + return qMax (0, delay); + } + +#if QT_VERSION >= QT_VERSION_CHECK (5, 10, 0) + auto const random = QRandomGenerator::global ()->generateDouble (); +#else + auto const random = qrand () / (RAND_MAX + 1.0); +#endif + auto const factor = 1. - retry_policy_.jitter_fraction + + random * retry_policy_.jitter_fraction * 2.; + return qMax (0, static_cast (delay * factor)); +} - if (!spot_queue_.size ()) +int WSPRNet::uploadsToSend () const +{ + auto total = uploads_started_; + auto count_unstarted = [&total](QQueue const& uploads) + { + for (auto const& upload : uploads) + { + if (!upload.attempts) { - Q_EMIT uploadStatus("done"); - QFile f {m_file}; - if (f.exists ()) f.remove (); - upload_timer_.stop (); + ++total; } } + }; + count_unstarted (pending_primary_uploads_); + count_unstarted (pending_alternate_uploads_); + return qMax (uploads_started_, total); +} - qDebug () << QString {"WSPRnet.org %1 outstanding requests"}.arg (m_outstandingRequests.size ()); +void WSPRNet::retryUpload (PendingUpload upload, QDateTime const& now, int retry_delay_ms) +{ + upload.next_attempt_at = now.addMSecs (retry_delay_ms); + auto& uploads = upload.target == UploadTarget::Primary + ? pending_primary_uploads_ : pending_alternate_uploads_; + uploads.enqueue (upload); + Q_EMIT uploadStatus (QString {"Retrying WSPRNet upload in %1 ms"}.arg (retry_delay_ms)); + enforcePendingLimit (); +} - // delete request object instance on return to the event loop otherwise it is leaked - reply->deleteLater (); +void WSPRNet::markAccepted (PendingUpload const& upload) +{ + if (UploadSource::File == upload.source) + { + auto state = file_uploads_.find (upload.file_batch_id); + if (state == file_uploads_.end ()) + { + return; + } + state->accepted.insert (upload.logical_upload_id); + state->failed.remove (upload.logical_upload_id); + maybeRemoveCompletedFile (upload.file_batch_id); + maybeRemoveFailedFileBatch (upload.file_batch_id); + } +} + +void WSPRNet::markFailed (PendingUpload const& upload) +{ + if (UploadSource::File == upload.source) + { + auto state = file_uploads_.find (upload.file_batch_id); + if (state == file_uploads_.end () || state->accepted.contains (upload.logical_upload_id)) + { + return; + } + if (!hasPendingFileLeg (upload.file_batch_id, upload.logical_upload_id)) + { + state->failed.insert (upload.logical_upload_id); + } + maybeRemoveFailedFileBatch (upload.file_batch_id); + } +} + +void WSPRNet::maybeRemoveFailedFileBatch (int file_batch_id) +{ + auto const state = file_uploads_.constFind (file_batch_id); + if (state == file_uploads_.constEnd () || state->failed.isEmpty ()) + { + return; + } + + if (state->accepted.size () + state->failed.size () >= state->total) + { + file_uploads_.remove (file_batch_id); + } +} + +void WSPRNet::maybeRemoveCompletedFile (int file_batch_id) +{ + if (!file_uploads_.contains (file_batch_id)) + { + return; + } + + auto const state = file_uploads_.value (file_batch_id); + if (state.total > 0 && state.accepted.size () == state.total) + { + QFile f {state.snapshot.path}; + // wsprd can rewrite this scratch file between the check and remove. + // The snapshot guard prevents deleting known-new contents. + if (f.exists () && fileMatchesSnapshot (state.snapshot)) + { + f.remove (); + } + file_uploads_.remove (file_batch_id); + } +} + +void WSPRNet::maybeFinalize () +{ + if (!upload_session_active_) + { + return; + } + if (pending_primary_uploads_.isEmpty () && pending_alternate_uploads_.isEmpty () + && outstanding_requests_.isEmpty ()) + { + uploads_started_ = 0; + upload_session_active_ = false; + upload_timer_.stop (); + Q_EMIT uploadStatus ("done"); } } @@ -214,6 +663,10 @@ bool WSPRNet::decodeLine (QString const& line, SpotQueue::value_type& query) con { auto const& rx_match = wspr_re.match (line); if (rx_match.hasMatch ()) { + if (line.contains ("<...>")) { + return false; + } + int msgType = 0; QString msg = rx_match.captured (7); QString call, grid, dbm; @@ -299,7 +752,7 @@ auto WSPRNet::urlEncodeNoSpot () const -> SpotQueue::value_type query.addQueryItem ("dbm", m_dbm); query.addQueryItem ("version", m_vers); query.addQueryItem ("mode", encode_mode ()); - return query;; + return query; } auto WSPRNet::urlEncodeSpot (SpotQueue::value_type& query) const -> SpotQueue::value_type @@ -314,31 +767,43 @@ auto WSPRNet::urlEncodeSpot (SpotQueue::value_type& query) const -> SpotQueue::v void WSPRNet::work() { - if (spots_to_send_ && spot_queue_.size ()) - { -#if QT_VERSION < QT_VERSION_CHECK (5, 15, 0) - if (QNetworkAccessManager::Accessible != network_manager_->networkAccessible ()) { - // try and recover network access for QNAM - network_manager_->setNetworkAccessible (QNetworkAccessManager::Accessible); - } -#endif - QNetworkRequest request (QUrl {wsprNetUrl}); - request.setHeader (QNetworkRequest::ContentTypeHeader, "application/x-www-form-urlencoded"); - auto const& spot = spot_queue_.dequeue (); - QNetworkReply *reply = network_manager_->post (request, spot.query(QUrl::FullyEncoded).toUtf8()); - connect (reply, &QNetworkReply::finished, this, [this, reply]() { networkReply(reply); }); - m_outstandingRequests << reply; - Q_EMIT uploadStatus(QString {"Uploading Spot %1/%2"}.arg (spots_to_send_ - spot_queue_.size()).arg (spots_to_send_)); - } - else + auto const now = QDateTime::currentDateTimeUtc (); + pruneExpiredUploads (now); + + auto send_ready_upload = [this, &now](QQueue& uploads, UploadTarget target) { - upload_timer_.stop (); - } + if (hasOutstanding (target)) + { + return; + } + for (int i = 0; i < uploads.size (); ++i) + { + if (uploads[i].next_attempt_at <= now) + { + sendUpload (uploads.takeAt (i)); + return; + } + } + }; + + send_ready_upload (pending_primary_uploads_, UploadTarget::Primary); + send_ready_upload (pending_alternate_uploads_, UploadTarget::Alternate); + + scheduleWork (); + maybeFinalize (); } void WSPRNet::abortOutstandingRequests () { - spot_queue_.clear (); - for (auto& request : m_outstandingRequests) { + upload_timer_.stop (); + pending_primary_uploads_.clear (); + pending_alternate_uploads_.clear (); + file_uploads_.clear (); + uploads_started_ = 0; + upload_session_active_ = false; + + auto const requests = outstanding_requests_.keys (); + outstanding_requests_.clear (); + for (auto& request : requests) { request->abort (); } } diff --git a/Network/wsprnet.h b/Network/wsprnet.h index 345f43fd..f7791720 100644 --- a/Network/wsprnet.h +++ b/Network/wsprnet.h @@ -4,12 +4,16 @@ #include #include #include -#include +#include #include #include +#include +#include +#include +#include -class QNetworkAccessManager; class QNetworkReply; +class QNetworkRequest; class WSPRNet : public QObject { @@ -18,13 +22,65 @@ class WSPRNet : public QObject using SpotQueue = QQueue; public: + // HTTP post seam so tests can upload without constructing QNetworkAccessManager. + class Transport + { + public: + virtual ~Transport () = default; + virtual QNetworkReply *post (QNetworkRequest const& request, QByteArray const& body) = 0; + }; + + struct RetryPolicy + { + int max_attempts = 7; + int max_pending = 1024; + int ttl_ms = 60 * 60 * 1000; + double jitter_fraction = 0.25; + QVector retry_delays_ms {15000, 60000, 120000, 300000, 600000, 1200000}; + }; + + struct StationContext + { + StationContext () = default; + StationContext (QString const& call, QString const& grid, QString const& rfreq, QString const& tfreq, + QString const& mode, float TR_period, QString const& tpct, QString const& dbm, + QString const& version) + : call {call} + , grid {grid} + , rfreq {rfreq} + , tfreq {tfreq} + , mode {mode} + , TR_period {TR_period} + , tpct {tpct} + , dbm {dbm} + , version {version} + { + } + + QString call; + QString grid; + QString rfreq; + QString tfreq; + QString mode; + float TR_period = 0.F; + QString tpct; + QString dbm; + QString version; + }; + explicit WSPRNet (QObject *parent = nullptr); + WSPRNet (Transport *transport, RetryPolicy retry_policy, + bool take_transport_ownership, QObject *parent = nullptr); + ~WSPRNet (); void upload (QString const& call, QString const& grid, QString const& rfreq, QString const& tfreq, - QString const& mode, float TR_peirod, QString const& tpct, QString const& dbm, + QString const& mode, float TR_period, QString const& tpct, QString const& dbm, QString const& version, QString const& fileName); void post (QString const& call, QString const& grid, QString const& rfreq, QString const& tfreq, QString const& mode, float TR_period, QString const& tpct, QString const& dbm, QString const& version, QString const& decode_text = QString {}); + void queueWsprFile (StationContext const& context, QString const& file_name); + void queueFst4wDecode (StationContext const& context, QString const& decode_text); + void flush (StationContext const& context); signals: void uploadStatus (QString); @@ -34,27 +90,88 @@ public slots: void abortOutstandingRequests (); private: + enum class UploadSource {Direct, File}; + enum class PayloadKind {Spot, Status}; + enum class UploadTarget {Primary, Alternate}; + + struct PendingUpload + { + QUrlQuery query; + UploadSource source; + PayloadKind kind; + QString source_file; + int file_batch_id; + QDateTime queued_at; + QDateTime expires_at; + QDateTime next_attempt_at; + int attempts; + UploadTarget target; + int logical_upload_id; + }; + + struct FileSnapshot + { + QString path; + qint64 size = -1; + QByteArray hash; + }; + + struct FileUploadState + { + FileSnapshot snapshot; + int total = 0; + QSet accepted; + QSet failed; + }; + + void applyContext (StationContext const& context); + FileSnapshot snapshotFile (QString const& file_name) const; + bool fileMatchesSnapshot (FileSnapshot const& snapshot) const; + bool hasPendingFileLeg (int file_batch_id, int logical_upload_id) const; + bool hasOutstanding (UploadTarget target) const; bool decodeLine (QString const& line, SpotQueue::value_type& query) const; SpotQueue::value_type urlEncodeNoSpot () const; SpotQueue::value_type urlEncodeSpot (SpotQueue::value_type& spot) const; QString encode_mode () const; + void enqueueUpload (QUrlQuery const& query, UploadSource source, PayloadKind kind, QString const& source_file = QString {}, int file_batch_id = 0); + int beginFileBatch (FileSnapshot const& snapshot); + void startUploadSession (); + void scheduleWork (); + void pruneExpiredUploads (QDateTime const& now); + void enforcePendingLimit (); + void sendUpload (PendingUpload upload); + bool replyAccepted (PendingUpload const& upload, QNetworkReply *reply, QString& server_response) const; + bool canRetry (PendingUpload const& upload, QDateTime const& now, int retry_delay_ms) const; + int retryDelayMs (PendingUpload const& upload) const; + int uploadsToSend () const; + void retryUpload (PendingUpload upload, QDateTime const& now, int retry_delay_ms); + void markAccepted (PendingUpload const& upload); + void markFailed (PendingUpload const& upload); + void maybeRemoveFailedFileBatch (int file_batch_id); + void maybeRemoveCompletedFile (int file_batch_id); + void maybeFinalize (); - QNetworkAccessManager * network_manager_; - QList m_outstandingRequests; + Transport * transport_; + bool owns_transport_; + RetryPolicy retry_policy_; + QHash outstanding_requests_; + QHash file_uploads_; QString m_call; - QString m_grid;; + QString m_grid; QString m_rfreq; QString m_tfreq; QString m_mode; QString m_tpct; QString m_dbm; QString m_vers; - QString m_file; float TR_period_; - int spots_to_send_; - SpotQueue spot_queue_; + int uploads_started_; + int next_file_batch_id_; + int next_logical_upload_id_; + QQueue pending_primary_uploads_; + QQueue pending_alternate_uploads_; QTimer upload_timer_; - int m_uploadType; + bool upload_session_active_; }; #endif // WSPRNET_H diff --git a/NonInheritingProcess.cpp b/NonInheritingProcess.cpp index 7f5644d5..5501f5a2 100644 --- a/NonInheritingProcess.cpp +++ b/NonInheritingProcess.cpp @@ -43,6 +43,44 @@ class NonInheritingProcess::impl { public: #ifdef Q_OS_WIN + impl () + : job_ {nullptr} + { + job_ = ::CreateJobObjectW (nullptr, nullptr); + if (job_) + { + JOBOBJECT_EXTENDED_LIMIT_INFORMATION limits {}; + limits.BasicLimitInformation.LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE; + if (!::SetInformationJobObject (job_, JobObjectExtendedLimitInformation, + &limits, sizeof limits)) + { + ::CloseHandle (job_); + job_ = nullptr; + } + } + } + + ~impl () + { + if (job_) + { + ::CloseHandle (job_); + } + } + + void assign_to_job (qint64 process_id) + { + if (!job_ || process_id <= 0) return; + + HANDLE process = ::OpenProcess (PROCESS_SET_QUOTA | PROCESS_TERMINATE, + FALSE, static_cast (process_id)); + if (process) + { + ::AssignProcessToJobObject (job_, process); + ::CloseHandle (process); + } + } + void extend_CreateProcessArguments (QProcess::CreateProcessArguments * args) { // @@ -95,6 +133,7 @@ public: using start_info_type = std::unique_ptr; start_info_type start_info_; + HANDLE job_; #endif }; @@ -105,7 +144,10 @@ NonInheritingProcess::NonInheritingProcess (QObject * parent) using namespace std::placeholders; // enable cleanup after process starts or fails to start - connect (this, &QProcess::started, [this] {m_->start_info_.reset ();}); + connect (this, &QProcess::started, [this] { + m_->start_info_.reset (); + m_->assign_to_job (processId ()); + }); connect (this, &QProcess::errorOccurred, [this] (QProcess::ProcessError) {m_->start_info_.reset ();}); setCreateProcessArgumentsModifier (std::bind (&NonInheritingProcess::impl::extend_CreateProcessArguments, &*m_, _1)); #endif diff --git a/OperatingFrequency.cpp b/OperatingFrequency.cpp new file mode 100644 index 00000000..529b3f7c --- /dev/null +++ b/OperatingFrequency.cpp @@ -0,0 +1,73 @@ +#include "OperatingFrequency.hpp" + +bool OperatingFrequency::requestNominal (Frequency value, Delta correction, + Request const& request) +{ + if (!value || !request (value + correction)) return false; + rx_ = tx_ = value; + return true; +} + +OperatingFrequency::Transition OperatingFrequency::enableMonitor ( + Context const& context, Request const& request) +{ + Transition result {snapshot (), snapshot (), std::nullopt}; + if (!context.monitorAllowed) return result; + result.monitor = true; + result.restorationAccepted = !context.monitoring && context.restore && !context.echo + && requestNominal (remembered_, context.rxCorrection, request); + result.after = snapshot (); + return result; +} + +OperatingFrequency::Transition OperatingFrequency::reconcile ( + Observation const& previous, Observation const& current, + Context const& context, Request const& request) +{ + Transition result {snapshot (), snapshot (), std::nullopt}; + auto const target = remembered_; + bool const startup = !previous.online && current.online && context.monitorAllowed; + bool const monitoring = startup ? context.monitorAtStartup && !context.echo : context.monitoring; + bool const restoring = startup && monitoring && !context.monitoring + && context.restore && !context.echo; + + if (current.online && current.rx) + { + if (!rx_ && current.transmitting) rx_ = current.rx; + if (!rx_ || current.rx != previous.rx || current.split != previous.split + || current.transmitting != previous.transmitting + || (current.transmitting && current.tx != previous.tx)) + { + observe (current, monitoring && !(startup && context.restore && !context.echo), + context.rxCorrection, context.txCorrection); + } + } + if (startup) + { + result.monitor = monitoring; + if (restoring) + { + // The observation that initiates restoration cannot replace its target. + remembered_ = target; + result.restorationAccepted = enableMonitor (context, request).restorationAccepted; + } + } + result.after = snapshot (); + return result; +} + +void OperatingFrequency::observe (Observation const& report, bool monitoring, + Delta rxCorrection, Delta txCorrection) +{ + if (!report.transmitting) + { + auto const previousNominal = rx_; + rx_ = report.rx - rxCorrection; + if (previousNominal != rx_) tx_ = rx_; + if (monitoring) remembered_ = rx_; + } + else + { + tx_ = report.split ? report.tx - txCorrection : report.rx; + } +} diff --git a/OperatingFrequency.hpp b/OperatingFrequency.hpp new file mode 100644 index 00000000..f511dc6d --- /dev/null +++ b/OperatingFrequency.hpp @@ -0,0 +1,65 @@ +#ifndef OPERATING_FREQUENCY_HPP +#define OPERATING_FREQUENCY_HPP + +#include +#include +#include "Radio.hpp" + +class OperatingFrequency +{ +public: + using Frequency = Radio::Frequency; + using Delta = Radio::FrequencyDelta; + // Acceptance permits a local commit; hardware confirmation arrives separately. + using Request = std::function; + struct Snapshot { Frequency rx; Frequency tx; Frequency remembered; }; + // Configuration supplies RF frequencies with Doppler correction still applied. + struct Observation + { + bool online; + bool transmitting; + bool split; + Frequency rx; + Frequency tx; + }; + struct Context + { + bool monitoring; + bool monitorAllowed; + bool monitorAtStartup; + bool restore; + bool echo; + Delta rxCorrection; + Delta txCorrection; + }; + struct Transition + { + Snapshot before; + Snapshot after; + std::optional monitor; + bool restorationAccepted = false; + }; + + explicit OperatingFrequency (Frequency remembered = 0) : remembered_ {remembered} {} + Frequency const& rx () const { return rx_; } + Frequency tx () const { return tx_; } + Frequency remembered () const { return remembered_; } + Snapshot snapshot () const { return {rx_, tx_, remembered_}; } + void loadRemembered (Frequency value) { remembered_ = value; } + bool requestNominal (Frequency, Delta, Request const&); + Transition enableMonitor (Context const&, Request const&); + Transition reconcile (Observation const& previous, Observation const& current, + Context const&, Request const&); + void commitAcceptedTx (Frequency value) { tx_ = value; } + Frequency correctedRx (Delta delta) const { return rx_ + delta; } + Frequency correctedTx (Delta delta) const { return tx_ + delta; } + +private: + void observe (Observation const&, bool monitoring, Delta rxCorrection, + Delta txCorrection); + Frequency rx_ = 0; + Frequency tx_ = 0; + Frequency remembered_; +}; + +#endif diff --git a/PerformanceTrace.cpp b/PerformanceTrace.cpp new file mode 100644 index 00000000..0c4c8059 --- /dev/null +++ b/PerformanceTrace.cpp @@ -0,0 +1,197 @@ +#include "PerformanceTrace.hpp" + +#include +#include +#include +#include +#include + +#include "Logger.hpp" + +namespace +{ + enum class Event {milestone, phase, run_end}; + + struct Run + { + QString category; + QString kind; + qint64 started_ms {0}; + bool finished {false}; + }; + + struct State + { + QMutex mutex; + QElapsedTimer process_timer; + QHash runs; + PerformanceTrace::RunId current_run {0}; + PerformanceTrace::RunId next_run {1}; + }; + + State& state () + { + static State value; + return value; + } + + void ensure_started (State& value) + { + if (!value.process_timer.isValid ()) + { + value.process_timer.start (); + } + } + + void ensure_current_run (State& value) + { + ensure_started (value); + if (!value.current_run) + { + value.current_run = value.next_run++; + value.runs.insert (value.current_run, {"performance", "implicit", 0}); + } + } + + void record (PerformanceTrace::RunId run, Event event, QString const& phase, + qint64 duration_ms, QString const& details) + { + QString category; + QString kind; + qint64 elapsed {0}; + qint64 run_elapsed {0}; + { + auto& value = state (); + QMutexLocker lock {&value.mutex}; + ensure_current_run (value); + elapsed = value.process_timer.elapsed (); + auto const run_info = value.runs.value (run, value.runs.value (value.current_run)); + category = run_info.category; + kind = run_info.kind; + run_elapsed = elapsed - run_info.started_ms; + } + + char const * event_name = "milestone"; + if (Event::phase == event) + { + event_name = "phase"; + } + else if (Event::run_end == event) + { + event_name = "run_end"; + } + QString message = QString {"PERF %1 pid=%2 run=%3 kind=%4 event=%5 phase=%6 elapsed_ms=%7"} + .arg (category).arg (QCoreApplication::applicationPid ()).arg (run) + .arg (kind, QString::fromLatin1 (event_name), phase).arg (run_elapsed); + if (duration_ms >= 0) + { + message += QString {" duration_ms=%1"}.arg (duration_ms); + } + if (!details.isEmpty ()) + { + message += ' ' + details; + } + LOG_INFO (message.toStdString ()); + } +} + +namespace PerformanceTrace +{ + RunId begin_run (char const * category, char const * kind) + { + RunId run; + { + auto& value = state (); + QMutexLocker lock {&value.mutex}; + ensure_started (value); + run = value.next_run++; + value.current_run = run; + value.runs.insert (run, {QString::fromLatin1 (category), QString::fromLatin1 (kind), + value.process_timer.elapsed ()}); + } + return run; + } + + RunId current_run () + { + auto& value = state (); + QMutexLocker lock {&value.mutex}; + ensure_current_run (value); + return value.current_run; + } + + void finish_run (RunId run, char const * phase, QString const& details) + { + bool finished {false}; + { + auto& value = state (); + QMutexLocker lock {&value.mutex}; + ensure_current_run (value); + auto run_info = value.runs.find (run); + if (run_info != value.runs.end () && !run_info->finished) + { + run_info->finished = true; + finished = true; + } + } + if (finished) + { + record (run, Event::run_end, QString::fromLatin1 (phase), -1, details); + } + } + + qint64 elapsed_ms () + { + auto& value = state (); + QMutexLocker lock {&value.mutex}; + ensure_started (value); + return value.process_timer.elapsed (); + } + + void milestone (char const * phase, QString const& details) + { + milestone (current_run (), phase, details); + } + + void milestone (RunId run, char const * phase, QString const& details) + { + record (run, Event::milestone, QString::fromLatin1 (phase), -1, details); + } + + Phase::Phase (char const * phase) + : Phase {current_run (), phase} + { + } + + Phase::Phase (RunId run, char const * phase) + : run_ {run} + , phase_ {QString::fromLatin1 (phase)} + , started_ms_ {elapsed_ms ()} + { + } + + Phase::~Phase () noexcept + { + if (!finished_) + { + try + { + finish (); + } + catch (...) + { + // Instrumentation must not terminate an already-unwinding path. + } + } + } + + void Phase::finish (QString const& details) + { + if (!finished_) + { + finished_ = true; + auto const finished_ms = elapsed_ms (); + record (run_, Event::phase, phase_, finished_ms - started_ms_, details); + } + } +} diff --git a/PerformanceTrace.hpp b/PerformanceTrace.hpp new file mode 100644 index 00000000..81ff56a2 --- /dev/null +++ b/PerformanceTrace.hpp @@ -0,0 +1,54 @@ +#ifndef PERFORMANCE_TRACE_HPP_ +#define PERFORMANCE_TRACE_HPP_ + +#include +#include + +namespace PerformanceTrace +{ + using RunId = quint64; + + // Measurements use one process-wide monotonic clock and are logged at INFO + // severity. The functions are thread-safe, but an individual Phase object + // must remain on one thread. Runs are retained until process exit so delayed + // asynchronous milestones can still be attributed to their originating run. + // Enable WSJT-X Diagnostic logging to capture the emitted "PERF" records. + + // A run groups related measurements on a shared monotonic timeline. The + // category and kind are emitted verbatim, so keep them stable and free of + // whitespace for log analysis. Records identify milestones, timed phases, + // and run ends explicitly through the event field. + RunId begin_run (char const * category, char const * kind); + RunId current_run (); + void finish_run (RunId run, char const * phase, QString const& details = {}); + qint64 elapsed_ms (); + + // Pass an explicit run from asynchronous work. current_run() may refer to a + // newer operation by the time a worker thread or queued callback completes. + // A finished run still accepts such explicitly attributed measurements. + void milestone (char const * phase, QString const& details = {}); + void milestone (RunId run, char const * phase, QString const& details = {}); + + // Phase records its duration when destroyed. Call finish() when details must + // accompany the measurement; subsequent calls and destruction are no-ops. + class Phase final + { + public: + explicit Phase (char const * phase); + Phase (RunId run, char const * phase); + ~Phase () noexcept; + + Phase (Phase const&) = delete; + Phase& operator= (Phase const&) = delete; + + void finish (QString const& details = {}); + + private: + RunId run_; + QString phase_; + qint64 started_ms_; + bool finished_ {false}; + }; +} + +#endif diff --git a/PrefixSuffix.cpp b/PrefixSuffix.cpp new file mode 100644 index 00000000..a60ca864 --- /dev/null +++ b/PrefixSuffix.cpp @@ -0,0 +1,65 @@ +#include "PrefixSuffix.hpp" + +namespace Radio +{ + QSet PrefixSuffix::type1Prefixes() + { + return { + "1A", "1S", + "3A", "3B6", "3B8", "3B9", "3C", "3C0", "3D2", "3D2C", + "3D2R", "3DA", "3V", "3W", "3X", "3Y", "3YB", "3YP", + "4J", "4L", "4S", "4U1I", "4U1U", "4W", "4X", + "5A", "5B", "5H", "5N", "5R", "5T", "5U", "5V", "5W", "5X", "5Z", + "6W", "6Y", + "7O", "7P", "7Q", "7X", + "8P", "8Q", "8R", + "9A", "9G", "9H", "9J", "9K", "9L", "9M2", "9M6", "9N", + "9Q", "9U", "9V", "9X", "9Y", + "A2", "A3", "A4", "A5", "A6", "A7", "A9", "AP", + "BS7", "BV", "BV9", "BY", + "C2", "C3", "C5", "C6", "C9", "CE", "CE0X", "CE0Y", + "CE0Z", "CE9", "CM", "CN", "CP", "CT", "CT3", "CU", + "CX", "CY0", "CY9", + "D2", "D4", "D6", "DL", "DU", + "E3", "E4", "E5", "EA", "EA6", "EA8", "EA9", "EI", "EK", + "EL", "EP", "ER", "ES", "ET", "EU", "EX", "EY", "EZ", + "F", "FG", "FH", "FJ", "FK", "FKC", "FM", "FO", "FOA", + "FOC", "FOM", "FP", "FR", "FRG", "FRJ", "FRT", "FT5W", + "FT5X", "FT5Z", "FW", "FY", + "M", "MD", "MI", "MJ", "MM", "MU", "MW", + "H4", "H40", "HA", "HB", "HB0", "HC", "HC8", "HH", + "HI", "HK", "HK0", "HK0M", "HL", "HM", "HP", "HR", + "HS", "HV", "HZ", + "I", "IS", "IS0", + "J2", "J3", "J5", "J6", "J7", "J8", "JA", "JDM", + "JDO", "JT", "JW", "JX", "JY", + "K", "KC4", "KG4", "KH0", "KH1", "KH2", "KH3", "KH4", "KH5", + "KH5K", "KH6", "KH7", "KH8", "KH9", "KL", "KP1", "KP2", + "KP4", "KP5", + "LA", "LU", "LX", "LY", "LZ", + "OA", "OD", "OE", "OH", "OH0", "OJ0", "OK", "OM", "ON", + "OX", "OY", "OZ", + "P2", "P4", "PA", "PJ2", "PJ7", "PY", "PY0F", "PT0S", "PY0T", "PZ", + "R1F", "R1M", + "S0", "S2", "S5", "S7", "S9", "SM", "SP", "ST", "SU", + "SV", "SVA", "SV5", "SV9", + "T2", "T30", "T31", "T32", "T33", "T5", "T7", "T8", "T9", "TA", + "TF", "TG", "TI", "TI9", "TJ", "TK", "TL", "TN", "TR", "TT", + "TU", "TY", "TZ", + "UA", "UA2", "UA9", "UK", "UN", "UR", + "V2", "V3", "V4", "V5", "V6", "V7", "V8", "VE", "VK", "VK0H", + "VK0M", "VK9C", "VK9L", "VK9M", "VK9N", "VK9W", "VK9X", "VP2E", + "VP2M", "VP2V", "VP5", "VP6", "VP6D", "VP8", "VP8G", "VP8H", + "VP8O", "VP8S", "VP9", "VQ9", "VR", "VU", "VU4", "VU7", + "XE", "XF4", "XT", "XU", "XW", "XX9", "XZ", + "YA", "YB", "YI", "YJ", "YK", "YL", "YN", "YO", "YS", "YU", "YV", "YV0", + "Z2", "Z3", "ZA", "ZB", "ZC4", "ZD7", "ZD8", "ZD9", "ZF", "ZK1N", + "ZK1S", "ZK2", "ZK3", "ZL", "ZL7", "ZL8", "ZL9", "ZP", "ZS", "ZS8" + }; + } + + QSet PrefixSuffix::type1Suffixes() + { + return {"P", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A"}; + } +} diff --git a/PrefixSuffix.hpp b/PrefixSuffix.hpp new file mode 100644 index 00000000..81ecbb47 --- /dev/null +++ b/PrefixSuffix.hpp @@ -0,0 +1,17 @@ +#ifndef PREFIXSUFFIX_HPP +#define PREFIXSUFFIX_HPP + +#include +#include + +namespace Radio +{ + class PrefixSuffix + { + public: + static QSet type1Prefixes(); + static QSet type1Suffixes(); + }; +} + +#endif // PREFIXSUFFIX_HPP diff --git a/QsoProgress.hpp b/QsoProgress.hpp new file mode 100644 index 00000000..7cd88b6e --- /dev/null +++ b/QsoProgress.hpp @@ -0,0 +1,16 @@ +#ifndef QSOPROGRESS_HPP +#define QSOPROGRESS_HPP + +// Values 0..5 cross the C++/Fortran boundary through nQSOProgress and index +// decoder AP tables. Their numeric values are part of the decoder contract. +enum class QsoProgress : int +{ + Calling = 0, + Replying = 1, + Report = 2, + RogerReport = 3, + Rogers = 4, + Signoff = 5 +}; + +#endif // QSOPROGRESS_HPP diff --git a/README b/README deleted file mode 100644 index 5797cd20..00000000 --- a/README +++ /dev/null @@ -1,107 +0,0 @@ - - __ __ ______ _____ ________ __ __ -| \ _ | \ / \ | \| \ | \ | \ -| $$ / \ | $$| $$$$$$\ \$$$$$ \$$$$$$$$ | $$ | $$ -| $$/ $\| $$| $$___\$$ | $$ | $$ ______ \$$\/ $$ -| $$ $$$\ $$ \$$ \ __ | $$ | $$| \ >$$ $$ -| $$ $$\$$\$$ _\$$$$$$\| \ | $$ | $$ \$$$$$$/ $$$$\ -| $$$$ \$$$$| \__| $$| $$__| $$ | $$ | $$ \$$\ -| $$$ \$$$ \$$ $$ \$$ $$ | $$ | $$ | $$ - \$$ \$$ \$$$$$$ \$$$$$$ \$$ \$$ \$$ - - - -Copyright (C) 2001 - 2023 by Joe Taylor, K1JT. - -WSJT-X Version 2.6.1 offers eleven different protocols or modes: FT4, -FT8, JT4, JT9, JT65, Q65, FST4, MSK144, WSPR, FST4W, and Echo. The -first seven are designed for making reliable QSOs under weak-signal -conditions. They use nearly identical message structure and source -encoding. JT65 and Q65 were designed for EME (“moonbounce”), but not -limited to just that propagation path, on the VHF/UHF bands and JT65 -has also proven very effective for worldwide QRP communication on the -HF bands. Q65 has a number of advantages over JT65, including better -performance on the very weakest signals and variants with different -T/R period lengths. We imagine that over time it may replace JT65 for -EME use, it has also proved to be very effective for iono-scatter -paths on 6m. JT9 was originally designed for the LF, MF, and lower HF -bands. Its submode JT9A is 2 dB more sensitive than JT65 while using -less than 10% of the bandwidth. JT4 offers a wide variety of tone -spacings and has proven highly effective for EME on microwave bands up -to 24 GHz. These four “slow” modes use one-minute timed sequences of -alternating transmission and reception, so a minimal QSO takes four to -six minutes — two or three transmissions by each station, one sending -in odd UTC minutes and the other even. FT8 is operationally similar -but four times faster (15-second T/R sequences) and less sensitive by -a few dB. FT4 is faster still (7.5 s T/R sequences) and especially -well suited for radio contesting. On the HF bands, world-wide QSOs are -possible with any of these modes using power levels of a few watts (or -even milliwatts) and compromise antennas. QSOs are possible at signal -levels 10 to 15 dB below those required for CW. FST4 has similarities -in use to JT9 but offers more flexibility as it offers different -period lengths allowing QSO completion time to be traded off against -sensitivity. In its base form of FST4-60A it has better sensitivity -than JT9A and should be considered as an upgrade where JT9 has been -the preferred slow QSO mode. - -Note that even though their T/R sequences are short, FT4 and FT8 are -classified as slow modes because their message frames are sent only -once per transmission. All fast modes in WSJT-X send their message -frames repeatedly, as many times as will fit into the Tx sequence -length. - -MSK144, and optionally submodes JT9E-H are “fast” protocols designed -to take advantage of brief signal enhancements from ionized meteor -trails, aircraft scatter, and other types of scatter -propagation. These modes use timed sequences of 5, 10, 15, or 30 s -duration. User messages are transmitted repeatedly at high rate (up to -250 characters per second, for MSK144) to make good use of the -shortest meteor-trail reflections or “pings”. MSK144 uses the same -structured messages as the slow modes and optionally an abbreviated -format with hashed callsigns. - -WSPR (pronounced “whisper”) stands for Weak Signal Propagation -Reporter. The WSPR protocol was designed for probing potential -propagation paths using low-power transmissions. WSPR messages -normally carry the transmitting station’s callsign, grid locator, and -transmitter power in dBm, and they can be decoded at signal-to-noise -ratios as low as -31 dB in a 2500 Hz bandwidth. WSPR users with -internet access can automatically upload reception reports to a -central database called WSPRnet that provides a mapping facility, -archival storage, and many other features. - -FST4W, like WSPR, is a quasi-beacon mode, it targets LF and MF bands -and offers a number of T/R periods form 2 minutes up to 30 minutes for -the most challenging weak signal paths. Similarly to WSPR reception -reports can be automatically uploaded to the WSPRnet.org web service. - -Echo mode allows you to detect and measure your own station’s echoes -from the moon, even if they are far below the audible threshold. - -WSJT-X provides spectral displays for receiver passbands as wide as 5 -kHz, flexible rig control for nearly all modern radios used by -amateurs, and a wide variety of special aids such as automatic Doppler -tracking for EME QSOs and Echo testing. The program runs equally well -on Windows, Macintosh, and Linux systems, and installation packages -are available for all three platforms. - -WSJT-X is an open-source project released under the GPLv3 license (See -COPYING). If you have programming or documentation skills or would -like to contribute to the project in other ways, please make your -interests known to the development team. The project’s source-code -repositories can be found at -https://sourceforge.net/p/wsjt/wsjtx/ci/master/tree/, and -communication among the developers takes place on the email reflector -https://sourceforge.net/p/wsjt/mailman. User-level questions and -answers, and general communication among users is found on the -https://wsjtx.groups.io/g/main email reflector. - - -Project web site: - -https://wsjt.sourceforge.io/wsjtx.html - -Project mailing list (shared with other applications from the same -team): - -https://sourceforge.net/projects/wsjt/lists/wsjt-devel diff --git a/README.md b/README.md index 5fe1f554..1bc152f0 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,57 @@ +![WSJT-X](wsjtx_icon.webp) + # Weak Signal Communication Software ## Programs -*WSJT-X*, *MAP65*, and *QMAP* are open-source, multi-platform programs designed for weak-signal digital communication by amateur radio. *WSJT-X* works with a standard SSB transceiver, while *MAP65* and *QMAP* use wideband SDR-style hardware. The programs are open source, free of charge, and licensed under the GNU General Public License. -*WSJT-X* implements communication protocols or "modes" called **FST4**, **FST4W**, **FT4**, **FT8**, **JT4**, **JT9**, **JT65**, **MSK144**, **Q65**, **WSPR**, and **Echo**. The first nine modes were designed for making reliable, confirmed QSOs in a wide variety of weak-signal propagation circumstances. These modes use timed Transmit/Receive sequences of specific lengths, synchronized with UTC. **WSPR** mode is for probing potential propagation paths with low-power transmissions, and **Echo** mode is for detecting and measuring reflections of your own signals from the Moon. +*WSJT-X*, *MAP65*, and *QMAP* are open-source, multi-platform programs designed for weak-signal digital communication by amateur radio. *WSJT-X* works with a standard SSB transceiver, while *MAP65* and *QMAP* use wideband SDR-style hardware. The programs are open source, free of charge, and licensed under the GNU General Public License. These program names are trademarks of the WSJT Development Team; see [TRADEMARK.md](TRADEMARK.md) for our policy on their use. + +They can be built and used on Windows, macOS, and Linux. + +*WSJT-X* implements communication protocols or "modes" called **FST4**, **FST4W**, **FT4**, **FT8**, **JT4**, **JT9**, **JT65**, **JTTY**, **MSK144**, **Q65**, **WSPR**, and **Echo**. Its two-way modes are designed for making reliable, confirmed QSOs in a wide variety of weak-signal propagation circumstances. Most use timed Transmit/Receive sequences of specific lengths, synchronized with UTC. **JTTY** supports fast RTTY-like contest exchanges and other keyboard-to-keyboard communication. **WSPR** and **FST4W** are for probing potential propagation paths with low-power transmissions, and **Echo** is for detecting and measuring reflections of your own signals from the Moon. *MAP65* implements a wideband receiver for **JT65** and **Q65** signals, optimized for EME on the VHF/UHF bands. It can be used together with *Linrad* (by SM5BSZ) or with direct input from a soundcard, FUNcube Dongle, or similar hardware. The program decodes all **JT65** or **Q65** signals in a passband up to 90 kHz wide, producing a sorted band map of decoded callsigns. In a dual-polarization system, *MAP65* optimally matches the linear polarization angle of each signal, thereby eliminating problems with Faraday rotation and spatial polarization offsets. *MAP65* also handles T/R switching and generates suitable messages and audio waveforms for the selected mode. *QMAP* is similar to *MAP65* in providing wideband reception of signals over a full EME sub-band. It works cooperatively with *WSJT-X*, supporting the **Q65** mode in both 30-second and 60-second submodes. The *QMAP* + *WSJT-X* combination provides full rig control and Doppler compensation for the EME (Earth-Moon-Earth) path. - ## Mode Details -**JT4**, **JT9**, and **JT65** use nearly identical message structure, efficient compression of messages for minimal QSOs, and 60-second T/R sequences. **JT4** and **JT65** were designed for EME on the VHF, UHF, and microwave bands, while **JT9** is optimized for the MF and HF bands. **JT9** is about 2 dB more sensitive than **JT65** while using less than 10% of the bandwidth. + +**JT4**, **JT9**, and **JT65** use nearly identical message structure, efficient compression of messages for minimal QSOs, and 60-second T/R sequences. **JT4** and **JT65** were designed for EME on the VHF, UHF, and microwave bands, while **JT9** is optimized for the MF and HF bands. **JT9** is about 1 dB more sensitive than **JT65** while using less than 10% of the bandwidth. **FT4** and **FT8** use T/R cycles of only 7.5 and 15 s, respectively. They have become extremely popular for world-wide DXing on the HF bands. **MSK144** is designed for Meteor Scatter on the VHF bands. **Q65** offers submodes with T/R sequence lengths from 15 seconds to 5 minutes, and a wide range of tone spacings. Particular Q65 submodes are highly recommended for EME, ionospheric scatter, and other weak signal work on VHF, UHF, and microwave bands. These modes include message formats explicitly supporting nonstandard callsigns and some popular radio contests. -**FST4** and **FST4W** are designed particularly for the LF and MF bands. On these bands their fundamental sensitivities are better than other *WSJT-X* modes with the same sequence lengths, approaching the theoretical limits for their rates of information throughput. **FST4** is optimized for two-way QSOs, while **FST4W** is for quasi-beacon transmissions of **WSPR**-style messages. **FST4** and **FST4W** do not require the strict, independent time synchronization and phase locking of modes like EbNaut. \ No newline at end of file +**FST4** and **FST4W** are designed particularly for the LF and MF bands. On these bands their fundamental sensitivities are better than other *WSJT-X* modes with the same sequence lengths, approaching the theoretical limits for their rates of information throughput. **FST4** is optimized for two-way QSOs, while **FST4W** is for quasi-beacon transmissions of **WSPR**-style messages. **FST4** and **FST4W** do not require the strict, independent time synchronization and phase locking of modes like EbNaut. + +The [WSJT-X User Guide](https://wsjtx.github.io/wsjtx/guide-full.html) documents operating procedures, mode details, configuration, and platform installation. + +## Building from source + +The [source-build guide](doc/user_guide/en/install-from-source.adoc) is the +maintained reference for developer builds, including the supported Windows +MSYS2 environment, required dependencies, tests, installation, and common +failures. Contributors should also read [CONTRIBUTING.md](CONTRIBUTING.md) for +the public and private repository workflow. + +## Support and contributing + +The [project website](https://wsjtx.github.io/wsjtx/) provides release downloads +and documentation. The User Guide is the first place to look for operating and +setup help. Questions and general discussion can go to +the [WSJT-X user group](https://wsjtx.groups.io/g/main) or the +[wsjt-devel mailing list](https://sourceforge.net/p/wsjt/mailman/wsjt-devel/). +[GitHub Discussions](https://github.com/WSJTX/wsjtx/discussions) is also +available. + +Source code, bug reports, and pull requests are hosted in the public +[WSJTX/wsjtx repository](https://github.com/WSJTX/wsjtx). See the +[contribution guide](https://github.com/WSJTX/wsjtx/blob/master/CONTRIBUTING.md) +for repository and development guidance. + +## License + +WSJT-X, MAP65, and QMAP are free software licensed under the GNU General Public +License version 3. See [COPYING](COPYING) for the full license. + +## Code Signing Policy + +Windows installers for GA releases are Authenticode-signed. Free code signing is provided by [SignPath.io](https://about.signpath.io/), certificate by [SignPath Foundation](https://signpath.org/). Signed installers are built from the source in this repository by GitHub Actions and signed only through that verified pipeline. diff --git a/Radio.cpp b/Radio.cpp index 5ee29040..f7fcd06d 100644 --- a/Radio.cpp +++ b/Radio.cpp @@ -52,19 +52,14 @@ namespace Radio Frequency frequency (double value, int scale, bool * ok) { value *= std::pow (10., scale); - if (ok) + auto const exclusive_frequency_limit = std::ldexp (1., std::numeric_limits::digits); + auto const valid = std::isfinite (value) && value >= 0. && value < exclusive_frequency_limit; + if (ok) *ok = valid; + if (!valid) { - if (value < 0. || value > static_cast(std::numeric_limits::max ())) - { - value = 0.; - *ok = false; - } - else - { - *ok = true; - } + return 0; } - return std::llround (value); + return static_cast (std::round (value)); } FrequencyDelta frequency_delta (QVariant const& v, int scale, bool * ok, QLocale const& locale) @@ -91,8 +86,8 @@ namespace Radio value *= std::pow (10., scale); if (ok) { - if (value < static_cast(std::numeric_limits::min ()) - || value > static_cast(std::numeric_limits::max ())) + if (value < static_cast(std::numeric_limits::min ()) + || value > static_cast(std::numeric_limits::max ())) { value = 0.; *ok = false; diff --git a/ReceiveAudio.hpp b/ReceiveAudio.hpp new file mode 100644 index 00000000..227c5de6 --- /dev/null +++ b/ReceiveAudio.hpp @@ -0,0 +1,135 @@ +#ifndef RECEIVE_AUDIO_HPP +#define RECEIVE_AUDIO_HPP + +#include "commons.h" +#include "DecDataMutex.hpp" +#include +#include +#include +#include +#include +#include +#include + +struct ReceiveAudioSourceState +{ + quint64 epoch = 0; + int frames = 0; +}; + +struct ReceiveAudioBlock +{ + quint64 epoch; + int start; + int periodFrames; + std::vector samples; + std::shared_ptr source; + int end () const { return start + int (samples.size ()); } + int sourceFrames () const { return source ? source->frames : 0; } +}; +using ReceiveAudio = std::shared_ptr; +Q_DECLARE_METATYPE (ReceiveAudio) + +inline std::atomic& receiveAudioEpochCounter () +{ + static std::atomic counter {0}; + return counter; +} + +// Producer methods are called under dec_data_mutex. Each receive backend owns +// independent staging storage; queued blocks retain source freshness state. +class ReceiveAudioProducer +{ +public: + ReceiveAudioProducer () + : data_ {new dec_data_t {}} + , source_ {std::make_shared ()} + { + } + + dec_data_t& data () { return *data_; } + int frames () const { return source_->frames; } + int capturedEnd () const { return capturedEnd_; } + + void setFrames (int frames) + { + data_->params.kin = frames; + source_->frames = frames; + } + + void reset (double period) + { + source_->epoch = receiveAudioEpochCounter ().fetch_add (1) + 1; + capturedEnd_ = 0; + auto const capacity = sizeof data_->d2 / sizeof data_->d2[0]; + auto const periodFrames = static_cast ( + std::ceil (period * RX_SAMPLE_RATE)); + std::fill_n (data_->d2, std::min (capacity, periodFrames), qint16 {0}); + setFrames (0); + } + + ReceiveAudio capture (int end, double period) + { + static int const registered = qRegisterMetaType ("ReceiveAudio"); + (void) registered; + auto block = std::make_shared (); + block->epoch = source_->epoch; + block->start = capturedEnd_; + block->periodFrames = std::min (NTMAX * RX_SAMPLE_RATE, + int (period * RX_SAMPLE_RATE)); + block->samples.assign (data_->d2 + capturedEnd_, data_->d2 + end); + block->source = source_; + capturedEnd_ = end; + return block; + } + +private: + std::unique_ptr data_; + std::shared_ptr source_; + int capturedEnd_ = 0; +}; + +// GUI-owned assembly. Reject obsolete periods (their timestamps and settings +// need no longer describe current operation), gaps and duplicate delivery. +// DSP may mutate the accepted buffer without affecting producer storage. +class ReceiveAudioConsumer +{ +public: + bool accept (ReceiveAudio const& block, dec_data_t& target) + { + { + QMutexLocker lock {&dec_data_mutex ()}; + if (!block || !block->source || block->epoch != block->source->epoch + || block->epoch <= invalidThrough_) return false; + } + if (block->samples.empty () || block->start < 0 || block->end () > NTMAX * RX_SAMPLE_RATE + || block->periodFrames < 0 || block->periodFrames > NTMAX * RX_SAMPLE_RATE) + return false; + if (block->epoch != epoch_) + { + if (block->epoch < epoch_ || block->start != 0) return false; + auto const clearFrames = std::min (NTMAX * RX_SAMPLE_RATE, + std::max ({periodFrames_, block->periodFrames, target.params.kin})); + std::fill_n (target.d2, clearFrames, short {0}); + periodFrames_ = block->periodFrames; + target.params.kin = 0; + epoch_ = block->epoch; + } + if (block->start != target.params.kin) return false; + std::copy (block->samples.begin (), block->samples.end (), target.d2 + block->start); + target.params.kin = block->end (); + return true; + } + void invalidate () + { + QMutexLocker lock {&dec_data_mutex ()}; + invalidThrough_ = receiveAudioEpochCounter ().load (); + epoch_ = 0; + } + quint64 epoch () const { return epoch_; } +private: + quint64 epoch_ = 0; + quint64 invalidThrough_ = 0; + int periodFrames_ = 0; +}; +#endif diff --git a/ReceiveHandoffTestController.cpp b/ReceiveHandoffTestController.cpp new file mode 100644 index 00000000..d2e68c21 --- /dev/null +++ b/ReceiveHandoffTestController.cpp @@ -0,0 +1,265 @@ +#include "ReceiveHandoffTestController.hpp" + +#include "Audio/FixtureAudioInput.hpp" +#include "commons.h" +#include "widgets/mainwindow.h" + +extern dec_data_t& dec_data; + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "moc_ReceiveHandoffTestController.cpp" + +namespace +{ +constexpr qint64 periodFrames = 15 * 12000; +} + +ReceiveHandoffTestController::ReceiveHandoffTestController ( + MainWindow * window, FixtureAudioInput * fixture, QObject * parent) + : QObject {parent} + , window_ {window} + , fixture_ {fixture} +{ + retry_.setSingleShot (true); + retry_.setInterval (50); + connect (&retry_, &QTimer::timeout, this, &ReceiveHandoffTestController::prepare); + timeout_.setSingleShot (true); + timeout_.setInterval (20000); + connect (&timeout_, &QTimer::timeout, this, [this] { + finish (false, tr ("Timed out waiting for the full receive handoff. ") + diagnostics ()); + }); + + auto const producer = producer_; + connect (fixture_, &FixtureAudioInput::handoffCheckpoint, this, + [producer] (qint64 frames) { + std::lock_guard lock {producer->mutex}; + producer->frames = frames; + producer->finished = true; + producer->changed.notify_all (); + }, Qt::DirectConnection); + connect (fixture_, &AudioInputSource::error, this, + [producer] (QString const& error) { + std::lock_guard lock {producer->mutex}; + producer->error = error; + producer->changed.notify_all (); + }, Qt::DirectConnection); + connect (window_, &MainWindow::liveAudioTestReceiveRange, + this, &ReceiveHandoffTestController::observe); + connect (window_, &MainWindow::ft8DecoderInvocation, this, + [this] (bool, int, int, int, bool, int, int halfSymbols, int, int, int) { + if (halfSymbols == 49) ++final_submissions_; + }); + connect (window_, &MainWindow::decodeCycleStarted, this, + [this] (quint64 generation) { decoder_generation_ = generation; }); +} + +void ReceiveHandoffTestController::begin () +{ + timeout_.start (); + prepare (); +} + +void ReceiveHandoffTestController::prepare () +{ + if (finished_) return; + auto * ft8 = window_->findChild ("actionFT8"); + auto * monitor = window_->findChild ("monitorButton"); + if (!ft8 || !monitor) + { + finish (false, tr ("Required FT8 or monitoring control was not found.")); + return; + } + if (!monitor->isEnabled () || !window_->decoderBackendRunning ()) + { + retry_.start (); + return; + } + + ft8->trigger (); + if (!monitor->isChecked ()) monitor->click (); + if (!window_->monitoringActive ()) + { + retry_.start (); + return; + } + if (!window_->configureLiveAudioTestHandoff ()) + { + finish (false, tr ("Unable to configure ordinary FT8 final start.")); + return; + } + + resetScenario (QStringLiteral ("within-period one-second backlog")); + if (!advance (0, true) || !drain ()) return; + for (qint64 offset = 3456; offset < 153600; offset += 3456) + if (!advance (offset) || !drain ()) return; + if (!advance (153600) || !drain ()) return; + auto const beforeStall = committed_; + if (!advance (165600)) return; + if (!require (committed_ == beforeStall, + tr ("GUI consumed audio during the withheld second.")) || !drain ()) return; + if (!require (!rejected_ && committed_ > beforeStall && committed_ < 165600, + tr ("Backlog did not commit losslessly with a partial tail."))) return; + auto const beforeFlush = accepted_; + if (!advance (165600, false, true) || !drain ()) return; + if (!require (committed_ == 165600 && accepted_ == beforeFlush + 1, + tr ("Partial tail was not delivered exactly once."))) return; + if (!advance (165600, false, true) || !drain ()) return; + if (!require (accepted_ == beforeFlush + 1, + tr ("Repeated flush duplicated the partial tail."))) return; + std::cerr << "WSJT-X receive handoff stage passed: " + << diagnostics ().toStdString () << std::endl; + + resetScenario (QStringLiteral ("one-second backlog across rollover")); + if (!advance (0, true) || !drain ()) return; + for (qint64 offset = 3456; offset < 168600; offset += 3456) + if (!advance (offset) || !drain ()) return; + if (!advance (168600) || !drain ()) return; + if (!require (!final_submissions_ && !rejected_, + tr ("A was rejected or a final was submitted by 14.05 seconds."))) return; + obsolete_epoch_ = epoch_; + rejected_end_ = committed_; + auto const acceptedA = accepted_; + if (!advance (180600) || !drain ()) return; + if (!require (rejected_ == 4 && rejected_end_ == 179712 + && accepted_ == acceptedA && !final_submissions_, + tr ("Obsolete A entered DSP or submitted a final pass."))) return; + sample_period_ = 1; + epoch_ = 0; + committed_ = 0; + if (!advance (183456) || !drain ()) return; + if (!require (committed_ == 3456 && epoch_ != obsolete_epoch_, + tr ("B did not begin with its first complete block at zero."))) return; + for (qint64 offset = 186912; offset <= 193824; offset += 3456) + if (!advance (offset) || !drain ()) return; + if (!require (committed_ == 13824 && accepted_ == acceptedA + 4 + && !final_submissions_, tr ("B stopped advancing after rollover."))) return; + std::cerr << "WSJT-X receive handoff stage passed: " + << diagnostics ().toStdString () << std::endl; + + resetScenario (QStringLiteral ("delayed complete-period handoff")); + sample_period_ = 1; + if (!advance (2 * periodFrames, true) || !drain ()) return; + if (!require (rejected_ > 0 && accepted_ > 0 && committed_ == 179712, + tr ("Delayed A/B handoff did not reject A and commit B."))) return; + std::cerr << "WSJT-X receive handoff stage passed: " + << diagnostics ().toStdString () << std::endl; + QTimer::singleShot (0, this, [this] { + finish (true, tr ("All three receive handoff stages passed.")); + }); +} + +void ReceiveHandoffTestController::resetScenario (QString const& name) +{ + scenario_ = name; + scenario_error_.clear (); + epoch_ = 0; + obsolete_epoch_ = 0; + sample_period_ = 0; + accepted_ = rejected_ = committed_ = rejected_end_ = final_submissions_ = 0; +} + +QString ReceiveHandoffTestController::diagnostics () const +{ + return tr ("scenario=%1 capture=%2 epoch=%3 obsolete=%4 committed=%5 " + "accepted=%6 rejected=%7 rejected-end=%8 final-submissions=%9 generation=%10") + .arg (scenario_).arg (capture_).arg (epoch_).arg (obsolete_epoch_) + .arg (committed_).arg (accepted_).arg (rejected_).arg (rejected_end_) + .arg (final_submissions_).arg (decoder_generation_); +} + +bool ReceiveHandoffTestController::require (bool condition, QString const& message) +{ + if (!condition) finish (false, message + " " + diagnostics ()); + return condition; +} + +bool ReceiveHandoffTestController::advance (qint64 frames, bool fresh, bool flush) +{ + { + std::lock_guard lock {producer_->mutex}; + producer_->finished = false; + producer_->frames = -1; + } + capture_ = frames; + auto * fixture = fixture_; + if (!require (QMetaObject::invokeMethod (fixture, [fixture, frames, fresh, flush] { + fixture->advanceHandoff (frames, fresh, flush); + }, Qt::QueuedConnection), tr ("Unable to command the audio fixture."))) return false; + bool completed; + QString error; + qint64 acknowledged; + { + std::unique_lock lock {producer_->mutex}; + completed = producer_->changed.wait_for ( + lock, std::chrono::seconds {10}, + [this] { return producer_->finished || !producer_->error.isEmpty (); }); + error = producer_->error; + acknowledged = producer_->frames; + } + return require (completed && error.isEmpty () && acknowledged == frames, + tr ("Capture checkpoint failed: acknowledged=%1 error=%2") + .arg (acknowledged).arg (error)); +} + +bool ReceiveHandoffTestController::drain () +{ + QCoreApplication::sendPostedEvents (window_, QEvent::MetaCall); + return require (scenario_error_.isEmpty (), scenario_error_); +} + +void ReceiveHandoffTestController::observe (quint64 epoch, int start, int end, bool accepted) +{ + if (!scenario_error_.isEmpty ()) return; + auto reject = [this, epoch, start, end] (QString const& reason) { + scenario_error_ = tr ("%1 range=[%2,%3) epoch=%4") + .arg (reason).arg (start).arg (end).arg (epoch); + }; + if (!accepted) + { + ++rejected_; + if (scenario_ == QStringLiteral ("within-period one-second backlog")) + reject (tr ("Current-period audio was rejected.")); + if (obsolete_epoch_ && (epoch != obsolete_epoch_ || start != rejected_end_)) + reject (tr ("Rejected A ranges lost their epoch or continuity.")); + rejected_end_ = end; + return; + } + ++accepted_; + if (!epoch_) epoch_ = epoch; + if (epoch != epoch_ || start != committed_ || end <= start) + { + reject (tr ("Accepted ranges changed epoch, duplicated, or skipped samples.")); + return; + } + for (int index = 0; index < end; ++index) + if (dec_data.d2[index] != FixtureAudioInput::handoffSample (sample_period_, index)) + { + reject (tr ("Committed sample %1 was %2, expected %3.") + .arg (index).arg (dec_data.d2[index]) + .arg (FixtureAudioInput::handoffSample (sample_period_, index))); + return; + } + committed_ = end; +} + +void ReceiveHandoffTestController::finish (bool success, QString const& message) +{ + if (finished_) return; + finished_ = true; + succeeded_ = success; + timeout_.stop (); + retry_.stop (); + std::cerr << "WSJT-X receive handoff test " << (success ? "passed: " : "failed: ") + << message.toStdString () << std::endl; + window_->close (); + QCoreApplication::exit (success ? EXIT_SUCCESS : EXIT_FAILURE); +} diff --git a/ReceiveHandoffTestController.hpp b/ReceiveHandoffTestController.hpp new file mode 100644 index 00000000..cc0f1c2f --- /dev/null +++ b/ReceiveHandoffTestController.hpp @@ -0,0 +1,66 @@ +#ifndef RECEIVE_HANDOFF_TEST_CONTROLLER_HPP +#define RECEIVE_HANDOFF_TEST_CONTROLLER_HPP + +#include +#include +#include + +#include +#include + +class FixtureAudioInput; +class MainWindow; + +// Drives capture checkpoints while controlling delivery to the real GUI consumer. +class ReceiveHandoffTestController final : public QObject +{ + Q_OBJECT + +public: + ReceiveHandoffTestController (MainWindow * window, FixtureAudioInput * fixture, + QObject * parent = nullptr); + + void begin (); + bool succeeded () const {return succeeded_;} + +private: + void prepare (); + bool advance (qint64 frames, bool fresh = false, bool flush = false); + bool drain (); + bool require (bool condition, QString const& message); + void resetScenario (QString const& name); + void observe (quint64 epoch, int start, int end, bool accepted); + QString diagnostics () const; + void finish (bool success, QString const& message); + + MainWindow * window_; + FixtureAudioInput * fixture_; + QTimer retry_; + QTimer timeout_; + struct ProducerAcknowledgement + { + std::mutex mutex; + std::condition_variable changed; + QString error; + bool finished {false}; + qint64 frames {-1}; + }; + std::shared_ptr producer_ { + std::make_shared ()}; + qint64 capture_ {0}; + QString scenario_; + QString scenario_error_; + quint64 epoch_ {0}; + quint64 obsolete_epoch_ {0}; + qint64 sample_period_ {0}; + int accepted_ = 0; + int rejected_ = 0; + int committed_ = 0; + int rejected_end_ = 0; + int final_submissions_ = 0; + quint64 decoder_generation_ = 0; + bool finished_ {false}; + bool succeeded_ {false}; +}; + +#endif diff --git a/ReferenceSpectrum.hpp b/ReferenceSpectrum.hpp new file mode 100644 index 00000000..8b4bb93a --- /dev/null +++ b/ReferenceSpectrum.hpp @@ -0,0 +1,33 @@ +#ifndef REFERENCE_SPECTRUM_HPP +#define REFERENCE_SPECTRUM_HPP + +#include + +// Visit each newly committed sample exactly once, independently of the mode's +// notification step. The DSP accepts chunks of at most 3456 samples; a zero +// count resets stream history without discarding accumulated measurements. +class ReferenceSpectrumInput +{ +public: + template + void consume (short * samples, int end, int mode, Process process) + { + bool const newPeriod = end < end_; + if (newPeriod) end_ = 0; + if (newPeriod || mode != mode_) process (samples, 0); + if (mode) + while (end_ < end) + { + int const count = std::min (3456, end - end_); + process (samples + end_, count); + end_ += count; + } + end_ = end; + mode_ = mode; + } + void reset () { end_ = 0; mode_ = -1; } +private: + int end_ = 0; + int mode_ = -1; +}; +#endif diff --git a/Release_Notes.txt b/Release_Notes.txt index afcdacdb..cc228997 100644 --- a/Release_Notes.txt +++ b/Release_Notes.txt @@ -8,9 +8,277 @@ | $$$ \$$$ \$$ $$ \$$ $$ | $$ | $$ | $$ \$$ \$$ \$$$$$$ \$$$$$$ \$$ \$$ \$$ - Copyright 2001 - 2026 by Joe Taylor, K1JT, and the WSJT Development Team + Release: WSJT-X 3.2.0-rc1 + September 23, 2026 + ------------------------- + +WSJT-X 3.2.0 introduces a new mode, JTTY, along with new capabilities +in Q65, MAP65, and QMAP and a large number of improvements and bug +fixes. Release Candidates give advanced users an opportunity to +exercise new features and provide feedback to developers. If you use +this Release Candidate, please send related comments or questions to +one of our user forums or open an Issue at our public repository +https://github.com/WSJTX/wsjtx. We also welcome explicit pull requests +against our public master branch there. + +Installation packages for Windows, Linux, and macOS include user +applications WSJT-X, MAP65, and QMAP and many utility programs useful +to advanced users and co-developers. Linux packages are provided for +x86_64, aarch64, and armhf. + +Among the more important enhancements since version 3.0.2 are the +following: + + - JTTY, a new digital mode for fast RTTY-style contest exchanges and + other keyboard-to-keyboard communication. JTTY has an operational + feel similar to RTTY but far better weak-signal performance and + a very low error rate. It can transmit at any time rather than in + fixed T/R periods. Its 4-tone GFSK waveform uses 1.888-second + frames and about 127 Hz of bandwidth. Function keys F1-F8 provide + contest-style exchanges, and messages can be queued while + transmitting. Signal subtraction and adaptive decoding help recover + overlapping or fading signals. Received and transmitted text is + recorded in ALL.TXT, and an MMTTY-compatible interface connects to + N1MM Logger+ version 1.0.11449 or later. + + - MAP65 adds support for 192 kHz sample rates, together with extensive + corrections to JT65 and Q65 decoding, scheduling, averaging, and + polarization handling. + + - QMAP overlays decoded callsigns in its standard waterfall. An + optional Vertical Waterfall displays callsigns without obscuring + signal traces. Clicking a callsign in either waterfall sets up, or + double-clicking starts, a QSO in a co-running WSJT-X. + + - Q65 Pileup mode can indicate that the station being called copied + the previous transmission. Such decodes are marked with "#" in the + decoded text and Active Stations windows. Everything needed is + exchanged over the air; no internet connection is required. + + - The Settings dialog can be resized and its pages scroll when + necessary. Main-window controls adapt to the selected font, mode, + and available width. Keyboard navigation and assistive-technology + support have been improved in Settings and the decode panes. + + - Decoded text panes keep their scroll position while earlier decodes + are being reviewed. New decodes continue to accumulate below, and + the pane returns to live output when scrolled back to the end. + + - Raspberry Pi and other ARM single-board computers: 32-bit (armhf) + Linux packages (.deb, .rpm, and AppImage) are again available + alongside 64-bit aarch64 packages. Both are built and tested on + Debian Bookworm. Projects such as DigiPi can install the current + release without building from source. + + - TX Inhibit through the WSJT-X UDP network protocol allows an + external controller to hold off PTT while another station on a + shared band is transmitting. PTT can resume if the hold ends while + transmission is still requested. + +Further features and fixes since version 3.0.2: + +MAP65, QMAP, and Q65: + + - MAP65 live decoding no longer uses incomplete received data, which + could produce spurious candidates or miss real signals. Early and + final decode requests are handled independently so a long-running + pass is less likely to prevent the next one from running. + + - For dual-polarization Q65 reception, MAP65 searches across + polarization angles and accounts for unequal or correlated receiver + noise. Paired Q65B simulations measured an average sensitivity gain + of about 0.1 dB. Applying the configured Dphi correction when + combining channels also recovers signals weakened by a receiver + phase offset. + + - MAP65 fixes cases where closely spaced signals or a JT65 sweep + could prevent another JT65 or Q65 signal from being decoded. JT65 + averaging now uses each candidate's measured timing, and + intermittent single-polarization JT65 failures have been corrected. + + - MAP65 now offers Full Deep Search for Q65. JT65 Deep Search reads + complete CALL3.TXT files and refreshes its candidates when the + calls, grid, or EME filter changes. + + - Specific spurious results from strong JT65 signals and invalid Q65 + callsigns have been corrected. + + - Manual JT65 decoding again uses the lower sync threshold at narrow + frequency tolerances, while manual Q65 decoding honors the selected + Ftol. Find Delta Phi displays its current result rather than stale + output from an earlier calibration. + + - QMAP callsign labels follow decode timestamps during live reception + and file playback. Both waterfalls remember their size and open + state, resizing preserves their history, and a separate Stop button + ends monitoring or a sequence of saved-file decodes. + +Decoding, sequencing, and transmit controls: + + - Multithreaded (MTD) FT8 decoding is more reliable under load. Fixes + prevent stalls when fewer decoder workers are available than + requested, occasional loss of weak messages during concurrent + signal subtraction, and fields from different decodes being mixed. + + - SuperFox rejects invalid callsigns, reports, and free text before + transmission. Its queue, counters, and logs stay consistent when a + message is rejected, and free text can again accompany four Hounds. + + - WSPR and FST4W beacon scheduling works with 900- and 1800-second + periods after Tune, with Tx Next, and with fixed Round Robin + selections. + + - Echo mode rejects invalid CW text and handles silent input and + averaging correctly. + + - Generated messages that cannot be represented by the selected + over-the-air format are rejected before PTT. This prevents a + callsign, prefix, suffix, serial number, or contest field from being + changed silently. + + - CQ: First and CQ: Max dB continue considering eligible callers + after a decode is rejected or filtered. An eligible station calling + directly can replace a pending CQ or QRZ according to the selected + response policy. + + - Q65 stops automatic transmission after final logging when repeat + transmission is disabled. RR73 is offered only by message formats + that support it; legacy and shorthand exchanges retain RRR. + + - Tx even/1st locking works independently of mode while preserving + Fox and Hound requirements. TX1 preferences survive temporary mode + restrictions, and Wait & Reply and Wait & Pounce provide accurate + state indications and prerequisite messages. + + - The former automatic transmit-frequency adjustment for UK + callsigns on 60 m has been removed. Operators remain responsible + for keeping their transmitted spectrum within permitted + allocations. + +Rig control and TCI: + + - On radios with multiple DATA profiles, WSJT-X preserves an + operator-selected DATA2 or DATA3 profile when Data/Pkt is selected. + Previously, frequency changes or Fake It split operation could + switch the radio to generic DATA (DATA1 on the TS-990S). + + - Rig Split preserves receive and transmit VFO roles during PTT. + Changes to the transmit audio offset keep the split transmit dial + synchronized, including with TCI and custom-frequency band hops. + + - A saved transverter RF frequency is no longer replaced by an + initial IF report. + + - Band and nominal-frequency changes are blocked while transmitting + or tuning, without losing the previous selection or monitoring + state. + + - Invalid frequencies and station offsets are rejected rather than + becoming zero or overflowing. After a rig failure, pending PTT, + Tune, and Stop TX commands are discarded. + + - TCI applies the correct audio period after startup or restart, + frames transmit audio correctly, reapplies the configured power + setting during rig synchronization, and validates frequencies + across the full supported range. + +Main window, Settings, and accessibility: + + - Double-clicking a decode selects the row under the initial click + even if another message arrives during the gesture. + + - Rx Frequency mirrors worked, wanted, ignored, territory, and + current-DX highlighting from Band Activity. Highlight prefix lists + accept "*" wildcards and "!" exclusions, and directional lists + match consistently regardless of spacing or letter case. + + - For a U.S. callsign operating portable from a grid in another + state, the displayed entity and state reflect the current location. + Worked-before and DXCC-credit tracking remain unchanged (reported by + Steve, K5DOG). + + - Settings tables and lists have keyboard-accessible Actions buttons. + Tx Macros and highlighting priorities can be reordered from the + keyboard, validation selects the relevant page and field, and + additional accessible names identify operating controls and decode + panes. High-DPI scaling is now enabled automatically; the obsolete + HighDPI and enlarged-tab options have been removed. + + - Switching configurations restarts the decoder cleanly and preserves + the dial frequency and waterfall state. + + - A stale lock-file dialog shows the file and process details and + offers explicit Remove Lock File, Retry, and No actions. + +Wide Graph: + + - Resizing Wide Graph preserves waterfall and spectrum history. + Spectrum flattening uses the visible frequency range so off-screen + signals do not shift the displayed baseline. + +Networking, logging, and integrations: + + - Large UDP Replay responses are sent in paced batches, reducing + dropped records and Network Error dialogs while keeping the + interface responsive. + + - UDP clients can reply to decodes hidden by display filters, and the + reference UDP server follows a restarted WSJT-X client's new port. + + - PSK Reporter uses smaller UDP packets on links with restricted + packet sizes. Spots received around midnight carry the correct + date. ALL.TXT and PSK Reporter also retain the band and frequency + of each receive period when the operator changes band or mode. + + - Cloudlog and Wavelog: Check Connection now verifies the API layout, + write access, and selected station profile. The station selector is + populated from the server, so a misconfigured connection is caught + before the first QSO is logged. + + - eQSL ADIF uploads use HTTPS so credentials are not sent in clear + text. ADIF export preserves contest exchanges including Field Day, + RTTY/FT Roundup, serial numbers, and EU VHF exchanges. + +Windows, macOS, and Linux: + + - Windows builds no longer depend on newer synchronization functions + that are unavailable on older systems. jt9.exe is terminated if + WSJT-X exits unexpectedly, high-numbered COM ports are handled, and + startup no longer plays an unsolicited Testing123 announcement. + + - The macOS installer replaces an existing application when + reinstalling the same version. + + - Linux data and alert-sound locations follow the installation + prefix consistently. Logs and writable cty.dat and CALL3.TXT + overrides use the configured data directory, including separate + locations selected with --rig-name. + + - Debian packages are classified as hamradio and prevent mixed + installations of official WSJT-X and conflicting fork packages. + +Documentation and translations: + + - German, Polish, and Ukrainian translations have been added, the + Hungarian translation is enabled, and the Spanish translation has + been updated. Untranslated text continues to appear in English. + + - The User Guide adds JTTY and QMAP sections and sample recordings. + WSJT-X, MAP65, and QMAP have new icons. + +We thank the contributors and reporters whose work is part of this +release, including Matt Manjos (W5MMW); Arek Czak (SP1AKU), Petro Ostapuk +(UR3PKI), and Cedric (EA4AC) for translations; Jeff Millar (WA1HCO) +for the original TX Inhibit proposal and field reports; and +Carl-Johan Kjellander, Jaroslav Škarvada, Laurence Howell (KL7L), +Tony (EI7BMB), Gary (N8CQ), Marco Calistri (PY1ZRJ), Mike (KK7ER), +Hasan (N0AN), Leigh (KG7WED), Jim (K1JH), Michael (W9IP), and +Glenn (AF8C) for reports and testing. +We also thank the many other operators who helped test corrections +through the WSJT-X mailing lists and user forums. + Release: WSJT-X 3.0.2 June 19, 2026 ------------------------- diff --git a/RigFrequencyChangePolicy.hpp b/RigFrequencyChangePolicy.hpp new file mode 100644 index 00000000..44ca6d70 --- /dev/null +++ b/RigFrequencyChangePolicy.hpp @@ -0,0 +1,110 @@ +#ifndef RIGFREQUENCYCHANGEPOLICY_HPP__ +#define RIGFREQUENCYCHANGEPOLICY_HPP__ + +namespace RigFrequencyChangePolicy +{ + enum class ChangeKind + { + NominalQsy, + TxPathCorrection + }; + + enum class BlockReason + { + None, + NominalQsyWhileRfActive, + TxCorrectionDisabled + }; + + struct Activity + { + bool transmitRequested {false}; + bool transmitCommandPending {false}; + bool transmitting {false}; + bool tuning {false}; + bool jttyTransmitting {false}; + bool startDelayActive {false}; + bool stopDelayActive {false}; + bool rigPtt {false}; + bool rigTune {false}; + }; + + struct Decision + { + bool allowed; + BlockReason reason; + }; + + constexpr bool nominal_qsy_locked (Activity const& activity) + { + return activity.transmitRequested + || activity.transmitCommandPending + || activity.transmitting + || activity.tuning + || activity.jttyTransmitting + || activity.startDelayActive + || activity.stopDelayActive + || activity.rigPtt + || activity.rigTune; + } + + constexpr bool tx_correction_requires_permission (Activity const& activity) + { + return activity.transmitCommandPending + || activity.transmitting + || activity.tuning + || activity.jttyTransmitting + || activity.startDelayActive + || activity.stopDelayActive + || activity.rigPtt + || activity.rigTune; + } + + constexpr Decision evaluate (ChangeKind kind, Activity const& activity, + bool correctionsAllowedWhileTransmitting) + { + return kind == ChangeKind::NominalQsy + ? (nominal_qsy_locked (activity) + ? Decision{false, BlockReason::NominalQsyWhileRfActive} + : Decision{true, BlockReason::None}) + : (tx_correction_requires_permission (activity) + && !correctionsAllowedWhileTransmitting + ? Decision{false, BlockReason::TxCorrectionDisabled} + : Decision{true, BlockReason::None}); + } + + constexpr bool tx_path_frequency_supported (bool hasTxFrequency, bool splitMode) + { + return !hasTxFrequency || splitMode; + } + + template + bool applyIfAllowed (ChangeKind kind, Activity const& activity, + bool correctionsAllowedWhileTransmitting, Action action) + { + if (!evaluate (kind, activity, correctionsAllowedWhileTransmitting).allowed) return false; + action (); + return true; + } + + template + bool commitIfAccepted (Request request, Commit commit) + { + if (!request ()) return false; + commit (); + return true; + } + + template + bool requestWhileMonitoring (bool was_monitoring, SetMonitoring setMonitoring, + Request request) + { + auto const started_monitoring = !was_monitoring; + if (started_monitoring) setMonitoring (true); + if (request ()) return true; + if (started_monitoring) setMonitoring (false); + return false; + } +} + +#endif diff --git a/Rr73Policy.cpp b/Rr73Policy.cpp new file mode 100644 index 00000000..cecccd0f --- /dev/null +++ b/Rr73Policy.cpp @@ -0,0 +1,15 @@ +#include "Rr73Policy.hpp" + +namespace Rr73Policy +{ + bool tx4AllowsRr73 (QString const& mode, bool shortMessages) + { + if ("FT8" == mode || "FT4" == mode || "FST4" == mode) + return true; + + if ("MSK144" == mode || "Q65" == mode) + return !shortMessages; + + return false; + } +} diff --git a/Rr73Policy.hpp b/Rr73Policy.hpp new file mode 100644 index 00000000..dbc202eb --- /dev/null +++ b/Rr73Policy.hpp @@ -0,0 +1,11 @@ +#ifndef RR73_POLICY_HPP_ +#define RR73_POLICY_HPP_ + +#include + +namespace Rr73Policy +{ + bool tx4AllowsRr73 (QString const& mode, bool shortMessages); +} + +#endif diff --git a/SpecialOperatingActivity.hpp b/SpecialOperatingActivity.hpp new file mode 100644 index 00000000..98c1ea46 --- /dev/null +++ b/SpecialOperatingActivity.hpp @@ -0,0 +1,18 @@ +#ifndef SPECIALOPERATINGACTIVITY_HPP +#define SPECIALOPERATINGACTIVITY_HPP + +enum class SpecialOperatingActivity +{ + NONE, + NA_VHF, + EU_VHF, + FIELD_DAY, + RTTY, + WW_DIGI, + FOX, + HOUND, + ARRL_DIGI, + Q65_PILEUP +}; + +#endif // SPECIALOPERATINGACTIVITY_HPP diff --git a/SuperFoxTxPlanner.cpp b/SuperFoxTxPlanner.cpp new file mode 100644 index 00000000..5fc45f0d --- /dev/null +++ b/SuperFoxTxPlanner.cpp @@ -0,0 +1,154 @@ +#include "SuperFoxTxPlanner.h" + +#include + +namespace +{ +bool rr73RepeatDue(SuperFoxTxPlanner::QsoState const& qso) +{ + return qso.tFoxRrpt >= 0 && qso.tFoxRrpt - qso.tFoxTxRR73 > 3; +} + +bool rr73NeverSent(SuperFoxTxPlanner::QsoState const& qso) +{ + return qso.tFoxRrpt >= 0 && qso.tFoxTxRR73 < 0; +} + +bool rr73ReplyNewerThanTx(SuperFoxTxPlanner::QsoState const& qso) +{ + return qso.tFoxRrpt >= 0 && qso.tFoxTxRR73 <= qso.tFoxRrpt; +} +} + +SuperFoxTxPlanner::Record::Record(RecordKind kind, QString const& call, + QString const& grid, QString const& report, + bool fromQueue) + : kind {kind} + , call {call} + , grid {grid} + , report {report} + , fromQueue {fromQueue} +{ +} + +SuperFoxTxPlanner::Capacity::Capacity(int maxRecords, int maxRR73, int maxReports) + : maxRecords {maxRecords} + , maxRR73 {maxRR73} + , maxReports {maxReports} +{ +} + +int SuperFoxTxPlanner::Plan::rr73Count() const +{ + int count = 0; + for (auto const& record : records) + { + if (record.kind == RecordKind::RR73) ++count; + } + return count; +} + +int SuperFoxTxPlanner::Plan::reportCount() const +{ + int count = 0; + for (auto const& record : records) + { + if (record.kind == RecordKind::Report) ++count; + } + return count; +} + +int SuperFoxTxPlanner::Plan::queuedReportCount() const +{ + int count = 0; + for (auto const& record : records) + { + if (record.kind == RecordKind::Report && record.fromQueue) ++count; + } + return count; +} + +SuperFoxTxPlanner::Capacity SuperFoxTxPlanner::capacity(bool sendFreeText) +{ + if (sendFreeText) + { + return Capacity {4, 4, 4}; + } + + return Capacity {9, 5, 4}; +} + +SuperFoxTxPlanner::Plan SuperFoxTxPlanner::plan(QVector const& qsos, + QQueue const& inProgress, + QVector const& queuedHounds, + int maxStrikes, + bool sendFreeText) +{ + Plan result; + result.capacity = capacity(sendFreeText); + + QSet selectedRR73; + addRR73Candidates(qsos, selectedRR73, result, rr73RepeatDue); + addRR73Candidates(qsos, selectedRR73, result, rr73NeverSent); + addRR73Candidates(qsos, selectedRR73, result, rr73ReplyNewerThanTx); + + QMap qsoByCall; + for (auto const& qso : qsos) + { + qsoByCall.insert(qso.call, qso); + } + + for (auto const& call : inProgress) + { + if (!canAdd(result, RecordKind::Report)) break; + auto const it = qsoByCall.constFind(call); + if (it == qsoByCall.constEnd()) continue; + auto const& qso = it.value(); + if (qso.tFoxRrpt < 0 && qso.ncall < maxStrikes) + { + result.records.push_back(Record {RecordKind::Report, call, qso.grid, + qso.sent, false}); + } + } + + for (auto const& queued : queuedHounds) + { + if (!canAdd(result, RecordKind::Report)) break; + result.records.push_back(Record {RecordKind::Report, queued.call, queued.grid, + queued.report, true}); + } + + return result; +} + +SuperFoxTxPlanner::QueuedHound SuperFoxTxPlanner::parseQueuedHound(QString const& line) +{ + QueuedHound hound; + auto const i0 = line.indexOf(" "); + hound.call = i0 >= 0 ? line.mid(0, i0).trimmed() : line.trimmed(); + hound.report = line.mid(12, 3).trimmed(); + hound.grid = line.mid(16, 4).trimmed(); + return hound; +} + +void SuperFoxTxPlanner::addRR73Candidates(QVector const& qsos, + QSet& selectedCalls, + Plan& plan, + bool (*predicate)(QsoState const&)) +{ + for (auto const& qso : qsos) + { + if (!canAdd(plan, RecordKind::RR73)) break; + if (selectedCalls.contains(qso.call)) continue; + if (!predicate(qso)) continue; + selectedCalls.insert(qso.call); + plan.records.push_back(Record {RecordKind::RR73, qso.call, qso.grid, {}, false}); + } +} + +bool SuperFoxTxPlanner::canAdd(Plan const& plan, RecordKind kind) +{ + if (plan.records.size() >= plan.capacity.maxRecords) return false; + if (kind == RecordKind::RR73) return plan.rr73Count() < plan.capacity.maxRR73; + return plan.reportCount() < plan.capacity.maxReports; +} diff --git a/SuperFoxTxPlanner.h b/SuperFoxTxPlanner.h new file mode 100644 index 00000000..509d4b18 --- /dev/null +++ b/SuperFoxTxPlanner.h @@ -0,0 +1,86 @@ +#ifndef SUPERFOXTXPLANNER_H +#define SUPERFOXTXPLANNER_H + +#include +#include +#include +#include + +class SuperFoxTxPlanner +{ +public: + enum class RecordKind + { + RR73, + Report + }; + + struct QsoState + { + QString call; + QString grid; + QString sent; + QString rcvd; + int ncall {0}; + int nRR73 {0}; + int tFoxRrpt {-1}; + int tFoxTxRR73 {-1}; + }; + + struct QueuedHound + { + QString call; + QString grid; + QString report; + }; + + struct Record + { + RecordKind kind {RecordKind::Report}; + QString call; + QString grid; + QString report; + bool fromQueue {false}; + + Record() = default; + Record(RecordKind kind, QString const& call, QString const& grid, + QString const& report, bool fromQueue); + }; + + struct Capacity + { + int maxRecords {9}; + int maxRR73 {5}; + int maxReports {4}; + + Capacity() = default; + Capacity(int maxRecords, int maxRR73, int maxReports); + }; + + struct Plan + { + Capacity capacity; + QVector records; + + int rr73Count() const; + int reportCount() const; + int queuedReportCount() const; + }; + + static Capacity capacity(bool sendFreeText); + static Plan plan(QVector const& qsos, + QQueue const& inProgress, + QVector const& queuedHounds, + int maxStrikes, + bool sendFreeText); + static QueuedHound parseQueuedHound(QString const& line); + +private: + static void addRR73Candidates(QVector const& qsos, + QSet& selectedCalls, + Plan& plan, + bool (*predicate)(QsoState const&)); + static bool canAdd(Plan const& plan, RecordKind kind); +}; + +#endif diff --git a/TRADEMARK.md b/TRADEMARK.md new file mode 100644 index 00000000..ba6b910f --- /dev/null +++ b/TRADEMARK.md @@ -0,0 +1,33 @@ +# Trademark Policy + +**WSJT™**, **WSJT-X™**, **MAP65™**, and **QMAP™** are trademarks of the WSJT Development Team, asserted under common law through our long-standing, continuous public distribution of software with these names. + +This policy is separate from, and independent of, our software license. The source code is licensed under the GNU General Public License v3.0 (see [COPYING](COPYING)), and nothing here changes or restricts your rights under that license. You may use, study, modify, and redistribute our code freely. What this policy restricts is use of our *names*. Trademark law, not copyright law, governs such use, and the GPL does not restrict or otherwise affect trademark rights. + +## Why we care + +A modified program build that behaves differently but is still called "WSJT-X" — or is versioned as though it were an official release, e.g. "MAP65 4.0" or "QMAP 1.0" — creates user confusion and potential interoperability problems, not just a branding dispute. It also leaves users unable to tell which builds we stand behind, support, and have actually tested, and who the authors may be. + +## Actions allowed + +- Redistributing exact, unmodified binaries built from our official source releases, under our program names. +- Packaging our unmodified software for a distro, OS, or platform, including the minor, purely mechanical patches that packaging sometimes requires (build-flag changes, path fixes, dependency-version bumps and the like), without renaming — provided the program's behavior and on-air protocol handling are unchanged. (Use of an appended revision number like "2.7.0-1" is acceptable, but replacement of the real version number with a fabricated one like "4.0" is not.) +- Forking, modifying, and redistributing the source code under the GPL — including studying it, building on it, and shipping your own version — provided you follow the renaming rule below. +- Saying your fork is "based on WSJT-X" (or MAP65, or QMAP) — that's just true, and we want people to know your fork's heritage. + +## Forbidden without renaming + +- Distributing a version with functional changes — new features, changed behavior, or altered protocol handling — under our names ("WSJT-X", "MAP65", "QMAP") or any confusingly similar variant of them (e.g. "WSJT-X Improved", "WSJT-X Plus"). +- Assigning your own version number within our numbering sequence, e.g. calling a modified fork "MAP65 4.0" or "QMAP 1.0" when we have not released any such version. This applies regardless of whether the underlying code changed. +- Using our names, or names confusingly similar to them, for a differently-behaving program in a way that could lead users, on the air or in software listings, to believe it is our software or is endorsed by us. + +If you've made functional changes, please pick a distinct name — you're welcome to describe your project as "based on WSJT-X code" or "a fork of QMAP." + +## Questions or concerns + +If you're unsure whether a planned use is fine, or want to flag a misuse you've found, please open an issue or contact the WSJT Development Team. + +--- + +*This is not a substitute for legal advice. It describes how we intend to use and enforce our trademarked program names in practice.* + diff --git a/Transceiver/EmulateSplitTransceiver.cpp b/Transceiver/EmulateSplitTransceiver.cpp index e7971fef..942ce088 100644 --- a/Transceiver/EmulateSplitTransceiver.cpp +++ b/Transceiver/EmulateSplitTransceiver.cpp @@ -18,7 +18,10 @@ EmulateSplitTransceiver::EmulateSplitTransceiver (logger_type * logger, // parent matching signals. connect (wrapped_.get (), &Transceiver::resolution, this, &Transceiver::resolution); connect (wrapped_.get (), &Transceiver::tciframeswritten, this, &Transceiver::tciframeswritten); + connect (wrapped_.get (), &Transceiver::receiveAudio, this, &Transceiver::receiveAudio); connect (wrapped_.get (), &Transceiver::tci_mod_active, this, &Transceiver::tci_mod_active); + connect (wrapped_.get (), &Transceiver::txSourceCommitted, this, &Transceiver::txSourceCommitted); + connect (wrapped_.get (), &Transceiver::rawTxPlayoutSnapshot, this, &Transceiver::rawTxPlayoutSnapshot); connect (wrapped_.get (), &Transceiver::finished, this, &Transceiver::finished); connect (wrapped_.get (), &Transceiver::failure, this, &Transceiver::failure); } diff --git a/Transceiver/HamlibMode.cpp b/Transceiver/HamlibMode.cpp new file mode 100644 index 00000000..dd7ce6a4 --- /dev/null +++ b/Transceiver/HamlibMode.cpp @@ -0,0 +1,109 @@ +#include "HamlibMode.hpp" + +namespace HamlibMode +{ + auto from_hamlib (rmode_t mode) -> Transceiver::MODE + { + switch (mode) + { + case RIG_MODE_AM: + case RIG_MODE_SAM: + case RIG_MODE_AMS: + case RIG_MODE_DSB: + return Transceiver::AM; + + case RIG_MODE_CW: + return Transceiver::CW; + + case RIG_MODE_CWR: + return Transceiver::CW_R; + + case RIG_MODE_USB: + case RIG_MODE_ECSSUSB: + case RIG_MODE_SAH: + case RIG_MODE_FAX: + return Transceiver::USB; + + case RIG_MODE_LSB: + case RIG_MODE_ECSSLSB: + case RIG_MODE_SAL: + return Transceiver::LSB; + + case RIG_MODE_RTTY: + return Transceiver::FSK; + + case RIG_MODE_RTTYR: + return Transceiver::FSK_R; + + case RIG_MODE_PKTLSB: + case RIG_MODE_LSBD1: + case RIG_MODE_LSBD2: + case RIG_MODE_LSBD3: + return Transceiver::DIG_L; + + case RIG_MODE_PKTUSB: + case RIG_MODE_USBD1: + case RIG_MODE_USBD2: + case RIG_MODE_USBD3: + return Transceiver::DIG_U; + + case RIG_MODE_FM: + case RIG_MODE_WFM: + return Transceiver::FM; + + case RIG_MODE_PKTFM: + return Transceiver::DIG_FM; + + default: + return Transceiver::UNK; + } + } + + rmode_t to_hamlib (Transceiver::MODE mode) + { + switch (mode) + { + case Transceiver::AM: return RIG_MODE_AM; + case Transceiver::CW: return RIG_MODE_CW; + case Transceiver::CW_R: return RIG_MODE_CWR; + case Transceiver::USB: return RIG_MODE_USB; + case Transceiver::LSB: return RIG_MODE_LSB; + case Transceiver::FSK: return RIG_MODE_RTTY; + case Transceiver::FSK_R: return RIG_MODE_RTTYR; + case Transceiver::DIG_L: return RIG_MODE_PKTLSB; + case Transceiver::DIG_U: return RIG_MODE_PKTUSB; + case Transceiver::FM: return RIG_MODE_FM; + case Transceiver::DIG_FM: return RIG_MODE_PKTFM; + default: break; + } + return RIG_MODE_USB; + } + + bool satisfies_request (rmode_t requested, rmode_t current) + { + if (requested == current) + { + return true; + } + + if (RIG_MODE_PKTUSB == requested) + { + return RIG_MODE_USBD1 == current || RIG_MODE_USBD2 == current + || RIG_MODE_USBD3 == current; + } + + if (RIG_MODE_PKTLSB == requested) + { + return RIG_MODE_LSBD1 == current || RIG_MODE_LSBD2 == current + || RIG_MODE_LSBD3 == current; + } + + return false; + } + + bool change_required (Transceiver::MODE requested, rmode_t current) + { + return Transceiver::UNK != requested + && !satisfies_request (to_hamlib (requested), current); + } +} diff --git a/Transceiver/HamlibMode.hpp b/Transceiver/HamlibMode.hpp new file mode 100644 index 00000000..5bebf26a --- /dev/null +++ b/Transceiver/HamlibMode.hpp @@ -0,0 +1,16 @@ +#ifndef HAMLIB_MODE_HPP_ +#define HAMLIB_MODE_HPP_ + +#include + +#include "Transceiver.hpp" + +namespace HamlibMode +{ + Transceiver::MODE from_hamlib (rmode_t); + rmode_t to_hamlib (Transceiver::MODE); + bool satisfies_request (rmode_t requested, rmode_t current); + bool change_required (Transceiver::MODE requested, rmode_t current); +} + +#endif diff --git a/Transceiver/HamlibTransceiver.cpp b/Transceiver/HamlibTransceiver.cpp index 99b31f5c..2dde9459 100644 --- a/Transceiver/HamlibTransceiver.cpp +++ b/Transceiver/HamlibTransceiver.cpp @@ -1,4 +1,5 @@ #include "HamlibTransceiver.hpp" +#include "HamlibMode.hpp" #include #include @@ -13,6 +14,13 @@ #include #include #include +#ifndef HAMLIB_PTTPORT +#include +#endif +#ifndef HAMLIB_STATE +#include +#endif +#include "HamlibVfoRoleState.hpp" #include "pimpl_impl.hpp" #include "moc_HamlibTransceiver.cpp" @@ -22,6 +30,32 @@ namespace { + int vfo_list (RIG * rig) + { + return HAMLIB_STATE (rig)->vfo_list; + } + + bool has_vfo (RIG * rig, vfo_t vfo) + { + return vfo_list (rig) & vfo; + } + + vfo_t rx_vfo (RIG * rig) + { + return has_vfo (rig, RIG_VFO_A) ? RIG_VFO_A : RIG_VFO_MAIN; + } + + vfo_t tx_vfo (RIG * rig) + { + return has_vfo (rig, RIG_VFO_B) ? RIG_VFO_B : RIG_VFO_SUB; + } + + bool ptt_port_configured (RIG * rig) + { + auto ptt_port = HAMLIB_PTTPORT (rig); + return ptt_port && RIG_PTT_NONE != ptt_port->type.ptt; + } + // Unfortunately bandwidth is conflated with mode, this is probably // because Icom do the same. So we have to care about bandwidth if // we want to set mode otherwise we will end up setting unwanted @@ -116,13 +150,13 @@ namespace hamlib_tx_vfo_fixup (RIG * rig, vfo_t tx_vfo) : rig_ {rig} { - original_vfo_ = rig_->state.tx_vfo; - rig_->state.tx_vfo = tx_vfo; + original_vfo_ = HAMLIB_STATE (rig_)->tx_vfo; + HAMLIB_STATE (rig_)->tx_vfo = tx_vfo; } ~hamlib_tx_vfo_fixup () { - rig_->state.tx_vfo = original_vfo_; + HAMLIB_STATE (rig_)->tx_vfo = original_vfo_; } private: @@ -142,7 +176,6 @@ public: , back_ptt_port_ {false} , one_VFO_ {false} , is_dummy_ {true} - , reversed_ {false} , freq_query_works_ {true} , mode_query_works_ {true} , split_query_works_ {true} @@ -165,7 +198,6 @@ public: , back_ptt_port_ {TransceiverFactory::TX_audio_source_rear == params.audio_source} , one_VFO_ {false} , is_dummy_ {RIG_MODEL_DUMMY == model_} - , reversed_ {false} , freq_query_works_ {rig_ && rig_get_function_ptr (model_, RIG_FUNCTION_GET_FREQ)} , mode_query_works_ {rig_ && rig_get_function_ptr (model_, RIG_FUNCTION_GET_MODE)} , split_query_works_ {rig_ && rig_get_function_ptr (model_, RIG_FUNCTION_GET_SPLIT_VFO)} @@ -189,7 +221,7 @@ public: QByteArray get_conf (char const * item); Transceiver::MODE map_mode (rmode_t) const; rmode_t map_mode (Transceiver::MODE mode) const; - std::tuple get_vfos (bool for_split) const; + std::tuple get_vfos (bool for_split, bool split_ptt_active) const; HamlibTransceiver::logger_type mutable * logger_; unsigned model_; @@ -206,7 +238,7 @@ public: static freq_t dummy_frequency_; static rmode_t dummy_mode_; - bool mutable reversed_; + HamlibVfoRoleState mutable vfo_roles_; bool freq_query_works_; bool mode_query_works_; @@ -283,7 +315,7 @@ void HamlibTransceiver::impl::error_check (int ret_code, QString const& doing) c } } -std::tuple HamlibTransceiver::impl::get_vfos (bool for_split) const +std::tuple HamlibTransceiver::impl::get_vfos (bool for_split, bool split_ptt_active) const { if (get_vfo_works_ && rig_get_function_ptr (model_, RIG_FUNCTION_GET_VFO)) { @@ -291,7 +323,7 @@ std::tuple HamlibTransceiver::impl::get_vfos (bool for_split) cons error_check (rig_get_vfo (rig_.data (), &v), tr ("getting current VFO")); // has side effect of establishing current VFO inside hamlib CAT_TRACE ("rig_get_vfo VFO=" << rig_strvfo (v)); - reversed_ = RIG_VFO_B == v; + vfo_roles_.observe_active_vfo (v, split_ptt_active); } else if (!for_split && set_vfo_works_ && rig_get_function_ptr (model_, RIG_FUNCTION_SET_VFO) && rig_get_function_ptr (model_, RIG_FUNCTION_SET_SPLIT_VFO)) { @@ -300,22 +332,22 @@ std::tuple HamlibTransceiver::impl::get_vfos (bool for_split) cons // support this way around CAT_TRACE ("rig_set_vfo VFO=A/MAIN"); - error_check (rig_set_vfo (rig_.data (), rig_->state.vfo_list & RIG_VFO_A ? RIG_VFO_A : RIG_VFO_MAIN), tr ("setting current VFO")); + error_check (rig_set_vfo (rig_.data (), rx_vfo (rig_.data ())), tr ("setting current VFO")); } // else only toggle available but VFOs should be substitutable - auto rx_vfo = rig_->state.vfo_list & RIG_VFO_A ? RIG_VFO_A : RIG_VFO_MAIN; + auto rx_vfo = ::rx_vfo (rig_.data ()); auto tx_vfo = (WSJT_RIG_NONE_CAN_SPLIT || !is_dummy_) && for_split - ? (rig_->state.vfo_list & RIG_VFO_B ? RIG_VFO_B : RIG_VFO_SUB) + ? ::tx_vfo (rig_.data ()) : rx_vfo; - if (reversed_) + if (vfo_roles_.reversed ()) { CAT_TRACE ("reversing VFOs"); - std::swap (rx_vfo, tx_vfo); } - CAT_TRACE ("RX VFO=" << rig_strvfo (rx_vfo) << " TX VFO=" << rig_strvfo (tx_vfo)); - return std::make_tuple (rx_vfo, tx_vfo); + auto vfos = vfo_roles_.resolve (rx_vfo, tx_vfo); + CAT_TRACE ("RX VFO=" << rig_strvfo (std::get<0> (vfos)) << " TX VFO=" << rig_strvfo (std::get<1> (vfos))); + return vfos; } void HamlibTransceiver::impl::set_conf (char const * item, char const * value) @@ -333,82 +365,15 @@ QByteArray HamlibTransceiver::impl::get_conf (char const * item) QByteArray value {128, '\0'}; if (RIG_CONF_END != token) // only get if valid for rig model { - error_check (rig_get_conf2 (rig_.data (), token, value.data (),value.length()), tr ("getting a configuration item")); //changed to conf2, added parameter for buffer length +#if HAVE_HAMLIB_GET_CONF2 + error_check (rig_get_conf2 (rig_.data (), token, value.data (), value.length ()), tr ("getting a configuration item")); +#else + error_check (rig_get_conf (rig_.data (), token, value.data ()), tr ("getting a configuration item")); +#endif } return value; } -auto HamlibTransceiver::impl::map_mode (rmode_t m) const -> MODE -{ - switch (m) - { - case RIG_MODE_AM: - case RIG_MODE_SAM: - case RIG_MODE_AMS: - case RIG_MODE_DSB: - return AM; - - case RIG_MODE_CW: - return CW; - - case RIG_MODE_CWR: - return CW_R; - - case RIG_MODE_USB: - case RIG_MODE_ECSSUSB: - case RIG_MODE_SAH: - case RIG_MODE_FAX: - return USB; - - case RIG_MODE_LSB: - case RIG_MODE_ECSSLSB: - case RIG_MODE_SAL: - return LSB; - - case RIG_MODE_RTTY: - return FSK; - - case RIG_MODE_RTTYR: - return FSK_R; - - case RIG_MODE_PKTLSB: - return DIG_L; - - case RIG_MODE_PKTUSB: - return DIG_U; - - case RIG_MODE_FM: - case RIG_MODE_WFM: - return FM; - - case RIG_MODE_PKTFM: - return DIG_FM; - - default: - return UNK; - } -} - -rmode_t HamlibTransceiver::impl::map_mode (MODE mode) const -{ - switch (mode) - { - case AM: return RIG_MODE_AM; - case CW: return RIG_MODE_CW; - case CW_R: return RIG_MODE_CWR; - case USB: return RIG_MODE_USB; - case LSB: return RIG_MODE_LSB; - case FSK: return RIG_MODE_RTTY; - case FSK_R: return RIG_MODE_RTTYR; - case DIG_L: return RIG_MODE_PKTLSB; - case DIG_U: return RIG_MODE_PKTUSB; - case FM: return RIG_MODE_FM; - case DIG_FM: return RIG_MODE_PKTFM; - default: break; - } - return RIG_MODE_USB; // quieten compiler grumble -} - HamlibTransceiver::HamlibTransceiver (logger_type * logger, TransceiverFactory::PTTMethod ptt_type, QString const& ptt_port, QObject * parent) @@ -467,9 +432,6 @@ HamlibTransceiver::HamlibTransceiver (logger_type * logger, { throw error {tr ("Hamlib initialisation error")}; } - - // m_->rig_->state.obj = this; - if (!m_->is_dummy_) { // printf("Hamlib open params: power_on=%d power_off=%d ptt_share=%d\n",(params.poll_interval & rig__power) == rig__power,(params.poll_interval & rig__power_off) == rig__power_off,(params.poll_interval & ptt__share) == ptt__share); @@ -645,7 +607,7 @@ int HamlibTransceiver::do_start () // reset dynamic state m_->one_VFO_ = false; - m_->reversed_ = false; + m_->vfo_roles_.reset (); m_->freq_query_works_ = rig_get_function_ptr (m_->model_, RIG_FUNCTION_GET_FREQ); m_->mode_query_works_ = rig_get_function_ptr (m_->model_, RIG_FUNCTION_GET_MODE); m_->split_query_works_ = rig_get_function_ptr (m_->model_, RIG_FUNCTION_GET_SPLIT_VFO); @@ -665,7 +627,7 @@ int HamlibTransceiver::do_start () m_->get_vfo_works_ = false; // determine if the rig uses single VFO addressing i.e. A/B and // no get_vfo function - if (m_->rig_->state.vfo_list & RIG_VFO_B) + if (has_vfo (m_->rig_.data (), RIG_VFO_B)) { m_->one_VFO_ = true; } @@ -706,7 +668,7 @@ int HamlibTransceiver::do_start () else { CAT_TRACE ("rig_set_vfo to other VFO"); - rc = rig_set_vfo (m_->rig_.data (), m_->rig_->state.vfo_list & RIG_VFO_B ? RIG_VFO_B : RIG_VFO_SUB); + rc = rig_set_vfo (m_->rig_.data (), tx_vfo (m_->rig_.data ())); if (-RIG_ENAVAIL == rc || -RIG_ENIMPL == rc) { // if we are talking to netrigctl then toggle VFO op @@ -749,7 +711,7 @@ int HamlibTransceiver::do_start () else { CAT_TRACE ("rig_set_vfo A/MAIN"); - m_->error_check (rig_set_vfo (m_->rig_.data (), m_->rig_->state.vfo_list & RIG_VFO_A ? RIG_VFO_A : RIG_VFO_MAIN), tr ("setting current VFO")); + m_->error_check (rig_set_vfo (m_->rig_.data (), rx_vfo (m_->rig_.data ())), tr ("setting current VFO")); } if (f1 != f2 || m != mb || w != wb) // we must have started with MAIN/A @@ -783,7 +745,7 @@ int HamlibTransceiver::do_start () CAT_TRACE ("rig_get_vfo current VFO=" << rig_strvfo (v)); } - m_->reversed_ = RIG_VFO_B == v; + m_->vfo_roles_.observe_active_vfo (v, false); if (m_->mode_query_works_ && !(rig_get_caps_int (m_->model_, RIG_CAPS_TARGETABLE_VFO) & RIG_TARGETABLE_MODE)) { @@ -801,7 +763,7 @@ int HamlibTransceiver::do_start () } } } - update_mode (m_->map_mode (m)); + update_mode (HamlibMode::from_hamlib (m)); } m_->tickle_hamlib_ = true; @@ -815,7 +777,7 @@ int HamlibTransceiver::do_start () if (RIG_MODE_NONE != impl::dummy_mode_) { rig_set_mode (m_->rig_.data (), RIG_VFO_CURR, impl::dummy_mode_, RIG_PASSBAND_NOCHANGE); - update_mode (m_->map_mode (impl::dummy_mode_)); + update_mode (HamlibMode::from_hamlib (impl::dummy_mode_)); } } @@ -873,7 +835,7 @@ int HamlibTransceiver::do_start () do_poll (); - CAT_TRACE ("finished start " << state () << " reversed=" << m_->reversed_ << " resolution=" << resolution); + CAT_TRACE ("finished start " << state () << " reversed=" << m_->vfo_roles_.reversed () << " resolution=" << resolution); return resolution; } @@ -894,12 +856,12 @@ void HamlibTransceiver::do_stop () rig_close (m_->rig_.data ()); } - CAT_TRACE ("state: " << state () << " reversed=" << m_->reversed_); + CAT_TRACE ("state: " << state () << " reversed=" << m_->vfo_roles_.reversed ()); } void HamlibTransceiver::do_frequency (Frequency f, MODE m, bool no_ignore) { - CAT_TRACE ("f: " << f << " mode: " << m << " reversed: " << m_->reversed_); + CAT_TRACE ("f: " << f << " mode: " << m << " reversed: " << m_->vfo_roles_.reversed ()); // only change when receiving or simplex or direct VFO addressing // unavailable or forced @@ -908,7 +870,7 @@ void HamlibTransceiver::do_frequency (Frequency f, MODE m, bool no_ignore) // for the 1st time as a band change may cause a recalled mode to be // set vfo_t target_vfo = RIG_VFO_CURR; - if (!(m_->rig_->state.vfo_list & RIG_VFO_B)) + if (!has_vfo (m_->rig_.data (), RIG_VFO_B)) { target_vfo = RIG_VFO_MAIN; // no VFO A/B so force to Rx on MAIN } @@ -919,11 +881,11 @@ void HamlibTransceiver::do_frequency (Frequency f, MODE m, bool no_ignore) { rmode_t current_mode; pbwidth_t current_width; - auto new_mode = m_->map_mode (m); + auto new_mode = HamlibMode::to_hamlib (m); m_->error_check (rig_get_mode (m_->rig_.data (), target_vfo, ¤t_mode, ¤t_width), tr ("getting current VFO mode")); CAT_TRACE ("rig_get_mode mode=" << rig_strrmode (current_mode) << " bw=" << current_width); - if (new_mode != current_mode) + if (HamlibMode::change_required (m, current_mode)) { CAT_TRACE ("rig_set_mode mode=" << rig_strrmode (new_mode)); m_->error_check (rig_set_mode (m_->rig_.data (), target_vfo, new_mode, RIG_PASSBAND_NOCHANGE), tr ("setting current VFO mode")); @@ -938,7 +900,16 @@ void HamlibTransceiver::do_frequency (Frequency f, MODE m, bool no_ignore) m_->error_check (rig_set_mode (m_->rig_.data (), target_vfo, new_mode, RIG_PASSBAND_NOCHANGE), tr ("setting current VFO mode")); } // set mode on VFOB too if we are in split - if (state ().split()) rig_set_mode (m_->rig_.data (), RIG_VFO_B, new_mode, RIG_PASSBAND_NOCHANGE), tr ("setting VFOB mode"); + if (state ().split ()) + { + rmode_t tx_mode; + pbwidth_t tx_width; + auto rc = rig_get_mode (m_->rig_.data (), RIG_VFO_B, &tx_mode, &tx_width); + if (RIG_OK != rc || HamlibMode::change_required (m, tx_mode)) + { + rig_set_mode (m_->rig_.data (), RIG_VFO_B, new_mode, RIG_PASSBAND_NOCHANGE); + } + } update_mode (m); } } @@ -946,12 +917,12 @@ void HamlibTransceiver::do_frequency (Frequency f, MODE m, bool no_ignore) void HamlibTransceiver::do_tx_frequency (Frequency tx, MODE mode, bool no_ignore) { - CAT_TRACE ("txf: " << tx << " reversed: " << m_->reversed_); + CAT_TRACE ("txf: " << tx << " reversed: " << m_->vfo_roles_.reversed ()); if (WSJT_RIG_NONE_CAN_SPLIT || !m_->is_dummy_) // split is meaningless if you can't see it { auto split = tx ? RIG_SPLIT_ON : RIG_SPLIT_OFF; - auto vfos = m_->get_vfos (tx); + auto vfos = m_->get_vfos (tx, state ().ptt () && state ().split ()); // auto rx_vfo = std::get<0> (vfos); // or use RIG_VFO_CURR auto tx_vfo = std::get<1> (vfos); @@ -999,11 +970,11 @@ void HamlibTransceiver::do_tx_frequency (Frequency tx, MODE mode, bool no_ignore { rmode_t current_mode; pbwidth_t current_width; - auto new_mode = m_->map_mode (mode); + auto new_mode = HamlibMode::to_hamlib (mode); m_->error_check (rig_get_mode (m_->rig_.data (), RIG_VFO_CURR, ¤t_mode, ¤t_width), tr ("getting current VFO mode")); CAT_TRACE ("rig_get_mode mode=" << rig_strrmode (current_mode) << " bw=" << current_width); - if (new_mode != current_mode) + if (HamlibMode::change_required (mode, current_mode)) { CAT_TRACE ("rig_set_mode mode=" << rig_strrmode (new_mode)); m_->error_check (rig_set_mode (m_->rig_.data (), RIG_VFO_CURR, new_mode, RIG_PASSBAND_NOCHANGE), tr ("setting current VFO mode")); @@ -1016,7 +987,22 @@ void HamlibTransceiver::do_tx_frequency (Frequency tx, MODE mode, bool no_ignore hamlib_tx_vfo_fixup fixup (m_->rig_.data (), tx_vfo); if (UNK != mode) { - auto new_mode = m_->map_mode (mode); + auto new_mode = HamlibMode::to_hamlib (mode); + rmode_t current_mode; + pbwidth_t current_width; + int rc; + if (state ().split ()) + { + rc = rig_get_split_mode (m_->rig_.data (), RIG_VFO_CURR, ¤t_mode, ¤t_width); + } + else + { + rc = rig_get_mode (m_->rig_.data (), tx_vfo, ¤t_mode, ¤t_width); + } + if (RIG_OK == rc && HamlibMode::satisfies_request (new_mode, current_mode)) + { + new_mode = current_mode; + } CAT_TRACE ("rig_set_split_freq_mode freq=" << tx << " mode = " << rig_strrmode (new_mode)); m_->error_check (rig_set_split_freq_mode (m_->rig_.data (), RIG_VFO_CURR, tx, new_mode, RIG_PASSBAND_NOCHANGE), tr ("setting split TX frequency and mode")); @@ -1061,16 +1047,16 @@ void HamlibTransceiver::do_mode (MODE mode) { CAT_TRACE (mode); - auto vfos = m_->get_vfos (state ().split ()); + auto vfos = m_->get_vfos (state ().split (), state ().ptt () && state ().split ()); // auto rx_vfo = std::get<0> (vfos); auto tx_vfo = std::get<1> (vfos); rmode_t current_mode; pbwidth_t current_width; - auto new_mode = m_->map_mode (mode); + auto new_mode = HamlibMode::to_hamlib (mode); vfo_t target_vfo = RIG_VFO_CURR; - if (!(m_->rig_->state.vfo_list & RIG_VFO_B)) + if (!has_vfo (m_->rig_.data (), RIG_VFO_B)) { target_vfo = RIG_VFO_MAIN; // no VFO A/B so force to Rx on MAIN } @@ -1081,7 +1067,7 @@ void HamlibTransceiver::do_mode (MODE mode) m_->error_check (rig_get_mode (m_->rig_.data (), target_vfo, ¤t_mode, ¤t_width), tr ("getting current VFO mode")); CAT_TRACE ("rig_get_mode mode=" << rig_strrmode (current_mode) << " bw=" << current_width); - if (new_mode != current_mode) + if (HamlibMode::change_required (mode, current_mode)) { CAT_TRACE ("rig_set_mode mode=" << rig_strrmode (new_mode)); m_->error_check (rig_set_mode (m_->rig_.data (), target_vfo, new_mode, RIG_PASSBAND_NOCHANGE), tr ("setting current VFO mode")); @@ -1094,7 +1080,7 @@ void HamlibTransceiver::do_mode (MODE mode) m_->error_check (rig_get_mode (m_->rig_.data (), RIG_VFO_CURR, ¤t_mode, ¤t_width), tr ("getting current VFO mode")); CAT_TRACE ("rig_get_mode mode=" << rig_strrmode (current_mode) << " bw=" << current_width); - if (new_mode != current_mode) + if (HamlibMode::change_required (mode, current_mode)) { CAT_TRACE ("rig_set_mode mode=" << rig_strrmode (new_mode)); m_->error_check (rig_set_mode (m_->rig_.data (), RIG_VFO_CURR, new_mode, RIG_PASSBAND_NOCHANGE), tr ("setting current VFO mode")); @@ -1105,7 +1091,7 @@ void HamlibTransceiver::do_mode (MODE mode) m_->error_check (rig_get_split_mode (m_->rig_.data (), RIG_VFO_CURR, ¤t_mode, ¤t_width), tr ("getting split TX VFO mode")); CAT_TRACE ("rig_get_split_mode mode=" << rig_strrmode (current_mode) << " bw=" << current_width); - if (new_mode != current_mode) + if (HamlibMode::change_required (mode, current_mode)) { CAT_TRACE ("rig_set_split_mode mode=" << rig_strrmode (new_mode)); hamlib_tx_vfo_fixup fixup (m_->rig_.data (), tx_vfo); @@ -1127,7 +1113,7 @@ void HamlibTransceiver::do_poll () vfo_t v; m_->error_check (rig_get_vfo (m_->rig_.data (), &v), tr ("getting current VFO")); // has side effect of establishing current VFO inside hamlib CAT_TRACE ("VFO=" << rig_strvfo (v)); - m_->reversed_ = RIG_VFO_B == v; + m_->vfo_roles_.observe_active_vfo (v, state ().ptt () && state ().split ()); } if ((WSJT_RIG_NONE_CAN_SPLIT || !m_->is_dummy_) @@ -1139,10 +1125,6 @@ void HamlibTransceiver::do_poll () { CAT_TRACE ("rig_get_split_vfo split=" << s << " VFO=" << rig_strvfo (v)); update_split (true); - // if (RIG_VFO_A == v) - // { - // m_->reversed_ = true; // not sure if this helps us here - // } } else if (-RIG_OK == rc) // not split { @@ -1181,11 +1163,8 @@ void HamlibTransceiver::do_poll () // we can only probe current VFO unless rig supports reading // the other one directly because we can't glitch the Rx - m_->error_check (rig_get_freq (m_->rig_.data () - , m_->reversed_ - ? (m_->rig_->state.vfo_list & RIG_VFO_A ? RIG_VFO_A : RIG_VFO_MAIN) - : (m_->rig_->state.vfo_list & RIG_VFO_B ? RIG_VFO_B : RIG_VFO_SUB) - , &f), tr ("getting other VFO frequency")); + auto vfos = m_->vfo_roles_.resolve (rx_vfo (m_->rig_.data ()), tx_vfo (m_->rig_.data ())); + m_->error_check (rig_get_freq (m_->rig_.data (), std::get<1> (vfos), &f), tr ("getting other VFO frequency")); f = std::round (f); CAT_TRACE ("rig_get_freq other VFO=" << f); update_other_frequency (f); @@ -1206,7 +1185,7 @@ void HamlibTransceiver::do_poll () if (RIG_OK == rc) { CAT_TRACE ("rig_get_mode mode=" << rig_strrmode (m) << " bw=" << w); - update_mode (m_->map_mode (m)); + update_mode (HamlibMode::from_hamlib (m)); } else { @@ -1214,7 +1193,7 @@ void HamlibTransceiver::do_poll () } } - if (RIG_PTT_NONE != m_->rig_->state.pttport.type.ptt && rig_get_function_ptr (m_->model_, RIG_FUNCTION_GET_PTT)) + if (ptt_port_configured (m_->rig_.data ()) && rig_get_function_ptr (m_->model_, RIG_FUNCTION_GET_PTT)) { ptt_t p; auto rc = rig_get_ptt (m_->rig_.data (), RIG_VFO_CURR, &p); @@ -1281,10 +1260,10 @@ void HamlibTransceiver::do_poll () void HamlibTransceiver::do_ptt (bool on) { - CAT_TRACE ("PTT: " << on << " " << state () << " reversed=" << m_->reversed_); + CAT_TRACE ("PTT: " << on << " " << state () << " reversed=" << m_->vfo_roles_.reversed ()); if (on) { - if (RIG_PTT_NONE != m_->rig_->state.pttport.type.ptt) + if (ptt_port_configured (m_->rig_.data ())) { ptt_on_ = true; CAT_TRACE ("rig_set_ptt PTT=true"); @@ -1296,7 +1275,7 @@ void HamlibTransceiver::do_ptt (bool on) } else { - if (RIG_PTT_NONE != m_->rig_->state.pttport.type.ptt) + if (ptt_port_configured (m_->rig_.data ())) { ptt_on_ = false; CAT_TRACE ("rig_set_ptt PTT=false"); @@ -1313,7 +1292,7 @@ void HamlibTransceiver::do_tune (bool on) CAT_TRACE ("Tune: " << on << " " << state ()); if (on) { - if (RIG_PTT_NONE != m_->rig_->state.pttport.type.ptt) + if (ptt_port_configured (m_->rig_.data ())) { update_PTT (true); // we'll change the PTT button while we do this CAT_TRACE ("rig_vfo_opt RIG_VFO_OP_TUNE=" << on); @@ -1325,7 +1304,7 @@ void HamlibTransceiver::do_tune (bool on) #if 0 else // do we need to be able to turn PTT off on anybody? { - if (RIG_PTT_NONE != m_->rig_->state.pttport.type.ptt) + if (ptt_port_configured (m_->rig_.data ())) { ptt_on_ = false; CAT_TRACE ("rig_set_ptt PTT=false"); diff --git a/Transceiver/HamlibTransceiver.hpp b/Transceiver/HamlibTransceiver.hpp index 101cbb9d..9300f64d 100644 --- a/Transceiver/HamlibTransceiver.hpp +++ b/Transceiver/HamlibTransceiver.hpp @@ -36,9 +36,9 @@ private: void do_poll () override; bool ptt_on_ = false; - bool do_pwr_; - bool do_pwr2_; - bool do_swr_; + bool do_pwr_ = false; + bool do_pwr2_= false; + bool do_swr_ = false; class impl; pimpl m_; diff --git a/Transceiver/HamlibVfoRoleState.hpp b/Transceiver/HamlibVfoRoleState.hpp new file mode 100644 index 00000000..c74d0ddf --- /dev/null +++ b/Transceiver/HamlibVfoRoleState.hpp @@ -0,0 +1,43 @@ +#ifndef HAMLIB_VFO_ROLE_STATE_HPP_ +#define HAMLIB_VFO_ROLE_STATE_HPP_ + +#include +#include + +#include + +class HamlibVfoRoleState final +{ +public: + void reset () noexcept + { + reversed_ = false; + } + + void observe_active_vfo (vfo_t active_vfo, bool split_ptt_active) noexcept + { + if (!split_ptt_active) + { + reversed_ = RIG_VFO_B == active_vfo; + } + } + + std::tuple resolve (vfo_t rx_vfo, vfo_t tx_vfo) const noexcept + { + if (reversed_) + { + std::swap (rx_vfo, tx_vfo); + } + return std::make_tuple (rx_vfo, tx_vfo); + } + + bool reversed () const noexcept + { + return reversed_; + } + +private: + bool reversed_ {false}; +}; + +#endif diff --git a/Transceiver/TCIProtocol.hpp b/Transceiver/TCIProtocol.hpp new file mode 100644 index 00000000..9dd2b3dd --- /dev/null +++ b/Transceiver/TCIProtocol.hpp @@ -0,0 +1,41 @@ +#ifndef TCI_PROTOCOL_HPP__ +#define TCI_PROTOCOL_HPP__ + +#include +#include + +namespace TciProtocol +{ + inline bool parse_frequency (QString const& text, quint64 * frequency) + { + if (!frequency || text.isEmpty ()) + { + return false; + } + + for (auto const character : text) + { + if (character < QLatin1Char {'0'} || character > QLatin1Char {'9'}) + { + return false; + } + } + + bool ok {false}; + auto const parsed = text.toULongLong (&ok, 10); + if (!ok) + { + return false; + } + + *frequency = parsed; + return true; + } + + inline bool frequency_difference_exceeds (quint64 lhs, quint64 rhs, quint64 threshold) + { + return lhs > rhs ? lhs - rhs > threshold : rhs - lhs > threshold; + } +} + +#endif diff --git a/Transceiver/TCIStream.hpp b/Transceiver/TCIStream.hpp new file mode 100644 index 00000000..5fbb468e --- /dev/null +++ b/Transceiver/TCIStream.hpp @@ -0,0 +1,170 @@ +#ifndef TCI_STREAM_HPP__ +#define TCI_STREAM_HPP__ + +#include +#include + +#include +#include +#include +#include + +namespace TciStream +{ + quint32 constexpr HeaderSize {16u * sizeof (quint32)}; + quint32 constexpr MaxFloatSamples {8192u}; + quint32 constexpr Float32Format {3u}; + quint32 constexpr UncompressedCodec {0u}; + quint32 constexpr DefaultChannels {2u}; + + struct Header + { + quint32 receiver; + quint32 sampleRate; + quint32 format; + quint32 codec; + quint32 crc; + quint32 length; + quint32 type; + quint32 channels; + quint32 reserved[8]; + }; + + static_assert (sizeof (Header) == HeaderSize, "TCI stream header must be 64 bytes"); + static_assert (offsetof (Header, length) == 20u, "TCI length field offset changed"); + static_assert (offsetof (Header, type) == 24u, "TCI type field offset changed"); + static_assert (offsetof (Header, channels) == 28u, "TCI channels field offset changed"); + static_assert (sizeof (float) == 4u, "TCI float32 streams require 32-bit float"); + + enum StreamType : quint32 + { + IqStream = 0u, + RxAudioStream, + TxAudioStream, + TxChrono, + }; + + inline bool checked_float_frame_size (quint32 scalar_count, int * size) + { + if (!size || scalar_count > MaxFloatSamples) + { + return false; + } + + auto const payload_bytes = static_cast (scalar_count) * sizeof (float); + auto const frame_bytes = static_cast (HeaderSize) + payload_bytes; + if (frame_bytes > static_cast ((std::numeric_limits::max) ())) + { + return false; + } + + *size = static_cast (frame_bytes); + return true; + } + + inline bool prepare_float_frame (QByteArray * frame, quint32 scalar_count) + { + int frame_size; + if (!frame || !checked_float_frame_size (scalar_count, &frame_size)) + { + return false; + } + + frame->resize (frame_size); + frame->fill ('\0'); + return true; + } + + inline Header * header (QByteArray * frame) + { + return frame && frame->size () >= static_cast (HeaderSize) + ? reinterpret_cast
(frame->data ()) : nullptr; + } + + inline Header const * header (QByteArray const& frame) + { + return frame.size () >= static_cast (HeaderSize) + ? reinterpret_cast
(frame.constData ()) : nullptr; + } + + inline float * float_payload (QByteArray * frame) + { + return header (frame) + ? reinterpret_cast (frame->data () + HeaderSize) : nullptr; + } + + inline float const * float_payload (QByteArray const& frame) + { + return header (frame) + ? reinterpret_cast (frame.constData () + HeaderSize) : nullptr; + } + + inline bool has_complete_float_payload (QByteArray const& frame, quint32 scalar_count) + { + int expected_size; + return checked_float_frame_size (scalar_count, &expected_size) + && frame.size () >= expected_size; + } + + inline bool protocol_has_channels (QString const& version) + { + auto const parsed = QVersionNumber::fromString (version); + return !parsed.isNull () + && QVersionNumber::compare (parsed, QVersionNumber {1, 9}) >= 0; + } + + inline quint32 channel_count (Header const& stream, bool channel_field_supported) + { + if (!channel_field_supported) + { + return DefaultChannels; + } + return stream.channels == 1u || stream.channels == 2u ? stream.channels : 0u; + } + + inline bool valid_tx_chrono (Header const& stream, bool channel_field_supported, + quint32 expected_sample_rate, quint32 * channels) + { + auto const count = channel_count (stream, channel_field_supported); + if (!channels || !count || stream.format != Float32Format + || stream.codec != UncompressedCodec || stream.sampleRate != expected_sample_rate + || stream.length > MaxFloatSamples || stream.length % count) + { + return false; + } + + *channels = count; + return true; + } + + inline bool prepare_tx_audio_frame (QByteArray * frame, Header const& chrono, + quint32 channels) + { + if ((channels != 1u && channels != 2u) || chrono.length % channels + || !prepare_float_frame (frame, chrono.length)) + { + return false; + } + + auto * response = header (frame); + response->receiver = chrono.receiver; + response->sampleRate = chrono.sampleRate; + response->format = Float32Format; + response->codec = UncompressedCodec; + response->length = chrono.length; + response->type = TxAudioStream; + response->channels = channels; + return true; + } + + inline float * write_channel_frame (float sample, quint32 channels, float * destination) + { + for (quint32 channel = 0u; channel < channels; ++channel) + { + *destination++ = sample; + } + return destination; + } +} + +#endif diff --git a/Transceiver/TCITransceiver.cpp b/Transceiver/TCITransceiver.cpp index 86d8e76e..5ee4bc0b 100644 --- a/Transceiver/TCITransceiver.cpp +++ b/Transceiver/TCITransceiver.cpp @@ -1,10 +1,16 @@ #include "Transceiver/TCITransceiver.hpp" +#include "Transceiver/TCIProtocol.hpp" #include -#include #include #include +#include +#include +#include +#include +#include + #if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) #include #endif @@ -18,12 +24,39 @@ #include #include #include +#include #include +#include + +#include "DecDataMutex.hpp" namespace { char const * const TCI_transceiver_1_name {"TCI Client RX1"}; char const * const TCI_transceiver_2_name {"TCI Client RX2"}; + // Exactly 1 MHz remains within the current band. + quint64 constexpr band_change_threshold_hz {1000000u}; + + bool has_required_args (QStringList const& args, int required) + { + return args.size () >= required; + } + + bool decimal_tenths (QString const& value, int * result) + { + auto const parts = value.split ('.'); + bool whole_ok {false}; + bool fractional_ok {false}; + int const whole = parts.value (0).toInt (&whole_ok); + int const fractional = parts.value (1).toInt (&fractional_ok); + if (!result || parts.size () < 2 || !whole_ok || !fractional_ok) + { + return false; + } + + *result = 10 * whole + fractional; + return true; + } QString map_mode (Transceiver::MODE mode) { @@ -31,11 +64,8 @@ namespace { case Transceiver::AM: return "am"; case Transceiver::CW: return "cw"; -// case Transceiver::CW_R: return "CW-R"; case Transceiver::USB: return "usb"; case Transceiver::LSB: return "lsb"; -// case Transceiver::FSK: return "RTTY"; -// case Transceiver::FSK_R: return "RTTY-R"; case Transceiver::DIG_L: return "digl"; case Transceiver::DIG_U: return "digu"; case Transceiver::FM: return "wfm"; @@ -51,7 +81,7 @@ namespace static const QString SmTrue("true"); static const QString SmFalse("false"); - // Command maps + // TCI command names static const QString CmdDevice("device"); static const QString CmdReceiveOnly("receive_only"); static const QString CmdTrxCount("trx_count"); @@ -112,9 +142,9 @@ namespace } extern "C" { - void fil4_(qint16*, qint32*, qint16*, qint32*, short int*); + void fil4_state_(qint16*, qint32*, qint16*, qint32*, float*); } -extern dec_data dec_data; +#include "ReceiveAudio.hpp" extern float gran(); // Noise generator (for tests only) @@ -134,11 +164,9 @@ void TCITransceiver::register_transceivers (logger_type *, TransceiverFactory::T (*registry)[TCI_transceiver_2_name] = TransceiverFactory::Capabilities {id2, TransceiverFactory::Capabilities::tci, true}; } -static constexpr quint32 AudioHeaderSize = 16u*sizeof(quint32); - TCITransceiver::TCITransceiver (logger_type * logger, std::unique_ptr wrapped,QString const& rignr, QString const& address, bool use_for_ptt, - int poll_interval, QObject * parent) + int poll_interval, QObject * parent, ReceiveClock receive_clock) : PollingTransceiver {logger, poll_interval, parent} , wrapped_ {std::move (wrapped)} , rx_ {rignr} @@ -191,7 +219,6 @@ TCITransceiver::TCITransceiver (logger_type * logger, std::unique_ptr 1) ? new short [max_buffer_size * m_downSampleFactor] : nullptr) @@ -200,12 +227,20 @@ TCITransceiver::TCITransceiver (logger_type * logger, std::unique_ptrsetInterval (25); + connect (m_jttyDrainTimer, &QTimer::timeout, this, &TCITransceiver::poll_jtty_drain); } void TCITransceiver::onConnected() @@ -288,7 +327,11 @@ void TCITransceiver::onError(QAbstractSocket::SocketError err) { qDebug() << "WebInThread::onError"; CAT_TRACE ("TCITransceiver entered TCI onError and ErrorNumber is " + QString::number(err) + '\n'); - error_ = tr ("TCI websocket error: %1").arg (errortable.at (err)); + auto const error_index = static_cast (err); + auto const error_name = error_index >= 0 && error_index < errortable.size () + ? errortable.at (error_index) + : tr ("UnknownSocketError"); + error_ = tr ("TCI websocket error: %1").arg (error_name); } int TCITransceiver::do_start () @@ -297,14 +340,13 @@ int TCITransceiver::do_start () CAT_TRACE ("TCITransceiver entered TCI do_start and tci_Ready is " + QString::number(tci_Ready) + '\n'); qDebug () << "qDebug says do_start tci_Ready is: " << tci_Ready; if (wrapped_) wrapped_->start (0); - url_.setUrl("ws://" + server_); //server_ + url_.setUrl("ws://" + server_); if (url_.host() == "") url_.setHost("localhost"); if (url_.port() == -1) url_.setPort(40001); if (!commander_) { - commander_ = new QWebSocket {}; // QObject takes ownership + commander_ = new QWebSocket {}; CAT_TRACE ("TCITransceiver entered TCI do_start and commander created\n"); - //printf ("commander created\n"); connect(commander_,SIGNAL(connected()),this,SLOT(onConnected())); connect(commander_,SIGNAL(disconnected()),this,SLOT(onDisconnected())); connect(commander_,SIGNAL(binaryMessageReceived(QByteArray)),this,SLOT(onBinaryReceived(QByteArray))); @@ -388,6 +430,7 @@ int TCITransceiver::do_start () tci_Ready = false; ESDR3 = false; HPSDR = false; + stream_channels_supported_ = false; band_change = false; trxA = 0; trxB = 0; @@ -428,19 +471,17 @@ int TCITransceiver::do_start () _power_ = false; CAT_TRACE ("TCITransceiver entered TCI do_start and url " + url_.toString() + " rig_power:" + QString::number(rig_power_) + " rig_power_off:" + QString::number(rig_power_off_) + " tci_audio:" + QString::number(tci_audio_) + " do_snr:" + QString::number(do_snr_) + " do_pwr:" + QString::number(do_pwr_) + '\n'); commander_->open (url_); - tci_done6(); - mysleep6(2000); + mysleep7(2000); busy_split_ = true; const QString cmd = CmdSplitEnable + SmDP + "false" + SmTZ; sendTextMessage(cmd); - //mysleep6(500); busy_split_ = false; if (error_.isEmpty()) { tci_Ready = true; if (!_power_) { if (rig_power_) { rig_power(true); - mysleep6(1000); + mysleep7(1000); if(!_power_) throw error {tr ("TCI SDR could not be switched on")}; } else { tci_Ready = false; @@ -456,7 +497,7 @@ int TCITransceiver::do_start () } if (tci_audio_) { stream_audio (true); - mysleep6(500); + mysleep7(500); if (!stream_audio_) { tci_Ready = false; throw error {tr ("TCI Audio could not be switched on")}; @@ -469,10 +510,6 @@ int TCITransceiver::do_start () const QString cmd = CmdSmeter + SmDP + rx_ + SmCM + "0" + SmTZ; sendTextMessage(cmd); } -// if (!requested_rx_frequency_.isEmpty()) do_frequency(string_to_frequency (requested_rx_frequency_),get_mode(true),false); -// if (!requested_other_frequency_.isEmpty()) do_tx_frequency(string_to_frequency (requested_other_frequency_),get_mode(true),false); -// else if (requested_split_ != split_) {rig_split();} - do_poll (); if (ESDR3) { const QString cmd = CmdTxSensorsEnable + SmDP + (do_pwr_ ? "true" : "false") + SmCM + "500" + SmTZ; @@ -495,20 +532,18 @@ int TCITransceiver::do_start () void TCITransceiver::do_stop () { CAT_TRACE ("TCITransceiver TCI close\n"); - //printf ("TCI close\n"); if (!commander_) return; if (stream_audio_ && tci_Ready && inConnected && _power_) { stream_audio (false); - mysleep1(500); + mysleep7(500); CAT_TRACE ("TCI audio closed\n"); - //printf ("TCI audio closed\n"); } if (tci_Ready && inConnected && _power_) { requested_other_frequency_ = ""; busy_split_ = true; const QString cmd = CmdSplitEnable + SmDP + "false" + SmTZ; sendTextMessage(cmd); - mysleep1(500); + mysleep5(500); busy_split_ = false; requested_split_ = false; rig_split(); @@ -521,7 +556,6 @@ void TCITransceiver::do_stop () rig_power(false); mysleep1(500); CAT_TRACE ("TCI power down\n"); - //printf ("TCI power down\n"); } tci_Ready = false; if (commander_) @@ -530,100 +564,85 @@ void TCITransceiver::do_stop () delete commander_, commander_ = nullptr; CAT_TRACE ("deleted commander & closed websocket & deleted:"); } + // The wait helpers are parent-owned and reused when the adapter restarts. if (tci_timer1_) { if (tci_timer1_->isActive()) tci_timer1_->stop(); - // tci_timer1_->deleteLater(), tci_timer1_ = nullptr; CAT_TRACE ("timer1 "); } if (tci_loop1_) { tci_loop1_->quit(); - // tci_loop1_->deleteLater(), tci_loop1_ = nullptr; CAT_TRACE ("loop1 "); } if (tci_timer2_) { if (tci_timer2_->isActive()) tci_timer2_->stop(); - // tci_timer2_->deleteLater(), tci_timer2_ = nullptr; CAT_TRACE ("timer2 "); } if (tci_loop2_) { tci_loop2_->quit(); - // tci_loop2_->deleteLater(), tci_loop2_ = nullptr; CAT_TRACE ("loop2 "); } if (tci_timer3_) { if (tci_timer3_->isActive()) tci_timer3_->stop(); - // tci_timer3_->deleteLater(), tci_timer3_ = nullptr; CAT_TRACE ("timer3 "); } if (tci_loop3_) { tci_loop3_->quit(); - // tci_loop3_->deleteLater(), tci_loop3_ = nullptr; CAT_TRACE ("loop3 "); } if (tci_timer4_) { if (tci_timer4_->isActive()) tci_timer4_->stop(); - // tci_timer4_->deleteLater(), tci_timer4_ = nullptr; CAT_TRACE ("timer4 "); } if (tci_loop4_) { tci_loop4_->quit(); - // tci_loop4_->deleteLater(), tci_loop4_ = nullptr; CAT_TRACE ("loop4 "); } if (tci_timer5_) { if (tci_timer5_->isActive()) tci_timer5_->stop(); - // tci_timer5_->deleteLater(), tci_timer5_ = nullptr; CAT_TRACE ("timer5 "); } if (tci_loop5_) { tci_loop5_->quit(); - // tci_loop5_->deleteLater(), tci_loop5_ = nullptr; CAT_TRACE ("loop5 "); } if (tci_timer6_) { if (tci_timer6_->isActive()) tci_timer6_->stop(); - // tci_timer6_->deleteLater(), tci_timer6_ = nullptr; CAT_TRACE ("timer6 "); } if (tci_loop6_) { tci_loop6_->quit(); - // tci_loop6_->deleteLater(), tci_loop6_ = nullptr; CAT_TRACE ("loop6 "); } if (tci_timer7_) { if (tci_timer7_->isActive()) tci_timer7_->stop(); - // tci_timer7_->deleteLater(), tci_timer7_ = nullptr; CAT_TRACE ("timer7 "); } if (tci_loop7_) { tci_loop7_->quit(); - // tci_loop7_->deleteLater(), tci_loop7_ = nullptr; CAT_TRACE ("loop7 "); } if (tci_timer8_) { if (tci_timer8_->isActive()) tci_timer8_->stop(); - // tci_timer8_->deleteLater(), tci_timer8_ = nullptr; CAT_TRACE ("timer8 "); } if (tci_loop8_) { tci_loop8_->quit(); - // tci_loop8_->deleteLater(), tci_loop8_ = nullptr; CAT_TRACE ("loop8 "); } @@ -637,6 +656,7 @@ void TCITransceiver::onMessageReceived(const QString &str) QStringList cmd_list = str.split(";", SkipEmptyParts); for (QString cmds : cmd_list){ QStringList cmd = cmds.split(":", SkipEmptyParts); + if (cmd.isEmpty ()) continue; QStringList args = cmd.last().split(",", SkipEmptyParts); Tci_Cmd idCmd = mapCmd_[cmd.first()]; if (idCmd != Cmd_Power && idCmd != Cmd_SWR && idCmd != Cmd_Smeter && idCmd != Cmd_AppFocus && idCmd != Cmd_RxSensors && idCmd != Cmd_TxSensors) { printf("%s TCI message received:|%s| ",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),str.toStdString().c_str()); printf("idCmd : %d args : %s\n",idCmd,args.join("|").toStdString().c_str());} @@ -645,53 +665,87 @@ void TCITransceiver::onMessageReceived(const QString &str) switch (idCmd) { case Cmd_Smeter: + if (!has_required_args (args, 3)) break; if(args.at(0)==rx_ && args.at(1) == "0") level_ = args.at(2).toInt() + 73; break; case Cmd_RxSensors: + if (!has_required_args (args, 2)) break; if(args.at(0)==rx_) level_ = args.at(1).split(".")[0].toInt() + 73; printf("Smeter=%d\n",level_); break; case Cmd_TxSensors: + if (!has_required_args (args, 5)) break; if(args.at(0)==rx_) { - power_ = 10 * args.at(3).split(".")[0].toInt() + args.at(3).split(".")[1].toInt(); - swr_ = 10 * args.at(4).split(".")[0].toInt() + args.at(4).split(".")[1].toInt(); + int power; + int swr; + if (!decimal_tenths (args.at (3), &power) || + !decimal_tenths (args.at (4), &swr)) break; + power_ = power; + swr_ = swr; printf("Power=%d SWR=%d\n",power_,swr_); } break; case Cmd_SWR: + if (!has_required_args (args, 1)) break; printf("%s Cmd_SWR : %s\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),args.join("|").toStdString().c_str()); - swr_ = 10 * args.at(0).split(".")[0].toInt() + args.at(0).split(".")[1].toInt(); + { + int swr; + if (!decimal_tenths (args.at (0), &swr)) break; + swr_ = swr; + } break; case Cmd_Power: - power_ = 10 * args.at(0).split(".")[0].toInt() + args.at(0).split(".")[1].toInt(); + if (!has_required_args (args, 1)) break; + { + int power; + if (!decimal_tenths (args.at (0), &power)) break; + power_ = power; + } printf("%s Cmd_Power : %s %d\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),args.join("|").toStdString().c_str(),power_); break; case Cmd_VFO: + { printf("%s Cmd_VFO : %s\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),args.join("|").toStdString().c_str()); - printf("band_change:%d busy_other_frequency_:%d timer1_remaining:%d timer2_remaining:%d",band_change,busy_other_frequency_,tci_timer7_->remainingTime(),tci_timer2_->remainingTime()); //was timer1 and timer2 - if(args.at(0)==rx_ && args.at(1) == "0") { - if (args.at(2).left(1) != "-") rx_frequency_ = args.at(2); + printf("band_change:%d busy_other_frequency_:%d timer1_remaining:%d timer2_remaining:%d",band_change,busy_other_frequency_,tci_timer7_->remainingTime(),tci_timer2_->remainingTime()); + if (!has_required_args (args, 1) || args.at (0) != rx_) break; + if (!has_required_args (args, 3) + || (args.at (1) != "0" && args.at (1) != "1")) + { + error_ = tr ("TCI sent an invalid VFO frequency"); + CAT_TRACE (error_); + break; + } + Frequency received_frequency; + if (!TciProtocol::parse_frequency (args.at (2), &received_frequency)) + { + error_ = tr ("TCI sent an invalid VFO frequency"); + CAT_TRACE (error_ + ": " + args.at (2)); + break; + } + auto const received_frequency_text = QString::number (received_frequency); + if(args.at(1) == "0") { + rx_frequency_ = received_frequency_text; CAT_TRACE("Rx VFO Frequency from SDR is :"); CAT_TRACE(rx_frequency_); if (!tci_Ready && requested_rx_frequency_.isEmpty()) requested_rx_frequency_ = rx_frequency_; if (busy_rx_frequency_ && !band_change) { printf (" cmdvfo0 done1"); - tci_done7(); //was tci_done1 (do_frequency) + tci_done7(); } else if (!tci_timer2_->isActive() && split_) { printf (" cmdvfo0 timer2 start 210"); tci_timer2_->start(210); } } - else if (args.at(0)==rx_ && args.at(1) == "1") { - if (args.at(2).left(1) != "-") other_frequency_ = args.at(2); + else { + other_frequency_ = received_frequency_text; CAT_TRACE("Tx VFO (other) Frequency from SDR is :"); CAT_TRACE(other_frequency_); if (!tci_Ready && requested_other_frequency_.isEmpty()) requested_other_frequency_ = other_frequency_; - if (band_change && tci_timer7_->isActive()) { //was tci_timer1 + if (band_change && tci_timer7_->isActive()) { printf (" cmdvfo1 done1"); band_change = false; tci_timer2_->start(210); - tci_done7(); //was tci_done1 (do_frequency) + tci_done7(); } else if (busy_other_frequency_) { printf (" cmdvfo1 done2"); tci_done2(); @@ -704,11 +758,18 @@ void TCITransceiver::onMessageReceived(const QString &str) } } break; + } case Cmd_Mode: printf("%s Cmd_Mode : %s\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),args.join("|").toStdString().c_str()); + if (!has_required_args (args, 2)) break; if(args.at(0)==rx_) { if (ESDR3 || HPSDR) { - if (args.at(1) == "0" ) mode_ = args.at(2).toLower(); else mode_ = args.at(1).toLower(); + if (args.at(1) == "0" ) { + if (!has_required_args (args, 3)) break; + mode_ = args.at(2).toLower(); + } else { + mode_ = args.at(1).toLower(); + } } else mode_ = args.at(1); if (started_mode_.isEmpty()) started_mode_ = mode_; if (busy_mode_) { @@ -722,20 +783,22 @@ void TCITransceiver::onMessageReceived(const QString &str) break; case Cmd_SplitEnable: printf("%s Cmd_SplitEnable : %s\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),args.join("|").toStdString().c_str()); + if (!has_required_args (args, 2)) break; if(args.at(0)==rx_) { if (args.at(1) == "false") split_ = false; else if (args.at(1) == "true") split_ = true; if (!tci_Ready) {started_split_ = split_;} - else if (busy_split_) tci_done5(); //was tci_done2 - else if (requested_split_ != split_ && !tci_timer5_->isActive()) { //was tci_timer2 + else if (busy_split_) tci_done5(); + else if (requested_split_ != split_ && !tci_timer5_->isActive()) { CAT_TRACE("tci_timer5 started in onMessageReceived-Cmd_SplitEnable"); - tci_timer5_->start(210); //was tci_timer2 + tci_timer5_->start(210); rig_split(); } } break; case Cmd_Drive: printf("%s Cmd_Drive : %s\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),args.join("|").toStdString().c_str()); + if ((!ESDR3 && !HPSDR && !has_required_args (args, 1)) || ((ESDR3 || HPSDR) && !has_required_args (args, 2))) break; if((!ESDR3 && !HPSDR) || args.at(0)==rx_) { if (ESDR3 || HPSDR) drive_ = args.at(1); else drive_ = args.at(0); if (requested_drive_.isEmpty()) requested_drive_ = drive_; @@ -746,6 +809,7 @@ void TCITransceiver::onMessageReceived(const QString &str) break; case Cmd_Trx: printf("%s Cmd_Trx : %s\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),args.join("|").toStdString().c_str()); + if (!has_required_args (args, 2)) break; if(args.at(0)==rx_) { if (args.at(1) == "false") PTT_ = false; else if (args.at(1) == "true") PTT_ = true; @@ -760,16 +824,18 @@ void TCITransceiver::onMessageReceived(const QString &str) break; case Cmd_AudioStart: printf("%s Cmd_AudioStart : %s\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),args.join("|").toStdString().c_str()); + if (!has_required_args (args, 1)) break; if(args.at(0)==rx_) { stream_audio_ = true; if (tci_Ready) { printf ("cmdaudiostart done1\n"); - tci_done7(); //was tci_done1 (do_frequency) + tci_done7(); } } break; case Cmd_RxEnable: printf("%s Cmd_RxEnable : %s\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),args.join("|").toStdString().c_str()); + if (!has_required_args (args, 2)) break; if(args.at(0)=="1") { if (args.at(1) == "false") rx2_ = false; else if (args.at(1) == "true") rx2_ = true; @@ -781,11 +847,12 @@ void TCITransceiver::onMessageReceived(const QString &str) break; case Cmd_AudioStop: printf("%s CmdAudioStop : %s\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),args.join("|").toStdString().c_str()); + if (!has_required_args (args, 1)) break; if(args.at(0)==rx_) { stream_audio_ = false; if (tci_Ready) { printf ("cmdaudiostop done1\n"); - tci_done7(); //was tci_done1 (do_frequency) + tci_done7(); } } break; @@ -794,7 +861,7 @@ void TCITransceiver::onMessageReceived(const QString &str) _power_ = true; printf ("cmdstart done1\n"); if (tci_Ready) { - tci_done7(); //was tci_done1 (do_frequency) + tci_done7(); } break; case Cmd_Stop: @@ -806,10 +873,11 @@ void TCITransceiver::onMessageReceived(const QString &str) power_ = 0; if (do_pwr_) update_power (0); swr_ = 0; if (do_pwr_) update_swr (0); m_state = Idle; + if (m_jttyDrainTimer && m_jttyDrainTimer->isActive ()) m_jttyDrainTimer->stop (); Q_EMIT tci_mod_active(m_state != Idle); } _power_ = false; - if (tci_timer1_->isActive()) { //was tci_timer1 + if (tci_timer1_->isActive()) { printf ("cmdstop done1\n"); tci_done1(); } else { @@ -818,17 +886,21 @@ void TCITransceiver::onMessageReceived(const QString &str) break; case Cmd_Version: printf("%s CmdVersion : %s\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),args.join("|").toStdString().c_str()); + if (!has_required_args (args, 1)) break; if(args.at(0)=="ExpertSDR3") ESDR3 = true; else if (args.at(0)=="Thetis") HPSDR = true; + stream_channels_supported_ = has_required_args (args, 2) + && TciStream::protocol_has_channels (args.at (1)); break; case Cmd_Device: printf("%s CmdDevice : %s\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),args.join("|").toStdString().c_str()); + if (!has_required_args (args, 1)) break; if((args.at(0)=="SunSDR2DX" || args.at(0)=="SunSDR2PRO") && !ESDR3) tx_top_ = false; printf ("tx_top_:%d\n",tx_top_); break; case Cmd_Ready: printf("%s CmdReady : %s\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),args.join("|").toStdString().c_str()); - tci_done7(); //was tci_done1 (do_frequency) + tci_done7(); break; default: @@ -847,11 +919,18 @@ void TCITransceiver::sendTextMessage(const QString &message) void TCITransceiver::onBinaryReceived(const QByteArray &data) { - Data_Stream *pStream = (Data_Stream*)(data.data()); + auto const * pStream = TciStream::header (data); + if (!pStream) { + return; + } + if (pStream->type != last_type) { last_type = pStream->type; } - if (pStream->type == Iq_Stream){ + if (pStream->type == TciStream::IqStream){ + if (!TciStream::has_complete_float_payload (data, pStream->length)) { + return; + } bool tx = false; if (pStream->receiver == 0){ tx = trxA == 0; @@ -862,125 +941,220 @@ void TCITransceiver::onBinaryReceived(const QByteArray &data) trxB = 1; } printf("sendIqData\n"); - emit sendIqData(pStream->receiver,pStream->length,pStream->data,tx); + emit sendIqData(pStream->receiver,pStream->length, + const_cast (TciStream::float_payload (data)),tx); qDebug() << "IQ" << data.size() << pStream->length; - } else if (pStream->type == RxAudioStream && audio_ && pStream->receiver == rx_.toUInt()) { - writeAudioData(pStream->data,pStream->length); - } else if (pStream->type == TxChrono && pStream->receiver == rx_.toUInt()) { - mtx_.lock(); tx_fifo += 1; tx_fifo &= 7; - int ssize = AudioHeaderSize+pStream->length*sizeof(float)*2; - quint16 tehtud; - if (m_tx1[tx_fifo].size() != ssize) m_tx1[tx_fifo].resize(ssize); - Data_Stream * pOStream1 = (Data_Stream*)(m_tx1[tx_fifo].data()); - pOStream1->receiver = pStream->receiver; - pOStream1->sampleRate = pStream->sampleRate; - pOStream1->format = pStream->format; - pOStream1->codec = 0; - pOStream1->crc = 0; - pOStream1->length = pStream->length; - pOStream1->type = TxAudioStream; - tehtud = readAudioData(pOStream1->data,pOStream1->length, txAtten); - if (tehtud && tehtud != pOStream1->length) { - quint16 valmis = tehtud; - tehtud = readAudioData(pOStream1->data + valmis,pOStream1->length - valmis,txAtten); + } else if (pStream->type == TciStream::RxAudioStream && audio_ && pStream->receiver == rx_.toUInt()) { + if (!TciStream::has_complete_float_payload (data, pStream->length)) { + return; + } + writeAudioData(const_cast (TciStream::float_payload (data)),pStream->length); + } else if (pStream->type == TciStream::TxChrono && pStream->receiver == rx_.toUInt()) { + quint32 channels; + if (!TciStream::valid_tx_chrono (*pStream, stream_channels_supported_, + audioSampleRate, &channels)) { + return; + } + + qint64 generatedScalars {0}; + { + std::lock_guard lock {mtx_}; + tx_fifo += 1; tx_fifo &= 7; + if (!TciStream::prepare_tx_audio_frame (&m_tx1[tx_fifo], *pStream, channels)) { + return; + } + + auto * response = TciStream::header (&m_tx1[tx_fifo]); + auto * payload = TciStream::float_payload (&m_tx1[tx_fifo]); + auto generated = readAudioData (payload, response->length, channels, txAtten); + generatedScalars = generated; + if (generated < response->length) { + generatedScalars += readAudioData (payload + generated, + response->length - generated, + channels, txAtten); + } + tx_fifo2 = tx_fifo; } - tx_fifo2 = tx_fifo; mtx_.unlock(); + if (!inConnected || commander_->sendBinaryMessage(m_tx1[tx_fifo2]) != m_tx1[tx_fifo2].size()) { + return; } + + // A generated source frame is committed only when its containing WebSocket + // response is sent completely; protocol padding past the source extent is + // not evidence that omitted source audio reached the radio. + qint64 const frames = TxEvidence::interleavedFrameCount (generatedScalars, + int (channels)); + m_tciSuccessfullyWrittenFrames += frames; + emit_tci_playout_snapshot (false, m_state == Idle); } } void TCITransceiver::txAudioData(quint32 len, float * data) { + if (len % TciStream::DefaultChannels || (len && !data)) { + return; + } + + TciStream::Header chrono {}; + chrono.receiver = 0u; + chrono.sampleRate = audioSampleRate; + chrono.length = len; QByteArray tx; - tx.resize(AudioHeaderSize+len*sizeof(float)*2); - Data_Stream * pStream = (Data_Stream*)(tx.data()); - pStream->receiver = 0; - pStream->sampleRate = audioSampleRate; - pStream->format = 3; - pStream->codec = 0; - pStream->crc = 0; - pStream->length = len; - pStream->type = TxAudioStream; - memcpy(pStream->data,data,len*sizeof(float)*2); + if (!TciStream::prepare_tx_audio_frame (&tx, chrono, TciStream::DefaultChannels)) { + return; + } + + if (len) { + std::memcpy (TciStream::float_payload (&tx), data, len * sizeof (float)); + } commander_->sendBinaryMessage(tx); } +void TCITransceiver::enqueue_jtty_pcm (QByteArray const& samples, + TxAudioQueueEpoch epoch, + qint64 enqueueId) noexcept +{ + qint64 const count = samples.size () / int (sizeof (qint16)); + if (count <= 0) return; + + qint16 const * pcm = reinterpret_cast (samples.constData ()); + auto const result = m_txAudioQueue.enqueue (pcm, count, epoch); + if (!result.accepted) + { + if (epoch == result.progress.epoch) + { + CAT_WARNING ("JTTY TCI transmit FIFO overflow; rejecting PCM enqueue\n"); + } + else + { + CAT_DEBUG ("JTTY TCI transmit queue epoch changed; rejecting stale PCM enqueue\n"); + } + Q_EMIT jtty_enqueue_failed (epoch, enqueueId); + return; + } + Q_EMIT jtty_enqueue_accepted (enqueueId, count, result.progress); +} + +void TCITransceiver::clear_jtty_pcm (TxAudioQueueEpoch epoch) noexcept +{ + m_txAudioQueue.clear (epoch); +} + +void TCITransceiver::poll_jtty_drain () +{ + // TCI audio is pulled while responding to TxChrono packets. Emitting the + // completion signal here keeps Qt work out of that packet/audio path. + auto const drain = m_txAudioQueue.takeDrainReady (); + if (drain.ready) + { + Q_EMIT jtty_drained (drain); + } +} + +void TCITransceiver::clear () +{ + m_receiveAudioProducer.reset (m_period); + m_bufferPos = 0; +} + quint32 TCITransceiver::writeAudioData (float * data, qint32 maxSize) { - static unsigned mstr0=999999; - qint64 ms0 = QDateTime::currentMSecsSinceEpoch() % 86400000; + if (dec_data_input_blocked ()) return maxSize; + + QVector frame_counts; + QVector audio; + qint64 ms0 = (receive_clock_ ? receive_clock_ () + : QDateTime::currentMSecsSinceEpoch ()) % 86400000; unsigned mstr = ms0 % int(1000.0*m_period); // ms into the nominal Tx start time - if(mstr < mstr0/2) { //When mstr has wrapped around to 0, restart the buffer - dec_data.params.kin = 0; - m_bufferPos = 0; - } - mstr0=mstr; - if(data != NULL) { - // block below adjusts receive audio attenuation - quint64 i = 0; - float * data1 = (float*)malloc(maxSize * sizeof(float)); - for(i=0;i<(quint64)maxSize;i++) { - data1[i] = ((float)(pow(10, 0.05*rxAtten) * data[i])); + if(data == NULL) { + QMutexLocker lock {&dec_data_mutex ()}; + if (dec_data_input_blocked ()) return maxSize; + if(mstr < m_lastPeriodOffsetMs/2) { //When mstr has wrapped around to 0, restart the buffer + clear (); + } + m_lastPeriodOffsetMs=mstr; + return maxSize; // we drop any data past the end of the buffer on + // the floor until the next period starts } - // no torn frames - Q_ASSERT (!(maxSize % static_cast (bytesPerFrame))); + double const receiveGain = std::pow (10.0, 0.05 * rxAtten); - // these are in terms of input frames (not down sampled) - size_t framesAcceptable ((sizeof (dec_data.d2) / - sizeof (dec_data.d2[0]) - dec_data.params.kin) * m_downSampleFactor); - size_t framesAccepted (qMin (static_cast (maxSize / - bytesPerFrame), framesAcceptable)); + { + QMutexLocker lock {&dec_data_mutex ()}; + auto& producer = m_receiveAudioProducer.data (); + if (dec_data_input_blocked ()) return maxSize; - if (framesAccepted < static_cast (maxSize / bytesPerFrame)) { - qDebug () << "dropped " << maxSize / bytesPerFrame - framesAccepted - << " frames of data on the floor!" - << dec_data.params.kin << mstr; - } + if(mstr < m_lastPeriodOffsetMs/2) { //When mstr has wrapped around to 0, restart the buffer + clear (); + } + m_lastPeriodOffsetMs=mstr; - for (unsigned remaining = framesAccepted; remaining; ) { - size_t numFramesProcessed (qMin (m_samplesPerFFT * - m_downSampleFactor - m_bufferPos, remaining)); + // no torn frames + Q_ASSERT (!(maxSize % static_cast (rxChannels))); - if(m_downSampleFactor > 1) { - store (&data1[(framesAccepted - remaining) * bytesPerFrame], - numFramesProcessed, &m_buffer[m_bufferPos]); - m_bufferPos += numFramesProcessed; + // these are in terms of input frames (not down sampled) + size_t framesAcceptable ((sizeof producer.d2 / + sizeof producer.d2[0] - m_receiveAudioProducer.frames ()) * m_downSampleFactor); + size_t framesAccepted (qMin (static_cast (maxSize / + rxChannels), framesAcceptable)); - if(m_bufferPos==m_samplesPerFFT*m_downSampleFactor) { - qint32 framesToProcess (m_samplesPerFFT * m_downSampleFactor); - qint32 framesAfterDownSample (m_samplesPerFFT); - if(m_downSampleFactor > 1 && dec_data.params.kin>=0 && - dec_data.params.kin < (NTMAX*12000 - framesAfterDownSample)) { - fil4_(&m_buffer[0], &framesToProcess, &dec_data.d2[dec_data.params.kin], - &framesAfterDownSample, &dec_data.d2[dec_data.params.kin]); - dec_data.params.kin += framesAfterDownSample; - } else { - qDebug() << "framesToProcess = " << framesToProcess; - qDebug() << "dec_data.params.kin = " << dec_data.params.kin; - qDebug() << "framesAfterDownSample" << framesAfterDownSample; + if (framesAccepted < static_cast (maxSize / rxChannels)) { + qDebug () << "dropped " << maxSize / rxChannels - framesAccepted + << " frames of data on the floor!" + << m_receiveAudioProducer.frames () << mstr; + } + + for (unsigned remaining = framesAccepted; remaining; ) { + size_t numFramesProcessed (qMin (m_samplesPerFFT * + m_downSampleFactor - m_bufferPos, remaining)); + + if(m_downSampleFactor > 1) { + store (&data[(framesAccepted - remaining) * rxChannels], + numFramesProcessed, &m_buffer[m_bufferPos], receiveGain); + m_bufferPos += numFramesProcessed; + + if(m_bufferPos==m_samplesPerFFT*m_downSampleFactor) { + qint32 framesToProcess (m_samplesPerFFT * m_downSampleFactor); + qint32 framesAfterDownSample (m_samplesPerFFT); + if(m_downSampleFactor > 1 && m_receiveAudioProducer.frames ()>=0 && + m_receiveAudioProducer.frames () < (NTMAX*12000 - framesAfterDownSample)) { + fil4_state_(&m_buffer[0], &framesToProcess, + &producer.d2[m_receiveAudioProducer.frames ()], + &framesAfterDownSample, m_downsampleState.data ()); + m_receiveAudioProducer.setFrames (m_receiveAudioProducer.frames () + framesAfterDownSample); + } else { + qDebug() << "framesToProcess = " << framesToProcess; + qDebug() << "receive audio frames = " << m_receiveAudioProducer.frames (); + qDebug() << "framesAfterDownSample" << framesAfterDownSample; + } + frame_counts << m_receiveAudioProducer.frames (); + audio << m_receiveAudioProducer.capture (m_receiveAudioProducer.frames (), m_period); + m_bufferPos = 0; } - Q_EMIT tciframeswritten (dec_data.params.kin); - m_bufferPos = 0; - } - } else { - store (&data1[(framesAccepted - remaining) * bytesPerFrame], - numFramesProcessed, &dec_data.d2[dec_data.params.kin]); - m_bufferPos += numFramesProcessed; - dec_data.params.kin += numFramesProcessed; - if (m_bufferPos == static_cast (m_samplesPerFFT)) { - Q_EMIT tciframeswritten (dec_data.params.kin); - m_bufferPos = 0; + } else { + store (&data[(framesAccepted - remaining) * rxChannels], + numFramesProcessed, &producer.d2[m_receiveAudioProducer.frames ()], + receiveGain); + m_bufferPos += numFramesProcessed; + m_receiveAudioProducer.setFrames (m_receiveAudioProducer.frames () + numFramesProcessed); + if (m_bufferPos == static_cast (m_samplesPerFFT)) { + frame_counts << m_receiveAudioProducer.frames (); + audio << m_receiveAudioProducer.capture (m_receiveAudioProducer.frames (), m_period); + m_bufferPos = 0; + } } + remaining -= numFramesProcessed; } - remaining -= numFramesProcessed; } - free(data1); -} + for (auto frames : frame_counts) { + Q_EMIT tciframeswritten (frames); + } + for (auto const& block : audio) Q_EMIT receiveAudio (block); + return maxSize; // we drop any data past the end of the buffer on // the floor until the next period starts } @@ -1044,8 +1218,9 @@ void TCITransceiver::do_audio (bool on) { TRACE_CAT ("TCITransceiver", on << state ()); if (on) { - dec_data.params.kin = 0; + QMutexLocker lock {&dec_data_mutex ()}; m_bufferPos = 0; + if (!dec_data_input_blocked ()) clear (); } audio_ = on; } @@ -1053,7 +1228,12 @@ void TCITransceiver::do_audio (bool on) void TCITransceiver::do_period (double period) { TRACE_CAT ("TCITransceiver", period << state ()); - m_period = period; + if (m_period != period) + { + QMutexLocker lock {&dec_data_mutex ()}; + m_period = period; + if (!dec_data_input_blocked ()) clear (); + } } void TCITransceiver::do_volume (qreal volume) @@ -1130,14 +1310,14 @@ void TCITransceiver::do_frequency (Frequency f, MODE m, bool no_ignore) if (tci_Ready && _power_) { if ((rx_frequency_ != requested_rx_frequency_)) { busy_rx_frequency_ = true; - band_change = abs(rx_frequency_.toInt()-requested_rx_frequency_.toInt()) > 1000000; + band_change = TciProtocol::frequency_difference_exceeds ( + string_to_frequency (rx_frequency_), f, band_change_threshold_hz); const QString cmd = CmdVFO + SmDP + rx_ + SmCM + "0" + SmCM + requested_rx_frequency_ + SmTZ; if(f > 100000 && f< 250000000000) sendTextMessage(cmd); mysleep7(2000); - // if (band_change) mysleep7(500); - band_change2 = abs(rx_frequency_.toInt()-requested_rx_frequency_.toInt()) > 1000000; + band_change2 = TciProtocol::frequency_difference_exceeds ( + string_to_frequency (rx_frequency_), f, band_change_threshold_hz); if (!band_change2) update_rx_frequency (f); - //if (requested_rx_frequency_ == rx_frequency_) update_rx_frequency (f); else { printf("%s TCI failed set rxfreq:%s->%s\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),rx_frequency_.toStdString().c_str(),requested_rx_frequency_.toStdString().c_str()); error_ = tr ("TCI failed set rxfreq"); @@ -1160,8 +1340,6 @@ void TCITransceiver::do_frequency (Frequency f, MODE m, bool no_ignore) else { printf("%s TCI failed set mode %s->%s",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),mode_.toStdString().c_str(),requested_mode_.toStdString().c_str()); error_ = tr ("TCI failed set mode"); - // tci_Ready = false; - // throw error {tr ("TCI failed set mode")}; } busy_mode_ = false; } @@ -1202,15 +1380,12 @@ void TCITransceiver::do_tx_frequency (Frequency tx, MODE mode, bool no_ignore) const QString cmd = CmdVFO + SmDP + rx_ + SmCM + "1" + SmCM + requested_other_frequency_ + SmTZ; if(tx > 100000 && tx < 250000000000) sendTextMessage(cmd); mysleep2(1000); - other_band_change = abs(other_frequency_.toInt()-requested_other_frequency_.toInt()) > 1000000; + other_band_change = TciProtocol::frequency_difference_exceeds ( + string_to_frequency (other_frequency_), tx, band_change_threshold_hz); if (!other_band_change) update_other_frequency (tx); - // if (requested_other_frequency_ == other_frequency_) update_other_frequency (tx); else { printf("%s TCI failed set txfreq:%s->%s\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),other_frequency_.toStdString().c_str(),requested_other_frequency_.toStdString().c_str()); CAT_TRACE("TCI failed set txfreq"); - // error_ = tr ("TCI failed set txfreq"); - // tci_Ready = false; - // throw error {tr ("TCI failed set txfreq")}; } busy_other_frequency_ = false; } else update_other_frequency (string_to_frequency (other_frequency_)); @@ -1239,7 +1414,6 @@ void TCITransceiver::do_tx_frequency (Frequency tx, MODE mode, bool no_ignore) } } -//do_mode is never called. void TCITransceiver::do_mode (MODE m) { TRACE_CAT ("TCITransceiver", m << state ()); @@ -1253,8 +1427,6 @@ void TCITransceiver::do_mode (MODE m) else { printf("%s TCI failed set mode %s->%s",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),mode_.toStdString().c_str(),requested_mode_.toStdString().c_str()); error_ = tr ("TCI failed set mode"); - // tci_Ready = false; - // throw error {tr ("TCI failed set mode")}; } busy_mode_ = false; } @@ -1356,55 +1528,30 @@ auto TCITransceiver::get_mode (bool requested) -> MODE QString TCITransceiver::mode_to_command (QString m_string) const { - // if (ESDR3) { - // const QString cmd = CmdMode + SmDP + rx_ + SmCM + m_string.toUpper() + SmTZ; - // return cmd; - // } else { const QString cmd = CmdMode + SmDP + rx_ + SmCM + m_string + SmTZ; return cmd; - // } } QString TCITransceiver::frequency_to_string (Frequency f) const { - // number is localized and in kHz, avoid floating point translation - // errors by adding a small number (0.1Hz) + // Frequency is an integer number of hertz, so decimal conversion is locale-independent. auto f_string = QString {}.setNum(f); printf ("frequency_to_string3 |%s|\n",f_string.toStdString().c_str()); return f_string; } -auto TCITransceiver::string_to_frequency (QString s) const -> Frequency +auto TCITransceiver::string_to_frequency (QString const& s) const -> Frequency { - // temporary hack because Commander is returning invalid UTF-8 bytes - s.replace (QChar {QChar::ReplacementCharacter}, locale_.groupSeparator ()); - - bool ok; - - auto f = QLocale::c ().toDouble (s, &ok); // temporary fix - - if (!ok) - { - printf("Frequency rejected is ***%s***\n",s.toStdString().c_str()); - // throw error {tr ("TCI sent an unrecognized frequency") + " |" + s + "|"}; - } - return f; + Frequency frequency; + if (!TciProtocol::parse_frequency (s, &frequency)) + { + throw error {tr ("TCI sent an invalid VFO frequency")}; + } + return frequency; } -/* - * mysleep1 is used in do_stop - * mysleep2 is used in do_tx_frequency - * mysleep3 is used in do_ptt - * mysleep4 is used in rx2_enable - * mysleep5 is used in rig_split - * mysleep6 is used in do_start - * mysleep7 is used in do_frequency - * mysleep8 is used in do_mode which is never called - * */ - void TCITransceiver::mysleep1 (int ms) { - //printf("%s TCI sleep1 start %d %d\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),ms,tci_timer1_->isActive()); if (ms) tci_timer1_->start(ms); tci_loop1_->exec(); if (tci_timer1_->isActive() && tci_Ready) tci_timer1_->stop(); @@ -1454,39 +1601,40 @@ void TCITransceiver::mysleep8 (int ms) } // Modulator part -void TCITransceiver::do_modulator_start (QString mode, unsigned symbolsLength, double framesPerSymbol, - double frequency, double toneSpacing, bool synchronize, bool fastMode, double dBSNR, double TRperiod) +void TCITransceiver::do_modulator_start (TxEvidence::TxRequest const& request) { // Time according to this computer which becomes our base time qint64 ms0 = QDateTime::currentMSecsSinceEpoch() % 86400000; qDebug() << "ModStart" << QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.sss"); unsigned mstr = ms0 % int(1000.0*m_period); // ms into the nominal Tx start time if (m_state != Idle) { - // stop (); throw error {tr ("TCI modulator not Idle")}; } m_quickClose = false; - m_symbolsLength = symbolsLength; + m_txMode = request.mode; + m_symbolsLength = request.symbols_length; m_isym0 = std::numeric_limits::max (); // big number m_frequency0 = 0.; m_phi = 0.; - m_addNoise = dBSNR < 0.; - m_nsps = framesPerSymbol; - m_trfrequency = frequency; + m_addNoise = request.snr_db < 0.; + m_nsps = request.frames_per_symbol; + m_trfrequency = request.frequency_hz; m_amp = std::numeric_limits::max (); - m_toneSpacing = toneSpacing; - m_bFastMode=fastMode; - m_TRperiod=TRperiod; + m_toneSpacing = request.tone_spacing; + m_bFastMode=request.fast_mode; + m_TRperiod=request.tr_period_s; + m_tuning=request.tuning; + m_cwId=request.cw_id; unsigned delay_ms=1000; - if((mode=="FT8" and m_nsps==1920) or (mode=="FST4" and m_nsps==720)) delay_ms=500; //FT8, FST4-15 - if((mode=="FT8" and m_nsps==1024)) delay_ms=400; //SuperFox Qary Polar Code transmission - if(mode=="Q65" and m_nsps<=3600) delay_ms=500; //Q65-15 and Q65-30 - if(mode=="FT4") delay_ms=300; //FT4 + if((request.mode=="FT8" and m_nsps==1920) or (request.mode=="FST4" and m_nsps==720)) delay_ms=500; //FT8, FST4-15 + if((request.mode=="FT8" and m_nsps==1024)) delay_ms=400; //SuperFox Qary Polar Code transmission + if(request.mode=="Q65" and m_nsps<=3600) delay_ms=500; //Q65-15 and Q65-30 + if(request.mode=="FT4") delay_ms=300; //FT4 // noise generator parameters if (m_addNoise) { - m_snr = qPow (10.0, 0.05 * (dBSNR - 6.0)); + m_snr = qPow (10.0, 0.05 * (request.snr_db - 6.0)); m_fac = 3000.0; if (m_snr > 1.0) m_fac = 3000.0 / m_snr; } @@ -1501,13 +1649,28 @@ void TCITransceiver::do_modulator_start (QString mode, unsigned symbolsLength, d m_silentFrames = 0; // calculate number of silent frames to send - if (m_ic == 0 && synchronize && !m_tuning) { + if (m_ic == 0 && request.synchronize && !request.tuning) { m_silentFrames = audioSampleRate / (1000 / delay_ms) - (mstr * (audioSampleRate / 1000)); } - m_state = (synchronize && m_silentFrames) ? + m_state = (request.synchronize && m_silentFrames) ? Synchronizing : Active; - printf("%s TCI modulator startdelay_ms=%d ASR=%d mstr=%d mstr2=%d m_ic=%d s_Frames=%lld synchronize=%d m_tuning=%d State=%d\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),delay_ms,audioSampleRate,mstr,mstr2,m_ic,m_silentFrames,synchronize,m_tuning,m_state); + m_txStartSnapshot.session_id = request.session_id; + m_txStartSnapshot.generation = request.generation; + m_txStartSnapshot.mode = m_txMode; + m_txStartSnapshot.sample_rate_hz = int (audioSampleRate); + m_txStartSnapshot.committed_end_sample = bounded_source_frames (request.tuning); + m_txStartSnapshot.target_known = m_txStartSnapshot.committed_end_sample >= 0; + m_txStartSnapshot.diagnostic = tr ("TCI source commitment; playout evidence is protocol-send dead reckoning, not DAC confirmation"); + ++m_tciBackendStartSequence; + m_tciSuccessfullyWrittenFrames = 0; + m_tciStartMsecs = QDateTime::currentMSecsSinceEpoch (); + m_tciLastReportMsecs = m_tciStartMsecs; + m_tciFinalSnapshotEmitted = false; + printf("%s TCI modulator startdelay_ms=%d ASR=%d mstr=%d mstr2=%d m_ic=%d s_Frames=%lld synchronize=%d m_tuning=%d State=%d\n",QDateTime::QDateTime::currentDateTimeUtc().toString("hh:mm:ss.zzz").toStdString().c_str(),delay_ms,audioSampleRate,mstr,mstr2,m_ic,m_silentFrames,request.synchronize,m_tuning,m_state); + if (m_txMode == "JTTY" && !m_jttyDrainTimer->isActive ()) m_jttyDrainTimer->start (); Q_EMIT tci_mod_active(m_state != Idle); + Q_EMIT txSourceCommitted (m_txStartSnapshot); + emit_tci_playout_snapshot (true, true); } void TCITransceiver::do_tune (bool newState) @@ -1523,11 +1686,57 @@ void TCITransceiver::do_modulator_stop (bool quick) m_state = Idle; Q_EMIT tci_mod_active(m_state != Idle); } + if (m_jttyDrainTimer->isActive ()) m_jttyDrainTimer->stop (); + emit_tci_playout_snapshot (false, true); tx_audio_ = false; } -quint16 TCITransceiver::readAudioData (float * data, qint32 maxSize, qreal txAtten) +qint64 TCITransceiver::bounded_source_frames (bool tuning) const +{ + if (tuning || m_txMode == "JTTY" || m_txMode == "CW" || !m_cwId.isEmpty ()) return -1; + + qint64 i1 = qint64 (m_symbolsLength * 4.0 * m_nsps); + if (m_bFastMode) + { + i1 = qint64 (m_TRperiod * 48000.0 - 24000.0); + } + return TxEvidence::boundedCommittedEndSample (m_silentFrames, m_ic, i1); +} + +void TCITransceiver::emit_tci_playout_snapshot (bool start_event, bool force) { + qint64 const now = QDateTime::currentMSecsSinceEpoch (); + bool const final = m_state == Idle; + if (!start_event && !force && now - m_tciLastReportMsecs < 1000) return; + if (final && m_tciFinalSnapshotEmitted) return; + + TxEvidence::TxRawPlayoutSnapshot snapshot; + snapshot.tier = TxEvidence::TxPlayoutTier::DeadReckoning; + snapshot.backend_start_sequence = m_tciBackendStartSequence; + snapshot.start_event = start_event; + snapshot.available = inConnected; + snapshot.state = final ? TxEvidence::TxBackendState::Idle : TxEvidence::TxBackendState::Active; + snapshot.elapsed_usecs = (now - m_tciStartMsecs) * 1000; + snapshot.successfully_written_frames = m_tciSuccessfullyWrittenFrames; + snapshot.sample_rate_hz = int (audioSampleRate); + snapshot.report_interval_ms = int (now - m_tciLastReportMsecs); + snapshot.diagnostic = tr ("TCI WebSocket send progress; no radio DAC or RF playback confirmation"); + if (m_txMode == "JTTY") + { + auto const progress = m_txAudioQueue.progress (); + snapshot.source_served_frames = progress.served_samples; + snapshot.source_total_frames = progress.total_samples; + } + Q_EMIT rawTxPlayoutSnapshot (snapshot); + m_tciLastReportMsecs = now; + if (final) m_tciFinalSnapshotEmitted = true; +} + +quint16 TCITransceiver::readAudioData (float * data, qint32 maxSize, quint32 channels, qreal txAtten) +{ + Q_ASSERT (channels == 1u || channels == 2u); + Q_ASSERT (maxSize >= 0 && !(static_cast (maxSize) % channels)); + double toneFrequency=1500.0; if(m_nsps==6) { toneFrequency=1000.0; @@ -1537,11 +1746,10 @@ quint16 TCITransceiver::readAudioData (float * data, qint32 maxSize, qreal txAtt if(maxSize==0) return 0; qreal newVolume = pow(2.22222 * (45 - txAtten) * 0.01,2); - //printf("txAtten is %f and newVolume is %f\n",txAtten, newVolume); - qint64 numFrames (maxSize/bytesPerFrame); + qint64 numFrames (maxSize/channels); float * samples (reinterpret_cast (data)); - float * end (samples + numFrames * bytesPerFrame); + float * end (samples + numFrames * channels); qint64 framesGenerated (0); switch (m_state) @@ -1550,10 +1758,10 @@ quint16 TCITransceiver::readAudioData (float * data, qint32 maxSize, qreal txAtt { if (m_silentFrames) { // send silence up to first second framesGenerated = qMin (m_silentFrames, numFrames); - for ( ; samples != end; samples = load (0, samples)) { // silence + for ( ; samples != end; samples = load (0, channels, samples)) { // silence } m_silentFrames -= framesGenerated; - return framesGenerated * bytesPerFrame; + return framesGenerated * channels; } m_state = Active; Q_EMIT tci_mod_active(m_state != Idle); @@ -1564,10 +1772,15 @@ quint16 TCITransceiver::readAudioData (float * data, qint32 maxSize, qreal txAtt case Active: { + if (m_txMode == "JTTY" && !m_tuning) + { + return readJttyAudioData (data, maxSize, channels, txAtten); + } + unsigned int isym=0; qint16 sample=0; if(!m_tuning) isym=m_ic/(4.0*m_nsps); // Actual fsample=48000 - bool slowCwId=((isym >= m_symbolsLength) && (icw[0] > 0)); + bool slowCwId=((isym >= m_symbolsLength) && !m_cwId.isEmpty ()); m_nspd=2560; // 22.5 WPM if(m_TRperiod > 16.0 && slowCwId) { // Transmit CW ID? @@ -1577,7 +1790,13 @@ quint16 TCITransceiver::readAudioData (float * data, qint32 maxSize, qreal txAtt while (samples != end) { j = (m_ic - ic0)/m_nspd + 1; // symbol of this sample - bool level {bool (icw[j])}; + if (j == 0 || j > static_cast (m_cwId.size ())) + { + m_state = Idle; + Q_EMIT tci_mod_active(m_state != Idle); + return framesGenerated * channels; + } + bool level {bool (m_cwId.at (j - 1))}; m_phi += m_dphi; if (m_phi > m_twoPi) m_phi -= m_twoPi; sample=0; @@ -1591,15 +1810,9 @@ quint16 TCITransceiver::readAudioData (float * data, qint32 maxSize, qreal txAtt } sample=round(newVolume * amp * x); } - if (int (j) <= icw[0] && j < NUM_CW_SYMBOLS) { // stopu condition - samples = load (postProcessSample (sample), samples); - ++framesGenerated; - ++m_ic; - } else { - m_state = Idle; - Q_EMIT tci_mod_active(m_state != Idle); - return framesGenerated * bytesPerFrame; - } + samples = load (postProcessSample (sample), channels, samples); + ++framesGenerated; + ++m_ic; // adjust ramp if ((m_ramp != 0 && m_ramp != std::numeric_limits::min ()) || level != m_cwLevel) { @@ -1608,7 +1821,7 @@ quint16 TCITransceiver::readAudioData (float * data, qint32 maxSize, qreal txAtt } m_cwLevel = level; } - return framesGenerated * bytesPerFrame; + return framesGenerated * channels; } //End of code for CW ID double const baud (12000.0 / m_nsps); @@ -1674,17 +1887,17 @@ quint16 TCITransceiver::readAudioData (float * data, qint32 maxSize, qreal txAtt m_amp=32767.0; sample=qRound(newVolume * m_amp*foxcom_.wave[m_ic]); } - samples = load (postProcessSample (sample), samples); + samples = load (postProcessSample (sample), channels, samples); ++framesGenerated; ++m_ic; } if (m_amp == 0.0) { // TODO G4WJS: compare double with zero might not be wise - if (icw[0] == 0) { + if (m_cwId.isEmpty ()) { // no CW ID to send m_state = Idle; Q_EMIT tci_mod_active(m_state != Idle); - return framesGenerated * bytesPerFrame; + return framesGenerated * channels; } m_phi = 0.0; } @@ -1694,21 +1907,48 @@ quint16 TCITransceiver::readAudioData (float * data, qint32 maxSize, qreal txAtt if (samples != end && framesGenerated) { } while (samples != end) { // pad block with silence - samples = load (0, samples); + samples = load (0, channels, samples); ++framesGenerated; } - return framesGenerated * bytesPerFrame; + return framesGenerated * channels; } // fall through case Idle: - while (samples != end) samples = load (0, samples); + while (samples != end) samples = load (0, channels, samples); } Q_ASSERT (Idle == m_state); return 0; } +quint16 TCITransceiver::readJttyAudioData (float * data, qint32 maxSize, quint32 channels, qreal txAtten) +{ + Q_ASSERT (channels == 1u || channels == 2u); + Q_ASSERT (maxSize >= 0 && !(static_cast (maxSize) % channels)); + + if(maxSize==0) return 0; + + qreal const newVolume = pow(2.22222 * (45 - txAtten) * 0.01,2); + qint64 const numFrames (maxSize/channels); + float * samples (reinterpret_cast (data)); + qint64 framesGenerated (0); + + // JTTY is pre-rendered mono PCM shared with the soundcard path. When the FIFO + // runs dry we keep sending silence until the drain guard proves the last real + // sample has cleared the backend. + for (qint64 i = 0; i < numFrames; ++i) + { + qint32 sample = qRound (newVolume * m_txAudioQueue.pullSample (m_jttyDrainGuard)); + if (sample > std::numeric_limits::max ()) sample = std::numeric_limits::max (); + if (sample < std::numeric_limits::min ()) sample = std::numeric_limits::min (); + samples = load (postProcessSample (qint16 (sample)), channels, samples); + ++framesGenerated; + } + + return framesGenerated * channels; +} + qint16 TCITransceiver::postProcessSample (qint16 sample) const { if (m_addNoise) { // Test frame, we'll add noise diff --git a/Transceiver/TCITransceiver.hpp b/Transceiver/TCITransceiver.hpp index 5518b449..4f2387b3 100644 --- a/Transceiver/TCITransceiver.hpp +++ b/Transceiver/TCITransceiver.hpp @@ -1,15 +1,22 @@ #ifndef TCI_TRANSCEIVER_HPP__ #define TCI_TRANSCEIVER_HPP__ +#include +#include +#include #include +#include #include "TransceiverFactory.hpp" #include "PollingTransceiver.hpp" +#include "TCIStream.hpp" #include "commons.h" +#include "Audio/TxAudioQueue.hpp" #include #include #include +#include #include typedef float REAL; @@ -17,43 +24,22 @@ typedef float REAL; class QWebSocket; class QByteArray; class QString; -// -// TCI Interface -// - -typedef struct -{ - quint32 receiver; //!< software receiver number - quint32 sampleRate; //!< sampling frequency - quint32 format; //!< data field format (0 - int16, 1 - int24, 2 - int32, 3 - float32, 4 - float64) - quint32 codec; //!< compression algorithm (not implemented), always 0 - quint32 crc; //!< checksum - quint32 length; //!< data field length number of float numbers - quint32 type; //!< data stream type - quint32 reserv[9]; //!< reserved - float data[8192]; //!< data field -}Data_Stream; - -typedef enum -{ - Iq_Stream = 0, - RxAudioStream, - TxAudioStream, - TxChrono, -}Stream_Type; - class TCITransceiver final : public PollingTransceiver { - Q_OBJECT; // for translation context + Q_OBJECT; public: + // UTC milliseconds, called on the transceiver thread for receive audio. + // An empty provider retains the system-clock behavior. + using ReceiveClock = std::function; static void register_transceivers (logger_type *, TransceiverFactory::Transceivers *, unsigned id1, unsigned id2); - // takes ownership of wrapped Transceiver + // Takes ownership of the wrapped transceiver. explicit TCITransceiver (logger_type * logger, std::unique_ptr wrapped, QString const& rignr, QString const& address, bool use_for_ptt, - int poll_interval, QObject * parent = nullptr); + int poll_interval, QObject * parent = nullptr, + ReceiveClock receive_clock = {}); enum Tci_Cmd { Cmd_Unknown, @@ -121,11 +107,11 @@ qreal rxAtten; qreal txAtten; public slots: -// void close(); void sendTextMessage(const QString &message); -// void trxChanged(quint32 trx, bool state); void txAudioData(quint32 len, float * data); -// void setAudioSampleRate(const quint32 &sr); + void enqueue_jtty_pcm (QByteArray const& samples, TxAudioQueueEpoch epoch, + qint64 enqueueId) noexcept override; + void clear_jtty_pcm (TxAudioQueueEpoch epoch) noexcept override; private slots: void onBinaryReceived(const QByteArray &data); @@ -133,6 +119,7 @@ private slots: void onError(QAbstractSocket::SocketError err); void onConnected(); void onDisconnected(); + void poll_jtty_drain (); signals: void sendIqData(int, quint32, float*, bool); @@ -157,7 +144,6 @@ protected: void do_ptt (bool on) override; void do_poll () override; -//for Audio void do_audio (bool on) override; void do_tune (bool on) override; void do_period(double period) override; @@ -167,25 +153,32 @@ protected: void do_trfrequency(double newfrequency) override {m_trfrequency = newfrequency;} void do_volume (qreal volume) override; void do_txvolume (qreal txvolume) override; -//bounch - void do_modulator_start(QString jtmode, unsigned symbolsLength, double framesPerSymbol, double frequency, - double toneSpacing, bool synchronize = true, bool fastmode=false, double dBSNR = 99., double TRperiod=60.0) override; + void do_modulator_start (TxEvidence::TxRequest const&) override; void do_modulator_stop(bool quick = false) override; void rx2_enable (bool on); void rig_split (); void rig_power (bool on); void stream_audio (bool on); - void store (float * source, size_t numFrames, qint16 * dest) + static qint16 tci_audio_sample_to_int16 (float sample) { static constexpr float K = 0x7FFF; - for (size_t i {0}; i < numFrames; ++i) { - dest[i] = static_cast(K*source[i*2]); + if (!std::isfinite (sample)) { + return 0; } + sample = std::max (-1.0f, std::min (sample, 1.0f)); + return static_cast (K * sample); + } + void store (float const * source, size_t numFrames, qint16 * dest, + double gain) + { + for (size_t i {0}; i < numFrames; ++i) { + dest[i] = tci_audio_sample_to_int16 (gain * source[i * 2]); + } } - float * load (qint16 sample, float * dest) + float * load (qint16 sample, quint32 channels, float * dest) { static constexpr float K1 = 0.999/0x7FFF; @@ -193,17 +186,14 @@ protected: float value; if (tx_top_) value = K1*static_cast(sample); else value = K2*static_cast(sample); - *dest++ = value; - *dest++ = value; - - return dest; + return TciStream::write_channel_frame (value, channels, dest); } enum ModulatorState {Synchronizing, Active, Idle}; private: MODE get_mode (bool requested = false); QString frequency_to_string (Frequency) const; - Frequency string_to_frequency (QString) const; + Frequency string_to_frequency (QString const&) const; void mysleep1 (int ms = 1); void mysleep2 (int ms = 1); void mysleep3 (int ms = 1); @@ -226,7 +216,6 @@ private: bool tci_audio_; bool _power_; QWebSocket * commander_; - QLocale locale_; QTimer * tci_timer1_; QEventLoop * tci_loop1_; QTimer * tci_timer2_; @@ -243,25 +232,24 @@ private: QEventLoop * tci_loop7_; QTimer * tci_timer8_; QEventLoop * tci_loop8_; - int nIqBytes; bool inConnected; bool tci_Ready; bool ESDR3; bool HPSDR; + bool stream_channels_supported_ = false; bool tx_top_; bool band_change; bool band_change2; bool other_band_change; QUrl url_; quint32 audioSampleRate; - FILE * wavptr_; QByteArray t_iqData; int trxA; int trxB; int cntIQ; bool bIQ; -// CAT internal variables + // Rig state QString requested_mode_; QString mode_; QString started_mode_; @@ -295,25 +283,30 @@ private: bool busy_PTT_; bool busy_rx2_; QHash mapCmd_; - // from Detector + // Receive audio buffering void clear (); // discard buffer contents double m_period = 15.0; + ReceiveClock receive_clock_; + ReceiveAudioProducer m_receiveAudioProducer; + std::array m_downsampleState {}; + unsigned m_lastPeriodOffsetMs = 999999; unsigned m_downSampleFactor; qint32 m_samplesPerFFT; // after any down sampling qint32 m_ns; + // m_samplesPerFFT must not exceed this post-downsampling limit; m_buffer + // scales it to hold one complete block at the input sample rate. static size_t const max_buffer_size {7 * 512}; QScopedArrayPointer m_buffer; // de-interleaved sample buffer - // big enough for all the - // samples for one increment of - // data (a signals worth) at - // the input sample rate unsigned m_bufferPos; quint32 writeAudioData (float * data, qint32 maxSize); - static size_t const bytesPerFrame = 2; - // from Modulator - quint16 readAudioData (float * data, qint32 maxSize, qreal txVolume); + static size_t const rxChannels = 2; + // Transmit audio generation + quint16 readAudioData (float * data, qint32 maxSize, quint32 channels, qreal txVolume); + quint16 readJttyAudioData (float * data, qint32 maxSize, quint32 channels, qreal txVolume); qint16 postProcessSample (qint16 sample) const; + qint64 bounded_source_frames (bool tuning) const; + void emit_tci_playout_snapshot (bool start_event, bool force); bool m_quickClose = false; unsigned m_symbolsLength; @@ -334,14 +327,25 @@ private: double m_TRperiod; qint64 m_silentFrames; + QString m_txMode; qint16 m_ramp; ModulatorState m_state; + TxAudioQueue m_txAudioQueue; + QTimer * m_jttyDrainTimer; + qint64 m_jttyDrainGuard; + TxEvidence::TxStartSnapshot m_txStartSnapshot; + qint64 m_tciBackendStartSequence; + qint64 m_tciSuccessfullyWrittenFrames; + qint64 m_tciStartMsecs; + qint64 m_tciLastReportMsecs; + bool m_tciFinalSnapshotEmitted; bool m_tuning; bool m_addNoise; bool m_bFastMode; bool m_cwLevel; + QVector m_cwId; unsigned m_ic; unsigned m_isym0; int m_j0; diff --git a/Transceiver/Transceiver.cpp b/Transceiver/Transceiver.cpp index c6dea805..ac85318e 100644 --- a/Transceiver/Transceiver.cpp +++ b/Transceiver/Transceiver.cpp @@ -24,13 +24,13 @@ QDebug operator << (QDebug d, Transceiver::TransceiverState const& s) << "; QUICK: " << (s.quick_ ? "on" : "off") << "; PERIOD: " << s.period_ << "sec." << "; BLOCKSIZE: " << s.blocksize_ - << "; SYMBOLSLENGTH: " << s.symbolslength_ - << "; FRAMESPERSYMBOL: " << s.framespersymbol_ - << "; TRFREQUENCY: " << s.trfrequency_ << "Hz" - << "; TONESPACING: " << s.tonespacing_ - << "; SYNCHRONIZE: " << (s.synchronize_ ? "on" : "off") - << "; DBSNR: " << s.dbsnr_ - << "; TRPERIOD: " << s.trperiod_ << "sec." + << "; SYMBOLSLENGTH: " << s.tx_request_.symbols_length + << "; FRAMESPERSYMBOL: " << s.tx_request_.frames_per_symbol + << "; TRFREQUENCY: " << s.tx_request_.frequency_hz << "Hz" + << "; TONESPACING: " << s.tx_request_.tone_spacing + << "; SYNCHRONIZE: " << (s.tx_request_.synchronize ? "on" : "off") + << "; DBSNR: " << s.tx_request_.snr_db + << "; TRPERIOD: " << s.tx_request_.tr_period_s << "sec." << "; SPREAD: " << s.spread_ << "; NSYM: " << s.nsym_ << "; VOLUME: " << s.volume_ @@ -38,6 +38,8 @@ QDebug operator << (QDebug d, Transceiver::TransceiverState const& s) << "; LEVEL: " << s.level_ << "dBm" << "; POWER: " << s.power_ << "mWatts" << "; SWR: " << s.swr_ + << "; TX_SESSION: " << s.tx_request_.session_id.value () + << "; TX_GENERATION: " << s.tx_request_.generation.value () << ")\n"; return d.space (); } @@ -59,6 +61,8 @@ std::ostream& operator << (std::ostream& os, Transceiver::TransceiverState const << "; POWER: " << s.power_ << "mWatts" << "; SWR: " << s.swr_ << "; TUNE: " << s.tune_ + << "; TX_SESSION: " << s.tx_request_.session_id.value () + << "; TX_GENERATION: " << s.tx_request_.generation.value () << ")\n"; } @@ -80,13 +84,7 @@ bool operator != (Transceiver::TransceiverState const& lhs, Transceiver::Transce || lhs.quick_ != rhs.quick_ || lhs.period_ != rhs.period_ || lhs.blocksize_ != rhs.blocksize_ - || lhs.symbolslength_ != rhs.symbolslength_ - || lhs.framespersymbol_ != rhs.framespersymbol_ - || lhs.trfrequency_ != rhs.trfrequency_ - || lhs.tonespacing_ != rhs.tonespacing_ - || lhs.synchronize_ != rhs.synchronize_ - || lhs.dbsnr_ != rhs.dbsnr_ - || lhs.trperiod_ != rhs.trperiod_ + || lhs.tx_request_ != rhs.tx_request_ || lhs.spread_ != rhs.spread_ || lhs.nsym_ != rhs.nsym_ || lhs.volume_ != rhs.volume_ diff --git a/Transceiver/Transceiver.hpp b/Transceiver/Transceiver.hpp index 16c2e9f0..14d1640b 100644 --- a/Transceiver/Transceiver.hpp +++ b/Transceiver/Transceiver.hpp @@ -7,12 +7,25 @@ #include #include +#include #include "qt_helpers.hpp" #include "Radio.hpp" +#include "Audio/TxAudioQueue.hpp" +#include "Audio/TxIdentity.hpp" +#include "Audio/TxPlaybackEvidence.hpp" +#include "Audio/TxRequest.hpp" +#include "ReceiveAudio.hpp" class QString; +// Qt 5 moc generates unqualified argument names for these value types. +using TxSessionId = TxEvidence::TxSessionId; +using TxGeneration = TxEvidence::TxGeneration; +using TxStartSnapshot = TxEvidence::TxStartSnapshot; +using TxRawPlayoutSnapshot = TxEvidence::TxRawPlayoutSnapshot; +using TxRequest = TxEvidence::TxRequest; + // // Abstract Transceiver Interface // @@ -92,13 +105,6 @@ public: , quick_ {false} , period_ {120.0} , blocksize_ {3456} - , symbolslength_ {79} - , framespersymbol_ {1920.0} - , trfrequency_ {1500.0} - , tonespacing_ {-3.0} - , synchronize_ {true} - , dbsnr_ {99.} - , trperiod_ {60.0} , spread_ {0.0} , nsym_ {79} , volume_ {0} @@ -106,8 +112,6 @@ public: , level_ {0} , power_ {0} , swr_ {0} - , jtmode_ {"FT8"} //w3sz tci - , fastmode_ {false} //w3sz tci { } @@ -123,13 +127,13 @@ public: bool quick () const {return quick_;} double period () const {return period_;} qint32 blocksize () const {return blocksize_;} - unsigned symbolslength () const {return symbolslength_;} - double framespersymbol () const {return framespersymbol_;} - double trfrequency () const {return trfrequency_;} - double tonespacing () const {return tonespacing_;} - bool synchronize () const {return synchronize_;} - double dbsnr () const {return dbsnr_;} - double trperiod () const {return trperiod_;} + unsigned symbolslength () const {return tx_request_.symbols_length;} + double framespersymbol () const {return tx_request_.frames_per_symbol;} + double trfrequency () const {return tx_request_.frequency_hz;} + double tonespacing () const {return tx_request_.tone_spacing;} + bool synchronize () const {return tx_request_.synchronize;} + double dbsnr () const {return tx_request_.snr_db;} + double trperiod () const {return tx_request_.tr_period_s;} double spread () const {return spread_;} int nsym () const {return nsym_;} qreal volume () const {return volume_;} @@ -137,8 +141,11 @@ public: int level () const {return level_;} unsigned int power () const {return power_;} unsigned int swr () const {return swr_;} - QString jtmode () const {return jtmode_;} //w3sz tci - bool fastmode () const {return fastmode_;} //w3sz tci + QString jtmode () const {return tx_request_.mode;} //w3sz tci + bool fastmode () const {return tx_request_.fast_mode;} //w3sz tci + TxEvidence::TxSessionId tx_session_id () const {return tx_request_.session_id;} + TxEvidence::TxGeneration tx_generation () const {return tx_request_.generation;} + TxEvidence::TxRequest const& tx_request () const {return tx_request_;} void online (bool state) {online_ = state;} void frequency (Frequency f) {rx_frequency_ = f;} @@ -152,13 +159,13 @@ public: void quick (bool state) {quick_ = state;} void period (double period) {period_ = period;} void blocksize (qint32 blocksize) {blocksize_ = blocksize;} - void symbolslength (unsigned symbolslength) {symbolslength_ = symbolslength;} - void framespersymbol (double framespersymbol) {framespersymbol_ = framespersymbol;} - void trfrequency (double trfrequency) {trfrequency_ = trfrequency;} - void tonespacing (double tonespacing) {tonespacing_ = tonespacing;} - void synchronize (bool synchronize) {synchronize_ = synchronize;} - void dbsnr (double dbsnr) {dbsnr_ = dbsnr;} - void trperiod (double trperiod) {trperiod_ = trperiod;} + void symbolslength (unsigned symbolslength) {tx_request_.symbols_length = symbolslength;} + void framespersymbol (double framespersymbol) {tx_request_.frames_per_symbol = framespersymbol;} + void trfrequency (double trfrequency) {tx_request_.frequency_hz = trfrequency;} + void tonespacing (double tonespacing) {tx_request_.tone_spacing = tonespacing;} + void synchronize (bool synchronize) {tx_request_.synchronize = synchronize;} + void dbsnr (double dbsnr) {tx_request_.snr_db = dbsnr;} + void trperiod (double trperiod) {tx_request_.tr_period_s = trperiod;} void spread (double spread) {spread_ = spread;} void nsym (int nsym) {nsym_ = nsym;} void volume (qreal volume) {volume_ = volume;} @@ -166,8 +173,11 @@ public: void level (int strength) {level_ = strength;} void power (unsigned int mwpower) {power_ = mwpower;} void swr (unsigned int mswr) {swr_ = mswr;} - void jtmode(QString jtmode) {jtmode_ = jtmode;} //w3sz tci - void fastmode(bool fastmode) {fastmode_ = fastmode;} //w3sz tci + void jtmode(QString jtmode) {tx_request_.mode = jtmode;} //w3sz tci + void fastmode(bool fastmode) {tx_request_.fast_mode = fastmode;} //w3sz tci + void tx_session_id (TxEvidence::TxSessionId value) {tx_request_.session_id = value;} + void tx_generation (TxEvidence::TxGeneration value) {tx_request_.generation = value;} + void tx_request (TxEvidence::TxRequest const& request) {tx_request_ = request;} private: bool online_; @@ -182,13 +192,7 @@ public: bool quick_; double period_; qint32 blocksize_; - unsigned symbolslength_; - double framespersymbol_; - double trfrequency_; - double tonespacing_; - bool synchronize_; - double dbsnr_; - double trperiod_; + TxEvidence::TxRequest tx_request_; double spread_; int nsym_; qreal volume_; @@ -196,8 +200,6 @@ public: int level_; unsigned int power_; unsigned int swr_; - QString jtmode_; //w3sz tci - bool fastmode_; //w3sz tci // Don't forget to update the debug print and != operator if you // add more members here @@ -226,6 +228,8 @@ public: // Connect and disconnect. Q_SLOT virtual void start (unsigned sequence_number) noexcept = 0; Q_SLOT virtual void stop () noexcept = 0; + Q_SLOT virtual void enqueue_jtty_pcm (QByteArray const&, TxAudioQueueEpoch, qint64) noexcept {} + Q_SLOT virtual void clear_jtty_pcm (TxAudioQueueEpoch) noexcept {} // // asynchronous status updates @@ -240,10 +244,20 @@ public: // rig audio data transfer w3sz tci Q_SIGNAL void tciframeswritten (qint64); + Q_SIGNAL void receiveAudio (ReceiveAudio); // rig audio data transfer w3sz tci Q_SIGNAL void tci_mod_active (bool); + // Diagnostics only: source commitment and TCI protocol-send progress. + Q_SIGNAL void txSourceCommitted (TxEvidence::TxStartSnapshot); + Q_SIGNAL void rawTxPlayoutSnapshot (TxEvidence::TxRawPlayoutSnapshot); + + Q_SIGNAL void jtty_drained (TxAudioQueueDrainState drain); + Q_SIGNAL void jtty_enqueue_accepted (qint64 enqueueId, qint64 sampleCount, + TxAudioQueueProgress progress); + Q_SIGNAL void jtty_enqueue_failed (TxAudioQueueEpoch epoch, qint64 enqueueId); + // rig state changed Q_SIGNAL void update (Transceiver::TransceiverState const&, unsigned sequence_number) const; diff --git a/Transceiver/TransceiverBase.cpp b/Transceiver/TransceiverBase.cpp index 72f6fafb..458eade5 100644 --- a/Transceiver/TransceiverBase.cpp +++ b/Transceiver/TransceiverBase.cpp @@ -78,10 +78,13 @@ void TransceiverBase::set (TransceiverState const& s, audio_cmd = true; requested_.blocksize (s.blocksize ()); } - if (requested_.period() != s.period()) { + if (!period_applied_ || applied_period_ != s.period()) { + bool const had_applied_period {period_applied_}; do_period (s.period()); - audio_cmd = true; requested_.period (s.period ()); + applied_period_ = s.period (); + period_applied_ = true; + audio_cmd = audio_cmd || had_applied_period; } if (requested_.spread() != s.spread()) { do_spread (s.spread()); @@ -105,14 +108,8 @@ void TransceiverBase::set (TransceiverState const& s, } if (requested_.tx_audio() != s.tx_audio()) { if (s.tx_audio()) { - do_modulator_start(s.jtmode(), s.symbolslength (), s.framespersymbol (), s.trfrequency (), s.tonespacing (), s.synchronize (),s.fastmode(), s.dbsnr (), s.trperiod ()); - requested_.symbolslength(s.symbolslength ()); - requested_.framespersymbol(s.framespersymbol ()); - requested_.trfrequency(s.trfrequency ()); - requested_.tonespacing(s.tonespacing ()); - requested_.synchronize(s.synchronize ()); - requested_.dbsnr(s.dbsnr ()); - requested_.trperiod(s.trperiod ()); + do_modulator_start (s.tx_request ()); + requested_.tx_request (s.tx_request ()); } else { do_modulator_stop(s.quick ()); requested_.quick (s.quick ()); @@ -263,6 +260,8 @@ void TransceiverBase::shutdown () do_post_stop (); actual_ = TransceiverState {}; requested_ = TransceiverState {}; + period_applied_ = false; + applied_period_ = 0.0; } void TransceiverBase::stop () noexcept diff --git a/Transceiver/TransceiverBase.hpp b/Transceiver/TransceiverBase.hpp index ee5f8c1c..085fccfc 100644 --- a/Transceiver/TransceiverBase.hpp +++ b/Transceiver/TransceiverBase.hpp @@ -123,8 +123,7 @@ protected: virtual void do_trfrequency(double) {} virtual void do_volume (qreal) {} virtual void do_txvolume (qreal) {} - //parameters are MODE,symbolslength,framespersymbol,trfrequency,tonespacing,synchronize,FASTMODE,dbsdr,trperiod //parameters added by w3sz are in bold - virtual void do_modulator_start(QString, unsigned, double, double, double, bool, bool, double, double) {} + virtual void do_modulator_start (TxEvidence::TxRequest const&) {} virtual void do_modulator_stop(bool) {} virtual bool do_pre_update () {return true;} @@ -168,6 +167,8 @@ private: TransceiverState actual_; TransceiverState last_; unsigned last_sequence_number_; // from set state operation + bool period_applied_ {false}; + double applied_period_ {0.0}; }; // some loggimg macros diff --git a/Transceiver/TransceiverFactory.cpp b/Transceiver/TransceiverFactory.cpp index 323a882a..9f245908 100644 --- a/Transceiver/TransceiverFactory.cpp +++ b/Transceiver/TransceiverFactory.cpp @@ -1,4 +1,5 @@ #include "TransceiverFactory.hpp" +#include "TxInhibitTransceiver.hpp" #include @@ -225,6 +226,15 @@ std::unique_ptr TransceiverFactory::create (ParameterPack const& pa } } + if (supports_tx_inhibit (params.ptt_type)) + { + result.reset (new TxInhibitTransceiver {&logger_, std::move (result)}); + if (target_thread) + { + result->moveToThread (target_thread); + } + } + return result; } diff --git a/Transceiver/TransceiverFactory.hpp b/Transceiver/TransceiverFactory.hpp index 3d9390d8..a579d451 100644 --- a/Transceiver/TransceiverFactory.hpp +++ b/Transceiver/TransceiverFactory.hpp @@ -74,6 +74,12 @@ public: Q_ENUM (Handshake) enum PTTMethod {PTT_method_VOX, PTT_method_CAT, PTT_method_DTR, PTT_method_RTS}; Q_ENUM (PTTMethod) + + static bool supports_tx_inhibit (PTTMethod method) + { + return PTT_method_DTR == method || PTT_method_RTS == method; + } + enum TXAudioSource {TX_audio_source_front, TX_audio_source_rear}; Q_ENUM (TXAudioSource) enum SplitMode {split_mode_none, split_mode_rig, split_mode_emulate}; diff --git a/Transceiver/TxInhibitTransceiver.cpp b/Transceiver/TxInhibitTransceiver.cpp new file mode 100644 index 00000000..6261432b --- /dev/null +++ b/Transceiver/TxInhibitTransceiver.cpp @@ -0,0 +1,255 @@ +#include "TxInhibitTransceiver.hpp" + +#include +#include + +#include +#include +#include + +#include "moc_TxInhibitTransceiver.cpp" + +namespace +{ + QString const overflow_hold_key; + + QString sanitize_holder (QString const& value) + { + QString result; + result.reserve (std::min (value.size (), 64)); + for (auto const character : value.left (64)) + { + if (character.isPrint ()) result.append (character); + } + return result.trimmed (); + } +} + +TxInhibitTransceiver::TxInhibitTransceiver (logger_type * logger, + std::unique_ptr wrapped) + : Transceiver {logger, nullptr} + , wrapped_ {std::move (wrapped)} + , expiry_timer_ {new QTimer {this}} +{ + Q_ASSERT (wrapped_); + + expiry_timer_->setSingleShot (true); + connect (expiry_timer_, &QTimer::timeout, this, &TxInhibitTransceiver::expire_holds); + + connect (wrapped_.get (), &Transceiver::resolution, this, &Transceiver::resolution); + connect (wrapped_.get (), &Transceiver::tciframeswritten, this, &Transceiver::tciframeswritten); + connect (wrapped_.get (), &Transceiver::receiveAudio, this, &Transceiver::receiveAudio); + connect (wrapped_.get (), &Transceiver::tci_mod_active, this, &Transceiver::tci_mod_active); + connect (wrapped_.get (), &Transceiver::txSourceCommitted, this, &Transceiver::txSourceCommitted); + connect (wrapped_.get (), &Transceiver::rawTxPlayoutSnapshot, this, &Transceiver::rawTxPlayoutSnapshot); + connect (wrapped_.get (), &Transceiver::jtty_drained, this, &Transceiver::jtty_drained); + connect (wrapped_.get (), &Transceiver::jtty_enqueue_accepted, this, &Transceiver::jtty_enqueue_accepted); + connect (wrapped_.get (), &Transceiver::jtty_enqueue_failed, this, &Transceiver::jtty_enqueue_failed); + connect (wrapped_.get (), &Transceiver::update, this, &Transceiver::update); + connect (wrapped_.get (), &Transceiver::finished, this, &Transceiver::finished); + connect (wrapped_.get (), &Transceiver::failure, this, &Transceiver::failure); +} + +void TxInhibitTransceiver::set (TransceiverState const& state, + unsigned sequence_number) noexcept +{ + requested_ = state; + sequence_number_ = sequence_number; + have_requested_state_ = true; + apply_requested_state (); +} + +void TxInhibitTransceiver::start (unsigned sequence_number) noexcept +{ + sequence_number_ = sequence_number; + have_effective_state_ = false; + monotonic_clock_.start (); + started_ = true; + emit_status (); + wrapped_->start (sequence_number); +} + +void TxInhibitTransceiver::stop () noexcept +{ + if (!started_) return; + + expiry_timer_->stop (); + holds_.clear (); + started_ = false; + emit_status (); + wrapped_->stop (); + have_requested_state_ = false; + have_effective_state_ = false; +} + +void TxInhibitTransceiver::enqueue_jtty_pcm (QByteArray const& samples, + TxAudioQueueEpoch epoch, + qint64 enqueue_id) noexcept +{ + wrapped_->enqueue_jtty_pcm (samples, epoch, enqueue_id); +} + +void TxInhibitTransceiver::clear_jtty_pcm (TxAudioQueueEpoch epoch) noexcept +{ + wrapped_->clear_jtty_pcm (epoch); +} + +void TxInhibitTransceiver::apply_requested_state () noexcept +{ + if (!have_requested_state_ || !started_) return; + + auto effective = requested_; + if (!holds_.isEmpty ()) + { + effective.ptt (false); + effective.tune (false); + } + + auto const previous_ptt = have_effective_state_ && last_effective_.ptt (); + auto final_sent = false; + if (effective.ptt () != previous_ptt) + { + if (effective.ptt ()) + { + auto prepare = effective; + prepare.ptt (false); + if (!have_effective_state_ || prepare != last_effective_) + { + wrapped_->set (prepare, sequence_number_); + } + } + else + { + auto unkey = last_effective_; + unkey.ptt (false); + wrapped_->set (unkey, sequence_number_); + final_sent = unkey == effective; + } + } + if (!final_sent) wrapped_->set (effective, sequence_number_); + last_effective_ = effective; + have_effective_state_ = true; +} + +void TxInhibitTransceiver::emit_status () +{ + Q_EMIT statusChanged (started_, started_ && !holds_.isEmpty (), + holder_summary (), hold_rx_, release_rx_, expiries_, invalid_); +} + +void TxInhibitTransceiver::tx_inhibit_invalid (quint64 count) +{ + if (!started_ || !count) return; + invalid_ += static_cast (count); + emit_status (); +} + +void TxInhibitTransceiver::expire_holds () +{ + auto const was_inhibited = !holds_.isEmpty (); + auto const previous_holder = holder_summary (); + auto expired = false; + auto const now = monotonic_clock_.elapsed (); + for (auto it = holds_.begin (); it != holds_.end ();) + { + if (it->expires_at <= now) + { + it = holds_.erase (it); + ++expiries_; + expired = true; + } + else + { + ++it; + } + } + + if (was_inhibited != !holds_.isEmpty ()) apply_requested_state (); + if (expired || was_inhibited != !holds_.isEmpty () + || previous_holder != holder_summary ()) + { + emit_status (); + } + schedule_expiry (); +} + +QString TxInhibitTransceiver::holder_summary () const +{ + QStringList holders; + QSet seen; + for (auto it = holds_.cbegin (); it != holds_.cend (); ++it) + { + if (!it->holder.isEmpty () && !seen.contains (it->holder)) + { + seen.insert (it->holder); + holders.append (it->holder); + } + } + holders.sort (Qt::CaseInsensitive); + return holders.join (QStringLiteral (", ")); +} + +void TxInhibitTransceiver::tx_inhibit_command (QString controller, quint32 ttl_ms, QString station) +{ + if (!started_) return; + auto const was_inhibited = !holds_.isEmpty (); + if (!ttl_ms) + { + ++release_rx_; + holds_.remove (controller); + } + else + { + ++hold_rx_; + auto const expires_at = monotonic_clock_.elapsed () + ttl_ms; + auto const holder = sanitize_holder (station.isEmpty () ? controller : station); + auto existing = holds_.find (controller); + if (existing != holds_.end ()) + { + *existing = Hold {expires_at, holder}; + } + else + { + auto const tracked_count = holds_.size () + - (holds_.contains (overflow_hold_key) ? 1 : 0); + if (tracked_count < maximum_tracked_holds) + { + holds_.insert (controller, Hold {expires_at, holder}); + } + else + { + auto overflow = holds_.find (overflow_hold_key); + if (overflow == holds_.end ()) + { + holds_.insert (overflow_hold_key, Hold {expires_at, {}}); + } + else + { + overflow->expires_at = std::max (overflow->expires_at, expires_at); + } + } + } + } + + if (was_inhibited != !holds_.isEmpty ()) apply_requested_state (); + emit_status (); + schedule_expiry (); +} + +void TxInhibitTransceiver::schedule_expiry () +{ + if (holds_.isEmpty ()) + { + expiry_timer_->stop (); + return; + } + + auto next_expiry = std::numeric_limits::max (); + for (auto it = holds_.cbegin (); it != holds_.cend (); ++it) + { + next_expiry = std::min (next_expiry, it->expires_at); + } + auto const delay = std::max (1, next_expiry - monotonic_clock_.elapsed ()); + expiry_timer_->start (static_cast (std::min (delay, + std::numeric_limits::max ()))); +} diff --git a/Transceiver/TxInhibitTransceiver.hpp b/Transceiver/TxInhibitTransceiver.hpp new file mode 100644 index 00000000..fb3f0103 --- /dev/null +++ b/Transceiver/TxInhibitTransceiver.hpp @@ -0,0 +1,67 @@ +#ifndef TX_INHIBIT_TRANSCEIVER_HPP__ +#define TX_INHIBIT_TRANSCEIVER_HPP__ + +#include + +#include +#include +#include + +#include "Transceiver.hpp" + +class QTimer; + +class TxInhibitTransceiver final + : public Transceiver +{ + Q_OBJECT + +public: + static constexpr int maximum_tracked_holds {64}; + + explicit TxInhibitTransceiver (logger_type *, std::unique_ptr); + + void set (TransceiverState const&, unsigned sequence_number) noexcept override; + void start (unsigned sequence_number) noexcept override; + void stop () noexcept override; + void enqueue_jtty_pcm (QByteArray const&, TxAudioQueueEpoch, qint64) noexcept override; + void clear_jtty_pcm (TxAudioQueueEpoch) noexcept override; + + Q_SLOT void tx_inhibit_command (QString controller, quint32 ttl_ms, QString station); + Q_SLOT void tx_inhibit_invalid (quint64 count); + + Q_SIGNAL void statusChanged (bool supported, bool inhibited, + QString const& holder, + quint32 hold_rx, quint32 release_rx, + quint32 expiries, quint32 invalid); + +private: + struct Hold + { + qint64 expires_at; + QString holder; + }; + + void apply_requested_state () noexcept; + void emit_status (); + void expire_holds (); + QString holder_summary () const; + void schedule_expiry (); + + std::unique_ptr wrapped_; + QTimer * expiry_timer_; + QElapsedTimer monotonic_clock_; + QHash holds_; + TransceiverState requested_; + TransceiverState last_effective_; + unsigned sequence_number_ {0}; + quint32 hold_rx_ {0}; + quint32 release_rx_ {0}; + quint32 expiries_ {0}; + quint32 invalid_ {0}; + bool have_requested_state_ {false}; + bool have_effective_state_ {false}; + bool started_ {false}; +}; + +#endif diff --git a/TxStartPolicy.hpp b/TxStartPolicy.hpp new file mode 100644 index 00000000..2aef9a52 --- /dev/null +++ b/TxStartPolicy.hpp @@ -0,0 +1,46 @@ +#ifndef TXSTARTPOLICY_HPP__ +#define TXSTARTPOLICY_HPP__ + +#include + +constexpr double TxStartLatestPeriodFraction = 0.75; + +inline bool requires_standard_tx_message (QString const& mode) +{ + // These modes synthesize their Tx payload outside the standard Tx1-Tx6 slots. + return mode != "Echo" && mode != "WSPR" && mode != "FST4W" && mode != "JTTY"; +} + +inline bool tx_payload_ready (QString const& mode, int standard_message_length) +{ + return !requires_standard_tx_message (mode) || standard_message_length > 0; +} + +inline bool should_stop_for_missing_tx_payload (QString const& mode, + int standard_message_length, + bool tuning) +{ + return !tuning && !tx_payload_ready (mode, standard_message_length); +} + +inline bool tx_start_window_open (QString const& mode, bool tx_time, double period_fraction) +{ + return mode == "JTTY" + || (tx_time && period_fraction < TxStartLatestPeriodFraction); +} + +inline bool can_start_transmit (QString const& mode, bool tx_time, + double period_fraction, int standard_message_length, + bool tuning) +{ + return tuning || (tx_start_window_open (mode, tx_time, period_fraction) + && tx_payload_ready (mode, standard_message_length)); +} + +inline bool should_block_generated_transmit (QString const& generated_message, bool tuning) +{ + return !tuning + && generated_message.trimmed () == QStringLiteral ("*** bad message ***"); +} + +#endif diff --git a/UDPExamples/MessageServer.cpp b/UDPExamples/MessageServer.cpp index df5a312a..69048bb4 100644 --- a/UDPExamples/MessageServer.cpp +++ b/UDPExamples/MessageServer.cpp @@ -205,6 +205,7 @@ void MessageServer::impl::parse_message (QHostAddress const& sender, port_type s Q_EMIT self_->client_opened (client_key, QString::fromUtf8 (client_version), QString::fromUtf8 (client_revision)); } + clients_[client_key].sender_port_ = sender_port; clients_[client_key].last_activity_ = QDateTime::currentDateTime (); // diff --git a/UnitTests.txt b/UnitTests.txt index 749ac9ca..9a4bd69b 100644 --- a/UnitTests.txt +++ b/UnitTests.txt @@ -132,3 +132,94 @@ Commit No_AP MyCall BothCalls 7ad881: 1 7ad881: 2 7ad881: 3 + +Mode: JTTY +Data: W2PU_260807 (25 files, real on-air conversational QSO test between K9AN + and W2PU, 2026-08-07, D:\data\JTTY\W2PU_260807\) +Message: conversational (not a fixed repeated test message) +RxFreq: 1500/10 and 1500/50 (FTol) + +Metric: total accumulated decode lines logged by rjtty across the 25-file +corpus (each successful frame merge prints the slot's current full text, so +this counts decode *events*, not distinct correct messages -- a regression +check against the known-good snapshot, not a literal "number correct" count). + +Commit Lines(ftol=10) Lines(ftol=50) +----------------------------------------------------------------- +4e5aa053f (pre jtty_peakup fix): 240 238 +86fff7d28 (jtty_peakup fix): 241 241 +be1082f82 (merge-history dedup): 233 239 +0a6391c89/3bb309215 (3.5 Hz gate): 235 241 +7e511f229 (jtty_peakup stage 2): 235 241 +a09c8fd4c (retighten to 3.0 Hz): 235 241 +3d4676a45 (closed-slot dedup): 209 211 + +86fff7d28 fixed lib/jtty/jtty_peakup.f90's time-search upper bound (ib was +clamped to the sync-pattern length instead of the c1 buffer's actual valid +range, silently zeroing ~17.5% of channel-0 candidate refinements whose +coarse time offset exceeded ~0.416 s). 260807_134202.wav went from a +3-way-split, partly garbled decode to a single clean thread exactly matching +the known-correct message ("LOST THE END DUE TO 3 MINUTE TRANSITION"); +several other files' frequency estimates were also measurably more stable +post-fix. No duplicate-word corruption found in a full corpus diff. + +be1082f82 added per-slot merge-history dedup (matching a rediscovered frame +against a slot's full frame history, not just its current position), which +correctly recognizes more retro-resweep rediscoveries as dupes instead of +reprinting them -- the drop from 241 is dedup working better, not lost +content (spot-checked: no decoded text regressed). + +0a6391c89 tightened decode_and_merge's slot-merge frequency gate from 8.0 Hz +to 3.5 Hz (after a data-driven 3.0 Hz attempt was reverted -- a genuine +same-message frame pair on 260807_140633.wav measured df1~3.0 Hz, right at +that boundary, corrupting "KNOW IF PRIOR" into "KNOPRIOR"); erred tight +deliberately, accepting more orphan fragments (260807_134312.wav, +260807_134915.wav) in exchange for fewer wrong merges pending better +frequency-estimation precision. 3bb309215 is a same-day comment-only cleanup +of the debugging-narrative comments added along the way, no logic change. + +7e511f229 added a second refinement stage to jtty_peakup.f90: the existing +coarse search only combines the 13 sync symbols non-coherently (32 ms +coherent chunks, power-summed); stage 2 fits the near-linear phase ramp +across those symbols (from the coarse 0.5 Hz grid's own residual frequency +error) and coherently combines all 13 for a sharper f1. Measured on 51 +genuine on-air decodes down to -12 dB SNR: post-fit residual phase scatter +tracks SNR the way ordinary estimation noise does, with no evidence the +channel decorrelates over the full 416 ms window. No decoded-text changes +at either FTol; only displayed frequencies shifted ~1 Hz tighter (e.g. one +message's frame-to-frame spread went from 1.0 Hz to 0.4 Hz). + +a09c8fd4c retightened the frequency gate from 3.5 back to 3.0 Hz once the +jtty_peakup refinement above made that safe: the same 260807_140633.wav +case that forced 3.5 Hz measured under 2.3 Hz post-refinement. One file's +decoded text actually improved (a "RTTYS" merge artifact at 3.5 Hz resolves +to the correct "RTTY FOLKS" at 3.0 Hz); the two genuinely-wider-than-gate +files still show their known orphan fragments either way. + +3d4676a45 fixed a duplicate-decode bug found via a new QRM test (see below): +decode_and_merge's match scan skipped closed slots (is_last_frame) entirely, +including the history-dedup fallback, so a closed slot's own signal being +rediscovered later (e.g. a short single-frame message found again by an +overlapping search window) always spawned a brand-new slot instead of being +recognized as a duplicate. Closed slots now still run the history-dedup +check while staying closed to new continuations; a pure dedup hit (no new +text merged) also no longer reprints an unchanged line. The line-count drop +here (235/241 to 209/211) is these now-suppressed duplicate reprints, not +lost content (full-corpus diff was pure deletions, no text changes, no new +duplicate-word corruption). + +Mode: JTTY +Data: sjtty_qrm QRM-overlap test (synthetic, generated by lib/jtty/sjtty_qrm.f90) +Message: multiple simultaneous signals at nearby frequencies, generated by: + sjtty_qrm 384 MM 1200 1800 5 1 -5 +RxFreq: 1500/50 (FTol) + +This generates one on-frequency signal (1500 Hz, "599 123") plus 4 nearby +interferers with substantial frequency overlap (this run: KP4SX @1758.3, +LV7QFH @1240.1, N2PPI @1430.0, N6GP @1511.6 Hz). Confirmed post-3d4676a45: +rjtty and the WSJT-X GUI both decode all 5 signals exactly once each in the +"All Decodes" pane; the "QSO Frequency" pane (narrower FTol) correctly shows +only the signals within tolerance of RxFreq. No fixed WAV file is kept in +the repo (regenerate with sjtty_qrm as needed) -- this is a good spot-check +for the closed-slot dedup fix and for signal-subtraction/QRM handling more +generally. diff --git a/WFPalette.cpp b/WFPalette.cpp index d7d8a5e6..d59fa70f 100644 --- a/WFPalette.cpp +++ b/WFPalette.cpp @@ -26,6 +26,7 @@ #include #include "qt_helpers.hpp" +#include "widgets/MessageBox.hpp" #include "ui_wf_palette_design_dialog.h" @@ -73,7 +74,7 @@ namespace auto line = in.readLine(); ++line_counter; - if (++count >= points) + if (++count > points) { throw_qstring (QObject::tr ("Error reading waterfall palette file \"%1:%2\" too many colors.") .arg (file.fileName ()).arg (line_counter)); @@ -221,8 +222,15 @@ namespace auto file_name = QFileDialog::getOpenFileName (this, tr ("Import Palette"), docs, tr ("Palettes (*.pal)")); if (!file_name.isEmpty ()) { - colours_ = load_palette (file_name); - load_table (); + try + { + colours_ = load_palette (file_name); + load_table (); + } + catch (std::exception const& error) + { + MessageBox::critical_message (this, tr ("Import Palette Failed"), QString::fromLocal8Bit (error.what ())); + } } } @@ -237,7 +245,8 @@ namespace file_name += ".pal"; } QFile file {file_name}; - if (file.open (QFile::WriteOnly | QFile::Truncate | QFile::Text)) + bool ok {file.open (QFile::WriteOnly | QFile::Truncate | QFile::Text)}; + if (ok) { QTextStream stream {&file}; Q_FOREACH (auto colour, colours_) @@ -250,10 +259,15 @@ namespace #endif ; } + stream.flush (); + ok = stream.status () == QTextStream::Ok && file.error () == QFileDevice::NoError; } - else + if (!ok) { - throw_qstring (QObject::tr ("Error writing waterfall palette file \"%1\": %2.").arg (file.fileName ()).arg (file.errorString ())); + MessageBox::critical_message (this, tr ("Export Palette Failed"), + tr ("Error writing waterfall palette file \"%1\": %2.") + .arg (file.fileName ()).arg (file.errorString ())); + return; } } } diff --git a/WSJTXLogging.cpp b/WSJTXLogging.cpp index 898de875..7f1e1da5 100644 --- a/WSJTXLogging.cpp +++ b/WSJTXLogging.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include "Logger.hpp" #include "qt_helpers.hpp" @@ -240,7 +241,10 @@ WSJTXLogging::WSJTXLogging () default_log_config (); } - ::qInstallMessageHandler (&qt_log_handler); + QFile f(QApplication::applicationDirPath() + "/qdebug"); + if(!f.exists()) { + ::qInstallMessageHandler (&qt_log_handler); + } } WSJTXLogging::~WSJTXLogging () diff --git a/WSPR/WSPRBandHopping.cpp b/WSPR/WSPRBandHopping.cpp index c5652f52..59ecdfeb 100644 --- a/WSPR/WSPRBandHopping.cpp +++ b/WSPR/WSPRBandHopping.cpp @@ -1,5 +1,6 @@ #include "WSPRBandHopping.hpp" +#include #include #include @@ -422,9 +423,9 @@ auto WSPRBandHopping::next_hop (bool tx_enabled) -> Hop { // build new random permutations m_->rx_permutation_ = target_rx_bands.values (); - std::random_shuffle (std::begin (m_->rx_permutation_), std::end (m_->rx_permutation_)); + std::shuffle (std::begin (m_->rx_permutation_), std::end (m_->rx_permutation_), m_->gen_); m_->tx_permutation_ = target_tx_bands.values (); - std::random_shuffle (std::begin (m_->tx_permutation_), std::end (m_->tx_permutation_)); + std::shuffle (std::begin (m_->tx_permutation_), std::end (m_->tx_permutation_), m_->gen_); // qDebug () << "New random Rx permutation:" << m_->rx_permutation_ // << "random Tx permutation:" << m_->tx_permutation_; } diff --git a/WaitFeaturePolicy.hpp b/WaitFeaturePolicy.hpp new file mode 100644 index 00000000..27b1237d --- /dev/null +++ b/WaitFeaturePolicy.hpp @@ -0,0 +1,105 @@ +#ifndef WAITFEATUREPOLICY_HPP +#define WAITFEATUREPOLICY_HPP + +#include + +#include "SpecialOperatingActivity.hpp" + +struct WaitFeatureContext +{ + WaitFeatureContext (QString const& mode, + SpecialOperatingActivity specialOperation, + bool waitFeaturesEnabled, + bool autoSequenceEnabled, + bool hasDxCall, + bool ncccSprint) + : mode {mode} + , specialOperation {specialOperation} + , waitFeaturesEnabled {waitFeaturesEnabled} + , autoSequenceEnabled {autoSequenceEnabled} + , hasDxCall {hasDxCall} + , ncccSprint {ncccSprint} + { + } + + QString mode; + SpecialOperatingActivity specialOperation; + bool waitFeaturesEnabled; + bool autoSequenceEnabled; + bool hasDxCall; + bool ncccSprint; +}; + +enum class EnableTxWarning +{ + NONE, + WAIT_AND_REPLY, + NCCC_SPRINT, + HOUND_AUTO_REPLY +}; + +inline bool slow_wait_feature_mode_supported (QString const& mode) +{ + return mode == "FT8" || mode == "FT4" || mode == "Q65" || mode == "FST4" + || mode == "JT65" || mode == "JT9" || mode == "JT4"; +} + +inline bool wait_and_reply_mode_supported (QString const& mode) +{ + return slow_wait_feature_mode_supported (mode) || mode == "MSK144"; +} + +inline bool nccc_sprint_auto_reply (WaitFeatureContext const& context) +{ + return context.mode == "FT4" + && context.specialOperation == SpecialOperatingActivity::NA_VHF + && context.ncccSprint; +} + +inline EnableTxWarning enable_tx_warning (WaitFeatureContext const& context) +{ + if (!context.hasDxCall || context.specialOperation == SpecialOperatingActivity::FOX) + { + return EnableTxWarning::NONE; + } + if (context.specialOperation == SpecialOperatingActivity::HOUND) + { + return context.mode == "FT8" + ? EnableTxWarning::HOUND_AUTO_REPLY + : EnableTxWarning::NONE; + } + if (nccc_sprint_auto_reply (context)) + { + return EnableTxWarning::NCCC_SPRINT; + } + if (context.waitFeaturesEnabled && wait_and_reply_mode_supported (context.mode)) + { + return EnableTxWarning::WAIT_AND_REPLY; + } + return EnableTxWarning::NONE; +} + +inline bool wait_and_call_mode_supported (QString const& mode) +{ + return mode == "FT8" || mode == "FT4" || mode == "Q65" || mode == "FST4" + || mode == "MSK144"; +} + +inline bool wait_and_call_arming_eligible (WaitFeatureContext const& context) +{ + auto const ordinaryWithCall = context.specialOperation == SpecialOperatingActivity::NONE + && context.hasDxCall; + auto const ft8Hound = context.mode == "FT8" + && context.specialOperation == SpecialOperatingActivity::HOUND; + return context.waitFeaturesEnabled + && context.autoSequenceEnabled + && wait_and_call_mode_supported (context.mode) + && (ordinaryWithCall || ft8Hound); +} + +inline bool wait_and_call_warning_eligible (WaitFeatureContext const& context) +{ + return context.hasDxCall && wait_and_call_arming_eligible (context); +} + +#endif // WAITFEATUREPOLICY_HPP diff --git a/bundle_fixup/CMakeLists.txt b/bundle_fixup/CMakeLists.txt index 0210c652..bedccdc1 100644 --- a/bundle_fixup/CMakeLists.txt +++ b/bundle_fixup/CMakeLists.txt @@ -18,9 +18,7 @@ if (APPLE OR WIN32) # if a system Qt is used (e.g. installed in /usr/lib/), it will not be included in the installation set (fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/${CMAKE_PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}") set (fixup_exes "${fixup_exe}") - if (NOT WSJT_SKIP_MAP65) - list (APPEND fixup_exes "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/map65${CMAKE_EXECUTABLE_SUFFIX}") - endif () + list (APPEND fixup_exes "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/map65${CMAKE_EXECUTABLE_SUFFIX}") #get_filename_component (hamlib_lib_dir ${Hamlib_LIBRARIES} PATH) @@ -84,14 +82,16 @@ if (APPLE OR WIN32) get_filename_component (usb_lib_dir ${Usb_LIBRARY} PATH) list (APPEND fixup_library_dirs ${usb_lib_dir}) - if (NOT WSJT_SKIP_MAP65) - get_filename_component (portaudio_lib_dir ${Portaudio_LIBRARY} PATH) - list (APPEND fixup_library_dirs ${portaudio_lib_dir}/../bin) - endif () + get_filename_component (portaudio_lib_dir ${Portaudio_LIBRARY} PATH) + list (APPEND fixup_library_dirs ${portaudio_lib_dir}/../bin) get_filename_component (fftw_lib_dir ${FFTW3F_LIBRARY} PATH) list (APPEND fixup_library_dirs ${fftw_lib_dir}) + foreach (boost_lib_dir IN LISTS Boost_LIBRARY_DIRS) + list (APPEND fixup_library_dirs ${boost_lib_dir} ${boost_lib_dir}/../bin) + endforeach () + # install required Qt plugins install ( DIRECTORY diff --git a/ci-cd/DEPLOYMENT_PLAYBOOK.md b/ci-cd/DEPLOYMENT_PLAYBOOK.md new file mode 100644 index 00000000..e2baa966 --- /dev/null +++ b/ci-cd/DEPLOYMENT_PLAYBOOK.md @@ -0,0 +1,878 @@ +# CI/CD Deployment Playbook + +Reference for configuring and operating the WSJT-X GitHub Actions CI/CD pipeline in the official `WSJTX` organization repositories. + +**Audience:** Repository administrators and release managers responsible for CI/CD configuration and release credentials. + +--- + +## Table of Contents + +1. [Prerequisites](#1-prerequisites) +2. [Architecture Overview](#2-architecture-overview) +3. [Phase 1: Enable GitHub Actions on the Org](#3-phase-1-enable-github-actions-on-the-org) +4. [Phase 2: Adapt Workflow Files](#4-phase-2-adapt-workflow-files) +5. [Phase 3: Create Repository Secrets](#5-phase-3-create-repository-secrets) +6. [Phase 4: Supporting Files](#6-phase-4-supporting-files) +7. [Phase 5: Submit the PR](#7-phase-5-submit-the-pr) +8. [Phase 6: Test the CI Pipeline](#8-phase-6-test-the-ci-pipeline) +9. [Phase 7: Test the Release Pipeline](#9-phase-7-test-the-release-pipeline) +10. [Ongoing Maintenance](#10-ongoing-maintenance) +11. [Troubleshooting](#11-troubleshooting) +12. [Reference: Complete File Inventory](#12-reference-complete-file-inventory) + +--- + +## 1. Prerequisites + +Before starting, confirm every item on this list. Missing any one of them will block deployment. + +### Access & Permissions + +| Requirement | How to Verify | Who Can Grant | +|-------------|---------------|---------------| +| **Org admin** or **repo admin** on `WSJTX/wsjtx-internal` | Go to repo → Settings. If you see "Actions" in the left sidebar, you have admin access. | Org owner (Joe K1JT) | +| **Write access** to `WSJTX/wsjtx` (public repo) | Try `gh api repos/WSJTX/wsjtx --jq .permissions.push` — should return `true` | Org owner | +| **GitHub Actions enabled** at the org level | Org Settings → Actions → General. Must not show "Actions permissions: Disabled" | Org owner | + +### Credentials You'll Need + +| Credential | Where to Get It | Format | +|------------|-----------------|--------| +| Apple Developer ID Application certificate (.p12) | Export from the Apple Developer account holder's keychain | PKCS12 file + password | +| Apple Developer ID Installer certificate (.p12) | Export from the Apple Developer account holder's keychain | PKCS12 file + password | +| App Store Connect API key (for notarization) | A team-owned key created by the Apple Developer Account Holder | `.p8` private key, key ID, and issuer ID | +| Apple Team ID | Apple Developer portal → Membership Details | 10-char alphanumeric like `ABCDE12345` | +| GitHub fine-grained PAT | github.com → Settings → Developer settings → Fine-grained tokens | `github_pat_...` token string | + +### Tools + +- `gh` ([GitHub CLI](https://cli.github.com/)) authenticated with an account that has admin access to the target repos +- `base64` command (macOS and Linux both have this) +- Git with push access to `WSJTX/wsjtx-internal` + +--- + +## 2. Architecture Overview + +Understanding the architecture will help you debug issues during deployment. + +> **Tag convention.** Internal `build/v*` tags identify immutable candidates. Only manual promotion creates the corresponding public `v*` tag; public distribution builds start from that public tag. + +### Workflow Structure + +``` +.github/workflows/ +├── ci.yml ← Orchestrator. Triggers on develop and release/**. +│ Linux x86_64 is the default path; full-ci or a +│ manual run selects broader platform coverage. +│ +├── build-macos.yml ← Reusable workflow (workflow_call). +│ macOS build (arm64 or x86_64); Developer ID +│ signing and notarization require credentials. +│ +├── build-linux.yml ← Reusable workflow (workflow_call). +│ Linux build (x86_64, aarch64, or armhf), +│ unsigned. +│ +├── build-windows.yml ← Reusable workflow (workflow_call). +│ Windows x86_64 via MSYS2/MinGW64. Installer +│ signing per sign_mode input: ephemeral +│ self-signed osslsigncode (CI/DEVEL/RC) or +│ none (GA — SignPath signs downstream, §5.4). +│ +├── sign-windows-release.yml ← Public repo (WSJTX/wsjtx) only; triggered by +│ promoted v* tags for both RC and GA. +│ Rebuilds the installer from public source, +│ SignPath authenticode-signs it, verifies the +│ chain and expected signer (hard-fail for RC/GA). +│ +├── signpath-smoke.yml ← workflow_dispatch; public repo. +│ ~2-minute SignPath round-trip check +│ with a trivial PE — no WSJT source built. +│ +├── hamlib-upstream-check.yml ← Scheduled (`cron: '0 12 * * MON'`) + `workflow_dispatch`. +│ Weekly poll of Hamlib upstream tags; files a +│ GitHub issue when a newer 4.x release is available. +│ No platform builds; self-contained. +│ +├── release.yml ← Internal `build/v*` candidate builds only. +│ Uploads validation artifacts; never publishes. +│ +└── promote-release.yml ← Manual candidate validation and public tag promotion. +``` + +### How It Flows + +**On pushes and pull requests to `develop` or `release/**`:** +``` +Push or pull request + └─→ ci.yml triggers + ├─→ validate workflow policy and release-state.txt + └─→ build/test Linux x86_64 by default + └─→ full-ci or manual selection adds other platforms +``` + +**For an RC or GA release:** +``` +release/X.Y metadata commit + └─→ Prepare Release Candidate validates/creates build/vX.Y.Z[-rcN] + └─→ release.yml builds the private candidate + └─→ release manager validates/promotes that candidate + └─→ public vX.Y.Z[-rcN] builds and signs all distributions + └─→ public-release approval publishes the release +``` + +The two approvals answer different questions: source promotion approves disclosure of the reviewed candidate, while `public-release` approves the exact publication artifacts after they exist. An RC publishes a public tag without moving `master`; GA also advances `master` to the promoted commit. + +### Build Strategy + +Each platform build does the same two-stage process: +1. **Build Hamlib 4.7.2** from source (cached after first run) +2. **Build WSJT-X** against the Hamlib install prefix + +This matches what developers do locally but doesn't use the superbuild. The superbuild's ExternalProject approach doesn't map well to CI caching. Building Hamlib directly and caching its install prefix gives better cache hits and faster builds. + +### What Gets Cached + +| Cache | Key | Saves | +|-------|-----|-------| +| Hamlib install (per platform × arch) | `hamlib-{os}-{arch}-{branch}-{workflow-hash}` on macOS and Linux (separate caches for macOS arm64 vs. x86_64 and Linux x86_64 vs. aarch64); `hamlib-windows-{branch}-{workflow-hash}` on Windows (single arch) | 5-10 min per platform | +| MSYS2 packages | Built-in `cache: true` parameter | 3-5 min on Windows | + +Caches invalidate when the Hamlib branch changes or the workflow file changes. This is intentional — if you change build flags, the cache rebuilds. + +### What the Release Produces + +Each approved public `v*` tag yields one installer per target plus a source tarball on the public GitHub Release: + +| Artifact | Produced by | Format | +|----------|-------------|--------| +| `wsjtx--arm64-macOS.pkg` | `build-macos.yml` (arm64 leg) | Hosted Developer ID signing, or a validated package for manual replacement | +| `wsjtx--x86_64-macOS.pkg` | `build-macos.yml` (x86_64 leg) | Hosted Developer ID signing, or a validated package for manual replacement | +| `wsjtx--linux-x86_64.AppImage` | `build-linux.yml` (x86_64 leg) | Portable AppImage | +| `wsjtx--linux-aarch64.AppImage` | `build-linux.yml` (aarch64 leg) | Portable AppImage | +| `wsjtx--linux-armhf.AppImage` | `build-linux.yml` (armhf leg) | Portable AppImage | +| Linux x86_64 `.deb` and `.rpm` | `build-linux.yml` (x86_64 leg) | Distribution packages | +| Linux aarch64 `.deb` and `.rpm` | `build-linux.yml` (aarch64 leg) | Distribution packages | +| Linux armhf `.deb` and `.rpm` | `build-linux.yml` (armhf leg) | Distribution packages | +| `wsjtx--win64.exe` | `build-windows.yml` | SignPath Foundation Authenticode for both public RC and GA | +| `wsjtx--src.tar.gz` | Public release workflow | Source tarball from the public tag | + +The project-created source tarball is assembled from the public tag. GitHub also generates its own zip and tar.gz source archives for that tag; they contain the tagged tree but may have different compressed hashes. `SHA256SUMS` covers immutable payload assets uploaded by the workflow. In manual macOS signing mode it excludes the two replaceable `.pkg` files, which the release manifest identifies separately. The manifest also records the tag, source commit, workflow run, and builder provenance. Checksums detect changed bytes; platform signatures establish signer identity and must be verified separately. + +### All-Platforms-Ready Gate + +Before publishing, the release workflow requires each platform build to produce its expected installer artifact. This prevents a structurally successful build job from creating a partial release. + +The gate checks for one installer per platform: + +| Platform | Expected artifact pattern | +|----------|---------------------------| +| macOS arm64 | Hosted-signing artifact, or `artifacts/wsjtx--arm64-macOS-unsigned.pkg/*.pkg` in manual mode | +| macOS x86_64 | Hosted-signing artifact, or `artifacts/wsjtx--x86_64-macOS-unsigned.pkg/*.pkg` in manual mode | +| Linux x86_64 | `artifacts/wsjtx--linux-x86_64-AppImage/*.AppImage` | +| Linux aarch64 | `artifacts/wsjtx--linux-aarch64-AppImage/*.AppImage` | +| Linux armhf | `artifacts/wsjtx--linux-armhf-AppImage/*.AppImage` | +| Linux packages | One non-empty `.deb` and `.rpm` under each architecture's artifact directory | +| Windows x86_64 | `artifacts/wsjtx--windows-x86_64-installer-signed/*.exe` | + +If any pattern matches zero files, the release job stops before publishing. + +Presence alone is insufficient. The publication gate also requires the expected production filenames and reports, and verifies that their hashes, public tag, and source SHA agree. In manual macOS signing mode the reports prove that the unsigned packages came from the expected validation builds; their final signatures are verified after manual replacement. A separate installed-runtime smoke test remains necessary because cryptographic verification does not establish application behavior. + +--- + +## 3. Phase 1: Enable GitHub Actions on the Org + +This is a **one-time setup** that requires org owner access. + +### Step 1: Navigate to Org Actions Settings + +``` +https://github.com/organizations/WSJTX/settings/actions +``` + +Or: GitHub → WSJTX org → Settings (gear icon) → Actions → General + +### Step 2: Set Actions Permissions + +Under **Actions permissions**, select one of: +- **"Allow all actions and reusable workflows"** — simplest, allows everything +- **"Allow WSJTX, and select non-WSJTX, actions and reusable workflows"** — more restrictive + +If you choose the restrictive option, explicitly allow the third-party actions used by the workflows: +- `actions/checkout@v7` +- `actions/cache/restore@v5` and `actions/cache/save@v5` +- `actions/cache/restore@v6` and `actions/cache/save@v6` +- `actions/upload-artifact@v7` +- `actions/download-artifact@v8` +- `msys2/setup-msys2@v2` + +**Important:** GitHub's allowlist must match each workflow `uses:` entry. Re-run the following after any Dependabot bump to stay aligned: + +```bash +grep -rE 'uses: (actions/|msys2/)' .github/workflows/ | sort -u +``` + +### Step 3: Set Workflow Permissions + +Under **Workflow permissions**, select: +- **"Read and write permissions"** + +This allows the release workflow to create GitHub Releases and push tags. Without write permissions, the release job will fail with a 403 error. + +### Step 4: Verify + +```bash +gh api orgs/WSJTX --jq '.has_organization_projects' +# Just verifying API access to the org works + +gh api repos/WSJTX/wsjtx-internal/actions/permissions --jq '.enabled' +# Should return: true +``` + +If `enabled` returns `false`, Actions is still disabled. Double-check the org settings. + +--- + +## 4. Phase 2: Install the Release Workflows + +The workflows in this repository are already configured for private trunk `develop`, release branches `release/**`, public branch `master`, and public repository `WSJTX/wsjtx`. Copying an older prototype or changing repository names inside `release.yml` would restore the obsolete behavior where an internal build published and synchronized source in one step. + +The release-related files have distinct responsibilities: + +| File | Responsibility | +|------|----------------| +| `release-state.txt` | Tracked numeric version, channel, RC number, and archive revision placeholder | +| `release-tag-helper.yml` | Validate the release-branch tip and CI, create an immutable private candidate tag, then call the candidate build | +| `release.yml` | Build private validation artifacts only; never publish or copy source | +| `promote-release.yml` | Validate the candidate run and manually copy its exact commit to the public tag; update public `master` only for GA | +| `public-release.yml` | Rebuild from public source, sign RC/GA installers, assemble an inspectable bundle, and publish after approval | + +`release-state.txt` is the version source of truth. Keep `revision=$Format:%H$` literal in Git; Git expands it in exported archives. The workflows reject a tag whose version/channel does not match the tracked state. + +The Hamlib version remains pinned on reusable-workflow calls. To audit all pin sites before changing it: + +```bash +rg -n 'hamlib_branch:' .github/workflows +``` + +--- + +## 5. Phase 3: Create Repository Secrets + +Use environments to keep credentials out of ordinary build jobs. On the private repository, `candidate-tagging` and `source-promotion` permit protected `release/*` branches; only `source-promotion` contains the cross-repository token. On the public repository, signing environments permit `v*` release tags. Only `public-release` needs a required reviewer; the other environments scope credentials and refs without adding approval prompts. + +Configure and restrict these environments before merging workflow code that can reference their credentials. Copy each existing repository-level release secret into its designated environment, verify the environment copy, and then delete the repository-level secret before the workflows become reachable. GitHub can otherwise fall back to a same-named repository secret when a job references `secrets.NAME`, defeating the intended ref restriction. In particular, remove any repository-level `CROSS_REPO_TOKEN` and `SIGNPATH_API_TOKEN`; keep Apple credentials environment-only from the outset. + +### Navigate to Secrets Settings + +``` +https://github.com/WSJTX/wsjtx-internal/settings/environments +``` + +Or: Repo → Settings → Environments. Create `candidate-tagging` and `source-promotion`, restrict both to protected `release/*` branches, and put the token below only in `source-promotion`. + +### 5.1 Secret 1: `CROSS_REPO_TOKEN` + +**Purpose:** Allows the release workflow to push source code and tags to the public repo (`WSJTX/wsjtx`). + +**How to create the PAT:** + +1. Go to https://github.com/settings/personal-access-tokens/new +2. Select **"Fine-grained personal access tokens"** +3. Configure: + - **Token name:** `wsjtx-release-sync` (or similar) + - **Expiration:** 1 year (maximum). Set a calendar reminder to rotate it before expiry. + - **Resource owner:** Select the `WSJTX` organization + - **Repository access:** Select "Only select repositories" → choose `WSJTX/wsjtx` + - **Permissions:** + - **Contents:** Read and write (to push code) + - **Workflows:** Read and write (to push `.github/workflows/` files) + - All other permissions: leave as "No access" +4. Click "Generate token" +5. **Copy the token immediately** — you cannot view it again. + +**Important:** The token must be created by someone who has **admin access to the target repo** (`WSJTX/wsjtx`). A fine-grained token scoped to a repo you don't admin will fail silently. + +**Set the secret:** +```bash +# Paste the token when prompted (it won't echo to the terminal): +gh secret set CROSS_REPO_TOKEN --repo WSJTX/wsjtx-internal --env source-promotion +``` + +**Why not a deploy key?** Deploy keys cannot push `.github/workflows/` files. This is a GitHub platform restriction. The error message ("refusing to allow an OAuth App to create or update workflow") is misleading — it applies to any non-PAT credential, including deploy keys over SSH. + +### 5.2 macOS Code Signing Environment + +Create the `apple-release-signing` environment on `WSJTX/wsjtx`, restrict it to release tags, and grant access only to release maintainers. These four secrets provide the distinct Developer ID identities used for application code and installer packages. Prefer fresh, CI-specific certificates rather than transferring a maintainer's long-lived personal export. + +#### Credential responsibilities + +The WSJT-X Apple Developer membership is currently held by **John G4KLA**, who is therefore the current Apple Developer Account Holder. The responsibilities below are described by role so that the procedure remains valid if the Account Holder changes. + +The Apple Developer account holder exports the signing identities. A repository administrator stores the exported credentials as GitHub Actions secrets. The team must assign responsibility for credential rotation and release-artifact verification. + +The workflow uses two identities with different responsibilities: + +- **Developer ID Application** signs application executables, frameworks, plug-ins, and command-line tools. +- **Developer ID Installer** signs the outer `.pkg` installer. + +Notarization uses the App Store Connect API key in §5.3 rather than either certificate password. Rotate a certificate's `.p12` and password together. Rotate the notarization key on the team's schedule, when access changes, or after suspected exposure. + +#### Preparing the .p12 files + +You need two signing identities associated with the Apple Developer team: +- **Developer ID Application** — signs the app binary and dylibs +- **Developer ID Installer** — signs the `.pkg` installer + +If you already have `.p12` files exported from Keychain Access, skip to the base64 step. + +**To export from Keychain Access (on a Mac):** + +1. Open Keychain Access +2. In the left sidebar, select "login" keychain +3. Click "My Certificates" tab +4. Find "Developer ID Application: [Team Name]" +5. Right-click → "Export..." +6. Choose format: Personal Information Exchange (.p12) +7. Save as `app.p12` +8. Enter a password when prompted — you'll need this for the secret +9. Repeat for "Developer ID Installer: [Team Name]" → save as `installer.p12` + +#### Base64-encode the certificates + +GitHub secrets are text, so binary `.p12` files must be base64-encoded: + +```bash +# On macOS: +base64 -i app.p12 -o app.p12.b64 +base64 -i installer.p12 -o installer.p12.b64 + +# On Linux: +base64 -w0 app.p12 > app.p12.b64 +base64 -w0 installer.p12 > installer.p12.b64 +``` + +#### Set the four secrets + +```bash +# Application signing certificate (base64-encoded .p12): +gh secret set DEVELOPER_ID_CERTIFICATE_P12 --repo WSJTX/wsjtx --env apple-release-signing < app.p12.b64 + +# Password for the application certificate: +gh secret set DEVELOPER_ID_CERTIFICATE_PASSWORD --repo WSJTX/wsjtx --env apple-release-signing +# (paste the password you chose when exporting, press Enter) + +# Installer signing certificate (base64-encoded .p12): +gh secret set DEVELOPER_ID_INSTALLER_P12 --repo WSJTX/wsjtx --env apple-release-signing < installer.p12.b64 + +# Password for the installer certificate: +gh secret set DEVELOPER_ID_INSTALLER_PASSWORD --repo WSJTX/wsjtx --env apple-release-signing +# (paste the password you chose when exporting, press Enter) +``` + +**After setting secrets, delete the local .p12 and .b64 files.** They contain your signing keys. + +```bash +rm app.p12 installer.p12 app.p12.b64 installer.p12.b64 +``` + +### 5.3 Apple Notarization API Key + +Notarization submits the signed package to Apple's service for automated security checks. An accepted submission is then stapled to the package so the ticket can be validated without contacting Apple. Notarization is distinct from Developer ID signing and does not by itself verify Gatekeeper acceptance or application behavior. + +Have the Account Holder create a team-owned App Store Connect API key scoped for notarization. Store its key ID as `APP_STORE_CONNECT_KEY_ID`, issuer ID as `APP_STORE_CONNECT_ISSUER_ID`, and base64-encoded `.p8` as `APP_STORE_CONNECT_PRIVATE_KEY_P8_BASE64`, all as `apple-release-signing` environment secrets. + +Configure these non-secret variables in the same environment: `APPLE_TEAM_ID`, `APPLE_APPLICATION_CERTIFICATE_SHA1`, and `APPLE_INSTALLER_CERTIFICATE_SHA1`. The SHA-1 values are the full certificate fingerprints without relying on certificate-name matching. Keeping expected identities separate lets the job reject a valid but unintended certificate. + +```bash +gh secret set APP_STORE_CONNECT_KEY_ID --repo WSJTX/wsjtx --env apple-release-signing +gh secret set APP_STORE_CONNECT_ISSUER_ID --repo WSJTX/wsjtx --env apple-release-signing +gh secret set APP_STORE_CONNECT_PRIVATE_KEY_P8_BASE64 --repo WSJTX/wsjtx --env apple-release-signing +gh variable set APPLE_TEAM_ID --repo WSJTX/wsjtx --env apple-release-signing --body '' +gh variable set APPLE_APPLICATION_CERTIFICATE_SHA1 --repo WSJTX/wsjtx --env apple-release-signing --body '<40-hex-fingerprint>' +gh variable set APPLE_INSTALLER_CERTIFICATE_SHA1 --repo WSJTX/wsjtx --env apple-release-signing --body '<40-hex-fingerprint>' +``` + +Do not use a maintainer's Apple ID password or app-specific password. The API key is independently revocable and does not tie unattended releases to one person's login. + +### Verification: Confirm All Secrets Are Set + +```bash +gh secret list --repo WSJTX/wsjtx --env apple-release-signing +``` + +The environment inventory must contain both certificate identities and the API-key notarization credential set declared by `build-macos.yml`: `DEVELOPER_ID_CERTIFICATE_P12`, `DEVELOPER_ID_CERTIFICATE_PASSWORD`, `DEVELOPER_ID_INSTALLER_P12`, `DEVELOPER_ID_INSTALLER_PASSWORD`, `APP_STORE_CONNECT_KEY_ID`, `APP_STORE_CONNECT_ISSUER_ID`, and `APP_STORE_CONNECT_PRIVATE_KEY_P8_BASE64`. Separately confirm `CROSS_REPO_TOKEN` in private environment `source-promotion`. + +Also configure the public workflow's non-secret expected Apple Team ID and SHA-1 fingerprints for the Application and Installer certificates. These are identifiers, not private-key material; the distribution job uses them to reject a valid but unintended identity. + +Set repository variable `MACOS_DISTRIBUTION_SIGNING_ENABLED=false` until the full environment is configured and tested. In that state the workflow publishes validated unsigned packages under the stable release filenames so a release manager can replace them manually. The manifest identifies those two packages as replaceable and excludes them from immutable hashes; workflow reruns preserve existing packages by name. Set the variable to `true` only after both architectures complete signing, notarization, stapling, identity, entitlement, and Gatekeeper verification. Distribution mode fails closed if any credential is absent. + +> **About Windows signing.** RC and GA installers are Authenticode-signed by SignPath Foundation on the **public** repo — see §5.4. No Windows certificate private key exists in GitHub; it remains in SignPath's HSM. Ordinary CI builds may use a per-run ephemeral self-signed certificate. + +### 5.4 Windows Authenticode Signing via SignPath Foundation + +> **How it works.** SignPath Foundation signs OSS artifacts built from the public repository, so the signature attests public-source provenance as well as identity. A promoted `vX.Y.Z` or `vX.Y.Z-rcN` tag triggers the public build, submits the unsigned installer under the `release-signing` policy, verifies the returned Authenticode signature and timestamp, and makes that verified installer eligible for publication. A failed or rejected request blocks the release. The certificate's private key lives in SignPath's HSM; there is no `.pfx` to export or store in GitHub. + +#### The one secret + +Create public environment `windows-release-signing`, restrict it to protected `master` and `v*` release tags, and set the token there (not on `wsjtx-internal`). `master` access permits the explicit smoke-test workflow; production signing still accepts only a public RC or GA tag. + +```bash +gh secret set SIGNPATH_API_TOKEN --repo WSJTX/wsjtx --env windows-release-signing +# (paste the SignPath CI user's API token, press Enter) +``` + +Set `WINDOWS_SIGNER_SUBJECT` and comma-separated `WINDOWS_SIGNER_THUMBPRINTS` as variables in that environment. The thumbprint list permits an explicit certificate rollover window; remove the old value after rollover. + +```bash +gh variable set WINDOWS_SIGNER_SUBJECT --repo WSJTX/wsjtx --env windows-release-signing --body '' +gh variable set WINDOWS_SIGNER_THUMBPRINTS --repo WSJTX/wsjtx --env windows-release-signing --body '[,]' +``` + +The SignPath CI user must be a **submitter** on the signing policies (`release-signing`, `test-signing`). The public workflow consumes its own signed result; the internal promotion token does not need access to SignPath credentials. + +#### SignPath dashboard configuration + +- **Artifact configuration** — GitHub Actions artifacts are always ZIP-wrapped, so the root element must be `zip-file`: + + ```xml + + + + + + + + + ``` + +- **Trusted build system** — the predefined *GitHub.com* trusted build system added to the SignPath org and linked to the `wsjtx` project; the [SignPath GitHub App](https://github.com/apps/signpath) installed with access to the public repo (origin verification). + +#### Validation + +`signpath-smoke.yml` (workflow_dispatch on the public repo) signs a trivial hello-world PE through the complete round trip in ~2 minutes — no WSJT source is built or exposed. Dispatch it against `test-signing` to validate plumbing without consuming a `release-signing` approval. Success: the workflow completes green — the returned exe carries a parseable Authenticode signature (hard-checked); chain status is printed for inspection only, since the test certificate never chains to a trusted root. + +#### RC/DEVEL builds + +DEVEL and private candidate builds may use a per-run ephemeral self-signed certificate. Public RC source is intentionally promoted before its distribution build, so RC installers use the same SignPath `release-signing` policy and hard verification as GA. + +### 5.5 Linux Signing (Optional) + +Linux binary signing is less critical — Linux users don't encounter SmartScreen-style warnings when downloading binaries. However, GPG-signing release tarballs is good practice if the team distributes `.tar.gz` or `.deb` packages. This would require one additional secret (`GPG_SIGNING_KEY`) and a small step in the release workflow. + +### Verification: Credential Boundaries + +Confirm `CROSS_REPO_TOKEN` exists only in private environment `source-promotion`; Apple material only in public environment `apple-release-signing`; and `SIGNPATH_API_TOKEN` only in public environment `windows-release-signing`. The `public-release` environment is an approval boundary and contains no signing-key material. + +--- + +## 6. Phase 4: Supporting Files + +These files are referenced by the workflows and must exist in the repo. + +### `entitlements.plist` (repo root) + +This file is the source of truth for executable entitlements. The **Code sign binaries** step applies the complete plist to every executable under `wsjtx.app/Contents/MacOS`, re-applies it when signing the app bundle and main executable, and applies it to staged standalone executables. Frameworks, plug-in libraries, and other bundled libraries do not receive this plist. The completed bundle must pass deep signature verification. + +The current plist enables: + +| Entitlement | Current requirement | +|-------------|---------------------| +| `com.apple.security.cs.disable-library-validation` | Allows loading bundled third-party code that does not satisfy library validation, including ad-hoc CI artifacts. | +| `com.apple.security.device.audio-input` | Allows WSJT-X to capture audio under hardened runtime. `NSMicrophoneUsageDescription` in the app's `Info.plist` supplies the separate TCC permission prompt. | + +Both entitlements are currently applied as one set, including to executables that may not exercise every capability. Narrowing that scope is a security-sensitive behavior change and is outside this playbook. + +Bundle signing re-signs the main executable, so it must receive the entitlement file again after nested code is signed. `codesign --verify` validates signature integrity but does not prove that required entitlements are present. Inspect the effective entitlements and exercise audio capture and a decoder cycle when validating a release. + +### `Darwin/com.wsjtx.sysctl.plist` + +The macOS installer package copies this into `/Library/LaunchDaemons/` to configure shared memory limits (required for WSJT-X interprocess communication). Check if it exists: + +```bash +ls -la Darwin/com.wsjtx.sysctl.plist +``` + +### OmniRig type-library input + +Windows CI passes `-DOMNIRIG_TYPE_LIB=` to CMake because the workflow +already knows the location of the installed OmniRig executable. The build +supports this input directly. Local Windows builds can omit it and allow +`dumpcpp` to query the registered OmniRig type library instead. + +MSYS2 installs the tool as `dumpcpp-qt5`; the build discovers both that name +and the unversioned `dumpcpp` name. Do not create an alias in the workflow. + +--- + +## 7. Phase 5: Submit the PR + +### Option A: PR from a Branch + +If you have write access to `WSJTX/wsjtx-internal`, create a feature branch from `develop`, commit the workflow and supporting-file changes together, push it, and open a PR. Do not copy older prototype workflows over the current files: the candidate, promotion, signing, and publication boundaries must be reviewed as one system. + +### Option B: PR from a Fork + +If you don't have write access: + +```bash +# Fork the repo on GitHub first, then: +git clone git@github.com:YOUR_USERNAME/wsjtx-internal.git +cd wsjtx-internal +git remote add upstream git@github.com:WSJTX/wsjtx-internal.git + +# Then follow the same steps as Option A, but push to your fork: +git push -u origin ci/github-actions + +# Create PR from fork to upstream: +gh pr create \ + --repo WSJTX/wsjtx-internal \ + --title "Add GitHub Actions CI/CD" \ + --body "Five-platform CI (macOS arm64, macOS x86_64, Linux x86_64, Linux aarch64, Windows x86_64) with tag-triggered releases (\`build/v*\`)." +``` + +**Important note about forks:** Workflow files in PRs from forks don't run automatically — this is a GitHub security feature. The PR must be merged before the workflows will trigger. This means you can't test the CI from a fork PR. If you need to test before merging, use a branch on the official repo (Option A). + +--- + +## 8. Phase 6: Test the CI Pipeline + +After the PR is merged (or if you pushed directly to a test branch), verify CI works. + +### Step 1: Trigger a CI Run + +Push any small change to the target branch: + +```bash +# If testing on a branch: +git checkout develop # or master +echo "# CI test" >> README.md +git add README.md +git commit -m "test: trigger CI pipeline" +git push +``` + +### Step 2: Monitor the Run + +```bash +# Watch the run in real-time: +gh run watch --repo WSJTX/wsjtx-internal + +# Or list recent runs: +gh run list --repo WSJTX/wsjtx-internal --limit 5 +``` + +### Step 3: Check the Selected Platforms + +An ordinary push runs the default Linux x86_64 check. Before a candidate, apply the `full-ci` label to a PR or manually dispatch full CI and confirm all six target builds. Expected times (first run, no cache): + +| Platform | First Run | Cached Run | +|----------|-----------|------------| +| macOS arm64 | ~12-15 min | ~8 min | +| macOS x86_64 (Intel) | ~15-20 min | ~10 min | +| Linux x86_64 | ~10-12 min | ~7 min | +| Linux aarch64 | ~10-12 min | ~7 min | +| Windows x86_64 | ~40-45 min | ~15 min | + +Windows is the slowest because MSYS2 package installation is slow on first run. + +### Step 4: Inspect Failures + +If a job fails: + +```bash +# View the failed run's logs: +gh run view --repo WSJTX/wsjtx-internal --log-failed +``` + +Common first-run failures: + +| Symptom | Cause | Fix | +|---------|-------|-----| +| "Resource not accessible by integration" | Workflow permissions too restrictive | Org Settings → Actions → Workflow permissions → "Read and write" | +| macOS signing fails with empty identity | Application P12 is present, but the credential set is incomplete or invalid | Verify the application P12, its password, and the imported identity | +| macOS notarization fails | Missing, revoked, or mismatched App Store Connect API credential | Verify the API key, key ID, issuer ID, and expected Team ID in `apple-release-signing` | +| Windows build timeout (>60 min) | MSYS2 cache miss + slow package install | Re-run — the cache will be populated for next time | +| "refusing to allow an OAuth App to create or update workflow" | This error can appear at PR merge time if the branch contains workflow files and was pushed with a deploy key | Push the branch using a PAT or via the GitHub web UI instead | + +### Step 5: Revert the Test Commit + +```bash +git revert HEAD +git push +``` + +--- + +## 9. Phase 7: Test the Release Pipeline + +Only do this after CI is green on all six targets. + +### Step 1: Prepare Release Metadata + +On `release/X.Y`, commit the numeric version and matching `DEVEL`, `RC n`, or `GA` state in `release-state.txt`. For `3.2.0-rc1`, use `version=3.2.0`, `channel=RC`, and `rc=1`. Leave its `$Format:%H$` revision placeholder intact so Git substitutes the source SHA when exporting an archive. Wait for branch CI before tagging. This metadata commit is required even when GA application source is otherwise identical to the last RC, because it makes builds from GitHub's source archives identify themselves correctly. + +### Step 2: Build the Private Candidate + +Run **Prepare Release Candidate** from the `release/X.Y` branch at the expected SHA. Supply the version and full SHA with `operation=validate`; review its summary, then repeat with `operation=create`. The latter creates immutable `build/v...` and calls `release.yml` inside the same workflow run. That run uploads private validation artifacts without publishing or copying source. + +### Step 3: Approve Public Source Promotion + +Inspect the successful Prepare Release Candidate run and record its run ID. From the same `release/X.Y` branch and SHA, run **Promote Release Source** with that run ID, version, and `operation=validate`; after reviewing the checks, repeat with `operation=promote`. The workflow creates public `v...` at the same SHA and starts the public distribution builds. RC promotion leaves public `master` unchanged; GA promotion advances it with a guarded, fast-forward-only update. + +### Step 4: Review and Approve Publication + +Confirm every public target build and report is green. Windows RC and GA installers must be SignPath release-signed. In hosted-signing mode, macOS RC and GA packages must be Developer ID-signed, notarized, stapled, and Gatekeeper-accepted before publication. + +If `MACOS_DISTRIBUTION_SIGNING_ENABLED` is false, inspect and approve the validated unsigned packages for publication. After publication, download both `.pkg` assets, sign and notarize them outside GitHub, verify their signatures and installed behavior, then replace the release assets without changing their filenames. They are intentionally absent from `SHA256SUMS`; the manifest records them as manually replaceable. After the `apple-release-signing` environment is fully populated, enable the variable for future tags. + +Download the `release-bundle-` workflow artifact, then approve the waiting `public-release` environment only after its manifest, asset hashes, source SHA, and signing reports agree. Verify that an RC is marked prerelease and does not move `master`; verify that GA is the latest release and does move `master`. + +### Step 5: Verify the Artifacts + +Download the release artifacts to a new directory: + +```bash +RELEASE_DIR="$(mktemp -d)" +gh release download "v$VERSION" --repo WSJTX/wsjtx --dir "$RELEASE_DIR" +PKG="$RELEASE_DIR/wsjtx-${VERSION}-arm64-macOS.pkg" +``` + +Verify the installer signature, stapled notarization ticket, and Gatekeeper policy independently: + +```bash +pkgutil --check-signature "$PKG" +xcrun stapler validate "$PKG" +spctl --assess --type install --verbose=2 "$PKG" +``` + +Success requires a valid Developer ID Installer chain, a valid staple, and an `accepted` Gatekeeper assessment. These checks do not validate nested application signatures, entitlements, or runtime behavior. + +Inspect the packaged application rather than the staged build tree: + +```bash +EXPANDED="$RELEASE_DIR/expanded" +pkgutil --expand-full "$PKG" "$EXPANDED" +APP="$EXPANDED/wsjtx-component.pkg/Payload/Applications/wsjtx.app" + +codesign --verify --deep --strict --verbose=2 "$APP" +codesign -d --entitlements :- "$APP/Contents/MacOS/wsjtx" +codesign -d --entitlements :- "$APP/Contents/MacOS/jt9" +``` + +Signature verification must succeed, and both inspected executables must contain the two keys in `entitlements.plist`. The effective-entitlement check detects an outer bundle re-sign that preserved a valid signature but removed the executable entitlements. + +Finally, install the package on a disposable or release-test macOS system and launch the installed app through Finder. Confirm that macOS grants audio input after the usage prompt, the receive level responds to live input, and `jt9` completes a decode cycle without a hardened-runtime or dynamic-loader failure. A successful signing or notarization check does not establish these runtime properties. + +### Step 6: Recover Safely + +Rerun jobs against the immutable tag for transient signing, notarization, or service failures. If source or metadata changes, make a new commit and cut the next RC. Do not clean up a failed attempt by moving or recreating either tag; retaining the original identity preserves the audit trail and prevents an already downloaded release name from silently changing meaning. + +--- + +## 10. Ongoing Maintenance + +### Secret Rotation + +| Secret | Rotation Schedule | How to Rotate | +|--------|-------------------|---------------| +| `CROSS_REPO_TOKEN` | Before expiry (check token settings at github.com) | Generate new PAT → update private environment `source-promotion` | +| App Store Connect API key | On team schedule, personnel change, or suspected exposure | Revoke the old key, create a team-owned replacement, and update `apple-release-signing` | +| macOS signing certificates (.p12) | When certificate expires (typically 5 years) | Export new cert from Keychain → base64-encode → update both P12 and PASSWORD secrets | +| SignPath API token | On SignPath schedule, submitter change, or suspected exposure | Replace the public-repo token; the signing key remains in SignPath's HSM | + +### Version Bumps + +Before creating an RC or GA candidate, commit the numeric version and matching release channel/RC number in `release-state.txt`. Workflows derive their build inputs from that tracked state and reject a mismatched tag; do not maintain duplicate per-platform version literals. + +```bash +# Review the tracked release identity before running Prepare Release Candidate: +git diff HEAD^ -- release-state.txt +``` + +### Hamlib Updates + +If the team moves to a new Hamlib version, update `hamlib_branch` in both `ci.yml` and `release.yml`. The Hamlib cache will automatically invalidate because the cache key includes the branch name. + +### Cache Management + +If builds behave strangely after dependency changes, clear the Actions cache: + +```bash +# List caches: +gh api repos/WSJTX/wsjtx-internal/actions/caches --jq '.actions_caches[] | "\(.id) \(.key)"' + +# Delete a specific cache: +gh api -X DELETE repos/WSJTX/wsjtx-internal/actions/caches/ +``` + +Or go to: Repo → Actions → Caches (left sidebar) + +### Workflow File Updates + +When modifying workflow files, keep in mind: +- Changes to `build-*.yml` invalidate the Hamlib cache for that platform (cache key includes the workflow file hash). +- Changes to `ci.yml` or `release.yml` do **not** invalidate caches (they're just orchestrators). +- Reusable workflows (`workflow_call`) cannot be tested from fork PRs — they must be on the same repo. + +### Branch, Tag, and Environment Protection + +Protect `develop` and `release/*` from force-push and deletion, and apply the team's normal CI/review policy. The two manual helper workflows must be run from the current protected `release/X.Y` tip; they reject any other workflow ref or SHA. + +On the public repository, add a tag ruleset for `v*` that blocks update and deletion and limits creation to the source-promotion identity. Protect `master` from force-push and deletion. `promote-release.yml` additionally requires GA to advance the prior public `master` and updates the branch and new tag atomically. + +Restrict `candidate-tagging` and `source-promotion` to protected private `release/*` branches, `apple-release-signing` to public `v*` tags, and `windows-release-signing` to protected public `master` plus `v*` tags. Restrict `public-release` to public `v*` tags and require a reviewer there. These restrictions keep modified workflow code on an arbitrary branch from receiving a release credential. Do not add reviewers to the signing environments unless the team intentionally wants extra approvals; keep the required artifact-publication approval on `public-release`. + +### Dependabot & Auto-merge Policy + +**Repo feature — enable everywhere this machinery lives:** + +```bash +gh api -X PATCH /repos// -f allow_auto_merge=true +``` + +Enabling the feature only makes auto-merge *available* per-PR; it does not auto-merge anything on its own. + +**Usage policy:** + +| Posture | Dependabot security updates | Patch bumps (x.y.Z) | Minor/major bumps (x.Y.z / X.y.z) | +|---------|-----------------------------|---------------------|-----------------------------------| +| Sandbox | Auto-merge | Auto-merge | Auto-merge OK — breakage teaches here | +| Production | Auto-merge | Auto-merge | **Human merge click required** | + +Rationale: CI cannot catch runtime-behavior regressions in major action-version bumps (output-format, permission-model, default-input changes). A human click is the cheapest way to force a moment of review proportional to the blast radius of a production action upgrade. + +**Arming auto-merge on a specific PR:** + +```bash +gh pr merge --repo / --auto --squash --delete-branch +``` + +Dependabot auto-rebases its PRs when the base branch moves, CI re-runs, and GitHub merges once the branch-protection checks (including "up-to-date with base") pass. + +--- + +## 11. Troubleshooting + +### Problem: "refusing to allow an OAuth App to create or update workflow" + +**Context:** This appears when the release workflow tries to push to the public repo. + +**Root cause:** The credential being used (deploy key, OAuth token, or any non-PAT) cannot modify `.github/workflows/` files. This is a GitHub platform-level restriction. + +**Fix:** Ensure `CROSS_REPO_TOKEN` is a **fine-grained PAT** with **Contents: Read and write** AND **Workflows: Read and write** permissions. Classic PATs need the `workflow` scope. + +### Problem: macOS build fails with "no identity found" + +**Context:** The signing step can't find a Developer ID certificate in the keychain. + +**Root cause:** Distribution mode was selected, but the imported file, password, or certificate contents do not yield the expected Developer ID Application identity. + +**Diagnosis:** +```bash +# Check that the secret exists: +gh secret list --repo WSJTX/wsjtx --env apple-release-signing | rg DEVELOPER_ID + +# Re-encode and re-set: +base64 -i app.p12 -o app.p12.b64 +gh secret set DEVELOPER_ID_CERTIFICATE_P12 --repo WSJTX/wsjtx --env apple-release-signing < app.p12.b64 +``` + +### Problem: Notarization fails with "Invalid" status + +**Context:** The notarytool submission comes back as "Invalid" instead of "Accepted." + +**Diagnosis:** The workflow automatically fetches the notarization log on failure. Look for the log output in the GitHub Actions run. Common issues: + +| Log message | Meaning | Fix | +|-------------|---------|-----| +| "The signature of the binary is invalid" | Code signing used wrong identity or missed a binary | Check that all executables and dylibs are signed | +| "The binary uses an SDK older than the 10.9 SDK" | Deployment target too old | Check `CMAKE_OSX_DEPLOYMENT_TARGET` (11.0 for arm64 per `ci.yml:39`, 10.13 for x86_64 Intel per `ci.yml:50`) | +| "The signature does not include a secure timestamp" | Missing `--timestamp` in codesign | Verify the codesign commands include `--timestamp` | + +### Problem: Windows build fails at OmniRig install + +**Context:** The PowerShell step that downloads OmniRig fails. + +**Root cause:** The download URL (`https://www.dxatlas.com/OmniRig/Files/OmniRig.zip`) may be temporarily unavailable. + +**Fix:** Re-run the job. If persistent, download OmniRig manually, add the `.exe` to the repo as a build dependency, and update the workflow to use the local copy. + +### Problem: Public source promotion reports a missing token + +**Context:** Promote Release Source stops before it inspects or creates the public tag. + +**Root cause:** The secret is not set, or it's set on the wrong repo, or it's empty. + +**Fix:** +```bash +# Verify the secret exists: +gh secret list --repo WSJTX/wsjtx-internal --env source-promotion | rg CROSS_REPO + +# Re-set it: +gh secret set CROSS_REPO_TOKEN --repo WSJTX/wsjtx-internal --env source-promotion +# Paste the token value +``` + +### Problem: Cache not being used + +**Context:** Hamlib builds from source every run even though nothing changed. + +**Diagnosis:** Check the cache step output in the workflow run. Look for "Cache not found" vs "Cache restored." + +**Common causes:** +- Cache key changed (workflow file was modified) +- Cache was evicted (GitHub evicts caches after 7 days of no access, or when the repo exceeds 10 GB of cache storage) +- The `actions/cache` action version changed behavior + +### Problem: Build succeeds but binary crashes + +**Context:** The built binary segfaults or behaves differently than a local build. + +**Diagnosis:** +- Check compiler versions: `gcc --version` / `gfortran --version` in the workflow output +- Check linked libraries: the macOS build has a verification step that checks for remaining Homebrew paths +- Compare CMake configure output between CI and a local build + +--- + +## 12. Reference: Complete File Inventory + +### Files to Include in the PR + +| File | Purpose | Changes Needed | +|------|---------|----------------| +| `.github/workflows/ci.yml` | CI orchestrator for `develop` and `release/**` | None | +| `.github/workflows/release.yml` | Reusable private candidate build | None | +| `.github/workflows/release-tag-helper.yml` | Validate/create immutable internal candidates | None | +| `.github/workflows/promote-release.yml` | Validate/promote exact source to the public repo | None | +| `.github/workflows/public-release.yml` | Public signed build, bundle, approval, and GitHub Release | None | +| `.github/workflows/sign-windows-release.yml` | Public SignPath build/sign/verification | SignPath project and policy identifiers | +| `.github/workflows/build-macos.yml` | macOS build (parameterized arm64/x86_64) | None | +| `.github/workflows/build-linux.yml` | Linux build (parameterized x86_64/aarch64/armhf) | None | +| `.github/workflows/build-windows.yml` | Windows x86_64 build | None | +| `.github/workflows/hamlib-upstream-check.yml` | Scheduled (weekly cron + `workflow_dispatch`) poll of Hamlib upstream tags; files a tracking issue when a newer 4.x release is available. No platform builds; self-contained. | None | +| `entitlements.plist` | macOS app entitlements | None (if not already in repo) | +| `Darwin/com.wsjtx.sysctl.plist` | macOS shared memory config | None (if not already in repo) | +| `release-state.txt` | Tracked version, channel, RC number, and archival revision | Set before each candidate | +| `.github/scripts/release-policy.py` | Release identity, asset, archive, signing-report, and manifest gates | None | + +### Secrets Required on `wsjtx-internal` + +Use the canonical inventory and setup procedure in [Phase 3](#5-phase-3-create-repository-secrets). Keep `CROSS_REPO_TOKEN` in private environment `source-promotion`, Apple material in public environment `apple-release-signing`, and `SIGNPATH_API_TOKEN` in public environment `windows-release-signing`. No SignPath private key is stored in either repository. + +### External Dependencies (Downloaded at Build Time) + +| Dependency | URL | Used By | +|------------|-----|---------| +| Hamlib 4.7.2 | `https://github.com/Hamlib/Hamlib.git` | All supported platforms | +| OmniRig | `https://www.dxatlas.com/OmniRig/Files/OmniRig.zip` | Windows only | + +### Build-Time Source Patches + +The current workflows do not patch the WSJT-X source tree during a build. +Windows support for MAP65, the MSYS2 FFTW threads library, and the +`dumpcpp-qt5` executable is implemented in the repository and exercised by CI. diff --git a/ci-cd/DEVELOPMENT_WORKFLOW.md b/ci-cd/DEVELOPMENT_WORKFLOW.md new file mode 100644 index 00000000..369d22da --- /dev/null +++ b/ci-cd/DEVELOPMENT_WORKFLOW.md @@ -0,0 +1,721 @@ +# WSJT-X Development Workflow + +How the WSJT-X project uses its two-repo model, how team members and external contributors participate, how CI/CD automates quality checks and releases, and how all the pieces fit together. + +**Audience:** Public-facing. Current team members, prospective contributors, and anyone evaluating the project's development practices. + +This document describes the WSJTX GitHub development and release workflow. Repository settings and signing credentials must be configured as described in the Deployment Playbook before the protected release paths can run. + +--- + +## Table of Contents + +1. [The Two-Repo Model](#1-the-two-repo-model) +2. [Roles and Access](#2-roles-and-access) +3. [Day-to-Day Development (Team Members)](#3-day-to-day-development-team-members) +4. [Contributing from Outside the Team](#4-contributing-from-outside-the-team) +5. [How CI/CD Fits In](#5-how-cicd-fits-in) +6. [The Release Process](#6-the-release-process) +7. [Branch Strategy](#7-branch-strategy) +8. [Issue and PR Conventions](#8-issue-and-pr-conventions) +9. [Code Review](#9-code-review) +10. [End-to-End Example: A Bug Fix](#10-end-to-end-example-a-bug-fix) +11. [End-to-End Example: A New Release](#11-end-to-end-example-a-new-release) +12. [Quick Reference](#12-quick-reference) + +--- + +## 1. The Two-Repo Model + +WSJT-X uses two separate repositories in the WSJTX GitHub organization: + +``` +WSJTX/wsjtx-internal (private) WSJTX/wsjtx (public) +┌──────────────────────────┐ ┌──────────────────────────┐ +│ Default branch: develop │ │ Default branch: master │ +│ │ │ │ +│ Active development │ ────> │ Tagged releases only │ +│ Feature branches │ sync │ │ +│ Issues & PRs │ │ External contributors │ +│ CI/CD workflows │ │ fork from here │ +└──────────────────────────┘ └──────────────────────────┘ +``` + +### Why two repos? + +- **wsjtx-internal** is where all development happens. It's private so the team can work without external pressure during development cycles. This is the repo team members push to, open PRs against, and file issues in. + +- **wsjtx** is the public face of the project. It receives an exact release commit and tag only after a release manager approves promotion of a successful internal candidate. External contributors fork this repo. + +### How they stay in sync + +The repos are **not** GitHub forks of each other — they are independent Git repos that share history. Synchronization happens in one direction only: + +``` +wsjtx-internal ──→ wsjtx + (private) tag (public) + sync +``` + +For a version such as `3.2.0-rc1`: +1. `build/v3.2.0-rc1` identifies an immutable internal candidate and builds validation artifacts +2. A release manager inspects that run and manually promotes its exact commit as public tag `v3.2.0-rc1` +3. The public repository builds and signs the distribution artifacts from that tag +4. A final `public-release` approval publishes the GitHub prerelease or release + +An RC promotion publishes only its tag, so public `master` remains the latest GA source. GA promotion also advances public `master` to the same commit. This keeps public source, signed binaries, and the release page bound to one reviewed revision. + +The public repo never pushes back to internal. Changes from external contributors are manually cherry-picked or merged by a team member (see [Section 4](#4-contributing-from-outside-the-team)). + +--- + +## 2. Roles and Access + +### Team Members + +Team members have **write access** to both repos. They can: +- Push branches directly to wsjtx-internal +- Open and merge pull requests +- Create and manage issues +- Trigger workflow runs manually +- Create tags (which trigger releases) + +### Org Admins + +Org admins can additionally: +- Manage org settings (Actions permissions, member roles) +- Configure repository secrets +- Add or remove team members +- Set branch protection rules + +### External Contributors + +External contributors have **read access** to the public repo (wsjtx). They can: +- Fork wsjtx to their own GitHub account +- Open pull requests from their fork to wsjtx +- File issues on wsjtx + +They **cannot** directly access wsjtx-internal, push branches to either org repo, or trigger protected release operations. Candidate CI runs internally; promoted RC and GA source tags and their distribution builds are public. External PRs are triaged by a team member, who brings accepted changes into wsjtx-internal where the pipeline builds and tests them. + +### Access Summary + +| Action | Team Member | Org Admin | External Contributor | +|--------|:-----------:|:---------:|:--------------------:| +| Read wsjtx-internal | Yes | Yes | No | +| Push to wsjtx-internal | Yes | Yes | No | +| Read wsjtx (public) | Yes | Yes | Yes | +| Push to wsjtx (public) | Yes | Yes | No (fork + PR) | +| Open PRs on wsjtx-internal | Yes | Yes | No | +| Open PRs on wsjtx (public) | Yes | Yes | Yes (from fork) | +| Create tags/releases | Yes | Yes | No | +| Manage secrets/settings | No | Yes | No | + +--- + +## 3. Day-to-Day Development (Team Members) + +### The basic loop + +``` +1. Pull latest develop +2. Create a feature/fix branch +3. Make changes, test locally +4. Push branch to wsjtx-internal +5. Open a PR against develop +6. CI runs automatically on the PR +7. Team reviews, discusses +8. Merge when ready +``` + +### Step by step + +#### 1. Start from develop + +```bash +cd wsjtx-internal +git checkout develop +git pull origin develop +``` + +#### 2. Create a branch + +Use a descriptive name with a prefix: + +```bash +# Feature: +git checkout -b feat-improved-decoder + +# Bug fix: +git checkout -b fix-audio-dropout-on-macos + +# Tied to an issue: +git checkout -b 15-fix-shared-memory-leak +``` + +See [Section 7](#7-branch-strategy) for naming conventions. + +#### 3. Make changes and test + +Build and test locally on your platform. At minimum, verify: +- The application compiles without errors +- The application launches and basic functions work +- If you changed decoding code, test with known `.wav` files + +#### 4. Push your branch + +```bash +git push -u origin feat-improved-decoder +``` + +#### 5. Open a pull request + +Use `gh` ([GitHub CLI](https://cli.github.com/)) to create the PR: + +```bash +gh pr create --base develop --title "feat: improve FT8 decoder sensitivity" \ + --body "Description of what changed and why. Tested on macOS ARM64." +``` + +Or use the GitHub web UI: go to the repo, click "Compare & pull request" on the banner that appears after pushing. + +#### 6. CI runs automatically + +When the PR is opened (and on every subsequent push), the default CI path runs the Linux x86_64 build. Apply the `full-ci` label or dispatch CI manually when all supported targets should run: + +- **macOS ARM64** — builds; Developer ID signing and notarization require credentials +- **macOS Intel x86_64** — builds; Developer ID signing and notarization require credentials +- **Linux x86_64** — builds +- **Linux aarch64** — builds (ARM Linux, via `ubuntu-24.04-arm`) +- **Linux armhf** — builds in the armhf container +- **Windows x86_64** — builds and signs via MSYS2/MinGW + +Green checks cover the jobs selected for that run. A red X means something broke — click the check to see which platform failed and view the logs. The private release candidate always runs the complete six-target matrix before source can be promoted. + +#### 7. Review and merge + +The team reviews the PR via GitHub. When approved, merge to `develop`. Prefer **"Create a merge commit"** to preserve history (not squash or rebase). + +### What if I want to push directly to develop? + +For very small, obvious changes (typo fixes, comment updates), pushing directly to `develop` is acceptable. CI will still run on the push. But for anything substantive — new features, bug fixes, refactoring — use a PR so the team can see what's happening and CI validates it before it lands on `develop`. + +--- + +## 4. Contributing from Outside the Team + +External contributors work through the public repo (wsjtx). The process has more steps because external changes must cross the public-to-internal boundary. + +### The external contributor loop + +``` +1. Fork WSJTX/wsjtx on GitHub +2. Clone your fork locally +3. Create a feature/fix branch +4. Make changes, test locally +5. Push to your fork +6. Open a PR from your fork to WSJTX/wsjtx (master branch) +7. A team member reviews the PR +8. If accepted, a team member ports the change to wsjtx-internal +``` + +### Step by step + +#### 1. Fork the public repo + +On GitHub, go to https://github.com/WSJTX/wsjtx and click **Fork**. + +#### 2. Clone your fork + +```bash +git clone git@github.com:YOUR_USERNAME/wsjtx.git +cd wsjtx +git remote add upstream https://github.com/WSJTX/wsjtx.git +``` + +#### 3. Create a branch and make changes + +```bash +git checkout -b fix-audio-dropout +# ... make changes ... +git add -A +git commit -m "fix: resolve audio dropout on macOS Sequoia" +``` + +#### 4. Push and open a PR + +```bash +git push -u origin fix-audio-dropout +gh pr create --repo WSJTX/wsjtx --base master \ + --title "fix: resolve audio dropout on macOS Sequoia" \ + --body "Description of the fix. Tested on macOS 15.3, ARM64." +``` + +#### 5. What happens next + +A team member reviews the PR on the public repo. If the change is accepted: + +1. The team member checks out the PR locally or cherry-picks the commits +2. They apply the change to a branch on wsjtx-internal +3. They open an internal PR against `develop` +4. Default CI validates the change on Linux x86_64; `full-ci`, manual CI, and release candidates provide all-target coverage +5. The change merges to `develop` +6. At the next release, the change flows back to the public repo automatically + +**Why this indirection?** The public repo only receives code at release time. Development happens on `develop` in wsjtx-internal. Merging an external PR directly to `master` on the public repo would put it out of sync with internal development. + +#### 6. Keeping your fork up to date + +After a release (when the public repo's `master` is updated): + +```bash +git checkout master +git fetch upstream +git merge upstream/master +git push origin master +``` + +### What external contributors should know + +- **Response time varies.** The core developers are volunteers with day jobs and other commitments. PRs may take days or weeks to review. +- **Build instructions** are in the + [source-build guide](../doc/user_guide/en/install-from-source.adoc). Build + locally before submitting. +- **One logical change per PR.** Don't bundle unrelated fixes. +- **Test on your platform.** Mention which OS and architecture you tested on. +- **License.** All contributions must be GPL-3.0 compatible. By submitting a PR, you agree to license your code under GPL-3.0. + +--- + +## 5. How CI/CD Fits In + +CI/CD serves two purposes: **quality gates** (does it compile?) and **release automation** (build and publish binaries). + +### CI: Quality Gates + +``` + ┌─────────────────────────────────────────────────────────┐ + Push to develop │ ci.yml │ + or open a PR ──> │ Linux x86_64 by default │ + │ │ + full-ci/manual ──>│ macOS arm64 + Intel, Linux x86_64 + aarch64 + armhf, │ + │ and Windows x86_64 │ + │ │ + │ Selected jobs must all be green │ + └─────────────────────────────────────────────────────────┘ +``` + +**What triggers CI:** +- Every push to `develop` or `release/**` +- Every pull request targeting `develop` or `release/**` +- Manual trigger via the Actions UI (workflow_dispatch) + +**What CI checks:** +- Default PR and branch CI compiles and tests Linux x86_64; `full-ci`, manual CI, and release candidates provide broader coverage +- On macOS, ordinary CI uses ad-hoc signing for validation. Public RC and GA packages use hosted Developer ID signing when it is enabled; otherwise a release manager replaces the validated packages with manually signed packages. +- On Windows, public RC and GA installers are Authenticode-signed through SignPath. Ordinary CI may use a per-run ephemeral self-signed certificate. +- Build artifacts are uploaded for inspection +- **Tests pass on every platform** (Qt helpers, decoder smoke tests, pFUnit Fortran unit tests — registered via ctest). See [Test Failure Policy](#test-failure-policy) below. + +**What CI does NOT check (yet):** +- Code style or linting +- Documentation generation + +**How to read CI results:** +- On a PR, scroll to the bottom to see the status checks +- Green check = all selected jobs completed successfully +- Red X = at least one selected job failed. Click it to read the logs. +- Yellow circle = builds still running + +### Release: Build and Publish + +The release pipeline is separate from CI. An internal candidate tag builds without publishing; manual source promotion starts public distribution builds, and a second approval publishes them. See [Section 6](#6-the-release-process). + +### Where CI runs + +CI runs on GitHub-hosted runners: + +| Platform | Runner | Architecture | Cost | +|----------|--------|-------------|------| +| macOS ARM64 | `macos-15` | ARM64 (Apple Silicon) | 10x multiplier on Actions minutes | +| macOS Intel | `macos-15-intel` | x86_64 | 10x multiplier on Actions minutes | +| Linux | `ubuntu-24.04` | x86_64 | 1x (baseline) | +| Linux aarch64 | `ubuntu-24.04-arm` | aarch64 | 1x (baseline) | +| Linux armhf | `ubuntu-24.04` + container | armhf | 1x (baseline) | +| Windows | `windows-latest` + MSYS2 | x86_64 | 2x multiplier | + +**Free tier:** GitHub provides 2,000 free Actions minutes/month for private repos (with multipliers applied). macOS jobs dominate billed time because both use the 10x multiplier; Linux targets run at the baseline rate. + +**Caching:** Hamlib builds and MSYS2 packages are cached to reduce build times. First-run builds are slower; subsequent builds use the cache. + +### Test Failure Policy + +Tests run via ctest at the end of each platform's build job, after compilation succeeds. The policy is **hard-fail everywhere**: + +- Any test failure fails the platform's build job +- A failed build job fails the entire CI run (red X on the PR or push) +- A failed candidate build blocks `release.yml`'s `candidate-ready` job, which requires macOS arm64 and Intel, Linux x86_64, aarch64, and armhf, plus Windows x86_64. Candidate builds do not publish. + +This is the simplest possible policy for v1. If a flaky test emerges, the team can add `continue-on-error: true` to the offending test's platform as a targeted soft-warn, file an issue to triage the flake, and remove the exception once fixed. No blanket soft-warn policy on `develop`. + +**Where to see results:** + +- **GitHub Actions step summary** — each build job posts a `## Test Results — — PASS/FAIL` table with per-test status and timing. Viewable on the job summary page without downloading logs. +- **Job log** — `ctest --output-on-failure` prints the full decoder/test output for any failing test directly into the job log. +- **Uploaded artifact** — each build job uploads `ctest-results-.xml` (JUnit-format XML) as a run artifact. Download via `gh run download --name ctest-results-` or via the Actions UI. Useful for programmatic parsing or post-mortem. + +--- + +## 6. The Release Process + +Releases are tag-defined but approval-driven. The internal `build/v...` tag fixes the candidate revision; it does not publish source or binaries. A release manager separately approves copying that exact revision to the public `v...` tag, and the public release waits for one final approval after its publication artifacts are available for inspection. + +### Overview + +``` +release/3.2 metadata commit + └─→ internal build/v3.2.0-rc1 candidate and validation artifacts + └─→ manual source promotion + └─→ public v3.2.0-rc1 tag + └─→ public all-platform builds and signing + └─→ public-release approval + └─→ public GitHub prerelease +``` + +### Step by step + +#### 1. Prepare tracked release metadata + +Cut `release/3.2` from a green `develop`, then make a small metadata commit before every RC or GA candidate. `release-state.txt` records the numeric version, `DEVEL`, `RC` plus its positive RC number, or `GA`; its export-substituted revision also preserves the source SHA outside Git. This makes a build from GitHub's automatic source archive identify itself correctly even though that archive has no `.git` directory. + +Do not put an RC or GA tag on a `DEVEL` commit. The helper rejects disagreement among the requested version, tag, and tracked release state; CMake derives its version from that same state. + +#### 2. Create the internal candidate + +Run **Prepare Release Candidate** from `release/3.2` at the intended SHA. First use `operation=validate`, then `operation=create`, supplying the version (`3.2.0-rc1`, for example) and the full SHA. Creation makes immutable tag `build/v3.2.0-rc1`; the same workflow run calls `release.yml` to build all internal validation artifacts but publishes nothing. + +Inspect the candidate run and installable validation artifacts. Record its run ID for promotion. + +#### 3. Promote the exact source + +From the same release branch and SHA, run **Promote Release Source** with the same version, the candidate run ID, and `operation=validate`. After reviewing its summary, rerun with `operation=promote`. The workflow verifies the immutable tag, commit, release metadata, current release-branch tip, candidate run, and artifacts before creating public tag `v3.2.0-rc1` at the same commit. + +The public tag exposes the corresponding source required for public distribution and triggers fresh public distribution builds. RC promotion does not move public `master`; GA promotion advances `master` to the same commit with a guarded update. + +#### 4. Review builds and approve publication + +The public workflow builds all supported targets. Both RC and GA Windows installers use SignPath production signing. When hosted Apple signing is enabled, both RC and GA macOS installers are Developer ID-signed, notarized, stapled, and verified before publication. + +With `MACOS_DISTRIBUTION_SIGNING_ENABLED=false`, the workflow publishes validated unsigned macOS packages under their final release filenames. Those two packages are marked as manually replaceable, excluded from `SHA256SUMS` and the manifest's immutable asset list, and preserved rather than compared on workflow reruns. A release manager must replace both with Developer ID-signed, notarized, and stapled packages. Enable the variable after `apple-release-signing` is configured to restore fully automated macOS signing and immutable package hashes. + +Download and review `release-bundle-`, including its checksums, manifest, and signing reports. Approve the waiting `public-release` environment only when they all correspond to the public tag and expected SHA. This final approval publishes an RC as a GitHub prerelease or GA as the latest release. + +#### 5. Recover without moving tags + +Rerun a failed workflow against the existing immutable tag after fixing transient credentials or service configuration. If source or tracked release metadata must change, commit the fix and cut the next RC. Never delete, recreate, or force-move a candidate or public release tag; immutable tags keep reviews, source, signatures, and downloaded artifacts attributable to one commit. + +### Release candidates + +Before a final release, cut one or more RCs and let the team exercise the same public, signed distribution path. An RC uses a SemVer suffix such as `3.2.0-rc1` and is published as a GitHub prerelease, so it does not replace the latest GA release. + +#### When to cut an RC + +Cut an RC whenever a release contains more than a trivial change — any feature work, non-obvious bug fixes, or changes to the build, signing, or notarization path. A pure doc or CI-config release does not need an RC. + +#### Tagging an RC + +RCs and GA are prepared on the same `release/X.Y` branch, never directly on `develop`. Make and merge the matching `RC n` metadata commit before asking Prepare Release Candidate to create the candidate tag. + +#### Testing an RC + +Before promoting an RC to GA, confirm: + +- All six target jobs in the public release workflow ran green +- The macOS `.pkg` passes the signing, staple, Gatekeeper, entitlement, and installed-runtime checks in the Deployment Playbook +- At least one volunteer on each supported platform (macOS ARM64, macOS Intel x86_64, Linux x86_64, Linux aarch64, Windows x86_64) has installed the RC and exercised the workflow they care about +- No critical issue has been filed against the RC for a reasonable soak period (typically 48 hours after the platform volunteers confirm) + +If an RC fails testing, push a fix to the release branch, update the metadata to the next RC number, and create `-rc2`, `-rc3`, etc. Each RC remains an independent public prerelease for reference. + +#### Promoting an RC to GA + +Change the tracked state from `RC n` to `GA` in a metadata-only commit, wait for CI, and create a new `3.2.0` candidate through the same validate/create/promote/approve sequence. Even when application source is unchanged, the GA commit is intentionally distinct so ordinary builds from its GitHub source archive report GA rather than RC. + +### What the release produces + +| Artifact | Platform | Signed | Notes | +|----------|----------|--------|-------| +| `wsjtx-3.2.0-rc1-arm64-macOS.pkg` | macOS ARM64 | After hosted or manual signing | Developer ID signed, notarized, and stapled; verify per the Deployment Playbook | +| `wsjtx-3.2.0-rc1-x86_64-macOS.pkg` | macOS Intel x86_64 | After hosted or manual signing | Developer ID signed, notarized, and stapled; verify per the Deployment Playbook | +| `wsjtx-3.2.0-rc1-linux-x86_64.AppImage` | Linux x86_64 | No | Published with matching `.deb` and `.rpm` packages | +| `wsjtx-3.2.0-rc1-linux-aarch64.AppImage` | Linux aarch64 | No | Published with matching `.deb` and `.rpm` packages | +| `wsjtx-3.2.0-rc1-linux-armhf.AppImage` | Linux armhf | No | Published with matching `.deb` and `.rpm` packages | +| `wsjtx-3.2.0-rc1-win64.exe` | Windows x86_64 | Yes | SignPath Foundation Authenticode for RC and GA | +| `wsjtx-3.2.0-rc1-src.tar.gz` | Source | N/A | Project-created archive of the public tagged commit | +| `SHA256SUMS` and release manifest | CI-managed assets | N/A | Bind immutable uploaded bytes to their public tag, commit, and build provenance | + +GitHub also adds automatic **Source code (zip)** and **Source code (tar.gz)** links from the public tag. They represent the same tagged source but are generated and compressed by GitHub, so their archive hashes need not equal the project-created `.tar.gz`. `SHA256SUMS` covers immutable assets uploaded by the project. In manual macOS signing mode it excludes the two replaceable `.pkg` files, which the manifest identifies separately. A checksum detects changed bytes but is not a substitute for platform signatures or tag-to-commit checks. + +### Who can trigger a release? + +Team members can run candidate validation. Creating the candidate, promoting its source, and approving the `public-release` environment are explicit release-manager actions; repository protection and environment access determine who can perform each one. + +--- + +## 7. Branch Strategy + +### Branch types + +| Prefix | Purpose | Base branch | Merges to | Lifetime | +|--------|---------|-------------|-----------|----------| +| `feat-*` | New feature | `develop` | `develop` via PR | Until merged | +| `fix-*` | Bug fix | `develop` | `develop` via PR | Until merged | +| `-*` | Issue-linked work | `develop` | `develop` via PR | Until merged | +| `release/X.Y` | RC and GA stabilization | `develop` | Public release tags; `master` only at GA | Maintained for patch releases | +| `develop` | Main development trunk | — | — | Permanent | +| `master` | Public releases (on wsjtx) | — | — | Permanent | + +### Naming conventions + +``` +feat-jtty # New JTTY mode +feat-improved-decoder # Decoder improvement +fix-audio-dropout-on-macos # Bug fix with context +15-fix-shared-memory-leak # Issue #15 +``` + +Use lowercase, hyphens between words. Keep names short but descriptive. + +### What NOT to do + +- **Don't push directly to `master`** on the public repo. It receives code only via the release sync. +- **Don't create long-lived feature branches** that diverge far from `develop`. Merge frequently to avoid painful conflicts. +- **Don't rewrite history** on shared branches (`develop`, release branches). Use merge commits, not force-push. + +--- + +## 8. Issue and PR Conventions + +### Issues + +Issues are tracked on **wsjtx-internal** (not the public repo) because that's where development happens. External contributors without `wsjtx-internal` access should file issues on the public repo (see `CONTRIBUTING.md`); a team member will move the issue to `wsjtx-internal` if triage reveals development work to be done. + +**When to file an issue:** +- Bug reports (use the bug report template) +- Feature requests +- Refactoring proposals +- Technical debt items (known-suboptimal code, deferred cleanup, latent bugs uncovered during other work — anything worth tracking but not urgent enough to fix immediately) + +**Issue structure:** +- Clear title describing the problem or feature +- Steps to reproduce (for bugs) +- Expected vs. actual behavior +- Platform and version information +- Relevant log output or screenshots + +### Pull Requests + +**PR title format:** +``` +feat: add JTTY decoder +fix: resolve audio dropout on macOS Sequoia +refactor: extract message parser from mainwindow.cpp +docs: update build instructions for Windows +``` + +**PR description should include:** +- What the change does and why +- Which platforms you tested on +- Related issue numbers (e.g., "Fixes #15") +- Any known limitations or follow-up work needed + +**PR etiquette:** +- Keep PRs focused — one logical change per PR +- Respond to review feedback promptly +- Don't force-push after review has started (it loses review context) +- Update the PR description if scope changes during review + +--- + +## 9. Code Review + +### Who reviews? + +Any team member can review any PR. For changes that affect specific areas: + +*Callsigns below reflect the team as of 2026-04-21; the team should confirm primary reviewers in `CODEOWNERS` before this table is treated as authoritative.* + +| Area | Primary Reviewer(s) | Why | +|------|---------------------|-----| +| Signal processing / codecs | K1JT, K9AN | Algorithm expertise | +| Qt GUI / application code | G4KLA, N9ADG | Application architecture | +| Build system / CMake | N9ADG, KJ5HST | Build infrastructure | +| Fortran code | K1JT, K9AN, W3SZ | Numerical methods | +| User guide / docs | DL3WDG | Documentation ownership | +| CI/CD workflows | KJ5HST | Pipeline expertise | + +### Review expectations + +- **Correctness:** Does the change do what it claims? +- **Platform impact:** Will this break other platforms? +- **Dependencies:** Does this introduce new external dependencies? +- **Backward compatibility:** Does this change behavior that users depend on? +- **Build system:** Does this require changes to CMakeLists.txt or new build dependencies? + +### Approval and merge + +- At least one team member should review before merging +- For significant changes (new features, architectural changes), wait for input from the relevant domain expert +- The PR author should not merge their own PR without at least one approval +- Use **"Create a merge commit"** (not squash or rebase) to preserve branch history + +--- + +## 10. End-to-End Example: A Bug Fix + +Here's what it looks like when a team member fixes a bug, from discovery to release. + +### 1. Bug is reported + +Someone files issue #20 on wsjtx-internal: "FT8 decoder misses callsigns with /P suffix on Windows." + +### 2. Team member picks it up + +```bash +git checkout develop +git pull +git checkout -b 20-fix-portable-suffix-decode +``` + +### 3. Fix and test + +The developer finds the bug in `lib/ft8/decode.f90`, fixes it, and tests locally with a known `.wav` file that contains a /P callsign. + +```bash +git add lib/ft8/decode.f90 +git commit -m "fix: handle /P suffix in FT8 decoder (fixes #20)" +git push -u origin 20-fix-portable-suffix-decode +``` + +### 4. PR and CI + +```bash +gh pr create --base develop --title "fix: handle /P suffix in FT8 decoder" \ + --body "Fixes #20. The suffix parsing was skipping the portable indicator. +Tested with the WA6BEV.wav reference file on macOS ARM64." +``` + +CI runs. All six targets build green. + +### 5. Review and merge + +Another team member reviews the Fortran change, confirms the logic, and approves. The PR is merged to `develop`. Issue #20 is automatically closed by the "Fixes #20" reference. + +### 6. Eventually released + +When the team decides to release the next version, this fix is included automatically — it's already on `develop`. The tag triggers the release pipeline, and the fix reaches the public repo and the downloadable binaries. + +--- + +## 11. End-to-End Example: A New Release + +Here's the complete flow for releasing `3.2.0-rc1`. + +### 1. Release decision + +The team cuts `release/3.2` from a green `develop`. Later `3.2.x` patches use that existing release branch so unrelated work on `develop` is not included. + +### 2. Version preparation + +Update the numeric version and tracked release state, then commit them before creating any tag: + +```bash +git switch release/3.2 +git pull origin release/3.2 +# Set release-state.txt to version 3.2.0, channel RC, and rc 1. +git commit -m "chore(release): prepare 3.2.0-rc1" +git push origin release/3.2 +``` + +Wait for CI to go green on this commit. + +### 3. Validate and create the candidate + +From `release/3.2` at the metadata commit, run **Prepare Release Candidate** twice with version `3.2.0-rc1` and the full SHA: first `operation=validate`, then `operation=create`. Do not create or move the tag locally. The helper creates immutable `build/v3.2.0-rc1` only after its checks pass. + +### 4. Automated pipeline runs + +The Prepare Release Candidate run calls internal `release.yml` to build validation artifacts from the candidate tag, but does not publish a release or copy source. Inspect that run and retain its run ID. + +``` + build/v3.2.0-rc1 + └─→ private validation builds + └─→ Promote Release Source validate, then promote + └─→ public v3.2.0-rc1 + └─→ public Linux, macOS, and Windows builds + └─→ signing and provenance checks + └─→ public-release approval + └─→ public prerelease +``` + +### 5. Promote, verify, and approve + +```bash +# After running Promote Release Source with validate and then promote: +gh api repos/WSJTX/wsjtx/git/ref/tags/v3.2.0-rc1 --jq .object.sha + +# After reviewing the public signing reports and approving public-release: +gh release view v3.2.0-rc1 --repo WSJTX/wsjtx +``` + +### 6. Distribute + +- Post the public GitHub Release link to the mailing list +- Upload artifacts to SourceForge (if still used as distribution channel) +- Update the website (wsjtx.github.io/wsjtx) if applicable + +### 7. External contributors sync + +For an RC, external contributors can fetch the public tag while `master` remains at the latest GA: + +```bash +git fetch upstream +git switch --detach v3.2.0-rc1 +``` + +After GA promotion, public `master` advances to the GA commit and normal fork synchronization resumes. + +--- + +## 12. Quick Reference + +### For Team Members + +| I want to... | Do this | +|--------------|---------| +| Start new work | `git checkout develop && git pull && git checkout -b feat-my-feature` | +| Submit my changes | `git push -u origin feat-my-feature` then `gh pr create --base develop` | +| Check CI status | Look at the PR's status checks, or `gh run list` | +| Trigger a release | Commit matching metadata on `release/X.Y`; run Prepare Release Candidate validate/create, inspect the candidate, then run Promote Release Source validate/promote. See [§6](#6-the-release-process). | +| See build logs | `gh run view --log` | +| Re-run a failed build | `gh run rerun ` | +| Manually trigger CI | `gh workflow run ci.yml --ref develop` | + +### For External Contributors + +| I want to... | Do this | +|--------------|---------| +| Get the source | Fork `WSJTX/wsjtx` on GitHub, then `git clone` your fork | +| Submit a fix | Create a branch, push to your fork, open PR to `WSJTX/wsjtx` `master` | +| Update my fork | `git fetch upstream && git merge upstream/master` | +| Report a bug | Open an issue on `WSJTX/wsjtx` using the bug report template | +| Build from source | Follow the [source-build guide](../doc/user_guide/en/install-from-source.adoc) | + +### Key URLs + +| Resource | URL | +|----------|-----| +| Internal repo | `https://github.com/WSJTX/wsjtx-internal` (team only) | +| Public repo | `https://github.com/WSJTX/wsjtx` | +| CI runs | `https://github.com/WSJTX/wsjtx-internal/actions` | +| Issues | `https://github.com/WSJTX/wsjtx-internal/issues` | +| Release artifacts | `https://github.com/WSJTX/wsjtx-internal/releases` | diff --git a/commons.h b/commons.h index 056d1c4c..30ddafe1 100644 --- a/commons.h +++ b/commons.h @@ -5,8 +5,10 @@ #define NTMAX 30*60 #define RX_SAMPLE_RATE 12000 +#include "DecoderIpcProtocol.h" + #ifdef __cplusplus -#include +#include #include #else #include @@ -16,14 +18,7 @@ * This structure is shared with Fortran code, it MUST be kept in * sync with lib/jt9com.f90 */ -typedef struct dec_data { - int ipc[3]; - float ss[184*NSMAX]; - float savg[NSMAX]; - float sred[5760]; - short int d2[NTMAX*RX_SAMPLE_RATE]; - struct - { +typedef struct decoder_params { int nutc; //UTC as integer, HHMM bool ndiskdat; //true ==> data read from *.wav file int ntrperiod; //TR period (seconds) @@ -107,9 +102,34 @@ typedef struct dec_data { bool lmultinst; //=m_multInst ? 1 : 0; (mainwindow.cpp) bool lskiptx1; //=m_skipTx1 ? 1 : 0; (mainwindow.cpp) int ndecoderstart; //=m_FT8DecoderStart; (mainwindow.cpp) - } params; +} decoder_params_t; + +typedef struct dec_data { + float ss[184*NSMAX]; + float savg[NSMAX]; + float sred[5760]; + short int d2[NTMAX*RX_SAMPLE_RATE]; + decoder_params_t params; } dec_data_t; +typedef struct shared_dec_data { + decoder_ipc_control_t control; + dec_data_t payload; +} shared_dec_data_t; + +#ifdef __cplusplus +static_assert (sizeof (int) == 4, "decoder IPC requires 32-bit C integers"); +static_assert (sizeof (decoder_ipc_control_t) == 16, + "decoder IPC control header must remain 16 bytes"); +static_assert (offsetof (decoder_ipc_control_t, state) == 4, + "decoder IPC state must remain at the legacy shutdown offset"); +static_assert (offsetof (shared_dec_data_t, payload) == 16, + "decoder payload must immediately follow the control header"); +static_assert (sizeof (shared_dec_data_t) == + sizeof (decoder_ipc_control_t) + sizeof (dec_data_t), + "decoder shared-memory layout must not contain trailing padding"); +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/displayWidgets.txt b/displayWidgets.txt deleted file mode 100644 index 5a53955b..00000000 --- a/displayWidgets.txt +++ /dev/null @@ -1,69 +0,0 @@ -Here are the "displayWidgets()" strings for WSJT-X modes - - 1 2 3 - 01234567890123456789012345678901234567 -------------------------------------------------- -JT4 11101000000011000011000000000000000000 -JT4/VHF 11111001001011011011110000000000000000 -JT9 11101000000011100001000000000000100000 -JT9/VHF 11111010100011111001000000000000000000 -JT65 11101000000011100001000000000000100000 -JT65/VHF 11111001000011011010110001000000000000 -Q65 11111101011011010011100000010000000011 -ISCAT 10011100000000011000000000000000000000 -MSK144 10111111010000000001000100000000000000 -WSPR 00000000000000000101000000000000000000 -FST4 11111100010011100001000000010000001100 -FST4W 00000000000000000101000000000000010000 -Echo 00000000000000000000001000000000000000 -FCal 00110100000000000000000000000100000000 -FT8 11101000010011100001000010011000100000 -FT8/VHF 11101000010011100001000010011000100000 -FT8/Fox 11101000010011100001000000000010000000 -FT8/Hound 11101000010011100001000000000011000000 -FT8/SupHou 11111000010011100001000000000011000000 -------------------------------------------------- - 1 2 3 - 01234567890123456789012345678901234567 - -------------------------------------------------- -Mapping of column numbers to widgets -------------------------------------------------- - 0. txFirstCheckbox - 1. TxFreqSpinBox - 2. RxFreqSpinBox - 3. sbFtol - 4. rptSpinBox - 5. sbTR - 6. sbCQTxFreq, cbCQTx - 7. cbShMsgs - 8. cbFast9 - 9. cbAutoSeq -10. cbTx6 -11. pbTxMode -12. pbR2T -13. pbT2R -14. cbHoldTxFreq -15. sbSubmode -16. syncSpinBox -17. WSPR_Controls_Widget -18. ClrAvgButton -19. Fast/Normal/Deep -20. Include Avg -21. Include Deep Search -22. Echo Graph -23. cbSWL -24. AP FT8 -25. AP JT65 -26. AP DX Call -27. cbFirst -28. labNextCall -29. measure_check_box -30. labDXped -31. cbRxAll -32. cbCQonly -33. sbTR_FST4W -34. sbF_Low -35. sbF_High -36. AutoClrAvg -37. sbMaxDrift diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 643adb48..25e3cae7 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -31,6 +31,8 @@ set (UG_SRCS install-windows.adoc introduction.adoc intro_subsections.adoc + jtty.adoc + jtty_n1mm_integration.adoc keyboard_mouse.adoc logging.adoc make-qso.adoc @@ -40,6 +42,7 @@ set (UG_SRCS new_features.adoc platform-dependencies.adoc protocols.adoc + qmap.adoc settings-advanced.adoc settings-alerts.adoc settings-audio.adoc @@ -120,6 +123,7 @@ set (UG_IMGS images/JT4F.png images/JT65B.png images/jtalert.png + images/jtty.png images/keyboard-shortcuts.png images/letter-s.png images/log-qso.png @@ -142,6 +146,7 @@ set (UG_IMGS images/psk-reporter.png images/Q65-60A_EME_6m.png images/Q65_6m_ionoscatter.png + images/qmap_all.png images/r3666-config-screen-80.png images/r3666-main-ui-80.png images/r4148-txmac-ui.png diff --git a/doc/building on MS Windows.txt b/doc/building on MS Windows.txt deleted file mode 100644 index 4df3ddd2..00000000 --- a/doc/building on MS Windows.txt +++ /dev/null @@ -1,245 +0,0 @@ -Building WSJT-X on MS Windows -============================= - -Here I describe my set up, you may have other preferences due to your -favoured file system layout for tools, utilities, and libraries. Many -variations are possible, use this guide as a template. The aim is to -provide an environment suitable for general development. - -Prerequisite Tools and Libraries -================================ - -Here is an overview list, details are filled out below: - - * Qt Open Source Framework - * Cmake build system generator - * FFTW v3 DFT library - * libusb usb device library - * MSYS2 *nix like command line environment - * Hamlib rig control library - * Pkg Config Lite - * Boost C++ libraries (see separate document) - * portaudio library (used by map65) - -Qt Framework ------------- - -At the time of writing I recommend using Qt v5.15.2 64-bit, v5.15.1 -has a defect that affects us so is best avoided. You need the MinGW -version as we do not support the MSVC version due to lack of a -suitable FOSS Fortran complier. To install the Qt developer SDK you -should download the official Qt on-line installer, this allows you to -install one or more variants of the Qt SDK and also to maintain and -update the installation at a later date. There are many versions and -components within versions available, you only need the base 64-bit -MinGW framework for Qt v5.15.2 and the matching MinGW 8.1.0 64-bit -developer tools, other components can be unchecked within the on-line -installer. The default install location is C:\Qt which is fine, do -not attempt to move the location of the installed libraries if you -decide you want it elsewhere, the installer patches the libraries for -the installed location and it is easier to un-install and re-install -if you wish to change the installed location. - -CMake ------ - -Download and install a recent version from the official CMake web -site. A default installation is fine. I am currently using v3.18.4, -versions as old as v3.9 should work. - -Other tools and libraries without installers --------------------------------------------- - -For small libraries that don't have a Windows installer and change -often I locate them under a directory C:\Tools. This location is -arbitrary and just used to aggregate such items in one place, but this -document assumes that location so you may need to adjust paths etc. if -you use a different location. - -FFTW v3 DFT library -------------------- - -The MS Windows builds of FFTW3 can be downloaded from -http://www.fftw.org/install/windows.html. The ZIP archives for this -package have no directory structure so create a directory under C:\ -Tools\ called fftw-3.3.5-dll64 and unzip the archive there. You only -need the 64-bit package. - -libusb library --------------- - -This library is available from https://libusb.info/, download the .7z -archive as the .zip archive does not contain the libraries we -require. Unzip this package into C:\Tools. - -MSYS2 ------ - -This utility is available from https://www.msys2.org/. Follow the -download, installation, and initial upgrading instructions there. Once -installed and updated you will need to install some packages, these -are needed to provide the necessary *nix tools and utilities to build -Hamlib from sources. - - pacman -S autoconf automake libtool make tar - -Hamlib ------- - -There is a fork of the official Hamlib project which we keep up to -date with the official project master branch, we recommend building -from the 'integration' branch, or a suitable tag on that fork. The -fork is a git repository which can be cloned with this command: - - mkdir -p ~/src/sf/bsomervi - cd !$ - git clone git://git.code.sf.net/u/bsomervi/hamlib hamlib - cd hamlib - git checkout integration - -Next you must build Hamlib using the MinGW compiler tools bundled with -Qt. As you will build Hamlib again when there are updates you should -set up you MSYS2 command line environment for this. I use a -$HOME/.bash_profile file containing these lines: - - dll_paths_64bit=/c/Tools/libusb-1.0.23/MinGW64/dll:$HOME/local/hamlib/mingw64/release/bin - export PATH=/c/Qt/Tools/mingw810_64/bin:$dll_paths_64bit:$PATH - -Test the amended ~/.bash_profile file by opening a new MSYS2 shell and -typing: - - which gcc - which libusb-1.0.dll - -The first time you checkout the Hamlib sources you must bootstrap the -configuration script, this is done with a script at the root of the -Hamlib sources: - - cd ~/src/sf/bsomervi/hamlib - ./bootstrap - -Now you need to configure and build Hamlib from an MSYS2 shell. Create -a build directory outside of the Hamlib sources you have just cloned, -then change working directory to that build directory. - - mkdir -p ~/build/hamlib/release - cd !$ - ~/src/sf/bsomervi/hamlib/configure --enable-shared --disable-static \ - --prefix=$HOME/local/hamlib/mingw64/release \ - CFLAGS="-DNDEBUG -g -O2 -fdata-sections -ffunction-sections -I/c/Tools/libusb-1.0.23/include" \ - CXXFLAGS="-DNDEBUG -g -O2 -fdata-sections -ffunction-sections" \ - LDFLAGS="-Wl,--gc-sections" \ - LIBUSB_LIBS="-L/c/Tools/libusb-1.0.23/MinGW64/dll -lusb-1.0" - -Then build and install the Hamlib package into a local directory: - - make & make install-strip - -If you wish you can make a debug configuration build of Hamlib which -can be useful if you intended to contribute to the Hamlib project, or -for tracking down issues: - - mkdir -p ~/build/hamlib/debug - cd !$ - ~/src/sf/bsomervi/hamlib/configure --enable-shared --disable-static \ - --prefix=$HOME/local/hamlib/mingw64/debug \ - CFLAGS="-g -O0 -I/c/Tools/libusb-1.0.23/include" \ - CXXFLAGS="-g -O0" \ - LIBUSB_LIBS="-L/c/Tools/libusb-1.0.23/MinGW64/dll -lusb-1.0" - make && make install - -To update the Hamlib sources to the latest commit and rebuild: - - cd ~/src/sf/bsomervi/hamlib - git pull - cd ~/build/hamlib/release - make & make install-strip - cd ~/build/hamlib/debug - make && make install - -Note that the WSJT-X CMake build script will not detect an updated -build of the Hamlib DLL, so to avoid using an out-of-date Hamlib DLL -you should delete the Hamlib DLL (libhamlib-4.dll) from your WSJT-X -release configuration install tree before rebuilding and installing -WSJT-X after a Hamlib update. - -Pkg Config Lite ---------------- - -This package allows the WSJT-X CMake configuration to locate and learn -the options needed to consume the Hamlib package. You can download it -from https://sourceforge.net/projects/pkgconfiglite/files/0.28-1/ and -unzip it into a convenient location, as with other ancillary tools and -libraries I put these under C:\Tools\. - -portaudio ---------- - -This library is only available as sources so must be built. It uses -autotools and building using MinGW tools from an MSYS2 shell is -recommended. Ensure your MSYS2 shell environment (PATH) is correctly -set up for the MinGW tool chain you wish to build with, i.e. the MinGW -tools bundled with the Qt installation for 32-, or 64-bit as required. - -Download this specific version's sources tarball from -http://files.portaudio.com/download.html , at the time of writing that -was the pa_stable_v190600_20161030.tgz file. Unzip and unpack the -tarball in a suitable location like ~/src : - - cd ~/src - tar xf ~/Downloads/pa_stable_v190600_20161030.tgz - - -Note that on Windows portaudio will only build static libraries using -the standard configuration, we prefer dynamic libraries for portaudio -as users may wish to substitute a build of the library with ASIO -support for personal use (we cannot redistribute binaries built from -proprietary closed source sources like the Steinberg ASIO SDK). - -In order to build DLLs on Windows the configure script requires a -patch as follows: - - sed -i -e 's/-luuid//g' ~/src/portaudio/configure - -This removes linker dependencies on the MS uuid library since it is -only available as a static archive and using that would disallow -shared library creation. - -Out-of-source-tree builds are recommended, create a build directory in -a suitable location like ~/build and change working directory to it: - - mkdir -p ~/build/portaudio/mingw64 - cd !$ - -Configure and build and install the library in a suitable place (I use -~/local as a root directory for installed packages. - - ~/src/portaudio/configure --prefix=$HOME/local/portaudio/mingw64 \ - --with-winapi=wmme,directx,wdmks --disable-static --enable-shared CFLAGS=-DNDEBUG - make && make install - -Repeat for the 32-bit architecture if required, using a suitable MSYS2 -environment for the required tool chain, different build directory, -and install location. - -Update your CMake tool chain files to include the install directory, -or directories, above. I have something like this in the 64-bit tool -chain files: - - # ... - set (PORTAUDIODIR C:/Users/bill/local/portaudio/mingw64) - # ... - set (CMAKE_PREFIX_PATH ... ${PORTAUDIODIR} ...) - #... - -and similarly with the 32-bit tool chain file specifying the mingw32 -portaudio installation root directory. - -To run Debug configuration WSJT-X builds you will also need to add the -location of the portaudio DLL to your PATH environment variable, like: - - SET "Path=%UserProfile%\local\portaudio\mingw64\bin;%Path%" - -Verify the setup with: - - WHERE libportaudio-2.dll diff --git a/doc/building-Boost-libs.txt b/doc/building-Boost-libs.txt deleted file mode 100644 index 79a7f9aa..00000000 --- a/doc/building-Boost-libs.txt +++ /dev/null @@ -1,243 +0,0 @@ -Linux -===== - -Debian style: - -sudo apt install libboost-all-dev - -RPM style: - -sudo dnf install boost-devel - - -macOS -===== - -Download the latest Boost sources from here: boost.org - -Currently v 1.74.0 - -https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.tar.bz2 - -cd ~/Downloads -curl -L -O https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.tar.bz2 -mkdir src -cd !$ -tar --bzip2 -xf ~/Downloads/boost_1_74_0.tar.bz2 -cd boost_1_74_0/tools/build -./bootstrap.sh -./b2 toolset=clang --prefix=$HOME/local/boost-build install -cd ../.. -~/local/boost-build/bin/b2 -j8 toolset=clang cflags=-mmacosx-version-min=10.12 \ - cxxflags=-mmacosx-version-min=10.12 mflags=-mmacosx-version-min=10.12 \ - mmflags=-mmacosx-version-min=10.12 mflags=-mmacosx-version-min=10.12 \ - linkflags=-mmacosx-version-min=10.12 \ - architecture=x86 address-model=64 --prefix=$HOME/local/boost install - -That will take a while, once successful (warnings can be ignored) you -can clean the build tree to save some space: - -~/local/boost-build/bin/b2 toolset=clang cflags=-mmacosx-version-min=10.12 \ - cxxflags=-mmacosx-version-min=10.12 mflags=-mmacosx-version-min=10.12 \ - mmflags=-mmacosx-version-min=10.12 mflags=-mmacosx-version-min=10.12 \ - linkflags=-mmacosx-version-min=10.12 \ - architecture=x86 address-model=64 --prefix=$HOME/local/boost clean - -All that remains is to reconfigure your WSJT-X build trees to include -~/local/boost in your CMAKE_PREFIX_PATH, maybe something like these -(one each for Debug and Release configuration builds and assumes the -Macports GCC v7 tool-chain is being used): - -FC=gfortran-mp-7 \ - cmake \ - -D CMAKE_PREFIX_PATH:PATH=~/local/boost\;~/Qt/5.15.0/clang_64\;~/local/hamlib/release\;/opt/local \ - -D CMAKE_INSTALL_PREFIX=~/local/wsjtx/release \ - -D CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk \ - -D CMAKE_BUILD_TYPE=Release \ - -B ~/build/wsjtx-release \ - ~/src/bitbucket.org/k1jt/wsjtx - -FC=gfortran-mp-7 \ - cmake \ - -D CMAKE_PREFIX_PATH:PATH=~/local/boost\;~/Qt/5.15.0/clang_64\;~/local/hamlib/debug\;/opt/local \ - -D CMAKE_INSTALL_PREFIX=~/local/wsjtx/debug \ - -D CMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk \ - -D CMAKE_BUILD_TYPE=Debug \ - -B ~/build/wsjtx-debug \ - ~/src/bitbucket.org/k1jt/wsjtx - -Substitute you installed SDK version, Qt version and location, and -Hamlib install locations. - - -MS Windows -========== - -Because 32-bit and 64-bit builds are possible and each use different -tool-chains, two separate builds are necessary if both architectures -are required. - -Common steps ------------- - -Download and extract the latest Boost library sources, at the time of -writing that was -https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.7z -. Extract to some convenient location, I use %USERPROFILE%\src . - -Download and extract the libbacktrace sources from -https://github.com/ianlancetaylor/libbacktrace as follows. - -cd %USERPROFILE%\src -mkdir github.com -cd github.com -mkdir ianlancetaylor -cd ianlancetaylor -git clone git@github.com:ianlancetaylor/libbacktrace.git - -I install third-party tools under the C:\Tools directory, the -following assumes that, adjust to taste. Note that it is OK to install -both 32- and 64-bit builds of Boost to the same path as the library -names are unique per architecture and tool-chain. This saves a lot of -space as the boost header files are quite big, and there's no need to -install multiple copies. - -Create a new file %USERPROFILE%\src\boost_1_74_0\project-config.jam -with the following three lines to specify how Boost.Build finds the -libbacktrace library matched to your relevant C++ compliers: - -import toolset ; - -using gcc : : C:\\Qt\\Tools\\mingw730_32\\bin\\g++ : -I"C:\\Tools\\libbacktrace-1.0\\MinGW32\\include" -L"C:\\Tools\\libbacktrace-1.0\\MinGW32\\lib" ; - -using gcc : 8~64 : C:\\Qt\\Tools\\mingw810_64\\bin\\g++ : -I"C:\\Tools\\libbacktrace-1.0\\MinGW64\\include" -L"C:\\Tools\\libbacktrace-1.0\\MinGW64\\lib" ; - -Note that it may need some local adjustment of the C++ compiler -version and path depending on the exact tool-chains from your Qt -installation. Above I am using the Qt v5.12.9 MinGW32 v7 tool-chain -for 32-bit (toolset=gcc), and Qt v5.15.0 MinGW64 v8 tool-chain for -64-bit (toolchain=gcc-8~64). - -32-bit ------- - -Start an MSys or MSys2 shell with the 32-bit C/C++ tool-chain from -your Qt installation on the PATH environment variable. - -cd ~/src/github.com/ianlancetaylor/libbacktrace -./configure --prefix=/c/Tools/libbacktrace-1.0/MinGW32 -make && make install -make clean - -Start a CMD window suitably configured for use of the 32-bit MinGW -tool-chain bundled with your Qt binary installation. Verify the -correct compiler is in the PATH. i.e. it identifies (g++ --version) as -i686-posix-dwarf-rev0. - -cd %USERPROFILE%\src\boost_1_74_0\tools\build -bootstrap.bat mingw -.\b2 --prefix=C:\Tools\boost-build\MinGW32 install -cd ..\.. -C:\Tools\boost-build\MinGW32\bin\b2 -j8 toolset=gcc ^ - --build-dir=%USERPROFILE%\build\boost ^ - address-model=32 architecture=x86 variant=debug,release ^ - link=shared threading=multi ^ - --with-log --with-stacktrace --with-timer --prefix=C:\Tools\boost install - -If all is well you should see the following line about a 1/3 of the -way through the initial configuration steps. - - - libbacktrace builds : yes - -After some time it should complete with something like: - -...failed updating 1574 targets... -...skipped 1112 targets... -...updated 3924 targets... - -warnings can usually be ignored. If successful; you can release some -space by cleaning the build tree: - -C:\Tools\boost-build\MinGW32\bin\b2 toolset=gcc ^ - --build-dir=%USERPROFILE%\build\boost ^ - --build-type=complete clean - -64-bit -====== - -Start an MSys or MSys2 shell with the 64-bit C/C++ tool-chain from -your Qt installation on the PATH environment variable. - -cd ~/src/github.com/ianlancetaylor/libbacktrace -./configure --prefix=/c/Tools/libbacktrace-1.0/MinGW64 -make && make install -make clean - -Start a CMD window suitably configured for use of the 64-bit MinGW -tool-chain bundled with your Qt binary installation. Verify the -correct compiler is in the PATH. i.e. it identifies (g++ --version) as -x86_64-posix-seh-rev0. Note the toolchain specified must match your -compilers and the project-config.jam file you created above. With a v7 -64-bit C++ compiler use gcc-7~64, with a v8 64-bit C++ compiler use -gcc-8~64. My example matches my 64-bit Qt v5.15.0 with the bundled -MinGW64 v8.1.0. - -cd %USERPROFILE%\src\boost_1_74_0\tools\build -bootstrap.bat mingw -.\b2 --prefix=C:\Tools\boost-build\MinGW64 install -cd ..\.. -C:\Tools\boost-build\MinGW64\bin\b2 -j8 toolset=gcc-8~64 ^ - address-model=64 architecture=x86 variant=debug,release ^ - link=shared threading=multi ^ - --with-log --with-stacktrace --with-timer ^ - --build-dir=%USERPROFILE%\build\boost ^ - --prefix=C:\Tools\boost install - -If all is well you should see the following line about a 1/3 of the -way through the initial configuration steps. - - - libbacktrace builds : yes - -After some time it should complete with something like: - -...failed updating 108 targets... -...skipped 32 targets... -...updated 3648 targets... - -warnings can usually be ignored. If successful; you can release some -space by cleaning the build tree: - -C:\Tools\boost-build\MinGW64\bin\b2 toolset=gcc-8~64 ^ - address-model=64 --build-dir=%USERPROFILE%\build\boost ^ - --build-type=complete clean - - -Run-time Environment --------------------- - -You will need to add C:\Tools\boost\lib to your PATH environment -variable in order to run installed Debug configurations of WSJT-X, or -to execute build artefacts from a build tree. It is also needed for -teh install target of release configuration builds. Installed Release -configurations will move any required DLLs to the installation bin -directory automatically. - -Setting up WSJT-X builds ------------------------- - -All that remains is to add C:\Tools\boost\ to your 32- and 64-bit -build configurations CMAKE_PREFIX_PATH variables. I use tool-chain -files for my WSJT-X builds on Windows, an extract from my 32-bit Debug -configuration tool-chain file: - -# ... - -set (BOOSTDIR C:/Tools/boost) -set (QTDIR C:/Qt/5.15.2/mingw81_32) -set (FFTWDIR C:/Tools/fftw-3.3.5-dll32) -set (HAMLIBDIR C:/test-install/hamlib/mingw32/debug) -set (LIBUSBDIR C:/Tools/libusb-1.0.23) - -# where to find required packages -set (CMAKE_PREFIX_PATH ${BOOSTDIR} ${QTDIR} ${FFTWDIR} ${HAMLIBDIR} ${HAMLIBDIR}/bin ${LIBUSBDIR}) - -# ... diff --git a/doc/common/links.adoc b/doc/common/links.adoc index 0fb162b6..b1fffbf8 100644 --- a/doc/common/links.adoc +++ b/doc/common/links.adoc @@ -15,7 +15,6 @@ Perform searches from the doc root directory: doc Search: grep -rl --exclude-dir="*\.git" {pskreporter} . grep -rl --exclude-dir="*\.git" PSK Reporter . grep -rl --exclude-dir="*\.git" {devrepo} . - grep -rl --exclude-dir="*\.git" {kvasd} . grep -rl --exclude-dir="*\.git" {ntpsetup} . Include links.adoc: grep -rl --exclude-dir="*\.git" pskreporter . @@ -112,7 +111,6 @@ d). Edit lines as needed. Keeping them in alphabetic order help see dupes. :win32: https://sourceforge.net/projects/wsjt/files/wsjtx-{VERSION}/wsjtx-{VERSION}-win32.exe[wsjtx-{VERSION}-win32.exe] :win64: https://sourceforge.net/projects/wsjt/files/wsjtx-{VERSION}/wsjtx-{VERSION}-win64.exe[wsjtx-{VERSION}-win64.exe] :wsjt-devel: https://sourceforge.net/projects/wsjt/lists/wsjt-devel/[wsjt-devel] - // MAIL-TO links :alex_efros: mailto:powerman@powerman.name[Alex Efros] :bill_somerville: mailto:g4wjs -at- c l a s s d e s i g n -dot- com [G4WJS] diff --git a/doc/user_guide/en/acknowledgements.adoc b/doc/user_guide/en/acknowledgements.adoc index 7998233b..6d465734 100644 --- a/doc/user_guide/en/acknowledgements.adoc +++ b/doc/user_guide/en/acknowledgements.adoc @@ -2,12 +2,12 @@ The _WSJT_ project was started by *K1JT* in 2001. Starting in 2005 it has been an Open Source project, and it has included the programs -_WSJT_, _MAP65_, _WSPR_, _WSJT-X_, and _QMAP_. *G4WJS* (2013-2021), -*K9AN* (since 2015), *IV3NWV* (2016), *DG2YCB* (2021-2026), *N9ADG* (2022), -*G4KLA* (2024), *DL3WDG* (2024), *W3SZ* (2025), and *KJ5HST* and *KD0BTO* (2026) -have made major contributions to _WSJT-X_. *G4WJS* and *W9MDB* also -made major contributions to the _Hamlib_ library, on which _WSJT-X_ -depends for rig control. +_WSJT_, _MAP65_, _WSPR_, _WSJT-X_, and _QMAP_. *G4WJS* (since 2013), +*K9AN* (2015), *IV3NWV* (2016), *DG2YCB* (2021-2026), *N9ADG* (2022), +*G4KLA* (2024), *DL3WDG* (2024), *W3SZ* (2025), *KJ5HST*, and *KD0BTO* +(2026) have made major contributions to _WSJT-X_. *G4WJS* and *W9MDB* +also made major contributions to the _Hamlib_ library, on which +_WSJT-X_ depends for rig control. All code in the _WSJT_ project is licensed under the GNU Public License (GPL). Many users of these programs, too numerous to mention diff --git a/doc/user_guide/en/controls-functions-center.adoc b/doc/user_guide/en/controls-functions-center.adoc index 4dcc0168..d9b93869 100644 --- a/doc/user_guide/en/controls-functions-center.adoc +++ b/doc/user_guide/en/controls-functions-center.adoc @@ -23,6 +23,11 @@ clicking the corresponding downward-pointing button. Your on-the-air frequency (normally that of your lowest tone) is the sum of dial frequency and audio Tx frequency. +IMPORTANT: The operator is responsible for ensuring that the complete occupied +spectrum of each transmission remains within applicable frequency allocations +and license conditions, and follows local band-plan conventions. _WSJT-X_ does +not enforce jurisdiction-specific operating limits. + * Check the box *Hold Tx Freq* to ensure that the specified Tx frequency is not changed automatically when you double-click on decoded text or a signal in the waterfall. @@ -63,8 +68,16 @@ features for particular operating modes: ** *Auto Seq* enables auto-sequencing of Tx messages -** *Call 1st* enables automatic response to the first decoded -responder to your CQ +** The CQ response mode drop-down controls automatic responses to +decoded responders to your CQ. Select *CQ: None* to disable automatic +CQ responses, *CQ: First* to respond to the first decoded responder, +*CQ: Max Dist* to prefer the most distant responder, *CQ: Max dB* to +prefer the strongest responder, or *CQ: Min dB* to prefer the weakest +responder. Automatic caller selection requires *Auto Seq* and a response +mode other than *CQ: None*. When a CQ or QRZ is pending, an eligible direct +caller decoded after *Enable Tx* is armed can replace it. Arming during +reception applies only to the remainder of that period; earlier decodes and +callers from earlier periods are not retained. ** *Tx6* toggles between two types of shorthand messages in JT4 and - Q65 modes \ No newline at end of file + Q65 modes diff --git a/doc/user_guide/en/controls-functions-left.adoc b/doc/user_guide/en/controls-functions-left.adoc index f4acaa5e..e6674f1d 100644 --- a/doc/user_guide/en/controls-functions-left.adoc +++ b/doc/user_guide/en/controls-functions-left.adoc @@ -9,6 +9,10 @@ checked on the *File | Settings | General* tab and a callsign is present in the *DX Call* box, the *DX Call* button turns yellow to warn that your station is primed to transmit. +When operating as a Hound, double-click a potential Fox decoded at +`:00` or `:30`. Stations decoded at `:15` or `:45` use the Hound +transmit slot and cannot be selected. + //.Misc Controls Left image::misc-main-ui.png[align="center",alt="Misc Menu Items"] @@ -59,4 +63,4 @@ the *File | Settings | Colors* tab. * You can invoke on-line searches for details about a station with a simple mouse click. Right-click on the *Lookup* button to search for the DX Call on `qrz.com`, the *Add* button for `hamqth.com`, and the -*Ignore* button `qrzcq.com`. \ No newline at end of file +*Ignore* button `qrzcq.com`. diff --git a/doc/user_guide/en/controls-functions-messages.adoc b/doc/user_guide/en/controls-functions-messages.adoc index 77afd1ef..cfed8617 100644 --- a/doc/user_guide/en/controls-functions-messages.adoc +++ b/doc/user_guide/en/controls-functions-messages.adoc @@ -28,11 +28,12 @@ Pressing *Enter* on a modified message #5 automatically adds that message to the stored macros. * In some circumstances it may be desirable to make your QSOs as short -as possible. To configure the program to start contacts with message -#2, disable message #1 by double-clicking its radio-button in the -*Next* column or *Tx 1* button in the *Now* column. Similarly, to -send RR73 rather than RRR for message #4, double-click one of its -buttons. + as possible. To configure the program to start contacts with message + #2, disable message #1 by double-clicking its radio-button in the + *Next* column or *Tx 1* button in the *Now* column. Similarly, in + modes that support RR73, double-click one of the *Tx 4* buttons to + send RR73 rather than RRR. Legacy 72-bit and shorthand modes always + use RRR for Tx4. TIP: During a transmission the actual message being sent is displayed in the first box of the status bar (bottom-left corner of the main diff --git a/doc/user_guide/en/controls-functions-status-bar.adoc b/doc/user_guide/en/controls-functions-status-bar.adoc index df82de65..809ddfbd 100644 --- a/doc/user_guide/en/controls-functions-status-bar.adoc +++ b/doc/user_guide/en/controls-functions-status-bar.adoc @@ -15,11 +15,15 @@ highlighted in green for Receiving, yellow for Tx, red for Tune, and light blue for a file name. When transmitting, the Tx message is displayed exactly as it will be decoded by receiving stations. The second label (as shown above) will be absent if you are using the -*Default* setting on the *Configurations* menu. A progress bar shows -the elapsed fraction of a Tx or Rx sequence. Finally, if the Watchdog +*Default* setting on the *Configurations* menu. In most modes, the next +label shows the number of messages decoded in the most recent receive +sequence. In Q65 it instead shows the number of receive sequences +accumulated for message averaging in the even and odd time slots. A +progress bar shows the elapsed fraction of a Tx or Rx sequence. Finally, +if the Watchdog (WD) timer was enabled on the *Files | Settings | General* tab, a label in the lower right-hand corner displays the number of minutes remaining before timeout. TIP: Temporary status messages may occasionally be displayed here for -a few seconds when background processing completes. \ No newline at end of file +a few seconds when background processing completes. diff --git a/doc/user_guide/en/controls-functions-wide-graph.adoc b/doc/user_guide/en/controls-functions-wide-graph.adoc index 22303d72..bbae3674 100644 --- a/doc/user_guide/en/controls-functions-wide-graph.adoc +++ b/doc/user_guide/en/controls-functions-wide-graph.adoc @@ -41,9 +41,11 @@ uneven response across the received passband. For this feature to work properly, you should restrict the range of displayed frequencies so that only the active part of the spectrum is shown. -- Check *Ref Spec* if you are using a pre-computed -<>. This control is available -only when a saved reference spectrum exists. +- Check *Ref Spec* to apply a pre-computed +<> to new received audio before +spectrum display and decoding. Clearing the checkbox stops applying the +correction to subsequent audio. This control is available only when a +saved reference spectrum exists. - Select *Current* or *Cumulative* for the spectrum displayed in the bottom one-third of the Wide Graph window. *Current* is the average diff --git a/doc/user_guide/en/docinfo.html b/doc/user_guide/en/docinfo.html index dbbfc166..bbc410c2 100644 --- a/doc/user_guide/en/docinfo.html +++ b/doc/user_guide/en/docinfo.html @@ -14,4 +14,23 @@ a:visited { color: purple; } + + #header .details { + border-bottom: none; + } + + .paragraph.copyright { + border-bottom: 1px solid #dddddf; + padding-bottom: 0.5em; + } + + .paragraph.copyright p { + font-size: 1.0em; + margin-right: 20em; + color: #666; + } + + .appicon { + margin-right: 3em; + } diff --git a/doc/user_guide/en/images/FST4_center.png b/doc/user_guide/en/images/FST4_center.png index 0c3e0c7f..d32d1870 100644 Binary files a/doc/user_guide/en/images/FST4_center.png and b/doc/user_guide/en/images/FST4_center.png differ diff --git a/doc/user_guide/en/images/VHF_controls.png b/doc/user_guide/en/images/VHF_controls.png index 1f088884..29d0b06b 100644 Binary files a/doc/user_guide/en/images/VHF_controls.png and b/doc/user_guide/en/images/VHF_controls.png differ diff --git a/doc/user_guide/en/images/active_stations_QMAP.png b/doc/user_guide/en/images/active_stations_QMAP.png index b76f4d0b..24b1344a 100644 Binary files a/doc/user_guide/en/images/active_stations_QMAP.png and b/doc/user_guide/en/images/active_stations_QMAP.png differ diff --git a/doc/user_guide/en/images/jtty.png b/doc/user_guide/en/images/jtty.png new file mode 100644 index 00000000..76c4df09 Binary files /dev/null and b/doc/user_guide/en/images/jtty.png differ diff --git a/doc/user_guide/en/images/main-ui-controls.png b/doc/user_guide/en/images/main-ui-controls.png index d0fb4011..f748e67c 100644 Binary files a/doc/user_guide/en/images/main-ui-controls.png and b/doc/user_guide/en/images/main-ui-controls.png differ diff --git a/doc/user_guide/en/images/map65_icon.png b/doc/user_guide/en/images/map65_icon.png new file mode 100644 index 00000000..68198d68 Binary files /dev/null and b/doc/user_guide/en/images/map65_icon.png differ diff --git a/doc/user_guide/en/images/misc-controls-center.png b/doc/user_guide/en/images/misc-controls-center.png index 19f14c71..69621cf1 100644 Binary files a/doc/user_guide/en/images/misc-controls-center.png and b/doc/user_guide/en/images/misc-controls-center.png differ diff --git a/doc/user_guide/en/images/misc-main-ui.png b/doc/user_guide/en/images/misc-main-ui.png index 578455cc..f8e71e2a 100644 Binary files a/doc/user_guide/en/images/misc-main-ui.png and b/doc/user_guide/en/images/misc-main-ui.png differ diff --git a/doc/user_guide/en/images/qmap_all.png b/doc/user_guide/en/images/qmap_all.png new file mode 100644 index 00000000..7466f586 Binary files /dev/null and b/doc/user_guide/en/images/qmap_all.png differ diff --git a/doc/user_guide/en/images/qmap_icon.png b/doc/user_guide/en/images/qmap_icon.png new file mode 100644 index 00000000..11026fa2 Binary files /dev/null and b/doc/user_guide/en/images/qmap_icon.png differ diff --git a/doc/user_guide/en/images/wsjtx_icon.png b/doc/user_guide/en/images/wsjtx_icon.png new file mode 100644 index 00000000..866213a6 Binary files /dev/null and b/doc/user_guide/en/images/wsjtx_icon.png differ diff --git a/doc/user_guide/en/install-from-source.adoc b/doc/user_guide/en/install-from-source.adoc index 971901e4..a8b63ed1 100644 --- a/doc/user_guide/en/install-from-source.adoc +++ b/doc/user_guide/en/install-from-source.adoc @@ -1,37 +1,551 @@ // Status=edited -Source code for _WSJT-X_ is available from a public repository at -{devrepo}. To compile the program, at a minimum you must install the -following packages: - -- Git -- Qt 5.2 or later -- g++ 4.8 or later -- gfortran 4.8 or later -- fftw3 -- MinGW (for Windows only) -- OpenSSL runtime DLLs in the MinGW environment used for Windows - installer builds - -For Windows installer builds, the _OpenSSL_ runtime DLLs bundled with -the installer are taken from the build environment. The DLLs must match -the Qt libraries used by that environment. - -Source code for _WSJT-X_ v{VERSION} can be downloaded with the command: - -===== -git clone git://git.code.sf.net/p/wsjt/wsjtx -cd wsjtx -git checkout wsjtx-{VERSION} -===== - -and for the current development branch: - -===== -git clone git://git.code.sf.net/p/wsjt/wsjtx -===== - -If you are interested in contributing to the development and -documentation of _WSJT_ and its sister programs, please join the -developer's email list {devmail} and let us know of your areas of -interest. += Building from source + +This guide is for developers building _WSJT-X_, _MAP65_, or _QMAP_ from +source. To install and operate a released version instead, use the platform +packages from the https://github.com/WSJTX/wsjtx/releases[official GitHub +Releases page]. + +== Know which build you need + +The same source can be built for several different purposes. Choose the +simplest path that answers your question: + +[%autowidth] +|=== +| Goal | Appropriate path + +| Edit, compile, and test locally +| Use the platform package manager and the instructions in this chapter. + +| Exercise an installed layout or create an unsigned package +| Complete the local build, then use the CMake `install` or `package` + target. + +|=== + +External contributors should fork the public repository; core team members +should use the private development branch assigned to their work. The +https://github.com/WSJTX/wsjtx/blob/master/CONTRIBUTING.md[contribution guide] +explains the repository model and pull-request workflow. + +== Common requirements + +All platforms require: + +* Git and CMake 3.20 or later for the commands as written. The project + configuration retains CMake 3.12 as its minimum for older build + environments. With CMake 3.12, replace `cmake -S . -B build` with + `mkdir -p build && (cd build && cmake ..)`. With CMake 3.12 through 3.19, + replace `ctest --test-dir build --output-on-failure` with + `(cd build && ctest --output-on-failure)`. +* Qt 5 Core, Widgets, Network, Multimedia, SerialPort, PrintSupport, Sql, + LinguistTools, and WebSockets; Test when developer tests are enabled; and + ActiveQt AxContainer on Windows +* C and C++ compilers with C++17 support +* a Fortran compiler, normally `gfortran` +* FFTW 3, including the single-precision `libfftw3f` library +* Boost, libusb, and PortAudio +* the Hamlib revision selected by the project's CI configuration + +CMake enables developer tests and User Guide generation by default. User Guide +generation requires Asciidoctor. If you do not need the local guide, configure +with `-DWSJT_GENERATE_DOCS=OFF`. + +Use an out-of-source build directory. This keeps generated files out of the +source tree and makes a clean reconfigure as simple as choosing a new directory. + +[[SRC_WINDOWS_MSYS2]] +== Building on Windows with MSYS2 + +The supported Windows developer environment is *MSYS2 MINGW64*. MSYS2 supplies +the compiler, Qt, CMake, and most libraries through its signed package +repositories. WSJT-X builds the CI-selected Hamlib revision separately. + +The project intentionally uses MINGW64 as its current Windows compatibility +contract. Do not substitute the MSYS, UCRT64, CLANG64, or another MSYS2 shell: +package names, binary formats, paths, and supported Windows APIs can differ. + +NOTE: The MSYS2 Boost package is suitable for local development. Official + Windows builds use a separate Boost configuration to support older + Windows versions; see `.github/workflows/build-windows.yml`. + +=== Install and update MSYS2 + +. Download and run the installer from https://www.msys2.org. The default + location, `C:\msys64`, is suitable. +. Open the *MSYS2 MINGW64* shell. +. Update the base system: + +[source,bash] +---- +pacman -Syu +---- + +MSYS2 may ask you to close the terminal during a core update. Close it, reopen +*MSYS2 MINGW64*, and run `pacman -Syu` again until no further core update is +required. + +Every command in the remainder of the Windows section runs in that MINGW64 +shell. Confirm the environment before installing packages: + +[source,bash] +---- +echo "$MSYSTEM" +---- + +The result must be `MINGW64`. + +=== Install the local-development dependencies + +Install the compiler, build tools, and libraries: + +[source,bash] +---- +pacman -S --needed \ + git make tar autoconf automake libtool \ + mingw-w64-x86_64-gcc \ + mingw-w64-x86_64-gcc-fortran \ + mingw-w64-x86_64-cmake \ + mingw-w64-x86_64-qt5-base \ + mingw-w64-x86_64-qt5-multimedia \ + mingw-w64-x86_64-qt5-serialport \ + mingw-w64-x86_64-qt5-svg \ + mingw-w64-x86_64-qt5-tools \ + mingw-w64-x86_64-qt5-websockets \ + mingw-w64-x86_64-qt5-activeqt \ + mingw-w64-x86_64-fftw \ + mingw-w64-x86_64-boost \ + mingw-w64-x86_64-libusb \ + mingw-w64-x86_64-openssl \ + mingw-w64-x86_64-portaudio \ + mingw-w64-x86_64-pkg-config +---- + +User Guide generation is enabled by default. Install Ruby and Asciidoctor if +you want the guide included in the build: + +[source,bash] +---- +pacman -S --needed mingw-w64-x86_64-ruby +gem install asciidoctor --no-document +---- + +If you skip these tools, add `-DWSJT_GENERATE_DOCS=OFF` to the CMake command in +the configure section. The application and automated tests do not require a +locally rendered User Guide. + +NSIS is required only when creating an unsigned Windows installer: + +[source,bash] +---- +pacman -S --needed mingw-w64-x86_64-nsis +---- + +Check that the MINGW64 programs, rather than programs from another Windows +toolchain, will be used: + +[source,bash] +---- +missing_tools=0 +for tool in gcc g++ gfortran cmake qmake-qt5 dumpcpp-qt5; do + command -v "$tool" || { echo "MISSING: $tool"; missing_tools=1; } +done +if test "$missing_tools" -eq 0; then + gcc --version + gfortran --version + cmake --version +else + echo "Install the missing tools before continuing." >&2 + false +fi +---- + +The MinGW programs should resolve under `/mingw64/bin`. Do not continue until +the check reports a path for every tool and no `MISSING` line. + +=== Clone the source + +Clone from inside the MINGW64 shell. These commands use a predictable workspace +under the MSYS2 home directory: + +[source,bash] +---- +mkdir -p ~/wsjtx-dev +cd ~/wsjtx-dev +git -c core.autocrlf=false -c core.longpaths=true \ + clone https://github.com/WSJTX/wsjtx.git src +cd src +git config core.autocrlf false +git config core.longpaths true +---- + +Keeping automatic CRLF conversion disabled prevents generated version metadata +from treating an unchanged checkout as modified. Long-path support accommodates +deep source and generated-file names used by the Windows build. + +External contributors should clone their fork instead and add +`https://github.com/WSJTX/wsjtx.git` as the `upstream` remote. Core team +members should use the private repository and the development branch assigned +to their work. + +=== Install OmniRig + +Install https://www.dxatlas.com/OmniRig/[OmniRig] in Windows. The usual +location is +`C:\Program Files (x86)\Afreet\OmniRig\OmniRig.exe`. WSJT-X does not link +against OmniRig at build time, but `dumpcpp` reads the COM type library +embedded in this executable to generate the ActiveQt interface. + +MSYS2 installs this tool as `dumpcpp-qt5`. The build finds that name directly; +do not copy or rename it to `dumpcpp`. + +=== Build the CI-selected Hamlib revision + +The CI configuration selects the Hamlib revision supported by this WSJT-X +source. Read it from the checked-out tree rather than assuming that the newest +Hamlib branch is compatible: + +[source,bash] +---- +cd ~/wsjtx-dev/src +HAMLIB_BRANCH=$(awk -F'"' '/hamlib_branch:/ {print $2; exit}' \ + .github/workflows/ci.yml) +if test -n "$HAMLIB_BRANCH"; then + echo "Building Hamlib $HAMLIB_BRANCH" +else + echo "hamlib_branch is missing" >&2 + false +fi +---- + +If this check fails, inspect the `hamlib_branch` setting in +`.github/workflows/ci.yml` before continuing. + +[source,bash] +---- +cd ~/wsjtx-dev +git clone --depth 1 --branch "$HAMLIB_BRANCH" \ + https://github.com/Hamlib/Hamlib.git hamlib-src +cd hamlib-src +./bootstrap +./configure --prefix="$HOME/wsjtx-dev/hamlib-prefix" \ + --enable-shared --disable-static \ + --without-cxx-binding --without-readline \ + CFLAGS="-DNDEBUG -g -O2 -fdata-sections -ffunction-sections" \ + LDFLAGS="-Wl,--gc-sections" +make -j"$(nproc)" +make install-strip +---- + +This creates an isolated Hamlib installation under +`~/wsjtx-dev/hamlib-prefix`; it does not replace another Hamlib installation +on the computer. + +If the CI pin changes, remove or rename `hamlib-src` and +`hamlib-prefix`, then repeat this section. A shallow clone made for an older +tag may not contain the new revision. + +=== Configure and build WSJT-X + +Return to the source tree and configure a local developer build. The normal +build includes WSJT-X, MAP65, and QMAP; add `-DWSJT_SKIP_QMAP=ON` to omit QMAP. + +[source,bash] +---- +cd ~/wsjtx-dev/src +OMNIRIG=$(cygpath "C:/Program Files (x86)/Afreet/OmniRig/OmniRig.exe") + +cmake -G "MSYS Makefiles" -S . -B build \ + -DCMAKE_PREFIX_PATH="$HOME/wsjtx-dev/hamlib-prefix" \ + -DCMAKE_INSTALL_PREFIX=C:/WSJT \ + -DOMNIRIG_TYPE_LIB="$OMNIRIG" \ + -DCMAKE_Fortran_FLAGS="-fallow-argument-mismatch -std=legacy" \ + -DWSJT_SKIP_MANPAGES=ON \ + -DWSJT_FORTRAN_LIBRARY_VARIANTS=OPENMP_ONLY \ + -Wno-dev + +cmake --build build -j"$(nproc)" +---- + +CMake 4.4 may report that `-Wno-dev` is deprecated. This notice is harmless; +the guide keeps the option because it also works with the documented older +CMake versions. + +The important options are: + +[%autowidth] +|=== +| Option | Purpose + +| `CMAKE_PREFIX_PATH` +| Locates the Hamlib installation built above. + +| `CMAKE_INSTALL_PREFIX` +| Selects the destination used by the install target. + +| `OMNIRIG_TYPE_LIB` +| Identifies the OmniRig executable whose COM type library `dumpcpp` reads. + +| `CMAKE_Fortran_FLAGS` +| Allows current gfortran to compile the project's legacy Fortran interfaces. + +| `WSJT_SKIP_MANPAGES` +| Avoids Unix manpage tooling that is not used by the Windows build. + +| `WSJT_FORTRAN_LIBRARY_VARIANTS=OPENMP_ONLY` +| Builds the normal OpenMP decoder-library variant. + +| `WSJT_GENERATE_DOCS=OFF` +| Omits the local User Guide when Asciidoctor is not installed. + +| `WSJT_SKIP_QMAP=ON` +| Omits QMAP from the build. +|=== + +=== Run the automated tests + +Tests are enabled by default. Hamlib's DLL must be on `PATH` while Windows +loads test executables that use rig-control code: + +[source,bash] +---- +cd ~/wsjtx-dev/src +export PATH="$HOME/wsjtx-dev/hamlib-prefix/bin:$PATH" +export QT_QPA_FONTDIR=C:/Windows/Fonts +ctest --test-dir build --output-on-failure +---- + +Some GUI tests use Qt's offscreen platform, which does not find the Windows +system fonts automatically. `QT_QPA_FONTDIR` lets those tests render text +without installing a separate font package. + +To rerun a single test, substitute its name below: + +[source,bash] +---- +ctest --test-dir build -R '^test_name$' --output-on-failure +---- + +An ordinary local test run does not require a separate pFUnit installation. + +=== Install and run + +The build directory is useful for tests, but it is not a self-contained +application layout. Install to the prefix selected during configuration: + +[source,bash] +---- +cmake --build build --target install +---- + +This places the application under `C:\WSJT`. Executables and required runtime +DLLs are collected in `C:\WSJT\bin`; program data is installed under +`C:\WSJT\share\wsjtx`. Run `C:\WSJT\bin\wsjtx.exe` from Windows +Explorer, Command Prompt, or the MINGW64 shell. + +The install step matters. A build-tree executable can find compiler and Qt DLLs +through the MINGW64 environment, but it does not have the final data-file and +plugin layout. It is suitable for a quick launch only: + +[source,bash] +---- +export PATH="$HOME/wsjtx-dev/hamlib-prefix/bin:$PATH" +export QT_QPA_PLATFORM_PLUGIN_PATH=/mingw64/share/qt5/plugins +./build/wsjtx.exe +---- + +Missing Hamlib on `PATH` produces a DLL-load failure. A missing Qt platform +plugin commonly reports that `qwindows.dll` could not be found or loaded. +Even when it starts, the build-tree application is not suitable for normal +operation: features that require installed ephemeris, callsign, country, or +other data files can fail. For example, an FT8 decode can report +`ALLCALL7.TXT is too short or broken?`, and opening Astronomical Data can fail +without the installed ephemeris. Use the installed copy for functional testing. + +=== Create an unsigned installer + +After installing NSIS, create a package from the configured build: + +[source,bash] +---- +cmake --build build --target package +---- + +The installer is written under `build` as `wsjtx--win64.exe`. +It is unsigned, so Windows SmartScreen may warn about it. + +=== Update safely + +Update the MSYS2 environment with: + +[source,bash] +---- +pacman -Syu +---- + +Update the checked-out branch, then rerun the CMake configure command, build, +and tests: + +[source,bash] +---- +cd ~/wsjtx-dev/src +git pull --ff-only +---- + +Rebuild Hamlib when the CI-selected revision changes. + +Use a new build directory after a major MSYS2 update changes GCC, gfortran, +CMake, Qt, the MinGW runtime, or foundational libraries. Cached compiler and +dependency paths from an older environment can otherwise produce confusing +configure, link, or runtime failures. + +=== Troubleshooting Windows builds + +For Windows build failures, check the following: + +* `echo "$MSYSTEM"` reports `MINGW64`. +* Every tool check from the dependency section resolves under `/mingw64/bin`. +* `OMNIRIG_TYPE_LIB` names an existing Windows installation of + `OmniRig.exe`. +* `mingw-w64-x86_64-openssl` is installed if CMake reports missing OpenSSL + runtime DLLs. +* `~/wsjtx-dev/hamlib-prefix` contains `include/hamlib/rig.h`, + `lib/libhamlib.dll.a`, and `bin/libhamlib-4.dll`. + +After fixing a configuration error, rerun the configure command. + +For a useful support report, include: + +[source,bash] +---- +echo "$MSYSTEM" +git rev-parse --short HEAD +cmake --version +gcc --version +gfortran --version +pacman -Q | sort +---- + +Also include the complete CMake error or failing command, not only its final +line, and state whether the failure occurred during configure, compile, test, +install, package, or application launch. + +== Linux and macOS developer builds + +Use the native package manager for local-development dependencies, then build +the CI-selected Hamlib revision into a private workspace. Keeping dependency +source, installed libraries, and generated build files outside the WSJT-X +checkout makes updates and clean rebuilds easier. + +=== Install the dependencies + +On current Debian or Ubuntu systems, a practical dependency starting point is: + +[source,bash] +---- +sudo apt update +sudo apt install \ + git build-essential cmake gfortran \ + qtbase5-dev qttools5-dev qtmultimedia5-dev \ + libqt5serialport5-dev libqt5websockets5-dev \ + libqt5sql5-sqlite libqt5multimedia5-plugins \ + libfftw3-dev libboost-log-dev libusb-1.0-0-dev libudev-dev \ + portaudio19-dev autoconf automake libtool pkg-config texinfo \ + asciidoctor +---- + +On macOS, install the Xcode command-line tools and the local developer +dependencies with Homebrew: + +[source,bash] +---- +xcode-select --install +brew install cmake gcc qt@5 fftw boost libusb portaudio \ + autoconf automake libtool pkg-config texinfo asciidoctor +---- + +=== Clone the source + +Clone the public repository, substituting your fork's URL if contributing a +change. If you already have a checkout, change to its root directory instead. + +[source,bash] +---- +mkdir -p ~/wsjtx-dev +git clone https://github.com/WSJTX/wsjtx.git ~/wsjtx-dev/src +cd ~/wsjtx-dev/src +---- + +=== Build the CI-selected Hamlib revision + +Start in the root of the WSJT-X checkout. Capture its path and read the Hamlib +revision selected by that source: + +[source,bash] +---- +WSJTX_SOURCE=$(git rev-parse --show-toplevel) +WSJTX_WORKSPACE="$HOME/wsjtx-dev" +mkdir -p "$WSJTX_WORKSPACE" + +HAMLIB_BRANCH=$(awk -F'"' '/hamlib_branch:/ {print $2; exit}' \ + "$WSJTX_SOURCE/.github/workflows/ci.yml") +if test -n "$HAMLIB_BRANCH"; then + echo "Building Hamlib $HAMLIB_BRANCH" +else + echo "hamlib_branch is missing" >&2 + false +fi +---- + +If this check fails, inspect `.github/workflows/ci.yml` before continuing. The +remaining commands assume the same terminal session. They create Hamlib source +and installation directories beside each other under `~/wsjtx-dev`: + +[source,bash] +---- +git clone --depth 1 --branch "$HAMLIB_BRANCH" \ + https://github.com/Hamlib/Hamlib.git "$WSJTX_WORKSPACE/hamlib-src" +cd "$WSJTX_WORKSPACE/hamlib-src" +./bootstrap +./configure --prefix="$WSJTX_WORKSPACE/hamlib-prefix" \ + --enable-shared --disable-static \ + --without-cxx-binding --without-readline +make -j"$(getconf _NPROCESSORS_ONLN)" +make install-strip +---- + +If the CI-selected revision changes, remove or rename `hamlib-src` and +`hamlib-prefix`, then repeat this section. + +=== Configure, build, test, and install + +These local builds skip manpage generation, which requires additional tools. +On Linux, configure WSJT-X with the explicit source and workspace paths: + +[source,bash] +---- +cmake -S "$WSJTX_SOURCE" -B "$WSJTX_WORKSPACE/wsjtx-build" \ + -DCMAKE_PREFIX_PATH="$WSJTX_WORKSPACE/hamlib-prefix" \ + -DWSJT_SKIP_MANPAGES=ON \ + -DCMAKE_INSTALL_PREFIX="$HOME/wsjtx-prefix" +cmake --build "$WSJTX_WORKSPACE/wsjtx-build" +ctest --test-dir "$WSJTX_WORKSPACE/wsjtx-build" --output-on-failure +cmake --build "$WSJTX_WORKSPACE/wsjtx-build" --target install +---- + +On macOS, include the Homebrew library prefixes and select Homebrew's +`gfortran` explicitly. + +[source,bash] +---- +cmake -S "$WSJTX_SOURCE" -B "$WSJTX_WORKSPACE/wsjtx-build" \ + -DCMAKE_PREFIX_PATH="$WSJTX_WORKSPACE/hamlib-prefix;$(brew --prefix qt@5);$(brew --prefix fftw);$(brew --prefix boost);$(brew --prefix libusb);$(brew --prefix portaudio)" \ + -DCMAKE_Fortran_COMPILER="$(brew --prefix gcc)/bin/gfortran" \ + -DWSJT_SKIP_MANPAGES=ON \ + -DCMAKE_INSTALL_PREFIX="$HOME/wsjtx-prefix" +cmake --build "$WSJTX_WORKSPACE/wsjtx-build" +ctest --test-dir "$WSJTX_WORKSPACE/wsjtx-build" --output-on-failure +cmake --build "$WSJTX_WORKSPACE/wsjtx-build" --target install +---- diff --git a/doc/user_guide/en/install-mac.adoc b/doc/user_guide/en/install-mac.adoc index 0c589343..c03acf15 100644 --- a/doc/user_guide/en/install-mac.adoc +++ b/doc/user_guide/en/install-mac.adoc @@ -2,11 +2,11 @@ For *macOS* installers are provided for x86_64 (Intel) systems and for ARM64 (Apple silicon) systems. Download the correct package for your system from the {downloads}, double-click on the file name, and follow the on-screen prompts in the Installer -app. +app. -If you have already installed a previous version, you can retain it by -changing its name in the *Applications* folder (such as from _WSJT-X_ to -_WSJT-X_2.7.0_). You can then proceed to the installation phase. +If you have already installed a previous version, you can retain it +by changing its name in the *Applications* folder (such as from _WSJT-X_ to +_WSJT-X_3.0_). You can then proceed to the installation phase. Take note also of the following: diff --git a/doc/user_guide/en/install-windows.adoc b/doc/user_guide/en/install-windows.adoc index 07130437..5e844b4b 100644 --- a/doc/user_guide/en/install-windows.adoc +++ b/doc/user_guide/en/install-windows.adoc @@ -32,7 +32,7 @@ NOTE: Having a PC clock that appears to be synchronized to UTC is not synchronization errors gradually. [[OPENSSL]] - + * _WSJT-X_ uses the _OpenSSL_ libraries for TLS network connections. Current _WSJT-X_ Windows installers include the required _OpenSSL_ runtime DLLs. If they are missing or cannot be loaded, you may see the diff --git a/doc/user_guide/en/intro_subsections.adoc b/doc/user_guide/en/intro_subsections.adoc index 80f0a979..7f7c17e3 100644 --- a/doc/user_guide/en/intro_subsections.adoc +++ b/doc/user_guide/en/intro_subsections.adoc @@ -31,7 +31,7 @@ particular classes of users. IMPORTANT: *Warnings* about usage that could lead to undesired consequences. -=== User Interface in Other Languages +=== Other Languages The _WSJT-X_ user interface (UI) is now available in many languages. When a translated UI is available for the computer's default System @@ -52,23 +52,28 @@ image::Main_Window_es.png[align="center"] image::Main_Window_ja.png[align="center"] -=== How You Can Contribute +=== Contributing -_WSJT-X_ is part of an open-source project released under the -{gnu_gpl} (GPLv3). If you have programming or documentation skills or -would like to contribute to the project in other ways, please make -your interests known to the development team. The project's public -source-code repository can be found at {devrepo}, and you can open -Issues and submit explicit pull requests there. We encourage those -with translation skills to volunteer their help by translating this -_User Guide_ or the program's user interface. - -Bug reports and suggestions for new features or improvements to the -_User Guide_ may be submitted at the {devrepo} site or sent to -one of the email lists listed in the <> section. You -must join the group in order to post messages there. +*WSJT* is an open-source project hosted at {devrepo}. If you have +programming or documentation skills or would like to contribute to the +project in other ways, please make your interests known to the +development team. You can submit bug reports, suggestions for new +features, and explicit pull requests at the {devrepo} site. We +especially encourage those with translation skills to volunteer their +help, either for this _User Guide_ or for the program's user +interface. === License -Before using _WSJT-X_, please read our licensing terms -<>. +_WSJT-X_, _MAP65_, and _QMAP_ are free software intended for +communication by Amateur Radio. Copyright (C) 2001-2026 by Joseph +Taylor, K1JT, and the WSJT Development Team. + +You can redistribute and/or modify these programs under the terms of +Version 3 of the GNU General Public License as published by the Free +Software Foundation. The programs are distributed in the hope that +they will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. See the https://www.gnu.org/licenses/gpl-3.0.txt[GNU General +Public License] for more details. + diff --git a/doc/user_guide/en/introduction.adoc b/doc/user_guide/en/introduction.adoc index 287df6ab..c0b906f2 100644 --- a/doc/user_guide/en/introduction.adoc +++ b/doc/user_guide/en/introduction.adoc @@ -1,5 +1,7 @@ // Status=review +image:wsjtx_icon.png[WSJT-X icon,100,role=appicon] image:map65_icon.png[MAP65 icon,100,role=appicon] image:qmap_icon.png[QMAP icon,100,role=appicon] + *_WSJT-X_* is an open source computer program designed to facilitate basic amateur radio communication using very weak signals. The first four letters in the program name stand for "`**W**eak **S**ignal @@ -23,17 +25,6 @@ Doppler tracking for Earth-Moon-Earth (EME) QSOs and lunar-Echo testing. The program analyzes received passbands up to 5 kHz wide and runs equally well on Windows, Macintosh, and Linux systems. -*Version Numbers* for our programs have major, minor, and patch -numbers separated by periods: for example, _WSJT-X 3.0.0_. Temporary -release candidates are sometimes made in advance of a new -general-availability (GA) release, in order to obtain user -feedback. Release candidates are given version labels such as -3.0.0-rc1, 3.0.0-rc2, etc., leading up to the general availability -(GA) release of version 3.0.0. Release candidates should be used only -during a defined testing period, and they carry an implicit obligation -to provide feedback to the program developers. Release candidates -should not be used on the air after a GA release with the same number. - *_MAP65_* and *_QMAP_* are companion programs originally written by K1JT to facilitate Earth-Moon-Earth (EME, or "Moonbounce") communication with digital protocols developed for _WSJT_ and _WSJT-X_. When used with @@ -44,8 +35,18 @@ kHz sub-band. _QMAP_ uses a single polarization channel and only the Q65 mode, also covering a 90 kHz sub-band. It works cooperatively with _WSJT-X_ to provide automatic Doppler compensation and other features important for EME, especially on 1296 MHz and higher amateur bands. -These programs are installed automatically along with _WSJT-X_ -(but _MAP65_ only on the Windows platform). +These programs are installed automatically along with _WSJT-X_. + +*Version Numbers* for our programs have major, minor, and patch +numbers separated by periods: for example, _WSJT-X 3.0.0_. Temporary +release candidates are sometimes made in advance of a new +general-availability (GA) release, in order to obtain user +feedback. Release candidates are given version labels such as +3.0.0-rc1, 3.0.0-rc2, etc., leading up to the general availability +(GA) release of version 3.0.0. Release candidates should be used only +during a defined testing period, and they carry an implicit obligation +to provide feedback to the program developers. Release candidates +should not be used on the air after a GA release with the same number. *_Hamlib_* is an independent, open-source software library that provides a consistent Application Programming Interface (API) for diff --git a/doc/user_guide/en/jtty.adoc b/doc/user_guide/en/jtty.adoc new file mode 100644 index 00000000..b351772b --- /dev/null +++ b/doc/user_guide/en/jtty.adoc @@ -0,0 +1,52 @@ +Select *JTTY* from the *Mode* menu and use *File | Open* to select the +sample file +...\save\samples\JTTY\260807_134110.wav+. + +A weak JTTY signal should appear on the waterfall and decode as shown +in the screen shot below. You may need to set or adjust certain +waterfall controls to see the signal clearly. If you're an experienced +RTTY operator, you might also want to listen to this WAV file by +opening it in your favorite media player. This JTTY signal is weak +enough that if it were standard 45.45 baud RTTY instead of JTTY, +decoding would be marginal and error-prone. Decoding from a WAV file +may seem nearly instantaneous, but in live operation you would see the +message accumulating sequentially, as it arrives. + + +image::jtty.png[align="center",alt=JTTY decoding of weak signal] + +To test transmitting, enter a message into the field at bottom right, +click *Send message*, and listen to the JTTY waveform's sound on your +computer's speaker. Remember that unlike other WSJT modes, JTTY does +not use timed T/R sequences. Transmissions can start at any time; +otherwise _WSJT-X_ simply stays in receive or *Monitor* mode. + +.JTTY Frames and Contest Messages + +Each JTTY transmission consists of one or more "`frames`". A frame has +space for up to 5 arbitrary characters, but it can also convey many +more characters by using the defined formats for special contest-style +messages. Function keys F1-F8 (and the on-screen buttons with those +same labels) can be programmed to send messages based on the entry +fields below the buttons. Use the macros %M and %H as stand-ins for +MyCall and HisCall, %E for the contest exchange (currently defined as +"599 nnn", where nnn is the number in the "Serial Number" spinbox), +and %Q for a queued callsign that woould be your next-in-line +contact. For best efficiency, use the exact message forms outlined in +the table below. As explicit examples the table uses K1ABC for MyCall, +W9XYZ for HisCall, W7UVW for a queued callsign, and 107 for Serial +Number. The final table column shows the number of JTTY frames that +required for each example message. + +[source] +---- +F-Key Macro Format Transmitted message Frames +------------------------------------------------------ +F1 CQ %M CQ CQ K1ABC CQ 1 +F2 %H %E W9XYZ 599 107 2 +F3 %H TU CQ %M CQ W9XYZ TU CQ K1ABC CQ 2 +F4 %M K1ABC 1 +F5 %H W9XYZ 1 +F6 TU NOW %Q %E TU NOW W7UVW 599 108 2 +F7 %H AGN? W9XYZ AGN? 1 +F8 %E 599 107 1 +---- diff --git a/doc/user_guide/en/jtty_n1mm_integration.adoc b/doc/user_guide/en/jtty_n1mm_integration.adoc new file mode 100644 index 00000000..ba737220 --- /dev/null +++ b/doc/user_guide/en/jtty_n1mm_integration.adoc @@ -0,0 +1,41 @@ +_WSJT-X_ in JTTY mode will work with N1MM Logger+ in the same way +other RTTY codecs (such as MMTTY) do. Once configured, you can type +"`JTTY`" in the callsign field in N1MM Logger+ to start _WSJT-X_ in JTTY +mode. N1MM Logger+ macros will work, but be sure to optimize the +macros so they will send JTTY's contest-style messages. + +.Setup + +* Set up N1MM Logger+ (version number 1.0.11449 released September 22, 2026 or later) with _WSJT-X_ +as you would for the FT8 mode. Follow the instructions in +https://www.rttycontesting.com/tutorials/n1mm/operating-ww-digi-with-n1mm/[Operating WW Digi with N1MM and WSJT-X]. + +* Make sure your configuration is working in FT8 mode before +attempting to use JTTY, including CAT control and PTT. This requires +configuring N1MM for the +https://www.rttycontesting.com/tutorials/n1mm/operating-ww-digi-with-n1mm/#startingfirsttime[forEW1] +configuration. + +* Enter JTTY mode by typing "`JTTY`" in the callsign field in N1MM +Logger+ and pressing enter. + +* Verify that the _WSJT-X_ window is showing *JTTY* in the footer, and +that the _WSJT-X_ window title shows *forEW1*. + +* Put your radio in test mode, turn the output power to zero, or use a +dummy load. + +* Verify that pressing *F1* in the _WSJT-X_ window, the message "CQ CQ" is being sent by your radio. + +* Verify that pressing *F1* in the N1MM Logger+ window sends the contents +of your F1 macro. + +* Be sure to customize the +https://n1mmwp.hamdocs.com/setup/function-keys/#the-function-key-message-editor[N1MM Digital Function Keys] file for JTTY operation. Here is +an example for the N1MM file `JTTY Messages.mc`: + +[source,bash] +---- +include::../../../lib/jtty/JTTY Messages.mc[] +---- diff --git a/doc/user_guide/en/keyboard_mouse.adoc b/doc/user_guide/en/keyboard_mouse.adoc index 06203f55..27113df4 100644 --- a/doc/user_guide/en/keyboard_mouse.adoc +++ b/doc/user_guide/en/keyboard_mouse.adoc @@ -12,3 +12,19 @@ Select *Special Mouse Commands* from the *Help* menu (or use function key === Special Mouse Commands image::special-mouse-commands.png[align="left",alt="Special Mouse Commands"] +=== GUI Keyboard Navigation + +Use *Tab* and *Shift+Tab* to move forward and backward among controls +in the main window. Use the arrow keys to change the selection within +grouped controls. + +You can control the transmitted-message sequence without leaving the +keyboard. On the Standard Messages page, the six radio buttons in the +*Next* column act as a single Tab stop: Tab reaches the currently +selected message, and the arrow keys choose which of Tx1 through Tx6 +will be sent in the next transmission. Further Tab presses reach the +*Now* buttons, which select the corresponding message and, during a +transmission, switch to it immediately, followed by the editable +message fields. When the vertical *1* / *2* / *3* message-page selector +has focus, use the arrow keys or the keys *1*, *2*, and *3* to select a +page. diff --git a/doc/user_guide/en/make-qso.adoc b/doc/user_guide/en/make-qso.adoc index 8e9a9705..59766c47 100644 --- a/doc/user_guide/en/make-qso.adoc +++ b/doc/user_guide/en/make-qso.adoc @@ -19,10 +19,13 @@ one callsign) followed by the transmitting station’s grid locator, a signal report, R plus a signal report, or the final acknowledgements RRR or 73. These messages are compressed and encoded in a highly efficient and reliable way. In uncompressed form (as displayed -on-screen) they may contain as many as 22 characters. Some operators -prefer to send RR73 rather than RRR. This is workable because RR73 is -encoded as a valid grid locator, one unlikely ever to be occupied by -an amateur station. +on-screen) they may contain as many as 22 characters. + +In 77-bit message formats, some operators prefer to send RR73 rather +than RRR. RR73 is encoded as an explicit final response in these +formats. In legacy 72-bit formats, RR73 matches the four-character +grid-locator form and is encoded as a grid locator, so generated Tx4 +messages use RRR instead. *Signal reports* are specified as signal-to-noise ratio (S/N or SNR) in dB, using a standard reference noise bandwidth of 2500 Hz. Thus, in the @@ -40,10 +43,11 @@ audible (to someone with very good hearing) around –15 dB. NOTE: Several options are available for circumstances where fast QSOs are desirable. Double-click the *Tx1* control under _Now_ or _Next_ to toggle use of the Tx2 message rather than Tx1 to start a QSO. -Similarly, double-click the *Tx4* control to toggle between sending -`RRR` and `RR73` in that message. The `RR73` message should be used -only if you are reasonably confident that no repetitions will be -required. +Similarly, in modes that support RR73, double-click the *Tx4* control +to toggle between sending `RRR` and `RR73` in that message. The +`RR73` message should be used only if you are reasonably confident +that no repetitions will be required. In legacy 72-bit and shorthand +modes, Tx4 uses `RRR` and a dialog explains why RR73 is unavailable. === Free-Text Messages @@ -70,13 +74,22 @@ image::auto-seq.png[align="center",alt="AutoSeq"] When calling CQ you may choose to select *CQ: First* to reply automatically to the first decoded responder, or *CQ: Max Dist* to reply to the most distant responder, or the strongest or weakest -responder. +responder. Automatic caller selection requires *Auto-Seq* and a response +mode other than *CQ: None*. If a CQ or QRZ message is selected, an eligible +direct caller decoded after *Enable Tx* is armed can replace it, including +immediately after the preceding QSO. Arming during reception applies only +to the remainder of that period; earlier decodes and callers from earlier +periods are not retained. NOTE: When *Auto-Seq* is enabled, the program de-activates *Enable Tx* at the end of each QSO. _WSJT-X_ will not make consecutive, fully automated QSOs. Auto-sequencing is an operator aid, not an operator replacement. +NOTE: The current-period caller behavior applies to direct calls to your +station. Answering a general CQ from another station is the separate +*Wait and Pounce* feature described below. + [[WAIT_FEATURES]] === Wait Features @@ -162,8 +175,8 @@ for each event type: W9XYZ K1ABC 73 Either callsign (or both) may have /R appended to signify a Rover in a -VHF contest. You can use RR73 in place of RRR, and the final 73 is -optional. +VHF contest. In 77-bit modes, you can use RR73 in place of RRR, and +the final 73 is optional. *EU VHF Contest* diff --git a/doc/user_guide/en/measurement_tools.adoc b/doc/user_guide/en/measurement_tools.adoc index 77e69c71..c08a5784 100644 --- a/doc/user_guide/en/measurement_tools.adoc +++ b/doc/user_guide/en/measurement_tools.adoc @@ -105,15 +105,21 @@ records. _(Not yet fully implemented.)_ _WSJT-X_ provides a tool that can be used to determine the detailed -shape of your receiver's passband. Tune to a quiet frequency with no -signals or birdies. With _WSJT-X_ running in one of the slow modes and -*Monitor* active, make sure that *Flatten* is checked on the *Wide -Graph* and then select *Measure reference spectrum* from the *Tools* -menu. Wait for about a minute and then click *Stop*. A file named -`refspec.dat` will appear in your log directory and the *Ref Spec* -checkbox on the *Wide Graph* will become available. When you check -*Ref Spec*, the recorded reference spectrum will then be used to -flatten your overall effective passband. +shape of your receiver's passband. Use the same receiver, audio input, +and filter settings you intend to use for receiving. Tune to a quiet +frequency with no signals or birdies. With _WSJT-X_ running in one of +the slow modes and *Monitor* active, make sure that *Flatten* is +checked on the *Wide Graph* and then select *Measure reference +spectrum* from the *Tools* menu. _WSJT-X_ measures for about seven +seconds and shows a countdown in the status bar. Click *Stop* only if +you want to finish the measurement early. A file named `refspec.dat` +will appear in your log directory and the *Ref Spec* checkbox on the +*Wide Graph* will become available. When you check *Ref Spec*, the +recorded reference spectrum will then be used to flatten your overall +effective passband. This correction is applied to new received audio +before spectrum display and decoding, so it affects both the Wide Graph +display and the data passed to decoders. Clearing *Ref Spec* stops +applying the correction to subsequent received audio. Select *Erase reference spectrum* from the *Tools* menu to remove the saved reference spectrum and stop applying its correction to new diff --git a/doc/user_guide/en/modes.adoc b/doc/user_guide/en/modes.adoc index 4dab91af..89735f12 100644 --- a/doc/user_guide/en/modes.adoc +++ b/doc/user_guide/en/modes.adoc @@ -1,6 +1,6 @@ -_WSJT-X_ offers eleven +_WSJT-X_ offers twelve different protocols or modes: *FST4*, *FT4*, *FT8*, *JT4*, *JT9*, -*JT65*, *Q65*, *MSK144*, *WSPR*, *FST4W*, and *Echo*. The first eight +*JT65*, *Q65*, *MSK144*, *JTTY*, *WSPR*, *FST4W*, and *Echo*. The first eight are designed for making reliable QSOs under weak-signal conditions. They use nearly identical message structure and source encoding. JT65 was designed for EME ("`moonbounce`") on VHF and @@ -38,11 +38,18 @@ structured messages as the slow modes and optionally an abbreviated format with hashed callsigns. Note that some of the modes classified as slow can have T/R sequence -lengths as short the fast modes. "`Slow`" in this sense implies +lengths as short as the fast modes. "`Slow`" in this sense implies message frames being sent only once per transmission. The fast modes in _WSJT-X_ send their message frames repeatedly, as many times as will fit into the Tx sequence length. +*JTTY* is designed for fast radio contest exchanges and other +keyboard-to-keyboard communication. Its operational feel is similar to +standard RTTY, but it has much better weak-signal performance and far +lower error rate. JTTY transmissions are not timed or synchronized +with UTC; they can start at any time and have any duration, but +typically last for a few seconds. + *WSPR* (pronounced "`whisper`") stands for **W**eak **S**ignal **P**ropagation **R**eporter. The WSPR protocol was designed for probing potential propagation paths using low-power transmissions. diff --git a/doc/user_guide/en/new_features.adoc b/doc/user_guide/en/new_features.adoc index 6a8f34cc..432e009d 100644 --- a/doc/user_guide/en/new_features.adoc +++ b/doc/user_guide/en/new_features.adoc @@ -1,100 +1,79 @@ [[NEW_FEATURES]] -//=== New in Version {VERSION_MAJOR}.{VERSION_MINOR} - -=== New in Version 3.0 - -_WSJT-X 3.0_ incorporates all developments successfully tested in -experimental versions and a number of new items. The list below -summarizes important new features. For more details you should -carefully read the sections in this guide linked in the following notes. - -- *Band Buttons* can be enabled and displayed from the *View* -menu. Two sets of buttons are available: an HF-oriented set for 160 m -through 70 cm bands, and a VHF-and-up set for 8 m through 24 GHz. See -the <> section for more details. - -- *FT8 Decoding* includes an option for <> with up to a dozen concurrent threads, yielding improved -performance. - -- *Filters* can be used to suppress display of certain categories of -decodes. For example, you can hide, ignore, or highlight stations -worked before on the current band, or worked today or -yesterday. Categories are defined on the *File | Settings | Filters* -<>, and options to turn categories on or off are found on -the <> menu. - -- *Wait and Reply*, *Wait and Call*, and *Wait and Pounce* are options -to help you make QSOs under difficult propagation conditions while -minimizing useless transmissions. See <> -for details. - -- *Audible Alerts* can play an audio sound to alert you to reception of -a message with specified content. Activating this feature requires -access to at least two audio output devices. See <> -for details. - -- *Auto-Sequencing*, *Filters*, *Reply-to-CQ*, and *Wait* features are -now available for all _WSJT-X_ QSO modes: the 72-bit modes JT4, JT9, -and JT65, as well as the 77-bit modes FST4, FT4, FT8, MSK144, and -Q65. - -- *Full Duplex Mode* allows _WSJT-X_ to transmit and receive at the -same time. This feature can be useful for satellite operation, where -the audio source is normally set to the transponder downlink, and for -monitoring your own transmitted signal by using a webSDR as the audio -input source. - -- *Transceiver Control Interface (TCI)*, a software layer allowing control, -data transfer, and synchronization between a wide variety of hardware -devices and software applications, is supported by _WSJT-X_ for -both rig control and audio input/output. - -- *SuperHound* operators can activate *Wait and Call* for a *SuperFox* -callsign, even if SuperFox has not yet been decoded. However, blind -calling of SuperFox is prevented. Fox operators receive a warning -message if another Fox appears to be on the same frequency, and -_WSJT-X_ will prevent inadvertent Fox transmissions from falling -within a conventional WSPR sub-band. - -- *Transmitted Power and SWR* can be displayed (as reported by the -radio) in a Status Bar label. Transmission can be stopped -automatically if SWR exceeds 2.5 -- for example, if you accidentally -select the wrong antenna. These features work with most modern radios -controlled via _Hamlib_ or _FLRig_. - -- *Right-click of Tune Button* can be used to initiate ATU tuning in -some rig models. This feature requires the radio to be equipped with -an internal ATU and controlled via _Hamlib_. - -- *Band Hopping* checkboxes for FT8, FT4 and MSK144 can activate -sequential reception intervals on the main sub-bands, or on up to eight -specified dial frequencies. The latter can be useful for contests and -other situations with frequencies of special interest. - -- *Saved Audio Files* can be scheduled for automatic deletion after 30 -days. This feature can be used to keep disk usage for saved files -within reasonable limits, while still preserving important information -that might prove useful for later analysis. - -- *CALL3.TXT files* for either terrestrial or EME use can be -downloaded by clicking a button on the *File | Settings | Colors* -tab. - -- *New EME Features* include easier ways to select dial frequencies -within an EME sub-band and to offset your Tx frequency by an integer -number of MHz from the Rx frequency, to accommodate different regulatory -frequency allocations. New buttons are provided for quick access to -Echo mode and six popular Q65 sub-modes. For experimental purposes, -the sub-modes 15A, 15B and 15C can be decoded with EME delay. - -- *QSO Logging* supports the ADIF field type for satellite QSOs, and -*the Log automatically* option is available when not in contest -mode. New checkboxes on the *File | Settings | Reporting* tab provide -new support for certain contests. - -- *OpenSSL* runtime DLLs are now installed automatically with _WSJT-X_ -on Windows. - -- *High Resolution Monitors* are supported with better scaling of -fonts and widget sizes. +=== New in Version {VERSION_MAJOR}.{VERSION_MINOR} + +- *JTTY* is an entirely new digital mode designed for fast RTTY-like +contest exchanges and other keyboard-to-keyboard communication. Its +operational feel is similar to standard RTTY, but it has much better +weak-signal performance and far lower error rate. JTTY transmissions +can start at any time and typically last a few seconds. Error-free +throughput is about 30 words per minute for arbitrary text and 60 WPM +for the short, fixed-format messages generally used in RTTY-style +contesting. + +- *_MAP65_* adds support for 192 kHz sample rate and a new JT65 *Full +Deep Search* mode. JT65 false decodes are substantially reduced, and +Q65 decoding sensitivity significantly improved for both single and +dual polarization signals. A number of smaller improvements and bug +fixes are present. We note that the +https://wsjt.sourceforge.io/MAP65_Users_Guide.pdf[_MAP65_ User's +Guide] is out-of-date, but still useful. This document is being +thoroughly revised, and we hope to make a new version available soon. + +- *_QMAP_* now displays decoded callsigns superimposed on its +waterfall. An optional vertical waterfall displays callsigns to its +right, without obscuring the signal traces. Clicking a callsign in +either waterfall sets up (and double-clicking starts) a QSO with that +station, with the QSO subsequently conducted in a co-running copy of +_WSJT-X_. A new *Stop* button ends a *Shift+F6* file sequence, as in +_WSJT-X_ and _MAP65_. See <> in this guide for more +details. + +- *Q65 Pileup Mode:* a previously unused message bit now indicates +whether the station being called was copied in the previous Rx +interval. Decodes with this bit set are flagged with "#" in the +decoded text window and in the Active Stations window. Everything +needed is exchanged over the air; no internet connection is required. + +- *Raspberry Pi* and other ARM-based computers: pre-built 32-bit +(armhf) as well as 64-bit (aarch64) packages are available. Projects +such as DigiPi, which runs _WSJT-X_ on the Pi Zero 2 W, can install +the current release without building from source. + +- *Decoded text panes* now keep their scroll position while you review +earlier decodes. New decodes will continue to accumulate below, and +the pane returns to live output when you scroll back to the end. + +- *Highlight orange* and *Highlight blue* prefix lists now accept +wildcards (*) and exclusions (!). + +- *TX Inhibit* for multi-op contesting: with a UDP connection, an +external controller can block _WSJT-X_ from transmitting when another +transmitter is active on the same band. + +- *WSPR* and *FST4W* now upload spots to `wsprnet.eu` as a backup. +Queued spots are preserved across retries when WSPRnet is slow or +unavailable. + +- *CloudLog* and *Wavelog* integration has been improved, and *eQSL* +uploads now use a secure protocol to protect your login credentials. + +- *Band Activity* shows `U.S.A.` and the correct state for a K-family +callsign operating portable from a different state, instead of the +DXCC entity of the callsign's home area. + +- *Settings* dialogs are more accessible, and keyboard navigation and +focus handling are improved. Dialogs are laid out responsively rather +than clipping controls on constrained window sizes or large +accessibility fonts. Decode panes and the startup splash screen are +properly named for use with assistive technology. + +- *German*, *Polish*, and *Ukrainian* translations of the user +interface have been added, and the *Spanish* translation updated. + +- *Copyright notice* and *Trademark policy* selections have been added +to the *Help* menus for _WSJT-X_, _MAP65_, and _QMAP_, and new icons +are used for all three programs. + +- *Many* other smaller improvements and bug fixes. See the +https://wsjtx.github.io/wsjtx/Release_Notes.txt[Release Notes] for +details. diff --git a/doc/user_guide/en/protocols.adoc b/doc/user_guide/en/protocols.adoc index 4203cdbc..67d473f2 100644 --- a/doc/user_guide/en/protocols.adoc +++ b/doc/user_guide/en/protocols.adoc @@ -338,7 +338,7 @@ comparable to tone spacing. |=== [[FAST_MODES]] -=== Fast Modes +=== Fast Modes and JTTY ==== JT9 @@ -387,6 +387,13 @@ adjusted to provide the flattest possible response over the range 300Hz to 2700Hz. The maximum permissible frequency offset between you and your QSO partner ± 200 Hz. +[[JTTYPRO]] +==== JTTY + +As an untimed mode, in the present context JTTY is neither a "`Fast`" +nor a "`Slow`" mode. Somewhat arbitrarily, then, we summarize +parameters of its protocol here. (... more to be added ...) + ==== Summary .Parameters of Fast Modes @@ -399,5 +406,6 @@ and your QSO partner ± 200 Hz. |JT9G |K=32, r=1/2|(206,72)| 8| 9-FSK|100.0 | 900 | 0.19| 0.850 |JT9H |K=32, r=1/2|(206,72)| 8| 9-FSK|200.0 | 1800 | 0.19| 0.425 |MSK144 |LDPC |(128,90)| 2| OQPSK| 2000 | 2400 | 0.11| 0.072 -|MSK144 Sh|LDPC |(32,16) | 2| OQPSK| 2000 | 2400 | 0.20| 0.020 +|MSK144 Sh|LDPC |(32,16) | 2| OQPSK| 2000 | 2400 | 0.20| 0.020 +|JTTY |K=10, r=1/2|(92,46) | 4|4-GFSK| 31.25| 125 | 0.22| 1.888 |=== diff --git a/doc/user_guide/en/qmap.adoc b/doc/user_guide/en/qmap.adoc new file mode 100644 index 00000000..6890f3a5 --- /dev/null +++ b/doc/user_guide/en/qmap.adoc @@ -0,0 +1,70 @@ +*_QMAP_* is a companion program installed automatically alongside +_WSJT-X_ and running cooperatively with it to provide wideband, +single-polarization reception of Q65 signals. While _WSJT-X_ decodes a +passband up to 5 kHz wide and a single specified T/R sequence length, +_QMAP_ monitors an entire 90 kHz sub-band and automatically decodes +both 30 s and 60 s sequences. The combination makes a very convenient +setup for EME, especially on the UHF and microwave bands. You can see +and decode all the EME activity in the sub-band while conducting your +own QSOs with _WSJT-X_. + +To gain some familiarity with _QMAP_, start the program and open its +*Vertical Waterfall* from the *View* menu. Resize and position the +windows for convenience, perhaps as in the screen shot below. Set +*Span* to 90 kHz on the *Horizontal Waterfall*. Then use *File | Open* +to select the sample file +...\save\samples\QMAP\241019_0403.qm+. + +_QMAP_ decodes the file's full 90 kHz sub-band and for each signal +displays the *UTC* time, received frequency *Frx*, and suggested +calling frequency *Fsked*, time offset *DT*, SNR *dB*, submode +*Q65-x*, and decoded message. Transmissions in a 30 s submode are +highlighted in yellow. Callsigns of transmitting stations are +displayed on the waterfall windows, close to the received frequencies. + +image::qmap_all.png[align="center",alt="QMAP main window"] + +If _WSJT-X_ is also active and in Q65 mode, information from _QMAP_ +decodes will appear in the _WSJT-X_ *Active Stations* window sorted +by received frequency: + +image::active_stations_QMAP.png[align="center",width=50%,alt="Active Stations"] + +Click a callsign on either of _QMAP_'s waterfalls, or in the *Active +Stations* window, to set up a QSO with that station in _WSJT-X_. +_WSJT-X_ will generate the appropriate messages and set the dial +frequency to that station's suggested calling frequency, +*Fsked*. Double-clicking will also activate *Enable Tx* so you can +call the station right away. + +The symbol *#* at the right edge of *Active Stations* marks a callsign +decoded by _QMAP_ that is not yet present in `wsjtx.log`. This feature +is a convenience for tracking EME initials or contest QSOs. An +asterisk +*+ marks a station whose most recent transmission contains +`CQ`, `RR73`, or `73`, so the sender is presumably ready to start +another QSO. Use the *Wanted only* and *CQ only* checkboxes and *Max +Age* spinner to narrow the list of stations as desired. With focus on +the _WSJT-X_ main window you can press *Alt+A* to clear *Active +Stations* and start over. + +//// +Ideas that might be used later, elsewhere: +For live operation, you should first set *Doppler tracking* on the +*Astronomical Data* window and select *Constant frequency on Moon* for +on the, so this frequency continues to track the Moon correctly for +the rest of the QSO. + +TIP: _QMAP_ can also record what it receives, for later review: select +*Save | Save decoded* or *Save | Save all* on its main window. Saved +files -- compact `*.qm` files, like the one you just opened, or raw +`*.iq` data -- go to the *Save Directory* set on the *Station* tab. +*File | Open next in directory* (*Shift+F6*) steps through every saved +file in a directory in turn, as if you were receiving them live. + +For live reception, _QMAP_ needs a wideband SDR front end, normally +provided by _Linrad_ (by SM5BSZ), and some initial setup on the *File +| Settings...* dialog -- entering *My Call* and *My Grid*, and +correcting for any frequency offset in your receiving chain with the +*Fcal (Hz)* and *Fadd (MHz)* fields. That hardware setup is beyond +this tutorial; instead, try _QMAP_ here with a saved file, the same +way you've already done for other modes. +//// diff --git a/doc/user_guide/en/settings-colors.adoc b/doc/user_guide/en/settings-colors.adoc index 684a82b5..8e795647 100644 --- a/doc/user_guide/en/settings-colors.adoc +++ b/doc/user_guide/en/settings-colors.adoc @@ -57,8 +57,13 @@ image::highlighting.png[align="center",alt="Decode Highlighting"] It is still possible for you to customize the color scheme according to your own preferences. In addition, you can highlight individual -callsigns or grids according to your specifications. Callsigns and/or -grids can be highlighted with orange or blue background -color. Callsigns/grids must be separated by commas and can be mixed -(e.g. "K1JT, DG2YCB, JO33, JN58,"). You must include a comma after +callsigns, grids, prefixes, or directional CQ calls such as DX, POTA, +and SOTA with an orange or blue background. Callsigns, grids, and +directional calls are separated by commas and can be mixed (e.g. +"K1JT, DG2YCB, JO33, DX, POTA, SOTA,"). Spaces after commas are +allowed. Directional calls are matched as whole list items, so list +order has no effect and no leading comma is needed. A single +directional call does not need a comma. You must include a comma after each callsign or grid, and also at the end of the line. +Prefixes must be followed by a semicolon (e.g. "VK;ZL;T88;"). The +Wanted audible alert uses the same orange and blue entries. diff --git a/doc/user_guide/en/settings-radio.adoc b/doc/user_guide/en/settings-radio.adoc index b4dc6640..084cdb3c 100644 --- a/doc/user_guide/en/settings-radio.adoc +++ b/doc/user_guide/en/settings-radio.adoc @@ -65,6 +65,31 @@ NOTE: CAT interfaces that require handshaking will be non-responsive + +With *DTR* or *RTS* PTT, an external controller can hold off PTT and rig +Tune while _WSJT-X_ continues its transmit sequence and audio. Enable +*Accept UDP requests* on the *Reporting* tab to accept these TX Inhibit +commands. While enabled, _WSJT-X_ periodically advertises TX Inhibit +availability on the configured UDP reporting stream. Transmission resumes +when all holds clear, provided the transmit sequence is still active. + ++ + +Configure UDP reporting on the *Reporting* tab so the controller can +receive _WSJT-X_ messages and send hold commands to the sending instance. +Multicast reporting allows several companion applications to receive the +messages. With unicast reporting, the controller must be the configured +receiver or receive the messages through a relay. + ++ + +Each controller refreshes its hold while needed, then releases it. Holds +also expire if refreshes stop. With multiple controllers, PTT remains +off until every hold has cleared. Turning off *Accept UDP requests* +withdraws TX Inhibit availability and stops accepting commands; existing +holds remain until they expire. + ++ + NOTE: When using a proxy application for rig control, *CAT* is usually the correct option for _PTT Method_ assuming the proxy application is capable of keying your transceiver independently. diff --git a/doc/user_guide/en/support.adoc b/doc/user_guide/en/support.adoc index 9bde8ee6..32ed31d1 100644 --- a/doc/user_guide/en/support.adoc +++ b/doc/user_guide/en/support.adoc @@ -1,11 +1,11 @@ === Help with Setup -The best source of help in setting up your station or configuring or -using _WSJT-X_ will be one of these email lists: {wsjtx_group}, -{wsjt_group}, or {wsjt-devel}. The chances are good that someone with -similar interests and equipment has already solved your problem and -will be happy to help. To post messages in any of these forums you -will need to join the group. +The best source of help in setting up your station or configuring +_WSJT-X_ will be one of these email lists: {wsjt-devel} or +{wsjtx_group}. The chances are good that someone with similar +interests and equipment has already solved your problem and will be +happy to help. To post messages in any of these forums you will need +to join the group. === Bug Reports @@ -27,6 +27,6 @@ information: Suggestions from users often result in new program features. Good ideas are always welcome: if there's a feature you would like to see in _WSJT-X_, spell it out in as much detail as seems useful and send -it to us at the public {devrepo} site or one of the email addresses -given above. Be sure to explain why you think the feature is -desirable, and what sort of other users might find it so. +it to us at one of the email addresses given a few lines above. Be +sure to explain why you think the feature is desirable, and what sort +of other users might find it so. diff --git a/doc/user_guide/en/system-requirements.adoc b/doc/user_guide/en/system-requirements.adoc index 20ba0000..66db4d37 100644 --- a/doc/user_guide/en/system-requirements.adoc +++ b/doc/user_guide/en/system-requirements.adoc @@ -1,7 +1,7 @@ // Status=review - SSB transceiver and antenna -- Computer running Windows 7 or later, macOS 10.15 or later, or Linux +- Computer running Windows 10 or later, macOS 13 or later, or Linux - 1.5 GHz or faster CPU and 200 MB of available memory; faster machines are better - Monitor with at least 1024 x 780 resolution diff --git a/doc/user_guide/en/vhf-features.adoc b/doc/user_guide/en/vhf-features.adoc index 24c70be5..6fe089c8 100644 --- a/doc/user_guide/en/vhf-features.adoc +++ b/doc/user_guide/en/vhf-features.adoc @@ -33,8 +33,13 @@ features*. delay on received lunar echoes. - If you will use automatic Doppler tracking and your radio accepts -frequency-setting commands while transmitting, check *Allow Tx -frequency changes while transmitting*. Transceivers known to permit +frequency-setting commands while transmitting, check *Allow +Tx-frequency corrections while transmitting*. This option permits +automatic Doppler, split/Fake It/XIT, and other Tx-frequency corrections +while the radio is keyed. Microwave EME Doppler corrections can be tens +of kHz, so WSJT-X does not limit these corrections by size. The option +never permits a nominal dial or band change while transmitting or tuning. +Transceivers known to permit such changes include the IC-735, IC-756 Pro II, IC-910-H, IC-9700, FT-847, TS-590S, TS-590SG, TS-2000 (with Rev 9 or later firmware upgrade), Flex 1500 and 5000, HPSDR, Anan-10, Anan-100, and KX3. To @@ -500,4 +505,4 @@ selected. image::shift2.png[align="center",alt="Split Settings"] TIP: To avoid the dial frequency indicator turning red, you may want -to add both transmit and receive frequencies to the Frequencies Table. \ No newline at end of file +to add both transmit and receive frequencies to the Frequencies Table. diff --git a/doc/user_guide/en/wsjtx-main.adoc b/doc/user_guide/en/wsjtx-main.adoc index 0e54555b..53bae3c6 100644 --- a/doc/user_guide/en/wsjtx-main.adoc +++ b/doc/user_guide/en/wsjtx-main.adoc @@ -1,6 +1,6 @@ // This is a comment line, anything with // is ignored at process time. = _WSJT-X_ User Guide -Copyright 2026 by Joe Taylor, K1JT +Copyright 2001-2026 by the WSJT Development Team. :revnumber: {VERSION} // For web-pages, adding :badges: is ok, but is a security issue for // package building .deb, .rpm, etc as it exposes the IP address and the images @@ -10,10 +10,15 @@ Copyright 2026 by Joe Taylor, K1JT :imagesdir: {docdir}/images :icons: font :numbered: -:keywords: amateur radio weak signal communication K1JT WSJT FT8 Q65 MSK!44 JT65 +:keywords: amateur radio weak signal communication K1JT WSJT JT65 JT9 :description: Software for Amateur Radio Weak-Signal Communication :prog: WSJT-X +[.copyright] +_You may use and distribute unmodified copies of this document, +including this copyright notice. You may not publish or distribute +any portion of it without our express written consent._ + // use global link file include::../../common/links.adoc[] @@ -61,11 +66,8 @@ include::install-linux.adoc[] === MacOS include::install-mac.adoc[] -//// [[SRC_CODE]] -=== Source Code -include::install-from-source.adoc[] -//// +include::install-from-source.adoc[leveloffset=+2] [[MENUS]] == Menus @@ -160,6 +162,18 @@ include::tutorial-example5.adoc[] === FST4W include::tutorial-example6.adoc[] +[[JTTY]] +=== JTTY +include::jtty.adoc[] + +[[JTTY_N1MM]] +=== JTTY and N1MM Logger+ +include::jtty_n1mm_integration.adoc[] + +[[QMAP]] +=== QMAP +include::qmap.adoc[] + [[MAKE_QSOS]] == Making QSOs include::make-qso.adoc[] diff --git a/entitlements.plist b/entitlements.plist index 2449f8c0..f7538bf7 100644 --- a/entitlements.plist +++ b/entitlements.plist @@ -3,54 +3,19 @@ com.apple.security.cs.disable-library-validation com.apple.security.device.audio-input - - com.apple.security.cs.allow-unsigned-executable-memory - diff --git a/example_log_configurations/wsjtx_log_config.ini.rig_control b/example_log_configurations/wsjtx_log_config.ini.rig_control index bcf981b3..dea735f9 100644 --- a/example_log_configurations/wsjtx_log_config.ini.rig_control +++ b/example_log_configurations/wsjtx_log_config.ini.rig_control @@ -13,7 +13,7 @@ MaxFiles=12 Target="${AppLocalDataLocation}/logs" ScanForFiles="Matching" Format="[%Channel%][%TimeStamp(format=\"%Y-%m-%d %H:%M:%S.%f\")%][%Uptime(format=\"%O:%M:%S.%f\")%][%Severity%] %Message%" -Filter="%Severity% >= info" +Filter="%Channel% matches \"SYSLOG\" & %Severity% >= info" [Sinks.RIGCTRL] Destination=TextFile @@ -22,4 +22,4 @@ AutoFlush=true FileName="${DesktopLocation}/WSJT-X_RigControl.log" Append=true Format="[%TimeStamp(format=\"%Y-%m-%d %H:%M:%S.%f\")%][%Uptime(format=\"%O:%M:%S.%f\")%][%Channel%:%Severity%] %Message%" -Filter="%Channel% matches \"RIGCTRL\" | %Severity% >= info" +Filter="%Channel% matches \"RIGCTRL\" & %Severity% >= info" diff --git a/icons/Darwin/wsjtx.iconset/icon_128x128.png b/icons/Darwin/wsjtx.iconset/icon_128x128.png index 9387de43..866213a6 100644 Binary files a/icons/Darwin/wsjtx.iconset/icon_128x128.png and b/icons/Darwin/wsjtx.iconset/icon_128x128.png differ diff --git a/icons/Darwin/wsjtx.iconset/icon_128x128@2x.png b/icons/Darwin/wsjtx.iconset/icon_128x128@2x.png index 6b0df8fb..f3a84109 100644 Binary files a/icons/Darwin/wsjtx.iconset/icon_128x128@2x.png and b/icons/Darwin/wsjtx.iconset/icon_128x128@2x.png differ diff --git a/icons/Darwin/wsjtx.iconset/icon_16x16.png b/icons/Darwin/wsjtx.iconset/icon_16x16.png index ecc5868e..4ec6a003 100644 Binary files a/icons/Darwin/wsjtx.iconset/icon_16x16.png and b/icons/Darwin/wsjtx.iconset/icon_16x16.png differ diff --git a/icons/Darwin/wsjtx.iconset/icon_16x16@2x.png b/icons/Darwin/wsjtx.iconset/icon_16x16@2x.png index 9a8ee28d..cdd3ab66 100644 Binary files a/icons/Darwin/wsjtx.iconset/icon_16x16@2x.png and b/icons/Darwin/wsjtx.iconset/icon_16x16@2x.png differ diff --git a/icons/Darwin/wsjtx.iconset/icon_256x256.png b/icons/Darwin/wsjtx.iconset/icon_256x256.png index 6b0df8fb..f3a84109 100644 Binary files a/icons/Darwin/wsjtx.iconset/icon_256x256.png and b/icons/Darwin/wsjtx.iconset/icon_256x256.png differ diff --git a/icons/Darwin/wsjtx.iconset/icon_256x256@2x.png b/icons/Darwin/wsjtx.iconset/icon_256x256@2x.png index f30a99d2..3011434b 100644 Binary files a/icons/Darwin/wsjtx.iconset/icon_256x256@2x.png and b/icons/Darwin/wsjtx.iconset/icon_256x256@2x.png differ diff --git a/icons/Darwin/wsjtx.iconset/icon_32x32.png b/icons/Darwin/wsjtx.iconset/icon_32x32.png index 9a8ee28d..cdd3ab66 100644 Binary files a/icons/Darwin/wsjtx.iconset/icon_32x32.png and b/icons/Darwin/wsjtx.iconset/icon_32x32.png differ diff --git a/icons/Darwin/wsjtx.iconset/icon_32x32@2x.png b/icons/Darwin/wsjtx.iconset/icon_32x32@2x.png index 88b285ee..391ad4b4 100644 Binary files a/icons/Darwin/wsjtx.iconset/icon_32x32@2x.png and b/icons/Darwin/wsjtx.iconset/icon_32x32@2x.png differ diff --git a/icons/Darwin/wsjtx.iconset/icon_512x512.png b/icons/Darwin/wsjtx.iconset/icon_512x512.png index f30a99d2..3011434b 100644 Binary files a/icons/Darwin/wsjtx.iconset/icon_512x512.png and b/icons/Darwin/wsjtx.iconset/icon_512x512.png differ diff --git a/icons/Darwin/wsjtx.iconset/icon_512x512@2x.png b/icons/Darwin/wsjtx.iconset/icon_512x512@2x.png index b0b4be5d..939e6883 100644 Binary files a/icons/Darwin/wsjtx.iconset/icon_512x512@2x.png and b/icons/Darwin/wsjtx.iconset/icon_512x512@2x.png differ diff --git a/icons/Unix/wsjtx_icon.png b/icons/Unix/wsjtx_icon.png index 9387de43..866213a6 100644 Binary files a/icons/Unix/wsjtx_icon.png and b/icons/Unix/wsjtx_icon.png differ diff --git a/icons/windows-icons/wsjtx.ico b/icons/windows-icons/wsjtx.ico index 142232ec..070b086b 100644 Binary files a/icons/windows-icons/wsjtx.ico and b/icons/windows-icons/wsjtx.ico differ diff --git a/item_delegates/FrequencyDelegate.cpp b/item_delegates/FrequencyDelegate.cpp index b899c056..25a3cdcd 100644 --- a/item_delegates/FrequencyDelegate.cpp +++ b/item_delegates/FrequencyDelegate.cpp @@ -22,6 +22,10 @@ void FrequencyDelegate::setEditorData (QWidget * editor, QModelIndex const& inde void FrequencyDelegate::setModelData (QWidget * editor, QAbstractItemModel * model, QModelIndex const& index) const { - model->setData (index, static_cast (editor)->frequency (), Qt::EditRole); + bool ok; + auto const frequency = static_cast (editor)->frequency (&ok); + if (ok) + { + model->setData (index, frequency, Qt::EditRole); + } } - diff --git a/item_delegates/FrequencyDeltaDelegate.cpp b/item_delegates/FrequencyDeltaDelegate.cpp index 40d90dc5..345675ae 100644 --- a/item_delegates/FrequencyDeltaDelegate.cpp +++ b/item_delegates/FrequencyDeltaDelegate.cpp @@ -22,5 +22,10 @@ void FrequencyDeltaDelegate::setEditorData (QWidget * editor, QModelIndex const& void FrequencyDeltaDelegate::setModelData (QWidget * editor, QAbstractItemModel * model, QModelIndex const& index) const { - model->setData (index, static_cast (editor)->frequency_delta (), Qt::EditRole); + bool ok; + auto const frequency_delta = static_cast (editor)->frequency_delta (&ok); + if (ok) + { + model->setData (index, frequency_delta, Qt::EditRole); + } } diff --git a/item_delegates/item_delegates.pri b/item_delegates/item_delegates.pri deleted file mode 100644 index 819cb2e0..00000000 --- a/item_delegates/item_delegates.pri +++ /dev/null @@ -1,13 +0,0 @@ -SOURCES += \ - item_delegates/ForeignKeyDelegate.cpp \ - item_delegates/FrequencyDelegate.cpp \ - item_delegates/FrequencyDeltaDelegate.cpp \ - item_delegates/CallsignDelegate.cpp \ - item_delegates/MaidenheadLocatorItemDelegate.cpp - -HEADERS += \ - item_delegates/ForeignKeyDelegate.hpp \ - item_delegates/FrequencyDelegate.hpp \ - item_delegates/FrequencyDeltaDelegate.hpp \ - item_delegates/CallsignDelegate.hpp \ - item_delegates/MaidenheadLocatorDelegate.hpp diff --git a/lib/77bit/77bit.txt b/lib/77bit/77bit.txt index ae8f3dd3..1ff7c117 100644 --- a/lib/77bit/77bit.txt +++ b/lib/77bit/77bit.txt @@ -11,26 +11,21 @@ i3.n3 Example message Bits Total Purpose ---------------------------------------------------------------------------------- 0.0 FREE TEXT MSG 71 71 Free text 0.1 K1ABC RR73; W9XYZ -12 28 28 10 5 71 DXpedition Mode -0.2 ... tbd +0.2 (reserved) 0.3 WA9XYZ KA1ABC R 16A EMA 28 28 1 4 3 7 71 ARRL Field Day 0.4 WA9XYZ KA1ABC R 32A EMA 28 28 1 4 3 7 71 ARRL Field Day 0.5 123456789ABCDEF012 71 71 Telemetry (18 hex) -0.6 Temporarily hijacked in packjt77 for WSPR-LF. This is not necessary! -0.7 ... tbd +0.6 K1ABC FN42 37 WSPR-LF (?) +0.7 (reserved) 1 WA9XYZ/R KA1ABC/R R FN42 28 1 28 1 1 15 74 Standard msg 2 PA3XYZ/P GM4ABC/P R JO22 28 1 28 1 1 15 74 EU VHF contest 3 TU; W9XYZ K1ABC R 579 MA 1 28 28 1 3 13 74 ARRL RTTY Roundup 4 PJ4/KA1ABC RR73 12 58 1 2 1 74 Nonstandard calls 5 R 570007 JO22DB 12 22 1 3 11 25 74 EU VHF Contest -6 ... tbd -7 ... tbd +6 (reserved) +7 (reserved) ---------------------------------------------------------------------------------- -NB: three 74-bit message types and two 71-bit message subtypes are still TBD. ----------------------------------------------------------------------------------- - -The 28-bit fields normally used for callsigns are configured rather -differently from before. Facts about the 28-bit integers used to encode standard callsigns: 2^28 = 268,435,456 Available values @@ -47,17 +42,11 @@ Further details on message types: i3.n3 ----------------------------------------------------------------------------- 0.0 Free text, up to 13 characters. - 0.1 DXpedition mode, as developed for KH1/KH7Z. - -0.2 Report, QSO serial number from 0001 to 4095, 6-character grid, and Roger - for EU VHF contests. - 0.3 ARRL Field Day exchange (1-16 transmitters). - 0.4 ARRL Field Day exchange (17-32 transmitters). - 0.5 Telemetry, 71 bits +0.6 WSPR-style 1. Two callsigns, Roger, and grid or report. Each callsign may have an appended "/R" to indicate Rover status for NA VHF contests. @@ -70,15 +59,12 @@ i3.n3 beginning to finish a previous QSO; then two standard callsigns, optional "R", a 3-bit report (529 to 599), and 13 bits to indicate US state, Canadian province/territory, or DX serial number from - 0001 to 7999. + 0001 to 7999. (*** Obsolete: RTTY Roundup now allows only standard + Baudot RTTY ***) 4. One hashed call or "CQ"; one compound or nonstandard call with up to 11 characters; and (if not "CQ") an optional RRR, RR73, or 73. ---------------------------------------------------------------------------- -The following are tentative and not included in first release. - -5. CQ WW RTTY - US/Can: RST CQZ state/prov R 579 5 NJ R1 r3 z6 u7 - DX: RST + CQzone R 559 15 R1 r3 z6 - -6. CQ WPX RTTY - RST + serial R 589 0013 R1 r3 n12 +5. Two hashed callsigns (one 12-bit and one 22-bit), optional "R", 3-bit + report (52 to 59), 4-digit serial number (0001 - 2047), 6-character + grid locator. For EU VHF contest. diff --git a/lib/77bit/encode77.f90 b/lib/77bit/encode77.f90 index 99af70cd..f3d64b93 100644 --- a/lib/77bit/encode77.f90 +++ b/lib/77bit/encode77.f90 @@ -1,31 +1,41 @@ program encode77 use packjt77 - + + implicit none + character*80 msg0 - character msg*37,cerr*1 + character msg*37 character*77 c77 character*80 infile character*13 w(19) + character*40 status_text + character*5 type_text integer nw(19) logical unpk77_success + integer nargs,iz,iline,i3,n3,nwords,j2,pack_status + integer nencoded,nrejected,nunpack_failed,ndifferent nargs=iargc() if(nargs.ne.1 .and.nargs.ne.2) then print*,'Usage: encode77 "message"' print*,' encode77 -f ' - go to 999 + stop 2 endif call getarg(1,msg0) - call fmtmsg(msg0,iz) if(nargs.eq.2) then call getarg(2,infile) open(10,file=infile,status='old') write(*,1000) -1000 format('i3.n3 Err Message to be encoded Decoded message' & - /80('-')) +1000 format('Type Result Message to be encoded Decoded message or reason' & + /96('-')) endif - + + nencoded=0 + nrejected=0 + nunpack_failed=0 + ndifferent=0 + do iline=1,999 if(nargs.eq.2) read(10,1002,end=999) msg0 1002 format(a80) @@ -34,27 +44,80 @@ program encode77 if(msg0(2:2).eq.'.' .or. msg0(3:3).eq.'.') cycle if(msg0(1:3).eq.'---') cycle msg0=adjustl(msg0) - i3=-1 - n3=-1 - call pack77(msg0(1:37),i3,n3,c77) - call unpack77(c77,1,msg,unpk77_success) - cerr=' ' - if(msg.ne.msg0(1:37)) cerr='*' - if(i3.eq.0 .and.n3.ne.6) write(*,1004) i3,n3,cerr,msg0(1:37),msg -1004 format(i2,'.',i1,4x,a1,1x,a37,1x,a37) + call fmtmsg(msg0,iz) + call pack77(msg0(1:37),i3,n3,c77,status=pack_status) + if(pack_status.ne.PACK77_STATUS_ENCODED) then + nrejected=nrejected+1 + status_text=pack77_status_text(pack_status) + write(*,1004) '--','REJECTED',msg0(1:37),trim(status_text) + if(nargs.eq.1) stop 1 + cycle + endif + + nencoded=nencoded+1 + call unpack77(c77,0,msg,unpk77_success) + if(.not.unpk77_success) then + nunpack_failed=nunpack_failed+1 + write(*,1004) '--','UNPACK FAIL',msg0(1:37),'--' + if(nargs.eq.1) stop 1 + cycle + endif + + type_text=' ' if(i3.eq.0 .and.n3.eq.6) then call split77(msg,nwords,nw,w) j2=0 if(nwords.eq.2 .and. len(trim(w(2))).le.2) j2=1 if(nwords.eq.2 .and. len(trim(w(2))).eq.6) j2=2 - write(*,1005) i3,n3,j2,cerr,msg0(1:37),msg -1005 format(i2,'.',i1,'.',i1,2x,a1,1x,a37,1x,a37) + write(type_text,1005) i3,n3,j2 +1005 format(i1,'.',i1,'.',i1) + else if(i3.eq.0) then + write(type_text,1006) i3,n3 +1006 format(i1,'.',i1) + else + write(type_text,1007) i3 +1007 format(i1) endif - if(i3.ge.1) write(*,1006) i3,cerr,msg0(1:37),msg -1006 format(i2,'.',5x,a1,1x,a37,1x,a37) + + if(msg.eq.msg0(1:37)) then + write(*,1004) trim(type_text),'OK',msg0(1:37),msg + else + ndifferent=ndifferent+1 + write(*,1004) trim(type_text),'DIFF',msg0(1:37),msg + endif +1004 format(a5,1x,a11,1x,a37,1x,a) if(nargs.eq.1) exit enddo -999 end program encode77 +999 if(nargs.eq.2) then + write(*,1010) nencoded,nrejected,nunpack_failed,ndifferent +1010 format(/'Summary: ',i0,' encoded, ',i0,' rejected, ',i0, & + ' unpack failures, ',i0,' differences') + endif + + if(nrejected.gt.0 .or. nunpack_failed.gt.0 .or. ndifferent.gt.0) stop 1 + +contains + + character(len=40) function pack77_status_text(status) result(text) + integer, intent(in) :: status + + select case(status) + case(PACK77_STATUS_NOT_ENCODED) + text='not encoded' + case(PACK77_STATUS_FREE_TEXT_TOO_LONG) + text='free text too long' + case(PACK77_STATUS_FREE_TEXT_INVALID) + text='invalid free text' + case(PACK77_STATUS_PREFERRED_FAMILY_REJECTED) + text='preferred message family rejected' + case(PACK77_STATUS_INTERNAL_ROUNDTRIP_REJECTED) + text='internal round-trip check failed' + case default + write(text,'(a,i0)') 'unknown status ',status + end select + end function pack77_status_text + +end program encode77 include '../chkcall.f90' diff --git a/lib/77bit/packjt77.f90 b/lib/77bit/packjt77.f90 index eab4ff6c..9fba9f92 100644 --- a/lib/77bit/packjt77.f90 +++ b/lib/77bit/packjt77.f90 @@ -1,48 +1,256 @@ module packjt77 - + + use packjt77_schema + use packjt77_grammar + ! These variables are accessible from outside via "use packjt77": parameter (MAXHASH=1000,MAXRECENT=10) - parameter (MAXHASHVAR=1000,MAXTXHASHVAR=5,MAXRECENTVAR=10) - ! variables from original packjt77 + ! Callsign hash resolution uses one session-persistent shared table. Encode, + ! decode, and configured/var decode stage calls at their boundaries, then + ! commit them through save_hash_call instead of maintaining separate TX/RX + ! hash stores. character (len=13), dimension(0:1023) :: calls10='' character (len=13), dimension(0:4095) :: calls12='' character (len=13), dimension(1:MAXHASH) :: calls22='' character (len=13), dimension(1:MAXRECENT) :: recent_calls='' character (len=13) :: mycall13='' character (len=13) :: dxcall13='' - character (len=6) :: dxbase='' integer, dimension(1:MAXHASH) :: ihash22=-1 integer :: nzhash=0 - integer n28a,n28b - ! variables from packjt77var - character (len=13), dimension(0:1023) :: calls10var='' - character (len=13), dimension(0:4095) :: calls12var='' - character (len=13), dimension(1:MAXHASHVAR) :: calls22var='' - character (len=13), dimension(0:1023) :: txcalls10var='' - character (len=13), dimension(0:4095) :: txcalls12var='' - character (len=13), dimension(1:MAXTXHASHVAR) :: txcalls22var='' - character (len=13), dimension(1:MAXRECENTVAR) :: recent_callsvar='' - character (len=13), dimension(1:840) :: last_callsvar='' - character (len=13) :: mycall13var='' - character (len=13) :: dxcall13var='' - character (len=13) :: mycall13_0var='' - character (len=13) :: dxcall13_0var='' - integer hashmy10var,hashmy12var,hashmy22var,hashdx10var - logical :: dxcall13_setvar=.false. - logical :: mycall13_setvar=.false. - integer, dimension(1:MAXHASHVAR) :: ihash22var=-1 - integer, dimension(1:5) :: itxhash22var=-1 - integer, dimension(1:24) :: nlast_callsvar=0 - integer, dimension(1:25) :: nthrindexvar=(/0,200,300,370,420,460,500,530,560,590,610,630,650,670,690,710, & + ! Configured/var decodes queue per-thread facts until fillhashvar folds them + ! into the shared hash and recent-call state. + character (len=13), dimension(1:840) :: queued_calls_by_thread='' + character (len=13), dimension(1:840) :: queued_recent_calls_by_thread='' + character (len=13) :: mycall13_configured='' + character (len=13) :: dxcall13_configured='' + character (len=13) :: mycall13_configured_prev='' + character (len=13) :: dxcall13_configured_prev='' + integer hashmy10_configured,hashmy12_configured,hashmy22_configured,hashdx10_configured + logical :: dxcall13_configured_set=.false. + logical :: mycall13_configured_set=.false. + integer, dimension(1:24) :: nqueued_calls_by_thread=0 + integer, dimension(1:24) :: nqueued_recent_calls_by_thread=0 + ! Per-thread slice boundaries of queued_*_by_thread; earlier (busier) + ! decode threads get larger slots. + integer, dimension(1:25) :: thread_call_index=(/0,200,300,370,420,460,500,530,560,590,610,630,650,670,690,710, & 730,750,770,790,800,810,820,830,840/) - integer :: nzhashvar=0 - integer :: nztxhashvar=0 - integer n28avar,n28bvar - logical(1) lcommonft8b -!$omp threadprivate(recent_callsvar,n28avar,n28bvar) + integer n28a_configured,n28b_configured +!$omp threadprivate(n28a_configured,n28b_configured) +! Everything is private unless exported here; imported grammar/schema +! symbols therefore never re-export through "use packjt77". + private + public :: pack77,pack77_legacy_truncating_fallback + public :: pack77_options,unpack77_options + public :: PACK77_STATUS_NOT_ENCODED,PACK77_STATUS_ENCODED + public :: PACK77_STATUS_FREE_TEXT_TOO_LONG + public :: PACK77_STATUS_FREE_TEXT_INVALID + public :: PACK77_STATUS_PREFERRED_FAMILY_REJECTED + public :: PACK77_STATUS_INTERNAL_ROUNDTRIP_REJECTED + public :: unpack77,unpack77_configured,pack28,unpack28 + public :: split77,packtext77,unpacktext77 + public :: ihashcall,hash10,hash12,hash22,save_hash_call + public :: add_call_to_recent_calls,queue_hash_call_for_thread + public :: fold_queued_recent_calls,sync_configured_calls_for_decode_start + public :: MAXHASH,MAXRECENT + public :: calls10,calls12,calls22,recent_calls,ihash22,nzhash + public :: mycall13,dxcall13 + public :: queued_calls_by_thread,queued_recent_calls_by_thread + public :: nqueued_calls_by_thread,nqueued_recent_calls_by_thread + public :: mycall13_configured,dxcall13_configured + public :: mycall13_configured_prev,dxcall13_configured_prev + public :: mycall13_configured_set,dxcall13_configured_set + public :: hashmy10_configured,hashmy12_configured,hashmy22_configured + public :: hashdx10_configured + public :: thread_call_index + + integer, parameter :: PACK77_STATUS_NOT_ENCODED=0 + integer, parameter :: PACK77_STATUS_ENCODED=1 + integer, parameter :: PACK77_STATUS_FREE_TEXT_TOO_LONG=3 + integer, parameter :: PACK77_STATUS_FREE_TEXT_INVALID=4 + integer, parameter :: PACK77_STATUS_PREFERRED_FAMILY_REJECTED=5 + integer, parameter :: PACK77_STATUS_INTERNAL_ROUNDTRIP_REJECTED=6 + + type pack77_result + logical :: encoded=.false. + integer :: status=PACK77_STATUS_NOT_ENCODED + integer :: i3=-1 + integer :: n3=-1 + character(len=77) :: c77=' ' + end type pack77_result + + type pack77_hash_facts + ! Calls that an accepted encode should make resolvable by later hash-only + ! decodes. pack77 commits these unless record_tx_hashes is disabled. + integer :: ncalls=0 + character(len=13) :: calls(32)='' + end type pack77_hash_facts + + type pack77_candidate + type(pack77_result) :: result + type(pack77_hash_facts) :: hash_facts + end type pack77_candidate + + type pack77_encode_core_result + type(pack77_result) :: result + type(pack77_hash_facts) :: hash_facts + end type pack77_encode_core_result + + + + type unpack77_effects + ! Decoders collect hash/recent-call side effects here and apply them only + ! after the message has decoded successfully. + integer :: nhash=0 + integer :: nrecent=0 + character(len=13) :: hash_calls(32)='' + character(len=13) :: recent_calls(32)='' + end type unpack77_effects + + type unpack77_context + integer :: nrx=0 + logical :: configured=.false. + logical :: strict_var_guards=.false. + logical :: mycall_set=.false. + logical :: dxcall_set=.false. + character(len=13) :: mycall='' + character(len=13) :: dxcall='' + integer :: hashmy10=-1 + integer :: hashmy12=-1 + integer :: hashmy22=-1 + integer :: hashdx10=-1 + end type unpack77_context + + type configured_decode_state + logical :: mycall_set=.false. + logical :: dxcall_set=.false. + character(len=13) :: mycall='' + character(len=13) :: dxcall='' + integer :: hashmy10=-1 + integer :: hashmy12=-1 + integer :: hashmy22=-1 + integer :: hashdx10=-1 + end type configured_decode_state + + type unpack77_core_result + logical :: success=.false. + integer :: i3=-1 + integer :: n3=-1 + character(len=37) :: msg=' ' + type(unpack77_effects) :: effects + end type unpack77_core_result + + type unpack77_effect_policy + logical :: record_hashes=.true. + logical :: record_recent_calls=.true. + logical :: queue_by_thread=.false. + ! Queued policies require valid 1-based thread indexes; disable recording + ! through record_hashes or record_recent_calls instead of sentinel indexes. + integer :: nthr_hash=1 + integer :: nthr_recent=1 + end type unpack77_effect_policy + + type pack77_options + logical :: prefer_wspr_50bit=.false. + logical :: record_tx_hashes=.true. + logical :: expand_dx_macro=.false. + character(len=6) :: dx_macro_base='' + end type pack77_options + + type unpack77_options + integer :: thread_index=1 + logical :: record_hashes=.true. + logical :: record_recent_calls=.true. + end type unpack77_options contains - + +type(pack77_result) function pack77_no_match() result(encoded) + encoded=pack77_result() +end function pack77_no_match + +type(pack77_result) function pack77_reject(status) result(encoded) + integer, intent(in) :: status + + encoded=pack77_result() + encoded%status=status +end function pack77_reject + +type(pack77_result) function pack77_accept(i3,n3,c77) result(encoded) + integer, intent(in) :: i3,n3 + character(len=77), intent(in) :: c77 + + encoded=pack77_result() + encoded%encoded=.true. + encoded%status=PACK77_STATUS_ENCODED + encoded%i3=i3 + encoded%n3=n3 + encoded%c77=c77 +end function pack77_accept + +subroutine pack77_accept_candidate_encoded(candidate,i3,n3,c77,ok) + type(pack77_candidate), intent(inout) :: candidate + integer, intent(in) :: i3,n3 + character(len=77), intent(in) :: c77 + logical, intent(in) :: ok + + candidate%result=pack77_no_match() + if(ok) candidate%result=pack77_accept(i3,n3,c77) +end subroutine pack77_accept_candidate_encoded + +logical function take_candidate(candidate,msg,encoded) result(won) + type(pack77_candidate), intent(in) :: candidate + character(len=*), intent(in) :: msg + type(pack77_encode_core_result), intent(inout) :: encoded + type(unpack77_core_result) :: decoded + logical :: messages_match,resolved_render_fits + +! A candidate must round-trip through the neutral decoder before it wins; a +! syntactically shaped but gated-out candidate only records its family so +! fallback callers can report what kind of exact encoding was rejected. + won=candidate%result%encoded + if(won) then + decoded=pack77_decode_neutral(candidate%result%c77) + call pack77_gate_message_checks(msg,decoded%msg,candidate%hash_facts%calls, & + candidate%hash_facts%ncalls,messages_match,resolved_render_fits) + if(.not.(decoded%success .and. decoded%i3.eq.candidate%result%i3 .and. & + decoded%n3.eq.candidate%result%n3 .and. messages_match .and. & + resolved_render_fits)) then + won=.false. + encoded%result=pack77_reject(PACK77_STATUS_INTERNAL_ROUNDTRIP_REJECTED) + endif + endif + if(.not.won) return + encoded%result=candidate%result + encoded%hash_facts=candidate%hash_facts +end function take_candidate + +type(unpack77_core_result) function pack77_decode_neutral(c77) result(decoded) + character(len=77), intent(in) :: c77 + type(unpack77_context) :: context + + context=unpack77_context() + decoded=unpack77_core(c77,context) +end function pack77_decode_neutral + +integer function pack77_wspr_payload_type(c77) result(wspr_type) + character(len=77), intent(in) :: c77 + +! Bit columns 49/50 are the j49/j50 subtype selector fields fixed by the +! WSPR schemas in packjt77_schema; keep in sync with those field offsets. + wspr_type=0 + if(c77(50:50).eq.'1') then + wspr_type=2 + else if(c77(49:49).eq.'0') then + wspr_type=1 + else if(c77(49:49).eq.'1') then + ! Invalid selector 110 reaches Type 3; the schema decoder rejects it. + wspr_type=3 + endif +end function pack77_wspr_payload_type + + + + subroutine hash10(n10,c13) character*13 c13 @@ -60,7 +268,7 @@ end subroutine hash10 subroutine hash12(n12,c13) character*13 c13 - + c13='<...>' if(n12.lt.0 .or. n12.gt.4095) return if(len(trim(calls12(n12))).gt.0) then @@ -75,7 +283,7 @@ end subroutine hash12 subroutine hash22(n22,c13) character*13 c13 - + c13='<...>' do i=1,nzhash if(ihash22(i).eq.n22) then @@ -96,12 +304,10 @@ integer function ihashcall(c0,m) integer, intent(in) :: m integer(kind=8) :: n8 integer :: i,j - character*38 c - data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/'/ n8=0_8 do i=1,11 - j=index(c,c0(i:i)) - 1 + j=index(PACK77_BASE38,c0(i:i)) - 1 n8=38_8*n8 + j enddo @@ -151,7 +357,7 @@ subroutine save_hash_call(c13,n10,n12,n22) character*13 c13,cw - cw=c13 + cw=c13 if(cw(1:1).eq.' ' .or. cw(1:5).eq.'<...>') return if(cw(1:1).eq.'<') cw=cw(2:) i=index(cw,'>') @@ -166,7 +372,7 @@ subroutine save_hash_call(c13,n10,n12,n22) if(n12.ge.0 .and. n12 .le. 4095 .and. cw.ne.mycall13) calls12(n12)=cw n22=ihashcall(cw,22) - if(any(ihash22.eq.n22)) then ! If entry exists, make sure callsign is the most recently received one + if(any(ihash22.eq.n22)) then ! If entry exists, make sure callsign is the most recently received one where(ihash22.eq.n22) calls22=cw go to 900 endif @@ -180,157 +386,444 @@ subroutine save_hash_call(c13,n10,n12,n22) calls22(1)=cw if(nzhash.lt.MAXHASH) nzhash=nzhash+1 900 continue - return + return end subroutine save_hash_call -subroutine pack77(msg0,i3,n3,c77) +subroutine normalize_hash_call(c13,cw,ok) - use packjt - character*37 msg,msg0 - character*18 c18 - character*13 w(19) - character*77 c77 - integer nw(19) - integer ntel(3) + character(len=*), intent(in) :: c13 + character(len=13), intent(out) :: cw + logical, intent(out) :: ok + integer :: i + + cw=c13 + ok=.false. + if(cw(1:1).eq.' ' .or. cw(1:5).eq.'<...>') return + if(cw(1:1).eq.'<') then + if(.not.pack77_valid_hash_call_token(cw)) return + cw=cw(2:) + i=index(cw,'>') + if(i.gt.0) cw(i:)=' ' + endif + if(len(trim(cw)) .lt. 3) return + ok=.true. + + return +end subroutine normalize_hash_call + +subroutine stage_hash_call(hash_facts,c13) + + type(pack77_hash_facts), intent(inout) :: hash_facts + character(len=*), intent(in) :: c13 + character(len=13) :: cw + logical :: ok + +! Do not update the global hash table while testing encode candidates. The +! accepted candidate's facts are committed once by pack77. + call normalize_hash_call(c13,cw,ok) + if(.not.ok) return + if(hash_facts%ncalls.ge.size(hash_facts%calls)) return + hash_facts%ncalls=hash_facts%ncalls+1 + hash_facts%calls(hash_facts%ncalls)=cw + + return +end subroutine stage_hash_call + +subroutine pack77_hash_index(hash_facts,token,nbits,n,ok) + type(pack77_hash_facts), intent(inout) :: hash_facts + character(len=*), intent(in) :: token + integer, intent(in) :: nbits + integer, intent(out) :: n + logical, intent(out) :: ok + character(len=13) :: hash_call + + call normalize_hash_call(token,hash_call,ok) + if(.not.ok) return + n=ihashcall(hash_call,nbits) + call stage_hash_call(hash_facts,hash_call) + + return +end subroutine pack77_hash_index + +subroutine commit_hash_facts(hash_facts) + + type(pack77_hash_facts), intent(in) :: hash_facts + integer :: i,n10,n12,n22 + +! All hash-producing encode paths feed the same shared tables here. + do i=1,hash_facts%ncalls + call save_hash_call(hash_facts%calls(i),n10,n12,n22) + enddo + + return +end subroutine commit_hash_facts + +character(len=37) function pack77_expand_dx_macro(msg0,dx_base) result(msg) + character(len=*), intent(in) :: msg0,dx_base + character(len=37) :: msg1 + integer :: i1 msg=msg0 - if(msg(1:3).eq.'$DX') then - i1=index(msg,' ') - msg=trim(dxbase)//' '//msg(i1+1:) + msg1=adjustl(msg0) + if(.not.pack77_first_word_is_dx_macro(msg1)) return + if(len_trim(dx_base).eq.0) return + + i1=index(msg1,' ') + if(i1.gt.0) then + msg=trim(dx_base)//' '//adjustl(msg1(i1+1:)) + else + msg=trim(dx_base) + endif +end function pack77_expand_dx_macro + +logical function pack77_first_word_is_dx_macro(msg0) result(is_macro) + character(len=*), intent(in) :: msg0 + character(len=37) :: first_word,msg1 + integer :: i,i1 + + msg1=adjustl(msg0) + if(len_trim(msg1).eq.0) then + is_macro=.false. + return endif - i3_hint=i3 - n3_hint=n3 - i3=-1 - n3=-1 - if(i3_hint.eq.0 .and. n3_hint.eq.5) go to 5 + i1=index(msg1,' ') + if(i1.gt.1) then + first_word=msg1(1:i1-1) + else + first_word=trim(msg1) + endif + + do i=1,len_trim(first_word) + if(first_word(i:i).ge.'a' .and. first_word(i:i).le.'z') & + first_word(i:i)=char(ichar(first_word(i:i))-32) + enddo + + is_macro=first_word.eq.'$DX' .or. first_word.eq.'$DXCALL' +end function pack77_first_word_is_dx_macro + +logical function pack77_failed_preferred_wspr_shape(msg0,options) result(reject) + + character(len=*), intent(in) :: msg0 + type(pack77_options), intent(in), optional :: options + character(len=13) :: source_tokens(2) + integer :: nwords + logical :: split_ok + +! FST4W callers use this option to request a WSPR/50-bit payload, not merely +! to try WSPR first. If the source has WSPR shape but is not valid WSPR, reject +! instead of falling through to another pack77 family or free text. + reject=.false. + if(.not.present(options)) return + if(.not.options%prefer_wspr_50bit) return + + call pack77_split_source_tokens(msg0,2,nwords,source_tokens,split_ok) + reject=split_ok .and. nwords.eq.2 .and. & + len_trim(source_tokens(1)).ge.5 .and. & + len_trim(source_tokens(1)).le.12 .and. & + len_trim(source_tokens(2)).le.6 +end function pack77_failed_preferred_wspr_shape + +type(pack77_encode_core_result) function pack77_encode_core(msg0,options) & + result(encoded) + + character*37 msg,msg0 + character(len=13) :: source_tokens(19) + type(pack77_options), intent(in), optional :: options + type(pack77_candidate) :: candidate + character(len=6) :: dx_macro_base + integer :: nwords + logical prefer_wspr_50bit + logical expand_dx_macro + logical split_ok + logical word_overflow + logical starts_with_special_token + + encoded%result=pack77_no_match() + prefer_wspr_50bit=.false. + expand_dx_macro=.false. + dx_macro_base='' + if(present(options)) then + prefer_wspr_50bit=options%prefer_wspr_50bit + expand_dx_macro=options%expand_dx_macro + dx_macro_base=options%dx_macro_base + endif + msg=msg0 + if(expand_dx_macro) msg=pack77_expand_dx_macro(msg,dx_macro_base) ! Convert msg to upper case; collapse multiple blanks; parse into words. - call split77(msg,nwords,nw,w) - if(msg(1:3).eq.'CQ ' .or. msg(1:3).eq.'DE ' .or. msg(1:4).eq.'QRZ ') go to 100 + call pack77_split_source_tokens(msg,19,nwords,source_tokens,split_ok) + word_overflow=.not.split_ok + starts_with_special_token=msg(1:3).eq.'CQ ' .or. msg(1:3).eq.'DE ' .or. & + msg(1:4).eq.'QRZ ' + if(word_overflow) then + if(.not.starts_with_special_token) then + encoded%result=pack77_05(msg) + if(encoded%result%encoded) return + endif + encoded%result=pack77_free_text_exact(msg) + return + endif + if(.not.starts_with_special_token) then ! Check 0.1 (DXpedition mode) - call pack77_01(nwords,w,i3,n3,c77) - if(i3.ge.0 .or. n3.ge.1) go to 900 + candidate=pack77_01_candidate(msg) + if(take_candidate(candidate,msg,encoded)) return ! Check 0.2 (EU VHF contest exchange) ! call pack77_02(nwords,w,i3,n3,c77) ! if(i3.ge.0) go to 900 ! Check 0.3 and 0.4 (ARRL Field Day exchange) - call pack77_03(nwords,w,i3,n3,c77) - if(i3.ge.0) go to 900 - if(nwords.ge.2) go to 100 + candidate=pack77_03_candidate(msg) + if(take_candidate(candidate,msg,encoded)) return + if(nwords.lt.2) then - ! Check 0.5 (telemetry) -5 i0=index(msg,' ') - c18=msg(1:i0-1) - c18=adjustr(c18) - ntel=-99 - read(c18,1005,err=6) ntel -1005 format(3z6) - if(ntel(1).ge.2**23) go to 800 -6 if(ntel(1).ge.0 .and. ntel(2).ge.0 .and. ntel(3).ge.0) then - i3=0 - n3=5 - write(c77,1006) ntel,n3,i3 -1006 format(b23.23,2b24.24,2b3.3) - go to 900 +! Check 0.5 (telemetry) + encoded%result=pack77_05(msg) + if(encoded%result%encoded) return + endif endif -100 call pack77_06(nwords,w,i3,n3,c77,i3_hint,n3_hint) - if(i3.ge.0) go to 900 + candidate=pack77_06_candidate(msg,prefer_wspr_50bit) + if(take_candidate(candidate,msg,encoded)) return ! Check Type 1 (Standard 77-bit message) or Type 2, with optional "/P" - call pack77_1(nwords,w,i3,n3,c77) - if(i3.ge.0) go to 900 + candidate=pack77_1_candidate(msg) + if(take_candidate(candidate,msg,encoded)) return ! Check Type 3 (ARRL RTTY contest exchange) - call pack77_3(nwords,w,i3,n3,c77) - if(i3.ge.0) go to 900 + candidate=pack77_3_candidate(msg) + if(take_candidate(candidate,msg,encoded)) return ! Check Type 4 (One nonstandard call and one hashed call) - call pack77_4(nwords,w,i3,n3,c77) - if(i3.ge.0) go to 900 + candidate=pack77_4_candidate(msg) + if(take_candidate(candidate,msg,encoded)) return ! Check Type 5 (EU VHF Contest with 2 hashed calls, report, serial, and grid6) - call pack77_5(nwords,w,i3,n3,c77) - if(i3.ge.0) go to 900 + candidate=pack77_5_candidate(msg) + if(take_candidate(candidate,msg,encoded)) return + +! It defaults to exactly representable free text. + encoded%result=pack77_free_text_exact(msg) +end function pack77_encode_core + +type(pack77_result) function pack77_encode_result(msg0,options) result(encoded) + + character*37 msg0 + type(pack77_options), intent(in), optional :: options + type(pack77_encode_core_result) :: core + logical :: record_tx_hashes + + record_tx_hashes=.true. + if(present(options)) record_tx_hashes=options%record_tx_hashes + + core=pack77_encode_core(msg0,options) + encoded=core%result + if(.not.encoded%encoded .and. & + encoded%status.ne.PACK77_STATUS_INTERNAL_ROUNDTRIP_REJECTED .and. & + pack77_failed_preferred_wspr_shape(pack77_normalized_message(msg0), & + options)) encoded=pack77_reject(PACK77_STATUS_PREFERRED_FAMILY_REJECTED) + if(record_tx_hashes) call commit_hash_facts(core%hash_facts) +end function pack77_encode_result + +subroutine pack77(msg0,i3,n3,c77,options,status) + character(len=*), intent(in) :: msg0 + integer, intent(out) :: i3,n3 + character(len=77), intent(out) :: c77 + type(pack77_options), intent(in), optional :: options + integer, intent(out), optional :: status + type(pack77_result) :: packed + + packed=pack77_encode_result(msg0,options) + i3=packed%i3 + n3=packed%n3 + c77=packed%c77 + if(present(status)) status=packed%status +end subroutine pack77 -! It defaults to free text -800 i3=0 - n3=0 - msg(14:)=' ' - call packtext77(msg(1:13),c77(1:71)) - write(c77(72:77),'(2b3.3)') n3,i3 +subroutine pack77_legacy_truncating_fallback(msg0,i3,n3,c77,options,status) + character(len=*), intent(in) :: msg0 + integer, intent(out) :: i3,n3 + character(len=77), intent(out) :: c77 + type(pack77_options), intent(in), optional :: options + integer, intent(out), optional :: status + type(pack77_result) :: packed + + packed=pack77_legacy_truncating_result(msg0,options) + i3=packed%i3 + n3=packed%n3 + c77=packed%c77 + if(present(status)) status=packed%status +end subroutine pack77_legacy_truncating_fallback + +type(pack77_result) function pack77_legacy_truncating_result(msg0,options) & + result(encoded) + character(len=*), intent(in) :: msg0 + type(pack77_options), intent(in), optional :: options + type(pack77_result) :: fallback + character(len=37) :: msg + character(len=13) :: payload + + encoded=pack77_encode_result(msg0,options) + if(encoded%encoded) return + if(encoded%status.eq.PACK77_STATUS_PREFERRED_FAMILY_REJECTED) return + if(encoded%status.eq.PACK77_STATUS_INTERNAL_ROUNDTRIP_REJECTED) return -900 return -end subroutine pack77 + msg=msg0 + if(present(options)) then + if(options%expand_dx_macro) msg=pack77_expand_dx_macro(msg, & + options%dx_macro_base) + endif + msg=pack77_normalized_message(msg) + if(len_trim(msg).lt.1) return + + payload=msg(1:13) + if(.not.pack77_free_text_alphabet_ok(payload)) return + + fallback=pack77_free_text_accept(payload,PACK77_STATUS_ENCODED) + if(fallback%encoded) encoded=fallback +end function pack77_legacy_truncating_result + +type(pack77_result) function pack77_05(msg) result(encoded) + character(len=*), intent(in) :: msg + character*77 c77 + character*37 text + character*18 c18 + character*1 ch + integer ntel(3) + logical ok + + encoded=pack77_no_match() + text=adjustl(msg) + n=len_trim(text) + if(n.lt.1 .or. n.gt.18) return + do i=1,n + ch=text(i:i) + if(ch.ge.'a' .and. ch.le.'z') ch=char(ichar(ch)-32) + if(index('0123456789ABCDEF',ch).eq.0) return + text(i:i)=ch + enddo + c18=text(1:n) + c18=adjustr(c18) + ntel=-99 + read(c18,1005,err=6) ntel +1005 format(3z6) + 6 if(ntel(1).ge.0 .and. ntel(2).ge.0 .and. ntel(3).ge.0) then + call encode_pack77_telemetry(ntel(1),ntel(2),ntel(3),c77,ok) + if(ok) then + encoded=pack77_accept(0,5,c77) + endif + endif +end function pack77_05 + +type(pack77_result) function pack77_free_text_exact(msg) result(encoded) + character(len=*), intent(in) :: msg + character*37 msg0 + + msg0=pack77_normalized_message(msg) + if(.not.pack77_exact_free_text_ok(msg0)) then + encoded=pack77_reject(pack77_free_text_reject_status(msg0)) + return + endif + encoded=pack77_free_text_accept(msg0,PACK77_STATUS_ENCODED) +end function pack77_free_text_exact + +type(pack77_result) function pack77_free_text_accept(msg,status) result(encoded) + character(len=*), intent(in) :: msg + integer, intent(in) :: status + character*37 msg0 + character*71 text_bits + character*77 c77 + logical ok + + msg0=msg + msg0(14:)=' ' + call packtext77(msg0(1:13),text_bits) + call encode_pack77_free_text(text_bits,c77,ok) + encoded=pack77_no_match() + if(ok) then + encoded=pack77_accept(0,0,c77) + encoded%status=status + endif +end function pack77_free_text_accept + +integer function pack77_free_text_reject_status(msg) result(status) + character(len=*), intent(in) :: msg + + if(.not.pack77_free_text_alphabet_ok(msg)) then + status=PACK77_STATUS_FREE_TEXT_INVALID + else if(len_trim(msg).gt.13) then + status=PACK77_STATUS_FREE_TEXT_TOO_LONG + else + status=PACK77_STATUS_FREE_TEXT_INVALID + endif +end function pack77_free_text_reject_status + +logical function pack77_exact_free_text_ok(msg) result(ok) + character(len=*), intent(in) :: msg + + ok=.false. + if(len_trim(msg).gt.13) return + ok=pack77_free_text_alphabet_ok(msg(1:len_trim(msg))) +end function pack77_exact_free_text_ok + +logical function pack77_free_text_alphabet_ok(msg) result(ok) + character(len=*), intent(in) :: msg + character(len=42), parameter :: alphabet=' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+-./?' + integer :: i + + ok=.false. + do i=1,len_trim(msg) + if(index(alphabet,msg(i:i)).eq.0) return + enddo + ok=.true. +end function pack77_free_text_alphabet_ok + +! Must mirror the character canonicalization of pack77_split_source_tokens +! (NUL->space, uppercase fold, blank collapse) so free text and structured +! parsing agree on the canonical form. +character(len=37) function pack77_normalized_message(msg) result(normalized) + character(len=*), intent(in) :: msg + character(len=1) :: c,c0 + integer :: i,j,iz + + normalized=' ' + c0=' ' + j=0 + iz=len_trim(msg) + do i=1,min(iz,len(normalized)) + c=msg(i:i) + if(ichar(c).eq.0) c=' ' + if(c.eq.' ' .and. c0.eq.' ') cycle + if(c.ge.'a' .and. c.le.'z') c=char(ichar(c)-32) + j=j+1 + normalized(j:j)=c + c0=c + enddo +end function pack77_normalized_message subroutine unpack77(c77,nrx,msg,unpk77_success) ! ! nrx=1 when unpacking a received message ! nrx=0 when unpacking a to-be-transmitted message -! the value of nrx is used to decide when mycall13 or dxcall13 should -! be used in place of a callsign from the hashtable ! - parameter (NSEC=86) !Number of ARRL Sections - parameter (NUSCAN=171) !Number of States and Provinces - parameter (MAXGRID4=32400) - integer*8 n58 - integer ntel(3) character*77 c77 character*37 msg - character*13 call_1,call_2,call_3,call_1a + integer, intent(in) :: nrx + logical unpk77_success character*13 mycall13_0,dxcall13_0 - character*11 c11 - character*3 crpt,cntx,cpfx - character*3 cmult(NUSCAN) - character*6 cexch,grid6 - character*4 grid4,cserial - character*3 csec(NSEC) - character*38 c - character*36 a2 integer hashmy10,hashmy12,hashmy22,hashdx10,hashdx12,hashdx22 - logical unpk28_success,unpk77_success,unpkg4_success logical dxcall13_set,mycall13_set + type(unpack77_context) :: context + type(unpack77_effect_policy) :: policy - data a2/'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/,nzzz/46656/ - data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/'/ - data csec/ & - "AB ","AK ","AL ","AR ","AZ ","BC ","CO ","CT ","DE ","EB ", & - "EMA","ENY","EPA","EWA","GA ","GH ","IA ","ID ","IL ","IN ", & - "KS ","KY ","LA ","LAX","NS ","MB ","MDC","ME ","MI ","MN ", & - "MO ","MS ","MT ","NC ","ND ","NE ","NFL","NH ","NL ","NLI", & - "NM ","NNJ","NNY","TER","NTX","NV ","OH ","OK ","ONE","ONN", & - "ONS","OR ","ORG","PAC","PR ","QC ","RI ","SB ","SC ","SCV", & - "SD ","SDG","SF ","SFL","SJV","SK ","SNJ","STX","SV ","TN ", & - "UT ","VA ","VI ","VT ","WCF","WI ","WMA","WNY","WPA","WTX", & - "WV ","WWA","WY ","DX ","PE ","NB "/ - data cmult/ & - "AL ","AK ","AZ ","AR ","CA ","CO ","CT ","DE ","FL ","GA ", & - "HI ","ID ","IL ","IN ","IA ","KS ","KY ","LA ","ME ","MD ", & - "MA ","MI ","MN ","MS ","MO ","MT ","NE ","NV ","NH ","NJ ", & - "NM ","NY ","NC ","ND ","OH ","OK ","OR ","PA ","RI ","SC ", & - "SD ","TN ","TX ","UT ","VT ","VA ","WA ","WV ","WI ","WY ", & - "NB ","NS ","QC ","ON ","MB ","SK ","AB ","BC ","NWT","NF ", & - "LB ","NU ","YT ","PEI","DC ","DR ","FR ","GD ","GR ","OV ", & - "ZH ","ZL ","X01","X02","X03","X04","X05","X06","X07","X08", & - "X09","X10","X11","X12","X13","X14","X15","X16","X17","X18", & - "X19","X20","X21","X22","X23","X24","X25","X26","X27","X28", & - "X29","X30","X31","X32","X33","X34","X35","X36","X37","X38", & - "X39","X40","X41","X42","X43","X44","X45","X46","X47","X48", & - "X49","X50","X51","X52","X53","X54","X55","X56","X57","X58", & - "X59","X60","X61","X62","X63","X64","X65","X66","X67","X68", & - "X69","X70","X71","X72","X73","X74","X75","X76","X77","X78", & - "X79","X80","X81","X82","X83","X84","X85","X86","X87","X88", & - "X89","X90","X91","X92","X93","X94","X95","X96","X97","X98", & - "X99"/ data dxcall13_set/.false./ data mycall13_set/.false./ data mycall13_0/''/ - data dxcall13_0/''/ + data dxcall13_0/' '/ save hashmy10,hashmy12,hashmy22,hashdx10,hashdx12,hashdx22 + save dxcall13_set,mycall13_set,mycall13_0,dxcall13_0 if(mycall13.ne.mycall13_0) then if(len(trim(mycall13)).gt.2) then @@ -349,365 +842,51 @@ subroutine unpack77(c77,nrx,msg,unpk77_success) hashdx10=ihashcall(dxcall13,10) hashdx12=ihashcall(dxcall13,12) hashdx22=ihashcall(dxcall13,22) + else + dxcall13_set=.false. endif endif - unpk77_success=.true. - -! Check for bad data - do i=1,77 - if(c77(i:i).ne.'0' .and. c77(i:i).ne.'1') then - msg='failed unpack' - unpk77_success=.false. - return - endif - enddo - - read(c77(72:77),'(2b3)') n3,i3 - msg=repeat(' ',37) - - if(i3.eq.0 .and. n3.eq.0) then -! 0.0 Free text - call unpacktext77(c77(1:71),msg(1:13)) - msg(14:)=' ' - msg=adjustl(msg) - if(msg(1:1).eq.' ') then - unpk77_success=.false. - return - endif - - else if(i3.eq.0 .and. n3.eq.1) then -! 0.1 K1ABC RR73; W9XYZ -11 28 28 10 5 71 DXpedition Mode - read(c77,1010) n28a,n28b,n10,n5 -1010 format(2b28,b10,b5) - irpt=2*n5 - 30 - write(crpt,1012) irpt -1012 format(i3.2) - if(irpt.ge.0) crpt(1:1)='+' - call unpack28(n28a,call_1,unpk28_success) - if(.not.unpk28_success .or. n28a.le.2) unpk77_success=.false. - call unpack28(n28b,call_2,unpk28_success) - if(.not.unpk28_success .or. n28b.le.2) unpk77_success=.false. - call hash10(n10,call_3) - if(call_3.eq.'<...>') then - call hash10var(n10,call_3,1) - endif - if(nrx.eq.1 .and. & - dxcall13_set .and. & - len(trim(dxcall13)).ge.3 .and. & - hashdx10.eq.n10) call_3='<'//trim(dxcall13)//'>' - if(nrx.eq.0 .and. & - mycall13_set .and. & - n10.eq.hashmy10) call_3='<'//trim(mycall13)//'>' - msg=trim(call_1)//' RR73; '//trim(call_2)//' '//trim(call_3)//' '//crpt - - else if(i3.eq.0 .and. n3.eq.2) then - unpk77_success=.false. - - else if(i3.eq.0 .and. (n3.eq.3 .or. n3.eq.4)) then -! 0.3 WA9XYZ KA1ABC R 16A EMA 28 28 1 4 3 7 71 ARRL Field Day -! 0.4 WA9XYZ KA1ABC R 32A EMA 28 28 1 4 3 7 71 ARRL Field Day - read(c77,1030) n28a,n28b,ir,intx,nclass,isec -1030 format(2b28,b1,b4,b3,b7) - if(isec.gt.NSEC .or. isec.lt.1) then - unpk77_success=.false. - isec=1 - endif - call unpack28(n28a,call_1,unpk28_success) - if(.not.unpk28_success .or. n28a.le.2) unpk77_success=.false. - call unpack28(n28b,call_2,unpk28_success) - if(.not.unpk28_success .or. n28b.le.2) unpk77_success=.false. - ntx=intx+1 - if(n3.eq.4) ntx=ntx+16 - write(cntx(1:2),1032) ntx -1032 format(i2) - cntx(3:3)=char(ichar('A')+nclass) - if(ir.eq.0 .and. ntx.lt.10) msg=trim(call_1)//' '//trim(call_2)// & - cntx//' '//csec(isec) - if(ir.eq.1 .and. ntx.lt.10) msg=trim(call_1)//' '//trim(call_2)// & - ' R'//cntx//' '//csec(isec) - if(ir.eq.0 .and. ntx.ge.10) msg=trim(call_1)//' '//trim(call_2)// & - ' '//cntx//' '//csec(isec) - if(ir.eq.1 .and. ntx.ge.10) msg=trim(call_1)//' '//trim(call_2)// & - ' R '//cntx//' '//csec(isec) - - else if(i3.eq.0 .and. n3.eq.5) then -! 0.5 0123456789abcdef01 71 71 Telemetry (18 hex) - read(c77,1006) ntel -1006 format(b23,2b24) - write(msg,1007) ntel -1007 format(3z6.6) - do i=1,18 - if(msg(i:i).ne.'0') exit - msg(i:i)=' ' - enddo - msg=adjustl(msg) - - else if(i3.eq.0 .and. n3.eq.6) then - read(c77(48:50),'(3b1)') j48,j49,j50 -! bits 48:50 -! itype=1: x00 -! itype=2: xx1 -! itype=3: 010 - if(j50.eq.1) then - itype=2 - else if(j49.eq.0) then - itype=1 - else if(j48.eq.0) then - itype=3 - else - itype=-1 - unpk77_success=.false. - endif - - if(itype.eq.1) then -! WSPR Type 1 - read(c77,2010) n28,igrid4,idbm -2010 format(b28.28,b15.15,b5.5) - idbm=nint(idbm*10.0/3.0) - if(idbm.lt.0 .or. idbm.gt.60) unpk77_success=.false. - call unpack28(n28,call_1,unpk28_success) - if(.not.unpk28_success) unpk77_success=.false. - call to_grid4(igrid4,grid4,unpkg4_success) - if(.not.unpkg4_success) unpk77_success=.false. - write(crpt,'(i3)') idbm - msg=trim(call_1)//' '//grid4//' '//trim(adjustl(crpt)) - if (unpk77_success) call save_hash_call(call_1,n10,n12,n22) !### Is this OK here? ### - else if(itype.eq.2) then -! WSPR Type 2 - read(c77,2020) n28,npfx,idbm -2020 format(b28.28,b16.16,b5.5) - idbm=nint(idbm*10.0/3.0) - if(idbm.lt.0 .or. idbm.gt.60) unpk77_success=.false. - call unpack28(n28,call_1,unpk28_success) - if(.not.unpk28_success) unpk77_success=.false. - write(crpt,'(i3)') idbm - cpfx=' ' - if(npfx.lt.nzzz) then -! Prefix - do i=3,1,-1 - j=mod(npfx,36)+1 - cpfx(i:i)=a2(j:j) - npfx=npfx/36 - if(npfx.eq.0) exit - enddo - msg=trim(adjustl(cpfx))//'/'//trim(call_1)//' '//trim(adjustl(crpt)) - call_1a=trim(adjustl(cpfx))//'/'//trim(call_1) - call save_hash_call(call_1a,n10,n12,n22) !### Is this OK here? ### - else -! Suffix - npfx=npfx-nzzz - if(npfx.le.35) then - cpfx(1:1)=a2(npfx+1:npfx+1) - else if(npfx.gt.35 .and. npfx.le.1295) then - cpfx(1:1)=a2(npfx/36+1:npfx/36+1) - cpfx(2:2)=a2(mod(npfx,36)+1:mod(npfx,36)+1) - else if(npfx.gt.1295 .and. npfx.le.12959) then - cpfx(1:1)=a2(npfx/360+1:npfx/360+1) - cpfx(2:2)=a2(mod(npfx/10,36)+1:mod(npfx/10,36)+1) - cpfx(3:3)=a2(mod(npfx,10)+1:mod(npfx,10)+1) - else - unpk77_success=.false. - return - endif - msg=trim(call_1)//'/'//trim(adjustl(cpfx))//' '//trim(adjustl(crpt)) - call_1a=trim(call_1)//'/'//trim(adjustl(cpfx)) - call save_hash_call(call_1a,n10,n12,n22) !### Is this OK here? ### - endif - - else if(itype.eq.3) then -! WSPR Type 3 - read(c77,2030) n22,igrid6 -2030 format(b22.22,b25.25) - n28=n22+2063592 - call unpack28(n28,call_1,unpk28_success) - if(.not.unpk28_success) unpk77_success=.false. - call to_grid(igrid6,grid6,unpkg4_success) - if(.not.unpkg4_success) unpk77_success=.false. - msg=trim(call_1)//' '//grid6 - endif - - else if(i3.eq.0 .and. n3.gt.6) then - unpk77_success=.false. - - else if(i3.eq.1 .or. i3.eq.2) then -! Type 1 (standard message) or Type 2 ("/P" form for EU VHF contest) - read(c77,1000) n28a,ipa,n28b,ipb,ir,igrid4,i3 -1000 format(2(b28,b1),b1,b15,b3) - call unpack28(n28a,call_1,unpk28_success) - if(nrx.eq.1 .and. mycall13_set .and. hashmy22.eq.(n28a-2063592)) then - call_1='<'//trim(mycall13)//'>' - unpk28_success=.true. - endif - if(.not.unpk28_success) unpk77_success=.false. - call unpack28(n28b,call_2,unpk28_success) - if(.not.unpk28_success) unpk77_success=.false. - if(call_1(1:3).eq.'CQ_') call_1(3:3)=' ' - if(index(call_1,'<').le.0) then - i=index(call_1,' ') - if(i.ge.4 .and. ipa.eq.1 .and. i3.eq.1) call_1(i:i+1)='/R' - if(i.ge.4 .and. ipa.eq.1 .and. i3.eq.2) call_1(i:i+1)='/P' - if(i.ge.4) call add_call_to_recent_calls(call_1) - endif - if(index(call_2,'<').le.0) then - i=index(call_2,' ') - if(i.ge.4 .and. ipb.eq.1 .and. i3.eq.1) call_2(i:i+1)='/R' - if(i.ge.4 .and. ipb.eq.1 .and. i3.eq.2) call_2(i:i+1)='/P' - if(i.ge.4) then - call add_call_to_recent_calls(call_2) -! only hash the "from" call - call save_hash_call(call_2,ndum10,ndum12,ndum22) - endif - endif - if(igrid4.le.MAXGRID4) then - call to_grid4(igrid4,grid4,unpkg4_success) - if(.not.unpkg4_success) unpk77_success=.false. - if(ir.eq.0) msg=trim(call_1)//' '//trim(call_2)//' '//grid4 - if(ir.eq.1) msg=trim(call_1)//' '//trim(call_2)//' R '//grid4 - if(msg(1:3).eq.'CQ ' .and. ir.eq.1) unpk77_success=.false. - else - irpt=igrid4-MAXGRID4 - if(irpt.eq.1) msg=trim(call_1)//' '//trim(call_2) - if(irpt.eq.2) msg=trim(call_1)//' '//trim(call_2)//' RRR' - if(irpt.eq.3) msg=trim(call_1)//' '//trim(call_2)//' RR73' - if(irpt.eq.4) msg=trim(call_1)//' '//trim(call_2)//' 73' - if(irpt.ge.5) then - isnr=irpt-35 - if(isnr.gt.50) isnr=isnr-101 - write(crpt,'(i3.2)') isnr - if(crpt(1:1).eq.' ') crpt(1:1)='+' - if(ir.eq.0) msg=trim(call_1)//' '//trim(call_2)//' '//crpt - if(ir.eq.1) msg=trim(call_1)//' '//trim(call_2)//' R'//crpt - endif - if(msg(1:3).eq.'CQ ' .and. irpt.ge.2) unpk77_success=.false. - endif + context%nrx=nrx + context%configured=.false. + context%strict_var_guards=.false. + context%mycall_set=mycall13_set + context%dxcall_set=dxcall13_set + context%mycall=mycall13 + context%dxcall=dxcall13 + context%hashmy10=hashmy10 + context%hashmy12=hashmy12 + context%hashmy22=hashmy22 + context%hashdx10=hashdx10 + + policy=unpack77_effect_policy() + call run_unpack77(c77,context,policy,msg,unpk77_success) - else if(i3.eq.3) then -! Type 3: ARRL RTTY Contest - read(c77,1040) itu,n28a,n28b,ir,irpt,nexch,i3 -1040 format(b1,2b28.28,b1,b3.3,b13.13,b3.3) - write(crpt,1042) irpt+2 -1042 format('5',i1,'9') - nserial=nexch - imult=-1 - if(nexch.gt.8000) then - imult=nexch-8000 - nserial=-1 - endif - call unpack28(n28a,call_1,unpk28_success) - if(.not.unpk28_success) unpk77_success=.false. - call unpack28(n28b,call_2,unpk28_success) - if(.not.unpk28_success) unpk77_success=.false. - imult=0 - nserial=0 - if(nexch.gt.8000) imult=nexch-8000 - if(nexch.lt.8000) nserial=nexch - - if(imult.ge.1 .and.imult.le.NUSCAN) then - if(itu.eq.0 .and. ir.eq.0) msg=trim(call_1)//' '//trim(call_2)// & - ' '//crpt//' '//cmult(imult) - if(itu.eq.1 .and. ir.eq.0) msg='TU; '//trim(call_1)//' '//trim(call_2)// & - ' '//crpt//' '//cmult(imult) - if(itu.eq.0 .and. ir.eq.1) msg=trim(call_1)//' '//trim(call_2)// & - ' R '//crpt//' '//cmult(imult) - if(itu.eq.1 .and. ir.eq.1) msg='TU; '//trim(call_1)//' '//trim(call_2)// & - ' R '//crpt//' '//cmult(imult) - else if(nserial.ge.1 .and. nserial.le.7999) then - write(cserial,'(i4.4)') nserial - if(itu.eq.0 .and. ir.eq.0) msg=trim(call_1)//' '//trim(call_2)// & - ' '//crpt//' '//cserial - if(itu.eq.1 .and. ir.eq.0) msg='TU; '//trim(call_1)//' '//trim(call_2)// & - ' '//crpt//' '//cserial - if(itu.eq.0 .and. ir.eq.1) msg=trim(call_1)//' '//trim(call_2)// & - ' R '//crpt//' '//cserial - if(itu.eq.1 .and. ir.eq.1) msg='TU; '//trim(call_1)//' '//trim(call_2)// & - ' R '//crpt//' '//cserial - endif - else if(i3.eq.4) then -! Type 4 - read(c77,1050) n12,n58,iflip,nrpt,icq -1050 format(b12,b58,b1,b2,b1) - do i=11,1,-1 - j=mod(n58,38)+1 - c11(i:i)=c(j:j) - n58=n58/38 - enddo - call hash12(n12,call_3) - if(call_3.eq.'<...>') then - call hash12var(n12,call_3,1) - endif - if(iflip.eq.0) then ! 12 bit hash for TO call - call_1=call_3 - call_2=adjustl(c11)//' ' - call add_call_to_recent_calls(call_2) - call save_hash_call(call_2,ndum10,ndum12,ndum22) - if(nrx.eq.1 .and. & - dxcall13_set .and. mycall13_set .and. & - call_2.eq.dxcall13 .and. & - n12.eq.hashmy12 ) call_1='<'//trim(mycall13)//'>' - if(nrx.eq.1 .and. & - mycall13_set .and. & - index(call_1,'<...>').gt.0 .and. & - n12.eq.hashmy12 ) call_1='<'//trim(mycall13)//'>' - else ! 12 bit hash for DE call - call_1=adjustl(c11) - call_2=call_3 - call add_call_to_recent_calls(call_1) - if(nrx.eq.0 .and. & - mycall13_set .and. & - n12.eq.hashmy12) call_2='<'//trim(mycall13)//'>' - endif - if(icq.eq.0) then - if(nrpt.eq.0) msg=trim(call_1)//' '//trim(call_2) - if(nrpt.eq.1) msg=trim(call_1)//' '//trim(call_2)//' RRR' - if(nrpt.eq.2) msg=trim(call_1)//' '//trim(call_2)//' RR73' - if(nrpt.eq.3) msg=trim(call_1)//' '//trim(call_2)//' 73' - else - msg='CQ '//trim(call_2) - endif + return +end subroutine unpack77 - else if(i3.eq.5) then - -! Type 5 R 590003 IO91NP h12 h22 r1 s3 S11 g25 -! EU VHF contest - read(c77,1060) n12,n22,ir,irpt,iserial,igrid6 -1060 format(b12,b22,b1,b3,b11,b25) - if(igrid6.lt.0 .or. igrid6.gt.18662399) then - unpk77_success=.false. - return - endif - call hash12(n12,call_1) - if(call_1.eq.'<...>') then - call hash12var(n12,call_1,1) - endif - if(n12.eq.hashmy12) call_1='<'//trim(mycall13)//'>' - call hash22(n22,call_2) - if(call_2.eq.'<...>') then - call hash22var(n22,call_2,1) - endif - nrs=52+irpt - write(cexch,1022) nrs,iserial -1022 format(i2,i4.4) - call to_grid6(igrid6,grid6,unpk77_success) - if(ir.eq.0) msg=trim(call_1)//' '//trim(call_2)//' '//cexch//' '//grid6 - if(ir.eq.1) msg=trim(call_1)//' '//trim(call_2)//' R '//cexch//' '//grid6 +subroutine pack28(c13,n28) +! Callers must pass a well-formed callsign or special/hash token. Malformed +! tokens are encoded as 22-bit hashes, never coerced to standard calls, per the +! c28 shape predicate in packjt77_grammar. + character*13 c13 + integer, intent(out) :: n28 + type(pack77_hash_facts) :: hash_facts - else if(i3.ge.6) then ! i3 values 6 and 7 are not yet defined - unpk77_success=.false. - endif - if(msg(1:4).eq.'CQ <') unpk77_success=.false. + call pack28_core(c13,n28,hash_facts) + call commit_hash_facts(hash_facts) return -end subroutine unpack77 +end subroutine pack28 -subroutine pack28(c13,n28) +subroutine pack28_core(c13,n28,hash_facts) ! Pack a special token, a 22-bit hash code, or a valid base call into a 28-bit ! integer. - parameter (NTOKENS=2063592,MAX22=4194304) - logical is_digit,is_letter character*13 c13 + integer, intent(out) :: n28 + type(pack77_hash_facts), intent(inout) :: hash_facts character*6 callsign character*1 c character*4 c4 @@ -719,9 +898,6 @@ subroutine pack28(c13,n28) data a2/'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ data a3/'0123456789'/ data a4/' ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ - - is_digit(c)=c.ge.'0' .and. c.le.'9' - is_letter(c)=c.ge.'A' .and. c.le.'Z' n28=-1 ! Work-around for Swaziland prefix: @@ -735,7 +911,7 @@ subroutine pack28(c13,n28) n28=0 go to 900 endif - + if(c13(1:4).eq.'QRZ ') then n28=1 go to 900 @@ -748,74 +924,60 @@ subroutine pack28(c13,n28) if(c13(1:3).eq.'CQ_') then n=len(trim(c13)) - if(n.ge.4 .and. n.le.7) then - nlet=0 - nnum=0 - do i=4,n - c=c13(i:i) - if(c.ge.'A' .and. c.le.'Z') nlet=nlet+1 - if(c.ge.'0' .and. c.le.'9') nnum=nnum+1 - enddo - if(nnum.eq.3 .and. nlet.eq.0) then - read(c13(4:3+nnum),*) nqsy +! The modifier grammar (1-4 letters or exactly 3 digits) is owned by +! pack77_valid_cq_modifier; only the number-space arithmetic lives here. + if(n.ge.4 .and. pack77_valid_cq_modifier(c13(4:n))) then + if(pack77_all_digits(c13(4:n))) then + nqsy=100*(iachar(c13(4:4))-iachar('0')) + & + 10*(iachar(c13(5:5))-iachar('0')) + & + iachar(c13(6:6))-iachar('0') n28=3+nqsy go to 900 endif - if(nlet.ge.1 .and. nlet.le.4 .and. nnum.eq.0) then - c4=c13(4:n) - c4=adjustr(c4) - m=0 - do i=1,4 - j=0 - c=c4(i:i) - if(c.ge.'A' .and. c.le.'Z') j=ichar(c)-ichar('A')+1 - m=27*m + j - enddo - n28=3+1000+m - go to 900 - endif + c4=c13(4:n) + c4=adjustr(c4) + m=0 + do i=1,4 + j=0 + c=c4(i:i) + if(c.ge.'A' .and. c.le.'Z') j=ichar(c)-ichar('A')+1 + m=27*m + j + enddo + n28=3+1000+m + go to 900 endif endif ! Check for <...> callsign if(c13(1:1).eq.'<')then - call save_hash_call(c13,n10,n12,n22) !Save callsign in hash table + if(.not.pack77_valid_hash_call_token(c13)) then + n28=PACK77_NTOKENS + go to 900 + endif + call stage_hash_call(hash_facts,c13) i2=index(c13,'>') c13=c13(2:i2-1) n22=ihashcall(c13,22) - n28=NTOKENS + n22 + n28=PACK77_NTOKENS + n22 go to 900 endif ! Check for standard callsign - iarea=-1 - n=len(trim(c13)) - do i=n,2,-1 - if(is_digit(c13(i:i))) exit - enddo - iarea=i !Call-area digit - npdig=0 !Digits before call area - nplet=0 !Letters before call area - do i=1,iarea-1 - if(is_digit(c13(i:i))) npdig=npdig+1 - if(is_letter(c13(i:i))) nplet=nplet+1 - enddo - nslet=0 - do i=iarea+1,n - if(is_letter(c13(i:i))) nslet=nslet+1 - enddo - if(iarea.lt.2 .or. iarea.gt.3 .or. nplet.eq.0 .or. & - npdig.ge.iarea-1 .or. nslet.gt.3) then + if(.not.pack77_c28_standard_shape(c13)) then ! Treat this as a nonstandard callsign: compute its 22-bit hash - call save_hash_call(c13,n10,n12,n22) !Save callsign in hash table + call stage_hash_call(hash_facts,c13) n22=ihashcall(c13,22) - n28=NTOKENS + n22 + n28=PACK77_NTOKENS + n22 go to 900 endif - + n=len(trim(c13)) + do i=n,2,-1 + if(pack77_is_digit_char(c13(i:i))) exit + enddo + iarea=i ! This is a standard callsign - call save_hash_call(c13,n10,n12,n22) !Save callsign in hash table + call stage_hash_call(hash_facts,c13) if(iarea.eq.2) callsign=' '//c13(1:5) if(iarea.eq.3) callsign=c13(1:6) i1=index(a1,callsign(1:1))-1 @@ -824,19 +986,33 @@ subroutine pack28(c13,n28) i4=index(a4,callsign(4:4))-1 i5=index(a4,callsign(5:5))-1 i6=index(a4,callsign(6:6))-1 + if(i1.lt.0 .or. i2.lt.0 .or. i3.lt.0 .or. i4.lt.0 .or. & + i5.lt.0 .or. i6.lt.0) then + n22=ihashcall(c13,22) + n28=PACK77_NTOKENS + n22 + go to 900 + endif n28=36*10*27*27*27*i1 + 10*27*27*27*i2 + 27*27*27*i3 + 27*27*i4 + & 27*i5 + i6 - n28=n28 + NTOKENS + MAX22 + n28=n28 + PACK77_NTOKENS + PACK77_MAX22 900 n28=iand(n28,ishft(1,28)-1) return -end subroutine pack28 - +end subroutine pack28_core subroutine unpack28(n28_0,c13,success) + integer, intent(in) :: n28_0 + character*13 c13 + logical success + + call unpack28_core(n28_0,c13,success,.false.) + + return +end subroutine unpack28 - parameter (NTOKENS=2063592,MAX22=4194304) +subroutine unpack28_core(n28_0,c13,success,reject_two_digit_prefix) logical success,callok + logical, intent(in) :: reject_two_digit_prefix character*13 c13 character*37 c1 character*36 c2 @@ -849,7 +1025,7 @@ subroutine unpack28(n28_0,c13,success) success=.true. n28=n28_0 - if(n28.lt.NTOKENS) then + if(n28.lt.PACK77_NTOKENS) then ! Special tokens DE, QRZ, CQ, CQ_nnn, CQ_aaaa if(n28.eq.0) c13='DE ' if(n28.eq.1) c13='QRZ ' @@ -875,19 +1051,16 @@ subroutine unpack28(n28_0,c13,success) go to 900 endif endif - n28=n28-NTOKENS - if(n28.lt.MAX22) then + n28=n28-PACK77_NTOKENS + if(n28.lt.PACK77_MAX22) then ! This is a 22-bit hash of a callsign n22=n28 call hash22(n22,c13) !Retrieve callsign from hash table - if(c13.eq.'<...>') then - call hash22var(n22,c13,1) - endif go to 900 endif - + ! Standard callsign - n=n28 - MAX22 + n=n28 - PACK77_MAX22 i1=n/(36*10*27*27*27) n=n-36*10*27*27*27*i1 i2=n/(10*27*27*27) @@ -903,18 +1076,24 @@ subroutine unpack28(n28_0,c13,success) c13=adjustl(c13) if(.not.callok(trim(c13))) then + ! Keep the legacy placeholder text for callers that still inspect c13 + ! when success is false. c13='QU1RK' success=.false. endif 900 i0=index(c13,' ') - if(i0.ne.0 .and. i0.lt.len(trim(c13))) then + if((i0.ne.0 .and. i0.lt.len(trim(c13))) .or. & + (reject_two_digit_prefix .and. pack77_is_digit_char(c13(1:1)) .and. & + pack77_is_digit_char(c13(2:2)))) then + ! Keep the legacy placeholder text for callers that still inspect c13 + ! when success is false. c13='QU1RK' success=.false. endif return -end subroutine unpack28 +end subroutine unpack28_core subroutine split77(msg,nwords,nw,w) @@ -926,13 +1105,14 @@ subroutine split77(msg,nwords,nw,w) character*6 bcall_1 logical ok1 integer nw(19) - + iz=len(trim(msg)) j=0 k=0 n=0 c0=' ' w=' ' + nw=0 do i=1,iz if(ichar(msg(i:i)).eq.0) msg(i:i)=' ' c=msg(i:i) !Single character @@ -945,609 +1125,58 @@ subroutine split77(msg,nwords,nw,w) n=n+1 !Index in word if(c.ge.'a' .and. c.le.'z') c=char(ichar(c)-32) !Force upper case msg(j:j)=c - if(n.le.13) w(k)(n:n)=c !Copy character c into word + if(k.le.19) then + nw(k)=n + if(n.le.13) w(k)(n:n)=c !Copy character c into word + endif c0=c enddo iz=j !Message length nwords=k !Number of words in msg if(nwords.le.0) go to 900 - do i=1,nwords - nw(i)=len(trim(w(i))) + do i=1,min(nwords,19) + if(nw(i).le.13) nw(i)=len(trim(w(i))) enddo msg(iz+1:)=' ' if(nwords.lt.3) go to 900 call chkcall(w(3),bcall_1,ok1) - if(ok1 .and. w(1)(1:3).eq.'CQ ') then + if(ok1 .and. w(1)(1:3).eq.'CQ ' .and. & + pack77_valid_cq_modifier(w(2))) then w(1)='CQ_'//w(2)(1:10) !Make "CQ " into "CQ_" w(2:12)=w(3:13) !Move all remaining words down by one nwords=nwords-1 + do i=1,nwords + nw(i)=len(trim(w(i))) + enddo endif 900 return end subroutine split77 -subroutine pack77_01(nwords,w,i3,n3,c77) - -! Pack a Type 0.1 message: DXpedition mode -! Example message: "K1ABC RR73; W9XYZ -11" 28 28 10 5 - - character*13 w(19),c13 - character*77 c77 - character*6 bcall_1,bcall_2 - logical ok1,ok2 - - if(nwords.ne.5) go to 900 !Must have 5 words - if(trim(w(2)).ne.'RR73;') go to 900 !2nd word must be "RR73;" - if(w(4)(1:1).ne.'<') go to 900 !4th word must have <...> - if(index(w(4),'>').lt.1) go to 900 - n=-99 - read(w(5),*,err=1) n -1 if(n.eq.-99) go to 900 !5th word must be a valid report - n5=(n+30)/2 - if(n5.lt.0) n5=0 - if(n5.gt.31) n5=31 - call chkcall(w(1),bcall_1,ok1) - if(.not.ok1) go to 900 !1st word must be a valid basecall - call chkcall(w(3),bcall_2,ok2) - if(.not.ok2) go to 900 !3rd word must be a valid basecall - -! Type 0.1: K1ABC RR73; W9XYZ -11 28 28 10 5 71 - i3=0 - n3=1 - call pack28(w(1),n28a) - call pack28(w(3),n28b) - call save_hash_call(w(4),n10,n12,n22) - i2=index(w(4),'>') - c13=w(4)(2:i2-1) - n10=ihashcall(c13,10) - write(c77,1010) n28a,n28b,n10,n5,n3,i3 -1010 format(2b28.28,b10.10,b5.5,2b3.3) - -900 return -end subroutine pack77_01 - - -subroutine pack77_03(nwords,w,i3,n3,c77) +subroutine packtext77(c13,c71) -! Check 0.3 and 0.4 (ARRL Field Day exchange) -! Example message: WA9XYZ KA1ABC R 16A EMA 28 28 1 4 3 7 71 + character*13 c13,w + character*71 c71 + character*42 c + character*1 qa(10),qb(10) + data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+-./?'/ - parameter (NSEC=86) !Number of ARRL Sections - character*13 w(19) - character*77 c77 - character*6 bcall_1,bcall_2 - character*3 csec(NSEC) - logical ok1,ok2 - data csec/ & - "AB ","AK ","AL ","AR ","AZ ","BC ","CO ","CT ","DE ","EB ", & - "EMA","ENY","EPA","EWA","GA ","GH ","IA ","ID ","IL ","IN ", & - "KS ","KY ","LA ","LAX","NS ","MB ","MDC","ME ","MI ","MN ", & - "MO ","MS ","MT ","NC ","ND ","NE ","NFL","NH ","NL ","NLI", & - "NM ","NNJ","NNY","TER","NTX","NV ","OH ","OK ","ONE","ONN", & - "ONS","OR ","ORG","PAC","PR ","QC ","RI ","SB ","SC ","SCV", & - "SD ","SDG","SF ","SFL","SJV","SK ","SNJ","STX","SV ","TN ", & - "UT ","VA ","VI ","VT ","WCF","WI ","WMA","WNY","WPA","WTX", & - "WV ","WWA","WY ","DX ","PE ","NB "/ - - if(nwords.lt.4 .or. nwords.gt.5) return - call chkcall(w(1),bcall_1,ok1) - call chkcall(w(2),bcall_2,ok2) - if(.not.ok1 .or. .not.ok2) return - isec=-1 - do i=1,NSEC - if(csec(i).eq.w(nwords)(1:3)) then - isec=i - exit - endif + call mp_short_init + qa=char(0) + w=adjustr(c13) + do i=1,13 + j=index(c,w(i:i))-1 + if(j.lt.0) j=0 + call mp_short_mult(qb,qa(2:10),9,42) !qb(1:9)=42*qa(2:9) + call mp_short_add(qa,qb(2:10),9,j) !qa(1:9)=qb(2:9)+j enddo - if(isec.eq.-1) return - if(nwords.eq.5 .and. trim(w(3)).ne.'R') return - - ntx=-1 - j=len(trim(w(nwords-1)))-1 - read(w(nwords-1)(1:j),*,err=1,end=1) ntx !Number of transmitters -1 if(ntx.lt.1 .or. ntx.gt.32) return - nclass=ichar(w(nwords-1)(j+1:j+1))-ichar('A') - - m=len(trim(w(nwords))) !Length of section abbreviation - if(m.lt.2 .or. m.gt.3) return -! 0.3 WA9XYZ KA1ABC R 16A EMA 28 28 1 4 3 7 71 ARRL Field Day -! 0.4 WA9XYZ KA1ABC R 32A EMA 28 28 1 4 3 7 71 ARRL Field Day - - i3=0 - n3=3 !Type 0.3 ARRL Field Day - intx=ntx-1 - if(intx.ge.16) then - n3=4 !Type 0.4 ARRL Field Day - intx=ntx-17 - endif - call pack28(w(1),n28a) - call pack28(w(2),n28b) - ir=0 - if(w(3)(1:2).eq.'R ') ir=1 - write(c77,1010) n28a,n28b,ir,intx,nclass,isec,n3,i3 -1010 format(2b28.28,b1,b4.4,b3.3,b7.7,2b3.3) + write(c71,1010) qa(2:10) +1010 format(b7.7,8b8.8) return -end subroutine pack77_03 - - -subroutine pack77_06(nwords,w,i3,n3,c77,i3_hint,n3_hint) - - character*13 w(19) - character*77 c77 - character*6 bcall,grid6 - character*4 grid4 - character*1 c - character*36 a2 - data a2/'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/,nzzz/46656/ - - logical is_grid4,is_grid6,is_digit,ok - is_grid4(grid4)=len(trim(grid4)).eq.4 .and. & - grid4(1:1).ge.'A' .and. grid4(1:1).le.'R' .and. & - grid4(2:2).ge.'A' .and. grid4(2:2).le.'R' .and. & - grid4(3:3).ge.'0' .and. grid4(3:3).le.'9' .and. & - grid4(4:4).ge.'0' .and. grid4(4:4).le.'9' - - is_grid6(grid6)=(len(trim(grid6)).eq.6.or.len(trim(grid6)).eq.4).and. & - grid6(1:1).ge.'A' .and. grid6(1:1).le.'R' .and. & - grid6(2:2).ge.'A' .and. grid6(2:2).le.'R' .and. & - grid6(3:3).ge.'0' .and. grid6(3:3).le.'9' .and. & - grid6(4:4).ge.'0' .and. grid6(4:4).le.'9' .and. & - (len(trim(grid6)).eq.4.or. & - (grid6(5:5).ge.'A' .and. grid6(5:5).le.'X' .and. & - grid6(6:6).ge.'A' .and. grid6(6:6).le.'X')) - - is_digit(c)=c.ge.'0' .and. c.le.'9' - - m1=len(trim(w(1))) - m2=len(trim(w(2))) - m3=len(trim(w(3))) - if(nwords.eq.3 .and. m1.ge.3 .and. m1.le.6 .and. m2.eq.4 .and. m3.le.2) then -! WSPR Type 1 - if(.not.is_grid4(w(2)(1:4))) go to 900 - if(.not.is_digit(w(3)(1:1))) go to 900 - if(m3.eq.2) then - if(.not.is_digit(w(3)(2:2))) go to 900 - endif - i3=0 - n3=6 - call pack28(w(1),n28) - grid4=w(2)(1:4) - k1=(ichar(grid4(1:1))-ichar('A'))*18*10*10 - k2=(ichar(grid4(2:2))-ichar('A'))*10*10 - k3=(ichar(grid4(3:3))-ichar('0'))*10 - k4=(ichar(grid4(4:4))-ichar('0')) - igrid4=k1+k2+k3+k4 - read(w(3),*) idbm - if(idbm.lt.0) idbm=0 - if(idbm.gt.60) idbm=60 - idbm=nint(0.3*idbm) - write(c77,1010) n28,igrid4,idbm,0,0,0,n3,i3 -1010 format(b28.28,b15.15,b5.5,2i1,b21.21,2b3.3) - go to 900 - endif - if(nwords.eq.2 .and. m1.ge.5 .and. m1.le.10 .and. m2.le.2) then -! WSPR Type 2 - i1=index(w(1),'/') - if(i1.lt.2 .or. i1.eq.m1) go to 900 - if(.not.is_digit(w(2)(1:1))) go to 900 - if(i1.eq.(m1-3) .and. .not.is_digit(w(1)(m1:m1))) go to 900 - if(m2.eq.2) then - if(.not.is_digit(w(2)(2:2))) go to 900 - endif - call chkcall(w(1),bcall,ok) - if(.not.ok) go to 900 - if(i1.le.4) then -! We have a prefix - npfx=index(a2,w(1)(1:1))-1 - if(i1.ge.3) npfx=36*npfx + index(a2,w(1)(2:2))-1 - if(i1.eq.4) npfx=36*npfx + index(a2,w(1)(3:3))-1 - else -! We have a suffix - if((m1-i1).eq.1) npfx=index(a2,w(1)(i1+1:i1+1))-1 - if((m1-i1).eq.2) npfx=36*(index(a2,w(1)(i1+1:i1+1))-1) + & - index(a2,w(1)(i1+2:i1+2))-1 - if((m1-i1).eq.3) then -! Third character of a suffix must be a digit - if(.not.is_digit(w(1)(i1+3:i1+3))) go to 900 - npfx=36*10*(index(a2,w(1)(i1+1:i1+1))-1) + & - 10*(index(a2,w(1)(i1+2:i1+2))-1) + index(a2,w(1)(i1+3:i1+3))-1 - endif - npfx=npfx + nzzz - endif - i3=0 - n3=6 - call pack28(bcall//' ',n28) - read(w(2),*) idbm - if(idbm.lt.0) idbm=0 - if(idbm.gt.60) idbm=60 - idbm=nint(0.3*idbm) - write(c77,1020) n28,npfx,idbm,1,0,n3,i3 -1020 format(b28.28,b16.16,b5.5,i1,b21.21,2b3.3) - go to 900 - endif - - if(i3_hint.eq.0.and.n3_hint.eq.6.and.nwords.eq.2 .and. m1.ge.5 & - .and. m1.le.12 .and. m2.le.6) then -! WSPR Type 3 - - !n3_hint=6 and i3_hint=0 is a hint that the caller wanted a - !50-bit encoding rather than the possible alternative n3=4 77-bit - !encoding - if(index(w(1),'<').lt.1 .or. index(w(1),'>').lt.1) go to 900 - grid6=w(2)(1:6) - if(.not.is_grid6(grid6)) go to 900 - i3=0 - n3=6 - call pack28(w(1),n28) - n22=n28-2063592 - k1=(ichar(grid6(1:1))-ichar('A'))*18*10*10*25*25 - k2=(ichar(grid6(2:2))-ichar('A'))*10*10*25*25 - k3=(ichar(grid6(3:3))-ichar('0'))*10*25*25 - k4=(ichar(grid6(4:4))-ichar('0'))*25*25 - if (grid6(5:6).eq.' ') then - igrid6=k1+k2+k3+k4+24*25+24 - else - k5=(ichar(grid6(5:5))-ichar('A'))*25 - k6=(ichar(grid6(6:6))-ichar('A')) - igrid6=k1+k2+k3+k4+k5+k6 - endif - write(c77,1030) n22,igrid6,2,0,n3,i3 -1030 format(b22.22,b25.25,b3.3,b21.21,2b3.3) - endif - -900 return -end subroutine pack77_06 - - -subroutine pack77_1(nwords,w,i3,n3,c77) - -! Check Type 1 (Standard 77-bit message) and Type 2 (ditto, with a "/P" call) -! Example message: WA9XYZ/R KA1ABC/R R FN42 28 1 28 1 1 15 74 - - parameter (MAXGRID4=32400) - character*13 w(19),c13 - character*77 c77 - character*6 bcall_1,bcall_2 - character*4 grid4 - character c1*1,c2*2 - logical is_grid4 - logical ok1,ok2 - is_grid4(grid4)=len(trim(grid4)).eq.4 .and. & - grid4(1:1).ge.'A' .and. grid4(1:1).le.'R' .and. & - grid4(2:2).ge.'A' .and. grid4(2:2).le.'R' .and. & - grid4(3:3).ge.'0' .and. grid4(3:3).le.'9' .and. & - grid4(4:4).ge.'0' .and. grid4(4:4).le.'9' - - if(nwords.lt.2 .or. nwords.gt.4) return - call chkcall(w(1),bcall_1,ok1) - call chkcall(w(2),bcall_2,ok2) - if(w(1)(1:3).eq.'DE ' .or. w(1)(1:3).eq.'CQ_' .or. w(1)(1:3).eq.'CQ ' .or. & - w(1)(1:4).eq.'QRZ ') ok1=.true. - if(w(1)(1:1).eq.'<' .and. index(w(1),'>').ge.5) ok1=.true. - if(w(2)(1:1).eq.'<' .and. index(w(2),'>').ge.5) ok2=.true. - if(.not.ok1 .or. .not.ok2) return - if(w(1)(1:1).eq.'<' .and. index(w(2),'/').gt.0) return - if(w(2)(1:1).eq.'<' .and. index(w(1),'/').gt.0) return - if(nwords.eq.2 .and. (.not.ok2 .or. index(w(2),'/').ge.2)) return - if(nwords.eq.2) go to 10 - - c1=w(nwords)(1:1) - c2=w(nwords)(1:2) - if(.not.is_grid4(w(nwords)(1:4)) .and. c1.ne.'+' .and. c1.ne.'-' & - .and. c2.ne.'R+' .and. c2.ne.'R-' .and. trim(w(nwords)).ne.'RRR' .and. & - trim(w(nwords)).ne.'RR73' .and. trim(w(nwords)).ne.'73') return - if(c1.eq.'+' .or. c1.eq.'-') then - ir=0 - read(w(nwords),*,err=900) irpt - if(irpt.ge.-50 .and. irpt.le.-31) irpt=irpt+101 - irpt=irpt+35 - else if(c2.eq.'R+' .or. c2.eq.'R-') then - ir=1 - read(w(nwords)(2:),*,err=900) irpt - if(irpt.ge.-50 .and. irpt.le.-31) irpt=irpt+101 - irpt=irpt+35 - else if(trim(w(nwords)).eq.'RRR') then - ir=0 - irpt=2 - else if(trim(w(nwords)).eq.'RR73') then - ir=0 - irpt=3 - else if(trim(w(nwords)).eq.'73') then - ir=0 - irpt=4 - endif - -! 1 WA9XYZ/R KA1ABC/R R FN42 28 1 28 1 1 15 74 Standard msg -! 2 PA3XYZ/P GM4ABC/P R JO22 28 1 28 1 1 15 74 EU VHF contest - -10 i1psuffix=index(w(1)//' ' ,'/P ') - i2psuffix=index(w(2)//' ','/P ') - if(nwords.eq.2 .or. nwords.eq.3 .or. (nwords.eq.4 .and. & - w(3)(1:2).eq.'R ')) then - n3=0 - i3=1 !Type 1: Standard message, possibly with "/R" - if (i1psuffix.ge.4.or.i2psuffix.ge.4) i3=2 !Type 2, with "/P" - endif - c13=bcall_1 - if(c13(1:3).eq.'CQ_' .or. w(1)(1:1).eq.'<') c13=w(1) - call pack28(c13,n28a) - c13=bcall_2 - if(w(2)(1:1).eq.'<') c13=w(2) - call pack28(c13,n28b) - ipa=0 - ipb=0 - if(i1psuffix.ge.4.or.index(w(1)//' ','/R ').ge.4) ipa=1 - if(i2psuffix.ge.4.or.index(w(2)//' ','/R ').ge.4) ipb=1 - - grid4=w(nwords)(1:4) - if(is_grid4(grid4)) then - ir=0 - if(w(3).eq.'R ') ir=1 - j1=(ichar(grid4(1:1))-ichar('A'))*18*10*10 - j2=(ichar(grid4(2:2))-ichar('A'))*10*10 - j3=(ichar(grid4(3:3))-ichar('0'))*10 - j4=(ichar(grid4(4:4))-ichar('0')) - igrid4=j1+j2+j3+j4 - else - igrid4=MAXGRID4 + irpt - endif - if(nwords.eq.2) then - ir=0 - irpt=1 - igrid4=MAXGRID4+irpt - endif - write(c77,1000) n28a,ipa,n28b,ipb,ir,igrid4,i3 -1000 format(2(b28.28,b1),b1,b15.15,b3.3) - return - -900 return -end subroutine pack77_1 - - -subroutine pack77_3(nwords,w,i3,n3,c77) - -! Check Type 3 (ARRL RTTY contest exchange) -! ARRL RTTY - US/Can: rpt state/prov R 579 MA -! - DX: rpt serial R 559 0013 -! Example message: TU; W9XYZ K1ABC R 579 MA 1 28 28 1 3 13 74 - - parameter (NUSCAN=171) !Number of US states and Canadian provinces/territories - character*13 w(19) - character*77 c77 - character*6 bcall_1,bcall_2 - character*3 cmult(NUSCAN),mult - character crpt*3 - logical ok1,ok2 - data cmult/ & - "AL ","AK ","AZ ","AR ","CA ","CO ","CT ","DE ","FL ","GA ", & - "HI ","ID ","IL ","IN ","IA ","KS ","KY ","LA ","ME ","MD ", & - "MA ","MI ","MN ","MS ","MO ","MT ","NE ","NV ","NH ","NJ ", & - "NM ","NY ","NC ","ND ","OH ","OK ","OR ","PA ","RI ","SC ", & - "SD ","TN ","TX ","UT ","VT ","VA ","WA ","WV ","WI ","WY ", & - "NB ","NS ","QC ","ON ","MB ","SK ","AB ","BC ","NWT","NF ", & - "LB ","NU ","YT ","PEI","DC ","DR ","FR ","GD ","GR ","OV ", & - "ZH ","ZL ","X01","X02","X03","X04","X05","X06","X07","X08", & - "X09","X10","X11","X12","X13","X14","X15","X16","X17","X18", & - "X19","X20","X21","X22","X23","X24","X25","X26","X27","X28", & - "X29","X30","X31","X32","X33","X34","X35","X36","X37","X38", & - "X39","X40","X41","X42","X43","X44","X45","X46","X47","X48", & - "X49","X50","X51","X52","X53","X54","X55","X56","X57","X58", & - "X59","X60","X61","X62","X63","X64","X65","X66","X67","X68", & - "X69","X70","X71","X72","X73","X74","X75","X76","X77","X78", & - "X79","X80","X81","X82","X83","X84","X85","X86","X87","X88", & - "X89","X90","X91","X92","X93","X94","X95","X96","X97","X98", & - "X99"/ - - if(w(1)(1:1).eq.'<' .and. w(2)(1:1).eq.'<') go to 900 - if(nwords.eq.4 .or. nwords.eq.5 .or. nwords.eq.6) then - i1=1 - if(trim(w(1)).eq.'TU;') i1=2 - call chkcall(w(i1),bcall_1,ok1) - call chkcall(w(i1+1),bcall_2,ok2) - if(.not.ok1 .or. .not.ok2) go to 900 - crpt=w(nwords-1)(1:3) - if(index(crpt,'-').ge.1 .or. index(crpt,'+').ge.1) go to 900 - if(crpt(1:1).eq.'5' .and. crpt(2:2).ge.'2' .and. crpt(2:2).le.'9' .and. & - crpt(3:3).eq.'9') then - nserial=0 - read(w(nwords),*,err=1) nserial - endif -1 mult=' ' - imult=-1 - do i=1,NUSCAN - if(cmult(i).eq.w(nwords)) then - imult=i - mult=cmult(i) - exit - endif - enddo - nexch=0 - if(nserial.gt.0) nexch=nserial - if(imult.gt.0) nexch=8000+imult - if(mult.ne.' ' .or. nserial.gt.0) then - i3=3 - n3=0 - itu=0 - if(trim(w(1)).eq.'TU;') itu=1 - call pack28(w(1+itu),n28a) - call pack28(w(2+itu),n28b) - ir=0 - if(w(3+itu)(1:2).eq.'R ') ir=1 - read(w(3+itu+ir),*,err=900) irpt - irpt=(irpt-509)/10 - 2 - if(irpt.lt.0) irpt=0 - if(irpt.gt.7) irpt=7 -! 3 TU; W9XYZ K1ABC R 579 MA 1 28 28 1 3 13 74 ARRL RTTY contest -! 3 TU; W9XYZ G8ABC R 559 0013 1 28 28 1 3 13 74 ARRL RTTY (DX) - write(c77,1010) itu,n28a,n28b,ir,irpt,nexch,i3 -1010 format(b1,2b28.28,b1,b3.3,b13.13,b3.3) - endif - endif - -900 return -end subroutine pack77_3 - - -subroutine pack77_4(nwords,w,i3,n3,c77) - -! Check Type 4 (One nonstandard call and one hashed call) -! Example message: PJ4/KA1ABC RR73 12 58 1 2 1 74 - - integer*8 n58 - logical ok1,ok2 - character*13 w(19) - character*77 c77 - character*13 call_1,call_2 - character*11 c11 - character*6 bcall_1,bcall_2 - character*38 c - data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/'/ - - iflip=0 - i3=-1 - if(nwords.eq.2 .or. nwords.eq.3) then - call_1=w(1) - if(call_1(1:1).eq.'<') call_1=w(1)(2:len(trim(w(1)))-1) - call_2=w(2) - if(call_2(1:1).eq.'<') call_2=w(2)(2:len(trim(w(2)))-1) - call chkcall(call_1,bcall_1,ok1) - call chkcall(call_2,bcall_2,ok2) - if(call_1.eq.bcall_1 .and. call_2.eq.bcall_2 .and. ok1 .and. ok2) go to 900 - icq=0 - if(trim(w(1)).eq.'CQ' .or. (ok1.and.ok2)) then - if(trim(w(1)).eq.'CQ' .and. len(trim(w(2))).le.4) go to 900 - i3=4 - n3=0 - if(trim(w(1)).eq.'CQ') icq=1 - endif - - if(icq.eq.1) then - iflip=0 - n12=0 - c11=adjustr(call_2(1:11)) - call save_hash_call(w(2),n10,n12,n22) - else if(w(1)(1:1).eq.'<') then - iflip=0 - i3=4 - call save_hash_call(w(1),n10,n12,n22) - c11=adjustr(call_2(1:11)) - else if(w(2)(1:1).eq.'<') then - iflip=1 - i3=4 - call save_hash_call(w(2),n10,n12,n22) - c11=adjustr(call_1(1:11)) - endif - n58=0 - do i=1,11 - n58=n58*38 + index(c,c11(i:i)) - 1 - enddo - nrpt=0 - if(trim(w(3)).eq.'RRR') nrpt=1 - if(trim(w(3)).eq.'RR73') nrpt=2 - if(trim(w(3)).eq.'73') nrpt=3 - if(icq.eq.1) then - iflip=0 - nrpt=0 - endif - write(c77,1010) n12,n58,iflip,nrpt,icq,i3 -1010 format(b12.12,b58.58,b1,b2.2,b1,b3.3) - do i=1,77 - if(c77(i:i).eq.'*') c77(i:i)='0' !### Clean up any illegal chars ### - enddo - endif - -900 return -end subroutine pack77_4 - -subroutine pack77_5(nwords,w,i3,n3,c77) - -! Pack a Type 0.2 message: EU VHF Contest mode -! Example message: PA3XYZ/P R 590003 IO91NP 28 1 1 3 12 25 -! R 590003 IO91NP h10 h20 r1 s3 s12 g25 - - character*13 w(19),c13 - character*77 c77 - character*6 grid6 - logical is_grid6 - - is_grid6(grid6)=len(trim(grid6)).eq.6 .and. & - grid6(1:1).ge.'A' .and. grid6(1:1).le.'R' .and. & - grid6(2:2).ge.'A' .and. grid6(2:2).le.'R' .and. & - grid6(3:3).ge.'0' .and. grid6(3:3).le.'9' .and. & - grid6(4:4).ge.'0' .and. grid6(4:4).le.'9' .and. & - grid6(5:5).ge.'A' .and. grid6(5:5).le.'X' .and. & - grid6(6:6).ge.'A' .and. grid6(6:6).le.'X' - - if(nwords.lt.4 .or. nwords.gt.5) return !nwords must be 4 or 5 - if(w(1)(1:1).ne.'<' .or. w(2)(1:1).ne.'<') return !Both calls must be hashed - nx=-1 - read(w(nwords-1),*,err=2) nx -2 if(nx.lt.520001 .or. nx.gt.594095) return !Exchange between 520001 - 594095 - if(.not.is_grid6(w(nwords)(1:6))) return !Last word must be a valid grid6 - -! Type 0.2: R 590003 IO91NP h10 h20 r1 s3 s12 g25 - - i3=5 - n3=0 - - call save_hash_call(w(1),n10,n12,n22) - i2=index(w(1),'>') - c13=w(1)(2:i2-1) - n12=ihashcall(c13,12) - - call save_hash_call(w(2),n10a,n12a,n22) - i2=index(w(2),'>') - c13=w(2)(2:i2-1) - n22=ihashcall(c13,22) - - ir=0 - if(w(3)(1:2).eq.'R ') ir=1 - irpt=nx/10000 - 52 - iserial=mod(nx,10000) - if(iserial.gt.2047) iserial=2047 - grid6=w(nwords)(1:6) - j1=(ichar(grid6(1:1))-ichar('A'))*18*10*10*24*24 - j2=(ichar(grid6(2:2))-ichar('A'))*10*10*24*24 - j3=(ichar(grid6(3:3))-ichar('0'))*10*24*24 - j4=(ichar(grid6(4:4))-ichar('0'))*24*24 - j5=(ichar(grid6(5:5))-ichar('A'))*24 - j6=(ichar(grid6(6:6))-ichar('A')) - igrid6=j1+j2+j3+j4+j5+j6 - - write(c77,1010) n12,n22,ir,irpt,iserial,igrid6,i3 -1010 format(b12.12,b22.22,b1,b3.3,b11.11,b25.25,b3.3) - - return -end subroutine pack77_5 - - -subroutine packtext77(c13,c71) - - character*13 c13,w - character*71 c71 - character*42 c - character*1 qa(10),qb(10) - data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+-./?'/ - - call mp_short_init - qa=char(0) - w=adjustr(c13) - do i=1,13 - j=index(c,w(i:i))-1 - if(j.lt.0) j=0 - call mp_short_mult(qb,qa(2:10),9,42) !qb(1:9)=42*qa(2:9) - call mp_short_add(qa,qb(2:10),9,j) !qa(1:9)=qb(2:9)+j - enddo - - write(c71,1010) qa(2:10) -1010 format(b7.7,8b8.8) - - return -end subroutine packtext77 +end subroutine packtext77 subroutine unpacktext77(c71,c13) @@ -1572,14 +1201,13 @@ subroutine unpacktext77(c71,c13) return end subroutine unpacktext77 -subroutine mp_short_ops(w,u) +subroutine mp_short_init character*1 w(*),u(*) integer i,ireg,j,n,ir,iv,ii1,ii2 character*1 creg(4) save ii1,ii2 equivalence (ireg,creg) - entry mp_short_init ireg=256*ichar('2')+ichar('1') do j=1,4 if (creg(j).eq.'1') ii1=j @@ -1613,9 +1241,9 @@ subroutine mp_short_ops(w,u) ir=mod(i,iv) enddo return - + return -end subroutine mp_short_ops +end subroutine mp_short_init subroutine add_call_to_recent_calls(callsign) @@ -1635,1817 +1263,1175 @@ subroutine add_call_to_recent_calls(callsign) recent_calls(1)=callsign endif -! Make sure that callsign is hashed -! call save_hash_call(callsign,n10,n12,n22) ! commented out - do this in the calling routine: +! Recent-call ordering is separate from hash storage; decode paths stage both +! effects explicitly when a call should become recent and hash-resolvable. return end subroutine add_call_to_recent_calls -subroutine to_grid4(n,grid4,ok) - character*4 grid4 - logical ok - - ok=.false. - j1=n/(18*10*10) - if (j1.lt.0.or.j1.gt.17) goto 900 - n=n-j1*18*10*10 - j2=n/(10*10) - if (j2.lt.0.or.j2.gt.17) goto 900 - n=n-j2*10*10 - j3=n/10 - if (j3.lt.0.or.j3.gt.9) goto 900 - j4=n-j3*10 - if (j4.lt.0.or.j4.gt.9) goto 900 - grid4(1:1)=char(j1+ichar('A')) - grid4(2:2)=char(j2+ichar('A')) - grid4(3:3)=char(j3+ichar('0')) - grid4(4:4)=char(j4+ichar('0')) - ok=.true. - -900 return -end subroutine to_grid4 - -subroutine to_grid6(n,grid6,ok) - character*6 grid6 - logical ok - - ok=.false. - j1=n/(18*10*10*24*24) - if (j1.lt.0.or.j1.gt.17) goto 900 - n=n-j1*18*10*10*24*24 - j2=n/(10*10*24*24) - if (j2.lt.0.or.j2.gt.17) goto 900 - n=n-j2*10*10*24*24 - j3=n/(10*24*24) - if (j3.lt.0.or.j3.gt.9) goto 900 - n=n-j3*10*24*24 - j4=n/(24*24) - if (j4.lt.0.or.j4.gt.9) goto 900 - n=n-j4*24*24 - j5=n/24 - if (j5.lt.0.or.j5.gt.23) goto 900 - j6=n-j5*24 - if (j6.lt.0.or.j6.gt.23) goto 900 - grid6(1:1)=char(j1+ichar('A')) - grid6(2:2)=char(j2+ichar('A')) - grid6(3:3)=char(j3+ichar('0')) - grid6(4:4)=char(j4+ichar('0')) - grid6(5:5)=char(j5+ichar('A')) - grid6(6:6)=char(j6+ichar('A')) - ok=.true. - -900 return -end subroutine to_grid6 - -subroutine to_grid(n,grid6,ok) - ! 4-, or 6-character grid - character*6 grid6 - logical ok - - ok=.false. - j1=n/(18*10*10*25*25) - if (j1.lt.0.or.j1.gt.17) goto 900 - n=n-j1*18*10*10*25*25 - j2=n/(10*10*25*25) - if (j2.lt.0.or.j2.gt.17) goto 900 - n=n-j2*10*10*25*25 - j3=n/(10*25*25) - if (j3.lt.0.or.j3.gt.9) goto 900 - n=n-j3*10*25*25 - j4=n/(25*25) - if (j4.lt.0.or.j4.gt.9) goto 900 - n=n-j4*25*25 - j5=n/25 - if (j5.lt.0.or.j5.gt.24) goto 900 - j6=n-j5*25 - if (j6.lt.0.or.j6.gt.24) goto 900 - grid6='' - grid6(1:1)=char(j1+ichar('A')) - grid6(2:2)=char(j2+ichar('A')) - grid6(3:3)=char(j3+ichar('0')) - grid6(4:4)=char(j4+ichar('0')) - if (j5.ne.24.or.j6.ne.24) then - grid6(5:5)=char(j5+ichar('A')) - grid6(6:6)=char(j6+ichar('A')) - endif - ok=.true. - -900 return -end subroutine to_grid - -subroutine hash10var(n10,c13,nthr) +subroutine queue_hash_call_for_thread(c13,nthr) character*13 c13 integer, intent(in) :: nthr - c13='<...>' - if(n10.lt.0 .or. n10.gt.1023) return - if(nthr.gt.25) then ! TX message - if(len(trim(txcalls10var(n10))).gt.0) then - c13=txcalls10var(n10) - c13='<'//trim(c13)//'>' - endif - else - if(len(trim(calls10var(n10))).gt.0) then - c13=calls10var(n10) - c13='<'//trim(c13)//'>' - endif - endif - return - -end subroutine hash10var +! Configured/var decode workers queue hash facts; fillhashvar later folds them +! into the shared calls10/calls12/calls22 tables. + call queue_call_for_thread(c13,nthr,queued_calls_by_thread, & + nqueued_calls_by_thread) -subroutine hash12var(n12,c13,nthr) + return +end subroutine queue_hash_call_for_thread +subroutine queue_recent_call_for_thread(c13,nthr) character*13 c13 integer, intent(in) :: nthr - - c13='<...>' - if(n12.lt.0 .or. n12.gt.4095) return - if(nthr.gt.25) then ! TX message - if(len(trim(txcalls12var(n12))).gt.0) then - c13=txcalls12var(n12) - c13='<'//trim(c13)//'>' - endif - else - if(len(trim(calls12var(n12))).gt.0) then - c13=calls12var(n12) - c13='<'//trim(c13)//'>' - endif - endif - return -end subroutine hash12var + call queue_call_for_thread(c13,nthr,queued_recent_calls_by_thread, & + nqueued_recent_calls_by_thread) -subroutine hash22var(n22,c13,nthr) + return +end subroutine queue_recent_call_for_thread - character*13 c13 +subroutine queue_call_for_thread(c13,nthr,queued_calls,nqueued_calls) + character(len=*), intent(in) :: c13 integer, intent(in) :: nthr - - c13='<...>' - if(nthr.gt.25) then ! TX message - do i=1,nztxhashvar - if(itxhash22var(i).eq.n22) then - c13=txcalls22var(i) - c13='<'//trim(c13)//'>' - go to 900 - endif - enddo - else - do i=1,nzhashvar - if(ihash22var(i).eq.n22) then - c13=calls22var(i) - c13='<'//trim(c13)//'>' - go to 900 - endif - enddo + character(len=13), intent(inout) :: queued_calls(:) + integer, intent(inout) :: nqueued_calls(:) + character*13 cw + + if(nthr.lt.1 .or. nthr.gt.24) return + cw=c13 + if(cw(1:1).eq.' ' .or. cw(1:5).eq.'<...>') return + if(cw(1:1).eq.'<') cw=cw(2:) + i=index(cw,'>') + if(i.gt.0) cw(i:)=' ' + if(len(trim(cw)) .lt. 3) return + + nposition=thread_call_index(nthr)+nqueued_calls(nthr) + if(nposition.lt.thread_call_index(nthr+1)) then + nqueued_calls(nthr)=nqueued_calls(nthr)+1 + queued_calls(nposition+1)=cw endif -900 return -end subroutine hash22var + return +end subroutine queue_call_for_thread -integer function ihashcallvar(c0,m) - implicit none +subroutine fold_queued_recent_calls(numthreads) - character(len=13), intent(in) :: c0 - integer, intent(in) :: m - integer(kind=8) :: n8 - integer :: i,j - character*38 :: c - data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/'/ + integer, intent(in) :: numthreads + character*13 cw - n8=0_8 - do i=1,11 - j=index(c,c0(i:i)) - 1 - n8=38_8*n8 + j + do i=1,numthreads + do m=1,nqueued_recent_calls_by_thread(i) + nposition=thread_call_index(i)+m + cw=queued_recent_calls_by_thread(nposition) + call add_call_to_recent_calls(cw) + enddo enddo - ihashcallvar=ihashcall_from_n8(n8,m) return -end function ihashcallvar +end subroutine fold_queued_recent_calls -subroutine save_hash_mycallvar(c13,n10,n12,n22) +subroutine sync_configured_calls_for_decode_start() - character*13 c13,cw +! Capture the operator-configured calls at decode-cycle boundaries. These +! hashes let configured decodes resolve hash-only messages without a separate +! var hash table. + if(mycall13.ne.mycall13_configured_prev) then + if(len(trim(mycall13)).gt.2) then + call set_configured_mycall_from_current() + else + call clear_configured_mycall() + endif + endif + call sync_configured_mycall_value_from_current() - cw=c13 - if(cw(1:1).eq.' ' .or. cw(1:5).eq.'<...>') return - if(cw(1:1).eq.'<') cw=cw(2:) - i=index(cw,'>') - if(i.gt.0) cw(i:)=' ' - if(len(trim(cw)) .lt. 3) return + if(dxcall13.ne.dxcall13_configured_prev) then + if(len(trim(dxcall13)).gt.2) then + call set_configured_dxcall_from_current() + else + call clear_configured_dxcall() + endif + endif + call sync_configured_dxcall_value_from_current() - n12=ihashcallvar(cw,12) - if(n12.ge.0 .and. n12 .le. 4095 .and. cw.ne.mycall13var) calls12var(n12)=cw + return +end subroutine sync_configured_calls_for_decode_start - n10=ihashcallvar(cw,10) - if(n10.ge.0 .and. n10 .le. 1023 .and. cw.ne.mycall13var) calls10var(n10)=cw +subroutine set_configured_mycall_from_current() - n22=ihashcallvar(cw,22) - if(any(ihash22var.eq.n22)) then ! If entry exists, make sure callsign is the most recently received one - where(ihash22var.eq.n22) calls22var=cw - go to 1900 - endif + mycall13_configured_set=.true. + mycall13_configured=mycall13 + mycall13_configured_prev=mycall13 + hashmy10_configured=ihashcall(mycall13,10) + hashmy12_configured=ihashcall(mycall13,12) + hashmy22_configured=ihashcall(mycall13,22) + call save_hash_call(mycall13,ndum10,ndum12,ndum22) -! New entry: move table down, making room for new one at the top - ihash22var(nzhashvar:2:-1)=ihash22var(nzhashvar-1:1:-1) + return +end subroutine set_configured_mycall_from_current -! Add the new entry - calls22var(nzhashvar:2:-1)=calls22var(nzhashvar-1:1:-1) - ihash22var(1)=n22 - calls22var(1)=cw - if(nzhashvar.lt.MAXHASHvar) nzhashvar=nzhashvar+1 +subroutine clear_configured_mycall() -1900 continue + mycall13_configured_set=.false. + mycall13_configured=' ' + mycall13_configured_prev=' ' + hashmy10_configured=-1 + hashmy12_configured=-1 + hashmy22_configured=-1 - return -end subroutine save_hash_mycallvar + return +end subroutine clear_configured_mycall -subroutine save_hash_txcallvar(c13,n10,n12,n22,lhashit) +subroutine sync_configured_mycall_value_from_current() - character*13 c13,cw - logical, intent(in) :: lhashit + if(mycall13_configured_set) mycall13_configured=mycall13 - cw=c13 - if(cw(1:1).eq.' ' .or. cw(1:5).eq.'<...>') return - if(cw(1:1).eq.'<') cw=cw(2:) - i=index(cw,'>') - if(i.gt.0) cw(i:)=' ' - - if(len(trim(cw)) .lt. 3) return + return +end subroutine sync_configured_mycall_value_from_current - n12=ihashcallvar(cw,12) +subroutine set_configured_dxcall_from_current() - if(lhashit) then - if(n12.ge.0 .and. n12 .le. 4095 .and. cw.ne.mycall13var) txcalls12var(n12)=cw + dxcall13_configured_set=.true. + dxcall13_configured=dxcall13 + dxcall13_configured_prev=dxcall13 + hashdx10_configured=ihashcall(dxcall13,10) + ! Seed the manual DX Call before decode so first-cycle hash references to it + ! can resolve even if the call has not yet been decoded over the air. + call queue_hash_call_for_thread(dxcall13,1) - n10=ihashcallvar(cw,10) - if(n10.ge.0 .and. n10 .le. 1023 .and. cw.ne.mycall13var) txcalls10var(n10)=cw + return +end subroutine set_configured_dxcall_from_current - n22=ihashcallvar(cw,22) - if(any(itxhash22var.eq.n22)) then ! If entry exists, make sure callsign is the most recently received one - where(itxhash22var.eq.n22) txcalls22var=cw - go to 1900 - endif +subroutine clear_configured_dxcall() -! New entry: move table down, making room for new one at the top - itxhash22var(nztxhashvar:2:-1)=itxhash22var(nztxhashvar-1:1:-1) + dxcall13_configured_set=.false. + dxcall13_configured=' ' + dxcall13_configured_prev=' ' + hashdx10_configured=-1 -! Add the new entry - txcalls22var(nztxhashvar:2:-1)=txcalls22var(nztxhashvar-1:1:-1) - itxhash22var(1)=n22 - txcalls22var(1)=cw - if(nztxhashvar.lt.MAXTXHASHvar) nztxhashvar=nztxhashvar+1 + return +end subroutine clear_configured_dxcall -1900 continue - endif +subroutine sync_configured_dxcall_value_from_current() - return -end subroutine save_hash_txcallvar + if(dxcall13_configured_set) dxcall13_configured=dxcall13 -subroutine save_hash_callvar(c13,nthr) + return +end subroutine sync_configured_dxcall_value_from_current - character*13 c13,cw - integer, intent(in) :: nthr +type(configured_decode_state) function current_configured_decode_state() & + result(state) - if(nthr.gt.24) return - cw=c13 - if(cw(1:1).eq.' ' .or. cw(1:5).eq.'<...>') return - if(cw(1:1).eq.'<') cw=cw(2:) - i=index(cw,'>') - if(i.gt.0) cw(i:)=' ' - if(len(trim(cw)) .lt. 3) return + state%mycall_set=mycall13_configured_set + state%dxcall_set=dxcall13_configured_set + state%mycall=mycall13_configured + state%dxcall=dxcall13_configured + state%hashmy10=hashmy10_configured + state%hashmy12=hashmy12_configured + state%hashmy22=hashmy22_configured + state%hashdx10=hashdx10_configured - nposition=nthrindexvar(nthr)+nlast_callsvar(nthr) - if(nposition.lt.nthrindexvar(nthr+1)) then - nlast_callsvar(nthr)=nlast_callsvar(nthr)+1 - last_callsvar(nposition+1)=cw - endif + return +end function current_configured_decode_state + +type(unpack77_context) function configured_unpack77_context(nrx) result(context) + integer, intent(in) :: nrx + type(configured_decode_state) :: state + + state=current_configured_decode_state() + context%nrx=nrx + context%configured=.true. + context%strict_var_guards=.true. + context%mycall_set=state%mycall_set + context%dxcall_set=state%dxcall_set + context%mycall=state%mycall + context%dxcall=state%dxcall + context%hashmy10=state%hashmy10 + context%hashmy12=state%hashmy12 + context%hashmy22=state%hashmy22 + context%hashdx10=state%hashdx10 +end function configured_unpack77_context + +type(unpack77_effect_policy) function configured_unpack77_effect_policy(options) & + result(policy) + type(unpack77_options), intent(in) :: options + + policy=unpack77_effect_policy(queue_by_thread=.true., & + nthr_hash=options%thread_index,nthr_recent=options%thread_index) + policy%record_hashes=options%record_hashes + policy%record_recent_calls=options%record_recent_calls +end function configured_unpack77_effect_policy + +subroutine unpack77_configured(c77,nrx,msg,unpk77_successvar,options) + character*77 c77 + character*37 msg + integer, intent(in) :: nrx + logical unpk77_successvar + type(unpack77_options), intent(in) :: options + type(unpack77_context) :: context + type(unpack77_effect_policy) :: policy - return -end subroutine save_hash_callvar + context=configured_unpack77_context(nrx) + policy=configured_unpack77_effect_policy(options) + call run_unpack77(c77,context,policy,msg,unpk77_successvar) -subroutine pack77var(msg0,i3,n3,c77,ntxhash) + return +end subroutine unpack77_configured - use packjt - character*37 msg,msg0 - character*18 c18 - character*13 w(19) +subroutine run_unpack77(c77,context,policy,msg,unpk77_success) character*77 c77 - integer nw(19) - integer ntel(3) - integer, intent(in) :: ntxhash + type(unpack77_context), intent(in) :: context + type(unpack77_effect_policy), intent(in) :: policy + character*37 msg + logical unpk77_success + type(unpack77_core_result) :: decoded - msg=msg0 - i3_hint=i3 - n3_hint=n3 - i3=-1 - n3=-1 - if(i3_hint.eq.0 .and. n3_hint.eq.5) go to 5 + decoded=unpack77_core(c77,context) + msg=decoded%msg + unpk77_success=decoded%success + if(unpk77_success) call apply_unpack77_effects(decoded%effects,policy) -! Convert msg to upper case; collapse multiple blanks; parse into words. - call split77var(msg,nwords,nw,w) - if(msg(1:3).eq.'CQ ' .or. msg(1:3).eq.'DE ' .or. msg(1:4).eq.'QRZ ') go to 100 + return +end subroutine run_unpack77 -! Check 0.1 (DXpedition mode) - call pack77_01var(nwords,w,i3,n3,c77,ntxhash) - if(i3.ge.0 .or. n3.ge.1) go to 900 -! Check 0.2 (EU VHF contest exchange) -! call pack77_02(nwords,w,i3,n3,c77) -! if(i3.ge.0) go to 900 +type(unpack77_core_result) function unpack77_core(c77,context) result(decoded) -! Check 0.3 and 0.4 (ARRL Field Day exchange) - call pack77_03var(nwords,w,i3,n3,c77,ntxhash) - if(i3.ge.0) go to 900 - if(nwords.ge.2) go to 100 + character*77 c77 + type(unpack77_context), intent(in) :: context + logical ok - ! Check 0.5 (telemetry) -5 i0=index(msg,' ') - c18=msg(1:i0-1) - c18=adjustr(c18) - ntel=-99 - read(c18,1005,err=6) ntel -1005 format(3z6) - if(ntel(1).ge.2**23) go to 800 -6 if(ntel(1).ge.0 .and. ntel(2).ge.0 .and. ntel(3).ge.0) then - i3=0 - n3=5 - write(c77,1006) ntel,n3,i3 -1006 format(b23.23,2b24.24,2b3.3) - go to 900 + decoded=unpack77_core_result() + decoded%msg=repeat(' ',37) + call decode_pack77_tag(c77,decoded%i3,decoded%n3,ok) + if(.not.ok) then + decoded%msg='failed unpack' + return + endif + decoded%success=.true. + + if(decoded%i3.eq.0) then + call unpack77_decode_i3_0(c77,context,decoded) + else if(decoded%i3.eq.1 .or. decoded%i3.eq.2) then + call unpack77_decode_type12(c77,context,decoded) + else if(decoded%i3.eq.3) then + call unpack77_decode_type3(c77,context,decoded) + else if(decoded%i3.eq.4) then + call unpack77_decode_type4(c77,context,decoded) + else if(decoded%i3.eq.5) then + call unpack77_decode_type5(c77,context,decoded) + else if(decoded%i3.ge.6) then + decoded%success=.false. endif +! CQ addressed to a hashed/nonstandard call is not a legal message form in +! any type; preserved verbatim from the legacy decoder. + if(decoded%msg(1:4).eq.'CQ <') decoded%success=.false. -100 call pack77_06var(nwords,w,i3,n3,c77,i3_hint,n3_hint,ntxhash) - if(i3.ge.0) go to 900 + return +end function unpack77_core -! Check Type 1 (Standard 77-bit message) or Type 2, with optional "/P" - call pack77_1var(nwords,w,i3,n3,c77,ntxhash) - if(i3.ge.0) go to 900 - -! Check Type 3 (ARRL RTTY contest exchange) - call pack77_3var(nwords,w,i3,n3,c77,ntxhash) - if(i3.ge.0) go to 900 - -! Check Type 4 (One nonstandard call and one hashed call) - call pack77_4var(nwords,w,i3,n3,c77,ntxhash) - if(i3.ge.0) go to 900 - -! Check Type 5 (EU VHF Contest with 2 hashed calls, report, serial, and grid6) - call pack77_5var(nwords,w,i3,n3,c77,ntxhash) - if(i3.ge.0) go to 900 - -! It defaults to free text -800 i3=0 - n3=0 - msg(14:)=' ' - call packtext77var(msg(1:13),c77(1:71)) - write(c77(72:77),'(2b3.3)') n3,i3 - -900 return -end subroutine pack77var - -subroutine unpack77var(c77,nrx,msg,unpk77_successvar,nthr) -! -! nrx=1 when unpacking a received message -! nrx=0 when unpacking a to-be-transmitted message -! the value of nrx is used to decide when mycall13var or dxcall13var should -! be used in place of a callsign from the hashtable -! - parameter (NSEC=86) !Number of ARRL Sections - parameter (NUSCAN=171) !Number of States and Provinces - parameter (MAXGRID4=32400) - integer*8 n58 - integer ntel(3) +subroutine unpack77_decode_i3_0(c77,context,decoded) character*77 c77 - character*37 msg + type(unpack77_context), intent(in) :: context + type(unpack77_core_result), intent(inout) :: decoded + integer ntel(3) character*13 call_1,call_2,call_3,call_1a - character*11 c11 character*3 crpt,cntx,cpfx - character*3 cmult(NUSCAN) - character*6 cexch,grid6 - character*4 grid4,cserial - character*3 csec(NSEC) - character*38 c - character*36 a2 - logical unpk28_success,unpk77_successvar,unpkg4_success - integer, intent(in) :: nthr - - data a2/'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/,nzzz/46656/ - data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/'/ - data csec/ & - "AB ","AK ","AL ","AR ","AZ ","BC ","CO ","CT ","DE ","EB ", & - "EMA","ENY","EPA","EWA","GA ","GH ","IA ","ID ","IL ","IN ", & - "KS ","KY ","LA ","LAX","NS ","MB ","MDC","ME ","MI ","MN ", & - "MO ","MS ","MT ","NC ","ND ","NE ","NFL","NH ","NL ","NLI", & - "NM ","NNJ","NNY","TER","NTX","NV ","OH ","OK ","ONE","ONN", & - "ONS","OR ","ORG","PAC","PR ","QC ","RI ","SB ","SC ","SCV", & - "SD ","SDG","SF ","SFL","SJV","SK ","SNJ","STX","SV ","TN ", & - "UT ","VA ","VI ","VT ","WCF","WI ","WMA","WNY","WPA","WTX", & - "WV ","WWA","WY ","DX ","PE ","NB "/ - data cmult/ & - "AL ","AK ","AZ ","AR ","CA ","CO ","CT ","DE ","FL ","GA ", & - "HI ","ID ","IL ","IN ","IA ","KS ","KY ","LA ","ME ","MD ", & - "MA ","MI ","MN ","MS ","MO ","MT ","NE ","NV ","NH ","NJ ", & - "NM ","NY ","NC ","ND ","OH ","OK ","OR ","PA ","RI ","SC ", & - "SD ","TN ","TX ","UT ","VT ","VA ","WA ","WV ","WI ","WY ", & - "NB ","NS ","QC ","ON ","MB ","SK ","AB ","BC ","NWT","NF ", & - "LB ","NU ","YT ","PEI","DC ","DR ","FR ","GD ","GR ","OV ", & - "ZH ","ZL ","X01","X02","X03","X04","X05","X06","X07","X08", & - "X09","X10","X11","X12","X13","X14","X15","X16","X17","X18", & - "X19","X20","X21","X22","X23","X24","X25","X26","X27","X28", & - "X29","X30","X31","X32","X33","X34","X35","X36","X37","X38", & - "X39","X40","X41","X42","X43","X44","X45","X46","X47","X48", & - "X49","X50","X51","X52","X53","X54","X55","X56","X57","X58", & - "X59","X60","X61","X62","X63","X64","X65","X66","X67","X68", & - "X69","X70","X71","X72","X73","X74","X75","X76","X77","X78", & - "X79","X80","X81","X82","X83","X84","X85","X86","X87","X88", & - "X89","X90","X91","X92","X93","X94","X95","X96","X97","X98", & - "X99"/ - - unpk77_successvar=.true. - -! Check for bad data - do i=1,77 - if(c77(i:i).ne.'0' .and. c77(i:i).ne.'1') then - msg='failed unpack' - unpk77_successvar=.false. + character*6 grid6 + character*4 grid4 + logical unpk28_success,unpkg4_success,ok,is_prefix + type(pack77_free_text_fields) :: free_text_fields + type(pack77_telemetry_fields) :: telemetry_fields + type(pack77_dxpedition_fields) :: dxpedition_fields + type(pack77_field_day_fields) :: field_day_fields + type(pack77_wspr_type1_fields) :: wspr1_fields + type(pack77_wspr_type2_fields) :: wspr2_fields + type(pack77_wspr_type3_fields) :: wspr3_fields + integer :: n28a,n28b + + if(decoded%n3.eq.0) then +! 0.0 Free text + call decode_pack77_free_text(c77,free_text_fields,ok,.true.) + if(.not.ok) then + decoded%success=.false. return endif - enddo + call unpacktext77(free_text_fields%text_bits,decoded%msg(1:13)) + decoded%msg(14:)=' ' + decoded%msg=adjustl(decoded%msg) + if(decoded%msg(1:1).eq.' ') decoded%success=.false. - read(c77(72:77),'(2b3)') n3,i3 - msg=repeat(' ',37) - if(i3.eq.0 .and. n3.eq.0) then -! 0.0 Free text - call unpacktext77var(c77(1:71),msg(1:13)) - msg(14:)=' ' - msg=adjustl(msg) - if(msg(1:1).eq.' ') then - unpk77_successvar=.false. + else if(decoded%n3.eq.1) then +! 0.1 K1ABC RR73; W9XYZ -11 28 28 10 5 71 DXpedition Mode + call decode_pack77_dxpedition(c77,dxpedition_fields,ok,.true.) + if(.not.ok) then + decoded%success=.false. return endif - else if(i3.eq.0 .and. n3.eq.1) then -! 0.1 K1ABC RR73; W9XYZ -11 28 28 10 5 71 DXpedition Mode - read(c77,1010) n28avar,n28bvar,n10,n5 -1010 format(2b28,b10,b5) + n28a=dxpedition_fields%n28a + n28b=dxpedition_fields%n28b + n10=dxpedition_fields%n10 + n5=dxpedition_fields%n5 + call record_configured_n28_pair(context,n28a,n28b) irpt=2*n5 - 30 - write(crpt,1012) irpt -1012 format(i3.2) - if(irpt.ge.0) crpt(1:1)='+' - call unpack28var(n28avar,call_1,unpk28_success,nthr) - if(.not.unpk28_success .or. n28avar.le.2) unpk77_successvar=.false. - call unpack28var(n28bvar,call_2,unpk28_success,nthr) - if(.not.unpk28_success .or. n28bvar.le.2) unpk77_successvar=.false. - call hash10var(n10,call_3,nthr) - if(call_3.eq.'<...>') then - call hash10(n10,call_3) - endif - - if(nrx.eq.1) then - if(dxcall13_setvar .and. len(trim(dxcall13var)).ge.3 .and. hashdx10var.eq.n10) then; call_3='<'//trim(dxcall13var)//'>' - elseif(.not.dxcall13_setvar .and. len(trim(dxcall13var)).ge.3 .and. .not.lcommonft8b .and. hashdx10var.eq.n10) then - call_3='<'//trim(dxcall13_0var)//'>' - elseif(.not.dxcall13_setvar .and. len(trim(dxcall13var)).ge.3 .and. .not.lcommonft8b .and. hashdx10var.ne.n10) then - call_3=trim(call_3) - elseif(.not.dxcall13_setvar .and. len(trim(dxcall13var)).ge.3 .and. lcommonft8b .and. hashdx10var.eq.n10) then - call_3='<'//trim(dxcall13_0var)//'>' - elseif(.not.dxcall13_setvar .and. len(trim(dxcall13var)).ge.3 .and. lcommonft8b .and. hashdx10var.ne.n10) then - call_3='<...>' - endif + crpt=pack77_format_snr_report(irpt) + call unpack28_for_context(context,n28a,call_1,unpk28_success) + if(.not.unpk28_success .or. n28a.le.2) decoded%success=.false. + call unpack28_for_context(context,n28b,call_2,unpk28_success) + if(.not.unpk28_success .or. n28b.le.2) decoded%success=.false. + call hash10(n10,call_3) + if(context%nrx.eq.1) then + if(context%dxcall_set .and. len(trim(context%dxcall)).ge.3 .and. & + context%hashdx10.eq.n10) then + call_3='<'//trim(context%dxcall)//'>' + endif endif - if(nrx.eq.0 .and. mycall13_setvar .and. n10.eq.hashmy10var) call_3='<'//trim(mycall13var)//'>' - msg=trim(call_1)//' RR73; '//trim(call_2)//' '//trim(call_3)//' '//crpt + if(context%nrx.eq.0 .and. context%mycall_set .and. & + n10.eq.context%hashmy10) call_3='<'//trim(context%mycall)//'>' + decoded%msg=trim(call_1)//' RR73; '//trim(call_2)//' '//trim(call_3)//' '//crpt + + else if(decoded%n3.eq.2) then + decoded%success=.false. - else if(i3.eq.0 .and. n3.eq.2) then - unpk77_successvar=.false. - - else if(i3.eq.0 .and. (n3.eq.3 .or. n3.eq.4)) then + else if(decoded%n3.eq.3 .or. decoded%n3.eq.4) then ! 0.3 WA9XYZ KA1ABC R 16A EMA 28 28 1 4 3 7 71 ARRL Field Day ! 0.4 WA9XYZ KA1ABC R 32A EMA 28 28 1 4 3 7 71 ARRL Field Day - read(c77,1030) n28avar,n28bvar,ir,intx,nclass,isec -1030 format(2b28,b1,b4,b3,b7) - if(isec.gt.NSEC .or. isec.lt.1) then - unpk77_successvar=.false. + if(decoded%n3.eq.3) then + call decode_pack77_field_day_low(c77,field_day_fields,ok,.true.) + else + call decode_pack77_field_day_high(c77,field_day_fields,ok,.true.) + endif + if(.not.ok) then + decoded%success=.false. + return + endif + n28a=field_day_fields%n28a + n28b=field_day_fields%n28b + ir=field_day_fields%ir + intx=field_day_fields%intx + nclass=field_day_fields%nclass + isec=field_day_fields%isec + call record_configured_n28_pair(context,n28a,n28b) + if(isec.gt.PACK77_NSEC .or. isec.lt.1) then + decoded%success=.false. isec=1 endif - call unpack28var(n28avar,call_1,unpk28_success,nthr) - if(.not.unpk28_success .or. n28avar.le.2) unpk77_successvar=.false. - call unpack28var(n28bvar,call_2,unpk28_success,nthr) - if(.not.unpk28_success .or. n28bvar.le.2) unpk77_successvar=.false. + call unpack28_for_context(context,n28a,call_1,unpk28_success) + if(.not.unpk28_success .or. n28a.le.2) decoded%success=.false. + call unpack28_for_context(context,n28b,call_2,unpk28_success) + if(.not.unpk28_success .or. n28b.le.2) decoded%success=.false. ntx=intx+1 - if(n3.eq.4) ntx=ntx+16 - write(cntx(1:2),1032) ntx -1032 format(i2) + if(decoded%n3.eq.4) ntx=ntx+16 + write(cntx(1:2),'(i2)') ntx cntx(3:3)=char(ichar('A')+nclass) - if(ir.eq.0 .and. ntx.lt.10) msg=trim(call_1)//' '//trim(call_2)// & - cntx//' '//csec(isec) - if(ir.eq.1 .and. ntx.lt.10) msg=trim(call_1)//' '//trim(call_2)// & - ' R'//cntx//' '//csec(isec) - if(ir.eq.0 .and. ntx.ge.10) msg=trim(call_1)//' '//trim(call_2)// & - ' '//cntx//' '//csec(isec) - if(ir.eq.1 .and. ntx.ge.10) msg=trim(call_1)//' '//trim(call_2)// & - ' R '//cntx//' '//csec(isec) - - else if(i3.eq.0 .and. n3.eq.5) then + decoded%msg=pack77_format_exchange_message(call_1,call_2,ir, & + trim(adjustl(cntx))//' '//pack77_arrl_section_name(isec),.true.) + + else if(decoded%n3.eq.5) then ! 0.5 0123456789abcdef01 71 71 Telemetry (18 hex) - read(c77,1006) ntel -1006 format(b23,2b24) - write(msg,1007) ntel + call decode_pack77_telemetry(c77,telemetry_fields,ok,.true.) + if(.not.ok) then + decoded%success=.false. + return + endif + ntel=(/telemetry_fields%ntel1,telemetry_fields%ntel2,telemetry_fields%ntel3/) + write(decoded%msg,1007) ntel 1007 format(3z6.6) - do i=1,18 - if(msg(i:i).ne.'0') exit - msg(i:i)=' ' - enddo - msg=adjustl(msg) - - else if(i3.eq.0 .and. n3.eq.6) then - read(c77(49:50),'(2b1)') j2a,j2b - itype=2 - if(j2b.eq.0 .and. j2a.eq.0) itype=1 - if(j2b.eq.0 .and. j2a.eq.1) itype=3 - if(itype.eq.1) then -! WSPR Type 1 - read(c77,2010) n28,igrid4,idbm -2010 format(b28.28,b15.15,b5.5) - idbm=nint(idbm*10.0/3.0) - call unpack28var(n28,call_1,unpk28_success,nthr) - if(.not.unpk28_success) unpk77_successvar=.false. - call to_grid4var(igrid4,grid4,unpkg4_success) - if(.not.unpkg4_success) unpk77_successvar=.false. - write(crpt,'(i3)') idbm - msg=trim(call_1)//' '//grid4//' '//trim(adjustl(crpt)) - if (unpk77_successvar) call save_hash_callvar(call_1,nthr) !### Is this OK here? ### - else if(itype.eq.2) then + else if(decoded%n3.eq.6) then + select case(pack77_wspr_payload_type(c77)) + case(2) + call decode_pack77_wspr_type2(c77,wspr2_fields,ok,.true.) + if(.not.ok) then + decoded%success=.false. + return + endif ! WSPR Type 2 - read(c77,2020) n28,npfx,idbm -2020 format(b28.28,b16.16,b5.5) - idbm=nint(idbm*10.0/3.0) - call unpack28var(n28,call_1,unpk28_success,nthr) - if(.not.unpk28_success) unpk77_successvar=.false. + n28=wspr2_fields%n28 + npfx=wspr2_fields%npfx + idbm=nint(wspr2_fields%idbm*10.0/3.0) + call unpack28_for_context(context,n28,call_1,unpk28_success) + if(.not.unpk28_success) decoded%success=.false. write(crpt,'(i3)') idbm - cpfx=' ' - if(npfx.lt.nzzz) then -! Prefix - do i=3,1,-1 - j=mod(npfx,36)+1 - cpfx(i:i)=a2(j:j) - npfx=npfx/36 - if(npfx.eq.0) exit - enddo - msg=trim(adjustl(cpfx))//'/'//trim(call_1)//' '//trim(adjustl(crpt)) + call pack77_wspr_affix_text(npfx,cpfx,is_prefix,ok) + if(.not.ok) then + decoded%success=.false. + return + endif + if(is_prefix) then call_1a=trim(adjustl(cpfx))//'/'//trim(call_1) - call save_hash_callvar(call_1a,nthr) !### Is this OK here? ### else -! Suffix - npfx=npfx-nzzz - if(npfx.le.35) then - cpfx(1:1)=a2(npfx+1:npfx+1) - else if(npfx.gt.35 .and. npfx.le.1295) then - cpfx(1:1)=a2(npfx/36+1:npfx/36+1) - cpfx(2:2)=a2(mod(npfx,36)+1:mod(npfx,36)+1) - else if(npfx.gt.1295 .and. npfx.le.12959) then - cpfx(1:1)=a2(npfx/360+1:npfx/360+1) - cpfx(2:2)=a2(mod(npfx/10,36)+1:mod(npfx/10,36)+1) - cpfx(3:3)=a2(mod(npfx,10)+1:mod(npfx,10)+1) - else - unpk77_successvar=.false. - return - endif - msg=trim(call_1)//'/'//trim(adjustl(cpfx))//' '//trim(adjustl(crpt)) call_1a=trim(call_1)//'/'//trim(adjustl(cpfx)) - call save_hash_callvar(call_1a,nthr) !### Is this OK here? ### endif - - else if(itype.eq.3) then -! WSPR Type 3 - read(c77,2030) n22,igrid6 -2030 format(b22.22,b25.25) - n28=n22+2063592 - call unpack28var(n28,call_1,unpk28_success,nthr) - if(.not.unpk28_success) unpk77_successvar=.false. - call to_gridvar(igrid6,grid6,unpkg4_success) - if(.not.unpkg4_success) unpk77_successvar=.false. - msg=trim(call_1)//' '//grid6 - endif - - else if(i3.eq.0 .and. n3.gt.6) then - unpk77_successvar=.false. - - else if(i3.eq.1 .or. i3.eq.2) then -! Type 1 (standard message) or Type 2 ("/P" form for EU VHF contest) - read(c77,1000) n28avar,ipa,n28bvar,ipb,ir,igrid4,i3 -1000 format(2(b28,b1),b1,b15,b3) - call unpack28var(n28avar,call_1,unpk28_success,nthr) - if(nrx.eq.1 .and. mycall13_setvar .and. hashmy22var.eq.(n28avar-2063592)) then - call_1='<'//trim(mycall13var)//'>' - unpk28_success=.true. - endif - if(.not.unpk28_success) unpk77_successvar=.false. - call unpack28var(n28bvar,call_2,unpk28_success,nthr) - if(.not.unpk28_success) unpk77_successvar=.false. - if(call_1(1:3).eq.'CQ_') call_1(3:3)=' ' - if(index(call_1,'<').le.0) then - i=index(call_1,' ') - if(i.ge.4 .and. ipa.eq.1 .and. i3.eq.1) call_1(i:i+1)='/R' - if(i.ge.4 .and. ipa.eq.1 .and. i3.eq.2) call_1(i:i+1)='/P' - if(i.ge.4) call add_call_to_recent_callsvar(call_1,nthr) - endif - if(index(call_2,'<').le.0) then - i=index(call_2,' ') - if(i.ge.4 .and. ipb.eq.1 .and. i3.eq.1) call_2(i:i+1)='/R' - if(i.ge.4 .and. ipb.eq.1 .and. i3.eq.2) call_2(i:i+1)='/P' - if(i.ge.4) then - call add_call_to_recent_callsvar(call_2,nthr) -! only hash the "from" call - call save_hash_callvar(call_2,nthr) - endif - endif - if(igrid4.le.MAXGRID4) then - call to_grid4var(igrid4,grid4,unpkg4_success) - if(.not.unpkg4_success) unpk77_successvar=.false. - if(ir.eq.0) msg=trim(call_1)//' '//trim(call_2)//' '//grid4 - if(ir.eq.1) msg=trim(call_1)//' '//trim(call_2)//' R '//grid4 - if(msg(1:3).eq.'CQ ' .and. ir.eq.1) unpk77_successvar=.false. -!out of current realisation of protocol: GRID is always dropped at WSJT-X/JTDX transmission of the messages below -! i3 n3 -! 1 0 -!110015 -23 0.5 1450 ~ <...> Y96IHQ/R GL12 -!112215 -23 0.0 1606 ~ <...> 3U1TBM/R CC65 -!000102 -23 0.5 801 ~ <...> NV3QHV/R JF62 - if(ir.eq.0 .and. call_1(1:1).eq.'<' .and. grid4.ne.'RR73') then ! hash value can also be associated with a valid callsign - nlencall2=len_trim(call_2) - if(nlencall2.gt.1) then - if(call_2(nlencall2-1:nlencall2).eq.'/R') unpk77_successvar=.false. - endif + decoded%msg=trim(call_1a)//' '//trim(adjustl(crpt)) + call stage_unpack_hash_call(decoded%effects,call_1a) + + case(1) + call decode_pack77_wspr_type1(c77,wspr1_fields,ok,.true.) + if(.not.ok) then + decoded%success=.false. + return endif - else - irpt=igrid4-MAXGRID4 - if(irpt.eq.1) msg=trim(call_1)//' '//trim(call_2) - if(irpt.eq.2) msg=trim(call_1)//' '//trim(call_2)//' RRR' - if(irpt.eq.3) msg=trim(call_1)//' '//trim(call_2)//' RR73' - if(irpt.eq.4) msg=trim(call_1)//' '//trim(call_2)//' 73' - if(irpt.ge.5) then - isnr=irpt-35 - if(isnr.gt.50) isnr=isnr-101 - write(crpt,'(i3.2)') isnr - if(crpt(1:1).eq.' ') crpt(1:1)='+' - if(ir.eq.0) msg=trim(call_1)//' '//trim(call_2)//' '//crpt - if(ir.eq.1) msg=trim(call_1)//' '//trim(call_2)//' R'//crpt +! WSPR Type 1 + n28=wspr1_fields%n28 + igrid4=wspr1_fields%igrid4 + idbm=nint(wspr1_fields%idbm*10.0/3.0) + call unpack28_for_context(context,n28,call_1,unpk28_success) + if(.not.unpk28_success) decoded%success=.false. + call to_grid4(igrid4,grid4,unpkg4_success) + if(.not.unpkg4_success) decoded%success=.false. + write(crpt,'(i3)') idbm + decoded%msg=trim(call_1)//' '//grid4//' '//trim(adjustl(crpt)) + call stage_unpack_hash_call(decoded%effects,call_1) + + case(3) + call decode_pack77_wspr_type3(c77,wspr3_fields,ok,.true.) + if(.not.ok) then + decoded%success=.false. + return endif - if(msg(1:3).eq.'CQ ' .and. irpt.ge.2) unpk77_successvar=.false. - endif +! WSPR Type 3 + n22=wspr3_fields%n22 + igrid6=wspr3_fields%igrid6 + n28=n22+PACK77_NTOKENS + call unpack28_for_context(context,n28,call_1,unpk28_success) + if(.not.unpk28_success) decoded%success=.false. + call to_grid(igrid6,grid6,unpkg4_success) + if(.not.unpkg4_success) decoded%success=.false. + decoded%msg=trim(call_1)//' '//grid6 - else if(i3.eq.3) then -! Type 3: ARRL RTTY Contest - read(c77,1040) itu,n28avar,n28bvar,ir,irpt,nexch,i3 -1040 format(b1,2b28.28,b1,b3.3,b13.13,b3.3) - write(crpt,1042) irpt+2 -1042 format('5',i1,'9') - nserial=nexch - imult=-1 - if(nexch.gt.8000) then - imult=nexch-8000 - nserial=-1 - endif - call unpack28var(n28avar,call_1,unpk28_success,nthr) - if(.not.unpk28_success) unpk77_successvar=.false. - call unpack28var(n28bvar,call_2,unpk28_success,nthr) - if(.not.unpk28_success) unpk77_successvar=.false. - imult=0 - nserial=0 - if(nexch.gt.8000) imult=nexch-8000 - if(nexch.lt.8000) nserial=nexch - - if(imult.ge.1 .and.imult.le.NUSCAN) then - if(itu.eq.0 .and. ir.eq.0) msg=trim(call_1)//' '//trim(call_2)// & - ' '//crpt//' '//cmult(imult) - if(itu.eq.1 .and. ir.eq.0) msg='TU; '//trim(call_1)//' '//trim(call_2)// & - ' '//crpt//' '//cmult(imult) - if(itu.eq.0 .and. ir.eq.1) msg=trim(call_1)//' '//trim(call_2)// & - ' R '//crpt//' '//cmult(imult) - if(itu.eq.1 .and. ir.eq.1) msg='TU; '//trim(call_1)//' '//trim(call_2)// & - ' R '//crpt//' '//cmult(imult) - else if(nserial.ge.1 .and. nserial.le.7999) then - write(cserial,'(i4.4)') nserial - if(itu.eq.0 .and. ir.eq.0) msg=trim(call_1)//' '//trim(call_2)// & - ' '//crpt//' '//cserial - if(itu.eq.1 .and. ir.eq.0) msg='TU; '//trim(call_1)//' '//trim(call_2)// & - ' '//crpt//' '//cserial - if(itu.eq.0 .and. ir.eq.1) msg=trim(call_1)//' '//trim(call_2)// & - ' R '//crpt//' '//cserial - if(itu.eq.1 .and. ir.eq.1) msg='TU; '//trim(call_1)//' '//trim(call_2)// & - ' R '//crpt//' '//cserial - endif + case default + decoded%success=.false. + return + end select - else if(i3.eq.4) then -! Type 4 - read(c77,1050) n12,n58,iflip,nrpt,icq -1050 format(b12,b58,b1,b2,b1) - do i=11,1,-1 - j=mod(n58,38)+1 - c11(i:i)=c(j:j) - n58=n58/38 - enddo - call hash12var(n12,call_3,nthr) - if(call_3.eq.'<...>') then - call hash12(n12,call_3) - endif - if(iflip.eq.0) then ! 12 bit hash for TO call - call_1=call_3 - call_2=adjustl(c11)//' ' - call add_call_to_recent_callsvar(call_2,nthr) - if(nrx.eq.1 .and. & - dxcall13_setvar .and. mycall13_setvar .and. & - call_2.eq.dxcall13var .and. & - n12.eq.hashmy12var ) call_1='<'//trim(mycall13var)//'>' - if(nrx.eq.1 .and. & - mycall13_setvar .and. & - index(call_1,'<...>').gt.0 .and. & - n12.eq.hashmy12var ) call_1='<'//trim(mycall13var)//'>' - else ! 12 bit hash for DE call - call_1=adjustl(c11) - call_2=call_3 - call add_call_to_recent_callsvar(call_1,nthr) - if(nrx.eq.0 .and. & - mycall13_setvar .and. & - n12.eq.hashmy12var) call_2='<'//trim(mycall13var)//'>' - endif - if(icq.eq.0) then - if(nrpt.eq.0) msg=trim(call_1)//' '//trim(call_2) - if(nrpt.eq.1) msg=trim(call_1)//' '//trim(call_2)//' RRR' - if(nrpt.eq.2) msg=trim(call_1)//' '//trim(call_2)//' RR73' - if(nrpt.eq.3) msg=trim(call_1)//' '//trim(call_2)//' 73' - else - msg='CQ '//trim(call_2) - endif - if(call_2(1:1).lt.':' .and. call_2(1:1).gt.'/' .and. call_2(2:2).lt.':' .and. call_2(2:2).gt.'/') unpk77_successvar=.false. - if(len_trim(call_2).eq.11) then - ispace=index(call_2,' '); if(ispace.gt.0 .and. ispace.lt.12) unpk77_successvar=.false. - islash=index(call_2,'/'); if(islash.eq.1 .or. islash.eq.2 .or. islash.eq.11 .or. (islash.eq.10 .and. & - call_2(11:11).gt.'@' .and. call_2(11:11).lt.'[' .and. call_2(11:11).ne.'P')) unpk77_successvar=.false. - if(islash.lt.6 .and. call_2(11:11).lt.':' .and. call_2(11:11).gt.'/') unpk77_successvar=.false. - endif - if(msg(1:3).ne.'CQ ') then - if(call_1(1:1).lt.':' .and. call_1(1:1).gt.'/' .and. call_1(2:2).lt.':' .and.call_1(2:2).gt.'/') unpk77_successvar=.false. - if(len_trim(call_1).eq.11) then - ispace=index(call_1,' '); if(ispace.gt.0 .and. ispace.lt.12) unpk77_successvar=.false. - islash=index(call_1,'/'); if(islash.eq.1 .or. islash.eq.2 .or. islash.eq.11 .or. (islash.eq.10 .and. & - call_1(11:11).gt.'@' .and. call_1(11:11).lt.'[' .and. call_1(11:11).ne.'P')) unpk77_successvar=.false. - if(islash.lt.6 .and. call_1(11:11).lt.':' .and. call_1(11:11).gt.'/') unpk77_successvar=.false. - endif - endif - nmsglen=len_trim(msg) -! protocol violations, also reported at wrong TX message packing -! prevent broken message transmission - if(unpk77_successvar .and. nmsglen.gt.0) then - indxp=index(msg,'/P ') - if((icq.eq.0 .and. nrpt.eq.0 .and. (indxp.lt.1 .or. indxp.gt.7)) .or. icq.eq.1) then -! -23 -3.3 N0S/W45ETOE <...> -!071445 -14 0.1 779 ~ <...> -!071445 -14 0.1 779 ~ W5JZ ! hash was associated -! CQ <...> -! with exception to broken by packing message 'JQ1AHT/P -15' wrongly being transmitted as type 4 message 'JQ1AHT/P ' - if(msg(nmsglen:nmsglen).eq.'>') unpk77_successvar=.false. - endif + else if(decoded%n3.gt.6) then + decoded%success=.false. + endif + + return +end subroutine unpack77_decode_i3_0 + +subroutine unpack77_decode_type12(c77,context,decoded) + character*77 c77 + type(unpack77_context), intent(in) :: context + type(unpack77_core_result), intent(inout) :: decoded + character*13 call_1,call_2 + character*3 crpt + character*4 grid4 + logical unpk28_success,unpkg4_success,ok + type(pack77_type12_fields) :: type12_fields + integer :: n28a,n28b + ! Type 1 (standard message) or Type 2 ("/P" form for EU VHF contest) + if(decoded%i3.eq.1) then + call decode_pack77_type1(c77,type12_fields,ok,.true.) + else + call decode_pack77_type2(c77,type12_fields,ok,.true.) + endif + if(.not.ok) then + decoded%success=.false. + return + endif + n28a=type12_fields%n28a + n28b=type12_fields%n28b + ipa=type12_fields%ipa + ipb=type12_fields%ipb + ir=type12_fields%ir + igrid4=type12_fields%igrid4 + call record_configured_n28_pair(context,n28a,n28b) + call unpack28_for_context(context,n28a,call_1,unpk28_success) + if(context%nrx.eq.1 .and. context%mycall_set .and. & + context%hashmy22.eq.(n28a-PACK77_NTOKENS)) then + call_1='<'//trim(context%mycall)//'>' + unpk28_success=.true. + endif + if(.not.unpk28_success) decoded%success=.false. + call unpack28_for_context(context,n28b,call_2,unpk28_success) + if(.not.unpk28_success) decoded%success=.false. + if(call_1(1:3).eq.'CQ_') call_1(3:3)=' ' + if(index(call_1,'<').le.0) then + i=index(call_1,' ') + if(i.ge.4 .and. ipa.eq.1 .and. decoded%i3.eq.1) call_1(i:i+1)='/R' + if(i.ge.4 .and. ipa.eq.1 .and. decoded%i3.eq.2) call_1(i:i+1)='/P' + if(i.ge.4) then + call stage_unpack_recent_call(decoded%effects,call_1) + if(context%configured) call stage_unpack_hash_call(decoded%effects,call_1) endif -! <...> /BZZ/0ZZ/C -! <...> ZZZZ/0Z/Z/ -! <...> OZZZZ/0ZZZ/ -! <...> 0I/IZZZ/O K -! <...> J/IZZZ/O K - if(unpk77_successvar .and. iflip.eq.0 .and. icq.eq.0 .and. nrpt.eq.0) then - nlencall2=len_trim(call_2) - if(nlencall2.gt.9) then - if(call_2(1:1).eq.'/' .or. call_2(nlencall2:nlencall2).eq.'/') unpk77_successvar=.false. - nindxspace=index(call_2,' ') - if(nindxspace.gt.0 .and. nindxspace.lt.nlencall2) unpk77_successvar=.false. - endif + endif + if(index(call_2,'<').le.0) then + i=index(call_2,' ') + if(i.ge.4 .and. ipb.eq.1 .and. decoded%i3.eq.1) call_2(i:i+1)='/R' + if(i.ge.4 .and. ipb.eq.1 .and. decoded%i3.eq.2) call_2(i:i+1)='/P' + if(i.ge.4) then + call stage_unpack_recent_call(decoded%effects,call_2) + call stage_unpack_hash_call(decoded%effects,call_2) endif + endif + if(igrid4.le.PACK77_MAXGRID4) then + call to_grid4(igrid4,grid4,unpkg4_success) + if(.not.unpkg4_success) decoded%success=.false. + decoded%msg=pack77_format_exchange_message(call_1,call_2,ir,grid4,.true.) + if(decoded%msg(1:3).eq.'CQ ' .and. ir.eq.1) decoded%success=.false. + if(context%strict_var_guards .and. .not.unpack77_type12_var_guard_ok( & + call_1,call_2,grid4,ir)) decoded%success=.false. + else + irpt=igrid4-PACK77_MAXGRID4 + if(irpt.ge.1 .and. irpt.le.4) & + decoded%msg=pack77_format_qso_tail(call_1,call_2, & + pack77_tail_from_type12_irpt(irpt)) + if(irpt.ge.5) then + crpt=pack77_format_snr_report(pack77_snr_from_report_index(irpt)) + decoded%msg=pack77_format_exchange_message(call_1,call_2,ir,crpt,.false.) + endif + if(decoded%msg(1:3).eq.'CQ ' .and. irpt.ge.2) decoded%success=.false. + endif - else if(i3.eq.5) then - -! Type 5 R 590003 IO91NP h12 h22 r1 s3 S11 g25 -! EU VHF contest - read(c77,1060) n12,n22,ir,irpt,iserial,igrid6 -1060 format(b12,b22,b1,b3,b11,b25) - if(igrid6.lt.0 .or. igrid6.gt.18662399) then - unpk77_successvar=.false. + return +end subroutine unpack77_decode_type12 + +subroutine unpack77_decode_type3(c77,context,decoded) + character*77 c77 + type(unpack77_context), intent(in) :: context + type(unpack77_core_result), intent(inout) :: decoded + character*13 call_1,call_2 + character*4 exchange + character crpt*3 + logical unpk28_success,ok + type(pack77_type3_fields) :: type3_fields + integer :: n28a,n28b + ! Type 3: ARRL RTTY Contest + call decode_pack77_type3(c77,type3_fields,ok,.true.) + if(.not.ok) then + decoded%success=.false. + return + endif + itu=type3_fields%itu + n28a=type3_fields%n28a + n28b=type3_fields%n28b + ir=type3_fields%ir + irpt=type3_fields%irpt + nexch=type3_fields%nexch + call record_configured_n28_pair(context,n28a,n28b) + crpt=pack77_format_rtty_report(irpt) + call unpack28_for_context(context,n28a,call_1,unpk28_success) + if(.not.unpk28_success) decoded%success=.false. + call unpack28_for_context(context,n28b,call_2,unpk28_success) + if(.not.unpk28_success) decoded%success=.false. + if(nexch.gt.8000 .and. nexch-8000.le.PACK77_NUSCAN) then + exchange=pack77_rtty_multiplier_name(nexch-8000) + if(.not.pack77_type3_render_fits(itu,ir,call_1,call_2,exchange)) then + decoded%success=.false. return endif - call hash12var(n12,call_1,nthr) - if(call_1.eq.'<...>') then - call hash12(n12,call_1) - endif - if(n12.eq.hashmy12var) call_1='<'//trim(mycall13var)//'>' - call hash22var(n22,call_2,nthr) - if(call_2.eq.'<...>') then - call hash22(n22,call_2) + decoded%msg=pack77_format_type3_message(itu,ir,call_1,call_2,crpt, & + exchange) + else if(nexch.ge.1 .and. nexch.le.7999) then + write(exchange,'(i4.4)') nexch + if(.not.pack77_type3_render_fits(itu,ir,call_1,call_2,exchange)) then + decoded%success=.false. + return endif - nrs=52+irpt - write(cexch,1022) nrs,iserial -1022 format(i2,i4.4) - call to_grid6var(igrid6,grid6,unpk77_successvar) - if(ir.eq.0) msg=trim(call_1)//' '//trim(call_2)//' '//cexch//' '//grid6 - if(ir.eq.1) msg=trim(call_1)//' '//trim(call_2)//' R '//cexch//' '//grid6 + decoded%msg=pack77_format_type3_message(itu,ir,call_1,call_2,crpt,exchange) + else + decoded%success=.false. + endif + + return +end subroutine unpack77_decode_type3 - else if(i3.ge.6) then ! i3 values 6 and 7 are not yet defined - unpk77_successvar=.false. +subroutine unpack77_decode_type4(c77,context,decoded) + character*77 c77 + type(unpack77_context), intent(in) :: context + type(unpack77_core_result), intent(inout) :: decoded + character*13 call_1,call_2,call_3 + character*11 c11 + logical ok + type(pack77_type4_fields) :: type4_fields + ! Type 4 + call decode_pack77_type4(c77,type4_fields,ok,.true.) + if(.not.ok) then + decoded%success=.false. + return + endif + n12=type4_fields%n12 + c11=pack77_type4_call_text_from_n58(type4_fields%n58) + iflip=type4_fields%iflip + nrpt=type4_fields%nrpt + icq=type4_fields%icq + call hash12(n12,call_3) + if(iflip.eq.0) then ! 12 bit hash for TO call + call_1=call_3 + call_2=adjustl(c11)//' ' + call stage_unpack_recent_call(decoded%effects,call_2) + call stage_unpack_hash_call(decoded%effects,call_2) + if(context%nrx.eq.1 .and. context%dxcall_set .and. & + context%mycall_set .and. call_2.eq.context%dxcall .and. & + n12.eq.context%hashmy12) call_1='<'//trim(context%mycall)//'>' + if(context%nrx.eq.1 .and. context%mycall_set .and. & + index(call_1,'<...>').gt.0 .and. & + n12.eq.context%hashmy12) call_1='<'//trim(context%mycall)//'>' + else ! 12 bit hash for DE call + call_1=adjustl(c11) + call_2=call_3 + call stage_unpack_recent_call(decoded%effects,call_1) + if(context%configured) call stage_unpack_hash_call(decoded%effects,call_1) + if(context%nrx.eq.0 .and. context%mycall_set .and. & + n12.eq.context%hashmy12) call_2='<'//trim(context%mycall)//'>' endif - if(msg(1:4).eq.'CQ <') unpk77_successvar=.false. + if(icq.eq.0) then + decoded%msg=pack77_format_qso_tail(call_1,call_2, & + pack77_tail_from_type4_nrpt(nrpt)) + else + decoded%msg='CQ '//trim(call_2) + endif + if(context%strict_var_guards .and. .not.unpack77_type4_var_guard_ok( & + call_1,call_2,decoded%msg,iflip,icq,nrpt)) decoded%success=.false. + return -end subroutine unpack77var +end subroutine unpack77_decode_type4 -subroutine pack28var(c13,n28,ntxhash) +subroutine unpack77_decode_type5(c77,context,decoded) + character*77 c77 + type(unpack77_context), intent(in) :: context + type(unpack77_core_result), intent(inout) :: decoded + character*13 call_1,call_2 + character*6 cexch,grid6 + logical ok + type(pack77_type5_fields) :: type5_fields + ! Type 5 R 590003 IO91NP h12 h22 r1 s3 S11 g25 + ! EU VHF contest + call decode_pack77_type5(c77,type5_fields,ok,.true.) + if(.not.ok) then + decoded%success=.false. + return + endif + n12=type5_fields%n12 + n22=type5_fields%n22 + ir=type5_fields%ir + irpt=type5_fields%irpt + iserial=type5_fields%iserial + igrid6=type5_fields%igrid6 + call hash12(n12,call_1) + if(n12.eq.context%hashmy12) call_1='<'//trim(context%mycall)//'>' + call hash22(n22,call_2) + cexch=pack77_format_vhf_exchange(irpt,iserial) + call to_grid6(igrid6,grid6,decoded%success) + decoded%msg=pack77_format_exchange_message(call_1,call_2,ir,cexch//' '//grid6,.true.) -! Pack a special token, a 22-bit hash code, or a valid base call into a 28-bit -! integer. + return +end subroutine unpack77_decode_type5 - parameter (NTOKENS=2063592,MAX22=4194304) - logical is_digit,is_letter,lhashit - character*13 c13 - character*6 callsign - character*1 c - character*4 c4 - character*37 a1 - character*36 a2 - character*10 a3 - character*27 a4 - integer, intent(in) :: ntxhash - data a1/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ - data a2/'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ - data a3/'0123456789'/ - data a4/' ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ - - is_digit(c)=c.ge.'0' .and. c.le.'9' - is_letter(c)=c.ge.'A' .and. c.le.'Z' +subroutine stage_unpack_hash_call(effects,c13) + type(unpack77_effects), intent(inout) :: effects + character(len=*), intent(in) :: c13 - n28=-1 -! Work-around for Swaziland prefix: - if(c13(1:4).eq.'3DA0') callsign='3D0'//c13(5:7) -! Work-around for Guinea prefixes: - if(c13(1:2).eq.'3X' .and. c13(3:3).ge.'A' .and. & - c13(3:3).le.'Z') callsign='Q'//c13(3:6) + call stage_unpack_call(effects%hash_calls,effects%nhash,c13) -! Check for special tokens first - if(c13(1:3).eq.'DE ') then - n28=0 - go to 900 - endif - - if(c13(1:4).eq.'QRZ ') then - n28=1 - go to 900 - endif + return +end subroutine stage_unpack_hash_call - if(c13(1:3).eq.'CQ ') then - n28=2 - go to 900 - endif +subroutine stage_unpack_recent_call(effects,c13) + type(unpack77_effects), intent(inout) :: effects + character(len=*), intent(in) :: c13 - if(c13(1:3).eq.'CQ_') then - n=len(trim(c13)) - if(n.ge.4 .and. n.le.7) then - nlet=0 - nnum=0 - do i=4,n - c=c13(i:i) - if(c.ge.'A' .and. c.le.'Z') nlet=nlet+1 - if(c.ge.'0' .and. c.le.'9') nnum=nnum+1 - enddo - if(nnum.eq.3 .and. nlet.eq.0) then - read(c13(4:3+nnum),*) nqsy - n28=3+nqsy - go to 900 + call stage_unpack_call(effects%recent_calls,effects%nrecent,c13) + + return +end subroutine stage_unpack_recent_call + +subroutine stage_unpack_call(calls,ncalls,c13) + character(len=13), intent(inout) :: calls(:) + integer, intent(inout) :: ncalls + character(len=*), intent(in) :: c13 + character(len=13) :: cw + logical :: ok + +! Keep unpack77_core side-effect free; callers decide whether staged calls are +! written immediately or queued for fillhashvar. + call normalize_hash_call(c13,cw,ok) + if(.not.ok) return + if(ncalls.ge.size(calls)) return + ncalls=ncalls+1 + calls(ncalls)=cw + + return +end subroutine stage_unpack_call + +subroutine apply_unpack77_effects(effects,policy) + type(unpack77_effects), intent(in) :: effects + type(unpack77_effect_policy), intent(in) :: policy + integer :: i,n10,n12,n22 + +! Non-configured decodes write directly to shared state. Configured/var decodes +! queue by RX thread and let fillhashvar merge the successful decode effects. + if(policy%record_hashes) then + do i=1,effects%nhash + if(policy%queue_by_thread) then + call queue_hash_call_for_thread(effects%hash_calls(i),policy%nthr_hash) + else + call save_hash_call(effects%hash_calls(i),n10,n12,n22) endif - if(nlet.ge.1 .and. nlet.le.4 .and. nnum.eq.0) then - c4=c13(4:n) - c4=adjustr(c4) - m=0 - do i=1,4 - j=0 - c=c4(i:i) - if(c.ge.'A' .and. c.le.'Z') j=ichar(c)-ichar('A')+1 - m=27*m + j - enddo - n28=3+1000+m - go to 900 + enddo + endif + if(policy%record_recent_calls) then + do i=1,effects%nrecent + if(policy%queue_by_thread) then + call queue_recent_call_for_thread(effects%recent_calls(i), & + policy%nthr_recent) + else + call add_call_to_recent_calls(effects%recent_calls(i)) endif - endif + enddo endif - lhashit=.false.; if(ntxhash.eq.1) lhashit=.true. -! Check for <...> callsign - if(c13(1:1).eq.'<')then - call save_hash_txcallvar(c13,n10,n12,n22,lhashit) !Save callsign in hash table - i2=index(c13,'>') - c13=c13(2:i2-1) - n22=ihashcall(c13,22) - n28=NTOKENS + n22 - go to 900 - endif + return +end subroutine apply_unpack77_effects -! Check for standard callsign - iarea=-1 - n=len(trim(c13)) - do i=n,2,-1 - if(is_digit(c13(i:i))) exit - enddo - iarea=i !Call-area digit - npdig=0 !Digits before call area - nplet=0 !Letters before call area - do i=1,iarea-1 - if(is_digit(c13(i:i))) npdig=npdig+1 - if(is_letter(c13(i:i))) nplet=nplet+1 - enddo - nslet=0 - do i=iarea+1,n - if(is_letter(c13(i:i))) nslet=nslet+1 - enddo - if(iarea.lt.2 .or. iarea.gt.3 .or. nplet.eq.0 .or. & - npdig.ge.iarea-1 .or. nslet.gt.3) then -! Treat this as a nonstandard callsign: compute its 22-bit hash - call save_hash_txcallvar(c13,n10,n12,n22,lhashit) !Save callsign in hash table - n22=ihashcall(c13,22) - n28=NTOKENS + n22 - go to 900 +subroutine unpack28_for_context(context,n28,c13,success) + type(unpack77_context), intent(in) :: context + integer, intent(in) :: n28 + character*13 c13 + logical success + + if(context%configured) then + call unpack28_configured(n28,c13,success) + else + call unpack28(n28,c13,success) endif - - n=len(trim(c13)) -! This is a standard callsign - call save_hash_txcallvar(c13,n10,n12,n22,lhashit) !Save callsign in hash table - if(iarea.eq.2) callsign=' '//c13(1:5) - if(iarea.eq.3) callsign=c13(1:6) - i1=index(a1,callsign(1:1))-1 - i2=index(a2,callsign(2:2))-1 - i3=index(a3,callsign(3:3))-1 - i4=index(a4,callsign(4:4))-1 - i5=index(a4,callsign(5:5))-1 - i6=index(a4,callsign(6:6))-1 - n28=36*10*27*27*27*i1 + 10*27*27*27*i2 + 27*27*27*i3 + 27*27*i4 + & - 27*i5 + i6 - n28=n28 + NTOKENS + MAX22 -900 n28=iand(n28,ishft(1,28)-1) return -end subroutine pack28var +end subroutine unpack28_for_context +subroutine record_configured_n28_pair(context,n28a,n28b) + type(unpack77_context), intent(in) :: context + integer, intent(in) :: n28a,n28b -subroutine unpack28var(n28_0,c13,success,nthr) + if(.not.context%configured) return + n28a_configured=n28a + n28b_configured=n28b - parameter (NTOKENS=2063592,MAX22=4194304) - logical success - character*13 c13 - character*37 c1 - character*36 c2 - character*10 c3 - character*27 c4 - integer, intent(in) :: nthr - data c1/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ - data c2/'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ - data c3/'0123456789'/ - data c4/' ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ + return +end subroutine record_configured_n28_pair - success=.true. - n28=n28_0 - if(n28.lt.NTOKENS) then -! Special tokens DE, QRZ, CQ, CQ_nnn, CQ_aaaa - if(n28.eq.0) c13='DE ' - if(n28.eq.1) c13='QRZ ' - if(n28.eq.2) c13='CQ ' - if(n28.le.2) go to 900 - if(n28.le.1002) then - write(c13,1002) n28-3 -1002 format('CQ_',i3.3) - go to 900 - endif - if(n28.le.532443) then - n=n28-1003 - n0=n - i1=n/(27*27*27) - n=n-27*27*27*i1 - i2=n/(27*27) - n=n-27*27*i2 - i3=n/27 - i4=n-27*i3 - c13=c4(i1+1:i1+1)//c4(i2+1:i2+1)//c4(i3+1:i3+1)//c4(i4+1:i4+1) - c13=adjustl(c13) - c13='CQ_'//c13(1:10) - go to 900 +logical function unpack77_type12_var_guard_ok(call_1,call_2,grid4,ir) result(ok) +! Configured decode rejects a few hash-collision renders that parse as valid +! source messages but cannot round-trip through the configured var encoder. + character(len=*), intent(in) :: call_1,call_2,grid4 + integer, intent(in) :: ir + type(pack77_type12_call_source) :: source + logical :: source_ok + + ok=.true. + if(ir.eq.0 .and. call_1(1:1).eq.'<' .and. grid4.ne.'RR73') then + call pack77_parse_type12_call(call_2,.false.,source,source_ok) + if(source_ok .and. source%suffix.eq.PACK77_TYPE12_SUFFIX_R) ok=.false. + endif + + return +end function unpack77_type12_var_guard_ok + +logical function unpack77_type4_var_guard_ok(call_1,call_2,msg,iflip,icq,nrpt) result(ok) +! Type 4 can decode arbitrary 58-bit text as plausible calls; configured var +! mode keeps only renders that also satisfy the source-side Type 4 grammar. + character(len=*), intent(in) :: call_1,call_2,msg + integer, intent(in) :: iflip,icq,nrpt + integer :: nmsglen,indxp,nlencall2,nindxspace + type(pack77_type4_source) :: source + logical :: source_ok + + ok=.true. + call pack77_parse_type4_source(msg,source,source_ok) + if(.not.source_ok) ok=.false. + if(.not.unpack77_type4_call_guard_ok(call_2)) ok=.false. + if(msg(1:3).ne.'CQ ' .and. .not.unpack77_type4_call_guard_ok(call_1)) & + ok=.false. + nmsglen=len_trim(msg) + if(ok .and. nmsglen.gt.0) then + indxp=index(msg,'/P ') + if((icq.eq.0 .and. nrpt.eq.0 .and. (indxp.lt.1 .or. indxp.gt.7)) .or. & + icq.eq.1) then + if(msg(nmsglen:nmsglen).eq.'>') ok=.false. endif endif - n28=n28-NTOKENS - if(n28.lt.MAX22) then -! This is a 22-bit hash of a callsign - n22=n28 - call hash22var(n22,c13,nthr) !Retrieve callsign from hash table - if(c13.eq.'<...>') then - call hash22(n22,c13) + if(ok .and. iflip.eq.0 .and. icq.eq.0 .and. nrpt.eq.0) then + nlencall2=len_trim(call_2) + if(nlencall2.gt.9) then + if(call_2(1:1).eq.'/' .or. call_2(nlencall2:nlencall2).eq.'/') & + ok=.false. + nindxspace=index(call_2,' ') + if(nindxspace.gt.0 .and. nindxspace.lt.nlencall2) ok=.false. endif - go to 900 endif - -! Standard callsign - n=n28 - MAX22 - i1=n/(36*10*27*27*27) - n=n-36*10*27*27*27*i1 - i2=n/(10*27*27*27) - n=n-10*27*27*27*i2 - i3=n/(27*27*27) - n=n-27*27*27*i3 - i4=n/(27*27) - n=n-27*27*i4 - i5=n/27 - i6=n-27*i5 - c13=c1(i1+1:i1+1)//c2(i2+1:i2+1)//c3(i3+1:i3+1)//c4(i4+1:i4+1)// & - c4(i5+1:i5+1)//c4(i6+1:i6+1) - c13=adjustl(c13) -900 i0=index(c13,' ') + return +end function unpack77_type4_var_guard_ok + +logical function unpack77_type4_call_guard_ok(call_text) result(ok) + character(len=*), intent(in) :: call_text + integer :: ispace,islash + + ok=pack77_valid_hash_call_token(call_text) .or. & + pack77_valid_type4_c11(call_text) + if(.not.ok) return + if(pack77_valid_hash_call_token(call_text)) return + if(pack77_is_digit_char(call_text(1:1)) .and. & + pack77_is_digit_char(call_text(2:2))) ok=.false. + if(len_trim(call_text).eq.11) then + ispace=index(call_text,' ') + if(ispace.gt.0 .and. ispace.lt.12) ok=.false. + islash=index(call_text,'/') + if(islash.eq.1 .or. islash.eq.2 .or. islash.eq.11 .or. & + (islash.eq.10 .and. pack77_is_letter_char(call_text(11:11)) .and. & + call_text(11:11).ne.'P')) ok=.false. + if(islash.lt.6 .and. pack77_is_digit_char(call_text(11:11))) ok=.false. + endif - if((i0.ne.0 .and. i0.lt.len(trim(c13))) .or. (c13(1:1).lt.':' .and. c13(1:1).gt.'/' .and. & - c13(2:2).lt.':' .and. c13(2:2).gt.'/')) then - c13='QU1RK' - success=.false. + return +end function unpack77_type4_call_guard_ok + +subroutine lower_c28_slot(token,allow_auto_hash,n28,hash_facts,ok) + character(len=*), intent(in) :: token + logical, intent(in) :: allow_auto_hash + integer, intent(out) :: n28 + character*13 cw + type(pack77_hash_facts), intent(inout) :: hash_facts + type(pack77_hash_facts) :: trial_facts + logical, intent(out) :: ok + +! Some c28 fields may auto-hash nonstandard calls; stricter fields require an +! explicit hash token so source text cannot choose a different family. + ok=.true. + n28=-1 + cw=token + if(cw(1:3).eq.'DE ' .or. cw(1:4).eq.'QRZ ' .or. & + cw(1:3).eq.'CQ ' .or. cw(1:3).eq.'CQ_') then + trial_facts=hash_facts + call pack28_core(cw,n28,trial_facts) + if(n28.lt.PACK77_NTOKENS) return endif + cw=token + if(pack77_valid_hash_call_token(cw) .or. pack77_c28_standard_shape(cw)) then + call pack28_core(cw,n28,hash_facts) + return + endif + + if(.not.allow_auto_hash) then + ok=.false. + return + endif + + call pack28_core(cw,n28,hash_facts) + return -end subroutine unpack28var +end subroutine lower_c28_slot -subroutine split77var(msg,nwords,nw,w) -! Convert msg to upper case; collapse multiple blanks; parse into words. +integer function pack77_c28_render_len(token) result(n) + character(len=*), intent(in) :: token + integer :: m - character*37 msg - character*13 w(19) - character*1 c,c0 - character*6 bcall_1 - logical ok1 - integer nw(19) - - iz=len(trim(msg)) - j=0 - k=0 - n=0 - c0=' ' - w=' ' - do i=1,iz - if(ichar(msg(i:i)).eq.0) msg(i:i)=' ' - c=msg(i:i) !Single character - if(c.eq.' ' .and. c0.eq.' ') cycle !Skip leading/repeated blanks - if(c.ne.' ' .and. c0.eq.' ') then - k=k+1 !New word - n=0 + m=len_trim(token) + n=m + if(pack77_valid_hash_call_token(token)) return + if(.not.pack77_c28_standard_shape(token)) then + if(m.gt.11) then + n=-1 + else + n=m+2 endif - j=j+1 !Index in msg - n=n+1 !Index in word - if(c.ge.'a' .and. c.le.'z') c=char(ichar(c)-32) !Force upper case - msg(j:j)=c - if(n.le.13) w(k)(n:n)=c !Copy character c into word - c0=c - enddo - iz=j !Message length - nwords=k !Number of words in msg - if(nwords.le.0) go to 900 - nw(k)=len(trim(w(k))) - msg(iz+1:)=' ' - if(nwords.lt.3) go to 900 - call chkcall(w(3),bcall_1,ok1) - if(ok1 .and. w(1)(1:3).eq.'CQ ') then - w(1)='CQ_'//w(2)(1:10) !Make "CQ " into "CQ_" - w(2:12)=w(3:13) !Move all remeining words down by one - nwords=nwords-1 endif - -900 return -end subroutine split77var +end function pack77_c28_render_len -subroutine pack77_01var(nwords,w,i3,n3,c77,ntxhash) +logical function pack77_dxpedition_render_fits(source) result(ok) + type(pack77_dxpedition_source), intent(in) :: source + integer :: n,ncall + + ok=.false. + n=pack77_c28_render_len(source%call_1) + if(n.lt.0) return + ncall=pack77_c28_render_len(source%call_2) + if(ncall.lt.0) return + n=n+1+5+1+ncall+1+len_trim(source%hash_token)+1+3 + ok=n.le.37 +end function pack77_dxpedition_render_fits + + +logical function pack77_field_day_render_fits(source) result(ok) + type(pack77_field_day_source), intent(in) :: source + character(len=3) :: section + integer :: n,ncall,nexch + + ok=.false. + section=pack77_arrl_section_name(source%isec) + nexch=2 + if(source%ntx.ge.10) nexch=3 + n=pack77_c28_render_len(source%call_1) + if(n.lt.0) return + ncall=pack77_c28_render_len(source%call_2) + if(ncall.lt.0) return + n=n+1+ncall+1+nexch+1+len_trim(section) + if(source%ir.eq.1) n=n+2 + ok=n.le.37 +end function pack77_field_day_render_fits + + +subroutine unpack28_configured(n28_0,c13,success) + integer, intent(in) :: n28_0 + character*13 c13 + logical success + + call unpack28_core(n28_0,c13,success,.true.) + + return +end subroutine unpack28_configured + +type(pack77_candidate) function pack77_01_candidate(msg) result(candidate) ! Pack a Type 0.1 message: DXpedition mode ! Example message: "K1ABC RR73; W9XYZ -11" 28 28 10 5 - character*13 w(19),c13 + character(len=*), intent(in) :: msg character*77 c77 - character*6 bcall_1,bcall_2 - logical ok1,ok2,lhashit - integer, intent(in) :: ntxhash - - if(nwords.ne.5) go to 900 !Must have 5 words - if(trim(w(2)).ne.'RR73;') go to 900 !2nd word must be "RR73;" - if(w(4)(1:1).ne.'<') go to 900 !4th word must have <...> - if(index(w(4),'>').lt.1) go to 900 - n=-99 - read(w(5),*,err=1) n -1 if(n.eq.-99) go to 900 !5th word must be a valid report - n5=(n+30)/2 - if(n5.lt.0) n5=0 - if(n5.gt.31) n5=31 - call chkcall(w(1),bcall_1,ok1) - if(.not.ok1) go to 900 !1st word must be a valid basecall - call chkcall(w(3),bcall_2,ok2) - if(.not.ok2) go to 900 !3rd word must be a valid basecall + type(pack77_dxpedition_source) :: source + integer :: n28a,n28b + logical ok,matched_shape -! Type 0.1: K1ABC RR73; W9XYZ -11 28 28 10 5 71 DXpedition special msg - i3=0 - n3=1 - call pack28var(w(1),n28avar,ntxhash) - call pack28var(w(3),n28bvar,ntxhash) - lhashit=.false.; if(ntxhash.eq.1) lhashit=.true. - call save_hash_txcallvar(w(4),n10,n12,n22,lhashit) - i2=index(w(4),'>') - c13=w(4)(2:i2-1) - n10=ihashcall(c13,10) - write(c77,1010) n28avar,n28bvar,n10,n5,n3,i3 -1010 format(2b28.28,b10.10,b5.5,2b3.3) - -900 return -end subroutine pack77_01var + candidate%result=pack77_no_match() + call pack77_parse_dxpedition_source(msg,source,ok,matched_shape) + if(.not.ok) return + if(.not.pack77_dxpedition_render_fits(source)) return -subroutine pack77_03var(nwords,w,i3,n3,c77,ntxhash) +! Type 0.1: K1ABC RR73; W9XYZ -11 28 28 10 5 71 DXpedition special msg + call lower_c28_slot(source%call_1,.true.,n28a,candidate%hash_facts,ok) + if(.not.ok) return + call lower_c28_slot(source%call_2,.true.,n28b,candidate%hash_facts,ok) + if(.not.ok) return + call pack77_hash_index(candidate%hash_facts,source%hash_token,10,n10,ok) + if(.not.ok) return + call encode_pack77_dxpedition(n28a,n28b,n10,source%n5,c77,ok) + call pack77_accept_candidate_encoded(candidate,0,1,c77,ok) +end function pack77_01_candidate + +type(pack77_candidate) function pack77_03_candidate(msg) result(candidate) ! Check 0.3 and 0.4 (ARRL Field Day exchange) -! Example message: WA9XYZ KA1ABC R 16A EMA 28 28 1 4 3 7 71 +! Example message: WA9XYZ KA1ABC R 16A EMA 28 28 1 4 3 7 71 - parameter (NSEC=86) !Number of ARRL Sections - character*13 w(19) + character(len=*), intent(in) :: msg character*77 c77 - character*6 bcall_1,bcall_2 - character*3 csec(NSEC) - logical ok1,ok2 - integer, intent(in) :: ntxhash - data csec/ & - "AB ","AK ","AL ","AR ","AZ ","BC ","CO ","CT ","DE ","EB ", & - "EMA","ENY","EPA","EWA","GA ","GH ","IA ","ID ","IL ","IN ", & - "KS ","KY ","LA ","LAX","NS ","MB ","MDC","ME ","MI ","MN ", & - "MO ","MS ","MT ","NC ","ND ","NE ","NFL","NH ","NL ","NLI", & - "NM ","NNJ","NNY","TER","NTX","NV ","OH ","OK ","ONE","ONN", & - "ONS","OR ","ORG","PAC","PR ","QC ","RI ","SB ","SC ","SCV", & - "SD ","SDG","SF ","SFL","SJV","SK ","SNJ","STX","SV ","TN ", & - "UT ","VA ","VI ","VT ","WCF","WI ","WMA","WNY","WPA","WTX", & - "WV ","WWA","WY ","DX ","PE ","NB "/ - - if(nwords.lt.4 .or. nwords.gt.5) return - call chkcall(w(1),bcall_1,ok1) - call chkcall(w(2),bcall_2,ok2) - if(.not.ok1 .or. .not.ok2) return - isec=-1 - do i=1,NSEC - if(csec(i).eq.w(nwords)(1:3)) then - isec=i - exit - endif - enddo - if(isec.eq.-1) return - if(nwords.eq.5 .and. trim(w(3)).ne.'R') return - - ntx=-1 - j=len(trim(w(nwords-1)))-1 - read(w(nwords-1)(1:j),*,err=1,end=1) ntx !Number of transmitters -1 if(ntx.lt.1 .or. ntx.gt.32) return - nclass=ichar(w(nwords-1)(j+1:j+1))-ichar('A') - - m=len(trim(w(nwords))) !Length of section abbreviation - if(m.lt.2 .or. m.gt.3) return + type(pack77_field_day_source) :: source + integer :: n28a,n28b + logical ok,matched_shape + + candidate%result=pack77_no_match() + call pack77_parse_field_day_source(msg,source,ok,matched_shape) + if(.not.ok) return + if(.not.pack77_field_day_render_fits(source)) return ! 0.3 WA9XYZ KA1ABC R 16A EMA 28 28 1 4 3 7 71 ARRL Field Day ! 0.4 WA9XYZ KA1ABC R 32A EMA 28 28 1 4 3 7 71 ARRL Field Day - - i3=0 + n3=3 !Type 0.3 ARRL Field Day - intx=ntx-1 + intx=source%ntx-1 if(intx.ge.16) then n3=4 !Type 0.4 ARRL Field Day - intx=ntx-17 + intx=source%ntx-17 endif - call pack28var(w(1),n28avar,ntxhash) - call pack28var(w(2),n28bvar,ntxhash) - ir=0 - if(w(3)(1:2).eq.'R ') ir=1 - write(c77,1010) n28avar,n28bvar,ir,intx,nclass,isec,n3,i3 -1010 format(2b28.28,b1,b4.4,b3.3,b7.7,2b3.3) + call lower_c28_slot(source%call_1,.true.,n28a,candidate%hash_facts,ok) + if(.not.ok) return + call lower_c28_slot(source%call_2,.true.,n28b,candidate%hash_facts,ok) + if(.not.ok) return + if(n3.eq.3) then + call encode_pack77_field_day_low(n28a,n28b,source%ir,intx, & + source%nclass,source%isec,c77,ok) + else + call encode_pack77_field_day_high(n28a,n28b,source%ir,intx, & + source%nclass,source%isec,c77,ok) + endif + call pack77_accept_candidate_encoded(candidate,0,n3,c77,ok) return -end subroutine pack77_03var +end function pack77_03_candidate -subroutine pack77_06var(nwords,w,i3,n3,c77,i3_hint,n3_hint,ntxhash) +type(pack77_candidate) function pack77_06_candidate(msg,prefer_wspr_50bit) result(candidate) - character*13 w(19) + character(len=*), intent(in) :: msg character*77 c77 - character*6 bcall,grid6 - character*4 grid4 - character*1 c - character*36 a2 - integer, intent(in) :: ntxhash - data a2/'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/,nzzz/46656/ - - logical is_grid4,is_grid6,is_digit,ok - is_grid4(grid4)=len(trim(grid4)).eq.4 .and. & - grid4(1:1).ge.'A' .and. grid4(1:1).le.'R' .and. & - grid4(2:2).ge.'A' .and. grid4(2:2).le.'R' .and. & - grid4(3:3).ge.'0' .and. grid4(3:3).le.'9' .and. & - grid4(4:4).ge.'0' .and. grid4(4:4).le.'9' - - is_grid6(grid6)=(len(trim(grid6)).eq.6.or.len(trim(grid6)).eq.4).and. & - grid6(1:1).ge.'A' .and. grid6(1:1).le.'R' .and. & - grid6(2:2).ge.'A' .and. grid6(2:2).le.'R' .and. & - grid6(3:3).ge.'0' .and. grid6(3:3).le.'9' .and. & - grid6(4:4).ge.'0' .and. grid6(4:4).le.'9' .and. & - (len(trim(grid6)).eq.4.or. & - (grid6(5:5).ge.'A' .and. grid6(5:5).le.'X' .and. & - grid6(6:6).ge.'A' .and. grid6(6:6).le.'X')) - - is_digit(c)=c.ge.'0' .and. c.le.'9' - - m1=len(trim(w(1))) - m2=len(trim(w(2))) - m3=len(trim(w(3))) - if(nwords.eq.3 .and. m1.ge.3 .and. m1.le.6 .and. m2.eq.4 .and. m3.le.2) then + type(pack77_wspr_source) :: source + logical, intent(in) :: prefer_wspr_50bit + logical ok,matched_shape + + candidate%result=pack77_no_match() + call pack77_parse_wspr_source(msg,source,ok,matched_shape) + if(.not.ok) return + + if(source%subtype.eq.1) then ! WSPR Type 1 - if(.not.is_grid4(w(2)(1:4))) go to 900 - if(.not.is_digit(w(3)(1:1))) go to 900 - if(m3.eq.2) then - if(.not.is_digit(w(3)(2:2))) go to 900 - endif - i3=0 - n3=6 - call pack28var(w(1),n28,ntxhash) - grid4=w(2)(1:4) - k1=(ichar(grid4(1:1))-ichar('A'))*18*10*10 - k2=(ichar(grid4(2:2))-ichar('A'))*10*10 - k3=(ichar(grid4(3:3))-ichar('0'))*10 - k4=(ichar(grid4(4:4))-ichar('0')) - igrid4=k1+k2+k3+k4 - read(w(3),*) idbm - if(idbm.lt.0) idbm=0 - if(idbm.gt.60) idbm=60 - idbm=nint(0.3*idbm) - write(c77,1010) n28,igrid4,idbm,0,0,0,n3,i3 -1010 format(b28.28,b15.15,b5.5,2i1,b21.21,2b3.3) - go to 900 + call lower_c28_slot(source%call_token,.false.,n28,candidate%hash_facts,ok) + if(.not.ok) return + igrid4=pack77_grid4_index(source%grid4) + call encode_pack77_wspr_type1(n28,igrid4,source%idbm,c77,ok) + call pack77_accept_candidate_encoded(candidate,0,6,c77,ok) + return endif - if(nwords.eq.2 .and. m1.ge.5 .and. m1.le.10 .and. m2.le.2) then + + if(source%subtype.eq.2) then ! WSPR Type 2 - i1=index(w(1),'/') - if(i1.lt.2 .or. i1.eq.m1) go to 900 - if(.not.is_digit(w(2)(1:1))) go to 900 - if(i1.eq.(m1-3) .and. .not.is_digit(w(1)(m1:m1))) go to 900 - if(m2.eq.2) then - if(.not.is_digit(w(2)(2:2))) go to 900 - endif - call chkcall(w(1),bcall,ok) - if(.not.ok) go to 900 - if(i1.le.4) then -! We have a prefix - npfx=index(a2,w(1)(1:1))-1 - if(i1.ge.3) npfx=36*npfx + index(a2,w(1)(2:2))-1 - if(i1.eq.4) npfx=36*npfx + index(a2,w(1)(3:3))-1 - else -! We have a suffix - if((m1-i1).eq.1) npfx=index(a2,w(1)(i1+1:i1+1))-1 - if((m1-i1).eq.2) npfx=36*(index(a2,w(1)(i1+1:i1+1))-1) + & - index(a2,w(1)(i1+2:i1+2))-1 - if((m1-i1).eq.3) then -! Third character of a suffix must be a digit - if(.not.is_digit(w(1)(i1+3:i1+3))) go to 900 - npfx=36*10*(index(a2,w(1)(i1+1:i1+1))-1) + & - 10*(index(a2,w(1)(i1+2:i1+2))-1) + index(a2,w(1)(i1+3:i1+3))-1 - endif - npfx=npfx + nzzz - endif - i3=0 - n3=6 - call pack28var(bcall//' ',n28,ntxhash) - read(w(2),*) idbm - if(idbm.lt.0) idbm=0 - if(idbm.gt.60) idbm=60 - idbm=nint(0.3*idbm) - write(c77,1020) n28,npfx,idbm,1,0,n3,i3 -1020 format(b28.28,b16.16,b5.5,i1,b21.21,2b3.3) - go to 900 + call lower_c28_slot(source%base_call//' ',.false.,n28, & + candidate%hash_facts,ok) + if(.not.ok) return + call encode_pack77_wspr_type2(n28,source%npfx,source%idbm,c77,ok) + call pack77_accept_candidate_encoded(candidate,0,6,c77,ok) + return endif - if(i3_hint.eq.0.and.n3_hint.eq.6.and.nwords.eq.2 .and. m1.ge.5 & - .and. m1.le.12 .and. m2.le.6) then + if(source%subtype.eq.3 .and. prefer_wspr_50bit) then ! WSPR Type 3 - !n3_hint=6 and i3_hint=0 is a hint that the caller wanted a - !50-bit encoding rather than the possible alternative n3=4 77-bit - !encoding - if(index(w(1),'<').lt.1 .or. index(w(1),'>').lt.1) go to 900 - grid6=w(2)(1:6) - if(.not.is_grid6(grid6)) go to 900 - i3=0 - n3=6 - call pack28var(w(1),n28,ntxhash) - n22=n28-2063592 - k1=(ichar(grid6(1:1))-ichar('A'))*18*10*10*25*25 - k2=(ichar(grid6(2:2))-ichar('A'))*10*10*25*25 - k3=(ichar(grid6(3:3))-ichar('0'))*10*25*25 - k4=(ichar(grid6(4:4))-ichar('0'))*25*25 - if (grid6(5:6).eq.' ') then - igrid6=k1+k2+k3+k4+24*25+24 - else - k5=(ichar(grid6(5:5))-ichar('A'))*25 - k6=(ichar(grid6(6:6))-ichar('A')) - igrid6=k1+k2+k3+k4+k5+k6 - endif - write(c77,1030) n22,igrid6,2,0,n3,i3 -1030 format(b22.22,b25.25,b3.3,b21.21,2b3.3) + ! n3=6 and i3=0 are an advisory preference for the caller's + ! 50-bit encoding over the possible alternative n3=4 77-bit + ! encoding. + call pack77_hash_index(candidate%hash_facts,source%hash_token,22,n22,ok) + if(.not.ok) return + igrid6=pack77_grid6_wspr_index(source%grid6) + call encode_pack77_wspr_type3(n22,igrid6,c77,ok) + call pack77_accept_candidate_encoded(candidate,0,6,c77,ok) endif +end function pack77_06_candidate -900 return -end subroutine pack77_06var +type(pack77_candidate) function pack77_1_candidate(msg) result(candidate) -subroutine pack77_1var(nwords,w,i3,n3,c77,ntxhash) +! Type 1/2 source grammar lowers only exact c28 call-slot forms. -! Check Type 1 (Standard 77-bit message) and Type 2 (ditto, with a "/P" call) -! Example message: WA9XYZ/R KA1ABC/R R FN42 28 1 28 1 1 15 74 - - parameter (MAXGRID4=32400) - character*13 w(19),c13 + character(len=*), intent(in) :: msg character*77 c77 - character*6 bcall_1,bcall_2 - character*4 grid4 - character c1*1,c2*2 - logical is_grid4 - logical ok1,ok2 - integer, intent(in) :: ntxhash - is_grid4(grid4)=len(trim(grid4)).eq.4 .and. & - grid4(1:1).ge.'A' .and. grid4(1:1).le.'R' .and. & - grid4(2:2).ge.'A' .and. grid4(2:2).le.'R' .and. & - grid4(3:3).ge.'0' .and. grid4(3:3).le.'9' .and. & - grid4(4:4).ge.'0' .and. grid4(4:4).le.'9' - - if(nwords.lt.2 .or. nwords.gt.4) return - call chkcall(w(1),bcall_1,ok1) - call chkcall(w(2),bcall_2,ok2) - if(w(1)(1:3).eq.'DE ' .or. w(1)(1:3).eq.'CQ_' .or. w(1)(1:3).eq.'CQ ' .or. & - w(1)(1:4).eq.'QRZ ') ok1=.true. - if(w(1)(1:1).eq.'<' .and. index(w(1),'>').ge.5) ok1=.true. - if(w(2)(1:1).eq.'<' .and. index(w(2),'>').ge.5) ok2=.true. - if(.not.ok1 .or. .not.ok2) return - if(w(1)(1:1).eq.'<' .and. index(w(2),'/').gt.0) return - if(w(2)(1:1).eq.'<' .and. index(w(1),'/').gt.0) return - if(nwords.eq.2 .and. (.not.ok2 .or. index(w(2),'/').ge.2)) return - if(nwords.eq.2) go to 10 - - c1=w(nwords)(1:1) - c2=w(nwords)(1:2) - if(.not.is_grid4(w(nwords)(1:4)) .and. c1.ne.'+' .and. c1.ne.'-' & - .and. c2.ne.'R+' .and. c2.ne.'R-' .and. trim(w(nwords)).ne.'RRR' .and. & - trim(w(nwords)).ne.'RR73' .and. trim(w(nwords)).ne.'73') return - if(c1.eq.'+' .or. c1.eq.'-') then - ir=0 - read(w(nwords),*,err=900) irpt - if(irpt.ge.-50 .and. irpt.le.-31) irpt=irpt+101 - irpt=irpt+35 - else if(c2.eq.'R+' .or. c2.eq.'R-') then - ir=1 - read(w(nwords)(2:),*,err=900) irpt - if(irpt.ge.-50 .and. irpt.le.-31) irpt=irpt+101 - irpt=irpt+35 - else if(trim(w(nwords)).eq.'RRR') then - ir=0 - irpt=2 - else if(trim(w(nwords)).eq.'RR73') then - ir=0 - irpt=3 - else if(trim(w(nwords)).eq.'73') then - ir=0 - irpt=4 - endif - -! 1 WA9XYZ/R KA1ABC/R R FN42 28 1 28 1 1 15 74 Standard msg -! 2 PA3XYZ/P GM4ABC/P R JO22 28 1 28 1 1 15 74 EU VHF contest - -10 i1psuffix=index(w(1)//' ' ,'/P ') - i2psuffix=index(w(2)//' ','/P ') - if(nwords.eq.2 .or. nwords.eq.3 .or. (nwords.eq.4 .and. & - w(3)(1:2).eq.'R ')) then - n3=0 - i3=1 !Type 1: Standard message, possibly with "/R" - if (i1psuffix.ge.4.or.i2psuffix.ge.4) i3=2 !Type 2, with "/P" - endif - c13=bcall_1 - if(c13(1:3).eq.'CQ_' .or. w(1)(1:1).eq.'<') c13=w(1) - call pack28var(c13,n28avar,ntxhash) - c13=bcall_2 - if(w(2)(1:1).eq.'<') c13=w(2) - call pack28var(c13,n28bvar,ntxhash) + type(pack77_type12_source) :: source + integer :: n28a,n28b + logical ok + + candidate%result=pack77_no_match() + call pack77_parse_type12_source(msg,source,ok) + if(.not.ok) return + + call lower_c28_slot(source%call_1%c28_token,.false.,n28a, & + candidate%hash_facts,ok) + if(.not.ok) return + call lower_c28_slot(source%call_2%c28_token,.false.,n28b, & + candidate%hash_facts,ok) + if(.not.ok) return + ipa=0 ipb=0 - if(i1psuffix.ge.4.or.index(w(1)//' ','/R ').ge.4) ipa=1 - if(i2psuffix.ge.4.or.index(w(2)//' ','/R ').ge.4) ipb=1 - - grid4=w(nwords)(1:4) - if(is_grid4(grid4)) then - ir=0 - if(w(3).eq.'R ') ir=1 - j1=(ichar(grid4(1:1))-ichar('A'))*18*10*10 - j2=(ichar(grid4(2:2))-ichar('A'))*10*10 - j3=(ichar(grid4(3:3))-ichar('0'))*10 - j4=(ichar(grid4(4:4))-ichar('0')) - igrid4=j1+j2+j3+j4 + if(pack77_type12_call_has_suffix(source%call_1)) ipa=1 + if(pack77_type12_call_has_suffix(source%call_2)) ipb=1 + + if(source%i3.eq.1) then + call encode_pack77_type1(n28a,ipa,n28b,ipb, & + source%ir,source%igrid4,c77,ok) else - igrid4=MAXGRID4 + irpt + call encode_pack77_type2(n28a,ipa,n28b,ipb, & + source%ir,source%igrid4,c77,ok) endif - if(nwords.eq.2) then - ir=0 - irpt=1 - igrid4=MAXGRID4+irpt - endif - write(c77,1000) n28avar,ipa,n28bvar,ipb,ir,igrid4,i3 -1000 format(2(b28.28,b1),b1,b15.15,b3.3) - return - -900 return -end subroutine pack77_1var + call pack77_accept_candidate_encoded(candidate,source%i3,0,c77,ok) +end function pack77_1_candidate -subroutine pack77_3var(nwords,w,i3,n3,c77,ntxhash) +type(pack77_candidate) function pack77_3_candidate(msg) result(candidate) ! Check Type 3 (ARRL RTTY contest exchange) !ARRL RTTY - US/Can: rpt state/prov R 579 MA ! - DX: rpt serial R 559 0013 ! Example message: TU; W9XYZ K1ABC R 579 MA 1 28 28 1 3 13 74 - parameter (NUSCAN=171) !Number of US states and Canadian provinces/territories - character*13 w(19) + character(len=*), intent(in) :: msg character*77 c77 - character*6 bcall_1,bcall_2 - character*3 cmult(NUSCAN),mult - character crpt*3 - integer, intent(in) :: ntxhash - logical ok1,ok2 - data cmult/ & - "AL ","AK ","AZ ","AR ","CA ","CO ","CT ","DE ","FL ","GA ", & - "HI ","ID ","IL ","IN ","IA ","KS ","KY ","LA ","ME ","MD ", & - "MA ","MI ","MN ","MS ","MO ","MT ","NE ","NV ","NH ","NJ ", & - "NM ","NY ","NC ","ND ","OH ","OK ","OR ","PA ","RI ","SC ", & - "SD ","TN ","TX ","UT ","VT ","VA ","WA ","WV ","WI ","WY ", & - "NB ","NS ","QC ","ON ","MB ","SK ","AB ","BC ","NWT","NF ", & - "LB ","NU ","YT ","PEI","DC ","DR ","FR ","GD ","GR ","OV ", & - "ZH ","ZL ","X01","X02","X03","X04","X05","X06","X07","X08", & - "X09","X10","X11","X12","X13","X14","X15","X16","X17","X18", & - "X19","X20","X21","X22","X23","X24","X25","X26","X27","X28", & - "X29","X30","X31","X32","X33","X34","X35","X36","X37","X38", & - "X39","X40","X41","X42","X43","X44","X45","X46","X47","X48", & - "X49","X50","X51","X52","X53","X54","X55","X56","X57","X58", & - "X59","X60","X61","X62","X63","X64","X65","X66","X67","X68", & - "X69","X70","X71","X72","X73","X74","X75","X76","X77","X78", & - "X79","X80","X81","X82","X83","X84","X85","X86","X87","X88", & - "X89","X90","X91","X92","X93","X94","X95","X96","X97","X98", & - "X99"/ - - if(w(1)(1:1).eq.'<' .and. w(2)(1:1).eq.'<') go to 900 - if(nwords.eq.4 .or. nwords.eq.5 .or. nwords.eq.6) then - i1=1 - if(trim(w(1)).eq.'TU;') i1=2 - call chkcall(w(i1),bcall_1,ok1) - call chkcall(w(i1+1),bcall_2,ok2) - if(.not.ok1 .or. .not.ok2) go to 900 - crpt=w(nwords-1)(1:3) - if(index(crpt,'-').ge.1 .or. index(crpt,'+').ge.1) go to 900 - if(crpt(1:1).eq.'5' .and. crpt(2:2).ge.'2' .and. crpt(2:2).le.'9' .and. & - crpt(3:3).eq.'9') then - nserial=0 - read(w(nwords),*,err=1) nserial - endif -1 mult=' ' - imult=-1 - do i=1,NUSCAN - if(cmult(i).eq.w(nwords)) then - imult=i - mult=cmult(i) - exit - endif - enddo - nexch=0 - if(nserial.gt.0) nexch=nserial - if(imult.gt.0) nexch=8000+imult - if(mult.ne.' ' .or. nserial.gt.0) then - i3=3 - n3=0 - itu=0 - if(trim(w(1)).eq.'TU;') itu=1 - call pack28var(w(1+itu),n28avar,ntxhash) - call pack28var(w(2+itu),n28bvar,ntxhash) - ir=0 - if(w(3+itu)(1:2).eq.'R ') ir=1 - read(w(3+itu+ir),*,err=900) irpt - irpt=(irpt-509)/10 - 2 - if(irpt.lt.0) irpt=0 - if(irpt.gt.7) irpt=7 + character*4 exchange + type(pack77_type3_source) :: source + integer :: n28a,n28b + logical ok,matched_shape + + candidate%result=pack77_no_match() + call pack77_parse_type3_source(msg,source,ok,matched_shape) + if(.not.ok) return + + call lower_c28_slot(source%call_1,.true.,n28a,candidate%hash_facts,ok) + if(.not.ok) return + call lower_c28_slot(source%call_2,.true.,n28b,candidate%hash_facts,ok) + if(.not.ok) return + exchange=' ' + if(source%nexch.gt.0 .and. source%nexch.lt.8000) & + write(exchange,'(i4.4)') source%nexch + if(source%nexch.gt.8000) & + exchange=pack77_rtty_multiplier_name(source%nexch-8000) + if(.not.pack77_type3_display_fits(source%itu,source%ir,n28a, & + n28b,source%call_1,source%call_2,exchange)) return ! 3 TU; W9XYZ K1ABC R 579 MA 1 28 28 1 3 13 74 ARRL RTTY contest ! 3 TU; W9XYZ G8ABC R 559 0013 1 28 28 1 3 13 74 ARRL RTTY (DX) - write(c77,1010) itu,n28avar,n28bvar,ir,irpt,nexch,i3 -1010 format(b1,2b28.28,b1,b3.3,b13.13,b3.3) - endif - endif + call encode_pack77_type3(source%itu,n28a,n28b,source%ir,source%irpt, & + source%nexch,c77,ok) + call pack77_accept_candidate_encoded(candidate,3,0,c77,ok) +end function pack77_3_candidate -900 return -end subroutine pack77_3var - -subroutine pack77_4var(nwords,w,i3,n3,c77,ntxhash) +type(pack77_candidate) function pack77_4_candidate(msg) result(candidate) ! Check Type 4 (One nonstandard call and one hashed call) ! Example message: PJ4/KA1ABC RR73 12 58 1 2 1 74 + character(len=*), intent(in) :: msg integer*8 n58 - logical ok1,ok2,lhashit - character*13 w(19) character*77 c77 - character*13 call_1,call_2 character*11 c11 - character*6 bcall_1,bcall_2 - character*38 c - integer, intent(in) :: ntxhash - data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/'/ - - iflip=0 - i3=-1 - if(nwords.eq.2 .or. nwords.eq.3) then - call_1=w(1) - if(call_1(1:1).eq.'<') call_1=w(1)(2:len(trim(w(1)))-1) - call_2=w(2) - if(call_2(1:1).eq.'<') call_2=w(2)(2:len(trim(w(2)))-1) - call chkcall(call_1,bcall_1,ok1) - call chkcall(call_2,bcall_2,ok2) - if(call_1.eq.bcall_1 .and. call_2.eq.bcall_2 .and. ok1 .and. ok2) go to 900 - icq=0 - if(trim(w(1)).eq.'CQ' .or. (ok1.and.ok2)) then - if(trim(w(1)).eq.'CQ' .and. len(trim(w(2))).le.4) go to 900 - i3=4 - n3=0 - if(trim(w(1)).eq.'CQ') icq=1 - endif + character*13 hash_token + type(pack77_type4_source) :: source + logical ok - lhashit=.false.; if(ntxhash.eq.1) lhashit=.true. - if(icq.eq.1) then - iflip=0 - n12=0 - c11=adjustr(call_2(1:11)) - call save_hash_txcallvar(w(2),n10,n12,n22,lhashit) - else if(w(1)(1:1).eq.'<') then - iflip=0 - i3=4 - call save_hash_txcallvar(w(1),n10,n12,n22,lhashit) - c11=adjustr(call_2(1:11)) - else if(w(2)(1:1).eq.'<') then - iflip=1 - i3=4 - call save_hash_txcallvar(w(2),n10,n12,n22,lhashit) - c11=adjustr(call_1(1:11)) - endif - n58=0 - do i=1,11 - n58=n58*38 + index(c,c11(i:i)) - 1 - enddo - nrpt=0 - if(trim(w(3)).eq.'RRR') nrpt=1 - if(trim(w(3)).eq.'RR73') nrpt=2 - if(trim(w(3)).eq.'73') nrpt=3 - if(icq.eq.1) then - iflip=0 - nrpt=0 - endif - write(c77,1010) n12,n58,iflip,nrpt,icq,i3 -1010 format(b12.12,b58.58,b1,b2.2,b1,b3.3) - do i=1,77 - if(c77(i:i).eq.'*') c77(i:i)='0' !### Clean up any illegal chars ### - enddo - endif + candidate%result=pack77_no_match() + call pack77_parse_type4_source(msg,source,ok) + if(.not.ok) return -900 return -end subroutine pack77_4var + hash_token=source%hash_token + if(source%icq.eq.1 .and. len_trim(hash_token).eq.0) hash_token=source%c11 + call pack77_hash_index(candidate%hash_facts,hash_token,12,n12,ok) + if(.not.ok) return + c11=adjustr(source%c11) + n58=pack77_type4_n58_from_call_text(c11) + nrpt=pack77_type4_nrpt_from_tail(source%itail) + if(source%icq.eq.1) nrpt=0 + call encode_pack77_type4(n12,n58,source%iflip,nrpt,source%icq,c77,ok) + call pack77_accept_candidate_encoded(candidate,4,0,c77,ok) +end function pack77_4_candidate -subroutine pack77_5var(nwords,w,i3,n3,c77,ntxhash) +type(pack77_candidate) function pack77_5_candidate(msg) result(candidate) ! Pack a Type 0.2 message: EU VHF Contest mode ! Example message: PA3XYZ/P R 590003 IO91NP 28 1 1 3 12 25 ! R 590003 IO91NP h10 h20 r1 s3 s12 g25 - character*13 w(19),c13 + character(len=*), intent(in) :: msg character*77 c77 - character*6 grid6 - logical is_grid6,lhashit - integer, intent(in) :: ntxhash - - is_grid6(grid6)=len(trim(grid6)).eq.6 .and. & - grid6(1:1).ge.'A' .and. grid6(1:1).le.'R' .and. & - grid6(2:2).ge.'A' .and. grid6(2:2).le.'R' .and. & - grid6(3:3).ge.'0' .and. grid6(3:3).le.'9' .and. & - grid6(4:4).ge.'0' .and. grid6(4:4).le.'9' .and. & - grid6(5:5).ge.'A' .and. grid6(5:5).le.'X' .and. & - grid6(6:6).ge.'A' .and. grid6(6:6).le.'X' - - if(nwords.lt.4 .or. nwords.gt.5) return !nwords must be 4 or 5 - if(w(1)(1:1).ne.'<' .or. w(2)(1:1).ne.'<') return !Both calls must be hashed - nx=-1 - read(w(nwords-1),*,err=2) nx -2 if(nx.lt.520001 .or. nx.gt.594095) return !Exchange between 520001 - 594095 - if(.not.is_grid6(w(nwords)(1:6))) return !Last word must be a valid grid6 - -! Type 0.2: R 590003 IO91NP h10 h20 r1 s3 s12 g25 - - i3=5 - n3=0 - - lhashit=.false.; if(ntxhash.eq.1) lhashit=.true. - call save_hash_txcallvar(w(1),n10,n12,n22,lhashit) - i2=index(w(1),'>') - c13=w(1)(2:i2-1) - n12=ihashcall(c13,12) - - call save_hash_txcallvar(w(2),n10a,n12a,n22,lhashit) - i2=index(w(2),'>') - c13=w(2)(2:i2-1) - n22=ihashcall(c13,22) - - ir=0 - if(w(3)(1:2).eq.'R ') ir=1 - irpt=nx/10000 - 52 - iserial=mod(nx,10000) - if(iserial.gt.2047) iserial=2047 - grid6=w(nwords)(1:6) - j1=(ichar(grid6(1:1))-ichar('A'))*18*10*10*24*24 - j2=(ichar(grid6(2:2))-ichar('A'))*10*10*24*24 - j3=(ichar(grid6(3:3))-ichar('0'))*10*24*24 - j4=(ichar(grid6(4:4))-ichar('0'))*24*24 - j5=(ichar(grid6(5:5))-ichar('A'))*24 - j6=(ichar(grid6(6:6))-ichar('A')) - igrid6=j1+j2+j3+j4+j5+j6 - write(c77,1010) n12,n22,ir,irpt,iserial,igrid6,i3 -1010 format(b12.12,b22.22,b1,b3.3,b11.11,b25.25,b3.3) - - return -end subroutine pack77_5var - -subroutine packtext77var(c13,c71) - - character*13 c13,w - character*71 c71 - character*42 c - character*1 qa(10),qb(10) - data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+-./?'/ - - call mp_short_init - qa=char(0) - w=adjustr(c13) - do i=1,13 - j=index(c,w(i:i))-1 - if(j.lt.0) j=0 - call mp_short_mult(qb,qa(2:10),9,42) !qb(1:9)=42*qa(2:9) - call mp_short_add(qa,qb(2:10),9,j) !qa(1:9)=qb(2:9)+j - enddo - - write(c71,1010) qa(2:10) -1010 format(b7.7,8b8.8) - - return -end subroutine packtext77var - -subroutine unpacktext77var(c71,c13) - - integer*1 ia(10) - character*1 qa(10),qb(10) - character*13 c13 - character*71 c71 - character*42 c - equivalence (qa,ia),(qb,ib) - data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+-./?'/ + type(pack77_type5_source) :: source + logical ok,matched_shape - qa(1)=char(0) - read(c71,1010) qa(2:10) -1010 format(b7.7,8b8.8) - - do i=13,1,-1 - call mp_short_div(qb,qa(2:10),9,42,ir) - c13(i:i)=c(ir+1:ir+1) - qa(2:10)=qb(1:9) - enddo + candidate%result=pack77_no_match() + call pack77_parse_type5_source(msg,source,ok,matched_shape) + if(.not.ok) return - return -end subroutine unpacktext77var - -subroutine add_call_to_recent_callsvar(callsign,nthr) - - character*13 callsign - logical ladd - integer, intent(in) :: nthr - -! only add if the callsign is not already on the list - ladd=.true. - do i=1,MAXRECENT-1 ! if callsign is at the end of the list add it again - if(recent_callsvar(i).eq.callsign) ladd=.false. - enddo +! Type 0.2: R 590003 IO91NP h10 h20 r1 s3 s12 g25 - if(ladd) then - do i=MAXRECENT,2,-1 - recent_callsvar(i)=recent_callsvar(i-1) - enddo - recent_callsvar(1)=callsign - endif + call pack77_hash_index(candidate%hash_facts,source%hash_token_1,12,n12,ok) + if(.not.ok) return + call pack77_hash_index(candidate%hash_facts,source%hash_token_2,22,n22,ok) + if(.not.ok) return -! Make sure that callsign is hashed - call save_hash_callvar(callsign,nthr) + igrid6=pack77_grid6_index(source%grid6) + call encode_pack77_type5(n12,n22,source%ir,source%irpt,source%iserial, & + igrid6,c77,ok) + call pack77_accept_candidate_encoded(candidate,5,0,c77,ok) return -end subroutine add_call_to_recent_callsvar - -subroutine to_grid4var(n,grid4,ok) - character*4 grid4 - logical ok - - ok=.false. - j1=n/(18*10*10) - if (j1.lt.0.or.j1.gt.17) goto 900 - n=n-j1*18*10*10 - j2=n/(10*10) - if (j2.lt.0.or.j2.gt.17) goto 900 - n=n-j2*10*10 - j3=n/10 - if (j3.lt.0.or.j3.gt.9) goto 900 - j4=n-j3*10 - if (j4.lt.0.or.j4.gt.9) goto 900 - grid4(1:1)=char(j1+ichar('A')) - grid4(2:2)=char(j2+ichar('A')) - grid4(3:3)=char(j3+ichar('0')) - grid4(4:4)=char(j4+ichar('0')) - ok=.true. - -900 return -end subroutine to_grid4var - -subroutine to_grid6var(n,grid6,ok) - character*6 grid6 - logical ok - - ok=.false. - j1=n/(18*10*10*24*24) - if (j1.lt.0.or.j1.gt.17) goto 900 - n=n-j1*18*10*10*24*24 - j2=n/(10*10*24*24) - if (j2.lt.0.or.j2.gt.17) goto 900 - n=n-j2*10*10*24*24 - j3=n/(10*24*24) - if (j3.lt.0.or.j3.gt.9) goto 900 - n=n-j3*10*24*24 - j4=n/(24*24) - if (j4.lt.0.or.j4.gt.9) goto 900 - n=n-j4*24*24 - j5=n/24 - if (j5.lt.0.or.j5.gt.23) goto 900 - j6=n-j5*24 - if (j6.lt.0.or.j6.gt.23) goto 900 - grid6(1:1)=char(j1+ichar('A')) - grid6(2:2)=char(j2+ichar('A')) - grid6(3:3)=char(j3+ichar('0')) - grid6(4:4)=char(j4+ichar('0')) - grid6(5:5)=char(j5+ichar('A')) - grid6(6:6)=char(j6+ichar('A')) - ok=.true. - -900 return -end subroutine to_grid6var - -subroutine to_gridvar(n,grid6,ok) - ! 4-, or 6-character grid - character*6 grid6 - logical ok - - ok=.false. - j1=n/(18*10*10*25*25) - if (j1.lt.0.or.j1.gt.17) goto 900 - n=n-j1*18*10*10*25*25 - j2=n/(10*10*25*25) - if (j2.lt.0.or.j2.gt.17) goto 900 - n=n-j2*10*10*25*25 - j3=n/(10*25*25) - if (j3.lt.0.or.j3.gt.9) goto 900 - n=n-j3*10*25*25 - j4=n/(25*25) - if (j4.lt.0.or.j4.gt.9) goto 900 - n=n-j4*25*25 - j5=n/25 - if (j5.lt.0.or.j5.gt.24) goto 900 - j6=n-j5*25 - if (j6.lt.0.or.j6.gt.24) goto 900 - grid6='' - grid6(1:1)=char(j1+ichar('A')) - grid6(2:2)=char(j2+ichar('A')) - grid6(3:3)=char(j3+ichar('0')) - grid6(4:4)=char(j4+ichar('0')) - if (j5.ne.24.or.j6.ne.24) then - grid6(5:5)=char(j5+ichar('A')) - grid6(6:6)=char(j6+ichar('A')) - endif - ok=.true. - -900 return -end subroutine to_gridvar +end function pack77_5_candidate end module packjt77 @@ -3454,7 +2440,6 @@ logical function callok(w) character*(*) w character*1 c1 character*2 pfx - character*3 sfx logical isdig,islet islet(c1)=(ichar(c1).ge.65 .and. ichar(c1).le.90) .or. & @@ -3465,7 +2450,7 @@ logical function callok(w) n=len(trim(w)) if(n.lt.3) return !Must be at lkeast three characters if(w(1:1).eq.'Q') return !Callsigns can't start with Q - + i0=0 do i=n,1,-1 if(isdig(w(i:i))) exit @@ -3475,7 +2460,6 @@ logical function callok(w) if(i0.ne.2 .and. i0.ne.3) return pfx=w(1:i0-1) !Prefix, without call area - sfx=w(i0+1:) !Suffix nlp=0 ndp=0 @@ -3484,16 +2468,18 @@ logical function callok(w) if(isdig(pfx(i:i))) ndp=ndp+1 if(islet(pfx(i:i))) nlp=nlp+1 enddo + if(nlp+ndp.ne.np) return if(nlp.eq.0) return !Prefix must have at least one letter nls=0 - ns=len(trim(sfx)) - do i=1,ns - if(islet(sfx(i:i))) nls=nls+1 + ns=n-i0 + if(ns.lt.1 .or. ns.gt.3) return + do i=i0+1,n + if(islet(w(i:i))) nls=nls+1 enddo if(nls.lt.ns) return !Suffix must be all letters - callok=.true. - + callok=.true. + return end function callok diff --git a/lib/77bit/packjt77_grammar.f90 b/lib/77bit/packjt77_grammar.f90 new file mode 100644 index 00000000..7a2616b0 --- /dev/null +++ b/lib/77bit/packjt77_grammar.f90 @@ -0,0 +1,1530 @@ +module packjt77_grammar + + implicit none + + private :: pack77_gate_staged_call_matches + + integer, parameter :: PACK77_NSEC=86 + integer, parameter :: PACK77_NUSCAN=171 + integer, parameter :: PACK77_WSPR_NZZZ=46656 +! c28 number-space partition: special tokens, then 22-bit hashes, then +! standard callsigns; grid4 indexes above PACK77_MAXGRID4 carry reports. + integer, parameter :: PACK77_NTOKENS=2063592 + integer, parameter :: PACK77_MAX22=4194304 + integer, parameter :: PACK77_MAXGRID4=32400 + character(len=36), parameter :: PACK77_BASE36='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ' + character(len=38), parameter :: PACK77_BASE38=' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/' + character(len=3), parameter :: PACK77_ARRL_SECTIONS(PACK77_NSEC)=(/ & + "AB ","AK ","AL ","AR ","AZ ","BC ","CO ","CT ","DE ","EB ", & + "EMA","ENY","EPA","EWA","GA ","GH ","IA ","ID ","IL ","IN ", & + "KS ","KY ","LA ","LAX","NS ","MB ","MDC","ME ","MI ","MN ", & + "MO ","MS ","MT ","NC ","ND ","NE ","NFL","NH ","NL ","NLI", & + "NM ","NNJ","NNY","TER","NTX","NV ","OH ","OK ","ONE","ONN", & + "ONS","OR ","ORG","PAC","PR ","QC ","RI ","SB ","SC ","SCV", & + "SD ","SDG","SF ","SFL","SJV","SK ","SNJ","STX","SV ","TN ", & + "UT ","VA ","VI ","VT ","WCF","WI ","WMA","WNY","WPA","WTX", & + "WV ","WWA","WY ","DX ","PE ","NB " /) + character(len=3), parameter :: PACK77_RTTY_MULTIPLIERS(PACK77_NUSCAN)=(/ & + "AL ","AK ","AZ ","AR ","CA ","CO ","CT ","DE ","FL ","GA ", & + "HI ","ID ","IL ","IN ","IA ","KS ","KY ","LA ","ME ","MD ", & + "MA ","MI ","MN ","MS ","MO ","MT ","NE ","NV ","NH ","NJ ", & + "NM ","NY ","NC ","ND ","OH ","OK ","OR ","PA ","RI ","SC ", & + "SD ","TN ","TX ","UT ","VT ","VA ","WA ","WV ","WI ","WY ", & + "NB ","NS ","QC ","ON ","MB ","SK ","AB ","BC ","NWT","NF ", & + "LB ","NU ","YT ","PEI","DC ","DR ","FR ","GD ","GR ","OV ", & + "ZH ","ZL ","X01","X02","X03","X04","X05","X06","X07","X08", & + "X09","X10","X11","X12","X13","X14","X15","X16","X17","X18", & + "X19","X20","X21","X22","X23","X24","X25","X26","X27","X28", & + "X29","X30","X31","X32","X33","X34","X35","X36","X37","X38", & + "X39","X40","X41","X42","X43","X44","X45","X46","X47","X48", & + "X49","X50","X51","X52","X53","X54","X55","X56","X57","X58", & + "X59","X60","X61","X62","X63","X64","X65","X66","X67","X68", & + "X69","X70","X71","X72","X73","X74","X75","X76","X77","X78", & + "X79","X80","X81","X82","X83","X84","X85","X86","X87","X88", & + "X89","X90","X91","X92","X93","X94","X95","X96","X97","X98", & + "X99" /) + integer, parameter :: PACK77_TYPE12_SUFFIX_NONE=0 + integer, parameter :: PACK77_TYPE12_SUFFIX_R=1 + integer, parameter :: PACK77_TYPE12_SUFFIX_P=2 + + + type pack77_type12_call_source + character(len=13) :: c28_token='' + integer :: suffix=PACK77_TYPE12_SUFFIX_NONE + logical :: is_hash=.false. + logical :: is_cq=.false. + end type pack77_type12_call_source + + type pack77_type12_source + type(pack77_type12_call_source) :: call_1 + type(pack77_type12_call_source) :: call_2 + integer :: ir=0 + integer :: igrid4=0 + integer :: i3=1 + end type pack77_type12_source + + type pack77_dxpedition_source + character(len=13) :: call_1='',call_2='',hash_token='' + integer :: n5=0 + end type pack77_dxpedition_source + + type pack77_field_day_source + character(len=13) :: call_1='',call_2='' + integer :: ir=0,ntx=0,nclass=0,isec=-1 + end type pack77_field_day_source + + type pack77_wspr_source + character(len=13) :: call_token='',hash_token='' + character(len=6) :: base_call='',grid6='' + character(len=4) :: grid4='' + integer :: subtype=0,idbm=0,npfx=0 + end type pack77_wspr_source + + type pack77_type3_source + character(len=13) :: call_1='',call_2='' + integer :: itu=0,ir=0,irpt=-1,nexch=0 + end type pack77_type3_source + + type pack77_type4_source + character(len=13) :: hash_token='' + character(len=11) :: c11='' + integer :: icq=0,iflip=0,itail=0 + end type pack77_type4_source + + type pack77_type5_source + character(len=13) :: hash_token_1='',hash_token_2='' + character(len=6) :: grid6='' + integer :: ir=0,irpt=0,iserial=0 + end type pack77_type5_source + contains + +integer function pack77_arrl_section_index(section) result(isec) + character(len=*), intent(in) :: section + integer :: i + + isec=-1 + if(len(section).lt.3) return + do i=1,PACK77_NSEC + if(PACK77_ARRL_SECTIONS(i).eq.section(1:3)) then + isec=i + return + endif + enddo + + return +end function pack77_arrl_section_index + +character(len=3) function pack77_arrl_section_name(isec) result(section) + integer, intent(in) :: isec + + section=' ' + if(isec.ge.1 .and. isec.le.PACK77_NSEC) section=PACK77_ARRL_SECTIONS(isec) + + return +end function pack77_arrl_section_name + +integer function pack77_rtty_multiplier_index(multiplier) result(imult) + character(len=*), intent(in) :: multiplier + integer :: i + + imult=-1 + if(len(multiplier).lt.3) return + do i=1,PACK77_NUSCAN + if(PACK77_RTTY_MULTIPLIERS(i).eq.multiplier(1:3)) then + imult=i + return + endif + enddo + + return +end function pack77_rtty_multiplier_index + +character(len=3) function pack77_rtty_multiplier_name(imult) result(multiplier) + integer, intent(in) :: imult + + multiplier=' ' + if(imult.ge.1 .and. imult.le.PACK77_NUSCAN) & + multiplier=PACK77_RTTY_MULTIPLIERS(imult) + + return +end function pack77_rtty_multiplier_name + +integer function pack77_report_index_from_snr(isnr) result(irpt) + integer, intent(in) :: isnr + + if(isnr.lt.-50 .or. isnr.gt.50) then + irpt=-1 + return + endif +! irpt 1..85 covers the legacy -30..+50 dB range; -50..-31 dB fold to +! irpt 86..105 above the old top so pre-extension decoders keep their mapping. + irpt=isnr + if(irpt.ge.-50 .and. irpt.le.-31) irpt=irpt+101 + irpt=irpt+35 + + return +end function pack77_report_index_from_snr + +integer function pack77_snr_from_report_index(irpt) result(isnr) + integer, intent(in) :: irpt + + isnr=irpt-35 + if(isnr.gt.50) isnr=isnr-101 + + return +end function pack77_snr_from_report_index + +character(len=3) function pack77_format_snr_report(isnr) result(crpt) + integer, intent(in) :: isnr + + write(crpt,'(i3.2)') isnr + if(crpt(1:1).eq.' ') crpt(1:1)='+' + + return +end function pack77_format_snr_report + +integer function pack77_rtty_report_index(report) result(irpt) + character(len=*), intent(in) :: report + + irpt=-1 + if(len_trim(report).ne.3) return + if(report(1:1).ne.'5') return + if(report(2:2).lt.'2' .or. report(2:2).gt.'9') return + if(report(3:3).ne.'9') return + irpt=iachar(report(2:2))-iachar('2') +end function pack77_rtty_report_index + +character(len=3) function pack77_format_rtty_report(irpt) result(crpt) + integer, intent(in) :: irpt + + write(crpt,1001) irpt+2 +1001 format('5',i1,'9') + + return +end function pack77_format_rtty_report + +character(len=6) function pack77_format_vhf_exchange(irpt,iserial) result(cexch) + integer, intent(in) :: irpt,iserial + + write(cexch,1002) 52+irpt,iserial +1002 format(i2,i4.4) + + return +end function pack77_format_vhf_exchange + +character(len=37) function pack77_format_type3_message(itu,ir,call_1,call_2,crpt,exchange) result(msg) + integer, intent(in) :: itu,ir + character(len=*), intent(in) :: call_1,call_2,crpt,exchange + character(len=37) :: body + + body=pack77_format_exchange_message(call_1,call_2,ir,crpt//' '//exchange,.true.) + msg=body + if(itu.eq.1) msg='TU; '//trim(body) + + return +end function pack77_format_type3_message + +integer function pack77_type3_message_len(itu,ir,call_1_len,call_2_len,exchange_len) result(nmsg) + integer, intent(in) :: itu,ir,call_1_len,call_2_len,exchange_len + + nmsg=call_1_len + 1 + call_2_len + 1 + 3 + 1 + exchange_len + if(ir.eq.1) nmsg=call_1_len + 1 + call_2_len + 3 + 3 + 1 + exchange_len + if(itu.eq.1) nmsg=nmsg+4 +end function pack77_type3_message_len + +integer function pack77_type3_display_call_len(n28,call_text) result(ncall) + integer, intent(in) :: n28 + character(len=*), intent(in) :: call_text + ncall=len_trim(call_text) + if(n28.ge.PACK77_NTOKENS .and. n28.lt.PACK77_NTOKENS+PACK77_MAX22) then + if(ncall.gt.11) then + ncall=-1 + else + ncall=ncall+2 + endif + endif +end function pack77_type3_display_call_len + +logical function pack77_type3_display_fits(itu,ir,n28a,n28b,call_1,call_2,exchange) result(ok) + integer, intent(in) :: itu,ir,n28a,n28b + character(len=*), intent(in) :: call_1,call_2,exchange + integer :: ncall_1,ncall_2,nmsg + + ok=.false. + ncall_1=pack77_type3_display_call_len(n28a,call_1) + if(ncall_1.lt.0) return + ncall_2=pack77_type3_display_call_len(n28b,call_2) + if(ncall_2.lt.0) return + nmsg=pack77_type3_message_len(itu,ir,ncall_1,ncall_2,len_trim(exchange)) + ok=nmsg.le.37 +end function pack77_type3_display_fits + +logical function pack77_type3_render_fits(itu,ir,call_1,call_2,exchange) result(ok) + integer, intent(in) :: itu,ir + character(len=*), intent(in) :: call_1,call_2,exchange + integer :: ncall_1,ncall_2,nmsg + + ok=.false. + ncall_1=len_trim(call_1) + ncall_2=len_trim(call_2) + if(call_1(1:1).eq.'<' .and. index(call_1,'>').lt.1) return + if(call_2(1:1).eq.'<' .and. index(call_2,'>').lt.1) return + nmsg=pack77_type3_message_len(itu,ir,ncall_1,ncall_2,len_trim(exchange)) + ok=nmsg.le.37 +end function pack77_type3_render_fits + +character(len=37) function pack77_format_qso_tail(call_1,call_2,itail) result(msg) + character(len=*), intent(in) :: call_1,call_2 + integer, intent(in) :: itail + + msg=trim(call_1)//' '//trim(call_2) + if(itail.eq.1) msg=trim(call_1)//' '//trim(call_2)//' RRR' + if(itail.eq.2) msg=trim(call_1)//' '//trim(call_2)//' RR73' + if(itail.eq.3) msg=trim(call_1)//' '//trim(call_2)//' 73' + + return +end function pack77_format_qso_tail + +integer function pack77_qso_tail_index(token) result(itail) + character(len=*), intent(in) :: token + + itail=0 + if(trim(token).eq.'RRR') itail=1 + if(trim(token).eq.'RR73') itail=2 + if(trim(token).eq.'73') itail=3 +end function pack77_qso_tail_index + +integer function pack77_type12_irpt_from_tail(itail) result(irpt) + integer, intent(in) :: itail + + irpt=0 + if(itail.ge.1 .and. itail.le.3) irpt=itail+1 +end function pack77_type12_irpt_from_tail + +integer function pack77_tail_from_type12_irpt(irpt) result(itail) + integer, intent(in) :: irpt + + itail=0 + if(irpt.ge.2 .and. irpt.le.4) itail=irpt-1 +end function pack77_tail_from_type12_irpt + +integer function pack77_type4_nrpt_from_tail(itail) result(nrpt) + integer, intent(in) :: itail + + nrpt=0 + if(itail.ge.1 .and. itail.le.3) nrpt=itail +end function pack77_type4_nrpt_from_tail + +integer function pack77_tail_from_type4_nrpt(nrpt) result(itail) + integer, intent(in) :: nrpt + + itail=0 + if(nrpt.ge.1 .and. nrpt.le.3) itail=nrpt +end function pack77_tail_from_type4_nrpt + +character(len=37) function pack77_format_exchange_message(call_1,call_2,ir,exchange,reply_has_separate_token) result(msg) + character(len=*), intent(in) :: call_1,call_2,exchange + integer, intent(in) :: ir + logical, intent(in) :: reply_has_separate_token + + msg=trim(call_1)//' '//trim(call_2)//' '//exchange + if(ir.eq.1) then + if(reply_has_separate_token) then + msg=trim(call_1)//' '//trim(call_2)//' R '//exchange + else + msg=trim(call_1)//' '//trim(call_2)//' R'//exchange + endif + endif + + return +end function pack77_format_exchange_message + +logical function pack77_is_digit_char(c) result(is_digit) + character(len=1), intent(in) :: c + + is_digit=c.ge.'0' .and. c.le.'9' + + return +end function pack77_is_digit_char + +logical function pack77_is_letter_char(c) result(is_letter) + character(len=1), intent(in) :: c + + is_letter=c.ge.'A' .and. c.le.'Z' + + return +end function pack77_is_letter_char + +logical function pack77_all_digits(token) result(ok) + character(len=*), intent(in) :: token + integer :: i,n + + ok=.false. + n=len_trim(token) + if(n.lt.1) return + do i=1,n + if(.not.pack77_is_digit_char(token(i:i))) return + enddo + ok=.true. +end function pack77_all_digits + +subroutine pack77_parse_uint(token,value,ok) + character(len=*), intent(in) :: token + integer, intent(out) :: value + logical, intent(out) :: ok + + value=0 + ok=pack77_all_digits(token) + if(.not.ok) return + read(token,*,err=10) value + return +10 ok=.false. +end subroutine pack77_parse_uint + +subroutine pack77_parse_signed_report(token,value,ok) + character(len=*), intent(in) :: token + integer, intent(out) :: value + logical, intent(out) :: ok + + value=0 + ok=.false. + if(len_trim(token).ne.3) return + if(token(1:1).ne.'+' .and. token(1:1).ne.'-') return + if(.not.pack77_is_digit_char(token(2:2))) return + if(.not.pack77_is_digit_char(token(3:3))) return + read(token,*,err=10) value + ok=.true. + return +10 ok=.false. +end subroutine pack77_parse_signed_report + +subroutine pack77_parse_dxpedition_report(token,n5,ok) + character(len=*), intent(in) :: token + integer, intent(out) :: n5 + integer :: isnr + logical, intent(out) :: ok + + n5=0 + call pack77_parse_signed_report(token,isnr,ok) + if(.not.ok) return + if(isnr.lt.-30 .or. isnr.gt.32) then + ok=.false. + return + endif + n5=(isnr+30)/2 + ok=(2*n5-30).eq.isnr +end subroutine pack77_parse_dxpedition_report + +subroutine pack77_parse_type3_serial(token,nserial,ok) + character(len=*), intent(in) :: token + integer, intent(out) :: nserial + logical, intent(out) :: ok + + nserial=0 + ok=.false. + if(len_trim(token).ne.4) return + call pack77_parse_uint(token,nserial,ok) + if(.not.ok) return + ok=nserial.ge.1 .and. nserial.le.7999 +end subroutine pack77_parse_type3_serial + +subroutine pack77_parse_wspr_dbm(token,idbm,ok) + character(len=*), intent(in) :: token + integer, intent(out) :: idbm + integer :: dbm,decoded_dbm + logical, intent(out) :: ok + + idbm=0 + call pack77_parse_uint(token,dbm,ok) + if(.not.ok) return + if(len_trim(token).gt.1 .and. token(1:1).eq.'0') then + ok=.false. + return + endif + if(dbm.lt.0 .or. dbm.gt.60) then + ok=.false. + return + endif + idbm=nint(0.3*dbm) + decoded_dbm=nint(idbm*10.0/3.0) + ok=decoded_dbm.eq.dbm +end subroutine pack77_parse_wspr_dbm + +subroutine pack77_parse_field_day_exchange(token,ntx,nclass,ok) + character(len=*), intent(in) :: token + integer, intent(out) :: ntx,nclass + integer :: n + logical, intent(out) :: ok + + ntx=-1 + nclass=-1 + ok=.false. + n=len_trim(token) + if(n.lt.2) return + if(n.gt.2 .and. token(1:1).eq.'0') return + call pack77_parse_uint(token(1:n-1),ntx,ok) + if(.not.ok) return + if(ntx.lt.1 .or. ntx.gt.32) then + ok=.false. + return + endif + nclass=ichar(token(n:n))-ichar('A') + ok=nclass.ge.0 .and. nclass.le.5 +end subroutine pack77_parse_field_day_exchange + +logical function pack77_valid_hash_call_token(token) result(ok) + character(len=*), intent(in) :: token + integer :: n + + ok=.false. + n=len_trim(token) + if(n.lt.5 .or. n.gt.13) return + if(token(1:1).ne.'<' .or. token(n:n).ne.'>') return + if(index(token(2:n-1),'<').gt.0) return + if(index(token(2:n-1),'>').gt.0) return + ok=.true. +end function pack77_valid_hash_call_token + +logical function pack77_valid_cq_modifier(token) result(ok) + character(len=*), intent(in) :: token + integer :: i,n,nletters,ndigits + + ok=.false. + n=len_trim(token) + if(n.lt.1 .or. n.gt.4) return + nletters=0 + ndigits=0 + do i=1,n + if(token(i:i).ge.'A' .and. token(i:i).le.'Z') then + nletters=nletters+1 + else if(pack77_is_digit_char(token(i:i))) then + ndigits=ndigits+1 + else + return + endif + enddo + ok=(ndigits.eq.3 .and. nletters.eq.0) .or. & + (nletters.ge.1 .and. nletters.le.4 .and. ndigits.eq.0) +end function pack77_valid_cq_modifier + +pure subroutine pack77_split_source_tokens(msg,max_words,nwords,w,ok) + character(len=*), intent(in) :: msg + integer, intent(in) :: max_words + integer, intent(out) :: nwords + character(len=*), intent(out) :: w(:) + logical, intent(out) :: ok + character(len=1) :: c,c0 + integer :: i,n,iz + + nwords=0 + n=0 + c0=' ' + w=' ' + ok=.true. + iz=len_trim(msg) + do i=1,iz + c=msg(i:i) + if(ichar(c).eq.0) c=' ' + if(c.ge.'a' .and. c.le.'z') c=char(ichar(c)-32) + if(c.eq.' ' .and. c0.eq.' ') cycle + if(c.ne.' ' .and. c0.eq.' ') then + nwords=nwords+1 + n=0 + if(nwords.gt.max_words .or. nwords.gt.size(w)) then + ok=.false. + return + endif + endif + if(c.ne.' ') then + n=n+1 + if(n.gt.len(w(1))) then + ok=.false. + return + endif + w(nwords)(n:n)=c + endif + c0=c + enddo +end subroutine pack77_split_source_tokens + +pure subroutine pack77_gate_message_checks(input_msg,decoded_msg,staged_calls, & + nstaged,messages_match,resolved_render_fits) + character(len=*), intent(in) :: input_msg,decoded_msg + character(len=13), intent(in) :: staged_calls(:) + integer, intent(in) :: nstaged + logical, intent(out) :: messages_match,resolved_render_fits + character(len=37) :: input_tokens(19),decoded_tokens(19),input_body + integer :: input_nwords,decoded_nwords,i,nrender,nbody + logical :: input_ok,decoded_ok,token_match + + messages_match=.false. + resolved_render_fits=.false. + call pack77_split_source_tokens(input_msg,19,input_nwords,input_tokens,input_ok) + call pack77_split_source_tokens(decoded_msg,19,decoded_nwords,decoded_tokens, & + decoded_ok) + if(.not.input_ok .or. .not.decoded_ok) return + if(input_nwords.ne.decoded_nwords) return + + messages_match=.true. + resolved_render_fits=.true. +! nrender is the display length after hash resolution: a decoded <...> token +! renders as the staged call body plus its two brackets, and separators are +! counted only between tokens. + nrender=0 + do i=1,input_nwords + if(i.gt.1) nrender=nrender+1 + token_match=.false. + if(trim(decoded_tokens(i)).eq.trim(input_tokens(i))) then + token_match=.true. + nrender=nrender+len_trim(decoded_tokens(i)) + else + input_body=' ' + input_body='<'//trim(input_tokens(i))//'>' + if(trim(decoded_tokens(i)).eq.trim(input_body)) then + token_match=.true. + nrender=nrender+len_trim(decoded_tokens(i)) + else if(trim(decoded_tokens(i)).eq.'<...>') then + input_body=input_tokens(i) + nbody=len_trim(input_body) + if(nbody.ge.2 .and. input_body(1:1).eq.'<' .and. & + input_body(nbody:nbody).eq.'>') then + input_body=' ' + if(nbody.gt.2) input_body=input_tokens(i)(2:nbody-1) + endif + token_match=pack77_gate_staged_call_matches(input_body,staged_calls, & + nstaged) + if(len_trim(input_body).gt.11) resolved_render_fits=.false. + nrender=nrender+len_trim(input_body)+2 + else + nrender=nrender+len_trim(decoded_tokens(i)) + endif + endif + if(.not.token_match) messages_match=.false. + if(trim(decoded_tokens(i)).eq.'<...>' .and. .not.token_match) & + resolved_render_fits=.false. + if(nrender.gt.37) resolved_render_fits=.false. + enddo +end subroutine pack77_gate_message_checks + +! Canonicalization accepted by the encode/decode gate is exhaustive: +! 1. The tokenizer folds case and collapses blanks before parsing. +! 2. A compound/nonstandard call in a c28 slot transmits as a hash and decodes bracketed. +! 3. A bracketed hash decodes as <...> when no hash-table call is available and the staged source call matches. +! 4. Type 4 CQ accepts only unbracketed c11 CQ targets; bracketed CQ targets are rejected and decoded CQ targets stay unbracketed. +! 5. DX-macro expansion is performed by callers through pack77_options before this gate. +! Any other source-vs-decode difference is rejected by this gate. +pure logical function pack77_gate_messages_match(input_msg,decoded_msg, & + staged_calls,nstaged) result(ok) + character(len=*), intent(in) :: input_msg,decoded_msg + character(len=13), intent(in) :: staged_calls(:) + integer, intent(in) :: nstaged + logical :: resolved_render_fits + + call pack77_gate_message_checks(input_msg,decoded_msg,staged_calls,nstaged, & + ok,resolved_render_fits) +end function pack77_gate_messages_match + +pure logical function pack77_gate_staged_call_matches(input_body,staged_calls, & + nstaged) result(ok) + character(len=*), intent(in) :: input_body + character(len=13), intent(in) :: staged_calls(:) + integer, intent(in) :: nstaged + integer :: i,n + + ok=.false. + n=min(max(nstaged,0),size(staged_calls)) + do i=1,n + if(trim(staged_calls(i)).eq.trim(input_body)) then + ok=.true. + return + endif + enddo +end function pack77_gate_staged_call_matches + +pure logical function pack77_gate_resolved_render_fits(input_msg,decoded_msg, & + staged_calls,nstaged) result(ok) + character(len=*), intent(in) :: input_msg,decoded_msg + character(len=13), intent(in) :: staged_calls(:) + integer, intent(in) :: nstaged + logical :: messages_match + + call pack77_gate_message_checks(input_msg,decoded_msg,staged_calls,nstaged, & + messages_match,ok) +end function pack77_gate_resolved_render_fits + +logical function pack77_c28_standard_shape(token) result(ok) + character(len=*), intent(in) :: token + integer :: i,n,iarea,npdig,nplet,nslet + character(len=1) :: c + + ok=.false. + n=len_trim(token) + if(n.lt.3 .or. n.gt.6) return + do i=1,n + c=token(i:i) + if(.not.((c.ge.'A' .and. c.le.'Z') .or. pack77_is_digit_char(c))) return + enddo + + iarea=0 + do i=n,2,-1 + if(pack77_is_digit_char(token(i:i))) then + iarea=i + exit + endif + enddo + if(iarea.ne.2 .and. iarea.ne.3) return + + npdig=0 + nplet=0 + do i=1,iarea-1 + c=token(i:i) + if(pack77_is_digit_char(c)) then + npdig=npdig+1 + else if(c.ge.'A' .and. c.le.'Z') then + nplet=nplet+1 + else + return + endif + enddo + if(nplet.eq.0 .or. npdig.ge.iarea-1) return + + nslet=0 + do i=iarea+1,n + c=token(i:i) + if(c.ge.'A' .and. c.le.'Z') then + nslet=nslet+1 + else + return + endif + enddo + ok=nslet.le.3 +end function pack77_c28_standard_shape + +logical function pack77_type12_standard_call(token) result(ok) + character(len=*), intent(in) :: token + + ok=.false. + if(.not.pack77_c28_standard_shape(token)) return + ! Q-prefix rejection is a source-grammar policy, not a c28 wire shape fact. + if(token(1:1).eq.'Q') return + ok=.true. +end function pack77_type12_standard_call + + +subroutine pack77_parse_type12_call(token,allow_special,call_source,ok) + character(len=*), intent(in) :: token + logical, intent(in) :: allow_special + type(pack77_type12_call_source), intent(out) :: call_source + logical, intent(out) :: ok + character(len=37) :: base,modifier + integer :: n,slash + + call_source=pack77_type12_call_source() + ok=.false. + n=len_trim(token) + if(n.lt.1 .or. n.gt.13) return + + if(allow_special) then + if(trim(token).eq.'CQ') then + call_source%c28_token='CQ' + call_source%is_cq=.true. + ok=.true. + return + endif + if(trim(token).eq.'DE' .or. trim(token).eq.'QRZ') then + call_source%c28_token=trim(token) + ok=.true. + return + endif + if(n.ge.4 .and. token(1:3).eq.'CQ_') then + modifier=' ' + modifier=token(4:n) + if(.not.pack77_valid_cq_modifier(modifier)) return + call_source%c28_token=trim(token) + call_source%is_cq=.true. + ok=.true. + return + endif + endif + + if(token(1:1).eq.'<' .or. index(token(1:n),'>').gt.0) then + if(.not.pack77_valid_hash_call_token(token)) return + call_source%c28_token=trim(token) + call_source%is_hash=.true. + ok=.true. + return + endif + + slash=index(token(1:n),'/') + base=' ' + if(slash.gt.0) then + if(slash.lt.2 .or. slash.ne.n-1) return + if(index(token(slash+1:n),'/').gt.0) return + if(token(slash:n).eq.'/R') then + call_source%suffix=PACK77_TYPE12_SUFFIX_R + else if(token(slash:n).eq.'/P') then + call_source%suffix=PACK77_TYPE12_SUFFIX_P + else + return + endif + base=token(1:slash-1) + else + base=token(1:n) + endif + + if(.not.pack77_type12_standard_call(base)) return + call_source%c28_token=trim(base) + ok=.true. +end subroutine pack77_parse_type12_call + +logical function pack77_type12_call_has_suffix(call_source) result(ok) + type(pack77_type12_call_source), intent(in) :: call_source + + ok=call_source%suffix.ne.PACK77_TYPE12_SUFFIX_NONE +end function pack77_type12_call_has_suffix + +subroutine pack77_parse_type12_source(msg,source,ok) + character(len=*), intent(in) :: msg + type(pack77_type12_source), intent(out) :: source + logical, intent(out) :: ok + character(len=37) :: w(5),call_1_token,tail + integer :: nwords,call_2_index,tail_start,ntail,itail,isnr,irpt + logical :: split_ok,call_ok,tail_is_grid + + source=pack77_type12_source() + ok=.false. + call pack77_split_source_tokens(msg,5,nwords,w,split_ok) + if(.not.split_ok) return + if(nwords.lt.2) return + + call_1_token=w(1) + call_2_index=2 + tail_start=3 + if(trim(w(1)).eq.'CQ' .and. nwords.ge.3 .and. & + pack77_valid_cq_modifier(w(2))) then + call_1_token=' ' + call_1_token='CQ_'//trim(w(2)) + call_2_index=3 + tail_start=4 + endif + + call pack77_parse_type12_call(call_1_token,.true.,source%call_1,call_ok) + if(.not.call_ok) return + call pack77_parse_type12_call(w(call_2_index),.false.,source%call_2,call_ok) + if(.not.call_ok) return + if(source%call_1%is_cq .and. source%call_2%is_hash) return + if(source%call_1%is_hash .and. & + (pack77_type12_call_has_suffix(source%call_2) .or. & + index(source%call_2%c28_token,'/').gt.0)) return + if(source%call_2%is_hash .and. & + (pack77_type12_call_has_suffix(source%call_1) .or. & + index(source%call_1%c28_token,'/').gt.0)) return + + if(source%call_1%suffix.eq.PACK77_TYPE12_SUFFIX_R .and. & + source%call_2%suffix.eq.PACK77_TYPE12_SUFFIX_P) return + if(source%call_1%suffix.eq.PACK77_TYPE12_SUFFIX_P .and. & + source%call_2%suffix.eq.PACK77_TYPE12_SUFFIX_R) return + + source%i3=1 + if(source%call_1%suffix.eq.PACK77_TYPE12_SUFFIX_P .or. & + source%call_2%suffix.eq.PACK77_TYPE12_SUFFIX_P) source%i3=2 + + ntail=nwords-tail_start+1 + if(ntail.lt.0 .or. ntail.gt.2) return + if(ntail.eq.0) then + source%ir=0 + source%igrid4=PACK77_MAXGRID4+1 + ok=.true. + return + endif + + if(ntail.eq.2) then + if(trim(w(tail_start)).ne.'R') return + if(source%call_1%is_cq) return + if(len_trim(w(tail_start+1)).ne.4) return + if(.not.pack77_is_grid4(w(tail_start+1))) return + source%ir=1 + source%igrid4=pack77_grid4_index(w(tail_start+1)(1:4)) + ok=.true. + return + endif + + tail=w(tail_start) + tail_is_grid=.false. + if(len_trim(tail).eq.4) tail_is_grid=pack77_is_grid4(tail) + if(tail_is_grid) then + source%ir=0 + source%igrid4=pack77_grid4_index(tail(1:4)) + ok=.true. + return + endif + if(source%call_1%is_cq) return + + if(tail(1:1).eq.'+' .or. tail(1:1).eq.'-') then + call pack77_parse_signed_report(tail,isnr,ok) + if(.not.ok) return + irpt=pack77_report_index_from_snr(isnr) + if(irpt.lt.1) then + ok=.false. + return + endif + source%ir=0 + source%igrid4=PACK77_MAXGRID4+irpt + ok=.true. + return + endif + if(tail(1:2).eq.'R+' .or. tail(1:2).eq.'R-') then + call pack77_parse_signed_report(tail(2:),isnr,ok) + if(.not.ok) return + irpt=pack77_report_index_from_snr(isnr) + if(irpt.lt.1) then + ok=.false. + return + endif + source%ir=1 + source%igrid4=PACK77_MAXGRID4+irpt + ok=.true. + return + endif + + itail=pack77_qso_tail_index(tail) + if(itail.lt.1) return + source%ir=0 + source%igrid4=PACK77_MAXGRID4+pack77_type12_irpt_from_tail(itail) + ok=.true. +end subroutine pack77_parse_type12_source +logical function pack77_valid_c28_call_slot(token) result(ok) + character(len=*), intent(in) :: token + integer :: i,n,slash + + ok=.false. + n=len_trim(token) + if(n.lt.3 .or. n.gt.13) return + if(pack77_valid_hash_call_token(token)) return + do i=1,n + if(.not.((token(i:i).ge.'A' .and. token(i:i).le.'Z') .or. & + pack77_is_digit_char(token(i:i)) .or. token(i:i).eq.'/')) return + enddo + if(pack77_type12_standard_call(token)) then + ok=.true. + return + endif + slash=index(token(1:n),'/') + if(slash.lt.2 .or. slash.ge.n) return + if(index(token(slash+1:n),'/').gt.0) return + ok=.true. +end function pack77_valid_c28_call_slot + +subroutine pack77_parse_dxpedition_source(msg,source,ok,matched_shape) +! DXpedition messages encode two c28 calls, a 10-bit hashed callsign, and a +! report in the fixed "CALL RR73; CALL REPORT" token shape. + character(len=*), intent(in) :: msg + type(pack77_dxpedition_source), intent(out) :: source + logical, intent(out) :: ok + logical, intent(out) :: matched_shape + character(len=37) :: w(5) + integer :: nwords + logical :: split_ok + + source=pack77_dxpedition_source() + ok=.false. + matched_shape=.false. + call pack77_split_source_tokens(msg,5,nwords,w,split_ok) + if(.not.split_ok) return + if(nwords.ne.5) return + if(trim(w(2)).ne.'RR73;') return + matched_shape=.true. + if(.not.pack77_valid_c28_call_slot(w(1))) return + if(.not.pack77_valid_c28_call_slot(w(3))) return + if(.not.pack77_valid_hash_call_token(w(4))) return + call pack77_parse_dxpedition_report(w(5),source%n5,ok) + if(.not.ok) return + source%call_1=trim(w(1)) + source%call_2=trim(w(3)) + source%hash_token=trim(w(4)) +end subroutine pack77_parse_dxpedition_source + +subroutine pack77_parse_field_day_source(msg,source,ok,matched_shape) + character(len=*), intent(in) :: msg + type(pack77_field_day_source), intent(out) :: source + logical, intent(out) :: ok + logical, intent(out) :: matched_shape + character(len=37) :: w(5),section + integer :: nwords,exchange_index,section_index + logical :: split_ok + + source=pack77_field_day_source() + ok=.false. + matched_shape=.false. + call pack77_split_source_tokens(msg,5,nwords,w,split_ok) + if(.not.split_ok) return + if(nwords.lt.4 .or. nwords.gt.5) return + section_index=nwords + source%isec=pack77_arrl_section_index(w(section_index)) + if(source%isec.eq.-1) return + section=pack77_arrl_section_name(source%isec) + if(len_trim(w(section_index)).ne.len_trim(section)) return + matched_shape=.true. + if(.not.pack77_valid_c28_call_slot(w(1))) return + if(.not.pack77_valid_c28_call_slot(w(2))) return + if(nwords.eq.5) then + if(trim(w(3)).ne.'R') return + source%ir=1 + endif + exchange_index=nwords-1 + call pack77_parse_field_day_exchange(w(exchange_index), & + source%ntx,source%nclass,ok) + if(.not.ok) return + source%call_1=trim(w(1)) + source%call_2=trim(w(2)) + ok=.true. +end subroutine pack77_parse_field_day_source + +subroutine pack77_parse_wspr_source(msg,source,ok,matched_shape) + character(len=*), intent(in) :: msg + type(pack77_wspr_source), intent(out) :: source + logical, intent(out) :: ok + logical, intent(out) :: matched_shape + character(len=37) :: w(3),base + character(len=3) :: cpfx + integer :: nwords,m1,m2,slash + logical :: split_ok,is_prefix,grid4_ok + + source=pack77_wspr_source() + ok=.false. + matched_shape=.false. + call pack77_split_source_tokens(msg,3,nwords,w,split_ok) + if(.not.split_ok) return + if(nwords.lt.2 .or. nwords.gt.3) return + m1=len_trim(w(1)) + m2=len_trim(w(2)) + + grid4_ok=.false. + if(nwords.eq.3) then + grid4_ok=m2.eq.4 .and. pack77_is_grid4(w(2)) + matched_shape=grid4_ok .and. pack77_all_digits(w(3)) + else if(nwords.eq.2) then + matched_shape=index(w(1)(1:m1),'/').gt.0 .and. pack77_all_digits(w(2)) + endif + + if(nwords.eq.3) then + if(.not.pack77_type12_standard_call(w(1))) return + if(.not.grid4_ok) return + call pack77_parse_wspr_dbm(w(3),source%idbm,ok) + if(.not.ok) return + source%subtype=1 + source%call_token=trim(w(1)) + source%grid4=w(2)(1:4) + ok=.true. + return + endif + + if(m1.ge.5 .and. m1.le.10 .and. m2.le.2) then + slash=index(w(1)(1:m1),'/') + if(slash.ge.2 .and. slash.lt.m1 .and. & + index(w(1)(slash+1:m1),'/').eq.0) then + base=' ' + if(slash.le.4) then + base=w(1)(slash+1:m1) + else + base=w(1)(1:slash-1) + endif + if(pack77_type12_standard_call(base)) then + call pack77_parse_wspr_dbm(w(2),source%idbm,ok) + if(.not.ok) return + source%npfx=pack77_wspr_affix_index(w(1),slash,m1,ok) + if(.not.ok) return + call pack77_wspr_affix_text(source%npfx,cpfx,is_prefix,ok) + if(.not.ok) return + ok=.false. + cpfx=adjustl(cpfx) + if(slash.le.4) then + if(.not.is_prefix) return + if(trim(cpfx).ne.w(1)(1:slash-1)) return + else + if(is_prefix) return + if(trim(cpfx).ne.w(1)(slash+1:m1)) return + endif + source%subtype=2 + source%call_token=trim(w(1)) + source%base_call=trim(base) + ok=.true. + return + endif + endif + endif + + if(m1.ge.5 .and. m1.le.12 .and. m2.le.6) then + if(.not.pack77_valid_hash_call_token(w(1))) return + if(.not.pack77_is_grid6(w(2),.true.)) return + source%subtype=3 + source%hash_token=trim(w(1)) + source%grid6=w(2)(1:6) + ok=.true. + endif +end subroutine pack77_parse_wspr_source + +subroutine pack77_parse_type3_source(msg,source,ok,matched_shape) + character(len=*), intent(in) :: msg + type(pack77_type3_source), intent(out) :: source + logical, intent(out) :: ok + logical, intent(out) :: matched_shape + character(len=37) :: w(6),exchange + integer :: nwords,report_index,exchange_index,nserial,imult + logical :: split_ok,serial_ok + + source=pack77_type3_source() + ok=.false. + matched_shape=.false. + call pack77_split_source_tokens(msg,6,nwords,w,split_ok) + if(.not.split_ok) return + if(nwords.lt.4 .or. nwords.gt.6) return + + if(trim(w(1)).eq.'TU;') source%itu=1 + if(trim(w(3+source%itu)).eq.'R') source%ir=1 + report_index=3+source%itu+source%ir + if(report_index.le.nwords) & + matched_shape=pack77_rtty_report_index(w(report_index)).ge.0 + if(.not.pack77_valid_c28_call_slot(w(1+source%itu))) return + if(.not.pack77_valid_c28_call_slot(w(2+source%itu))) return + source%call_1=trim(w(1+source%itu)) + source%call_2=trim(w(2+source%itu)) + + exchange_index=report_index+1 + if(exchange_index.ne.nwords) return + + source%irpt=pack77_rtty_report_index(w(report_index)) + if(source%irpt.lt.0) return + + call pack77_parse_type3_serial(w(exchange_index),nserial,serial_ok) + if(serial_ok) then + source%nexch=nserial + ok=.true. + return + endif + + imult=pack77_rtty_multiplier_index(w(exchange_index)) + if(imult.le.0) return + exchange=pack77_rtty_multiplier_name(imult) + if(len_trim(w(exchange_index)).ne.len_trim(exchange)) return + source%nexch=8000+imult + ok=.true. +end subroutine pack77_parse_type3_source + +subroutine pack77_parse_type4_source(msg,source,ok) + character(len=*), intent(in) :: msg + type(pack77_type4_source), intent(out) :: source + logical, intent(out) :: ok + character(len=37) :: w(3),c11_token + integer :: nwords + logical :: split_ok,hash_1,hash_2 + + source=pack77_type4_source() + ok=.false. + call pack77_split_source_tokens(msg,3,nwords,w,split_ok) + if(.not.split_ok) return + if(nwords.lt.2 .or. nwords.gt.3) return + + hash_1=pack77_valid_hash_call_token(w(1)) + hash_2=pack77_valid_hash_call_token(w(2)) + + if(trim(w(1)).eq.'CQ') then + if(nwords.ne.2) return + if(hash_2) return + c11_token=w(2) + if(len_trim(c11_token).lt.5) return + if(.not.pack77_valid_type4_c11(c11_token)) return + if(pack77_type12_standard_call(c11_token)) return + source%c11=c11_token(1:11) + source%icq=1 + ok=.true. + return + endif + + if(nwords.eq.3) then + source%itail=pack77_qso_tail_index(w(3)) + if(source%itail.eq.0) return + endif + + if(hash_1 .and. .not.hash_2) then + if(.not.pack77_valid_type4_c11(w(2))) return + if(pack77_type12_standard_call(w(2))) return + source%hash_token=trim(w(1)) + source%c11=w(2)(1:11) + source%iflip=0 + ok=.true. + return + endif + + if(hash_2 .and. .not.hash_1) then + if(.not.pack77_valid_type4_c11(w(1))) return + if(pack77_type12_standard_call(w(1))) return + source%hash_token=trim(w(2)) + source%c11=w(1)(1:11) + source%iflip=1 + ok=.true. + return + endif +end subroutine pack77_parse_type4_source + +subroutine pack77_parse_type5_source(msg,source,ok,matched_shape) +! Type 5 EU VHF messages carry two explicit hash tokens, an optional R, +! report+serial as 52..59 plus 0001..2047, and a required six-character grid. + character(len=*), intent(in) :: msg + type(pack77_type5_source), intent(out) :: source + logical, intent(out) :: ok + logical, intent(out) :: matched_shape + character(len=37) :: w(5) + integer :: nwords,exchange_index,grid_index,nx + logical :: split_ok + + source=pack77_type5_source() + ok=.false. + matched_shape=.false. + call pack77_split_source_tokens(msg,5,nwords,w,split_ok) + if(.not.split_ok) return + if(nwords.lt.4 .or. nwords.gt.5) return + matched_shape=pack77_valid_hash_call_token(w(1)) .and. & + pack77_valid_hash_call_token(w(2)) + if(.not.pack77_valid_hash_call_token(w(1))) return + if(.not.pack77_valid_hash_call_token(w(2))) return + if(nwords.eq.5) then + if(trim(w(3)).ne.'R') return + source%ir=1 + endif + + exchange_index=nwords-1 + grid_index=nwords + call pack77_valid_type5_exchange(w(exchange_index),nx,ok) + if(.not.ok) return + if(nx.lt.520001 .or. nx.gt.592047) then + ok=.false. + return + endif + source%iserial=mod(nx,10000) + if(source%iserial.lt.1 .or. source%iserial.gt.2047) then + ok=.false. + return + endif + if(len_trim(w(grid_index)).ne.6) then + ok=.false. + return + endif + if(.not.pack77_is_grid6(w(grid_index),.false.)) then + ok=.false. + return + endif + + source%hash_token_1=trim(w(1)) + source%hash_token_2=trim(w(2)) + source%irpt=nx/10000 - 52 + source%grid6=w(grid_index)(1:6) + ok=.true. +end subroutine pack77_parse_type5_source + +logical function pack77_valid_type4_c11(token) result(ok) + character(len=*), intent(in) :: token + integer :: i,n + + ok=.false. + n=len_trim(token) + if(n.lt.1 .or. n.gt.11) return + do i=1,n + if(index(PACK77_BASE38,token(i:i)).lt.1) return + enddo + ok=.true. +end function pack77_valid_type4_c11 + +subroutine pack77_valid_type5_exchange(token,nx,ok) + character(len=*), intent(in) :: token + integer, intent(out) :: nx + logical, intent(out) :: ok + + nx=-1 + ok=.false. + if(len_trim(token).ne.6) return + call pack77_parse_uint(token,nx,ok) +end subroutine pack77_valid_type5_exchange + +integer function pack77_wspr_affix_index(token,slash_index,token_len,ok) result(npfx) + character(len=*), intent(in) :: token + integer, intent(in) :: slash_index,token_len + logical, intent(out) :: ok + integer :: i + + ok=.true. + npfx=0 + if(slash_index.le.4 .and. token_len-slash_index.lt.3) then + ok=.false. + return + endif + if(slash_index.gt.4 .and. token_len-slash_index.gt.3) then + ok=.false. + return + endif + do i=1,slash_index-1 + if(index(PACK77_BASE36,token(i:i)).lt.1) then + ok=.false. + return + endif + enddo + do i=slash_index+1,token_len + if(index(PACK77_BASE36,token(i:i)).lt.1) then + ok=.false. + return + endif + enddo + if(slash_index.le.4) then + npfx=index(PACK77_BASE36,token(1:1))-1 + if(slash_index.ge.3) npfx=36*npfx + index(PACK77_BASE36,token(2:2))-1 + if(slash_index.eq.4) npfx=36*npfx + index(PACK77_BASE36,token(3:3))-1 + else + if((token_len-slash_index).eq.1) & + npfx=index(PACK77_BASE36,token(slash_index+1:slash_index+1))-1 + if((token_len-slash_index).eq.2) & + npfx=36*(index(PACK77_BASE36,token(slash_index+1:slash_index+1))-1) + & + index(PACK77_BASE36,token(slash_index+2:slash_index+2))-1 + if((token_len-slash_index).eq.3) then + if(.not.pack77_is_digit_char(token(slash_index+3:slash_index+3))) then + ok=.false. + return + endif + npfx=36*10*(index(PACK77_BASE36,token(slash_index+1:slash_index+1))-1) + & + 10*(index(PACK77_BASE36,token(slash_index+2:slash_index+2))-1) + & + index(PACK77_BASE36,token(slash_index+3:slash_index+3))-1 + endif + npfx=npfx + PACK77_WSPR_NZZZ + endif + + return +end function pack77_wspr_affix_index + +subroutine pack77_wspr_affix_text(npfx,cpfx,is_prefix,ok) + integer, intent(in) :: npfx + character(len=3), intent(out) :: cpfx + logical, intent(out) :: is_prefix,ok + integer :: n,i,j + + n=npfx + cpfx=' ' + ok=.true. + is_prefix=n.lt.PACK77_WSPR_NZZZ + if(is_prefix) then + do i=3,1,-1 + j=mod(n,36)+1 + cpfx(i:i)=PACK77_BASE36(j:j) + n=n/36 + if(n.eq.0) exit + enddo + else + n=n-PACK77_WSPR_NZZZ + if(n.le.35) then + cpfx(1:1)=PACK77_BASE36(n+1:n+1) + else if(n.gt.35 .and. n.le.1295) then + cpfx(1:1)=PACK77_BASE36(n/36+1:n/36+1) + cpfx(2:2)=PACK77_BASE36(mod(n,36)+1:mod(n,36)+1) + else if(n.gt.1295 .and. n.le.12959) then + cpfx(1:1)=PACK77_BASE36(n/360+1:n/360+1) + cpfx(2:2)=PACK77_BASE36(mod(n/10,36)+1:mod(n/10,36)+1) + cpfx(3:3)=PACK77_BASE36(mod(n,10)+1:mod(n,10)+1) + else + ok=.false. + endif + endif + + return +end subroutine pack77_wspr_affix_text + +character(len=11) function pack77_type4_call_text_from_n58(n58) result(c11) + integer*8, intent(in) :: n58 + integer*8 :: n + integer :: i,j + + c11=' ' + n=n58 + do i=11,1,-1 + j=mod(n,38_8)+1 + c11(i:i)=PACK77_BASE38(j:j) + n=n/38 + enddo + + return +end function pack77_type4_call_text_from_n58 + +integer*8 function pack77_type4_n58_from_call_text(c11) result(n58) + character(len=*), intent(in) :: c11 + integer :: i + + n58=0_8 + do i=1,11 + n58=n58*38_8 + index(PACK77_BASE38,c11(i:i)) - 1 + enddo + + return +end function pack77_type4_n58_from_call_text + +subroutine to_grid4(n,grid4,ok) + character*4 grid4 + logical ok + integer :: n,j1,j2,j3,j4 + + ok=.false. + j1=n/(18*10*10) + if (j1.lt.0.or.j1.gt.17) goto 900 + n=n-j1*18*10*10 + j2=n/(10*10) + if (j2.lt.0.or.j2.gt.17) goto 900 + n=n-j2*10*10 + j3=n/10 + if (j3.lt.0.or.j3.gt.9) goto 900 + j4=n-j3*10 + if (j4.lt.0.or.j4.gt.9) goto 900 + grid4(1:1)=char(j1+ichar('A')) + grid4(2:2)=char(j2+ichar('A')) + grid4(3:3)=char(j3+ichar('0')) + grid4(4:4)=char(j4+ichar('0')) + ok=.true. + +900 return +end subroutine to_grid4 + +subroutine to_grid6(n,grid6,ok) + character*6 grid6 + logical ok + integer :: n,j1,j2,j3,j4,j5,j6 + + ok=.false. + j1=n/(18*10*10*24*24) + if (j1.lt.0.or.j1.gt.17) goto 900 + n=n-j1*18*10*10*24*24 + j2=n/(10*10*24*24) + if (j2.lt.0.or.j2.gt.17) goto 900 + n=n-j2*10*10*24*24 + j3=n/(10*24*24) + if (j3.lt.0.or.j3.gt.9) goto 900 + n=n-j3*10*24*24 + j4=n/(24*24) + if (j4.lt.0.or.j4.gt.9) goto 900 + n=n-j4*24*24 + j5=n/24 + if (j5.lt.0.or.j5.gt.23) goto 900 + j6=n-j5*24 + if (j6.lt.0.or.j6.gt.23) goto 900 + grid6(1:1)=char(j1+ichar('A')) + grid6(2:2)=char(j2+ichar('A')) + grid6(3:3)=char(j3+ichar('0')) + grid6(4:4)=char(j4+ichar('0')) + grid6(5:5)=char(j5+ichar('A')) + grid6(6:6)=char(j6+ichar('A')) + ok=.true. + +900 return +end subroutine to_grid6 + +subroutine to_grid(n,grid6,ok) + ! 4-, or 6-character grid + character*6 grid6 + logical ok + integer :: n,j1,j2,j3,j4,j5,j6 + + ok=.false. + j1=n/(18*10*10*25*25) + if (j1.lt.0.or.j1.gt.17) goto 900 + n=n-j1*18*10*10*25*25 + j2=n/(10*10*25*25) + if (j2.lt.0.or.j2.gt.17) goto 900 + n=n-j2*10*10*25*25 + j3=n/(10*25*25) + if (j3.lt.0.or.j3.gt.9) goto 900 + n=n-j3*10*25*25 + j4=n/(25*25) + if (j4.lt.0.or.j4.gt.9) goto 900 + n=n-j4*25*25 + j5=n/25 + if (j5.lt.0.or.j5.gt.24) goto 900 + j6=n-j5*25 + if (j6.lt.0.or.j6.gt.24) goto 900 + grid6='' + grid6(1:1)=char(j1+ichar('A')) + grid6(2:2)=char(j2+ichar('A')) + grid6(3:3)=char(j3+ichar('0')) + grid6(4:4)=char(j4+ichar('0')) + if (j5.ne.24.or.j6.ne.24) then + grid6(5:5)=char(j5+ichar('A')) + grid6(6:6)=char(j6+ichar('A')) + endif + ok=.true. + +900 return +end subroutine to_grid + +logical function pack77_is_grid4(grid4) result(ok) + character(len=*), intent(in) :: grid4 + + ok=.false. + if(len(grid4).lt.4) return + if(len(trim(grid4)).ne.4) return + ok=grid4(1:1).ge.'A' .and. grid4(1:1).le.'R' .and. & + grid4(2:2).ge.'A' .and. grid4(2:2).le.'R' .and. & + grid4(3:3).ge.'0' .and. grid4(3:3).le.'9' .and. & + grid4(4:4).ge.'0' .and. grid4(4:4).le.'9' + + return +end function pack77_is_grid4 + +logical function pack77_is_grid6(grid6,allow_grid4) result(ok) + character(len=*), intent(in) :: grid6 + logical, intent(in) :: allow_grid4 + integer :: ngrid + + ok=.false. + if(len(grid6).lt.4) return + ngrid=len(trim(grid6)) + if(ngrid.eq.4) then + ok=allow_grid4 .and. pack77_is_grid4(grid6(1:4)) + return + endif + if(len(grid6).lt.6 .or. ngrid.ne.6) return + ok=pack77_is_grid4(grid6(1:4)) .and. & + grid6(5:5).ge.'A' .and. grid6(5:5).le.'X' .and. & + grid6(6:6).ge.'A' .and. grid6(6:6).le.'X' + + return +end function pack77_is_grid6 + +integer function pack77_grid4_index(grid4) result(igrid4) + character(len=*), intent(in) :: grid4 + + igrid4=(ichar(grid4(1:1))-ichar('A'))*18*10*10 + & + (ichar(grid4(2:2))-ichar('A'))*10*10 + & + (ichar(grid4(3:3))-ichar('0'))*10 + & + (ichar(grid4(4:4))-ichar('0')) + + return +end function pack77_grid4_index + +integer function pack77_grid6_index(grid6) result(igrid6) + character(len=*), intent(in) :: grid6 + + igrid6=pack77_grid4_index(grid6(1:4))*24*24 + & + (ichar(grid6(5:5))-ichar('A'))*24 + & + (ichar(grid6(6:6))-ichar('A')) + + return +end function pack77_grid6_index + +integer function pack77_grid6_wspr_index(grid6) result(igrid6) + character(len=*), intent(in) :: grid6 + + igrid6=pack77_grid4_index(grid6(1:4))*25*25 + if(grid6(5:6).eq.' ') then + igrid6=igrid6 + 24*25 + 24 + else + igrid6=igrid6 + (ichar(grid6(5:5))-ichar('A'))*25 + & + (ichar(grid6(6:6))-ichar('A')) + endif + + return +end function pack77_grid6_wspr_index + +end module packjt77_grammar diff --git a/lib/77bit/packjt77_schema.f90 b/lib/77bit/packjt77_schema.f90 new file mode 100644 index 00000000..cfa43687 --- /dev/null +++ b/lib/77bit/packjt77_schema.f90 @@ -0,0 +1,871 @@ +module packjt77_schema + + use, intrinsic :: iso_fortran_env, only: int64 + implicit none + + integer, parameter :: PACK77_SCHEMA_INT_KIND=int64 + integer, parameter :: PACK77_MAX_SCHEMA_FIELDS=8 + integer, parameter :: PACK77_FIELD_NAME_LEN=16 + integer, parameter :: PACK77_SCHEMA_NAME_LEN=32 + + private :: NO_FIELD,put_int,get_int,begin_message,put_int_i4,put_int_i8, & + put_bits,get_int_i4,get_int_i8,get_bits,valid_field_bounds, & + encode_pack77_field_day,encode_pack77_type12,decode_pack77_field_day, & + decode_pack77_type12,require_int,pack77_binary_precondition, & + bits_are_binary + + ! Schema bit ranges use Fortran string coordinates in the 77-character c77 + ! payload: start_bit is 1-based and integer fields are encoded MSB-first. + type bit_field + character(len=PACK77_FIELD_NAME_LEN) :: name='' + integer :: start_bit=0 + integer :: width=0 + integer(kind=int64) :: min_value=0_int64 + integer(kind=int64) :: max_value=-1_int64 + logical :: bitstring=.false. + end type bit_field + + type message_schema + integer :: i3=-1 + integer :: n3=-1 + character(len=PACK77_SCHEMA_NAME_LEN) :: name='' + integer :: nfields=0 + type(bit_field) :: fields(PACK77_MAX_SCHEMA_FIELDS) + end type message_schema + + type(bit_field), parameter :: NO_FIELD=bit_field('',0,0,0_int64,-1_int64,.false.) + + interface put_int + module procedure put_int_i4 + module procedure put_int_i8 + end interface put_int + + interface get_int + module procedure get_int_i4 + module procedure get_int_i8 + end interface get_int + + type(message_schema), parameter :: PACK77_SCHEMA_FREE_TEXT=message_schema( & + 0,0,'free text',3,(/ & + bit_field('text_bits',1,71,0_int64,0_int64,.true.), & + bit_field('n3',72,3,0_int64,0_int64,.false.), & + bit_field('i3',75,3,0_int64,0_int64,.false.), & + NO_FIELD,NO_FIELD,NO_FIELD,NO_FIELD,NO_FIELD /)) + + type(message_schema), parameter :: PACK77_SCHEMA_TELEMETRY=message_schema( & + 0,5,'telemetry',5,(/ & + bit_field('ntel1',1,23,0_int64,8388607_int64,.false.), & + bit_field('ntel2',24,24,0_int64,16777215_int64,.false.), & + bit_field('ntel3',48,24,0_int64,16777215_int64,.false.), & + bit_field('n3',72,3,5_int64,5_int64,.false.), & + bit_field('i3',75,3,0_int64,0_int64,.false.), & + NO_FIELD,NO_FIELD,NO_FIELD /)) + + type(message_schema), parameter :: PACK77_SCHEMA_DXPEDITION=message_schema( & + 0,1,'dxpedition',6,(/ & + bit_field('n28a',1,28,0_int64,268435455_int64,.false.), & + bit_field('n28b',29,28,0_int64,268435455_int64,.false.), & + bit_field('n10',57,10,0_int64,1023_int64,.false.), & + bit_field('n5',67,5,0_int64,31_int64,.false.), & + bit_field('n3',72,3,1_int64,1_int64,.false.), & + bit_field('i3',75,3,0_int64,0_int64,.false.), & + NO_FIELD,NO_FIELD /)) + + type(message_schema), parameter :: PACK77_SCHEMA_FIELD_DAY_LOW=message_schema( & + 0,3,'field day low',8,(/ & + bit_field('n28a',1,28,0_int64,268435455_int64,.false.), & + bit_field('n28b',29,28,0_int64,268435455_int64,.false.), & + bit_field('ir',57,1,0_int64,1_int64,.false.), & + bit_field('intx',58,4,0_int64,15_int64,.false.), & + bit_field('nclass',62,3,0_int64,7_int64,.false.), & + bit_field('isec',65,7,0_int64,127_int64,.false.), & + bit_field('n3',72,3,3_int64,3_int64,.false.), & + bit_field('i3',75,3,0_int64,0_int64,.false.) /)) + + type(message_schema), parameter :: PACK77_SCHEMA_FIELD_DAY_HIGH=message_schema( & + 0,4,'field day high',8,(/ & + bit_field('n28a',1,28,0_int64,268435455_int64,.false.), & + bit_field('n28b',29,28,0_int64,268435455_int64,.false.), & + bit_field('ir',57,1,0_int64,1_int64,.false.), & + bit_field('intx',58,4,0_int64,15_int64,.false.), & + bit_field('nclass',62,3,0_int64,7_int64,.false.), & + bit_field('isec',65,7,0_int64,127_int64,.false.), & + bit_field('n3',72,3,4_int64,4_int64,.false.), & + bit_field('i3',75,3,0_int64,0_int64,.false.) /)) + + type(message_schema), parameter :: PACK77_SCHEMA_WSPR_TYPE1=message_schema( & + 0,6,'wspr type 1',8,(/ & + bit_field('n28',1,28,0_int64,268435455_int64,.false.), & + bit_field('igrid4',29,15,0_int64,32767_int64,.false.), & + ! idbm max 18 = nint(0.3*dBm) for dBm 0..60; range enforced here + bit_field('idbm',44,5,0_int64,18_int64,.false.), & + bit_field('j49',49,1,0_int64,0_int64,.false.), & + bit_field('j50',50,1,0_int64,0_int64,.false.), & + bit_field('pad',51,21,0_int64,0_int64,.false.), & + bit_field('n3',72,3,6_int64,6_int64,.false.), & + bit_field('i3',75,3,0_int64,0_int64,.false.) /)) + + type(message_schema), parameter :: PACK77_SCHEMA_WSPR_TYPE2=message_schema( & + 0,6,'wspr type 2',7,(/ & + bit_field('n28',1,28,0_int64,268435455_int64,.false.), & + bit_field('npfx',29,16,0_int64,65535_int64,.false.), & + ! idbm max 18 = nint(0.3*dBm) for dBm 0..60; range enforced here + bit_field('idbm',45,5,0_int64,18_int64,.false.), & + bit_field('j50',50,1,1_int64,1_int64,.false.), & + bit_field('pad',51,21,0_int64,0_int64,.false.), & + bit_field('n3',72,3,6_int64,6_int64,.false.), & + bit_field('i3',75,3,0_int64,0_int64,.false.), & + NO_FIELD /)) + + type(message_schema), parameter :: PACK77_SCHEMA_WSPR_TYPE3=message_schema( & + 0,6,'wspr type 3',6,(/ & + bit_field('n22',1,22,0_int64,4194303_int64,.false.), & + bit_field('igrid6',23,25,0_int64,33554431_int64,.false.), & + bit_field('selector',48,3,2_int64,2_int64,.false.), & + bit_field('pad',51,21,0_int64,0_int64,.false.), & + bit_field('n3',72,3,6_int64,6_int64,.false.), & + bit_field('i3',75,3,0_int64,0_int64,.false.), & + NO_FIELD,NO_FIELD /)) + + type(message_schema), parameter :: PACK77_SCHEMA_TYPE1=message_schema( & + 1,0,'type 1 standard',7,(/ & + bit_field('n28a',1,28,0_int64,268435455_int64,.false.), & + bit_field('ipa',29,1,0_int64,1_int64,.false.), & + bit_field('n28b',30,28,0_int64,268435455_int64,.false.), & + bit_field('ipb',58,1,0_int64,1_int64,.false.), & + bit_field('ir',59,1,0_int64,1_int64,.false.), & + bit_field('igrid4',60,15,0_int64,32767_int64,.false.), & + bit_field('i3',75,3,1_int64,1_int64,.false.), & + NO_FIELD /)) + + type(message_schema), parameter :: PACK77_SCHEMA_TYPE2=message_schema( & + 2,0,'type 2 portable',7,(/ & + bit_field('n28a',1,28,0_int64,268435455_int64,.false.), & + bit_field('ipa',29,1,0_int64,1_int64,.false.), & + bit_field('n28b',30,28,0_int64,268435455_int64,.false.), & + bit_field('ipb',58,1,0_int64,1_int64,.false.), & + bit_field('ir',59,1,0_int64,1_int64,.false.), & + bit_field('igrid4',60,15,0_int64,32767_int64,.false.), & + bit_field('i3',75,3,2_int64,2_int64,.false.), & + NO_FIELD /)) + + type(message_schema), parameter :: PACK77_SCHEMA_TYPE3=message_schema( & + 3,0,'type 3 rtty',7,(/ & + bit_field('itu',1,1,0_int64,1_int64,.false.), & + bit_field('n28a',2,28,0_int64,268435455_int64,.false.), & + bit_field('n28b',30,28,0_int64,268435455_int64,.false.), & + bit_field('ir',58,1,0_int64,1_int64,.false.), & + bit_field('irpt',59,3,0_int64,7_int64,.false.), & + bit_field('nexch',62,13,0_int64,8191_int64,.false.), & + bit_field('i3',75,3,3_int64,3_int64,.false.), & + NO_FIELD /)) + + type(message_schema), parameter :: PACK77_SCHEMA_TYPE4=message_schema( & + 4,0,'type 4 nonstandard',6,(/ & + bit_field('n12',1,12,0_int64,4095_int64,.false.), & + bit_field('n58',13,58,0_int64,288230376151711743_int64,.false.), & + bit_field('iflip',71,1,0_int64,1_int64,.false.), & + bit_field('nrpt',72,2,0_int64,3_int64,.false.), & + bit_field('icq',74,1,0_int64,1_int64,.false.), & + bit_field('i3',75,3,4_int64,4_int64,.false.), & + NO_FIELD,NO_FIELD /)) + + type(message_schema), parameter :: PACK77_SCHEMA_TYPE5=message_schema( & + 5,0,'type 5 eu vhf',7,(/ & + bit_field('n12',1,12,0_int64,4095_int64,.false.), & + bit_field('n22',13,22,0_int64,4194303_int64,.false.), & + bit_field('ir',35,1,0_int64,1_int64,.false.), & + bit_field('irpt',36,3,0_int64,7_int64,.false.), & + bit_field('iserial',39,11,1_int64,2047_int64,.false.), & + ! igrid6 max 18662399 = EU-VHF grid6 range, enforced here + ! (WSPR type3 igrid6 keeps the full 2^25-1 range) + bit_field('igrid6',50,25,0_int64,18662399_int64,.false.), & + bit_field('i3',75,3,5_int64,5_int64,.false.), & + NO_FIELD /)) + + type pack77_free_text_fields + character(len=71) :: text_bits='' + end type pack77_free_text_fields + + type pack77_telemetry_fields + integer :: ntel1=0 + integer :: ntel2=0 + integer :: ntel3=0 + end type pack77_telemetry_fields + + type pack77_dxpedition_fields + integer :: n28a=0 + integer :: n28b=0 + integer :: n10=0 + integer :: n5=0 + end type pack77_dxpedition_fields + + type pack77_field_day_fields + integer :: n28a=0 + integer :: n28b=0 + integer :: ir=0 + integer :: intx=0 + integer :: nclass=0 + integer :: isec=0 + end type pack77_field_day_fields + + type pack77_wspr_type1_fields + integer :: n28=0 + integer :: igrid4=0 + integer :: idbm=0 + end type pack77_wspr_type1_fields + + type pack77_wspr_type2_fields + integer :: n28=0 + integer :: npfx=0 + integer :: idbm=0 + end type pack77_wspr_type2_fields + + type pack77_wspr_type3_fields + integer :: n22=0 + integer :: igrid6=0 + end type pack77_wspr_type3_fields + + type pack77_type12_fields + integer :: n28a=0 + integer :: ipa=0 + integer :: n28b=0 + integer :: ipb=0 + integer :: ir=0 + integer :: igrid4=0 + end type pack77_type12_fields + + type pack77_type3_fields + integer :: itu=0 + integer :: n28a=0 + integer :: n28b=0 + integer :: ir=0 + integer :: irpt=0 + integer :: nexch=0 + end type pack77_type3_fields + + type pack77_type4_fields + integer :: n12=0 + integer(kind=int64) :: n58=0_int64 + integer :: iflip=0 + integer :: nrpt=0 + integer :: icq=0 + end type pack77_type4_fields + + type pack77_type5_fields + integer :: n12=0 + integer :: n22=0 + integer :: ir=0 + integer :: irpt=0 + integer :: iserial=0 + integer :: igrid6=0 + end type pack77_type5_fields +contains + + + subroutine begin_message(c77,ok) + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + + c77=repeat('0',len(c77)) + ok=.true. + end subroutine begin_message + + subroutine put_int_i4(ok,c77,field,value) + logical, intent(inout) :: ok + character(len=77), intent(inout) :: c77 + type(bit_field), intent(in) :: field + integer, intent(in) :: value + + call put_int_i8(ok,c77,field,int(value,kind=int64)) + end subroutine put_int_i4 + + subroutine put_int_i8(ok,c77,field,value) + logical, intent(inout) :: ok + character(len=77), intent(inout) :: c77 + type(bit_field), intent(in) :: field + integer(kind=int64), intent(in) :: value + integer :: i + integer(kind=int64) :: place + + if(.not.ok) return + ok=.false. + if(.not.valid_field_bounds(field,len(c77))) return + if(field%bitstring) return + if(value.lt.field%min_value .or. value.gt.field%max_value) return + do i=field%width,1,-1 + place=2_int64**(field%width-i) + if(mod(value/place,2_int64).eq.1_int64) then + c77(field%start_bit+i-1:field%start_bit+i-1)='1' + else + c77(field%start_bit+i-1:field%start_bit+i-1)='0' + endif + enddo + ok=.true. + end subroutine put_int_i8 + + subroutine put_bits(ok,c77,field,bits) + logical, intent(inout) :: ok + character(len=77), intent(inout) :: c77 + type(bit_field), intent(in) :: field + character(len=*), intent(in) :: bits + integer :: i + + if(.not.ok) return + ok=.false. + if(.not.valid_field_bounds(field,len(c77))) return + if(.not.field%bitstring) return + if(len_trim(bits).ne.field%width) return + do i=1,field%width + if(bits(i:i).ne.'0' .and. bits(i:i).ne.'1') return + enddo + c77(field%start_bit:field%start_bit+field%width-1)=bits(1:field%width) + ok=.true. + end subroutine put_bits + + subroutine get_int_i4(ok,c77,field,value) + logical, intent(inout) :: ok + character(len=77), intent(in) :: c77 + type(bit_field), intent(in) :: field + integer, intent(out) :: value + integer(kind=int64) :: int64_value + + value=0 + call get_int_i8(ok,c77,field,int64_value) + if(ok) value=int(int64_value) + end subroutine get_int_i4 + + subroutine get_int_i8(ok,c77,field,value) + logical, intent(inout) :: ok + character(len=77), intent(in) :: c77 + type(bit_field), intent(in) :: field + integer(kind=int64), intent(out) :: value + integer :: i + + value=0_int64 + if(.not.ok) return + ok=.false. + if(.not.valid_field_bounds(field,len(c77))) return + if(field%bitstring) return + do i=0,field%width-1 + value=value*2_int64 + if(c77(field%start_bit+i:field%start_bit+i).eq.'1') then + value=value+1_int64 + else if(c77(field%start_bit+i:field%start_bit+i).ne.'0') then + return + endif + enddo + if(value.lt.field%min_value .or. value.gt.field%max_value) return + ok=.true. + end subroutine get_int_i8 + + subroutine get_bits(ok,c77,field,bits) + logical, intent(inout) :: ok + character(len=77), intent(in) :: c77 + type(bit_field), intent(in) :: field + character(len=*), intent(out) :: bits + + bits='' + if(.not.ok) return + ok=.false. + if(.not.valid_field_bounds(field,len(c77))) return + if(.not.field%bitstring) return + if(field%width.gt.len(bits)) return + if(.not.bits_are_binary(c77(field%start_bit:field%start_bit+field%width-1))) return + bits(1:field%width)=c77(field%start_bit:field%start_bit+field%width-1) + ok=.true. + end subroutine get_bits + + logical function valid_field_bounds(field,nbits) result(ok) + type(bit_field), intent(in) :: field + integer, intent(in) :: nbits + + ok=.false. + if(field%start_bit.lt.1 .or. field%width.lt.1) return + if(field%start_bit+field%width-1.gt.nbits) return + ok=.true. + end function valid_field_bounds + + subroutine encode_pack77_free_text(text_bits,c77,ok) + character(len=*), intent(in) :: text_bits + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + character(len=71) :: packed_text + + call begin_message(c77,ok) + if(len(text_bits).ne.71) then + ok=.false. + return + endif + packed_text=text_bits + call put_bits(ok,c77,PACK77_SCHEMA_FREE_TEXT%fields(1),packed_text) + call put_int(ok,c77,PACK77_SCHEMA_FREE_TEXT%fields(2),0) + call put_int(ok,c77,PACK77_SCHEMA_FREE_TEXT%fields(3),0) + end subroutine encode_pack77_free_text + + subroutine encode_pack77_telemetry(ntel1,ntel2,ntel3,c77,ok) + integer, intent(in) :: ntel1,ntel2,ntel3 + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + + call begin_message(c77,ok) + call put_int(ok,c77,PACK77_SCHEMA_TELEMETRY%fields(1),ntel1) + call put_int(ok,c77,PACK77_SCHEMA_TELEMETRY%fields(2),ntel2) + call put_int(ok,c77,PACK77_SCHEMA_TELEMETRY%fields(3),ntel3) + call put_int(ok,c77,PACK77_SCHEMA_TELEMETRY%fields(4),5) + call put_int(ok,c77,PACK77_SCHEMA_TELEMETRY%fields(5),0) + end subroutine encode_pack77_telemetry + + subroutine encode_pack77_dxpedition(n28a,n28b,n10,n5,c77,ok) + integer, intent(in) :: n28a,n28b,n10,n5 + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + + call begin_message(c77,ok) + call put_int(ok,c77,PACK77_SCHEMA_DXPEDITION%fields(1),n28a) + call put_int(ok,c77,PACK77_SCHEMA_DXPEDITION%fields(2),n28b) + call put_int(ok,c77,PACK77_SCHEMA_DXPEDITION%fields(3),n10) + call put_int(ok,c77,PACK77_SCHEMA_DXPEDITION%fields(4),n5) + call put_int(ok,c77,PACK77_SCHEMA_DXPEDITION%fields(5),1) + call put_int(ok,c77,PACK77_SCHEMA_DXPEDITION%fields(6),0) + end subroutine encode_pack77_dxpedition + + subroutine encode_pack77_field_day(schema,n28a,n28b,ir,intx,nclass,isec,c77,ok) + type(message_schema), intent(in) :: schema + integer, intent(in) :: n28a,n28b,ir,intx,nclass,isec + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + + call begin_message(c77,ok) + call put_int(ok,c77,schema%fields(1),n28a) + call put_int(ok,c77,schema%fields(2),n28b) + call put_int(ok,c77,schema%fields(3),ir) + call put_int(ok,c77,schema%fields(4),intx) + call put_int(ok,c77,schema%fields(5),nclass) + call put_int(ok,c77,schema%fields(6),isec) + call put_int(ok,c77,schema%fields(7),schema%n3) + call put_int(ok,c77,schema%fields(8),0) + end subroutine encode_pack77_field_day + + subroutine encode_pack77_field_day_low(n28a,n28b,ir,intx,nclass,isec,c77,ok) + integer, intent(in) :: n28a,n28b,ir,intx,nclass,isec + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + + call encode_pack77_field_day(PACK77_SCHEMA_FIELD_DAY_LOW, & + n28a,n28b,ir,intx,nclass,isec,c77,ok) + end subroutine encode_pack77_field_day_low + + subroutine encode_pack77_field_day_high(n28a,n28b,ir,intx,nclass,isec,c77,ok) + integer, intent(in) :: n28a,n28b,ir,intx,nclass,isec + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + + call encode_pack77_field_day(PACK77_SCHEMA_FIELD_DAY_HIGH, & + n28a,n28b,ir,intx,nclass,isec,c77,ok) + end subroutine encode_pack77_field_day_high + + subroutine encode_pack77_wspr_type1(n28,igrid4,idbm,c77,ok) + integer, intent(in) :: n28,igrid4,idbm + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + + call begin_message(c77,ok) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(1),n28) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(2),igrid4) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(3),idbm) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(4),0) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(5),0) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(6),0) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(7),6) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(8),0) + end subroutine encode_pack77_wspr_type1 + + subroutine encode_pack77_wspr_type2(n28,npfx,idbm,c77,ok) + integer, intent(in) :: n28,npfx,idbm + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + + call begin_message(c77,ok) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE2%fields(1),n28) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE2%fields(2),npfx) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE2%fields(3),idbm) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE2%fields(4),1) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE2%fields(5),0) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE2%fields(6),6) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE2%fields(7),0) + end subroutine encode_pack77_wspr_type2 + + subroutine encode_pack77_wspr_type3(n22,igrid6,c77,ok) + integer, intent(in) :: n22,igrid6 + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + + call begin_message(c77,ok) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE3%fields(1),n22) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE3%fields(2),igrid6) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE3%fields(3),2) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE3%fields(4),0) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE3%fields(5),6) + call put_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE3%fields(6),0) + end subroutine encode_pack77_wspr_type3 + + subroutine encode_pack77_type12(schema,n28a,ipa,n28b,ipb,ir,igrid4,c77,ok) + type(message_schema), intent(in) :: schema + integer, intent(in) :: n28a,ipa,n28b,ipb,ir,igrid4 + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + + call begin_message(c77,ok) + call put_int(ok,c77,schema%fields(1),n28a) + call put_int(ok,c77,schema%fields(2),ipa) + call put_int(ok,c77,schema%fields(3),n28b) + call put_int(ok,c77,schema%fields(4),ipb) + call put_int(ok,c77,schema%fields(5),ir) + call put_int(ok,c77,schema%fields(6),igrid4) + call put_int(ok,c77,schema%fields(7),schema%i3) + end subroutine encode_pack77_type12 + + subroutine encode_pack77_type1(n28a,ipa,n28b,ipb,ir,igrid4,c77,ok) + integer, intent(in) :: n28a,ipa,n28b,ipb,ir,igrid4 + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + + call encode_pack77_type12(PACK77_SCHEMA_TYPE1, & + n28a,ipa,n28b,ipb,ir,igrid4,c77,ok) + end subroutine encode_pack77_type1 + + subroutine encode_pack77_type2(n28a,ipa,n28b,ipb,ir,igrid4,c77,ok) + integer, intent(in) :: n28a,ipa,n28b,ipb,ir,igrid4 + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + + call encode_pack77_type12(PACK77_SCHEMA_TYPE2, & + n28a,ipa,n28b,ipb,ir,igrid4,c77,ok) + end subroutine encode_pack77_type2 + + subroutine encode_pack77_type3(itu,n28a,n28b,ir,irpt,nexch,c77,ok) + integer, intent(in) :: itu,n28a,n28b,ir,irpt,nexch + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + + call begin_message(c77,ok) + call put_int(ok,c77,PACK77_SCHEMA_TYPE3%fields(1),itu) + call put_int(ok,c77,PACK77_SCHEMA_TYPE3%fields(2),n28a) + call put_int(ok,c77,PACK77_SCHEMA_TYPE3%fields(3),n28b) + call put_int(ok,c77,PACK77_SCHEMA_TYPE3%fields(4),ir) + call put_int(ok,c77,PACK77_SCHEMA_TYPE3%fields(5),irpt) + call put_int(ok,c77,PACK77_SCHEMA_TYPE3%fields(6),nexch) + call put_int(ok,c77,PACK77_SCHEMA_TYPE3%fields(7),3) + end subroutine encode_pack77_type3 + + subroutine encode_pack77_type4(n12,n58,iflip,nrpt,icq,c77,ok) + integer, intent(in) :: n12,iflip,nrpt,icq + integer(kind=int64), intent(in) :: n58 + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + + call begin_message(c77,ok) + call put_int(ok,c77,PACK77_SCHEMA_TYPE4%fields(1),n12) + call put_int(ok,c77,PACK77_SCHEMA_TYPE4%fields(2),n58) + call put_int(ok,c77,PACK77_SCHEMA_TYPE4%fields(3),iflip) + call put_int(ok,c77,PACK77_SCHEMA_TYPE4%fields(4),nrpt) + call put_int(ok,c77,PACK77_SCHEMA_TYPE4%fields(5),icq) + call put_int(ok,c77,PACK77_SCHEMA_TYPE4%fields(6),4) + end subroutine encode_pack77_type4 + + subroutine encode_pack77_type5(n12,n22,ir,irpt,iserial,igrid6,c77,ok) + integer, intent(in) :: n12,n22,ir,irpt,iserial,igrid6 + character(len=77), intent(out) :: c77 + logical, intent(out) :: ok + + call begin_message(c77,ok) + call put_int(ok,c77,PACK77_SCHEMA_TYPE5%fields(1),n12) + call put_int(ok,c77,PACK77_SCHEMA_TYPE5%fields(2),n22) + call put_int(ok,c77,PACK77_SCHEMA_TYPE5%fields(3),ir) + call put_int(ok,c77,PACK77_SCHEMA_TYPE5%fields(4),irpt) + call put_int(ok,c77,PACK77_SCHEMA_TYPE5%fields(5),iserial) + call put_int(ok,c77,PACK77_SCHEMA_TYPE5%fields(6),igrid6) + call put_int(ok,c77,PACK77_SCHEMA_TYPE5%fields(7),5) + end subroutine encode_pack77_type5 + + subroutine decode_pack77_tag(c77,i3,n3,ok,binary_checked) + character(len=77), intent(in) :: c77 + integer, intent(out) :: i3,n3 + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + integer(kind=int64) :: value + + i3=-1 + n3=-1 + ok=pack77_binary_precondition(c77,binary_checked) + call get_int(ok,c77,bit_field('i3',75,3,0_int64,7_int64,.false.),value) + if(.not.ok) return + i3=int(value) + if(i3.eq.0) then + call get_int(ok,c77,bit_field('n3',72,3,0_int64,7_int64,.false.),value) + if(.not.ok) return + n3=int(value) + else + n3=0 + endif + end subroutine decode_pack77_tag + + subroutine decode_pack77_free_text(c77,fields,ok,binary_checked) + character(len=77), intent(in) :: c77 + type(pack77_free_text_fields), intent(out) :: fields + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + + fields=pack77_free_text_fields() + ok=pack77_binary_precondition(c77,binary_checked) + call get_bits(ok,c77,PACK77_SCHEMA_FREE_TEXT%fields(1),fields%text_bits) + call require_int(ok,c77,PACK77_SCHEMA_FREE_TEXT%fields(2),0) + call require_int(ok,c77,PACK77_SCHEMA_FREE_TEXT%fields(3),0) + end subroutine decode_pack77_free_text + + subroutine decode_pack77_telemetry(c77,fields,ok,binary_checked) + character(len=77), intent(in) :: c77 + type(pack77_telemetry_fields), intent(out) :: fields + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + + fields=pack77_telemetry_fields() + ok=pack77_binary_precondition(c77,binary_checked) + call get_int(ok,c77,PACK77_SCHEMA_TELEMETRY%fields(1),fields%ntel1) + call get_int(ok,c77,PACK77_SCHEMA_TELEMETRY%fields(2),fields%ntel2) + call get_int(ok,c77,PACK77_SCHEMA_TELEMETRY%fields(3),fields%ntel3) + call require_int(ok,c77,PACK77_SCHEMA_TELEMETRY%fields(4),5) + call require_int(ok,c77,PACK77_SCHEMA_TELEMETRY%fields(5),0) + end subroutine decode_pack77_telemetry + + subroutine decode_pack77_dxpedition(c77,fields,ok,binary_checked) + character(len=77), intent(in) :: c77 + type(pack77_dxpedition_fields), intent(out) :: fields + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + + fields=pack77_dxpedition_fields() + ok=pack77_binary_precondition(c77,binary_checked) + call get_int(ok,c77,PACK77_SCHEMA_DXPEDITION%fields(1),fields%n28a) + call get_int(ok,c77,PACK77_SCHEMA_DXPEDITION%fields(2),fields%n28b) + call get_int(ok,c77,PACK77_SCHEMA_DXPEDITION%fields(3),fields%n10) + call get_int(ok,c77,PACK77_SCHEMA_DXPEDITION%fields(4),fields%n5) + call require_int(ok,c77,PACK77_SCHEMA_DXPEDITION%fields(5),1) + call require_int(ok,c77,PACK77_SCHEMA_DXPEDITION%fields(6),0) + end subroutine decode_pack77_dxpedition + + subroutine decode_pack77_field_day_low(c77,fields,ok,binary_checked) + character(len=77), intent(in) :: c77 + type(pack77_field_day_fields), intent(out) :: fields + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + + call decode_pack77_field_day(PACK77_SCHEMA_FIELD_DAY_LOW,c77,fields, & + ok,binary_checked) + end subroutine decode_pack77_field_day_low + + subroutine decode_pack77_field_day_high(c77,fields,ok,binary_checked) + character(len=77), intent(in) :: c77 + type(pack77_field_day_fields), intent(out) :: fields + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + + call decode_pack77_field_day(PACK77_SCHEMA_FIELD_DAY_HIGH,c77,fields, & + ok,binary_checked) + end subroutine decode_pack77_field_day_high + + subroutine decode_pack77_wspr_type1(c77,fields,ok,binary_checked) + character(len=77), intent(in) :: c77 + type(pack77_wspr_type1_fields), intent(out) :: fields + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + + fields=pack77_wspr_type1_fields() + ok=pack77_binary_precondition(c77,binary_checked) + call get_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(1),fields%n28) + call get_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(2),fields%igrid4) + call get_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(3),fields%idbm) + call require_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(4),0) + call require_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(5),0) + call require_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(6),0) + call require_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(7),6) + call require_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE1%fields(8),0) + end subroutine decode_pack77_wspr_type1 + + subroutine decode_pack77_wspr_type2(c77,fields,ok,binary_checked) + character(len=77), intent(in) :: c77 + type(pack77_wspr_type2_fields), intent(out) :: fields + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + + fields=pack77_wspr_type2_fields() + ok=pack77_binary_precondition(c77,binary_checked) + call get_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE2%fields(1),fields%n28) + call get_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE2%fields(2),fields%npfx) + call get_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE2%fields(3),fields%idbm) + call require_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE2%fields(4),1) + call require_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE2%fields(5),0) + call require_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE2%fields(6),6) + call require_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE2%fields(7),0) + end subroutine decode_pack77_wspr_type2 + + subroutine decode_pack77_wspr_type3(c77,fields,ok,binary_checked) + character(len=77), intent(in) :: c77 + type(pack77_wspr_type3_fields), intent(out) :: fields + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + + fields=pack77_wspr_type3_fields() + ok=pack77_binary_precondition(c77,binary_checked) + call get_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE3%fields(1),fields%n22) + call get_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE3%fields(2),fields%igrid6) + call require_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE3%fields(3),2) + call require_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE3%fields(4),0) + call require_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE3%fields(5),6) + call require_int(ok,c77,PACK77_SCHEMA_WSPR_TYPE3%fields(6),0) + end subroutine decode_pack77_wspr_type3 + + subroutine decode_pack77_type1(c77,fields,ok,binary_checked) + character(len=77), intent(in) :: c77 + type(pack77_type12_fields), intent(out) :: fields + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + + call decode_pack77_type12(PACK77_SCHEMA_TYPE1,c77,fields,ok,binary_checked) + end subroutine decode_pack77_type1 + + subroutine decode_pack77_type2(c77,fields,ok,binary_checked) + character(len=77), intent(in) :: c77 + type(pack77_type12_fields), intent(out) :: fields + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + + call decode_pack77_type12(PACK77_SCHEMA_TYPE2,c77,fields,ok,binary_checked) + end subroutine decode_pack77_type2 + + subroutine decode_pack77_type3(c77,fields,ok,binary_checked) + character(len=77), intent(in) :: c77 + type(pack77_type3_fields), intent(out) :: fields + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + + fields=pack77_type3_fields() + ok=pack77_binary_precondition(c77,binary_checked) + call get_int(ok,c77,PACK77_SCHEMA_TYPE3%fields(1),fields%itu) + call get_int(ok,c77,PACK77_SCHEMA_TYPE3%fields(2),fields%n28a) + call get_int(ok,c77,PACK77_SCHEMA_TYPE3%fields(3),fields%n28b) + call get_int(ok,c77,PACK77_SCHEMA_TYPE3%fields(4),fields%ir) + call get_int(ok,c77,PACK77_SCHEMA_TYPE3%fields(5),fields%irpt) + call get_int(ok,c77,PACK77_SCHEMA_TYPE3%fields(6),fields%nexch) + call require_int(ok,c77,PACK77_SCHEMA_TYPE3%fields(7),3) + end subroutine decode_pack77_type3 + + subroutine decode_pack77_type4(c77,fields,ok,binary_checked) + character(len=77), intent(in) :: c77 + type(pack77_type4_fields), intent(out) :: fields + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + + fields=pack77_type4_fields() + ok=pack77_binary_precondition(c77,binary_checked) + call get_int(ok,c77,PACK77_SCHEMA_TYPE4%fields(1),fields%n12) + call get_int(ok,c77,PACK77_SCHEMA_TYPE4%fields(2),fields%n58) + call get_int(ok,c77,PACK77_SCHEMA_TYPE4%fields(3),fields%iflip) + call get_int(ok,c77,PACK77_SCHEMA_TYPE4%fields(4),fields%nrpt) + call get_int(ok,c77,PACK77_SCHEMA_TYPE4%fields(5),fields%icq) + call require_int(ok,c77,PACK77_SCHEMA_TYPE4%fields(6),4) + end subroutine decode_pack77_type4 + + subroutine decode_pack77_type5(c77,fields,ok,binary_checked) + character(len=77), intent(in) :: c77 + type(pack77_type5_fields), intent(out) :: fields + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + + fields=pack77_type5_fields() + ok=pack77_binary_precondition(c77,binary_checked) + call get_int(ok,c77,PACK77_SCHEMA_TYPE5%fields(1),fields%n12) + call get_int(ok,c77,PACK77_SCHEMA_TYPE5%fields(2),fields%n22) + call get_int(ok,c77,PACK77_SCHEMA_TYPE5%fields(3),fields%ir) + call get_int(ok,c77,PACK77_SCHEMA_TYPE5%fields(4),fields%irpt) + call get_int(ok,c77,PACK77_SCHEMA_TYPE5%fields(5),fields%iserial) + call get_int(ok,c77,PACK77_SCHEMA_TYPE5%fields(6),fields%igrid6) + call require_int(ok,c77,PACK77_SCHEMA_TYPE5%fields(7),5) + end subroutine decode_pack77_type5 + + subroutine decode_pack77_field_day(schema,c77,fields,ok,binary_checked) + type(message_schema), intent(in) :: schema + character(len=77), intent(in) :: c77 + type(pack77_field_day_fields), intent(out) :: fields + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + + fields=pack77_field_day_fields() + ok=pack77_binary_precondition(c77,binary_checked) + call get_int(ok,c77,schema%fields(1),fields%n28a) + call get_int(ok,c77,schema%fields(2),fields%n28b) + call get_int(ok,c77,schema%fields(3),fields%ir) + call get_int(ok,c77,schema%fields(4),fields%intx) + call get_int(ok,c77,schema%fields(5),fields%nclass) + call get_int(ok,c77,schema%fields(6),fields%isec) + call require_int(ok,c77,schema%fields(7),schema%n3) + call require_int(ok,c77,schema%fields(8),0) + end subroutine decode_pack77_field_day + + subroutine decode_pack77_type12(schema,c77,fields,ok,binary_checked) + type(message_schema), intent(in) :: schema + character(len=77), intent(in) :: c77 + type(pack77_type12_fields), intent(out) :: fields + logical, intent(out) :: ok + logical, intent(in), optional :: binary_checked + + fields=pack77_type12_fields() + ok=pack77_binary_precondition(c77,binary_checked) + call get_int(ok,c77,schema%fields(1),fields%n28a) + call get_int(ok,c77,schema%fields(2),fields%ipa) + call get_int(ok,c77,schema%fields(3),fields%n28b) + call get_int(ok,c77,schema%fields(4),fields%ipb) + call get_int(ok,c77,schema%fields(5),fields%ir) + call get_int(ok,c77,schema%fields(6),fields%igrid4) + call require_int(ok,c77,schema%fields(7),schema%i3) + end subroutine decode_pack77_type12 + + subroutine require_int(ok,c77,field,expected) + logical, intent(inout) :: ok + character(len=77), intent(in) :: c77 + type(bit_field), intent(in) :: field + integer, intent(in) :: expected + integer(kind=int64) :: value + + call get_int(ok,c77,field,value) + if(ok) ok=value.eq.int(expected,kind=int64) + end subroutine require_int + + logical function pack77_binary_precondition(c77,binary_checked) result(ok) + character(len=*), intent(in) :: c77 + logical, intent(in), optional :: binary_checked + + ok=.false. + if(present(binary_checked)) then + if(binary_checked) then + ! Caller asserts decode_pack77_tag has accepted this same c77. + ok=.true. + return + endif + endif + ok=bits_are_binary(c77) + end function pack77_binary_precondition + + logical function bits_are_binary(c77) result(ok) + character(len=*), intent(in) :: c77 + integer :: i + + ok=.false. + do i=1,len(c77) + if(c77(i:i).ne.'0' .and. c77(i:i).ne.'1') return + enddo + ok=.true. + end function bits_are_binary + +end module packjt77_schema diff --git a/lib/EchoCallSim.f90 b/lib/EchoCallSim.f90 index 224e68c7..e9b55b5a 100644 --- a/lib/EchoCallSim.f90 +++ b/lib/EchoCallSim.f90 @@ -4,13 +4,13 @@ program EchoCallSim use wavhdr parameter (NSPS=4096,NZ=3*12000) - parameter (NMAX=6*NSPS) !Samples in .wav file, 2.2*12000 + parameter (NMAX=6*NSPS) !Samples occupied by the signal type(hdr) h !Header for .wav file integer*2 iwave(NZ) !Generated waveform integer itone(6) !Channel symbols, values 0-37 real*4 xnoise(NMAX) !Generated random noise real*4 dat(NMAX) !Generated real data - complex cdat(NMAX) !Generated complex waveform + complex cdat(NZ) !Generated full-length complex waveform complex z real*8 f0,dt,twopi,phi,dphi,fsample,freq character callsign*6,fname*17,arg*8 @@ -46,7 +46,7 @@ program EchoCallSim twopi=8.d0*atan(1.d0) rms=100. fsample=12000.d0 !Sample rate (Hz) - npts=NMAX !Total samples in .wav file + npts=NMAX !Samples occupied by the signal nfft=npts nh=nfft/2 dt=1.d0/fsample !Sample interval (s) @@ -61,8 +61,11 @@ program EchoCallSim endif bandwidth_ratio=2500.0/6000.0 - sig=sqrt(2*bandwidth_ratio)*10.0**(0.05*snrdb) - if(snrdb.gt.90.0) sig=1.0 + if(snrdb.ge.90.0) then + sig=1.0 + else + sig=sqrt(2*bandwidth_ratio)*10.0**(0.05*snrdb) + endif phi=0.d0 dphi=0.d0 @@ -80,12 +83,22 @@ program EchoCallSim enddo enddo + cdat(npts+1:)=0. if(fspread.gt.0.0) call fspread_lorentz(cdat,fspread) - dat=aimag(cdat) + xnoise !Add generated AWGN noise - fac=32767.0 - if(snrdb.ge.90.0) iwave(1:npts)=nint(fac*dat(1:npts)) - if(snrdb.lt.90.0) iwave(1:npts)=nint(rms*dat(1:npts)) + dat=aimag(cdat(1:npts)) + xnoise !Add generated AWGN noise + datpk=maxval(abs(dat)) + fac=rms + if(datpk.gt.0.0) then + if(snrdb.ge.90.0) then + fac=32766.0/datpk + elseif(fac*datpk.gt.32766.0) then + fac=32766.0/datpk + write(*,'(a,i0,a)') 'Warning: normalized file ',ifile, & + ' to prevent 16-bit PCM overflow; absolute level was not preserved.' + endif + endif + iwave(1:npts)=nint(fac*dat(1:npts)) iwave(npts+1:)=0 nDop=nint(fdop) @@ -101,7 +114,7 @@ program EchoCallSim isec=mod(n,60) write(fname,1102) ihr,imin,isec 1102 format('000000_',3i2.2,'.wav') - open(10,file=trim(fname),access='stream',status='unknown') + open(10,file=trim(fname),access='stream',status='replace') write(10) h,iwave !Save the .wav file close(10) @@ -111,5 +124,3 @@ program EchoCallSim enddo 999 end program EchoCallSim - - diff --git a/lib/addit.f90 b/lib/addit.f90 index 48fd8cd4..c3b948aa 100644 --- a/lib/addit.f90 +++ b/lib/addit.f90 @@ -44,6 +44,7 @@ subroutine addcw(icw,ncw,ifreq,sig,dat) real x(60*12000) real y(60*12000) real*8 dt,twopi,phi,dphi,fsample,tdit,t + save s,x,y wpm=25.0 nspd=nint(1.2*12000.0/wpm) diff --git a/lib/afc9.f90 b/lib/afc9.f90 index dd106aa4..83647867 100644 --- a/lib/afc9.f90 +++ b/lib/afc9.f90 @@ -1,8 +1,8 @@ subroutine afc9(c3a,npts,fsample,a,syncpk) - parameter (NZ2=1512) - complex c3a(0:NZ2-1) - complex c3(0:NZ2-1) + parameter (NZ3=1360) + complex c3a(0:NZ3-1) + complex c3(0:NZ3-1) real a(3),deltaa(3) a(1)=0. !f0 diff --git a/lib/allsim.f90 b/lib/allsim.f90 index 94a03ef4..5607c53b 100644 --- a/lib/allsim.f90 +++ b/lib/allsim.f90 @@ -45,7 +45,7 @@ program allsim call sgran() !Seed C rand generator (used in gran) h=default_header(12000,NMAX) - open(10,file='000000_0000.wav',access='stream',status='unknown') + open(10,file='000000_0000.wav',access='stream',status='replace') do i=1,NMAX !Generate gaussian noise dat(i)=gran() enddo @@ -106,7 +106,7 @@ program allsim endif if(isig.eq.0 .or. isig.eq.9) then - call genq65(msg37,0,msgsent37,itone,i3,n3) + call genq65(msg37,0,msgsent37,itone,i3,n3,0) call addit(itone,12000,85,7200,2000,sig,dat) !9 Q65 endif diff --git a/lib/astro.f90 b/lib/astro.f90 index ae2ad1f2..cb44433d 100644 --- a/lib/astro.f90 +++ b/lib/astro.f90 @@ -1,8 +1,10 @@ subroutine astro(nyear,month,nday,uth,freq8,Mygrid, & NStation,MoonDX,AzSun,ElSun,AzMoon0,ElMoon0, & ntsky,doppler00,doppler,dbMoon,RAMoon,DecMoon,HA,Dgrd,sd, & - poloffset,xnr,day,lon,lat,LST,techo) + poloffset,xnr,day,lon,lat,LST,techo,ephemeris_result) + use jpl_ephemeris_status, only: EPHEMERIS_INVALID_INPUT, & + EPHEMERIS_UNAVAILABLE ! Computes astronomical quantities for display and tracking. ! NB: may want to smooth the Tsky map to 10 degrees or so. @@ -10,6 +12,7 @@ subroutine astro(nyear,month,nday,uth,freq8,Mygrid, & real*8 freq8 real LST real lat,lon + integer ephemeris_result integer*2 nt144(180) ! common/echo/xdop(2),techo,AzMoon,ElMoon,mjd @@ -43,7 +46,31 @@ subroutine astro(nyear,month,nday,uth,freq8,Mygrid, & AzSun,ElSun,mjd,day) call MoonDopJPL(nyear,month,nday,uth,lon,lat,RAMoon,DecMoon, & - LST,HA,AzMoon,ElMoon,vr,techo) + LST,HA,AzMoon,ElMoon,vr,techo,ephemeris_result) + if(ephemeris_result.eq.EPHEMERIS_INVALID_INPUT .or. & + ephemeris_result.eq.EPHEMERIS_UNAVAILABLE) then + AzSun=0. + ElSun=0. + AzMoon0=0. + ElMoon0=0. + ntsky=0 + doppler00=0. + doppler=0. + dbMoon=0. + RAMoon=0. + DecMoon=0. + HA=0. + Dgrd=0. + sd=0. + poloffset=0. + xnr=0. + day=0. + lon=0. + lat=0. + LST=0. + techo=0. + return + endif RAMoon=rad*RAMoon DecMoon=rad*DecMoon dist=2.99792458d5*techo/2.d0 diff --git a/lib/astro0.f90 b/lib/astro0.f90 index d852fbf3..207aa6a4 100644 --- a/lib/astro0.f90 +++ b/lib/astro0.f90 @@ -1,35 +1,63 @@ subroutine astro0(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8,ntsky,ndop,ndop00, & dbMoon8,RAMoon8,DecMoon8,HA8,Dgrd8,sd8,poloffset8,xnr8,dfdt,dfdt0, & - width1,width2,xlst8,techo8) + width1,width2,xlst8,techo8,ephemeris_result) + use jpl_ephemeris_status, only: EPHEMERIS_JPL, & + EPHEMERIS_ANALYTIC_FALLBACK, EPHEMERIS_INVALID_INPUT, & + EPHEMERIS_UNAVAILABLE, jpl_reader_generation parameter (DEGS=57.2957795130823d0) - character*6 mygrid,hisgrid + character*6 mygrid,hisgrid,mygrid_calc,hisgrid_calc + character(len=6), parameter :: legacy_blank_grid='BB44mm' real*8 AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8 real*8 dbMoon8,RAMoon8,DecMoon8,HA8,Dgrd8,xnr8,dfdt,dfdt0,dt real*8 sd8,poloffset8,width1,width2,xlst8 real*8 uth8,techo8,freq8 real*8 xl,b + integer ephemeris_result,result_dx,result_self,last_result + integer last_reader_generation common/librcom/xl(2),b(2) common/echocom2/fspread_self,fspread_dx data uth8z/0.d0/ + data last_result/-1/ + data last_reader_generation/-1/ save uth=uth8 - call astro(nyear,month,nday,uth,freq8,hisgrid,2,1, & + mygrid_calc=mygrid + hisgrid_calc=hisgrid +! Blank locators historically reduce to the same periodic position as BB44mm. + if(len_trim(mygrid_calc).eq.0) mygrid_calc=legacy_blank_grid + if(len_trim(hisgrid_calc).eq.0) hisgrid_calc=legacy_blank_grid + + call astro(nyear,month,nday,uth,freq8,hisgrid_calc,2,1, & AzSun,ElSun,AzMoon,ElMoon,ntsky,doppler00,doppler, & dbMoon,RAMoon,DecMoon,HA,Dgrd,sd,poloffset,xnr, & - day,xlon2,xlat2,xlst,techo) + day,xlon2,xlat2,xlst,techo,result_dx) + if(result_dx.eq.EPHEMERIS_INVALID_INPUT .or. & + result_dx.eq.EPHEMERIS_UNAVAILABLE) then + ephemeris_result=result_dx + go to 800 + endif AzMoonB8=AzMoon ElMoonB8=ElMoon xl2=xl(1) xl2a=xl(2) b2=b(1) b2a=b(2) - call astro(nyear,month,nday,uth,freq8,mygrid,1,1, & + call astro(nyear,month,nday,uth,freq8,mygrid_calc,1,1, & AzSun,ElSun,AzMoon,ElMoon,ntsky,doppler00,doppler, & dbMoon,RAMoon,DecMoon,HA,Dgrd,sd,poloffset,xnr, & - day,xlon1,xlat1,xlst,techo) + day,xlon1,xlat1,xlst,techo,result_self) + if(result_self.eq.EPHEMERIS_INVALID_INPUT .or. & + result_self.eq.EPHEMERIS_UNAVAILABLE) then + ephemeris_result=result_self + go to 800 + endif + ephemeris_result=EPHEMERIS_JPL + if(result_dx.eq.EPHEMERIS_ANALYTIC_FALLBACK .or. & + result_self.eq.EPHEMERIS_ANALYTIC_FALLBACK) & + ephemeris_result=EPHEMERIS_ANALYTIC_FALLBACK xl1=xl(1) xl1a=xl(2) b1=b(1) @@ -45,7 +73,10 @@ subroutine astro0(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & width1=0.5*6741*fghz*rate1 rate2=sqrt((dldt1+dldt2)**2 + (dbdt1+dbdt2)**2) width2=0.5*6741*fghz*rate2 - if(hisgrid(1:4).eq.' ') width2=width1 !No hisgrid, use self width + if(hisgrid(1:4).eq.' ') then + width2=width1 + xnr=0. + endif fspread_self=width1 !Save for avecho() fspread_dx=width2 !Save for avecho() @@ -65,19 +96,53 @@ subroutine astro0(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & ndop=nint(doppler) ndop00=nint(doppler00) - if(uth8z.eq.0.d0) then - uth8z=uth8-1.d0/3600.d0 - dopplerz=doppler - doppler00z=doppler00 + if(uth8z.eq.0.d0 .or. ephemeris_result.ne.last_result .or. & + jpl_reader_generation.ne.last_reader_generation) then + dfdt=0.d0 + dfdt0=0.d0 + else + dt=60.0*(uth8-uth8z) + if(dt.le.0) dt=1.d0/60.d0 + dfdt=(doppler-dopplerz)/dt + dfdt0=(doppler00-doppler00z)/dt endif - - dt=60.0*(uth8-uth8z) - if(dt.le.0) dt=1.d0/60.d0 - dfdt=(doppler-dopplerz)/dt - dfdt0=(doppler00-doppler00z)/dt uth8z=uth8 dopplerz=doppler doppler00z=doppler00 + last_result=ephemeris_result + last_reader_generation=jpl_reader_generation + + return +800 uth8z=0.d0 + dopplerz=0.0 + doppler00z=0.0 + last_result=-1 + last_reader_generation=-1 + fspread_self=0.0 + fspread_dx=0.0 + AzSun8=0.d0 + ElSun8=0.d0 + AzMoon8=0.d0 + ElMoon8=0.d0 + AzMoonB8=0.d0 + ElMoonB8=0.d0 + ntsky=0 + ndop=0 + ndop00=0 + dbMoon8=0.d0 + RAMoon8=0.d0 + DecMoon8=0.d0 + HA8=0.d0 + Dgrd8=0.d0 + sd8=0.d0 + poloffset8=0.d0 + xnr8=0.d0 + dfdt=0.d0 + dfdt0=0.d0 + width1=0.d0 + width2=0.d0 + xlst8=0.d0 + techo8=0.d0 return end subroutine astro0 diff --git a/lib/astrosub.f90 b/lib/astrosub.f90 index 28eaa1ed..35437cc2 100644 --- a/lib/astrosub.f90 +++ b/lib/astrosub.f90 @@ -11,20 +11,24 @@ contains subroutine astrosub(nyear,month,nday,uth8,freq8,mygrid_cp, & hisgrid_cp,AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8, & - ntsky,ndop,ndop00,RAMoon8,DecMoon8,Dgrd8,poloffset8,xnr8,extraazel,techo8,width1, & - width2,bTx,AzElFileName_cp,jpleph_file_name_cp) & + ntsky,ndop,ndop00,RAMoon8,DecMoon8,Dgrd8,poloffset8,xnr8,extraazel, & + techo8,width1,width2,bTx,AzElFileName_cp,jpleph_file_name_cp, & + ephemeris_result) & bind (C, name="astrosub") use :: types, only: dp - use :: C_interface_module, only: C_int, C_double, C_bool, C_ptr, C_string_value, assignment(=) + use :: jpl_ephemeris_status, only: EPHEMERIS_INVALID_INPUT, & + EPHEMERIS_UNAVAILABLE + use :: C_interface_module, only: C_int, C_double, C_bool, C_ptr, & + C_string_value, assignment(=) integer(C_int), intent(in), value :: nyear, month, nday - logical(C_int), value :: extraazel + logical(C_bool), intent(in), value :: extraazel real(C_double), intent(in), value :: uth8, freq8 real(C_double), intent(out) :: AzSun8, ElSun8, AzMoon8, ElMoon8, AzMoonB8, & ElMoonB8, Ramoon8, DecMoon8, Dgrd8, poloffset8, xnr8, techo8, width1, & width2 - integer(C_int), intent(out) :: ntsky, ndop, ndop00 + integer(C_int), intent(out) :: ntsky, ndop, ndop00, ephemeris_result logical(C_bool), intent(in), value :: bTx type(C_ptr), value, intent(in) :: mygrid_cp, hisgrid_cp, AzElFileName_cp, & jpleph_file_name_cp @@ -48,12 +52,13 @@ contains hisgrid = hisgrid_cp AzElFileName = C_string_value (AzElFileName_cp) jpleph_file_name = jpleph_file_name_cp - call astro0(nyear,month,nday,uth8,freq8,mygrid,hisgrid, & AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8,ntsky,ndop,ndop00, & dbMoon8,RAMoon8,DecMoon8,HA8,Dgrd8,sd8,poloffset8,xnr8,dfdt,dfdt0, & - width1,width2,xlst8,techo8) + width1,width2,xlst8,techo8,ephemeris_result) + if (ephemeris_result.eq.EPHEMERIS_INVALID_INPUT .or. & + ephemeris_result.eq.EPHEMERIS_UNAVAILABLE) go to 999 if (len_trim(AzElFileName) .eq. 0) go to 999 if(len(trim(hisgrid)).eq.0) then !If DX grid is blank, set these to zero: AzMoonB8=0 diff --git a/lib/avecho.f90 b/lib/avecho.f90 index 7b68213f..bfa1be1c 100644 --- a/lib/avecho.f90 +++ b/lib/avecho.f90 @@ -1,4 +1,4 @@ -subroutine avecho(id2_0,ndop,nfrit,nauto,ndf,navg,nqual,f1,xlevel, & +subroutine avecho(id2_0,ndop,nfrit,nauto,navg,nqual,f1,xlevel, & snrdb,db_err,dfreq,width,bDiskData,bEchoCall,txcall,rxcall) parameter (NTX=6*4096) @@ -29,7 +29,8 @@ subroutine avecho(id2_0,ndop,nfrit,nauto,ndf,navg,nqual,f1,xlevel, & data navg0/-1/ save dop0,navg0,sax,sbx - if(ndf.eq.-999) stop !Silence compiler warning + rxcall=' ' + if(bEchoCall .and. .not.bDiskData) then ! Calculate the transmitted tones for real-time Echo Call testing call gen_echocall(txcall,itone4) @@ -54,7 +55,7 @@ subroutine avecho(id2_0,ndop,nfrit,nauto,ndf,navg,nqual,f1,xlevel, & endif sq=sum(float(id2_0(16:NTX))**2) - xlevel=10.0*log10(sq/(NTX-15)) + xlevel=db(sq/(NTX-15)) if(navg.eq.1) nclearave=1 if(nclearave.ne.0) nsum=0 @@ -81,7 +82,6 @@ subroutine avecho(id2_0,ndop,nfrit,nauto,ndf,navg,nqual,f1,xlevel, & ! Shift all tone frequencies to 1500 Hz, returning modified data in id2 ! and decoded message in rxcall. - rxcall=' ' call decode_echo(id2,.false.,rxcall) x(1:15)=0. diff --git a/lib/blanker.f90 b/lib/blanker.f90 index fe43931b..ec94f0df 100644 --- a/lib/blanker.f90 +++ b/lib/blanker.f90 @@ -4,6 +4,7 @@ subroutine blanker(iwave,nz,ndropmax,npct,c_bigfft) complex c_bigfft(0:nz/2) integer hist(0:32768) real fblank !Fraction of points to be blanked + save hist fblank=0.01*npct hist=0 diff --git a/lib/ccf2.f90 b/lib/ccf2.f90 index 8e1f6cf4..c84fc240 100644 --- a/lib/ccf2.f90 +++ b/lib/ccf2.f90 @@ -41,7 +41,7 @@ subroutine ccf2(ss,nz,nflip,ccfbest,xlagpk) xlagpk=lagpk endif enddo - if( lagpk.gt.-LAGMAX .and. lagpk.lt.LAGMAX) then + if( lagpk.gt.LAGMIN .and. lagpk.lt.LAGMAX) then call peakup(ccf(lagpk-1),ccf(lagpk),ccf(lagpk+1),dx) xlagpk=lagpk+dx endif diff --git a/lib/cwsim.f90 b/lib/cwsim.f90 index 92300b72..3c36a820 100644 --- a/lib/cwsim.f90 +++ b/lib/cwsim.f90 @@ -3,6 +3,7 @@ program cwsim ! Generate simulated audio for a CW message sent repeatedly for 60 seconds use wavhdr + use morse_encoder, only: encode_morse parameter (NMAX=60*12000) type(hdr) h !Header for the .wav file integer*2 iwave(NMAX) !Generated waveform (no noise) @@ -33,19 +34,23 @@ program cwsim call getarg(6,arg) read(arg,*) snrdb !S/N in dB (2500 hz reference BW) + call encode_morse(trim(message),icw,ncw) + if(ncw.eq.0) then + print*,'Error: message contains unsupported Morse characters' + stop 1 + endif + rms=500.0 bandwidth_ratio=2500.0/6000.0 sig=sqrt(2*bandwidth_ratio)*10.0**(0.05*snrdb) twopi=8.0*atan(1.0) h=default_header(12000,NMAX) - open(10,file='000000_0000.wav',access='stream',status='unknown') + open(10,file='000000_0000.wav',access='stream',status='replace') do i=1,NMAX !Generate gaussian noise xnoise(i)=gran() enddo - itone=0 - call morse(message,icw,ncw) call cwsig(icw,ncw,ifreq,wpm,sig,cdat) nfft=NMAX @@ -112,6 +117,7 @@ subroutine cwsig(icw,ncw,ifreq,wpm,sig,cdat) complex z(NMAX) real x(NMAX) real y(NMAX) + save z,x,y !Keep these big arrays off the stack real*8 dt,twopi,phi,dphi,fsample,tdit,t nspd=nint(1.2*12000.0/wpm) @@ -145,91 +151,3 @@ subroutine cwsig(icw,ncw,ifreq,wpm,sig,cdat) return end subroutine cwsig - -subroutine morse(msg,idat,n) - -! Convert ascii message to a Morse code bit string. -! Dash = 3 dots -! Space between dots, dashes = 1 dot -! Space between letters = 3 dots -! Space between words = 7 dots - - character*(*) msg - integer idat(500) - integer*1 ic(21,38) - data ic/ & - 1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,20, & - 1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,0,0,18, & - 1,0,1,0,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,16, & - 1,0,1,0,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,14, & - 1,0,1,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,12, & - 1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,10, & - 1,1,1,0,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,12, & - 1,1,1,0,1,1,1,0,1,0,1,0,1,0,0,0,0,0,0,0,14, & - 1,1,1,0,1,1,1,0,1,1,1,0,1,0,1,0,0,0,0,0,16, & - 1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,0,0,0,18, & - 1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 6, & - 1,1,1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,10, & - 1,1,1,0,1,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,12, & - 1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, 8, & - 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2, & - 1,0,1,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,10, & - 1,1,1,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,10, & - 1,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, 8, & - 1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 4, & - 1,0,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,14, & - 1,1,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,10, & - 1,0,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,10, & - 1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0, 8, & - 1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 6, & - 1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,12, & - 1,0,1,1,1,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,12, & - 1,1,1,0,1,1,1,0,1,0,1,1,1,0,0,0,0,0,0,0,14, & - 1,0,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0, 8, & - 1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 6, & - 1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 4, & - 1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0, 8, & - 1,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,10, & - 1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,10, & - 1,1,1,0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,12, & - 1,1,1,0,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,14, & - 1,1,1,0,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,12, & - 1,1,1,0,1,0,1,0,1,1,1,0,1,0,0,0,0,0,0,0,14, & - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2/ !Incremental word space - save - - msglen=len(trim(msg)) - idat=0 - n=6 - do k=1,msglen - jj=ichar(msg(k:k)) - if(jj.ge.97 .and. jj.le.122) jj=jj-32 !Convert lower to upper case - if(jj.ge.48 .and. jj.le.57) j=jj-48 !Numbers - if(jj.ge.65 .and. jj.le.90) j=jj-55 !Letters - if(jj.eq.47) j=36 !Slash (/) - if(jj.eq.32) j=37 !Word space - j=j+1 - -! Insert this character - nmax=ic(21,j) - if (n + nmax + 4 .gt. size (idat)) exit - do i=1,nmax - n=n+1 - idat(n)=ic(i,j) - enddo - -! Insert character space of 2 dit lengths: - n=n+1 - idat(n)=0 - n=n+1 - idat(n)=0 - enddo - -! Insert word space at end of message - do j=1,4 - n=n+1 - idat(n)=0 - enddo - - return -end subroutine morse diff --git a/lib/decode_completion.f90 b/lib/decode_completion.f90 new file mode 100644 index 00000000..da96872c --- /dev/null +++ b/lib/decode_completion.f90 @@ -0,0 +1,90 @@ +module decode_completion_module + use iso_fortran_env, only: int64 + use decoder_ipc_atomic, only: decoder_ipc_progress_report + implicit none + + private + public :: decode_completion_result + public :: reset_decode_completion + public :: set_decode_completion + public :: write_decode_completion + public :: write_decode_progress + + type :: decode_completion_result + logical :: available = .false. + integer :: synchronized = 0 + integer :: decoded = 0 + integer :: average = 0 + end type decode_completion_result + + integer, save :: progress_thread_generation = 0 + integer, save :: progress_thread_calls = 0 + integer(int64), save :: progress_thread_count = 0_int64 + integer(int64), save :: progress_thread_rate = 0_int64 +!$omp threadprivate(progress_thread_generation, progress_thread_calls, & +!$omp& progress_thread_count, progress_thread_rate) + +contains + + subroutine reset_decode_completion(completion) + type(decode_completion_result), intent(out) :: completion + + completion%available = .false. + completion%synchronized = 0 + completion%decoded = 0 + completion%average = 0 + end subroutine reset_decode_completion + + subroutine set_decode_completion(completion, synchronized, decoded, average) + type(decode_completion_result), intent(out) :: completion + integer, intent(in) :: synchronized, decoded, average + + completion%available = .true. + completion%synchronized = synchronized + completion%decoded = decoded + completion%average = average + end subroutine set_decode_completion + + subroutine write_decode_completion(completion, generation) + type(decode_completion_result), intent(in) :: completion + integer, intent(in), optional :: generation + + if (.not. completion%available) return + if (present(generation)) then + write(*,1001) completion%synchronized, completion%decoded, & + completion%average, generation +1001 format('',2i4,i9,' gen=',i0) + else + write(*,1000) completion%synchronized, completion%decoded, & + completion%average +1000 format('',2i4,i9) + end if + end subroutine write_decode_completion + + subroutine write_decode_progress(generation) + integer, intent(in) :: generation + integer(int64) :: count, count_max, elapsed, rate + + if (generation <= 0) return + if (generation == progress_thread_generation) then + progress_thread_calls = progress_thread_calls + 1 + if (progress_thread_calls < 32) return + end if + progress_thread_calls = 0 + call system_clock(count, rate, count_max) + if (generation == progress_thread_generation .and. & + rate == progress_thread_rate .and. rate > 0_int64) then + if (count >= progress_thread_count) then + elapsed = count - progress_thread_count + else + elapsed = count_max - progress_thread_count + count + 1_int64 + end if + if (elapsed < max(1_int64, rate)) return + end if + progress_thread_generation = generation + progress_thread_count = count + progress_thread_rate = rate + call decoder_ipc_progress_report(generation) + end subroutine write_decode_progress + +end module decode_completion_module diff --git a/lib/decode_echo.f90 b/lib/decode_echo.f90 index d2ebe71d..7bf30f6d 100644 --- a/lib/decode_echo.f90 +++ b/lib/decode_echo.f90 @@ -15,7 +15,7 @@ subroutine decode_echo(id2,searching,rxcall) complex c2(0:NZ) !Analytic data with shifted tone freqs character*6 rxcall !The recovered callsign real s(0:NSPS-1) !Spectrum for one received character - real p(0:NSPS-1,6) !Summed spectra for all six received characters + real, save :: p(0:NSPS-1,6)=0. !Summed spectra for six characters real a(3) character*37 c common/echocom/nclearave,nsum,blue(4096),red(4096) diff --git a/lib/decode_msk144.f90 b/lib/decode_msk144.f90 index 17110cf4..513cc342 100644 --- a/lib/decode_msk144.f90 +++ b/lib/decode_msk144.f90 @@ -1,4 +1,8 @@ -subroutine decode_msk144(audio_samples, params, data_dir) +subroutine decode_msk144_core(audio_samples, params, data_dir, completion) + use streaming_emit, only: streaming_emit_enabled, & + streaming_emit_decode + use decode_completion_module, only: decode_completion_result, & + reset_decode_completion, set_decode_completion include 'jt9com.f90' ! constants @@ -11,6 +15,7 @@ subroutine decode_msk144(audio_samples, params, data_dir) integer*2 audio_samples(NMAX) type(params_block) :: params character(len = 500) :: data_dir + type(decode_completion_result), intent(out) :: completion ! parameters of mskrtd integer*2 :: buffer(BLOCK_SIZE) @@ -26,7 +31,10 @@ subroutine decode_msk144(audio_samples, params, data_dir) ! local variables integer :: sample_count integer :: position - integer :: message_count = 0 + integer :: message_count + + call reset_decode_completion(completion) + message_count = 0 ! decode in 0.3s blocks @@ -43,15 +51,60 @@ subroutine decode_msk144(audio_samples, params, data_dir) if (line(1:1) .ne. char(0)) then line = line(1:index(line, char(0))-1) - write(*, 1001) line + if (streaming_emit_enabled()) then + call emit_msk144_line(line) + else + write(*, 1001) line + end if 1001 format(a80) message_count = message_count + 1; end if end do - if (.not. params%ndiskdat) then - write(*, 1002) 0, message_count, 0 - 1002 format('', 2i4, i9) - end if + call set_decode_completion(completion, 0, message_count, 0) + +contains + + ! Parse the 80-char mskrtd line and emit it as NDJSON. mskrtd's format + ! mirrors the FT8/FT4/Q65 emit shape: + ! cols 1-6: HHMMSS (i6.6) + ! cols 7-10: snr (i4) + ! cols 11-15: dt (f5.1) + ! cols 16-20: freq (i5) + ! col 22: '&' (mode separator) + ! cols 24-60: message (a37, trimmed) + subroutine emit_msk144_line(line_in) + character(len=*), intent(in) :: line_in + integer :: nutc_l, snr_l, freq_l, ios_l + real :: dt_l + character(len=37) :: msg_l + read(line_in, '(i6,i4,f5.1,i5,1x,1x,1x,a37)', & + iostat=ios_l) nutc_l, snr_l, dt_l, freq_l, msg_l + if (ios_l /= 0) return ! parse failure: silently drop + call streaming_emit_decode("MSK144", nutc_l, snr_l, dt_l, freq_l, & + adjustl(msg_l)) + end subroutine emit_msk144_line + +end subroutine decode_msk144_core + +subroutine decode_msk144(audio_samples, params, data_dir) + use streaming_emit, only: streaming_emit_enabled, & + streaming_emit_decode_finished + use decode_completion_module, only: decode_completion_result, & + write_decode_completion -end subroutine decode_msk144 \ No newline at end of file + include 'jt9com.f90' + + integer*2 audio_samples(NMAX) + type(params_block) :: params + character(len = 500) :: data_dir + type(decode_completion_result) :: completion + + call decode_msk144_core(audio_samples, params, data_dir, completion) + if (streaming_emit_enabled()) then + call streaming_emit_decode_finished(params%nutc) + else if (.not. params%ndiskdat) then + call write_decode_completion(completion) + call flush(6) + end if +end subroutine decode_msk144 diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 4dbb0515..d588ffa5 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -1,4 +1,4 @@ -subroutine multimode_decoder(ss,id2,params,nfsample) +subroutine multimode_decoder_core(ss,id2,params,nfsample,completion,progress_generation) !$ use omp_lib use prog_args @@ -7,10 +7,23 @@ subroutine multimode_decoder(ss,id2,params,nfsample) use jt65_decode use jt9_decode use ft8_decode + use ft8_decode_ranges, only: max_ft8_decode_ranges, partition_ft8_decode_range + use ft8_mtd_residual, only: mtd_prepare,mtd_finish,mtd_worker_residual, & + mtd_worker_spectrum use ft8_decodevar use ft4_decode use fst4_decode use q65_decode + use decoder_callbacks, only: decoder_callback_context, & + counting_jt4_decoder, counting_jt65_decoder, counting_jt9_decoder, & + counting_ft8_decoder, counting_ft8_decodervar, counting_ft4_decoder, & + counting_fst4_decoder, counting_q65_decoder, ft8_decodedvar, & + ft8_decoded, ft4_decoded, fst4_decoded, q65_decoded, jt4_decoded, & + jt4_average, jt65_decoded, jt9_decoded + use streaming_emit, only: streaming_emit_enabled, & + streaming_emit_decode + use decode_completion_module, only: decode_completion_result, & + reset_decode_completion, set_decode_completion, write_decode_progress !ft8md added 3 uses below use ft8_mod1, only : ndecodes,allmessages,allsnrs,allfreq,mycall12_0, & @@ -18,55 +31,41 @@ subroutine multimode_decoder(ss,id2,params,nfsample) lqsomsgdcd,mycalllen1,msgroot,msgrootlen,lapmyc,sumxdtt,avexdt, & nfawide,nfbwide,mycall,hiscall,lhound,mybcall,hisbcall,lenabledxcsearch, & lwidedxcsearch,hisgrid4,lmultinst,dd8,nft8cycles,lskiptx1,ncandallthr, & - nincallthr,incall,msgincall,xdtincall,maskincallthr,ltxing,hisgrid - - use packjt77, only : lcommonft8b,ihash22var,calls12var,calls22var + nincallthr,incall,msgincall,xdtincall,maskincallthr,ltxing,hisgrid, & + lastrxmsg,lasthcall include 'jt9com.f90' - type, extends(jt4_decoder) :: counting_jt4_decoder - integer :: decoded - end type counting_jt4_decoder - - type, extends(jt65_decoder) :: counting_jt65_decoder - integer :: decoded - end type counting_jt65_decoder - - type, extends(jt9_decoder) :: counting_jt9_decoder - integer :: decoded - end type counting_jt9_decoder - - type, extends(ft8_decoder) :: counting_ft8_decoder - integer :: decoded - end type counting_ft8_decoder - - type, extends(ft8_decodervar) :: counting_ft8_decodervar - integer :: decodedvar - real :: xdtt(200) - end type counting_ft8_decodervar - - type, extends(ft4_decoder) :: counting_ft4_decoder - integer :: decoded - end type counting_ft4_decoder - - type, extends(fst4_decoder) :: counting_fst4_decoder - integer :: decoded - end type counting_fst4_decoder - - type, extends(q65_decoder) :: counting_q65_decoder - integer :: decoded - end type counting_q65_decoder + interface + subroutine wsjt_tsan_acquire_decoder_section_primary() bind(C) + end subroutine wsjt_tsan_acquire_decoder_section_primary + subroutine wsjt_tsan_release_decoder_section_primary() bind(C) + end subroutine wsjt_tsan_release_decoder_section_primary + subroutine wsjt_tsan_acquire_decoder_section_secondary() bind(C) + end subroutine wsjt_tsan_acquire_decoder_section_secondary + subroutine wsjt_tsan_release_decoder_section_secondary() bind(C) + end subroutine wsjt_tsan_release_decoder_section_secondary + end interface logical first,firstsd !ft8md logical(1) lhoundprev !ft8md integer nutc,ndelay + integer :: ft8_range_low(max_ft8_decode_ranges) + integer :: ft8_range_high(max_ft8_decode_ranges) + integer :: ft8_range_count + integer :: requested_threads + integer :: nthr + integer, intent(in) :: progress_generation + integer :: active_progress_generation type(params_block) :: params + type(decode_completion_result), intent(out) :: completion + type(decoder_callback_context) :: callback_context data ndelay/0/ data first/.true./ !ft8md data firstsd/.true./ !ft8md data lhoundprev/.false./ !ft8md real ss(184,NSMAX) - logical baddata,newdat65,newdat9,single_decode,bVHF,bad0,newdat,ex + logical baddata,newdat65,newdat9,single_decode,bVHF,q65_pileup,bad0,newdat,ex logical lprinthash22 integer*2 id2(NTMAX*12000) integer nqf(20) @@ -75,7 +74,6 @@ subroutine multimode_decoder(ss,id2,params,nfsample) !character(len=12) :: mycall, hiscall !ft8md character(len=6) :: mygrid!, hisgrid !ft8md character*60 line - character*37 msg37 data ndec8/0/,ntr0/-1/ save type(counting_jt4_decoder) :: my_jt4 @@ -87,6 +85,22 @@ subroutine multimode_decoder(ss,id2,params,nfsample) type(counting_fst4_decoder) :: my_fst4 type(counting_q65_decoder) :: my_q65 + call reset_decode_completion(completion) + active_progress_generation=progress_generation + + my_jt4%decoded = 0 + my_jt65%decoded = 0 + my_jt9%decoded = 0 + my_ft8%decoded = 0 + my_ft8var%decodedvar = 0 + my_ft8var%callback => ft8_decodedvar !Set once in serial init; avoids racing writes in decodevar + my_ft4%decoded = 0 + my_fst4%decoded = 0 + my_q65%decoded = 0 + my_ft8var%xdtt=0. + nsynced=0 + navg0=0 + if(.not.params%newdat .and. params%ntr.gt.ntr0) go to 800 ntr0=params%ntr rms=sqrt(dot_product(float(id2(1:180000)),float(id2(1:180000)))/180000.0) @@ -102,17 +116,6 @@ subroutine multimode_decoder(ss,id2,params,nfsample) hisgrid=transfer(params%hisgrid,hisgrid) hisgrid4=hisgrid(1:4) -! Initialize decode counts - my_jt4%decoded = 0 - my_jt65%decoded = 0 - my_jt9%decoded = 0 - my_ft8%decoded = 0 - my_ft8var%decodedvar = 0 - my_ft4%decoded = 0 - my_fst4%decoded = 0 - my_q65%decoded = 0 - my_ft8var%xdtt=0. - ncandall=0 !ft8md ncandallthr=0 !ft8md @@ -137,6 +140,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample) ncontest=iand(params%nexp_decode,7) single_decode=iand(params%nexp_decode,32).ne.0 bVHF=iand(params%nexp_decode,64).ne.0 + q65_pileup=iand(params%nexp_decode,128).ne.0 ! bit 7 is reserved for Q65 Pileup if(mod(params%nranera,2).eq.0) ntrials=10**(params%nranera/2) if(mod(params%nranera,2).eq.1) ntrials=3*10**(params%nranera/2) if(params%nranera.eq.0) ntrials=0 @@ -156,6 +160,22 @@ subroutine multimode_decoder(ss,id2,params,nfsample) endif endif + callback_context%nutc = params%nutc + callback_context%nfqso = params%nfqso + callback_context%ncontest = ncontest + callback_context%ios13 = ios13 + callback_context%bVHF = bVHF + callback_context%b_superfox = params%b_superfox + callback_context%mycall = mycall + my_jt4%context = callback_context + my_jt65%context = callback_context + my_jt9%context = callback_context + my_ft8%context = callback_context + my_ft8var%context = callback_context + my_ft4%context = callback_context + my_fst4%context = callback_context + my_q65%context = callback_context + if(params%nmode.eq.8) then ! We're in FT8 mode if(ncontest.eq.6) then !Fox=6, Hound=7 @@ -179,6 +199,10 @@ subroutine multimode_decoder(ss,id2,params,nfsample) call sfrx_sub(params%yymmdd,params%nutc,params%nfqso,params%ntol,id2) else call timer('decft8 ',0) + if(params%nfa.gt.params%nfb) then + call timer('decft8 ',1) + go to 800 + endif newdat=params%newdat if(params%emedelay.ne.0.0) then id2(1:156000)=id2(24001:180000) ! Drop the first 2 seconds of data @@ -189,9 +213,6 @@ subroutine multimode_decoder(ss,id2,params,nfsample) if(params%lmultift8 .and. params%nmode.eq.8) then if(params%lmodechanged) then avexdt=0. - ihash22var=-1 - calls22var='' - calls12var='' nintcount=3 endif ! avexdt fast track in FT8 after mode change @@ -228,7 +249,6 @@ subroutine multimode_decoder(ss,id2,params,nfsample) msgroot='' msgroot=trim(mycall)//' '//trim(hiscall)//' ' msgrootlen=len_trim(msgroot) - lcommonft8b=params%lcommonft8b lhound=params%lhound nft8cycles=params%nft8cycles forcedt=0. @@ -253,7 +273,8 @@ subroutine multimode_decoder(ss,id2,params,nfsample) allmessages="" allsnrs=0 allfreq=0. - numcores=omp_get_num_procs() + numcores=1 +!$ numcores=omp_get_num_procs() nuserthr=params%nmt numthreads=1 ! fallback @@ -278,8 +299,8 @@ subroutine multimode_decoder(ss,id2,params,nfsample) endif endif - call omp_set_dynamic(.false.) - call omp_set_nested(.true.) +!$ call omp_set_dynamic(.false.) +!$ call omp_set_max_active_levels(omp_get_supported_active_levels()) nfa=params%nfa nfb=params%nfb @@ -299,6 +320,15 @@ subroutine multimode_decoder(ss,id2,params,nfsample) ! To do: withdraw limitation when threads are in sync at main passes? endif + call partition_ft8_decode_range(nfa,nfb,numthreads,ft8_range_low, & + ft8_range_high,ft8_range_count) + if(ft8_range_count.eq.0) then + call timer('decft8 ',1) + go to 800 + endif + numthreads=ft8_range_count + requested_threads=numthreads + nsec=mod(nutc,100) nmsg=0 if(nsec.ne.0 .and. nsec.ne.15 .and. nsec.ne.30 .and. nsec.ne.45) then @@ -336,729 +366,47 @@ subroutine multimode_decoder(ss,id2,params,nfsample) nFT8decd=0 sumxdt=0.0 if(params%nmode.eq.4) sumxdtt=0.0 - call fillhashvar(numthreads,.false.) - call ft8apsetvar(params%lmycallstd,params%lhiscallstd,numthreads) - - if(numthreads.eq.1) then - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress, & - nfqso,params%nft8rxfsens,params%nftx,nutc,nfa,nfb, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 1,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) - endif - - if(numthreads.eq.2) then - nfmid=nfa+nint(abs(nfb-nfa)/2.) - if((nfmid+1).gt.nfb) nfmid=nfb-1 - -!$omp parallel sections num_threads(2) shared(dd8,nmsg,even,odd,lqsomsgdcd), & -!$omp& shared(first_osd,gen,ndecodes,allmessages,allsnrs,allfreq) if(.true.) !iif() needed on Mac - -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfa,nfmid, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 1,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid+1,nfb, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 2,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp end parallel sections - endif - if(numthreads.eq.3) then - nfdelta=nint(abs(nfb-nfa)/3.) - nfmid1=nfa+nfdelta - nfmid2=nfmid1+nfdelta - if((nfmid2+1).gt.nfb) nfmid2=nfb-1 -!$omp parallel sections num_threads(3) shared(dd8,nmsg,even,odd,lqsomsgdcd), & -!$omp& shared(first_osd,gen,ndecodes,allmessages,allsnrs,allfreq) if(.true.) !iif() needed on Mac - -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfa,nfmid1, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 1,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid1+1,nfmid2, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 2,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid2+1,nfb, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 3,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp end parallel sections + if(hiscall.eq.'') then + lastrxmsg(1)%lstate=.false. + else if(lastrxmsg(1)%lstate .and. lasthcall.ne.hiscall .and. & + index(lastrxmsg(1)%lastmsg,trim(hiscall)).le.0) then + lastrxmsg(1)%lstate=.false. endif - if(numthreads.eq.4) then - nfdelta=nint(abs(nfb-nfa)/4.) - nfmid1=nfa+nfdelta - nfmid2=nfmid1+nfdelta - nfmid3=nfmid2+nfdelta - if((nfmid3+1).gt.nfb) nfmid3=nfb-1 - -!$omp parallel sections num_threads(4) shared(dd8,nmsg,even,odd,lqsomsgdcd), & -!$omp& shared(first_osd,gen,ndecodes,allmessages,allsnrs,allfreq) if(.true.) !iif() needed on Mac - -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid1+1,nfmid2, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 2,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid2+1,nfmid3, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 3,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfa,nfmid1, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 1,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid3+1,nfb, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 4,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp end parallel sections - endif - - if(numthreads.eq.5) then - nfdelta=nint(abs(nfb-nfa)/5.) - nfmid1=nfa+nfdelta - nfmid2=nfmid1+nfdelta - nfmid3=nfmid2+nfdelta - nfmid4=nfmid3+nfdelta - if((nfmid4+1).gt.nfb) nfmid4=nfb-1 - -!$omp parallel sections num_threads(5) shared(dd8,nmsg,even,odd,lqsomsgdcd), & -!$omp& shared(first_osd,gen,ndecodes,allmessages,allsnrs,allfreq) if(.true.) !iif() needed on Mac - -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid2+1,nfmid3, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 3,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid1+1,nfmid2, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 2,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid3+1,nfmid4, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 4,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfa,nfmid1, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 1,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid4+1,nfb, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 5,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp end parallel sections - endif - - if(numthreads.eq.6) then - nfdelta=nint(abs(nfb-nfa)/6.) - nfmid1=nfa+nfdelta - nfmid2=nfmid1+nfdelta - nfmid3=nfmid2+nfdelta - nfmid4=nfmid3+nfdelta - nfmid5=nfmid4+nfdelta - if((nfmid5+1).gt.nfb) nfmid5=nfb-1 - -!$omp parallel sections num_threads(6) shared(dd8,nmsg,even,odd,lqsomsgdcd), & -!$omp& shared(first_osd,gen,ndecodes,allmessages,allsnrs,allfreq) if(.true.) !iif() needed on Mac - -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid2+1,nfmid3, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 3,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid3+1,nfmid4, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 4,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid1+1,nfmid2, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 2,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid4+1,nfmid5, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 5,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfa,nfmid1, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 1,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid5+1,nfb, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 6,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp end parallel sections - endif - - if(numthreads.eq.7) then - nfdelta=nint(abs(nfb-nfa)/7.) - nfmid1=nfa+nfdelta - nfmid2=nfmid1+nfdelta - nfmid3=nfmid2+nfdelta - nfmid4=nfmid3+nfdelta - nfmid5=nfmid4+nfdelta - nfmid6=nfmid5+nfdelta - if((nfmid6+1).gt.nfb) nfmid6=nfb-1 - -!$omp parallel sections num_threads(7) shared(dd8,nmsg,even,odd,lqsomsgdcd), & -!$omp& shared(first_osd,gen,ndecodes,allmessages,allsnrs,allfreq) if(.true.) !iif() needed on Mac - -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid3+1,nfmid4, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 4,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid2+1,nfmid3, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 3,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid4+1,nfmid5, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 5,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid1+1,nfmid2, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 2,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid5+1,nfmid6, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 6,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfa,nfmid1, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 1,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid6+1,nfb, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 7,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp end parallel sections - endif - - if(numthreads.eq.8) then - nfdelta=nint(abs(nfb-nfa)/8.) - nfmid1=nfa+nfdelta - nfmid2=nfmid1+nfdelta - nfmid3=nfmid2+nfdelta - nfmid4=nfmid3+nfdelta - nfmid5=nfmid4+nfdelta - nfmid6=nfmid5+nfdelta - nfmid7=nfmid6+nfdelta - if((nfmid7+1).gt.nfb) nfmid7=nfb-1 - -!$omp parallel sections num_threads(8) shared(dd8,nmsg,even,odd,lqsomsgdcd), & -!$omp& shared(first_osd,gen,ndecodes,allmessages,allsnrs,allfreq) if(.true.) !iif() needed on Mac - -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid3+1,nfmid4, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 4,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid4+1,nfmid5, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 5,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid2+1,nfmid3, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 3,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid5+1,nfmid6, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 6,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid1+1,nfmid2, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 2,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid6+1,nfmid7, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 7,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfa,nfmid1, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 1,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid7+1,nfb, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 8,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp end parallel sections - endif - - if(numthreads.eq.9) then - nfdelta=nint(abs(nfb-nfa)/9.) - nfmid1=nfa+nfdelta - nfmid2=nfmid1+nfdelta - nfmid3=nfmid2+nfdelta - nfmid4=nfmid3+nfdelta - nfmid5=nfmid4+nfdelta - nfmid6=nfmid5+nfdelta - nfmid7=nfmid6+nfdelta - nfmid8=nfmid7+nfdelta - if((nfmid8+1).gt.nfb) nfmid8=nfb-1 - -!$omp parallel sections num_threads(9) shared(dd8,nmsg,even,odd,lqsomsgdcd), & -!$omp& shared(first_osd,gen,ndecodes,allmessages,allsnrs,allfreq) if(.true.) !iif() needed on Mac - -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid4+1,nfmid5, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 5,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid3+1,nfmid4, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 4,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid5+1,nfmid6, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 6,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid2+1,nfmid3, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 3,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid6+1,nfmid7, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 7,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid1+1,nfmid2, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 2,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid7+1,nfmid8, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 8,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfa,nfmid1, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 1,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid8+1,nfb, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 9,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp end parallel sections - endif - - if(numthreads.eq.10) then - nfdelta=nint(abs(nfb-nfa)/10.) - nfmid1=nfa+nfdelta - nfmid2=nfmid1+nfdelta - nfmid3=nfmid2+nfdelta - nfmid4=nfmid3+nfdelta - nfmid5=nfmid4+nfdelta - nfmid6=nfmid5+nfdelta - nfmid7=nfmid6+nfdelta - nfmid8=nfmid7+nfdelta - nfmid9=nfmid8+nfdelta - if((nfmid9+1).gt.nfb) nfmid9=nfb-1 - -!$omp parallel sections num_threads(10) shared(dd8,nmsg,even,odd,lqsomsgdcd), & -!$omp& shared(first_osd,gen,ndecodes,allmessages,allsnrs,allfreq) if(.true.) !iif() needed on Mac - -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid4+1,nfmid5, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 5,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid5+1,nfmid6, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 6,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid3+1,nfmid4, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 4,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid6+1,nfmid7, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 7,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid2+1,nfmid3, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 3,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid7+1,nfmid8, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 8,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid1+1,nfmid2, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 2,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid8+1,nfmid9, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 9,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfa,nfmid1, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 1,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid9+1,nfb, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 10,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp end parallel sections - endif - - if(numthreads.eq.11) then - nfdelta=nint(abs(nfb-nfa)/11.) - nfmid1=nfa+nfdelta - nfmid2=nfmid1+nfdelta - nfmid3=nfmid2+nfdelta - nfmid4=nfmid3+nfdelta - nfmid5=nfmid4+nfdelta - nfmid6=nfmid5+nfdelta - nfmid7=nfmid6+nfdelta - nfmid8=nfmid7+nfdelta - nfmid9=nfmid8+nfdelta - nfmid10=nfmid9+nfdelt - if((nfmid10+1).gt.nfb) nfmid10=nfb-1 -!$omp parallel sections num_threads(11) shared(dd8,nmsg,even,odd,lqsomsgdcd), & -!$omp& shared(first_osd,gen,ndecodes,allmessages,allsnrs,allfreq) if(.true.) !iif() needed on Mac - -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid5+1,nfmid6, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 6,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid4+1,nfmid5, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 5,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid6+1,nfmid7, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 7,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid3+1,nfmid4, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 4,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid7+1,nfmid8, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 8,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid2+1,nfmid3, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 3,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid8+1,nfmid9, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 9,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid1+1,nfmid2, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 2,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid9+1,nfmid10, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 10,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfa,nfmid1, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 1,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid10+1,nfb, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 11,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp end parallel sections - endif - - if(numthreads.eq.12) then - nfdelta=nint(abs(nfb-nfa)/12.) - nfmid1=nfa+nfdelta - nfmid2=nfmid1+nfdelta - nfmid3=nfmid2+nfdelta - nfmid4=nfmid3+nfdelta - nfmid5=nfmid4+nfdelta - nfmid6=nfmid5+nfdelta - nfmid7=nfmid6+nfdelta - nfmid8=nfmid7+nfdelta - nfmid9=nfmid8+nfdelta - nfmid10=nfmid9+nfdelta - nfmid11=nfmid10+nfdelt - if((nfmid11+1).gt.nfb) nfmid11=nfb-1 -!$omp parallel sections num_threads(12) shared(dd8,nmsg,even,odd,lqsomsgdcd), & -!$omp& shared(first_osd,gen,ndecodes,allmessages,allsnrs,allfreq) if(.true.) !iif() needed on Mac +!$omp parallel num_threads(requested_threads) private(nthr) shared(numthreads) +!$omp single + numthreads=1 +!$ numthreads=omp_get_num_threads() +! Reduced teams cover wider frequency slices, so fixed per-worker candidate limits can lower crowded-band yield. + call partition_ft8_decode_range(nfa,nfb,numthreads,ft8_range_low, & + ft8_range_high,ft8_range_count) + numthreads=ft8_range_count + call mtd_prepare(dd8,numthreads) + call fillhashvar(numthreads,.false.) + call ft8apsetvar(params%lmycallstd,params%lhiscallstd,numthreads) +!$omp end single + + nthr=1 +!$ nthr=omp_get_thread_num()+1 + call my_ft8var%decodevar(params%nQSOProgress,nfqso, & + params%nft8rxfsens,params%nftx,ft8_range_low(nthr), & + ft8_range_high(nthr),params%ncandthin,params%ndtcenter,nsec, & + params%napwid,params%lmycallstd,params%lhiscallstd, & + params%nstophint,nthr,numthreads,logical(params%nagainfil), & + params%lft8lowth,params%lft8subpass,params%lhideft8dupes, & + active_progress_generation, & + mtd_worker_residual(:,nthr), & + mtd_worker_spectrum(:,nthr)) +!$omp end parallel + + call write_decode_progress(active_progress_generation) + call mtd_finish(dd8) + + call write_decode_progress(active_progress_generation) + call run_ft8_mtd_a8_decode() + call write_decode_progress(active_progress_generation) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid5+1,nfmid6, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 6,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid6+1,nfmid7, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 7,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid4+1,nfmid5, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 5,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid7+1,nfmid8, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 8,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid3+1,nfmid4, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 4,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid8+1,nfmid9, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 9,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid2+1,nfmid3, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 3,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid9+1,nfmid10, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 10,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid1+1,nfmid2, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 2,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid10+1,nfmid11, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 11,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfa,nfmid1, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 1,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp section - call my_ft8var%decodevar(ft8_decodedvar,params%nQSOProgress,nfqso, & - params%nft8rxfsens,params%nftx,nutc,nfmid11+1,nfb, & - params%ncandthin,params%ndtcenter,nsec,params%napwid, & - params%lmycallstd,params%lhiscallstd,params%nstophint, & - 12,numthreads,logical(params%nagainfil),params%lft8lowth, & - params%lft8subpass,params%lhideft8dupes,params%lft8apon,ncontest) -!$omp end parallel sections - endif - do i=1,numthreads do m=1,nincallthr(i) nindex=maskincallthr(i)+m @@ -1131,6 +479,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample) if(nFT8decd.gt.10 .and. nintcount.eq.1) avexdt=sumxdt/nFT8decd ! fast track after Sync or mode change on crowded bands call fillhashvar(numthreads,.true.) + call write_decode_progress(active_progress_generation) ncandall=sum(ncandallthr(1:numthreads)) if(nFT8decd.eq.0) avexdt=0. ! reset to let correct sliding in decoder call timer('decft8 ',1) @@ -1208,7 +557,8 @@ subroutine multimode_decoder(ss,id2,params,nfsample) params%nfa,params%nfb,logical(params%nclearave), & single_decode,logical(params%nagain),params%max_drift, & logical(params%newdat),params%emedelay,mycall,hiscall,hisgrid, & - params%nQSOProgress,ncontest,logical(params%lapcqonly),navg0,nqf) + params%nQSOProgress,ncontest,q65_pileup,logical(params%lapcqonly), & + navg0,nqf) params%nclearave=.false. if(.not.params%nagain) then @@ -1225,8 +575,8 @@ subroutine multimode_decoder(ss,id2,params,nfsample) params%nfa,params%nfb,logical(params%nclearave), & .true.,.true.,params%max_drift, & .false.,params%emedelay,mycall,hiscall,hisgrid, & - params%nQSOProgress,ncontest,logical(params%lapcqonly), & - navg0,nqf) + params%nQSOProgress,ncontest,q65_pileup, & + logical(params%lapcqonly),navg0,nqf) enddo endif @@ -1319,11 +669,14 @@ subroutine multimode_decoder(ss,id2,params,nfsample) newdat65=params%newdat newdat9=params%newdat - call omp_set_dynamic(.true.) +!$ call omp_set_dynamic(.true.) + call wsjt_tsan_release_decoder_section_primary() + call wsjt_tsan_release_decoder_section_secondary() !$omp parallel sections num_threads(2) shared(ndecoded) if(.true.) !iif() needed on Mac !$omp section + call wsjt_tsan_acquire_decoder_section_primary() if(params%nmode.eq.65) then ! We're in JT65 mode if(newdat65) dd(1:npts65)=id2(1:npts65) nf1=params%nfa @@ -1348,8 +701,10 @@ subroutine multimode_decoder(ss,id2,params,nfsample) params%nmode,params%nsubmode,params%nexp_decode) call timer('decjt9 ',1) endif + call wsjt_tsan_release_decoder_section_primary() !$omp section + call wsjt_tsan_acquire_decoder_section_secondary() if(params%nmode.eq.(65+9)) then !Do the other mode (we're in dual mode) if (params%ntxmode.eq.9) then if(newdat65) dd(1:npts65)=id2(1:npts65) @@ -1373,8 +728,11 @@ subroutine multimode_decoder(ss,id2,params,nfsample) call timer('decjt9 ',1) end if endif + call wsjt_tsan_release_decoder_section_secondary() !$omp end parallel sections + call wsjt_tsan_acquire_decoder_section_primary() + call wsjt_tsan_acquire_decoder_section_secondary() ! JT65 is not yet producing info for nsynced, ndecoded. @@ -1400,9 +758,8 @@ subroutine multimode_decoder(ss,id2,params,nfsample) if(params%nmode.ne.8 .or. params%nzhsym.eq.50 .or. & (params%lmultift8 .and. params%nmode.eq.8 .and. params%nzhsym.gt.45) .or. & .not.params%ndiskdat) then !ft8md - if(.not.lquiet) write(*,1010) nsynced,ndecoded,navg0 -1010 format('',2i4,i9) - call flush(6) + call set_decode_completion(completion,nsynced,ndecoded,navg0) + call write_decode_progress(active_progress_generation) endif close(13) if(ncontest.eq.6) close(19) @@ -1411,545 +768,62 @@ subroutine multimode_decoder(ss,id2,params,nfsample) contains - subroutine jt4_decoded(this,snr,dt,freq,have_sync,sync,is_deep, & - decoded0,qual,ich,is_average,ave) - implicit none - class(jt4_decoder), intent(inout) :: this - integer, intent(in) :: snr - real, intent(in) :: dt - integer, intent(in) :: freq - logical, intent(in) :: have_sync - logical, intent(in) :: is_deep - character(len=1), intent(in) :: sync - character(len=22), intent(in) :: decoded0 - real, intent(in) :: qual - integer, intent(in) :: ich - logical, intent(in) :: is_average - integer, intent(in) :: ave - - character*22 decoded - character*3 cflags - - if(ich.eq.-99) stop !Silence compiler warning - if (have_sync) then - decoded=decoded0 - cflags=' ' - if(decoded.ne.' ') then - cflags='f ' - if(is_deep) then - cflags='d ' - write(cflags(2:2),'(i1)') min(int(qual),9) - if(qual.ge.10.0) cflags(2:2)='*' - if(qual.lt.3.0) decoded(22:22)='?' - endif - if(is_average) then - write(cflags(3:3),'(i1)') min(ave,9) - if(ave.ge.10) cflags(3:3)='*' - if(cflags(1:1).eq.'f') cflags=cflags(1:1)//cflags(3:3)//' ' - endif - endif - write(*,1000) params%nutc,snr,dt,freq,sync,decoded,cflags -1000 format(i4.4,i4,f5.1,i5,1x,'$',a1,1x,a22,1x,a3) - else - write(*,1000) params%nutc,snr,dt,freq - end if - - select type(this) - type is (counting_jt4_decoder) - this%decoded = this%decoded + 1 - end select - end subroutine jt4_decoded - - subroutine jt4_average (this, used, utc, sync, dt, freq, flip) - implicit none - class(jt4_decoder), intent(inout) :: this - logical, intent(in) :: used - integer, intent(in) :: utc - real, intent(in) :: sync - real, intent(in) :: dt - integer, intent(in) :: freq - logical, intent(in) :: flip - character(len=1) :: cused, csync - - cused = '.' - csync = '*' - if (used) cused = '$' - if (flip) csync = '$' - write(14,1000) cused,utc,sync,dt,freq,csync -1000 format(a1,i5.4,f6.1,f6.2,i6,1x,a1) - end subroutine jt4_average - - subroutine jt65_decoded(this,sync,snr,dt,freq,drift,nflip,width, & - decoded0,ft,qual,nsmo,nsum,minsync) - - use jt65_decode - implicit none - - class(jt65_decoder), intent(inout) :: this - real, intent(in) :: sync - integer, intent(in) :: snr - real, intent(in) :: dt - integer, intent(in) :: freq - integer, intent(in) :: drift - integer, intent(in) :: nflip - real, intent(in) :: width - character(len=22), intent(in) :: decoded0 - integer, intent(in) :: ft - integer, intent(in) :: qual - integer, intent(in) :: nsmo - integer, intent(in) :: nsum - integer, intent(in) :: minsync - - integer i,nap - logical is_deep,is_average - character decoded*22,csync*2,cflags*3 - - !$omp critical(decode_results) - decoded=decoded0 - cflags=' ' - is_deep=ft.eq.2 - - if(ft.eq.0 .and. minsync.ge.0 .and. int(sync).lt.minsync) then - write(*,1010) params%nutc,snr,dt,freq - else - is_average=nsum.ge.2 - if(bVHF .and. ft.gt.0) then - cflags='f ' - if(is_deep) then - cflags='d ' - write(cflags(2:2),'(i1)') min(qual,9) - if(qual.ge.10) cflags(2:2)='*' - if(qual.lt.3) decoded(22:22)='?' - endif - if(is_average) then - write(cflags(3:3),'(i1)') min(nsum,9) - if(nsum.ge.10) cflags(3:3)='*' - endif - nap=ishft(ft,-2) - if(nap.ne.0) then - if(nsum.lt.2) write(cflags(1:3),'(a1,i1," ")') 'a',nap - if(nsum.ge.2) write(cflags(1:3),'(a1,2i1)') 'a',nap,min(nsum,9) - endif - endif - csync='# ' - i=0 - if(bVHF .and. nflip.ne.0 .and. & - sync.ge.max(0.0,float(minsync))) then - csync='#*' - if(nflip.eq.-1) then - csync='##' - if(decoded.ne.' ') then - do i=22,1,-1 - if(decoded(i:i).ne.' ') exit - enddo - if(i.gt.18) i=18 - decoded(i+2:i+4)='OOO' - endif - endif - endif - n=len(trim(decoded)) - if(n.eq.2 .or. n.eq.3) csync='# ' - if(cflags(1:1).eq.'f') then - cflags(2:2)=cflags(3:3) - cflags(3:3)=' ' - endif - write(*,1010) params%nutc,snr,dt,freq,csync,decoded,cflags -1010 format(i4.4,i4,f5.1,i5,1x,a2,1x,a22,1x,a3) - endif - if(ios13.eq.0) write(13,1012) params%nutc,nint(sync),snr,dt, & - float(freq),drift,decoded,ft,nsum,nsmo -1012 format(i4.4,i4,i5,f6.2,f8.0,i4,3x,a22,' JT65',3i3) - call flush(6) - - !$omp end critical(decode_results) - select type(this) - type is (counting_jt65_decoder) - this%decoded = this%decoded + 1 - end select - end subroutine jt65_decoded - - subroutine jt9_decoded (this, sync, snr, dt, freq, drift, decoded) - use jt9_decode - implicit none - - class(jt9_decoder), intent(inout) :: this - real, intent(in) :: sync - integer, intent(in) :: snr - real, intent(in) :: dt - real, intent(in) :: freq - integer, intent(in) :: drift - character(len=22), intent(in) :: decoded - - !$omp critical(decode_results) - - write(*,1000) params%nutc,snr,dt,nint(freq),decoded -1000 format(i4.4,i4,f5.1,i5,1x,'@ ',1x,a22) - if(ios13.eq.0) write(13,1002) params%nutc,nint(sync),snr,dt,freq, & - drift,decoded -1002 format(i4.4,i4,i5,f6.1,f8.0,i4,3x,a22,' JT9') - call flush(6) - !$omp end critical(decode_results) - select type(this) - type is (counting_jt9_decoder) - this%decoded = this%decoded + 1 - end select - end subroutine jt9_decoded - - subroutine ft8_decodedvar (this,snr,dt,freq,decodedvar,nap,qual) !ft8md was(this,snr,dt,freq,decodedvar) - use ft8_decodevar - implicit none - - class(ft8_decodervar), intent(inout) :: this - integer, intent(in) :: snr - real, intent(in) :: dt - real, intent(in) :: freq - real, intent(in) :: qual - real fdiff - character(len=37), intent(in) :: decodedvar !ft8md was 26 - character*2 annot - character c1*12,c2*12,g2*4,w*4 - integer i1,i2,i3,i4,i5,n30,nwrap - integer, intent(in) :: nap !ft8md - integer msglen - character*37 decoded0 - logical isgrid4,first,b0,b1,b2 - data first/.true./ - save - - isgrid4(w)=(len_trim(w).eq.4 .and. & - ichar(w(1:1)).ge.ichar('A') .and. ichar(w(1:1)).le.ichar('R') .and. & - ichar(w(2:2)).ge.ichar('A') .and. ichar(w(2:2)).le.ichar('R') .and. & - ichar(w(3:3)).ge.ichar('0') .and. ichar(w(3:3)).le.ichar('9') .and. & - ichar(w(4:4)).ge.ichar('0') .and. ichar(w(4:4)).le.ichar('9')) - - if(first) then - c2fox=' ' - g2fox=' ' - nsnrfox=-99 - nfreqfox=-99 - n30z=0 - nwrap=0 - nfox=0 - first=.false. - endif - - fdiff=freq-params%nfqso - if(abs(fdiff).lt.3.0) ltry_a8=.false. - - decoded0=decodedvar - - annot=' ' - if(nap.ne.0) then - if(nap.ge.9) then - write(annot,'(a1,i1)') 'a',9 - else - write(annot,'(a1,i1)') 'a',nap - endif - if(qual.lt.0.17) decoded0(37:37)='?' - endif - - write(*,1000) params%nutc,snr,dt,nint(freq),decoded0,annot -1000 format(i6.6,i4,f5.1,i5,' ~ ',1x,a37,1x,a2) - - if(ncontest.eq.6) then - i1=index(decoded0,' ') - i2=i1 + index(decoded0(i1+1:),' ') - i3=i2 + index(decoded0(i2+1:),' ') - if(i1.ge.3 .and. i2.ge.7 .and. i3.ge.10) then - c1=decoded0(1:i1-1)//' ' - c2=decoded0(i1+1:i2-1) - g2=decoded0(i2+1:i3-1) - b0=c1.eq.mycall - if(c1(1:3).eq.'DE ' .and. index(c2,'/').ge.2) b0=.true. - if(len(trim(c1)).ne.len(trim(mycall))) then - i4=index(trim(c1),trim(mycall)) - i5=index(trim(mycall),trim(c1)) - if(i4.ge.1 .or. i5.ge.1) b0=.true. - endif - b1=i3-i2.eq.5 .and. isgrid4(g2) - b2=i3-i2.eq.1 - if(b0 .and. (b1.or.b2) .and. (nint(freq).ge.1000 .or. & - params%b_superfox)) then - n=params%nutc - n30=(3600*(n/10000) + 60*mod((n/100),100) + mod(n,100))/30 - if(n30.lt.n30z) nwrap=nwrap+2880 !New UTC day, handle the wrap - n30z=n30 - n30=n30+nwrap - if(nfox.lt.MAXFOX) nfox=nfox+1 - c2fox(nfox)=c2 - g2fox(nfox)=g2 - nsnrfox(nfox)=snr - nfreqfox(nfox)=nint(freq) - n30fox(nfox)=n30 - endif - endif - endif - call flush(6) - if(ios13.eq.0) call flush(13) - - select type(this) - type is (counting_ft8_decodervar) - this%decodedvar = this%decodedvar + 1 - this%xdtt(this%decodedvar)=dt - end select - - return - end subroutine ft8_decodedvar - - subroutine ft8_decoded (this,sync,snr,dt,freq,decoded,nap,qual) - use ft8_decode + subroutine run_ft8_mtd_a8_decode() implicit none - class(ft8_decoder), intent(inout) :: this - real, intent(in) :: sync - integer, intent(in) :: snr - real, intent(in) :: dt - real, intent(in) :: freq - character(len=37), intent(in) :: decoded - character c1*12,c2*12,g2*4,w*4 - integer i0,i1,i2,i3,i4,i5,n30,nwrap - integer, intent(in) :: nap - real, intent(in) :: qual - real fdiff - character*2 annot - character*37 decoded0 - logical isgrid4,first,b0,b1,b2 - data first/.true./ - save - - isgrid4(w)=(len_trim(w).eq.4 .and. & - ichar(w(1:1)).ge.ichar('A') .and. ichar(w(1:1)).le.ichar('R') .and. & - ichar(w(2:2)).ge.ichar('A') .and. ichar(w(2:2)).le.ichar('R') .and. & - ichar(w(3:3)).ge.ichar('0') .and. ichar(w(3:3)).le.ichar('9') .and. & - ichar(w(4:4)).ge.ichar('0') .and. ichar(w(4:4)).le.ichar('9')) - - if(first) then - c2fox=' ' - g2fox=' ' - nsnrfox=-99 - nfreqfox=-99 - n30z=0 - nwrap=0 - nfox=0 - first=.false. - endif - - decoded0=decoded - fdiff=freq-params%nfqso - if(abs(fdiff).lt.3.0) ltry_a8=.false. - - annot=' ' - if(nap.ne.0) then - write(annot,'(a1,i1)') 'a',nap - if(qual.lt.0.17) decoded0(37:37)='?' - endif - - ! i0=index(decoded0,';') - ! Always print 37 characters? Or, send i3,n3 up to here from ft8b_2 and use them - ! to decide how many chars to print? - !TEMP - i0=1 - if(i0.le.0) write(*,1000) params%nutc,snr,dt,nint(freq),decoded0(1:22),annot -1000 format(i6.6,i4,f5.1,i5,' ~ ',1x,a22,1x,a2) - if(i0.gt.0) write(*,1001) params%nutc,snr,dt,nint(freq),decoded0,annot -1001 format(i6.6,i4,f5.1,i5,' ~ ',1x,a37,1x,a2) - if(ios13.eq.0) write(13,1002) params%nutc,nint(sync),snr,dt,freq,0,decoded0 -1002 format(i6.6,i4,i5,f6.1,f8.0,i4,3x,a37,' FT8') - - if(ncontest.eq.6) then - i1=index(decoded0,' ') - i2=i1 + index(decoded0(i1+1:),' ') - i3=i2 + index(decoded0(i2+1:),' ') - if(i1.ge.3 .and. i2.ge.7 .and. i3.ge.10) then - c1=decoded0(1:i1-1)//' ' - c2=decoded0(i1+1:i2-1) - g2=decoded0(i2+1:i3-1) - b0=c1.eq.mycall - if(c1(1:3).eq.'DE ' .and. index(c2,'/').ge.2) b0=.true. - if(len(trim(c1)).ne.len(trim(mycall))) then - i4=index(trim(c1),trim(mycall)) - i5=index(trim(mycall),trim(c1)) - if(i4.ge.1 .or. i5.ge.1) b0=.true. - endif - b1=i3-i2.eq.5 .and. isgrid4(g2) - b2=i3-i2.eq.1 - if(b0 .and. (b1.or.b2) .and. (nint(freq).ge.1000 .or. & - params%b_superfox)) then - n=params%nutc - n30=(3600*(n/10000) + 60*mod((n/100),100) + mod(n,100))/30 - if(n30.lt.n30z) nwrap=nwrap+2880 !New UTC day, handle the wrap - n30z=n30 - n30=n30+nwrap - if(nfox.lt.MAXFOX) nfox=nfox+1 - c2fox(nfox)=c2 - g2fox(nfox)=g2 - nsnrfox(nfox)=snr - nfreqfox(nfox)=nint(freq) - n30fox(nfox)=n30 - endif + external ft8_a8d + real f1,xdt,fbest,xsnr,plog,qual + integer nsnr,iaptype + character(len=6) dxgrid + character(len=37) msg37 + + if(.not.params%lft8apon) return + if(ncontest.eq.6 .or. ncontest.eq.7) return + if(len(trim(hiscall)).lt.3 .or. len(trim(hisgrid4)).lt.4) return + if(.not.ltry_a8) return + + f1=nfqso + dxgrid=hisgrid4 + call timer('ft8_a8d ',0) + call ft8_a8d(dd8,mycall,hiscall,dxgrid,f1,xdt,fbest,xsnr,plog,msg37, & + active_progress_generation) + call timer('ft8_a8d ',1) + + if(msg37(1:1).ne.' ') then + if(associated(my_ft8var%callback)) then + nsnr=nint(xsnr) + iaptype=8 + qual=1.0 + if(plog.lt.-147.0) qual=0.16 + call my_ft8var%callback(nsnr,xdt,fbest,msg37,iaptype,qual) endif endif + end subroutine run_ft8_mtd_a8_decode - call flush(6) - if(ios13.eq.0) call flush(13) - - select type(this) - type is (counting_ft8_decoder) - this%decoded = this%decoded + 1 - end select - - return - end subroutine ft8_decoded - - subroutine ft4_decoded (this,sync,snr,dt,freq,decoded,nap,qual) - use ft4_decode - implicit none - - class(ft4_decoder), intent(inout) :: this - real, intent(in) :: sync - integer, intent(in) :: snr - real, intent(in) :: dt - real, intent(in) :: freq - character(len=37), intent(in) :: decoded - integer, intent(in) :: nap - real, intent(in) :: qual - character*2 annot - character*37 decoded0 - - decoded0=decoded - - annot=' ' - if(nap.ne.0) then - write(annot,'(a1,i1)') 'a',nap - if(qual.lt.0.17) decoded0(37:37)='?' - endif - - write(*,1001) params%nutc,snr,dt,nint(freq),decoded0,annot -1001 format(i6.6,i4,f5.1,i5,' + ',1x,a37,1x,a2) - if(ios13.eq.0) then - write(13,1002,err=10) params%nutc,nint(sync),snr,dt,freq,0,decoded0 -1002 format(i6.6,i4,i5,f6.1,f8.0,i4,3x,a37,' FT4') - flush(13) - endif - -10 call flush(6) - - select type(this) - type is (counting_ft4_decoder) - this%decoded = this%decoded + 1 - end select - - return - end subroutine ft4_decoded - - subroutine fst4_decoded (this,nutc,sync,nsnr,dt,freq,decoded,nap, & - qual,ntrperiod,fmid,w50) - - use fst4_decode - implicit none - - class(fst4_decoder), intent(inout) :: this - integer, intent(in) :: nutc - real, intent(in) :: sync - integer, intent(in) :: nsnr - real, intent(in) :: dt - real, intent(in) :: freq - character(len=37), intent(in) :: decoded - integer, intent(in) :: nap - real, intent(in) :: qual - integer, intent(in) :: ntrperiod - real, intent(in) :: fmid - real, intent(in) :: w50 - - character*2 annot - character*37 decoded0 - character*70 line - - decoded0=decoded - annot=' ' - if(nap.ne.0) then - write(annot,'(a1,i1)') 'a',nap - if(qual.lt.0.17) decoded0(37:37)='?' - endif - - if(ntrperiod.lt.60) then - write(line,1001) nutc,nsnr,dt,nint(freq),decoded0,annot -1001 format(i6.6,i4,f5.1,i5,' ` ',1x,a37,1x,a2) - if(ios13.eq.0) write(13,1002) nutc,nint(sync),nsnr,dt,freq,0,decoded0 -1002 format(i6.6,i4,i5,f6.1,f8.0,i4,3x,a37,' FST4') - else - write(line,1003) nutc,nsnr,dt,nint(freq),decoded0,annot -1003 format(i4.4,i4,f5.1,i5,' ` ',1x,a37,1x,a2,2f7.3) - if(ios13.eq.0) write(13,1004) nutc,nint(sync),nsnr,dt,freq,0,decoded0 -1004 format(i4.4,i4,i5,f6.1,f8.0,i4,3x,a37,' FST4') - endif - - if(fmid.ne.-999.0) then - if(w50.lt.0.95) write(line(65:70),'(f6.3)') w50 - if(w50.ge.0.95) write(line(65:70),'(f6.2)') w50 - endif - - write(*,1005) line -1005 format(a70) +end subroutine multimode_decoder_core - call flush(6) - if(ios13.eq.0) call flush(13) - - select type(this) - type is (counting_fst4_decoder) - this%decoded = this%decoded + 1 - end select - - return - end subroutine fst4_decoded - - subroutine q65_decoded (this,nutc,snr1,nsnr,dt,freq,decoded,idec, & - nused,ntrperiod) - - use q65_decode - implicit none - - class(q65_decoder), intent(inout) :: this - integer, intent(in) :: nutc - real, intent(in) :: snr1 - integer, intent(in) :: nsnr - real, intent(in) :: dt - real, intent(in) :: freq - character(len=37), intent(in) :: decoded - integer, intent(in) :: idec - integer, intent(in) :: nused - integer, intent(in) :: ntrperiod - character*3 cflags - - cflags=' ' - if(idec.ge.0) then - cflags='q ' - write(cflags(2:2),'(i1)') idec - if(nused.ge.2) write(cflags(3:3),'(i1)') nused - endif - - if(ntrperiod.lt.60) then - write(*,1001) nutc,nsnr,dt,nint(freq),decoded,cflags -1001 format(i6.6,i4,f5.1,i5,' : ',1x,a37,1x,a3) - if(ios13.eq.0) write(13,1002) nutc,nint(snr1),nsnr,dt,freq,0,decoded -1002 format(i6.6,i4,i5,f6.1,f8.0,i4,3x,a37,' Q65') - else - write(*,1003) nutc,nsnr,dt,nint(freq),decoded,cflags -1003 format(i4.4,i4,f5.1,i5,' : ',1x,a37,1x,a3) - if(ios13.eq.0) write(13,1004) nutc,nint(snr1),nsnr,dt,freq,0,decoded -1004 format(i4.4,i4,i5,f6.1,f8.0,i4,3x,a37,' Q65') +subroutine multimode_decoder(ss,id2,params,nfsample) + use prog_args, only: lquiet + use streaming_emit, only: streaming_emit_enabled, & + streaming_emit_decode_finished + use decode_completion_module, only: decode_completion_result, & + write_decode_completion - endif - call flush(6) - if(ios13.eq.0) call flush(13) + include 'jt9com.f90' - select type(this) - type is (counting_q65_decoder) - if(idec.ge.0) this%decoded = this%decoded + 1 - end select + real ss(184,NSMAX) + integer*2 id2(NTMAX*12000) + type(params_block) :: params + type(decode_completion_result) :: completion - return - end subroutine q65_decoded + call multimode_decoder_core(ss,id2,params,nfsample,completion,0) + if (.not. completion%available) return + if (streaming_emit_enabled()) then + call streaming_emit_decode_finished(params%nutc) + else if (.not. lquiet) then + call write_decode_completion(completion) + end if + call flush(6) end subroutine multimode_decoder diff --git a/lib/decoder_callbacks.f90 b/lib/decoder_callbacks.f90 new file mode 100644 index 00000000..33c2ac85 --- /dev/null +++ b/lib/decoder_callbacks.f90 @@ -0,0 +1,718 @@ +module decoder_callbacks + + use jt4_decode + use jt65_decode + use jt9_decode + use ft8_decode + use ft8_decodevar + use ft4_decode + use fst4_decode + use q65_decode + use streaming_emit, only: streaming_emit_enabled, streaming_emit_decode + + implicit none + + type :: decoder_callback_context + ! Callback state is stored on each decoder instead of captured by a nested procedure. + integer :: nutc = 0 + integer :: nfqso = 0 + integer :: ncontest = 0 + integer :: ios13 = -1 + logical :: bVHF = .false. + logical :: b_superfox = .false. + character(len=12) :: mycall = ' ' + end type decoder_callback_context + + type, extends(jt4_decoder) :: counting_jt4_decoder + type(decoder_callback_context) :: context + integer :: decoded = 0 + end type counting_jt4_decoder + + type, extends(jt65_decoder) :: counting_jt65_decoder + type(decoder_callback_context) :: context + integer :: decoded = 0 + end type counting_jt65_decoder + + type, extends(jt9_decoder) :: counting_jt9_decoder + type(decoder_callback_context) :: context + integer :: decoded = 0 + end type counting_jt9_decoder + + type, extends(ft8_decoder) :: counting_ft8_decoder + type(decoder_callback_context) :: context + integer :: decoded = 0 + end type counting_ft8_decoder + + type, extends(ft8_decodervar) :: counting_ft8_decodervar + type(decoder_callback_context) :: context + integer :: decodedvar = 0 + real :: xdtt(200) + end type counting_ft8_decodervar + + type, extends(ft4_decoder) :: counting_ft4_decoder + type(decoder_callback_context) :: context + integer :: decoded = 0 + end type counting_ft4_decoder + + type, extends(fst4_decoder) :: counting_fst4_decoder + type(decoder_callback_context) :: context + integer :: decoded = 0 + end type counting_fst4_decoder + + type, extends(q65_decoder) :: counting_q65_decoder + type(decoder_callback_context) :: context + integer :: decoded = 0 + end type counting_q65_decoder + +contains + + subroutine jt4_decoded(this,snr,dt,freq,have_sync,sync,is_deep, & + decoded0,qual,ich,is_average,ave) + implicit none + class(jt4_decoder), intent(inout) :: this + integer, intent(in) :: snr + real, intent(in) :: dt + integer, intent(in) :: freq + logical, intent(in) :: have_sync + logical, intent(in) :: is_deep + character(len=1), intent(in) :: sync + character(len=22), intent(in) :: decoded0 + real, intent(in) :: qual + integer, intent(in) :: ich + logical, intent(in) :: is_average + integer, intent(in) :: ave + + character*22 decoded + character*3 cflags + integer context_nutc + + select type (typed_this => this) + type is (counting_jt4_decoder) + context_nutc = typed_this%context%nutc + class default + return + end select + + if(ich.eq.-99) stop + if (have_sync) then + decoded=decoded0 + cflags=' ' + if(decoded.ne.' ') then + cflags='f ' + if(is_deep) then + cflags='d ' + write(cflags(2:2),'(i1)') min(int(qual),9) + if(qual.ge.10.0) cflags(2:2)='*' + if(qual.lt.3.0) decoded(22:22)='?' + endif + if(is_average) then + write(cflags(3:3),'(i1)') min(ave,9) + if(ave.ge.10) cflags(3:3)='*' + if(cflags(1:1).eq.'f') cflags=cflags(1:1)//cflags(3:3)//' ' + endif + endif + if (streaming_emit_enabled()) then + call streaming_emit_decode("JT4", context_nutc, snr, dt, freq, decoded) + else + write(*,1000) context_nutc,snr,dt,freq,sync,decoded,cflags + end if + else + if (.not. streaming_emit_enabled()) write(*,1000) context_nutc,snr,dt,freq + end if +1000 format(i4.4,i4,f5.1,i5,1x,'$',a1,1x,a22,1x,a3) + + select type (typed_this => this) + type is (counting_jt4_decoder) + typed_this%decoded = typed_this%decoded + 1 + end select + end subroutine jt4_decoded + + subroutine jt4_average (this, used, utc, sync, dt, freq, flip) + implicit none + class(jt4_decoder), intent(inout) :: this + logical, intent(in) :: used + integer, intent(in) :: utc + real, intent(in) :: sync + real, intent(in) :: dt + integer, intent(in) :: freq + logical, intent(in) :: flip + character(len=1) :: cused, csync + + cused = '.' + csync = '*' + if (used) cused = '$' + if (flip) csync = '$' + write(14,1000) cused,utc,sync,dt,freq,csync +1000 format(a1,i5.4,f6.1,f6.2,i6,1x,a1) + end subroutine jt4_average + + subroutine jt65_decoded(this,sync,snr,dt,freq,drift,nflip,width, & + decoded0,ft,qual,nsmo,nsum,minsync) + + implicit none + + class(jt65_decoder), intent(inout) :: this + real, intent(in) :: sync + integer, intent(in) :: snr + real, intent(in) :: dt + integer, intent(in) :: freq + integer, intent(in) :: drift + integer, intent(in) :: nflip + real, intent(in) :: width + character(len=22), intent(in) :: decoded0 + integer, intent(in) :: ft + integer, intent(in) :: qual + integer, intent(in) :: nsmo + integer, intent(in) :: nsum + integer, intent(in) :: minsync + + integer i,nap,n + integer context_nutc, context_ios13 + logical context_bVHF + logical is_deep,is_average + character decoded*22,csync*2,cflags*3 + + select type (typed_this => this) + type is (counting_jt65_decoder) + context_nutc = typed_this%context%nutc + context_ios13 = typed_this%context%ios13 + context_bVHF = typed_this%context%bVHF + class default + return + end select + + !$omp critical(decode_results) + decoded=decoded0 + cflags=' ' + is_deep=ft.eq.2 + + if(ft.eq.0 .and. minsync.ge.0 .and. int(sync).lt.minsync) then + if (.not. streaming_emit_enabled()) write(*,1010) context_nutc,snr,dt,freq + else + is_average=nsum.ge.2 + if(context_bVHF .and. ft.gt.0) then + cflags='f ' + if(is_deep) then + cflags='d ' + write(cflags(2:2),'(i1)') min(qual,9) + if(qual.ge.10) cflags(2:2)='*' + if(qual.lt.3) decoded(22:22)='?' + endif + if(is_average) then + write(cflags(3:3),'(i1)') min(nsum,9) + if(nsum.ge.10) cflags(3:3)='*' + endif + nap=ishft(ft,-2) + if(nap.ne.0) then + if(nsum.lt.2) write(cflags(1:3),'(a1,i1," ")') 'a',nap + if(nsum.ge.2) write(cflags(1:3),'(a1,2i1)') 'a',nap,min(nsum,9) + endif + endif + csync='# ' + i=0 + if(context_bVHF .and. nflip.ne.0 .and. & + sync.ge.max(0.0,float(minsync))) then + csync='#*' + if(nflip.eq.-1) then + csync='##' + if(decoded.ne.' ') then + do i=22,1,-1 + if(decoded(i:i).ne.' ') exit + enddo + if(i.gt.18) i=18 + decoded(i+2:i+4)='OOO' + endif + endif + endif + n=len(trim(decoded)) + if(n.eq.2 .or. n.eq.3) csync='# ' + if(cflags(1:1).eq.'f') then + cflags(2:2)=cflags(3:3) + cflags(3:3)=' ' + endif + if (streaming_emit_enabled()) then + call streaming_emit_decode("JT65", context_nutc, snr, dt, freq, decoded) + else + write(*,1010) context_nutc,snr,dt,freq,csync,decoded,cflags + end if +1010 format(i4.4,i4,f5.1,i5,1x,a2,1x,a22,1x,a3) + endif + if(context_ios13.eq.0) write(13,1012) context_nutc,nint(sync),snr,dt, & + float(freq),drift,decoded,ft,nsum,nsmo +1012 format(i4.4,i4,i5,f6.2,f8.0,i4,3x,a22,' JT65',3i3) + call flush(6) + + !$omp end critical(decode_results) + select type (typed_this => this) + type is (counting_jt65_decoder) + typed_this%decoded = typed_this%decoded + 1 + end select + end subroutine jt65_decoded + + subroutine jt9_decoded (this, sync, snr, dt, freq, drift, decoded) + implicit none + + class(jt9_decoder), intent(inout) :: this + real, intent(in) :: sync + integer, intent(in) :: snr + real, intent(in) :: dt + real, intent(in) :: freq + integer, intent(in) :: drift + character(len=22), intent(in) :: decoded + integer context_nutc, context_ios13 + + select type (typed_this => this) + type is (counting_jt9_decoder) + context_nutc = typed_this%context%nutc + context_ios13 = typed_this%context%ios13 + class default + return + end select + + !$omp critical(decode_results) + + if (streaming_emit_enabled()) then + call streaming_emit_decode("JT9", context_nutc, snr, dt, nint(freq), decoded) + else + write(*,1000) context_nutc,snr,dt,nint(freq),decoded + end if +1000 format(i4.4,i4,f5.1,i5,1x,'@ ',1x,a22) + if(context_ios13.eq.0) write(13,1002) context_nutc,nint(sync),snr,dt,freq, & + drift,decoded +1002 format(i4.4,i4,i5,f6.1,f8.0,i4,3x,a22,' JT9') + call flush(6) + !$omp end critical(decode_results) + select type (typed_this => this) + type is (counting_jt9_decoder) + typed_this%decoded = typed_this%decoded + 1 + end select + end subroutine jt9_decoded + + subroutine ft8_decodedvar (this,snr,dt,freq,decodedvar,nap,qual) + implicit none + + class(ft8_decodervar), intent(inout) :: this + integer, intent(in) :: snr + real, intent(in) :: dt + real, intent(in) :: freq + real, intent(in) :: qual + character(len=37), intent(in) :: decodedvar + integer, intent(in) :: nap + real fdiff + character*2 annot + character c1*12,c2*12,g2*4,w*4 + integer i1,i2,i3,i4,i5,n,n30,nwrap + character*37 decoded0 + logical isgrid4,first,b0,b1,b2 + integer context_nutc, context_nfqso, context_ncontest, context_ios13 + logical context_b_superfox + character(len=12) context_mycall + data first/.true./ + save :: first,nwrap + + isgrid4(w)=(len_trim(w).eq.4 .and. & + ichar(w(1:1)).ge.ichar('A') .and. ichar(w(1:1)).le.ichar('R') .and. & + ichar(w(2:2)).ge.ichar('A') .and. ichar(w(2:2)).le.ichar('R') .and. & + ichar(w(3:3)).ge.ichar('0') .and. ichar(w(3:3)).le.ichar('9') .and. & + ichar(w(4:4)).ge.ichar('0') .and. ichar(w(4:4)).le.ichar('9')) + + select type (typed_this => this) + type is (counting_ft8_decodervar) + context_nutc = typed_this%context%nutc + context_nfqso = typed_this%context%nfqso + context_ncontest = typed_this%context%ncontest + context_ios13 = typed_this%context%ios13 + context_b_superfox = typed_this%context%b_superfox + context_mycall = typed_this%context%mycall + class default + return + end select + + if(first) then + c2fox=' ' + g2fox=' ' + nsnrfox=-99 + nfreqfox=-99 + n30z=0 + nwrap=0 + nfox=0 + first=.false. + endif + + fdiff=freq-context_nfqso + if(abs(fdiff).lt.3.0) ltry_a8=.false. + + decoded0=decodedvar + + annot=' ' + if(nap.ne.0) then + if(nap.ge.9) then + write(annot,'(a1,i1)') 'a',9 + else + write(annot,'(a1,i1)') 'a',nap + endif + if(qual.lt.0.17) decoded0(37:37)='?' + endif + + if (streaming_emit_enabled()) then + call streaming_emit_decode("FT8", context_nutc, snr, dt, nint(freq), decoded0) + else + write(*,1000) context_nutc,snr,dt,nint(freq),decoded0,annot + end if +1000 format(i6.6,i4,f5.1,i5,' ~ ',1x,a37,1x,a2) + + if(context_ncontest.eq.6) then + i1=index(decoded0,' ') + i2=i1 + index(decoded0(i1+1:),' ') + i3=i2 + index(decoded0(i2+1:),' ') + if(i1.ge.3 .and. i2.ge.7 .and. i3.ge.10) then + c1=decoded0(1:i1-1)//' ' + c2=decoded0(i1+1:i2-1) + g2=decoded0(i2+1:i3-1) + b0=c1.eq.context_mycall + if(c1(1:3).eq.'DE ' .and. index(c2,'/').ge.2) b0=.true. + if(len(trim(c1)).ne.len(trim(context_mycall))) then + i4=index(trim(c1),trim(context_mycall)) + i5=index(trim(context_mycall),trim(c1)) + if(i4.ge.1 .or. i5.ge.1) b0=.true. + endif + b1=i3-i2.eq.5 .and. isgrid4(g2) + b2=i3-i2.eq.1 + if(b0 .and. (b1.or.b2) .and. (nint(freq).ge.1000 .or. & + context_b_superfox)) then + n=context_nutc + n30=(3600*(n/10000) + 60*mod((n/100),100) + mod(n,100))/30 + if(n30.lt.n30z) nwrap=nwrap+2880 + n30z=n30 + n30=n30+nwrap + if(nfox.lt.MAXFOX) nfox=nfox+1 + c2fox(nfox)=c2 + g2fox(nfox)=g2 + nsnrfox(nfox)=snr + nfreqfox(nfox)=nint(freq) + n30fox(nfox)=n30 + endif + endif + endif + call flush(6) + if(context_ios13.eq.0) call flush(13) + + select type (typed_this => this) + type is (counting_ft8_decodervar) + typed_this%decodedvar = typed_this%decodedvar + 1 + typed_this%xdtt(typed_this%decodedvar)=dt + end select + end subroutine ft8_decodedvar + + subroutine ft8_decoded (this,sync,snr,dt,freq,decoded,nap,qual) + implicit none + + class(ft8_decoder), intent(inout) :: this + real, intent(in) :: sync + integer, intent(in) :: snr + real, intent(in) :: dt + real, intent(in) :: freq + character(len=37), intent(in) :: decoded + character c1*12,c2*12,g2*4,w*4 + integer i0,i1,i2,i3,i4,i5,n,n30,nwrap + integer, intent(in) :: nap + real, intent(in) :: qual + real fdiff + character*2 annot + character*37 decoded0 + logical isgrid4,first,b0,b1,b2 + integer context_nutc, context_nfqso, context_ncontest, context_ios13 + logical context_b_superfox + character(len=12) context_mycall + data first/.true./ + save :: first,nwrap + + isgrid4(w)=(len_trim(w).eq.4 .and. & + ichar(w(1:1)).ge.ichar('A') .and. ichar(w(1:1)).le.ichar('R') .and. & + ichar(w(2:2)).ge.ichar('A') .and. ichar(w(2:2)).le.ichar('R') .and. & + ichar(w(3:3)).ge.ichar('0') .and. ichar(w(3:3)).le.ichar('9') .and. & + ichar(w(4:4)).ge.ichar('0') .and. ichar(w(4:4)).le.ichar('9')) + + select type (typed_this => this) + type is (counting_ft8_decoder) + context_nutc = typed_this%context%nutc + context_nfqso = typed_this%context%nfqso + context_ncontest = typed_this%context%ncontest + context_ios13 = typed_this%context%ios13 + context_b_superfox = typed_this%context%b_superfox + context_mycall = typed_this%context%mycall + class default + return + end select + + if(first) then + c2fox=' ' + g2fox=' ' + nsnrfox=-99 + nfreqfox=-99 + n30z=0 + nwrap=0 + nfox=0 + first=.false. + endif + + decoded0=decoded + fdiff=freq-context_nfqso + if(abs(fdiff).lt.3.0) ltry_a8=.false. + + annot=' ' + if(nap.ne.0) then + write(annot,'(a1,i1)') 'a',nap + if(qual.lt.0.17) decoded0(37:37)='?' + endif + + i0=1 + if (streaming_emit_enabled()) then + if (i0.le.0) call streaming_emit_decode("FT8", context_nutc, snr, dt, nint(freq), decoded0(1:22)) + if (i0.gt.0) call streaming_emit_decode("FT8", context_nutc, snr, dt, nint(freq), decoded0) + else + if(i0.le.0) write(*,1000) context_nutc,snr,dt,nint(freq),decoded0(1:22),annot + if(i0.gt.0) write(*,1001) context_nutc,snr,dt,nint(freq),decoded0,annot + end if +1000 format(i6.6,i4,f5.1,i5,' ~ ',1x,a22,1x,a2) +1001 format(i6.6,i4,f5.1,i5,' ~ ',1x,a37,1x,a2) + if(context_ios13.eq.0) write(13,1002) context_nutc,nint(sync),snr,dt,freq,0,decoded0 +1002 format(i6.6,i4,i5,f6.1,f8.0,i4,3x,a37,' FT8') + + if(context_ncontest.eq.6) then + i1=index(decoded0,' ') + i2=i1 + index(decoded0(i1+1:),' ') + i3=i2 + index(decoded0(i2+1:),' ') + if(i1.ge.3 .and. i2.ge.7 .and. i3.ge.10) then + c1=decoded0(1:i1-1)//' ' + c2=decoded0(i1+1:i2-1) + g2=decoded0(i2+1:i3-1) + b0=c1.eq.context_mycall + if(c1(1:3).eq.'DE ' .and. index(c2,'/').ge.2) b0=.true. + if(len(trim(c1)).ne.len(trim(context_mycall))) then + i4=index(trim(c1),trim(context_mycall)) + i5=index(trim(context_mycall),trim(c1)) + if(i4.ge.1 .or. i5.ge.1) b0=.true. + endif + b1=i3-i2.eq.5 .and. isgrid4(g2) + b2=i3-i2.eq.1 + if(b0 .and. (b1.or.b2) .and. (nint(freq).ge.1000 .or. & + context_b_superfox)) then + n=context_nutc + n30=(3600*(n/10000) + 60*mod((n/100),100) + mod(n,100))/30 + if(n30.lt.n30z) nwrap=nwrap+2880 + n30z=n30 + n30=n30+nwrap + if(nfox.lt.MAXFOX) nfox=nfox+1 + c2fox(nfox)=c2 + g2fox(nfox)=g2 + nsnrfox(nfox)=snr + nfreqfox(nfox)=nint(freq) + n30fox(nfox)=n30 + endif + endif + endif + + call flush(6) + if(context_ios13.eq.0) call flush(13) + + select type (typed_this => this) + type is (counting_ft8_decoder) + typed_this%decoded = typed_this%decoded + 1 + end select + end subroutine ft8_decoded + + subroutine ft4_decoded (this,sync,snr,dt,freq,decoded,nap,qual) + implicit none + + class(ft4_decoder), intent(inout) :: this + real, intent(in) :: sync,dt,freq,qual + integer, intent(in) :: snr,nap + character(len=37), intent(in) :: decoded + character*2 annot + character*37 decoded0 + integer context_nutc, context_ios13 + + select type (typed_this => this) + type is (counting_ft4_decoder) + context_nutc = typed_this%context%nutc + context_ios13 = typed_this%context%ios13 + class default + return + end select + + decoded0=decoded + + annot=' ' + if(nap.ne.0) then + write(annot,'(a1,i1)') 'a',nap + if(qual.lt.0.17) decoded0(37:37)='?' + endif + + if (streaming_emit_enabled()) then + call streaming_emit_decode("FT4", context_nutc, snr, dt, nint(freq), decoded0) + else + write(*,1001) context_nutc,snr,dt,nint(freq),decoded0,annot + end if +1001 format(i6.6,i4,f5.1,i5,' + ',1x,a37,1x,a2) + + if(context_ios13.eq.0) then + write(13,1002,err=10) context_nutc,nint(sync),snr,dt,freq,0,decoded0 +1002 format(i6.6,i4,i5,f6.1,f8.0,i4,3x,a37,' FT4') + flush(13) + endif + +10 call flush(6) + + select type (typed_this => this) + type is (counting_ft4_decoder) + typed_this%decoded = typed_this%decoded + 1 + end select + end subroutine ft4_decoded + + subroutine fst4_decoded (this,nutc,sync,nsnr,dt,freq,decoded,nap, & + qual,ntrperiod,fmid,w50) + + implicit none + + class(fst4_decoder), intent(inout) :: this + integer, intent(in) :: nutc + real, intent(in) :: sync + integer, intent(in) :: nsnr + real, intent(in) :: dt + real, intent(in) :: freq + character(len=37), intent(in) :: decoded + integer, intent(in) :: nap + real, intent(in) :: qual + integer, intent(in) :: ntrperiod + real, intent(in) :: fmid + real, intent(in) :: w50 + + character*2 annot + character*37 decoded0 + character*70 line + integer context_ios13 + + select type (typed_this => this) + type is (counting_fst4_decoder) + context_ios13 = typed_this%context%ios13 + class default + return + end select + + decoded0=decoded + annot=' ' + if(nap.ne.0) then + write(annot,'(a1,i1)') 'a',nap + if(qual.lt.0.17) decoded0(37:37)='?' + endif + + if(ntrperiod.lt.60) then + write(line,1001) nutc,nsnr,dt,nint(freq),decoded0,annot +1001 format(i6.6,i4,f5.1,i5,' ` ',1x,a37,1x,a2) + if(context_ios13.eq.0) write(13,1002) nutc,nint(sync),nsnr,dt,freq,0,decoded0 +1002 format(i6.6,i4,i5,f6.1,f8.0,i4,3x,a37,' FST4') + else + write(line,1003) nutc,nsnr,dt,nint(freq),decoded0,annot +1003 format(i4.4,i4,f5.1,i5,' ` ',1x,a37,1x,a2,2f7.3) + if(context_ios13.eq.0) write(13,1004) nutc,nint(sync),nsnr,dt,freq,0,decoded0 +1004 format(i4.4,i4,i5,f6.1,f8.0,i4,3x,a37,' FST4') + endif + + if(fmid.ne.-999.0) then + if(w50.lt.0.95) write(line(65:70),'(f6.3)') w50 + if(w50.ge.0.95) write(line(65:70),'(f6.2)') w50 + endif + + if (streaming_emit_enabled()) then + call streaming_emit_decode("FST4", nutc, nsnr, dt, nint(freq), decoded0) + else + write(*,1005) line + end if +1005 format(a70) + + call flush(6) + if(context_ios13.eq.0) call flush(13) + + select type (typed_this => this) + type is (counting_fst4_decoder) + typed_this%decoded = typed_this%decoded + 1 + end select + end subroutine fst4_decoded + + subroutine q65_decoded (this,nutc,snr1,nsnr,dt,freq,decoded,idec, & + nused,ntrperiod,iflagdec) + + implicit none + + class(q65_decoder), intent(inout) :: this + integer, intent(in) :: nutc + real, intent(in) :: snr1 + integer, intent(in) :: nsnr + real, intent(in) :: dt + real, intent(in) :: freq + character(len=37), intent(in) :: decoded + integer, intent(in) :: idec + integer, intent(in) :: nused + integer, intent(in) :: ntrperiod + integer, intent(in) :: iflagdec !Recovered spare 78th bit (see genq65/q65_ap) + character*4 cflags + integer context_ios13 + + select type (typed_this => this) + type is (counting_q65_decoder) + context_ios13 = typed_this%context%ios13 + class default + return + end select + + cflags=' ' + if(idec.ge.0) then + cflags='q ' + write(cflags(2:2),'(i1)') idec + if(nused.ge.2) write(cflags(3:3),'(i1)') nused + ! Append '#' (e.g. "q0#", "q3#") when the sender flagged bit78=1, + ! copying our last transmission -- leave the qualifier unchanged + ! ("q0", "q3", ...) otherwise. + if(iflagdec.eq.1) cflags=trim(cflags)//'#' + endif + + if(ntrperiod.lt.60) then + if (streaming_emit_enabled()) then + call streaming_emit_decode("Q65", nutc, nsnr, dt, nint(freq), decoded) + else + if(len_trim(cflags).gt.3) then + write(*,1005) nutc,nsnr,dt,nint(freq),decoded,cflags + else + write(*,1001) nutc,nsnr,dt,nint(freq),decoded,cflags + endif + end if +1001 format(i6.6,i4,f5.1,i5,' : ',1x,a37,1x,a3) +1005 format(i6.6,i4,f5.1,i5,' : ',1x,a37,1x,a4) + if(context_ios13.eq.0) write(13,1002) nutc,nint(snr1),nsnr,dt,freq,0,decoded +1002 format(i6.6,i4,i5,f6.1,f8.0,i4,3x,a37,' Q65') + else + if (streaming_emit_enabled()) then + call streaming_emit_decode("Q65", nutc, nsnr, dt, nint(freq), decoded) + else + if(len_trim(cflags).gt.3) then + write(*,1006) nutc,nsnr,dt,nint(freq),decoded,cflags + else + write(*,1003) nutc,nsnr,dt,nint(freq),decoded,cflags + endif + end if +1003 format(i4.4,i4,f5.1,i5,' : ',1x,a37,1x,a3) +1006 format(i4.4,i4,f5.1,i5,' : ',1x,a37,1x,a4) + if(context_ios13.eq.0) write(13,1004) nutc,nint(snr1),nsnr,dt,freq,0,decoded +1004 format(i4.4,i4,i5,f6.1,f8.0,i4,3x,a37,' Q65') + endif + call flush(6) + if(context_ios13.eq.0) call flush(13) + + select type (typed_this => this) + type is (counting_q65_decoder) + if(idec.ge.0) typed_this%decoded = typed_this%decoded + 1 + end select + end subroutine q65_decoded + +end module decoder_callbacks diff --git a/lib/decoder_ipc_atomic.f90 b/lib/decoder_ipc_atomic.f90 new file mode 100644 index 00000000..2814168d --- /dev/null +++ b/lib/decoder_ipc_atomic.f90 @@ -0,0 +1,49 @@ +module decoder_ipc_atomic + use, intrinsic :: iso_c_binding, only: c_int + implicit none + + integer(c_int), parameter :: DECODER_IPC_CLAIM_INVALID = -2 + integer(c_int), parameter :: DECODER_IPC_CLAIM_INCOMPATIBLE = -1 + integer(c_int), parameter :: DECODER_IPC_CLAIM_NONE = 0 + integer(c_int), parameter :: DECODER_IPC_CLAIMED = 1 + integer(c_int), parameter :: DECODER_IPC_CLAIM_SHUTDOWN = 2 + + interface + function decoder_ipc_control_try_claim(generation, state, version, & + claimed_generation) bind(C) + import c_int + integer(c_int), intent(inout) :: generation + integer(c_int), intent(inout) :: state + integer(c_int), intent(in) :: version + integer(c_int), intent(out) :: claimed_generation + integer(c_int) :: decoder_ipc_control_try_claim + end function decoder_ipc_control_try_claim + + function decoder_ipc_control_finish(generation, state, version, & + request_generation) bind(C) + import c_int + integer(c_int), intent(in) :: generation + integer(c_int), intent(inout) :: state + integer(c_int), intent(in) :: version + integer(c_int), value :: request_generation + integer(c_int) :: decoder_ipc_control_finish + end function decoder_ipc_control_finish + + subroutine decoder_ipc_progress_bind(generation, state, version, & + progress) bind(C) + import c_int + integer(c_int), intent(in) :: generation + integer(c_int), intent(in) :: state + integer(c_int), intent(in) :: version + integer(c_int), intent(inout) :: progress + end subroutine decoder_ipc_progress_bind + + subroutine decoder_ipc_progress_unbind() bind(C) + end subroutine decoder_ipc_progress_unbind + + subroutine decoder_ipc_progress_report(request_generation) bind(C) + import c_int + integer(c_int), value :: request_generation + end subroutine decoder_ipc_progress_report + end interface +end module decoder_ipc_atomic diff --git a/lib/decoder_ipc_control.cpp b/lib/decoder_ipc_control.cpp new file mode 100644 index 00000000..e72251d7 --- /dev/null +++ b/lib/decoder_ipc_control.cpp @@ -0,0 +1,191 @@ +#include "decoder_ipc_control.h" + +#include +#include +#include + +#if defined (_MSC_VER) +#include +#endif + +static_assert (sizeof (int) == sizeof (std::int32_t), + "decoder IPC requires 32-bit control words"); + +namespace +{ + std::atomic progressGeneration {nullptr}; + std::atomic progressState {nullptr}; + std::atomic progressVersion {nullptr}; + std::atomic progressCounter {nullptr}; + +#if defined (_MSC_VER) + static_assert (sizeof (long) == sizeof (int), + "decoder IPC requires 32-bit MSVC interlocked words"); + + int atomicLoad (int const * value) + { + return static_cast (_InterlockedCompareExchange ( + reinterpret_cast (const_cast (value)), 0, 0)); + } + + void atomicStore (int * value, int desired) + { + _InterlockedExchange (reinterpret_cast (value), desired); + } + + bool compareExchange (int * value, int expected, int desired) + { + return expected == _InterlockedCompareExchange ( + reinterpret_cast (value), desired, expected); + } +#else + static_assert (__atomic_always_lock_free (sizeof (int), nullptr), + "decoder IPC control words must be lock-free"); + + int atomicLoad (int const * value) + { + return __atomic_load_n (value, __ATOMIC_ACQUIRE); + } + + void atomicStore (int * value, int desired) + { + __atomic_store_n (value, desired, __ATOMIC_RELEASE); + } + + bool compareExchange (int * value, int expected, int desired) + { + return __atomic_compare_exchange_n (value, &expected, desired, false, + __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE); + } +#endif + + bool hasCurrentVersion (int const * version) + { + return DECODER_IPC_VERSION == atomicLoad (version); + } +} + +extern "C" int decoder_ipc_atomic_load (int const * value) +{ + return atomicLoad (value); +} + +extern "C" void decoder_ipc_control_initialize (int * generation, int * state, + int * version, int * progress) +{ + atomicStore (generation, 0); + atomicStore (progress, 0); + atomicStore (version, DECODER_IPC_VERSION); + atomicStore (state, DECODER_IPC_IDLE); +} + +extern "C" void decoder_ipc_control_shutdown (int * state, + int * legacy_acknowledgment) +{ + atomicStore (state, DECODER_IPC_SHUTDOWN); + atomicStore (legacy_acknowledgment, 1); +} + +extern "C" int decoder_ipc_control_publish (int * generation, int * state, + int const * version, + int * progress, + int request_generation) +{ + if (request_generation <= 0 || !hasCurrentVersion (version) + || DECODER_IPC_IDLE != atomicLoad (state)) + { + return 0; + } + + atomicStore (progress, 0); + atomicStore (generation, request_generation); + return compareExchange (state, DECODER_IPC_IDLE, DECODER_IPC_READY); +} + +extern "C" int decoder_ipc_control_try_claim (int * generation, int * state, + int const * version, + int * claimed_generation) +{ + if (!hasCurrentVersion (version)) return DECODER_IPC_CLAIM_INCOMPATIBLE; + + auto const currentState = atomicLoad (state); + if (DECODER_IPC_SHUTDOWN == currentState) return DECODER_IPC_CLAIM_SHUTDOWN; + if (DECODER_IPC_READY != currentState) return DECODER_IPC_CLAIM_NONE; + + auto const currentGeneration = atomicLoad (generation); + if (currentGeneration <= 0) return DECODER_IPC_CLAIM_INVALID; + + if (!compareExchange (state, DECODER_IPC_READY, DECODER_IPC_DECODING)) + { + return DECODER_IPC_CLAIM_NONE; + } + + *claimed_generation = currentGeneration; + return DECODER_IPC_CLAIMED; +} + +extern "C" int decoder_ipc_control_finish (int const * generation, int * state, + int const * version, + int request_generation) +{ + return request_generation > 0 + && hasCurrentVersion (version) + && request_generation == atomicLoad (generation) + && compareExchange (state, DECODER_IPC_DECODING, DECODER_IPC_COMPLETE); +} + +extern "C" int decoder_ipc_control_consume (int const * generation, int * state, + int const * version, + int request_generation) +{ + if (request_generation <= 0 || !hasCurrentVersion (version) + || request_generation != atomicLoad (generation)) + { + return 0; + } + + return compareExchange (state, DECODER_IPC_COMPLETE, DECODER_IPC_IDLE); +} + +extern "C" void decoder_ipc_progress_bind (int const * generation, + int const * state, + int const * version, + int * progress) +{ + progressGeneration.store (generation, std::memory_order_relaxed); + progressState.store (state, std::memory_order_relaxed); + progressVersion.store (version, std::memory_order_relaxed); + progressCounter.store (progress, std::memory_order_release); +} + +extern "C" void decoder_ipc_progress_unbind () +{ + progressCounter.store (nullptr, std::memory_order_release); + progressVersion.store (nullptr, std::memory_order_relaxed); + progressState.store (nullptr, std::memory_order_relaxed); + progressGeneration.store (nullptr, std::memory_order_relaxed); +} + +extern "C" void decoder_ipc_progress_report (int request_generation) +{ + auto * progress = progressCounter.load (std::memory_order_acquire); + auto const * version = progressVersion.load (std::memory_order_relaxed); + auto const * state = progressState.load (std::memory_order_relaxed); + auto const * generation = progressGeneration.load (std::memory_order_relaxed); + if (!progress || !version || !state || !generation + || request_generation <= 0 + || DECODER_IPC_VERSION != atomicLoad (version) + || DECODER_IPC_DECODING != atomicLoad (state) + || request_generation != atomicLoad (generation)) + { + return; + } + + for (;;) + { + auto const current = atomicLoad (progress); + auto const next = std::numeric_limits::max () == current + ? 1 : current + 1; + if (compareExchange (progress, current, next)) return; + } +} diff --git a/lib/decoder_ipc_control.h b/lib/decoder_ipc_control.h new file mode 100644 index 00000000..5bf593ba --- /dev/null +++ b/lib/decoder_ipc_control.h @@ -0,0 +1,40 @@ +#ifndef DECODER_IPC_CONTROL_H +#define DECODER_IPC_CONTROL_H + +#include "../DecoderIpcProtocol.h" + +enum decoder_ipc_claim_result +{ + DECODER_IPC_CLAIM_INVALID = -2, + DECODER_IPC_CLAIM_INCOMPATIBLE = -1, + DECODER_IPC_CLAIM_NONE = 0, + DECODER_IPC_CLAIMED = 1, + DECODER_IPC_CLAIM_SHUTDOWN = 2 +}; + +#ifdef __cplusplus +extern "C" { +#endif + +int decoder_ipc_atomic_load (int const * value); +void decoder_ipc_control_initialize (int * generation, int * state, int * version, + int * progress); +void decoder_ipc_control_shutdown (int * state, int * legacy_acknowledgment); +int decoder_ipc_control_publish (int * generation, int * state, + int const * version, int * progress, + int request_generation); +int decoder_ipc_control_try_claim (int * generation, int * state, int const * version, + int * claimed_generation); +int decoder_ipc_control_finish (int const * generation, int * state, + int const * version, int request_generation); +int decoder_ipc_control_consume (int const * generation, int * state, + int const * version, int request_generation); +void decoder_ipc_progress_bind (int const * generation, int const * state, + int const * version, int * progress); +void decoder_ipc_progress_unbind (void); +void decoder_ipc_progress_report (int request_generation); +#ifdef __cplusplus +} +#endif + +#endif diff --git a/lib/digi-contest.txt b/lib/digi-contest.txt index b0eafaec..a45e4d04 100644 --- a/lib/digi-contest.txt +++ b/lib/digi-contest.txt @@ -95,13 +95,14 @@ CQ WW RTTY US/Can: RST CQZ state/prov R 579 8 NJ r1 r3 z6 s6 16 72 ARRL VHF+ grid4 R FN42 r1 g15 16 72 -EU VHF+ rpt serial grid6 R 590013 IO91NP r1 r3 n12 g25 41 97 +EU VHF+ rpt serial grid6 R 590013 IO91NP r1 r3 n11 g25 40 96 ------------------------------------------------------------------------------ Meaning and number of bits for each exchange component: c3 Operating class (A-F) g15 grid4 g25 grid6 +n11 Serial number for EU VHF Type 5 n12 Serial number n5 Number of transmitters (0-31) r1 acknowledgment of received exchange diff --git a/lib/echo_snr.f90 b/lib/echo_snr.f90 index 786f1aea..ce806fa6 100644 --- a/lib/echo_snr.f90 +++ b/lib/echo_snr.f90 @@ -15,7 +15,14 @@ subroutine echo_snr(sa,sb,fspread,blue,red,snrdb,db_err,fpeak,snr_detect) i3=nint((1500.0 + wh)/df) - 2048 i4=nint((1500.0 + 2.0*wh)/df) - 2048 + blue=0. + red=0. + snrdb=-99. + db_err=1.8 + fpeak=0. + snr_detect=0. baseline=(sum(sb(i1:i2-1)) + sum(sb(i3+1:i4)))/(i2+i4-i1-i3) + if(.not.(baseline.gt.0.)) return blue=sa/baseline red=sb/baseline psig=sum(red(i2:i3)-1.0) @@ -23,6 +30,7 @@ subroutine echo_snr(sa,sb,fspread,blue,red,snrdb,db_err,fpeak,snr_detect) snrdb=db(psig/pnoise_2500) smax=0. + ipk=2048 mh=max(1,nint(0.2*fspread/df)) do i=i2,i3 ssum=sum(red(i-mh:i+mh)) @@ -36,7 +44,7 @@ subroutine echo_snr(sa,sb,fspread,blue,red,snrdb,db_err,fpeak,snr_detect) call averms(red(i1:i2-1),i2-i1,-1,ave1,rms1) call averms(red(i3+1:i4),i4-i3,-1,ave2,rms2) perr=0.707*(rms1+rms2)*sqrt(float(i2-i1+i4-i3)) - snr_detect=psig/perr + if(perr.gt.0.) snr_detect=psig/perr db_err=0.8 if(snrdb.lt.-10.0) db_err=0.8 if(snrdb.lt.-11.0) db_err=0.9 diff --git a/lib/echosim.f90 b/lib/echosim.f90 index 96854aae..aa70bb5a 100644 --- a/lib/echosim.f90 +++ b/lib/echosim.f90 @@ -3,15 +3,21 @@ program echosim ! Generate simulated echo-mode files -- self-echo or "measure" use wavhdr - parameter (NWAVE=27648,NMAX=32768,NZ=36000) + use julian + parameter (NWAVE=27648,NZ=36000) type(hdr) h !Header for .wav file character arg*12,fname*17 - complex c0(0:NMAX-1) - complex c(0:NMAX-1) + complex c0(0:NZ-1) real*4 level_1,level_2 real*8 f0,dt,twopi,phi,dphi real wave(NZ) integer*2 iwave(NZ) !Generated full-length waveform + character*32 isft !WAV LIST/INFO trailer fields + character*24 icrd + character*64 icmt + integer*8 tsec8 + integer gmt(9) + integer*4 trailerlen,wav_trailer_length equivalence (nDop0,iwave(1)) equivalence (nDopAudio0,iwave(3)) equivalence (nfrit0,iwave(5)) @@ -59,6 +65,15 @@ program echosim write(*,1000) 1000 format(' N f0 fDop fSpread SNR File name'/51('-')) + isft='WSJT-X echosim' + tsec8=itime8() + call gmtime(int(tsec8,4),gmt) + write(icrd,1004) gmt(6)+1900,gmt(5)+1,gmt(4),gmt(3),gmt(2),gmt(1) +1004 format(i4.4,'-',i2.2,'-',i2.2,'T',i2.2,':',i2.2,':',i2.2,'Z') + write(icmt,1005) nfiles +1005 format('Mode=Echo; Simulated by echosim; nfiles=',i0) + trailerlen=wav_trailer_length(isft,icrd,icmt) + do ifile=1,nfiles wave=0. @@ -72,9 +87,7 @@ program echosim enddo c0(NWAVE:)=0. if(fspread.gt.0.0) call fspread_lorentz(c0,fspread) - c=sig*c0 - wave(1:NWAVE)=imag(c(1:NWAVE)) - peak=maxval(abs(wave)) + wave(1:NWAVE)=sig*imag(c0(0:NWAVE-1)) endif if(snrdb.lt.90) then @@ -109,18 +122,66 @@ program echosim f10=f0 + fdop fspread0=fspread - h=default_header(12000,NMAX) + h=default_header(12000,NZ) + h%lenfile=h%lenfile + trailerlen ! Include trailing metadata in the RIFF size n=3*(ifile-1) ihr=n/3600 imin=(n-3600*ihr)/60 isec=mod(n,60) write(fname,1102) ihr,imin,isec 1102 format('000000_',3i2.2,'.wav') - open(10,file=fname,status='unknown',access='stream') + open(10,file=fname,status='replace',access='stream') write(10) h,iwave !Save to *.wav file + call write_wav_info_trailer(10,isft,icrd,icmt) close(10) write(*,1110) ifile,f0,fdop,fspread,snrdb,fname 1110 format(i4,4f7.1,2x,a17) enddo 999 end program echosim + +integer*4 function wav_info_field_bytes(nchar) +! Match BWFFile's NUL-terminated, word-aligned INFO subchunk layout. + integer, intent(in) :: nchar + integer*4 n + n=nchar+1 + wav_info_field_bytes=8+n+mod(n,2) +end function wav_info_field_bytes + +integer*4 function wav_trailer_length(isft,icrd,icmt) +! Return the complete LIST chunk size, including its 8-byte header. + character(len=*), intent(in) :: isft,icrd,icmt + integer*4 wav_info_field_bytes + wav_trailer_length = 8 + 4 & !'LIST' id+size, 'INFO' + + wav_info_field_bytes(len_trim(isft)) & + + wav_info_field_bytes(len_trim(icrd)) & + + wav_info_field_bytes(len_trim(icmt)) +end function wav_trailer_length + +subroutine write_wav_info_trailer(lu,isft,icrd,icmt) +! Append LIST/INFO metadata at the current stream position. + integer, intent(in) :: lu + character(len=*), intent(in) :: isft,icrd,icmt + integer*4 listlen,wav_info_field_bytes + + listlen = 4 & !'INFO' + + wav_info_field_bytes(len_trim(isft)) & + + wav_info_field_bytes(len_trim(icrd)) & + + wav_info_field_bytes(len_trim(icmt)) + + write(lu) 'LIST',listlen,'INFO' + call write_wav_info_field(lu,'ISFT',isft(1:len_trim(isft))) + call write_wav_info_field(lu,'ICRD',icrd(1:len_trim(icrd))) + call write_wav_info_field(lu,'ICMT',icmt(1:len_trim(icmt))) +end subroutine write_wav_info_trailer + +subroutine write_wav_info_field(lu,id,value) +! Write one NUL-terminated, word-aligned INFO subchunk. + integer, intent(in) :: lu + character*4, intent(in) :: id + character(len=*), intent(in) :: value + integer*4 n + n=len(value)+1 + write(lu) id,n,value,char(0) + if(mod(n,2).eq.1) write(lu) char(0) +end subroutine write_wav_info_field diff --git a/lib/emedop.f90 b/lib/emedop.f90 index 4a95fb87..da57bb9c 100644 --- a/lib/emedop.f90 +++ b/lib/emedop.f90 @@ -1,10 +1,15 @@ program emedop + use jpl_ephemeris_status, only: EPHEMERIS_INVALID_INPUT, & + EPHEMERIS_UNAVAILABLE real*8 txfreq8 real*8 rxfreq8 real*4 LST real*4 lat_a real*4 lat_b + integer start_year,start_month,start_day + integer stop_year,stop_month,stop_day + integer ephemeris_result_a,ephemeris_result_b character*80 infile character*256 jpleph_file_name common/jplcom/jpleph_file_name @@ -24,13 +29,27 @@ program emedop read(10,1001) lat_b read(10,1001) wlon_b read(10,1001) txfreq8 - read(10,1002) nyear,month,nday,ih,im,is + read(10,1002) start_year,start_month,start_day,ih,im,is 1002 format(10x,i4,2i2,1x,i2,1x,i2,1x,i2) sec_start=3600.0*ih + 60.0*im + is - read(10,1002) nyear,month,nday,ih,im,is + read(10,1002) stop_year,stop_month,stop_day,ih,im,is sec_stop=3600.0*ih + 60.0*im + is read(10,1001) sec_step + if(start_year.ne.stop_year .or. start_month.ne.stop_month .or. & + start_day.ne.stop_day) then + print*,'Start and stop dates must be the same' + go to 999 + endif + if(sec_stop.lt.sec_start) then + print*,'Stop time must not precede start time' + go to 999 + endif + if(sec_step.le.0.0) then + print*,'Time step must be positive' + go to 999 + endif + write(*,1005) 1005 format(' Date UTC Tx Freq Rx Freq Doppler'/ & '------------------------------------------------------') @@ -40,11 +59,23 @@ program emedop do icalc=1,ncalc uth=sec/3600.0 - call MoonDopJPL(nyear,month,nday,uth,-wlon_a,lat_a,RAMoon,DecMoon, & - LST,HA,AzMoon,ElMoon,vr_a,techo) + call MoonDopJPL(start_year,start_month,start_day,uth,-wlon_a,lat_a, & + RAMoon,DecMoon, & + LST,HA,AzMoon,ElMoon,vr_a,techo,ephemeris_result_a) - call MoonDopJPL(nyear,month,nday,uth,-wlon_b,lat_b,RAMoon,DecMoon, & - LST,HA,AzMoon,ElMoon,vr_b,techo) + call MoonDopJPL(start_year,start_month,start_day,uth,-wlon_b,lat_b, & + RAMoon,DecMoon, & + LST,HA,AzMoon,ElMoon,vr_b,techo,ephemeris_result_b) + if(ephemeris_result_a.eq.EPHEMERIS_INVALID_INPUT .or. & + ephemeris_result_b.eq.EPHEMERIS_INVALID_INPUT) then + print*,'Invalid date or time in input file' + go to 999 + endif + if(ephemeris_result_a.eq.EPHEMERIS_UNAVAILABLE .or. & + ephemeris_result_b.eq.EPHEMERIS_UNAVAILABLE) then + print*,'Ephemeris calculation failed' + go to 999 + endif dop_a=-txfreq8*vr_a/2.99792458e5 !One-way Doppler from a dop_b=-txfreq8*vr_b/2.99792458e5 !One-way Doppler to b @@ -54,7 +85,8 @@ program emedop ih=sec/3600.0 im=(sec-ih*3600.0)/60.0 is=nint(mod(sec,60.0)) - write(*,1010) nyear,month,nday,ih,im,is,txFreq8,rxFreq8,doppler + write(*,1010) start_year,start_month,start_day,ih,im,is,txFreq8, & + rxFreq8,doppler 1010 format(i4,2i2.2,2x,i2.2,':',i2.2,':',i2.2,2f13.7,f8.1) sec=sec + sec_step @@ -64,4 +96,3 @@ program emedop 999 end program emedop - diff --git a/lib/ephem.f90 b/lib/ephem.f90 index a24ddbd0..be5b711a 100644 --- a/lib/ephem.f90 +++ b/lib/ephem.f90 @@ -1,85 +1,174 @@ subroutine ephem(mjd0,dut,east_long,geodetic_lat,height,nspecial, & - RA,Dec,Az,El,techo,dop,fspread_1GHz,vr) + RA,Dec,Az,El,techo,dop,fspread_1GHz,vr,ephemeris_result) + use ieee_arithmetic, only: ieee_is_finite + use jpl_ephemeris_status, only: JPL_STATUS_OK, EPHEMERIS_JPL, & + EPHEMERIS_ANALYTIC_FALLBACK, EPHEMERIS_UNAVAILABLE implicit real*8 (a-h,o-z) - real*8 jd !Time of observationa as a Julian Date - real*8 mjd,mjd0 !Modified Julian Date - real*8 prec(3,3) !Precession matrix, J2000 to Date - real*8 rmatn(3,3) !Nutation matrix - real*8 rme2000(6) !Vector from Earth center to Moon, JD2000 - real*8 rmeDate(6) !Vector from Earth center to Moon at Date - real*8 rmeTrue(6) !Include nutation - real*8 raeTrue(6) !Vector from Earth center to Obs at Date - real*8 rmaTrue(6) !Vector from Obs to Moon at Date - logical km,bary !Set km=.true. to get km, km/s from ephemeris - common/stcomx/km,bary,pvsun(6) !Common used in JPL subroutines + real*8 jd + real*8 mjd,mjd0 + real*8 prec(3,3) + real*8 rmatn(3,3) + real*8 rme2000(6,2) + real*8 rmeDate(6) + real*8 rmeTrue(6) + real*8 raeTrue(6) + real*8 rmaTrue(6) + real*8 djutc_sample(2),jd_sample(2),djtt_sample(2) + real*8, parameter :: max_lunar_position_km=1.d7 + real*8, parameter :: max_lunar_velocity_km_s=100.d0 + logical km,bary,jpl_available,use_jpl,derived_valid + integer ephemeris_result,jpl_status,attempt + common/stcomx/km,bary,pvsun(6) common/librcom/xl(2),b(2) - twopi=8.d0*atan(1.d0) !Define some constants + RA=0.d0 + Dec=0.d0 + Az=0.d0 + El=0.d0 + techo=0.d0 + dop=0.d0 + fspread_1GHz=0.d0 + vr=0.d0 + ephemeris_result=EPHEMERIS_UNAVAILABLE + + twopi=8.d0*atan(1.d0) rad=360.d0/twopi clight=2.99792458d5 au2km=0.1495978706910000d9 - pi=0.5d0*twopi - pio2=0.5d0*pi km=.true. freq=1000.0d6 + jpl_available=nspecial.ne.8 do jj=1,2 mjd=mjd0 if(jj.eq.1) mjd=mjd - 1.d0/1440.d0 - djutc=mjd - jd=2400000.5d0 + mjd - djtt=mjd + sla_DTT(jd)/86400.d0 - ttjd=jd + sla_DTT(jd)/86400.d0 - - if(nspecial.ne.8) then - call pleph(ttjd,10,3,rme2000) !RME (J2000) from JPL ephemeris - - year=2000.d0 + (jd-2451545.d0)/365.25d0 - call sla_PREC (2000.0d0, year, prec) !Get precession matrix - rmeDate(1:3)=matmul(prec,rme2000(1:3)) !Moon geocentric xyz at Date - rmeDate(4:6)=matmul(prec,rme2000(4:6)) !Moon geocentric vel at Date - else - call sla_DMOON(djtt,rmeDate) !No JPL ephemeris, use DMOON - rmeDate=rmeDate*au2km - endif + djutc_sample(jj)=mjd + jd_sample(jj)=2400000.5d0 + mjd + djtt_sample(jj)=mjd + sla_DTT(jd_sample(jj))/86400.d0 - if(nspecial.eq.7) then - rmeTrue=rmeDate - else -!Nutation to true equinox of Date - call sla_NUT(djtt,rmatn) - call sla_DMXV(rmatn,rmeDate,rmeTrue) - call sla_DMXV(rmatn,rmeDate(4),rmeTrue(4)) + if(jpl_available) then + ttjd=2400000.5d0 + djtt_sample(jj) + call pleph(ttjd,10,3,rme2000(:,jj),jpl_status) + if(jpl_status.ne.JPL_STATUS_OK) jpl_available=.false. + if(jpl_available) then + if(.not.all(ieee_is_finite(rme2000(:,jj)))) & + jpl_available=.false. + endif + if(jpl_available) then + if(any(abs(rme2000(1:3,jj)).gt.max_lunar_position_km) & + .or. any(abs(rme2000(4:6,jj)).gt. & + max_lunar_velocity_km_s)) & + jpl_available=.false. + endif endif + enddo + + do attempt=1,2 + use_jpl=jpl_available + derived_valid=.true. + + do jj=1,2 + djutc=djutc_sample(jj) + jd=jd_sample(jj) + djtt=djtt_sample(jj) + + if(use_jpl) then + year=2000.d0 + (jd-2451545.d0)/365.25d0 + call sla_PREC(2000.0d0,year,prec) + rmeDate(1:3)=matmul(prec,rme2000(1:3,jj)) + rmeDate(4:6)=matmul(prec,rme2000(4:6,jj)) + else + call sla_DMOON(djtt,rmeDate) + rmeDate=rmeDate*au2km + endif + if(.not.all(ieee_is_finite(rmeDate))) then + derived_valid=.false. + exit + endif -! Local Apparent Sidereal Time: - djut1=djutc + dut/86400.d0 - if(nspecial.eq.6) djut1=djutc - xlast=sla_DRANRM(sla_GMST(djut1) + sla_EQEQX(djtt) + east_long) - call sla_PVOBS(geodetic_lat,height,xlast,raeTrue) - rmaTrue=rmeTrue - raeTrue*au2km - - if(nspecial.ne.2) then -! Allow for planetary aberration - tl=499.004782D0*SQRT(rmaTrue(1)**2 + rmaTrue(2)**2 + rmaTrue(3)**2) - rmaTrue(1:3)=rmaTrue(1:3)-tl*rmaTrue(4:6)/au2km + if(nspecial.eq.7) then + rmeTrue=rmeDate + else + call sla_NUT(djtt,rmatn) + call sla_DMXV(rmatn,rmeDate,rmeTrue) + call sla_DMXV(rmatn,rmeDate(4),rmeTrue(4)) + endif + if(.not.all(ieee_is_finite(rmeTrue))) then + derived_valid=.false. + exit + endif + + djut1=djutc + dut/86400.d0 + if(nspecial.eq.6) djut1=djutc + xlast=sla_DRANRM(sla_GMST(djut1) + sla_EQEQX(djtt) + & + east_long) + call sla_PVOBS(geodetic_lat,height,xlast,raeTrue) + rmaTrue=rmeTrue - raeTrue*au2km + if(.not.ieee_is_finite(xlast) .or. & + .not.all(ieee_is_finite(raeTrue)) .or. & + .not.all(ieee_is_finite(rmaTrue))) then + derived_valid=.false. + exit + endif + + if(nspecial.ne.2) then + tl=499.004782D0*SQRT(rmaTrue(1)**2 + rmaTrue(2)**2 + & + rmaTrue(3)**2) + rmaTrue(1:3)=rmaTrue(1:3)-tl*rmaTrue(4:6)/au2km + if(.not.ieee_is_finite(tl) .or. & + .not.all(ieee_is_finite(rmaTrue))) then + derived_valid=.false. + exit + endif + endif + + call sla_DC62S(rmaTrue,RA,Dec,dist,RAdot,DECdot,vr) + dop=-2.d0 * freq * vr/clight + techo=2.d0*dist/clight + call libration(jd,RA,Dec,xl(jj),b(jj)) + if(.not.all(ieee_is_finite((/RA,Dec,dist,RAdot,DECdot,vr, & + dop,techo,xl(jj),b(jj)/)))) then + derived_valid=.false. + exit + endif + enddo + + if(derived_valid) then + dldt=57.2957795131*(xl(2)-xl(1)) + dbdt=57.2957795131*(b(2)-b(1)) + rate=sqrt((2*dldt)**2 + (2*dbdt)**2) + fspread_1GHz=0.5*6741*rate + call sla_DE2H(xlast-RA,Dec,geodetic_lat,Az,El) + if(.not.all(ieee_is_finite((/dldt,dbdt,rate,fspread_1GHz, & + Az,El/)))) derived_valid=.false. endif -!Topocentric RA, Dec, dist, velocity - call sla_DC62S(rmaTrue,RA,Dec,dist,RAdot,DECdot,vr) - dop=-2.d0 * freq * vr/clight !EME doppler shift - techo=2.d0*dist/clight !Echo delay time (s) - call libration(jd,RA,Dec,xl(jj),b(jj)) + if(use_jpl .and. .not.derived_valid) then + jpl_available=.false. + cycle + endif + exit enddo - fspread_1GHz=0.0d0 - dldt=57.2957795131*(xl(2)-xl(1)) - dbdt=57.2957795131*(b(2)-b(1)) - rate=sqrt((2*dldt)**2 + (2*dbdt)**2) - fspread_1GHz=0.5*6741*rate - - call sla_DE2H(xlast-RA,Dec,geodetic_lat,Az,El) + if(derived_valid) then + if(use_jpl) then + ephemeris_result=EPHEMERIS_JPL + else + ephemeris_result=EPHEMERIS_ANALYTIC_FALLBACK + endif + else + ephemeris_result=EPHEMERIS_UNAVAILABLE + RA=0.d0 + Dec=0.d0 + Az=0.d0 + El=0.d0 + techo=0.d0 + dop=0.d0 + fspread_1GHz=0.d0 + vr=0.d0 + xl=0.d0 + b=0.d0 + endif - return end subroutine ephem diff --git a/lib/fil4.f90 b/lib/fil4.f90 index 4946da2f..da98ded6 100644 --- a/lib/fil4.f90 +++ b/lib/fil4.f90 @@ -1,5 +1,19 @@ subroutine fil4(id1,n1,id2,n2) + parameter (NTAPS=49) + integer*2 id1(n1) + integer*2 id2(*) + real t(NTAPS) + data t/NTAPS*0.0/ + save t + + call fil4_state(id1,n1,id2,n2,t) + + return +end subroutine fil4 + +subroutine fil4_state(id1,n1,id2,n2,t) + ! FIR lowpass filter designed using ScopeFIR ! fsample = 48000 Hz @@ -15,7 +29,6 @@ subroutine fil4(id1,n1,id2,n2) integer*2 id1(n1) integer*2 id2(*) real t(NTAPS) - data t/NTAPS*0.0/ ! Filter coefficients: real w(NTAPS) @@ -33,7 +46,7 @@ subroutine fil4(id1,n1,id2,n2) -0.013752163325,-0.011720748164,-0.005202883094, 0.002613872664, & 0.008706594219, 0.011363155076, 0.010161983649, 0.010051920210, & 0.000861074040/ - save w,t + save w n2=n1/NDOWN if(n2*NDOWN.ne.n1) stop 'Error in fil4' @@ -46,4 +59,4 @@ subroutine fil4(id1,n1,id2,n2) enddo return -end subroutine fil4 +end subroutine fil4_state diff --git a/lib/flat4.f90 b/lib/flat4.f90 index faf15459..44f1e9c7 100644 --- a/lib/flat4.f90 +++ b/lib/flat4.f90 @@ -12,10 +12,11 @@ subroutine flat4(s,npts0,nflatten) real*8 x(1000),y(1000),a(5) data nseg/10/,npct/10/ + epsilon=tiny(s(1)) npts=min(6827,npts0) if(s(1).gt.1.e29) go to 900 !Boundary between Rx intervals: do nothing do i=1,npts - s(i)=10.0*log10(s(i)) !Convert to dB scale + s(i)=10.0*log10(max(s(i),epsilon)) !Convert to dB scale enddo if(nflatten.gt.0) then diff --git a/lib/fst4/fastosd240_74.f90 b/lib/fst4/fastosd240_74.f90 index 39d20b8e..9af0f4e9 100644 --- a/lib/fst4/fastosd240_74.f90 +++ b/lib/fst4/fastosd240_74.f90 @@ -168,6 +168,7 @@ subroutine fastosd240_74(llr,k,apmask,ndeep,message74,cw,nhardmin,dmin) if(ndeep.eq.0) goto 998 ! norder=0 if(ndeep.gt.4) ndeep=4 + nord=0 nsyndmax=0 if( ndeep.eq. 1) then nord=1 diff --git a/lib/fst4/fst4sim.f90 b/lib/fst4/fst4sim.f90 index 936c4b6f..3476d097 100644 --- a/lib/fst4/fst4sim.f90 +++ b/lib/fst4/fst4sim.f90 @@ -13,11 +13,14 @@ program fst4sim complex, allocatable :: c(:) real, allocatable :: wave(:) integer hmod + integer exit_status + integer pack_status integer itone(NN) integer*1 msgbits(101) integer*2, allocatable :: iwave(:) !Generated full-length waveform ! Get command-line argument(s) + exit_status=0 nargs=iargc() if(nargs.ne.9) then print*,'Need 9 arguments, got ',nargs @@ -76,15 +79,27 @@ program fst4sim if(snrdb.gt.90.0) sig=1.0 if(wspr_hint) then - i3=0 - n3=6 + iwspr=1 else - i3=-1 - n3=-1 + iwspr=0 endif - call pack77(msg37,i3,n3,c77) - if(i3.eq.0.and.n3.eq.6) iwspr=1 call genfst4(msg37,0,msgsent37,msgbits,itone,iwspr) + if(trim(msgsent37).eq.'*** bad message ***') then + print*,'Cannot encode message: ',trim(msg37) + exit_status=1 + go to 999 + endif + if(iwspr.eq.1) then + call pack77(msgsent37,i3,n3,c77, & + pack77_options(prefer_wspr_50bit=.true.),pack_status) + else + call pack77(msgsent37,i3,n3,c77,status=pack_status) + endif + if(pack_status.ne.PACK77_STATUS_ENCODED) then + print*,'Cannot encode message: ',trim(msg37) + exit_status=1 + go to 999 + endif write(*,*) write(*,'(a9,a37,a3,L2,a7,i2)') 'Message: ',msgsent37,'W:',wspr_hint,' iwspr:',iwspr write(*,1000) f00,xdt,txt,snrdb @@ -149,11 +164,17 @@ program fst4sim write(fname,1104) ifile 1104 format('000000_',i4.4,'.wav') endif - open(10,file=trim(fname),status='unknown',access='stream') + open(10,file=trim(fname),status='replace',access='stream') write(10) h,iwave !Save to *.wav file close(10) write(*,1110) ifile,xdt,f00,snrdb,fname 1110 format(i4,f7.2,f8.2,f7.1,2x,a17) enddo -999 end program fst4sim +999 if(allocated(c0)) deallocate(c0) + if(allocated(c)) deallocate(c) + if(allocated(wave)) deallocate(wave) + if(allocated(iwave)) deallocate(iwave) + if(exit_status.ne.0) stop 1 + +end program fst4sim diff --git a/lib/fst4/gen_fst4wave.f90 b/lib/fst4/gen_fst4wave.f90 index 74a9b34c..516bf722 100644 --- a/lib/fst4/gen_fst4wave.f90 +++ b/lib/fst4/gen_fst4wave.f90 @@ -7,7 +7,7 @@ subroutine gen_fst4wave(itone,nsym,nsps,nwave,fsample,hmod,f0, & complex cwave(nwave),ctab(0:NTAB-1) character(len=1) :: cvalue real, allocatable, save :: pulse(:) - real, allocatable :: dphi(:) + real, allocatable :: dphi(:), scaled_pulse(:) integer hmod integer itone(nsym) logical first, lshape @@ -40,34 +40,36 @@ subroutine gen_fst4wave(itone,nsym,nsps,nwave,fsample,hmod,f0, & nsps0=nsps endif -! Compute the smoothed frequency waveform. -! Length = (nsym+2)*nsps samples, zero-padded - allocate( dphi(0:(nsym+2)*nsps-1) ) +! Generate one symbol at a time, retaining phase across symbol boundaries. + allocate(dphi(0:nsps-1)) dphi_peak=twopi*hmod/real(nsps) - dphi=0.0 - do j=1,nsym - ib=(j-1)*nsps - ie=ib+3*nsps-1 - dphi(ib:ie) = dphi(ib:ie) + dphi_peak*pulse(1:3*nsps)*itone(j) - enddo - -! Calculate and insert the audio waveform + allocate(scaled_pulse(3*nsps)) + scaled_pulse=dphi_peak*pulse + carrier=twopi*(f0-1.5*hmod/tsym)*dt + if(icmplx.eq.0) wave(nsym*nsps+1:nwave)=0. + if(icmplx.eq.1) cwave(nsym*nsps+1:nwave)=0. phi=0.0 - dphi = dphi + twopi*(f0-1.5*hmod/tsym)*dt !Shift frequency up by f0 - if(icmplx.eq.0) wave=0. - if(icmplx.eq.1) cwave=0. k=0 - do j=nsps,(nsym+1)*nsps-1 - k=k+1 - i=phi*float(NTAB)/twopi - i=iand(i,NTAB-1) - if(icmplx.eq.0) then - wave(k)=aimag(ctab(i)) - else - cwave(k)=ctab(i) - endif - phi=phi+dphi(j) - if(phi.gt.twopi) phi=phi-twopi + do iblock=1,nsym + dphi=0.0 +! Accumulate overlapping pulses in tone order to preserve phase rounding. + do j=max(1,iblock-1),min(nsym,iblock+1) + ip=(iblock-j+1)*nsps+1 + dphi=dphi+scaled_pulse(ip:ip+nsps-1)*itone(j) + enddo + dphi=dphi+carrier + do j=0,nsps-1 + k=k+1 + i=phi*float(NTAB)/twopi + i=iand(i,NTAB-1) + if(icmplx.eq.0) then + wave(k)=aimag(ctab(i)) + else + cwave(k)=ctab(i) + endif + phi=phi+dphi(j) + if(phi.gt.twopi) phi=phi-twopi + enddo enddo ! Compute the ramp-up and ramp-down symbols diff --git a/lib/fst4/genfst4.f90 b/lib/fst4/genfst4.f90 index 42950554..643a08cf 100644 --- a/lib/fst4/genfst4.f90 +++ b/lib/fst4/genfst4.f90 @@ -23,7 +23,7 @@ subroutine genfst4(msg0,ichk,msgsent,msgbits,i4tone,iwspr) integer*1 msgbits(101),rvec(77) integer isyncword1(8),isyncword2(8) integer ncrc24 - logical unpk77_success + logical requested_wspr,encoded_wspr,unpk77_success data isyncword1/0,1,3,2,1,0,2,3/ data isyncword2/2,3,1,0,3,2,0,1/ data rvec/0,1,0,0,1,0,1,0,0,1,0,1,1,1,1,0,1,0,0,0,1,0,0,1,1,0,1,1,0, & @@ -42,24 +42,35 @@ subroutine genfst4(msg0,ichk,msgsent,msgbits,i4tone,iwspr) message=message(i+1:) enddo + requested_wspr=iwspr.eq.1 i3=-1 n3=-1 - if(iwspr.eq.1) then - i3=0 - n3=6 + c77=' ' + if(requested_wspr) then + call pack77(message,i3,n3,c77, & + pack77_options(prefer_wspr_50bit=.true.)) + else + call pack77_legacy_truncating_fallback(message,i3,n3,c77) + endif + encoded_wspr=i3.eq.0.and.n3.eq.6 + unpk77_success=.false. + if(i3.ge.0.and.n3.ge.0) then + call unpack77(c77,0,msgsent,unpk77_success) !Unpack to get msgsent endif - call pack77(message,i3,n3,c77) - call unpack77(c77,0,msgsent,unpk77_success) !Unpack to get msgsent msgbits=0 iwspr=0 - if(i3.eq.0.and.n3.eq.6) then + if(requested_wspr.and..not.encoded_wspr) then + iwspr=1 + go to 1 + endif + if(encoded_wspr) then iwspr=1 read(c77,'(50i1)') msgbits(1:50) call get_crc24(msgbits,74,ncrc24) write(c24,'(b24.24)') ncrc24 read(c24,'(24i1)') msgbits(51:74) else - read(c77,'(77i1)') msgbits(1:77) + read(c77,'(77i1)',err=1) msgbits(1:77) msgbits(1:77)=mod(msgbits(1:77)+rvec,2) call get_crc24(msgbits,101,ncrc24) write(c24,'(b24.24)') ncrc24 @@ -68,8 +79,9 @@ subroutine genfst4(msg0,ichk,msgsent,msgbits,i4tone,iwspr) if(ichk.eq.1) go to 999 if(unpk77_success) go to 2 - msgbits=0 - itone=0 +1 msgbits=0 + i4tone=0 + if(requested_wspr) iwspr=1 msgsent='*** bad message *** ' go to 999 diff --git a/lib/fst4/get_fst4_bitmetrics.f90 b/lib/fst4/get_fst4_bitmetrics.f90 index 0ae747c5..762daa25 100644 --- a/lib/fst4/get_fst4_bitmetrics.f90 +++ b/lib/fst4/get_fst4_bitmetrics.f90 @@ -15,7 +15,7 @@ subroutine get_fst4_bitmetrics(cd,nss,bitmetrics,s4,nsync_qual,badsync) logical first logical badsync real bitmetrics(2*NN,4) - real s2(0:65535) + real, save :: s2(0:65535) real s4(0:3,NN) data isyncword1/0,1,3,2,1,0,2,3/ data isyncword2/2,3,1,0,3,2,0,1/ diff --git a/lib/fst4/ldpcsim240_101.f90 b/lib/fst4/ldpcsim240_101.f90 index e201ac41..b886d6ae 100644 --- a/lib/fst4/ldpcsim240_101.f90 +++ b/lib/fst4/ldpcsim240_101.f90 @@ -14,6 +14,7 @@ program ldpcsim240_101 integer*1 cw(240) integer*1 codeword(N),message101(101) integer ncrc24 + integer pack_status real rxdata(N),llr(N) logical first,unpk77_success data first/.true./ @@ -41,7 +42,17 @@ program ldpcsim240_101 read(arg,*) Keff msg0='K9AN K1JT FN20 ' if(nargs.eq.6) call getarg(6,msg0) - call pack77(msg0,i3,n3,c77) + call pack77_legacy_truncating_fallback(msg0,i3,n3,c77, & + status=pack_status) + if(pack_status.ne.PACK77_STATUS_ENCODED) then + print*,'Cannot encode message: ',trim(msg0) + stop 1 + endif + call unpack77(c77,0,msg,unpk77_success) + if(.not.unpk77_success) then + print*,'Cannot encode message: ',trim(msg0) + stop 1 + endif rate=real(Keff)/real(N) @@ -50,6 +61,7 @@ program ldpcsim240_101 write(*,*) "norder : ",norder write(*,*) "s : ",s write(*,*) "K : ",Keff + write(*,*) 'Message sent: ',trim(msg) msgbits=0 read(c77,'(77i1)') msgbits(1:77) diff --git a/lib/fst4/osd240_101.f90 b/lib/fst4/osd240_101.f90 index 9d97e8b6..199b27a8 100644 --- a/lib/fst4/osd240_101.f90 +++ b/lib/fst4/osd240_101.f90 @@ -130,7 +130,8 @@ subroutine osd240_101(llr,k,apmask,ndeep,message101,cw,nhardmin,dmin) npre2=0 nt=0 - if(ndeep.eq.0) goto 998 ! norder=0 + nord=0 + if(ndeep.le.0) goto 998 ! norder=0 if(ndeep.gt.6) ndeep=6 if( ndeep.eq. 1) then nord=1 @@ -401,4 +402,3 @@ subroutine fetchit101(reset,e2,ntau,i1,i2) lastpat=ipat return end subroutine fetchit101 - diff --git a/lib/fst4/osd240_74.f90 b/lib/fst4/osd240_74.f90 index a54e767b..74cb1a0e 100644 --- a/lib/fst4/osd240_74.f90 +++ b/lib/fst4/osd240_74.f90 @@ -130,7 +130,8 @@ subroutine osd240_74(llr,k,apmask,ndeep,message74,cw,nhardmin,dmin) npre2=0 nt=0 - if(ndeep.eq.0) goto 998 ! norder=0 + nord=0 + if(ndeep.le.0) goto 998 ! norder=0 if(ndeep.gt.6) ndeep=6 if( ndeep.eq. 1) then nord=1 @@ -401,4 +402,3 @@ subroutine fetchit74(reset,e2,ntau,i1,i2) lastpat=ipat return end subroutine fetchit74 - diff --git a/lib/fst4_decode.f90 b/lib/fst4_decode.f90 index 0e7d8d67..83cf11f9 100644 --- a/lib/fst4_decode.f90 +++ b/lib/fst4_decode.f90 @@ -80,7 +80,8 @@ contains data rvec/0,1,0,0,1,0,1,0,0,1,0,1,1,1,1,0,1,0,0,0,1,0,0,1,1,0,1,1,0, & 1,0,0,1,0,1,1,0,0,0,0,1,0,0,0,1,0,1,0,0,1,1,1,1,0,0,1,0,1, & 0,1,0,1,0,1,1,0,1,1,1,1,1,0,0,0,1,0,1/ - data first/.true./,hmod/1/ + data first/.true./,hmod/1/,fcbest/0.0/ + save first,apbits,nappasses,naptypes,mycall0,hiscall0 save wcalls,nwcalls @@ -327,7 +328,8 @@ contains call timer('dwnsmpl ',1) call timer('sync240 ',0) - call fst4_sync_search(c2,nfft2,hmod,fs2,nss,ntrperiod,nsyncoh,emedelay,sbest,fcbest,isbest) + call fst4_sync_search(c2,nfft2,hmod,fs2,nss,ntrperiod,nsyncoh, & + emedelay,sbest,fcbest,isbest) call timer('sync240 ',1) fc_synced = fc0 + fcbest @@ -876,9 +878,11 @@ contains return end subroutine get_candidates_fst4 - subroutine fst4_sync_search(c2,nfft2,hmod,fs2,nss,ntrperiod,nsyncoh,emedelay,sbest,fcbest,isbest) + subroutine fst4_sync_search(c2,nfft2,hmod,fs2,nss,ntrperiod,nsyncoh, & + emedelay,sbest,fcbest,isbest) complex c2(0:nfft2-1) integer hmod + nspsec=int(fs2) baud=fs2/real(nss) fc1=0.0 diff --git a/lib/ft2/cdatetime.f90 b/lib/ft2/cdatetime.f90 deleted file mode 100644 index 33deaf30..00000000 --- a/lib/ft2/cdatetime.f90 +++ /dev/null @@ -1,6 +0,0 @@ -character*17 function cdatetime() - character cdate*8,ctime*10 - call date_and_time(cdate,ctime) - cdatetime=cdate(3:8)//'_'//ctime - return -end function cdatetime diff --git a/lib/ft2/ft2.f90 b/lib/ft2/ft2.f90 deleted file mode 100644 index e5c389f9..00000000 --- a/lib/ft2/ft2.f90 +++ /dev/null @@ -1,279 +0,0 @@ -program ft2 - - use packjt77 - include 'gcom1.f90' - integer ft2audio,ptt - logical allok - character*20 pttport - character*8 arg - character*80 fname - integer*2 id2(30000) - - open(12,file='all_ft2.txt',status='unknown',position='append') - nargs=iargc() - if(nargs.eq.1) then - call getarg(1,fname) - open(10,file=fname,status='old',access='stream') - read(10) id2(1:22) !Read (and ignore) the header - read(10) id2 !Read the Rx data - close(10) - call ft2_decode(fname(1:17),nfqso,id2,ndecodes,mycall,hiscall,nrx) - go to 999 - endif - - allok=.true. -! Get home-station details - open(10,file='ft2.ini',status='old',err=1) - go to 2 -1 print*,'Cannot open ft2.ini' - allok=.false. -2 read(10,*,err=3) mycall,mygrid,ndevin,ndevout,pttport,exch - go to 4 -3 print*,'Error reading ft2.ini' - allok=.false. -4 if(index(pttport,'/').lt.1) read(pttport,*) nport - hiscall=' ' - hiscall_next=' ' - idevin=ndevin - idevout=ndevout - call padevsub(idevin,idevout) - if(idevin.ne.ndevin .or. idevout.ne.ndevout) allok=.false. - i1=0 - i1=ptt(nport,1,1,iptt) - i1=ptt(nport,1,0,iptt) - if(i1.lt.0 .and. nport.ne.0) allok=.false. - if(.not.allok) then - write(*,"('Please fix setup error(s) and restart.')") - go to 999 - endif - - nright=1 - iwrite=0 - iwave=0 - nwave=NTZ - nfsample=12000 - ngo=1 - npabuf=1152 - ntxok=0 - ntransmitting=0 - tx_once=.false. - snrdb=99.0 - txmsg='CQ K1JT FN20' - ltx=.false. - lrx=.false. - autoseq=.false. - QSO_in_progress=.false. - ntxed=0 - - if(nargs.eq.3) then - call getarg(1,txmsg) - call getarg(2,arg) - read(arg,*) f0 - call getarg(3,arg) - read(arg,*) snrdb - tx_once=.true. - ftx=1500.0 - call transmit(-1,ftx,iptt) - snrdb=99.0 - endif - -! Start the audio streams - ierr=ft2audio(idevin,idevout,npabuf,nright,y1,y2,NRING,iwrite,itx, & - iwave,nwave+3*1152,nfsample,nTxOK,nTransmitting,ngo) - if(ierr.ne.0) then - print*,'Error',ierr,' starting audio input and/or output.' - endif - -999 end program ft2 - -subroutine update(total_time,ic1,ic2) - - use wavhdr - type(hdr) h - real*8 total_time - integer*8 count0,count1,clkfreq - integer ptt - integer*2 id(30000) - logical transmitted,level,ok - character*70 line - character cdatetime*17,fname*17,mode*8,band*6 - include 'gcom1.f90' - data nt0/-1/,transmitted/.false./,snr/-99.0/ - data level/.false./ - save nt0,transmitted,level,snr,iptt - - if(ic1.ne.0 .or. ic2.ne.0) then - if(ic1.eq.27 .and. ic2.eq.0) ngo=0 !ESC - if(nTxOK.eq.0 .and. ntransmitting.eq.0) then - nfunc=0 - if(ic1.eq.0 .and. ic2.eq.59) nfunc=1 !F1 - if(ic1.eq.0 .and. ic2.eq.60) nfunc=2 !F2 - if(ic1.eq.0 .and. ic2.eq.61) nfunc=3 !F3 - if(ic1.eq.0 .and. ic2.eq.62) nfunc=4 !F4 - if(ic1.eq.0 .and. ic2.eq.63) nfunc=5 !F5 - if(nfunc.eq.1 .or. (nfunc.ge.2 .and. hiscall.ne.' ')) then - ftx=1500.0 - call transmit(nfunc,ftx,iptt) - endif - endif - if(ic1.eq.13 .and. ic2.eq.0) hiscall=hiscall_next - if((ic1.eq.97 .or. ic1.eq.65) .and. ic2.eq.0) autoseq=.not.autoseq - if((ic1.eq.108 .or. ic1.eq.76) .and. ic2.eq.0) level=.not.level - endif - - if(ntransmitting.eq.1) transmitted=.true. - if(transmitted .and. ntransmitting.eq.0) then - i1=0 - if(iptt.eq.1 .and. nport.gt.0) i1=ptt(nport,0,1,iptt) - if(tx_once .and. transmitted) stop - transmitted=.false. - endif - - nt=2*total_time - if(nt.gt.nt0 .or. ic1.ne.0 .or. ic2.ne.0) then - if(level) then -! Measure and display the average level of signal plus noise in past 0.5 s - k=iwrite-6000 - if(k.lt.1) k=k+NRING - sq=0. - do i=1,6000 - k=k+1 - if(k.gt.NRING) k=k-NRING - x=y1(k) - sq=sq + x*x - enddo - sigdb=0. - if(sq.gt.0.0) sigdb=db(sq/6000.0) - n=sigdb - if(n.lt.1) n=1 - if(n.gt.70) n=70 - line=' ' - line(n:n)='*' - write(*,1030) sigdb,ntxed,autoseq,QSO_in_progress,(line(i:i),i=1,n) -1030 format(f4.1,i3,2L2,1x,70a1) -! write(*,1020) nt,total_time,iwrite,itx,ntxok,ntransmitting,ndecodes, & -! snr,sigdb,line -!1020 format(i6,f9.3,i10,i6,3i3,f6.0,f6.1,1x,a30) - endif - k=iwrite-30000 - if(k.lt.1) k=k+NRING - do i=1,30000 - k=k+1 - if(k.gt.NRING) k=k-NRING - id(i)=y1(k) - enddo - nutc=0 - nfqso=1500 - ndecodes=0 - if(maxval(abs(id)).gt.0) then - call system_clock(count0,clkfreq) - nrx=-1 - call ft2_decode(cdatetime(),nfqso,id,ndecodes,mycall,hiscall,nrx) - call system_clock(count1,clkfreq) -! tdecode=float(count1-count0)/float(clkfreq) - - if(ndecodes.ge.1) then - fMHz=7.074 - mode='FT2' - nsubmode=1 - ntrperiod=0 - h=default_header(12000,30000) - k=0 - do i=1,250 - sq=0 - do n=1,120 - k=k+1 - x=id(k) - sq=sq + x*x - enddo - write(43,3043) i,0.01*i,1.e-4*sq -3043 format(i7,f12.6,f12.3) - enddo - call set_wsjtx_wav_params(fMHz,mode,nsubmode,ntrperiod,id) - band="" - mode="" - nsubmode=-1 - ntrperiod=-1 - call get_wsjtx_wav_params(id,band,mode,nsubmode,ntrperiod,ok) -! write(*,1010) band,ntrperiod,mode,char(ichar('A')-1+id(3)) -!1010 format('Band: ',a6,' T/R period:',i4,' Mode: ',a8,1x,a1) - - fname=cdatetime() - fname(14:17)='.wav' - open(13,file=fname,status='unknown',access='stream') - write(13) h,id - close(13) - endif - if(autoseq .and.nrx.eq.2) QSO_in_progress=.true. - if(autoseq .and. QSO_in_progress .and. nrx.ge.1 .and. nrx.le.4) then - lrx(nrx)=.true. - ftx=1500.0 - if(ntxed.eq.1) then - if(nrx.eq.2) then - call transmit(3,ftx,iptt) - else - call transmit(1,ftx,iptt) - endif - endif - if(ntxed.eq.2) then - if(nrx.eq.3) then - call transmit(4,ftx,iptt) - QSO_in_progress=.false. - write(*,1032) -1032 format('QSO complete: S+P side') - else - call transmit(2,ftx,iptt) - endif - endif - if(ntxed.eq.3) then - if(nrx.eq.4) then - QSO_in_progress=.false. - write(*,1034) -1034 format('QSO complete: CQ side') - else - call transmit(3,ftx,iptt) - endif - endif - endif - endif - nt0=nt - endif - - return -end subroutine update - -character*17 function cdatetime() - character cdate*8,ctime*10 - call date_and_time(cdate,ctime) - cdatetime=cdate(3:8)//'_'//ctime - return -end function cdatetime - -subroutine transmit(nfunc,ftx,iptt) - include 'gcom1.f90' - character*17 cdatetime - integer ptt - - if(nTxOK.eq.1) return - - if(nfunc.eq.1) txmsg='CQ '//trim(mycall)//' '//mygrid - if(nfunc.eq.2) txmsg=trim(hiscall)//' '//trim(mycall)// & - ' 559 '//trim(exch) - if(nfunc.eq.3) txmsg=trim(hiscall)//' '//trim(mycall)// & - ' R 559 '//trim(exch) - if(nfunc.eq.4) txmsg=trim(hiscall)//' '//trim(mycall)//' RR73' - if(nfunc.eq.5) txmsg='TNX 73 GL' - call ft2_iwave(txmsg,ftx,snrdb,iwave) - iwave(23041:)=0 - i1=ptt(nport,1,1,iptt) - ntxok=1 - n=len(trim(txmsg)) - write(*,1010) cdatetime(),0,0.0,nint(ftx),(txmsg(i:i),i=1,n) - write(12,1010) cdatetime(),0,0.0,nint(ftx),(txmsg(i:i),i=1,n) -1010 format(a17,i4,f6.2,i5,' Tx ',37a1) - if(nfunc.ge.1 .and. nfunc.le.4) ntxed=nfunc - if(nfunc.ge.1 .and. nfunc.le.5) ltx(nfunc)=.true. - if(nfunc.eq.2 .or. nfunc.eq.3) QSO_in_progress=.true. - - return -end subroutine transmit diff --git a/lib/ft2/ft2.ini b/lib/ft2/ft2.ini deleted file mode 100644 index d66770d1..00000000 --- a/lib/ft2/ft2.ini +++ /dev/null @@ -1,2 +0,0 @@ -K1JT FN20 1 5 0 NJ -MyCall MyGrid AudioIn AudioOut PTTport Exch diff --git a/lib/ft2/ft2_decode.f90 b/lib/ft2/ft2_decode.f90 deleted file mode 100644 index 1d1bb6a5..00000000 --- a/lib/ft2/ft2_decode.f90 +++ /dev/null @@ -1,298 +0,0 @@ -subroutine ft2_decode(cdatetime0,nfqso,iwave,ndecodes,mycall,hiscall,nrx,line) - - use crc - use packjt77 - include 'ft2_params.f90' - character message*37,c77*77 - character*61 line - character*37 decodes(100) - character*120 data_dir - character*17 cdatetime0,cdatetime - character*6 mycall,hiscall,hhmmss - complex c2(0:NMAX/16-1) !Complex waveform - complex cb(0:NMAX/16-1) - complex cd(0:144*10-1) !Complex waveform - complex c1(0:9),c0(0:9) - complex ccor(0:1,144) - complex csum,cterm,cc0,cc1,csync1 - real*8 fMHz - - real a(5) - real rxdata(128),llr(128) !Soft symbols - real llr2(128) - real sbits(144),sbits1(144),sbits3(144) - real ps(0:8191),psbest(0:8191) - real candidate(3,100) - real savg(NH1) - integer*2 iwave(NMAX) !Generated full-length waveform - integer*1 message77(77),apmask(128),cw(128) - integer*1 hbits(144),hbits1(144),hbits3(144) - integer*1 s16(16) - logical unpk77_success - data s16/0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0/ - - hhmmss=cdatetime0(8:13) - fs=12000.0/NDOWN !Sample rate - dt=1/fs !Sample interval after downsample (s) - tt=NSPS*dt !Duration of "itone" symbols (s) - baud=1.0/tt !Keying rate for "itone" symbols (baud) - txt=NZ*dt !Transmission length (s) - twopi=8.0*atan(1.0) - h=0.8 !h=0.8 seems to be optimum for AWGN sensitivity (not for fading) - - dphi=twopi/2*baud*h*dt*16 ! dt*16 is samp interval after downsample - dphi0=-1*dphi - dphi1=+1*dphi - phi0=0.0 - phi1=0.0 - do i=0,9 - c1(i)=cmplx(cos(phi1),sin(phi1)) - c0(i)=cmplx(cos(phi0),sin(phi0)) - phi1=mod(phi1+dphi1,twopi) - phi0=mod(phi0+dphi0,twopi) - enddo - the=twopi*h/2.0 - cc1=cmplx(cos(the),-sin(the)) - cc0=cmplx(cos(the),sin(the)) - - data_dir="." - fMHz=7.074 - ncoh=1 - candidate=0.0 - ncand=0 - fa=375.0 - fb=3000.0 - syncmin=0.2 - maxcand=100 - nfqso=-1 - call getcandidates2a(iwave,fa,fb,maxcand,savg,candidate,ncand) - ndecodes=0 - do icand=1,ncand - f0=candidate(1,icand) - if( f0.le.375.0 .or. f0.ge.(5000.0-375.0) ) cycle - call ft2_downsample(iwave,f0,c2) ! downsample from 160s/Symbol to 10s/Symbol -! 750 samples/second here - ibest=-1 - sybest=-99. - dfbest=-1. -!### do if=-15,+15 - do if=-30,30 - df=if - a=0. - a(1)=-df - call twkfreq1(c2,NMAX/16,fs,a,cb) - do is=0,374 !DT search range is 0 - 0.5 s - csync1=0. - cterm=1 - do ib=1,16 - i1=(ib-1)*10+is - i2=i1+136*10 - if(s16(ib).eq.1) then - csync1=csync1+sum(cb(i1:i1+9)*conjg(c1(0:9)))*cterm - cterm=cterm*cc1 - else - csync1=csync1+sum(cb(i1:i1+9)*conjg(c0(0:9)))*cterm - cterm=cterm*cc0 - endif - enddo - if(abs(csync1).gt.sybest) then - ibest=is - sybest=abs(csync1) - dfbest=df - endif - enddo - enddo - - a=0. - a(1)=-dfbest - call twkfreq1(c2,NMAX/16,fs,a,cb) - ib=ibest - cd=cb(ib:ib+144*10-1) - s2=sum(real(cd*conjg(cd)))/(10*144) - cd=cd/sqrt(s2) - do nseq=1,5 - if( nseq.eq.1 ) then ! noncoherent single-symbol detection - sbits1=0.0 - do ibit=1,144 - ib=(ibit-1)*10 - ccor(1,ibit)=sum(cd(ib:ib+9)*conjg(c1(0:9))) - ccor(0,ibit)=sum(cd(ib:ib+9)*conjg(c0(0:9))) - sbits1(ibit)=abs(ccor(1,ibit))-abs(ccor(0,ibit)) - hbits1(ibit)=0 - if(sbits1(ibit).gt.0) hbits1(ibit)=1 - enddo - sbits=sbits1 - hbits=hbits1 - sbits3=sbits1 - hbits3=hbits1 - elseif( nseq.ge.2 ) then - nbit=2*nseq-1 - numseq=2**(nbit) - ps=0 - do ibit=nbit/2+1,144-nbit/2 - ps=0.0 - pmax=0.0 - do iseq=0,numseq-1 - csum=0.0 - cterm=1.0 - k=1 - do i=nbit-1,0,-1 - ibb=iand(iseq/(2**i),1) - csum=csum+ccor(ibb,ibit-(nbit/2+1)+k)*cterm - if(ibb.eq.0) cterm=cterm*cc0 - if(ibb.eq.1) cterm=cterm*cc1 - k=k+1 - enddo - ps(iseq)=abs(csum) - if( ps(iseq) .gt. pmax ) then - pmax=ps(iseq) - ibflag=1 - endif - enddo - if( ibflag .eq. 1 ) then - psbest=ps - ibflag=0 - endif - call getbitmetric(2**(nbit/2),psbest,numseq,sbits3(ibit)) - hbits3(ibit)=0 - if(sbits3(ibit).gt.0) hbits3(ibit)=1 - enddo - sbits=sbits3 - hbits=hbits3 - endif - nsync_qual=count(hbits(1:16).eq.s16) - if(nsync_qual.lt.10) exit - rxdata=sbits(17:144) - rxav=sum(rxdata(1:128))/128.0 - rx2av=sum(rxdata(1:128)*rxdata(1:128))/128.0 - rxsig=sqrt(rx2av-rxav*rxav) - rxdata=rxdata/rxsig - sigma=0.80 - llr(1:128)=2*rxdata/(sigma*sigma) - apmask=0 - max_iterations=40 - do ibias=0,0 - llr2=llr - if(ibias.eq.1) llr2=llr+0.4 - if(ibias.eq.2) llr2=llr-0.4 - call bpdecode128_90(llr2,apmask,max_iterations,message77,cw,nharderror,niterations) - if(nharderror.ge.0) exit - enddo - nhardmin=-1 - if(sum(message77).eq.0) cycle - if( nharderror.ge.0 ) then - write(c77,'(77i1)') message77(1:77) - call unpack77(c77,nrx,message,unpk77_success) - idupe=0 - do i=1,ndecodes - if(decodes(i).eq.message) idupe=1 - enddo - if(idupe.eq.1) exit - ndecodes=ndecodes+1 - decodes(ndecodes)=message - xsnr=db(sybest*sybest) - 115.0 !### Rough estimate of S/N ### - nsnr=nint(xsnr) - freq=f0+dfbest - write(line,1000) hhmmss,nsnr,ibest/750.0,nint(freq),message -1000 format(a6,i4,f5.2,i5,' + ',1x,a37) - open(24,file='all_ft2.txt',status='unknown',position='append') - write(24,1002) cdatetime0,nsnr,ibest/750.0,nint(freq),message, & - nseq,nharderror,nhardmin - if(hhmmss.eq.' ') write(*,1002) cdatetime0,nsnr, & - ibest/750.0,nint(freq),message,nseq,nharderror,nhardmin -1002 format(a17,i4,f6.2,i5,' Rx ',a37,3i5) - close(24) - -!### Temporary: assume most recent decoded message conveys "hiscall". - i0=index(message,' ') - if(i0.ge.3 .and. i0.le.7) then - hiscall=message(i0+1:i0+6) - i1=index(hiscall,' ') - if(i1.gt.0) hiscall=hiscall(1:i1) - endif - nrx=-1 - if(index(message,'CQ ').eq.1) nrx=1 - if((index(message,trim(mycall)//' ').eq.1) .and. & - (index(message,' '//trim(hiscall)//' ').ge.4)) then - if(index(message,' 559 ').gt.8) nrx=2 - if(index(message,' R 559 ').gt.8) nrx=3 - if(index(message,' RR73 ').gt.8) nrx=4 - endif -!### - exit - endif - enddo ! nseq - enddo !candidate list - - return -end subroutine ft2_decode - -subroutine getbitmetric(ib,ps,ns,xmet) - real ps(0:ns-1) - xm1=0 - xm0=0 - do i=0,ns-1 - if( iand(i/ib,1) .eq. 1 .and. ps(i) .gt. xm1 ) xm1=ps(i) - if( iand(i/ib,1) .eq. 0 .and. ps(i) .gt. xm0 ) xm0=ps(i) - enddo - xmet=xm1-xm0 - return -end subroutine getbitmetric - -subroutine downsample2(ci,f0,co) - parameter(NI=144*160,NH=NI/2,NO=NI/16) ! downsample from 200 samples per symbol to 10 - complex ci(0:NI-1),ct(0:NI-1) - complex co(0:NO-1) - fs=12000.0 - df=fs/NI - ct=ci - call four2a(ct,NI,1,-1,1) !c2c FFT to freq domain - i0=nint(f0/df) - ct=cshift(ct,i0) - co=0.0 - co(0)=ct(0) - b=8.0 - do i=1,NO/2 - arg=(i*df/b)**2 - filt=exp(-arg) - co(i)=ct(i)*filt - co(NO-i)=ct(NI-i)*filt - enddo - co=co/NO - call four2a(co,NO,1,1,1) !c2c FFT back to time domain - return -end subroutine downsample2 - -subroutine ft2_downsample(iwave,f0,c) - -! Input: i*2 data in iwave() at sample rate 12000 Hz -! Output: Complex data in c(), sampled at 1200 Hz - - include 'ft2_params.f90' - parameter (NFFT2=NMAX/16) - integer*2 iwave(NMAX) - complex c(0:NMAX/16-1) - complex c1(0:NFFT2-1) - complex cx(0:NMAX/2) - real x(NMAX) - equivalence (x,cx) - - BW=4.0*75 - df=12000.0/NMAX - x=iwave - call four2a(x,NMAX,1,-1,0) !r2c FFT to freq domain - ibw=nint(BW/df) - i0=nint(f0/df) - c1=0. - c1(0)=cx(i0) - do i=1,NFFT2/2 - arg=(i-1)*df/bw - win=exp(-arg*arg) - c1(i)=cx(i0+i)*win - c1(NFFT2-i)=cx(i0-i)*win - enddo - c1=c1/NFFT2 - call four2a(c1,NFFT2,1,1,1) !c2c FFT back to time domain - c=c1(0:NMAX/16-1) - return -end subroutine ft2_downsample diff --git a/lib/ft2/ft2_gfsk_iwave.f90 b/lib/ft2/ft2_gfsk_iwave.f90 deleted file mode 100644 index 2611eca0..00000000 --- a/lib/ft2/ft2_gfsk_iwave.f90 +++ /dev/null @@ -1,88 +0,0 @@ -subroutine ft2_gfsk_iwave(msg37,f0,snrdb,iwave) - -! Generate waveform for experimental "FT2" mode - - use packjt77 - include 'ft2_params.f90' !Set various constants - parameter (NWAVE=(NN+2)*NSPS) - character msg37*37,msgsent37*37 - real wave(NWAVE),xnoise(NWAVE) - real dphi(NWAVE) - real pulse(480) - - integer itone(NN) - integer*2 iwave(NWAVE) !Generated full-length waveform - logical first - data first/.true./ - save pulse - - twopi=8.0*atan(1.0) - fs=12000.0 !Sample rate (Hz) - dt=1.0/fs !Sample interval (s) - hmod=0.8 !Modulation index (MSK=0.5, FSK=1.0) - tt=NSPS*dt !Duration of symbols (s) - baud=1.0/tt !Keying rate (baud) - bw=1.5*baud !Occupied bandwidth (Hz) - txt=NZ*dt !Transmission length (s) - bandwidth_ratio=2500.0/(fs/2.0) -! sig=sqrt(2*bandwidth_ratio) * 10.0**(0.05*snrdb) -! if(snrdb.gt.90.0) sig=1.0 - txt=NN*NSPS/12000.0 - - if(first) then -! The filtered frequency pulse - do i=1,480 - tt=(i-240.5)/160.0 - pulse(i)=gfsk_pulse(1.0,tt) - enddo - dphi_peak=twopi*(hmod/2.0)/real(NSPS) - first=.false. - endif - -! Source-encode, then get itone(): - itype=1 - call genft2(msg37,0,msgsent37,itone,itype) - -! Create the instantaneous frequency waveform - dphi=0.0 - do j=1,NN - ib=(j-1)*160+1 - ie=ib+480-1 - dphi(ib:ie)=dphi(ib:ie)+dphi_peak*pulse*(2*itone(j)-1) - enddo - - phi=0.0 - wave=0.0 - sqrt2=sqrt(2.) - dphi=dphi+twopi*f0*dt - do j=1,NWAVE - wave(j)=sqrt2*sin(phi) - sqsig=sqsig + wave(j)**2 - phi=mod(phi+dphi(j),twopi) - enddo - wave(1:160)=wave(1:160)*(1.0-cos(twopi*(/(i,i=0,159)/)/320.0) )/2.0 - wave(145*160+1:146*160)=wave(145*160+1:146*160)*(1.0+cos(twopi*(/(i,i=0,159)/)/320.0 ))/2.0 - wave(146*160+1:)=0. - - if(snrdb.gt.90.0) then - iwave=nint((32767.0/sqrt(2.0))*wave) - return - endif - - sqnoise=1.e-30 - if(snrdb.lt.90) then - do i=1,NWAVE !Add gaussian noise at specified SNR - xnoise(i)=gran() !Noise has rms = 1.0 - enddo - endif - xnoise=xnoise*sqrt(0.5*fs/2500.0) - fac=30.0 - snr_amplitude=10.0**(0.05*snrdb) - wave=fac*(snr_amplitude*wave + xnoise) - datpk=maxval(abs(wave)) - print*,'A',snr_amplitude,datpk - - iwave=nint((30000.0/datpk)*wave) - - return -end subroutine ft2_gfsk_iwave diff --git a/lib/ft2/ft2_iwave.f90 b/lib/ft2/ft2_iwave.f90 deleted file mode 100644 index 10b9908d..00000000 --- a/lib/ft2/ft2_iwave.f90 +++ /dev/null @@ -1,64 +0,0 @@ -subroutine ft2_iwave(msg37,f0,snrdb,iwave) - -! Generate waveform for experimental "FT2" mode - - use packjt77 - include 'ft2_params.f90' !Set various constants - parameter (NWAVE=NN*NSPS) - character msg37*37,msgsent37*37 - real wave(NWAVE),xnoise(NWAVE) - integer itone(NN) - integer*2 iwave(NWAVE) !Generated full-length waveform - - twopi=8.0*atan(1.0) - fs=12000.0 !Sample rate (Hz) - dt=1.0/fs !Sample interval (s) - hmod=0.8 !Modulation index (MSK=0.5, FSK=1.0) - tt=NSPS*dt !Duration of symbols (s) - baud=1.0/tt !Keying rate (baud) - bw=1.5*baud !Occupied bandwidth (Hz) - txt=NZ*dt !Transmission length (s) - bandwidth_ratio=2500.0/(fs/2.0) -! sig=sqrt(2*bandwidth_ratio) * 10.0**(0.05*snrdb) -! if(snrdb.gt.90.0) sig=1.0 - txt=NN*NSPS/12000.0 - -! Source-encode, then get itone(): - itype=1 - call genft2(msg37,0,msgsent37,itone,itype) - - k=0 - phi=0.0 - sqsig=0. - do j=1,NN !Generate real waveform - dphi=twopi*(f0*dt+(hmod/2.0)*(2*itone(j)-1)/real(NSPS)) - do i=1,NSPS - k=k+1 - wave(k)=sqrt(2.0)*sin(phi) !Signal has rms = 1.0 - sqsig=sqsig + wave(k)**2 - phi=mod(phi+dphi,twopi) - enddo - enddo - - if(snrdb.gt.90.0) then - iwave=nint((32767.0/sqrt(2.0))*wave) - return - endif - - sqnoise=1.e-30 - if(snrdb.lt.90) then - do i=1,NWAVE !Add gaussian noise at specified SNR - xnoise(i)=gran() !Noise has rms = 1.0 - enddo - endif - xnoise=xnoise*sqrt(0.5*fs/2500.0) - fac=30.0 - snr_amplitude=10.0**(0.05*snrdb) - wave=fac*(snr_amplitude*wave + xnoise) - datpk=maxval(abs(wave)) - print*,'A',snr_amplitude,datpk - - iwave=nint((30000.0/datpk)*wave) - - return -end subroutine ft2_iwave diff --git a/lib/ft2/ft2_params.f90 b/lib/ft2/ft2_params.f90 deleted file mode 100644 index 4751e47e..00000000 --- a/lib/ft2/ft2_params.f90 +++ /dev/null @@ -1,12 +0,0 @@ -! LDPC (128,90) code -parameter (KK=90) !Information bits (77 + CRC13) -parameter (ND=128) !Data symbols -parameter (NS=16) !Sync symbols (2x8) -parameter (NN=NS+ND) !Total channel symbols (144) -parameter (NSPS=160) !Samples per symbol at 12000 S/s -parameter (NZ=NSPS*NN) !Samples in full 1.92 s waveform (23040) -parameter (NMAX=30000) !Samples in iwave (2.5*12000) -parameter (NFFT1=400, NH1=NFFT1/2) !Length of FFTs for symbol spectra -parameter (NSTEP=NSPS/4) !Rough time-sync step size -parameter (NHSYM=NMAX/NSTEP-3) !Number of symbol spectra (1/4-sym steps) -parameter (NDOWN=16) !Downsample factor diff --git a/lib/ft2/ft2audio.c b/lib/ft2/ft2audio.c deleted file mode 100644 index b5f19fa4..00000000 --- a/lib/ft2/ft2audio.c +++ /dev/null @@ -1,347 +0,0 @@ -#include -#include "portaudio.h" -#include -#include - -int iaa; -int icc; -double total_time=0.0; - -// Definition of structure pointing to the audio data -typedef struct -{ - int *iwrite; - int *itx; - int *TxOK; - int *Transmitting; - int *nwave; - int *nright; - int nring; - int nfs; - short *y1; - short *y2; - short *iwave; -} paTestData; - -// Input callback routine: -static int -SoundIn( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, - const PaStreamCallbackTimeInfo* timeInfo, - PaStreamCallbackFlags statusFlags, - void *userData ) -{ - paTestData *data = (paTestData*)userData; - short *in = (short*)inputBuffer; - unsigned int i; - static int ia=0; - - if(*data->Transmitting) return 0; - - if(statusFlags!=0) printf("Status flags %d\n",(int)statusFlags); - - if((statusFlags&1) == 0) { - //increment buffer pointers only if data available - ia=*data->iwrite; - if(*data->nright==0) { //Use left channel for input - for(i=0; iy1[ia] = (*in++); - data->y2[ia] = (*in++); - ia++; - } - } else { //Use right channel - for(i=0; iy2[ia] = (*in++); - data->y1[ia] = (*in++); - ia++; - } - } - } - - if(ia >= data->nring) ia=0; //Wrap buffer pointer if necessary - *data->iwrite = ia; //Save buffer pointer - iaa=ia; - total_time += (double)framesPerBuffer/12000.0; - // printf("iwrite: %d\n",*data->iwrite); - return 0; -} - -// Output callback routine: -static int -SoundOut( void *inputBuffer, void *outputBuffer, - unsigned long framesPerBuffer, - const PaStreamCallbackTimeInfo* timeInfo, - PaStreamCallbackFlags statusFlags, - void *userData ) -{ - paTestData *data = (paTestData*)userData; - short *wptr = (short*)outputBuffer; - unsigned int i,n; - static short int n2; - static int ic=0; - static int TxOKz=0; - static clock_t tstart=-1; - static clock_t tend=-1; - static int nsent=0; - - // printf("txOK: %d %d\n",TxOKz,*data->TxOK); - - if(*data->TxOK && (!TxOKz)) ic=0; //Reset buffer pointer to start Tx - *data->Transmitting=*data->TxOK; //Set the "transmitting" flag - - if(*data->TxOK) { - if(!TxOKz) { - // Start of a transmission - tstart=clock(); - nsent=0; - // printf("Start Tx\n"); - } - TxOKz=*data->TxOK; - for(i=0 ; i < framesPerBuffer; i++ ) { - n2=data->iwave[ic]; - *wptr++ = n2; //left - *wptr++ = n2; //right - ic++; - - if(ic > *data->nwave) { - *data->TxOK = 0; - *data->Transmitting = 0; - *data->iwrite = 0; //Reset Rx buffer pointer to 0 - ic=0; - tend=clock(); - double TxT=((double)(tend-tstart))/CLOCKS_PER_SEC; - // printf("End Tx, TxT = %f nSent = %d\n",TxT,nsent); - break; - } - } - nsent += framesPerBuffer; - } else { - memset((void*)outputBuffer, 0, 2*sizeof(short)*framesPerBuffer); - } - *data->itx = icc; //Save buffer pointer - icc=ic; - return 0; -} - -/*******************************************************************/ -int ft2audio_(int *ndevin, int *ndevout, int *npabuf, int *nright, - short y1[], short y2[], int *nring, int *iwrite, - int *itx, short iwave[], int *nwave, int *nfsample, - int *TxOK, int *Transmitting, int *ngo) - -{ - paTestData data; - PaStream *instream, *outstream; - PaStreamParameters inputParameters, outputParameters; - // PaStreamInfo *streamInfo; - - int nfpb = *npabuf; - int nSampleRate = *nfsample; - int ndevice_in = *ndevin; - int ndevice_out = *ndevout; - double dSampleRate = (double) *nfsample; - PaError err_init, err_open_in, err_open_out, err_start_in, err_start_out; - PaError err = 0; - - data.iwrite = iwrite; - data.itx = itx; - data.TxOK = TxOK; - data.Transmitting = Transmitting; - data.y1 = y1; - data.y2 = y2; - data.nring = *nring; - data.nright = nright; - data.nwave = nwave; - data.iwave = iwave; - data.nfs = nSampleRate; - - err_init = Pa_Initialize(); // Initialize PortAudio - - if(err_init) { - printf("Error initializing PortAudio.\n"); - printf("\tErrortext: %s\n\tNumber: %d\n",Pa_GetErrorText(err_init), - err_init); - Pa_Terminate(); // I don't think we need this but... - return(-1); - } - - // printf("Opening device %d for input, %d for output...\n", - // ndevice_in,ndevice_out); - - inputParameters.device = ndevice_in; - inputParameters.channelCount = 2; - inputParameters.sampleFormat = paInt16; - inputParameters.suggestedLatency = 0.2; - inputParameters.hostApiSpecificStreamInfo = NULL; - -// Test if this configuration actually works, so we do not run into an -// ugly assertion - err_open_in = Pa_IsFormatSupported(&inputParameters, NULL, dSampleRate); - - if (err_open_in == 0) { - err_open_in = Pa_OpenStream( - &instream, //address of stream - &inputParameters, - NULL, - dSampleRate, //Sample rate - nfpb, //Frames per buffer - paNoFlag, - (PaStreamCallback *)SoundIn, //Callback routine - (void *)&data); //address of data structure - - if(err_open_in) { // We should have no error here usually - printf("Error opening input audio stream:\n"); - printf("\tErrortext: %s\n\tNumber: %d\n",Pa_GetErrorText(err_open_in), - err_open_in); - err = 1; - } else { - // printf("Successfully opened audio input.\n"); - } - } else { - printf("Error opening input audio stream.\n"); - printf("\tErrortext: %s\n\tNumber: %d\n",Pa_GetErrorText(err_open_in), - err_open_in); - err = 1; - } - - outputParameters.device = ndevice_out; - outputParameters.channelCount = 2; - outputParameters.sampleFormat = paInt16; - outputParameters.suggestedLatency = 0.2; - outputParameters.hostApiSpecificStreamInfo = NULL; - -// Test if this configuration actually works, so we do not run into an -// ugly assertion. - err_open_out = Pa_IsFormatSupported(NULL, &outputParameters, dSampleRate); - - if (err_open_out == 0) { - err_open_out = Pa_OpenStream( - &outstream, //address of stream - NULL, - &outputParameters, - dSampleRate, //Sample rate - nfpb, //Frames per buffer - paNoFlag, - (PaStreamCallback *)SoundOut, //Callback routine - (void *)&data); //address of data structure - - if(err_open_out) { // We should have no error here usually - printf("Error opening output audio stream!\n"); - printf("\tErrortext: %s\n\tNumber: %d\n",Pa_GetErrorText(err_open_out), - err_open_out); - err += 2; - } else { - // printf("Successfully opened audio output.\n"); - } - } else { - printf("Error opening output audio stream.\n"); - printf("\tErrortext: %s\n\tNumber: %d\n",Pa_GetErrorText(err_open_out), - err_open_out); - err += 2; - } - - // if there was no error in opening both streams start them - if (err == 0) { - err_start_in = Pa_StartStream(instream); //Start input stream - if(err_start_in) { - printf("Error starting input audio stream!\n"); - printf("\tErrortext: %s\n\tNumber: %d\n",Pa_GetErrorText(err_start_in), - err_start_in); - err += 4; - } - - err_start_out = Pa_StartStream(outstream); //Start output stream - if(err_start_out) { - printf("Error starting output audio stream!\n"); - printf("\tErrortext: %s\n\tNumber: %d\n",Pa_GetErrorText(err_start_out), - err_start_out); - err += 8; - } - } - - if (err == 0) printf("Audio streams running normally.\n******************************************************************\n"); - - while( Pa_IsStreamActive(instream) && (*ngo != 0) && (err == 0) ) { - int ic1=0; - int ic2=0; - if(_kbhit()) ic1 = _getch(); - if(_kbhit()) ic2 = _getch(); - // if(ic1!=0 || ic2!=0) printf("%d %d %d\n",iaa,ic1,ic2); - update_(&total_time,&ic1,&ic2); - Pa_Sleep(100); - } - - Pa_AbortStream(instream); // Abort stream - Pa_CloseStream(instream); // Close stream, we're done. - Pa_AbortStream(outstream); // Abort stream - Pa_CloseStream(outstream); // Close stream, we're done. - - Pa_Terminate(); - - return(err); -} - - -int padevsub_(int *idevin, int *idevout) -{ - int numdev,ndefin,ndefout; - int nchin[101], nchout[101]; - int i, devIdx; - int numDevices; - const PaDeviceInfo *pdi; - PaError err; - - Pa_Initialize(); - numDevices = Pa_GetDeviceCount(); - numdev = numDevices; - - if( numDevices < 0 ) { - err = numDevices; - Pa_Terminate(); - return err; - } - - if ((devIdx = Pa_GetDefaultInputDevice()) > 0) { - ndefin = devIdx; - } else { - ndefin = 0; - } - - if ((devIdx = Pa_GetDefaultOutputDevice()) > 0) { - ndefout = devIdx; - } else { - ndefout = 0; - } - - printf("\nAudio Input Output Device Name\n"); - printf("Device Channels Channels\n"); - printf("------------------------------------------------------------------\n"); - - for( i=0; i < numDevices; i++ ) { - pdi = Pa_GetDeviceInfo(i); -// if(i == Pa_GetDefaultInputDevice()) ndefin = i; -// if(i == Pa_GetDefaultOutputDevice()) ndefout = i; - nchin[i]=pdi->maxInputChannels; - nchout[i]=pdi->maxOutputChannels; - printf(" %2d %2d %2d %s\n",i,nchin[i],nchout[i], - pdi->name); - } - - printf("\nUser requested devices: Input = %2d Output = %2d\n", - *idevin,*idevout); - printf("Default devices: Input = %2d Output = %2d\n", - ndefin,ndefout); - if((*idevin<0) || (*idevin>=numdev)) *idevin=ndefin; - if((*idevout<0) || (*idevout>=numdev)) *idevout=ndefout; - if((*idevin==0) && (*idevout==0)) { - *idevin=ndefin; - *idevout=ndefout; - } - printf("Will open devices: Input = %2d Output = %2d\n", - *idevin,*idevout); - - Pa_Terminate(); - - return 0; -} - diff --git a/lib/ft2/g4.cmd b/lib/ft2/g4.cmd deleted file mode 100644 index 0894dbeb..00000000 --- a/lib/ft2/g4.cmd +++ /dev/null @@ -1,7 +0,0 @@ -gcc -c ft2audio.c -gcc -c ptt.c -gfortran -c ../77bit/packjt77.f90 -gfortran -c ../wavhdr.f90 -gfortran -c ../crc.f90 -gfortran -o ft2 -fbounds-check -fno-second-underscore -ffpe-trap=invalid,zero -Wall -Wno-conversion -Wno-character-truncation ft2.f90 ft2_iwave.f90 ft2_decode.f90 getcandidates2.f90 ft2audio.o ptt.o /JTSDK/wsjtx-output/qt55/2.1.0/Release/build/libwsjt_fort.a /JTSDK/wsjtx-output/qt55/2.1.0/Release/build/libwsjt_cxx.a libportaudio.a ../libfftw3f_win.a -lwinmm -rm *.o *.mod diff --git a/lib/ft2/gcom1.f90 b/lib/ft2/gcom1.f90 deleted file mode 100644 index 9402f9d9..00000000 --- a/lib/ft2/gcom1.f90 +++ /dev/null @@ -1,34 +0,0 @@ -! Variable Purpose -!--------------------------------------------------------------------------- -integer NRING !Length of Rx ring buffer -integer NTZ !Length of Tx waveform in samples -parameter(NRING=230400) !Ring buffer at 12000 samples/sec -parameter(NTZ=23040) !144*160 -parameter(NMAX=30000) !2.5*12000 -real snrdb -integer ndevin !Device# for audio input -integer ndevout !Device# for audio output -integer iwrite !Pointer to Rx ring buffer -integer itx !Pointer to Tx buffer -integer ngo !Set to 0 to terminate audio streams -integer nTransmitting !Actually transmitting? -integer nTxOK !OK to transmit? -integer nport !COM port for PTT -logical tx_once !Transmit one message, then exit -logical ltx !True if msg i has been transmitted -logical lrx !True if msg i has been received -logical autoseq -logical QSO_in_progress -integer*2 y1 !Ring buffer for audio channel 0 -integer*2 y2 !Ring buffer for audio channel 1 -integer*2 iwave !Data for Tx audio -character*6 mycall -character*6 hiscall -character*6 hiscall_next -character*4 mygrid -character*3 exch -character*37 txmsg - -common/gcom1/snrdb,ndevin,ndevout,iwrite,itx,ngo,nTransmitting,nTxOK,nport, & - ntxed,tx_once,y1(NRING),y2(NRING),iwave(NTZ+3*1152),ltx(5),lrx(5), & - autoseq,QSO_in_progress,mycall,hiscall,hiscall_next,mygrid,exch,txmsg diff --git a/lib/ft2/genft2.f90 b/lib/ft2/genft2.f90 deleted file mode 100644 index 2eb36bcc..00000000 --- a/lib/ft2/genft2.f90 +++ /dev/null @@ -1,86 +0,0 @@ -subroutine genft2(msg0,ichk,msgsent,i4tone,itype) -! s8 + 48bits + s8 + 80 bits = 144 bits (72ms message duration) -! -! Encode an MSK144 message -! Input: -! - msg0 requested message to be transmitted -! - ichk if ichk=1, return only msgsent -! if ichk.ge.10000, set imsg=ichk-10000 for short msg -! - msgsent message as it will be decoded -! - i4tone array of audio tone values, 0 or 1 -! - itype message type -! 1 = 77 bit message -! 7 = 16 bit message " Rpt" - - use iso_c_binding, only: c_loc,c_size_t - use packjt77 - character*37 msg0 - character*37 message !Message to be generated - character*37 msgsent !Message as it will be received - character*77 c77 - integer*4 i4tone(144) - integer*1 codeword(128) - integer*1 msgbits(77) - integer*1 bitseq(144) !Tone #s, data and sync (values 0-1) - integer*1 s16(16) - real*8 xi(864),xq(864),pi,twopi - data s16/0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0/ - equivalence (ihash,i1hash) - logical unpk77_success - - nsym=128 - pi=4.0*atan(1.0) - twopi=8.*atan(1.0) - - message(1:37)=' ' - itype=1 - if(msg0(1:1).eq.'@') then !Generate a fixed tone - read(msg0(2:5),*,end=1,err=1) nfreq !at specified frequency - go to 2 -1 nfreq=1000 -2 i4tone(1)=nfreq - else - message=msg0 - - do i=1, 37 - if(ichar(message(i:i)).eq.0) then - message(i:37)=' ' - exit - endif - enddo - do i=1,37 !Strip leading blanks - if(message(1:1).ne.' ') exit - message=message(i+1:) - enddo - - if(message(1:1).eq.'<') then - i2=index(message,'>') - i1=0 - if(i2.gt.0) i1=index(message(1:i2),' ') - if(i1.gt.0) then - call genmsk40(message,msgsent,ichk,i4tone,itype) - if(itype.lt.0) go to 999 - i4tone(41)=-40 - go to 999 - endif - endif - - i3=-1 - n3=-1 - call pack77(message,i3,n3,c77) - call unpack77(c77,0,msgsent,unpk77_success) !Unpack to get msgsent - - if(ichk.eq.1) go to 999 - read(c77,"(77i1)") msgbits - call encode_128_90(msgbits,codeword) - -!Create 144-bit channel vector: - bitseq=0 - bitseq(1:16)=s16 - bitseq(17:144)=codeword - - i4tone=bitseq - endif - -999 return -end subroutine genft2 diff --git a/lib/ft2/getcandidates2a.f90 b/lib/ft2/getcandidates2a.f90 deleted file mode 100644 index 8e7209c9..00000000 --- a/lib/ft2/getcandidates2a.f90 +++ /dev/null @@ -1,64 +0,0 @@ -subroutine getcandidates2a(id,fa,fb,maxcand,savg,candidate,ncand) - -! For now, hardwired to find the largest peak in the average spectrum - - include 'ft2_params.f90' - real s(NH1,NHSYM) - real savg(NH1),savsm(NH1) - real x(NFFT1) - complex cx(0:NH1) - real candidate(3,100) - integer*2 id(NMAX) - integer*1 s8(8) - integer indx(NH1) - data s8/0,1,1,1,0,0,1,0/ - equivalence (x,cx) - -! Compute symbol spectra, stepping by NSTEP steps. - savg=0. - tstep=NSTEP/12000.0 - df=12000.0/NFFT1 !3.125 Hz - fac=1.0/300.0 - do j=1,NHSYM - ia=(j-1)*NSTEP + 1 - ib=ia+NSPS-1 - x(1:NSPS)=fac*id(ia:ib) - x(NSPS+1:)=0. - call four2a(x,NFFT1,1,-1,0) !r2c FFT - do i=1,NH1 - s(i,j)=real(cx(i))**2 + aimag(cx(i))**2 - enddo - savg=savg + s(1:NH1,j) !Average spectrum - enddo - savsm=0. - do i=2,NH1-1 - savsm(i)=sum(savg(i-1:i+1))/3. - enddo - savsm(1)=savg(1) - savsm(NH1)=savg(NH1) - - nfa=nint(fa/df) - nfb=nint(fb/df) - np=nfb-nfa+1 - indx=0 - call indexx(savsm(nfa:nfb),np,indx) - xn=savsm(nfa+indx(nint(0.3*np))) - if(xn.ne.0) savsm=savsm/xn - imax=-1 - xmax=-99. - do i=2,NH1-1 - if(savsm(i).gt.savsm(i-1).and. & - savsm(i).gt.savsm(i+1).and. & - savsm(i).gt.xmax) then - xmax=savsm(i) - imax=i - endif - enddo - f0=imax*df - if(xmax.gt.1.2) then - if(ncand.lt.maxcand) ncand=ncand+1 - candidate(1,ncand)=f0 - endif - - return -end subroutine getcandidates2a diff --git a/lib/ft2/gfsk_pulse.f90 b/lib/ft2/gfsk_pulse.f90 deleted file mode 100644 index 99ab78e3..00000000 --- a/lib/ft2/gfsk_pulse.f90 +++ /dev/null @@ -1,6 +0,0 @@ -real function gfsk_pulse(b,t) - pi=4.*atan(1.0) - c=pi*sqrt(2.0/log(2.0)) - gfsk_pulse=0.5*(erf(c*b*(t+0.5))-erf(c*b*(t-0.5))) - return -end function gfsk_pulse diff --git a/lib/ft2/libportaudio.a b/lib/ft2/libportaudio.a deleted file mode 100644 index f20f02c1..00000000 Binary files a/lib/ft2/libportaudio.a and /dev/null differ diff --git a/lib/ft2/libwsjt_cxx.a b/lib/ft2/libwsjt_cxx.a deleted file mode 100644 index d10d509c..00000000 Binary files a/lib/ft2/libwsjt_cxx.a and /dev/null differ diff --git a/lib/ft2/libwsjt_fort.a b/lib/ft2/libwsjt_fort.a deleted file mode 100644 index 7884c85b..00000000 Binary files a/lib/ft2/libwsjt_fort.a and /dev/null differ diff --git a/lib/ft2/portaudio.h b/lib/ft2/portaudio.h deleted file mode 100644 index 250fba02..00000000 --- a/lib/ft2/portaudio.h +++ /dev/null @@ -1,1123 +0,0 @@ - -#ifndef PORTAUDIO_H -#define PORTAUDIO_H -/* - * $Id: portaudio.h,v 1.1 2005/11/29 21:27:24 joe Exp $ - * PortAudio Portable Real-Time Audio Library - * PortAudio API Header File - * Latest version available at: http://www.portaudio.com/ - * - * Copyright (c) 1999-2002 Ross Bencina and Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** @file - @brief The PortAudio API. -*/ - - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - - -/** Retrieve the release number of the currently running PortAudio build, - eg 1900. -*/ -int Pa_GetVersion( void ); - - -/** Retrieve a textual description of the current PortAudio build, - eg "PortAudio V19-devel 13 October 2002". -*/ -const char* Pa_GetVersionText( void ); - - -/** Error codes returned by PortAudio functions. - Note that with the exception of paNoError, all PaErrorCodes are negative. -*/ - -typedef int PaError; -typedef enum PaErrorCode -{ - paNoError = 0, - - paNotInitialized = -10000, - paUnanticipatedHostError, - paInvalidChannelCount, - paInvalidSampleRate, - paInvalidDevice, - paInvalidFlag, - paSampleFormatNotSupported, - paBadIODeviceCombination, - paInsufficientMemory, - paBufferTooBig, - paBufferTooSmall, - paNullCallback, - paBadStreamPtr, - paTimedOut, - paInternalError, - paDeviceUnavailable, - paIncompatibleHostApiSpecificStreamInfo, - paStreamIsStopped, - paStreamIsNotStopped, - paInputOverflowed, - paOutputUnderflowed, - paHostApiNotFound, - paInvalidHostApi, - paCanNotReadFromACallbackStream, /**< @todo review error code name */ - paCanNotWriteToACallbackStream, /**< @todo review error code name */ - paCanNotReadFromAnOutputOnlyStream, /**< @todo review error code name */ - paCanNotWriteToAnInputOnlyStream, /**< @todo review error code name */ - paIncompatibleStreamHostApi -} PaErrorCode; - - -/** Translate the supplied PortAudio error code into a human readable - message. -*/ -const char *Pa_GetErrorText( PaError errorCode ); - - -/** Library initialization function - call this before using PortAudio. - This function initialises internal data structures and prepares underlying - host APIs for use. This function MUST be called before using any other - PortAudio API functions. - - If Pa_Initialize() is called multiple times, each successful - call must be matched with a corresponding call to Pa_Terminate(). - Pairs of calls to Pa_Initialize()/Pa_Terminate() may overlap, and are not - required to be fully nested. - - Note that if Pa_Initialize() returns an error code, Pa_Terminate() should - NOT be called. - - @return paNoError if successful, otherwise an error code indicating the cause - of failure. - - @see Pa_Terminate -*/ -PaError Pa_Initialize( void ); - - -/** Library termination function - call this when finished using PortAudio. - This function deallocates all resources allocated by PortAudio since it was - initializied by a call to Pa_Initialize(). In cases where Pa_Initialise() has - been called multiple times, each call must be matched with a corresponding call - to Pa_Terminate(). The final matching call to Pa_Terminate() will automatically - close any PortAudio streams that are still open. - - Pa_Terminate() MUST be called before exiting a program which uses PortAudio. - Failure to do so may result in serious resource leaks, such as audio devices - not being available until the next reboot. - - @return paNoError if successful, otherwise an error code indicating the cause - of failure. - - @see Pa_Initialize -*/ -PaError Pa_Terminate( void ); - - - -/** The type used to refer to audio devices. Values of this type usually - range from 0 to (Pa_DeviceCount-1), and may also take on the PaNoDevice - and paUseHostApiSpecificDeviceSpecification values. - - @see Pa_DeviceCount, paNoDevice, paUseHostApiSpecificDeviceSpecification -*/ -typedef int PaDeviceIndex; - - -/** A special PaDeviceIndex value indicating that no device is available, - or should be used. - - @see PaDeviceIndex -*/ -#define paNoDevice ((PaDeviceIndex)-1) - - -/** A special PaDeviceIndex value indicating that the device(s) to be used - are specified in the host api specific stream info structure. - - @see PaDeviceIndex -*/ -#define paUseHostApiSpecificDeviceSpecification ((PaDeviceIndex)-2) - - -/* Host API enumeration mechanism */ - -/** The type used to enumerate to host APIs at runtime. Values of this type - range from 0 to (Pa_GetHostApiCount()-1). - - @see Pa_GetHostApiCount -*/ -typedef int PaHostApiIndex; - - -/** Retrieve the number of available host APIs. Even if a host API is - available it may have no devices available. - - @return A non-negative value indicating the number of available host APIs - or, a PaErrorCode (which are always negative) if PortAudio is not initialized - or an error is encountered. - - @see PaHostApiIndex -*/ -PaHostApiIndex Pa_GetHostApiCount( void ); - - -/** Retrieve the index of the default host API. The default host API will be - the lowest common denominator host API on the current platform and is - unlikely to provide the best performance. - - @return A non-negative value ranging from 0 to (Pa_GetHostApiCount()-1) - indicating the default host API index or, a PaErrorCode (which are always - negative) if PortAudio is not initialized or an error is encountered. -*/ -PaHostApiIndex Pa_GetDefaultHostApi( void ); - - -/** Unchanging unique identifiers for each supported host API. This type - is used in the PaHostApiInfo structure. The values are guaranteed to be - unique and to never change, thus allowing code to be written that - conditionally uses host API specific extensions. - - New type ids will be allocated when support for a host API reaches - "public alpha" status, prior to that developers should use the - paInDevelopment type id. - - @see PaHostApiInfo -*/ -typedef enum PaHostApiTypeId -{ - paInDevelopment=0, /* use while developing support for a new host API */ - paDirectSound=1, - paMME=2, - paASIO=3, - paSoundManager=4, - paCoreAudio=5, - paOSS=7, - paALSA=8, - paAL=9, - paBeOS=10, - paWDMKS=11, - paJACK=12 -} PaHostApiTypeId; - - -/** A structure containing information about a particular host API. */ - -typedef struct PaHostApiInfo -{ - /** this is struct version 1 */ - int structVersion; - /** The well known unique identifier of this host API @see PaHostApiTypeId */ - PaHostApiTypeId type; - /** A textual description of the host API for display on user interfaces. */ - const char *name; - - /** The number of devices belonging to this host API. This field may be - used in conjunction with Pa_HostApiDeviceIndexToDeviceIndex() to enumerate - all devices for this host API. - @see Pa_HostApiDeviceIndexToDeviceIndex - */ - int deviceCount; - - /** The the default input device for this host API. The value will be a - device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice - if no default input device is available. - */ - PaDeviceIndex defaultInputDevice; - - /** The the default output device for this host API. The value will be a - device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice - if no default output device is available. - */ - PaDeviceIndex defaultOutputDevice; - -} PaHostApiInfo; - - -/** Retrieve a pointer to a structure containing information about a specific - host Api. - - @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) - - @return A pointer to an immutable PaHostApiInfo structure describing - a specific host API. If the hostApi parameter is out of range or an error - is encountered, the function returns NULL. - - The returned structure is owned by the PortAudio implementation and must not - be manipulated or freed. The pointer is only guaranteed to be valid between - calls to Pa_Initialize() and Pa_Terminate(). -*/ -const PaHostApiInfo * Pa_GetHostApiInfo( PaHostApiIndex hostApi ); - - -/** Convert a static host API unique identifier, into a runtime - host API index. - - @param type A unique host API identifier belonging to the PaHostApiTypeId - enumeration. - - @return A valid PaHostApiIndex ranging from 0 to (Pa_GetHostApiCount()-1) or, - a PaErrorCode (which are always negative) if PortAudio is not initialized - or an error is encountered. - - The paHostApiNotFound error code indicates that the host API specified by the - type parameter is not available. - - @see PaHostApiTypeId -*/ -PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type ); - - -/** Convert a host-API-specific device index to standard PortAudio device index. - This function may be used in conjunction with the deviceCount field of - PaHostApiInfo to enumerate all devices for the specified host API. - - @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) - - @param hostApiDeviceIndex A valid per-host device index in the range - 0 to (Pa_GetHostApiInfo(hostApi)->deviceCount-1) - - @return A non-negative PaDeviceIndex ranging from 0 to (Pa_GetDeviceCount()-1) - or, a PaErrorCode (which are always negative) if PortAudio is not initialized - or an error is encountered. - - A paInvalidHostApi error code indicates that the host API index specified by - the hostApi parameter is out of range. - - A paInvalidDevice error code indicates that the hostApiDeviceIndex parameter - is out of range. - - @see PaHostApiInfo -*/ -PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex( PaHostApiIndex hostApi, - int hostApiDeviceIndex ); - - - -/** Structure used to return information about a host error condition. -*/ -typedef struct PaHostErrorInfo{ - PaHostApiTypeId hostApiType; /**< the host API which returned the error code */ - long errorCode; /**< the error code returned */ - const char *errorText; /**< a textual description of the error if available, otherwise a zero-length string */ -}PaHostErrorInfo; - - -/** Return information about the last host error encountered. The error - information returned by Pa_GetLastHostErrorInfo() will never be modified - asyncronously by errors occurring in other PortAudio owned threads - (such as the thread that manages the stream callback.) - - This function is provided as a last resort, primarily to enhance debugging - by providing clients with access to all available error information. - - @return A pointer to an immutable structure constaining information about - the host error. The values in this structure will only be valid if a - PortAudio function has previously returned the paUnanticipatedHostError - error code. -*/ -const PaHostErrorInfo* Pa_GetLastHostErrorInfo( void ); - - - -/* Device enumeration and capabilities */ - -/** Retrieve the number of available devices. The number of available devices - may be zero. - - @return A non-negative value indicating the number of available devices or, - a PaErrorCode (which are always negative) if PortAudio is not initialized - or an error is encountered. -*/ -PaDeviceIndex Pa_GetDeviceCount( void ); - - -/** Retrieve the index of the default input device. The result can be - used in the inputDevice parameter to Pa_OpenStream(). - - @return The default input device index for the default host API, or paNoDevice - if no default input device is available or an error was encountered. -*/ -PaDeviceIndex Pa_GetDefaultInputDevice( void ); - - -/** Retrieve the index of the default output device. The result can be - used in the outputDevice parameter to Pa_OpenStream(). - - @return The default output device index for the defualt host API, or paNoDevice - if no default output device is available or an error was encountered. - - @note - On the PC, the user can specify a default device by - setting an environment variable. For example, to use device #1. -
- set PA_RECOMMENDED_OUTPUT_DEVICE=1
-
- The user should first determine the available device ids by using - the supplied application "pa_devs". -*/ -PaDeviceIndex Pa_GetDefaultOutputDevice( void ); - - -/** The type used to represent monotonic time in seconds that can be used - for syncronisation. The type is used for the outTime argument to the - PaStreamCallback and as the result of Pa_GetStreamTime(). - - @see PaStreamCallback, Pa_GetStreamTime -*/ -typedef double PaTime; - - -/** A type used to specify one or more sample formats. Each value indicates - a possible format for sound data passed to and from the stream callback, - Pa_ReadStream and Pa_WriteStream. - - The standard formats paFloat32, paInt16, paInt32, paInt24, paInt8 - and aUInt8 are usually implemented by all implementations. - - The floating point representation (paFloat32) uses +1.0 and -1.0 as the - maximum and minimum respectively. - - paUInt8 is an unsigned 8 bit format where 128 is considered "ground" - - The paNonInterleaved flag indicates that a multichannel buffer is passed - as a set of non-interleaved pointers. - - @see Pa_OpenStream, Pa_OpenDefaultStream, PaDeviceInfo - @see paFloat32, paInt16, paInt32, paInt24, paInt8 - @see paUInt8, paCustomFormat, paNonInterleaved -*/ -typedef unsigned long PaSampleFormat; - - -#define paFloat32 ((PaSampleFormat) 0x00000001) /**< @see PaSampleFormat */ -#define paInt32 ((PaSampleFormat) 0x00000002) /**< @see PaSampleFormat */ -#define paInt24 ((PaSampleFormat) 0x00000004) /**< Packed 24 bit format. @see PaSampleFormat */ -#define paInt16 ((PaSampleFormat) 0x00000008) /**< @see PaSampleFormat */ -#define paInt8 ((PaSampleFormat) 0x00000010) /**< @see PaSampleFormat */ -#define paUInt8 ((PaSampleFormat) 0x00000020) /**< @see PaSampleFormat */ -#define paCustomFormat ((PaSampleFormat) 0x00010000)/**< @see PaSampleFormat */ - -#define paNonInterleaved ((PaSampleFormat) 0x80000000) - -/** A structure providing information and capabilities of PortAudio devices. - Devices may support input, output or both input and output. -*/ -typedef struct PaDeviceInfo -{ - int structVersion; /* this is struct version 2 */ - const char *name; - PaHostApiIndex hostApi; /* note this is a host API index, not a type id*/ - - int maxInputChannels; - int maxOutputChannels; - - /* Default latency values for interactive performance. */ - PaTime defaultLowInputLatency; - PaTime defaultLowOutputLatency; - /* Default latency values for robust non-interactive applications (eg. playing sound files). */ - PaTime defaultHighInputLatency; - PaTime defaultHighOutputLatency; - - double defaultSampleRate; -} PaDeviceInfo; - - -/** Retrieve a pointer to a PaDeviceInfo structure containing information - about the specified device. - @return A pointer to an immutable PaDeviceInfo structure. If the device - parameter is out of range the function returns NULL. - - @param device A valid device index in the range 0 to (Pa_GetDeviceCount()-1) - - @note PortAudio manages the memory referenced by the returned pointer, - the client must not manipulate or free the memory. The pointer is only - guaranteed to be valid between calls to Pa_Initialize() and Pa_Terminate(). - - @see PaDeviceInfo, PaDeviceIndex -*/ -const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceIndex device ); - - -/** Parameters for one direction (input or output) of a stream. -*/ -typedef struct PaStreamParameters -{ - /** A valid device index in the range 0 to (Pa_GetDeviceCount()-1) - specifying the device to be used or the special constant - paUseHostApiSpecificDeviceSpecification which indicates that the actual - device(s) to use are specified in hostApiSpecificStreamInfo. - This field must not be set to paNoDevice. - */ - PaDeviceIndex device; - - /** The number of channels of sound to be delivered to the - stream callback or accessed by Pa_ReadStream() or Pa_WriteStream(). - It can range from 1 to the value of maxInputChannels in the - PaDeviceInfo record for the device specified by the device parameter. - */ - int channelCount; - - /** The sample format of the buffer provided to the stream callback, - a_ReadStream() or Pa_WriteStream(). It may be any of the formats described - by the PaSampleFormat enumeration. - */ - PaSampleFormat sampleFormat; - - /** The desired latency in seconds. Where practical, implementations should - configure their latency based on these parameters, otherwise they may - choose the closest viable latency instead. Unless the suggested latency - is greater than the absolute upper limit for the device implementations - shouldround the suggestedLatency up to the next practial value - ie to - provide an equal or higher latency than suggestedLatency whereever possibe. - Actual latency values for an open stream may be retrieved using the - inputLatency and outputLatency fields of the PaStreamInfo structure - returned by Pa_GetStreamInfo(). - @see default*Latency in PaDeviceInfo, *Latency in PaStreamInfo - */ - PaTime suggestedLatency; - - /** An optional pointer to a host api specific data structure - containing additional information for device setup and/or stream processing. - hostApiSpecificStreamInfo is never required for correct operation, - if not used it should be set to NULL. - */ - void *hostApiSpecificStreamInfo; - -} PaStreamParameters; - - -/** Return code for Pa_IsFormatSupported indicating success. */ -#define paFormatIsSupported (0) - -/** Determine whether it would be possible to open a stream with the specified - parameters. - - @param inputParameters A structure that describes the input parameters used to - open a stream. The suggestedLatency field is ignored. See PaStreamParameters - for a description of these parameters. inputParameters must be NULL for - output-only streams. - - @param outputParameters A structure that describes the output parameters used - to open a stream. The suggestedLatency field is ignored. See PaStreamParameters - for a description of these parameters. outputParameters must be NULL for - input-only streams. - - @param sampleRate The required sampleRate. For full-duplex streams it is the - sample rate for both input and output - - @return Returns 0 if the format is supported, and an error code indicating why - the format is not supported otherwise. The constant paFormatIsSupported is - provided to compare with the return value for success. - - @see paFormatIsSupported, PaStreamParameters -*/ -PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate ); - - - -/* Streaming types and functions */ - - -/** - A single PaStream can provide multiple channels of real-time - streaming audio input and output to a client application. A stream - provides access to audio hardware represented by one or more - PaDevices. Depending on the underlying Host API, it may be possible - to open multiple streams using the same device, however this behavior - is implementation defined. Portable applications should assume that - a PaDevice may be simultaneously used by at most one PaStream. - - Pointers to PaStream objects are passed between PortAudio functions that - operate on streams. - - @see Pa_OpenStream, Pa_OpenDefaultStream, Pa_OpenDefaultStream, Pa_CloseStream, - Pa_StartStream, Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive, - Pa_GetStreamTime, Pa_GetStreamCpuLoad - -*/ -typedef void PaStream; - - -/** Can be passed as the framesPerBuffer parameter to Pa_OpenStream() - or Pa_OpenDefaultStream() to indicate that the stream callback will - accept buffers of any size. -*/ -#define paFramesPerBufferUnspecified (0) - - -/** Flags used to control the behavior of a stream. They are passed as - parameters to Pa_OpenStream or Pa_OpenDefaultStream. Multiple flags may be - ORed together. - - @see Pa_OpenStream, Pa_OpenDefaultStream - @see paNoFlag, paClipOff, paDitherOff, paNeverDropInput, - paPrimeOutputBuffersUsingStreamCallback, paPlatformSpecificFlags -*/ -typedef unsigned long PaStreamFlags; - -/** @see PaStreamFlags */ -#define paNoFlag ((PaStreamFlags) 0) - -/** Disable default clipping of out of range samples. - @see PaStreamFlags -*/ -#define paClipOff ((PaStreamFlags) 0x00000001) - -/** Disable default dithering. - @see PaStreamFlags -*/ -#define paDitherOff ((PaStreamFlags) 0x00000002) - -/** Flag requests that where possible a full duplex stream will not discard - overflowed input samples without calling the stream callback. This flag is - only valid for full duplex callback streams and only when used in combination - with the paFramesPerBufferUnspecified (0) framesPerBuffer parameter. Using - this flag incorrectly results in a paInvalidFlag error being returned from - Pa_OpenStream and Pa_OpenDefaultStream. - - @see PaStreamFlags, paFramesPerBufferUnspecified -*/ -#define paNeverDropInput ((PaStreamFlags) 0x00000004) - -/** Call the stream callback to fill initial output buffers, rather than the - default behavior of priming the buffers with zeros (silence). This flag has - no effect for input-only and blocking read/write streams. - - @see PaStreamFlags -*/ -#define paPrimeOutputBuffersUsingStreamCallback ((PaStreamFlags) 0x00000008) - -/** A mask specifying the platform specific bits. - @see PaStreamFlags -*/ -#define paPlatformSpecificFlags ((PaStreamFlags)0xFFFF0000) - -/** - Timing information for the buffers passed to the stream callback. -*/ -typedef struct PaStreamCallbackTimeInfo{ - PaTime inputBufferAdcTime; - PaTime currentTime; - PaTime outputBufferDacTime; -} PaStreamCallbackTimeInfo; - - -/** - Flag bit constants for the statusFlags to PaStreamCallback. - - @see paInputUnderflow, paInputOverflow, paOutputUnderflow, paOutputOverflow, - paPrimingOutput -*/ -typedef unsigned long PaStreamCallbackFlags; - -/** In a stream opened with paFramesPerBufferUnspecified, indicates that - input data is all silence (zeros) because no real data is available. In a - stream opened without paFramesPerBufferUnspecified, it indicates that one or - more zero samples have been inserted into the input buffer to compensate - for an input underflow. - @see PaStreamCallbackFlags -*/ -#define paInputUnderflow ((PaStreamCallbackFlags) 0x00000001) - -/** In a stream opened with paFramesPerBufferUnspecified, indicates that data - prior to the first sample of the input buffer was discarded due to an - overflow, possibly because the stream callback is using too much CPU time. - Otherwise indicates that data prior to one or more samples in the - input buffer was discarded. - @see PaStreamCallbackFlags -*/ -#define paInputOverflow ((PaStreamCallbackFlags) 0x00000002) - -/** Indicates that output data (or a gap) was inserted, possibly because the - stream callback is using too much CPU time. - @see PaStreamCallbackFlags -*/ -#define paOutputUnderflow ((PaStreamCallbackFlags) 0x00000004) - -/** Indicates that output data will be discarded because no room is available. - @see PaStreamCallbackFlags -*/ -#define paOutputOverflow ((PaStreamCallbackFlags) 0x00000008) - -/** Some of all of the output data will be used to prime the stream, input - data may be zero. - @see PaStreamCallbackFlags -*/ -#define paPrimingOutput ((PaStreamCallbackFlags) 0x00000010) - -/** - Allowable return values for the PaStreamCallback. - @see PaStreamCallback -*/ -typedef enum PaStreamCallbackResult -{ - paContinue=0, - paComplete=1, - paAbort=2 -} PaStreamCallbackResult; - - -/** - Functions of type PaStreamCallback are implemented by PortAudio clients. - They consume, process or generate audio in response to requests from an - active PortAudio stream. - - @param input and @param output are arrays of interleaved samples, - the format, packing and number of channels used by the buffers are - determined by parameters to Pa_OpenStream(). - - @param frameCount The number of sample frames to be processed by - the stream callback. - - @param timeInfo The time in seconds when the first sample of the input - buffer was received at the audio input, the time in seconds when the first - sample of the output buffer will begin being played at the audio output, and - the time in seconds when the stream callback was called. - See also Pa_GetStreamTime() - - @param statusFlags Flags indicating whether input and/or output buffers - have been inserted or will be dropped to overcome underflow or overflow - conditions. - - @param userData The value of a user supplied pointer passed to - Pa_OpenStream() intended for storing synthesis data etc. - - @return - The stream callback should return one of the values in the - PaStreamCallbackResult enumeration. To ensure that the callback continues - to be called, it should return paContinue (0). Either paComplete or paAbort - can be returned to finish stream processing, after either of these values is - returned the callback will not be called again. If paAbort is returned the - stream will finish as soon as possible. If paComplete is returned, the stream - will continue until all buffers generated by the callback have been played. - This may be useful in applications such as soundfile players where a specific - duration of output is required. However, it is not necessary to utilise this - mechanism as Pa_StopStream(), Pa_AbortStream() or Pa_CloseStream() can also - be used to stop the stream. The callback must always fill the entire output - buffer irrespective of its return value. - - @see Pa_OpenStream, Pa_OpenDefaultStream - - @note With the exception of Pa_GetStreamCpuLoad() it is not permissable to call - PortAudio API functions from within the stream callback. -*/ -typedef int PaStreamCallback( - const void *input, void *output, - unsigned long frameCount, - const PaStreamCallbackTimeInfo* timeInfo, - PaStreamCallbackFlags statusFlags, - void *userData ); - - -/** Opens a stream for either input, output or both. - - @param stream The address of a PaStream pointer which will receive - a pointer to the newly opened stream. - - @param inputParameters A structure that describes the input parameters used by - the opened stream. See PaStreamParameters for a description of these parameters. - inputParameters must be NULL for output-only streams. - - @param outputParameters A structure that describes the output parameters used by - the opened stream. See PaStreamParameters for a description of these parameters. - outputParameters must be NULL for input-only streams. - - @param sampleRate The desired sampleRate. For full-duplex streams it is the - sample rate for both input and output - - @param framesPerBuffer The number of frames passed to the stream callback - function, or the preferred block granularity for a blocking read/write stream. - The special value paFramesPerBufferUnspecified (0) may be used to request that - the stream callback will recieve an optimal (and possibly varying) number of - frames based on host requirements and the requested latency settings. - Note: With some host APIs, the use of non-zero framesPerBuffer for a callback - stream may introduce an additional layer of buffering which could introduce - additional latency. PortAudio guarantees that the additional latency - will be kept to the theoretical minimum however, it is strongly recommended - that a non-zero framesPerBuffer value only be used when your algorithm - requires a fixed number of frames per stream callback. - - @param streamFlags Flags which modify the behaviour of the streaming process. - This parameter may contain a combination of flags ORed together. Some flags may - only be relevant to certain buffer formats. - - @param streamCallback A pointer to a client supplied function that is responsible - for processing and filling input and output buffers. If this parameter is NULL - the stream will be opened in 'blocking read/write' mode. In blocking mode, - the client can receive sample data using Pa_ReadStream and write sample data - using Pa_WriteStream, the number of samples that may be read or written - without blocking is returned by Pa_GetStreamReadAvailable and - Pa_GetStreamWriteAvailable respectively. - - @param userData A client supplied pointer which is passed to the stream callback - function. It could for example, contain a pointer to instance data necessary - for processing the audio buffers. This parameter is ignored if streamCallback - is NULL. - - @return - Upon success Pa_OpenStream() returns paNoError and places a pointer to a - valid PaStream in the stream argument. The stream is inactive (stopped). - If a call to Pa_OpenStream() fails, a non-zero error code is returned (see - PaError for possible error codes) and the value of stream is invalid. - - @see PaStreamParameters, PaStreamCallback, Pa_ReadStream, Pa_WriteStream, - Pa_GetStreamReadAvailable, Pa_GetStreamWriteAvailable -*/ -PaError Pa_OpenStream( PaStream** stream, - const PaStreamParameters *inputParameters, - const PaStreamParameters *outputParameters, - double sampleRate, - unsigned long framesPerBuffer, - PaStreamFlags streamFlags, - PaStreamCallback *streamCallback, - void *userData ); - - -/** A simplified version of Pa_OpenStream() that opens the default input - and/or output devices. - - @param stream The address of a PaStream pointer which will receive - a pointer to the newly opened stream. - - @param numInputChannels The number of channels of sound that will be supplied - to the stream callback or returned by Pa_ReadStream. It can range from 1 to - the value of maxInputChannels in the PaDeviceInfo record for the default input - device. If 0 the stream is opened as an output-only stream. - - @param numOutputChannels The number of channels of sound to be delivered to the - stream callback or passed to Pa_WriteStream. It can range from 1 to the value - of maxOutputChannels in the PaDeviceInfo record for the default output dvice. - If 0 the stream is opened as an output-only stream. - - @param sampleFormat The sample format of both the input and output buffers - provided to the callback or passed to and from Pa_ReadStream and Pa_WriteStream. - sampleFormat may be any of the formats described by the PaSampleFormat - enumeration. - - @param sampleRate Same as Pa_OpenStream parameter of the same name. - @param framesPerBuffer Same as Pa_OpenStream parameter of the same name. - @param streamCallback Same as Pa_OpenStream parameter of the same name. - @param userData Same as Pa_OpenStream parameter of the same name. - - @return As for Pa_OpenStream - - @see Pa_OpenStream, PaStreamCallback -*/ -PaError Pa_OpenDefaultStream( PaStream** stream, - int numInputChannels, - int numOutputChannels, - PaSampleFormat sampleFormat, - double sampleRate, - unsigned long framesPerBuffer, - PaStreamCallback *streamCallback, - void *userData ); - - -/** Closes an audio stream. If the audio stream is active it - discards any pending buffers as if Pa_AbortStream() had been called. -*/ -PaError Pa_CloseStream( PaStream *stream ); - - -/** Functions of type PaStreamFinishedCallback are implemented by PortAudio - clients. They can be registered with a stream using the Pa_SetStreamFinishedCallback - function. Once registered they are called when the stream becomes inactive - (ie once a call to Pa_StopStream() will not block). - A stream will become inactive after the stream callback returns non-zero, - or when Pa_StopStream or Pa_AbortStream is called. For a stream providing audio - output, if the stream callback returns paComplete, or Pa_StopStream is called, - the stream finished callback will not be called until all generated sample data - has been played. - - @param userData The userData parameter supplied to Pa_OpenStream() - - @see Pa_SetStreamFinishedCallback -*/ -typedef void PaStreamFinishedCallback( void *userData ); - - -/** Register a stream finished callback function which will be called when the - stream becomes inactive. See the description of PaStreamFinishedCallback for - further details about when the callback will be called. - - @param stream a pointer to a PaStream that is in the stopped state - if the - stream is not stopped, the stream's finished callback will remain unchanged - and an error code will be returned. - - @param streamFinishedCallback a pointer to a function with the same signature - as PaStreamFinishedCallback, that will be called when the stream becomes - inactive. Passing NULL for this parameter will un-register a previously - registered stream finished callback function. - - @return on success returns paNoError, otherwise an error code indicating the cause - of the error. - - @see PaStreamFinishedCallback -*/ -PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ); - - -/** Commences audio processing. -*/ -PaError Pa_StartStream( PaStream *stream ); - - -/** Terminates audio processing. It waits until all pending - audio buffers have been played before it returns. -*/ -PaError Pa_StopStream( PaStream *stream ); - - -/** Terminates audio processing immediately without waiting for pending - buffers to complete. -*/ -PaError Pa_AbortStream( PaStream *stream ); - - -/** Determine whether the stream is stopped. - A stream is considered to be stopped prior to a successful call to - Pa_StartStream and after a successful call to Pa_StopStream or Pa_AbortStream. - If a stream callback returns a value other than paContinue the stream is NOT - considered to be stopped. - - @return Returns one (1) when the stream is stopped, zero (0) when - the stream is running or, a PaErrorCode (which are always negative) if - PortAudio is not initialized or an error is encountered. - - @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive -*/ -PaError Pa_IsStreamStopped( PaStream *stream ); - - -/** Determine whether the stream is active. - A stream is active after a successful call to Pa_StartStream(), until it - becomes inactive either as a result of a call to Pa_StopStream() or - Pa_AbortStream(), or as a result of a return value other than paContinue from - the stream callback. In the latter case, the stream is considered inactive - after the last buffer has finished playing. - - @return Returns one (1) when the stream is active (ie playing or recording - audio), zero (0) when not playing or, a PaErrorCode (which are always negative) - if PortAudio is not initialized or an error is encountered. - - @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamStopped -*/ -PaError Pa_IsStreamActive( PaStream *stream ); - - - -/** A structure containing unchanging information about an open stream. - @see Pa_GetStreamInfo -*/ - -typedef struct PaStreamInfo -{ - /** this is struct version 1 */ - int structVersion; - - /** The input latency of the stream in seconds. This value provides the most - accurate estimate of input latency available to the implementation. It may - differ significantly from the suggestedLatency value passed to Pa_OpenStream(). - The value of this field will be zero (0.) for output-only streams. - @see PaTime - */ - PaTime inputLatency; - - /** The output latency of the stream in seconds. This value provides the most - accurate estimate of output latency available to the implementation. It may - differ significantly from the suggestedLatency value passed to Pa_OpenStream(). - The value of this field will be zero (0.) for input-only streams. - @see PaTime - */ - PaTime outputLatency; - - /** The sample rate of the stream in Hertz (samples per second). In cases - where the hardware sample rate is inaccurate and PortAudio is aware of it, - the value of this field may be different from the sampleRate parameter - passed to Pa_OpenStream(). If information about the actual hardware sample - rate is not available, this field will have the same value as the sampleRate - parameter passed to Pa_OpenStream(). - */ - double sampleRate; - -} PaStreamInfo; - - -/** Retrieve a pointer to a PaStreamInfo structure containing information - about the specified stream. - @return A pointer to an immutable PaStreamInfo structure. If the stream - parameter invalid, or an error is encountered, the function returns NULL. - - @param stream A pointer to an open stream previously created with Pa_OpenStream. - - @note PortAudio manages the memory referenced by the returned pointer, - the client must not manipulate or free the memory. The pointer is only - guaranteed to be valid until the specified stream is closed. - - @see PaStreamInfo -*/ -const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream ); - - -/** Determine the current time for the stream according to the same clock used - to generate buffer timestamps. This time may be used for syncronising other - events to the audio stream, for example synchronizing audio to MIDI. - - @return The stream's current time in seconds, or 0 if an error occurred. - - @see PaTime, PaStreamCallback -*/ -PaTime Pa_GetStreamTime( PaStream *stream ); - - -/** Retrieve CPU usage information for the specified stream. - The "CPU Load" is a fraction of total CPU time consumed by a callback stream's - audio processing routines including, but not limited to the client supplied - stream callback. This function does not work with blocking read/write streams. - - This function may be called from the stream callback function or the - application. - - @return - A floating point value, typically between 0.0 and 1.0, where 1.0 indicates - that the stream callback is consuming the maximum number of CPU cycles possible - to maintain real-time operation. A value of 0.5 would imply that PortAudio and - the stream callback was consuming roughly 50% of the available CPU time. The - return value may exceed 1.0. A value of 0.0 will always be returned for a - blocking read/write stream, or if an error occurrs. -*/ -double Pa_GetStreamCpuLoad( PaStream* stream ); - - -/** Read samples from an input stream. The function doesn't return until - the entire buffer has been filled - this may involve waiting for the operating - system to supply the data. - - @param stream A pointer to an open stream previously created with Pa_OpenStream. - - @param buffer A pointer to a buffer of sample frames. The buffer contains - samples in the format specified by the inputParameters->sampleFormat field - used to open the stream, and the number of channels specified by - inputParameters->numChannels. If non-interleaved samples were requested, - buffer is a pointer to the first element of an array of non-interleaved - buffer pointers, one for each channel. - - @param frames The number of frames to be read into buffer. This parameter - is not constrained to a specific range, however high performance applications - will want to match this parameter to the framesPerBuffer parameter used - when opening the stream. - - @return On success PaNoError will be returned, or PaInputOverflowed if input - data was discarded by PortAudio after the previous call and before this call. -*/ -PaError Pa_ReadStream( PaStream* stream, - void *buffer, - unsigned long frames ); - - -/** Write samples to an output stream. This function doesn't return until the - entire buffer has been consumed - this may involve waiting for the operating - system to consume the data. - - @param stream A pointer to an open stream previously created with Pa_OpenStream. - - @param buffer A pointer to a buffer of sample frames. The buffer contains - samples in the format specified by the outputParameters->sampleFormat field - used to open the stream, and the number of channels specified by - outputParameters->numChannels. If non-interleaved samples were requested, - buffer is a pointer to the first element of an array of non-interleaved - buffer pointers, one for each channel. - - @param frames The number of frames to be written from buffer. This parameter - is not constrained to a specific range, however high performance applications - will want to match this parameter to the framesPerBuffer parameter used - when opening the stream. - - @return On success PaNoError will be returned, or paOutputUnderflowed if - additional output data was inserted after the previous call and before this - call. -*/ -PaError Pa_WriteStream( PaStream* stream, - const void *buffer, - unsigned long frames ); - - -/** Retrieve the number of frames that can be read from the stream without - waiting. - - @return Returns a non-negative value representing the maximum number of frames - that can be read from the stream without blocking or busy waiting or, a - PaErrorCode (which are always negative) if PortAudio is not initialized or an - error is encountered. -*/ -signed long Pa_GetStreamReadAvailable( PaStream* stream ); - - -/** Retrieve the number of frames that can be written to the stream without - waiting. - - @return Returns a non-negative value representing the maximum number of frames - that can be written to the stream without blocking or busy waiting or, a - PaErrorCode (which are always negative) if PortAudio is not initialized or an - error is encountered. -*/ -signed long Pa_GetStreamWriteAvailable( PaStream* stream ); - - -/* Miscellaneous utilities */ - - -/** Retrieve the size of a given sample format in bytes. - - @return The size in bytes of a single sample in the specified format, - or paSampleFormatNotSupported if the format is not supported. -*/ -PaError Pa_GetSampleSize( PaSampleFormat format ); - - -/** Put the caller to sleep for at least 'msec' milliseconds. This function is - provided only as a convenience for authors of portable code (such as the tests - and examples in the PortAudio distribution.) - - The function may sleep longer than requested so don't rely on this for accurate - musical timing. -*/ -void Pa_Sleep( long msec ); - - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ -#endif /* PORTAUDIO_H */ diff --git a/lib/ft2/ptt.c b/lib/ft2/ptt.c deleted file mode 100644 index fdda4ff9..00000000 --- a/lib/ft2/ptt.c +++ /dev/null @@ -1,58 +0,0 @@ -#include -#include - -int ptt_(int *nport, int *ntx, int *ndtr, int *iptt) -{ - static HANDLE hFile; - static int open=0, nhold=0; - char s[10]; - int i3,i4,i5,i6,i9,i00; - - if(*nport==0) { - *iptt=*ntx; - return(0); - } - - nhold=0; - if(*nport>100) nhold=1; - - if(*ntx && (!open)) { - sprintf(s,"\\\\.\\COM%d",*nport%100); - hFile=CreateFile( - TEXT(s), - GENERIC_WRITE, - 0, - NULL, - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL - ); - if(hFile==INVALID_HANDLE_VALUE) { - printf("PTT: Cannot open COM port %d.\n",*nport%100); - return(-1); - } - open=1; - } - - if(*ntx && open) { - if(*ndtr) - EscapeCommFunction(hFile,5); //set DTR - else - EscapeCommFunction(hFile,3); //set RTS - *iptt=1; - } - - else { - if(*ndtr) - EscapeCommFunction(hFile,6); //clear DTR - else - EscapeCommFunction(hFile,4); //clear RTS - EscapeCommFunction(hFile,9); //clear BREAK - if(nhold==0) { - i00=CloseHandle(hFile); - open=0; - } - *iptt=0; - } - return(0); -} diff --git a/lib/ft2/ptt_unix.c b/lib/ft2/ptt_unix.c deleted file mode 100644 index b1638060..00000000 --- a/lib/ft2/ptt_unix.c +++ /dev/null @@ -1,341 +0,0 @@ -#include -#include -#include -#include -#include -#include -//#include -//#include -//#include -//#include -//#include - -int lp_reset (int fd); -int lp_ptt (int fd, int onoff); - -#ifdef HAVE_SYS_STAT_H -# include -#endif -#if (defined(__unix__) || defined(unix)) && !defined(USG) -# include -#endif - -#include -/* parport functions */ - -int dev_is_parport(int fd); -int ptt_parallel(int fd, int *ntx, int *iptt); -int ptt_serial(int fd, int *ntx, int *iptt); - -int fd=-1; /* Used for both serial and parallel */ - -/* - * ptt_ - * - * generic unix PTT routine called from Fortran - * - * Inputs - * unused Unused, to satisfy old windows calling convention - * ptt_port device name serial or parallel - * ntx pointer to fortran command on or off - * iptt pointer to fortran command status on or off - * Returns - non 0 if error -*/ - -/* Tiny state machine */ -#define STATE_PORT_CLOSED 0 -#define STATE_PORT_OPEN_PARALLEL 1 -#define STATE_PORT_OPEN_SERIAL 2 - -int -ptt_(int *unused, char *ptt_port, int *ntx, int *ndtr, int *iptt) -{ - static int state=0; - char *p; - - /* In the very unlikely event of a NULL pointer, just return. - * Yes, I realise this should not be possible in WSJT. - */ - if (ptt_port == NULL) { - *iptt = *ntx; - return (0); - } - - switch (state) { - case STATE_PORT_CLOSED: - - /* Remove trailing ' ' */ - if ((p = strchr(ptt_port, ' ')) != NULL) - *p = '\0'; - - /* If all that is left is a '\0' then also just return */ - if (*ptt_port == '\0') { - *iptt = *ntx; - return(0); - } - - if ((fd = open(ptt_port, O_RDWR|O_NONBLOCK)) < 0) { - fprintf(stderr, "Can't open %s.\n", ptt_port); - return (1); - } - - if (dev_is_parport(fd)) { - state = STATE_PORT_OPEN_PARALLEL; - lp_reset(fd); - ptt_parallel(fd, ntx, iptt); - } else { - state = STATE_PORT_OPEN_SERIAL; - ptt_serial(fd, ntx, iptt); - } - break; - - case STATE_PORT_OPEN_PARALLEL: - ptt_parallel(fd, ntx, iptt); - break; - - case STATE_PORT_OPEN_SERIAL: - ptt_serial(fd, ntx, iptt); - break; - - default: - close(fd); - fd = -1; - state = STATE_PORT_CLOSED; - break; - } - return(0); -} - -/* - * ptt_serial - * - * generic serial unix PTT routine called indirectly from Fortran - * - * fd - already opened file descriptor - * ntx - pointer to fortran command on or off - * iptt - pointer to fortran command status on or off - */ - -int -ptt_serial(int fd, int *ntx, int *iptt) -{ - int control = TIOCM_RTS | TIOCM_DTR; - - if(*ntx) { - ioctl(fd, TIOCMBIS, &control); /* Set DTR and RTS */ - *iptt = 1; - } else { - ioctl(fd, TIOCMBIC, &control); - *iptt = 0; - } - return(0); -} - - -/* parport functions */ - -/* - * dev_is_parport(fd): - * - * inputs - Already open fd - * output - 1 if parallel port, 0 if not - * side effects - Unfortunately, this is platform specific. - */ - -#if defined(HAVE_LINUX_PPDEV_H) /* Linux (ppdev) */ - -int -dev_is_parport(int fd) -{ - struct stat st; - int m; - - if ((fstat(fd, &st) == -1) || - ((st.st_mode & S_IFMT) != S_IFCHR) || - (ioctl(fd, PPGETMODE, &m) == -1)) - return(0); - - return(1); -} - -#elif defined(HAVE_DEV_PPBUS_PPI_H) /* FreeBSD (ppbus/ppi) */ - -int -dev_is_parport(int fd) -{ - struct stat st; - unsigned char c; - - if ((fstat(fd, &st) == -1) || - ((st.st_mode & S_IFMT) != S_IFCHR) || - (ioctl(fd, PPISSTATUS, &c) == -1)) - return(0); - - return(1); -} - -#else /* Fallback (nothing) */ - -int -dev_is_parport(int fd) -{ - return(0); -} - -#endif -/* Linux wrapper around PPFCONTROL */ -#ifdef HAVE_LINUX_PPDEV_H -static void -parport_control (int fd, unsigned char controlbits, int values) -{ - struct ppdev_frob_struct frob; - frob.mask = controlbits; - frob.val = values; - - if (ioctl (fd, PPFCONTROL, &frob) == -1) - { - fprintf(stderr, "Parallel port PPFCONTROL"); - exit (1); - } -} -#endif - -/* FreeBSD wrapper around PPISCTRL */ -#ifdef HAVE_DEV_PPBUS_PPI_H -static void -parport_control (int fd, unsigned char controlbits, int values) -{ - unsigned char val; - - if (ioctl (fd, PPIGCTRL, &val) == -1) - { - fprintf(stderr, "Parallel port PPIGCTRL"); - exit (1); - } - - val &= ~controlbits; - val |= values; - - if (ioctl (fd, PPISCTRL, &val) == -1) - { - fprintf(stderr, "Parallel port PPISCTRL"); - exit (1); - } -} -#endif - -/* Initialise a parallel port, given open fd */ -int -lp_init (int fd) -{ -#ifdef HAVE_LINUX_PPDEV_H - int mode; -#endif - -#ifdef HAVE_LINUX_PPDEV_H - mode = PARPORT_MODE_PCSPP; - - if (ioctl (fd, PPSETMODE, &mode) == -1) - { - fprintf(stderr, "Setting parallel port mode"); - close (fd); - return(-1); - } - - if (ioctl (fd, PPEXCL, NULL) == -1) - { - fprintf(stderr, "Parallel port is already in use.\n"); - close (fd); - return(-1); - } - if (ioctl (fd, PPCLAIM, NULL) == -1) - { - fprintf(stderr, "Claiming parallel port.\n"); - fprintf(stderr, "HINT: did you unload the lp kernel module?"); - close (fd); - return(-1); - } - - /* Enable CW & PTT - /STROBE bit (pin 1) */ - parport_control (fd, PARPORT_CONTROL_STROBE, PARPORT_CONTROL_STROBE); -#endif -#ifdef HAVE_DEV_PPBUS_PPI_H - parport_control (fd, STROBE, STROBE); -#endif - lp_reset (fd); - return(0); -} - -/* release ppdev and close port */ -int -lp_free (int fd) -{ -#ifdef HAVE_LINUX_PPDEV_H - lp_reset (fd); - - /* Disable CW & PTT - /STROBE bit (pin 1) */ - parport_control (fd, PARPORT_CONTROL_STROBE, 0); - - ioctl (fd, PPRELEASE); -#endif -#ifdef HAVE_DEV_PPBUS_PPI_H - /* Disable CW & PTT - /STROBE bit (pin 1) */ - parport_control (fd, STROBE, 0); -#endif - close (fd); - return(0); -} - -/* set to a known state */ -int -lp_reset (int fd) -{ -#if defined (HAVE_LINUX_PPDEV_H) || defined (HAVE_DEV_PPBUS_PPI_H) - lp_ptt (fd, 0); -#endif - return(0); -} - -/* SSB PTT keying - /INIT bit (pin 16) (inverted) */ -int -lp_ptt (int fd, int onoff) -{ -#ifdef HAVE_LINUX_PPDEV_H - if (onoff == 1) - parport_control (fd, PARPORT_CONTROL_INIT, - PARPORT_CONTROL_INIT); - else - parport_control (fd, PARPORT_CONTROL_INIT, 0); -#endif -#ifdef HAVE_DEV_PPBUS_PPI_H - if (onoff == 1) - parport_control (fd, nINIT, - nINIT); - else - parport_control (fd, nINIT, 0); -#endif - return(0); -} - -/* - * ptt_parallel - * - * generic parallel unix PTT routine called indirectly from Fortran - * - * fd - already opened file descriptor - * ntx - pointer to fortran command on or off - * iptt - pointer to fortran command status on or off - */ - -int -ptt_parallel(int fd, int *ntx, int *iptt) -{ - if(*ntx) { - lp_ptt(fd, 1); - *iptt=1; - } else { - lp_ptt(fd, 0); - *iptt=0; - } - return(0); -} diff --git a/lib/ft4/ft4code.f90 b/lib/ft4/ft4code.f90 index 1792d9a2..7ebc10a2 100644 --- a/lib/ft4/ft4code.f90 +++ b/lib/ft4/ft4code.f90 @@ -12,6 +12,7 @@ program ft4code character*77 c77 character*9 comment character bad*1,msgtype*18 + integer pack_status integer itone(NN) integer*1 msgbits(77),rvec(77),codeword(174) data rvec/0,1,0,0,1,0,1,0,0,1,0,1,1,1,1,0,1,0,0,0,1,0,0,1,1,0,1,1,0, & @@ -46,10 +47,16 @@ program ft4code if(nmsg.gt.1) msg=testmsg(imsg) ! Generate msgsent, msgbits, and itone - i3=-1 - n3=-1 - call pack77(msg,i3,n3,c77) call genft4(msg,0,msgsent,msgbits,itone) + if(trim(msgsent).eq.'*** bad message ***') then + print*,'Cannot encode message: ',trim(msg) + stop 1 + endif + call pack77(msgsent,i3,n3,c77,status=pack_status) + if(pack_status.ne.PACK77_STATUS_ENCODED) then + print*,'Cannot encode message: ',trim(msg) + stop 1 + endif call encode174_91(msgbits,codeword) msgtype="" if(i3.eq.0) then diff --git a/lib/ft4/ft4sim.f90 b/lib/ft4/ft4sim.f90 index cef22303..bc9337e2 100644 --- a/lib/ft4/ft4sim.f90 +++ b/lib/ft4/ft4sim.f90 @@ -13,6 +13,7 @@ program ft4sim complex c(0:NMAX-1) real wave(NMAX) integer itone(NN) + integer pack_status integer*1 msgbits(77) integer*2 iwave(NMAX) !Generated full-length waveform integer icos4(4) @@ -54,11 +55,16 @@ program ft4sim if(snrdb.gt.90.0) sig=1.0 ! Source-encode, then get itone() - i3=-1 - n3=-1 - call pack77(msg37,i3,n3,c77) - read(c77,'(77i1)') msgbits call genft4(msg37,0,msgsent37,msgbits,itone) + if(trim(msgsent37).eq.'*** bad message ***') then + print*,'Cannot encode message: ',trim(msg37) + stop 1 + endif + call pack77(msgsent37,i3,n3,c77,status=pack_status) + if(pack_status.ne.PACK77_STATUS_ENCODED) then + print*,'Cannot encode message: ',trim(msg37) + stop 1 + endif write(*,*) write(*,'(a9,a37,3x,a7,i1,a1,i1)') 'Message: ',msgsent37,'i3.n3: ',i3,'.',n3 write(*,1000) f0,xdt,txt,snrdb @@ -115,7 +121,7 @@ program ft4sim h=default_header(12000,NMAX) write(fname,1102) ifile 1102 format('000000_',i6.6,'.wav') - open(10,file=fname,status='unknown',access='stream') + open(10,file=fname,status='replace',access='stream') write(10) h,iwave !Save to *.wav file close(10) write(*,1110) ifile,xdt,f0,snrdb,fname diff --git a/lib/ft4/ft4sim_mult.f90 b/lib/ft4/ft4sim_mult.f90 index d93978e5..437946ad 100644 --- a/lib/ft4/ft4sim_mult.f90 +++ b/lib/ft4/ft4sim_mult.f90 @@ -91,7 +91,7 @@ program ft4sim_mult if(any(abs(wave).gt.32767.0)) print*,"Warning - data will be clipped." iwave=nint(wave) h=default_header(12000,NZZ) - open(12,file=fname,status='unknown',access='stream') + open(12,file=fname,status='replace',access='stream') write(12) h,iwave !Save to *.wav file close(12) print*,' ' diff --git a/lib/ft4/gen_ft4wave.f90 b/lib/ft4/gen_ft4wave.f90 index 13018242..885c690b 100644 --- a/lib/ft4/gen_ft4wave.f90 +++ b/lib/ft4/gen_ft4wave.f90 @@ -3,12 +3,14 @@ subroutine gen_ft4wave(itone,nsym,nsps,fsample,f0,cwave,wave,icmplx,nwave) real wave(nwave) complex cwave(nwave) real pulse(6912) !576*4*3 - real dphi(0:250000-1) + real, allocatable :: dphi(:) integer itone(nsym) logical first data first/.true./ save pulse,first,twopi,dt,hmod + allocate(dphi(0:(nsym+2)*nsps-1)) + if(first) then twopi=8.0*atan(1.0) dt=1.0/fsample diff --git a/lib/ft4/genft4.f90 b/lib/ft4/genft4.f90 index 66e70a61..2fdd478a 100644 --- a/lib/ft4/genft4.f90 +++ b/lib/ft4/genft4.f90 @@ -48,14 +48,17 @@ subroutine genft4(msg0,ichk,msgsent,msgbits,i4tone) i3=-1 n3=-1 - call pack77(message,i3,n3,c77) + c77=' ' + unpk77_success=.false. + call pack77_legacy_truncating_fallback(message,i3,n3,c77) + if(i3.lt.0 .or. n3.lt.0) go to 1 call unpack77(c77,0,msgsent,unpk77_success) !Unpack to get msgsent if(ichk.eq.1) go to 999 read(c77,'(77i1)',err=1) msgbits if(unpk77_success) go to 2 1 msgbits=0 - itone=0 + i4tone=0 msgsent='*** bad message *** ' go to 999 diff --git a/lib/ft4_decode.f90 b/lib/ft4_decode.f90 index 7d68e17a..540c3911 100644 --- a/lib/ft4_decode.f90 +++ b/lib/ft4_decode.f90 @@ -35,10 +35,8 @@ contains character message*37,msgsent*37 character c77*77 character*37 decodes(100) - character*17 cdatetime0 character*12 mycall,hiscall character*12 mycall0,hiscall0 - character*6 hhmmss complex cd2(0:NDMAX-1) !Complex waveform complex cb(0:NDMAX-1) @@ -82,11 +80,10 @@ contains data rvec/0,1,0,0,1,0,1,0,0,1,0,1,1,1,1,0,1,0,0,0,1,0,0,1,1,0,1,1,0, & 1,0,0,1,0,1,1,0,0,0,0,1,0,0,0,1,0,1,0,0,1,1,1,1,0,0,1,0,1, & 0,1,0,1,0,1,1,0,1,1,1,1,1,0,0,0,1,0,1/ - save fs,dt,tt,txt,twopi,h,first,apbits,nappasses,naptypes, & + save dd,fs,dt,tt,txt,twopi,h,first,apbits,nappasses,naptypes, & mycall0,hiscall0,ctwk2 this%callback => callback - hhmmss=cdatetime0(8:13) dxcall13=hiscall ! initialize for use in packjt77 mycall13=mycall @@ -418,12 +415,12 @@ contains maxosd=3 endif if(.not.doosd) maxosd = -1 - call timer('dec174_91 ',0) + call timer('dec174_9',0) Keff=91 call decode174_91(llr,Keff,maxosd,ndeep,apmask,message91,cw, & ntype,nharderror,dmin) message77=message91(1:77) - call timer('dec174_91 ',1) + call timer('dec174_9',1) if(sum(message77).eq.0) cycle if( nharderror.ge.0 ) then diff --git a/lib/ft8/compress.f90 b/lib/ft8/compress.f90 index 683fc4d8..ece1d3ef 100644 --- a/lib/ft8/compress.f90 +++ b/lib/ft8/compress.f90 @@ -3,6 +3,7 @@ subroutine compress(c) parameter (NMAX=15*12000) !Samples in iwave (180,000) complex c(0:NMAX-1) real xr(0:NMAX-1),xi(0:NMAX-1) + save xr,xi xr=real(c) call wavestats(xr,NMAX,rms,pk,pwr_pk,pwr_ave) diff --git a/lib/ft8/foxgen.f90 b/lib/ft8/foxgen.f90 index 89383e71..0d50761a 100644 --- a/lib/ft8/foxgen.f90 +++ b/lib/ft8/foxgen.f90 @@ -38,7 +38,7 @@ subroutine foxgen(bSuperFox,fname) n=nslots if(bMoreCQs) cmsg(1)(40:40)='1' !Set flag to include a CQ if(bSendMsg) then - n=min(nslots+1,3) + n=min(nslots+1,5) cmsg(n)=textMsg cmsg(n)(39:39)='1' !Set flag for text message nslots=n diff --git a/lib/ft8/ft8_a7.f90 b/lib/ft8/ft8_a7.f90 index 7c7f0288..09a3837f 100644 --- a/lib/ft8/ft8_a7.f90 +++ b/lib/ft8/ft8_a7.f90 @@ -211,8 +211,11 @@ subroutine ft8_a7d(dd0,newdat,call_1,call_2,grid4,xdt,f1,xbase,nharderrors,dmin, nt=2**(3*nsym) do ihalf=1,2 do k=1,29,nsym - if(ihalf.eq.1) ks=k+7 - if(ihalf.eq.2) ks=k+43 + if(ihalf.eq.1) then + ks=k+7 + else + ks=k+43 + endif amax=-1.0 do i=0,nt-1 i1=i/64 @@ -364,9 +367,9 @@ subroutine ft8_a7d(dd0,newdat,call_1,call_2,grid4,xdt,f1,xbase,nharderrors,dmin, xsnr=-25. arg=pbest/xbase/3.0e6-1.0 if(arg.gt.0.0) xsnr=max(-25.0,db(arg)-27.0) -! write(41,3041) nharderrors,dmin,dmin2,dmin2/dmin,xsnr,trim(msgbest) +! write(41,3041) nharderrors,dmin,dmin2,dmin2/(dmin+1e-6),xsnr,trim(msgbest) !3041 format(i3,2f7.1,f7.2,f7.1,1x,a) - if(dmin.gt.100.0 .or. dmin2/dmin.lt.1.3) nharderrors=-1 + if(dmin.gt.100.0 .or. dmin2/(dmin+1e-6).lt.1.3) nharderrors=-1 msg37=msgbest if(msg37(1:3).eq.'CQ ' .and. std_2 .and. grid4.eq.' ') nharderrors=-1 if(msg37(1:6).eq.'QU1RK ') nharderrors=-1 diff --git a/lib/ft8/ft8_a8_test.f90 b/lib/ft8/ft8_a8_test.f90 index 50ebc5c2..33d5b91a 100644 --- a/lib/ft8/ft8_a8_test.f90 +++ b/lib/ft8/ft8_a8_test.f90 @@ -35,7 +35,7 @@ program ft8_a8_test fac=1.0/32767.0 dd=fac*iwave - call ft8_a8d(dd,mycall,dxcall,dxgrid,f1,xdt,fbest,xsnr,plog,msgbest) + call ft8_a8d(dd,mycall,dxcall,dxgrid,f1,xdt,fbest,xsnr,plog,msgbest,0) apflag=' a8' if(plog.lt.-155) apflag(1:1)='?' diff --git a/lib/ft8/ft8_a8d.f90 b/lib/ft8/ft8_a8d.f90 index 3fb1a073..5d05fef1 100644 --- a/lib/ft8/ft8_a8d.f90 +++ b/lib/ft8/ft8_a8d.f90 @@ -1,4 +1,5 @@ -subroutine ft8_a8d(dd,mycall,dxcall,dxgrid,f1a,xdt,fbest,xsnr,plog,msgbest) +subroutine ft8_a8d(dd,mycall,dxcall,dxgrid,f1a,xdt,fbest,xsnr,plog,msgbest, & + progress_generation) ! List decoding for FT8, activated only at nfqso (Rx Freq) +/- 10 Hz and when ! DxCall and DxGrid are populated. Returns xdt, fbest, and msgbest. @@ -6,6 +7,7 @@ subroutine ft8_a8d(dd,mycall,dxcall,dxgrid,f1a,xdt,fbest,xsnr,plog,msgbest) use packjt77 use ft8_a7 use timer_module, only: timer + use decode_completion_module, only: write_decode_progress include 'ft8_params.f90' !Set various constants parameter (NWAVE=NN*NSPS/NDOWN) !Length of generated cwave = 2528 parameter (NZZ=3200) !Length of downsampled arrays @@ -30,6 +32,7 @@ subroutine ft8_a8d(dd,mycall,dxcall,dxgrid,f1a,xdt,fbest,xsnr,plog,msgbest) complex csymb(0:31) integer itone(NN) integer itone_best(NN) + integer, intent(in) :: progress_generation integer ipk(1) logical newdat @@ -54,6 +57,7 @@ subroutine ft8_a8d(dd,mycall,dxcall,dxgrid,f1a,xdt,fbest,xsnr,plog,msgbest) msgbest='' itone_best=0 do imsg=1,NMSGS + call write_decode_progress(progress_generation) call getmsg(imsg,mycall,dxcall,dxgrid,msg) ! Source-encode the message, get itone(), and generate complex FT8 waveform. diff --git a/lib/ft8/ft8b.f90 b/lib/ft8/ft8b.f90 index 43ac33bf..8934e399 100644 --- a/lib/ft8/ft8b.f90 +++ b/lib/ft8/ft8b.f90 @@ -187,8 +187,11 @@ subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,nzhsym,lapon, & nt=2**(3*nsym) do ihalf=1,2 do k=1,29,nsym - if(ihalf.eq.1) ks=k+7 - if(ihalf.eq.2) ks=k+43 + if(ihalf.eq.1) then + ks=k+7 + else + ks=k+43 + endif amax=-1.0 do i=0,nt-1 i1=i/64 @@ -204,7 +207,7 @@ subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,nzhsym,lapon, & print*,"Error - nsym must be 1, 2, or 3." endif enddo - if(imetric.eq.2) s2=s2**2 + if(imetric.eq.2) s2(0:nt-1)=s2(0:nt-1)**2 i32=1+(k-1)*3+(ihalf-1)*87 if(nsym.eq.1) ibmax=2 if(nsym.eq.2) ibmax=5 @@ -432,12 +435,12 @@ subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,nzhsym,lapon, & (abs(nfqso-f1).le.napwid .or. abs(nftx-f1).le.napwid .or. ncontest.eq.7)) then maxosd=2 endif - call timer('dec174_91 ',0) + call timer('dec174_9',0) Keff=91 call decode174_91(llrz,Keff,maxosd,norder,apmask,message91,cw, & ntype,nharderrors,dmin) if(nharderrors.ge.0) message77=message91(1:77) - call timer('dec174_91 ',1) + call timer('dec174_9',1) msg37=' ' nbadcrc=1 diff --git a/lib/ft8/ft8c.f90 b/lib/ft8/ft8c.f90 index a7d1ccb9..4e2e8d72 100644 --- a/lib/ft8/ft8c.f90 +++ b/lib/ft8/ft8c.f90 @@ -136,8 +136,11 @@ subroutine ft8c(dd0,newdat,call_1,call_2,grid4,xdt,f1,nharderrors,dmin, & nt=2**(3*nsym) do ihalf=1,2 do k=1,29,nsym - if(ihalf.eq.1) ks=k+7 - if(ihalf.eq.2) ks=k+43 + if(ihalf.eq.1) then + ks=k+7 + else + ks=k+43 + endif amax=-1.0 do i=0,nt-1 i1=i/64 diff --git a/lib/ft8/ft8sim.f90 b/lib/ft8/ft8sim.f90 index 4897814b..2ee9bd5d 100644 --- a/lib/ft8/ft8sim.f90 +++ b/lib/ft8/ft8sim.f90 @@ -5,12 +5,15 @@ program ft8sim_gfsk use wavhdr use packjt77 + use, intrinsic :: iso_c_binding + include 'ft8_params.f90' !Set various constants parameter (NWAVE=NN*NSPS) type(hdr) h !Header for .wav file character arg*12,fname*17 character msg37*37,msgsent37*37 character c77*77 + character(len=7) :: prog_name='ft8sim'//char(0) complex c0(0:NMAX-1) complex c(0:NMAX-1) complex cwave(0:NWAVE-1) @@ -20,9 +23,17 @@ program ft8sim_gfsk integer*1 msgbits(77) integer*2 iwave(NMAX) !Generated full-length waveform + interface + subroutine print_version(prog_name) bind(C, name='print_version') + use, intrinsic :: iso_c_binding + character(kind=c_char, len=1), intent(in) :: prog_name(*) + end subroutine print_version + end interface + ! Get command-line argument(s) nargs=iargc() if(nargs.ne.7) then + call print_version(prog_name) print*,'Usage: ft8sim "message" f0 DT fdop del nfiles snr' print*,'Examples: ft8sim "K1ABC W9XYZ EN37" 1500.0 0.0 0.5 1.0 10 -18' print*,' ft8sim "K1ABC W9XYZ EN37" 1500.0 0.0 MM 1.0 10 -18' @@ -164,7 +175,7 @@ program ft8sim_gfsk h=default_header(12000,NMAX) write(fname,1102) ifile 1102 format('000000_',i6.6,'.wav') - open(10,file=fname,status='unknown',access='stream') + open(10,file=fname,status='replace',access='stream') write(10) h,iwave !Save to *.wav file close(10) write(*,1110) ifile,xdt,f0,snrdb,fname,snr_2500 diff --git a/lib/ft8/genft8.f90 b/lib/ft8/genft8.f90 index a03c3e58..ce866451 100644 --- a/lib/ft8/genft8.f90 +++ b/lib/ft8/genft8.f90 @@ -16,10 +16,12 @@ subroutine genft8(msg,i3,n3,msgsent,msgbits,itone) i3=-1 n3=-1 - call pack77(msg,i3,n3,c77) - call unpack77(c77,0,msgsent,unpk77_success) + c77=' ' + unpk77_success=.false. + call pack77_legacy_truncating_fallback(msg,i3,n3,c77) + if(i3.ge.0) call unpack77(c77,0,msgsent,unpk77_success) read(c77,'(77i1)',err=1) msgbits - if(unpk77_success) go to 2 + if(i3.ge.0 .and. unpk77_success) go to 2 1 msgbits=0 itone=0 msgsent='*** bad message *** ' diff --git a/lib/ft8/ldpcsim174_91.f90 b/lib/ft8/ldpcsim174_91.f90 index 4e30859a..9a286649 100644 --- a/lib/ft8/ldpcsim174_91.f90 +++ b/lib/ft8/ldpcsim174_91.f90 @@ -75,7 +75,7 @@ program ldpcsim174_91 msg="K9ABC K1ABC FN20" i3=0 n3=1 - call pack77(msg,i3,n3,c77) !Pack into 12 6-bit bytes + call pack77(msg,i3,n3,c77) call unpack77(c77,1,msgsent,unpk77_success) !Unpack to get msgsent write(*,*) "message sent ",msgsent diff --git a/lib/ft8/sync8.f90 b/lib/ft8/sync8.f90 index 57af21a8..b14300ab 100644 --- a/lib/ft8/sync8.f90 +++ b/lib/ft8/sync8.f90 @@ -14,6 +14,7 @@ subroutine sync8(dd,npts,nfa,nfb,syncmin,nfqso,maxcand,candidate,ncand,sbase) real red(NH1) real red2(NH1) real candidate0(3,MAXPRECAND) + real candidate_sync(MAXPRECAND) real candidate(3,maxcand) real dd(npts) integer jpeak(NH1) @@ -151,7 +152,8 @@ subroutine sync8(dd,npts,nfa,nfb,syncmin,nfqso,maxcand,candidate,ncand,sbase) s=fac*s ! Sort by sync - call indexx(candidate0(3,1:ncand),ncand,indx) + candidate_sync(1:ncand)=candidate0(3,1:ncand) + call indexx(candidate_sync,ncand,indx) ! Place candidates within 10 Hz of nfqso at the top of the list k=1 do i=1,ncand diff --git a/lib/ft8_decode.f90 b/lib/ft8_decode.f90 index 5402cc6c..e23df118 100644 --- a/lib/ft8_decode.f90 +++ b/lib/ft8_decode.f90 @@ -37,7 +37,6 @@ contains ltry_a8,lapcqonly,napwid,mycall12,hiscall12,hisgrid,ldiskdat) use iso_c_binding, only: c_bool, c_int use timer_module, only: timer - use shmem, only: shmem_lock, shmem_unlock use ft8_a7 include 'ft8/ft8_params.f90' @@ -291,7 +290,7 @@ contains ! Try for an a8 decode at nfqso f1=nfqso call timer('ft8_a8d ',0) - call ft8_a8d(dd,mycall12,hiscall12,hisgrid,f1,xdt,fbest,xsnr,plog,msg37) + call ft8_a8d(dd,mycall12,hiscall12,hisgrid,f1,xdt,fbest,xsnr,plog,msg37,0) call timer('ft8_a8d ',1) if(msg37(1:1).ne.' ') then diff --git a/lib/ft8var/agccft8.f90 b/lib/ft8var/agccft8.f90 index 1b88ca84..be39347f 100644 --- a/lib/ft8var/agccft8.f90 +++ b/lib/ft8var/agccft8.f90 @@ -1,4 +1,4 @@ -subroutine agccft8(nfa,nfb,forcedt) +subroutine agccft8(nfa,nfb) use ft8_mod1, only : dd8,twopi,lagccbail integer, parameter :: NFFT=1024,NSZ=426,NHSYM=178,NHSTEP=960 !3413 = NFFT*5000/12000 diff --git a/lib/ft8var/cwfilter.f90 b/lib/ft8var/cwfilter.f90 index d3ec35fb..e305047d 100644 --- a/lib/ft8var/cwfilter.f90 +++ b/lib/ft8var/cwfilter.f90 @@ -1,13 +1,14 @@ subroutine cwfilter(first) use ft8_mod1, only : cw,windowc1,windowx,pivalue,facx,mcq,m73,mrr73,mrrr,one,twopi,facc1,dt,csync,idtone25,csynccq, & + idtone25_valid, & NFILT1,NFILT2,endcorr,ctwkw,ctwkn,ctwk256 use jt65_mod9 ! callsign DB to memory use prog_args ! path to files parameter (NFFT=180000) - complex csig0(151680) - real*4 window1(-NFILT1/2:NFILT1/2),window2(-NFILT2/2:NFILT2/2) + complex, allocatable :: csig0(:) + real*4 window1(-NFILT1/2:NFILT1/2) character*37 msgcq25(25),msgsent37 integer itone(79) integer*1 msgbits(77) @@ -17,6 +18,7 @@ subroutine cwfilter(first) !note that with new, larger ALLCALL7.TXT files, dimensions of various ncall arrays may need to be increased in jt65_mod9.f90 !on 20250709 callj dim was increased from 9000 to 10000 when updated ALLCALL7.TXT file was added if(first) then + allocate(csig0(151680)) ! Open the shipped read-only ALLCALL7.TXT for reading only. status='old' with ! action='read' makes a missing/unreadable file degrade cleanly to an empty ! callsign DB (handled by the count check below) instead of status='unknown' @@ -112,9 +114,12 @@ subroutine cwfilter(first) msgcq25(23)='CQ SM2GSH KP05' msgcq25(24)='CQ UA9OHX NO15' msgcq25(25)='CQ JA W0YH EN12' + idtone25(2:25,1:58)=0 + idtone25_valid(2:25)=.false. do i=2,25 i3=-1; n3=-1 call genft8sdvar(msgcq25(i),i3,n3,msgsent37,msgbits,itone) + if(i3.lt.0) cycle if(i.eq.2) then call gen_ft8wave(itone,79,1920,2.0,12000.0,0.0,csig0,xjunk,1,151680) m=1 @@ -127,6 +132,7 @@ subroutine cwfilter(first) endif idtone25(i,1:29)=itone(8:36) idtone25(i,30:58)=itone(44:72) + idtone25_valid(i)=.true. enddo dt2=0.005 ! fs2=200 Hz k=1 @@ -182,4 +188,3 @@ subroutine cwfilter(first) return end subroutine cwfilter - \ No newline at end of file diff --git a/lib/ft8var/fillhashvar.f90 b/lib/ft8var/fillhashvar.f90 index edab5e30..851ddc13 100644 --- a/lib/ft8var/fillhashvar.f90 +++ b/lib/ft8var/fillhashvar.f90 @@ -1,67 +1,30 @@ subroutine fillhashvar(numthreads,lfill) - use packjt77 ! also setting mycall13var,dxcall13var + use packjt77 use ft8_mod1, only : mycall,hiscall integer, intent(in) :: numthreads logical, intent(in) :: lfill character*13 cw if(lfill) then + ! End of a configured/var decode pass: merge per-thread successful decode + ! effects into the shared callsign hash and recent-call state. do i=1,numthreads - do m=1,nlast_callsvar(i) - nposition=nthrindexvar(i)+m - cw=last_callsvar(nposition) + do m=1,nqueued_calls_by_thread(i) + nposition=thread_call_index(i)+m + cw=queued_calls_by_thread(nposition) !print *,i,m,cw - n10=ihashcallvar(cw,10) - if(n10.ge.0 .and. n10 .le. 1023 .and. cw.ne.mycall13var) calls10var(n10)=cw - - n12=ihashcallvar(cw,12) - if(n12.ge.0 .and. n12 .le. 4095 .and. cw.ne.mycall13var) calls12var(n12)=cw - - n22=ihashcallvar(cw,22) - if(any(ihash22var.eq.n22)) then ! If entry exists, make sure callsign is the most recently received one - where(ihash22var.eq.n22) calls22var=cw - go to 900 - endif - -! New entry: move table down, making room for new one at the top - ihash22var(nzhashvar:2:-1)=ihash22var(nzhashvar-1:1:-1) - -! Add the new entry - calls22var(nzhashvar:2:-1)=calls22var(nzhashvar-1:1:-1) - ihash22var(1)=n22 - calls22var(1)=cw - if(nzhashvar.lt.MAXHASHvar) nzhashvar=nzhashvar+1 -900 continue + call save_hash_call(cw,n10,n12,n22) enddo enddo + call fold_queued_recent_calls(numthreads) else - nlast_callsvar=0 - mycall13var=mycall//' '; dxcall13var=hiscall//' ' - if(mycall13var.ne.mycall13_0var) then - if(len(trim(mycall13var)).gt.2) then - mycall13_setvar=.true. - mycall13_0var=mycall13var - call save_hash_mycallvar(mycall13var,hashmy10var,hashmy12var,hashmy22var) -!print *,mycall13var,hashmy10var,hashmy12var,hashmy22var - else - mycall13_setvar=.false. - endif - endif - - if(dxcall13var.ne.dxcall13_0var) then - if(len(trim(dxcall13var)).gt.2) then - dxcall13_setvar=.true. - dxcall13_0var=dxcall13var - hashdx10var=ihashcallvar(dxcall13var,10) -! make sure new DX Call is stored in hash tables prior to decoding -! it is needed if manually callsign set in DX Call window was not decoded before - call save_hash_callvar(dxcall13var,1) -!print *,dxcall13var,hashdx10var - else - dxcall13_setvar=.false. - endif - endif + ! Start of a configured/var decode pass: clear staged worker effects and + ! snapshot the operator-configured calls used by hash-only decode guards. + nqueued_calls_by_thread=0 + nqueued_recent_calls_by_thread=0 + mycall13=mycall//' '; dxcall13=hiscall//' ' + call sync_configured_calls_for_decode_start() endif return diff --git a/lib/ft8var/four2avar.f90 b/lib/ft8var/four2avar.f90 index 3ed44f22..1653955b 100644 --- a/lib/ft8var/four2avar.f90 +++ b/lib/ft8var/four2avar.f90 @@ -32,11 +32,20 @@ subroutine four2avar(a,nfft,ndim,isign,iform) include '/lib/fftw3.f90' !FFTW definitions save plan,nplan,nn,ns,nf,nl + interface + subroutine wsjt_tsan_acquire_four2avar_setup() bind(C) + end subroutine wsjt_tsan_acquire_four2avar_setup + subroutine wsjt_tsan_release_four2avar_setup() bind(C) + end subroutine wsjt_tsan_release_four2avar_setup + end interface + if(nfft.lt.0) go to 999 nloc=loc(a) found_plan = .false. + !$omp critical(four2avar_setup) + call wsjt_tsan_acquire_four2avar_setup() do i=1,nplan if(nfft.eq.nn(i) .and. isign.eq.ns(i) .and. & iform.eq.nf(i) .and. nloc.eq.nl(i)) then @@ -48,7 +57,6 @@ subroutine four2avar(a,nfft,ndim,isign,iform) if(i.ge.NPMAX) stop 'Too many FFTW plans requested.' if (.not. found_plan) then - !$omp critical(four2avar_setup) nplan=nplan+1 i=nplan @@ -90,8 +98,9 @@ subroutine four2avar(a,nfft,ndim,isign,iform) if(iform.le.0) jz=nfft/2+1 a(1:jz)=aa(1:jz) endif - !$omp end critical(four2avar_setup) end if + call wsjt_tsan_release_four2avar_setup() + !$omp end critical(four2avar_setup) call sfftw_execute(plan(i)) return diff --git a/lib/ft8var/ft4_mod1.f90 b/lib/ft8var/ft4_mod1.f90 index 9bdf2a94..e3cb7619 100644 --- a/lib/ft8var/ft4_mod1.f90 +++ b/lib/ft8var/ft4_mod1.f90 @@ -3,5 +3,6 @@ module ft4_mod1 real*4 dd4(73728) logical(1) llagcc,lfilter,lhidetest,lhidetelemetry integer nFT4decd,nfafilt,nfbfilt + save dd4 -end module ft4_mod1 \ No newline at end of file +end module ft4_mod1 diff --git a/lib/ft8var/ft8_decode_ranges.f90 b/lib/ft8var/ft8_decode_ranges.f90 new file mode 100644 index 00000000..40c6b171 --- /dev/null +++ b/lib/ft8var/ft8_decode_ranges.f90 @@ -0,0 +1,38 @@ +module ft8_decode_ranges + implicit none + private + + integer, parameter, public :: max_ft8_decode_ranges = 12 + public :: partition_ft8_decode_range + +contains + + pure subroutine partition_ft8_decode_range(nfa,nfb,requested_ranges,range_low,range_high,nranges) + integer, intent(in) :: nfa,nfb,requested_ranges + integer, intent(out) :: range_low(max_ft8_decode_ranges) + integer, intent(out) :: range_high(max_ft8_decode_ranges) + integer, intent(out) :: nranges + integer :: base_width,extra,i,next_low,range_width,total_width + + range_low=0 + range_high=-1 + nranges=0 + + if(nfa.gt.nfb) return + + total_width=nfb-nfa+1 + nranges=min(max(1,requested_ranges),max_ft8_decode_ranges,total_width) + base_width=total_width/nranges + extra=mod(total_width,nranges) + next_low=nfa + + do i=1,nranges + range_width=base_width + if(i.le.extra) range_width=range_width+1 + range_low(i)=next_low + range_high(i)=next_low+range_width-1 + next_low=range_high(i)+1 + enddo + end subroutine partition_ft8_decode_range + +end module ft8_decode_ranges diff --git a/lib/ft8var/ft8_decodevar.f90 b/lib/ft8var/ft8_decodevar.f90 index 521ab6da..d7324216 100644 --- a/lib/ft8var/ft8_decodevar.f90 +++ b/lib/ft8var/ft8_decodevar.f90 @@ -21,42 +21,51 @@ module ft8_decodevar contains - subroutine decodevar(this,callback,nQSOProgress,nfqso,nft8rxfsens,nftx,nutc, & + subroutine decodevar(this,nQSOProgress,nfqso,nft8rxfsens,nftx, & nfa,nfb,ncandthin,ndtcenter,nsec,napwid,lmycallstd,lhiscallstd, & stophint,nthr,numthreads,nagainfil,lft8lowth,lft8subpass,lhideft8dupes, & - lft8apon,ncontest) + progress_generation,residual,spectrum) - use timer_module, only: timer use omp_lib - use ft8_a7 + use ft8_mtd_residual, only : mtd_publish_worker,mtd_transform_phase + use decode_completion_module, only : write_decode_progress use ft8_mod1, only : ndecodes,allmessages,allsnrs,allfreq,odd,even,nmsg, & - lastrxmsg,lasthcall,calldteven,calldtodd,incall,oddcopy,evencopy, & - avexdt,mycall,hiscall,dd8,nft8cycles,ncandallthr,nincallthr,evencq, & + lastrxmsg,calldteven,calldtodd,incall,oddcopy,evencopy, & + avexdt,mycall,hiscall,nft8cycles,ncandallthr,nincallthr,evencq, & oddcq,numcqsig,numdeccq,evenmyc,oddmyc,nummycsig,numdecmyc,lapmyc, & evenqso,oddqso,lqsomsgdcd,hisgrid4 + interface + subroutine wsjt_tsan_acquire_ft8_find_dupes() bind(C) + end subroutine wsjt_tsan_acquire_ft8_find_dupes + subroutine wsjt_tsan_release_ft8_find_dupes() bind(C) + end subroutine wsjt_tsan_release_ft8_find_dupes + subroutine wsjt_tsan_acquire_ft8_update_structures() bind(C) + end subroutine wsjt_tsan_acquire_ft8_update_structures + subroutine wsjt_tsan_release_ft8_update_structures() bind(C) + end subroutine wsjt_tsan_release_ft8_update_structures + end interface + include 'ft8_params.f90' class(ft8_decodervar), intent(inout) :: this - procedure(ft8_decodevar_callback) :: callback - real, DIMENSION(:), ALLOCATABLE :: dd8m - real candidate(4,460),freqsub(200) + real, intent(inout) :: residual(180000) + complex, intent(inout) :: spectrum(0:96000) + real candidate(4,460) real qual !ft8md integer, intent(in) :: nQSOProgress,nfqso,nft8rxfsens,nftx,nfa,nfb, & - ncandthin,ndtcenter,nsec,napwid,nthr,numthreads + ncandthin,ndtcenter,nsec,napwid,nthr,numthreads,progress_generation logical, intent(in) :: nagainfil logical(1), intent(in) :: stophint,lft8lowth,lft8subpass,lhideft8dupes, & - lmycallstd,lhiscallstd,lft8apon + lmycallstd,lhiscallstd logical newdat1,lsubtract,ldupe,lFreeText,lspecial logical(1) lft8sdec,lft8s,lft8sd,lrepliedother,lhashmsg,lqsothread, & - lhidemsg,lhighsens,lcqcand,lsubtracted,levenint,loddint,lnohiscall, & + lhidemsg,lhighsens,lcqcand,levenint,loddint,lnohiscall, & lnomycall,lnohisgrid character msg37*37,msg37_2*37,msg26*37,call2*12 !ft8md msg26 was *26 character*37 msgsrcvd(130) - logical la8 integer nsnr - character*6 dxgrid type oddtmp_struct real freq @@ -85,7 +94,7 @@ contains real xdt complex cs(0:7,79) end type tmpcqsig_struct - type(tmpcqsig_struct) tmpcqsig(numcqsig) ! 20 sigs + type(tmpcqsig_struct), allocatable :: tmpcqsig(:) ! 20 sigs type tmpmyc_struct real freq @@ -107,9 +116,7 @@ contains end type tmpqsosig_struct type(tmpqsosig_struct) tmpqsosig(1) - this%callback => callback - la8=.true. - + allocate(tmpcqsig(numcqsig)) oddtmp%lstate=.false. eventmp%lstate=.false. nmsgloc=0 @@ -121,13 +128,6 @@ contains tmpcqsig(:)%freq=6000.0 tmpmycsig(:)%freq=6000.0 tmpqsosig(1)%freq=6000.0 - if(hiscall.eq.'') then - lastrxmsg(1)%lstate=.false. - else if(lastrxmsg(1)%lstate .and. lasthcall.ne.hiscall .and. & - index(lastrxmsg(1)%lastmsg,trim(hiscall)).le.0) then - lastrxmsg(1)%lstate=.false. - endif - levenint=.false. loddint=.false. if(nsec.eq.0 .or. nsec.eq.30) then @@ -139,11 +139,9 @@ contains lrepliedother=.false. lft8sdec=.false. lqsothread=.false. - lsubtracted=.false. ncount=0 mycalllen1=len_trim(mycall)+1 nincallthr(nthr)=0 - nallocthr=0 ncqsignal=0 nmycsignal=0 @@ -212,9 +210,15 @@ contains syncmin=1.3 do ipass=1,npass + if(ipass.eq.4 .or. ipass.eq.7) then +!$omp barrier +!$omp single + call mtd_transform_phase(ipass) +!$omp end single + endif + call mtd_publish_worker(nthr) newdat1=.true. lsubtract=.true. - npos=0 if(ipass.eq.1 .or. ipass.eq.4 .or. ipass.eq.7) then if(lft8lowth) syncmin=1.225 elseif(ipass.eq.2 .or. ipass.eq.5 .or. ipass.eq.8) then @@ -224,36 +228,12 @@ contains endif if(ipass.gt.5 .or. (ipass.eq.3 .and. npass.eq.3)) lsubtract=.false. - if(ipass.eq.4) then -!$omp barrier -!$omp single - if(npass.eq.9) then ! 3 decoding cycles - nallocthr=nthr - allocate(dd8m(180000), STAT = nAllocateStatus1) - if(nAllocateStatus1.ne.0) STOP "Not enough memory" - dd8m=dd8 - endif - do i=1,179999 - dd8(i)=(dd8(i)+dd8(i+1))/2 - enddo -!$omp end single -!$omp barrier - else if(ipass.eq.7) then -!$omp barrier - if(nthr.eq.nallocthr) then - dd8(1)=dd8m(1) - do i=2,180000 - dd8(i)=(dd8m(i-1)+dd8m(i))/2 - enddo - deallocate (dd8m, STAT = nDeAllocateStatus1) - if (nDeAllocateStatus1.ne.0) print *, 'failed to release memory' - endif -!$omp barrier - endif - - call sync8var(nfa,nfb,syncmin,nfqso,candidate,ncand,jzb,jzt,ipass, & - lqsothread,ncandthin,ndtcenter) + call write_decode_progress(progress_generation) + call sync8var(residual,nfa,nfb,syncmin,nfqso,candidate,ncand,jzb,jzt, & + ipass,lqsothread,ncandthin,ndtcenter,progress_generation) + call write_decode_progress(progress_generation) do icand=1,ncand + if(mod(icand,8).eq.0) call write_decode_progress(progress_generation) sync=candidate(3,icand) f1=candidate(1,icand) xdt=candidate(2,icand) @@ -273,14 +253,16 @@ contains i3=16 n3=16 - call ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos, & - freqsub,tmpcqdec,tmpmyc,nagainfil,iaptype,f1,xdt,nbadcrc, & + call ft8bvar(residual,spectrum,newdat1,nQSOProgress,nfqso,nftx, & + napwid,lsubtract,tmpcqdec,tmpmyc,nagainfil,iaptype,f1,xdt, & + nbadcrc, & lft8sdec,msg37,msg37_2,xsnr,stophint,nthr,lFreeText,ipass, & lft8subpass,lspecial,lcqcand,ncqsignal,nmycsignal,npass,i3bit, & lft8s,lmycallstd,lhiscallstd,levenint,loddint,lft8sd,i3,n3, & nft8rxfsens,ncount,msgsrcvd,lrepliedother,lhashmsg,lqsothread, & - lft8lowth,lhighsens,lsubtracted,tmpcqsig,tmpmycsig,tmpqsosig, & - lnohiscall,lnomycall,lnohisgrid,qual,iaptype2) + lft8lowth,lhighsens,tmpcqsig,tmpmycsig,tmpqsosig, & + lnohiscall,lnomycall,lnohisgrid,qual,iaptype2, & + progress_generation) nsnr=nint(xsnr) xdt=xdt-0.5 if(nbadcrc.eq.0) then @@ -292,6 +274,7 @@ contains endif !$omp critical(find_dupes) + call wsjt_tsan_acquire_ft8_find_dupes() do k=1,nspecial !ft8md if(k.eq.2) msg37=msg37_2 ! this splits DXpedition mode msg into 2 lines ldupe=.false. @@ -417,9 +400,11 @@ contains endif 4 continue enddo !do k + call wsjt_tsan_release_ft8_find_dupes() !$omp end critical(find_dupes) endif enddo !icand + call write_decode_progress(progress_generation) ncandthr=ncandthr+ncand enddo !ipass @@ -468,6 +453,7 @@ contains if(nmsgloc.gt.0) then !$omp critical(update_structures) + call wsjt_tsan_acquire_ft8_update_structures() if(levenint) then even(nmsg+1:nmsg+nmsgloc)%msg=eventmp(1:nmsgloc)%msg even(nmsg+1:nmsg+nmsgloc)%freq=eventmp(1:nmsgloc)%freq @@ -481,34 +467,11 @@ contains odd(nmsg+1:nmsg+nmsgloc)%lstate=oddtmp(1:nmsgloc)%lstate nmsg=nmsg+nmsgloc endif + call wsjt_tsan_release_ft8_update_structures() !$omp end critical(update_structures) endif -!$omp single -! test code for a8 start - if(lft8apon .and. ncontest.ne.6 .and. ncontest.ne.7 .and. la8 .and. & - len(trim(hiscall)).ge.3 .and. & - len(trim(hisgrid4)).ge.4 .and. ltry_a8) then -! Try for an a8 decode at nfqso - f1=nfqso - dxgrid=hisgrid4 - call timer('ft8_a8d ',0) - call ft8_a8d(dd8,mycall,hiscall,dxgrid,f1,xdt,fbest,xsnr,plog,msg37) !w3sz was dd - call timer('ft8_a8d ',1) - if(msg37(1:1).ne.' ') then - if(associated(this%callback)) then - sync=10.0 !### ??? !URUR was 10, tried 15 - nsnr=nint(xsnr) - iaptype=8 - qual=1.0 - if(plog.lt.-147.0) qual=0.16 - call this%callback(nsnr,xdt,fbest,msg37,iaptype,qual) - endif - endif - endif -! test code for a8 stop -!$omp end single nowait - return + end subroutine decodevar end module ft8_decodevar diff --git a/lib/ft8var/ft8_downsamplevar.f90 b/lib/ft8var/ft8_downsamplevar.f90 index 7253075e..6e7293f4 100644 --- a/lib/ft8var/ft8_downsamplevar.f90 +++ b/lib/ft8var/ft8_downsamplevar.f90 @@ -1,34 +1,26 @@ -subroutine ft8_downsamplevar(newdat1,f0,nqso,c0,c2,c3,lhighsens,lsubtracted,npos,freqsub) +subroutine ft8_downsamplevar(residual,cxx,newdat1,f0,nqso,c0,c2,c3,lhighsens) ! Downconvert to complex data sampled at 200 Hz ==> 32 samples/symbol - use ft8_mod1, only : dd8,windowc1,facc1 + use ft8_mod1, only : windowc1,facc1 parameter (NFFT1=192000,NFFT2=3200) !192000/60 = 3200 logical newdat1 complex, intent(out) :: c0(-800:4000),c2(-800:4000),c3(-800:4000) - complex cx(0:96000),cxx(0:96000),c1(0:3199) ! 0:NFFT1/2 + real, intent(in) :: residual(180000) + complex, intent(inout) :: cxx(0:96000) + complex cx(0:96000),c1(0:3199) ! 0:NFFT1/2 real x(NFFT1) real, intent(in) :: f0 integer, intent(in) :: nqso - real freqsub(200) logical(1), intent(in) :: lhighsens - logical(1) lsubtracted,ldofft equivalence (x,cx) - save cxx - ldofft=.false. - if(lsubtracted) then - do i=1,npos - if(abs(f0-freqsub(i)).lt.50.) then; ldofft=.true.; lsubtracted=.false.; exit; endif - enddo - endif - - if(newdat1 .or. ldofft) then -! Data in dd have changed, recompute the long FFT - x(1:180000)=dd8 + if(newdat1) then +! Residual has changed, recompute the long FFT + x(1:180000)=residual x(180001:NFFT1)=0. !Zero-pad the x array call four2avar(cx,NFFT1,1,-1,0) !r2c FFT to freq domain - newdat1=.false.; ldofft=.false.; npos=0 + newdat1=.false. cxx=cx endif diff --git a/lib/ft8var/ft8_mod1.f90 b/lib/ft8var/ft8_mod1.f90 index 8bfe3027..cd1f0d2c 100644 --- a/lib/ft8var/ft8_mod1.f90 +++ b/lib/ft8var/ft8_mod1.f90 @@ -1,5 +1,7 @@ module ft8_mod1 + save + parameter (NPS=180000,NFR=151680,NFILT1=4000,NFILT2=3400,numcqsig=20, & numdeccq=40,nummycsig=5,numdecmyc=25,nmaxthreads=24) real*4 dd8(nps) @@ -29,6 +31,8 @@ module ft8_mod1 logical one(0:511,0:8),lqsomsgdcd,first_osd logical(1) lapmyc,lagcc,lagccbail,lhound,lenabledxcsearch, & lwidedxcsearch,lmultinst,lskiptx1,ltxing + logical(1) idtone25_valid(25),idtone56_valid(56),idtone76_valid(76) + logical(1) csyncsd_valid,csyncsdcq_valid data maskincallthr/0,30,45,55,65,75,85,90,95,100,105,110,115,120,125, & 130,135,140,145,150,155,160,165,170,175/ data mcq/0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0/ @@ -99,6 +103,11 @@ module ft8_mod1 data nintcount/0/ data avexdt/0.0/ data first_osd/.true./ + data idtone25_valid/25*.false./ + data idtone56_valid/56*.false./ + data idtone76_valid/76*.false./ + data csyncsd_valid/.false./ + data csyncsdcq_valid/.false./ type odd_struct real freq diff --git a/lib/ft8var/ft8_mtd_residual.f90 b/lib/ft8var/ft8_mtd_residual.f90 new file mode 100644 index 00000000..2d4dea8d --- /dev/null +++ b/lib/ft8var/ft8_mtd_residual.f90 @@ -0,0 +1,459 @@ +module ft8_mtd_residual + + use iso_fortran_env, only : int64 + + implicit none + + integer, parameter, public :: mtd_residual_samples=180000 + integer, parameter, public :: mtd_spectrum_bins=96001 + integer, parameter, public :: mtd_max_subtractions_per_worker=460 + integer, parameter, public :: mtd_subtraction_passes=5 + integer, parameter, public :: mtd_commit_current=1 + integer, parameter, public :: mtd_commit_independent=2 + integer, parameter, public :: mtd_commit_conflict=3 + integer, parameter, public :: mtd_commit_duplicate=4 + integer, parameter, public :: mtd_commit_fallback=5 + integer, parameter :: mtd_frame_samples=151680 + real, parameter :: mtd_interaction_bandwidth=50.0 + + type, public :: ft8_subtraction_descriptor + integer :: tones(79)=0 + real :: frequency=0.0 + real :: dt=0.0 + integer :: frequency_bin=0 + integer :: start_sample=0 + integer :: clipped_start=0 + integer :: clipped_end=-1 + integer(int64) :: epoch=0_int64 + integer :: pass=0 + integer(int64) :: commit_generation=0_int64 + end type ft8_subtraction_descriptor + + real, allocatable, save, public :: mtd_worker_residual(:,:) + complex, allocatable, save, public :: mtd_worker_spectrum(:,:) + + real, allocatable, save :: canonical_residual(:) + real, allocatable, save :: post_pass3_residual(:) + real, allocatable, save :: subtraction_delta(:,:) + type(ft8_subtraction_descriptor), allocatable, save :: history(:) + integer(int64), allocatable, save :: worker_generation(:) + integer(int64), allocatable, save :: worker_epoch(:) + integer(int64), allocatable, save :: worker_spectrum_generation(:) + integer(int64), allocatable, save :: worker_spectrum_epoch(:) + integer, save :: active_workers=0 + integer(int64), save :: canonical_generation=0_int64 + integer(int64), save :: current_epoch=0_int64 + integer, save :: history_count=0 + + interface + subroutine subtractft8var(residual,itone,f0,dt,delta) + real, intent(inout) :: residual(180000) + integer, intent(in) :: itone(79) + real, intent(in) :: f0,dt + real, intent(out), optional :: delta(151680) + end subroutine subtractft8var + subroutine wsjt_tsan_acquire_ft8_mtd() bind(C) + end subroutine wsjt_tsan_acquire_ft8_mtd + subroutine wsjt_tsan_release_ft8_mtd() bind(C) + end subroutine wsjt_tsan_release_ft8_mtd + end interface + +contains + + subroutine mtd_prepare(input_residual,nworkers) + real, intent(in) :: input_residual(:) + integer, intent(in) :: nworkers + + if(size(input_residual).ne.mtd_residual_samples) error stop & + 'MTD residual has an unexpected sample count' + if(nworkers.lt.1) error stop 'MTD requires at least one worker' + + call ensure_capacity(nworkers) +!$omp critical(ft8_mtd_canonical) + call wsjt_tsan_acquire_ft8_mtd() + active_workers=nworkers + current_epoch=current_epoch+1_int64 + canonical_generation=0_int64 + history_count=0 + canonical_residual=input_residual + post_pass3_residual=input_residual + worker_generation(1:active_workers)=-1_int64 + worker_epoch(1:active_workers)=current_epoch + worker_spectrum_generation(1:active_workers)=-1_int64 + worker_spectrum_epoch(1:active_workers)=current_epoch + call wsjt_tsan_release_ft8_mtd() +!$omp end critical(ft8_mtd_canonical) + end subroutine mtd_prepare + + subroutine ensure_capacity(nworkers) + integer, intent(in) :: nworkers + integer :: current_workers,history_capacity + + current_workers=0 + if(allocated(mtd_worker_residual)) current_workers=size(mtd_worker_residual,2) + if(current_workers.ge.nworkers) return + + if(allocated(mtd_worker_residual)) deallocate(mtd_worker_residual) + if(allocated(mtd_worker_spectrum)) deallocate(mtd_worker_spectrum) + if(allocated(subtraction_delta)) deallocate(subtraction_delta) + if(allocated(history)) deallocate(history) + if(allocated(worker_generation)) deallocate(worker_generation) + if(allocated(worker_epoch)) deallocate(worker_epoch) + if(allocated(worker_spectrum_generation)) deallocate(worker_spectrum_generation) + if(allocated(worker_spectrum_epoch)) deallocate(worker_spectrum_epoch) + if(.not.allocated(canonical_residual)) allocate(canonical_residual(mtd_residual_samples)) + if(.not.allocated(post_pass3_residual)) allocate(post_pass3_residual(mtd_residual_samples)) + + history_capacity=mtd_subtraction_passes*mtd_max_subtractions_per_worker*nworkers + allocate(mtd_worker_residual(mtd_residual_samples,nworkers)) + allocate(mtd_worker_spectrum(0:mtd_spectrum_bins-1,nworkers)) + allocate(subtraction_delta(mtd_frame_samples,nworkers)) + allocate(history(history_capacity)) + allocate(worker_generation(nworkers)) + allocate(worker_epoch(nworkers)) + allocate(worker_spectrum_generation(nworkers)) + allocate(worker_spectrum_epoch(nworkers)) + end subroutine ensure_capacity + + subroutine mtd_publish_worker(worker) + integer, intent(in) :: worker + + call assert_worker(worker) +!$omp critical(ft8_mtd_canonical) + call wsjt_tsan_acquire_ft8_mtd() + mtd_worker_residual(:,worker)=canonical_residual + worker_generation(worker)=canonical_generation + worker_epoch(worker)=current_epoch + worker_spectrum_generation(worker)=-1_int64 + worker_spectrum_epoch(worker)=current_epoch + call wsjt_tsan_release_ft8_mtd() +!$omp end critical(ft8_mtd_canonical) + end subroutine mtd_publish_worker + + subroutine mtd_refresh_candidate(worker,frequency,newdat1,rebuild_spectrum) + integer, intent(in) :: worker + real, intent(in) :: frequency + logical, intent(inout) :: newdat1 + logical, intent(out) :: rebuild_spectrum + integer :: i + logical :: refresh_residual + + call assert_worker(worker) +!$omp critical(ft8_mtd_canonical) + call wsjt_tsan_acquire_ft8_mtd() + refresh_residual=worker_epoch(worker).ne.current_epoch + if(.not.refresh_residual) then + do i=1,history_count + if(history(i)%epoch.ne.current_epoch .or. & + history(i)%commit_generation.le.worker_generation(worker)) cycle + if(abs(history(i)%frequency-frequency).lt.mtd_interaction_bandwidth) then + refresh_residual=.true. + exit + endif + enddo + endif + if(refresh_residual) then + mtd_worker_residual(:,worker)=canonical_residual + worker_generation(worker)=canonical_generation + worker_epoch(worker)=current_epoch + newdat1=.true. + endif + if(worker_spectrum_epoch(worker).ne.worker_epoch(worker)) newdat1=.true. + if(.not.newdat1) then + do i=1,history_count + if(history(i)%epoch.ne.worker_epoch(worker) .or. & + history(i)%commit_generation.le.worker_spectrum_generation(worker) .or. & + history(i)%commit_generation.gt.worker_generation(worker)) cycle + if(abs(history(i)%frequency-frequency).lt.mtd_interaction_bandwidth) then + newdat1=.true. + exit + endif + enddo + endif + rebuild_spectrum=newdat1 + call wsjt_tsan_release_ft8_mtd() +!$omp end critical(ft8_mtd_canonical) + end subroutine mtd_refresh_candidate + + subroutine mtd_mark_spectrum_current(worker) + integer, intent(in) :: worker + + call assert_worker(worker) + worker_spectrum_generation(worker)=worker_generation(worker) + worker_spectrum_epoch(worker)=worker_epoch(worker) + end subroutine mtd_mark_spectrum_current + + subroutine mtd_commit_subtraction(worker,ipass,itone,f0,dt,residual,final_outcome) + integer, intent(in) :: worker,ipass,itone(79) + real, intent(in) :: f0,dt + real, intent(inout) :: residual(mtd_residual_samples) + integer, intent(out), optional :: final_outcome + type(ft8_subtraction_descriptor) :: descriptor + integer(int64) :: base_generation,base_epoch + integer :: outcome + + call assert_worker(worker) + call mtd_make_descriptor(descriptor,ipass,itone,f0,dt) + base_generation=worker_generation(worker) + base_epoch=worker_epoch(worker) + descriptor%epoch=base_epoch + call fit_subtraction(worker,residual,descriptor) + call mtd_try_commit_delta(worker,residual,descriptor,base_epoch, & + base_generation,subtraction_delta(:,worker),outcome) + if(outcome.ne.mtd_commit_conflict) then + if(present(final_outcome)) final_outcome=outcome + return + endif + + base_generation=worker_generation(worker) + base_epoch=worker_epoch(worker) + descriptor%epoch=base_epoch + call fit_subtraction(worker,residual,descriptor) + call mtd_try_commit_delta(worker,residual,descriptor,base_epoch, & + base_generation,subtraction_delta(:,worker),outcome) + if(outcome.ne.mtd_commit_conflict) then + if(present(final_outcome)) final_outcome=outcome + return + endif + +!$omp critical(ft8_mtd_canonical) + call wsjt_tsan_acquire_ft8_mtd() + descriptor%epoch=current_epoch + if(history_contains_duplicate(descriptor)) then + outcome=mtd_commit_duplicate + else + ! No caller holds an FFT lock while entering this transaction region. + call subtractft8var(canonical_residual,descriptor%tones, & + descriptor%frequency,descriptor%dt) + call record_commit(descriptor) + outcome=mtd_commit_fallback + endif + residual=canonical_residual + worker_generation(worker)=canonical_generation + worker_epoch(worker)=current_epoch + call wsjt_tsan_release_ft8_mtd() +!$omp end critical(ft8_mtd_canonical) + if(present(final_outcome)) final_outcome=outcome + end subroutine mtd_commit_subtraction + + subroutine mtd_capture_generation(worker,epoch,generation) + integer, intent(in) :: worker + integer(int64), intent(out) :: epoch,generation + + call assert_worker(worker) + epoch=worker_epoch(worker) + generation=worker_generation(worker) + end subroutine mtd_capture_generation + + subroutine mtd_try_commit_delta(worker,residual,descriptor,base_epoch, & + base_generation,delta,outcome) + integer, intent(in) :: worker + real, intent(inout) :: residual(mtd_residual_samples) + type(ft8_subtraction_descriptor), intent(in) :: descriptor + integer(int64), intent(in) :: base_epoch,base_generation + real, intent(in) :: delta(mtd_frame_samples) + integer, intent(out) :: outcome + logical :: stale + + call assert_worker(worker) +!$omp critical(ft8_mtd_canonical) + call wsjt_tsan_acquire_ft8_mtd() + if(history_contains_duplicate(descriptor)) then + outcome=mtd_commit_duplicate + else if(history_has_conflict(base_epoch,base_generation,descriptor)) then + outcome=mtd_commit_conflict + else + stale=base_epoch.ne.current_epoch .or. base_generation.ne.canonical_generation + call apply_fitted_subtraction(delta,descriptor) + if(stale) then + outcome=mtd_commit_independent + else + outcome=mtd_commit_current + endif + endif + if(outcome.eq.mtd_commit_conflict .or. outcome.eq.mtd_commit_duplicate .or. & + outcome.eq.mtd_commit_independent) residual=canonical_residual + worker_generation(worker)=canonical_generation + worker_epoch(worker)=current_epoch + call wsjt_tsan_release_ft8_mtd() +!$omp end critical(ft8_mtd_canonical) + end subroutine mtd_try_commit_delta + + subroutine fit_subtraction(worker,residual,descriptor) + integer, intent(in) :: worker + real, intent(inout) :: residual(mtd_residual_samples) + type(ft8_subtraction_descriptor), intent(in) :: descriptor + + call subtractft8var(residual,descriptor%tones, & + descriptor%frequency,descriptor%dt,subtraction_delta(:,worker)) + end subroutine fit_subtraction + + subroutine apply_fitted_subtraction(delta,descriptor) + real, intent(in) :: delta(mtd_frame_samples) + type(ft8_subtraction_descriptor), intent(in) :: descriptor + + integer :: i,j + + do i=1,mtd_frame_samples + j=descriptor%start_sample+i-1 + if(j.ge.1 .and. j.le.mtd_residual_samples) & + canonical_residual(j)=canonical_residual(j)+delta(i) + enddo + call record_commit(descriptor) + end subroutine apply_fitted_subtraction + + subroutine record_commit(descriptor) + type(ft8_subtraction_descriptor), intent(in) :: descriptor + + history_count=history_count+1 + if(history_count.gt.size(history)) error stop 'MTD transaction history capacity exceeded' + canonical_generation=canonical_generation+1_int64 + history(history_count)=descriptor + history(history_count)%commit_generation=canonical_generation + end subroutine record_commit + + logical function history_contains_duplicate(descriptor) + type(ft8_subtraction_descriptor), intent(in) :: descriptor + integer :: i + + history_contains_duplicate=.false. + do i=1,history_count + if(history(i)%epoch.ne.descriptor%epoch .or. & + history(i)%pass.ne.descriptor%pass) cycle + if(mtd_same_signal(history(i),descriptor)) then + history_contains_duplicate=.true. + return + endif + enddo + end function history_contains_duplicate + + logical function history_has_conflict(base_epoch,base_generation,descriptor) + integer(int64), intent(in) :: base_epoch,base_generation + type(ft8_subtraction_descriptor), intent(in) :: descriptor + integer :: i + + history_has_conflict=base_epoch.ne.current_epoch .or. & + descriptor%epoch.ne.current_epoch + if(history_has_conflict) return + do i=1,history_count + if(history(i)%epoch.ne.descriptor%epoch .or. & + history(i)%commit_generation.le.base_generation) cycle + if(mtd_descriptors_conflict(history(i),descriptor)) then + history_has_conflict=.true. + return + endif + enddo + end function history_has_conflict + + subroutine mtd_make_descriptor(descriptor,ipass,itone,f0,dt) + type(ft8_subtraction_descriptor), intent(out) :: descriptor + integer, intent(in) :: ipass,itone(79) + real, intent(in) :: f0,dt + + descriptor%tones=itone + descriptor%frequency=f0 + descriptor%dt=dt + descriptor%frequency_bin=nint(f0/0.0625) + descriptor%start_sample=mtd_start_sample(dt) + call mtd_clipped_interval(dt,descriptor%clipped_start,descriptor%clipped_end) + descriptor%epoch=current_epoch + descriptor%pass=ipass + descriptor%commit_generation=0_int64 + end subroutine mtd_make_descriptor + + integer function mtd_start_sample(dt) + real, intent(in) :: dt + + mtd_start_sample=int(dt*12000.0+1.0) + end function mtd_start_sample + + subroutine mtd_clipped_interval(dt,first_sample,last_sample) + real, intent(in) :: dt + integer, intent(out) :: first_sample,last_sample + integer :: start_sample + + start_sample=mtd_start_sample(dt) + first_sample=max(1,start_sample) + last_sample=min(mtd_residual_samples,start_sample+mtd_frame_samples-1) + end subroutine mtd_clipped_interval + + logical function mtd_same_signal(left,right) + type(ft8_subtraction_descriptor), intent(in) :: left,right + + mtd_same_signal=left%frequency_bin.eq.right%frequency_bin .and. & + left%start_sample.eq.right%start_sample .and. all(left%tones.eq.right%tones) + end function mtd_same_signal + + logical function mtd_descriptors_conflict(left,right) + type(ft8_subtraction_descriptor), intent(in) :: left,right + logical :: overlap + + overlap=left%clipped_start.le.left%clipped_end .and. & + right%clipped_start.le.right%clipped_end .and. & + left%clipped_start.le.right%clipped_end .and. & + right%clipped_start.le.left%clipped_end + mtd_descriptors_conflict=overlap .and. & + abs(left%frequency-right%frequency).lt.mtd_interaction_bandwidth + end function mtd_descriptors_conflict + + subroutine mtd_transform_phase(ipass) + integer, intent(in) :: ipass + +!$omp critical(ft8_mtd_canonical) + call wsjt_tsan_acquire_ft8_mtd() + if(ipass.eq.4) then + post_pass3_residual=canonical_residual + call mtd_forward_half_sample(canonical_residual) + else if(ipass.eq.7) then + canonical_residual=post_pass3_residual + call mtd_backward_half_sample(canonical_residual) + else + error stop 'Invalid MTD transform pass' + endif + current_epoch=current_epoch+1_int64 + canonical_generation=canonical_generation+1_int64 + call wsjt_tsan_release_ft8_mtd() +!$omp end critical(ft8_mtd_canonical) + end subroutine mtd_transform_phase + + subroutine mtd_finish(output_residual) + real, intent(out) :: output_residual(:) + + if(size(output_residual).ne.mtd_residual_samples) error stop & + 'MTD output residual has an unexpected sample count' +!$omp critical(ft8_mtd_canonical) + call wsjt_tsan_acquire_ft8_mtd() + output_residual=canonical_residual + call wsjt_tsan_release_ft8_mtd() +!$omp end critical(ft8_mtd_canonical) + end subroutine mtd_finish + + subroutine mtd_forward_half_sample(residual) + real, intent(inout) :: residual(:) + integer :: i + + if(size(residual).ne.mtd_residual_samples) error stop & + 'MTD forward transform has an unexpected sample count' + do i=1,mtd_residual_samples-1 + residual(i)=(residual(i)+residual(i+1))/2.0 + enddo + end subroutine mtd_forward_half_sample + + subroutine mtd_backward_half_sample(residual) + real, intent(inout) :: residual(:) + integer :: i + + if(size(residual).ne.mtd_residual_samples) error stop & + 'MTD backward transform has an unexpected sample count' + do i=mtd_residual_samples,2,-1 + residual(i)=(residual(i-1)+residual(i))/2.0 + enddo + end subroutine mtd_backward_half_sample + + subroutine assert_worker(worker) + integer, intent(in) :: worker + + if(worker.lt.1 .or. worker.gt.active_workers) error stop 'Invalid MTD worker index' + end subroutine assert_worker + +end module ft8_mtd_residual diff --git a/lib/ft8var/ft8_tsan.c b/lib/ft8var/ft8_tsan.c new file mode 100644 index 00000000..1905ca07 --- /dev/null +++ b/lib/ft8var/ft8_tsan.c @@ -0,0 +1,30 @@ +#if defined(__SANITIZE_THREAD__) +#include +#endif + +// GCC TSan does not observe libgomp synchronization. Stable tokens mirror the +// OpenMP edges without changing production synchronization. +#if defined(__SANITIZE_THREAD__) +#define WSJT_TSAN_SYNC(name) \ + static unsigned char name##_token; \ + void wsjt_tsan_acquire_##name(void) \ + { \ + __tsan_acquire(&name##_token); \ + } \ + void wsjt_tsan_release_##name(void) \ + { \ + __tsan_release(&name##_token); \ + } +#else +#define WSJT_TSAN_SYNC(name) \ + void wsjt_tsan_acquire_##name(void) {} \ + void wsjt_tsan_release_##name(void) {} +#endif + +WSJT_TSAN_SYNC(ft8_mtd) +WSJT_TSAN_SYNC(four2avar_setup) +WSJT_TSAN_SYNC(ft8_find_dupes) +WSJT_TSAN_SYNC(ft8_update_structures) +WSJT_TSAN_SYNC(decoder_section_primary) +WSJT_TSAN_SYNC(decoder_section_secondary) +WSJT_TSAN_SYNC(msk40_sync) diff --git a/lib/ft8var/ft8apsetvar.f90 b/lib/ft8var/ft8apsetvar.f90 index 6a247a38..f23d604e 100644 --- a/lib/ft8var/ft8apsetvar.f90 +++ b/lib/ft8var/ft8apsetvar.f90 @@ -7,15 +7,28 @@ subroutine ft8apsetvar(lmycallstd,lhiscallstd,numthreads) character*77 c77 character*37 msg,msgchk character*12 hiscallt,mycallprev,hiscallprev + integer :: i1,i3,n3,nlenmyc logical lnohiscall,unpk77_successvar,first logical(1) lhoundprev logical(1), intent(in) :: lmycallstd,lhiscallstd + type(unpack77_options) :: no_record_options + type(pack77_options) :: no_tx_hash_options data mycallprev/'QQ2QQ'/ data hiscallprev/'QQ1QQ'/ data lhoundprev/.false./ data first/.true./ save hiscallprev,mycallprev,lhoundprev,first + i1=0 + i3=-1 + n3=-1 + nlenmyc=0 +! AP mask generation packs and unpacks synthetic messages only to derive symbol +! masks; it must not teach those calls to the shared hash or recent-call state. + no_record_options=unpack77_options(record_hashes=.false., & + record_recent_calls=.false.) + no_tx_hash_options=pack77_options(record_tx_hashes=.false.) + if(hiscall.ne.hiscallprev .or. mycall.ne.mycallprev .or. (lhound.neqv.lhoundprev) .or. first) then ! first for lhound triggered first=.false.; mycallprev=mycall; lhoundprev=lhound @@ -38,8 +51,8 @@ subroutine ft8apsetvar(lmycallstd,lhiscallstd,numthreads) else; msg='CQ '//trim(hiscall) endif - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) !read(c77(75:77),'(b3)') k3; print *,'i3 =',k3; print *,msgchk if(lhiscallstd .and. i3.ne.1 .or. .not.lhiscallstd .and. i3.ne.4 .or. (msg.ne.msgchk) .or. .not.unpk77_successvar) go to 1 read(c77,'(77i1)',err=1) apcqsym(1:77) @@ -49,8 +62,8 @@ subroutine ft8apsetvar(lmycallstd,lhiscallstd,numthreads) if(lhiscallstd .and. .not.lmycallstd) then msg=trim(hiscall)//' '//trim(hiscall)//' RRR' i3=0; n3=0 - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) !read(c77(75:77),'(b3)') k3; print *,'i3 =',k3; print *,msgchk if(i3.ne.1 .or. (msg.ne.msgchk) .or. .not.unpk77_successvar) go to 2 read(c77,'(58i1)',err=2) apsymdxstd(1:58) @@ -60,16 +73,16 @@ subroutine ft8apsetvar(lmycallstd,lhiscallstd,numthreads) if(.not.lhound .and. .not.lhiscallstd .and. len_trim(hiscall).gt.2) then ! nonstandard DXCall searching msg=' '//trim(hiscall)//' RR73' - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) !read(c77(75:77),'(b3)') k3; print *,'i3 =',k3; print *,msgchk if(i3.ne.4 .or. .not.unpk77_successvar) go to 3 read(c77,'(77i1)',err=3) apsymdxnsrr73(1:77) apsymdxnsrr73=2*apsymdxnsrr73-1 msg=' '//trim(hiscall)//' 73' - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) !read(c77(75:77),'(b3)') k3; print *,'i3 =',k3; print *,msgchk if(i3.ne.4 .or. .not.unpk77_successvar) go to 4 read(c77,'(77i1)',err=4) apsymdxns73(1:77) @@ -80,28 +93,28 @@ subroutine ft8apsetvar(lmycallstd,lhiscallstd,numthreads) if(.not.lhound .and. .not.lmycallstd .and. len_trim(mycall).gt.2) then if(lhiscallstd) then msg='<'//trim(mycall)//'> '//trim(hiscall)//' -15' - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) if(i3.ne.1 .or. msg.ne.msgchk .or. .not.unpk77_successvar) go to 5 read(c77,'(58i1)',err=5) apsymmyns2(1:58) apsymmyns2=2*apsymmyns2-1 nlenmyc=len_trim(mycall) msg=trim(mycall)//' <'//trim(hiscall)//'> RR73' - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) if(i3.ne.4 .or. msg.ne.msgchk .or. .not.unpk77_successvar) go to 6 read(c77,'(77i1)',err=6) apsymmynsrr73(1:77) apsymmynsrr73=2*apsymmynsrr73-1 msg=trim(mycall)//' <'//trim(hiscall)//'> 73' - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) if(i3.ne.4 .or. msg.ne.msgchk .or. .not.unpk77_successvar) go to 7 read(c77,'(77i1)',err=7) apsymmyns73(1:77) apsymmyns73=2*apsymmyns73-1 msg=trim(mycall)//' <'//trim(hiscall)//'> RRR' - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) if(i3.ne.4 .or. msg.ne.msgchk .or. .not.unpk77_successvar) go to 15 read(c77,'(77i1)',err=15) apsymmynsrrr(1:77) apsymmynsrrr=2*apsymmynsrrr-1 @@ -109,8 +122,8 @@ subroutine ft8apsetvar(lmycallstd,lhiscallstd,numthreads) else if(lnohiscall) then msg='<'//trim(mycall)//'> ZZ1ZZZ -15' - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) if(i3.ne.1 .or. msgchk.ne.msg .or. .not.unpk77_successvar) go to 8 read(c77,'(29i1)',err=8) apsymmyns1(1:29) apsymmyns1=2*apsymmyns1-1 @@ -122,8 +135,8 @@ subroutine ft8apsetvar(lmycallstd,lhiscallstd,numthreads) if(.not.lhound .and. lmycallstd .and. (lhiscallstd .or. lnohiscall)) then msg=trim(mycall)//' '//trim(hiscallt)//' RRR' i3=0; n3=0 - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) !read(c77(75:77),'(b3)') k3; print *,'i3 =',k3; print *,msgchk if(i3.ne.1 .or. (msg.ne.msgchk) .or. .not.unpk77_successvar) go to 9 read(c77,'(58i1)',err=9) apsym(1:58) @@ -134,8 +147,8 @@ subroutine ft8apsetvar(lmycallstd,lhiscallstd,numthreads) ! standard messages from Fox, always base callsigns if(len_trim(hisbcall).gt.2 .and. len_trim(mybcall).gt.2) then msg=trim(mybcall)//' '//trim(hisbcall)//' -15' - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) !read(c77(75:77),'(b3)') k3; print *,'i3 =',k3; print *,msgchk if(i3.ne.1 .or. (msg.ne.msgchk) .or. .not.unpk77_successvar) go to 9 read(c77,'(58i1)',err=9) apsym(1:58) @@ -147,8 +160,8 @@ subroutine ft8apsetvar(lmycallstd,lhiscallstd,numthreads) ! special messages msg=trim(mycall)//' RR73; '//trim(mycall)//' <'//trim(hiscallt)//'> -16' i3=0; n3=1 - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) !read(c77(75:77),'(b3)') k3; print *,'i3 =',k3; print *,msgchk i1=0; i1=index(msgchk,'<'); if(i1.lt.15) return if(i3.ne.0 .or. msg(1:i1).ne.msgchk(1:i1) .or. .not.unpk77_successvar) go to 10 @@ -158,32 +171,32 @@ subroutine ft8apsetvar(lmycallstd,lhiscallstd,numthreads) if(.not.lhound .and. lmycallstd .and. .not.lhiscallstd .and. len_trim(hiscall).gt.2) then msg=trim(mycall)//' <'//trim(hiscall)//'> -16' ! report, rreport - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) !read(c77(75:77),'(b3)') k3; print *,'i3 =',k3; print *,msgchk if(i3.ne.1 .or. msg.ne.msgchk .or. .not.unpk77_successvar) go to 11 read(c77,'(58i1)',err=11) apsymdxns1(1:58) apsymdxns1=2*apsymdxns1-1 msg='<'//trim(mycall)//'> '//trim(hiscall)//' RRR' - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) !read(c77(75:77),'(b3)') k3; print *,'i3 =',k3; print *,msgchk if(i3.ne.4 .or. msg.ne.msgchk .or. .not.unpk77_successvar) go to 12 read(c77,'(77i1)',err=12) apsymdxnsrrr(1:77) apsymdxnsrrr=2*apsymdxnsrrr-1 msg='<'//trim(mycall)//'> '//trim(hiscall)//' RR73' - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) !read(c77(75:77),'(b3)') k3; print *,'i3 =',k3; print *,msgchk if(i3.ne.4 .or. msg.ne.msgchk .or. .not.unpk77_successvar) go to 13 read(c77,'(77i1)',err=13) apsymdxnsr73(1:77) apsymdxnsr73=2*apsymdxnsr73-1 msg='<'//trim(mycall)//'> '//trim(hiscall)//' 73' - call pack77var(msg,i3,n3,c77,0) - call unpack77var(c77,1,msgchk,unpk77_successvar,25) + call pack77(msg,i3,n3,c77,no_tx_hash_options) + call unpack77_configured(c77,1,msgchk,unpk77_successvar,no_record_options) !read(c77(75:77),'(b3)') k3; print *,'i3 =',k3; print *,msgchk if(i3.ne.4 .or. msg.ne.msgchk .or. .not.unpk77_successvar) go to 14 read(c77,'(77i1)',err=14) apsymdxns732(1:77) diff --git a/lib/ft8var/ft8bvar.f90 b/lib/ft8var/ft8bvar.f90 index 6a12b933..caf1d94c 100644 --- a/lib/ft8var/ft8bvar.f90 +++ b/lib/ft8var/ft8bvar.f90 @@ -1,47 +1,57 @@ -subroutine ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos,freqsub, & - tmpcqdec,tmpmyc,nagainfil,iaptype,f1,xdt,nbadcrc,lft8sdec,msg37,msg37_2, & +subroutine ft8bvar(residual,spectrum,newdat1,nQSOProgress,nfqso,nftx,napwid, & + lsubtract,tmpcqdec,tmpmyc,nagainfil,iaptype,f1,xdt,nbadcrc,lft8sdec, & + msg37,msg37_2, & xsnr,stophint,nthr,lFreeText,ipass,lft8subpass,lspecial,lcqcand,ncqsignal, & nmycsignal,npass,i3bit,lft8s,lmycallstd,lhiscallstd,levenint,loddint,lft8sd, & i3,n3,nft8rxfsens,ncount,msgsrcvd,lrepliedother,lhashmsg,lqsothread, & - lft8lowth,lhighsens,lsubtracted,tmpcqsig,tmpmycsig,tmpqsosig,lnohiscall, & - lnomycall,lnohisgrid,qual,iaptype2) + lft8lowth,lhighsens,tmpcqsig,tmpmycsig,tmpqsosig,lnohiscall, & + lnomycall,lnohisgrid,qual,iaptype2,progress_generation) - use packjt77, only : unpack77var + use packjt77, only : unpack77, unpack77_configured, unpack77_options + use ft8_mtd_residual, only : mtd_commit_subtraction,mtd_mark_spectrum_current, & + mtd_refresh_candidate + use decode_completion_module, only : write_decode_progress use ft8_mod1, only : allmessages,ndecodes,apsym,mcq,m73,mrr73,mrrr,icos7, & naptypes,nhaptypes,one,graymap,oddcopy,evencopy,lastrxmsg,lasthcall, & nlasttx,calldteven,calldtodd,lqsomsgdcd,mycalllen1,msgroot,msgrootlen, & - allfreq,idtone25,lapmyc,idtonemyc,mycall,hiscall,lhound,apsymsp, & + allfreq,idtone25,idtone25_valid,lapmyc,idtonemyc,mycall,hiscall,lhound,apsymsp, & ndxnsaptypes,apsymdxns1,apsymdxnsrrr,lenabledxcsearch,lwidedxcsearch, & apcqsym,apsymdxnsrr73,apsymdxns73,mybcall,hisbcall,lskiptx1,nft8cycles, & ctwkw,ctwkn,nincallthr,msgincall,xdtincall,maskincallthr,ctwk256,numcqsig, & numdeccq,evencq,oddcq,nummycsig,numdecmyc,evenmyc,oddmyc,idtone56, & + idtone56_valid, & idtonecqdxcns,evenqso,oddqso,nmycnsaptypes,apsymmyns1,apsymmyns2, & apsymmynsrr73,apsymmyns73,apsymdxstd,apsymdxnsr73,apsymdxns732,ltxing, & apsymmynsrrr,idtonedxcns73,idtonefox73,idtonespec !ft8md added include 'ft8_params.f90' + real, intent(inout) :: residual(180000) + complex, intent(inout) :: spectrum(0:96000) character c77*77,msg37*37,msg37_2*37,msgd*37,msgbase37*37,call_a*12,call_b*12 character callsign*12,grid*12 character*37 msgsrcvd(130) complex cd0(-800:4000),cd1(-800:4000),cd2(-800:4000),cd3(-800:4000),ctwk(32), & - csymb(32),cs(0:7,79),csymbr(32),csr(0:7,79),csig(32),csig0(151680),z1, & + csymb(32),cs(0:7,79),csymbr(32),csr(0:7,79),csig(32),z1, & csymb256(256),cstmp2(0:7,79),csold(0:7,79),cscs(0:7,79) + complex, allocatable :: csig0(:) real a(5),s8(0:7,79),s82(0:7,79),s2(0:511),sp(0:7),s81(0:7),snrsync(21), & - syncw(7),sumkw(7),scoreratiow(7),freqsub(200),s256(0:8),s2563(0:26), & + syncw(7),sumkw(7),scoreratiow(7),s256(0:8),s2563(0:26), & syncavpart(3) real bmeta(174),bmetb(174),bmetc(174),bmetd(174) real llra(174),llrb(174),llrc(174),llrd(174),llrz(174) real qual !ft8md integer*1 message77(77),apmask(174),cw(174),nsmax(8) integer itone(79),ip(1),ka(1),nqsoend(3) - integer, intent(in) :: nQSOProgress,nfqso,nftx,napwid,nthr,ipass,nft8rxfsens + integer, intent(in) :: nQSOProgress,nfqso,nftx,napwid,nthr,ipass,nft8rxfsens, & + progress_generation logical newdat1,lsubtract,lFreeText,nagainfil,lspecial,unpk77_successvar + logical rebuild_spectrum logical(1), intent(in) :: stophint,lft8subpass,lmycallstd,lhiscallstd, & lqsothread,lft8lowth,lhighsens,lcqcand,levenint,loddint,lnohiscall, & lnomycall,lnohisgrid logical(1) falsedec,lastsync,ldupemsg,lft8s,lft8sdec,lft8sd,lsdone,ldupeft8sd, & lrepliedother,lhashmsg,lvirtual2,lvirtual3,lsd,lcq,ldeepsync,lcallsstd, & - lfound,lsubptxfreq,lreverse,lchkcall,lgvalid,lwrongcall,lsubtracted, & + lfound,lsubptxfreq,lreverse,lchkcall,lgvalid,lwrongcall, & lcqsignal,loutapwid,lfoundcq,lmycsignal,lfoundmyc,lqsosig,ldxcsig, & lcqdxcsig,lcqdxcnssig,lqsocandave,lcall1hash,lqsosigtype3,lqso73,lqsorr73, & lqsorrr,lfoxspecrpt,lfoxstdr73,lapcqonly,lcall2hash,lskipnotap @@ -185,8 +195,10 @@ subroutine ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos,freqsub endif endif - call ft8_downsamplevar(newdat1,f1,nqso,cd0,cd2,cd3,lhighsens,lsubtracted,npos, & - freqsub) !Mix f1 to baseband and downsample + call mtd_refresh_candidate(nthr,f1,newdat1,rebuild_spectrum) + call ft8_downsamplevar(residual,spectrum,newdat1,f1,nqso,cd0,cd2,cd3, & + lhighsens) !Mix f1 to baseband and downsample + if(rebuild_spectrum) call mtd_mark_spectrum_current(nthr) lsd=.false. isd=1 @@ -847,16 +859,18 @@ subroutine ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos,freqsub if(.not.lqsomsgdcd .and. (dfqso.lt.napwid .or. abs(nftx-f1).lt.napwid) .and. & lapmyc .and. len_trim(hiscall).gt.2) then nqsot=0 - do i=1,19 - ip=maxloc(s8(:,i+7)) - if(ip(1).eq.idtone56(1,i)+1) nqsot=nqsot+1 - enddo - if(nqsot.gt.6) lqsosig=.true. ! decoding depth only - do i=20,22 - ip=maxloc(s8(:,i+7)) - if(ip(1).eq.idtone56(1,i)+1) nqsot=nqsot+1 - enddo - if(nqsot.gt.3) lqsosigtype3=.true. + if(idtone56_valid(1)) then + do i=1,19 + ip=maxloc(s8(:,i+7)) + if(ip(1).eq.idtone56(1,i)+1) nqsot=nqsot+1 + enddo + if(nqsot.gt.6) lqsosig=.true. ! decoding depth only + do i=20,22 + ip=maxloc(s8(:,i+7)) + if(ip(1).eq.idtone56(1,i)+1) nqsot=nqsot+1 + enddo + if(nqsot.gt.3) lqsosigtype3=.true. + endif nqsoend=0 ! array 73,rr73,rrr if(dfqso.lt.napwid .and. (nQSOProgress.eq.3 .or. nQSOProgress.eq.4)) then ! QSO RX freq only @@ -866,9 +880,9 @@ subroutine ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos,freqsub else ip=maxloc(s8(:,i+14)) endif - if(ip(1).eq.idtone56(56,i)+1) nqsoend(1)=nqsoend(1)+1 - if(ip(1).eq.idtone56(55,i)+1) nqsoend(2)=nqsoend(2)+1 - if(ip(1).eq.idtone56(54,i)+1) nqsoend(3)=nqsoend(3)+1 + if(idtone56_valid(56) .and. ip(1).eq.idtone56(56,i)+1) nqsoend(1)=nqsoend(1)+1 + if(idtone56_valid(55) .and. ip(1).eq.idtone56(55,i)+1) nqsoend(2)=nqsoend(2)+1 + if(idtone56_valid(54) .and. ip(1).eq.idtone56(54,i)+1) nqsoend(3)=nqsoend(3)+1 enddo ip=maxloc(nqsoend) if(nqsoend(ip(1)).gt.6) then @@ -900,10 +914,12 @@ subroutine ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos,freqsub lcqdxcnssig=.false. ndxt=0 if(lhiscallstd) then - do k11=17,26 - ip=maxloc(s8(:,k11)) - if(ip(1).eq.idtone56(1,k11-7)+1) ndxt=ndxt+1 - enddo + if(idtone56_valid(1)) then + do k11=17,26 + ip=maxloc(s8(:,k11)) + if(ip(1).eq.idtone56(1,k11-7)+1) ndxt=ndxt+1 + enddo + endif if(ndxt.gt.3) ldxcsig=.true. if(lcqsignal .and. ldxcsig) lcqdxcsig=.true. endif @@ -1056,6 +1072,7 @@ subroutine ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos,freqsub endif do isubp1=1,nsubpasses + call write_decode_progress(progress_generation) if(nweak.eq.1 .and. isubp1.eq.2) cycle ! skip if it is lmycsignal, can be both lcq and lmy @@ -1307,6 +1324,7 @@ subroutine ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos,freqsub ! print*,'hisgrid is ',hisgrid do isubp2=1,31 + call write_decode_progress(progress_generation) if(isubp2.lt.5) then if(lapcqonly .or. lskipnotap) cycle if(ltxing) then @@ -1381,6 +1399,7 @@ subroutine ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos,freqsub if(iaptype.eq.1) then if(isubp2.eq.20) then + if(.not.idtone25_valid(2)) cycle scqlev=0. do i4=1,9 scqlev=scqlev+s8(idtone25(2,i4),i4+7) @@ -1553,6 +1572,7 @@ subroutine ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos,freqsub if(iaptype.eq.1) then if(isubp2.eq.20) then + if(.not.idtone25_valid(2)) cycle scqlev=0. do i4=1,9 scqlev=scqlev+s8(idtone25(2,i4),i4+7) @@ -1703,6 +1723,7 @@ subroutine ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos,freqsub if(iaptype.eq.1) then if(isubp2.eq.20) then + if(.not.idtone25_valid(2)) cycle scqlev=0. do i4=1,9 scqlev=scqlev+s8(idtone25(2,i4),i4+7) @@ -2091,7 +2112,8 @@ subroutine ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos,freqsub if(nagainfil) ndeep=5 !print *,omp_get_nested(),OMP_get_num_threads() - call osd174_91var(llrz,apmask,ndeep,message77,cw,nharderrors,dmin,nthr) + call osd174_91var(llrz,apmask,ndeep,message77,cw,nharderrors,dmin, & + nthr,progress_generation) endif nbadcrc=1 @@ -2253,7 +2275,8 @@ subroutine ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos,freqsub ! and n3.eq.5 for USA calls with EU VHF ! added .or. n3.eq.2 .or. n3.eq.8 .or. n3.eq.9 as test for EU VHF !print*,'did not cycle at line 2248' - call unpack77var(c77,1,msg37,unpk77_successvar,nthr) + call unpack77_configured(c77,1,msg37,unpk77_successvar, & + unpack77_options(thread_index=nthr)) if(.not.unpk77_successvar) then if(lqsothread .and. (.not.lhound .and. iaptype.ge.3 .or. lhound .and. & (iaptype.eq.21 .or. iaptype.eq.23)) .and. .not.lsdone) then @@ -2901,6 +2924,7 @@ subroutine ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos,freqsub syncp=0. syncm=0. k=1 + allocate(csig0(151680)) call gen_ft8wavevar(itone,79,1920,2.0,12000.0,0.0,csig0,xjunk,1,151680) do i=0,78 do j=1,32 @@ -2920,6 +2944,7 @@ subroutine ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos,freqsub z1=sum(cd0(i21:i21+31)*conjg(csig)) syncm = syncm + real(z1)**2 + aimag(z1)**2 enddo + deallocate(csig0) call peakup(syncm,sync0,syncp,dx) if(abs(dx).gt.1.0) then scorr=0. @@ -2927,12 +2952,7 @@ subroutine ft8bvar(newdat1,nQSOProgress,nfqso,nftx,napwid,lsubtract,npos,freqsub scorr=real(noff)*(dx) ! was * dx ft8md endif xdt3=xdt+scorr*dt2 - call subtractft8var(itone,f1,xdt3) - lsubtracted=.true. ! inside current thread - if(npos.lt.200) then - npos=npos+1 - freqsub(npos)=f1 - endif + call mtd_commit_subtraction(nthr,ipass,itone,f1,xdt3,residual) endif endif diff --git a/lib/ft8var/ft8mf1var.f90 b/lib/ft8var/ft8mf1var.f90 index eff9f236..df4400bd 100644 --- a/lib/ft8var/ft8mf1var.f90 +++ b/lib/ft8var/ft8mf1var.f90 @@ -1,7 +1,7 @@ subroutine ft8mf1var(s8,itone,msgd,msg37,lft8sd) - use ft8_mod1, only : itone76,idtone76,msgsd76 + use ft8_mod1, only : itone76,idtone76,msgsd76,idtone76_valid real, intent(in) :: s8(0:7,79) real s8d(0:7,58) character msgd*37,msg37*37,msggrid*37,c1*12,c2*12,grid*4 @@ -37,6 +37,7 @@ subroutine ft8mf1var(s8,itone,msgd,msg37,lft8sd) ipk=0; u1=0.0; u2=0.0 do k=1,76 + if(.not.idtone76_valid(k)) cycle psum=0.; ref=ref0 do j=1,58; i3=idtone76(k,j); psum=psum + s8d(i3,j); if(i3.eq.mrs(j)) ref=ref - s8d(i3,j) + s8d(mrs2(j),j); enddo p=psum/ref diff --git a/lib/ft8var/ft8mfcqvar.f90 b/lib/ft8var/ft8mfcqvar.f90 index 092493da..bd58058e 100644 --- a/lib/ft8var/ft8mfcqvar.f90 +++ b/lib/ft8var/ft8mfcqvar.f90 @@ -1,7 +1,7 @@ subroutine ft8mfcqvar(s8,itone,msgd,msg37,lft8sd) - use ft8_mod1, only : idtone25 + use ft8_mod1, only : idtone25,idtone25_valid real, intent(in) :: s8(0:7,79) real s8d(0:7,58) character*37 msgd,msg37,msgsent37 @@ -10,10 +10,14 @@ subroutine ft8mfcqvar(s8,itone,msgd,msg37,lft8sd) logical(1) lft8sd if(len_trim(msgd).lt.6) return + idtone25(1,1:58)=0 + idtone25_valid(1)=.false. i3=-1; n3=-1 call genft8sdvar(msgd,i3,n3,msgsent37,msgbits,itone) + if(i3.lt.0) return idtone25(1,1:29)=itone(8:36) idtone25(1,30:58)=itone(44:72) + idtone25_valid(1)=.true. thresh=0.0; i1=0; i2=0 do i=1,58; if(i.le.29) then; s8d(0:7,i)=s8(0:7,i+7); else; s8d(0:7,i)=s8(0:7,i+14); endif; enddo @@ -28,6 +32,7 @@ subroutine ft8mfcqvar(s8,itone,msgd,msg37,lft8sd) ipk=0; u1=0.0; u2=0.0 do k=1,25 + if(.not.idtone25_valid(k)) cycle psum=0.; ref=ref0 do j=1,58; i3=idtone25(k,j); psum=psum + s8d(i3,j); if(i3.eq.mrs(j)) ref=ref - s8d(i3,j) + s8d(mrs2(j),j); enddo p=psum/ref diff --git a/lib/ft8var/ft8sd1var.f90 b/lib/ft8var/ft8sd1var.f90 index 7436e586..3c6fd2c5 100644 --- a/lib/ft8var/ft8sd1var.f90 +++ b/lib/ft8var/ft8sd1var.f90 @@ -9,7 +9,7 @@ subroutine ft8sd1var(s8,itone,msgd,msg37,lft8sd,lcq) integer itone(79),itonedem(58),idtone(58),ip1(1) integer*1 msgbits(77) logical(1), intent(in) :: lcq - logical(1) lft8sd,lr73,lgrid,lmatched(58) + logical(1) lft8sd,lr73,lgrid,lmatched(58),valid4(4) lmatched=.false.; lr73=.false.; lgrid=.false. itonedem=11 @@ -41,13 +41,17 @@ subroutine ft8sd1var(s8,itone,msgd,msg37,lft8sd,lcq) i3=-1; n3=-1 msg372=msgd call genft8sdvar(msg372,i3,n3,msgsent37,msgbits,itone) + if(i3.lt.0) return idtone(1:29)=itone(8:36) idtone(30:58)=itone(44:72) else + valid4=.false. do i=1,4 msg372=msg4(i) i3=-1; n3=-1 call genft8sdvar(msg372,i3,n3,msgsent37,msgbits,itone) + if(i3.lt.0) cycle + valid4(i)=.true. idtone4(i,1:29)=itone(8:36) idtone4(i,30:58)=itone(44:72) itone4(i,1:79)=itone(1:79) @@ -70,6 +74,7 @@ subroutine ft8sd1var(s8,itone,msgd,msg37,lft8sd,lcq) else nmatchditer1=0; ncrcpatyiter1=0 do i=1,4 + if(.not.valid4(i)) cycle nmatch1=0; ncrcpaty1=0 do k=1,58 if(idtone4(i,k).eq.itonedem(k)) then; nmatch1=nmatch1+1; if(k.gt.25) ncrcpaty1=ncrcpaty1+1; endif diff --git a/lib/ft8var/ft8sdvar.f90 b/lib/ft8var/ft8sdvar.f90 index 202aa711..f6332e64 100644 --- a/lib/ft8var/ft8sdvar.f90 +++ b/lib/ft8var/ft8sdvar.f90 @@ -9,7 +9,7 @@ subroutine ft8sdvar(s8,srr,itone,msgd,msg37,lft8sd,lcq) integer itone(79),itonedem(58),idtone(58),ip1(1) integer*1 msgbits(77) logical(1), intent(in) :: lcq - logical(1) lft8sd,lmatched(58) + logical(1) lft8sd,lmatched(58),valid4(4) if(index(msgd,' RR73').gt.0 .or. index(msgd,' 73').gt.0) return ! do not process 73 messages ! do not process messages with grid @@ -39,13 +39,17 @@ subroutine ft8sdvar(s8,srr,itone,msgd,msg37,lft8sd,lcq) i3=-1; n3=-1 msg372=msgd call genft8sdvar(msg372,i3,n3,msgsent37,msgbits,itone) + if(i3.lt.0) return idtone(1:29)=itone(8:36) idtone(30:58)=itone(44:72) else + valid4=.false. do i=1,4 msg372=msg4(i) i3=-1; n3=-1 call genft8sdvar(msg372,i3,n3,msgsent37,msgbits,itone) + if(i3.lt.0) cycle + valid4(i)=.true. idtone4(i,1:29)=itone(8:36) idtone4(i,30:58)=itone(44:72) itone4(i,1:79)=itone(1:79) @@ -67,6 +71,7 @@ subroutine ft8sdvar(s8,srr,itone,msgd,msg37,lft8sd,lcq) else nmatchditer1=0; nbaseiter1=0; ncrcpatyiter1=0; do i=1,4 + if(.not.valid4(i)) cycle nmatch1=0; nbase1=0; ncrcpaty1=0 do k=1,58 if(idtone4(i,k).eq.itonedem(k)) then diff --git a/lib/ft8var/ft8svar.f90 b/lib/ft8var/ft8svar.f90 index 17aa58f7..1d0cc4fc 100644 --- a/lib/ft8var/ft8svar.f90 +++ b/lib/ft8var/ft8svar.f90 @@ -1,7 +1,8 @@ subroutine ft8svar(s8,srr,itone,msg37,lft8s,nft8rxfsens,stophint) - use ft8_mod1, only : itone56,idtone56,msg,nlasttx,lastrxmsg,mycall,hiscall + use ft8_mod1, only : itone56,idtone56,msg,nlasttx,lastrxmsg,mycall,hiscall, & + idtone56_valid real, intent(in) :: s8(0:7,79),srr real s8_1(0:7,79),s8d(0:7,58),xsync(21),xmsync(21),xdata(58),xmdata(58),xnoise(79),xmnoise(79) character, intent(out) :: msg37*37 @@ -9,6 +10,7 @@ subroutine ft8svar(s8,srr,itone,msg37,lft8s,nft8rxfsens,stophint) integer, intent(out) :: itone(79) integer, intent(in) :: nft8rxfsens integer itonedem(58),idtone(58),mrs(58),mrs2(58),mrs3(58),mrs4(58),ip1(1) + integer*1 msgbits(77) logical(1), intent(in) :: stophint logical(1), intent(out) :: lft8s logical(1) lmatched(58),lmycall,lhiscall,lrrr,lr73,lcallingrprt,lastrrprt,lastreport,lgrid @@ -53,12 +55,18 @@ subroutine ft8svar(s8,srr,itone,msg37,lft8s,nft8rxfsens,stophint) if(lastrxmsg(1)%lstate .and. .not.lmycall .and. lhiscall .and. nlasttx.eq.2) lcallingrprt=.true. ! calling with REPORT if(lgrid .and. index(msg(53),trim(mycall)//' '//trim(hiscall)//' AA00').eq.1) then ! standard callsigns + idtone56(53,1:58)=0 + itone56(53,1:79)=0 + idtone56_valid(53)=.false. i3=-1; n3=-1 - msg(53)=lastrxmsg(1)%lastmsg - call genft8sdvar(msg(53),i3,n3,msgsent37,msgbits,itone) - idtone56(53,1:29)=itone(8:36) - idtone56(53,30:58)=itone(44:72) - itone56(53,1:79)=itone(1:79) + call genft8sdvar(lastrxmsg(1)%lastmsg,i3,n3,msgsent37,msgbits,itone) + if(i3.ge.0) then + msg(53)=lastrxmsg(1)%lastmsg + idtone56(53,1:29)=itone(8:36) + idtone56(53,30:58)=itone(44:72) + itone56(53,1:79)=itone(1:79) + idtone56_valid(53)=.true. + endif endif do i=1,58 @@ -67,9 +75,11 @@ subroutine ft8svar(s8,srr,itone,msg37,lft8s,nft8rxfsens,stophint) enddo nmycall1=0; nbase1=0 - do k=1,19 - if(idtone56(1,k).eq.itonedem(k)) then; if(k.lt.10) nmycall1=nmycall1+1; nbase1=nbase1+1; endif - enddo + if(idtone56_valid(1)) then + do k=1,19 + if(idtone56(1,k).eq.itonedem(k)) then; if(k.lt.10) nmycall1=nmycall1+1; nbase1=nbase1+1; endif + enddo + endif ! /'-01 ','-02 ','-03 ','-04 ','-05 ','-06 ','-07 ','-08 ','-09 ','-10 ', ! '-11 ','-12 ','-13 ','-14 ','-15 ','-16 ','-17 ','-18 ','-19 ','-20 ', @@ -89,6 +99,7 @@ subroutine ft8svar(s8,srr,itone,msg37,lft8s,nft8rxfsens,stophint) nmatchditer1=0; ncrcpatyiter1=0; imax=0 do i=ilow,ihigh + if(.not.idtone56_valid(i)) cycle if(lastreport .and. i.gt.26 .and. i.lt.54) cycle ! RREPORT is not a valid msg, direction change is not allowed nmatch1=0; ncrcpaty1=0 do k=1,58 @@ -132,6 +143,7 @@ subroutine ft8svar(s8,srr,itone,msg37,lft8s,nft8rxfsens,stophint) ref0oth=ref0mycl+ref0paty ipk=0; u1=0.; u2=0.; u1paty=0.; u2paty=0.; u1oth=0.; u2oth=0. do k=ilow,ihigh + if(.not.idtone56_valid(k)) cycle if(lastreport .and. k.gt.26 .and. k.lt.54) cycle ! GRID, RREPORT is not a valid msg, direction change is not allowed psum=0.0; ref=ref0; psumpaty=0.; refpaty=ref0paty; psumoth=0.; refoth=ref0oth do j=1,58; i=idtone56(k,j); psum=psum + s8d(i,j) diff --git a/lib/ft8var/gen_ft8wavevar.f90 b/lib/ft8var/gen_ft8wavevar.f90 index 2920332a..187e487a 100644 --- a/lib/ft8var/gen_ft8wavevar.f90 +++ b/lib/ft8var/gen_ft8wavevar.f90 @@ -10,6 +10,7 @@ subroutine gen_ft8wavevar(itone,nsym,nsps,bt,fsample,f0,cwave,wave,icmplx,nwave) integer itone(nsym) data ibt0/0/ save pulse,twopi,dt,hmod,ibt0,ctab +!$omp threadprivate(pulse,twopi,dt,hmod,ibt0,ctab) ibt=nint(10*bt) if(ibt0.ne.ibt) then diff --git a/lib/ft8var/genft8sdvar.f90 b/lib/ft8var/genft8sdvar.f90 index 57d1560e..ae2ca408 100644 --- a/lib/ft8var/genft8sdvar.f90 +++ b/lib/ft8var/genft8sdvar.f90 @@ -3,7 +3,7 @@ subroutine genft8sdvar(msg,i3,n3,msgsent,msgbits,itone) ! Encode an FT8 message, producing array itone(). - use packjt77sdvar + use packjt77 use ft8_mod1, only : icos7,graymap character msg*37,msgsent*37,c77*77 integer*1 msgbits(77),codeword(174) @@ -12,8 +12,16 @@ subroutine genft8sdvar(msg,i3,n3,msgsent,msgbits,itone) i3=-1 n3=-1 - call pack77sdvar(msg,i3,n3,c77) - call unpack77sdvar(c77,msgsent,unpk77_successvar) + call pack77(msg,i3,n3,c77,pack77_options(record_tx_hashes=.false.)) + ! SD thresholds are calibrated for classic Type 1/2 templates only. + if(.not.(i3.ge.0 .and. (i3.eq.1 .or. i3.eq.2) .and. & + index(msg,'<').eq.0)) then + i3=-1 + n3=-1 + endif + if(i3.lt.0) go to 1 + call unpack77_configured(c77,0,msgsent,unpk77_successvar, & + unpack77_options(record_hashes=.false.,record_recent_calls=.false.)) read(c77,'(77i1)',err=1) msgbits if(unpk77_successvar) go to 2 1 msgbits=0 diff --git a/lib/ft8var/genft8var.f90 b/lib/ft8var/genft8var.f90 index 5166e580..86defc7e 100644 --- a/lib/ft8var/genft8var.f90 +++ b/lib/ft8var/genft8var.f90 @@ -9,14 +9,10 @@ subroutine genft8var(msg,i3,n3,ntxhash,msgsent,msgbits,itone) integer itone(79) logical unpk77_successvar - i3=-1 - n3=-1 - call pack77var(msg,i3,n3,c77,ntxhash) - if(ntxhash.eq.1) then - call unpack77var(c77,0,msgsent,unpk77_successvar,26) !TX message, unpack to get msgsent, use TX hash tables and do not save RX hash values - else - call unpack77var(c77,0,msgsent,unpk77_successvar,27) !service message, unpack to get msgsent. Do not save hash values - endif + call pack77(msg,i3,n3,c77, & + pack77_options(record_tx_hashes=ntxhash.eq.1)) + call unpack77_configured(c77,0,msgsent,unpk77_successvar, & + unpack77_options(record_hashes=.false.,record_recent_calls=.false.)) read(c77,'(77i1)',err=1) msgbits if(unpk77_successvar) go to 2 1 msgbits=0 diff --git a/lib/ft8var/jt65_mod9.f90 b/lib/ft8var/jt65_mod9.f90 index 6fc3413d..b116dc08 100644 --- a/lib/ft8var/jt65_mod9.f90 +++ b/lib/ft8var/jt65_mod9.f90 @@ -1,5 +1,7 @@ module jt65_mod9 ! stores callsign DB in memory for false decodes checking + + save parameter (MAXC=200000) ! supporting 7-char Australian callsigns diff --git a/lib/ft8var/osd174_91var.f90 b/lib/ft8var/osd174_91var.f90 index d46fd377..16aa6667 100644 --- a/lib/ft8var/osd174_91var.f90 +++ b/lib/ft8var/osd174_91var.f90 @@ -1,8 +1,10 @@ -subroutine osd174_91var(llr,apmask,ndeep,message77,cw,nhardmin,dmin,nthr) +subroutine osd174_91var(llr,apmask,ndeep,message77,cw,nhardmin,dmin,nthr, & + progress_generation) ! ! An ordered-statistics decoder for the (174,91) code. ! use ft8_mod1, only : first_osd,gen +use decode_completion_module, only : write_decode_progress integer, parameter:: N=174, K=91, M=N-K integer*1 apmask(N),apmaskr(N) integer*1 genmrb(K,N),g2(N,K) @@ -12,7 +14,8 @@ integer indices(N),nxor(N) integer*1 cw(N),ce(N),c0(N),hdec(N) integer*1 decoded(K) integer*1 message77(77) -integer indx(N) +integer indx(N),progress_work +integer, intent(in) :: progress_generation real llr(N),rx(N),absrx(N) include '/lib/ft8/ldpc_174_91_c_generator.f90' logical reset @@ -37,8 +40,8 @@ interface end interface npre1=0; npre2=0; d1=0. -if(first_osd) then ! fill the generator matrix !$omp critical(first_osd) +if(first_osd) then ! fill the generator matrix gen=0 do i=1,M do j=1,23 @@ -55,8 +58,8 @@ if(first_osd) then ! fill the generator matrix gen(irow,irow)=1 enddo first_osd=.false. -!$omp end critical(first_osd) endif +!$omp end critical(first_osd) rx=llr apmaskr=apmask @@ -161,10 +164,13 @@ elseif(ndeep.eq.5) then endif do iorder=1,nord + progress_work=0 misub(1:K-iorder)=0 misub(K-iorder+1:K)=1 iflag=K-iorder+1 do while(iflag .ge.0) + progress_work=progress_work+1 + if(mod(progress_work,32).eq.0) call write_decode_progress(progress_generation) if(iorder.eq.nord .and. npre1.eq.0) then iend=iflag else @@ -220,6 +226,7 @@ if(npre2.eq.1) then reset=.true. ntotal=0 do i1=K,1,-1 + if(mod(i1,8).eq.0) call write_decode_progress(progress_generation) do i2=i1-1,1,-1 ntotal=ntotal+1 mi(1:ntau)=ieor(g2(K+1:K+ntau,i1),g2(K+1:K+ntau,i2)) @@ -234,7 +241,10 @@ if(npre2.eq.1) then misub(1:K-nord)=0 misub(K-nord+1:K)=1 iflag=K-nord+1 + progress_work=0 do while(iflag .ge.0) + progress_work=progress_work+1 + if(mod(progress_work,32).eq.0) call write_decode_progress(progress_generation) me=ieor(m0,misub) call mrbencode91var(me,ce,g2,N,K) e2sub=ieor(ce(K+1:N),hdec(K+1:N)) @@ -397,4 +407,4 @@ subroutine fetchit91var(indexes,fp,np,reset,e2,ntau,i1,i2,nthr) lastpat(nthr)=ipat return -end subroutine fetchit91var \ No newline at end of file +end subroutine fetchit91var diff --git a/lib/ft8var/packjt77sdvar.f90 b/lib/ft8var/packjt77sdvar.f90 deleted file mode 100644 index 5d02407c..00000000 --- a/lib/ft8var/packjt77sdvar.f90 +++ /dev/null @@ -1,558 +0,0 @@ - -module packjt77sdvar - -! These variables are accessible from outside via "use packjt77sdvar": -! integer n28avar,n28bvar - - contains - -subroutine pack77sdvar(msg0,i3,n3,c77) - - use packjt - character*37 msg,msg0 - character*13 w(19) - character*77 c77 - integer nw(19) - - msg=msg0 - -! Convert msg to upper case; collapse multiple blanks; parse into words. - call split77var(msg,nwords,nw,w) - i3=-1 - n3=-1 - if(msg(1:3).eq.'CQ ' .or. msg(1:3).eq.'DE ' .or. msg(1:4).eq.'QRZ ') go to 100 - -! Check Type 1 (Standard 77-bit message) or Type 2, with optional "/P" -100 call pack77_1var(nwords,w,i3,n3,c77) - if(i3.ge.0) go to 900 - -! It defaults to free text - i3=0 - n3=0 - msg(14:)=' ' - call packtext77var(msg(1:13),c77(1:71)) - write(c77(72:77),'(2b3.3)') n3,i3 - -900 return -end subroutine pack77sdvar - -subroutine unpack77sdvar(c77,msg,unpk77_successvar) - - parameter (MAXGRID4=32400) - integer*8 n58 - character*77 c77*77,msg*37,c*38,call_1*13,call_2*13,c11*11,grid4*4,crpt*3 - logical unpk28_success,unpk77_successvar - - data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/'/ - - unpk77_successvar=.true. - -! Check for bad data - do i=1,77 - if(c77(i:i).ne.'0' .and. c77(i:i).ne.'1') then - msg='failed unpack' - unpk77_successvar=.false. - return - endif - enddo - - read(c77(72:77),'(2b3)') n3,i3 - msg=repeat(' ',37) - if(i3.eq.0 .and. n3.eq.0) then -! 0.0 Free text - call unpacktext77var(c77(1:71),msg(1:13)) - msg(14:)=' ' - msg=adjustl(msg) - - else if(i3.eq.1 .or. i3.eq.2) then -! Type 1 (standard message) or Type 2 ("/P" form for EU VHF contest) - read(c77,1000) n28avar,ipa,n28bvar,ipb,ir,igrid4,i3 -1000 format(2(b28,b1),b1,b15,b3) - call unpack28var(n28avar,call_1,unpk28_success) - if(.not.unpk28_success) unpk77_successvar=.false. - call unpack28var(n28bvar,call_2,unpk28_success) - if(.not.unpk28_success) unpk77_successvar=.false. - if(call_1(1:3).eq.'CQ_') call_1(3:3)=' ' - if(index(call_1,'<').le.0) then - i=index(call_1,' ') - if(i.ge.4 .and. ipa.eq.1 .and. i3.eq.1) call_1(i:i+1)='/R' - if(i.ge.4 .and. ipa.eq.1 .and. i3.eq.2) call_1(i:i+1)='/P' - endif - if(index(call_2,'<').le.0) then - i=index(call_2,' ') - if(i.ge.4 .and. ipb.eq.1 .and. i3.eq.1) call_2(i:i+1)='/R' - if(i.ge.4 .and. ipb.eq.1 .and. i3.eq.2) call_2(i:i+1)='/P' - endif - if(igrid4.le.MAXGRID4) then - n=igrid4 - j1=n/(18*10*10) - n=n-j1*18*10*10 - j2=n/(10*10) - n=n-j2*10*10 - j3=n/10 - j4=n-j3*10 - grid4(1:1)=char(j1+ichar('A')) - grid4(2:2)=char(j2+ichar('A')) - grid4(3:3)=char(j3+ichar('0')) - grid4(4:4)=char(j4+ichar('0')) - if(ir.eq.0) msg=trim(call_1)//' '//trim(call_2)//' '//grid4 - if(ir.eq.1) msg=trim(call_1)//' '//trim(call_2)//' R '//grid4 - if(msg(1:3).eq.'CQ ' .and. ir.eq.1) unpk77_successvar=.false. - else - irpt=igrid4-MAXGRID4 - if(irpt.eq.1) msg=trim(call_1)//' '//trim(call_2) - if(irpt.eq.2) msg=trim(call_1)//' '//trim(call_2)//' RRR' - if(irpt.eq.3) msg=trim(call_1)//' '//trim(call_2)//' RR73' - if(irpt.eq.4) msg=trim(call_1)//' '//trim(call_2)//' 73' - if(irpt.ge.5) then - write(crpt,'(i3.2)') irpt-35 - if(crpt(1:1).eq.' ') crpt(1:1)='+' - if(ir.eq.0) msg=trim(call_1)//' '//trim(call_2)//' '//crpt - if(ir.eq.1) msg=trim(call_1)//' '//trim(call_2)//' R'//crpt - endif - if(msg(1:3).eq.'CQ ' .and. irpt.ge.2) unpk77_successvar=.false. - endif - - else if(i3.eq.4) then - read(c77,1050) n12,n58,iflip,nrpt,icq -1050 format(b12,b58,b1,b2,b1) - if(icq.eq.1) then - do i=11,1,-1 - j=mod(n58,38)+1 - c11(i:i)=c(j:j) - n58=n58/38 - enddo - call_2=adjustl(c11)//' ' - msg='CQ '//trim(call_2) - if(msg(1:4).eq.'CQ <') unpk77_successvar=.false. - else - unpk77_successvar=.false. - endif - endif - - return -end subroutine unpack77sdvar - -subroutine pack28var(c13,n28) - -! Pack a special token, a 22-bit hash code, or a valid base call into a 28-bit -! integer. - - parameter (NTOKENS=2063592,MAX22=4194304) - logical is_digit,is_letter - character*13 c13 - character*6 callsign - character*1 c - character*4 c4 - character*37 a1 - character*36 a2 - character*10 a3 - character*27 a4 - data a1/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ - data a2/'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ - data a3/'0123456789'/ - data a4/' ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ - - is_digit(c)=c.ge.'0' .and. c.le.'9' - is_letter(c)=c.ge.'A' .and. c.le.'Z' - - n28=-1 -! Work-around for Swaziland prefix: - if(c13(1:4).eq.'3DA0') callsign='3D0'//c13(5:7) -! Work-around for Guinea prefixes: - if(c13(1:2).eq.'3X' .and. c13(3:3).ge.'A' .and. & - c13(3:3).le.'Z') callsign='Q'//c13(3:6) - -! Check for special tokens first - if(c13(1:3).eq.'DE ') then - n28=0 - go to 900 - endif - - if(c13(1:4).eq.'QRZ ') then - n28=1 - go to 900 - endif - - if(c13(1:3).eq.'CQ ') then - n28=2 - go to 900 - endif - - if(c13(1:3).eq.'CQ_') then - n=len(trim(c13)) - if(n.ge.4 .and. n.le.7) then - nlet=0 - nnum=0 - do i=4,n - c=c13(i:i) - if(c.ge.'A' .and. c.le.'Z') nlet=nlet+1 - if(c.ge.'0' .and. c.le.'9') nnum=nnum+1 - enddo - if(nnum.eq.3 .and. nlet.eq.0) then - read(c13(4:3+nnum),*) nqsy - n28=3+nqsy - go to 900 - endif - if(nlet.ge.1 .and. nlet.le.4 .and. nnum.eq.0) then - c4=c13(4:n) - c4=adjustr(c4) - m=0 - do i=1,4 - j=0 - c=c4(i:i) - if(c.ge.'A' .and. c.le.'Z') j=ichar(c)-ichar('A')+1 - m=27*m + j - enddo - n28=3+1000+m - go to 900 - endif - endif - endif - -! Check for standard callsign - iarea=-1 - n=len(trim(c13)) - do i=n,2,-1 - if(is_digit(c13(i:i))) exit - enddo - iarea=i !Call-area digit - npdig=0 !Digits before call area - nplet=0 !Letters before call area - do i=1,iarea-1 - if(is_digit(c13(i:i))) npdig=npdig+1 - if(is_letter(c13(i:i))) nplet=nplet+1 - enddo - nslet=0 - do i=iarea+1,n - if(is_letter(c13(i:i))) nslet=nslet+1 - enddo - - n=len(trim(c13)) -! This is a standard callsign - if(iarea.eq.2) callsign=' '//c13(1:5) - if(iarea.eq.3) callsign=c13(1:6) - i1=index(a1,callsign(1:1))-1 - i2=index(a2,callsign(2:2))-1 - i3=index(a3,callsign(3:3))-1 - i4=index(a4,callsign(4:4))-1 - i5=index(a4,callsign(5:5))-1 - i6=index(a4,callsign(6:6))-1 - n28=36*10*27*27*27*i1 + 10*27*27*27*i2 + 27*27*27*i3 + 27*27*i4 + & - 27*i5 + i6 - n28=n28 + NTOKENS + MAX22 - -900 n28=iand(n28,ishft(1,28)-1) - return -end subroutine pack28var - - -subroutine unpack28var(n28_0,c13,success) - - parameter (NTOKENS=2063592,MAX22=4194304) - logical success - character*13 c13 - character*37 c1 - character*36 c2 - character*10 c3 - character*27 c4 - data c1/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ - data c2/'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ - data c3/'0123456789'/ - data c4/' ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ - - success=.true. - n28=n28_0 - if(n28.lt.NTOKENS) then -! Special tokens DE, QRZ, CQ, CQ_nnn, CQ_aaaa - if(n28.eq.0) c13='DE ' - if(n28.eq.1) c13='QRZ ' - if(n28.eq.2) c13='CQ ' - if(n28.le.2) go to 900 - if(n28.le.1002) then - write(c13,1002) n28-3 -1002 format('CQ_',i3.3) - go to 900 - endif - if(n28.le.532443) then - n=n28-1003 - n0=n - i1=n/(27*27*27) - n=n-27*27*27*i1 - i2=n/(27*27) - n=n-27*27*i2 - i3=n/27 - i4=n-27*i3 - c13=c4(i1+1:i1+1)//c4(i2+1:i2+1)//c4(i3+1:i3+1)//c4(i4+1:i4+1) - c13=adjustl(c13) - c13='CQ_'//c13(1:10) - go to 900 - endif - endif - n28=n28-NTOKENS - -! Standard callsign - n=n28 - MAX22 - i1=n/(36*10*27*27*27) - n=n-36*10*27*27*27*i1 - i2=n/(10*27*27*27) - n=n-10*27*27*27*i2 - i3=n/(27*27*27) - n=n-27*27*27*i3 - i4=n/(27*27) - n=n-27*27*i4 - i5=n/27 - i6=n-27*i5 - c13=c1(i1+1:i1+1)//c2(i2+1:i2+1)//c3(i3+1:i3+1)//c4(i4+1:i4+1)// & - c4(i5+1:i5+1)//c4(i6+1:i6+1) - c13=adjustl(c13) - -900 i0=index(c13,' ') - if(i0.ne.0 .and. i0.lt.len(trim(c13))) then - c13='QU1RK' - success=.false. - endif - return -end subroutine unpack28var - -subroutine split77var(msg,nwords,nw,w) - -! Convert msg to upper case; collapse multiple blanks; parse into words. - - character*37 msg - character*13 w(19) - character*1 c,c0 - character*6 bcall_1 - logical ok1 - integer nw(19) - - iz=len(trim(msg)) - j=0 - k=0 - n=0 - c0=' ' - w=' ' - do i=1,iz - if(ichar(msg(i:i)).eq.0) msg(i:i)=' ' - c=msg(i:i) !Single character - if(c.eq.' ' .and. c0.eq.' ') cycle !Skip leading/repeated blanks - if(c.ne.' ' .and. c0.eq.' ') then - k=k+1 !New word - n=0 - endif - j=j+1 !Index in msg - n=n+1 !Index in word - if(c.ge.'a' .and. c.le.'z') c=char(ichar(c)-32) !Force upper case - msg(j:j)=c - if(n.le.13) w(k)(n:n)=c !Copy character c into word - c0=c - enddo - iz=j !Message length - nwords=k !Number of words in msg - if(nwords.le.0) go to 900 - nw(k)=len(trim(w(k))) - msg(iz+1:)=' ' - if(nwords.lt.3) go to 900 - call chkcall(w(3),bcall_1,ok1) - if(ok1 .and. w(1)(1:3).eq.'CQ ') then - w(1)='CQ_'//w(2)(1:10) !Make "CQ " into "CQ_" - w(2:12)=w(3:13) !Move all remeining words down by one - nwords=nwords-1 - endif - -900 return -end subroutine split77var - -subroutine pack77_1var(nwords,w,i3,n3,c77) -! Check Type 1 (Standard 77-bit message) and Type 2 (ditto, with a "/P" call) - - parameter (MAXGRID4=32400) - character*13 w(19),c13 - character*77 c77 - character*6 bcall_1,bcall_2 - character*4 grid4 - character c1*1,c2*2 - logical is_grid4 - logical ok1,ok2 - is_grid4(grid4)=len(trim(grid4)).eq.4 .and. & - grid4(1:1).ge.'A' .and. grid4(1:1).le.'R' .and. & - grid4(2:2).ge.'A' .and. grid4(2:2).le.'R' .and. & - grid4(3:3).ge.'0' .and. grid4(3:3).le.'9' .and. & - grid4(4:4).ge.'0' .and. grid4(4:4).le.'9' - - if(nwords.lt.2 .or. nwords.gt.4) return - call chkcall(w(1),bcall_1,ok1) - call chkcall(w(2),bcall_2,ok2) - if(w(1)(1:3).eq.'DE ' .or. w(1)(1:3).eq.'CQ_' .or. w(1)(1:3).eq.'CQ ' .or. & - w(1)(1:4).eq.'QRZ ') ok1=.true. - if(w(1)(1:1).eq.'<' .and. index(w(1),'>').ge.5) ok1=.true. - if(w(2)(1:1).eq.'<' .and. index(w(2),'>').ge.5) ok2=.true. - if(.not.ok1 .or. .not.ok2) return - if(w(1)(1:1).eq.'<' .and. index(w(2),'/').gt.0) return - if(w(2)(1:1).eq.'<' .and. index(w(1),'/').gt.0) return - if(nwords.eq.2 .and. (.not.ok2 .or. index(w(2),'/').ge.2)) return - if(nwords.eq.2) go to 10 - - c1=w(nwords)(1:1) - c2=w(nwords)(1:2) - if(.not.is_grid4(w(nwords)(1:4)) .and. c1.ne.'+' .and. c1.ne.'-' & - .and. c2.ne.'R+' .and. c2.ne.'R-' .and. trim(w(nwords)).ne.'RRR' .and. & - trim(w(nwords)).ne.'RR73' .and. trim(w(nwords)).ne.'73') return - if(c1.eq.'+' .or. c1.eq.'-') then - ir=0 - read(w(nwords),*,err=900) irpt - irpt=irpt+35 - else if(c2.eq.'R+' .or. c2.eq.'R-') then - ir=1 - read(w(nwords)(2:),*) irpt - irpt=irpt+35 - else if(trim(w(nwords)).eq.'RRR') then - ir=0 - irpt=2 - else if(trim(w(nwords)).eq.'RR73') then - ir=0 - irpt=3 - else if(trim(w(nwords)).eq.'73') then - ir=0 - irpt=4 - endif - -! 1 WA9XYZ/R KA1ABC/R R FN42 28 1 28 1 1 15 74 Standard msg -! 2 PA3XYZ/P GM4ABC/P R JO22 28 1 28 1 1 15 74 EU VHF contest - -10 i1psuffix=index(w(1)//' ' ,'/P ') - i2psuffix=index(w(2)//' ','/P ') - if(nwords.eq.2 .or. nwords.eq.3 .or. (nwords.eq.4 .and. & - w(3)(1:2).eq.'R ')) then - n3=0 - i3=1 !Type 1: Standard message, possibly with "/R" - if (i1psuffix.ge.4.or.i2psuffix.ge.4) i3=2 !Type 2, with "/P" - endif - c13=bcall_1 - if(c13(1:3).eq.'CQ_' .or. w(1)(1:1).eq.'<') c13=w(1) - call pack28var(c13,n28avar) - c13=bcall_2 - if(w(2)(1:1).eq.'<') c13=w(2) - call pack28var(c13,n28bvar) - ipa=0 - ipb=0 - if(i1psuffix.ge.4.or.index(w(1)//' ','/R ').ge.4) ipa=1 - if(i2psuffix.ge.4.or.index(w(2)//' ','/R ').ge.4) ipb=1 - - grid4=w(nwords)(1:4) - if(is_grid4(grid4)) then - ir=0 - if(w(3).eq.'R ') ir=1 - j1=(ichar(grid4(1:1))-ichar('A'))*18*10*10 - j2=(ichar(grid4(2:2))-ichar('A'))*10*10 - j3=(ichar(grid4(3:3))-ichar('0'))*10 - j4=(ichar(grid4(4:4))-ichar('0')) - igrid4=j1+j2+j3+j4 - else - igrid4=MAXGRID4 + irpt - endif - if(nwords.eq.2) then - ir=0 - irpt=1 - igrid4=MAXGRID4+irpt - endif - write(c77,1000) n28avar,ipa,n28bvar,ipb,ir,igrid4,i3 -1000 format(2(b28.28,b1),b1,b15.15,b3.3) - return - -900 return -end subroutine pack77_1var - -subroutine packtext77var(c13,c71) - - character*13 c13,w - character*71 c71 - character*42 c - character*1 qa(10),qb(10) - data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+-./?'/ - - call mp_short_init - qa=char(0) - w=adjustr(c13) - do i=1,13 - j=index(c,w(i:i))-1 - if(j.lt.0) j=0 - call mp_short_mult(qb,qa(2:10),9,42) !qb(1:9)=42*qa(2:9) - call mp_short_add(qa,qb(2:10),9,j) !qa(1:9)=qb(2:9)+j - enddo - - write(c71,1010) qa(2:10) -1010 format(b7.7,8b8.8) - - return -end subroutine packtext77var - -subroutine unpacktext77var(c71,c13) - - integer*1 ia(10) - character*1 qa(10),qb(10) - character*13 c13 - character*71 c71 - character*42 c - equivalence (qa,ia),(qb,ib) - data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+-./?'/ - - qa(1)=char(0) - read(c71,1010) qa(2:10) -1010 format(b7.7,8b8.8) - - do i=13,1,-1 - call mp_short_div(qb,qa(2:10),9,42,ir) - c13(i:i)=c(ir+1:ir+1) - qa(2:10)=qb(1:9) - enddo - - return -end subroutine unpacktext77var - -subroutine mp_short_opsvar(w,u) - character*1 w(*),u(*) - integer i,ireg,j,n,ir,iv,ii1,ii2 - character*1 creg(4) - save ii1,ii2 - equivalence (ireg,creg) - - entry mp_short_init - ireg=256*ichar('2')+ichar('1') - do j=1,4 - if (creg(j).eq.'1') ii1=j - if (creg(j).eq.'2') ii2=j - enddo - return - - entry mp_short_add(w,u,n,iv) - ireg=256*iv - do j=n,1,-1 - ireg=ichar(u(j))+ichar(creg(ii2)) - w(j+1)=creg(ii1) - enddo - w(1)=creg(ii2) - return - - entry mp_short_mult(w,u,n,iv) - ireg=0 - do j=n,1,-1 - ireg=ichar(u(j))*iv+ichar(creg(ii2)) - w(j+1)=creg(ii1) - enddo - w(1)=creg(ii2) - return - - entry mp_short_div(w,u,n,iv,ir) - ir=0 - do j=1,n - i=256*ir+ichar(u(j)) - w(j)=char(i/iv) - ir=mod(i,iv) - enddo - return - - return -end subroutine mp_short_opsvar - -end module packjt77sdvar diff --git a/lib/ft8var/subtractft8var.f90 b/lib/ft8var/subtractft8var.f90 index a15f9bfa..ae60652b 100644 --- a/lib/ft8var/subtractft8var.f90 +++ b/lib/ft8var/subtractft8var.f90 @@ -1,4 +1,4 @@ -subroutine subtractft8var(itone,f0,dt) +subroutine subtractft8var(residual,itone,f0,dt,delta) ! Subtract an ft8 signal ! @@ -7,20 +7,25 @@ subroutine subtractft8var(itone,f0,dt) ! Complex amp : cfilt(t) = LPF[ dd(t)*CONJG(cref(t)) ] ! Subtract : dd(t) = dd(t) - 2*REAL{cref*cfilt} - use ft8_mod1, only : dd8,cw,NFILT1,NFILT2,endcorr + use ft8_mod1, only : cw,NFILT1,NFILT2,endcorr + use ft8_mtd_residual, only : mtd_start_sample ! NMAX=15*12000,NFFT=15*12000,NFRAME=1920*79 parameter (NFFT=180000,NMAX=180000,NFRAME=151680) complex cref(nframe),cfilt(nmax) - integer itone(79) - save cfilt - !$omp threadprivate(cfilt) + real, intent(inout) :: residual(NMAX) + real, intent(out), optional :: delta(NFRAME) + integer, intent(in) :: itone(79) + real, intent(in) :: f0,dt + save cref,cfilt + !$omp threadprivate(cref,cfilt) - nstart=dt*12000+1 + nstart=mtd_start_sample(dt) + if(present(delta)) delta=0.0 call gen_ft8wavevar(itone,79,1920,2.0,12000.0,f0,cref,xjunk,1,NFRAME) do i=1,nframe id=nstart-1+i if(id.ge.1.and.id.le.NMAX) then - cfilt(i)=dd8(id)*conjg(cref(i)) + cfilt(i)=residual(id)*conjg(cref(i)) else cfilt(i)=0.0 endif @@ -33,9 +38,11 @@ subroutine subtractft8var(itone,f0,dt) cfilt(nframe:nframe-NFILT1/2:-1)=cfilt(nframe:nframe-NFILT1/2:-1)*endcorr do i=1,nframe j=nstart+i-1 - if(j.ge.1 .and. j.le.NMAX) dd8(j)=dd8(j)-2*REAL(cfilt(i)*cref(i)) + if(j.ge.1 .and. j.le.NMAX) then + correction=-2*REAL(cfilt(i)*cref(i)) + residual(j)=residual(j)+correction + if(present(delta)) delta(i)=correction + endif enddo -!!!$omp flush(dd8) ! makes no difference in number of decoded messages - return end subroutine subtractft8var diff --git a/lib/ft8var/sync8dvar.f90 b/lib/ft8var/sync8dvar.f90 index 34874679..84b6507e 100644 --- a/lib/ft8var/sync8dvar.f90 +++ b/lib/ft8var/sync8dvar.f90 @@ -1,7 +1,8 @@ subroutine sync8dvar(cd0,i0,ctwk,itwk,sync,ipass,lastsync,iqso,lcq,lcallsstd,lcqcand) ! Compute sync power for a complex, downsampled FT8 signal. - use ft8_mod1, only : csync,csynce,csyncsd,csyncsdcq,csynccq + use ft8_mod1, only : csync,csynce,csyncsd,csyncsdcq,csynccq, & + csyncsd_valid,csyncsdcq_valid complex, intent(in) :: cd0(-800:4000),ctwk(32) complex csync1(0:18,32),csync2(32),z1,z2,z3,z4,zt1(0:6),zt2(0:6),zt3(0:6),zt4(0:7),zt5(0:18), & @@ -9,9 +10,10 @@ subroutine sync8dvar(cd0,i0,ctwk,itwk,sync,ipass,lastsync,iqso,lcq,lcallsstd,lcq real sync1(0:20)!,sync2(0:20) integer, intent(in) :: i0,ipass,iqso logical(1), intent(in) :: lcq,lcallsstd,lcqcand - logical(1) lastsync + logical(1) lastsync,lsync1_valid - sync=0.; sync1=0.; zt1=0.; zt2=0.; zt3=0.; z11=0.; z22=0.; z33=0.!; sync2=0. + sync=0.; sync1=0.; zt1=0.; zt2=0.; zt3=0.; z4=0.; z11=0.; z22=0.; z33=0.!; sync2=0. + lsync1_valid=.false. k=1 do i=0,6 ! Sum over 7 Costas frequencies and three Costas arrays i1=i0+i*32; i2=i1+1152; i3=i1+2304 ! +36*32, +72*32 @@ -83,9 +85,15 @@ subroutine sync8dvar(cd0,i0,ctwk,itwk,sync,ipass,lastsync,iqso,lcq,lcallsstd,lcq endif if(.not.lastsync) then - if(iqso.gt.1 .and. iqso.lt.4 .and. lcallsstd) csync1=csynce; if(iqso.eq.4 .and. .not.lcq) csync1=csyncsd + if(iqso.gt.1 .and. iqso.lt.4 .and. lcallsstd) then + csync1=csynce + lsync1_valid=.true. + else if(iqso.eq.4 .and. .not.lcq .and. csyncsd_valid) then + csync1=csyncsd + lsync1_valid=.true. + endif - if((iqso.eq.4 .and. .not.lcq) .or. ((iqso.eq.2 .or. iqso.eq.3) .and. lcallsstd)) then + if(lsync1_valid) then zt5=0. do i=0,18 csync2=csync1(i,1:32) @@ -105,7 +113,7 @@ subroutine sync8dvar(cd0,i0,ctwk,itwk,sync,ipass,lastsync,iqso,lcq,lcallsstd,lcq enddo endif - if(iqso.eq.4 .and. lcq) then + if(iqso.eq.4 .and. lcq .and. csyncsdcq_valid) then do i=0,57 csync2=csyncsdcq(i,1:32) if(itwk.eq.1) csync2=ctwk*csync2 !Tweak the frequency diff --git a/lib/ft8var/sync8var.f90 b/lib/ft8var/sync8var.f90 index 6540d766..17b2b894 100644 --- a/lib/ft8var/sync8var.f90 +++ b/lib/ft8var/sync8var.f90 @@ -1,11 +1,18 @@ -subroutine sync8var(nfa,nfb,syncmin,nfqso,candidate,ncand,jzb,jzt,ipass,lqsothread,ncandthin,ndtcenter) +subroutine sync8var(residual,nfa,nfb,syncmin,nfqso,candidate,ncand,jzb,jzt,ipass, & + lqsothread,ncandthin,ndtcenter,progress_generation) - use ft8_mod1, only : dd8,windowx,facx,icos7,lagcc,lagccbail,nfawide,nfbwide + use ft8_mod1, only : windowx,facx,icos7,lagcc,lagccbail,nfawide,nfbwide + use decode_completion_module, only : write_decode_progress + real, intent(in) :: residual(180000) include 'ft8_params.f90' complex cx(0:NH1) - real s(NH1,NHSYM),x(NFFT1),sync2d(NH1,jzb:jzt),red(NH1),candidate0(5,450),candidate(4,460),tall(30),freq,rcandthin,dtcenter + real, save :: s(NH1,NHSYM) + !$omp threadprivate(s) + real x(NFFT1),sync2d(NH1,jzb:jzt),red(NH1),candidate0(5,450),candidate(4,460),tall(30),freq,rcandthin,dtcenter + real candidate_sync(450) integer jpeak(NH1),indx(NH1),ii(1) - integer, intent(in) :: nfa,nfb,nfqso,jzb,jzt,ipass,ncandthin,ndtcenter + integer, parameter :: max_sync_stencil=16 + integer, intent(in) :: nfa,nfb,nfqso,jzb,jzt,ipass,ncandthin,ndtcenter,progress_generation logical(1) syncq(NH1,jzb:jzt),redcq(NH1),lcq,lcq2,lpass1,lpass2 logical(1), intent(in) :: lqsothread equivalence (x,cx) @@ -14,22 +21,26 @@ subroutine sync8var(nfa,nfb,syncmin,nfqso,candidate,ncand,jzb,jzt,ipass,lqsothre tstep=0.04 ! NSTEP/12000.0 df=3.125 ! 12000.0/NFFT1 , Hz syncq=.false.; redcq=.false.; candidate(4,:)=0. + ncand=0 rcandthin=ncandthin/100.; dtcenter=ndtcenter/100. + if(nfa.gt.nfb .or. nfawide.gt.nfbwide) return + if(ipass.eq.1 .or. ipass.eq.4 .or. ipass.eq.7) then do j=1,NHSYM ia=(j-1)*NSTEP + 1 ib=ia+NSPS-1 x(1:759)=0. - if(j.ne.1) then; x(760:960)=dd8(ia-201:ia-1)*windowx(200:0:-1); else; x(760:960)=0.; endif - x(961:2880)=facx*dd8(ia:ib); x(961)=x(961)*1.9; x(2880)=x(2880)*1.9 - if(j.ne.NHSYM) then; x(2881:3081)=dd8(ib+1:ib+201)*windowx; else; x(2881:3081)=0.; endif + if(j.ne.1) then; x(760:960)=residual(ia-201:ia-1)*windowx(200:0:-1); else; x(760:960)=0.; endif + x(961:2880)=facx*residual(ia:ib); x(961)=x(961)*1.9; x(2880)=x(2880)*1.9 + if(j.ne.NHSYM) then; x(2881:3081)=residual(ib+1:ib+201)*windowx; else; x(2881:3081)=0.; endif x(3082:)=0. call four2avar(cx,NFFT1,1,-1,0) !r2c FFT do i=1,NH1 s(i,j)=SQRT(real(cx(i))**2 + aimag(cx(i))**2) enddo + if(mod(j,16).eq.0) call write_decode_progress(progress_generation) enddo endif if(ipass.eq.2 .or. ipass.eq.5 .or. ipass.eq.8) then @@ -37,14 +48,15 @@ subroutine sync8var(nfa,nfb,syncmin,nfqso,candidate,ncand,jzb,jzt,ipass,lqsothre ia=(j-1)*NSTEP + 1 ib=ia+NSPS-1 x(1:759)=0. - if(j.ne.1) then; x(760:960)=dd8(ia-201:ia-1)*windowx(200:0:-1); else; x(760:960)=0.; endif - x(961:2880)=facx*dd8(ia:ib); x(961)=x(961)*1.9; x(2880)=x(2880)*1.9 - if(j.ne.NHSYM) then; x(2881:3081)=dd8(ib+1:ib+201)*windowx; else; x(2881:3081)=0.; endif + if(j.ne.1) then; x(760:960)=residual(ia-201:ia-1)*windowx(200:0:-1); else; x(760:960)=0.; endif + x(961:2880)=facx*residual(ia:ib); x(961)=x(961)*1.9; x(2880)=x(2880)*1.9 + if(j.ne.NHSYM) then; x(2881:3081)=residual(ib+1:ib+201)*windowx; else; x(2881:3081)=0.; endif x(3082:)=0. call four2avar(cx,NFFT1,1,-1,0) !r2c FFT do i=1,NH1 s(i,j)=real(cx(i))**2 + aimag(cx(i))**2 enddo + if(mod(j,16).eq.0) call write_decode_progress(progress_generation) enddo endif if(ipass.eq.3 .or. ipass.eq.6 .or. ipass.eq.9) then @@ -52,18 +64,25 @@ subroutine sync8var(nfa,nfb,syncmin,nfqso,candidate,ncand,jzb,jzt,ipass,lqsothre ia=(j-1)*NSTEP + 1 ib=ia+NSPS-1 x(1:759)=0. - if(j.ne.1) then; x(760:960)=dd8(ia-201:ia-1)*windowx(200:0:-1); else; x(760:960)=0.; endif - x(961:2880)=facx*dd8(ia:ib); x(961)=x(961)*1.9; x(2880)=x(2880)*1.9 - if(j.ne.NHSYM) then; x(2881:3081)=dd8(ib+1:ib+201)*windowx; else; x(2881:3081)=0.; endif + if(j.ne.1) then; x(760:960)=residual(ia-201:ia-1)*windowx(200:0:-1); else; x(760:960)=0.; endif + x(961:2880)=facx*residual(ia:ib); x(961)=x(961)*1.9; x(2880)=x(2880)*1.9 + if(j.ne.NHSYM) then; x(2881:3081)=residual(ib+1:ib+201)*windowx; else; x(2881:3081)=0.; endif x(3082:)=0. call four2avar(cx,NFFT1,1,-1,0) !r2c FFT do i=1,NH1 s(i,j)=abs(real(cx(i))) + abs(aimag(cx(i))) enddo + if(mod(j,16).eq.0) call write_decode_progress(progress_generation) enddo endif - ia=max(1,nint(nfa/df)); ib=max(1,nint(nfb/df)); iaw=max(1,nint(nfawide/df)); ibw=max(1,nint(nfbwide/df)) + ia=max(1,nint(nfa/df)) + ib=min(NH1-max_sync_stencil,nint(nfb/df)) + iaw=max(1,nint(nfawide/df)) + ibw=min(NH1-max_sync_stencil,nint(nfbwide/df)) + ia=max(ia,iaw) + ib=min(ib,ibw) + if(ia.gt.ib .or. iaw.gt.ibw) return nssy=4 ! NSPS/NSTEP ! # steps per symbol nssy36=144 ! nssy*36 nssy72=288 ! nssy*72 @@ -74,7 +93,7 @@ subroutine sync8var(nfa,nfb,syncmin,nfqso,candidate,ncand,jzb,jzt,ipass,lqsothre nfos6=12 ! nfos*6 do j=jzb,jzt do i=iaw,ibw - ta=0.; tb=0.; tc=0. + ta=0.; tb=0.; tc=0.; tall=0. do n=0,6 k=j+jstrt+nssy*n if(k.gt.0) then @@ -112,10 +131,11 @@ subroutine sync8var(nfa,nfb,syncmin,nfqso,candidate,ncand,jzb,jzt,ipass,lqsothre endif sync2d(i,j)=max(sync_abc,sync_bc); if(lcq) syncq(i,j)=.true. enddo + if(mod(j-jzb+1,16).eq.0) call write_decode_progress(progress_generation) enddo else ! nfos6=15 ! 16i spec bw -1 - nfos6=16 + nfos6=max_sync_stencil do j=jzb,jzt do i=iaw,ibw ta=0.; tb=0.; tc=0.; tcq=0.; t0a=0.; t0b=0.; t0c=0.; t0cq=0. @@ -151,6 +171,7 @@ subroutine sync8var(nfa,nfb,syncmin,nfqso,candidate,ncand,jzb,jzt,ipass,lqsothre sync2d(i,j)=max(syncf,syncs) if(syncf.gt.syncs) then; if(lcq) syncq(i,j)=.true.; else; if(lcq2) syncq(i,j)=.true.; endif enddo + if(mod(j-jzb+1,16).eq.0) call write_decode_progress(progress_generation) enddo endif @@ -226,10 +247,11 @@ subroutine sync8var(nfa,nfb,syncmin,nfqso,candidate,ncand,jzb,jzt,ipass,lqsothre ! Sort by sync ! call indexx(candidate0(3,1:ncand),ncand,indx) - if(rcandthin.gt.0.99) then; call indexx(candidate0(3,1:ncand),ncand,indx) + if(rcandthin.gt.0.99) then; candidate_sync(1:ncand)=candidate0(3,1:ncand) ! sort by sync value with DT weight - else; call indexx(candidate0(5,1:ncand),ncand,indx) + else; candidate_sync(1:ncand)=candidate0(5,1:ncand) endif + call indexx(candidate_sync,ncand,indx) ! Sort by frequency ! call indexx(candidate0(1,1:ncand),ncand,indx) diff --git a/lib/ft8var/tone8.f90 b/lib/ft8var/tone8.f90 index d5a95761..63e21e94 100644 --- a/lib/ft8var/tone8.f90 +++ b/lib/ft8var/tone8.f90 @@ -1,13 +1,15 @@ subroutine tone8(lmycallstd,lhiscallstd) use ft8_mod1, only : itone56,idtone56,msg,csynce,mycall,hiscall,idtonecqdxcns,idtonedxcns73,mybcall,hisbcall,lhound, & + idtone56_valid, & idtonefox73,idtonespec - complex csig0(151680) + complex, allocatable :: csig0(:) character msg37*37,msgsent37*37,mycall14*14,hiscall14*14 character*4 rpt(56) integer itone(79),itone1(79) integer*1 msgbits(77) logical(1), intent(in) :: lmycallstd,lhiscallstd + logical(1) valid_first data rpt/'-01 ','-02 ','-03 ','-04 ','-05 ','-06 ','-07 ','-08 ','-09 ','-10 ', & '-11 ','-12 ','-13 ','-14 ','-15 ','-16 ','-17 ','-18 ','-19 ','-20 ', & @@ -20,6 +22,11 @@ subroutine tone8(lmycallstd,lhiscallstd) ! integer itone56(56,79),idtone56(56,58) ! character*37 msg(56) + idtone56(1:56,1:58)=0 + itone56(1:56,1:79)=0 + idtone56_valid(1:56)=.false. + valid_first=.false. + if(lhound .and. len_trim(mybcall).gt.2 .and. len_trim(hisbcall).gt.2) then msg37=''; msg37=trim(mybcall)//' '//trim(hisbcall)//' RR73' i3=-1; n3=-1 @@ -58,10 +65,7 @@ subroutine tone8(lmycallstd,lhiscallstd) msg(i)=msg37 i3=-1; n3=-1 call genft8var(msg37,i3,n3,0,msgsent37,msgbits,itone) - if(i.eq.1) itone1=itone - idtone56(i,1:29)=itone(8:36) - idtone56(i,30:58)=itone(44:72) - itone56(i,1:79)=itone(1:79) + call store_tone_slot(i,itone,i3.ge.0,i.eq.1) enddo go to 2 endif @@ -71,10 +75,7 @@ subroutine tone8(lmycallstd,lhiscallstd) msg37=''; msg37=trim(mycall)//' '//trim(hiscall14)//' '//trim(rpt(i)) i3=-1; n3=-1 call genft8var(msg37,i3,n3,0,msgsent37,msgbits,itone) - if(i.eq.1) itone1=itone - idtone56(i,1:29)=itone(8:36) - idtone56(i,30:58)=itone(44:72) - itone56(i,1:79)=itone(1:79) + call store_tone_slot(i,itone,i3.ge.0,i.eq.1) msg37=''; msg37=trim(mycall)//' '//trim(hiscall)//' '//trim(rpt(i)) msg(i)=msg37 enddo @@ -82,9 +83,7 @@ subroutine tone8(lmycallstd,lhiscallstd) msg37=''; msg37=trim(mycall14)//' '//trim(hiscall)//' '//trim(rpt(i)) i3=-1; n3=-1 call genft8var(msg37,i3,n3,0,msgsent37,msgbits,itone) - idtone56(i,1:29)=itone(8:36) - idtone56(i,30:58)=itone(44:72) - itone56(i,1:79)=itone(1:79) + call store_tone_slot(i,itone,i3.ge.0,.false.) msg37=''; msg37=trim(mycall)//' '//trim(hiscall)//' '//trim(rpt(i)) msg(i)=msg37 enddo @@ -92,9 +91,7 @@ subroutine tone8(lmycallstd,lhiscallstd) msg(53)=msg37 i3=-1; n3=-1 call genft8var(msg37,i3,n3,0,msgsent37,msgbits,itone) - idtone56(53,1:29)=itone(8:36) - idtone56(53,30:58)=itone(44:72) - itone56(53,1:79)=itone(1:79) + call store_tone_slot(53,itone,i3.ge.0,.false.) go to 2 endif @@ -103,10 +100,7 @@ subroutine tone8(lmycallstd,lhiscallstd) msg37=''; msg37=trim(mycall14)//' '//trim(hiscall)//' '//trim(rpt(i)) i3=-1; n3=-1 call genft8var(msg37,i3,n3,0,msgsent37,msgbits,itone) - if(i.eq.1) itone1=itone - idtone56(i,1:29)=itone(8:36) - idtone56(i,30:58)=itone(44:72) - itone56(i,1:79)=itone(1:79) + call store_tone_slot(i,itone,i3.ge.0,i.eq.1) msg37=''; msg37=trim(mycall)//' '//trim(hiscall)//' '//trim(rpt(i)) msg(i)=msg37 enddo @@ -114,9 +108,7 @@ subroutine tone8(lmycallstd,lhiscallstd) msg37=''; msg37=trim(mycall)//' '//trim(hiscall14)//' '//trim(rpt(i)) i3=-1; n3=-1 call genft8var(msg37,i3,n3,0,msgsent37,msgbits,itone) - idtone56(i,1:29)=itone(8:36) - idtone56(i,30:58)=itone(44:72) - itone56(i,1:79)=itone(1:79) + call store_tone_slot(i,itone,i3.ge.0,.false.) msg37=''; msg37=trim(mycall)//' '//trim(hiscall)//' '//trim(rpt(i)) msg(i)=msg37 enddo @@ -124,17 +116,37 @@ subroutine tone8(lmycallstd,lhiscallstd) msg(53)=msg37 i3=-1; n3=-1 call genft8var(msg37,i3,n3,0,msgsent37,msgbits,itone) - idtone56(53,1:29)=itone(8:36) - idtone56(53,30:58)=itone(44:72) - itone56(53,1:79)=itone(1:79) + call store_tone_slot(53,itone,i3.ge.0,.false.) go to 2 endif -2 m=13441 ! 7*1920+1 +2 if(.not.valid_first) return + allocate(csig0(151680)) + m=13441 ! 7*1920+1 call gen_ft8wavevar(itone1,79,1920,2.0,12000.0,0.0,csig0,xjunk,1,151680) do j=0,18 do k=1,32; csynce(j,k)=csig0(m); m=m+60; enddo enddo return + +contains + + subroutine store_tone_slot(islot,itone,valid,set_first) + integer, intent(in) :: islot,itone(79) + logical, intent(in) :: valid,set_first + + ! Invalid generated messages leave the slot cleared/invalid; valid_first + ! prevents csynce from being regenerated from a stale first tone sequence. + if(.not.valid) return + if(set_first) then + itone1=itone + valid_first=.true. + endif + idtone56(islot,1:29)=itone(8:36) + idtone56(islot,30:58)=itone(44:72) + itone56(islot,1:79)=itone(1:79) + idtone56_valid(islot)=.true. + end subroutine store_tone_slot + end subroutine tone8 diff --git a/lib/ft8var/tonesdvar.f90 b/lib/ft8var/tonesdvar.f90 index b973ca77..50d3cb00 100644 --- a/lib/ft8var/tonesdvar.f90 +++ b/lib/ft8var/tonesdvar.f90 @@ -1,14 +1,15 @@ subroutine tonesdvar(msgd,lcq) - use ft8_mod1, only : csyncsd,csyncsdcq,itone76,idtone76,msgsd76 - complex csig0(151680) + use ft8_mod1, only : csyncsd,csyncsdcq,itone76,idtone76,msgsd76, & + idtone76_valid,csyncsd_valid,csyncsdcq_valid + complex, allocatable :: csig0(:) character, intent(in) :: msgd*37 character msg37*37,msgsent37*37,c1*12,c2*12,grid*6 character*4 rpt(75) integer itone(79),itone1(79) integer*1 msgbits(77) logical(1), intent(in) :: lcq - logical(1) lgrid,lr73 + logical(1) lgrid,lr73,valid_first data rpt/'+09 ','+08 ','+07 ','+06 ','+05 ','+04 ','+03 ','+02 ','+01 ','+00 ', & '-01 ','-02 ','-03 ','-04 ','-05 ','-06 ','-07 ','-08 ','-09 ','-10 ', & @@ -25,11 +26,21 @@ subroutine tonesdvar(msgd,lcq) ! complex csyncsd(0:18,32),csyncsdcq(0:71,32) lgrid=.false.; lr73=.false. + valid_first=.false. + idtone76(1:76,1:58)=0 + itone76(1:76,1:79)=0 + idtone76_valid(1:76)=.false. + if(lcq) then + csyncsdcq_valid=.false. + else + csyncsd_valid=.false. + endif if(lcq) then msg37=msgd i3=-1; n3=-1 call genft8sdvar(msg37,i3,n3,msgsent37,msgbits,itone) + if(i3.lt.0) return else c1=' '; c2=' ' ispc1=index(msgd,' '); ispc2=index(msgd((ispc1+1):),' ')+ispc1; ispc3=index(msgd((ispc2+1):),' ')+ispc2; @@ -48,21 +59,31 @@ subroutine tonesdvar(msgd,lcq) msgsd76(i)=msg37 i3=-1; n3=-1 call genft8sdvar(msg37,i3,n3,msgsent37,msgbits,itone) - if(i.eq.1) itone1=itone + if(i3.lt.0) cycle + if(i.eq.1) then + itone1=itone + valid_first=.true. + endif idtone76(i,1:29)=itone(8:36) idtone76(i,30:58)=itone(44:72) itone76(i,1:79)=itone(1:79) + idtone76_valid(i)=.true. enddo msg37=' ' msg37=trim(c1)//' '//trim(c2)//' '//trim(grid) msgsd76(76)=msg37 i3=-1; n3=-1 call genft8sdvar(msg37,i3,n3,msgsent37,msgbits,itone) - idtone76(76,1:29)=itone(8:36) - idtone76(76,30:58)=itone(44:72) - itone76(76,1:79)=itone(1:79) + if(i3.ge.0) then + idtone76(76,1:29)=itone(8:36) + idtone76(76,30:58)=itone(44:72) + itone76(76,1:79)=itone(1:79) + idtone76_valid(76)=.true. + endif endif + if(.not.lcq .and. .not.valid_first) return + allocate(csig0(151680)) m=13441 ! 7*1920+1 if(lcq) then call gen_ft8wavevar(itone,79,1920,2.0,12000.0,0.0,csig0,xjunk,1,151680) @@ -70,11 +91,13 @@ subroutine tonesdvar(msgd,lcq) if(i.eq.29) m=m+13440 do j=1,32; csyncsdcq(i,j)=csig0(m); m=m+60; enddo enddo + csyncsdcq_valid=.true. else call gen_ft8wavevar(itone1,79,1920,2.0,12000.0,0.0,csig0,xjunk,1,151680) do i=0,18 do j=1,32; csyncsd(i,j)=csig0(m); m=m+60; enddo enddo + csyncsd_valid=.true. endif return diff --git a/lib/gen_cw_wave.f90 b/lib/gen_cw_wave.f90 index cf6d6d98..1698af67 100644 --- a/lib/gen_cw_wave.f90 +++ b/lib/gen_cw_wave.f90 @@ -11,6 +11,7 @@ subroutine gen_cw_wave(message,ifreq,wave) real x(NMAX) real y(NMAX) + wave=0. call morse(message,icw,ncw) i1=0 diff --git a/lib/genmsk_128_90.f90 b/lib/genmsk_128_90.f90 index 6e35d725..90b5078c 100644 --- a/lib/genmsk_128_90.f90 +++ b/lib/genmsk_128_90.f90 @@ -81,10 +81,13 @@ subroutine genmsk_128_90(msg0,ichk,msgsent,i4tone,itype) i3=-1 n3=-1 - call pack77(message,i3,n3,c77) + c77=' ' + unpk77_success=.false. + call pack77_legacy_truncating_fallback(message,i3,n3,c77) + if(i3.lt.0 .or. n3.lt.0) go to 998 call unpack77(c77,0,msgsent,unpk77_success) !Unpack to get msgsent if(ichk.eq.1) go to 999 - read(c77,"(77i1)") msgbits + read(c77,"(77i1)",err=998) msgbits call encode_128_90(msgbits,codeword) !Create 144-bit channel vector: @@ -116,5 +119,11 @@ subroutine genmsk_128_90(msg0,ichk,msgsent,i4tone,itype) ! Flip polarity i4tone=-i4tone+1 + go to 999 +998 msgbits=0 + bitseq=0 + i4tone=0 + msgsent='*** bad message *** ' + itype=-1 999 return end subroutine genmsk_128_90 diff --git a/lib/get_q3list.f90 b/lib/get_q3list.f90 index 0b483759..d9b66e2d 100644 --- a/lib/get_q3list.f90 +++ b/lib/get_q3list.f90 @@ -1,5 +1,8 @@ subroutine get_q3list(fname,bDiskData,nlist,list) + use jpl_ephemeris_status, only: EPHEMERIS_INVALID_INPUT, & + EPHEMERIS_UNAVAILABLE + type q3list character*6 call character*4 grid @@ -8,13 +11,15 @@ subroutine get_q3list(fname,bDiskData,nlist,list) integer moonel end type q3list - parameter (MAX_CALLERS=40) + parameter (MAX_CALLERS=50) character*(*) fname - character*36 list(40) + character*37 list(MAX_CALLERS) character*8 grid6 logical*1 bDiskData integer time integer nt(8) + integer utc_year,utc_month,utc_day + integer ephemeris_result integer indx(MAX_CALLERS) type(q3list) ctmp(MAX_CALLERS),callers(MAX_CALLERS) character*256 jpleph_file_name,file24name @@ -24,7 +29,7 @@ subroutine get_q3list(fname,bDiskData,nlist,list) nhist2=0 open(24,file=fname,status='unknown',form='unformatted') read(24,end=1) nhist2 - if(nhist2.ge.1 .and. nhist2.le.40) then + if(nhist2.ge.1 .and. nhist2.le.MAX_CALLERS) then read(24,end=1) ctmp(1:nhist2) else nhist2=0 @@ -34,7 +39,7 @@ subroutine get_q3list(fname,bDiskData,nlist,list) now=time() call date_and_time(values=nt) - uth=nt(5) + (nt(6)-nt(4))/60.0 + nt(7)/3600.0 + call normalize_utc_calendar(nt,utc_year,utc_month,utc_day,uth) j=0 do i=1,nhist2 @@ -42,10 +47,13 @@ subroutine get_q3list(fname,bDiskData,nlist,list) if(age.gt.24.0) cycle grid6=ctmp(i)%grid//'mm' call grid2deg(grid6,xlon,xlat) - call sun(nt(1),nt(2),nt(3),uth,-xlon,xlat,RASun,DecSun,xLST, & - AzSun,ElSun,mjd,day) - call moondopjpl(nt(1),nt(2),nt(3),uth,-xlon,xlat,RAMoon,DecMoon, & - xLST,HA,AzMoon,ElMoon,vr,techo) + call sun(utc_year,utc_month,utc_day,uth,-xlon,xlat,RASun,DecSun, & + xLST,AzSun,ElSun,mjd,day) + call moondopjpl(utc_year,utc_month,utc_day,uth,-xlon,xlat,RAMoon, & + DecMoon, & + xLST,HA,AzMoon,ElMoon,vr,techo,ephemeris_result) + if(ephemeris_result.eq.EPHEMERIS_INVALID_INPUT .or. & + ephemeris_result.eq.EPHEMERIS_UNAVAILABLE) cycle if(ElMoon.lt.-5.0 .and. (.not.bDiskData)) cycle j=j+1 !Keep this one... callers(j)=ctmp(i) @@ -63,7 +71,7 @@ subroutine get_q3list(fname,bDiskData,nlist,list) age=(now - callers(j)%nsec)/3600.0 write(list(i),1000) i,callers(j)%nfreq,callers(j)%call, & callers(j)%grid,callers(j)%moonel,age,char(0) -1000 format(i2,'.',i6,2x,a6,2x,a4,i5,f7.1,a1) +1000 format(i2,'.',i6,2x,a6,2x,a4,i5,f7.1,1x,a1) ! h1=mod(now,86400)/3600.0 ! h2=mod(callers(i)%nsec,86400)/3600.0 @@ -81,9 +89,70 @@ subroutine get_q3list(fname,bDiskData,nlist,list) return end subroutine get_q3list +subroutine normalize_utc_calendar(values,year,month,day,uth) + + implicit none + + integer, intent(in) :: values(8) + integer, intent(out) :: year,month,day + real, intent(out) :: uth + real :: utc_seconds + + year=values(1) + month=values(2) + day=values(3) + utc_seconds=3600.0*values(5) + 60.0*values(6) + values(7) + & + 0.001*values(8) - 60.0*values(4) + + if(utc_seconds.lt.0.0) then + utc_seconds=utc_seconds + 86400.0 + day=day - 1 + if(day.lt.1) then + month=month - 1 + if(month.lt.1) then + year=year - 1 + month=12 + endif + day=days_in_month(year,month) + endif + else if(utc_seconds.ge.86400.0) then + utc_seconds=utc_seconds - 86400.0 + day=day + 1 + if(day.gt.days_in_month(year,month)) then + day=1 + month=month + 1 + if(month.gt.12) then + year=year + 1 + month=1 + endif + endif + endif + uth=utc_seconds/3600.0 + +contains + + integer function days_in_month(calendar_year,calendar_month) + integer, intent(in) :: calendar_year,calendar_month + logical :: leap_year + + select case(calendar_month) + case(4,6,9,11) + days_in_month=30 + case(2) + leap_year=mod(calendar_year,400).eq.0 .or. & + (mod(calendar_year,4).eq.0 .and. mod(calendar_year,100).ne.0) + days_in_month=28 + if(leap_year) days_in_month=29 + case default + days_in_month=31 + end select + end function days_in_month + +end subroutine normalize_utc_calendar + subroutine rm_q3list(dxcall0) - parameter (MAX_CALLERS=40) + parameter (MAX_CALLERS=50) type q3list character*6 call character*4 grid @@ -125,10 +194,16 @@ subroutine rm_q3list(dxcall0) end subroutine rm_q3list subroutine jpl_setup(fname) + use jpl_ephemeris_status, only: reset_jpl_reader character*256 fname,jpleph_file_name common/jplcom/jpleph_file_name - j=index(fname,char(0)) - jpleph_file_name(1:j)=fname(1:j) - jpleph_file_name(j:)=' ' + j = index(fname,char(0)) + if(j.eq.0) then + jpleph_file_name=fname + else + jpleph_file_name(1:j)=fname(1:j) + jpleph_file_name(j:)=' ' + endif + call reset_jpl_reader() return end subroutine jpl_setup diff --git a/lib/gfsk_pulse.f90 b/lib/gfsk_pulse.f90 new file mode 100644 index 00000000..99ab78e3 --- /dev/null +++ b/lib/gfsk_pulse.f90 @@ -0,0 +1,6 @@ +real function gfsk_pulse(b,t) + pi=4.*atan(1.0) + c=pi*sqrt(2.0/log(2.0)) + gfsk_pulse=0.5*(erf(c*b*(t+0.5))-erf(c*b*(t-0.5))) + return +end function gfsk_pulse diff --git a/lib/hspec.f90 b/lib/hspec.f90 index 216f2ddf..9db613cb 100644 --- a/lib/hspec.f90 +++ b/lib/hspec.f90 @@ -96,7 +96,8 @@ subroutine hspec(id2,k,nutc0,ntrpdepth,nrxfreq,ntol,bmsk144, & k0=k-3584 tt2=sum(float(abs(id2(k0:k0+3583)))) if(tt1.ne.0.0 .and. tt2.ne.0) then - call mskrtd(id2(k-7168+1:k),nutc0,tsec,ntol,nrxfreq,ndepth, & +! k is the end-exclusive count supplied by the audio producer. + call mskrtd(id2(k-7168:k-1),nutc0,tsec,ntol,nrxfreq,ndepth, & mycall,hiscall,bshmsg,btrain,pcoeffs,bswl,datadir,line0) if(line0(1:1).eq.char(0)) then line1(1:1)=char(0) diff --git a/lib/jpl_ephemeris_status.f90 b/lib/jpl_ephemeris_status.f90 new file mode 100644 index 00000000..0d15cdc8 --- /dev/null +++ b/lib/jpl_ephemeris_status.f90 @@ -0,0 +1,29 @@ +module jpl_ephemeris_status + implicit none + + integer, parameter :: JPL_STATUS_OK = 0 + integer, parameter :: JPL_STATUS_IO_ERROR = 1 + integer, parameter :: JPL_STATUS_INVALID_HEADER = 2 + integer, parameter :: JPL_STATUS_OUT_OF_RANGE = 3 + integer, parameter :: JPL_STATUS_NOT_AVAILABLE = 4 + integer, parameter :: JPL_STATUS_INVALID_REQUEST = 5 + + integer, parameter :: EPHEMERIS_JPL = 0 + integer, parameter :: EPHEMERIS_ANALYTIC_FALLBACK = 1 + integer, parameter :: EPHEMERIS_INVALID_INPUT = 2 + integer, parameter :: EPHEMERIS_UNAVAILABLE = 3 + + integer, save :: configuration_generation = 0 + integer, save :: jpl_reader_generation = 0 + +contains + + subroutine reset_jpl_reader() + configuration_generation = configuration_generation + 1 + end subroutine reset_jpl_reader + + subroutine note_jpl_reader_change() + jpl_reader_generation = jpl_reader_generation + 1 + end subroutine note_jpl_reader_change + +end module jpl_ephemeris_status diff --git a/lib/jplsubs.f b/lib/jplsubs.f index f1438d93..e1e4fb8d 100644 --- a/lib/jplsubs.f +++ b/lib/jplsubs.f @@ -52,8 +52,7 @@ C IF 'INQUIRE' DOES NOT WORK, USUALLY IRECSZ WILL BE LEFT AT 0 . ' INQUIRE STATEMENT PROBABLY DID NOT WORK' KSIZE=IRECSZ/NRECL - if(nrfile.eq.-99) stop !silence compiler warning - + NRFILE=-1 RETURN END @@ -97,7 +96,7 @@ C C NRFILE IS THE INTERNAL UNIT NUMBER USED FOR THE EPHEMERIS FILE - NRFILE=12 + NRFILE=-1 C NAMFIL IS THE EXTERNAL NAME OF THE BINARY EPHEMERIS FILE @@ -112,15 +111,28 @@ C ** DETERMINE THE SIZE OF THE EPHEMERIS RECORD MRECL=NRECL*1000 - OPEN(NRFILE, + OPEN(NEWUNIT=NRFILE, * FILE=NAMFIL, * ACCESS='DIRECT', * FORM='UNFORMATTED', * RECL=MRECL, - * STATUS='OLD') + * STATUS='OLD', + * ACTION='READ', + * IOSTAT=IOS) + IF(IOS.NE.0) THEN + KSIZE=0 + NRFILE=-1 + RETURN + ENDIF - READ(NRFILE,REC=1)TTL,(CNAM(K),K=1,OLDMAX),SS,NCON,AU,EMRAT, + READ(NRFILE,REC=1,IOSTAT=IOS)TTL, + & (CNAM(K),K=1,OLDMAX),SS,NCON,AU,EMRAT, & ((IPT(I,J),I=1,3),J=1,12),NUMDE,(IPT(I,13),I=1,3) + IF(IOS.NE.0) THEN + KSIZE=0 + CLOSE(NRFILE) + RETURN + ENDIF CLOSE(NRFILE) @@ -205,14 +217,11 @@ C ******************************************************************* END C++++++++++++++++++++++++++ C - SUBROUTINE PLEPH ( ET, NTARG, NCENT, RRD ) + SUBROUTINE PLEPH ( ET, NTARG, NCENT, RRD, STATUS ) + USE JPL_EPHEMERIS_STATUS C C++++++++++++++++++++++++++ -C NOTE : Over the years, different versions of PLEPH have had a fifth argument: -C sometimes, an error return statement number; sometimes, a logical denoting -C whether or not the requested date is covered by the ephemeris. We apologize -C for this inconsistency; in this present version, we use only the four necessary -C arguments and do the testing outside of the subroutine. +C STATUS REPORTS FILE, HEADER, RANGE, AND REQUEST ERRORS WITHOUT TERMINATING. C C THIS SUBROUTINE READS THE JPL PLANETARY EPHEMERIS C AND GIVES THE POSITION AND VELOCITY OF THE POINT 'NTARG' @@ -254,6 +263,8 @@ C RADIANS AND RADIANS/DAY. C C The option is available to have the units in km and km/sec. C For this, set km=.true. in the STCOMX common block. +C +C STATUS = INTEGER STATUS VALUE DEFINED BY JPL_EPHEMERIS_STATUS. C IMPLICIT DOUBLE PRECISION (A-H,O-Z) @@ -267,10 +278,8 @@ C DATA ZIPS/2*0.d0/ LOGICAL BSAVE,KM,BARY - LOGICAL FIRST - DATA FIRST/.TRUE./ - INTEGER LIST(12),IPT(39),DENUM + INTEGER LIST(12),IPT(39),DENUM,STATUS COMMON/EPHHDR/CVAL,SS,AU,EMRAT,DENUM,NCON,IPT COMMON/STCOMX/KM,BARY,PVSUN @@ -283,13 +292,26 @@ C C ENTRY POINT 'DPLEPH' FOR DOUBLY-DIMENSIONED TIME ARGUMENT C (SEE THE DISCUSSION IN THE SUBROUTINE STATE) - ENTRY DPLEPH(ET2Z,NTARG,NCENT,RRD) + ENTRY DPLEPH(ET2Z,NTARG,NCENT,RRD,STATUS) ET2(1)=ET2Z(1) ET2(2)=ET2Z(2) - 11 IF(FIRST) CALL STATE(ZIPS,LIST,PVST,PNUT) - FIRST=.FALSE. + 11 STATUS=JPL_STATUS_OK + DO I=1,6 + RRD(I)=0.D0 + ENDDO + + IF(NTARG.EQ.14 .OR. NTARG.EQ.15) THEN + IF(NCENT.NE.0) THEN + STATUS=JPL_STATUS_INVALID_REQUEST + RETURN + ENDIF + ELSE IF(NTARG.LT.1 .OR. NTARG.GT.13 .OR. + * NCENT.LT.1 .OR. NCENT.GT.13) THEN + STATUS=JPL_STATUS_INVALID_REQUEST + RETURN + ENDIF IF(NTARG .EQ. NCENT) RETURN @@ -300,44 +322,25 @@ C (SEE THE DISCUSSION IN THE SUBROUTINE STATE) C CHECK FOR NUTATION CALL IF(NTARG.NE.14) GO TO 97 - IF(IPT(35).GT.0) THEN - LIST(11)=2 - CALL STATE(ET2,LIST,PVST,PNUT) - DO I=1,4 - RRD(I)=PNUT(I) - ENDDO - RRD(5) = 0.d0 - RRD(6) = 0.d0 - RETURN - ELSE - DO I=1,4 - RRD(I)=0.d0 - ENDDO - WRITE(6,297) - 297 FORMAT(' ***** NO NUTATIONS ON THE EPHEMERIS FILE *****') - STOP - ENDIF + LIST(11)=2 + CALL STATE(ET2,LIST,PVST,PNUT,STATUS) + IF(STATUS.NE.JPL_STATUS_OK) RETURN + DO I=1,4 + RRD(I)=PNUT(I) + ENDDO + RETURN C CHECK FOR LIBRATIONS 97 CONTINUE - DO I=1,6 - RRD(I)=0.d0 - ENDDO - IF(NTARG.NE.15) GO TO 98 - IF(IPT(38).GT.0) THEN - LIST(12)=2 - CALL STATE(ET2,LIST,PVST,PNUT) - DO I=1,6 - RRD(I)=PVST(I,11) - ENDDO - RETURN - ELSE - WRITE(6,298) - 298 FORMAT(' ***** NO LIBRATIONS ON THE EPHEMERIS FILE *****') - STOP - ENDIF + LIST(12)=2 + CALL STATE(ET2,LIST,PVST,PNUT,STATUS) + IF(STATUS.NE.JPL_STATUS_OK) RETURN + DO I=1,6 + RRD(I)=PVST(I,11) + ENDDO + RETURN C FORCE BARYCENTRIC OUTPUT BY 'STATE' @@ -357,7 +360,8 @@ C SET UP PROPER ENTRIES IN 'LIST' ARRAY FOR STATE CALL C MAKE CALL TO STATE - CALL STATE(ET2,LIST,PVST,PNUT) + CALL STATE(ET2,LIST,PVST,PNUT,STATUS) + IF(STATUS.NE.JPL_STATUS_OK) GO TO 190 DO I=1,10 DO J = 1,6 @@ -409,6 +413,8 @@ C MAKE CALL TO STATE BARY=BSAVE RETURN + 190 BARY=BSAVE + RETURN END C+++++++++++++++++++++++++++++++++ C @@ -576,7 +582,10 @@ C MAKE ADJUSTMENTS FOR NEGATIVE INPUT NUMBER C++++++++++++++++++++++++++++++++ C - SUBROUTINE STATE(ET2,LIST,PV,PNUT) + SUBROUTINE STATE(ET2,LIST,PV,PNUT,STATUS) + USE JPL_EPHEMERIS_STATUS + USE IEEE_ARITHMETIC, ONLY: IEEE_IS_FINITE + USE ISO_FORTRAN_ENV, ONLY: INT64 C C++++++++++++++++++++++++++++++++ C @@ -656,8 +665,7 @@ C D EPSILON (NUTATION IN OBLIQUITY) C D PSI DOT C D EPSILON DOT C -C * STATEMENT # FOR ERROR RETURN, IN CASE OF EPOCH OUT OF -C RANGE OR I/O ERRORS. +C STATUS INTEGER STATUS VALUE DEFINED BY JPL_EPHEMERIS_STATUS. C C COMMON AREA STCOMX: C @@ -685,67 +693,138 @@ C PARAMETER ( OLDMAX = 400) INTEGER NMAX PARAMETER ( NMAX = 1000) - DIMENSION ET2(2),PV(6,11),PNUT(4),T(2),PJD(4),BUF(1500), . SS(3),CVAL(NMAX),PVSUN(6) - INTEGER LIST(12),IPT(3,13) - - LOGICAL FIRST - DATA FIRST/.TRUE./ + INTEGER LIST(12),IPT(3,13),STATUS + INTEGER(INT64) FILESIZE,IRECORD_END CHARACTER*6 TTL(14,3),CNAM(NMAX) - CHARACTER*256 NAMFIL + CHARACTER*256 NAMFIL,JPLEPH_FILE_NAME,ACTIVE_PATH - LOGICAL KM,BARY + LOGICAL KM,BARY,INITIALIZED,FAILED,ISOPEN + INTEGER SAVED_GENERATION,FAILURE_STATUS + DATA INITIALIZED/.FALSE./,FAILED/.FALSE./ + DATA SAVED_GENERATION/-1/,FAILURE_STATUS/1/ + DATA NRFILE/-1/,NRL/0/,ACTIVE_PATH/' '/ COMMON/EPHHDR/CVAL,SS,AU,EMRAT,NUMDE,NCON,IPT COMMON/CHRHDR/CNAM,TTL COMMON/STCOMX/KM,BARY,PVSUN + COMMON/JPLCOM/JPLEPH_FILE_NAME -C -C ENTRY POINT - 1ST TIME IN, GET POINTER DATA, ETC., FROM EPH FILE -C - IF(FIRST) THEN - FIRST=.FALSE. - -C ************************************************************************ -C ************************************************************************ - -C THE USER MUST SELECT ONE OF THE FOLLOWING BY DELETING THE 'C' IN COLUMN 1 + STATUS=JPL_STATUS_OK + DO I=1,11 + DO J=1,6 + PV(J,I)=0.D0 + ENDDO + ENDDO + DO I=1,4 + PNUT(I)=0.D0 + ENDDO + DO I=1,6 + PVSUN(I)=0.D0 + ENDDO -C ************************************************************************ +C RESET LOCAL READER STATE WHEN THE CONFIGURATION CHANGES -C CALL FSIZER1(NRECL,KSIZE,NRFILE,NAMFIL) -C CALL FSIZER2(NRECL,KSIZE,NRFILE,NAMFIL) - CALL FSIZER3(NRECL,KSIZE,NRFILE,NAMFIL) + IF(SAVED_GENERATION.NE.CONFIGURATION_GENERATION .OR. + * ACTIVE_PATH.NE.JPLEPH_FILE_NAME) THEN + IF(NRFILE.NE.-1) THEN + INQUIRE(UNIT=NRFILE,OPENED=ISOPEN) + IF(ISOPEN) CLOSE(NRFILE) + ENDIF + NRFILE=-1 + NRL=0 + INITIALIZED=.FALSE. + FAILED=.FALSE. + FAILURE_STATUS=JPL_STATUS_IO_ERROR + ACTIVE_PATH=JPLEPH_FILE_NAME + SAVED_GENERATION=CONFIGURATION_GENERATION + CALL NOTE_JPL_READER_CHANGE() + ENDIF - IF(NRECL .EQ. 0) WRITE(*,*)' ***** FSIZER IS NOT WORKING *****' + IF(.NOT.IEEE_IS_FINITE(ET2(1)) .OR. + * .NOT.IEEE_IS_FINITE(ET2(2))) THEN + STATUS=JPL_STATUS_INVALID_REQUEST + RETURN + ENDIF -C ************************************************************************ -C ************************************************************************ + IF(FAILED) THEN + STATUS=FAILURE_STATUS + RETURN + ENDIF +C +C ENTRY POINT - 1ST TIME IN, GET POINTER DATA, ETC., FROM EPH FILE +C + IF(.NOT.INITIALIZED) THEN + NRECL=4 + KSIZE=2036 + NAMFIL=JPLEPH_FILE_NAME IRECSZ=NRECL*KSIZE NCOEFFS=KSIZE/2 - OPEN(NRFILE, + OPEN(NEWUNIT=NRFILE, * FILE=NAMFIL, * ACCESS='DIRECT', * FORM='UNFORMATTED', * RECL=IRECSZ, - * STATUS='OLD') + * STATUS='OLD', + * ACTION='READ', + * IOSTAT=IOS) + IF(IOS.NE.0) THEN + NRFILE=-1 + GO TO 990 + ENDIF - READ(NRFILE,REC=1)TTL,(CNAM(K),K=1,OLDMAX),SS,NCON,AU,EMRAT, + READ(NRFILE,REC=1,IOSTAT=IOS)TTL, + & (CNAM(K),K=1,OLDMAX),SS,NCON,AU,EMRAT, & ((IPT(I,J),I=1,3),J=1,12),NUMDE,(IPT(I,13),I=1,3) - & ,(CNAM(L),L=OLDMAX+1,NCON) - - IF(NCON .LE. OLDMAX)THEN - READ(NRFILE,REC=2)(CVAL(I),I=1,OLDMAX) - ELSE - READ(NRFILE,REC=2)(CVAL(I),I=1,NCON) + IF(IOS.NE.0) GO TO 991 + IF(NCON.LT.0 .OR. NCON.GT.NMAX .OR. + * NCON.GT.NCOEFFS) GO TO 992 + +C READ EXTENDED CONSTANT NAMES ONLY AFTER NCON IS KNOWN TO FIT + + IF(NCON.GT.OLDMAX) THEN + READ(NRFILE,REC=1,IOSTAT=IOS)TTL, + & (CNAM(K),K=1,OLDMAX),SS,NCON,AU,EMRAT, + & ((IPT(I,J),I=1,3),J=1,12),NUMDE, + & (IPT(I,13),I=1,3),(CNAM(L),L=OLDMAX+1,NCON) + IF(IOS.NE.0) GO TO 991 ENDIF + IF(.NOT.IEEE_IS_FINITE(SS(1)) .OR. + * .NOT.IEEE_IS_FINITE(SS(2)) .OR. + * .NOT.IEEE_IS_FINITE(SS(3)) .OR. + * .NOT.IEEE_IS_FINITE(AU) .OR. + * .NOT.IEEE_IS_FINITE(EMRAT)) GO TO 992 + IF(SS(2).LE.SS(1) .OR. SS(3).LE.0.D0 .OR. + * AU.LE.0.D0 .OR. EMRAT.LE.0.D0) GO TO 992 + + DO J=1,13 + IF(IPT(1,J).EQ.0 .AND. IPT(2,J).EQ.0 .AND. + * IPT(3,J).EQ.0) THEN + IF(J.LE.11) GO TO 992 + ELSE + IF(IPT(1,J).LE.0 .OR. IPT(2,J).LE.0 .OR. + * IPT(3,J).LE.0) GO TO 992 + IF(IPT(1,J).GT.NCOEFFS .OR. IPT(2,J).GT.18 + * .OR. IPT(3,J).GT.NCOEFFS) GO TO 992 + NCOMP=3 + IF(J.EQ.12) NCOMP=2 + IAVAILABLE=NCOEFFS-IPT(1,J)+1 + IF(IPT(2,J).GT.IAVAILABLE/NCOMP/IPT(3,J)) GO TO 992 + ENDIF + ENDDO + + NVALUES=MAX(OLDMAX,NCON) + READ(NRFILE,REC=2,IOSTAT=IOS)(CVAL(I),I=1,NVALUES) + IF(IOS.NE.0) GO TO 991 + NRL=0 + INITIALIZED=.TRUE. ENDIF @@ -753,6 +832,15 @@ C ********** MAIN ENTRY POINT ********** IF(ET2(1) .EQ. 0.D0) RETURN + IF(LIST(11).GT.0 .AND. IPT(2,12).EQ.0) THEN + STATUS=JPL_STATUS_NOT_AVAILABLE + RETURN + ENDIF + IF(LIST(12).GT.0 .AND. IPT(2,13).EQ.0) THEN + STATUS=JPL_STATUS_NOT_AVAILABLE + RETURN + ENDIF + S=ET2(1)-.5D0 CALL SPLIT_DP(S,PJD(1)) CALL SPLIT_DP(ET2(2),PJD(3)) @@ -763,11 +851,21 @@ C ********** MAIN ENTRY POINT ********** C ERROR RETURN FOR EPOCH OUT OF RANGE - IF(PJD(1)+PJD(4).LT.SS(1) .OR. PJD(1)+PJD(4).GT.SS(2)) GO TO 98 + IF(PJD(1)+PJD(4).LT.SS(1) .OR. + * PJD(1)+PJD(4).GT.SS(2)) THEN + STATUS=JPL_STATUS_OUT_OF_RANGE + RETURN + ENDIF C CALCULATE RECORD # AND RELATIVE TIME IN INTERVAL - NR=IDINT((PJD(1)-SS(1))/SS(3))+3 + RECORD_SPAN=PJD(1)-SS(1)+PJD(4) + IF(.NOT.IEEE_IS_FINITE(RECORD_SPAN)) GO TO 992 + IF(SS(3).LE.RECORD_SPAN/DBLE(HUGE(NR)-3)) GO TO 992 + RECORD_OFFSET=RECORD_SPAN/SS(3) + IF(.NOT.IEEE_IS_FINITE(RECORD_OFFSET) .OR. + * RECORD_OFFSET.GE.DBLE(HUGE(NR)-3)) GO TO 992 + NR=IDINT(RECORD_OFFSET)+3 IF(PJD(1).EQ.SS(2)) NR=NR-1 tmp1 = DBLE(NR-3)*SS(3) + SS(1) @@ -777,8 +875,13 @@ C CALCULATE RECORD # AND RELATIVE TIME IN INTERVAL C READ CORRECT RECORD IF NOT IN CORE IF(NR.NE.NRL) THEN + INQUIRE(UNIT=NRFILE,SIZE=FILESIZE,IOSTAT=IOS) + IF(IOS.NE.0) GO TO 991 + IRECORD_END=INT(NR,INT64)*INT(IRECSZ,INT64) + IF(FILESIZE.LT.IRECORD_END) GO TO 991 + READ(NRFILE,REC=NR,IOSTAT=IOS)(BUF(K),K=1,NCOEFFS) + IF(IOS.NE.0) GO TO 991 NRL=NR - READ(NRFILE,REC=NR,ERR=99)(BUF(K),K=1,NCOEFFS) ENDIF IF(KM) THEN @@ -829,20 +932,27 @@ C GET LIBRATIONS IF REQUESTED (AND IF ON FILE) RETURN - 98 WRITE(*,198)ET2(1)+ET2(2),SS(1),SS(2) - 198 FORMAT(' *** Requested JED,',f12.2, - * ' not within ephemeris limits,',2f12.2,' ***') - - STOP - - 99 WRITE(*,'(2F12.2,A80)')ET2,'ERROR RETURN IN STATE' - - STOP + 990 FAILURE_STATUS=JPL_STATUS_IO_ERROR + GO TO 994 + 991 FAILURE_STATUS=JPL_STATUS_IO_ERROR + GO TO 993 + 992 FAILURE_STATUS=JPL_STATUS_INVALID_HEADER + 993 IF(NRFILE.NE.-1) THEN + INQUIRE(UNIT=NRFILE,OPENED=ISOPEN) + IF(ISOPEN) CLOSE(NRFILE) + ENDIF + 994 NRFILE=-1 + NRL=0 + INITIALIZED=.FALSE. + FAILED=.TRUE. + STATUS=FAILURE_STATUS + RETURN END C+++++++++++++++++++++++++++++ C SUBROUTINE CONST(NAM,VAL,SSS,N) + USE JPL_EPHEMERIS_STATUS C C+++++++++++++++++++++++++++++ C @@ -871,17 +981,17 @@ C DOUBLE PRECISION PVST(6,11),PNUT(4) DATA ZIPS/2*0.d0/ - INTEGER IPT(3,13),DENUM,LIST(12) - logical first - data first/.true./ - + INTEGER IPT(3,13),DENUM,LIST(12),STATUS COMMON/EPHHDR/CVAL,SS,AU,EMRAT,DENUM,NCON,IPT COMMON/CHRHDR/CNAM,TTL C CALL STATE TO INITIALIZE THE EPHEMERIS AND READ IN THE CONSTANTS - IF(FIRST) CALL STATE(ZIPS,LIST,PVST,PNUT) - first=.false. + CALL STATE(ZIPS,LIST,PVST,PNUT,STATUS) + IF(STATUS.NE.JPL_STATUS_OK) THEN + N=0 + RETURN + ENDIF N=NCON diff --git a/lib/jt4.f90 b/lib/jt4.f90 index 21407255..42a2d16b 100644 --- a/lib/jt4.f90 +++ b/lib/jt4.f90 @@ -23,4 +23,7 @@ module jt4 0,1,1,1,0,0,1,0,1,1,0,1,1,1,1,0,0,0,0,1,1,0,1,1,0,0,0,1,1,1, & 0,1,1,1,0,1,1,1,0,0,1,0,0,0,1,1,0,1,1,0,0,1,0,0,0,1,1,1,1,1, & 1,0,0,1,1,0,0,0,0,1,1,0,0,0,1,0,1,1,0,1,1,1,1,0,1,0,1/ + + save ppsave,zz + end module jt4 diff --git a/lib/jt49sim.f90 b/lib/jt49sim.f90 index 7da5b510..9bced81e 100644 --- a/lib/jt49sim.f90 +++ b/lib/jt49sim.f90 @@ -80,7 +80,7 @@ program jt49sim do ifile=1,nfiles !Loop over requested number of files write(fname,1002) ifile !Output filename 1002 format('000000_',i4.4) - open(10,file=fname//'.wav',access='stream',status='unknown') + open(10,file=fname//'.wav',access='stream',status='replace') xnoise=0. cdat=0. if(snrdb.lt.90) then diff --git a/lib/jt4_decode.f90 b/lib/jt4_decode.f90 index 483c8275..8ab48bda 100644 --- a/lib/jt4_decode.f90 +++ b/lib/jt4_decode.f90 @@ -61,9 +61,9 @@ contains character(len=12), intent(in) :: mycall,hiscall character(len=6), intent(in) :: hisgrid procedure(jt4_average_callback), optional :: average_callback - real*4 dat(30*11025) character*6 cfile6 + save dat this%decode_callback => decode_callback if (present (average_callback)) then @@ -443,7 +443,6 @@ subroutine getsnr(dat,npts,mode4,dtx,decoded,nsnr) do i=1,nh s(i)=real(cx(i))**2 + aimag(cx(i))**2 enddo - jtone=nint((fpk-1500)/(mode4*df)) nshift=mode4*itone(j) savg=savg + cshift(s,nshift) !Move all power into lowest tone freq enddo diff --git a/lib/jt4sim.f90 b/lib/jt4sim.f90 index 73edabf7..c15d6d55 100644 --- a/lib/jt4sim.f90 +++ b/lib/jt4sim.f90 @@ -62,7 +62,7 @@ program jt4sim do ifile=1,nfiles !Loop over requested number of files write(fname,1002) ifile !Output filename 1002 format('000000_',i4.4) - open(10,file=fname//'.wav',access='stream',status='unknown') + open(10,file=fname//'.wav',access='stream',status='replace') xnoise=0. cdat=0. if(snrdb.lt.90) then diff --git a/lib/jt65.f90 b/lib/jt65.f90 index bce3a4f1..2e77c694 100644 --- a/lib/jt65.f90 +++ b/lib/jt65.f90 @@ -17,6 +17,7 @@ program jt65 character(len=500) optarg character*12 mycall,hiscall character*6 hisgrid + integer :: files_read, samples_read type (option) :: long_options(12) = [ & option ('aggressive',.true.,'a','aggressiveness [0-10], default AGGR=0','AGGR'), & @@ -107,6 +108,7 @@ program jt65 call timer('jt65 ',0) ndecoded=0 + files_read=0 do ifile=noffset+1,noffset+nremain nfa=nlow nfb=nhigh @@ -114,14 +116,32 @@ program jt65 call get_command_argument(ifile,optarg,narglen) infile=optarg(:narglen) call timer('read ',0) - call wav%read (infile) + call wav%read (infile, ios, optarg) + if (ios /= 0) then + call timer('read ',1) + write(*,*) 'Cannot read WAV file ',trim(infile),': ',trim(optarg) + cycle + end if + if (wav%audio_format%sample_rate /= 12000) then + close(unit=wav%lun) + call timer('read ',1) + write(*,*) 'Cannot read WAV file ',trim(infile),': unsupported sample rate' + cycle + end if i1=index(infile,'.wav') if( i1 .eq. 0 ) i1=index(infile,'.WAV') read(infile(i1-4:i1-1),*,err=998) nutc npts=52*12000 - read(unit=wav%lun) id2(1:npts) + id2=0 + call wav%read_samples(id2(1:npts), samples_read, ios, optarg) close(unit=wav%lun) call timer('read ',1) + if (ios /= 0) then + write(*,*) 'Cannot read WAV file ',trim(infile),': ',trim(optarg) + cycle + end if + if (samples_read < npts) print*,'EOF on input file ',trim(infile) + files_read=files_read+1 dd(1:npts)=id2(1:npts) dd(npts+1:)=0. call test(dd,nutc,nfa,nfb,nfqso,ntol,nsubmode, & @@ -132,6 +152,7 @@ program jt65 call timer('jt65 ',1) call timer('jt65 ',101) + if (files_read == 0) stop 2 ! call four2a(a,-1,1,1,1) !Free the memory used for plans ! call filbig(a,-1,1,0.0,0,0,0,0,0) ! (ditto) go to 999 diff --git a/lib/jt65_decode.f90 b/lib/jt65_decode.f90 index 4e73ee7b..18a901ce 100644 --- a/lib/jt65_decode.f90 +++ b/lib/jt65_decode.f90 @@ -205,6 +205,8 @@ contains if(bVHF) then flip=ca(icand)%flip nflip=int(flip) + else + nflip=1 endif if(sync1.lt.float(minsync)) nflip=0 if(ipass.eq.1) ntry65a=ntry65a + 1 @@ -275,6 +277,8 @@ contains ! Display a decoded message obtained by averaging 2 or more transmissions call this%callback(sync1,nsnr,dtx-1.0,nfreq,ndrift, & nflip,width,avemsg,nftt,nqave,nsmo,nsum,minsync) + if (iand(ndepth,128).ne.0 .and. .not.nagain .and. & + abs(nfreq-nfqso).le.ntol) clear_avg65=.true. ! AutoClrAvg prtavg=.true. end if @@ -370,6 +374,13 @@ contains data first/.true./ save + nftt=0 + avemsg=' ' + deepave=' ' + qave=0.0 + deepbest=' ' + nfttbest=0 + if(first .or. clear_avg65) then iutc=-1 nfsave=0 @@ -385,7 +396,10 @@ contains do i=1,64 if(iutc(i).lt.0) exit - if(nutc.eq.iutc(i) .and. abs(nfreq-nfsave(i)).le.ntol) go to 10 + if(nutc.eq.iutc(i) .and. abs(nfreq-nfsave(i)).le.ntol) then + nsave=mod(nsave-2+MAXAVE,MAXAVE)+1 + go to 10 + endif enddo ! Save data for message averaging @@ -396,9 +410,6 @@ contains nflipsave(nsave)=nflip s1save(-255:256,1:126,nsave)=s1 s3save(1:64,1:63,nsave)=s3a - avemsg=' ' - deepbest=' ' - nfttbest=0 10 syncsum=0. dtsum=0. diff --git a/lib/jt65_mod.f90 b/lib/jt65_mod.f90 index 23c29537..772ebeae 100644 --- a/lib/jt65_mod.f90 +++ b/lib/jt65_mod.f90 @@ -1,5 +1,7 @@ module jt65_mod + save + integer param(0:9) integer mrs(63) integer mrs2(63) diff --git a/lib/jt65sim.f90 b/lib/jt65sim.f90 index 623a0fca..d3f099ff 100644 --- a/lib/jt65sim.f90 +++ b/lib/jt65sim.f90 @@ -151,7 +151,7 @@ program jt65sim do ifile=1,nfiles !Loop over requested number of files write(fname,1002) ifile !Output filename 1002 format('000000_',i4.4) - open(10,file=fname//'.wav',access='stream',status='unknown') + open(10,file=fname//'.wav',access='stream',status='replace') xnoise=0. cdat=0. diff --git a/lib/jt9.f90 b/lib/jt9.f90 index c6c80164..be09716b 100644 --- a/lib/jt9.f90 +++ b/lib/jt9.f90 @@ -10,11 +10,22 @@ program jt9 use timer_module, only: timer use timer_impl, only: init_timer, fini_timer use readwav + use jt9_input_validation, only: parse_integer, parse_real, parse_wav_filename_nutc + use, intrinsic :: iso_fortran_env, only: error_unit use ft8_mod1, only : dd8 use jt65_mod6, only : dd + use streaming_emit, only: streaming_emit_set_enabled, streaming_emit_error + use jt9_params_init, only: init_default_params, init_streaming_extra_fields, & + apply_per_mode_policy, cli_args_t include 'jt9com.f90' + interface + subroutine jt9_print_version() bind(C, name='jt9_print_version') + end subroutine jt9_print_version + end interface + + type(cli_args_t) :: args integer*2 id2a(180000) integer(C_INT) iret type(wav_header) wav @@ -28,18 +39,24 @@ program jt9 integer :: arglen,stat,offset,remain,mode=0,flow=200,fsplit=2700, & fhigh=4000,nrxfreq=1500,ndepth=1,nexp_decode=0,nQSOProg=0,ncycles=3, & - nft8rxfsens=3,nmt=0,nmtft8decsens=3,ndecoderstart=3 + nft8rxfsens=3,nmt=0,nmtft8decsens=3,ndecoderstart=3, samples_read, wav_status logical :: read_files = .true., tx9 = .false., display_help = .false., & + display_version = .false., & bLowSidelobes = .false., nexp_decode_set = .false., & have_ntol = .false.,multift8 = .false.,hidedupes = .false., & - lft8lowth = .true.,lft8subpass = .true.,lwidedxcsearch = .true. - type (option) :: long_options(41) = [ & + lft8lowth = .true.,lft8subpass = .true.,lwidedxcsearch = .true., & + stream_mode = .false. + type (option) :: long_options(43) = [ & option ('help', .false., 'h', 'Display this help message', ''), & + option ('version', .false., 'v', 'Display version and build revision', ''),& option ('shmem',.true.,'s','Use shared memory for sample data','KEY'), & + option ('stream', .false., '0', & + 'Read framed PCM samples from stdin', & + ''), & option ('tr-period', .true., 'p', 'Tx/Rx period, default SECONDS=60', & 'SECONDS'), & option ('executable-path', .true., 'e', & - 'Location of subordinate executables (KVASD) default PATH="."', & + 'Location of subordinate executables, default PATH="."', & 'PATH'), & option ('data-path', .true., 'a', & 'Location of writeable data files, default PATH="."', 'PATH'), & @@ -107,7 +124,6 @@ program jt9 'FLAGS') ] type(dec_data), allocatable :: shared_data - character(len=20) :: datetime='' character(len=12) :: mycall='K1ABC', hiscall='W9XYZ' character(len=6) :: mygrid='', hisgrid='EN37' common/patience/npatience,nthreads @@ -119,7 +135,7 @@ program jt9 TRperiod=60.d0 do - call getopt('hs:e:a:b:r:m:p:d:f:F:w:t:9876543WYqkTMUSZL:S:H:c:G:x:g:X:Q:C:R:N:E:D:', & + call getopt('hvs:e:a:b:r:m:p:d:f:F:w:t:9876543WYqkTMUSZL:S:H:c:G:x:g:X:Q:C:R:N:E:D:', & long_options,c,optarg,arglen,stat,offset,remain,.true.) if (stat .ne. 0) then exit @@ -127,9 +143,15 @@ program jt9 select case (c) case ('h') display_help = .true. + case ('v') + display_version = .true. case ('s') read_files = .false. shm_key = optarg(:arglen) + case ('0') + read_files = .false. + stream_mode = .true. + call streaming_emit_set_enabled(.true.) case ('e') exe_dir = optarg(:arglen) case ('a') @@ -141,36 +163,39 @@ program jt9 case ('t') temp_dir = optarg(:arglen) case ('m') - read (optarg(:arglen), *) nthreads + call require_integer('m', optarg(:arglen), nthreads) case ('p') - read (optarg(:arglen), *) TRperiod + call require_real('p', optarg(:arglen), TRperiod) + if (TRperiod <= 0.d0 .or. TRperiod > dble(NTMAX)) then + call invalid_option('p', optarg(:arglen), 'must be between 0 and 1800 seconds') + end if case ('d') - read (optarg(:arglen), *) ndepth + call require_integer('d', optarg(:arglen), ndepth) case ('f') - read (optarg(:arglen), *) nrxfreq + call require_integer('f', optarg(:arglen), nrxfreq) case ('F') - read (optarg(:arglen), *) ntol + call require_integer('F', optarg(:arglen), ntol) have_ntol = .true. case ('L') - read (optarg(:arglen), *) flow + call require_integer('L', optarg(:arglen), flow) case ('S') - read (optarg(:arglen), *) fsplit + call require_integer('S', optarg(:arglen), fsplit) case ('H') - read (optarg(:arglen), *) fhigh + call require_integer('H', optarg(:arglen), fhigh) case ('M') multift8 = .true. case ('C') - read (optarg(:arglen), *) ncycles + call require_integer('C', optarg(:arglen), ncycles) case ('U') hidedupes = .true. case ('R') - read (optarg(:arglen), *) nft8rxfsens + call require_integer('R', optarg(:arglen), nft8rxfsens) case ('N') - read (optarg(:arglen), *) nmt + call require_integer('N', optarg(:arglen), nmt) case ('E') - read (optarg(:arglen), *) nmtft8decsens + call require_integer('E', optarg(:arglen), nmtft8decsens) case ('D') - read (optarg(:arglen), *) ndecoderstart + call require_integer('D', optarg(:arglen), ndecoderstart) case ('Z') lwidedxcsearch = .false. case ('q') @@ -178,7 +203,10 @@ program jt9 case ('k') mode = 144 case ('Q') - read (optarg(:arglen), *) nQSOProg + call require_integer('Q', optarg(:arglen), nQSOProg) + if (nQSOProg < 0 .or. nQSOProg > 5) then + call invalid_option('Q', optarg(:arglen), 'must be between 0 and 5') + end if case ('3') mode = 66 case ('4') @@ -196,7 +224,7 @@ program jt9 case ('T') tx9 = .true. case ('w') - read (optarg(:arglen), *) npatience + call require_integer('w', optarg(:arglen), npatience) case ('W') mode = 241 case ('Y') @@ -210,10 +238,15 @@ program jt9 case ('g') read (optarg(:arglen), *) hisgrid case ('X') - read (optarg(:arglen), *) nexp_decode + call require_integer('X', optarg(:arglen), nexp_decode) nexp_decode_set = .true. end select end do + + if (display_version) then + call jt9_print_version() + stop + endif if (display_help .or. stat .lt. 0 & .or. (.not. read_files .and. remain .gt. 0) & @@ -225,6 +258,9 @@ program jt9 print *, ' jt9 -s [-w patience] [-m threads] [-e path] [-a path] [-t path] [-r path]' print *, ' Gets data from shared memory region with key==' print *, '' + print *, ' cat | jt9 --stream' + print *, ' Reads framed PCM samples from stdin.' + print *, '' print *, 'OPTIONS:' print *, '' do i = 1, size (long_options) @@ -250,7 +286,67 @@ program jt9 numfano=0 if (.not. read_files) then - call jt9a() !We're running under control of WSJT-X + if (stream_mode) then + ! Streaming subprocess mode. Mirror the WAV path's shared_data setup, + ! then hand off to the streaming reader. + if (mode .eq. 0) then + mode = 8 ! default: FT8 + if (TRperiod .eq. 60.d0) TRperiod = 15.d0 + end if + if (mode .eq. 5 .and. TRperiod .eq. 60.d0) TRperiod = 7.5d0 ! FT4 + if (mode .eq. 144 .and. TRperiod .eq. 60.d0) TRperiod = 30.d0 ! MSK144 + + ! Per-mode ntol defaulting (mirrors WAV path lines 277–285). + if (mode .eq. 241 .or. mode .eq. 242) then + ntol = min(ntol, 100) + else if (mode .eq. 65 + 9 .and. .not. have_ntol) then + ntol = 20 + else if (mode .eq. 66 .and. .not. have_ntol) then + ntol = 10 + else + ntol = min(ntol, 1000) + end if + + ! Per-mode nexp_decode default (mirrors WAV path lines 287–291). + if (.not. nexp_decode_set) then + if (mode .eq. 240 .or. mode .eq. 241 .or. mode .eq. 242) then + nexp_decode = 3 * 256 ! FST4: single decode off, nb=0 + end if + end if + + if (mycall.eq.'b') mycall = ' ' + if (hiscall.eq.'b') then + hiscall = ' ' + hisgrid = ' ' + end if + allocate(shared_data) + call init_timer (trim(data_dir)//'/timer.out') + shared_data%id2 = 0 + + ! Common params first, then streaming-only fields. + args = cli_args_t( & + flow=flow, fsplit=fsplit, fhigh=fhigh, nrxfreq=nrxfreq, & + ndepth=ndepth, ntol=ntol, nQSOProg=nQSOProg, & + nexp_decode=nexp_decode, ncycles=ncycles, & + nft8rxfsens=nft8rxfsens, nmt=nmt, ndecoderstart=ndecoderstart, & + nsubmode=nsubmode, mycall=mycall, hiscall=hiscall, & + mygrid=mygrid, hisgrid=hisgrid, & + datetime='2026-Apr-25 00:00 ', & + tx9=tx9, multift8=.false., hidedupes=.false., & + lft8lowth=.true., lft8subpass=.true., & + lwidedxcsearch=lwidedxcsearch, have_ntol=have_ntol, & + nexp_decode_set=nexp_decode_set) + call init_default_params(shared_data%params, mode, TRperiod, args) + call init_streaming_extra_fields(shared_data%params, args) + + ! Streaming-side overrides post-init. + ! (mode=9 nfa=fsplit handled by init_default_params per-mode adjustment.) + ! (single-pass FT8 only in stream — already enforced via args.multift8=.false.) + + call jt9_stream(shared_data, mode, TRperiod) + else + call jt9a() !We're running under control of WSJT-X (shared memory) + end if go to 999 endif @@ -281,18 +377,20 @@ program jt9 do iarg = offset + 1, offset + remain call get_command_argument (iarg, optarg, arglen) infile = optarg(:arglen) - call wav%read (infile) + call wav%read (infile, wav_status, optarg) + if (wav_status /= 0) then + write(error_unit, '(A)') 'jt9: cannot read WAV file ' // trim(infile) // ': ' // trim(optarg) + stop 2 + end if nfsample=wav%audio_format%sample_rate - i1=index(infile,'.wav') - if(i1.lt.1) i1=index(infile,'.WAV') - if(infile(i1-5:i1-5).eq.'_') then - read(infile(i1-4:i1-1),*,err=1) nutc - else - read(infile(i1-6:i1-1),*,err=1) nutc - endif - go to 2 -1 nutc=0 -2 nsps=6912 + if (nfsample /= 12000 .and. .not. (mode == 4 .and. nfsample == 11025)) then + close(unit=wav%lun) + write(error_unit, '(A,I0,A)') 'jt9: unsupported ',nfsample, & + ' Hz WAV sample rate for the selected mode' + stop 2 + end if + call parse_wav_filename_nutc(infile, nutc) + nsps=6912 npts=TRperiod*12000.d0 kstep=nsps/2 k=0 @@ -303,18 +401,29 @@ program jt9 call timer('jt9 ',0) endif shared_data%id2=0 !??? Why is this necessary ??? + if(mode.eq.4) npts=52*nfsample if(mode.eq.5) npts=21*3456 if(mode.eq.66) npts=TRperiod*12000 - do iblk=1,npts/kstep - k=iblk*kstep + nblocks=npts/kstep + if(mode.eq.4) nblocks=(npts+kstep-1)/kstep + do iblk=1,nblocks + k0=(iblk-1)*kstep + k=min(iblk*kstep,npts) if(mode.eq.8 .and. k.gt.179712) exit call timer('read_wav',0) - read(unit=wav%lun,end=3) shared_data%id2(k-kstep+1:k) - go to 4 -3 call timer('read_wav',1) - print*,'EOF on input file ',trim(infile) - exit -4 call timer('read_wav',1) + call wav%read_samples(shared_data%id2(k0+1:k), samples_read, & + wav_status, optarg) + call timer('read_wav',1) + if (wav_status /= 0) then + close(unit=wav%lun) + write(error_unit, '(A)') 'jt9: cannot read WAV file ' // & + trim(infile) // ': ' // trim(optarg) + stop 2 + end if + if (samples_read == 0) then + print*,'EOF on input file ',trim(infile) + exit + end if nhsym=(k-2048)/kstep if(nhsym.ge.1 .and. nhsym.ne.nhsym0) then if(mode.eq.9 .or. mode.eq.74) then @@ -330,53 +439,38 @@ program jt9 if(nhsym.ge.181 .and. mode.ne.240 .and. mode.ne.241 .and. & mode.ne.242 .and. mode.ne.66) exit endif + if (samples_read < k-k0) then + print*,'EOF on input file ',trim(infile) + exit + end if enddo close(unit=wav%lun) - shared_data%params%nutc=nutc - shared_data%params%ndiskdat=.true. - shared_data%params%ntr=TRperiod - shared_data%params%nfqso=nrxfreq - shared_data%params%newdat=.true. - shared_data%params%npts8=74736 - shared_data%params%nfa=flow - shared_data%params%nfsplit=fsplit - shared_data%params%nfb=fhigh - shared_data%params%ntol=ntol - shared_data%params%kin=64800 - if(mode.eq.240) shared_data%params%kin=720000 !### 60 s periods ### - shared_data%params%nzhsym=nhsym - shared_data%params%ndepth=ndepth - shared_data%params%lft8apon=.true. - shared_data%params%ljt65apon=.true. - shared_data%params%napwid=75 - shared_data%params%dttol=3. - if(mode.eq.164 .and. nsubmode.lt.100) nsubmode=nsubmode+100 - shared_data%params%nagain=.false. - shared_data%params%nclearave=.false. - shared_data%params%lapcqonly=.false. - shared_data%params%naggressive=0 - shared_data%params%n2pass=2 - shared_data%params%nQSOprogress=nQSOProg - shared_data%params%nranera=6 !### ntrials=3000 - shared_data%params%nrobust=.false. - shared_data%params%nexp_decode=nexp_decode - shared_data%params%lmultift8=multift8 - shared_data%params%mycall=transfer(mycall,shared_data%params%mycall) - shared_data%params%mygrid=transfer(mygrid,shared_data%params%mygrid) - shared_data%params%hiscall=transfer(hiscall,shared_data%params%hiscall) - shared_data%params%hisgrid=transfer(hisgrid,shared_data%params%hisgrid) - if (tx9) then - shared_data%params%ntxmode=9 - else - shared_data%params%ntxmode=65 - end if - if (mode.eq.0) then - shared_data%params%nmode=65+9 - else - shared_data%params%nmode=mode - end if - shared_data%params%nsubmode=nsubmode + ! WAV-path-only mode adjustment (mode=164 with submode<100 bumps by 100). + ! Hoisted before init_default_params so the bumped value is threaded + ! through the args bundle. + if (mode.eq.164 .and. nsubmode.lt.100) nsubmode = nsubmode + 100 + + ! WAV mode initializes only fields historically set by this path. + args = cli_args_t( & + flow=flow, fsplit=fsplit, fhigh=fhigh, nrxfreq=nrxfreq, & + ndepth=ndepth, ntol=ntol, nQSOProg=nQSOProg, & + nexp_decode=nexp_decode, ncycles=ncycles, & + nft8rxfsens=nft8rxfsens, nmt=nmt, ndecoderstart=ndecoderstart, & + nsubmode=nsubmode, mycall=mycall, hiscall=hiscall, & + mygrid=mygrid, hisgrid=hisgrid, & + datetime='2013-Apr-16 15:13 ', & + tx9=tx9, multift8=multift8, hidedupes=hidedupes, & + lft8lowth=lft8lowth, lft8subpass=lft8subpass, & + lwidedxcsearch=lwidedxcsearch, have_ntol=have_ntol, & + nexp_decode_set=nexp_decode_set) + call init_default_params(shared_data%params, mode, TRperiod, args) + + ! WAV-path post-init overrides. + shared_data%params%nutc = nutc ! parsed from filename + shared_data%params%ndiskdat = .true. ! reading from disk + shared_data%params%nzhsym = nhsym ! per-period (matches former jt9.f90:486) + if (mode.eq.0) shared_data%params%nmode = 65 + 9 ! WAV-only mode=0 → JT65+JT9 if (multift8 .and. mode.eq.8) then shared_data%params%lft8subpass = .true. @@ -414,12 +508,9 @@ program jt9 shared_data%params%nsdecatt = 1 !print*,'lwidedxcsearch ',shared_data%params%lwidedxcsearch end if -!### temporary, for MAP65: - if(mode.eq.66 .and. TRperiod.eq.60) shared_data%params%emedelay=2.5 + ! emedelay (Q65 60s), datetime placeholder, and mode=9 nfa=fsplit + ! handled by init_default_params + apply_per_mode_policy above. - datetime="2013-Apr-16 15:13" !### Temp - shared_data%params%datetime=transfer(datetime,shared_data%params%datetime) - if(mode.eq.9 .and. fsplit.ne.2700) shared_data%params%nfa=fsplit nearly=50 if(mode.eq.8 .and. .not. shared_data%params%lmultift8) then ! "Early" decoding pass, FT8 only, when jt9 reads data from disk @@ -511,5 +602,36 @@ program jt9 endif call fftwf_cleanup_threads() call fftwf_cleanup() + if (allocated(shared_data)) deallocate(shared_data) + +contains + + subroutine require_integer(option, text, value) + character(len=*), intent(in) :: option, text + integer, intent(out) :: value + + logical :: ok + + call parse_integer(text, value, ok) + if (.not. ok) call invalid_option(option, text, 'must be an integer') + end subroutine require_integer + + subroutine require_real(option, text, value) + character(len=*), intent(in) :: option, text + real(kind=8), intent(out) :: value + + logical :: ok + + call parse_real(text, value, ok) + if (.not. ok) call invalid_option(option, text, 'must be a finite number') + end subroutine require_real + + subroutine invalid_option(option, text, reason) + character(len=*), intent(in) :: option, text, reason + + write(error_unit, '(A)') 'jt9: invalid value for -' // trim(option) // ': ' // & + trim(text) // ' (' // trim(reason) // ')' + stop 2 + end subroutine invalid_option end program jt9 diff --git a/lib/jt9_input_validation.f90 b/lib/jt9_input_validation.f90 new file mode 100644 index 00000000..333fb30b --- /dev/null +++ b/lib/jt9_input_validation.f90 @@ -0,0 +1,158 @@ +module jt9_input_validation + use, intrinsic :: ieee_arithmetic, only: ieee_is_finite + implicit none + + private + public :: parse_integer, parse_real, parse_wav_filename_nutc + +contains + + subroutine parse_integer(text, value, ok) + character(len=*), intent(in) :: text + integer, intent(out) :: value + logical, intent(out) :: ok + + integer :: ios + + value = 0 + if (.not. is_integer_token(text)) then + ok = .false. + return + end if + read(text, *, iostat=ios) value + ok = ios == 0 + end subroutine parse_integer + + subroutine parse_real(text, value, ok) + character(len=*), intent(in) :: text + real(kind=8), intent(out) :: value + logical, intent(out) :: ok + + integer :: ios + + value = 0.d0 + if (.not. is_real_token(text)) then + ok = .false. + return + end if + read(text, *, iostat=ios) value + ok = ios == 0 .and. ieee_is_finite(value) + end subroutine parse_real + + pure logical function is_integer_token(text) + character(len=*), intent(in) :: text + + integer :: first + + first = 1 + if (len(text) > 0) then + if (text(1:1) == '+' .or. text(1:1) == '-') first = 2 + end if + is_integer_token = first <= len(text) .and. & + verify(text(first:), '0123456789') == 0 + end function is_integer_token + + pure logical function is_real_token(text) + character(len=*), intent(in) :: text + + integer :: digits, i, length + + is_real_token = .false. + length = len(text) + if (length == 0) return + + i = 1 + if (text(i:i) == '+' .or. text(i:i) == '-') i = i + 1 + if (i > length) return + + digits = 0 + do while (i <= length) + if (text(i:i) < '0' .or. text(i:i) > '9') exit + digits = digits + 1 + i = i + 1 + end do + if (i <= length) then + if (text(i:i) == '.') then + i = i + 1 + do while (i <= length) + if (text(i:i) < '0' .or. text(i:i) > '9') exit + digits = digits + 1 + i = i + 1 + end do + end if + end if + if (digits == 0) return + + if (i <= length) then + if (text(i:i) /= 'e' .and. text(i:i) /= 'E') return + i = i + 1 + if (i <= length) then + if (text(i:i) == '+' .or. text(i:i) == '-') i = i + 1 + end if + if (i > length) return + digits = 0 + do while (i <= length) + if (text(i:i) < '0' .or. text(i:i) > '9') return + digits = digits + 1 + i = i + 1 + end do + if (digits == 0) return + end if + + is_real_token = i > length + end function is_real_token + + subroutine parse_wav_filename_nutc(filename, nutc) + character(len=*), intent(in) :: filename + integer, intent(out) :: nutc + + integer :: dot, ios, length + character(len=:), allocatable :: stem + + nutc = 0 + length = len_trim(filename) + if (length == 0) return + + dot = index(filename(:length), '.', back=.true.) + if (dot == 0) return + if (.not. is_wav_extension(filename(dot:length))) return + + stem = filename(:dot - 1) + if (len(stem) >= 6) then + if (all_digits(stem(len(stem) - 5:))) then + read(stem(len(stem) - 5:), *, iostat=ios) nutc + if (ios == 0) return + end if + end if + if (len(stem) >= 5) then + if (stem(len(stem) - 4:len(stem) - 4) == '_' .and. & + all_digits(stem(len(stem) - 3:))) then + read(stem(len(stem) - 3:), *, iostat=ios) nutc + if (ios == 0) return + end if + end if + nutc = 0 + end subroutine parse_wav_filename_nutc + + pure logical function is_wav_extension(extension) + character(len=*), intent(in) :: extension + + is_wav_extension = len(extension) == 4 .and. & + (extension == '.wav' .or. extension == '.WAV') + end function is_wav_extension + + pure logical function all_digits(text) + character(len=*), intent(in) :: text + + integer :: i + + all_digits = len(text) > 0 + do i = 1, len(text) + if (text(i:i) < '0' .or. text(i:i) > '9') then + all_digits = .false. + return + end if + end do + end function all_digits + +end module jt9_input_validation diff --git a/lib/jt9_params_init.f90 b/lib/jt9_params_init.f90 new file mode 100644 index 00000000..782a7e12 --- /dev/null +++ b/lib/jt9_params_init.f90 @@ -0,0 +1,241 @@ +! Shared params init — factored from WAV-path (jt9.f90:474-554), +! stream-mode dispatch arm (jt9.f90:298-388), and streaming_io.f90:130-190. +! +! Eliminates the structural drift surface that arose from hand-copying +! a baseline-init block into streaming_io.f90. Now both the WAV-decoder and +! streaming-decoder paths route through one source of truth. +! +! Scope discipline: +! - init_default_params sets ONLY fields the pre-refactor WAV path was +! setting (the "common" subset). This preserves WAV byte-identical +! behavior under run-golden-fixtures.sh — the regression gate. +! - init_streaming_extra_fields sets the additional fields the pre-refactor +! streaming dispatch arm (jt9.f90:298-388) set beyond the common set. +! Streaming callers do init_default_params THEN init_streaming_extra_fields. +! - The WAV multift8-only block at jt9.f90:519-554 stays inline (out of +! scope). It sets some of the same fields init_streaming_extra_fields +! sets, but with multift8-specific logic; not factored here. +! +! Public surface: +! init_default_params(params, mode, TRperiod, args) +! Common-subset init. Always called first. +! +! init_streaming_extra_fields(params, args) +! Extra fields needed by the streaming subprocess path. Streaming +! callers call this AFTER init_default_params. +! +! apply_per_mode_policy(params, mode, TRperiod) +! Per-mode ntol cap + Q65 60s emedelay. Called from init_default_params, +! and from streaming_apply's apply_configure_fields on mode/trperiod change. +! +! Per-mode invariants preserved (each documented inline at the policy site): +! - FST4/FST4W (mode 241/242): ntol = min(ntol, 100) +! - JT65+JT9 combined (mode 74): ntol hard = 20 unless -F supplied (have_ntol) +! - Q65 (mode 66): ntol hard = 10 unless -F supplied; emedelay = 2.5 when TRperiod = 60 +! - All other modes: ntol = min(ntol, 1000) +! - FST4 60s (mode 240): kin = 720000 (init-only; not in policy sub) +! - JT9 with explicit -S (mode 9 ∧ fsplit ≠ 2700): nfa = fsplit +! (init-only; not in policy sub since fsplit isn't in apply_configure_fields' +! scope today) + +module jt9_params_init + use, intrinsic :: iso_c_binding, only: c_int, c_short, c_float, c_char, c_bool + + include 'jt9com.f90' + + private + public :: init_default_params + public :: init_streaming_extra_fields + public :: apply_per_mode_policy + public :: cli_args_t + + ! CLI-arg bundle threaded through to the params init. Defaults match + ! jt9.f90's local-var defaults (lines 30-32) so a bare call (with all + ! args at default) produces the same shape as un-flagged jt9 invocation. + type :: cli_args_t + integer :: flow = 200 + integer :: fsplit = 2700 + integer :: fhigh = 4000 + integer :: nrxfreq = 1500 + integer :: ndepth = 1 + integer :: ntol = 1000 ! caller pre-clamps; per-mode policy applies on top + integer :: nQSOProg = 0 + integer :: nexp_decode = 0 + integer :: ncycles = 3 + integer :: nft8rxfsens = 3 + integer :: nmt = 0 + integer :: ndecoderstart = 3 + integer :: nsubmode = 0 + character(len=12) :: mycall = ' ' + character(len=12) :: hiscall = ' ' + character(len=6) :: mygrid = ' ' + character(len=6) :: hisgrid = ' ' + character(len=20) :: datetime = '2026-Apr-25 00:00 ' + logical :: tx9 = .false. + logical :: multift8 = .false. + logical :: hidedupes = .false. + logical :: lft8lowth = .true. + logical :: lft8subpass = .true. + logical :: lwidedxcsearch = .true. + logical :: have_ntol = .false. ! tracks whether -F was supplied + logical :: nexp_decode_set = .false. ! tracks whether --exp-decode was supplied + end type cli_args_t + +contains + + ! Common-subset init. Sets the fields the pre-refactor WAV path was + ! setting, plus the per-mode policy outcomes (ntol cap, emedelay, + ! kin mode=240 override, nfa mode=9-fsplit override). + ! + ! Caller-specific overrides happen AFTER the call: + ! - WAV path: nutc (filename), ndiskdat=.true., nzhsym=nhsym (per-period), + ! nmode=65+9 if mode=0 + ! - Streaming dispatch: ndiskdat=.false. (default; jt9_stream overrides + ! via init_streaming_extra_fields side-effect or its own override) + subroutine init_default_params(params, mode, TRperiod, args) + type(params_block), intent(out) :: params + integer, intent(in) :: mode + real(8), intent(in) :: TRperiod + type(cli_args_t), intent(in) :: args + + ! Common-subset structural defaults (preserves pre-refactor WAV scope). + params%nutc = 0 ! caller may overwrite (filename) + params%ndiskdat = .false. ! caller may overwrite + params%ntr = int(TRperiod) + params%nQSOProgress = args%nQSOProg + params%nfqso = args%nrxfreq + params%newdat = .true. + params%npts8 = 74736 + params%nfa = args%flow + params%nfsplit = args%fsplit + params%nfb = args%fhigh + params%ntol = args%ntol ! per-mode policy applies below + params%kin = 64800 ! mode=240 override below + params%nzhsym = 50 ! caller may overwrite per-period + params%nsubmode = args%nsubmode + params%nagain = .false. + params%ndepth = args%ndepth + params%lft8apon = .true. + params%lapcqonly = .false. + params%ljt65apon = .true. + params%napwid = 75 + if (args%tx9) then + params%ntxmode = 9 + else + params%ntxmode = 65 + end if + params%nmode = mode ! caller may overwrite (WAV mode=0 → 65+9) + params%nclearave = .false. + params%emedelay = 0.0 ! per-mode policy may override + params%dttol = 3. + params%n2pass = 2 + params%nranera = 6 + params%naggressive = 0 + params%nrobust = .false. + params%nexp_decode = args%nexp_decode + + params%datetime = transfer(args%datetime, params%datetime) + params%mycall = transfer(args%mycall, params%mycall) + params%mygrid = transfer(args%mygrid, params%mygrid) + params%hiscall = transfer(args%hiscall, params%hiscall) + params%hisgrid = transfer(args%hisgrid, params%hisgrid) + + params%lmultift8 = args%multift8 + + ! Per-mode init-only adjustments (NOT folded into apply_per_mode_policy + ! because they reference CLI args (fsplit) or are mode-specific to a + ! degree the post-configure policy doesn't need to revisit). + + ! FST4 60s period uses a larger sample window (jt9.f90:485 in WAV path). + if (mode .eq. 240) params%kin = 720000 + + ! JT9 with explicit -S: remap nfa to fsplit (jt9.f90:386, :560). + if (mode .eq. 9 .and. args%fsplit .ne. 2700) params%nfa = args%fsplit + + ! Init-time ntol cap (per-mode). Streaming-config-time ntol policy + ! lives in apply_configure_fields where it can branch on consumer-set vs + ! mode-default (see streaming_apply.f90). + if (mode .eq. 241 .or. mode .eq. 242) then + params%ntol = min(args%ntol, 100) ! FST4/FST4W + else if (mode .eq. 65 + 9 .and. .not. args%have_ntol) then + params%ntol = 20 ! JT65+JT9 hard (unless -F given) + else if (mode .eq. 66 .and. .not. args%have_ntol) then + params%ntol = 10 ! Q65 hard (unless -F given) + else + params%ntol = min(args%ntol, 1000) ! FT8/FT4/etc + end if + + ! Q65 60s emedelay (the only piece left in apply_per_mode_policy + ! — ntol moved out). + call apply_per_mode_policy(params, mode, TRperiod) + end subroutine init_default_params + + ! Streaming-only extras. Mirrors fields the pre-refactor stream-dispatch + ! arm (jt9.f90:298-388) set beyond the common set. NOT called by WAV + ! callers — those leave these fields at their bind(C) default state + ! (matching pre-refactor WAV behavior; the multift8-only block in WAV + ! will set a subset of these for multift8 mode). + subroutine init_streaming_extra_fields(params, args) + type(params_block), intent(inout) :: params + type(cli_args_t), intent(in) :: args + + ! Tx-side companion to nfqso (WAV path leaves this uninit; streaming sets it). + params%nftx = args%nrxfreq + + params%minw = 1 + params%minsync = 0 + params%nlist = 0 + params%max_drift = 0 + params%b_even_seq = .false. + params%b_superfox = .false. + params%lft8lowth = args%lft8lowth + params%lft8subpass = args%lft8subpass + params%lwidedxcsearch = args%lwidedxcsearch + params%lhound = .false. + params%lcommonft8b = .true. + params%lhideft8dupes = args%hidedupes + params%nft8cycles = args%ncycles + params%nft8rxfsens = args%nft8rxfsens + params%nmt = args%nmt + params%ndecoderstart = args%ndecoderstart + params%ncandthin = 100 + params%ndtcenter = 0 + params%nharmonicsdepth = 0 + params%nprepass = 4 + params%nsdecatt = 1 + params%nlasttx = 0 + params%ndelay = 0 + params%nsecbandchanged = 0 + params%nagainfil = .false. + params%nstophint = .false. + params%nhint = .false. + params%fmaskact = .false. + params%ltxing = .false. + params%lmycallstd = .true. + params%lhiscallstd = .true. + params%lapmyc = .false. + params%lmodechanged = .false. + params%lbandchanged = .false. + params%lenabledxcsearch= .true. + params%lmultinst = .false. + params%lskiptx1 = .false. + end subroutine init_streaming_extra_fields + + ! Per-mode policy that runs both at init AND on configure-frame mode/trperiod + ! changes. Currently only Q65 60s emedelay (ntol was moved out since the + ! cap-vs-restore semantics differ between init and config-time). + ! Idempotent. + subroutine apply_per_mode_policy(params, mode, TRperiod) + type(params_block), intent(inout) :: params + integer, intent(in) :: mode + real(8), intent(in) :: TRperiod + + ! Q65 60s mode requires 2.5s eme-delay; other modes 0.0. + if (mode .eq. 66 .and. TRperiod .eq. 60.d0) then + params%emedelay = 2.5 + else + params%emedelay = 0.0 + end if + end subroutine apply_per_mode_policy + +end module jt9_params_init diff --git a/lib/jt9_version.c b/lib/jt9_version.c new file mode 100644 index 00000000..daa7a248 --- /dev/null +++ b/lib/jt9_version.c @@ -0,0 +1,20 @@ +#include + +#include "scs_version.h" +#include "wsjtx_config.h" + +#ifndef JT9_PROGRAM_NAME +#define JT9_PROGRAM_NAME "jt9" +#endif + +void jt9_print_version(void) +{ + printf("%s %d.%d.%d%s", JT9_PROGRAM_NAME, + PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR, PROJECT_VERSION_PATCH, + BUILD_TYPE_REVISION); + if (SCS_VERSION_STR[0] != '\0') { + printf(" (revision %s)\n", SCS_VERSION_STR); + } else { + puts(" (revision unavailable)"); + } +} diff --git a/lib/jt9a.f90 b/lib/jt9a.f90 index f45661c7..9daa8272 100644 --- a/lib/jt9a.f90 +++ b/lib/jt9a.f90 @@ -1,5 +1,12 @@ subroutine jt9a() - use, intrinsic :: iso_c_binding, only: c_f_pointer, c_null_char, c_bool + use, intrinsic :: iso_c_binding, only: c_f_pointer, c_null_char, c_bool, c_sizeof, c_int + use decoder_ipc_atomic, only: decoder_ipc_control_try_claim, & + decoder_ipc_control_finish, decoder_ipc_progress_bind, & + decoder_ipc_progress_unbind, DECODER_IPC_CLAIM_INVALID, & + DECODER_IPC_CLAIM_INCOMPATIBLE, DECODER_IPC_CLAIM_NONE, & + DECODER_IPC_CLAIMED, DECODER_IPC_CLAIM_SHUTDOWN + use decode_completion_module, only: decode_completion_result, & + reset_decode_completion, set_decode_completion, write_decode_completion use prog_args use timer_module, only: timer use timer_impl, only: init_timer !, limtrace @@ -10,10 +17,13 @@ subroutine jt9a() include 'jt9com.f90' integer*2 id2a(180000) + save id2a !Keep this big array off the stack ! Multiple instances: - type(dec_data), pointer, volatile :: shared_data !also makes target volatile + type(shared_dec_data), pointer, volatile :: shared_memory type(params_block) :: local_params logical(c_bool) :: ok + integer(c_int) :: active_generation, claim_result + type(decode_completion_result) :: completion call init_timer (trim(data_dir)//'/timer.out') ! open(23,file=trim(data_dir)//'/CALL3.TXT',status='unknown') @@ -25,49 +35,61 @@ subroutine jt9a() ok=shmem_attach() if(.not.ok) call abort msdelay=10 - call c_f_pointer(shmem_address(),shared_data) + call c_f_pointer(shmem_address(),shared_memory) + nbytes=shmem_size() + if(nbytes.lt.c_sizeof(shared_memory)) then + ok=shmem_detach() + print*,'jt9a: Incompatible shared-memory layout.' + go to 999 + endif -! Terminate if ipc(2) is 999 -10 ok=shmem_lock() - if(.not.ok) call abort - if(shared_data%ipc(2).eq.999.0) then - ok=shmem_unlock() + call decoder_ipc_progress_bind(shared_memory%control%generation, & + shared_memory%control%state, shared_memory%control%version, & + shared_memory%control%progress) + + call reset_decode_completion(completion) + +10 claim_result=decoder_ipc_control_try_claim( & + shared_memory%control%generation, shared_memory%control%state, & + shared_memory%control%version, active_generation) + if(claim_result.eq.DECODER_IPC_CLAIM_SHUTDOWN) then ok=shmem_detach() go to 999 - endif! Wait here until GUI has set ipc(2) to 1 - if(shared_data%ipc(2).ne.1) then - ok=shmem_unlock() - if(.not.ok) call abort - call sleep_msec(msdelay) - go to 10 endif - shared_data%ipc(2)=0 - nbytes=shmem_size() - if(nbytes.le.0) then - ok=shmem_unlock() + if(claim_result.eq.DECODER_IPC_CLAIM_INCOMPATIBLE) then ok=shmem_detach() - print*,'jt9a: Shared memory does not exist.' - print*,"Must start 'jt9 -s ' from within WSJT-X." + print*,'jt9a: Incompatible shared-memory protocol version.' go to 999 endif - local_params=shared_data%params !save a copy because wsjtx carries on accessing - ok=shmem_unlock() - if(.not.ok) call abort + if(claim_result.eq.DECODER_IPC_CLAIM_INVALID) then + ok=shmem_detach() + print*,'jt9a: Invalid decoder request generation.' + go to 999 + endif + if(claim_result.eq.DECODER_IPC_CLAIM_NONE) then + call sleep_msec(msdelay) + go to 10 + endif + if(claim_result.ne.DECODER_IPC_CLAIMED) call abort + write(*,'(a,i0)') ' gen=',active_generation call flush(6) + local_params=shared_memory%payload%params call timer('decoder ',0) if(local_params%nmode.eq.8 .and. local_params%ndiskdat .and. & .not. local_params%nagain .and. .not. local_params%lmultift8) then ! Early decoding pass, FT8 only, when wsjtx reads from disk nearly=41 local_params%nzhsym=nearly - id2a(1:nearly*3456)=shared_data%id2(1:nearly*3456) + id2a(1:nearly*3456)=shared_memory%payload%id2(1:nearly*3456) id2a(nearly*3456+1:)=0 - call multimode_decoder(shared_data%ss,id2a,local_params,12000) + call multimode_decoder_core(shared_memory%payload%ss,id2a,local_params, & + 12000,completion,active_generation) nearly=47 local_params%nzhsym=nearly - id2a(1:nearly*3456)=shared_data%id2(1:nearly*3456) + id2a(1:nearly*3456)=shared_memory%payload%id2(1:nearly*3456) id2a(nearly*3456+1:)=0 - call multimode_decoder(shared_data%ss,id2a,local_params,12000) + call multimode_decoder_core(shared_memory%payload%ss,id2a,local_params, & + 12000,completion,active_generation) local_params%nzhsym=50 endif @@ -79,59 +101,63 @@ subroutine jt9a() nearly=41 local_params%lmultift8=.false. local_params%nzhsym=nearly - id2a(1:nearly*3456)=shared_data%id2(1:nearly*3456) + id2a(1:nearly*3456)=shared_memory%payload%id2(1:nearly*3456) id2a(nearly*3456+1:)=0 - call multimode_decoder(shared_data%ss,id2a,local_params,12000) + call multimode_decoder_core(shared_memory%payload%ss,id2a,local_params, & + 12000,completion,active_generation) if(local_params%ndecoderstart.lt.2) then nearly=46 local_params%lmultift8=.false. local_params%nzhsym=nearly - id2a(1:nearly*3456)=shared_data%id2(1:nearly*3456) + id2a(1:nearly*3456)=shared_memory%payload%id2(1:nearly*3456) id2a(nearly*3456+1:)=0 - call multimode_decoder(shared_data%ss,id2a,local_params,12000) + call multimode_decoder_core(shared_memory%payload%ss,id2a,local_params, & + 12000,completion,active_generation) endif if(local_params%ndecoderstart.eq.0) nearly=49 if(local_params%ndecoderstart.eq.1) nearly=50 local_params%lmultift8=.true. - shared_data%params%nzhsym=nearly - id2a(1:nearly*3456)=shared_data%id2(1:nearly*3456) + shared_memory%payload%params%nzhsym=nearly + id2a(1:nearly*3456)=shared_memory%payload%id2(1:nearly*3456) id2a(nearly*3456+1:)=0 - dd(1:nearly*3456)=shared_data%id2(1:nearly*3456) + dd(1:nearly*3456)=shared_memory%payload%id2(1:nearly*3456) dd(nearly*3456+1:)=0 - dd8(1:nearly*3456)=shared_data%id2(1:nearly*3456) + dd8(1:nearly*3456)=shared_memory%payload%id2(1:nearly*3456) dd8(nearly*3456+1:)=0 - if(local_params%ndecoderstart.eq.0) shared_data%params%nzhsym=49 - if(local_params%ndecoderstart.eq.1) shared_data%params%nzhsym=50 + if(local_params%ndecoderstart.eq.0) shared_memory%payload%params%nzhsym=49 + if(local_params%ndecoderstart.eq.1) shared_memory%payload%params%nzhsym=50 else nearly=50 if(local_params%ndecoderstart.eq.2) nearly=48 if(local_params%ndecoderstart.eq.3) nearly=49 if(local_params%ndecoderstart.eq.4) nearly=50 - shared_data%params%nzhsym=nearly - id2a(1:nearly*3456)=shared_data%id2(1:nearly*3456) + shared_memory%payload%params%nzhsym=nearly + id2a(1:nearly*3456)=shared_memory%payload%id2(1:nearly*3456) id2a(nearly*3456+1:)=0 - dd(1:nearly*3456)=shared_data%id2(1:nearly*3456) + dd(1:nearly*3456)=shared_memory%payload%id2(1:nearly*3456) dd(nearly*3456+1:)=0 - dd8(1:nearly*3456)=shared_data%id2(1:nearly*3456) + dd8(1:nearly*3456)=shared_memory%payload%id2(1:nearly*3456) dd8(nearly*3456+1:)=0 - if(local_params%ndecoderstart.eq.2) shared_data%params%nzhsym=48 - if(local_params%ndecoderstart.eq.3) shared_data%params%nzhsym=49 - if(local_params%ndecoderstart.eq.4) shared_data%params%nzhsym=50 + if(local_params%ndecoderstart.eq.2) shared_memory%payload%params%nzhsym=48 + if(local_params%ndecoderstart.eq.3) shared_memory%payload%params%nzhsym=49 + if(local_params%ndecoderstart.eq.4) shared_memory%payload%params%nzhsym=50 endif elseif (local_params%nmode.eq.8 .and. local_params%lmultift8 .and. .not. & local_params%ndiskdat) then - npts1=180000 - dd(1:npts1)=shared_data%id2(1:npts1) + npts1=min(180000,local_params%nzhsym*3456) + dd(1:npts1)=shared_memory%payload%id2(1:npts1) + dd(npts1+1:)=0 rms=sum(abs(dd(1:10))) + sum(abs(dd(76001:76010))) + sum(abs(dd(151670:151680))) dd8(1:npts1)=dd(1:npts1) + dd8(npts1+1:)=0 !### WHY WAS THIS STUFF HERE ??? ### ! if(rms.gt.0.001) then -! dd(1:npts1)=shared_data%dd2(1:npts1) +! dd(1:npts1)=shared_memory%payload%dd2(1:npts1) ! dd8(1:npts1)=dd(1:npts1) !print *,'win7',rms ! else ! workaround for zero data values of dd2 array under WinXP -! dd(1:npts1)=shared_data%id2(1:npts1) +! dd(1:npts1)=shared_memory%payload%id2(1:npts1) ! dd8(1:npts1)=dd(1:npts1) !print *, 'winxp',rms ! endif @@ -141,30 +167,30 @@ subroutine jt9a() if(local_params%nmode .eq. 144) then ! MSK144 - call decode_msk144(shared_data%id2, shared_data%params, data_dir) + call decode_msk144_core(shared_memory%payload%id2, local_params, data_dir, & + completion) else ! Normal decoding pass - call multimode_decoder(shared_data%ss,shared_data%id2,local_params,12000) + call multimode_decoder_core(shared_memory%payload%ss, & + shared_memory%payload%id2,local_params,12000,completion,active_generation) endif call timer('decoder ',1) -!print*,time, ' jt9a before final loop which waits for ipc(3) ==1' !ft8md -! Wait here until GUI routine decodeDone() has set ipc(3) to 1 -100 ok=shmem_lock() - if(.not.ok) call abort - if(shared_data%ipc(3).ne.1) then - ok=shmem_unlock() - if(.not.ok) call abort - call sleep_msec(msdelay) - go to 100 + if(.not.completion%available) then + call set_decode_completion(completion,0,0,0) + endif + claim_result=decoder_ipc_control_finish(shared_memory%control%generation, & + shared_memory%control%state, shared_memory%control%version, & + active_generation) + if(claim_result.ne.0) then + call write_decode_completion(completion,active_generation) + call flush(6) endif - shared_data%ipc(3)=0 - ok=shmem_unlock() - if(.not.ok) call abort go to 10 -999 call timer('decoder ',101) +999 call decoder_ipc_progress_unbind() + call timer('decoder ',101) return end subroutine jt9a diff --git a/lib/jt9a_stub.f90 b/lib/jt9a_stub.f90 new file mode 100644 index 00000000..ca06055f --- /dev/null +++ b/lib/jt9a_stub.f90 @@ -0,0 +1,12 @@ +! Headless stub for jt9a(): the GUI shared-memory worker loop (lib/jt9a.f90) +! is excluded from headless builds so jt9 links zero Qt (the real jt9a +! depends on QSharedMemory). The headless jt9 is driven by `--stream` +! or a WAV file; the GUI-worker entry is unreachable in normal use. If reached +! (bare `jt9` with no --stream and no input file), fail clean with a diagnostic +! instead of attaching shared memory (which the real jt9a aborts on). +subroutine jt9a() + use, intrinsic :: iso_fortran_env, only: error_unit + write(error_unit,'(a)') 'jt9: GUI shared-memory worker mode is not available '// & + 'in the headless build. Use `jt9 --stream` or `jt9 `.' + stop 2 +end subroutine jt9a diff --git a/lib/jt9com.f90 b/lib/jt9com.f90 index dc955479..fc0577a2 100644 --- a/lib/jt9com.f90 +++ b/lib/jt9com.f90 @@ -1,14 +1,28 @@ use, intrinsic :: iso_c_binding, only: c_int, c_short, c_float, c_char, c_bool include 'constants.f90' + integer(c_int), parameter :: DECODER_IPC_VERSION = 2 + integer(c_int), parameter :: DECODER_IPC_IDLE = 0 + integer(c_int), parameter :: DECODER_IPC_READY = 1 + integer(c_int), parameter :: DECODER_IPC_DECODING = 2 + integer(c_int), parameter :: DECODER_IPC_COMPLETE = 3 + integer(c_int), parameter :: DECODER_IPC_SHUTDOWN = 999 + ! ! these structures must be kept in sync with ../commons.h ! + type, bind(C) :: decoder_ipc_control + integer(c_int) :: generation + integer(c_int) :: state + integer(c_int) :: version + integer(c_int) :: progress + end type decoder_ipc_control + type, bind(C) :: params_block integer(c_int) :: nutc logical(c_bool) :: ndiskdat integer(c_int) :: ntr - integer(c_int) :: nQSOProgress ! See MainWindow::m_QSOProgress for values + integer(c_int) :: nQSOProgress ! Values are defined by ../QsoProgress.hpp integer(c_int) :: nfqso integer(c_int) :: nftx logical(c_bool) :: newdat @@ -92,10 +106,14 @@ end type params_block type, bind(C) :: dec_data - integer(c_int) :: ipc(3) real(c_float) :: ss(184,NSMAX) real(c_float) :: savg(NSMAX) real(c_float) :: sred(5760) integer(c_short) :: id2(NMAX) type(params_block) :: params end type dec_data + + type, bind(C) :: shared_dec_data + type(decoder_ipc_control) :: control + type(dec_data) :: payload + end type shared_dec_data diff --git a/lib/jt9sim.f90 b/lib/jt9sim.f90 index e195b40b..04f3f11a 100644 --- a/lib/jt9sim.f90 +++ b/lib/jt9sim.f90 @@ -87,7 +87,7 @@ program jt9sim imin=mod(nmin,60) write(fname,1002) ihr,imin !Create output filename 1002 format('000000_',2i2.2) - open(10,file=fname//'.wav',access='stream',status='unknown') + open(10,file=fname//'.wav',access='stream',status='replace') if(snrdb.lt.90) then do i=1,npts diff --git a/lib/jtty/JTTY Messages.mc b/lib/jtty/JTTY Messages.mc new file mode 100644 index 00000000..7b0b91ea --- /dev/null +++ b/lib/jtty/JTTY Messages.mc @@ -0,0 +1,44 @@ +# +# Digital Function Key File Example for JTTY use +# +# See the discussion in the accompanying jtty_n1mm_integration.md file +# The leading [[JTTY:ACTION]] marker opts into native Call8/STRUCT30 encoding. +# Untagged N1MM text uses automatic packing after exchange-profile normalization. +# +# S&P F1 calls CQ and automatically places the program in RUN Mode +# F2 F3 F4 F5 use "!" macro for his callsign +# Exchange actions use the active JTTY profile; do not hardcode 599. +# Run F11 remains spare until N1MM call-stack TXTEXT ordering is validated. +# +################### +# RUN Messages +################### +F1 Run CQ,{TX}[[JTTY:CQ]]{MYCALL}{RX} +F2 Run Exch,{TX}[[JTTY:CALL_EXCH]]! {EXCH}{RX} +F3 Run TU,{TX}[[JTTY:CALL_TU_CQ]]! {MYCALL}{RX} +F4 {MYCALL},{TX}[[JTTY:MYCALL]]{MYCALL}{RX} +F5 His Call,{TX}[[JTTY:HISCALL]]!{RX} +F6 NR?,{TX}[[JTTY:CONTROL]]NR?{RX} +F7 Spare, +F8 Agn?,{TX}[[JTTY:CONTROL]]AGN?{RX} +F9 Spare, +F10 Spare, +F11 Spare, +F12 Wipe,{WIPE} +# +################### +# S&P Messages +################### +# "&" doubled, displays one "&" in the button label +F1 S&&P CQ,{TX}[[JTTY:CQ]]{MYCALL}{RX} +F2 S&&P Exch,{TX}[[JTTY:CALL_EXCH]]! {EXCH}{RX} +F3 S&&P TU,{TX}[[JTTY:CALL_TU_MY]]! {MYCALL}{RX} +F4 S&&P Call Him,{TX}[[JTTY:CALL_MY]]! {MYCALL}{RX} +F5 His Call,{TX}[[JTTY:HISCALL]]!{RX} +F6 {MYCALL},{TX}[[JTTY:MYCALL]]{MYCALL}{RX} +F7 My Exch,{TX}[[JTTY:EXCH]]{EXCH}{RX} +F8 Agn?,{TX}[[JTTY:CONTROL]]AGN?{RX} +F9 Spare, +F10 Spare, +F11 Spare, +F12 Wipe,{WIPE} diff --git a/lib/jtty/ana64a.f90 b/lib/jtty/ana64a.f90 new file mode 100644 index 00000000..fe7c7fb8 --- /dev/null +++ b/lib/jtty/ana64a.f90 @@ -0,0 +1,19 @@ +subroutine ana64a(iwave,npts,c0,nfft1) + implicit none + integer*2, intent(in) :: iwave(npts) !Raw data at 12000 Hz + integer, intent(in) :: npts, nfft1 + integer :: nfft2 + real :: fac + complex, intent(out) :: c0(0:nfft1-1) + + nfft2=nfft1/2 + fac=2.0/(32767.0*NFFT1) + c0(0:npts-1)=fac*iwave(1:npts) + c0(npts:)=0. + call four2a(c0,NFFT1,1,-1,1) !Forward c2c FFT + c0(nfft2/2+1:nfft2-1)=0. !Set negative freqs to 0. + c0(0)=0.5*c0(0) + call four2a(c0,nfft2,1,1,1) !Inverse c2c FFT; c0 is the analytic sig + c0(npts:)=0. + return +end subroutine ana64a diff --git a/lib/jtty/c_funcs.f90 b/lib/jtty/c_funcs.f90 new file mode 100644 index 00000000..3c21cf16 --- /dev/null +++ b/lib/jtty/c_funcs.f90 @@ -0,0 +1,13 @@ +MODULE c_funcs + + USE, INTRINSIC :: ISO_C_BINDING + IMPLICIT NONE + + INTERFACE + ! Use BIND(C, name="putc") to link to the C library function + FUNCTION c_putc(character) BIND(C, name="putchar") + INTEGER(C_INT) :: c_putc + END FUNCTION c_putc + END INTERFACE + + END MODULE C_Funcs diff --git a/lib/jtty/cdatetime.f90 b/lib/jtty/cdatetime.f90 new file mode 100644 index 00000000..33deaf30 --- /dev/null +++ b/lib/jtty/cdatetime.f90 @@ -0,0 +1,6 @@ +character*17 function cdatetime() + character cdate*8,ctime*10 + call date_and_time(cdate,ctime) + cdatetime=cdate(3:8)//'_'//ctime + return +end function cdatetime diff --git a/lib/jtty/decodes.txt b/lib/jtty/decodes.txt new file mode 100644 index 00000000..ed82f996 --- /dev/null +++ b/lib/jtty/decodes.txt @@ -0,0 +1,463 @@ + 0 1 1 1 F 1501.2 0.264 1.536 -11 ~~~~~ + 0 2 2 2 F 1501.7 0.101 15.789 0 CQ K1JT CQ + 0 3 3 3 F 1502.2 0.315 24.483 6 K1JT + 0 4 3 3 T 1502.2 0.313 26.177 5 599 0004~ + 0 5 4 4 F 1502.2 0.202 30.730 8 AA5AU + 0 6 5 5 F 1502.2 0.061 73.413 4 AA5AU + 0 7 6 6 F 1502.2 0.352 84.728 7 AA5AU + 0 8 7 7 F 1502.2 0.259 109.227 5 AA5AU + 0 9 8 8 F 1518.3 0.271 135.527 -8 CQ W1UE CQ + 0 10 9 9 F 1502.2 0.169 151.113 4 ONLY~ + 0 11 9 9 T 1502.2 0.168 152.808 12 DECOD + 0 12 9 9 T 1502.2 0.168 154.504 10 ED~YO + 0 13 9 9 T 1502.2 0.169 156.201 16 UR~FI + 0 14 9 9 T 1502.2 0.168 157.896 8 RST~C + 0 15 9 9 T 1502.2 0.167 159.591 14 Q~~~~ + 0 16 10 10 F 1502.2 0.157 172.301 13 DID~N + 0 17 10 10 T 1502.2 0.156 173.996 14 OT~DE + 0 18 10 10 T 1502.2 0.159 175.695 1 CODE~ + + 0 1 1 1 F 1515.4 0.173 8.229 -7 CQ W1UE CQ + 0 2 2 2 F 1502.2 0.347 16.035 14 NO~DE + 0 3 2 2 T 1502.2 0.347 17.731 13 CODE~ + 14 4 3 3 F 2705.6 0.380 48.716 -14 + 0 5 4 4 F 1502.2 0.117 60.325 2 CQ AA5AU CQ + 0 6 5 5 F 1517.9 0.199 65.919 -11 IS~TH + 0 7 5 5 T 1515.4 0.199 67.615 -7 IS~DE + 0 8 5 5 T 1515.8 0.199 69.311 -8 CODIN + 0 9 6 6 F 1502.2 0.392 74.592 7 YES~~ + 0 10 7 7 F 1515.8 0.163 84.539 -9 CQ W1UE CQ + 0 11 8 8 F 1502.7 0.155 92.587 5 AA5AU + 0 12 2 8 T 1502.2 0.346 102.530 12 W1UE + 0 13 2 8 T 1502.2 0.345 104.225 13 599 0004~ + 0 14 9 9 F 1518.3 0.220 118.940 -11 599 0008~ + 0 15 10 10 F 1502.2 0.203 124.011 12 TU NOW W1UE + 0 16 10 10 T 1502.7 0.203 125.707 8 599 0004~ + 0 17 11 11 F 1516.8 0.254 128.726 -9 TU W1UE CQ + + 0 1 1 1 F 1514.3 0.357 30.037 -10 CQ W1UE CQ + 0 2 2 2 F 1502.7 0.227 35.419 1 AA5AU + 0 3 3 3 F 1516.8 0.186 39.194 -9 CQ W1UE CQ + 0 4 4 4 F 1502.7 0.191 47.255 7 AGN?~ + 0 5 5 5 F 1502.2 0.405 55.525 -13 AGN?~ + 0 6 6 6 F 1514.9 0.196 70.580 -9 AA5AU + 0 7 7 7 F 1502.7 0.017 79.305 11 599 0005~ + 0 8 8 8 F 1502.7 0.321 97.841 12 I~HAV + 0 9 8 8 T 1502.2 0.320 99.536 14 E~STR + 0 10 8 8 T 1502.7 0.319 101.231 10 ONG~S + 0 11 8 8 T 1502.7 0.320 102.928 12 SB~QR + 0 12 8 8 T 1502.2 0.319 104.623 12 M~~~~ + 0 13 9 9 F 1514.8 0.123 124.355 -7 R~IT~ + 0 14 9 9 T 1517.4 0.127 126.055 -11 BUT~N + 0 15 9 9 T 1515.8 0.128 127.752 -6 OT~ST + 0 16 10 10 F 1502.7 0.159 138.807 -3 NOT~B + 0 17 10 10 T 1502.7 0.160 140.504 15 OTHER + 0 18 10 10 T 1502.7 0.160 142.200 16 NING~ + 0 19 10 10 T 1502.7 0.160 143.896 16 DECOD + 0 20 10 10 T 1502.7 0.161 145.593 15 E~NOW + 0 21 11 11 F 1515.4 0.267 152.059 -11 Y~YOU + 0 22 11 11 T 1517.8 0.266 153.754 -10 ~CAN' + 0 23 11 11 T 1514.8 0.267 155.451 -12 T~COP + 0 24 12 12 F 1502.7 0.283 161.403 10 NOT~S + 0 25 12 12 T 1502.7 0.281 163.097 1 URE~~ + 0 26 13 13 F 1519.3 0.129 168.033 -10 CQ W1UE CQ + + 0 1 1 1 F 1517.8 0.175 9.927 -11 W1UE + 0 2 2 2 F 1501.7 0.358 17.742 6 AA5AU + 0 3 2 2 T 1501.7 0.357 19.437 14 599 0001~ + 0 4 3 3 F 1502.7 0.415 25.855 14 599 0005~ + 0 5 4 4 F 1497.4 0.000 25.864 -10 599 0005~ + 0 6 5 5 F 1501.7 0.125 37.013 2 TU WV4P CQ + 0 7 6 6 F 1502.2 0.215 45.583 4 U~QTC + 0 8 6 6 T 1501.7 0.214 47.278 10 ~FOR~ + 0 9 6 6 T 1501.7 0.214 48.974 16 ME~?~ + 0 10 7 7 F 1501.7 0.107 76.427 12 CQ WV4P CQ + 0 11 8 8 F 1515.8 0.404 80.540 -11 W1UE + 0 12 9 9 F 1501.7 0.026 86.098 3 CQ WV4P CQ + 0 13 2 9 T 1501.7 0.359 100.423 1 CQ WV4P CQ + 0 14 10 10 F 1517.9 0.069 104.797 -13 W1UE + 0 15 11 11 F 1517.3 0.267 116.867 -10 WV4P + 0 16 11 11 T 1516.8 0.264 118.560 -7 W1UE~ + 0 17 12 12 F 1502.2 0.178 125.258 2 ~~~~~ + 0 18 13 13 F 1516.8 0.296 134.704 -13 CODE~ + 0 19 14 14 F 1502.7 0.101 141.717 5 CQ AA5AU CQ + 0 20 5 14 T 1502.2 0.121 144.705 1 YOU~Q + 0 21 5 14 T 1502.2 0.121 146.401 15 TC~FO + 0 22 5 14 T 1502.2 0.121 148.097 16 R~ME~ + 0 23 5 14 T 1502.2 0.121 149.793 16 ?~~~~ + 0 24 15 15 F 1502.7 0.086 165.022 15 CQ AA5AU CQ + 0 25 16 16 F 1515.8 0.393 169.993 -7 W1UE + + 0 1 1 1 F 1517.8 0.164 21.364 -11 BE~BA + 0 2 1 1 T 1513.9 0.162 23.058 -9 CK~IN + 0 3 1 1 T 1517.8 0.164 26.452 -11 NUTE~ + 0 4 2 2 F 1502.2 0.067 39.075 14 AWESO + 0 5 2 2 T 1502.2 0.066 40.770 15 ME~ME + 0 6 2 2 T 1502.2 0.066 42.466 15 ~TOO~ + 0 7 2 2 T 1502.2 0.066 44.162 16 !~~~~ + 0 8 3 3 F 1502.7 0.377 52.529 8 73~AA + 0 9 3 3 T 1503.2 0.377 54.225 14 5AU~~ + 0 10 2 3 T 1503.2 0.068 102.676 14 TU AA5AU CQ + 0 11 4 4 F 1516.8 0.157 112.093 -11 W1UE + 0 12 5 5 F 1503.2 0.144 118.440 1 W1UE + 0 13 5 5 T 1503.2 0.144 120.136 13 599 0007~ + 0 14 6 6 F 1515.3 0.339 125.419 -11 599 010~~ + 0 15 7 7 F 1503.2 0.351 128.823 16 TU AA5AU CQ + 0 16 8 8 F 1503.2 0.262 143.150 4 AA5AU + + 0 1 1 1 F 1515.9 0.215 7.847 -12 CQ W1UE CQ + 0 2 2 2 F 1503.2 0.353 17.737 16 AA5AU + 0 3 3 3 F 1503.2 0.064 45.432 17 AGN?~ + 0 4 4 4 F 1503.2 0.321 55.441 16 AGN?~ + 0 5 5 5 F 1503.2 0.315 76.211 4 NO~DE + 0 6 5 5 T 1503.2 0.315 77.907 15 CODE~ + 0 7 5 5 T 1503.2 0.315 79.603 16 QRX~W + 0 8 5 5 T 1503.2 0.315 81.299 16 ILL~R + 0 9 5 5 T 1503.2 0.315 82.995 15 ESTAR + 0 10 5 5 T 1503.2 0.315 84.691 16 T~~~~ + 0 11 6 6 F 1503.2 0.161 135.417 14 CQ AA5AU CQ + 0 12 7 7 F 1515.3 0.334 149.158 -11 W1UE + 0 13 8 8 F 1503.2 0.020 156.900 16 W1UE + 0 14 8 8 T 1503.2 0.020 158.596 16 599 0008~ + 0 15 9 9 F 1516.8 0.240 165.176 -10 599 010~~ + 0 16 10 10 F 1503.2 0.190 172.334 5 TU AA5AU CQ + + 0 1 1 1 F 1503.2 0.133 3.101 8 AA5AU + 0 2 2 2 F 1514.8 0.093 11.965 -11 599 011~~ + 0 3 3 3 F 1503.2 0.362 15.626 15 W1UE + 0 4 3 3 T 1503.7 0.361 17.321 16 599 0009~ + 0 5 4 4 F 1517.4 0.273 21.897 -12 TU W1UE CQ + 0 6 5 5 F 1517.4 0.019 30.971 -13 CQ W1UE CQ + 0 7 6 6 F 1515.8 0.071 45.439 -10 CQ W1UE CQ + 0 8 7 7 F 1503.7 0.343 63.943 16 WHEN~ + 0 9 7 7 T 1503.7 0.343 65.639 16 I~STO + 0 10 7 7 T 1503.2 0.343 67.335 16 P~DEC + 0 11 7 7 T 1503.7 0.343 69.031 15 ODING + 0 12 7 7 T 1503.7 0.343 70.727 16 ~I~HA + 0 13 7 7 T 1503.7 0.343 72.423 16 VE~TO + 0 14 7 7 T 1503.7 0.343 74.119 16 ~REST + 0 15 7 7 T 1503.7 0.343 75.815 16 ART~P + 0 16 7 7 T 1503.7 0.343 77.511 16 GM~~~ + 0 17 8 8 F 1515.4 0.259 92.691 -12 W1UE + 0 18 9 9 F 1513.9 0.352 95.752 -10 W1UE + 0 19 6 9 T 1515.8 0.074 98.442 -12 W1UE + 0 20 10 10 F 1515.3 0.305 110.969 -10 CQ W1UE CQ + 0 21 3 10 T 1503.7 0.361 118.233 4 AA5AU + 0 22 11 11 F 1518.3 0.136 129.456 -8 AA5AU + 0 23 11 11 T 1515.4 0.136 131.152 -10 599 012~~ + 0 24 12 12 F 1503.7 0.051 136.155 14 599 0009~ + 0 25 13 13 F 1516.3 0.110 141.726 -11 TU W1UE CQ + 0 26 14 14 F 1503.7 0.083 169.683 6 AA5AU + 0 27 8 14 T 1517.8 0.257 174.945 -8 AA5AU + 0 28 8 14 T 1515.3 0.255 176.639 -12 599 013~~ + + 0 1 1 1 F 1503.7 0.146 0.994 13 W1UE + 0 2 1 1 T 1503.7 0.145 2.689 15 599 0009~ + 0 3 2 2 F 1516.8 0.124 6.484 -7 TU W1UE CQ + 0 4 3 3 F 1516.8 0.000 32.224 -9 DID~U + 0 5 3 3 T 1519.3 0.002 33.922 -13 ~DECO + 0 6 4 4 F 1514.3 0.415 37.303 -11 L~3~M + 0 7 3 4 T 1516.4 0.000 39.008 -12 ESSAG + 0 8 3 4 T 1516.9 0.004 40.708 -9 ES~FO + 0 9 5 5 F 1503.7 0.059 47.123 11 YES~~ + 0 10 6 6 F 1519.3 0.085 58.173 -12 GOOD! + 0 11 7 7 F 1503.7 0.219 66.363 10 TU AA5AU CQ + 0 12 8 8 F 1517.9 0.007 70.815 -12 W1UE + 0 13 9 9 F 1503.7 0.315 78.755 14 599 010~~ + 0 14 10 10 F 1503.7 0.347 86.843 13 TU AA5AU CQ + 0 15 11 11 F 1517.3 0.354 91.090 -10 AA5AU + 0 16 12 12 F 1503.7 0.202 102.386 14 CQ AA5AU CQ + 0 17 6 12 T 1517.3 0.083 106.931 -9 W1UE + 0 18 13 13 F 1503.7 0.192 110.432 4 W1UE + 0 19 13 13 T 1503.7 0.192 112.128 16 599 011~~ + 0 20 14 14 F 1515.3 0.246 115.574 -9 599 014~~ + 0 21 12 14 T 1503.7 0.201 118.073 10 TU AA5AU CQ + 0 22 15 15 F 1514.3 0.213 124.021 -12 W1UE + 0 23 16 16 F 1503.7 0.231 129.127 3 AA5AU + 0 24 17 17 F 1516.4 0.138 135.394 -10 W1UE + 0 25 18 18 F 1503.7 0.116 145.972 14 DID~G + 0 26 18 18 T 1503.7 0.115 147.667 13 ET~TH + 0 27 18 18 T 1503.7 0.115 149.363 14 AT~LA + 0 28 18 18 T 1503.2 0.116 151.060 13 ST~TX + 0 29 19 19 F 1517.9 0.062 156.518 -13 GETTI + 0 30 20 20 F 1517.3 0.055 159.903 -11 ~CLIC + 0 31 20 20 T 1514.9 0.054 161.598 -8 K~ON~ + 0 32 20 20 T 1515.3 0.054 163.294 -8 YOUR~ + 0 33 12 20 T 1503.7 0.206 170.230 7 RRR~~ + + 0 1 1 1 F 1503.2 0.219 4.883 6 YOUR~ + 0 2 1 1 T 1503.7 0.219 6.579 16 CALL~ + 0 3 1 1 T 1503.2 0.219 8.275 16 STAYS + 0 4 1 1 T 1502.7 0.220 9.972 14 ~IN~D + 0 5 1 1 T 1503.7 0.219 11.667 14 X~CAL + 0 6 1 1 T 1503.2 0.219 13.363 16 L~BOX + 0 7 2 2 F 1514.3 0.334 25.350 -11 NOT~I + 0 8 2 2 T 1516.8 0.335 27.047 -10 F~YOU + 0 9 3 3 F 1516.9 0.343 28.751 -9 ~LOG~ + 0 10 2 3 T 1515.8 0.334 30.438 -11 IT~~~ + 0 11 4 4 F 1502.7 0.062 36.526 13 HOW~D + 0 12 4 4 T 1502.7 0.061 38.221 16 O~YOU + 0 13 4 4 T 1503.2 0.061 39.917 16 ~LOG~ + 0 14 5 5 F 1503.2 0.306 41.434 -5 IT~~~ + 0 15 6 6 F 1517.3 0.357 53.357 -14 WHEN~ + 0 16 6 6 T 1514.9 0.357 55.053 -8 LOGGI + 0 17 6 6 T 1517.3 0.362 56.754 -13 NG~WI + 0 18 7 7 F 1518.3 0.350 58.438 -11 NDOW~ + 0 19 6 7 T 1517.9 0.356 60.140 -8 POPS~ + 0 20 7 7 T 1516.8 0.349 63.525 -10 OG~IT + 0 21 8 8 F 1516.9 0.287 66.855 -9 AFTER + 0 22 8 8 T 1518.3 0.287 68.551 -8 ~F3~~ + 0 23 9 9 F 1502.2 0.410 82.666 15 LOGGI + 0 24 9 9 T 1502.2 0.409 84.361 16 NG~WI + 0 25 9 9 T 1502.2 0.409 86.057 16 NDOW~ + 0 26 9 9 T 1502.2 0.409 87.753 15 DOES~ + 0 27 9 9 T 1502.2 0.410 89.450 14 NOT~P + 0 28 9 9 T 1502.2 0.410 91.146 16 OP~UP + 0 29 9 9 T 1502.2 0.409 92.841 16 ~AFTE + 0 30 9 9 T 1502.2 0.410 94.538 16 R~F3~ + + 0 1 1 1 F 1517.9 0.370 0.370 -10 IN~~~ + 0 2 2 2 F 1502.2 0.375 8.007 5 LOG~Q + 0 3 2 2 T 1502.2 0.375 9.703 16 SO~DO + 0 4 2 2 T 1502.2 0.375 11.399 15 ES~NO + 0 5 2 2 T 1502.2 0.375 13.095 12 THING + + 0 1 1 1 F 1518.3 0.284 0.708 -9 OG~QS + 0 2 2 2 F 1515.8 0.277 2.397 -6 O.~MI + 0 3 2 2 T 1520.8 0.277 4.093 -10 NE~PO + 0 4 1 2 T 1517.3 0.283 5.795 -7 PS~UP + 0 5 3 3 F 1502.2 0.305 16.417 15 DOES~ + 0 6 3 3 T 1502.2 0.305 18.113 12 NOT~W + 0 7 3 3 T 1502.2 0.305 19.809 16 ORK~H + 0 8 3 3 T 1502.2 0.305 21.505 16 ERE~~ + 0 9 4 4 F 1514.8 0.260 49.020 -6 SOMEO + 0 10 4 4 T 1516.8 0.261 50.717 -6 NE~EL + 0 11 4 4 T 1515.8 0.263 52.415 -3 SE~IS + 0 12 4 4 T 1516.4 0.262 54.110 -8 ~IN~T + 0 13 4 4 T 1515.8 0.263 55.807 -9 HERE~ + + 0 1 1 1 F 1502.7 0.035 5.971 2 AGN?~ + + 0 1 1 1 F 1516.8 0.293 4.957 -11 JOE~~ + 0 2 2 2 F 1502.7 0.037 14.029 1 AA5AU + + 0 1 1 1 F 1502.7 0.175 3.143 4 AA5AU + + 0 1 1 1 F 1502.7 0.097 8.577 1 AGN?~ + + 0 1 1 1 F 1502.2 0.369 4.185 6 AGN?~ + + 0 1 1 1 F 1503.7 0.328 8.808 5 NOT~D + 0 2 1 1 T 1503.2 0.327 10.503 12 ECODI + 0 3 1 1 T 1503.2 0.328 12.200 11 NG~DE + 0 4 1 1 T 1503.2 0.328 13.896 13 ~AA5A + 0 5 1 1 T 1503.2 0.327 15.591 11 U~~~~ + 0 6 2 2 F 1503.2 0.126 42.950 -11 WILL~ + 0 7 2 2 T 1503.2 0.125 44.645 11 RESTA + 0 8 2 2 T 1503.2 0.125 46.341 14 RT~PG + 0 9 2 2 T 1503.2 0.126 48.038 7 M~DE~ + 0 10 2 2 T 1503.7 0.125 49.733 6 AA5AU + 0 11 3 3 F 1502.2 0.316 87.660 5 AA5AU + + 0 1 1 1 F 1502.2 0.415 1.263 4 599 012~~ + 0 2 2 2 F 1497.4 0.000 1.272 -8 599 012~~ + + 0 1 1 1 F 1502.2 0.338 5.850 12 W2PU + 0 2 1 1 T 1501.7 0.337 7.545 12 599 012~~ + + 0 1 1 1 F 1517.3 0.076 3.892 -13 W1UE + + 0 1 1 1 F 1514.3 0.270 5.782 -10 TU W1UE CQ + + 0 1 1 1 F 1514.3 0.270 5.782 -10 TU W1UE CQ + + 0 1 1 1 F 1519.3 0.029 3.421 -10 W2PU + 0 2 1 1 T 1518.3 0.027 5.115 -12 599 016~~ + + 0 1 1 1 F 1516.8 0.371 3.339 -8 W2PU + 0 2 1 1 T 1514.8 0.373 5.037 -7 599 016~~ + + 0 1 1 1 F 1502.7 0.003 2.547 11 AA5AU + + 0 1 1 1 F 1502.7 0.240 1.512 14 W2PU + 0 2 1 1 T 1502.7 0.239 3.207 13 599 012~~ + + 0 1 1 1 F 1518.3 0.032 5.120 -10 W1UE + + 0 1 1 1 F 1515.8 0.253 5.341 -8 599 016~~ + + 0 1 1 1 F 1502.2 0.372 6.732 5 CQ AA5AU CQ + 0 2 2 2 F 1502.7 0.037 23.357 8 CQ AA5AU CQ + 0 3 3 3 F 1503.2 0.321 32.969 3 K9AN + 0 4 3 3 T 1502.7 0.320 34.664 13 599 013~~ + 0 5 4 4 F 1502.7 0.265 43.513 9 TU AA5AU CQ + 0 6 5 5 F 1516.3 0.113 48.025 -9 W1UE + 0 7 6 6 F 1502.7 0.071 53.495 12 W1UE + 0 8 6 6 T 1503.2 0.071 55.191 2 599 014~~ + 0 9 7 7 F 1517.3 0.126 59.062 -11 AA5AU + 0 10 7 7 T 1517.4 0.124 60.756 -11 599 016~~ + 0 11 8 8 F 1502.7 0.352 64.376 3 TU AA5AU CQ + + 0 1 1 1 F 1502.7 0.105 2.225 9 W2PU + 0 2 1 1 T 1502.7 0.104 3.920 8 599 015~~ + + 0 1 1 1 F 1503.2 0.137 2.681 13 TU AA5AU CQ + 0 2 2 2 F 1516.8 0.346 8.826 -9 W1UE + 0 3 3 3 F 1503.2 0.366 16.478 4 W1UE + 0 4 3 3 T 1502.7 0.366 18.174 7 599 016~~ + 0 5 4 4 F 1514.3 0.275 21.475 -7 AA5AU + 0 6 4 4 T 1514.8 0.272 23.168 -9 599 016~~ + 0 7 5 5 F 1503.2 0.395 26.259 9 TU AA5AU CQ + 0 8 6 6 F 1503.2 0.005 34.773 8 K9AN + 0 9 6 6 T 1503.2 0.003 36.467 6 599 017~~ + 0 10 5 6 T 1503.2 0.398 45.766 5 TU AA5AU CQ + 0 11 7 7 F 1502.7 0.042 55.586 12 W1UE + 0 12 7 7 T 1502.7 0.041 57.281 11 599 018~~ + 0 13 8 8 F 1516.8 0.251 61.731 -7 599 016~~ + 0 14 9 9 F 1502.2 0.106 64.554 12 TU AA5AU CQ + + 0 1 1 1 F 1502.2 0.377 5.041 13 WOW~D + 0 2 1 1 T 1502.2 0.377 6.737 15 E~AA5 + 0 3 1 1 T 1502.2 0.377 8.433 12 AU~~~ + 0 4 2 2 F 1517.3 0.181 21.381 -10 CQ W1UE CQ + + 0 1 1 1 F 1515.8 0.301 6.661 -12 CQ W1UE CQ + 0 2 2 2 F 1502.2 0.156 12.876 5 AA5AU + + 0 1 1 1 F 1502.2 0.347 0.771 2 CQ WV4P CQ + 0 2 1 1 T 1502.2 0.351 7.983 14 AA5AU + 0 3 2 2 F 1502.2 0.389 16.501 4 CQ WV4P CQ + + 0 1 1 1 F 1502.2 0.201 3.593 5 CQ WV4P CQ + + 0 1 1 1 F 1502.2 0.301 3.269 3 W1UE + 0 2 1 1 T 1502.2 0.300 4.964 11 599 0003~ + 0 3 2 2 F 1515.8 0.272 8.328 -9 WV4P + 0 4 3 3 F 1502.2 0.051 14.891 14 TU WV4P CQ + + 0 1 1 1 F 1502.2 0.395 5.483 -3 W2PU + 0 2 1 1 T 1502.2 0.393 7.177 16 599 0004~ + + 0 1 1 1 F 1502.2 0.067 2.611 14 TU WV4P CQ + 0 2 2 2 F 1502.7 0.307 5.819 -1 AA5AU + 0 3 3 3 F 1502.2 0.231 11.679 4 AA5AU + 0 4 3 3 T 1502.2 0.231 13.375 16 599 0005~ + 0 5 4 4 F 1502.2 0.380 16.068 12 WV4P + 0 6 4 4 T 1502.2 0.380 17.764 8 599 019~~ + 0 7 5 5 F 1502.2 0.179 24.347 11 TU WV4P CQ + 0 8 6 6 F 1502.2 0.354 26.642 5 U~QTC + 0 9 6 6 T 1502.2 0.353 28.337 15 ~FOR~ + 0 10 6 6 T 1502.2 0.353 30.033 15 ME~?~ + + 0 1 1 1 F 1502.2 0.067 2.611 14 TU WV4P CQ + 0 2 2 2 F 1502.7 0.307 5.819 -1 AA5AU + 0 3 3 3 F 1502.2 0.231 11.679 4 AA5AU + 0 4 3 3 T 1502.2 0.231 13.375 16 599 0005~ + 0 5 4 4 F 1502.2 0.380 16.068 12 WV4P + 0 6 4 4 T 1502.2 0.380 17.764 8 599 019~~ + 0 7 5 5 F 1502.2 0.179 24.347 11 TU WV4P CQ + 0 8 6 6 F 1502.2 0.354 26.642 5 U~QTC + 0 9 6 6 T 1502.2 0.353 28.337 15 ~FOR~ + 0 10 6 6 T 1502.2 0.353 30.033 15 ME~?~ + + 0 1 1 1 F 1502.2 0.185 5.273 11 599 0006~ + + + 0 1 1 1 F 1501.7 0.092 1.788 11 K1JT + 0 2 1 1 T 1501.7 0.092 3.484 17 599 0006~ + + 0 1 1 1 F 1501.7 0.063 3.031 4 TU WV4P CQ + 0 2 2 2 F 1501.7 0.121 11.993 5 599 0007~ + 0 3 3 3 F 1501.7 0.172 15.012 4 W1UE + 0 4 3 3 T 1502.2 0.172 16.708 9 599 0007~ + + 0 1 1 1 F 1503.2 0.240 6.600 5 AA5AU + 0 2 2 2 F 1501.7 0.201 14.617 4 599 0008~ + 0 3 3 3 F 1501.2 0.343 17.727 1 599 0008~ + 0 4 4 4 F 1501.2 0.333 20.261 13 AA5AU + 0 5 4 4 T 1501.7 0.334 21.958 13 599 0008~ + 0 6 5 5 F 1503.7 0.269 24.861 -3 WV4P + 0 7 5 5 T 1503.2 0.270 26.558 4 599 019~~ + 0 8 6 6 F 1501.7 0.261 30.789 2 TU WV4P CQ + + 0 1 1 1 F 1501.7 0.135 3.103 8 W2ZQ + 0 2 1 1 T 1501.2 0.134 4.798 15 599 0009~ + + + + 0 1 1 1 F 1501.2 0.023 2.991 8 W3CCX + 0 2 1 1 T 1501.7 0.023 4.687 14 599 010~~ + + 0 1 1 1 F 1501.7 0.184 2.728 5 TU WV4P CQ + 0 2 2 2 F 1516.8 0.122 7.754 -11 W1UE + 0 3 3 3 F 1501.2 0.124 12.844 4 W1UE + 0 4 3 3 T 1501.2 0.123 14.539 16 599 011~~ + 0 5 4 4 F 1517.8 0.105 17.489 -10 WV4P + 0 6 5 5 F 1501.7 0.307 23.203 13 TU WV4P CQ + + 0 1 1 1 F 1503.2 0.111 10.711 6 CQ AA5AU CQ + + 0 1 1 1 F 1515.8 0.130 6.490 -8 CQ W1UE CQ + 0 2 2 2 F 1501.2 0.199 17.583 2 WV4P + 0 3 3 3 F 1516.8 0.251 23.147 -10 WV4P + 0 4 3 3 T 1518.3 0.254 24.846 -9 599 016~~ + 0 5 4 4 F 1501.2 0.307 29.987 9 TU WV4P CQ + 0 6 5 5 F 1501.2 0.406 37.294 2 599 013~~ + 0 7 6 6 F 1503.7 0.246 49.854 2 AA5AU + 0 8 7 7 F 1517.3 0.007 77.599 -9 W1UE + 0 9 8 8 F 1503.7 0.301 110.541 2 AA5AU + 0 10 9 9 F 1518.8 0.261 117.285 -9 AA5AU + 0 11 9 9 T 1514.3 0.256 118.976 -9 599 017~~ + 0 12 10 10 F 1503.7 0.230 121.918 12 WV4P + 0 13 10 10 T 1503.7 0.230 123.614 13 599 019~~ + 0 14 11 11 F 1516.8 0.353 128.825 -12 TU W1UE CQ + + 0 1 1 1 F 1517.3 0.132 22.604 -13 W1UE + 0 2 2 2 F 1501.2 0.215 38.375 3 I~AM~ + 0 3 2 2 T 1501.2 0.215 40.071 17 USING + 0 4 2 2 T 1501.2 0.215 41.767 16 ~IN~N + 0 5 2 2 T 1501.2 0.215 43.463 16 1MM~R + 0 6 2 2 T 1501.2 0.215 45.159 14 IGHT~ + 0 7 2 2 T 1501.2 0.215 46.855 13 NOW~~ + + 0 1 1 1 F 1501.2 0.019 19.099 14 I~JUS + 0 2 1 1 T 1501.2 0.018 20.794 15 T~TYP + 0 3 1 1 T 1501.2 0.018 22.490 15 ED~FT + 0 4 1 1 T 1501.7 0.018 24.186 9 8~ENT + 0 5 1 1 T 1501.2 0.018 25.882 16 ER~TH + 0 6 1 1 T 1501.2 0.019 27.579 15 EN~CH + 0 7 1 1 T 1501.2 0.019 29.275 15 ANGED + 0 8 1 1 T 1501.2 0.019 30.971 16 ~MODE + 0 9 1 1 T 1501.2 0.019 32.667 15 ,~WOR + 0 10 1 1 T 1501.2 0.019 34.363 11 KS~WE + 0 11 1 1 T 1501.2 0.019 36.059 15 LL~~~ + + 0 1 1 1 F 1501.2 0.263 7.471 9 YES~~ + + 0 1 1 1 F 1516.8 0.271 20.623 -6 W1UE + 0 2 2 2 F 1474.4 0.203 29.035 -10 CQ N9ADG CQ + + 0 1 1 1 F 1503.7 0.219 9.123 11 IM~GO + 0 2 1 1 T 1504.2 0.218 10.818 15 OD~HE + 0 3 1 1 T 1504.2 0.218 12.514 14 RE~DE + 0 4 1 1 T 1504.2 0.218 14.210 15 ~AA5A + 0 5 1 1 T 1504.2 0.218 15.906 16 U~~~~ + 0 6 2 2 F 1519.8 0.037 25.901 -9 GOOD~ + 0 7 2 2 T 1520.8 0.035 27.595 -9 HERE~ + 0 8 3 3 F 1517.8 0.028 29.284 -7 W1UE~ + 0 9 4 4 F 1472.9 0.391 38.975 -9 CQ N9ADG CQ + 0 10 5 5 F 1504.2 0.327 60.111 13 DE~AA + 0 11 5 5 T 1504.2 0.327 61.807 16 5AU~Q + 0 12 5 5 T 1504.2 0.327 63.503 16 RT~~~ + 0 13 6 6 F 1517.3 0.367 66.511 -7 9AN~B + 0 14 6 6 T 1518.3 0.367 68.207 -7 ARELY + 10 15 7 7 F 1983.4 0.260 68.100 -1 CQ N9ADG CQ + 0 16 6 7 T 1515.8 0.365 69.901 -7 ~SHOW + 0 17 6 7 T 1515.8 0.364 71.596 -9 ~ON~W + 0 18 6 7 T 1517.8 0.363 73.291 -6 ATERF + 0 19 6 7 T 1514.8 0.369 74.993 -9 ALL~B + 10 20 8 8 F 1981.9 0.024 74.648 -15 CQ N9ADG CQ + 0 21 6 8 T 1518.3 0.363 76.683 -9 UT~SO + 0 22 6 8 T 1519.3 0.366 78.382 -12 LID~C + 0 23 6 8 T 1515.3 0.366 80.078 -8 OPY~~ + diff --git a/lib/jtty/gen_jttywave.f90 b/lib/jtty/gen_jttywave.f90 new file mode 100644 index 00000000..88c7eafb --- /dev/null +++ b/lib/jtty/gen_jttywave.f90 @@ -0,0 +1,110 @@ +subroutine gen_jttywave(itone,nsym,nsps,bt,fsample,f0,cwave,wave,icmplx,nwave) + +! Generate JT2 waveform using Gaussian-filtered frequency pulses. + +! Input: integer*4 itone(1:nsym) !Tones for channel symbols +! integer*4 nsym !Number of channel symbols +! integer*4 nsps !Number of samples per symbol +! real*4 bt !BT product for Gaussian smoothing +! real*4 fsample !Sample rate, Hz +! real*4 f0 !Nominal carrier frequency (lowest tone) +! integer*4 icmplx !0 for real waveford, 1 for complex +! integer*4 nwave !Length of output waveform + +! Output: complex*8 cwave(nwave) !Complex waveform +! read*4 wave(nwave) !Real waveform + + parameter(NTAB=65536) + real wave(nwave) + complex cwave(nwave),ctab(0:NTAB-1) + real, allocatable :: pulse(:) + real, allocatable :: dphi(:) + integer itone(nsym) + data fchk0/0.0/ + save pulse,twopi,dt,hmod,fchk0,ctab + + if(nsym.le.0 .or. nwave.le.0) then + nwave=0 + return + endif + + ibt=nint(10*bt) + fchk=nsym+nsps+bt+fsample + if(fchk.ne.fchk0) then !Execute again only when params change + if( allocated(pulse) ) then + deallocate(pulse) + endif + allocate(pulse(1:3*nsps)) + + twopi=8.0*atan(1.0) + dt=1.0/fsample + hmod=1.0 +! Compute the frequency-smoothing pulse + do i=1,3*nsps + tt=(i-1.5*nsps)/real(nsps) + pulse(i)=gfsk_pulse(bt,tt) + enddo + do i=0,NTAB-1 !Tabulate the trig-functiion values + phi=i*twopi/NTAB + ctab(i)=cmplx(cos(phi),sin(phi)) + enddo + fchk0=fchk + endif + +! Compute the smoothed frequency waveform. +! Length = (nsym+2)*nsps samples, first and last symbols extended + + allocate(dphi(0:(nsym+2)*nsps-1)) + + dphi_peak=twopi*hmod/real(nsps) + dphi=0.0 + do j=1,nsym + ib=(j-1)*nsps + ie=ib+3*nsps-1 + dphi(ib:ie) = dphi(ib:ie) + dphi_peak*pulse(1:3*nsps)*itone(j) + enddo + +! Add dummy symbols at beginning and end with tone values equal to 1st and +! last symbol, respectively + + dphi(0:2*nsps-1)=dphi(0:2*nsps-1)+dphi_peak*itone(1)*pulse(nsps+1:3*nsps) + dphi(nsym*nsps:(nsym+2)*nsps-1)=dphi(nsym*nsps:(nsym+2)*nsps-1) + & + dphi_peak*itone(nsym)*pulse(1:2*nsps) + +! Calculate and insert the audio waveform + phi=0.0 + dphi = dphi + twopi*f0*dt !Shift frequency up by f0 + if(icmplx .eq. 0) wave=0. + if(icmplx .ne. 0) cwave=0. !Avoid writing to memory we may not have access to + + k=0 + do j=nsps,nsps+nwave-1 !Don't include dummy symbols + k=k+1 + if(icmplx.eq.0) then + wave(k)=sin(phi) + else + i=min(NTAB-1,int(phi*float(NTAB)/twopi)) + cwave(k)=ctab(i) + endif + phi=modulo(phi+dphi(j),twopi) + enddo + +! Apply envelope shaping to the first and last symbols + nramp=nint(nsps/8.0) + if(icmplx.eq.0) then + wave(1:nramp)=wave(1:nramp) * & + (1.0-cos(twopi*(/(i,i=0,nramp-1)/)/(2.0*nramp)))/2.0 + k1=nsym*nsps-nramp+1 + wave(k1:k1+nramp-1)=wave(k1:k1+nramp-1) * & + (1.0+cos(twopi*(/(i,i=0,nramp-1)/)/(2.0*nramp)))/2.0 + else + cwave(1:nramp)=cwave(1:nramp) * & + (1.0-cos(twopi*(/(i,i=0,nramp-1)/)/(2.0*nramp)))/2.0 + k1=nsym*nsps-nramp+1 + cwave(k1:k1+nramp-1)=cwave(k1:k1+nramp-1) * & + (1.0+cos(twopi*(/(i,i=0,nramp-1)/)/(2.0*nramp)))/2.0 + endif + + deallocate(dphi) + return +end subroutine gen_jttywave diff --git a/lib/jtty/gen_syncwave.f90 b/lib/jtty/gen_syncwave.f90 new file mode 100644 index 00000000..07c0ae43 --- /dev/null +++ b/lib/jtty/gen_syncwave.f90 @@ -0,0 +1,26 @@ +subroutine gen_syncwave(csync,nss) + use jtty_fec, only: is13 ! sync sequence + implicit none + integer, intent(in) :: nss ! samples/symbol at 6000 samples/sec + integer :: i,j,k + real :: twopi, fsample, dt, baud, phi, dphi + complex, intent(out) :: csync(13*nss) + + twopi=8.0*atan(1.0) + fsample = 6000.0 + dt=1.0/fsample + baud=fsample/nss + csync=cmplx(0.,0.) + k=1 + phi=0.0 + do i=1,13 + dphi=twopi*baud*is13(i)*dt + do j=1,nss + csync(k)=cmplx(cos(phi),sin(phi)) + k=k+1 + phi=phi+dphi + enddo + enddo + + return +end subroutine gen_syncwave diff --git a/lib/jtty/genjtty.f90 b/lib/jtty/genjtty.f90 new file mode 100644 index 00000000..80be9c02 --- /dev/null +++ b/lib/jtty/genjtty.f90 @@ -0,0 +1,161 @@ +subroutine genjtty(umsg,itone,nsym) + +! Input: character*80 umsg !User message +! Output: integer*4 itone(1:nsym) !Tones for channel symbols +! integer*4 nsym !Number of channel symbols + + use jtty_mod, only: JTTY_EXCHANGE_UNKNOWN + parameter (MAX_TONES=59*16) !Max number of channel symbols + character*80 umsg !User-formatted message + integer itone(MAX_TONES) !Array of tone frequencies for this message + call genjtty_profile(umsg,JTTY_EXCHANGE_UNKNOWN,itone,nsym) + + return +end subroutine genjtty + +subroutine genjtty_profile(umsg,exchange_profile,itone,nsym) + + use jtty_mod, only: pack_jtty,MAX_FRAMES + implicit none + character(len=80), intent(inout) :: umsg + integer, intent(in) :: exchange_profile + integer, intent(out) :: itone(59*MAX_FRAMES),nsym + character(len=34) :: frames(MAX_FRAMES) + integer :: nframes + + nsym=0 + call pack_jtty(umsg,frames,nframes,exchange_profile) + if(nframes.le.0) return + call genjtty_frames(frames,nframes,itone,nsym) +end subroutine genjtty_profile + +subroutine genjtty_atoms(atoms,natoms,itone,nsym) + + use jtty_mod, only: jtty_source_atom,pack_jtty_atoms,MAX_FRAMES + type(jtty_source_atom), intent(in) :: atoms(:) + integer, intent(in) :: natoms + integer, intent(out) :: itone(*) + integer, intent(out) :: nsym + character(len=34) :: frames(MAX_FRAMES) + integer :: nframes + logical :: valid + + call pack_jtty_atoms(atoms,natoms,frames,nframes,valid) + nsym=0 + if(.not.valid) return + call genjtty_frames(frames,nframes,itone,nsym) +end subroutine genjtty_atoms + +subroutine genjtty_frames(frames,nframes,itone,nsym) + + use jtty_fec, only: PAYLOAD_BITS,tbcc_encode,is13 + use jtty_tbcc_code_profiles, only: JTTY_TBCC_PROFILE_1167_1545_80F + implicit none + character(len=34), intent(in) :: frames(*) + integer, intent(in) :: nframes + integer, intent(out) :: itone(*),nsym + integer :: payload(PAYLOAD_BITS),tone_symbols(46),i,ib + + nsym=0 + do i=1,nframes + read(frames(i),'(34i1)') payload + call tbcc_encode(payload,tone_symbols,JTTY_TBCC_PROFILE_1167_1545_80F) + ib=(i-1)*59+1 + itone(ib:ib+12)=is13 + itone(ib+13:ib+58)=tone_symbols + nsym=nsym+59 + enddo +end subroutine genjtty_frames + +subroutine genjtty_atoms_c(c_atoms,natoms,itone,nsym,status) bind(C,name='genjtty_atoms_c') + + use iso_c_binding, only: c_char,c_int,c_null_char + use packjt77_grammar, only: pack77_arrl_section_index + use jtty_mod, only: jtty_source_atom,jtty_source_atom_c,JTTY_ATOM_CALL, & + JTTY_ATOM_EXCH_NUM,JTTY_ATOM_EXCH_LOC,JTTY_ATOM_EXCH_PAIR, & + JTTY_ATOM_CONTROL,JTTY_ATOM_GRID4,jtty_call_atom,jtty_exch_num_atom, & + jtty_exch_loc_atom,jtty_class_section_atom,jtty_control_atom, & + jtty_grid4_atom,MAX_FRAMES,JTTY_ENCODE_OK,JTTY_ENCODE_INVALID_DESCRIPTOR, & + JTTY_ENCODE_UNKNOWN_SECTION + type(jtty_source_atom_c), intent(in) :: c_atoms(*) + integer(c_int), value, intent(in) :: natoms + integer(c_int), intent(out) :: itone(*) + integer(c_int), intent(out) :: nsym + integer(c_int), intent(out) :: status + type(jtty_source_atom) :: atoms(MAX_FRAMES) + character(len=13) :: descriptor_text + integer :: i,section_index + logical :: text_valid + + interface + subroutine genjtty_atoms(atoms,natoms,itone,nsym) + use jtty_mod, only: jtty_source_atom + type(jtty_source_atom), intent(in) :: atoms(:) + integer, intent(in) :: natoms + integer, intent(out) :: itone(*) + integer, intent(out) :: nsym + end subroutine genjtty_atoms + end interface + + nsym=0; status=JTTY_ENCODE_INVALID_DESCRIPTOR + if(natoms.lt.1 .or. natoms.gt.MAX_FRAMES) return + do i=1,natoms + if(c_atoms(i)%reserved.ne.0) return + call unpack_descriptor_text(c_atoms(i)%text,descriptor_text,text_valid) + if(.not.text_valid) return + select case(int(c_atoms(i)%kind)) + case(JTTY_ATOM_CALL) + if(c_atoms(i)%role.ne.0 .or. c_atoms(i)%value.ne.0) return + atoms(i)=jtty_call_atom(int(c_atoms(i)%subtype),descriptor_text) + case(JTTY_ATOM_EXCH_NUM) + if(len_trim(descriptor_text).ne.0) return + atoms(i)=jtty_exch_num_atom(int(c_atoms(i)%role), & + int(c_atoms(i)%subtype),int(c_atoms(i)%value)) + case(JTTY_ATOM_EXCH_LOC) + if(c_atoms(i)%value.ne.0) return + atoms(i)=jtty_exch_loc_atom(int(c_atoms(i)%role), & + int(c_atoms(i)%subtype),descriptor_text) + case(JTTY_ATOM_EXCH_PAIR) + if(c_atoms(i)%subtype.ne.1) return + if(c_atoms(i)%role.lt.0 .or. c_atoms(i)%role.gt.5) return + section_index=pack77_arrl_section_index(descriptor_text) + if(section_index.lt.1) then + status=JTTY_ENCODE_UNKNOWN_SECTION + return + endif + atoms(i)=jtty_class_section_atom(int(c_atoms(i)%value), & + char(ichar('A')+int(c_atoms(i)%role)),section_index) + case(JTTY_ATOM_CONTROL) + if(c_atoms(i)%role.ne.0 .or. c_atoms(i)%value.ne.0 .or. & + len_trim(descriptor_text).ne.0) return + atoms(i)=jtty_control_atom(int(c_atoms(i)%subtype)) + case(JTTY_ATOM_GRID4) + if(c_atoms(i)%subtype.ne.0 .or. c_atoms(i)%value.ne.0) return + atoms(i)=jtty_grid4_atom(int(c_atoms(i)%role),descriptor_text) + case default + return + end select + enddo + call genjtty_atoms(atoms,int(natoms),itone,nsym) + if(nsym.gt.0) status=JTTY_ENCODE_OK + +contains + + subroutine unpack_descriptor_text(c_text,text,text_valid) + character(kind=c_char), intent(in) :: c_text(9) + character(len=13), intent(out) :: text + logical, intent(out) :: text_valid + integer :: j + + text='' + text_valid=.false. + do j=1,9 + if(c_text(j).eq.c_null_char) then + text_valid=.true. + return + endif + if(j.gt.8) return + text(j:j)=c_text(j) + enddo + end subroutine unpack_descriptor_text +end subroutine genjtty_atoms_c diff --git a/lib/jtty/jtty.f90 b/lib/jtty/jtty.f90 new file mode 100644 index 00000000..a8ac65c9 --- /dev/null +++ b/lib/jtty/jtty.f90 @@ -0,0 +1,60 @@ +program jtty + +! Basic implementation of the JTTY protocol for use from the command line. + + use jtty_mod + use jtty_fec + use jttycom + integer jttyaudio !C function for JTTY portaudio + character*12 arg + data idevin/-1/,idevout/-1/ + + narg=iargc() + if(narg.ne.7) then + print*,'Usage: jtty MyCall HisCall devin devout fTol nQSO ndebug' + print*,'Example: jtty K1JT K9AN 2 5 100 123 0' + call padevsub(idevin,idevout) !Configure the portaudio devices + go to 999 + endif + call getarg(1,mycall) + call getarg(2,hiscall) + call getarg(3,arg) + read(arg,*) idevin + call getarg(4,arg) + read(arg,*) idevout + call getarg(5,arg) + read(arg,*) ftol + call getarg(6,arg) + read(arg,*) nQSO + call getarg(7,arg) + read(arg,*) ndebug + + call padevsub(idevin,idevout) !Configure the portaudio devices + + nright=1 !Use right channel for audio input + iwrite=0 !Set buffer pointer + nfsample=12000 !Sample rate (Hz) + ngo=1 !Set to 0 to stop program + npabuf=384 !PortAudio: 384 frames per buffer, 31.25 baud, 0.032 s + ntxok=0 + ntransmitting=0 + ltx=.false. + lrx=.false. + autoseq=.false. + QSO_in_progress=.false. + ntxed=0 + nwave=59*384 + txmsg='' + ftx=1500.0 + +! Start the input and output audio streams. Note that in normal use this call +! does not return until an error or end-of-program occurs. + + ierr=jttyaudio(idevin,idevout,npabuf,nright,y1,y2,NMAX,iwrite,itx, & + iwave,nwave+3*npabuf,nfsample,nTxOK,nTransmitting,ngo,ndebug) + + if(ierr.ne.0) then + print*,'Error',ierr,' starting audio input or output.' + endif + +999 end program jtty diff --git a/lib/jtty/jtty.ini b/lib/jtty/jtty.ini new file mode 100644 index 00000000..cecea728 --- /dev/null +++ b/lib/jtty/jtty.ini @@ -0,0 +1,3 @@ +K1JT FN20 2 5 0 NJ +K1JT FN20 1 6 0 NJ +MyCall MyGrid AudioIn AudioOut PTTport Exch diff --git a/lib/jtty/jtty_block_pow.f90 b/lib/jtty/jtty_block_pow.f90 new file mode 100644 index 00000000..795e8559 --- /dev/null +++ b/lib/jtty/jtty_block_pow.f90 @@ -0,0 +1,101 @@ +subroutine jtty_block_pow(z, nsym, iblock, pow_block) + +! Coherent block detection for JTTY's 4-FSK symbols. Cascades the already- +! computed blocksize-1 complex correlator outputs z(0:3,1:nsym) (see +! jtty_mdecode.f90's decode_and_merge) into coherent blocksize-2 and, if +! iblock==4, blocksize-4 candidate-sequence sums, then reduces back to a +! max-over-consistent-sequences per-tone/per-position array shaped like the +! ordinary single-symbol pow(0:3,1:nsym), ready to feed directly into +! tbcc_wava_fsk_decode's tone_energies argument -- no changes needed there. +! +! Combining operator is plain addition at every cascade level, with no +! rotation/derotation term. This is specific to JTTY's tone grid: ctones() +! is built with dphi=i*TWOPI/nss, so one full symbol window advances tone +! i's phase by exactly i*TWOPI -- an exact multiple of 2*pi for all four +! tones -- unlike e.g. FST4's centered tone grid (get_fst4_bitmetrics.f90), +! which picks up a guaranteed 180-degree flip every symbol and so needs a +! subtraction at its first cascade step. +! +! nsym is expected even (NCHAN_SYM=46). The L=2 cascade (nsym/2 pairs) is +! always built first and used directly when iblock==2. When iblock==4, +! pairs are grouped by two; if the pair count is odd, the last pair is left +! at its L=2 reduction instead of being folded into an L=4 group -- this +! costs nothing extra, since the L=2 cascade already covers every position. + + implicit none + integer, intent(in) :: nsym ! NCHAN_SYM (46) + integer, intent(in) :: iblock ! 2 or 4 + complex, intent(in) :: z(0:3,nsym) + real, intent(out) :: pow_block(0:3,nsym) + + complex :: c2(0:3,0:3,nsym/2) + complex :: s4 + integer :: npair, nquad, ip, iq, ipL, ipR + integer :: posA, posB, pos1, pos2, pos3, pos4 + integer :: ta, tb, tc, td + real :: p2 + + npair = nsym/2 + + do ip=1,npair + posA=2*ip-1 + posB=2*ip + do ta=0,3 + do tb=0,3 + c2(ta,tb,ip) = z(ta,posA) + z(tb,posB) + enddo + enddo + enddo + +! L=2 reduction, always computed: used directly for iblock==2, and as the +! trailing-remainder fallback for iblock==4. + do ip=1,npair + posA=2*ip-1 + posB=2*ip + do ta=0,3 + p2 = real(c2(ta,0,ip)*conjg(c2(ta,0,ip))) + p2 = max(p2, real(c2(ta,1,ip)*conjg(c2(ta,1,ip)))) + p2 = max(p2, real(c2(ta,2,ip)*conjg(c2(ta,2,ip)))) + p2 = max(p2, real(c2(ta,3,ip)*conjg(c2(ta,3,ip)))) + pow_block(ta,posA) = p2/2.0 + enddo + do tb=0,3 + p2 = real(c2(0,tb,ip)*conjg(c2(0,tb,ip))) + p2 = max(p2, real(c2(1,tb,ip)*conjg(c2(1,tb,ip)))) + p2 = max(p2, real(c2(2,tb,ip)*conjg(c2(2,tb,ip)))) + p2 = max(p2, real(c2(3,tb,ip)*conjg(c2(3,tb,ip)))) + pow_block(tb,posB) = p2/2.0 + enddo + enddo + + if(iblock.eq.4) then + nquad = npair/2 + do iq=1,nquad + ipL=2*iq-1 + ipR=2*iq + pos1=2*ipL-1 + pos2=2*ipL + pos3=2*ipR-1 + pos4=2*ipR + pow_block(:,pos1)=0.0 + pow_block(:,pos2)=0.0 + pow_block(:,pos3)=0.0 + pow_block(:,pos4)=0.0 + do ta=0,3 + do tb=0,3 + do tc=0,3 + do td=0,3 + s4 = c2(ta,tb,ipL) + c2(tc,td,ipR) + p2 = real(s4*conjg(s4))/4.0 + pow_block(ta,pos1) = max(pow_block(ta,pos1), p2) + pow_block(tb,pos2) = max(pow_block(tb,pos2), p2) + pow_block(tc,pos3) = max(pow_block(tc,pos3), p2) + pow_block(td,pos4) = max(pow_block(td,pos4), p2) + enddo + enddo + enddo + enddo + enddo + endif + +end subroutine jtty_block_pow diff --git a/lib/jtty/jtty_codewords.f90 b/lib/jtty/jtty_codewords.f90 new file mode 100644 index 00000000..da0f3162 --- /dev/null +++ b/lib/jtty/jtty_codewords.f90 @@ -0,0 +1,16 @@ + integer cw(0:63) !Codewords for the RS(7,2) code + data cw/o'1243675',o'2436751',o'3675124',o'4367512',o'5124367', & + o'6751243',o'7512436',o'0352764',o'3527640',o'2764035', & !10 + o'5276403',o'4035276',o'7640352',o'6403527',o'3061457', & + o'0614573',o'1457306',o'6145730',o'7306145',o'4573061', & !20 + o'5730614',o'2170546',o'1705462',o'0546217',o'7054621', & + o'6217054',o'5462170',o'4621705',o'5607231',o'6072315', & !30 + o'7231560',o'0723156',o'1560723',o'2315607',o'3156072', & + o'4716320',o'7163204',o'6320471',o'1632047',o'0471632', & !40 + o'3204716',o'2047163',o'7425013',o'4250137',o'5013742', & + o'2501374',o'3742501',o'0137425',o'1374250',o'6534102', & !50 + o'5341026',o'4102653',o'3410265',o'2653410',o'1026534', & + o'0265341',o'0000000',o'1111111',o'2222222',o'3333333', & !60 + o'4444444',o'5555555',o'6666666',o'7777777'/ + +! The source alphabet is defined by JTTY_ALPHABET in jtty_mod.f90. diff --git a/lib/jtty/jtty_decode.f90 b/lib/jtty/jtty_decode.f90 new file mode 100644 index 00000000..357c687c --- /dev/null +++ b/lib/jtty/jtty_decode.f90 @@ -0,0 +1,192 @@ +subroutine jtty_decode(iwave,nchunk,nsps,f0,ftol,smin,synced,xdt,f1,snr,decoded,success,nharderrors,nsync,dmin) +! +! note nsps is samples per symbol at 12000 s^-1 sample rate. +! + use jtty_mod + use jtty_fec + use jtty_tbcc_decoder, only: jtty_tbcc_decode + use jtty_payload_correlators, only: jtty_payload_correlator, & + jtty_payload_correlator_prepare, jtty_correlate_payload_symbols + implicit none + character*80, intent(out) :: decoded + character*34 :: c32(MAX_FRAMES) + integer :: final_payload(PAYLOAD_BITS) + integer*2, intent(in) :: iwave(nchunk) + integer :: i,j,i0,ja,jb + integer, intent(in) :: nchunk,nsps !size of chunk, nsps at 12000 Sa/s + integer :: nchunk6,nana !size of chunk, nana at 6000 Sa/s + integer :: nframe6 !size of frame at 6000 Sa/s + integer, save :: nsps0=-999 + integer, save :: nfft,nh2,nss + type(jtty_payload_correlator), save :: payload_correlator + complex :: zsym(0:3,TOTAL_K),zhalf(0:3,TOTAL_K) + integer :: iloc(1) + integer :: irxsync(13) + integer, intent(out) :: nharderrors,nsync + real :: fsample + real :: spk,fpk,pa,pt,pn + real :: fbest,xdtbest,sbest + real, allocatable :: s(:), sm(:), s0(:) + real :: a(3) + real :: pow(0:3) + real, save :: twopi,baud,dt + real :: phi,dphi,df2 + real :: ssnr,db + real, intent(in) :: f0,ftol,smin + real, intent(out) :: dmin + real, intent(inout) :: xdt,f1,snr + complex, allocatable :: c(:) + complex, allocatable :: c0(:) + complex, allocatable :: c1(:) + complex, allocatable,save :: csync(:) !Waveform for sync at 6000 s^-1 sample rate + complex, allocatable,save :: ctones(:,:) + complex :: z + logical, intent(out) :: success + logical, intent(inout) :: synced + logical :: source_valid + + success=.false. + decoded=' ' + nharderrors=-1 + nsync=0 + dmin=0.0 + if(sum(abs(iwave)).eq.0) return + + if(nsps.ne.nsps0) then + nsps0=nsps + nss=nsps/2 ! samples per symbol at 6000 sa/s + nfft=8192 ! FFT size for sync search, gives df2=0.732 + nh2=nfft/2 ! spectrum size for sync search + +! allocate saved arrays + if(allocated(csync)) deallocate(csync) + allocate(csync(0:13*nss-1)) + if(allocated(ctones)) deallocate(ctones) + allocate(ctones(0:nss-1,0:3)) + +! Generate complex waveform for sync + twopi=8.0*atan(1.0) + baud=6000.0/real(nss) !31.25 for nss=192 + dt=1/6000.0 + call gen_syncwave(csync,nss) + + do i=0,3 + phi=0.0 + dphi=twopi*i*baud*dt + do j=0,nss-1 + ctones(j,i)=cmplx(cos(phi),sin(phi)) + phi=phi+dphi + enddo + enddo + endif + + nchunk6=nchunk/2 ! chunk size at 6000 Sa/s + nframe6=59*nss ! frame size at 6000 Sa/s + +! make size of c0 next power of 2 larger than nchunk + nana = 2**nint(log(real(nchunk))/log(2.0)+0.5) + allocate(c0(0:nana-1)) + +! convert integer samples at 12K Sa/s to complex analytic signal at 6K Sa/s + call ana64a(iwave,nchunk,c0,nana) + c0(nchunk6:)=0. + + allocate(c(0:nfft-1)) ! + allocate(c1(0:nchunk6-1)) + allocate(s(0:nh2)) + allocate(sm(0:nh2)) + allocate(s0(0:nh2)) + + fsample=6000.0 + dt=1.0/fsample + df2=fsample/nfft + decoded=' ' + + if(.not.synced) then + sbest=0. + fbest=0. + xdtbest=0. + fpk=0. + ja=(f0-ftol)/df2 + jb=(f0+ftol)/df2 + if(ja .lt. 3) ja=3 + if(jb .gt. nh2-2) jb=nh2-2 !Keep s(j-2:j+2) within s(0:nh2) + do i0=0,nframe6/4,12 !Search over quarter-frame segments + xdt=i0*dt + c(0:13*nss-1)=conjg(csync(0:13*nss-1))*c0(i0:i0+13*nss-1) + c(13*nss:)=0. + call four2a(c,nfft,1,-1,1) !Compute the sync-shifted spectrum + spk=0. + do j=ja-2,jb+2 + s(j)=real(c(j))**2 + aimag(c(j))**2 + enddo + do j=ja,jb + sm(j)=s(j-2)+2*s(j-1)+3*s(j)+2*s(j+1)+s(j+2) + if(sm(j).gt.spk) then + spk=sm(j) + fpk=j*df2 + xdt=i0*dt + endif + enddo + if(spk.gt.sbest) then + s0=sm + sbest=spk + fbest=fpk + xdtbest=xdt + endif + enddo + + xdt=xdtbest + snr=db(sbest) + f1=fbest + +! call jtty_peakup(c0,c1,csync,xdtbest,fbest,xdt,f1,snr) + endif + + a=0. + a(1)=-f1 !Shift peak to zero frequency + call twkfreq(c0,c1,nchunk6,6000.0,a) + + pt=0. + pa=0. + do j=1,13 ! find tone powers for sync symbols + i0=nint(xdt/dt) + (j-1)*nss + if(i0+nss.gt.nchunk6) exit + + do i=0,3 + c(0:nss-1)=conjg(ctones(0:nss-1,i))*c1(i0:i0+nss-1) + z=sum(c(0:nss-1)) + pow(i)=abs(z)**2 + enddo + iloc=maxloc(pow)-1 + irxsync(j)=iloc(1) + pt=pt+pow(is13(j)) !signal plus noise + pa=pa+sum(pow) !signal plus 4*noise + enddo + ssnr=-99.0 + pn=(pa-pt)/3.0 + if(pn.gt.0.) ssnr=db(pt/pn) ! pt/pn instead of pt/pn-1 to avoid negative snr estimates + snr=ssnr ! replace the snr derived from sync-shifted spectrum + nsync=count(is13.eq.irxsync) ! nsync is the number of correct hard-decoded sync tones. + + if(nsync .gt. 6 .and. snr .gt. smin) go to 10 + return + +10 synced=.true. + + + call jtty_payload_correlator_prepare(payload_correlator,nss) + call jtty_correlate_payload_symbols(payload_correlator,c1, & + nint(xdt/dt)+13*nss,zsym,zhalf) + call jtty_tbcc_decode(zsym,zhalf,final_payload,success) + nharderrors=-1 + if(success) nharderrors=0 + + decoded=' ' + if( success ) then + write(c32(1),'(34i1)') final_payload + call unpack_jtty(c32,1,decoded,source_valid=source_valid) + if(.not.source_valid) success=.false. + endif + return +end subroutine jtty_decode diff --git a/lib/jtty/jtty_design.md b/lib/jtty/jtty_design.md new file mode 100644 index 00000000..9448c8db --- /dev/null +++ b/lib/jtty/jtty_design.md @@ -0,0 +1,145 @@ +# JTTY Design + +JTTY is a new digital mode designed for fast RTTY-like contest exchanges and other keyboard-to-keyboard communication on the amateur radio bands. It has an operational feel similar to standard RTTY, but far better weak-signal performance and a lower error rate. JTTY transmissions can start at any time and typically last a few seconds. Any arbitrary message can be sent using letters, digits, spaces, and punctuation. Source encoding is especially well optimized for the short, fixed-format messages generally used in RTTY-style radio contesting. + +## Frame and waveform + +A transmission contains one or more 1.888-second frames. Each frame carries a 32-bit source-grammar word followed by two universal control bits: a reserved bit that is always zero and an end-of-message (EOM) bit set only on the final source atom. A 12-bit CRC extends this 34-bit payload to 46 bits. A tail-biting, rate-1/2 convolutional code with constraint length K=10 produces 92 coded bits. + +The waveform is Gaussian-smoothed four-tone frequency-shift keying (4-GFSK), with two coded bits per tone symbol. A frame contains a 13-symbol synchronization sequence followed by 46 coded symbols. At 12000/384 = 31.25 baud, its duration is (13+46)/31.25 = 1.888 seconds. The occupied bandwidth (99% of transmitted power) is 127 Hz. + +The receiver verifies FEC, CRC, the universal reserved-zero bit, and the complete source grammar. A structurally invalid source word is discarded before display, EOM handling, slot creation, or signal subtraction. + +## Source contracts + +JTTY separates automatic text packing from typed native actions. + +Ordinary keyboard text, `sjtty` input, externally queued strings, and untagged N1MM/MMTTY text use the literal source interface. Text is folded to uppercase, spaces are normalized, and unsupported characters become `#`. The explicit RTTY Roundup profile also canonicalizes report-prefixed serials as described below. The encoder chooses the minimum-frame combination of recognized compact atoms and five-character TEXT5 frames that preserves the resulting normalized text exactly. "Literal" identifies the text interface, not a requirement to use TEXT5 or bypass profile normalization. + +The eight shipped JTTY function-key templates use a NativeMacro contract. When a default template is selected, it is compiled to typed call and exchange atoms before placeholder expansion. Native atoms provide compact transmission and unambiguous fields for future logger integration. A customized template that does not match a native form falls back to automatic text packing after normal placeholder expansion. A recognized native template with invalid runtime data is rejected rather than silently transmitted with different semantics. + +Earlier JTTY packing minimized frames using compact calls, a generic `599 ` plus five-character format, and TEXT5. STRUCT30 replaced that generic exchange format with richer typed atoms. Restricting ordinary input to TEXT5 avoided guessing whether `05` meant a serial, zone, or check, but also lost unambiguous callsign compaction. Automatic packing retains the minimum-frame algorithm, with context-free recognition and an explicit exchange profile that can normalize serials and enable additional typed candidates. + +## Automatic text packing + +At complete token boundaries, the packer considers the six callsign forms below, registered control phrases (including within longer messages), and these STRUCT30 forms: + +| Text form | Automatic atom | +| --- | --- | +| Canonical unsigned decimal, optionally preceded by `599` | GENERIC_NUMERIC, 0-131071, with no leading zeros except `0` | +| `599 ` | GENERIC_QTH, exactly two or three base-36 characters including at least one letter | +| Valid four-character Maidenhead locator, optionally preceded by `599` | GRID4 | +| `
` | CLASS_SECTION, count 1-32, class A-F, registered ARRL/RAC section | + +Every candidate must pass the existing codec validation and render exactly as its span in the normalized text. Calls must round-trip through the standard callsign codec; QTH tokens must obey the wire format's canonical length rules. + +The GUI captures an exchange profile from the existing special operating activity when each message is submitted: Unknown, Field Day, or RTTY Roundup. No activity means Unknown even though native macros default to serial exchanges. All profiles retain the context-free candidates above. Only RTTY Roundup adds candidates: full `599 ` as SERIAL and full `599 ` as STATE_PROVINCE, using the native exchange rules and requiring a location token to contain a letter. Bare numbers are never inferred as serials. Field Day adds no candidates because class/section syntax is already self-identifying. No new configuration or wire format is needed. + +Zones, checks, ages, power, license years, other specific location categories, zone/location pairs, and serial/time pairs are not inferred. Under RTTY Roundup, equally compact serial or state/province candidates take precedence over their generic equivalents through the subtype ordering below. + +A dynamic program over character offsets selects the fewest frames under this recognition policy, rather than greedily taking the first compact form. TEXT5 consumes exactly five characters except at the end; an interior short fragment cannot be padded to reach a compact candidate because that would change the text. Structured atoms supply an implicit single space when followed by another token. Equal-cost alternatives prefer a structured atom, then the longest consumed span, then atom kind/subtype/role order. + +Before packing, the explicit RTTY Roundup profile canonicalizes a decimal token following a complete `599` token as a serial: `599 05` becomes `599 005`, and `599 0123` becomes `599 123`. Both use one SERIAL frame. Eligible tokens contain one to six digits with value 0-131071; unsupported tokens retain their spelling and use the normal fallback. Bare digits and all text under Unknown or Field Day retain their spelling after ordinary normalization. The canonical message is returned to the GUI for display and logging. If serial normalization expands the message beyond 80 characters, submission is rejected rather than truncating it. + +The result need not match the theoretical minimum with perfect knowledge of exchange semantics. Under Unknown or Field Day, `599 001` and `599 05` still take two frames. An explicit codec caller can encode `599 05` as a CQ zone in one frame, but the current GUI macros do not expose that numeric kind; RTTY Roundup explicitly selects serial meaning instead. + +`sjtty` defaults to Unknown. An optional leading `--exchange-profile=unknown|field-day|rtty-roundup` selects the profile for either its one-message packing invocation or its eight-argument waveform invocation. Invalid profile values are errors. For example, `sjtty --exchange-profile=rtty-roundup "599 001"` selects the one-frame serial interpretation. + +## Source grammar + +Bits 31-32 select one of four message types. The complete normative definition, including field ranges, enum assignments, validity rules, and golden vectors, is in [jtty_source_encoding.txt](jtty_source_encoding.txt). + +| `i2.n2` | Contents | Canonical rendering | +| --- | --- | --- | +| `0.0` | CQ call action | `CQ CQ` | +| `0.1` | CALL action | `` | +| `0.2` | TU/CQ call action | `TU CQ` | +| `0.3` | CALL/TU action | ` TU` | +| `1.0` | CALL/AGN call action | ` AGN?` | +| `1.1` | TU NOW/CALL action | `TU NOW ` | +| `1.2`, `1.3` | Reserved | Invalid in version 1 | +| `2` | STRUCT30 | Typed exchange, pair, time, control, or GRID4 atom | +| `3` | TEXT5 | Five six-bit JTTY characters | + +STRUCT30 places a 27-bit family body before a three-bit family selector: + +| Family | Name | Fields, in transmitted bit order | +| --- | --- | --- | +| `000` | EXCH_NUM | `role1 + number_kind4 + value17 + zero5` | +| `001` | EXCH_LOC | `role1 + location_kind4 + length1 + base36_token16 + zero5` | +| `010` | EXCH_PAIR | `pair_schema3 + pair_data23 + zero1` | +| `011` | EXCH_NUM_TIME | `role1 + serial14 + minute_of_day11 + zero1` | +| `100` | MISC | `subtype4 + subtype_data23` | +| `101` | Profiled/dense extension | Reserved | +| `110` | Versioned extension | Reserved | +| `111` | Guard space | Invalid | + +The assigned fields cover serials, zones, ages, power, checks, four-digit first-license years, generic numbers, two- or three-character locations, zone/location pairs, Field Day class/section pairs, serial/time pairs, GRID4, and 18 common control phrases. Native values render canonically: serials use at least three digits, zones and checks at least two, UTC time exactly four, and license years exactly four. A full exchange adds `599`; a field-only atom omits it. Decimal width, separator style, `5NN` spelling, and visible repetition do not consume wire bits. + +The former `i2=2` meaning, literal `599 ` followed by five characters, has been intentionally replaced by STRUCT30. There is no discriminator: old receivers display new STRUCT30 bits as `599` text, and some old type-2 frames are valid new STRUCT30 words with different meanings. JTTY is unreleased, so there is no legacy decoder mode. Automatic packing uses only the current grammar; unrecognized `599 ...` text remains available through TEXT5. + +## Native function keys + +Current native templates and control phrases match after case folding and +whitespace normalization, before placeholders are expanded. The three +superseded serial templates are accepted only in their exact saved-default +form so edited variants remain literal. + +| Key | Template | Native meaning | +| --- | --- | --- | +| F1 | `CQ %M CQ` | CQ with the configured call | +| F2 | `%H %E` | His call, then configured full exchange | +| F3 | `%H TU CQ %M CQ` | His call/TU, then CQ with the configured call | +| F4 | `%M` | Configured call | +| F5 | `%H` | His call | +| F6 | `TU NOW %Q %E` | Queued call, then configured full exchange | +| F7 | `%H AGN?` | Request repeat from his call | +| F8 | `%E` | Configured full exchange | + +Keyboard shortcuts and the clickable F1-F8 buttons select the same actions. Native atom sequences use an implicit single-space separator and set EOM only on the last atom. Consecutive queued native messages do not need an intervening TEXT5 space frame. + +`%E` parses the selected contest profile: the default is a decimal serial, FIELD_DAY is exactly `
`, and RTTY is a decimal serial or canonical two- or three-character state/province. `%G` is a field-only GRID4; the exact `599 %G` template selects its full-exchange role. The exact old F2, F6, and F8 defaults using `599 %N` remain recognized during migration and are replaced only when unchanged in saved settings. Edited variants remain literal. + +The practical native GUI and N1MM transmit subset covers Call8, serial or RTTY state/province exchanges, Field Day class/section, GRID4, and registered control phrases. Automatic text packing additionally uses GENERIC_NUMERIC and GENERIC_QTH without assigning contest-specific meanings. Other normative STRUCT30 types are decoded, validated, and rendered canonically but are not inferred from text or exposed as general-purpose macros yet. + +## Tagged N1MM actions + +N1MM may explicitly request native encoding by starting TXTEXT with `[[JTTY:]]`. The assigned actions are `CQ`, `CALL_EXCH`, `CALL_TU_CQ`, `MYCALL`, `HISCALL`, `TU_NOW_EXCH`, `CALL_MY`, `CALL_TU_MY`, `EXCH`, `GRID`, and `CONTROL`. N1MM expands `{MYCALL}`, `!` or `{CALL}`, and `{EXCH}` before WSJT-X validates the action payload under the active profile. + +Untagged N1MM text remains literal. A malformed tag, unknown action, invalid call, invalid exchange or grid, unregistered control phrase, or profile mismatch is rejected rather than transmitted as literal bracket text. The exact grammar and action payloads are in [jtty_source_encoding.txt](jtty_source_encoding.txt), with operating examples in [jtty_n1mm_integration.md](jtty_n1mm_integration.md). + +## Contest exchange example + +The native defaults keep the usual run sequence compact while retaining explicit meanings: + +| Run station | S+P stations | Frames | +| --- | --- | ---: | +| `CQ KA1ABC CQ` | | 1 | +| | `WB9XYZ` | 1 | +| | `JA6DEF` | 1 | +| `WB9XYZ 599 101` | | 2 | +| | `599 057` | 1 | +| `TU NOW JA6DEF 599 102` | | 2 | +| | *(no decode)* | 1 | +| `JA6DEF AGN?` | | 1 | +| | `599 292` | 1 | +| `TU KA1ABC CQ` | | 1 | + +Typed exchanges such as `599 05 NWT`, `599 156 1749`, and `1D EMA` fit one STRUCT30 frame. Automatic text packing recognizes `1D EMA`, but does not infer the zone/location or serial/time meanings of the other two examples. Strong FEC makes repeated visible fields unnecessary; when RF redundancy is desired, repeating the protected atom provides another independent synchronization, FEC, and CRC opportunity. + +These frame counts apply to ordinary text, without a native template or contest profile: + +| Input | Frames | Reason | +| --- | ---: | --- | +| `CQ K1ABC CQ` or `CQ KA1ABC CQ` | 1 | CQ call atom | +| `WB9XYZ` | 1 | Call atom | +| `WB9XYZ TU CQ KA1ABC CQ` | 2 | Two call atoms | +| `WB9XYZ 599 123` | 2 | Call and generic numeric exchange | +| `599 123` | 1 | Generic numeric exchange | +| `599 MA` | 1 | Generic QTH exchange | +| `599 FN42` | 1 | Full-role GRID4 | +| `1D EMA` | 1 | Class/section pair | +| `599 001` or `599 05` | 2 | No numeric kind is inferred to preserve leading zeros | +| `599 BRUCE` | 2 | No current generic five-character exchange atom | + +With the RTTY Roundup profile, `599 001` takes one frame and `K1ABC 599 001` takes two. `599 05` becomes `599 005` in one frame. The other examples retain their frame counts, although `599 123` and `599 MA` use typed SERIAL and STATE_PROVINCE atoms instead of generic atoms. diff --git a/lib/jtty/jtty_design.txt b/lib/jtty/jtty_design.txt new file mode 100644 index 00000000..b117e77c --- /dev/null +++ b/lib/jtty/jtty_design.txt @@ -0,0 +1,231 @@ +JTTY: A possible WSJT mode for fast RTTY-like contest exchanges + +JTTY aims for an operational feel similar to conventional amateur RTTY, +with much better weak-signal performance and a much lower error rate. +Transmissions may start at any time and normally last a few seconds. + +FRAME AND WAVEFORM + +Each frame carries 32 message-grammar bits, a reserved-zero bit, and a +universal end-of-message bit. A 12-bit CRC extends the payload to 46 bits. +A tail-biting rate-1/2 convolutional code with constraint length K=10 +produces 92 coded bits. + +JTTY uses Gaussian-smoothed four-tone frequency-shift keying (4-GFSK). +A frame has 13 synchronization symbols followed by 46 coded symbols. +At 12000/384 = 31.25 baud, one frame lasts 1.888 seconds. Nominal +half-power bandwidth is 125 Hz. + +The receiver verifies FEC, CRC, the universal reserved-zero bit, and the +complete source grammar. An invalid source word is discarded before it can +be displayed, mark EOM, create a receive slot, or participate in signal +subtraction. + +SOURCE CONTRACTS + +Ordinary keyboard text, sjtty input, externally queued strings, and untagged +N1MM/MMTTY text use the literal source interface. After uppercase and space +normalization and replacement of unsupported characters with '#', automatic +packing selects the minimum-frame combination of recognized compact atoms +and TEXT5 that preserves the normalized text exactly. Explicit RTTY Roundup +also applies serial normalization below before packing. "Literal" identifies +the text interface, not a requirement to use TEXT5 or bypass that normalization. + +The eight shipped JTTY function-key templates are explicit native actions. +Their call, profile-exchange, and grid placeholders compile to typed atoms. A +customized template that does not match a native form uses automatic text +packing after normal placeholder expansion. If a recognized native template +has invalid runtime data, +transmission is rejected instead of changing meaning through a literal +fallback. + +Earlier JTTY packing minimized frames using compact calls, a generic "599 " +plus five-character format, and TEXT5. STRUCT30 replaced that exchange format +with richer typed atoms. Restricting ordinary input to TEXT5 avoided guessing +whether "05" meant a serial, zone, or check, but also lost unambiguous call +compaction. Automatic packing retains the minimum-frame algorithm with +context-free recognition and an explicit exchange profile that can normalize +serials and enable additional typed candidates. + +AUTOMATIC TEXT PACKING + +At complete token boundaries the packer considers: + + * The six call forms below, with an exact standard-call codec round trip. + * Registered CONTROL phrases, including inside longer messages. + * Canonical unsigned decimal 0-131071 as GENERIC_NUMERIC, field-only or + preceded by "599 ". Leading zeros are not canonical except for "0". + * "599 " plus a canonical two- or three-character base-36 token containing + at least one letter, as GENERIC_QTH. The wire length rules apply. + * Valid four-character Maidenhead GRID4, field-only or preceded by "599 ". + * CLASS_SECTION: count 1-32, class A-F, registered ARRL/RAC section. + +Every candidate must pass codec pack/unpack validation and render exactly as +its span in the normalized text. At submission the GUI captures Unknown, +Field Day, or RTTY +Roundup from the existing special operating activity. No activity means +Unknown even though native macros default to serial exchanges. All profiles +retain the context-free candidates above; Field Day adds no further candidates. + +Only RTTY Roundup adds full "599 " SERIAL and full "599 " +STATE_PROVINCE candidates under the native exchange rules. Locations must +contain a letter. Exact rendering after profile normalization remains +mandatory; bare serials are never +inferred. Zone, check, age, power, license-year, other specific location, +zone/location, and serial/time meanings are not inferred. No new configuration +or wire format is needed. Native actions retain their typed exchange semantics. + +Before packing, explicit RTTY Roundup canonicalizes a decimal token following +a complete "599" token as a serial: "599 05" becomes "599 005", and +"599 0123" becomes "599 123". Tokens must contain one to six digits and have +value 0-131071. Unsupported tokens retain their spelling for normal fallback. +Bare digits and Unknown or Field Day input retain their spelling after ordinary +normalization. The canonical message is returned to the GUI for display and +logging. Expansion beyond 80 characters is rejected rather than truncated. + +A dynamic program over source-character offsets chooses the minimum number +of frames under this recognition policy, rather than a greedy sequence. +TEXT5 consumes exactly five characters except at the end. Interior padding +cannot be used to reach a compact candidate because it would change the text. +Structured candidates consume one source space after their rendered span +when another token follows, matching the receiver's implicit separator. +Equal-cost choices prefer a structured atom, then the longest consumed span, +then ascending atom kind/subtype/role. +The subtype ordering prefers typed serial and state/province candidates over +generic candidates of equal frame count and span under RTTY Roundup. + +This minimum need not equal the theoretical minimum with perfect knowledge +of contest semantics. Examples for ordinary text under Unknown or Field Day, +without a native action: + +-------------------------------------------------------------------------------- +Text Frames Encoding or limitation +-------------------------------------------------------------------------------- +CQ K1ABC CQ 1 CQ call +CQ KA1ABC CQ 1 CQ call +WB9XYZ 1 Call +WB9XYZ TU CQ KA1ABC CQ 2 Two call atoms +WB9XYZ 599 123 2 Call plus generic number +599 123 1 Generic numeric exchange +599 MA 1 Generic QTH exchange +599 FN42 1 Full-role GRID4 +1D EMA 1 Class/section pair +599 001 2 Leading zeros must be preserved +599 05 2 No numeric kind is inferred +599 BRUCE 2 No generic five-character exchange +-------------------------------------------------------------------------------- + +Under RTTY Roundup, "599 001" takes one frame and "K1ABC 599 001" takes two. +"599 123" and "599 MA" use SERIAL and STATE_PROVINCE instead of generic atoms +without changing frame counts. "599 05" and "599 0123" become "599 005" and +"599 123", each in one frame. + +sjtty defaults to Unknown. Its optional leading argument +--exchange-profile=unknown|field-day|rtty-roundup applies to both the +one-message packing invocation and the eight-argument waveform invocation. +Invalid values are errors. Example: + + sjtty --exchange-profile=rtty-roundup "599 001" + +SOURCE GRAMMAR + +-------------------------------------------------------------------------------- +i2.n2 Example Bits Purpose +-------------------------------------------------------------------------------- +0.0 CQ K1ABC CQ call28 + n2 CQ call action +0.1 K1ABC call28 + n2 CALL action +0.2 TU K1ABC CQ call28 + n2 TU/CQ action +0.3 K1ABC TU call28 + n2 CALL/TU action +1.0 K1ABC AGN? call28 + n2 CALL/AGN action +1.1 TU NOW K1ABC call28 + n2 TU NOW/CALL action +1.2 (reserved; invalid) +1.3 (reserved; invalid) +2 599 123 body27 + family3 STRUCT30 +3 HELLO 6 6 6 6 6 TEXT5 +-------------------------------------------------------------------------------- + +Bits 1-30 contain the form listed above and bits 31-32 contain i2. Bit 33 +is always zero. Bit 34 is one only on the final atom of a source message. + +STRUCT30 replaces the former i2=2 "599 " plus five-character form: + +-------------------------------------------------------------------------------- +Family Name Body fields, in transmitted bit order +-------------------------------------------------------------------------------- +000 EXCH_NUM role1 kind4 value17 zero5 +001 EXCH_LOC role1 kind4 length1 token16 zero5 +010 EXCH_PAIR schema3 pair_data23 zero1 +011 EXCH_NUM_TIME role1 serial14 minute11 zero1 +100 MISC subtype4 subtype_data23 +101 PROFILED reserved; invalid in version 1 +110 VERSIONED reserved; invalid in version 1 +111 INVALID source-validity guard space +-------------------------------------------------------------------------------- + +EXCH_NUM kinds 0-7 are serial, CQ zone, ITU zone, age, power, check, +first-license year, and generic numeric. EXCH_LOC kinds 0-4 are +state/province, ARRL/RAC section, country/prefix, generic QTH, and local +administrative code. EXCH_PAIR schemas are ZONE_LOC3 and CLASS_SECTION. +MISC subtypes are CONTROL and GRID4. All other IDs are invalid. + +Full-role fields render with a "599 " prefix; field-only fields omit it. +Serials use at least three digits, zones and checks at least two, UTC time +exactly four, and first-license year exactly four. Structured atoms supply +one implicit trailing space; TEXT5 characters are appended verbatim. Final +trailing spaces and TEXT5 padding are not displayed. Formatting choices and +visible repetitions are not encoded in typed fields. + +NATIVE FUNCTION KEYS + +-------------------------------------------------------------------------------- +Key Template Native atoms +-------------------------------------------------------------------------------- +F1 CQ %M CQ CQ(my_call) +F2 %H %E CALL(his_call), configured full exchange +F3 %H TU CQ %M CQ CALL_TU(his_call), CQ(my_call) +F4 %M CALL(my_call) +F5 %H CALL(his_call) +F6 TU NOW %Q %E TU_NOW_CALL(queue_call), configured exchange +F7 %H AGN? CALL_AGN(his_call) +F8 %E configured full exchange +-------------------------------------------------------------------------------- + +Current templates and control phrases match case-insensitively while ignoring +whitespace differences, before placeholder expansion. Superseded serial +templates match only in their exact saved-default form. Keyboard F1-F8 +shortcuts and clickable buttons select the same actions. EOM is set only on +the final native atom; queued native messages do not require a TEXT5 spacing +frame between them. + +%E uses the selected profile: decimal serial by default, exact +"
" for FIELD_DAY, and either decimal serial or a +canonical two- or three-character state/province for RTTY. %G is field-only +GRID4; the exact "599 %G" template selects full role. Exact old F2, F6, and F8 +defaults using 599 %N remain recognized during migration and are replaced only +when unchanged in saved settings; edited variants remain literal. + +N1MM can opt into native encoding with a leading [[JTTY:]] marker in +TXTEXT. Actions are CQ, CALL_EXCH, CALL_TU_CQ, MYCALL, HISCALL, TU_NOW_EXCH, +CALL_MY, CALL_TU_MY, EXCH, GRID, and CONTROL. Untagged N1MM strings use the +literal source interface with automatic text packing. +Invalid or unknown tagged requests are rejected, not transmitted as bracket +text. See jtty_source_encoding.txt and jtty_n1mm_integration.md for the payload +grammar. + +The practical native transmit subset is Call8, serial and RTTY state/province, +Field Day class/section, GRID4, and registered controls. Automatic text packing +also generates GENERIC_NUMERIC and GENERIC_QTH. Other normative atoms have +canonical receive decoding and rendering but are not inferred from text or +exposed as general-purpose macros in this version. + +The complete normative source definition, field ranges, enum assignments, +validation rules, and binary/hex vectors are in jtty_source_encoding.txt. + +COMPATIBILITY + +The old i2=2 form is intentionally incompatible with STRUCT30. There is no +version discriminator: old receivers display new STRUCT30 bits as "599" text, +and some old type-2 frames are valid new STRUCT30 words with different +meanings. JTTY is unreleased, so no legacy decoder mode is retained. Automatic +packing uses only the current grammar; unrecognized "599 ..." text remains +available through TEXT5. diff --git a/lib/jtty/jtty_fec_mod.f90 b/lib/jtty/jtty_fec_mod.f90 new file mode 100644 index 00000000..b73a3e62 --- /dev/null +++ b/lib/jtty/jtty_fec_mod.f90 @@ -0,0 +1,19 @@ +module jtty_fec + +! JTTY's forward-error-correction configuration: the 13-symbol 4-FSK sync +! sequence and established TBCC/outer-check code. +! The profile and codec APIs are re-exported so JTTY callers need one module. + + use jtty_tbcc_code_profiles + use tbcc + +! The ACF of this 4FSK sync sequence has peak sidelobe level of 2/13 +! and 46 such values over the entire 25x7 lag space + integer :: is13(13) = [0,2,2,3,0,0,3,2,1,3,1,2,0] + +! Bit 33 of the 34-bit payload (see jtty_mod.f90's pack_jtty/unpack_jtty) is +! reserved-zero in the current protocol. Assigning it requires a coordinated +! protocol revision. Bit 34 is the "last frame of this message" flag. + integer, parameter :: JTTY_RESERVED_BIT = 33 + +end module jtty_fec diff --git a/lib/jtty/jtty_mdecode.f90 b/lib/jtty/jtty_mdecode.f90 new file mode 100644 index 00000000..4f77d51f --- /dev/null +++ b/lib/jtty/jtty_mdecode.f90 @@ -0,0 +1,1228 @@ +module jtty_mdec + + use iso_fortran_env, only: int64 + use iso_c_binding, only: c_ptr,c_null_ptr,c_associated,c_f_pointer, & + c_float_complex,c_size_t + use jtty_mod, only: MAX_FRAMES + use jtty_fec, only: PAYLOAD_BITS, TOTAL_K, tbcc_encode + use jtty_tbcc_code_profiles, only: JTTY_TBCC_PROFILE_1167_1545_80F + use jtty_tbcc_decoder, only: jtty_tbcc_decode + use jtty_payload_correlators, only: jtty_payload_correlator, & + jtty_payload_correlator_prepare, jtty_correlate_payload_symbols + + type :: decode + real :: f1 = 0.0 !Synced audio frequency + real :: xdt = 0.0 !Synced DT (0 to 0.5 s) + real :: tsync = 0.0 !Time of sync from istart=1 + real :: snrdb = 0.0 !SNR of decoded frame + character(len=80) :: decoded = '' + logical :: trailing_sep = .false. !decoded ends with an implicit separator column + logical :: is_last_frame = .false. !this frame had the "last frame of message" bit set + end type decode + + type :: message_assembly + integer(int64) :: message_id = 0_int64 + real :: f1 = 0.0 + real :: tsync = 0.0 + real :: start_tsync = 0.0 + integer :: k = 0 + character(len=80) :: decoded = '' + logical :: trailing_sep = .false. + end type message_assembly + + type :: frame_fingerprint + real :: f1 = 0.0 + real :: tsync = 0.0 + end type frame_fingerprint + + type :: message_update + integer(int64) :: message_id = 0_int64 + real :: f1 = 0.0 + real :: start_tsync = 0.0 + character(len=80) :: decoded = '' + logical :: complete = .false. + end type message_update + + integer, parameter :: MAX_DECODES = 100 + integer, parameter :: MAX_ACTIVE_MESSAGES = 30 + integer, parameter :: MAX_RECENT_FRAMES = MAX_ACTIVE_MESSAGES*MAX_FRAMES + integer, parameter :: MAX_CONTINUATION_GAP = 3 + integer, parameter :: MAX_RETRO_STEPS = 3 + real, parameter :: FRAME_HISTORY_TIME_TOLERANCE = 0.05 + real, parameter :: FRAME_HISTORY_FREQ_TOLERANCE = 3.0 + real, parameter :: NEAR_SIMULTANEOUS_FREQ_TOLERANCE = 12.0 + real, parameter :: CONTINUATION_TIME_TOLERANCE = 0.1 + integer :: ndecodes = 0 + integer :: nactive = 0 + integer :: nrecent = 0 + integer :: npending = 0 + integer :: pending_first = 1 + integer(int64) :: next_message_id = 1_int64 + type(message_assembly) :: active_messages(MAX_ACTIVE_MESSAGES) + type(frame_fingerprint) :: recent_frames(MAX_RECENT_FRAMES) + type(message_update), allocatable :: pending_updates(:) + +! Cross-call "retro re-sweep" plumbing (see jtty_mdecode_step): interferer_* +! requests a pre-search subtraction; nsubtracted/subtracted_* report this +! call's own subtractions back out. + integer, parameter :: MAX_SUBTRACTED = 16 + logical :: interferer_pending = .false. + real :: interferer_f1 = 0.0 + real :: interferer_tsync = 0.0 + integer :: interferer_payload(PAYLOAD_BITS) = 0 + integer :: nsubtracted = 0 + real :: subtracted_f1(MAX_SUBTRACTED) = 0.0 + real :: subtracted_tsync(MAX_SUBTRACTED) = 0.0 + integer :: subtracted_payload(PAYLOAD_BITS,MAX_SUBTRACTED) = 0 + complex, allocatable, private :: sync_chirp_weights(:),sync_chirp_kernel(:) + integer, private :: sync_chirp_samples=0,sync_chirp_first_bin=-1 + integer, private :: sync_chirp_output_count=0 + type, private :: sync_fft_cache + type(c_ptr) :: forward=c_null_ptr + type(c_ptr) :: backward=c_null_ptr + type(c_ptr) :: input_storage=c_null_ptr + type(c_ptr) :: spectrum_storage=c_null_ptr + type(c_ptr) :: inverse_storage=c_null_ptr + complex(c_float_complex), pointer, contiguous :: input(:)=>null() + complex(c_float_complex), pointer, contiguous :: spectrum(:)=>null() + complex(c_float_complex), pointer, contiguous :: inverse(:)=>null() + end type sync_fft_cache + integer, parameter, private :: MIN_SYNC_FFT_ORDER=11,MAX_SYNC_FFT_ORDER=13 + type(sync_fft_cache), private :: sync_fft_caches(MIN_SYNC_FFT_ORDER:MAX_SYNC_FFT_ORDER) + +contains + + subroutine release_sync_fft_cache(cache) + use fftw3, only: fftwf_destroy_plan,fftwf_free + type(sync_fft_cache), intent(inout) :: cache + + !$omp critical(fftw) + if(c_associated(cache%forward)) call fftwf_destroy_plan(cache%forward) + if(c_associated(cache%backward)) call fftwf_destroy_plan(cache%backward) + !$omp end critical(fftw) + cache%forward=c_null_ptr + cache%backward=c_null_ptr + nullify(cache%input,cache%spectrum,cache%inverse) + if(c_associated(cache%input_storage)) call fftwf_free(cache%input_storage) + if(c_associated(cache%spectrum_storage)) call fftwf_free(cache%spectrum_storage) + if(c_associated(cache%inverse_storage)) call fftwf_free(cache%inverse_storage) + cache%input_storage=c_null_ptr + cache%spectrum_storage=c_null_ptr + cache%inverse_storage=c_null_ptr + end subroutine release_sync_fft_cache + + logical function allocate_sync_fft_buffer(nfft,storage,buffer) + use fftw3, only: fftwf_alloc_complex + integer, intent(in) :: nfft + type(c_ptr), intent(out) :: storage + complex(c_float_complex), pointer, contiguous, intent(out) :: buffer(:) + complex(c_float_complex), pointer, contiguous :: one_based_buffer(:) + + storage=fftwf_alloc_complex(int(nfft,c_size_t)) + allocate_sync_fft_buffer=c_associated(storage) + if(.not.allocate_sync_fft_buffer) return + call c_f_pointer(storage,one_based_buffer,[nfft]) + buffer(0:nfft-1)=>one_based_buffer + end function allocate_sync_fft_buffer + + logical function ensure_sync_fft_cache(nfft,needs_backward,fft_order) + use fftw3, only: fftwf_plan_dft_1d,FFTW_FORWARD,FFTW_BACKWARD, & + FFTW_MEASURE,FFTW_PRESERVE_INPUT,fftwf_free + integer, intent(in) :: nfft + logical, intent(in) :: needs_backward + integer, intent(out) :: fft_order + + ensure_sync_fft_cache=.false. + fft_order=0 + if(nfft.le.0) return + fft_order=trailz(nfft) + if(fft_order.lt.MIN_SYNC_FFT_ORDER .or. & + fft_order.gt.MAX_SYNC_FFT_ORDER) then + fft_order=0 + return + endif + if(2**fft_order.ne.nfft) then + fft_order=0 + return + endif + + if(.not.c_associated(sync_fft_caches(fft_order)%forward)) then + if(.not.allocate_sync_fft_buffer(nfft, & + sync_fft_caches(fft_order)%input_storage, & + sync_fft_caches(fft_order)%input)) then + fft_order=0 + return + endif + if(.not.allocate_sync_fft_buffer(nfft, & + sync_fft_caches(fft_order)%spectrum_storage, & + sync_fft_caches(fft_order)%spectrum)) then + call release_sync_fft_cache(sync_fft_caches(fft_order)) + fft_order=0 + return + endif + !$omp critical(fftw) + sync_fft_caches(fft_order)%forward=fftwf_plan_dft_1d(nfft, & + sync_fft_caches(fft_order)%input, & + sync_fft_caches(fft_order)%spectrum,FFTW_FORWARD, & + ior(FFTW_MEASURE,FFTW_PRESERVE_INPUT)) + !$omp end critical(fftw) + if(.not.c_associated(sync_fft_caches(fft_order)%forward)) then + call release_sync_fft_cache(sync_fft_caches(fft_order)) + fft_order=0 + return + endif + endif + + if(needs_backward .and. & + .not.c_associated(sync_fft_caches(fft_order)%backward)) then + if(.not.allocate_sync_fft_buffer(nfft, & + sync_fft_caches(fft_order)%inverse_storage, & + sync_fft_caches(fft_order)%inverse)) then + fft_order=0 + return + endif + !$omp critical(fftw) + sync_fft_caches(fft_order)%backward=fftwf_plan_dft_1d(nfft, & + sync_fft_caches(fft_order)%spectrum, & + sync_fft_caches(fft_order)%inverse,FFTW_BACKWARD,FFTW_MEASURE) + !$omp end critical(fftw) + if(.not.c_associated(sync_fft_caches(fft_order)%backward)) then + nullify(sync_fft_caches(fft_order)%inverse) + call fftwf_free(sync_fft_caches(fft_order)%inverse_storage) + sync_fft_caches(fft_order)%inverse_storage=c_null_ptr + fft_order=0 + return + endif + endif + + ensure_sync_fft_cache=c_associated(sync_fft_caches(fft_order)%forward) + if(needs_backward) ensure_sync_fft_cache=ensure_sync_fft_cache .and. & + c_associated(sync_fft_caches(fft_order)%backward) + if(.not.ensure_sync_fft_cache) then + call release_sync_fft_cache(sync_fft_caches(fft_order)) + fft_order=0 + endif + end function ensure_sync_fft_cache + + subroutine jtty_release_fft_resources() bind(C,name='jtty_release_fft_resources') + integer :: index + + do index=MIN_SYNC_FFT_ORDER,MAX_SYNC_FFT_ORDER + call release_sync_fft_cache(sync_fft_caches(index)) + enddo + if(allocated(sync_chirp_weights)) deallocate(sync_chirp_weights) + if(allocated(sync_chirp_kernel)) deallocate(sync_chirp_kernel) + sync_chirp_samples=0 + sync_chirp_first_bin=-1 + sync_chirp_output_count=0 + end subroutine jtty_release_fft_resources + + subroutine reset_decode_search_state() + nactive=0 + nrecent=0 + end subroutine reset_decode_search_state + + subroutine discard_pending_updates() + npending=0 + pending_first=1 + end subroutine discard_pending_updates + + pure logical function same_frame(f1_a,tsync_a,f1_b,tsync_b) + real, intent(in) :: f1_a,tsync_a,f1_b,tsync_b + + same_frame=abs(f1_a-f1_b).lt.FRAME_HISTORY_FREQ_TOLERANCE .and. & + abs(tsync_a-tsync_b).lt.FRAME_HISTORY_TIME_TOLERANCE + end function same_frame + + pure logical function same_recent_frame(f1_a,tsync_a,f1_b,tsync_b) + real, intent(in) :: f1_a,tsync_a,f1_b,tsync_b + + same_recent_frame=abs(f1_a-f1_b).lt.NEAR_SIMULTANEOUS_FREQ_TOLERANCE .and. & + abs(tsync_a-tsync_b).lt.FRAME_HISTORY_TIME_TOLERANCE + end function same_recent_frame + + pure function display_message_text(decoded) result(msg) + character(len=*), intent(in) :: decoded + character(len=80) :: msg + integer :: i + + msg=decoded + do i=1,len_trim(msg)-4 + if(msg(i:i+4).eq.'~~~~~') msg(i:i+4)=' ... ' + enddo + do i=1,len_trim(msg) + if(msg(i:i).eq.'~') msg(i:i)=' ' + enddo + if(msg(1:1).eq.' ') msg=trim(msg(2:)) + end function display_message_text + + logical function is_recent_frame(candidate) + type(decode), intent(in) :: candidate + integer :: i + + is_recent_frame=.false. + do i=1,nrecent + if(same_recent_frame(candidate%f1,candidate%tsync,recent_frames(i)%f1, & + recent_frames(i)%tsync)) then + is_recent_frame=.true. + return + endif + enddo + end function is_recent_frame + + subroutine remember_recent_frame(candidate) + type(decode), intent(in) :: candidate + + if(nrecent.ge.MAX_RECENT_FRAMES) then + ! Duplicate history must never prevent an otherwise valid decode. + recent_frames(1:MAX_RECENT_FRAMES-1)=recent_frames(2:MAX_RECENT_FRAMES) + else + nrecent=nrecent+1 + endif + recent_frames(nrecent)%f1=candidate%f1 + recent_frames(nrecent)%tsync=candidate%tsync + end subroutine remember_recent_frame + + subroutine queue_message_update(message,complete) + type(message_assembly), intent(in) :: message + logical, intent(in) :: complete + type(message_update), allocatable :: grown(:) + integer :: i,index,new_capacity + + do i=0,npending-1 + index=pending_first+i + if(pending_updates(index)%message_id.eq.message%message_id) then + pending_updates(index)%f1=message%f1 + pending_updates(index)%decoded=message%decoded + pending_updates(index)%complete=complete + return + endif + enddo + + if(.not.allocated(pending_updates)) then + allocate(pending_updates(MAX_ACTIVE_MESSAGES)) + else if(pending_first+npending.gt.size(pending_updates)) then + if(npending.lt.size(pending_updates)) then + pending_updates(1:npending)= & + pending_updates(pending_first:pending_first+npending-1) + else + new_capacity=2*npending + allocate(grown(new_capacity)) + grown(1:npending)=pending_updates(pending_first:pending_first+npending-1) + call move_alloc(grown,pending_updates) + endif + pending_first=1 + endif + npending=npending+1 + index=pending_first+npending-1 + pending_updates(index)%message_id=message%message_id + pending_updates(index)%f1=message%f1 + pending_updates(index)%start_tsync=message%start_tsync + pending_updates(index)%decoded=message%decoded + pending_updates(index)%complete=complete + end subroutine queue_message_update + + subroutine remove_active_message(index) + integer, intent(in) :: index + + if(index.lt.1 .or. index.gt.nactive) return + if(index.lt.nactive) active_messages(index)=active_messages(nactive) + nactive=nactive-1 + end subroutine remove_active_message + + subroutine start_message(candidate,message,accepted) + type(decode), intent(in) :: candidate + type(message_assembly), intent(out) :: message + logical, intent(out) :: accepted + + message=message_assembly() + accepted=.false. + if(.not.candidate%is_last_frame .and. nactive.ge.MAX_ACTIVE_MESSAGES) return + call remember_recent_frame(candidate) + + message%message_id=next_message_id + message%f1=candidate%f1 + message%tsync=candidate%tsync + message%start_tsync=candidate%tsync + message%decoded=candidate%decoded + if(message%decoded(1:4).eq.'599 ') & + message%decoded='~'//trim(message%decoded) + message%k=len_trim(message%decoded) + message%trailing_sep=candidate%trailing_sep + + next_message_id=next_message_id+1_int64 + call queue_message_update(message,candidate%is_last_frame) + if(.not.candidate%is_last_frame) then + nactive=nactive+1 + active_messages(nactive)=message + endif + accepted=.true. + end subroutine start_message + + subroutine append_active_message(index,candidate,nframes_gap,message,accepted) + integer, intent(in) :: index,nframes_gap + type(decode), intent(in) :: candidate + type(message_assembly), intent(out) :: message + logical, intent(out) :: accepted + integer :: k,kz,n,nchar,nstart + + message=message_assembly() + accepted=.false. + if(index.lt.1 .or. index.gt.nactive) return + call remember_recent_frame(candidate) + + k=active_messages(index)%k + n=len_trim(candidate%decoded) + if(nframes_gap.gt.1) then + nstart=1 + if(n.ge.1) then + if(candidate%decoded(1:1).eq.'~') nstart=2 + endif + kz=min(k+5+(n-nstart+1),80) + nchar=max(kz-k-5,0) + active_messages(index)%decoded=trim(active_messages(index)%decoded)// & + '~~~~~'//candidate%decoded(nstart:nstart+nchar-1) + active_messages(index)%k=k+5+nchar + else + kz=min(k+n,80) + if(active_messages(index)%trailing_sep) then + active_messages(index)%decoded=trim(active_messages(index)%decoded)// & + ' '//candidate%decoded(1:kz-k) + else + active_messages(index)%decoded=trim(active_messages(index)%decoded)// & + candidate%decoded(1:kz-k) + endif + active_messages(index)%k=kz + endif + active_messages(index)%trailing_sep=candidate%trailing_sep + active_messages(index)%f1=candidate%f1 + active_messages(index)%tsync=candidate%tsync + call queue_message_update(active_messages(index),candidate%is_last_frame) + message=active_messages(index) + if(candidate%is_last_frame) call remove_active_message(index) + accepted=.true. + end subroutine append_active_message + + subroutine prune_receive_state(forward_tsync,frame_period) + real, intent(in) :: forward_tsync,frame_period + real :: oldest_revisit + integer :: i,keep + + oldest_revisit=forward_tsync-real(MAX_RETRO_STEPS)*frame_period/4.0 + ! Retro candidates move backward in time, so only the forward watermark may expire history. + keep=0 + do i=1,nrecent + if(recent_frames(i)%tsync.lt. & + oldest_revisit-FRAME_HISTORY_TIME_TOLERANCE) cycle + keep=keep+1 + if(keep.ne.i) recent_frames(keep)=recent_frames(i) + enddo + nrecent=keep + + i=1 + do while(i.le.nactive) + if(oldest_revisit-active_messages(i)%tsync.gt. & + real(MAX_CONTINUATION_GAP)*frame_period+ & + CONTINUATION_TIME_TOLERANCE) then + call queue_message_update(active_messages(i),.false.) + call remove_active_message(i) + else + i=i+1 + endif + enddo + end subroutine prune_receive_state + subroutine jtty_tbcc_reencode_for_subtraction(payload, tones) + integer, intent(in) :: payload(PAYLOAD_BITS) + integer, intent(out) :: tones(TOTAL_K) + + call tbcc_encode(payload, tones, JTTY_TBCC_PROFILE_1167_1545_80F) + end subroutine jtty_tbcc_reencode_for_subtraction + + pure subroutine jtty_search_window(fc,fwid,nfa,nfb,constrain_to_graph,df, & + first_bin,last_bin,ja,jb,usable) + implicit none + real, intent(inout) :: fc + real, intent(in) :: fwid,df + integer, intent(in) :: nfa,nfb,first_bin,last_bin + integer, intent(out) :: ja,jb + logical, intent(in) :: constrain_to_graph + logical, intent(out) :: usable + + ja=first_bin + jb=last_bin + usable=.false. + if(df.le.0.0 .or. fwid.lt.0.0 .or. first_bin.gt.last_bin) return + + if(constrain_to_graph) then + if(nfa.gt.nfb) return + fc=max(real(nfa),min(fc,real(nfb))) + endif + + ja=max(first_bin,int((fc-fwid)/df)) + jb=min(last_bin,int((fc+fwid)/df)) + if(constrain_to_graph) then + ja=max(ja,ceiling(real(nfa)/df)) + jb=min(jb,floor(real(nfb)/df)) + endif + usable=ja.le.jb + end subroutine jtty_search_window + + pure subroutine classify_active_candidate(existing,candidate,frame_period, & + match,is_window_dupe,nframes_gap) + type(message_assembly), intent(in) :: existing + type(decode), intent(in) :: candidate + real, intent(in) :: frame_period + logical, intent(out) :: match,is_window_dupe + integer, intent(out) :: nframes_gap + real :: df1,dtsync,qstep,resid,fp_resid,df_tol + integer :: nstep,nfp + + df1=candidate%f1-existing%f1 + dtsync=candidate%tsync-existing%tsync + match=.false. + nframes_gap=1 + nfp=nint(dtsync/frame_period) + fp_resid=abs(dtsync-frame_period*nfp) + if(nfp.ge.1 .and. nfp.le.MAX_CONTINUATION_GAP .and. & + fp_resid.lt.CONTINUATION_TIME_TOLERANCE) then + df_tol=10.0+3.0*real(nfp-1) + match=abs(df1).lt.df_tol + if(match) nframes_gap=nfp + endif + + ! Retro sweeps revisit only the preceding three quarter-frame windows. + is_window_dupe=.false. + if(.not.match) then + qstep=frame_period/4.0 + nstep=nint(dtsync/qstep) + resid=abs(dtsync-qstep*nstep) + if(abs(nstep).le.MAX_RETRO_STEPS .and. abs(df1).lt.10.0 .and. & + resid.lt.0.003 .and. & + .not.(mod(abs(nstep),4).eq.0 .and. nstep.ne.0)) then + match=.true. + is_window_dupe=.true. + endif + endif + + end subroutine classify_active_candidate + + subroutine jtty_mdecode(istart,istart0,iwave,nchunk,nsps,ndebug,nfa,nfb,f0,ftol,smin) + +! First try at a multi-decoder for JTTY - replaces the single-decode version in +! jtty_decode.f90. Does not pass decodes back to rjtty_sub yet - just prints +! results to the console + +! Note: nsps is samples per symbol at 12000 s^-1 sample rate. + use iso_fortran_env, only: int16 + use jtty_mod + use jtty_fec + implicit none + integer, parameter :: MAXCAND = 100 + integer, parameter :: NSYNC_SYM = 13 + integer, parameter :: NCHAN_SYM = 46 + integer, parameter :: NFRAME_SYM = 59 + real, parameter :: FSAMPLE = 6000.0 + real, parameter :: TWOPI = 6.283185307179586 + character(len=80) :: msg + character(len=34) :: c32(MAX_FRAMES) + integer :: final_payload(PAYLOAD_BITS), tone_symbols_chk(NCHAN_SYM) + integer :: tone_symbols_full(NFRAME_SYM), ipass + integer(int16), intent(in) :: iwave(nchunk) + integer, intent(in) :: istart, istart0, ndebug + integer :: i,i0,is,j,ja,jb + integer, save :: ntstep, ntgrid + integer :: istep,first_sync_bin,last_sync_bin + integer :: nchan, ichan + integer, intent(in) :: nchunk,nsps !size of chunk, nsps at 12000 Sa/s + integer, intent(in) :: nfa,nfb !Wide Graph freq range + integer :: nchunk6,nana !size of chunk, nana at 6000 Sa/s + integer, save :: nframe6 !size of frame at 6000 Sa/s + integer, save :: nsps0=-999 + type(jtty_payload_correlator), save :: payload_correlator + integer, save :: nfft,nh2,nss + integer :: iloc(1) + integer :: irxsync(NSYNC_SYM), irxchan(NCHAN_SYM) + integer :: iactive + integer :: nsloc(2),nfz,ntz,ncand,ic,nc,nstep_search + integer :: nc0,n_ch0_ok + integer :: ja_ch0_ok(16),jb_ch0_ok(16) + real :: f1_ch0_ok(16),tsync_ch0_ok(16) + integer :: nsync,nsymerrs + real :: fc,fwid + real :: fpk,pa,pt,pn + real :: fbest,xdtbest + real :: xdt_retry + real, allocatable, save :: s0(:,:) + logical, allocatable, save :: mask0(:,:) + real :: a(3) + real :: pow(0:3,NCHAN_SYM) + real, save :: baud,dt,df2 + real :: phi,dphi + real, external :: db + real, intent(in) :: f0,ftol,smin + real :: snrdb, xdt + real :: xdt1, f11, snr0 + complex, allocatable,save,target :: c(:) + complex, allocatable,save :: c0(:) + complex, allocatable,save :: c1(:) + complex, allocatable,save :: csync(:) !Waveform for sync at 6000 s^-1 sample rate + complex, allocatable,save :: ctones(:,:) + complex :: z + logical :: match + logical :: dupe + logical :: usable + logical :: is_window_dupe + logical :: is_pure_dupe + logical :: success_dec + logical :: channel_decoded, decoded_ok + logical :: any_subtracted + logical :: s0_valid + integer :: ir + type(decode) :: cand(MAXCAND) !Candidates for decoding + type(decode) :: dec !Current successful decode + logical :: use_interferer + real :: use_interferer_f1, use_interferer_tsync + integer :: use_interferer_payload(PAYLOAD_BITS) + +! Capture and clear the retro-resweep interferer request (if any) as the +! very first thing this call does, before any possible early return below +! -- otherwise a stale request could leak into a later, unrelated call. + use_interferer=interferer_pending + use_interferer_f1=interferer_f1 + use_interferer_tsync=interferer_tsync + use_interferer_payload=interferer_payload + interferer_pending=.false. + nsubtracted=0 + + nsync=0 + + if(istart.eq.istart0 .and. .not.use_interferer) then + ndecodes=0 + call reset_decode_search_state() + endif + if(sum(abs(int(iwave))).eq.0) return + + nchunk6=nchunk/2 ! chunk size at 6000 Sa/s +! nana is the size of c0 - next power of 2 larger than nchunk + nana = 2**nint(log(real(nchunk))/log(2.0)+0.5) + + if(nsps.ne.nsps0) then + nsps0=nsps + nss=nsps/2 ! samples per symbol at 6000 sa/s + nfft=8192 ! FFT size for sync search, gives df2=0.732 + df2=FSAMPLE/nfft + nh2=nfft/2 ! spectrum size for sync search + nframe6=NFRAME_SYM*nss ! frame size at 6000 Sa/s + ntstep=nframe6/4 + ntgrid=ntstep/12 + +! allocate saved arrays once + if(allocated(csync)) deallocate(csync) + allocate(csync(0:NSYNC_SYM*nss-1)) + if(allocated(ctones)) deallocate(ctones) + allocate(ctones(0:nss-1,0:3)) + if(allocated(c0)) deallocate(c0) + allocate(c0(0:nana-1)) + if(allocated(c)) deallocate(c) + allocate(c(0:nfft-1)) ! + if(allocated(c1)) deallocate(c1) + allocate(c1(0:nchunk6-1)) + if(allocated(s0)) deallocate(s0) + allocate(s0(0:nh2,0:ntgrid)) + s0=0. + if(allocated(mask0)) deallocate(mask0) + allocate(mask0(0:nh2,0:ntgrid)) + +! Generate complex waveform for sync + baud=FSAMPLE/real(nss) !31.25 for nss=192 + dt=1/FSAMPLE + call gen_syncwave(csync,nss) + + do i=0,3 + phi=0.0 + dphi=i*TWOPI/real(nss) + do j=0,nss-1 + ctones(j,i)=cmplx(cos(phi),sin(phi)) + phi=phi+dphi + enddo + enddo + endif + + call jtty_payload_correlator_prepare(payload_correlator,nss) + +! convert integer samples at 12K Sa/s to complex analytic signal at 6K Sa/s + call ana64a(iwave,nchunk,c0,nana) + c0(nchunk6:)=0. + + if(use_interferer) then + ! Retro re-sweep call: subtract the already-known signal out of + ! this window's own c0 before searching, on the theory that this + ! window's own candidates (whose frame spans reach ~ntstep to + ! nframe6 forward of this window's own [0,ntstep] search range) + ! may have been corrupted by that signal's energy even though this + ! window never itself searched for that signal's own sync. See + ! jtty_mdecode_step. + tone_symbols_full(1:NSYNC_SYM)=is13 + call jtty_tbcc_reencode_for_subtraction(use_interferer_payload, tone_symbols_chk) + tone_symbols_full(NSYNC_SYM+1:NFRAME_SYM)=tone_symbols_chk + call subtract_jtty(c0, nana, nchunk6, tone_symbols_full, NFRAME_SYM, & + nss, use_interferer_f1, use_interferer_tsync-(istart-1)/12000.0) + endif + +! Look for up to 2 sync candidates in each quarter-frame (0.424 second) by 2*FTol rectangle in +! the time/frequency plane. Find the peak in the search rectangle, then zero a small region +! of size nfz by ntz centered on the peak location and find the location of the next peak. + + nfz=nint(10.0/df2) ! 14 + ntz=nint(0.016*6000.0/12.0) ! 8 + + ! Every channel reads inside this span; unsearched bins may remain stale. + nchan=2 + first_sync_bin=nh2-2 + last_sync_bin=3 + do ichan=0,nchan + call channel_window() + if(.not.usable) cycle + first_sync_bin=min(first_sync_bin,ja) + last_sync_bin=max(last_sync_bin,jb) + enddo + + nc=2 ! look for 2 candidates in each channel + ncand=0 + any_subtracted=.false. + s0_valid=.false. + + ! Phase A: channel 0 gets first claim on every signal -- runs its own + ! full up-to-2-pass sweep to completion, accumulating n_ch0_ok across + ! both passes, before channels 1/2 (Phase B) ever run. + n_ch0_ok=0 + do ipass=1,2 + if(ipass.eq.2 .and. .not.any_subtracted) exit + if(.not.s0_valid) call build_s0() + ichan=0 + call process_channel() + enddo + + ! Channel 0 masks candidates privately, so an unchanged surface can + ! also serve channels 1/2. Their suppression modifies s0 directly. + any_subtracted=.false. + do ipass=1,2 + if(ipass.eq.2 .and. .not.any_subtracted) exit + if(.not.s0_valid) call build_s0() + do ichan=1,nchan + call process_channel() + enddo + s0_valid=.false. + enddo + + return + + contains + + subroutine build_s0() + use fftw3, only: fftwf_execute_dft + real(8), parameter :: CHIRP_TWOPI=6.2831853071795864769d0 + real(8) :: phase + real :: p0,p1,p2,p3,p4,chirp_scale + integer :: chirp_nfft,output_count,convolution_length + integer :: sync_fft_order + integer :: index,distance,first_output_bin + complex :: cz + complex, pointer :: fft_output(:) + logical :: use_chirp,full_fft_available + ! Rebuild s0, the FFT-correlation sync-search surface, from the + ! current c0 (may already reflect earlier-phase subtractions). + first_output_bin=first_sync_bin-2 + output_count=last_sync_bin-first_sync_bin+5 + convolution_length=NSYNC_SYM*nss+output_count-1 + chirp_nfft=1 + do while(chirp_nfft.lt.convolution_length) + chirp_nfft=2*chirp_nfft + enddo + use_chirp=output_count.gt.0 .and. & + chirp_nfft.lt.nfft .and. chirp_nfft.le.nfft/2 + + if(use_chirp) & + use_chirp=ensure_sync_fft_cache(chirp_nfft,.true.,sync_fft_order) + if(use_chirp .and. (sync_chirp_samples.ne.NSYNC_SYM*nss .or. & + sync_chirp_first_bin.ne.first_output_bin .or. & + sync_chirp_output_count.ne.output_count)) then + if(allocated(sync_chirp_weights)) deallocate(sync_chirp_weights) + if(allocated(sync_chirp_kernel)) deallocate(sync_chirp_kernel) + allocate(sync_chirp_weights(0:NSYNC_SYM*nss-1)) + allocate(sync_chirp_kernel(0:chirp_nfft-1)) + do index=0,NSYNC_SYM*nss-1 + phase=-CHIRP_TWOPI*(dble(first_output_bin)*dble(index)+ & + 0.5d0*dble(index)*dble(index))/dble(nfft) + sync_chirp_weights(index)=conjg(csync(index))* & + cmplx(cos(phase),sin(phase)) + enddo + sync_fft_caches(sync_fft_order)%input=0. + do distance=0,max(NSYNC_SYM*nss,output_count)-1 + phase=0.5d0*CHIRP_TWOPI*dble(distance)*dble(distance)/dble(nfft) + if(distance.lt.output_count) & + sync_fft_caches(sync_fft_order)%input(distance)= & + cmplx(cos(phase),sin(phase)) + if(distance.gt.0 .and. distance.lt.NSYNC_SYM*nss) & + sync_fft_caches(sync_fft_order)%input(chirp_nfft-distance)= & + cmplx(cos(phase),sin(phase)) + enddo + call fftwf_execute_dft(sync_fft_caches(sync_fft_order)%forward, & + sync_fft_caches(sync_fft_order)%input, & + sync_fft_caches(sync_fft_order)%spectrum) + sync_chirp_kernel=sync_fft_caches(sync_fft_order)%spectrum + sync_chirp_samples=NSYNC_SYM*nss + sync_chirp_first_bin=first_output_bin + sync_chirp_output_count=output_count + endif + + ! Wider searches retain the full FFT path. + full_fft_available=.false. + if(.not.use_chirp) & + full_fft_available=ensure_sync_fft_cache(nfft,.false.,sync_fft_order) + if(use_chirp) then + sync_fft_caches(sync_fft_order)%input(NSYNC_SYM*nss:)=0. + chirp_scale=1.0/real(chirp_nfft) + else if(full_fft_available) then + ! Preserving the input keeps this padding intact for every time column. + sync_fft_caches(sync_fft_order)%input(NSYNC_SYM*nss:)=0. + endif + if(full_fft_available) then + fft_output=>sync_fft_caches(sync_fft_order)%spectrum + else + fft_output=>c + endif + istep=0 + do i0=0,ntstep,12 !Search over quarter-frame segment + xdt=i0*dt + if(use_chirp) then + sync_fft_caches(sync_fft_order)%input(0:NSYNC_SYM*nss-1)= & + sync_chirp_weights* & + c0(i0:i0+NSYNC_SYM*nss-1) + call fftwf_execute_dft(sync_fft_caches(sync_fft_order)%forward, & + sync_fft_caches(sync_fft_order)%input, & + sync_fft_caches(sync_fft_order)%spectrum) + sync_fft_caches(sync_fft_order)%spectrum= & + sync_fft_caches(sync_fft_order)%spectrum*sync_chirp_kernel + call fftwf_execute_dft(sync_fft_caches(sync_fft_order)%backward, & + sync_fft_caches(sync_fft_order)%spectrum, & + sync_fft_caches(sync_fft_order)%inverse) + ! Bluestein's omitted output chirp has unit magnitude. + cz=sync_fft_caches(sync_fft_order)%inverse(0)*chirp_scale + p0=real(cz)**2+aimag(cz)**2 + cz=sync_fft_caches(sync_fft_order)%inverse(1)*chirp_scale + p1=real(cz)**2+aimag(cz)**2 + cz=sync_fft_caches(sync_fft_order)%inverse(2)*chirp_scale + p2=real(cz)**2+aimag(cz)**2 + cz=sync_fft_caches(sync_fft_order)%inverse(3)*chirp_scale + p3=real(cz)**2+aimag(cz)**2 + do j=first_sync_bin,last_sync_bin + cz=sync_fft_caches(sync_fft_order)%inverse( & + j-first_sync_bin+4)*chirp_scale + p4=real(cz)**2+aimag(cz)**2 + s0(j,istep)=p0+2*p1+3*p2+2*p3+p4 + p0=p1 + p1=p2 + p2=p3 + p3=p4 + enddo + else + if(full_fft_available) then + sync_fft_caches(sync_fft_order)%input(0:NSYNC_SYM*nss-1)= & + conjg(csync(0:NSYNC_SYM*nss-1))*c0(i0:i0+NSYNC_SYM*nss-1) + call fftwf_execute_dft(sync_fft_caches(sync_fft_order)%forward, & + sync_fft_caches(sync_fft_order)%input, & + sync_fft_caches(sync_fft_order)%spectrum) + else + c=0. + c(0:NSYNC_SYM*nss-1)=conjg(csync(0:NSYNC_SYM*nss-1))* & + c0(i0:i0+NSYNC_SYM*nss-1) + call four2a(c,nfft,1,-1,1) + endif + ! Keep the two-bin halo while advancing the five-bin smoothing kernel. + p0=real(fft_output(first_sync_bin-2))**2+ & + aimag(fft_output(first_sync_bin-2))**2 + p1=real(fft_output(first_sync_bin-1))**2+ & + aimag(fft_output(first_sync_bin-1))**2 + p2=real(fft_output(first_sync_bin))**2+ & + aimag(fft_output(first_sync_bin))**2 + p3=real(fft_output(first_sync_bin+1))**2+ & + aimag(fft_output(first_sync_bin+1))**2 + do j=first_sync_bin,last_sync_bin + p4=real(fft_output(j+2))**2+aimag(fft_output(j+2))**2 + s0(j,istep)=p0+2*p1+3*p2+2*p3+p4 + p0=p1 + p1=p2 + p2=p3 + p3=p4 + enddo + endif + istep=istep+1 + enddo + nstep_search=istep-1 + s0_valid=.true. + end subroutine build_s0 + + subroutine channel_window() + if(ichan.eq.0) then + fc=f0 + fwid=ftol + else + fc=1350 + if(ichan.eq.2) fc=1650 + fwid=150 + endif + call jtty_search_window(fc,fwid,nfa,nfb,ichan.ne.0,df2,3, & + ubound(s0,1)-2,ja,jb,usable) + end subroutine channel_window + + subroutine process_channel() + ! One channel's candidate search plus sticky-sync retry, for the + ! host's current ichan/ipass (host-associated with jtty_mdecode). + call channel_window() + if(.not.usable) return + nc0=nc + ! A wide QSO band needs more candidates to avoid crowding out its signal. + if(ichan.eq.0) nc0=max(2, min(8, nint(fwid/(nfz*df2)))) + fbest=0. + xdtbest=0. + fpk=0. + channel_decoded=.false. + + if(ichan.ne.0 .and. n_ch0_ok.gt.0) then + ! Erase only channel 0's actual successful-decode neighborhoods + ! (not its whole nominal band) so channels 1/2 can't rediscover + ! them, while staying free to catch what channel 0 missed. + do i=1,n_ch0_ok + if(max(ja,ja_ch0_ok(i)) .le. min(jb,jb_ch0_ok(i))) & + s0(max(ja,ja_ch0_ok(i)):min(jb,jb_ch0_ok(i)),0:nstep_search) = 0.0 + enddo + endif + + if(ichan.eq.0) mask0(ja:jb,0:nstep_search)=.true. + + do ic=1,nc0 + if(ichan.eq.0) then + ! Channel 0 uses a private mask instead of zeroing s0 + ! directly, so candidates that never pass the decode gate + ! don't eat into channels 1/2's shared search surface. + nsloc=maxloc(s0(ja:jb,0:nstep_search), & + mask=mask0(ja:jb,0:nstep_search)) + mask0( max( ja, nsloc(1)-nfz+ja ) : min( jb, nsloc(1)+nfz+ja ), & + max( 0, nsloc(2)-ntz ) : min( nstep_search, nsloc(2)+ntz ) ) = .false. + else + nsloc=maxloc(s0(ja:jb,0:nstep_search)) + s0( max( ja, nsloc(1)-nfz+ja ) : min( jb, nsloc(1)+nfz+ja ), & + max( 0, nsloc(2)-ntz ) : min( nstep_search, nsloc(2)+ntz ) ) = 0.0 + endif + fbest = (nsloc(1)-1+ja)*df2 + xdtbest = (nsloc(2)-1)*dt*12 + + if(ichan.eq.0) then + call jtty_peakup(c0,c1,csync,nchunk6, nss, xdtbest, fbest, xdt1, f11, snr0) + xdtbest=xdt1 + fbest=f11 + endif + + if(ncand .ge. MAXCAND) exit + ncand=ncand+1 + cand(ncand)%xdt=xdtbest + cand(ncand)%f1=fbest + + a=0. + a(1)=-cand(ncand)%f1 !Shift peak to zero frequency + call twkfreq(c0,c1,nchunk6,6000.0,a) + + pt=0. + pa=0. + pow=0.0 + do j=1,NSYNC_SYM ! find tone powers for sync symbols + i0=nint(cand(ncand)%xdt/dt) + (j-1)*nss + if(i0+nss.gt.nchunk6) exit + + do i=0,3 + z = dot_product(ctones(0:nss-1,i), c1(i0:i0+nss-1)) + pow(i,j)=real(z*conjg(z)) + enddo + + iloc=maxloc(pow(:,j))-1 + irxsync(j)=iloc(1) + pt=pt+pow(is13(j),j) !signal plus noise + pa=pa+sum(pow(:,j)) !signal plus 4*noise + enddo + + snrdb=-99.9 + pn=(pa-pt)/3.0 + if(pn.gt.0.) snrdb=db(pt/pn) + nsync=count(is13.eq.irxsync) ! nsync is the number of correct hard-decoded sync tones. + cand(ncand)%snrdb=snrdb + + if( ichan.eq.0 .and. (nsync .le. 6 .or. snrdb .lt. smin)) cycle + if( ichan.ne.0 .and. (nsync .le. 8 .or. snrdb .lt. 5.0)) cycle + +! looks like a real candidate - try to decode + call decode_and_merge(ic, decoded_ok) + if(decoded_ok) call record_ch0_success() + if(decoded_ok) channel_decoded=.true. + enddo ! candidate loop + + if(.not.channel_decoded) then + ! Sticky-sync retry: nothing decoded this call. If an active + ! message's continuation frame is due almost exactly one frame + ! period ago, retry the FEC decode directly at that remembered + ! sync point instead of giving up on it. + do ir=1,nactive + if(active_messages(ir)%f1.lt.fc-fwid .or. & + active_messages(ir)%f1.gt.fc+fwid) cycle + if(abs(((istart-1)/12000.0 - active_messages(ir)%tsync) - & + nframe6/6000.0) & + .gt. 0.1) cycle + ! Derive the local offset from absolute sync time because the + ! assembly may have been updated from a different decode window. + xdt_retry=active_messages(ir)%tsync + nframe6/6000.0 - & + (istart-1)/12000.0 + if(xdt_retry.lt.0.0) cycle + if(ncand .ge. MAXCAND) exit + ncand=ncand+1 + cand(ncand)%xdt=xdt_retry + cand(ncand)%f1=active_messages(ir)%f1 + ! decode_and_merge reads tone powers from c1, which is only + ! valid for whichever frequency the blind-candidate loop + ! above last shifted it to -- re-shift it for this retry's + ! own frequency, or it silently correlates against the wrong + ! signal (dchristle, PR #337). + a=0. + a(1)=-cand(ncand)%f1 + call twkfreq(c0,c1,nchunk6,6000.0,a) + nsync=-1 ! not meaningful for a sticky-sync retry; flags it in ndebug output + call decode_and_merge(-1, decoded_ok) + if(decoded_ok) call record_ch0_success() + if(decoded_ok) channel_decoded=.true. + exit ! at most one retry attempt per channel per call + enddo + endif + end subroutine process_channel + + subroutine record_ch0_success() + ! Record channel 0's successful-decode neighborhood so Phase B can + ! avoid it, and decode_and_merge's dedup check can catch it too. + if(ichan.ne.0) return + if(n_ch0_ok.ge.16) return + n_ch0_ok=n_ch0_ok+1 + ja_ch0_ok(n_ch0_ok)=nint(cand(ncand)%f1/df2)-nfz + jb_ch0_ok(n_ch0_ok)=nint(cand(ncand)%f1/df2)+nfz + f1_ch0_ok(n_ch0_ok)=cand(ncand)%f1 + tsync_ch0_ok(n_ch0_ok)=cand(ncand)%tsync + end subroutine record_ch0_success + + subroutine decode_and_merge(ic_label, decoded_ok) + ! Shared by the candidate loop and the sticky-sync retry: given + ! cand(ncand)%xdt/%f1, decode the 46 info symbols and merge into + ! active_messages(:). ic_label is only for the ndebug print (-1 for a retry). + integer, intent(in) :: ic_label + logical, intent(out) :: decoded_ok + complex :: zsym(0:3,NCHAN_SYM) + complex :: zhalf(0:3,NCHAN_SYM) + integer :: payload_start + integer :: best_cont + real :: best_df,dfabs + logical :: have_win,accepted,source_valid + integer :: gap,best_gap + type(message_assembly) :: accepted_message + + decoded_ok=.false. + payload_start=nint(cand(ncand)%xdt/dt) + NSYNC_SYM*nss + call jtty_correlate_payload_symbols(payload_correlator,c1,payload_start,zsym,zhalf) + call jtty_tbcc_decode(zsym,zhalf,final_payload,success_dec) + ! Half-symbol off-tone leakage is not a noise estimate; diagnostics use M1. + pow=abs(zsym)**2 + do j=1,NCHAN_SYM + iloc=maxloc(pow(:,j))-1 + irxchan(j)=iloc(1) + enddo + cand(ncand)%decoded=' ' + if( .not. success_dec ) return + + write(c32(1),'(34i1)') final_payload + call unpack_jtty(c32,1,cand(ncand)%decoded,cand(ncand)%trailing_sep, & + cand(ncand)%is_last_frame,source_valid) + if(.not.source_valid) return + + ndecodes=ndecodes+1 + ! Re-encode the decoded payload to recover the expected tone + ! per symbol, for the symbol-error-count/SNR diagnostic below + ! (mirrors what the old LDPC path got for free from its own + ! codeword bits). + call jtty_tbcc_reencode_for_subtraction(final_payload, tone_symbols_chk) + nsymerrs=13-nsync + do j = 1, NCHAN_SYM + is=tone_symbols_chk(j) + if(is.ne.irxchan(j)) nsymerrs=nsymerrs+1 + pt=pt+pow(is,j) + pa=pa+sum(pow(:,j)) + enddo + pn=(pa-pt)/3.0 + if(pn.gt.0.) then + snrdb=db(pt/pn) + cand(ncand)%snrdb=snrdb + endif + cand(ncand)%tsync=(istart-1)/12000.0 + cand(ncand)%xdt + decoded_ok=.true. + +! dupe detection + dupe=.false. + do i=1,ncand-1 + if( cand(i)%decoded .eq. cand(ncand)%decoded .and. & + abs(cand(i)%tsync - cand(ncand)%tsync).lt. 0.032 ) dupe=.true. + enddo + ! A channel-1/2 candidate matching a frame channel 0 already decoded + ! this call is sync-estimation noise, not a distinct signal. 3.0 Hz + ! tracks jtty_peakup's coherent-combining frequency precision. + if(ichan.ne.0) then + do i=1,n_ch0_ok + if(same_frame(cand(ncand)%f1,cand(ncand)%tsync, & + f1_ch0_ok(i),tsync_ch0_ok(i))) dupe=.true. + enddo + endif + if(dupe) return + + ! Subtract this signal from c0 so a second, weaker one underneath can + ! be found by a follow-up sweep over the residual (see the ipass loop + ! in jtty_mdecode). tone_symbols_full is the re-encoded, error- + ! corrected full frame (sync + info), matching what genjtty.f90 + ! assembles for TX. + tone_symbols_full(1:NSYNC_SYM)=is13 + tone_symbols_full(NSYNC_SYM+1:NFRAME_SYM)=tone_symbols_chk + call subtract_jtty(c0, nana, nchunk6, tone_symbols_full, NFRAME_SYM, & + nss, cand(ncand)%f1, cand(ncand)%xdt) + any_subtracted=.true. + s0_valid=.false. + + if(nsubtracted.lt.MAX_SUBTRACTED) then + nsubtracted=nsubtracted+1 + subtracted_f1(nsubtracted)=cand(ncand)%f1 + subtracted_tsync(nsubtracted)=cand(ncand)%tsync + subtracted_payload(:,nsubtracted)=final_payload + endif + + dec=cand(ncand) + match=.false. + is_pure_dupe=is_recent_frame(dec) + iactive=0 + if(.not.is_pure_dupe .and. nactive.gt.0) then + have_win=.false. + best_cont=0 + best_df=1.0e30 + best_gap=1 + do i=1,nactive + call classify_active_candidate(active_messages(i),dec, & + nframe6/6000.0,match,is_window_dupe,gap) + if(.not.match) cycle + if(is_window_dupe) then + if(.not.have_win) iactive=i + have_win=.true. + cycle + endif + dfabs=abs(dec%f1-active_messages(i)%f1) + if(dfabs.lt.best_df) then + best_df=dfabs + best_cont=i + best_gap=gap + endif + enddo + if(have_win) then + match=.true. + is_pure_dupe=.true. + else if(best_cont.gt.0) then + match=.true. + iactive=best_cont + else + match=.false. + endif + endif + + if(.not.is_pure_dupe .and. match) then + call append_active_message(iactive,dec,best_gap,accepted_message,accepted) + if(.not.accepted) return + msg=accepted_message%decoded + if(dec%is_last_frame) iactive=0 + else if(.not.is_pure_dupe) then + call start_message(dec,accepted_message,accepted) + if(.not.accepted) return + msg=accepted_message%decoded + if(dec%is_last_frame) then + iactive=0 + else + iactive=nactive + endif + else + msg=dec%decoded + endif + msg=display_message_text(msg) + if(ndebug.eq.0) then + if(.not.is_pure_dupe) write(*,3001) nint(dec%f1),trim(msg) +3001 format(i4,2x,a) + else if(ndebug.gt.0) then + write(*,3002) ichan,ipass,ic_label,ndecodes,iactive,nactive,match, & + use_interferer,dec%f1,dec%xdt,dec%tsync,nint(dec%snrdb-20.0), & + nsync,nsymerrs,trim(msg) +3002 format(6i4,2L3,f7.1,f7.3,f9.3,i5,i4,i4,2x,a) + endif + end subroutine decode_and_merge + + end subroutine jtty_mdecode + + subroutine jtty_mdecode_step(iwave,nwave,istart,istart0,nchunk,nsps,ndebug,nfa,nfb,f0,ftol,smin) + +! Wraps jtty_mdecode with "retro" re-sweeps: after the normal forward call, +! re-run the candidate sweep for up to 3 prior quarter-frame windows for +! every signal this call newly subtracted, since their candidates' frame +! spans could overlap that signal's energy. Not cascaded to further retro +! passes. Both rjtty_sub and rjtty call this instead of jtty_mdecode +! directly, passing the FULL buffer so retro calls can reach backward into it. + + use iso_fortran_env, only: int16 + implicit none + integer, intent(in) :: nwave + integer(int16), intent(in) :: iwave(nwave) + integer, intent(in) :: istart, istart0, nchunk, nsps, ndebug, nfa, nfb + real, intent(in) :: f0, ftol, smin + integer :: n_local, nframe, step, istart_prev, k, i + real :: f1_local(MAX_SUBTRACTED) + real :: tsync_local(MAX_SUBTRACTED) + integer :: payload_local(PAYLOAD_BITS,MAX_SUBTRACTED) + + nframe=59*nsps + step=nframe/4 + call prune_receive_state((istart-1)/12000.0,nframe/12000.0) + + interferer_pending=.false. ! defensive: no stale interferer input + call jtty_mdecode(istart,istart0,iwave(istart),nchunk,nsps,ndebug,nfa,nfb, & + f0,ftol,smin) + +! Copy this call's subtraction events out before any retro call below +! overwrites the same module-level output arrays with its own results. + n_local=nsubtracted + if(n_local.gt.0) then + f1_local(1:n_local)=subtracted_f1(1:n_local) + tsync_local(1:n_local)=subtracted_tsync(1:n_local) + payload_local(:,1:n_local)=subtracted_payload(:,1:n_local) + endif + + do i=1,n_local + do k=1,MAX_RETRO_STEPS + istart_prev=istart-k*step + if(istart_prev.lt.1) cycle + interferer_pending=.true. + interferer_f1=f1_local(i) + interferer_tsync=tsync_local(i) + interferer_payload=payload_local(:,i) + call jtty_mdecode(istart_prev,istart0,iwave(istart_prev),nchunk,nsps, & + ndebug,nfa,nfb,f0,ftol,smin) + enddo + enddo + + return + end subroutine jtty_mdecode_step + +end module jtty_mdec diff --git a/lib/jtty/jtty_mod.f90 b/lib/jtty/jtty_mod.f90 new file mode 100644 index 00000000..7ff25b5b --- /dev/null +++ b/lib/jtty/jtty_mod.f90 @@ -0,0 +1,447 @@ +module jtty_mod + + use jtty_source_codec + + parameter (MAX_FRAMES=16) !Max frames for the encoded message + character(len=*), parameter :: JTTY_ALPHABET = ALPHABET + integer, parameter :: JTTY_EXCHANGE_UNKNOWN=0,JTTY_EXCHANGE_FIELD_DAY=1,JTTY_EXCHANGE_RTTY=2 + +contains + +subroutine pack_jtty(message,c32,nframes,exchange_profile) + +! Input: character*80 message !JTTY message, as it appears to a user +! Output: character*34 c32 !34-bit payload: 32 bits of existing +! !grammar (unchanged) + 1 "last frame +! !of this message" flag (c32(:)(34:34)) +! !+ 1 reserved bit, always '0' +! !(c32(:)(33:33)), that the decoder +! !uses as a free extra check beyond +! !the CRC. +! integer nframes !Frames in this message (max = 16) +! +! Minimize frames after alphabet and exchange-profile normalization. + + use packjt77_grammar, only: pack77_arrl_section_index + implicit none + character*80 message,msg + character*34 c32(MAX_FRAMES) + integer, intent(in), optional :: exchange_profile + integer, parameter :: INF=999 + type(jtty_source_atom) :: choice(80),atoms(MAX_FRAMES) + integer :: dp(81),successor(80),n,ipos,inext,natoms,nframes,profile + logical valid + + call normalize_jtty_message(message,msg) + message=msg + nframes=0 + c32='' + profile=JTTY_EXCHANGE_UNKNOWN + if(present(exchange_profile)) profile=exchange_profile + if(profile.lt.JTTY_EXCHANGE_UNKNOWN .or. profile.gt.JTTY_EXCHANGE_RTTY) then + nframes=-1 + return + endif + if(profile.eq.JTTY_EXCHANGE_RTTY) then + call normalize_serials(valid) + if(.not.valid) then + nframes=-1 + return + endif + endif + message=msg + n=len_trim(msg) + if(n.le.0) return + + ! dp(i) is the minimum frame count for msg(i:n). + dp=INF + successor=0 + dp(n+1)=0 + do ipos=n,1,-1 + inext=min(n+1,ipos+5) + call consider(jtty_text5_atom(msg(ipos:inext-1)),inext) + if(ipos.gt.1) then + if(msg(ipos-1:ipos-1).ne.' ') cycle + endif + call try_compact() + enddo + + if(dp(1).gt.MAX_FRAMES) then + nframes=-1 + return + endif + ipos=1 + natoms=0 + do while(ipos.le.n) + natoms=natoms+1 + atoms(natoms)=choice(ipos) + ipos=successor(ipos) + enddo + call pack_jtty_atoms(atoms,natoms,c32,nframes,valid) + if(.not.valid) then + c32='' + nframes=-1 + endif + +contains + + subroutine normalize_serials(ok) + logical, intent(out) :: ok + character(len=160) :: result + character(len=80) :: rendered + integer :: first,last,next,last_field,value,length + logical :: numeric + + result='' + first=1 + length=len_trim(msg) + do while(first.le.length) + last=index(msg(first:length),' ') + if(last.eq.0) then + last=length + else + last=first+last-2 + endif + rendered=msg(first:last) + next=last+2 + if(rendered.eq.'599' .and. next.le.length) then + last_field=index(msg(next:length),' ') + if(last_field.eq.0) then + last_field=length + else + last_field=next+last_field-2 + endif + call decimal_value(msg(next:last_field),value,numeric) + if(numeric) then + call render_jtty_atom(jtty_exch_num_atom(JTTY_ROLE_FULL,JTTY_NUM_SERIAL,value),rendered,ok) + if(.not.ok) return + next=last_field+2 + endif + endif + if(first.eq.1) then + result=trim(rendered) + else + result=trim(result)//' '//trim(rendered) + endif + if(len_trim(result).gt.len(msg)) then + ok=.false. + return + endif + first=next + enddo + msg=result + ok=.true. + end subroutine normalize_serials + + subroutine consider(atom,next) + type(jtty_source_atom), intent(in) :: atom + integer, intent(in) :: next + integer :: cost,rank,best_rank,key,best_key + + cost=1+dp(next) + if(cost.gt.MAX_FRAMES .or. cost.gt.dp(ipos)) return + rank=merge(1,0,atom%kind.eq.JTTY_ATOM_TEXT5) + best_rank=merge(1,0,choice(ipos)%kind.eq.JTTY_ATOM_TEXT5) + key=100*atom%kind+2*atom%subtype+atom%role + best_key=100*choice(ipos)%kind+2*choice(ipos)%subtype+choice(ipos)%role + if(cost.eq.dp(ipos)) then + if(rank.gt.best_rank) return + if(rank.eq.best_rank) then + if(next.lt.successor(ipos)) return + if(next.eq.successor(ipos) .and. key.ge.best_key) return + endif + endif + dp(ipos)=cost + successor(ipos)=next + choice(ipos)=atom + end subroutine consider + + subroutine offer(atom) + type(jtty_source_atom), intent(in) :: atom + type(jtty_source_atom) :: decoded + character(len=34) :: frame + character(len=80) :: rendered + logical :: ok,eom + integer :: length,last,next + + call pack_jtty_atom(atom,frame,.false.,ok) + if(.not.ok) return + call unpack_jtty_atom(frame,decoded,ok,eom) + if(.not.ok) return + call render_jtty_atom(decoded,rendered,ok) + if(.not.ok) return + length=len_trim(rendered) + if(length.eq.0) return + last=ipos+length-1 + if(last.gt.n) return + if(msg(ipos:last).ne.rendered(1:length)) return + next=n+1 + if(last.lt.n) then + if(msg(last+1:last+1).ne.' ') return + ! Structured frames supply exactly one following separator column. + next=last+2 + endif + call consider(atom,next) + end subroutine offer + + subroutine try_compact() + character(len=80) :: words(3) + integer :: first,last,nwords,j,action,role,field,value,length,section_index + logical :: numeric + + words='' + first=ipos + nwords=0 + do j=1,size(words) + if(first.gt.n) exit + last=index(msg(first:n),' ') + if(last.eq.0) then + last=n + else + last=first+last-2 + endif + nwords=j + words(j)=msg(first:last) + first=last+2 + enddo + + do j=1,nwords + if(len_trim(words(j)).gt.len(choice(1)%text)) cycle + do action=JTTY_CALL_CQ,JTTY_CALL_TU_NOW + call offer(jtty_call_atom(action,trim(words(j)))) + enddo + enddo + do j=lbound(CONTROL_TEXT,1),ubound(CONTROL_TEXT,1) + call offer(jtty_control_atom(j)) + enddo + + do role=JTTY_ROLE_FIELD_ONLY,JTTY_ROLE_FULL + field=1 + if(role.eq.JTTY_ROLE_FULL) then + if(words(1).ne.'599' .or. nwords.lt.2) cycle + field=2 + endif + length=len_trim(words(field)) + call decimal_value(trim(words(field)),value,numeric) + if(numeric) call offer(jtty_exch_num_atom(role,JTTY_NUM_GENERIC,value)) + if(numeric .and. role.eq.JTTY_ROLE_FULL .and. profile.eq.JTTY_EXCHANGE_RTTY) & + call offer(jtty_exch_num_atom(role,JTTY_NUM_SERIAL,value)) + if(length.eq.4) call offer(jtty_grid4_atom(role,words(field)(1:4))) + if(role.ne.JTTY_ROLE_FULL .or. length.lt.2 .or. length.gt.3) cycle + if(scan(trim(words(field)),'ABCDEFGHIJKLMNOPQRSTUVWXYZ').eq.0) cycle + call offer(jtty_exch_loc_atom(role,JTTY_LOC_QTH,trim(words(field)))) + if(profile.eq.JTTY_EXCHANGE_RTTY) & + call offer(jtty_exch_loc_atom(role,JTTY_LOC_STATE_PROVINCE,trim(words(field)))) + enddo + + length=len_trim(words(1)) + if(nwords.lt.2 .or. length.lt.2 .or. length.gt.3) return + call decimal_value(words(1)(1:length-1),value,numeric) + if(.not.numeric) return + section_index=pack77_arrl_section_index(trim(words(2))) + call offer(jtty_class_section_atom(value,words(1)(length:length),section_index)) + end subroutine try_compact + + subroutine decimal_value(text,value,valid) + character(len=*), intent(in) :: text + integer, intent(out) :: value + logical, intent(out) :: valid + integer :: j + + value=0 + valid=.false. + if(len(text).lt.1 .or. len(text).gt.6) return + if(verify(text,'0123456789').ne.0) return + do j=1,len(text) + value=10*value+ichar(text(j:j))-ichar('0') + enddo + valid=value.le.131071 + end subroutine decimal_value + +end subroutine pack_jtty + +logical function jtty_standard_call(c13) + +! True only for tokens safe to carry in a 28-bit structured callsign field. + + use packjt77 + character*13 c13,c13a + character*13 unpacked + character*6 bcall_1 + logical ok1,success + integer*4 n28 + + jtty_standard_call=.false. + c13a=c13 + ! chkcall is a syntax filter; pack28/unpack28 round-trip defines what this + ! protocol field can actually carry. + call chkcall(c13a,bcall_1,ok1) + if(.not.ok1) return + if(index(c13a,'/').gt.0) return + if(c13a(1:1).eq.'Q') return + if(verify(trim(c13a),'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789').ne.0) return + + call pack28(c13a,n28) + call unpack28(n28,unpacked,success) + if(.not.success) return + jtty_standard_call=trim(unpacked).eq.trim(c13a) + +end function jtty_standard_call + +subroutine normalize_jtty_message(raw,normalized) + +! Fold operator text into the source alphabet used by the JTTY encoder. + + character*80 raw,normalized + character*1 c + logical last_space + + normalized='' + last_space=.true. + j=0 + + do i=1,len(raw) + c=raw(i:i) + if(ichar(c).eq.0) c=' ' + ! The decoder uses '~' as a display marker for space, not a source symbol. + if(c.eq.'~') c=' ' + if(c.ge.'a' .and. c.le.'z') c=char(ichar(c)-32) + if(jchar(c).lt.0) c='#' + if(c.eq.' ') then + if(last_space) cycle + j=j+1 + normalized(j:j)=' ' + last_space=.true. + else + j=j+1 + normalized(j:j)=c + last_space=.false. + endif + enddo + +end subroutine normalize_jtty_message + +subroutine unpack_jtty(c32,nframes,message,trailing_sep,is_last_frame,source_valid) + +! Input: character*34 c32 !34-bit payload: 32 bits of existing +! !grammar + 1 reserved bit (33) + 1 +! !"last frame of this message" flag (34) +! integer nframes !Frames in this message (max = 16) +! Output: character*80 message !JTTY message, as it appears to a user +! logical trailing_sep (optional) !True if the last frame +! processed appended an implicit separator column. +! logical is_last_frame (optional) !True if the last frame +! processed had its "last frame of message" flag +! set -- for callers (e.g. jtty_mdecode's slot +! accumulation) that decode one frame at a time and +! need to know when a message is complete. +! +! Frame decoding flow: +! 1. Read the class bits once for each 32-bit payload. +! 2. Dispatch only assigned frame forms. +! 3. Append through one bounds-safe path. + + character*80 message + character*34 c32(MAX_FRAMES) + logical, intent(out), optional :: trailing_sep + logical, intent(out), optional :: is_last_frame + logical, intent(out), optional :: source_valid + + character*80 rendered + type(jtty_source_atom) atom + logical last_frame_sep + logical last_frame_flag + logical frame_valid,render_valid,frame_eom,all_valid + + message='' + k=1 + last_frame_sep=.false. + last_frame_flag=.false. + all_valid=nframes.ge.1 .and. nframes.le.MAX_FRAMES + do iframe=1,max(0,min(nframes,MAX_FRAMES)) + last_frame_sep=.false. + last_frame_flag=.false. + call unpack_jtty_atom(c32(iframe),atom,frame_valid,frame_eom) + if(.not.frame_valid) then + all_valid=.false. + cycle + endif + call render_jtty_atom(atom,rendered,render_valid) + if(.not.render_valid) then + all_valid=.false. + cycle + endif + last_frame_flag=frame_eom + if(atom%kind.eq.JTTY_ATOM_TEXT5) then + call append_payload_chars() + else + call append_text(rendered(1:len_trim(rendered))) + call append_implicit_separator() + endif + + enddo + + if(present(trailing_sep)) trailing_sep=last_frame_sep + if(present(is_last_frame)) is_last_frame=last_frame_flag .and. all_valid + if(present(source_valid)) source_valid=all_valid + + return + +contains + + subroutine append_text(text) + character*(*) text + integer i + + do i=1,len(text) + if(k.le.len(message)) message(k:k)=text(i:i) + k=k+1 + enddo + end subroutine append_text + + subroutine append_payload_chars() + ! TEXT5 carries five 6-bit JTTY characters in the upper 30 bits. + integer n30, j, idx + character*1 c + + read(c32(iframe),1006) n30 +1006 format(b30.30) + do j=1,5 + idx=iand(ishft(n30,-6*(5-j)),63) + c=charj(idx) + if(c.eq.' ') c='~' + if(k.le.len(message)) message(k:k)=c + k=k+1 + enddo + end subroutine append_payload_chars + + subroutine append_implicit_separator() + ! Structured frames leave one blank column before any following frame. + k=k+1 + last_frame_sep=.true. + end subroutine append_implicit_separator + +end subroutine unpack_jtty + + +character*1 function charj(j) + +! Returns the printable character corresponding to JTTY index j (0-63), + + charj=source_char(j) + + return +end function charj + +integer function jchar(c0) + +! Returns the JTTY index (0-63) corresponding to character c0. + + character*1 c0 + + jchar=source_index(c0) + + return +end function jchar + +end module jtty_mod diff --git a/lib/jtty/jtty_msgs.txt b/lib/jtty/jtty_msgs.txt new file mode 100644 index 00000000..f97d8ad1 --- /dev/null +++ b/lib/jtty/jtty_msgs.txt @@ -0,0 +1,23 @@ +CQ KA1ABC CQ +WB9XYZ +TU KA1ABC CQ +WB9XYZ TU +WB9XYZ AGN? +WB9XYZ TU CQ KA1ABC CQ +TU NOW JA6DEF 599 123 +WB9XYZ 599 0123 +WB9XYZ NR? + +599 1234 +599 MA +599 FN42 +599 BRUCE + +PJ4/KA1ABC +CQ KA1ABC +CQ PJ4/KA1ABC CQ +PJ4/KA1ABC 599 124 + + +THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG. +0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ +-./?!"#$%,&*()_'=[]{}<>|:; diff --git a/lib/jtty/jtty_n1mm_integration.md b/lib/jtty/jtty_n1mm_integration.md new file mode 100644 index 00000000..63125cc9 --- /dev/null +++ b/lib/jtty/jtty_n1mm_integration.md @@ -0,0 +1,140 @@ +# JTTY and N1MM Logger+ Integration + +## Summary + +N1MM Logger+ can send either literal JTTY text or an explicit native action. Ordinary TXTEXT uses automatic minimum-frame packing after text and exchange-profile normalization, combining recognized compact forms with TEXT5. Explicit typed exchanges use a leading `[[JTTY:]]` marker in the transmitted text. The marker is consumed by WSJT-X and is never put on the air. + +The bundled `JTTY Messages.mc` uses tagged actions for its common Run and S&P messages. This provides compact Call8 and STRUCT30 transmission without asking WSJT-X to infer meaning from visible logger text. + +## Setup + +- Configure N1MM Logger+ with WSJT-X as for FT8. A starting point is [Operating WW Digi with N1MM and WSJT-X](https://www.rttycontesting.com/tutorials/n1mm/operating-ww-digi-with-n1mm/). +- Verify radio control, PTT, audio, and the `forEW1` configuration in FT8 before selecting JTTY. +- Enter `JTTY` in the N1MM callsign field and press Enter to start WSJT-X in JTTY mode. +- Confirm that the WSJT-X footer shows JTTY and the window title contains `forEW1`. +- Use radio test mode, zero output power, or a dummy load for initial checks. +- Save the existing Digital Function Key file before loading the supplied `JTTY Messages.mc` example. + +End-to-end validation with N1MM on Windows, including two-radio focus, call selection, queue movement, and Run/S&P state transitions, remains required before release. + +## Literal TXTEXT + +N1MM expands logger macros before passing TXTEXT to WSJT-X. An untagged result uses the literal source interface: + +- lowercase letters become uppercase; +- leading, trailing, and repeated spaces are removed; +- unsupported characters become `#`; +- explicit RTTY Roundup canonicalizes eligible report-prefixed decimal serials; +- recognized calls, control phrases, generic numbers, full generic QTH exchanges, grids, and class/section pairs compete with TEXT5 for the minimum frame count; +- every compact candidate must preserve its source text exactly after normalization. + +`CQ N9ADG CQ`, `N9ADG`, `599 123`, `599 MA`, `599 FN42`, and `1D EMA` each use one frame without a tag. Recognition works at token boundaries inside longer messages as well. The existing special operating activity supplies a profile captured when each message is submitted. No activity selects Unknown, even though native macros default to serials. Field Day uses the same context-free candidates as Unknown. + +RTTY Roundup additionally recognizes full `599 ` SERIAL and full `599 ` STATE_PROVINCE exchanges under the native rules; locations must contain a letter. Before packing, decimal tokens following a complete `599` token are normalized as serials: `599 05` becomes `599 005`, and `599 0123` becomes `599 123`, each in one frame. Eligible tokens have one to six digits and value 0-131071. Unsupported tokens keep their spelling for normal fallback. `599 001` takes one frame in RTTY Roundup and two otherwise, and `K1ABC 599 001` takes two in RTTY Roundup. + +Bare digits and all Unknown or Field Day input retain their spelling after ordinary text normalization. Every compact candidate must exactly match the resulting normalized text. The canonical message is returned to the GUI for display and logging; expansion beyond 80 characters is rejected rather than truncated. Tagged exchanges retain explicit type semantics. The full recognition policy and spacing constraints are in [`jtty_design.md`](jtty_design.md). + +The former `i2=2` shortcut for literal `599 ` plus five characters has been replaced by STRUCT30. There is no compatibility discriminator: an old receiver displays new STRUCT30 bits as `599` text, and some old type-2 frames are valid new STRUCT30 words with a different meaning. JTTY is unreleased, so no legacy decoder mode is retained. + +## Tagged TXTEXT grammar + +Place the marker so it is the leading transmitted text. Non-transmitting N1MM +commands may execute between `{TX}` and the marker: + +```text +{TX}[[JTTY:]]{RX} +``` + +N1MM expands `{MYCALL}`, `!` or `{CALL}`, and `{EXCH}`. WSJT-X removes the marker, normalizes whitespace and case in the expanded payload, and validates it under the selected action and active JTTY profile. Tag and action matching is case-insensitive, but the tag must start at the first non-space transmitted character. + +| Action | Expanded payload | Native sequence | +| --- | --- | --- | +| `CQ` | `` | CQ with my call | +| `CALL_EXCH` | ` ` | His call, configured full exchange | +| `CALL_TU_CQ` | ` ` | His call/TU, CQ with my call | +| `MYCALL` | `` | My call | +| `HISCALL` | `` | His call | +| `TU_NOW_EXCH` | ` ` | TU NOW/his call, configured full exchange | +| `CALL_MY` | ` ` | His call, my call | +| `CALL_TU_MY` | ` ` | His call/TU, my call | +| `EXCH` | `` | Configured full exchange | +| `GRID` | `` | Field-only GRID4 | +| `CONTROL` | `` | Registered control phrase | + +Payloads contain dynamic values, not the phrases implied by an action. For +example, `CQ` receives only the callsign, `CALL_TU_CQ` receives two callsigns, +and `TU_NOW_EXCH` receives a callsign and exchange. The action supplies `CQ`, +`TU`, `TU NOW`, and canonical full-exchange report text where applicable. Do +not add a hardcoded `599` to an exchange payload. + +Profile exchange payloads are: + +- Default: one decimal serial in the 17-bit serial domain. +- `FIELD_DAY`: exactly `
`, with count 1-32, class A-F, and a registered ARRL/RAC section. +- `RTTY`: either one decimal serial or one canonical two- or three-character state/province token. A three-character token may not have a leading zero because its two-character spelling would be canonical. + +For tagged N1MM input, `DX` is an expanded two-letter location token. The +special `DX` and `#` meanings that select the live serial apply only to the +local WSJT-X RTTY `%E` configuration. + +`GRID` accepts exactly one valid four-character Maidenhead locator. `CONTROL` accepts exactly one of the 18 registered phrases, including spaces and punctuation where shown in `jtty_source_encoding.txt`. + +An unknown or malformed leading JTTY marker, unsupported action, missing field, invalid call, invalid profile exchange, invalid grid, or unregistered control phrase is rejected. It never falls back to literal transmission. Untagged messages, including customized N1MM macros, use automatic text packing with the exchange profile captured at submission. A tag-shaped substring later in the text is just literal text. + +An all-rejected transaction receives `OUTPUTCOMPLETE` at `XMIT OFF`. When a transaction also contains accepted or pending audio, completion waits until that audio has drained. `ABORT` clears the transaction without reporting a successful output completion. + +## Bundled action mappings + +The supplied macro file deliberately omits hardcoded `599`. Full-role native exchanges render the report canonically when the selected profile calls for it; Field Day class/section does not. + +| Context | Key | Tagged meaning | +| --- | --- | --- | +| Run | F1 | `CQ` | +| Run | F2 | `CALL_EXCH` | +| Run | F3 | `CALL_TU_CQ` | +| Run | F4 | `MYCALL` | +| Run | F5 | `HISCALL` | +| Run | F6 | `CONTROL NR?` | +| Run | F8 | `CONTROL AGN?` | +| S&P | F1 | `CQ` | +| S&P | F2 | `CALL_EXCH` | +| S&P | F3 | `CALL_TU_MY` | +| S&P | F4 | `CALL_MY` | +| S&P | F5 | `HISCALL` | +| S&P | F6 | `MYCALL` | +| S&P | F7 | `EXCH` | +| S&P | F8 | `CONTROL AGN?` | + +Run F11 is intentionally left spare. N1MM call stacking can transmit a call +correction before `{LOGTHENPOP}` and change the station referenced by subsequent +callsign and exchange macros. That sequence cannot satisfy the leading-tag +contract reliably without validated N1MM TXTEXT ordering. `TU_NOW_EXCH` remains +available for an explicit leading tag whose already-expanded payload names the +intended station and exchange. + +## Native WSJT-X function keys + +The WSJT-X JTTY editor offers the same native subset without an N1MM tag. The shipped defaults are: + +| Key | Template | +| --- | --- | +| F1 | `CQ %M CQ` | +| F2 | `%H %E` | +| F3 | `%H TU CQ %M CQ` | +| F4 | `%M` | +| F5 | `%H` | +| F6 | `TU NOW %Q %E` | +| F7 | `%H AGN?` | +| F8 | `%E` | + +`%E` is the configured profile exchange. `%G` is a field-only GRID4, while the exact template `599 %G` selects full-role GRID4. Current templates and control phrases match before expansion after case and whitespace normalization. + +The exact former F2, F6, and F8 defaults (`%H 599 %N`, `TU NOW %Q 599 %N`, and `599 %N`) remain recognized during migration and are replaced by `%E` only when unchanged in saved settings. An edited old default is a customized literal template. Likewise, an unrecognized current template uses automatic text packing after normal expansion. A recognized native template with invalid runtime data is rejected rather than changing semantics through fallback. + +Clickable F1-F8 buttons and keyboard shortcuts select the same actions. Native sequences set EOM only on their final atom and do not add a TEXT5 spacing frame between queued messages. + +## Current scope + +The practical tagged and GUI native transmit subset includes Call8, serial and RTTY state/province exchanges, Field Day class/section, GRID4, and registered controls. Automatic text packing additionally uses GENERIC_NUMERIC and GENERIC_QTH. The full wire codec also validates and canonically renders other STRUCT30 number/location kinds, ZONE_LOC3, and EXCH_NUM_TIME. Those remaining forms are receive-only in the current operator-facing integration unless an explicit native codec caller constructs them; they are not inferred from ordinary text. + +The complete wire definition is in [`jtty_source_encoding.txt`](jtty_source_encoding.txt). diff --git a/lib/jtty/jtty_payload_correlators.f90 b/lib/jtty/jtty_payload_correlators.f90 new file mode 100644 index 00000000..296ffe69 --- /dev/null +++ b/lib/jtty/jtty_payload_correlators.f90 @@ -0,0 +1,108 @@ +module jtty_payload_correlators + use, intrinsic :: iso_fortran_env, only: int32, real32, real64 + implicit none + private + + real(real32), parameter :: TWO_PI = 6.2831853071795864769_real32 + + type, public :: jtty_payload_correlator + private + integer(int32) :: samples_per_symbol = 0_int32 + real(real32), allocatable :: reference_real(:,:) + real(real32), allocatable :: reference_imaginary(:,:) + end type jtty_payload_correlator + + public :: jtty_payload_correlator_prepare + public :: jtty_correlate_payload_symbols + +contains + + subroutine jtty_payload_correlator_prepare(correlator, samples_per_symbol) + type(jtty_payload_correlator), intent(inout) :: correlator + integer(int32), intent(in) :: samples_per_symbol + real(real32) :: phase, phase_step + integer :: sample, tone + + if (samples_per_symbol <= 0_int32 .or. modulo(samples_per_symbol,2_int32) /= 0_int32) & + error stop 'invalid JTTY payload symbol length' + if (correlator%samples_per_symbol == samples_per_symbol .and. & + allocated(correlator%reference_real) .and. & + allocated(correlator%reference_imaginary)) return + + correlator%samples_per_symbol = samples_per_symbol + if (allocated(correlator%reference_real)) deallocate(correlator%reference_real) + if (allocated(correlator%reference_imaginary)) & + deallocate(correlator%reference_imaginary) + allocate(correlator%reference_real(0:3,0:samples_per_symbol-1)) + allocate(correlator%reference_imaginary(0:3,0:samples_per_symbol-1)) + + do tone = 0, 3 + phase = 0.0_real32 + phase_step = TWO_PI*real(tone,real32)/real(samples_per_symbol,real32) + do sample = 0, samples_per_symbol - 1 + correlator%reference_real(tone,sample) = cos(phase) + correlator%reference_imaginary(tone,sample) = sin(phase) + phase = phase + phase_step + end do + end do + end subroutine jtty_payload_correlator_prepare + + subroutine jtty_correlate_payload_symbols(correlator, samples, payload_start, & + correlations, half_correlations) + ! Samples are candidate-centered analytic baseband; payload_start is zero-based. + type(jtty_payload_correlator), intent(in) :: correlator + complex(real32), intent(in) :: samples(0:) + integer(int32), intent(in) :: payload_start + complex(real32), intent(out) :: correlations(0:,:), half_correlations(0:,:) + real(real32) :: sample_real, sample_imaginary + real(real32) :: full_real(0:3), full_imaginary(0:3) + real(real32) :: half_real(0:3), half_imaginary(0:3) + real(real32) :: product_rr(0:3), product_ii(0:3), product_ri(0:3), product_ir(0:3) + real(real64) :: energy(0:3) + integer :: available_symbols, first, offset, segment, half_length, symbol, tone + + if (.not.allocated(correlator%reference_real) .or. & + correlator%samples_per_symbol <= 0_int32) & + error stop 'unprepared JTTY payload correlator' + if (size(correlations,1) /= 4 .or. any(shape(correlations) /= shape(half_correlations))) & + error stop 'invalid JTTY payload correlation shape' + if (payload_start < 0_int32) error stop 'invalid JTTY payload offset' + correlations = cmplx(0.0_real32,0.0_real32,real32) + half_correlations = cmplx(0.0_real32,0.0_real32,real32) + if (payload_start >= size(samples)) return + available_symbols = min(size(correlations,2), & + (size(samples)-payload_start)/correlator%samples_per_symbol) + half_length = correlator%samples_per_symbol/2 + + do symbol = 1, available_symbols + first = payload_start + (symbol - 1)*correlator%samples_per_symbol + full_real = 0.0_real32 + full_imaginary = 0.0_real32 + energy = 0.0_real64 + do segment = 0, 1 + half_real = 0.0_real32 + half_imaginary = 0.0_real32 + do offset = segment*half_length, (segment+1)*half_length-1 + sample_real = real(samples(first+offset),real32) + sample_imaginary = aimag(samples(first+offset)) + product_rr = correlator%reference_real(:,offset)*sample_real + product_ii = correlator%reference_imaginary(:,offset)*sample_imaginary + product_ri = correlator%reference_real(:,offset)*sample_imaginary + product_ir = correlator%reference_imaginary(:,offset)*sample_real + ! Preserve each observation's accumulation order while sharing products. + full_real = full_real + product_rr + product_ii + full_imaginary = full_imaginary + product_ri - product_ir + half_real = half_real + product_rr + product_ii + half_imaginary = half_imaginary + product_ri - product_ir + end do + energy = energy + real(half_real*half_real + half_imaginary*half_imaginary,real64) + end do + do tone = 0, 3 + correlations(tone,symbol) = cmplx(full_real(tone),full_imaginary(tone),real32) + half_correlations(tone,symbol) = & + cmplx(real(sqrt(max(0.0_real64,energy(tone))),real32),0.0_real32,real32) + end do + end do + end subroutine jtty_correlate_payload_symbols + +end module jtty_payload_correlators diff --git a/lib/jtty/jtty_peakup.f90 b/lib/jtty/jtty_peakup.f90 new file mode 100644 index 00000000..80afcbe2 --- /dev/null +++ b/lib/jtty/jtty_peakup.f90 @@ -0,0 +1,146 @@ +subroutine jtty_peakup(c0,c1,csync,nchunk,nss,xdt0,f0,xdt,f1,snr) + implicit none + + complex, intent(in) :: c0(0:nchunk-1) !Complex data at 6000 S/s + complex :: c1(0:nchunk-1) !Work array + complex, intent(in) :: csync(0:13*nss-1) + complex :: c(0:13*nss-1) !Lengh of Barker sequence + complex :: z + complex :: zcur(0:12), zbest(0:12), ztot + complex :: qstep(0:12) + real :: a(3) + real :: fsample, dt, pmax, fpk, xdtpk, xnorm, p + real :: phase(0:12), uw(0:12) + real :: dphi, xm, ym, sxy, sxx, slope, intercept + real :: resid, resid_rms, dfhz, tsym + integer, intent(in) :: nchunk, nss + integer :: i, i0, ia, ib, idf, istart, iend, npsync, r + integer, parameter :: hop=4 + real, intent(in) :: xdt0, f0 + real, intent(out) :: xdt, f1, snr + real, parameter :: TWOPI = 6.283185307179586 + real, parameter :: PI = 3.141592653589793 + + npsync=13*nss ! size of the sync waveform array + do i=0,12 + istart=i*nss + qstep(i)=csync(istart+hop)*conjg(csync(istart)) + enddo + fsample=6000.0 + dt=1.0/fsample + ia=max(0,nint((xdt0-0.004)/dt)) + ! ib must bound the i0 loop against c1's actual size (nchunk), not + ! npsync (an unrelated length) -- else ib|:;' + integer, parameter :: JTTY_ATOM_CALL=0,JTTY_ATOM_EXCH_NUM=1 + integer, parameter :: JTTY_ATOM_EXCH_LOC=2,JTTY_ATOM_EXCH_PAIR=3 + integer, parameter :: JTTY_ATOM_EXCH_NUM_TIME=4,JTTY_ATOM_CONTROL=5 + integer, parameter :: JTTY_ATOM_GRID4=6,JTTY_ATOM_TEXT5=7 + integer, parameter :: JTTY_CALL_CQ=0,JTTY_CALL_CALL=1,JTTY_CALL_TU_CQ=2 + integer, parameter :: JTTY_CALL_CALL_TU=3,JTTY_CALL_CALL_AGN=4,JTTY_CALL_TU_NOW=5 + integer, parameter :: JTTY_ROLE_FIELD_ONLY=0,JTTY_ROLE_FULL=1 + integer, parameter :: JTTY_NUM_SERIAL=0,JTTY_NUM_CQ_ZONE=1,JTTY_NUM_ITU_ZONE=2 + integer, parameter :: JTTY_NUM_AGE=3,JTTY_NUM_POWER=4,JTTY_NUM_CHECK=5 + integer, parameter :: JTTY_NUM_LICENSE_YEAR=6,JTTY_NUM_GENERIC=7 + integer, parameter :: JTTY_LOC_STATE_PROVINCE=0,JTTY_LOC_SECTION=1 + integer, parameter :: JTTY_LOC_COUNTRY_PREFIX=2,JTTY_LOC_QTH=3,JTTY_LOC_ADMIN_CODE=4 + integer, parameter :: JTTY_PAIR_ZONE_LOC3=0,JTTY_PAIR_CLASS_SECTION=1 + integer, parameter :: JTTY_MISC_CONTROL=0,JTTY_MISC_GRID4=1 + integer(c_int), parameter :: JTTY_ENCODE_OK=0,JTTY_ENCODE_INVALID_DESCRIPTOR=1 + integer(c_int), parameter :: JTTY_ENCODE_UNKNOWN_SECTION=2 + integer, parameter :: JTTY_CONTROL_AGN=0,JTTY_CONTROL_CALL=1,JTTY_CONTROL_AGN_CALL=2 + integer, parameter :: JTTY_CONTROL_NR=3,JTTY_CONTROL_AGN_NR=4,JTTY_CONTROL_EXCH=5 + integer, parameter :: JTTY_CONTROL_STATE=6,JTTY_CONTROL_SECTION=7,JTTY_CONTROL_ZONE=8 + integer, parameter :: JTTY_CONTROL_GRID=9,JTTY_CONTROL_RPRT=10,JTTY_CONTROL_QSL_TU=11 + integer, parameter :: JTTY_CONTROL_TU=12,JTTY_CONTROL_QRZ=13,JTTY_CONTROL_QSO_B4=14 + integer, parameter :: JTTY_CONTROL_WAIT=15,JTTY_CONTROL_NIL=16,JTTY_CONTROL_OK=17 + character(len=8), parameter :: CONTROL_TEXT(0:17)=[character(len=8) :: & + 'AGN?','CALL?','AGN CALL','NR?','AGN NR','EXCH?','STATE?','SECTION?', & + 'ZONE?','GRID?','RPRT?','QSL TU','TU','QRZ?','QSO B4','WAIT','NIL?','OK?'] + + type :: jtty_source_atom + integer :: kind=-1,subtype=0,role=JTTY_ROLE_FIELD_ONLY,value=0,value2=0 + character(len=13) :: text='' + end type jtty_source_atom + + type, bind(C) :: jtty_source_atom_c + integer(c_int8_t) :: kind,subtype,role,reserved + integer(c_int32_t) :: value + character(kind=c_char) :: text(9) + end type jtty_source_atom_c + +contains + +subroutine pack_jtty_atom(atom,frame,eom,valid) + type(jtty_source_atom), intent(in) :: atom + character(len=34), intent(out) :: frame + logical, intent(in) :: eom + logical, intent(out) :: valid + integer(I8) :: body,top30,n32,token_value,pair_data,data + integer :: i,n28,i2,n2,n,grid_index,class_index + character(len=13) :: call_text,roundtrip + character(len=5) :: text5 + logical :: success + frame=''; valid=.false.; n32=0 + select case(atom%kind) + case(JTTY_ATOM_CALL) + if(atom%subtype.lt.0 .or. atom%subtype.gt.5) return + call_text=atom%text + if(.not.standard_call(call_text)) return + call pack28(call_text,n28); call unpack28(n28,roundtrip,success) + if(.not.success .or. trim(roundtrip).ne.trim(call_text)) return + if(atom%subtype.le.3) then; i2=0; n2=atom%subtype + else; i2=1; n2=atom%subtype-4; endif + n32=ishft(int(n28,I8),4)+4*n2+i2 + case(JTTY_ATOM_EXCH_NUM) + if(.not.valid_role(atom%role) .or. .not.valid_number(atom%subtype,atom%value)) return + body=ishft(int(atom%role,I8),26)+ishft(int(atom%subtype,I8),22)+ishft(int(atom%value,I8),5) + call finish_struct(body,0,n32) + case(JTTY_ATOM_EXCH_LOC) + if(.not.valid_role(atom%role) .or. atom%subtype.lt.0 .or. atom%subtype.gt.4) return + n=len_trim(atom%text); if(n.ne.2 .and. n.ne.3) return + call pack_base36(atom%text(1:n),token_value,success); if(.not.success) return + body=ishft(int(atom%role,I8),26)+ishft(int(atom%subtype,I8),22)+ & + ishft(int(n-2,I8),21)+ishft(token_value,5) + call finish_struct(body,1,n32) + case(JTTY_ATOM_EXCH_PAIR) + select case(atom%subtype) + case(JTTY_PAIR_ZONE_LOC3) + if(atom%value.lt.1 .or. atom%value.gt.40) return + n=len_trim(atom%text); if(n.ne.2 .and. n.ne.3) return + call pack_base36(atom%text(1:n),token_value,success); if(.not.success) return + pair_data=ishft(int(atom%value,I8),17)+ishft(int(n-2,I8),16)+token_value + case(JTTY_PAIR_CLASS_SECTION) + if(atom%value.lt.1 .or. atom%value.gt.32) return + if(atom%value2.lt.1 .or. atom%value2.gt.PACK77_NSEC .or. len_trim(atom%text).ne.1) return + class_index=ichar(atom%text(1:1))-ichar('A'); if(class_index.lt.0 .or. class_index.gt.5) return + pair_data=ishft(int(atom%value,I8),17)+ishft(int(class_index,I8),14)+ & + ishft(int(atom%value2,I8),7) + case default; return + end select + body=ishft(int(atom%subtype,I8),24)+ishft(pair_data,1); call finish_struct(body,2,n32) + case(JTTY_ATOM_EXCH_NUM_TIME) + if(.not.valid_role(atom%role) .or. atom%value.lt.0 .or. atom%value.gt.16383) return + if(atom%value2.lt.0 .or. atom%value2.gt.1439) return + body=ishft(int(atom%role,I8),26)+ishft(int(atom%value,I8),12)+ishft(int(atom%value2,I8),1) + call finish_struct(body,3,n32) + case(JTTY_ATOM_CONTROL) + if(atom%subtype.lt.0 .or. atom%subtype.gt.17) return + body=ishft(int(JTTY_MISC_CONTROL,I8),23)+ishft(int(atom%subtype,I8),16) + call finish_struct(body,4,n32) + case(JTTY_ATOM_GRID4) + if(.not.valid_role(atom%role)) return + call grid4_to_index(atom%text,grid_index,success); if(.not.success) return + data=ishft(int(atom%role,I8),22)+ishft(int(grid_index,I8),7) + body=ishft(int(JTTY_MISC_GRID4,I8),23)+data; call finish_struct(body,4,n32) + case(JTTY_ATOM_TEXT5) + text5=atom%text(1:5); top30=0 + do i=1,5 + if(source_index(text5(i:i)).lt.0) return + top30=64*top30+source_index(text5(i:i)) + enddo + n32=4*top30+3 + case default; return + end select + write(frame(1:32),'(b32.32)') n32 + frame(33:33)='0' + frame(34:34)=merge('1','0',eom) + valid=.true. +end subroutine pack_jtty_atom + +subroutine finish_struct(body,family,n32) + integer(I8), intent(in) :: body + integer, intent(in) :: family + integer(I8), intent(out) :: n32 + n32=4*(8*body+family)+2 +end subroutine finish_struct + +subroutine unpack_jtty_atom(frame,atom,valid,eom) + character(len=34), intent(in) :: frame + type(jtty_source_atom), intent(out) :: atom + logical, intent(out) :: valid,eom + integer(I8) :: top30,body,pair_data,data,token_value + integer :: i,i2,family,n28,n2,zero,n,grid_index,class_index + character(len=13) :: call_text + logical :: success + atom=jtty_source_atom(); valid=.false.; eom=.false. + if(verify(frame,'01').ne.0 .or. frame(33:33).ne.'0') return + if(frame(1:32).eq.repeat('0',32)) return + read(frame,'(b30.30,b2.2)') top30,i2 + select case(i2) + case(0,1) + read(frame,'(b28.28,b2.2)') n28,n2 + if(i2.eq.1 .and. n2.gt.1) return + call unpack28(n28,call_text,success) + if(.not.success .or. .not.standard_call(call_text)) return + atom=jtty_call_atom(merge(n2,n2+4,i2.eq.0),call_text) + case(2) + family=int(iand(top30,7_I8)); body=ishft(top30,-3) + select case(family) + case(0) + atom%kind=JTTY_ATOM_EXCH_NUM; atom%role=int(ibits(body,26,1)) + atom%subtype=int(ibits(body,22,4)); atom%value=int(ibits(body,5,17)) + zero=int(ibits(body,0,5)) + if(zero.ne.0 .or. .not.valid_number(atom%subtype,atom%value)) return + case(1) + atom%kind=JTTY_ATOM_EXCH_LOC; atom%role=int(ibits(body,26,1)) + atom%subtype=int(ibits(body,22,4)); n=int(ibits(body,21,1))+2 + token_value=ibits(body,5,16); zero=int(ibits(body,0,5)) + if(zero.ne.0 .or. atom%subtype.gt.4 .or. token_value.ge.36_I8**n) return + if(n.eq.3 .and. token_value.lt.36_I8**2) return + call unpack_base36(token_value,n,atom%text) + case(2) + atom%kind=JTTY_ATOM_EXCH_PAIR; atom%subtype=int(ibits(body,24,3)) + pair_data=ibits(body,1,23); zero=int(ibits(body,0,1)); if(zero.ne.0) return + select case(atom%subtype) + case(JTTY_PAIR_ZONE_LOC3) + atom%value=int(ibits(pair_data,17,6)); n=int(ibits(pair_data,16,1))+2 + token_value=ibits(pair_data,0,16) + if(atom%value.lt.1 .or. atom%value.gt.40 .or. token_value.ge.36_I8**n) return + if(n.eq.3 .and. token_value.lt.36_I8**2) return + call unpack_base36(token_value,n,atom%text) + case(JTTY_PAIR_CLASS_SECTION) + atom%value=int(ibits(pair_data,17,6)); class_index=int(ibits(pair_data,14,3)) + atom%value2=int(ibits(pair_data,7,7)); zero=int(ibits(pair_data,0,7)) + if(atom%value.lt.1 .or. atom%value.gt.32 .or. class_index.gt.5) return + if(atom%value2.lt.1 .or. atom%value2.gt.PACK77_NSEC .or. zero.ne.0) return + atom%text(1:1)=char(ichar('A')+class_index) + case default; return + end select + case(3) + atom%kind=JTTY_ATOM_EXCH_NUM_TIME; atom%role=int(ibits(body,26,1)) + atom%value=int(ibits(body,12,14)); atom%value2=int(ibits(body,1,11)) + zero=int(ibits(body,0,1)); if(zero.ne.0 .or. atom%value2.gt.1439) return + case(4) + i=int(ibits(body,23,4)); data=ibits(body,0,23) + select case(i) + case(JTTY_MISC_CONTROL) + atom%kind=JTTY_ATOM_CONTROL; atom%subtype=int(ibits(data,16,7)) + zero=int(ibits(data,0,16)); if(zero.ne.0 .or. atom%subtype.gt.17) return + case(JTTY_MISC_GRID4) + atom%kind=JTTY_ATOM_GRID4; atom%role=int(ibits(data,22,1)) + grid_index=int(ibits(data,7,15)); zero=int(ibits(data,0,7)) + if(zero.ne.0 .or. grid_index.ge.32400) return + call index_to_grid4(grid_index,atom%text) + case default; return + end select + case default; return + end select + case(3) + atom%kind=JTTY_ATOM_TEXT5 + do i=1,5 + atom%text(i:i)=source_char(int(iand(ishft(top30,-6*(5-i)),63_I8))) + enddo + end select + eom=frame(34:34).eq.'1' + valid=.true. +end subroutine unpack_jtty_atom + +subroutine render_jtty_atom(atom,text,valid) + type(jtty_source_atom), intent(in) :: atom + character(len=80), intent(out) :: text + logical, intent(out) :: valid + character(len=16) :: first,second + character(len=3) :: section + integer :: hours,minutes + text=''; valid=.true. + select case(atom%kind) + case(JTTY_ATOM_CALL) + select case(atom%subtype) + case(JTTY_CALL_CQ); text='CQ '//trim(atom%text)//' CQ' + case(JTTY_CALL_CALL); text=trim(atom%text) + case(JTTY_CALL_TU_CQ); text='TU '//trim(atom%text)//' CQ' + case(JTTY_CALL_CALL_TU); text=trim(atom%text)//' TU' + case(JTTY_CALL_CALL_AGN); text=trim(atom%text)//' AGN?' + case(JTTY_CALL_TU_NOW); text='TU NOW '//trim(atom%text) + case default; valid=.false. + end select + case(JTTY_ATOM_EXCH_NUM) + if(.not.valid_role(atom%role) .or. .not.valid_number(atom%subtype,atom%value)) then + valid=.false.; return + endif + call render_number(atom%subtype,atom%value,first); call render_role(atom%role,trim(first),text) + case(JTTY_ATOM_EXCH_LOC) + if(atom%subtype.lt.0 .or. atom%subtype.gt.4) then; valid=.false.; return; endif + call render_role(atom%role,trim(atom%text),text) + case(JTTY_ATOM_EXCH_PAIR) + select case(atom%subtype) + case(JTTY_PAIR_ZONE_LOC3) + write(first,'(i2.2)') atom%value; text='599 '//trim(first)//' '//trim(atom%text) + case(JTTY_PAIR_CLASS_SECTION) + if(atom%value2.lt.1 .or. atom%value2.gt.PACK77_NSEC) then; valid=.false.; return; endif + section=PACK77_ARRL_SECTIONS(atom%value2) + write(first,'(i0,a1)') atom%value,atom%text(1:1); text=trim(first)//' '//trim(section) + case default; valid=.false. + end select + case(JTTY_ATOM_EXCH_NUM_TIME) + if(.not.valid_role(atom%role) .or. atom%value.lt.0 .or. atom%value.gt.16383 .or. & + atom%value2.lt.0 .or. atom%value2.gt.1439) then; valid=.false.; return; endif + call render_number(JTTY_NUM_SERIAL,atom%value,first) + hours=atom%value2/60; minutes=mod(atom%value2,60) + write(second,'(i2.2,i2.2)') hours,minutes + call render_role(atom%role,trim(first)//' '//trim(second),text) + case(JTTY_ATOM_CONTROL) + if(atom%subtype.lt.0 .or. atom%subtype.gt.17) then; valid=.false.; return; endif + text=trim(CONTROL_TEXT(atom%subtype)) + case(JTTY_ATOM_GRID4) + call render_role(atom%role,atom%text(1:4),text) + case(JTTY_ATOM_TEXT5); text(1:5)=atom%text(1:5) + case default; valid=.false. + end select +end subroutine render_jtty_atom + +subroutine render_role(role,field,text) + integer, intent(in) :: role + character(len=*), intent(in) :: field + character(len=80), intent(out) :: text + if(role.eq.JTTY_ROLE_FULL) then; text='599 '//field; else; text=field; endif +end subroutine render_role + +subroutine render_number(kind,value,text) + integer, intent(in) :: kind,value + character(len=16), intent(out) :: text + select case(kind) + case(JTTY_NUM_SERIAL) + if(value.lt.1000) then; write(text,'(i3.3)') value; else; write(text,'(i0)') value; endif + case(JTTY_NUM_CQ_ZONE,JTTY_NUM_ITU_ZONE,JTTY_NUM_CHECK) + if(value.lt.100) then; write(text,'(i2.2)') value; else; write(text,'(i0)') value; endif + case(JTTY_NUM_LICENSE_YEAR); write(text,'(i4.4)') value + case default; write(text,'(i0)') value + end select +end subroutine render_number + +logical function valid_number(kind,value) + integer, intent(in) :: kind,value + valid_number=kind.ge.0 .and. kind.le.7 .and. value.ge.0 .and. value.le.131071 + if(.not.valid_number) return + if(kind.eq.JTTY_NUM_CQ_ZONE) valid_number=value.ge.1 .and. value.le.40 + if(kind.eq.JTTY_NUM_ITU_ZONE) valid_number=value.ge.1 .and. value.le.90 + if(kind.eq.JTTY_NUM_LICENSE_YEAR) valid_number=value.le.9999 +end function valid_number + +logical function valid_role(role) + integer, intent(in) :: role + valid_role=role.eq.JTTY_ROLE_FIELD_ONLY .or. role.eq.JTTY_ROLE_FULL +end function valid_role + +logical function standard_call(call_text) + character(len=13), intent(in) :: call_text + character(len=13) :: work,unpacked + character(len=6) :: base_call + logical :: ok,success + integer :: n28 + standard_call=.false.; work=call_text + call chkcall(work,base_call,ok) + if(.not.ok .or. index(work,'/').gt.0 .or. work(1:1).eq.'Q') return + if(verify(trim(work),'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789').ne.0) return + call pack28(work,n28); call unpack28(n28,unpacked,success) + standard_call=success .and. trim(unpacked).eq.trim(work) +end function standard_call + +type(jtty_source_atom) function jtty_call_atom(action,call) result(atom) + integer, intent(in) :: action + character(len=*), intent(in) :: call + atom%kind=JTTY_ATOM_CALL; atom%subtype=action; atom%text=call +end function jtty_call_atom + +type(jtty_source_atom) function jtty_exch_num_atom(role,kind,value) result(atom) + integer, intent(in) :: role,kind,value + atom%kind=JTTY_ATOM_EXCH_NUM; atom%role=role; atom%subtype=kind; atom%value=value +end function jtty_exch_num_atom + +type(jtty_source_atom) function jtty_exch_loc_atom(role,kind,token) result(atom) + integer, intent(in) :: role,kind + character(len=*), intent(in) :: token + atom%kind=JTTY_ATOM_EXCH_LOC; atom%role=role; atom%subtype=kind; atom%text=token +end function jtty_exch_loc_atom + +type(jtty_source_atom) function jtty_zone_loc_atom(zone,token) result(atom) + integer, intent(in) :: zone + character(len=*), intent(in) :: token + atom%kind=JTTY_ATOM_EXCH_PAIR; atom%subtype=JTTY_PAIR_ZONE_LOC3 + atom%value=zone; atom%text=token +end function jtty_zone_loc_atom + +type(jtty_source_atom) function jtty_class_section_atom(count,class,section_index) result(atom) + integer, intent(in) :: count,section_index + character(len=*), intent(in) :: class + atom%kind=JTTY_ATOM_EXCH_PAIR; atom%subtype=JTTY_PAIR_CLASS_SECTION + atom%value=count; atom%value2=section_index; atom%text=class +end function jtty_class_section_atom + +type(jtty_source_atom) function jtty_exch_num_time_atom(role,serial,minute_of_day) result(atom) + integer, intent(in) :: role,serial,minute_of_day + atom%kind=JTTY_ATOM_EXCH_NUM_TIME; atom%role=role + atom%value=serial; atom%value2=minute_of_day +end function jtty_exch_num_time_atom + +type(jtty_source_atom) function jtty_control_atom(phrase_id) result(atom) + integer, intent(in) :: phrase_id + atom%kind=JTTY_ATOM_CONTROL; atom%subtype=phrase_id +end function jtty_control_atom + +type(jtty_source_atom) function jtty_grid4_atom(role,grid) result(atom) + integer, intent(in) :: role + character(len=*), intent(in) :: grid + atom%kind=JTTY_ATOM_GRID4; atom%role=role; atom%text=grid +end function jtty_grid4_atom + +type(jtty_source_atom) function jtty_text5_atom(text) result(atom) + character(len=*), intent(in) :: text + integer :: n + atom%kind=JTTY_ATOM_TEXT5; atom%text=''; n=min(5,len(text)) + if(n.gt.0) atom%text(1:n)=text(1:n) +end function jtty_text5_atom + +subroutine pack_jtty_atoms(atoms,natoms,frames,nframes,valid) + type(jtty_source_atom), intent(in) :: atoms(:) + integer, intent(in) :: natoms + character(len=34), intent(out) :: frames(:) + integer, intent(out) :: nframes + logical, intent(out) :: valid + integer :: i + frames=''; nframes=0 + valid=natoms.ge.1 .and. natoms.le.16 .and. natoms.le.size(atoms) .and. natoms.le.size(frames) + if(.not.valid) return + do i=1,natoms + call pack_jtty_atom(atoms(i),frames(i),i.eq.natoms,valid) + if(.not.valid) then; frames=''; return; endif + enddo + nframes=natoms +end subroutine pack_jtty_atoms + +subroutine pack_base36(token,value,valid) + character(len=*), intent(in) :: token + integer(I8), intent(out) :: value + logical, intent(out) :: valid + integer :: i,digit + value=0; valid=len(token).eq.2 .or. len(token).eq.3 + if(.not.valid) return + do i=1,len(token) + digit=index('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ',token(i:i))-1 + if(digit.lt.0) then; valid=.false.; return; endif + value=36*value+digit + enddo + if(len(token).eq.3 .and. value.lt.36_I8**2) valid=.false. +end subroutine pack_base36 + +subroutine unpack_base36(value,n,token) + integer(I8), intent(in) :: value + integer, intent(in) :: n + character(len=13), intent(out) :: token + integer(I8) :: work + integer :: i,digit + token=''; work=value + do i=n,1,-1 + digit=int(mod(work,36_I8)); work=work/36 + token(i:i)='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'(digit+1:digit+1) + enddo +end subroutine unpack_base36 + +subroutine grid4_to_index(grid,index_value,valid) + character(len=*), intent(in) :: grid + integer, intent(out) :: index_value + logical, intent(out) :: valid + integer :: a,b,c,d + index_value=0; valid=len_trim(grid).eq.4 + if(.not.valid) return + a=ichar(grid(1:1))-ichar('A'); b=ichar(grid(2:2))-ichar('A') + c=ichar(grid(3:3))-ichar('0'); d=ichar(grid(4:4))-ichar('0') + valid=a.ge.0 .and. a.lt.18 .and. b.ge.0 .and. b.lt.18 .and. & + c.ge.0 .and. c.lt.10 .and. d.ge.0 .and. d.lt.10 + if(valid) index_value=((a*18+b)*10+c)*10+d +end subroutine grid4_to_index + +subroutine index_to_grid4(index_value,grid) + integer, intent(in) :: index_value + character(len=13), intent(out) :: grid + integer :: work,a,b,c,d + grid=''; work=index_value + d=mod(work,10); work=work/10; c=mod(work,10); work=work/10 + b=mod(work,18); a=work/18 + grid(1:4)=char(ichar('A')+a)//char(ichar('A')+b)//char(ichar('0')+c)//char(ichar('0')+d) +end subroutine index_to_grid4 + +integer function source_index(c) + character(len=1), intent(in) :: c + source_index=index(ALPHABET,c)-1 +end function source_index + +character(len=1) function source_char(i) + integer, intent(in) :: i + source_char=ALPHABET(i+1:i+1) +end function source_char + +end module jtty_source_codec diff --git a/lib/jtty/jtty_source_encoding.txt b/lib/jtty/jtty_source_encoding.txt new file mode 100644 index 00000000..efc78c6e --- /dev/null +++ b/lib/jtty/jtty_source_encoding.txt @@ -0,0 +1,380 @@ +JTTY source encoding + +Each JTTY frame conveys 34 source bits. Bits are numbered from left to right, +most significant first. Bits 1-32 are the message grammar, bit 33 is reserved +and shall be zero, and bit 34 is the universal end-of-message (EOM) flag. EOM +is one only on the final atom of a source message. It is a sender-intended +boundary, not evidence that earlier atoms were received or that a QSO is +complete. + +The 32-bit all-zero grammar word is an invalid sentinel. A receiver shall also +reject a source word if any reserved-zero field is nonzero or if it contains an +unassigned type, family, subtype, enum value, or out-of-range field. These +source-validity checks are made after FEC and CRC verification. An invalid +source word shall not be displayed, create a receive slot, complete a message +through EOM, or participate in signal subtraction. + +Top-level message space + +-------------------------------------------------------------------------------- +i2.n2 Example Bits Total Purpose +-------------------------------------------------------------------------------- +0.0 CQ K1ABC CQ 28 2 30 CQ call action +0.1 K1ABC 28 2 30 CALL action +0.2 TU K1ABC CQ 28 2 30 TU/CQ action +0.3 K1ABC TU 28 2 30 CALL/TU action +1.0 K1ABC AGN? 28 2 30 CALL/AGN action +1.1 TU NOW K1ABC 28 2 30 TU NOW/CALL action +1.2 (reserved; invalid) +1.3 (reserved; invalid) +2 599 123 27 3 30 STRUCT30 +3 HELLO 6 6 6 6 6 30 TEXT5 +-------------------------------------------------------------------------------- + +For i2=0 or 1, bits 1-28 are the existing call28 representation, bits 29-30 +are n2, and bits 31-32 are i2. Only standard calls that round-trip through the +existing pack28/unpack28 grammar are valid JTTY call atoms. The six assigned +actions render exactly as shown above after substituting the decoded call. + +For i2=3, bits 1-30 contain five six-bit characters in transmission order and +bits 31-32 are 11. Character values 0-63 index this alphabet: + + 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ +-./?!"#$%,&*()_'=[]{}<>|:; + +The final TEXT5 atom is padded on the right with spaces. Padding is not part of +the rendered message. + +STRUCT30 + +For i2=2, bits 1-27 are body27, bits 28-30 are family3, and bits 31-32 +are 10. Fields below are listed in bit order, from bit 1 toward bit 27. + +-------------------------------------------------------------------------------- +Family Name Body fields Total Status +-------------------------------------------------------------------------------- +000 EXCH_NUM role1 kind4 value17 zero5 27 assigned +001 EXCH_LOC role1 kind4 length1 token16 zero5 27 assigned +010 EXCH_PAIR schema3 pair_data23 zero1 27 assigned +011 EXCH_NUM_TIME role1 serial14 minute11 zero1 27 assigned +100 MISC subtype4 subtype_data23 27 assigned +101 PROFILED body27 27 reserved +110 VERSIONED body27 27 reserved +111 INVALID body27 27 invalid guard +-------------------------------------------------------------------------------- + +Families 101-111 are invalid in version 1. They reserve space for a future +profiled/dense extension, a versioned extension, and an explicit validity +guard, respectively. A future assignment requires a protocol revision. + +Common fields + +role1 is an utterance role: + + 0 field-only; do not render a signal report + 1 full exchange; prefix the rendered fields with "599 " + +Base-36 fields use digit values 0-9 followed by A-Z. A token is accumulated +left to right, so ABC is ((10 * 36) + 11) * 36 + 12. length1 is 0 for exactly +two characters and 1 for exactly three characters. The token16 value shall be +less than 36^2 for length=0. For length=1 it shall be at least 36^2 and less +than 36^3; a three-character spelling with a leading zero would have a +canonical two-character representation and is invalid. Lowercase and +punctuation do not occur on the wire. + +EXCH_NUM, family 000 + +-------------------------------------------------------------------------------- +Kind Name Values Canonical field rendering +-------------------------------------------------------------------------------- +0 SERIAL 0-131071 decimal, at least three digits +1 CQ_ZONE 1-40 decimal, at least two digits +2 ITU_ZONE 1-90 decimal, at least two digits +3 AGE 0-131071 decimal +4 POWER 0-131071 decimal +5 CHECK 0-131071 decimal, at least two digits +6 FIRST_LICENSE_YEAR 0-9999 decimal, exactly four digits +7 GENERIC_NUMERIC 0-131071 decimal +8-15 (reserved; invalid) +-------------------------------------------------------------------------------- + +The role determines whether "599 " precedes the field. Apart from CQ and ITU +zones and the four-digit license-year domain, the core grammar enforces only +the 17-bit range; contest-specific limits belong to future profile validation. +Decimal width, separators, 5NN spelling, and visible repetition are not +represented. + +EXCH_LOC, family 001 + +-------------------------------------------------------------------------------- +Kind Name +-------------------------------------------------------------------------------- +0 STATE_PROVINCE +1 ARRL_RAC_SECTION +2 COUNTRY_PREFIX +3 GENERIC_QTH +4 LOCAL_ADMINISTRATIVE_CODE +5-15 (reserved; invalid) +-------------------------------------------------------------------------------- + +The token has the base-36 and length rules above. The role determines whether +"599 " precedes it. + +EXCH_PAIR, family 010 + +-------------------------------------------------------------------------------- +Schema Name pair_data fields Valid ranges +-------------------------------------------------------------------------------- +0 ZONE_LOC3 cq_zone6 length1 token16 zone 1-40; token as above +1 CLASS_SECTION count6 class3 section7 zero7 count 1-32; class 0-5; + section 1-86 +2-7 (reserved; invalid) +-------------------------------------------------------------------------------- + +ZONE_LOC3 always renders "599 " with a two-digit-minimum zone. +CLASS_SECTION renders "
". Class values 0-5 mean A-F; +6-7 are invalid. Section values 1-86 index PACK77_ARRL_SECTIONS in +lib/77bit/packjt77_grammar.f90; value zero and values 87-127 are invalid. The +registry is deliberately shared rather than copied into this specification. + +EXCH_NUM_TIME, family 011 + + role1 + serial14 + minute_of_day11 + zero1 + +serial is 0-16383. minute_of_day is 0-1439 and maps to UTC HHMM by division +and remainder by 60. The serial uses at least three digits and UTC time exactly +four digits. role=1 renders "599 "; role=0 omits "599 ". Values +1440-2047 for minute_of_day are invalid. + +MISC, family 100 + +-------------------------------------------------------------------------------- +Subtype Name subtype_data fields +-------------------------------------------------------------------------------- +0 CONTROL phrase7 zero16 +1 GRID4 role1 grid4_code15 zero7 +2-15 (reserved; invalid) +-------------------------------------------------------------------------------- + +CONTROL phrase assignments and canonical renderings are: + +-------------------------------------------------------------------------------- +ID Phrase ID Phrase ID Phrase +-------------------------------------------------------------------------------- + 0 AGN? 6 STATE? 12 TU + 1 CALL? 7 SECTION? 13 QRZ? + 2 AGN CALL 8 ZONE? 14 QSO B4 + 3 NR? 9 GRID? 15 WAIT + 4 AGN NR 10 RPRT? 16 NIL? + 5 EXCH? 11 QSL TU 17 OK? +-------------------------------------------------------------------------------- + +Phrase values 18-127 are invalid. CONTROL's sixteen reserved bits shall be +zero. + +GRID4 accepts only Maidenhead fields AA00 through RR99. With A=0, the code is: + + (((field_1 * 18 + field_2) * 10 + digit_1) * 10 + digit_2) + +Thus the valid domain is 0-32399. Values 32400-32767 are invalid. role=1 +renders "599 " and role=0 renders only the four-character grid. + +Canonical atom sequences + +Structured atoms are rendered independently and supply one implicit trailing +space; TEXT5 characters are appended verbatim. The final trailing space or +TEXT5 padding is not part of the displayed message. The receiver truncates +the accumulated display at 80 characters. A sender +sets bit 33 to zero on every atom and bit 34 only on the last atom. Queuing a +second native message does not add a TEXT5 spacing atom. + +Ordinary keyboard text, externally queued strings, and N1MM/MMTTY strings use +the literal source interface. They are normalized to uppercase, leading, +trailing, and repeated ASCII spaces are removed, and unsupported characters +become '#'. The literal wrapper accepts an 80-character input field, so longer +caller strings are truncated before normalization. Automatic packing minimizes +the frame count while preserving this text exactly after any explicit RTTY +Roundup serial normalization described below. The result is +at most sixteen frames because TEXT5 is always available as a fallback. + +Candidates at complete token boundaries are: + + * All six call forms, with an exact standard-call codec round trip. + * Registered CONTROL phrases, including inside longer messages. + * Canonical unsigned decimal 0-131071 as GENERIC_NUMERIC, field-only or + preceded by "599 ". Leading zeros are not canonical except for "0". + * "599 " followed by a valid two- or three-character base-36 token + containing at least one letter, as full-role GENERIC_QTH. Canonical + base-36 length rules apply; numeric-only tokens cannot use this path. + * Valid GRID4, field-only or preceded by "599 ". + * Canonical CLASS_SECTION using the count, class, and section rules above. + +Every candidate must pass codec pack/unpack validation and render exactly as +its span in the normalized text. These context-free candidates remain +available under every +exchange profile. The GUI captures Unknown, Field Day, or RTTY Roundup from +the existing special operating activity when a message is submitted. No +activity means Unknown; the native macro default of SERIAL does not apply to +automatic text recognition. Field Day adds no candidates because CLASS_SECTION +is already self-identifying. + +RTTY Roundup additionally considers full "599 " as SERIAL and full +"599 " as STATE_PROVINCE under the existing native exchange rules. +Location tokens must contain at least one letter. Before the shared packing +algorithm, explicit RTTY Roundup canonicalizes decimal tokens following a +complete "599" token to the SERIAL spelling (at least three digits). Eligible +tokens have one to six digits and value 0-131071. Unsupported tokens keep their +spelling and use normal fallback. Bare digits and Unknown or Field Day input +retain their spelling after ordinary text normalization. The canonical message +is returned to the GUI for display and logging. A canonical result exceeding +80 characters is rejected rather than truncated. + +The exact-render requirement applies to this profile-normalized text, and no +bare number is inferred as SERIAL. CQ_ZONE, ITU_ZONE, +AGE, POWER, CHECK, FIRST_LICENSE_YEAR, other specific location kinds, +ZONE_LOC3, and EXCH_NUM_TIME are not inferred from ordinary text. The profile +is per-message encoder context, not a new configuration or wire field. + +A dynamic program over source-character offsets selects a minimum-frame +sequence of candidates and TEXT5. An interior TEXT5 atom consumes exactly five +characters; only the final TEXT5 atom may be padded. A structured candidate +consumes its rendering plus one source space when another token follows, +matching the receiver's implicit separator. Equal-cost choices prefer a +structured atom, then the longest consumed span, then ascending atom +kind/subtype/role. Thus equally compact SERIAL and STATE_PROVINCE candidates +win over their generic equivalents under RTTY Roundup. This minimizes frames +under the recognition policy, not +under hypothetical knowledge of the contest exchange's meaning. + +For example, "CQ K1ABC CQ", "599 123", "599 MA", "599 FN42", and "1D EMA" +each use one frame. Under Unknown or Field Day, "599 001" and "599 05" need +two frames because their leading zeros cannot be preserved with GENERIC_NUMERIC. +Under RTTY Roundup, "599 001" uses one SERIAL frame and "K1ABC 599 001" uses +two frames. Under RTTY Roundup, "599 05" becomes "599 005" and "599 0123" +becomes "599 123", each using one SERIAL frame. Under Unknown or Field Day +they retain their spelling and use two frames. "599 BRUCE" also needs two: +STRUCT30 has no generic five-character exchange atom. + +sjtty defaults to Unknown. The optional leading argument +--exchange-profile=unknown|field-day|rtty-roundup applies to both its +one-message packing and eight-argument waveform invocations. An invalid +profile value is an error. + +The eight shipped JTTY function-key templates are a separate NativeMacro +contract. Current templates and control phrases match after case folding and +whitespace normalization, before placeholder expansion. Superseded templates +use the exact-compatibility rule below. + +-------------------------------------------------------------------------------- +Key Template Native atoms +-------------------------------------------------------------------------------- +F1 CQ %M CQ CQ(my_call) +F2 %H %E CALL(his_call), configured full exchange +F3 %H TU CQ %M CQ CALL_TU(his_call), CQ(my_call) +F4 %M CALL(my_call) +F5 %H CALL(his_call) +F6 TU NOW %Q %E TU_NOW_CALL(queue_call), configured full exchange +F7 %H AGN? CALL_AGN(his_call) +F8 %E configured full exchange +-------------------------------------------------------------------------------- + +%E is the configured profile exchange. The default profile accepts a decimal +serial. FIELD_DAY accepts exactly "
" and encodes +CLASS_SECTION. RTTY accepts either a decimal SERIAL or a canonical two- or +three-character STATE_PROVINCE token. %G accepts one valid GRID4 and is +field-only; the exact template "599 %G" selects a full-role GRID4. These are +semantic placeholders, not text substitution followed by source inference. + +The exact former defaults "%H 599 %N", "TU NOW %Q 599 %N", and "599 %N" +remain recognized during migration and are replaced by their %E forms when +still unchanged in saved settings. Edited variants are not migrated or matched +as native templates. An unrecognized customized template uses automatic text +packing after normal placeholder expansion. A recognized native template +whose required runtime call, exchange, or grid is invalid is rejected; it +never changes meaning by falling back to literal transmission. + +Practical transmit subset + +The wire codec defines and validates every atom in this document. The current +WSJT-X macro and tagged-N1MM compilers intentionally generate a smaller +operator-facing subset: the six Call8 actions, SERIAL, RTTY STATE_PROVINCE, +CLASS_SECTION, GRID4, and registered CONTROL phrases. The automatic text packer +also generates GENERIC_NUMERIC and GENERIC_QTH. Other number and location kinds, +ZONE_LOC3, and EXCH_NUM_TIME have canonical receive rendering and remain +available to explicit native codec callers, but are not inferred from ordinary +text or exposed as general-purpose transmit macros in this version. + +Tagged N1MM TXTEXT + +N1MM can opt into the practical native subset by placing this marker at the +start of the transmitted text, after the normal {TX} command: + + [[JTTY:]] + +N1MM expands {MYCALL}, ! or {CALL}, and {EXCH}; WSJT-X then parses the expanded +payload under the selected action and active profile. The tag must begin at the +first non-space character; tag and action matching is case-insensitive. The +marker is transport metadata and is not transmitted. Assigned actions are: + +-------------------------------------------------------------------------------- +Action Expanded payload Native meaning +-------------------------------------------------------------------------------- +CQ CQ(mycall) +CALL_EXCH CALL(hiscall), full exchange +CALL_TU_CQ CALL_TU(hiscall), CQ(mycall) +MYCALL CALL(mycall) +HISCALL CALL(hiscall) +TU_NOW_EXCH TU_NOW_CALL(hiscall), exchange +CALL_MY CALL(hiscall), CALL(mycall) +CALL_TU_MY CALL_TU(hiscall), CALL(mycall) +EXCH configured full exchange +GRID field-only GRID4 +CONTROL CONTROL(phrase) +-------------------------------------------------------------------------------- + +The exchange payload follows the same default, FIELD_DAY, and RTTY profile +rules as %E, except that tagged values are already expanded: RTTY "DX" is a +two-letter location, and the local-configuration "DX" and "#" serial sentinels +do not apply. It contains the exchange value only: the action supplies CQ, TU, +TU NOW, and canonical full-exchange report text where applicable. GRID requires +a valid four-character Maidenhead locator. CONTROL requires one exact +registered phrase from the CONTROL table above. An untagged N1MM message uses +the literal source interface with automatic packing described above. +A tag-shaped substring later in a message has no +special meaning. An unknown or malformed leading JTTY tag, an unsupported +action, invalid payload, or profile mismatch is rejected rather than put on +the air as literal bracket text. + +Representative 34-bit vectors + +Binary strings below contain bits 1-34 exactly. Hex values interpret the same +34 bits as an unsigned integer and pad to nine hex digits. Both serial rows +encode the same atom and demonstrate the EOM difference; changing any final +atom to non-final clears the final binary bit and subtracts one from its hex +value. + +-------------------------------------------------------------------------------- +Meaning Bits 1-34 Hex +-------------------------------------------------------------------------------- +CQ K1ABC CQ 0000100110111101111000110101000001 0x026F78D41 +EXCH_NUM full SERIAL 123, more 1000000000000001111011000000001000 0x20007B008 +EXCH_NUM full SERIAL 123, EOM 1000000000000001111011000000001001 0x20007B009 +EXCH_LOC full STATE CA 1000000000000110111010000000011001 0x2001BA019 +ZONE_LOC3 05 NWT 0000001011011110010000110100101001 0x00B790D29 +CLASS_SECTION 1D EMA 0010000010110001011000000000101001 0x082C58029 +EXCH_NUM_TIME full 156 1749 1000000100111001000010110100111001 0x204E42D39 +CONTROL AGN? 0000000000000000000000000001001001 0x000000049 +GRID4 field-only FN42 0001001010000110011000000001001001 0x04A198049 +TEXT5 HELLO 0100010011100101010101010110001101 0x11395558D +-------------------------------------------------------------------------------- + +Compatibility + +This version deliberately replaces the earlier i2=2 encoding, which meant the +literal prefix "599 " followed by five six-bit characters. There is no version +discriminator: an old receiver will render new STRUCT30 payload bits as +arbitrary text following "599 ", while some old i2=2 frames happen to satisfy +the new STRUCT30 structural rules and will be accepted with a different +meaning by a new receiver. JTTY is unreleased, so this incompatibility is +intentional and no legacy decoder mode is retained. Automatic text packing +uses only the current grammar; unrecognized "599 ..." text remains available +through TEXT5. diff --git a/lib/jtty/jtty_spec.f90 b/lib/jtty/jtty_spec.f90 new file mode 100644 index 00000000..27101200 --- /dev/null +++ b/lib/jtty/jtty_spec.f90 @@ -0,0 +1,40 @@ +subroutine jtty_spec(iwave,iz) + + parameter (NFFT=262144,NH=NFFT/2) + integer*2 iwave(iz) + real*4 x(NFFT) + real*4 s(0:NH) + complex c(0:NH) + equivalence (x,c) + + x(1:iz)=iwave + x(iz+1:)=0. + call four2a(c,NFFT,1,-1,0) + + do i=0,NH + c(i)=c(i)/NFFT + s(i)=real(c(i))**2 + aimag(c(i))**2 + enddo + do i=1,200 + call smo121(s,NH+1) + enddo + smax=maxval(s) + s=s/(4.0*smax) + tpmax=sum(s) + + df=12000.0/NFFT + f1=0. + f2=0. + tp=0. + do i=0,NH + if(f1.eq.0.0 .and. db(s(i)).gt.-60.0) f1=i*df + if(i*df.gt.1500.0 .and. db(s(i)).gt.-60.0) f2=i*df + tp=tp+s(i) + write(70,3070) i*df,db(s(i)),100.0*tp/tpmax,s(i) +3070 format(3f12.3,e12.3) + enddo + write(*,1000) f1,f2,f2-f1 +1000 format(3f10.1) + + return +end subroutine jtty_spec diff --git a/lib/jtty/jtty_tbcc_code_profile.f90 b/lib/jtty/jtty_tbcc_code_profile.f90 new file mode 100644 index 00000000..9037d790 --- /dev/null +++ b/lib/jtty/jtty_tbcc_code_profile.f90 @@ -0,0 +1,106 @@ +module jtty_tbcc_code_profiles + use, intrinsic :: iso_fortran_env, only: int32 + implicit none + private + + integer(int32), parameter, public :: JTTY_TBCC_PAYLOAD_BITS = 34_int32 + integer(int32), parameter, public :: JTTY_TBCC_OUTER_CHECK_BITS = 12_int32 + integer(int32), parameter, public :: JTTY_TBCC_INFORMATION_BITS = & + JTTY_TBCC_PAYLOAD_BITS + JTTY_TBCC_OUTER_CHECK_BITS + + ! A circular rate-1/2 trellis with memory nu has 2**nu states and a + ! constraint-length register of nu+1 bits. + type, public :: jtty_tbcc_code_profile + integer(int32) :: profile_id = 0_int32 + integer(int32) :: memory_nu = 0_int32 + integer(int32) :: constraint_length = 0_int32 + integer(int32) :: state_count = 0_int32 + integer(int32) :: state_mask = 0_int32 + integer(int32) :: register_mask = 0_int32 + ! Generator masks use integer bit patterns; octal notation is the + ! conventional spelling for convolutional codes such as 1167/1545. + integer(int32) :: generator_0 = 0_int32 + integer(int32) :: generator_1 = 0_int32 + ! The leading term of the outer polynomial is implicit; these masks describe + ! the stored feedback coefficients and remainder register. + integer(int32) :: outer_polynomial = 0_int32 + integer(int32) :: outer_top_bit_mask = 0_int32 + integer(int32) :: outer_register_mask = 0_int32 + integer(int32) :: payload_bits = 0_int32 + integer(int32) :: outer_check_bits = 0_int32 + integer(int32) :: information_bits = 0_int32 + end type jtty_tbcc_code_profile + + type(jtty_tbcc_code_profile), parameter, public :: & + JTTY_TBCC_PROFILE_1167_1545_80F = jtty_tbcc_code_profile( & + profile_id=1_int32, memory_nu=9_int32, constraint_length=10_int32, & + state_count=512_int32, state_mask=int(z'1FF', int32), & + register_mask=int(z'3FF', int32), & + generator_0=int(o'1167', int32), generator_1=int(o'1545', int32), & + outer_polynomial=int(z'80F', int32), & + outer_top_bit_mask=int(z'800', int32), & + outer_register_mask=int(z'FFF', int32), & + payload_bits=JTTY_TBCC_PAYLOAD_BITS, & + outer_check_bits=JTTY_TBCC_OUTER_CHECK_BITS, & + information_bits=JTTY_TBCC_INFORMATION_BITS) + + public :: jtty_tbcc_code_profile_is_valid + public :: jtty_tbcc_code_profile_is_supported + +contains + + pure logical function jtty_tbcc_code_profile_is_valid(profile) result(valid) + type(jtty_tbcc_code_profile), intent(in) :: profile + integer(int32) :: expected_state_count, expected_register_mask + + valid = .false. + if (profile%memory_nu < 1_int32 .or. profile%memory_nu > 20_int32) return + if (profile%constraint_length /= profile%memory_nu + 1_int32) return + expected_state_count = shiftl(1_int32, profile%memory_nu) + expected_register_mask = shiftl(1_int32, profile%constraint_length) - 1_int32 + if (profile%state_count /= expected_state_count) return + if (profile%state_mask /= expected_state_count - 1_int32) return + if (profile%register_mask /= expected_register_mask) return + if (profile%generator_0 <= 0_int32 .or. & + iand(profile%generator_0, not(profile%register_mask)) /= 0_int32) return + if (profile%generator_1 <= 0_int32 .or. & + iand(profile%generator_1, not(profile%register_mask)) /= 0_int32) return + if (profile%payload_bits /= JTTY_TBCC_PAYLOAD_BITS) return + if (profile%outer_check_bits /= JTTY_TBCC_OUTER_CHECK_BITS) return + if (profile%information_bits /= profile%payload_bits + profile%outer_check_bits) return + if (profile%outer_top_bit_mask /= & + shiftl(1_int32, profile%outer_check_bits - 1_int32)) return + if (profile%outer_register_mask /= & + shiftl(1_int32, profile%outer_check_bits) - 1_int32) return + if (profile%outer_polynomial <= 0_int32 .or. & + iand(profile%outer_polynomial, not(profile%outer_register_mask)) /= 0_int32) return + valid = .true. + end function jtty_tbcc_code_profile_is_valid + + pure logical function jtty_tbcc_code_profile_is_supported(profile) result(supported) + type(jtty_tbcc_code_profile), intent(in) :: profile + + supported = jtty_tbcc_code_profile_is_valid(profile) .and. & + jtty_tbcc_code_profiles_equal(profile, JTTY_TBCC_PROFILE_1167_1545_80F) + end function jtty_tbcc_code_profile_is_supported + + pure logical function jtty_tbcc_code_profiles_equal(left, right) result(equal) + type(jtty_tbcc_code_profile), intent(in) :: left, right + + equal = left%profile_id == right%profile_id .and. & + left%memory_nu == right%memory_nu .and. & + left%constraint_length == right%constraint_length .and. & + left%state_count == right%state_count .and. & + left%state_mask == right%state_mask .and. & + left%register_mask == right%register_mask .and. & + left%generator_0 == right%generator_0 .and. & + left%generator_1 == right%generator_1 .and. & + left%outer_polynomial == right%outer_polynomial .and. & + left%outer_top_bit_mask == right%outer_top_bit_mask .and. & + left%outer_register_mask == right%outer_register_mask .and. & + left%payload_bits == right%payload_bits .and. & + left%outer_check_bits == right%outer_check_bits .and. & + left%information_bits == right%information_bits + end function jtty_tbcc_code_profiles_equal + +end module jtty_tbcc_code_profiles diff --git a/lib/jtty/jtty_tbcc_decoder.f90 b/lib/jtty/jtty_tbcc_decoder.f90 new file mode 100644 index 00000000..c010331d --- /dev/null +++ b/lib/jtty/jtty_tbcc_decoder.f90 @@ -0,0 +1,151 @@ +module jtty_tbcc_decoder + use, intrinsic :: iso_fortran_env, only: int32, int64, real32, real64 + use jtty_tbcc_code_profiles, only: JTTY_TBCC_PROFILE_1167_1545_80F + use jtty_tbcc_list_decoder, only: jtty_tbcc_decoder_plan, & + jtty_tbcc_decoder_workspace, jtty_tbcc_init_decoder_plan, & + jtty_tbcc_init_decoder_workspace, jtty_tbcc_list_wava_optimized, & + JTTY_TBCC_INFORMATION_BITS, JTTY_TBCC_MAX_HYPOTHESES + use tbcc, only: PAYLOAD_BITS + implicit none + private + + integer(int32), parameter :: COHERENT_LENGTHS(3) = [1_int32, 2_int32, 4_int32] + integer(int32), parameter :: CIRCULAR_PASSES = 2_int32 + + type, public :: jtty_tbcc_decode_result + integer(int32) :: accepted_hypothesis_rank = 0_int32 + integer(int32) :: exported_candidate_count = 0_int32 + integer(int32) :: circular_candidate_count = 0_int32 + integer(int32) :: coherent_block_length = 0_int32 + integer(int32) :: evaluated_rung_count = 0_int32 + integer(int64) :: accepted_identity = 0_int64 + real(real64) :: accepted_metric = -huge(0.0_real64) + logical :: used_half_symbol_observation = .false. + end type jtty_tbcc_decode_result + + type :: jtty_tbcc_rung_result + integer(int32) :: candidates(JTTY_TBCC_INFORMATION_BITS, & + JTTY_TBCC_MAX_HYPOTHESES) = 0_int32 + integer(int64) :: identities(JTTY_TBCC_MAX_HYPOTHESES) = 0_int64 + real(real64) :: clean_metrics(JTTY_TBCC_MAX_HYPOTHESES) = & + -huge(0.0_real64) + logical :: crc_valid(JTTY_TBCC_MAX_HYPOTHESES) = .false. + type(jtty_tbcc_decode_result) :: result + logical :: accepted = .false. + end type jtty_tbcc_rung_result + + logical, save :: decoders_initialized = .false. + type(jtty_tbcc_decoder_plan), save :: plans(3) + type(jtty_tbcc_decoder_workspace), save :: workspaces(3) + + public :: jtty_tbcc_decode + +contains + + subroutine jtty_tbcc_decode(correlations, half_correlations, payload, success, result) + complex(real32), intent(in) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + complex(real32), intent(in) :: half_correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + integer(int32), intent(out) :: payload(PAYLOAD_BITS) + logical, intent(out) :: success + type(jtty_tbcc_decode_result), intent(out), optional :: result + type(jtty_tbcc_decode_result) :: local_result + + !$omp critical(jtty_tbcc_decoder) + call initialize_decoders() + call decode_ladder(correlations, half_correlations, payload, success, local_result) + !$omp end critical(jtty_tbcc_decoder) + if (present(result)) result = local_result + end subroutine jtty_tbcc_decode + + subroutine initialize_decoders() + integer :: coherent_index + + if (decoders_initialized) return + + do coherent_index = 1, size(COHERENT_LENGTHS) + call jtty_tbcc_init_decoder_plan(plans(coherent_index), & + JTTY_TBCC_PROFILE_1167_1545_80F, & + COHERENT_LENGTHS(coherent_index), 4_int32, CIRCULAR_PASSES, & + JTTY_TBCC_MAX_HYPOTHESES) + call jtty_tbcc_init_decoder_workspace(workspaces(coherent_index), & + plans(coherent_index)) + end do + decoders_initialized = .true. + end subroutine initialize_decoders + + subroutine decode_ladder(correlations, half_correlations, payload, success, result) + complex(real32), intent(in) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + complex(real32), intent(in) :: half_correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + integer(int32), intent(out) :: payload(PAYLOAD_BITS) + logical, intent(out) :: success + type(jtty_tbcc_decode_result), intent(out) :: result + type(jtty_tbcc_rung_result) :: decoded_rung + integer :: rung + + payload = 0_int32 + success = .false. + result = jtty_tbcc_decode_result() + do rung = 1, size(COHERENT_LENGTHS) + call decode_rung(correlations, rung, decoded_rung) + if (.not.decoded_rung%accepted) cycle + call accept_rung(decoded_rung, rung, .false., payload, success, result) + return + end do + + ! Half-symbol energies discard phase, so only L1 is meaningful here. + call decode_rung(half_correlations, 1, decoded_rung) + if (decoded_rung%accepted) then + call accept_rung(decoded_rung, 4, .true., payload, success, result) + else + result%evaluated_rung_count = 4_int32 + end if + end subroutine decode_ladder + + subroutine decode_rung(correlations, coherent_index, rung) + complex(real32), intent(in) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + integer, intent(in) :: coherent_index + type(jtty_tbcc_rung_result), intent(out) :: rung + integer(int32) :: start_states(JTTY_TBCC_MAX_HYPOTHESES) + real(real64) :: path_metrics(JTTY_TBCC_MAX_HYPOTHESES) + integer(int32) :: candidate_count, pool_count, rank + + rung = jtty_tbcc_rung_result() + call jtty_tbcc_list_wava_optimized(plans(coherent_index), & + workspaces(coherent_index), correlations, rung%candidates, rung%identities, & + rung%clean_metrics, path_metrics, start_states, rung%crc_valid, & + candidate_count, pool_count, prune_reserved_zero=.true.) + + rung%result = jtty_tbcc_decode_result( & + exported_candidate_count=candidate_count, & + circular_candidate_count=pool_count, & + coherent_block_length=COHERENT_LENGTHS(coherent_index)) + do rank = 1, candidate_count + if (.not.rung%crc_valid(rank)) cycle + ! Do not expand the fixed false-accept budget past the all-zero sentinel. + if (all(rung%candidates(1:PAYLOAD_BITS, rank) == 0_int32)) exit + rung%accepted = .true. + rung%result%accepted_hypothesis_rank = rank + rung%result%accepted_identity = rung%identities(rank) + rung%result%accepted_metric = rung%clean_metrics(rank) + exit + end do + end subroutine decode_rung + + subroutine accept_rung(rung, evaluated_rung_count, half_symbol, payload, success, result) + type(jtty_tbcc_rung_result), intent(in) :: rung + integer, intent(in) :: evaluated_rung_count + logical, intent(in) :: half_symbol + integer(int32), intent(out) :: payload(PAYLOAD_BITS) + logical, intent(out) :: success + type(jtty_tbcc_decode_result), intent(out) :: result + integer :: rank + + rank = rung%result%accepted_hypothesis_rank + payload = rung%candidates(1:PAYLOAD_BITS, rank) + success = .true. + result = rung%result + result%evaluated_rung_count = evaluated_rung_count + result%used_half_symbol_observation = half_symbol + end subroutine accept_rung + +end module jtty_tbcc_decoder diff --git a/lib/jtty/jtty_tbcc_list_decoder.f90 b/lib/jtty/jtty_tbcc_list_decoder.f90 new file mode 100644 index 00000000..ca4a4bd1 --- /dev/null +++ b/lib/jtty/jtty_tbcc_list_decoder.f90 @@ -0,0 +1,1168 @@ +module jtty_tbcc_list_decoder + use, intrinsic :: iso_fortran_env, only: int32, int64, real32, real64 + use, intrinsic :: ieee_arithmetic, only: ieee_is_finite + use jtty_tbcc_code_profiles, only: jtty_tbcc_code_profile, & + jtty_tbcc_code_profile_is_supported, JTTY_TBCC_INFORMATION_BITS + implicit none + private + + ! This module keeps decoder breadth and admission breadth separate. The + ! shorthand P1/P4 means retaining one/four distinct paths at every trellis + ! merge. H1/H4 means returning at most one/four unique, closed codewords to + ! the CRC admission layer. A wider path search therefore does not silently + ! increase the number of CRC hypotheses tested. + + public :: JTTY_TBCC_INFORMATION_BITS + integer(int32), parameter, public :: JTTY_TBCC_RESERVED_BIT = 33_int32 + integer(int32), parameter, public :: JTTY_TBCC_MAX_HYPOTHESES = 4_int32 + real(real64), parameter :: NEGATIVE_METRIC = -huge(0.0_real64) + + type :: survivor_t + logical :: valid = .false. + real(real64) :: metric = NEGATIVE_METRIC + integer(int32) :: origin_state = -1_int32 + integer(int32) :: bits(JTTY_TBCC_INFORMATION_BITS) = 0_int32 + end type survivor_t + + type :: pool_candidate_t + integer(int32) :: bits(JTTY_TBCC_INFORMATION_BITS) = 0_int32 + integer(int32) :: start_state = -1_int32 + integer(int64) :: identity = 0_int64 + real(real64) :: clean_metric = NEGATIVE_METRIC + real(real64) :: wava_metric = NEGATIVE_METRIC + logical :: crc_valid = .false. + end type pool_candidate_t + + integer(int32), parameter :: PACKED_ORIGIN_BITS = 11_int32 + integer(int32), parameter :: PACKED_VALID_BIT = JTTY_TBCC_INFORMATION_BITS + PACKED_ORIGIN_BITS + + type :: packed_survivor_t + real(real64) :: metric = NEGATIVE_METRIC + ! Low bits hold the input word in lexical order, then origin and validity. + ! Unwritten input bits stay zero, so integer order also orders every prefix. + integer(int64) :: key = 0_int64 + end type packed_survivor_t + + type, public :: jtty_tbcc_decoder_plan + private + ! Immutable trellis geometry and coherent branch tables shared by decodes. + logical :: initialized = .false. + type(jtty_tbcc_code_profile) :: code + integer(int32) :: coherent_length = 0_int32 + integer(int32) :: per_state_width = 0_int32 + integer(int32) :: wraps = 0_int32 + integer(int32) :: hypothesis_count = 0_int32 + integer(int32) :: state_count = 0_int32 + integer(int32) :: block_count = 0_int32 + integer(int32) :: max_branch_count = 0_int32 + integer(int32) :: pool_capacity = 0_int32 + integer(int32) :: hash_capacity = 0_int32 + integer(int32) :: energy_count = 0_int32 + integer(int32), allocatable :: next_state(:,:), tone(:,:) + integer(int32), allocatable :: block_starts(:), block_lengths(:) + integer(int32), allocatable :: branch_counts(:), energy_offsets(:) + integer(int32), allocatable :: branch_end_states(:,:,:) + integer(int32), allocatable :: branch_sequence_indices(:,:,:) + integer(int64), allocatable :: branch_identities(:,:) + end type jtty_tbcc_decoder_plan + + type, public :: jtty_tbcc_decoder_workspace + private + ! Reusable scratch storage keeps allocation outside the receiver hot path. + logical :: initialized = .false. + type(packed_survivor_t), allocatable :: previous(:,:), current(:,:) + type(pool_candidate_t), allocatable :: pool(:) + integer(int32), allocatable :: order(:), sort_scratch(:), hash_indices(:) + integer(int64), allocatable :: hash_keys(:) + real(real64), allocatable :: sequence_energies(:) + logical, allocatable :: hash_used(:) + end type jtty_tbcc_decoder_workspace + + public :: jtty_tbcc_transition + public :: jtty_tbcc_supertransition + public :: jtty_tbcc_coherent_metric + public :: jtty_tbcc_score_candidate + public :: jtty_tbcc_tailbiting_state + public :: jtty_tbcc_candidate_identity + public :: jtty_tbcc_crc_valid + public :: jtty_tbcc_list_wava + public :: jtty_tbcc_list_wava_reference + public :: jtty_tbcc_init_decoder_plan + public :: jtty_tbcc_init_decoder_workspace + public :: jtty_tbcc_list_wava_optimized + +contains + + pure subroutine jtty_tbcc_transition(code, state, input_bit, next_state, tone) + type(jtty_tbcc_code_profile), intent(in) :: code + integer(int32), intent(in) :: state, input_bit + integer(int32), intent(out) :: next_state, tone + integer(int32) :: output_register, out_b0, out_b1, state_mask + + state_mask = code%state_mask + output_register = iand(ior(shiftl(state, 1), input_bit), & + code%register_mask) + out_b0 = modulo(popcnt(iand(output_register, code%generator_0)), 2) + out_b1 = modulo(popcnt(iand(output_register, code%generator_1)), 2) + tone = 2_int32*out_b0 + ieor(out_b0, out_b1) + next_state = iand(output_register, state_mask) + end subroutine jtty_tbcc_transition + + pure subroutine jtty_tbcc_supertransition(code, start_state, input_bits, & + end_state, tones) + type(jtty_tbcc_code_profile), intent(in) :: code + integer(int32), intent(in) :: start_state + integer(int32), intent(in) :: input_bits(:) + integer(int32), intent(out) :: end_state + integer(int32), intent(out) :: tones(size(input_bits)) + integer(int32) :: offset, state + + state = start_state + do offset = 1, size(input_bits) + call jtty_tbcc_transition(code, state, input_bits(offset), & + end_state, tones(offset)) + state = end_state + end do + end_state = state + end subroutine jtty_tbcc_supertransition + + pure real(real64) function jtty_tbcc_coherent_metric(correlations, & + first_symbol, tones) result(metric) + complex(real32), intent(in) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + integer(int32), intent(in) :: first_symbol + integer(int32), intent(in) :: tones(:) + complex(real32) :: coherent_sum + integer(int32) :: offset + + coherent_sum = cmplx(0.0_real32, 0.0_real32, real32) + do offset = 1, size(tones) + coherent_sum = coherent_sum + & + correlations(tones(offset), first_symbol + offset - 1) + end do + metric = real(coherent_sum*conjg(coherent_sum), real64) / & + real(size(tones), real64) + end function jtty_tbcc_coherent_metric + + pure integer(int32) function jtty_tbcc_tailbiting_state(code, bits) & + result(state) + type(jtty_tbcc_code_profile), intent(in) :: code + integer(int32), intent(in) :: bits(JTTY_TBCC_INFORMATION_BITS) + integer(int32) :: bit_index, state_mask + + state = 0_int32 + state_mask = code%state_mask + do bit_index = JTTY_TBCC_INFORMATION_BITS - code%memory_nu + 1, & + JTTY_TBCC_INFORMATION_BITS + state = iand(ior(shiftl(state, 1), bits(bit_index)), state_mask) + end do + end function jtty_tbcc_tailbiting_state + + pure subroutine jtty_tbcc_score_candidate(code, correlations, & + coherent_length, bits, metric, closed) + type(jtty_tbcc_code_profile), intent(in) :: code + complex(real32), intent(in) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + integer(int32), intent(in) :: coherent_length + integer(int32), intent(in) :: bits(JTTY_TBCC_INFORMATION_BITS) + real(real64), intent(out) :: metric + logical, intent(out) :: closed + integer(int32) :: block_length, block_start, end_state, next_state, start_state + integer(int32) :: tones(4) + + start_state = jtty_tbcc_tailbiting_state(code, bits) + end_state = start_state + metric = 0.0_real64 + do block_start = 1, JTTY_TBCC_INFORMATION_BITS, coherent_length + block_length = min(coherent_length, & + JTTY_TBCC_INFORMATION_BITS - block_start + 1_int32) + call jtty_tbcc_supertransition(code, end_state, & + bits(block_start:block_start + block_length - 1), next_state, & + tones(1:block_length)) + metric = metric + jtty_tbcc_coherent_metric(correlations, & + block_start, tones(1:block_length)) + end_state = next_state + end do + closed = end_state == start_state + end subroutine jtty_tbcc_score_candidate + + pure integer(int64) function jtty_tbcc_candidate_identity(bits) & + result(identity) + integer(int32), intent(in) :: bits(JTTY_TBCC_INFORMATION_BITS) + integer(int32) :: bit_index + + identity = 0_int64 + do bit_index = 1, JTTY_TBCC_INFORMATION_BITS + if (bits(bit_index) /= 0_int32) identity = ibset(identity, bit_index - 1) + end do + end function jtty_tbcc_candidate_identity + + pure logical function jtty_tbcc_crc_valid(code, bits) result(valid) + type(jtty_tbcc_code_profile), intent(in) :: code + integer(int32), intent(in) :: bits(JTTY_TBCC_INFORMATION_BITS) + integer(int32) :: bit_index, crc_register + + crc_register = 0_int32 + do bit_index = 1, JTTY_TBCC_INFORMATION_BITS + crc_register = ieor(crc_register, & + shiftl(bits(bit_index), code%outer_check_bits - 1_int32)) + if (iand(crc_register, code%outer_top_bit_mask) /= 0_int32) then + crc_register = ieor(shiftl(crc_register, 1), code%outer_polynomial) + else + crc_register = shiftl(crc_register, 1) + end if + crc_register = iand(crc_register, code%outer_register_mask) + end do + valid = crc_register == 0_int32 + end function jtty_tbcc_crc_valid + + subroutine jtty_tbcc_init_decoder_plan(plan, code, coherent_length, & + per_state_width, wraps, hypothesis_count) + type(jtty_tbcc_decoder_plan), intent(out) :: plan + type(jtty_tbcc_code_profile), intent(in) :: code + integer(int32), intent(in) :: coherent_length, per_state_width, wraps + integer(int32), intent(in) :: hypothesis_count + integer(int32) :: block_index, block_length, block_start, branch_word + integer(int32) :: end_state, input_bit, offset, state, tone_word + integer(int32) :: input_bits(4), tones(4) + integer(int64) :: branch_identity + + call validate_decoder_arguments(code, coherent_length, per_state_width, & + wraps, hypothesis_count) + if (code%memory_nu > PACKED_ORIGIN_BITS) error stop 'TBCC state does not fit packed survivor' + plan%code = code + plan%coherent_length = coherent_length + plan%per_state_width = per_state_width + plan%wraps = wraps + plan%hypothesis_count = hypothesis_count + plan%state_count = code%state_count + plan%block_count = (JTTY_TBCC_INFORMATION_BITS + coherent_length - 1_int32) / & + coherent_length + plan%max_branch_count = shiftl(1_int32, coherent_length) + plan%pool_capacity = plan%state_count*per_state_width + plan%hash_capacity = 1_int32 + do while (plan%hash_capacity < 2_int32*plan%pool_capacity) + plan%hash_capacity = 2_int32*plan%hash_capacity + end do + + allocate(plan%next_state(0:plan%state_count - 1, 0:1)) + allocate(plan%tone(0:plan%state_count - 1, 0:1)) + do input_bit = 0, 1 + do state = 0, plan%state_count - 1 + call jtty_tbcc_transition(code, state, input_bit, & + plan%next_state(state, input_bit), plan%tone(state, input_bit)) + end do + end do + + allocate(plan%block_starts(plan%block_count), plan%block_lengths(plan%block_count)) + allocate(plan%branch_counts(plan%block_count), plan%energy_offsets(plan%block_count)) + allocate(plan%branch_identities(0:plan%max_branch_count - 1, plan%block_count)) + allocate(plan%branch_end_states(0:plan%state_count - 1, & + 0:plan%max_branch_count - 1, plan%block_count)) + allocate(plan%branch_sequence_indices(0:plan%state_count - 1, & + 0:plan%max_branch_count - 1, plan%block_count)) + plan%branch_identities = 0_int64 + plan%branch_end_states = 0_int32 + plan%branch_sequence_indices = 0_int32 + plan%energy_count = 0_int32 + do block_index = 1, plan%block_count + block_start = 1_int32 + (block_index - 1_int32)*coherent_length + block_length = min(coherent_length, & + JTTY_TBCC_INFORMATION_BITS - block_start + 1_int32) + plan%block_starts(block_index) = block_start + plan%block_lengths(block_index) = block_length + plan%branch_counts(block_index) = shiftl(1_int32, block_length) + plan%energy_offsets(block_index) = plan%energy_count + 1_int32 + plan%energy_count = plan%energy_count + shiftl(1_int32, 2_int32*block_length) + do branch_word = 0, plan%branch_counts(block_index) - 1 + call unpack_branch_word(branch_word, block_length, input_bits) + branch_identity = 0_int64 + do offset = 1, block_length + if (input_bits(offset) /= 0_int32) & + branch_identity = ibset(branch_identity, JTTY_TBCC_INFORMATION_BITS - block_start - offset + 1_int32) + end do + plan%branch_identities(branch_word, block_index) = branch_identity + do state = 0, plan%state_count - 1 + call planned_supertransition(plan, state, input_bits, block_length, & + end_state, tones, tone_word) + plan%branch_end_states(state, branch_word, block_index) = end_state + plan%branch_sequence_indices(state, branch_word, block_index) = & + plan%energy_offsets(block_index) + tone_word + end do + end do + end do + plan%initialized = .true. + end subroutine jtty_tbcc_init_decoder_plan + + subroutine jtty_tbcc_init_decoder_workspace(workspace, plan) + type(jtty_tbcc_decoder_workspace), intent(out) :: workspace + type(jtty_tbcc_decoder_plan), intent(in) :: plan + + if (.not.plan%initialized) error stop 'TBCC list decoder plan is not initialized' + allocate(workspace%previous(0:plan%state_count - 1, plan%per_state_width)) + allocate(workspace%current(0:plan%state_count - 1, plan%per_state_width)) + allocate(workspace%pool(max(1_int32, plan%pool_capacity))) + allocate(workspace%order(max(1_int32, plan%pool_capacity))) + allocate(workspace%sort_scratch(max(1_int32, plan%pool_capacity))) + allocate(workspace%hash_keys(plan%hash_capacity)) + allocate(workspace%hash_indices(plan%hash_capacity)) + allocate(workspace%hash_used(plan%hash_capacity)) + allocate(workspace%sequence_energies(plan%energy_count)) + workspace%initialized = .true. + end subroutine jtty_tbcc_init_decoder_workspace + + subroutine jtty_tbcc_list_wava(correlations, code, coherent_length, & + per_state_width, wraps, hypothesis_count, candidate_bits, & + candidate_identities, candidate_clean_metrics, candidate_wava_metrics, & + candidate_start_states, candidate_crc_valid, candidate_count, pool_count, & + prune_reserved_zero, reference_bits, reference_present, & + reference_pool_rank, reference_h_rank) + complex(real32), intent(in) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + type(jtty_tbcc_code_profile), intent(in) :: code + integer(int32), intent(in) :: coherent_length, per_state_width, wraps + integer(int32), intent(in) :: hypothesis_count + integer(int32), intent(out) :: candidate_bits(JTTY_TBCC_INFORMATION_BITS, hypothesis_count) + integer(int64), intent(out) :: candidate_identities(hypothesis_count) + real(real64), intent(out) :: candidate_clean_metrics(hypothesis_count) + real(real64), intent(out) :: candidate_wava_metrics(hypothesis_count) + integer(int32), intent(out) :: candidate_start_states(hypothesis_count) + logical, intent(out) :: candidate_crc_valid(hypothesis_count) + integer(int32), intent(out) :: candidate_count, pool_count + logical, intent(in), optional :: prune_reserved_zero + integer(int32), intent(in), optional :: reference_bits(JTTY_TBCC_INFORMATION_BITS) + logical, intent(out), optional :: reference_present + integer(int32), intent(out), optional :: reference_pool_rank, reference_h_rank + type(jtty_tbcc_decoder_plan) :: plan + type(jtty_tbcc_decoder_workspace) :: workspace + + call jtty_tbcc_init_decoder_plan(plan, code, coherent_length, & + per_state_width, wraps, hypothesis_count) + call jtty_tbcc_init_decoder_workspace(workspace, plan) + call jtty_tbcc_list_wava_optimized(plan, workspace, correlations, & + candidate_bits, candidate_identities, candidate_clean_metrics, & + candidate_wava_metrics, candidate_start_states, candidate_crc_valid, & + candidate_count, pool_count, prune_reserved_zero, reference_bits, & + reference_present, reference_pool_rank, reference_h_rank) + end subroutine jtty_tbcc_list_wava + + subroutine jtty_tbcc_list_wava_optimized(plan, workspace, correlations, & + candidate_bits, candidate_identities, candidate_clean_metrics, & + candidate_wava_metrics, candidate_start_states, candidate_crc_valid, & + candidate_count, pool_count, prune_reserved_zero, reference_bits, & + reference_present, reference_pool_rank, reference_h_rank) + type(jtty_tbcc_decoder_plan), intent(in) :: plan + type(jtty_tbcc_decoder_workspace), intent(inout) :: workspace + complex(real32), intent(in) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + integer(int32), intent(out) :: candidate_bits(:, :) + integer(int64), intent(out) :: candidate_identities(:) + real(real64), intent(out) :: candidate_clean_metrics(:), candidate_wava_metrics(:) + integer(int32), intent(out) :: candidate_start_states(:) + logical, intent(out) :: candidate_crc_valid(:) + integer(int32), intent(out) :: candidate_count, pool_count + logical, intent(in), optional :: prune_reserved_zero + integer(int32), intent(in), optional :: reference_bits(JTTY_TBCC_INFORMATION_BITS) + logical, intent(out), optional :: reference_present + integer(int32), intent(out), optional :: reference_pool_rank, reference_h_rank + type(packed_survivor_t), allocatable :: swap_survivors(:,:) + integer(int32) :: block_index, hash_slot + integer(int32) :: output_rank, pool_index, rank, state, wrap + integer(int64) :: identity, reference_identity + real(real64) :: clean_metric + logical :: closed, found, prune, ordered_metrics + + call validate_optimized_storage(plan, workspace, candidate_bits, & + candidate_identities, candidate_clean_metrics, candidate_wava_metrics, & + candidate_start_states, candidate_crc_valid) + call precompute_sequence_energies(plan, correlations, workspace%sequence_energies) + ! Nonfinite metrics do not provide the monotone rank order needed by the cutoff. + ordered_metrics = all(ieee_is_finite(workspace%sequence_energies)) + call clear_packed_survivors(workspace%previous) + do state = 0, plan%state_count - 1 + workspace%previous(state, 1)%key = ibset(shiftl(int(state, int64), JTTY_TBCC_INFORMATION_BITS), PACKED_VALID_BIT) + workspace%previous(state, 1)%metric = 0.0_real64 + end do + + prune = .false. + if (present(prune_reserved_zero)) prune = prune_reserved_zero + do wrap = 1, plan%wraps + call reset_packed_frame_identity(workspace%previous) + do block_index = 1, plan%block_count + call advance_packed_survivors(plan, block_index, prune, workspace%sequence_energies, & + workspace%previous, workspace%current, ordered_metrics) + call move_alloc(workspace%previous, swap_survivors) + call move_alloc(workspace%current, workspace%previous) + call move_alloc(swap_survivors, workspace%current) + end do + end do + + pool_count = 0_int32 + workspace%hash_used = .false. + do state = 0, plan%state_count - 1 + do rank = 1, plan%per_state_width + if (.not.btest(workspace%previous(state, rank)%key, PACKED_VALID_BIT)) cycle + ! Tail-biting paths are eligible only when their final and remembered + ! initial states agree after the last wrap. + if (ibits(workspace%previous(state, rank)%key, & + JTTY_TBCC_INFORMATION_BITS, PACKED_ORIGIN_BITS) /= state) cycle + identity = reverse_identity(workspace%previous(state, rank)%key) + ! The same complete word can close through more than one retained path; + ! hash by all 46 bits before applying the global hypothesis limit. + call locate_identity(identity, workspace%hash_keys, workspace%hash_indices, & + workspace%hash_used, hash_slot, pool_index, found) + if (found) then + if (workspace%previous(state, rank)%metric > & + workspace%pool(pool_index)%wava_metric .or. & + (.not.(workspace%previous(state, rank)%metric < & + workspace%pool(pool_index)%wava_metric) .and. & + state < workspace%pool(pool_index)%start_state)) then + workspace%pool(pool_index)%wava_metric = & + workspace%previous(state, rank)%metric + workspace%pool(pool_index)%start_state = state + end if + cycle + end if + pool_count = pool_count + 1_int32 + pool_index = pool_count + workspace%hash_used(hash_slot) = .true. + workspace%hash_keys(hash_slot) = identity + workspace%hash_indices(hash_slot) = pool_index + workspace%pool(pool_index)%identity = identity + workspace%pool(pool_index)%start_state = state + workspace%pool(pool_index)%wava_metric = workspace%previous(state, rank)%metric + call unpack_identity(identity, workspace%pool(pool_index)%bits) + ! WAVA survivor metrics include history from earlier wraps. Admission + ! order is based on a clean, single-frame score of each complete word. + call score_planned_identity(plan, workspace%sequence_energies, identity, & + clean_metric, closed) + if (.not.closed) error stop 'closed TBCC survivor failed clean scoring closure' + workspace%pool(pool_index)%clean_metric = clean_metric + ! This flag reports the polynomial remainder only. Message admission, + ! including the protocol's all-zero rejection, remains with the caller. + workspace%pool(pool_index)%crc_valid = & + jtty_tbcc_crc_valid(plan%code, workspace%pool(pool_index)%bits) + end do + end do + + do pool_index = 1, pool_count + workspace%order(pool_index) = pool_index + end do + call sort_candidate_order_with_scratch(workspace%pool, workspace%order, & + workspace%sort_scratch, pool_count) + candidate_bits = 0_int32 + candidate_identities = 0_int64 + candidate_clean_metrics = NEGATIVE_METRIC + candidate_wava_metrics = NEGATIVE_METRIC + candidate_start_states = -1_int32 + candidate_crc_valid = .false. + candidate_count = min(plan%hypothesis_count, pool_count) + do output_rank = 1, candidate_count + pool_index = workspace%order(output_rank) + candidate_bits(:, output_rank) = workspace%pool(pool_index)%bits + candidate_identities(output_rank) = workspace%pool(pool_index)%identity + candidate_clean_metrics(output_rank) = workspace%pool(pool_index)%clean_metric + candidate_wava_metrics(output_rank) = workspace%pool(pool_index)%wava_metric + candidate_start_states(output_rank) = workspace%pool(pool_index)%start_state + candidate_crc_valid(output_rank) = workspace%pool(pool_index)%crc_valid + end do + + if (present(reference_present)) reference_present = .false. + if (present(reference_pool_rank)) reference_pool_rank = 0_int32 + if (present(reference_h_rank)) reference_h_rank = 0_int32 + if (present(reference_bits)) then + reference_identity = jtty_tbcc_candidate_identity(reference_bits) + do output_rank = 1, pool_count + pool_index = workspace%order(output_rank) + if (workspace%pool(pool_index)%identity /= reference_identity) cycle + if (present(reference_present)) reference_present = .true. + if (present(reference_pool_rank)) reference_pool_rank = output_rank + if (present(reference_h_rank)) then + if (output_rank <= candidate_count) reference_h_rank = output_rank + end if + exit + end do + end if + end subroutine jtty_tbcc_list_wava_optimized + + subroutine jtty_tbcc_list_wava_reference(correlations, code, coherent_length, & + per_state_width, wraps, hypothesis_count, candidate_bits, & + candidate_identities, candidate_clean_metrics, candidate_wava_metrics, & + candidate_start_states, candidate_crc_valid, candidate_count, pool_count, & + prune_reserved_zero, reference_bits, reference_present, & + reference_pool_rank, reference_h_rank) + complex(real32), intent(in) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + type(jtty_tbcc_code_profile), intent(in) :: code + integer(int32), intent(in) :: coherent_length, per_state_width, wraps + integer(int32), intent(in) :: hypothesis_count + integer(int32), intent(out) :: candidate_bits(JTTY_TBCC_INFORMATION_BITS, hypothesis_count) + integer(int64), intent(out) :: candidate_identities(hypothesis_count) + real(real64), intent(out) :: candidate_clean_metrics(hypothesis_count) + real(real64), intent(out) :: candidate_wava_metrics(hypothesis_count) + integer(int32), intent(out) :: candidate_start_states(hypothesis_count) + logical, intent(out) :: candidate_crc_valid(hypothesis_count) + integer(int32), intent(out) :: candidate_count, pool_count + logical, intent(in), optional :: prune_reserved_zero + integer(int32), intent(in), optional :: reference_bits(JTTY_TBCC_INFORMATION_BITS) + logical, intent(out), optional :: reference_present + integer(int32), intent(out), optional :: reference_pool_rank + integer(int32), intent(out), optional :: reference_h_rank + type(survivor_t), allocatable :: previous(:,:), current(:,:) + type(pool_candidate_t), allocatable :: pool(:) + integer(int32), allocatable :: order(:), hash_indices(:) + integer(int32), allocatable :: block_starts(:), block_lengths(:) + integer(int32), allocatable :: branch_bits(:,:,:), branch_end_states(:,:,:) + integer(int64), allocatable :: hash_keys(:) + real(real64), allocatable :: branch_metrics(:,:,:) + logical, allocatable :: hash_used(:) + integer(int32) :: block_length, block_start, branch_count, branch_word + integer(int32) :: block_count, block_index, max_branch_count + integer(int32) :: state_count, state, rank, wrap, end_state, output_rank + integer(int32) :: input_bits(4), tones(4), pool_capacity, hash_capacity + integer(int32) :: pool_index, hash_slot + integer(int64) :: identity, reference_identity + real(real64) :: branch_metric, clean_metric + logical :: prune, closed, found + type(survivor_t) :: extension + + call validate_decoder_arguments(code, coherent_length, per_state_width, & + wraps, hypothesis_count) + state_count = code%state_count + block_count = (JTTY_TBCC_INFORMATION_BITS + coherent_length - 1_int32) / coherent_length + max_branch_count = shiftl(1_int32, coherent_length) + pool_capacity = state_count*per_state_width + hash_capacity = 1_int32 + do while (hash_capacity < 2_int32*pool_capacity) + hash_capacity = 2_int32*hash_capacity + end do + + allocate(previous(0:state_count - 1, per_state_width)) + allocate(current(0:state_count - 1, per_state_width)) + allocate(pool(max(1_int32, pool_capacity))) + allocate(order(max(1_int32, pool_capacity))) + allocate(hash_keys(hash_capacity), hash_indices(hash_capacity)) + allocate(hash_used(hash_capacity)) + allocate(block_starts(block_count), block_lengths(block_count)) + allocate(branch_bits(4, 0:max_branch_count - 1, block_count)) + allocate(branch_end_states(0:state_count - 1, 0:max_branch_count - 1, block_count)) + allocate(branch_metrics(0:state_count - 1, 0:max_branch_count - 1, block_count)) + branch_bits = 0_int32 + branch_end_states = 0_int32 + branch_metrics = 0.0_real64 + do block_index = 1, block_count + block_start = 1_int32 + (block_index - 1_int32)*coherent_length + block_length = min(coherent_length, & + JTTY_TBCC_INFORMATION_BITS - block_start + 1_int32) + block_starts(block_index) = block_start + block_lengths(block_index) = block_length + branch_count = shiftl(1_int32, block_length) + do branch_word = 0, branch_count - 1 + call unpack_branch_word(branch_word, block_length, input_bits) + branch_bits(:, branch_word, block_index) = input_bits + do state = 0, state_count - 1 + call jtty_tbcc_supertransition(code, state, & + input_bits(1:block_length), end_state, tones(1:block_length)) + branch_end_states(state, branch_word, block_index) = end_state + branch_metrics(state, branch_word, block_index) = & + jtty_tbcc_coherent_metric(correlations, block_start, & + tones(1:block_length)) + end do + end do + end do + call clear_survivors(previous) + do state = 0, state_count - 1 + previous(state, 1)%valid = .true. + previous(state, 1)%metric = 0.0_real64 + previous(state, 1)%origin_state = state + end do + + prune = .false. + if (present(prune_reserved_zero)) prune = prune_reserved_zero + do wrap = 1, wraps + call reset_frame_identity(previous) + do block_index = 1, block_count + block_start = block_starts(block_index) + block_length = block_lengths(block_index) + branch_count = shiftl(1_int32, block_length) + call clear_survivors(current) + do state = 0, state_count - 1 + do rank = 1, per_state_width + if (.not.previous(state, rank)%valid) cycle + do branch_word = 0, branch_count - 1 + if (prune .and. block_contains_reserved(block_start, block_length)) then + if (branch_bits(JTTY_TBCC_RESERVED_BIT - block_start + 1, & + branch_word, block_index) /= & + 0_int32) cycle + end if + end_state = branch_end_states(state, branch_word, block_index) + branch_metric = branch_metrics(state, branch_word, block_index) + extension = previous(state, rank) + extension%metric = extension%metric + branch_metric + extension%bits(block_start:block_start + block_length - 1) = & + branch_bits(1:block_length, branch_word, block_index) + call insert_survivor(current(end_state, :), extension, & + block_start + block_length - 1_int32) + end do + end do + end do + previous = current + end do + end do + + pool_count = 0_int32 + hash_used = .false. + hash_keys = 0_int64 + hash_indices = 0_int32 + do state = 0, state_count - 1 + do rank = 1, per_state_width + if (.not.previous(state, rank)%valid) cycle + if (previous(state, rank)%origin_state /= state) cycle + identity = jtty_tbcc_candidate_identity(previous(state, rank)%bits) + call locate_identity(identity, hash_keys, hash_indices, hash_used, & + hash_slot, pool_index, found) + if (found) then + if (previous(state, rank)%metric > pool(pool_index)%wava_metric .or. & + (.not.(previous(state, rank)%metric < pool(pool_index)%wava_metric) .and. & + state < pool(pool_index)%start_state)) then + pool(pool_index)%wava_metric = previous(state, rank)%metric + pool(pool_index)%start_state = state + end if + cycle + end if + pool_count = pool_count + 1_int32 + pool_index = pool_count + hash_used(hash_slot) = .true. + hash_keys(hash_slot) = identity + hash_indices(hash_slot) = pool_index + pool(pool_index)%bits = previous(state, rank)%bits + pool(pool_index)%identity = identity + pool(pool_index)%start_state = state + pool(pool_index)%wava_metric = previous(state, rank)%metric + call jtty_tbcc_score_candidate(code, correlations, coherent_length, & + pool(pool_index)%bits, clean_metric, closed) + if (.not.closed) error stop 'closed TBCC survivor failed clean scoring closure' + pool(pool_index)%clean_metric = clean_metric + pool(pool_index)%crc_valid = jtty_tbcc_crc_valid(code, pool(pool_index)%bits) + end do + end do + + do pool_index = 1, pool_count + order(pool_index) = pool_index + end do + call sort_candidate_order(pool, order, pool_count) + candidate_bits = 0_int32 + candidate_identities = 0_int64 + candidate_clean_metrics = NEGATIVE_METRIC + candidate_wava_metrics = NEGATIVE_METRIC + candidate_start_states = -1_int32 + candidate_crc_valid = .false. + candidate_count = min(hypothesis_count, pool_count) + do output_rank = 1, candidate_count + pool_index = order(output_rank) + candidate_bits(:, output_rank) = pool(pool_index)%bits + candidate_identities(output_rank) = pool(pool_index)%identity + candidate_clean_metrics(output_rank) = pool(pool_index)%clean_metric + candidate_wava_metrics(output_rank) = pool(pool_index)%wava_metric + candidate_start_states(output_rank) = pool(pool_index)%start_state + candidate_crc_valid(output_rank) = pool(pool_index)%crc_valid + end do + + if (present(reference_present)) reference_present = .false. + if (present(reference_pool_rank)) reference_pool_rank = 0_int32 + if (present(reference_h_rank)) reference_h_rank = 0_int32 + if (present(reference_bits)) then + reference_identity = jtty_tbcc_candidate_identity(reference_bits) + do output_rank = 1, pool_count + pool_index = order(output_rank) + if (pool(pool_index)%identity /= reference_identity) cycle + if (.not.all(pool(pool_index)%bits == reference_bits)) cycle + if (present(reference_present)) reference_present = .true. + if (present(reference_pool_rank)) reference_pool_rank = output_rank + if (present(reference_h_rank)) then + if (output_rank <= candidate_count) reference_h_rank = output_rank + end if + exit + end do + end if + + deallocate(previous, current, pool, order, hash_keys, hash_indices, hash_used) + deallocate(block_starts, block_lengths, branch_bits, branch_end_states, branch_metrics) + end subroutine jtty_tbcc_list_wava_reference + + + pure subroutine planned_supertransition(plan, start_state, input_bits, & + block_length, end_state, tones, tone_word) + type(jtty_tbcc_decoder_plan), intent(in) :: plan + integer(int32), intent(in) :: start_state, input_bits(4), block_length + integer(int32), intent(out) :: end_state, tones(4), tone_word + integer(int32) :: offset, state + + state = start_state + tones = 0_int32 + tone_word = 0_int32 + do offset = 1, block_length + tones(offset) = plan%tone(state, input_bits(offset)) + tone_word = 4_int32*tone_word + tones(offset) + state = plan%next_state(state, input_bits(offset)) + end do + end_state = state + end subroutine planned_supertransition + + subroutine precompute_sequence_energies(plan, correlations, energies) + type(jtty_tbcc_decoder_plan), intent(in) :: plan + complex(real32), intent(in) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + real(real64), intent(out) :: energies(:) + complex(real32) :: coherent_sum + integer(int32) :: block_index, block_length, block_start + integer(int32) :: offset, sequence_count, sequence_word, tone + + do block_index = 1, plan%block_count + block_start = plan%block_starts(block_index) + block_length = plan%block_lengths(block_index) + sequence_count = shiftl(1_int32, 2_int32*block_length) + do sequence_word = 0, sequence_count - 1 + coherent_sum = cmplx(0.0_real32, 0.0_real32, real32) + do offset = 1, block_length + tone = ibits(sequence_word, 2_int32*(block_length - offset), 2) + coherent_sum = coherent_sum + correlations(tone, block_start + offset - 1_int32) + end do + energies(plan%energy_offsets(block_index) + sequence_word) = & + real(coherent_sum*conjg(coherent_sum), real64) / real(block_length, real64) + end do + end do + end subroutine precompute_sequence_energies + + subroutine score_planned_identity(plan, energies, identity, metric, closed) + type(jtty_tbcc_decoder_plan), intent(in) :: plan + real(real64), intent(in) :: energies(:) + integer(int64), intent(in) :: identity + real(real64), intent(out) :: metric + logical, intent(out) :: closed + integer(int32) :: bit_index, block_index, branch_word, offset, state, start_state + + start_state = 0_int32 + do bit_index = JTTY_TBCC_INFORMATION_BITS - plan%code%memory_nu + 1, & + JTTY_TBCC_INFORMATION_BITS + start_state = iand(ior(shiftl(start_state, 1), & + merge(1_int32, 0_int32, btest(identity, bit_index - 1))), & + plan%state_count - 1_int32) + end do + state = start_state + metric = 0.0_real64 + do block_index = 1, plan%block_count + branch_word = 0_int32 + do offset = 0, plan%block_lengths(block_index) - 1 + branch_word = 2_int32*branch_word + merge(1_int32, 0_int32, & + btest(identity, plan%block_starts(block_index) + offset - 1_int32)) + end do + metric = metric + energies( & + plan%branch_sequence_indices(state, branch_word, block_index)) + state = plan%branch_end_states(state, branch_word, block_index) + end do + closed = state == start_state + end subroutine score_planned_identity + + pure integer(int64) function reverse_identity(key) result(identity) + integer(int64), intent(in) :: key + integer(int32) :: bit_index + + identity = 0_int64 + do bit_index = 0, JTTY_TBCC_INFORMATION_BITS - 1 + if (btest(key, bit_index)) identity = ibset(identity, JTTY_TBCC_INFORMATION_BITS - bit_index - 1) + end do + end function reverse_identity + + pure subroutine unpack_identity(identity, bits) + integer(int64), intent(in) :: identity + integer(int32), intent(out) :: bits(JTTY_TBCC_INFORMATION_BITS) + integer(int32) :: bit_index + + do bit_index = 1, JTTY_TBCC_INFORMATION_BITS + bits(bit_index) = merge(1_int32, 0_int32, btest(identity, bit_index - 1)) + end do + end subroutine unpack_identity + + subroutine clear_packed_survivors(survivors) + type(packed_survivor_t), intent(inout) :: survivors(0:, :) + integer(int32) :: rank, state + + do rank = 1, size(survivors, 2) + do state = 0, size(survivors, 1) - 1 + survivors(state, rank)%key = 0_int64 + survivors(state, rank)%metric = NEGATIVE_METRIC + end do + end do + end subroutine clear_packed_survivors + + subroutine reset_packed_frame_identity(survivors) + type(packed_survivor_t), intent(inout) :: survivors(0:, :) + integer(int32) :: rank, state + + do rank = 1, size(survivors, 2) + do state = 0, size(survivors, 1) - 1 + if (.not.btest(survivors(state, rank)%key, PACKED_VALID_BIT)) cycle + survivors(state, rank)%key = ibset(shiftl(int(state, int64), JTTY_TBCC_INFORMATION_BITS), PACKED_VALID_BIT) + end do + end do + end subroutine reset_packed_frame_identity + + subroutine advance_packed_survivors(plan, block_index, prune, energies, previous, current, ordered_metrics) + type(jtty_tbcc_decoder_plan), intent(in) :: plan + integer(int32), intent(in) :: block_index + logical, intent(in) :: prune, ordered_metrics + real(real64), intent(in) :: energies(:) + type(packed_survivor_t), intent(in) :: previous(0:, :) + type(packed_survivor_t), intent(inout) :: current(0:, :) + type(packed_survivor_t) :: selected(4), extension + integer(int32) :: branch_count, branch_word, end_state, state, state_stride + integer(int32) :: rank, width + integer(int64) :: branch_identity + real(real64) :: branch_metric, metric + logical :: prune_block + + width = plan%per_state_width + branch_count = plan%branch_counts(block_index) + state_stride = plan%state_count / branch_count + prune_block = prune .and. block_contains_reserved( & + plan%block_starts(block_index), plan%block_lengths(block_index)) + do end_state = 0, plan%state_count - 1 + selected%key = 0_int64 + branch_word = iand(end_state, branch_count - 1_int32) + branch_identity = plan%branch_identities(branch_word, block_index) + if (.not.(prune_block .and. btest(branch_identity, JTTY_TBCC_INFORMATION_BITS - JTTY_TBCC_RESERVED_BIT))) then + ! The low L destination bits are the input word; the discarded high + ! L source bits enumerate every predecessor in the original order. + do state = end_state / branch_count, plan%state_count - 1, state_stride + branch_metric = energies(plan%branch_sequence_indices(state, branch_word, block_index)) + do rank = 1, width + if (.not.btest(previous(state, rank)%key, PACKED_VALID_BIT)) cycle + metric = previous(state, rank)%metric + branch_metric + if (btest(selected(width)%key, PACKED_VALID_BIT)) then + if (metric < selected(width)%metric) then + ! Lower ranks receive the same branch metric and cannot recover. + if (ordered_metrics) exit + cycle + end if + end if + extension = previous(state, rank) + extension%metric = metric + extension%key = ior(extension%key, branch_identity) + call insert_packed_survivor(selected, width, extension, block_index == 1) + end do + end do + end if + do rank = 1, width + current(end_state, rank) = selected(rank) + end do + end do + end subroutine advance_packed_survivors + + subroutine insert_packed_survivor(survivors, width, candidate, deduplicate) + type(packed_survivor_t), intent(inout) :: survivors(4) + type(packed_survivor_t), intent(in) :: candidate + integer(int32), intent(in) :: width + logical, intent(in) :: deduplicate + integer(int32) :: insertion_slot, slot + + ! Resetting a wrap's origins and identities can duplicate a state's ranks. + ! After the first block, an origin and prefix determine exactly one path, + ! so extending distinct retained paths cannot create another duplicate. + if (deduplicate) then + do slot = 1, width + if (.not.btest(survivors(slot)%key, PACKED_VALID_BIT)) cycle + if (survivors(slot)%key == candidate%key) then + if (candidate%metric <= survivors(slot)%metric) return + do insertion_slot = 1, 3 + if (insertion_slot >= slot .and. insertion_slot < width) & + survivors(insertion_slot) = survivors(insertion_slot + 1) + end do + survivors(width)%key = 0_int64 + exit + end if + end do + end if + + insertion_slot = width + 1_int32 + do slot = 1, width + if (.not.btest(survivors(slot)%key, PACKED_VALID_BIT) .or. & + packed_survivor_precedes(candidate, survivors(slot))) then + insertion_slot = slot + exit + end if + end do + if (insertion_slot > width) return + do slot = 4, 2, -1 + if (slot <= width .and. slot > insertion_slot) survivors(slot) = survivors(slot - 1) + end do + survivors(insertion_slot) = candidate + end subroutine insert_packed_survivor + + pure logical function packed_survivor_precedes(left, right) & + result(precedes) + type(packed_survivor_t), intent(in) :: left, right + + if (left%metric > right%metric) then + precedes = .true. + return + else if (left%metric < right%metric) then + precedes = .false. + return + end if + precedes = left%key < right%key + end function packed_survivor_precedes + + subroutine validate_optimized_storage(plan, workspace, candidate_bits, & + candidate_identities, candidate_clean_metrics, candidate_wava_metrics, & + candidate_start_states, candidate_crc_valid) + type(jtty_tbcc_decoder_plan), intent(in) :: plan + type(jtty_tbcc_decoder_workspace), intent(in) :: workspace + integer(int32), intent(in) :: candidate_bits(:, :) + integer(int64), intent(in) :: candidate_identities(:) + real(real64), intent(in) :: candidate_clean_metrics(:), candidate_wava_metrics(:) + integer(int32), intent(in) :: candidate_start_states(:) + logical, intent(in) :: candidate_crc_valid(:) + + if (.not.plan%initialized) error stop 'TBCC list decoder plan is not initialized' + if (.not.workspace%initialized) & + error stop 'TBCC list decoder workspace is not initialized' + if (size(workspace%previous, 1) /= plan%state_count .or. & + size(workspace%previous, 2) /= plan%per_state_width .or. & + size(workspace%sequence_energies) /= plan%energy_count) & + error stop 'TBCC list decoder workspace does not match plan' + if (size(candidate_bits, 1) /= JTTY_TBCC_INFORMATION_BITS .or. & + size(candidate_bits, 2) < plan%hypothesis_count .or. & + size(candidate_identities) < plan%hypothesis_count .or. & + size(candidate_clean_metrics) < plan%hypothesis_count .or. & + size(candidate_wava_metrics) < plan%hypothesis_count .or. & + size(candidate_start_states) < plan%hypothesis_count .or. & + size(candidate_crc_valid) < plan%hypothesis_count) & + error stop 'TBCC list decoder output storage is too small' + end subroutine validate_optimized_storage + + + subroutine validate_decoder_arguments(code, coherent_length, per_state_width, & + wraps, hypothesis_count) + type(jtty_tbcc_code_profile), intent(in) :: code + integer(int32), intent(in) :: coherent_length, per_state_width, wraps + integer(int32), intent(in) :: hypothesis_count + if (.not.jtty_tbcc_code_profile_is_supported(code)) & + error stop 'TBCC list decoder requires a supported code profile' + if (coherent_length /= 1_int32 .and. coherent_length /= 2_int32 .and. & + coherent_length /= 4_int32) & + error stop 'TBCC list decoder supports coherent lengths 1, 2, and 4' + if (per_state_width < 1_int32 .or. per_state_width > 4_int32) & + error stop 'TBCC list decoder per-state width must be between 1 and 4' + if (wraps < 1_int32 .or. wraps > 2_int32) & + error stop 'TBCC list decoder supports one or two wraps' + if (hypothesis_count < 1_int32 .or. & + hypothesis_count > JTTY_TBCC_MAX_HYPOTHESES) & + error stop 'TBCC list decoder hypothesis count must be between 1 and 4' + end subroutine validate_decoder_arguments + + subroutine clear_survivors(survivors) + type(survivor_t), intent(inout) :: survivors(0:, :) + integer(int32) :: rank, state + + do rank = 1, size(survivors, 2) + do state = 0, size(survivors, 1) - 1 + survivors(state, rank)%valid = .false. + survivors(state, rank)%metric = NEGATIVE_METRIC + survivors(state, rank)%origin_state = -1_int32 + survivors(state, rank)%bits = 0_int32 + end do + end do + end subroutine clear_survivors + + subroutine reset_frame_identity(survivors) + type(survivor_t), intent(inout) :: survivors(0:, :) + integer(int32) :: rank, state + + do rank = 1, size(survivors, 2) + do state = 0, size(survivors, 1) - 1 + if (.not.survivors(state, rank)%valid) cycle + survivors(state, rank)%origin_state = state + survivors(state, rank)%bits = 0_int32 + end do + end do + end subroutine reset_frame_identity + + pure subroutine unpack_branch_word(branch_word, block_length, input_bits) + integer(int32), intent(in) :: branch_word, block_length + integer(int32), intent(out) :: input_bits(4) + integer(int32) :: offset + + input_bits = 0_int32 + do offset = 1, block_length + input_bits(offset) = ibits(branch_word, block_length - offset, 1) + end do + end subroutine unpack_branch_word + + pure logical function block_contains_reserved(block_start, block_length) & + result(contains_reserved) + integer(int32), intent(in) :: block_start, block_length + + contains_reserved = block_start <= JTTY_TBCC_RESERVED_BIT .and. & + block_start + block_length > JTTY_TBCC_RESERVED_BIT + end function block_contains_reserved + + subroutine insert_survivor(survivors, candidate, prefix_length) + type(survivor_t), intent(inout) :: survivors(:) + type(survivor_t), intent(in) :: candidate + integer(int32), intent(in) :: prefix_length + integer(int32) :: slot, insertion_slot + + do slot = 1, size(survivors) + if (.not.survivors(slot)%valid) cycle + if (survivors(slot)%origin_state /= candidate%origin_state) cycle + if (.not.all(survivors(slot)%bits(1:prefix_length) == & + candidate%bits(1:prefix_length))) cycle + if (candidate%metric <= survivors(slot)%metric) return + do insertion_slot = slot, size(survivors) - 1 + survivors(insertion_slot) = survivors(insertion_slot + 1) + end do + survivors(size(survivors))%valid = .false. + survivors(size(survivors))%metric = NEGATIVE_METRIC + survivors(size(survivors))%origin_state = -1_int32 + survivors(size(survivors))%bits = 0_int32 + exit + end do + + insertion_slot = size(survivors) + 1 + do slot = 1, size(survivors) + if (.not.survivors(slot)%valid .or. & + survivor_precedes(candidate, survivors(slot), prefix_length)) then + insertion_slot = slot + exit + end if + end do + if (insertion_slot > size(survivors)) return + do slot = size(survivors), insertion_slot + 1, -1 + survivors(slot) = survivors(slot - 1) + end do + survivors(insertion_slot) = candidate + end subroutine insert_survivor + + pure logical function survivor_precedes(left, right, prefix_length) result(precedes) + type(survivor_t), intent(in) :: left, right + integer(int32), intent(in) :: prefix_length + integer(int32) :: bit_index + + if (left%metric > right%metric) then + precedes = .true. + return + else if (left%metric < right%metric) then + precedes = .false. + return + else + precedes = left%metric > right%metric + end if + if (left%origin_state /= right%origin_state) then + precedes = left%origin_state < right%origin_state + return + end if + do bit_index = 1, prefix_length + if (left%bits(bit_index) == right%bits(bit_index)) cycle + precedes = left%bits(bit_index) < right%bits(bit_index) + return + end do + precedes = .false. + end function survivor_precedes + + subroutine locate_identity(identity, hash_keys, hash_indices, hash_used, & + hash_slot, pool_index, found) + integer(int64), intent(in) :: identity + integer(int64), intent(in) :: hash_keys(:) + integer(int32), intent(in) :: hash_indices(:) + logical, intent(in) :: hash_used(:) + integer(int32), intent(out) :: hash_slot, pool_index + logical, intent(out) :: found + + hash_slot = 1_int32 + int(modulo(identity, int(size(hash_keys), int64)), int32) + do + if (.not.hash_used(hash_slot)) then + pool_index = 0_int32 + found = .false. + return + end if + if (hash_keys(hash_slot) == identity) then + pool_index = hash_indices(hash_slot) + found = .true. + return + end if + hash_slot = hash_slot + 1_int32 + if (hash_slot > size(hash_keys)) hash_slot = 1_int32 + end do + end subroutine locate_identity + + subroutine sort_candidate_order(pool, order, count) + type(pool_candidate_t), intent(in) :: pool(:) + integer(int32), intent(inout) :: order(:) + integer(int32), intent(in) :: count + integer(int32), allocatable :: scratch(:) + + if (count <= 1_int32) return + allocate(scratch(count)) + call sort_candidate_order_with_scratch(pool, order, scratch, count) + deallocate(scratch) + end subroutine sort_candidate_order + + subroutine sort_candidate_order_with_scratch(pool, order, scratch, count) + type(pool_candidate_t), intent(in) :: pool(:) + integer(int32), intent(inout) :: order(:), scratch(:) + integer(int32), intent(in) :: count + integer(int32) :: left, middle, right, width + + if (count <= 1_int32) return + width = 1_int32 + do while (width < count) + left = 1_int32 + do while (left <= count) + middle = min(left + width, count + 1_int32) + right = min(left + 2_int32*width - 1_int32, count) + call merge_candidate_order(pool, order, scratch, left, middle, right) + left = left + 2_int32*width + end do + order(1:count) = scratch(1:count) + width = 2_int32*width + end do + end subroutine sort_candidate_order_with_scratch + + subroutine merge_candidate_order(pool, order, scratch, left, middle, right) + type(pool_candidate_t), intent(in) :: pool(:) + integer(int32), intent(in) :: order(:), left, middle, right + integer(int32), intent(inout) :: scratch(:) + integer(int32) :: left_cursor, right_cursor, output + + left_cursor = left + right_cursor = middle + do output = left, right + if (left_cursor >= middle) then + scratch(output) = order(right_cursor) + right_cursor = right_cursor + 1_int32 + else if (right_cursor > right) then + scratch(output) = order(left_cursor) + left_cursor = left_cursor + 1_int32 + else if (candidate_precedes(pool(order(left_cursor)), & + pool(order(right_cursor)))) then + scratch(output) = order(left_cursor) + left_cursor = left_cursor + 1_int32 + else + scratch(output) = order(right_cursor) + right_cursor = right_cursor + 1_int32 + end if + end do + end subroutine merge_candidate_order + + pure logical function candidate_precedes(left, right) result(precedes) + type(pool_candidate_t), intent(in) :: left, right + + if (left%clean_metric > right%clean_metric) then + precedes = .true. + else if (left%clean_metric < right%clean_metric) then + precedes = .false. + else if (left%identity /= right%identity) then + precedes = left%identity < right%identity + else if (left%start_state /= right%start_state) then + precedes = left%start_state < right%start_state + else + precedes = left%wava_metric > right%wava_metric + end if + end function candidate_precedes + +end module jtty_tbcc_list_decoder diff --git a/lib/jtty/jtty_tx_manual_checks.md b/lib/jtty/jtty_tx_manual_checks.md new file mode 100644 index 00000000..bcb4ff44 --- /dev/null +++ b/lib/jtty/jtty_tx_manual_checks.md @@ -0,0 +1,65 @@ +# JTTY transmit manual checks + +These checks cover MainWindow, PTT, and backend behavior that is outside the +FIFO unit-test boundary. + +- Soundcard: send one JTTY message and verify the full tail plays before PTT drops. +- Soundcard: queue two or three messages rapidly and verify playback is contiguous with PTT held. +- Soundcard: press Stop during playback and verify queued audio is abandoned before PTT drops. +- Soundcard: press Esc before PTT comes up and during playback and verify clean aborts. +- Soundcard: send again after a natural drain and verify a fresh transmit session starts. +- TCI, where available: repeat the same checks and watch for backend enqueue failure warnings. +- Native macros: activate each default JTTY F1-F8 template by keyboard and by + clicking its button; verify both paths show the same canonical message and + enqueue the same number of frames. +- Native macros: enter a valid call and serial, send a call-plus-exchange + template, and verify EOM appears only on the final atom. +- Native macros: make a recognized template's runtime call or serial invalid + and verify transmission is rejected rather than sent as literal text. +- Literal fallback: customize a function-key template so it no longer matches + a native form and verify automatic packing preserves its expanded text after + the selected profile's normalization. +- Free entry: with MyCall K1ABC, compare F1 with typing `CQ K1ABC CQ` and + selecting Send message; verify the same text and one frame. Repeat with + `CQ K1ABC CQ CQ K1ABC CQ`, verifying two frames and unchanged spacing. +- External text: send `CQ K1ABC CQ`, `599 123`, `599 MA`, `599 FN42`, and + `1D EMA` from N1MM/MMTTY; verify each uses one frame and preserves the text. + With no special activity or with Field Day, send `599 001`, `599 05`, and + `599 BRUCE`; verify each uses two frames and preserves the text. +- Automatic profile: select RTTY Roundup and send `599 001` and + `K1ABC 599 001`; verify one and two frames respectively. Verify `599 123` + and `599 MA` use SERIAL and STATE_PROVINCE rather than generic atoms. + Verify `599 05` and `599 0123` become `599 005` and `599 123`, each in one + frame, with the canonical text shown and logged. Verify bare `001` retains + its spelling and is not inferred as SERIAL. Verify unsupported serial + tokens (over six digits or above 131071) retain their spelling. Verify a + message whose serial normalization expands beyond 80 characters is rejected + rather than truncated. Submit a message, change activity + before it plays, and verify the submitted message retains its captured + profile. Repeat through untagged N1MM/MMTTY and customized macro fallback. +- sjtty: compare default and leading `--exchange-profile=rtty-roundup` with + `599 001`; verify two and one frames. Exercise `unknown` and `field-day`, + the eight-argument waveform invocation, and rejection of an invalid value. +- Mixed text: send `HI WB9XYZ`, `TEST WB9XYZ`, and `K1ABC HELLO`; verify no + spaces are inserted or lost where TEXT5 and compact atoms meet. Send a + registered control phrase alone and embedded in a longer message. +- Queueing: queue two native messages and verify no visible or transmitted + TEXT5 spacing frame is inserted between them. +- Profile exchange: exercise `%E` with default serial, FIELD_DAY class/section, + and both RTTY serial and state/province payloads; verify canonical rendering + and rejection of a payload from the wrong profile. +- Grid macros: verify `%G` renders field-only GRID4 and exact `599 %G` renders + full-role GRID4; reject malformed locators. +- Settings migration: load unchanged old F2, F6, and F8 defaults using `%N` + and verify migration to `%E`; verify any edited variant remains literal. +- Windows/N1MM: load `JTTY Messages.mc`, exercise every tagged Run and S&P + action, and verify the `[[JTTY:ACTION]]` marker is consumed rather than + transmitted. Reject malformed tags, invalid profile payloads, and unknown + actions; verify untagged TXTEXT remains literal. Verify an all-rejected + transaction completes at OFF, and a rejected action followed by a valid + action still starts and completes only after the accepted audio drains. +- Windows/N1MM: in a two-radio configuration, verify entry-window focus, `!` + and `{CALL}` expansion, queued-call selection, `{LOGTHENPOP}`, and Run/S&P + state changes. Before adding a Run F11 call-stacking macro, capture its + TXTEXT ordering and verify that the leading tag, callsign, and exchange all + refer to the intended queued station. diff --git a/lib/jtty/jttyaudio.c b/lib/jtty/jttyaudio.c new file mode 100644 index 00000000..f4571117 --- /dev/null +++ b/lib/jtty/jttyaudio.c @@ -0,0 +1,376 @@ +#include +#include +#include "portaudio.h" +#include +#include + +// Prototypes for Fortran subroutine update +void update_(int* ic1, int* ic2); + +int iaa; +int icc; +int n2send=0; +int ndebug=0; +double total_time=0.0; + +// Definition of structure pointing to the audio data +typedef struct +{ + int *iwrite; + int *itx; + int *TxOK; + int *Transmitting; + int *nwave; + int *nright; + int nring; + int nfs; + short *y1; + short *y2; + short *iwave; +} paTestData; + +// Input callback routine: +static int +SoundIn( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + short *in = (short*)inputBuffer; + unsigned int i; + static int ia=0; + +// Don't save audio input samples when we're transmitting + if(*data->Transmitting) return 0; + + if(outputBuffer == timeInfo) i=0; //Suppress 'unused' warnings + + if(statusFlags!=0) printf("Status flags %d\n",(int)statusFlags); + + if((statusFlags&1) == 0) { + //increment buffer pointers only if data available + ia=*data->iwrite; + if(*data->nright==0) { //Use left channel for input + for(i=0; iy1[ia] = (*in++); + data->y2[ia] = (*in++); + ia++; + if(ia >= data->nring) ia=0; //Wrap buffer pointer if necessary + } + } else { //Use right channel + for(i=0; iy2[ia] = (*in++); + data->y1[ia] = (*in++); + ia++; + if(ia >= data->nring) ia=0; //Wrap buffer pointer if necessary + } + } + } + + *data->iwrite = ia; //Save buffer pointer + iaa=ia; + total_time += (double)framesPerBuffer/12000.0; + return 0; +} + +// Output callback routine: +static int +SoundOut( void *inputBuffer, void *outputBuffer, + unsigned long framesPerBuffer, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ) +{ + paTestData *data = (paTestData*)userData; + short *wptr = (short*)outputBuffer; + unsigned int i; + static short int n2; + static int ic=0; + static int TxOKz=0; + static int nsent=0; + + if(inputBuffer == timeInfo) i=0; //Suppress 'unused' warnings + if(statusFlags!=0) printf("Status flags %d\n",(int)statusFlags); + + // if(ndebug>0) printf("SoundOut: %d %d %d\n",TxOKz,*data->TxOK,(int)framesPerBuffer); + + if(*data->TxOK && (!TxOKz)) ic=0; //Reset buffer pointer to start Tx + *data->Transmitting=*data->TxOK; //Set the "transmitting" flag + + if(*data->TxOK) { + if(!TxOKz) { + // Start of a transmission + nsent=0; + if(ndebug>0) printf("Start Tx %d %d\n",TxOKz,*data->TxOK); + } + TxOKz=*data->TxOK; + for(i=0 ; i < framesPerBuffer; i++ ) { + n2=data->iwave[ic]; + // addnoise_(&n2); + *wptr++ = n2; //left + *wptr++ = n2; //right + ic++; + + if(ic > n2send) { + *data->TxOK = 0; + *data->Transmitting = 0; + *data->iwrite = 0; //Reset Rx buffer pointer to 0 + TxOKz=0; //### ??? ### + ic=0; + if(ndebug>0) { + printf("TxT = %7.3f nSent = %d Frames = %7.3f\n",nsent/12000.0, + nsent,nsent/(53.0*384.0)); + } + break; + } + } + nsent += framesPerBuffer; + } else { + memset((void*)outputBuffer, 0, 2*sizeof(short)*framesPerBuffer); + } + *data->itx = icc; //Save buffer pointer + icc=ic; + return 0; +} + +/*******************************************************************/ +int jttyaudio_(int *ndevin, int *ndevout, int *npabuf, int *nright, + short y1[], short y2[], int *nring, int *iwrite, + int *itx, short iwave[], int *nwave, int *nfsample, + int *TxOK, int *Transmitting, int *ngo, int *ndebug0) + +{ + paTestData data; + PaStream *instream, *outstream; + PaStreamParameters inputParameters, outputParameters; + // PaStreamInfo *streamInfo; + + int nfpb = *npabuf; + int nSampleRate = *nfsample; + int ndevice_in = *ndevin; + int ndevice_out = *ndevout; + double dSampleRate = (double) *nfsample; + ndebug = *ndebug0; + PaError err_init, err_open_in, err_open_out, err_start_in, err_start_out; + PaError err = 0; + + data.iwrite = iwrite; + data.itx = itx; + data.TxOK = TxOK; + data.Transmitting = Transmitting; + data.y1 = y1; + data.y2 = y2; + data.nring = *nring; + data.nright = nright; + data.nwave = nwave; + data.iwave = iwave; + data.nfs = nSampleRate; + + err_init = Pa_Initialize(); // Initialize PortAudio + + if(err_init) { + printf("Error initializing PortAudio.\n"); + printf("\tErrortext: %s\n\tNumber: %d\n",Pa_GetErrorText(err_init), + err_init); + Pa_Terminate(); // I don't think we need this but... + return(-1); + } + + // printf("Opening device %d for input, %d for output...\n", + // ndevice_in,ndevice_out); + + inputParameters.device = ndevice_in; + inputParameters.channelCount = 2; + inputParameters.sampleFormat = paInt16; + inputParameters.suggestedLatency = 0.1; + inputParameters.hostApiSpecificStreamInfo = NULL; + +// Test if this configuration actually works, so we do not run into an +// ugly assertion + err_open_in = Pa_IsFormatSupported(&inputParameters, NULL, dSampleRate); + + if (err_open_in == 0) { + err_open_in = Pa_OpenStream( + &instream, //address of stream + &inputParameters, + NULL, + dSampleRate, //Sample rate + nfpb, //Frames per buffer + paNoFlag, + (PaStreamCallback *)SoundIn, //Callback routine + (void *)&data); //address of data structure + + if(err_open_in) { // We should have no error here usually + printf("Error opening input audio stream:\n"); + printf("\tErrortext: %s\n\tNumber: %d\n",Pa_GetErrorText(err_open_in), + err_open_in); + err = 1; + } else { + // printf("Successfully opened audio input.\n"); + } + } else { + printf("Error opening input audio stream.\n"); + printf("\tErrortext: %s\n\tNumber: %d\n",Pa_GetErrorText(err_open_in), + err_open_in); + err = 1; + } + + outputParameters.device = ndevice_out; + outputParameters.channelCount = 2; + outputParameters.sampleFormat = paInt16; + outputParameters.suggestedLatency = 0.2; + outputParameters.hostApiSpecificStreamInfo = NULL; + +// Test if this configuration actually works, so we do not run into an +// ugly assertion. + err_open_out = Pa_IsFormatSupported(NULL, &outputParameters, dSampleRate); + + if (err_open_out == 0) { + err_open_out = Pa_OpenStream( + &outstream, //address of stream + NULL, + &outputParameters, + dSampleRate, //Sample rate + nfpb, //Frames per buffer + paNoFlag, + (PaStreamCallback *)SoundOut, //Callback routine + (void *)&data); //address of data structure + + if(err_open_out) { // We should have no error here usually + printf("Error opening output audio stream!\n"); + printf("\tErrortext: %s\n\tNumber: %d\n",Pa_GetErrorText(err_open_out), + err_open_out); + err += 2; + } else { + // printf("Successfully opened audio output.\n"); + } + } else { + printf("Error opening output audio stream.\n"); + printf("\tErrortext: %s\n\tNumber: %d\n",Pa_GetErrorText(err_open_out), + err_open_out); + err += 2; + } + + // if there was no error in opening both streams start them + if (err == 0) { + err_start_in = Pa_StartStream(instream); //Start input stream + if(err_start_in) { + printf("Error starting input audio stream!\n"); + printf("\tErrortext: %s\n\tNumber: %d\n",Pa_GetErrorText(err_start_in), + err_start_in); + err += 4; + } + + err_start_out = Pa_StartStream(outstream); //Start output stream + if(err_start_out) { + printf("Error starting output audio stream!\n"); + printf("\tErrortext: %s\n\tNumber: %d\n",Pa_GetErrorText(err_start_out), + err_start_out); + err += 8; + } + } + + if (err != 0) printf("Error starting audio input or output.\n"); + + while( Pa_IsStreamActive(instream) && (*ngo != 0) && (err == 0) ) { + int ic1=0; + int ic2=0; + + if(_kbhit()) ic1 = _getch(); + if(_kbhit()) ic2 = _getch(); + + // if(ic1!=0 || ic2!=0) printf("%d %d %d\n",iaa,ic1,ic2); + // if(ic1!=0 && ic2==0) putchar(ic1); + + update_(&ic1,&ic2); + Pa_Sleep(100); + } + + Pa_AbortStream(instream); // Abort input stream + Pa_CloseStream(instream); // Close input stream, we're done. + Pa_AbortStream(outstream); // Abort output stream + Pa_CloseStream(outstream); // Close output stream, we're done. + + Pa_Terminate(); // Terminate PortAudio + + return(err); +} + + +int padevsub_(int *idevin, int *idevout) +{ + int numdev,ndefin,ndefout; + int nchin[101], nchout[101]; + int i, devIdx; + int numDevices; + const PaDeviceInfo *pdi; + PaError err; + + Pa_Initialize(); + numDevices = Pa_GetDeviceCount(); + numdev = numDevices; + + if( numDevices < 0 ) { + err = numDevices; + Pa_Terminate(); + return err; + } + + if ((devIdx = Pa_GetDefaultInputDevice()) > 0) { + ndefin = devIdx; + } else { + ndefin = 0; + } + + if ((devIdx = Pa_GetDefaultOutputDevice()) > 0) { + ndefout = devIdx; + } else { + ndefout = 0; + } + + if(*idevin < 0) { + printf("\nAudio Input Output Device Name\n"); + printf("Device Channels Channels\n"); + printf("------------------------------------------------------------------\n"); + + for( i=0; i < numDevices; i++ ) { + pdi = Pa_GetDeviceInfo(i); +// if(i == Pa_GetDefaultInputDevice()) ndefin = i; +// if(i == Pa_GetDefaultOutputDevice()) ndefout = i; + nchin[i]=pdi->maxInputChannels; + nchout[i]=pdi->maxOutputChannels; + printf(" %2d %2d %2d %s\n",i,nchin[i],nchout[i], + pdi->name); + } + printf("\nDefault devices: Input = %2d Output = %2d\n", + ndefin,ndefout); + } + + // printf("\nUser requested devices: Input = %2d Output = %2d\n", + // *idevin,*idevout); + if((*idevin<0) || (*idevin>=numdev)) *idevin=ndefin; + if((*idevout<0) || (*idevout>=numdev)) *idevout=ndefout; + if((*idevin==0) && (*idevout==0)) { + *idevin=ndefin; + *idevout=ndefout; + } + // printf("Will open devices: Input = %2d Output = %2d\n", + // *idevin,*idevout); + + Pa_Terminate(); + + return 0; +} + +void set_tx_length_(int* nwave) +{ + n2send=*nwave; + // printf("n2send = %d\n",n2send); +} + +void putchar_(int *n) +{ + putchar(*n); +} diff --git a/lib/jtty/jttycom.f90 b/lib/jtty/jttycom.f90 new file mode 100644 index 00000000..d6efab19 --- /dev/null +++ b/lib/jtty/jttycom.f90 @@ -0,0 +1,31 @@ +module jttycom + + implicit none + +! Variable Purpose +!--------------------------------------------------------------------------- + integer NMAX + parameter(NMAX=30*12000) !Ring buffer at 12000 samples/sec + real ftx !Tx audio frequency + integer iwrite !Pointer to Rx ring buffer + integer itx !Pointer to Tx buffer + integer ngo !Set to 0 to terminate audio streams + integer nTransmitting !Actually transmitting? + integer nTxOK !OK to transmit? + integer ndebug + logical ltx(5) !True if msg i has been transmitted + logical lrx(5) !True if msg i has been received + logical autoseq + logical QSO_in_progress + integer*2 y1(NMAX) !Ring buffer for audio channel 0 + integer*2 y2(NMAX) !Ring buffer for audio channel 1 + integer*2 iwave(NMAX) !Data for Tx audio + character*6 mycall + character*6 hiscall + character*6 hiscall_next + character*4 mygrid + character*4 exch + character*80 txmsg + save iwave,y1,y2 + +end module jttycom diff --git a/lib/jtty/portaudio.h b/lib/jtty/portaudio.h new file mode 100644 index 00000000..250fba02 --- /dev/null +++ b/lib/jtty/portaudio.h @@ -0,0 +1,1123 @@ + +#ifndef PORTAUDIO_H +#define PORTAUDIO_H +/* + * $Id: portaudio.h,v 1.1 2005/11/29 21:27:24 joe Exp $ + * PortAudio Portable Real-Time Audio Library + * PortAudio API Header File + * Latest version available at: http://www.portaudio.com/ + * + * Copyright (c) 1999-2002 Ross Bencina and Phil Burk + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files + * (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, + * publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * Any person wishing to distribute modifications to the Software is + * requested to send the modifications to the original developer so that + * they can be incorporated into the canonical version. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** @file + @brief The PortAudio API. +*/ + + +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + +/** Retrieve the release number of the currently running PortAudio build, + eg 1900. +*/ +int Pa_GetVersion( void ); + + +/** Retrieve a textual description of the current PortAudio build, + eg "PortAudio V19-devel 13 October 2002". +*/ +const char* Pa_GetVersionText( void ); + + +/** Error codes returned by PortAudio functions. + Note that with the exception of paNoError, all PaErrorCodes are negative. +*/ + +typedef int PaError; +typedef enum PaErrorCode +{ + paNoError = 0, + + paNotInitialized = -10000, + paUnanticipatedHostError, + paInvalidChannelCount, + paInvalidSampleRate, + paInvalidDevice, + paInvalidFlag, + paSampleFormatNotSupported, + paBadIODeviceCombination, + paInsufficientMemory, + paBufferTooBig, + paBufferTooSmall, + paNullCallback, + paBadStreamPtr, + paTimedOut, + paInternalError, + paDeviceUnavailable, + paIncompatibleHostApiSpecificStreamInfo, + paStreamIsStopped, + paStreamIsNotStopped, + paInputOverflowed, + paOutputUnderflowed, + paHostApiNotFound, + paInvalidHostApi, + paCanNotReadFromACallbackStream, /**< @todo review error code name */ + paCanNotWriteToACallbackStream, /**< @todo review error code name */ + paCanNotReadFromAnOutputOnlyStream, /**< @todo review error code name */ + paCanNotWriteToAnInputOnlyStream, /**< @todo review error code name */ + paIncompatibleStreamHostApi +} PaErrorCode; + + +/** Translate the supplied PortAudio error code into a human readable + message. +*/ +const char *Pa_GetErrorText( PaError errorCode ); + + +/** Library initialization function - call this before using PortAudio. + This function initialises internal data structures and prepares underlying + host APIs for use. This function MUST be called before using any other + PortAudio API functions. + + If Pa_Initialize() is called multiple times, each successful + call must be matched with a corresponding call to Pa_Terminate(). + Pairs of calls to Pa_Initialize()/Pa_Terminate() may overlap, and are not + required to be fully nested. + + Note that if Pa_Initialize() returns an error code, Pa_Terminate() should + NOT be called. + + @return paNoError if successful, otherwise an error code indicating the cause + of failure. + + @see Pa_Terminate +*/ +PaError Pa_Initialize( void ); + + +/** Library termination function - call this when finished using PortAudio. + This function deallocates all resources allocated by PortAudio since it was + initializied by a call to Pa_Initialize(). In cases where Pa_Initialise() has + been called multiple times, each call must be matched with a corresponding call + to Pa_Terminate(). The final matching call to Pa_Terminate() will automatically + close any PortAudio streams that are still open. + + Pa_Terminate() MUST be called before exiting a program which uses PortAudio. + Failure to do so may result in serious resource leaks, such as audio devices + not being available until the next reboot. + + @return paNoError if successful, otherwise an error code indicating the cause + of failure. + + @see Pa_Initialize +*/ +PaError Pa_Terminate( void ); + + + +/** The type used to refer to audio devices. Values of this type usually + range from 0 to (Pa_DeviceCount-1), and may also take on the PaNoDevice + and paUseHostApiSpecificDeviceSpecification values. + + @see Pa_DeviceCount, paNoDevice, paUseHostApiSpecificDeviceSpecification +*/ +typedef int PaDeviceIndex; + + +/** A special PaDeviceIndex value indicating that no device is available, + or should be used. + + @see PaDeviceIndex +*/ +#define paNoDevice ((PaDeviceIndex)-1) + + +/** A special PaDeviceIndex value indicating that the device(s) to be used + are specified in the host api specific stream info structure. + + @see PaDeviceIndex +*/ +#define paUseHostApiSpecificDeviceSpecification ((PaDeviceIndex)-2) + + +/* Host API enumeration mechanism */ + +/** The type used to enumerate to host APIs at runtime. Values of this type + range from 0 to (Pa_GetHostApiCount()-1). + + @see Pa_GetHostApiCount +*/ +typedef int PaHostApiIndex; + + +/** Retrieve the number of available host APIs. Even if a host API is + available it may have no devices available. + + @return A non-negative value indicating the number of available host APIs + or, a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + + @see PaHostApiIndex +*/ +PaHostApiIndex Pa_GetHostApiCount( void ); + + +/** Retrieve the index of the default host API. The default host API will be + the lowest common denominator host API on the current platform and is + unlikely to provide the best performance. + + @return A non-negative value ranging from 0 to (Pa_GetHostApiCount()-1) + indicating the default host API index or, a PaErrorCode (which are always + negative) if PortAudio is not initialized or an error is encountered. +*/ +PaHostApiIndex Pa_GetDefaultHostApi( void ); + + +/** Unchanging unique identifiers for each supported host API. This type + is used in the PaHostApiInfo structure. The values are guaranteed to be + unique and to never change, thus allowing code to be written that + conditionally uses host API specific extensions. + + New type ids will be allocated when support for a host API reaches + "public alpha" status, prior to that developers should use the + paInDevelopment type id. + + @see PaHostApiInfo +*/ +typedef enum PaHostApiTypeId +{ + paInDevelopment=0, /* use while developing support for a new host API */ + paDirectSound=1, + paMME=2, + paASIO=3, + paSoundManager=4, + paCoreAudio=5, + paOSS=7, + paALSA=8, + paAL=9, + paBeOS=10, + paWDMKS=11, + paJACK=12 +} PaHostApiTypeId; + + +/** A structure containing information about a particular host API. */ + +typedef struct PaHostApiInfo +{ + /** this is struct version 1 */ + int structVersion; + /** The well known unique identifier of this host API @see PaHostApiTypeId */ + PaHostApiTypeId type; + /** A textual description of the host API for display on user interfaces. */ + const char *name; + + /** The number of devices belonging to this host API. This field may be + used in conjunction with Pa_HostApiDeviceIndexToDeviceIndex() to enumerate + all devices for this host API. + @see Pa_HostApiDeviceIndexToDeviceIndex + */ + int deviceCount; + + /** The the default input device for this host API. The value will be a + device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice + if no default input device is available. + */ + PaDeviceIndex defaultInputDevice; + + /** The the default output device for this host API. The value will be a + device index ranging from 0 to (Pa_GetDeviceCount()-1), or paNoDevice + if no default output device is available. + */ + PaDeviceIndex defaultOutputDevice; + +} PaHostApiInfo; + + +/** Retrieve a pointer to a structure containing information about a specific + host Api. + + @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) + + @return A pointer to an immutable PaHostApiInfo structure describing + a specific host API. If the hostApi parameter is out of range or an error + is encountered, the function returns NULL. + + The returned structure is owned by the PortAudio implementation and must not + be manipulated or freed. The pointer is only guaranteed to be valid between + calls to Pa_Initialize() and Pa_Terminate(). +*/ +const PaHostApiInfo * Pa_GetHostApiInfo( PaHostApiIndex hostApi ); + + +/** Convert a static host API unique identifier, into a runtime + host API index. + + @param type A unique host API identifier belonging to the PaHostApiTypeId + enumeration. + + @return A valid PaHostApiIndex ranging from 0 to (Pa_GetHostApiCount()-1) or, + a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + + The paHostApiNotFound error code indicates that the host API specified by the + type parameter is not available. + + @see PaHostApiTypeId +*/ +PaHostApiIndex Pa_HostApiTypeIdToHostApiIndex( PaHostApiTypeId type ); + + +/** Convert a host-API-specific device index to standard PortAudio device index. + This function may be used in conjunction with the deviceCount field of + PaHostApiInfo to enumerate all devices for the specified host API. + + @param hostApi A valid host API index ranging from 0 to (Pa_GetHostApiCount()-1) + + @param hostApiDeviceIndex A valid per-host device index in the range + 0 to (Pa_GetHostApiInfo(hostApi)->deviceCount-1) + + @return A non-negative PaDeviceIndex ranging from 0 to (Pa_GetDeviceCount()-1) + or, a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. + + A paInvalidHostApi error code indicates that the host API index specified by + the hostApi parameter is out of range. + + A paInvalidDevice error code indicates that the hostApiDeviceIndex parameter + is out of range. + + @see PaHostApiInfo +*/ +PaDeviceIndex Pa_HostApiDeviceIndexToDeviceIndex( PaHostApiIndex hostApi, + int hostApiDeviceIndex ); + + + +/** Structure used to return information about a host error condition. +*/ +typedef struct PaHostErrorInfo{ + PaHostApiTypeId hostApiType; /**< the host API which returned the error code */ + long errorCode; /**< the error code returned */ + const char *errorText; /**< a textual description of the error if available, otherwise a zero-length string */ +}PaHostErrorInfo; + + +/** Return information about the last host error encountered. The error + information returned by Pa_GetLastHostErrorInfo() will never be modified + asyncronously by errors occurring in other PortAudio owned threads + (such as the thread that manages the stream callback.) + + This function is provided as a last resort, primarily to enhance debugging + by providing clients with access to all available error information. + + @return A pointer to an immutable structure constaining information about + the host error. The values in this structure will only be valid if a + PortAudio function has previously returned the paUnanticipatedHostError + error code. +*/ +const PaHostErrorInfo* Pa_GetLastHostErrorInfo( void ); + + + +/* Device enumeration and capabilities */ + +/** Retrieve the number of available devices. The number of available devices + may be zero. + + @return A non-negative value indicating the number of available devices or, + a PaErrorCode (which are always negative) if PortAudio is not initialized + or an error is encountered. +*/ +PaDeviceIndex Pa_GetDeviceCount( void ); + + +/** Retrieve the index of the default input device. The result can be + used in the inputDevice parameter to Pa_OpenStream(). + + @return The default input device index for the default host API, or paNoDevice + if no default input device is available or an error was encountered. +*/ +PaDeviceIndex Pa_GetDefaultInputDevice( void ); + + +/** Retrieve the index of the default output device. The result can be + used in the outputDevice parameter to Pa_OpenStream(). + + @return The default output device index for the defualt host API, or paNoDevice + if no default output device is available or an error was encountered. + + @note + On the PC, the user can specify a default device by + setting an environment variable. For example, to use device #1. +
+ set PA_RECOMMENDED_OUTPUT_DEVICE=1
+
+ The user should first determine the available device ids by using + the supplied application "pa_devs". +*/ +PaDeviceIndex Pa_GetDefaultOutputDevice( void ); + + +/** The type used to represent monotonic time in seconds that can be used + for syncronisation. The type is used for the outTime argument to the + PaStreamCallback and as the result of Pa_GetStreamTime(). + + @see PaStreamCallback, Pa_GetStreamTime +*/ +typedef double PaTime; + + +/** A type used to specify one or more sample formats. Each value indicates + a possible format for sound data passed to and from the stream callback, + Pa_ReadStream and Pa_WriteStream. + + The standard formats paFloat32, paInt16, paInt32, paInt24, paInt8 + and aUInt8 are usually implemented by all implementations. + + The floating point representation (paFloat32) uses +1.0 and -1.0 as the + maximum and minimum respectively. + + paUInt8 is an unsigned 8 bit format where 128 is considered "ground" + + The paNonInterleaved flag indicates that a multichannel buffer is passed + as a set of non-interleaved pointers. + + @see Pa_OpenStream, Pa_OpenDefaultStream, PaDeviceInfo + @see paFloat32, paInt16, paInt32, paInt24, paInt8 + @see paUInt8, paCustomFormat, paNonInterleaved +*/ +typedef unsigned long PaSampleFormat; + + +#define paFloat32 ((PaSampleFormat) 0x00000001) /**< @see PaSampleFormat */ +#define paInt32 ((PaSampleFormat) 0x00000002) /**< @see PaSampleFormat */ +#define paInt24 ((PaSampleFormat) 0x00000004) /**< Packed 24 bit format. @see PaSampleFormat */ +#define paInt16 ((PaSampleFormat) 0x00000008) /**< @see PaSampleFormat */ +#define paInt8 ((PaSampleFormat) 0x00000010) /**< @see PaSampleFormat */ +#define paUInt8 ((PaSampleFormat) 0x00000020) /**< @see PaSampleFormat */ +#define paCustomFormat ((PaSampleFormat) 0x00010000)/**< @see PaSampleFormat */ + +#define paNonInterleaved ((PaSampleFormat) 0x80000000) + +/** A structure providing information and capabilities of PortAudio devices. + Devices may support input, output or both input and output. +*/ +typedef struct PaDeviceInfo +{ + int structVersion; /* this is struct version 2 */ + const char *name; + PaHostApiIndex hostApi; /* note this is a host API index, not a type id*/ + + int maxInputChannels; + int maxOutputChannels; + + /* Default latency values for interactive performance. */ + PaTime defaultLowInputLatency; + PaTime defaultLowOutputLatency; + /* Default latency values for robust non-interactive applications (eg. playing sound files). */ + PaTime defaultHighInputLatency; + PaTime defaultHighOutputLatency; + + double defaultSampleRate; +} PaDeviceInfo; + + +/** Retrieve a pointer to a PaDeviceInfo structure containing information + about the specified device. + @return A pointer to an immutable PaDeviceInfo structure. If the device + parameter is out of range the function returns NULL. + + @param device A valid device index in the range 0 to (Pa_GetDeviceCount()-1) + + @note PortAudio manages the memory referenced by the returned pointer, + the client must not manipulate or free the memory. The pointer is only + guaranteed to be valid between calls to Pa_Initialize() and Pa_Terminate(). + + @see PaDeviceInfo, PaDeviceIndex +*/ +const PaDeviceInfo* Pa_GetDeviceInfo( PaDeviceIndex device ); + + +/** Parameters for one direction (input or output) of a stream. +*/ +typedef struct PaStreamParameters +{ + /** A valid device index in the range 0 to (Pa_GetDeviceCount()-1) + specifying the device to be used or the special constant + paUseHostApiSpecificDeviceSpecification which indicates that the actual + device(s) to use are specified in hostApiSpecificStreamInfo. + This field must not be set to paNoDevice. + */ + PaDeviceIndex device; + + /** The number of channels of sound to be delivered to the + stream callback or accessed by Pa_ReadStream() or Pa_WriteStream(). + It can range from 1 to the value of maxInputChannels in the + PaDeviceInfo record for the device specified by the device parameter. + */ + int channelCount; + + /** The sample format of the buffer provided to the stream callback, + a_ReadStream() or Pa_WriteStream(). It may be any of the formats described + by the PaSampleFormat enumeration. + */ + PaSampleFormat sampleFormat; + + /** The desired latency in seconds. Where practical, implementations should + configure their latency based on these parameters, otherwise they may + choose the closest viable latency instead. Unless the suggested latency + is greater than the absolute upper limit for the device implementations + shouldround the suggestedLatency up to the next practial value - ie to + provide an equal or higher latency than suggestedLatency whereever possibe. + Actual latency values for an open stream may be retrieved using the + inputLatency and outputLatency fields of the PaStreamInfo structure + returned by Pa_GetStreamInfo(). + @see default*Latency in PaDeviceInfo, *Latency in PaStreamInfo + */ + PaTime suggestedLatency; + + /** An optional pointer to a host api specific data structure + containing additional information for device setup and/or stream processing. + hostApiSpecificStreamInfo is never required for correct operation, + if not used it should be set to NULL. + */ + void *hostApiSpecificStreamInfo; + +} PaStreamParameters; + + +/** Return code for Pa_IsFormatSupported indicating success. */ +#define paFormatIsSupported (0) + +/** Determine whether it would be possible to open a stream with the specified + parameters. + + @param inputParameters A structure that describes the input parameters used to + open a stream. The suggestedLatency field is ignored. See PaStreamParameters + for a description of these parameters. inputParameters must be NULL for + output-only streams. + + @param outputParameters A structure that describes the output parameters used + to open a stream. The suggestedLatency field is ignored. See PaStreamParameters + for a description of these parameters. outputParameters must be NULL for + input-only streams. + + @param sampleRate The required sampleRate. For full-duplex streams it is the + sample rate for both input and output + + @return Returns 0 if the format is supported, and an error code indicating why + the format is not supported otherwise. The constant paFormatIsSupported is + provided to compare with the return value for success. + + @see paFormatIsSupported, PaStreamParameters +*/ +PaError Pa_IsFormatSupported( const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate ); + + + +/* Streaming types and functions */ + + +/** + A single PaStream can provide multiple channels of real-time + streaming audio input and output to a client application. A stream + provides access to audio hardware represented by one or more + PaDevices. Depending on the underlying Host API, it may be possible + to open multiple streams using the same device, however this behavior + is implementation defined. Portable applications should assume that + a PaDevice may be simultaneously used by at most one PaStream. + + Pointers to PaStream objects are passed between PortAudio functions that + operate on streams. + + @see Pa_OpenStream, Pa_OpenDefaultStream, Pa_OpenDefaultStream, Pa_CloseStream, + Pa_StartStream, Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive, + Pa_GetStreamTime, Pa_GetStreamCpuLoad + +*/ +typedef void PaStream; + + +/** Can be passed as the framesPerBuffer parameter to Pa_OpenStream() + or Pa_OpenDefaultStream() to indicate that the stream callback will + accept buffers of any size. +*/ +#define paFramesPerBufferUnspecified (0) + + +/** Flags used to control the behavior of a stream. They are passed as + parameters to Pa_OpenStream or Pa_OpenDefaultStream. Multiple flags may be + ORed together. + + @see Pa_OpenStream, Pa_OpenDefaultStream + @see paNoFlag, paClipOff, paDitherOff, paNeverDropInput, + paPrimeOutputBuffersUsingStreamCallback, paPlatformSpecificFlags +*/ +typedef unsigned long PaStreamFlags; + +/** @see PaStreamFlags */ +#define paNoFlag ((PaStreamFlags) 0) + +/** Disable default clipping of out of range samples. + @see PaStreamFlags +*/ +#define paClipOff ((PaStreamFlags) 0x00000001) + +/** Disable default dithering. + @see PaStreamFlags +*/ +#define paDitherOff ((PaStreamFlags) 0x00000002) + +/** Flag requests that where possible a full duplex stream will not discard + overflowed input samples without calling the stream callback. This flag is + only valid for full duplex callback streams and only when used in combination + with the paFramesPerBufferUnspecified (0) framesPerBuffer parameter. Using + this flag incorrectly results in a paInvalidFlag error being returned from + Pa_OpenStream and Pa_OpenDefaultStream. + + @see PaStreamFlags, paFramesPerBufferUnspecified +*/ +#define paNeverDropInput ((PaStreamFlags) 0x00000004) + +/** Call the stream callback to fill initial output buffers, rather than the + default behavior of priming the buffers with zeros (silence). This flag has + no effect for input-only and blocking read/write streams. + + @see PaStreamFlags +*/ +#define paPrimeOutputBuffersUsingStreamCallback ((PaStreamFlags) 0x00000008) + +/** A mask specifying the platform specific bits. + @see PaStreamFlags +*/ +#define paPlatformSpecificFlags ((PaStreamFlags)0xFFFF0000) + +/** + Timing information for the buffers passed to the stream callback. +*/ +typedef struct PaStreamCallbackTimeInfo{ + PaTime inputBufferAdcTime; + PaTime currentTime; + PaTime outputBufferDacTime; +} PaStreamCallbackTimeInfo; + + +/** + Flag bit constants for the statusFlags to PaStreamCallback. + + @see paInputUnderflow, paInputOverflow, paOutputUnderflow, paOutputOverflow, + paPrimingOutput +*/ +typedef unsigned long PaStreamCallbackFlags; + +/** In a stream opened with paFramesPerBufferUnspecified, indicates that + input data is all silence (zeros) because no real data is available. In a + stream opened without paFramesPerBufferUnspecified, it indicates that one or + more zero samples have been inserted into the input buffer to compensate + for an input underflow. + @see PaStreamCallbackFlags +*/ +#define paInputUnderflow ((PaStreamCallbackFlags) 0x00000001) + +/** In a stream opened with paFramesPerBufferUnspecified, indicates that data + prior to the first sample of the input buffer was discarded due to an + overflow, possibly because the stream callback is using too much CPU time. + Otherwise indicates that data prior to one or more samples in the + input buffer was discarded. + @see PaStreamCallbackFlags +*/ +#define paInputOverflow ((PaStreamCallbackFlags) 0x00000002) + +/** Indicates that output data (or a gap) was inserted, possibly because the + stream callback is using too much CPU time. + @see PaStreamCallbackFlags +*/ +#define paOutputUnderflow ((PaStreamCallbackFlags) 0x00000004) + +/** Indicates that output data will be discarded because no room is available. + @see PaStreamCallbackFlags +*/ +#define paOutputOverflow ((PaStreamCallbackFlags) 0x00000008) + +/** Some of all of the output data will be used to prime the stream, input + data may be zero. + @see PaStreamCallbackFlags +*/ +#define paPrimingOutput ((PaStreamCallbackFlags) 0x00000010) + +/** + Allowable return values for the PaStreamCallback. + @see PaStreamCallback +*/ +typedef enum PaStreamCallbackResult +{ + paContinue=0, + paComplete=1, + paAbort=2 +} PaStreamCallbackResult; + + +/** + Functions of type PaStreamCallback are implemented by PortAudio clients. + They consume, process or generate audio in response to requests from an + active PortAudio stream. + + @param input and @param output are arrays of interleaved samples, + the format, packing and number of channels used by the buffers are + determined by parameters to Pa_OpenStream(). + + @param frameCount The number of sample frames to be processed by + the stream callback. + + @param timeInfo The time in seconds when the first sample of the input + buffer was received at the audio input, the time in seconds when the first + sample of the output buffer will begin being played at the audio output, and + the time in seconds when the stream callback was called. + See also Pa_GetStreamTime() + + @param statusFlags Flags indicating whether input and/or output buffers + have been inserted or will be dropped to overcome underflow or overflow + conditions. + + @param userData The value of a user supplied pointer passed to + Pa_OpenStream() intended for storing synthesis data etc. + + @return + The stream callback should return one of the values in the + PaStreamCallbackResult enumeration. To ensure that the callback continues + to be called, it should return paContinue (0). Either paComplete or paAbort + can be returned to finish stream processing, after either of these values is + returned the callback will not be called again. If paAbort is returned the + stream will finish as soon as possible. If paComplete is returned, the stream + will continue until all buffers generated by the callback have been played. + This may be useful in applications such as soundfile players where a specific + duration of output is required. However, it is not necessary to utilise this + mechanism as Pa_StopStream(), Pa_AbortStream() or Pa_CloseStream() can also + be used to stop the stream. The callback must always fill the entire output + buffer irrespective of its return value. + + @see Pa_OpenStream, Pa_OpenDefaultStream + + @note With the exception of Pa_GetStreamCpuLoad() it is not permissable to call + PortAudio API functions from within the stream callback. +*/ +typedef int PaStreamCallback( + const void *input, void *output, + unsigned long frameCount, + const PaStreamCallbackTimeInfo* timeInfo, + PaStreamCallbackFlags statusFlags, + void *userData ); + + +/** Opens a stream for either input, output or both. + + @param stream The address of a PaStream pointer which will receive + a pointer to the newly opened stream. + + @param inputParameters A structure that describes the input parameters used by + the opened stream. See PaStreamParameters for a description of these parameters. + inputParameters must be NULL for output-only streams. + + @param outputParameters A structure that describes the output parameters used by + the opened stream. See PaStreamParameters for a description of these parameters. + outputParameters must be NULL for input-only streams. + + @param sampleRate The desired sampleRate. For full-duplex streams it is the + sample rate for both input and output + + @param framesPerBuffer The number of frames passed to the stream callback + function, or the preferred block granularity for a blocking read/write stream. + The special value paFramesPerBufferUnspecified (0) may be used to request that + the stream callback will recieve an optimal (and possibly varying) number of + frames based on host requirements and the requested latency settings. + Note: With some host APIs, the use of non-zero framesPerBuffer for a callback + stream may introduce an additional layer of buffering which could introduce + additional latency. PortAudio guarantees that the additional latency + will be kept to the theoretical minimum however, it is strongly recommended + that a non-zero framesPerBuffer value only be used when your algorithm + requires a fixed number of frames per stream callback. + + @param streamFlags Flags which modify the behaviour of the streaming process. + This parameter may contain a combination of flags ORed together. Some flags may + only be relevant to certain buffer formats. + + @param streamCallback A pointer to a client supplied function that is responsible + for processing and filling input and output buffers. If this parameter is NULL + the stream will be opened in 'blocking read/write' mode. In blocking mode, + the client can receive sample data using Pa_ReadStream and write sample data + using Pa_WriteStream, the number of samples that may be read or written + without blocking is returned by Pa_GetStreamReadAvailable and + Pa_GetStreamWriteAvailable respectively. + + @param userData A client supplied pointer which is passed to the stream callback + function. It could for example, contain a pointer to instance data necessary + for processing the audio buffers. This parameter is ignored if streamCallback + is NULL. + + @return + Upon success Pa_OpenStream() returns paNoError and places a pointer to a + valid PaStream in the stream argument. The stream is inactive (stopped). + If a call to Pa_OpenStream() fails, a non-zero error code is returned (see + PaError for possible error codes) and the value of stream is invalid. + + @see PaStreamParameters, PaStreamCallback, Pa_ReadStream, Pa_WriteStream, + Pa_GetStreamReadAvailable, Pa_GetStreamWriteAvailable +*/ +PaError Pa_OpenStream( PaStream** stream, + const PaStreamParameters *inputParameters, + const PaStreamParameters *outputParameters, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamFlags streamFlags, + PaStreamCallback *streamCallback, + void *userData ); + + +/** A simplified version of Pa_OpenStream() that opens the default input + and/or output devices. + + @param stream The address of a PaStream pointer which will receive + a pointer to the newly opened stream. + + @param numInputChannels The number of channels of sound that will be supplied + to the stream callback or returned by Pa_ReadStream. It can range from 1 to + the value of maxInputChannels in the PaDeviceInfo record for the default input + device. If 0 the stream is opened as an output-only stream. + + @param numOutputChannels The number of channels of sound to be delivered to the + stream callback or passed to Pa_WriteStream. It can range from 1 to the value + of maxOutputChannels in the PaDeviceInfo record for the default output dvice. + If 0 the stream is opened as an output-only stream. + + @param sampleFormat The sample format of both the input and output buffers + provided to the callback or passed to and from Pa_ReadStream and Pa_WriteStream. + sampleFormat may be any of the formats described by the PaSampleFormat + enumeration. + + @param sampleRate Same as Pa_OpenStream parameter of the same name. + @param framesPerBuffer Same as Pa_OpenStream parameter of the same name. + @param streamCallback Same as Pa_OpenStream parameter of the same name. + @param userData Same as Pa_OpenStream parameter of the same name. + + @return As for Pa_OpenStream + + @see Pa_OpenStream, PaStreamCallback +*/ +PaError Pa_OpenDefaultStream( PaStream** stream, + int numInputChannels, + int numOutputChannels, + PaSampleFormat sampleFormat, + double sampleRate, + unsigned long framesPerBuffer, + PaStreamCallback *streamCallback, + void *userData ); + + +/** Closes an audio stream. If the audio stream is active it + discards any pending buffers as if Pa_AbortStream() had been called. +*/ +PaError Pa_CloseStream( PaStream *stream ); + + +/** Functions of type PaStreamFinishedCallback are implemented by PortAudio + clients. They can be registered with a stream using the Pa_SetStreamFinishedCallback + function. Once registered they are called when the stream becomes inactive + (ie once a call to Pa_StopStream() will not block). + A stream will become inactive after the stream callback returns non-zero, + or when Pa_StopStream or Pa_AbortStream is called. For a stream providing audio + output, if the stream callback returns paComplete, or Pa_StopStream is called, + the stream finished callback will not be called until all generated sample data + has been played. + + @param userData The userData parameter supplied to Pa_OpenStream() + + @see Pa_SetStreamFinishedCallback +*/ +typedef void PaStreamFinishedCallback( void *userData ); + + +/** Register a stream finished callback function which will be called when the + stream becomes inactive. See the description of PaStreamFinishedCallback for + further details about when the callback will be called. + + @param stream a pointer to a PaStream that is in the stopped state - if the + stream is not stopped, the stream's finished callback will remain unchanged + and an error code will be returned. + + @param streamFinishedCallback a pointer to a function with the same signature + as PaStreamFinishedCallback, that will be called when the stream becomes + inactive. Passing NULL for this parameter will un-register a previously + registered stream finished callback function. + + @return on success returns paNoError, otherwise an error code indicating the cause + of the error. + + @see PaStreamFinishedCallback +*/ +PaError Pa_SetStreamFinishedCallback( PaStream *stream, PaStreamFinishedCallback* streamFinishedCallback ); + + +/** Commences audio processing. +*/ +PaError Pa_StartStream( PaStream *stream ); + + +/** Terminates audio processing. It waits until all pending + audio buffers have been played before it returns. +*/ +PaError Pa_StopStream( PaStream *stream ); + + +/** Terminates audio processing immediately without waiting for pending + buffers to complete. +*/ +PaError Pa_AbortStream( PaStream *stream ); + + +/** Determine whether the stream is stopped. + A stream is considered to be stopped prior to a successful call to + Pa_StartStream and after a successful call to Pa_StopStream or Pa_AbortStream. + If a stream callback returns a value other than paContinue the stream is NOT + considered to be stopped. + + @return Returns one (1) when the stream is stopped, zero (0) when + the stream is running or, a PaErrorCode (which are always negative) if + PortAudio is not initialized or an error is encountered. + + @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamActive +*/ +PaError Pa_IsStreamStopped( PaStream *stream ); + + +/** Determine whether the stream is active. + A stream is active after a successful call to Pa_StartStream(), until it + becomes inactive either as a result of a call to Pa_StopStream() or + Pa_AbortStream(), or as a result of a return value other than paContinue from + the stream callback. In the latter case, the stream is considered inactive + after the last buffer has finished playing. + + @return Returns one (1) when the stream is active (ie playing or recording + audio), zero (0) when not playing or, a PaErrorCode (which are always negative) + if PortAudio is not initialized or an error is encountered. + + @see Pa_StopStream, Pa_AbortStream, Pa_IsStreamStopped +*/ +PaError Pa_IsStreamActive( PaStream *stream ); + + + +/** A structure containing unchanging information about an open stream. + @see Pa_GetStreamInfo +*/ + +typedef struct PaStreamInfo +{ + /** this is struct version 1 */ + int structVersion; + + /** The input latency of the stream in seconds. This value provides the most + accurate estimate of input latency available to the implementation. It may + differ significantly from the suggestedLatency value passed to Pa_OpenStream(). + The value of this field will be zero (0.) for output-only streams. + @see PaTime + */ + PaTime inputLatency; + + /** The output latency of the stream in seconds. This value provides the most + accurate estimate of output latency available to the implementation. It may + differ significantly from the suggestedLatency value passed to Pa_OpenStream(). + The value of this field will be zero (0.) for input-only streams. + @see PaTime + */ + PaTime outputLatency; + + /** The sample rate of the stream in Hertz (samples per second). In cases + where the hardware sample rate is inaccurate and PortAudio is aware of it, + the value of this field may be different from the sampleRate parameter + passed to Pa_OpenStream(). If information about the actual hardware sample + rate is not available, this field will have the same value as the sampleRate + parameter passed to Pa_OpenStream(). + */ + double sampleRate; + +} PaStreamInfo; + + +/** Retrieve a pointer to a PaStreamInfo structure containing information + about the specified stream. + @return A pointer to an immutable PaStreamInfo structure. If the stream + parameter invalid, or an error is encountered, the function returns NULL. + + @param stream A pointer to an open stream previously created with Pa_OpenStream. + + @note PortAudio manages the memory referenced by the returned pointer, + the client must not manipulate or free the memory. The pointer is only + guaranteed to be valid until the specified stream is closed. + + @see PaStreamInfo +*/ +const PaStreamInfo* Pa_GetStreamInfo( PaStream *stream ); + + +/** Determine the current time for the stream according to the same clock used + to generate buffer timestamps. This time may be used for syncronising other + events to the audio stream, for example synchronizing audio to MIDI. + + @return The stream's current time in seconds, or 0 if an error occurred. + + @see PaTime, PaStreamCallback +*/ +PaTime Pa_GetStreamTime( PaStream *stream ); + + +/** Retrieve CPU usage information for the specified stream. + The "CPU Load" is a fraction of total CPU time consumed by a callback stream's + audio processing routines including, but not limited to the client supplied + stream callback. This function does not work with blocking read/write streams. + + This function may be called from the stream callback function or the + application. + + @return + A floating point value, typically between 0.0 and 1.0, where 1.0 indicates + that the stream callback is consuming the maximum number of CPU cycles possible + to maintain real-time operation. A value of 0.5 would imply that PortAudio and + the stream callback was consuming roughly 50% of the available CPU time. The + return value may exceed 1.0. A value of 0.0 will always be returned for a + blocking read/write stream, or if an error occurrs. +*/ +double Pa_GetStreamCpuLoad( PaStream* stream ); + + +/** Read samples from an input stream. The function doesn't return until + the entire buffer has been filled - this may involve waiting for the operating + system to supply the data. + + @param stream A pointer to an open stream previously created with Pa_OpenStream. + + @param buffer A pointer to a buffer of sample frames. The buffer contains + samples in the format specified by the inputParameters->sampleFormat field + used to open the stream, and the number of channels specified by + inputParameters->numChannels. If non-interleaved samples were requested, + buffer is a pointer to the first element of an array of non-interleaved + buffer pointers, one for each channel. + + @param frames The number of frames to be read into buffer. This parameter + is not constrained to a specific range, however high performance applications + will want to match this parameter to the framesPerBuffer parameter used + when opening the stream. + + @return On success PaNoError will be returned, or PaInputOverflowed if input + data was discarded by PortAudio after the previous call and before this call. +*/ +PaError Pa_ReadStream( PaStream* stream, + void *buffer, + unsigned long frames ); + + +/** Write samples to an output stream. This function doesn't return until the + entire buffer has been consumed - this may involve waiting for the operating + system to consume the data. + + @param stream A pointer to an open stream previously created with Pa_OpenStream. + + @param buffer A pointer to a buffer of sample frames. The buffer contains + samples in the format specified by the outputParameters->sampleFormat field + used to open the stream, and the number of channels specified by + outputParameters->numChannels. If non-interleaved samples were requested, + buffer is a pointer to the first element of an array of non-interleaved + buffer pointers, one for each channel. + + @param frames The number of frames to be written from buffer. This parameter + is not constrained to a specific range, however high performance applications + will want to match this parameter to the framesPerBuffer parameter used + when opening the stream. + + @return On success PaNoError will be returned, or paOutputUnderflowed if + additional output data was inserted after the previous call and before this + call. +*/ +PaError Pa_WriteStream( PaStream* stream, + const void *buffer, + unsigned long frames ); + + +/** Retrieve the number of frames that can be read from the stream without + waiting. + + @return Returns a non-negative value representing the maximum number of frames + that can be read from the stream without blocking or busy waiting or, a + PaErrorCode (which are always negative) if PortAudio is not initialized or an + error is encountered. +*/ +signed long Pa_GetStreamReadAvailable( PaStream* stream ); + + +/** Retrieve the number of frames that can be written to the stream without + waiting. + + @return Returns a non-negative value representing the maximum number of frames + that can be written to the stream without blocking or busy waiting or, a + PaErrorCode (which are always negative) if PortAudio is not initialized or an + error is encountered. +*/ +signed long Pa_GetStreamWriteAvailable( PaStream* stream ); + + +/* Miscellaneous utilities */ + + +/** Retrieve the size of a given sample format in bytes. + + @return The size in bytes of a single sample in the specified format, + or paSampleFormatNotSupported if the format is not supported. +*/ +PaError Pa_GetSampleSize( PaSampleFormat format ); + + +/** Put the caller to sleep for at least 'msec' milliseconds. This function is + provided only as a convenience for authors of portable code (such as the tests + and examples in the PortAudio distribution.) + + The function may sleep longer than requested so don't rely on this for accurate + musical timing. +*/ +void Pa_Sleep( long msec ); + + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ +#endif /* PORTAUDIO_H */ diff --git a/lib/jtty/rjtty.f90 b/lib/jtty/rjtty.f90 new file mode 100644 index 00000000..16c6263e --- /dev/null +++ b/lib/jtty/rjtty.f90 @@ -0,0 +1,85 @@ +program rjtty + +! Decode JTTY data in one or more WAV files. + + use wavhdr + use jtty_mod + use jtty_mdec + +! MAX_FRAMES = 16 in pack_jtty. Each frame is +! 59 symbols (13 sync + 46 codeword). +! Maximum length of a transmission is +! 16*59*(symbol_duration). +! With baud rate 31.25 s^-1, symbol duration = 32 ms, +! so maximum txt = 16*59*0.032 = 30.208 s. + + parameter (NMAX=180*12000) !Max length of data + type(hdr) h + character*80 fname + character*8 arg + integer*2 iwave(NMAX) + logical success,newsig + + f0=1500.0 + ftol=50.0 + nsps = 384 + nfa=200 + nfb=2800 + + nargs=iargc() + if(nargs.lt.6) then + print*,'Usage: rjtty smin ndebug nsps f0 ftol fname [...]' + print*,'Examples: rjtty 4.6 0 384 1500 50 000000_000001.wav' + print*,' rjtty 4.6 1 240 1500 50 *.wav' + print*,'nsps choices are: 240, 320, 384, 480 samples/symbol' + go to 999 + endif + call getarg(1,arg) + read(arg,*) smin + call getarg(2,arg) + read(arg,*) ndebug + call getarg(3,arg) + read(arg,*) nsps + if(nsps .ne. 240 .and. nsps .ne. 320 .and. nsps .ne. 384 .and. nsps .ne. 480) then + print*,'nsps choices are: 240, 320, 384, 480 samples/symbol' + endif + call getarg(4,arg) + read(arg,*) f0 + call getarg(5,arg) + read(arg,*) ftol + + nframe = 59*nsps + nchunk = nframe + nframe/4 + ndecodes = 0 + + do ifile=1,nargs-5 + call getarg(ifile+5,fname) + open(10,file=fname,status='old',access='stream') + read(10) h + nwave=min(h%ndata/2,NMAX) + read(10) iwave(1:nwave) + close(10) + if(ndebug.gt.0) then + n=len_trim(fname) + write(*,'(a)') fname(n-16:n) + endif + if(nwave.lt.NMAX) iwave(nwave+1:NMAX) = 0 + ndecodes=0 + kchar=0 + istart=1 + nsync=0 + f1good = -99. + xdtgood = -99. + missed_syncs = 0 + newsig = .false. + +! Process data on the fly, one buffer at a time: + do while (istart+nchunk-1 .le. nwave) + success=.false. + call jtty_mdecode_step(iwave,nwave,istart,1,nchunk,nsps,ndebug,nfa,nfb,f0,ftol,smin) + call discard_pending_updates() + istart=istart+nframe/4 + enddo + enddo !ifile + +999 end program rjtty diff --git a/lib/jtty/rjtty_sub.f90 b/lib/jtty/rjtty_sub.f90 new file mode 100644 index 00000000..333d38b4 --- /dev/null +++ b/lib/jtty/rjtty_sub.f90 @@ -0,0 +1,102 @@ +subroutine rjtty_sub(iwave,kz,nsps,nfa,nfb,f0,ftol) + ! Unwindowed entry point: scans the whole buffer, exactly as before. + integer*2 iwave(kz) + call rjtty_core(iwave,kz,nsps,nfa,nfb,f0,ftol,1,kz) +end subroutine rjtty_sub + +subroutine rjtty_sub_windowed(iwave,kz,nsps,nfa,nfb,f0,ftol,istart0,istop) + ! Bounds the scan to [istart0,istop] (sample indices into iwave) instead + ! of the whole buffer -- e.g. a WideGraph click-driven re-decode that only + ! needs a window around a known time, not a full "decode again" pass. + integer*2 iwave(kz) + integer, intent(in) :: istart0,istop + call rjtty_core(iwave,kz,nsps,nfa,nfb,f0,ftol,istart0,istop) +end subroutine rjtty_sub_windowed + +subroutine rjtty_core(iwave,kz,nsps,nfa,nfb,f0,ftol,istart0,istop) + + use jtty_mdec + integer*2 iwave(kz) + integer, intent(in) :: istart0,istop + data kz0/9999999/,missed_syncs/0/,istart0_save/0/ + save istart,kz0,kchar,missed_syncs,ndtol,istart0_save + + if(nsps.ne.240 .and. nsps.ne.320 .and. nsps.ne.384 .and. nsps.ne.480) return + + nframe = 59*nsps + nchunk = nframe + nframe/4 + smin=4.6 + + ! A shorter/new buffer always restarts; a windowed call whose window has + ! moved (a new click) also restarts, even mid-buffer, so active assemblies + ! are not polluted by a previous window's in-progress messages. + if(kz .le. kz0 .or. istart0.ne.istart0_save) then + kz0=kz + istart=istart0 + kchar=0 + ndtol=0 + call reset_decode_search_state() + istart0_save=istart0 + go to 999 + endif + kzeff=min(kz,istop) + if(kzeff-istart+1 .lt. nchunk) return ! wait for enough data + + nsync=0 + do while (istart+nchunk-1 .le. kzeff) + ndebug=-1 + snr=-99.0 + call jtty_mdecode_step(iwave,kz,istart,istart0,nchunk,nsps,ndebug,nfa,nfb, & + f0,ftol,smin) + istart=istart+nframe/4 + enddo + +999 return +end subroutine rjtty_core + +subroutine jtty_get_updates(text_blocks,message_ids,frequencies,start_tsync,eom,count) + + use iso_fortran_env, only: int64 + use jtty_mdec + integer, parameter :: BATCH_SIZE = 30 + integer, parameter :: MESSAGE_LENGTH = 80 + character(len=BATCH_SIZE*MESSAGE_LENGTH), intent(out) :: text_blocks + integer(int64), intent(out) :: message_ids(BATCH_SIZE) + real, intent(out) :: frequencies(BATCH_SIZE) + real, intent(out) :: start_tsync(BATCH_SIZE) + logical*1, intent(out) :: eom(BATCH_SIZE) + integer, intent(out) :: count + character(len=MESSAGE_LENGTH) :: msg + integer :: i,index,offset + + text_blocks='' + message_ids=0_int64 + frequencies=0.0 + start_tsync=0.0 + eom=.false. + count=min(npending,BATCH_SIZE) + + do i=1,count + index=pending_first+i-1 + msg=display_message_text(pending_updates(index)%decoded) + offset=(i-1)*MESSAGE_LENGTH + text_blocks(offset+1:offset+MESSAGE_LENGTH)=msg + message_ids(i)=pending_updates(index)%message_id + frequencies(i)=pending_updates(index)%f1 + start_tsync(i)=pending_updates(index)%start_tsync + eom(i)=pending_updates(index)%complete + enddo + + ! Pending membership is the delivery guarantee; remove records only after copying them out. + pending_first=pending_first+count + npending=npending-count + if(npending.eq.0) then + pending_first=1 + if(allocated(pending_updates)) then + if(size(pending_updates).gt.MAX_ACTIVE_MESSAGES) then + deallocate(pending_updates) + allocate(pending_updates(MAX_ACTIVE_MESSAGES)) + endif + endif + endif +end subroutine jtty_get_updates diff --git a/lib/jtty/sjtty.f90 b/lib/jtty/sjtty.f90 new file mode 100644 index 00000000..16d4324a --- /dev/null +++ b/lib/jtty/sjtty.f90 @@ -0,0 +1,258 @@ +program sjtty + + ! Simulate received data for JTTY, a mode operationally similar to RTTY + ! but providing much better performance and reliability. + + ! Messages are source-encoded into 34-bit blocks. A 12-bit CRC is + ! added to create a 46 bit payload, which is then FEC-encoded using + ! a tail-biting rate-1/2 convolutional code (K=10) to create 92-bit + ! (46-symbol) codewords. + + ! Modulation is 4FSK at 12000/NSPS = 31.25 baud. Each transmitted frame + ! consists of 13 sync symbols followed by 46 codeword symbols. + + use wavhdr + use jtty_mod ! This module provides NSPS + use jtty_fec + + parameter (MAX_TONES=59*16) !Max number of channel symbols + character*12 arg !Command line argument + character*2 arg4 !The 4th command-line argument + character*80 umsg !User-formatted message + character(len=80) :: profile_option + integer :: exchange_profile,arg_offset + character*40 fname !Output file name + character*34 c32(16) + complex, allocatable :: cwave(:) !Complex generated waveform (12000 Hz) + complex, allocatable :: c0(:) !With propagation degradation + complex, allocatable :: c(:) !With propagation degradation + real, allocatable :: wave(:) !Real generated waveform (12000 Hz) + type(hdr) h !Header for .wav file + integer itone(MAX_TONES) !Array of tone frequencies for this message + integer*2, allocatable :: iwave(:) !Data written to the *.wav file + integer payload(PAYLOAD_BITS) + integer tone_symbols(TOTAL_K) + logical itu_model !True if fdop, delay are from an ITU model + + nargs=iargc() + exchange_profile=JTTY_EXCHANGE_UNKNOWN + arg_offset=0 + if(nargs.gt.0) then + call getarg(1,profile_option) + if(index(profile_option,'--exchange-profile=').eq.1) then + select case(trim(profile_option(20:))) + case('unknown'); exchange_profile=JTTY_EXCHANGE_UNKNOWN + case('field-day'); exchange_profile=JTTY_EXCHANGE_FIELD_DAY + case('rtty-roundup'); exchange_profile=JTTY_EXCHANGE_RTTY + case default + print*,'Invalid exchange profile: use unknown, field-day, or rtty-roundup' + stop 1 + end select + arg_offset=1 + nargs=nargs-1 + endif + endif + if(nargs.eq.1) then + call getarg(1+arg_offset,umsg) + call pack_jtty(umsg,c32,nframes,exchange_profile) + if(nframes.lt.0) then + print*,'Message exceeds JTTY encoding limits after exchange normalization' + stop 1 + endif + call unpack_jtty(c32,nframes,umsg) + do while (index(umsg,'~') .ne. 0) + i1=index(umsg,'~') + umsg(i1:i1)=' ' + enddo + write(*,'(a,a)') "Message after pack/unpack : ",trim(umsg) + nsps=384 + if(nframes.eq.1) then + write(*,'(i4,a,f5.2,a)') nframes," frame, Transmission length ", & + 59*nframes*nsps/12000.0," seconds" + else + write(*,'(i4,a,f5.2,a)') nframes," frames, Transmission length ", & + 59*nframes*nsps/12000.0," seconds" + endif + go to 999 + else if(nargs.ne.8) then + print*,'Usage: sjtty message' + print*,'Example: sjtty "CQ DX KA1ABC"' + print*,'or' + print*,'Usage: sjtty message f0 DT fdop del nsps nfiles SNR' + print*,'Example: sjtty "CQ K1ABC CQ" 1500 0.0 0.5 1 384 10 -10' + print*,'Optional first argument: --exchange-profile=unknown|field-day|rtty-roundup' + print*,'ITU propagation models: set fdop to AW LQ LM LD MQ MM MD HQ HM HD' + print*,'nsps: 240, 320, 384, or 480' + go to 999 + endif + + call getarg(1+arg_offset,umsg) !User message + call getarg(2+arg_offset,arg) + read(arg,*) f0 !Frequency of lowest tone + call getarg(3+arg_offset,arg) + read(arg,*) xdt !Time offset (positive only) + call getarg(4+arg_offset,arg) + itu_model=.true. + arg4=arg(1:2) + if(arg(1:2).eq.'LQ') then !ITU params for Low Latitude Quiet + fspread=0.5 + delay=0.5 + else if(arg(1:2).eq.'LM') then !Low Latitude Moderate + fspread=1.5 + delay=2.0 + else if(arg(1:2).eq.'LD') then !Low Latitude Disturbed + fspread=10.0 + delay=6.0 + else if(arg(1:2).eq.'MQ') then !Mid Latitude ... etc. + fspread=0.1 + delay=0.5 + else if(arg(1:2).eq.'MM') then + fspread=0.5 + delay=1.0 + else if(arg(1:2).eq.'MD') then + fspread=1.0 + delay=2.0 + else if(arg(1:2).eq.'HQ') then + fspread=0.5 + delay=1.0 + else if(arg(1:2).eq.'HM') then + fspread=10.0 + delay=3.0 + else if(arg(1:2).eq.'HD') then + fspread=30.0 + delay=7.0 + else if(arg(1:2).eq.'AW') then + fspread=0.0 + delay=0.0 + else + itu_model=.false. + read(arg,*) fspread !Watterson frequency spread (Hz) + call getarg(5+arg_offset,arg) + read(arg,*) delay !Watterson delay (ms) + endif + call getarg(6+arg_offset,arg) + read(arg,*) nsps !Number of files + if(nsps.ne.240 .and. nsps.ne.320 .and. nsps.ne.384 .and. nsps.ne.480) then + print*,'nsps: 240, 320, 384, or 480' + stop + endif + call getarg(7+arg_offset,arg) + read(arg,*) nfiles !Number of files + call getarg(8+arg_offset,arg) + read(arg,*) snrdb !SNR in 2500 Hz bandwidth + + fsample=12000.0 + dt=1.0/fsample + twopi=8.0*atan(1.0) + bandwidth_ratio=2500.0/(fsample/2.0) + sig=sqrt(2*bandwidth_ratio) * 10.0**(0.05*snrdb) + if(snrdb.gt.90.0) sig=1.0 + + bt=2.0 !Default bt=2 (smaller ==> more smoothing) + baud=fsample/nsps !Symbol rate + bw=4.0*baud !Signal bandwidth + hmod=1.0 !Modulation index + + call pack_jtty(umsg,c32,nframes,exchange_profile) + if(nframes.lt.0) then + print*,'Message exceeds JTTY encoding limits after exchange normalization' + stop 1 + endif + nsym=0 + do i=1,nframes + read(c32(i),'(34i1)') payload + call tbcc_encode(payload,tone_symbols,JTTY_TBCC_PROFILE_1167_1545_80F) + ib=(i-1)*59+1 ! 59 tones per frame + itone(ib:ib+12)=is13 + itone(ib+13:ib+58)=tone_symbols + nsym=nsym+59 + enddo + + txt=nsym*nsps*dt !Transmission length (s) + numsg=len(trim(umsg)) + write(*,1012) trim(umsg) +1012 format('User message: ',a) + write(*,1013) nsps,txt,nsym,itone(1:nsym) +1013 format('nsps:',i5,' samples/symbol ','Transmission length:',f5.1, & + ' s,',i5,' channel symbols:'/ & + (30i2)) + + nwave=nsps*nsym !Length of i*2 data written to *.wav file + npts=2**(int(log(float(nwave)+xdt/dt)/log(2.0) + 0.9999)) !Round up to integer power of 2 + iz=nint(xdt/dt) + nwave + nsps*59 !Add one frame of noise at end + nbuf=max(nwave,npts,iz) + + allocate(cwave(0:nwave-1)) + allocate(c0(0:nbuf-1)) + allocate(c(0:nbuf-1)) + allocate(wave(1:nbuf)) + allocate(iwave(1:nbuf)) + + icmplx=1 + call gen_jttywave(itone,nsym,nsps,bt,fsample,f0,cwave,wave,icmplx,nwave) + + + write(*,1000) f0,xdt,txt,snrdb,bw +1000 format('f0:',f7.1,' DT:',f6.2,' TxT:',f6.1,' SNR:',f6.1,' BW:',f6.1) + cps=baud/7.0 + cps_effective=numsg/txt + write(*,1001) cps,cps_effective +1001 format('Raw character rate:',f5.1,' c/s Effective character rate:',f5.1,' c/s') + write(*,1002) fspread,delay +1002 format('Fspread:',f5.1,' Hz Delay:',f5.1,' ms') + if(itu_model) write(*,1003) arg4 +1003 format('ITU propagation model: ',a2) + write(*,*) + +! call sgran() + + do ifile=1,nfiles + c0=0. + c0(0:nwave-1)=cwave(0:nwave-1) + c0=cshift(c0,-nint(xdt/dt)) + if(fspread.ne.0.0 .or. delay.ne.0.0) then + ! Apply channel propagation + call watterson(c0,npts,nwave,fsample,delay,fspread) + endif + c=0. + c=sig*c0 !Scale to specified SNR + wave=0. + wave=imag(c) !Signal with SNR and prop degradation + + if(snrdb.lt.90) then + do i=1,iz !Add gaussian noise for specified SNR + xnoise=gran() + wave(i)=wave(i) + xnoise + enddo + endif + + gain=100.0 + if(snrdb.lt.90.0) then + wave(1:iz)=gain*wave(1:iz) + else + datpk=maxval(abs(wave(1:iz))) + fac=32766.9/datpk + wave(1:iz)=fac*wave(1:iz) + endif + + iwave(1:iz)=nint(wave(1:iz)) +! call jtty_spec(iwave,iz) + h=default_header(12000,iz) + write(fname,1102) ifile +1102 format('000000_',i6.6,'.wav') + open(10,file=fname,status='replace',access='stream') + write(10) h,iwave(1:iz) !Save to *.wav file + close(10) + write(*,1110) ifile,xdt,f0,snrdb,fname +1110 format(i4,f7.2,f8.2,f7.1,2x,a17) + enddo + +999 if (allocated(cwave)) deallocate(cwave) + if (allocated(c0)) deallocate(c0) + if (allocated(c)) deallocate(c) + if (allocated(wave)) deallocate(wave) + if (allocated(iwave)) deallocate(iwave) + +end program sjtty + +!include 'jtty_spec.f90' diff --git a/lib/jtty/sjtty_qrm.f90 b/lib/jtty/sjtty_qrm.f90 new file mode 100644 index 00000000..d4038b0b --- /dev/null +++ b/lib/jtty/sjtty_qrm.f90 @@ -0,0 +1,238 @@ +program sjtty_qrm + + ! Simulate received data for JTTY, a mode operationally similar to RTTY + ! but providing much better performance and reliability. + + ! Messages are source-encoded into 34-bit blocks. A 12-bit CRC is + ! added to create a 46 bit payload, which is then FEC-encoded using + ! a tail-biting rate-1/2 convolutional code (K=10) to create 92-bit + ! (46-symbol) codewords. + + ! Modulation is 4FSK at 12000/NSPS = 31.25 baud. Each transmitted frame + ! consists of 13 sync symbols followed by 46 codeword symbols. + + ! This version generates multiple signals spread across nfa to nfb Hz. + ! One signal falls at f0 = 1500 Hz and has the message "599 123" (or, if + ! an 8th command-line argument is given, that text instead -- a longer, + ! multi-frame message there is useful for exercising continuation-frame + ! logic, e.g. the sticky-sync retry, that a single-frame message never + ! reaches). Others are spread in frequency and DT, and contain just a + ! callsign. + + use wavhdr + use jtty_mod + use jtty_fec + + parameter (NMAX=131072) !Max size of .wav file + parameter (MAX_TONES=59*16) !Max number of channel symbols + parameter (MAX_SIGS=20) !Max number of signals + character*12 arg !Command line argument + character*2 arg4 !The 4th command-line argument + character*80 umsg !User-formatted message + character*80 msg_override !Optional 8th-arg override for f0=1500 signal + character*17 fname !Output file name, + character*10 flags !Single-character shorthand flags + character*34 c32(16) + character*6 xcall(25) + complex cwave(0:NMAX-1) !Complex generated waveform (12000 Hz) + complex c0(0:NMAX-1) !With propagation degradation + complex cdat(0:NMAX-1) + real wave (NMAX) !Real generated waveform (12000 Hz) + real xnoise(NMAX) + type(hdr) h !Header for .wav file + integer itone(MAX_TONES) !Array of tone frequencies for this message + integer*2 iwave(NMAX) !Data written to the *.wav file + integer payload(PAYLOAD_BITS) + integer tone_symbols(TOTAL_K) + data flags/'!@#$%^&*()'/ + data idum/-1/ + + ! Some arbitrary callsigns: + data xcall/'AC9QI ','CF7GEM','EA1AAE','GI4FUE','IU8CNE','K2AK ', & + 'K5CIA ','K7CAH ','KA9KQH','KE0N ','KM2J ','KP4SX ', & + 'LV7QFH','N2PPI ','N6GP ','N8HMG ','NV8B ','PA2GP ', & + 'PY7BC ','W0OGH ','W4EIS ','W6RYO ','W8OI ','WA2HIP', & + 'WB2KSP'/ + + nargs=iargc() + if(nargs.ne.7 .and. nargs.ne.8) then + print*,'Usage: sjtty_qrm nsps prop nfa nfb nsigs nfiles snr [message]' + print*,'Example: sjtty_qrm 384 MM 1200 1800 5 10 -5' + print*,'Example: sjtty_qrm 384 MM 1200 1800 5 10 -5 ', & + '"LET''S ASK BRIAN WHAT HE THINKS"' + print*,'NSPS must be 240, 320, 384, or 480' + print*,'ITU propagation models: AW LQ LM LD MQ MM MD HQ HM HD' + print*,'Main signal at f0 = 1500 Hz and specified SNR, message' + print*,'"599 123" unless the optional 8th argument overrides it --' + print*,'quote it if it contains spaces. A message long enough to' + print*,'need more than one frame exercises continuation-frame' + print*,'decoder logic that "599 123" alone never reaches; frames' + print*,'beyond what the fixed-size output buffer can hold at this' + print*,'signal''s randomly-drawn DT are silently dropped (matches a' + print*,'transmission truncated by a WAV-file boundary), with a' + print*,'warning printed when that happens.' + print*,'Off-freq signals at random freqs in range nfa to nfb Hz.' + print*,'Off-freq SNRs randomized by +/- 5 dB around specified value' + print*,'DT values random in range 0.1 to 1.0 s.' + go to 999 + endif + + call getarg(1,arg) + read(arg,*) nsps + call getarg(2,arg) + arg4=arg(1:2) + if(arg(1:2).eq.'LQ') then !ITU params for Low Latitude Quiet + fspread=0.5 + delay=0.5 + else if(arg(1:2).eq.'LM') then !Low Latitude Moderate + fspread=1.5 + delay=2.0 + else if(arg(1:2).eq.'LD') then !Low Latitude Disturbed + fspread=10.0 + delay=6.0 + else if(arg(1:2).eq.'MQ') then !Mid Latitude ... etc. + fspread=0.1 + delay=0.5 + else if(arg(1:2).eq.'MM') then + fspread=0.5 + delay=1.0 + else if(arg(1:2).eq.'MD') then + fspread=1.0 + delay=2.0 + else if(arg(1:2).eq.'HQ') then + fspread=0.5 + delay=1.0 + else if(arg(1:2).eq.'HM') then + fspread=10.0 + delay=3.0 + else if(arg(1:2).eq.'HD') then + fspread=30.0 + delay=7.0 + else if(arg(1:2).eq.'AW') then + fspread=0.0 + delay=0.0 + endif + call getarg(3,arg) + read(arg,*) nfa + call getarg(4,arg) + read(arg,*) nfb + call getarg(5,arg) + read(arg,*) nsigs + call getarg(6,arg) + read(arg,*) nfiles + call getarg(7,arg) + read(arg,*) snrdb + if(nfa.lt.0 .or. nfb.lt.0) then + print*,'Frequency range endpoints must be nonnegative.' + stop 1 + endif + msg_override=' ' + if(nargs.eq.8) call getarg(8,msg_override) + + fsample=12000.0 + dt=1.0/fsample + twopi=8.0*atan(1.0) + bandwidth_ratio=2500.0/(fsample/2.0) + if(snrdb.gt.90.0) sig=1.0 + bt=2.0 !Default bt=2 (smaller ==> more smoothing) + baud=fsample/nsps !Symbol rate + bw=4.0*baud !Signal bandwidth + hmod=1.0 !Modulation index + + npts=131072 + do ifile=1,nfiles + write(fname,1002) ifile !Output filename +1002 format('000000_',i6.6,'.wav') + open(10,file=fname,access='stream',status='replace') + write(*,1004) ifile,fname +1004 format(i3,2x,a17) + xnoise=0. + if(snrdb.lt.90) then + do i=1,NMAX + xnoise(i)=gran() !Generate gaussian noise, rms=1.0 + enddo + endif + cdat=0. + i0=25.0*ran1(idum) + + do isig=1,nsigs + f0=nfa + (nfb-nfa)*ran1(idum) + xdt=0.1 + 3.9*ran1(idum) + snr=snrdb + 10.0*(ran1(idum)-0.5) + i0=i0+1 + if(i0.gt.25) i0=1 + umsg=xcall(i0) + if(isig.eq.1) then + f0=1500.0 + snr=snrdb + umsg='599 123' + if(len_trim(msg_override).gt.0) umsg=msg_override + endif + sig=sqrt(2*bandwidth_ratio) * 10.0**(0.05*snr) + write(*,1006) isig,f0,xdt,snr,sig,trim(umsg) +1006 format(i4,f8.1,f8.3,f7.1,f10.3,2x,a) + + i1=nint(xdt/dt) + call pack_jtty(umsg,c32,nframes) + ! itone/cwave/c0 are all fixed at NMAX -- gen_jttywave trusts its + ! caller's nwave completely, with no bounds checking of its own, + ! so a long enough message combined with this signal's own + ! (randomly drawn) start offset i1 could otherwise write past the + ! end of those arrays. Clamp to however many frames actually fit + ! before building itone, rather than risk that: this can only + ! happen with a message overriding the default "599 123" (that + ! one frame always fits), so it's silent for existing callers. + nframes_fit=max(0,(NMAX-i1)/(nsps*59)) + if(nframes.gt.nframes_fit) then + write(*,1007) nframes,nframes_fit +1007 format(' WARNING: message needs ',i2,' frames but only ', & + i2,' fit in the output buffer at this DT -- truncating') + nframes=nframes_fit + endif + if(nframes.lt.1) then + print*,' WARNING: no room for this signal at this DT -- skipping' + cycle + endif + nsym=0 + do i=1,nframes + read(c32(i),'(34i1)') payload + call tbcc_encode(payload,tone_symbols,JTTY_TBCC_PROFILE_1167_1545_80F) + ib=(i-1)*59+1 ! 59 tones per frame + itone(ib:ib+12)=is13 + itone(ib+13:ib+58)=tone_symbols + nsym=nsym+59 + enddo + nwave=nsps*nsym + icmplx=1 + call gen_jttywave(itone,nsym,nsps,bt,fsample,f0,cwave,wave,icmplx,nwave) + c0=0. + c0(i1:nwave+i1-1)=cwave(0:nwave-1)! + if(fspread.ne.0.0 .or. delay.ne.0.0) then + ! Apply channel propagation + call watterson(c0,npts,nwave,fsample,delay,fspread) + endif + cdat=cdat + sig*c0 + enddo ! isig + + c0=cdat + wave=0. + wave=aimag(c0) !Signal with SNR and prop degradation + iz=10*12000 + if(snrdb.lt.90) wave = wave + xnoise + + gain=100.0 + if(snrdb.lt.90.0) then + wave(1:iz)=gain*wave(1:iz) + else + datpk=maxval(abs(wave(1:iz))) + fac=32766.9/datpk + wave(1:iz)=fac*wave(1:iz) + endif + + iwave(1:iz)=nint(wave(1:iz)) + h=default_header(12000,iz) + write(10) h,iwave(1:iz) !Save to *.wav file + close(10) + enddo + +999 end program sjtty_qrm diff --git a/lib/jtty/subtract_jtty.f90 b/lib/jtty/subtract_jtty.f90 new file mode 100644 index 00000000..eeb062a0 --- /dev/null +++ b/lib/jtty/subtract_jtty.f90 @@ -0,0 +1,99 @@ +subroutine subtract_jtty(c0, n, nvalid, tone_symbols, nsym_total, nss, f1, xdt) + +! Subtract a decoded JTTY signal from the complex analytic buffer c0 (at +! 6000 Sa/s -- the domain jtty_mdecode.f90 already works in, produced from +! the raw audio by ana64a), so a second, weaker signal at a different +! time/frequency can be recovered in a follow-up decode pass over the +! residual. Modeled on lib/ft8/subtractft8.f90: build a unit-amplitude +! reference waveform for the already re-encoded (error-corrected) tone +! sequence, estimate its actual complex (amplitude+phase) channel gain via +! a matched-filter/low-pass correlation against c0, then subtract. +! +! Measured signal : c0(t) = a(t) * cref(t) + noise +! Reference signal : cref(t) = exp( j*(2*pi*f1*t+phi(t)) ), unit amplitude +! Complex gain : cfilt(t) = LPF[ c0(t) * CONJG(cref(t)) ] +! Subtract : c0(t) = c0(t) - cref(t) * cfilt(t) +! +! Unlike subtractft8 (a real-valued passband buffer, hence its factor-of-2 +! real-part subtraction to reconstruct a real signal from an analytic +! estimate), c0 here is already complex analytic, so the full complex +! estimate is subtracted directly with no real-part/factor-of-2 step. +! +! Input: complex c0(0:n-1) In/out: buffer to subtract from +! integer n Size of c0 (must be a power of 2) +! integer nvalid Number of valid samples in c0 (<=n) +! integer tone_symbols(nsym_total) Full frame: sync + info tones +! integer nsym_total Total symbols/frame (sync+info) +! integer nss Samples per symbol at 6000 Sa/s +! real f1 Signal's estimated audio frequency, Hz +! real xdt Signal's estimated DT (start time), s + + implicit none + integer, intent(in) :: n, nvalid, nsym_total, nss + complex, intent(inout) :: c0(0:n-1) + integer, intent(in) :: tone_symbols(nsym_total) + real, intent(in) :: f1, xdt + + real, parameter :: FSAMPLE6 = 6000.0 + integer, save :: nframe_save=-1, nfft_save=-1 + complex, allocatable, save :: cref(:), camp(:), cfilt(:), cw(:) + real, allocatable, save :: window(:) + integer :: nframe, nfft, nfilt, i, j, nstart + real :: pi, fac, sumw, xjunk(1) + complex :: z + + nframe=nsym_total*nss + nfft=n + ! ~2 symbol periods, matching subtractft8's NFILT (4000 samples @ 12000 + ! Sa/s = 333 ms) being ~2 FT8 symbol periods (160 ms each) -- smooths the + ! channel-gain estimate enough to track slow fading without blurring out + ! genuine amplitude structure within the frame. + nfilt=2*nss + + if(nframe.ne.nframe_save .or. nfft.ne.nfft_save) then + if(allocated(cref)) deallocate(cref,camp,cfilt,cw,window) + allocate(cref(nframe), camp(nfft), cfilt(nfft), cw(nfft)) + allocate(window(-nfilt/2:nfilt/2)) + pi=4.0*atan(1.0) + fac=1.0/float(nfft) + sumw=0.0 + do j=-nfilt/2,nfilt/2 + window(j)=cos(pi*j/nfilt)**2 + sumw=sumw+window(j) + enddo + cw=0. + cw(1:nfilt+1)=window/sumw + cw=cshift(cw,nfilt/2+1) + call four2a(cw,nfft,1,-1,1) + cw=cw*fac + nframe_save=nframe + nfft_save=nfft + endif + +! Generate a unit-amplitude complex reference waveform for the full frame +! (sync + info tones), at this signal's own estimated frequency. + call gen_jttywave(tone_symbols, nsym_total, nss, 2.0, FSAMPLE6, f1, & + cref, xjunk, 1, nframe) + + nstart=nint(xdt*FSAMPLE6) ! 0-based c0 index of the frame's first sample + camp=(0.,0.) + do i=1,nframe + j=nstart+i-1 + if(j.ge.0 .and. j.lt.nvalid) camp(i)=c0(j)*conjg(cref(i)) + enddo + + cfilt=camp + call four2a(cfilt,nfft,1,-1,1) ! forward FFT + cfilt=cfilt*cw ! apply the low-pass filter + call four2a(cfilt,nfft,1,1,1) ! inverse FFT -> smoothed complex gain + + do i=1,nframe + j=nstart+i-1 + if(j.ge.0 .and. j.lt.nvalid) then + z=cfilt(i)*cref(i) + c0(j)=c0(j)-z !Subtract the reconstructed signal + endif + enddo + + return +end subroutine subtract_jtty diff --git a/lib/jtty/tbcc.f90 b/lib/jtty/tbcc.f90 new file mode 100644 index 00000000..c3a89c0c --- /dev/null +++ b/lib/jtty/tbcc.f90 @@ -0,0 +1,422 @@ +module tbcc + ! Tail-biting rate-1/2 convolutional code: encode, WAVA/list decode, + ! CRC-12 append/check, and generator-polynomial selection. Used by JTTY + ! mode (lib/jtty/jtty_fec_mod.f90 and callers) and by the standalone + ! research tools under lib/jtty/wava/. + use, intrinsic :: iso_fortran_env, only: real32, int32, int16 + use jtty_tbcc_code_profiles, only: jtty_tbcc_code_profile, & + jtty_tbcc_code_profile_is_supported, & + PROFILE_PAYLOAD_BITS => JTTY_TBCC_PAYLOAD_BITS, & + PROFILE_OUTER_CHECK_BITS => JTTY_TBCC_OUTER_CHECK_BITS, & + PROFILE_INFORMATION_BITS => JTTY_TBCC_INFORMATION_BITS + !$ use omp_lib + implicit none + + ! Fixed frame parameters, shared with every caller. + integer(int32), parameter :: PAYLOAD_BITS = PROFILE_PAYLOAD_BITS + integer(int32), parameter :: CRC_BITS = PROFILE_OUTER_CHECK_BITS + integer(int32), parameter :: TOTAL_K = PROFILE_INFORMATION_BITS + integer(int32), parameter :: TBCC_OUTER_POLYNOMIAL_80F = int(Z"80F", int32) + + ! Standalone simulation tools retain runtime nu selection through tbcc_init. + ! JTTY production callers pass a complete selected profile instead. + integer(int32) :: memory_nu, num_states, g0_poly, g1_poly, reg_mask + + integer(int32), allocatable, protected :: incoming_tones(:,:) + + type candidate_t + real(real32) :: metric + integer(int32) :: bits(TOTAL_K) + end type candidate_t + + ! Per-thread RNG state (xorshift32), used only by the channel-simulation + ! helpers below (box_muller/generate_random_bits/seed_random_generator). + ! tbcc_encode/tbcc_wava_fsk_decode/encode_crc12 never touch it -- a + ! production caller that never runs the simulator helpers pays nothing + ! for this. The RANDOM_NUMBER intrinsic keeps a single shared generator + ! state and is not safe to call concurrently from multiple OpenMP + ! threads, so each thread gets its own independent stream instead. + ! Threadprivate module variables retain that property for every program + ! unit that USEs this module. + integer(int32), save :: rng_state = 0 + !$omp threadprivate(rng_state) + +contains + + subroutine tbcc_init(nu) + ! Sets memory_nu, num_states, g0_poly, g1_poly, and reg_mask for the + ! chosen constraint length K = nu+1. Call once, before any + ! encode/decode. + integer(int32), intent(in) :: nu + memory_nu = nu + num_states = 2**nu + call select_generator_polynomials(nu, g0_poly, g1_poly) + reg_mask = 2**(nu + 1) - 1 + if (allocated(incoming_tones)) deallocate(incoming_tones) + allocate(incoming_tones(0:1, 0:num_states-1)) + call build_incoming_tones(memory_nu, num_states, g0_poly, g1_poly, incoming_tones) + end subroutine tbcc_init + + subroutine tbcc_encode(payload, tone_symbols, code_profile, encoded_bits) + ! Encodes a PAYLOAD_BITS-bit payload into a TOTAL_K-symbol 4-FSK + ! tone sequence: CRC-12 append, then tail-biting rate-1/2 + ! convolutional encode with a Gray-coded 2-bit-per-symbol tone + ! mapping (00/01/11/10 -> 0/1/2/3). A caller that omits code_profile + ! must first initialize the standalone simulation code with tbcc_init(). + integer(int32), intent(in) :: payload(PAYLOAD_BITS) + integer(int32), intent(out) :: tone_symbols(TOTAL_K) + type(jtty_tbcc_code_profile), intent(in), optional :: code_profile + integer(int32), intent(out), optional :: encoded_bits(2, TOTAL_K) + integer(int32) :: info_bits(2, TOTAL_K) + integer(int32) :: state, t, bit, g0_out, out_b0, out_b1 + integer(int32) :: selected_nu, selected_state_count, selected_g0, selected_g1 + integer(int32) :: selected_register_mask, outer_polynomial, outer_check_bits + integer(int32) :: outer_top_bit_mask, outer_register_mask + + call resolve_code_definition(code_profile, selected_nu, selected_state_count, & + selected_g0, selected_g1, selected_register_mask, outer_polynomial, & + outer_check_bits, outer_top_bit_mask, outer_register_mask) + call encode_crc12(payload, info_bits, code_profile) + + ! Tail-biting initialization: preload the shift register with the + ! message's own last nu bits, so the encoder's starting + ! state equals what it would be after wrapping around the circular + ! frame. + state = 0 + do t = 0, selected_nu - 1 + bit = info_bits(1, TOTAL_K - (selected_nu - 1) + t) + state = iand(ior(ishft(state, 1), bit), selected_state_count-1) + end do + + do t = 1, TOTAL_K + bit = info_bits(1, t) + g0_out = iand(ior(ishft(state, 1), bit), selected_register_mask) + out_b0 = parity_bit(iand(g0_out, selected_g0)) + out_b1 = parity_bit(iand(g0_out, selected_g1)) + state = iand(ior(ishft(state, 1), bit), selected_state_count-1) + if (present(encoded_bits)) encoded_bits(:, t) = [out_b0, out_b1] + + if (out_b0 == 0 .and. out_b1 == 0) tone_symbols(t) = 0 + if (out_b0 == 0 .and. out_b1 == 1) tone_symbols(t) = 1 + if (out_b0 == 1 .and. out_b1 == 1) tone_symbols(t) = 2 + if (out_b0 == 1 .and. out_b1 == 0) tone_symbols(t) = 3 + end do + end subroutine tbcc_encode + + subroutine tbcc_wava_fsk_decode(tone_energies, list_size, max_wava_iters, & + final_payload, success, reserved_zero_bit, code_profile) + real(real32), intent(in) :: tone_energies(0:3, TOTAL_K) + integer(int32), intent(in) :: list_size + integer(int32), intent(in) :: max_wava_iters + integer(int32), intent(out) :: final_payload(PAYLOAD_BITS) + logical, intent(out) :: success + ! Failed decodes return an all-zero payload; success determines validity. + ! Optional 1-based position (within PAYLOAD_BITS) of a payload bit + ! that the caller guarantees is always transmitted as 0. When + ! present, a list candidate is only accepted if it also satisfies + ! this in addition to CRC==0, rather than accepting the first + ! CRC-clean candidate regardless -- roughly halves the undetected- + ! error rate, since a wrong candidate must now also hit this bit by + ! chance. Absent (the default) reproduces the original CRC-only + ! behavior exactly. + integer(int32), intent(in), optional :: reserved_zero_bit + type(jtty_tbcc_code_profile), intent(in), optional :: code_profile + + real(real32), allocatable :: prev_m(:), curr_m(:) + integer(int16), allocatable :: traceback_table(:,:) + type(candidate_t), allocatable :: sorted_list(:) + integer(int32) :: iter, t, s, bit_in, prev_s, curr_s, l, crc_reg, i + integer(int32), allocatable :: profile_tones(:,:) + integer(int32) :: selected_nu, selected_state_count, selected_g0, selected_g1 + integer(int32) :: selected_register_mask, outer_polynomial, outer_check_bits + integer(int32) :: outer_top_bit_mask, outer_register_mask + real(real32) :: m0, m1 + integer(int32) :: tmp_bits(TOTAL_K) + + final_payload = 0_int32 + success = .false. + call resolve_code_definition(code_profile, selected_nu, selected_state_count, & + selected_g0, selected_g1, selected_register_mask, outer_polynomial, & + outer_check_bits, outer_top_bit_mask, outer_register_mask) + ! Zero iterations means the WAVA loop below never runs, leaving + ! curr_m/traceback_table unread-by-design -- but the traceback and + ! list-selection code after the loop unconditionally reads them + ! regardless. Bail out before allocating rather than let that read + ! uninitialized memory (production always passes max_wava_iters=2; + ! only reachable via the CLI simulator's --iters option, which + ! accepts any caller-supplied value; found by David Christle, PR + ! #337, who confirmed it otherwise returns success=.true. with an + ! all-zero payload). + if (max_wava_iters < 1) return + allocate(prev_m(0:selected_state_count-1), curr_m(0:selected_state_count-1)) + allocate(traceback_table(0:selected_state_count-1, TOTAL_K), sorted_list(list_size)) + + allocate(profile_tones(0:1,0:selected_state_count-1)) + if (present(code_profile)) then + call build_incoming_tones(selected_nu, selected_state_count, & + selected_g0, selected_g1, profile_tones) + else + profile_tones = incoming_tones + end if + prev_m = 0.0_real32 + + do l = 1, list_size + sorted_list(l)%metric = -1.0e30_real32 + end do + + ! Forward Trellis WAVA loop + do iter = 1, max_wava_iters + do t = 1, TOTAL_K + curr_m = -1.0e30_real32 + do s = 0, selected_state_count-1 + ! For a destination state 's' at time 't' under a left-shift model, + ! the two possible predecessor states at time 't-1' are determined + ! by shifting 's' right and checking both options for the bit that + ! left the window. + prev_s = iand(ishft(s, -1), selected_state_count-1) + + m0 = prev_m(prev_s) + tone_energies(profile_tones(0, s), t) + prev_s = ior(prev_s, ishft(1, selected_nu-1)) + m1 = prev_m(prev_s) + tone_energies(profile_tones(1, s), t) + + ! Select and record maximum likelihood trajectory decision + if (m0 > m1) then + curr_m(s) = m0 + ! Picked path from state with dropped bit 0 + traceback_table(s, t) = 0_int16 + else + curr_m(s) = m1 + ! Picked path from state with dropped bit 1 + traceback_table(s, t) = 1_int16 + end if + end do + prev_m = curr_m + end do + end do + + ! REVISED TRACEBACK ALIGNMENT + do s = 0, selected_state_count-1 + curr_s = s + do t = TOTAL_K, 1, -1 + ! The input bit that caused the transition into 'curr_s' is its LSB (bit 0) + bit_in = iand(curr_s, 1) + tmp_bits(t) = bit_in + + ! Recover the parent state index using the recorded history bit flag + prev_s = iand(ishft(curr_s, -1), selected_state_count-1) + if (traceback_table(curr_s, t) == 1_int16) then + prev_s = ior(prev_s, ishft(1, selected_nu-1)) + end if + curr_s = prev_s + end do + + ! Check if circular tail-biting constraint condition holds valid + if (curr_s == s) then + do l = 1, list_size + if (curr_m(s) > sorted_list(l)%metric) then + do i = list_size, l+1, -1 + sorted_list(i) = sorted_list(i-1) + end do + sorted_list(l)%metric = curr_m(s) + sorted_list(l)%bits = tmp_bits + exit + end if + end do + end if + end do + + ! Serial CRC (and, if requested, reserved-bit) filtering pass + do l = 1, list_size + if (sorted_list(l)%metric <= -1.0e29_real32) cycle + if (present(reserved_zero_bit)) then + if (sorted_list(l)%bits(reserved_zero_bit) /= 0) cycle + end if + crc_reg = 0 + do i = 1, TOTAL_K + crc_reg = ieor(crc_reg, ishft(sorted_list(l)%bits(i), & + outer_check_bits - 1)) + if (iand(crc_reg, outer_top_bit_mask) /= 0) then + crc_reg = ieor(ishft(crc_reg, 1), outer_polynomial) + else + crc_reg = ishft(crc_reg, 1) + end if + crc_reg = iand(crc_reg, outer_register_mask) + end do + + if (crc_reg == 0) then + final_payload = sorted_list(l)%bits(1:PAYLOAD_BITS) + success = .true. + exit + end if + end do + + deallocate(prev_m, curr_m, traceback_table, sorted_list) + end subroutine tbcc_wava_fsk_decode + + subroutine encode_crc12(payload, out_buf, code_profile) + integer(int32), intent(in) :: payload(PAYLOAD_BITS) + integer(int32), intent(out) :: out_buf(2, TOTAL_K) + type(jtty_tbcc_code_profile), intent(in), optional :: code_profile + integer(int32) :: crc_reg, i + integer(int32) :: selected_nu, selected_state_count, selected_g0, selected_g1 + integer(int32) :: selected_register_mask, outer_polynomial, outer_check_bits + integer(int32) :: outer_top_bit_mask, outer_register_mask + + call resolve_code_definition(code_profile, selected_nu, selected_state_count, & + selected_g0, selected_g1, selected_register_mask, outer_polynomial, & + outer_check_bits, outer_top_bit_mask, outer_register_mask) + out_buf(1, 1:PAYLOAD_BITS) = payload + crc_reg = 0 + do i = 1, PAYLOAD_BITS + crc_reg = ieor(crc_reg, ishft(payload(i), outer_check_bits - 1)) + if (iand(crc_reg, outer_top_bit_mask) /= 0) then + crc_reg = ieor(ishft(crc_reg, 1), outer_polynomial) + else + crc_reg = ishft(crc_reg, 1) + end if + crc_reg = iand(crc_reg, outer_register_mask) + end do + do i = 1, outer_check_bits + out_buf(1, PAYLOAD_BITS + i) = & + iand(ishft(crc_reg, -(outer_check_bits - i)), 1) + end do + end subroutine encode_crc12 + + subroutine resolve_code_definition(code_profile, selected_nu, selected_state_count, & + selected_g0, selected_g1, selected_register_mask, outer_polynomial, & + outer_check_bits, outer_top_bit_mask, outer_register_mask) + type(jtty_tbcc_code_profile), intent(in), optional :: code_profile + integer(int32), intent(out) :: selected_nu, selected_state_count + integer(int32), intent(out) :: selected_g0, selected_g1, selected_register_mask + integer(int32), intent(out) :: outer_polynomial, outer_check_bits + integer(int32), intent(out) :: outer_top_bit_mask, outer_register_mask + + if (present(code_profile)) then + if (.not.jtty_tbcc_code_profile_is_supported(code_profile)) & + error stop 'unsupported JTTY TBCC code profile' + selected_nu = code_profile%memory_nu + selected_state_count = code_profile%state_count + selected_g0 = code_profile%generator_0 + selected_g1 = code_profile%generator_1 + selected_register_mask = code_profile%register_mask + outer_polynomial = code_profile%outer_polynomial + outer_check_bits = code_profile%outer_check_bits + outer_top_bit_mask = code_profile%outer_top_bit_mask + outer_register_mask = code_profile%outer_register_mask + else + selected_nu = memory_nu + selected_state_count = num_states + selected_g0 = g0_poly + selected_g1 = g1_poly + selected_register_mask = reg_mask + outer_polynomial = TBCC_OUTER_POLYNOMIAL_80F + outer_check_bits = CRC_BITS + outer_top_bit_mask = shiftl(1_int32, CRC_BITS - 1_int32) + outer_register_mask = shiftl(1_int32, CRC_BITS) - 1_int32 + end if + end subroutine resolve_code_definition + + subroutine build_incoming_tones(nu, state_count, g0, g1, tones) + integer(int32), intent(in) :: nu, state_count, g0, g1 + integer(int32), intent(out) :: tones(0:1,0:state_count-1) + integer(int32) :: state, dropped_bit, register_value, b0, b1 + integer(int32), parameter :: gray_tones(0:3) = [0, 1, 3, 2] + + do state = 0, state_count-1 + do dropped_bit = 0, 1 + register_value = ior(state, ishft(dropped_bit, nu)) + b0 = parity_bit(iand(register_value, g0)) + b1 = parity_bit(iand(register_value, g1)) + tones(dropped_bit, state) = gray_tones(2*b0+b1) + end do + end do + end subroutine build_incoming_tones + + subroutine box_muller(rand_normal) + real(real32), intent(out) :: rand_normal + real(real32) :: u1, u2 + u1 = thread_uniform(); u2 = thread_uniform() + if (u1 < 1.0e-30_real32) u1 = 1.0e-30_real32 + rand_normal = sqrt(-2.0_real32 * log(u1)) * cos(6.28318530718_real32 * u2) + end subroutine box_muller + + subroutine generate_random_bits(vec, n) + integer(int32), intent(out) :: vec(n) + integer(int32) :: n, i + do i = 1, n + vec(i) = merge(1, 0, thread_uniform() >= 0.5_real32) + end do + end subroutine generate_random_bits + + function thread_uniform() result(u) + ! Fast per-thread xorshift32 generator returning a uniform value on + ! [0,1]. rng_state is !$omp threadprivate, so this advances each + ! thread's own independent stream with no shared mutable state and + ! no locking -- the replacement for RANDOM_NUMBER, which is not + ! safe to call from a parallel region. + real(real32) :: u + rng_state = ieor(rng_state, ishft(rng_state, 13)) + rng_state = ieor(rng_state, ishft(rng_state, -17)) + rng_state = ieor(rng_state, ishft(rng_state, 5)) + u = real(iand(rng_state, huge(rng_state)), real32) / real(huge(rng_state), real32) + end function thread_uniform + + subroutine select_generator_polynomials(nu, g0, g1) + ! Optimal (maximum free distance, noncatastrophic) rate-1/2 + ! generator polynomials, indexed by memory order nu (constraint + ! length K = nu+1). K=12 (nu=11) keeps this file's original pair + ! (octal 7173,5261), unchanged, so results already gathered at + ! that setting stay reproducible. K=10, 11, 13 are the standard + ! maximum-dfree pairs from the Larsen/Odenwalder rate-1/2 tables + ! (as tabulated in e.g. Proakis "Digital Communications" and Lin & + ! Costello "Error Control Coding"): + ! K=10 (nu= 9): octal 1167,1545 dfree=12 + ! K=11 (nu=10): octal 2335,3661 dfree=14 + ! K=12 (nu=11): octal 7173,5261 (this file's existing pair) + ! K=13 (nu=12): octal 10533,17661 dfree=16 + integer(int32), intent(in) :: nu + integer(int32), intent(out) :: g0, g1 + select case (nu) + case (9) ! K = 10, dfree = 12 + g0 = int(Z"277", int32); g1 = int(Z"365", int32) + case (10) ! K = 11, dfree = 14 + g0 = int(Z"4DD", int32); g1 = int(Z"7B1", int32) + case (11) ! K = 12 -- this file's original constants + g0 = int(Z"E7B", int32); g1 = int(Z"AB1", int32) + case (12) ! K = 13, dfree = 16 + g0 = int(Z"115B", int32); g1 = int(Z"1FB1", int32) + case default + print *, "No optimal generator polynomial pair defined for memory_nu =", nu + print *, "Supported values: 9, 10, 11, 12 (K = 10, 11, 12, 13)" + stop 1 + end select + end subroutine select_generator_polynomials + + pure integer(int32) function parity_bit(val) + integer(int32), intent(in) :: val + integer(int32) :: temp, p + temp = val; p = 0 + do while (temp > 0) + if (iand(temp, 1) /= 0) p = ieor(p, 1) + temp = ishft(temp, -1) + end do + parity_bit = p + end function parity_bit + + subroutine seed_random_generator() + ! Give every OpenMP thread its own distinct, deterministic, nonzero + ! xorshift32 seed -- rng_state is threadprivate, so this assignment + ! runs once per thread. Reproducible for a fixed thread count; + ! changing OMP_NUM_THREADS changes how frames are partitioned across + ! streams, so per-frame outcomes differ (though aggregate statistics + ! over num_frames should not, within Monte Carlo noise). + ! In a non-OpenMP build, !$ lines and !$omp directives are comments, + ! so use a deterministic single-thread seed without requiring libgomp. + rng_state = 9999_int32 + !$omp parallel default(shared) + !$ rng_state = 9999_int32 + 104729_int32 * int(omp_get_thread_num(), int32) + if (rng_state == 0_int32) rng_state = 1_int32 + !$omp end parallel + end subroutine seed_random_generator + +end module tbcc diff --git a/lib/jtty/transmit.f90 b/lib/jtty/transmit.f90 new file mode 100644 index 00000000..98136ba0 --- /dev/null +++ b/lib/jtty/transmit.f90 @@ -0,0 +1,55 @@ +subroutine transmit(nfunc) + + use jttycom + parameter (MAX_TONES=85*7) !Max number of channel symbols + integer itone(MAX_TONES) !Channel symbols (tone frequencies) + character*17 cdatetime + real wave(NMAX) + complex cwave(NMAX) + + if(ntransmitting.eq.1) return !Ignore if we're already transmitting + +! if(nfunc.eq.1) txmsg='CQ '//trim(mycall)//' '//mygrid +! if(nfunc.eq.2) txmsg=trim(hiscall)//' '//trim(mycall)// & +! ' 599 '//trim(exch) +! if(nfunc.eq.3) txmsg=trim(hiscall)//' '//trim(mycall)// & +! ' R 599 '//trim(exch) +! if(nfunc.eq.4) txmsg=trim(hiscall)//' '//trim(mycall)//' RR73' +! if(nfunc.eq.5) txmsg='TNX 73 GL' + + if(nfunc.eq.1) txmsg='CQ '//trim(mycall)//' CQ' + if(nfunc.eq.2) txmsg=mycall + if(nfunc.eq.3) txmsg=trim(hiscall)//' 599 123' + if(nfunc.eq.4) txmsg='599 456' + if(nfunc.eq.5) txmsg=trim(hiscall)//' TU '//trim(mycall)//' CQ' + + call genjtty(txmsg,itone,nsym) + + nsps=384 !Samples per symbol at 12000 Hz + nwave=nsps*nsym !Length of i*2 data written to *.wav file + txt=nwave/12000.0 + + icmplx=0 + bt=2.0 + fsample=12000.0 + f0=ftx + call gen_jttywave(itone,nsym,nsps,bt,fsample,f0,cwave,wave,icmplx,nwave) + + iwave(1:nwave)=1000.0*wave(1:nwave) + iwave(nwave:)=0 + call set_tx_length(nwave) + ntxok=1 + n=len(trim(txmsg)) + + write(*,1010) trim(txmsg) +1010 format('Tx: ',a) + + write(12,1020) cdatetime(),0,0.0,nint(ftx),trim(txmsg) +1020 format(a17,i4,f6.2,i5,' Tx ',a) + if(nfunc.ge.1 .and. nfunc.le.4) ntxed=nfunc + if(nfunc.ge.1 .and. nfunc.le.5) ltx(nfunc)=.true. + if(nfunc.eq.2 .or. nfunc.eq.3) QSO_in_progress=.true. + txmsg="" + + return +end subroutine transmit diff --git a/lib/jtty/update.f90 b/lib/jtty/update.f90 new file mode 100644 index 00000000..a95b0519 --- /dev/null +++ b/lib/jtty/update.f90 @@ -0,0 +1,144 @@ +subroutine update(ic1,ic2) + + ! When the audio streams are active, this routine gets called + ! approximately every 100 ms -- determined by this statement + ! near the end of C function jttyaudio_(): + ! Pa_Sleep(100); + + ! It functions somewhat like the GUIupdate() loop in WSJT-X, calling + ! Rx or Tx routines as needed. + + use jttycom + integer*2 id(30000) + logical level +! character*50 line + character*80 umsg +! character cdatetime*17 + logical synced,eom + data iwrite00/9999999/ + data level/.false./,idone/0/ + data synced/.false./,eom/.false./ + data umsg/' '/,m/0/,nt0/-1/ + save level,iwrite00,iwrite0,synced,m,nt0,idone + + if(ndebug.gt.0 .and. ntransmitting.eq.0 .and. & + (abs(iwrite-iwrite00).ge.12000 .or. iwrite.lt.iwrite00)) then + write(*,1000) iwrite,ntxok,ntransmitting,ndebug,ic1,ic2 +1000 format('Receiving iwrite:',i8,5i5) + iwrite00=iwrite + endif + +! Some keyboard Scan Codes: ic1=0, ic2 as follows +! 13 27 59 60 61 62 63 64 65 66 67 68 +! = ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 + + if(ic1.ne.0 .or. ic2.ne.0) then + if(ic1.eq.27 .and. ic2.eq.0) ngo=0 !ESC ==> terminate program + if(nTxOK.eq.0 .and. ntransmitting.eq.0) then + nfunc=0 + if(ic1.eq.0 .and. ic2.eq.59) nfunc=1 !F1 has Scan Code = 59 + if(ic1.eq.0 .and. ic2.eq.60) nfunc=2 !F2 + if(ic1.eq.0 .and. ic2.eq.61) nfunc=3 !F3 + if(ic1.eq.0 .and. ic2.eq.62) nfunc=4 !F4 + if(ic1.eq.0 .and. ic2.eq.63) nfunc=5 !F5 + if(ic1.eq.0 .and. ic2.eq.64) hiscall=txmsg(1:6) !F6 + if(nfunc.eq.1 .or. (nfunc.ge.2 .and. hiscall.ne.' ')) then + call transmit(nfunc) + endif + endif + if(ic1.eq.13 .and. ic2.eq.0) hiscall=hiscall_next !Enter key + if((ic1.eq.97 .or. ic1.eq.65) .and. ic2.eq.0) autoseq=.not.autoseq !a or A + if(ic1.eq.76 .and. ic2.eq.0) level=.not.level !l or L + + if(ic2.eq.0) then + if(ic1.eq.13) then + call putchar(13) ! CR + call putchar(12) ! LF + call transmit(0) + m=0 + elseif(ic1.eq.8) then + txmsg(m:m)=' ' + if(m.ge.1) m=m-1 + call putchar(ic1) + call putchar(32) + call putchar(ic1) + else + m=m+1 + if(ic1.ge.97 .and. ic1.le.122) ic1=ic1-32 + txmsg(m:m)=char(ic1) + call putchar(ic1) + endif + endif + endif + + nready=iwrite-idone + if(nready.lt.0) nready=nready+NMAX + if(nready.lt.59*384) go to 100 + + ! Call the jtty decoder here, using code from rjtty. + ! ### Maybe call rjtty_sub(y1,iwrite,line1) ??? ### + + iz=30240 !### TEMPORARY ### + k=iwrite-12000 + if(k.lt.1) k=k+NMAX + do i=1,12000 + k=k+1 + if(k.gt.NMAX) k=k-NMAX + id(i)=y1(k) + enddo + nutc=0 + nfqso=1500 + nrx=-1 + k0=0 + k1=0 + eom=.false. + f0=1500.0 + ftol=100.0 + smin=0 + xdt=0. + f1=0. +!### WORK NEEDED HERE ### + call jtty_decode(id,iz,f0,ftol,smin,synced,xdt,f1,snr,umsg) +! fname=cdatetime() +! fname(14:17)='.wav' +! open(13,file=fname,status='unknown',access='stream') +! h=default_header(12000,nwave) +! write(13) h,id +! close(13) + if(autoseq .and.nrx.eq.2) QSO_in_progress=.true. + if(autoseq .and. QSO_in_progress .and. nrx.ge.1 .and. nrx.le.4) then + lrx(nrx)=.true. + if(ntxed.eq.1) then + if(nrx.eq.2) then + call transmit(3) + else + call transmit(1) + endif + endif + if(ntxed.eq.2) then + if(nrx.eq.3) then + call transmit(4) + QSO_in_progress=.false. + write(*,1032) +1032 format('QSO complete: S+P side') + else + call transmit(2) + endif + endif + if(ntxed.eq.3) then + if(nrx.eq.4) then + QSO_in_progress=.false. + write(*,1034) +1034 format('QSO complete: CQ side') + else + call transmit(3) + endif + endif + endif + nt0=nt + idone=iwrite + +100 iwrite0=iwrite + + return +end subroutine update diff --git a/lib/jtty/wava/plot_results.py b/lib/jtty/wava/plot_results.py new file mode 100644 index 00000000..0ef97628 --- /dev/null +++ b/lib/jtty/wava/plot_results.py @@ -0,0 +1,57 @@ + +import pandas as pd +import matplotlib.pyplot as plt + +# Read data logged from the Fortran testbench suite +try: + df = pd.read_csv('simulation_results.csv') +except FileNotFoundError: + print("Error: 'simulation_results.csv' not found. Execute the Fortran simulation program first.") + exit() + +# Strip whitespace from columns to avoid parsing mismatches +df['channel'] = df['channel'].str.strip() + +# Initialize Figure with high resolution DPI properties +fig, ax1 = plt.subplots(figsize=(10, 6), dpi=120) + +# Set up Primary Axis: Frame Correct-Decode Probability P(Correct) +ax1.set_xlabel('SNR in 2500 Hz Reference Bandwidth [dB]', fontsize=11, fontweight='bold') +ax1.set_ylabel('P(Correct Decode)', color='navy', fontsize=11, fontweight='bold') +ax1.set_xlim(0, -20) # Invert axis view to scan standard drop off descending to -20 dB +ax1.set_ylim(-0.05, 1.05) +ax1.grid(True, which='both', linestyle='--', alpha=0.5) + +# Set up Secondary Axis on the right side for 100 * UER (%) +ax2 = ax1.twinx() +ax2.set_ylabel('Undetected Error Rate: 100 * UER [%]', color='crimson', fontsize=11, fontweight='bold') +ax2.set_ylim(-0.1, 5.0) # Standard percentage visualization window + +# Isolate channel tracking configurations +awgn_data = df[df['channel'] == 'AWGN'].sort_values(by='snr_db', ascending=False) +rayleigh_data = df[df['channel'] == 'RAYLEIGH'].sort_values(by='snr_db', ascending=False) + +# Plot Primary Curves - P(Correct) +line1 = ax1.plot(awgn_data['snr_db'], awgn_data['p_correct'], + 'o-', color='navy', linewidth=2.0, label='AWGN: P(Correct)') +line2 = ax1.plot(rayleigh_data['snr_db'], rayleigh_data['p_correct'], + 's-', color='royalblue', linewidth=1.8, label='Rayleigh: P(Correct)') + +# Plot Secondary Curves - 100 * UER (%) +line3 = ax2.plot(awgn_data['snr_db'], awgn_data['uer_pct'], + '^--', color='crimson', linewidth=1.5, label='AWGN: 100*UER') +line4 = ax2.plot(rayleigh_data['snr_db'], rayleigh_data['uer_pct'], + 'v--', color='orange', linewidth=1.5, label='Rayleigh: 100*UER') + +# Align Legend structures coherently across shared dual axis space +lines = line1 + line2 + line3 + line4 +labels = [l.get_label() for l in lines] +ax1.legend(lines, labels, loc='center left', frameon=True, shadow=True) + +plt.title('TBCC (92,46) Noncoherent 4-FSK Performance Profile\nConstraint Length K=11, List Size L=8, Rate=1/2', + fontsize=12, fontweight='bold', pad=15) + +plt.tight_layout() +plt.savefig('tbcc_performance_curves.png', dpi=300) +print("Plot successfully rendered and saved as 'tbcc_performance_curves.png'") +plt.show() diff --git a/lib/jtty/wava/rcu_bound_4fsk.f90 b/lib/jtty/wava/rcu_bound_4fsk.f90 new file mode 100644 index 00000000..ae58793f --- /dev/null +++ b/lib/jtty/wava/rcu_bound_4fsk.f90 @@ -0,0 +1,217 @@ +program rcu_bound_4fsk + ! Random Coding Union (RCU) achievability bound (Polyanskiy-Poor-Verdu + ! 2010, eq. 2) for noncoherent 4-FSK over AWGN and Rayleigh-fading + ! channels, matched to the exact channel model and SNR convention used + ! in tbcc_4fsk_simulation.f90. This bounds the frame-error probability + ! of the BEST POSSIBLE code at (n=46 symbols, M=2^k messages) -- a + ! benchmark for how close an actual code+decoder gets to optimal, not a + ! statement about any particular code. + ! + ! Method: for a fixed received sequence r^n, each per-symbol term of the + ! competitor information density i(X_bar_t; r_t) is an exact discrete + ! 4-valued random variable (X_bar_t uniform over the 4 tones), so its + ! mean/variance are closed-form -- no inner Monte Carlo. Summing 46 such + ! terms and invoking the CLT gives the inner tail probability via erfc. + ! Only the outer expectation (over the true (x^n, r^n) pair) needs Monte + ! Carlo. + use, intrinsic :: iso_fortran_env, only: real32, real64, int32 + use omp_lib + implicit none + + integer(int32), save :: rng_state = 0 + !$omp threadprivate(rng_state) + + integer(int32), parameter :: N_SYM = 46 ! channel uses; matches TOTAL_K + + character(len=8) :: channel_type + character(len=16) :: arg + integer(int32) :: nargs, num_trials, kbits, e, s + real(real64) :: Mminus1, rcu + real(real32) :: snr_2500_db, esno_linear + real(real64) :: t_wall_start, t_wall_end + + nargs = iargc() + if (nargs /= 2) then + print *, 'Usage: rcu_bound_4fsk ' + print *, ' k_bits: log2(number of equiprobable messages), e.g. 34' + stop + end if + call getarg(1, arg); read(arg,*) num_trials + call getarg(2, arg); read(arg,*) kbits + Mminus1 = 2.0_real64**kbits - 1.0_real64 + + call seed_random_generator() + + print *, "==========================================================================" + print *, "RCU achievability bound: noncoherent 4-FSK, n =", N_SYM, " symbols" + print *, "M = 2^", kbits, "equiprobable messages | OpenMP threads:", omp_get_max_threads() + print *, "==========================================================================" + + open(unit=25, file="rcu_bound_results.csv", status="unknown", action="write") + write(25,'(A)') "channel,snr_db,rcu_bound" + + t_wall_start = omp_get_wtime() + + do e = 1, 2 + channel_type = merge("AWGN ", "RAYLEIGH", e == 1) + print *, "" + print *, "--- Channel: ", trim(channel_type), " ---" + write(*,'(A10,A16)') "SNR_2500", "RCU bound" + do s = -5, -20, -1 + snr_2500_db = real(s, real32) + esno_linear = (10.0_real32**(snr_2500_db/10.0_real32)) * 80.0_real32 + call compute_rcu(channel_type, esno_linear, Mminus1, num_trials, rcu) + write(*,'(F10.1,ES16.5)') snr_2500_db, rcu + write(25,'(A,A,F6.1,A,ES14.6)') trim(channel_type), ",", snr_2500_db, ",", rcu + end do + end do + + close(25) + t_wall_end = omp_get_wtime() + print '(A,F8.2,A)', "Total wall-clock time: ", t_wall_end - t_wall_start, " s" + +contains + + subroutine compute_rcu(channel_type, esno, Mm1, ntrials, rcu_out) + character(len=*), intent(in) :: channel_type + real(real32), intent(in) :: esno + real(real64), intent(in) :: Mm1 + integer(int32), intent(in) :: ntrials + real(real64), intent(out) :: rcu_out + + integer(int32) :: trial, t, x_true, j + real(real32) :: r(0:3), n_i, n_q, hfade + real(real64) :: logL(0:3), S, i_true, mu_t, var_t, term + real(real64) :: T_sum, MU_sum, VAR_sum, tail, bound_val, acc + + acc = 0.0_real64 + + !$omp parallel do default(shared) & + !$omp private(trial, t, x_true, j, r, n_i, n_q, hfade, logL, S, & + !$omp i_true, mu_t, var_t, term, T_sum, MU_sum, VAR_sum, & + !$omp tail, bound_val) & + !$omp reduction(+:acc) schedule(static) + do trial = 1, ntrials + T_sum = 0.0_real64 + MU_sum = 0.0_real64 + VAR_sum = 0.0_real64 + + do t = 1, N_SYM + x_true = int(thread_uniform()*4.0_real32) + if (x_true > 3) x_true = 3 + + if (channel_type == "AWGN") then + hfade = 1.0_real32 + else + call box_muller(n_i); call box_muller(n_q) + hfade = sqrt(0.5_real32*(n_i**2 + n_q**2)) + end if + + do j = 0, 3 + call box_muller(n_i); call box_muller(n_q) + n_i = n_i*sqrt(0.5_real32); n_q = n_q*sqrt(0.5_real32) + if (j == x_true) then + r(j) = (hfade*sqrt(esno) + n_i)**2 + n_q**2 + else + r(j) = n_i**2 + n_q**2 + end if + end do + + ! log-likelihood-ratio log L(r) = log f_sig(r) - log f_noise(r) + do j = 0, 3 + if (channel_type == "AWGN") then + logL(j) = -real(esno,real64) & + + log_bessel_i0(2.0_real64*sqrt(real(esno,real64)*real(r(j),real64))) + else + logL(j) = -log(1.0_real64+real(esno,real64)) & + + real(r(j),real64)*real(esno,real64)/(1.0_real64+real(esno,real64)) + end if + end do + + S = logsumexp4(logL) ! log( sum_j L(r_j) ) + i_true = log(4.0_real64) + logL(x_true) - S + + mu_t = 0.0_real64 + do j = 0, 3 + mu_t = mu_t + (log(4.0_real64) + logL(j) - S) + end do + mu_t = mu_t/4.0_real64 + + var_t = 0.0_real64 + do j = 0, 3 + term = (log(4.0_real64) + logL(j) - S) - mu_t + var_t = var_t + term*term + end do + var_t = var_t/4.0_real64 + + T_sum = T_sum + i_true + MU_sum = MU_sum + mu_t + VAR_sum = VAR_sum + var_t + end do + + ! CLT approximation to Pr[ sum_t i(X_bar_t;r_t) >= T_sum ] + tail = 0.5_real64*erfc( (T_sum-MU_sum) / sqrt(2.0_real64*VAR_sum) ) + bound_val = min(1.0_real64, Mm1*tail) + acc = acc + bound_val + end do + !$omp end parallel do + + rcu_out = acc/real(ntrials, real64) + end subroutine compute_rcu + + pure function logsumexp4(v) result(s) + real(real64), intent(in) :: v(0:3) + real(real64) :: s, m + m = maxval(v) + s = m + log(sum(exp(v-m))) + end function logsumexp4 + + ! log(I0(x)), x>=0, via the standard Abramowitz & Stegun 9.8.1/9.8.2 + ! rational approximations (~1.6e-7 relative accuracy), evaluated in log + ! space for large x to avoid overflowing exp(x). + pure function log_bessel_i0(x) result(logi0) + real(real64), intent(in) :: x + real(real64) :: logi0, ax, y, bessi0 + + ax = abs(x) + if (ax < 3.75_real64) then + y = (x/3.75_real64)**2 + bessi0 = 1.0_real64 + y*(3.5156229_real64 + y*(3.0899424_real64 + & + y*(1.2067492_real64 + y*(0.2659732_real64 + & + y*(0.0360768_real64 + y*0.0045813_real64))))) + logi0 = log(bessi0) + else + y = 3.75_real64/ax + logi0 = ax - 0.5_real64*log(ax) + & + log(0.39894228_real64 + y*(0.01328592_real64 + & + y*(0.00225319_real64 + y*(-0.00157565_real64 + & + y*(0.00916281_real64 + y*(-0.02057706_real64 + & + y*(0.02635537_real64 + y*(-0.01647633_real64 + & + y*0.00392377_real64)))))))) + end if + end function log_bessel_i0 + + subroutine box_muller(rand_normal) + real(real32), intent(out) :: rand_normal + real(real32) :: u1, u2 + u1 = thread_uniform(); u2 = thread_uniform() + if (u1 < 1.0e-30_real32) u1 = 1.0e-30_real32 + rand_normal = sqrt(-2.0_real32*log(u1)) * cos(6.28318530718_real32*u2) + end subroutine box_muller + + function thread_uniform() result(u) + real(real32) :: u + rng_state = ieor(rng_state, ishft(rng_state, 13)) + rng_state = ieor(rng_state, ishft(rng_state, -17)) + rng_state = ieor(rng_state, ishft(rng_state, 5)) + u = real(iand(rng_state, huge(rng_state)), real32) / real(huge(rng_state), real32) + end function thread_uniform + + subroutine seed_random_generator() + !$omp parallel default(shared) + rng_state = 9999_int32 + 104729_int32*int(omp_get_thread_num(), int32) + if (rng_state == 0_int32) rng_state = 1_int32 + !$omp end parallel + end subroutine seed_random_generator + +end program rcu_bound_4fsk diff --git a/lib/jtty/wava/tbcc_4fsk_simulation.f90 b/lib/jtty/wava/tbcc_4fsk_simulation.f90 new file mode 100644 index 00000000..d6512f27 --- /dev/null +++ b/lib/jtty/wava/tbcc_4fsk_simulation.f90 @@ -0,0 +1,167 @@ +program tbcc_4fsk_simulation + + use, intrinsic :: iso_fortran_env, only: real32, int32, real64 + use omp_lib + use tbcc + implicit none + + real(real64) :: t_wall_start, t_wall_end + + character(len=8) :: channel_type + character(len=8) :: arg + real(real32) :: snr_2500_db, esno_linear + + + integer(int32) :: tx_payload(PAYLOAD_BITS), tx_symbols(TOTAL_K) + real(real32) :: rx_tone_energies(0:3, TOTAL_K) + integer(int32) :: rx_decoded(PAYLOAD_BITS) + + integer(int32) :: correct_frames, undetected_errors, total_detected_errors, total_frames + integer(int32) :: num_frames, L_size, wava_iters, isnr1, isnr2 + real(real32) :: p_correct, uer + integer(int32) :: f, e, t, s, i, nargs + real(real32) :: n_i, n_q, h_fade, ch_i, ch_q, xsnr + logical :: decode_success, payload_match + + nargs=iargc() + if(nargs.ne.5) then + print*,'Usage: tbcc_sim nu L iters Nmax SNR' + print*,'Example: tbcc_sim 9 4 2 10000 0' + stop + endif + + call getarg(1,arg) + read(arg,*) memory_nu + call getarg(2,arg) + read(arg,*) L_size ! List size + call getarg(3,arg) + read(arg,*) wava_iters ! Trellis wraps for tail-biting convergence + call getarg(4,arg) + read(arg,*) num_frames + call getarg(5,arg) + read(arg,*) xsnr + + call seed_random_generator() + + print *, "==========================================================================" + print *, "Tail-Biting Convolutional Code (92,46) Noncoherent 4-FSK Simulation Suite" + print *, "Symbol Rate = 31.25 Baud | Reference Bandwidth = 2500 Hz" + print *, "OpenMP threads available: ", omp_get_max_threads() + print *, "Writing data logs directly to simulation_results.csv..." + print *, "==========================================================================" + + ! Open CSV data output buffer file + open(unit=24, file="simulation_results.dat", status="unknown", action="write") + open(unit=25, file="simulation_results.csv", status="unknown", action="write") + write(24, '(A)') "snr,frames,good,uer" + write(25, '(A)') "channel,snr_db,p_correct,uer_pct" + + t_wall_start = omp_get_wtime() + call tbcc_init(memory_nu) + total_frames = 0 + + do e = 1, 2 + channel_type = merge("AWGN ", "RAYLEIGH", e == 1) + print *, "" + print *, "--- Channel Profile: ", trim(channel_type), " ---" + write(24,'(a,a,a)') "--- Channel Profile: ", trim(channel_type), " ---" + + write(*,1000) + write(24,1000) +1000 format(' SNR_2500 Frames Good UER '/39('-')) + + isnr1 = -5 + isnr2 = -20 + do s = isnr1, isnr2, -1 + snr_2500_db = s + if(xsnr.ne.0.0) snr_2500_db = xsnr + esno_linear = (10.0_real32 ** (snr_2500_db / 10.0_real32)) * 80.0_real32 + correct_frames = 0 + undetected_errors = 0 + total_detected_errors = 0 + + ! Each frame (generate -> encode -> channel -> WAVA decode) is + ! completely independent of every other frame, so the frame loop + ! is embarrassingly parallel. Every array/scalar that a single + ! frame writes must be private -- otherwise threads clobber each + ! other's tx_payload/tx_encoded/etc. The three tallies are + ! combined across threads via REDUCTION. + + !$omp parallel do default(shared) & + !$omp private(f, t, i, n_i, n_q, h_fade, ch_i, ch_q, decode_success, payload_match, & + !$omp tx_payload, tx_symbols, rx_tone_energies, rx_decoded) & + !$omp reduction(+:correct_frames, undetected_errors, total_detected_errors) & + !$omp schedule(static) + do f = 1, num_frames + call generate_random_bits(tx_payload, PAYLOAD_BITS) + call tbcc_encode(tx_payload, tx_symbols) + + ! Channel Simulation + do t = 1, TOTAL_K + if (channel_type == "AWGN") then + h_fade = 1.0_real32 + else + call box_muller(n_i) + call box_muller(n_q) + h_fade = sqrt(0.5_real32 * (n_i**2 + n_q**2)) + end if + + do i = 0, 3 + call box_muller(n_i) + call box_muller(n_q) + n_i = n_i * sqrt(0.5_real32) + n_q = n_q * sqrt(0.5_real32) + + if (i == tx_symbols(t)) then + ch_i = (h_fade * sqrt(esno_linear)) + n_i + ch_q = n_q + else + ch_i = n_i + ch_q = n_q + end if + rx_tone_energies(i, t) = ch_i**2 + ch_q**2 + end do + end do + + ! Decoding Execution + call tbcc_wava_fsk_decode(rx_tone_energies, L_size, wava_iters, & + rx_decoded, decode_success) + + if (decode_success) then + payload_match = all(tx_payload == rx_decoded) + if (payload_match) then + correct_frames = correct_frames + 1 + else + undetected_errors = undetected_errors + 1 + end if + else + total_detected_errors = total_detected_errors + 1 + end if + end do + !$omp end parallel do + + p_correct = real(correct_frames, real32) / real(num_frames, real32) + uer = real(undetected_errors, real32) / real(num_frames, real32) + total_frames = total_frames + num_frames + + write(*,1001) snr_2500_db, num_frames, p_correct, uer + write(24,1001) snr_2500_db, num_frames, p_correct, uer +1001 format(f8.1,i10,2f10.6) + + ! Write tracking vectors to the spreadsheet data table (Multiplying UER by + ! 100 for percentage scale) + write(25, '(A,A,F6.1,A,F7.5,A,F7.5)') trim(channel_type), ",", snr_2500_db, & + ",", p_correct, ",", uer * 100.0_real32 + if(xsnr.ne.0.0) exit + end do !Loop over SNRs + end do !Loop over channel types (AWGN, then Rayleigh) + + close(24) + close(25) + + t_wall_end = omp_get_wtime() + print '(A,F8.2,A)', "Total wall-clock time: ", t_wall_end - t_wall_start, " s" + print '(a,f7.3,a)' ,"Average time per frame: ", & + 1000.0*(t_wall_end - t_wall_start)/total_frames, " ms" + +end program tbcc_4fsk_simulation diff --git a/lib/jtty/wava/tbcc_performance_curves.png b/lib/jtty/wava/tbcc_performance_curves.png new file mode 100644 index 00000000..88d63b07 Binary files /dev/null and b/lib/jtty/wava/tbcc_performance_curves.png differ diff --git a/lib/lookup3.c b/lib/lookup3.c new file mode 100644 index 00000000..d9951e81 --- /dev/null +++ b/lib/lookup3.c @@ -0,0 +1,305 @@ +/* + File name: lookup3.c + + *------------------------------------------------------------------------------ + * + * This file is part of the WSPR application, Weak Signal Propogation Reporter + * + * File Name: lookup3.c + * Description: Produce 32-bit hashes for hash table lookup + * + * Copyright (C) 2008-2014 Joseph Taylor, K1JT + * License: GNU GPL v3+ + * + * 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; either 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 for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin + * Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Files: lookup3.c + * Copyright: Copyright (C) 2006 Bob Jenkins + * License: public-domain + * You may use this code any way you wish, private, educational, or commercial. + * It's free. + * + *------------------------------------------------------------------------------- +*/ + +#include "lookup3.h" + +#define HASH_LITTLE_ENDIAN 1 + +#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) + +/* +------------------------------------------------------------------------------- +mix -- mix 3 32-bit values reversibly. + +This is reversible, so any information in (a,b,c) before mix() is +still in (a,b,c) after mix(). + +If four pairs of (a,b,c) inputs are run through mix(), or through +mix() in reverse, there are at least 32 bits of the output that +are sometimes the same for one pair and different for another pair. +This was tested for: +* pairs that differed by one bit, by two bits, in any combination + of top bits of (a,b,c), or in any combination of bottom bits of + (a,b,c). +* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed + the output delta to a Gray code (a^(a>>1)) so a string of 1's (as + is commonly produced by subtraction) look like a single 1-bit + difference. +* the base values were pseudorandom, all zero but one bit set, or + all zero plus a counter that starts at zero. + +Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that +satisfy this are + 4 6 8 16 19 4 + 9 15 3 18 27 15 + 14 9 3 7 17 3 +Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing +for "differ" defined as + with a one-bit base and a two-bit delta. I +used http://burtleburtle.net/bob/hash/avalanche.html to choose +the operations, constants, and arrangements of the variables. + +This does not achieve avalanche. There are input bits of (a,b,c) +that fail to affect some output bits of (a,b,c), especially of a. The +most thoroughly mixed value is c, but it doesn't really even achieve +avalanche in c. + +This allows some parallelism. Read-after-writes are good at doubling +the number of bits affected, so the goal of mixing pulls in the opposite +direction as the goal of parallelism. I did what I could. Rotates +seem to cost as much as shifts on every machine I could lay my hands +on, and rotates are much kinder to the top and bottom bits, so I used +rotates. +------------------------------------------------------------------------------- +*/ +#define mix(a,b,c) \ +{ \ + a -= c; a ^= rot(c, 4); c += b; \ + b -= a; b ^= rot(a, 6); a += c; \ + c -= b; c ^= rot(b, 8); b += a; \ + a -= c; a ^= rot(c,16); c += b; \ + b -= a; b ^= rot(a,19); a += c; \ + c -= b; c ^= rot(b, 4); b += a; \ +} + +/* +------------------------------------------------------------------------------- +final -- final mixing of 3 32-bit values (a,b,c) into c + +Pairs of (a,b,c) values differing in only a few bits will usually +produce values of c that look totally different. This was tested for +* pairs that differed by one bit, by two bits, in any combination + of top bits of (a,b,c), or in any combination of bottom bits of + (a,b,c). +* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed + the output delta to a Gray code (a^(a>>1)) so a string of 1's (as + is commonly produced by subtraction) look like a single 1-bit + difference. +* the base values were pseudorandom, all zero but one bit set, or + all zero plus a counter that starts at zero. + +These constants passed: + 14 11 25 16 4 14 24 + 12 14 25 16 4 14 24 +and these came close: + 4 8 15 26 3 22 24 + 10 8 15 26 3 22 24 + 11 8 15 26 3 22 24 +------------------------------------------------------------------------------- +*/ +#define final(a,b,c) \ +{ \ + c ^= b; c -= rot(b,14); \ + a ^= c; a -= rot(c,11); \ + b ^= a; b -= rot(a,25); \ + c ^= b; c -= rot(b,16); \ + a ^= c; a -= rot(c,4); \ + b ^= a; b -= rot(a,14); \ + c ^= b; c -= rot(b,24); \ +} + +/* +------------------------------------------------------------------------------- +hashlittle() -- hash a variable-length key into a 32-bit value + k : the key (the unaligned variable-length array of bytes) + length : the length of the key, counting by bytes + initval : can be any 4-byte value +Returns a 32-bit value. Every bit of the key affects every bit of +the return value. Two keys differing by one or two bits will have +totally different hash values. + +The best hash table sizes are powers of 2. There is no need to do +mod a prime (mod is sooo slow!). If you need less than 32 bits, +use a bitmask. For example, if you need only 10 bits, do + h = (h & hashmask(10)); +In which case, the hash table should have hashsize(10) elements. + +If you are hashing n strings (uint8_t **)k, do it like this: + for (i=0, h=0; i 12) + { + a += k[0]; + b += k[1]; + c += k[2]; + mix(a,b,c); + length -= 12; + k += 3; + } + + /*----------------------------- handle the last (probably partial) block */ + const uint8_t *k8 = (const uint8_t *)k; + switch(length) + { + case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; + case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ + case 10: c+=((uint32_t)k8[9])<<8; /* fall through */ + case 9 : c+=k8[8]; /* fall through */ + case 8 : b+=k[1]; a+=k[0]; break; + case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ + case 6 : b+=((uint32_t)k8[5])<<8; /* fall through */ + case 5 : b+=k8[4]; /* fall through */ + case 4 : a+=k[0]; break; + case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ + case 2 : a+=((uint32_t)k8[1])<<8; /* fall through */ + case 1 : a+=k8[0]; break; + case 0 : return c; + } + + } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { + const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */ + const uint8_t *k8; + + /*--------------- all but last block: aligned reads and different mixing */ + while (length > 12) + { + a += k[0] + (((uint32_t)k[1])<<16); + b += k[2] + (((uint32_t)k[3])<<16); + c += k[4] + (((uint32_t)k[5])<<16); + mix(a,b,c); + length -= 12; + k += 6; + } + + /*----------------------------- handle the last (probably partial) block */ + k8 = (const uint8_t *)k; + switch(length) + { + case 12: c+=k[4]+(((uint32_t)k[5])<<16); + b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ + case 10: c+=k[4]; + b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 9 : c+=k8[8]; /* fall through */ + case 8 : b+=k[2]+(((uint32_t)k[3])<<16); + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ + case 6 : b+=k[2]; + a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 5 : b+=k8[4]; /* fall through */ + case 4 : a+=k[0]+(((uint32_t)k[1])<<16); + break; + case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ + case 2 : a+=k[0]; + break; + case 1 : a+=k8[0]; + break; + case 0 : return c; /* zero length requires no mixing */ + } + + } else { /* need to read the key one byte at a time */ + const uint8_t *k = (const uint8_t *)key; + + /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ + while (length > 12) + { + a += k[0]; + a += ((uint32_t)k[1])<<8; + a += ((uint32_t)k[2])<<16; + a += ((uint32_t)k[3])<<24; + b += k[4]; + b += ((uint32_t)k[5])<<8; + b += ((uint32_t)k[6])<<16; + b += ((uint32_t)k[7])<<24; + c += k[8]; + c += ((uint32_t)k[9])<<8; + c += ((uint32_t)k[10])<<16; + c += ((uint32_t)k[11])<<24; + mix(a,b,c); + length -= 12; + k += 12; + } + + /*-------------------------------- last block: affect all 32 bits of (c) */ + switch(length) /* all the case statements fall through */ + { + case 12: c+=((uint32_t)k[11])<<24; + /* fall through */ + case 11: c+=((uint32_t)k[10])<<16; + /* fall through */ + case 10: c+=((uint32_t)k[9])<<8; + /* fall through */ + case 9 : c+=k[8]; + /* fall through */ + case 8 : b+=((uint32_t)k[7])<<24; + /* fall through */ + case 7 : b+=((uint32_t)k[6])<<16; + /* fall through */ + case 6 : b+=((uint32_t)k[5])<<8; + /* fall through */ + case 5 : b+=k[4]; + /* fall through */ + case 4 : a+=((uint32_t)k[3])<<24; + /* fall through */ + case 3 : a+=((uint32_t)k[2])<<16; + /* fall through */ + case 2 : a+=((uint32_t)k[1])<<8; + /* fall through */ + case 1 : a+=k[0]; + break; + case 0 : return c; + } + } + + final(a,b,c); + return c; +} diff --git a/lib/lookup3.h b/lib/lookup3.h new file mode 100644 index 00000000..ad45d2d0 --- /dev/null +++ b/lib/lookup3.h @@ -0,0 +1,18 @@ +#ifndef WSJT_LOOKUP3_H_ +#define WSJT_LOOKUP3_H_ + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Return the full 32-bit Jenkins lookup3 hash for a byte sequence. */ +uint32_t wsjt_hashlittle(const void *key, size_t length, uint32_t initval); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/lib/map65_mmdec.f90 b/lib/map65_mmdec.f90 index 3d7512a9..797e6ab5 100644 --- a/lib/map65_mmdec.f90 +++ b/lib/map65_mmdec.f90 @@ -1,5 +1,11 @@ module map65_mmdec_mod + use q65_decode implicit none + + type, extends(q65_decoder) :: counting_q65_decoder + integer :: decoded + end type counting_q65_decoder + contains subroutine map65_mmdec(nutc,id2,nqd,ntrperiod, nsubmode,nfa,nfb,nfqso, & @@ -12,10 +18,6 @@ subroutine map65_mmdec(nutc,id2,nqd,ntrperiod, nsubmode,nfa,nfb,nfqso, & include 'jt9com.f90' - type, extends(q65_decoder) :: counting_q65_decoder - integer :: decoded - end type counting_q65_decoder - logical single_decode,bVHF,lnewdat,lagain,lclearave,lapcqonly integer(int16) id2(300*12000) integer nqf(20) @@ -52,48 +54,49 @@ subroutine map65_mmdec(nutc,id2,nqd,ntrperiod, nsubmode,nfa,nfb,nfqso, & call timer('dec_q65 ',0) call my_q65%decode(q65_decoded,id2,nqd,nutc,ntrperiod,nsubmode,nfqso, & ntol,ndepth,nfa,nfb,lclearave,single_decode,lagain,max_drift,lnewdat, & - emedelay,mycall,hiscall,hisgrid,nQSOProgress,ncontest,lapcqonly,navg0,nqf) + emedelay,mycall,hiscall,hisgrid,nQSOProgress,ncontest,.false., & + lapcqonly,navg0,nqf) call timer('dec_q65 ',1) return -contains - - subroutine q65_decoded (this,nutc,snr1,nsnr,dt,freq,decoded,idec, & - nused,ntrperiod) - - use q65_decode - implicit none - - class(q65_decoder), intent(inout) :: this - integer, intent(in) :: nutc - real, intent(in) :: snr1 - integer, intent(in) :: nsnr - real, intent(in) :: dt - real, intent(in) :: freq - character(len=37), intent(in) :: decoded - integer, intent(in) :: idec - integer, intent(in) :: nused - integer, intent(in) :: ntrperiod - - if(nutc+snr1+nsnr+dt+freq+idec+nused+ntrperiod.eq.-999) stop - if(decoded.eq.'-999') stop - - cq0='q ' - write(cq0(2:2),'(i1)') idec - if(nused.ge.2) write(cq0(3:3),'(i1)') nused - nsnr0=nsnr - xdt0=dt - nfreq0=nint(freq) - msg0=decoded - - select type(this) - type is (counting_q65_decoder) - if(idec.ge.0) this%decoded = this%decoded + 1 - end select - - return - end subroutine q65_decoded end subroutine map65_mmdec -end module map65_mmdec_mod \ No newline at end of file + +subroutine q65_decoded (this,nutc,snr1,nsnr,dt,freq,decoded,idec, & + nused,ntrperiod,iflagdec) + + implicit none + + class(q65_decoder), intent(inout) :: this + integer, intent(in) :: nutc + real, intent(in) :: snr1 + integer, intent(in) :: nsnr + real, intent(in) :: dt + real, intent(in) :: freq + character(len=37), intent(in) :: decoded + integer, intent(in) :: idec + integer, intent(in) :: nused + integer, intent(in) :: ntrperiod + integer, intent(in) :: iflagdec !Not used by MAP65's q65b path; see WSJT-X's q65_decoded + + if(nutc+snr1+nsnr+dt+freq+idec+nused+ntrperiod+iflagdec.eq.-999) stop + if(decoded.eq.'-999') stop + + cq0='q ' + write(cq0(2:2),'(i1)') idec + if(nused.ge.2) write(cq0(3:3),'(i1)') nused + nsnr0=nsnr + xdt0=dt + nfreq0=nint(freq) + msg0=decoded + + select type(this) + type is (counting_q65_decoder) + if(idec.ge.0) this%decoded = this%decoded + 1 + end select + + return +end subroutine q65_decoded + +end module map65_mmdec_mod diff --git a/lib/moondopjpl.f90 b/lib/moondopjpl.f90 index 20fbb5e8..f05de384 100644 --- a/lib/moondopjpl.f90 +++ b/lib/moondopjpl.f90 @@ -1,6 +1,9 @@ subroutine MoonDopJPL(nyear,month,nday,uth4,lon4,lat4,RAMoon4, & - DecMoon4,LST4,HA4,AzMoon4,ElMoon4,vr4,dist4) + DecMoon4,LST4,HA4,AzMoon4,ElMoon4,vr4,dist4,ephemeris_result) + use ieee_arithmetic, only: ieee_is_finite + use jpl_ephemeris_status, only: EPHEMERIS_INVALID_INPUT, & + EPHEMERIS_UNAVAILABLE implicit real*8 (a-h,o-z) real*4 uth4 !UT in hours real*4 lon4 !East longitude, degrees @@ -13,12 +16,28 @@ subroutine MoonDopJPL(nyear,month,nday,uth4,lon4,lat4,RAMoon4, & real*4 ElMoon4 !Topocentric Elevation of moon, degrees real*4 vr4 !Radial velocity of moon wrt obs, km/s real*4 dist4 !Echo time, seconds + integer ephemeris_result + + RAMoon4=0. + DecMoon4=0. + LST4=0. + HA4=0. + AzMoon4=0. + ElMoon4=0. + vr4=0. + dist4=0. + ephemeris_result=EPHEMERIS_INVALID_INPUT + + if(.not.ieee_is_finite(uth4) .or. uth4.lt.0. .or. uth4.ge.24.) return + if(.not.ieee_is_finite(lon4) .or. .not.ieee_is_finite(lat4)) return + if(lat4.lt.-90. .or. lat4.gt.90.) return twopi=8.d0*atan(1.d0) !Define some constants rad=360.d0/twopi clight=2.99792458d5 call sla_CLDJ(nyear,month,nday,djutc,j) + if(j.ne.0) return djutc=djutc + uth4/24.d0 dut=-0.460d0 @@ -28,7 +47,8 @@ subroutine MoonDopJPL(nyear,month,nday,uth4,lon4,lat4,RAMoon4, & nspecial=0 call ephem(djutc,dut,east_long,geodetic_lat,height,nspecial, & - RA,Dec,Az,El,techo,dop,fspread_1GHz,vr) + RA,Dec,Az,El,techo,dop,fspread_1GHz,vr,ephemeris_result) + if(ephemeris_result.eq.EPHEMERIS_UNAVAILABLE) return RAMoon4=RA DecMoon4=Dec diff --git a/lib/morse.f90 b/lib/morse.f90 index 7b428958..ecc6b2be 100644 --- a/lib/morse.f90 +++ b/lib/morse.f90 @@ -1,4 +1,12 @@ -subroutine morse(msg,idat,n) +module morse_encoder + + implicit none + private + public encode_morse + +contains + +subroutine encode_morse(msg,idat,n) ! Convert ascii message to a Morse code bit string. ! Dash = 3 dots @@ -6,9 +14,12 @@ subroutine morse(msg,idat,n) ! Space between letters = 3 dots ! Space between words = 7 dots - character*(*) msg - integer idat(250) + implicit none + + character(len=*), intent(in) :: msg + integer, intent(out) :: idat(:),n integer*1 ic(21,38) + integer i,j,jj,k,msglen,nmax data ic/ & 1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,20, & 1,0,1,1,1,0,1,1,1,0,1,1,1,0,1,1,1,0,0,0,18, & @@ -48,7 +59,6 @@ subroutine morse(msg,idat,n) 1,1,1,0,1,1,1,0,1,0,1,0,0,0,0,0,0,0,0,0,12, & 1,1,1,0,1,0,1,0,1,1,1,0,1,0,0,0,0,0,0,0,14, & 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 2/ !Incremental word space - save msglen=len(msg) idat=0 @@ -56,15 +66,24 @@ subroutine morse(msg,idat,n) do k=1,msglen jj=ichar(msg(k:k)) if(jj.ge.97 .and. jj.le.122) jj=jj-32 !Convert lower to upper case - if(jj.ge.48 .and. jj.le.57) j=jj-48 !Numbers - if(jj.ge.65 .and. jj.le.90) j=jj-55 !Letters - if(jj.eq.47) j=36 !Slash (/) - if(jj.eq.32) j=37 !Word space + if(jj.ge.48 .and. jj.le.57) then + j=jj-48 !Numbers + else if(jj.ge.65 .and. jj.le.90) then + j=jj-55 !Letters + else if(jj.eq.47) then + j=36 !Slash (/) + else if(jj.eq.32) then + j=37 !Word space + else + idat=0 + n=0 + return + endif j=j+1 ! Insert this character nmax=ic(21,j) - if (n + nmax + 4 .gt. size (idat)) exit + if (n + nmax + 6 .gt. size (idat)) exit do i=1,nmax n=n+1 idat(n)=ic(i,j) @@ -84,4 +103,17 @@ subroutine morse(msg,idat,n) enddo return +end subroutine encode_morse + +end module morse_encoder + +subroutine morse(msg,idat,n) + + use morse_encoder, only: encode_morse + implicit none + + character(len=*), intent(in) :: msg + integer, intent(out) :: idat(250),n + call encode_morse(msg,idat,n) + end subroutine morse diff --git a/lib/msk144_freq_search.f90 b/lib/msk144_freq_search.f90 index 5029816a..5268851b 100644 --- a/lib/msk144_freq_search.f90 +++ b/lib/msk144_freq_search.f90 @@ -1,9 +1,11 @@ subroutine msk144_freq_search(cdat,fc,if1,if2,delf,nframes,navmask,cb, & cdat2,xmax,bestf,cs,xccs) - parameter (NSPM=864,NZ=7*NSPM) - complex cdat(NZ) - complex cdat2(NZ) + use, intrinsic :: ieee_arithmetic, only: ieee_is_finite + + parameter (NSPM=864) + complex cdat(NSPM*nframes) + complex cdat2(NSPM*nframes) complex c(NSPM) !Coherently averaged complex data complex ct2(2*NSPM) complex cs(NSPM) @@ -13,7 +15,13 @@ subroutine msk144_freq_search(cdat,fc,if1,if2,delf,nframes,navmask,cb, & real xccs(0:NSPM-1) integer navmask(nframes) !Tells which frames to average - navg=sum(navmask) + xmax=0.0 + bestf=0.0 + cs=0.0 + xccs=0.0 + + navg=sum(navmask) + if(navg.le.0 .or. if1.gt.if2) return n=nframes*NSPM fac=1.0/(48.0*sqrt(float(navg))) @@ -37,8 +45,10 @@ subroutine msk144_freq_search(cdat,fc,if1,if2,delf,nframes,navmask,cb, & enddo xcc=abs(cc) + if(.not.all(ieee_is_finite(xcc))) cycle xb=maxval(xcc)*fac - if(xb.gt.xmax) then + if(.not.ieee_is_finite(xb)) cycle + if(ifr.eq.if1 .or. xb.gt.xmax) then xmax=xb bestf=ferr cs=c diff --git a/lib/msk144code.f90 b/lib/msk144code.f90 index 2cb4d6a4..ffbc9acc 100644 --- a/lib/msk144code.f90 +++ b/lib/msk144code.f90 @@ -6,6 +6,7 @@ program msk144code use packjt77 character*77 c77 character msg*37,msgsent*37,bad*1,msgtype*18 + integer pack_status integer*4 i4tone(144) include 'msk144_testmsg.f90' @@ -36,7 +37,17 @@ program msk144code call genmsk_128_90(msg,ichk,msgsent,i4tone,itype) i3=-1 n3=-1 - call pack77(msg,i3,n3,c77) + if(msg(1:1).ne.'@' .and. itype.ne.7) then + if(trim(msgsent).eq.'*** bad message ***') then + print*,'Cannot encode message: ',trim(msg) + stop 1 + endif + call pack77(msgsent,i3,n3,c77,status=pack_status) + if(pack_status.ne.PACK77_STATUS_ENCODED) then + print*,'Cannot encode message: ',trim(msg) + stop 1 + endif + endif msgtype="" if(i3.eq.0) then if(n3.eq.0) msgtype="Free text" diff --git a/lib/msk144sim.f90 b/lib/msk144sim.f90 index 5a4f3cb5..b0ed8873 100644 --- a/lib/msk144sim.f90 +++ b/lib/msk144sim.f90 @@ -86,7 +86,7 @@ program msk144sim do ifile=1,nfiles !Loop over requested number of files write(fname,1002) ifile !Output filename 1002 format('000000_',i6.6) - open(10,file=fname(1:13)//'.wav',access='stream',status='unknown') + open(10,file=fname(1:13)//'.wav',access='stream',status='replace') wave=0.0 iwave=0 diff --git a/lib/msk144spd.f90 b/lib/msk144spd.f90 index 2bc6dcfe..3ff5e12c 100644 --- a/lib/msk144spd.f90 +++ b/lib/msk144spd.f90 @@ -4,7 +4,9 @@ subroutine msk144spd(cbig,n,ntol,nsuccess,msgreceived,fc,fret,tret,navg,ct, & ! MSK144 short-ping-decoder use packjt77 + use msk_spectrum, only: msk_clip_spectrum_window,msk_peak_offset use timer_module, only: timer + use, intrinsic :: ieee_arithmetic, only: ieee_is_finite parameter (NSPM=864, MAXSTEPS=100, NFFT=NSPM, MAXCAND=5, NPATTERNS=6) character*37 msgreceived @@ -20,6 +22,7 @@ subroutine msk144spd(cbig,n,ntol,nsuccess,msgreceived,fc,fret,tret,navg,ct, & integer navmask(3) integer nstart(MAXCAND) logical ismask(NFFT) + logical high_window_usable,low_window_usable real detmet(-2:MAXSTEPS+3) real detmet2(-2:MAXSTEPS+3) real detfer(MAXSTEPS) @@ -29,7 +32,8 @@ subroutine msk144spd(cbig,n,ntol,nsuccess,msgreceived,fc,fret,tret,navg,ct, & real softbits(144) real tonespec(NFFT) real tpat(NPATTERNS) - real*8 dt, df, fs, pi, twopi + real*8 dt,df,fs,pi,twopi,nfhi,nflo + real*8 ihlo_requested,ihhi_requested,illo_requested,ilhi_requested logical first data first/.true./ data navpatterns/ & @@ -43,6 +47,10 @@ subroutine msk144spd(cbig,n,ntol,nsuccess,msgreceived,fc,fret,tret,navg,ct, & save df,first,fs,pi,twopi,dt,tframe,rcw + nsuccess=0 + msgreceived=' ' + if(n.lt.3*NSPM .or. ntol.lt.0 .or. .not.ieee_is_finite(fc)) return + if(first) then nmatchedfilter=1 ! define half-sine pulse and raised-cosine edge window @@ -62,16 +70,21 @@ subroutine msk144spd(cbig,n,ntol,nsuccess,msgreceived,fc,fret,tret,navg,ct, & endif ! fill the detmet, detferr arrays - nstep=(n-NSPM)/216 ! 72ms/4=18ms steps + nstep=min(MAXSTEPS,(n-NSPM)/216) ! 72ms/4=18ms steps detmet=0 detmet2=0 detfer=-999.99 - nfhi=2*(fc+500) - nflo=2*(fc-500) - ihlo=nint((nfhi-2*ntol)/df) + 1 - ihhi=nint((nfhi+2*ntol)/df) + 1 - illo=nint((nflo-2*ntol)/df) + 1 - ilhi=nint((nflo+2*ntol)/df) + 1 + nfhi=2d0*(dble(fc)+500d0) + nflo=2d0*(dble(fc)-500d0) + ihlo_requested=(nfhi-2d0*dble(ntol))/df + 1d0 + ihhi_requested=(nfhi+2d0*dble(ntol))/df + 1d0 + illo_requested=(nflo-2d0*dble(ntol))/df + 1d0 + ilhi_requested=(nflo+2d0*dble(ntol))/df + 1d0 + call msk_clip_spectrum_window(NFFT,ihlo_requested,ihhi_requested,ihlo,ihhi, & + high_window_usable) + call msk_clip_spectrum_window(NFFT,illo_requested,ilhi_requested,illo,ilhi, & + low_window_usable) + if(.not.high_window_usable .or. .not.low_window_usable) return i2000=nint(nflo/df) + 1 i4000=nint(nfhi/df) + 1 do istp=1,nstep @@ -94,7 +107,7 @@ subroutine msk144spd(cbig,n,ntol,nsuccess,msgreceived,fc,fret,tret,navg,ct, & ismask(ihlo:ihhi)=.true. ! high tone search window iloc=maxloc(tonespec,ismask) ihpk=iloc(1) - deltah=-real( (ctmp(ihpk-1)-ctmp(ihpk+1)) / (2*ctmp(ihpk)-ctmp(ihpk-1)-ctmp(ihpk+1)) ) + deltah=msk_peak_offset(ctmp,ihpk) ah=tonespec(ihpk) ahavp=(sum(tonespec,ismask)-ah)/count(ismask) trath=ah/(ahavp+0.01) @@ -102,7 +115,7 @@ subroutine msk144spd(cbig,n,ntol,nsuccess,msgreceived,fc,fret,tret,navg,ct, & ismask(illo:ilhi)=.true. ! window for low tone iloc=maxloc(tonespec,ismask) ilpk=iloc(1) - deltal=-real( (ctmp(ilpk-1)-ctmp(ilpk+1)) / (2*ctmp(ilpk)-ctmp(ilpk-1)-ctmp(ilpk+1)) ) + deltal=msk_peak_offset(ctmp,ilpk) al=tonespec(ilpk) alavp=(sum(tonespec,ismask)-al)/count(ismask) tratl=al/(alavp+0.01) @@ -121,6 +134,7 @@ subroutine msk144spd(cbig,n,ntol,nsuccess,msgreceived,fc,fret,tret,navg,ct, & call indexx(detmet(1:nstep),nstep,indices) !find median of detection metric vector xmed=detmet(indices(nstep/4)) + if(xmed.le.0.0 .or. .not.ieee_is_finite(xmed)) return detmet=detmet/xmed ! noise floor of detection metric is 1.0 ndet=0 @@ -152,8 +166,6 @@ subroutine msk144spd(cbig,n,ntol,nsuccess,msgreceived,fc,fret,tret,navg,ct, & enddo endif - nsuccess=0 - msgreceived=' ' npeaks=2 ntol0=8 deltaf=2.0 diff --git a/lib/msk144sync.f90 b/lib/msk144sync.f90 index cfcd8c92..ccbb1c2d 100644 --- a/lib/msk144sync.f90 +++ b/lib/msk144sync.f90 @@ -67,7 +67,7 @@ subroutine msk144sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest, & if2=if1+nstep-1 if(id.eq.nthreads) if2=nint(ntol/delf) call msk144_freq_search(cdat,fc,if1,if2,delf,nframes,navmask,cb, & - cdat2(1,id),xm(id),bf(id),cs(1,id),xccs(1,id)) + cdat2(1,id),xm(id),bf(id),cs(1,id),xccs(:,id)) !$OMP END PARALLEL xmax=xm(1) diff --git a/lib/msk40_freq_search.f90 b/lib/msk40_freq_search.f90 index 97f74f5e..6645c97b 100644 --- a/lib/msk40_freq_search.f90 +++ b/lib/msk40_freq_search.f90 @@ -1,9 +1,11 @@ subroutine msk40_freq_search(cdat,fc,if1,if2,delf,nframes,navmask,cb, & cdat2,xmax,bestf,cs,xccs) - parameter (NSPM=240,NZ=7*NSPM) - complex cdat(NZ) - complex cdat2(NZ) + use, intrinsic :: ieee_arithmetic, only: ieee_is_finite + + parameter (NSPM=240) + complex cdat(NSPM*nframes) + complex cdat2(NSPM*nframes) complex c(NSPM) !Coherently averaged complex data complex ct2(2*NSPM) complex cs(NSPM) @@ -13,7 +15,13 @@ subroutine msk40_freq_search(cdat,fc,if1,if2,delf,nframes,navmask,cb, & real xccs(0:NSPM-1) integer navmask(nframes) !Tells which frames to average - navg=sum(navmask) + xmax=0.0 + bestf=0.0 + cs=0.0 + xccs=0.0 + + navg=sum(navmask) + if(navg.le.0 .or. if1.gt.if2) return n=nframes*NSPM ! fac=1.0/(48.0*sqrt(float(navg))) fac=1.0/(24.0*sqrt(float(navg))) @@ -37,8 +45,10 @@ subroutine msk40_freq_search(cdat,fc,if1,if2,delf,nframes,navmask,cb, & enddo xcc=abs(cc) + if(.not.all(ieee_is_finite(xcc))) cycle xb=maxval(xcc)*fac - if(xb.gt.xmax) then + if(.not.ieee_is_finite(xb)) cycle + if(ifr.eq.if1 .or. xb.gt.xmax) then xmax=xb bestf=ferr cs=c diff --git a/lib/msk40spd.f90 b/lib/msk40spd.f90 index 63532ae9..65321849 100644 --- a/lib/msk40spd.f90 +++ b/lib/msk40spd.f90 @@ -3,7 +3,9 @@ subroutine msk40spd(cbig,n,ntol,mycall,hiscall,bswl,nhasharray, & ! msk40 short-ping-decoder use packjt77 + use msk_spectrum, only: msk_clip_spectrum_window,msk_peak_offset use timer_module, only: timer + use, intrinsic :: ieee_arithmetic, only: ieee_is_finite parameter (NSPM=240, MAXSTEPS=150, NFFT=NSPM, MAXCAND=5, NPATTERNS=6) character*12 mycall,hiscall @@ -20,6 +22,7 @@ subroutine msk40spd(cbig,n,ntol,mycall,hiscall,bswl,nhasharray, & integer navmask(3) integer nstart(MAXCAND) logical ismask(NFFT) + logical high_window_usable,low_window_usable logical*1 bswl real detmet(-2:MAXSTEPS+3) real detmet2(-2:MAXSTEPS+3) @@ -29,7 +32,8 @@ subroutine msk40spd(cbig,n,ntol,mycall,hiscall,bswl,nhasharray, & real snrs(MAXCAND) real tonespec(NFFT) real tpat(NPATTERNS) - real*8 dt, df, fs, pi, twopi + real*8 dt,df,fs,pi,twopi,nfhi,nflo + real*8 ihlo_requested,ihhi_requested,illo_requested,ilhi_requested logical first data first/.true./ data navpatterns/ & @@ -42,6 +46,10 @@ subroutine msk40spd(cbig,n,ntol,mycall,hiscall,bswl,nhasharray, & data tpat/1.5,0.5,2.5,1.0,2.0,1.5/ save df,first,fs,pi,twopi,dt,tframe,rcw + nsuccess=0 + msgreceived=' ' + if(n.lt.3*NSPM .or. ntol.lt.0 .or. .not.ieee_is_finite(fc)) return + if(first) then nmatchedfilter=1 ! define half-sine pulse and raised-cosine edge window @@ -62,16 +70,21 @@ subroutine msk40spd(cbig,n,ntol,mycall,hiscall,bswl,nhasharray, & ! fill the detmet, detferr arrays - nstep=(n-NSPM)/60 ! 20ms/4=5ms steps + nstep=min(MAXSTEPS,(n-NSPM)/60) ! 20ms/4=5ms steps detmet=0 detmet2=0 detfer=-999.99 - nfhi=2*(fc+500) - nflo=2*(fc-500) - ihlo=nint((nfhi-2*ntol)/df)+1 - ihhi=nint((nfhi+2*ntol)/df)+1 - illo=nint((nflo-2*ntol)/df)+1 - ilhi=nint((nflo+2*ntol)/df)+1 + nfhi=2d0*(dble(fc)+500d0) + nflo=2d0*(dble(fc)-500d0) + ihlo_requested=(nfhi-2d0*dble(ntol))/df + 1d0 + ihhi_requested=(nfhi+2d0*dble(ntol))/df + 1d0 + illo_requested=(nflo-2d0*dble(ntol))/df + 1d0 + ilhi_requested=(nflo+2d0*dble(ntol))/df + 1d0 + call msk_clip_spectrum_window(NFFT,ihlo_requested,ihhi_requested,ihlo,ihhi, & + high_window_usable) + call msk_clip_spectrum_window(NFFT,illo_requested,ilhi_requested,illo,ilhi, & + low_window_usable) + if(.not.high_window_usable .or. .not.low_window_usable) return i2000=nint(nflo/df)+1 i4000=nint(nfhi/df)+1 do istp=1,nstep @@ -94,7 +107,7 @@ subroutine msk40spd(cbig,n,ntol,mycall,hiscall,bswl,nhasharray, & ismask(ihlo:ihhi)=.true. ! high tone search window iloc=maxloc(tonespec,ismask) ihpk=iloc(1) - deltah=-real( (ctmp(ihpk-1)-ctmp(ihpk+1)) / (2*ctmp(ihpk)-ctmp(ihpk-1)-ctmp(ihpk+1)) ) + deltah=msk_peak_offset(ctmp,ihpk) ah=tonespec(ihpk) ahavp=(sum(tonespec,ismask)-ah)/count(ismask) trath=ah/(ahavp+0.01) @@ -102,7 +115,7 @@ subroutine msk40spd(cbig,n,ntol,mycall,hiscall,bswl,nhasharray, & ismask(illo:ilhi)=.true. ! window for low tone iloc=maxloc(tonespec,ismask) ilpk=iloc(1) - deltal=-real( (ctmp(ilpk-1)-ctmp(ilpk+1)) / (2*ctmp(ilpk)-ctmp(ilpk-1)-ctmp(ilpk+1)) ) + deltal=msk_peak_offset(ctmp,ilpk) al=tonespec(ilpk) alavp=(sum(tonespec,ismask)-al)/count(ismask) tratl=al/(alavp+0.01) @@ -121,6 +134,7 @@ subroutine msk40spd(cbig,n,ntol,mycall,hiscall,bswl,nhasharray, & call indexx(detmet(1:nstep),nstep,indices) !find median of detection metric vector xmed=detmet(indices(nstep/4)) + if(xmed.le.0.0 .or. .not.ieee_is_finite(xmed)) return detmet=detmet/xmed ! noise floor of detection metric is 1.0 ndet=0 @@ -152,8 +166,6 @@ subroutine msk40spd(cbig,n,ntol,mycall,hiscall,bswl,nhasharray, & enddo endif - nsuccess=0 - msgreceived=' ' npeaks=2 ntol0=29 deltaf=7.2 diff --git a/lib/msk40sync.f90 b/lib/msk40sync.f90 index 5a2ca1e7..888673f7 100644 --- a/lib/msk40sync.f90 +++ b/lib/msk40sync.f90 @@ -27,6 +27,13 @@ subroutine msk40sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest, & data s8r/1,0,1,1,0,0,0,1/ save first,cb,fs,pi,twopi,dt,s8r,pp + interface + subroutine wsjt_tsan_acquire_msk40_sync() bind(C) + end subroutine wsjt_tsan_acquire_msk40_sync + subroutine wsjt_tsan_release_msk40_sync() bind(C) + end subroutine wsjt_tsan_release_msk40_sync + end interface + if(first) then pi=4.0*atan(1.0) twopi=8.0*atan(1.0) @@ -67,10 +74,13 @@ subroutine msk40sync(cdat,nframes,ntol,delf,navmask,npeaks,fc,fest, & if2=if1+nstep-1 if(id.eq.nthreads) if2=nint(ntol/delf) call msk40_freq_search(cdat,fc,if1,if2,delf,nframes,navmask,cb, & - cdat2(1,id),xm(id),bf(id),cs(1,id),xccs(1,id)) + cdat2(1,id),xm(id),bf(id),cs(1,id),xccs(:,id)) + ! GCC TSan does not observe libgomp's implicit barrier. + call wsjt_tsan_release_msk40_sync() ! write(73,3002) id,if1,if2,nfreqs,nthreads,bf(id),xm(id) !3002 format(5i5,2f10.3) !$OMP END PARALLEL + call wsjt_tsan_acquire_msk40_sync() xmax=xm(1) fest=fc+bf(1) diff --git a/lib/msk_spectrum.f90 b/lib/msk_spectrum.f90 new file mode 100644 index 00000000..2339105c --- /dev/null +++ b/lib/msk_spectrum.f90 @@ -0,0 +1,59 @@ +module msk_spectrum + use, intrinsic :: iso_fortran_env, only: real64 + use, intrinsic :: ieee_arithmetic, only: ieee_is_finite + implicit none + private + + public :: msk_clip_spectrum_window + public :: msk_peak_offset + +contains + + pure subroutine msk_clip_spectrum_window(nfft,requested_lo,requested_hi, & + lo,hi,usable) + integer, intent(in) :: nfft + real(real64), intent(in) :: requested_lo,requested_hi + integer, intent(out) :: lo,hi + logical, intent(out) :: usable + + lo=1 + hi=0 + usable=.false. + if(nfft.lt.1) return + if(.not.ieee_is_finite(requested_lo) .or. & + .not.ieee_is_finite(requested_hi)) return + if(requested_lo.gt.requested_hi) return + if(requested_hi.lt.0.5_real64 .or. & + requested_lo.ge.real(nfft,real64)+0.5_real64) return + + lo=nint(max(1.0_real64,min(real(nfft,real64),requested_lo))) + hi=nint(max(1.0_real64,min(real(nfft,real64),requested_hi))) + usable=lo.le.hi + if(.not.usable) then + lo=1 + hi=0 + endif + end subroutine msk_clip_spectrum_window + + pure real function msk_peak_offset(spectrum,peak_bin) result(offset) + complex, intent(in) :: spectrum(:) + integer, intent(in) :: peak_bin + complex :: curvature + real :: candidate,scale + + offset=0.0 + if(peak_bin.le.lbound(spectrum,1) .or. & + peak_bin.ge.ubound(spectrum,1)) return + + curvature=2.0*spectrum(peak_bin)-spectrum(peak_bin-1)- & + spectrum(peak_bin+1) + scale=max(abs(spectrum(peak_bin-1)),abs(spectrum(peak_bin)), & + abs(spectrum(peak_bin+1))) + if(scale.le.0.0) return + if(abs(curvature).le.epsilon(scale)*scale) return + + candidate=-real((spectrum(peak_bin-1)-spectrum(peak_bin+1))/curvature) + if(ieee_is_finite(candidate)) offset=candidate + end function msk_peak_offset + +end module msk_spectrum diff --git a/lib/options.f90 b/lib/options.f90 index f12311ed..bc2cdf97 100644 --- a/lib/options.f90 +++ b/lib/options.f90 @@ -106,6 +106,7 @@ contains integer :: chrpos, length, st, id = 0 character :: chr + character(len=100) :: longopt_name logical :: long if (cnt == 0) cnt = command_argument_count() @@ -152,6 +153,7 @@ contains end if chr = longopts(id)%chr + longopt_name = longopts(id)%name ! check if option requires an argument if (.not. longopts(id)%has_arg) then @@ -248,7 +250,7 @@ contains // " requires an argument" else write (error_unit, *) "error: option --" & - // trim(longopts(id)%name) // " requires an argument" + // trim(longopt_name) // " requires an argument" end if end select diff --git a/lib/osd128_90.f90 b/lib/osd128_90.f90 index 75082bf5..bb7a52ba 100644 --- a/lib/osd128_90.f90 +++ b/lib/osd128_90.f90 @@ -110,7 +110,8 @@ subroutine osd128_90(llr,apmask,ndeep,message77,cw,nhardmin,dmin) ntotal=0 nrejected=0 - if(ndeep.eq.0) goto 998 ! norder=0 + nord=0 + if(ndeep.le.0) goto 998 ! norder=0 if(ndeep.gt.5) ndeep=5 if( ndeep.eq. 1) then nord=1 diff --git a/lib/packjt.f90 b/lib/packjt.f90 index 2e51d78a..4bcead11 100644 --- a/lib/packjt.f90 +++ b/lib/packjt.f90 @@ -470,10 +470,10 @@ subroutine packbits(dbits,nsymd,m0,sym) if(c3.eq.'OOO ') c3=' ' !Strip out the OOO flag call getpfx1(c1,k1,nv2a) if(nv2a.ge.4) go to 10 - call packcall(c1,nc1,text1) + call packcall(c1(1:6),nc1,text1) if(text1) go to 10 call getpfx1(c2,k2,nv2b) - call packcall(c2,nc2,text2) + call packcall(c2(1:6),nc2,text2) if(text2) go to 10 if(nv2a.eq.2 .or. nv2a.eq.3 .or. nv2b.eq.2 .or. nv2b.eq.3) then if(k1.lt.0 .or. k2.lt.0 .or. k1*k2.ne.0) go to 10 @@ -801,6 +801,12 @@ subroutine packbits(dbits,nsymd,m0,sym) lrof=len_trim(rof) ispfx=(llof.gt.0 .and. llof.le.4) issfx=(lrof.gt.0 .and. lrof.le.3) + do i=1,llof + if(lof(i:i).lt.' ') ispfx=.false. + enddo + do i=1,lrof + if(rof(i:i).lt.' ') issfx=.false. + enddo invalid=.not.(ispfx.or.issfx) if(ispfx.and.issfx) then if(llof.lt.3) issfx=.false. @@ -817,6 +823,7 @@ subroutine packbits(dbits,nsymd,m0,sym) if(invalid) then k=-1 + callsign=callsign0 else if(ispfx) then tpfx=lof(1:4) @@ -936,8 +943,7 @@ subroutine packbits(dbits,nsymd,m0,sym) else if(c.ge.' ') then n=36 else - Print*,'Invalid character in callsign ',c,' ',ichar(c) - stop + n=-1 endif nchar=n @@ -980,7 +986,7 @@ subroutine packpfx(call1,n1,ng,nadd) if(call1(i1+2:i1+2).eq.' ') then ! Single-character add-on suffix (maybe also fourth suffix letter?) call0=call1(:i1-1) - call packcall(call0,n1,text) + call packcall(call0(1:6),n1,text) nadd=1 nc=ichar(call1(i1+1:i1+1)) if(nc.ge.48 .and. nc.le.57) then @@ -995,7 +1001,7 @@ subroutine packpfx(call1,n1,ng,nadd) else if(call1(i1+3:i1+3).eq.' ') then ! Two-character numerical suffix, /10 to /99 call0=call1(:i1-1) - call packcall(call0,n1,text) + call packcall(call0(1:6),n1,text) nadd=1 n=10*(ichar(call1(i1+1:i1+1))-48) + ichar(call1(i1+2:i1+2)) - 48 nadd=1 @@ -1006,7 +1012,7 @@ subroutine packpfx(call1,n1,ng,nadd) if(pfx(3:3).eq.' ') pfx=' '//pfx(1:2) if(pfx(3:3).eq.' ') pfx=' '//pfx(1:2) call0=call1(i1+1:) - call packcall(call0,n1,text) + call packcall(call0(1:6),n1,text) ng=0 do i=1,3 diff --git a/lib/plotsave.f90 b/lib/plotsave.f90 index ee1a41cf..4e144264 100644 --- a/lib/plotsave.f90 +++ b/lib/plotsave.f90 @@ -1,7 +1,8 @@ subroutine plotsave(swide,nw,nh,irow) - real, dimension(:,:), allocatable :: sw + real, dimension(:,:), allocatable :: sw,sw_old real swide(0:nw-1) + integer mw,mh data nw0/-1/,nh0/-1/ save nw0,nh0,sw @@ -11,10 +12,19 @@ subroutine plotsave(swide,nw,nh,irow) endif if(nw.ne.nw0 .or. nh.ne.nh0 .or. (.not.allocated(sw))) then - if(allocated(sw)) deallocate(sw) -! if(nw0.ne.-1) deallocate(sw) - allocate(sw(0:nw-1,0:nh-1)) - sw=0. + if(allocated(sw)) then +! Resize: keep the overlapping history instead of blanking the waterfall. + call move_alloc(sw,sw_old) + allocate(sw(0:nw-1,0:nh-1)) + sw=0. + mw=min(nw,nw0) + mh=min(nh,nh0) + sw(0:mw-1,0:mh-1)=sw_old(0:mw-1,0:mh-1) + deallocate(sw_old) + else + allocate(sw(0:nw-1,0:nh-1)) + sw=0. + endif nw0=nw nh0=nh endif diff --git a/lib/print_version.c b/lib/print_version.c new file mode 100644 index 00000000..1cf1215f --- /dev/null +++ b/lib/print_version.c @@ -0,0 +1,16 @@ +#include + +#include "scs_version.h" +#include "wsjtx_config.h" + +void print_version(const char *prog_name) +{ + printf(" Program: %s %d.%d.%d%s", prog_name, + PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR, PROJECT_VERSION_PATCH, + BUILD_TYPE_REVISION); + if (SCS_VERSION_STR[0] != '\0') { + printf(" (revision %s)\n", SCS_VERSION_STR); + } else { + puts(" (revision unavailable)"); + } +} diff --git a/lib/ptt.c b/lib/ptt.c index 902193fd..42854cc5 100644 --- a/lib/ptt.c +++ b/lib/ptt.c @@ -5,8 +5,8 @@ int ptt_(int *nport, int *ntx, int *iptt) { static HANDLE hFile; static int open=0; - char s[10]; - int i3=1,i4=1,i5=1,i6=1,i9=1,i00=1; + char s[32]; + int i3=1,i4=1,i5=1,i6=1,i9=1,i00=1,n; if(*nport==0) { *iptt=*ntx; @@ -14,7 +14,8 @@ int ptt_(int *nport, int *ntx, int *iptt) } if(*ntx && (!open)) { - sprintf(s,"\\\\.\\COM%d",*nport); + n=snprintf(s,sizeof s,"\\\\.\\COM%d",*nport); + if(n < 0 || n >= (int) sizeof s) return 1; hFile=CreateFile(TEXT(s),GENERIC_WRITE,0,NULL,OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,NULL); if(hFile==INVALID_HANDLE_VALUE) { diff --git a/lib/q65_decode.f90 b/lib/q65_decode.f90 index 5c9b0237..e06d9972 100644 --- a/lib/q65_decode.f90 +++ b/lib/q65_decode.f90 @@ -1,10 +1,13 @@ module q65_decode + use q65_workspace, only: q65_workspace_type + integer nsnr0,nfreq0 real xdt0 character msg0*37,cq0*3 type :: q65_decoder + type(q65_workspace_type) :: workspace procedure(q65_decode_callback), pointer :: callback contains procedure :: decode @@ -12,7 +15,7 @@ module q65_decode abstract interface subroutine q65_decode_callback (this,nutc,snr1,nsnr,dt,freq, & - decoded,idec,nused,ntrperiod) + decoded,idec,nused,ntrperiod,iflagdec) import q65_decoder implicit none class(q65_decoder), intent(inout) :: this @@ -25,6 +28,7 @@ module q65_decode integer, intent(in) :: idec integer, intent(in) :: nused integer, intent(in) :: ntrperiod + integer, intent(in) :: iflagdec !Recovered spare 78th bit (see genq65/q65_ap) end subroutine q65_decode_callback end interface @@ -33,7 +37,7 @@ contains subroutine decode(this,callback,iwave,nqd0,nutc,ntrperiod,nsubmode,nfqso, & ntol,ndepth,nfa0,nfb0,lclearave,single_decode,lagain,max_drift0, & lnewdat0,emedelay,mycall,hiscall,hisgrid,nQSOprogress,ncontest, & - lapcqonly,navg0,nqf) + lq65pileup,lapcqonly,navg0,nqf) ! Top-level routine that organizes the decoding of Q65 signals ! Input: iwave Raw data, i*2 @@ -47,6 +51,7 @@ contains ! emedelay Sync search extended to cover EME delays ! nQSOprogress Auto-sequencing state for the present QSO ! ncontest Supported contest type +! lq65pileup Q65 Pileup AP flag policy ! lapcqonly Flag to use AP only for CQ calls ! Output: sent to the callback routine for display to user @@ -58,7 +63,7 @@ contains use types parameter (NMAX=300*12000) !Max TRperiod is 300 s - parameter (MAX_CALLERS=40) !For multiple q3 decodes in NA VHf Contest mode + parameter (MAX_CALLERS=50) !For multiple q3 decodes in NA VHF Contest mode class(q65_decoder), intent(inout) :: this @@ -81,7 +86,8 @@ contains integer nqf(20) integer stageno !Added by W3SZ integer time - logical lclearave,lnewdat0,lapcqonly,unpk77_success + integer iflagdec !Recovered spare 78th bit + logical lclearave,lnewdat0,lq65pileup,lapcqonly,unpk77_success logical single_decode,lagain complex c00(0:3600000) !Analytic signal, 6000 Sa/s type(q3list) callers(MAX_CALLERS) @@ -233,7 +239,7 @@ contains apsymbols=0 if(ipass.ge.1) then ! Subsequent passes use AP information appropiate for nQSOprogress - call q65_ap(nQSOprogress,ipass,ncontest,lapcqonly,iaptype, & + call q65_ap(nQSOprogress,ipass,ncontest,lq65pileup,lapcqonly,iaptype, & apsym0,apmask1,apsymbols1) write(c78,1050) apmask1 1050 format(78i1) @@ -244,7 +250,7 @@ contains endif call timer('q65loop1',0) - call q65_loops(c00,npts/2,nsps/2,nsubmode,ndepth,jpk0, & + call q65_loops(this%workspace,c00,npts/2,nsps/2,nsubmode,ndepth,jpk0, & xdt,f0,iaptype,xdt1,f1,snr2,dat4,idec) call timer('q65loop1',1) if(idec.ge.0) then @@ -312,6 +318,7 @@ contains ! 3: Decode with AP for "MyCall DxCall ?" ! Unpack decoded message for display to user + iflagdec=iand(dat4(13),1) !Recover the spare 78th bit before it's shifted away write(c77,1000) dat4(1:12),dat4(13)/2 1000 format(12b6.6,b5.5) call unpack77(c77,1,decoded,unpk77_success) !Unpack to get decoded @@ -319,7 +326,7 @@ contains do i=1,ndecodes if(decodes(i).eq.decoded) idupe=1 enddo - if(idupe.eq.0) then + if(idupe.eq.0 .and. unpk77_success) then ndecodes=min(ndecodes+1,100) decodes(ndecodes)=decoded f0decodes(ndecodes)=f0dec @@ -327,7 +334,7 @@ contains call q65_snr(dat4,dtdec,f0dec,mode_q65,snr2) nsnr=nint(snr2) call this%callback(nutc,snr1,nsnr,dtdec,f0dec,decoded, & - idec,nused,ntrperiod) + idec,nused,ntrperiod,iflagdec) if(ncontest.eq.1) then call q65_hist2(nint(f0dec),decoded,callers,nhist2) else @@ -403,7 +410,7 @@ contains apsymbols=0 if(ipass.ge.1) then ! Subsequent passes use AP information appropiate for nQSOprogress - call q65_ap(nQSOprogress,ipass,ncontest,lapcqonly,iaptype, & + call q65_ap(nQSOprogress,ipass,ncontest,lq65pileup,lapcqonly,iaptype, & apsym0,apmask1,apsymbols1) write(c78,1050) apmask1 read(c78,1060) apmask @@ -412,7 +419,7 @@ contains endif call timer('q65loop2',0) - call q65_loops(c00,npts/2,nsps/2,nsubmode,ndepth,jpk0, & + call q65_loops(this%workspace,c00,npts/2,nsps/2,nsubmode,ndepth,jpk0, & xdt,f0,iaptype,xdt1,f1,snr2,dat4,idec) call timer('q65loop2',1) ! write(*,3001) '=e',nfqso,ntol,ndepth,xdt,f0,idec @@ -426,20 +433,21 @@ contains 200 decoded=' ' if(idec.ge.0) then ! Unpack decoded message for display to user + iflagdec=iand(dat4(13),1) !Recover the spare 78th bit before it's shifted away write(c77,1000) dat4(1:12),dat4(13)/2 call unpack77(c77,1,decoded,unpk77_success) !Unpack to get decoded idupe=0 do i=1,ndecodes if(decodes(i).eq.decoded) idupe=1 enddo - if(idupe.eq.0) then + if(idupe.eq.0 .and. unpk77_success) then ndecodes=min(ndecodes+1,100) decodes(ndecodes)=decoded f0decodes(ndecodes)=f0dec call q65_snr(dat4,dtdec,f0dec,mode_q65,snr2) nsnr=nint(snr2) call this%callback(nutc,snr1,nsnr,dtdec,f0dec,decoded, & - idec,nused,ntrperiod) + idec,nused,ntrperiod,iflagdec) if(ncontest.eq.1) then call q65_hist2(nint(f0dec),decoded,callers,nhist2) else diff --git a/lib/qra/q65/genq65.f90 b/lib/qra/q65/genq65.f90 index 4c555748..1705ce82 100644 --- a/lib/qra/q65/genq65.f90 +++ b/lib/qra/q65/genq65.f90 @@ -1,4 +1,4 @@ -subroutine genq65(msg0,ichk,msgsent,itone,i3,n3) +subroutine genq65(msg0,ichk,msgsent,itone,i3,n3,iflag) ! Encodes a Q65 message to yield itone(1:85) @@ -25,13 +25,16 @@ subroutine genq65(msg0,ichk,msgsent,itone,i3,n3) endif i3=-1 n3=-1 - call pack77(msg0,i3,n3,c77) - read(c77(60:74),'(b15)') ng15 + c77=' ' + unpk77_success=.false. + call pack77_legacy_truncating_fallback(msg0,i3,n3,c77) + if(i3.lt.0 .or. n3.lt.0) go to 998 + read(c77(60:74),'(b15)',err=998) ng15 if(ng15.eq.32373) c77(60:74)='111111010010011' !Message is RR73 call unpack77(c77,0,msgsent,unpk77_success) !Unpack to get msgsent - read(c77,1001) dgen + read(c77,1001,err=998) dgen 1001 format(12b6.6,b5.5) - dgen(13)=2*dgen(13) !Convert 77-bit to 78-bit payload + dgen(13)=2*dgen(13)+iflag !Convert 77-bit to 78-bit payload; iflag is the spare 78th bit if(ichk.eq.1) go to 999 !Return if checking only call q65_enc(dgen,sent) !Encode message, dgen(1:13) ==> sent(1:63) @@ -47,5 +50,12 @@ subroutine genq65(msg0,ichk,msgsent,itone,i3,n3) endif enddo + go to 999 +998 dgen=0 + sent=0 + itone=0 + i3=-1 + n3=-1 + msgsent='*** bad message *** ' 999 return end subroutine genq65 diff --git a/lib/qra/q65/normrnd.c b/lib/qra/q65/normrnd.c index 90abfa42..29d7e243 100644 --- a/lib/qra/q65/normrnd.c +++ b/lib/qra/q65/normrnd.c @@ -33,7 +33,7 @@ #elif _SVID_SOURCE || _XOPEN_SOURCE || __unix__ || (defined (__APPLE__) && defined(__MACH__)) /* POSIX or Unix or Apple */ #include #define rand_s(x) (*x)=(unsigned int)lrand48() // returns unsigned integers in the range 0..0x7FFFFFFF - #define K_RAND_MAX 0x7FFFFFFF // that's the max number + #define K_RAND_MAX 2147483647.0f // that's the max number // generated by lrand48 #else #error "No good quality PRNG found" diff --git a/lib/qra/q65/q65.c b/lib/qra/q65/q65.c index fb08dd13..a88c1e4e 100644 --- a/lib/qra/q65/q65.c +++ b/lib/qra/q65/q65.c @@ -30,11 +30,12 @@ #define Q65_LLH_THRESHOLD -260.0f // This value produce the same WER performance in decode_fullaplist -// #define Q65_LLH_THRESHOLD -262.0f +// #define Q65_LLH_THRESHOLD -262.0f static int _q65_crc6(int *x, int sz); static void _q65_crc12(int *y, int *x, int sz); +static void _q65_mask(const qracode *pcode, float *ix, const int *mask, const int *x); float q65_llh; @@ -665,7 +666,12 @@ int q65_check_llh(float *llh, const int* ydec, const int nN, const int nM, const int k; float t = 0; + if (llh != NULL) + *llh = -INFINITY; + for (k=0;k= nM) + return 0; float x=pIntrin[ydec[k]]; if(x < 1.0e-36) x = 1.0e-36; t+=logf(x); @@ -805,7 +811,7 @@ int _q65_get_bits_per_symbol(const qracode *pCode) { return pCode->m; } -static void _q65_mask(const qracode *pcode, float *ix, const int *mask, const int *x) +void _q65_mask(const qracode *pcode, float *ix, const int *mask, const int *x) { // mask intrinsic information ix with available a priori knowledge diff --git a/lib/qra/q65/q65.f90 b/lib/qra/q65/q65.f90 index d73ded61..5718243c 100644 --- a/lib/qra/q65/q65.f90 +++ b/lib/qra/q65/q65.f90 @@ -9,7 +9,7 @@ module q65 integer apmask(13),apsymbols(13) integer,dimension(22) :: isync = (/1,9,12,13,15,22,23,26,27,33,35, & 38,46,50,55,60,62,66,69,74,76,85/) - integer codewords(63,206) + integer codewords(63,411) !See MAX_NCW in q65_set_list2.f90 integer ibwa,ibwb,ncw,nsps,mode_q65,nfa,nfb,nqd integer idfbest,idtbest,ibw,ndistbest,maxiters,max_drift integer istep,nsmo,lag1,lag2,npasses,iseq,ncand,nrc @@ -367,7 +367,7 @@ subroutine q65_dec_q012(s3,LL,snr2,dat4,idec,decoded) apsymbols=0 if(ipass.ge.1) then ! Subsequent passes use AP information appropiate for nQSOprogress - call q65_ap(nQSOprogress,ipass,ncontest,lapcqonly,iaptype, & + call q65_ap(nQSOprogress,ipass,ncontest,.false.,lapcqonly,iaptype, & apsym0,apmask1,apsymbols1) write(c78,1050) apmask1 1050 format(78i1) @@ -527,7 +527,7 @@ subroutine q65_ccf_22(s1,iz,jz,nfqso,ntol,ipk,jpk,f0,xdt,ccf2) if(ccfmax.gt.ccfbest .and. abs(i*df-nfqso).le.ftol) then ccfbest=ccfmax - snrbest=snr +! snrbest=snr ! snrbest not used. snr may be uninitialized. ibest=i lagbest=lagpk idrift_best=idrift_max @@ -848,7 +848,7 @@ subroutine q65_hist2(nfreq,msg0,callers,nhist2) use types use prog_args - parameter (MAX_CALLERS=40) !For multiple q3 decodes in NA VHf Contest mode + parameter (MAX_CALLERS=50) !For multiple q3 decodes in NA VHF Contest mode character*37 msg0,msg type(q3list) callers(MAX_CALLERS) character*6 c6 diff --git a/lib/qra/q65/q65.h b/lib/qra/q65/q65.h index d0a04d4e..ab1b389d 100644 --- a/lib/qra/q65/q65.h +++ b/lib/qra/q65/q65.h @@ -34,7 +34,9 @@ // Verify loglikelihood after successful decoding #define Q65_CHECKLLH // Max codeword list size in q65_decode_fullaplist -#define Q65_FULLAPLIST_SIZE 256 +// See MAX_NCW in q65_set_list2.f90 (not required to be a power of 2 -- +// this value is only ever used in a plain bounds check). +#define Q65_FULLAPLIST_SIZE 411 // maximum number of weights for the fast-fading metric evaluation #define Q65_FASTFADING_MAXWEIGTHS 65 @@ -113,7 +115,6 @@ int q65_esnodb_fastfading( int _q65_get_message_length(const qracode *pCode); int _q65_get_codeword_length(const qracode *pCode); float _q65_get_code_rate(const qracode *pCode); -static void _q65_mask(const qracode *pcode, float *ix, const int *mask, const int *x); int _q65_get_alphabet_size(const qracode *pCode); int _q65_get_bits_per_symbol(const qracode *pCode); diff --git a/lib/qra/q65/q65_ap.f90 b/lib/qra/q65/q65_ap.f90 index 32e26a4e..e6568676 100644 --- a/lib/qra/q65/q65_ap.f90 +++ b/lib/qra/q65/q65_ap.f90 @@ -1,4 +1,4 @@ -subroutine q65_ap(nQSOprogress,ipass,ncontest,lapcqonly,iaptype, & +subroutine q65_ap(nQSOprogress,ipass,ncontest,lq65pileup,lapcqonly,iaptype, & apsym0,apmask,apsymbols) integer apsym0(58),aph10(10) @@ -6,7 +6,7 @@ subroutine q65_ap(nQSOprogress,ipass,ncontest,lapcqonly,iaptype, & integer naptypes(0:5,4) ! (nQSOProgress, ipass) maximum of 4 passes for now integer mcqru(29),mcqfd(29),mcqtest(29),mcqww(29) integer mcq(29),mrrr(19),m73(19),mrr73(19) - logical lapcqonly,first + logical lq65pileup,lapcqonly,first data mcq/0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0/ data mcqru/0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,0,0,1,1,0,0/ data mcqfd/0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,0,0,0,1,0/ @@ -120,25 +120,31 @@ subroutine q65_ap(nQSOprogress,ipass,ncontest,lapcqonly,iaptype, & endif endif - if(iaptype.eq.3) then ! MyCall,DxCall,??? + if(iaptype.eq.3) then ! MyCall,DxCall,??? apmask=0 +! Q65 Pileup uses bit 78 for the copied-last-transmission indication. +! Other Q65 AP decodes retain the normal known-zero bit. if(ncontest.eq.0.or.ncontest.eq.1.or.ncontest.eq.2.or.ncontest.eq.5.or.ncontest.eq.7) then - apmask(1:58)=1 + apmask(1:58)=1 apsymbols(1:58)=apsym0 - apmask(75:78)=1 - apsymbols(75:78)=(/0,0,1,0/) + apmask(75:77)=1 + apsymbols(75:77)=(/0,0,1/) + if(.not.lq65pileup) then + apmask(78)=1 + apsymbols(78)=0 + endif else if(ncontest.eq.3) then ! Field Day - apmask(1:56)=1 + apmask(1:56)=1 apsymbols(1:28)=apsym0(1:28) apsymbols(29:56)=apsym0(30:57) - apmask(72:78)=1 - apsymbols(75:78)=0 - else if(ncontest.eq.4) then - apmask(2:57)=1 + apmask(72:77)=1 + apsymbols(75:77)=0 + else if(ncontest.eq.4) then + apmask(2:57)=1 apsymbols(2:29)=apsym0(1:28) apsymbols(30:57)=apsym0(30:57) - apmask(75:78)=1 - apsymbols(75:78)=(/0,0,1,0/) + apmask(75:77)=1 + apsymbols(75:77)=(/0,0,1/) endif endif diff --git a/lib/qra/q65/q65_encoding_modules.f90 b/lib/qra/q65/q65_encoding_modules.f90 index 4988dd4d..3f749d5b 100644 --- a/lib/qra/q65/q65_encoding_modules.f90 +++ b/lib/qra/q65/q65_encoding_modules.f90 @@ -164,10 +164,10 @@ subroutine get_q65crc12(mc2,ncrc1,ncrc2) end subroutine get_q65crc12 -subroutine get_q65_tones(msg37,codeword,itone) +subroutine get_q65_tones(msg37,codeword,itone,msgsent,success) use packjt77 implicit none - character*37 msg37 + character*37 msg37,msgsent character*77 c77 character*6 c6 integer codeword(65) @@ -175,16 +175,36 @@ subroutine get_q65_tones(msg37,codeword,itone) integer message(15) integer shortcodeword(63) integer itone(85) - integer i,j,k + integer i,j,k,ios,pack_status,ng15 integer*1 mbits(90) integer i3,n3,ncrc1,ncrc2 + logical success,unpk77_success data sync/1,9,12,13,15,22,23,26,27,33,35,38,46,50,55,60,62,66,69,74,76,85/ i3=-1 n3=-1 - call pack77(msg37,i3,n3,c77) + c77=' ' + codeword=0 + itone=0 + msgsent='*** bad message *** ' + success=.false. + call pack77_legacy_truncating_fallback(msg37,i3,n3,c77, & + status=pack_status) + if(pack_status.ne.PACK77_STATUS_ENCODED) return + read(c77(60:74),'(b15)',iostat=ios) ng15 + if(ios.ne.0) return + if(ng15.eq.32373) c77(60:74)='111111010010011' !Message is RR73 + call unpack77(c77,0,msgsent,unpk77_success) + if(.not.unpk77_success) then + msgsent='*** bad message *** ' + return + endif mbits=0 - read(c77,'(77i1)') mbits(1:77) + read(c77,'(77i1)',iostat=ios) mbits(1:77) + if(ios.ne.0) then + msgsent='*** bad message *** ' + return + endif ! Message is 77 bits long. Add a 0 bit to create a 78-bit message and pad with ! 12 zeros to create 90-bit mbit array for CRC calculation. @@ -216,6 +236,7 @@ subroutine get_q65_tones(msg37,codeword,itone) itone(i)=shortcodeword(k)+1 endif enddo + success=.true. end subroutine get_q65_tones end module q65_encoding diff --git a/lib/qra/q65/q65_ftn_test.f90 b/lib/qra/q65/q65_ftn_test.f90 index 607d0f5b..3f5c47c0 100644 --- a/lib/qra/q65/q65_ftn_test.f90 +++ b/lib/qra/q65/q65_ftn_test.f90 @@ -21,8 +21,12 @@ program q65_ftn_test endif call getarg(1,msg0) call pack77(msg0,i3,n3,c77) + if(i3.lt.0) then + print*,'Cannot pack message: ',trim(msg0) + go to 999 + endif call unpack77(c77,0,msgsent,unpk77_success) !Unpack to get msgsent - read(c77,1000) x + read(c77,1000,err=990) x 1000 format(12b6.6,b5.5) call q65_enc(x,y) !Encode message, x(1:13) ==> y(1:63) @@ -48,4 +52,7 @@ program q65_ftn_test write(*,1100) xdec,trim(msg) 1100 format(/'Decoded message:'/13i3,2x,a) + go to 999 + +990 print*,'Cannot read packed message bits: ',trim(msg0) 999 end program q65_ftn_test diff --git a/lib/qra/q65/q65_loops.f90 b/lib/qra/q65/q65_loops.f90 index 3220648e..4a5bc34f 100644 --- a/lib/qra/q65/q65_loops.f90 +++ b/lib/qra/q65/q65_loops.f90 @@ -1,24 +1,23 @@ -subroutine q65_loops(c00,npts2,nsps2,nsubmode,ndepth,jpk0, & +subroutine q65_loops(workspace,c00,npts2,nsps2,nsubmode,ndepth,jpk0, & xdt0,f0,iaptype,xdt1,f1,snr2,dat4,idec) use packjt77 use timer_module, only: timer use q65 + use q65_workspace, only: q65_workspace_type parameter (NN=63) parameter (LN=2176*63) !LN=LL*NN; LL=64*(mode_q65+2), NN=63 + type(q65_workspace_type), intent(inout) :: workspace complex c00(0:npts2-1) !Analytic representation of dd(), 6000 Hz - complex ,allocatable :: c0(:) !Ditto, with freq shift character decoded*37 real a(3) !twkfreq params f,f1,f2 - real,allocatable :: s3(:) !Symbol spectra integer dat4(13) !Decoded message (as 13 six-bit integers) integer nap(0:11) !AP return codes data nap/0,2,3,2,3,4,2,3,6,4,6,6/ LL=64*(mode_q65+2) - allocate(s3(LL*NN)) - allocate(c0(0:npts2-1)) + call workspace%ensure(npts2,LL) idec=-1 ircbest=9999 irc=-99 @@ -54,18 +53,19 @@ subroutine q65_loops(c00,npts2,nsps2,nsubmode,ndepth,jpk0, & a(1)=-(f0+0.5*baud*ndf) ! Variable 'drift' is frequency increase over full TxT. Therefore we want: a(2)=-0.5*drift - call twkfreq(c00,c0,npts2,6000.0,a) + call twkfreq(c00,workspace%c0(0:npts2-1),npts2,6000.0,a) do idt=1,idtmax ndt=idt/2 if(mod(idt,2).eq.0) ndt=-ndt jpk=jpk0 + nsps2*ndt/16 !tsym/16 jpk=max(0,jpk) jpk=min(29000,jpk) - call spec64(c0,npts2,nsps2,mode_q65,jpk,s3,LL,NN) - call pctile(s3,LL*NN,40,base) - s3=s3/base - where(s3(1:LL*NN)>s3lim) s3(1:LL*NN)=s3lim - call q65_bzap(s3,LL) !Zap birdies + call spec64(workspace%c0(0:npts2-1),workspace%cs,npts2,nsps2, & + mode_q65,jpk,workspace%s3(1:LL*NN),LL,NN) + call pctile(workspace%s3(1:LL*NN),LL*NN,40,base) + workspace%s3(1:LL*NN)=workspace%s3(1:LL*NN)/base + where(workspace%s3(1:LL*NN)>s3lim) workspace%s3(1:LL*NN)=s3lim + call q65_bzap(workspace%s3(1:LL*NN),LL) !Zap birdies do ibw=ibwa,ibwb ndist=ndf**2 + ndt**2 + (ibw-ibw0)**2 if(ndist.gt.maxdist) cycle @@ -73,7 +73,7 @@ subroutine q65_loops(c00,npts2,nsps2,nsubmode,ndepth,jpk0, & if(b90.gt.345.0) cycle b90ts = b90/baud call timer('dec2 ',0) - call q65_dec2(s3,nsubmode,b90ts,esnodb,irc,dat4,decoded) + call q65_dec2(workspace%s3(1:LL*NN),nsubmode,b90ts,esnodb,irc,dat4,decoded) call timer('dec2 ',1) ! irc > 0 ==> number of iterations required to decode ! -1 = invalid params diff --git a/lib/qra/q65/q65_set_list.f90 b/lib/qra/q65/q65_set_list.f90 index 0b836bde..2bb9c1f3 100644 --- a/lib/qra/q65/q65_set_list.f90 +++ b/lib/qra/q65/q65_set_list.f90 @@ -45,7 +45,7 @@ subroutine q65_set_list(mycall,hiscall,hisgrid,codewords,ncw) endif endif - call genq65(msg,0,msgsent,itone,i3,n3) + call genq65(msg,0,msgsent,itone,i3,n3,0) i0=1 j=0 do k=1,85 diff --git a/lib/qra/q65/q65_set_list2.f90 b/lib/qra/q65/q65_set_list2.f90 index 39147e61..433802fb 100644 --- a/lib/qra/q65/q65_set_list2.f90 +++ b/lib/qra/q65/q65_set_list2.f90 @@ -1,8 +1,8 @@ subroutine q65_set_list2(mycall,hiscall,hisgrid,callers,nhist2,codewords,ncw) use types - parameter (MAX_NCW=206) - parameter (MAX_CALLERS=40) !For multiple q3 decodes in NA VHf Contest mode + parameter (MAX_NCW=411) !1 + 40 stored callers plus the current call, 5 kinds, 2 flags + parameter (MAX_CALLERS=50) !For multiple q3 decodes in NA VHF Contest mode character*12 mycall,hiscall character*6 hisgrid,c6 character*4 g4 @@ -41,7 +41,6 @@ subroutine q65_set_list2(mycall,hiscall,hisgrid,callers,nhist2,codewords,ncw) g4=hisgrid(1:4) endif do k=1,5 - i=i+1 msg=trim(mycall)//' '//trim(c6) j0=len(trim(msg))+1 if(k.eq.1) msg=msg(1:j0)//g4 @@ -49,19 +48,26 @@ subroutine q65_set_list2(mycall,hiscall,hisgrid,callers,nhist2,codewords,ncw) if(k.eq.3) msg(j0:j0+3)=' RRR' if(k.eq.4) msg(j0:j0+4)=' RR73' if(k.eq.5) msg(j0:j0+2)=' 73' - call genq65(msg,0,msgsent,itone,i3,n3) - i0=1 - jj=0 - do kk=1,85 - if(kk.eq.isync(i0)) then - i0=i0+1 - cycle - endif - jj=jj+1 - codewords(jj,i)=itone(kk) - 1 + ! Generate both flag values: a caller may or may not have set + ! bit78 (copied our last transmission), and both must be + ! present as exact candidates for the full-AP list match to + ! recognize either with full sensitivity. + do iflag=0,1 + i=i+1 + call genq65(msg,0,msgsent,itone,i3,n3,iflag) + i0=1 + jj=0 + do kk=1,85 + if(kk.eq.isync(i0)) then + i0=i0+1 + cycle + endif + jj=jj+1 + codewords(jj,i)=itone(kk) - 1 + enddo +! write(71,3001) i,j,k,iflag,codewords(1:13,i),trim(msg) +!3001 format(4i3,2x,13i3,2x,a) enddo -! write(71,3001) i,j,k,codewords(1:13,i),trim(msg) -!3001 format(3i3,2x,13i3,2x,a) enddo enddo ncw=i diff --git a/lib/qra/q65/q65_workspace.f90 b/lib/qra/q65/q65_workspace.f90 new file mode 100644 index 00000000..321bdfd4 --- /dev/null +++ b/lib/qra/q65/q65_workspace.f90 @@ -0,0 +1,43 @@ +module q65_workspace + + implicit none + + integer, parameter :: Q65_NN=63 + integer, parameter :: Q65_MAXFFT=20736 + + type :: q65_workspace_type + complex, allocatable :: c0(:) + real, allocatable :: s3(:) + complex, allocatable :: cs(:) + contains + procedure :: ensure => ensure_q65_workspace + end type q65_workspace_type + +contains + + subroutine ensure_q65_workspace(this,npts2,ll) + class(q65_workspace_type), intent(inout) :: this + integer, intent(in) :: npts2,ll + integer n3 + + ! Keep the largest capacity so repeated searches do not churn the allocator. + n3=ll*Q65_NN + + if(.not.allocated(this%c0)) then + allocate(this%c0(0:npts2-1)) + else if(size(this%c0).lt.npts2) then + deallocate(this%c0) + allocate(this%c0(0:npts2-1)) + endif + + if(.not.allocated(this%s3)) then + allocate(this%s3(1:n3)) + else if(size(this%s3).lt.n3) then + deallocate(this%s3) + allocate(this%s3(1:n3)) + endif + + if(.not.allocated(this%cs)) allocate(this%cs(0:Q65_MAXFFT-1)) + end subroutine ensure_q65_workspace + +end module q65_workspace diff --git a/lib/qra/q65/q65code.f90 b/lib/qra/q65/q65code.f90 index d61cba91..f4a94d00 100644 --- a/lib/qra/q65/q65code.f90 +++ b/lib/qra/q65/q65code.f90 @@ -2,9 +2,11 @@ program q65code use q65_encoding implicit none - character*37 msg37 + character*37 msg37,msgsent integer nargs integer codeword(65),tones(85) + integer iargc + logical success nargs=iargc() if(nargs .ne. 1) then @@ -13,8 +15,13 @@ program q65code endif call getarg(1,msg37) - call get_q65_tones(msg37,codeword,tones) + call get_q65_tones(msg37,codeword,tones,msgsent,success) + if(.not.success) then + print*,'Cannot encode message: ',trim(msg37) + stop 1 + endif + write(*,*) 'Message sent: ',trim(msgsent) write(*,*) 'Generated message plus CRC (90 bits)' write(*,'(a8,15i4)') '6 bit : ',codeword(1:15) write(*,'(a8,15b6.6)') 'binary: ',codeword(1:15) diff --git a/lib/qra/q65/q65sim.f90 b/lib/qra/q65/q65sim.f90 index 827cf55c..53d6ca84 100644 --- a/lib/qra/q65/q65sim.f90 +++ b/lib/qra/q65/q65sim.f90 @@ -23,8 +23,8 @@ program q65sim character*37 msg,msgsent,imsg(10) nargs=iargc() - if(nargs.ne.11) then - print*,'Usage: q65sim "msg" A-F freq fDop DT f1 Stp TRp Nsig Nfile SNR' + if(nargs.ne.11 .and. nargs.ne.12) then + print*,'Usage: q65sim "msg" A-F freq fDop DT f1 Stp TRp Nsig Nfile SNR [Flag]' print*,'Example: q65sim "K1ABC W9XYZ EN37" A 1500 0.0 0.0 0.0 1 60 1 1 -26' print*,'Example: q65sim "ST" A 1500 0.0 0.0 0.0 1 60 1 -26' print*,' fDop = Doppler spread' @@ -32,6 +32,7 @@ program q65sim print*,' Stp = Step size (Hz)' print*,' Stp = 0 implies no Doppler tracking' print*,' Nsig = number of generated signals, 1 - 10' + print*,' Flag = optional, sets the spare 78th bit (0 or 1); default 0' print*,' Creates filenames which increment to permit averaging in first period' print*,' If msg = ST program produces a single tone at freq' go to 999 @@ -57,6 +58,11 @@ program q65sim read(arg,*) nfiles call getarg(11,arg) read(arg,*) snrdb + iflag=0 + if(nargs.eq.12) then + call getarg(12,arg) + read(arg,*) iflag + endif if(ntrperiod.eq.15) then nsps=1800 @@ -97,7 +103,7 @@ program q65sim ichk=0 do i=1,nsig msg=imsg(i) - call genq65(msg,ichk,msgsent,itone,i3,n3) + call genq65(msg,ichk,msgsent,itone,i3,n3,iflag) ntone(:,i)=itone enddo @@ -135,7 +141,7 @@ program q65sim 1106 format('000000_',i4.4,'.wav') endif - open(10,file=trim(fname),access='stream',status='unknown') + open(10,file=trim(fname),access='stream',status='replace') xnoise=0. if(snrdb.lt.90) then do i=1,npts diff --git a/lib/qso50/g0 b/lib/qso50/g0 index a19d872a..50fff694 100644 --- a/lib/qso50/g0 +++ b/lib/qso50/g0 @@ -4,5 +4,5 @@ gfortran -o twq -Wall -Wno-conversion -fbounds-check twq.f90 \ unpacktext2.f90 unpackpfx.f90 pack50.f90 unpack50.f90 \ ../hash.f90 ../deg2grid.f90 ../grid2deg.f90 \ ../fix_contest_msg.f90 ../to_contest_msg.f90 \ - ../fmtmsg.f90 ../azdist.f90 ../geodist.f90 ../wsprd/nhash.c - \ No newline at end of file + ../fmtmsg.f90 ../azdist.f90 ../geodist.f90 ../wsprd/nhash.c \ + ../lookup3.c diff --git a/lib/readwav.f90 b/lib/readwav.f90 index 25369049..506bf3a9 100644 --- a/lib/readwav.f90 +++ b/lib/readwav.f90 @@ -17,6 +17,7 @@ ! end do ! module readwav + use, intrinsic :: iso_fortran_env, only: int64 implicit none type format_chunk @@ -32,13 +33,15 @@ module readwav integer :: lun type(format_chunk) :: audio_format integer :: data_size + integer :: data_bytes_remaining contains procedure :: read + procedure :: read_samples end type wav_header private contains - subroutine read (this, filename) + subroutine read (this, filename, status, message) implicit none type riff_descriptor @@ -48,26 +51,147 @@ contains class(wav_header), intent(inout) :: this character(len=*), intent(in) :: filename + integer, intent(out), optional :: status + character(len=*), intent(out), optional :: message - integer :: filepos + integer :: ios + integer(int64) :: filepos, filesize, data_end, nextpos, padded_size type(riff_descriptor) :: desc character(len=4) :: riff_type + logical :: format_found this%lun=26 - open (unit=this%lun, file=filename, access='stream',status='old') - read (unit=this%lun) desc,riff_type + this%data_size = 0 + this%data_bytes_remaining = 0 + this%audio_format = format_chunk(0, 0, 0, 0, 0, 0) + format_found = .false. + call set_result(0, '') + + open (unit=this%lun, file=filename, access='stream', form='unformatted', & + status='old', action='read', iostat=ios) + if (ios /= 0) then + call fail('cannot open file') + return + end if + inquire (unit=this%lun, size=filesize) + if (filesize < 12) then + call fail('file is too short for a RIFF/WAVE header') + return + end if + + read (unit=this%lun, iostat=ios) desc, riff_type + if (ios /= 0) then + call fail('cannot read RIFF/WAVE header') + return + end if + if (desc%id /= 'RIFF' .or. riff_type /= 'WAVE') then + call fail('not a RIFF/WAVE file') + return + end if inquire (unit=this%lun, pos=filepos) do - read (unit=this%lun, pos=filepos) desc + if (filepos + 8_int64 > filesize + 1_int64) then + call fail('missing data chunk') + return + end if + read (unit=this%lun, pos=filepos, iostat=ios) desc + if (ios /= 0) then + call fail('cannot read WAV chunk header') + return + end if inquire (unit=this%lun, pos=filepos) + if (desc%size < 0) then + call fail('WAV chunk has an invalid size') + return + end if + data_end = filepos + int(desc%size, int64) + if (data_end > filesize + 1_int64) then + call fail('WAV chunk extends beyond end of file') + return + end if + padded_size = int(desc%size, int64) + if (mod(padded_size, 2_int64) /= 0) padded_size = padded_size + 1_int64 + nextpos = filepos + padded_size if (desc%id .eq. 'fmt ') then - read (unit=this%lun) this%audio_format + if (desc%size < 16) then + call fail('fmt chunk is too short') + return + end if + read (unit=this%lun, iostat=ios) this%audio_format + if (ios /= 0) then + call fail('cannot read fmt chunk') + return + end if + if (this%audio_format%audio_format /= 1 .or. & + this%audio_format%num_channels /= 1 .or. & + this%audio_format%bits_per_sample /= 16) then + call fail('unsupported WAV format; expected mono 16-bit PCM') + return + end if + if (this%audio_format%sample_rate /= 11025 .and. & + this%audio_format%sample_rate /= 12000) then + call fail('unsupported WAV sample rate') + return + end if + format_found = .true. else if (desc%id .eq. 'data') then + if (.not. format_found) then + call fail('data chunk appears before fmt chunk') + return + end if this%data_size = desc%size - exit + this%data_bytes_remaining = desc%size + call set_result(0, '') + return + end if + if (nextpos > filesize + 1_int64) then + call fail('WAV chunk extends beyond end of file') + return end if - filepos = filepos + (desc%size + 1) / 2 * 2 ! pad to even alignment + filepos = nextpos end do - return + + contains + + subroutine fail(text) + character(len=*), intent(in) :: text + + close(unit=this%lun, iostat=ios) + this%lun = -1 + call set_result(1, text) + end subroutine fail + + subroutine set_result(code, text) + integer, intent(in) :: code + character(len=*), intent(in) :: text + + if (present(status)) status = code + if (present(message)) message = text + end subroutine set_result end subroutine read + + subroutine read_samples(this, samples, samples_read, status, message) + class(wav_header), intent(inout) :: this + integer*2, intent(out) :: samples(:) + integer, intent(out) :: samples_read + integer, intent(out), optional :: status + character(len=*), intent(out), optional :: message + + integer :: ios + + samples = 0 + samples_read = min(size(samples), this%data_bytes_remaining / 2) + if (present(status)) status = 0 + if (present(message)) message = '' + if (samples_read == 0) return + + read(unit=this%lun, iostat=ios) samples(:samples_read) + if (ios /= 0) then + samples_read = 0 + if (present(status)) status = 1 + if (present(message)) message = 'cannot read WAV sample data' + return + end if + this%data_bytes_remaining = this%data_bytes_remaining - 2 * samples_read + end subroutine read_samples end module readwav diff --git a/lib/refspectrum.f90 b/lib/refspectrum.f90 index 862d38f0..01a79ab0 100644 --- a/lib/refspectrum.f90 +++ b/lib/refspectrum.f90 @@ -1,11 +1,14 @@ -subroutine refspectrum(id2,bclear,brefspec,buseref,fname) +subroutine refspectrum(id2,ninput,bclear,brefspec,buseref,fname) ! Input: ! id2 i*2 Raw 16-bit integer data, 12000 Hz sample rate +! ninput Valid input count, 1..3456; zero resets stream history ! brefspec logical True when accumulating a reference spectrum parameter (NFFT=6912,NH=NFFT/2,NPOLYLOW=400,NPOLYHIGH=2600) integer*2 id2(NFFT) + integer*2 measurement(NH) + integer ninput,nmeasurement,offset,ncopy logical*1 bclear,brefspec,buseref,blastuse real xs(0:NH-1) !Saved upper half of input chunk convolved with h(t) @@ -30,6 +33,7 @@ subroutine refspectrum(id2,bclear,brefspec,buseref,fname) w(i)=ww*ww/NFFT enddo nsave=0 + nmeasurement=0 s=0.0 filter=1.0 xs=0. @@ -43,11 +47,27 @@ subroutine refspectrum(id2,bclear,brefspec,buseref,fname) cfil=0.0 xs=0.0 nsave=0 + nmeasurement=0 blastuse=.false. endif + if(ninput.lt.0.or.ninput.gt.NH) return + if(ninput.eq.0) then + xs=0.0 + nmeasurement=0 + if(.not.buseref) blastuse=.false. + return + endif if(brefspec) then - x(0:NH-1)=0.001*id2(1:NH) + offset=0 + do while(offset.lt.ninput) + ncopy=min(NH-nmeasurement,ninput-offset) + measurement(nmeasurement+1:nmeasurement+ncopy)=id2(offset+1:offset+ncopy) + offset=offset+ncopy + nmeasurement=nmeasurement+ncopy + if(nmeasurement.lt.NH) cycle + nmeasurement=0 + x(0:NH-1)=0.001*measurement x(NH:NFFT-1)=0.0 call four2a(cx,NFFT,1,-1,0) !r2c FFT @@ -127,6 +147,7 @@ subroutine refspectrum(id2,bclear,brefspec,buseref,fname) enddo close(16) endif + enddo return endif @@ -145,21 +166,23 @@ subroutine refspectrum(id2,bclear,brefspec,buseref,fname) cx(1:NH)=fil(1:NH)/NFFT call four2a(cx,NFFT,1,1,-1) x=cshift(x,-400) - x(800:NH)=0.0 +! Retain only the causal 800-tap response. Leaving the negative-time tail +! near NFFT produces circular wraparound that depends on input chunk size. + x(800:NFFT-1)=0.0 call four2a(cx,NFFT,1,-1,0) cfil=cx close(16) endif ! Use overlap and add method to apply causal reference filter. - x(0:NH-1)=id2(1:NH) - x(NH:NFFT-1)=0.0 + x(0:ninput-1)=id2(1:ninput) + x(ninput:NFFT-1)=0.0 x=x/NFFT call four2a(cx,NFFT,1,-1,0) cx=cfil*cx call four2a(cx,NFFT,1,1,-1) x(0:NH-1)=x(0:NH-1)+xs - xs=x(NH:NFFT-1) - id2(1:NH)=nint(x(0:NH-1)) + xs=x(ninput:ninput+NH-1) + id2(1:ninput)=nint(x(0:ninput-1)) endif blastuse=buseref diff --git a/lib/rig_control.c b/lib/rig_control.c index 7c8b2f62..96cd49ca 100644 --- a/lib/rig_control.c +++ b/lib/rig_control.c @@ -3,6 +3,9 @@ #include #include #include "tstrig.h" +#ifndef HAMLIB_RIGPORT +#include +#endif RIG *my_rig; // handle to rig @@ -60,10 +63,10 @@ int rigOpen(int verbose, rig_model_t my_model, const char* rig_file, } if (rig_file) - strncpy(my_rig->state.rigport.pathname, rig_file, FILPATHLEN - 1); + strncpy(HAMLIB_RIGPORT(my_rig)->pathname, rig_file, HAMLIB_FILPATHLEN - 1); if (serial_rate!=0) - my_rig->state.rigport.parm.serial.rate = serial_rate; + HAMLIB_RIGPORT(my_rig)->parm.serial.rate = serial_rate; if (civaddr) rig_set_conf(my_rig, rig_token_lookup(my_rig, "civaddr"), civaddr); diff --git a/lib/rtty_spec.f90 b/lib/rtty_spec.f90 index 2ddc802f..6b109665 100644 --- a/lib/rtty_spec.f90 +++ b/lib/rtty_spec.f90 @@ -95,7 +95,7 @@ program rtty_spec h=default_header(12000,NMAX) datmax=maxval(abs(dat)) iwave=nint(32767.0*dat/datmax) - open(10,file='000000_000001.wav',access='stream',status='unknown') + open(10,file='000000_000001.wav',access='stream',status='replace') write(10) h,iwave close(10) diff --git a/lib/save_dxbase.f90 b/lib/save_dxbase.f90 deleted file mode 100644 index 206dfd5e..00000000 --- a/lib/save_dxbase.f90 +++ /dev/null @@ -1,9 +0,0 @@ -subroutine save_dxbase(dxbase0) - - use packjt77 - character*6 dxbase0 - - dxbase=dxbase0 - - return -end subroutine save_dxbase diff --git a/lib/savec2.f90 b/lib/savec2.f90 index 6435a215..b3862186 100644 --- a/lib/savec2.f90 +++ b/lib/savec2.f90 @@ -2,27 +2,27 @@ integer function savec2(c2name,ntrseconds,f0m1500) ! Array c0() has complex samples at 1500 Hz sample rate. ! WSPR-2: downsample by 1/4 to produce c2, centered at 1500 Hz -! WSPR-15: downsample by 1/32 to produce c2, centered at 1612.5 Hz parameter (NDMAX=120*1500) !Sample intervals at 1500 Hz rate - parameter (MAXFFT=256*1024) character*(*) c2name character*14 outfile real*8 f0m1500 complex c0 - complex c1(0:MAXFFT-1) - complex c2(0:65535) + ! Keep FFT buffers at a stable address so four2a can reuse its plans. + complex, allocatable, save :: c1(:),c2(:) common/c0com/c0(0:NDMAX-1) - ntrminutes=ntrseconds/60 + if(ntrseconds.ne.120) then + savec2=-1 + return + endif + + ntrminutes=2 npts=114*1500 nfft1=262144 - if(ntrminutes.eq.15) then - npts=890*1500 - nfft1=MAXFFT - endif - df1=1500.0/nfft1 + nfft2=65536 + if(.not.allocated(c1)) allocate(c1(0:nfft1-1),c2(0:nfft2-1)) fac=1.0/nfft1 c1(0:npts-1)=fac*c0(0:npts-1) c1(npts:nfft1-1)=0. @@ -30,23 +30,16 @@ integer function savec2(c2name,ntrseconds,f0m1500) call four2a(c1,nfft1,1,1,1) !Complex FFT to frequency domain ! Select the desired frequency range - nfft2=65536 nh2=nfft2/2 - if(ntrminutes.eq.2) then - c2(0:nh2)=c1(0:nh2) - c2(nh2+1:nfft2-1)=c1(nfft1-nh2+1:nfft1-1) - else - i0=nint(112.5/df1) - c2(0:nh2)=c1(i0:i0+nh2) - c2(nh2+1:nfft2-1)=c1(i0-nh2+1:i0-1) - endif + c2(0:nh2)=c1(0:nh2) + c2(nh2+1:nfft2-1)=c1(nfft1-nh2+1:nfft1-1) call four2a(c2,nfft2,1,-1,1) !Shorter complex FFT, back to time domain ! Write complex time-domain data to disk. i1=index(c2name,'.c2') outfile=c2name(i1-11:i1+2) - open(18,file=c2name,status='unknown',access='stream', iostat=ioerr) + open(18,file=c2name,status='replace',access='stream', iostat=ioerr) if (ioerr.eq.0) then write(18) outfile,ntrminutes,f0m1500,c2(0:45000-1) close(18) diff --git a/lib/sec_midn.f90 b/lib/sec_midn.f90 index 0bbe62c2..03d175d5 100644 --- a/lib/sec_midn.f90 +++ b/lib/sec_midn.f90 @@ -4,8 +4,7 @@ real function sec_midn() end function sec_midn subroutine sleep_msec(n) - - call usleep(1000*n) - + use, intrinsic :: iso_fortran_env, only: INT64 + call usleep(int(1000*n, kind=INT64)) return end subroutine sleep_msec diff --git a/lib/sh65.f90 b/lib/sh65.f90 index 09bef9c2..7d1efc3d 100644 --- a/lib/sh65.f90 +++ b/lib/sh65.f90 @@ -6,6 +6,7 @@ subroutine sh65(cx,n5,mode65,ntol,xdf,nspecial,snrdb) real ss(-NH+1:NH,16) real sigmax(16) integer ipk(16) + save ss ss=0. @@ -47,6 +48,7 @@ subroutine sh65(cx,n5,mode65,ntol,xdf,nspecial,snrdb) ib2=min(NH,nint(fb/df + 4.1*nfac)) ! Find strongest line in each of the 16 phases + snr1=0. sbest=0. snrbest=0. nbest=1 diff --git a/lib/shmem.cpp b/lib/shmem.cpp index 95a86614..7d1783d6 100644 --- a/lib/shmem.cpp +++ b/lib/shmem.cpp @@ -14,7 +14,5 @@ extern "C" bool shmem_attach () {return shmem.attach();} int shmem_size () {return static_cast (shmem.size());} struct jt9com * shmem_address () {return reinterpret_cast(shmem.data());} - bool shmem_lock () {return shmem.lock();} - bool shmem_unlock () {return shmem.unlock();} bool shmem_detach () {return shmem.detach();} } diff --git a/lib/shmem.f90 b/lib/shmem.f90 index 8d9db7d6..853f67e9 100644 --- a/lib/shmem.f90 +++ b/lib/shmem.f90 @@ -27,16 +27,6 @@ module shmem integer(c_int) :: shmem_size end function shmem_size - function shmem_lock () bind(C, name="shmem_lock") - use iso_c_binding, only: c_bool - logical(c_bool) :: shmem_lock - end function shmem_lock - - function shmem_unlock () bind(C, name="shmem_unlock") - use iso_c_binding, only: c_bool - logical(c_bool) :: shmem_unlock - end function shmem_unlock - function shmem_detach () bind(C, name="shmem_detach") use iso_c_binding, only: c_bool logical(c_bool) :: shmem_detach diff --git a/lib/sleep_msec.f90 b/lib/sleep_msec.f90 index 1a8dbe4f..1c15053e 100644 --- a/lib/sleep_msec.f90 +++ b/lib/sleep_msec.f90 @@ -1,4 +1,5 @@ subroutine sleep_msec(n) - call usleep(n*1000) + use, intrinsic :: iso_fortran_env, only: INT64 + call usleep(INT(n*1000, kind=INT64)) return end subroutine sleep_msec diff --git a/lib/spec64.f90 b/lib/spec64.f90 index 9e0d708d..1fd732bb 100644 --- a/lib/spec64.f90 +++ b/lib/spec64.f90 @@ -1,10 +1,12 @@ -subroutine spec64(c0,npts,nsps,mode_q65,jpk,s3,LL,NN) +subroutine spec64(c0,cs,npts,nsps,mode_q65,jpk,s3,LL,NN) + + use q65_workspace, only: Q65_MAXFFT - parameter (MAXFFT=20736) complex c0(0:npts-1) !Complex spectrum of dd() - complex cs(0:MAXFFT-1) !Complex symbol spectrum + complex cs(0:Q65_MAXFFT-1) !Complex symbol spectrum real s3(LL,NN) !Synchronized symbol spectra real xbase0(LL),xbase(LL) + real s3_row(NN) ! integer ipk1(1) integer isync(22) !Indices of sync symbols data isync/1,9,12,13,15,22,23,26,27,33,35,38,46,50,55,60,62,66,69,74,76,85/ @@ -36,7 +38,8 @@ subroutine spec64(c0,npts,nsps,mode_q65,jpk,s3,LL,NN) df=6000.0/nfft do i=1,LL - call pctile(s3(i,1:NN),NN,45,xbase0(i)) !Get baseline for passband shape + s3_row=s3(i,1:NN) + call pctile(s3_row,NN,45,xbase0(i)) !Get baseline for passband shape enddo nh=25 diff --git a/lib/spec_qra65.f90 b/lib/spec_qra65.f90 index 15e8fd09..575d5050 100644 --- a/lib/spec_qra65.f90 +++ b/lib/spec_qra65.f90 @@ -6,6 +6,7 @@ subroutine spec_qra65(c0,nsps,s3,LL,NN) complex, allocatable :: cs(:) !Complex symbol spectrum real s3(LL,NN) !Synchronized symbol spectra real xbase0(LL),xbase(LL) !Work arrays + real s3_row(NN) integer isync(22) !Indices of sync symbols data isync/1,9,12,13,15,22,23,26,27,33,35,38,46,50,55,60,62,66,69,74,76,85/ @@ -32,7 +33,8 @@ subroutine spec_qra65(c0,nsps,s3,LL,NN) df=6000.0/nsps do i=1,LL - call pctile(s3(i,1:NN),NN,45,xbase0(i)) !Get baseline for passband shape + s3_row=s3(i,1:NN) + call pctile(s3_row,NN,45,xbase0(i)) !Get baseline for passband shape enddo nh=9 diff --git a/lib/stdmsg.f90 b/lib/stdmsg.f90 index b4f41040..323b3c47 100644 --- a/lib/stdmsg.f90 +++ b/lib/stdmsg.f90 @@ -41,3 +41,37 @@ function stdmsg(msg0) return end function stdmsg + +function stdmsg72(msg0,is_jt65) + + use iso_c_binding, only: c_bool + use packjt, only: packmsg, unpackmsg + + implicit none + + character(len=37), intent(in) :: msg0 + logical(c_bool), intent(in) :: is_jt65 + logical(c_bool) :: stdmsg72 + character(len=22) :: msg72,decoded72 + integer :: dat(12),itype,n + + stdmsg72=.false. + msg72=msg0(1:22) + + if(msg0(23:24).eq.' d' .and. msg72(22:22).eq.'?') msg72(22:22)=' ' + + if(is_jt65) then + n=len_trim(msg72) + if(n.ge.4) then + if(msg72(n-3:n).eq.' OOO') msg72(n-3:)=' ' + endif + endif + + call packmsg(msg72,dat,itype) + if(itype.lt.1 .or. itype.gt.5) return + + call unpackmsg(dat,decoded72) + stdmsg72=(decoded72.eq.msg72) + + return +end function stdmsg72 diff --git a/lib/stream_setmode.c b/lib/stream_setmode.c new file mode 100644 index 00000000..f70b29e7 --- /dev/null +++ b/lib/stream_setmode.c @@ -0,0 +1,24 @@ +/* stream_setmode.c — put stdin into binary mode on Windows. + * + * jt9 --stream / jt9stream read a framed binary byte stream (PCM audio + + * control frames) from stdin. On Windows, stdin defaults to text mode, which + * translates CR/LF and stops at a 0x1A (^Z) byte — both corrupt binary data. + * This helper forces binary mode once, before the stream is opened. + * + * On POSIX (Linux, macOS) there is no text/binary distinction for stdin, so + * this compiles to a no-op. Called via a bind(C) interface from + * lib/streaming_io.f90. C linkage gives the exact symbol name (no Fortran + * trailing-underscore mangling), matched by bind(C, name="..."). + */ +#ifdef _WIN32 +#include +#include +#include +#endif + +void stream_set_stdin_binary(void) +{ +#ifdef _WIN32 + _setmode(_fileno(stdin), _O_BINARY); +#endif +} diff --git a/lib/stream_stdin.c b/lib/stream_stdin.c new file mode 100644 index 00000000..b3f09025 --- /dev/null +++ b/lib/stream_stdin.c @@ -0,0 +1,49 @@ +/* stream_stdin.c — portable read-fully helper for the framed stdin + * protocol (lib/streaming_io.f90). + * + * Fortran unit I/O cannot read a redirected stdin portably: native + * Windows has no /dev/stdin, and re-OPENing the preconnected unit 5 with + * ACCESS='STREAM' is non-conforming (F2018 12.5.6.1 — ACCESS is not a + * changeable mode of a connected unit), so libgfortran rejects it on + * every platform. This helper reads file descriptor 0 directly instead, + * and is used on ALL platforms — one code path, exercised by the POSIX + * fixtures suites, no #ifdef branch that CI never runs. + * + * The loop retries until the full request is delivered or the stream + * truly ends (read() == 0, or a hard error). A pipe short-read — which + * a small fast producer can trigger, and which Fortran stream input + * surfaces as an I/O error — therefore can never be mistaken for EOF: + * a short return here means the producer closed the pipe. + * + * Windows: binary mode must be forced on fd 0 before the first read + * (stream_set_stdin_binary in lib/stream_setmode.c, called from + * jt9_stream's setup) or the CRT stops at 0x1A and rewrites CRLF; + * _read() honors that mode. Called via bind(C) from Fortran. + */ +#include + +#ifdef _WIN32 +#include +#else +#include +#include +#endif + +int64_t stream_stdin_read_fully(void *buf, int64_t n) +{ + char *p = (char *) buf; + int64_t total = 0; + while (total < n) { + int64_t want = n - total; + if (want > ((int64_t) 1 << 20)) want = (int64_t) 1 << 20; +#ifdef _WIN32 + int r = _read(0, p + total, (unsigned int) want); +#else + ssize_t r = read(0, p + total, (size_t) want); + if (r < 0 && errno == EINTR) continue; +#endif + if (r <= 0) break; + total += (int64_t) r; + } + return total; +} diff --git a/lib/streaming_apply.f90 b/lib/streaming_apply.f90 new file mode 100644 index 00000000..72feda74 --- /dev/null +++ b/lib/streaming_apply.f90 @@ -0,0 +1,328 @@ +! Streaming apply — configure_fields -> params_block mapping. +! +! Extracted from streaming_io.f90's former nested-internal apply_configure_ +! so the cfg->params apply ROUTING is unit-testable. The +! routing was previously unreachable (a nested internal sub of jt9_stream) and +! inert on the FT8/JT9 fixtures, so a mis-route (e.g. his_call -> hisgrid) +! passed every fixture gate byte-identical. This module makes the +! mapping a module-public procedure that a standalone driver can call against a +! bare params_block — see test/apply_routing_test.f90. +! +! This is a behavior-preserving relocation: the body below is the verbatim +! apply_configure_ body (sd%params -> params, the two host-associated baselines +! now explicit dummy args). The order-sensitive logic (rxfreq decouple, +! apply_per_mode_policy call + emedelay-before-policy, nfa/nfb baseline restore, +! ntol per-mode cap) keeps its original position, so behavior is identical. +! +! Dependencies (all acyclic — neither dependee uses this module): +! streaming_control -> configure_fields (the source struct) +! jt9_params_init -> apply_per_mode_policy +! include jt9com.f90 -> params_block (+ iso_c_binding / constants.f90) + +module streaming_apply + use streaming_control, only: configure_fields, NPTS_C0_ARRAY_MIN, & + NPTS_C0_ARRAY_MAX + use jt9_params_init, only: apply_per_mode_policy + + include 'jt9com.f90' + + private + public :: apply_configure_fields + ! Re-export the include'd struct so a standalone unit driver can declare a + ! params_block to assert apply routing against (test/apply_routing_test.f90) + ! without itself including jt9com.f90. Same bind(C) type as everywhere else + ! (F2018 §7.5.2.4 same-type rule), so it argument-associates with the + ! jt9_params_init init routines exactly as streaming_io's include'd one does. + public :: params_block + +contains + + ! Apply a configure frame's set fields to a params_block + the caller's + ! mode/TRperiod state. baseline_nfa/baseline_nfb are the session-baseline + ! nfa/nfb (stashed by the caller at stream start) restored on mode change + ! when the consumer didn't explicit-set them this frame. + subroutine apply_configure_fields(in_cfg, io_mode, io_TRperiod, params, & + baseline_nfa, baseline_nfb) + type(configure_fields), intent(in) :: in_cfg + integer, intent(inout) :: io_mode + real(8), intent(inout) :: io_TRperiod + type(params_block), intent(inout) :: params + integer, intent(in) :: baseline_nfa, baseline_nfb + if (in_cfg%mode_set) then + io_mode = in_cfg%mode + params%nmode = in_cfg%mode + ! Default TRperiod for the new mode if no explicit trperiod follows. + if (.not. in_cfg%trperiod_set) then + select case (in_cfg%mode) + case (8); io_TRperiod = 15.d0 + case (5); io_TRperiod = 7.5d0 + case (144); io_TRperiod = 30.d0 + case default; io_TRperiod = 60.d0 + end select + params%ntr = int(io_TRperiod) + end if + end if + if (in_cfg%trperiod_set) then + io_TRperiod = in_cfg%trperiod + params%ntr = int(io_TRperiod) + end if + if (in_cfg%depth_set) params%ndepth = in_cfg%depth + if (in_cfg%submode_set) params%nsubmode = in_cfg%submode + if (in_cfg%rxfreq_set) then + params%nfqso = in_cfg%rxfreq + params%nftx = in_cfg%rxfreq + end if + if (in_cfg%mycall_set) params%mycall = transfer(in_cfg%mycall, params%mycall) + if (in_cfg%mygrid_set) params%mygrid = transfer(in_cfg%mygrid, params%mygrid) + + ! ===== Phase 4: operator identity fields (RFC v1 §2) ==================== + ! char12/char6 via transfer() like mycall/mygrid (§4 — a width mismatch + ! silently truncates/pads at the bind(C) boundary, so the configure_fields + ! widths match the struct). Bools assign directly (logical -> logical(c_bool)). + if (in_cfg%his_call_set) params%hiscall = transfer(in_cfg%his_call, params%hiscall) + if (in_cfg%his_grid_set) params%hisgrid = transfer(in_cfg%his_grid, params%hisgrid) + if (in_cfg%my_b_call_set) params%mybcall = transfer(in_cfg%my_b_call, params%mybcall) + if (in_cfg%his_b_call_set) params%hisbcall = transfer(in_cfg%his_b_call, params%hisbcall) + if (in_cfg%my_call_standard_set) params%lmycallstd = in_cfg%my_call_standard + if (in_cfg%his_call_standard_set) params%lhiscallstd = in_cfg%his_call_standard + + ! Phase 4: frequency-window ints. tx_audio_offset_hz -> nftx applies AFTER + ! the rxfreq block above so it DECOUPLES the tx side: rxfreq set both + ! nfqso+nftx, and a co-present tx_audio_offset_hz then overrides nftx only. + ! jt65_jt9_split_hz -> nfsplit (honored as written; a bare + ! mid-stream mode switch does not auto-replay init-time fsplit). max_drift_hz + ! -> max_drift (Q65 drift search; inert for FT8/JT9, so no decode-output + ! fixture — verified at parse-unit + no-regression, like the other §4 fields). + if (in_cfg%tx_audio_offset_hz_set) params%nftx = in_cfg%tx_audio_offset_hz + if (in_cfg%jt65_jt9_split_hz_set) params%nfsplit = in_cfg%jt65_jt9_split_hz + if (in_cfg%max_drift_hz_set) params%max_drift = in_cfg%max_drift_hz + + ! ===== Phase 5: decoder-tuning basic fields (RFC v1 §2) ================= + ! Flat 1:1. dt_tolerance_seconds/eme_delay_seconds narrow real(8) -> + ! real(c_float) via the target's kind() (§4 — document the narrowing). + ! eme_delay_seconds is applied HERE, before the apply_per_mode_policy + ! call below: a frame that ALSO sets mode/trperiod re-runs that policy, which + ! OVERWRITES emedelay (0.0 non-Q65-60s, 2.5 Q65-60s) — so a producer + ! eme_delay_seconds survives only on a frame with NO mode/trperiod change + ! (matches RFC §2.4). kin_samples/nzhsym_per_period are honored at apply, but + ! the streaming period-prep block (~:331/:339) RECOMPUTES kin/nzhsym from the + ! accumulated sample count before each decode, so they are inert on this path + ! (documented; verified byte-identical). robust_mode/nagain_flag/ + ! clear_average -> logical(c_bool). tx_mode (enum) -> ntxmode (read only in + ! the 65+9 dual-decode dispatch; inert for FT8/pure-JT9 fixtures). + if (in_cfg%dt_tolerance_seconds_set) & + params%dttol = real(in_cfg%dt_tolerance_seconds, kind(params%dttol)) + if (in_cfg%eme_delay_seconds_set) & + params%emedelay = real(in_cfg%eme_delay_seconds, kind(params%emedelay)) + if (in_cfg%kin_samples_set) params%kin = in_cfg%kin_samples + if (in_cfg%nzhsym_per_period_set) params%nzhsym = in_cfg%nzhsym_per_period + if (in_cfg%npts_c0_array_set .and. & + in_cfg%npts_c0_array .ge. NPTS_C0_ARRAY_MIN .and. & + in_cfg%npts_c0_array .le. NPTS_C0_ARRAY_MAX) & + params%npts8 = in_cfg%npts_c0_array + if (in_cfg%min_width_set) params%minw = in_cfg%min_width + if (in_cfg%min_sync_set) params%minsync = in_cfg%min_sync + if (in_cfg%n_2pass_set) params%n2pass = in_cfg%n_2pass + if (in_cfg%robust_mode_set) params%nrobust = in_cfg%robust_mode + if (in_cfg%nagain_flag_set) params%nagain = in_cfg%nagain_flag + if (in_cfg%tx_mode_set) params%ntxmode = in_cfg%tx_mode + if (in_cfg%clear_average_set) params%nclearave = in_cfg%clear_average + + ! ===== Phase 6: FT8/FT4 specifics cluster (RFC v1 §2) =================== + ! Flat 1:1, no per-mode-policy interaction (none of these 24 are touched by + ! apply_per_mode_policy / the nfa-nfb-restore / ntol blocks below). 21 of 24 + ! are INERT on the jt9 --stream FT8/JT9 fixtures (read only inside the + ! multithreaded-FT8 block decoder.f90:192, which streaming forces off via + ! lmultift8=.false.; jt65_ap_on is JT65-only; superfox_mode/even_sequence are + ! superfox-path-only (ncontest==7 / sfrx_sub); ft8_decoder_start is non-stream + ! (WAV/shmem) path; hint_mode unread anywhere) — + ! parse-unit + apply-routing-unit + no-regression guard them. Only ft8_ap_on + ! -> lft8apon, ap_cq_only -> lapcqonly, ap_width_hz -> napwid reach the + ! single-pass FT8 decoder (decoder.f90:1141-1146), but they are EMPIRICALLY + ! inert on the FT8 fixture in the FLIP direction too (ft8_ap_on=false / AP off, + ! ap_cq_only=true, ap_width_hz=5000 each yield byte-identical 21 decodes vs + ! baseline across 6 clean paired trials — the fixture has no AP-only + ! decodes), so no decode-effect gate is possible. ap_width_hz stores the RAW + ! wire int (the decoder halves it at lib/ft8var/ft8bvar.f90:1040 for the lapmyc + ! AP path, §3 napwid note) — do NOT pre-scale here. nagain_filter/stop_hint/hint_mode + ! assign logical -> logical(c_bool) nagainfil/nstophint/nhint (n-prefix, but + ! bool-typed in the struct). + ! multithreaded_ft8: the receiver IGNORES a non-false value. + ! Streaming has NO multithreaded-FT8 support — lmultift8=.true. takes the + ! decoder.f90:192 multithread branch, which yields 0 FT8 decodes on the stream + ! path (deterministic: 0 vs a 21-decode baseline, every trial). + ! So apply ONLY a false value (a no-op given the init-forced false), keeping the + ! forced-false invariant; a true is dropped so a producer can never enable the + ! broken path. Re-enable a straight pass-through if/when multithread streaming + ! lands. (The other 23 keys are flat pass-throughs — inert on the FT8/JT9 + ! fixtures; verified byte-identical at probe values.) + if (in_cfg%multithreaded_ft8_set .and. .not. in_cfg%multithreaded_ft8) & + params%lmultift8 = .false. + if (in_cfg%ft8_cycles_set) params%nft8cycles = in_cfg%ft8_cycles + if (in_cfg%ft8_rxf_sensitivity_set) params%nft8rxfsens = in_cfg%ft8_rxf_sensitivity + if (in_cfg%ft8_threads_set) params%nmt = in_cfg%ft8_threads + if (in_cfg%ft8_decoder_start_set) params%ndecoderstart = in_cfg%ft8_decoder_start + if (in_cfg%ft8_low_threshold_set) params%lft8lowth = in_cfg%ft8_low_threshold + if (in_cfg%ft8_subpass_set) params%lft8subpass = in_cfg%ft8_subpass + if (in_cfg%ft8_ap_on_set) params%lft8apon = in_cfg%ft8_ap_on + if (in_cfg%ap_cq_only_set) params%lapcqonly = in_cfg%ap_cq_only + if (in_cfg%ap_my_call_set) params%lapmyc = in_cfg%ap_my_call + if (in_cfg%jt65_ap_on_set) params%ljt65apon = in_cfg%jt65_ap_on + if (in_cfg%ap_width_hz_set) params%napwid = in_cfg%ap_width_hz + if (in_cfg%hide_ft8_duplicates_set) params%lhideft8dupes = in_cfg%hide_ft8_duplicates + if (in_cfg%common_ft8b_set) params%lcommonft8b = in_cfg%common_ft8b + if (in_cfg%enable_dxc_search_set) params%lenabledxcsearch = in_cfg%enable_dxc_search + if (in_cfg%wide_dxc_search_set) params%lwidedxcsearch = in_cfg%wide_dxc_search + if (in_cfg%superfox_mode_set) params%b_superfox = in_cfg%superfox_mode + if (in_cfg%even_sequence_set) params%b_even_seq = in_cfg%even_sequence + if (in_cfg%hound_mode_set) params%lhound = in_cfg%hound_mode + if (in_cfg%multi_instance_set) params%lmultinst = in_cfg%multi_instance + if (in_cfg%skip_tx1_set) params%lskiptx1 = in_cfg%skip_tx1 + if (in_cfg%nagain_filter_set) params%nagainfil = in_cfg%nagain_filter + if (in_cfg%stop_hint_set) params%nstophint = in_cfg%stop_hint + if (in_cfg%hint_mode_set) params%nhint = in_cfg%hint_mode + + ! ===== Phase 7: diagnostic / sequencing fields (RFC v1 §2) ============== + ! No per-mode-policy interaction (none of these 6 are touched by + ! apply_per_mode_policy / the nfa-nfb-restore / ntol blocks below). 5 of the 6 + ! are flat pass-throughs and INERT on the jt9 --stream FT8/JT9 fixtures: + ! currently_txing/mode_changed/sec_band_changed/delay_units/ + ! last_tx_seconds_ago are read ONLY inside the multithreaded-FT8 block + ! (decoder.f90:192..1148, which streaming forces off via lmultift8=.false.), so + ! no decode-output gate is possible -> the parse-unit (run-phase7-parse-unit.sh) + ! + the apply-routing unit (run-apply-routing-unit.sh, sentinel-opposite slot + ! asserts) + no-regression are their coverage (like Phase 4). + ! currently_txing/mode_changed assign logical -> logical(c_bool) + ! ltxing/lmodechanged. OMITTED wire keys (utc_list*/nlist_count/datetime/ + ! from_wav_file/new_data_flag) are documented in streaming_control.f90. + ! + ! qso_progress_state -> nQSOProgress is the EXCEPTION: it reaches the + ! single-pass FT8 decoder (decoder.f90:1141), where ft8b.f90:274/299 use it as a + ! RAW index into nappasses(0:5) / naptypes(0:5,4) on the default + ! lft8apon=.true. / lapcqonly=.false. path. An out-of-range producer value + ! (<0 or >5) faults the decoder (an -fbounds-check abort -> a one-frame DoS; + ! silent memory corruption without the flag) -- a qso_progress_state=99 + ! crashes jt9 --stream. The valid range is [0,5] universally (every decoder + ! dimensions naptypes(0:5,4)/nappasses(0:5); QsoProgress.hpp defines the + ! C++ producer values as 0..5). So, exactly like the Phase 6 + ! multithreaded_ft8 guard + ! (the receiver IGNORES a value that would break the decode path), the apply + ! IGNORES an out-of-range value, keeping the safe default. Valid [0,5] pass + ! through UNCHANGED -> wire-parity preserved for every value the CLI -Q path + ! accepts (the CLI's identical out-of-range crash, jt9.f90:191, is a pre-existing + ! latent bug the streaming wire contract declines to inherit). On the FT8/JT9 + ! fixtures an in-range qso_progress_state is empirically INERT (it only steers AP + ! passes and the fixture has no AP-only decodes -> qso=5 gives a + ! byte-identical 21-decode set), so the in-range routing is guarded by the + ! apply-routing unit; a survival fixture guards the out-of-range case (negative-controlled). + if (in_cfg%last_tx_seconds_ago_set) params%nlasttx = in_cfg%last_tx_seconds_ago + if (in_cfg%currently_txing_set) params%ltxing = in_cfg%currently_txing + if (in_cfg%mode_changed_set) params%lmodechanged = in_cfg%mode_changed + if (in_cfg%qso_progress_state_set .and. in_cfg%qso_progress_state >= 0 & + .and. in_cfg%qso_progress_state <= 5) & + params%nQSOProgress = in_cfg%qso_progress_state + if (in_cfg%sec_band_changed_set) params%nsecbandchanged = in_cfg%sec_band_changed + if (in_cfg%delay_units_set) params%ndelay = in_cfg%delay_units + + ! ===== Phase 8: string & scaled / derived fields (RFC v1 §2/§6) ========= + ! No per-mode-policy interaction. The cfg members already hold the DERIVED + ! legacy ints (utc_nutc / date_yymmdd / n_trials_nranera — computed at parse, + ! streaming_control.f90), so date/n_trials are flat pass-throughs here; only + ! candthin_threshold/dt_center_seconds scale at apply (real(8) wire -> int /100, + ! §6.5). INERT on the FT8/JT9 stream fixtures except utc (read-site map+probe): + ! ncandthin/ndtcenter are read ONLY by the multithread FT8-variant decoder + ! my_ft8var%decodevar (every such call — first at decoder.f90:348 — scales /100 + ! into the variant sync thresholds sync8var.f90:17-18), and every such call lives + ! inside the if(lmultift8 .and. nmode==8) block (opens decoder.f90:192, else at + ! :1140) that streaming forces off — the single-pass FT8 decoder + ! (my_ft8%decode, :1141) is NOT passed them (probed inert: 5.0 / 2.0 s gave the + ! byte-identical 21-decode set). n_trials->nranera->ntrials is JT65-deep-search-only + ! (ntrials computed decoder.f90:143-145, consumed :1338/:1365, unused on FT8/JT9); + ! date->yymmdd is superfox-only (sfrx_sub.f90). So those four are guarded by + ! parse-unit + apply-routing-unit + no-regression; utc is decode-observable + ! (round-trip fixtures). NONE is an array index, so unlike qso_progress_state no + ! out-of-range apply guard is needed (read-site check: nranera<=18 + ! keeps 10**(nranera/2) within int32; ncandthin/ndtcenter become real thresholds). + if (in_cfg%date_set) params%yymmdd = in_cfg%date_yymmdd + if (in_cfg%n_trials_set) params%nranera = in_cfg%n_trials_nranera + if (in_cfg%candthin_threshold_set) & + params%ncandthin = nint(in_cfg%candthin_threshold * 100.d0) + if (in_cfg%dt_center_seconds_set) & + params%ndtcenter = nint(in_cfg%dt_center_seconds * 100.d0) + + ! ===== Phase 9: bit-packed fields (RFC v1 §2.4/§2.5/§6.1/§6.2) =========== + ! ndepth_packed / nexp_decode_packed were computed at parse (pack_phase9_ in + ! streaming_control.f90) from the 9 unpacked keys, so apply is flat. The legacy + ! `depth` full-int routes to ndepth verbatim above (the depth_set line near the + ! top); a frame carrying BOTH depth and any unpacked ndepth key was declined at + ! parse (conflict configure_type_error), so the depth and ndepth_packed + ! assignments never both fire on an accepted frame. Only depth_level is + ! decode-observable on FT8/JT9 (the fixtures run at depth=3 -> ndepth=3; + ! depth_level=1 -> ndepth=1 changes the FT8 pass structure ft8_decode.f90:178/182 + ! and the JT9 iand(ndepth,7) tests jt9_decode.f90:88,92). The other 8 + ! unpacked keys reach Q65/JT65/FST4/JT4 or the contest branch only + ! (single_decode/vhf_features/noise_blanker never reach the single-pass FT8 + ! my_ft8%decode), so they are guarded by the parse-unit (the bit-pack) + this + ! routing (apply-routing-unit) + no-regression. No out-of-range apply guard is + ! needed: the pack already masks depth_level/q65_maxiters to their + ! bit widths and clamps the NB byte, and none reaches a raw array index. + if (in_cfg%ndepth_packed_set) params%ndepth = in_cfg%ndepth_packed + if (in_cfg%nexp_decode_packed_set) params%nexp_decode = in_cfg%nexp_decode_packed + + ! Decode-bandwidth fields. Apply BEFORE the per-mode + ! policy block so consumer values flow through the cap: FT8/FST4 use + ! min(ntol, cap) so a smaller consumer value wins; Q65 + JT65+JT9 hard- + ! override the consumer value (those modes have decoder-side invariants + ! tied to the per-mode ntol). nfa/nfb pass through unchanged. + if (in_cfg%ntol_set) params%ntol = in_cfg%ntol + if (in_cfg%nfa_set) params%nfa = in_cfg%nfa + if (in_cfg%nfb_set) params%nfb = in_cfg%nfb + + ! Per-period UTC. Producer sends a fresh nutc in each + ! period's configure frame so streaming_emit_decode can format the time + ! field correctly (instead of "000000"). + if (in_cfg%nutc_set) params%nutc = in_cfg%nutc + ! Phase 8 (RFC v1 §6.3/§4.1): utc (ISO "HH:MM:SS") is a SECOND route to nutc, + ! kept alongside the legacy int nutc above. Applied AFTER nutc so utc WINS when + ! a frame carries both (the richer ISO form). The apply order encodes the + ! precedence — it does NOT depend on the parse order. utc_nutc was derived from + ! the ISO string at parse (streaming_control.f90 parse_iso_time_). + if (in_cfg%utc_set) params%nutc = in_cfg%utc_nutc + + ! Re-apply per-mode policy whenever mode or trperiod changes. + if (in_cfg%mode_set .or. in_cfg%trperiod_set) then + ! Q65 60s emedelay (apply_per_mode_policy is emedelay-only). + call apply_per_mode_policy(params, io_mode, io_TRperiod) + + ! Restore session-baseline nfa/nfb on mode change + ! when consumer didn't explicit-set this frame. Mirrors WAV semantics + ! (each invocation starts from CLI defaults). + if (.not. in_cfg%nfa_set) params%nfa = baseline_nfa + if (.not. in_cfg%nfb_set) params%nfb = baseline_nfb + + ! ntol mode-change policy. The cap-vs-restore logic + ! differs from init-time (which always starts from CLI args), so the + ! ntol block lives here at config-time rather than in + ! apply_per_mode_policy. + if (.not. in_cfg%ntol_set) then + ! Restore per-mode default — NOT min()-clamping the carry-over. + select case (io_mode) + case (241, 242); params%ntol = 100 ! FST4/FST4W + case (65 + 9); params%ntol = 20 ! JT65+JT9 hard + case (66); params%ntol = 10 ! Q65 hard + case default; params%ntol = 1000 ! FT8/FT4/etc + end select + else + ! Consumer set explicit ntol — apply per-mode cap on the consumer + ! value. Q65 + JT65+JT9 always hard-override (decoder invariants). + select case (io_mode) + case (241, 242); params%ntol = min(params%ntol, 100) + case (66); params%ntol = 10 + case (65 + 9); params%ntol = 20 + case default; params%ntol = min(params%ntol, 1000) + end select + end if + end if + end subroutine apply_configure_fields + +end module streaming_apply diff --git a/lib/streaming_control.f90 b/lib/streaming_control.f90 new file mode 100644 index 00000000..a65915bd --- /dev/null +++ b/lib/streaming_control.f90 @@ -0,0 +1,1779 @@ +! Streaming control-frame parser. +! +! Parses control JSON frames received on stdin via the streaming +! framing. Two frame types are recognized today: +! +! {"t":"configure","mode":"FT8","depth":3,"rxfreq":1500, +! "mycall":"KJ5HST","mygrid":"EM18","trperiod":15} +! {"t":"halt"} +! +! Hand-rolled flat-JSON parser. Callers should treat unknown "t" values +! as forward-compat extensions (mirrors the consumer-ignores-unknown +! discipline from the ready handshake). +! +! Restrictions (deliberate scope): +! - Flat objects only; no nested objects, no arrays. +! - Numeric values must be plain decimal (no scientific notation). +! - String values must NOT contain escape sequences. Callsigns, grids, +! and mode names are alphanumeric ASCII per WSJT-X conventions, so +! this is a safe simplification today; it can be extended if needed. + +module streaming_control + use, intrinsic :: iso_fortran_env, only: error_unit + implicit none + private + + ! Action returned by parse_control_frame. + integer, parameter, public :: CTRL_UNKNOWN = 0 + integer, parameter, public :: CTRL_CONFIGURE = 1 + integer, parameter, public :: CTRL_HALT = 2 + integer, parameter, public :: CTRL_PARSE_ERR = 3 + ! downsam9 expands npts8 by 8 before filling its NFFT1 input buffer. + integer, parameter, public :: NPTS_C0_ARRAY_MIN = 1 + integer, parameter, public :: NPTS_C0_ARRAY_MAX = 81648 + + type, public :: configure_fields + ! Each "*_set" flag indicates whether the JSON contained that key. + ! Callers apply only the fields that were set so partial updates work. + logical :: mode_set = .false. + integer :: mode = 0 + logical :: mode_invalid = .false. + logical :: depth_set = .false. + integer :: depth = 0 + logical :: rxfreq_set = .false. + integer :: rxfreq = 0 + logical :: trperiod_set = .false. + real(8) :: trperiod = 0.d0 + logical :: submode_set = .false. + integer :: submode = 0 + logical :: mycall_set = .false. + character(len=12) :: mycall = ' ' + logical :: mygrid_set = .false. + character(len=6) :: mygrid = ' ' + ! Decode-bandwidth fields. Without these, the streaming + ! default ntol=20 confines decoding to ±20 Hz around audio offset 0, + ! missing the entire FT8 200-3000 Hz passband. Apply BEFORE the per-mode + ! policy block in apply_configure_fields so explicit values aren't capped by + ! min(ntol, 1000). + logical :: ntol_set = .false. + integer :: ntol = 0 + logical :: nfa_set = .false. + integer :: nfa = 0 + logical :: nfb_set = .false. + integer :: nfb = 0 + ! Per-period UTC as HHMMSS integer. Threaded into + ! params%nutc so streaming_emit_decode can format the time field + ! correctly. Producer should send a fresh nutc in each period's + ! configure frame (mirrors WAV-path filename-derived per-invocation + ! UTC). + logical :: nutc_set = .false. + integer :: nutc = 0 + ! Body schema version (RFC v1 §3). Absent => default 1 (forward-compat + ! with un-versioned producers). The receiver declines a frame whose + ! version it does not recognize (streaming_io.f90 CTRL_CONFIGURE arm). + logical :: version_set = .false. + integer :: version = 1 + ! Phase 4 (RFC v1 §2): operator identity + frequency-window fields, flat + ! 1:1 onto params_block. Char widths match the bind(C) struct exactly + ! (his_call/my_b_call/his_b_call=12, his_grid=6) — applied via transfer() + ! in apply_configure_fields. Over-length callsign/grid keeps the current silent + ! truncation (consistent with mycall/mygrid; stricter validation is + ! out of scope). my_call_standard/his_call_standard are the + ! schema's first BOOLEAN keys (-> logical(c_bool) lmycallstd/lhiscallstd). + logical :: his_call_set = .false. + character(len=12) :: his_call = ' ' + logical :: his_grid_set = .false. + character(len=6) :: his_grid = ' ' + logical :: my_b_call_set = .false. + character(len=12) :: my_b_call = ' ' + logical :: his_b_call_set = .false. + character(len=12) :: his_b_call = ' ' + logical :: my_call_standard_set = .false. + logical :: my_call_standard = .false. + logical :: his_call_standard_set = .false. + logical :: his_call_standard = .false. + ! Frequency-window ints. tx_audio_offset_hz -> nftx DECOUPLES the tx side + ! from rxfreq (which sets both nfqso AND nftx), so it must apply AFTER the + ! rxfreq block. jt65_jt9_split_hz -> nfsplit (a mid-stream mode switch + ! does not auto-replay init-time fsplit). + ! max_drift_hz -> max_drift (Q65 drift search; default 0). + logical :: tx_audio_offset_hz_set = .false. + integer :: tx_audio_offset_hz = 0 + logical :: jt65_jt9_split_hz_set = .false. + integer :: jt65_jt9_split_hz = 0 + logical :: max_drift_hz_set = .false. + integer :: max_drift_hz = 0 + ! Phase 5 (RFC v1 §2): decoder-tuning basic fields, flat 1:1 onto + ! params_block. dt_tolerance_seconds/eme_delay_seconds are the schema's + ! first real(8) members; they narrow to real(c_float) dttol/emedelay at + ! apply (§4 — narrowing documented in streaming_apply.f90 apply_configure_fields). + ! robust_mode/nagain_flag/clear_average are BOOLEANS -> logical(c_bool) + ! nrobust/nagain/nclearave (reuse the Phase 4 get_bool_/accept_bool path). + ! tx_mode is an enum (JT9->9 / JT65->65, or a raw int) -> ntxmode, mirroring + ! the "mode" parse. OBSERVABILITY (read-site map): on the + ! jt9 --stream FT8/JT9 fixtures kin_samples(kin)+nzhsym_per_period(nzhsym) + ! are OVERWRITTEN every period by the streaming period-prep block + ! (streaming_io.f90 ~:331/:339); dttol/minw/minsync/n2pass/nrobust/nclearave + ! are JT4/JT65/Q65-only; emedelay is forced to 0 by apply_per_mode_policy on + ! a mode-setting frame; ntxmode is read only in mode 65+9 — so 10 of 12 are + ! inert here (parse-unit + no-regression guard them). Only npts_c0_array(npts8) + ! and nagain_flag(nagain) reach the FT8/JT9 decoders. + logical :: dt_tolerance_seconds_set = .false. + real(8) :: dt_tolerance_seconds = 0.d0 + logical :: eme_delay_seconds_set = .false. + real(8) :: eme_delay_seconds = 0.d0 + logical :: kin_samples_set = .false. + integer :: kin_samples = 0 + logical :: nzhsym_per_period_set = .false. + integer :: nzhsym_per_period = 0 + logical :: npts_c0_array_set = .false. + integer :: npts_c0_array = 0 + logical :: min_width_set = .false. + integer :: min_width = 0 + logical :: min_sync_set = .false. + integer :: min_sync = 0 + logical :: n_2pass_set = .false. + integer :: n_2pass = 0 + logical :: robust_mode_set = .false. + logical :: robust_mode = .false. + logical :: nagain_flag_set = .false. + logical :: nagain_flag = .false. + logical :: tx_mode_set = .false. + integer :: tx_mode = 0 + logical :: clear_average_set = .false. + logical :: clear_average = .false. + ! Phase 6 (RFC v1 §2): FT8/FT4 specifics cluster — 19 bools + 5 ints, flat + ! 1:1 onto params_block. OBSERVABILITY (read-site map + binary + ! probe): 21 of 24 are INERT on the jt9 --stream FT8/JT9 fixtures — most are + ! read ONLY inside the multithreaded-FT8 block (guard + ! if(params%lmultift8 .and. nmode==8), decoder.f90:192), which streaming + ! forces off (lmultift8=.false. constructed at jt9.f90:316); jt65_ap_on is + ! JT65-only; superfox_mode/even_sequence are superfox-path-only; + ! ft8_decoder_start is non-stream (WAV/shmem) path; hint_mode is never read. Only + ! ft8_ap_on/ap_cq_only/ap_width_hz reach the single-pass FT8 decoder + ! (decoder.f90:1141-1146, the lmultift8=.false. branch). ap_width_hz stores + ! the RAW int (decode halves it at lib/ft8var/ft8bvar.f90:1040; §3 napwid + ! note) — do NOT pre-scale. nagain_filter/stop_hint/hint_mode map to logical(c_bool) + ! nagainfil/nstophint/nhint despite the n-prefix. Bools reuse the Phase 4/5 + ! get_bool_/accept_bool path; the 5 ints use get_int_. multithreaded_ft8 is + ! PARSED faithfully but APPLY ignores a non-false value (a true re-enables the + ! broken multithread branch -> 0 decodes; see streaming_apply.f90). + logical :: multithreaded_ft8_set = .false. + logical :: multithreaded_ft8 = .false. + logical :: ft8_cycles_set = .false. + integer :: ft8_cycles = 0 + logical :: ft8_rxf_sensitivity_set = .false. + integer :: ft8_rxf_sensitivity = 0 + logical :: ft8_threads_set = .false. + integer :: ft8_threads = 0 + logical :: ft8_decoder_start_set = .false. + integer :: ft8_decoder_start = 0 + logical :: ft8_low_threshold_set = .false. + logical :: ft8_low_threshold = .false. + logical :: ft8_subpass_set = .false. + logical :: ft8_subpass = .false. + logical :: ft8_ap_on_set = .false. + logical :: ft8_ap_on = .false. + logical :: ap_cq_only_set = .false. + logical :: ap_cq_only = .false. + logical :: ap_my_call_set = .false. + logical :: ap_my_call = .false. + logical :: jt65_ap_on_set = .false. + logical :: jt65_ap_on = .false. + logical :: ap_width_hz_set = .false. + integer :: ap_width_hz = 0 + logical :: hide_ft8_duplicates_set = .false. + logical :: hide_ft8_duplicates = .false. + logical :: common_ft8b_set = .false. + logical :: common_ft8b = .false. + logical :: enable_dxc_search_set = .false. + logical :: enable_dxc_search = .false. + logical :: wide_dxc_search_set = .false. + logical :: wide_dxc_search = .false. + logical :: superfox_mode_set = .false. + logical :: superfox_mode = .false. + logical :: even_sequence_set = .false. + logical :: even_sequence = .false. + logical :: hound_mode_set = .false. + logical :: hound_mode = .false. + logical :: multi_instance_set = .false. + logical :: multi_instance = .false. + logical :: skip_tx1_set = .false. + logical :: skip_tx1 = .false. + logical :: nagain_filter_set = .false. + logical :: nagain_filter = .false. + logical :: stop_hint_set = .false. + logical :: stop_hint = .false. + logical :: hint_mode_set = .false. + logical :: hint_mode = .false. + ! Phase 7 (RFC v1 §2): diagnostic / sequencing fields — 2 bools + 4 ints, + ! flat 1:1 onto params_block. OBSERVABILITY (read-site map): + ! ALL 6 are INERT on the jt9 --stream FT8/JT9 fixtures. Five are read ONLY + ! inside the multithreaded-FT8 block (guard + ! if(params%lmultift8 .and. nmode==8), decoder.f90:192..1148, which streaming + ! forces off via lmultift8=.false.): currently_txing (ltxing, decoder.f90:228), + ! mode_changed (lmodechanged, :193), sec_band_changed (nsecbandchanged, + ! :208), delay_units (ndelay, :201/:1077), last_tx_seconds_ago (nlasttx, + ! :337, consumed only by the multithread FT8-variant decoder ft8bvar/ft8svar). + ! qso_progress_state (nQSOProgress) DOES reach the single-pass FT8 decoder + ! (decoder.f90:1141) but only steers AP decoding passes; the FT8 fixture has + ! no AP-only decodes, so an IN-RANGE value is empirically inert (probed: + ! qso=5 gives a byte-identical 21-decode set). It is the one Phase 7 key the + ! apply GUARDS (streaming_apply.f90): an OUT-OF-range value (<0 or >5) is a raw + ! index into nappasses(0:5)/naptypes(0:5,4) at ft8b.f90:274/299 -> a decoder + ! crash, so the apply ignores it (valid [0,5] pass through; see the apply + ! comment). Parse stays a plain get_int_ (no parse-time range check -- v1 does + ! type validation only, not range validation). No decode-output gate is + ! possible for the inert in-range values -> parse-unit + apply-routing-unit + + ! no-regression are the coverage (like Phase 4); the out-of-range guard is + ! covered by a survival fixture + an apply-routing assert. The 4 ints use + ! get_int_; the 2 bools (currently_txing/mode_changed, logical(c_bool) in + ! jt9com.f90) reuse the get_bool_/accept_bool path. + ! + ! OMITTED Phase 7 wire keys (intentionally NOT exposed in v1): + ! utc_list / utc_list_0..9 / nlist_count — map to listutc, which is read + ! ONLY by the JT4 averaging path (decoder.f90:1310, the nmode==4 block) and + ! has no writer in the decode core — dead for the FT8/JT9/FT4/Q65 stream + ! paths. Exposing it would be a no-op there. + ! datetime — read into a dead local at decoder.f90:99 (assigned, never used); + ! no decode effect. Only date->yymmdd carries time (Phase 8, §6.1). + ! from_wav_file (ndiskdat) / new_data_flag (newdat) — receiver-managed + ! invariants (§6.1/§9): the receiver hard-sets both, and a producer + ! override would break the one-shot decode contract. Not producer-settable. + logical :: last_tx_seconds_ago_set = .false. + integer :: last_tx_seconds_ago = 0 + logical :: currently_txing_set = .false. + logical :: currently_txing = .false. + logical :: mode_changed_set = .false. + logical :: mode_changed = .false. + logical :: qso_progress_state_set = .false. + integer :: qso_progress_state = 0 + logical :: sec_band_changed_set = .false. + integer :: sec_band_changed = 0 + logical :: delay_units_set = .false. + integer :: delay_units = 0 + ! Phase 8 (RFC v1 §2/§6): string & scaled / derived fields. Unlike Phases + ! 4-7 (flat value-extract), these REWRITE the wire value into the legacy + ! encoding AT PARSE, so the member holds the DERIVED legacy int, not the raw + ! wire form: + ! utc ("HH:MM:SS") -> utc_nutc = hh*10000+mm*100+ss (§6.3) + ! date ("YYYY-MM-DD") -> date_yymmdd = (yr-2000)*10000+mo*100+day (§6.4) + ! n_trials (int) -> n_trials_nranera = encode(n_trials) (§6.6) + ! parse_iso_time_/parse_iso_date_/ntrials_to_nranera_ do the work; a + ! malformed ISO string leaves the key UNSET (value-domain silent-skip, like a + ! bad mode name — type validation only, §4.1). TWO keys carry a PARSE-TIME + ! VALUE check that emits configure_type_error (the schema's first value-domain + ! errors, both RFC-mandated): n_trials NOT in {10^N, 3*10^N} (§6.6 — else a + ! bad nranera silently corrupts ntrials at decoder.f90:143-145) and date with + ! year >= 2100 (§6.4 — the 2000+offset YYMMDD encoding caps at 2099). + ! + ! PRECEDENCE (§4.1): utc is a SECOND route to nutc alongside the legacy int + ! key nutc (kept for the legacy subset). utc_nutc is stored SEPARATELY from + ! nutc; apply_configure_fields applies nutc THEN utc_nutc, so utc WINS when a + ! frame carries both (richer ISO form). Order-independent at apply (the apply + ! sequence encodes precedence, not the parse order). + ! + ! OBSERVABILITY (read-site map + binary probe): utc->nutc + ! round-trips through the decode "time" field (DECODE-OBSERVABLE via the + ! nutc round-trip fixtures). The other four are INERT on the FT8/JT9 stream + ! fixtures: + ! - candthin_threshold->ncandthin / dt_center_seconds->ndtcenter are read + ! ONLY by the multithread FT8-variant decoder my_ft8var%decodevar (all such + ! calls — first at decoder.f90:348 — scale /100 into the variant's sync + ! thresholds at lib/ft8var/sync8var.f90:17-18), and EVERY my_ft8var%decodevar + ! call lives inside the if(lmultift8 .and. nmode==8) block (opens + ! decoder.f90:192, else-arm at :1140) which streaming forces off — same class + ! as the Phase 6/7 multithread keys. The single-pass FT8 decoder + ! (my_ft8%decode, :1141) is NOT passed them. Probed inert: ncandthin + ! scaled to 5.0 and ndtcenter to a 2.0 s shift each gave the byte-identical + ! 21-decode FT8 set. + ! - n_trials->nranera->ntrials reaches only the JT65 deep-search decoder + ! (ntrials computed at decoder.f90:143-145, consumed at :1338/:1365), unused + ! on FT8/JT9. + ! - date->yymmdd's only param read site is decoder.f90:182 (guarded by + ! if(ncontest==7 .and. b_superfox .and. b_even_seq) -> superfox-only), + ! decoded into yr/mo/day at lib/superfox/sfrx_sub.f90:21,25-27. + ! None is an array index (array-bound check: nranera<=18 keeps the + ! decode-site 10**(nranera/2) within int32 for any parseable valid n_trials; + ! ncandthin/ndtcenter become real thresholds), so no out-of-range apply guard is + ! needed (unlike qso_progress_state). The four inert keys are guarded by + ! parse-unit + apply-routing-unit + no-regression (like Phase 4/6/7). + ! candthin_threshold/dt_center_seconds are real(8) members scaled at apply + ! (§4 — declare real(8), nint(wire*100), do NOT pre-store as int). + logical :: utc_set = .false. + integer :: utc_nutc = 0 + logical :: date_set = .false. + integer :: date_yymmdd = 0 + logical :: n_trials_set = .false. + integer :: n_trials_nranera = 0 + logical :: candthin_threshold_set = .false. + real(8) :: candthin_threshold = 0.d0 + logical :: dt_center_seconds_set = .false. + real(8) :: dt_center_seconds = 0.d0 + ! ===== Phase 9 (RFC v1 §2.4/§2.5/§6.1/§6.2): bit-packed fields =========== + ! ndepth + nexp_decode are PACKED at parse (the post-pass pack_phase9_, called + ! after all keys are read) into the two derived *_packed members below, so + ! apply stays flat (mirrors Phase 8's derive-at-parse). The 9 unpacked keys + + ! their _set flags drive the pack; the post-pass also enforces the two + ! atomic-decline errors (the legacy depth full-int co-present with ANY unpacked + ! ndepth key -> conflicting encodings; depth_level vs q65_maxiters_level + ! inconsistency). Only depth_level is decode-observable on FT8/JT9 (the fixtures + ! run at depth=3 -> ndepth=3; depth_level=1 -> ndepth=1 changes the FT8 pass + ! structure ft8_decode.f90:178/182 and the JT9 iand(ndepth,7) tests + ! jt9_decode.f90:88,92) — the other 8 are Q65/JT65/FST4/JT4 or contest-branch + ! only (use_averaging q65_decode.f90:221/477+jt65_decode.f90:258; + ! deep_ap_search jt4_decode.f90:393+extract.f90:182; q65_auto_clear_average + ! q65_decode.f90:337/449; single_decode/vhf_features/noise_blanker reach + ! FST4/JT65 not the single-pass FT8 my_ft8%decode) -> parse-unit + + ! apply-routing-unit + no-regression (like Phase 4/6/7). NONE indexes an array + ! raw, so no out-of-range apply guard is needed; the pack instead + ! MASKS depth_level to 3 bits / q65_maxiters to 2 bits and CLAMPS the NB byte to + ! [0,255], so an out-of-range producer value cannot corrupt a sibling bit. + ! contest_type holds the COLLAPSED ncontest int (0-7) resolved at parse by + ! contest_string_to_int_ (SpecOp 5/8/9 -> 1; Configuration.hpp:318 enum). + ! -- ndepth group -- + logical :: depth_level_set = .false. + integer :: depth_level = 0 + logical :: q65_maxiters_level_set = .false. + integer :: q65_maxiters_level = 0 + logical :: use_averaging_set = .false. + logical :: use_averaging = .false. + logical :: deep_ap_search_set = .false. + logical :: deep_ap_search = .false. + logical :: q65_auto_clear_average_set = .false. + logical :: q65_auto_clear_average = .false. + ! -- nexp_decode group -- + logical :: contest_type_set = .false. + integer :: contest_type = 0 ! collapsed ncontest (0-7) + logical :: single_decode_set = .false. + logical :: single_decode = .false. + logical :: vhf_features_set = .false. + logical :: vhf_features = .false. + logical :: noise_blanker_level_set = .false. + integer :: noise_blanker_level = 0 + ! -- derived packed ints (computed by pack_phase9_; apply routes these flat) -- + logical :: ndepth_packed_set = .false. + integer :: ndepth_packed = 0 + logical :: nexp_decode_packed_set = .false. + integer :: nexp_decode_packed = 0 + end type configure_fields + + ! Per-key type-validation result (RFC v1 §4.1, Phase 2). When a configure + ! frame carries a key whose JSON value type mismatches the schema (e.g. + ! {"depth":"abc"}), parse_control_frame records the FIRST such error here and + ! the caller declines the ENTIRE frame with configure_type_error (no partial + ! application). `present=.false.` means the frame is well-typed. + type, public :: control_type_error + logical :: present = .false. + character(len=24) :: key = ' ' ! offending key (no quotes) + character(len=16) :: expected = ' ' ! "int"/"real"/"string"/"string|int" + character(len=8) :: got = ' ' ! "string"/"number"/"bool"/"null" + end type control_type_error + + public :: parse_control_frame + public :: mode_string_to_int + +contains + + ! Parse a UTF-8 JSON line into an action and (for CONFIGURE) fields. + ! + ! Type validation (RFC v1 §4.1, Phase 2): every configure key is checked + ! against its schema JSON type BEFORE its value is parsed. A key present with + ! a mismatched JSON type (e.g. {"depth":"abc"}) records the FIRST such error in + ! `terr`; the caller (streaming_io.f90 CTRL_CONFIGURE arm) then declines the + ! ENTIRE frame with configure_type_error — no partial application. Value-domain + ! issues (unknown mode name, over-length callsign, a fractional value for an + ! int key) are NOT type errors: they preserve the current silent behavior + ! (the key is simply left unset). + subroutine parse_control_frame(buf, action, cfg, terr) + character(len=*), intent(in) :: buf + integer, intent(out) :: action + type(configure_fields), intent(out) :: cfg + type(control_type_error), intent(out) :: terr + + character(len=64) :: t_value + character(len=128) :: str_val + integer :: int_val, mode_value_start, mode_buffer_length + real(8) :: real_val + logical :: lval + logical :: ok, proceed, mode_present + integer :: hh, mm, ss, yr, mo, dy, enc ! Phase 8 ISO/encode temps + logical :: vok ! Phase 8 value-parse ok + + action = CTRL_UNKNOWN + terr%present = .false. + + ! Required: "t": + call get_string_(buf, '"t"', t_value, ok) + if (.not. ok) then + action = CTRL_PARSE_ERR + return + end if + + if (trim(t_value) .eq. 'halt') then + action = CTRL_HALT + return + end if + + if (trim(t_value) .ne. 'configure') then + action = CTRL_UNKNOWN ! forward-compat: ignore unknown "t" + return + end if + + action = CTRL_CONFIGURE + + ! "mode" accepts a mode-name string ("FT8") or an integer code (8). + call check_type_(buf, '"mode"', 'mode', 'string|int', .true., .true., terr, proceed) + if (proceed) then + call get_string_(buf, '"mode"', str_val, ok) + if (ok) then + int_val = mode_string_to_int(trim(str_val)) + if (int_val .ge. 0) then + cfg%mode_set = .true. + cfg%mode = int_val + else + cfg%mode_invalid = .true. + end if + else + call get_int_(buf, '"mode"', int_val, ok) + if (ok .and. valid_mode_int_(int_val)) then + cfg%mode_set = .true. + cfg%mode = int_val + else if (ok) then + cfg%mode_invalid = .true. + else + call find_key_(buf, '"mode"', mode_value_start, & + mode_buffer_length, mode_present) + cfg%mode_invalid = mode_present + end if + end if + end if + + call check_type_(buf, '"depth"', 'depth', 'int', .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"depth"', int_val, ok) + if (ok) then + cfg%depth_set = .true. + cfg%depth = int_val + end if + end if + + call check_type_(buf, '"rxfreq"', 'rxfreq', 'int', .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"rxfreq"', int_val, ok) + if (ok) then + cfg%rxfreq_set = .true. + cfg%rxfreq = int_val + end if + end if + + call check_type_(buf, '"trperiod"', 'trperiod', 'real', .false., .true., terr, proceed) + if (proceed) then + call get_real_(buf, '"trperiod"', real_val, ok) + if (ok) then + cfg%trperiod_set = .true. + cfg%trperiod = real_val + end if + end if + + ! "submode" accepts integer (0..n) or single-letter string ("A".."G"). + call check_type_(buf, '"submode"', 'submode', 'string|int', .true., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"submode"', int_val, ok) + if (ok) then + cfg%submode_set = .true. + cfg%submode = int_val + else + call get_string_(buf, '"submode"', str_val, ok) + if (ok .and. len_trim(str_val) .ge. 1) then + cfg%submode_set = .true. + cfg%submode = iachar(str_val(1:1)) - iachar('A') + if (cfg%submode .lt. 0) cfg%submode = 0 + end if + end if + end if + + call check_type_(buf, '"mycall"', 'mycall', 'string', .true., .false., terr, proceed) + if (proceed) then + call get_string_(buf, '"mycall"', str_val, ok) + if (ok) then + cfg%mycall_set = .true. + cfg%mycall = str_val(:min(len(str_val), 12)) + end if + end if + + call check_type_(buf, '"mygrid"', 'mygrid', 'string', .true., .false., terr, proceed) + if (proceed) then + call get_string_(buf, '"mygrid"', str_val, ok) + if (ok) then + cfg%mygrid_set = .true. + cfg%mygrid = str_val(:min(len(str_val), 6)) + end if + end if + + call check_type_(buf, '"ntol"', 'ntol', 'int', .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"ntol"', int_val, ok) + if (ok) then + cfg%ntol_set = .true. + cfg%ntol = int_val + end if + end if + + call check_type_(buf, '"nfa"', 'nfa', 'int', .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"nfa"', int_val, ok) + if (ok) then + cfg%nfa_set = .true. + cfg%nfa = int_val + end if + end if + + call check_type_(buf, '"nfb"', 'nfb', 'int', .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"nfb"', int_val, ok) + if (ok) then + cfg%nfb_set = .true. + cfg%nfb = int_val + end if + end if + + call check_type_(buf, '"nutc"', 'nutc', 'int', .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"nutc"', int_val, ok) + if (ok) then + cfg%nutc_set = .true. + cfg%nutc = int_val + end if + end if + + ! ===== Phase 4: operator identity + frequency-window fields (RFC v1 §2) === + ! his_call/his_grid/my_b_call/his_b_call: strings (like mycall/mygrid), + ! truncated to the struct char width at assignment (silent truncation). + call check_type_(buf, '"his_call"', 'his_call', 'string', .true., .false., terr, proceed) + if (proceed) then + call get_string_(buf, '"his_call"', str_val, ok) + if (ok) then + cfg%his_call_set = .true. + cfg%his_call = str_val(:min(len(str_val), 12)) + end if + end if + + call check_type_(buf, '"his_grid"', 'his_grid', 'string', .true., .false., terr, proceed) + if (proceed) then + call get_string_(buf, '"his_grid"', str_val, ok) + if (ok) then + cfg%his_grid_set = .true. + cfg%his_grid = str_val(:min(len(str_val), 6)) + end if + end if + + call check_type_(buf, '"my_b_call"', 'my_b_call', 'string', .true., .false., terr, proceed) + if (proceed) then + call get_string_(buf, '"my_b_call"', str_val, ok) + if (ok) then + cfg%my_b_call_set = .true. + cfg%my_b_call = str_val(:min(len(str_val), 12)) + end if + end if + + call check_type_(buf, '"his_b_call"', 'his_b_call', 'string', .true., .false., terr, proceed) + if (proceed) then + call get_string_(buf, '"his_b_call"', str_val, ok) + if (ok) then + cfg%his_b_call_set = .true. + cfg%his_b_call = str_val(:min(len(str_val), 12)) + end if + end if + + ! my_call_standard/his_call_standard: booleans (true/false). accept_bool + ! widens check_type_ to accept the 'bool' category for these two keys only. + call check_type_(buf, '"my_call_standard"', 'my_call_standard', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"my_call_standard"', lval, ok) + if (ok) then + cfg%my_call_standard_set = .true. + cfg%my_call_standard = lval + end if + end if + + call check_type_(buf, '"his_call_standard"', 'his_call_standard', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"his_call_standard"', lval, ok) + if (ok) then + cfg%his_call_standard_set = .true. + cfg%his_call_standard = lval + end if + end if + + ! Frequency-window ints (Hz). + call check_type_(buf, '"tx_audio_offset_hz"', 'tx_audio_offset_hz', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"tx_audio_offset_hz"', int_val, ok) + if (ok) then + cfg%tx_audio_offset_hz_set = .true. + cfg%tx_audio_offset_hz = int_val + end if + end if + + call check_type_(buf, '"jt65_jt9_split_hz"', 'jt65_jt9_split_hz', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"jt65_jt9_split_hz"', int_val, ok) + if (ok) then + cfg%jt65_jt9_split_hz_set = .true. + cfg%jt65_jt9_split_hz = int_val + end if + end if + + call check_type_(buf, '"max_drift_hz"', 'max_drift_hz', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"max_drift_hz"', int_val, ok) + if (ok) then + cfg%max_drift_hz_set = .true. + cfg%max_drift_hz = int_val + end if + end if + + ! ===== Phase 5: decoder-tuning basic fields (RFC v1 §2) ================= + ! Two real keys (parsed as real(8); narrowed to real(c_float) at apply, §4). + call check_type_(buf, '"dt_tolerance_seconds"', 'dt_tolerance_seconds', & + 'real', .false., .true., terr, proceed) + if (proceed) then + call get_real_(buf, '"dt_tolerance_seconds"', real_val, ok) + if (ok) then + cfg%dt_tolerance_seconds_set = .true. + cfg%dt_tolerance_seconds = real_val + end if + end if + + call check_type_(buf, '"eme_delay_seconds"', 'eme_delay_seconds', & + 'real', .false., .true., terr, proceed) + if (proceed) then + call get_real_(buf, '"eme_delay_seconds"', real_val, ok) + if (ok) then + cfg%eme_delay_seconds_set = .true. + cfg%eme_delay_seconds = real_val + end if + end if + + ! Six int keys. + call check_type_(buf, '"kin_samples"', 'kin_samples', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"kin_samples"', int_val, ok) + if (ok) then + cfg%kin_samples_set = .true. + cfg%kin_samples = int_val + end if + end if + + call check_type_(buf, '"nzhsym_per_period"', 'nzhsym_per_period', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"nzhsym_per_period"', int_val, ok) + if (ok) then + cfg%nzhsym_per_period_set = .true. + cfg%nzhsym_per_period = int_val + end if + end if + + call check_type_(buf, '"npts_c0_array"', 'npts_c0_array', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"npts_c0_array"', int_val, ok) + if (ok .and. int_val .ge. NPTS_C0_ARRAY_MIN .and. & + int_val .le. NPTS_C0_ARRAY_MAX) then + cfg%npts_c0_array_set = .true. + cfg%npts_c0_array = int_val + end if + end if + + call check_type_(buf, '"min_width"', 'min_width', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"min_width"', int_val, ok) + if (ok) then + cfg%min_width_set = .true. + cfg%min_width = int_val + end if + end if + + call check_type_(buf, '"min_sync"', 'min_sync', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"min_sync"', int_val, ok) + if (ok) then + cfg%min_sync_set = .true. + cfg%min_sync = int_val + end if + end if + + call check_type_(buf, '"n_2pass"', 'n_2pass', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"n_2pass"', int_val, ok) + if (ok) then + cfg%n_2pass_set = .true. + cfg%n_2pass = int_val + end if + end if + + ! Three bool keys (reuse the Phase 4 get_bool_ / accept_bool path). + call check_type_(buf, '"robust_mode"', 'robust_mode', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"robust_mode"', lval, ok) + if (ok) then + cfg%robust_mode_set = .true. + cfg%robust_mode = lval + end if + end if + + call check_type_(buf, '"nagain_flag"', 'nagain_flag', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"nagain_flag"', lval, ok) + if (ok) then + cfg%nagain_flag_set = .true. + cfg%nagain_flag = lval + end if + end if + + call check_type_(buf, '"clear_average"', 'clear_average', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"clear_average"', lval, ok) + if (ok) then + cfg%clear_average_set = .true. + cfg%clear_average = lval + end if + end if + + ! tx_mode: enum string ("JT9"/"JT65") or int (9/65) -> ntxmode. Mirrors the + ! "mode" block (string|int via mode_string_to_int). A negative map (unknown + ! name) leaves tx_mode unset, like "mode". + call check_type_(buf, '"tx_mode"', 'tx_mode', 'string|int', .true., .true., & + terr, proceed) + if (proceed) then + call get_string_(buf, '"tx_mode"', str_val, ok) + if (ok) then + int_val = mode_string_to_int(trim(str_val)) + if (int_val .ge. 0) then + cfg%tx_mode_set = .true. + cfg%tx_mode = int_val + end if + else + call get_int_(buf, '"tx_mode"', int_val, ok) + if (ok) then + cfg%tx_mode_set = .true. + cfg%tx_mode = int_val + end if + end if + end if + + ! ===== Phase 6: FT8/FT4 specifics cluster (RFC v1 §2) ================== + ! 19 bools + 5 ints, flat 1:1. Bools reuse the get_bool_/accept_bool path; + ! ints use get_int_. ap_width_hz is a wire int stored RAW (decode halves it). + call check_type_(buf, '"multithreaded_ft8"', 'multithreaded_ft8', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"multithreaded_ft8"', lval, ok) + if (ok) then + cfg%multithreaded_ft8_set = .true. + cfg%multithreaded_ft8 = lval + end if + end if + + call check_type_(buf, '"ft8_cycles"', 'ft8_cycles', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"ft8_cycles"', int_val, ok) + if (ok) then + cfg%ft8_cycles_set = .true. + cfg%ft8_cycles = int_val + end if + end if + + call check_type_(buf, '"ft8_rxf_sensitivity"', 'ft8_rxf_sensitivity', & + 'int', .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"ft8_rxf_sensitivity"', int_val, ok) + if (ok) then + cfg%ft8_rxf_sensitivity_set = .true. + cfg%ft8_rxf_sensitivity = int_val + end if + end if + + call check_type_(buf, '"ft8_threads"', 'ft8_threads', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"ft8_threads"', int_val, ok) + if (ok) then + cfg%ft8_threads_set = .true. + cfg%ft8_threads = int_val + end if + end if + + call check_type_(buf, '"ft8_decoder_start"', 'ft8_decoder_start', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"ft8_decoder_start"', int_val, ok) + if (ok) then + cfg%ft8_decoder_start_set = .true. + cfg%ft8_decoder_start = int_val + end if + end if + + call check_type_(buf, '"ft8_low_threshold"', 'ft8_low_threshold', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"ft8_low_threshold"', lval, ok) + if (ok) then + cfg%ft8_low_threshold_set = .true. + cfg%ft8_low_threshold = lval + end if + end if + + call check_type_(buf, '"ft8_subpass"', 'ft8_subpass', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"ft8_subpass"', lval, ok) + if (ok) then + cfg%ft8_subpass_set = .true. + cfg%ft8_subpass = lval + end if + end if + + call check_type_(buf, '"ft8_ap_on"', 'ft8_ap_on', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"ft8_ap_on"', lval, ok) + if (ok) then + cfg%ft8_ap_on_set = .true. + cfg%ft8_ap_on = lval + end if + end if + + call check_type_(buf, '"ap_cq_only"', 'ap_cq_only', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"ap_cq_only"', lval, ok) + if (ok) then + cfg%ap_cq_only_set = .true. + cfg%ap_cq_only = lval + end if + end if + + call check_type_(buf, '"ap_my_call"', 'ap_my_call', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"ap_my_call"', lval, ok) + if (ok) then + cfg%ap_my_call_set = .true. + cfg%ap_my_call = lval + end if + end if + + call check_type_(buf, '"jt65_ap_on"', 'jt65_ap_on', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"jt65_ap_on"', lval, ok) + if (ok) then + cfg%jt65_ap_on_set = .true. + cfg%jt65_ap_on = lval + end if + end if + + call check_type_(buf, '"ap_width_hz"', 'ap_width_hz', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"ap_width_hz"', int_val, ok) + if (ok) then + cfg%ap_width_hz_set = .true. + cfg%ap_width_hz = int_val + end if + end if + + call check_type_(buf, '"hide_ft8_duplicates"', 'hide_ft8_duplicates', & + 'bool', .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"hide_ft8_duplicates"', lval, ok) + if (ok) then + cfg%hide_ft8_duplicates_set = .true. + cfg%hide_ft8_duplicates = lval + end if + end if + + call check_type_(buf, '"common_ft8b"', 'common_ft8b', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"common_ft8b"', lval, ok) + if (ok) then + cfg%common_ft8b_set = .true. + cfg%common_ft8b = lval + end if + end if + + call check_type_(buf, '"enable_dxc_search"', 'enable_dxc_search', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"enable_dxc_search"', lval, ok) + if (ok) then + cfg%enable_dxc_search_set = .true. + cfg%enable_dxc_search = lval + end if + end if + + call check_type_(buf, '"wide_dxc_search"', 'wide_dxc_search', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"wide_dxc_search"', lval, ok) + if (ok) then + cfg%wide_dxc_search_set = .true. + cfg%wide_dxc_search = lval + end if + end if + + call check_type_(buf, '"superfox_mode"', 'superfox_mode', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"superfox_mode"', lval, ok) + if (ok) then + cfg%superfox_mode_set = .true. + cfg%superfox_mode = lval + end if + end if + + call check_type_(buf, '"even_sequence"', 'even_sequence', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"even_sequence"', lval, ok) + if (ok) then + cfg%even_sequence_set = .true. + cfg%even_sequence = lval + end if + end if + + call check_type_(buf, '"hound_mode"', 'hound_mode', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"hound_mode"', lval, ok) + if (ok) then + cfg%hound_mode_set = .true. + cfg%hound_mode = lval + end if + end if + + call check_type_(buf, '"multi_instance"', 'multi_instance', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"multi_instance"', lval, ok) + if (ok) then + cfg%multi_instance_set = .true. + cfg%multi_instance = lval + end if + end if + + call check_type_(buf, '"skip_tx1"', 'skip_tx1', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"skip_tx1"', lval, ok) + if (ok) then + cfg%skip_tx1_set = .true. + cfg%skip_tx1 = lval + end if + end if + + call check_type_(buf, '"nagain_filter"', 'nagain_filter', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"nagain_filter"', lval, ok) + if (ok) then + cfg%nagain_filter_set = .true. + cfg%nagain_filter = lval + end if + end if + + call check_type_(buf, '"stop_hint"', 'stop_hint', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"stop_hint"', lval, ok) + if (ok) then + cfg%stop_hint_set = .true. + cfg%stop_hint = lval + end if + end if + + call check_type_(buf, '"hint_mode"', 'hint_mode', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"hint_mode"', lval, ok) + if (ok) then + cfg%hint_mode_set = .true. + cfg%hint_mode = lval + end if + end if + + ! ===== Phase 7: diagnostic / sequencing fields (RFC v1 §2) ============= + ! 2 bools + 4 ints, flat 1:1. Bools reuse the get_bool_/accept_bool path; + ! ints use get_int_. All inert on the stream path (multithread-block-only / + ! AP-only) — see the configure_fields Phase 7 comment for read sites + OMITs. + call check_type_(buf, '"last_tx_seconds_ago"', 'last_tx_seconds_ago', & + 'int', .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"last_tx_seconds_ago"', int_val, ok) + if (ok) then + cfg%last_tx_seconds_ago_set = .true. + cfg%last_tx_seconds_ago = int_val + end if + end if + + call check_type_(buf, '"currently_txing"', 'currently_txing', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"currently_txing"', lval, ok) + if (ok) then + cfg%currently_txing_set = .true. + cfg%currently_txing = lval + end if + end if + + call check_type_(buf, '"mode_changed"', 'mode_changed', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"mode_changed"', lval, ok) + if (ok) then + cfg%mode_changed_set = .true. + cfg%mode_changed = lval + end if + end if + + call check_type_(buf, '"qso_progress_state"', 'qso_progress_state', & + 'int', .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"qso_progress_state"', int_val, ok) + if (ok) then + cfg%qso_progress_state_set = .true. + cfg%qso_progress_state = int_val + end if + end if + + call check_type_(buf, '"sec_band_changed"', 'sec_band_changed', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"sec_band_changed"', int_val, ok) + if (ok) then + cfg%sec_band_changed_set = .true. + cfg%sec_band_changed = int_val + end if + end if + + call check_type_(buf, '"delay_units"', 'delay_units', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"delay_units"', int_val, ok) + if (ok) then + cfg%delay_units_set = .true. + cfg%delay_units = int_val + end if + end if + + ! ===== Phase 8: string & scaled / derived fields (RFC v1 §2/§6) ========= + ! These derive the LEGACY encoding at parse (see the configure_fields Phase 8 + ! comment): utc/date are ISO strings tokenized by parse_iso_time_/ + ! parse_iso_date_; n_trials is encoded to nranera by ntrials_to_nranera_; + ! candthin_threshold/dt_center_seconds are wire reals scaled /100 at apply. + ! + ! utc: ISO "HH:MM:SS" -> utc_nutc = hh*10000+mm*100+ss (§6.3, always full + ! HHMMSS). A malformed time string leaves utc unset (value-domain silent skip). + call check_type_(buf, '"utc"', 'utc', 'string', .true., .false., terr, proceed) + if (proceed) then + call get_string_(buf, '"utc"', str_val, ok) + if (ok) then + call parse_iso_time_(trim(str_val), hh, mm, ss, vok) + if (vok) then + cfg%utc_set = .true. + cfg%utc_nutc = hh * 10000 + mm * 100 + ss + end if + end if + end if + + ! date: ISO "YYYY-MM-DD" -> date_yymmdd = (yr-2000)*10000+mo*100+day (§6.4). + ! The 2000+offset encoding caps at 2099 -> year >= 2100 is a configure_type_error + ! (RFC §6.4 "receiver emits error if year >= 2100"). A malformed date string + ! leaves date unset (value-domain silent skip). Only yymmdd is populated; the + ! datetime leg is intentionally OMITted (§6.1 — C/GUI filename field). + call check_type_(buf, '"date"', 'date', 'string', .true., .false., terr, proceed) + if (proceed) then + call get_string_(buf, '"date"', str_val, ok) + if (ok) then + call parse_iso_date_(trim(str_val), yr, mo, dy, vok) + if (vok) then + if (yr .ge. 2100) then + call set_type_error_(terr, 'date', 'year<2100', 'string') + else + cfg%date_set = .true. + cfg%date_yymmdd = (yr - 2000) * 10000 + mo * 100 + dy + end if + end if + end if + end if + + ! n_trials: plain int on the wire -> encoded nranera (§6.6). The value MUST be + ! one of {10^N, 3*10^N}; anything else is a configure_type_error (§6.6 — a + ! non-conforming value would integer-divide into a silently-wrong ntrials at + ! decoder.f90:143-145). The check is a VALUE check (the JSON type is int), so it + ! runs AFTER the int parse and reuses the same configure_type_error envelope. + call check_type_(buf, '"n_trials"', 'n_trials', 'int', .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"n_trials"', int_val, ok) + if (ok) then + call ntrials_to_nranera_(int_val, enc, vok) + if (vok) then + cfg%n_trials_set = .true. + cfg%n_trials_nranera = enc + else + call set_type_error_(terr, 'n_trials', 'int 10^N|3*10^N', 'number') + end if + end if + end if + + ! candthin_threshold / dt_center_seconds: wire reals, scaled /100 to int at + ! apply (§4/§6.5 — declare real(8), nint(wire*100)). Parsed like the Phase 5 + ! reals (check_type_ 'real' -> get_real_). + call check_type_(buf, '"candthin_threshold"', 'candthin_threshold', & + 'real', .false., .true., terr, proceed) + if (proceed) then + call get_real_(buf, '"candthin_threshold"', real_val, ok) + if (ok) then + cfg%candthin_threshold_set = .true. + cfg%candthin_threshold = real_val + end if + end if + + call check_type_(buf, '"dt_center_seconds"', 'dt_center_seconds', & + 'real', .false., .true., terr, proceed) + if (proceed) then + call get_real_(buf, '"dt_center_seconds"', real_val, ok) + if (ok) then + cfg%dt_center_seconds_set = .true. + cfg%dt_center_seconds = real_val + end if + end if + + ! ===== Phase 9 (RFC v1 §2.4/§2.5/§6.1/§6.2): bit-packed unpacked keys ====== + ! Each unpacked key parses into its own configure_fields member; pack_phase9_ + ! (called after the version block) folds them into ndepth_packed / + ! nexp_decode_packed and enforces the two atomic-decline errors. depth_level/ + ! q65_maxiters_level/noise_blanker_level are ints; use_averaging/deep_ap_search/ + ! q65_auto_clear_average/single_decode/vhf_features are bools (get_bool_ / + ! accept_bool path); contest_type is an enum string resolved to the collapsed + ! ncontest int by contest_string_to_int_ (an unknown string leaves it unset — a + ! value-domain silent skip, exactly like an unknown mode name). + call check_type_(buf, '"depth_level"', 'depth_level', 'int', .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"depth_level"', int_val, ok) + if (ok) then + cfg%depth_level_set = .true. + cfg%depth_level = int_val + end if + end if + + call check_type_(buf, '"q65_maxiters_level"', 'q65_maxiters_level', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"q65_maxiters_level"', int_val, ok) + if (ok) then + cfg%q65_maxiters_level_set = .true. + cfg%q65_maxiters_level = int_val + end if + end if + + call check_type_(buf, '"use_averaging"', 'use_averaging', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"use_averaging"', lval, ok) + if (ok) then + cfg%use_averaging_set = .true. + cfg%use_averaging = lval + end if + end if + + call check_type_(buf, '"deep_ap_search"', 'deep_ap_search', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"deep_ap_search"', lval, ok) + if (ok) then + cfg%deep_ap_search_set = .true. + cfg%deep_ap_search = lval + end if + end if + + call check_type_(buf, '"q65_auto_clear_average"', 'q65_auto_clear_average', & + 'bool', .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"q65_auto_clear_average"', lval, ok) + if (ok) then + cfg%q65_auto_clear_average_set = .true. + cfg%q65_auto_clear_average = lval + end if + end if + + ! contest_type: enum string -> collapsed ncontest int (0-7). Unknown -> unset. + call check_type_(buf, '"contest_type"', 'contest_type', 'string', & + .true., .false., terr, proceed) + if (proceed) then + call get_string_(buf, '"contest_type"', str_val, ok) + if (ok) then + int_val = contest_string_to_int_(trim(str_val)) + if (int_val .ge. 0) then + cfg%contest_type_set = .true. + cfg%contest_type = int_val + end if + end if + end if + + call check_type_(buf, '"single_decode"', 'single_decode', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"single_decode"', lval, ok) + if (ok) then + cfg%single_decode_set = .true. + cfg%single_decode = lval + end if + end if + + call check_type_(buf, '"vhf_features"', 'vhf_features', 'bool', & + .false., .false., terr, proceed, accept_bool=.true.) + if (proceed) then + call get_bool_(buf, '"vhf_features"', lval, ok) + if (ok) then + cfg%vhf_features_set = .true. + cfg%vhf_features = lval + end if + end if + + call check_type_(buf, '"noise_blanker_level"', 'noise_blanker_level', 'int', & + .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"noise_blanker_level"', int_val, ok) + if (ok) then + cfg%noise_blanker_level_set = .true. + cfg%noise_blanker_level = int_val + end if + end if + + ! Body schema version (RFC v1 §3). Absent => stays at the default 1. + call check_type_(buf, '"version"', 'version', 'int', .false., .true., terr, proceed) + if (proceed) then + call get_int_(buf, '"version"', int_val, ok) + if (ok) then + cfg%version_set = .true. + cfg%version = int_val + end if + end if + + ! ===== Phase 9 post-pass: pack ndepth / nexp_decode + atomic-decline checks = + ! Runs after ALL keys are parsed (the depth-vs-unpacked conflict is cross-key). + call pack_phase9_(cfg, terr) + + end subroutine parse_control_frame + + ! Map a mode name string to the jt9 integer mode code. Returns -1 for + ! an unknown name. Mirrors lib/jt9.f90's case-table accepted modes. + function mode_string_to_int(name) result(mode_int) + character(len=*), intent(in) :: name + integer :: mode_int + character(len=16) :: u + + u = upper_(name) + mode_int = -1 + select case (trim(u)) + case ('FT8'); mode_int = 8 + case ('FT4'); mode_int = 5 + case ('JT9'); mode_int = 9 + case ('JT65'); mode_int = 65 + case ('JT65+JT9'); mode_int = 74 + case ('JT4'); mode_int = 4 + case ('FST4'); mode_int = 240 + case ('FST4W'); mode_int = 241 + case ('Q65'); mode_int = 66 + case ('MSK144'); mode_int = 144 + end select + end function mode_string_to_int + + pure function valid_mode_int_(mode_int) result(valid) + integer, intent(in) :: mode_int + logical :: valid + + select case (mode_int) + case (4, 5, 8, 9, 65, 66, 74, 144, 240, 241, 242) + valid = .true. + case default + valid = .false. + end select + end function valid_mode_int_ + + ! ===== internals ====================================================== + + ! Find a string value in a flat JSON: looks for `key:"value"`, returns + ! `value` unescaped. ok=.false. on miss or syntax error. + subroutine get_string_(buf, key, val, ok) + character(len=*), intent(in) :: buf, key + character(len=*), intent(out) :: val + logical, intent(out) :: ok + integer :: vstart, vend, blen + logical :: found + + val = ' ' + ok = .false. + call find_key_(buf, key, vstart, blen, found) + if (.not. found) return + if (vstart .gt. blen) return + if (buf(vstart:vstart) .ne. '"') return + vstart = vstart + 1 + vend = index(buf(vstart:blen), '"') + if (vend .le. 0) return + val = buf(vstart : vstart + vend - 2) + ok = .true. + end subroutine get_string_ + + ! Find an integer value in a flat JSON: looks for `key:NNN`, value is + ! decimal integer with optional sign. ok=.false. on miss or non-int. + subroutine get_int_(buf, key, val, ok) + character(len=*), intent(in) :: buf, key + integer, intent(out) :: val + logical, intent(out) :: ok + integer :: vstart, vend, blen, ios + character :: ch + logical :: found + + val = 0 + ok = .false. + call find_key_(buf, key, vstart, blen, found) + if (.not. found) return + if (vstart .gt. blen) return + if (buf(vstart:vstart) .eq. '"') return ! string, not int + vend = vstart + do while (vend .le. blen) + ch = buf(vend:vend) + if (ch .eq. ',' .or. ch .eq. '}' .or. ch .eq. ' ') exit + vend = vend + 1 + end do + if (vend .le. vstart) return + read(buf(vstart : vend - 1), *, iostat=ios) val + if (ios .eq. 0) ok = .true. + end subroutine get_int_ + + ! Find a real value (e.g., trperiod=15 or 7.5). + subroutine get_real_(buf, key, val, ok) + character(len=*), intent(in) :: buf, key + real(8), intent(out) :: val + logical, intent(out) :: ok + integer :: vstart, vend, blen, ios + character :: ch + logical :: found + + val = 0.d0 + ok = .false. + call find_key_(buf, key, vstart, blen, found) + if (.not. found) return + if (vstart .gt. blen) return + if (buf(vstart:vstart) .eq. '"') return + vend = vstart + do while (vend .le. blen) + ch = buf(vend:vend) + if (ch .eq. ',' .or. ch .eq. '}' .or. ch .eq. ' ') exit + vend = vend + 1 + end do + if (vend .le. vstart) return + read(buf(vstart : vend - 1), *, iostat=ios) val + if (ios .eq. 0) ok = .true. + end subroutine get_real_ + + ! Find a boolean value in a flat JSON: looks for `key:true` or `key:false`, + ! keying off the value's leading char ('t'/'f'). ok=.false. on miss or a + ! non-boolean value. Value EXTRACTION uses the same unanchored index() as + ! get_int_/get_string_/get_real_ (wire-parity — it only ever leaves a key + ! unset, never misapplies; TYPE validation anchors via check_type_/find_key_). + subroutine get_bool_(buf, key, val, ok) + character(len=*), intent(in) :: buf, key + logical, intent(out) :: val + logical, intent(out) :: ok + integer :: vstart, blen + character :: ch + logical :: found + + val = .false. + ok = .false. + call find_key_(buf, key, vstart, blen, found) + if (.not. found) return + if (vstart .gt. blen) return + ch = buf(vstart:vstart) + if (ch .eq. 't') then + val = .true.; ok = .true. + else if (ch .eq. 'f') then + val = .false.; ok = .true. + end if + end subroutine get_bool_ + + ! ===== Phase 8 derivations (ISO parsers + nranera encoder) =============== + + ! Read a NON-EMPTY all-digit field into an integer. ok=.false. if empty or any + ! char is a non-digit. A strict digit scan (not a bare list-directed read) is + ! required so a malformed ISO field like "34" missing from "13:34" or a stray + ! "30:99" tail is rejected rather than silently read as a partial number. + subroutine read_int_field_(s, val, ok) + character(len=*), intent(in) :: s + integer, intent(out) :: val + logical, intent(out) :: ok + integer :: i, c, ios + val = 0; ok = .false. + if (len(s) .lt. 1) return + do i = 1, len(s) + c = iachar(s(i:i)) + if (c .lt. iachar('0') .or. c .gt. iachar('9')) return + end do + read(s, *, iostat=ios) val + if (ios .eq. 0) ok = .true. + end subroutine read_int_field_ + + ! Parse ISO 8601 time "HH:MM:SS" -> three ints (§6.3). ok=.false. on a malformed + ! string (not exactly two ':' separators with a non-empty all-digit field + ! between/around each). Ranges are NOT enforced (the caller packs HHMMSS; an + ! out-of-range component is a value-domain matter, not a parse error). + subroutine parse_iso_time_(s, hh, mm, ss, ok) + character(len=*), intent(in) :: s + integer, intent(out) :: hh, mm, ss + logical, intent(out) :: ok + integer :: c1, c2, n + hh = 0; mm = 0; ss = 0; ok = .false. + n = len_trim(s) + c1 = index(s(1:n), ':') + if (c1 .le. 1) return ! no 1st ':' or empty HH + c2 = index(s(c1+1:n), ':') + if (c2 .le. 1) return ! no 2nd ':' or empty MM + c2 = c1 + c2 ! absolute index of the 2nd ':' + if (c2 .ge. n) return ! nothing after the 2nd ':' + call read_int_field_(s(1:c1-1), hh, ok); if (.not. ok) return + call read_int_field_(s(c1+1:c2-1), mm, ok); if (.not. ok) return + call read_int_field_(s(c2+1:n), ss, ok) + end subroutine parse_iso_time_ + + ! Parse ISO 8601 date "YYYY-MM-DD" -> three ints (§6.4). ok=.false. on a + ! malformed string. The caller enforces the year<2100 cap. + subroutine parse_iso_date_(s, yr, mo, dy, ok) + character(len=*), intent(in) :: s + integer, intent(out) :: yr, mo, dy + logical, intent(out) :: ok + integer :: d1, d2, n + yr = 0; mo = 0; dy = 0; ok = .false. + n = len_trim(s) + d1 = index(s(1:n), '-') + if (d1 .le. 1) return ! no 1st '-' or empty YYYY + d2 = index(s(d1+1:n), '-') + if (d2 .le. 1) return ! no 2nd '-' or empty MM + d2 = d1 + d2 ! absolute index of the 2nd '-' + if (d2 .ge. n) return ! nothing after the 2nd '-' + call read_int_field_(s(1:d1-1), yr, ok); if (.not. ok) return + call read_int_field_(s(d1+1:d2-1), mo, ok); if (.not. ok) return + call read_int_field_(s(d2+1:n), dy, ok) + end subroutine parse_iso_date_ + + ! Encode a desired trial count n_trials into the legacy nranera index (§6.6): + ! nranera even -> ntrials = 10**(nranera/2) (decoder.f90:143) + ! nranera odd -> ntrials = 3*10**(nranera/2) (decoder.f90:144) + ! so n_trials must be 10^k or 3*10^k. ok=.false. for any other value (the caller + ! then emits configure_type_error). Strip trailing factors of 10; the residual + ! must be 1 (pure power of 10 -> nranera=2k) or 3 (3x -> nranera=2k+1). This is + ! functionally equivalent to the RFC §6.6 reference algorithm (a log10-based form; + ! same {10^N,3*10^N} acceptance set and same mapping), which likewise returns + ! nranera=0 for n_trials=1; note + ! decoder.f90:145 then special-cases nranera=0 -> ntrials=0 (a legacy-encoding + ! quirk a producer hits only by sending the degenerate n_trials=1 — documented, + ! not "fixed", per the wire-parity scope guardrail). nranera stays <= 18 for any + ! n_trials that fits int32 (10^9), so the decode-site 10**(nranera/2) cannot + ! overflow (read-site bound check — no out-of-range guard needed). + subroutine ntrials_to_nranera_(n_trials, nranera, ok) + integer, intent(in) :: n_trials + integer, intent(out) :: nranera + logical, intent(out) :: ok + integer :: v, k + nranera = 0; ok = .false. + if (n_trials .le. 0) return + v = n_trials + k = 0 + do while (mod(v, 10) .eq. 0) + v = v / 10 + k = k + 1 + end do + if (v .eq. 1) then + nranera = 2 * k; ok = .true. + else if (v .eq. 3) then + nranera = 2 * k + 1; ok = .true. + end if + end subroutine ntrials_to_nranera_ + + ! Phase 9 post-pass: fold the unpacked ndepth/nexp_decode keys into the two + ! derived packed ints (cfg%ndepth_packed / cfg%nexp_decode_packed) and emit the + ! two RFC §6.1/§4.1 atomic-decline errors. Called once after all keys are parsed + ! (the legacy-depth-vs-unpacked conflict is inherently cross-key). Pack rule + ! (RFC §6.1/§6.2): + ! ndepth = depth_level(bits0-2) | use_avg<<4 | deep_ap<<5 | autoclr<<7 + ! nexp_decode = ncontest(bits0-2) | single<<5 | vhf<<6 | q65_pileup<<7 | (nb+3)<<8 + ! depth_level is masked to 3 bits and q65_maxiters to 2, the NB byte clamped to + ! [0,255], so an out-of-range producer value cannot corrupt a sibling bit (none + ! of these reaches a raw array index, so no decode crash). The + ! legacy `depth` full-int is applied verbatim by streaming_apply when NO + ! unpacked ndepth key is set; co-present with any unpacked key it is a conflict + ! (declined here, reusing the configure_type_error envelope for a VALUE-domain + ! error like Phase 8's n_trials/date checks). + subroutine pack_phase9_(cfg, terr) + type(configure_fields), intent(inout) :: cfg + type(control_type_error), intent(inout) :: terr + logical :: any_ndepth, any_nexp + integer :: dl, nb + + any_ndepth = cfg%depth_level_set .or. cfg%q65_maxiters_level_set .or. & + cfg%use_averaging_set .or. cfg%deep_ap_search_set .or. & + cfg%q65_auto_clear_average_set + any_nexp = cfg%contest_type_set .or. cfg%single_decode_set .or. & + cfg%vhf_features_set .or. cfg%noise_blanker_level_set + + ! Conflict: legacy depth (full int) AND any unpacked ndepth key -> decline. + if (cfg%depth_set .and. any_ndepth) then + call set_type_error_(terr, 'ndepth', 'depth|unpacked', 'conflict') + return + end if + + ! Consistency: depth_level (bits 0-2) and q65_maxiters_level (bits 0-1) overlap + ! on bits 0-1 (RFC §6.1). If both are set they MUST agree; an inconsistent pair + ! is a configure_type_error. + if (cfg%depth_level_set .and. cfg%q65_maxiters_level_set) then + if (iand(cfg%depth_level, 3) .ne. iand(cfg%q65_maxiters_level, 3)) then + call set_type_error_(terr, 'q65_maxiters_level', 'match depth_lvl', 'conflict') + return + end if + end if + + if (any_ndepth) then + ! Effective depth_level (bits 0-2): depth_level wins; else derive from + ! q65_maxiters_level (bits 0-1); else 0. + if (cfg%depth_level_set) then + dl = iand(cfg%depth_level, 7) + else if (cfg%q65_maxiters_level_set) then + dl = iand(cfg%q65_maxiters_level, 3) + else + dl = 0 + end if + cfg%ndepth_packed = dl + if (cfg%use_averaging_set .and. cfg%use_averaging) & + cfg%ndepth_packed = ior(cfg%ndepth_packed, 16) + if (cfg%deep_ap_search_set .and. cfg%deep_ap_search) & + cfg%ndepth_packed = ior(cfg%ndepth_packed, 32) + if (cfg%q65_auto_clear_average_set .and. cfg%q65_auto_clear_average) & + cfg%ndepth_packed = ior(cfg%ndepth_packed, 128) + cfg%ndepth_packed_set = .true. + end if + + if (any_nexp) then + cfg%nexp_decode_packed = iand(cfg%contest_type, 7) ! bits 0-2 (collapsed) + if (cfg%single_decode_set .and. cfg%single_decode) & + cfg%nexp_decode_packed = ior(cfg%nexp_decode_packed, 32) + if (cfg%vhf_features_set .and. cfg%vhf_features) & + cfg%nexp_decode_packed = ior(cfg%nexp_decode_packed, 64) + if (cfg%noise_blanker_level_set) then + nb = cfg%noise_blanker_level + 3 ! -3 offset (RFC §6.2; 3 = off) + if (nb .lt. 0) nb = 0 + if (nb .gt. 255) nb = 255 + cfg%nexp_decode_packed = cfg%nexp_decode_packed + nb * 256 + end if + cfg%nexp_decode_packed_set = .true. + end if + end subroutine pack_phase9_ + + ! Map a contest_type wire string to the legacy ncontest int (nexp_decode bits + ! 0-2), applying the GUI's SpecOp 5/8/9 -> 1 collapse. The + ! SpecialOperatingActivity enum (Configuration.hpp:318, compiled only into the + ! widgets/GUI build so the headless core does not link it -> hardcoded here; this + ! comment guards a future upstream enum reorder) is: + ! NONE=0 NA_VHF=1 EU_VHF=2 FIELD_DAY=3 RTTY=4 WW_DIGI=5 FOX=6 HOUND=7 + ! ARRL_DIGI=8 Q65_PILEUP=9 ; mainwindow.cpp:5469-5475 collapses 5,8,9 -> 1. + ! Returns -1 for an unknown string (caller leaves contest_type unset — a + ! value-domain silent skip, like an unknown mode name). Wire strings are the + ! lowercase snake_case names of RFC §6.2. + pure function contest_string_to_int_(s) result(n) + character(len=*), intent(in) :: s + integer :: n + select case (trim(s)) + case ('none'); n = 0 + case ('na_vhf'); n = 1 + case ('eu_vhf'); n = 2 + case ('field_day'); n = 3 + case ('rtty'); n = 4 + case ('ww_digi'); n = 1 ! SpecOp 5 -> collapsed to 1 + case ('fox'); n = 6 + case ('hound'); n = 7 + case ('arrl_digi'); n = 1 ! SpecOp 8 -> collapsed to 1 + case ('q65_pileup'); n = 1 ! SpecOp 9 -> collapsed to 1 + case default; n = -1 + end select + end function contest_string_to_int_ + + pure function upper_(s) result(u) + character(len=*), intent(in) :: s + character(len=len(s)) :: u + integer :: i, c + do i = 1, len(s) + c = iachar(s(i:i)) + if (c .ge. iachar('a') .and. c .le. iachar('z')) then + u(i:i) = achar(c - 32) + else + u(i:i) = s(i:i) + end if + end do + end function upper_ + + ! Locate `key` (a quoted token such as '"depth"') at a STRUCTURAL key position + ! in a flat JSON buffer: preceded (after optional spaces) by '{' or ',' AND + ! followed (after optional spaces) by ':'. Returns found=.true. and vstart = + ! the index of the first value char (after the ':' and any spaces). + ! + ! Anchoring on the structural form is what stops a quoted string VALUE that + ! happens to equal a key token (e.g. {"mycall":"mygrid"}) from being mistaken + ! for that key. The unanchored index() in get_int_/get_string_/get_real_ still + ! carries that pre-existing flaw for value EXTRACTION (left as-is for + ! wire-parity — it only ever leaves a key unset, never misapplies), but it must + ! NOT leak into TYPE validation: an unanchored hit on a value would falsely + ! decline a well-typed frame, or mask a genuine type error on the real key. + ! Scans matches left-to-right and returns the first real key. + subroutine find_key_(buf, key, vstart, blen, found) + character(len=*), intent(in) :: buf, key + integer, intent(out) :: vstart, blen + logical, intent(out) :: found + integer :: start, rel, kpos, klen, p + + found = .false. + vstart = 0 + blen = len_trim(buf) + klen = len_trim(key) + start = 1 + do + if (start .gt. blen) return + rel = index(buf(start:blen), key) + if (rel .eq. 0) return + kpos = start + rel - 1 ! absolute start of this match + start = kpos + 1 ! next search resumes after this match + ! preceding non-space char must be '{' or ',' (a structural key position) + p = kpos - 1 + do while (p .ge. 1) + if (buf(p:p) .ne. ' ') exit + p = p - 1 + end do + if (p .lt. 1) cycle + if (buf(p:p) .ne. '{' .and. buf(p:p) .ne. ',') cycle + ! following non-space char must be ':' + p = kpos + klen + do while (p .le. blen) + if (buf(p:p) .ne. ' ') exit + p = p + 1 + end do + if (p .gt. blen) cycle + if (buf(p:p) .ne. ':') cycle + ! skip ':' and following spaces -> first value char + p = p + 1 + do while (p .le. blen) + if (buf(p:p) .ne. ' ') exit + p = p + 1 + end do + vstart = p + found = .true. + return + end do + end subroutine find_key_ + + ! Classify the JSON value type of `key` in a flat JSON buffer, WITHOUT parsing + ! it, using the structural key locator above. Categorizes by the value's + ! leading char: + ! '"' -> 'string' + ! 't' / 'f' -> 'bool' (true/false) + ! 'n' -> 'null' + ! '}' / ',' -> 'absent' (empty value, e.g. {"mycall":}) — treated as + ! absent so malformed-empty values keep the + ! current silent-skip (configure_parse_error + ! territory, not a type error) + ! anything else -> 'number' (digit, sign, '.', or an odd value the typed + ! parser will soft-reject as today) + ! 'absent' means the key is not present (or has no value), which is never a + ! type error (RFC §4.1: absent key -> leave at current value). + subroutine value_category_(buf, key, cat) + character(len=*), intent(in) :: buf, key + character(len=*), intent(out) :: cat + integer :: vstart, blen + logical :: found + character :: c + + cat = 'absent' + call find_key_(buf, key, vstart, blen, found) + if (.not. found) return + if (vstart .gt. blen) return + c = buf(vstart:vstart) + select case (c) + case ('"'); cat = 'string' + case ('t', 'f'); cat = 'bool' + case ('n'); cat = 'null' + case ('}', ','); cat = 'absent' + case default; cat = 'number' + end select + end subroutine value_category_ + + ! Type-check one configure key against its schema JSON type. Sets + ! proceed=.true. when the key is absent OR present with an accepted category + ! (the caller then parses it). Sets proceed=.false. and records the first + ! type error in `terr` when the key is present with a mismatched category. + ! accept_str : the key accepts a JSON string value + ! accept_num : the key accepts a JSON number value + ! accept_bool : (optional, default .false.) the key accepts a JSON boolean. + ! Added in Phase 4 for my_call_standard/his_call_standard; + ! existing int/real/string callers omit it and reject bools. + ! (a 'null' value is always a mismatch for the keys handled here.) + subroutine check_type_(buf, key, keyname, expected, accept_str, accept_num, & + terr, proceed, accept_bool) + character(len=*), intent(in) :: buf, key, keyname, expected + logical, intent(in) :: accept_str, accept_num + type(control_type_error), intent(inout) :: terr + logical, intent(out) :: proceed + logical, optional, intent(in) :: accept_bool + character(len=8) :: cat + logical :: acc_bool + + acc_bool = .false. + if (present(accept_bool)) acc_bool = accept_bool + call value_category_(buf, key, cat) + proceed = .true. + if (trim(cat) .eq. 'absent') return + if (trim(cat) .eq. 'string' .and. accept_str) return + if (trim(cat) .eq. 'number' .and. accept_num) return + if (trim(cat) .eq. 'bool' .and. acc_bool) return + proceed = .false. + call set_type_error_(terr, keyname, expected, cat) + end subroutine check_type_ + + ! Record the FIRST per-key type error of a frame (subsequent ones are ignored; + ! the whole frame is declined regardless). + subroutine set_type_error_(terr, keyname, expected, got) + type(control_type_error), intent(inout) :: terr + character(len=*), intent(in) :: keyname, expected, got + if (terr%present) return + terr%present = .true. + terr%key = keyname + terr%expected = expected + terr%got = got + end subroutine set_type_error_ + +end module streaming_control diff --git a/lib/streaming_emit.f90 b/lib/streaming_emit.f90 new file mode 100644 index 00000000..fc86246a --- /dev/null +++ b/lib/streaming_emit.f90 @@ -0,0 +1,288 @@ +! Streaming NDJSON emitter. +! +! Hand-rolled JSON output for the streaming protocol. +! Zero-dependency (no Qt, no nlohmann). One line per message on stdout. +! +! Schema (v=1): +! ready {"v":1,"t":"ready","modes":[...],"protocol":1} +! decode {"v":1,"t":"decode","mode":"FT8","time":"HHMMSS", +! "snr":-12,"dt":0.6,"freq":1500,"message":"CQ ..."} +! decode_finished {"v":1,"t":"decode_finished","period_end":"HHMMSS"} +! error {"v":1,"t":"error","msg":"..."} +! error (coded) {"v":1,"t":"error","code":"configure_parse_error","detail":"..."} +! error (version) {"v":1,"t":"error","code":"unknown_schema_version","got":N} +! error (type) {"v":1,"t":"error","code":"configure_type_error", +! "key":"depth","expected":"int","got":"string"} +! warning {"v":1,"t":"warning","code":"period_boundary_discard", +! "discarded_samples":N} +! +! Activation: program jt9 calls streaming_emit_set_enabled(.true.) when +! --stream is parsed. Decoder per-mode sites in lib/decoder.f90 query +! streaming_emit_enabled() and call streaming_emit_decode() instead of +! the legacy write(*,...) text format. When disabled, every routine in +! this module is a no-op so non-streaming jt9 (WAV / shmem) is unchanged. + +module streaming_emit + use, intrinsic :: iso_fortran_env, only: int64, output_unit + implicit none + private + + logical, save :: enabled_ = .false. + + public :: streaming_emit_set_enabled + public :: streaming_emit_enabled + public :: streaming_emit_ready + public :: streaming_emit_decode + public :: streaming_emit_decode_finished + public :: streaming_emit_error + public :: streaming_emit_error_code + public :: streaming_emit_error_version + public :: streaming_emit_error_type + public :: streaming_emit_warning_samples + +contains + + subroutine streaming_emit_set_enabled(flag) + logical, intent(in) :: flag + enabled_ = flag + end subroutine streaming_emit_set_enabled + + pure function streaming_emit_enabled() result(v) + logical :: v + v = enabled_ + end function streaming_emit_enabled + + subroutine streaming_emit_ready() + if (.not. enabled_) return + ! Full jt9-internal mode support (FT8/FT4/JT9/JT65/JT4/FST4/ + ! FST4W/Q65/MSK144). Modes outside this set (e.g., wsprd C2 streaming, + ! map65 I/Q) may extend this list later. + write(output_unit, '(a)') & + '{"v":1,"t":"ready","modes":["FT8","FT4","JT9","JT65","JT4","FST4","FST4W","Q65","MSK144"],"protocol":1}' + flush(output_unit) + end subroutine streaming_emit_ready + + ! Emit one decode line. + ! + ! mode_str : "FT8" / "FT4" / "JT9" / etc. (no escaping) + ! nutc : 4-digit (HHMM) or 6-digit (HHMMSS) integer time + ! snr : SNR in dB (integer; negative allowed) + ! dt : DT seconds (float) + ! freq : decode frequency offset in Hz (integer) + ! msg : decoded message text (gets JSON-escaped + trimmed) + subroutine streaming_emit_decode(mode_str, nutc, snr, dt, freq, msg) + character(len=*), intent(in) :: mode_str + integer, intent(in) :: nutc + integer, intent(in) :: snr + real, intent(in) :: dt + integer, intent(in) :: freq + character(len=*), intent(in) :: msg + + character(len=8) :: time_str + character(len=320) :: msg_escaped + character(len=16) :: dt_str + integer :: msg_len + + if (.not. enabled_) return + + call format_utc_(nutc, time_str) + call json_escape_(msg, msg_escaped, msg_len) + call format_dt_(dt, dt_str) + + write(output_unit, '(5a,i0,3a,i0,3a)') & + '{"v":1,"t":"decode","mode":"', trim(mode_str), & + '","time":"', trim(time_str), & + '","snr":', snr, & + ',"dt":', trim(dt_str), & + ',"freq":', freq, & + ',"message":"', msg_escaped(1:msg_len), & + '"}' + flush(output_unit) + end subroutine streaming_emit_decode + + subroutine streaming_emit_decode_finished(nutc) + integer, intent(in) :: nutc + character(len=8) :: time_str + if (.not. enabled_) return + call format_utc_(nutc, time_str) + write(output_unit, '(3a)') & + '{"v":1,"t":"decode_finished","period_end":"', trim(time_str), & + '"}' + flush(output_unit) + end subroutine streaming_emit_decode_finished + + subroutine streaming_emit_error(msg) + character(len=*), intent(in) :: msg + character(len=320) :: msg_escaped + integer :: msg_len + if (.not. enabled_) return + call json_escape_(msg, msg_escaped, msg_len) + write(output_unit, '(3a)') & + '{"v":1,"t":"error","msg":"', msg_escaped(1:msg_len), '"}' + flush(output_unit) + end subroutine streaming_emit_error + + ! Structured configure-frame error (RFC v1 §4.1). Machine-readable `code` + ! plus a free-text `detail` (JSON-escaped). Used for configure_parse_error. + ! {"v":1,"t":"error","code":"","detail":""} + subroutine streaming_emit_error_code(code, detail) + character(len=*), intent(in) :: code + character(len=*), intent(in) :: detail + character(len=320) :: d_escaped + integer :: d_len + if (.not. enabled_) return + call json_escape_(detail, d_escaped, d_len) + write(output_unit, '(5a)') & + '{"v":1,"t":"error","code":"', trim(code), & + '","detail":"', d_escaped(1:d_len), '"}' + flush(output_unit) + end subroutine streaming_emit_error_code + + ! Unknown schema-version error (RFC v1 §3/§4.1). `got` is the rejected + ! schema version the producer sent in the configure frame. + ! {"v":1,"t":"error","code":"unknown_schema_version","got":} + subroutine streaming_emit_error_version(got) + integer, intent(in) :: got + if (.not. enabled_) return + write(output_unit, '(a,i0,a)') & + '{"v":1,"t":"error","code":"unknown_schema_version","got":', & + got, '}' + flush(output_unit) + end subroutine streaming_emit_error_version + + ! Per-key type-mismatch error (RFC v1 §4.1). The producer sent `key` with a + ! JSON value of type `got` where the schema expects `expected`; the whole + ! configure frame is declined (no partial application). `key`/`expected`/`got` + ! are controlled-vocabulary ASCII tokens (no escaping needed). + ! {"v":1,"t":"error","code":"configure_type_error","key":"", + ! "expected":"","got":""} + subroutine streaming_emit_error_type(key, expected, got) + character(len=*), intent(in) :: key, expected, got + if (.not. enabled_) return + write(output_unit, '(7a)') & + '{"v":1,"t":"error","code":"configure_type_error","key":"', & + trim(key), '","expected":"', trim(expected), & + '","got":"', trim(got), '"}' + flush(output_unit) + end subroutine streaming_emit_error_type + + subroutine streaming_emit_warning_samples(code, discarded_samples) + character(len=*), intent(in) :: code + integer(int64), intent(in) :: discarded_samples + if (.not. enabled_) return + write(output_unit, '(3a,i0,a)') & + '{"v":1,"t":"warning","code":"', trim(code), & + '","discarded_samples":', discarded_samples, '}' + flush(output_unit) + end subroutine streaming_emit_warning_samples + + ! Internals ------------------------------------------------------------- + + ! Format dt (real seconds) as a JSON-safe number. gfortran's f0.x format + ! omits the leading zero (".25" instead of "0.25"), which violates RFC + ! 8259. This wrapper formats with f0.2, then re-inserts a leading zero + ! when the result starts with "." or "-.". + subroutine format_dt_(dt, str) + real, intent(in) :: dt + character(len=*), intent(out) :: str + character(len=16) :: tmp + write(tmp, '(f0.2)') dt + if (tmp(1:1) .eq. '.') then + str = '0' // trim(tmp) + else if (tmp(1:2) .eq. '-.') then + str = '-0' // trim(tmp(2:)) + else + str = trim(tmp) + end if + end subroutine format_dt_ + + ! Format the integer nutc time as 6 chars. 4-digit HHMM gets + ! zero-extended to HHMM00 so consumers always see a 6-char field. + subroutine format_utc_(nutc, str) + integer, intent(in) :: nutc + character(len=*), intent(out) :: str + integer :: hh, mm, ss + str = '000000' + if (nutc .ge. 100000) then + hh = nutc / 10000 + mm = mod(nutc/100, 100) + ss = mod(nutc, 100) + write(str, '(i2.2,i2.2,i2.2)') hh, mm, ss + else if (nutc .ge. 0) then + hh = nutc / 100 + mm = mod(nutc, 100) + write(str, '(i2.2,i2.2,a2)') hh, mm, '00' + end if + end subroutine format_utc_ + + ! Minimal RFC-8259 JSON string escape covering the chars that can + ! appear in WSJT decode payloads: + ! - " -> \" + ! - \ -> \\ + ! - \b \t \n \f \r -> \b \t \n \f \r + ! - other 0..0x1F -> \u00xx + ! - everything else (incl. printable ASCII, UTF-8 bytes) passes through + ! + ! Trailing trim: the input is silently trimmed to its non-blank length + ! before escaping (decoder messages are right-padded fixed-width strings). + ! Output buffer must be large enough for worst case 6x input len. + subroutine json_escape_(in_str, out_str, out_len) + character(len=*), intent(in) :: in_str + character(len=*), intent(out) :: out_str + integer, intent(out) :: out_len + + integer :: i, n, code + character :: c + + n = len_trim(in_str) + out_len = 0 + out_str = ' ' + + do i = 1, n + c = in_str(i:i) + code = iachar(c) + select case (code) + case (iachar('"')) + call append_pair_('\', '"', out_str, out_len) + case (iachar('\')) + call append_pair_('\', '\', out_str, out_len) + case (8) ! BS + call append_pair_('\', 'b', out_str, out_len) + case (9) ! HT + call append_pair_('\', 't', out_str, out_len) + case (10) ! LF + call append_pair_('\', 'n', out_str, out_len) + case (12) ! FF + call append_pair_('\', 'f', out_str, out_len) + case (13) ! CR + call append_pair_('\', 'r', out_str, out_len) + case (0:7, 11, 14:31) + call append_unicode_(code, out_str, out_len) + case default + out_len = out_len + 1 + out_str(out_len:out_len) = c + end select + end do + end subroutine json_escape_ + + subroutine append_pair_(a, b, buf, idx) + character, intent(in) :: a, b + character(len=*), intent(inout) :: buf + integer, intent(inout) :: idx + idx = idx + 1; buf(idx:idx) = a + idx = idx + 1; buf(idx:idx) = b + end subroutine append_pair_ + + subroutine append_unicode_(code, buf, idx) + integer, intent(in) :: code + character(len=*), intent(inout) :: buf + integer, intent(inout) :: idx + character(len=4) :: hex4 + write(hex4, '(z4.4)') code + idx = idx + 1; buf(idx:idx) = '\' + idx = idx + 1; buf(idx:idx) = 'u' + buf(idx+1:idx+4) = hex4 + idx = idx + 4 + end subroutine append_unicode_ + +end module streaming_emit diff --git a/lib/streaming_io.f90 b/lib/streaming_io.f90 new file mode 100644 index 00000000..98c9a13e --- /dev/null +++ b/lib/streaming_io.f90 @@ -0,0 +1,466 @@ +! Streaming I/O — framed audio + control on stdin. +! +! Reads framed messages from stdin. After a +! one-time 8-byte WSJT session header (4-byte magic 'WSJT' + 1-byte fmt +! + 1-byte channels + 2-byte rate_kHz LE), stdin carries a sequence of +! frames: +! +! [type:1][len:4 LE][body:len bytes] +! +! Frame types: +! 0x01 audio chunk body = N samples in declared format +! 0x02 control JSON body = UTF-8 JSON line (no trailing newline) +! +! Other types are skipped (forward-compat: consumers ignore unknown +! frame types just as NDJSON consumers ignore unknown "t" values). +! +! Control frames recognized today: {"t":"configure",...}, {"t":"halt"}. +! See lib/streaming_control.f90 for the parser + schema. +! +! Apply policy: +! configure : applied immediately at receive. If mode changes, the +! in-flight sample accumulator is discarded (k=0) — the +! buffered audio is wrong-format for the new mode anyway. +! Producers should send `configure` FIRST, before any +! audio frames; subsequent audio is interpreted under the +! most recent configure. +! halt : drain current period (call decoder if k>0), exit clean. +! +! Period boundary: when k accumulates to `npts` samples (mode-dependent), +! we run the decoder. Audio frames that overflow `npts` have the excess +! discarded — producers should chunk audio so that any single frame fits +! within one period, OR send exactly `npts` samples per period. An +! external producer should honor this. +! +! Format support: fmt=0x00 (int16 PCM) only. Other formats may be +! added later. +! +! Platform: reads stdin through a portable C read-fully helper on fd 0 +! (stream_stdin_read_fully, lib/stream_stdin.c) — the same code path on +! every platform. Fortran unit I/O cannot read a redirected stdin +! portably: native Windows has no /dev/stdin, and re-OPENing the +! preconnected unit 5 with ACCESS='STREAM' is non-conforming (F2018 +! 12.5.6.1 — ACCESS is not a changeable mode), rejected by libgfortran +! everywhere. Binary mode is forced on Windows first via +! stream_set_stdin_binary (lib/stream_setmode.c; no-op on POSIX). The +! helper loops read() until the request fills or the stream truly ends, +! so a pipe short-read is never mistaken for EOF. + +subroutine jt9_stream(shared_data, mode, TRperiod) + use, intrinsic :: iso_fortran_env, only: int8, int16, int64, error_unit + use, intrinsic :: ieee_arithmetic, only: ieee_is_finite + use, intrinsic :: iso_c_binding, only: c_int64_t + use prog_args, only: data_dir + use timer_module, only: timer + use streaming_emit, only: streaming_emit_ready, & + streaming_emit_decode_finished, streaming_emit_error, & + streaming_emit_error_code, streaming_emit_error_version, & + streaming_emit_error_type, streaming_emit_warning_samples + use streaming_control, only: parse_control_frame, configure_fields, & + control_type_error, CTRL_CONFIGURE, CTRL_HALT, CTRL_PARSE_ERR + use streaming_apply, only: apply_configure_fields + + include 'jt9com.f90' + + type(dec_data) :: shared_data + integer :: mode + real(8) :: TRperiod + + integer, parameter :: HDR_LEN = 8 + integer, parameter :: NFSAMPLE = 12000 + integer, parameter :: FRAME_AUDIO = 1 + integer, parameter :: FRAME_CONTROL = 2 + integer, parameter :: CTL_BUF_LEN = 1024 + ! 4-byte session magic "WSJT" (W=0x57 S=0x53 J=0x4A T=0x54) + integer(int8), parameter :: MAGIC(4) = [ & + int(z'57', int8), int(z'53', int8), & + int(z'4A', int8), int(z'54', int8) ] + + integer :: ios, fmt, ch, rate_khz + integer(int8) :: hdr(HDR_LEN), type_byte(1), len_bytes(4) + integer(int64) :: frame_len_wide, max_audio_frame_bytes + integer :: frame_len + + integer :: nsps, kstep, npts, k, nhsym, nhsym0 + integer :: ingain, nminw, ihsym, npts8 + real :: pxdb, df3, pxdbmax, s(NSMAX) + integer :: npct_unused + integer :: body_left, take_bytes, take_samples + integer(int64) :: discarded_samples + integer(int16) :: chunk(4096) + integer(int8) :: byte_sink(4096) + ! FT8 progressive-decode working buffer (mirrors jt9.f90:19's id2a) — the + ! FT8 decoder's `dd` array is populated only on nzhsym <= 47 calls, so we + ! mirror the WAV path's 41/47/50 call cadence with a working copy zeroed + ! past the per-call sample boundary. + integer(int16), save :: id2a(180000) !Keep this big array off the stack + character(len=CTL_BUF_LEN) :: ctl_buf + integer(int8) :: ctl_bytes(CTL_BUF_LEN) + integer :: i_ctl, prev_mode + ! Session-baseline nfa/nfb stashed after jt9.f90's init_streaming_extra_fields + ! returned. apply_configure_fields restores these on mode change with no + ! explicit consumer override; passed in as dummy args. + integer :: baseline_nfa, baseline_nfb + logical :: bLowSidelobes, eof_period, halt_req + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + + ! C stdin helpers. stream_set_stdin_binary (lib/stream_setmode.c) is a + ! no-op on POSIX; stream_stdin_read_fully (lib/stream_stdin.c) is the + ! read-fully byte reader used on all platforms. + interface + subroutine stream_set_stdin_binary() bind(C, name="stream_set_stdin_binary") + end subroutine stream_set_stdin_binary + function stream_stdin_read_fully(buf, n) result(nread) & + bind(C, name="stream_stdin_read_fully") + import :: c_int64_t + type(*), dimension(*), intent(inout) :: buf + integer(c_int64_t), value :: n + integer(c_int64_t) :: nread + end function stream_stdin_read_fully + end interface + + bLowSidelobes = .false. + ingain = 0 + nminw = 1 + + ! Read the framed byte stream from stdin via the C helper (stdin_read + ! below) — no Fortran unit is opened. Binary mode must be forced before + ! the first read on Windows or the CRT stops at 0x1A and rewrites CRLF. + call stream_set_stdin_binary() + + call stdin_read(hdr, HDR_LEN, ios) + if (ios /= 0) then + call streaming_emit_error('short header (need 8 bytes)') + write(error_unit, '(a)') 'jt9 --stream: short header (need 8 bytes)' + stop 1 + end if + + if (any(hdr(1:4) /= MAGIC)) then + call streaming_emit_error('bad magic (expected ''WSJT'')') + write(error_unit, '(a)') 'jt9 --stream: bad magic (expected ''WSJT'')' + stop 1 + end if + + fmt = iand(int(hdr(5)), 255) + ch = iand(int(hdr(6)), 255) + rate_khz = iand(int(hdr(7)), 255) + ishft(iand(int(hdr(8)), 255), 8) + + if (fmt /= 0) then + call streaming_emit_error('unsupported format (only fmt=0 int16 PCM supported)') + write(error_unit, '(a,i0,a)') & + 'jt9 --stream: unsupported fmt=', fmt, ' (only int16 PCM supported)' + stop 1 + end if + + if (ch /= 1) then + call streaming_emit_error('unsupported channel count (only mono supported)') + write(error_unit, '(a,i0,a)') & + 'jt9 --stream: unsupported channels=', ch, ' (only mono supported)' + stop 1 + end if + + if (rate_khz /= 12) then + call streaming_emit_error('unsupported sample rate (only 12 kHz supported)') + write(error_unit, '(a,i0,a)') & + 'jt9 --stream: unsupported rate=', rate_khz, ' kHz (only 12 kHz supported)' + stop 1 + end if + + write(error_unit, '(a,i0,a,i0,a,i0,a)') & + 'jt9 --stream: header ok (fmt=', fmt, ' ch=', ch, & + ' rate=', rate_khz, ' kHz)' + + nsps = 6912 + kstep = nsps / 2 + + ! Streaming-specific params override. The full params init was already + ! performed in jt9.f90's stream-mode dispatch arm via + ! init_default_params + init_streaming_extra_fields; + ! all that remains here is the streaming-vs-WAV diff. + ! + ! CRITICAL: ndiskdat = .true. Without it, ft8_decode.f90:141 bails out at + ! tseq >= 14.3s ("real-time mode, leave time for next period") — but + ! streaming calls multimode_decoder once per period at end-of-period when + ! tseq >= 15.0, so the bail ALWAYS fires and zero decodes are produced. + ! ndiskdat=.true. tells the decoder "complete-period one-shot, don't bail". + shared_data%params%ndiskdat = .true. + + ! Stash session-baseline nfa/nfb. apply_configure_fields + ! restores these on mode change with no explicit consumer override — + ! mirrors WAV semantics where each invocation starts from CLI defaults. + baseline_nfa = shared_data%params%nfa + baseline_nfb = shared_data%params%nfb + + call streaming_emit_ready() + max_audio_frame_bytes = 2_int64 * int(size(shared_data%id2), int64) + + ! ===== Outer period loop =========================================== + do + ! Compute per-period sample target. (Same multi-mode logic.) + npts = int(TRperiod * NFSAMPLE) + if (mode .eq. 5) npts = 21 * 3456 + if (npts > size(shared_data%id2)) npts = size(shared_data%id2) + if (npts < 1) npts = NFSAMPLE + if (mode .eq. 8 .and. npts .gt. 50 * 3456) npts = 50 * 3456 + + shared_data%id2 = 0 + k = 0 + nhsym = 0 + nhsym0 = 0 ! seed at 0 so the symspec catch-up loop is O(nhsym) + eof_period = .false. + halt_req = .false. + + ! Inner frame loop: read frames until period full, halt, or EOF. + do while (k .lt. npts .and. .not. halt_req .and. .not. eof_period) + call stdin_read(type_byte, 1, ios) + if (ios /= 0) then + eof_period = .true.; exit + end if + call stdin_read(len_bytes, 4, ios) + if (ios /= 0) then + eof_period = .true.; exit + end if + frame_len_wide = iand(int(len_bytes(1), int64), int(z'FF', int64)) & + + 256_int64 * iand(int(len_bytes(2), int64), int(z'FF', int64)) & + + 65536_int64 * iand(int(len_bytes(3), int64), int(z'FF', int64)) & + + 16777216_int64 * iand(int(len_bytes(4), int64), int(z'FF', int64)) + if (frame_len_wide .gt. max_audio_frame_bytes) then + call streaming_emit_error_code('frame_too_large', & + 'frame length exceeds the streaming sample-buffer capacity') + write(error_unit, '(a,i0,a,i0)') 'jt9 --stream: frame length ', & + frame_len_wide, ' exceeds capacity ', max_audio_frame_bytes + stop 1 + end if + frame_len = int(frame_len_wide) + + if (iand(int(type_byte(1)), 255) .eq. FRAME_AUDIO) then + if (mod(frame_len, 2) /= 0) then + call streaming_emit_error_code('odd_audio_frame', & + 'audio frame length must contain whole int16 samples') + body_left = frame_len + do while (body_left .gt. 0) + take_bytes = min(body_left, size(byte_sink)) + call stdin_read(byte_sink, take_bytes, ios) + if (ios /= 0) then + eof_period = .true.; exit + end if + body_left = body_left - take_bytes + end do + cycle + end if + discarded_samples = max(0_int64, frame_len_wide / 2_int64 & + - int(npts - k, int64)) + if (discarded_samples .gt. 0_int64) then + call streaming_emit_warning_samples('period_boundary_discard', & + discarded_samples) + end if + body_left = frame_len + do while (body_left .gt. 0) + if (k .lt. npts) then + take_bytes = min(body_left, 2 * size(chunk)) + take_samples = take_bytes / 2 + call stdin_read(chunk, 2*take_samples, ios) + if (ios /= 0) then + eof_period = .true.; exit + end if + if (k + take_samples .gt. npts) take_samples = npts - k + shared_data%id2(k+1 : k+take_samples) = & + chunk(1:take_samples) + k = k + take_samples + body_left = body_left - take_bytes + ! Incremental symspec for JT9-family at kstep boundaries. + ! Cap at nhsym=181 to match the WAV-path exit condition + ! (jt9.f90:442-443) — exceeding it overruns ss(184,*). + do while ((k - 2048) / kstep .gt. nhsym0 .and. nhsym0 .lt. 181) + nhsym0 = nhsym0 + 1 + if (nhsym0 .lt. 1) cycle + nhsym = nhsym0 + if (mode .eq. 9 .or. mode .eq. 74) then + call timer('symspec ', 0) + call symspec(shared_data, nhsym*kstep + 2048, nsps, & + ingain, bLowSidelobes, nminw, pxdb, s, df3, & + ihsym, npts8, pxdbmax, npct_unused) + call timer('symspec ', 1) + end if + end do + else + ! Period full: drain the rest of this audio frame. + take_bytes = min(body_left, size(byte_sink)) + call stdin_read(byte_sink, take_bytes, ios) + if (ios /= 0) then + eof_period = .true.; exit + end if + body_left = body_left - take_bytes + end if + end do + + else if (iand(int(type_byte(1)), 255) .eq. FRAME_CONTROL) then + ! Read JSON body into char buffer (cap at CTL_BUF_LEN) + if (frame_len .gt. CTL_BUF_LEN) then + call streaming_emit_error_code('control_frame_too_large', & + 'control frame exceeds the configured buffer capacity') + ! drain + skip + body_left = frame_len + do while (body_left .gt. 0) + take_bytes = min(body_left, size(byte_sink)) + call stdin_read(byte_sink, take_bytes, ios) + if (ios /= 0) exit + body_left = body_left - take_bytes + end do + cycle + end if + call stdin_read(ctl_bytes, frame_len, ios) + if (ios /= 0) then + eof_period = .true.; exit + end if + ctl_buf = ' ' + do i_ctl = 1, frame_len + ctl_buf(i_ctl:i_ctl) = achar(iand(int(ctl_bytes(i_ctl)), 255)) + end do + call parse_control_frame(ctl_buf(1:frame_len), action, cfg, terr) + select case (action) + case (CTRL_HALT) + halt_req = .true. + case (CTRL_CONFIGURE) + if (cfg%version_set .and. cfg%version .ne. 1) then + ! RFC v1 §3/§4.1: unknown schema version -> decline this frame. + ! Checked BEFORE per-key types: an unrecognized version means + ! we cannot trust the body's schema. (A wrong-TYPED version + ! leaves version_set=.false., so it falls through to the + ! type-error gate below — reported as configure_type_error + ! key:"version" only if version is the sole mistyped key; + ! otherwise the FIRST mistyped key wins, since parse records + ! one error and checks version last. Either way: declined.) + call streaming_emit_error_version(cfg%version) + cycle + end if + if (terr%present) then + ! RFC v1 §4.1: a key's JSON value type mismatched the schema. + ! Decline the ENTIRE frame — no field is applied (the apply + ! below is gated on reaching it; cycle skips it AND the npts/ + ! buffer-discard logic, so a co-present valid key never takes + ! effect). + call streaming_emit_error_type(trim(terr%key), & + trim(terr%expected), trim(terr%got)) + cycle + end if + if (cfg%mode_invalid) then + call streaming_emit_error_code('unknown_mode', & + 'configure frame contains an unsupported mode') + cycle + end if + if (cfg%trperiod_set .and. & + (.not. ieee_is_finite(cfg%trperiod) .or. & + cfg%trperiod .le. 0.d0 .or. & + cfg%trperiod .gt. dble(NTMAX))) then + call streaming_emit_error_code('invalid_trperiod', & + 'trperiod must be finite and between 0 and 1800 seconds') + cycle + end if + prev_mode = mode + call apply_configure_fields(cfg, mode, TRperiod, & + shared_data%params, baseline_nfa, baseline_nfb) + ! Mode changed: in-flight samples are wrong format. Discard + ! and recompute npts. Producer should configure FIRST so + ! this branch is rare/diagnostic. + if (cfg%mode_set .and. mode .ne. prev_mode) then + npts = int(TRperiod * NFSAMPLE) + if (mode .eq. 5) npts = 21 * 3456 + if (npts .gt. size(shared_data%id2)) npts = size(shared_data%id2) + if (npts .lt. 1) npts = NFSAMPLE + if (mode .eq. 8 .and. npts .gt. 50 * 3456) npts = 50 * 3456 + shared_data%id2 = 0 + k = 0 + nhsym = 0 + nhsym0 = 0 + else if (cfg%trperiod_set) then + ! TRperiod-only change: recompute npts but keep accumulated samples. + npts = int(TRperiod * NFSAMPLE) + if (mode .eq. 5) npts = 21 * 3456 + if (mode .eq. 8 .and. npts .gt. 50 * 3456) npts = 50 * 3456 + if (npts .gt. size(shared_data%id2)) npts = size(shared_data%id2) + end if + case (CTRL_PARSE_ERR) + call streaming_emit_error_code('configure_parse_error', & + 'malformed control frame (missing or invalid t field)') + end select + + else + ! Unknown frame type: drain body + body_left = frame_len + do while (body_left .gt. 0) + take_bytes = min(body_left, size(byte_sink)) + call stdin_read(byte_sink, take_bytes, ios) + if (ios /= 0) then + eof_period = .true.; exit + end if + body_left = body_left - take_bytes + end do + end if + end do + + ! Run decoder if we accumulated any samples this period. + if (k .gt. 0) then + shared_data%params%newdat = .true. + shared_data%params%nzhsym = nhsym + ! FT8 override: decoder is tuned for nzhsym=50 (cf. jt9.f90:552). + if (mode .eq. 8) shared_data%params%nzhsym = 50 + ! Non-FT8/FST4/Q65: cap at 181 to match WAV-path exit (ss array bound). + if (mode .ne. 8 .and. mode .ne. 240 .and. mode .ne. 241 .and. & + mode .ne. 242 .and. mode .ne. 66 .and. shared_data%params%nzhsym .gt. 181) then + shared_data%params%nzhsym = 181 + end if + shared_data%params%kin = 64800 + if (mode .eq. 240) shared_data%params%kin = 720000 + if (mode .eq. 241) shared_data%params%kin = 720000 + if (mode .eq. 242) shared_data%params%kin = 720000 + + if (mode .eq. 144) then + call decode_msk144(shared_data%id2, shared_data%params, data_dir) + else if (mode .eq. 8 .and. .not. shared_data%params%lmultift8) then + ! FT8 progressive 41/47/50 sequence (mirrors jt9.f90:562-581). + ! Without the early calls, ft8_decode.f90's saved `dd` array stays + ! unset and the final nzhsym=50 call decodes silence. With the + ! sequence, dd is populated on the nzhsym=41/47 passes and the + ! nzhsym=50 final pass produces real decodes. + shared_data%params%nzhsym = 41 + id2a(1:41*3456) = shared_data%id2(1:41*3456) + id2a(41*3456+1:) = 0 + call multimode_decoder(shared_data%ss, id2a, shared_data%params, NFSAMPLE) + + shared_data%params%nzhsym = 47 + id2a(1:47*3456) = shared_data%id2(1:47*3456) + id2a(47*3456+1:) = 0 + call multimode_decoder(shared_data%ss, id2a, shared_data%params, NFSAMPLE) + + shared_data%params%nzhsym = 50 + id2a(1:50*3456) = shared_data%id2(1:50*3456) + id2a(50*3456+1:) = 0 + call multimode_decoder(shared_data%ss, id2a, shared_data%params, NFSAMPLE) + else + call multimode_decoder(shared_data%ss, shared_data%id2, & + shared_data%params, NFSAMPLE) + end if + end if + + if (halt_req .or. eof_period) return + end do + +contains + + ! Read exactly nbytes from stdin via the C helper; ios=0 on success, + ! ios=1 on end-of-stream (short delivery — the producer closed the + ! pipe). Every caller treats nonzero ios as end-of-stream, matching + ! the old unformatted-stream-read iostat contract. + subroutine stdin_read(buf, nbytes, ios) + type(*), dimension(*), intent(inout) :: buf + integer, intent(in) :: nbytes + integer, intent(out) :: ios + ios = 0 + if (stream_stdin_read_fully(buf, int(nbytes, c_int64_t)) /= & + int(nbytes, c_int64_t)) ios = 1 + end subroutine stdin_read + +end subroutine jt9_stream diff --git a/lib/subtract65.f90 b/lib/subtract65.f90 index cf6e00e3..7469472c 100644 --- a/lib/subtract65.f90 +++ b/lib/subtract65.f90 @@ -62,7 +62,7 @@ subroutine subtract65(dd,npts,f0,dt) cref(ind)=cexp(cmplx(0.0,phi)) phi=modulo(phi+dphi,2*pi) id=nstart-1+ind - if(id.ge.1) camp(ind)=dd(id)*conjg(cref(ind)) + if(id.ge.1 .and. id.le.npts) camp(ind)=dd(id)*conjg(cref(ind)) ind=ind+1 enddo enddo diff --git a/lib/sumsim.f90 b/lib/sumsim.f90 index 594b8b20..7236b47c 100644 --- a/lib/sumsim.f90 +++ b/lib/sumsim.f90 @@ -35,7 +35,7 @@ program sumsim fac=1.0/nargs iwave(1:npts)=nint(fac*wave(1:npts)) - open(12,file='000001_0000.wav',access='stream',status='unknown') + open(12,file='000001_0000.wav',access='stream',status='replace') write(12) h,iwave(1:npts) close(12) diff --git a/lib/superfox/qpc/nhash2.c b/lib/superfox/qpc/nhash2.c index 78817c7d..5453947b 100644 --- a/lib/superfox/qpc/nhash2.c +++ b/lib/superfox/qpc/nhash2.c @@ -1,383 +1,9 @@ -/* - - File name: nhash2.c - - *------------------------------------------------------------------------------ - * - * This file is part of the WSPR application, Weak Signal Propogation Reporter - * - * File Name: nhash.c - * Description: Functions to produce 32-bit hashes for hash table lookup - * - * Copyright (C) 2008-2014 Joseph Taylor, K1JT - * License: GNU GPL v3+ - * - * 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; either 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 for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin - * Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Files: lookup3.c - * Copyright: Copyright (C) 2006 Bob Jenkins - * License: public-domain - * You may use this code any way you wish, private, educational, or commercial. - * It's free. - * - *------------------------------------------------------------------------------- -*/ - -/* -These are functions for producing 32-bit hashes for hash table lookup. -hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final() -are externally useful functions. Routines to test the hash are included -if SELF_TEST is defined. You can use this free for any purpose. It's in -the public domain. It has no warranty. - -You probably want to use hashlittle(). hashlittle() and hashbig() -hash byte arrays. hashlittle() is is faster than hashbig() on -little-endian machines. Intel and AMD are little-endian machines. -On second thought, you probably want hashlittle2(), which is identical to -hashlittle() except it returns two 32-bit hashes for the price of one. -You could implement hashbig2() if you wanted but I haven't bothered here. - -If you want to find a hash of, say, exactly 7 integers, do - a = i1; b = i2; c = i3; - mix(a,b,c); - a += i4; b += i5; c += i6; - mix(a,b,c); - a += i7; - final(a,b,c); -then use c as the hash value. If you have a variable length array of -4-byte integers to hash, use hashword(). If you have a byte array (like -a character string), use hashlittle(). If you have several byte arrays, or -a mix of things, see the comments above hashlittle(). - -Why is this so big? I read 12 bytes at a time into 3 4-byte integers, -then mix those integers. This is fast (you can do a lot more thorough -mixing with 12*3 instructions on 3 integers than you can with 3 instructions -on 1 byte), but shoehorning those bytes into integers efficiently is messy. -*/ - -#define SELF_TEST 1 - -#include /* defines printf for tests */ -#include /* defines time_t for timings in the test */ #include "nhash2.h" -//#include /* attempt to define endianness */ -//#ifdef linux -//# include /* attempt to define endianness */ -//#endif - -#define HASH_LITTLE_ENDIAN 1 - -#define hashsize(n) ((uint32_t)1<<(n)) -#define hashmask(n) (hashsize(n)-1) -#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) - -/* -------------------------------------------------------------------------------- -mix -- mix 3 32-bit values reversibly. - -This is reversible, so any information in (a,b,c) before mix() is -still in (a,b,c) after mix(). - -If four pairs of (a,b,c) inputs are run through mix(), or through -mix() in reverse, there are at least 32 bits of the output that -are sometimes the same for one pair and different for another pair. -This was tested for: -* pairs that differed by one bit, by two bits, in any combination - of top bits of (a,b,c), or in any combination of bottom bits of - (a,b,c). -* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed - the output delta to a Gray code (a^(a>>1)) so a string of 1's (as - is commonly produced by subtraction) look like a single 1-bit - difference. -* the base values were pseudorandom, all zero but one bit set, or - all zero plus a counter that starts at zero. - -Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that -satisfy this are - 4 6 8 16 19 4 - 9 15 3 18 27 15 - 14 9 3 7 17 3 -Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing -for "differ" defined as + with a one-bit base and a two-bit delta. I -used http://burtleburtle.net/bob/hash/avalanche.html to choose -the operations, constants, and arrangements of the variables. - -This does not achieve avalanche. There are input bits of (a,b,c) -that fail to affect some output bits of (a,b,c), especially of a. The -most thoroughly mixed value is c, but it doesn't really even achieve -avalanche in c. - -This allows some parallelism. Read-after-writes are good at doubling -the number of bits affected, so the goal of mixing pulls in the opposite -direction as the goal of parallelism. I did what I could. Rotates -seem to cost as much as shifts on every machine I could lay my hands -on, and rotates are much kinder to the top and bottom bits, so I used -rotates. -------------------------------------------------------------------------------- -*/ -#define mix(a,b,c) \ -{ \ - a -= c; a ^= rot(c, 4); c += b; \ - b -= a; b ^= rot(a, 6); a += c; \ - c -= b; c ^= rot(b, 8); b += a; \ - a -= c; a ^= rot(c,16); c += b; \ - b -= a; b ^= rot(a,19); a += c; \ - c -= b; c ^= rot(b, 4); b += a; \ -} - -/* -------------------------------------------------------------------------------- -final -- final mixing of 3 32-bit values (a,b,c) into c - -Pairs of (a,b,c) values differing in only a few bits will usually -produce values of c that look totally different. This was tested for -* pairs that differed by one bit, by two bits, in any combination - of top bits of (a,b,c), or in any combination of bottom bits of - (a,b,c). -* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed - the output delta to a Gray code (a^(a>>1)) so a string of 1's (as - is commonly produced by subtraction) look like a single 1-bit - difference. -* the base values were pseudorandom, all zero but one bit set, or - all zero plus a counter that starts at zero. - -These constants passed: - 14 11 25 16 4 14 24 - 12 14 25 16 4 14 24 -and these came close: - 4 8 15 26 3 22 24 - 10 8 15 26 3 22 24 - 11 8 15 26 3 22 24 -------------------------------------------------------------------------------- -*/ -#define final(a,b,c) \ -{ \ - c ^= b; c -= rot(b,14); \ - a ^= c; a -= rot(c,11); \ - b ^= a; b -= rot(a,25); \ - c ^= b; c -= rot(b,16); \ - a ^= c; a -= rot(c,4); \ - b ^= a; b -= rot(a,14); \ - c ^= b; c -= rot(b,24); \ -} -/* -------------------------------------------------------------------------------- -hashlittle() -- hash a variable-length key into a 32-bit value - k : the key (the unaligned variable-length array of bytes) - length : the length of the key, counting by bytes - initval : can be any 4-byte value -Returns a 32-bit value. Every bit of the key affects every bit of -the return value. Two keys differing by one or two bits will have -totally different hash values. +#include "../../lookup3.h" -The best hash table sizes are powers of 2. There is no need to do -mod a prime (mod is sooo slow!). If you need less than 32 bits, -use a bitmask. For example, if you need only 10 bits, do - h = (h & hashmask(10)); -In which case, the hash table should have hashsize(10) elements. - -If you are hashing n strings (uint8_t **)k, do it like this: - for (i=0, h=0; i 12) - { - a += k[0]; - b += k[1]; - c += k[2]; - mix(a,b,c); - length -= 12; - k += 3; - } - - // printf("AAA %x %d %x %d\n",c,c,c&32767,c&32767); - - /*----------------------------- handle the last (probably partial) block */ - /* - * "k[2]&0xffffff" actually reads beyond the end of the string, but - * then masks off the part it's not allowed to read. Because the - * string is aligned, the masked-off tail is in the same word as the - * rest of the string. Every machine with memory protection I've seen - * does it on word boundaries, so is OK with this. But VALGRIND will - * still catch it and complain. The masking trick does make the hash - * noticably faster for short strings (like English words). - */ -#ifndef VALGRIND - - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break; - case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break; - case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break; - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=k[1]&0xffffff; a+=k[0]; break; - case 6 : b+=k[1]&0xffff; a+=k[0]; break; - case 5 : b+=k[1]&0xff; a+=k[0]; break; - case 4 : a+=k[0]; break; - case 3 : a+=k[0]&0xffffff; break; - case 2 : a+=k[0]&0xffff; break; - case 1 : a+=k[0]&0xff; break; - case 0 : return c; /* zero length strings require no mixing */ - } - -#else /* make valgrind happy */ - - k8 = (const uint8_t *)k; - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ - case 10: c+=((uint32_t)k8[9])<<8; /* fall through */ - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ - case 6 : b+=((uint32_t)k8[5])<<8; /* fall through */ - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]; break; - case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ - case 2 : a+=((uint32_t)k8[1])<<8; /* fall through */ - case 1 : a+=k8[0]; break; - case 0 : return c; - } - -#endif /* !valgrind */ - - } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { - const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */ - const uint8_t *k8; - - /*--------------- all but last block: aligned reads and different mixing */ - while (length > 12) - { - a += k[0] + (((uint32_t)k[1])<<16); - b += k[2] + (((uint32_t)k[3])<<16); - c += k[4] + (((uint32_t)k[5])<<16); - mix(a,b,c); - length -= 12; - k += 6; - } - - /*----------------------------- handle the last (probably partial) block */ - k8 = (const uint8_t *)k; - switch(length) - { - case 12: c+=k[4]+(((uint32_t)k[5])<<16); - b+=k[2]+(((uint32_t)k[3])<<16); - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ - case 10: c+=k[4]; - b+=k[2]+(((uint32_t)k[3])<<16); - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[2]+(((uint32_t)k[3])<<16); - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ - case 6 : b+=k[2]; - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ - case 2 : a+=k[0]; - break; - case 1 : a+=k8[0]; - break; - case 0 : return c; /* zero length requires no mixing */ - } - - } else { /* need to read the key one byte at a time */ - const uint8_t *k = (const uint8_t *)key; - - /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ - while (length > 12) - { - a += k[0]; - a += ((uint32_t)k[1])<<8; - a += ((uint32_t)k[2])<<16; - a += ((uint32_t)k[3])<<24; - b += k[4]; - b += ((uint32_t)k[5])<<8; - b += ((uint32_t)k[6])<<16; - b += ((uint32_t)k[7])<<24; - c += k[8]; - c += ((uint32_t)k[9])<<8; - c += ((uint32_t)k[10])<<16; - c += ((uint32_t)k[11])<<24; - mix(a,b,c); - length -= 12; - k += 12; - } - - /*-------------------------------- last block: affect all 32 bits of (c) */ - switch(length) /* all the case statements fall through */ - { - case 12: c+=((uint32_t)k[11])<<24; - /* fall through */ - case 11: c+=((uint32_t)k[10])<<16; - /* fall through */ - case 10: c+=((uint32_t)k[9])<<8; - /* fall through */ - case 9 : c+=k[8]; - /* fall through */ - case 8 : b+=((uint32_t)k[7])<<24; - /* fall through */ - case 7 : b+=((uint32_t)k[6])<<16; - /* fall through */ - case 6 : b+=((uint32_t)k[5])<<8; - /* fall through */ - case 5 : b+=k[4]; - /* fall through */ - case 4 : a+=((uint32_t)k[3])<<24; - /* fall through */ - case 3 : a+=((uint32_t)k[2])<<16; - /* fall through */ - case 2 : a+=((uint32_t)k[1])<<8; - /* fall through */ - case 1 : a+=k[0]; - break; - case 0 : return c; - } - } - - final(a,b,c); - return c; + /* SuperFox applies its 21-bit CRC mask after hashing. */ + return wsjt_hashlittle(key, (size_t)length, initval); } diff --git a/lib/superfox/qpc/nhash2.h b/lib/superfox/qpc/nhash2.h index 1864a93f..4cdcd4a1 100644 --- a/lib/superfox/qpc/nhash2.h +++ b/lib/superfox/qpc/nhash2.h @@ -1,5 +1,5 @@ -#ifndef NHASH_H_ -#define NHASH_H_ +#ifndef SUPERFOX_NHASH2_H_ +#define SUPERFOX_NHASH2_H_ #ifdef Win32 #include "win_stdint.h" /* defines uint32_t etc */ @@ -12,8 +12,7 @@ extern "C" { #endif -uint32_t nhash( const void * key, uint64_t length, uint32_t initval); - //int nhash(const char *key, int length, int initval); +uint32_t nhash2(const void *key, uint64_t length, uint32_t initval); #ifdef __cplusplus } diff --git a/lib/superfox/qpc/np_rnd.c b/lib/superfox/qpc/np_rnd.c index df2afacc..ca6f675b 100644 --- a/lib/superfox/qpc/np_rnd.c +++ b/lib/superfox/qpc/np_rnd.c @@ -27,7 +27,7 @@ #elif _SVID_SOURCE || _XOPEN_SOURCE || __unix__ || (defined (__APPLE__) && defined(__MACH__)) /* POSIX or Unix or Apple */ #include #define rand_s(x) (*x)=(unsigned int)lrand48() // returns unsigned integers in the range 0..0x7FFFFFFF - #define K_RAND_MAX 0x7FFFFFFF // that's the max number + #define K_RAND_MAX 2147483647.0f // that's the max number // generated by lrand48 #else #error "No good quality PRNG found" diff --git a/lib/superfox/qpc_decode2.f90 b/lib/superfox/qpc_decode2.f90 index 57152ab8..fb1dde88 100644 --- a/lib/superfox/qpc_decode2.f90 +++ b/lib/superfox/qpc_decode2.f90 @@ -5,11 +5,11 @@ subroutine qpc_decode2(c0,fsync,ftol,xdec,ndepth,dth,damp,crc_ok, & parameter(NMAX=15*12000,NFT=365,NZ=100) complex c0(NMAX) !Signal as received - complex c(NMAX) !Signal as received + complex, allocatable :: c(:) !Signal as received real py(0:127,0:127) !Probabilities for received synbol values real py0(0:127,0:127) !Probabilities for strong signal real pyd(0:127,0:127) !Dithered values for py - real s2(0:127,0:151) !Symbol spectra, including sync + real, allocatable :: s2(:,:) !Symbol spectra, including sync real s3(0:127,0:127) !Synchronized symbol spectra real No integer crc_chk,crc_sent @@ -49,6 +49,8 @@ subroutine qpc_decode2(c0,fsync,ftol,xdec,ndepth,dth,damp,crc_ok, & -5, 4, -4, 3, -5, 4, -4, -5, 4, -5/ + allocate(c(NMAX),s2(0:127,0:151)) + s2=0.0 fsample=12000.0 baud=12000.0/1024.0 nstype=1 diff --git a/lib/superfox/qpc_sync.f90 b/lib/superfox/qpc_sync.f90 index ea9afb5b..9c80b390 100644 --- a/lib/superfox/qpc_sync.f90 +++ b/lib/superfox/qpc_sync.f90 @@ -46,6 +46,12 @@ subroutine qpc_sync(crcvd0,fsample,isync,fsync,ftol,f2,t2,snrsync) s0=s0+s(i) s1=s1+(i-i0)*s(i) enddo + if(.not. (s0 .gt. 0.0)) then + f2=fsync-750.0 + t2=0.0 + snrsync=0.0 + return + endif delta=s1/s0 i0=nint(i0+delta) f2=i0*df2-750.0 @@ -105,9 +111,22 @@ subroutine qpc_sync(crcvd0,fsample,isync,fsync,ftol,f2,t2,snrsync) sp=sp + p(lag) sq=sq + p(lag)*p(lag) enddo + if(nsum .le. 0) then + snrsync=0.0 + return + endif ave=sp/nsum - rms=sqrt(sq/nsum-ave*ave) - snrsync=(pmax-ave)/rms + var=sq/nsum-ave*ave + if(.not. (var .gt. 0.0)) then + snrsync=0.0 + return + endif + rms=sqrt(var) + if(rms .gt. 0.0) then + snrsync=(pmax-ave)/rms + else + snrsync=0.0 + endif return end subroutine qpc_sync diff --git a/lib/superfox/ran1.f90 b/lib/superfox/ran1.f90 index b09b9bab..8ea83bdf 100644 --- a/lib/superfox/ran1.f90 +++ b/lib/superfox/ran1.f90 @@ -1,18 +1,24 @@ FUNCTION ran1(idum) - INTEGER idum,IA,IM,IQ,IR,NTAB,NDIV - REAL ran1,AM,EPS,RNMX - PARAMETER (IA=16807,IM=2147483647,AM=1./IM,IQ=127773,IR=2836, & - NTAB=32,NDIV=1+(IM-1)/NTAB,EPS=1.2e-7,RNMX=1.-EPS) + INTEGER idum + INTEGER, PARAMETER :: IA=16807,IM=2147483647,IQ=127773,IR=2836,NTAB=32 + INTEGER, PARAMETER :: NDIV=1+INT(DBLE(IM-1)/DBLE(NTAB)) + REAL ran1 + REAL, PARAMETER :: AM=1.0/REAL(IM),EPS=1.2e-7,RNMX=1.-EPS INTEGER j,k,iv(NTAB),iy SAVE iv,iy DATA iv /NTAB*0/, iy /0/ if (idum.le.0.or.iy.eq.0) then idum=max(-idum,1) - do j=NTAB+8,1,-1 + do j=NTAB+8,NTAB+1,-1 k=idum/IQ idum=IA*(idum-k*IQ)-IR*k if (idum.lt.0) idum=idum+IM - if (j.le.NTAB) iv(j)=idum + enddo + do j=NTAB,1,-1 + k=idum/IQ + idum=IA*(idum-k*IQ)-IR*k + if (idum.lt.0) idum=idum+IM + iv(j)=idum enddo iy=iv(1) endif diff --git a/lib/superfox/sfox_pack.f90 b/lib/superfox/sfox_pack.f90 index c5a6d94c..1a482422 100644 --- a/lib/superfox/sfox_pack.f90 +++ b/lib/superfox/sfox_pack.f90 @@ -1,79 +1,132 @@ -subroutine sfox_pack(line,ckey,bMoreCQs,bSendMsg,freeTextMsg,xin) +subroutine sfox_pack(line,ckey,bMoreCQs,bSendMsg,freeTextMsg,xin,pack_error) use qpc_mod use packjt use packjt77 - use julian parameter (NQU1RKS=203514677) - integer*8 n47,n58,now + integer*8 n47,n58 integer*1 xin(0:49) !Packed message as 7-bit symbols logical*1 bMoreCQs,bSendMsg - logical text,allz + integer pack_error + integer, parameter :: SFOX_PACK_OK=0 + integer, parameter :: SFOX_PACK_BAD_TOKEN=1 + integer, parameter :: SFOX_PACK_BAD_OTP=2 + integer, parameter :: SFOX_PACK_BAD_CQ=3 + integer, parameter :: SFOX_PACK_BAD_CALL=4 + integer, parameter :: SFOX_PACK_BAD_REPORT=5 + integer, parameter :: SFOX_PACK_BAD_FREE_TEXT=6 + logical text,allz,split_success character*120 line !SuperFox message pieces character*10 ckey character*26 freeTextMsg character*13 w(16) + character*13 w1,w2,w3 !Scalar copies of w() elements passed to + !explicit-interface functions/subroutines + !below: gfortran's -Wcharacter-truncation + !treats an array-element actual argument + !as spanning the rest of w()'s storage + !sequence, so pass a same-length scalar + !instead to give it an exact length character*11 c11 character*329 msgbits !Packed message as bits character*38 c data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/'/ - i0=index(line,'/') + pack_error=SFOX_PACK_BAD_TOKEN + xin=0 i3=0 !Default to i3=0, standard message nh1=0 !Number of Hound calls with RR73 nh2=0 !Number of Hound calls with report ! Split the command line into words - w=' ' - i1=1 - do j=1,16 - do i=i1,min(i1+12,120) - if(line(i:i).eq.' ') exit - enddo - i2=i-1 - w(j)=line(i1:i2) - do i=i2+1,120 - if(line(i:i).ne.' ') exit - enddo - i1=i - if(i1.ge.120) exit - enddo - nwords=j - - do i=1,nwords - if(w(i)(1:1).eq.' ') then - nwords=i-1 - exit - endif - enddo + call split_sfox_line(line,w,nwords,split_success) + if(.not.split_success .or. nwords.lt.1) then + pack_error=SFOX_PACK_BAD_TOKEN + return + endif do i=1,329 !Set all msgbits to '0' msgbits(i:i)='0' enddo - now=itime8()/30 - now=30*now - read(ckey(5:10),*) notp + read(ckey(5:10),*,err=910) notp write(msgbits(307:326),'(b20.20)') notp !Insert the digital signature if(w(1)(1:3).eq.'CQ ') then + if(nwords.ne.3) then + pack_error=SFOX_PACK_BAD_CQ + return + endif + w2=w(2) + w3=w(3) + if(.not.valid_sfox_cq_call(w2) .or. .not.valid_sfox_grid4(w3)) then + pack_error=SFOX_PACK_BAD_CQ + return + endif i3=3 - c11=w(2)(1:11) + c11=w2(1:11) n58=0 do i=1,11 n58=n58*38 + index(c,c11(i:i)) - 1 enddo write(msgbits(1:58),'(b58.58)') n58 - call packgrid(w(3)(1:4),n15,text) + call packgrid(w3(1:4),n15,text) + if(text) then + pack_error=SFOX_PACK_BAD_CQ + return + endif write(msgbits(59:73),'(b15.15)') n15 write(msgbits(327:329),'(b3.3)') i3 !Message type i3=3 go to 800 endif - call pack28(w(1),n28) !Fox call + w1=w(1) + if(.not.valid_sfox_call(w1)) then + pack_error=SFOX_PACK_BAD_CALL + return + endif + call pack28(w1,n28) !Fox call write(msgbits(1:28),'(b28.28)') n28 + nrr73_total=0 + nreport_total=0 + i=2 + do while(i.le.nwords) + if(w(i)(1:1).eq.'+' .or. w(i)(1:1).eq.'-') then + pack_error=SFOX_PACK_BAD_TOKEN + return + endif + if(.not.valid_sfox_call(w(i))) then + pack_error=SFOX_PACK_BAD_CALL + return + endif + i1=i+1 + if(i1.le.nwords .and. & + (w(i1)(1:1).eq.'+' .or. w(i1)(1:1).eq.'-')) then + if(.not.valid_sfox_report(w(i1),n)) then + pack_error=SFOX_PACK_BAD_REPORT + return + endif + nreport_total=nreport_total+1 + i=i+2 + else + nrr73_total=nrr73_total+1 + i=i+1 + endif + enddo + + if(bSendMsg) then + if(nrr73_total+nreport_total.gt.4 .or. nreport_total.gt.4) then + pack_error=SFOX_PACK_BAD_TOKEN + return + endif + else if(nrr73_total.gt.5 .or. nreport_total.gt.4 .or. & + nrr73_total+nreport_total.gt.9) then + pack_error=SFOX_PACK_BAD_TOKEN + return + endif + ! Default report is RR73 if we're also sending a free text message. if(bSendMsg) msgbits(141:160)='11111111111111111111' @@ -84,6 +137,10 @@ subroutine sfox_pack(line,ckey,bMoreCQs,bSendMsg,freeTextMsg,xin) if(w(i)(1:1).eq.'+' .or. w(i)(1:1).eq.'-') cycle !Skip report words i1=min(i+1,nwords) if(w(i1)(1:1) .eq.'+' .or. w(i1)(1:1).eq.'-') cycle !Skip if i+1 is report + if(.not.valid_sfox_call(w(i))) then + pack_error=SFOX_PACK_BAD_CALL + return + endif call pack28(w(i),n28) write(msgbits(j:j+27),1002) n28 !Insert this call for RR73 message 1002 format(b28.28) @@ -104,11 +161,16 @@ subroutine sfox_pack(line,ckey,bMoreCQs,bSendMsg,freeTextMsg,xin) do i=2,nwords i1=min(i+1,nwords) if(w(i1)(1:1).eq.'+' .or. w(i1)(1:1).eq.'-') then + if(.not.valid_sfox_call(w(i))) then + pack_error=SFOX_PACK_BAD_CALL + return + endif call pack28(w(i),n28) write(msgbits(j:j+27),1002) n28 !Insert this call - read(w(i1),*) n !Valid reports are -18 to +12, plus RR73 - if(n.lt.-18) n=-18 !... Even numbers only ... - if(n.gt.12) n=12 + if(.not.valid_sfox_report(w(i1),n)) then + pack_error=SFOX_PACK_BAD_REPORT + return + endif write(msgbits(j2:j2+4),1000) n+18 1000 format(b5.5) w(i1)="" @@ -121,6 +183,10 @@ subroutine sfox_pack(line,ckey,bMoreCQs,bSendMsg,freeTextMsg,xin) enddo 800 if(bSendMsg) then + if(.not.valid_sfox_free_text(freeTextMsg)) then + pack_error=SFOX_PACK_BAD_FREE_TEXT + return + endif i1=26 do i=1,26 if(freeTextMsg(i:i).ne.' ') i1=i @@ -174,5 +240,116 @@ subroutine sfox_pack(line,ckey,bMoreCQs,bSendMsg,freeTextMsg,xin) xin=xin(49:0:-1) !Reverse the symbol order ! NB: CRC is now in first three symbols, fox call in the last four. + pack_error=SFOX_PACK_OK +900 continue return +910 pack_error=SFOX_PACK_BAD_OTP + go to 900 + +contains + + subroutine split_sfox_line(text,words,nwords,success) + character*120 text + character*13 words(16) + integer nwords + logical success + integer first,last + + words=' ' + nwords=0 + success=.true. + first=1 + do while(first.le.120) + do while(first.le.120) + if(text(first:first).ne.' ') exit + first=first+1 + enddo + if(first.gt.120) exit + + last=first + do while(last.le.120) + if(text(last:last).eq.' ') exit + last=last+1 + enddo + if(last-first.gt.13) then + success=.false. + return + endif + if(nwords.ge.16) then + success=.false. + return + endif + nwords=nwords+1 + words(nwords)=text(first:last-1) + first=last+1 + enddo + end subroutine split_sfox_line + + logical function valid_sfox_call(call) + character*13 call + character*13 decoded + logical success + integer n28 + + valid_sfox_call=.false. + call pack28(call,n28) + call unpack28(n28,decoded,success) + if(.not.success) return + valid_sfox_call=trim(decoded).eq.trim(call) + return + end function valid_sfox_call + + logical function valid_sfox_cq_call(callsign) + character*13 callsign + integer n + + valid_sfox_cq_call=.false. + n=len(trim(callsign)) + if(n.lt.3 .or. n.gt.11) return + do i=1,n + if(index(c(2:38),callsign(i:i)).eq.0) return + enddo + + valid_sfox_cq_call=.true. + return + end function valid_sfox_cq_call + + logical function valid_sfox_grid4(grid) + character*13 grid + + valid_sfox_grid4=len(trim(grid)).eq.4 .and. & + grid(1:1).ge.'A' .and. grid(1:1).le.'R' .and. & + grid(2:2).ge.'A' .and. grid(2:2).le.'R' .and. & + grid(3:3).ge.'0' .and. grid(3:3).le.'9' .and. & + grid(4:4).ge.'0' .and. grid(4:4).le.'9' + return + end function valid_sfox_grid4 + + logical function valid_sfox_report(word,n) + character*13 word + integer n + + valid_sfox_report=.false. + read(word,*,err=910,end=910) n + if(n.lt.-18 .or. n.gt.12) return + valid_sfox_report=.true. +910 return + end function valid_sfox_report + + logical function valid_sfox_free_text(text) + character*26 text + character*42 text_chars +! Authoritative free-text charset; the GUI precheck in on_pbFreeText_clicked +! (widgets/mainwindow_slots.cpp) must mirror this string. + data text_chars/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+-./?'/ + + valid_sfox_free_text=.true. + do i=1,26 + if(index(text_chars,text(i:i)).eq.0) then + valid_sfox_free_text=.false. + return + endif + enddo + return + end function valid_sfox_free_text end subroutine sfox_pack diff --git a/lib/superfox/sfox_remove_ft8.f90 b/lib/superfox/sfox_remove_ft8.f90 index fc990bca..75687659 100644 --- a/lib/superfox/sfox_remove_ft8.f90 +++ b/lib/superfox/sfox_remove_ft8.f90 @@ -133,8 +133,11 @@ subroutine sfox_remove_ft8(dd,npts) nt=2**(3*nsym) do ihalf=1,2 do k=1,29,nsym - if(ihalf.eq.1) ks=k+7 - if(ihalf.eq.2) ks=k+43 + if(ihalf.eq.1) then + ks=k+7 + else + ks=k+43 + endif amax=-1.0 do i=0,nt-1 i3=iand(i,7) diff --git a/lib/superfox/sfox_remove_tone.f90 b/lib/superfox/sfox_remove_tone.f90 index c8f9e033..35a6fbec 100644 --- a/lib/superfox/sfox_remove_tone.f90 +++ b/lib/superfox/sfox_remove_tone.f90 @@ -68,6 +68,7 @@ subroutine sfox_remove_tone(c0,fsync) s0=s0+s(i) s1=s1+(i-i0)*s(i) enddo + if(.not. (s0 .gt. 0.0)) exit delta=s1/s0 i0=nint(i0+delta) f2=i0*df diff --git a/lib/superfox/sfox_unpack.f90 b/lib/superfox/sfox_unpack.f90 index 56168963..fd940347 100644 --- a/lib/superfox/sfox_unpack.f90 +++ b/lib/superfox/sfox_unpack.f90 @@ -23,16 +23,16 @@ subroutine sfox_unpack(nutc,x,nsnr,f0,dt0,foxcall,notp) endif write(msgbits,1000) x(0:46) 1000 format(47b7.7) - read(msgbits(327:329),'(b6)') i3 !Message type + read(msgbits(327:329),'(b3)') i3 !Message type read(msgbits(1:28),'(b28)') n28 !Standard Fox call call unpack28(n28,foxcall,success) - if(i3.eq.1) then !Compound Fox callsign -! read(msgbits(87:101),'(b15)') n15 -! call unpackgrid(n15,grid4) -! msg(1)='CQ '//trim(foxcall)//' '//grid4 -! write(*,1100) nutc,nsnr,dt0,nint(f0),trim(msg(1)) -! go to 100 + if(i3.eq.1) then +! Type i3=1 is documented for a compound-Fox c58 layout, but the +! current transmitter does not emit it and this decoder does not +! implement the c58 field offsets. Do not render hound messages with +! a mis-decoded c28 Fox call. + go to 900 else if(i3.eq.2) then !Up to 4 Hound calls and free text call unpacktext77(msgbits(161:231),freeTextMsg(1:13)) call unpacktext77(msgbits(232:302),freeTextMsg(14:26)) @@ -54,8 +54,12 @@ subroutine sfox_unpack(nutc,x,nsnr,f0,dt0,foxcall,notp) call unpackgrid(n15,grid4) msg(1)='CQ '//trim(foxcall)//' '//grid4 write(*,1100) nutc,nsnr,dt0,nint(f0),trim(msg(1)) - read(msgbits(74:105),'(b32)') n32 - if(n32.eq.NQU1RKS) go to 100 + allz=1 + do i=0,6 + read(msgbits(74+32*i:105+32*i),'(b32)') n32 + if(n32.ne.NQU1RKS) allz=0 + enddo + if(allz.eq.1) go to 100 call unpacktext77(msgbits(74:144),freeTextMsg(1:13)) call unpacktext77(msgbits(145:215),freeTextMsg(14:26)) do i=26,1,-1 @@ -112,8 +116,9 @@ subroutine sfox_unpack(nutc,x,nsnr,f0,dt0,foxcall,notp) 100 read(msgbits(307:326),'(b20)') notp if (use_otp) then - write(ssignature,'(I6.6)') notp - write(*,1100) nutc,nsnr,dt0,nint(f0),'$VERIFY$ '//trim(foxcall)//' '//trim(ssignature) - endif - return + write(ssignature,'(I6.6)') notp + write(*,1100) nutc,nsnr,dt0,nint(f0),'$VERIFY$ '//trim(foxcall)// & + ' '//trim(ssignature) + endif +900 return end subroutine sfox_unpack diff --git a/lib/superfox/sfoxsim.f90 b/lib/superfox/sfoxsim.f90 index 86f7019e..1b4bb9f2 100644 --- a/lib/superfox/sfoxsim.f90 +++ b/lib/superfox/sfoxsim.f90 @@ -11,6 +11,7 @@ program sfoxsim type(hdr) h !Header for .wav file logical*1 bMoreCQs !Include a CQ when space available? logical*1 bSendMsg !Send a Free text message + integer pack_error integer*2 iwave(NMAX) !Generated i*2 waveform integer isync(24) !Indices of sync symbols integer itone(151) !Symbol values, data and sync @@ -112,7 +113,8 @@ program sfoxsim ! Generate a SuperFox message nslots=5 call foxgen2(nslots,cmsg,line,foxcall) !Parse old-style Fox messages - call sfox_pack(line,ckey,bMoreCQs,bSendMsg,text_msg,xin) + call sfox_pack(line,ckey,bMoreCQs,bSendMsg,text_msg,xin,pack_error) + if(pack_error.ne.0) error stop 'SuperFox pack failed' call qpc_encode(y,xin) y=cshift(y,1) @@ -137,6 +139,7 @@ program sfoxsim xdt=ran1(idum)-0.5 endif ! Generate cdat, the SuperFox waveform + cdat=0. call sfox_gen_gfsk(chansym,f1,isync,itone,cdat) crcvd=0. @@ -156,7 +159,7 @@ program sfoxsim nmin=(nsec-nhr*3600)/60 nsec=mod(nsec,60) write(fname(8:13),'(3i2.2)') nhr,nmin,nsec - open(10,file=trim(fname),access='stream',status='unknown') + open(10,file=trim(fname),access='stream',status='replace') write(10) h,iwave(1:NMAX) !Save the .wav file close(10) enddo ! ifile diff --git a/lib/superfox/sfrx_sub.f90 b/lib/superfox/sfrx_sub.f90 index 12a48e08..fed03461 100644 --- a/lib/superfox/sfrx_sub.f90 +++ b/lib/superfox/sfrx_sub.f90 @@ -7,8 +7,8 @@ subroutine sfrx_sub(nyymmdd,nutc,nfqso,ntol,iwave) integer*8 secday,ntime8 integer*1 xdec(0:49) character*13 foxcall - complex c0(NMAX) !Complex form of signal as received - real dd(NMAX) + complex, allocatable :: c0(:) !Complex form of signal as received + real, allocatable :: dd(:) logical crc_ok data secday/86400/ @@ -31,6 +31,7 @@ subroutine sfrx_sub(nyymmdd,nutc,nfqso,ntol,iwave) ntime8=secday*(JD(iyr,imo,iday)-2440588) + 3600*ih + 60*im + is endif + allocate(c0(NMAX),dd(NMAX)) dd=iwave call sfox_remove_ft8(dd,npts) diff --git a/lib/superfox/sftx.f90 b/lib/superfox/sftx.f90 index 78b5ca15..d629eb7d 100644 --- a/lib/superfox/sftx.f90 +++ b/lib/superfox/sftx.f90 @@ -17,22 +17,15 @@ program sftx character*120 line !List of SuperFox message pieces character*40 cmsg(5) !Old-style Fox messages character*26 freeTextMsg - character*2 arg character*10 ckey ! character*9 foxkey character*11 foxcall0,foxcall logical*1 bMoreCQs,bSendMsg - logical crc_ok - real py(0:127,0:127) !Probabilities for received synbol values - integer*8 n47 + integer pack_error integer itone(151) !SuperFox channel-symbol values integer*1 xin(0:49) !Packed message as 7-bit symbols - integer*1 xdec(0:49) !Decoded message integer*1 y(0:127) !Encoded symbols as i*1 integers - integer*1 ydec(0:127) !Decoded codeword - integer*1 yy(0:10) integer chansym0(127) !Transmitted symbols, data only - integer chansym(127) !Received symbols, data only integer isync(24) !Symbol numbers for sync tones data isync/1,2,4,7,11,16,22,29,37,39,42,43,45,48,52,57,63,70,78,80, & 83,84,86,89/ @@ -70,15 +63,21 @@ program sftx freeTextMsg=' ' bMoreCQs=cmsg(1)(40:40).eq.'1' bSendMsg=cmsg(nslots)(39:39).eq.'1' + nDataSlots=nslots if(bSendMsg) then freeTextMsg=cmsg(nslots)(1:26) - if(nslots.gt.2) nslots=2 + nDataSlots=nslots-1 + if(nDataSlots.gt.4) nDataSlots=4 endif - call foxgen2(nslots,cmsg,line,foxcall) !Parse old-style Fox messages + call foxgen2(nDataSlots,cmsg,line,foxcall) !Parse old-style Fox messages ! Pack message information and CRC into xin(0:49) - call sfox_pack(line,ckey,bMoreCQs,bSendMsg,freeTextMsg,xin) + call sfox_pack(line,ckey,bMoreCQs,bSendMsg,freeTextMsg,xin,pack_error) + if(pack_error.ne.0) then + itone=-99 + go to 100 + endif call qpc_encode(y,xin) !Encode the message to 128 symbols y=cshift(y,1) !Puncture the code by removing y(0) y(127)=0 diff --git a/lib/superfox/sftx_sub.f90 b/lib/superfox/sftx_sub.f90 index ed6c678c..310bb059 100644 --- a/lib/superfox/sftx_sub.f90 +++ b/lib/superfox/sftx_sub.f90 @@ -1,4 +1,4 @@ -subroutine sftx_sub(ckey0) +subroutine sftx_sub(ckey0,pack_error) ! This routine is required in order to create a SuperFox transmission. @@ -20,6 +20,7 @@ subroutine sftx_sub(ckey0) character*10 ckey character*11 foxcall logical*1 bMoreCQs,bSendMsg + integer pack_error integer*1 xin(0:49) !Packed message as 7-bit symbols integer*1 y(0:127) !Encoded symbols as i*1 integers integer chansym0(127) !Transmitted symbols, data only @@ -35,15 +36,21 @@ subroutine sftx_sub(ckey0) freeTextMsg=' ' bMoreCQs=cmsg(1)(40:40).eq.'1' bSendMsg=cmsg(nslots)(39:39).eq.'1' + nDataSlots=nslots if(bSendMsg) then freeTextMsg=cmsg(nslots)(1:26) - if(nslots.gt.4) nslots=4 + nDataSlots=nslots-1 + if(nDataSlots.gt.4) nDataSlots=4 endif - call foxgen2(nslots,cmsg,line,foxcall) !Parse old-style Fox messages + call foxgen2(nDataSlots,cmsg,line,foxcall) !Parse old-style Fox messages ! Pack message information and CRC into xin(0:49) - call sfox_pack(line,ckey,bMoreCQs,bSendMsg,freeTextMsg,xin) + call sfox_pack(line,ckey,bMoreCQs,bSendMsg,freeTextMsg,xin,pack_error) + if(pack_error.ne.0) then + itone=-99 + return + endif call qpc_encode(y,xin) !Encode the message to 128 symbols y=cshift(y,1) !Puncture the code by removing y(0) y(127)=0 diff --git a/lib/superfox/superfox_qpc_2.txt b/lib/superfox/superfox_qpc_2.txt index f89bffe1..51bf80ac 100644 --- a/lib/superfox/superfox_qpc_2.txt +++ b/lib/superfox/superfox_qpc_2.txt @@ -50,13 +50,14 @@ G Grid locator (15 bits) H Hound call (28 bits) M Message type (3 bits) Q MoreCQs flag -R Report, (5 bits: -18 to +12 dB, or RR73) +R Report, (5 bits: integer dB value -18 through +12, or RR73) T Free text, up to 26 characters total U Unused bits Unused callsign slots are set to the numerical value for "QU1RKS", and ignored when received. Similarly for unused t71 slots. Unused report -slots are set to 0 (-20 dB). "CQ FoxCall" will be displayed along +slots are set to raw value 0, which decodes as -18 dB if displayed. +"CQ FoxCall" will be displayed along with other messages if the "q1" bit is 1. The SuperFox decoder displays its results with a separate line for each Hound. diff --git a/lib/symspec.f90 b/lib/symspec.f90 index 3f338aa2..9847eb3f 100644 --- a/lib/symspec.f90 +++ b/lib/symspec.f90 @@ -57,7 +57,6 @@ subroutine symspec(shared_data,k,nsps,ingain,bLowSidelobes, & ja=0 ssum=0. ihsym=0 - if(.not. shared_data%params%ndiskdat) shared_data%id2(k+1:)=0 !Needed to prevent "ghosts". Not sure why. endif gain=10.0**(0.1*ingain) sq=0. diff --git a/lib/testEchoCall.f90 b/lib/testEchoCall.f90 index 72059f7f..5f493791 100644 --- a/lib/testEchoCall.f90 +++ b/lib/testEchoCall.f90 @@ -1,17 +1,27 @@ program testEchoCall + use, intrinsic :: iso_fortran_env, only: error_unit + use readwav, only: wav_header + parameter (NSPS=4096,NH=NSPS/2,NZ=3*12000) integer*2 iwave(NZ) !Raw data, 12000 Hz sample rate - integer ihdr(11) - integer*1 itone(6) - character*120 fname - character*6 rxcall,hhmmss + integer*4 itone(6) + type(wav_header) wav + character(:), allocatable :: fname + character*256 iomsg + character*6 rxcall,hhmmss,txcall + character*4 extension + logical*1 bDiskData,bEchoCall + logical valid_time + integer argument_length,i,ich,ios,name_length,nerrors,samples_read common/echocom/nclearave,nsum,blue(4096),red(4096) common/echocom2/fspread_self,fspread_dx - narg=iargc() + nerrors=0 + narg=command_argument_count() if(narg.lt.1) then print*,'Usage: testEchoCall fname1 [fname2, ...]' + nerrors=1 go to 999 endif @@ -23,21 +33,90 @@ program testEchoCall navg=10 nauto=1 nqual=0 + bDiskData=.true. + bEchoCall=.false. + txcall=' ' do ifile=1,narg - call getarg(ifile,fname) - open(10,file=trim(fname),access='stream',status='unknown') - read(10) ihdr,iwave - close(10) + call get_command_argument(ifile,length=argument_length,status=ios) + if(ios.ne.0) then + write(error_unit,'(a,i0)') 'testEchoCall: cannot read argument ',ifile + nerrors=nerrors+1 + cycle + endif + if(allocated(fname)) deallocate(fname) + allocate(character(len=max(1,argument_length)) :: fname) + call get_command_argument(ifile,value=fname,status=ios) + if(ios.ne.0) then + write(error_unit,'(a,i0)') 'testEchoCall: cannot read argument ',ifile + nerrors=nerrors+1 + cycle + endif + name_length=len_trim(fname) + valid_time=.false. + if(name_length.ge.10) then + extension=fname(name_length-3:name_length) + do i=1,len(extension) + ich=iachar(extension(i:i)) + if(ich.ge.iachar('A') .and. ich.le.iachar('Z')) then + extension(i:i)=achar(ich + iachar('a') - iachar('A')) + endif + enddo + hhmmss=fname(name_length-9:name_length-4) + if(extension.eq.'.wav' .and. verify(hhmmss,'0123456789').eq.0) then + read(hhmmss,'(3i2)',iostat=ios) ih,im,is + if(ios.eq.0) then + valid_time=ih.le.23 .and. im.le.59 .and. is.le.59 + endif + endif + endif + if(.not.valid_time) then + write(error_unit,'(a)') & + 'testEchoCall: filename must end with a valid HHMMSS.wav timestamp: '//trim(fname) + nerrors=nerrors+1 + cycle + endif + + call wav%read(trim(fname),ios,iomsg) + if(ios.ne.0) then + if(trim(iomsg).eq.'cannot open file') then + write(error_unit,'(a)') 'testEchoCall: cannot open '//trim(fname)//': '//trim(iomsg) + else + write(error_unit,'(a)') 'testEchoCall: cannot read '//trim(fname)//': '//trim(iomsg) + endif + nerrors=nerrors+1 + cycle + endif + + if(wav%audio_format%sample_rate.ne.12000) then + close(wav%lun) + write(error_unit,'(a)') & + 'testEchoCall: cannot read '//trim(fname)//': expected a 12000 Hz WAV file' + nerrors=nerrors+1 + cycle + endif + + call wav%read_samples(iwave,samples_read,ios,iomsg) + close(wav%lun) + if(ios.ne.0) then + write(error_unit,'(a)') & + 'testEchoCall: cannot read '//trim(fname)//': '//trim(iomsg) + nerrors=nerrors+1 + cycle + endif + if(samples_read.lt.NZ) then + write(error_unit,'(a,i0,a,i0)') 'testEchoCall: cannot read '//trim(fname)// & + ': expected ',NZ,' samples, found ',samples_read + nerrors=nerrors+1 + cycle + endif ! Retrieve params known at time of transmissiion and saved in iwave call save_echo_params(nDop,nDopAudio,nfrit,f1,fspread,ndf,itone,iwave,-1) fspread_self=fspread + width=fspread - call avecho(iwave,0,nfrit,ndf,nauto,navg,nqual,f1,xlevel,snrdb,db_err,dfreq, & + call avecho(iwave,0,nfrit,nauto,navg,nqual,f1,xlevel,snrdb,db_err,dfreq, & width,bDiskData,bEchoCall,txcall,rxcall) - i1=index(fname,'.wav') - hhmmss=fname(i1-6:i1-1) - read(hhmmss,'(3i2)') ih,im,is hour=ih + im/60.0 + is/3600.0 write(*,1110) hhmmss,hour,xlevel,ndop,fspread,nsum,nqual,nint(dfreq), & snrdb,db_err,rxcall @@ -45,4 +124,5 @@ program testEchoCall nclearave=0 enddo -999 end program testEchoCall +999 if(nerrors.gt.0) stop 1 +end program testEchoCall diff --git a/lib/tweak1.f90 b/lib/tweak1.f90 index c62c4087..668ba198 100644 --- a/lib/tweak1.f90 +++ b/lib/tweak1.f90 @@ -3,13 +3,10 @@ subroutine tweak1(ca,jz,f0,cb) ! Shift frequency of analytic signal ca, with output to cb complex ca(jz),cb(jz) - real*8 twopi + real*8, parameter :: twopi=6.283185307179586476925286766559d0 complex*16 w,wstep complex w4 - data twopi/0.d0/ - save twopi - if(twopi.eq.0.d0) twopi=8.d0*atan(1.d0) w=1.d0 dphi=twopi*f0/12000.d0 wstep=cmplx(cos(dphi),sin(dphi)) diff --git a/lib/twkfreq.f90 b/lib/twkfreq.f90 index 7ffe396f..d5c99337 100644 --- a/lib/twkfreq.f90 +++ b/lib/twkfreq.f90 @@ -12,6 +12,15 @@ subroutine twkfreq(c3,c4,npts,fsample,a) ! Mix the complex signal w=1.0 + if(a(2).eq.0.0 .and. a(3).eq.0.0) then + dphi=a(1)*(twopi/fsample) + wstep=cmplx(cos(dphi),sin(dphi)) + do i=1,npts + w=w*wstep + c4(i)=w*c3(i) + enddo + return + endif wstep=1.0 x0=0.5*(npts+1) s=2.0/npts diff --git a/lib/types.f90 b/lib/types.f90 index 0fb82320..d3eced0a 100644 --- a/lib/types.f90 +++ b/lib/types.f90 @@ -5,7 +5,6 @@ module types ! use the Fortran 2008 intrinsic constants to define real kinds integer, parameter :: sp = REAL32 integer, parameter :: dp = REAL64 - integer, parameter :: qp = REAL128 type q3list character*6 call diff --git a/lib/vit213.c b/lib/vit213.c index 93f803ab..73a1f01c 100644 --- a/lib/vit213.c +++ b/lib/vit213.c @@ -83,7 +83,7 @@ unsigned int endstate /* Encoder ending state */ ){ int bitcnt = -(K-1); int m0,m1; - int i,j,sym,ipp; + int i,j,sym; int mets[1 << N]; unsigned int paths[(MAXNBITS+K-1)*D]; unsigned int *pp,mask; @@ -113,7 +113,6 @@ unsigned int endstate /* Encoder ending state */ cmetric[startstate] = 0; pp = paths; - ipp=0; for(;;){ /* For each data bit */ /* Read input symbols and compute branch metrics */ for(i=0;i< 1<= 0;i--){ // int a0,a1; pp -= D; - ipp -= D; m0=endstate >> LOGLONGBITS; m1=1L << (endstate & (LONGBITS-1)); if(pp[m0] & m1) { diff --git a/lib/wav12.f90 b/lib/wav12.f90 index ff655436..989c9b54 100644 --- a/lib/wav12.f90 +++ b/lib/wav12.f90 @@ -20,6 +20,7 @@ subroutine wav12(d2,d1,npts,nbitsam2) complex cx(0:NFFT2/2) integer*2 nbitsam2 equivalence (x,cx),(i1,i2) + save d1a,x,cx jz=min(NZ11,npts) if(nbitsam2.eq.8) then diff --git a/lib/wqencode.f90 b/lib/wqencode.f90 index 59b24706..47236856 100644 --- a/lib/wqencode.f90 +++ b/lib/wqencode.f90 @@ -19,7 +19,7 @@ subroutine wqencode(msg,ntype,data0) call1=msg(:i1-1) if(i1.lt.3 .or. i1.gt.7 .or. i2.gt.0 .or. i3.gt.0) go to 10 grid4=msg(i1+1:i1+4) - call packcall(call1,n1,lbad1) + call packcall(call1(1:6),n1,lbad1) call packgrid(grid4,ng,lbad2) if(lbad1 .or. lbad2) go to 10 ndbm=0 @@ -49,7 +49,7 @@ subroutine wqencode(msg,ntype,data0) i5=index(trim(msg(i1+1:)),' ') ! Convert grid to valid callsign format - first character moved to end call2=msg(i1+2:i1+i5-1)//msg(i1+1:i1+1)//' ' - call packcall(call2,n1,lbad1) + call packcall(call2(1:6),n1,lbad1) ndbm=0 read(msg(i1+i5+1:),*) ndbm if(ndbm.lt.0) ndbm=0 diff --git a/lib/wsprcode/go.sh b/lib/wsprcode/go.sh index dfce99ea..3c4e1656 100644 --- a/lib/wsprcode/go.sh +++ b/lib/wsprcode/go.sh @@ -1 +1 @@ - gfortran -o wsprcode -fbounds-check wsprcode.f90 nhash.c + gfortran -o wsprcode -fbounds-check wsprcode.f90 nhash.c ../lookup3.c diff --git a/lib/wsprcode/nhash.c b/lib/wsprcode/nhash.c index cbf6df8f..a10f45fb 100644 --- a/lib/wsprcode/nhash.c +++ b/lib/wsprcode/nhash.c @@ -1,384 +1,17 @@ -/* - *------------------------------------------------------------------------------- - * - * This file is part of the WSPR application, Weak Signal Propagation Reporter - * - * File Name: nhash.c - * Description: Functions to produce 32-bit hashes for hash table lookup - * - * Copyright (C) 2008-2014 Joseph Taylor, K1JT - * License: GPL-3 - * - * 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; either 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 for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin - * Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Files: lookup3.c - * Copyright: Copyright (C) 2006 Bob Jenkins - * License: public-domain - * You may use this code any way you wish, private, educational, or commercial. - * It's free. - * - *------------------------------------------------------------------------------- -*/ +#include +#include -/* -These are functions for producing 32-bit hashes for hash table lookup. -hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final() -are externally useful functions. Routines to test the hash are included -if SELF_TEST is defined. You can use this free for any purpose. It's in -the public domain. It has no warranty. +#include "../lookup3.h" -You probably want to use hashlittle(). hashlittle() and hashbig() -hash byte arrays. hashlittle() is is faster than hashbig() on -little-endian machines. Intel and AMD are little-endian machines. -On second thought, you probably want hashlittle2(), which is identical to -hashlittle() except it returns two 32-bit hashes for the price of one. -You could implement hashbig2() if you wanted but I haven't bothered here. - -If you want to find a hash of, say, exactly 7 integers, do - a = i1; b = i2; c = i3; - mix(a,b,c); - a += i4; b += i5; c += i6; - mix(a,b,c); - a += i7; - final(a,b,c); -then use c as the hash value. If you have a variable length array of -4-byte integers to hash, use hashword(). If you have a byte array (like -a character string), use hashlittle(). If you have several byte arrays, or -a mix of things, see the comments above hashlittle(). - -Why is this so big? I read 12 bytes at a time into 3 4-byte integers, -then mix those integers. This is fast (you can do a lot more thorough -mixing with 12*3 instructions on 3 integers than you can with 3 instructions -on 1 byte), but shoehorning those bytes into integers efficiently is messy. -*/ - -#define SELF_TEST 1 - -#include /* defines printf for tests */ -#include /* defines time_t for timings in the test */ -#ifdef Win32 -#include "win_stdint.h" /* defines uint32_t etc */ -#else -#include /* defines uint32_t etc */ -#endif -//#include /* attempt to define endianness */ -//#ifdef linux -//# include /* attempt to define endianness */ -//#endif - -#define HASH_LITTLE_ENDIAN 1 - -#define hashsize(n) ((uint32_t)1<<(n)) -#define hashmask(n) (hashsize(n)-1) -#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) - -/* -------------------------------------------------------------------------------- -mix -- mix 3 32-bit values reversibly. - -This is reversible, so any information in (a,b,c) before mix() is -still in (a,b,c) after mix(). - -If four pairs of (a,b,c) inputs are run through mix(), or through -mix() in reverse, there are at least 32 bits of the output that -are sometimes the same for one pair and different for another pair. -This was tested for: -* pairs that differed by one bit, by two bits, in any combination - of top bits of (a,b,c), or in any combination of bottom bits of - (a,b,c). -* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed - the output delta to a Gray code (a^(a>>1)) so a string of 1's (as - is commonly produced by subtraction) look like a single 1-bit - difference. -* the base values were pseudorandom, all zero but one bit set, or - all zero plus a counter that starts at zero. - -Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that -satisfy this are - 4 6 8 16 19 4 - 9 15 3 18 27 15 - 14 9 3 7 17 3 -Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing -for "differ" defined as + with a one-bit base and a two-bit delta. I -used http://burtleburtle.net/bob/hash/avalanche.html to choose -the operations, constants, and arrangements of the variables. - -This does not achieve avalanche. There are input bits of (a,b,c) -that fail to affect some output bits of (a,b,c), especially of a. The -most thoroughly mixed value is c, but it doesn't really even achieve -avalanche in c. - -This allows some parallelism. Read-after-writes are good at doubling -the number of bits affected, so the goal of mixing pulls in the opposite -direction as the goal of parallelism. I did what I could. Rotates -seem to cost as much as shifts on every machine I could lay my hands -on, and rotates are much kinder to the top and bottom bits, so I used -rotates. -------------------------------------------------------------------------------- -*/ -#define mix(a,b,c) \ -{ \ - a -= c; a ^= rot(c, 4); c += b; \ - b -= a; b ^= rot(a, 6); a += c; \ - c -= b; c ^= rot(b, 8); b += a; \ - a -= c; a ^= rot(c,16); c += b; \ - b -= a; b ^= rot(a,19); a += c; \ - c -= b; c ^= rot(b, 4); b += a; \ -} - -/* -------------------------------------------------------------------------------- -final -- final mixing of 3 32-bit values (a,b,c) into c - -Pairs of (a,b,c) values differing in only a few bits will usually -produce values of c that look totally different. This was tested for -* pairs that differed by one bit, by two bits, in any combination - of top bits of (a,b,c), or in any combination of bottom bits of - (a,b,c). -* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed - the output delta to a Gray code (a^(a>>1)) so a string of 1's (as - is commonly produced by subtraction) look like a single 1-bit - difference. -* the base values were pseudorandom, all zero but one bit set, or - all zero plus a counter that starts at zero. - -These constants passed: - 14 11 25 16 4 14 24 - 12 14 25 16 4 14 24 -and these came close: - 4 8 15 26 3 22 24 - 10 8 15 26 3 22 24 - 11 8 15 26 3 22 24 -------------------------------------------------------------------------------- -*/ -#define final(a,b,c) \ -{ \ - c ^= b; c -= rot(b,14); \ - a ^= c; a -= rot(c,11); \ - b ^= a; b -= rot(a,25); \ - c ^= b; c -= rot(b,16); \ - a ^= c; a -= rot(c,4); \ - b ^= a; b -= rot(a,14); \ - c ^= b; c -= rot(b,24); \ -} - -/* -------------------------------------------------------------------------------- -hashlittle() -- hash a variable-length key into a 32-bit value - k : the key (the unaligned variable-length array of bytes) - length : the length of the key, counting by bytes - initval : can be any 4-byte value -Returns a 32-bit value. Every bit of the key affects every bit of -the return value. Two keys differing by one or two bits will have -totally different hash values. - -The best hash table sizes are powers of 2. There is no need to do -mod a prime (mod is sooo slow!). If you need less than 32 bits, -use a bitmask. For example, if you need only 10 bits, do - h = (h & hashmask(10)); -In which case, the hash table should have hashsize(10) elements. - -If you are hashing n strings (uint8_t **)k, do it like this: - for (i=0, h=0; i 12) - { - a += k[0]; - b += k[1]; - c += k[2]; - mix(a,b,c); - length -= 12; - k += 3; - } - - /*----------------------------- handle the last (probably partial) block */ - /* - * "k[2]&0xffffff" actually reads beyond the end of the string, but - * then masks off the part it's not allowed to read. Because the - * string is aligned, the masked-off tail is in the same word as the - * rest of the string. Every machine with memory protection I've seen - * does it on word boundaries, so is OK with this. But VALGRIND will - * still catch it and complain. The masking trick does make the hash - * noticably faster for short strings (like English words). - */ -#ifndef VALGRIND - - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break; - case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break; - case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break; - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=k[1]&0xffffff; a+=k[0]; break; - case 6 : b+=k[1]&0xffff; a+=k[0]; break; - case 5 : b+=k[1]&0xff; a+=k[0]; break; - case 4 : a+=k[0]; break; - case 3 : a+=k[0]&0xffffff; break; - case 2 : a+=k[0]&0xffff; break; - case 1 : a+=k[0]&0xff; break; - case 0 : return c; /* zero length strings require no mixing */ - } - -#else /* make valgrind happy */ - - k8 = (const uint8_t *)k; - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ - case 10: c+=((uint32_t)k8[9])<<8; /* fall through */ - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ - case 6 : b+=((uint32_t)k8[5])<<8; /* fall through */ - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]; break; - case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ - case 2 : a+=((uint32_t)k8[1])<<8; /* fall through */ - case 1 : a+=k8[0]; break; - case 0 : return c; - } - -#endif /* !valgrind */ - - } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { - const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */ - const uint8_t *k8; - - /*--------------- all but last block: aligned reads and different mixing */ - while (length > 12) - { - a += k[0] + (((uint32_t)k[1])<<16); - b += k[2] + (((uint32_t)k[3])<<16); - c += k[4] + (((uint32_t)k[5])<<16); - mix(a,b,c); - length -= 12; - k += 6; - } - - /*----------------------------- handle the last (probably partial) block */ - k8 = (const uint8_t *)k; - switch(length) - { - case 12: c+=k[4]+(((uint32_t)k[5])<<16); - b+=k[2]+(((uint32_t)k[3])<<16); - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ - case 10: c+=k[4]; - b+=k[2]+(((uint32_t)k[3])<<16); - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[2]+(((uint32_t)k[3])<<16); - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ - case 6 : b+=k[2]; - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ - case 2 : a+=k[0]; - break; - case 1 : a+=k8[0]; - break; - case 0 : return c; /* zero length requires no mixing */ - } - - } else { /* need to read the key one byte at a time */ - const uint8_t *k = (const uint8_t *)key; - - /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ - while (length > 12) - { - a += k[0]; - a += ((uint32_t)k[1])<<8; - a += ((uint32_t)k[2])<<16; - a += ((uint32_t)k[3])<<24; - b += k[4]; - b += ((uint32_t)k[5])<<8; - b += ((uint32_t)k[6])<<16; - b += ((uint32_t)k[7])<<24; - c += k[8]; - c += ((uint32_t)k[9])<<8; - c += ((uint32_t)k[10])<<16; - c += ((uint32_t)k[11])<<24; - mix(a,b,c); - length -= 12; - k += 12; - } - - /*-------------------------------- last block: affect all 32 bits of (c) */ - switch(length) /* all the case statements fall through */ - { - case 12: c+=((uint32_t)k[11])<<24; /* fall through */ - case 11: c+=((uint32_t)k[10])<<16; /* fall through */ - case 10: c+=((uint32_t)k[9])<<8; /* fall through */ - case 9 : c+=k[8]; /* fall through */ - case 8 : b+=((uint32_t)k[7])<<24; /* fall through */ - case 7 : b+=((uint32_t)k[6])<<16; /* fall through */ - case 6 : b+=((uint32_t)k[5])<<8; /* fall through */ - case 5 : b+=k[4]; /* fall through */ - case 4 : a+=((uint32_t)k[3])<<24; /* fall through */ - case 3 : a+=((uint32_t)k[2])<<16; /* fall through */ - case 2 : a+=((uint32_t)k[1])<<8; /* fall through */ - case 1 : a+=k[0]; - break; - case 0 : return c; - } - } - - final(a,b,c); - return c; + return wsjt_hashlittle(key, (size_t)*length, *initval); } - -//uint32_t __stdcall NHASH(const void *key, size_t length, uint32_t initval) +#endif diff --git a/lib/wsprcode/wspr_old_subs.f90 b/lib/wsprcode/wspr_old_subs.f90 index a8b5c503..a44dc896 100644 --- a/lib/wsprcode/wspr_old_subs.f90 +++ b/lib/wsprcode/wspr_old_subs.f90 @@ -608,7 +608,7 @@ subroutine packpfx(call1,n1,ng,nadd) if(call1(i1+2:i1+2).eq.' ') then ! Single-character add-on suffix (maybe also fourth suffix letter?) call0=call1(:i1-1) - call packcall(call0,n1,text) + call packcall(call0(1:6),n1,text) nadd=1 nc=ichar(call1(i1+1:i1+1)) if(nc.ge.48 .and. nc.le.57) then @@ -623,7 +623,7 @@ subroutine packpfx(call1,n1,ng,nadd) else if(call1(i1+3:i1+3).eq.' ') then ! Two-character numerical suffix, /10 to /99 call0=call1(:i1-1) - call packcall(call0,n1,text) + call packcall(call0(1:6),n1,text) nadd=1 n=10*(ichar(call1(i1+1:i1+1))-48) + ichar(call1(i1+2:i1+2)) - 48 nadd=1 @@ -634,7 +634,7 @@ subroutine packpfx(call1,n1,ng,nadd) if(pfx(3:3).eq.' ') pfx=' '//pfx(1:2) if(pfx(3:3).eq.' ') pfx=' '//pfx(1:2) call0=call1(i1+1:) - call packcall(call0,n1,text) + call packcall(call0(1:6),n1,text) ng=0 do i=1,3 @@ -891,7 +891,7 @@ subroutine wqencode(msg,ntype,data0) call1=msg(:i1-1) if(i1.lt.3 .or. i1.gt.7 .or. i2.gt.0 .or. i3.gt.0) go to 10 grid4=msg(i1+1:i1+4) - call packcall(call1,n1,lbad1) + call packcall(call1(1:6),n1,lbad1) call packgrid(grid4,ng,lbad2) if(lbad1 .or. lbad2) go to 10 ndbm=0 @@ -920,7 +920,7 @@ subroutine wqencode(msg,ntype,data0) call hash(call1,i4-2,ih) grid6=msg(i1+1:i1+6) call2=grid6(2:6)//grid6(1:1)//' ' - call packcall(call2,n1,lbad1) + call packcall(call2(1:6),n1,lbad1) ndbm=0 read(msg(i1+8:),*) ndbm if(ndbm.lt.0) ndbm=0 diff --git a/lib/wsprd/Makefile b/lib/wsprd/Makefile index c8e15723..cf8d5edb 100644 --- a/lib/wsprd/Makefile +++ b/lib/wsprd/Makefile @@ -20,17 +20,20 @@ LIBS = -lfftw3f -lm -lgfortran all: wsprd wsprsim -DEPS = wsprsim_utils.h wsprd_utils.h fano.h jelinek.h nhash.h +DEPS = wsprsim_utils.h wsprd_utils.h fano.h jelinek.h nhash.h ../lookup3.h + +lookup3.o: ../lookup3.c ../lookup3.h + ${CC} ${CFLAGS} -c $< -o $@ indexx.o: ../indexx.f90 ${FC} -o indexx.o ${FFLAGS} -c ../indexx.f90 -OBJS1 = wsprd.o wsprsim_utils.o wsprd_utils.o tab.o fano.o jelinek.o nhash.o indexx.o osdwspr.o +OBJS1 = wsprd.o wsprsim_utils.o wsprd_utils.o tab.o fano.o jelinek.o nhash.o lookup3.o indexx.o osdwspr.o wsprd: $(OBJS1) $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS) -OBJS2 = wsprsim.o wsprsim_utils.o wsprd_utils.o tab.o fano.o nhash.o +OBJS2 = wsprsim.o wsprsim_utils.o wsprd_utils.o tab.o fano.o nhash.o lookup3.o wsprsim: $(OBJS2) $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS) diff --git a/lib/wsprd/Makefile.MinGW b/lib/wsprd/Makefile.MinGW index d9fd6b83..4ba8f87c 100644 --- a/lib/wsprd/Makefile.MinGW +++ b/lib/wsprd/Makefile.MinGW @@ -21,8 +21,12 @@ LIBS = c:/JTSDK/fftw3f/libfftw3-3.dll -lm all: wsprd -DEPS = fano.h -OBJS1 = wsprd.o wsprd_utils.o fano.o tab.o nhash.o +DEPS = fano.h nhash.h ../lookup3.h + +lookup3.o: ../lookup3.c ../lookup3.h + ${CC} ${CFLAGS} -c $< -o $@ + +OBJS1 = wsprd.o wsprd_utils.o fano.o tab.o nhash.o lookup3.o wsprd: $(OBJS1) $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS) diff --git a/lib/wsprd/Makefile.win32 b/lib/wsprd/Makefile.win32 index 8d600d71..a9beb435 100644 --- a/lib/wsprd/Makefile.win32 +++ b/lib/wsprd/Makefile.win32 @@ -21,18 +21,21 @@ LIBS = c:/JTSDK/fftw3f/libfftw3-3.dll -lm all: wsprd.exe wsprsim.exe wsprd_exp.exe -DEPS = wsprsim_utils.h wsprd_utils.h fano.h jelinek.h nhash.h +DEPS = wsprsim_utils.h wsprd_utils.h fano.h jelinek.h nhash.h ../lookup3.h -OBJS1 = wsprd.o wsprsim_utils.o wsprd_utils.o tab.o fano.o jelinek.o nhash.o +lookup3.o: ../lookup3.c ../lookup3.h + ${CC} ${CFLAGS} -c $< -o $@ + +OBJS1 = wsprd.o wsprsim_utils.o wsprd_utils.o tab.o fano.o jelinek.o nhash.o lookup3.o wsprd.exe: $(OBJS1) $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS) -OBJS2 = wsprsim.o wsprsim_utils.o wsprd_utils.o tab.o fano.o nhash.o +OBJS2 = wsprsim.o wsprsim_utils.o wsprd_utils.o tab.o fano.o nhash.o lookup3.o wsprsim.exe: $(OBJS2) $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS) OBJS3 = wsprd_exp.o wsprsim_utils.o wsprd_utils.o tab.o fano.o jelinek.o \ - nhash.o + nhash.o lookup3.o wsprd_exp.exe: $(OBJS3) $(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS) diff --git a/lib/wsprd/nhash.c b/lib/wsprd/nhash.c index 5bf6ce04..ca52f262 100644 --- a/lib/wsprd/nhash.c +++ b/lib/wsprd/nhash.c @@ -1,383 +1,10 @@ -/* - This file is part of wsprd. - - File name: nhash.c - - *------------------------------------------------------------------------------ - * - * This file is part of the WSPR application, Weak Signal Propogation Reporter - * - * File Name: nhash.c - * Description: Functions to produce 32-bit hashes for hash table lookup - * - * Copyright (C) 2008-2014 Joseph Taylor, K1JT - * License: GNU GPL v3+ - * - * 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; either 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 for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin - * Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Files: lookup3.c - * Copyright: Copyright (C) 2006 Bob Jenkins - * License: public-domain - * You may use this code any way you wish, private, educational, or commercial. - * It's free. - * - *------------------------------------------------------------------------------- -*/ - -/* -These are functions for producing 32-bit hashes for hash table lookup. -hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final() -are externally useful functions. Routines to test the hash are included -if SELF_TEST is defined. You can use this free for any purpose. It's in -the public domain. It has no warranty. - -You probably want to use hashlittle(). hashlittle() and hashbig() -hash byte arrays. hashlittle() is is faster than hashbig() on -little-endian machines. Intel and AMD are little-endian machines. -On second thought, you probably want hashlittle2(), which is identical to -hashlittle() except it returns two 32-bit hashes for the price of one. -You could implement hashbig2() if you wanted but I haven't bothered here. - -If you want to find a hash of, say, exactly 7 integers, do - a = i1; b = i2; c = i3; - mix(a,b,c); - a += i4; b += i5; c += i6; - mix(a,b,c); - a += i7; - final(a,b,c); -then use c as the hash value. If you have a variable length array of -4-byte integers to hash, use hashword(). If you have a byte array (like -a character string), use hashlittle(). If you have several byte arrays, or -a mix of things, see the comments above hashlittle(). - -Why is this so big? I read 12 bytes at a time into 3 4-byte integers, -then mix those integers. This is fast (you can do a lot more thorough -mixing with 12*3 instructions on 3 integers than you can with 3 instructions -on 1 byte), but shoehorning those bytes into integers efficiently is messy. -*/ - -#define SELF_TEST 1 - -#include /* defines printf for tests */ -#include /* defines time_t for timings in the test */ #include "nhash.h" -//#include /* attempt to define endianness */ -//#ifdef linux -//# include /* attempt to define endianness */ -//#endif - -#define HASH_LITTLE_ENDIAN 1 - -#define hashsize(n) ((uint32_t)1<<(n)) -#define hashmask(n) (hashsize(n)-1) -#define rot(x,k) (((x)<<(k)) | ((x)>>(32-(k)))) - -/* -------------------------------------------------------------------------------- -mix -- mix 3 32-bit values reversibly. - -This is reversible, so any information in (a,b,c) before mix() is -still in (a,b,c) after mix(). - -If four pairs of (a,b,c) inputs are run through mix(), or through -mix() in reverse, there are at least 32 bits of the output that -are sometimes the same for one pair and different for another pair. -This was tested for: -* pairs that differed by one bit, by two bits, in any combination - of top bits of (a,b,c), or in any combination of bottom bits of - (a,b,c). -* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed - the output delta to a Gray code (a^(a>>1)) so a string of 1's (as - is commonly produced by subtraction) look like a single 1-bit - difference. -* the base values were pseudorandom, all zero but one bit set, or - all zero plus a counter that starts at zero. - -Some k values for my "a-=c; a^=rot(c,k); c+=b;" arrangement that -satisfy this are - 4 6 8 16 19 4 - 9 15 3 18 27 15 - 14 9 3 7 17 3 -Well, "9 15 3 18 27 15" didn't quite get 32 bits diffing -for "differ" defined as + with a one-bit base and a two-bit delta. I -used http://burtleburtle.net/bob/hash/avalanche.html to choose -the operations, constants, and arrangements of the variables. - -This does not achieve avalanche. There are input bits of (a,b,c) -that fail to affect some output bits of (a,b,c), especially of a. The -most thoroughly mixed value is c, but it doesn't really even achieve -avalanche in c. - -This allows some parallelism. Read-after-writes are good at doubling -the number of bits affected, so the goal of mixing pulls in the opposite -direction as the goal of parallelism. I did what I could. Rotates -seem to cost as much as shifts on every machine I could lay my hands -on, and rotates are much kinder to the top and bottom bits, so I used -rotates. -------------------------------------------------------------------------------- -*/ -#define mix(a,b,c) \ -{ \ - a -= c; a ^= rot(c, 4); c += b; \ - b -= a; b ^= rot(a, 6); a += c; \ - c -= b; c ^= rot(b, 8); b += a; \ - a -= c; a ^= rot(c,16); c += b; \ - b -= a; b ^= rot(a,19); a += c; \ - c -= b; c ^= rot(b, 4); b += a; \ -} - -/* -------------------------------------------------------------------------------- -final -- final mixing of 3 32-bit values (a,b,c) into c - -Pairs of (a,b,c) values differing in only a few bits will usually -produce values of c that look totally different. This was tested for -* pairs that differed by one bit, by two bits, in any combination - of top bits of (a,b,c), or in any combination of bottom bits of - (a,b,c). -* "differ" is defined as +, -, ^, or ~^. For + and -, I transformed - the output delta to a Gray code (a^(a>>1)) so a string of 1's (as - is commonly produced by subtraction) look like a single 1-bit - difference. -* the base values were pseudorandom, all zero but one bit set, or - all zero plus a counter that starts at zero. - -These constants passed: - 14 11 25 16 4 14 24 - 12 14 25 16 4 14 24 -and these came close: - 4 8 15 26 3 22 24 - 10 8 15 26 3 22 24 - 11 8 15 26 3 22 24 -------------------------------------------------------------------------------- -*/ -#define final(a,b,c) \ -{ \ - c ^= b; c -= rot(b,14); \ - a ^= c; a -= rot(c,11); \ - b ^= a; b -= rot(a,25); \ - c ^= b; c -= rot(b,16); \ - a ^= c; a -= rot(c,4); \ - b ^= a; b -= rot(a,14); \ - c ^= b; c -= rot(b,24); \ -} -/* -------------------------------------------------------------------------------- -hashlittle() -- hash a variable-length key into a 32-bit value - k : the key (the unaligned variable-length array of bytes) - length : the length of the key, counting by bytes - initval : can be any 4-byte value -Returns a 32-bit value. Every bit of the key affects every bit of -the return value. Two keys differing by one or two bits will have -totally different hash values. +#include "../lookup3.h" -The best hash table sizes are powers of 2. There is no need to do -mod a prime (mod is sooo slow!). If you need less than 32 bits, -use a bitmask. For example, if you need only 10 bits, do - h = (h & hashmask(10)); -In which case, the hash table should have hashsize(10) elements. - -If you are hashing n strings (uint8_t **)k, do it like this: - for (i=0, h=0; i 12) - { - a += k[0]; - b += k[1]; - c += k[2]; - mix(a,b,c); - length -= 12; - k += 3; - } - - /*----------------------------- handle the last (probably partial) block */ - /* - * "k[2]&0xffffff" actually reads beyond the end of the string, but - * then masks off the part it's not allowed to read. Because the - * string is aligned, the masked-off tail is in the same word as the - * rest of the string. Every machine with memory protection I've seen - * does it on word boundaries, so is OK with this. But VALGRIND will - * still catch it and complain. The masking trick does make the hash - * noticably faster for short strings (like English words). - */ -#ifndef VALGRIND - - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=k[2]&0xffffff; b+=k[1]; a+=k[0]; break; - case 10: c+=k[2]&0xffff; b+=k[1]; a+=k[0]; break; - case 9 : c+=k[2]&0xff; b+=k[1]; a+=k[0]; break; - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=k[1]&0xffffff; a+=k[0]; break; - case 6 : b+=k[1]&0xffff; a+=k[0]; break; - case 5 : b+=k[1]&0xff; a+=k[0]; break; - case 4 : a+=k[0]; break; - case 3 : a+=k[0]&0xffffff; break; - case 2 : a+=k[0]&0xffff; break; - case 1 : a+=k[0]&0xff; break; - case 0 : return c; /* zero length strings require no mixing */ - } - -#else /* make valgrind happy */ - - k8 = (const uint8_t *)k; - switch(length) - { - case 12: c+=k[2]; b+=k[1]; a+=k[0]; break; - case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ - case 10: c+=((uint32_t)k8[9])<<8; /* fall through */ - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[1]; a+=k[0]; break; - case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ - case 6 : b+=((uint32_t)k8[5])<<8; /* fall through */ - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]; break; - case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ - case 2 : a+=((uint32_t)k8[1])<<8; /* fall through */ - case 1 : a+=k8[0]; break; - case 0 : return c; - } - -#endif /* !valgrind */ - - } else if (HASH_LITTLE_ENDIAN && ((u.i & 0x1) == 0)) { - const uint16_t *k = (const uint16_t *)key; /* read 16-bit chunks */ - const uint8_t *k8; - - /*--------------- all but last block: aligned reads and different mixing */ - while (length > 12) - { - a += k[0] + (((uint32_t)k[1])<<16); - b += k[2] + (((uint32_t)k[3])<<16); - c += k[4] + (((uint32_t)k[5])<<16); - mix(a,b,c); - length -= 12; - k += 6; - } - - /*----------------------------- handle the last (probably partial) block */ - k8 = (const uint8_t *)k; - switch(length) - { - case 12: c+=k[4]+(((uint32_t)k[5])<<16); - b+=k[2]+(((uint32_t)k[3])<<16); - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 11: c+=((uint32_t)k8[10])<<16; /* fall through */ - case 10: c+=k[4]; - b+=k[2]+(((uint32_t)k[3])<<16); - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 9 : c+=k8[8]; /* fall through */ - case 8 : b+=k[2]+(((uint32_t)k[3])<<16); - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 7 : b+=((uint32_t)k8[6])<<16; /* fall through */ - case 6 : b+=k[2]; - a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 5 : b+=k8[4]; /* fall through */ - case 4 : a+=k[0]+(((uint32_t)k[1])<<16); - break; - case 3 : a+=((uint32_t)k8[2])<<16; /* fall through */ - case 2 : a+=k[0]; - break; - case 1 : a+=k8[0]; - break; - case 0 : return c; /* zero length requires no mixing */ - } - - } else { /* need to read the key one byte at a time */ - const uint8_t *k = (const uint8_t *)key; - - /*--------------- all but the last block: affect some 32 bits of (a,b,c) */ - while (length > 12) - { - a += k[0]; - a += ((uint32_t)k[1])<<8; - a += ((uint32_t)k[2])<<16; - a += ((uint32_t)k[3])<<24; - b += k[4]; - b += ((uint32_t)k[5])<<8; - b += ((uint32_t)k[6])<<16; - b += ((uint32_t)k[7])<<24; - c += k[8]; - c += ((uint32_t)k[9])<<8; - c += ((uint32_t)k[10])<<16; - c += ((uint32_t)k[11])<<24; - mix(a,b,c); - length -= 12; - k += 12; - } - - /*-------------------------------- last block: affect all 32 bits of (c) */ - switch(length) /* all the case statements fall through */ - { - case 12: c+=((uint32_t)k[11])<<24; - /* fall through */ - case 11: c+=((uint32_t)k[10])<<16; - /* fall through */ - case 10: c+=((uint32_t)k[9])<<8; - /* fall through */ - case 9 : c+=k[8]; - /* fall through */ - case 8 : b+=((uint32_t)k[7])<<24; - /* fall through */ - case 7 : b+=((uint32_t)k[6])<<16; - /* fall through */ - case 6 : b+=((uint32_t)k[5])<<8; - /* fall through */ - case 5 : b+=k[4]; - /* fall through */ - case 4 : a+=((uint32_t)k[3])<<24; - /* fall through */ - case 3 : a+=((uint32_t)k[2])<<16; - /* fall through */ - case 2 : a+=((uint32_t)k[1])<<8; - /* fall through */ - case 1 : a+=k[0]; - break; - case 0 : return c; - } - } - - final(a,b,c); - c=(32767&c); - - return c; + /* WSPR table indices use 15 bits; empty keys historically bypass the mask. */ + uint32_t hash = wsjt_hashlittle(key, length, initval); + return length == 0 ? hash : hash & (uint32_t)0x7fff; } diff --git a/lib/wsprd/osdwspr.f90 b/lib/wsprd/osdwspr.f90 index 2a2d712d..31ece6a0 100644 --- a/lib/wsprd/osdwspr.f90 +++ b/lib/wsprd/osdwspr.f90 @@ -133,6 +133,8 @@ elseif(ndeep.eq.5) then nt=66 ntheta=22 ntau=16 +else + goto 998 endif do iorder=1,nord diff --git a/lib/wsprd/wsprd.c b/lib/wsprd/wsprd.c index 13f8d8b3..d442c70b 100644 --- a/lib/wsprd/wsprd.c +++ b/lib/wsprd/wsprd.c @@ -42,6 +42,7 @@ #include "nhash.h" #include "wsprd_utils.h" #include "wsprsim_utils.h" +#include "wsprd_stream.h" #define max(x,y) ((x) > (y) ? (x) : (y)) @@ -727,6 +728,23 @@ void usage(void) printf(" -v verbose mode (shows dupes)\n"); printf(" -w wideband mode - decode signals within +/- 150 Hz of center\n"); printf(" -z x (x is fano metric table bias, default is 0.45)\n"); + printf(" -0 streaming mode: read PCM audio from stdin per the\n"); + printf(" streaming framing protocol; emit decodes as NDJSON\n"); + printf(" on stdout. Replaces the positional\n"); + printf(" input file argument.\n"); +} + +static int build_data_path(char *destination, size_t capacity, + const char *data_dir, const char *filename) +{ + const char *base = data_dir ? data_dir : "."; + int written = snprintf(destination, capacity, "%s/%s", base, filename); + if (written < 0 || (size_t)written >= capacity) { + fprintf(stderr, "Error: data path for '%s' exceeds %zu bytes\n", + filename, capacity - 1); + return -1; + } + return 0; } //*************************************************************************** @@ -740,13 +758,15 @@ int main(int argc, char *argv[]) unsigned char *symbols, *decdata, *channel_symbols, *apmask, *cw; signed char message[]={-9,13,-35,123,57,-39,64,0,0,0,0}; char *callsign, *grid, *call_loc_pow; - char *ptr_to_infile,*ptr_to_infile_suffix; + char *ptr_to_infile = NULL, *ptr_to_infile_suffix = NULL; char *data_dir="."; char wisdom_fname[200],all_fname[200],spots_fname[200]; char timer_fname[200],hash_fname[200]; char uttime[5],date[7]; int c,delta,maxpts=65536,verbose=0,quickmode=0,more_candidates=0, stackdecoder=0; int usehashtable=1,wspr_type=2, ipass, nblocksize; + int stream_mode = 0; + struct wsprd_stream_config stream_cfg = {0}; int nhardmin,ihash; int writec2=0,maxdrift; int shift1, lagmin, lagmax, lagstep, ifmin, ifmax, not_decoded; @@ -777,10 +797,9 @@ int main(int argc, char *argv[]) struct result decodes[50]; char *hashtab; - hashtab=calloc(32768*13,sizeof(char)); + hashtab=calloc(WSPRD_HASH_COUNT*WSPRD_CALLSIGN_SIZE,sizeof(char)); char *loctab; - loctab=calloc(32768*5,sizeof(char)); - int nh; + loctab=calloc(WSPRD_HASH_COUNT*WSPRD_GRID4_SIZE,sizeof(char)); symbols=calloc(nbits*2,sizeof(unsigned char)); apmask=calloc(162,sizeof(unsigned char)); cw=calloc(162,sizeof(unsigned char)); @@ -818,8 +837,26 @@ int main(int argc, char *argv[]) idat=calloc(maxpts,sizeof(float)); qdat=calloc(maxpts,sizeof(float)); + if (!hashtab || !loctab || !symbols || !apmask || !cw || !decdata || + !channel_symbols || !callsign || !grid || !call_loc_pow || + !idat || !qdat) { + fprintf(stderr, "Error: unable to allocate wsprd decoder buffers\n"); + free(hashtab); + free(loctab); + free(symbols); + free(apmask); + free(cw); + free(decdata); + free(channel_symbols); + free(callsign); + free(grid); + free(call_loc_pow); + free(idat); + free(qdat); + return EXIT_FAILURE; + } - while ( (c = getopt(argc, argv, "a:BcC:de:f:HJmo:qstwvz:")) !=-1 ) { + while ( (c = getopt(argc, argv, "a:BcC:de:f:HJmo:qstwvz:0")) !=-1 ) { switch (c) { case 'a': data_dir = optarg; @@ -872,6 +909,9 @@ int main(int argc, char *argv[]) case 'z': bias=strtod(optarg,NULL); //fano metric bias (default is 0.45) break; + case '0': // --stream (long-name parity with jt9 --stream) + stream_mode = 1; + break; case '?': usage(); return 1; @@ -884,15 +924,19 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } - if( optind+1 > argc) { + if( !stream_mode && optind+1 > argc) { usage(); return 1; - } else { + } else if (!stream_mode) { ptr_to_infile=argv[optind]; } if( stackdecoder ) { stack=calloc(stacksize,sizeof(struct snode)); + if (!stack) { + fprintf(stderr, "Error: unable to allocate wsprd stack decoder\n"); + return EXIT_FAILURE; + } } // setup metric table @@ -902,23 +946,18 @@ int main(int argc, char *argv[]) } FILE *fp_fftwf_wisdom_file, *fall_wspr, *fwsprd, *fhash, *ftimer; - strcpy(wisdom_fname,"."); - strcpy(all_fname,"."); - strcpy(spots_fname,"."); - strcpy(timer_fname,"."); - strcpy(hash_fname,"."); - if(data_dir != NULL) { - strncpy(wisdom_fname,data_dir, sizeof wisdom_fname); - strncpy(all_fname,data_dir, sizeof all_fname); - strncpy(spots_fname,data_dir, sizeof spots_fname); - strncpy(timer_fname,data_dir, sizeof timer_fname); - strncpy(hash_fname,data_dir, sizeof hash_fname); + if (build_data_path(wisdom_fname, sizeof wisdom_fname, data_dir, + "wspr_wisdom.dat") != 0 || + build_data_path(all_fname, sizeof all_fname, data_dir, + "ALL_WSPR.TXT") != 0 || + build_data_path(spots_fname, sizeof spots_fname, data_dir, + "wspr_spots.txt") != 0 || + build_data_path(timer_fname, sizeof timer_fname, data_dir, + "wspr_timer.out") != 0 || + build_data_path(hash_fname, sizeof hash_fname, data_dir, + "hashtable.txt") != 0) { + return EXIT_FAILURE; } - strncat(wisdom_fname,"/wspr_wisdom.dat",20); - strncat(all_fname,"/ALL_WSPR.TXT",20); - strncat(spots_fname,"/wspr_spots.txt",20); - strncat(timer_fname,"/wspr_timer.out",20); - strncat(hash_fname,"/hashtable.txt",20); if ((fp_fftwf_wisdom_file = fopen(wisdom_fname, "r"))) { //Open FFTW wisdom fftwf_import_wisdom_from_file(fp_fftwf_wisdom_file); fclose(fp_fftwf_wisdom_file); @@ -938,17 +977,35 @@ int main(int argc, char *argv[]) } ftimer=fopen(timer_fname,"w"); - if( strstr(ptr_to_infile,".wav") ) { + if (stream_mode) { + // Read PCM from stdin per the streaming protocol. Configure frame + // supplies date/time/dialfreq/wspr_type; audio frames carry int16 + // PCM @ 12 kHz mono. + wsprd_stream_emit_ready(); + t0 = clock(); + npoints = wsprd_stream_read(&stream_cfg, idat, qdat); + treadwav += (float)(clock()-t0)/CLOCKS_PER_SEC; + if (npoints == 1) return 1; + wspr_type = stream_cfg.wspr_type; + dialfreq = stream_cfg.dialfreq - (dialfreq_error * 1.0e-06); + strncpy(date, stream_cfg.date, 6); date[6] = '\0'; + strncpy(uttime, stream_cfg.uttime, 4); uttime[4] = '\0'; + } else if( strstr(ptr_to_infile,".wav") ) { ptr_to_infile_suffix=strstr(ptr_to_infile,".wav"); - + t0 = clock(); npoints=readwavfile(ptr_to_infile, wspr_type, idat, qdat); treadwav += (float)(clock()-t0)/CLOCKS_PER_SEC; - + if( npoints == 1 ) { return 1; } dialfreq=dialfreq_cmdline - (dialfreq_error*1.0e-06); + // Parse date and time from given filename + strncpy(date,ptr_to_infile_suffix-11,6); + strncpy(uttime,ptr_to_infile_suffix-4,4); + date[6]='\0'; + uttime[4]='\0'; } else if ( strstr(ptr_to_infile,".c2") !=0 ) { ptr_to_infile_suffix=strstr(ptr_to_infile,".c2"); npoints=readc2file(ptr_to_infile, idat, qdat, &dialfreq, &wspr_type); @@ -956,23 +1013,34 @@ int main(int argc, char *argv[]) return 1; } dialfreq -= (dialfreq_error*1.0e-06); + // Parse date and time from given filename + strncpy(date,ptr_to_infile_suffix-11,6); + strncpy(uttime,ptr_to_infile_suffix-4,4); + date[6]='\0'; + uttime[4]='\0'; } else { printf("Error: Failed to open %s\n",ptr_to_infile); printf("WSPR file must have suffix .wav or .c2\n"); return 1; } - // Parse date and time from given filename - strncpy(date,ptr_to_infile_suffix-11,6); - strncpy(uttime,ptr_to_infile_suffix-4,4); - date[6]='\0'; - uttime[4]='\0'; - // Do windowed ffts over 2 symbols, stepped by half symbols int nffts=4*floor(npoints/512)-1; fftin=(fftwf_complex*) fftwf_malloc(sizeof(fftwf_complex)*512); fftout=(fftwf_complex*) fftwf_malloc(sizeof(fftwf_complex)*512); + if (!fftin || !fftout) { + fprintf(stderr, "Error: unable to allocate wsprd FFT buffers\n"); + if (fftin) fftwf_free(fftin); + if (fftout) fftwf_free(fftout); + return EXIT_FAILURE; + } PLAN3 = fftwf_plan_dft_1d(512, fftin, fftout, FFTW_FORWARD, PATIENCE); + if (!PLAN3) { + fprintf(stderr, "Error: unable to create wsprd FFT plan\n"); + fftwf_free(fftin); + fftwf_free(fftout); + return EXIT_FAILURE; + } float ps[512][nffts]; float w[512]; @@ -981,13 +1049,10 @@ int main(int argc, char *argv[]) } if( usehashtable ) { - char line[80], hcall[13], hgrid[5]; + char line[80]; if( (fhash=fopen(hash_fname,"r+")) ) { while (fgets(line, sizeof(line), fhash) != NULL) { - hgrid[0]='\0'; - sscanf(line,"%d %s %s",&nh,hcall,hgrid); - strcpy(hashtab+nh*13,hcall); - if(strlen(hgrid)>0) strcpy(loctab+nh*5,hgrid); + wsprd_load_hash_line(line, hashtab, loctab); } } else { fhash=fopen(hash_fname,"w+"); @@ -1003,7 +1068,7 @@ int main(int argc, char *argv[]) maxdrift=4; minsync2=0.12; } - if(ipass == 2 ) { + else { nblocksize=4; // try 3 blocksizes plus bitbybit normalization maxdrift=0; // no drift for smaller frequency estimator variance minsync2=0.10; @@ -1444,7 +1509,8 @@ int main(int argc, char *argv[]) if(!strcmp(callsign,allcalls[i]) && (fabs(f1-allfreqs[i]) <4.0)) dupe=1; } - if( (verbose || !dupe) && !noprint) { + if( (verbose || !dupe) && !noprint && + uniques < (int)(sizeof decodes / sizeof decodes[0]) ) { strcpy(allcalls[uniques],callsign); allfreqs[uniques]=f1; uniques++; @@ -1502,9 +1568,16 @@ int main(int argc, char *argv[]) } for (i=0; i\n"); + if (stream_mode) { + wsprd_stream_emit_decode_finished(date, uttime); + } else { + printf("\n"); + } fftwf_free(fftin); fftwf_free(fftout); @@ -1553,15 +1630,17 @@ int main(int argc, char *argv[]) fclose(fwsprd); // fclose(fdiag); fclose(ftimer); - fftwf_destroy_plan(PLAN1); - fftwf_destroy_plan(PLAN2); - fftwf_destroy_plan(PLAN3); + if (PLAN1) fftwf_destroy_plan(PLAN1); + if (PLAN2) fftwf_destroy_plan(PLAN2); + if (PLAN3) fftwf_destroy_plan(PLAN3); if( usehashtable ) { fhash=fopen(hash_fname,"w"); - for (i=0; i<32768; i++) { - if( strncmp(hashtab+i*13,"\0",1) != 0 ) { - fprintf(fhash,"%5d %s %s\n",i,hashtab+i*13,loctab+i*5); + for (i=0; i +#include +#include +#include +#include +#include +#include +#include +#ifdef _WIN32 +#include +#include +#endif + +#include "wsprd_stream.h" + +#define WSJT_MAGIC "WSJT" +#define WSJT_FMT_PCM 0x00 +#define FRAME_AUDIO 0x01 +#define FRAME_CONTROL 0x02 + +// Buffer the producer's audio chunks. Sized for WSPR-15 worst case +// (8 * 114 * 12000 = 10,944,000 samples). WSPR-2 needs only 1,368,000. +#define MAX_PCM_SAMPLES (8 * 114 * 12000) +#define MAX_CONTROL_FRAME 1024U + +// ============================================================ +// JSON parsing for the flat, ASCII streaming control schema. +// ============================================================ + +static const char *skip_space(const char *p) { + while (*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n') p++; + return p; +} + +static const char *skip_json_string(const char *p) { + if (*p != '"') return NULL; + for (p++; *p; p++) { + if (*p == '\\' && p[1]) { + p++; + } else if (*p == '"') { + return p + 1; + } + } + return NULL; +} + +static const char *json_find_key(const char *json, const char *key) { + const size_t key_len = strlen(key); + const char *p = skip_space(json); + if (*p != '{') return NULL; + p++; + + for (;;) { + p = skip_space(p); + if (*p == ',') { + p = skip_space(p + 1); + } + if (*p == '}') return NULL; + if (*p != '"') return NULL; + + const char *name = p + 1; + const char *after_name = skip_json_string(p); + if (!after_name) return NULL; + const size_t name_len = (size_t)(after_name - name - 1); + p = skip_space(after_name); + if (*p != ':') return NULL; + const char *value = skip_space(p + 1); + if (name_len == key_len && memcmp(name, key, key_len) == 0) { + return *value ? value : NULL; + } + + if (*value == '"') { + p = skip_json_string(value); + if (!p) return NULL; + } else { + p = value; + while (*p && *p != ',' && *p != '}') p++; + } + if (*p == '}') return NULL; + } +} + +static int json_get_string(const char *json, const char *key, + char *out, size_t out_size) { + const char *p = json_find_key(json, key); + if (!p || *p != '"') return -1; + p++; + size_t i = 0; + while (*p && *p != '"' && i + 1 < out_size) { + out[i++] = *p++; + } + out[i] = '\0'; + return (*p == '"') ? 0 : -1; +} + +static int json_get_int(const char *json, const char *key, int *out) { + const char *p = json_find_key(json, key); + if (!p) return -1; + char *end = NULL; + errno = 0; + long v = strtol(p, &end, 10); + if (end == p || errno == ERANGE || v < INT_MIN || v > INT_MAX) return -1; + end = (char *)skip_space(end); + if (*end != ',' && *end != '}') return -1; + *out = (int) v; + return 0; +} + +static int json_get_double(const char *json, const char *key, double *out) { + const char *p = json_find_key(json, key); + if (!p) return -1; + char *end = NULL; + double v = strtod(p, &end); + if (end == p) return -1; + *out = v; + return 0; +} + +// ============================================================ +// Frame I/O. +// ============================================================ + +static void set_stdin_binary(void) { +#ifdef _WIN32 + _setmode(_fileno(stdin), _O_BINARY); +#endif +} + +static int wsjt_header_read(FILE *fp) { + unsigned char hdr[8]; + if (fread(hdr, 1, 8, fp) != 8) { + fprintf(stderr, "wsprd --stream: short read on WSJT header\n"); + return -1; + } + if (memcmp(hdr, WSJT_MAGIC, 4) != 0) { + fprintf(stderr, "wsprd --stream: bad magic; expected 'WSJT'\n"); + return -1; + } + unsigned char fmt = hdr[4]; + unsigned char ch = hdr[5]; + uint16_t rate_khz = (uint16_t)hdr[6] | ((uint16_t)hdr[7] << 8); + if (fmt != WSJT_FMT_PCM) { + fprintf(stderr, + "wsprd --stream: unsupported fmt=0x%02x (only 0x00 PCM today)\n", + fmt); + return -1; + } + if (ch != 1) { + fprintf(stderr, + "wsprd --stream: unsupported channels=%u (only mono supported)\n", + ch); + return -1; + } + if (rate_khz != 12) { + fprintf(stderr, + "wsprd --stream: unsupported rate=%u kHz (only 12 kHz supported)\n", + rate_khz); + return -1; + } + fprintf(stderr, + "wsprd --stream: header ok (fmt=%u ch=%u rate=%u kHz)\n", + fmt, ch, rate_khz); + return 0; +} + +// Reads one frame envelope. *body is malloc'd on success; caller frees. +// Returns 0 ok, -1 err, +1 EOF (clean producer-disconnect). +static int frame_read(FILE *fp, unsigned char *type, void **body, uint32_t *len) { + unsigned char hdr[5]; + size_t nr = fread(hdr, 1, 5, fp); + if (nr == 0) return 1; // clean EOF + if (nr != 5) { + fprintf(stderr, "wsprd --stream: short read on frame header\n"); + return -1; + } + *type = hdr[0]; + *len = (uint32_t)hdr[1] | ((uint32_t)hdr[2] << 8) | + ((uint32_t)hdr[3] << 16) | ((uint32_t)hdr[4] << 24); + const uint32_t max_len = *type == FRAME_CONTROL + ? MAX_CONTROL_FRAME + : (uint32_t)(MAX_PCM_SAMPLES * sizeof(int16_t)); + if (*len > max_len) { + char detail[160]; + snprintf(detail, sizeof detail, + "frame length %u exceeds type capacity %u", *len, max_len); + wsprd_stream_emit_error_code("frame_too_large", detail); + fprintf(stderr, "wsprd --stream: %s\n", detail); + return -1; + } + if (*len == 0) { + *body = NULL; + return 0; + } + *body = malloc(*len); + if (!*body) { + fprintf(stderr, "wsprd --stream: alloc %u bytes failed\n", *len); + wsprd_stream_emit_error_code("allocation_failed", + "unable to allocate frame body"); + return -1; + } + if (fread(*body, 1, *len, fp) != *len) { + fprintf(stderr, "wsprd --stream: short read on frame body (%u bytes)\n", + *len); + free(*body); + *body = NULL; + wsprd_stream_emit_error_code("frame_read_error", + "short read on frame body"); + return -1; + } + return 0; +} + +// ============================================================ +// PCM → I/Q FFT/extract/IFFT (mirrors readwavfile lines 155-188). +// ============================================================ + +static unsigned long pcm_to_iq(int16_t *pcm, size_t npcm, int ntrmin, + float *idat, float *qdat) { + int nfft1, nfft2 = 46080, nh2 = nfft2 / 2, i0; + double df; + size_t expected_npcm; + float *realin = NULL; + fftwf_complex *fftout = NULL; + fftwf_complex *fftin = NULL; + fftwf_complex *fftout2 = NULL; + fftwf_plan plan_fwd = NULL; + fftwf_plan plan_inv = NULL; + unsigned long result = 1; + + if (ntrmin == 2) { + nfft1 = nfft2 * 32; + df = 12000.0 / nfft1; + i0 = 1500.0 / df + 0.5; + expected_npcm = 114 * 12000; + } else if (ntrmin == 15) { + nfft1 = nfft2 * 8 * 32; + df = 12000.0 / nfft1; + i0 = (1500.0 + 112.5) / df + 0.5; + expected_npcm = 8 * 114 * 12000; + } else { + fprintf(stderr, "wsprd --stream: invalid wspr_type=%d\n", ntrmin); + wsprd_stream_emit_error_code("invalid_wspr_type", + "wspr_type must be 2 or 15"); + return 1; + } + + if (npcm < expected_npcm) { + fprintf(stderr, + "wsprd --stream: short PCM (got %zu, expected %zu for WSPR-%d)\n", + npcm, expected_npcm, ntrmin); + wsprd_stream_emit_error_code("insufficient_audio", + "not enough PCM samples for the configured WSPR type"); + return 1; + } + + realin = fftwf_malloc(sizeof(float) * (size_t)nfft1); + fftout = fftwf_malloc(sizeof(fftwf_complex) * ((size_t)nfft1 / 2 + 1)); + if (!realin || !fftout) { + wsprd_stream_emit_error_code("allocation_failed", + "unable to allocate streaming FFT buffers"); + goto cleanup; + } + plan_fwd = fftwf_plan_dft_r2c_1d(nfft1, realin, fftout, FFTW_ESTIMATE); + if (!plan_fwd) { + wsprd_stream_emit_error_code("allocation_failed", + "unable to create streaming forward FFT plan"); + goto cleanup; + } + + for (size_t i = 0; i < expected_npcm; i++) realin[i] = pcm[i] / 32768.0f; + for (size_t i = expected_npcm; i < (size_t)nfft1; i++) realin[i] = 0.0f; + + fftwf_execute(plan_fwd); + fftwf_destroy_plan(plan_fwd); + plan_fwd = NULL; + fftwf_free(realin); + realin = NULL; + + fftin = fftwf_malloc(sizeof(fftwf_complex) * (size_t)nfft2); + if (!fftin) { + wsprd_stream_emit_error_code("allocation_failed", + "unable to allocate streaming inverse FFT input"); + goto cleanup; + } + for (size_t i = 0; i < (size_t)nfft2; i++) { + size_t j = i0 + i; + if (i > (size_t)nh2) j = j - nfft2; + fftin[i][0] = fftout[j][0]; + fftin[i][1] = fftout[j][1]; + } + fftwf_free(fftout); + fftout = NULL; + + fftout2 = fftwf_malloc(sizeof(fftwf_complex) * (size_t)nfft2); + if (!fftout2) { + wsprd_stream_emit_error_code("allocation_failed", + "unable to allocate streaming inverse FFT output"); + goto cleanup; + } + plan_inv = fftwf_plan_dft_1d(nfft2, fftin, fftout2, FFTW_BACKWARD, + FFTW_ESTIMATE); + if (!plan_inv) { + wsprd_stream_emit_error_code("allocation_failed", + "unable to create streaming inverse FFT plan"); + goto cleanup; + } + fftwf_execute(plan_inv); + fftwf_destroy_plan(plan_inv); + plan_inv = NULL; + + for (size_t i = 0; i < (size_t)nfft2; i++) { + idat[i] = fftout2[i][0] / 1000.0f; + qdat[i] = fftout2[i][1] / 1000.0f; + } + result = (unsigned long)nfft2; + +cleanup: + if (plan_fwd) fftwf_destroy_plan(plan_fwd); + if (plan_inv) fftwf_destroy_plan(plan_inv); + if (realin) fftwf_free(realin); + if (fftout) fftwf_free(fftout); + if (fftin) fftwf_free(fftin); + if (fftout2) fftwf_free(fftout2); + return result; +} + +// ============================================================ +// Public API (declared in wsprd_stream.h). +// ============================================================ + +void wsprd_stream_emit_ready(void) { + fputs("{\"v\":1,\"t\":\"ready\",\"modes\":[\"WSPR\"],\"protocol\":1}\n", + stdout); + fflush(stdout); +} + +// JSON-escape a string into out. Best-effort: handles ASCII printable +// and the must-escape control chars per RFC 8259. +static void json_escape_into(const char *src, char *out, size_t out_size) { + size_t o = 0; + for (const char *p = src; *p && o + 6 < out_size; p++) { + unsigned char c = (unsigned char) *p; + if (c == '"' || c == '\\') { + if (o + 2 < out_size) { out[o++] = '\\'; out[o++] = c; } + } else if (c < 0x20) { + o += snprintf(out + o, out_size - o, "\\u%04x", c); + } else { + out[o++] = c; + } + } + out[o] = '\0'; +} + +void wsprd_stream_emit_decode(const char *date, const char *uttime, + float snr, float dt, double freq, + int drift, const char *message) { + char esc_msg[80]; + json_escape_into(message ? message : "", esc_msg, sizeof esc_msg); + fprintf(stdout, + "{\"v\":1,\"t\":\"decode\",\"mode\":\"WSPR\"," + "\"date\":\"%s\",\"time\":\"%s\"," + "\"snr\":%.0f,\"dt\":%.1f,\"freq\":%.6f," + "\"drift\":%d,\"message\":\"%s\"}\n", + date ? date : "", + uttime ? uttime : "", + snr, dt, freq, drift, esc_msg); + fflush(stdout); +} + +void wsprd_stream_emit_decode_finished(const char *date, const char *uttime) { + fprintf(stdout, + "{\"v\":1,\"t\":\"decode_finished\"," + "\"date\":\"%s\",\"time\":\"%s\"}\n", + date ? date : "", + uttime ? uttime : ""); + fflush(stdout); +} + +void wsprd_stream_emit_error(const char *msg) { + char esc[256]; + json_escape_into(msg ? msg : "", esc, sizeof esc); + fprintf(stdout, "{\"v\":1,\"t\":\"error\",\"msg\":\"%s\"}\n", esc); + fflush(stdout); +} + +void wsprd_stream_emit_error_code(const char *code, const char *detail) { + char esc_code[80]; + char esc_detail[256]; + json_escape_into(code ? code : "", esc_code, sizeof esc_code); + json_escape_into(detail ? detail : "", esc_detail, sizeof esc_detail); + fprintf(stdout, + "{\"v\":1,\"t\":\"error\",\"code\":\"%s\",\"detail\":\"%s\"}\n", + esc_code, esc_detail); + fflush(stdout); +} + +// Read header + frames from stdin until configure + enough audio + halt +// (or audio-exhaustion + EOF) are received. Populates *cfg and the +// supplied I/Q buffers via FFT/extract/IFFT. Returns nfft2 (number of +// complex samples populated) on success; 1 on protocol error. +unsigned long wsprd_stream_read(struct wsprd_stream_config *cfg, + float *idat, float *qdat) { + set_stdin_binary(); + if (wsjt_header_read(stdin) != 0) return 1; + + int16_t *pcm = calloc(MAX_PCM_SAMPLES, sizeof(int16_t)); + if (!pcm) { + wsprd_stream_emit_error_code("allocation_failed", + "unable to allocate PCM accumulation buffer"); + return 1; + } + + memset(cfg, 0, sizeof *cfg); + cfg->wspr_type = 2; + int have_date = 0; + int have_time = 0; + int have_dialfreq = 0; + int halted = 0; + int wspr_type_value = 0; + size_t pcm_n = 0; + + while (!halted) { + unsigned char type; + void *body = NULL; + uint32_t len = 0; + int rc = frame_read(stdin, &type, &body, &len); + if (rc < 0) { + free(pcm); + return 1; + } + if (rc > 0) break; // EOF without halt — treat as drain-and-decode + + if (type == FRAME_CONTROL) { + char *json = malloc((size_t)len + 1); + if (!json) { + free(body); + free(pcm); + wsprd_stream_emit_error_code("allocation_failed", + "unable to allocate control JSON buffer"); + return 1; + } + if (len != 0) { + memcpy(json, body, len); + } + json[len] = '\0'; + free(body); + + char event_type[16]; + if (json_get_string(json, "t", event_type, sizeof event_type) != 0) { + free(json); + wsprd_stream_emit_error_code("control_parse_error", + "control frame is missing a string t field"); + continue; + } + if (strcmp(event_type, "halt") == 0) { + halted = 1; + free(json); + continue; + } + if (strcmp(event_type, "configure") == 0) { + if (json_get_string(json, "date", cfg->date, + sizeof cfg->date) == 0) { + have_date = 1; + } + if (json_get_string(json, "time", cfg->uttime, + sizeof cfg->uttime) == 0) { + have_time = 1; + } + if (json_get_double(json, "dialfreq", &cfg->dialfreq) == 0) { + have_dialfreq = 1; + } + if (json_find_key(json, "wspr_type")) { + if (json_get_int(json, "wspr_type", &wspr_type_value) != 0 || + (wspr_type_value != 2 && wspr_type_value != 15)) { + free(json); + free(pcm); + wsprd_stream_emit_error_code("invalid_wspr_type", + "wspr_type must be 2 or 15"); + return 1; + } + cfg->wspr_type = wspr_type_value; + } + json_get_string(json, "mycall", cfg->mycall, sizeof cfg->mycall); + json_get_string(json, "mygrid", cfg->mygrid, sizeof cfg->mygrid); + cfg->configure_received = 1; + } + free(json); + continue; + } + + if (type == FRAME_AUDIO) { + // body is raw int16 LE PCM. len must be even (whole samples). + if (len % sizeof(int16_t) != 0) { + free(body); + wsprd_stream_emit_error_code("odd_audio_frame", + "audio frame length must contain whole int16 samples"); + free(pcm); + return 1; + } + size_t nsamples = len / sizeof(int16_t); + if (pcm_n + nsamples > MAX_PCM_SAMPLES) { + nsamples = MAX_PCM_SAMPLES - pcm_n; + } + if (nsamples != 0) { + memcpy(pcm + pcm_n, body, nsamples * sizeof(int16_t)); + } + pcm_n += nsamples; + free(body); + continue; + } + + // Unknown frame type — ignore (forward-compat). + free(body); + } + + if (!cfg->configure_received) { + free(pcm); + wsprd_stream_emit_error_code("missing_configure", + "no configure frame received before halt or EOF"); + return 1; + } + if (!have_date || !have_time || !have_dialfreq) { + free(pcm); + wsprd_stream_emit_error_code("incomplete_configure", + "configure frame missing date, time, or dialfreq"); + return 1; + } + + unsigned long npoints = pcm_to_iq(pcm, pcm_n, cfg->wspr_type, idat, qdat); + free(pcm); + return npoints; +} diff --git a/lib/wsprd/wsprd_stream.h b/lib/wsprd/wsprd_stream.h new file mode 100644 index 00000000..0eed120e --- /dev/null +++ b/lib/wsprd/wsprd_stream.h @@ -0,0 +1,33 @@ +/* + * wsprd streaming layer — public API consumed by wsprd.c. + * See wsprd_stream.c for protocol + scope notes. + */ +#ifndef WSPRD_STREAM_H +#define WSPRD_STREAM_H + +struct wsprd_stream_config { + char date[7]; // YYMMDD\0 + char uttime[5]; // HHMM\0 + double dialfreq; // MHz + int wspr_type; // 2 or 15 + char mycall[13]; // up to 12-char callsign + NUL + char mygrid[7]; // up to 6-char grid + NUL + int configure_received; +}; + +void wsprd_stream_emit_ready(void); +void wsprd_stream_emit_decode(const char *date, const char *uttime, + float snr, float dt, double freq, + int drift, const char *message); +void wsprd_stream_emit_decode_finished(const char *date, const char *uttime); +void wsprd_stream_emit_error(const char *msg); +void wsprd_stream_emit_error_code(const char *code, const char *detail); + +// Reads WSJT header + frames from stdin until halt or EOF. On success, +// populates *cfg and the supplied I/Q buffers (idat/qdat must hold +// at least 46080 floats each). Returns the number of complex samples +// populated (nfft2 = 46080), or 1 on protocol error. +unsigned long wsprd_stream_read(struct wsprd_stream_config *cfg, + float *idat, float *qdat); + +#endif diff --git a/lib/wsprd/wsprd_utils.c b/lib/wsprd/wsprd_utils.c index 64e809f8..bd17890d 100644 --- a/lib/wsprd/wsprd_utils.c +++ b/lib/wsprd/wsprd_utils.c @@ -27,11 +27,96 @@ along with this program. If not, see . */ #include "wsprd_utils.h" +#include +#include #ifndef int32_t #define int32_t int #endif +static int format_checked(char *dest, size_t dest_size, char const *format, ...) +{ + va_list args; + va_start(args, format); + int nwritten = vsnprintf(dest, dest_size, format, args); + va_end(args); + return nwritten >= 0 && (size_t)nwritten < dest_size; +} + +static int read_bounded_token(char const **cursor, char *dest, + size_t dest_size, int required) +{ + char const *p = *cursor; + while( isspace((unsigned char)*p) ) p++; + + if( *p == '\0' ) { + if( required ) return 0; + dest[0] = '\0'; + *cursor = p; + return 1; + } + + char const *start = p; + while( *p != '\0' && !isspace((unsigned char)*p) ) p++; + + size_t len = (size_t)(p - start); + if( len >= dest_size ) return 0; + + memcpy(dest, start, len); + dest[len] = '\0'; + *cursor = p; + return 1; +} + +static int store_hash_call(int ihash, char const *callsign, char *hashtab) +{ + if( ihash < 0 || ihash >= WSPRD_HASH_COUNT ) return 0; + if( strlen(callsign) >= WSPRD_CALLSIGN_SIZE ) return 0; + if( !format_checked(hashtab + ihash * WSPRD_CALLSIGN_SIZE, + WSPRD_CALLSIGN_SIZE, "%s", callsign) ) return 0; + return 1; +} + +static int store_hash_grid(int ihash, char const *grid, char *loctab) +{ + if( ihash < 0 || ihash >= WSPRD_HASH_COUNT ) return 0; + if( strlen(grid) >= WSPRD_GRID4_SIZE ) return 0; + if( !format_checked(loctab + ihash * WSPRD_GRID4_SIZE, + WSPRD_GRID4_SIZE, "%s", grid) ) return 0; + return 1; +} + +static int store_hash_entry(int ihash, char const *callsign, char const *grid, + char *hashtab, char *loctab) +{ + if( !store_hash_call(ihash, callsign, hashtab) ) return 0; + if( !store_hash_grid(ihash, grid, loctab) ) return 0; + return 1; +} + +int wsprd_load_hash_line(char const *line, char *hashtab, char *loctab) +{ + char const *p = line; + errno = 0; + char *end = NULL; + long ihash = strtol(p, &end, 10); + if( p == end || errno == ERANGE || + ihash < 0 || ihash >= WSPRD_HASH_COUNT ) return 0; + if( !isspace((unsigned char)*end) ) return 0; + + char callsign[WSPRD_CALLSIGN_SIZE]; + char grid[WSPRD_GRID4_SIZE]; + p = end; + if( !read_bounded_token(&p, callsign, sizeof callsign, 1) ) return 0; + if( !read_bounded_token(&p, grid, sizeof grid, 0) ) return 0; + + if( !store_hash_call((int)ihash, callsign, hashtab) ) return 0; + /* Legacy loader semantics: missing grid preserves the existing locator. */ + if( grid[0] != '\0' && + !store_hash_grid((int)ihash, grid, loctab) ) return 0; + return 1; +} + void unpack50( signed char *dat, int32_t *n1, int32_t *n2 ) { int32_t i,i4; @@ -153,7 +238,7 @@ int unpackpfx( int32_t nprefix, char *call) int i; int32_t n; - strcpy(tmpcall,call); + if( !format_checked(tmpcall, sizeof tmpcall, "%s", call) ) return 0; if( nprefix < 60000 ) { // add a prefix of 1 to 3 characters n=nprefix; @@ -172,31 +257,27 @@ int unpackpfx( int32_t nprefix, char *call) } char * p = strrchr(pfx,' '); - strcpy(call, p ? p + 1 : pfx); - strncat(call,"/",1); - strncat(call,tmpcall,strlen(tmpcall)); + if( !format_checked(call, WSPRD_CALLSIGN_SIZE, "%s/%s", + p ? p + 1 : pfx, tmpcall) ) return 0; } else { // add a suffix of 1 or 2 characters nc=nprefix-60000; if( (nc >= 0) & (nc <= 9) ) { pfx[0]=nc+48; - strcpy(call,tmpcall); - strncat(call,"/",1); - strncat(call,pfx,1); + if( !format_checked(call, WSPRD_CALLSIGN_SIZE, "%s/%.1s", + tmpcall, pfx) ) return 0; } else if( (nc >= 10) & (nc <= 35) ) { pfx[0]=nc+55; - strcpy(call,tmpcall); - strncat(call,"/",1); - strncat(call,pfx,1); + if( !format_checked(call, WSPRD_CALLSIGN_SIZE, "%s/%.1s", + tmpcall, pfx) ) return 0; } else if( (nc >= 36) & (nc <= 125) ) { pfx[0]=(nc-26)/10+48; pfx[1]=(nc-26)%10+48; - strcpy(call,tmpcall); - strncat(call,"/",1); - strncat(call,pfx,2); + if( !format_checked(call, WSPRD_CALLSIGN_SIZE, "%s/%.2s", + tmpcall, pfx) ) return 0; } else { return 0; @@ -243,13 +324,13 @@ int floatcomp(const void* elem1, const void* elem2) int unpk_(signed char *message, char *hashtab, char *loctab, char *call_loc_pow, char *callsign) { int n1,n2,n3,ndbm,ihash,nadd,noprint=0; - char grid[5],grid6[7],cdbm[4]; + char grid[WSPRD_GRID4_SIZE],grid6[WSPRD_GRID6_SIZE]; unpack50(message,&n1,&n2); if( !unpackcall(n1,callsign) ) return 1; if( !unpackgrid(n2, grid) ) return 1; int ntype = (n2&127) - 64; - callsign[12]=0; + callsign[WSPRD_CALLSIGN_SIZE - 1]=0; grid[4]=0; /* @@ -269,17 +350,10 @@ int unpk_(signed char *message, char *hashtab, char *loctab, char *call_loc_pow, int nu=ntype%10; if( nu == 0 || nu == 3 || nu == 7 ) { ndbm=ntype; - memset(call_loc_pow,0,sizeof(char)*23); - sprintf(cdbm,"%2d",ndbm); - strncat(call_loc_pow,callsign,strlen(callsign)); - strncat(call_loc_pow," ",1); - strncat(call_loc_pow,grid,4); - strncat(call_loc_pow," ",1); - strncat(call_loc_pow,cdbm,2); - strncat(call_loc_pow,"\0",1); + if( !format_checked(call_loc_pow, WSPRD_MESSAGE_SIZE, "%s %.4s %2d", + callsign, grid, ndbm) ) return 1; ihash=nhash(callsign,strlen(callsign),(uint32_t)146); - strcpy(hashtab+ihash*13,callsign); - strcpy(loctab+ihash*5,grid); + if( !store_hash_entry(ihash, callsign, grid, hashtab, loctab) ) return 1; } else { nadd=nu; if( nu > 3 ) nadd=nu-3; @@ -287,25 +361,21 @@ int unpk_(signed char *message, char *hashtab, char *loctab, char *call_loc_pow, n3=n2/128+32768*(nadd-1); if( !unpackpfx(n3,callsign) ) return 1; ndbm=ntype-nadd; - memset(call_loc_pow,0,sizeof(char)*23); - sprintf(cdbm,"%2d",ndbm); - strncat(call_loc_pow,callsign,strlen(callsign)); - strncat(call_loc_pow," ",1); - strncat(call_loc_pow,cdbm,2); - strncat(call_loc_pow,"\0",1); + if( !format_checked(call_loc_pow, WSPRD_MESSAGE_SIZE, "%s %2d", + callsign, ndbm) ) return 1; int nu=ndbm%10; if( nu == 0 || nu == 3 || nu == 7 || nu == 10 ) { //make sure power is OK ihash=nhash(callsign,strlen(callsign),(uint32_t)146); - strcpy(hashtab+ihash*13,callsign); + if( !store_hash_call(ihash, callsign, hashtab) ) return 1; } else noprint=1; } } else if ( ntype < 0 ) { ndbm=-(ntype+1); - memset(grid6,0,sizeof(char)*7); + memset(grid6,0,sizeof grid6); // size_t len=strlen(callsign); size_t len=6; - strncat(grid6,callsign+len-1,1); - strncat(grid6,callsign,len-1); + if( !format_checked(grid6, sizeof grid6, "%.1s%.*s", + callsign+len-1, (int)(len-1), callsign) ) return 1; int nu=ndbm%10; if ((nu != 0 && nu != 3 && nu != 7 && nu != 10) || !isalpha(grid6[0]) || !isalpha(grid6[1]) || @@ -318,19 +388,15 @@ int unpk_(signed char *message, char *hashtab, char *loctab, char *call_loc_pow, ihash=(n2-ntype-64)/128; if( strncmp(hashtab+ihash*13,"\0",1) != 0 ) { - sprintf(callsign,"<%s>",hashtab+ihash*13); + if( !format_checked(callsign, WSPRD_CALLSIGN_SIZE, "<%s>", + hashtab+ihash*13) ) return 1; } else { - sprintf(callsign,"%5s","<...>"); + if( !format_checked(callsign, WSPRD_CALLSIGN_SIZE, "%5s", + "<...>") ) return 1; } - memset(call_loc_pow,0,sizeof(char)*23); - sprintf(cdbm,"%2d",ndbm); - strncat(call_loc_pow,callsign,strlen(callsign)); - strncat(call_loc_pow," ",1); - strncat(call_loc_pow,grid6,strlen(grid6)); - strncat(call_loc_pow," ",1); - strncat(call_loc_pow,cdbm,2); - strncat(call_loc_pow,"\0",1); + if( !format_checked(call_loc_pow, WSPRD_MESSAGE_SIZE, "%s %s %2d", + callsign, grid6, ndbm) ) return 1; // I don't know what to do with these... They show up as "A000AA" grids. diff --git a/lib/wsprd/wsprd_utils.h b/lib/wsprd/wsprd_utils.h index db6ba946..62c653e8 100644 --- a/lib/wsprd/wsprd_utils.h +++ b/lib/wsprd/wsprd_utils.h @@ -10,6 +10,14 @@ #include #include "nhash.h" +enum { + WSPRD_CALLSIGN_SIZE = 13, + WSPRD_GRID4_SIZE = 5, + WSPRD_GRID6_SIZE = 7, + WSPRD_MESSAGE_SIZE = 23, + WSPRD_HASH_COUNT = 32768 +}; + void unpack50( signed char *dat, int32_t *n1, int32_t *n2 ); int unpackcall( int32_t ncall, char *call ); @@ -26,4 +34,6 @@ int floatcomp(const void* elem1, const void* elem2); int unpk_( signed char *message, char* hashtab, char* loctab, char *call_loc_pow, char *callsign); +int wsprd_load_hash_line(char const *line, char *hashtab, char *loctab); + #endif diff --git a/lib/wsprd/wsprsimf.f90 b/lib/wsprd/wsprsimf.f90 index d6ee25d4..8fb2a0d7 100644 --- a/lib/wsprd/wsprsimf.f90 +++ b/lib/wsprd/wsprsimf.f90 @@ -89,7 +89,7 @@ program wsprsim endif write(fname14,1100) ifile 1100 format('000000_',i4.4,'.c2') - open(10,file=fname14,status='unknown',access='stream') + open(10,file=fname14,status='replace',access='stream') fMHz=10.1387d0 nmin=2 write(10) fname14,nmin,fMHz,c !Save to *.c2 file @@ -102,7 +102,7 @@ program wsprsim hwav=default_header(12000,NMAX) write(fname15,1102) ifile 1102 format('000000_',i4.4,'.wav') - open(10,file=fname15,status='unknown',access='stream') + open(10,file=fname15,status='replace',access='stream') write(10) hwav,iwave !Save to *.wav file close(10) write(*,1110) ifile,xdt,f0,snrdb,fname15 diff --git a/lib/xcor.f90 b/lib/xcor.f90 index 83937736..84273b85 100644 --- a/lib/xcor.f90 +++ b/lib/xcor.f90 @@ -13,7 +13,6 @@ subroutine xcor(ipk,nsteps,nsym,lag1,lag2,ccf,ccf0,lagpk,flip,fdot,nrobust) real a(NSMAX) ! real ccf(-44:118) real ccf(lag1:lag2) - data lagmin/0/ !Silence g77 warning ! save common/sync/ss @@ -43,6 +42,8 @@ subroutine xcor(ipk,nsteps,nsym,lag1,lag2,ccf,ccf0,lagpk,flip,fdot,nrobust) ccfmax=0. ccfmin=0. + lagpk=lag1 + lagmin=lag1 do lag=lag1,lag2 x=0. do i=1,nsym diff --git a/logbook/AD1CCty.cpp b/logbook/AD1CCty.cpp index e4b2fd84..d63b1dff 100644 --- a/logbook/AD1CCty.cpp +++ b/logbook/AD1CCty.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -21,6 +20,7 @@ #include "Radio.hpp" #include "pimpl_impl.hpp" #include "Logger.hpp" +#include "qt_helpers.hpp" #include "moc_AD1CCty.cpp" @@ -39,6 +39,7 @@ struct entity explicit entity (int id , QString const& name + , QString const& abbreviated_name , bool WAE_only , int CQ_zone , int ITU_zone @@ -49,6 +50,7 @@ struct entity , QString const& primary_prefix) : id_ {id} , name_ {name} + , abbreviated_name_ {abbreviated_name} , WAE_only_ {WAE_only} , CQ_zone_ {CQ_zone} , ITU_zone_ {ITU_zone} @@ -62,6 +64,7 @@ struct entity int id_; QString name_; + QString abbreviated_name_; bool WAE_only_; // DARC WAE only, not valid for ARRL awards int CQ_zone_; int ITU_zone_; @@ -86,6 +89,7 @@ QDebug operator << (QDebug dbg, entity const& e) dbg.nospace () << "entity(" << e.id_ << ", " << e.name_ << ", " + << e.abbreviated_name_ << ", " << e.WAE_only_ << ", " << e.CQ_zone_ << ", " << e.ITU_zone_ << ", " @@ -173,6 +177,30 @@ public: : configuration_ {configuration} { } + QString abbreviated_entity_name (QString const& name) const + { + auto result = name; + result.replace ("Islands", "Is."); + result.replace ("Island", "Is."); + result.replace ("North ", "N. "); + result.replace ("Northern ", "N. "); + result.replace ("South ", "S. "); + result.replace ("East ", "E. "); + result.replace ("Eastern ", "E. "); + result.replace ("West ", "W. "); + result.replace ("Western ", "W. "); + result.replace ("Central ", "C. "); + result.replace (" and ", " & "); + result.replace ("Republic", "Rep."); + result.replace ("United States of America", "U.S.A."); + result.replace ("United States", "U.S.A."); + result.replace ("Fed. Rep. of ", ""); + result.replace ("French ", "Fr."); + result.replace ("Asiatic", "AS"); + result.replace ("European", "EU"); + result.replace ("African", "AF"); + return result; + } QString get_cty_path(const Configuration *configuration); void load_cty(QFile &file); @@ -203,6 +231,7 @@ public: result.CQ_zone = e.CQ_zone_; result.ITU_zone = e.ITU_zone_; result.entity_name = e.name_; + result.abbreviated_entity_name = e.abbreviated_name_; result.WAE_only = e.WAE_only_; result.latitude = e.lat_; result.longtitude = e.long_; @@ -333,11 +362,8 @@ char const * AD1CCty::continent (Continent c) QString AD1CCty::impl::get_cty_path(Configuration const * configuration) { - QDir dataPath {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}; - auto path = dataPath.exists (file_name) - ? dataPath.absoluteFilePath (file_name) // user override - : configuration->data_dir ().absoluteFilePath (file_name); // or original - return path; + return writable_override_or_installed_file_path (configuration->writeable_data_dir (), + configuration->data_dir (), file_name); } void AD1CCty::impl::load_cty(QFile &file) @@ -369,7 +395,7 @@ void AD1CCty::impl::load_cty(QFile &file) WAE_only = true; } bool ok1, ok2, ok3, ok4, ok5; - entities_.emplace(++entity_id, entity_parts[0].trimmed(), WAE_only, entity_parts[1].trimmed().toInt(&ok1), + entities_.emplace(++entity_id, entity_parts[0].trimmed(), abbreviated_entity_name(entity_parts[0].trimmed()),WAE_only, entity_parts[1].trimmed().toInt(&ok1), entity_parts[2].trimmed().toInt(&ok2), continent(entity_parts[3].trimmed()), entity_parts[4].trimmed().toFloat(&ok3), entity_parts[5].trimmed().toFloat(&ok4), static_cast (entity_parts[6].trimmed().toFloat(&ok5) * 60 * 60), primary_prefix); @@ -423,14 +449,10 @@ AD1CCty::AD1CCty (Configuration const * configuration) } } - QDir dataPath {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}; - m_->path_ = dataPath.exists (file_name) - ? dataPath.absoluteFilePath (file_name) // user override - : configuration->data_dir ().absoluteFilePath (file_name); // or original + m_->path_ = m_->impl::get_cty_path (configuration); - QString path = dataPath.exists (grid_file_name) - ? dataPath.absoluteFilePath (grid_file_name) // user override - : configuration->data_dir ().absoluteFilePath (grid_file_name); // or original in the resources FS + QString path = writable_override_or_installed_file_path (configuration->writeable_data_dir (), + configuration->data_dir (), grid_file_name); QFile file1 {path}; diff --git a/logbook/AD1CCty.hpp b/logbook/AD1CCty.hpp index 1f031b99..4afb7d9b 100644 --- a/logbook/AD1CCty.hpp +++ b/logbook/AD1CCty.hpp @@ -34,6 +34,7 @@ public: int CQ_zone; int ITU_zone; QString entity_name; + QString abbreviated_entity_name; bool WAE_only; float latitude; float longtitude; diff --git a/logbook/AdifQso.cpp b/logbook/AdifQso.cpp new file mode 100644 index 00000000..c85a869e --- /dev/null +++ b/logbook/AdifQso.cpp @@ -0,0 +1,143 @@ +#include "logbook/AdifQso.hpp" + +#include +#include + +QByteArray AdifQso::to_adif (QString const& hisCall, QString const& hisGrid, QString const& mode, + QString const& rptSent, QString const& rptRcvd, QDateTime const& dateTimeOn, + QDateTime const& dateTimeOff, QString const& band, QString const& comments, + QString const& name, QString const& strDialFreq, QString const& myCall, + QString const& myGrid, QString const& txPower, QString const& operator_call, + QString const& xSent, QString const& xRcvd, QString const& propmode, + QString const& satellite, QString const& satmode, QString const& freqRx, + Contest contest) +{ + QString t; + + auto to_adi_text = [] (QString value) + { + for (auto& ch : value) + { + if (ch == QChar {'<'} || ch == QChar {'>'}) + { + ch = QChar {}; + } + else if (ch < QChar {' '} || ch > QChar {'~'}) + { + ch = QChar {'?'}; + } + } + return value.remove (QChar {}); + }; + + auto append_field = [&t, &to_adi_text] (QString const& fieldName, QString const& value) + { + auto const adiValue = to_adi_text (value); + if (!t.isEmpty ()) t += ' '; + t += '<' + fieldName + ':' + QString::number (adiValue.size ()) + '>' + adiValue; + }; + // Optional fields are omitted entirely when empty. + auto append_optional = [&] (QString const& fieldName, QString const& value) + { + if (value.size ()) append_field (fieldName, value); + }; + append_field ("call", hisCall); + append_field ("gridsquare", hisGrid); // emitted even when empty for consistency + if (mode != "FT4" && mode != "FST4" && mode != "Q65") + { + append_field ("mode", mode); + } + else + { + append_field ("mode", "MFSK"); + append_field ("submode", mode); + } + append_field ("rst_sent", rptSent); + append_field ("rst_rcvd", rptRcvd); + append_field ("qso_date", dateTimeOn.date ().toString ("yyyyMMdd")); + append_field ("time_on", dateTimeOn.time ().toString ("hhmmss")); + append_field ("qso_date_off", dateTimeOff.date ().toString ("yyyyMMdd")); + append_field ("time_off", dateTimeOff.time ().toString ("hhmmss")); + append_field ("band", band); + append_field ("freq", strDialFreq); + append_field ("station_callsign", myCall); + append_optional ("my_gridsquare", myGrid); + append_optional ("tx_pwr", txPower); + append_optional ("comment", comments); + append_optional ("name", name); + append_optional ("operator", operator_call); + append_optional ("prop_mode", propmode); + append_optional ("sat_name", satellite); + append_optional ("sat_mode", satmode); + append_optional ("freq_rx", freqRx); + if (xSent.size ()) + { + auto words = xSent.split (' ' +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + , QString::SkipEmptyParts +#else + , Qt::SkipEmptyParts +#endif + ); + if (words.size () > 1) + { + // Supported contest exchanges are either two tokens, or EU VHF's + // report+serial token followed by a locator. + if (words.size () == 2 && words.back ().toUInt ()) + { + append_field ("stx", words.back ()); // last word is a positive serial + } + else if (words.size () == 2 && words.front ().toUInt () && words.front ().size () > 3) // EU VHF contest mode + { + append_field ("stx", words.front ().mid (2)); // first word is report+serial + } + else + { + // non-serial exchange (e.g. Field Day class+section) kept verbatim + append_field ("STX_STRING", xSent); + } + } + } + if (xRcvd.size ()) + { + auto words = xRcvd.split (' ' +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + , QString::SkipEmptyParts +#else + , Qt::SkipEmptyParts +#endif + ); + if (words.size () > 1) + { + // Supported contest exchanges are either two tokens, or EU VHF's + // report+serial token followed by a locator. + if (words.size () == 2 && words.back ().toUInt ()) + { + append_field ("srx", words.back ()); // last word is a positive serial + } + else if (words.size () == 2 && words.front ().toUInt () && words.front ().size () > 3) // EU VHF contest exchange + { + append_field ("srx", words.front ().mid (2)); // strip report, keep serial + } + else if (words.size () == 2 && Contest::FieldDay == contest) + { + // include DX as an ARRL_SECT value even though it is not in the + // ADIF spec ARRL_SECT enumeration, done because N1MM does the same + append_field ("contest_id", "ARRL-FIELD-DAY"); + append_field ("SRX_STRING", xRcvd); + append_field ("class", words.front ()); + append_field ("arrl_sect", words.back ()); + } + else if (words.size () == 2 && Contest::Rtty == contest) + { + append_field ("state", words.back ()); + } + else + { + // non-serial exchange with no special handling kept verbatim + append_field ("SRX_STRING", xRcvd); + } + } + } + return t.toLatin1 (); +} diff --git a/logbook/AdifQso.hpp b/logbook/AdifQso.hpp new file mode 100644 index 00000000..8868b2b7 --- /dev/null +++ b/logbook/AdifQso.hpp @@ -0,0 +1,29 @@ +#ifndef WSJTX_LOGBOOK_ADIFQSO_HPP +#define WSJTX_LOGBOOK_ADIFQSO_HPP + +#include +#include + +class QDateTime; + +namespace AdifQso +{ + //! Contest-exchange handling required by the ADIF formatter. + enum class Contest { None, FieldDay, Rtty }; + + //! Format a single QSO as an ADIF (.adi) record. + //! + //! The returned record has no terminator; callers append their own. + //! Values are converted to printable ADI text and stripped of '<'/'>' + //! before field lengths are calculated. + QByteArray to_adif (QString const& hisCall, QString const& hisGrid, QString const& mode, + QString const& rptSent, QString const& rptRcvd, QDateTime const& dateTimeOn, + QDateTime const& dateTimeOff, QString const& band, QString const& comments, + QString const& name, QString const& strDialFreq, QString const& myCall, + QString const& myGrid, QString const& txPower, QString const& operator_call, + QString const& xSent, QString const& xRcvd, QString const& propmode, + QString const& satellite, QString const& satmode, QString const& freqRx, + Contest contest); +} + +#endif // WSJTX_LOGBOOK_ADIFQSO_HPP diff --git a/logbook/WorkedBefore.cpp b/logbook/WorkedBefore.cpp index 7255ee4a..c2570f0b 100644 --- a/logbook/WorkedBefore.cpp +++ b/logbook/WorkedBefore.cpp @@ -15,16 +15,18 @@ #include #include #include -#include #include #include #include #include #include +#include #include "Configuration.hpp" +#include "PerformanceTrace.hpp" #include "revision_utils.hpp" #include "Logger.hpp" #include "qt_helpers.hpp" +#include "WorkedBeforeLoadState.hpp" #include "pimpl_impl.hpp" #include "moc_WorkedBefore.cpp" @@ -279,8 +281,10 @@ namespace return QString {}; } - worked_before_database_type loader (QString const& path, AD1CCty const * prefixes) + worked_before_database_type loader (QString const& path, AD1CCty const * prefixes, + PerformanceTrace::RunId run) { + PerformanceTrace::Phase parse {run, "logbook.parse"}; worked_before_database_type worked; QFile inputFile {path}; if (inputFile.exists ()) @@ -359,6 +363,7 @@ namespace throw LoaderException (std::runtime_error {QCoreApplication::translate ("WorkedBefore", "Error opening ADIF log file for read: %0").arg (inputFile.errorString ()).toLocal8Bit ()}); } } + parse.finish (QString {"unique_entries=%1"}.arg (worked.size ())); return worked; } } @@ -367,50 +372,82 @@ class WorkedBefore::impl final { public: impl (Configuration const * configuration) - : configuration_ {configuration} - , path_ {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath (logFileName)} + : construction_trace_ {"logbook.construct"} + , configuration_ {configuration} + , path_ {writable_file_path (configuration->writeable_data_dir (), logFileName)} , prefixes_ {configuration} { + construction_trace_.finish (); } - void reload () + void start_loader () { - prefixes_.reload (configuration_); - async_loader_ = QtConcurrent::run (loader, path_, &prefixes_); + loader_run_ = PerformanceTrace::current_run (); + { + PerformanceTrace::Phase prefixes_reload {loader_run_, "logbook.prefixes_reload"}; + prefixes_.reload (configuration_); + } + PerformanceTrace::milestone (loader_run_, "logbook.load_started"); + async_loader_ = QtConcurrent::run (loader, path_, &prefixes_, loader_run_); loader_watcher_.setFuture (async_loader_); } + void reload () + { + if (WorkedBeforeLoadState::ReloadResult::Start == load_state_.request_reload ()) + { + start_loader (); + } + } + + PerformanceTrace::Phase construction_trace_; Configuration const * configuration_; QString path_; AD1CCty prefixes_; QFutureWatcher loader_watcher_; QFuture async_loader_; worked_before_database_type worked_; + WorkedBeforeLoadState load_state_; + PerformanceTrace::RunId loader_run_ {0}; }; WorkedBefore::WorkedBefore (Configuration const * configuration) : m_ {configuration} { Q_ASSERT (configuration); - connect (&m_->loader_watcher_, &QFutureWatcher::finished, [this] () { - QString error; - size_t n {0}; - try - { - m_->worked_ = m_->loader_watcher_.result (); - n = m_->worked_.size (); - } - catch (LoaderException const& e) - { - error = e.error (); - } - QString cty_ver = m_->prefixes_.version(); - LOG_DEBUG(QString{"WorkedBefore::reload: CTY.DAT version %1"}.arg (cty_ver)); - Q_EMIT finished_loading (n, cty_ver, error); - }); + connect (&m_->loader_watcher_, &QFutureWatcher::finished, + this, &WorkedBefore::handle_loader_finished); reload (); } +void WorkedBefore::handle_loader_finished () +{ + m_->load_state_.begin_completion (); + QString error; + size_t n {0}; + try + { + m_->worked_ = m_->loader_watcher_.result (); + n = m_->worked_.size (); + } + catch (LoaderException const& e) + { + error = e.error (); + } + QString cty_ver = m_->prefixes_.version(); + LOG_DEBUG(QString{"WorkedBefore::reload: CTY.DAT version %1"}.arg (cty_ver)); + QPointer guard {this}; + Q_EMIT finished_loading (n, cty_ver, error); + if (!guard) + { + return; + } + if (WorkedBeforeLoadState::CompletionResult::Restart == m_->load_state_.finish_completion ()) + { + m_->start_loader (); + } +} + QString WorkedBefore::cty_version () const { return m_->prefixes_.version (); @@ -423,6 +460,8 @@ void WorkedBefore::reload () WorkedBefore::~WorkedBefore () { + PerformanceTrace::Phase shutdown_wait {"logbook.shutdown_wait"}; + m_->async_loader_.waitForFinished (); } QString const& WorkedBefore::path () const @@ -445,8 +484,11 @@ bool WorkedBefore::add (QString const& call { auto const& entity = m_->prefixes_.lookup (call); QFile file {m_->path_}; + ensure_parent_directory (file.fileName ()); if (!file.open(QIODevice::Text | QIODevice::Append)) { + LOG_ERROR ("Error opening ADIF log file for append: " << file.fileName () + << " - " << file.errorString ()); return false; } else diff --git a/logbook/WorkedBefore.hpp b/logbook/WorkedBefore.hpp index 0be9d783..ae9cb443 100644 --- a/logbook/WorkedBefore.hpp +++ b/logbook/WorkedBefore.hpp @@ -41,6 +41,8 @@ public: Q_SIGNAL void finished_loading (int worked_before_record_count, QString const, QString const& error) const; private: + Q_SLOT void handle_loader_finished (); + class impl; pimpl m_; }; diff --git a/logbook/WorkedBeforeLoadState.hpp b/logbook/WorkedBeforeLoadState.hpp new file mode 100644 index 00000000..02578cd2 --- /dev/null +++ b/logbook/WorkedBeforeLoadState.hpp @@ -0,0 +1,70 @@ +#ifndef WORKED_BEFORE_LOAD_STATE_HPP +#define WORKED_BEFORE_LOAD_STATE_HPP + +#include + +class WorkedBeforeLoadState final +{ +public: + enum class ReloadResult + { + Start, + Coalesced + }; + + enum class CompletionResult + { + Idle, + Restart + }; + + ReloadResult request_reload () + { + if (Phase::Idle == phase_) + { + phase_ = Phase::Loading; + return ReloadResult::Start; + } + + reload_pending_ = true; + return ReloadResult::Coalesced; + } + + void begin_completion () + { + Q_ASSERT (Phase::Loading == phase_); + phase_ = Phase::Completing; + } + + CompletionResult finish_completion () + { + Q_ASSERT (Phase::Completing == phase_); + if (reload_pending_) + { + reload_pending_ = false; + phase_ = Phase::Loading; + return CompletionResult::Restart; + } + + phase_ = Phase::Idle; + return CompletionResult::Idle; + } + + bool active () const + { + return Phase::Idle != phase_; + } + +private: + enum class Phase + { + Idle, + Loading, + Completing + }; + + Phase phase_ {Phase::Idle}; + bool reload_pending_ {false}; +}; + +#endif // WORKED_BEFORE_LOAD_STATE_HPP diff --git a/logbook/logbook.cpp b/logbook/logbook.cpp index e1c0da30..e80930cf 100644 --- a/logbook/logbook.cpp +++ b/logbook/logbook.cpp @@ -7,6 +7,7 @@ #include "logbook/AD1CCty.hpp" #include "models/CabrilloLog.hpp" #include "models/FoxLog.hpp" +#include "logbook/AdifQso.hpp" #include "moc_logbook.cpp" @@ -32,6 +33,15 @@ void LogBook::match (QString const& call, QString const& mode, QString const& gr bool& ITUZoneB4, QString const& band) const { + // Default every flag so callers reading them after an empty call see defined + // values: "not worked" for call/grid, and "do not flag" for entity-derived + // categories (mirroring the unknown-entity policy below). + callB4 = false; + gridB4 = false; + countryB4 = true; + continentB4 = true; + CQZoneB4 = true; + ITUZoneB4 = true; if (call.size() > 0) { auto const& mode_to_check = (config_ && !config_->highlight_by_mode ()) ? QString {} : mode; @@ -82,103 +92,22 @@ QByteArray LogBook::QSOToADIF (QString const& hisCall, QString const& hisGrid, Q QString const& xSent, QString const& xRcvd, QString const& propmode, QString const& satellite, QString const& satmode, QString const& freqRx) { - QString t; - t = "" + hisCall; - t += " " + hisGrid; - if (mode != "FT4" && mode != "FST4" && mode != "Q65") + Q_ASSERT (config_); + auto contest = AdifQso::Contest::None; + switch (config_->special_op_id ()) { - t += " " + mode; + case Configuration::SpecialOperatingActivity::FIELD_DAY: + contest = AdifQso::Contest::FieldDay; + break; + case Configuration::SpecialOperatingActivity::RTTY: + contest = AdifQso::Contest::Rtty; + break; + default: + break; } - else - { - t += " MFSK " + mode; - } - t += " " + rptSent; - t += " " + rptRcvd; - t += " " + dateTimeOn.date().toString("yyyyMMdd"); - t += " " + dateTimeOn.time().toString("hhmmss"); - t += " " + dateTimeOff.date().toString("yyyyMMdd"); - t += " " + dateTimeOff.time().toString("hhmmss"); - t += " " + band; - t += " " + strDialFreq; - t += " " + myCall; - if(myGrid!="") t += " " + myGrid; - if(txPower!="") t += " " + txPower; - if(comments!="") t += " " + comments; - if(name!="") t += " " + name; - if(operator_call!="") t+=" " + operator_call; - if(propmode!="") t += " " + propmode; - if(satellite!="") t += " " + satellite; - if(satmode!="") t += " " + satmode; - if(freqRx!="") t += " " + freqRx; - if (xSent.size ()) - { - auto words = xSent.split (' ' -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) - , QString::SkipEmptyParts -#else - , Qt::SkipEmptyParts -#endif - ); - if (words.size () > 1) - { - if (words.back ().toUInt ()) - { - // assume last word is a serial if there are at least - // two words and if it is positive numeric - t += " ' + words.back (); - } - else - { - if (words.front ().toUInt () && words.front ().size () > 3) // EU VHF contest mode - { - auto sn_text = words.front ().mid (2); - // assume first word is report+serial if there are - // at least two words and if the first word less the - // first two characters is a positive numeric - t += " ' + sn_text; - } - } - } - } - if (xRcvd.size ()) { - auto words = xRcvd.split (' ' -#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) - , QString::SkipEmptyParts -#else - , Qt::SkipEmptyParts -#endif - ); - if (words.size () == 2) - { - if (words.at (1).toUInt ()) - { - t += " " + words.at (1); - } - else if (words.at (0).toUInt () && words.at (0).size () > 3) // EU VHF contest exchange - { - // strip report and set SRX to serial - t += " " + words.at (0).mid (2); - } - else - { - if (Configuration::SpecialOperatingActivity::FIELD_DAY == config_->special_op_id ()) - { - // include DX as an ARRL_SECT value even though it is - // not in the ADIF spec ARRL_SECT enumeration, done - // because N1MM does the same - t += " ARRL-FIELD-DAY ' + xRcvd - + " ' - + words.at (0) + " ' + words.at (1); - } - else if (Configuration::SpecialOperatingActivity::RTTY == config_->special_op_id ()) - { - t += " " + words.at (1); - } - } - } - } - return t.toLatin1(); + return AdifQso::to_adif (hisCall, hisGrid, mode, rptSent, rptRcvd, dateTimeOn, dateTimeOff, + band, comments, name, strDialFreq, myCall, myGrid, txPower, operator_call, + xSent, xRcvd, propmode, satellite, satmode, freqRx, contest); } CabrilloLog * LogBook::contest_log () diff --git a/logbook/logbook.pri b/logbook/logbook.pri deleted file mode 100644 index e67cdebd..00000000 --- a/logbook/logbook.pri +++ /dev/null @@ -1,13 +0,0 @@ -SOURCES += \ - logbook/countriesworked.cpp \ - logbook/logbook.cpp \ - logbook/AD1CCty.cpp \ - logbook/WorkedBefore.cpp \ - logbook/Multiplier.cpp - -HEADERS += \ - logbook/WorkedBefore.hpp \ - logbook/logbook.h \ - logbook/countriesworked.h \ - logbook/AD1CCty.hpp \ - logbook/Multiplier.hpp diff --git a/main.cpp b/main.cpp index 01aaf28e..ebd1221e 100644 --- a/main.cpp +++ b/main.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -6,6 +7,7 @@ #include #include #include +#include #include #include @@ -15,18 +17,23 @@ #include #include #include +#include #include #include #include #include #include #include +#include +#include #include #include +#include #include #include #include #include +#include #include #include #include @@ -34,9 +41,13 @@ #include #include #include +#include +#include +#include #include "ExceptionCatchingApplication.hpp" #include "Logger.hpp" +#include "PerformanceTrace.hpp" #include "revision_utils.hpp" #include "MetaDataRegistry.hpp" #include "qt_helpers.hpp" @@ -46,7 +57,20 @@ #include "WSJTXLogging.hpp" #include "MultiSettings.hpp" #include "widgets/mainwindow.h" +#include "Audio/AudioInputSource.hpp" +#include "Audio/soundout.h" +#ifdef WSJT_ENABLE_LIVE_AUDIO_TEST +#include "Audio/BWFFile.hpp" +#include "Audio/FixtureAudioInput.hpp" +#include "Audio/FixtureSoundOutput.hpp" +#include "Ft8TxLoopbackTestController.hpp" +#include "JttyTxLoopbackTestController.hpp" +#include "LiveAudioTestController.hpp" +#include "ReceiveHandoffTestController.hpp" +#include +#endif #include "commons.h" +#include "DecoderIpc.hpp" #include "lib/init_random_seed.h" #include "Radio.hpp" #include "models/FrequencyList.hpp" @@ -56,6 +80,7 @@ extern "C" { // Fortran procedures we need void four2a_(_Complex float *, int * nfft, int * ndim, int * isign, int * iform, int len); + void jtty_release_fft_resources(); } namespace @@ -101,10 +126,156 @@ namespace os << v.toString (); } } + + QString lock_file_details (QLockFile const& lock, QString const& path) + { + QStringList details {QCoreApplication::translate ("main", "Lock file: %1").arg (QDir::toNativeSeparators (path))}; + qint64 pid; + QString hostname; + QString appname; + if (lock.getLockInfo (&pid, &hostname, &appname)) + { + details << QCoreApplication::translate ("main", "Owner process: %1").arg (pid); + if (!appname.isEmpty ()) + { + details << QCoreApplication::translate ("main", "Owner application: %1").arg (appname); + } + if (!hostname.isEmpty ()) + { + details << QCoreApplication::translate ("main", "Owner host: %1").arg (hostname); + } + } + else + { + details << QCoreApplication::translate ("main", "Owner information is not available."); + } + return details.join ('\n'); + } + + QString diagnostic_text (QString text) + { + return text.replace ('\\', "\\\\") + .replace ('\n', "\\n") + .replace ('\r', "\\r") + .replace ('\t', "\\t") + .replace ('"', "\\\""); + } + + char const * window_modality_name (Qt::WindowModality modality) + { + switch (modality) + { + case Qt::NonModal: return "NonModal"; + case Qt::WindowModal: return "WindowModal"; + case Qt::ApplicationModal: return "ApplicationModal"; + } + return "Unknown"; + } + + void report_unexpected_modal (QWidget const& modal) + { + std::cerr << "WSJT-X startup smoke: unexpected modal window:" + << " class=" << modal.metaObject ()->className () + << " objectName=\"" << diagnostic_text (modal.objectName ()).toStdString () << '"' + << " title=\"" << diagnostic_text (modal.windowTitle ()).toStdString () << '"' + << " visible=" << (modal.isVisible () ? "true" : "false") + << " modal=" << (modal.isModal () ? "true" : "false") + << " modality=" << window_modality_name (modal.windowModality ()); + + if (auto const *message_box = qobject_cast (&modal)) + { + std::cerr << " text=\"" << diagnostic_text (message_box->text ()).toStdString () << '"' + << " informativeText=\"" + << diagnostic_text (message_box->informativeText ()).toStdString () << '"'; + } + if (auto const *progress_dialog = qobject_cast (&modal)) + { + std::cerr << " labelText=\"" + << diagnostic_text (progress_dialog->labelText ()).toStdString () << '"'; + } + std::cerr << std::endl; + } + + enum class LockFileAction + { + RemoveLockFile, + Retry, + Stop + }; + + struct LockFileRemovalResult + { + bool removed; + QString error; + }; + + LockFileRemovalResult remove_stale_lock_file (QLockFile& lock, QString const& path) + { + if (lock.removeStaleLockFile ()) + { + return {true, QString {}}; + } + + QFile lock_file {path}; + if (!lock_file.exists ()) + { + return {true, QString {}}; + } + if (lock_file.remove ()) + { + return {true, QString {}}; + } + return {false, QCoreApplication::translate ("main", "Remove error: %1").arg (lock_file.errorString ())}; + } + + LockFileAction query_lock_file_recovery (QLockFile const& lock, QString const& path) + { + MessageBox message_box {MessageBox::Question + , QCoreApplication::translate ("main", "Another instance may be running") + , MessageBox::NoButton}; + message_box.setInformativeText (QCoreApplication::translate ("main", "WSJT-X could not lock its temporary instance file. " + "\n\nIf another WSJT-X window is still running, choose No. " + "\nUse a unique rig name to run more than one instance. " + "\n\nIf WSJT-X crashed or will not restart, choose Remove Lock File. " + "\nChoose Retry after closing the other instance.")); + message_box.setDetailedText (lock_file_details (lock, path)); + + auto remove_button = message_box.addButton (QCoreApplication::translate ("main", "Remove Lock File"), MessageBox::ActionRole); + auto retry_button = message_box.addButton (MessageBox::Retry); + auto no_button = message_box.addButton (MessageBox::No); + message_box.setDefaultButton (retry_button); + message_box.setEscapeButton (no_button); + + if (message_box.exec () == -1) + { + return LockFileAction::Stop; + } + auto clicked_button = message_box.clickedButton (); + if (remove_button == clicked_button) + { + return LockFileAction::RemoveLockFile; + } + if (retry_button == clicked_button) + { + return LockFileAction::Retry; + } + return LockFileAction::Stop; + } + + bool test_mode_requested (int argc, char * argv[]) + { + for (int i = 1; i < argc; ++i) + { + if (QByteArray {argv[i]} == QByteArrayLiteral ("--test-mode")) return true; + } + return false; + } } int main(int argc, char *argv[]) { + PerformanceTrace::begin_run ("startup", "initial"); + PerformanceTrace::Phase process_bootstrap {"process.bootstrap"}; init_random_seed (); // make the Qt type magic happen @@ -114,13 +285,21 @@ int main(int argc, char *argv[]) // Multiple instances communicate with jt9 via this QSharedMemory mem_jt9; - // Read optional file to disable highDPI scaling - QFile f("DisableHighDpiScaling"); - if (!f.exists()) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + if (test_mode_requested (argc, argv)) QStandardPaths::setTestModeEnabled (true); + QApplication::setAttribute (Qt::AA_EnableHighDpiScaling); auto const env = QProcessEnvironment::systemEnvironment (); ExceptionCatchingApplication a(argc, argv); + bool startup_smoke_test {false}; + bool automated_test {false}; +#ifdef WSJT_ENABLE_LIVE_AUDIO_TEST + bool live_audio_test {false}; + bool jtty_live_audio_test {false}; + bool jtty_tx_loopback_test {false}; + bool ft8_tx_loopback_test {false}; + bool receive_handoff_test {false}; +#endif try { // LOG_INfO ("+++++++++++++++++++++++++++ Resources ++++++++++++++++++++++++++++"); @@ -153,6 +332,16 @@ int main(int argc, char *argv[]) , "rig-name"); parser.addOption (rig_option); + QCommandLineOption n1mm_tcp_port_option (QStringList {} << "p" << "n1mm-tcp-port" << "n1mm_tcp_port" + , "N1MM Logger+ TCP port number." + , "TCP port"); + parser.addOption (n1mm_tcp_port_option); + + QCommandLineOption mode_option (QStringList {} << "mode" + , "Startup mode (ft8, ft4, jtty)." + , "mode"); + parser.addOption (mode_option); + // support for start up configuration QCommandLineOption cfg_option (QStringList {} << "c" << "config" , "Where is an existing one." @@ -169,6 +358,46 @@ int main(int argc, char *argv[]) , "Writable files in test location. Use with caution, for testing only."); parser.addOption (test_option); + QCommandLineOption startup_smoke_test_option ( + QStringList {} << "startup-smoke-test", + "Start the application, process initial GUI events, and exit."); + parser.addOption (startup_smoke_test_option); + +#ifdef WSJT_ENABLE_LIVE_AUDIO_TEST + QCommandLineOption live_audio_test_option ( + QStringList {} << "live-audio-test", + "Feed a WAV fixture through the live receive path.", "wav-path"); + parser.addOption (live_audio_test_option); + QCommandLineOption live_audio_expected_option ( + QStringList {} << "live-audio-expected", + "Expected decoder output used by --live-audio-test.", "expected-path"); + parser.addOption (live_audio_expected_option); + QCommandLineOption live_audio_data_dir_option ( + QStringList {} << "live-audio-data-dir", + "Shipped decoder data used by --live-audio-test.", "directory"); + parser.addOption (live_audio_data_dir_option); + QCommandLineOption jtty_live_audio_test_option ( + QStringList {} << "jtty-live-audio-test", + "Feed a WAV fixture through the live JTTY receive path.", "wav-path"); + parser.addOption (jtty_live_audio_test_option); + QCommandLineOption jtty_live_audio_expected_option ( + QStringList {} << "jtty-live-audio-expected", + "Expected message used by --jtty-live-audio-test.", "text-path"); + parser.addOption (jtty_live_audio_expected_option); + QCommandLineOption jtty_tx_loopback_test_option ( + QStringList {} << "jtty-tx-loopback-test", + "Capture two gaplessly queued JTTY messages to a WAV file.", "wav-path"); + parser.addOption (jtty_tx_loopback_test_option); + QCommandLineOption ft8_tx_loopback_test_option ( + QStringList {} << "ft8-tx-loopback-test", + "Capture one period-aligned FT8 transmission to a WAV file.", "wav-path"); + parser.addOption (ft8_tx_loopback_test_option); + QCommandLineOption receive_handoff_test_option ( + QStringList {} << "receive-handoff-test", + "Backlog two synthetic periods at the MainWindow receive boundary."); + parser.addOption (receive_handoff_test_option); +#endif + if (!parser.parse (a.arguments ())) { MessageBox::critical_message (nullptr, "Command line error", parser.errorText ()); @@ -188,11 +417,68 @@ int main(int argc, char *argv[]) } } - QStandardPaths::setTestModeEnabled (parser.isSet (test_option)); + startup_smoke_test = parser.isSet (startup_smoke_test_option); +#ifdef WSJT_ENABLE_LIVE_AUDIO_TEST + live_audio_test = parser.isSet (live_audio_test_option); + jtty_live_audio_test = parser.isSet (jtty_live_audio_test_option); + jtty_tx_loopback_test = parser.isSet (jtty_tx_loopback_test_option); + ft8_tx_loopback_test = parser.isSet (ft8_tx_loopback_test_option); + receive_handoff_test = parser.isSet (receive_handoff_test_option); + if (live_audio_test != parser.isSet (live_audio_expected_option) + || live_audio_test != parser.isSet (live_audio_data_dir_option)) + { + std::cerr << "--live-audio-test, --live-audio-expected, and " + "--live-audio-data-dir must be used together" + << std::endl; + return EXIT_FAILURE; + } + if (jtty_live_audio_test != parser.isSet (jtty_live_audio_expected_option)) + { + std::cerr << "--jtty-live-audio-test and --jtty-live-audio-expected " + "must be used together" << std::endl; + return EXIT_FAILURE; + } + if ((startup_smoke_test ? 1 : 0) + (live_audio_test ? 1 : 0) + + (jtty_live_audio_test ? 1 : 0) + + (jtty_tx_loopback_test ? 1 : 0) + + (ft8_tx_loopback_test ? 1 : 0) + + (receive_handoff_test ? 1 : 0) > 1) + { + std::cerr << "Startup, live-audio, and TX loopback tests are mutually exclusive" + << std::endl; + return EXIT_FAILURE; + } + if (live_audio_test) + { + QDir const decoderDataDir {parser.value (live_audio_data_dir_option)}; + QFileInfo const allCallsigns { + decoderDataDir.absoluteFilePath ("ALLCALL7.TXT")}; + if (!allCallsigns.isFile () || !allCallsigns.isReadable ()) + { + std::cerr << "--live-audio-data-dir does not contain a readable " + "ALLCALL7.TXT" + << std::endl; + return EXIT_FAILURE; + } + } + automated_test = startup_smoke_test || live_audio_test + || jtty_live_audio_test || jtty_tx_loopback_test || ft8_tx_loopback_test + || receive_handoff_test; +#else + automated_test = startup_smoke_test; +#endif + auto const smoke_phase = [startup_smoke_test] (char const *phase) { + if (startup_smoke_test) + { + std::cerr << "WSJT-X startup smoke: " << phase << std::endl; + } + }; + smoke_phase ("command line accepted"); + QStandardPaths::setTestModeEnabled (parser.isSet (test_option) || automated_test); // support for multiple instances running from a single installation bool multiple {false}; - if (parser.isSet (rig_option) || parser.isSet (test_option)) + if (parser.isSet (rig_option) || parser.isSet (test_option) || automated_test) { auto temp_name = parser.value (rig_option); if (!temp_name.isEmpty ()) @@ -206,7 +492,7 @@ int main(int argc, char *argv[]) a.setApplicationName (a.applicationName () + " - " + temp_name); } - if (parser.isSet (test_option)) + if (parser.isSet (test_option) || automated_test) { a.setApplicationName (a.applicationName () + " - test"); } @@ -217,6 +503,9 @@ int main(int argc, char *argv[]) // now we have the application name we can open the logging and settings WSJTXLogging lg; LOG_INFO (program_title (revision ()) << " - Program startup"); + process_bootstrap.finish (); + PerformanceTrace::milestone ("logging.ready"); + PerformanceTrace::Phase process_prepare {"process.prepare"}; MultiSettings multi_settings {parser.value (cfg_option)}; // find the temporary files path @@ -224,28 +513,38 @@ int main(int argc, char *argv[]) Q_ASSERT (temp_dir.exists ()); // sanity check // disallow multiple instances with same instance key - QLockFile instance_lock {temp_dir.absoluteFilePath (a.applicationName () + ".lock")}; + auto const instance_lock_path = temp_dir.absoluteFilePath (a.applicationName () + ".lock"); + QLockFile instance_lock {instance_lock_path}; instance_lock.setStaleLockTime (0); while (!instance_lock.tryLock ()) { if (QLockFile::LockFailedError == instance_lock.error ()) { - auto button = MessageBox::query_message (nullptr - , "Another instance may be running" - , "try to remove stale lock file?" - , QString {} - , MessageBox::Yes | MessageBox::Retry | MessageBox::No - , MessageBox::Yes); - switch (button) + switch (query_lock_file_recovery (instance_lock, instance_lock_path)) { - case MessageBox::Yes: - instance_lock.removeStaleLockFile (); + case LockFileAction::RemoveLockFile: + { + auto const removal = remove_stale_lock_file (instance_lock, instance_lock_path); + if (!removal.removed) + { + auto details = lock_file_details (instance_lock, instance_lock_path); + if (!removal.error.isEmpty ()) + { + details += '\n'; + details += removal.error; + } + MessageBox::warning_message (nullptr + , a.translate ("main", "Unable to remove stale lock file") + , a.translate ("main", "Close any running WSJT-X instance or remove the lock file manually after confirming WSJT-X is not running.") + , details); + } + } break; - case MessageBox::Retry: + case LockFileAction::Retry: break; - default: + case LockFileAction::Stop: throw std::runtime_error {"Multiple instances must have unique rig names"}; } } @@ -293,7 +592,14 @@ int main(int argc, char *argv[]) // for a new version, the user will be able to re-disable it // if they wish QString splash_flag_name {"Splash_v1.7"}; - if (multi_settings.common_value (splash_flag_name, true).toBool ()) +#if defined(WSJT_TSAN_TEST_PROFILE) + // GCC TSan cannot track Qt's instrumented SVG setjmp/longjmp rasterizer. + auto const skip_splash = automated_test; +#else + auto const skip_splash = false; +#endif + if (!skip_splash + && multi_settings.common_value (splash_flag_name, true).toBool ()) { QObject::connect (&splash, &SplashScreen::disabled, [&, splash_flag_name] { multi_settings.set_common_value (splash_flag_name, false); @@ -324,17 +630,51 @@ int main(int argc, char *argv[]) { throw std::runtime_error {("Database Error: " + db.lastError ().text ()).toStdString ()}; } - + smoke_phase ("SQLite opened"); // better performance traded for a risk of d/b corruption // on system crash or application crash // db.exec ("PRAGMA synchronous=OFF"); // system crash risk // db.exec ("PRAGMA journal_mode=MEMORY"); // application crash risk db.exec ("PRAGMA locking_mode=EXCLUSIVE"); + process_prepare.finish (); int result; - auto const& original_style_sheet = a.styleSheet (); + bool startup_smoke_ready {false}; + auto const prerelease_expiration = QDateTime { + {2026, 12, 31}, {23, 59, 59, 999}, Qt::UTC}; + bool prerelease_notice_pending = + QCoreApplication::applicationVersion ().contains ("-devel") + || QCoreApplication::applicationVersion ().contains ("-rc"); + auto const original_style_sheet = a.styleSheet (); + auto const original_font = a.font (); + auto const apply_application_appearance = [&] { + auto font = original_font; + if (!font.fromString (multi_settings.settings ()->value ( + "Configuration/Font", original_font.toString ()).toString ())) + { + font = original_font; + } + + auto const dark_style = multi_settings.settings ()->value ( + "MainWindow/DarkStyle", false).toBool (); + QString dark_style_sheet; + if (dark_style) + { + QFile file {":qdarkstyle/style.qss"}; + if (file.open (QFile::ReadOnly | QFile::Text)) + { + dark_style_sheet = QTextStream {&file}.readAll (); + } + } + + auto const style_sheet = application_style_sheet ( + original_style_sheet, dark_style_sheet, dark_style, font); + if (a.font () != font) a.setFont (font); + if (a.styleSheet () != style_sheet) a.setStyleSheet (style_sheet); + }; do { + PerformanceTrace::Phase runtime_prepare {"runtime.prepare"}; // dump settings auto sys_lg = sys::get (); if (auto rec = sys_lg.open_record @@ -383,10 +723,10 @@ int main(int argc, char *argv[]) if (mem_jt9.attach ()) // shared memory presence implies // orphaned jt9 sub-process { - dec_data_t * dd = reinterpret_cast (mem_jt9.data()); - mem_jt9.lock (); - dd->ipc[1] = 999; // tell jt9 to shut down - mem_jt9.unlock (); + if (DecoderIpc::hasShutdownControlSize (mem_jt9.size ())) + { + DecoderIpc::shutdownControl (mem_jt9.data ()); + } mem_jt9.detach (); // start again } else @@ -397,25 +737,40 @@ int main(int argc, char *argv[]) } if (!mem_jt9.attach ()) { - if (!mem_jt9.create (sizeof (dec_data))) + if (!mem_jt9.create (sizeof (shared_dec_data_t))) { - splash.hide (); - MessageBox::critical_message (nullptr, a.translate ("main", "Shared memory error"), - a.translate ("main", "Unable to create shared memory segment")); + auto const shared_memory_error = mem_jt9.error (); + auto const shared_memory_error_text = mem_jt9.errorString (); + std::cerr << "WSJT-X startup: shared memory creation failed" + << " (error " << static_cast (shared_memory_error) << "): " + << shared_memory_error_text.toStdString () << std::endl; + if (!automated_test) + { + splash.hide (); + MessageBox::critical_message ( + nullptr, a.translate ("main", "Shared memory error"), + a.translate ("main", "Unable to create shared memory segment")); + } throw std::runtime_error {"Shared memory error"}; } LOG_INFO ("shmem size: " << mem_jt9.size ()); } else { - splash.hide (); - MessageBox::critical_message (nullptr, a.translate ("main", "Sub-process error"), - a.translate ("main", "Failed to close orphaned jt9 process")); + std::cerr << "WSJT-X startup: orphaned jt9 shared memory segment remained after " + "shutdown attempts" + << std::endl; + if (!automated_test) + { + splash.hide (); + MessageBox::critical_message ( + nullptr, a.translate ("main", "Sub-process error"), + a.translate ("main", "Failed to close orphaned jt9 process")); + } throw std::runtime_error {"Sub-process error"}; } - mem_jt9.lock (); - memset(mem_jt9.data(),0,sizeof(struct dec_data)); //Zero all decoding params in shared memory - mem_jt9.unlock (); + auto * shared = reinterpret_cast (mem_jt9.data ()); + DecoderIpc::initialize (*shared); unsigned downSampleFactor; { @@ -436,23 +791,247 @@ int main(int argc, char *argv[]) #endif ).toBool () ? 1u : 4u; +#ifdef WSJT_ENABLE_LIVE_AUDIO_TEST + if (live_audio_test) + { + BWFFile fixture {QAudioFormat {}, parser.value (live_audio_test_option)}; + if (fixture.open (BWFFile::ReadOnly)) + { + downSampleFactor = fixture.format ().sampleRate () == 48000 + ? 4u : 1u; + } + } + if (jtty_live_audio_test) + { + BWFFile fixture {QAudioFormat {}, + parser.value (jtty_live_audio_test_option)}; + if (fixture.open (BWFFile::ReadOnly)) + { + downSampleFactor = fixture.format ().sampleRate () == 48000 + ? 4u : 1u; + } + } + if (receive_handoff_test) downSampleFactor = 1u; +#endif + } QDir::setCurrent(qApp->applicationDirPath()); //This helps to find the SF executables + runtime_prepare.finish (); + + apply_application_appearance (); // run the application UI - MainWindow w(temp_dir, multiple, &multi_settings, &mem_jt9, downSampleFactor, &splash, env); + smoke_phase ("constructing MainWindow"); + PerformanceTrace::Phase main_window_construct {"mainwindow.construct"}; +#ifdef WSJT_ENABLE_LIVE_AUDIO_TEST + FixtureAudioInput * fixture_input {nullptr}; + FixtureSoundOutput * fixture_output {nullptr}; + std::unique_ptr audio_input; + std::unique_ptr sound_output; + if (live_audio_test || jtty_live_audio_test || receive_handoff_test) + { + std::unique_ptr fixture { + new FixtureAudioInput { + receive_handoff_test ? QString {} + : parser.value (live_audio_test + ? live_audio_test_option + : jtty_live_audio_test_option), + receive_handoff_test ? FixtureAudioInput::Profile::ReceiveHandoff + : (live_audio_test ? FixtureAudioInput::Profile::Ft8 + : FixtureAudioInput::Profile::Jtty)}}; + fixture_input = fixture.get (); + audio_input = std::move (fixture); + } + if (jtty_tx_loopback_test || ft8_tx_loopback_test) + { + std::unique_ptr fixture { + new FixtureSoundOutput { + parser.value (jtty_tx_loopback_test + ? jtty_tx_loopback_test_option + : ft8_tx_loopback_test_option), + ft8_tx_loopback_test + ? FixtureSoundOutput::Profile::Ft8Period + : FixtureSoundOutput::Profile::JttyStrict}}; + fixture_output = fixture.get (); + sound_output = std::move (fixture); + } +#else + std::unique_ptr audio_input; +#endif + MainWindow w(temp_dir, multiple, &multi_settings, &mem_jt9, downSampleFactor, &splash, env, + automated_test, original_style_sheet, std::move (audio_input), +#ifdef WSJT_ENABLE_LIVE_AUDIO_TEST + std::move (sound_output), +#else + {}, +#endif +#ifdef WSJT_ENABLE_LIVE_AUDIO_TEST + live_audio_test ? parser.value (live_audio_data_dir_option) : QString {} +#else + QString {} +#endif + ); + main_window_construct.finish (); + smoke_phase ("MainWindow constructed"); +#ifdef Q_OS_WIN + quint16 mmtty_port = 0; + if (parser.isSet(n1mm_tcp_port_option)) { + mmtty_port = parser.value(n1mm_tcp_port_option).toUShort(); + } + + if (mmtty_port > 0) { + LOG_INFO("Starting JTTY/N1MM Logger interface on port: " << mmtty_port); + w.initMMTTY(mmtty_port); + } else { + LOG_INFO("JTTY/N1MM Logger interface not enabled (no port or matching rig name provided)."); + } +#endif + if (parser.isSet(mode_option)) { + bool lock_mode = parser.isSet(n1mm_tcp_port_option); + w.set_mode_from_command_line(parser.value(mode_option), lock_mode); + } + w.show(); + PerformanceTrace::milestone ("ui.show_returned"); + smoke_phase ("MainWindow shown"); + if (prerelease_notice_pending) + { + prerelease_notice_pending = false; + QTimer::singleShot (0, &w, [&w, automated_test, prerelease_expiration] { + if (!automated_test) + { + auto const expiration_date = QLocale::c ().toString ( + prerelease_expiration.date (), "MMMM d, yyyy"); + MessageBox::critical_message ( + &w, + "This is a pre-release version of WSJT-X " + version (false) + " made\n" + "available for testing purposes. By design it will\n" + "be nonfunctional after " + expiration_date + "."); + } + if (QDateTime::currentDateTimeUtc () >= prerelease_expiration) + { + w.close (); + } + }); + } +#ifdef WSJT_ENABLE_LIVE_AUDIO_TEST + std::unique_ptr live_audio_controller; + std::unique_ptr receive_handoff_controller; + std::unique_ptr jtty_tx_controller; + std::unique_ptr ft8_tx_controller; + if (live_audio_test || jtty_live_audio_test) + { + a.setQuitOnLastWindowClosed (false); + live_audio_controller.reset (new LiveAudioTestController { + &w, fixture_input, + parser.value (live_audio_test + ? live_audio_expected_option + : jtty_live_audio_expected_option), + live_audio_test ? LiveAudioTestController::Mode::Ft8 + : LiveAudioTestController::Mode::Jtty}); + auto * controller = live_audio_controller.get (); + QTimer::singleShot (0, live_audio_controller.get (), + [controller] { + controller->begin (); + }); + } + if (receive_handoff_test) + { + a.setQuitOnLastWindowClosed (false); + receive_handoff_controller.reset (new ReceiveHandoffTestController { + &w, fixture_input}); + auto * controller = receive_handoff_controller.get (); + QTimer::singleShot (0, controller, [controller] { controller->begin (); }); + } + if (jtty_tx_loopback_test) + { + a.setQuitOnLastWindowClosed (false); + jtty_tx_controller.reset (new JttyTxLoopbackTestController { + &w, fixture_output, + parser.value (jtty_tx_loopback_test_option)}); + auto * controller = jtty_tx_controller.get (); + QTimer::singleShot (0, jtty_tx_controller.get (), + [controller] { + controller->begin (); + }); + } + if (ft8_tx_loopback_test) + { + a.setQuitOnLastWindowClosed (false); + ft8_tx_controller.reset (new Ft8TxLoopbackTestController { + &w, fixture_output, + parser.value (ft8_tx_loopback_test_option)}); + auto * controller = ft8_tx_controller.get (); + QTimer::singleShot (0, ft8_tx_controller.get (), + [controller] { + controller->begin (); + }); + } +#endif + if (startup_smoke_test) + { + QTimer::singleShot (1000, &w, [&a, &w, &smoke_phase, &startup_smoke_ready] { + smoke_phase ("event loop reached"); + if (auto *modal = QApplication::activeModalWidget ()) + { + report_unexpected_modal (*modal); + modal->close (); + w.close (); + a.exit (EXIT_FAILURE); + return; + } + if (w.close ()) + { + smoke_phase ("close accepted"); + startup_smoke_ready = true; + a.quit (); + } + else + { + std::cerr << "WSJT-X startup smoke: main window rejected close" << std::endl; + a.exit (EXIT_FAILURE); + } + }); + } splash.raise (); QObject::connect (&a, SIGNAL (lastWindowClosed()), &a, SLOT (quit())); result = a.exec(); + PerformanceTrace::milestone ("event_loop.exit"); + if (startup_smoke_test && !startup_smoke_ready) + { + std::cerr << "WSJT-X startup smoke: application exited before readiness" << std::endl; + result = EXIT_FAILURE; + } +#ifdef WSJT_ENABLE_LIVE_AUDIO_TEST + if ((live_audio_test || jtty_live_audio_test) + && (!live_audio_controller || !live_audio_controller->succeeded ())) + { + result = EXIT_FAILURE; + } + if (jtty_tx_loopback_test + && (!jtty_tx_controller || !jtty_tx_controller->succeeded ())) + { + result = EXIT_FAILURE; + } + if (ft8_tx_loopback_test + && (!ft8_tx_controller || !ft8_tx_controller->succeeded ())) + { + result = EXIT_FAILURE; + } + if (receive_handoff_test + && (!receive_handoff_controller + || !receive_handoff_controller->succeeded ())) + { + result = EXIT_FAILURE; + } +#endif - // ensure config switches start with the right style sheet - a.setStyleSheet (original_style_sheet); } - while (!result && !multi_settings.exit ()); + while (!multi_settings.exit () && !result && !automated_test); // clean up lazily initialized resources + jtty_release_fft_resources (); { int nfft {-1}; int ndim {1}; @@ -465,16 +1044,27 @@ int main(int argc, char *argv[]) fftwf_cleanup (); temp_dir.removeRecursively (); // clean up temp files + if (startup_smoke_test && !result) + { + smoke_phase ("cleanup complete"); + std::cout << "WSJT-X startup smoke test passed" << std::endl; + } return result; } catch (std::exception const& e) { - MessageBox::critical_message (nullptr, "Fatal error", e.what ()); + if (!automated_test) + { + MessageBox::critical_message (nullptr, "Fatal error", e.what ()); + } std::cerr << "Error: " << e.what () << '\n'; } catch (...) { - MessageBox::critical_message (nullptr, "Unexpected fatal error"); + if (!automated_test) + { + MessageBox::critical_message (nullptr, "Unexpected fatal error"); + } std::cerr << "Unexpected fatal error\n"; throw; // hoping the runtime might tell us more about the exception } diff --git a/manpages/man1/message_aggregator.1.txt b/manpages/man1/message_aggregator.1.txt index 7f2a0207..7e07f96b 100644 --- a/manpages/man1/message_aggregator.1.txt +++ b/manpages/man1/message_aggregator.1.txt @@ -2,11 +2,11 @@ :man source: AsciiDoc :man version: {VERSION} :man manual: WSJT-X Manual -= wsjtx(1) += message_aggregator(1) == NAME -message_aggregator - Reference example UDP server +message_aggregator - Graphical reference server for the WSJT-X UDP protocol. == SYNOPSIS @@ -14,29 +14,25 @@ message_aggregator - Reference example UDP server == DESCRIPTION -*message_aggregator* does not serve any useful purpose other than to - demonstrate the UDP message features of *WSJT-X*. It is a small GUI - application that interacts with any running *WSJT-X* instances. +*message_aggregator* is a graphical reference implementation of a server for +the WSJT-X UDP protocol. It displays logged QSOs and WSPR decodes, and creates +a dockable status and decode view for each connected WSJT-X instance. It also +demonstrates requests and commands that an external application can send back +to a WSJT-X client. Its source provides a starting point for applications that +integrate with WSJT-X: -Developers writing add on applications may find the source code of -message_aggregator contained in the *WSJT-X* code repository -useful. The files NetworkMessage.hpp, MessageServer.hpp, -MessageClient.hpp and their associated implementations along with the -application source MessageAggregator.cpp should cover all the required -areas. All these files can be found at: +https://github.com/WSJTX/wsjtx/tree/master/UDPExamples -https://sourceforge.net/p/wsjt/wsjt/HEAD/tree/branches/wsjtx/ +The server starts in unicast mode on UDP port 2237. Enter a valid multicast +group to use multicast, select one or more network interfaces if required, and +configure the same group and port in each WSJT-X instance under +*Settings -> Reporting -> UDP Server*. Multicast permits multiple servers to +receive the same WSJT-X messages. MAC-ambiguous IPv4 multicast group addresses +are not supported. -*message_aggregator* may also be used as a multi-cast UDP server which -allows multiple instances of *message_aggregator* to be run -concurrently, to do this simply use a suitable multi-cast group -address in *message_aggregator* and in *WSJT-X* in the -"*Settings->Reporting->UDP Server*" pane e.g. 239.255.0.1 or ff03::1 -for a local scope group. - -Note that on some systems it may be necessary to add a static -multi-cast route to the routing table before multi-cast traffic can be -routed to sockets on the same host as the sender. +When no multicast interface is selected, the server joins the loopback +interface. Some systems may require a suitable multicast route before traffic +can be delivered to sockets on the sending host. == AUTHOR @@ -45,10 +41,10 @@ Bill Somerville, G4WJS. == COPYING *message_aggregator* is Copyright (C) 2015 by William Somerville, G4WJS, -with contributions from additional authors. *message_aggregator* is Open Source -software, licensed under the GNU General Public License (GPLv3). +with contributions from additional authors. *message_aggregator* is Open +Source software, licensed under the GNU General Public License (GPLv3). 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 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. diff --git a/manpages/man1/udp_daemon.1.txt b/manpages/man1/udp_daemon.1.txt index e1182e8f..41fb908a 100644 --- a/manpages/man1/udp_daemon.1.txt +++ b/manpages/man1/udp_daemon.1.txt @@ -2,11 +2,11 @@ :man source: AsciiDoc :man version: {VERSION} :man manual: WSJT-X Manual -= wsjtx(1) += udp_daemon(1) == NAME -udp_daemon - Reference example UDP server +udp_daemon - Command-line reference server for the WSJT-X UDP protocol. == SYNOPSIS @@ -14,42 +14,51 @@ udp_daemon - Reference example UDP server == DESCRIPTION -*udp_daemon* does not serve any useful purpose other than to - demonstrate the UDP message features of *WSJT-X*. It is a small - command line application that interacts with any running *WSJT-X* - instances. +*udp_daemon* is a command-line reference implementation of a server for the +WSJT-X UDP protocol. It discovers WSJT-X clients and prints their status, +decodes, WSPR decodes, logged QSOs, and logged ADIF records. Its source also +demonstrates how an external application can receive and respond to WSJT-X +messages: -Developers writing add on applications may find the source code of -*udp_daemon* contained in the *WSJT-X* code repository useful. The -files NetworkMessage.hpp, MessageServer.hpp, MessageClient.hpp and -their associated implementations along with the application source -UDPDaemon.cpp should cover all the required areas. All these files can -be found at: +https://github.com/WSJTX/wsjtx/tree/master/UDPExamples -https://sourceforge.net/p/wsjt/wsjt/HEAD/tree/branches/wsjtx/ +The daemon listens as a unicast server by default. To use multicast, specify a +valid multicast group with *--multicast-group* and configure the same group +and port in each WSJT-X instance under *Settings -> Reporting -> UDP Server*. +Multicast permits multiple servers to receive the same WSJT-X messages. +MAC-ambiguous IPv4 multicast group addresses are not supported. -*udp_daemon* may also be used as a multi-cast UDP server which allows -multiple instances of *udp_daemon* to be run concurrently, to do this -simply pass a suitable multi-cast group address using the command line -option and in *WSJT-X* in the "*Settings->Reporting->UDP Server*" pane -e.g. 239.255.0.1 or ff03::1 for a local scope group. - -Note that on some systems it may be necessary to add a static -multi-cast route to the routing table before multi-cast traffic can be -routed to sockets on the same host as the sender. +Without *--network-interface*, a multicast server joins the loopback +interface. Use *--list-interfaces* to find interface names and repeat +*--network-interface* to join the group on one or more selected interfaces. +Some systems may require a suitable multicast route before traffic can be +delivered to sockets on the sending host. == OPTIONS -*-p* PORT, *--port*=PORT:: -Optional service port number to listen on (default 2237). +*-h, --help*:: +Display command-line help and exit. + +*--help-all*:: +Display command-line help including Qt-specific options and exit. + +*-v, --version*:: +Display the application version and exit. -*-g* MULTICAST-GROUP, *--group*=MULTICAST-GROUP:: +*-l, --list-interfaces*:: +Print the available network interfaces and exit. -Optional multicast group address to join (Default unicast server). +*-p* _PORT_, *--port*=_PORT_:: +Listen on UDP service port _PORT_. The default is 2237. -*-v, --version*:: Display the application version. +*-g* _GROUP_, *--multicast-group*=_GROUP_:: +Join multicast group _GROUP_. Without this option, listen as a unicast server +on all interfaces. -*-h,--help*:: Display usage information. +*-i* _INTERFACE_, *--network-interface*=_INTERFACE_:: +Join the multicast group on the named network interface. This option may be +repeated to select multiple interfaces; without it, multicast uses the +loopback interface. == AUTHOR @@ -58,10 +67,10 @@ Bill Somerville, G4WJS. == COPYING *udp_daemon* is Copyright (C) 2015 by William Somerville, G4WJS, -with contributions from additional authors. *udp_daemon* is Open Source +with contributions from additional authors. *udp_daemon* is Open Source software, licensed under the GNU General Public License (GPLv3). 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 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. diff --git a/manpages/man1/wsjtx.1.txt b/manpages/man1/wsjtx.1.txt index 49bfd3de..0a5d6a3b 100644 --- a/manpages/man1/wsjtx.1.txt +++ b/manpages/man1/wsjtx.1.txt @@ -6,7 +6,7 @@ == NAME -wsjtx, jt9 - Weak signal communications program. +wsjtx - Weak-signal communications program. == SYNOPSIS @@ -14,91 +14,95 @@ wsjtx, jt9 - Weak signal communications program. == DESCRIPTION -*wsjtx* is a weak signal communications program supporting several operating -modes: JT65, JT9, JT4 and WSPR (*wsjtx* version 1 supported JT9 only). +*WSJT-X* is an amateur-radio application for weak-signal communication. Its +selectable modes are FST4, FT4, FT8, JT4, JT9, JT65, Q65, JTTY, MSK144, +FST4W, WSPR, Echo, and FreqCal. -WSJT-X home page:: http://www.physics.princeton.edu/pulsar/K1JT/wsjtx.html +WSJT-X home page:: https://wsjtx.github.io/wsjtx/ -WSJT-X User's Guide:: -http://www.physics.princeton.edu/pulsar/K1JT/wsjtx-doc/wsjtx-main-{VERSION}.html - -An alternative JT65 decoder executable *kvasd* for i386 Ubuntu is -available at http://www.physics.princeton.edu/pulsar/K1JT/kvasd . -This decoder is not open-source, is not included in the wsjtx package, -and is not required for JT65 decoding. +WSJT-X User Guide:: https://wsjtx.github.io/wsjtx/guide-full.html == OPTIONS -*-r, --rig-name*[=RIGNAME]:: - -Enable multiple instances of the wsjtx(1) application to run -concurrently. Each RIGNAME must be unique. One instance may use no -RIGNAME. If this option is not supplied then only one instance of -wsjtx(1) may be run at any time. -*-v, --version*:: Display the application version. +*-h, --help*:: +Display command-line help and exit. -*-h,--help*:: Display usage information. +*--help-all*:: +Display command-line help including Qt-specific options and exit. -*--test-mode*:: +*-v, --version*:: +Display the application version and exit. -When this option is provided all writable files will be placed in a -special test location (~/.qttest). This option is only for -application testing and is not designed for normal operations. **Use -with caution**. +*-r, --rig-name*=_RIG-NAME_:: +Run a named instance. Each concurrently running instance must use a unique +name. The name is appended to the application identity, separating its +instance lock, settings file, and writable data directory from other +instances. -== FILES +*-p, --n1mm-tcp-port*=_PORT_:: +On Windows, connect the N1MM Logger+ interface to TCP port _PORT_ on the local +host. -Most of the following files are in a directory path containing the -directory name *WSJT-X[ - RIGNAME]* which indicates the value of the -command line option *--rig-name=RIGNAME* to indicate multiple instances of -*wsjtx* running concurrently. All writable files listed below are -therefore unique to each concurrent instance of *wsjtx*. If the -*--rig-name* command line option is not supplied or the *RIGNAME* argument -is not supplied then the directory paths below will have the directory -*WSJT-X*. +*--mode*=_MODE_:: +Start in FT8, FT4, or JTTY mode. Mode names are case-insensitive. When +*--n1mm-tcp-port* is supplied, the selected mode is locked for the N1MM +session. -~/.config/WSJT-X[ - RIGNAME].ini:: +*-c, --config*=_CONFIGURATION_:: +Select an existing saved configuration at startup. Configurations share the +instance's settings file and do not change its writable data directory. -This file stores the application -configuration settings. +*-l, --language*=_LANGUAGE_:: +Override the user-interface language with a language code, optionally +followed by a country code, such as `de` or `pt-BR`. -~/.local/share/WSJT-X[ - RIGNAME]/ALL.txt:: +*--test-mode*:: +Redirect Qt standard writable locations to the test hierarchy and allow a +separate test instance. This option is intended for application testing only. -*ALL.txt* contains a record of transmitted and received messages and -other activity such as frequency or band changes. +*--startup-smoke-test*:: +Start the application, process its initial GUI events, and exit. This option +also uses the test-mode writable locations. -~/.local/share/WSJT-X[ - RIGNAME]/save/:: +== FILES -Is the default location for saved .WAV files recorded by the -application. The .WAV file save location may be changed in the -applications settings dialog. +*WSJT-X* uses the platform's Qt standard paths. On Linux, the default paths +for an unnamed instance are: -~/.local/share/WSJT-X[ - RIGNAME]/save/samples/:: +~/.config/WSJT-X.ini:: +Application settings. Named configurations selected with *--config* are +stored in this file. -Sample .WAV files supplied with the application are found in this -directory, they may be played back in the application and are referred -to in the user guide tutorial sections. +~/.local/share/WSJT-X/:: +Writable application data. -~/.local/share/WSJT-X[ -RIGNAME]/timer.out:: +When *--rig-name* is used, a space, hyphen, space, and _RIG-NAME_ are appended +to `WSJT-X` in both paths. If `XDG_CONFIG_HOME` or `XDG_DATA_HOME` is set, Qt +uses that directory instead of the corresponding default above. *--test-mode* +uses Qt's test-path hierarchy under `~/.qttest`. -This is a diagnostic file that records decode performance profiling -information. +Notable files and directories in the writable data directory include: -~/.local/share/WSJT-X[ - RIGNAME]/cty.dat:: +ALL.TXT:: +A record of transmitted and received messages and other activity. Depending +on its logging settings and mode, WSJT-X may write date- or mode-specific +variants instead. -This file is not required as a version of it is embedded in the -application, but if you wish an updated version can be placed here. -If present that version will be used in preference to the embedded -version. +save/:: +The default directory for saved audio files. The location can be changed in +the application settings. -~/.local/share/WSJT-X[ - RIGNAME]/wsjtx.log:: +save/samples/:: +Sample audio files used by the User Guide tutorials and sample downloader. -This is a plain text CSV record of logged QSOs. +cty.dat:: +An optional writable override for the country file installed with WSJT-X. -~/.local/share/WSJT-X[ - RIGNAME]/wsjtx_log.adi:: +wsjtx.log:: +A plain-text CSV record of logged QSOs. -This is a record of QSOs logged in the ADIF format which is suitable -for import into many Ham Radio logging programs. +wsjtx_log.adi:: +The ADIF log used as the primary WSJT-X logbook. == AUTHOR @@ -106,16 +110,16 @@ Joe Taylor, K1JT. == COPYING -*wsjtx* is Copyright (C) 2001 - 2025 by Joseph H. Taylor, Jr., K1JT, -with contributions from additional authors. WSJT-X is Open Source +*wsjtx* is Copyright (C) 2001 - 2026 by Joseph H. Taylor, Jr., K1JT, +with contributions from additional authors. WSJT-X is Open Source software, licensed under the GNU General Public License (GPLv3). *wsjtx* includes the ``**Hamlib - Ham Radio Control Libraries**'' software which is licensed under the GNU Lesser General Public License -(LGPL). Home page https://sourceforge.net/apps/mediawiki/hamlib, -sources from https://sourceforge.net/p/hamlib/code/ci/master/tree/. +(LGPL). Home page https://hamlib.github.io/, sources from +https://github.com/Hamlib/Hamlib. 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 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. diff --git a/map65/CMakeLists.txt b/map65/CMakeLists.txt index 9d1b45bb..00de39fd 100644 --- a/map65/CMakeLists.txt +++ b/map65/CMakeLists.txt @@ -13,14 +13,19 @@ set (map65_CXXSRCS getdev.cpp # getfile.cpp liveCQSender.cpp +# map65_paths.cpp main.cpp mainwindow.cpp + map65_decode_display_filter.cpp messages.cpp meterwidget.cpp plotter.cpp + pskreporter_decode.cpp + pskreporter_settings.cpp + Radio.cpp + runtime_paths.cpp ../Network/PSKReporter.cpp ../Network/PSKReporterIPFIX.cpp - Radio.cpp set570.cpp signalmeter.cpp soundin.cpp @@ -53,12 +58,19 @@ add_subdirectory (libm65) # UI generation qt5_wrap_ui (map65_GENUISRCS ${map65_UISRCS}) +# windres doesn't track a .rc file's ICON directive as a dependency, so an icon-only edit needs this to trigger a rebuild. +set_property (SOURCE map65.rc APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/wsjt.ico) + +# Resource generation (About dialog logo + GPL logo) +qt5_add_resources (map65_RESOURCES_RCC about.qrc) + # Executable: only the .rc file is Windows-only if (WIN32) add_executable(map65 ${map65_CXXSRCS} ${map65_CSRCS} ${map65_GENUISRCS} + ${map65_RESOURCES_RCC} map65.rc ) else() @@ -66,6 +78,7 @@ else() ${map65_CXXSRCS} ${map65_CSRCS} ${map65_GENUISRCS} + ${map65_RESOURCES_RCC} ) endif() @@ -88,6 +101,10 @@ target_link_libraries(map65 PRIVATE Usb::Usb ) +if (APPLE) + target_link_libraries(map65 PRIVATE m65_qt) +endif () + # Linux needs libusb # if (UNIX AND NOT APPLE) # find_package(PkgConfig REQUIRED) diff --git a/map65/about.cpp b/map65/about.cpp index 1d92e0c3..6a1dde07 100644 --- a/map65/about.cpp +++ b/map65/about.cpp @@ -7,14 +7,21 @@ CAboutDlg::CAboutDlg(QWidget *parent) : ui(new Ui::CAboutDlg) { ui->setupUi(this); - ui->labelTxt->setText("

" + QString {"MAP65 v" + ui->labelTxt->setText("

" + QString {"MAP65™ v" + QCoreApplication::applicationVersion () + " " + revision ()}.simplified () + "


" - "MAP65 implements a wideband polarization-matching receiver
" + "MAP65™ implements a wideband polarization-matching receiver
" "for the JT65 and Q65 protocols, with a matching transmitting
" "facility. It is primarily intended for amateur radio EME communication.

" - "Copyright 2001-2026 by Joe Taylor, K1JT, and the WSJT
" - "Develolpment Group."); + "Copyright 2001-2026 by Joe Taylor, K1JT, and the WSJT™
" + "Development Team.

" + "MAP65 is licensed under the terms of Version 3
" + "of the GNU General Public License (GPL)

" + "" + "" + "" + "
" + "https://www.gnu.org/licenses/gpl-3.0.txt
"); } CAboutDlg::~CAboutDlg() diff --git a/map65/about.qrc b/map65/about.qrc new file mode 100644 index 00000000..9520adbc --- /dev/null +++ b/map65/about.qrc @@ -0,0 +1,6 @@ + + + about_icon.png + ../contrib/gpl-v3-logo.svg + + diff --git a/map65/about.ui b/map65/about.ui index fb20f48d..8141882d 100644 --- a/map65/about.ui +++ b/map65/about.ui @@ -5,22 +5,8 @@ Qt::NonModal - - - 0 - 0 - 374 - 164 - - - - - 0 - 0 - - - About MAP65 + About MAP65™ @@ -28,6 +14,12 @@ + + Qt::AlignCenter + + + true + diff --git a/map65/about_icon.png b/map65/about_icon.png new file mode 100644 index 00000000..68198d68 Binary files /dev/null and b/map65/about_icon.png differ diff --git a/map65/commons.cpp b/map65/commons.cpp index bbef8ed0..74c69b74 100644 --- a/map65/commons.cpp +++ b/map65/commons.cpp @@ -4,5 +4,8 @@ extern "C" { float* dd = nullptr; float* ss = nullptr; float* savg = nullptr; + float* dd_old = nullptr; + float* ss_old = nullptr; + float* savg_old = nullptr; } diff --git a/map65/commons.h b/map65/commons.h index d717f82c..888e922b 100644 --- a/map65/commons.h +++ b/map65/commons.h @@ -2,8 +2,12 @@ #define COMMONS_H #define NFFT 32768 +#define BASELINE_RATE 96000 +#define BASELINE_NFFT 32768 + #include +#include // This header defines the C++ interface to the Fortran datcom_ptrs_mod module. // It replaces the legacy common block interface with explicit setter/getter functions. @@ -53,12 +57,17 @@ extern struct { //This is "common/datcom/..." in Fortran extern float* dd; extern float* ss; extern float* savg; + extern float* dd_old; + extern float* ss_old; + extern float* savg_old; + extern int manualDecodeFlag ; double get_fcenter(); void get_mycall(char*); void get_hiscall(char*); void get_mygrid(char*); void get_hisgrid(char*); void get_datetime(char*); + int get_manual_decode_flag(); int get_nutc(); int get_ndop00(); int get_nkeep(); @@ -91,6 +100,9 @@ extern struct { //This is "common/datcom/..." in Fortran void set_dd_ptr(void* ptr, int dim1, int dim2); void set_ss_ptr(void* ptr, int dim1, int dim2, int dim3); void set_savg_ptr(void* ptr, int dim1, int dim2); + void set_dd_old_ptr(void* ptr, int dim1, int dim2); + void set_ss_old_ptr(void* ptr, int dim1, int dim2, int dim3); + void set_savg_old_ptr(void* ptr, int dim1, int dim2); void set_fcenter(double); void set_map65RxLog(int); void set_nutc(int); @@ -130,11 +142,17 @@ extern struct { //This is "common/datcom/..." in Fortran void run_m65_(int* pol, int* sample_rate); void set_stop_m65(int val); void set_decoder_ready(int val); + std::int64_t publish_decode_request(); + void cancel_pending_decode_requests(); + void advance_live_input_generation(); + bool is_current_decode_request(std::int64_t request_id); void set_wsjtx_dir_(const char* path, int path_len); void set_stdout_channel(void* buf_ptr, void* hdr_ptr, int buf_size, intptr_t event_handle); + void set_manual_decode_flag(int); + void snapshot_buffers(); } extern QStringList allDecodes; @@ -143,8 +161,6 @@ extern QString guiDate; extern bool m_w3szUrl; extern QString m_otherUrl; -extern bool m_spot_to_psk_reporter; -extern bool m_psk_reporter_tcpip; // Scalar getters inline int getNutc() { return get_nutc(); } diff --git a/map65/devsetup.cpp b/map65/devsetup.cpp index 2b1e9e8f..4fae12ea 100644 --- a/map65/devsetup.cpp +++ b/map65/devsetup.cpp @@ -9,6 +9,9 @@ #include #include #include +#include +#include +#include "SettingsGroup.hpp" #if !defined(Q_OS_WIN) extern "C" { @@ -54,8 +57,17 @@ DevSetup::DevSetup(MainWindow *parent) mw(parent) { ui.setupUi(this); //setup the dialog form + + { + QSettings settings(mw->m_settings_filename, QSettings::IniFormat); + SettingsGroup g {&settings, "DevSetup"}; + restoreGeometry(settings.value("geometry").toByteArray()); + } + m_restartSoundIn=false; m_restartSoundOut=false; + m_restartRequired=false; + m_pendingFs96000=-1; QButtonGroup *buttonGroup = new QButtonGroup(this); buttonGroup->addButton(ui.w3szBut); @@ -74,6 +86,18 @@ DevSetup::~DevSetup() { } +void DevSetup::done(int r) +{ + // accept()/reject() (OK, Cancel, and the title-bar close button, which + // triggers reject() internally) all funnel through here -- unlike + // closeEvent(), which only fires for the title-bar close button, not + // for accept()/reject() called directly from button clicks. + QSettings settings(mw->m_settings_filename, QSettings::IniFormat); + SettingsGroup g {&settings, "DevSetup"}; + settings.setValue("geometry", saveGeometry()); + QDialog::done(r); +} + void DevSetup::initDlg() { int k,id; @@ -105,9 +129,10 @@ getDev(&numDevices, k = 0; for (id = 0; id < numDevices; id++) { - if (!(96000 >= minSpeed[id] && 96000 <= maxSpeed[id])) + if (!(g_sampleRate >= minSpeed[id] && g_sampleRate <= maxSpeed[id])) continue; + #ifdef _WIN32 if (!QString(hostAPI_DeviceName[id].name).contains("MME")) continue; @@ -201,6 +226,14 @@ for (id = 0; id < numDevices; id++) { ptt_set_override(nullptr); #endif + if (mw->m_fs96000 == 2) + oldSampleRate = 192000; + else if (mw->m_fs96000 == 1) + oldSampleRate = 96000; + else if (mw->m_fs96000 == 0) + oldSampleRate = 95238; + else oldSampleRate = 96000; + ui.astroFont->setValue(mw->m_astroFont); ui.cbXpol->setChecked(mw->m_xpol); ui.rbAntennaX->setChecked(mw->m_xpolx); @@ -212,10 +245,16 @@ for (id = 0; id < numDevices; id++) { ui.dPhiSpinBox->setValue(mw->m_dPhi); ui.fCalSpinBox->setValue(mw->m_fCal); ui.faddEntry->setText(QString::number(mw->m_fAdd,'f',3)); - ui.networkRadioButton->setChecked(mw->m_network); - ui.soundCardRadioButton->setChecked(!mw->m_network); - ui.rb96000->setChecked(mw->m_fs96000); - ui.rb95238->setChecked(!mw->m_fs96000); + { + QSignalBlocker blockNetwork {ui.networkRadioButton}; + QSignalBlocker blockSoundCard {ui.soundCardRadioButton}; + ui.networkRadioButton->setChecked(mw->m_network); + ui.soundCardRadioButton->setChecked(!mw->m_network); + } + ui.rb192000->setChecked(mw->m_fs96000 == 2); + ui.rb96000->setChecked(mw->m_fs96000 == 1); + ui.rb95238->setChecked(mw->m_fs96000 == 0); + on_soundCardRadioButton_toggled(ui.soundCardRadioButton->isChecked()); ui.rbIQXT->setChecked(mw->m_bIQxt); ui.rbSi570->setChecked(!mw->m_bIQxt); ui.mult570TxSpinBox->setEnabled(mw->m_bIQxt); @@ -267,10 +306,26 @@ void DevSetup::accept() // Check to see whether SoundInThread must be restarted, // and save user parameters. + int newSampleRate = ui.rb192000->isChecked() ? 192000 : + ui.rb96000->isChecked() ? 96000 : + 95238; + int newFs96000 = ui.rb192000->isChecked() ? 2 : + ui.rb96000->isChecked() ? 1 : + 0; + double const newFAdd = ui.faddEntry->text().toDouble(); + + m_restartRequired = oldSampleRate != newSampleRate; + if (m_restartRequired) { + m_pendingFs96000 = newFs96000; + } else { + emit sampleRateChanged(newSampleRate); + } + if(mw->m_network!=ui.networkRadioButton->isChecked() or mw->m_nDevIn!=ui.comboBoxSndIn->currentIndex() or mw->m_paInDevice!=m_inDevList[mw->m_nDevIn] or mw->m_xpol!=ui.cbXpol->isChecked() or + mw->m_fAdd!=newFAdd or mw->m_udpPort!=ui.sbPort->value()) m_restartSoundIn=true; if(mw->m_nDevOut!=ui.comboBoxSndOut->currentIndex() or @@ -303,9 +358,11 @@ void DevSetup::accept() mw->m_timeout=ui.timeoutSpinBox->value(); mw->m_dPhi=ui.dPhiSpinBox->value(); mw->m_fCal=ui.fCalSpinBox->value(); - mw->m_fAdd=ui.faddEntry->text().toDouble(); + mw->m_fAdd=newFAdd; mw->m_network=ui.networkRadioButton->isChecked(); - mw->m_fs96000=ui.rb96000->isChecked(); + if (!m_restartRequired) { + mw->m_fs96000 = newFs96000; + } mw->m_bIQxt=ui.rbIQXT->isChecked(); mw->m_nDevIn=ui.comboBoxSndIn->currentIndex(); mw->m_paInDevice=m_inDevList[mw->m_nDevIn]; @@ -325,13 +382,34 @@ void DevSetup::accept() mw->m_spot_to_psk_reporter = ui.pskBox->isChecked(); mw->m_psk_reporter_tcpip = ui.pskReporterTcpIpBox->isChecked(); + if (m_restartRequired) { + QMessageBox::information(this, + "Restart Required", + "Changing sample rate requires MAP65 to be restarted.\n" + "Please exit MAP65 and start it again."); + } + + // Normal path QDialog::accept(); + } void DevSetup::on_soundCardRadioButton_toggled(bool checked) { ui.comboBoxSndIn->setEnabled(ui.soundCardRadioButton->isChecked()); - ui.rb96000->setChecked(checked); + int fs96000 = ui.rb192000->isChecked() ? 2 : + ui.rb95238->isChecked() ? 0 : + 1; + if(checked) { + if(fs96000 == 0) fs96000 = 1; + ui.rb95238->setEnabled(false); + } + else { + ui.rb95238->setEnabled(true); + } + ui.rb192000->setChecked(fs96000 == 2); + ui.rb96000->setChecked(fs96000 == 1); + ui.rb95238->setChecked(fs96000 == 0); ui.rb95238->setEnabled(!checked); ui.label_InputDev->setEnabled(checked); ui.label_Port->setEnabled(!checked); diff --git a/map65/devsetup.h b/map65/devsetup.h index 9ae4bad9..64acd572 100644 --- a/map65/devsetup.h +++ b/map65/devsetup.h @@ -16,13 +16,20 @@ public: ~DevSetup(); void initDlg(); + qint32 m_inDevList[1024]; qint32 m_outDevList[1024]; bool m_restartSoundIn; bool m_restartSoundOut; + bool m_restartRequired; + int m_pendingFs96000; + +signals: + void sampleRateChanged(int newRate); public slots: - void accept(); + void accept() override; + void done(int r) override; void onButtonClicked(); private slots: @@ -56,6 +63,7 @@ private: MainWindow *mw; int r,g,b,r0,g0,b0,r1,g1,b1,r2,g2,b2,r3,g3,b3; Ui::DialogSndCard ui; + int oldSampleRate; }; #endif // DEVSETUP_H diff --git a/map65/devsetup.ui b/map65/devsetup.ui index e9d2746c..fa87164a 100644 --- a/map65/devsetup.ui +++ b/map65/devsetup.ui @@ -324,17 +324,11 @@ - + 0 0 - - - 0 - 55 - - Antennas: @@ -798,6 +792,29 @@ + + + + 192000 Hz + + + true + + + + + + + Qt::Orientation::Horizontal + + + + 40 + 20 + + + + @@ -809,7 +826,7 @@ - + Qt::Orientation::Horizontal @@ -923,104 +940,39 @@ - - - - - Qt::Orientation::Horizontal - - - QSizePolicy::Policy::Fixed - - - - 80 - 20 - - - - - + + Red - - - - - - Qt::Orientation::Horizontal - - - QSizePolicy::Policy::Fixed - - - - 31 - 20 - + + Qt::AlignmentFlag::AlignCenter - + - + Green - - - - - - Qt::Orientation::Horizontal - - - QSizePolicy::Policy::Fixed - - - - 34 - 20 - + + Qt::AlignmentFlag::AlignCenter - + - + Blue - - - - - - Qt::Orientation::Horizontal - - - QSizePolicy::Policy::Fixed - - - - 80 - 20 - + + Qt::AlignmentFlag::AlignCenter - + - - - - - + - - - 60 - 16777215 - - Background @@ -1029,21 +981,21 @@ - + 255 - + 255 - + 255 @@ -1053,34 +1005,8 @@ - - - - Qt::Orientation::Horizontal - - - QSizePolicy::Policy::Fixed - - - - 55 - 20 - - - - - - - - - + - - - 60 - 16777215 - - Newest @@ -1089,7 +1015,7 @@ - + 255 @@ -1099,34 +1025,28 @@ - + 255 - + 255 - + - + 0 0 - - - 50 - 16777215 - - Courier New @@ -1138,18 +1058,8 @@ - - - - - + - - - 60 - 16777215 - - 2nd @@ -1158,7 +1068,7 @@ - + 255 @@ -1168,7 +1078,7 @@ - + 255 @@ -1178,27 +1088,21 @@ - + 255 - + - + 0 0 - - - 50 - 16777215 - - Courier New @@ -1210,18 +1114,8 @@ - - - - - + - - - 60 - 16777215 - - 3rd @@ -1230,7 +1124,7 @@ - + 255 @@ -1240,7 +1134,7 @@ - + 255 @@ -1250,7 +1144,7 @@ - + 255 @@ -1260,20 +1154,14 @@ - + - + 0 0 - - - 50 - 16777215 - - Courier New @@ -1285,18 +1173,8 @@ - - - - - + - - - 60 - 16777215 - - Oldest @@ -1305,7 +1183,7 @@ - + 255 @@ -1315,7 +1193,7 @@ - + 255 @@ -1325,7 +1203,7 @@ - + 255 @@ -1335,20 +1213,14 @@ - + - + 0 0 - - - 50 - 16777215 - - Courier New @@ -1714,13 +1586,6 @@ - - - - Use TCP/IP for PSKReporter - - - @@ -1734,6 +1599,16 @@ + + + + Transport changes take effect the next time MAP65 starts. + + + Use TCP for PSK Reporter + + + diff --git a/map65/globals.h b/map65/globals.h new file mode 100644 index 00000000..c9fa80d8 --- /dev/null +++ b/map65/globals.h @@ -0,0 +1 @@ +extern int g_activeNfft; diff --git a/map65/half_symbol_scheduler.h b/map65/half_symbol_scheduler.h new file mode 100644 index 00000000..b4b1e2b5 --- /dev/null +++ b/map65/half_symbol_scheduler.h @@ -0,0 +1,36 @@ +#ifndef MAP65_HALF_SYMBOL_SCHEDULER_H +#define MAP65_HALF_SYMBOL_SCHEDULER_H + +#include + +class Map65HalfSymbolScheduler +{ +public: + void reset () noexcept { scheduled_half_symbol_ = 0; } + + bool claim_next (int available_half_symbol, std::atomic_bool& busy) noexcept + { + if (available_half_symbol <= scheduled_half_symbol_) + { + return false; + } + + bool expected = false; + if (!busy.compare_exchange_strong (expected, true, + std::memory_order_acq_rel, + std::memory_order_acquire)) + { + return false; + } + + ++scheduled_half_symbol_; + return true; + } + + int scheduled_half_symbol () const noexcept { return scheduled_half_symbol_; } + +private: + int scheduled_half_symbol_ {0}; +}; + +#endif diff --git a/map65/libm65/CMakeLists.txt b/map65/libm65/CMakeLists.txt index 67e4961e..c0361b44 100644 --- a/map65/libm65/CMakeLists.txt +++ b/map65/libm65/CMakeLists.txt @@ -6,6 +6,7 @@ set (libm65_FSRCS extract_shared_mod.f90 gran_interface.f90 m65_mod.f90 + map65_polarization_score.f90 four2a_legacy_wrap.f90 npar_ptrs_mod.f90 pfx_mod.f90 @@ -91,7 +92,6 @@ set (libm65_FSRCS smo.f90 sun.f90 symspec.f90 - test_astro_pipeline.f90 # timer.f90 timf2.f90 tm2.f90 @@ -113,6 +113,7 @@ set (libm65_ka9q_CSRCS set_source_files_properties (${libm65_ka9q_CSRCS} PROPERTIES COMPILE_FLAGS -Wno-sign-compare) set (libm65_CSRCS + decode_request_mutex.cpp ${libm65_ka9q_CSRCS} ftrsd2.c # gran.c @@ -137,12 +138,24 @@ else () ) endif () +if (APPLE) + # Keep Apple's framework include flags out of m65impl's Fortran sources. + list (REMOVE_ITEM libm65_CSRCS stdout_shared_memory.cpp) + add_library (m65_qt STATIC stdout_shared_memory.cpp) + target_link_libraries (m65_qt PRIVATE Qt5::Core) +endif () + #set (libm65_CXXSRCS # ipcomm.cpp # ) add_definitions (-DBIGSYM=1) set_source_files_properties (sec_midn.f90 PROPERTIES COMPILE_FLAGS -fno-second-underscore) +# pol is genuine C-supplied state (bind(C, name='run_m65_'), called from +# MAP65's audio callback) that the current implementation doesn't happen +# to reference; removing it would mean touching the C++ caller too, so we +# suppress the warning instead. +set_source_files_properties (run_m65.f90 PROPERTIES COMPILE_FLAGS "-Wno-unused-dummy-argument") if(Qt6_FOUND) set_source_files_properties(m65a.f90 PROPERTIES COMPILE_FLAGS "-Wno-aliasing -fallow-argument-mismatch") else() @@ -179,14 +192,130 @@ set_source_files_properties(stdout_channel_mod.f90 PROPERTIES Fortran_PREPROCESS ON ) -# MAP65 should not choose between wsjt_fort and wsjt_fort_omp locally. The -# common interface target keeps the variant policy in one place and still -# resolves to wsjt_fort_omp when OPENMP_ONLY leaves no non-OpenMP library. -# Default BOTH builds intentionally use the non-OpenMP common target here; -# release Windows and Linux builds pin OPENMP_ONLY when MAP65 needs OpenMP. -target_link_libraries (m65impl PUBLIC Qt5::Core) +# MAP65 uses OpenMP critical regions to protect shared FFTW planning state, +# independently of which common Fortran library variant it consumes. +if (NOT TARGET wsjt_fortran_openmp) + message (FATAL_ERROR "MAP65 requires Fortran OpenMP support") +endif () +if (NOT APPLE) + target_link_libraries (m65impl PUBLIC Qt5::Core) +endif () +if (CMAKE_SYSTEM_NAME STREQUAL "Linux") + target_link_libraries (m65impl PRIVATE rt) +endif () +target_link_libraries (m65impl PRIVATE wsjt_fortran_openmp) wsjt_link_common_fortran (m65impl) +if (WSJT_ENABLE_TESTS) + add_subdirectory (${CMAKE_SOURCE_DIR}/tests/unit/map65/decode_history + ${CMAKE_CURRENT_BINARY_DIR}/decode_history) + + add_executable (test_map65_deep_search_cache + ${CMAKE_SOURCE_DIR}/tests/unit/map65/test_map65_deep_search_cache.f90) + target_include_directories (test_map65_deep_search_cache PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries (test_map65_deep_search_cache PRIVATE m65impl) + file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/deep_search_cache) + add_test (NAME test_map65_deep_search_cache COMMAND test_map65_deep_search_cache) + set_tests_properties (test_map65_deep_search_cache PROPERTIES + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/deep_search_cache TIMEOUT 30) + + add_executable (test_map65_decode_requests + ${CMAKE_SOURCE_DIR}/tests/unit/map65/test_map65_decode_requests.f90) + target_include_directories (test_map65_decode_requests PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries (test_map65_decode_requests PRIVATE m65impl) + add_test (NAME test_map65_decode_requests COMMAND test_map65_decode_requests) + + add_executable (test_map65_astro + ${CMAKE_SOURCE_DIR}/tests/unit/map65/test_map65_astro.f90) + target_include_directories (test_map65_astro PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries (test_map65_astro PRIVATE m65impl) + add_test (NAME test_map65_astro COMMAND test_map65_astro) + set_tests_properties (test_map65_astro PROPERTIES TIMEOUT 180) + + add_executable (test_map65_jt65_handoff + ${CMAKE_SOURCE_DIR}/tests/unit/jt65/jt65_test_fixture.f90 + ${CMAKE_SOURCE_DIR}/tests/unit/jt65/test_map65_jt65_handoff.f90) + target_include_directories (test_map65_jt65_handoff PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries (test_map65_jt65_handoff PRIVATE m65impl jt65_test_vectors) + add_test (NAME test_map65_jt65_handoff COMMAND test_map65_jt65_handoff) + set_tests_properties (test_map65_jt65_handoff PROPERTIES TIMEOUT 180) + + add_executable (test_q65_waveform_generator + ${CMAKE_SOURCE_DIR}/tests/unit/q65/test_q65_waveform_generator.f90) + target_include_directories (test_q65_waveform_generator PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries (test_q65_waveform_generator PRIVATE m65impl) + add_test (NAME test_q65_waveform_generator COMMAND test_q65_waveform_generator) + set_tests_properties (test_q65_waveform_generator PROPERTIES TIMEOUT 180) + + add_executable (test_map65_wideband_sync_rows + ${CMAKE_SOURCE_DIR}/tests/unit/q65/test_map65_wideband_sync_rows.f90) + target_include_directories (test_map65_wideband_sync_rows PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries (test_map65_wideband_sync_rows PRIVATE m65impl) + add_test (NAME test_map65_wideband_sync_rows COMMAND test_map65_wideband_sync_rows) + set_tests_properties (test_map65_wideband_sync_rows PROPERTIES TIMEOUT 180) + + add_executable (test_map65_polarization_score + ${CMAKE_SOURCE_DIR}/tests/unit/q65/test_map65_polarization_score.f90) + target_include_directories (test_map65_polarization_score PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries (test_map65_polarization_score PRIVATE m65impl) + add_test (NAME test_map65_polarization_score COMMAND test_map65_polarization_score) + + add_executable (test_ccf65_correlator + ${CMAKE_SOURCE_DIR}/tests/unit/jt65/test_ccf65_correlator.f90) + target_include_directories (test_ccf65_correlator PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries (test_ccf65_correlator PRIVATE m65impl) + add_test (NAME test_ccf65_correlator COMMAND test_ccf65_correlator) + set_tests_properties (test_ccf65_correlator PROPERTIES TIMEOUT 180) + + add_executable (test_map65_s3avg_contracts + ${CMAKE_SOURCE_DIR}/tests/unit/jt65/test_map65_s3avg_contracts.f90) + target_include_directories (test_map65_s3avg_contracts PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries (test_map65_s3avg_contracts PRIVATE m65impl) + add_test (NAME test_map65_s3avg_contracts COMMAND test_map65_s3avg_contracts) + set_tests_properties (test_map65_s3avg_contracts PROPERTIES TIMEOUT 180) + + add_executable (test_map65_jt65_message_validity + ${CMAKE_SOURCE_DIR}/tests/unit/jt65/test_map65_jt65_message_validity.f90) + target_include_directories (test_map65_jt65_message_validity PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries (test_map65_jt65_message_validity PRIVATE m65impl) + add_test (NAME test_map65_jt65_message_validity COMMAND test_map65_jt65_message_validity) + set_tests_properties (test_map65_jt65_message_validity PROPERTIES TIMEOUT 180) + + add_executable (test_map65_jt65_candidate_consistency + ${CMAKE_SOURCE_DIR}/tests/unit/jt65/test_map65_jt65_candidate_consistency.f90) + target_include_directories (test_map65_jt65_candidate_consistency PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries (test_map65_jt65_candidate_consistency PRIVATE m65impl) + add_test (NAME test_map65_jt65_candidate_consistency COMMAND test_map65_jt65_candidate_consistency) + set_tests_properties (test_map65_jt65_candidate_consistency PROPERTIES TIMEOUT 180) + + add_executable (test_map65_result_selection + ${CMAKE_SOURCE_DIR}/tests/unit/map65/test_map65_result_selection.f90) + target_include_directories (test_map65_result_selection PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries (test_map65_result_selection PRIVATE m65impl) + add_test (NAME test_map65_result_selection COMMAND test_map65_result_selection) + set_tests_properties (test_map65_result_selection PROPERTIES TIMEOUT 180) + + add_executable (test_map65_q65b_timeout + ${CMAKE_SOURCE_DIR}/tests/unit/map65/test_map65_q65b_timeout.f90) + target_include_directories (test_map65_q65b_timeout PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries (test_map65_q65b_timeout PRIVATE m65impl) + add_test (NAME test_map65_q65b_timeout COMMAND test_map65_q65b_timeout) + set_tests_properties (test_map65_q65b_timeout PROPERTIES TIMEOUT 180) + + add_executable (test_map65_q65_dphi + ${CMAKE_SOURCE_DIR}/tests/unit/map65/test_map65_q65_dphi.f90) + target_include_directories (test_map65_q65_dphi PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_link_libraries (test_map65_q65_dphi PRIVATE m65impl) + file (MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test-map65-q65-dphi) + add_test (NAME test_map65_q65_dphi COMMAND test_map65_q65_dphi) + set_tests_properties (test_map65_q65_dphi PROPERTIES + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test-map65-q65-dphi + ENVIRONMENT "OMP_NUM_THREADS=1" + RUN_SERIAL TRUE + TIMEOUT 180) + +endif () + if (WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4) target_compile_definitions(m65impl PRIVATE _WIN32) elseif (WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 8) @@ -199,8 +328,8 @@ endif() add_executable (mapsim mapsim.f90) add_dependencies(mapsim m65impl) -target_include_directories(mapsim PRIVATE ${CMAKE_BINARY_DIR}/mod ) target_link_libraries (mapsim m65impl ${FFTW3_LIBRARIES}) +wsjt_add_simulator_usage_test (mapsim "Usage:[ ]+mapsim") #add_executable (synctest synctest.f90) #target_link_libraries (synctest m65impl ${FFTW3_LIBRARIES}) diff --git a/map65/libm65/afc65b.f90 b/map65/libm65/afc65b.f90 index 8083d924..e0ebfbc0 100644 --- a/map65/libm65/afc65b.f90 +++ b/map65/libm65/afc65b.f90 @@ -3,20 +3,31 @@ module afc65b_mod contains subroutine afc65b(cx,cy,npts,fsample,nflip,ipol,xpol,ndphi,a,ccfbest,dtbest) - use debug_log use fchisq_mod + use, intrinsic :: ieee_arithmetic, only: ieee_is_finite implicit none - - logical :: xpol - integer :: npts, nflip, ipol, ndphi - complex :: cx(npts), cy(npts) - real :: a(5), deltaa(5) - integer :: iter, j, nterms - real :: ccfbest, dtbest - real :: chisq1, chisq2, chisq3, chisqr, chisqr0 - real :: delta, dtmax, fn, tmp - real :: fsample, ccfmax + + integer, parameter :: MAX_STEP_TRIES = 200 + integer, parameter :: MAX_DOWNHILL_STEPS = 200 + real, parameter :: MIN_STEP = 1.0e-4 + real, parameter :: OBJECTIVE_REL_TOL = 1.0e-6 + + logical, intent(in) :: xpol + integer, intent(in) :: npts, nflip, ndphi + integer, intent(inout) :: ipol + complex, intent(in) :: cx(npts), cy(npts) + real, intent(inout) :: a(5) + real :: deltaa(5) + integer :: iter, j, nterms, step, downhill_steps + real, intent(out) :: ccfbest, dtbest + real :: chisq1, chisq2, chisqr, chisqr0 + real :: delta, dtmax + real, intent(in) :: fsample + real :: ccfmax + real :: x0, xlast, xprev, xbest, xnext, candidate + real :: flast, fprev, fbest, fnext, fcandidate, curvature, tolerance + logical :: bracketed, improved, have_previous ! Initial parameter guesses a(1) = 0.0 @@ -33,78 +44,143 @@ subroutine afc65b(cx,cy,npts,fsample,nflip,ipol,xpol,ndphi,a,ccfbest,dtbest) nterms = 3 if (xpol) nterms = 4 + if (ndphi /= 0) nterms = 3 ! don't fit pol when solving for dphi - ! Don't fit polarization when solving for dphi - if (ndphi /= 0) nterms = 3 + ccfbest = 0.0 + dtbest = 0.0 + chisqr0 = 0.0 + have_previous = .false. - ! Start the iteration - chisqr = 0.0 - chisqr0 = 1.0e6 + if (npts < 1 .or. fsample <= 0.0 .or. .not. ieee_is_finite(fsample)) return - do iter = 1, 3 ! One iteration is enough? + do iter = 1, 3 do j = 1, nterms + x0 = a(j) chisq1 = fchisq(cx,cy,npts,fsample,nflip,a,ccfmax,dtmax) - fn = 0.0 - delta = deltaa(j) + if (.not. ieee_is_finite(chisq1)) then + a(j) = x0 + cycle + endif - ! Find first step where chisq changes - do - a(j) = a(j) + delta + delta = abs(deltaa(j)) + if (.not. ieee_is_finite(delta) .or. delta < MIN_STEP) delta = MIN_STEP + improved = .false. + xlast = x0 + flast = chisq1 + xnext = xlast + + do step = 1, MAX_STEP_TRIES + xnext = xlast + delta + a(j) = xnext chisq2 = fchisq(cx,cy,npts,fsample,nflip,a,ccfmax,dtmax) - if (chisq2 /= chisq1) exit + if (.not. ieee_is_finite(chisq2)) exit + tolerance = OBJECTIVE_REL_TOL * max(1.0, abs(chisq1), abs(chisq2)) + if (abs(chisq2 - chisq1) > tolerance) then + xprev = xlast + fprev = flast + improved = .true. + exit + endif + xlast = xnext + flast = chisq2 end do - ! If we stepped uphill, reverse direction and swap labels + if (.not. improved) then + a(j) = x0 + deltaa(j) = max(MIN_STEP, 0.5*delta) + cycle + endif + if (chisq2 > chisq1) then - delta = -delta - a(j) = a(j) + delta - tmp = chisq1 - chisq1 = chisq2 - chisq2 = tmp + delta = -delta + xnext = x0 + delta + a(j) = xnext + chisq2 = fchisq(cx,cy,npts,fsample,nflip,a,ccfmax,dtmax) + tolerance = OBJECTIVE_REL_TOL * max(1.0, abs(chisq1), abs(chisq2)) + if (.not. ieee_is_finite(chisq2) .or. chisq2 >= chisq1 - tolerance) then + a(j) = x0 + deltaa(j) = max(MIN_STEP, 0.5*abs(delta)) + cycle + endif + xprev = x0 + fprev = chisq1 endif - ! Walk while chisq keeps improving - do - fn = fn + 1.0 - a(j) = a(j) + delta - chisq3 = fchisq(cx,cy,npts,fsample,nflip,a,ccfmax,dtmax) - if (chisq3 < chisq2) then - chisq1 = chisq2 - chisq2 = chisq3 + xbest = xnext + fbest = chisq2 + downhill_steps = 0 + bracketed = .false. + + do step = 1, MAX_DOWNHILL_STEPS + xnext = xbest + delta + a(j) = xnext + fnext = fchisq(cx,cy,npts,fsample,nflip,a,ccfmax,dtmax) + if (.not. ieee_is_finite(fnext)) then + a(j) = xbest + exit + endif + + tolerance = OBJECTIVE_REL_TOL * max(1.0, abs(fbest), abs(fnext)) + if (fnext < fbest - tolerance) then + xprev = xbest + fprev = fbest + xbest = xnext + fbest = fnext + downhill_steps = downhill_steps + 1 else + a(j) = xbest + bracketed = .true. exit endif end do - ! Guard against division by zero in flat regions - if (chisq3 == chisq2) cycle + if (bracketed) then + curvature = fprev - 2.0*fbest + fnext + tolerance = OBJECTIVE_REL_TOL * max(1.0, abs(fprev), abs(fbest), abs(fnext)) + if (curvature > tolerance) then + candidate = xbest + 0.5*delta*(fprev - fnext)/curvature + if (ieee_is_finite(candidate) .and. candidate > min(xprev, xnext) .and. & + candidate < max(xprev, xnext)) then + a(j) = candidate + fcandidate = fchisq(cx,cy,npts,fsample,nflip,a,ccfmax,dtmax) + if (ieee_is_finite(fcandidate)) then + tolerance = OBJECTIVE_REL_TOL * max(1.0, abs(fbest), abs(fcandidate)) + if (fcandidate < fbest - tolerance) then + xbest = candidate + fbest = fcandidate + endif + endif + endif + endif + endif - ! Find minimum of parabola defined by last three points - delta = delta*(1.0/(1.0 + (chisq1 - chisq2)/(chisq3 - chisq2)) + 0.5) - a(j) = a(j) - delta - deltaa(j) = deltaa(j)*fn/3.0 + a(j) = xbest + if (downhill_steps < 3) then + deltaa(j) = max(MIN_STEP, abs(delta)*max(1, downhill_steps)/3.0) + else + deltaa(j) = abs(delta) + endif enddo chisqr = fchisq(cx,cy,npts,fsample,nflip,a,ccfmax,dtmax) - if (chisqr/chisqr0 > 0.9999) exit + if (.not. ieee_is_finite(chisqr)) exit + if (have_previous) then + tolerance = OBJECTIVE_REL_TOL * max(1.0, abs(chisqr), abs(chisqr0)) + if (abs(chisqr - chisqr0) <= tolerance) exit + endif chisqr0 = chisqr + have_previous = .true. enddo - ccfbest = ccfmax * (1378.125/fsample)**2 - dtbest = dtmax - - ! Wrap polarization angle into [0,180) - if (a(4) < 0.0) a(4) = a(4) + 180.0 - if (a(4) >= 180.) a(4) = a(4) - 180.0 - if (nint(a(4)) == 180) a(4) = 0.0 + if (ieee_is_finite(ccfmax)) ccfbest = max(0.0, ccfmax * (1378.125/fsample)**2) + if (ieee_is_finite(dtmax)) dtbest = dtmax + if (.not. ieee_is_finite(ccfbest)) ccfbest = 0.0 + if (.not. ieee_is_finite(dtbest)) dtbest = 0.0 - if (a(4) < 0.0 .or. a(4) >= 180.0) then - ! print *, 'afc65b: bad a(4) after wrap, set to 0. was ', a(4) - a(4) = 0.0 - endif + if (.not. ieee_is_finite(a(4))) a(4) = 0.0 + a(4) = modulo(a(4), 180.0) - ipol = nint(a(4)/45.0) + 1 - if (ipol > 4) ipol = ipol - 4 + ipol = modulo(nint(a(4)/45.0), 4) + 1 end subroutine afc65b diff --git a/map65/libm65/astro.f90 b/map65/libm65/astro.f90 index d8304671..9ec92045 100644 --- a/map65/libm65/astro.f90 +++ b/map65/libm65/astro.f90 @@ -4,24 +4,24 @@ module astro_mod ! Sky temperature lookup table (was integer*2 nt144 + DATA + SAVE) integer(int16), parameter :: nt144(180) = [ & - 234_int16, 246_int16, 257_int16, 267_int16, 275_int16, 280_int16, 283_int16, 286_int16, 291_int16, 298_int16, & - 305_int16, 313_int16, 322_int16, 331_int16, 341_int16, 351_int16, 361_int16, 369_int16, 376_int16, 381_int16, & - 383_int16, 382_int16, 379_int16, 374_int16, 370_int16, 366_int16, 363_int16, 361_int16, 363_int16, 368_int16, & - 376_int16, 388_int16, 401_int16, 415_int16, 428_int16, 440_int16, 453_int16, 467_int16, 487_int16, 512_int16, & - 544_int16, 579_int16, 607_int16, 618_int16, 609_int16, 588_int16, 563_int16, 539_int16, 512_int16, 482_int16, & - 450_int16, 422_int16, 398_int16, 379_int16, 363_int16, 349_int16, 334_int16, 319_int16, 302_int16, 282_int16, & - 262_int16, 242_int16, 226_int16, 213_int16, 205_int16, 200_int16, 198_int16, 197_int16, 196_int16, 197_int16, & - 200_int16, 202_int16, 204_int16, 205_int16, 204_int16, 203_int16, 202_int16, 201_int16, 203_int16, 206_int16, & - 212_int16, 218_int16, 223_int16, 227_int16, 231_int16, 236_int16, 240_int16, 243_int16, 247_int16, 257_int16, & - 276_int16, 301_int16, 324_int16, 339_int16, 346_int16, 344_int16, 339_int16, 331_int16, 323_int16, 316_int16, & - 312_int16, 310_int16, 312_int16, 317_int16, 327_int16, 341_int16, 358_int16, 375_int16, 392_int16, 407_int16, & - 422_int16, 437_int16, 451_int16, 466_int16, 480_int16, 494_int16, 511_int16, 530_int16, 552_int16, 579_int16, & - 612_int16, 653_int16, 702_int16, 768_int16, 863_int16,1008_int16,1232_int16,1557_int16,1966_int16,2385_int16, & - 2719_int16,2924_int16,3018_int16,3038_int16,2986_int16,2836_int16,2570_int16,2213_int16,1823_int16,1461_int16, & - 1163_int16, 939_int16, 783_int16, 677_int16, 602_int16, 543_int16, 494_int16, 452_int16, 419_int16, 392_int16, & - 373_int16, 360_int16, 353_int16, 350_int16, 350_int16, 350_int16, 350_int16, 350_int16, 350_int16, 348_int16, & - 344_int16, 337_int16, 329_int16, 319_int16, 307_int16, 295_int16, 284_int16, 276_int16, 272_int16, 272_int16, & - 273_int16, 274_int16, 274_int16, 271_int16, 266_int16, 260_int16, 252_int16, 245_int16, 238_int16, 231_int16 ] + 234, 246, 257, 267, 275, 280, 283, 286, 291, 298, & + 305, 313, 322, 331, 341, 351, 361, 369, 376, 381, & + 383, 382, 379, 374, 370, 366, 363, 361, 363, 368, & + 376, 388, 401, 415, 428, 440, 453, 467, 487, 512, & + 544, 579, 607, 618, 609, 588, 563, 539, 512, 482, & + 450, 422, 398, 379, 363, 349, 334, 319, 302, 282, & + 262, 242, 226, 213, 205, 200, 198, 197, 196, 197, & + 200, 202, 204, 205, 204, 203, 202, 201, 203, 206, & + 212, 218, 223, 227, 231, 236, 240, 243, 247, 257, & + 276, 301, 324, 339, 346, 344, 339, 331, 323, 316, & + 312, 310, 312, 317, 327, 341, 358, 375, 392, 407, & + 422, 437, 451, 466, 480, 494, 511, 530, 552, 579, & + 612, 653, 702, 768, 863,1008,1232,1557,1966,2385, & + 2719,2924,3018,3038,2986,2836,2570,2213,1823,1461, & + 1163, 939, 783, 677, 602, 543, 494, 452, 419, 392, & + 373, 360, 353, 350, 350, 350, 350, 350, 350, 348, & + 344, 337, 329, 319, 307, 295, 284, 276, 272, 272, & + 273, 274, 274, 271, 266, 260, 252, 245, 238, 231 ] real(real32), parameter :: RAD2DEG = 57.2957795130823 real(real32), parameter :: C_KM_S = 2.99792458e5 @@ -56,7 +56,7 @@ contains real(real64) :: freq real :: RASun, DecSun real :: AzMoon, ElMoon, vr, dist - real(real64) :: xx, yy, poloffset1 = 0.0_real64, poloffset2 = 0.0_real64 + real(real64) :: xx, yy, poloffset1 = 0.0, poloffset2 = 0.0 real(real64) :: techo real(real32) :: el, eb integer :: longecl_half, t144 @@ -91,11 +91,7 @@ contains lon = -elon call sun(nyear,month,nday,uth,lon,lat,RASun,DecSun,LST,AzSun,ElSun,mjd,day) - - freq = real(nfreq,real64)*1.0e6_real64 - if (nfreq == 2) freq = 1.8e6_real64 - if (nfreq == 4) freq = 3.5e6_real64 - + freq = nfreq*1.0d6 call MoonDop(nyear,month,nday,uth,lon,lat,RAMoon,DecMoon,LST,HA, & AzMoon,ElMoon,vr,dist) @@ -106,40 +102,40 @@ contains if (NStation == 1) poloffset1 = RAD2DEG*atan2(yy,xx) if (NStation == 2) poloffset2 = RAD2DEG*atan2(yy,xx) - techo = 2.0_real64 * dist / C_KM_S + techo = 2.0 * dist / C_KM_S doppler = -freq*vr / C_KM_S call coord(0.,0.,-1.570796,1.161639, & RAMoon/RAD2DEG,DecMoon/RAD2DEG,el,eb) - longecl_half = nint(RAD2DEG*el/2.0_real64) + longecl_half = nint(RAD2DEG*el/2.0) if (longecl_half < 1 .or. longecl_half > 180) longecl_half = 180 t144 = nt144(longecl_half) - tsky = (real(t144,real64)-2.7_real64)*(144.0_real64/freq*1.0e-6_real64)**2.6_real64 + 2.7_real64 + tsky = (t144-2.7)*(144.0e6/freq)**2.6 + 2.7 xdop(NStation) = doppler if (NStation == 2) then HisGrid = MyGrid else - doppler00 = 2.0_real64*xdop(1) + doppler00 = 2.0*xdop(1) doppler = xdop(1) + xdop(2) - dbMoon = -40.0_real64*log10(dist/356903.0_real64) - sd = 16.23_real64*370152.0_real64/dist - - if (NStation == 1 .and. MoonDX /= 0.0_real64) then - poloffset = mod(poloffset2-poloffset1+720.0_real64,180.0_real64) - if (poloffset > 90.0_real64) poloffset = poloffset - 180.0_real64 - x1 = abs(cos(2.0_real64*poloffset/RAD2DEG)) - if (x1 < 0.056234_real64) x1 = 0.056234_real64 - xnr = -20.0_real64*log10(x1) - if (HisGrid(1:1) < 'A' .or. HisGrid(1:1) > 'R') xnr = 0.0_real64 + dbMoon = -40.0*log10(dist/356903.0) + sd = 16.23*370152.0/dist + + if (NStation == 1 .and. MoonDX /= 0.0) then + poloffset = mod(poloffset2-poloffset1+720.d0,180.d0) + if (poloffset > 90.0) poloffset = poloffset - 180.0 + x1 = abs(cos(2.0*poloffset/RAD2DEG)) + if (x1 < 0.056234) x1 = 0.056234 + xnr = -20.0*log10(x1) + if (HisGrid(1:1) < 'A' .or. HisGrid(1:1) > 'R') xnr = 0.0 end if - tr = 80.0_real64 - tskymin = 13.0_real64*(408.0_real64/freq*1.0e-6_real64)**2.6_real64 + tr = 80.0 + tskymin = 13.0*(408.0e6/freq)**2.6 tsysmin = tskymin + tr tsys = tsky + tr - Dgrd = -10.0_real64*log10(tsys/tsysmin) + dbMoon + Dgrd = -10.0*log10(tsys/tsysmin) + dbMoon end if AzMoon0 = AzMoon diff --git a/map65/libm65/astro0.f90 b/map65/libm65/astro0.f90 index 1501e2dc..f84c8bba 100644 --- a/map65/libm65/astro0.f90 +++ b/map65/libm65/astro0.f90 @@ -1,9 +1,9 @@ module astro0_state_mod use iso_fortran_env, only: real64 implicit none - real(real64) :: uth8z = 0.0_real64 - real(real64) :: dopplerz = 0.0_real64 - real(real64) :: doppler00z = 0.0_real64 + real(real64) :: uth8z = 0.0 + real(real64) :: dopplerz = 0.0 + real(real64) :: doppler00z = 0.0 end module astro0_state_mod @@ -77,7 +77,7 @@ contains AzMoon8 = AzMoon ElMoon8 = ElMoon dbMoon8 = dbMoon - RAMoon8 = RAMoon/15.0_real64 + RAMoon8 = RAMoon/15.0 DecMoon8 = DecMoon HA8 = HA Dgrd8 = Dgrd @@ -95,34 +95,34 @@ contains call tm2(real(day,8)+1.0/1440.0,xlat1,xlon1,xl1a,b1a) call tm2(real(day,8)+1.0/1440.0,xlat2,xlon2,xl2a,b2a) - fghz = 0.001_real64*real(nfreq,real64) + fghz = 0.001*real(nfreq,real64) dldt1 = DEGS*(xl1a-xl1) dbdt1 = DEGS*(b1a-b1) dldt2 = DEGS*(xl2a-xl2) dbdt2 = DEGS*(b2a-b2) - rate1 = 2.0_real64*sqrt(dldt1**2 + dbdt1**2) - width1 = 0.5_real64*6741.0_real64*fghz*rate1 + rate1 = 2.0*sqrt(dldt1**2 + dbdt1**2) + width1 = 0.5*6741.0*fghz*rate1 rate2 = sqrt((dldt1+dldt2)**2 + (dbdt1+dbdt2)**2) - width2 = 0.5_real64*6741.0_real64*fghz*rate2 + width2 = 0.5*6741.0*fghz*rate2 - fbend = 0.7_real64 - a2 = 0.0045_real64*log(fghz/fbend)/log(1.05_real64) - if (fghz < fbend) a2 = 0.0_real64 - f50 = 0.19_real64 * (fghz/fbend)**a2 - if (f50 > 1.0_real64) f50 = 1.0_real64 + fbend = 0.7 + a2 = 0.0045*log(fghz/fbend)/log(1.05) + if (fghz < fbend) a2 = 0.0 + f50 = 0.19 * (fghz/fbend)**a2 + if (f50 > 1.0) f50 = 1.0 w501 = f50*width1 w502 = f50*width2 ! df/dt using persistent state in astro0_state_mod - if (uth8z == 0.0_real64) then - uth8z = uth8 - 1.0_real64/3600.0_real64 + if (uth8z == 0.0) then + uth8z = uth8 - 1.0/3600.0 dopplerz = ndop_loc doppler00z = doppler00_loc end if - dt = 60.0_real64*(uth8-uth8z) - if (dt <= 0.0_real64) dt = 1.0_real64/60.0_real64 + dt = 60.0*(uth8-uth8z) + if (dt <= 0.0) dt = 1.0/60.0 dfdt = (ndop_loc - dopplerz )/dt dfdt0 = (doppler00_loc - doppler00z)/dt diff --git a/map65/libm65/ccf65.f90 b/map65/libm65/ccf65.f90 index 27a41f2f..2aa5228a 100644 --- a/map65/libm65/ccf65.f90 +++ b/map65/libm65/ccf65.f90 @@ -1,29 +1,37 @@ !------------------------------------------------------------------------------ -! NOTE: This module intentionally preserves the original legacy WSJT/MAP65 -! ccf65 implementation. Modernizing this routine changes the numerical -! behavior of the JT65 correlation (FFT layout, half-spectrum handling, -! baseline statistics, and sync metrics), which in turn produces a -! different false-positive/false-negative profile. Extensive testing -! shows that the legacy algorithm yields the correct and expected -! decode behavior, so it is retained here without modification. +! NOTE: This routine preserves the legacy JT65 correlation core. Its boundary +! validation and output defaults make degenerate inputs deterministic +! without changing the normal signal-processing path. !------------------------------------------------------------------------------ module ccf65_legacy_mod + implicit none contains subroutine ccf65(ss_plane, nhsym, ssmax, sync1, ipol1, jpz, dt1, flipk, & syncshort, snr2, ipol2, dt2) - use four2a_legacy_wrap_mod, only: r2c_legacy, c2r_legacy + use four2a_legacy_wrap_mod, only: r2c_legacy, c2r_legacy, JT65_NFFT, JT65_NH use pctile_mod, only: pctile + use, intrinsic :: ieee_arithmetic, only: ieee_is_finite + + implicit none + + integer, parameter :: NFFT = JT65_NFFT + integer, parameter :: NH = JT65_NH + integer, parameter :: MAX_NHSYM = 322 + + integer, intent(in) :: nhsym, jpz + real, intent(in) :: ssmax + real, intent(out) :: sync1, dt1, flipk, syncshort, snr2, dt2 + integer, intent(out) :: ipol1, ipol2 - parameter (NFFT=512,NH=NFFT/2) ! Modern interface: ! ss_plane(4,322) is passed as a proper 2-D slice (ss(:,:,i)) - real, intent(in) :: ss_plane(4,322) + real, intent(in) :: ss_plane(4,MAX_NHSYM) ! Legacy expects: real ss(4,322) passed by reference from ss(1,1,i) - real :: ss(4,322) + real :: ss(4,MAX_NHSYM) ! time-domain real :: s(NFFT) ! CCF = ss*pr @@ -37,12 +45,11 @@ subroutine ccf65(ss_plane, nhsym, ssmax, sync1, ipol1, jpz, dt1, flipk, & complex :: cpr(0:NH) ! Complex FT of pr complex :: cpr2(0:NH) ! Complex FT of pr2 - real tmp1(322) + real tmp1(MAX_NHSYM) real ccf(-11:54,4) - logical first integer npr(126) - data first/.true./ - save s,s2,pr,pr2,cs,cs2,cpr,cpr2 + integer :: i, j, k, ip, lag, lagpk, lagpk2, npol + real :: fac, base, ccfbest, ccfbest2, ccf2, sumccf, sq, rms ! The JT65 pseudo-random sync pattern: data npr/ & @@ -54,40 +61,48 @@ subroutine ccf65(ss_plane, nhsym, ssmax, sync1, ipol1, jpz, dt1, flipk, & 0,1,0,1,0,0,1,1,0,0,1,0,0,1,0,0,0,0,1,1, & 1,1,1,1,1,1/ - logical :: debug - debug = .false. ! (nhsym .gt. 300) - - ss = ss_plane - - if(first) then - fac=1.0/NFFT - do i=1,NFFT - pr(i)=0. - pr2(i)=0. - k=2*mod((i-1)/8,2)-1 - if(i.le.NH) pr2(i)=fac*k - enddo - do i=1,126 - j=2*i - pr(j)=fac*(2*npr(i)-1) -! pr(j-1)=pr(j) - enddo + sync1 = -4.0 + syncshort = -4.0 + snr2 = 0.01 + dt1 = 0.0 + dt2 = 0.0 + flipk = 1.0 + ipol1 = 1 + ipol2 = 1 - call r2c_legacy(pr, cpr, NFFT) - call r2c_legacy(pr2, cpr2, NFFT) + if (nhsym < 2 .or. nhsym > MAX_NHSYM) return + if (jpz < 1 .or. jpz > 4) return + if (.not. ieee_is_finite(ssmax)) return - first=.false. - endif + npol = jpz + ss = ss_plane + if (.not. all(ieee_is_finite(ss(1:npol,1:nhsym)))) return + + fac = 1.0/NFFT + do i=1,NFFT + pr(i)=0. + pr2(i)=0. + k=2*mod((i-1)/8,2)-1 + if(i.le.NH) pr2(i)=fac*k + enddo + do i=1,126 + j=2*i + pr(j)=fac*(2*npr(i)-1) + enddo + + call r2c_legacy(pr, cpr) + call r2c_legacy(pr2, cpr2) - syncshort=0. - snr2=0. + ccf = 0.0 ! Look for JT65 sync pattern and shorthand square-wave pattern. ccfbest=0. ccfbest2=0. ipol1=1 ipol2=1 - do ip=1,jpz !Do jpz polarizations + lagpk=0 + lagpk2=0 + do ip=1,npol !Do npol polarizations do i=1,nhsym-1 ! s(i)=ss(ip,i)+ss(ip,i+1) s(i)=min(ssmax,ss(ip,i)+ss(ip,i+1)) @@ -97,17 +112,17 @@ subroutine ccf65(ss_plane, nhsym, ssmax, sync1, ipol1, jpz, dt1, flipk, & s(nhsym:NFFT)=0. ! === Forward FFT: real ? packed half-spectrum === - call r2c_legacy(s, cs, NFFT) + call r2c_legacy(s, cs) ! === Multiply by sync patterns in frequency domain === do i=0,NH - cs2(i) = cs(i)*conjg(cpr2(i)) - cs(i) = cs(i)*conjg(cpr(i)) - enddo + cs2(i) = cs(i) * conjg(cpr2(i)) + cs(i) = cs(i) * conjg(cpr(i)) + enddo ! === Inverse FFT: packed half-spectrum ? real === - call c2r_legacy(cs, s, NFFT) - call c2r_legacy(cs2, s2, NFFT) + call c2r_legacy(cs, s) + call c2r_legacy(cs2, s2) do lag=-11,54 !Check for best JT65 sync j=lag @@ -122,9 +137,6 @@ subroutine ccf65(ss_plane, nhsym, ssmax, sync1, ipol1, jpz, dt1, flipk, & endif enddo -!### Not sure why this is ever true??? - if(sum(ccf).eq.0.0) return -!### do lag=-11,54 !Check for best shorthand ccf2=s2(lag+28) if(ccf2.gt.ccfbest2) then @@ -136,6 +148,8 @@ subroutine ccf65(ss_plane, nhsym, ssmax, sync1, ipol1, jpz, dt1, flipk, & enddo + if (.not. ieee_is_finite(ccfbest) .or. ccfbest <= 0.0) return + ! Find rms level on baseline of "ccfblue", for normalization. sumccf=0. do lag=-11,54 @@ -147,8 +161,10 @@ subroutine ccf65(ss_plane, nhsym, ssmax, sync1, ipol1, jpz, dt1, flipk, & if(abs(lag-lagpk).gt.1) sq=sq + (ccf(lag,ipol1)-base)**2 enddo rms=sqrt(sq/49.0) - sync1=-4.0 - if(rms.gt.0.0) sync1=ccfbest/rms - 4.0 + if (ieee_is_finite(rms) .and. rms > 0.0) then + sync1=ccfbest/rms - 4.0 + syncshort=0.5*ccfbest2/rms - 4.0 + endif dt1=lagpk*(2048.0/11025.0) - 2.5 ! Find base level for normalizing snr2. @@ -158,10 +174,11 @@ subroutine ccf65(ss_plane, nhsym, ssmax, sync1, ipol1, jpz, dt1, flipk, & call pctile(tmp1,nhsym,40,base) snr2=0.01 if(base.gt.0.0) snr2=0.398107*ccfbest2/base !### empirical - syncshort=0.5*ccfbest2/rms - 4.0 !### better normalizer than rms? dt2=2.5 + lagpk2*(2048.0/11025.0) - if (debug) write(logunit,*) 'QT?', 'sync1=', sync1, ' lagpk=', lagpk, ' dt1=', dt1,' snr2=',snr2 + if (.not. ieee_is_finite(sync1)) sync1 = -4.0 + if (.not. ieee_is_finite(syncshort)) syncshort = -4.0 + if (.not. ieee_is_finite(snr2)) snr2 = 0.01 return end subroutine ccf65 diff --git a/map65/libm65/cgen65.f90 b/map65/libm65/cgen65.f90 index ac0c14b2..6fcf98d6 100644 --- a/map65/libm65/cgen65.f90 +++ b/map65/libm65/cgen65.f90 @@ -21,7 +21,7 @@ subroutine cgen65(message,mode65,samfac,nsendingsh,msgsent,cwave,nwave) integer, intent(out) :: nsendingsh character(len=22),intent(out) :: msgsent - complex, intent(out) :: cwave(NMAX) + complex, intent(out) :: cwave(:) integer, intent(out) :: nwave !-------------------------------------------------------------------- @@ -106,7 +106,7 @@ subroutine cgen65(message,mode65,samfac,nsendingsh,msgsent,cwave,nwave) !-------------------------------------------------------------------- do i = 1, ndata t = t + dt - j = int(t / tsymbol) + 1 + j = min(nsym, int(t / tsymbol) + 1) if (j .ne. j0) then f = f0 diff --git a/map65/libm65/datcom_ptrs_mod.f90 b/map65/libm65/datcom_ptrs_mod.f90 index bcc8d41a..a507168e 100644 --- a/map65/libm65/datcom_ptrs_mod.f90 +++ b/map65/libm65/datcom_ptrs_mod.f90 @@ -6,6 +6,14 @@ module datcom_ptrs_mod real(c_float), pointer, contiguous :: dd(:,:) => null() ! [4, 5760000] real(c_float), pointer, contiguous :: ss(:,:,:) => null() ! [4, 322, NFFT] real(c_float), pointer, contiguous :: savg(:,:) => null() ! [4, NFFT] + real(c_float), pointer, contiguous :: dd_old(:,:) => null() ! [4, 5760000] + real(c_float), pointer, contiguous :: ss_old(:,:,:) => null() ! [4, 322, NFFT] + real(c_float), pointer, contiguous :: savg_old(:,:) => null() ! [4, NFFT] + + ! Pointers used by decode0 / narrowband decoder + real(c_float), pointer, contiguous :: dd_use(:,:) => null() + real(c_float), pointer, contiguous :: ss_use(:,:,:)=> null() + real(c_float), pointer, contiguous :: savg_use(:,:)=> null() ! Scalar values integer, parameter :: NFFT=32768 !Length of FFTs @@ -13,6 +21,12 @@ module datcom_ptrs_mod contains + subroutine snapshot_buffers() bind(C) + dd_old(:,:) = dd(:,:) + ss_old(:,:,:) = ss(:,:,:) + savg_old(:,:) = savg(:,:) + end subroutine + ! Helper subroutine to copy fixed-length Fortran string to C buffer subroutine move_chars(dest, dest_len, src) integer(c_int), intent(in) :: dest_len @@ -53,6 +67,33 @@ contains print *, "Fortran: savg pointer associated with dimensions", dim1, dim2 end subroutine + subroutine set_dd_old_ptr(ptr, dim1, dim2) bind(C, name="set_dd_old_ptr") + use iso_c_binding + implicit none + type(c_ptr), value :: ptr + integer(c_int), value :: dim1, dim2 + call c_f_pointer(ptr, dd_old, [dim1, dim2]) + print *, "Fortran: dd_old pointer associated with dimensions", dim1, dim2 + end subroutine + + subroutine set_ss_old_ptr(ptr, dim1, dim2, dim3) bind(C, name="set_ss_old_ptr") + use iso_c_binding + implicit none + type(c_ptr), value :: ptr + integer(c_int), value :: dim1, dim2, dim3 + call c_f_pointer(ptr, ss_old, [dim1, dim2, dim3]) + print *, "Fortran: ss_old pointer associated with dimensions", dim1, dim2, dim3 + end subroutine + + subroutine set_savg_old_ptr(ptr, dim1, dim2) bind(C, name="set_savg_old_ptr") + use iso_c_binding + implicit none + type(c_ptr), value :: ptr + integer(c_int), value :: dim1, dim2 + call c_f_pointer(ptr, savg_old, [dim1, dim2]) + print *, "Fortran: savg_old pointer associated with dimensions", dim1, dim2 + end subroutine + function get_junk1() bind(C, name="get_junk1") integer(c_int) :: get_junk1 get_junk1 = junk1 diff --git a/map65/libm65/debug_log.f90 b/map65/libm65/debug_log.f90 index 6b6a39e7..d91b969b 100644 --- a/map65/libm65/debug_log.f90 +++ b/map65/libm65/debug_log.f90 @@ -2,6 +2,7 @@ module debug_log implicit none integer, save :: dbg_unit = -1 logical, save :: dbg_opened = .false. + logical, save :: dbg_enabled = .false. ! master switch; set .true./.false. from run_m65 to enable/disable all dbg() output contains subroutine ensure_log_open() if (.not. dbg_opened) then @@ -10,9 +11,10 @@ contains dbg_opened = .true. end if end subroutine ensure_log_open - + subroutine dbg(msg) character(len=*), intent(in) :: msg + if (.not. dbg_enabled) return call ensure_log_open() write(dbg_unit,'(A)') trim(msg) flush(dbg_unit) diff --git a/map65/libm65/decode0.f90 b/map65/libm65/decode0.f90 index a84f67ea..26a90366 100644 --- a/map65/libm65/decode0.f90 +++ b/map65/libm65/decode0.f90 @@ -7,8 +7,9 @@ contains use iso_c_binding, only: c_int use timer_module, only: timer use npar_ptrs_mod - use datcom_ptrs_mod, only: NFFT, dd - use debug_log + use datcom_ptrs_mod, only: NFFT, dd, dd_old, dd_use, ss, ss_old, savg, savg_old, ss_use, savg_use + use debug_log, only: dbg, itoa, rtoa + use sec_midn_mod, only: sec_midn use map65a_mod use stdout_channel_mod, only: write_stdout use decodes_mod, only: ndecodes, nhsym1, nhsym2 @@ -16,34 +17,77 @@ contains implicit none - integer, parameter :: NSMAX = 60*96000 integer(c_int), intent(in) :: nstandalone integer hist(0:32768) integer i, j1, j2, j3, j4, m, mcall3b, ndphi, neme0, nsum integer :: ndecdone real :: tdec, tquick, rmsdd integer nz + integer :: nhsym0 + integer :: newdat0 character(len=128) :: line character mycall0*12, hiscall0*12, hisgrid0*6 - data neme0/-99/, mcall3b/1/, mycall0/' '/, hiscall0/' '/, hisgrid0/' '/ + logical :: first_mcall3b_check + + data neme0/-99/, mcall3b/0/, mycall0/' '/, hiscall0/' '/, hisgrid0/' '/ + data first_mcall3b_check/.true./ save + ! The decoder owns the claimed parameters until this call returns. + nhsym0 = nhsym + newdat0 = newdat + + ! TEMP diagnostic 2026-09-10 for the missing-final-pass / incomplete- + ! data-set investigation. + call dbg('decode0: ENTRY at t=' // rtoa(sec_midn()) // & + ' nhsym0=' // itoa(nhsym0) // ' newdat0=' // itoa(newdat0) // & + ' manualDecodeFlag=' // itoa(manualDecodeFlag) // & + ' nagain=' // itoa(nagain) // ' ndiskdat=' // itoa(ndiskdat)) + + ! newdat is forced to 1 by decode() for every call (manual or + ! automatic); it does not by itself mean "the live buffers just + ! finished a fresh accumulation." nagain=1 marks a manual repeat + ! (Decode button / Find Delta Phi), which must not refresh dd_old + ! from a live buffer that may still be mid-fill. + if (newdat0 /= 0 .and. manualDecodeFlag == 0 .and. nagain == 0) then + dd_old = dd + ss_old = ss + savg_old = savg + call dbg('decode0: dd_old REFRESHED from live dd at t=' // rtoa(sec_midn()) // ' nhsym0=' // itoa(nhsym0)) + else + call dbg('decode0: dd_old NOT refreshed (reusing prior snapshot) at t=' // rtoa(sec_midn()) // & + ' nhsym0=' // itoa(nhsym0) // ' nagain=' // itoa(nagain)) + endif + nkeep = 20 call sec0(0, tquick) call timer('decode0 ', 0) - if (newdat .ne. 0) then - nz = int(96000.0*nhsym/5.3833) + + ! Always decode from the snapshot (dd_old/ss_old/savg_old) taken above, + ! never the live dd/ss/savg. The nhsym2 pass routinely runs past the + ! minute boundary (several seconds), and symspec_() on the GUI thread + ! resets/overwrites the live buffers for the next cycle unconditionally + ! as soon as new UDP data arrives -- with no lock between the two + ! threads. Without this, a still-running decode reads a mix of this + ! cycle's and next cycle's data for candidates it hasn't reached yet + ! in its frequency sweep. + dd_use => dd_old + ss_use => ss_old + savg_use => savg_old + + if (newdat0 .ne. 0 .or. manualDecodeFlag /= 0) then + nz = int( real(nrate_active, kind=real64) * nhsym0 / 5.3833_real64 ) hist = 0 do i = 1, nz - j1 = int(min(abs(dd(1, i)), 32768.0)) + j1 = int(min(abs(dd_use(1, i)), 32768.0)) hist(j1) = hist(j1) + 1 - j2 = int(min(abs(dd(2, i)), 32768.0)) + j2 = int(min(abs(dd_use(2, i)), 32768.0)) hist(j2) = hist(j2) + 1 - j3 = int(min(abs(dd(3, i)), 32768.0)) + j3 = int(min(abs(dd_use(3, i)), 32768.0)) hist(j3) = hist(j3) + 1 - j4 = int(min(abs(dd(4, i)), 32768.0)) + j4 = int(min(abs(dd_use(4, i)), 32768.0)) hist(j4) = hist(j4) + 1 enddo m = 0 @@ -56,6 +100,17 @@ contains ndphi = 0 if (iand(nrxlog, 8) .ne. 0) ndphi = 1 + ! Seed mycall0/hiscall0/hisgrid0/neme0 from the real values on the + ! first call instead of blank sentinels, so the mismatch check below + ! only fires on a genuine later change, not on startup. + if (first_mcall3b_check) then + mycall0 = mycall + hiscall0 = hiscall + hisgrid0 = hisgrid + neme0 = neme + first_mcall3b_check = .false. + endif + if (mycall .ne. mycall0 .or. hiscall .ne. hiscall0 .or. & hisgrid .ne. hisgrid0 .or. mcall3 .ne. 0 .or. neme .ne. neme0) mcall3b = 1 @@ -64,30 +119,82 @@ contains hisgrid0 = hisgrid neme0 = neme + ! Manual decode: force a single nhsym2-style cycle and always emit DecodeFinished + if (manualDecodeFlag /= 0) then + nhsym0 = nhsym2 + call announce_decode_pass('manual') + + call timer('map65a ', 0) + call map65a(dd_use, newdat0, nutc, fcenter, ntol, idphi, nfa, nfb, & + mousedf, mousefqso, nagain, ndecdone, nfshift, ndphi, max_drift, & + nfcal, nkeep, mcall3b, nsum, nsave, nxant, mycall, mygrid, & + neme, ndepth, nstandalone, hiscall, hisgrid, nhsym0, nfsample, & + ndiskdat, nxpol, nmode, ndop00) + call timer('map65a ', 1) + call timer('decode0 ', 1) + + call sec0(1, tdec) + + write (line, '("",3I4,I6,F6.2,I5,1X,I0)') & + nsum, nsave, nstandalone, nhsym0, tdec, ndecodes, active_request_id + call write_stdout(trim(line)//new_line('a')) + + call dbg('decode0: MANUAL path RETURNING at t=' // rtoa(sec_midn())) + + return + + else + + ! Normal wideband path: nhsym1 (EarlyFinished) + nhsym2 (DecodeFinished) + if (ndiskdat /= 0) then + call announce_decode_pass('disk') + else if (nhsym0 == nhsym1) then + call announce_decode_pass('early') + else if (nhsym0 == nhsym2) then + call announce_decode_pass('final') + else + call announce_decode_pass('unknown') + endif call timer('map65a ', 0) - call map65a(dd, newdat, nutc, fcenter, ntol, idphi, nfa, nfb, & + call map65a(dd_use, newdat0, nutc, fcenter, ntol, idphi, nfa, nfb, & mousedf, mousefqso, nagain, ndecdone, nfshift, ndphi, max_drift, & nfcal, nkeep, mcall3b, nsum, nsave, nxant, mycall, mygrid, & - neme, ndepth, nstandalone, hiscall, hisgrid, nhsym, nfsample, & + neme, ndepth, nstandalone, hiscall, hisgrid, nhsym0, nfsample, & ndiskdat, nxpol, nmode, ndop00) call timer('map65a ', 1) call timer('decode0 ', 1) call sec0(1, tdec) - if (nhsym == nhsym1) then + if (nhsym0 == nhsym1) then write (line, '("",3I4,I6,F6.2)') & - nsum, nsave, nstandalone, nhsym, tdec + nsum, nsave, nstandalone, nhsym0, tdec call write_stdout(trim(line)//new_line('a')) end if - if (nhsym == nhsym2) then - write (line, '("",3I4,I6,F6.2,I5)') & - nsum, nsave, nstandalone, nhsym, tdec, ndecodes + ! A manual repeat decode (Decode button / Find Delta Phi) is always a + ! single, complete request regardless of nhsym, which only reflects + ! the automatic per-minute cycle and may never equal nhsym2 if no + ! automatic decode has run yet this session. + if (nhsym0 == nhsym2 .or. nagain /= 0) then + write (line, '("",3I4,I6,F6.2,I5,1X,I0)') & + nsum, nsave, nstandalone, nhsym0, tdec, ndecodes, active_request_id call write_stdout(trim(line)//new_line('a')) end if -! print *, 'nhsym is: ',nhsym,' nhsym1 is: ',nhsym1,' nhsym2 is: ',nhsym2 + + call dbg('decode0: WIDEBAND path RETURNING at t=' // rtoa(sec_midn())) + return + end if end subroutine decode0 + subroutine announce_decode_pass(pass_name) + use stdout_channel_mod, only: write_stdout + implicit none + + character(len=*), intent(in) :: pass_name + + call write_stdout(' '//trim(pass_name)//new_line('a')) + end subroutine announce_decode_pass + end module decode0_mod diff --git a/map65/libm65/decode1a.f90 b/map65/libm65/decode1a.f90 index ab981524..691593fd 100644 --- a/map65/libm65/decode1a.f90 +++ b/map65/libm65/decode1a.f90 @@ -21,11 +21,12 @@ subroutine decode1a(dd,newdat,f0,nflip,mode65,nfsample,xpol, & use timf2_mod use fil6521_mod use twkfreq_xy_mod + use npar_ptrs_mod, only: nsmax_active + use sec_midn_mod, only: sec_midn implicit none - integer, parameter :: NMAX = 60*96000 !Samples per 60 s - real(real32), intent(in) :: dd(4, NMAX) !92 MB: raw data from Linrad timf2 + real(real32), intent(in) :: dd(4, nsmax_active) !92 MB: raw data from Linrad timf2 integer, intent(in) :: nflip, mode65, nfsample logical, intent(in) :: xpol character(len=12), intent(in) :: mycall, hiscall @@ -33,40 +34,47 @@ subroutine decode1a(dd,newdat,f0,nflip,mode65,nfsample,xpol, & integer, intent(in) :: neme, ndepth, nqd, ndphi real, intent(in) :: dphi real(real64), intent(in) :: f0 - integer, intent(in) :: nutc, nkhz, ndf, ipol, ntol + integer, intent(in) :: nutc, nkhz, ndf, ntol + integer, intent(inout) :: ipol real, intent(inout):: sync2, a(5), dt, pol, qual integer, intent(inout):: nkv, nhist, nsum, nsave, newdat character(len=22), intent(out) :: decoded - complex cx(NMAX/64), cy(NMAX/64) !Data at 1378.125 samples/s - complex c5x(NMAX/256),c5y(NMAX/256) !Data at 344.53125 Hz + complex cx(nsmax_active/64), cy(nsmax_active/64) !Data at 1378.125 samples/s + complex c5x(nsmax_active/256), c5y(nsmax_active/256) !Data at 344.53125 Hz + complex c5a(512) complex z real s2(66,126) real s3(64,63),sy(63) real :: aa, bb, ccfbest, dt00, flip - real :: dtbest, fsample, sq0, sqa, sqb, syncbest, xdt + real :: dtbest, fsample, sq0, sqa, sqb, syncbest integer :: i, i0, ihzdiff, j, jj, jjjmax, jjjmin, k, n, n5 integer :: n6, nadd, nfft, nhz, nhz0, npol, nsym, nutc0, nz logical first + +! real(kind=8) :: s2sum, s2mean +! integer :: ii,kk ! real(c_double), dimension(*) :: dd data first/.true./,jjjmin/1000/,jjjmax/-1000/ data nutc0/-999/,nhz0/-9999999/ save - + ! Mix sync tone to baseband, low-pass filter, downsample to 1378.125 Hz dt00=dt call timer('filbig ',0) - + if (.not. ieee_is_finite(f0)) then write(*,*) 'DECODE1A: bad f0, skipping filbig. f0=', f0 return end if - call filbig(dd,NMAX,f0,newdat,nfsample,xpol,cx,cy,n5) -! NB: cx, cy have sample rate 96000*77125/5376000 = 1378.125 Hz + call filbig(dd, nsmax_active, f0, newdat, nfsample, xpol, cx, cy, n5) + call timer('filbig ',1) + +! NB: cx, cy have sample rate 96000*77125/5376000 = 1378.125 Hz if(mode65.eq.0) return sqa=0. sqb=0. @@ -89,10 +97,14 @@ subroutine decode1a(dd,newdat,f0,nflip,mode65,nfsample,xpol, & if(xpol) then c5y(:nadd)=0. call fil6521(cy,n5,c5y(nadd+1),n6) + else + c5y(:n6+nadd)=0. endif n6=n6+nadd - fsample=1378.125/4. + ! JT65 uses quarter-rate for symbol timing + fsample = 1378.125/4.0 + a(5)=dt00 i0=nint((a(5)+0.5)*fsample) - 2 + nadd if(i0.lt.1) then @@ -102,16 +114,43 @@ subroutine decode1a(dd,newdat,f0,nflip,mode65,nfsample,xpol, & endif nz=n6+1-i0 + ! 2026-09-12: instrumentation for the "identical anomalous dtbest despite + ! identical, legitimate dt00" investigation. dt00 itself is now confirmed + ! correct and consistent between working (nqd=1) and failing (nqd=0) + ! decodes of the same signal (traced to ccf65's lagpk, a genuine + ! correlation-peak lag, not a fallback constant) -- so the actual sample + ! window afc65b searches (c5x/c5y from i0 to i0+nz-1) is the next place to + ! look. Logging i0/nz and a cheap fingerprint (sum of magnitudes) of that + ! exact window so a live capture can show directly whether the underlying + ! data itself differs between a working and failing case. + if (nz .ge. 1 .and. i0 .ge. 1 .and. i0 + nz - 1 .le. nsmax_active/256) then + call dbg('decode1a: pre-afc65b at t=' // rtoa(sec_midn()) // & + ' i0=' // itoa(i0) // ' nz=' // itoa(nz) // ' n5=' // itoa(n5) // & + ' n6=' // itoa(n6) // ' dt00=' // rtoa(dt00) // & + ' c5x_sum_abs=' // rtoa(sum(abs(c5x(i0:i0+nz-1)))) // & + ' c5x_i0=' // rtoa(real(c5x(i0))) // ',' // rtoa(aimag(c5x(i0)))) + else + call dbg('decode1a: pre-afc65b at t=' // rtoa(sec_midn()) // & + ' i0=' // itoa(i0) // ' nz=' // itoa(nz) // ' (OUT OF RANGE, skipping fingerprint)') + endif + ! We're looking only at sync tone here... so why not downsample by another ! factor of 1/8, say? Should be a significant execution speed-up. ! Best fit for DF, f1, f2, pol - call afc65b(c5x(i0),c5y(i0),nz,fsample,nflip,ipol,xpol,ndphi,a,ccfbest,dtbest) +call afc65b(c5x(i0), c5y(i0), nz, fsample, nflip, ipol, xpol, ndphi, a, ccfbest, dtbest) pol=a(4)/57.2957795 aa=cos(pol) bb=sin(pol) sq0=aa*aa*sqa + bb*bb*sqb sync2=3.7*ccfbest/sq0 + + ! TEMP diagnostic 2026-09-10 for the freq/time-sync-vs-false-decode investigation. + call dbg('decode1a: afc65b fit at t=' // rtoa(sec_midn()) // & + ' f0=' // rtoa(real(f0)) // ' dt00=' // rtoa(dt00) // ' dtbest=' // rtoa(dtbest) // & + ' ccfbest=' // rtoa(ccfbest) // ' a1(df)=' // rtoa(a(1)) // ' a2=' // rtoa(a(2)) // & + ' a3=' // rtoa(a(3)) // ' a4(pol_deg)=' // rtoa(a(4)) // ' sync2=' // rtoa(sync2) // & + ' nflip=' // itoa(nflip) // ' ipol=' // itoa(ipol)) ! Apply AFC corrections to the time-domain signal ! Now we are back to using the 1378.125 Hz sample rate, enough to @@ -126,7 +165,9 @@ subroutine decode1a(dd,newdat,f0,nflip,mode65,nfsample,xpol, & nsym=126 nfft=512 - j=(dt00+dtbest+2.685)*1378.125 + j = (dt00 + dtbest + 2.685)*1378.125 +! fs_out = real(n5) / 60.0 ! actual sample rate from filbig +! j = (dt00 + dtbest + 2.685) * fs_out if(j.lt.0) j=0 @@ -137,7 +178,7 @@ subroutine decode1a(dd,newdat,f0,nflip,mode65,nfsample,xpol, & ! do n=1,mode65 do n=1,1 do i=1,nfft - j=min(j+1,NMAX/64) + j = min(j+1, nsmax_active/64) c5a(i)=aa*cx(j) + bb*cy(j) enddo call four2a(c5a,nfft,1,1,1) @@ -159,8 +200,22 @@ subroutine decode1a(dd,newdat,f0,nflip,mode65,nfsample,xpol, & flip=nflip call timer('dec65b ',0) + +! After filling s2(66,126), just before: +! call decode65b(...) + +!s2sum = 0.0d0 +!do kk = 1, nsym +! do ii = 1, 66 +! s2sum = s2sum + dble(s2(ii,kk)) +! end do +!end do + +!s2mean = s2sum / dble(66*nsym) + call decode65b(s2,flip,mycall,hiscall,hisgrid,mode65,neme,ndepth, & nqd,nkv,nhist,qual,decoded,s3,sy) + dt=dt00 + dtbest + 1.7 call timer('dec65b ',1) @@ -173,7 +228,7 @@ subroutine decode1a(dd,newdat,f0,nflip,mode65,nfsample,xpol, & nsave=mod(nsave-1,64)+1 npol=nint(57.296*pol) - call s3avg(nsave,mode65,nutc,nhz,xdt,npol,ntol,s3,nsum,nkv,decoded) + call s3avg(nsave,mode65,nutc,nhz,dt,npol,nflip,ntol,s3,nsum,nkv,decoded) syncbest=sync2 nhz0=nhz endif diff --git a/map65/libm65/decode65b.f90 b/map65/libm65/decode65b.f90 index 93166de0..694cbccb 100644 --- a/map65/libm65/decode65b.f90 +++ b/map65/libm65/decode65b.f90 @@ -9,6 +9,7 @@ subroutine decode65b(s2,flip,mycall,hiscall,hisgrid,mode65,neme,ndepth, & use extract_mod use pr_mod use setup65_mod + use debug_log, only: dbg, itoa real, intent(in) :: s2(66,126) real, intent(out) :: s3(64,63), sy(63) @@ -61,13 +62,33 @@ subroutine decode65b(s2,flip,mycall,hiscall,hisgrid,mode65,neme,ndepth, & decoded=' ' endif + ! TEMP diagnostic 2026-09-10 for the false-JT65-decode investigation. + call dbg('decode65b: extract() done, ncount=' // itoa(ncount) // ' nkv=' // itoa(nkv) // & + ' hard_decoded="' // trim(decoded) // '" nqd=' // itoa(nqd) // ' flip=' // itoa(nint(flip)) // & + ' ndepth=' // itoa(ndepth) // & + ' will_run_deep65=' // itoa(merge(1,0, ndepth.ge.1 .and. (nqd.eq.1 .or. flip.eq.1.0)))) + qual=0. if(ndepth.ge.1 .and. (nqd.eq.1 .or. flip.eq.1.0)) then call deep65(s3,mode65,neme,flip,mycall,hiscall,hisgrid,deepmsg,qual,mrs,mrs2) if(nqd.ne.1 .and. qual.lt.10.0) qual=0.0 if(ndepth.lt.2 .and. qual.lt.6.0) qual=0.0 endif - if(nkv.eq.0 .and. qual.ge.1.0) decoded=deepmsg + + ! Deep Search's AP guess overrides extract()'s hard decode whenever + ! qual.ge.1.0, regardless of nkv (whether extract() itself reported + ! success). A "successful" hard Reed-Solomon decode doesn't guarantee a + ! real message -- JT65's RS code has a nonzero false-positive rate, and a + ! qual.ge.1.0 Deep Search match is far more likely to be correct than a + ! false RS accept. This cutoff is not immune to a low-but-nonzero + ! marginal-qual false accept of its own; see the PR's false-decode-rate + ! discussion for known residual cases. + if (qual.ge.1.0) then + decoded=deepmsg + nkv=0 + endif + + call dbg('decode65b: final decoded="' // trim(decoded) // '" nkv=' // itoa(nkv) // ' qual=' // itoa(nint(qual))) return end subroutine decode65b diff --git a/map65/libm65/decode_request_mutex.cpp b/map65/libm65/decode_request_mutex.cpp new file mode 100644 index 00000000..999512e6 --- /dev/null +++ b/map65/libm65/decode_request_mutex.cpp @@ -0,0 +1,15 @@ +#include + +namespace { +std::mutex request_mutex; +} + +extern "C" void lock_decode_requests() +{ + request_mutex.lock(); +} + +extern "C" void unlock_decode_requests() +{ + request_mutex.unlock(); +} diff --git a/map65/libm65/decodes_mod.f90 b/map65/libm65/decodes_mod.f90 index 03c84069..3479fbb4 100644 --- a/map65/libm65/decodes_mod.f90 +++ b/map65/libm65/decodes_mod.f90 @@ -1,23 +1,43 @@ module decodes_mod - implicit none + use npar_ptrs_mod, only: nfft_active - integer, parameter :: NLD = 32768 - ! from decodes - integer :: ndecodes = 0 - - !from early - integer :: nhsym1 = 0, nhsym2 = 0 + implicit none - logical, allocatable :: ldecoded(:) - - !from c3com - integer :: mcall3a = 0 + integer :: ndecodes = 0 + integer :: nhsym1 = 0, nhsym2 = 0 + logical, allocatable :: ldecoded(:) + ! JT65 bins already decoded in this accumulation cycle. Retaining them + ! across early/final calls avoids reporting the same signal twice; + ! select_unique_decodes() only compares results within one call. + logical, allocatable :: ljt65decoded(:) + integer :: mcall3a = 0 - contains +contains - subroutine decodes_init() - if (.not. allocated(ldecoded)) allocate(ldecoded(NLD)) - end subroutine decodes_init + subroutine decodes_init() + ! (Re)allocate ldecoded/ljt65decoded to match the active symspec FFT length. + if (allocated(ldecoded)) then + if (size(ldecoded) /= nfft_active) then + deallocate(ldecoded) + end if + end if + + if (.not. allocated(ldecoded)) then + allocate(ldecoded(nfft_active)) + ldecoded = .false. + end if + + if (allocated(ljt65decoded)) then + if (size(ljt65decoded) /= nfft_active) then + deallocate(ljt65decoded) + end if + end if + + if (.not. allocated(ljt65decoded)) then + allocate(ljt65decoded(nfft_active)) + ljt65decoded = .false. + end if + end subroutine decodes_init end module decodes_mod diff --git a/map65/libm65/deep65.f90 b/map65/libm65/deep65.f90 index ccd04d26..dfe83751 100644 --- a/map65/libm65/deep65.f90 +++ b/map65/libm65/deep65.f90 @@ -1,12 +1,185 @@ module deep65_mod implicit none + + ! MAXCALLS/testmsg/ncode/callgrid/pp/ntot are module-scoped so that a + ! separate subroutine, build_call3_candidates() below, can be called once + ! eagerly from run_m65.f90 at startup and build the same cached candidate + ! list before the decoder ever needs it, instead of the first real decode + ! paying for it. + integer, parameter :: MAXRPT = 63 + integer, save :: MAXCALLS = 0, narr = 0, ntot = 0 + character(len=22), allocatable, save :: testmsg(:) + character(len=15), allocatable, save :: callgrid(:) + integer, allocatable, save :: ncode(:,:) + real, allocatable, save :: pp(:) + character(len=12), save :: cached_mycall = '', cached_hiscall = '' + character(len=6), save :: cached_hisgrid = '' + integer, save :: cached_neme = 0 + contains + ! Encoding the full CALL3.TXT list is expensive. Reuse candidates only + ! while the file and their station settings match. + subroutine build_call3_candidates(mycall, hiscall, hisgrid, neme) + use decodes_mod, only: mcall3a + use encode65_mod + use debug_log, only: dbg, itoa, rtoa + use sec_midn_mod, only: sec_midn + use timer_module, only: timer + implicit none + + character(len=12), intent(in) :: mycall, hiscall + character(len=6), intent(in) :: hisgrid + integer, intent(in) :: neme + + character callsign*12, grid*4, message*22, ceme*3 + character(len=180) line + character(len=4) :: rpt(MAXRPT) + integer :: nlines_in_file, ios + integer :: i, i1, i2, i3, icall, k, j1, j2, j3, j4, m, mz, n + + data rpt/'-01','-02','-03','-04','-05', & + '-06','-07','-08','-09','-10', & + '-11','-12','-13','-14','-15', & + '-16','-17','-18','-19','-20', & + '-21','-22','-23','-24','-25', & + '-26','-27','-28','-29','-30', & + 'R-01','R-02','R-03','R-04','R-05', & + 'R-06','R-07','R-08','R-09','R-10', & + 'R-11','R-12','R-13','R-14','R-15', & + 'R-16','R-17','R-18','R-19','R-20', & + 'R-21','R-22','R-23','R-24','R-25', & + 'R-26','R-27','R-28','R-29','R-30', & + 'RO','RRR','73'/ + save rpt + + call dbg('build_call3_candidates: entry, mcall3a=' // itoa(mcall3a) // ' cached ntot=' // itoa(ntot)) + + if (mcall3a.eq.0 .and. allocated(testmsg) .and. & + mycall.eq.cached_mycall .and. hiscall.eq.cached_hiscall .and. & + hisgrid.eq.cached_hisgrid .and. neme.eq.cached_neme) return + + k = 0 + ntot = 0 + + call timer('deep65a ', 0) + mcall3a = 0 + + ! CALL3.TXT is normally already open on unit 23 by the time map65a() + ! calls deep65() (see map65a.f90's own open() near its top, run before + ! every decode). When this is called eagerly from run_m65.f90, before + ! any decode has happened, nothing has opened it yet -- open it here + ! too. Re-opening an already-open unit on the same file is harmless. + !### Should use AppDir! ### + open (23, file='CALL3.TXT', status='unknown') + + ! Count actual lines in CALL3.TXT so the candidate-list arrays can be + ! sized to fit the whole file, then size arrays large enough for every + ! line to become a real candidate, generously covering the n=1 + ! (hiscall) special case that can expand into up to MAXRPT+1 + ! report-message variants. + rewind 23 + nlines_in_file = 0 + do + read(23, '(A)', iostat=ios) line + if (ios /= 0) exit + nlines_in_file = nlines_in_file + 1 + end do + rewind 23 + + MAXCALLS = max(nlines_in_file + 1, 100) ! +1 for the n=1 hiscall slot + narr = 2*(MAXCALLS + MAXRPT + 1) + + if (allocated(testmsg)) deallocate(testmsg) + if (allocated(ncode)) deallocate(ncode) + if (allocated(callgrid)) deallocate(callgrid) + if (allocated(pp)) deallocate(pp) + allocate(testmsg(narr)) + allocate(ncode(63,narr)) + allocate(callgrid(MAXCALLS)) + allocate(pp(narr)) + + call dbg('build_call3_candidates: rebuilding candidate list, nlines_in_file=' // itoa(nlines_in_file) // & + ' MAXCALLS=' // itoa(MAXCALLS)) + call dbg('build_call3_candidates: candidate-encoding loop STARTING at t=' // rtoa(sec_midn())) + + k=0 + icall=0 + do n=1,MAXCALLS + if(n.eq.1) then + callsign=hiscall + do i=4,12 + if(ichar(callsign(i:i)).eq.0) callsign(i:i)=' ' + enddo + grid=hisgrid(1:4) + if(ichar(grid(3:3)).eq.0) grid(3:3)=' ' + if(ichar(grid(4:4)).eq.0) grid(4:4)=' ' + else + read(23,1002,end=20) line +1002 format (A80) + if(line(1:4).eq.'ZZZZ') go to 20 + if(line(1:2).eq.'//') go to 10 + i1=index(line,',') + if(i1.lt.4) go to 10 + i2=index(line(i1+1:),',') + if(i2.lt.5) go to 10 + i2=i2+i1 + i3=index(line(i2+1:),',') + if(i3.lt.1) i3=index(line(i2+1:),' ') + i3=i2+i3 + callsign=line(1:i1-1) + grid=line(i1+1:i2-1) + ceme=line(i2+1:i3-1) + if(neme.eq.1 .and. ceme.ne.'EME') go to 10 + endif + + icall=icall+1 + j1=index(mycall,' ') - 1 + if(j1.le.-1) j1=12 + if(j1.lt.3) j1=6 + j2=index(callsign,' ') - 1 + if(j2.le.-1) j2=12 + if(j2.lt.3) j2=6 + j3=index(mycall,'/') ! j3>0 means compound mycall + j4=index(callsign,'/') ! j4>0 means compound hiscall + callgrid(icall)=callsign(1:j2) + + mz=1 +! Allow MyCall + HisCall + rpt (?) + if(n.eq.1 .and. j3.lt.1 .and. j4.lt.1 .and. callsign(1:6).ne.' ') & + mz=MAXRPT+1 + do m=1,mz + if(m.gt.1) grid=rpt(m-1) + if(j3.lt.1 .and.j4.lt.1) callgrid(icall)=callsign(1:j2)//' '//grid + message=mycall(1:j1)//' '//callgrid(icall) + k=k+1 + testmsg(k)=message + call encode65(message,ncode(1,k)) + +! Insert CQ message + if(j4.lt.1) callgrid(icall)=callsign(1:j2)//' '//grid + message='CQ '//callgrid(icall) + k=k+1 + testmsg(k)=message + call encode65(message,ncode(1,k)) + enddo +10 continue + enddo + +20 continue + ntot=k + cached_mycall=mycall + cached_hiscall=hiscall + cached_hisgrid=hisgrid + cached_neme=neme + call timer('deep65a ',1) + call dbg('build_call3_candidates: candidate-encoding loop DONE at t=' // rtoa(sec_midn()) // ' ntot=' // itoa(ntot)) + end subroutine build_call3_candidates + subroutine deep65(s3,mode65,neme,flip,mycall,hiscall,hisgrid,decoded,qual,mrs,mrs2) - use timer_module, only: timer - use decodes_mod, only: mcall3a - use encode65_mod + use timer_module, only: timer + use debug_log, only: dbg, itoa implicit none real, intent(in) :: s3(64,63) @@ -18,110 +191,28 @@ subroutine deep65(s3,mode65,neme,flip,mycall,hiscall,hisgrid,decoded,qual,mrs,mr real, intent(out) :: qual integer, intent(in) :: mrs(63), mrs2(63) - - integer,parameter :: MAXCALLS=10000,MAXRPT=63 - character callsign*12,grid*4,message*22,c*1,ceme*3 character(len=22) bestmsg - character(len=22) testmsg(2*MAXCALLS + 2 + MAXRPT) - character(len=15) callgrid(MAXCALLS) - character(len=180) line - character(len=4) rpt(MAXRPT) - integer ncode(63,2*MAXCALLS + 2 + MAXRPT) - integer i,i1,i2,i3,icall,ip1,k,j,j1,j2,j3,j4,m - integer mz,n,ntot + character c*1 + integer i,ip1,j,k real bias,p,p1,p2,ref,ref0,sum - real pp(2*MAXCALLS + 2 + MAXRPT) - data rpt/'-01','-02','-03','-04','-05', & - '-06','-07','-08','-09','-10', & - '-11','-12','-13','-14','-15', & - '-16','-17','-18','-19','-20', & - '-21','-22','-23','-24','-25', & - '-26','-27','-28','-29','-30', & - 'R-01','R-02','R-03','R-04','R-05', & - 'R-06','R-07','R-08','R-09','R-10', & - 'R-11','R-12','R-13','R-14','R-15', & - 'R-16','R-17','R-18','R-19','R-20', & - 'R-21','R-22','R-23','R-24','R-25', & - 'R-26','R-27','R-28','R-29','R-30', & - 'RO','RRR','73'/ + integer :: n_g4swx, n_dg2ycb + data ip1/1/ ! Default safety, in case ntot ends up 0 the very first time save - if(mcall3a.eq.0) go to 30 - k = 0 - ntot = 0 - ip1 = 1 ! Default safety - - call timer('deep65a ',0) - mcall3a=0 - rewind 23 - k=0 - icall=0 - do n=1,MAXCALLS - if(n.eq.1) then - callsign=hiscall - do i=4,12 - if(ichar(callsign(i:i)).eq.0) callsign(i:i)=' ' - enddo - grid=hisgrid(1:4) - if(ichar(grid(3:3)).eq.0) grid(3:3)=' ' - if(ichar(grid(4:4)).eq.0) grid(4:4)=' ' - else - read(23,1002,end=20) line -1002 format (A80) - if(line(1:4).eq.'ZZZZ') go to 20 - if(line(1:2).eq.'//') go to 10 - i1=index(line,',') - if(i1.lt.4) go to 10 - i2=index(line(i1+1:),',') - if(i2.lt.5) go to 10 - i2=i2+i1 - i3=index(line(i2+1:),',') - if(i3.lt.1) i3=index(line(i2+1:),' ') - i3=i2+i3 - callsign=line(1:i1-1) - grid=line(i1+1:i2-1) - ceme=line(i2+1:i3-1) - if(neme.eq.1 .and. ceme.ne.'EME') go to 10 - endif + call build_call3_candidates(mycall, hiscall, hisgrid, neme) - icall=icall+1 - j1=index(mycall,' ') - 1 - if(j1.le.-1) j1=12 - if(j1.lt.3) j1=6 - j2=index(callsign,' ') - 1 - if(j2.le.-1) j2=12 - if(j2.lt.3) j2=6 - j3=index(mycall,'/') ! j3>0 means compound mycall - j4=index(callsign,'/') ! j4>0 means compound hiscall - callgrid(icall)=callsign(1:j2) - - mz=1 -! Allow MyCall + HisCall + rpt (?) - if(n.eq.1 .and. j3.lt.1 .and. j4.lt.1 .and. callsign(1:6).ne.' ') & - mz=MAXRPT+1 - do m=1,mz - if(m.gt.1) grid=rpt(m-1) - if(j3.lt.1 .and.j4.lt.1) callgrid(icall)=callsign(1:j2)//' '//grid - message=mycall(1:j1)//' '//callgrid(icall) - k=k+1 - testmsg(k)=message - call encode65(message,ncode(1,k)) - -! Insert CQ message - if(j4.lt.1) callgrid(icall)=callsign(1:j2)//' '//grid - message='CQ '//callgrid(icall) - k=k+1 - testmsg(k)=message - call encode65(message,ncode(1,k)) - enddo -10 continue - enddo - -20 continue - ntot=k - call timer('deep65a ',1) - -30 continue + ! TEMP diagnostic 2026-09-10: confirm whether the currently-loaded candidate + ! list (whether just rebuilt or reused from cache) actually contains the + ! callsigns known to be in CALL3.TXT right now. + n_g4swx = 0 + n_dg2ycb = 0 + do k = 1, ntot + if (index(testmsg(k), 'G4SWX') > 0) n_g4swx = n_g4swx + 1 + if (index(testmsg(k), 'DG2YCB') > 0) n_dg2ycb = n_dg2ycb + 1 + end do + call dbg('deep65: about to score, ntot=' // itoa(ntot) // & + ' n_g4swx_in_list=' // itoa(n_g4swx) // & + ' n_dg2ycb_in_list=' // itoa(n_dg2ycb)) call timer('deep65b ',0) ref0=0. do j=1,63 @@ -180,6 +271,11 @@ subroutine deep65(s3,mode65,neme,flip,mycall,hiscall,hisgrid,decoded,qual,mrs,mr endif decoded(22:22)=c + ! TEMP diagnostic 2026-09-10. + call dbg('deep65: result ip1=' // itoa(ip1) // ' p1=' // itoa(nint(100*p1)) // & + ' p2=' // itoa(nint(100*p2)) // ' bias=' // itoa(nint(100*bias)) // & + ' qual=' // itoa(nint(qual)) // ' bestmsg="' // trim(testmsg(max(ip1,1))) // '"') + ! Make sure everything is upper case. do i=1,22 if(decoded(i:i).ge.'a' .and. decoded(i:i).le.'z') & diff --git a/map65/libm65/display.f90 b/map65/libm65/display.f90 index a7f71175..901313c8 100644 --- a/map65/libm65/display.f90 +++ b/map65/libm65/display.f90 @@ -6,6 +6,8 @@ subroutine display(nkeep, ftol) use stdout_channel_mod, only: write_stdout use iso_fortran_env, only: real64 use indexx_mod, only: indexx + use debug_log, only: dbg, itoa, rtoa + use sec_midn_mod, only: sec_midn implicit none ! Arguments @@ -27,7 +29,7 @@ subroutine display(nkeep, ftol) ! Hz offset within kHz) alongside cfreq0 in the "&" bandmap line. ! The C++ overlay handler (mainwindow.cpp processStdOut) reads ! both fields and places the tick at nkHz + ndf/1000 instead of - ! integer kHz, which was up to ±500 Hz off on signals with + ! integer kHz, which was up to �500 Hz off on signals with ! non-zero ndf. character(len=18) :: freqcall(MAXCALLS) @@ -51,6 +53,12 @@ subroutine display(nkeep, ftol) callsign0 = ' ' freqcall = ' ' + ! TEMP diagnostic 2026-09-10 for the "decode reaches map65_rx.log but not + ! the Messages window" investigation -- this is the entry point for the + ! ENTIRE "@"/"&" (Messages/Band Map window) pipeline; nothing gets to + ! those windows except through here. + call dbg('display: ENTRY at t=' // rtoa(sec_midn()) // ' nkeep=' // itoa(nkeep)) + !------------------ Read and filter valid lines --------------------- rewind(26) nz = 0 @@ -66,12 +74,16 @@ subroutine display(nkeep, ftol) utc(i) = 60*nh + nm freqkHz(i) = 1000.d0*(f0 - 144.d0) + 0.001d0*ndf enddo - + 10 backspace(26) nz = i -1 - utcz = utc(nz) + call dbg('display: read from unit 26, raw record count nz=' // itoa(nz)) + if (nz >= 1) utcz = utc(nz) nz=nz-1 - if (nz < 1) return + if (nz < 1) then + call dbg('display: EARLY RETURN, nz<1 after decrement -- no records to emit') + return + endif nquad = max(nkeep/4, 3) do i = 1, nz nage = utcz - utc(i) @@ -101,6 +113,18 @@ subroutine display(nkeep, ftol) write(26,1022) line(i) 1022 format(a83) enddo + ! Rewriting fewer records than the file previously held does not + ! shrink it -- the old, longer tail stays on disk past this point. + ! Without truncating here, a later rewind+read pass reads straight + ! through into that stale leftover data and resurrects entries this + ! trim was supposed to drop for good, causing unbounded growth of + ! the Messages window over a long session regardless of nkeep. + ! endfile leaves the file positioned after the EOF marker it just + ! wrote, and Fortran forbids further sequential I/O from there + ! without repositioning first -- backspace moves back onto that + ! marker so the next append (map65a.f90/q65b.F90) can write there. + endfile(26) + backspace(26) endif flush(26) @@ -167,6 +191,7 @@ subroutine display(nkeep, ftol) cfreq0=' ' nc = 0 callsign0=' ' + call dbg('display: about to walk k3=' // itoa(k3) // ' sorted records for "@" emission') do k = 1, k3 out = line3(k)(1:13)//line3(k)(28:31)//line3(k)(39:45)// & line3(k)(35:38)//line3(k)(46:80) @@ -180,7 +205,14 @@ subroutine display(nkeep, ftol) livecq3 = out(1:61)//' '//livecq2(23:27)//' '//livecq2(79:83) write(linenew,'("@",A)') trim(livecq3) call write_stdout(trim(linenew)//new_line('a')) + call dbg('display: k=' // itoa(k) // ' "@" EMITTED freq=' // out(6:8) // & + ' utc=' // out(19:22) // ' msg="' // trim(out(31:55)) // '"') out0 = out + else + call dbg('display: k=' // itoa(k) // ' "@" SUPPRESSED (matches out0) freq=' // out(6:8) // & + ' utc=' // out(19:22) // ' msg="' // trim(out(31:55)) // & + '" -- out0 was freq=' // out0(6:8) // ' utc=' // out0(19:22) // & + ' msg="' // trim(out0(31:55)) // '"') endif i1 = index(out(31:), ' ') @@ -201,8 +233,11 @@ subroutine display(nkeep, ftol) freqcall(nc) = cfreq0//line3(k)(9:13)//' '//callsign//line3(k)(79:80) endif endif + else + call dbg('display: k=' // itoa(k) // ' SKIPPED entirely (out(6:8) blank -- not a frequency record)') endif enddo + call dbg('display: done, nc(bandmap entries)=' // itoa(nc)) if(nc.lt.MAXCALLS) nc=nc+1 freqcall(nc)=' ' diff --git a/map65/libm65/extract.f90 b/map65/libm65/extract.f90 index 5c5c9033..c6b3345b 100644 --- a/map65/libm65/extract.f90 +++ b/map65/libm65/extract.f90 @@ -2,6 +2,17 @@ module extract_mod implicit none contains +pure logical function jt65_candidate_is_consistent(nhard,ntotal,rtt,matched_power) + integer, intent(in) :: nhard,ntotal + real, intent(in) :: rtt,matched_power + logical :: high_power_mismatch,ambiguous_high_burden + + high_power_mismatch=nhard.ge.42 .and. matched_power.ge.8.0 + ambiguous_high_burden=ntotal.ge.80 .and. & + (matched_power.ge.7.5 .or. rtt.ge.0.87) + jt65_candidate_is_consistent=.not.(high_power_mismatch .or. ambiguous_high_burden) +end function jt65_candidate_is_consistent + subroutine extract(s3,nadd,ncount,nhist,decoded,ltext,mrs,mrs2) use iso_c_binding, only: c_int @@ -36,7 +47,7 @@ subroutine extract(s3,nadd,ncount,nhist,decoded,ltext,mrs,mrs2) integer :: i,ipk,naggressive,ncandidates,nd0,nerased,nfail,n integer :: nft,nhard,nlow,nsec1,nsoft,ntest,ntotal,ntrials integer(c_int) :: ntry(1) - real :: base,qual,r00,rtt + real :: base,matched_power,qual,r00,rtt ! 0 1 2 3 4 5 6 7 8 9 10 11 data h0/41,42,43,43,44,45,46,47,48,48,49,49/ @@ -95,6 +106,7 @@ subroutine extract(s3,nadd,ncount,nhist,decoded,ltext,mrs,mrs2) rtt=0.001*param(4) ntotal=param(5) qual=0.001*param(7) + matched_power=0.001*param(8) nd0=81 r00=0.87 if(naggressive.eq.10) then @@ -107,6 +119,7 @@ subroutine extract(s3,nadd,ncount,nhist,decoded,ltext,mrs,mrs2) if(nhard.gt.h0(n)) nft=0 if(ntotal.gt.d0(n)) nft=0 if(rtt.gt.r0(n)) nft=0 + if(.not.jt65_candidate_is_consistent(nhard,ntotal,rtt,matched_power)) nft=0 ncount=-1 decoded=' ' @@ -117,17 +130,17 @@ subroutine extract(s3,nadd,ncount,nhist,decoded,ltext,mrs,mrs2) do i=1,12 dat4(i)=correct(13-i) enddo + if (.not. is_valid_jt65_codeword(dat4)) then + nft=0 + go to 900 + endif do i=1,63 itmp(i)=correct(64-i) enddo correct(1:63)=itmp(1:63) call interleave63(correct,1) call graycode65(correct,63,1) - ! write(*,*) 'EXTRACT: nft=', nft, ' ncount=', ncount, ' nhist=', nhist - ! write(*,*) 'EXTRACT: correct(1:20) = ', correct(1:20) - ! write(*,*) 'EXTRACT: dat4(1:12) = ', dat4 call unpackmsg(dat4, decoded) !Unpack the user message -! write(*,*) 'EXTRACT: decoded = "', decoded, '"' ncount=0 if(iand(dat4(10),8).ne.0) ltext=.true. endif diff --git a/map65/libm65/fchisq.f90 b/map65/libm65/fchisq.f90 index 15a7d4d1..4d0a5ae0 100644 --- a/map65/libm65/fchisq.f90 +++ b/map65/libm65/fchisq.f90 @@ -13,28 +13,20 @@ real function fchisq(cx, cy, npts, fsample, nflip, a, ccfmax, dtmax) integer, intent(in) :: npts, nflip complex, intent(in) :: cx(npts), cy(npts) real, intent(in) :: fsample - real, intent(inout) :: a(5) ! a(1:3) used for AFC, a(4) for pol + real, intent(inout) :: a(5) real, intent(out) :: ccfmax, dtmax - !==== Local parameters ===================================================== - integer, parameter :: NMAX = 60*96000 - !==== Local variables ====================================================== - complex :: w, wstep = (1.0, 0.0), za, zb, z - real :: ss(3000) - complex :: csx(0:NMAX/64), csy(0:NMAX/64) + complex :: w, wstep, za, zb, z + real, allocatable :: ss(:) + complex, allocatable :: csx(:), csy(:) integer :: i, j, k, lagpk integer :: ndiv, nout, nsph, nsps - real :: a1, a2, a3 real :: dphi, dtstep, fac real :: p2, pol, s, twopi, x, x0, baud - !==== Saved state (explicitly initialized) ================================= - save a1, a2, a3 - data a1, a2, a3 / 99.0, 99.0, 99.0 / - !==== Initialize outputs =================================================== ccfmax = 0.0 dtmax = 0.0 @@ -44,50 +36,48 @@ real function fchisq(cx, cy, npts, fsample, nflip, a, ccfmax, dtmax) baud = 11025.0 / 4096.0 !==== Symbol timing ======================================================== - nsps = nint(fsample / baud) ! samples per symbol - nsph = nsps / 2 ! samples per half-symbol - ndiv = 16 ! ss() steps per symbol - nout = ndiv * npts / nsps + nsps = nint(fsample / baud) + nsph = nsps / 2 + ndiv = 16 + nout = ndiv * npts / nsps dtstep = 1.0 / (ndiv * baud) + !==== Allocate buffers ===================================================== + allocate(csx(0:npts), csy(0:npts)) call timer('fchisq ', 0) !=========================================================================== - ! MIX AND INTEGRATE (only if a(1:3) changed) + ! MIX AND INTEGRATE (always recompute) !=========================================================================== - if (a(1) /= a1 .or. a(2) /= a2 .or. a(3) /= a3) then - a1 = a(1) - a2 = a(2) - a3 = a(3) + csx(0) = (0.0, 0.0) + csy(0) = (0.0, 0.0) - csx(0) = (0.0, 0.0) - csy(0) = (0.0, 0.0) + wstep = (1.0, 0.0) + w = (1.0, 0.0) + x0 = 0.5*(npts + 1) + s = 2.0 / npts - w = (1.0, 0.0) - x0 = 0.5*(npts + 1) - s = 2.0 / npts + do i = 1, npts + x = s*(i - x0) - do i = 1, npts - x = s*(i - x0) - - if (mod(i,100) == 1) then - p2 = 1.5*x*x - 0.5 - dphi = (a(1) + x*a(2) + p2*a(3)) * (twopi/fsample) - wstep = cmplx(cos(dphi), sin(dphi)) - end if + if (mod(i,100) == 1) then + p2 = 1.5*x*x - 0.5 + dphi = (a(1) + x*a(2) + p2*a(3)) * (twopi/fsample) + wstep = cmplx(cos(dphi), sin(dphi)) + end if - w = w * wstep - csx(i) = csx(i-1) + w*cx(i) - csy(i) = csy(i-1) + w*cy(i) - end do - end if + w = w * wstep + csx(i) = csx(i-1) + w*cx(i) + csy(i) = csy(i-1) + w*cy(i) + end do !=========================================================================== ! COMPUTE HALF-SYMBOL POWERS !=========================================================================== fac = 1.0e-4 pol = a(4) / 57.2957795 - ss = 0.0 + allocate(ss(nout)) + ss = 0.0 do i = 1, nout j = i*nsps/ndiv @@ -111,8 +101,12 @@ real function fchisq(cx, cy, npts, fsample, nflip, a, ccfmax, dtmax) dtmax = lagpk * dtstep fchisq = -ccfmax - call timer('fchisq ', 1) + !==== Cleanup ============================================================== + deallocate(ss) + deallocate(csx, csy) + call timer('fchisq ', 1) end function fchisq end module fchisq_mod + diff --git a/map65/libm65/filbig.f90 b/map65/libm65/filbig.f90 index 79f49a8d..bfbaf7a5 100644 --- a/map65/libm65/filbig.f90 +++ b/map65/libm65/filbig.f90 @@ -4,17 +4,26 @@ module filbig_mod use timer_module, only: timer use debug_log use cacb_mod + use npar_ptrs_mod, only: nrate_active, nfft_big_active use fftw3_constants use fftw3_f77_interfaces + use sec_midn_mod, only: sec_midn implicit none + + integer, parameter :: MAXFFT1 = 56*192000 + integer, parameter :: MAXFFT2 = 2*77175 + + complex, save :: c4a_buf(MAXFFT2), c4b_buf(MAXFFT2), cfilt_buf(MAXFFT2) + integer(c_intptr_t), save :: plan1, plan2, plan3, plan4, plan5 + logical, save :: filbig_first = .true. + contains subroutine filbig(dd, nmax, f0, newdat, nfsample, xpol, c4a, c4b, n4) ! Filter and downsample complex data stored in array dd(4,nmax). - ! Output is downsampled from 96000 Hz to 1375.125 Hz. + ! Output is downsampled from nrate_active Hz to 1378.125 Hz (same decimation ratio as 96 kHz). - integer, parameter :: MAXFFT1 = 5376000, MAXFFT2 = 77175 integer, intent(in) :: nmax real(real32), intent(in) :: dd(4, nmax) real(real64), intent(in) :: f0 @@ -28,27 +37,61 @@ contains real halfpulse(8) !Impulse response (one sided) real base, fac, filtval integer i, i0, j, nfft1, nfft2, nflags, nh, npatience, nz - complex cfilt(MAXFFT2) !Filter in frequency domain - integer(c_intptr_t) plan1, plan2, plan3, plan4, plan5 - logical first - data first/.true./, npatience/1/ + real(real64) :: decim + ! Filter in frequency domain; sized at max short-FFT length + data npatience/1/ data halfpulse/114.97547150, 36.57879257, -20.93789101, & 5.89886379, 1.59355187, -2.49138308, 0.60910773, -0.04248129/ save - call init_cacb(5376000) + ! ca/cb storage is sized at MAXFFT1 in cacb_mod; the *active* big FFT + ! length is nfft_big_active, set from C++ via set_runtime_params_(). + call init_cacb(MAXFFT1) if (nmax .lt. 0) go to 900 - nfft1 = MAXFFT1 - nfft2 = MAXFFT2 + ! Runtime big-FFT length: nfft_big_active is 56 * nrate_active, set + ! from C++ at startup. Clamp to MAXFFT1 for safety. + nfft1 = min(56*nrate_active, MAXFFT1) + decim = real(nrate_active, kind=real64) / 1378.125_real64 + ! Preserve the original decimation ratio between nfft1 and nfft2. + ! At 96 kHz: nfft1 = 5376000, nfft2 = 77175 ? ratio � 69.64 + ! At 192 kHz: nfft1 doubles, so nfft2 should double to keep the + ! same time span / bandwidth in the downsampled stream. + ! + ! Use the 96 kHz baseline ratio to derive nfft2 for any rate: + ! nfft2 � nfft1 * (77175 / 5376000) + + ! Choose nfft2 so that the time span in c4a is the same as in the 96 kHz case + ! Baseline: at 96 kHz, nfft1=5,376,000, nfft2=77,175 + ! nfft2 = int( real(nfft1, kind=real64) * 77175.0_real64 / 5376000.0_real64 ) + nfft2 = int(MAXFFT2/2) + nfft2 = min(nfft2, MAXFFT2) + if (nfft2 .gt. MAXFFT2) nfft2 = MAXFFT2 + + ! Preserve the legacy 95238 special case (Linrad odd rate); if you + ! still use it, override the derived sizes with the historical ones. if (nfsample .eq. 95238) then - nfft1 = 5120000 - nfft2 = 74088 + nfft1 = min(5120000, MAXFFT1) + nfft2 = min(74088, MAXFFT2) endif - if (first) then + if (filbig_first) then + ! TEMP diagnostic 2026-09-10 for the "first decode cycle after + ! startup is degraded/missing" investigation. filbig_first is a + ! module-SAVEd flag -- true exactly once, for the life of the + ! process -- so this whole block runs on the very first filbig() + ! call and never again. That happens to line up exactly with when + ! the anomaly has been observed. FFTW plan creation (even the cheap + ! ESTIMATE_PATIENT mode used below) still does real work for a + ! multi-million-point transform; if it takes long enough to run + ! synchronously on this thread, it could delay real-time audio + ! capture on the GUI/audio thread for that whole span. Time it + ! directly rather than assuming either way. + call dbg('filbig: FIRST-EVER CALL, starting FFTW plan creation at t=' // rtoa(sec_midn()) // & + ' nfft1=' // itoa(nfft1) // ' nfft2=' // itoa(nfft2)) + nflags = FFTW_ESTIMATE if (npatience .eq. 1) nflags = FFTW_ESTIMATE_PATIENT if (npatience .eq. 2) nflags = FFTW_MEASURE @@ -56,31 +99,35 @@ contains if (npatience .eq. 4) nflags = FFTW_EXHAUSTIVE ! Plan the FFTs just once - call timer('FFTplans ', 0) + call timer('FFTplans', 0) call sfftw_plan_dft_1d(plan1, nfft1, ca, ca, FFTW_BACKWARD, nflags) call sfftw_plan_dft_1d(plan2, nfft1, cb, cb, FFTW_BACKWARD, nflags) - call sfftw_plan_dft_1d(plan3, nfft2, c4a, c4a, FFTW_FORWARD, nflags) - call sfftw_plan_dft_1d(plan4, nfft2, c4b, c4b, FFTW_FORWARD, nflags) - call sfftw_plan_dft_1d(plan5, nfft2, cfilt, cfilt, FFTW_BACKWARD, nflags) - call timer('FFTplans ', 1) + call sfftw_plan_dft_1d(plan3, nfft2, c4a_buf, c4a_buf, FFTW_FORWARD, nflags) + call sfftw_plan_dft_1d(plan4, nfft2, c4b_buf, c4b_buf, FFTW_FORWARD, nflags) + call sfftw_plan_dft_1d(plan5, nfft2, cfilt_buf,cfilt_buf,FFTW_BACKWARD, nflags) + call timer('FFTplans', 1) + call dbg('filbig: FFTW plan creation DONE at t=' // rtoa(sec_midn())) ! Convert impulse response to filter function do i = 1, nfft2 - cfilt(i) = 0.0 + cfilt_buf(i) = 0.0 enddo fac = 0.00625/nfft1 - cfilt(1) = fac*halfpulse(1) + cfilt_buf(1) = fac*halfpulse(1) do i = 2, 8 - cfilt(i) = fac*halfpulse(i) - cfilt(nfft2 + 2 - i) = fac*halfpulse(i) + cfilt_buf(i) = fac*halfpulse(i) + cfilt_buf(nfft2 + 2 - i) = fac*halfpulse(i) enddo call sfftw_execute(plan5) - base = real(cfilt(nfft2/2 + 1)) + base = real(cfilt_buf(nfft2/2 + 1)) - df = 96000.d0/nfft1 - if (nfsample .eq. 95238) df = 95238.1d0/nfft1 - first = .false. + ! Bin width of the big FFT: use the active runtime rate instead + ! of a hardcoded 96000. The 95238 special case is preserved. + df = dble(nrate_active)/dble(nfft1) + if (nfsample .eq. 95238) df = 95238.1d0/dble(nfft1) + filbig_first = .false. + call dbg('filbig: entire one-time init (plans + filter) DONE at t=' // rtoa(sec_midn())) endif ! When new data comes along, we need to compute a new "big FFT" @@ -116,12 +163,12 @@ contains do i = 1, nh j = i0 + i - 1 if (j .ge. 1 .and. j .le. nfft1) then - filtval = real(cfilt(i)) - base - c4a(i) = filtval*ca(j) - if (xpol) c4b(i) = filtval*cb(j) + filtval = real(cfilt_buf(i)) - base + c4a_buf(i) = filtval*ca(j) + if (xpol) c4b_buf(i) = filtval*cb(j) else - c4a(i) = 0.0 - if (xpol) c4b(i) = 0.0 + c4a_buf(i) = 0.0 + if (xpol) c4b_buf(i) = 0.0 endif enddo @@ -137,9 +184,9 @@ contains stop 'FILBIG index OOB' end if - filtval = real(cfilt(i)) - base - c4a(i) = filtval*ca(j) - if (xpol) c4b(i) = filtval*cb(j) + filtval = real(cfilt_buf(i)) - base + c4a_buf(i) = filtval*ca(j) + if (xpol) c4b_buf(i) = filtval*cb(j) enddo ! Do the short reverse transform, to go back to time domain. @@ -147,7 +194,18 @@ contains call sfftw_execute(plan3) if (xpol) call sfftw_execute(plan4) call timer('FFTsmall', 1) - n4 = min(nmax/64, nfft2) + + c4a(1:nfft2) = c4a_buf(1:nfft2) + if (xpol) then + c4b(1:nfft2) = c4b_buf(1:nfft2) + else + c4b(1:nfft2) = 0.0 + endif + + ! Number of valid output samples at ~1375 Hz + n4 = min( int( real(nmax, kind=real64) / decim ), nfft2 ) + n4 = min( int( real(nmax, kind=real64) / decim ), nfft2 ) + go to 999 900 call sfftw_destroy_plan(plan1) diff --git a/map65/libm65/four2a.f90 b/map65/libm65/four2a.f90 index ad1da4a1..91be0f48 100644 --- a/map65/libm65/four2a.f90 +++ b/map65/libm65/four2a.f90 @@ -81,7 +81,8 @@ contains nflags = FFTW_ESTIMATE if (nfft <= NSMALL) then - jz = merge(nfft/2, nfft, iform == 0) + jz = nfft + if (iform <= 0) jz = nfft/2 + 1 aa(1:jz) = a(1:jz) endif diff --git a/map65/libm65/four2a_legacy_wrap.f90 b/map65/libm65/four2a_legacy_wrap.f90 index f95a0589..d2c0028b 100644 --- a/map65/libm65/four2a_legacy_wrap.f90 +++ b/map65/libm65/four2a_legacy_wrap.f90 @@ -2,81 +2,76 @@ module four2a_legacy_wrap_mod use iso_c_binding use four2a_mod, only: four2a implicit none + + integer, parameter :: JT65_NFFT = 512 + integer, parameter :: JT65_NH = JT65_NFFT/2 contains -subroutine r2c_legacy(s_real, cs_half, nfft) +subroutine r2c_legacy(s_real, cs_half) use iso_c_binding use four2a_mod, only: four2a implicit none - integer, intent(in) :: nfft - real, intent(in) :: s_real(nfft) - complex, intent(out) :: cs_half(0:nfft/2) + real, intent(in) :: s_real(JT65_NFFT) + complex, intent(out) :: cs_half(0:JT65_NH) - integer :: nh, k + integer :: k integer(c_int) :: nfft_c, ndim_c, isign_c, iform_c - nh = nfft/2 - block - ! full complex buffer: nfft complex → 2*nfft reals - real(c_float), target :: work(2*nfft) + real(c_float), save, target :: work(2*(JT65_NH+1)) complex(c_float_complex), pointer :: work_c(:) - call c_f_pointer(c_loc(work), work_c, [nfft]) + call c_f_pointer(c_loc(work), work_c, [JT65_NH+1]) - ! real input → first nfft reals - work(1:nfft) = real(s_real(1:nfft), kind=c_float) + work(1:JT65_NFFT) = real(s_real, kind=c_float) - nfft_c = nfft + nfft_c = JT65_NFFT ndim_c = 1 isign_c = 1 iform_c = 0 call four2a(work_c, nfft_c, ndim_c, isign_c, iform_c) - ! packed half-spectrum: cs_half(0..nh) ↔ work_c(1..nh+1) - do k = 0, nh + do k = 0, JT65_NH cs_half(k) = cmplx(real(work_c(k+1)), aimag(work_c(k+1))) enddo end block end subroutine r2c_legacy -subroutine c2r_legacy(cs_half, s_real, nfft) +subroutine c2r_legacy(cs_half, s_real) use iso_c_binding use four2a_mod, only: four2a implicit none - integer, intent(in) :: nfft - complex, intent(in) :: cs_half(0:nfft/2) - real, intent(out) :: s_real(nfft) + complex, intent(in) :: cs_half(0:JT65_NH) + real, intent(out) :: s_real(JT65_NFFT) - integer :: nh, k + integer :: k integer(c_int) :: nfft_c, ndim_c, isign_c, iform_c - nh = nfft/2 - block - real(c_float), target :: work(2*nfft) + real(c_float), target :: work(2*(JT65_NH+1)) complex(c_float_complex), pointer :: work_c(:) - call c_f_pointer(c_loc(work), work_c, [nfft]) + call c_f_pointer(c_loc(work), work_c, [JT65_NH+1]) ! load packed half-spectrum: cs_half(0..nh) → work_c(1..nh+1) - do k = 0, nh + do k = 0, JT65_NH work_c(k+1) = cmplx(real(cs_half(k), kind=c_float), & aimag(cs_half(k)), kind=c_float) enddo - nfft_c = nfft + ! c2r: iform = -1 + nfft_c = JT65_NFFT ndim_c = 1 isign_c = 1 iform_c = -1 call four2a(work_c, nfft_c, ndim_c, isign_c, iform_c) ! real output in first nfft reals - s_real(1:nfft) = real(work(1:nfft)) + s_real = real(work(1:JT65_NFFT)) end block -end subroutine c2r_legacy +end subroutine c2r_legacy end module four2a_legacy_wrap_mod diff --git a/map65/libm65/ftnquit.f90 b/map65/libm65/ftnquit.f90 index 573b2536..7543c19e 100644 --- a/map65/libm65/ftnquit.f90 +++ b/map65/libm65/ftnquit.f90 @@ -2,14 +2,14 @@ module ftnquit_mod use filbig_mod use four2a_mod use iso_fortran_env, only: real64, real32 + use filbig_mod, only: MAXFFT2 + implicit none contains subroutine ftnquit implicit none - integer, parameter :: MAXFFT2 = 77175 - real(real32) :: dd_dummy(1,1) integer :: nmax_dummy = -1 real(real64) :: f0_dummy = 0.0d0 diff --git a/map65/libm65/ftrsd2.c b/map65/libm65/ftrsd2.c index 7d8dd366..f281e72d 100644 --- a/map65/libm65/ftrsd2.c +++ b/map65/libm65/ftrsd2.c @@ -132,15 +132,14 @@ codeword is "best". jj = (62-i)/8; thresh0[i] = 1.3*perr[ii][jj]; } - if(nsum<=0) return; - pp1=0.0; pp2=0.0; + if (nsum>0) { for (k=1; k<=ntrials; k++) { memset(era_pos,0,51*sizeof(int)); memcpy(workdat,rxdat,sizeof(rxdat)); -/* +/* Mark a subset of the symbols as erasures. Run through the ranked symbols, starting with the worst, i=0. NB: j is the symbol-vector index of the symbol with rank i. @@ -162,10 +161,10 @@ NB: j is the symbol-vector index of the symbol with rank i. } } - nerr=decode_rs_int(rs,workdat,era_pos,numera,0); + nerr=decode_rs_int(rs,workdat,era_pos,numera,0); if( nerr >= 0 ) { // We have a candidate codeword. Find its hard and soft distance from - // the received word. Also find pp1 and pp2 from the full array + // the received word. Also find pp1 and pp2 from the full array // s3(64,63) of synchronized symbol spectra. ncandidates=ncandidates+1; nhard=0; @@ -198,7 +197,15 @@ NB: j is the symbol-vector index of the symbol with rank i. } if(k == ntrials) ntry[0]=k; } - + } + // nsum<=0 (or no erasure trial found a valid codeword) falls through to + // here with ncandidates==0 and the *_min sentinels left at their "nothing + // found" initial values (32768) -- previously this case (nsum<=0) hit an + // early "return;" that skipped writing param[]/correct[]/ntry[] entirely, + // leaving the caller's pre-call param=0 in place, which incorrectly read + // as an accepted decode (ntotal=0 trivially clears the accept threshold) + // and unpacked whatever garbage was sitting in the uninitialized + // "correct" array as if it were a real message. param[0]=ncandidates; param[1]=nhard_min; param[2]=nsoft_min; diff --git a/map65/libm65/ftrsd2_mod.f90 b/map65/libm65/ftrsd2_mod.f90 index ad716070..0737e9c0 100644 --- a/map65/libm65/ftrsd2_mod.f90 +++ b/map65/libm65/ftrsd2_mod.f90 @@ -4,9 +4,9 @@ module ftrsd2_mod interface subroutine ftrsd2_(mrsym, mrprob, mr2sym, mr2prob, ntrials0, correct, param, ntry) bind(C, name="ftrsd2_") use iso_c_binding - integer(c_int), intent(in) :: mrsym(*), mrprob(*), mr2sym(*), mr2prob(*) - integer(c_int), intent(in) :: ntrials0 - integer(c_int), intent(in) :: correct(*), param(*), ntry(*) + integer(c_int), intent(in) :: mrsym(*), mrprob(*), mr2sym(*), mr2prob(*) + integer(c_int), intent(in) :: ntrials0 + integer(c_int), intent(out) :: correct(*), param(*), ntry(*) end subroutine ftrsd2_ end interface end module ftrsd2_mod diff --git a/map65/libm65/gen65.f90 b/map65/libm65/gen65.f90 index 46f591f9..0be99fc4 100644 --- a/map65/libm65/gen65.f90 +++ b/map65/libm65/gen65.f90 @@ -178,7 +178,7 @@ subroutine gen65_c(msg, mode65, samfac, nsendingsh, msgsent_c, iwave_c, nwave) & ! Fortran locals character(len=22) :: fmsg, fmsgsent - integer(2), dimension(2*60*11025) :: fiwave + integer(2), save :: fiwave(2*60*11025) integer :: i ! Copy C msg ? Fortran CHARACTER(22) diff --git a/map65/libm65/gen_q65_cwave.f90 b/map65/libm65/gen_q65_cwave.f90 index 474e291f..2f5c1262 100644 --- a/map65/libm65/gen_q65_cwave.f90 +++ b/map65/libm65/gen_q65_cwave.f90 @@ -2,28 +2,28 @@ module gen_q65_cwave_mod implicit none contains -subroutine gen_q65_cwave(msg,ntxfreq,ntone_spacing,msgsent,cwave,nwave) +subroutine gen_q65_cwave(msg,ntxfreq,ntone_spacing,fsample,msgsent,cwave,nwave) use packjt use q65_encoding use iso_fortran_env, only: real64 - integer, parameter :: NMAX = 60*96000 - !-------------------------------------------------------------------- ! Arguments (with correct intent and explicit types) !-------------------------------------------------------------------- + ! fsample is the actual sample rate in Hz + real(real64), intent(in) :: fsample character*24, intent(in) :: msg integer, intent(in) :: ntxfreq integer, intent(in) :: ntone_spacing character*24, intent(out) :: msgsent - complex, intent(out) :: cwave(NMAX) + complex, intent(out) :: cwave(:) integer, intent(out) :: nwave !-------------------------------------------------------------------- ! Local character variables !-------------------------------------------------------------------- - character*37 :: msg37 + character*37 :: msg37,msgsent37 !-------------------------------------------------------------------- ! Explicit declarations for all formerly implicit variables @@ -37,6 +37,7 @@ subroutine gen_q65_cwave(msg,ntxfreq,ntone_spacing,msgsent,cwave,nwave) ! Explicit locals integer :: codeword(65), itone(85) integer :: icos7(0:6) + logical :: success data icos7 /2,5,6,0,4,1,3/ data twopi /6.283185307179586476d0/ @@ -45,31 +46,36 @@ subroutine gen_q65_cwave(msg,ntxfreq,ntone_spacing,msgsent,cwave,nwave) !-------------------------------------------------------------------- ! Begin logic (unchanged from legacy) !-------------------------------------------------------------------- - msgsent = msg msg37 = '' msg37(1:24) = msg - call get_q65_tones(msg37, codeword, itone) + call get_q65_tones(msg37, codeword, itone, msgsent37, success) + msgsent = msgsent37(1:len(msgsent)) + if(.not.success) then + cwave=0 + nwave=0 + return + endif ! Constants nsym = 85 - tsym = 7200.d0 / 12000.d0 - dt = 1.d0 / 96000.d0 + tsym = 7200.d0 / 12000.d0 ! symbol duration (unchanged) + dt = 1.d0 / fsample ! sample interval f0 = ntxfreq - dfgen = ntone_spacing * 12000.d0 / 7200.d0 + dfgen = ntone_spacing * 12000.d0 / 7200.d0 ! tone spacing in Hz (unchanged) phi = 0.d0 dphi = twopi * dt * f0 - nwave = 85 * 7200 * 96000.d0 / 12000.d0 + ! total samples for the 85-symbol Q65-60A waveform + nwave = int( nsym * tsym * fsample + 0.5d0 ) t = 0.d0 j0 = 0 do i = 1, nwave t = t + dt - j = t/tsym + 1 - if (j > 85) exit + j = min(nsym, int(t/tsym) + 1) if (j /= j0) then f = f0 + itone(j) * dfgen diff --git a/map65/libm65/gen_q65_wave.f90 b/map65/libm65/gen_q65_wave.f90 index 38757113..cfdd04da 100644 --- a/map65/libm65/gen_q65_wave.f90 +++ b/map65/libm65/gen_q65_wave.f90 @@ -25,7 +25,7 @@ subroutine gen_q65_wave(msg,ntxfreq,mode65,msgsent,iwave,nwave) !-------------------------------------------------------------------- ! Local character !-------------------------------------------------------------------- - character*37 :: msg37 + character*37 :: msg37,msgsent37 !-------------------------------------------------------------------- ! Explicit REAL*8 variables (as in original) @@ -40,6 +40,7 @@ subroutine gen_q65_wave(msg,ntxfreq,mode65,msgsent,iwave,nwave) integer :: codeword(65), itone(85) integer :: icos7(0:6) + logical :: success data icos7 /2,5,6,0,4,1,3/ data twopi /6.283185307179586476d0/ @@ -48,7 +49,6 @@ subroutine gen_q65_wave(msg,ntxfreq,mode65,msgsent,iwave,nwave) !-------------------------------------------------------------------- ! Logic (unchanged) !-------------------------------------------------------------------- - msgsent = msg msg37 = '' msg37(1:22) = msg @@ -59,7 +59,13 @@ subroutine gen_q65_wave(msg,ntxfreq,mode65,msgsent,iwave,nwave) end if end if - call get_q65_tones(msg37, codeword, itone) + call get_q65_tones(msg37, codeword, itone, msgsent37, success) + msgsent = msgsent37(1:len(msgsent)) + if(.not.success) then + iwave=0 + nwave=0 + return + endif nsym = 85 tsym = 7200.d0/12000.d0 @@ -76,7 +82,7 @@ subroutine gen_q65_wave(msg,ntxfreq,mode65,msgsent,iwave,nwave) do i = 1, iz t = t + dt - j = t/tsym + 1.0 + j = min(nsym, int(t/tsym) + 1) if (j /= j0) then f = f0 + itone(j)*dfgen dphi = twopi*dt*f @@ -93,4 +99,4 @@ subroutine gen_q65_wave(msg,ntxfreq,mode65,msgsent,iwave,nwave) end subroutine gen_q65_wave -! does not require end module \ No newline at end of file +! does not require end module diff --git a/map65/libm65/getdphi.f90 b/map65/libm65/getdphi.f90 index 73439142..24cf0ab4 100644 --- a/map65/libm65/getdphi.f90 +++ b/map65/libm65/getdphi.f90 @@ -3,6 +3,7 @@ module getdphi_mod contains subroutine getdphi(qphi) + use stdout_channel_mod, only: write_stdout implicit none ! Arguments @@ -11,6 +12,7 @@ subroutine getdphi(qphi) ! Locals real :: c, dphi, s, th integer :: i + character(len=32) :: line s = 0.0 c = 0.0 @@ -22,8 +24,12 @@ subroutine getdphi(qphi) end do dphi = 57.2957795 * atan2(s, c) - write(*,1010) nint(dphi) + write(line,1010) nint(dphi) 1010 format('!Best-fit Dphi =', i4, ' deg') + ! Plain write(*,...) went to real process stdout, which nothing reads any + ! more -- the GUI now gets decoder output through the write_stdout shared- + ! memory channel instead, so this line never reached the Messages window. + call write_stdout(trim(line)//new_line('a')) end subroutine getdphi diff --git a/map65/libm65/getpfx1.f90 b/map65/libm65/getpfx1.f90 index d49d63e1..ba7faa37 100644 --- a/map65/libm65/getpfx1.f90 +++ b/map65/libm65/getpfx1.f90 @@ -63,6 +63,7 @@ subroutine getpfx1(callsign, k, nv2) ! Original JT65 would force this compound callsign to be treated as ! plain text. In JT65v2, we will encode the prefix or suffix into nc1. ! The task here is to compute the proper value of k. +! TODO: Reject invalid compound characters before nchar can stop MAP65. lof=callsign0(:islash-1) rof=callsign0(islash+1:) llof=len_trim(lof) diff --git a/map65/libm65/indexx.f90 b/map65/libm65/indexx.f90 index a81c1712..53eca25c 100644 --- a/map65/libm65/indexx.f90 +++ b/map65/libm65/indexx.f90 @@ -68,38 +68,37 @@ contains ! Partition loop replacing labels 3 and 4 do - ! Move i right + ! Move i right do i = i + 1 - if (i > ir) exit ! exit inner loop + if (i > ir) exit ! exit inner loop if (arr(indx(i)) >= a) exit end do - ! Move j left + ! Move j left do j = j - 1 - if (j < l) then - exit ! exit inner loop - end if + if (j < l) then + exit ! exit inner loop + end if if (arr(indx(j)) <= a) exit end do ! If j < i, partition is done if (j < i) exit - ! Swap - itemp = indx(i) - indx(i) = indx(j) - indx(j) = itemp + ! Swap + itemp = indx(i) + indx(i) = indx(j) + indx(j) = itemp end do - ! But now j might be < l, so clamp it: - if (j < l) j = l + ! But now j might be < l, so clamp it: + if (j < l) j = l indx(l) = indx(j) indx(j) = indxt - ! Push larger segment, process smaller first jstack = jstack + 2 if (jstack > NSTACK) stop 'NSTACK too small in indexx' diff --git a/map65/libm65/init_rs.c b/map65/libm65/init_rs.c index 876819f8..6dff0392 100644 --- a/map65/libm65/init_rs.c +++ b/map65/libm65/init_rs.c @@ -35,7 +35,7 @@ void *INIT_RS(unsigned int symsize,unsigned int gfpoly,unsigned fcr,unsigned pri int i, j, sr,root,iprim; /* Check parameter ranges */ - if(symsize < 0 || symsize > (int)(8*sizeof(DTYPE))) + if(symsize > (int)(8*sizeof(DTYPE))) return NULL; /* Need version with ints rather than chars */ if(fcr >= (1< ss_old + savg_dec => savg_old + + abort_decode = .false. + if (.not. m65_inited) then call decodes_init() - call init_wideband_sync(NFFT) + call init_wideband_sync() m65_inited = .true. endif - + rewind 12 ndecodes = 0 - + km = 0 ipol = 1 -! Clean start for Q65 at early decode - if (nhsym .eq. nhsym1 .or. nagain .ne. 0) ldecoded = .false. - if (ndiskdat .eq. 1) ldecoded = .false. +!------------------------------------------------------------ +! BASIC DECODE SETUP (shared by manual + wideband) +!------------------------------------------------------------ + ! Share the ledger across early/final passes, but start a new cycle + ! even when the preceding final request expired before execution. + if ((nhsym .eq. nhsym1 .and. (nhsym_prev_call .ne. nhsym1 .or. & + previous_input_generation .ne. active_input_generation)) .or. nagain .ne. 0) then + ldecoded = .false. + ljt65decoded = .false. + call dbg('map65a: ldecoded/ljt65decoded RESET at t=' // rtoa(sec_midn()) // & + ' nhsym=' // itoa(nhsym) // ' nhsym_prev_call=' // itoa(nhsym_prev_call) // & + ' nagain=' // itoa(nagain)) + else if (nhsym .eq. nhsym1) then + call dbg('map65a: ldecoded/ljt65decoded NOT reset (repeat call at nhsym1) at t=' // rtoa(sec_midn()) // & + ' nhsym=' // itoa(nhsym)) + endif + nhsym_prev_call = nhsym + if (nagain .eq. 0 .and. ndiskdat .eq. 0 .and. manualDecodeFlag .eq. 0) & + previous_input_generation = active_input_generation + if (ndiskdat .eq. 1) then + ldecoded = .false. + ljt65decoded = .false. + endif + + df = real(nrate_active)/real(nfft_active) + if (nfsample .eq. 95238) df = 95238.1/real(nfft_active) - nkhz_center = nint(1000.0*(fcenter - int(fcenter))) - mfa = nfa - nkhz_center + 48 - mfb = nfb - nkhz_center + 48 - mode65 = mod(nmode, 10) + mode65 = mod(nmode,10) if (mode65 .eq. 3) mode65 = 4 - mode_q65 = nmode/10 - nts_jt65 = mode65 !JT65 tone separation factor - nts_q65 = 2**(mode_q65 - 1) !Q65 tone separation factor + mode_q65 = nmode/10 + nts_jt65 = mode65 + nts_q65 = 2**(mode_q65 - 1) xpol = (nxpol .ne. 0) -! No second decode for JT65? Can't use this guard with modern code -! if (nhsym.eq.nhsym2 .and. nagain.eq.0 .and. ndiskdat.eq.0) mode65 = 0 - - if (nagain .eq. 0) then - call timer('get_cand', 0) - call get_candidates(ss, savg, xpol, nhsym, mfa, mfb, nts_jt65, nts_q65, cand, ncand) - call timer('get_cand', 1) - candec = .false. - endif nwrite_q65 = 0 bq65 = mode_q65 .gt. 0 - + mcall3a = mcall3b mousefqso0 = mousefqso if (.not. xpol) ndphi = 0 nsum = 0 -!### Should use AppDir! ### - open (23, file='CALL3.TXT', status='unknown') - - df = 96000.0/NFFT !df = 96000/NFFT = 2.930 Hz - if (nfsample .eq. 95238) df = 95238.1/NFFT - ftol = 0.010 !Frequency tolerance (kHz) dphi = idphi/57.2957795 - foffset = 0.001*(1270 + nfcal) !Offset from sync tone, plus CAL - fqso = mousefqso + foffset - 0.5*(nfa + nfb) + nfshift !fqso at baseband (khz) + foffset = 0.001*(1270 + nfcal) iloop = 0 + ! qphi is "save"d across calls (blanket SAVE above) but only gets + ! written for a trial (iloop=1..12) that actually decodes something; + ! without this reset, a trial that finds nothing leaves behind + ! whatever unrelated value qphi(iloop) held from an earlier Find-dPhi + ! run, silently mixing stale data into getdphi's best-fit calculation. + if (ndphi .eq. 1) qphi = 0.0 + 2 if (ndphi .eq. 1) dphi = 30*iloop/57.2957795 if (nutc .ne. nutc0) nfile = nfile + 1 nutc0 = nutc + !### Should use AppDir! ### + open (23, file='CALL3.TXT', status='unknown') + +!------------------------------------------------------------ +! MANUAL NARROWBAND DECODE PATH +!------------------------------------------------------------ + if (manualDecodeFlag /= 0) then + abort_saved = abort_decode + km = 0 + icenter = nfft_active/2 + 1 + + ! JT65/Q65 RF frame (kHz) + foffset = 0.001*(1270 + nfcal) + fqso = mousefqso + foffset - 0.5*(nfa + nfb) + nfshift + + ! Manual clicked RF (kHz) + freq = fqso + 0.001*mousedf + + ! Bin index + i = nint(freq*1000.0/df) + icenter + + ! Tolerance from GUI + ftol = real(ntol) ! Hz + ftol_bins = nint(ftol / df) + + i = nint(freq*1000.0/df) + icenter ! bin corresponding to that RF + i = max(51, min(nfft_active - 51, i)) + + ! --- local search around clicked bin within ftol --- + ftol = real(ntol) + ftol_bins = nint(ftol / df) + + jpz = merge(4,1,xpol) + + best_sync1 = -1.e9 + best_i = i + best_dt = 0.0 + best_flipk = 0.0 + best_syncshort = 0.0 + best_snr2 = 0.0 + best_ipol2 = 1 + best_dt2 = 0.0 + + do ii = -ftol_bins, ftol_bins + iii = i + ii + if (iii < 51 .or. iii > nfft_active - 51) cycle + + ssmax = 1.e30 + call timer('ccf65 ',0) + call ccf65(ss_dec(:,:,iii), nhsym, ssmax, sync1_tmp, ipol_tmp, jpz, dt_tmp, flipk_tmp, & + syncshort_tmp, snr2_tmp, ipol2_tmp, dt2_tmp) + call timer('ccf65 ',1) + + if (sync1_tmp > best_sync1) then + best_sync1 = sync1_tmp + best_i = iii + best_dt = dt_tmp + best_flipk = flipk_tmp + best_syncshort = syncshort_tmp + best_snr2 = snr2_tmp + best_ipol2 = ipol2_tmp + best_dt2 = dt2_tmp + endif + enddo + + ! use best bin and metrics from the search + i = best_i + sync1 = best_sync1 + dt = best_dt + flipk = best_flipk + syncshort = best_syncshort + snr2 = best_snr2 + ipol2 = best_ipol2 + dt2 = best_dt2 + + ! Match the 3.0.1 double-click ("quick decode", nqd=1) rule: use a + ! lower sync threshold at the clicked frequency when ftol <= 100 Hz. + ! A fixed 1.0 here gates the click exactly like the wideband pass, + ! so a signal the wideband pass missed could never be decoded. + thresh1 = 1.0 + if (ntol .le. 100) thresh1 = 0. + nflip = nint(flipk) + call dbg('map65a manual: click nutc=' // itoa(nutc) // ' mousefqso=' // itoa(mousefqso) // & + ' mousedf=' // itoa(mousedf) // ' ntol=' // itoa(ntol) // & + ' best sync1=' // rtoa(sync1) // ' thresh1=' // rtoa(thresh1) // & + ' syncshort=' // rtoa(syncshort) // ' mode65=' // itoa(mode65)) + + !=========================== + ! SHORTHAND DETECTION (JT65) + !=========================== + shorthand_detected = .false. + + thresh0 = 1.0 + if (syncshort > thresh0 .and. mode65 > 0) then + shorthand_detected = .true. + + km = 1 + sig(1,1) = nfile + sig(1,2) = nutc + sig(1,3) = freq + sig(1,4) = syncshort + sig(1,5) = dt2 + sig(1,6) = 45*(ipol2 - 1)/57.2957795 + sig(1,7) = 0 + sig(1,8) = snr2 + sig(1,9) = 0 + sig(1,10)= 0 + sig(1,12)= savg_dec(ipol2,i) + msg(1) = shmsg0(1) + endif + + ! Bin frequency for this click (for decode1a’s f00) + f00 = (i - 1)*df + + ikhz = nint(freq + 0.5*(nfa + nfb) - foffset) - nfshift + idf = nint(1000.0*(freq + 0.5*(nfa + nfb) - foffset - (ikHz + nfshift))) + + noffset = nint(1000.0*(freq - fqso) - mousedf) + + ! JT65-specific rejects only when JT65 is active + if (mode65 > 0) then + if (sync1 <= thresh1) then + + if (.not. bq65) then + ! JT65-only mode → real reject + newdat = 0 + km = 0 + ncand = 0 + msg(1) = blank + msg(2) = blank + do j = 1, 30 + sig(1,j) = 0.0 + enddo + manualDecodeFlag = 0 + return + endif + + ! JT65 failed but Q65 is active → DO NOT RETURN + endif + + if (abs(noffset) > ntol) then + + if (.not. bq65) then + ! JT65-only mode → real reject + + newdat = 0 + km = 0 + ncand = 0 + + msg(1) = blank + msg(2) = blank + + do j = 1, 30 + sig(1,j) = 0.0 + enddo + + manualDecodeFlag = 0 + return + endif + + ! JT65 failed but Q65 is active → DO NOT RETURN + endif + endif + + !=========================== + ! JT65 MANUAL DECODE (if active) + !=========================== + jt65_success = .false. + decoded_jt65 = ' ' + + if (mode65 > 0 .and. sync1 > thresh1 .and. abs(noffset) <= ntol) then + + call timer('decode1a',0) + ifreq = i + + call decode1a(dd,newdat,f00,nflip,mode65,nfsample,xpol,mycall,hiscall, & + hisgrid,neme,ndepth,1,dphi,ndphi,nutc,ikHz,idf,ipol,ntol, & + sync2,a,dt,pol,nkv,nhist,nsum,nsave,qual,decoded_jt65) + call timer('decode1a',1) + + abort_decode = abort_saved + ! Fit and averaging details, to tell a normal decode from a strange one + ! (e.g. an odd DT). dt_in is the DT decode1a was given (from ccf65 at the + ! best bin), dt_out the DT it returned. nsum > 0 means the single-period + ! decode failed and decode1a went on to try averaging saved spectra; + ! nkv >= 2 with a decode means the message came from that average. + call dbg('map65a manual: decode1a called, decoded=[' // trim(decoded_jt65) // ']' // & + ' dt_in=' // rtoa(best_dt) // ' dt_out=' // rtoa(dt) // & + ' sync2=' // rtoa(sync2) // ' a1_df=' // rtoa(a(1)) // & + ' nkv=' // itoa(nkv) // ' nsum=' // itoa(nsum) // ' nsave=' // itoa(nsave) // & + ' nhist=' // itoa(nhist) // ' qual=' // rtoa(qual) // & + ' nflip=' // itoa(nflip) // ' f00=' // rtoa(real(f00))) + + if (decoded_jt65 /= ' ') then + jt65_success = .true. + + km = km + 1 + sig(km,1) = nfile + sig(km,2) = nutc + sig(km,3) = freq + 0.5*(nfa+nfb) + sig(km,4) = sync1 + sig(km,5) = dt + sig(km,6) = pol + sig(km,7) = flipk + sig(km,8) = sync2 + sig(km,9) = nkv + sig(km,10)= qual + sig(km,12)= savg_dec(ipol,i) + sig(km,13)= a(1) + sig(km,14)= a(2) + sig(km,15)= a(3) + sig(km,16)= a(4) + sig(km,18)= nhist + msg(km) = decoded_jt65 + endif + endif + + !=========================== + ! Q65 MANUAL DECODE (if active) + !=========================== + q65_success = .false. + + if (bq65) then + ! Include mousedf (the sub-kHz part of the click) so the search + ! is centered on the actual clicked frequency, not just rounded + ! to the nearest kHz -- matters once q65b targets this exactly + ! (see the manualDecodeFlag handling around k0 in q65b.F90). + freq = mousefqso + 0.001*mousedf + freq_q65 = freq + f0 = freq_q65 - (nkhz_center - real(nrate_active)/2000.0 - 1.27046) + nqd = 1 ! target-frequency decode, like wideband's quick pass at + ! fQSO; also required so q65b's own write_stdout/output + ! path (gated on nqd==1) actually emits the result + ikhz = nint(freq_q65) + ! NB: mousedf must stay relative to mousefqso here, unmodified -- + ! q65b.F90 also uses it (via f_mouse) to pick k0, the actual + ! sample-extraction point for the decode. A previous attempt to + ! re-reference it to ikhz here (for q65b's output gate, which + ! compares against ikhz-relative nq65df) fixed the gate but broke + ! k0/f_mouse, silently decoding whatever signal sits near the + ! *other* kHz bucket instead of the one actually clicked. The + ! gate's reference-frame mismatch is now fixed inside q65b.F90 + ! itself instead, from f0 (already unambiguous), leaving this + ! mousedf untouched for f_mouse/k0 to keep working correctly. + + call dbg('map65a manual: Q65 call nutc=' // itoa(nutc) // ' nqd=' // itoa(nqd) // & + ' ikhz=' // itoa(ikhz) // ' mousedf=' // itoa(mousedf) // ' ntol=' // itoa(ntol) // & + ' mode_q65=' // itoa(mode_q65) // ' f0=' // rtoa(real(f0)) // & + ' newdat=' // itoa(newdat) // ' nagain=' // itoa(nagain) // & + ' ndepth=' // itoa(ndepth) // ' max_drift=' // itoa(max_drift)) + + call timer('q65b ', 0) + call q65b(nutc, nqd, nxant, fcenter, nfcal, nfsample, ikhz, mousedf, & + ntol, xpol, idphi, mycall, mygrid, hiscall, hisgrid, mode_q65, f0, fqso, & + newdat, nagain, max_drift, ndop00, idec) + call timer('q65b ', 1) + + call dbg('map65a manual: Q65 result idec=' // itoa(idec) // ' nsnr0=' // itoa(nsnr0) // & + ' nfreq0=' // itoa(nfreq0) // ' xdt0=' // rtoa(xdt0) // ' msg0=[' // trim(msg0) // ']') + + ! NB: idec, as returned by q65b, is not a trustworthy success flag: + ! q65b derives it by parsing cq0(2:2) (see q65b.F90, label 900), and + ! cq0 is not reset on a failed attempt, so it can still read back + ! whatever digit was left over from an earlier, unrelated decode. + ! nsnr0 is q65b's own internal success test (freshly reset to -99 + ! immediately before it attempts this decode), so use that instead. + + q65_success = (nsnr0 .gt. -99) + ! On success, q65b has already written the decoded text itself + ! (write_stdout, plus units 26/21/12) because nqd=1 and the result + ! is within ntol of mousedf -- the same mechanism the wideband + ! quick-decode pass uses. Nothing further to add to km/msg/sig here. + endif + + !=========================== + ! EMIT DECODE(S) DIRECTLY + !=========================== + ! NB: this used to "go to 600" to reuse the wideband write/rescan + ! block, but that block lives inside "do nqd = 1, 0, -1 ... enddo" + ! while this code is lexically outside that loop. Branching into + ! the interior of a DO construct from outside it is illegal and + ! was causing a stray re-entrant q65b call (via the stale, never- + ! populated "cand" array) plus a "if (mode65.eq.0) km = 0" reset + ! that silently discarded the manual Q65 decode before it could be + ! written. Emit the km/msg/sig entries here instead. + if (jt65_success .or. q65_success .or. shorthand_detected) then + nwrite = 0 + + do k = 1, km + decoded = msg(k) + if (decoded .ne. ' ') then + nutc = sig(k,2) + freq = sig(k,3) + sync1 = sig(k,4) + dt = sig(k,5) + npol = nint(57.2957795*sig(k,6)) + flip = sig(k,7) + sync2 = sig(k,8) + nkv = sig(k,9) + nqual = sig(k,10) + if (flip .lt. 0.0) then + i = len_trim(decoded) + if (i .eq. 0) stop 'Error in message format' + if (i .le. 18) decoded(i + 2:i + 4) = 'OOO' + endif + nkHz = nint(freq - foffset) - nfshift + mhz = fcenter + f0 = mhz + 0.001*nkHz + ndf = nint(1000.0*(freq - foffset - (nkHz + nfshift))) + nsync1 = sync1 + s2db = 10.0*log10(sync2) - 40 + nsync2 = nint(s2db) + if (decoded(1:4) .eq. 'RO ' .or. decoded(1:4) .eq. 'RRR ' .or. & + decoded(1:4) .eq. '73 ') then + nsync2 = nint(1.33*s2db + 2.0) + endif + + nwrite = nwrite + 1 + if (nxant .ne. 0) then + npol = npol - 45 + if (npol .lt. 0) npol = npol + 180 + endif + + call txpol(xpol, decoded, mygrid, npol, nxant, ntxpol, cp) + + write (line, '("!",I3,I5,I4,I6.4,F5.1,I5,1X,A1,1X,A22,I2,I5,I5,1X,A1)') & + nkHz, ndf, npol, nutc, dt, nsync2, cm, decoded, nkv, nqual, ntxpol, cp + call write_stdout(trim(line)//new_line('a')) + endif + enddo ! k=1,km + + manualDecodeFlag = 0 + return + endif + + newdat = 0 + km = 0 + ncand = 0 + msg(1) = blank + msg(2) = blank + do j = 1, 30 + sig(1,j) = 0.0 + enddo + manualDecodeFlag = 0 + return + endif + + +!------------------------------------------------------------ +! WIDEBAND CODE RESUMES HERE +!------------------------------------------------------------ + +! km is "save"d across calls, but this point runs once per Find-dPhi trial +! (iloop 0..12 via "go to 2" below) as well as once for a normal decode. +! Without resetting it here, each later trial's "do k=1,km" write-out loop +! replays every earlier trial's decode(s) again verbatim -- the repeated, +! made-up-looking decodes seen with Find Delta Phi. +km = 0 + +! Only JT65 applies the trial phase; Q65 keeps the same input each time. +if (ndphi .eq. 1) then + ljt65decoded = .false. +endif + +ftol = 0.010 +fqso = mousefqso + foffset - 0.5*(nfa + nfb) + nfshift +nkhz_center = nint(1000.0*(fcenter - int(fcenter))) +mfa = nfa - nkhz_center + int(nrate_active/2000.0) +mfb = nfb - nkhz_center + int(nrate_active/2000.0) + +tsec_mod = real(mod(t_start, 60), kind=4) +! Number of samples to use for RMS check +n_rms = min(322, 2048) + +sumsq = 0.0d0 +do i2 = 1, n_rms + v = ss_dec(1, i2, 1) + sumsq = sumsq + v*v +end do + +if (n_rms > 0) then + rms = sqrt(sumsq / dble(n_rms)) +else + rms = 0.0d0 +endif + +if (nagain .eq. 0) then + call timer('get_cand', 0) + call get_candidates(ss_dec, savg_dec, xpol, nhsym, mfa, mfb, nts_jt65, nts_q65, cand, ncand) + call timer('get_cand', 1) + candec = .false. + ! TEMP diagnostic 2026-09-09 for the missing-upper-Q65-decode investigation. + call dbg('map65a: get_candidates done at t=' // rtoa(sec_midn()) // & + ' ncand=' // itoa(ncand) // ' n_q65cand=' // itoa(count(cand(1:max(ncand,0))%iflip == 0)) // & + ' bq65=' // itoa(merge(1,0,bq65)) // ' xpol=' // itoa(merge(1,0,xpol)) // & + ' nhsym=' // itoa(nhsym) // ' manualDecodeFlag_initial=' // itoa(manualDecodeFlag_initial)) +endif + do nqd = 1, 0, -1 + + call system_clock(t_now, t_rate) + call dbg('map65a: nqd loop top at t=' // rtoa(sec_midn()) // & + ' nqd=' // itoa(nqd) // ' elapsed=' // rtoa(real(t_now - t_start)/real(t_rate)) // & + ' manualDecodeFlag_initial=' // itoa(manualDecodeFlag_initial)) + if (real(t_now - t_start)/real(t_rate) > 40.0) then + abort_decode = .true. + call dbg('map65a: ABORT (40s budget exceeded) at t=' // rtoa(sec_midn()) // ' nqd=' // itoa(nqd)) + go to 700 + endif + + if (manualDecodeFlag_initial == 1 .and. nqd == 0) then + call dbg('map65a: nqd=0 CYCLE-skipped (manualDecodeFlag_initial=1) at t=' // rtoa(sec_midn())) + cycle + endif + + if (nqd .eq. 1) then !Quick decode, at fQSO fa = 1000.0*(fqso + 0.001*mousedf) - ntol - fb = 1000.0*(fqso + 0.001*mousedf) + ntol + 4*53.8330078 + fb = 1000.0*(fqso + 0.001*mousedf) + ntol + 4*(96000.0/1783.0) else !Wideband decode at all freqs fa = -1000*0.5*(nfb - nfa) + 1000*nfshift fb = 1000*0.5*(nfb - nfa) + 1000*nfshift + + ! Debug: report JT65 wideband search window + +!write(sfa, '(F20.6)') fa +!write(sfb, '(F20.6)') fb +!write(sspan, '(F20.6)') (fb-fa)/1000.0 + endif - ia = nint(fa/df) + 16385 - ib = nint(fb/df) + 16385 + icenter = nfft_active/2 + 1 + ia = nint(fa/df) + icenter + ib = nint(fb/df) + icenter ia = max(51, ia) - ib = min(32768 - 51, ib) + ib = min(nfft_active - 51, ib) if (ndiskdat .eq. 1 .and. mode65 .eq. 0) ib = ia - km = 0 nkm = 1 - nz = n/8 freq0 = -999. sync10 = -999. fshort0 = -999. @@ -173,15 +641,36 @@ contains jpz = 1 if (xpol) jpz = 4 + ! TEMP diagnostic 2026-09-09 for the missing-other-JT65-signal investigation. + call dbg('map65a: JT65 sweep window at t=' // rtoa(sec_midn()) // & + ' nqd=' // itoa(nqd) // ' fa=' // rtoa(fa) // ' fb=' // rtoa(fb) // & + ' ia=' // itoa(ia) // ' ib=' // itoa(ib) // ' km_entering=' // itoa(km)) + do i = ia, ib !Search over freq range - freq = 0.001*(i - 16385)*df + + call system_clock(t_now, t_rate) + if (real(t_now - t_start)/real(t_rate) > 40.0) then + call dbg('Decode abort: exceeded 40 seconds in do i = ia, ib pass, nqd=' // itoa(nqd) // ' i=' // itoa(i)) + abort_decode = .true. + ! "go to 700" here used to jump past the Q65 candidate-decode + ! loop below (do icand = 1, ncand), which only runs after this + ! JT65 sweep completes -- so a slow JT65 sweep (e.g. many + ! birdie-triggered decode1a calls) could burn the whole 40 s + ! budget and starve Q65 of any decode attempt at all, even + ! though its candidates were already found by get_candidates() + ! before this loop started. Just stop scanning more JT65 bins + ! instead, so Q65 still gets its turn this pass. + exit + endif + + freq = 0.001*(i - icenter)*df ! Find the local base level for each polarization; update every 10 bins. if (mod(i - ia, 10) .eq. 0) then do jp = 1, jpz do ii = -50, 50 iii = i + ii - if (iii .ge. 1 .and. iii .le. 32768) then - tavg(ii) = savg(jp, iii) + if (iii .ge. 1 .and. iii .le. nfft_active) then + tavg(ii) = savg_dec(jp, iii) else write (13, *) 'Error in iii:', iii, ia, ib, fa, fb flush (13) @@ -196,8 +685,8 @@ contains smax = 0. jpmax = 1 do jp = 1, jpz - if (savg(jp, i)/base(jp) .gt. smax) then - smax = savg(jp, i)/base(jp) + if (savg_dec(jp, i)/base(jp) .gt. smax) then + smax = savg_dec(jp, i)/base(jp) jpmax = jp endif enddo @@ -207,9 +696,18 @@ contains ! Look for JT65 sync patterns and shorthand square-wave patterns. call timer('ccf65 ', 0) ssmax = 1.e30 - call ccf65(ss(:,:,i), nhsym, ssmax, sync1, ipol, jpz, dt, flipk, & + call ccf65(ss_dec(:,:,i), nhsym, ssmax, sync1, ipol, jpz, dt, flipk, & syncshort, snr2, ipol2, dt2) call timer('ccf65 ', 1) + ! 2026-09-12: instrumentation for the "identical anomalous + ! dtbest across several consecutive nqd=0 candidates" investigation. + ! Logging ccf65's own per-candidate dt (the value that becomes + ! decode1a's dt00 input) so a live capture can show directly + ! whether the staleness/repetition already exists at THIS + ! input, before decode1a/afc65b ever runs. + call dbg('map65a: ccf65 result at t=' // rtoa(sec_midn()) // & + ' nqd=' // itoa(nqd) // ' i=' // itoa(i) // ' dt=' // rtoa(dt) // & + ' sync1=' // rtoa(sync1) // ' ntry=' // itoa(ntry)) if (mode65 .eq. 0) syncshort = -99.0 !If "No JT65", don't waste time ! ########################### Search for Shorthand Messages ################# @@ -229,7 +727,7 @@ contains ! Should this be i0 +/- 1, or just i0? ! Should we also insist that difference in DT be either 1.5 or -1.5 s? if (short(1, i0) .gt. thresh0) then - fshort = 0.001*(i0 - 16385)*df + fshort = 0.001*(i0 - icenter)*df noffset = 0 if (nqd .eq. 1) noffset = nint(1000.0*(fshort - fqso) - mousedf) if (abs(noffset) .le. ntol) then @@ -252,7 +750,7 @@ contains sig(km, 9) = 0 sig(km, 10) = 0 ! sig(km,11)=rms0 - sig(km, 12) = savg(ipol2, i) + sig(km, 12) = savg_dec(ipol2, i) sig(km, 13) = 0 sig(km, 14) = 0 sig(km, 15) = 0 @@ -277,11 +775,42 @@ contains if (nqd .eq. 1 .and. ntol .le. 100) thresh1 = 0. noffset = 0 if (nqd .ge. 1) noffset = nint(1000.0*(freq - fqso) - mousedf) - if (newdat .eq. 1 .and. sync1 .gt. -99.0) then + initialization_only = .false. + if (newdat .eq. 1 .and. sync1 .gt. -99.0 .and. & + (sync1 .le. thresh1 .or. abs(noffset) .gt. ntol)) then + initialization_only = .true. sync1 = thresh1 + 1.0 noffset = 0 endif + ! Computed once per candidate, before the "keep only best + ! within ftol" collapse logic just below -- see the SKIPPED + ! branch right after for why the ordering matters. Must be + ! false whenever initialization_only is true: that probe + ! doesn't accumulate anything regardless, but still needs + ! decode1a() called once per sweep for its own internal + ! state, so it must not be intercepted here. + already_decoded_nearby = (.not. initialization_only) .and. & + any(ljt65decoded(max(1,i-JT65_LOCAL_BINS):min(nfft_active,i+JT65_LOCAL_BINS))) + if (sync1 .gt. thresh1 .and. abs(noffset) .le. ntol) then + if (already_decoded_nearby) then + ! Skip a candidate whose bin (or a nearby one, within + ! JT65_LOCAL_BINS) already produced a real decode + ! earlier this same accumulation cycle, mirroring + ! Q65's ldecoded(ipk) (decodes_mod.f90) -- otherwise a + ! repeat automatic call re-discovers and re-emits the + ! same JT65 decode. + ! + ! Must run before the "keep only best within ftol" + ! collapse logic below, not after: that logic's + ! "km=km-1" runs unconditionally, on the assumption + ! that accumulation always follows with a matching + ! "km=km+1" -- skipping AFTER that decrement leaves it + ! unmatched and silently drives km negative, hiding + ! the whole signal from this pass's output. + call dbg('map65a: JT65 i=' // itoa(i) // & + ' SKIPPED (already decoded nearby this cycle) at t=' // rtoa(sec_midn())) + else ! Keep only the best candidate within ftol. ! (Am I deleting any good decodes by doing this?) if(freq-freq0.le.ftol .and. sync1.gt.sync10 .and. & @@ -292,25 +821,52 @@ contains ntry = ntry + 1 if ((nqd .eq. 1 .and. ntry .ge. 40) .or. & (nqd .eq. 0 .and. ntry .ge. 400)) then - ! Too many calls to decode1a! + ! Too many calls to decode1a for this pass -- stop scanning more + ! frequency bins for JT65 candidates here, but only here: exit just this + ! do i=ia,ib sweep. A "go to 900" used to jump all the way past the rest + ! of this pass (including the wideband Q65 full-decode loop further + ! below when nqd=0), all remaining nqd passes, and the post-loop + ! cleanup/display() -- silently costing Q65 a whole minute even though + ! the abort was tripped by JT65 candidate volume, not a Q65 problem. + call dbg('map65a: Signal too strong, decoding aborted, nqd=' // itoa(nqd) // & + ' ntry=' // itoa(ntry) // ' i=' // itoa(i)) call write_stdout('! Signal too strong, or suspect data? Decoding aborted.'//new_line('a')) write (13, *) 'Signal too strong, or suspect data? Decoding aborted.' flush (13) - go to 900 + exit endif call timer('decode1a', 0) ifreq = i ikhz = nint(freq + 0.5*(nfa + nfb) - foffset) - nfshift idf = nint(1000.0*(freq + 0.5*(nfa + nfb) - foffset - (ikHz + nfshift))) - call decode1a(dd, newdat, f00, nflip, mode65, nfsample, & + + call decode1a(dd, newdat, f00, nflip, merge(0,mode65,initialization_only), nfsample, & xpol, mycall, hiscall, hisgrid, neme, ndepth, nqd, dphi, & ndphi, nutc, ikHz, idf, ipol, ntol, sync2, & a, dt, pol, nkv, nhist, nsum, nsave, qual, decoded) call timer('decode1a', 1) + ! 2026-09-12: paired with the ccf65 instrumentation above -- + ! logs decode1a's OUTPUT dt (dt00+dtbest+1.7, so this + ! encodes dtbest even though dtbest itself isn't passed + ! back to this scope), the running real-candidate count + ! this pass (ntry, already used for the "signal too + ! strong" abort check), and elapsed wall-clock time, so a + ! live capture can show whether the anomaly correlates + ! with how many real candidates/how much time this pass + ! has already chewed through before reaching this one. + call dbg('map65a: decode1a call ' // itoa(ntry) // ' this pass at t=' // & + rtoa(sec_midn()) // ' nqd=' // itoa(nqd) // ' i=' // itoa(i) // & + ' f00=' // rtoa(real(f00)) // ' dt_out=' // rtoa(dt) // & + ' initialization_only=' // itoa(merge(1,0,initialization_only)) // & + ' decoded="' // trim(decoded) // '"') + + call dbg('map65a: decode1a result at t=' // rtoa(sec_midn()) // & + ' nqd=' // itoa(nqd) // ' i=' // itoa(i) // ' freq=' // rtoa(freq) // & + ' sync1=' // rtoa(sync1) // ' initialization_only=' // itoa(merge(1,0,initialization_only)) // & + ' decoded="' // trim(decoded) // '"') -! The case sync1=2.0 is just to make sure decode1a is called and bigfft done. - if (mode65 .ne. 0 .and. sync1 .ne. 2.000000) then + if (mode65 .ne. 0 .and. .not. initialization_only) then if (km .lt. MAXMSG) km = km + 1 sig(km, 1) = nfile sig(km, 2) = nutc @@ -323,7 +879,7 @@ contains sig(km, 9) = nkv sig(km, 10) = qual ! sig(km,11)=idphi - sig(km, 12) = savg(ipol, i) + sig(km, 12) = savg_dec(ipol, i) sig(km, 13) = a(1) sig(km, 14) = a(2) sig(km, 15) = a(3) @@ -334,15 +890,24 @@ contains freq0 = freq sync10 = sync1 nkm = 1 + ! The lookup supplies the neighborhood radius; + ! marking it here too would double the exclusion. + if (decoded .ne. ' ') & + ljt65decoded(i) = .true. endif endif + endif endif endif enddo !i=ia,ib - + + call dbg('map65a: JT65 sweep done at t=' // rtoa(sec_midn()) // & + ' nqd=' // itoa(nqd) // ' km_exiting=' // itoa(km) // ' ntry=' // itoa(ntry)) + if (nqd .eq. 1) then nwrite = 0 if (mode65 .eq. 0) km = 0 + do k = 1, km decoded = msg(k) if (decoded .ne. ' ') then @@ -382,15 +947,16 @@ contains endif call txpol(xpol, decoded, mygrid, npol, nxant, ntxpol, cp) - + if (ndphi .eq. 0) then write (line, '("!",I3,I5,I4,I6.4,F5.1,I5,1X,A1,1X,A22,I2,I5,I5,1X,A1)') & nkHz, ndf, npol, nutc, dt, nsync2, cm, decoded, nkv, nqual, ntxpol, cp call write_stdout(trim(line)//new_line('a')) else if (iloop .ge. 1) qphi(iloop) = sig(k, 10) + write (line, '("!",I3,I5,I4,I6.4,F5.1,I5,1X,A1,1X,A22,I2,I5,I5,1X,A1)') & - nkHz, ndf, npol, nutc, dt, nsync2, cm, decoded, nkv, nqual, 30*iloop + nkHz, ndf, npol, nutc, dt, nsync2, cm, decoded, nkv, nqual, 30*iloop, '-' call write_stdout(trim(line)//new_line('a')) write (27, 1011) 30*iloop, nkHz, ndf, npol, nutc, & dt, sync2, nkv, nqual, cm, decoded @@ -403,28 +969,40 @@ contains q65b_called = .false. do icand = 1, ncand if (cand(icand)%iflip .ne. 0) cycle !Keep only Q65 candidates - freq = cand(icand)%f + nkhz_center - 48.0 - 1.27046 + freq = cand(icand)%f + nkhz_center - real(nrate_active)/2000.0 - 1.27046 nhzdiff = nint(1000.0*(freq - mousefqso) - mousedf) - nfcal ! Now looking for "quick decode" (nqd=1) candidates at cursor freq +/- ntol. if (nqd .eq. 1 .and. abs(nhzdiff) .gt. ntol) cycle ikhz = mousefqso q65b_called = .true. f0 = cand(icand)%f - call timer('q65b ', 0) + call timer('q65b ', 0) + call q65b(nutc, nqd, nxant, fcenter, nfcal, nfsample, ikhz, mousedf, & - ntol, xpol, mycall, mygrid, hiscall, hisgrid, mode_q65, f0, fqso, & - newdat, nagain, max_drift, ndop00, idec) + ntol, xpol, idphi, mycall, mygrid, hiscall, hisgrid, mode_q65, f0, fqso, & + newdat, nagain, max_drift, ndop00, idec) + call timer('q65b ', 1) - if (idec .ge. 0) candec(icand) = .true. + + ! idec is not a trustworthy success flag here -- q65b + ! derives it from cq0(2:2), which is not reset on a + ! failed/no-op attempt, so a later candidate in this same + ! loop can falsely read back an earlier candidate's + ! leftover cq0 digit. nsnr0 is reset to -99 at the top of + ! every q65b() call (q65b.F90) and can't carry state + ! across candidates this way. + if (nsnr0 .gt. -99) candec(icand) = .true. enddo if (.not. q65b_called) then freq = mousefqso + 0.001*mousedf ikhz = mousefqso - f0 = freq - (nkhz_center - 48.0 - 1.27046) !### ??? ### + f0 = freq - (nkhz_center - real(nrate_active)/2000.0 - 1.27046) call timer('q65b ', 0) + call q65b(nutc, nqd, nxant, fcenter, nfcal, nfsample, ikhz, mousedf, & - ntol, xpol, mycall, mygrid, hiscall, hisgrid, mode_q65, f0, fqso, & - newdat, nagain, max_drift, ndop00, idec) + ntol, xpol, idphi, mycall, mygrid, hiscall, hisgrid, mode_q65, f0, fqso, & + newdat, nagain, max_drift, ndop00, idec, cursor_fallback=.true.) + call timer('q65b ', 1) endif endif @@ -440,7 +1018,7 @@ contains go to 2 endif - if (ndphi .eq. 1 .and. iloop .eq. 12) call getdphi(qphi) + if (ndphi .eq. 1 .and. iloop .eq. 12 .and. nqd .eq. 1) call getdphi(qphi) if (nqd .eq. 1) then call sec0(1, tdec) write (line, '("",3I4,I6,F6.2)') & @@ -454,55 +1032,66 @@ contains close (16) endif call sec0(1, tsec0) - if (nhsym .eq. nhsym1 .and. tsec0 .gt. 3.0) go to 700 - if (nqd .eq. 1 .and. nagain .eq. 1) go to 900 + call dbg('map65a: end of nqd=' // itoa(nqd) // ' body at t=' // rtoa(sec_midn()) // & + ' tsec0=' // rtoa(tsec0) // ' nhsym=' // itoa(nhsym) // ' nagain=' // itoa(nagain)) + if (nhsym .eq. nhsym1 .and. tsec0 .gt. 3.0) then + call dbg('map65a: ABORT (early-pass 3s budget) at t=' // rtoa(sec_midn()) // & + ' tsec0=' // rtoa(tsec0) // ' -- nqd=0 will NOT run this pass') + go to 700 + endif + if (nqd .eq. 1 .and. nagain .eq. 1) then + call dbg('map65a: SKIP nqd=0 (nagain=1, manual repeat) at t=' // rtoa(sec_midn())) + go to 900 + endif if (nqd .eq. 0 .and. bq65) then ! Do the wideband Q65 decode do icand = 1, ncand if (cand(icand)%iflip .ne. 0) cycle !Do only Q65 candidates here if (candec(icand)) cycle !Skip if already decoded - freq = cand(icand)%f + nkhz_center - 48.0 - 1.27046 + freq = cand(icand)%f + nkhz_center - real(nrate_active)/2000.0 - 1.27046 !###! If here at nqd=1, do only candidates at mousefqso +/- ntol !### if(nqd.eq.1 .and. abs(freq-mousefqso).gt.0.001*ntol) cycle ikhz = nint(freq) f0 = cand(icand)%f call timer('q65b ', 0) - call q65b(nutc, nqd, nxant, fcenter, nfcal, nfsample, ikhz, mousedf, ntol, & - xpol, mycall, mygrid, hiscall, hisgrid, mode_q65, f0, fqso, newdat, & - nagain, max_drift, ndop00, idec) + + call q65b(nutc, nqd, nxant, fcenter, nfcal, nfsample, ikhz, mousedf, & + ntol, xpol, idphi, mycall, mygrid, hiscall, hisgrid, mode_q65, f0, fqso, & + newdat, nagain, max_drift, ndop00, idec) + call timer('q65b ', 1) - if (idec .ge. 0) candec(icand) = .true. + + ! See the matching note on the nqd==1 candidate loop above -- + ! idec is unreliable across back-to-back q65b() calls in the + ! same loop; use nsnr0 instead. + if (nsnr0 .gt. -99) candec(icand) = .true. + if (abort_decode) go to 700 enddo ! icand - endif + endif call sec0(1, tsec0) + call system_clock(t_now, t_rate) + if (real(t_now - t_start)/real(t_rate) > 40.0) then + call dbg('Decode abort: exceeded 40 seconds at end of do nqd = 1, 0, -1 pass, nqd=' // itoa(nqd)) + abort_decode = .true. + go to 700 + endif + enddo ! nqd -! Trim the list and produce a sorted index and sizes of groups. -! (Should trimlist remove all but best SNR for given UTC and message content?) 700 continue - if (km < 0) km = 0 ! single safety clamp - call trimlist(sig, km, ftol, indx, nsiz, nz) + ! TEMP diagnostic 2026-09-09 for the missing-other-signals-in-Messages investigation. + call dbg('map65a: reached label 700 at t=' // rtoa(sec_midn()) // & + ' km=' // itoa(km) // ' abort_decode=' // itoa(merge(1,0,abort_decode)) // & + ' nhsym=' // itoa(nhsym)) + call select_unique_decodes(sig, msg, km, ftol, RESULT_DT_TOLERANCE, indx, nz) + call dbg('map65a: select_unique_decodes done at t=' // rtoa(sec_midn()) // & + ' km=' // itoa(km) // ' nz=' // itoa(nz)) - if (km .gt. 0) done(1:km) = .false. - j = 0 - ilatest = -1 do n = 1, nz - ifile0 = 0 - do m = 1, nsiz(n) - i = indx(j + m) - ifile = sig(i, 1) - if (ifile .gt. ifile0 .and. msg(i) .ne. blank) then - ilatest = i - ifile0 = ifile - endif - enddo - i = ilatest - + i = indx(n) if (i .ge. 1) then - if (.not. done(i)) then - done(i) = .true. nutc = sig(i, 2) freq = sig(i, 3) sync1 = sig(i, 4) @@ -546,9 +1135,9 @@ contains npol = npol - 45 if (npol .lt. 0) npol = npol + 180 endif - + call txpol(xpol, decoded, mygrid, npol, nxant, ntxpol, cp) - + cmode = '#A' if (mode65 .eq. 2) cmode = '#B' if (mode65 .eq. 4) cmode = '#C' @@ -559,11 +1148,8 @@ contains write (21, 1100) f0, ndf, dt, npol, nsync2, nutc, decoded, '#', cp, & cmode(1:1), cmode(2:2)! was decoded,cp, 1100 format(f8.3, i5, f5.1, 2i4, i5.4, 2x, a22, 7x, 2a1, 3x, a1, 1x, a1) ! was a22,2x,a1,1x,a1 - endif - endif - j = j + nsiz(n) - enddo !i=1,km + enddo write (26, 1015) nutc 1015 format(37x, i6.4, ' ') diff --git a/map65/libm65/mapsim.f90 b/map65/libm65/mapsim.f90 index 8b1d2aa6..9daa21ed 100644 --- a/map65/libm65/mapsim.f90 +++ b/map65/libm65/mapsim.f90 @@ -2,29 +2,32 @@ module dopspread_mod implicit none contains - subroutine dopspread(cwave,fspread) + subroutine dopspread(cwave, npts, fsample, fspread) use four2a_mod use gran_interface use iso_fortran_env, only: real32, real64 implicit none - integer, parameter :: NMAX=60*96000 - integer, parameter :: NFFT=NMAX, NH=NFFT/2 - complex, intent(inout) :: cwave(NMAX) - real(real64), intent(in) :: fspread - complex, allocatable :: cspread(:) + integer, intent(in) :: npts + real(real64), intent(in) :: fsample, fspread + complex(real32), intent(inout) :: cwave(npts) + + integer :: nfft, nh, i + complex(real32), allocatable :: cspread(:) real(real32) :: twopi, df, b, f, x, a, phi1, phi2 real(real32) :: sum, p, avep, fac - complex :: z - integer :: i - - allocate(cspread(0:NMAX-1)) - - twopi=8.0*atan(1.0) - df=96000.0/nfft + complex(real32) :: z + + nfft = npts + nh = nfft/2 + allocate(cspread(0:nfft-1)) + + twopi = 8.0*atan(1.0) + df = real(fsample,real32)/real(nfft,real32) + cspread(0)=1.0 - cspread(NH)=0. + cspread(nh)=0. b=6.0 !Use truncated Lorenzian shape for fspread - do i=1,NH + do i=1,nh f=i*df x=b*f/fspread z=0. @@ -73,9 +76,9 @@ program mapsim use iso_fortran_env, only: real32, real64, int16 implicit none - integer, parameter :: NMAX=60*96000 + integer :: NMAX - real(real32) d4(4,NMAX) !Floating-point data + real(real32), allocatable :: d4(:,:) !Floating-point data integer(int16), allocatable :: id4(:,:) !i*2 data, dual polarization integer(int16), allocatable :: id2(:,:) !i*2 data, single polarization complex(real32), allocatable :: cwave(:) !i*2 data, single polarization @@ -97,6 +100,7 @@ program mapsim integer :: nargs, nsigs, npol, nfiles, isig, nmin, ifile integer :: ntone_spacing, ntxfreq, nsendingsh, nwave, npts integer :: ilist, i0, i, j + integer :: sRatekHz data msg_list/ & ! 'CQ K1WDG/R','CQ YL/EA8DBM',' OH3LWP KP11', & @@ -133,14 +137,10 @@ program mapsim 'W7IYI K8JYJ EM54','W9KYK K0LYL EM55','G0MYM F1NYN JN56', & 'G2OYO F3PYP JN57','G4QYQ F5RYR JN58','G6SYS F7TYT JN59'/ - allocate(id4(4,NMAX)) !i*2 data, dual polarization - allocate(id2(2,NMAX)) !i*2 data, single polarization - allocate(cwave(NMAX)) !Generated complex waveform (no noise) - nargs=command_argument_count() - if(nargs.ne.12) then - print*,'Usage: mapsim "message" mode DT fa fb nsigs pol fDop SNR nfiles fcenter HHmm' - print*,'Example: mapsim "CQ K1ABC FN42" B 2.5 -20 20 21 45 0.0 -20 1 1296.1 1803' + if(nargs.ne.13) then + print*,'Usage: mapsim "message" mode DT fa fb nsigs pol fDop SNR nfiles fcenter HHmm sRatekHz' + print*,'Example: mapsim "CQ K1ABC FN42" B 2.5 -20 20 21 45 0.0 -20 1 1296.1 1803 96' print*,' ' print*,' mode = A B C for JT65; QA-QE for Q65-60A' print*,' fa = lowest freq in kHz, relative to center' @@ -148,6 +148,7 @@ program mapsim print*,' message = "list" to use callsigns from list' print*,' pol = -1 to generate a range of polarization angles.' print*,' SNR = 0 to generate a range of SNRs.' + print*,' sRateKHz must be one of 96, 128, 192,256' go to 999 endif @@ -174,16 +175,31 @@ program mapsim read(arg,*) fcenter ! added by w3sz call get_command_argument(12,arg) ! added by w3sz read(arg,*) hhmm ! added by w3sz + call get_command_argument(13,arg) ! added by w3sz + read(arg,*) sRatekHz ! added by w3sz + + if (sRatekHz /= 96 .and. sRatekHz /= 128 .and. sRatekHz /= 192 .and. sRatekHz /= 256) then + write(*,*) 'ERROR: Invalid sample rate ', sRatekHz, ' kHz' + write(*,*) 'Allowed sample rates are: 96, 128, 192, 256 kHz' + stop + endif + + fsample = 1000.d0 * sRatekHz + dt = 1.d0 / fsample + NMAX = 60 * sRatekHz * 1000 + npts = NMAX + allocate(d4(4, NMAX)) + allocate(id4(4,NMAX)) + allocate(id2(2,NMAX)) + allocate(cwave(NMAX)) message=msg0 !Transmitted message rmsdb=25. rms=10.0**(0.05*rmsdb) ! w3sz fcenter=144.125d0 !Center frequency (MHz) - fsample=96000.d0 !Sample rate (Hz) - dt=1.d0/fsample !Sample interval (s) twopi=8.d0*atan(1.d0) rad=360.0/twopi - samfac=1.d0 + samfac = fsample / 96000.d0 bq65=(mode(1:1).eq.'Q') ntone_spacing=1 ntxfreq=1270 @@ -192,7 +208,6 @@ program mapsim if(mode(1:1).eq.'C' .or. mode(2:2).eq.'C') ntone_spacing=4 if(mode(2:2).eq.'D') ntone_spacing=8 if(mode(2:2).eq.'E') ntone_spacing=16 - npts=NMAX nsendingsh=0 ! Initialize nsendingsh (was implicit?) write(*,1000) @@ -203,35 +218,23 @@ program mapsim nmin=ifile-1 if(mode(2:2).eq.' ') nmin=2*nmin write(fname, '(I6.6, "_", I4.4)') ifile, hhmm !Create the output filenames ! w3sz was nmin - open(10,file=fname//'.iq',access='stream',status='unknown') - open(11,file=fname//'.tf2',access='stream',status='unknown') + open(10,file=fname//'.iq',access='stream',status='replace') + open(11,file=fname//'.tf2',access='stream',status='replace') call noisegen(d4,npts) !Generate Gaussuian noise if(msg0(1:4).ne.'list') then - if(bq65) then - call gen_q65_cwave(message,ntxfreq,ntone_spacing,msgsent, & - cwave,nwave) - else - call cgen65(message,ntone_spacing,samfac,nsendingsh,msgsent, & - cwave,nwave) - endif + call generate_cwave(message,msgsent,cwave,nwave) endif - if(fdop.gt.0.0) call dopspread(cwave,fdop) + if(fdop.gt.0.0) call dopspread(cwave,npts,fsample,fdop) do isig=1,nsigs if(msg0(1:4).eq.'list') then ilist=ilist+1 message=msg_list(ilist) - if(bq65) then - call gen_q65_cwave(message,ntxfreq,ntone_spacing,msgsent, & - cwave,nwave) - else - call cgen65(message,ntone_spacing,samfac,nsendingsh,msgsent, & - cwave,nwave) - endif + call generate_cwave(message,msgsent,cwave,nwave) endif if(npol.lt.0) pol=(isig-1)*180.0/nsigs @@ -243,7 +246,7 @@ program mapsim snrdbx=snrdb if(snrdb.eq.0.0) snrdbx=-15.0 - 15.0*(isig-1.0)/nsigs - sig=sqrt(2.2*2500.0/96000.0) * 10.0**(0.05*snrdbx) + sig = sqrt(2.2*2500.0/fsample) * 10.0**(0.05*snrdbx) write(*,1020) ifile,isig,mode,dt0,0.001*f,nint(pol),fDop,snrdbx,msgsent 1020 format(i3,i3,2x,a2,f6.2,f8.3,i5,2f7.1,2x,a24) !w3sz was a22 @@ -276,15 +279,38 @@ program mapsim id2(2,i)=id4(2,i) enddo + write(*,*) 'DEBUG: fsample =', fsample, ' sRatekHz =', sRatekHz, & + ' NMAX =', NMAX, ' npts =', npts + write(10) fcenter,id2(1:2,1:npts) write(11) fcenter,id4(1:4,1:npts) close(10) close(11) enddo - + deallocate(d4) deallocate(id4) deallocate(id2) deallocate(cwave) -999 end program mapsim +999 continue +contains + + subroutine generate_cwave(message,msgsent,cwave,nwave) + character(len=*),intent(inout) :: message + character(len=*),intent(out) :: msgsent + complex, intent(out) :: cwave(:) + integer, intent(out) :: nwave + + ! cgen65 defines only 22 characters; blank-fill so the a24 output is fully defined + msgsent = ' ' + if(bq65) then + call gen_q65_cwave(message,ntxfreq,ntone_spacing,fsample,msgsent, & + cwave,nwave) + else + call cgen65(message,ntone_spacing,samfac,nsendingsh,msgsent, & + cwave,nwave) + endif + end subroutine generate_cwave + +end program mapsim diff --git a/map65/libm65/nchar.f90 b/map65/libm65/nchar.f90 index 1a7f2e11..5f8688f0 100644 --- a/map65/libm65/nchar.f90 +++ b/map65/libm65/nchar.f90 @@ -16,6 +16,7 @@ contains else if(c.ge.' ') then n=36 else + ! TODO: Return an invalid status instead of terminating MAP65. ! Print*,'Invalid character in callsign ',c,' ',ichar(c) stop 1 endif diff --git a/map65/libm65/npar_ptrs_mod.f90 b/map65/libm65/npar_ptrs_mod.f90 index ff8d4b0d..f33a92fc 100644 --- a/map65/libm65/npar_ptrs_mod.f90 +++ b/map65/libm65/npar_ptrs_mod.f90 @@ -2,27 +2,148 @@ module npar_ptrs_mod use iso_c_binding implicit none - ! Scalar values - real(c_double) :: fcenter ! RF center frequency (MHz) - integer(c_int) :: nfa ! Low decode limit (kHz, RF-relative) - integer(c_int) :: nfb ! High decode limit (kHz, RF-relative) - integer(c_int) :: nfshift ! Display center shift (kHz, RF-relative) - integer(c_int) :: nfcal ! Frequency calibration offset (Hz) - integer(c_int) :: nutc, idphi, mousedf, mousefqso, nagain, ndepth - integer(c_int) :: ndiskdat, neme, newdat,map65RxLog - integer(c_int) :: mcall3, ntimeout, ntol, nxant, nfsample - integer(c_int) :: nxpol, nmode, nsave, max_drift, nhsym - integer(c_int) :: ndop00,nrxlog,nkeep - character(len=12) :: mycall, hiscall - character(len=6) :: mygrid, hisgrid - character(len=20) :: datetime ! changed 1/4/26 to match legacy code - integer(c_int) :: stop_m65 = 0 - integer(c_int) :: decoder_ready = 0 + type :: decode_parameters + real(c_double) :: fcenter = 0 + real(c_double) :: ftol_nb = 0 + integer(c_int) :: nfa = 0 + integer(c_int) :: nfb = 0 + integer(c_int) :: nfshift = 0 + integer(c_int) :: nfcal = 0 + integer(c_int) :: nutc = 0 + integer(c_int) :: idphi = 0 + integer(c_int) :: mousedf = 0 + integer(c_int) :: mousefqso = 0 + integer(c_int) :: nagain = 0 + integer(c_int) :: ndepth = 0 + integer(c_int) :: ndiskdat = 0 + integer(c_int) :: neme = 0 + integer(c_int) :: newdat = 0 + integer(c_int) :: map65RxLog = 0 + integer(c_int) :: mcall3 = 0 + integer(c_int) :: ntimeout = 0 + integer(c_int) :: ntol = 0 + integer(c_int) :: nxant = 0 + integer(c_int) :: nfsample = 0 + integer(c_int) :: nxpol = 0 + integer(c_int) :: nmode = 0 + integer(c_int) :: nsave = 0 + integer(c_int) :: max_drift = 0 + integer(c_int) :: nhsym = 0 + integer(c_int) :: ndop00 = 0 + integer(c_int) :: nrxlog = 0 + integer(c_int) :: nkeep = 0 + integer(c_int) :: manualDecodeFlag = 0 + character(len=12) :: mycall = '' + character(len=12) :: hiscall = '' + character(len=6) :: mygrid = '' + character(len=6) :: hisgrid = '' + character(len=20) :: datetime = '' + end type + + ! GUI setters prepare draft; only the decoder changes active after claiming a request. + type(decode_parameters), target, save :: active + type(decode_parameters), save :: draft + type :: decode_request + type(decode_parameters) :: parameters + integer(c_int64_t) :: id + integer(c_int64_t) :: input_generation + type(decode_request), pointer :: next => null() + end type + type(decode_request), pointer, save :: pending_head => null(), pending_tail => null() + integer(c_int64_t), save :: published_request_id = 0 + integer(c_int64_t), save :: active_request_id = 0 + integer(c_int64_t), save :: live_input_generation = 0 + integer(c_int64_t), save :: active_input_generation = 0 + logical, save :: active_request_expired = .false. + + real(c_double), pointer :: fcenter => active%fcenter + real(c_double), pointer :: ftol_nb => active%ftol_nb + integer(c_int), pointer :: nfa => active%nfa + integer(c_int), pointer :: nfb => active%nfb + integer(c_int), pointer :: nfshift => active%nfshift + integer(c_int), pointer :: nfcal => active%nfcal + integer(c_int), pointer :: nutc => active%nutc + integer(c_int), pointer :: idphi => active%idphi + integer(c_int), pointer :: mousedf => active%mousedf + integer(c_int), pointer :: mousefqso => active%mousefqso + integer(c_int), pointer :: nagain => active%nagain + integer(c_int), pointer :: ndepth => active%ndepth + integer(c_int), pointer :: ndiskdat => active%ndiskdat + integer(c_int), pointer :: neme => active%neme + integer(c_int), pointer :: newdat => active%newdat + integer(c_int), pointer :: map65RxLog => active%map65RxLog + integer(c_int), pointer :: mcall3 => active%mcall3 + integer(c_int), pointer :: ntimeout => active%ntimeout + integer(c_int), pointer :: ntol => active%ntol + integer(c_int), pointer :: nxant => active%nxant + integer(c_int), pointer :: nfsample => active%nfsample + integer(c_int), pointer :: nxpol => active%nxpol + integer(c_int), pointer :: nmode => active%nmode + integer(c_int), pointer :: nsave => active%nsave + integer(c_int), pointer :: max_drift => active%max_drift + integer(c_int), pointer :: nhsym => active%nhsym + integer(c_int), pointer :: ndop00 => active%ndop00 + integer(c_int), pointer :: nrxlog => active%nrxlog + integer(c_int), pointer :: nkeep => active%nkeep + integer(c_int), pointer :: manualDecodeFlag => active%manualDecodeFlag + character(len=12), pointer :: mycall => active%mycall + character(len=12), pointer :: hiscall => active%hiscall + character(len=6), pointer :: mygrid => active%mygrid + character(len=6), pointer :: hisgrid => active%hisgrid + character(len=20), pointer :: datetime => active%datetime + integer(c_int) :: stop_m65 = 0 + integer(c_int) :: decoder_ready = 0 character(len=512) :: wsjtx_dir = '' - + integer(c_int) :: nrate_active = 96000 + integer(c_int) :: nfft_active = 32768 + integer(c_int) :: nsmax_active = 60*96000 + integer(c_int) :: nfft_big_active = 56*96000 + integer(c_int) :: t_start = -1 + logical(c_bool) :: abort_decode = .false. + + interface + subroutine lock_decode_requests() bind(C) + end subroutine + subroutine unlock_decode_requests() bind(C) + end subroutine + end interface + contains + subroutine set_manual_decode_flag(val) bind(C, name="set_manual_decode_flag") + integer(c_int), value :: val + call lock_decode_requests() + draft%manualDecodeFlag = val + call unlock_decode_requests() + end subroutine + + function get_manual_decode_flag() bind(C, name="get_manual_decode_flag") + use iso_c_binding + integer(c_int) :: get_manual_decode_flag + call lock_decode_requests() + get_manual_decode_flag = draft%manualDecodeFlag + call unlock_decode_requests() + end function + + subroutine set_ftol_nb(val) bind(C, name="set_ftol_nb") + integer(c_int), value :: val + call lock_decode_requests() + draft%ftol_nb = val + call unlock_decode_requests() + end subroutine + + subroutine set_runtime_params(rate_hz, nfft, nfft_big) bind(C, name="set_runtime_params_") + use iso_c_binding + implicit none + integer(c_int), value :: rate_hz, nfft, nfft_big + + nrate_active = rate_hz + nfft_active = nfft + nsmax_active = 60*rate_hz + nfft_big_active = nfft_big + end subroutine set_runtime_params + subroutine set_wsjtx_dir(path, path_len) bind(C, name="set_wsjtx_dir_") use iso_c_binding implicit none @@ -41,48 +162,63 @@ contains subroutine set_stop_m65(val) bind(C, name="set_stop_m65") use iso_c_binding integer(c_int), value :: val + call lock_decode_requests() stop_m65 = 0 - if (val /= 0) stop_m65 = 1 + if (val /= 0) then + stop_m65 = 1 + call clear_pending_requests() + endif + call unlock_decode_requests() end subroutine subroutine set_decoder_ready(val) bind(C, name="set_decoder_ready") use iso_c_binding integer(c_int), value :: val + call lock_decode_requests() decoder_ready = 0 if (val /= 0) decoder_ready = 1 + call unlock_decode_requests() end subroutine subroutine get_mycall(buf) bind(C, name="get_mycall") character(kind=c_char), intent(out) :: buf(12) integer :: i + call lock_decode_requests() do i = 1, 12 - buf(i) = mycall(i:i) + buf(i) = draft%mycall(i:i) end do + call unlock_decode_requests() end subroutine get_mycall subroutine get_hiscall(buf) bind(C, name="get_hiscall") character(kind=c_char), intent(out) :: buf(12) integer :: i + call lock_decode_requests() do i = 1, 12 - buf(i) = hiscall(i:i) + buf(i) = draft%hiscall(i:i) end do + call unlock_decode_requests() end subroutine subroutine get_mygrid(buf) bind(C, name="get_mygrid") character(kind=c_char), intent(out) :: buf(6) integer :: i + call lock_decode_requests() do i = 1, 6 - buf(i) = mygrid(i:i) + buf(i) = draft%mygrid(i:i) end do + call unlock_decode_requests() end subroutine subroutine get_hisgrid(buf) bind(C, name="get_hisgrid") character(kind=c_char), intent(out) :: buf(6) integer :: i + call lock_decode_requests() do i = 1, 6 - buf(i) = hisgrid(i:i) + buf(i) = draft%hisgrid(i:i) end do + call unlock_decode_requests() end subroutine ! NOTE ABOUT DATETIME LENGTH (17 vs 20) @@ -103,9 +239,11 @@ contains subroutine get_datetime(buf) bind(C, name="get_datetime") character(kind=c_char), intent(out) :: buf(17) integer :: i + call lock_decode_requests() do i = 1, 17 - buf(i) = datetime(i:i) + buf(i) = draft%datetime(i:i) end do + call unlock_decode_requests() end subroutine ! Helper subroutine to copy fixed-length Fortran string to C buffer @@ -123,344 +261,557 @@ contains function get_fcenter() bind(C, name="get_fcenter") real(c_double) :: get_fcenter - get_fcenter = fcenter + call lock_decode_requests() + get_fcenter = draft%fcenter + call unlock_decode_requests() end function function get_nkeep() bind(C, name="get_nkeep") integer(c_int) :: get_nkeep - get_nkeep = nkeep + call lock_decode_requests() + get_nkeep = draft%nkeep + call unlock_decode_requests() end function function get_ndop00() bind(C, name="get_ndop00") integer(c_int) :: get_ndop00 - get_ndop00 = ndop00 + call lock_decode_requests() + get_ndop00 = draft%ndop00 + call unlock_decode_requests() end function function get_map65RxLog() bind(C, name="get_map65RxLog") integer(c_int) :: get_map65RxLog - get_map65RxLog = map65RxLog + call lock_decode_requests() + get_map65RxLog = draft%map65RxLog + call unlock_decode_requests() end function function get_nutc() bind(C, name="get_nutc") integer(c_int) :: get_nutc - get_nutc = nutc + call lock_decode_requests() + get_nutc = draft%nutc + call unlock_decode_requests() end function function get_idphi() bind(C, name="get_idphi") integer(c_int) :: get_idphi - get_idphi = idphi + call lock_decode_requests() + get_idphi = draft%idphi + call unlock_decode_requests() end function function get_mousedf() bind(C, name="get_mousedf") integer(c_int) :: get_mousedf - get_mousedf = mousedf + call lock_decode_requests() + get_mousedf = draft%mousedf + call unlock_decode_requests() end function function get_mousefqso() bind(C, name="get_mousefqso") integer(c_int) :: get_mousefqso - get_mousefqso = mousefqso + call lock_decode_requests() + get_mousefqso = draft%mousefqso + call unlock_decode_requests() end function function get_nagain() bind(C, name="get_nagain") integer(c_int) :: get_nagain - get_nagain = nagain + call lock_decode_requests() + get_nagain = draft%nagain + call unlock_decode_requests() end function function get_ndepth() bind(C, name="get_ndepth") integer(c_int) :: get_ndepth - get_ndepth = ndepth + call lock_decode_requests() + get_ndepth = draft%ndepth + call unlock_decode_requests() end function function get_ndiskdat() bind(C, name="get_ndiskdat") integer(c_int) :: get_ndiskdat - get_ndiskdat = ndiskdat + call lock_decode_requests() + get_ndiskdat = draft%ndiskdat + call unlock_decode_requests() end function function get_neme() bind(C, name="get_neme") integer(c_int) :: get_neme - get_neme = neme + call lock_decode_requests() + get_neme = draft%neme + call unlock_decode_requests() end function function get_newdat() bind(C, name="get_newdat") integer(c_int) :: get_newdat - get_newdat = newdat + call lock_decode_requests() + get_newdat = draft%newdat + call unlock_decode_requests() end function function get_nfa() bind(C, name="get_nfa") integer(c_int) :: get_nfa - get_nfa = nfa + call lock_decode_requests() + get_nfa = draft%nfa + call unlock_decode_requests() end function function get_nfb() bind(C, name="get_nfb") integer(c_int) :: get_nfb - get_nfb = nfb + call lock_decode_requests() + get_nfb = draft%nfb + call unlock_decode_requests() end function function get_nfcal() bind(C, name="get_nfcal") integer(c_int) :: get_nfcal - get_nfcal = nfcal + call lock_decode_requests() + get_nfcal = draft%nfcal + call unlock_decode_requests() end function function get_nfshift() bind(C, name="get_nfshift") integer(c_int) :: get_nfshift - get_nfshift = nfshift + call lock_decode_requests() + get_nfshift = draft%nfshift + call unlock_decode_requests() end function function get_mcall3() bind(C, name="get_mcall3") integer(c_int) :: get_mcall3 - get_mcall3 = mcall3 + call lock_decode_requests() + get_mcall3 = draft%mcall3 + call unlock_decode_requests() end function function get_ntimeout() bind(C, name="get_ntimeout") integer(c_int) :: get_ntimeout - get_ntimeout = ntimeout + call lock_decode_requests() + get_ntimeout = draft%ntimeout + call unlock_decode_requests() end function function get_ntol() bind(C, name="get_ntol") integer(c_int) :: get_ntol - get_ntol = ntol + call lock_decode_requests() + get_ntol = draft%ntol + call unlock_decode_requests() end function function get_nxant() bind(C, name="get_nxant") integer(c_int) :: get_nxant - get_nxant = nxant + call lock_decode_requests() + get_nxant = draft%nxant + call unlock_decode_requests() end function function get_nfsample() bind(C, name="get_nfsample") integer(c_int) :: get_nfsample - get_nfsample = nfsample + call lock_decode_requests() + get_nfsample = draft%nfsample + call unlock_decode_requests() end function function get_nxpol() bind(C, name="get_nxpol") integer(c_int) :: get_nxpol - get_nxpol = nxpol + call lock_decode_requests() + get_nxpol = draft%nxpol + call unlock_decode_requests() end function function get_nmode() bind(C, name="get_nmode") integer(c_int) :: get_nmode - get_nmode = nmode + call lock_decode_requests() + get_nmode = draft%nmode + call unlock_decode_requests() end function function get_nsave() bind(C, name="get_nsave") integer(c_int) :: get_nsave - get_nsave = nsave + call lock_decode_requests() + get_nsave = draft%nsave + call unlock_decode_requests() end function function get_max_drift() bind(C, name="get_max_drift") integer(c_int) :: get_max_drift - get_max_drift = max_drift + call lock_decode_requests() + get_max_drift = draft%max_drift + call unlock_decode_requests() end function function get_nhsym() bind(C, name="get_nhsym") integer(c_int) :: get_nhsym - get_nhsym = nhsym + call lock_decode_requests() + get_nhsym = draft%nhsym + call unlock_decode_requests() end function subroutine set_fcenter(val) bind(C, name="set_fcenter") use iso_c_binding real(c_double), value :: val - fcenter = val + call lock_decode_requests() + draft%fcenter = val + call unlock_decode_requests() end subroutine subroutine set_nkeep(val) bind(C, name="set_nkeep") use iso_c_binding integer(c_int), value :: val - nkeep = val + call lock_decode_requests() + draft%nkeep = val + call unlock_decode_requests() end subroutine subroutine set_ndop00(val) bind(C, name="set_ndop00") use iso_c_binding integer(c_int), value :: val - ndop00 = val + call lock_decode_requests() + draft%ndop00 = val + call unlock_decode_requests() end subroutine subroutine set_map65RxLog(val) bind(C, name="set_map65RxLog") use iso_c_binding integer(c_int), value :: val - map65RxLog = val + ! map65RxLog is read back by get_map65RxLog() for debug logging only. + ! nrxlog is the variable m65c()/decode0.f90 actually check (iand bits + ! 1/2/4/8) to write the date header, erase map65_rx.log, clear the + ! decode-history file on Erase, and force manual dPhi. Before this fix + ! nrxlog was never assigned anywhere, so all four of those flag bits + ! were permanently dead -- e.g. Erase Band Map and Messages never + ! actually cleared unit 26, so the next display() cycle just replayed + ! the full decode history back into the Messages window. + call lock_decode_requests() + draft%map65RxLog = val + draft%nrxlog = val + call unlock_decode_requests() end subroutine subroutine set_nutc(val) bind(C, name="set_nutc") use iso_c_binding integer(c_int), value :: val - nutc = val + call lock_decode_requests() + draft%nutc = val + call unlock_decode_requests() end subroutine subroutine set_idphi(val) bind(C, name="set_idphi") use iso_c_binding integer(c_int), value :: val - idphi = val + call lock_decode_requests() + draft%idphi = val + call unlock_decode_requests() end subroutine subroutine set_mousedf(val) bind(C, name="set_mousedf") use iso_c_binding integer(c_int), value :: val - mousedf = val + call lock_decode_requests() + draft%mousedf = val + call unlock_decode_requests() end subroutine subroutine set_mousefqso(val) bind(C, name="set_mousefqso") use iso_c_binding integer(c_int), value :: val - mousefqso = val + call lock_decode_requests() + draft%mousefqso = val + call unlock_decode_requests() end subroutine subroutine set_nagain(val) bind(C, name="set_nagain") use iso_c_binding integer(c_int), value :: val - nagain = val + call lock_decode_requests() + draft%nagain = val + call unlock_decode_requests() end subroutine subroutine set_ndepth(val) bind(C, name="set_ndepth") use iso_c_binding integer(c_int), value :: val - ndepth = val + call lock_decode_requests() + draft%ndepth = val + call unlock_decode_requests() end subroutine subroutine set_ndiskdat(val) bind(C, name="set_ndiskdat") use iso_c_binding integer(c_int), value :: val - ndiskdat = val + call lock_decode_requests() + draft%ndiskdat = val + call unlock_decode_requests() end subroutine subroutine set_neme(val) bind(C, name="set_neme") use iso_c_binding integer(c_int), value :: val - neme = val + call lock_decode_requests() + draft%neme = val + call unlock_decode_requests() end subroutine subroutine set_newdat(val) bind(C, name="set_newdat") use iso_c_binding integer(c_int), value :: val - newdat = val + call lock_decode_requests() + draft%newdat = val + call unlock_decode_requests() end subroutine subroutine set_nfa(val) bind(C, name="set_nfa") use iso_c_binding integer(c_int), value :: val - nfa = val + call lock_decode_requests() + draft%nfa = val + call unlock_decode_requests() end subroutine subroutine set_nfb(val) bind(C, name="set_nfb") use iso_c_binding integer(c_int), value :: val - nfb = val + call lock_decode_requests() + draft%nfb = val + call unlock_decode_requests() end subroutine subroutine set_nfcal(val) bind(C, name="set_nfcal") use iso_c_binding integer(c_int), value :: val - nfcal = val + call lock_decode_requests() + draft%nfcal = val + call unlock_decode_requests() end subroutine subroutine set_nfshift(val) bind(C, name="set_nfshift") use iso_c_binding integer(c_int), value :: val - nfshift = val + call lock_decode_requests() + draft%nfshift = val + call unlock_decode_requests() end subroutine subroutine set_mcall3(val) bind(C, name="set_mcall3") use iso_c_binding integer(c_int), value :: val - mcall3 = val + call lock_decode_requests() + draft%mcall3 = val + call unlock_decode_requests() end subroutine subroutine set_ntimeout(val) bind(C, name="set_ntimeout") use iso_c_binding integer(c_int), value :: val - ntimeout = val + call lock_decode_requests() + draft%ntimeout = val + call unlock_decode_requests() end subroutine subroutine set_ntol(val) bind(C, name="set_ntol") use iso_c_binding integer(c_int), value :: val - ntol = val + call lock_decode_requests() + draft%ntol = val + call unlock_decode_requests() end subroutine subroutine set_nxant(val) bind(C, name="set_nxant") use iso_c_binding integer(c_int), value :: val - nxant = val + call lock_decode_requests() + draft%nxant = val + call unlock_decode_requests() end subroutine subroutine set_nfsample(val) bind(C, name="set_nfsample") use iso_c_binding integer(c_int), value :: val - nfsample = val + call lock_decode_requests() + draft%nfsample = val + call unlock_decode_requests() end subroutine subroutine set_nxpol(val) bind(C, name="set_nxpol") use iso_c_binding integer(c_int), value :: val - nxpol = val + call lock_decode_requests() + draft%nxpol = val + call unlock_decode_requests() end subroutine subroutine set_nmode(val) bind(C, name="set_nmode") use iso_c_binding integer(c_int), value :: val - nmode = val + call lock_decode_requests() + draft%nmode = val + call unlock_decode_requests() end subroutine subroutine set_nsave(val) bind(C, name="set_nsave") use iso_c_binding integer(c_int), value :: val - nsave = val + call lock_decode_requests() + draft%nsave = val + call unlock_decode_requests() end subroutine subroutine set_max_drift(val) bind(C, name="set_max_drift") use iso_c_binding integer(c_int), value :: val - max_drift = val + call lock_decode_requests() + draft%max_drift = val + call unlock_decode_requests() end subroutine subroutine set_nhsym(val) bind(C, name="set_nhsym") use iso_c_binding integer(c_int), value :: val - nhsym = val + call lock_decode_requests() + draft%nhsym = val + call unlock_decode_requests() end subroutine subroutine set_mycall(buf) bind(C, name="set_mycall") use iso_c_binding character(kind=c_char), intent(in) :: buf(12) integer :: i + call lock_decode_requests() do i = 1, 12 - mycall(i:i) = buf(i) + draft%mycall(i:i) = buf(i) end do + call unlock_decode_requests() end subroutine subroutine set_hiscall(buf) bind(C, name="set_hiscall") use iso_c_binding character(kind=c_char), intent(in) :: buf(12) integer :: i + call lock_decode_requests() do i = 1, 12 - hiscall(i:i) = buf(i) + draft%hiscall(i:i) = buf(i) end do + call unlock_decode_requests() end subroutine subroutine set_mygrid(buf) bind(C, name="set_mygrid") use iso_c_binding character(kind=c_char), intent(in) :: buf(6) integer :: i + call lock_decode_requests() do i = 1, 6 - mygrid(i:i) = buf(i) + draft%mygrid(i:i) = buf(i) end do + call unlock_decode_requests() end subroutine subroutine set_hisgrid(buf) bind(C, name="set_hisgrid") use iso_c_binding character(kind=c_char), intent(in) :: buf(6) integer :: i + call lock_decode_requests() do i = 1, 6 - hisgrid(i:i) = buf(i) + draft%hisgrid(i:i) = buf(i) end do + call unlock_decode_requests() end subroutine subroutine set_datetime(buf) bind(C, name="set_datetime") use iso_c_binding character(kind=c_char), intent(in) :: buf(17) integer :: i + call lock_decode_requests() do i = 1, 17 - datetime(i:i) = buf(i) + draft%datetime(i:i) = buf(i) end do + call unlock_decode_requests() end subroutine + function publish_decode_request() result(request_id) bind(C) + integer(c_int64_t) :: request_id + type(decode_request), pointer :: request + + allocate(request) + call lock_decode_requests() + published_request_id = published_request_id + 1 + request_id = published_request_id + request%id = request_id + request%input_generation = live_input_generation + request%parameters = draft + request%parameters%newdat = 1 + if (associated(pending_tail)) then + pending_tail%next => request + else + pending_head => request + endif + pending_tail => request + decoder_ready = 1 + draft%manualDecodeFlag = 0 + call unlock_decode_requests() + end function + + logical function claim_decode_request() + type(decode_request), pointer :: request + + call lock_decode_requests() + claim_decode_request = decoder_ready /= 0 .and. associated(pending_head) + if (claim_decode_request) then + request => pending_head + pending_head => request%next + if (.not. associated(pending_head)) nullify(pending_tail) + active = request%parameters + active_request_id = request%id + active_input_generation = request%input_generation + active_request_expired = active%ndiskdat == 0 .and. active%nagain == 0 .and. & + active%manualDecodeFlag == 0 .and. request%input_generation /= live_input_generation + deallocate(request) + endif + call unlock_decode_requests() + end function + + subroutine initialize_decode_parameters() + call lock_decode_requests() + active = draft + call unlock_decode_requests() + end subroutine + + subroutine advance_live_input_generation() bind(C) + call lock_decode_requests() + live_input_generation = live_input_generation + 1 + call unlock_decode_requests() + end subroutine + + subroutine clear_pending_requests() + type(decode_request), pointer :: request + do while (associated(pending_head)) + request => pending_head + pending_head => request%next + deallocate(request) + enddo + nullify(pending_tail) + end subroutine + + subroutine cancel_pending_decode_requests() bind(C) + call lock_decode_requests() + call clear_pending_requests() + decoder_ready = 0 + published_request_id = published_request_id + 1 + call unlock_decode_requests() + end subroutine + + function get_stop_m65() result(stopped) + integer(c_int) :: stopped + call lock_decode_requests() + stopped = stop_m65 + call unlock_decode_requests() + end function + + logical(c_bool) function is_current_decode_request(request_id) bind(C) + integer(c_int64_t), value :: request_id + call lock_decode_requests() + is_current_decode_request = request_id == published_request_id + call unlock_decode_requests() + end function + end module npar_ptrs_mod diff --git a/map65/libm65/packjt.f90 b/map65/libm65/packjt.f90 index e42a1662..c9928208 100644 --- a/map65/libm65/packjt.f90 +++ b/map65/libm65/packjt.f90 @@ -2,6 +2,28 @@ module packjt implicit none contains +pure logical function is_valid_jt65_codeword(dat) + integer, intent(in) :: dat(12) + + integer, parameter :: NBASE = 37*36*10*27*27*27 + integer, parameter :: LAST_V2_CALL = 267796945 + integer :: nc1, nc2, ng + + nc1 = ishft(dat(1),22) + ishft(dat(2),16) + ishft(dat(3),10) + & + ishft(dat(4),4) + iand(ishft(dat(5),-2),15) + nc2 = ishft(iand(dat(5),3),26) + ishft(dat(6),20) + & + ishft(dat(7),14) + ishft(dat(8),8) + ishft(dat(9),2) + & + iand(ishft(dat(10),-4),3) + ng = ishft(iand(dat(10),15),12) + ishft(dat(11),6) + dat(12) + + if (ng >= 32768) then + is_valid_jt65_codeword = .true. + else + is_valid_jt65_codeword = nc1 /= NBASE .and. nc1 <= LAST_V2_CALL .and. & + nc2 < NBASE + endif +end function is_valid_jt65_codeword + subroutine packbits(dbits,nsymd,m0,sym) ! Pack 0s and 1s from dbits() into sym() with m0 bits per word. @@ -147,12 +169,13 @@ subroutine unpackcall(ncall, word, iv2, psfx) character(len=37) :: c integer, parameter :: NBASE = 37*36*10*27*27*27 + integer, parameter :: LAST_V2_CALL = 267796945 data c /'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ '/ word = '......' psfx = ' ' - if ((ncall < 0 .or. ncall >= 262177560) .and. ncall .ne. 262177561) then + if (ncall < 0 .or. ncall == NBASE .or. ncall > LAST_V2_CALL) then write(*,*) 'unpackcall: ncall out of range = ', ncall end if @@ -496,10 +519,10 @@ end subroutine unpackcall if(c3.eq.'OOO ') c3=' ' !Strip out the OOO flag call getpfx1(c1,k1,nv2a) if(nv2a.ge.4) go to 10 - call packcall(c1,nc1,text1) + call packcall(c1(1:6),nc1,text1) if(text1) go to 10 call getpfx1(c2,k2,nv2b) - call packcall(c2,nc2,text2) + call packcall(c2(1:6),nc2,text2) if(text2) go to 10 if(nv2a.eq.2 .or. nv2a.eq.3 .or. nv2b.eq.2 .or. nv2b.eq.3) then if(k1.lt.0 .or. k2.lt.0 .or. k1*k2.ne.0) go to 10 @@ -529,7 +552,7 @@ end subroutine unpackcall ! The message will be treated as plain text. 10 itype=6 - call packtext(msg,nc1,nc2,ng) + call packtext(msg(1:13),nc1,nc2,ng) ng=ng+32768 ! Encode data into 6-bit words @@ -876,7 +899,7 @@ subroutine packpfx(call1, n1, ng, nadd) if(call1(i1+2:i1+2).eq.' ') then ! Single-character add-on suffix (maybe also fourth suffix letter?) call0=call1(:i1-1) - call packcall(call0,n1,text) + call packcall(call0(1:6),n1,text) nadd=1 nc=ichar(call1(i1+1:i1+1)) if(nc.ge.48 .and. nc.le.57) then @@ -891,7 +914,7 @@ subroutine packpfx(call1, n1, ng, nadd) else if(call1(i1+3:i1+3).eq.' ') then ! Two-character numerical suffix, /10 to /99 call0=call1(:i1-1) - call packcall(call0,n1,text) + call packcall(call0(1:6),n1,text) nadd=1 n=10*(ichar(call1(i1+1:i1+1))-48) + ichar(call1(i1+2:i1+2)) - 48 nadd=1 @@ -902,7 +925,7 @@ subroutine packpfx(call1, n1, ng, nadd) if(pfx(3:3).eq.' ') pfx=' '//pfx(1:2) if(pfx(3:3).eq.' ') pfx=' '//pfx(1:2) call0=call1(i1+1:) - call packcall(call0,n1,text) + call packcall(call0(1:6),n1,text) ng=0 do i=1,3 diff --git a/map65/libm65/ptt.c b/map65/libm65/ptt.c index 3170ab78..b2c6cb48 100644 --- a/map65/libm65/ptt.c +++ b/map65/libm65/ptt.c @@ -15,12 +15,12 @@ int ptt_(int *nport, int *ntx, int *iptt) if(*ntx && (!open)) { if (*nport < 10) - snprintf(s, sizeof(s), "COM%d", *nport); + snprintf(s, sizeof(s), "COM%d", *nport); else snprintf(s, sizeof(s), "\\\\.\\COM%d", *nport); hFile = CreateFileA(s, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, NULL); + FILE_ATTRIBUTE_NORMAL,NULL); if(hFile==INVALID_HANDLE_VALUE) { // printf("PTT: Cannot open COM port %d.\n",*nport); diff --git a/map65/libm65/ptt_unix.c b/map65/libm65/ptt_unix.c index 5cefe9f5..0787308b 100644 --- a/map65/libm65/ptt_unix.c +++ b/map65/libm65/ptt_unix.c @@ -17,26 +17,11 @@ */ # include # include -# include +# include #include # include #include #include -#include - -static void ptt_log(const char *fmt, ...) -{ - FILE *f = fopen("/tmp/map65_ptt.log", "a"); - if (!f) return; - - va_list ap; - va_start(ap, fmt); - vfprintf(f, fmt, ap); - fprintf(f, "\n"); - va_end(ap); - fflush(f); - fclose(f); -} #ifdef HAVE_SYS_STAT_H # include diff --git a/map65/libm65/q65b.F90 b/map65/libm65/q65b.F90 index 6dba967f..7f28f0f3 100644 --- a/map65/libm65/q65b.F90 +++ b/map65/libm65/q65b.F90 @@ -9,9 +9,31 @@ implicit none contains - subroutine q65b(nutc, nqd, nxant, fcenter, nfcal, nfsample, ikhz, mousedf, ntol, xpol, & + subroutine write_wav_header(unit, nsamp, fs) + integer, intent(in) :: unit, nsamp, fs + integer :: datasize, file_size + + datasize = nsamp * 2 ! 16-bit samples + file_size = 36 + datasize + + write(unit) 'RIFF' + write(unit) file_size + write(unit) 'WAVE' + write(unit) 'fmt ' + write(unit) 16 ! PCM header size + write(unit) 1 ! PCM format + write(unit) 1 ! mono + write(unit) fs ! sample rate + write(unit) fs*2 ! byte rate + write(unit) 2 ! block align + write(unit) 16 ! bits per sample + write(unit) 'data' + write(unit) datasize + end subroutine write_wav_header + + subroutine q65b(nutc, nqd, nxant, fcenter, nfcal, nfsample, ikhz, mousedf, ntol, xpol, configured_dphi_deg, & mycall0, mygrid, hiscall0, hisgrid, mode_q65, f0, fqso, newdat, nagain, & - max_drift, ndop00, idec) + max_drift, ndop00, idec, cursor_fallback) use iso_c_binding use q65_decode @@ -25,6 +47,9 @@ use txpol_mod use iso_fortran_env, only: real64, int16 use map65_mmdec_mod + use npar_ptrs_mod, only: nrate_active, nfft_big_active, nfft_active, t_start, abort_decode, & + manualDecodeFlag, ndepth + use sec_midn_mod, only: sec_midn implicit none @@ -39,6 +64,7 @@ integer, intent(in) :: mousedf integer, intent(in) :: ntol logical, intent(in) :: xpol + integer, intent(in) :: configured_dphi_deg character(len=12), intent(in) :: mycall0 character(len=6), intent(in) :: mygrid character(len=12), intent(in) :: hiscall0 @@ -51,10 +77,14 @@ integer, intent(in) :: max_drift integer, intent(in) :: ndop00 integer, intent(out) :: idec + logical, optional, intent(in) :: cursor_fallback !==== Local parameters ==================================================== - integer, parameter :: MAXFFT1 = 5376000 - integer, parameter :: MAXFFT2 = 336000 + ! MAXFFT1/2 are *max* sizes; actual runtime sizes are derived below. + ! MAXFFT1 must be = nfft_big_active; MAXFFT2 must be = the + ! downsampled-FFT length at the highest supported rate. + integer, parameter :: MAXFFT1 = 56*192000 + integer, parameter :: MAXFFT2 = 336000*2 integer, parameter :: NMAX = 60*12000 real(real64), parameter :: RAD = 57.2957795 @@ -62,12 +92,19 @@ integer(int16) :: iwave(300*12000) complex :: cx(0:MAXFFT2-1), cy(0:MAXFFT2-1), cz(0:MAXFFT2) integer :: ipk1(1) + ! Small, fixed bin radius for the automatic-candidate ipk search (see + ! the note below at "for a wideband candidate"). Deliberately + ! independent of the GUI's Ftol (ntol) -- this only needs to absorb + ! wb_sync's own low-SNR bin-selection noise, not accommodate arbitrary + ! user-configured search widths. + integer, parameter :: IPK_LOCAL_BINS = 5 integer :: i, ia, ib, ifreq, ikhz1, ipk, ipol - integer :: j, ja, jb, k0, mhz, ndf, ndpth, nfft1, nfft2 + integer :: j, ja, jb, k0, mhz, ndf, nfft1, nfft2 integer :: npol, nq65df, nsubmode, ntxpol, nutc00, nh integer :: nfa, nfb - real :: df, df3, f_ipk, f_mouse, fac - real :: freq1_00, frx, fsked, poldeg, r, snr1 + integer :: k0_click, mousedf_gate + real :: df, df3, dphi, f_ipk, f_mouse, fac + real :: combine_poldeg, freq1_00, frx, fsked, poldeg, r, snr1 real(real64) :: freq0, freq1 character(len=12) :: mycall, hiscall character(len=4) :: grid4 @@ -76,6 +113,9 @@ character(len=2) :: cmode character(len=256) :: linenew + integer :: t_now, t_rate + logical :: search_cursor + ! From q65_decode / wideband_sync / globals: ! real :: xdt0 ! integer :: nsnr0, nfreq0, nkhz_center @@ -88,49 +128,149 @@ data msg00 /' '/ save - call init_cacb(5376000) + idec = -1 + nsnr0 = -99 + msg0 = ' ' + cq0 = ' ' + xdt0 = 0.0 + nfreq0 = 0 + search_cursor = manualDecodeFlag .ne. 0 + if (present(cursor_fallback)) search_cursor = search_cursor .or. cursor_fallback + + call system_clock(t_now, t_rate) + if (real(t_now - t_start)/real(t_rate) > 40.0) then + abort_decode = .true. + return + endif + + ! ca/cb storage is sized at MAXFFT1 in cacb_mod; the *active* big FFT + ! length is nfft_big_active, set from C++ via set_runtime_params_(). + call init_cacb(MAXFFT1) - call init_wideband_sync(NFFT) + ! wideband_sync expects the active symspec FFT length + call init_wideband_sync() + if (mycall0(1:1) .ne. ' ') mycall = mycall0 if (hiscall0(1:1) .ne. ' ') hiscall = hiscall0 if (hisgrid(1:4) .ne. ' ') grid4 = hisgrid(1:4) ! Find best frequency and ipol from sync_dat, the "orange sync curve". - df3 = 96000.0/32768.0 + ! df3 is the bin width of the symspec FFT (savg), based on the + ! active runtime rate and FFT length. + df3 = real(nrate_active)/real(nfft_active) ifreq = nint((1000.0*f0)/df3) - ia = nint(ifreq - ntol/df3) - ib = nint(ifreq + ntol/df3) - if (ia >= 1 .and. ia <= 32768 .and. ib >= 1 .and. ib <= 32768) then !if added qt6 - ipk1 = maxloc(sync(ia:ib)%ccfmax) + ! Candidate frequencies need only local bin refinement. Cursor + ! targets, including the no-candidate fallback, need the selected Ftol. + ! Bin-quantized weak-signal candidates can miss the true sync peak; + ! retain the local five-bin search rather than testing one exact bin. + if (search_cursor) then + ia = nint(ifreq - ntol/df3) + ib = nint(ifreq + ntol/df3) + if (ia >= 1 .and. ia <= nfft_active .and. ib >= 1 .and. ib <= nfft_active) then + ipk1 = maxloc(sync(ia:ib)%ccfmax) + else + go to 901 + endif + ipk = ia + ipk1(1) - 1 else - go to 901 + ia = max(1, ifreq - IPK_LOCAL_BINS) + ib = min(nfft_active, ifreq + IPK_LOCAL_BINS) + if (ifreq >= 1 .and. ifreq <= nfft_active .and. ib >= ia) then + ipk1 = maxloc(sync(ia:ib)%ccfmax) + ipk = ia + ipk1(1) - 1 + else + go to 901 + endif endif + snr1 = sync(ipk)%ccfmax - ipk = ia + ipk1(1) - 1 - if (ldecoded(ipk)) go to 900 + ! TEMP diagnostic 2026-09-09 for the two-close-Q65-signals investigation. + call dbg('q65b: ipk check at t=' // rtoa(sec_midn()) // & + ' nqd=' // itoa(nqd) // ' f0=' // rtoa(real(f0)) // ' ntol=' // itoa(ntol) // & + ' ifreq=' // itoa(ifreq) // ' ipk=' // itoa(ipk) // & + ' ldecoded(ipk)=' // itoa(merge(1,0,ldecoded(ipk))) // & + ' manualDecodeFlag=' // itoa(manualDecodeFlag) // ' nagain=' // itoa(nagain)) + ! ldecoded(ipk) exists to keep the wideband scan from repeatedly + ! re-decoding a bin it already got a result from. A manual click is a + ! deliberate, targeted request to decode at this exact bin, so it must + ! not be skipped just because an earlier wideband pass happened to + ! visit the same bin first. + if (ldecoded(ipk) .and. manualDecodeFlag .eq. 0) then + call dbg('q65b: SKIPPED (ldecoded already set) at t=' // rtoa(sec_midn()) // & + ' ipk=' // itoa(ipk)) + go to 900 + endif snr1 = sync(ipk)%ccfmax ! ipol was never declared and its value is never used ipol = 1 if (xpol) ipol = sync(ipk)%ipol - nfft1 = MAXFFT1 - nfft2 = MAXFFT2 - df = 96000.0/NFFT1 + ! Runtime big-FFT length: nfft_big_active is 56 * nrate_active, + ! set from C++ at startup. Clamp to MAXFFT1 for safety. + nfft1 = min(nfft_big_active, MAXFFT1) + + ! Use a fixed small-FFT length that matches the legacy 96 kHz + ! geometry and stays within MAXFFT2 at all supported rates. + nfft2 = min(336000, MAXFFT2) + + ! Preserve the legacy 95238 special case; if you still use it, + ! override the derived sizes with the historical ones. if (nfsample .eq. 95238) then - nfft1 = 5120000 - nfft2 = 322560 - df = 96000.0/nfft1 + nfft1 = min(5120000, MAXFFT1) + nfft2 = min(322560, MAXFFT2) endif + + ! Bin width of the big FFT: use the active runtime rate instead + ! of a hardcoded 96000. The 95238 special case is preserved. + df = real(nrate_active)/real(nfft1) + if (nfsample .eq. 95238) df = 96000.0/real(nfft1) + nh = nfft2/2 - f_mouse = 1000.0*(fqso + 48.0) + mousedf + f_mouse = 1000.0*(fqso + real(nrate_active/2000.0)) + mousedf f_ipk = ipk*df3 - k0 = nint((ipk*df3 - 1000.0)/df) - if (nagain .eq. 1) k0 = nint((f_mouse - 1000.0)/df) - - if (k0 .lt. nh .or. k0 .gt. MAXFFT1 - nfft2 + 1) go to 900 - if (snr1 .lt. 1.5) go to 900 !### Threshold needs work? ### + ! k0 used to come from f_ipk (ipk*df3), i.e. re-derived from the coarse, + ! JT65-oriented "orange sync curve" bin (df3 ~ 2.9 Hz resolution) rather + ! than from the candidate's own already-refined frequency. For a + ! wideband Q65 candidate, f0 (set by the caller from cand()%f, which + ! wb_sync already computed with sub-bin precision) is a strictly better + ! estimate of the true signal frequency than re-quantizing through ipk + ! -- and the difference matters here because the actual decode below + ! only searches a tight +/-10 Hz window (nfa=990..1010) around k0. + ! Use f0 directly, same as the manual-click/nagain path already does + ! via f_mouse below. + k0 = nint((1000.0*f0 - 1000.0)/df) + ! ipk (and therefore f_ipk) comes from maxloc'ing the JT65-oriented + ! "orange sync curve" over the whole +/-ntol window -- fine for a + ! wideband scan, but if a strong JT65 signal happens to sit anywhere + ! in that window it will always win, even over an equal-strength Q65 + ! signal, because that curve doesn't score Q65 signals the same way. + ! A manual click already tells us exactly where to look, so center + ! the analysis window on the actual clicked frequency (f_mouse, which + ! properly includes mousedf) instead of trusting that curve. + ! nagain=1 (Decode button / Find Delta Phi repeat) runs the same + ! per-candidate loop over real, precise wb_sync candidates that + ! automatic decoding does -- f0 is not an imprecise mousefqso click + ! there, so forcing k0 to f_mouse would make every candidate in that + ! loop decode the same narrow window near the cursor instead of its + ! own frequency. The one nagain=1 case where f0 genuinely comes from + ! mousefqso (the "no candidate found" fallback in map65a.f90) already + ! sets f0 = mousefqso + mousedf directly, so the default k0 below + ! lands on the same point anyway. + if (manualDecodeFlag .ne. 0) k0 = nint((f_mouse - 1000.0)/df) + + if (k0 .lt. nh .or. k0 .gt. nfft1 - nfft2 + 1) then + if (manualDecodeFlag .ne. 0) & + call dbg('q65b manual: NOT ATTEMPTED, k0=' // itoa(k0) // ' outside ' // & + itoa(nh) // '..' // itoa(nfft1 - nfft2 + 1)) + go to 900 + endif + ! Likewise, snr1 is the sync-curve strength at ipk, which for a manual + ! click may be the wrong bin entirely (see above) -- don't let it gate + ! a manual decode attempt. Let q65_decode's own Q65-native search + ! (below) determine success or failure instead. + if (snr1 .lt. 1.5 .and. manualDecodeFlag .eq. 0) go to 900 !### Threshold needs work? ### fac = 1.0/nfft2 cx(0:nfft2 - 1) = ca(k0:k0 + nfft2 - 1) @@ -138,6 +278,11 @@ if (xpol) then cy(0:nfft2 - 1) = cb(k0:k0 + nfft2 - 1) cy = fac*cy + if (configured_dphi_deg .ne. 0) then + dphi = configured_dphi_deg/RAD + ! The sync weights describe the phase-corrected basis from symspec. + cy(0:nfft2 - 1) = cmplx(cos(dphi), sin(dphi))*cy(0:nfft2 - 1) + endif endif ! Here cx and cy (if xpol) are frequency-domain data around the selected @@ -153,8 +298,12 @@ poldeg = 0. if (xpol) then + ! NB: still uses the (possibly wrong-bin, see k0 above) ipk for + ! manual clicks in xpol mode -- not exercised by current testing, + ! but worth revisiting if xpol manual decode misbehaves similarly. poldeg = sync(ipk)%pol - cz(0:MAXFFT2 - 1) = cos(poldeg/RAD)*cx + sin(poldeg/RAD)*cy + combine_poldeg = sync(ipk)%combine_pol + cz(0:MAXFFT2 - 1) = cos(combine_poldeg/RAD)*cx + sin(combine_poldeg/RAD)*cy else cz(0:MAXFFT2 - 1) = cx endif @@ -177,34 +326,49 @@ iwave(2*i + 2) = int(max(-32768, min(32767, nint(real(cz(j))))), kind=2) iwave(2*i + 1) = int(max(-32768, min(32767, nint(aimag(cz(j))))), kind=2) enddo - iwave(2*nfft2 + 1:) = 0 -! open(30,file='000000_0001.wav',status='unknown',access='stream') -! h=default_header(12000,NMAX) -! write(30) h,iwave -! close(30) + iwave(2*nfft2 + 1:) = 0 nsubmode = mode_q65 - 1 nfa = 990 !Tight limits around ipk for the wideband decode nfb = 1010 - if (nagain .eq. 1) then !For nagain=1, use limits of +/- ntol + if (search_cursor) then nfa = max(100, 1000 - ntol) nfb = min(2500, 1000 + ntol) endif - nsnr0 = -99 !Default snr for no decode - ndpth = 3 ! NB: Frequency of ipk is now shifted to 1000 Hz. + + ! ndepth comes from npar_ptrs_mod, set from the GUI's Decode Depth + ! menu (see MainWindow::decode() -> setNdepth()). This used to be a + ! local variable "ndpth" hardwired to 3 here, which was never + ! connected to the GUI at all -- Q65 always ran at depth 3 + ! regardless of what the user selected. call map65_mmdec(nutc, iwave, nqd, 60, nsubmode, nfa, nfb, 1000, ntol, & - newdat, nagain, max_drift, ndpth, mycall, hiscall0, hisgrid) + newdat, nagain, max_drift, ndepth, mycall, hiscall0, hisgrid) MHz = fcenter freq0 = MHz + 0.001d0*ikhz + call dbg('q65b: map65_mmdec result at t=' // rtoa(sec_midn()) // & + ' nqd=' // itoa(nqd) // ' f0=' // rtoa(real(f0)) // ' ipk=' // itoa(ipk) // & + ' nsnr0=' // itoa(nsnr0)) + if (nsnr0 .gt. -99) then ldecoded(ipk) = .true. - nq65df = nint(1000*(0.001*k0*df + nkhz_center - 48.0 + 1.000 - 1.27046 - ikhz)) - nfcal + nq65df = nint(1000*( 0.001*k0*df + nkhz_center - real(nrate_active)/2000.0 + 1.000 - 1.27046 - ikhz )) - nfcal nq65df = nq65df + nfreq0 - 1000 + ! Gate comparison target, expressed in the same ikhz-relative frame + ! as nq65df above -- computed from f0 (the unambiguous target + ! frequency for this call, for both a manual click and a wideband + ! candidate) via the same k0/nq65df formula, rather than from raw + ! mousedf, which is relative to mousefqso and only matches ikhz's + ! frame when the target happens to already be sub-kHz. mousedf + ! itself is left untouched -- f_mouse/k0 above still need it in its + ! original, unmodified form. + k0_click = nint((1000.0*f0 - 1000.0)/df) + mousedf_gate = nint(1000*( 0.001*k0_click*df + nkhz_center - real(nrate_active)/2000.0 + & + 1.000 - 1.27046 - ikhz )) - nfcal npol = nint(poldeg) if (nxant .ne. 0) then npol = npol - 45 @@ -216,11 +380,18 @@ if (ndf .gt. 500) ikhz1 = ikhz + (nq65df + 500)/1000 if (ndf .lt. -500) ikhz1 = ikhz + (nq65df - 500)/1000 ndf = nq65df - 1000*(ikhz1 - ikhz) - if (nqd .eq. 1 .and. abs(nq65df - mousedf) .lt. ntol) then + + if (manualDecodeFlag .ne. 0) & + call dbg('q65b manual: decoded nq65df=' // itoa(nq65df) // ' mousedf_gate=' // & + itoa(mousedf_gate) // ' ntol=' // itoa(ntol) // ' nqd=' // itoa(nqd) // & + ' display gate ' // merge('PASSED', 'FAILED', & + nqd .eq. 1 .and. abs(nq65df - mousedf_gate) .lt. ntol)) + + if (nqd .eq. 1 .and. abs(nq65df - mousedf_gate) .lt. ntol) then + write (linenew, '("!",I3.3,I5,I4,I6.4,F5.1,I5," : ",A28,A3,I4,1X,A1)') & ikhz1, ndf, npol, nutc, xdt0, nsnr0, msg0(1:28), cq0, ntxpol, cp call write_stdout(trim(linenew)//new_line('a')) - endif ! Write to lu 26, for Messages and Band Map windows @@ -242,7 +413,7 @@ nutc00 = nutc msg00 = msg0(1:28) freq1_00 = freq1 - frx = 0.001*k0*df + nkhz_center - 48.0 + 1.0 - 0.001*nfcal + frx = 0.001*k0*df + nkhz_center - real(nrate_active/2000.0) + 1.0 - 0.001*nfcal fsked = frx - 0.001*ndop00/2.0 - 1.5 write (12, 1120) nutc, fsked, xdt0, nsnr0, trim(msg0) 1120 format(i4.4, f9.3, f7.2, i5, 2x, a, i6) @@ -252,7 +423,10 @@ 900 close (13) close (17) idec = -1 - read (cq0(2:2), *) idec + ! cq0 is blank unless this call's own decode attempt set it (see the + ! reset at subroutine entry); only parse it when there's really a + ! digit there, otherwise there's nothing for READ to find. + if (cq0(2:2) .ne. ' ') read (cq0(2:2), *) idec return 901 close (13) close (17) diff --git a/map65/libm65/recvpkt.f90 b/map65/libm65/recvpkt.f90 index 03ca5b1f..32900835 100644 --- a/map65/libm65/recvpkt.f90 +++ b/map65/libm65/recvpkt.f90 @@ -1,6 +1,6 @@ module recvpkt_mod use datcom_ptrs_mod ! for dd - use iso_fortran_env, only: real64, real32, int16 + use iso_fortran_env, only: real64, real32, int16 implicit none contains @@ -8,7 +8,7 @@ subroutine recvpkt(nsam, nblock2, userx_no, k, buf4, buf8, buf16) & bind(C, name="recvpkt_") use iso_c_binding - use datcom_ptrs_mod + integer(c_int), intent(in) :: nsam integer(c_int16_t), intent(inout) :: nblock2 integer(c_int8_t), intent(in) :: userx_no @@ -20,7 +20,6 @@ subroutine recvpkt(nsam, nblock2, userx_no, k, buf4, buf8, buf16) & ! ===== Locals ===== integer :: i - integer, parameter :: NSMAX = 60*96000 ! Silence unused warning if (nblock2 .eq. -9999) nblock2 = -9998 @@ -34,41 +33,40 @@ subroutine recvpkt(nsam, nblock2, userx_no, k, buf4, buf8, buf16) & do i = 1, 174 k = k + 1 call unpack_r8_to_r4(buf8(i), dd(1,k), dd(2,k)) - end do - - case (1) - do i = 1, 348 - k = k + 1 - call unpack_r4_to_i2_as_r4(buf4(i), dd(1,k), dd(2,k)) - end do - - case (-2) - do i = 1, 87 - k = k + 1 - call unpack_c16_to_r4(buf16(i), dd(1,k), dd(2,k), dd(3,k), dd(4,k)) - end do - - case (2) - do i = 1, 174 - k = k + 1 - call unpack_r8_to_i2_as_r4(buf8(i), dd(1,k), dd(2,k), dd(3,k), dd(4,k)) - end do - - end select - - else - ! nsam >= 0: special case for one RF channel, r*4 data - if (userx_no .eq. 1) then - do i = 1, nsam - k = k + 1 - call unpack_r4_to_i2_as_r4(buf4(i), dd(1,k), dd(2,k)) - - k = k + 1 - dd(1,k) = dd(1,k-1) - dd(2,k) = dd(2,k-1) - end do - end if - end if + end do + + case (1) + do i = 1, 348 + k = k + 1 + call unpack_r4_to_i2_as_r4(buf4(i), dd(1,k), dd(2,k)) + end do + + case (-2) + do i = 1, 87 + k = k + 1 + call unpack_c16_to_r4(buf16(i), dd(1,k), dd(2,k), dd(3,k), dd(4,k)) + end do + + case (2) + do i = 1, 174 + k = k + 1 + call unpack_r8_to_i2_as_r4(buf8(i), dd(1,k), dd(2,k), dd(3,k), dd(4,k)) + end do + end select + + else + ! nsam >= 0: special case for one RF channel, r*4 data + if (userx_no .eq. 1) then + do i = 1, nsam + k = k + 1 + call unpack_r4_to_i2_as_r4(buf4(i), dd(1,k), dd(2,k)) + + k = k + 1 + dd(1,k) = dd(1,k-1) + dd(2,k) = dd(2,k-1) + end do + end if + end if end subroutine recvpkt diff --git a/map65/libm65/run_m65.f90 b/map65/libm65/run_m65.f90 index e927e33e..cc0ffe73 100644 --- a/map65/libm65/run_m65.f90 +++ b/map65/libm65/run_m65.f90 @@ -9,11 +9,14 @@ subroutine run_m65(pol, sample_rate_96000) bind(C, name='run_m65_') use timer_impl, only: init_timer, fini_timer use debug_log use m65a_mod - use datcom_ptrs_mod, only: dd, ss, savg - use npar_ptrs_mod, only: newdat, stop_m65, decoder_ready + use npar_ptrs_mod, only: t_start, nhsym, mycall, hiscall, hisgrid, neme, & + initialize_decode_parameters, claim_decode_request, get_stop_m65, & + active_request_id, active_request_expired use stdout_channel_mod, only: write_stdout use decodes_mod, only: nhsym1,nhsym2 + use deep65_mod, only: build_call3_candidates use sleep_msec_mod + use sec_midn_mod, only: sec_midn implicit none @@ -22,17 +25,13 @@ subroutine run_m65(pol, sample_rate_96000) bind(C, name='run_m65_') ! Local variables integer :: sample_rate character(len=128) :: line - - ! timestamp variables - character(len=8) :: d - character(len=10) :: t - integer :: v(8) - character(len=32) :: timestamp + integer :: t_rate + integer :: t_now nhsym1=280 - nhsym2=302 - - ! call ensure_log_open() !uncomment this to enable logging to file + nhsym2=302 + + dbg_enabled = .false. ! flip to .true. to enable dbg() logging to w3sz_debug.log if (sample_rate_96000 /=0) then sample_rate = 96000 @@ -71,39 +70,30 @@ subroutine run_m65(pol, sample_rate_96000) bind(C, name='run_m65_') !print *, 'IN RUN_M65, initial stop_m65 =', stop_m65 !flush(6) - !call date_and_time(d, t, values=v) - - !write(timestamp, '(I4.4,"-",I2.2,"-",I2.2," ",I2.2,":",I2.2,":",I2.2,".",I3.3)') & - ! v(1), v(2), v(3), v(5), v(6), v(7), v(8) - - !print *, trim(timestamp), ' CALLING M65A' - - call init_timer() - - !print *, 'IN RUN_M65, just passed init_timer' - do while (stop_m65 == 0) - if (decoder_ready /=0 .and. newdat /= 0) then - ! call date_and_time(d, t, values=v) - - ! write(timestamp, '(I4.4,"-",I2.2,"-",I2.2," ",I2.2,":",I2.2,":",I2.2,".",I3.3)') & - ! v(1), v(2), v(3), v(5), v(6), v(7), v(8) - - ! print *, trim(timestamp), ' CALLING M65A' - call m65a() - end if -!print *, ' ENTERING SLEEP_MSEC' -call sleep_msec(50) -!print *, ' RETURNED FROM SLEEP_MSEC' -!print *, ' LOOP: stop_m65 =', stop_m65, & -! ' decoder_ready=', decoder_ready, & -! ' newdat=', newdat - -! stop_m65 = .true. + call initialize_decode_parameters() + + ! Encode the CALL3.TXT candidates before the first decode's time budget starts. + ! deep65 rebuilds them when calls, grids, the EME filter, or CALL3.TXT change. + call dbg('run_m65: eager build_call3_candidates() STARTING at t=' // rtoa(sec_midn())) + call build_call3_candidates(mycall, hiscall, hisgrid, neme) + call dbg('run_m65: eager build_call3_candidates() DONE at t=' // rtoa(sec_midn())) + + do while (get_stop_m65() == 0) + if (claim_decode_request()) then + if (active_request_expired) then + write(line, '(A,1X,I0)') '', active_request_id + call write_stdout(trim(line)//new_line('a')) + else + call system_clock(t_start, t_rate) + call m65a() + call system_clock(t_now) + call dbg('run_m65: request completed, elapsed=' // rtoa(real(t_now - t_start)/real(t_rate))) + endif + endif + call sleep_msec(50) end do -! print *, 'RUN_M65 exiting main loop.' -! flush (6) call fini_timer() close(21) diff --git a/map65/libm65/s3avg.f90 b/map65/libm65/s3avg.f90 index 780d8a4c..5a21c31f 100644 --- a/map65/libm65/s3avg.f90 +++ b/map65/libm65/s3avg.f90 @@ -2,7 +2,7 @@ module s3avg_mod implicit none contains -subroutine s3avg(nsave, mode65, nutc, nhz, xdt, npol, ntol, s3, nsum, nkv, decoded) +subroutine s3avg(nsave, mode65, nutc, nhz, xdt, npol, nflip, ntol, s3, nsum, nkv, decoded) use extract_mod implicit none @@ -10,35 +10,39 @@ subroutine s3avg(nsave, mode65, nutc, nhz, xdt, npol, ntol, s3, nsum, nkv, decod ! decoding of average. integer, intent(inout) :: nsave - integer, intent(in) :: mode65, nutc, nhz, npol, ntol + integer, intent(in) :: mode65, nutc, nhz, npol, nflip, ntol real, intent(in) :: xdt real, intent(in) :: s3(64,63) !Synchronized spectra for 63 symbols - integer, intent(inout) :: nsum, nkv - character(len=22), intent(inout) :: decoded + integer, intent(out) :: nsum, nkv + character(len=22), intent(out) :: decoded real s3a(64,63,64) !Saved spectra real s3b(64,63) !Average spectra - integer iutc(64),ihz(64),ipol(64) + integer iutc(64),ihz(64),ipol(64),iflip(64) integer :: i,ihzdiff,nadd,ncount,nhist integer :: mrs(63), mrs2(63) !Dummy arguments for extract - real :: dtdiff + real, parameter :: dtdiff=0.2 real dt(64) logical ltext,first data first/.true./ - save + save first,iutc,ihz,ipol,iflip,s3a,dt + + nsum=0 + nkv=0 + decoded=' ' + ihzdiff=min(100,ntol) if(first) then iutc=-1 ihz=0 ipol=0 + iflip=0 first=.false. - ihzdiff=min(100,ntol) - dtdiff=0.2 endif do i=1,64 - if(nutc.eq.iutc(i) .and. abs(nhz-ihz(i)).lt.ihzdiff) then - nsave=mod(nsave-1+64,64)+1 + if(nutc.eq.iutc(i) .and. abs(nhz-ihz(i)).le.ihzdiff) then + nsave=mod(nsave-2+64,64)+1 go to 10 endif enddo @@ -46,6 +50,7 @@ subroutine s3avg(nsave, mode65, nutc, nhz, xdt, npol, ntol, s3, nsum, nkv, decod iutc(nsave)=nutc !Save UTC ihz(nsave)=nhz !Save freq in Hz ipol(nsave)=npol !Save pol + iflip(nsave)=nflip dt(nsave)=xdt !Save DT s3a(1:64,1:63,nsave)=s3 !Save the spectra @@ -55,11 +60,13 @@ subroutine s3avg(nsave, mode65, nutc, nhz, xdt, npol, ntol, s3, nsum, nkv, decod if(mod(iutc(i),2).ne.mod(nutc,2)) cycle !Use only same sequence if(abs(nhz-ihz(i)).gt.ihzdiff) cycle !Freq must match if(abs(xdt-dt(i)).gt.dtdiff) cycle !DT must match + ! Opposite sync polarities map s3 columns to complementary symbol positions. + if(iflip(i).eq.0) cycle + if(nflip.ne.iflip(i)) cycle s3b=s3b + s3a(1:64,1:63,i) nsum=nsum+1 enddo - decoded=' ' if(nsum.ge.2) then !Try decoding the sverage nadd=mode65*nsum call extract(s3b,nadd,ncount,nhist,decoded,ltext,mrs,mrs2) !Extract the message diff --git a/map65/libm65/stdout_channel_mod.f90 b/map65/libm65/stdout_channel_mod.f90 index a5f3b01f..2dffdb95 100644 --- a/map65/libm65/stdout_channel_mod.f90 +++ b/map65/libm65/stdout_channel_mod.f90 @@ -8,7 +8,7 @@ module stdout_channel_mod type, bind(C) :: StdoutSharedHeader integer(c_int32_t) :: version integer(c_int32_t) :: writeIndex - integer(c_int32_t) :: dataSize + integer(c_int32_t) :: readIndex integer(c_int32_t) :: seq end type StdoutSharedHeader @@ -75,6 +75,7 @@ end subroutine set_stdout_channel !========================================================= subroutine write_stdout(msg) use iso_c_binding + use sleep_msec_mod, only: sleep_msec implicit none !==== Dummy argument ===================================================== @@ -82,7 +83,9 @@ subroutine write_stdout(msg) !==== Local variables ==================================================== integer(c_int32_t) :: n, i, rc - integer(c_int32_t) :: w, idx + integer(c_int32_t) :: w, idx, r, occupied, free_bytes + integer :: nwait + integer, parameter :: MAX_WAIT_ITERS = 2000 ! ~2 s at 1 ms/iter character(kind=c_char) :: ch if (.not. initialized) return @@ -100,6 +103,21 @@ subroutine write_stdout(msg) w = hdr%writeIndex if (w < 0 .or. w >= g_buf_size) w = 0 + ! Wait for the reader to make room rather than overwriting unread + ! data. One byte of the buffer is always kept empty so a full ring + ! can be told apart from an empty one. If the reader stalls for a + ! couple of seconds we give up waiting and write anyway, so a dead + ! or stuck reader can never hang the decoder. + do nwait = 1, MAX_WAIT_ITERS + r = hdr%readIndex + if (r < 0 .or. r >= g_buf_size) r = 0 + occupied = w - r + if (occupied < 0) occupied = occupied + g_buf_size + free_bytes = g_buf_size - 1 - occupied + if (free_bytes >= n) exit + call sleep_msec(1) + end do + ! Write bytes with wraparound, using 0-based idx and 1-based buf do i = 0, n - 1 idx = w + i diff --git a/map65/libm65/stdout_shared_layout.h b/map65/libm65/stdout_shared_layout.h index c45d8852..4564678e 100644 --- a/map65/libm65/stdout_shared_layout.h +++ b/map65/libm65/stdout_shared_layout.h @@ -7,7 +7,10 @@ struct StdoutSharedHeader { std::uint32_t version; // For compatibility std::uint32_t writeIndex; // Next write position in buffer - std::uint32_t dataSize; // Bytes of new data just written + std::uint32_t readIndex; // Last position consumed by the reader thread; + // the writer uses this to compute free space + // and apply backpressure instead of + // overwriting unread data. std::uint32_t seq; // Incremented each write (helps detect missed events) }; diff --git a/map65/libm65/stdout_shared_memory.cpp b/map65/libm65/stdout_shared_memory.cpp index 0fbcab3a..946ea187 100644 --- a/map65/libm65/stdout_shared_memory.cpp +++ b/map65/libm65/stdout_shared_memory.cpp @@ -163,7 +163,7 @@ StdoutSharedMemory::StdoutSharedMemory(const std::wstring &mappingName, auto* region = getRegion(); region->header.version = 1; region->header.writeIndex = 0; - region->header.dataSize = 0; + region->header.readIndex = 0; region->header.seq = 0; } diff --git a/map65/libm65/symspec.f90 b/map65/libm65/symspec.f90 index d1c27fc2..abab5ef0 100644 --- a/map65/libm65/symspec.f90 +++ b/map65/libm65/symspec.f90 @@ -2,13 +2,13 @@ module symspec_mod implicit none contains -subroutine symspec(k,nxpol,ndiskdat,nb,nbslider,idphi,nfsample, & +subroutine symspec(k,nxpol,ndiskdat,nb,nbslider,idphi, & iqadjust,iqapply,gainx,gainy,phasex,phasey,rejectx,rejecty, & pxdb,pydb,ssz5a,nkhz,ihsym,nzap,slimit,lstrong) bind(C, name='symspec_') use iso_c_binding use datcom_ptrs_mod - use npar_ptrs_mod, only: fcenter + use npar_ptrs_mod, only: get_fcenter, nrate_active, nfft_active, nsmax_active use four2a_mod use timf2_mod use iqcal_mod @@ -17,7 +17,7 @@ subroutine symspec(k,nxpol,ndiskdat,nb,nbslider,idphi,nfsample, & ! C-facing arguments (keep these as in your modern version) integer(c_int), intent(in) :: k, nxpol, ndiskdat, nb, nbslider - integer(c_int), intent(in) :: idphi, nfsample + integer(c_int), intent(in) :: idphi integer(c_int), intent(in) :: iqadjust, iqapply real(c_float), intent(inout) :: gainx, gainy, phasex, phasey real(c_float), intent(out) :: rejectx, rejecty, pxdb, pydb @@ -27,6 +27,8 @@ subroutine symspec(k,nxpol,ndiskdat,nb,nbslider,idphi,nfsample, & real(c_float), intent(inout) :: slimit integer(c_signed_char), intent(out) :: lstrong(0:1023) + integer, parameter :: live_lookahead_samples=512 + ! ---- from legacy body, adapted to modules ---- ! (no COMMON, no local fcenter, no logical*1 lstrong) @@ -37,8 +39,12 @@ subroutine symspec(k,nxpol,ndiskdat,nb,nbslider,idphi,nfsample, & mm, nadjx, nadjy, nblk, nblks, nfft2, npts, nsum, nwindow, n, nfast real(real32) :: fac, faclim, peaklimit, px, py, q, rejectx0, rms, rmsx, rmsy, & s135, s45, sigmas, sx, sy, u, x1, x2, x3, x4, dphi, pi - real(real32) :: w(NFFT), w2a(NFFT), w2b(NFFT) - complex :: z, zfac, zsumx, zsumy, cx(NFFT), cy(NFFT), cx00(NFFT), cy00(NFFT) + + real(real32), allocatable :: w(:), w2a(:), w2b(:) + complex, allocatable :: cx(:), cy(:), cx00(:), cy00(:) + + complex :: z, zfac, zsumx, zsumy + real(c_double) :: fcenter complex :: cx0(0:1023), cx1(0:1023), cy0(0:1023), cy1(0:1023) data rms/999.0/, k0/99999999/, k1/0/, nadjx/0/, nadjy/0/ @@ -46,18 +52,32 @@ subroutine symspec(k,nxpol,ndiskdat,nb,nbslider,idphi,nfsample, & nfast = 1 -if (k.gt.5751000) goto 999 -if (k.lt.NFFT) then +! Stop when we�re near the end of the allocated minute buffer. +! nsmax_active = 60 * nrate_active, set from C++ at startup. +if (k.gt.nsmax_active-9000) goto 999 + +if (k.lt.nfft_active) then ihsym = 0 goto 999 endif if(k0.eq.99999999) then + ! First-time initialization: allocate buffers at runtime NFFT and + ! build the window(s). nfft_active is set from C++ via + ! set_runtime_params_() before any call into this routine. + if(.not.allocated(w)) allocate(w(nfft_active)) + if(.not.allocated(w2a)) allocate(w2a(nfft_active)) + if(.not.allocated(w2b)) allocate(w2b(nfft_active)) + if(.not.allocated(cx)) allocate(cx(nfft_active)) + if(.not.allocated(cy)) allocate(cy(nfft_active)) + if(.not.allocated(cx00)) allocate(cx00(nfft_active)) + if(.not.allocated(cy00)) allocate(cy00(nfft_active)) + pi=4.0*atan(1.0) w2a=0. w2b=0. - do i=1,NFFT - w(i)=(sin(i*pi/NFFT))**2 !Window for nfast=1 + do i=1,nfft_active + w(i)=(sin(i*pi/nfft_active))**2 !Window for nfast=1 if(i.lt.17833) w2a(i)=(sin(i*pi/17832.925))**2 !Window a for nfast=2 j=i-8916 if(j.gt.0 .and. j.lt.17833) w2b(i)=(sin(j*pi/17832.925))**2 ! b @@ -66,8 +86,11 @@ endif w2b=sqrt(2.0)*w2b endif - hsym=2048.d0*96000.d0/11025.d0 - if(nfsample.eq.95238) hsym=2048.d0*95238.1d0/11025.d0 + +! Symbol length in samples, based on the active runtime rate. +hsym = 2048.d0 * dble(nrate_active) / 11025.d0 + +if(nrate_active.eq.95238) hsym=2048.d0*95238.1d0/11025.d0 if (k.lt.k0) then ! Perform the legacy reset @@ -75,7 +98,8 @@ if (k.lt.k0) then savg = 0. ihsym = 0 k1 = 0 - if (ndiskdat.eq.0) dd(1:4,k+1:5760000)=0. + ! if (ndiskdat.eq.0) dd(1:4,k+1:5760000)=0. + if (ndiskdat.eq.0) dd(1:4,k+live_lookahead_samples+1:nsmax_active)=0. endif k0 = k @@ -119,7 +143,7 @@ k0 = k k1=k1+kstep enddo - npts=NFFT !Samples used in each half-symbol FFT + npts=nfft_active !Samples used in each half-symbol FFT ts=ts+hsym ja=ts ! ts already set from ihsym above; do not integrate it again !Index of first sample @@ -178,22 +202,22 @@ k0 = k endif endif - call four2a(cx,NFFT,1,1,1) !Second forward FFT (X) + call four2a(cx,nfft_active,1,1,1) !Second forward FFT (X) if(iqadjust.eq.0) nadjx=0 - if(iqadjust.ne.0 .and. nadjx.lt.50) call iqcal(nadjx,cx,NFFT, & + if(iqadjust.ne.0 .and. nadjx.lt.50) call iqcal(nadjx,cx,nfft_active, & gainx,phasex,zsumx,ipkx,rejectx0) - if(iqapply.ne.0) call iqfix(cx,NFFT,gainx,phasex) + if(iqapply.ne.0) call iqfix(cx,nfft_active,gainx,phasex) if(nxpol.ne.0) then - call four2a(cy,NFFT,1,1,1) !Second forward FFT (Y) + call four2a(cy,nfft_active,1,1,1) !Second forward FFT (Y) if(iqadjust.eq.0) nadjy=0 - if(iqadjust.ne.0 .and. nadjy.lt.50) call iqcal(nadjy,cy,NFFT, & + if(iqadjust.ne.0 .and. nadjy.lt.50) call iqcal(nadjy,cy,nfft_active, & gainy,phasey,zsumy,ipky,rejecty) - if(iqapply.ne.0) call iqfix(cy,NFFT,gainy,phasey) + if(iqapply.ne.0) call iqfix(cy,nfft_active,gainy,phasey) endif n=min(322,ihsym) - do i=1,NFFT + do i=1,nfft_active sx=real(cx(i))**2 + aimag(cx(i))**2 ss(1,n,i)=sx ! Pol = 0 savg(1,i)=savg(1,i) + sx @@ -232,11 +256,12 @@ k0 = k if(ihsym.eq.278) then if(iqadjust.ne.0 .and. ipkx.ne.0 .and. ipky.ne.0) then - rejectx=10.0*log10(savg(1,1+nfft-ipkx)/savg(1,1+ipkx)) - rejecty=10.0*log10(savg(3,1+nfft-ipky)/savg(3,1+ipky)) + rejectx=10.0*log10(savg(1,1+nfft_active-ipkx)/savg(1,1+ipkx)) + rejecty=10.0*log10(savg(3,1+nfft_active-ipky)/savg(3,1+ipky)) endif endif + fcenter=get_fcenter() nkhz=nint(1000.d0*(fcenter-int(fcenter))) if(fcenter.eq.0.d0) nkhz=125 diff --git a/map65/libm65/test_astro_pipeline.f90 b/map65/libm65/test_astro_pipeline.f90 deleted file mode 100644 index 07a67ccc..00000000 --- a/map65/libm65/test_astro_pipeline.f90 +++ /dev/null @@ -1,32 +0,0 @@ -program test_astro_pipeline - use iso_fortran_env, only: real64 - use astrosub_mod - implicit none - - integer :: nyear, month, nday, nfreq, ndop00 - real(real64) :: uth - character(len=6) :: mygrid - - ! Simple test case - nyear = 2025 - month = 1 - nday = 15 - uth = 12.0_real64 ! 12:00 UTC - nfreq = 1440000000/1000000 ! e.g. 1440 MHz → 1440 - mygrid = 'FN20rx' ! or whatever grid you like - ndop00 = 0 - - call astrosub00(nyear,month,nday,uth,nfreq,mygrid,ndop00,len(mygrid)) - - print *, 'Test astro pipeline:' - print *, ' nyear =', nyear - print *, ' month =', month - print *, ' nday =', nday - print *, ' uth =', uth - print *, ' nfreq =', nfreq - print *, ' mygrid =', mygrid - print *, ' ndop00 =', ndop00 - -end program test_astro_pipeline - -!does not require end module diff --git a/map65/libm65/tmoonsub.c b/map65/libm65/tmoonsub.c index 29ac28b4..f33dec0e 100644 --- a/map65/libm65/tmoonsub.c +++ b/map65/libm65/tmoonsub.c @@ -36,7 +36,7 @@ void tmoonsub_(double *day, double *glat, double *glong, double *moonalt, double *mrv, double *l, double *b, double *paxis); static const char -*usage = " Usage: tmoon date[yyyymm] timz[+/-h.hh] long[+/-dddmm] lat[+/-ddmm]\n" +usage[] = " Usage: tmoon date[yyyymm] timz[+/-h.hh] long[+/-dddmm] lat[+/-ddmm]\n" "example: tmoon 200009 0 -00155 5230\n"; /* @@ -360,6 +360,7 @@ void libration(double day, double lambda, double beta, double alpha, double *l, */ void illumination(double day, double lra, double ldec, double dr, double sra, double sdec, double *pabl, double *ill) { double x, y, phi, i; + (void)day; y = cos(sdec) * sin(sra - lra); x = sin(sdec) * cos(ldec) - cos(sdec) * sin(ldec) * cos (sra - lra); *pabl = atan22(y, x); @@ -448,6 +449,7 @@ R is unchanged. */ void equatorial(double d, double *lon, double *lat, double *r) { double eps, ceps, seps, l, b; + (void)r; l = *lon; b = * lat; @@ -464,6 +466,8 @@ of above, but used to find topocentric ecliptic coords. */ void ecliptic(double d, double *lon, double *lat, double *r) { double eps, ceps, seps, alp, dec; + (void)r; + alp = *lon; dec = *lat; eps = epsilon(d); diff --git a/map65/libm65/trimlist.f90 b/map65/libm65/trimlist.f90 index 5017bc89..088a4221 100644 --- a/map65/libm65/trimlist.f90 +++ b/map65/libm65/trimlist.f90 @@ -1,39 +1,49 @@ module trimlist_mod implicit none contains - subroutine trimlist(sig,km,ftol,indx,nsiz,nz) + subroutine select_unique_decodes(sig, msg, km, freq_tolerance, dt_tolerance, indx, nz) use indexx_mod implicit none - - integer, parameter :: MAXMSG=1000 !Size of decoded message list - real, intent(in) :: sig(MAXMSG,30) + + integer, parameter :: MAXMSG = 1000 + real, intent(in) :: sig(MAXMSG, 30) + character(len=22), intent(in) :: msg(MAXMSG) integer, intent(in) :: km - real, intent(in) :: ftol + real, intent(in) :: freq_tolerance, dt_tolerance integer, intent(out) :: indx(MAXMSG) - integer, intent(out) :: nsiz(MAXMSG) integer, intent(out) :: nz - - integer :: n, i0, i, j0, j - - ! 1 2 3 4 5 6 7 8 - ! nfile nutc freq snr dt ipol flip sync - - call indexx(sig(1,3),km,indx) !Sort list by frequency - - n=1 - i0=1 - do i=2,km - j0=indx(i-1) - j=indx(i) - if(sig(j,3)-sig(j0,3).gt.ftol) then - nsiz(n)=i-i0 - i0=i - n=n+1 - endif - enddo - nz=n - nsiz(nz)=km+1-i0 - nsiz(nz+1)=-1 - - end subroutine trimlist + + integer :: sorted(MAXMSG) + integer :: i, j, k + logical :: duplicate + + nz = 0 + if (km <= 0) return + + call indexx(sig(:, 3), km, sorted) + do k = 1, km + i = sorted(k) + if (len_trim(msg(i)) == 0) cycle + + duplicate = .false. + do j = 1, nz + if (nint(sig(i, 2)) /= nint(sig(indx(j), 2))) cycle + if (msg(i) /= msg(indx(j))) cycle + if (nint(sig(i, 7)) /= nint(sig(indx(j), 7))) cycle + if (abs(sig(i, 3) - sig(indx(j), 3)) > freq_tolerance) cycle + if (abs(sig(i, 5) - sig(indx(j), 5)) > dt_tolerance) cycle + duplicate = .true. + if (sig(i, 8) > sig(indx(j), 8) .or. & + (sig(i, 8) == sig(indx(j), 8) .and. sig(i, 4) > sig(indx(j), 4)) .or. & + (sig(i, 8) == sig(indx(j), 8) .and. sig(i, 4) == sig(indx(j), 4) .and. & + i > indx(j))) indx(j) = i + exit + end do + + if (.not. duplicate) then + nz = nz + 1 + indx(nz) = i + end if + end do + end subroutine select_unique_decodes end module trimlist_mod diff --git a/map65/libm65/wideband_sync.f90 b/map65/libm65/wideband_sync.f90 index a39b42f2..a8ae8a68 100644 --- a/map65/libm65/wideband_sync.f90 +++ b/map65/libm65/wideband_sync.f90 @@ -5,7 +5,7 @@ module wideband_sync type candidate real :: snr !Relative S/N of sync detection real :: f !Freq of sync tone, 0 to 96000 Hz - real :: xdt !DT of matching sync pattern, -1.0 to +4.0 s + real :: xdt !DT of matching sync pattern, -1.0 to +4.6 s real :: pol !Polarization angle, degrees integer :: ipol !Polarization angle, 1 to 4 ==> 0, 45, 90, 135 deg integer :: iflip !Sync type: JT65 = +/- 1, Q65 = 0 @@ -15,30 +15,32 @@ module wideband_sync real :: ccfmax real :: xdt real :: pol + real :: combine_pol integer :: ipol integer :: iflip logical :: birdie end type sync_dat - integer, parameter :: NFFT = 32768 integer, parameter :: MAX_CANDIDATES = 50 real(real32), parameter :: SNR1_THRESHOLD = 4.5 type(sync_dat), allocatable :: sync(:) !NFFT + type(sync_dat), allocatable :: q65_generalized_sync(:) integer nkhz_center contains subroutine get_candidates(ss, savg, xpol, jz, nfa, nfb, nts_jt65, nts_q65, cand, ncand) use iso_c_binding - use debug_log + use debug_log, only: dbg, itoa, rtoa use indexx_mod, only: indexx use iso_fortran_env, only: real64 + use npar_ptrs_mod, only: nrate_active, nfft_active implicit none !==== Dummy arguments ===================================================== - real, intent(in) :: ss(4,322,NFFT) - real, intent(in) :: savg(4,NFFT) + real, intent(in) :: ss(4,322,nfft_active) + real, intent(in) :: savg(4,nfft_active) logical, intent(in) :: xpol integer, intent(in) :: jz, nfa, nfb integer, intent(in) :: nts_jt65, nts_q65 @@ -47,9 +49,11 @@ contains ! Search symbol spectra ss() over frequency range nfa to nfb (in kHz) for -! JT65 and Q65 sync patterns. The nts_* variables are the submode tone -! spacings: 1 2 4 8 16 for A B C D E. Birdies are detected and -! excised. Candidates are returned in the structure array cand(). +! sync candidates. A valid generalized Q65 score replaces the legacy mixed-mode +! surface, so that path returns Q65 candidates only; MAP65 discovers JT65 +! independently through ccf65(). Legacy paths may retain JT65 candidates. +! The nts_* variables are the submode tone spacings: 1 2 4 8 16 for A B C D E. +! Birdies are detected and excised. Candidates are returned in cand(). integer, parameter :: MAX_PEAKS = 100 real pavg(-20:20) @@ -60,15 +64,16 @@ contains integer, allocatable :: indx(:) logical skip - call wb_sync(ss, savg, xpol, jz, nfa, nfb) !Output to sync() array + call wb_sync(ss, savg, xpol, nts_q65.ne.0, jz, nfa, nfb) !Output to sync() array tstep = 2048.0/11025.0 !0.185760 s: 0.5*tsym_jt65, 0.3096*tsym_q65 - df3 = 96000.0/NFFT + df3 = real(nrate_active)/real(nfft_active) ia = nint(1000*nfa/df3) + 1 ib = nint(1000*nfb/df3) + 1 - if (ia .lt. 1) ia = 1 - if (ib .gt. NFFT - 1) ib = NFFT - 1 + if (ia .lt. 21) ia = 21 + if (ib .gt. nfft_active - 20) ib = nfft_active - 20 iz = ib - ia + 1 + allocate (indx(iz)) ! w3sz this if block should not be necessary but it is @@ -83,7 +88,7 @@ contains n_top = indx(iz) + ia - 1 snr_top = sync(n_top)%ccfmax flip_top = sync(n_top)%iflip - + k = 0 do i = 1, MAX_PEAKS if ((iz + 1 - i) .lt. 1) cycle !w3sz debug @@ -97,9 +102,10 @@ contains if (sync(n)%birdie) cycle ! Test for signal outside of TxT range and set bw for this signal type - j1 = int((sync(n)%xdt + 1.0)/tstep - 1.0) - j2 = int((sync(n)%xdt + 52.0)/tstep + 1.0) + j1 = max(0,min(jz,int((sync(n)%xdt + 1.0)/tstep - 1.0))) + j2 = max(1,int((sync(n)%xdt + 52.0)/tstep + 1.0)) if (flip .ne. 0) j2 = int((sync(n)%xdt + 47.811)/tstep + 1.0) + j2 = max(1,j2) ipol = sync(n)%ipol pavg = 0. do j = 1, j1 @@ -108,13 +114,16 @@ contains do j = j2, jz pavg = pavg + ss(ipol, j, n - 20:n + 20) enddo - jsum = j1 + (jz - j2 + 1) - pmax = maxval(pavg(-2:2)) !### Why not just pavg(0) ? - base = (sum(pavg) - pmax)/jsum - pmax = pmax/base - if (pmax .gt. 5.0) cycle + jsum = outside_row_count(j1,j2,jz) + if (jsum .gt. 0) then + pmax = maxval(pavg(-2:2)) !### Why not just pavg(0) ? + base = (sum(pavg) - pmax)/jsum + pmax = pmax/base + if (pmax .gt. 5.0) cycle + endif skip = .false. do m = 1, k !Skip false syncs within signal bw + if (cand(m)%iflip .ne. nint(flip)) cycle !only dedupe within the same type diffhz = 1000.0*(f0 - cand(m)%f) bw = nts_q65*110.0 if (cand(m)%iflip .ne. 0) bw = nts_jt65*178.0 @@ -128,40 +137,52 @@ contains cand(k)%pol = sync(n)%pol cand(k)%ipol = sync(n)%ipol cand(k)%iflip = nint(flip) - cand(k)%indx = n + cand(k)%indx = n + ! write(50,3050) i,k,m,f0+32.0,diffhz,bw,snr1,db(snr1) !3050 format(3i5,f8.3,2f8.0,2f8.2) if (k .ge. MAX_CANDIDATES) exit enddo - ncand = k + ncand = k return end subroutine get_candidates - subroutine wb_sync(ss, savg, xpol, jz, nfa, nfb) + subroutine wb_sync(ss, savg, xpol, q65_enabled, jz, nfa, nfb) use iso_c_binding + use iso_fortran_env, only: real64 use debug_log use indexx_mod + use map65_polarization_score_mod, only: generalized_polarization_score,polarization_matrix use txpol_mod use trimlist_mod use pctile_mod use polfit_mod + use npar_ptrs_mod, only: nrate_active, nfft_active implicit none !==== Dummy arguments ===================================================== - real, intent(in) :: ss(4,322,NFFT) - real, intent(in) :: savg(4,NFFT) - logical, intent(in) :: xpol + real, intent(in) :: ss(4,322,nfft_active) + real, intent(in) :: savg(4,nfft_active) + logical, intent(in) :: xpol,q65_enabled integer, intent(in) :: jz, nfa, nfb integer, parameter :: LAGMAX = 30 + integer, parameter :: Q65_SYNC_ROWS = 3*22, JT65_SYNC_ROWS = 2*63 + integer, parameter :: Q65_MIN_ROWS = Q65_SYNC_ROWS - 3 + integer, parameter :: JT65_MIN_ROWS = JT65_SYNC_ROWS - 2 real(c_float) :: savg_med(4) real ccf4(4), ccf4best(4), a(3) - real base, bw, ccf, ccfmax, df3, fac, flip, poldeg, spk, syncmin, tstep - integer i, i0, ia, ib, ipolbest, j, ja, jb, k, lag, lagbest - integer nbw, nguard, npol, ipol - logical first + real base, ccf, ccfmax, combine_poldeg, df3, fac, flip, poldeg, row_scale, tstep + real(real64) :: combine_angle,g00,g01,g11,n00,n01,n11,physical_angle + real(real64) :: projections(4),whitened_score + integer i, ia, ib, ipolbest, j, k, lag, lagbest, nrows + integer npol, ipol + logical first,generalized_available,score_valid integer isync(22) integer jsync0(63), jsync1(63) + integer q65_available(22,0:LAGMAX), q65_row_count(0:LAGMAX) + integer jt65_0_available(63,0:LAGMAX), jt65_0_row_count(0:LAGMAX) + integer jt65_1_available(63,0:LAGMAX), jt65_1_row_count(0:LAGMAX) integer ip(1) ! --- JT65 wideband debugging probe --- @@ -195,17 +216,48 @@ contains first = .false. endif - df3 = 96000.0/NFFT + df3 = real(nrate_active)/real(nfft_active) ia = nint(1000*nfa/df3) + 1 !Flat frequency range for WSE converters ib = nint(1000*nfb/df3) + 1 if (ia .lt. 1) ia = 1 - if (ib .gt. NFFT - 1) ib = NFFT - 1 + if (ib .gt. nfft_active - 1) ib = nfft_active - 1 npol = 1 if (xpol) npol = 4 + q65_row_count = 0 + jt65_0_row_count = 0 + jt65_1_row_count = 0 + do lag = 0, LAGMAX + do j = 1, 22 + k = isync(j) + lag + q65_available(j,lag) = min(3,max(0,jz-k+1)) + q65_row_count(lag) = q65_row_count(lag) + q65_available(j,lag) + enddo + do j = 1, 63 + k = jsync0(j) + lag + jt65_0_available(j,lag) = min(2,max(0,jz-k+1)) + jt65_0_row_count(lag) = jt65_0_row_count(lag) + jt65_0_available(j,lag) + + k = jsync1(j) + lag + jt65_1_available(j,lag) = min(2,max(0,jz-k+1)) + jt65_1_row_count(lag) = jt65_1_row_count(lag) + jt65_1_available(j,lag) + enddo + enddo + do i = 1, npol call pctile(savg(i, ia:ib), ib - ia + 1, 50, savg_med(i)) enddo + n00=real(savg_med(1),real64)/real(jz,real64) + n11=n00 + n01=0.0_real64 + generalized_available=.false. + if (xpol .and. q65_enabled) then + n11=real(savg_med(3),real64)/real(jz,real64) + call pctile(0.5*(savg(2,ia:ib)-savg(4,ia:ib)),ib-ia+1,50,base) + n01=real(base,real64)/real(jz,real64) + call generalized_polarization_score(0.0_real64,0.0_real64,0.0_real64, & + n00,n11,n01,whitened_score,physical_angle,combine_angle,generalized_available) + endif ! do i=ia,ib ! write(14,3014) 0.001*(i-1)*df3,savg(1:npol,i) !3014 format(5f10.3) @@ -217,77 +269,131 @@ contains do i = ia, ib ccfmax = 0. + poldeg = 0. + combine_poldeg = 0. + q65_generalized_sync(i)%ccfmax=0. + q65_generalized_sync(i)%xdt=0. + q65_generalized_sync(i)%pol=0. + q65_generalized_sync(i)%combine_pol=0. + q65_generalized_sync(i)%ipol=1 + q65_generalized_sync(i)%iflip=0 + q65_generalized_sync(i)%birdie=.false. do lag = 0, LAGMAX - ccf = 0. - ccf4 = 0. - do j = 1, 22 !Test for Q65 sync - k = isync(j) + lag - ccf4(1:npol) = ccf4(1:npol) + ss(1:npol, k, i + 1) + & - ss(1:npol, k + 1, i + 1) + ss(1:npol, k + 2, i + 1) - enddo - ccf4(1:npol) = ccf4(1:npol) - savg(1:npol, i + 1)*3*22/float(jz) - ccf = maxval(ccf4) - ip = maxloc(ccf4) - ipol = ip(1) - if (ccf .gt. ccfmax) then - ipolbest = ipol - lagbest = lag - ccfmax = ccf - ccf4best = ccf4 - flip = 0. + nrows = q65_row_count(lag) + if (nrows .ge. Q65_MIN_ROWS) then + ccf = 0. + ccf4 = 0. + do j = 1, 22 !Test for Q65 sync + k = isync(j) + lag + if (q65_available(j,lag) .ge. 1) & + ccf4(1:npol) = ccf4(1:npol) + ss(1:npol,k,i) + if (q65_available(j,lag) .ge. 2) & + ccf4(1:npol) = ccf4(1:npol) + ss(1:npol,k+1,i) + if (q65_available(j,lag) .ge. 3) & + ccf4(1:npol) = ccf4(1:npol) + ss(1:npol,k+2,i) + enddo + ccf4(1:npol) = ccf4(1:npol) - savg(1:npol,i)*real(nrows)/real(jz) + row_scale = sqrt(real(Q65_SYNC_ROWS)/real(nrows)) + ccf4(1:npol) = row_scale*ccf4(1:npol) + ccf = maxval(ccf4) + ip = maxloc(ccf4) + ipol = ip(1) + if (generalized_available) then + projections=real(ccf4,real64) + call polarization_matrix(projections,g00,g11,g01) + call generalized_polarization_score(g00,g11,g01,n00,n11,n01, & + whitened_score,physical_angle,combine_angle,score_valid) + if (score_valid .and. whitened_score > & + real(q65_generalized_sync(i)%ccfmax,real64)) then + q65_generalized_sync(i)%ccfmax=real(whitened_score) + q65_generalized_sync(i)%xdt=lag*tstep-1.0 + q65_generalized_sync(i)%pol=real(physical_angle) + q65_generalized_sync(i)%combine_pol=real(combine_angle) + q65_generalized_sync(i)%ipol=ipol + endif + endif + if (ccf .gt. ccfmax) then + ipolbest = ipol + lagbest = lag + ccfmax = ccf + ccf4best = ccf4 + flip = 0. + endif endif - ccf = 0. - ccf4 = 0. - do j = 1, 63 !Test for JT65 sync, std msg - k = jsync0(j) + lag - ccf4(1:npol) = ccf4(1:npol) + ss(1:npol, k, i + 1) + ss(1:npol, k + 1, i + 1) - enddo - ccf4(1:npol) = ccf4(1:npol) - savg(1:npol, i + 1)*2*63/float(jz) - ccf = maxval(ccf4) - ip = maxloc(ccf4) - ipol = ip(1) - if (ccf .gt. ccfmax) then - ipolbest = ipol - lagbest = lag - ccfmax = ccf - ccf4best = ccf4 - flip = 1.0 + nrows = jt65_0_row_count(lag) + if (nrows .ge. JT65_MIN_ROWS) then + ccf = 0. + ccf4 = 0. + do j = 1, 63 !Test for JT65 sync, std msg + k = jsync0(j) + lag + if (jt65_0_available(j,lag) .ge. 1) & + ccf4(1:npol) = ccf4(1:npol) + ss(1:npol,k,i) + if (jt65_0_available(j,lag) .ge. 2) & + ccf4(1:npol) = ccf4(1:npol) + ss(1:npol,k+1,i) + enddo + ccf4(1:npol) = ccf4(1:npol) - savg(1:npol,i)*real(nrows)/real(jz) + row_scale = sqrt(real(JT65_SYNC_ROWS)/real(nrows)) + ccf4(1:npol) = row_scale*ccf4(1:npol) + ccf = maxval(ccf4) + ip = maxloc(ccf4) + ipol = ip(1) + if (ccf .gt. ccfmax) then + ipolbest = ipol + lagbest = lag + ccfmax = ccf + ccf4best = ccf4 + flip = 1.0 + endif endif - ccf = 0. - ccf4 = 0. - do j = 1, 63 !Test for JT65 sync, OOO msg - k = jsync1(j) + lag - ccf4(1:npol) = ccf4(1:npol) + ss(1:npol, k, i + 1) + ss(1:npol, k + 1, i + 1) - enddo - ccf4(1:npol) = ccf4(1:npol) - savg(1:npol, i + 1)*2*63/float(jz) - ccf = maxval(ccf4) - ip = maxloc(ccf4) - ipol = ip(1) - if (ccf .gt. ccfmax) then - ipolbest = ipol - lagbest = lag - ccfmax = ccf - ccf4best = ccf4 - flip = -1.0 + nrows = jt65_1_row_count(lag) + if (nrows .ge. JT65_MIN_ROWS) then + ccf = 0. + ccf4 = 0. + do j = 1, 63 !Test for JT65 sync, OOO msg + k = jsync1(j) + lag + if (jt65_1_available(j,lag) .ge. 1) & + ccf4(1:npol) = ccf4(1:npol) + ss(1:npol,k,i) + if (jt65_1_available(j,lag) .ge. 2) & + ccf4(1:npol) = ccf4(1:npol) + ss(1:npol,k+1,i) + enddo + ccf4(1:npol) = ccf4(1:npol) - savg(1:npol,i)*real(nrows)/real(jz) + row_scale = sqrt(real(JT65_SYNC_ROWS)/real(nrows)) + ccf4(1:npol) = row_scale*ccf4(1:npol) + ccf = maxval(ccf4) + ip = maxloc(ccf4) + ipol = ip(1) + if (ccf .gt. ccfmax) then + ipolbest = ipol + lagbest = lag + ccfmax = ccf + ccf4best = ccf4 + flip = -1.0 + endif endif enddo ! lag - poldeg = 0. if (xpol .and. ccfmax .ge. SNR1_THRESHOLD) then call polfit(ccf4best, 4, a) poldeg = a(3) endif + combine_poldeg=poldeg sync(i)%ccfmax = ccfmax sync(i)%xdt = lagbest*tstep - 1.0 sync(i)%pol = poldeg + sync(i)%combine_pol = combine_poldeg sync(i)%ipol = ipolbest sync(i)%iflip = int(flip) sync(i)%birdie = .false. if (ccfmax/(savg(ipolbest, i)/savg_med(ipolbest)) .lt. 3.0) sync(i)%birdie = .true. + if (generalized_available) then + ipol=q65_generalized_sync(i)%ipol + if (q65_generalized_sync(i)%ccfmax/(savg(ipol,i)/savg_med(ipol)) .lt. 3.0) & + q65_generalized_sync(i)%birdie=.true. + endif ! --- JT65 wideband probe (new) --- ! freq_hz = 0.001 * (i - 1) * df3 ! convert FFT bin index to kHz @@ -303,26 +409,28 @@ contains call pctile(sync(ia:ib)%ccfmax, ib - ia + 1, 50, base) sync(ia:ib)%ccfmax = sync(ia:ib)%ccfmax/base + if (generalized_available) then + call pctile(q65_generalized_sync(ia:ib)%ccfmax,ib-ia+1,50,base) + if (base > tiny(base)) then + q65_generalized_sync(ia:ib)%ccfmax=q65_generalized_sync(ia:ib)%ccfmax/base + sync(ia:ib)=q65_generalized_sync(ia:ib) + endif + endif - bw = 65*4*1.66666667 !Q65-60C bandwidth - nbw = int(bw/df3 + 1) !Number of bins to blank - syncmin = 2.0 - nguard = 10 - do i = ia, ib - if (sync(i)%ccfmax .lt. syncmin) cycle - if ((i .lt. 1) .or. (i .gt. (NFFT - nbw))) cycle !w3sz debug - spk = maxval(sync(i:i + nbw)%ccfmax) - ip = maxloc(sync(i:i + nbw)%ccfmax) - i0 = ip(1) + i - 1 - ja = min(i, i0 - nguard) - jb = i0 + nbw + nguard - if (ja .lt. 1) cycle !ja = 1 !w3sz debug - if (jb .lt. 1) cycle !jb = 1 !w3sz debug - if (ja .gt. NFFT) cycle !ja = NFFT !w3sz debug - if (jb .gt. NFFT) cycle !jb = NFFT !w3sz debug - sync(ja:jb)%ccfmax = 0. - sync(i0)%ccfmax = spk - enddo + ! A local-peak "collapse to single survivor" pass used to run here, + ! blanking a wide (~450 Hz) same-type swath around whatever bin its + ! own forward-only search happened to land on. Because that search + ! and blanking radius were not centered on the true global peak, it + ! could -- and, for closely-spaced real Q65 signals, did -- wipe out + ! a much stronger genuine peak in favor of a weaker one found earlier + ! in the frequency sweep, corrupting the candidate frequency reported + ! for that signal (confirmed via w3sz debug logging: a real Q65 + ! signal's candidate frequency was off by ~150-200 Hz from its true + ! peak whenever this pass ran, and exactly correct with it removed). + ! get_candidates() below already does its own correct, strength- + ! ordered, same-type-only deduplication (skip a candidate within its + ! own signal bandwidth of an already-accepted stronger one), which + ! does not have this failure mode, so this pass is not needed. ! do i=ia,ib ! write(15,3015) 0.001*(i-1)*df3+32.0,sync(i)%ccfmax,sync(i)%xdt, & @@ -333,10 +441,19 @@ contains return end subroutine wb_sync - subroutine init_wideband_sync(n) + pure integer function outside_row_count(j1,j2,jz) + implicit none + integer, intent(in) :: j1,j2,jz + + outside_row_count = max(0,min(j1,jz)) + max(0,jz-max(1,j2)+1) + end function outside_row_count + + subroutine init_wideband_sync() + use npar_ptrs_mod, only: nfft_active implicit none - integer, intent(in) :: n - if (.not. allocated(sync)) allocate (sync(n)) + if (.not. allocated(sync)) allocate (sync(nfft_active)) + if (.not. allocated(q65_generalized_sync)) & + allocate (q65_generalized_sync(nfft_active)) end subroutine init_wideband_sync end module wideband_sync diff --git a/map65/main.cpp b/map65/main.cpp index 55ef209a..5c8de1d7 100644 --- a/map65/main.cpp +++ b/map65/main.cpp @@ -9,18 +9,25 @@ #include #endif - #include "revision_utils.hpp" #include "mainwindow.h" #include "fortran_mutex.hpp" +#include "globals.h" +#include "runtime_paths.h" #include +extern "C" void set_runtime_params_(int rate_hz, int nfft, int nfft_big); + extern "C" { // Fortran procedures we need void four2a_ (_Complex float *, int * nfft, int * ndim, int * isign, int * iform, int len); } +extern int g_sampleRate; +extern int active_nfft; +int g_activeNfft = 32768; // default + int main(int argc, char *argv[]) { #ifdef _WIN32 @@ -37,12 +44,55 @@ int main(int argc, char *argv[]) # endif #endif QApplication a {argc, argv}; - - // Override programs executable basename as application name. a.setApplicationName ("MAP65"); - a.setApplicationVersion ("3.6"); - // switch off as we share an Info.plist file with WSJT-X + a.setApplicationVersion ("3.8.2"); a.setAttribute (Qt::AA_DontUseNativeMenuBar); + + QString appDir = QApplication::applicationDirPath(); + QString dataDir = writableMap65DataDir(); + QSettings settings(map65SettingsFile(appDir, dataDir), QSettings::IniFormat); + settings.beginGroup("Common"); + int srFlag = readFSam96000(settings, 1); + settings.endGroup(); + if(srFlag <= 1) g_sampleRate = 96000; + else if(srFlag == 2) g_sampleRate = 192000; + if (g_sampleRate != 96000 && g_sampleRate != 192000) + g_sampleRate = 96000; + +// ------------------------------------------------------------ +// NEW: compute active FFT sizes for MAP65 +// ------------------------------------------------------------ +int active_rate = g_sampleRate; + +// Keep ~3 Hz bin resolution like WSJT-X/QMAP +auto round_pow2 = [](int x) { + int p = 1; + while (p < x) p <<= 1; + return p; +}; + +// symspec FFT size +active_nfft = round_pow2( + static_cast( + static_cast(BASELINE_NFFT) * active_rate / BASELINE_RATE + ) +); + +g_activeNfft = active_nfft; + +// big FFT size (56 symbols * sample rate) +int active_nfft_big = 56 * active_rate; + +// ------------------------------------------------------------ +// Push runtime parameters into Fortran BEFORE MainWindow starts +// ------------------------------------------------------------ +set_runtime_params_(active_rate, active_nfft, active_nfft_big); + +// ------------------------------------------------------------ +// allocate buffers now that sample rate is known +// ------------------------------------------------------------ +id.resize(4 * 60 * g_sampleRate); + MainWindow w; w.show (); diff --git a/map65/mainwindow.cpp b/map65/mainwindow.cpp index 7a47d5b6..3cb1e760 100644 --- a/map65/mainwindow.cpp +++ b/map65/mainwindow.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -47,6 +48,8 @@ #include "stdout_channel.h" #include "fortran_mutex.hpp" +#include "pskreporter_settings.h" +#include "runtime_paths.h" #if !defined(Q_OS_WIN) extern "C" { @@ -66,51 +69,13 @@ extern "C" void ptt_close(void); #undef MessageBox #endif -#define NFFT 32768 - - QByteArray g_TxTuneGeometry; -namespace { -struct Map65TxWaveStorage { short int samples[2*60*12000]; }; -struct Map65RxSamplesStorage { qint16 samples[4*60*96000]; }; - -QString writableMap65DataDir() -{ - QString dataDir = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation); - if (dataDir.isEmpty()) { - dataDir = QDir::home().absoluteFilePath(".map65"); - } - - if (!QDir{}.mkpath(dataDir)) { - qWarning() << "Unable to create MAP65 data directory:" << dataDir; - } - - QDir dir {dataDir}; - if (!dir.mkpath("save")) { - qWarning() << "Unable to create MAP65 save directory:" << dir.absoluteFilePath("save"); - } - return dataDir; -} - -QString map65SettingsFile(QString const& appDir, QString const& dataDir) -{ - QString settingsFile = QDir {dataDir}.absoluteFilePath("map65.ini"); - QString legacySettingsFile = QDir {appDir}.absoluteFilePath("map65.ini"); - if (!QFile::exists(settingsFile) && QFile::exists(legacySettingsFile)) { - if (QFile::copy(legacySettingsFile, settingsFile)) { - QFile::setPermissions(settingsFile, QFile::ReadOwner | QFile::WriteOwner - | QFile::ReadGroup | QFile::ReadOther); - } else { - qWarning() << "Unable to migrate MAP65 settings from" << legacySettingsFile - << "to" << settingsFile; - } - } - return settingsFile; -} -} // namespace +int g_sampleRate = 96000; +int active_nfft; +std::vector id; -short int (&iwave)[2*60*12000] = (new Map65TxWaveStorage{})->samples; //Wave file for Tx audio +short int iwave[2*60*12000]; //Wave file for Tx audio int nwave; //Length of Tx waveform bool btxok; //True if OK to transmit bool bTune; @@ -119,14 +84,10 @@ double outputLatency; //Latency in seconds int txPower; int iqAmp; int iqPhase; -qint16 (&id)[4*60*96000] = (new Map65RxSamplesStorage{})->samples; int pipefd[2]; // pipefd[0] = read end, pipefd[1] = write end TxTune* g_pTxTune = NULL; -extern const int RxDataFrequency = 96000; -extern const int TxDataFrequency = 11025; - std::atomic stop_m65{false}; QString guiDate; //liveCQ @@ -134,8 +95,6 @@ QStringList allDecodes; //liveCQ QStringList allDecodes2; //liveCQ QString m_otherUrl; bool m_w3szUrl; -bool m_spot_to_psk_reporter; -bool m_psk_reporter_tcpip; struct MainWindow::DecoderContext { @@ -149,7 +108,7 @@ MainWindow::DecoderContext::DecoderContext() stdoutChan = new StdoutChannel( L"MAP65_STDOUT_MAPPING", L"MAP65_STDOUT_EVENT", - 64 * 1024 + 1024 * 1024 ); } @@ -158,12 +117,43 @@ MainWindow::DecoderContext::~DecoderContext() delete stdoutChan; } +// TEMP diagnostic 2026-09-10 for the "decode reaches map65_rx.log but not the +// Messages window, only on the first decode cycle after MAP65 starts" report. +// Writes to its own separate log file rather than the shared w3sz_debug.log +// Fortran's dbg() uses -- the two processes/threads have no lock between +// them, and sharing a file produces torn, interleaved lines. Timestamps use +// the same sec_midn()-style local h*3600+m*60+s+ms/1000 format as the +// Fortran log, so the two can still be correlated by eye. Strip both files' +// worth of logging before merge. +// +// Mirrors run_m65.f90's dbg_enabled flag -- flip to true to re-enable this +// log without touching any of the cppDbg(...) call sites scattered through +// this file. +static bool const cppDbgEnabled = false; + +static void cppDbg(const QString &msg) +{ + if (!cppDbgEnabled) return; + double const t = [] { + QTime const now = QTime::currentTime(); + return now.hour() * 3600.0 + now.minute() * 60.0 + now.second() + now.msec() / 1000.0; + }(); + QFile f("w3sz_debug_cpp.log"); + if (f.open(QIODevice::Append | QIODevice::Text)) { + QTextStream out(&f); + out << "mainwindow: " << msg << " at t=" << QString::number(t, 'f', 3) << "\n"; + } +} + //-------------------------------------------------- MainWindow constructor MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow), m_appDir {QApplication::applicationDirPath ()}, + m_installedDataDir {installed_data_directory ().absolutePath ()}, m_dataDir {writableMap65DataDir ()}, + m_eclipseFile {map65RuntimeSourceFile (m_appDir, m_installedDataDir, m_dataDir, + "eclipse.txt")}, m_settings_filename {map65SettingsFile (m_appDir, m_dataDir)}, m_astro_window {new Astro {m_settings_filename}}, m_band_map_window {new BandMap {m_settings_filename}}, @@ -171,13 +161,15 @@ MainWindow::MainWindow(QWidget *parent) : m_wide_graph_window {new WideGraph {m_settings_filename}}, m_gui_timer {new QTimer {this}} { - qDebug() << "IN MainWindow Constructor NFFT IS: " << NFFT; - // Legacy C++ and Fortran paths still use relative opens for runtime files. + qDebug() << "IN MainWindow Constructor active_nfft IS: " << active_nfft; if (!QDir::setCurrent(m_dataDir)) { qWarning() << "Unable to set MAP65 working directory:" << m_dataDir; } + QByteArray dataDirBytes = m_dataDir.toLocal8Bit(); + set_wsjtx_dir_(dataDirBytes.constData(), dataDirBytes.size()); + ensureMap65RuntimeFile(m_appDir, m_installedDataDir, m_dataDir, "CALL3.TXT"); constexpr int baseSeconds = 56; - constexpr int sampleRate = 96000; + const int sampleRate = g_sampleRate; constexpr int channels = 4; // dd(1..4, t) decoderCtx = new DecoderContext(); @@ -192,17 +184,28 @@ MainWindow::MainWindow(QWidget *parent) : // Tell Fortran about the maximum shape (channels × pairsWorst) set_dd_ptr(dd, channels, pairsWorst); + qDebug() << "g_sampleRate:" << g_sampleRate + << "sampleRate:" << sampleRate + << "id.size():" << id.size() + << "bytes:" << id.size() * sizeof(id[0]); + std::cout << "dd pointer set to: " << dd << " size: " << ddSize << " (channels=" << channels << ", pairsWorst=" << pairsWorst << ")\n"; - ss = new float[4 * 322 * NFFT]; - savg = new float[4 * NFFT]; - set_ss_ptr(ss, 4, 322, NFFT); + ss = new float[4 * 322 * active_nfft]; + savg = new float[4 * active_nfft]; + set_ss_ptr(ss, 4, 322, active_nfft); std::cout << "ss pointer set to: " << ss << std::endl; - set_savg_ptr(savg, 4, NFFT); + set_savg_ptr(savg, 4, active_nfft); std::cout << "savg pointer set to: " << savg << std::endl; + dd_old = new float[ddSize]; + set_dd_old_ptr(dd_old, channels, pairsWorst); + ss_old = new float[4 * 322 * active_nfft]; + savg_old = new float[4 * active_nfft]; + set_ss_old_ptr(ss_old, 4, 322, active_nfft); + set_savg_old_ptr(savg_old, 4, active_nfft); qDebug() << "MAINWINDOW created dd ss savg "; @@ -243,6 +246,7 @@ MainWindow::MainWindow(QWidget *parent) : ui->actionNo_Deep_Search->setActionGroup(DepthGroup); ui->actionNormal_Deep_Search->setActionGroup(DepthGroup); ui->actionAggressive_Deep_Search->setActionGroup(DepthGroup); + ui->actionFull_Deep_Search->setActionGroup(DepthGroup); QButtonGroup* txMsgButtonGroup = new QButtonGroup; txMsgButtonGroup->addButton(ui->txrb1,1); @@ -343,7 +347,7 @@ MainWindow::MainWindow(QWidget *parent) : wg, [wg]{ wg->setDecodeLabelPosition(DecodeLabelPosition::Bottom); }); } - setWindowTitle (program_title ()); + setWindowTitle (branded_program_title ()); qDebug() << "MAINWINDOW about to start soundInThread SIGNAL/SLOT connections"; connect(&soundInThread, SIGNAL(readyForFFT(int)), @@ -388,7 +392,7 @@ MainWindow::MainWindow(QWidget *parent) : m_NB=false; m_mode="JT65B"; m_mode65=2; - m_fs96000=true; + m_fs96000=1; m_udpPort=50004; m_adjustIQ=0; m_applyIQcal=0; @@ -411,11 +415,34 @@ MainWindow::MainWindow(QWidget *parent) : fftwf_import_wisdom_from_filename (QDir {m_dataDir}.absoluteFilePath ("map65_wisdom.dat").toLocal8Bit ()); readSettings(); //Restore user's setup params + + // Push mycall/mygrid/hiscall/hisgrid/neme to the Fortran side here, right + // after settings load, instead of waiting for the first + // MainWindow::decode() call to do it (decode() still pushes these on + // every cycle further down; this just makes the values available + // sooner). run_m65.f90 builds the deep65 CALL3.TXT candidate list eagerly + // before its decode loop starts (build_call3_candidates() in deep65.f90); + // without this, that eager build ran against Fortran's still-default/ + // blank mycall/hiscall, and decode0.f90's genuine mycall-changed check + // then forced a second, redundant rebuild on the first real decode. + { + QString mcall = (m_myCall + " ").mid(0, 12); + QString mgrid = (m_myGrid + " ").mid(0, 6); + QString hcall = (ui->dxCallEntry->text() + " ").mid(0, 12); + QString hgrid = (ui->dxGridEntry->text() + " ").mid(0, 6); + setMyCall(mcall); + setMyGrid(mgrid); + setHisCall(hcall); + setHisGrid(hgrid); + setNeme(0); + if (ui->actionOnly_EME_calls->isChecked()) setNeme(1); + } + PaError paerr=Pa_Initialize(); //Initialize Portaudio if(paerr!=paNoError) { msgBox("Unable to initialize PortAudio."); } - QFile quitFile(QDir {m_dataDir}.absoluteFilePath (".quit")); + QFile quitFile(m_appDir + "/.quit"); quitFile.remove(); m_pbdecoding_style1="QPushButton{background-color: cyan; \ @@ -460,8 +487,9 @@ MainWindow::MainWindow(QWidget *parent) : // Assign input device and start input thread soundInThread.setInputDevice(m_paInDevice); - if(m_fs96000) soundInThread.setRate(96000.0); - if(!m_fs96000) soundInThread.setRate(95238.1); + if(m_fs96000 == 1) soundInThread.setRate(96000.0); + else if(m_fs96000 ==0) soundInThread.setRate(95238.1); + else if(m_fs96000 ==2) soundInThread.setRate(192000.0); soundInThread.setBufSize(10*7056); soundInThread.setNetwork(m_network); soundInThread.setPort(m_udpPort); @@ -473,11 +501,11 @@ MainWindow::MainWindow(QWidget *parent) : soundOutThread.setOutputDevice(m_paOutDevice); m_monitoring=true; // Start with Monitoring ON + qDebug() << "m_monitoring set to" << m_monitoring << "at" << Q_FUNC_INFO; + soundInThread.setMonitoring(m_monitoring); m_diskData=false; m_wide_graph_window->setFcal(m_fCal); - if(m_fs96000) m_wide_graph_window->setFsample(96000); - if(!m_fs96000) m_wide_graph_window->setFsample(95238); m_wide_graph_window->m_mult570=m_mult570; m_wide_graph_window->m_mult570Tx=m_mult570Tx; m_wide_graph_window->m_cal570=m_cal570; @@ -509,7 +537,7 @@ MainWindow::MainWindow(QWidget *parent) : connect (m_wide_graph_window.get (), &WideGraph::f11f12, this, &MainWindow::bumpDF); QTimer::singleShot (0, this,[this]() { - m_messages_window = new Messages(m_settings_filename); + m_messages_window = new Messages(m_settings_filename, m_eclipseFile); m_messages_window->show(); on_actionMessages_triggered(); connect (m_messages_window, &Messages::click2OnCallsign, this, &MainWindow::doubleClickOnMessages); @@ -570,32 +598,33 @@ void MainWindow::startDecoder() { qDebug() << "MAINWINDOW calling run_m65_ "; - QByteArray runtimeDir = QDir::toNativeSeparators(m_dataDir).toLocal8Bit(); - set_wsjtx_dir_(runtimeDir.constData(), runtimeDir.size()); - QFutureWatcher* watcher_m65 = new QFutureWatcher(this); connect(watcher_m65, &QFutureWatcher::finished, this, &MainWindow::onRunM65Finished); watcher_m65->setFuture(QtConcurrent::run([=]() { - // Hook up shared stdout channel for Fortran - StdoutSharedRegion* region = - decoderCtx->stdoutChan->shared.getRegion(); - void* bufPtr = static_cast(region->buffer); - void* hdrPtr = static_cast(®ion->header); - int bufSize = static_cast(decoderCtx->stdoutChan->shared.getBufferSize()); - intptr_t eventH = reinterpret_cast(decoderCtx->stdoutChan->eventHandle); + qDebug() << "DECODE: starting run_m65_() with m_fs96000=" << m_fs96000; + + // Hook up shared stdout channel for Fortran + StdoutSharedRegion* region = + decoderCtx->stdoutChan->shared.getRegion(); - set_stdout_channel(bufPtr, hdrPtr, bufSize, eventH); + void* bufPtr = static_cast(region->buffer); + void* hdrPtr = static_cast(®ion->header); + int bufSize = static_cast(decoderCtx->stdoutChan->shared.getBufferSize()); + intptr_t eventH = reinterpret_cast(decoderCtx->stdoutChan->eventHandle); - // Now run the decoder - std::lock_guard lock(g_fortran_decode_mutex); - int xpol_flag = m_xpol ? 1 : 0; - int rate_flag = m_fs96000 ? 1 : 0; - run_m65_(&xpol_flag, &rate_flag); + set_stdout_channel(bufPtr, hdrPtr, bufSize, eventH); + // Now run the decoder + std::lock_guard lock(g_fortran_decode_mutex); + int xpol_flag = m_xpol ? 1 : 0; + run_m65_(&xpol_flag, &m_fs96000); + + qDebug() << "DECODE: run_m65_() returned"; })); + } void MainWindow::startSharedMemoryStdoutReader(DecoderContext* ctx) @@ -619,6 +648,17 @@ void MainWindow::startSharedMemoryStdoutReader(DecoderContext* ctx) std::uint32_t readIndex = h0.writeIndex; if (readIndex >= bufSize) readIndex = 0; + region->header.readIndex = readIndex; + + // TEMP diagnostic 2026-09-10: h0.writeIndex should always be 0 here -- + // StdoutSharedMemory's constructor unconditionally zeroes writeIndex/ + // readIndex right after mapping (see stdout_shared_memory.cpp), and + // that happens synchronously on the main thread before this reader + // thread is even spawned. If this ever logs a nonzero value, that + // assumption is wrong and this "start from current writeIndex" line + // is silently skipping over real data written before this point. + cppDbg(QString("stdout reader INIT readIndex=%1 (h0.writeIndex=%2) bufSize=%3") + .arg(readIndex).arg(h0.writeIndex).arg(bufSize)); std::string lineBuffer; @@ -652,16 +692,43 @@ void MainWindow::startSharedMemoryStdoutReader(DecoderContext* ctx) ); } } + + // Publish how far we've drained so the Fortran writer can + // compute free space and wait for room instead of wrapping + // around and overwriting data we haven't read yet. + region->header.readIndex = readIndex; } }); } void MainWindow::processStdOut(QString t) -{ - +{ + // qDebug().noquote() << QDateTime::currentMSecsSinceEpoch() << "PROCESS STDOUT:" << t; + // TEMP diagnostic 2026-09-10: confirms whether a decode line that made it + // into map65_rx.log (written Fortran-side, independent of this whole + // path) ever actually arrived here on the GUI thread. If a "!"-prefixed + // line is missing from this log around the time of a report-vs-rx.log + // mismatch, the loss is upstream (shared-memory ring buffer / reader + // thread); if it IS here but never appended to the Messages window, the + // loss is in handleControlLine/shouldDisplay below. + cppDbg(QString("processStdOut RECV \"%1\"").arg(t.trimmed())); + + if (m_decodeDisplayFilter.handleControlLine(t)) return; + + if (t.startsWith("")) { + bool validRequestId = false; + auto requestId = t.trimmed().section(' ', -1).toLongLong(&validRequestId); + if (validRequestId && is_current_decode_request(requestId)) { + m_decodeDisplayFilter.completeCycle(); + decodeBusy(false); + ui->DecodeButton->setStyleSheet(""); + } + return; + } + //qDebug() << "in processStdOut STDOUT:" << t; if (t.indexOf("") >= 0) { @@ -677,6 +744,17 @@ if (t.indexOf("") >= 0) { // --- / --- if (t.indexOf("") >= 0 || t.indexOf("") >= 0) { + if (t.indexOf("") >= 0) { + bool validRequestId = false; + auto requestId = t.trimmed().section(' ', -1).toLongLong(&validRequestId); + if (!validRequestId || !is_current_decode_request(requestId)) return; + } + + if (t.indexOf("") >= 0) + m_decodeDisplayFilter.completeEarlyPass(); + if (t.indexOf("") >= 0) + m_decodeDisplayFilter.completeCycle(); + if (m_widebandDecode) { if (m_messages_window) m_messages_window->setText(m_messagesText, m_bandmapText); @@ -687,16 +765,21 @@ if (t.indexOf("") >= 0) { if (t.indexOf("") >= 0) { ++m_decodeFinishedCount; - decodeBusy(false); + decodeBusy(false); // qDebug().noquote() << QDateTime::currentMSecsSinceEpoch() << "decodeBusy(false)"; if (m_diskData) onDiskDecodeFinished(); int ndecodes = t.mid(40,5).toInt(); - lab5->setText(QString::number(ndecodes)); - m_map65RxLog = 0; + lab8->setText(QString::number(ndecodes)); + m_map65RxLog = 0; + + // Only clear the button's "busy" styling on , not + // -- decodeBusy(false) is likewise gated on + // alone, and the final pass can legitimately take + // many seconds longer than the early pass, during which the button + // must keep showing busy while more decodes are still arriving. + ui->DecodeButton->setStyleSheet(""); } - - ui->DecodeButton->setStyleSheet(""); return; } @@ -710,11 +793,23 @@ if (t.indexOf("") >= 0) { #ifdef WIN32 m = 3; #endif - const QString decode_line = t.mid(1, n - m); - - // Suppress *second* narrowband GUI entry, but keep everything else - if (m_RxState != 2 || m_diskData) { - if (n >= 30 || t.indexOf("Best-fit") >= 0) + // The m=2/m=3 trim above assumes a normal decode line's fixed + // layout, whose last field is disposable padding/polarization -- + // Find Delta Phi's "!Best-fit Dphi = NNN deg" summary line ends on + // real content instead (the "g" of "deg"), so the same trim chops + // it to "...de". Just trim the line terminator for this one case. + const QString decode_line = (t.indexOf("Best-fit") >= 0) + ? t.mid(1).trimmed() + : t.mid(1, n - m); + + if (n >= 30 || t.indexOf("Best-fit") >= 0) { + bool const display = m_decodeDisplayFilter.shouldDisplay(decode_line); + // TEMP diagnostic 2026-09-10 -- see the matching note at the top + // of processStdOut(). If display=false here for a line that has + // no legitimate earlier-pass duplicate, the display filter itself + // (map65_decode_display_filter.cpp) is the culprit. + cppDbg(QString("shouldDisplay=%1 for \"%2\"").arg(display ? "true" : "false").arg(decode_line)); + if (display) ui->decodedTextBrowser->append(decode_line); } @@ -857,12 +952,13 @@ if (t.indexOf("") >= 0) { void MainWindow::onRunM65Finished() { // Do something when run_m65 finishes + // qDebug() << "DECODE: onRunM65Finished()"; } void MainWindow::onDiskDecodeFinished() { if (!m_path.isEmpty()) - setWindowTitle("MAP65 - " + QFileInfo(m_path).fileName()); + setWindowTitle("MAP65™ - " + QFileInfo(m_path).fileName()); if (m_loopall) on_actionOpen_next_in_directory_triggered(); @@ -901,7 +997,7 @@ void MainWindow::writeSettings() settings.setValue("Fcal",m_fCal); settings.setValue("Fadd",m_fAdd); settings.setValue("NetworkInput", m_network); - settings.setValue("FSam96000", m_fs96000); + settings.setValue("FSam96000", QString::number(m_pendingFs96000 >= 0 ? m_pendingFs96000 : m_fs96000)); settings.setValue("SoundInIndex",m_nDevIn); settings.setValue("paInDevice",m_paInDevice); settings.setValue("SoundOutIndex",m_nDevOut); @@ -958,12 +1054,13 @@ void MainWindow::writeSettings() void MainWindow::readSettings() { QSettings settings(m_settings_filename, QSettings::IniFormat); + auto const pskReporterSettings = readMap65PSKReporterSettings(settings); { SettingsGroup g {&settings, "MainWindow"}; restoreGeometry(settings.value("geometry").toByteArray()); ui->dxCallEntry->setText(settings.value("DXcall","").toString()); ui->dxGridEntry->setText(settings.value("DXgrid","").toString()); - m_path = settings.value("MRUdir", QDir {m_dataDir}.absoluteFilePath("save")).toString(); + m_path = settings.value("MRUdir", m_appDir + "/save").toString(); m_txFirst = settings.value("TxFirst",false).toBool(); ui->txFirstCheckBox->setChecked(m_txFirst); } @@ -984,6 +1081,19 @@ void MainWindow::readSettings() m_xpolx=settings.value("XpolX",false).toBool(); m_saveDir=settings.value("SaveDir",QDir {m_dataDir}.absoluteFilePath("save")).toString(); m_azelDir=settings.value("AzElDir",m_dataDir).toString(); + if (!settings.value("AzElDirMigratedToDataDir",false).toBool()) { + // One-time migration: earlier versions defaulted AzElDir to the + // application/bin directory instead of the user data directory, and + // that default got persisted the first time settings were saved. An + // exact-match check against the *current* m_appDir can't catch this, + // since the saved value may point at some older build's bin directory + // that no longer matches this run's m_appDir at all. So instead: force + // everyone onto the new default exactly once, unconditionally, then + // remember it's done so a deliberate later customization (via the + // Setup dialog's AzEl Directory field) is never overwritten again. + m_azelDir = m_dataDir; + settings.setValue("AzElDirMigratedToDataDir",true); + } m_editorCommand=settings.value("Editor","notepad").toString(); m_dxccPfx=settings.value("DXCCpfx","").toString(); m_timeout=settings.value("Timeout",20).toInt(); @@ -994,7 +1104,8 @@ void MainWindow::readSettings() m_fAdd=settings.value("Fadd",0).toDouble(); soundInThread.setFadd(m_fAdd); m_network = settings.value("NetworkInput",true).toBool(); - m_fs96000 = settings.value("FSam96000",true).toBool(); + m_fs96000 = readFSam96000(settings,1); + qDebug() << "In MainWindow::readSettings FSam96000 is read as:" << m_fs96000; m_nDevIn = settings.value("SoundInIndex", 0).toInt(); m_paInDevice = settings.value("paInDevice",0).toInt(); m_nDevOut = settings.value("SoundOutIndex", 0).toInt(); @@ -1060,10 +1171,11 @@ void MainWindow::readSettings() if(m_ndepth==0) ui->actionNo_Deep_Search->setChecked(true); if(m_ndepth==1) ui->actionNormal_Deep_Search->setChecked(true); if(m_ndepth==2) ui->actionAggressive_Deep_Search->setChecked(true); + if(m_ndepth==3) ui->actionFull_Deep_Search->setChecked(true); m_w3szUrl=settings.value("w3szUrl",true).toBool(); m_otherUrl=settings.value("otherUrl","").toString(); - m_spot_to_psk_reporter=settings.value("spotPSK",true).toBool(); - m_psk_reporter_tcpip=settings.value("PSKReporterTCPIP",false).toBool(); + m_spot_to_psk_reporter = pskReporterSettings.enabled; + m_psk_reporter_tcpip = pskReporterSettings.use_tcpip; m_tol=settings.value("FTol",500).toInt(); m_wide_graph_window->setTol(m_tol); @@ -1072,7 +1184,7 @@ void MainWindow::readSettings() if(m_tol==50) i=2; if(m_tol==100) i=3; if(m_tol==200) i=4; -// if(m_tol==500) i=5; + if(m_tol==500) i=5; if(m_tol==1000) i=6; ui->labTol1->setText(QString::number(m_tol)); ui->tolSpinBox->setValue(i); @@ -1099,13 +1211,20 @@ void MainWindow::readSettings() //-------------------------------------------------------------- dataSink() void MainWindow::dataSink(int k) { - static float s[NFFT],splot[NFFT]; + static float* s = nullptr; + static float* splot = nullptr; + if (!s) { + s = new float[active_nfft]; + splot = new float[active_nfft]; + } static int n=0; static int ihsym=0; static int nzap=0; static int ntrz=0; static int nkhz; - int nfsample= m_fs96000 ? 96000 : 95238; + int nfsample = 96000; + if (m_fs96000 == 0) nfsample = 95238; + else if(m_fs96000 == 2) nfsample = 192000; setNfsample(nfsample); int nxpol= m_xpol ? 1 : 0; setNxpol(nxpol); @@ -1115,7 +1234,8 @@ void MainWindow::dataSink(int k) static int nb; static int nadj=0; static float px=0.0,py=0.0; - static uchar lstrong[1024]; + constexpr int lstrongSize = 1024; + static uchar lstrong[lstrongSize]; static float rejectx; static float rejecty; static float slimit; @@ -1133,15 +1253,13 @@ void MainWindow::dataSink(int k) // Get x and y power, polarized spectrum, nkhz, and ihsym nb=0; if(m_NB) nb=1; - nfsample=96000; - if(!m_fs96000) nfsample=95238; nxpol=0; if(m_xpol) nxpol=1; nadj++; if(m_adjustIQ==0) nadj=0; - + symspec_(&k, &nxpol, &ndiskdat, &nb, &m_NBslider, &m_dPhi, - &nfsample, &m_adjustIQ, &m_applyIQcal, + &m_adjustIQ, &m_applyIQcal, &m_gainx, &m_gainy, &m_phasex, &m_phasey, &rejectx, &rejecty, &px, &py, s, &nkhz, &ihsym, &nzap, &slimit, lstrong); @@ -1176,8 +1294,9 @@ void MainWindow::dataSink(int k) } xSignalMeter->setValue(px); // Update the signal meters ySignalMeter->setValue(py); + if(m_monitoring || m_diskData) { - m_wide_graph_window->dataSink2(s,nkhz,ihsym,m_diskData,lstrong); + m_wide_graph_window->dataSink2(s,nkhz,ihsym,m_diskData,lstrong,lstrongSize); } if(nadj == 10) { @@ -1201,16 +1320,16 @@ void MainWindow::dataSink(int k) //Average over specified number of spectra if (n==0) { - for (int i=0; i=m_waterfallAvg) { - for (int i=0; isetFuture(*future2); } } - soundInThread.m_dataSinkBusy=false; + soundInThread.m_dataSinkBusy.store (false, std::memory_order_release); } /* Generate gaussian random float with mean=0 and std_dev=1 */ @@ -1298,7 +1417,7 @@ float* MainWindow::getDd() const void MainWindow::savetf2(QString fname, bool xpol) { - int npts=2*56*96000; + int npts=2*56*g_sampleRate; if(xpol) npts=2*npts; FILE* fp = fopen(fname.toUtf8().constData(), "wb"); @@ -1334,15 +1453,15 @@ void MainWindow::savetf2(QString fname, bool xpol) void MainWindow::getfile(QString fname, bool xpol, int dbDgrd) { - setDecoderReady(0); - int npts = 2 * 56 * 96000; + cancel_pending_decode_requests(); + int npts = 2 * 56 * g_sampleRate; if (xpol) npts = 2 * npts; // j indexes dd[], which has 4 channels per pair int j = 0; // Clear id[] properly - memset(id, 0, npts * sizeof(id[0])); + memset(id.data(), 0, npts * sizeof(id[0])); // Open file FILE* fp = fopen(fname.toUtf8().constData(), "rb"); @@ -1351,6 +1470,11 @@ void MainWindow::getfile(QString fname, bool xpol, int dbDgrd) return; } + qDebug().noquote() << QString("NEWFILE: nfsample=%1 nrate_active=%2") + .arg(active_nfft) + .arg(g_sampleRate); + + // Read fcenter double fcenter = 0.0; if (fread(&fcenter, sizeof(fcenter), 1, fp) != 1) { @@ -1360,16 +1484,20 @@ void MainWindow::getfile(QString fname, bool xpol, int dbDgrd) setFcenter(fcenter); - // Skip the 8-byte zero padding - uint64_t pad = 0; - if (fread(&pad, sizeof(pad), 1, fp) != 1) { - fclose(fp); - return; - } + qint64 sampleBytes = static_cast(npts) * static_cast(sizeof(id[0])); + qint64 expectedPaddedSize = static_cast(sizeof(fcenter)) + + static_cast(sizeof(uint64_t)) + sampleBytes; + if (QFileInfo {fname}.size() == expectedPaddedSize) { + uint64_t pad = 0; + if (fread(&pad, sizeof(pad), 1, fp) != 1) { + fclose(fp); + return; + } + } // Read raw samples - size_t nRead = fread(id, sizeof(id[0]), npts, fp); + size_t nRead = fread(id.data(), sizeof(id[0]), npts, fp); qDebug() << "fread read" << nRead << "samples, expected" << npts; fclose(fp); @@ -1424,10 +1552,25 @@ void MainWindow::showStatusMessage(const QString& statusMsg) void MainWindow::on_actionDeviceSetup_triggered() { DevSetup dlg(this); + + connect(&dlg, &DevSetup::sampleRateChanged, + this, &MainWindow::onSampleRateChanged); + dlg.initDlg(); if (dlg.exec() == QDialog::Accepted) { + if (dlg.m_restartRequired) + { + m_pendingFs96000 = dlg.m_pendingFs96000; + writeSettings(); + if (m_messages_window) { + m_messages_window->setPSKReportingEnabled(m_spot_to_psk_reporter); + } + return; + } + m_pendingFs96000 = -1; + // // Apply runtime effects for SoundIn // @@ -1439,7 +1582,9 @@ void MainWindow::on_actionDeviceSetup_triggered() soundInThread.setInputDevice(m_paInDevice); soundInThread.setNetwork(m_network); soundInThread.setFadd(m_fAdd); - soundInThread.setRate(m_fs96000 ? 96000.0 : 95238.1); + if (m_fs96000 == 1) soundInThread.setRate(96000.0); + else if (m_fs96000 == 0) soundInThread.setRate(95238.1); + else if (m_fs96000 == 2) soundInThread.setRate(192000.0); soundInThread.setSwapIQ(m_IQswap); soundInThread.setScale(m_dB); soundInThread.setPort(m_udpPort); @@ -1483,15 +1628,33 @@ void MainWindow::on_actionDeviceSetup_triggered() // Save to disk // writeSettings(); + if (m_messages_window) { + m_messages_window->setPSKReportingEnabled(m_spot_to_psk_reporter); + } } } +void MainWindow::onSampleRateChanged(int newRate) +{ + if (!m_wide_graph_window) + return; + + if (newRate == 96000 || newRate == 95238) + m_wide_graph_window->setFreqSpanLimits(60, 90); + else + m_wide_graph_window->setFreqSpanLimits(60, 190); + + m_wide_graph_window->updateSpanFromSpinbox(); +} + void MainWindow::on_monitorButton_clicked() //Monitor { m_monitoring=true; + qDebug() << "m_monitoring set to" << m_monitoring << "at" << Q_FUNC_INFO; soundInThread.setMonitoring(true); m_diskData=false; + } void MainWindow::on_actionLinrad_triggered() //Linrad palette { @@ -1662,6 +1825,12 @@ void MainWindow::createStatusBar() //createStatusBar lab7->setMinimumSize(QSize(50,10)); lab7->setFrameStyle(QFrame::Panel | QFrame::Sunken); statusBar()->addWidget(lab7); + + lab8 = new QLabel("QSOs: 0"); + lab8->setAlignment(Qt::AlignHCenter); + lab8->setMinimumSize(QSize(50,10)); + lab8->setFrameStyle(QFrame::Panel | QFrame::Sunken); + statusBar()->addWidget(lab8); } void MainWindow::on_tolSpinBox_valueChanged(int i) //tolSpinBox @@ -1683,7 +1852,7 @@ void MainWindow::closeEvent(QCloseEvent *e) if (m_gui_timer) m_gui_timer->stop(); m_wide_graph_window->saveSettings(); - QFile quitFile(QDir {m_dataDir}.absoluteFilePath (".quit")); + QFile quitFile(m_appDir + "/.quit"); (void)quitFile.open(QFileDevice::ReadWrite); setQuitID(quitFile.handle()); @@ -1713,6 +1882,7 @@ void MainWindow::closeEvent(QCloseEvent *e) void MainWindow::on_stopButton_clicked() //stopButton { m_monitoring=false; + qDebug() << "m_monitoring set to" << m_monitoring << "at" << Q_FUNC_INFO; soundInThread.setMonitoring(m_monitoring); m_loopall=false; } @@ -1757,6 +1927,16 @@ void MainWindow::on_actionQ65_Sensitivity_in_MAP65_3_0_triggered() QDesktopServices::openUrl (QUrl {"https://wsjt.sourceforge.io/Q65_Sensitivity_in_MAP65.pdf"}); } +void MainWindow::on_actionCopyright_Notice_triggered() +{ + MessageBox::warning_message (this, copyright_notice_text ()); +} + +void MainWindow::on_actionTrademark_Policy_triggered() +{ + QDesktopServices::openUrl (QUrl {"https://wsjtx.github.io/wsjtx/trademark.html"}); +} + void MainWindow::on_actionAstro_Data_triggered() //Display Astro { if (m_astro_window ) m_astro_window->show(); @@ -1780,6 +1960,8 @@ void MainWindow::on_actionMessages_triggered() //Display Messages void MainWindow::on_actionOpen_triggered() //Open File { m_monitoring=false; + qDebug() << "m_monitoring set to" << m_monitoring << "at" << Q_FUNC_INFO; + soundInThread.setMonitoring(m_monitoring); // Wipe waterfall callsign overlay so stale labels from the previous // file (or live capture) don't linger over the new decode. @@ -1851,7 +2033,7 @@ void MainWindow::on_actionOpen_next_in_directory_triggered() //Open Next *future1 = QtConcurrent::run([this](QString fname, bool xpol, int dbDgrd) { this->getfile(fname, xpol, dbDgrd); }, fname, m_xpol, dbDgrd); - // qDebug() << "MainWindow::on_actionOpen_next_in_directory_triggered Reading wav file: " << m_path; + qDebug() << "MainWindow::on_actionOpen_next_in_directory_triggered Reading wav file: " << m_path; watcher1->setFuture(*future1); return; } @@ -1874,8 +2056,9 @@ void MainWindow::diskDat() //diskDat() setFcenter(m_wide_graph_window->m_dForceCenterFreq); } - if(m_fs96000) hsym=2048.0*96000.0/11025.0; //Samples per JT65 half-symbol - if(!m_fs96000) hsym=2048.0*95238.1/11025.0; + hsym=2048.0*96000.0/11025.0; //Samples per JT65 half-symbol if SR = 96000 + if(m_fs96000 == 0) hsym=2048.0*95238.1/11025.0; // Samples per JT65 half-symbol if SR = 95238.1 + else if(m_fs96000 == 2) hsym=2048.0*192000.0/11025.0; //Samples per JT65 half-symbol if SR = 192000 for(int i=0; i<304; i++) { // Do the half-symbol FFTs int k = i*hsym + 2048.5; dataSink(k); @@ -1915,6 +2098,14 @@ void MainWindow::on_actionErase_Band_Map_and_Messages_triggered() { m_band_map_window->setText(""); m_messages_window->setText("",""); + // m_messagesText/m_bandmapText accumulate across decode cycles and are + // only reset when a "!" line arrives (processStdOut). Without clearing + // them here too, the next / redisplay + // (or a cycle with no fresh decodes) repaints the stale pre-erase text + // right back into the windows. + m_messagesText.clear(); + m_bandmapText.clear(); + m_widebandDecode = false; m_map65RxLog |= 4; } @@ -1954,6 +2145,11 @@ void MainWindow::on_actionAggressive_Deep_Search_triggered() //Aggressive DS m_ndepth=2; } +void MainWindow::on_actionFull_Deep_Search_triggered() //Full DS +{ + m_ndepth=3; +} + void MainWindow::on_actionNone_triggered() //Save None { m_saveAll=false; @@ -2005,6 +2201,7 @@ void MainWindow::freezeDecode(int n) //freezeDecode() if(!m_decoderBusy) { setNagain(1); setNewdat(0); + set_manual_decode_flag(1); decode(); } } @@ -2035,7 +2232,6 @@ void MainWindow::decode() //decode() if(m_diskData) { if(m_myGrid.trimmed().length()>=6) { setNdiskdat(1); - setNagain(0); int i0=m_path.indexOf(".tf2"); if(i0<0) i0=m_path.indexOf(".iq"); if(i0>0) { @@ -2087,8 +2283,10 @@ void MainWindow::decode() //decode() if(getNutc() < m_nutc0) m_map65RxLog |= 1; //Date and Time to map65_rx.log m_nutc0=getNutc(); setMap65RxLog(m_map65RxLog); - setNfsample(96000); - if(!m_fs96000) setNfsample(95238); + if(m_fs96000 == 1) setNfsample(96000); + if(m_fs96000 == 0) setNfsample(95238); + else if(m_fs96000 == 2) setNfsample(192000); + // qDebug() << "MainWindow::decode setting nfsample to " << m_fs96000; setNxpol(0); if(m_xpol) setNxpol(1); setNmode(10*m_modeQ65 + m_modeJT65); @@ -2110,9 +2308,8 @@ QString hgrid = (ui->dxGridEntry->text() + " ").mid(0, 6); setJunk1(1234); setJunk2(5678); - setNagain(0); //added 12-30-25 to agree with legacy if (!m_diskData) setNdiskdat(0); //added 12-30-25 to agree with legacy - setDecoderReady(1); + publish_decode_request(); m_map65RxLog=0; m_call3Modified=false; // qDebug() << QDateTime::currentMSecsSinceEpoch() << "finished MainWindow::decode()"; @@ -2240,6 +2437,8 @@ void MainWindow::guiUpdate() if(bTune0 and !bTune) { btxok=false; m_monitoring=bMonitoring0; + // qDebug() << "m_monitoring set to" << m_monitoring << "at" << Q_FUNC_INFO; + soundInThread.setMonitoring(m_monitoring); } if(bTune and !bTune0) bMonitoring0=m_monitoring; @@ -2292,7 +2491,7 @@ void MainWindow::guiUpdate() int mode65=m_mode65; int ntxFreq=1000; double samfac=1.0; - qDebug() << mode65 << samfac; + // qDebug() << mode65 << samfac; if(m_modeTx=="JT65") { gen65_(message,&mode65,&samfac,&nsendingsh,msgsent,iwave, &nwave,len1,len1); @@ -2330,6 +2529,8 @@ void MainWindow::guiUpdate() xSignalMeter->setValue(0); ySignalMeter->setValue(0); m_monitoring=false; + // qDebug() << "m_monitoring set to" << m_monitoring << "at" << Q_FUNC_INFO; + soundInThread.setMonitoring(false); btxok=true; m_transmitting=true; @@ -2369,6 +2570,8 @@ void MainWindow::guiUpdate() m_wide_graph_window->enableSetRxHardware(true); if(m_auto) { m_monitoring=true; + // qDebug() << "m_monitoring set to" << m_monitoring << "at" << Q_FUNC_INFO; + soundInThread.setMonitoring(m_monitoring); } } @@ -2653,14 +2856,7 @@ void MainWindow::genStdMsgs(QString rpt) //genStdMsgs() QString MainWindow::call3Path() const { - QString writablePath = QDir {m_dataDir}.absoluteFilePath("CALL3.TXT"); - if (!QFile::exists(writablePath)) { - QString bundledPath = QDir {m_appDir}.absoluteFilePath("CALL3.TXT"); - if (QFile::exists(bundledPath)) { - QFile::copy(bundledPath, writablePath); - } - } - return writablePath; + return ensureMap65RuntimeFile(m_appDir, m_installedDataDir, m_dataDir, "CALL3.TXT"); } void MainWindow::lookup() //lookup() @@ -3075,8 +3271,7 @@ void MainWindow::on_actionFUNcube_Dongle_triggered() void MainWindow::on_actionEdit_wsjt_log_triggered() { - proc_editor.start (QDir::toNativeSeparators (m_editorCommand), - {QDir::toNativeSeparators (QDir {m_dataDir}.absoluteFilePath ("wsjt.log")), }); + proc_editor.start (QDir::toNativeSeparators (m_editorCommand), {QDir::toNativeSeparators (m_appDir + "/wsjt.log"), }); } void MainWindow::on_actionTx_Tune_triggered() @@ -3121,7 +3316,7 @@ void MainWindow::read_log() // Update "m_worked" by reading wsjtx.log m_worked.clear(); //Start from scratch QFile f("wsjtx.log"); -// qDebug() << "MainWindow::read_log File open result:" << f.open(QFileDevice::ReadOnly); + qDebug() << "MainWindow::read_log File open result:" << f.open(QFileDevice::ReadOnly); if(f.isOpen()) { QTextStream in(&f); QString line,callsign; diff --git a/map65/mainwindow.h b/map65/mainwindow.h index d60e1239..0262e0ac 100644 --- a/map65/mainwindow.h +++ b/map65/mainwindow.h @@ -12,11 +12,11 @@ #include "soundout.h" #include "signalmeter.h" #include "commons.h" +#include "map65_decode_display_filter.h" #include "sleep.h" #include #include -#define NFFT 32768 #define NSMAX 5760000 @@ -53,13 +53,16 @@ public: float* getDd() const; std::thread stdoutReaderThread; std::atomic stdoutReaderStop {false}; + void writeSettings(); bool m_network; int m_pttPortNumber = 0; QString m_pttPath; QString m_appDir; + QString m_installedDataDir; QString m_dataDir; + QString m_eclipseFile; QString m_settings_filename; qint32 m_nDevIn; qint32 m_nDevOut; @@ -84,7 +87,8 @@ public: bool m_xpol; bool m_xpolx; - bool m_fs96000; + int m_fs96000; + int m_pendingFs96000 {-1}; bool m_IQswap; bool m_initIQplus; bool m_bIQxt; @@ -139,6 +143,8 @@ private slots: void on_actionQSG_Q65_triggered(); void on_actionQSG_MAP65_v3_triggered(); void on_actionQ65_Sensitivity_in_MAP65_3_0_triggered(); + void on_actionCopyright_Notice_triggered(); + void on_actionTrademark_Policy_triggered(); void on_actionWide_Waterfall_triggered(); void on_actionBand_Map_triggered(); void on_actionMessages_triggered(); @@ -154,6 +160,7 @@ private slots: void on_actionNo_Deep_Search_triggered(); void on_actionNormal_Deep_Search_triggered(); void on_actionAggressive_Deep_Search_triggered(); + void on_actionFull_Deep_Search_triggered(); void on_actionNone_triggered(); void on_actionSave_all_triggered(); void on_actionKeyboard_shortcuts_triggered(); @@ -202,12 +209,13 @@ private slots: void on_actionQ65D_triggered(); void on_actionQ65E_triggered(); void on_pbTxMode_clicked(); + void onSampleRateChanged(int newRate); private: + QString call3Path() const; virtual void keyPressEvent (QKeyEvent *) override; virtual bool eventFilter (QObject *, QEvent *) override; virtual void closeEvent (QCloseEvent *) override; - QString call3Path() const; QScopedPointer m_astro_window; QScopedPointer m_band_map_window; @@ -263,6 +271,7 @@ private: QString m_pbAutoOn_style; QString m_messagesText; QString m_bandmapText; + Map65DecodeDisplayFilter m_decodeDisplayFilter; QString m_hisCall; QString m_hisGrid; QString m_palette; @@ -290,6 +299,7 @@ private: QLabel* lab5; QLabel* lab6; QLabel* lab7; + QLabel* lab8; QMessageBox msgBox0; @@ -323,7 +333,6 @@ private: //---------------------------------------------------- private functions void readSettings(); - void writeSettings(); void createStatusBar(); void updateStatusBar(); void msgBox(QString t); @@ -343,6 +352,10 @@ private: void createMessagesWindow(); }; +extern int g_sampleRate; +extern int active_nfft; +extern std::vector id; + extern void getDev(int* numDevices,char hostAPI_DeviceName[][50], int minChan[], int maxChan[], int minSpeed[], int maxSpeed[]); @@ -350,7 +363,7 @@ extern void getDev(int* numDevices,char hostAPI_DeviceName[][50], extern "C" { //----------------------------------------------------- C and Fortran routines void symspec_(int* k, int* nxpol, int* ndiskdat, int* nb, - int* m_NBslider, int* idphi, int* nfsample, + int* m_NBslider, int* idphi, int* iqadjust, int* iqapply, float* gainx, float* gainy, float* phasex, float* phasey, float* rejectx, float* rejecty, float* px, float* py, float s[], int* nkhz, int* nhsym, diff --git a/map65/mainwindow.ui b/map65/mainwindow.ui index 1f6b27f6..fb09f4e1 100644 --- a/map65/mainwindow.ui +++ b/map65/mainwindow.ui @@ -1382,6 +1382,7 @@ p, li { white-space: pre-wrap; } + @@ -1403,6 +1404,10 @@ p, li { white-space: pre-wrap; } + + + + @@ -1453,12 +1458,22 @@ p, li { white-space: pre-wrap; }
- About MAP65 + About MAP65™ Ctrl+F1 + + + Copyright notice + + + + + Trademark policy + + Astro Data @@ -1696,6 +1711,14 @@ p, li { white-space: pre-wrap; } Aggressive Deep Search + + + true + + + Full Deep Search + + true @@ -1972,7 +1995,7 @@ p, li { white-space: pre-wrap; } DisplayText QTextBrowser -
widgets/displaytext.h
+
displaytext.h
diff --git a/map65/map65.pro b/map65/map65.pro deleted file mode 100644 index b71140d6..00000000 --- a/map65/map65.pro +++ /dev/null @@ -1,73 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2011-07-07T08:39:24 -# -#------------------------------------------------- - -QT += core gui network -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets -CONFIG += thread -#CONFIG += console - -TARGET = map65 -VERSION = 2.5.0 -TEMPLATE = app -DEFINES = QT5 -DESTDIR = /MAP65_2.9 - -F90 = gfortran -gfortran.output = ${QMAKE_FILE_BASE}.o -gfortran.commands = $$F90 -c -O2 -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} -gfortran.input = F90_SOURCES -QMAKE_EXTRA_COMPILERS += gfortran - -win32 { -DEFINES = WIN32 -} - -unix { -DEFINES = UNIX -} - -SOURCES += main.cpp mainwindow.cpp plotter.cpp about.cpp \ - soundin.cpp soundout.cpp devsetup.cpp \ - widegraph.cpp getfile.cpp messages.cpp bandmap.cpp \ - astro.cpp displaytext.cpp getdev.cpp \ - txtune.cpp meterwidget.cpp signalmeter.cpp \ - cqdatasender.cpp liveCQSender.cpp Radio.cpp \ - ../Network/PSKReporter.cpp ../Network/PSKReporterIPFIX.cpp - -win32 { -SOURCES += set570.cpp -} - -HEADERS += mainwindow.h plotter.h soundin.h soundout.h \ - about.h devsetup.h widegraph.h getfile.h messages.h \ - bandmap.h commons.h sleep.h astro.h displaytext.h \ - txtune.h meterwidget.h signalmeter.h cqdatasender.h \ - liveCQSender.hpp Radio.hpp ../Network/PSKReporter.hpp ../Network/PSKReporterIPFIX.hpp - -FORMS += mainwindow.ui about.ui devsetup.ui widegraph.ui \ - messages.ui bandmap.ui astro.ui \ - txtune.ui - -RC_FILE = map65.rc - -unix { -LIBS += ../map65/libm65/libm65.a -LIBS += -lfftw3f -lportaudio -lgfortran -#LIBS +- -lusb -} - -win32 { -LIBS += ../map65/libm65/libm65.a -LIBS += ../map65/libfftw3f_win.a -LIBS += ../map65/palir-02.dll -LIBS += libwsock32 -#LIBS += C:/MinGW/lib/libf95.a -LIBS += -lgfortran -#LIBS += -lusb -LIBS += ../map65/libusb.a -#LIBS += -lQt5Concurrent -#LIBS += c:\JTSDK-QT\Qt5\Tools\mingw48_32\i686-w64-mingw32\lib\libmingwex.a -} diff --git a/map65/map65_decode_display_filter.cpp b/map65/map65_decode_display_filter.cpp new file mode 100644 index 00000000..107001d4 --- /dev/null +++ b/map65/map65_decode_display_filter.cpp @@ -0,0 +1,95 @@ +#include "map65_decode_display_filter.h" + +#include + +namespace +{ +QString const passMarker {""}; +constexpr int duplicateFrequencyToleranceHz = 20; +} + +bool Map65DecodeDisplayFilter::handleControlLine(QString const& line) +{ + if (!line.startsWith(passMarker)) return false; + + QString const pass = line.mid(passMarker.size()).trimmed().toLower(); + if (pass == "early") + { + pass_ = Pass::Early; + earlyDecodes_.clear(); + } + else if (pass == "final") pass_ = Pass::Final; + else if (pass == "manual") pass_ = Pass::Manual; + else if (pass == "disk") pass_ = Pass::Disk; + else pass_ = Pass::Unknown; + + return true; +} + +bool Map65DecodeDisplayFilter::shouldDisplay(QString const& decodeLine) +{ + if (pass_ == Pass::Manual || pass_ == Pass::Disk || pass_ == Pass::Unknown) + return true; + + Identity identity; + if (!parseIdentity(decodeLine, &identity)) return true; + + for (auto const& earlyDecode : earlyDecodes_) + { + if (pass_ == Pass::Final && matches(earlyDecode, identity)) return false; + } + + if (pass_ == Pass::Early) earlyDecodes_.append(identity); + return true; +} + +void Map65DecodeDisplayFilter::completeEarlyPass() +{ + pass_ = Pass::Unknown; +} + +void Map65DecodeDisplayFilter::completeCycle() +{ + pass_ = Pass::Unknown; + earlyDecodes_.clear(); +} + +bool Map65DecodeDisplayFilter::parseIdentity(QString const& input, Identity * identity) +{ + QString line = input; + if (line.startsWith('!')) line.remove(0, 1); + if (line.size() < 53) return false; + + bool khzOk = false; + bool dfOk = false; + bool utcOk = false; + int const khz = line.mid(0, 3).trimmed().toInt(&khzOk); + int const df = line.mid(3, 5).trimmed().toInt(&dfOk); + int const utc = line.mid(12, 6).trimmed().toInt(&utcOk); + int const hour = utc / 100; + int const minute = utc % 100; + if (!khzOk || !dfOk || !utcOk || hour < 0 || hour > 23 + || minute < 0 || minute > 59) + return false; + + QString const separator = line.mid(28, 3); + if (separator != " : " && separator != " # ") return false; + bool const q65 = separator == " : "; + int const messageLength = q65 ? 28 : 22; + if (line.size() < 31 + messageLength) return false; + QString const message = line.mid(31, messageLength).simplified().toUpper(); + if (message.isEmpty()) return false; + + identity->q65 = q65; + identity->utc = utc; + identity->frequencyHz = 1000 * khz + df; + identity->message = message; + return true; +} + +bool Map65DecodeDisplayFilter::matches(Identity const& left, Identity const& right) +{ + return left.q65 == right.q65 && left.utc == right.utc + && left.message == right.message + && qAbs(left.frequencyHz - right.frequencyHz) <= duplicateFrequencyToleranceHz; +} diff --git a/map65/map65_decode_display_filter.h b/map65/map65_decode_display_filter.h new file mode 100644 index 00000000..72130a07 --- /dev/null +++ b/map65/map65_decode_display_filter.h @@ -0,0 +1,40 @@ +#ifndef MAP65_DECODE_DISPLAY_FILTER_H +#define MAP65_DECODE_DISPLAY_FILTER_H + +#include +#include + +class Map65DecodeDisplayFilter +{ +public: + bool handleControlLine(QString const& line); + bool shouldDisplay(QString const& decodeLine); + void completeEarlyPass(); + void completeCycle(); + +private: + enum class Pass + { + Unknown, + Early, + Final, + Manual, + Disk + }; + + struct Identity + { + bool q65; + int utc; + int frequencyHz; + QString message; + }; + + static bool parseIdentity(QString const& line, Identity * identity); + static bool matches(Identity const& left, Identity const& right); + + Pass pass_ {Pass::Unknown}; + QVector earlyDecodes_; +}; + +#endif diff --git a/map65/map65_decode_lifecycle.txt b/map65/map65_decode_lifecycle.txt index d3aaba57..95296fbb 100644 --- a/map65/map65_decode_lifecycle.txt +++ b/map65/map65_decode_lifecycle.txt @@ -1,385 +1,68 @@ -/* -=============================================================================== - MAP65 DECODE LIFECYCLE — MODERNIZED AND LEGACY‑ACCURATE -=============================================================================== - - This document describes the sequencing rules for disk and live-input decoding - in modern MAP65. The goal is deterministic, race‑free behavior that matches - the legacy MAP65 decode pipeline while eliminating timing-dependent behavior. - -------------------------------------------------------------------------------- - OVERVIEW -------------------------------------------------------------------------------- - A decode cycle consists of: - 1. Preparing input data (disk or live) - 2. Preparing decode parameters (C++ decode()) - 3. Triggering the Fortran decoder loop (newdat + decoder_ready) - 4. Receiving from stdout - 5. Detecting decoder silence (idle timer) - 6. Clearing busy and optionally auto‑advancing - - The Fortran decoder loop runs ONLY when: - decoder_ready == 1 AND newdat == 1 - -------------------------------------------------------------------------------- - STATE FLAGS -------------------------------------------------------------------------------- - newdat: - - Set to 1 by the caller (disk or live) BEFORE calling decode(). - - Indicates that new data is ready for decoding. - - Cleared internally by the decoder after each pass. - - Only one pass per file/minute is expected (legacy behavior). - - decoder_ready: - - Set to 0 BEFORE calling decode() (disk or live). - - Set to 1 at the END of decode() after all parameters are prepared. - - Prevents the decoder loop from running early with stale parameters. - - decoderBusy: - - Set to true ONLY inside decode(). - - Set to false ONLY in the idle timer after + silence. - - Reflects actual decoder activity, not file loading. - -------------------------------------------------------------------------------- - DISK INPUT SEQUENCE -------------------------------------------------------------------------------- - getfile(): - setDecoderReady(0); // block decoder loop - load file data - setNewdat(1); // legacy behavior - decode(); // prepares parameters, sets decoder_ready=1 - -------------------------------------------------------------------------------- - LIVE INPUT SEQUENCE -------------------------------------------------------------------------------- - dataSink(): - when a full 60s block is ready: - setDecoderReady(0); // block decoder loop - setNewdat(1); // legacy behavior - decode(); // prepares parameters, sets decoder_ready=1 - -------------------------------------------------------------------------------- - DECODE() SEQUENCE -------------------------------------------------------------------------------- - decode(): - decodeBusy(true); // decoder is now officially active - prepare all decode parameters (nfa, nfb, nfshift, mode, etc.) - setDecoderReady(1); // allow decoder loop to run - // newdat was already set by caller - -------------------------------------------------------------------------------- - FORTRAN LOOP -------------------------------------------------------------------------------- - do while (.not. stop_m65) - if (decoder_ready .and. newdat .ne. 0) call m65a() - call sleep_msec(50) - end do - -------------------------------------------------------------------------------- - STDOUT PROCESSING -------------------------------------------------------------------------------- - processStdOut(): - On "": - m_decodeFinishedCount++ - // no second pass expected (legacy behavior) - -------------------------------------------------------------------------------- - IDLE TIMER -------------------------------------------------------------------------------- - Idle timer fires when decoder stdout is silent: - if (m_decodeFinishedCount == 0) - ignore (decoder not finished yet) - - decodeBusy(false); // decoder is done - - if (m_loopall && m_diskData) - on_actionOpen_next_in_directory_triggered(); - -------------------------------------------------------------------------------- - NOTES -------------------------------------------------------------------------------- - - Only ONE decode pass per file/minute is expected (legacy MAP65 behavior). - - No second-pass logic is required. - - No failsafe timer is required. - - This lifecycle eliminates all timing races present in earlier versions. -=============================================================================== -*/ -/* -=============================================================================== - LIVE MODE VS DISK MODE — BUSY‑CLEARING RULES -=============================================================================== - - Modern MAP65 supports two fundamentally different input modes: - - 1. Disk mode (file-based decoding) - 2. Live mode (real-time network or audio decoding) - - These modes differ in how decoder stdout behaves, and therefore require - different rules for clearing the decoderBusy flag. - -------------------------------------------------------------------------------- - DISK MODE (FILE INPUT) -------------------------------------------------------------------------------- - - Decoder stdout is finite. - - After , the decoder emits a tail of late decodes, - bandmap lines, and summary lines. - - Once this tail completes, stdout becomes silent. - - The idle timer detects this silence (~2500 ms) and clears busy. - - Correct behavior in disk mode: - Wait for - THEN wait for ~2500 ms of silence - THEN clear busy - THEN auto-advance (if loopall is enabled) - - This reproduces legacy MAP65’s blocking behavior exactly. - -------------------------------------------------------------------------------- - LIVE MODE (REAL-TIME INPUT) -------------------------------------------------------------------------------- - In live mode, the decoder *never* becomes silent: - - - The decoder emits continuous tracking lines (e.g., "@1296.xxx") every - 120 ms throughout the entire minute. - - These lines continue even after . - - Therefore, the idle timer will NEVER observe a 2500 ms silent period. - - If busy were cleared only by the idle timer, it would remain stuck TRUE - forever, causing the GUI to remain greyed out. - - To match legacy behavior and maintain correct GUI state, MAP65 must clear - busy *immediately* upon receiving in live mode. - - Correct behavior in live mode: - On : - clear busy immediately - (do NOT wait for silence) - (do NOT auto-advance) - - This mirrors legacy MAP65, where the blocking read returned immediately - after during live decoding. - -------------------------------------------------------------------------------- - SUMMARY OF BUSY‑CLEARING RULES -------------------------------------------------------------------------------- - Disk mode: - → wait for silence → busy = false → auto-advance - - Live mode: - → busy = false immediately (no idle timer) - -------------------------------------------------------------------------------- - RATIONALE -------------------------------------------------------------------------------- - - Disk mode produces finite stdout; silence detection is meaningful. - - Live mode produces continuous stdout; silence detection is impossible. - - Legacy MAP65 implicitly handled both cases correctly via blocking I/O. - - Modern MAP65 must explicitly differentiate the two modes to reproduce - legacy behavior and avoid GUI lockout. - -=============================================================================== -*/ - -/* -=============================================================================== - WHY LEGACY MAP65 DID NOT NEED AN IDLE TIMER -=============================================================================== - - Legacy MAP65 used a synchronous, blocking I/O model for running the decoder. - This architecture *implicitly* waited for the decoder to finish producing ALL - stdout before advancing to the next file. No timers, heuristics, or silence - detection were required. - -------------------------------------------------------------------------------- - LEGACY ARCHITECTURE (SYNCHRONOUS / BLOCKING) -------------------------------------------------------------------------------- - - The decoder was launched as a child process. - - MAP65 read stdout using a blocking read loop. - - The read call did not return until the decoder flushed all output. - - The program could not proceed until stdout was fully drained. - - was just a marker, not a signal to advance. - - Late decodes, bandmap lines, and summary lines always arrived before the - blocking read returned. - - Result: - Legacy MAP65 *automatically* waited long enough to capture all decodes, - including those emitted 1–3 seconds after . - -------------------------------------------------------------------------------- - MODERN ARCHITECTURE (ASYNCHRONOUS / EVENT-DRIVEN) -------------------------------------------------------------------------------- - Modern MAP65 uses Qt's QProcess, which delivers decoder stdout asynchronously: - - - stdout arrives in bursts via readyReadStandardOutput() signals - - the GUI thread continues running while the decoder works - - does NOT mean the decoder is done talking - - late decodes and summary lines may arrive up to ~2500 ms later - - the decoder does not close stdout between passes or files - - Because the program is no longer blocked waiting for stdout, MAP65 must - explicitly detect when the decoder has gone silent. - -------------------------------------------------------------------------------- - WHY AN IDLE TIMER IS REQUIRED -------------------------------------------------------------------------------- - In the asynchronous model, MAP65 must decide when the decoder is "done." - The correct criterion is: - - has been seen - AND - no stdout has arrived for ~2500 ms - - This silence window reproduces the behavior of legacy MAP65's blocking read: - it ensures that all late decodes, bandmap lines, and summary lines have been - received before auto-advancing. - -------------------------------------------------------------------------------- - SUMMARY -------------------------------------------------------------------------------- - Legacy MAP65: - - Blocking I/O naturally waited for all decoder output. - - No idle timer needed. - - Modern MAP65: - - Asynchronous I/O requires explicit silence detection. - - A 2500 ms idle window faithfully reproduces legacy behavior. - -=============================================================================== -*/ -/* -=============================================================================== - FILE INPUT MODE DECODER OUTPUT TIMING DIAGRAM -=============================================================================== - - This diagram illustrates the typical sequence of decoder stdout during a - single decode pass when using file input. It shows why legacy MAP65 naturally - waited for all output, and why modern MAP65 must explicitly wait for a period - of silence. - - Time flows left → right. - -------------------------------------------------------------------------------- - LEGEND -------------------------------------------------------------------------------- - |====| Decoder producing stdout - "" marker - .... Silence (no stdout) - [2500 ms silence] Idle timer threshold in modern MAP65 - -------------------------------------------------------------------------------- - TYPICAL DECODER STDOUT TIMELINE -------------------------------------------------------------------------------- - - QuickDecode FullDecode Post-Processing - (fast) (heavy FFT) (late decodes, bandmap, summary) - |====================|====================|====================| - ^ ^ ^ ^ - | | | | - Start Late output Final flush - continues then silence - - 0 ms ~800–1200 ms ~1200–2200 ms ~2200–2500+ ms - ---------------------------------------------------------------------------→ time - - After , the decoder may continue emitting: - - late decodes - - bandmap lines - - candidate summaries - - sync statistics - - final housekeeping output - - This tail can last up to ~2500 ms depending on CPU speed and decode load. - -------------------------------------------------------------------------------- - LEGACY MAP65 BEHAVIOR (BLOCKING I/O) -------------------------------------------------------------------------------- - Legacy MAP65 used a blocking read loop: - - It did not return until ALL stdout was flushed. - - It implicitly waited for the entire tail of output. - - It always captured all decodes. - - No idle timer was needed. - -------------------------------------------------------------------------------- - MODERN MAP65 BEHAVIOR (ASYNCHRONOUS I/O) -------------------------------------------------------------------------------- - Modern MAP65 receives stdout via Qt signals: - - does NOT mean the decoder is done. - - Late output arrives asynchronously after . - - The GUI thread continues running. - - MAP65 must explicitly detect when the decoder has gone silent. - - Correct behavior: - - Wait for - - THEN wait for ~2500 ms of silence - - THEN auto-advance - - This reproduces legacy behavior exactly. - -=============================================================================== -*/ -/* -=============================================================================== - LIVE MODE TIMING DIAGRAM (REAL‑TIME NETWORK / AUDIO INPUT) -=============================================================================== - - This diagram illustrates why live-mode decoding cannot rely on the idle timer - to detect decoder completion. Unlike disk-mode decoding, live-mode produces - continuous stdout throughout the entire minute, even AFTER . - - Time flows left → right. - -------------------------------------------------------------------------------- - LEGEND -------------------------------------------------------------------------------- - |====| Decoder producing stdout (continuous live tracking output) - "" marker for early or full decode - .... (Never occurs in live mode — no silence) - [X] Idle timer never fires in live mode - -------------------------------------------------------------------------------- - LIVE-MODE STDOUT TIMELINE (52s + 56s DECODE CYCLES) -------------------------------------------------------------------------------- - - Live tracking output (continuous @1296.xxx lines every ~120 ms) - |=========================================================================| - ^ ^ - | | - Start of minute End of minute - - Early Decode (~52s) Full Decode (~56s) - |====================| |====================| - ^ ^ ^ ^ - | | | | - Trigger Trigger - (ihsym>=280) EarlyFinished (ihsym>=302) DecodeFinished - - ---------------------------------------------------------------------------→ time - - IMPORTANT: - - Live tracking output continues uninterrupted across BOTH decode cycles. - - There is NO period of silence after . - - Therefore the idle timer NEVER observes a 2500 ms quiet window. - - If busy were cleared only by the idle timer, it would remain TRUE forever. - -------------------------------------------------------------------------------- - CORRECT LIVE-MODE BEHAVIOR -------------------------------------------------------------------------------- - On (early or full): - - Clear busy IMMEDIATELY. - - Do NOT wait for silence (there is none). - - Do NOT auto-advance (live mode never advances files). - - This matches legacy MAP65, where the blocking read returned immediately after - during live decoding. - -------------------------------------------------------------------------------- - SUMMARY -------------------------------------------------------------------------------- - Disk mode: - → wait for silence → busy=false → auto-advance - - Live mode: - → busy=false immediately (no idle timer) - -=============================================================================== -*/ +MAP65 decode request lifecycle +============================== + +Parameter ownership +------------------- +The C-facing getters and setters in npar_ptrs_mod operate on a draft +parameter record. MainWindow::decode prepares that record, then calls +publish_decode_request. Publication copies the complete record into a FIFO +queue and assigns it a monotonically increasing request ID. + +A dedicated mutex protects draft access, publication, cancellation and +claiming. It is separate from g_fortran_decode_mutex, which is held for the +decoder thread's entire lifetime. + +run_m65 claims one queued request before calling m65a. Claiming removes that +request from the queue and copies its parameters into decoder-owned active +storage. All decoder routines use those active parameters until the call +returns. GUI updates can prepare and publish subsequent requests without +changing the active pass. + +The live waterfall reads the draft center frequency through get_fcenter. +Runtime sample-rate/FFT sizes and the working directory are initialized +before decoding and are not per-request parameters. + +Triggers and completion +----------------------- +Automatic live decoding publishes an early request at 280 half-symbols and a +final request at 302 half-symbols. Disk input publishes the final request. +The FIFO preserves both requests if the early pass is delayed or has not +started when the final trigger arrives. + +The live input generation advances when the sound/UDP input resets its +write pointer, before writing the next interval's samples. Each request +records that generation. An automatic live +request still pending after rollover expires instead of decoding another +interval's samples. The decoder emits with the expired +request ID; the GUI clears busy only for the latest request, without +changing decode counts or advancing a disk sequence. Manual repeats and +disk requests do not expire on live rollover. + +newdat belongs to the active request and starts at 1. The DSP receives its +own copy for FFT-cache invalidation. Clearing that copy or finishing a pass +cannot erase or repeat a pending request. + +The Decode button sets nagain to reuse the previous sample snapshot. +Freeze-decode also sets manualDecodeFlag. Publication consumes the draft +manual flag, so it cannot leak into the next automatic request. + +An early pass emits . A final or manual pass emits + with its request ID appended after the existing fixed-width +fields. The GUI accepts final completion only when that ID still matches the +latest published request. An older completion cannot clear busy state or +advance a disk sequence while newer work is pending. + +decoder_ready temporarily prevents claims while input/parameters are being +prepared; publication enables claims. Loading another file cancels queued +requests and invalidates older completion IDs. Shutdown frees queued +requests. Neither operation interrupts an already active DSP call. + +Sample-buffer boundary +---------------------- +The request queue owns scalar parameters and strings, not sample buffers. +decode0 copies live dd/ss/savg into the existing snapshot when an automatic +request starts; manual repeats reuse that snapshot. Requests claimed before +rollover still have the existing race between the sample copy and buffer +updates. Generation checks reject already obsolete pending requests; they +do not establish ownership of a claimed request's samples or synchronize +its sample copy. diff --git a/map65/messages.cpp b/map65/messages.cpp index 876c04f0..4ded52c2 100644 --- a/map65/messages.cpp +++ b/map65/messages.cpp @@ -5,9 +5,10 @@ #include "mainwindow.h" #include "qt_helpers.hpp" #include "../revision_utils.hpp" -#include "../Logger.hpp" #include "../Network/PSKReporter.hpp" #include "liveCQSender.hpp" +#include "pskreporter_decode.h" +#include "pskreporter_settings.h" #include //liveCQ #include //liveCQ @@ -21,11 +22,8 @@ #include #include -#include -#include -#include - -Messages::Messages (QString const& settings_filename, QWidget * parent) : +Messages::Messages (QString const& settings_filename, QString const& eclipse_filename, + QWidget * parent) : QDialog {parent}, ui {new Ui::Messages}, m_settings_filename {settings_filename} @@ -42,11 +40,13 @@ Messages::Messages (QString const& settings_filename, QWidget * parent) : ui->messagesTextBrowser->clear(); QSettings settings2 {m_settings_filename, QSettings::IniFormat}; + auto const pskReporterSettings = readMap65PSKReporterSettings(settings2); SettingsGroup h {&settings2, "Common"}; bool m_w3szUrl = settings2.value("w3szUrl",true).toBool(); QString m_otherUrl = settings2.value("otherUrl","").toString(); QString m_myCall=settings2.value("MyCall","").toString(); QString m_myGrid=settings2.value("MyGrid","").toString(); + m_spot_to_psk_reporter = pskReporterSettings.enabled; QString theUrl; if(m_w3szUrl) { @@ -78,16 +78,18 @@ Messages::Messages (QString const& settings_filename, QWidget * parent) : }); connect(livecqThread, &QThread::finished, livecqThread, &QObject::deleteLater); livecqThread->start(); - - pskReporter_.reset (new PSKReporter { - {settings2.value ("PSKReporterTCPIP", false).toBool (), - QCoreApplication::applicationDirPath () + "/eclipse.txt", - QString {"MAP65 v" + QCoreApplication::applicationVersion () + " " + revision ()}.simplified ()} - }); - if (m_spot_to_psk_reporter) - { - initializePSKReporting (); - } + + m_psk_reporter.reset(new PSKReporter({ + pskReporterSettings.use_tcpip, + eclipse_filename, + QString {"MAP65 v" + QCoreApplication::applicationVersion() + + " " + revision()}.simplified() + })); + connect(m_psk_reporter.get(), &PSKReporter::errorOccurred, + this, &Messages::errorOccurred); + if (m_spot_to_psk_reporter) { + initializePSKReporting(); + } } Messages::~Messages() @@ -95,6 +97,9 @@ Messages::~Messages() //QSettings settings {m_settings_filename, QSettings::IniFormat}; //SettingsGroup g {&settings, "MainWindow"}; //settings.setValue ("MessagesGeom", geometry ()); + if (m_psk_reporter) { + m_psk_reporter->sendReport(true); + } delete ui; } @@ -120,10 +125,19 @@ void Messages::initializePSKReporting() SettingsGroup g {&settings, "Common"}; QString receiverCallsign=settings.value("MyCall","").toString(); QString receiverLocator=settings.value("MyGrid","").toString(); - if (pskReporter_) - { - pskReporter_->setLocalStation(receiverCallsign, receiverLocator, "N/A", "N/A (MAP65)"); - } + m_psk_reporter->setLocalStation(receiverCallsign, receiverLocator, + "N/A", "N/A (MAP65)"); +} + +void Messages::setPSKReportingEnabled(bool enabled) +{ + auto const was_enabled = m_spot_to_psk_reporter; + m_spot_to_psk_reporter = enabled; + if (enabled) { + initializePSKReporting(); + } else if (was_enabled) { + m_psk_reporter->sendReport(true); + } } void Messages::sendLiveCQData(QStringList decodeList) { @@ -145,7 +159,7 @@ void Messages::sendLiveCQData(QStringList decodeList) { else return; for (const QString &theLine : decodeList) { QStringList thePostLine = theLine.split(" ",SkipEmptyParts); - if((thePostLine.at(5) == "CQ" || thePostLine.at(5) == "QRZ" || thePostLine.at(5) == "CQV" || thePostLine.at(5) == "CQH" || thePostLine.at(5) == "QRT") && m_myCall.length() >=3 && m_myGrid.length()>=4) { + if((thePostLine.at(5).trimmed() == "CQ" || thePostLine.at(5).trimmed() == "QRZ" || thePostLine.at(5).trimmed() == "CQV" || thePostLine.at(5) == "CQH" || thePostLine.at(5).trimmed() == "QRT") && m_myCall.length() >=3 && m_myGrid.length()>=4) { if(allDecodes.filter(theLine.mid(0,53)).length() == 0) { allDecodes.append(theLine); QString freq = thePostLine.at(0).trimmed(); @@ -166,7 +180,7 @@ void Messages::sendLiveCQData(QStringList decodeList) { // Handle CQ CALL but NO GRID -- dot at 7 if(thePostLine.at(7).contains(".")) { callsign = thePostLine.at(6).trimmed().toUpper(); - bool isCall = testCall(callsign); + bool isCall = Map65PSKReporter::isValidMap65Callsign(callsign); if(!isCall) continue; dT =thePostLine.at(7).trimmed(); modeChar = thePostLine.at(8).trimmed(); @@ -183,13 +197,13 @@ void Messages::sendLiveCQData(QStringList decodeList) { } else if (thePostLine.at(8).contains(".")) { // Test for callsign at thePostLine(6) callsign = thePostLine.at(6).trimmed().toUpper(); - bool isCall = testCall(callsign); + bool isCall = Map65PSKReporter::isValidMap65Callsign(callsign); if(isCall) { grid = thePostLine.at(7).trimmed(); // Handle CQ XXX CALL } else { callsign = thePostLine.at(7).trimmed().toUpper(); - bool isCall = testCall(callsign); + bool isCall = Map65PSKReporter::isValidMap65Callsign(callsign); if(!isCall) continue; } dT =thePostLine.at(8).trimmed(); @@ -219,7 +233,7 @@ void Messages::sendLiveCQData(QStringList decodeList) { // Handle CQ XXX CALL GRID } else if(thePostLine.at(9).contains(".")) { callsign = thePostLine.at(7).trimmed().toUpper(); - bool isCall = testCall(callsign); + bool isCall = Map65PSKReporter::isValidMap65Callsign(callsign); if(!isCall) continue; grid = thePostLine.at(8).trimmed(); @@ -262,63 +276,6 @@ void Messages::sendLiveCQData(QStringList decodeList) { } } -bool Messages::testCall(QString w) -{ -// Check "callsign" to see if it could be a valid standard callsign or a valid -// compound callsign. -// Return a logical "call ok" indicator. - if(w.indexOf('.') >= 0) return false; - if(w.indexOf('+') >= 0) return false; - if(w.indexOf('-') >= 0) return false; - if(w.indexOf('?') >= 0) return false; - w = w.replace('<',""); - w = w.replace('>',""); - int n1=w.length(); - if(n1 > 11) return false; - QString bc = QString(); - QStringList wSplit = w.split("/"); - if(wSplit.length() > 1) { - if(wSplit.at(0).length() > wSplit.at(1).length()) { - bc = wSplit.at(0); - } - else { - bc = wSplit.at(1); - } - } - else { - bc = w; - } - int nbc=bc.trimmed().length(); - if(nbc > 8) return false; //Base call should have no more than 8 characters e.g. YW18FIFA - -// One of first two characters must be a letter - if((!bc[0].isLetter()) && (!bc[1].isLetter())) return false; -// Real calls don't start with Q, but we'll allow the placeholder -// callsign QU1RK to be considered a standard call: - if(bc[0]=='Q' && bc.mid(0,5) != "QU1RK") return false; - -// Must have a digit in 2nd or 3rd or 4th position - int i1=0; - if(bc[1].isDigit()) i1=1; - if(bc[2].isDigit()) i1=2; - if(bc[3].isDigit()) i1=3; - if(i1==0) return false; - -// Callsign must have a suffix of 1-4 letters e.g. YW18FIFA - if(i1==nbc) return false; - int n=0; - QChar j=QChar(); - for (int i=i1+1; i<=nbc-1; ++i) { - j=bc[i]; - if(j QChar('Z')) return false; - n=n+1; - } - if(n >= 1 && n <= 4) return true; - - return false; -} - - void Messages::onFinished(QNetworkReply *reply) { if (reply->error() == QNetworkReply::NoError) { @@ -379,135 +336,20 @@ void Messages::setText(QString t, QString t2) } } -void Messages::sendPSKReporterData(QStringList decodeList) { - - QSettings settings(m_settings_filename, QSettings::IniFormat); +void Messages::sendPSKReporterData(QStringList decodeList) { + QSettings settings {m_settings_filename, QSettings::IniFormat}; SettingsGroup g {&settings, "Common"}; - - //QRZ parameters (3) - QString receiverCallsign=settings.value("MyCall","").toString(); - QString receiverLocator=settings.value("MyGrid","").toString(); - m_spot_to_psk_reporter = settings.value("spotPSK",true).toBool(); - //QRZ parameters (8) - QString senderCallsign; - QString senderLocator; - double doubleFreq = 0.0; //(Hz) - qint64 frequency = 0.0; - int sNR = -10; - QString mode = ""; - bool ok = false; - - for (const QString &theLine : decodeList) { - QStringList thePostLine = theLine.split(" ",SkipEmptyParts); - if((thePostLine.at(5) == "CQ" || thePostLine.at(5) == "QRZ" || thePostLine.at(5) == "CQV" || thePostLine.at(5) == "CQH" || thePostLine.at(5) == "QRT") && receiverCallsign.length() >=3 && receiverLocator.length()>=4) { - if(allDecodes2.filter(theLine.mid(0,53)).length() == 0) { - allDecodes2.append(theLine); - QString freq = thePostLine.at(0).trimmed(); - doubleFreq = freq.toDouble(&ok); - frequency = qRound64(doubleFreq * 1000000); - QString dF = thePostLine.at(1).trimmed(); - QString dB = thePostLine.at(4).trimmed(); - sNR = dB.toInt(&ok); - QString msgType = thePostLine.at(5).trimmed().toUpper(); - senderCallsign = ""; - senderLocator = "--"; - mode=""; - sNR=-10; - QString modeChar = ""; + auto const spots = Map65PSKReporter::parseMap65PSKReporterSpots( + decodeList, + settings.value("MyCall", "").toString(), + settings.value("MyGrid", "").toString(), + QDateTime::currentDateTimeUtc(), + allDecodes2); - int m_TRperiod = 60; - QString sTimeString = (thePostLine.at(3).trimmed() + "00"); - int sTime = sTimeString.toInt(); - int h=sTimeString.mid(0,2).toInt(); - int m=sTimeString.mid(2,2).toInt(); - int s=sTimeString.mid(4,2).toInt(); - QTime time2(h, m, s); - QDateTime qSpotTime; - if (sTime + m_TRperiod < 236000) { - #if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0) - qSpotTime = QDateTime( - QDateTime::currentDateTimeUtc().date(), - time2, - QTimeZone::UTC - ); - #else - qSpotTime = QDateTime( - QDateTime::currentDateTimeUtc().date(), - time2, - Qt::UTC - ); - #endif - } - else { - #if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0) - qSpotTime = QDateTime( - QDateTime::currentDateTimeUtc().addDays(-1).date(), - time2, - QTimeZone::UTC - ); - #else - qSpotTime = QDateTime( - QDateTime::currentDateTimeUtc().addDays(-1).date(), - time2, - Qt::UTC - ); - #endif - } - - // Handle CQ CALL but NO GRID -- dot at 7 - if(thePostLine.at(7).contains(".")) { - senderCallsign = thePostLine.at(6).trimmed().toUpper(); - bool isCall = testCall(senderCallsign); - if(!isCall) continue; - modeChar = thePostLine.at(8).trimmed(); - if(modeChar.contains("#")) mode = QString("JT65") + modeChar.back(); - else if(modeChar.contains(":")) mode = QString("Q65-60") + modeChar.back(); - - // Handle CQ CALL GRID or CQ XXX CALL -- dot at 8 - } else if (thePostLine.at(8).contains(".")) { - // Test for callsign at thePostLine(6) - senderCallsign = thePostLine.at(6).trimmed().toUpper(); - bool isCall = testCall(senderCallsign); - if(isCall) { - senderLocator = thePostLine.at(7).trimmed(); - // Handle CQ XXX CALL - } else { - senderCallsign = thePostLine.at(7).trimmed().toUpper(); - bool isCall = testCall(senderCallsign); - if(!isCall) continue; - } - modeChar = thePostLine.at(9).trimmed(); - if(modeChar.contains("#")) - { - mode = QString("JT65") + modeChar.back(); - } else if(modeChar.contains(":")) { - mode = QString("Q65-60") + modeChar.back(); - } - // Handle CQ XXX CALL GRID - } else if(thePostLine.at(9).contains(".")) { - senderCallsign = thePostLine.at(7).trimmed().toUpper(); - bool isCall = testCall(senderCallsign); - if(!isCall) continue; - senderLocator = thePostLine.at(8).trimmed(); - - modeChar = thePostLine.at(10).trimmed(); - if(modeChar.contains("#")) - { - mode = QString("JT65") + modeChar.back(); - } else if(modeChar.contains(":")) { - mode = QString("Q65-60") + modeChar.back(); - } - } - else { - continue; - } - - if (pskReporter_) - { - pskReporter_->addRemoteStation(senderCallsign, senderLocator, frequency, mode, sNR, qSpotTime); - } - } - } + for (auto const& spot : spots) { + m_psk_reporter->addRemoteStation(spot.callsign, spot.locator, + spot.frequency, spot.mode, spot.snr, + spot.time); } } diff --git a/map65/messages.h b/map65/messages.h index 67973c53..5b27157a 100644 --- a/map65/messages.h +++ b/map65/messages.h @@ -3,26 +3,25 @@ #include #include "commons.h" -#include "../Network/PSKReporter.hpp" #include #include -#include namespace Ui { class Messages; } -class PSKReporter; // Forward declaration — avoids including PSKReporter.h here +class PSKReporter; class Messages : public QDialog { Q_OBJECT public: - explicit Messages (QString const& settings_filename, QWidget * parent = nullptr); + explicit Messages (QString const& settings_filename, QString const& eclipse_filename, + QWidget * parent = nullptr); void setText(QString t, QString t2); void setColors(QString t); - void init_psk_reporter(bool const& param1, bool const& param2, QString const& param3); + void setPSKReportingEnabled(bool enabled); void setClosingForShutdown(bool value) { m_closingForShutdown = value; } ~Messages(); @@ -53,8 +52,8 @@ private: QString m_color2; QString m_color3; - std::unique_ptr pskReporter_; QThread* livecqThread; + std::unique_ptr m_psk_reporter; bool m_closingForShutdown = false; bool m_cqOnly; @@ -64,7 +63,7 @@ private: void sendPSKReporterData(QStringList decodeList); //PSKReporter void sendLiveCQData(QStringList decodeList); // This will trigger the web request void initializePSKReporting(); - bool testCall(QString w); //liveCQ + bool m_spot_to_psk_reporter {false}; QString w3szUrlAddr="https://w3sz.com/livecq_update.php"; //liveCQ diff --git a/map65/plotter.cpp b/map65/plotter.cpp index 1c158928..6397222b 100644 --- a/map65/plotter.cpp +++ b/map65/plotter.cpp @@ -11,6 +11,8 @@ #define MAX_SCREENSIZE 2048 +extern int g_sampleRate; +extern int g_activeNfft; CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor QFrame(parent) @@ -39,7 +41,6 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor m_fQSO = 125; m_TXkHz = m_fQSO; m_line = 0; - m_fSample = 96000; m_paintAllZoom = false; m_TxDF=0; m_bDecodeFinished=false; @@ -47,6 +48,18 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor CPlotter::~CPlotter() { } // Destructor +void CPlotter::ensureWaterfallHistory(int rows) +{ + rows = std::max(0, rows); + int stride = std::max(0, g_activeNfft); + size_t size = static_cast(stride) * static_cast(rows); + if (m_waterfallStride != stride || m_waterfallRows != rows || m_zwf.size() != size) { + m_zwf.assign(size, 0); + m_waterfallStride = stride; + m_waterfallRows = rows; + } +} + QSize CPlotter::minimumSizeHint() const { return QSize(50, 50); @@ -64,14 +77,14 @@ void CPlotter::resizeEvent(QResizeEvent* ) //resizeEvent() //if changed, resize pixmaps to new screensize m_Size = size(); int w = m_Size.width(); - int h = (m_Size.height()-60)/2; + int h = std::max(0, (m_Size.height()-60)/2); m_WaterfallPixmap = QPixmap(w,h); m_ZoomWaterfallPixmap = QPixmap(w,h); m_2DPixmap = QPixmap(w,h); m_WaterfallPixmap.fill(Qt::black); m_ZoomWaterfallPixmap.fill(Qt::black); m_2DPixmap.fill(Qt::black); - memset(m_zwf,0,32768*h); + ensureWaterfallHistory(h); m_ScalePixmap = QPixmap(w,30); m_ZoomScalePixmap = QPixmap(w,30); //(no change on resize...) m_ScalePixmap.fill(Qt::white); @@ -106,24 +119,34 @@ void CPlotter::paintEvent(QPaintEvent *) // paintEvent() QRect source(0,0,w,30); painter.drawPixmap(target,m_ZoomScalePixmap,source); - float df=m_fSample/32768.0; - int x0=16384 + (0.001*(m_ZoomStartFreq+m_fCal)+m_fQSO-m_nkhz+1.27046) * \ + float df = float(g_sampleRate) / float(g_activeNfft); + int x0 = g_activeNfft/2 + (0.001*(m_ZoomStartFreq+m_fCal)+m_fQSO-m_nkhz+1.27046) * \ 1000.0/df + 0.5; QPainter painter1(&m_WaterfallPixmap); QPainter painter2(&m_ZoomWaterfallPixmap); for(int i=0; i= 0 && idx < m_waterfallStride && !m_zwf.empty()) { + color = m_zwf[static_cast(idx)]; + } + painter2.setPen(m_ColorTbl[color]); painter2.drawPoint(i,0); } if(m_paintAllZoom or (x0 != x00 and x00 != -99)) { // If new fQSO, paint all rows int k=x0; for(int j=1; j= 0 && static_cast(idx) < m_zwf.size()) { + color = m_zwf[static_cast(idx)]; + } + painter2.setPen(m_ColorTbl[color]); painter2.drawPoint(i,j); } } @@ -196,13 +219,17 @@ void CPlotter::draw(float s[], int i0, float splot[]) //draw() m_i0=i0; w = m_WaterfallPixmap.width(); h = m_WaterfallPixmap.height(); + ensureWaterfallHistory(h); double gain = pow(10.0,0.05*(m_plotGain+7)); //move current data down one line //(must do this before attaching a QPainter object) m_WaterfallPixmap.scroll(0,1,0,0,w,h); m_ZoomWaterfallPixmap.scroll(0,1,0,0, w, h); - memmove(&m_zwf[32768],m_zwf,32768*(h-1)); + if (m_waterfallStride > 0 && m_waterfallRows > 1) { + size_t stride = static_cast(m_waterfallStride); + memmove(&m_zwf[stride], m_zwf.data(), stride * static_cast(m_waterfallRows - 1)); + } QPainter painter1(&m_WaterfallPixmap); QPainter painter2D(&m_2DPixmap); @@ -251,14 +278,17 @@ void CPlotter::draw(float s[], int i0, float splot[]) //draw() } } - for(i=0; i<32768; i++) { + int rowBins = std::min(g_activeNfft, m_waterfallStride); + for (i = 0; i < rowBins; i++) { y = 10.0*log10(splot[i]); int y1 = 5.0*gain*(y + 30 - m_plotZero); if (y1<0) y1=0; if (y1>254) y1=254; if (splot[i]>1.e29) y1=255; m_hist2[y1]++; - m_zwf[i]=y1; + if (!m_zwf.empty()) { + m_zwf[static_cast(i)] = static_cast(y1); + } } if(s[0]>1.0e29) m_line=0; @@ -305,10 +335,17 @@ void CPlotter::DrawOverlay() //DrawOverlay() painter0.setFont(Font); painter0.setPen(Qt::black); - m_binsPerPixel = m_nSpan * 32768.0/(w*0.001*m_fSample) + 0.5; double FreqPerDiv=5.0; - double df = m_binsPerPixel*0.001*m_fSample/32768.0; - m_hdivs = w*df/FreqPerDiv + 0.9999; + double df = m_binsPerPixel * 0.001 * double(g_sampleRate) / double(g_activeNfft); + m_fSpan = w * df; + + m_hdivs = int(w * df / FreqPerDiv + 0.9999); + // Clamp to array size + const int MAX_HDIVS = 482; + if (m_hdivs < 0) m_hdivs = 0; + if (m_hdivs > MAX_HDIVS) m_hdivs = MAX_HDIVS; + + m_fSpan = w*df; m_ScalePixmap.fill(Qt::white); painter0.drawRect(0, 0, w, 30); @@ -355,7 +392,7 @@ void CPlotter::DrawOverlay() //DrawOverlay() painter0.setPen(pen0); x = m_xClick; painter0.drawLine(x,15,x,30); - int x0=(16384-m_i0)/m_binsPerPixel; + int x0=((g_activeNfft/2) - m_i0)/m_binsPerPixel; m_fGreen=(x-x0)*df; x0 += (x0-x); QPen pen3(Qt::red, 3); @@ -379,8 +416,10 @@ void CPlotter::DrawOverlay() //DrawOverlay() painter3.setPen(Qt::black); FreqPerDiv=0.2; - df = 0.001*m_fSample/32768.0; - m_hdivs = 32768*df/FreqPerDiv + 0.9999; + df = 0.001f * float(g_sampleRate) / float(g_activeNfft); + m_hdivs = int(g_activeNfft * df / FreqPerDiv + 0.9999); + if (m_hdivs < 0) m_hdivs = 0; + if (m_hdivs > MAX_HDIVS) m_hdivs = MAX_HDIVS; int nlabs=df*w/0.2 + 1.0; m_ZoomScalePixmap.fill(Qt::white); painter3.drawRect(0, 0, w, 30); @@ -402,7 +441,7 @@ void CPlotter::DrawOverlay() //DrawOverlay() m_HDivText[i]); } - df=m_fSample/32768.0; + df = float(g_sampleRate) / float(g_activeNfft); if(m_bLockTxRx) m_TxDF=m_DF; x = (m_DF + m_mode65*66*11025.0/4096.0 - m_ZoomStartFreq)/df; QPen pen2(Qt::darkGreen, 3); //Mark top JT65B tone with dark Green tick @@ -431,6 +470,7 @@ void CPlotter::DrawOverlay() //DrawOverlay() void CPlotter::MakeFrequencyStrs() //MakeFrequencyStrs { + float StartFreq = m_StartFreq; float freq; int i,j; @@ -440,7 +480,7 @@ void CPlotter::MakeFrequencyStrs() //MakeFrequencyStrs m_FreqUnits = 1; FreqPerDiv = 200; int w = m_WaterfallPixmap.width(); - float df=m_fSample/32768.0; + float df = float(g_sampleRate) / float(g_activeNfft); StartFreq = -w*df/2; int n=StartFreq/FreqPerDiv; StartFreq=n*200; @@ -631,8 +671,9 @@ void CPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent m_TXfreq = floor(static_cast(getFcenter())) + 0.001*m_TXkHz; } } else { // Zoomed waterfall - if(button==1) m_DF=int(m_ZoomStartFreq + x*m_fSample/32768.0); - if(button==2 and !m_bLockTxRx) m_TxDF=int(m_ZoomStartFreq + x*m_fSample/32768.0); + float df = float(g_sampleRate) / float(g_activeNfft); + if (button == 1) m_DF = int(m_ZoomStartFreq + x * df); + if (button == 2 && !m_bLockTxRx) m_TxDF = int(m_ZoomStartFreq + x * df); if(m_bLockTxRx) m_TxDF=m_DF; } DrawOverlay(); @@ -657,7 +698,8 @@ void CPlotter::mouseDoubleClickEvent(QMouseEvent *event) //mouse2click setFQSO(x,false); emit freezeDecode1(2); //### ??? } else { - float f = m_ZoomStartFreq + x*m_fSample/32768.0; + float df = float(g_sampleRate) / float(g_activeNfft); + float f = m_ZoomStartFreq + x * df; m_DF=int(f); emit freezeDecode1(1); DrawOverlay(); @@ -679,7 +721,7 @@ int CPlotter::autoZero() //autoZero() int sum2=0; for(int i=0; i<256; i++) { sum2 += m_hist2[i]; - if(sum2 > 16384) { + if (sum2 > g_activeNfft/2) { m_z2=i; break; } @@ -694,8 +736,23 @@ int CPlotter::autoZero() //autoZero() void CPlotter::setNSpan(int n) //setNSpan() { m_nSpan=n; +// ui->widePlot->resetWaterfall(); } +/* +void CPlotter::resetWaterfall() +{ + int w = m_WaterfallPixmap.width(); + int h = m_WaterfallPixmap.height(); + + m_WaterfallPixmap = QPixmap(w, h); + m_WaterfallPixmap.fill(Qt::black); + + m_ScalePixmap = QPixmap(w, 30); + m_ScalePixmap.fill(Qt::white); + m_lastWaterfallLine = 0; +} +*/ void CPlotter::setPalette(QString palette) //setPalette() { if(palette=="Linrad") { @@ -754,11 +811,6 @@ void CPlotter::setPalette(QString palette) //setPalette() } } -void CPlotter::setFsample(int n) -{ - m_fSample=n; -} - void CPlotter::setMode65(int n) { m_mode65=n; @@ -805,8 +857,8 @@ void CPlotter::mouseMoveEvent (QMouseEvent * event) #endif bool lower=(y > 30+h); float freq=FreqfromX(x); - float df=m_fSample/32768.0; - int ndf=x*df + m_ZoomStartFreq; + float df = float(g_sampleRate) / float(g_activeNfft); + int ndf = int(x * df + m_ZoomStartFreq + 0.5f); if(lower) { QToolTip::showText( #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) diff --git a/map65/plotter.h b/map65/plotter.h index 1147b12e..e7ff1f82 100644 --- a/map65/plotter.h +++ b/map65/plotter.h @@ -13,6 +13,7 @@ #include #include #include +#include #include "commons.h" #include "decode_label.h" @@ -68,13 +69,13 @@ public: int DF(); int autoZero(); void setPalette(QString palette); - void setFsample(int n); void setMode65(int n); void set2Dspec(bool b); double fGreen(); void setLockTxRx(bool b); double rxFreq(); double txFreq(); +// void resetWaterfall() // void updateFreqLabel(); // Decoded-callsign overlay (N6NU 2026-05-12, ported from QMAP). @@ -114,6 +115,7 @@ private: int XfromFreq(float f); float FreqfromX(int x); qint64 RoundFreq(qint64 freq, int resolution); + void ensureWaterfallHistory(int rows); // Render m_decodeLabels overlay on top of the waterfall pixmap. // Stacks colliding labels vertically (max 5 rows) so a busy band // doesn't paint labels on top of each other. @@ -130,7 +132,9 @@ private: QPixmap m_WaterfallPixmap; QPixmap m_ZoomWaterfallPixmap; QPixmap m_2DPixmap; - unsigned char m_zwf[32768*400]; + std::vector m_zwf; + int m_waterfallStride {0}; + int m_waterfallRows {0}; QPixmap m_ScalePixmap; QPixmap m_ZoomScalePixmap; QSize m_Size; @@ -158,7 +162,6 @@ private: qint32 m_z1; qint32 m_z2; qint32 m_nkhz; - qint32 m_fSample; qint32 m_mode65; qint32 m_i0; qint32 m_xClick; diff --git a/map65/pskreporter_decode.cpp b/map65/pskreporter_decode.cpp new file mode 100644 index 00000000..85b51b58 --- /dev/null +++ b/map65/pskreporter_decode.cpp @@ -0,0 +1,120 @@ +#include "pskreporter_decode.h" + +#include "../validators/LiveCQCallsign.hpp" +#include "../Network/DecodedTime.hpp" + +#include + +namespace +{ + bool isReportableMessageType(QString const& messageType) + { + return messageType == "CQ" || messageType == "QRZ" + || messageType == "CQV" || messageType == "CQH" + || messageType == "QRT"; + } + + bool parseSpot(QStringList const& tokens, + QString const& receiverCallsign, + QString const& receiverLocator, + QDateTime const& nowUtc, + PSKReporterIPFIX::Spot& spot) + { + if (tokens.size() < 9 || receiverCallsign.length() < 3 + || receiverLocator.length() < 4 + || !isReportableMessageType(tokens.at(5).trimmed())) { + return false; + } + + bool ok = false; + auto const frequencyMHz = tokens.at(0).trimmed().toDouble(&ok); + if (!ok) { + return false; + } + + auto const spotTime = DecodedTime::spotTime(tokens.at(3).trimmed(), nowUtc, 60); + if (!spotTime.isValid()) { + return false; + } + + QString callsign; + QString locator = "--"; + QString mode; + QString modeToken; + + if (tokens.at(7).contains('.')) { + callsign = tokens.at(6).trimmed().toUpper(); + modeToken = tokens.at(8).trimmed(); + } else if (tokens.size() >= 10 && tokens.at(8).contains('.')) { + callsign = tokens.at(6).trimmed().toUpper(); + if (Map65PSKReporter::isValidMap65Callsign(callsign)) { + locator = tokens.at(7).trimmed(); + } else { + callsign = tokens.at(7).trimmed().toUpper(); + } + modeToken = tokens.at(9).trimmed(); + } else if (tokens.size() >= 11 && tokens.at(9).contains('.')) { + callsign = tokens.at(7).trimmed().toUpper(); + locator = tokens.at(8).trimmed(); + modeToken = tokens.at(10).trimmed(); + } else { + return false; + } + + if (!Map65PSKReporter::isValidMap65Callsign(callsign)) { + return false; + } + if (modeToken.contains('#')) { + mode = "JT65" + modeToken.back(); + } else if (modeToken.contains(':')) { + mode = "Q65-60" + modeToken.back(); + } else { + return false; + } + + spot = { + callsign, + locator, + -10, + static_cast(qRound64(frequencyMHz * 1000000)), + mode, + spotTime + }; + return true; + } +} + +namespace Map65PSKReporter +{ + bool isValidMap65Callsign(QString const& callsign) + { + return LiveCQ::isValidCallsign(callsign); + } + + QList parseMap65PSKReporterSpots( + QStringList const& decodeLines, + QString const& receiverCallsign, + QString const& receiverLocator, + QDateTime const& nowUtc, + QStringList& seenDecodes) + { + QList spots; + for (auto const& line : decodeLines) { + auto const tokens = line.split(' ', Qt::SkipEmptyParts); + if (tokens.size() < 6 + || !isReportableMessageType(tokens.at(5).trimmed()) + || receiverCallsign.length() < 3 + || receiverLocator.length() < 4 + || !seenDecodes.filter(line.left(53)).isEmpty()) { + continue; + } + + seenDecodes.append(line); + PSKReporterIPFIX::Spot spot; + if (parseSpot(tokens, receiverCallsign, receiverLocator, nowUtc, spot)) { + spots.append(spot); + } + } + return spots; + } +} diff --git a/map65/pskreporter_decode.h b/map65/pskreporter_decode.h new file mode 100644 index 00000000..55a47b6b --- /dev/null +++ b/map65/pskreporter_decode.h @@ -0,0 +1,23 @@ +#ifndef MAP65_PSKREPORTER_DECODE_H +#define MAP65_PSKREPORTER_DECODE_H + +#include +#include +#include +#include + +#include "../Network/PSKReporterIPFIX.hpp" + +namespace Map65PSKReporter +{ + bool isValidMap65Callsign(QString const& callsign); + + QList parseMap65PSKReporterSpots( + QStringList const& decodeLines, + QString const& receiverCallsign, + QString const& receiverLocator, + QDateTime const& nowUtc, + QStringList& seenDecodes); +} + +#endif diff --git a/map65/pskreporter_settings.cpp b/map65/pskreporter_settings.cpp new file mode 100644 index 00000000..0df138b7 --- /dev/null +++ b/map65/pskreporter_settings.cpp @@ -0,0 +1,11 @@ +#include "pskreporter_settings.h" + +#include + +Map65PSKReporterSettings readMap65PSKReporterSettings(QSettings const& settings) +{ + return { + settings.value ("Common/spotPSK", true).toBool (), + settings.value ("Common/PSKReporterTCPIP", false).toBool () + }; +} diff --git a/map65/pskreporter_settings.h b/map65/pskreporter_settings.h new file mode 100644 index 00000000..9e6e2d66 --- /dev/null +++ b/map65/pskreporter_settings.h @@ -0,0 +1,14 @@ +#ifndef MAP65_PSKREPORTER_SETTINGS_H +#define MAP65_PSKREPORTER_SETTINGS_H + +class QSettings; + +struct Map65PSKReporterSettings +{ + bool enabled; + bool use_tcpip; +}; + +Map65PSKReporterSettings readMap65PSKReporterSettings(QSettings const& settings); + +#endif diff --git a/map65/runtime_paths.cpp b/map65/runtime_paths.cpp new file mode 100644 index 00000000..eabf2296 --- /dev/null +++ b/map65/runtime_paths.cpp @@ -0,0 +1,132 @@ +#include "runtime_paths.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace +{ + QStringList runtimeSourceCandidates(QString const& appDir, QString const& installedDataDir, + QString const& fileName) + { + QDir app {appDir}; + QDir cwd {QDir::currentPath()}; + + return { + QDir {installedDataDir}.absoluteFilePath(fileName), + app.absoluteFilePath(fileName), + app.absoluteFilePath("resources/" + fileName), + app.absoluteFilePath("../" + fileName), + app.absoluteFilePath("../map65/resources/" + fileName), + cwd.absoluteFilePath(fileName), + cwd.absoluteFilePath("map65/resources/" + fileName) + }; + } +} + +QString writableMap65DataDir() +{ + QString dataDir = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation); + if (dataDir.isEmpty()) { + dataDir = QDir::home().absoluteFilePath(".map65"); + } + + if (!QDir{}.mkpath(dataDir)) { + qWarning() << "Unable to create MAP65 data directory:" << dataDir; + } + + QDir dir {dataDir}; + if (!dir.mkpath("save")) { + qWarning() << "Unable to create MAP65 save directory:" << dir.absoluteFilePath("save"); + } + return dataDir; +} + +QString map65SettingsFile(QString const& appDir, QString const& dataDir) +{ + QString settingsFile = QDir {dataDir}.absoluteFilePath("map65.ini"); + QString legacySettingsFile = QDir {appDir}.absoluteFilePath("map65.ini"); + if (!QFile::exists(settingsFile) && QFile::exists(legacySettingsFile)) { + if (QFile::copy(legacySettingsFile, settingsFile)) { + QFile::setPermissions(settingsFile, QFile::ReadOwner | QFile::WriteOwner + | QFile::ReadGroup | QFile::ReadOther); + } else { + qWarning() << "Unable to migrate MAP65 settings from" << legacySettingsFile + << "to" << settingsFile; + } + } + return settingsFile; +} + +int readFSam96000(QSettings const& settings, int defaultValue) +{ + QString text = settings.value("FSam96000", QString::number(defaultValue)).toString(); + if (text.compare("true", Qt::CaseInsensitive) == 0) return 1; // legacy bool: true == 96000 + if (text.compare("false", Qt::CaseInsensitive) == 0) return 0; // legacy bool: false == 95238 + bool ok = false; + int value = text.toInt(&ok); + if (ok && value >= 0 && value <= 2) return value; // current int: 0/1/2 + return defaultValue; +} + +QString map65RuntimeFile(QString const& dataDir, QString const& fileName) +{ + return QDir {dataDir}.absoluteFilePath(fileName); +} + +QString map65RuntimeSourceFile(QString const& appDir, QString const& installedDataDir, + QString const& writableDataDir, QString const& fileName) +{ + QString const writablePath = map65RuntimeFile(writableDataDir, fileName); + QString const writableCanonicalPath = QFileInfo {writablePath}.canonicalFilePath(); + auto const candidates = runtimeSourceCandidates(appDir, installedDataDir, fileName); + for (auto const& sourcePath : candidates) { + QFileInfo sourceInfo {sourcePath}; + if (!sourceInfo.exists() || !sourceInfo.isFile() || sourceInfo.size() == 0) { + continue; + } + if (sourceInfo.absoluteFilePath() == writablePath + || (!writableCanonicalPath.isEmpty() + && sourceInfo.canonicalFilePath() == writableCanonicalPath)) { + continue; + } + return sourceInfo.absoluteFilePath(); + } + + return candidates.front(); +} + +QString ensureMap65RuntimeFile(QString const& appDir, QString const& installedDataDir, + QString const& writableDataDir, QString const& fileName) +{ + QString const writablePath = map65RuntimeFile(writableDataDir, fileName); + QFileInfo writableInfo {writablePath}; + if (writableInfo.exists() && writableInfo.size() > 0) { + return writablePath; + } + + QString const sourcePath = map65RuntimeSourceFile(appDir, installedDataDir, + writableDataDir, fileName); + QFileInfo sourceInfo {sourcePath}; + if (sourceInfo.exists() && sourceInfo.isFile() && sourceInfo.size() > 0) { + if (writableInfo.exists()) { + QFile::remove(writablePath); + } + + if (QFile::copy(sourceInfo.absoluteFilePath(), writablePath)) { + QFile::setPermissions(writablePath, QFile::ReadOwner | QFile::WriteOwner + | QFile::ReadGroup | QFile::ReadOther); + return writablePath; + } + + qWarning() << "Unable to migrate MAP65 runtime file from" << sourcePath + << "to" << writablePath; + } + + return writablePath; +} diff --git a/map65/runtime_paths.h b/map65/runtime_paths.h new file mode 100644 index 00000000..4c786c4a --- /dev/null +++ b/map65/runtime_paths.h @@ -0,0 +1,24 @@ +#ifndef MAP65_RUNTIME_PATHS_H +#define MAP65_RUNTIME_PATHS_H + +#include + +class QSettings; + +QString writableMap65DataDir(); +QString map65SettingsFile(QString const& appDir, QString const& dataDir); +QString map65RuntimeFile(QString const& dataDir, QString const& fileName); +QString map65RuntimeSourceFile(QString const& appDir, QString const& installedDataDir, + QString const& writableDataDir, QString const& fileName); +QString ensureMap65RuntimeFile(QString const& appDir, QString const& installedDataDir, + QString const& writableDataDir, QString const& fileName); + +// Reads the "FSam96000" key (expected to already be scoped, e.g. via +// settings.beginGroup("Common") / SettingsGroup) as text and interprets it +// under both conventions that have shared a single map65.ini across +// versions: legacy MAP65 stored this as a bool (true==96000, false==95238); +// current MAP65 stores it as an integer (0==95238, 1==96000, 2==192000). +// Returns defaultValue if the stored text doesn't match either convention. +int readFSam96000(QSettings const& settings, int defaultValue = 1); + +#endif diff --git a/map65/soundin.cpp b/map65/soundin.cpp index ff233d20..ee1886e8 100644 --- a/map65/soundin.cpp +++ b/map65/soundin.cpp @@ -10,7 +10,6 @@ #include #endif -#define NFFT 32768 #define FRAMES_PER_BUFFER 1024 #include @@ -50,6 +49,7 @@ extern "C" int a2dCallback(const void* inputBuffer, void* outputBuffer, } if (udata->bzero) { // Start of a new minute + advance_live_input_generation(); udata->kin = 0; // Reset buffer pointer udata->bzero = false; } @@ -114,6 +114,14 @@ extern "C" int a2dCallback(const void* inputBuffer, void* outputBuffer, namespace { + constexpr int symspecLookaheadSamples = 512; + + int symspecReadyPointer(int acquiredSamples) + { + // symspec's final 1024-sample window extends one 512-sample hop past k. + return acquiredSamples - symspecLookaheadSamples; + } + struct COMWrapper { explicit COMWrapper () @@ -173,7 +181,7 @@ void SoundInThread::run() //SoundInThread::run() inParam.suggestedLatency=device_info->defaultHighInputLatency; inParam.hostApiSpecificStreamInfo=NULL; - paerr=Pa_IsFormatSupported(&inParam,NULL,96000.0); + paerr=Pa_IsFormatSupported(&inParam,NULL,double(g_sampleRate)); if(paerr<0) { QString error_message; if (paUnanticipatedHostError == paerr) @@ -191,7 +199,7 @@ void SoundInThread::run() //SoundInThread::run() &inStream, &inParam, NULL, - 96000.0, + double(g_sampleRate), FRAMES_PER_BUFFER, paClipOff, a2dCallback, @@ -208,47 +216,44 @@ void SoundInThread::run() //SoundInThread::run() int k=0; int nsec; int ntr; - int nhsym0=0; + Map65HalfSymbolScheduler spectrumScheduler; //---------------------------------------------- Soundcard input loop while (!qe) { qe = quitExecution; if (qe) break; + qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000; - nsec = ms/1000; // Time according to this computer + nsec = ms/1000; ntr = nsec % m_TRperiod; -// Reset buffer pointer and symbol number at start of minute if(ntr < ntr0 or !m_monitoring or m_TRperiod!=m_TRperiod0) { - nhsym0=0; + spectrumScheduler.reset (); udata.bzero=true; m_TRperiod0=m_TRperiod; } + k=udata.kin; + udata.iqswap= (m_IQswap != 0); udata.dB=m_dB; + if(m_monitoring) { - double fcenter; - if(m_bForceCenterFreq) { - fcenter = m_dForceCenterFreq; - } else { - fcenter = 144.125; // default center - } + double fcenter = m_bForceCenterFreq ? m_dForceCenterFreq : 144.125; set_fcenter(fcenter); - m_hsym=(k-2048)*11025.0/(2048.0*m_rate); - if(m_hsym != nhsym0) { - if(m_dataSinkBusy) { - } else { - m_dataSinkBusy=true; - emit readyForFFT(k); //Signal to compute new FFTs - } - nhsym0=m_hsym; + int const fftPointer=symspecReadyPointer(k); + m_hsym=(fftPointer-2048)*11025.0/(2048.0*m_rate); + + if (spectrumScheduler.claim_next (m_hsym, m_dataSinkBusy)) { + emit readyForFFT(fftPointer); } } + msleep(100); ntr0=ntr; } + Pa_StopStream(inStream); Pa_CloseStream(inStream); } @@ -304,12 +309,15 @@ void SoundInThread::setNetwork(bool b) //setNetwork() void SoundInThread::setMonitoring(bool b) //setMonitoring() { m_monitoring = b; + qDebug() << "m_monitoring set to" << m_monitoring << "at" << Q_FUNC_INFO; + } void SoundInThread::setForceCenterFreqBool(bool b) { m_bForceCenterFreq=b; + } void SoundInThread::setForceCenterFreqMHz(double d) @@ -368,7 +376,7 @@ void SoundInThread::inputUDP() int k=0; int nsec; int ntr; - int nhsym0=0; + Map65HalfSymbolScheduler spectrumScheduler; int iz=174; // Main loop for input of UDP packets over the network: @@ -390,8 +398,9 @@ void SoundInThread::inputUDP() // Reset buffer pointer and symbol number at start of minute if(ntr < ntr0 or !m_monitoring or m_TRperiod!=m_TRperiod0) { + advance_live_input_generation(); k=0; - nhsym0=0; + spectrumScheduler.reset (); m_TRperiod0=m_TRperiod; } ntr0=ntr; @@ -404,7 +413,7 @@ void SoundInThread::inputUDP() if(m_nrx == -2) iz=87; // Two RF channels, r*4 data // If buffer will not overflow, move data into datcom_ - if ((k+iz) <= 60*96000) { + if ((k + iz) <= 60 * m_rate) { int nsam=-1; recvpkt_(&nsam, &b.iblk, &b.nrx, &k, b.d8, b.d8, b.d8); double fcenter; @@ -416,18 +425,11 @@ void SoundInThread::inputUDP() set_fcenter(fcenter); } -m_hsym = (k-2048)*11025.0/(2048.0*m_rate); -if (m_hsym != nhsym0) { - if (m_dataSinkBusy) { - } else { - m_dataSinkBusy = true; - - QDateTime now = QDateTime::currentDateTime(); - QString ts = now.toString("yyyy-MM-dd hh:mm:ss.zzz"); - - emit readyForFFT(k); - } - nhsym0 = m_hsym; +double hsym = 2048.0 * m_rate / 11025.0; +int const fftPointer=symspecReadyPointer(k); +m_hsym = (fftPointer - 2048) / hsym; +if (spectrumScheduler.claim_next (m_hsym, m_dataSinkBusy)) { + emit readyForFFT(fftPointer); } } diff --git a/map65/soundin.h b/map65/soundin.h index 7dc78839..0f45acea 100644 --- a/map65/soundin.h +++ b/map65/soundin.h @@ -4,8 +4,11 @@ #include #include #include +#include #include +#include "half_symbol_scheduler.h" + class MainWindow; //Forward declaration // Thread gets audio data from soundcard and signals when a buffer of @@ -21,7 +24,7 @@ protected: virtual void run(); public: - bool m_dataSinkBusy; + std::atomic_bool m_dataSinkBusy; SoundInThread(): quitExecution(false), diff --git a/map65/soundout.cpp b/map65/soundout.cpp index 0828afe4..baa0d129 100644 --- a/map65/soundout.cpp +++ b/map65/soundout.cpp @@ -7,7 +7,7 @@ #include extern float gran(); -extern short int (&iwave)[2*60*12000]; +extern short int iwave[2*60*12000]; //was 11025 extern int nwave; extern bool btxok; extern bool bTune; @@ -37,24 +37,17 @@ extern "C" int d2aCallback(const void * /*inputBuffer*/, void *outputBuffer, // step is ~0.229 for 48k ASIO, and exactly 1.0 for 11k MME // Calculate step once outside the loop - double step = 11025.0 / udata->streamSampleRate; - - // Debug: Check this value in your console once to ensure it's ~0.229 for ASIO - static bool debugOnce = true; - if(debugOnce) { - qDebug() << "Stream Rate:" << udata->streamSampleRate << "Step:" << step; - qDebug() << "channels:" << channels; - debugOnce = false; - } - + double step = 11025.0 / udata->streamSampleRate; + const int waveCapacity = sizeof(iwave) / sizeof(iwave[0]); static double ic_exact = 0.0; static bool btxok0 = false; static bool bTune0 = false; static int nStart = 0; static double phi = 0.; - - double tsec, tstart, dphi; + + double tsec, tstart; + double dphi = 0.0; int nsec; int nTRperiod = udata->nTRperiod; @@ -68,9 +61,9 @@ extern "C" int d2aCallback(const void * /*inputBuffer*/, void *outputBuffer, qreal yAmp = txPower * 295.00 * amp; static int nsec0 = 0; - if(bTune) { + if(bTune) { ic_exact = 0; - // CHANGE: Use the actual stream sample rate, not 11025 + // Use the actual stream sample rate, not 11025 dphi = 6.28318530718 * 1270.46 / udata->streamSampleRate; } @@ -104,34 +97,27 @@ extern "C" int d2aCallback(const void * /*inputBuffer*/, void *outputBuffer, short int i2a = 0; short int i2b = 0; - // 2. Linear Interpolation to clean up the noise -if (btxok && (2 * i1 + 1) < 1440000) { + int i0a = 2 * i0; + int i0b = i0a + 1; + int i1a = 2 * i1; + int i1b = i1a + 1; + bool haveWaveformSample = i1b < nwave && i1b < waveCapacity; - // Interpolate message waveform - qreal I = (1.0 - frac) * iwave[2*i0] + frac * iwave[2*i1]; - qreal Q = (1.0 - frac) * iwave[2*i0 + 1] + frac * iwave[2*i1 + 1]; + if(btxok && (bTune || haveWaveformSample)) { - if (bTune) { - // --- TUNE MODE (unchanged) --- + if(bTune) { phi += dphi; - I = xAmp * qCos(phi); - Q = yAmp * qSin(phi + dPhase); - - } else { - // --- MESSAGE TX: scale using the Tune slider percentage --- - qreal gain = txPower / 100.0; // 0.0 ? 1.0 - - I *= gain; - Q *= gain; + } else { + // 2. Linear Interpolation to clean up the noise + // Blend current sample (i0) and next sample (i1) based on frac + i2a = (short int)((1.0 - frac) * iwave[i0a] + frac * iwave[i1a]); + i2b = (short int)((1.0 - frac) * iwave[i0b] + frac * iwave[i1b]); + phi = qAtan2(qreal(i2b), qreal(i2a)); + } + i2a = xAmp * qCos(phi); + i2b = yAmp * qSin(phi + dPhase); } - // Clamp to 16-bit - i2a = short(qBound(-32768.0, I, 32767.0)); - i2b = short(qBound(-32768.0, Q, 32767.0)); -} - - - *wptr++ = i2b; // Left *wptr++ = i2a; // Right diff --git a/map65/widegraph.cpp b/map65/widegraph.cpp index 40b650f2..ff3650b0 100644 --- a/map65/widegraph.cpp +++ b/map65/widegraph.cpp @@ -10,8 +10,9 @@ #include #include "SettingsGroup.hpp" #include "ui_widegraph.h" +#include "globals.h" -#define NFFT 32768 +extern int g_sampleRate; WideGraph::WideGraph (QString const& settings_filename, QWidget * parent) : QDialog {parent}, @@ -44,8 +45,20 @@ WideGraph::WideGraph (QString const& settings_filename, QWidget * parent) int n = settings.value("FreqSpan",60).toInt(); int w = settings.value("PlotWidth",1000).toInt(); ui->freqSpanSpinBox->setValue(n); + + if (g_sampleRate == 96000 || g_sampleRate == 95238) + setFreqSpanLimits(60, 90); + else + setFreqSpanLimits(60, 190); + updateSpanFromSpinbox(); + + extern int g_sampleRate; // at top of widegraph.cpp ui->widePlot->setNSpan(n); - int nbpp = n * 32768.0/(w*96.0) + 0.5; + double sr_kHz = g_sampleRate / 1000.0; // 96.0 or 192.0 + int sr_display = int(sr_kHz + 0.5); + ui->srValueLabel->setText(QString::number(sr_display)); + int nbpp = int(n * g_activeNfft / (w * sr_kHz) + 0.5); + if (nbpp < 1) nbpp = 1; // safety ui->widePlot->setBinsPerPixel(nbpp); m_waterfallAvg = settings.value("WaterfallAvg",10).toInt(); ui->waterfallAvgSpinBox->setValue(m_waterfallAvg); @@ -172,6 +185,7 @@ void WideGraph::resizeEvent(QResizeEvent* ) //resizeEvent() int w = size().width(); int h = size().height(); ui->labFreq->setGeometry(QRect(w-256,h-100,227,41)); + updateSpanFromSpinbox(); } void WideGraph::saveSettings() @@ -211,7 +225,7 @@ void WideGraph::addDecodeLabel(double freq_khz, const QString& callsign, lab.last_seen_ms = now; // Only overwrite freq when the caller has sub-kHz precision. // The "&" bandmap tap only has 3-char integer-kHz precision - // (display.f90 cfreq0 is character(3) — no ndf field), so it + // (display.f90 cfreq0 is character(3) � no ndf field), so it // would otherwise stomp on a precise "!" tick that already // includes ndf, leaving the tick up to ~500 Hz off the signal. if (freq_reliable) lab.freq_khz = freq_khz; @@ -309,9 +323,9 @@ void WideGraph::setDecodeLabelPosition(DecodeLabelPosition p) } void WideGraph::dataSink2(float s[], int nkhz, int ihsym, int ndiskdata, - uchar lstrong[]) + uchar lstrong[], int lstrongSize) { - static float splot[NFFT]; + static std::vector splot; float swide[2048]; float smax; double df; @@ -319,7 +333,10 @@ void WideGraph::dataSink2(float s[], int nkhz, int ihsym, int ndiskdata, static int n=0; static int nkhz0=-999; static int ntrz=0; - df = m_fSample/32768.0; + + if ((int)splot.size() != g_activeNfft) + splot.assign(g_activeNfft, 0.0f); + df = double(g_sampleRate) / double(g_activeNfft); if(nkhz != nkhz0) { ui->widePlot->setNkhz(nkhz); //Why do we need both? ui->widePlot->SetCenterFreq(nkhz); //Why do we need both? @@ -329,35 +346,59 @@ void WideGraph::dataSink2(float s[], int nkhz, int ihsym, int ndiskdata, //Average spectra over specified number, m_waterfallAvg if (n==0) { - for (int i=0; i=m_waterfallAvg) { - for (int i=0; iwidePlot->plotWidth(); qint64 sf = nkhz + ui->widePlot->freqOffset() - 0.5*w*nbpp*df/1000.0; - if(sf != ui->widePlot->startFreq()) ui->widePlot->SetStartFreq(sf); - int i0=16384.0+(ui->widePlot->startFreq()-nkhz+1.27046+0.001*m_fCal) * - 1000.0/df + 0.5; + if (sf != ui->widePlot->startFreq()) + ui->widePlot->SetStartFreq(sf); + + int i0 = (g_activeNfft/2) + + (ui->widePlot->startFreq() - nkhz + 1.27046 + 0.001*m_fCal) * 1000.0/df + + 0.5; + + // Clamp i0 into [0, g_activeNfft-1] + if (i0 < 0) i0 = 0; + if (i0 > g_activeNfft-1) i0 = g_activeNfft-1; + int i=i0; - for (int j=0; j<2048; j++) { - smax=0; - for (int k=0; k 0 ? maxBins / nbpp : 0; + if (maxCols > 2048) maxCols = 2048; + + for (int j = 0; j < maxCols; ++j) { + smax = 0.0f; + for (int k = 0; k < nbpp; ++k) { + ++i; + if (i >= g_activeNfft) break; if(splot[i]>smax) smax=splot[i]; } swide[j]=smax; - if(lstrong[1 + i/32]!=0) swide[j]=-smax; //Tag strong signals + + int binsPerStrongFlag = std::max(1, g_activeNfft / lstrongSize); + int li = 1 + i / binsPerStrongFlag; + if (li >= 0 && li < lstrongSize && lstrong[li] != 0) + swide[j] = -smax; } + // Optionally zero any remaining swide entries if j < 2048 + for (int j = maxCols; j < 2048; ++j) + swide[j] = 0.0f; + + // Time according to this computer qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000; int ntr = (ms/1000) % m_TRperiod; @@ -366,12 +407,12 @@ void WideGraph::dataSink2(float s[], int nkhz, int ihsym, int ndiskdata, for (int i=0; i<2048; i++) { swide[i] = 1.e30; } - for (int i=0; i<32768; i++) { + for (int i=0; iwidePlot->draw(swide,i0,splot); + ui->widePlot->draw(swide,i0,splot.data()); } } @@ -380,15 +421,19 @@ void WideGraph::on_freqOffsetSpinBox_valueChanged(int f) ui->widePlot->SetFreqOffset(f); } -void WideGraph::on_freqSpanSpinBox_valueChanged(int n) +void WideGraph::on_freqSpanSpinBox_valueChanged(int) { - ui->widePlot->setNSpan(n); - int w = ui->widePlot->plotWidth(); - int nbpp = n * 32768.0/(w*96.0) + 0.5; - if(nbpp < 1) nbpp=1; - if(w > 0) { - ui->widePlot->setBinsPerPixel(nbpp); - } + updateSpanFromSpinbox(); +} + +void WideGraph::setFreqSpanLimits(int min, int max) +{ + ui->freqSpanSpinBox->setMinimum(min); + ui->freqSpanSpinBox->setMaximum(max); + + int v = ui->freqSpanSpinBox->value(); + if (v < min) ui->freqSpanSpinBox->setValue(min); + if (v > max) ui->freqSpanSpinBox->setValue(max); } void WideGraph::on_waterfallAvgSpinBox_valueChanged(int n) @@ -491,11 +536,6 @@ void WideGraph::setPalette(QString palette) { ui->widePlot->setPalette(palette); } -void WideGraph::setFsample(int n) -{ - m_fSample=n; - ui->widePlot->setFsample(n); -} void WideGraph::setMode65(int n) { @@ -607,3 +647,21 @@ void WideGraph::enableSetRxHardware(bool b) { ui->pbSetRxHardware->setEnabled(b); } + +void WideGraph::updateSpanFromSpinbox() +{ + int n = ui->freqSpanSpinBox->value(); + + // Update NSpan + ui->widePlot->setNSpan(n); + + // Recompute bins-per-pixel + int w = ui->widePlot->plotWidth(); + int nbpp = int(n * g_activeNfft / (w * (g_sampleRate / 1000.0)) + 0.5); + if (nbpp < 1) nbpp = 1; + + if (w > 0) + ui->widePlot->setBinsPerPixel(nbpp); +} + + diff --git a/map65/widegraph.h b/map65/widegraph.h index 81f804a3..e96cb2c2 100644 --- a/map65/widegraph.h +++ b/map65/widegraph.h @@ -21,7 +21,7 @@ public: ~WideGraph(); void dataSink2(float s[], int nkhz, int ihsym, int ndiskdata, - uchar lstrong[]); + uchar lstrong[], int lstrongSize); int QSOfreq(); int nSpan(); int nStartFreq(); @@ -33,7 +33,6 @@ public: void setTol(int n); void setFcal(int n); void setPalette(QString palette); - void setFsample(int n); void setMode65(int n); void setPeriod(int n); void setDecodeFinished(); @@ -42,6 +41,9 @@ public: void tx570(); void updateFreqLabel(); void enableSetRxHardware(bool b); + void setFreqSpanLimits(int min, int max); + void updateSpanFromSpinbox(); + // Decoded-callsign overlay (N6NU 2026-05-12, port of QMAP feature). // mainwindow calls addDecodeLabel for each decoded line (after @@ -125,7 +127,6 @@ private: bool m_bIQxt; qint32 m_waterfallAvg; qint32 m_fCal; - qint32 m_fSample; qint32 m_mode65; qint32 m_TRperiod=60; diff --git a/map65/widegraph.ui b/map65/widegraph.ui index 38f90d47..ca14671a 100644 --- a/map65/widegraph.ui +++ b/map65/widegraph.ui @@ -74,6 +74,32 @@ Tx: 144.127.317 + + + + SR + + + Qt::AlignRight|Qt::AlignVCenter + + + + + + + + 30 + 0 + + + + 96 + + + Qt::AlignLeft|Qt::AlignVCenter + + + @@ -157,7 +183,7 @@ Tx: 144.127.317 5 - 90 + 190 5 diff --git a/map65/wsjt.ico b/map65/wsjt.ico index 8a55550f..3f736a9c 100644 Binary files a/map65/wsjt.ico and b/map65/wsjt.ico differ diff --git a/models/DecodeHighlightingModel.cpp b/models/DecodeHighlightingModel.cpp index 7c884b18..ab504268 100644 --- a/models/DecodeHighlightingModel.cpp +++ b/models/DecodeHighlightingModel.cpp @@ -166,10 +166,21 @@ auto DecodeHighlightingModel::items () const -> HighlightItems const& void DecodeHighlightingModel::items (HighlightItems const& items) { + if (items.size () != m_->data_.size ()) + { + beginResetModel (); + m_->data_ = items; + endResetModel (); + return; + } + m_->data_ = items; - QVector roles; - roles << Qt::CheckStateRole << Qt::ForegroundRole << Qt::BackgroundRole; - Q_EMIT dataChanged (index (0, 0), index (rowCount () - 1, 0), roles); + if (!m_->data_.isEmpty ()) + { + QVector roles; + roles << Qt::DisplayRole << Qt::CheckStateRole << Qt::ForegroundRole << Qt::BackgroundRole << TypeRole; + Q_EMIT dataChanged (index (0, 0), index (rowCount () - 1, 0), roles); + } } void DecodeHighlightingModel::set_font (QFont const& font) diff --git a/models/FrequencyList.cpp b/models/FrequencyList.cpp index a0d22942..cc6ed129 100644 --- a/models/FrequencyList.cpp +++ b/models/FrequencyList.cpp @@ -71,6 +71,7 @@ namespace {1839000, Modes::JT9, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {1839000, Modes::FST4, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {1840000, Modes::FT8, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, + {1838000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY frequency // Band plans (all USB dial unless stated otherwise) // @@ -107,6 +108,7 @@ namespace {3568600, Modes::FST4W, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, // needs guard marker and lock out {3575000, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // provisional {3568000, Modes::FT4, IARURegions::R3, "","", QDateTime(), QDateTime(), false}, // provisional + {3575000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // stays under R3's narrow DM segment (documented above as ending at 3575-3580) even with the 1500 Hz audio offset added {5357000, Modes::JT65, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, // provisional {5357000, Modes::JT9, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, // provisional @@ -153,6 +155,7 @@ namespace {7047500, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // provisional - moved // up 500Hz to clear // W1AW code practice QRG + {7090000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY freq + 10 kHz // Band plans (all USB dial unless stated otherwise) // @@ -187,6 +190,7 @@ namespace {10138700, Modes::FST4W, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {10140000, Modes::JT9, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {10140000, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // provisional + {10140000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY frequency; band's upper edge (10150) leaves no room for the usual +10 kHz nudge // Band plans (all USB dial unless stated otherwise) // @@ -215,7 +219,7 @@ namespace // 14105.5 OLIVIA 1000 // 14106.5 OLIVIA 1000 (main QRG) // - // R3: 14070 - 14112 DM NB(<2000Hz) with ±500Hz IBP guard band at 14100 + // R3: 14070 - 14112 DM NB(<2000Hz) with +/-500 Hz IBP guard band at 14100 // // 14070 PSK31 // 14074.4 OLIVIA, Contestia, etc. @@ -232,6 +236,7 @@ namespace {14076000, Modes::JT65, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {14078000, Modes::JT9, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {14080000, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // provisional + {14090000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY freq + 10 kHz // Band plans (all USB dial unless stated otherwise) @@ -254,7 +259,7 @@ namespace // 18105 - 18110 Packet // 18110 NCDXF beacons // - // R3: 18095 - 18120 DM NB(<2000Hz) with ±500Hz IBP guard band at 18110 + // R3: 18095 - 18120 DM NB(<2000Hz) with +/-500 Hz IBP guard band at 18110 // // 18100 PSK31 // 18103.4 OLIVIA, Contestia, etc. (main QRG) @@ -268,6 +273,7 @@ namespace {18104000, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // provisional {18104600, Modes::WSPR, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {18104600, Modes::FST4W, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, + {18100000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY frequency; +10 kHz would put the 1500 Hz-offset signal past the US data segment's 18110 kHz edge (and onto the NCDXF beacon frequency) {21074000, Modes::FT8, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, {21091000, Modes::FT8, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, // DXpedition @@ -276,6 +282,7 @@ namespace {21094600, Modes::WSPR, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {21094600, Modes::FST4W, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {21140000, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, + {21090000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY freq + 10 kHz {24911000, Modes::FT8, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, // DXpedition {24915000, Modes::FT8, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, @@ -284,6 +291,7 @@ namespace {24919000, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // provisional {24924600, Modes::WSPR, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {24924600, Modes::FST4W, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, + {24920000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY frequency; the US narrow data segment (24920-24925) leaves no room for the usual +10 kHz nudge once the 1500 Hz audio offset is added {28074000, Modes::FT8, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, {28091000, Modes::FT8, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, // DXpedition @@ -292,6 +300,7 @@ namespace {28124600, Modes::WSPR, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {28124600, Modes::FST4W, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {28180000, Modes::FT4, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, + {28090000, Modes::JTTY, IARURegions::ALL, "","", QDateTime(), QDateTime(), true}, // conventional RTTY freq + 10 kHz {50200000, Modes::Echo, IARURegions::ALL, "","", QDateTime(), QDateTime(), false}, {50211000, Modes::Q65, IARURegions::ALL, "EME","", QDateTime(), QDateTime(), false}, @@ -1040,15 +1049,21 @@ void FrequencyList_v2_101::impl::unprefer_all_but(Item &item, int const item_row bool FrequencyList_v2_101::impl::setData (QModelIndex const& model_index, QVariant const& value, int role) { bool changed {false}; - auto const& row = model_index.row (); + auto const row = model_index.row (); + + if (!model_index.isValid () + || row < 0 + || row >= frequency_list_.size ()) + { + return false; + } + auto& item = frequency_list_[row]; QVector roles; roles << role; - if (model_index.isValid () - && Qt::CheckStateRole == role - && row < frequency_list_.size () + if (Qt::CheckStateRole == role && model_index.column () == preferred_column) { bool b_val = ((Qt::CheckState)value.toInt() == Qt::Checked); @@ -1064,9 +1079,7 @@ bool FrequencyList_v2_101::impl::setData (QModelIndex const& model_index, QVaria } } - if (model_index.isValid () - && Qt::EditRole == role - && row < frequency_list_.size ()) + if (Qt::EditRole == role) { switch (model_index.column()) { @@ -1096,9 +1109,10 @@ bool FrequencyList_v2_101::impl::setData (QModelIndex const& model_index, QVaria case frequency_column: { - if (value.canConvert()) + bool ok; + Radio::Frequency frequency{value.toULongLong (&ok)}; + if (ok && frequency) { - Radio::Frequency frequency{qvariant_cast(value)}; if (frequency != item.frequency_) { item.frequency_ = frequency; diff --git a/models/Modes.cpp b/models/Modes.cpp index 966665bb..da6e6dbd 100644 --- a/models/Modes.cpp +++ b/models/Modes.cpp @@ -25,7 +25,8 @@ namespace "FT4", "FST4", "FST4W", - "Q65" + "Q65", + "JTTY" }; std::size_t constexpr mode_names_size = sizeof (mode_names) / sizeof (mode_names[0]); } diff --git a/models/Modes.hpp b/models/Modes.hpp index 675f097e..31ea163b 100644 --- a/models/Modes.hpp +++ b/models/Modes.hpp @@ -51,6 +51,7 @@ public: FST4, FST4W, Q65, + JTTY, MODES_END_SENTINAL_AND_COUNT // this must be last }; Q_ENUM (Mode) diff --git a/models/StationList.cpp b/models/StationList.cpp index 2b501259..308acf4e 100644 --- a/models/StationList.cpp +++ b/models/StationList.cpp @@ -412,9 +412,10 @@ bool StationList::impl::setData (QModelIndex const& model_index, QVariant const& case offset_column: { - if (value.canConvert ()) + bool ok; + FrequencyDelta offset {value.toLongLong (&ok)}; + if (ok) { - FrequencyDelta offset {qvariant_cast (value)}; if (offset != stations_[row].offset_) { stations_[row].offset_ = offset; diff --git a/models/models.pri b/models/models.pri deleted file mode 100644 index 5b3d038b..00000000 --- a/models/models.pri +++ /dev/null @@ -1,20 +0,0 @@ -SOURCES += \ - models/Bands.cpp \ - models/FrequencyList.cpp \ - models/StationList.cpp \ - models/Modes.cpp \ - models/IARURegions.cpp \ - models/FoxLog.cpp \ - models/CabrilloLog.cpp \ - models/DecodeHighlightingModel.cpp - -HEADERS += \ - models/Bands.hpp \ - models/FrequencyList.hpp \ - models/StationList.hpp \ - models/Modes.hpp \ - models/IARURegions.hpp \ - models/FoxLog.hpp \ - models/CabrilloLog.hpp \ - models/FontOverrideModel.hpp \ - models/DecodeHighlightingModel.hpp diff --git a/qcustomplot-source/qcustomplot.cpp b/qcustomplot-source/qcustomplot.cpp index 375fc57a..9ae3a4f6 100644 --- a/qcustomplot-source/qcustomplot.cpp +++ b/qcustomplot-source/qcustomplot.cpp @@ -667,7 +667,7 @@ QCPPaintBufferPixmap::~QCPPaintBufferPixmap() QCPPainter *QCPPaintBufferPixmap::startPainting() { QCPPainter *result = new QCPPainter(&mBuffer); - result->setRenderHint(QPainter::HighQualityAntialiasing); + result->setRenderHint(QPainter::Antialiasing); return result; } @@ -755,7 +755,7 @@ QCPPainter *QCPPaintBufferGlPbuffer::startPainting() } QCPPainter *result = new QCPPainter(mGlPBuffer); - result->setRenderHint(QPainter::HighQualityAntialiasing); + result->setRenderHint(QPainter::Antialiasing); return result; } @@ -860,7 +860,7 @@ QCPPainter *QCPPaintBufferGlFbo::startPainting() mGlContext.data()->makeCurrent(mGlContext.data()->surface()); mGlFrameBuffer->bind(); QCPPainter *result = new QCPPainter(mGlPaintDevice.data()); - result->setRenderHint(QPainter::HighQualityAntialiasing); + result->setRenderHint(QPainter::Antialiasing); return result; } @@ -14465,7 +14465,7 @@ void QCustomPlot::paintEvent(QPaintEvent *event) QCPPainter painter(this); if (painter.isActive()) { - painter.setRenderHint(QPainter::HighQualityAntialiasing); // to make Antialiasing look good if using the OpenGL graphicssystem + painter.setRenderHint(QPainter::Antialiasing); // to make Antialiasing look good if using the OpenGL graphicssystem if (mBackgroundBrush.style() != Qt::NoBrush) painter.fillRect(mViewport, mBackgroundBrush); drawBackground(&painter); @@ -20872,11 +20872,9 @@ void QCPGraph::getOptimizedScatterData(QVector *scatterData, QCPGr */ void QCPGraph::getVisibleDataBounds(QCPGraphDataContainer::const_iterator &begin, QCPGraphDataContainer::const_iterator &end, const QCPDataRange &rangeRestriction) const { - if (rangeRestriction.isEmpty()) - { - end = mDataContainer->constEnd(); - begin = end; - } else + end = mDataContainer->constEnd(); + begin = end; + if (!rangeRestriction.isEmpty()) { QCPAxis *keyAxis = mKeyAxis.data(); QCPAxis *valueAxis = mValueAxis.data(); @@ -29785,5 +29783,3 @@ QPen QCPItemBracket::mainPen() const return mSelected ? mSelectedPen : mPen; } /* end of 'src/items/item-bracket.cpp' */ - - diff --git a/qmake_only/scs_version.h b/qmake_only/scs_version.h deleted file mode 100644 index 3712dbb5..00000000 --- a/qmake_only/scs_version.h +++ /dev/null @@ -1,4 +0,0 @@ -/* This is a dummy file required to make the qmake build compatible - with the CMake build. */ - -#define STRINGIZE__(X) diff --git a/qmake_only/svnversion.h b/qmake_only/svnversion.h deleted file mode 100644 index 3f14daf7..00000000 --- a/qmake_only/svnversion.h +++ /dev/null @@ -1,4 +0,0 @@ -/* This is a dummy file required to make the qmake build compatible - with the CMake build. */ - -#define WSJTX_STRINGIZE(X) diff --git a/qmap/CMakeLists.txt b/qmap/CMakeLists.txt index 81f710dc..4a4e43ba 100644 --- a/qmap/CMakeLists.txt +++ b/qmap/CMakeLists.txt @@ -2,8 +2,10 @@ set (qmap_CXXSRCS about.cpp astro.cpp devsetup.cpp + decode_click_coalescer.cpp displaytext.cpp getfile.cpp + livecq_parser.cpp main.cpp mainwindow.cpp meterwidget.cpp @@ -11,6 +13,8 @@ set (qmap_CXXSRCS runtime_paths.cpp signalmeter.cpp soundin.cpp + vertwaterfall.cpp + vplotter.cpp widegraph.cpp ) @@ -23,6 +27,7 @@ set (qmap_UISRCS astro.ui devsetup.ui mainwindow.ui + vertwaterfall.ui widegraph.ui ) @@ -39,7 +44,13 @@ add_subdirectory (libqmap) # UI generation qt5_wrap_ui (qmap_GENUISRCS ${qmap_UISRCS}) -add_executable (qmap ${qmap_CXXSRCS} ${qmap_CSRCS} ${qmap_GENUISRCS} qmap.rc) +# windres doesn't track a .rc file's ICON directive as a dependency, so an icon-only edit needs this to trigger a rebuild. +set_property (SOURCE qmap.rc APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/wsjt.ico) + +# Resource generation (About dialog logo + GPL logo) +qt5_add_resources (qmap_RESOURCES_RCC about.qrc) + +add_executable (qmap ${qmap_CXXSRCS} ${qmap_CSRCS} ${qmap_GENUISRCS} ${qmap_RESOURCES_RCC} qmap.rc) target_include_directories (qmap PRIVATE ${CMAKE_SOURCE_DIR} ${FFTW3_INCLUDE_DIRS}) target_link_libraries (qmap wsjt_qt qmap_impl ${FFTW3_LIBRARIES} Qt5::Widgets Qt5::Network Usb::Usb) diff --git a/qmap/about.cpp b/qmap/about.cpp index 7ee4adcb..62374325 100644 --- a/qmap/about.cpp +++ b/qmap/about.cpp @@ -7,14 +7,21 @@ CAboutDlg::CAboutDlg(QWidget *parent) : ui(new Ui::CAboutDlg) { ui->setupUi(this); - ui->labelTxt->setText("

" + QString {"QMAP v" + ui->labelTxt->setText("

" + QString {"QMAP™ v" + QCoreApplication::applicationVersion ()+ " " + revision ()}.simplified () + "

" - "QMAP is a wideband receiver for the Q65 protocol, intended
" + "QMAP™ is a wideband receiver for the Q65 protocol, intended
" "primarily for amateur radio EME communication. It works
" - "in close cooperation with WSJT-X versions 2.7.0 and later.

" - "Copyright 2001-2026 by Joe Taylor, K1JT., and the WSJT
" - "Development Group.
"); + "in close cooperation with WSJT-X™ versions 2.7.0 and later.

" + "Copyright 2001-2026 by Joe Taylor, K1JT., and the WSJT™
" + "Development Team.

" + "QMAP is licensed under the terms of Version 3
" + "of the GNU General Public License (GPL)

" + "" + "" + "" + "
" + "https://www.gnu.org/licenses/gpl-3.0.txt
"); } CAboutDlg::~CAboutDlg() diff --git a/qmap/about.qrc b/qmap/about.qrc new file mode 100644 index 00000000..9520adbc --- /dev/null +++ b/qmap/about.qrc @@ -0,0 +1,6 @@ + + + about_icon.png + ../contrib/gpl-v3-logo.svg + + diff --git a/qmap/about.ui b/qmap/about.ui index dbcd8651..614f25d6 100644 --- a/qmap/about.ui +++ b/qmap/about.ui @@ -5,22 +5,8 @@ Qt::NonModal - - - 0 - 0 - 374 - 164 - - - - - 0 - 0 - - - About QMAP + About QMAP™ @@ -28,6 +14,12 @@ + + Qt::AlignCenter + + + true + diff --git a/qmap/about_icon.png b/qmap/about_icon.png new file mode 100644 index 00000000..11026fa2 Binary files /dev/null and b/qmap/about_icon.png differ diff --git a/qmap/commons.h b/qmap/commons.h index d62a9570..0b8c10d0 100644 --- a/qmap/commons.h +++ b/qmap/commons.h @@ -1,6 +1,8 @@ #ifndef COMMONS_H #define COMMONS_H +#include "qmap_ipc.h" + #define NFFT 32768 extern "C" { @@ -87,19 +89,8 @@ extern struct { //This is "common/datcom/..." in Fortran bool bAlso30; //Process for 30-second submode as well as 60-second } datcom2_; -extern struct { - int ndecodes; //These are flags for inter-process communication - int ncand; //between QMAP and WSJT-X - int nQDecoderDone; //1 for real-time decodes, 2 for data from disk - int nWDecoderBusy; //Set to 1 when WSJT-X decoder is busy - int nWTransmitting; //Set to TRperiod when WSJT-X is transmitting - int kHzRequested; //Integer kHz dial frequency request to WSJT-X - char result[50][72]; //Staging area for QMAP decodes -} decodes_; - -extern struct { - char result2[50][8]; -} decodes2_; +extern qmap_decode_ipc::DecodeRows decodes_; +extern qmap_decode_ipc::LiveCqRows decodes2_; extern struct { char revision[22]; diff --git a/qmap/decode_click_coalescer.cpp b/qmap/decode_click_coalescer.cpp new file mode 100644 index 00000000..b1c2725e --- /dev/null +++ b/qmap/decode_click_coalescer.cpp @@ -0,0 +1,50 @@ +#include "decode_click_coalescer.h" + +#include + +#include +#include + +DecodeClickCoalescer::DecodeClickCoalescer (QObject * context, Dispatch dispatch, int interval) + : dispatch_ {std::move (dispatch)} +{ + timer_.setSingleShot (true); + timer_.setTimerType (Qt::PreciseTimer); + timer_.setInterval (interval >= 0 ? interval : QApplication::doubleClickInterval ()); + QObject::connect (&timer_, &QTimer::timeout, context, [this] { dispatchPending (); }); +} + +void DecodeClickCoalescer::press (QString const& identity, QByteArray const& decodeRow) +{ + // Qt reports the first press before deciding whether the gesture is a double-click. + if (timer_.isActive () && pendingIdentity_ != identity) { + timer_.stop (); + dispatchPending (); + } + dispatch_ (decodeRow, DecodeClickGesture::Press); + pendingIdentity_ = identity; + pending_ = decodeRow; + timer_.start (); +} + +void DecodeClickCoalescer::doubleClick (QString const& identity, QByteArray const& decodeRow) +{ + if (timer_.isActive ()) { + timer_.stop (); + if (pendingIdentity_ != identity) dispatchPending (); + else { + pendingIdentity_.clear (); + pending_.clear (); + } + } + dispatch_ (decodeRow, DecodeClickGesture::DoubleClick); +} + +void DecodeClickCoalescer::dispatchPending () +{ + if (pending_.isEmpty ()) return; + auto const decodeRow = pending_; + pendingIdentity_.clear (); + pending_.clear (); + dispatch_ (decodeRow, DecodeClickGesture::SingleClick); +} diff --git a/qmap/decode_click_coalescer.h b/qmap/decode_click_coalescer.h new file mode 100644 index 00000000..98a59c10 --- /dev/null +++ b/qmap/decode_click_coalescer.h @@ -0,0 +1,38 @@ +#ifndef QMAP_DECODE_CLICK_COALESCER_H +#define QMAP_DECODE_CLICK_COALESCER_H + +#include + +#include +#include +#include + +class QObject; + +enum class DecodeClickGesture +{ + Press, + SingleClick, + DoubleClick, +}; + +class DecodeClickCoalescer +{ +public: + using Dispatch = std::function; + + DecodeClickCoalescer (QObject * context, Dispatch dispatch, int interval = -1); + + void press (QString const& identity, QByteArray const& decodeRow); + void doubleClick (QString const& identity, QByteArray const& decodeRow); + +private: + void dispatchPending (); + + Dispatch dispatch_; + QTimer timer_; + QString pendingIdentity_; + QByteArray pending_; +}; + +#endif // QMAP_DECODE_CLICK_COALESCER_H diff --git a/qmap/decode_ipc.h b/qmap/decode_ipc.h new file mode 100644 index 00000000..8b554b33 --- /dev/null +++ b/qmap/decode_ipc.h @@ -0,0 +1,53 @@ +#ifndef QMAP_DECODE_IPC_H +#define QMAP_DECODE_IPC_H + +#include +#include + +namespace qmap_decode_ipc +{ + // Keep row dimensions in sync with qmap_decode_ipc.f90. + constexpr std::size_t shared_memory_size {4096}; + constexpr std::size_t max_rows {50}; + constexpr std::size_t row_size {80}; + constexpr std::size_t live_cq_row_size {8}; + + struct DecodeRows + { + int ndecodes; // Number of populated decode rows in the current cycle. + int ncand; // Number of QMAP candidates found in the current cycle. + int nQDecoderDone; // QMAP completion state: 1 for live data, 2 for disk data. + int nWDecoderBusy; // WSJT-X decoder busy flag: 1 while busy, otherwise 0. + int nWTransmitting; // WSJT-X transmit period while transmitting, otherwise 0. + int kHzRequested; // QMAP dial request in integer kHz; 0 means no request. + char result[max_rows][row_size]; // Formatted QMAP decode rows. + }; + + struct LiveCqRows + { + char result2[max_rows][live_cq_row_size]; + }; + + template + std::size_t text_length (char const (&row)[Size]) noexcept + { + std::size_t length {0}; + while (length < Size && row[length]) ++length; + return length; + } + + static_assert (std::is_standard_layout::value, + "QMAP decode IPC data must have a stable layout"); + static_assert (std::is_trivially_copyable::value, + "QMAP decode IPC data must support shared-memory copies"); + static_assert (sizeof (int) == 4, + "QMAP decode IPC integers must match Fortran INTEGER storage"); + static_assert (sizeof (DecodeRows) == 6 * sizeof (int) + max_rows * row_size, + "QMAP decode IPC data must not contain padding"); + static_assert (sizeof (DecodeRows) <= shared_memory_size, + "QMAP decode IPC data must fit in shared memory"); + static_assert (sizeof (LiveCqRows) == max_rows * live_cq_row_size, + "QMAP LiveCQ data must not contain padding"); +} + +#endif diff --git a/qmap/decode_label.h b/qmap/decode_label.h new file mode 100644 index 00000000..5e9417cb --- /dev/null +++ b/qmap/decode_label.h @@ -0,0 +1,38 @@ +#ifndef QMAP_DECODE_LABEL_H +#define QMAP_DECODE_LABEL_H + +#include + +#include + +#include "qmap_decode_record.h" + +using QMapDecodeLabel = QMapDecodeRecord; +constexpr int QMapDecodeLabelMaximum = 100; +constexpr int QMapDecodeLabelLifetimeSecs = 3 * 60; + +inline void upsertQMapDecodeLabel (QList& labels, + QMapDecodeRecord const& record) +{ + for (auto& label : labels) { + if (label.callsign == record.callsign) { + label = record; + return; + } + } + if (labels.size () >= QMapDecodeLabelMaximum) labels.removeFirst (); + labels.append (record); +} + +inline void pruneQMapDecodeLabels (QList& labels, int nowSeconds) +{ + labels.erase (std::remove_if (labels.begin (), labels.end (), + [nowSeconds] (QMapDecodeLabel const& label) { + int delta = nowSeconds - label.secondsSinceMidnight; + if (delta < -43200) delta += 86400; + else if (delta > 43200) delta -= 86400; + return delta > QMapDecodeLabelLifetimeSecs; + }), labels.end ()); +} + +#endif // QMAP_DECODE_LABEL_H diff --git a/qmap/getfile.cpp b/qmap/getfile.cpp index 644d4b05..dc29b279 100644 --- a/qmap/getfile.cpp +++ b/qmap/getfile.cpp @@ -1,11 +1,11 @@ #include "getfile.h" -#include -#include +#include +#include +#include +#include #include #include -extern qint16 id[2*60*96000]; - void getfile(QString fname, int dbDgrd) { // int npts=2*56*96000; @@ -16,34 +16,36 @@ void getfile(QString fname, int dbDgrd) if(dbDgrd<0) dgrd = 23.0*sqrt(pow(10.0,-0.1*(double)dbDgrd) - 1.0); float fac=23.0/sqrt(dgrd*dgrd + 23.0*23.0); - memset(id,0,2*npts); - char name[80]; - strcpy(name,fname.toLocal8Bit()); - FILE* fp=fopen(name,"rb"); + QFile file(fname); - if(fp != NULL) { - auto n = fread(&datcom_.fcenter,sizeof(datcom_.fcenter),1,fp); - n=fread(id,2,npts,fp); - n=fread(&datcom_.ntx30a,4,1,fp); - n=fread(&datcom_.ntx30b,4,1,fp); - if(n==0) { - datcom_.ntx30a=0; - datcom_.ntx30b=0; - } + if(file.open(QIODevice::ReadOnly)) { + file.read(reinterpret_cast(&datcom_.fcenter), sizeof(datcom_.fcenter)); + std::array samples; int j=0; - - if(dbDgrd<0) { - for(int i=0; i(samples.size(),npts-j); + qint64 bytes_read=file.read(reinterpret_cast(samples.data()), + want * static_cast(sizeof(qint16))); + size_t n=bytes_read > 0 + ? static_cast(bytes_read / static_cast(sizeof(qint16))) + : 0; + for(size_t i=0; i(want)) break; + } + while(j(sizeof(datcom_.ntx30a)); + bool read_ntx30a=file.read(reinterpret_cast(&datcom_.ntx30a), + ntx30_size) == ntx30_size; + bool read_ntx30b=file.read(reinterpret_cast(&datcom_.ntx30b), + ntx30_size) == ntx30_size; + if(!read_ntx30a || !read_ntx30b) { + datcom_.ntx30a=0; + datcom_.ntx30b=0; } - fclose(fp); datcom_.ndiskdat=1; // int nfreq=(int)datcom_.fcenter; @@ -59,23 +61,23 @@ void getfile(QString fname, int dbDgrd) void save_iq(QString fname) { int npts=2*60*96000; - qint16* buf=(qint16*)malloc(2*npts); - char name[80]; - strcpy(name,fname.toLocal8Bit()); - FILE* fp=fopen(name,"wb"); + std::vector buf(npts); + QFile file(fname); - if(fp != NULL) { - fwrite(&datcom_.fcenter,sizeof(datcom_.fcenter),1,fp); + if(file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { + file.write(reinterpret_cast(&datcom_.fcenter), + sizeof(datcom_.fcenter)); int j=0; for(int i=0; i(buf.data()), + static_cast(buf.size() * sizeof(qint16))); + qint64 ntx30_size=static_cast(sizeof(datcom_.ntx30a)); + file.write(reinterpret_cast(&datcom_.ntx30a), + 2 * ntx30_size); } - free(buf); } /* Generate gaussian random float with mean=0 and std_dev=1 */ diff --git a/qmap/libqmap/CMakeLists.txt b/qmap/libqmap/CMakeLists.txt index 7ecc22ef..5480486b 100644 --- a/qmap/libqmap/CMakeLists.txt +++ b/qmap/libqmap/CMakeLists.txt @@ -1,5 +1,6 @@ set (libq65_FSRCS # Modules come first: + qmap_decode_ipc.f90 cacb_mod.f90 # Non-module Fortran routines: @@ -49,10 +50,20 @@ set (libq65_C_and_CXXSRCS set_property (SOURCE ${libq65_C_and_CXXSRCS} APPEND_STRING PROPERTY COMPILE_FLAGS " -include wsjtx_config.h") set_property (SOURCE ${libq65_C_and_CXXSRCS} APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/wsjtx_config.h) +# These carry dummy arguments that are genuine QMAP-GUI-supplied state +# (see qmap/mainwindow.cpp) which the current Fortran implementation +# doesn't happen to reference; removing them would mean touching the +# GUI call sites too, so we suppress the warning instead. +set_source_files_properties (chkstat.f90 PROPERTIES COMPILE_FLAGS "-Wno-unused-dummy-argument") +set_source_files_properties (symspec.f90 PROPERTIES COMPILE_FLAGS "-Wno-unused-dummy-argument") +set_source_files_properties (q65b.f90 PROPERTIES COMPILE_FLAGS "-Wno-unused-dummy-argument") + # # build our targets # add_library (qmap_impl STATIC ${libq65_FSRCS} ${libq65_CSRCS} ${libq65_CXXSRCS}) -target_link_libraries (qmap_impl PUBLIC Qt5::Core) +if (NOT APPLE) + target_link_libraries (qmap_impl PUBLIC Qt5::Core) +endif () wsjt_link_common_fortran (qmap_impl) diff --git a/qmap/libqmap/decode0.f90 b/qmap/libqmap/decode0.f90 index d119fdcb..901da861 100644 --- a/qmap/libqmap/decode0.f90 +++ b/qmap/libqmap/decode0.f90 @@ -1,6 +1,7 @@ subroutine decode0(dd,ss,savg) use timer_module, only: timer + use qmap_decode_ipc, only: nQDecoderDone parameter (NSMAX=60*96000,NFFT=32768) real*4 dd(2,NSMAX),ss(400,NFFT),savg(NFFT) @@ -10,9 +11,6 @@ subroutine decode0(dd,ss,savg) logical*1 bAlso30 character mycall*12,hiscall*12,mygrid*6,hisgrid*6,datetime*20 character mycall0*12,hiscall0*12,hisgrid0*6 - character*72 result - common/decodes/ndecodes,ncand2,nQDecoderDone,nWDecoderBusy, & - nWTransmitting,kHzRequested,result(50) common/npar/fcenter,nutc,fselected,mousedf,mousefqso,nagain, & ndepth,ndiskdat,ntx60,newdat,nfa,nfb,nfcal,nfshift, & ntx30a,ntx30b,ntol,n60,nCFOM,nfsample,ndop58,nmode, & diff --git a/qmap/libqmap/getcand2.f90 b/qmap/libqmap/getcand2.f90 index 521f97f6..c98c3088 100644 --- a/qmap/libqmap/getcand2.f90 +++ b/qmap/libqmap/getcand2.f90 @@ -16,6 +16,7 @@ subroutine getcand2(ss,savg0,nts_q65,nagain,nhsym,ntx30a,ntx30b, & type(candidate) :: cand(MAX_CANDIDATES) real ss(400,NFFT) !Symbol spectra real savg0(NFFT),savg(NFFT) !Average spectra over whole Rx sequence + save savg !Keep this big array off the stack integer ipk1(1) !Peak index of local portion of spectrum logical sync_ok !True if sync pattern is present logical*1 bAlso30 diff --git a/qmap/libqmap/q65b.f90 b/qmap/libqmap/q65b.f90 index 4ac1bd1e..619f785d 100644 --- a/qmap/libqmap/q65b.f90 +++ b/qmap/libqmap/q65b.f90 @@ -12,6 +12,8 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & use wavhdr use timer_module, only: timer use map65_mmdec_mod, only: map65_mmdec + use qmap_decode_ipc, only: max_decode_rows, decode_row_length, & + ndecodes, result, result2 use iso_fortran_env, only: int16 use cacb_mod, only: ca, init_cacb @@ -31,18 +33,13 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & character*4 grid4 character*3 csubmode character*17 fname - character*72 result,ctmp - character*8 result2 !liveCQ + character(len=decode_row_length) ctmp character*20 datetime,datetime1 - character*1 c1 - common/decodes/ndecodes,ncand2,nQDecoderDone,nWDecoderBusy, & - nWTransmitting,kHzRequested,result(50) - common/decodes2/result2(50) !liveCQ data ifile/0/ save - - call init_cacb(MAXFFT1) + call init_cacb(MAXFFT1) + if(mycall0(1:1).ne.' ') mycall=mycall0 if(hiscall0(1:1).ne.' ') hiscall=hiscall0 if(hisgrid(1:4).ne.' ') grid4=hisgrid(1:4) @@ -164,7 +161,7 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & frx=0.001*k0*df+nkhz_center-48.0+1.0 - 0.001*nfcal fsked=frx - 0.001*ndop00/2.0 - 0.001*offset ctmp=csubmode//' '//trim(msg0) - ndecodes=min(ndecodes+1,50) + ndecodes=min(ndecodes+1,max_decode_rows) write(result(ndecodes),1120) nhhmmss,frx,fsked,xdt0,nsnr0,trim(ctmp) 1120 format(i6.6,f9.3,f7.1,f7.2,i5,2x,a) write(result2(ndecodes),1125) fsked !liveCQ diff --git a/qmap/libqmap/q65c.f90 b/qmap/libqmap/q65c.f90 index 51b4335e..eadf53d7 100644 --- a/qmap/libqmap/q65c.f90 +++ b/qmap/libqmap/q65c.f90 @@ -6,6 +6,7 @@ subroutine q65c use FFTW3 use q65 use q65_decode + use qmap_decode_ipc, only: ndecodes parameter (NFFT=32768) include 'njunk.f90' @@ -20,11 +21,6 @@ subroutine q65c character*12 mycall,hiscall character*6 mygrid,hisgrid character*20 datetime - character*72 result - character*8 result2 !liveCQ - common/decodes/ndecodes,ncand2,nQDecoderDone,nWDecoderBusy, & - nWTransmitting,kHzRequested,result(50) - common/decodes2/result2(50) !liveCQ common/datcom2/dd(2,5760000),ss(400,NFFT),savg(NFFT),nparams0 common/savecom/revision,fname !### REMEMBER that /npar/ is not updated until nparams=nparams0 is executed. ### diff --git a/qmap/libqmap/qmap_decode_ipc.f90 b/qmap/libqmap/qmap_decode_ipc.f90 new file mode 100644 index 00000000..0f8d5d5e --- /dev/null +++ b/qmap/libqmap/qmap_decode_ipc.f90 @@ -0,0 +1,18 @@ +module qmap_decode_ipc + implicit none + + ! Keep row dimensions in sync with qmap/decode_ipc.h. + integer, parameter :: max_decode_rows = 50 + integer, parameter :: decode_row_length = 80 + integer, parameter :: live_cq_row_length = 8 + + integer ndecodes,ncand2,nQDecoderDone,nWDecoderBusy + integer nWTransmitting,kHzRequested + character(len=decode_row_length) result(max_decode_rows) + character(len=live_cq_row_length) result2(max_decode_rows) + + common/decodes/ndecodes,ncand2,nQDecoderDone,nWDecoderBusy, & + nWTransmitting,kHzRequested,result + common/decodes2/result2 + +end module qmap_decode_ipc diff --git a/qmap/libqmap/qmapa.f90 b/qmap/libqmap/qmapa.f90 index 7c299885..2b785622 100644 --- a/qmap/libqmap/qmapa.f90 +++ b/qmap/libqmap/qmapa.f90 @@ -6,6 +6,7 @@ subroutine qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, & ! Processes timf2 data received from Linrad to find and decode Q65 signals. use timer_module, only: timer + use qmap_decode_ipc, only: ndecodes, ncand2 type candidate real :: snr !Relative S/N of sync detection @@ -33,12 +34,7 @@ subroutine qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, & character mycall*12,hiscall*12,hisgrid*6 type(candidate) :: cand(MAX_CANDIDATES) type(good_decode) found(MAX_CANDIDATES) - character*72 result - character*8 result2 !liveCQ character*20 datetime - common/decodes/ndecodes,ncand2,nQDecoderDone,nWDecoderBusy, & - nWTransmitting,kHzRequested,result(50) - common/decodes2/result2(50) !liveCQ save tsec0=sec_midn() diff --git a/qmap/libqmap/read_qm.f90 b/qmap/libqmap/read_qm.f90 index 67e3a0cd..30b02eda 100644 --- a/qmap/libqmap/read_qm.f90 +++ b/qmap/libqmap/read_qm.f90 @@ -7,21 +7,28 @@ subroutine read_qm(fname,iret) real*8 fcenter integer nxtra(15) !For possible future additions integer*1 id1(2,NMAX) + save id1 !Keep this big array off the stack common/datcom/dd(2,5760000),ss(400,NFFT),savg(NFFT), & fcenter,nutc,fselected,mousedf,mousefqso,nagain, & ndepth,ndiskdat,ntx60,newdat,nn1,nn2,nfcal,nfshift, & ntx30a,ntx30b !... open(28,file=trim(fname),status='old',access='stream',err=900) - read(28,end=910) prog_id,mycall,mygrid,fcenter,nutc,ntx30a, & + read(28,end=910,err=910) prog_id,mycall,mygrid,fcenter,nutc,ntx30a, & ntx30b,ndop00,ndop58,ia,ib,fac0,nxtra + + if(.not. ((ia.eq.1 .and. ib.eq.NMAX) .or. & + (ia.eq.1 .and. ib.eq.NMAX/2) .or. & + (ia.eq.NMAX/2+1 .and. ib.eq.NMAX) .or. & + (ia.eq.NMAX/2+1 .and. ib.eq.NMAX/2))) go to 910 + iret=3 if(ib.eq.NMAX/2) iret=1 if(ia.eq.NMAX/2+1) iret=2 fac=1.0 if(fac0.gt.0.0) fac=1.0/fac0 id1=0 - read(28,end=910) id1(1:2,ia:ib) + read(28,end=910,err=910) id1(1:2,ia:ib) dd=0. dd(1:2,ia:ib)=fac*id1(1:2,ia:ib) !Boost back to previous level go to 999 diff --git a/qmap/libqmap/save_qm.f90 b/qmap/libqmap/save_qm.f90 index 282f29b8..94a32b0b 100644 --- a/qmap/libqmap/save_qm.f90 +++ b/qmap/libqmap/save_qm.f90 @@ -15,6 +15,7 @@ subroutine save_qm(fname,revision,mycall,mygrid,dd,ntx30a,ntx30b,fcenter, & ib=NMAX if(ntx30a.gt.5) ia=NMAX/2+1 if(ntx30b.gt.5) ib=NMAX/2 + if(ia.gt.ib) return sq=0. do i=ia,ib @@ -60,4 +61,3 @@ subroutine save_qm(fname,revision,mycall,mygrid,dd,ntx30a,ntx30b,fcenter, & return end subroutine save_qm - diff --git a/qmap/livecq_parser.cpp b/qmap/livecq_parser.cpp new file mode 100644 index 00000000..e43ec5ce --- /dev/null +++ b/qmap/livecq_parser.cpp @@ -0,0 +1,95 @@ +#include "livecq_parser.h" + +#include "../validators/LiveCQCallsign.hpp" + +namespace +{ + bool isReportableMessageType(QString const& messageType) + { + return messageType == "CQ" || messageType == "QRZ" || messageType == "CQV" + || messageType == "CQH" || messageType == "QRT"; + } + + bool parseFrequency(QString const& token, int frequencyOffset, + int& receiveFrequency, int& scheduledFrequency) + { + auto const fields = token.split('.'); + if (fields.size() != 2 || fields.at(0).isEmpty() || fields.at(1).isEmpty()) { + return false; + } + + bool ok = false; + auto const integerPart = fields.at(0).toInt(&ok); + if (!ok) { + return false; + } + auto const fractionalPart = fields.at(1).toInt(&ok); + if (!ok) { + return false; + } + + receiveFrequency = frequencyOffset + fractionalPart; + if (receiveFrequency <= frequencyOffset + 500) { + scheduledFrequency = integerPart; + } else { + scheduledFrequency = integerPart + 1; + receiveFrequency -= 1000; + } + return true; + } +} + +namespace QMapLiveCQ +{ + bool parse(QStringList const& tokens, int frequencyOffset, Record& record) + { + if (tokens.size() < 9 || tokens.size() > 11 + || !isReportableMessageType(tokens.at(6).trimmed())) { + return false; + } + + Record parsed; + parsed.grid = "--"; + auto const messageType = tokens.at(6).trimmed(); + QString frequencyToken; + + if (tokens.size() == 9) { + parsed.callsign = tokens.at(7).trimmed(); + if (!LiveCQ::isValidCallsign(parsed.callsign)) { + return false; + } + parsed.message = messageType + " " + parsed.callsign; + frequencyToken = tokens.at(8); + } else if (tokens.size() == 10) { + auto const firstCandidate = tokens.at(7).trimmed(); + if (LiveCQ::isValidCallsign(firstCandidate)) { + parsed.callsign = firstCandidate; + parsed.grid = tokens.at(8).trimmed(); + parsed.message = messageType + " " + parsed.callsign + " " + parsed.grid; + } else { + parsed.callsign = tokens.at(8).trimmed(); + if (!LiveCQ::isValidCallsign(parsed.callsign)) { + return false; + } + parsed.message = messageType + " " + parsed.callsign; + } + frequencyToken = tokens.at(9); + } else { + parsed.callsign = tokens.at(8).trimmed(); + if (!LiveCQ::isValidCallsign(parsed.callsign)) { + return false; + } + parsed.grid = tokens.at(9).trimmed(); + parsed.message = messageType + " " + parsed.callsign + " " + parsed.grid; + frequencyToken = tokens.at(10); + } + + if (!parseFrequency(frequencyToken, frequencyOffset, + parsed.receiveFrequency, parsed.scheduledFrequency)) { + return false; + } + + record = parsed; + return true; + } +} diff --git a/qmap/livecq_parser.h b/qmap/livecq_parser.h new file mode 100644 index 00000000..aa80bb10 --- /dev/null +++ b/qmap/livecq_parser.h @@ -0,0 +1,21 @@ +#ifndef QMAP_LIVE_CQ_PARSER_H +#define QMAP_LIVE_CQ_PARSER_H + +#include +#include + +namespace QMapLiveCQ +{ + struct Record + { + QString callsign; + QString grid; + QString message; + int receiveFrequency {0}; + int scheduledFrequency {0}; + }; + + bool parse(QStringList const& tokens, int frequencyOffset, Record& record); +} + +#endif diff --git a/qmap/main.cpp b/qmap/main.cpp index 3ef9def2..196b6f4b 100644 --- a/qmap/main.cpp +++ b/qmap/main.cpp @@ -5,10 +5,11 @@ #include #endif #include +#include #include -#include #include #include +#include #include "revision_utils.hpp" #include "mainwindow.h" @@ -26,11 +27,14 @@ extern "C" { int main(int argc, char *argv[]) { - QString appDir = QFileInfo {argc > 0 ? QString::fromLocal8Bit (argv[0]) : QString {}}.absoluteDir ().absolutePath (); + QCoreApplication::setApplicationName ("QMAP"); + QString dataDir = QStandardPaths::writableLocation (QStandardPaths::AppLocalDataLocation); + if (dataDir.isEmpty ()) + { + dataDir = QDir::home ().absoluteFilePath (".qmap"); + } - // Read optional file to disable highDPI scaling - QFile f(QDir {appDir}.absoluteFilePath ("DisableHighDpiScaling")); - if (!f.exists()) QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QApplication::setAttribute (Qt::AA_EnableHighDpiScaling); QApplication a {argc, argv}; @@ -38,7 +42,7 @@ int main(int argc, char *argv[]) a.setApplicationName ("QMAP"); a.setApplicationVersion ("0.7"); - QString dataDir = qmapDataDir(); + dataDir = qmapDataDir(); QFileInfo dataDirInfo {dataDir}; if (!dataDirInfo.exists() || !dataDirInfo.isDir() || !dataDirInfo.isWritable() || !QDir::setCurrent(dataDir)) { diff --git a/qmap/mainwindow.cpp b/qmap/mainwindow.cpp index 70141b2d..7f3b5352 100644 --- a/qmap/mainwindow.cpp +++ b/qmap/mainwindow.cpp @@ -1,5 +1,6 @@ //------------------------------------------------------------------ MainWindow #include "mainwindow.h" +#include #include #include #include @@ -17,7 +18,13 @@ #include "about.h" #include "astro.h" #include "widegraph.h" +#include "vertwaterfall.h" #include "sleep.h" +#include "livecq_parser.h" +#include "shared_memory_key.h" +#include "qmap_ipc.h" +#include "qmap_decode_record.h" +#include "validators/LiveCQCallsign.hpp" #include //liveCQ #include //liveCQ @@ -29,10 +36,10 @@ #define NFFT 32768 -qint16 id[2*60*96000]; - -QSharedMemory mem_qmap("mem_qmap"); //Memory segment to be shared (optionally) with WSJT-X -int* ipc_wsjtx; +QSharedMemory mem_qmap; //Memory segment to be shared (optionally) with WSJT-X +QMapSharedMemory * ipc_wsjtx {nullptr}; +bool qmap_decoder_region_available {false}; +bool qmap_click_mailbox_available {false}; extern const int RxDataFrequency = 96000; @@ -45,6 +52,7 @@ MainWindow::MainWindow(QWidget *parent) : m_settings_filename {qmapSettingsFile (m_appDir, m_dataDir)}, m_astro_window {new Astro {m_settings_filename}}, m_wide_graph_window {new WideGraph {m_settings_filename}}, + m_vert_waterfall_window {new VertWaterfall {m_settings_filename}}, m_gui_timer {new QTimer {this}} { ui->setupUi(this); @@ -75,7 +83,7 @@ MainWindow::MainWindow(QWidget *parent) : ui->actionSave_all->setActionGroup(saveGroup); ui->actionSave_decoded->setActionGroup(saveGroup); - setWindowTitle (program_title ()); + setWindowTitle (branded_program_title ()); connect(&soundInThread, SIGNAL(readyForFFT(int)), this, SLOT(dataSink(int))); connect(&soundInThread, SIGNAL(error(QString)), this, SLOT(showSoundInError(QString))); @@ -109,16 +117,23 @@ MainWindow::MainWindow(QWidget *parent) : xSignalMeter->resize(50, 160); //Attach or create a memory segment to be shared with WSJT-X. - int memSize=4096; + auto const memSize=static_cast(QMapSharedMemorySize); + mem_qmap.setKey (qmap_decode_ipc::shared_memory_key ()); if(!mem_qmap.attach()) { if(!mem_qmap.create(memSize)) { msgBox("Unable to create shared memory segment mem_qmap."); } } - ipc_wsjtx = (int*)mem_qmap.data(); - mem_qmap.lock(); - memset(ipc_wsjtx,0,memSize); //Zero all of shared memory - mem_qmap.unlock(); + auto const mappedSize = mem_qmap.isAttached () + ? static_cast (mem_qmap.size ()) : 0u; + qmap_decoder_region_available = qmapDecoderRegionAvailable (mappedSize); + qmap_click_mailbox_available = qmapClickMailboxAvailable (mappedSize); + ipc_wsjtx = qmap_decoder_region_available + ? static_cast (mem_qmap.data ()) : nullptr; + if (ipc_wsjtx && mem_qmap.lock ()) { + clearQMapSharedMemory (ipc_wsjtx, mappedSize); + mem_qmap.unlock (); + } // fftwf_import_wisdom_from_filename (QDir {m_appDir}.absoluteFilePath ("qmap_wisdom.dat").toLocal8Bit ()); readSettings(); //Restore user's setup params @@ -137,7 +152,21 @@ MainWindow::MainWindow(QWidget *parent) : border-color: black; min-width: 5em; padding: 3px;}"; on_actionAstro_Data_triggered(); //Create the other windows - on_actionWide_Waterfall_triggered(); + { + // Restore each waterfall's visibility from its last-exit setting. + QSettings settings {m_settings_filename, QSettings::IniFormat}; + bool wideVisible, vertVisible; + { + SettingsGroup g {&settings, "MainWindow"}; + wideVisible = settings.value ("WideGraphVisible", true).toBool (); + } + { + SettingsGroup g {&settings, "VertWaterfall"}; + vertVisible = settings.value ("VertWaterfallVisible", false).toBool (); + } + if (wideVisible) on_actionWide_Waterfall_triggered(); + if (vertVisible) on_actionVertical_Waterfall_triggered(); + } if (m_astro_window) m_astro_window->setFontSize (m_astroFont); if(m_modeQ65==1) on_actionQ65A_triggered(); @@ -202,7 +231,11 @@ MainWindow::MainWindow(QWidget *parent) : if(ui->actionBlue->isChecked()) on_actionBlue_triggered(); connect (m_wide_graph_window.get (), &WideGraph::freezeDecode2, this, &MainWindow::freezeDecode); + connect (m_wide_graph_window.get (), &WideGraph::decodeLabelClicked2, this, &MainWindow::decodeLabelClicked); + connect (m_vert_waterfall_window.get (), &VertWaterfall::decodeLabelClicked2, this, &MainWindow::decodeLabelClicked); connect (m_wide_graph_window.get (), &WideGraph::f11f12, this, &MainWindow::bumpDF); + connect (m_wide_graph_window.get (), &WideGraph::spectrumReady, + m_vert_waterfall_window.get (), &VertWaterfall::dataSinkVert); //default freq at startup for Doppler and Tsky datcom_.fcenter = 1296.150; @@ -219,6 +252,12 @@ MainWindow::~MainWindow() writeSettings(); all_done_(); + if (ipc_wsjtx && mem_qmap.isAttached () && mem_qmap.lock ()) { + clearQMapSharedMemory (ipc_wsjtx, + static_cast (mem_qmap.size ())); + mem_qmap.unlock (); + } + if (soundInThread.isRunning()) { soundInThread.quit(); soundInThread.wait(3000); @@ -523,15 +562,24 @@ void MainWindow::on_actionSettings_triggered() void MainWindow::on_monitorButton_clicked() //Monitor { - if(m_monitoring or m_loopall) { - m_monitoring=false; - soundInThread.setMonitoring(false); - m_loopall=false; - } else { - m_monitoring=true; - soundInThread.setMonitoring(true); - m_diskData=false; - } + clearDecodeLabels (); + m_monitoring=true; + soundInThread.setMonitoring(true); + m_diskData=false; +} + +void MainWindow::clearDecodeLabels () +{ + if (m_wide_graph_window) m_wide_graph_window->clearDecodeLabels (); + if (m_vert_waterfall_window) m_vert_waterfall_window->clearDecodeLabels (); +} + +void MainWindow::on_stopButton_clicked() //stopButton +{ + m_monitoring=false; + soundInThread.setMonitoring(m_monitoring); + m_loopall=false; + m_startAnother=false; } void MainWindow::on_actionLinrad_triggered() //Linrad palette @@ -668,9 +716,30 @@ void MainWindow::on_actionExit_triggered() //Exit() void MainWindow::closeEvent (QCloseEvent * e) { if (m_gui_timer) m_gui_timer->stop (); + + // Record whether each waterfall was open, so it can be restored on the + // next startup. Must happen before close() below, since close() hides + // the window and isVisible() would otherwise read back false. Written + // directly here (not from each window's own saveSettings(), which also + // runs again from its destructor after close() -- that second call + // would otherwise clobber this with isVisible()==false). + { + QSettings settings {m_settings_filename, QSettings::IniFormat}; + { + SettingsGroup g {&settings, "MainWindow"}; + settings.setValue ("WideGraphVisible", m_wide_graph_window && m_wide_graph_window->isVisible ()); + } + { + SettingsGroup g {&settings, "VertWaterfall"}; + settings.setValue ("VertWaterfallVisible", m_vert_waterfall_window && m_vert_waterfall_window->isVisible ()); + } + } + m_wide_graph_window->saveSettings(); + if (m_vert_waterfall_window) m_vert_waterfall_window->saveSettings(); if (m_astro_window) m_astro_window->close (); if (m_wide_graph_window) m_wide_graph_window->close (); + if (m_vert_waterfall_window) m_vert_waterfall_window->close (); QMainWindow::closeEvent (e); } @@ -690,6 +759,11 @@ void MainWindow::on_actionWide_Waterfall_triggered() //Display Waterfalls m_wide_graph_window->show(); } +void MainWindow::on_actionVertical_Waterfall_triggered() //Display Vertical Waterfall +{ + if (m_vert_waterfall_window) m_vert_waterfall_window->show(); +} + void MainWindow::on_actionOpen_triggered() //Open File { m_monitoring=false; @@ -705,7 +779,8 @@ void MainWindow::on_actionOpen_triggered() //Open File lab1->setStyleSheet("QLabel{background-color: #66ff66}"); lab1->setText(" " + fname.mid(i,15) + " "); } - if(m_monitoring) on_monitorButton_clicked(); + on_stopButton_clicked(); + clearDecodeLabels (); m_diskData=true; int dbDgrd=0; int iret=4; @@ -741,6 +816,7 @@ void MainWindow::on_actionOpen_next_in_directory_triggered() //Open Next lab1->setStyleSheet("QLabel{background-color: #66ff66}"); lab1->setText(" " + fname.mid(i,len) + " "); } + clearDecodeLabels (); m_diskData=true; int dbDgrd=0; int iret=4; @@ -790,14 +866,12 @@ void MainWindow::decoderFinished() { m_startAnother=m_loopall; decodes_.nQDecoderDone=1; - decodes_.kHzRequested=0; if(m_diskData) decodes_.nQDecoderDone=2; - mem_qmap.lock(); - decodes_.nWDecoderBusy=ipc_wsjtx[3]; //Prevent overwriting values - decodes_.nWTransmitting=ipc_wsjtx[4]; //written here by WSJT-X + if (qmap_decoder_region_available && ipc_wsjtx && mem_qmap.lock ()) { + publishQMapDecodeBlock(*ipc_wsjtx, decodes_); + mem_qmap.unlock (); + } m_bWTransmitting=decodes_.nWTransmitting>0; - memcpy((char*)ipc_wsjtx, &decodes_, sizeof(decodes_)); //Send decodes and flags to WSJT-X - mem_qmap.unlock(); QString t1; t1=t1.asprintf(" %.1f s %d/%d ", 0.15*datcom2_.nhsym, decodes_.ndecodes, decodes_.ncand); lab4->setText(t1); @@ -873,10 +947,12 @@ void MainWindow::on_DecodeButton_clicked() //Decode request void MainWindow::freezeDecode(int n) //freezeDecode() { if(n==3) { + if (!qmap_decoder_region_available || !ipc_wsjtx) return; decodes_.kHzRequested=m_wide_graph_window->QSOfreq(); - mem_qmap.lock(); - ipc_wsjtx[5]=decodes_.kHzRequested; - mem_qmap.unlock(); + if (mem_qmap.lock ()) { + ipc_wsjtx->decodes.kHzRequested=decodes_.kHzRequested; + mem_qmap.unlock (); + } return; } if(n==2) { @@ -895,6 +971,22 @@ void MainWindow::freezeDecode(int n) //freezeDecode() } } +void MainWindow::decodeLabelClicked(QByteArray decodeRow, DecodeClickGesture gesture) +{ + if (!qmap_click_mailbox_available || !ipc_wsjtx + || decodeRow.size () != static_cast (QMapDecodeRowSize)) return; + if (mem_qmap.lock ()) { + std::memcpy(ipc_wsjtx->click.selectedDecode, decodeRow.constData(), QMapDecodeRowSize); + if (gesture == DecodeClickGesture::Press) ipc_wsjtx->click.action = QMapClickAction::Disarm; + else if (gesture == DecodeClickGesture::SingleClick) { + ipc_wsjtx->click.action = QMapClickAction::Select; + } else { + ipc_wsjtx->click.action = QMapClickAction::SelectAndEnableTx; + } + mem_qmap.unlock (); + } +} + void MainWindow::decode() //decode() { if(m_decoderBusy) { @@ -1037,208 +1129,49 @@ void MainWindow::CreateLiveCQ(QStringList cqliveText) //return if cqliveText is empty or data were read from disk. if ((m_diskData && m_myCall.toUpper() != "W3SZ" && m_myCall.toUpper() != "DL3WDG") or (cqliveText.size() == 0)) return; - QStringList cqliveFinalText; - QStringList oldFile; - bool ok; int freqOffset = ui->sbOffset->value(); QStringList bandInfo; bandInfo = ui->labFreq->text().split(".",SkipEmptyParts); QString bandFreq = bandInfo.at(0); QString theDate = ui->labUTC->text().trimmed().mid(0,12); QList decodeList; - bool strOK = false; for (const QString &item : cqliveText) { - QString line = " "; - QStringList thePostLine; - line = line.repeated(100); //.replace("<","").replace(">",""); - QStringList thePieces; - qDebug () << "item is: " << item; - thePieces = item.split(" ",SkipEmptyParts); - int rxFreq = 0.0; - if((thePieces.at(6) == "CQ" || thePieces.at(6) == "QRZ" || thePieces.at(6) == "CQV" || thePieces.at(6) == "CQH" || thePieces.at(6) == "QRT") && m_myCall.length() >=3 && m_myGrid.length()>=4 ) { - try { - //extract Fsked freq and format to 3 digits no decimals - qDebug() << "entered try"; - QString theMsg; - QString theCall; - QString theGrid; - QStringList thekHz; - int nWords=thePieces.length(); - if(nWords==9) { - // Handle CQ CALL messages that do not include a locator - if(thePieces.at(6)==NULL or thePieces.at(7)==NULL or thePieces.at(8)==NULL) continue; - theCall = thePieces.at(7); - bool isCall = testCall(theCall); - qDebug() << "theCall is: " << theCall << " and isCall is: " << isCall; - if(!isCall) continue; - theGrid = "--"; - theMsg = thePieces.at(6) + " " + theCall; - thekHz = thePieces.at(8).split("."); - rxFreq = freqOffset + thekHz.at(1).toInt(&ok); - // int rxFreq = freqOffset + 100 * thekHz.at(1).toInt(&ok); - if (!ok) continue; - } else if(nWords==10) { - // Handle CQ CALL GRID --or-- CQ XXX CALL - if(thePieces.at(6)==NULL or thePieces.at(7)==NULL or thePieces.at(8)==NULL or thePieces.at(9)==NULL) continue; - // Test for callsign at thePieces.at(7) - theCall = thePieces.at(7); - bool isCall = testCall(theCall); - qDebug() << "theCall is: " << theCall << " and isCall is: " << isCall; - // Handle CQ CALL GRID - if(isCall) { - theGrid = thePieces.at(8); - theMsg = thePieces.at(6) + " " + theCall + " " + theGrid; - } - // Handle CQ XXX CALL - else { - theCall = thePieces.at(8); - isCall = testCall(theCall); - qDebug() << "theCall is: " << theCall << " and isCall is: " << isCall; - if(!isCall) continue; - theGrid = "--"; - theMsg = thePieces.at(6) + " " + theCall; - } - thekHz = thePieces.at(9).split("."); - rxFreq = freqOffset + thekHz.at(1).toInt(&ok); - // int rxFreq = freqOffset + 100 * thekHz.at(1).toInt(&ok); - if (!ok) continue; - // Handle CQ XXX CALL GRID - } else if (nWords==11) { - if(thePieces.at(6)==NULL or thePieces.at(7)==NULL or thePieces.at(8)==NULL or thePieces.at(9)==NULL or thePieces.at(10)==NULL) continue; - theCall = thePieces.at(8); - bool isCall = testCall(theCall); - qDebug() << "theCall is: " << theCall << " and isCall is: " << isCall; - if(!isCall) continue; - theGrid = thePieces.at(9); - theMsg = thePieces.at(6) + " " + theCall + " " + theGrid; - thekHz = thePieces.at(10).split("."); - rxFreq = freqOffset + thekHz.at(1).toInt(&ok); - // int rxFreq = freqOffset + 100 * thekHz.at(1).toInt(&ok); - if (!ok) continue; - } - strOK = true; - int skedFreq; - QString skedFreqString; - if (rxFreq <= freqOffset + 500) { - skedFreq = thekHz.at(0).toInt(&ok); - } else { - skedFreq = thekHz.at(0).toInt(&ok) + 1; - rxFreq=rxFreq - 1000; - } - skedFreqString = QString::number(skedFreq).rightJustified(3,'0'); - QString mode = "0 Q65-" + thePieces.at(5); - line.insert(0,bandFreq + "." + skedFreqString); - line.insert(10,QString::number(rxFreq)); - line.insert(15,"0"); - line.insert(18,thePieces.at(0)); - line.insert(26,thePieces.at(3)); - line.insert(32,thePieces.at(4)); - line.insert(36,theMsg); - line.insert(55,mode); - line.insert(67,m_myGrid.toUpper()); - line.insert(74,"Q"); - line.insert(76,theDate); - line.insert(88,m_myCall.toUpper()); - cqliveFinalText << line.trimmed(); - //qDebug () << "cqliveFinalText is: " << cqliveFinalText; - - thePostLine.insert(0, bandFreq + "." + skedFreqString); //skedfreq - thePostLine.insert(1, QString::number(rxFreq)); //rxfreq - thePostLine.insert(2, "--"); //rpol - thePostLine.insert(3,thePieces.at(0)); //utc HHmmSS - thePostLine.insert(4,thePieces.at(3)); //dt - thePostLine.insert(5, thePieces.at(4)); //dB - thePostLine.insert(6, "Q65-" + thePieces.at(5)); //Q65 submode - thePostLine.insert(7, thePieces.at(6)); //msg type - thePostLine.insert(8, theCall); //dx call - thePostLine.insert(9, theGrid); //dx grid - thePostLine.insert(10, m_myGrid.toUpper()); //myGrid - thePostLine.insert(11, theDate); //the date - thePostLine.insert(12, m_myCall.toUpper()); //myCall - thePostLine.insert(13, "--"); //txpol - decodeList.append(thePostLine); - qDebug () << "thePostLine is: " << thePostLine; - } - catch (const std::exception& e) { - // Handle standard C++ exceptions - QMessageBox::critical(this, "Exception", "Exception at line 1116 MainWindow::CreateLiveCQ " + QString::fromStdString(e.what())); - } - catch (...) { - // Handle any other type of exception - QMessageBox::critical(this, "Exception", "Unknown Exception at line 1121 MainWindow::CreateLiveCQ"); - } - } -} - if(strOK) { - sendLiveCQData(decodeList); - } -} - -bool MainWindow::testCall(QString w) -{ -// Check "callsign" to see if it could be a valid standard callsign or a valid -// compound callsign. -// Return a logical "call ok" indicator. - if(w.indexOf('.') >= 0) return false; - if(w.indexOf('+') >= 0) return false; - if(w.indexOf('-') >= 0) return false; - if(w.indexOf('?') >= 0) return false; - w = w.replace('<',""); - w = w.replace('>',""); - int i0=w.indexOf('/'); - int n1=w.length(); - if(n1 > 11) return false; - qDebug() << "Line 1186 w is: " << w << " and i0 is: " << i0 << " and n1 is: " << n1 << " and call is: " << w; - QString bc = QString(); - QStringList wSplit = w.split("/"); - if(wSplit.length() > 1) { - if(wSplit.at(0).length() > wSplit.at(1).length()) { - bc = wSplit.at(0); + QStringList const thePieces = item.split(" ",SkipEmptyParts); + QMapLiveCQ::Record record; + if (!QMapLiveCQ::parse(thePieces, freqOffset, record)) { + continue; } - else { - bc = wSplit.at(1); + qDebug () << "item is: " << item; + if (m_myCall.length() >= 3 && m_myGrid.length() >= 4) { + QString theCall = record.callsign; + QString theGrid = record.grid; + int rxFreq = record.receiveFrequency; + QString skedFreqString = QString::number(record.scheduledFrequency) + .rightJustified(3, '0'); + QStringList thePostLine; + + thePostLine.insert(0, bandFreq + "." + skedFreqString); //skedfreq + thePostLine.insert(1, QString::number(rxFreq)); //rxfreq + thePostLine.insert(2, "--"); //rpol + thePostLine.insert(3,thePieces.at(0)); //utc HHmmSS + thePostLine.insert(4,thePieces.at(3)); //dt + thePostLine.insert(5, thePieces.at(4)); //dB + thePostLine.insert(6, "Q65-" + thePieces.at(5)); //Q65 submode + thePostLine.insert(7, thePieces.at(6)); //msg type + thePostLine.insert(8, theCall); //dx call + thePostLine.insert(9, theGrid); //dx grid + thePostLine.insert(10, m_myGrid.toUpper()); //myGrid + thePostLine.insert(11, theDate); //the date + thePostLine.insert(12, m_myCall.toUpper()); //myCall + thePostLine.insert(13, "--"); //txpol + decodeList.append(thePostLine); + qDebug () << "thePostLine is: " << thePostLine; } } - else { - bc = w; + if (!decodeList.isEmpty()) { + sendLiveCQData(decodeList); } - int nbc=bc.trimmed().length(); - if(nbc > 8) return false; //Base call should have no more than 8 characters e.g. YW18FIFA - qDebug() << "reached line 1201"; - -// One of first two characters (c1 or c2) must be a letter - if((!bc[0].isLetter()) && (!bc[1].isLetter())) return false; - qDebug() << "reached line 1206"; -// Real calls don't start with Q, but we'll allow the placeholder -// callsign QU1RK to be considered a standard call: - if(bc[0]=='Q' && bc.mid(0,5) != "QU1RK") return false; - qDebug() << "reached line 1209"; - -// Must have a digit in 2nd or 3rd or 4th position - int i1=0; - if(bc[1].isDigit()) i1=1; - if(bc[2].isDigit()) i1=2; - if(bc[3].isDigit()) i1=3; - if(i1==0) return false; - qDebug() << "reached line 1217"; - -// Callsign must have a suffix of 1-4 letters e.g. YW18FIFA - if(i1==nbc) return false; - qDebug() << "reached line 1221"; - int n=0; - QChar j=QChar(); - for (int i=i1+1; i<=nbc-1; ++i) { - j=bc[i]; - if(j QChar('Z')) return false; - qDebug() << "reached line 1227 and n = " << n ; - n=n+1; - } - qDebug() << "reached line 1230"; - if(n >= 1 && n <= 4) return true; - qDebug() << "reached line 1232"; - - return false; } void MainWindow::sendLiveCQData(QListdecodeList) @@ -1331,6 +1264,10 @@ void MainWindow::guiUpdate() } m_wide_graph_window->updateFreqLabel(); + if (!m_diskData) { + m_wide_graph_window->pruneDecodeLabels(nsec); + if (m_vert_waterfall_window) m_vert_waterfall_window->pruneDecodeLabels(nsec); + } if(m_startAnother and !m_bDiskDatBusy) { m_startAnother=false; @@ -1341,8 +1278,22 @@ void MainWindow::guiUpdate() if(decodes_.ndecodes > m_fetched) { doLiveCQ = true; while(m_fetched(qmap_decode_ipc::text_length(row))); + QString t2=QString::fromLatin1(live_cq_row, + static_cast(qmap_decode_ipc::text_length(live_cq_row))); + + if (m_vert_waterfall_window || m_wide_graph_window) { + auto const record = parseQMapDecodeRecord ( + QByteArray {decodes_.result[m_fetched], static_cast (QMapDecodeRowSize)}); + if (record && LiveCQ::isValidCallsign (record->callsign)) { + if (m_vert_waterfall_window) m_vert_waterfall_window->addDecodeLabel(*record); + if (m_wide_graph_window) m_wide_graph_window->addDecodeLabel(*record); + } + } + if(m_UTC0!="" and m_UTC0!=t.left(4)) { t1="-"; ui->decodedTextBrowser->append(t1.repeated(60)); @@ -1387,12 +1338,13 @@ void MainWindow::guiUpdate() m_n60=nsec%60; // See if WSJT-X is transmitting - int itest[5]; - mem_qmap.lock(); - memcpy(&itest, (char*)ipc_wsjtx, 20); - mem_qmap.unlock(); - if(itest[4]>0) { - m_WSJTX_TRperiod=itest[4]; + int transmitting = 0; + if (qmap_decoder_region_available && ipc_wsjtx && mem_qmap.lock ()) { + transmitting=ipc_wsjtx->decodes.nWTransmitting; + mem_qmap.unlock (); + } + if(transmitting>0) { + m_WSJTX_TRperiod=transmitting; m_bWTransmitting=true; if(m_WSJTX_TRperiod==30 and m_n60<30) m_nTx30a++; if(m_WSJTX_TRperiod==30 and m_n60>=30) m_nTx30b++; @@ -1520,6 +1472,16 @@ void MainWindow::on_actionQuick_Start_Guide_to_Q65_triggered() QDesktopServices::openUrl (QUrl {"https://wsjt.sourceforge.io/Q65_Quick_Start.pdf"}); } +void MainWindow::on_actionCopyright_Notice_triggered() +{ + MessageBox::warning_message (this, copyright_notice_text ()); +} + +void MainWindow::on_actionTrademark_Policy_triggered() +{ + QDesktopServices::openUrl (QUrl {"https://wsjtx.github.io/wsjtx/trademark.html"}); +} + void MainWindow::on_actionQuick_Start_Guide_to_WSJT_X_2_7_and_QMAP_triggered() { QDesktopServices::openUrl (QUrl {"https://wsjt.sourceforge.io/Quick_Start_WSJT-X_2.7_QMAP.pdf"}); diff --git a/qmap/mainwindow.h b/qmap/mainwindow.h index 6f1b4a23..8c71c4d5 100644 --- a/qmap/mainwindow.h +++ b/qmap/mainwindow.h @@ -25,6 +25,8 @@ namespace Ui { class QTimer; class Astro; class WideGraph; +class VertWaterfall; +enum class DecodeClickGesture; class MainWindow : public QMainWindow { @@ -42,6 +44,7 @@ public slots: void diskDat(int iret); void decoderFinished(); void freezeDecode(int n); + void decodeLabelClicked(QByteArray decodeRow, DecodeClickGesture gesture); void guiUpdate(); private: @@ -51,6 +54,7 @@ private: private slots: void on_monitorButton_clicked(); + void on_stopButton_clicked(); void on_actionExit_triggered(); void on_actionAbout_triggered(); void on_actionLinrad_triggered(); @@ -58,6 +62,7 @@ private slots: void on_tolSpinBox_valueChanged(int arg1); void on_actionAstro_Data_triggered(); void on_actionWide_Waterfall_triggered(); + void on_actionVertical_Waterfall_triggered(); void on_actionOpen_triggered(); void on_actionOpen_next_in_directory_triggered(); void on_actionDecode_remaining_files_in_directory_triggered(); @@ -80,6 +85,8 @@ private slots: void on_actionQ65D_triggered(); void on_actionQ65E_triggered(); void on_actionQuick_Start_Guide_to_Q65_triggered(); + void on_actionCopyright_Notice_triggered(); + void on_actionTrademark_Policy_triggered(); void on_actionQuick_Start_Guide_to_WSJT_X_2_7_and_QMAP_triggered(); void on_actionAlso_Q65_30x_toggled(bool b); void on_sbMaxDrift_valueChanged(int arg1); @@ -100,6 +107,7 @@ private: QString m_settings_filename; QScopedPointer m_astro_window; QScopedPointer m_wide_graph_window; + QScopedPointer m_vert_waterfall_window; QPointer m_gui_timer; qint32 m_waterfallAvg; qint32 m_DF; @@ -200,9 +208,9 @@ private: void updateStatusBar(); void msgBox(QString t); bool isGrid4(QString g); + void clearDecodeLabels(); void CreateLiveCQ(QStringList cqliveText); //liveCQ void sendLiveCQData(QList decodeList); //liveCQ - bool testCall(QString callsign); //liveCQ }; extern void getfile(QString fname, bool xpol, int idInt); diff --git a/qmap/mainwindow.ui b/qmap/mainwindow.ui index 8f27ebb5..8e1f9fc8 100644 --- a/qmap/mainwindow.ui +++ b/qmap/mainwindow.ui @@ -161,32 +161,52 @@ li.checked::marker { content: "\2612"; }
- - - - 0 - 0 - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - <html><head/><body><p>Toggle monitoring On/Off. <br/>Yellow when saving .qm files.</p></body></html> - - - &Monitor - - + + + + + + 0 + 0 + + + + <html><head/><body><p>Stop monitoring, and break out of a Decode-remaining-files sequence started with Shift+F6.</p></body></html> + + + &Stop + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + <html><head/><body><p>Start monitoring. <br/>Yellow when saving .qm files.</p></body></html> + + + &Monitor + + + + @@ -597,6 +617,7 @@ li.checked::marker { content: "\2612"; } + @@ -617,6 +638,10 @@ li.checked::marker { content: "\2612"; }
+ + + + @@ -655,12 +680,22 @@ li.checked::marker { content: "\2612"; }
- About QMAP + About QMAP™ Ctrl+F1 + + + Copyright notice + + + + + Trademark policy + + Astro Data @@ -681,7 +716,12 @@ li.checked::marker { content: "\2612"; } - Wideband Waterfall + Horizontal Waterfall + + + + + Vertical Waterfall @@ -1031,7 +1071,7 @@ li.checked::marker { content: "\2612"; } DisplayText QTextBrowser -
widgets/displaytext.h
+
displaytext.h
diff --git a/qmap/plotter.cpp b/qmap/plotter.cpp index 0cf1ad17..8977dd92 100644 --- a/qmap/plotter.cpp +++ b/qmap/plotter.cpp @@ -1,5 +1,6 @@ #include "plotter.h" #include +#include #include #include #include @@ -8,7 +9,10 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor - QFrame(parent) + QFrame(parent), + m_decodeClickCoalescer {this, [this] (QByteArray const& decodeRow, DecodeClickGesture gesture) { + emit decodeLabelClicked (decodeRow, gesture); + }} { setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setFocusPolicy(Qt::StrongFocus); @@ -18,26 +22,12 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor setAttribute(Qt::WA_NoSystemBackground, true); setMouseTracking(true); - m_StartFreq = 100; - m_nSpan=65; //Units: kHz - m_fSpan=(float)m_nSpan; - m_hdivs = HORZ_DIVS; - m_FreqUnits = 1; - m_Running = false; - m_paintEventBusy=false; m_WaterfallPixmap = QPixmap(0,0); m_ZoomWaterfallPixmap = QPixmap(0,0); m_2DPixmap = QPixmap(0,0); m_ScalePixmap = QPixmap(0,0); m_ZoomScalePixmap = QPixmap(0,0); m_Size = QSize(0,0); - m_fQSO = 125; - m_TXkHz = m_fQSO; - m_line = 0; - m_fSample = 96000; - m_paintAllZoom = false; - m_TxDF=0; - m_bDecodeFinished=false; } CPlotter::~CPlotter() { } // Destructor @@ -55,7 +45,20 @@ QSize CPlotter::sizeHint() const void CPlotter::resizeEvent(QResizeEvent* ) //resizeEvent() { if(!size().isValid()) return; - if( m_Size != size() ) { + applySize(); +} + +void CPlotter::ensureSized(int w, int h) +{ + resize(w, h); + if(!size().isValid()) return; + applySize(); +} + +void CPlotter::applySize() +{ + bool changed = (m_Size != size()); + if(changed) { //if changed, resize pixmaps to new screensize m_Size = size(); int w = m_Size.width(); @@ -66,14 +69,27 @@ void CPlotter::resizeEvent(QResizeEvent* ) //resizeEvent() m_WaterfallPixmap.fill(Qt::black); m_ZoomWaterfallPixmap.fill(Qt::black); m_2DPixmap.fill(Qt::black); - memset(m_zwf,0,32768*h); m_ScalePixmap = QPixmap(w,30); m_ZoomScalePixmap = QPixmap(w,30); //(no change on resize...) m_ScalePixmap.fill(Qt::white); m_ZoomScalePixmap.fill(Qt::yellow); + + // m_zwf (the zoom row's raw per-bin history) is intentionally NOT + // cleared here -- it's sized independently of the widget and already + // holds the real data; only the just-recreated pixmaps above lost + // their pixels. } SetCenterFreq(-1); - DrawOverlay(); + DrawOverlay(); // recomputes m_binsPerPixel/m_fSpan for the new width + if(changed) { + // Repaint both rows from the raw data that survived, now that + // DrawOverlay() above has updated m_fSpan/m_binsPerPixel to match + // the new width -- rebuildWideFromHistory() needs the *current* + // frequency-per-pixel to remap old rows by frequency, not raw index. + rebuildWideFromHistory(); + m_paintAllZoom = true; // forces paintEvent to fully repaint the + // zoom row from m_zwf at the new size + } } void CPlotter::paintEvent(QPaintEvent *) // paintEvent() @@ -87,6 +103,9 @@ void CPlotter::paintEvent(QPaintEvent *) // paintEvent() int h = (m_Size.height()-60)/2; painter.drawPixmap(0,0,m_ScalePixmap); painter.drawPixmap(0,30,m_WaterfallPixmap); + if (!m_decodeLabels.isEmpty()) { + paintDecodeLabels(painter); + } if(m_2Dspec) { painter.drawPixmap(0,h+30,m_ScalePixmap); painter.drawPixmap(0,h+60,m_2DPixmap); @@ -182,6 +201,8 @@ void CPlotter::draw(float s[], int i0, float splot[]) //draw() int i,j,w,h; float y; + if (m_WaterfallPixmap.isNull()) return; // not yet sized (window never shown) + m_i0=i0; w = m_WaterfallPixmap.width(); h = m_WaterfallPixmap.height(); @@ -240,6 +261,22 @@ void CPlotter::draw(float s[], int i0, float splot[]) //draw() } } + // Remember this row (raw, pre-color-map, post-abs), along with the + // frequency-per-pixel it was captured at, so a later resize can repaint + // m_WaterfallPixmap by remapping frequency to the new width instead of + // just blanking it (or, worse, copying pixel index i to pixel index i + // regardless of how many kHz that pixel now represents). + { + QVector row(w); + for (int k=0; k0) ? m_fSpan/w : 0.0; + m_wideHistory.prepend(line); + if (m_wideHistory.size() > kMaxWideHistory) m_wideHistory.removeLast(); + } + for(i=0; i<32768; i++) { y = 10.0*log10(splot[i]); int y1 = 5.0*gain*(y + 30 - m_plotZero); @@ -261,6 +298,46 @@ void CPlotter::draw(float s[], int i0, float splot[]) //draw() update(); //trigger a new paintEvent } +// Repaints m_WaterfallPixmap from m_wideHistory, for use right after a +// resize recreates it as a blank pixmap. Remaps by frequency (using each +// row's own captured startFreq/df against the *current* m_StartFreq/ +// m_fSpan) rather than by raw pixel index, so a width change rescales +// the preserved data instead of misaligning it. Uses the same +// color-mapping formula as draw()'s main loop; kept as a separate small +// duplicate rather than factored out, since draw()'s loop is also +// entangled with the histogram and 2D-spectrum bookkeeping that don't +// apply here. +void CPlotter::rebuildWideFromHistory() +{ + if (m_WaterfallPixmap.isNull()) return; + int w = m_WaterfallPixmap.width(); + int h = m_WaterfallPixmap.height(); + if (w<=0 || m_fSpan<=0.0) return; + double gain = pow(10.0,0.05*(m_plotGain+7)); + double newDf = m_fSpan/w; // kHz per pixel, current width + + QPainter painter(&m_WaterfallPixmap); + int rows = qMin(h, m_wideHistory.size()); + for (int y=0; y=n) continue; // outside what this row captured + float sv = line.row.at(j); + double yv = 10.0*log10(sv); + int y1 = 5.0*gain*(yv + 29 - m_plotZero); + if (y1<0) y1=0; + if (y1>254) y1=254; + if (sv>1.e29) y1=255; + painter.setPen(m_ColorTbl[y1]); + painter.drawPoint(i,y); + } + } +} + void CPlotter::UTCstr() { int ihr,imin; @@ -297,45 +374,42 @@ void CPlotter::DrawOverlay() //DrawOverlay() m_binsPerPixel = m_nSpan * 32768.0/(w*0.001*m_fSample) + 0.5; double FreqPerDiv=5.0; double df = m_binsPerPixel*0.001*m_fSample/32768.0; - m_hdivs = w*df/FreqPerDiv + 0.9999; m_fSpan = w*df; m_ScalePixmap.fill(Qt::white); painter0.drawRect(0, 0, w, 30); - //draw tick marks on wideband (upper) scale + // Wideband (upper) scale ticks and labels. Snap the first division to + // the nearest round FreqPerDiv-kHz frequency at or after m_StartFreq, + // rather than starting the grid at the raw left-edge frequency (which + // is generally not a multiple of FreqPerDiv) -- otherwise labels read + // e.g. 34,39,44,... instead of the intended 35,40,45,..., and the + // ticks themselves sit up to FreqPerDiv/2 kHz off from where the + // labels claim, not just a cosmetic mislabeling. Mirrors + // CVertPlotter::drawScale()'s equivalent fix for the vertical + // waterfall's own frequency scale. pixperdiv = FreqPerDiv/df; - for( int i=1; i0) { + for (int k=1; k<5; k++) { //minor ticks between this major and the previous one + int xm = (int)(x0 + (i-1)*pixperdiv + k*pixperdiv/5.0 + 0.5); + painter0.drawLine(xm,24,xm,30); + } + } + m_HDivText[i].setNum((int)(f0 + i*FreqPerDiv + 0.5)); } //draw frequency values - MakeFrequencyStrs(); - for( int i=0; i<=m_hdivs; i++) { - if(0==i) { - //left justify the leftmost text - x = (int)( (float)i*pixperdiv); - rect0.setRect(x,0, (int)pixperdiv, 20); - painter0.drawText(rect0, Qt::AlignLeft|Qt::AlignVCenter, - m_HDivText[i]); - } - else if(m_hdivs == i) { - //right justify the rightmost text - x = (int)( (float)i*pixperdiv - pixperdiv); - rect0.setRect(x,0, (int)pixperdiv, 20); - painter0.drawText(rect0, Qt::AlignRight|Qt::AlignVCenter, - m_HDivText[i]); - } else { - //center justify the rest of the text - x = (int)( (float)i*pixperdiv - pixperdiv/2); - rect0.setRect(x,0, (int)pixperdiv, 20); - painter0.drawText(rect0, Qt::AlignHCenter|Qt::AlignVCenter, - m_HDivText[i]); - } + for (int i=0; i<=ndivs; i++) { + x = (int)(x0 + i*pixperdiv + 0.5); + rect0.setRect(x-(int)(pixperdiv/2),0, (int)pixperdiv, 20); + painter0.drawText(rect0, Qt::AlignHCenter|Qt::AlignVCenter, + m_HDivText[i]); } @@ -491,6 +565,90 @@ float CPlotter::FreqfromX(int x) //FreqfromX() return f; } +void CPlotter::setDecodeLabels(const QList& labels) +{ + m_decodeLabels = labels; + update(); +} + +QVector CPlotter::layoutDecodeLabels() +{ + // Sort left-to-right so the stacking pass below assigns rows in order + // of x-position. + QList sorted = m_decodeLabels; + std::sort(sorted.begin(), sorted.end(), + [this](QMapDecodeLabel const& a, QMapDecodeLabel const& b) { + return XfromFreq(static_cast(a.receiveFrequencyKHz)) + < XfromFreq(static_cast(b.receiveFrequencyKHz)); + }); + + QFont font("Arial", 8, QFont::Bold); + QFontMetrics metrics(font); + const int row_height = metrics.height() + 1; + + // Up to 5 stack rows -- plenty for how many simultaneous decoded + // stations typically show up in one wideband span. + constexpr int max_rows = 5; + // Upper-waterfall geometry: paintEvent() draws the scale at y=0..30 + // and the waterfall row starting at y=30, height (m_Size.height()-60)/2. + constexpr int waterfall_top_y = 30; + int row_right_edge[max_rows]; + for (int i = 0; i < max_rows; ++i) row_right_edge[i] = -1000; + + QVector out; + for (auto const& l : sorted) { + if (l.receiveFrequencyKHz < m_StartFreq + || l.receiveFrequencyKHz > m_StartFreq + m_fSpan) continue; + const int x = XfromFreq(static_cast(l.receiveFrequencyKHz)); + const int text_w = metrics.horizontalAdvance(l.callsign); + const int rect_w = text_w + 4; + const int rect_x = x - rect_w / 2; + + int row = 0; + for (; row < max_rows; ++row) { + if (rect_x > row_right_edge[row] + 4) break; + } + if (row >= max_rows) continue; + row_right_edge[row] = rect_x + rect_w; + + const int y_top = waterfall_top_y + row_height * row; + out.append({l, QRect(rect_x, y_top, rect_w, row_height)}); + } + return out; +} + +void CPlotter::paintDecodeLabels(QPainter& painter) +{ + QFont font("Arial", 8, QFont::Bold); + painter.setFont(font); + const int row_height = QFontMetrics(font).height() + 1; + + for (auto const& lr : layoutDecodeLabels()) { + painter.fillRect(lr.rect, QColor(0, 0, 0, 180)); + + // Primary (60s) decodes yellow; second-30s-half decodes a distinct + // hue (orange) rather than a shade, so they stay legible at a glance. + const QColor col = lr.label.secondHalf ? QColor(255, 165, 0) : QColor(255, 255, 0); + const int x = XfromFreq(static_cast(lr.label.receiveFrequencyKHz)); + painter.setPen(QColor(col.red(), col.green(), col.blue(), 200)); + // Tick points down into the waterfall trace at the label's exact frequency. + painter.drawLine(x, lr.rect.top() + row_height, x, lr.rect.top() + row_height + 4); + painter.setPen(col); + painter.drawText(lr.rect, Qt::AlignHCenter | Qt::AlignVCenter, lr.label.callsign); + } +} + +bool CPlotter::hitTestDecodeLabel(QPoint const& pos, QMapDecodeLabel& label) +{ + for (auto const& lr : layoutDecodeLabels()) { + if (lr.rect.contains(pos)) { + label = lr.label; + return true; + } + } + return false; +} + void CPlotter::SetRunningState(bool running) //SetRunningState() { m_Running = running; @@ -601,8 +759,15 @@ void CPlotter::mousePressEvent(QMouseEvent *event) //mousePressEvent int button=event->button(); if(y < h+30) { // Wideband waterfall if(button==1) { + QMapDecodeLabel label; + bool const controlClick = event->modifiers() & Qt::ControlModifier; + bool const labelClicked = !controlClick + && hitTestDecodeLabel(QPoint(x,y), label); setFQSO(x,false); - if(event->modifiers() & Qt::ControlModifier) emit freezeDecode1(3); + if (labelClicked) { + m_decodeClickCoalescer.press(label.callsign, label.raw); + } + if(controlClick) emit freezeDecode1(3); } if(button==2 and !m_bLockTxRx) { if(x<0) x=0; // x is pixel number @@ -627,7 +792,14 @@ void CPlotter::mouseDoubleClickEvent(QMouseEvent *event) //mouse2click int y=event->y(); if(y < h+30) { m_DF=0; + QMapDecodeLabel label; + bool const controlClick = event->modifiers() & Qt::ControlModifier; + bool const labelClicked = !controlClick + && hitTestDecodeLabel(QPoint(x,y), label); setFQSO(x,false); + if (labelClicked) { + m_decodeClickCoalescer.doubleClick(label.callsign, label.raw); + } emit freezeDecode1(2); } else { float f = m_ZoomStartFreq + x*m_fSample/32768.0; diff --git a/qmap/plotter.h b/qmap/plotter.h index 36f0bcd0..ce4663b3 100644 --- a/qmap/plotter.h +++ b/qmap/plotter.h @@ -11,8 +11,12 @@ #include #include #include +#include +#include #include #include "commons.h" +#include "decode_click_coalescer.h" +#include "decode_label.h" #define VERT_DIVS 7 //specify grid screen divisions #define HORZ_DIVS 20 @@ -26,17 +30,17 @@ public: QSize minimumSizeHint() const override; QSize sizeHint() const override; - QColor m_ColorTbl[256]; - bool m_bDecodeFinished; - int m_plotZero; - int m_plotGain; - float m_fSpan; - qint32 m_nSpan; - qint32 m_binsPerPixel; - qint32 m_fQSO; - qint32 m_DF; - qint32 m_tol; - qint32 m_fCal; + QColor m_ColorTbl[256] {}; + bool m_bDecodeFinished {}; + int m_plotZero {}; + int m_plotGain {}; + float m_fSpan {65.f}; + qint32 m_nSpan {65}; + qint32 m_binsPerPixel {1}; + qint32 m_fQSO {125}; + qint32 m_DF {}; + qint32 m_tol {}; + qint32 m_fCal {}; void draw(float sw[], int i0, float splot[]); //Update the waterfalls void SetRunningState(bool running); @@ -75,65 +79,103 @@ public: double txFreq(); // void updateFreqLabel(); + void setDecodeLabels(const QList& labels); + + // Hidden plotters may not receive an initial resize event, but spectrum production still needs valid geometry. + void ensureSized(int w, int h); + signals: void freezeDecode0(int n); void freezeDecode1(int n); + void decodeLabelClicked(QByteArray decodeRow, DecodeClickGesture gesture); protected: //re-implemented widget event handlers void paintEvent(QPaintEvent *event) override; void resizeEvent(QResizeEvent* event) override; void mouseMoveEvent(QMouseEvent * event) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; private: void MakeFrequencyStrs(); void UTCstr(); + void applySize(); int XfromFreq(float f); float FreqfromX(int x); qint64 RoundFreq(qint64 freq, int resolution); + // Render m_decodeLabels overlay on top of the waterfall pixmap. Stacks + // colliding labels vertically (max 5 rows) so a busy band doesn't paint + // labels on top of each other. + void paintDecodeLabels(QPainter& painter); + + // Painting and hit-testing share the same collision-adjusted bounds. + struct DecodeLabelRect { + QMapDecodeLabel label; + QRect rect; + }; + QVector layoutDecodeLabels(); + bool hitTestDecodeLabel(QPoint const& pos, QMapDecodeLabel& label); + + // Raw wideband-row snapshots (post color-mapping input, pre color-map), + // front=newest, so a resize can repaint m_WaterfallPixmap from history + // instead of blanking it. m_zwf already plays this role for the zoom + // row -- this is the wideband row's counterpart. Each row keeps the + // frequency-per-pixel (df) it was captured at, since that changes with + // window width -- rebuildWideFromHistory() remaps by frequency, not by + // raw pixel index, so a width change rescales existing data instead of + // just shifting it to the wrong frequency. + struct WideHistoryLine { + QVector row; + double startFreq; // m_StartFreq at capture time + double df; // kHz per pixel at capture time (m_fSpan/width) + }; + void rebuildWideFromHistory(); + QList m_wideHistory; + static constexpr int kMaxWideHistory = 2048; + + QList m_decodeLabels; + DecodeClickCoalescer m_decodeClickCoalescer; QPixmap m_WaterfallPixmap; QPixmap m_ZoomWaterfallPixmap; QPixmap m_2DPixmap; - unsigned char m_zwf[32768*400]; + unsigned char m_zwf[32768*400] {}; QPixmap m_ScalePixmap; QPixmap m_ZoomScalePixmap; QSize m_Size; QString m_Str; QString m_HDivText[483]; - bool m_Running; - bool m_paintEventBusy; - bool m_2Dspec; - bool m_paintAllZoom; - bool m_bLockTxRx; - double m_CenterFreq; - double m_fGreen; - double m_TXfreq; - qint64 m_StartFreq; - qint64 m_ZoomStartFreq; - qint64 m_FreqOffset; - qint32 m_dBStepSize; - qint32 m_FreqUnits; - qint32 m_hdivs; - bool m_dataFromDisk; + bool m_Running {}; + bool m_paintEventBusy {}; + bool m_2Dspec {}; + bool m_paintAllZoom {}; + bool m_bLockTxRx {}; + double m_CenterFreq {}; + double m_fGreen {}; + double m_TXfreq {}; + qint64 m_StartFreq {100}; + qint64 m_ZoomStartFreq {}; + qint64 m_FreqOffset {}; + qint32 m_dBStepSize {}; + qint32 m_FreqUnits {1}; + qint32 m_hdivs {HORZ_DIVS}; + bool m_dataFromDisk {}; QString m_sutc; - qint32 m_line; - qint32 m_hist1[256]; - qint32 m_hist2[256]; - qint32 m_z1; - qint32 m_z2; - qint32 m_nkhz; - qint32 m_fSample; - qint32 m_mode65; - qint32 m_i0; - qint32 m_xClick; - qint32 m_TXkHz; - qint32 m_TxDF; - -private slots: - void mousePressEvent(QMouseEvent *event) override; - void mouseDoubleClickEvent(QMouseEvent *event) override; + qint32 m_line {}; + qint32 m_hist1[256] {}; + qint32 m_hist2[256] {}; + qint32 m_z1 {}; + qint32 m_z2 {}; + qint32 m_nkhz {}; + qint32 m_fSample {96000}; + qint32 m_mode65 {}; + qint32 m_i0 {}; + qint32 m_xClick {}; + qint32 m_TXkHz {125}; + qint32 m_TxDF {}; + }; #endif // PLOTTER_H diff --git a/qmap/qmap.pro b/qmap/qmap.pro deleted file mode 100644 index 3bc2b681..00000000 --- a/qmap/qmap.pro +++ /dev/null @@ -1,44 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2011-07-07T08:39:24 -# -#------------------------------------------------- - -QT += core gui network -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets -CONFIG += thread -#CONFIG += console - -TARGET = qmap -VERSION = 0.1 -TEMPLATE = app -DEFINES = QT5 - -F90 = gfortran -gfortran.output = ${QMAKE_FILE_BASE}.o -gfortran.commands = $$F90 -c -O2 -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} -gfortran.input = F90_SOURCES -QMAKE_EXTRA_COMPILERS += gfortran - -win32 { -DEFINES = WIN32 -} - -unix { -DEFINES = UNIX -} - -SOURCES += main.cpp mainwindow.cpp plotter.cpp about.cpp \ - soundin.cpp devsetup.cpp \ - widegraph.cpp getfile.cpp \ - astro.cpp displaytext.cpp getdev.cpp \ - meterwidget.cpp signalmeter.cpp - -HEADERS += mainwindow.h plotter.h soundin.h \ - about.h devsetup.h widegraph.h getfile.h \ - commons.h sleep.h astro.h displaytext.h \ - meterwidget.h signalmeter.h - -FORMS += mainwindow.ui about.ui devsetup.ui widegraph.ui \ - astro.ui txtune.ui - diff --git a/qmap/qmap_click_policy.h b/qmap/qmap_click_policy.h new file mode 100644 index 00000000..d5cedc0f --- /dev/null +++ b/qmap/qmap_click_policy.h @@ -0,0 +1,25 @@ +#ifndef QMAP_CLICK_POLICY_H +#define QMAP_CLICK_POLICY_H + +struct QMapClickPolicy +{ + bool disarmBeforeQsy {}; + bool enableAutoTx {}; + bool disableAutoTx {}; + bool restartTransmission {}; +}; + +constexpr QMapClickPolicy qmapClickPolicy (bool doubleClick, + bool frequencyChanged, + bool autoTxEnabled, + bool transmitting) noexcept +{ + return { + doubleClick && autoTxEnabled, + doubleClick && frequencyChanged, + !doubleClick && autoTxEnabled, + frequencyChanged && transmitting + }; +} + +#endif // QMAP_CLICK_POLICY_H diff --git a/qmap/qmap_decode_record.cpp b/qmap/qmap_decode_record.cpp new file mode 100644 index 00000000..7891bfeb --- /dev/null +++ b/qmap/qmap_decode_record.cpp @@ -0,0 +1,41 @@ +#include "qmap_decode_record.h" + +#include "Decoder/decodedtext.h" + +std::optional parseQMapDecodeRecord (QByteArray const& row) +{ + if (row.size () != static_cast (QMapDecodeRowSize)) return std::nullopt; + + auto text = QString::fromLatin1 (row.constData (), row.size ()); + auto const terminator = text.indexOf (QChar::Null); + if (terminator >= 0) text.truncate (terminator); + + bool timeOk {}; + bool receiveOk {}; + bool scheduledOk {}; + bool snrOk {}; + auto const hhmmss = text.left (6).toInt (&timeOk); + auto const hour = hhmmss / 10000; + auto const minute = (hhmmss / 100) % 100; + auto const second = hhmmss % 100; + + QMapDecodeRecord record; + record.raw = row; + record.time = text.left (6); + record.receiveFrequencyKHz = text.mid (6, 9).toDouble (&receiveOk); + record.scheduledFrequencyKHz = text.mid (15, 7).toDouble (&scheduledOk); + record.snr = text.mid (29, 5).toInt (&snrOk); + record.submode = text.mid (36, 3).trimmed (); + auto const fields = parseDecodedMessage (text.mid (41)); + record.callsign = fields.sender; + record.grid = fields.grid; + record.secondsSinceMidnight = hour * 3600 + minute * 60 + second; + record.secondHalf = second == 30; + record.cq = fields.cq; + + if (!timeOk || !receiveOk || !scheduledOk || !snrOk + || hour > 23 || minute > 59 || second > 59 || record.submode.isEmpty ()) { + return std::nullopt; + } + return record; +} diff --git a/qmap/qmap_decode_record.h b/qmap/qmap_decode_record.h new file mode 100644 index 00000000..1d0f3e03 --- /dev/null +++ b/qmap/qmap_decode_record.h @@ -0,0 +1,28 @@ +#ifndef QMAP_DECODE_RECORD_H +#define QMAP_DECODE_RECORD_H + +#include + +#include +#include + +#include "qmap_ipc.h" + +struct QMapDecodeRecord +{ + QByteArray raw; + QString time; + QString callsign; + QString grid; + QString submode; + double receiveFrequencyKHz {}; + double scheduledFrequencyKHz {}; + int snr {}; + int secondsSinceMidnight {}; + bool secondHalf {}; + bool cq {}; +}; + +std::optional parseQMapDecodeRecord (QByteArray const& row); + +#endif // QMAP_DECODE_RECORD_H diff --git a/qmap/qmap_ipc.h b/qmap/qmap_ipc.h new file mode 100644 index 00000000..2ded811d --- /dev/null +++ b/qmap/qmap_ipc.h @@ -0,0 +1,107 @@ +#ifndef QMAP_IPC_H +#define QMAP_IPC_H + +#include "decode_ipc.h" + +#include +#include +#include +#include +#include + +constexpr std::size_t QMapDecodeCapacity = qmap_decode_ipc::max_rows; +constexpr std::size_t QMapDecodeRowSize = qmap_decode_ipc::row_size; + +static_assert (QMapDecodeRowSize == 80, + "QMAP IPC must use the fixed 80-byte decoder row"); + +enum class QMapClickAction : std::int32_t +{ + None = 0, + Disarm = 1, + Select = 2, + SelectAndEnableTx = 3, +}; + +using QMapDecodeBlock = qmap_decode_ipc::DecodeRows; + +struct QMapClickMailbox +{ + char selectedDecode[QMapDecodeRowSize]; + QMapClickAction action; +}; + +struct QMapSharedMemory +{ + QMapDecodeBlock decodes; + QMapClickMailbox click; +}; + +static_assert (sizeof (std::int32_t) == 4, "QMAP IPC requires 32-bit integers"); +static_assert (std::is_standard_layout::value, + "QMAP click mailbox must have a stable field layout"); +static_assert (std::is_trivially_copyable::value, + "QMAP click mailbox must support byte-for-byte copying"); +static_assert (offsetof (QMapClickMailbox, action) == QMapDecodeRowSize, + "QMAP click request offset changed"); +static_assert (sizeof (QMapClickMailbox) == QMapDecodeRowSize + sizeof (std::int32_t), + "QMAP click mailbox size changed"); +static_assert (std::is_standard_layout::value, + "QMAP shared memory must have a stable field layout"); +static_assert (std::is_trivially_copyable::value, + "QMAP shared memory must support byte-for-byte copying"); +static_assert (offsetof (QMapSharedMemory, decodes) == 0, + "QMAP decode block must start the shared segment"); +static_assert (offsetof (QMapSharedMemory, click) == sizeof (QMapDecodeBlock), + "QMAP click mailbox offset changed"); +static_assert (sizeof (QMapSharedMemory) == sizeof (QMapDecodeBlock) + sizeof (QMapClickMailbox), + "QMAP IPC wire layout changed"); + +constexpr std::size_t QMapSharedMemorySize { + ((sizeof (QMapSharedMemory) + 15) / 16) * 16 +}; + +static_assert (QMapSharedMemorySize >= qmap_decode_ipc::shared_memory_size, + "QMAP shared memory must preserve the decoder segment size"); +static_assert (sizeof (QMapSharedMemory) <= QMapSharedMemorySize, + "QMAP IPC exceeds the shared-memory segment"); + +constexpr bool qmapDecoderRegionAvailable (std::size_t mappedSize) noexcept +{ + return mappedSize >= qmap_decode_ipc::shared_memory_size; +} + +constexpr bool qmapClickMailboxAvailable (std::size_t mappedSize) noexcept +{ + return mappedSize >= sizeof (QMapSharedMemory); +} + +constexpr std::size_t qmapClearLength (std::size_t mappedSize) noexcept +{ + return std::min (mappedSize, QMapSharedMemorySize); +} + +inline void clearQMapSharedMemory (void * mappedData, + std::size_t mappedSize) noexcept +{ + if (mappedData) std::memset (mappedData, 0, qmapClearLength (mappedSize)); +} + +inline void publishQMapDecodeBlock (QMapSharedMemory& shared, + QMapDecodeBlock& publication) noexcept +{ + publication.nWDecoderBusy = shared.decodes.nWDecoderBusy; + publication.nWTransmitting = shared.decodes.nWTransmitting; + publication.kHzRequested = shared.decodes.kHzRequested; + shared.decodes = publication; +} + +inline bool acknowledgeQMapDecodeBatch (QMapDecodeBlock& shared) noexcept +{ + if (shared.nQDecoderDone == 0) return false; + shared.ndecodes = 0; + shared.nQDecoderDone = 0; + return true; +} + +#endif // QMAP_IPC_H diff --git a/qmap/shared_memory_key.h b/qmap/shared_memory_key.h new file mode 100644 index 00000000..6a0a5cae --- /dev/null +++ b/qmap/shared_memory_key.h @@ -0,0 +1,15 @@ +#ifndef QMAP_SHARED_MEMORY_KEY_H +#define QMAP_SHARED_MEMORY_KEY_H + +#include + +namespace qmap_decode_ipc +{ + inline QString shared_memory_key () + { + auto const override_key = qEnvironmentVariable ("WSJT_QMAP_SHARED_MEMORY_KEY"); + return override_key.isEmpty () ? QStringLiteral ("mem_qmap") : override_key; + } +} + +#endif diff --git a/qmap/soundin.cpp b/qmap/soundin.cpp index 1b71b9e8..e84911ef 100644 --- a/qmap/soundin.cpp +++ b/qmap/soundin.cpp @@ -12,7 +12,7 @@ extern "C" { - struct + extern struct { double d8[60*96000]; //This is "common/datcom/..." in fortran float ss[400*NFFT]; diff --git a/qmap/vertwaterfall.cpp b/qmap/vertwaterfall.cpp new file mode 100644 index 00000000..ec42549e --- /dev/null +++ b/qmap/vertwaterfall.cpp @@ -0,0 +1,85 @@ +#include "vertwaterfall.h" +#include +#include "SettingsGroup.hpp" +#include "ui_vertwaterfall.h" + +VertWaterfall::VertWaterfall (QString const& settings_filename, QWidget * parent) + : QDialog {parent}, + ui {new Ui::VertWaterfall}, + m_settings_filename {settings_filename}, + m_decodeLabelsEnabled {true} +{ + ui->setupUi(this); + setWindowTitle("Vertical Waterfall"); + setWindowFlags(Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint); + + QSettings settings {m_settings_filename, QSettings::IniFormat}; + { + SettingsGroup g {&settings, "VertWaterfall"}; + setGeometry (settings.value ("VertWaterfallGeom", QRect {80,80,300,900}).toRect ()); + m_decodeLabelsEnabled = settings.value ("decode_labels_enabled", true).toBool (); + } + ui->cbShowCallsigns->setChecked (m_decodeLabelsEnabled); + + connect (ui->vertPlot, &CVertPlotter::decodeLabelClicked, + this, &VertWaterfall::decodeLabelClicked2); +} + +VertWaterfall::~VertWaterfall() +{ + saveSettings(); + delete ui; +} + +void VertWaterfall::saveSettings() +{ + QSettings settings {m_settings_filename, QSettings::IniFormat}; + SettingsGroup g {&settings, "VertWaterfall"}; + settings.setValue ("VertWaterfallGeom", geometry()); + settings.setValue ("decode_labels_enabled", m_decodeLabelsEnabled); +} + +void VertWaterfall::closeEvent(QCloseEvent * event) +{ + saveSettings(); + QDialog::closeEvent(event); +} + +void VertWaterfall::dataSinkVert(const float swide[], int n, double startFreqKHz, double fSpanKHz, + int plotZero, int plotGain) +{ + ui->vertPlot->draw(swide, n, startFreqKHz, fSpanKHz, plotZero, plotGain); +} + +void VertWaterfall::addDecodeLabel(QMapDecodeRecord const& record) +{ + if (!m_decodeLabelsEnabled) return; + pruneQMapDecodeLabels(m_decodeLabels, record.secondsSinceMidnight); + upsertQMapDecodeLabel(m_decodeLabels, record); + ui->vertPlot->setDecodeLabels(m_decodeLabels); +} + +void VertWaterfall::pruneDecodeLabels(int nowSeconds) +{ + auto const previousSize = m_decodeLabels.size(); + pruneQMapDecodeLabels(m_decodeLabels, nowSeconds); + if (m_decodeLabels.size() != previousSize) { + ui->vertPlot->setDecodeLabels(m_decodeLabels); + } +} + +void VertWaterfall::clearDecodeLabels() +{ + if (m_decodeLabels.isEmpty ()) return; + m_decodeLabels.clear (); + ui->vertPlot->setDecodeLabels (m_decodeLabels); +} + +void VertWaterfall::on_cbShowCallsigns_toggled(bool checked) +{ + m_decodeLabelsEnabled = checked; + if (!checked) { + m_decodeLabels.clear(); + ui->vertPlot->setDecodeLabels(m_decodeLabels); + } +} diff --git a/qmap/vertwaterfall.h b/qmap/vertwaterfall.h new file mode 100644 index 00000000..3a713b5e --- /dev/null +++ b/qmap/vertwaterfall.h @@ -0,0 +1,47 @@ +#ifndef VERTWATERFALL_H +#define VERTWATERFALL_H + +#include +#include +#include +#include "vplotter.h" + +namespace Ui { + class VertWaterfall; +} + +class VertWaterfall : public QDialog +{ + Q_OBJECT + +public: + explicit VertWaterfall (QString const& settings_filename, QWidget * parent = nullptr); + ~VertWaterfall(); + + void saveSettings(); + void pruneDecodeLabels(int nowSeconds); + void clearDecodeLabels(); + +public slots: + void dataSinkVert(const float swide[], int n, double startFreqKHz, double fSpanKHz, + int plotZero, int plotGain); + void addDecodeLabel(QMapDecodeRecord const& record); + +signals: + void decodeLabelClicked2(QByteArray decodeRow, DecodeClickGesture gesture); + +protected: + void closeEvent(QCloseEvent * event) override; + +private slots: + void on_cbShowCallsigns_toggled(bool checked); + +private: + Ui::VertWaterfall * ui; + QString m_settings_filename; + + QList m_decodeLabels; + bool m_decodeLabelsEnabled; +}; + +#endif // VERTWATERFALL_H diff --git a/qmap/vertwaterfall.ui b/qmap/vertwaterfall.ui new file mode 100644 index 00000000..4c745dcb --- /dev/null +++ b/qmap/vertwaterfall.ui @@ -0,0 +1,78 @@ + + + VertWaterfall + + + + 0 + 0 + 300 + 900 + + + + Vertical Waterfall + + + + + + + 0 + 0 + + + + + 150 + 200 + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + + + + + + + Show callsigns + + + true + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + CVertPlotter + QFrame +
vplotter.h
+ 1 +
+
+ + +
diff --git a/qmap/vplotter.cpp b/qmap/vplotter.cpp new file mode 100644 index 00000000..91e9b26d --- /dev/null +++ b/qmap/vplotter.cpp @@ -0,0 +1,367 @@ +#include "vplotter.h" +#include +#include +#include +#include +#include +#include + +CVertPlotter::CVertPlotter(QWidget *parent) : + QFrame(parent), + m_decodeClickCoalescer {this, [this] (QByteArray const& decodeRow, DecodeClickGesture gesture) { + emit decodeLabelClicked (decodeRow, gesture); + }} +{ + setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + setAttribute(Qt::WA_OpaquePaintEvent, false); + setAttribute(Qt::WA_NoSystemBackground, true); + + m_scaleWidth = 40; + m_labelWidth = 90; + m_startFreqKHz = 0.0; + m_fSpanKHz = 1.0; + m_hdivs = 0; + m_size = QSize(0,0); + m_waterfallPixmap = QPixmap(0,0); + m_scalePixmap = QPixmap(0,0); + setPalette("Linrad"); +} + +CVertPlotter::~CVertPlotter() { } + +QSize CVertPlotter::minimumSizeHint() const +{ + return QSize(m_scaleWidth + m_labelWidth + 40, 100); +} + +QSize CVertPlotter::sizeHint() const +{ + return QSize(m_scaleWidth + m_labelWidth + 120, 800); +} + +void CVertPlotter::resizeEvent(QResizeEvent*) +{ + if(!size().isValid()) return; + if(m_size != size()) { + m_size = size(); + int w = qMax(1, m_size.width() - m_scaleWidth - m_labelWidth); + int h = m_size.height(); + m_waterfallPixmap = QPixmap(w,h); + m_waterfallPixmap.fill(Qt::black); + m_scalePixmap = QPixmap(m_scaleWidth,h); + m_scalePixmap.fill(QColor(235,235,230)); + rebuildFromHistory(); + } + drawScale(); +} + +// y=0 is the top of the spectrogram (highest frequency in span); y=h-1 +// is the bottom (lowest frequency), matching "frequency runs bottom to +// top" as requested. +int CVertPlotter::yFromFreq(double freq_khz) const +{ + int h = m_waterfallPixmap.height(); + if(h<=0 || m_fSpanKHz<=0.0) return 0; + double frac = (freq_khz - m_startFreqKHz)/m_fSpanKHz; // 0=bottom .. 1=top + int y = int((1.0 - frac)*h + 0.5); + if(y<0) y=0; + if(y>h-1) y=h-1; + return y; +} + +void CVertPlotter::draw(const float swide[], int n, double startFreqKHz, double fSpanKHz, + int plotZero, int plotGain) +{ + if(n<=0 || m_waterfallPixmap.isNull()) return; + m_startFreqKHz = startFreqKHz; + m_fSpanKHz = fSpanKHz; + + // Remember this column (raw, pre-color-map) so a later resize can + // repaint the spectrogram instead of blanking it. + { + HistoryLine line; + line.swide.resize(n); + for (int k=0; k kMaxHistory) m_history.removeLast(); + } + + int w = m_waterfallPixmap.width(); + int h = m_waterfallPixmap.height(); + double gain = pow(10.0,0.05*(plotGain+7)); + + //move current data left one column (must do this before attaching a QPainter) + m_waterfallPixmap.scroll(-1,0,0,0,w,h); + QPainter painter(&m_waterfallPixmap); + + for(int y=0; yn-1) j=n-1; + float sv = swide[j]; + if(sv<0) sv=-sv; //strong-signal tag, ignored for color here + double yv = 10.0*log10(sv); + int y1 = int(5.0*gain*(yv + 29 - plotZero)); + if(y1<0) y1=0; + if(y1>254) y1=254; + if(sv>1.e29) y1=255; + painter.setPen(m_ColorTbl[y1]); + painter.drawPoint(w-1,y); + } + + drawScale(); + update(); +} + +// Repaints the spectrogram from m_history, for use right after a resize +// recreates m_waterfallPixmap as blank. Same color-mapping formula as +// draw()'s loop (kept as a separate small duplicate rather than shared, +// same tradeoff as CPlotter::rebuildWideFromHistory). A column narrower +// or wider than the current width is left as-is (each column already +// resamples to the current height independent of its own sample count). +void CVertPlotter::rebuildFromHistory() +{ + if (m_waterfallPixmap.isNull()) return; + int w = m_waterfallPixmap.width(); + int h = m_waterfallPixmap.height(); + m_waterfallPixmap.fill(Qt::black); + QPainter painter(&m_waterfallPixmap); + + int cols = qMin(w, m_history.size()); + for (int age=0; agen-1) j=n-1; + float sv = line.swide.at(j); + if(sv<0) sv=-sv; + double yv = 10.0*log10(sv); + int y1 = int(5.0*gain*(yv + 29 - line.plotZero)); + if(y1<0) y1=0; + if(y1>254) y1=254; + if(sv>1.e29) y1=255; + painter.setPen(m_ColorTbl[y1]); + painter.drawPoint(x,y); + } + } +} + +// Chooses a round kHz step (5/10/25/50/...) that keeps ticks from +// crowding, then the first (bottom-most) tick frequency at or above +// m_startFreqKHz, and formats the label text for each tick. +void CVertPlotter::makeFrequencyStrs() +{ + m_hdivs = 0; + int h = m_scalePixmap.height(); + if(h<=0 || m_fSpanKHz<=0.0) return; + + static const double steps[] = {5.0,10.0,25.0,50.0,100.0,200.0,500.0,1000.0}; + double pixPerKHz = h/m_fSpanKHz; + m_freqPerDiv = steps[0]; + for (double step : steps) { + m_freqPerDiv = step; + if (step*pixPerKHz >= 24.0) break; + } + + m_freq0 = qCeil(m_startFreqKHz/m_freqPerDiv)*m_freqPerDiv; + m_hdivs = qMin(63, int((m_startFreqKHz+m_fSpanKHz-m_freq0)/m_freqPerDiv + 1.e-6)); + for(int i=0; i<=m_hdivs; i++) { + double f = m_freq0 + i*m_freqPerDiv; + m_HDivText[i] = QString::number(f, 'f', 0); + } +} + +void CVertPlotter::drawScale() +{ + if(m_scalePixmap.isNull()) return; + int w = m_scalePixmap.width(); + + QPainter painter(&m_scalePixmap); + QFont font("Arial"); + font.setPointSize(8); + painter.setFont(font); + m_scalePixmap.fill(QColor(235,235,230)); + painter.setPen(QColor(120,120,115)); + painter.drawLine(0,0,0,m_scalePixmap.height()); // thin rule against the spectrogram edge + + makeFrequencyStrs(); + painter.setPen(Qt::black); + for(int i=0; i<=m_hdivs; i++) { + double f = m_freq0 + i*m_freqPerDiv; + int y = yFromFreq(f); + painter.drawLine(0,y,6,y); + QRect rect0(8, y-8, w-10, 16); + painter.drawText(rect0, Qt::AlignLeft|Qt::AlignVCenter, m_HDivText[i]); + } +} + +void CVertPlotter::setDecodeLabels(const QList& labels) +{ + m_decodeLabels = labels; + update(); +} + +QFont CVertPlotter::labelFont() const +{ + QFont font("Arial"); + font.setPointSize(9); + return font; +} + +// Displace nearby labels downward in frequency order to keep them legible. +QVector CVertPlotter::computeLayout(QFontMetrics const& fm, int minSpacing) const +{ + int labelX = m_waterfallPixmap.width() + m_scaleWidth; + int indentPx = fm.horizontalAdvance("MM"); + + QVector out; + out.reserve(m_decodeLabels.size()); + for (auto const& lab : qAsConst(m_decodeLabels)) { + if (lab.receiveFrequencyKHz < m_startFreqKHz + || lab.receiveFrequencyKHz > m_startFreqKHz + m_fSpanKHz) continue; + LabelLayout ll; + ll.label = lab; + ll.trueY = ll.dispY = yFromFreq(lab.receiveFrequencyKHz); + ll.textX = labelX + 14 + (lab.secondHalf ? indentPx : 0); + out.append(ll); + } + std::sort(out.begin(), out.end(), [](LabelLayout const& a, LabelLayout const& b) { + return a.trueY < b.trueY; + }); + for (int i=1; ibutton() != Qt::LeftButton) return; + QMapDecodeLabel label; + if (hitTestDecodeLabel(event->pos(), label)) { + m_decodeClickCoalescer.press(label.callsign, label.raw); + } +} + +void CVertPlotter::mouseDoubleClickEvent(QMouseEvent *event) +{ + if (event->button() != Qt::LeftButton) return; + QMapDecodeLabel label; + if (hitTestDecodeLabel(event->pos(), label)) { + m_decodeClickCoalescer.doubleClick(label.callsign, label.raw); + } +} + +void CVertPlotter::paintEvent(QPaintEvent*) +{ + QPainter painter(this); + int w = m_waterfallPixmap.width(); + painter.drawPixmap(0,0,m_waterfallPixmap); + painter.drawPixmap(w,0,m_scalePixmap); + + int labelX = w + m_scaleWidth; + painter.fillRect(labelX, 0, m_labelWidth, height(), QColor(255,255,240)); + + QFont font = labelFont(); + painter.setFont(font); + QFontMetrics fm(font); + int minSpacing = fm.height() + 2; + + QColor dotColor(230,200,40); + QColor leaderColor(150,150,140); + for (auto const& ll : computeLayout(fm, minSpacing)) { + painter.setPen(Qt::NoPen); + painter.setBrush(dotColor); + painter.drawEllipse(QPoint(labelX+5,ll.trueY), 3, 3); + if (ll.dispY != ll.trueY || ll.label.secondHalf) { + painter.setPen(QPen(leaderColor,1)); + painter.drawLine(labelX+8, ll.trueY, ll.textX-2, ll.dispY); + } + painter.setPen(Qt::black); + painter.drawText(ll.textX, ll.dispY+4, ll.label.callsign); + } +} + +void CVertPlotter::setPalette(QString palette) +{ + if(palette=="Linrad") { + float twopi=6.2831853f; + float r,g,b,phi,x; + for(int i=0; i<256; i++) { + r=0.0; + if(i>105 and i<=198) { + phi=(twopi/4.0f) * (i-105.0f)/(198.0f-105.0f); + r=sin(phi); + } else if(i>=198) { + r=1.0; + } + + g=0.0; + if(i>35 and i<198) { + phi=(twopi/4.0f) * (i-35.0f)/(122.5f-35.0f); + g=0.625f*sin(phi); + } else if(i>=198) { + x=(i-186.0f); + g=-0.014f + 0.0144f*x -0.00007f*x*x +0.000002f*x*x*x; + if(g>1.0) g=1.0; + } + + b=0.0; + if(i<=117) { + phi=(twopi/2.0f) * i/117.0f; + b=0.4531f*sin(phi); + } else if(i>186) { + x=(i-186.0f); + b=-0.014f + 0.0144f*x -0.00007f*x*x +0.000002f*x*x*x; + if(b>1.0) b=1.0; + } + m_ColorTbl[i].setRgb(int(255.0*r),int(255.0*g),int(255.0*b)); + } + m_ColorTbl[255].setRgb(255,255,100); + } + + if(palette=="CuteSDR") { + for(int i=0; i<256; i++) { + if( (i<43) ) + m_ColorTbl[i].setRgb( 0,0, 255*(i)/43); + if( (i>=43) && (i<87) ) + m_ColorTbl[i].setRgb( 0, 255*(i-43)/43, 255 ); + if( (i>=87) && (i<120) ) + m_ColorTbl[i].setRgb( 0,255, 255-(255*(i-87)/32)); + if( (i>=120) && (i<154) ) + m_ColorTbl[i].setRgb( (255*(i-120)/33), 255, 0); + if( (i>=154) && (i<217) ) + m_ColorTbl[i].setRgb( 255, 255 - (255*(i-154)/62), 0); + if( (i>=217) ) + m_ColorTbl[i].setRgb( 255, 0, 128*(i-217)/38); + } + m_ColorTbl[255].setRgb(255,255,100); + } +} diff --git a/qmap/vplotter.h b/qmap/vplotter.h new file mode 100644 index 00000000..8d50de01 --- /dev/null +++ b/qmap/vplotter.h @@ -0,0 +1,103 @@ +/////////////////////////////////////////////////////////////////////////// +// Rotated counterpart of plotter.h/CPlotter: frequency runs bottom-to-top +// instead of left-to-right, and spectra scroll to the left instead of +// scrolling down. Used by VertWaterfall, the optional narrow/tall sibling +// of the Horizontal Waterfall (WideGraph/CPlotter). +/////////////////////////////////////////////////////////////////////////// + +#ifndef VPLOTTER_H +#define VPLOTTER_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "decode_click_coalescer.h" +#include "decode_label.h" + +class QMouseEvent; +class QFontMetrics; + +class CVertPlotter : public QFrame +{ + Q_OBJECT +public: + explicit CVertPlotter(QWidget *parent = nullptr); + ~CVertPlotter(); + + QSize minimumSizeHint() const override; + QSize sizeHint() const override; + + // swide[0..n-1] is the same decimated spectrum WideGraph paints as the + // top row of its waterfall (increasing index = increasing frequency), + // spanning [startFreqKHz, startFreqKHz+fSpanKHz]. plotZero/plotGain are + // WideGraph's current values, so color mapping matches it exactly. + void draw(const float swide[], int n, double startFreqKHz, double fSpanKHz, + int plotZero, int plotGain); + void setPalette(QString palette); + void setDecodeLabels(const QList& labels); + +signals: + void decodeLabelClicked(QByteArray decodeRow, DecodeClickGesture gesture); + +protected: + void paintEvent(QPaintEvent *event) override; + void resizeEvent(QResizeEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; + +private: + void drawScale(); + int yFromFreq(double freq_khz) const; + void makeFrequencyStrs(); + + // One remembered column (raw, pre-color-map), so a resize can repaint + // the spectrogram from history instead of blanking it. Keeps its own + // freq/gain context, so an old column still renders how it looked when + // captured even if the live settings have since changed. + struct HistoryLine { + QVector swide; + double startFreqKHz; + double fSpanKHz; + int plotZero; + int plotGain; + }; + void rebuildFromHistory(); + QList m_history; // front = newest + static constexpr int kMaxHistory = 4096; + + // Painting and hit-testing share the same frequency and displaced text bounds. + struct LabelLayout { + QMapDecodeLabel label; + int trueY; + int dispY; + int textX; + QRect rect; + }; + QVector computeLayout(QFontMetrics const& fm, int minSpacing) const; + QFont labelFont() const; + bool hitTestDecodeLabel(QPoint const& pos, QMapDecodeLabel& label); + + QColor m_ColorTbl[256]; + QPixmap m_waterfallPixmap; // spectrogram: x=time (newest at right), y=frequency (high at top) + QPixmap m_scalePixmap; // frequency ticks/labels, drawn just right of the spectrogram + QSize m_size; + int m_scaleWidth; // px reserved for the tick/label strip + int m_labelWidth; // px reserved for decoded-callsign text, right of the scale + double m_startFreqKHz; // frequency at the bottom edge + double m_fSpanKHz; + QString m_HDivText[64]; + int m_hdivs; + double m_freqPerDiv; + double m_freq0; // frequency of the first (bottom-most) tick + + QList m_decodeLabels; + DecodeClickCoalescer m_decodeClickCoalescer; +}; + +#endif // VPLOTTER_H diff --git a/qmap/widegraph.cpp b/qmap/widegraph.cpp index bc64fd50..4290ec7d 100644 --- a/qmap/widegraph.cpp +++ b/qmap/widegraph.cpp @@ -12,7 +12,7 @@ WideGraph::WideGraph (QString const& settings_filename, QWidget * parent) m_settings_filename {settings_filename} { ui->setupUi(this); - setWindowTitle("Wideband Waterfall"); + setWindowTitle("Horizontal Waterfall"); setWindowFlags(Qt::WindowCloseButtonHint | Qt::WindowMinimizeButtonHint); installEventFilter(parent); //Installing the filter ui->widePlot->setCursor(Qt::CrossCursor); @@ -21,12 +21,16 @@ WideGraph::WideGraph (QString const& settings_filename, QWidget * parent) ui->widePlot->setMaximumHeight(800); connect(ui->widePlot, SIGNAL(freezeDecode1(int)),this, SLOT(wideFreezeDecode(int))); + connect(ui->widePlot, &CPlotter::decodeLabelClicked, + this, &WideGraph::decodeLabelClicked2); //Restore user's settings QSettings settings {m_settings_filename, QSettings::IniFormat}; + QRect geom; { SettingsGroup g {&settings, "MainWindow"}; // historical reasons - setGeometry (settings.value ("WideGraphGeom", QRect {45,30,1023,340}).toRect ()); + geom = settings.value ("WideGraphGeom", QRect {45,30,1023,340}).toRect (); + setGeometry (geom); } SettingsGroup g {&settings, "WideGraph"}; ui->widePlot->setPlotZero(settings.value("PlotZero", 20).toInt()); @@ -41,6 +45,8 @@ WideGraph::WideGraph (QString const& settings_filename, QWidget * parent) ui->widePlot->setBinsPerPixel(nbpp); m_waterfallAvg = settings.value("WaterfallAvg",10).toInt(); ui->waterfallAvgSpinBox->setValue(m_waterfallAvg); + + ui->widePlot->ensureSized(w, qMax(100, geom.height()-60)); } WideGraph::~WideGraph() @@ -109,6 +115,8 @@ void WideGraph::dataSink2(float s[], int nkhz, int ihsym, int ndiskdata, } n=0; + if (ui->widePlot->plotWidth() <= 0) return; // not yet sized (window never shown) + int w=ui->widePlot->plotWidth(); qint64 sf = nkhz - 0.5*w*nbpp*df/1000.0; if(sf != ui->widePlot->startFreq()) ui->widePlot->SetStartFreq(sf); @@ -138,9 +146,34 @@ void WideGraph::dataSink2(float s[], int nkhz, int ihsym, int ndiskdata, } ntrz=ntr; ui->widePlot->draw(swide,i0,splot); + emit spectrumReady(swide, qMin(w,2048), ui->widePlot->startFreq(), ui->widePlot->m_fSpan, + ui->widePlot->getPlotZero(), ui->widePlot->getPlotGain()); + } +} + +void WideGraph::addDecodeLabel(QMapDecodeRecord const& record) +{ + pruneQMapDecodeLabels(m_decodeLabels, record.secondsSinceMidnight); + upsertQMapDecodeLabel(m_decodeLabels, record); + if (ui && ui->widePlot) ui->widePlot->setDecodeLabels(m_decodeLabels); +} + +void WideGraph::pruneDecodeLabels(int nowSeconds) +{ + auto const previousSize = m_decodeLabels.size(); + pruneQMapDecodeLabels(m_decodeLabels, nowSeconds); + if (m_decodeLabels.size() != previousSize && ui && ui->widePlot) { + ui->widePlot->setDecodeLabels(m_decodeLabels); } } +void WideGraph::clearDecodeLabels() +{ + if (m_decodeLabels.isEmpty ()) return; + m_decodeLabels.clear (); + if (ui && ui->widePlot) ui->widePlot->setDecodeLabels (m_decodeLabels); +} + void WideGraph::on_waterfallAvgSpinBox_valueChanged(int n) { m_waterfallAvg = n; diff --git a/qmap/widegraph.h b/qmap/widegraph.h index e678a664..2dc241cc 100644 --- a/qmap/widegraph.h +++ b/qmap/widegraph.h @@ -2,6 +2,9 @@ #define WIDEGRAPH_H #include +#include +#include "decode_click_coalescer.h" +#include "decode_label.h" namespace Ui { class WideGraph; @@ -36,11 +39,21 @@ public: void updateFreqLabel(); void enableSetRxHardware(bool b); + void addDecodeLabel(QMapDecodeRecord const& record); + void pruneDecodeLabels(int nowSeconds); + void clearDecodeLabels(); + qint32 m_qsoFreq; signals: void freezeDecode2(int n); void f11f12(int n); + void decodeLabelClicked2(QByteArray decodeRow, DecodeClickGesture gesture); + // Emitted once per average cycle, right after the Horizontal Waterfall's + // own top-row draw(), so VertWaterfall can show exactly the same + // spectral data instead of an independently-decimated copy of it. + void spectrumReady(const float swide[], int n, double startFreqKHz, double fSpanKHz, + int plotZero, int plotGain); public slots: void wideFreezeDecode(int n); @@ -68,6 +81,8 @@ private: qint32 m_fSample; qint32 m_mode65; qint32 m_TRperiod=60; + + QList m_decodeLabels; }; #endif // WIDEGRAPH_H diff --git a/qmap/wsjt.ico b/qmap/wsjt.ico index 8a55550f..dcbba2ca 100644 Binary files a/qmap/wsjt.ico and b/qmap/wsjt.ico differ diff --git a/qt_helpers.cpp b/qt_helpers.cpp index 5e4b233a..a9e5b14d 100644 --- a/qt_helpers.cpp +++ b/qt_helpers.cpp @@ -8,6 +8,15 @@ #include #include #include +#include +#include +#include + +#include + +#if CMAKE_BUILD +#include "wsjtx_config.h" +#endif QString font_as_stylesheet (QFont const& font) { @@ -31,6 +40,19 @@ QString font_as_stylesheet (QFont const& font) .arg (font_weight); } +QString application_style_sheet (QString const& base_style_sheet, + QString const& dark_style_sheet, + bool dark_style, + QFont const& font) +{ + auto style_sheet = dark_style ? dark_style_sheet : base_style_sheet; + if (!style_sheet.isEmpty ()) + { + style_sheet += '\n'; + } + return style_sheet + "* {" + font_as_stylesheet (font) + '}'; +} + void update_dynamic_property (QWidget * widget, char const * property, QVariant const& value) { widget->setProperty (property, value); @@ -39,32 +61,233 @@ void update_dynamic_property (QWidget * widget, char const * property, QVariant widget->update (); } -QDateTime qt_round_date_time_to (QDateTime dt, int milliseconds) +namespace { - dt.setMSecsSinceEpoch (dt.addMSecs (milliseconds / 2).toMSecsSinceEpoch () / milliseconds * milliseconds); +enum class DateTimeAlignment +{ + earlier, + nearest +}; + +QDateTime align_date_time (QDateTime dt, int milliseconds, DateTimeAlignment alignment) +{ + if (!dt.isValid () || milliseconds <= 0) + { + return {}; + } + + auto const interval = static_cast (milliseconds); + auto const timestamp = dt.toMSecsSinceEpoch (); + auto remainder = timestamp % interval; + if (remainder < 0) + { + remainder += interval; + } + + auto offset = -remainder; + if (alignment == DateTimeAlignment::nearest && remainder >= interval - remainder) + { + offset = interval - remainder; + } + + if ((offset > 0 && timestamp > std::numeric_limits::max () - offset) + || (offset < 0 && timestamp < std::numeric_limits::min () - offset)) + { + return {}; + } + + dt.setMSecsSinceEpoch (timestamp + offset); return dt; } +} + +QDateTime qt_round_date_time_to (QDateTime dt, int milliseconds) +{ + return align_date_time (dt, milliseconds, DateTimeAlignment::nearest); +} QDateTime qt_truncate_date_time_to (QDateTime dt, int milliseconds) { - dt.setMSecsSinceEpoch (dt.toMSecsSinceEpoch () / milliseconds * milliseconds); - return dt; + return align_date_time (dt, milliseconds, DateTimeAlignment::earlier); } -QString app_sounds_directory (QString const& subdirectory) +namespace +{ +QDir legacy_app_sounds_directory () { #if defined (__APPLE__) - QString root {QCoreApplication::applicationDirPath () + "/../Resources/sounds"}; + return QDir {QCoreApplication::applicationDirPath () + "/../Resources/sounds"}; #else - QString root {QCoreApplication::applicationDirPath () + "/sounds"}; + return QDir {QCoreApplication::applicationDirPath () + "/sounds"}; #endif - auto child = subdirectory; +} + +QString normalized_app_sounds_child (QString const& subdirectory) +{ + auto child = subdirectory.trimmed (); + child.replace (QChar {'\\'}, QChar {'/'}); while (child.startsWith (QChar {'/'})) { child.remove (0, 1); } + return QDir::cleanPath (child); +} + +bool normalized_app_sounds_child_is_safe (QString const& child) +{ + return child.isEmpty () || child == "." + || (!QDir::isAbsolutePath (child) && child != ".." && !child.startsWith ("../")); +} +} + +QDir resolve_installed_data_directory (QString const& application_directory, + QString const& configured_data_destination, + QString const& relative_application_root) +{ + if (QDir::isAbsolutePath (configured_data_destination)) + { + return QDir {QDir::cleanPath (configured_data_destination)}; + } + + QDir application {application_directory}; + auto const destination = QDir::cleanPath ( + application.absoluteFilePath (relative_application_root + QChar {'/'} + configured_data_destination)); + return QDir {destination}; +} + +QDir installed_data_directory () +{ +#if CMAKE_BUILD +#if defined (Q_OS_MAC) + auto const relative_application_root = QStringLiteral ("../../.."); +#else + auto const relative_application_root = QStringLiteral (".."); +#endif + return resolve_installed_data_directory (QCoreApplication::applicationDirPath (), + QString::fromUtf8 (WSJT_DATA_DESTINATION), + relative_application_root); +#else + return QDir {QCoreApplication::applicationDirPath ()}; +#endif +} + +QDir preferred_sounds_directory (QDir const& canonical_directory, QDir const& legacy_directory) +{ + if (canonical_directory.exists ()) + { + return canonical_directory; + } + if (legacy_directory.exists ()) + { + return legacy_directory; + } + return canonical_directory; +} + +QDir app_sounds_directory () +{ + auto const legacy_directory = legacy_app_sounds_directory (); +#if defined (Q_OS_LINUX) + return preferred_sounds_directory (QDir {installed_data_directory ().absoluteFilePath ("sounds")}, + legacy_directory); +#else + return legacy_directory; +#endif +} + +QString voice_manifest_path (QDir const& canonical_directory, QDir const& legacy_directory) +{ + for (auto const& directory : {canonical_directory, legacy_directory}) + { + QFile manifest {directory.absoluteFilePath ("voices.dat")}; + if (manifest.open (QIODevice::ReadOnly | QIODevice::Text)) + { + return manifest.fileName (); + } + } + return {}; +} + +QString app_voice_manifest_path () +{ + auto const legacy_directory = legacy_app_sounds_directory (); +#if defined (Q_OS_LINUX) + return voice_manifest_path (QDir {installed_data_directory ().absoluteFilePath ("sounds")}, + legacy_directory); +#else + return voice_manifest_path (legacy_directory, legacy_directory); +#endif +} + +bool app_sounds_subdirectory_is_safe (QString const& subdirectory) +{ + return normalized_app_sounds_child_is_safe (normalized_app_sounds_child (subdirectory)); +} + +bool parse_app_voice_entry (QString const& record, QString& subdirectory, QString& display_name) +{ + auto const fields = record.split (QChar {'|'}); + if (fields.size () != 2) + { + return false; + } - QDir dir {root}; - auto path = child.isEmpty () ? dir.absolutePath () : dir.absoluteFilePath (child); - return QDir::cleanPath (path) + QChar {'/'}; + auto const candidate_subdirectory = fields.at (0).trimmed (); + auto const candidate_display_name = fields.at (1).trimmed (); + auto const normalized_subdirectory = normalized_app_sounds_child (candidate_subdirectory); + if (normalized_subdirectory.isEmpty () || normalized_subdirectory == "." + || candidate_display_name.isEmpty () + || !normalized_app_sounds_child_is_safe (normalized_subdirectory)) + { + return false; + } + + subdirectory = normalized_subdirectory; + display_name = candidate_display_name; + return true; +} + +QDir sounds_subdirectory (QDir const& root_directory, QString const& subdirectory) +{ + auto const root = QDir::cleanPath (root_directory.absolutePath ()); + auto const child = normalized_app_sounds_child (subdirectory); + + if (!normalized_app_sounds_child_is_safe (child) || child.isEmpty () || child == ".") + { + return QDir {root}; + } + + auto const path = QDir::cleanPath (QDir {root}.absoluteFilePath (child)); + if (path != root && !path.startsWith (root + QChar {'/'})) + { + return QDir {root}; + } + return QDir {path}; +} + +int next_cyclic_index (int current_index, int item_count) +{ + if (item_count <= 0) + { + return -1; + } + + return (current_index + 1) % item_count; +} + +QString writable_file_path (QDir const& writable_dir, QString const& file_name) +{ + return writable_dir.absoluteFilePath (file_name); +} + +QString writable_override_or_installed_file_path (QDir const& writable_dir, QDir const& installed_dir, + QString const& file_name) +{ + auto writable_path = writable_file_path (writable_dir, file_name); + return QFileInfo::exists (writable_path) ? writable_path : installed_dir.absoluteFilePath (file_name); +} + +bool ensure_parent_directory (QString const& file_path) +{ + return QDir {}.mkpath (QFileInfo {file_path}.absolutePath ()); } diff --git a/qt_helpers.hpp b/qt_helpers.hpp index d450686e..aa3ecdc1 100644 --- a/qt_helpers.hpp +++ b/qt_helpers.hpp @@ -16,6 +16,8 @@ #include #include +class QDir; + // ---------------------- // Windows version macros // ---------------------- @@ -123,17 +125,42 @@ void throw_qstring (QString const& qs) QString font_as_stylesheet (QFont const&); +QString application_style_sheet (QString const& base_style_sheet, + QString const& dark_style_sheet, + bool dark_style, + QFont const& font); + // do what is necessary to change a dynamic property and trigger any // conditional style sheet updates void update_dynamic_property (QWidget *, char const * property, QVariant const& value); -// round a QDateTime instance to an integral interval of milliseconds +// Invalid input, a nonpositive interval, or an unrepresentable result returns an invalid QDateTime. +// Round to the nearest interval, resolving midpoint ties toward the later interval. QDateTime qt_round_date_time_to (QDateTime dt, int milliseconds); -// truncate a QDateTime to an integral interval of milliseconds +// Invalid input, a nonpositive interval, or an unrepresentable result returns an invalid QDateTime. +// Truncate to the earlier interval. QDateTime qt_truncate_date_time_to (QDateTime dt, int milliseconds); -QString app_sounds_directory (QString const& subdirectory = QString {}); +QDir resolve_installed_data_directory (QString const& application_directory, + QString const& configured_data_destination, + QString const& relative_application_root); +QDir installed_data_directory (); +QDir preferred_sounds_directory (QDir const& canonical_directory, QDir const& legacy_directory); +QDir app_sounds_directory (); +QString voice_manifest_path (QDir const& canonical_directory, QDir const& legacy_directory); +QString app_voice_manifest_path (); +QDir sounds_subdirectory (QDir const& root, QString const& subdirectory); +bool app_sounds_subdirectory_is_safe (QString const& subdirectory); +bool parse_app_voice_entry (QString const& record, QString& subdirectory, QString& display_name); + +// Empty lists have no valid index; -1 advances to the first item. +int next_cyclic_index (int current_index, int item_count); + +QString writable_file_path (QDir const& writable_dir, QString const& file_name); +QString writable_override_or_installed_file_path (QDir const& writable_dir, QDir const& installed_dir, + QString const& file_name); +bool ensure_parent_directory (QString const& file_path); template class VPtr diff --git a/release-state.txt b/release-state.txt new file mode 100644 index 00000000..9623fef5 --- /dev/null +++ b/release-state.txt @@ -0,0 +1,5 @@ +version=3.2.0 +channel=RC +rc=1 +revision=567ad29ce6abf3d4a44f181cdbc7ceba0d73e5f4 +windows_signing=unsigned diff --git a/revision_utils.cpp b/revision_utils.cpp index 9c8f6964..83c416f1 100644 --- a/revision_utils.cpp +++ b/revision_utils.cpp @@ -76,12 +76,19 @@ QString display_revision () source_revision = source_revision.left (6); if (source_revision != build_revision.left (6)) { - return QString {"source %1 (build %2)"}.arg (source_revision, build_revision); + return QString {"(source %1, build %2)"}.arg ( + source_revision, + build_revision.isEmpty () ? QString {"unavailable"} : build_revision); } } #endif - return build_revision; + if (build_revision.isEmpty ()) + { + return QString {"(revision unavailable)"}; + } + + return QString {"(revision %1)"}.arg (build_revision); } QString version (bool include_patch) @@ -104,6 +111,13 @@ QString program_title (QString const& revision) return id + " " + revision ; } +QString branded_program_title (QString const& revision) +{ + // applicationName() itself must stay plain ASCII -- it also names the jt9 shared-memory key and settings/lock/temp paths. + QString id {QCoreApplication::applicationName () + "™ v" + QCoreApplication::applicationVersion ()}; + return id + " " + revision ; +} + QString http_user_agent () { // See User-Agent format definition https://www.rfc-editor.org/rfc/rfc9110#name-user-agent @@ -115,3 +129,23 @@ QString http_user_agent () return QString {"WSJT-X/" + version () + "_" + revision ()}.simplified () + " " + platform; } + +QString copyright_notice_text () +{ + return QCoreApplication::translate ( + "main", + "If you make fair use of any part of WSJT-X, MAP65, QMAP, or our " + "associated utility programs under terms of the GNU General Public " + "License, you must display the following copyright notice prominently " + "in your derivative work:\n\n" + "\"The algorithms, source code, look-and-feel of WSJT-X, MAP65, QMAP, " + "and related programs, and protocol specifications for the modes " + "FSK441, FST4, FST4W, FT4, FT8, ISCAT, JT4, JT6M, JT9, JT65, JTMS, " + "JTTY, MSK144, QRA64, Q65, and WSPR are Copyright (C) 2001-2026 by one " + "or more of the following authors: Joseph Taylor, K1JT; Bill " + "Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg " + "Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, " + "KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; Roger Rehr, W3SZ; John " + "Nelson, G4KLA; Charlie Suckling, DL3WDG; Terrell Deppe, KJ5HST; David " + "Christle, KD0BTO; and other members of the WSJT™ Development Team.\""); +} diff --git a/revision_utils.hpp b/revision_utils.hpp index 601c519a..d4adb266 100644 --- a/revision_utils.hpp +++ b/revision_utils.hpp @@ -7,6 +7,12 @@ QString revision (QString const& svn_rev_string = QString {}); QString display_revision (); QString version (bool include_patch = true); QString program_title (QString const& revision = QString {}); +// Same as program_title(), plus a ™ mark -- only for the three main-window +// titles (widgets/map65/qmap mainwindow.cpp), not the general-purpose +// program_title() itself, which also feeds non-UI uses (WAV metadata, +// startup log, generic dialog titles) where a trademark symbol doesn't belong. +QString branded_program_title (QString const& revision = QString {}); QString http_user_agent (); +QString copyright_notice_text (); #endif diff --git a/revision_utils_wsjtx.cpp b/revision_utils_wsjtx.cpp deleted file mode 100644 index c96e9e95..00000000 --- a/revision_utils_wsjtx.cpp +++ /dev/null @@ -1,85 +0,0 @@ -#include "revision_utils.hpp" - -#include - -#include -#include - -#include "scs_version.h" - -namespace -{ - QString revision_extract_number (QString const& s) - { - QString revision; - - // try and match a number (hexadecimal allowed) - QRegularExpression re {R"(^[$:]\w+: (r?[\da-f]+[^$]*)\$$)"}; - auto match = re.match (s); - if (match.hasMatch ()) - { - revision = match.captured (1); - } - return revision; - } -} - -QString revision (QString const& scs_rev_string) -{ - return "251203"; - QString result; - auto revision_from_scs = revision_extract_number (scs_rev_string); - -#if defined (CMAKE_BUILD) - QString scs_info {":Rev: " SCS_VERSION_STR " $"}; - - auto revision_from_scs_info = revision_extract_number (scs_info); - if (!revision_from_scs_info.isEmpty ()) - { - // we managed to get the revision number from svn info etc. - result = revision_from_scs_info; - } - else if (!revision_from_scs.isEmpty ()) - { - // fall back to revision passed in if any - result = revision_from_scs; - } - else - { - // match anything - QRegularExpression re {R"(^[$:]\w+: ([^$]*)\$$)"}; - auto match = re.match (scs_info); - if (match.hasMatch ()) - { - result = match.captured (1); - } - } -#else - if (!revision_from_scs.isEmpty ()) - { - // not CMake build so all we have is revision passed - result = revision_from_scs; - } -#endif - return result.trimmed (); -} - -QString version (bool include_patch) -{ -#if defined (CMAKE_BUILD) - QString v {TO_STRING__ (PROJECT_VERSION_MAJOR) "." TO_STRING__ (PROJECT_VERSION_MINOR)}; - if (include_patch) - { - v += "." TO_STRING__ (PROJECT_VERSION_PATCH) + QString {BUILD_TYPE_REVISION}; - } -#else - QString v {"Not for Release"}; -#endif - return v; -} - -QString program_title (QString const& revision) -{ - QString id {QCoreApplication::applicationName () + " v" + QCoreApplication::applicationVersion ()}; - return id + " " + revision; -} diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt new file mode 100644 index 00000000..63e30e29 --- /dev/null +++ b/samples/CMakeLists.txt @@ -0,0 +1,67 @@ +set (SAMPLE_FILES + FT4/000000_000002.wav + FT8/210703_133430.wav + FST4+FST4W/210115_0058.wav + FST4+FST4W/201230_0300.wav + MSK144/181211_120500.wav + MSK144/181211_120800.wav + ISCAT/ISCAT-A/VK7MO_110401_235515.wav + ISCAT/ISCAT-B/K0AWU_100714_115000.wav + JT4/JT4A/DF2ZC_070926_040700.WAV + JT4/JT4F/OK1KIR_141105_175700.WAV + JT65/JT65B/DL7UAE_040308_002400.wav + JT65/JT65B/000000_0001.wav + JT65/JT65B/000000_0002.wav + JT65/JT65B/000000_0003.wav + JT65/JT65B/000000_0004.wav + JT65/JT65B/000000_0005.wav + JT65/JT65B/000000_0006.wav + JT65/JT65B/000000_0007.wav + JT9/130418_1742.wav + JTTY/260807_134110.wav + MSK144/181211_120500.wav + MSK144/181211_120800.wav + WSPR/150426_0918.wav + Q65/30A_Ionoscatter_6m/201203_022700.wav + Q65/30A_Ionoscatter_6m/201203_022800.wav + Q65/30A_Ionoscatter_6m/201203_022900.wav + Q65/30A_Ionoscatter_6m/201203_024000.wav + Q65/60A_EME_6m/210106_1621.wav + Q65/60B_1296_Troposcatter/210109_0007.wav + Q65/60B_1296_Troposcatter/210109_0147.wav + Q65/60B_1296_Troposcatter/210109_0151.wav + Q65/60D_EME_10GHz/201212_1838.wav + Q65/120D_Rainscatter_10_GHz/210117_0920.wav + Q65/120E_Ionoscatter_6m/210130_1438.wav + Q65/120E_Ionoscatter_6m/210130_1442.wav + Q65/300A_Optical_Scatter/201210_0505.wav + QMAP/241019_0403.qm + ) + +set (contents_file_name contents_${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.json) +set (contents_file ${CMAKE_CURRENT_BINARY_DIR}/${contents_file_name}) +set (web_tree ${CMAKE_CURRENT_BINARY_DIR}/web) +set_source_files_properties (${contents_file} PROPERTIES GENERATED ON) + +add_custom_command ( + OUTPUT ${contents_file} + COMMAND ${CMAKE_COMMAND} ARGS -Dcontents_file=${contents_file} -DFILES="${SAMPLE_FILES}" -DDEST=${CMAKE_CURRENT_BINARY_DIR} -P make_contents.cmake + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + DEPENDS ${SAMPLE_FILES} make_contents.cmake +) + +find_program (RSYNC_EXECUTABLE rsync) +add_custom_command ( + OUTPUT upload.timestamp + COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${contents_file} ${web_tree}/samples/${contents_file_name} + # Source path must be relative (no drive letter): on MSYS2/Windows, rsync + # parses any "X:" prefix as a remote host spec, and with an actually-remote + # destination too it then refuses with "source and destination cannot both + # be remote." WORKING_DIRECTORY defaults to CMAKE_CURRENT_BINARY_DIR here, + # so a bare "web/samples" resolves the same as the old absolute path did. + COMMAND ${RSYNC_EXECUTABLE} ARGS -avz --progress web/samples ${PROJECT_SAMPLES_UPLOAD_DEST} + COMMAND ${CMAKE_COMMAND} ARGS -E touch upload.timestamp + DEPENDS ${contents_file} + COMMENT "Uploading WSJT-X samples to web server" + ) +add_custom_target (upload-samples DEPENDS upload.timestamp) diff --git a/samples/FST4+FST4W/201230_0300.wav b/samples/FST4+FST4W/201230_0300.wav new file mode 100644 index 00000000..524875f3 Binary files /dev/null and b/samples/FST4+FST4W/201230_0300.wav differ diff --git a/samples/FST4+FST4W/210115_0058.wav b/samples/FST4+FST4W/210115_0058.wav new file mode 100644 index 00000000..c0541b3d Binary files /dev/null and b/samples/FST4+FST4W/210115_0058.wav differ diff --git a/samples/FT4/000000_000002.wav b/samples/FT4/000000_000002.wav new file mode 100644 index 00000000..e5cdc880 Binary files /dev/null and b/samples/FT4/000000_000002.wav differ diff --git a/samples/FT8/210703_133430.wav b/samples/FT8/210703_133430.wav new file mode 100644 index 00000000..2b00aec2 Binary files /dev/null and b/samples/FT8/210703_133430.wav differ diff --git a/samples/ISCAT/ISCAT-A/VK7MO_110401_235515.wav b/samples/ISCAT/ISCAT-A/VK7MO_110401_235515.wav new file mode 100644 index 00000000..ca8cbf21 Binary files /dev/null and b/samples/ISCAT/ISCAT-A/VK7MO_110401_235515.wav differ diff --git a/samples/ISCAT/ISCAT-B/K0AWU_100714_115000.wav b/samples/ISCAT/ISCAT-B/K0AWU_100714_115000.wav new file mode 100644 index 00000000..405ba864 Binary files /dev/null and b/samples/ISCAT/ISCAT-B/K0AWU_100714_115000.wav differ diff --git a/samples/JT4/JT4A/DF2ZC_070926_040700.WAV b/samples/JT4/JT4A/DF2ZC_070926_040700.WAV new file mode 100644 index 00000000..76b2b106 Binary files /dev/null and b/samples/JT4/JT4A/DF2ZC_070926_040700.WAV differ diff --git a/samples/JT4/JT4F/OK1KIR_141105_175700.WAV b/samples/JT4/JT4F/OK1KIR_141105_175700.WAV new file mode 100644 index 00000000..5c260cd5 Binary files /dev/null and b/samples/JT4/JT4F/OK1KIR_141105_175700.WAV differ diff --git a/samples/JT65/JT65B/000000_0001.wav b/samples/JT65/JT65B/000000_0001.wav new file mode 100644 index 00000000..163b5f07 Binary files /dev/null and b/samples/JT65/JT65B/000000_0001.wav differ diff --git a/samples/JT65/JT65B/000000_0002.wav b/samples/JT65/JT65B/000000_0002.wav new file mode 100644 index 00000000..9d114235 Binary files /dev/null and b/samples/JT65/JT65B/000000_0002.wav differ diff --git a/samples/JT65/JT65B/000000_0003.wav b/samples/JT65/JT65B/000000_0003.wav new file mode 100644 index 00000000..94c85e3f Binary files /dev/null and b/samples/JT65/JT65B/000000_0003.wav differ diff --git a/samples/JT65/JT65B/000000_0004.wav b/samples/JT65/JT65B/000000_0004.wav new file mode 100644 index 00000000..c59f412f Binary files /dev/null and b/samples/JT65/JT65B/000000_0004.wav differ diff --git a/samples/JT65/JT65B/000000_0005.wav b/samples/JT65/JT65B/000000_0005.wav new file mode 100644 index 00000000..2e7b0ff9 Binary files /dev/null and b/samples/JT65/JT65B/000000_0005.wav differ diff --git a/samples/JT65/JT65B/000000_0006.wav b/samples/JT65/JT65B/000000_0006.wav new file mode 100644 index 00000000..9970f734 Binary files /dev/null and b/samples/JT65/JT65B/000000_0006.wav differ diff --git a/samples/JT65/JT65B/000000_0007.wav b/samples/JT65/JT65B/000000_0007.wav new file mode 100644 index 00000000..e48a0725 Binary files /dev/null and b/samples/JT65/JT65B/000000_0007.wav differ diff --git a/samples/JT65/JT65B/DL7UAE_040308_002400.wav b/samples/JT65/JT65B/DL7UAE_040308_002400.wav new file mode 100644 index 00000000..f0d3d58f Binary files /dev/null and b/samples/JT65/JT65B/DL7UAE_040308_002400.wav differ diff --git a/samples/JT9/130418_1742.wav b/samples/JT9/130418_1742.wav new file mode 100644 index 00000000..056cd2e4 Binary files /dev/null and b/samples/JT9/130418_1742.wav differ diff --git a/samples/JTTY/260807_134110.wav b/samples/JTTY/260807_134110.wav new file mode 100644 index 00000000..1f253896 Binary files /dev/null and b/samples/JTTY/260807_134110.wav differ diff --git a/samples/MSK144/181211_120500.wav b/samples/MSK144/181211_120500.wav new file mode 100644 index 00000000..dc060163 Binary files /dev/null and b/samples/MSK144/181211_120500.wav differ diff --git a/samples/MSK144/181211_120800.wav b/samples/MSK144/181211_120800.wav new file mode 100644 index 00000000..a353e70a Binary files /dev/null and b/samples/MSK144/181211_120800.wav differ diff --git a/samples/Q65/120D_Rainscatter_10_GHz/210117_0920.wav b/samples/Q65/120D_Rainscatter_10_GHz/210117_0920.wav new file mode 100644 index 00000000..a7243be5 Binary files /dev/null and b/samples/Q65/120D_Rainscatter_10_GHz/210117_0920.wav differ diff --git a/samples/Q65/120E_Ionoscatter_6m/210130_1438.wav b/samples/Q65/120E_Ionoscatter_6m/210130_1438.wav new file mode 100644 index 00000000..6d1921ac Binary files /dev/null and b/samples/Q65/120E_Ionoscatter_6m/210130_1438.wav differ diff --git a/samples/Q65/120E_Ionoscatter_6m/210130_1442.wav b/samples/Q65/120E_Ionoscatter_6m/210130_1442.wav new file mode 100644 index 00000000..d59e82b9 Binary files /dev/null and b/samples/Q65/120E_Ionoscatter_6m/210130_1442.wav differ diff --git a/samples/Q65/300A_Optical_Scatter/201210_0505.wav b/samples/Q65/300A_Optical_Scatter/201210_0505.wav new file mode 100644 index 00000000..eb95d8bc Binary files /dev/null and b/samples/Q65/300A_Optical_Scatter/201210_0505.wav differ diff --git a/samples/Q65/30A_Ionoscatter_6m/201203_022700.wav b/samples/Q65/30A_Ionoscatter_6m/201203_022700.wav new file mode 100644 index 00000000..12db3ed5 Binary files /dev/null and b/samples/Q65/30A_Ionoscatter_6m/201203_022700.wav differ diff --git a/samples/Q65/30A_Ionoscatter_6m/201203_022800.wav b/samples/Q65/30A_Ionoscatter_6m/201203_022800.wav new file mode 100644 index 00000000..8dbd3766 Binary files /dev/null and b/samples/Q65/30A_Ionoscatter_6m/201203_022800.wav differ diff --git a/samples/Q65/30A_Ionoscatter_6m/201203_022900.wav b/samples/Q65/30A_Ionoscatter_6m/201203_022900.wav new file mode 100644 index 00000000..ef9c1423 Binary files /dev/null and b/samples/Q65/30A_Ionoscatter_6m/201203_022900.wav differ diff --git a/samples/Q65/30A_Ionoscatter_6m/201203_024000.wav b/samples/Q65/30A_Ionoscatter_6m/201203_024000.wav new file mode 100644 index 00000000..509f75f0 Binary files /dev/null and b/samples/Q65/30A_Ionoscatter_6m/201203_024000.wav differ diff --git a/samples/Q65/60A_EME_6m/210106_1621.wav b/samples/Q65/60A_EME_6m/210106_1621.wav new file mode 100644 index 00000000..5fd22bb3 Binary files /dev/null and b/samples/Q65/60A_EME_6m/210106_1621.wav differ diff --git a/samples/Q65/60B_1296_Troposcatter/210109_0007.wav b/samples/Q65/60B_1296_Troposcatter/210109_0007.wav new file mode 100644 index 00000000..35552680 Binary files /dev/null and b/samples/Q65/60B_1296_Troposcatter/210109_0007.wav differ diff --git a/samples/Q65/60B_1296_Troposcatter/210109_0147.wav b/samples/Q65/60B_1296_Troposcatter/210109_0147.wav new file mode 100644 index 00000000..945726d8 Binary files /dev/null and b/samples/Q65/60B_1296_Troposcatter/210109_0147.wav differ diff --git a/samples/Q65/60B_1296_Troposcatter/210109_0151.wav b/samples/Q65/60B_1296_Troposcatter/210109_0151.wav new file mode 100644 index 00000000..70e7a915 Binary files /dev/null and b/samples/Q65/60B_1296_Troposcatter/210109_0151.wav differ diff --git a/samples/Q65/60D_EME_10GHz/201212_1838.wav b/samples/Q65/60D_EME_10GHz/201212_1838.wav new file mode 100644 index 00000000..a6e2754e Binary files /dev/null and b/samples/Q65/60D_EME_10GHz/201212_1838.wav differ diff --git a/samples/QMAP/241019_0403.qm b/samples/QMAP/241019_0403.qm new file mode 100644 index 00000000..34d08dc2 Binary files /dev/null and b/samples/QMAP/241019_0403.qm differ diff --git a/samples/README b/samples/README new file mode 100644 index 00000000..db1c18e5 --- /dev/null +++ b/samples/README @@ -0,0 +1,20 @@ +This directory contains the resources necessary to build the WSJT-X +samples database. The CMake build script creates a directory structure +ready for upload to the project samples web or ftp file server. The +CMake script also defines a build target 'upload-samples' which +uploads the sample database to the the destination defined by the +project CMake variable PROJECT_SAMPLES_UPLOAD_DEST (defined in the +project root CMake script). A suitably authorized user may use this +target to update the server with the latest samples. + +The samples database includes a JSON contents file for each +major/minor version combination of WSJT-X, this file is generated by +CMake and should not be manually edited. + +To add new samples simply add the files here and update the +SAMPLE_FILES list variable in the CMakeLists.txt file in this +directory. Sample files must be checked into source control. A +meaningful directory structure is advisable, the same directory +structure will be replicated by the WSJT-X sample downloader dialog +allowing WSJT-X users to easily identify wath each sample file +contains. diff --git a/samples/WSPR/150426_0918.wav b/samples/WSPR/150426_0918.wav new file mode 100644 index 00000000..c53ec20a Binary files /dev/null and b/samples/WSPR/150426_0918.wav differ diff --git a/samples/make_contents.cmake b/samples/make_contents.cmake new file mode 100644 index 00000000..42f2bead --- /dev/null +++ b/samples/make_contents.cmake @@ -0,0 +1,107 @@ +string (REPLACE " " ";" FILES ${FILES}) # make back into a list + +function(JOIN VALUES GLUE OUTPUT) + string (REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}") + string (REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping + set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE) +endfunction() + +function (indent) + foreach (temp RANGE ${level}) + file (APPEND ${contents_file} " ") + endforeach () +endfunction () + +function (end_entry) + file (APPEND ${contents_file} "\n") + set(first 0 PARENT_SCOPE) + math (EXPR level "${level} - 1") + indent () + file (APPEND ${contents_file} "]\n") + math (EXPR level "${level} - 2") + indent () + file (APPEND ${contents_file} "}") + string (FIND "${dirs}" "${cwd}" pos) + set (level ${level} PARENT_SCOPE) +endfunction () + +file (WRITE ${contents_file} "[") +set (cwd) +set (level 0) +set (first 1) +list (SORT FILES) +foreach (file IN LISTS FILES) + string (REGEX MATCHALL "[^/]*/" dirs "${file}") + string (REPLACE "/" "" dirs "${dirs}") + string (REGEX MATCH "[^/]*$" name "${file}") + string (FIND "${dirs}" "${cwd}" pos) + list (LENGTH cwd cwd_count) + if (${pos} EQUAL 0) + # same root + while (${cwd_count} GREATER 0) + list (REMOVE_AT dirs 0) + math (EXPR cwd_count "${cwd_count} - 1") + endwhile () + else () + # reduce cwd until matched + while ((NOT ${pos} EQUAL 0) AND ${cwd_count} GREATER 0) + math (EXPR cwd_count "${cwd_count} - 1") + list (REMOVE_AT cwd ${cwd_count}) + string (FIND "${dirs}" "${cwd}" pos) + end_entry () + endwhile () + # back to same root + while (${cwd_count} GREATER 0) + list (REMOVE_AT dirs 0) + math (EXPR cwd_count "${cwd_count} - 1") + endwhile () + endif () + list (LENGTH cwd cwd_count) + list (LENGTH dirs path_count) + while (${path_count} GREATER 0) + list (GET dirs 0 dir) + list (APPEND cwd "${dir}") + list (REMOVE_AT dirs 0) + if (${first}) + file (APPEND ${contents_file} "\n") + set (first 0) + else () + file (APPEND ${contents_file} ",\n") + endif () + indent () + file (APPEND ${contents_file} "{\n") + math (EXPR level "${level} + 1") + indent () + file (APPEND ${contents_file} "\"type\": \"directory\",\n") + indent () + file (APPEND ${contents_file} "\"name\": \"${dir}\",\n") + indent () + file (APPEND ${contents_file} "\"entries\": [") + set (first 1) + math (EXPR level "${level} + 2") + math (EXPR path_count "${path_count} - 1") + endwhile () + JOIN ("${cwd}" "/" path) + file (COPY "${file}" DESTINATION "${DEST}/web/samples/${path}") + if (${first}) + file (APPEND ${contents_file} "\n") + set (first 0) + else () + file (APPEND ${contents_file} ",\n") + endif () + indent () + file (APPEND ${contents_file} "{\n") + math (EXPR level "${level} + 1") + indent () + file (APPEND ${contents_file} "\"type\": \"file\",\n") + indent () + file (APPEND ${contents_file} "\"name\": \"${name}\"\n") + math (EXPR level "${level} - 1") + indent () + file (APPEND ${contents_file} "}") + set (first 0) +endforeach () +if (${level} GREATER 1) + end_entry () +endif () +file (APPEND ${contents_file} "\n]\n") diff --git a/test/apply_routing_test.f90 b/test/apply_routing_test.f90 new file mode 100644 index 00000000..ac675cc4 --- /dev/null +++ b/test/apply_routing_test.f90 @@ -0,0 +1,630 @@ +! Apply-routing unit driver. Asserts that +! apply_configure_fields (extracted from streaming_io.f90's former nested-internal +! apply_configure_) routes each configure_fields member to its CORRECT params_block +! slot — the coverage gap the fixture gates cannot close (most Phase 4/5 fields are +! inert on the FT8/JT9 fixtures, so a mis-route like his_call->hisgrid passes every +! fixture byte-identical, as proven empirically). +! +! This drives the APPLY side (configure_fields -> params_block), complementing the +! parse-unit drivers (phase4/phase5_parse_test.f90) which drive the PARSE side +! (JSON -> configure_fields). It also exercises the order-sensitive logic that was +! previously review-only: the rxfreq/tx_audio_offset decouple, emedelay-before- +! per-mode-policy (D1), nfa/nfb baseline restore, and the ntol per-mode cap/restore. +! +! Bool swap-blindness (known, bounded): the Phase 6 bool asserts alternate T/F in +! source order, so an ADJACENT apply-line transposition (the realistic copy-paste +! swap) flips a value and IS caught; a swap of two NON-adjacent bools that share an +! asserted value is not (bools are binary). The parse-unit's per-key anchored +! NAME match is the primary swap guard (a swap there requires editing a literal +! key string, not transposing lines). Ints use distinct values, so int-swaps are +! always caught. +! +! params_block is re-exported from streaming_apply (it owns the include); the +! baseline is a realistic params built via jt9_params_init's init routines. +! Compiled + run by test/run-apply-routing-unit.sh against lib/streaming_control.f90 +! + lib/jt9_params_init.f90 + lib/streaming_apply.f90, in an ISOLATED module dir. +program apply_routing_test + use streaming_control, only: configure_fields + use jt9_params_init, only: cli_args_t, init_default_params, & + init_streaming_extra_fields + use streaming_apply, only: apply_configure_fields, params_block + implicit none + integer :: nfail + integer, parameter :: BNFA = 111, BNFB = 222 ! baseline nfa/nfb + nfail = 0 + + call frame_flat() + call frame_npts_c0_guard() + call frame_rxfreq() + call frame_decouple() + call frame_emedelay_survive() + call frame_emedelay_ft8() + call frame_emedelay_q65() + call frame_nfa_nfb_restore() + call frame_ntol_policy() + call frame_mode_trperiod() + call frame_multithreaded_guard() + call frame_qso_guard() + call frame_utc_precedence() + call frame_phase9_pack() + + write(*,'(a)') '------------------------------------------------------------' + if (nfail .eq. 0) then + write(*,'(a)') 'ALL APPLY-ROUTING CHECKS PASSED' + else + write(*,'(a,i0,a)') 'APPLY-ROUTING: ', nfail, ' CHECK(S) FAILED' + call exit(1) + end if + +contains + + subroutine ok(label, cond) + character(len=*), intent(in) :: label + logical, intent(in) :: cond + if (cond) then + write(*,'(a,a)') ' PASS ', label + else + write(*,'(a,a)') ' FAIL ', label + nfail = nfail + 1 + end if + end subroutine ok + + ! Build a realistic, fully-defined baseline params (mode 8 / 15 s). + subroutine fresh(p) + type(params_block), intent(out) :: p + type(cli_args_t) :: args + call init_default_params(p, 8, 15.d0, args) + call init_streaming_extra_fields(p, args) + end subroutine fresh + + subroutine frame_npts_c0_guard() + type(configure_fields) :: cfg + type(params_block) :: p + integer :: md + real(8) :: tr + write(*,'(a)') 'Frame npts_c0_array domain guard' + call fresh(p) + md = 9; tr = 60.d0 + p%npts8 = 74736 + cfg%npts_c0_array_set = .true. + cfg%npts_c0_array = -1 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('negative npts_c0_array not applied', p%npts8 .eq. 74736) + cfg%npts_c0_array = 0 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('zero npts_c0_array not applied', p%npts8 .eq. 74736) + cfg%npts_c0_array = 81649 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('oversize npts_c0_array not applied', p%npts8 .eq. 74736) + cfg%npts_c0_array = 81648 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('max npts_c0_array applied', p%npts8 .eq. 81648) + end subroutine frame_npts_c0_guard + + ! Read back a c_char(N) params field as a fixed-length string (inverse of the + ! transfer() the apply does). + function s12(arr) result(s) + character(len=12) :: s + character, intent(in) :: arr(12) + s = transfer(arr, s) + end function s12 + + function s6(arr) result(s) + character(len=6) :: s + character, intent(in) :: arr(6) + s = transfer(arr, s) + end function s6 + + ! =================================================================== + ! Frame FLAT: every flat field, distinct value, NO mode/trperiod (so the + ! per-mode-policy block does NOT fire — emedelay survives, ntol/nfa/nfb keep + ! the explicit value). This is the core routing assertion: each value must + ! land in its OWN slot. The mis-route killers are the same-shaped pairs + ! (his_call/hisgrid, tx_audio_offset/nfsplit, min_width/min_sync, + ! dt_tolerance/emedelay). + subroutine frame_flat() + type(params_block) :: p + type(configure_fields) :: cfg + integer :: md + real(8) :: tr + write(*,'(a)') 'Frame FLAT: every flat field -> its own slot (no mode/trperiod)' + call fresh(p) + ! Defeat baseline-collision vacuity: lmycallstd/lhiscallstd + ! default .true. (init_streaming_extra_fields), and mybcall/hisbcall are + ! undefined after init. Plant sentinels OPPOSITE to each asserted value, so a + ! dropped/mis-routed apply leaves the sentinel and the assert fails. + p%lmycallstd = .false. ! asserted .true. + p%lhiscallstd = .true. ! asserted .false. + p%mybcall = transfer('zzzzzzzzzzzz', p%mybcall) + p%hisbcall = transfer('zzzzzzzzzzzz', p%hisbcall) + ! Phase 6 sentinels: plant each param OPPOSITE its asserted value (an + ! assert whose expected value == the init default is vacuous). Bools + ! alternate T/F asserted so a swap between adjacent keys flips a value and is + ! caught; ints get a distinct 99 sentinel so a mis-route leaves 99 != asserted. + ! multithreaded_ft8 is NOT set here (it is apply-ignored; see frame_multithreaded_guard). + p%lft8lowth = .false. ! asserted .true. + p%lft8subpass = .true. ! asserted .false. + p%lft8apon = .true. ! asserted .false. + p%lapcqonly = .false. ! asserted .true. + p%lapmyc = .true. ! asserted .false. + p%ljt65apon = .false. ! asserted .true. + p%lhideft8dupes = .true. ! asserted .false. + p%lcommonft8b = .false. ! asserted .true. + p%lenabledxcsearch = .true. ! asserted .false. + p%lwidedxcsearch = .false. ! asserted .true. + p%b_superfox = .true. ! asserted .false. + p%b_even_seq = .false. ! asserted .true. + p%lhound = .true. ! asserted .false. + p%lmultinst = .false. ! asserted .true. + p%lskiptx1 = .true. ! asserted .false. + p%nagainfil = .false. ! asserted .true. + p%nstophint = .true. ! asserted .false. + p%nhint = .false. ! asserted .true. + p%nft8cycles = 99 + p%nft8rxfsens = 99 + p%nmt = 99 + p%ndecoderstart = 99 + p%napwid = 99 + ! Phase 7 sentinels (plant OPPOSITE the asserted value). bools: + ! ltxing asserted .true. -> plant .false.; lmodechanged asserted .false. -> + ! plant .true. (the SENTINEL is load-bearing here since the init default is + ! also .false., matching the asserted value). ints get a distinct 99. + p%ltxing = .false. ! asserted .true. + p%lmodechanged = .true. ! asserted .false. + p%nlasttx = 99 + p%nQSOProgress = 99 + p%nsecbandchanged = 99 + p%ndelay = 99 + ! Phase 8 sentinels (plant OPPOSITE the asserted value; the + ! asserted values are ALSO non-default so neither the sentinel nor the default + ! can mask a dropped apply). nranera default is 6 / ncandthin default 100, so + ! the asserted 8 / 150 differ from both the planted 99 and the init default. + ! utc is NOT exercised here (it shares the nutc slot — see frame_utc_precedence). + p%yymmdd = 99 + p%nranera = 99 + p%ncandthin = 99 + p%ndtcenter = 99 + md = 8; tr = 15.d0 + cfg%depth_set = .true.; cfg%depth = 7 + cfg%submode_set = .true.; cfg%submode = 2 + cfg%mycall_set = .true.; cfg%mycall = 'K5TST' + cfg%mygrid_set = .true.; cfg%mygrid = 'EM10' + cfg%his_call_set = .true.; cfg%his_call = 'DX1ABC' + cfg%his_grid_set = .true.; cfg%his_grid = 'FN31' + cfg%my_b_call_set = .true.; cfg%my_b_call = 'K5TST/B' + cfg%his_b_call_set = .true.; cfg%his_b_call = 'DX1/B' + cfg%my_call_standard_set = .true.; cfg%my_call_standard = .true. + cfg%his_call_standard_set = .true.; cfg%his_call_standard = .false. + cfg%tx_audio_offset_hz_set = .true.; cfg%tx_audio_offset_hz = 1234 + cfg%jt65_jt9_split_hz_set = .true.; cfg%jt65_jt9_split_hz = 2345 + cfg%max_drift_hz_set = .true.; cfg%max_drift_hz = 55 + cfg%dt_tolerance_seconds_set = .true.; cfg%dt_tolerance_seconds = 0.7d0 + cfg%eme_delay_seconds_set = .true.; cfg%eme_delay_seconds = 1.3d0 + cfg%kin_samples_set = .true.; cfg%kin_samples = 99000 + cfg%nzhsym_per_period_set = .true.; cfg%nzhsym_per_period = 42 + cfg%npts_c0_array_set = .true.; cfg%npts_c0_array = 60000 + cfg%min_width_set = .true.; cfg%min_width = 3 + cfg%min_sync_set = .true.; cfg%min_sync = 4 + cfg%n_2pass_set = .true.; cfg%n_2pass = 1 + cfg%robust_mode_set = .true.; cfg%robust_mode = .true. + cfg%nagain_flag_set = .true.; cfg%nagain_flag = .true. + cfg%tx_mode_set = .true.; cfg%tx_mode = 9 + cfg%clear_average_set = .true.; cfg%clear_average = .true. + cfg%nutc_set = .true.; cfg%nutc = 133430 + cfg%ntol_set = .true.; cfg%ntol = 250 + cfg%nfa_set = .true.; cfg%nfa = 180 + cfg%nfb_set = .true.; cfg%nfb = 3900 + ! Phase 6 (23 keys; multithreaded_ft8 excluded — apply-ignored). Bools + ! alternate T/F (asserted); ints distinct (2/4/3/1/150). + cfg%ft8_low_threshold_set = .true.; cfg%ft8_low_threshold = .true. + cfg%ft8_subpass_set = .true.; cfg%ft8_subpass = .false. + cfg%ft8_ap_on_set = .true.; cfg%ft8_ap_on = .false. + cfg%ap_cq_only_set = .true.; cfg%ap_cq_only = .true. + cfg%ap_my_call_set = .true.; cfg%ap_my_call = .false. + cfg%jt65_ap_on_set = .true.; cfg%jt65_ap_on = .true. + cfg%hide_ft8_duplicates_set = .true.; cfg%hide_ft8_duplicates = .false. + cfg%common_ft8b_set = .true.; cfg%common_ft8b = .true. + cfg%enable_dxc_search_set = .true.; cfg%enable_dxc_search = .false. + cfg%wide_dxc_search_set = .true.; cfg%wide_dxc_search = .true. + cfg%superfox_mode_set = .true.; cfg%superfox_mode = .false. + cfg%even_sequence_set = .true.; cfg%even_sequence = .true. + cfg%hound_mode_set = .true.; cfg%hound_mode = .false. + cfg%multi_instance_set = .true.; cfg%multi_instance = .true. + cfg%skip_tx1_set = .true.; cfg%skip_tx1 = .false. + cfg%nagain_filter_set = .true.; cfg%nagain_filter = .true. + cfg%stop_hint_set = .true.; cfg%stop_hint = .false. + cfg%hint_mode_set = .true.; cfg%hint_mode = .true. + cfg%ft8_cycles_set = .true.; cfg%ft8_cycles = 2 + cfg%ft8_rxf_sensitivity_set = .true.; cfg%ft8_rxf_sensitivity = 4 + cfg%ft8_threads_set = .true.; cfg%ft8_threads = 3 + cfg%ft8_decoder_start_set = .true.; cfg%ft8_decoder_start = 1 + cfg%ap_width_hz_set = .true.; cfg%ap_width_hz = 150 + ! Phase 7 (6 keys; all flat pass-throughs). bools alternate T/F (asserted); + ! ints distinct (4/5/7/6) and != the planted 99 sentinel. + cfg%last_tx_seconds_ago_set = .true.; cfg%last_tx_seconds_ago = 4 + cfg%currently_txing_set = .true.; cfg%currently_txing = .true. + cfg%mode_changed_set = .true.; cfg%mode_changed = .false. + cfg%qso_progress_state_set = .true.; cfg%qso_progress_state = 5 + cfg%sec_band_changed_set = .true.; cfg%sec_band_changed = 7 + cfg%delay_units_set = .true.; cfg%delay_units = 6 + ! Phase 8 (4 keys; utc tested in frame_utc_precedence). The cfg members hold + ! the DERIVED legacy ints (utc_nutc/date_yymmdd/n_trials_nranera computed at + ! parse) — here we set them directly. candthin_threshold/dt_center_seconds are + ! reals scaled nint(x*100) at apply: 1.5 -> 150, 0.2 -> 20. + cfg%date_set = .true.; cfg%date_yymmdd = 210703 + cfg%n_trials_set = .true.; cfg%n_trials_nranera = 8 + cfg%candthin_threshold_set = .true.; cfg%candthin_threshold = 1.5d0 + cfg%dt_center_seconds_set = .true.; cfg%dt_center_seconds = 0.2d0 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('depth -> ndepth = 7', p%ndepth .eq. 7) + call ok('submode -> nsubmode = 2', p%nsubmode .eq. 2) + call ok('mycall -> mycall = K5TST', trim(s12(p%mycall)) .eq. 'K5TST') + call ok('mygrid -> mygrid = EM10', trim(s6(p%mygrid)) .eq. 'EM10') + call ok('his_call -> hiscall = DX1ABC', trim(s12(p%hiscall)) .eq. 'DX1ABC') + call ok('his_grid -> hisgrid = FN31', trim(s6(p%hisgrid)) .eq. 'FN31') + call ok('my_b_call -> mybcall = K5TST/B', trim(s12(p%mybcall)) .eq. 'K5TST/B') + call ok('his_b_call -> hisbcall = DX1/B', trim(s12(p%hisbcall)) .eq. 'DX1/B') + call ok('my_call_standard -> lmycallstd true', logical(p%lmycallstd)) + call ok('his_call_standard -> lhiscallstd false', .not. logical(p%lhiscallstd)) + call ok('tx_audio_offset_hz -> nftx = 1234 (not nfsplit)', p%nftx .eq. 1234) + call ok('jt65_jt9_split_hz -> nfsplit = 2345 (not nftx)', p%nfsplit .eq. 2345) + call ok('max_drift_hz -> max_drift = 55', p%max_drift .eq. 55) + call ok('dt_tolerance_seconds -> dttol = 0.7', abs(p%dttol - 0.7) .lt. 1.0e-6) + call ok('eme_delay_seconds -> emedelay = 1.3 (survives)', abs(p%emedelay - 1.3) .lt. 1.0e-6) + call ok('kin_samples -> kin = 99000', p%kin .eq. 99000) + call ok('nzhsym_per_period -> nzhsym = 42', p%nzhsym .eq. 42) + call ok('npts_c0_array -> npts8 = 60000', p%npts8 .eq. 60000) + call ok('min_width -> minw = 3 (not minsync)', p%minw .eq. 3) + call ok('min_sync -> minsync = 4 (not minw)', p%minsync .eq. 4) + call ok('n_2pass -> n2pass = 1', p%n2pass .eq. 1) + call ok('robust_mode -> nrobust true', logical(p%nrobust)) + call ok('nagain_flag -> nagain true', logical(p%nagain)) + call ok('tx_mode -> ntxmode = 9', p%ntxmode .eq. 9) + call ok('clear_average -> nclearave true', logical(p%nclearave)) + call ok('nutc -> nutc = 133430', p%nutc .eq. 133430) + call ok('ntol -> ntol = 250 (no policy)', p%ntol .eq. 250) + call ok('nfa -> nfa = 180', p%nfa .eq. 180) + call ok('nfb -> nfb = 3900', p%nfb .eq. 3900) + ! Phase 6 routing (23 keys). Each asserted value is opposite its planted + ! sentinel, so a dropped/mis-routed apply leaves the sentinel and fails. + call ok('ft8_low_threshold -> lft8lowth true', logical(p%lft8lowth)) + call ok('ft8_subpass -> lft8subpass false', .not. logical(p%lft8subpass)) + call ok('ft8_ap_on -> lft8apon false', .not. logical(p%lft8apon)) + call ok('ap_cq_only -> lapcqonly true', logical(p%lapcqonly)) + call ok('ap_my_call -> lapmyc false', .not. logical(p%lapmyc)) + call ok('jt65_ap_on -> ljt65apon true', logical(p%ljt65apon)) + call ok('hide_ft8_duplicates -> lhideft8dupes false', .not. logical(p%lhideft8dupes)) + call ok('common_ft8b -> lcommonft8b true', logical(p%lcommonft8b)) + call ok('enable_dxc_search -> lenabledxcsearch false', .not. logical(p%lenabledxcsearch)) + call ok('wide_dxc_search -> lwidedxcsearch true', logical(p%lwidedxcsearch)) + call ok('superfox_mode -> b_superfox false', .not. logical(p%b_superfox)) + call ok('even_sequence -> b_even_seq true', logical(p%b_even_seq)) + call ok('hound_mode -> lhound false', .not. logical(p%lhound)) + call ok('multi_instance -> lmultinst true', logical(p%lmultinst)) + call ok('skip_tx1 -> lskiptx1 false', .not. logical(p%lskiptx1)) + call ok('nagain_filter -> nagainfil true', logical(p%nagainfil)) + call ok('stop_hint -> nstophint false', .not. logical(p%nstophint)) + call ok('hint_mode -> nhint true', logical(p%nhint)) + call ok('ft8_cycles -> nft8cycles = 2', p%nft8cycles .eq. 2) + call ok('ft8_rxf_sensitivity -> nft8rxfsens = 4', p%nft8rxfsens .eq. 4) + call ok('ft8_threads -> nmt = 3', p%nmt .eq. 3) + call ok('ft8_decoder_start -> ndecoderstart = 1', p%ndecoderstart .eq. 1) + call ok('ap_width_hz -> napwid = 150 (RAW, not halved)', p%napwid .eq. 150) + ! Phase 7 routing (6 keys). Each asserted value is opposite its planted + ! sentinel, so a dropped/mis-routed apply leaves the sentinel and fails. + call ok('last_tx_seconds_ago -> nlasttx = 4', p%nlasttx .eq. 4) + call ok('currently_txing -> ltxing true', logical(p%ltxing)) + call ok('mode_changed -> lmodechanged false', .not. logical(p%lmodechanged)) + call ok('qso_progress_state -> nQSOProgress = 5', p%nQSOProgress .eq. 5) + call ok('sec_band_changed -> nsecbandchanged = 7', p%nsecbandchanged .eq. 7) + call ok('delay_units -> ndelay = 6', p%ndelay .eq. 6) + ! Phase 8 routing (4 keys; utc in frame_utc_precedence). Each asserted value is + ! opposite its planted sentinel (99) AND non-default, so a dropped/mis-routed + ! apply leaves the sentinel and fails. candthin/dtcenter prove the /100 scaling. + call ok('date -> yymmdd = 210703', p%yymmdd .eq. 210703) + call ok('n_trials -> nranera = 8', p%nranera .eq. 8) + call ok('candthin_threshold 1.5 -> ncandthin = 150', p%ncandthin .eq. 150) + call ok('dt_center_seconds 0.2 -> ndtcenter = 20', p%ndtcenter .eq. 20) + end subroutine frame_flat + + ! Frame RXFREQ: rxfreq sets BOTH nfqso and nftx. + subroutine frame_rxfreq() + type(params_block) :: p + type(configure_fields) :: cfg + integer :: md + real(8) :: tr + write(*,'(a)') 'Frame RXFREQ: rxfreq -> nfqso AND nftx' + call fresh(p) + md = 8; tr = 15.d0 + cfg%rxfreq_set = .true.; cfg%rxfreq = 1600 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('rxfreq -> nfqso = 1600', p%nfqso .eq. 1600) + call ok('rxfreq -> nftx = 1600', p%nftx .eq. 1600) + end subroutine frame_rxfreq + + ! Frame DECOUPLE: rxfreq sets both, then tx_audio_offset_hz overrides nftx only. + subroutine frame_decouple() + type(params_block) :: p + type(configure_fields) :: cfg + integer :: md + real(8) :: tr + write(*,'(a)') 'Frame DECOUPLE: rxfreq + tx_audio_offset_hz -> nfqso=rx, nftx=offset' + call fresh(p) + md = 8; tr = 15.d0 + cfg%rxfreq_set = .true.; cfg%rxfreq = 1600 + cfg%tx_audio_offset_hz_set = .true.; cfg%tx_audio_offset_hz = 1700 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('nfqso = 1600 (rxfreq)', p%nfqso .eq. 1600) + call ok('nftx = 1700 (offset overrides)', p%nftx .eq. 1700) + end subroutine frame_decouple + + ! Frame EMEDELAY (D1a): eme_delay survives when NO mode/trperiod is set. + subroutine frame_emedelay_survive() + type(params_block) :: p + type(configure_fields) :: cfg + integer :: md + real(8) :: tr + write(*,'(a)') 'Frame EMEDELAY-survive: eme_delay, no mode/trperiod -> survives' + call fresh(p) + md = 8; tr = 15.d0 + cfg%eme_delay_seconds_set = .true.; cfg%eme_delay_seconds = 1.9d0 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('emedelay = 1.9 (no policy)', abs(p%emedelay - 1.9) .lt. 1.0e-6) + end subroutine frame_emedelay_survive + + ! Frame EMEDELAY (D1b): eme_delay + mode=8 -> per-mode policy clobbers to 0.0 + ! (emedelay is applied BEFORE the policy call, which overwrites it). + subroutine frame_emedelay_ft8() + type(params_block) :: p + type(configure_fields) :: cfg + integer :: md + real(8) :: tr + write(*,'(a)') 'Frame EMEDELAY-ft8: eme_delay + mode=8 -> policy clobbers to 0.0' + call fresh(p) + md = 8; tr = 15.d0 + cfg%eme_delay_seconds_set = .true.; cfg%eme_delay_seconds = 1.9d0 + cfg%mode_set = .true.; cfg%mode = 8 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('emedelay = 0.0 (FT8 policy)', abs(p%emedelay - 0.0) .lt. 1.0e-6) + end subroutine frame_emedelay_ft8 + + ! Frame EMEDELAY (D1c): eme_delay + mode=66 (Q65) + trperiod=60 -> policy = 2.5. + subroutine frame_emedelay_q65() + type(params_block) :: p + type(configure_fields) :: cfg + integer :: md + real(8) :: tr + write(*,'(a)') 'Frame EMEDELAY-q65: eme_delay + Q65 60s -> policy = 2.5' + call fresh(p) + md = 8; tr = 15.d0 + cfg%eme_delay_seconds_set = .true.; cfg%eme_delay_seconds = 1.9d0 + cfg%mode_set = .true.; cfg%mode = 66 + cfg%trperiod_set = .true.; cfg%trperiod = 60.d0 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('emedelay = 2.5 (Q65 60s policy)', abs(p%emedelay - 2.5) .lt. 1.0e-6) + end subroutine frame_emedelay_q65 + + ! Frame NFA/NFB restore: on a mode change with NO explicit nfa/nfb, the + ! session baseline is restored; an explicit nfa is honored instead. + subroutine frame_nfa_nfb_restore() + type(params_block) :: p + type(configure_fields) :: cfg, blank + integer :: md + real(8) :: tr + write(*,'(a)') 'Frame NFA/NFB: mode change restores baseline unless explicit' + ! (a) no explicit nfa/nfb -> baseline restored + call fresh(p) + md = 8; tr = 15.d0 + cfg = blank + cfg%mode_set = .true.; cfg%mode = 8 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('no nfa/nfb + mode change -> nfa = baseline 111', p%nfa .eq. BNFA) + call ok('no nfa/nfb + mode change -> nfb = baseline 222', p%nfb .eq. BNFB) + ! (b) explicit nfa wins over baseline + call fresh(p) + md = 8; tr = 15.d0 + cfg = blank + cfg%mode_set = .true.; cfg%mode = 8 + cfg%nfa_set = .true.; cfg%nfa = 900 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('explicit nfa=900 + mode change -> nfa = 900 (not baseline)', p%nfa .eq. 900) + end subroutine frame_nfa_nfb_restore + + ! Frame NTOL policy: per-mode cap (consumer set) vs restore (consumer unset), + ! on a mode/trperiod change. + subroutine frame_ntol_policy() + type(params_block) :: p + type(configure_fields) :: cfg, blank + integer :: md + real(8) :: tr + write(*,'(a)') 'Frame NTOL: per-mode cap/restore on mode change' + ! FT8, consumer unset -> restore default 1000. Sentinel 7777 first (review + ! HIGH: the mode-8 baseline is already 1000, so without a sentinel a deleted + ! restore line would pass vacuously). + call fresh(p); md = 8; tr = 15.d0; cfg = blank + p%ntol = 7777 + cfg%mode_set = .true.; cfg%mode = 8 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('FT8 + no ntol -> ntol = 1000 (restored from 7777)', p%ntol .eq. 1000) + ! FT8, consumer 5000 -> min(5000,1000) = 1000 + call fresh(p); md = 8; tr = 15.d0; cfg = blank + cfg%mode_set = .true.; cfg%mode = 8 + cfg%ntol_set = .true.; cfg%ntol = 5000 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('FT8 + ntol 5000 -> ntol = 1000 (capped)', p%ntol .eq. 1000) + ! FT8, consumer 200 -> 200 (under cap) + call fresh(p); md = 8; tr = 15.d0; cfg = blank + cfg%mode_set = .true.; cfg%mode = 8 + cfg%ntol_set = .true.; cfg%ntol = 200 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('FT8 + ntol 200 -> ntol = 200', p%ntol .eq. 200) + ! Q65, consumer 999 -> hard 10 + call fresh(p); md = 8; tr = 60.d0; cfg = blank + cfg%mode_set = .true.; cfg%mode = 66 + cfg%trperiod_set = .true.; cfg%trperiod = 60.d0 + cfg%ntol_set = .true.; cfg%ntol = 999 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('Q65 + ntol 999 -> ntol = 10 (hard)', p%ntol .eq. 10) + ! JT65+JT9 (mode 74), consumer unset -> hard 20 + call fresh(p); md = 8; tr = 60.d0; cfg = blank + cfg%mode_set = .true.; cfg%mode = 65 + 9 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('JT65+JT9 + no ntol -> ntol = 20 (hard)', p%ntol .eq. 20) + ! FST4 (241), consumer 50 -> min(50,100) = 50 + call fresh(p); md = 8; tr = 60.d0; cfg = blank + cfg%mode_set = .true.; cfg%mode = 241 + cfg%ntol_set = .true.; cfg%ntol = 50 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('FST4 + ntol 50 -> ntol = 50 (under cap)', p%ntol .eq. 50) + end subroutine frame_ntol_policy + + ! Frame MODE/TRPERIOD: mode routes to io_mode + nmode; default TRperiod is + ! derived when no explicit trperiod follows; explicit trperiod -> ntr. + subroutine frame_mode_trperiod() + type(params_block) :: p + type(configure_fields) :: cfg, blank + integer :: md + real(8) :: tr + write(*,'(a)') 'Frame MODE/TRPERIOD: mode -> io_mode/nmode + TRperiod default' + ! mode=5 (FT4), no explicit trperiod -> io_mode=5, nmode=5, TRperiod=7.5, ntr=7 + call fresh(p); md = 8; tr = 15.d0; cfg = blank + cfg%mode_set = .true.; cfg%mode = 5 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('mode=5 -> io_mode = 5', md .eq. 5) + call ok('mode=5 -> nmode = 5', p%nmode .eq. 5) + call ok('mode=5 -> TRperiod = 7.5', abs(tr - 7.5d0) .lt. 1.0e-9) + call ok('mode=5 -> ntr = 7', p%ntr .eq. 7) + ! explicit trperiod=30 -> ntr=30 + call fresh(p); md = 8; tr = 15.d0; cfg = blank + cfg%mode_set = .true.; cfg%mode = 144 + cfg%trperiod_set = .true.; cfg%trperiod = 30.d0 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('trperiod=30 -> ntr = 30', p%ntr .eq. 30) + end subroutine frame_mode_trperiod + + ! Frame MULTITHREADED-GUARD: multithreaded_ft8 is apply-IGNORED when non-false + ! (a true would re-enable the broken multithread branch + ! decoder.f90:192 -> 0 FT8 decodes). (a) a cfg true must NOT set + ! lmultift8 true (a straight pass-through regression would, and this catches it); + ! (b) a cfg false IS honored. + subroutine frame_multithreaded_guard() + type(params_block) :: p + type(configure_fields) :: cfg, blank + integer :: md + real(8) :: tr + write(*,'(a)') 'Frame MULTITHREADED-GUARD: multithreaded_ft8 ignore-non-false' + ! (a) true is IGNORED: plant lmultift8=.false., apply true, assert STILL false. + ! (A pass-through regression would set it true and fail this.) + call fresh(p); md = 8; tr = 15.d0; cfg = blank + p%lmultift8 = .false. + cfg%multithreaded_ft8_set = .true.; cfg%multithreaded_ft8 = .true. + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('multithreaded_ft8=true IGNORED -> lmultift8 stays false', .not. logical(p%lmultift8)) + ! (b) false is HONORED: plant lmultift8=.true. (sentinel), apply false -> false. + call fresh(p); md = 8; tr = 15.d0; cfg = blank + p%lmultift8 = .true. + cfg%multithreaded_ft8_set = .true.; cfg%multithreaded_ft8 = .false. + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('multithreaded_ft8=false honored -> lmultift8 false', .not. logical(p%lmultift8)) + end subroutine frame_multithreaded_guard + + ! Frame QSO-GUARD: qso_progress_state apply guard. nQSOProgress + ! reaches the single-pass FT8 decoder where ft8b.f90:274/299 index + ! nappasses(0:5)/naptypes(0:5,4) -> an out-of-range value crashes the decoder + ! (verified: qso_progress_state=99 crashes jt9 --stream). The apply IGNORES an + ! out-of-range value (valid [0,5] pass through unchanged) -- like the + ! multithreaded_ft8 guard. Negative-controlled: plant a sentinel (2) != asserted, + ! so a straight pass-through regression (which would write 99 / -1) fails the + ! ignore asserts, and a dropped apply fails the in-range asserts. + subroutine frame_qso_guard() + type(params_block) :: p + type(configure_fields) :: cfg, blank + integer :: md + real(8) :: tr + write(*,'(a)') 'Frame QSO-GUARD: qso_progress_state in-range applied / out-of-range ignored' + md = 8; tr = 15.d0 + ! out-of-range HIGH (99) IGNORED: plant 2, apply 99, assert STILL 2. + call fresh(p); cfg = blank; p%nQSOProgress = 2 + cfg%qso_progress_state_set = .true.; cfg%qso_progress_state = 99 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('qso_progress_state=99 (>5) IGNORED -> nQSOProgress stays 2', p%nQSOProgress .eq. 2) + ! out-of-range LOW (-1) IGNORED: plant 2, apply -1, assert STILL 2. + call fresh(p); cfg = blank; p%nQSOProgress = 2 + cfg%qso_progress_state_set = .true.; cfg%qso_progress_state = -1 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('qso_progress_state=-1 (<0) IGNORED -> nQSOProgress stays 2', p%nQSOProgress .eq. 2) + ! in-range boundary 5 APPLIED (overwrites sentinel 2). + call fresh(p); cfg = blank; p%nQSOProgress = 2 + cfg%qso_progress_state_set = .true.; cfg%qso_progress_state = 5 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('qso_progress_state=5 (in range) APPLIED -> nQSOProgress = 5', p%nQSOProgress .eq. 5) + ! in-range boundary 0 APPLIED (overwrites sentinel 2 -> proves it is applied, + ! not merely left at a default that happens to equal 0). + call fresh(p); cfg = blank; p%nQSOProgress = 2 + cfg%qso_progress_state_set = .true.; cfg%qso_progress_state = 0 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('qso_progress_state=0 (in range) APPLIED -> nQSOProgress = 0', p%nQSOProgress .eq. 0) + end subroutine frame_qso_guard + + ! Frame UTC-PRECEDENCE (Phase 8): utc (ISO) is a SECOND route to + ! nutc alongside the legacy int nutc. apply_configure_fields applies nutc THEN + ! utc, so utc WINS when a frame carries both. Three cases, each sentinel-planted + ! (nutc=999999, != every asserted value) so a dropped apply fails: + ! (a) utc alone -> nutc = utc_nutc (133430) + ! (b) legacy nutc alone -> nutc = nutc (120000) + ! (c) BOTH -> utc wins (133430, NOT 120000) + ! Case (c) is the precedence killer: a swap of the two apply lines (utc before + ! nutc) would leave 120000 and fail it. + subroutine frame_utc_precedence() + type(params_block) :: p + type(configure_fields) :: cfg, blank + integer :: md + real(8) :: tr + write(*,'(a)') 'Frame UTC-PRECEDENCE: utc routes to nutc and wins over a co-present nutc' + md = 8; tr = 15.d0 + ! (a) utc alone -> nutc = utc_nutc. + call fresh(p); cfg = blank; p%nutc = 999999 + cfg%utc_set = .true.; cfg%utc_nutc = 133430 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('utc alone -> nutc = 133430', p%nutc .eq. 133430) + ! (b) legacy nutc alone -> nutc = nutc. + call fresh(p); cfg = blank; p%nutc = 999999 + cfg%nutc_set = .true.; cfg%nutc = 120000 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('nutc alone -> nutc = 120000', p%nutc .eq. 120000) + ! (c) BOTH -> utc wins (120000 overwritten by 133430). + call fresh(p); cfg = blank; p%nutc = 999999 + cfg%nutc_set = .true.; cfg%nutc = 120000 + cfg%utc_set = .true.; cfg%utc_nutc = 133430 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('nutc+utc -> utc WINS (nutc = 133430, not 120000)', p%nutc .eq. 133430) + end subroutine frame_utc_precedence + + ! Frame PHASE9-PACK (Phase 9): the two derived packed ints route + ! FLAT to params%ndepth / params%nexp_decode. The bit-PACKING itself (each wire + ! key -> its bit, the contest collapse, the masking/clamp) is asserted by the + ! parse-unit (run-phase9-parse-unit.sh); this guards the cfg -> params ROUTING. + ! ndepth_packed and the legacy depth are mutually exclusive on an accepted frame + ! (co-present is declined at parse), so they are tested separately: frame_flat + ! covers depth -> ndepth, this covers ndepth_packed -> ndepth. Sentinel-opposite: + ! plant ndepth/nexp_decode = 99 (!= the asserted values) so a + ! dropped or mis-routed apply leaves the sentinel and fails. The asserted values + ! are realistic packs: ndepth 178 = 2|0x10|0x20|0x80; nexp_decode 1382 = + ! 6|0x20|0x40|(5<<8). + subroutine frame_phase9_pack() + type(params_block) :: p + type(configure_fields) :: cfg, blank + integer :: md + real(8) :: tr + write(*,'(a)') 'Frame PHASE9-PACK: ndepth_packed/nexp_decode_packed -> their slots' + call fresh(p); md = 8; tr = 15.d0; cfg = blank + p%ndepth = 99 ! sentinel != 178 + p%nexp_decode = 99 ! sentinel != 1382 + cfg%ndepth_packed_set = .true.; cfg%ndepth_packed = 178 + cfg%nexp_decode_packed_set = .true.; cfg%nexp_decode_packed = 1382 + call apply_configure_fields(cfg, md, tr, p, BNFA, BNFB) + call ok('ndepth_packed -> ndepth = 178 (not sentinel 99)', p%ndepth .eq. 178) + call ok('nexp_decode_packed -> nexp_decode = 1382 (not sentinel 99)', p%nexp_decode .eq. 1382) + end subroutine frame_phase9_pack + +end program apply_routing_test diff --git a/test/fixtures/README.md b/test/fixtures/README.md new file mode 100644 index 00000000..f511c352 --- /dev/null +++ b/test/fixtures/README.md @@ -0,0 +1,47 @@ +# Golden fixtures + +Known-good decoder outputs captured at SHA `3b354122` (a commit with zero decoder changes relative to its parent). + +These fixtures are the regression baseline: any change that alters `jt9`'s or `wsprd`'s stdout byte-for-byte fails the harness in CI. The harness protects decoder behavior through the streaming I/O, NDJSON output, control frames, and wsprd streaming paths. + +## Current fixtures + +| Fixture | Input | Mode | Decodes | Captured from | +|---|---|---|---|---| +| `ft8_210703_133430.expected.txt` | `samples/FT8/210703_133430.wav` | FT8 (`-8`) | 14 signals | `3b354122` | +| `jt9_130418_1742.expected.txt` | `samples/JT9/130418_1742.wav` | JT9 (`-9`) | 6 signals | `3b354122` | +| `q65_30a_201203_024000.expected.txt` | `samples/Q65/30A_Ionoscatter_6m/201203_024000.wav` | Q65-30A (`--q65 -p 30 -f 1000 -d 3`) | 1 signal | K1JT, 2026-08-01 | +| `q65_300a_201210_0505.expected.txt` | `samples/Q65/300A_Optical_Scatter/201210_0505.wav` | Q65-300A (`--q65 -p 300 -f 1000 -d 3`) | 1 signal | K1JT, 2026-08-02 | +| `q65_60d_201212_1838.expected.txt` | `samples/Q65/60D_EME_10GHz/201212_1838.wav` | Q65-60D (`--q65 -b D -p 60 -f 1000 -d 3`) | 1 signal | K1JT, 2026-08-02 | +| `msk144_181211_120800.expected.txt` | `samples/MSK144/181211_120800.wav` | MSK144 (`--msk144 -p 15 -f 1500 -F 50 -d 3`) | 2 signals | K1JT, 2026-08-02 | +| `fst4_210115_0058.expected.txt` | `samples/FST4+FST4W/210115_0058.wav` | FST4 (`--fst4 -p 60 -f 1331 -L 1000 -H 1400 -d 3`) | 3 signals | K1JT, 2026-08-02 | +| `fst4w_201230_0300.expected.txt` | `samples/FST4+FST4W/201230_0300.wav` | FST4W (`--fst4w -p 1800 -f 1433 -F 100 -d 3`) | 1 signal | K1JT, 2026-08-02 | +| `ft4_000000_000002.expected.txt` | `samples/FT4/000000_000002.wav` | FT4 (`--ft4 -d 3`) | 19 signals | K1JT, 2026-08-02 | +| `jt65_000000_0004.expected.txt` | `samples/JT65/JT65B/000000_0004.wav` | JT65 (`--jt65 -b B -f 1700 -d 3`) | 1 signal | K1JT, 2026-08-02 | +| `jt4_OK1KIR_141105_175700.expected.txt` | `samples/JT4/JT4F/OK1KIR_141105_175700.WAV` | JT4-F (`--jt4 -b F -f 1200 -d 3`) | 1 signal | K1JT, 2026-08-02 | +| `wspr_150426_0918.expected.txt` | `samples/WSPR/150426_0918.wav` | WSPR (`wsprd`, no flags) | 9 signals | K1JT, 2026-08-02 | + +## Running + +Two independent ways to run these: + +- **Standalone script** (manual/local use, not itself CI-invoked): + ``` + cmake --build build --target jt9 wsprd + test/run-golden-fixtures.sh + ``` + Exits 0 on pass, 1 on regression. +- **ctest** (this is what CI actually runs): each fixture above is also registered as a `test_jt9_golden_*`/`test_wsprd_golden_*` test via `wsjt_add_jt9_golden_test`/`wsjt_add_wsprd_golden_test` in the top-level `CMakeLists.txt`, using `tests/integration/{jt9,wsprd}/compare_*_output.cmake` for an isolated, byte-exact comparison. These are gated to Linux x86-64 only (`ctest -R test_jt9_golden` / `test_wsprd_golden` to run just these) -- decoder output can drift in small ways across compilers/architectures, so the byte-exact check is pinned to one canonical platform; the other four CI legs still run everything else in `ctest`. + +## Adding a fixture + +1. Put the input `.wav` under `samples//` (already there for standard modes). +2. Run `./build/jt9 samples//.wav > test/fixtures/.expected.txt 2>&1` (or `./build/wsprd .wav > ...` for WSPR). +3. Add a `run_fixture` call in `test/run-golden-fixtures.sh`, **and** a `wsjt_add_jt9_golden_test`/`wsjt_add_wsprd_golden_test` call in the top-level `CMakeLists.txt` -- the shell script alone does not run in CI. +4. Commit the expected file + both script/CMake changes together. + +## Coverage + +- FT8 + JT9 + Q65-30A + Q65-300A + Q65-60D + MSK144 + FST4 + FST4W + FT4 + JT65 + JT4 + WSPR fixtures above cover basic decoder regression. +- The streaming harnesses extend coverage to FST4 (`-7`), Q65 (`-3`), MSK144 (`-5`), and wsprd streaming. +- Streaming I/O parity: `test/run-stream-wav-parity.sh` validates that `jt9 --stream` decodes **contain** these expected decodes. The check is **containment, not identity**: streaming legitimately finds *more* signals (the early `nzhsym` passes pick up low-SNR signals) and the `snr`/`dt`/`freq` fields drift between the WAV and stream decode paths for the same signal (≈ ±2 dB / ±0.05 s / ±3 Hz — different fine estimates), so the decoded **message text** is the parity identity. FT8/JT9 only (FST4W has no good fixture; EME/JT65 I/Q paths are pass-on-absence). diff --git a/test/fixtures/fst4_210115_0058.expected.txt b/test/fixtures/fst4_210115_0058.expected.txt new file mode 100644 index 00000000..87c3c703 --- /dev/null +++ b/test/fixtures/fst4_210115_0058.expected.txt @@ -0,0 +1,4 @@ +0058 17 0.4 1331 ` CQ K9KFR EN71 +0058 -8 0.3 1101 ` CQ N5TM EL29 +0058 -29 0.4 1135 ` CQ N3HSK FM28 ? a1 + 0 3 0 diff --git a/test/fixtures/fst4w_201230_0300.expected.txt b/test/fixtures/fst4w_201230_0300.expected.txt new file mode 100644 index 00000000..5565f4e9 --- /dev/null +++ b/test/fixtures/fst4w_201230_0300.expected.txt @@ -0,0 +1,2 @@ +0300 -44 0.3 1433 ` DL0HOT JO60 30 + 0 1 0 diff --git a/test/fixtures/ft4_000000_000002.expected.txt b/test/fixtures/ft4_000000_000002.expected.txt new file mode 100644 index 00000000..647422bc --- /dev/null +++ b/test/fixtures/ft4_000000_000002.expected.txt @@ -0,0 +1,20 @@ +000002 -10 -0.2 296 + N1TRK N4FKH 569 VA +000002 -9 -0.4 422 + N1TRK KB7RUQ RR73 +000002 -7 -0.1 560 + CQ RU AB5XS EM12 +000002 -12 0.1 727 + NZ7P WA7JAY 589 CA +000002 16 0.3 1149 + KB0VHA KA1YQC R 539 MA +000002 -3 -0.2 1640 + CQ RU N9OY EN43 +000002 -11 0.2 1910 + K1JT WB4HXE 559 GA +000002 5 0.3 2067 + VE3LON K7RL R 549 WA +000002 -1 0.2 2310 + WD9IGY KX1X 73 +000002 -17 -0.4 2413 + W7BOB KJ7G RR73 +000002 -7 -0.3 2566 + NI6G W7DRW 569 AZ +000002 2 -0.3 2725 + K4SQC VE3RX RR73 +000002 -6 -0.4 2813 + CQ RU W1QA FN32 +000002 0 0.0 2995 + CQ RU WS4WW FM17 +000002 13 0.2 3159 + HB9BUN KG4W R 549 VA +000002 -8 0.4 3337 + W9TO KN3ILZ 529 PA +000002 -10 -0.3 520 + W9JA PY2APK RRR +000002 -15 0.2 2299 + AC6BW KR9A R 559 WI +000002 -13 -0.3 2560 + CQ RU W0FRC DM79 + 0 19 0 diff --git a/test/fixtures/ft8_210703_133430.expected.txt b/test/fixtures/ft8_210703_133430.expected.txt new file mode 100644 index 00000000..03b27568 --- /dev/null +++ b/test/fixtures/ft8_210703_133430.expected.txt @@ -0,0 +1,15 @@ +133430 15 0.3 2571 ~ W1FC F5BZB -08 +133430 -2 -0.8 1197 ~ CQ F5RXL IN94 +133430 13 -0.1 2157 ~ WM3PEN EA6VQ -09 +133430 -13 0.3 590 ~ K1JT HA0DU KN07 +133430 -7 0.1 723 ~ A92EE F5PSR -14 +133430 -3 -0.1 2695 ~ K1BZM EA3GP -09 +133430 -13 0.3 641 ~ N1JFU EA6EE R-07 +133430 -3 0.2 466 ~ N1PJT HB9CQK -10 +133430 -7 0.4 2734 ~ W1DIG SV9CVY -14 +133430 -16 0.1 1649 ~ K1JT EA3AGB -15 +133430 -16 0.3 400 ~ W0RSJ EA3BMU RR73 +133430 -11 0.2 2855 ~ XE2X HA2NP RR73 +133430 -6 0.4 472 ~ KD2UGC F6GCP R-23 +133430 -7 0.2 2522 ~ K1BZM EA3CJ JN01 + 0 14 0 diff --git a/test/fixtures/ft8_210703_133430_mtd.expected.txt b/test/fixtures/ft8_210703_133430_mtd.expected.txt new file mode 100644 index 00000000..78a17b08 --- /dev/null +++ b/test/fixtures/ft8_210703_133430_mtd.expected.txt @@ -0,0 +1,21 @@ +# Message identities are compared as a set; numeric metadata and order are informational. +133430 -9 0.1 723 ~ A92EE F5PSR -14 +133430 -7 -0.8 1196 ~ CQ F5RXL IN94 +133430 0 -0.1 2157 ~ WM3PEN EA6VQ -09 +133430 0 0.3 2571 ~ W1FC F5BZB -08 +133430 -14 0.3 641 ~ N1JFU EA6EE R-07 +133430 -13 0.3 2239 ~ N1API HA6FQ -23 +133430 -13 0.3 590 ~ K1JT HA0DU KN07 +133430 -12 0.3 465 ~ N1PJT HB9CQK -10 +133430 -11 -0.1 2695 ~ K1BZM EA3GP -09 +133430 -15 0.1 2279 ~ CQ EA2BFM IN83 +133430 -15 0.3 399 ~ W0RSJ EA3BMU RR73 +133430 -9 0.4 2734 ~ W1DIG SV9CVY -14 +133430 -15 0.1 1648 ~ K1JT EA3AGB -15 +133430 -18 0.7 1513 ~ N1API F2VX 73 +133430 -10 0.4 472 ~ KD2UGC F6GCP R-23 +133430 -14 0.2 2854 ~ XE2X HA2NP RR73 +133430 -18 0.1 2039 ~ K1JT HA5WA 73 +133430 -19 0.5 244 ~ K1BZM DK8NE -10 +133430 -12 0.2 2522 ~ K1BZM EA3CJ JN01 +133430 -15 -0.1 2546 ~ WA2FZW DL5AXX RR73 diff --git a/test/fixtures/jt4_OK1KIR_141105_175700.expected.txt b/test/fixtures/jt4_OK1KIR_141105_175700.expected.txt new file mode 100644 index 00000000..5add3711 --- /dev/null +++ b/test/fixtures/jt4_OK1KIR_141105_175700.expected.txt @@ -0,0 +1,2 @@ +**** -14 1.8 1199 $# G3WDG OK1KIR RRR f + 0 1 0 diff --git a/test/fixtures/jt65_000000_0004.expected.txt b/test/fixtures/jt65_000000_0004.expected.txt new file mode 100644 index 00000000..6a230c84 --- /dev/null +++ b/test/fixtures/jt65_000000_0004.expected.txt @@ -0,0 +1,2 @@ +0004 -26 2.5 1700 # K1ABC G4XYZ IO91 + 0 1 0 diff --git a/test/fixtures/jt9_130418_1742.expected.txt b/test/fixtures/jt9_130418_1742.expected.txt new file mode 100644 index 00000000..147b44de --- /dev/null +++ b/test/fixtures/jt9_130418_1742.expected.txt @@ -0,0 +1,7 @@ +1742 -5 1.2 1505 @ JA1KAU PD0JAC -23 +1742 -25 0.0 1119 @ CQ GM7GAX IO75 +1742 -17 -0.0 1186 @ TF3G N7MQ CN84 +1742 -18 0.0 1224 @ K1JT KF4RWA 73 +1742 -22 0.1 1290 @ CQ M0WAY IO82 +1742 -13 0.0 1461 @ G7CNF N4HFA EL89 + 0 6 0 diff --git a/test/fixtures/msk144_181211_120800.expected.txt b/test/fixtures/msk144_181211_120800.expected.txt new file mode 100644 index 00000000..484bae80 --- /dev/null +++ b/test/fixtures/msk144_181211_120800.expected.txt @@ -0,0 +1,3 @@ +120800 5 4.6 1458 & CQ W4IMD EM84 +120800 7 12.2 1496 & CQ KD9VV EN71 + 0 0 0 diff --git a/test/fixtures/q65_300a_201210_0505.expected.txt b/test/fixtures/q65_300a_201210_0505.expected.txt new file mode 100644 index 00000000..b921120b --- /dev/null +++ b/test/fixtures/q65_300a_201210_0505.expected.txt @@ -0,0 +1,2 @@ +0505 -34 -0.6 1002 : VK7MO VK7PD QE38 q0 + 0 1 1 diff --git a/test/fixtures/q65_30a_201203_024000.expected.txt b/test/fixtures/q65_30a_201203_024000.expected.txt new file mode 100644 index 00000000..d511c993 --- /dev/null +++ b/test/fixtures/q65_30a_201203_024000.expected.txt @@ -0,0 +1,2 @@ +024000 -18 0.3 1008 : K1JT K9AN R-16 q0 + 0 1 1000 diff --git a/test/fixtures/q65_60d_201212_1838.expected.txt b/test/fixtures/q65_60d_201212_1838.expected.txt new file mode 100644 index 00000000..46216a00 --- /dev/null +++ b/test/fixtures/q65_60d_201212_1838.expected.txt @@ -0,0 +1,2 @@ +1838 -15 2.8 998 : VK7MO K6QPV DM12 q0 + 0 1 1000 diff --git a/test/fixtures/wspr_150426_0918.expected.txt b/test/fixtures/wspr_150426_0918.expected.txt new file mode 100644 index 00000000..42ab2b7f --- /dev/null +++ b/test/fixtures/wspr_150426_0918.expected.txt @@ -0,0 +1,10 @@ +0918 -9 1.1 0.001446 0 ND6P DM04 30 +0918 -15 0.1 0.001460 0 W5BIT EL09 17 +0918 -23 2.2 0.001465 0 G8VDQ IO91 37 +0918 -6 0.6 0.001489 0 WD4LHT EL89 30 +0918 -1 -0.8 0.001503 0 NM7J DM26 30 +0918 -21 0.5 0.001517 0 KI7CI DM09 37 +0918 -18 -1.9 0.001530 0 DJ6OL JO52 37 +0918 -11 0.8 0.001587 0 W3HH EL89 30 +0918 -25 0.7 0.001594 0 W3BI FN20 30 + diff --git a/test/phase4_parse_test.f90 b/test/phase4_parse_test.f90 new file mode 100644 index 00000000..116bca60 --- /dev/null +++ b/test/phase4_parse_test.f90 @@ -0,0 +1,206 @@ +! Phase 4 parse-unit regression driver ("unit parse->pack assert"). +! Exercises parse_control_frame for the 9 Phase 4 +! keys + the tricky cases: bool true/false, his_call vs his_call_standard +! substring non-collision (both orderings), wrong-type detection (bool/string/ +! int), and value-vs-key aliasing (a string value equal to a key token must NOT +! be mistaken for that key). Compiled + run by +! test/run-phase4-parse-unit.sh against lib/streaming_control.f90. +! +! SCOPE: this guards the JSON -> configure_fields PARSE (the module-public entry +! point). The configure_fields -> params APPLY routing now lives in the module- +! public streaming_apply::apply_configure_fields (extracted from the +! former nested-internal apply_configure_) and is asserted by +! test/run-apply-routing-unit.sh — so the 9 inert Phase 4 fields' apply routing +! IS now unit-guarded, not just code-review + no-regression. +program p4_parse_test + use streaming_control, only: parse_control_frame, configure_fields, & + control_type_error, CTRL_CONFIGURE + implicit none + integer :: nfail + nfail = 0 + + call frame_A() + call frame_B() + call frame_C() + call frame_D() + call frame_E() + call frame_F() + call frame_G() + call frame_H() + call frame_I() + + write(*,'(a)') '------------------------------------------------------------' + if (nfail .eq. 0) then + write(*,'(a)') 'ALL PHASE 4 PARSE-UNIT CHECKS PASSED' + else + write(*,'(a,i0,a)') 'PHASE 4 PARSE-UNIT: ', nfail, ' CHECK(S) FAILED' + call exit(1) + end if + +contains + + subroutine ok(label, cond) + character(len=*), intent(in) :: label + logical, intent(in) :: cond + if (cond) then + write(*,'(a,a)') ' PASS ', label + else + write(*,'(a,a)') ' FAIL ', label + nfail = nfail + 1 + end if + end subroutine ok + + ! Frame A: all 9 keys, bools true. + subroutine frame_A() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","mode":"FT8","his_call":"DX1ABC","his_grid":"FN20",' // & + '"my_b_call":"KJ5HST/P","his_b_call":"DX1ABC/P","my_call_standard":true,' //& + '"his_call_standard":true,"tx_audio_offset_hz":1234,' // & + '"jt65_jt9_split_hz":2500,"max_drift_hz":8}' + write(*,'(a)') 'Frame A: all 9 keys present, bools true' + call parse_control_frame(b, action, cfg, terr) + call ok('action == CTRL_CONFIGURE', action .eq. CTRL_CONFIGURE) + call ok('terr not present', .not. terr%present) + call ok('his_call == DX1ABC', cfg%his_call_set .and. trim(cfg%his_call) .eq. 'DX1ABC') + call ok('his_grid == FN20', cfg%his_grid_set .and. trim(cfg%his_grid) .eq. 'FN20') + call ok('my_b_call == KJ5HST/P', cfg%my_b_call_set .and. trim(cfg%my_b_call) .eq. 'KJ5HST/P') + call ok('his_b_call == DX1ABC/P', cfg%his_b_call_set.and. trim(cfg%his_b_call).eq. 'DX1ABC/P') + call ok('my_call_standard == true', cfg%my_call_standard_set .and. cfg%my_call_standard) + call ok('his_call_standard == true', cfg%his_call_standard_set .and. cfg%his_call_standard) + call ok('tx_audio_offset_hz == 1234',cfg%tx_audio_offset_hz_set .and. cfg%tx_audio_offset_hz .eq. 1234) + call ok('jt65_jt9_split_hz == 2500', cfg%jt65_jt9_split_hz_set .and. cfg%jt65_jt9_split_hz .eq. 2500) + call ok('max_drift_hz == 8', cfg%max_drift_hz_set .and. cfg%max_drift_hz .eq. 8) + end subroutine frame_A + + ! Frame B: bools false (distinguish "set to false" from "absent"). + subroutine frame_B() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","my_call_standard":false,"his_call_standard":false}' + write(*,'(a)') 'Frame B: bools explicitly false' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present', .not. terr%present) + call ok('my_call_standard set, value false', cfg%my_call_standard_set .and. (.not. cfg%my_call_standard)) + call ok('his_call_standard set, value false', cfg%his_call_standard_set .and. (.not. cfg%his_call_standard)) + end subroutine frame_B + + ! Frame C: his_call AND his_call_standard both present, BOTH orderings. + ! "his_call" is a substring of "his_call_standard" — the closing quote in the + ! key token must prevent the shorter key from matching the longer one. + subroutine frame_C() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b1 = & + '{"t":"configure","his_call":"W1AW","his_call_standard":true}' + character(len=*), parameter :: b2 = & + '{"t":"configure","his_call_standard":true,"his_call":"W1AW"}' + write(*,'(a)') 'Frame C: his_call vs his_call_standard substring non-collision' + call parse_control_frame(b1, action, cfg, terr) + call ok('order1: terr not present', .not. terr%present) + call ok('order1: his_call == W1AW', cfg%his_call_set .and. trim(cfg%his_call) .eq. 'W1AW') + call ok('order1: his_call_standard == true', cfg%his_call_standard_set .and. cfg%his_call_standard) + call parse_control_frame(b2, action, cfg, terr) + call ok('order2: terr not present', .not. terr%present) + call ok('order2: his_call == W1AW', cfg%his_call_set .and. trim(cfg%his_call) .eq. 'W1AW') + call ok('order2: his_call_standard == true', cfg%his_call_standard_set .and. cfg%his_call_standard) + end subroutine frame_C + + ! Frame D: bool key carrying a number -> configure_type_error. + subroutine frame_D() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","my_call_standard":5}' + write(*,'(a)') 'Frame D: my_call_standard:5 (number) -> type error' + call parse_control_frame(b, action, cfg, terr) + call ok('terr present', terr%present) + call ok('key == my_call_standard',trim(terr%key) .eq. 'my_call_standard') + call ok('expected == bool', trim(terr%expected) .eq. 'bool') + call ok('got == number', trim(terr%got) .eq. 'number') + end subroutine frame_D + + ! Frame E: bool key carrying a string -> configure_type_error. + subroutine frame_E() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","his_call_standard":"true"}' + write(*,'(a)') 'Frame E: his_call_standard:"true" (string) -> type error' + call parse_control_frame(b, action, cfg, terr) + call ok('terr present', terr%present) + call ok('key == his_call_standard',trim(terr%key) .eq. 'his_call_standard') + call ok('expected == bool', trim(terr%expected) .eq. 'bool') + call ok('got == string', trim(terr%got) .eq. 'string') + end subroutine frame_E + + ! Frame F: string key carrying a number -> configure_type_error. + subroutine frame_F() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","his_call":123}' + write(*,'(a)') 'Frame F: his_call:123 (number) -> type error' + call parse_control_frame(b, action, cfg, terr) + call ok('terr present', terr%present) + call ok('key == his_call', trim(terr%key) .eq. 'his_call') + call ok('expected == string',trim(terr%expected) .eq. 'string') + call ok('got == number', trim(terr%got) .eq. 'number') + end subroutine frame_F + + ! Frame G: int key carrying a string -> configure_type_error. + subroutine frame_G() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","max_drift_hz":"abc"}' + write(*,'(a)') 'Frame G: max_drift_hz:"abc" (string) -> type error' + call parse_control_frame(b, action, cfg, terr) + call ok('terr present', terr%present) + call ok('key == max_drift_hz', trim(terr%key) .eq. 'max_drift_hz') + call ok('expected == int', trim(terr%expected) .eq. 'int') + call ok('got == string', trim(terr%got) .eq. 'string') + end subroutine frame_G + + ! Frame H: value-vs-key aliasing — his_call VALUE equals the "max_drift_hz" + ! token, with no real max_drift_hz key. The value must NOT be mistaken for the + ! key: max_drift_hz stays unset (benign extraction miss) and NO false type + ! error is raised (anchored find_key_ ignores the value). Aliasing guard. + subroutine frame_H() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","his_call":"max_drift_hz"}' + write(*,'(a)') 'Frame H: his_call value == "max_drift_hz" token (aliasing guard)' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present (no false decline)', .not. terr%present) + call ok('his_call == max_drift_hz', cfg%his_call_set .and. trim(cfg%his_call) .eq. 'max_drift_hz') + call ok('max_drift_hz stays UNSET', .not. cfg%max_drift_hz_set) + end subroutine frame_H + + ! Frame I: Phase 4 keys absent -> all unset, no error (keys are optional). + subroutine frame_I() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","mode":"FT8"}' + write(*,'(a)') 'Frame I: Phase 4 keys absent -> unset' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present', .not. terr%present) + call ok('his_call unset', .not. cfg%his_call_set) + call ok('his_grid unset', .not. cfg%his_grid_set) + call ok('my_b_call unset', .not. cfg%my_b_call_set) + call ok('his_b_call unset', .not. cfg%his_b_call_set) + call ok('my_call_standard unset', .not. cfg%my_call_standard_set) + call ok('his_call_standard unset', .not. cfg%his_call_standard_set) + call ok('tx_audio_offset_hz unset', .not. cfg%tx_audio_offset_hz_set) + call ok('jt65_jt9_split_hz unset', .not. cfg%jt65_jt9_split_hz_set) + call ok('max_drift_hz unset', .not. cfg%max_drift_hz_set) + end subroutine frame_I + +end program p4_parse_test diff --git a/test/phase5_parse_test.f90 b/test/phase5_parse_test.f90 new file mode 100644 index 00000000..e635484f --- /dev/null +++ b/test/phase5_parse_test.f90 @@ -0,0 +1,246 @@ +! Phase 5 parse-unit regression driver ("unit parse->pack assert"). +! Exercises parse_control_frame for the 12 Phase 5 +! decoder-tuning keys + the tricky cases: real(8) keys (dt_tolerance_seconds / +! eme_delay_seconds), the tx_mode enum (string JT9/JT65 -> 9/65 and raw int), +! bool true/false (robust_mode / nagain_flag / clear_average), wrong-type +! detection (real/int/bool), the "mode" vs "tx_mode" + "min_width" vs "min_sync" +! substring non-collision, and value-vs-key aliasing (a string value equal to a +! Phase-5 key token must NOT be mistaken for that key). +! Compiled + run by test/run-phase5-parse-unit.sh against lib/streaming_control.f90. +! +! SCOPE: this guards the JSON -> configure_fields PARSE (the module-public entry +! point). The configure_fields -> params APPLY routing now lives in the module- +! public streaming_apply::apply_configure_fields (extracted from the +! former nested-internal apply_configure_) and is asserted by +! test/run-apply-routing-unit.sh. For Phase 5, 10 of 12 fields are observably +! inert on the FT8/JT9 fixtures; the two observable keys (nagain_flag -> FT8, +! npts_c0_array -> JT9) ALSO get a decode-effect gate in run-schema-v1-fixtures.sh +! (Gates 11/12), which proves they reach the decoder (apply routed them to a +! decode-affecting param). +program p5_parse_test + use streaming_control, only: parse_control_frame, configure_fields, & + control_type_error, CTRL_CONFIGURE + implicit none + integer :: nfail + nfail = 0 + + call frame_A() + call frame_B() + call frame_C() + call frame_D() + call frame_E() + call frame_F() + call frame_G() + call frame_H() + call frame_I() + + write(*,'(a)') '------------------------------------------------------------' + if (nfail .eq. 0) then + write(*,'(a)') 'ALL PHASE 5 PARSE-UNIT CHECKS PASSED' + else + write(*,'(a,i0,a)') 'PHASE 5 PARSE-UNIT: ', nfail, ' CHECK(S) FAILED' + call exit(1) + end if + +contains + + subroutine ok(label, cond) + character(len=*), intent(in) :: label + logical, intent(in) :: cond + if (cond) then + write(*,'(a,a)') ' PASS ', label + else + write(*,'(a,a)') ' FAIL ', label + nfail = nfail + 1 + end if + end subroutine ok + + ! Frame A: all 12 keys, bools true, tx_mode as the "JT65" enum string. + subroutine frame_A() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","dt_tolerance_seconds":0.1,"eme_delay_seconds":1.5,' // & + '"kin_samples":64800,"nzhsym_per_period":50,"npts_c0_array":74736,' // & + '"min_width":1,"min_sync":2,"n_2pass":1,"robust_mode":true,' // & + '"nagain_flag":true,"tx_mode":"JT65","clear_average":true}' + write(*,'(a)') 'Frame A: all 12 keys present, bools true, tx_mode="JT65"' + call parse_control_frame(b, action, cfg, terr) + call ok('action == CTRL_CONFIGURE', action .eq. CTRL_CONFIGURE) + call ok('terr not present', .not. terr%present) + ! 0.1 is NOT exactly representable in real(4); the tight 1e-10 tolerance also + ! proves the configure_fields member is real(8) (a real(4) member would hold + ! ~0.10000000149 and fail). The narrowing to real(c_float) happens at APPLY. + call ok('dt_tolerance_seconds == 0.1 (real8)', cfg%dt_tolerance_seconds_set .and. & + abs(cfg%dt_tolerance_seconds - 0.1d0) .lt. 1.d-10) + call ok('eme_delay_seconds == 1.5', cfg%eme_delay_seconds_set .and. & + abs(cfg%eme_delay_seconds - 1.5d0) .lt. 1.d-9) + call ok('kin_samples == 64800', cfg%kin_samples_set .and. cfg%kin_samples .eq. 64800) + call ok('nzhsym_per_period == 50', cfg%nzhsym_per_period_set .and. cfg%nzhsym_per_period .eq. 50) + call ok('npts_c0_array == 74736', cfg%npts_c0_array_set .and. cfg%npts_c0_array .eq. 74736) + call ok('min_width == 1', cfg%min_width_set .and. cfg%min_width .eq. 1) + call ok('min_sync == 2', cfg%min_sync_set .and. cfg%min_sync .eq. 2) + call ok('n_2pass == 1', cfg%n_2pass_set .and. cfg%n_2pass .eq. 1) + call ok('robust_mode == true', cfg%robust_mode_set .and. cfg%robust_mode) + call ok('nagain_flag == true', cfg%nagain_flag_set .and. cfg%nagain_flag) + call ok('tx_mode == 65 (JT65)', cfg%tx_mode_set .and. cfg%tx_mode .eq. 65) + call ok('clear_average == true', cfg%clear_average_set .and. cfg%clear_average) + end subroutine frame_A + + ! Frame B: bools false (distinguish "set to false" from "absent"); + ! tx_mode as a raw int (9); a negative real. + subroutine frame_B() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","robust_mode":false,"nagain_flag":false,' // & + '"clear_average":false,"tx_mode":9,"dt_tolerance_seconds":-0.5}' + write(*,'(a)') 'Frame B: bools false, tx_mode=9 (int), negative real' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present', .not. terr%present) + call ok('robust_mode set, value false', cfg%robust_mode_set .and. (.not. cfg%robust_mode)) + call ok('nagain_flag set, value false', cfg%nagain_flag_set .and. (.not. cfg%nagain_flag)) + call ok('clear_average set, value false', cfg%clear_average_set .and. (.not. cfg%clear_average)) + call ok('tx_mode == 9 (int)', cfg%tx_mode_set .and. cfg%tx_mode .eq. 9) + call ok('dt_tolerance_seconds == -0.5', cfg%dt_tolerance_seconds_set .and. & + abs(cfg%dt_tolerance_seconds + 0.5d0) .lt. 1.d-9) + end subroutine frame_B + + ! Frame C: substring non-collision. "mode" is a substring of "tx_mode" and + ! "min_width"/"min_sync" share the "min_" prefix — the structural key locator + ! (closing quote in the token + anchor) must keep them distinct, both orderings. + subroutine frame_C() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b1 = & + '{"t":"configure","mode":"FT8","tx_mode":"JT9","min_width":3,"min_sync":4}' + character(len=*), parameter :: b2 = & + '{"t":"configure","tx_mode":"JT9","mode":"FT8","min_sync":4,"min_width":3}' + write(*,'(a)') 'Frame C: mode vs tx_mode + min_width vs min_sync non-collision' + call parse_control_frame(b1, action, cfg, terr) + call ok('order1: terr not present', .not. terr%present) + call ok('order1: mode == 8 (FT8)', cfg%mode_set .and. cfg%mode .eq. 8) + call ok('order1: tx_mode == 9 (JT9)',cfg%tx_mode_set .and. cfg%tx_mode .eq. 9) + call ok('order1: min_width == 3', cfg%min_width_set .and. cfg%min_width .eq. 3) + call ok('order1: min_sync == 4', cfg%min_sync_set .and. cfg%min_sync .eq. 4) + call parse_control_frame(b2, action, cfg, terr) + call ok('order2: terr not present', .not. terr%present) + call ok('order2: mode == 8 (FT8)', cfg%mode_set .and. cfg%mode .eq. 8) + call ok('order2: tx_mode == 9 (JT9)',cfg%tx_mode_set .and. cfg%tx_mode .eq. 9) + call ok('order2: min_width == 3', cfg%min_width_set .and. cfg%min_width .eq. 3) + call ok('order2: min_sync == 4', cfg%min_sync_set .and. cfg%min_sync .eq. 4) + end subroutine frame_C + + ! Frame D: real key carrying a string -> configure_type_error. + subroutine frame_D() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","dt_tolerance_seconds":"abc"}' + write(*,'(a)') 'Frame D: dt_tolerance_seconds:"abc" (string) -> type error' + call parse_control_frame(b, action, cfg, terr) + call ok('terr present', terr%present) + call ok('key == dt_tolerance_seconds', trim(terr%key) .eq. 'dt_tolerance_seconds') + call ok('expected == real', trim(terr%expected) .eq. 'real') + call ok('got == string', trim(terr%got) .eq. 'string') + end subroutine frame_D + + ! Frame E: int key carrying a string -> configure_type_error. + subroutine frame_E() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","npts_c0_array":"big"}' + write(*,'(a)') 'Frame E: npts_c0_array:"big" (string) -> type error' + call parse_control_frame(b, action, cfg, terr) + call ok('terr present', terr%present) + call ok('key == npts_c0_array', trim(terr%key) .eq. 'npts_c0_array') + call ok('expected == int', trim(terr%expected) .eq. 'int') + call ok('got == string', trim(terr%got) .eq. 'string') + end subroutine frame_E + + ! Frame F: bool key carrying a number -> configure_type_error. + subroutine frame_F() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","robust_mode":5}' + write(*,'(a)') 'Frame F: robust_mode:5 (number) -> type error' + call parse_control_frame(b, action, cfg, terr) + call ok('terr present', terr%present) + call ok('key == robust_mode', trim(terr%key) .eq. 'robust_mode') + call ok('expected == bool', trim(terr%expected) .eq. 'bool') + call ok('got == number', trim(terr%got) .eq. 'number') + end subroutine frame_F + + ! Frame G: value-vs-key aliasing — the mycall VALUE is the literal "n_2pass" + ! token, with no real n_2pass key. The anchored locator must NOT mistake the + ! value for the key: n_2pass stays unset (benign extraction miss) and NO false + ! type error is raised. (Documents the benign aliasing + ! behavior for an int key whose token appears as a string value.) NOTE: the + ! primary anchoring-REGRESSION teeth live in Frame C — a value's closing quote + ! is always followed by a structural char ('}'/','), so a hypothetical raw- + ! index regression would classify this value as 'absent' and also not decline; + ! Frame C (mode-inside-tx_mode, order2) is what actually fails on a raw-index + ! regression. This frame documents the benign no-false-decline contract. + subroutine frame_G() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","mycall":"n_2pass"}' + write(*,'(a)') 'Frame G: mycall value == "n_2pass" token (aliasing guard)' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present (no false decline)', .not. terr%present) + call ok('mycall == n_2pass', cfg%mycall_set .and. trim(cfg%mycall) .eq. 'n_2pass') + call ok('n_2pass stays UNSET', .not. cfg%n_2pass_set) + end subroutine frame_G + + ! Frame H: Phase 5 keys absent -> all unset, no error (keys are optional). + subroutine frame_H() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","mode":"FT8"}' + write(*,'(a)') 'Frame H: Phase 5 keys absent -> unset' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present', .not. terr%present) + call ok('dt_tolerance_seconds unset', .not. cfg%dt_tolerance_seconds_set) + call ok('eme_delay_seconds unset', .not. cfg%eme_delay_seconds_set) + call ok('kin_samples unset', .not. cfg%kin_samples_set) + call ok('nzhsym_per_period unset', .not. cfg%nzhsym_per_period_set) + call ok('npts_c0_array unset', .not. cfg%npts_c0_array_set) + call ok('min_width unset', .not. cfg%min_width_set) + call ok('min_sync unset', .not. cfg%min_sync_set) + call ok('n_2pass unset', .not. cfg%n_2pass_set) + call ok('robust_mode unset', .not. cfg%robust_mode_set) + call ok('nagain_flag unset', .not. cfg%nagain_flag_set) + call ok('tx_mode unset', .not. cfg%tx_mode_set) + call ok('clear_average unset', .not. cfg%clear_average_set) + end subroutine frame_H + + ! Frame I: npts_c0_array feeds JT9 npts8. Values outside the downsam9 + ! FFT input domain are ignored rather than routed to the decoder. + subroutine frame_I() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b1 = '{"t":"configure","npts_c0_array":-1}' + character(len=*), parameter :: b2 = '{"t":"configure","npts_c0_array":0}' + character(len=*), parameter :: b3 = '{"t":"configure","npts_c0_array":81649}' + character(len=*), parameter :: b4 = '{"t":"configure","npts_c0_array":81648}' + write(*,'(a)') 'Frame I: npts_c0_array domain guard' + call parse_control_frame(b1, action, cfg, terr) + call ok('negative npts_c0_array ignored', .not. terr%present .and. .not. cfg%npts_c0_array_set) + call parse_control_frame(b2, action, cfg, terr) + call ok('zero npts_c0_array ignored', .not. terr%present .and. .not. cfg%npts_c0_array_set) + call parse_control_frame(b3, action, cfg, terr) + call ok('oversize npts_c0_array ignored', .not. terr%present .and. .not. cfg%npts_c0_array_set) + call parse_control_frame(b4, action, cfg, terr) + call ok('max npts_c0_array accepted', .not. terr%present .and. cfg%npts_c0_array_set .and. & + cfg%npts_c0_array .eq. 81648) + end subroutine frame_I + +end program p5_parse_test diff --git a/test/phase6_parse_test.f90 b/test/phase6_parse_test.f90 new file mode 100644 index 00000000..14249aa2 --- /dev/null +++ b/test/phase6_parse_test.f90 @@ -0,0 +1,216 @@ +! Phase 6 parse-unit regression driver. Exercises parse_control_frame for the 24 +! Phase 6 FT8/FT4-specifics keys (19 bools + 5 ints) + the tricky cases: bool +! true/false (distinguishing "set false" from "absent"), int parse, wrong-type +! detection (bool-as-number, int-as-string), the "mode" substring non-collisions +! introduced by hint_mode / hound_mode / superfox_mode (all contain "mode"), and +! value-vs-key aliasing. Compiled + run by +! test/run-phase6-parse-unit.sh against lib/streaming_control.f90. +! +! SCOPE: this guards the JSON -> configure_fields PARSE (the module-public entry +! point). The configure_fields -> params APPLY routing lives in the module-public +! streaming_apply::apply_configure_fields and is asserted by +! test/run-apply-routing-unit.sh (which includes the 24 Phase 6 slot asserts + +! the multithreaded_ft8 ignore-non-false guard). All 24 Phase 6 keys are inert on +! the FT8/JT9 fixtures (multithreaded_ft8 is destructive and +! apply-guarded, the rest read only on multithread/JT65/superfox/WAV paths or have +! no AP-only decodes on the fixture), so no decode-output gate can assert their +! values; this parse-unit + the apply-routing unit are their coverage. +program p6_parse_test + use streaming_control, only: parse_control_frame, configure_fields, & + control_type_error, CTRL_CONFIGURE + implicit none + integer :: nfail + nfail = 0 + + call frame_A() + call frame_B() + call frame_C() + call frame_D() + call frame_E() + call frame_F() + call frame_G() + + write(*,'(a)') '------------------------------------------------------------' + if (nfail .eq. 0) then + write(*,'(a)') 'ALL PHASE 6 PARSE-UNIT CHECKS PASSED' + else + write(*,'(a,i0,a)') 'PHASE 6 PARSE-UNIT: ', nfail, ' CHECK(S) FAILED' + call exit(1) + end if + +contains + + subroutine ok(label, cond) + character(len=*), intent(in) :: label + logical, intent(in) :: cond + if (cond) then + write(*,'(a,a)') ' PASS ', label + else + write(*,'(a,a)') ' FAIL ', label + nfail = nfail + 1 + end if + end subroutine ok + + ! Frame A: all 24 keys present — 19 bools true, 5 ints at distinct values. + subroutine frame_A() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","multithreaded_ft8":true,"ft8_cycles":2,' // & + '"ft8_rxf_sensitivity":4,"ft8_threads":3,"ft8_decoder_start":1,' // & + '"ft8_low_threshold":true,"ft8_subpass":true,"ft8_ap_on":true,' // & + '"ap_cq_only":true,"ap_my_call":true,"jt65_ap_on":true,' // & + '"ap_width_hz":150,"hide_ft8_duplicates":true,"common_ft8b":true,' // & + '"enable_dxc_search":true,"wide_dxc_search":true,"superfox_mode":true,' // & + '"even_sequence":true,"hound_mode":true,"multi_instance":true,' // & + '"skip_tx1":true,"nagain_filter":true,"stop_hint":true,"hint_mode":true}' + write(*,'(a)') 'Frame A: all 24 keys present (19 bools true, 5 ints distinct)' + call parse_control_frame(b, action, cfg, terr) + call ok('action == CTRL_CONFIGURE', action .eq. CTRL_CONFIGURE) + call ok('terr not present', .not. terr%present) + ! ints + call ok('ft8_cycles == 2', cfg%ft8_cycles_set .and. cfg%ft8_cycles .eq. 2) + call ok('ft8_rxf_sensitivity == 4', cfg%ft8_rxf_sensitivity_set .and. cfg%ft8_rxf_sensitivity .eq. 4) + call ok('ft8_threads == 3', cfg%ft8_threads_set .and. cfg%ft8_threads .eq. 3) + call ok('ft8_decoder_start == 1', cfg%ft8_decoder_start_set .and. cfg%ft8_decoder_start .eq. 1) + call ok('ap_width_hz == 150 (RAW)', cfg%ap_width_hz_set .and. cfg%ap_width_hz .eq. 150) + ! bools (true) + call ok('multithreaded_ft8 true', cfg%multithreaded_ft8_set .and. cfg%multithreaded_ft8) + call ok('ft8_low_threshold true', cfg%ft8_low_threshold_set .and. cfg%ft8_low_threshold) + call ok('ft8_subpass true', cfg%ft8_subpass_set .and. cfg%ft8_subpass) + call ok('ft8_ap_on true', cfg%ft8_ap_on_set .and. cfg%ft8_ap_on) + call ok('ap_cq_only true', cfg%ap_cq_only_set .and. cfg%ap_cq_only) + call ok('ap_my_call true', cfg%ap_my_call_set .and. cfg%ap_my_call) + call ok('jt65_ap_on true', cfg%jt65_ap_on_set .and. cfg%jt65_ap_on) + call ok('hide_ft8_duplicates true', cfg%hide_ft8_duplicates_set .and. cfg%hide_ft8_duplicates) + call ok('common_ft8b true', cfg%common_ft8b_set .and. cfg%common_ft8b) + call ok('enable_dxc_search true', cfg%enable_dxc_search_set .and. cfg%enable_dxc_search) + call ok('wide_dxc_search true', cfg%wide_dxc_search_set .and. cfg%wide_dxc_search) + call ok('superfox_mode true', cfg%superfox_mode_set .and. cfg%superfox_mode) + call ok('even_sequence true', cfg%even_sequence_set .and. cfg%even_sequence) + call ok('hound_mode true', cfg%hound_mode_set .and. cfg%hound_mode) + call ok('multi_instance true', cfg%multi_instance_set .and. cfg%multi_instance) + call ok('skip_tx1 true', cfg%skip_tx1_set .and. cfg%skip_tx1) + call ok('nagain_filter true', cfg%nagain_filter_set .and. cfg%nagain_filter) + call ok('stop_hint true', cfg%stop_hint_set .and. cfg%stop_hint) + call ok('hint_mode true', cfg%hint_mode_set .and. cfg%hint_mode) + end subroutine frame_A + + ! Frame B: bools false (distinguish "set false" from "absent"); ap_width_hz=0. + subroutine frame_B() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","ft8_ap_on":false,"ap_cq_only":false,' // & + '"superfox_mode":false,"hint_mode":false,"stop_hint":false,' // & + '"multithreaded_ft8":false,"ap_width_hz":0}' + write(*,'(a)') 'Frame B: bools false (set, not absent); ap_width_hz=0' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present', .not. terr%present) + call ok('ft8_ap_on set, value false', cfg%ft8_ap_on_set .and. (.not. cfg%ft8_ap_on)) + call ok('ap_cq_only set, value false', cfg%ap_cq_only_set .and. (.not. cfg%ap_cq_only)) + call ok('superfox_mode set, value false', cfg%superfox_mode_set .and. (.not. cfg%superfox_mode)) + call ok('hint_mode set, value false', cfg%hint_mode_set .and. (.not. cfg%hint_mode)) + call ok('stop_hint set, value false', cfg%stop_hint_set .and. (.not. cfg%stop_hint)) + call ok('multithreaded_ft8 set, false', cfg%multithreaded_ft8_set .and. (.not. cfg%multithreaded_ft8)) + call ok('ap_width_hz set, value 0', cfg%ap_width_hz_set .and. cfg%ap_width_hz .eq. 0) + end subroutine frame_B + + ! Frame C: "mode" substring non-collision. "mode" is a substring of hint_mode / + ! hound_mode / superfox_mode / tx_mode / submode — the structural key locator + ! (closing quote in the quoted token + anchor) must keep them distinct. Both + ! orderings. A raw-index regression would mis-classify these. + subroutine frame_C() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b1 = & + '{"t":"configure","mode":"FT8","tx_mode":"JT9","superfox_mode":true,' // & + '"hound_mode":false,"hint_mode":true}' + character(len=*), parameter :: b2 = & + '{"t":"configure","hint_mode":true,"hound_mode":false,' // & + '"superfox_mode":true,"tx_mode":"JT9","mode":"FT8"}' + write(*,'(a)') 'Frame C: mode vs tx_mode/superfox_mode/hound_mode/hint_mode' + call parse_control_frame(b1, action, cfg, terr) + call ok('order1: terr not present', .not. terr%present) + call ok('order1: mode == 8 (FT8)', cfg%mode_set .and. cfg%mode .eq. 8) + call ok('order1: tx_mode == 9 (JT9)', cfg%tx_mode_set .and. cfg%tx_mode .eq. 9) + call ok('order1: superfox_mode true', cfg%superfox_mode_set .and. cfg%superfox_mode) + call ok('order1: hound_mode false', cfg%hound_mode_set .and. (.not. cfg%hound_mode)) + call ok('order1: hint_mode true', cfg%hint_mode_set .and. cfg%hint_mode) + call parse_control_frame(b2, action, cfg, terr) + call ok('order2: terr not present', .not. terr%present) + call ok('order2: mode == 8 (FT8)', cfg%mode_set .and. cfg%mode .eq. 8) + call ok('order2: tx_mode == 9 (JT9)', cfg%tx_mode_set .and. cfg%tx_mode .eq. 9) + call ok('order2: superfox_mode true', cfg%superfox_mode_set .and. cfg%superfox_mode) + call ok('order2: hound_mode false', cfg%hound_mode_set .and. (.not. cfg%hound_mode)) + call ok('order2: hint_mode true', cfg%hint_mode_set .and. cfg%hint_mode) + end subroutine frame_C + + ! Frame D: int key carrying a string -> configure_type_error. + subroutine frame_D() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","ap_width_hz":"wide"}' + write(*,'(a)') 'Frame D: ap_width_hz:"wide" (string) -> type error' + call parse_control_frame(b, action, cfg, terr) + call ok('terr present', terr%present) + call ok('key == ap_width_hz', trim(terr%key) .eq. 'ap_width_hz') + call ok('expected == int', trim(terr%expected) .eq. 'int') + call ok('got == string', trim(terr%got) .eq. 'string') + end subroutine frame_D + + ! Frame E: bool key carrying a number -> configure_type_error (mirrors the + ! Gate 14 fixture, ft8_ap_on:5). + subroutine frame_E() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","ft8_ap_on":5}' + write(*,'(a)') 'Frame E: ft8_ap_on:5 (number) -> type error' + call parse_control_frame(b, action, cfg, terr) + call ok('terr present', terr%present) + call ok('key == ft8_ap_on', trim(terr%key) .eq. 'ft8_ap_on') + call ok('expected == bool', trim(terr%expected) .eq. 'bool') + call ok('got == number', trim(terr%got) .eq. 'number') + end subroutine frame_E + + ! Frame F: value-vs-key aliasing — the mycall VALUE is the literal "ft8_ap_on" + ! token, with no real ft8_ap_on key. The anchored locator must NOT mistake the + ! string value for the key: ft8_ap_on stays unset and NO false type error fires + ! (the benign no-false-decline contract for a Phase 6 key). + subroutine frame_F() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","mycall":"ft8_ap_on"}' + write(*,'(a)') 'Frame F: mycall value == "ft8_ap_on" token (aliasing guard)' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present (no false decline)', .not. terr%present) + call ok('mycall == ft8_ap_on', cfg%mycall_set .and. trim(cfg%mycall) .eq. 'ft8_ap_on') + call ok('ft8_ap_on stays UNSET', .not. cfg%ft8_ap_on_set) + end subroutine frame_F + + ! Frame G: Phase 6 keys absent -> all unset, no error (keys are optional). + subroutine frame_G() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","mode":"FT8"}' + write(*,'(a)') 'Frame G: Phase 6 keys absent -> unset' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present', .not. terr%present) + call ok('multithreaded_ft8 unset', .not. cfg%multithreaded_ft8_set) + call ok('ft8_cycles unset', .not. cfg%ft8_cycles_set) + call ok('ft8_ap_on unset', .not. cfg%ft8_ap_on_set) + call ok('ap_width_hz unset', .not. cfg%ap_width_hz_set) + call ok('superfox_mode unset', .not. cfg%superfox_mode_set) + call ok('hint_mode unset', .not. cfg%hint_mode_set) + call ok('stop_hint unset', .not. cfg%stop_hint_set) + call ok('nagain_filter unset', .not. cfg%nagain_filter_set) + end subroutine frame_G + +end program p6_parse_test diff --git a/test/phase7_parse_test.f90 b/test/phase7_parse_test.f90 new file mode 100644 index 00000000..6cde831e --- /dev/null +++ b/test/phase7_parse_test.f90 @@ -0,0 +1,182 @@ +! Phase 7 parse-unit regression driver. Exercises parse_control_frame for the 6 +! Phase 7 diagnostic / sequencing keys (4 ints + 2 bools) + the tricky cases: bool +! true/false (distinguishing "set false" from "absent"), int parse, wrong-type +! detection (int-as-string, bool-as-number), the "mode" substring non-collision +! introduced by mode_changed (it contains "mode", which is also a key and a +! substring of tx_mode), and value-vs-key aliasing. +! Compiled + run by test/run-phase7-parse-unit.sh against lib/streaming_control.f90. +! +! SCOPE: this guards the JSON -> configure_fields PARSE (the module-public entry +! point). The configure_fields -> params APPLY routing lives in the module-public +! streaming_apply::apply_configure_fields and is asserted by +! test/run-apply-routing-unit.sh (which includes the 6 Phase 7 slot asserts). All +! 6 Phase 7 keys are inert on the FT8/JT9 fixtures (five read only +! inside the multithreaded-FT8 block decoder.f90:192..1148 which streaming forces +! off; qso_progress_state reaches the single-pass FT8 decoder but only steers AP +! passes and the fixture has no AP-only decodes), so no decode-output gate can +! assert their values; this parse-unit + the apply-routing unit are their coverage. +program p7_parse_test + use streaming_control, only: parse_control_frame, configure_fields, & + control_type_error, CTRL_CONFIGURE + implicit none + integer :: nfail + nfail = 0 + + call frame_A() + call frame_B() + call frame_C() + call frame_D() + call frame_E() + call frame_F() + call frame_G() + + write(*,'(a)') '------------------------------------------------------------' + if (nfail .eq. 0) then + write(*,'(a)') 'ALL PHASE 7 PARSE-UNIT CHECKS PASSED' + else + write(*,'(a,i0,a)') 'PHASE 7 PARSE-UNIT: ', nfail, ' CHECK(S) FAILED' + call exit(1) + end if + +contains + + subroutine ok(label, cond) + character(len=*), intent(in) :: label + logical, intent(in) :: cond + if (cond) then + write(*,'(a,a)') ' PASS ', label + else + write(*,'(a,a)') ' FAIL ', label + nfail = nfail + 1 + end if + end subroutine ok + + ! Frame A: all 6 keys present — 4 ints at distinct values, 2 bools true. + subroutine frame_A() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","last_tx_seconds_ago":4,"currently_txing":true,' // & + '"mode_changed":true,"qso_progress_state":5,"sec_band_changed":7,' // & + '"delay_units":6}' + write(*,'(a)') 'Frame A: all 6 keys present (4 ints distinct, 2 bools true)' + call parse_control_frame(b, action, cfg, terr) + call ok('action == CTRL_CONFIGURE', action .eq. CTRL_CONFIGURE) + call ok('terr not present', .not. terr%present) + ! ints + call ok('last_tx_seconds_ago == 4', cfg%last_tx_seconds_ago_set .and. cfg%last_tx_seconds_ago .eq. 4) + call ok('qso_progress_state == 5', cfg%qso_progress_state_set .and. cfg%qso_progress_state .eq. 5) + call ok('sec_band_changed == 7', cfg%sec_band_changed_set .and. cfg%sec_band_changed .eq. 7) + call ok('delay_units == 6', cfg%delay_units_set .and. cfg%delay_units .eq. 6) + ! bools (true) + call ok('currently_txing true', cfg%currently_txing_set .and. cfg%currently_txing) + call ok('mode_changed true', cfg%mode_changed_set .and. cfg%mode_changed) + end subroutine frame_A + + ! Frame B: bools false (distinguish "set false" from "absent"); ints at 0. + subroutine frame_B() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","currently_txing":false,"mode_changed":false,' // & + '"last_tx_seconds_ago":0,"delay_units":0}' + write(*,'(a)') 'Frame B: bools false (set, not absent); ints 0' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present', .not. terr%present) + call ok('currently_txing set, value false', cfg%currently_txing_set .and. (.not. cfg%currently_txing)) + call ok('mode_changed set, value false', cfg%mode_changed_set .and. (.not. cfg%mode_changed)) + call ok('last_tx_seconds_ago set, value 0', cfg%last_tx_seconds_ago_set .and. cfg%last_tx_seconds_ago .eq. 0) + call ok('delay_units set, value 0', cfg%delay_units_set .and. cfg%delay_units .eq. 0) + end subroutine frame_B + + ! Frame C: "mode" substring non-collision. "mode" is itself a key AND a + ! substring of tx_mode / mode_changed — the structural key locator (quoted token + ! + anchor) must keep them distinct in BOTH orderings. A raw-index regression + ! would mis-classify mode_changed as mode (or vice-versa). + subroutine frame_C() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b1 = & + '{"t":"configure","mode":"FT8","tx_mode":"JT9","mode_changed":true}' + character(len=*), parameter :: b2 = & + '{"t":"configure","mode_changed":true,"tx_mode":"JT9","mode":"FT8"}' + write(*,'(a)') 'Frame C: mode vs tx_mode vs mode_changed (substring non-collision)' + call parse_control_frame(b1, action, cfg, terr) + call ok('order1: terr not present', .not. terr%present) + call ok('order1: mode == 8 (FT8)', cfg%mode_set .and. cfg%mode .eq. 8) + call ok('order1: tx_mode == 9 (JT9)', cfg%tx_mode_set .and. cfg%tx_mode .eq. 9) + call ok('order1: mode_changed true', cfg%mode_changed_set .and. cfg%mode_changed) + call parse_control_frame(b2, action, cfg, terr) + call ok('order2: terr not present', .not. terr%present) + call ok('order2: mode == 8 (FT8)', cfg%mode_set .and. cfg%mode .eq. 8) + call ok('order2: tx_mode == 9 (JT9)', cfg%tx_mode_set .and. cfg%tx_mode .eq. 9) + call ok('order2: mode_changed true', cfg%mode_changed_set .and. cfg%mode_changed) + end subroutine frame_C + + ! Frame D: int key carrying a string -> configure_type_error (mirrors the + ! Gate 17 fixture, last_tx_seconds_ago:"soon"). + subroutine frame_D() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","last_tx_seconds_ago":"soon"}' + write(*,'(a)') 'Frame D: last_tx_seconds_ago:"soon" (string) -> type error' + call parse_control_frame(b, action, cfg, terr) + call ok('terr present', terr%present) + call ok('key == last_tx_seconds_ago', trim(terr%key) .eq. 'last_tx_seconds_ago') + call ok('expected == int', trim(terr%expected) .eq. 'int') + call ok('got == string', trim(terr%got) .eq. 'string') + end subroutine frame_D + + ! Frame E: bool key carrying a number -> configure_type_error. + subroutine frame_E() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","currently_txing":5}' + write(*,'(a)') 'Frame E: currently_txing:5 (number) -> type error' + call parse_control_frame(b, action, cfg, terr) + call ok('terr present', terr%present) + call ok('key == currently_txing', trim(terr%key) .eq. 'currently_txing') + call ok('expected == bool', trim(terr%expected) .eq. 'bool') + call ok('got == number', trim(terr%got) .eq. 'number') + end subroutine frame_E + + ! Frame F: value-vs-key aliasing — the mycall VALUE is the literal + ! "delay_units" token (a Phase 7 key name; 11 chars, fits mycall's len=12), with + ! no real delay_units key. The anchored locator must NOT mistake the string + ! value for the key: delay_units stays unset and NO false type error fires + ! (the benign no-false-decline contract for a Phase 7 key). + subroutine frame_F() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","mycall":"delay_units"}' + write(*,'(a)') 'Frame F: mycall value == "delay_units" token (aliasing guard)' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present (no false decline)', .not. terr%present) + call ok('mycall == delay_units', cfg%mycall_set .and. trim(cfg%mycall) .eq. 'delay_units') + call ok('delay_units stays UNSET', .not. cfg%delay_units_set) + end subroutine frame_F + + ! Frame G: Phase 7 keys absent -> all unset, no error (keys are optional). + subroutine frame_G() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","mode":"FT8"}' + write(*,'(a)') 'Frame G: Phase 7 keys absent -> unset' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present', .not. terr%present) + call ok('last_tx_seconds_ago unset', .not. cfg%last_tx_seconds_ago_set) + call ok('currently_txing unset', .not. cfg%currently_txing_set) + call ok('mode_changed unset', .not. cfg%mode_changed_set) + call ok('qso_progress_state unset', .not. cfg%qso_progress_state_set) + call ok('sec_band_changed unset', .not. cfg%sec_band_changed_set) + call ok('delay_units unset', .not. cfg%delay_units_set) + end subroutine frame_G + +end program p7_parse_test diff --git a/test/phase8_parse_test.f90 b/test/phase8_parse_test.f90 new file mode 100644 index 00000000..e36e3900 --- /dev/null +++ b/test/phase8_parse_test.f90 @@ -0,0 +1,299 @@ +! Phase 8 parse-unit regression driver. Exercises parse_control_frame for the 5 +! Phase 8 string & scaled / derived keys (utc/date/n_trials/candthin_threshold/ +! dt_center_seconds), which are MORE than flat value-extract: utc/date are ISO +! strings tokenized into the legacy int (utc->nutc HHMMSS, date->yymmdd), n_trials +! is ENCODED to nranera, and two keys carry a PARSE-TIME VALUE check that emits +! configure_type_error (n_trials not in {10^N,3*10^N}; date year>=2100). This +! driver asserts the derivations, the encoding table (incl. the n_trials=1 -> +! nranera=0 edge), the two value errors, the wrong-TYPE detection, malformed +! ISO silent-skip, that nutc AND utc are BOTH kept at parse (precedence is resolved +! at apply — see run-apply-routing-unit.sh frame_utc_precedence), and value-vs-key +! aliasing. Compiled + run by run-phase8-parse-unit.sh. +! +! SCOPE: this guards the JSON -> configure_fields PARSE. The configure_fields -> +! params APPLY routing (incl. the utc-wins precedence, the /100 scaling, and the +! flat date/n_trials pass-throughs) lives in streaming_apply::apply_configure_fields +! and is asserted by run-apply-routing-unit.sh. Four of the five keys +! are inert on the FT8/JT9 fixtures (date superfox-only, n_trials JT65-only, +! candthin/dtcenter multithread-variant-only), so this parse-unit + +! the apply-routing unit are their coverage; utc is decode-observable (Gates 19/20). +program p8_parse_test + use streaming_control, only: parse_control_frame, configure_fields, & + control_type_error, CTRL_CONFIGURE, CTRL_PARSE_ERR + implicit none + integer :: nfail + nfail = 0 + + call frame_A() + call frame_B() + call frame_C() + call frame_D() + call frame_E() + call frame_F() + call frame_G() + call frame_H() + call frame_H2() + call frame_I() + call frame_J() + + write(*,'(a)') '------------------------------------------------------------' + if (nfail .eq. 0) then + write(*,'(a)') 'ALL PHASE 8 PARSE-UNIT CHECKS PASSED' + else + write(*,'(a,i0,a)') 'PHASE 8 PARSE-UNIT: ', nfail, ' CHECK(S) FAILED' + call exit(1) + end if + +contains + + subroutine ok(label, cond) + character(len=*), intent(in) :: label + logical, intent(in) :: cond + if (cond) then + write(*,'(a,a)') ' PASS ', label + else + write(*,'(a,a)') ' FAIL ', label + nfail = nfail + 1 + end if + end subroutine ok + + ! Frame A: all 5 keys present, distinct values, ALL valid. Asserts each + ! derivation: utc "13:34:30" -> nutc 133430; date "2021-07-03" -> yymmdd 210703 + ! ((2021-2000)*10000+7*100+3); n_trials 1000 -> nranera 6; the two reals stored. + subroutine frame_A() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","utc":"13:34:30","date":"2021-07-03",' // & + '"n_trials":1000,"candthin_threshold":1.5,"dt_center_seconds":0.2}' + write(*,'(a)') 'Frame A: all 5 keys valid (utc/date/n_trials/candthin/dtcenter)' + call parse_control_frame(b, action, cfg, terr) + call ok('action == CTRL_CONFIGURE', action .eq. CTRL_CONFIGURE) + call ok('terr not present', .not. terr%present) + call ok('utc "13:34:30" -> utc_nutc = 133430', cfg%utc_set .and. cfg%utc_nutc .eq. 133430) + call ok('date "2021-07-03" -> date_yymmdd = 210703', cfg%date_set .and. cfg%date_yymmdd .eq. 210703) + call ok('n_trials 1000 -> nranera = 6', cfg%n_trials_set .and. cfg%n_trials_nranera .eq. 6) + call ok('candthin_threshold == 1.5', cfg%candthin_threshold_set .and. & + abs(cfg%candthin_threshold - 1.5d0) .lt. 1.0d-10) + call ok('dt_center_seconds == 0.2', cfg%dt_center_seconds_set .and. & + abs(cfg%dt_center_seconds - 0.2d0) .lt. 1.0d-10) + end subroutine frame_A + + ! Frame B: the n_trials -> nranera encoding TABLE. Each value is parsed in + ! its own frame so an encoder bug surfaces per-value. Covers both legs (10^N and + ! 3*10^N) and the n_trials=1 -> nranera=0 edge (the legacy quirk). + subroutine frame_B() + write(*,'(a)') 'Frame B: n_trials -> nranera encoding table' + call enc_ok('n_trials 1 -> nranera 0', 1, .true., 0) ! edge case (decoder reads 0 trials) + call enc_ok('n_trials 3 -> nranera 1', 3, .true., 1) + call enc_ok('n_trials 10 -> nranera 2', 10, .true., 2) + call enc_ok('n_trials 30 -> nranera 3', 30, .true., 3) + call enc_ok('n_trials 100 -> nranera 4', 100, .true., 4) + call enc_ok('n_trials 300 -> nranera 5', 300, .true., 5) + call enc_ok('n_trials 1000 -> nranera 6', 1000, .true., 6) + call enc_ok('n_trials 3000 -> nranera 7', 3000, .true., 7) + call enc_ok('n_trials 10000 -> nranera 8', 10000, .true., 8) + end subroutine frame_B + + ! Helper: parse {"t":"configure","n_trials":} and assert set-state + nranera. + subroutine enc_ok(label, n, want_set, want_nranera) + character(len=*), intent(in) :: label + integer, intent(in) :: n, want_nranera + logical, intent(in) :: want_set + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=16) :: ns + character(len=64) :: b + write(ns, '(i0)') n + b = '{"t":"configure","n_trials":' // trim(ns) // '}' + call parse_control_frame(trim(b), action, cfg, terr) + if (want_set) then + call ok(label, (.not. terr%present) .and. cfg%n_trials_set .and. & + cfg%n_trials_nranera .eq. want_nranera) + else + call ok(label, terr%present .and. (.not. cfg%n_trials_set)) + end if + end subroutine enc_ok + + ! Frame C: n_trials VALUE-invalid (not 10^N/3*10^N) -> configure_type_error. The + ! JSON type is correct (a number), so this is the schema's first VALUE error (the + ! envelope reused). Tests 500 (the Gate-21 value), 0, and a negative. + subroutine frame_C() + write(*,'(a)') 'Frame C: n_trials value-invalid -> type error' + call inval_ok('n_trials 500 -> value error', 500) + call inval_ok('n_trials 0 -> value error', 0) + call inval_ok('n_trials 50 -> value error', 50) + call inval_ok('n_trials 7 -> value error', 7) + end subroutine frame_C + + subroutine inval_ok(label, n) + character(len=*), intent(in) :: label + integer, intent(in) :: n + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=16) :: ns + character(len=64) :: b + write(ns, '(i0)') n + b = '{"t":"configure","n_trials":' // trim(ns) // '}' + call parse_control_frame(trim(b), action, cfg, terr) + ! Assert the FULL envelope incl. expected, so the 'int 10^N|3*10^N' constraint + ! string is guarded at the parse-unit level (not only by Gate 21's cross-file + ! grep — a brittle coupling). + call ok(label, terr%present .and. (.not. cfg%n_trials_set) .and. & + trim(terr%key) .eq. 'n_trials' .and. & + trim(terr%expected) .eq. 'int 10^N|3*10^N' .and. & + trim(terr%got) .eq. 'number') + end subroutine inval_ok + + ! Frame D: date year >= 2100 -> configure_type_error (the YYMMDD encoding + ! caps at 2099). The parse succeeds (well-formed ISO) but the value is rejected. + subroutine frame_D() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","date":"2200-01-01"}' + write(*,'(a)') 'Frame D: date year>=2100 -> type error' + call parse_control_frame(b, action, cfg, terr) + call ok('terr present', terr%present) + call ok('key == date', trim(terr%key) .eq. 'date') + call ok('expected == year<2100', trim(terr%expected) .eq. 'year<2100') + call ok('got == string', trim(terr%got) .eq. 'string') + call ok('date stays UNSET', .not. cfg%date_set) + end subroutine frame_D + + ! Frame E: wrong-TYPE detection (distinct from the value checks above). n_trials + ! as a string and candthin_threshold as a string -> check_type_ rejects (int / + ! real expected, got string). + subroutine frame_E() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b1 = '{"t":"configure","n_trials":"abc"}' + character(len=*), parameter :: b2 = '{"t":"configure","candthin_threshold":"x"}' + write(*,'(a)') 'Frame E: wrong-type keys (n_trials/candthin as string) -> type error' + call parse_control_frame(b1, action, cfg, terr) + call ok('n_trials string: terr present', terr%present) + call ok('n_trials string: key == n_trials', trim(terr%key) .eq. 'n_trials') + call ok('n_trials string: expected == int', trim(terr%expected) .eq. 'int') + call ok('n_trials string: got == string', trim(terr%got) .eq. 'string') + call parse_control_frame(b2, action, cfg, terr) + call ok('candthin string: terr present', terr%present) + call ok('candthin string: key == candthin_threshold', trim(terr%key) .eq. 'candthin_threshold') + call ok('candthin string: expected == real', trim(terr%expected) .eq. 'real') + call ok('candthin string: got == string', trim(terr%got) .eq. 'string') + end subroutine frame_E + + ! Frame F: malformed ISO strings -> value-domain SILENT SKIP (key left unset, NO + ! type error — these are well-typed strings, just not parseable HH:MM:SS / + ! YYYY-MM-DD). Mirrors the bad-mode-name silent skip. + subroutine frame_F() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","utc":"13:34","date":"2021-07","mode":"FT8"}' + write(*,'(a)') 'Frame F: malformed ISO (utc "13:34" / date "2021-07") -> silent skip' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present (no false decline)', .not. terr%present) + call ok('utc "13:34" (no seconds) -> utc UNSET', .not. cfg%utc_set) + call ok('date "2021-07" (no day) -> date UNSET', .not. cfg%date_set) + call ok('mode still parsed (FT8)', cfg%mode_set .and. cfg%mode .eq. 8) + end subroutine frame_F + + ! Frame G: nutc AND utc both present -> parse keeps BOTH (the legacy int nutc and + ! the derived utc_nutc). Precedence (utc wins) is resolved at APPLY, not parse — + ! the parse-unit only proves both legs are captured (see frame_utc_precedence in + ! run-apply-routing-unit.sh for the apply-side utc-wins assertion). + subroutine frame_G() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","nutc":120000,"utc":"13:34:30"}' + write(*,'(a)') 'Frame G: nutc + utc both kept at parse (precedence is apply-side)' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present', .not. terr%present) + call ok('legacy nutc kept (120000)', cfg%nutc_set .and. cfg%nutc .eq. 120000) + call ok('utc derived kept (utc_nutc 133430)', cfg%utc_set .and. cfg%utc_nutc .eq. 133430) + end subroutine frame_G + + ! Frame H: value-vs-key aliasing — the mycall VALUE is the literal "n_trials" + ! token (8 chars, fits mycall len=12) with no real n_trials key. The anchored + ! locator must NOT mistake the string value for the key: n_trials stays unset and + ! NO false type error fires. + subroutine frame_H() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","mycall":"n_trials"}' + write(*,'(a)') 'Frame H: mycall value == "n_trials" token (aliasing guard)' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present (no false decline)', .not. terr%present) + call ok('mycall == n_trials', cfg%mycall_set .and. trim(cfg%mycall) .eq. 'n_trials') + call ok('n_trials stays UNSET', .not. cfg%n_trials_set) + end subroutine frame_H + + subroutine frame_H2() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","mycall":"n_trials","n_trials":1000}' + write(*,'(a)') 'Frame H2: value token before real n_trials key' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present', .not. terr%present) + call ok('mycall == n_trials', cfg%mycall_set .and. trim(cfg%mycall) .eq. 'n_trials') + call ok('n_trials parsed', cfg%n_trials_set .and. cfg%n_trials_nranera .eq. 6) + end subroutine frame_H2 + + ! Frame I: Phase 8 keys absent -> all unset, no error (keys are optional). + subroutine frame_I() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","mode":"FT8"}' + write(*,'(a)') 'Frame I: Phase 8 keys absent -> unset' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present', .not. terr%present) + call ok('utc unset', .not. cfg%utc_set) + call ok('date unset', .not. cfg%date_set) + call ok('n_trials unset', .not. cfg%n_trials_set) + call ok('candthin_threshold unset', .not. cfg%candthin_threshold_set) + call ok('dt_center_seconds unset', .not. cfg%dt_center_seconds_set) + end subroutine frame_I + + ! Frame J: truncated values exercise every scalar getter at end-of-buffer. + subroutine frame_J() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + write(*,'(a)') 'Frame J: truncated key values at end of frame' + + call parse_control_frame('{"t":', action, cfg, terr) + call ok('truncated required t -> parse error', action .eq. CTRL_PARSE_ERR) + + call parse_control_frame('{"t":"configure","mode":', action, cfg, terr) + call ok('truncated string key: action == CTRL_CONFIGURE', action .eq. CTRL_CONFIGURE) + call ok('truncated string key: terr not present', .not. terr%present) + call ok('truncated string key: mode unset', .not. cfg%mode_set) + + call parse_control_frame('{"t":"configure","depth":', action, cfg, terr) + call ok('truncated int key: action == CTRL_CONFIGURE', action .eq. CTRL_CONFIGURE) + call ok('truncated int key: terr not present', .not. terr%present) + call ok('truncated int key: depth unset', .not. cfg%depth_set) + + call parse_control_frame('{"t":"configure","trperiod": ', action, cfg, terr) + call ok('space-only real key: action == CTRL_CONFIGURE', action .eq. CTRL_CONFIGURE) + call ok('space-only real key: terr not present', .not. terr%present) + call ok('space-only real key: trperiod unset', .not. cfg%trperiod_set) + + call parse_control_frame('{"t":"configure","my_call_standard":', action, cfg, terr) + call ok('truncated bool key: action == CTRL_CONFIGURE', action .eq. CTRL_CONFIGURE) + call ok('truncated bool key: terr not present', .not. terr%present) + call ok('truncated bool key: my_call_standard unset', .not. cfg%my_call_standard_set) + end subroutine frame_J + +end program p8_parse_test diff --git a/test/phase9_parse_test.f90 b/test/phase9_parse_test.f90 new file mode 100644 index 00000000..7290ef4a --- /dev/null +++ b/test/phase9_parse_test.f90 @@ -0,0 +1,355 @@ +! Phase 9 parse-unit regression driver. Phase 9 unpacks two bit-packed legacy ints +! into 9 wire keys; parse_control_frame folds them BACK into the derived members +! cfg%ndepth_packed / cfg%nexp_decode_packed (the post-pass pack_phase9_), so this +! driver is the authoritative guard for the PACKING (each key -> its bit), the +! contest_type -> ncontest table (incl. the SpecOp 5/8/9 -> 1 collapse), the two +! atomic-decline errors (legacy depth co-present with any unpacked ndepth key; a +! depth_level vs q65_maxiters_level inconsistency), the bit-width MASKING of +! depth_level/q65_maxiters_level, and the noise_blanker -3 offset + [0,255] clamp. +! +! WHY a Fortran unit driver (not only fixtures through jt9): only depth_level is +! decode-observable on FT8/JT9 (Gate 24); the other 8 keys are inert (Q65/JT65/ +! FST4/JT4 or contest-branch only), and the bit-PACKING of even +! depth_level is invisible to a decode-count gate (ndepth=3 and ndepth=3|16 both +! decode 21 on FT8). This driver + run-apply-routing-unit.sh (the packed-int APPLY +! routing) + no-regression are the coverage for the 8 inert keys, exactly like the +! Phase 4/6/7 inert fields. Compiled + run by run-phase9-parse-unit.sh. +program p9_parse_test + use streaming_control, only: parse_control_frame, configure_fields, & + control_type_error, CTRL_CONFIGURE + implicit none + integer :: nfail + nfail = 0 + + call frame_A() + call frame_B() + call frame_C() + call frame_D() + call frame_E() + call frame_F() + call frame_G() + call frame_H() + call frame_I() + call frame_J() + call frame_K() + call frame_L() + call frame_M() + + write(*,'(a)') '------------------------------------------------------------' + if (nfail .eq. 0) then + write(*,'(a)') 'ALL PHASE 9 PARSE-UNIT CHECKS PASSED' + else + write(*,'(a,i0,a)') 'PHASE 9 PARSE-UNIT: ', nfail, ' CHECK(S) FAILED' + call exit(1) + end if + +contains + + subroutine ok(label, cond) + character(len=*), intent(in) :: label + logical, intent(in) :: cond + if (cond) then + write(*,'(a,a)') ' PASS ', label + else + write(*,'(a,a)') ' FAIL ', label + nfail = nfail + 1 + end if + end subroutine ok + + ! Frame A: ndepth bit-pack. depth_level=2 (bits0-2), use_averaging (0x10), + ! deep_ap_search (0x20), q65_auto_clear_average (0x80) -> ndepth = 2|16|32|128 = + ! 178. Asserts each bit lands (a dropped/mis-shifted bit changes the total). + subroutine frame_A() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","depth_level":2,"use_averaging":true,' // & + '"deep_ap_search":true,"q65_auto_clear_average":true}' + write(*,'(a)') 'Frame A: ndepth bit-pack (2 | 0x10 | 0x20 | 0x80 = 178)' + call parse_control_frame(b, action, cfg, terr) + call ok('action == CTRL_CONFIGURE', action .eq. CTRL_CONFIGURE) + call ok('terr not present', .not. terr%present) + call ok('ndepth_packed set', cfg%ndepth_packed_set) + call ok('ndepth_packed == 178', cfg%ndepth_packed .eq. 178) + ! Individual bits, so a single dropped key surfaces: + call ok('bit 0-2 (depth_level=2)', iand(cfg%ndepth_packed, 7) .eq. 2) + call ok('bit 4 (use_averaging)', iand(cfg%ndepth_packed, 16) .eq. 16) + call ok('bit 5 (deep_ap_search)', iand(cfg%ndepth_packed, 32) .eq. 32) + call ok('bit 7 (q65_auto_clear_avg)', iand(cfg%ndepth_packed, 128).eq. 128) + call ok('bit 3 unused (clear)', iand(cfg%ndepth_packed, 8) .eq. 0) + call ok('bit 6 unused (clear)', iand(cfg%ndepth_packed, 64) .eq. 0) + call ok('nexp_decode NOT packed (no nexp key)', .not. cfg%nexp_decode_packed_set) + end subroutine frame_A + + ! Frame B: contest_type -> ncontest table (incl. SpecOp/collapse). + ! Each string parsed in its own frame. The 5/8/9 -> 1 collapse is the key risk. + subroutine frame_B() + write(*,'(a)') 'Frame B: contest_type -> ncontest table (incl. SpecOp 5/8/9 collapse)' + call con_ok('none -> 0', 'none', 0) + call con_ok('na_vhf -> 1', 'na_vhf', 1) + call con_ok('eu_vhf -> 2', 'eu_vhf', 2) + call con_ok('field_day -> 3', 'field_day', 3) + call con_ok('rtty -> 4', 'rtty', 4) + call con_ok('ww_digi -> 1 (SpecOp 5 collapsed)', 'ww_digi', 1) + call con_ok('fox -> 6', 'fox', 6) + call con_ok('hound -> 7', 'hound', 7) + call con_ok('arrl_digi -> 1 (SpecOp 8 collapsed)', 'arrl_digi', 1) + call con_ok('q65_pileup -> 1 (SpecOp 9 collapsed)', 'q65_pileup', 1) + end subroutine frame_B + + ! Helper: parse {"t":"configure","contest_type":""} and assert the collapsed + ! ncontest lands in nexp_decode_packed bits 0-2 (and contest_type member). + subroutine con_ok(label, s, want) + character(len=*), intent(in) :: label, s + integer, intent(in) :: want + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=80) :: b + b = '{"t":"configure","contest_type":"' // trim(s) // '"}' + call parse_control_frame(trim(b), action, cfg, terr) + call ok(label, (.not. terr%present) .and. cfg%contest_type_set .and. & + cfg%contest_type .eq. want .and. cfg%nexp_decode_packed_set .and. & + iand(cfg%nexp_decode_packed, 7) .eq. want) + end subroutine con_ok + + ! Frame C: nexp_decode full pack. contest_type=fox (6) | single_decode (0x20) | + ! vhf_features (0x40) | noise_blanker_level=2 ((2+3)<<8 = 1280) -> 6+32+64+1280 = + ! 1382. Asserts each sub-field lands in its slot. + subroutine frame_C() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","contest_type":"fox","single_decode":true,' // & + '"vhf_features":true,"noise_blanker_level":2}' + write(*,'(a)') 'Frame C: nexp_decode full pack (6 | 0x20 | 0x40 | (2+3)<<8 = 1382)' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present', .not. terr%present) + call ok('nexp_decode_packed == 1382', cfg%nexp_decode_packed .eq. 1382) + call ok('bits 0-2 (ncontest fox=6)', iand(cfg%nexp_decode_packed, 7) .eq. 6) + call ok('bit 5 (single_decode)', iand(cfg%nexp_decode_packed, 32) .eq. 32) + call ok('bit 6 (vhf_features)', iand(cfg%nexp_decode_packed, 64) .eq. 64) + call ok('upper byte (nb+3 = 5)', cfg%nexp_decode_packed / 256 .eq. 5) + call ok('ndepth NOT packed (no ndepth key)', .not. cfg%ndepth_packed_set) + end subroutine frame_C + + ! Frame D: depth_level vs q65_maxiters_level consistency (bits 0-1 + ! overlap). (a) consistent pair (depth_level=6 low2=2, q65_maxiters=2) -> OK, + ! ndepth bits0-2 = 6. (b) inconsistent pair -> configure_type_error. + subroutine frame_D() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: ba = & + '{"t":"configure","depth_level":6,"q65_maxiters_level":2}' + character(len=*), parameter :: bb = & + '{"t":"configure","depth_level":6,"q65_maxiters_level":1}' + write(*,'(a)') 'Frame D: depth_level/q65_maxiters_level consistency (bits 0-1 overlap)' + call parse_control_frame(ba, action, cfg, terr) + call ok('(a) consistent (6 low2 == 2): no error', .not. terr%present) + call ok('(a) ndepth_packed == 6', cfg%ndepth_packed .eq. 6) + call parse_control_frame(bb, action, cfg, terr) + call ok('(b) inconsistent (6 low2=2 != 1): terr present', terr%present) + call ok('(b) key == q65_maxiters_level', trim(terr%key) .eq. 'q65_maxiters_level') + call ok('(b) expected == match depth_lvl', trim(terr%expected) .eq. 'match depth_lvl') + call ok('(b) got == conflict', trim(terr%got) .eq. 'conflict') + call ok('(b) ndepth NOT packed (declined)', .not. cfg%ndepth_packed_set) + end subroutine frame_D + + ! Frame E: legacy depth co-present with an unpacked ndepth key -> conflict + ! configure_type_error (the two encodings are mutually exclusive). + subroutine frame_E() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","depth":3,"depth_level":1}' + write(*,'(a)') 'Frame E: depth + depth_level conflict -> type error' + call parse_control_frame(b, action, cfg, terr) + call ok('terr present', terr%present) + call ok('key == ndepth', trim(terr%key) .eq. 'ndepth') + call ok('expected == depth|unpacked', trim(terr%expected) .eq. 'depth|unpacked') + call ok('got == conflict', trim(terr%got) .eq. 'conflict') + call ok('ndepth NOT packed (declined)', .not. cfg%ndepth_packed_set) + end subroutine frame_E + + ! Frame F: bit-width MASKING. An out-of-range depth_level=99 (0x63) must mask to + ! its 3 bits (99 & 7 = 3) so it cannot corrupt sibling bits (4/5/7). Likewise a + ! lone q65_maxiters_level=99 masks to 2 bits (99 & 3 = 3). No crash. + subroutine frame_F() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: ba = '{"t":"configure","depth_level":99}' + character(len=*), parameter :: bb = '{"t":"configure","q65_maxiters_level":99}' + write(*,'(a)') 'Frame F: out-of-range depth_level/q65_maxiters masked to bit width' + call parse_control_frame(ba, action, cfg, terr) + call ok('(a) depth_level=99 -> ndepth = 3 (99 & 7)', cfg%ndepth_packed .eq. 3) + call ok('(a) no sibling bits set', iand(cfg%ndepth_packed, 240) .eq. 0) + call ok('(a) no type error', .not. terr%present) + call parse_control_frame(bb, action, cfg, terr) + call ok('(b) q65_maxiters=99 -> ndepth = 3 (99 & 3)', cfg%ndepth_packed .eq. 3) + end subroutine frame_F + + ! Frame G: q65_maxiters_level alone (no depth_level) -> derive depth_level's + ! bits 0-1 from it (receiver-side derivation). q65_maxiters=3 -> ndepth=3. + subroutine frame_G() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","q65_maxiters_level":3,"use_averaging":true}' + write(*,'(a)') 'Frame G: q65_maxiters_level alone -> ndepth bits 0-1 derived' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present', .not. terr%present) + call ok('ndepth_packed == 3|16 = 19', cfg%ndepth_packed .eq. 19) + call ok('bits 0-1 = q65_maxiters 3', iand(cfg%ndepth_packed, 3) .eq. 3) + end subroutine frame_G + + ! Frame H: noise_blanker_level -3 offset + [0,255] clamp (upper byte). + ! nb=0 -> (0+3)<<8 = 768; nb=-3 -> 0; nb=300 -> clamp 255 -> 255<<8 = 65280. + ! Each still sets nexp_decode_packed_set (the key was present). + subroutine frame_H() + write(*,'(a)') 'Frame H: noise_blanker_level offset + clamp' + call nb_ok('nb=0 -> upper byte 3 (768)', 0, 768) + call nb_ok('nb=2 -> upper byte 5 (1280)', 2, 1280) + call nb_ok('nb=-3 -> upper byte 0 (clamp)', -3, 0) + call nb_ok('nb=300 -> upper byte 255 (clamp)', 300, 65280) + end subroutine frame_H + + subroutine nb_ok(label, nb, want) + character(len=*), intent(in) :: label + integer, intent(in) :: nb, want + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=16) :: ns + character(len=64) :: b + write(ns, '(i0)') nb + b = '{"t":"configure","noise_blanker_level":' // trim(ns) // '}' + call parse_control_frame(trim(b), action, cfg, terr) + call ok(label, (.not. terr%present) .and. cfg%nexp_decode_packed_set .and. & + cfg%nexp_decode_packed .eq. want) + end subroutine nb_ok + + ! Frame I: wrong-TYPE detection. depth_level as a string (int expected) and + ! contest_type as a number (string expected) -> check_type_ rejects. + subroutine frame_I() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b1 = '{"t":"configure","depth_level":"deep"}' + character(len=*), parameter :: b2 = '{"t":"configure","contest_type":5}' + character(len=*), parameter :: b3 = '{"t":"configure","use_averaging":7}' + write(*,'(a)') 'Frame I: wrong-type Phase 9 keys -> type error' + call parse_control_frame(b1, action, cfg, terr) + call ok('depth_level string: terr present', terr%present) + call ok('depth_level string: key', trim(terr%key) .eq. 'depth_level') + call ok('depth_level string: expected', trim(terr%expected) .eq. 'int') + call ok('depth_level string: got', trim(terr%got) .eq. 'string') + call ok('depth_level string: ndepth NOT packed', .not. cfg%ndepth_packed_set) + call parse_control_frame(b2, action, cfg, terr) + call ok('contest_type number: terr present', terr%present) + call ok('contest_type number: key', trim(terr%key) .eq. 'contest_type') + call ok('contest_type number: expected', trim(terr%expected) .eq. 'string') + call parse_control_frame(b3, action, cfg, terr) + call ok('use_averaging number: terr present', terr%present) + call ok('use_averaging number: expected bool', trim(terr%expected) .eq. 'bool') + end subroutine frame_I + + ! Frame J: unknown contest_type string -> value-domain SILENT SKIP (left unset, + ! NO type error — mirrors the unknown-mode-name skip). nexp not packed. + subroutine frame_J() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = & + '{"t":"configure","contest_type":"sweepstakes","mode":"FT8"}' + write(*,'(a)') 'Frame J: unknown contest_type -> silent skip (no false decline)' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present', .not. terr%present) + call ok('contest_type stays UNSET', .not. cfg%contest_type_set) + call ok('nexp NOT packed', .not. cfg%nexp_decode_packed_set) + call ok('mode still parsed (FT8)', cfg%mode_set .and. cfg%mode .eq. 8) + end subroutine frame_J + + ! Frame K: value-vs-key aliasing. The mycall VALUE is the literal + ! token "depth_level" (11 chars, fits mycall len=12) with no real depth_level + ! key. The anchored locator must NOT mistake the value for the key. + subroutine frame_K() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","mycall":"depth_level"}' + write(*,'(a)') 'Frame K: mycall value == "depth_level" token (aliasing guard)' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present (no false decline)', .not. terr%present) + call ok('mycall == depth_level', cfg%mycall_set .and. trim(cfg%mycall) .eq. 'depth_level') + call ok('depth_level stays UNSET', .not. cfg%depth_level_set) + call ok('ndepth NOT packed', .not. cfg%ndepth_packed_set) + end subroutine frame_K + + ! Frame L: Phase 9 keys absent -> all unset, no error, no packing (keys optional). + subroutine frame_L() + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=*), parameter :: b = '{"t":"configure","mode":"FT8","depth":3}' + write(*,'(a)') 'Frame L: Phase 9 keys absent -> unset (legacy depth alone OK)' + call parse_control_frame(b, action, cfg, terr) + call ok('terr not present', .not. terr%present) + call ok('depth (legacy) still set', cfg%depth_set .and. cfg%depth .eq. 3) + call ok('depth_level unset', .not. cfg%depth_level_set) + call ok('contest_type unset', .not. cfg%contest_type_set) + call ok('ndepth NOT packed', .not. cfg%ndepth_packed_set) + call ok('nexp_decode NOT packed', .not. cfg%nexp_decode_packed_set) + end subroutine frame_L + + ! Frame M: per-bool SINGLE-BIT isolation (closes the swap-blindness where + ! two bool keys that only ever appear together-all-true can be + ! swapped invisibly: Frame A sets all 3 ndepth bools true, Frame C both nexp + ! bools true, so a deep_ap_search<->q65_auto_clear_average (0x20<->0x80) or a + ! single_decode<->vhf_features (0x20<->0x40) swap leaves the total unchanged). + ! Each bool set ALONE asserts EXACTLY its bit, so every bool->bit assignment is + ! now independently load-bearing. (use_averaging is also disambiguated by Frame G, + ! but assert it here too for symmetry.) + subroutine frame_M() + write(*,'(a)') 'Frame M: per-bool single-bit isolation (swap-blindness guard)' + call bit_ok_ndepth('use_averaging alone -> ndepth 0x10', 'use_averaging', 16) + call bit_ok_ndepth('deep_ap_search alone -> ndepth 0x20', 'deep_ap_search', 32) + call bit_ok_ndepth('q65_auto_clear_average alone -> ndepth 0x80', 'q65_auto_clear_average', 128) + call bit_ok_nexp('single_decode alone -> nexp 0x20', 'single_decode', 32) + call bit_ok_nexp('vhf_features alone -> nexp 0x40', 'vhf_features', 64) + end subroutine frame_M + + ! Helper: parse {"t":"configure","":true} and assert ndepth_packed == want + ! EXACTLY (so the bit isolated is the only one set; a mis-shift fails the equality). + subroutine bit_ok_ndepth(label, key, want) + character(len=*), intent(in) :: label, key + integer, intent(in) :: want + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=80) :: b + b = '{"t":"configure","' // trim(key) // '":true}' + call parse_control_frame(trim(b), action, cfg, terr) + call ok(label, (.not. terr%present) .and. cfg%ndepth_packed_set .and. & + cfg%ndepth_packed .eq. want) + end subroutine bit_ok_ndepth + + subroutine bit_ok_nexp(label, key, want) + character(len=*), intent(in) :: label, key + integer, intent(in) :: want + type(configure_fields) :: cfg + type(control_type_error) :: terr + integer :: action + character(len=80) :: b + b = '{"t":"configure","' // trim(key) // '":true}' + call parse_control_frame(trim(b), action, cfg, terr) + call ok(label, (.not. terr%present) .and. cfg%nexp_decode_packed_set .and. & + cfg%nexp_decode_packed .eq. want) + end subroutine bit_ok_nexp + +end program p9_parse_test diff --git a/test/run-apply-routing-unit.sh b/test/run-apply-routing-unit.sh new file mode 100755 index 00000000..83c11037 --- /dev/null +++ b/test/run-apply-routing-unit.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash +# apply-routing unit regression. Compiles +# lib/streaming_control.f90 + lib/jt9_params_init.f90 + lib/streaming_apply.f90 +# and the driver test/apply_routing_test.f90 into an ISOLATED module dir and runs +# it. Guards the APPLY side: each configure_fields member -> its CORRECT +# params_block slot, plus the order-sensitive logic (rxfreq/tx_audio_offset +# decouple, emedelay-before-per-mode-policy, nfa/nfb baseline restore, ntol +# per-mode cap/restore). +# +# WHY a Fortran unit driver: the cfg->params apply routing used to live in a +# nested INTERNAL subroutine (streaming_io.f90 apply_configure_), unreachable from +# a unit driver, AND most Phase 4/5 fields are inert on the FT8/JT9 fixtures, so a +# mis-route (e.g. his_call -> hisgrid) passed every fixture gate byte-identical. +# The mapping was extracted to the module-public +# streaming_apply::apply_configure_fields so this driver can assert it directly. +# This is the structural close of the apply-routing gap. +# +# Usage: +# test/run-apply-routing-unit.sh (no build dir; compiles from source) +# FC=gfortran-13 test/run-apply-routing-unit.sh (override the compiler) + +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +FC="${FC:-gfortran}" +SRC_CTRL="$REPO_ROOT/lib/streaming_control.f90" +SRC_INIT="$REPO_ROOT/lib/jt9_params_init.f90" +SRC_APPLY="$REPO_ROOT/lib/streaming_apply.f90" +DRV="$REPO_ROOT/test/apply_routing_test.f90" + +if ! command -v "$FC" >/dev/null 2>&1; then + echo "ERROR: Fortran compiler '$FC' not found (set \$FC to override)" >&2 + exit 2 +fi +for f in "$SRC_CTRL" "$SRC_INIT" "$SRC_APPLY" "$DRV" \ + "$REPO_ROOT/lib/jt9com.f90" "$REPO_ROOT/lib/constants.f90"; do + if [[ ! -f "$f" ]]; then + echo "ERROR: missing source: $f" >&2 + exit 2 + fi +done + +# Compile into a throwaway dir so a stray repo-root *.mod cannot shadow the fresh +# compile, and so we leave no artifacts behind. +WORK="$(mktemp -d)" +trap 'rm -rf "$WORK"' EXIT + +echo "apply-routing unit regression" +echo " FC: $FC" +echo " driver: $DRV" +echo "" + +# Copy the textual includes (jt9com.f90 -> constants.f90) into the work dir so the +# INCLUDE chain resolves with cwd=$WORK and lib/ never lands on the search path. +cp "$REPO_ROOT/lib/jt9com.f90" "$REPO_ROOT/lib/constants.f90" "$WORK/" + +# Compile FROM the work dir as cwd: gfortran searches the current directory for +# .mod files (and INCLUDE files) first, so a stray repo-root *.mod / jt9com.f90 +# would otherwise shadow the fresh compile. -J/-I alone +# do NOT remove cwd from the search order; the cd does. +cd "$WORK" +"$FC" -c "$SRC_CTRL" -J"$WORK" -I"$WORK" -o "$WORK/streaming_control.o" +"$FC" -c "$SRC_INIT" -J"$WORK" -I"$WORK" -o "$WORK/jt9_params_init.o" +"$FC" -c "$SRC_APPLY" -J"$WORK" -I"$WORK" -o "$WORK/streaming_apply.o" +"$FC" "$DRV" "$WORK/streaming_control.o" "$WORK/jt9_params_init.o" \ + "$WORK/streaming_apply.o" -I"$WORK" -o "$WORK/apply_drv" +"$WORK/apply_drv" diff --git a/test/run-golden-fixtures.sh b/test/run-golden-fixtures.sh new file mode 100755 index 00000000..467baf98 --- /dev/null +++ b/test/run-golden-fixtures.sh @@ -0,0 +1,137 @@ +#!/usr/bin/env bash +# golden-fixture regression harness. +# +# Compares decoder stdout against known-good captures, for both `jt9` +# (FT8/JT9/Q65/MSK144/FST4/FST4W/FT4/JT65/JT4) and the standalone `wsprd` +# (WSPR) binary. Any regression that changes decoder stdout byte-for-byte +# fails here. +# +# Usage: +# test/run-golden-fixtures.sh [build-dir] +# +# Where build-dir defaults to ./build and must contain built jt9 and wsprd +# binaries. + +set -euo pipefail + +BUILD_DIR="${1:-build}" +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +JT9="$REPO_ROOT/$BUILD_DIR/jt9" +WSPRD="$REPO_ROOT/$BUILD_DIR/wsprd" +SAMPLES="$REPO_ROOT/samples" +FIXTURES="$REPO_ROOT/test/fixtures" + +if [[ ! -x "$JT9" ]]; then + echo "ERROR: jt9 binary not found at $JT9" >&2 + echo " Build it first: cmake --build $BUILD_DIR --target jt9" >&2 + exit 2 +fi + +if [[ ! -x "$WSPRD" ]]; then + echo "ERROR: wsprd binary not found at $WSPRD" >&2 + echo " Build it first: cmake --build $BUILD_DIR --target wsprd" >&2 + exit 2 +fi + +FAIL=0 +pass() { echo " PASS: $1"; } +fail() { echo " FAIL: $1"; FAIL=1; } + +run_fixture() { + local binary="$1"; shift + local name="$1"; shift + local sample="$1"; shift + local expected="$1"; shift + # Remaining args are flags for $binary (e.g., -8, -9, --q65 -p 30 ..., etc.) + + local actual_file + actual_file="$(mktemp -t "wsjtl-golden-$name.XXXXXX")" + + if ! "$binary" "$@" "$sample" > "$actual_file" 2>&1; then + fail "$name: $(basename "$binary") exited non-zero" + rm -f "$actual_file" + return + fi + + if diff -u "$expected" "$actual_file" > /dev/null 2>&1; then + pass "$name" + else + fail "$name: output differs from golden (see diff below)" + diff -u "$expected" "$actual_file" | head -30 | sed 's/^/ /' + fi + rm -f "$actual_file" +} + +echo "golden-fixture regression" +echo " jt9: $JT9" +echo " wsprd: $WSPRD" +echo " fixtures: $FIXTURES" +echo "" + +run_fixture "$JT9" "ft8_210703_133430" \ + "$SAMPLES/FT8/210703_133430.wav" \ + "$FIXTURES/ft8_210703_133430.expected.txt" \ + -8 + +run_fixture "$JT9" "jt9_130418_1742" \ + "$SAMPLES/JT9/130418_1742.wav" \ + "$FIXTURES/jt9_130418_1742.expected.txt" \ + -9 + +run_fixture "$JT9" "q65_30a_201203_024000" \ + "$SAMPLES/Q65/30A_Ionoscatter_6m/201203_024000.wav" \ + "$FIXTURES/q65_30a_201203_024000.expected.txt" \ + --q65 -p 30 -f 1000 -d 3 + +run_fixture "$JT9" "q65_300a_201210_0505" \ + "$SAMPLES/Q65/300A_Optical_Scatter/201210_0505.wav" \ + "$FIXTURES/q65_300a_201210_0505.expected.txt" \ + --q65 -p 300 -f 1000 -d 3 + +run_fixture "$JT9" "q65_60d_201212_1838" \ + "$SAMPLES/Q65/60D_EME_10GHz/201212_1838.wav" \ + "$FIXTURES/q65_60d_201212_1838.expected.txt" \ + --q65 -b D -p 60 -f 1000 -d 3 + +run_fixture "$JT9" "msk144_181211_120800" \ + "$SAMPLES/MSK144/181211_120800.wav" \ + "$FIXTURES/msk144_181211_120800.expected.txt" \ + --msk144 -p 15 -f 1500 -F 50 -d 3 + +run_fixture "$JT9" "fst4_210115_0058" \ + "$SAMPLES/FST4+FST4W/210115_0058.wav" \ + "$FIXTURES/fst4_210115_0058.expected.txt" \ + --fst4 -p 60 -f 1331 -L 1000 -H 1400 -d 3 + +run_fixture "$JT9" "fst4w_201230_0300" \ + "$SAMPLES/FST4+FST4W/201230_0300.wav" \ + "$FIXTURES/fst4w_201230_0300.expected.txt" \ + --fst4w -p 1800 -f 1433 -F 100 -d 3 + +run_fixture "$JT9" "ft4_000000_000002" \ + "$SAMPLES/FT4/000000_000002.wav" \ + "$FIXTURES/ft4_000000_000002.expected.txt" \ + --ft4 -d 3 + +run_fixture "$JT9" "jt65_000000_0004" \ + "$SAMPLES/JT65/JT65B/000000_0004.wav" \ + "$FIXTURES/jt65_000000_0004.expected.txt" \ + --jt65 -b B -f 1700 -d 3 + +run_fixture "$JT9" "jt4_OK1KIR_141105_175700" \ + "$SAMPLES/JT4/JT4F/OK1KIR_141105_175700.WAV" \ + "$FIXTURES/jt4_OK1KIR_141105_175700.expected.txt" \ + --jt4 -b F -f 1200 -d 3 + +run_fixture "$WSPRD" "wspr_150426_0918" \ + "$SAMPLES/WSPR/150426_0918.wav" \ + "$FIXTURES/wspr_150426_0918.expected.txt" + +echo "" +if [[ $FAIL -eq 0 ]]; then + echo "All golden fixtures passed." + exit 0 +else + echo "One or more golden fixtures regressed." + exit 1 +fi diff --git a/test/run-phase4-parse-unit.sh b/test/run-phase4-parse-unit.sh new file mode 100755 index 00000000..0d30a5e2 --- /dev/null +++ b/test/run-phase4-parse-unit.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +# Phase 4 parse-unit regression (streaming-schema unit parse->pack assert). +# Compiles lib/streaming_control.f90 and the driver +# test/phase4_parse_test.f90 into an ISOLATED module dir and runs it. Guards the +# PARSE side of the 9 Phase 4 keys: each key -> correct configure_fields member + +# value, bool true/false, his_call vs his_call_standard substring non-collision, +# wrong-type detection (bool/string/int), and the value-vs-key aliasing guard. +# +# WHY a Fortran unit driver (not a fixture through jt9): the 9 Phase 4 fields are +# observably INERT on the FT8/JT9 fixtures (tx/Q65/JT65-split only — an +# all-9-keys configure yields a byte-identical 21-message FT8 decode set), so no +# decode-output gate can assert a Phase 4 value landed. This unit driver is the +# parse->pack assert for inert fields. +# +# SCOPE: this guards JSON -> configure_fields PARSE only (the module-public entry +# point). The configure_fields -> params APPLY routing now lives in the module- +# public streaming_apply::apply_configure_fields and is asserted by +# test/run-apply-routing-unit.sh — so the 9 inert Phase 4 fields' apply routing +# IS now unit-guarded, not just code-review + no-regression. +# +# Usage: +# test/run-phase4-parse-unit.sh (no build dir; compiles from source) +# FC=gfortran-13 test/run-phase4-parse-unit.sh (override the compiler) + +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +FC="${FC:-gfortran}" +SRC="$REPO_ROOT/lib/streaming_control.f90" +DRV="$REPO_ROOT/test/phase4_parse_test.f90" + +if ! command -v "$FC" >/dev/null 2>&1; then + echo "ERROR: Fortran compiler '$FC' not found (set \$FC to override)" >&2 + exit 2 +fi +for f in "$SRC" "$DRV"; do + if [[ ! -f "$f" ]]; then + echo "ERROR: missing source: $f" >&2 + exit 2 + fi +done + +# Compile into a throwaway dir so a stray repo-root *.mod cannot shadow the +# fresh compile, and so we leave no artifacts behind. +WORK="$(mktemp -d)" +trap 'rm -rf "$WORK"' EXIT + +echo "Phase 4 parse-unit regression" +echo " FC: $FC" +echo " source: $SRC" +echo " driver: $DRV" +echo "" + +# Compile FROM the work dir as cwd: gfortran searches the current directory for +# .mod files first, so a stray repo-root streaming_control.mod would otherwise +# shadow the fresh compile (the -J/-I flags alone do NOT remove cwd from the +# search order; the cd does). +cd "$WORK" +"$FC" -c "$SRC" -J"$WORK" -o "$WORK/streaming_control.o" +"$FC" "$DRV" "$WORK/streaming_control.o" -I"$WORK" -o "$WORK/p4drv" +"$WORK/p4drv" diff --git a/test/run-phase5-parse-unit.sh b/test/run-phase5-parse-unit.sh new file mode 100755 index 00000000..2c3a9aeb --- /dev/null +++ b/test/run-phase5-parse-unit.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash +# Phase 5 parse-unit regression (streaming-schema unit parse->pack assert). +# Compiles lib/streaming_control.f90 and the driver +# test/phase5_parse_test.f90 into an ISOLATED module dir and runs it. Guards the +# PARSE side of the 12 Phase 5 decoder-tuning keys: each key -> correct +# configure_fields member + value, real(8) keys, the tx_mode enum (JT9/JT65 -> 9/ +# 65 and raw int), bool true/false, wrong-type detection (real/int/bool), the +# "mode" vs "tx_mode" + "min_width" vs "min_sync" substring non-collision, and +# the value-vs-key aliasing guard. +# +# WHY a Fortran unit driver (not only a fixture through jt9): 10 of the 12 Phase 5 +# fields are observably INERT on the FT8/JT9 fixtures (kin/nzhsym +# are recomputed per period; dttol/minw/minsync/n2pass/nrobust/nclearave are +# JT4/JT65/Q65-only; emedelay is forced to 0 on a mode-setting frame; ntxmode is +# read only in mode 65+9), so no decode-output gate can assert those values +# landed. This unit driver is the parse->pack assert for them. +# The two observable keys (nagain_flag -> FT8, npts_c0_array -> JT9) ALSO get a +# decode-effect gate in run-schema-v1-fixtures.sh (Gates 11/12). +# +# SCOPE: this guards JSON -> configure_fields PARSE only (the module-public entry +# point). The configure_fields -> params APPLY routing now lives in the module- +# public streaming_apply::apply_configure_fields and is asserted by +# test/run-apply-routing-unit.sh — so the 10 inert keys' apply routing IS now +# unit-guarded, not just code-review + no-regression. +# +# Usage: +# test/run-phase5-parse-unit.sh (no build dir; compiles from source) +# FC=gfortran-13 test/run-phase5-parse-unit.sh (override the compiler) + +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +FC="${FC:-gfortran}" +SRC="$REPO_ROOT/lib/streaming_control.f90" +DRV="$REPO_ROOT/test/phase5_parse_test.f90" + +if ! command -v "$FC" >/dev/null 2>&1; then + echo "ERROR: Fortran compiler '$FC' not found (set \$FC to override)" >&2 + exit 2 +fi +for f in "$SRC" "$DRV"; do + if [[ ! -f "$f" ]]; then + echo "ERROR: missing source: $f" >&2 + exit 2 + fi +done + +# Compile into a throwaway dir so a stray repo-root *.mod cannot shadow the +# fresh compile, and so we leave no artifacts behind. +WORK="$(mktemp -d)" +trap 'rm -rf "$WORK"' EXIT + +echo "Phase 5 parse-unit regression" +echo " FC: $FC" +echo " source: $SRC" +echo " driver: $DRV" +echo "" + +# Compile FROM the work dir as cwd: gfortran searches the current directory for +# .mod files first, so a stray repo-root streaming_control.mod would otherwise +# shadow the fresh compile. +# -J/-I alone do NOT remove cwd from the search order; the cd does. +cd "$WORK" +"$FC" -c "$SRC" -J"$WORK" -o "$WORK/streaming_control.o" +"$FC" "$DRV" "$WORK/streaming_control.o" -I"$WORK" -o "$WORK/p5drv" +"$WORK/p5drv" diff --git a/test/run-phase6-parse-unit.sh b/test/run-phase6-parse-unit.sh new file mode 100755 index 00000000..bbdeb629 --- /dev/null +++ b/test/run-phase6-parse-unit.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +# Phase 6 parse-unit regression (streaming-schema unit parse->pack assert). +# Compiles lib/streaming_control.f90 and the driver +# test/phase6_parse_test.f90 into an ISOLATED module dir and runs it. Guards the +# PARSE side of the 24 Phase 6 FT8/FT4-specifics keys (19 bools + 5 ints): each +# key -> correct configure_fields member + value, bool true/false, int parse, +# wrong-type detection (bool-as-number, int-as-string), the NEW "mode" substring +# non-collisions (hint_mode / hound_mode / superfox_mode all contain "mode"), and +# the value-vs-key aliasing guard. +# +# WHY a Fortran unit driver (not only a fixture through jt9): all 24 Phase 6 keys +# are INERT on the FT8/JT9 fixtures (multithreaded_ft8 is +# destructive and apply-guarded to ignore non-false; the other 23 are read only on +# the multithread-FT8 / JT65 / superfox-Q65 / WAV-disk paths or are AP keys for +# which the fixture has no AP-only decodes), so no decode-output gate can assert +# those values landed. This unit driver is the parse->pack assert +# for the PARSE side; the configure_fields -> params APPLY routing is asserted by +# test/run-apply-routing-unit.sh (the 24 Phase 6 slot asserts + the +# multithreaded_ft8 ignore-non-false guard). +# +# Usage: +# test/run-phase6-parse-unit.sh (no build dir; compiles from source) +# FC=gfortran-13 test/run-phase6-parse-unit.sh (override the compiler) + +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +FC="${FC:-gfortran}" +SRC="$REPO_ROOT/lib/streaming_control.f90" +DRV="$REPO_ROOT/test/phase6_parse_test.f90" + +if ! command -v "$FC" >/dev/null 2>&1; then + echo "ERROR: Fortran compiler '$FC' not found (set \$FC to override)" >&2 + exit 2 +fi +for f in "$SRC" "$DRV"; do + if [[ ! -f "$f" ]]; then + echo "ERROR: missing source: $f" >&2 + exit 2 + fi +done + +# Compile into a throwaway dir so a stray repo-root *.mod cannot shadow the +# fresh compile, and so we leave no artifacts behind. +WORK="$(mktemp -d)" +trap 'rm -rf "$WORK"' EXIT + +echo "Phase 6 parse-unit regression" +echo " FC: $FC" +echo " source: $SRC" +echo " driver: $DRV" +echo "" + +# Compile FROM the work dir as cwd: gfortran searches the current directory for +# .mod files first, so a stray repo-root streaming_control.mod would otherwise +# shadow the fresh compile. +# -J/-I alone do NOT remove cwd from the search order; the cd does. +cd "$WORK" +"$FC" -c "$SRC" -J"$WORK" -o "$WORK/streaming_control.o" +"$FC" "$DRV" "$WORK/streaming_control.o" -I"$WORK" -o "$WORK/p6drv" +"$WORK/p6drv" diff --git a/test/run-phase7-parse-unit.sh b/test/run-phase7-parse-unit.sh new file mode 100755 index 00000000..19c4cb33 --- /dev/null +++ b/test/run-phase7-parse-unit.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +# Phase 7 parse-unit regression (streaming-schema unit parse->pack assert). +# Compiles lib/streaming_control.f90 and the driver +# test/phase7_parse_test.f90 into an ISOLATED module dir and runs it. Guards the +# PARSE side of the 6 Phase 7 diagnostic / sequencing keys (4 ints + 2 bools): +# each key -> correct configure_fields member + value, bool true/false, int +# parse, wrong-type detection (int-as-string, bool-as-number), the "mode" +# substring non-collision (mode_changed contains "mode"), and the value-vs-key +# aliasing guard. +# +# WHY a Fortran unit driver (not only a fixture through jt9): all 6 Phase 7 keys +# are INERT on the FT8/JT9 fixtures (five are read only inside +# the multithreaded-FT8 block decoder.f90:192..1148 which streaming forces off; +# qso_progress_state reaches the single-pass FT8 decoder but only steers AP +# decoding passes and the fixture has no AP-only decodes), so no decode-output +# gate can assert those values landed. This unit driver is the +# parse->pack assert for the PARSE side; the configure_fields -> params APPLY +# routing is asserted by test/run-apply-routing-unit.sh (the 6 Phase 7 slot +# asserts). +# +# Usage: +# test/run-phase7-parse-unit.sh (no build dir; compiles from source) +# FC=gfortran-13 test/run-phase7-parse-unit.sh (override the compiler) + +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +FC="${FC:-gfortran}" +SRC="$REPO_ROOT/lib/streaming_control.f90" +DRV="$REPO_ROOT/test/phase7_parse_test.f90" + +if ! command -v "$FC" >/dev/null 2>&1; then + echo "ERROR: Fortran compiler '$FC' not found (set \$FC to override)" >&2 + exit 2 +fi +for f in "$SRC" "$DRV"; do + if [[ ! -f "$f" ]]; then + echo "ERROR: missing source: $f" >&2 + exit 2 + fi +done + +# Compile into a throwaway dir so a stray repo-root *.mod cannot shadow the +# fresh compile, and so we leave no artifacts behind. +WORK="$(mktemp -d)" +trap 'rm -rf "$WORK"' EXIT + +echo "Phase 7 parse-unit regression" +echo " FC: $FC" +echo " source: $SRC" +echo " driver: $DRV" +echo "" + +# Compile FROM the work dir as cwd: gfortran searches the current directory for +# .mod files first, so a stray repo-root streaming_control.mod would otherwise +# shadow the fresh compile. +# -J/-I alone do NOT remove cwd from the search order; the cd does. +cd "$WORK" +"$FC" -c "$SRC" -J"$WORK" -o "$WORK/streaming_control.o" +"$FC" "$DRV" "$WORK/streaming_control.o" -I"$WORK" -o "$WORK/p7drv" +"$WORK/p7drv" diff --git a/test/run-phase8-parse-unit.sh b/test/run-phase8-parse-unit.sh new file mode 100755 index 00000000..10848cac --- /dev/null +++ b/test/run-phase8-parse-unit.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +# Phase 8 parse-unit regression (streaming-schema unit parse->pack assert). +# Compiles lib/streaming_control.f90 and the driver +# test/phase8_parse_test.f90 into an ISOLATED module dir and runs it. Guards the +# PARSE side of the 5 Phase 8 string & scaled / derived keys +# (utc/date/n_trials/candthin_threshold/dt_center_seconds): the ISO derivations +# (utc->nutc HHMMSS, date->yymmdd), the n_trials->nranera encoding table (incl. the +# n_trials=1 -> nranera=0 spec edge), the two PARSE-TIME VALUE errors (n_trials not +# in {10^N,3*10^N}; date year>=2100), wrong-TYPE detection, malformed-ISO silent +# skip, nutc+utc both captured, and the value-vs-key aliasing guard. +# +# WHY a Fortran unit driver (not only a fixture through jt9): four of the five +# Phase 8 keys are INERT on the FT8/JT9 fixtures (date superfox-only; n_trials +# JT65-deep-search-only; candthin_threshold/dt_center_seconds multithread-FT8- +# variant-only), so no decode-output gate can assert those +# derivations landed. (utc IS decode-observable — Gates 19/20.) This driver is the +# parse->pack assert for the PARSE side; the configure_fields -> +# params APPLY routing (incl. the utc-wins precedence + the /100 scaling) is +# asserted by test/run-apply-routing-unit.sh. +# +# Usage: +# test/run-phase8-parse-unit.sh (no build dir; compiles from source) +# FC=gfortran-13 test/run-phase8-parse-unit.sh (override the compiler) + +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +FC="${FC:-gfortran}" +SRC="$REPO_ROOT/lib/streaming_control.f90" +DRV="$REPO_ROOT/test/phase8_parse_test.f90" + +if ! command -v "$FC" >/dev/null 2>&1; then + echo "ERROR: Fortran compiler '$FC' not found (set \$FC to override)" >&2 + exit 2 +fi +for f in "$SRC" "$DRV"; do + if [[ ! -f "$f" ]]; then + echo "ERROR: missing source: $f" >&2 + exit 2 + fi +done + +# Compile into a throwaway dir so a stray repo-root *.mod cannot shadow the +# fresh compile, and so we leave no artifacts behind. +WORK="$(mktemp -d)" +trap 'rm -rf "$WORK"' EXIT + +echo "Phase 8 parse-unit regression" +echo " FC: $FC" +echo " source: $SRC" +echo " driver: $DRV" +echo "" + +# Compile FROM the work dir as cwd: gfortran searches the current directory for +# .mod files first, so a stray repo-root streaming_control.mod would otherwise +# shadow the fresh compile. +# -J/-I alone do NOT remove cwd from the search order; the cd does. +cd "$WORK" +"$FC" -c "$SRC" -J"$WORK" -o "$WORK/streaming_control.o" +"$FC" "$DRV" "$WORK/streaming_control.o" -I"$WORK" -o "$WORK/p8drv" +"$WORK/p8drv" diff --git a/test/run-phase9-parse-unit.sh b/test/run-phase9-parse-unit.sh new file mode 100755 index 00000000..738116fb --- /dev/null +++ b/test/run-phase9-parse-unit.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +# Phase 9 parse-unit regression (streaming-schema unit parse->pack assert). +# Compiles lib/streaming_control.f90 and the driver +# test/phase9_parse_test.f90 into an ISOLATED module dir and runs it. Guards the +# PARSE + PACK side of the 9 bit-packed keys (depth_level/q65_maxiters_level/ +# use_averaging/deep_ap_search/q65_auto_clear_average -> ndepth; +# contest_type/single_decode/vhf_features/noise_blanker_level -> nexp_decode): the +# per-bit packing, the contest_type -> ncontest table (incl. the SpecOp 5/8/9 -> 1 +# collapse), the two atomic-decline errors (legacy depth co-present with an unpacked +# ndepth key; depth_level vs q65_maxiters_level inconsistency), the bit-width masking +# of depth_level/q65_maxiters, the noise_blanker -3 offset + [0,255] clamp, +# wrong-type detection, the unknown-contest silent skip, and value-vs-key aliasing. +# +# WHY a Fortran unit driver (not only fixtures through jt9): only depth_level is +# decode-observable on FT8/JT9 (Gate 24); the other 8 keys are INERT (Q65/JT65/ +# FST4/JT4 or contest-branch only), and even depth_level's bit +# PACKING is invisible to a decode-count gate (ndepth=3 and ndepth=3|16 both decode +# 21 on FT8). This driver is the parse->pack assert; the +# configure_fields -> params APPLY routing (the packed ints -> ndepth/nexp_decode) +# is asserted by test/run-apply-routing-unit.sh. +# +# Usage: +# test/run-phase9-parse-unit.sh (no build dir; compiles from source) +# FC=gfortran-13 test/run-phase9-parse-unit.sh (override the compiler) + +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +FC="${FC:-gfortran}" +SRC="$REPO_ROOT/lib/streaming_control.f90" +DRV="$REPO_ROOT/test/phase9_parse_test.f90" + +if ! command -v "$FC" >/dev/null 2>&1; then + echo "ERROR: Fortran compiler '$FC' not found (set \$FC to override)" >&2 + exit 2 +fi +for f in "$SRC" "$DRV"; do + if [[ ! -f "$f" ]]; then + echo "ERROR: missing source: $f" >&2 + exit 2 + fi +done + +# Compile into a throwaway dir so a stray repo-root *.mod cannot shadow the +# fresh compile, and so we leave no artifacts behind. +WORK="$(mktemp -d)" +trap 'rm -rf "$WORK"' EXIT + +echo "Phase 9 parse-unit regression" +echo " FC: $FC" +echo " source: $SRC" +echo " driver: $DRV" +echo "" + +# Compile FROM the work dir as cwd: gfortran searches the current directory for +# .mod files first, so a stray repo-root streaming_control.mod would otherwise +# shadow the fresh compile. +# -J/-I alone do NOT remove cwd from the search order; the cd does. +cd "$WORK" +"$FC" -c "$SRC" -J"$WORK" -o "$WORK/streaming_control.o" +"$FC" "$DRV" "$WORK/streaming_control.o" -I"$WORK" -o "$WORK/p9drv" +"$WORK/p9drv" diff --git a/test/run-pr3-fixtures.sh b/test/run-pr3-fixtures.sh new file mode 100755 index 00000000..f0ba2117 --- /dev/null +++ b/test/run-pr3-fixtures.sh @@ -0,0 +1,92 @@ +#!/usr/bin/env bash +# Configure-protocol regression harness — nutc thread-through, nfa/nfb +# mode-change restore, and ntol widening transition. +# +# Three gates: +# 1. nutc thread-through: verify NDJSON time field reflects sent nutc. +# 2. Mode-change ntol restore: prepend Q65 configure (auto-sets ntol=10), +# then FT8 configure with no explicit ntol. Buggy behavior: FT8 decodes +# with ntol=10 → ±10 Hz window → near-zero decodes. Fixed behavior: ntol +# restores to 1000 → full FT8 decode count. +# 3. Mode-change nfa/nfb restore: prepend Q65 configure with explicit +# narrow nfa/nfb (1400/1600) AND ntol=10, then FT8 configure with no +# explicit nfa/nfb/ntol. Buggy behavior: FT8 inherits the narrow window +# → near-zero decodes. Fixed behavior: both ntol AND nfa/nfb restore. +# +# Usage: +# test/run-pr3-fixtures.sh [build-dir] + +set -euo pipefail + +BUILD_DIR="${1:-build}" +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +JT9="$REPO_ROOT/$BUILD_DIR/jt9" +HARNESS="$REPO_ROOT/test/wav_to_stream_harness.py" + +if [[ ! -x "$JT9" ]]; then + echo "ERROR: jt9 binary not found or not executable: $JT9" >&2 + exit 2 +fi +if [[ ! -f "$HARNESS" ]]; then + echo "ERROR: harness not found: $HARNESS" >&2 + exit 2 +fi + +echo "Configure-protocol regression (nutc + nfa/nfb + ntol)" +echo " jt9: $JT9" +echo " harness: $HARNESS" + +fail=0 + +# --- Gate 1: nutc thread-through ---------------------------------- +echo "" +echo "Gate 1 — nutc thread-through" +nutc_count=$(python3 "$HARNESS" "$JT9" "$REPO_ROOT/samples/FT8/210703_133430.wav" \ + --mode FT8 --nutc 133430 --quiet 2>/dev/null \ + | grep -c '"time":"133430"' || true) +if [[ "$nutc_count" -ge 14 ]]; then + echo " PASS: nutc=133430 reflected in $nutc_count decode records" +else + echo " FAIL: nutc=133430 only reflected in $nutc_count decode records (expected >= 14)" + fail=1 +fi + +# --- Gate 2: mode-change ntol restore ----------------------------- +echo "" +echo "Gate 2 — mode-change ntol restore" +ntol_count=$(python3 "$HARNESS" "$JT9" "$REPO_ROOT/samples/FT8/210703_133430.wav" \ + --mode FT8 --prepend-mode Q65 --quiet 2>/dev/null \ + | grep -c '"t":"decode"' || true) +if [[ "$ntol_count" -ge 14 ]]; then + echo " PASS: Q65→FT8 (no explicit ntol): $ntol_count decodes >= 14" + echo " ntol restored from Q65's hard-10 to FT8's default 1000" +else + echo " FAIL: Q65→FT8 (no explicit ntol): $ntol_count decodes < 14 expected" + echo " ntol likely stayed at Q65's 10, narrowing FT8 window" + fail=1 +fi + +# --- Gate 3: mode-change nfa/nfb restore -------------------------- +echo "" +echo "Gate 3 — mode-change nfa/nfb restore" +nfa_count=$(python3 "$HARNESS" "$JT9" "$REPO_ROOT/samples/FT8/210703_133430.wav" \ + --mode FT8 --prepend-mode Q65 --prepend-with-explicit-narrowing \ + --quiet 2>/dev/null \ + | grep -c '"t":"decode"' || true) +if [[ "$nfa_count" -ge 14 ]]; then + echo " PASS: Q65 (narrow nfa=1400 nfb=1600 ntol=10) → FT8 (no override):" + echo " $nfa_count decodes >= 14" + echo " Both nfa/nfb (session baseline) AND ntol (per-mode default) restored" +else + echo " FAIL: Q65 (narrow) → FT8: $nfa_count decodes < 14 expected" + echo " Either nfa/nfb stayed narrow or ntol stayed at Q65's 10" + fail=1 +fi + +echo "" +if [[ "$fail" -eq 0 ]]; then + echo "All configure-protocol fixtures passed." +else + echo "One or more configure-protocol fixtures regressed." + exit 1 +fi diff --git a/test/run-schema-v1-fixtures.sh b/test/run-schema-v1-fixtures.sh new file mode 100755 index 00000000..072794f4 --- /dev/null +++ b/test/run-schema-v1-fixtures.sh @@ -0,0 +1,698 @@ +#!/usr/bin/env bash +# Streaming schema-v1 regression — Phases 1 + 2 + 4 + 5 + 6 + 7 + 8 + 9 +# (schema versioning, structured error envelope, per-key type validation + atomic +# decline, the Phase 4 operator-identity / frequency-window field group, the +# Phase 5 decoder-tuning field group, the Phase 6 FT8/FT4 specifics cluster, the +# Phase 7 diagnostic / sequencing field group, the Phase 8 string / scaled / +# derived field group, and the Phase 9 bit-packed ndepth / nexp_decode fields). +# +# Twenty-six gates: +# 1. Unknown schema version: a configure with version=2 is declined with +# exactly one {"t":"error","code":"unknown_schema_version","got":2}. +# 2. Explicit version=1 accepted: configure applies normally; FT8 decodes +# >= floor and NO unknown_schema_version is emitted. +# 3. Malformed control frame (missing "t"): emits +# {"t":"error","code":"configure_parse_error",...} AND the stream +# continues (the following valid configure applies, FT8 decodes >= floor). +# 4. (Phase 2) Per-key TYPE error + whole-frame decline: a configure with a +# wrong-typed key (depth as a string) AND a co-present good key (mode=JT65) +# emits exactly one {"code":"configure_type_error","key":"depth", +# "expected":"int","got":"string"} and the good key does NOT apply — the +# FT8 audio still decodes under the FT8 init default (>= floor), proving the +# ENTIRE frame was declined (no partial application). +# 5. (Phase 2) Recovery: a wrong-typed frame is declined with +# configure_type_error, then the following VALID configure applies normally. +# Proven by an APPLIED side-effect of the recovered frame (its nutc=133430 +# appears in the decode "time" fields) — a count floor alone cannot tell a +# recovered frame (21 decodes) from a silently-dropped one (14, init +# default), but the nutc reflection can (dropped -> time 000000). +# 6. (Phase 2) Value-vs-key aliasing guard: a configure whose mycall VALUE is +# the literal token "mygrid" (with no real mygrid key) must be ACCEPTED, not +# falsely declined (type validation must anchor keys to structural +# positions, not match a quoted value). +# 7. (Phase 4) All 9 operator-identity / frequency-window keys present with +# correct types (his_call/his_grid/my_b_call/his_b_call strings, +# my_call_standard/his_call_standard bools, tx_audio_offset_hz/ +# jt65_jt9_split_hz/max_drift_hz ints) are ACCEPTED end-to-end: ZERO +# configure_type_error and FT8 still decodes >= floor (parse + apply run +# without corrupting params). These fields are no-ops on the FT8 fixture +# (tx/Q65/split-only), so this gate proves the path, not a decode effect. +# 8. (Phase 4) A wrong-typed Phase 4 key (my_call_standard as a NUMBER) on a +# frame that also sets mode=JT65 emits exactly one {"code": +# "configure_type_error","key":"my_call_standard","expected":"bool", +# "got":"number"} and the whole frame is declined — mode JT65 does NOT +# apply, so the FT8 audio still decodes under the FT8 init default +# (>= floor). Proves Phase 4 type checks are wired into atomic-decline. +# 9. (Phase 5) All 12 decoder-tuning keys (dt_tolerance_seconds/ +# eme_delay_seconds reals, kin_samples/nzhsym_per_period/npts_c0_array/ +# min_width/min_sync/n_2pass ints, robust_mode/nagain_flag/clear_average +# bools, tx_mode enum) present with correct types are ACCEPTED end-to-end: +# ZERO configure_type_error and FT8 still decodes >= floor (parse + apply +# run without corrupting params). 10 of 12 are inert on FT8 (per-period +# recompute / JT65-Q65-only); this gate proves the PATH, not per-key routing +# (that is the parse-unit driver + Gates 11/12). +# 10. (Phase 5) A wrong-typed Phase 5 key (dt_tolerance_seconds as a STRING) on +# a frame that also sets mode=JT65 emits exactly one {"code": +# "configure_type_error","key":"dt_tolerance_seconds","expected":"real", +# "got":"string"} and the whole frame is declined (mode JT65 not applied, +# FT8 >= floor). Proves Phase 5 type checks are wired into atomic-decline. +# 11. (Phase 5 — APPLY ROUTING) nagain_flag=true changes the FT8 decode +# message-set vs the no-key baseline (empirically 21 -> 16). nagain is +# the ONLY Phase 5 key that reaches the FT8 decoder, so an observable change +# proves nagain_flag was applied to an FT8-affecting param — a partial +# apply-routing guard the inert Phase 4 fields could not have. +# 12. (Phase 5 — APPLY ROUTING) npts_c0_array=60000 changes the JT9 decode +# message-set vs the no-key baseline (empirically 7 -> 6). npts8 is +# the Phase 5 key that reaches the JT9 decoder, so an observable change +# proves npts_c0_array was applied to a JT9-affecting param. +# 13. (Phase 6) All 24 FT8/FT4-specifics keys present with correct types are +# ACCEPTED end-to-end: ZERO configure_type_error and FT8 still decodes +# >= floor. 23 of 24 are inert on the FT8 fixture (read only in the +# multithread-FT8 block / JT65 / superfox-Q65 / WAV path; or AP keys that +# this fixture has no AP-only decodes for); the 24th, +# multithreaded_ft8, is sent TRUE here and only stays >= floor BECAUSE the +# apply ignores the non-false value (Gate 15). So this proves the parse->apply +# PATH; per-key routing is guarded by the parse-unit + apply-routing units. +# 14. (Phase 6) A wrong-typed Phase 6 key (ft8_ap_on as a NUMBER) on a frame that +# also sets mode=JT65 emits exactly one {"code":"configure_type_error", +# "key":"ft8_ap_on","expected":"bool","got":"number"} and the whole frame is +# declined (mode JT65 not applied, FT8 >= floor). Wires Phase 6 type checks +# into atomic-decline. +# 15. (Phase 6 — CORRECTNESS GUARD) multithreaded_ft8=true must STILL decode FT8 +# >= floor. Setting lmultift8=.true. would take the decoder.f90:192 multithread +# branch, which yields 0 FT8 decodes on the stream path; the apply IGNORES +# the non-false value (the receiver ignores a non-false value). A regression +# to a straight pass-through would collapse FT8 to 0 and fail here. +# 16. (Phase 7) All 6 diagnostic / sequencing keys (last_tx_seconds_ago/ +# qso_progress_state/sec_band_changed/delay_units ints, currently_txing/ +# mode_changed bools) present with correct types are ACCEPTED end-to-end: +# ZERO configure_type_error and FT8 still decodes >= floor (parse + apply run +# without corrupting params). All 6 are inert on the FT8 fixture (read only +# in the multithread-FT8 block / AP passes with no AP-only decodes), +# so this gate proves the PATH, not a decode effect; per-key routing is +# guarded by run-phase7-parse-unit.sh + run-apply-routing-unit.sh. +# 17. (Phase 7) A wrong-typed Phase 7 key (last_tx_seconds_ago as a STRING) on a +# frame that also sets mode=JT65 emits exactly one {"code": +# "configure_type_error","key":"last_tx_seconds_ago","expected":"int", +# "got":"string"} and the whole frame is declined (mode JT65 not applied, +# FT8 >= floor). Wires Phase 7 type checks into atomic-decline. +# 18. (Phase 7 — CORRECTNESS GUARD) qso_progress_state OUT OF RANGE must STILL +# decode FT8 >= floor. nQSOProgress reaches the single-pass FT8 decoder +# (decoder.f90:1141), where ft8b.f90:274/299 use it as a raw index into +# nappasses(0:5)/naptypes(0:5,4); an out-of-range value (here 99) faults the +# decoder under -fbounds-check (0 decodes). The apply IGNORES +# an out-of-range value (valid [0,5] only), so FT8 must STILL decode >= floor. +# A regression to a straight pass-through would crash and fail here. +# 19. (Phase 8 — APPLY ROUTING) All 5 string/scaled/derived keys (utc/date/ +# n_trials/candthin_threshold/dt_center_seconds) accepted with 0 type errors, +# AND utc:"13:34:30" -> nutc 133430 is reflected in EVERY decode's "time" +# field (utc is decode-observable; the other 4 are inert — superfox / JT65 / +# multithread-variant only). A real apply-routing guard for utc. +# 20. (Phase 8 — PRECEDENCE) A frame with BOTH nutc:120000 and utc:"13:34:30" +# applies utc (time 133430), not nutc (120000) — apply order is nutc then utc +# (utc wins). Asserts 133430 present AND 120000 absent. +# 21. (Phase 8 — VALUE VALIDATION) n_trials=500 (a number, but not 10^N or 3*10^N) +# emits one configure_type_error key:"n_trials" and declines the whole frame +# (co-present mode=JT65 does not apply; FT8 decodes under its default). +# A non-conforming value would integer-divide into a wrong ntrials. +# 22. (Phase 8 — VALUE VALIDATION) date=2200-01-01 (year >= 2100) emits one +# configure_type_error key:"date" and declines the whole frame. +# The 2000+offset YYMMDD encoding caps at 2099. +# 23. (Phase 9 — ACCEPTED) All 9 unpacked ndepth/nexp_decode keys accepted with 0 +# type errors and FT8 >= floor (depth_level=3/q65_maxiters_level=3 keep ndepth=3 +# so the count is unperturbed; the other 7 are inert on FT8 — Q65/JT65/FST4/JT4 +# or contest-branch only). Proves the parse->pack->apply path runs clean. +# 24. (Phase 9 — APPLY ROUTING) depth_level is decode-observable: the FT8 fixture +# runs at depth=3 -> ndepth=3 (21 decodes); depth_level=1 -> ndepth=1 changes +# the FT8 pass structure (ft8_decode.f90:178/182) -> 14 decodes. Assertion: +# baseline >= floor AND with-key >= floor AND with-key != baseline (both-sides- +# healthy differs guard — a crash/empty with-key also "differs", so guard it). +# A real apply-routing guard for the one FT8-observable Phase-9 key. +# 25. (Phase 9 — CONFLICT DECLINE) A frame carrying BOTH the legacy depth and the +# unpacked depth_level emits one configure_type_error key:"ndepth" +# expected:"depth|unpacked" got:"conflict" and declines the whole frame +# (co-present mode=JT65 does not apply; FT8 decodes under its default). The +# conflicting-encodings rule, via the parse post-pass pack_phase9_. +# 26. (Phase 9 — TYPE DECLINE) A wrong-typed Phase 9 key (depth_level as a string) +# emits one configure_type_error key:"depth_level" expected:"int" got:"string" +# and declines the whole frame (mode=JT65 not applied; FT8 >= floor). Wires +# Phase 9 type checks into atomic-decline. +# +# Usage: +# test/run-schema-v1-fixtures.sh [build-dir] + +set -euo pipefail + +BUILD_DIR="${1:-build}" +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +JT9="$REPO_ROOT/$BUILD_DIR/jt9" +HARNESS="$REPO_ROOT/test/wav_to_stream_harness.py" +WAV="$REPO_ROOT/samples/FT8/210703_133430.wav" +JT9_WAV="$REPO_ROOT/samples/JT9/130418_1742.wav" +FT8_FLOOR=14 +JT9_FLOOR=6 + +if [[ ! -x "$JT9" ]]; then + echo "ERROR: jt9 binary not found or not executable: $JT9" >&2 + exit 2 +fi +if [[ ! -f "$HARNESS" ]]; then + echo "ERROR: harness not found: $HARNESS" >&2 + exit 2 +fi + +echo "Streaming schema-v1 regression (Phase 1: versioning + structured errors)" +echo " jt9: $JT9" +echo " harness: $HARNESS" + +fail=0 + +# --- Gate 1: unknown schema version declined -------------------------------- +echo "" +echo "Gate 1 — unknown schema version (version=2 declined)" +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 --schema-version 2 --quiet 2>/dev/null || true) +uv_count=$(printf '%s\n' "$out" | grep -c '"code":"unknown_schema_version"' || true) +got_count=$(printf '%s\n' "$out" | grep -c '"got":2' || true) +if [[ "$uv_count" -eq 1 && "$got_count" -ge 1 ]]; then + echo " PASS: version=2 declined with exactly one unknown_schema_version (got:2)" +else + echo " FAIL: expected exactly 1 unknown_schema_version with got:2 (saw code=$uv_count got=$got_count)" + fail=1 +fi + +# --- Gate 2: explicit version=1 accepted ------------------------------------ +echo "" +echo "Gate 2 — explicit version=1 accepted (normal decode)" +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 --schema-version 1 --quiet 2>/dev/null || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +uv=$(printf '%s\n' "$out" | grep -c '"code":"unknown_schema_version"' || true) +if [[ "$dec" -ge "$FT8_FLOOR" && "$uv" -eq 0 ]]; then + echo " PASS: version=1 accepted; $dec decodes >= $FT8_FLOOR, no version error" +else + echo " FAIL: version=1 — $dec decodes (expected >= $FT8_FLOOR), $uv version errors (expected 0)" + fail=1 +fi + +# --- Gate 3: malformed control frame -> configure_parse_error --------------- +echo "" +echo "Gate 3 — malformed control frame (configure_parse_error + graceful continue)" +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 --bad-control --quiet 2>/dev/null || true) +pe=$(printf '%s\n' "$out" | grep -c '"code":"configure_parse_error"' || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$pe" -ge 1 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: configure_parse_error emitted ($pe) and stream continued ($dec decodes >= $FT8_FLOOR)" +else + echo " FAIL: parse-error=$pe (expected >= 1), decodes=$dec (expected >= $FT8_FLOOR)" + fail=1 +fi + +# --- Gate 4: per-key type error + atomic decline (no partial application) --- +echo "" +echo "Gate 4 — configure_type_error + whole-frame decline (no partial application)" +# MAIN configure is wrong-typed (depth as a JSON string) AND sets mode JT65. +# Atomic decline: the entire frame -> mode JT65 must NOT apply, so the FT8 +# audio decodes under the FT8 init default (>= floor). Partial application +# (mode=JT65) would collapse FT8 decodes to ~0. +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode JT65 --bad-type --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +triple=$(printf '%s\n' "$out" | grep -c '"key":"depth","expected":"int","got":"string"' || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$te" -eq 1 && "$triple" -ge 1 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: one configure_type_error (depth/int/string); whole frame declined, mode JT65 not applied ($dec FT8 decodes >= $FT8_FLOOR)" +else + echo " FAIL: type_err=$te (want 1), key/expected/got match=$triple (want >=1), decodes=$dec (want >= $FT8_FLOOR)" + fail=1 +fi + +# --- Gate 5: type error then recovery (recovered frame's effect must apply) -- +echo "" +echo "Gate 5 — type error then recovery (recovered frame's nutc must be applied)" +# Declined bad-type preamble, then a VALID main configure carrying nutc=133430. +# Recovery is proven by the APPLIED side-effect (decode time == 133430), not by +# the decode count: a silently-dropped recovered frame would still yield ~14 +# init-default decodes (>= FT8_FLOOR) but with time 000000, which this gate +# rejects. +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 --bad-type-preamble --nutc 133430 --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +rec=$(printf '%s\n' "$out" | grep '"t":"decode"' | grep -c '"time":"133430"' || true) +if [[ "$te" -ge 1 && "$dec" -ge "$FT8_FLOOR" && "$rec" -ge 1 ]]; then + echo " PASS: configure_type_error emitted ($te); recovered frame APPLIED ($rec/$dec decodes carry nutc 133430)" +else + echo " FAIL: type_err=$te (want >=1), decodes=$dec (want >= $FT8_FLOOR), nutc-reflected=$rec (want >=1)" + fail=1 +fi + +# --- Gate 6: value-vs-key aliasing must NOT falsely decline (regression) ----- +echo "" +echo "Gate 6 — value-vs-key aliasing accepted (mycall value == \"mygrid\" token)" +# {"t":"configure","mode":"FT8","depth":3,"mycall":"mygrid"} (no real mygrid key). +# A well-typed string value that equals another key's token must NOT be mistaken +# for that key and falsely declined. Expect ZERO configure_type_error and a +# normal decode. (wire-parity regression guard) +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 --mycall mygrid --omit-mygrid --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$te" -eq 0 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: aliasing frame accepted (0 type errors); $dec decodes >= $FT8_FLOOR" +else + echo " FAIL: type_err=$te (want 0 — false decline = regression), decodes=$dec (want >= $FT8_FLOOR)" + fail=1 +fi + +# --- Gate 7: Phase 4 — all 9 keys accepted (parse + apply run clean) --------- +echo "" +echo "Gate 7 — Phase 4 fields accepted (his_call/his_grid/my_b_call/his_b_call/" +echo " my_call_standard/his_call_standard/tx_audio_offset_hz/" +echo " jt65_jt9_split_hz/max_drift_hz)" +# All 9 keys present with correct types and benign values. They are no-ops on +# the FT8 fixture (tx/Q65/split-only — an all-9-keys configure yields a +# byte-identical 21-message FT8 decode set), so the assertion is: ZERO type +# errors (every key accepted) AND FT8 still decodes >= floor (apply ran without +# corrupting params). This proves the parse->apply PATH executes cleanly; it +# does NOT prove each value lands in its CORRECT params slot (the fields are +# inert here, so a mis-route would still pass) — that routing is guarded by the +# parse-unit driver (test/run-phase4-parse-unit.sh, parse side) + code review. +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 \ + --his-call DX1ABC --his-grid FN20 --my-b-call KJ5HST/P --his-b-call DX1ABC/P \ + --my-call-standard --his-call-standard \ + --tx-audio-offset-hz 1234 --jt65-jt9-split-hz 2500 --max-drift-hz 8 \ + --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$te" -eq 0 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: all 9 Phase 4 keys accepted (0 type errors); $dec decodes >= $FT8_FLOOR (apply clean)" +else + echo " FAIL: type_err=$te (want 0), decodes=$dec (want >= $FT8_FLOOR)" + fail=1 +fi + +# --- Gate 8: Phase 4 — wrong-typed key -> type error + atomic decline -------- +echo "" +echo "Gate 8 — Phase 4 wrong-typed key (my_call_standard as number) declines frame" +# MAIN configure carries my_call_standard:5 (number, wrong type for a bool) AND +# sets mode=JT65. Atomic decline: the entire frame -> mode JT65 must NOT +# apply, so the FT8 audio decodes under the FT8 init default (>= floor). The +# error must name the Phase 4 key with expected:"bool" got:"number". +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode JT65 --bad-phase4 --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +triple=$(printf '%s\n' "$out" | grep -c '"key":"my_call_standard","expected":"bool","got":"number"' || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$te" -eq 1 && "$triple" -ge 1 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: one configure_type_error (my_call_standard/bool/number); frame declined, mode JT65 not applied ($dec FT8 decodes >= $FT8_FLOOR)" +else + echo " FAIL: type_err=$te (want 1), key/expected/got match=$triple (want >=1), decodes=$dec (want >= $FT8_FLOOR)" + fail=1 +fi + +# --- Gate 9: Phase 5 — all 12 keys accepted (parse + apply run clean) -------- +echo "" +echo "Gate 9 — Phase 5 fields accepted (dt_tolerance_seconds/eme_delay_seconds/" +echo " kin_samples/nzhsym_per_period/npts_c0_array/min_width/min_sync/" +echo " n_2pass/robust_mode/nagain_flag/tx_mode/clear_average)" +# All 12 keys present with correct types and benign values. 10 are inert on FT8 +# (per-period recompute or JT65/Q65-only); nagain_flag=true does affect FT8 +# (21->16, still >= floor) and npts_c0_array is set to its streaming default +# (74736, a no-op). Assertion: ZERO type errors (every key accepted) AND FT8 still +# decodes >= floor (apply ran without corrupting params). Proves the parse->apply +# PATH; per-key routing is guarded by run-phase5-parse-unit.sh + Gates 11/12. +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 \ + --dt-tolerance-seconds 2.0 --eme-delay-seconds 0.0 --kin-samples 64800 \ + --nzhsym-per-period 50 --npts-c0-array 74736 --min-width 1 --min-sync 1 \ + --n-2pass 1 --robust-mode --nagain-flag --tx-mode JT9 --clear-average \ + --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$te" -eq 0 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: all 12 Phase 5 keys accepted (0 type errors); $dec decodes >= $FT8_FLOOR (apply clean)" +else + echo " FAIL: type_err=$te (want 0), decodes=$dec (want >= $FT8_FLOOR)" + fail=1 +fi + +# --- Gate 10: Phase 5 — wrong-typed key -> type error + atomic decline -------- +echo "" +echo "Gate 10 — Phase 5 wrong-typed key (dt_tolerance_seconds as string) declines frame" +# MAIN configure carries dt_tolerance_seconds:"abc" (string, wrong type for a +# real) AND sets mode=JT65. Atomic decline: the entire frame -> mode JT65 must +# NOT apply, so FT8 decodes under the FT8 init default (>= floor). The error must +# name the Phase 5 key with expected:"real" got:"string". +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode JT65 --bad-phase5 --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +triple=$(printf '%s\n' "$out" | grep -c '"key":"dt_tolerance_seconds","expected":"real","got":"string"' || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$te" -eq 1 && "$triple" -ge 1 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: one configure_type_error (dt_tolerance_seconds/real/string); frame declined, mode JT65 not applied ($dec FT8 decodes >= $FT8_FLOOR)" +else + echo " FAIL: type_err=$te (want 1), key/expected/got match=$triple (want >=1), decodes=$dec (want >= $FT8_FLOOR)" + fail=1 +fi + +# --- Gate 11: Phase 5 APPLY ROUTING — nagain_flag observably changes FT8 ------ +echo "" +echo "Gate 11 — nagain_flag=true changes the FT8 decode set (apply-routing proof)" +# nagain is the only Phase 5 key reaching the FT8 decoder (ft8_decode.f90 final +# pass). Baseline (no key) vs --nagain-flag must DIFFER, proving apply routed +# nagain_flag to an FT8-affecting param. Baseline computed fresh (robust to +# count drift); guard against a vacuous pass by requiring a non-empty baseline. +base=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 --quiet 2>/dev/null \ + | grep '"t":"decode"' | grep -oE '"message":"[^"]*"' | sort || true) +withk=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 --nagain-flag --quiet 2>/dev/null \ + | grep '"t":"decode"' | grep -oE '"message":"[^"]*"' | sort || true) +nbase=$(printf '%s\n' "$base" | grep -c '"message"' || true) +nwith=$(printf '%s\n' "$withk" | grep -c '"message"' || true) +# Guard BOTH sides: a crash / shmem-collision that emits nothing yields withk="" +# which "differs" from a healthy baseline and would FALSELY pass. Require the +# with-key run to be a healthy decode (>= 1 msg) too — only then does "differs" +# prove the key reached the decoder (not that one side died). (guards a vacuous pass) +if [[ -n "$base" && "$nbase" -ge "$FT8_FLOOR" && "$nwith" -ge 1 && "$base" != "$withk" ]]; then + echo " PASS: nagain_flag observably changed FT8 decode set (baseline $nbase msgs != with-key $nwith msgs)" +else + echo " FAIL: nagain_flag effect unproven (baseline=$nbase >= $FT8_FLOOR?, with-key=$nwith >= 1?, sets differ=$([[ "$base" != "$withk" ]] && echo yes || echo no))" + fail=1 +fi + +# --- Gate 12: Phase 5 APPLY ROUTING — npts_c0_array observably changes JT9 ---- +echo "" +echo "Gate 12 — npts_c0_array changes the JT9 decode set (apply-routing proof)" +# npts8 reaches the JT9 decoder (decoder.f90:1349). Baseline (no key) vs +# --npts-c0-array 60000 (off the 74736 default) must DIFFER, proving apply routed +# npts_c0_array to a JT9-affecting param. Uses the JT9 fixture; baseline fresh. +if [[ -f "$JT9_WAV" ]]; then + base=$(python3 "$HARNESS" "$JT9" "$JT9_WAV" --mode JT9 --quiet 2>/dev/null \ + | grep '"t":"decode"' | grep -oE '"message":"[^"]*"' | sort || true) + withk=$(python3 "$HARNESS" "$JT9" "$JT9_WAV" --mode JT9 --npts-c0-array 60000 --quiet 2>/dev/null \ + | grep '"t":"decode"' | grep -oE '"message":"[^"]*"' | sort || true) + nbase=$(printf '%s\n' "$base" | grep -c '"message"' || true) + nwith=$(printf '%s\n' "$withk" | grep -c '"message"' || true) + # Same both-sides guard as Gate 11 (crash / shmem-collision -> empty withk + # must NOT pass as a spurious "difference"). + if [[ -n "$base" && "$nbase" -ge "$JT9_FLOOR" && "$nwith" -ge 1 && "$base" != "$withk" ]]; then + echo " PASS: npts_c0_array observably changed JT9 decode set (baseline $nbase msgs != with-key $nwith msgs)" + else + echo " FAIL: npts_c0_array effect unproven (baseline=$nbase >= $JT9_FLOOR?, with-key=$nwith >= 1?, sets differ=$([[ "$base" != "$withk" ]] && echo yes || echo no))" + fail=1 + fi +else + echo " SKIP: JT9 fixture not found ($JT9_WAV)" +fi + +# --- Gate 13: Phase 6 — all 24 keys accepted (parse + apply run clean) -------- +echo "" +echo "Gate 13 — Phase 6 FT8/FT4-specifics keys accepted (24 keys: 19 bools + 5 ints)" +# All 24 keys present with correct types and benign values. 23 are inert on the +# FT8 fixture (multithread-block / JT65 / superfox / WAV-path / AP-no-effect). +# multithreaded_ft8 is sent TRUE and only stays >= floor because +# the apply ignores the non-false value (Gate 15). Assertion: ZERO type errors +# (every key accepted) AND FT8 still decodes >= floor (apply ran without +# corrupting params). Per-key routing is guarded by run-phase6-parse-unit.sh + +# run-apply-routing-unit.sh (no Phase 6 key is decode-observable in a healthy way). +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 \ + --multithreaded-ft8 --ft8-cycles 3 --ft8-rxf-sensitivity 3 --ft8-threads 0 \ + --ft8-decoder-start 3 --ft8-low-threshold --ft8-subpass --ft8-ap-on \ + --ap-cq-only --ap-my-call --jt65-ap-on --ap-width-hz 150 \ + --hide-ft8-duplicates --common-ft8b --enable-dxc-search --wide-dxc-search \ + --superfox-mode --even-sequence --hound-mode --multi-instance --skip-tx1 \ + --nagain-filter --stop-hint --hint-mode \ + --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$te" -eq 0 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: all 24 Phase 6 keys accepted (0 type errors); $dec decodes >= $FT8_FLOOR (apply clean)" +else + echo " FAIL: type_err=$te (want 0), decodes=$dec (want >= $FT8_FLOOR)" + fail=1 +fi + +# --- Gate 14: Phase 6 — wrong-typed key -> type error + atomic decline -------- +echo "" +echo "Gate 14 — Phase 6 wrong-typed key (ft8_ap_on as number) declines frame" +# MAIN configure carries ft8_ap_on:5 (number, wrong type for a bool) AND sets +# mode=JT65. Atomic decline: the entire frame -> mode JT65 must NOT apply, so the +# FT8 audio decodes under the FT8 init default (>= floor). The error must name the +# Phase 6 key with expected:"bool" got:"number". +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode JT65 --bad-phase6 --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +triple=$(printf '%s\n' "$out" | grep -c '"key":"ft8_ap_on","expected":"bool","got":"number"' || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$te" -eq 1 && "$triple" -ge 1 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: one configure_type_error (ft8_ap_on/bool/number); frame declined, mode JT65 not applied ($dec FT8 decodes >= $FT8_FLOOR)" +else + echo " FAIL: type_err=$te (want 1), key/expected/got match=$triple (want >=1), decodes=$dec (want >= $FT8_FLOOR)" + fail=1 +fi + +# --- Gate 15: Phase 6 CORRECTNESS GUARD — multithreaded_ft8 ignore-non-false --- +echo "" +echo "Gate 15 — multithreaded_ft8=true still decodes (apply ignores non-false)" +# lmultift8=.true. takes the decoder.f90:192 multithread branch, which yields 0 +# FT8 decodes on the stream path. The apply IGNORES a non-false +# multithreaded_ft8, so FT8 must STILL decode >= floor. A straight +# pass-through regression would collapse FT8 to 0 and fail here. Compare against a +# fresh baseline to keep the assertion meaningful (both runs healthy). +base=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 --quiet 2>/dev/null \ + | grep -c '"t":"decode"' || true) +mt=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 --multithreaded-ft8 --quiet 2>/dev/null \ + | grep -c '"t":"decode"' || true) +if [[ "$base" -ge "$FT8_FLOOR" && "$mt" -ge "$FT8_FLOOR" ]]; then + echo " PASS: multithreaded_ft8=true ignored; FT8 still decodes ($mt >= $FT8_FLOOR, baseline $base)" +else + echo " FAIL: guard broken — multithreaded_ft8=true collapsed FT8 (with-key=$mt, baseline=$base, floor=$FT8_FLOOR)" + fail=1 +fi + +# --- Gate 16: Phase 7 — all 6 keys accepted (parse + apply run clean) --------- +echo "" +echo "Gate 16 — Phase 7 diagnostic/sequencing keys accepted (6 keys: 4 ints + 2 bools)" +# All 6 keys present with correct types and benign values. All are inert on the +# FT8 fixture (multithread-block-only / AP passes with no AP-only decodes). +# qso_progress_state=5 reaches the single-pass FT8 decoder but +# only steers AP passes (no AP-only decodes on this fixture). Assertion: ZERO +# type errors (every key accepted) AND FT8 still decodes >= floor (apply ran +# without corrupting params). Per-key routing is guarded by +# run-phase7-parse-unit.sh + run-apply-routing-unit.sh. +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 \ + --last-tx-seconds-ago 3 --currently-txing --mode-changed \ + --qso-progress-state 5 --sec-band-changed 7 --delay-units 6 \ + --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$te" -eq 0 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: all 6 Phase 7 keys accepted (0 type errors); $dec decodes >= $FT8_FLOOR (apply clean)" +else + echo " FAIL: type_err=$te (want 0), decodes=$dec (want >= $FT8_FLOOR)" + fail=1 +fi + +# --- Gate 17: Phase 7 — wrong-typed key -> type error + atomic decline -------- +echo "" +echo "Gate 17 — Phase 7 wrong-typed key (last_tx_seconds_ago as string) declines frame" +# MAIN configure carries last_tx_seconds_ago:"soon" (string, wrong type for an +# int) AND sets mode=JT65. Atomic decline: the entire frame -> mode JT65 must +# NOT apply, so the FT8 audio decodes under the FT8 init default (>= floor). The +# error must name the Phase 7 key with expected:"int" got:"string". +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode JT65 --bad-phase7 --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +triple=$(printf '%s\n' "$out" | grep -c '"key":"last_tx_seconds_ago","expected":"int","got":"string"' || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$te" -eq 1 && "$triple" -ge 1 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: one configure_type_error (last_tx_seconds_ago/int/string); frame declined, mode JT65 not applied ($dec FT8 decodes >= $FT8_FLOOR)" +else + echo " FAIL: type_err=$te (want 1), key/expected/got match=$triple (want >=1), decodes=$dec (want >= $FT8_FLOOR)" + fail=1 +fi + +# --- Gate 18: Phase 7 CORRECTNESS GUARD — qso_progress_state out-of-range ------ +echo "" +echo "Gate 18 — qso_progress_state=99 (out of range) still decodes (apply ignores it)" +# nQSOProgress reaches the single-pass FT8 decoder (decoder.f90:1141), where +# ft8b.f90:274/299 use it as a raw index into nappasses(0:5)/naptypes(0:5,4) on the +# default lft8apon=.true. path. An out-of-range value faults the decoder under +# -fbounds-check (qso_progress_state=99 crashes jt9 --stream). The +# apply IGNORES an out-of-range value (valid [0,5] only), so FT8 must STILL decode +# >= floor. A straight-pass-through regression would crash and collapse FT8 to 0. +# Both-sides-healthy: baseline >= floor AND with-key >= floor. +base=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 --quiet 2>/dev/null \ + | grep -c '"t":"decode"' || true) +oor=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 --qso-progress-state 99 --quiet 2>/dev/null \ + | grep -c '"t":"decode"' || true) +if [[ "$base" -ge "$FT8_FLOOR" && "$oor" -ge "$FT8_FLOOR" ]]; then + echo " PASS: qso_progress_state=99 ignored; FT8 still decodes ($oor >= $FT8_FLOOR, baseline $base)" +else + echo " FAIL: guard broken — out-of-range qso_progress_state collapsed FT8 (with-key=$oor, baseline=$base, floor=$FT8_FLOOR)" + fail=1 +fi + +# --- Gate 19: Phase 8 — all 5 keys accepted + utc DECODE-OBSERVABLE ----------- +echo "" +echo "Gate 19 — Phase 8 string/scaled/derived keys accepted; utc reflected in time" +# All 5 keys present with benign values. utc:"13:34:30" -> nutc 133430 is +# DECODE-OBSERVABLE in the decode "time" field (unlike Phases 4/6/7's inert +# fields, this is a real apply-routing guard, like the Gate 5 nutc pattern). +# date/n_trials/candthin_threshold/dt_center_seconds are inert on FT8 (superfox / +# JT65 / multithread-variant only), and the n_trials/candthin/ +# dtcenter values equal the init defaults (nranera=6 / ncandthin=100 / ndtcenter=0) +# so they cannot perturb the count. Assertion: ZERO type errors, FT8 >= floor, AND +# every decode carries time 133430 (proves utc parsed -> nutc -> emitted). +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 \ + --utc "13:34:30" --date "2021-07-03" --n-trials 1000 \ + --candthin-threshold 1.0 --dt-center-seconds 0.0 \ + --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +rec=$(printf '%s\n' "$out" | grep '"t":"decode"' | grep -c '"time":"133430"' || true) +if [[ "$te" -eq 0 && "$dec" -ge "$FT8_FLOOR" && "$rec" -ge 1 && "$rec" -eq "$dec" ]]; then + echo " PASS: all 5 Phase 8 keys accepted (0 type errors); $dec decodes >= $FT8_FLOOR; utc reflected ($rec/$dec carry time 133430)" +else + echo " FAIL: type_err=$te (want 0), decodes=$dec (want >= $FT8_FLOOR), utc-reflected=$rec (want == $dec, >=1)" + fail=1 +fi + +# --- Gate 20: Phase 8 — utc WINS over the legacy int nutc (precedence) -------- +echo "" +echo "Gate 20 — utc precedence: utc beats a co-present nutc" +# A frame carrying BOTH nutc:120000 (legacy int) AND utc:"13:34:30" (ISO) must +# apply utc (133430), not nutc (120000). apply_configure_fields applies nutc then +# utc, so utc wins. Assertion: time 133430 present AND time 120000 ABSENT. +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 --nutc 120000 --utc "13:34:30" \ + --quiet 2>/dev/null || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +win=$(printf '%s\n' "$out" | grep '"t":"decode"' | grep -c '"time":"133430"' || true) +lose=$(printf '%s\n' "$out" | grep '"t":"decode"' | grep -c '"time":"120000"' || true) +if [[ "$dec" -ge "$FT8_FLOOR" && "$win" -ge 1 && "$lose" -eq 0 ]]; then + echo " PASS: utc wins ($win/$dec carry time 133430; 0 carry the nutc 120000)" +else + echo " FAIL: decodes=$dec (want >= $FT8_FLOOR), utc-wins=$win (want >=1), nutc-leak=$lose (want 0)" + fail=1 +fi + +# --- Gate 21: Phase 8 — n_trials out of {10^N,3*10^N} -> type error + decline - +echo "" +echo "Gate 21 — n_trials=500 (invalid value) declines the frame" +# n_trials is type-correct (a number) but VALUE-invalid (not 10^N or 3*10^N), so the +# receiver emits configure_type_error (a bad nranera would silently corrupt ntrials, +# decoder.f90:143-145). The frame also sets mode=JT65; atomic decline of the WHOLE +# frame -> JT65 must NOT apply, so the FT8 audio decodes under the FT8 init default. +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode JT65 --n-trials 500 --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +triple=$(printf '%s\n' "$out" | grep -F '"key":"n_trials","expected":"int 10^N|3*10^N","got":"number"' | grep -c . || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$te" -eq 1 && "$triple" -ge 1 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: one configure_type_error (n_trials value-invalid); frame declined, mode JT65 not applied ($dec FT8 decodes >= $FT8_FLOOR)" +else + echo " FAIL: type_err=$te (want 1), n_trials triple=$triple (want >=1), decodes=$dec (want >= $FT8_FLOOR)" + fail=1 +fi + +# --- Gate 22: Phase 8 — date year >= 2100 -> type error + decline ------------- +echo "" +echo "Gate 22 — date=2200-01-01 (year >= 2100) declines the frame" +# The 2000+offset YYMMDD encoding caps at 2099; a year >= 2100 is a +# configure_type_error. The frame also sets mode=JT65, which must NOT apply +# (whole-frame decline) -> FT8 decodes under its init default. +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode JT65 --date "2200-01-01" --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +triple=$(printf '%s\n' "$out" | grep -F '"key":"date","expected":"year<2100","got":"string"' | grep -c . || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$te" -eq 1 && "$triple" -ge 1 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: one configure_type_error (date year>=2100); frame declined, mode JT65 not applied ($dec FT8 decodes >= $FT8_FLOOR)" +else + echo " FAIL: type_err=$te (want 1), date triple=$triple (want >=1), decodes=$dec (want >= $FT8_FLOOR)" + fail=1 +fi + +# --- Gate 23: Phase 9 — all 9 unpacked keys accepted (parse + pack + apply clean) +echo "" +echo "Gate 23 — Phase 9 bit-packed keys accepted (9 keys: ndepth group + nexp_decode group)" +# All 9 unpacked keys present. depth_level=3 / q65_maxiters_level=3 keep ndepth=3 +# (== the harness default depth=3), so the count is unperturbed; q65_maxiters agrees +# with depth_level's low 2 bits (consistency OK). use_averaging/deep_ap_search/ +# q65_auto_clear_average (ndepth bits 4/5/7) + single_decode/vhf_features/ +# noise_blanker (nexp_decode) are all inert on FT8 (Q65/JT65/FST4/JT4 only). +# contest_type=na_vhf -> ncontest=1 reaches FT8 ft8apset but the +# fixture has no contest/AP-only decodes. Assertion: ZERO type errors AND FT8 still +# decodes >= floor (parse->pack->apply ran clean). Per-key bit-packing is guarded by +# run-phase9-parse-unit.sh; per-key routing by run-apply-routing-unit.sh. +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 \ + --depth-level 3 --q65-maxiters-level 3 --use-averaging --deep-ap-search \ + --q65-auto-clear-average --contest-type na_vhf --single-decode \ + --vhf-features --noise-blanker-level 2 --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$te" -eq 0 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: all 9 Phase 9 keys accepted (0 type errors); $dec decodes >= $FT8_FLOOR (pack+apply clean)" +else + echo " FAIL: type_err=$te (want 0), decodes=$dec (want >= $FT8_FLOOR)" + fail=1 +fi + +# --- Gate 24: Phase 9 APPLY ROUTING — depth_level is decode-observable --------- +echo "" +echo "Gate 24 — depth_level=1 changes the FT8 decode set (real apply-routing guard)" +# The FT8 fixture default runs at depth=3 -> ndepth=3 (21 decodes). Sending +# depth_level=1 (which auto-drops the legacy depth key) -> ndepth=1 takes the FT8 +# fast-decode path (ft8_decode.f90:178 npass=2, :182 syncmin) -> FEWER decodes +# (14). A mis-route to an inert param would leave the count at 21. Assertion: +# baseline healthy (>= floor) AND with-key non-empty (>= 1, NOT a crash/shmem-0 — +# the both-sides-healthy guard: a 0 with-key also "differs" from a healthy +# baseline) AND with-key STRICTLY FEWER than baseline (the fast path +# decodes less). NB: the with-key bound is >= 1, NOT >= FT8_FLOOR, so the gate is +# robust to a future decode-core nudge in the fast-path count (which happens to be +# 14 == FT8_FLOOR today; coupling them would false-fail on a benign drift to 13). +# "< baseline" + ">= 1" still catches a mis-route (== baseline) +# and a crash (0). +base=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 --quiet 2>/dev/null \ + | grep -c '"t":"decode"' || true) +dl=$(python3 "$HARNESS" "$JT9" "$WAV" --mode FT8 --depth-level 1 --quiet 2>/dev/null \ + | grep -c '"t":"decode"' || true) +if [[ "$base" -ge "$FT8_FLOOR" && "$dl" -ge 1 && "$dl" -lt "$base" ]]; then + echo " PASS: depth_level=1 routed to ndepth (fewer decodes: $dl < baseline $base, both healthy)" +else + echo " FAIL: baseline=$base (want >= $FT8_FLOOR), depth_level=1=$dl (want >= 1 AND < $base)" + fail=1 +fi + +# --- Gate 25: Phase 9 — depth + depth_level conflict -> type error + decline --- +echo "" +echo "Gate 25 — depth + depth_level co-present (conflict) declines the frame" +# A frame carrying BOTH the legacy depth (full int) and the unpacked depth_level is +# a conflicting-encodings error (the two are mutually exclusive). The +# parse post-pass pack_phase9_ emits configure_type_error key:"ndepth" +# expected:"depth|unpacked" got:"conflict". The frame also sets mode=JT65, which must +# NOT apply (whole-frame decline) -> FT8 decodes under its init default. +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode JT65 --phase9-conflict --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +triple=$(printf '%s\n' "$out" | grep -F '"key":"ndepth","expected":"depth|unpacked","got":"conflict"' | grep -c . || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$te" -eq 1 && "$triple" -ge 1 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: one configure_type_error (ndepth conflict); frame declined, mode JT65 not applied ($dec FT8 decodes >= $FT8_FLOOR)" +else + echo " FAIL: type_err=$te (want 1), ndepth conflict triple=$triple (want >=1), decodes=$dec (want >= $FT8_FLOOR)" + fail=1 +fi + +# --- Gate 26: Phase 9 — wrong-typed key -> type error + atomic decline --------- +echo "" +echo "Gate 26 — Phase 9 wrong-typed key (depth_level as string) declines frame" +# MAIN configure carries depth_level:"deep" (string, wrong type for an int) AND sets +# mode=JT65. Atomic decline: the entire frame -> mode JT65 must NOT apply, so the +# FT8 audio decodes under the FT8 init default (>= floor). The error must name the +# Phase 9 key with expected:"int" got:"string". +out=$(python3 "$HARNESS" "$JT9" "$WAV" --mode JT65 --bad-phase9 --quiet 2>/dev/null || true) +te=$(printf '%s\n' "$out" | grep -c '"code":"configure_type_error"' || true) +triple=$(printf '%s\n' "$out" | grep -c '"key":"depth_level","expected":"int","got":"string"' || true) +dec=$(printf '%s\n' "$out" | grep -c '"t":"decode"' || true) +if [[ "$te" -eq 1 && "$triple" -ge 1 && "$dec" -ge "$FT8_FLOOR" ]]; then + echo " PASS: one configure_type_error (depth_level/int/string); frame declined, mode JT65 not applied ($dec FT8 decodes >= $FT8_FLOOR)" +else + echo " FAIL: type_err=$te (want 1), key/expected/got match=$triple (want >=1), decodes=$dec (want >= $FT8_FLOOR)" + fail=1 +fi + +echo "" +if [[ "$fail" -eq 0 ]]; then + echo "All schema-v1 fixtures passed." +else + echo "Some schema-v1 fixtures FAILED." + exit 1 +fi diff --git a/test/run-stream-wav-parity.sh b/test/run-stream-wav-parity.sh new file mode 100755 index 00000000..67c66e43 --- /dev/null +++ b/test/run-stream-wav-parity.sh @@ -0,0 +1,126 @@ +#!/usr/bin/env bash +# Stream-vs-WAV decode-parity harness. +# +# Asserts CONTAINMENT: every signal in a committed WAV-mode golden +# (test/fixtures/*.expected.txt) is also decoded by `jt9 --stream`. Streaming +# legitimately finds MORE (the early nzhsym passes pick up low-SNR signals; see +# run-streaming-fixtures.sh) so the relation is "WAV goldens are a subset of +# stream decodes", NOT equality. This is the rigorous regression guard the +# decode-affecting later phases (8, 9) depend on. +# +# Identity is the decoded MESSAGE text. Empirically snr/dt/freq drift between +# the WAV and stream decode paths for the SAME signal (snr ±2 dB, dt ±0.05 s, +# freq ±3 Hz on these fixtures — the streaming early passes compute slightly +# different fine estimates), so the harness shows them as diagnostics but the +# pass/fail hinges only on message-set containment. +# +# Scope: FT8 and JT9 ONLY (stated, not silently capped). FST4W has no +# known-good decoder fixture and the EME/JT65 I/Q paths are +# pass-on-absence, so neither can anchor a parity golden. +# +# A NEGATIVE CONTROL gate proves the harness can fail: a golden carrying one +# synthetic impossible signal MUST be reported as a parity failure. Without it, +# a green run cannot distinguish "containment held" from "harness never fails". +# +# Usage: +# test/run-stream-wav-parity.sh [build-dir] +# +# Where build-dir defaults to ./build and must contain a built jt9 binary. + +set -euo pipefail + +BUILD_DIR="${1:-build}" +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +JT9="$REPO_ROOT/$BUILD_DIR/jt9" +HARNESS="$REPO_ROOT/test/wav_to_stream_harness.py" + +if [[ ! -x "$JT9" ]]; then + echo "ERROR: jt9 binary not found or not executable: $JT9" >&2 + exit 2 +fi +if [[ ! -f "$HARNESS" ]]; then + echo "ERROR: harness not found: $HARNESS" >&2 + exit 2 +fi + +echo "Stream-vs-WAV decode-parity (containment; FT8/JT9 only)" +echo " jt9: $JT9" +echo " harness: $HARNESS" + +fail=0 + +# Format: +fixtures=( + "samples/FT8/210703_133430.wav FT8 test/fixtures/ft8_210703_133430.expected.txt" + "samples/JT9/130418_1742.wav JT9 test/fixtures/jt9_130418_1742.expected.txt" +) + +for entry in "${fixtures[@]}"; do + read -r wav mode golden <<< "$entry" + wav_path="$REPO_ROOT/$wav" + golden_path="$REPO_ROOT/$golden" + echo "" + if [[ ! -f "$wav_path" ]]; then + echo " SKIP: $wav (sample not present)" + continue + fi + if [[ ! -f "$golden_path" ]]; then + echo " SKIP: $golden (golden not present)" + continue + fi + if python3 "$HARNESS" "$JT9" "$wav_path" --mode "$mode" --parity "$golden_path"; then + echo " PASS: $mode parity (WAV goldens are a subset of stream decodes)" + else + echo " FAIL: $mode parity — a WAV-confirmed signal was dropped" + fail=1 + fi +done + +# --- Negative control: prove the harness can FAIL --------------------------- +echo "" +echo "Negative control — a golden with one impossible signal MUST fail parity" +ng_wav="$REPO_ROOT/samples/FT8/210703_133430.wav" +ng_src="$REPO_ROOT/test/fixtures/ft8_210703_133430.expected.txt" +if [[ -f "$ng_wav" && -f "$ng_src" ]]; then + tmp="$(mktemp)" + trap 'rm -f "$tmp"' EXIT + cat "$ng_src" > "$tmp" + # A syntactically valid WSJT-X decode line whose message this audio can + # never produce. The parser must report it as a dropped (MISSING) signal. + printf '133430 -5 0.0 1500 ~ ZZ9ZZZ NOTREAL XX99\n' >> "$tmp" + if python3 "$HARNESS" "$JT9" "$ng_wav" --mode FT8 --parity "$tmp" >/dev/null 2>&1; then + echo " FAIL: harness reported parity OK on a golden with an impossible signal (cannot discriminate)" + fail=1 + else + echo " PASS: harness correctly flagged the impossible signal as dropped" + fi + rm -f "$tmp" + trap - EXIT + + # An empty/truncated golden must NOT pass vacuously (0 signals ⊆ anything is + # trivially true). The harness must fail it loudly so a corrupt baseline is + # caught rather than masking future regressions. + echo "" + echo "Negative control 2 — an EMPTY golden MUST fail parity (no vacuous pass)" + empty="$(mktemp)" + trap 'rm -f "$empty"' EXIT + : > "$empty" # zero-byte golden + if python3 "$HARNESS" "$JT9" "$ng_wav" --mode FT8 --parity "$empty" >/dev/null 2>&1; then + echo " FAIL: harness reported parity OK on an empty golden (vacuous pass)" + fail=1 + else + echo " PASS: harness correctly rejected the empty golden" + fi + rm -f "$empty" + trap - EXIT +else + echo " SKIP: FT8 sample/golden not present for the negative control" +fi + +echo "" +if [[ "$fail" -eq 0 ]]; then + echo "All stream-vs-WAV parity checks passed." +else + echo "One or more stream-vs-WAV parity checks FAILED." + exit 1 +fi diff --git a/test/run-streaming-fixtures-no-configure.sh b/test/run-streaming-fixtures-no-configure.sh new file mode 100755 index 00000000..318d8131 --- /dev/null +++ b/test/run-streaming-fixtures-no-configure.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash +# Streaming-fixture regression harness — no-configure-frame variant. +# +# Exercises the CLI-arg threading path through init_default_params. +# Sends WSJT header + audio frames + halt to jt9 --stream +# WITHOUT a configure frame; jt9 reads its decode parameters from the +# CLI flags supplied to the binary directly. +# +# Earlier, streaming_io.f90's bulk init silently overrode CLI-supplied +# values like -F (ntol), -f (rxfreq), -L (flow), -H (fhigh), -d (ndepth) +# with FT8-baseline hardcoded defaults. A jt9 invocation without a +# configure frame produced 0 decodes for any non-default CLI args — the +# CLI args were lost. This harness locks in the fix. +# +# Usage: +# test/run-streaming-fixtures-no-configure.sh [build-dir] + +set -euo pipefail + +BUILD_DIR="${1:-build}" +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +JT9="$REPO_ROOT/$BUILD_DIR/jt9" +HARNESS="$REPO_ROOT/test/wav_to_stream_no_configure.py" + +if [[ ! -x "$JT9" ]]; then + echo "ERROR: jt9 binary not found or not executable: $JT9" >&2 + exit 2 +fi +if [[ ! -f "$HARNESS" ]]; then + echo "ERROR: harness not found: $HARNESS" >&2 + exit 2 +fi + +echo "Streaming-fixture regression (no-configure-frame variant)" +echo " jt9: $JT9" +echo " harness: $HARNESS" + +fail=0 + +# Format: +# CLI flags supplied: -F 1000 (ntol), -f 1500 (rxfreq), -L 200 (flow), +# -H 3000 (fhigh), -d 1 (ndepth) — values that would otherwise come from +# a configure frame. Targets the same FT8/JT9 fixtures used by the +# configure-frame harness so the two suites' decode-count expectations +# can be compared directly. +fixtures=( + "samples/FT8/210703_133430.wav -8 14" + "samples/JT9/130418_1742.wav -9 6" +) + +for entry in "${fixtures[@]}"; do + read -r wav mode_flag min_count <<< "$entry" + wav_path="$REPO_ROOT/$wav" + if [[ ! -f "$wav_path" ]]; then + echo " SKIP: $wav (sample not present)" + continue + fi + + count=$(python3 "$HARNESS" "$JT9" "$wav_path" \ + --mode-flag "$mode_flag" \ + --ntol 1000 --nrxfreq 1500 --flow 200 --fhigh 3000 --ndepth 1 \ + --quiet 2>/dev/null \ + | grep -c '"t":"decode"' || true) + if [[ "$count" -ge "$min_count" ]]; then + echo " PASS: $wav ($mode_flag, $count decodes >= $min_count)" + else + echo " FAIL: $wav ($mode_flag, $count decodes < $min_count expected)" + fail=1 + fi +done + +if [[ "$fail" -eq 0 ]]; then + echo "All no-configure streaming fixtures passed." +else + echo "One or more no-configure streaming fixtures regressed." + exit 1 +fi diff --git a/test/run-streaming-fixtures.sh b/test/run-streaming-fixtures.sh new file mode 100755 index 00000000..bd60987f --- /dev/null +++ b/test/run-streaming-fixtures.sh @@ -0,0 +1,114 @@ +#!/usr/bin/env bash +# Streaming-fixture regression harness (cross-mode validation). +# +# Pipes the same WAV fixtures used by run-golden-fixtures.sh through +# `jt9 --stream` via test/wav_to_stream_harness.py and asserts that the +# streaming-mode decode count meets or exceeds the WAV-mode ground truth. +# +# Streaming may produce MORE decodes than WAV mode (the early-pass +# nzhsym=41/47 calls can find low-SNR signals; not a regression). What we +# guard against is the "zero decodes" regression: any combination of +# params/protocol bugs that silences the FT8 decoder under --stream. +# +# Usage: +# test/run-streaming-fixtures.sh [build-dir] +# +# Where build-dir defaults to ./build and must contain a built jt9 binary. + +set -euo pipefail + +BUILD_DIR="${1:-build}" +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +JT9="$REPO_ROOT/$BUILD_DIR/jt9" +HARNESS="$REPO_ROOT/test/wav_to_stream_harness.py" + +if [[ ! -x "$JT9" ]]; then + echo "ERROR: jt9 binary not found or not executable: $JT9" >&2 + exit 2 +fi +if [[ ! -f "$HARNESS" ]]; then + echo "ERROR: harness not found: $HARNESS" >&2 + exit 2 +fi + +echo "Streaming-fixture regression" +echo " jt9: $JT9" +echo " harness: $HARNESS" + +fail=0 + +# Format: +# +# Floors are set conservatively below WAV-mode ground truth to absorb +# small streaming/WAV variance (per file header). FT8 fixture: 14 +# (streaming finds 21+; WAV finds 14). JT9: 6 (matches WAV). FT4: +# 14 (WAV=16, streaming=16). MSK144: +# 1 (WAV=1, streaming=1; the sample contains exactly one ping. The +# 181211_120800 sibling is a fallback if 181211_120500 ever produces 0). +# FST4: 2 (WAV=2, streaming=2; the 60s sample at +# 210115_0058 contains 'CQ K9KFR EN71' + 'CQ N5TM EL29'). +# JT65 deliberately omitted — the JT65B capture +# samples/JT65/JT65B/000000_0001.wav decodes a -25 dB signal at JT65's +# ~-24 dB sensitivity floor. It is one of the upstream cad95e65c "test +# files for JT65 averaging, AP, and DS decodes" -- a weak-signal +# sequence. A probe of all 8 JT65B samples through this harness +# found ONLY 0001 decodes at all (others 0/6), and 0001 only on a +# quiescent box; the one non-averaging sample (DL7UAE) is 8-bit/11025 Hz +# which --stream hard-rejects (needs 16-bit/12 kHz), so no margin-clearing +# JT65 sample is available to swap in. On the single-pass streaming +# path (no WAV multi-pass threshold relaxation, jt65_decode.f90:122-145) +# the candidate sits on KVASD's dual accept gate (extract.f90:176), so a +# floor=1 HARD assertion is nondeterministic: ~50/50 quiescent, 0 under +# concurrent build/workflow churn. It turned CI RED on its first +# Linux-CI exposure: ubuntu-22.04 sampled 0, macos-14 sampled 1. +# Upstream itself gates NO JT65 decode (its tests/ are C++/Qt unit tests; +# the JT65B WAVs ship for manual GUI use only). nmode=65 dispatch/parse/ +# apply coverage is retained via run-schema-v1-fixtures.sh (--mode JT65), +# the Phase-5 parse-unit, and the apply-routing unit; map65d JT65 wiring +# via run-eme-jt65-fixtures.sh. Same posture as FST4W below; replace-with- +# margin-sample and soft-gate were the rejected alternatives. +# Q65: 1 floor (streaming=4). 60s Q65-A sample; EME-sourced but +# decoded through the TERRESTRIAL jt9 --stream nmode=66 path (NOT map65d) — +# exactly the path an external streaming producer exercises. Closes the +# residual per-mode gap (FT4/MSK144/FST4 were closed earlier). +# +# FST4W deliberately omitted — the only available FST4W sample +# (samples/FST4+FST4W/201230_0300.wav, "FST4W-1800" per commit 97dce3aa7) +# does not decode under jt9 -W with any standard period (120/300/900/ +# 1800s) on this build. Streaming-dispatch wiring still verified via +# the FST4W mode_string_to_int mapping (lib/streaming_control.f90:209) +# and TRperiod auto-default (streaming_io.f90:370 case default 60s); +# what's missing is a known-good FST4W decoder fixture. +fixtures=( + "samples/FT8/210703_133430.wav FT8 14" + "samples/JT9/130418_1742.wav JT9 6" + "samples/FT4/000000_000002.wav FT4 14" + "samples/MSK144/181211_120500.wav MSK144 1" + "samples/FST4+FST4W/210115_0058.wav FST4 2" + "samples/Q65/60A_EME_6m/210106_1621.wav Q65 1" +) + +for entry in "${fixtures[@]}"; do + read -r wav mode min_count <<< "$entry" + wav_path="$REPO_ROOT/$wav" + if [[ ! -f "$wav_path" ]]; then + echo " SKIP: $wav (sample not present)" + continue + fi + + count=$(python3 "$HARNESS" "$JT9" "$wav_path" --mode "$mode" --quiet 2>/dev/null \ + | grep -c '"t":"decode"' || true) + if [[ "$count" -ge "$min_count" ]]; then + echo " PASS: $wav ($mode, $count decodes >= $min_count)" + else + echo " FAIL: $wav ($mode, $count decodes < $min_count expected)" + fail=1 + fi +done + +if [[ "$fail" -eq 0 ]]; then + echo "All streaming fixtures passed." +else + echo "One or more streaming fixtures regressed." + exit 1 +fi diff --git a/test/run-wsjtx-startup-macos.sh b/test/run-wsjtx-startup-macos.sh new file mode 100755 index 00000000..3263efcb --- /dev/null +++ b/test/run-wsjtx-startup-macos.sh @@ -0,0 +1,131 @@ +#!/usr/bin/env bash +set -u + +readonly DEFAULT_TIMEOUT_SECS=15 +readonly SAMPLE_DURATION_SECS=3 +readonly SAMPLE_INTERVAL_MSECS=10 + +diagnostics_dir="${1:?usage: run-wsjtx-startup-macos.sh [args...]}" +shift +executable="${1:?usage: run-wsjtx-startup-macos.sh [args...]}" +timeout_secs="${WSJTX_STARTUP_SMOKE_TIMEOUT_SECS:-$DEFAULT_TIMEOUT_SECS}" + +case "$timeout_secs" in + ''|*[!0-9]*) + echo "startup smoke: timeout must be a positive integer: $timeout_secs" + exit 2 + ;; +esac +if [ "$timeout_secs" -eq 0 ]; then + echo "startup smoke: timeout must be greater than zero" + exit 2 +fi +if [ ! -x "$executable" ]; then + echo "startup smoke: executable not found or not executable: $executable" + exit 2 +fi + +if ! mkdir -p "$diagnostics_dir"; then + echo "startup smoke: unable to create diagnostics directory: $diagnostics_dir" + exit 2 +fi +output_log="$diagnostics_dir/startup-smoke.log" +summary="$diagnostics_dir/diagnostic-summary.txt" +sample_log="$diagnostics_dir/hang-sample.txt" +sample_command_log="$diagnostics_dir/sample-command.log" +launch_marker="$diagnostics_dir/launch-start.marker" +: >"$output_log" +: >"$launch_marker" + +copy_new_crash_reports () +{ + if [ -z "${HOME:-}" ]; then + return + fi + report_dir="$HOME/Library/Logs/DiagnosticReports" + if [ ! -d "$report_dir" ]; then + return + fi + for report in \ + "$report_dir"/wsjtx*.ips \ + "$report_dir"/wsjtx*.crash \ + "$report_dir"/WSJT-X*.ips \ + "$report_dir"/WSJT-X*.crash + do + if [ -e "$report" ] && [ "$report" -nt "$launch_marker" ]; then + cp "$report" "$diagnostics_dir/" + fi + done +} + +print_failure_diagnostics () +{ + echo "----- diagnostic summary -----" + cat "$summary" 2>/dev/null || true + echo "----- startup smoke output -----" + cat "$output_log" 2>/dev/null || true + if [ -s "$sample_command_log" ]; then + echo "----- sample command output -----" + cat "$sample_command_log" + fi +} + +echo "startup smoke: $executable ${*:2}" +"$@" >"$output_log" 2>&1 & +test_pid=$! +start_time=$SECONDS +timed_out=false + +while kill -0 "$test_pid" 2>/dev/null; do + if [ $((SECONDS - start_time)) -ge "$timeout_secs" ]; then + timed_out=true + break + fi + sleep 0.25 +done + +if [ "$timed_out" = true ]; then + { + echo "result=timeout" + echo "pid=$test_pid" + echo "timeout_seconds=$timeout_secs" + echo "executable=$executable" + } >"$summary" + /usr/bin/sample "$test_pid" "$SAMPLE_DURATION_SECS" "$SAMPLE_INTERVAL_MSECS" \ + -mayDie -file "$sample_log" >"$sample_command_log" 2>&1 || true + kill -TERM "$test_pid" 2>/dev/null || true + terminate_attempts=0 + while [ "$terminate_attempts" -lt 8 ]; do + if ! kill -0 "$test_pid" 2>/dev/null; then + break + fi + sleep 0.25 + terminate_attempts=$((terminate_attempts + 1)) + done + if kill -0 "$test_pid" 2>/dev/null; then + kill -KILL "$test_pid" 2>/dev/null || true + fi + wait "$test_pid" 2>/dev/null || true + copy_new_crash_reports + print_failure_diagnostics + exit 124 +fi + +wait "$test_pid" +status=$? +if [ "$status" -ne 0 ]; then + sleep 2 + copy_new_crash_reports + { + echo "result=exit" + echo "pid=$test_pid" + echo "exit_status=$status" + echo "executable=$executable" + } >"$summary" + print_failure_diagnostics + exit "$status" +fi + +cat "$output_log" +rm -f "$output_log" "$launch_marker" +exit 0 diff --git a/test/run-wsprd-streaming-fixtures.sh b/test/run-wsprd-streaming-fixtures.sh new file mode 100755 index 00000000..6b96d3c3 --- /dev/null +++ b/test/run-wsprd-streaming-fixtures.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +# wsprd streaming-fixture regression harness. +# +# Pipes the same WSPR fixture used by file-mode through `wsprd -0` +# (streaming mode) via test/wav_to_wsprd_stream_harness.py and asserts +# that the streaming-mode decode count meets or exceeds the file-mode +# ground truth. +# +# Usage: +# test/run-wsprd-streaming-fixtures.sh [build-dir] + +set -euo pipefail + +BUILD_DIR="${1:-build}" +REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" +WSPRD="$REPO_ROOT/$BUILD_DIR/wsprd" +HARNESS="$REPO_ROOT/test/wav_to_wsprd_stream_harness.py" + +if [[ ! -x "$WSPRD" ]]; then + echo "ERROR: wsprd binary not found or not executable: $WSPRD" >&2 + exit 2 +fi +if [[ ! -f "$HARNESS" ]]; then + echo "ERROR: harness not found: $HARNESS" >&2 + exit 2 +fi + +echo "wsprd streaming-fixture regression" +echo " wsprd: $WSPRD" +echo " harness: $HARNESS" + +fail=0 + +# Format: +fixtures=( + "samples/WSPR/150426_0918.wav 14.0956 2 9" +) + +for entry in "${fixtures[@]}"; do + read -r wav dialfreq wspr_type min_count <<< "$entry" + wav_path="$REPO_ROOT/$wav" + if [[ ! -f "$wav_path" ]]; then + echo " SKIP: $wav (sample not present)" + continue + fi + + count=$(python3 "$HARNESS" "$WSPRD" "$wav_path" \ + --dialfreq "$dialfreq" --wspr-type "$wspr_type" \ + --quiet 2>/dev/null \ + | grep -c '"t":"decode"' || true) + if [[ "$count" -ge "$min_count" ]]; then + echo " PASS: $wav (WSPR-$wspr_type, $count decodes >= $min_count)" + else + echo " FAIL: $wav (WSPR-$wspr_type, $count decodes < $min_count expected)" + fail=1 + fi +done + +if [[ "$fail" -eq 0 ]]; then + echo "All wsprd streaming fixtures passed." +else + echo "One or more wsprd streaming fixtures regressed." + exit 1 +fi diff --git a/test/wav_to_stream_harness.py b/test/wav_to_stream_harness.py new file mode 100755 index 00000000..99cc0f28 --- /dev/null +++ b/test/wav_to_stream_harness.py @@ -0,0 +1,966 @@ +#!/usr/bin/env python3 +""" +wav-to-stream validation harness. + +Pipes a 12 kHz mono int16 WAV file through `jt9 --stream` using the +streaming protocol, then prints the resulting NDJSON decodes. +Used to verify that streaming-mode decode results match the WAV-mode +ground truth (cross-mode validation). + +Usage: + test/wav_to_stream_harness.py [--mode FT8] + +Exit code is jt9's exit code. NDJSON lines are written to stdout, one +per `{"v":1,"t":"...",...}` event from jt9. Diagnostic stderr from jt9 +is merged into stdout (consumers MUST drain stderr; this harness uses +redirect_error_stream=true). +""" +from __future__ import annotations + +import argparse +import json +import struct +import subprocess +import sys +import wave +from pathlib import Path + +# Frame-type bytes (matching streaming_io.f90). +FRAME_AUDIO = 0x01 +FRAME_CONTROL = 0x02 + +# Audio chunk size in 12 kHz samples per frame. ~1 s per frame keeps the +# protocol's audio-doesn't-span-period gotcha trivially satisfied. +CHUNK_SAMPLES = 12000 + + +def wsjt_session_header(rate_khz: int = 12) -> bytes: + """8-byte WSJT session header: magic + fmt + channels + rate_kHz LE u16.""" + return b"WSJT" + bytes([0, 1]) + struct.pack(" bytes: + """[type:1][len:4 LE][body:len]""" + return bytes([type_byte]) + struct.pack(" + # omit the key from the frame (so they default to no-op on the fixtures). + his_call: str | None = None, + his_grid: str | None = None, + my_b_call: str | None = None, + his_b_call: str | None = None, + my_call_standard: bool | None = None, + his_call_standard: bool | None = None, + tx_audio_offset_hz: int | None = None, + jt65_jt9_split_hz: int | None = None, + max_drift_hz: int | None = None, + bad_phase4: bool = False, + # Phase 5: decoder-tuning basic fields. None => omit (no-op). + dt_tolerance_seconds: float | None = None, + eme_delay_seconds: float | None = None, + kin_samples: int | None = None, + nzhsym_per_period: int | None = None, + npts_c0_array: int | None = None, + min_width: int | None = None, + min_sync: int | None = None, + n_2pass: int | None = None, + robust_mode: bool | None = None, + nagain_flag: bool | None = None, + tx_mode: str | None = None, + clear_average: bool | None = None, + bad_phase5: bool = False, + # Phase 6: FT8/FT4 specifics cluster. None => omit (no-op). + multithreaded_ft8: bool | None = None, + ft8_cycles: int | None = None, + ft8_rxf_sensitivity: int | None = None, + ft8_threads: int | None = None, + ft8_decoder_start: int | None = None, + ft8_low_threshold: bool | None = None, + ft8_subpass: bool | None = None, + ft8_ap_on: bool | None = None, + ap_cq_only: bool | None = None, + ap_my_call: bool | None = None, + jt65_ap_on: bool | None = None, + ap_width_hz: int | None = None, + hide_ft8_duplicates: bool | None = None, + common_ft8b: bool | None = None, + enable_dxc_search: bool | None = None, + wide_dxc_search: bool | None = None, + superfox_mode: bool | None = None, + even_sequence: bool | None = None, + hound_mode: bool | None = None, + multi_instance: bool | None = None, + skip_tx1: bool | None = None, + nagain_filter: bool | None = None, + stop_hint: bool | None = None, + hint_mode: bool | None = None, + bad_phase6: bool = False, + # Phase 7: diagnostic / sequencing fields. None => omit (no-op). + last_tx_seconds_ago: int | None = None, + currently_txing: bool | None = None, + mode_changed: bool | None = None, + qso_progress_state: int | None = None, + sec_band_changed: int | None = None, + delay_units: int | None = None, + bad_phase7: bool = False, + # Phase 8: string & scaled / derived fields. None => omit. + utc: str | None = None, + date: str | None = None, + n_trials: int | None = None, + candthin_threshold: float | None = None, + dt_center_seconds: float | None = None, + # Phase 9: bit-packed fields. None => omit. + # Sending ANY ndepth-unpacked key auto-drops the legacy `depth` key + # (precedence — a frame carrying both is a configure_type_error conflict). + depth_level: int | None = None, + q65_maxiters_level: int | None = None, + use_averaging: bool | None = None, + deep_ap_search: bool | None = None, + q65_auto_clear_average: bool | None = None, + contest_type: str | None = None, + single_decode: bool | None = None, + vhf_features: bool | None = None, + noise_blanker_level: int | None = None, + bad_phase9: bool = False, + phase9_conflict: bool = False, +) -> bytes: + payload: dict = { + "t": "configure", + "mode": mode, + "depth": depth, + "mycall": mycall, + "mygrid": mygrid, + } + if omit_mygrid: + # Drop mygrid so a mycall value equal to the literal token "mygrid" has + # no real mygrid key to anchor to — exercises the value-vs-key aliasing + # regression guard. + payload.pop("mygrid", None) + if bad_depth: + # Wrong JSON type for an int key: depth as a string. Exercises the + # configure_type_error / atomic-decline path. + payload["depth"] = "abc" + if version is not None: + payload["version"] = version + if ntol is not None: + payload["ntol"] = ntol + if nfa is not None: + payload["nfa"] = nfa + if nfb is not None: + payload["nfb"] = nfb + if nutc is not None: + payload["nutc"] = nutc + # Phase 4 keys (omitted when None so they don't perturb the default frame). + if his_call is not None: + payload["his_call"] = his_call + if his_grid is not None: + payload["his_grid"] = his_grid + if my_b_call is not None: + payload["my_b_call"] = my_b_call + if his_b_call is not None: + payload["his_b_call"] = his_b_call + if my_call_standard is not None: + payload["my_call_standard"] = my_call_standard + if his_call_standard is not None: + payload["his_call_standard"] = his_call_standard + if tx_audio_offset_hz is not None: + payload["tx_audio_offset_hz"] = tx_audio_offset_hz + if jt65_jt9_split_hz is not None: + payload["jt65_jt9_split_hz"] = jt65_jt9_split_hz + if max_drift_hz is not None: + payload["max_drift_hz"] = max_drift_hz + if bad_phase4: + # Wrong JSON type for a Phase 4 BOOLEAN key: my_call_standard as a + # number. Exercises the configure_type_error / atomic-decline path for + # a Phase 4 key (mirrors --bad-type's depth-as-string for an int key). + # Placed last so it overrides any my_call_standard set above. + payload["my_call_standard"] = 5 + # Phase 5 keys (omitted when None so they don't perturb the default frame). + if dt_tolerance_seconds is not None: + payload["dt_tolerance_seconds"] = dt_tolerance_seconds + if eme_delay_seconds is not None: + payload["eme_delay_seconds"] = eme_delay_seconds + if kin_samples is not None: + payload["kin_samples"] = kin_samples + if nzhsym_per_period is not None: + payload["nzhsym_per_period"] = nzhsym_per_period + if npts_c0_array is not None: + payload["npts_c0_array"] = npts_c0_array + if min_width is not None: + payload["min_width"] = min_width + if min_sync is not None: + payload["min_sync"] = min_sync + if n_2pass is not None: + payload["n_2pass"] = n_2pass + if robust_mode is not None: + payload["robust_mode"] = robust_mode + if nagain_flag is not None: + payload["nagain_flag"] = nagain_flag + if tx_mode is not None: + payload["tx_mode"] = tx_mode + if clear_average is not None: + payload["clear_average"] = clear_average + if bad_phase5: + # Wrong JSON type for a Phase 5 REAL key: dt_tolerance_seconds as a + # string. Exercises the configure_type_error / atomic-decline path for a + # Phase 5 key. Placed last so it overrides any value set above. + payload["dt_tolerance_seconds"] = "abc" + # Phase 6 keys (omitted when None so they don't perturb the default frame). + if multithreaded_ft8 is not None: + payload["multithreaded_ft8"] = multithreaded_ft8 + if ft8_cycles is not None: + payload["ft8_cycles"] = ft8_cycles + if ft8_rxf_sensitivity is not None: + payload["ft8_rxf_sensitivity"] = ft8_rxf_sensitivity + if ft8_threads is not None: + payload["ft8_threads"] = ft8_threads + if ft8_decoder_start is not None: + payload["ft8_decoder_start"] = ft8_decoder_start + if ft8_low_threshold is not None: + payload["ft8_low_threshold"] = ft8_low_threshold + if ft8_subpass is not None: + payload["ft8_subpass"] = ft8_subpass + if ft8_ap_on is not None: + payload["ft8_ap_on"] = ft8_ap_on + if ap_cq_only is not None: + payload["ap_cq_only"] = ap_cq_only + if ap_my_call is not None: + payload["ap_my_call"] = ap_my_call + if jt65_ap_on is not None: + payload["jt65_ap_on"] = jt65_ap_on + if ap_width_hz is not None: + payload["ap_width_hz"] = ap_width_hz + if hide_ft8_duplicates is not None: + payload["hide_ft8_duplicates"] = hide_ft8_duplicates + if common_ft8b is not None: + payload["common_ft8b"] = common_ft8b + if enable_dxc_search is not None: + payload["enable_dxc_search"] = enable_dxc_search + if wide_dxc_search is not None: + payload["wide_dxc_search"] = wide_dxc_search + if superfox_mode is not None: + payload["superfox_mode"] = superfox_mode + if even_sequence is not None: + payload["even_sequence"] = even_sequence + if hound_mode is not None: + payload["hound_mode"] = hound_mode + if multi_instance is not None: + payload["multi_instance"] = multi_instance + if skip_tx1 is not None: + payload["skip_tx1"] = skip_tx1 + if nagain_filter is not None: + payload["nagain_filter"] = nagain_filter + if stop_hint is not None: + payload["stop_hint"] = stop_hint + if hint_mode is not None: + payload["hint_mode"] = hint_mode + if bad_phase6: + # Wrong JSON type for a Phase 6 BOOLEAN key: ft8_ap_on as a number. + # Exercises the configure_type_error / atomic-decline path for a Phase 6 + # key. Placed last so it overrides any ft8_ap_on set above. + payload["ft8_ap_on"] = 5 + # Phase 7 keys (omitted when None so they don't perturb the default frame). + if last_tx_seconds_ago is not None: + payload["last_tx_seconds_ago"] = last_tx_seconds_ago + if currently_txing is not None: + payload["currently_txing"] = currently_txing + if mode_changed is not None: + payload["mode_changed"] = mode_changed + if qso_progress_state is not None: + payload["qso_progress_state"] = qso_progress_state + if sec_band_changed is not None: + payload["sec_band_changed"] = sec_band_changed + if delay_units is not None: + payload["delay_units"] = delay_units + if bad_phase7: + # Wrong JSON type for a Phase 7 INT key: last_tx_seconds_ago as a string. + # Exercises the configure_type_error / atomic-decline path for a Phase 7 + # key (expected:"int" got:"string"). Placed last so it overrides any + # last_tx_seconds_ago set above. + payload["last_tx_seconds_ago"] = "soon" + # Phase 8 keys (omitted when None so they don't perturb the default frame). + # utc/date are ISO strings; n_trials is a plain int the receiver encodes to + # nranera; candthin_threshold/dt_center_seconds are floats scaled /100. + if utc is not None: + payload["utc"] = utc + if date is not None: + payload["date"] = date + if n_trials is not None: + payload["n_trials"] = n_trials + if candthin_threshold is not None: + payload["candthin_threshold"] = candthin_threshold + if dt_center_seconds is not None: + payload["dt_center_seconds"] = dt_center_seconds + # Phase 9 keys (omitted when None so they don't perturb the default frame). + # ndepth group: sending any of these drops the legacy `depth` key (the receiver + # declines a frame carrying BOTH the full-int depth and an unpacked ndepth key — + # conflicting encodings). This mirrors a real producer sending one encoding form. + ndepth_keys = { + "depth_level": depth_level, + "q65_maxiters_level": q65_maxiters_level, + "use_averaging": use_averaging, + "deep_ap_search": deep_ap_search, + "q65_auto_clear_average": q65_auto_clear_average, + } + if any(v is not None for v in ndepth_keys.values()): + payload.pop("depth", None) + for k, v in ndepth_keys.items(): + if v is not None: + payload[k] = v + # nexp_decode group (contest_type / single_decode / vhf_features / noise_blanker). + if contest_type is not None: + payload["contest_type"] = contest_type + if single_decode is not None: + payload["single_decode"] = single_decode + if vhf_features is not None: + payload["vhf_features"] = vhf_features + if noise_blanker_level is not None: + payload["noise_blanker_level"] = noise_blanker_level + if bad_phase9: + # Wrong JSON type for a Phase 9 INT key: depth_level as a string. Drop the + # legacy depth so the only error is the depth_level type mismatch (exercises + # the configure_type_error / atomic-decline path for a Phase 9 key). + payload.pop("depth", None) + payload["depth_level"] = "deep" + if phase9_conflict: + # Co-present legacy depth (full int) + unpacked depth_level -> the receiver + # declines the frame (conflicting encodings). Force BOTH present + # (the unpacked block above would otherwise have dropped depth). + payload["depth"] = depth + payload["depth_level"] = 1 + return json.dumps(payload, separators=(",", ":")).encode("utf-8") + + +def halt_json() -> bytes: + return b'{"t":"halt"}' + + +# --- Stream-vs-WAV parity --------------------------------------------------- +# +# Identity is the decoded MESSAGE text. Empirically the snr/dt/freq fields +# drift between the WAV and stream decode paths for the SAME signal (snr +# ±2 dB, dt ±0.05 s, freq ±3 Hz on the FT8/JT9 fixtures) because the early +# nzhsym streaming passes compute slightly different fine estimates than the +# full-period WAV decode. So they are reported as diagnostics, never asserted; +# the message text is the only exactly-stable field and is the parity identity. + +# WSJT-X decode-line sync indicators (column 5), stripped before the message. +_SYNC_MARKERS = {"~", "@", "&", "+", "*", "#", "$", "`"} + + +def _norm_msg(s: str) -> str: + """Collapse runs of whitespace to single spaces and strip ends, so a + right-padded WAV text message and a trimmed NDJSON message compare equal.""" + return " ".join(s.split()) + + +def parse_wav_golden(path: Path) -> list[dict]: + """Parse a WSJT-X jt9 text decode file (test/fixtures/*.expected.txt). + + Line format: HHMMSS SNR DT FREQ MESSAGE + The trailer and blank lines are skipped. Returns a + list of {"snr": int, "dt": float, "freq": int, "message": str}. + """ + out: list[dict] = [] + for raw in path.read_text().splitlines(): + if not raw.strip(): + continue + if raw.lstrip().startswith("<"): # trailer + continue + tok = raw.split() + if len(tok) < 5: + continue + try: + snr = int(tok[1]) + dt = float(tok[2]) + freq = int(tok[3]) + except ValueError: + # Not a decode row (e.g. an unexpected header) — skip defensively. + continue + rest = tok[4:] + if rest and rest[0] in _SYNC_MARKERS: + rest = rest[1:] + out.append({ + "snr": snr, + "dt": dt, + "freq": freq, + "message": _norm_msg(" ".join(rest)), + }) + return out + + +def parse_stream_decodes(lines: list[str]) -> list[dict]: + """Pull the decode payload (snr/dt/freq/message) from each + {"t":"decode",...} NDJSON line, ignoring all other events and any + non-JSON diagnostic lines merged from stderr.""" + out: list[dict] = [] + for line in lines: + s = line.strip() + if not s.startswith("{"): + continue + try: + obj = json.loads(s) + except json.JSONDecodeError: + continue + if obj.get("t") != "decode": + continue + out.append({ + "snr": obj.get("snr"), + "dt": obj.get("dt"), + "freq": obj.get("freq"), + # `or ""` (not a get-default): an explicit "message":null sets the + # key, so get("message","") would return None and crash _norm_msg. + "message": _norm_msg(obj.get("message") or ""), + }) + return out + + +def run_parity(golden_path: Path, stream_lines: list[str], jt9_rc: int, + label: str) -> int: + """Assert WAV-golden signals ⊆ stream decodes (by message). Print a + per-signal diagnostic table; return 0 if all present, 1 if any dropped.""" + golden = parse_wav_golden(golden_path) + stream = parse_stream_decodes(stream_lines) + + if not golden: + # A golden that parses to zero signals cannot anchor a containment + # check — "WAV signals ⊆ stream" is vacuously true. Fail loudly so a + # truncated / corrupt / empty baseline is caught, not silently passed. + print(f"stream-vs-WAV parity: {label}") + print(f" golden: {golden_path} (0 WAV-confirmed signals)") + print(f" stream: {len(stream)} decodes (jt9 rc={jt9_rc})") + print(" PARITY FAIL: golden has 0 signals — cannot verify containment " + "(empty / truncated / corrupt baseline).") + return 1 + + by_msg: dict[str, list[dict]] = {} + for d in stream: + by_msg.setdefault(d["message"], []).append(d) + + print(f"stream-vs-WAV parity: {label}") + print(f" golden: {golden_path} ({len(golden)} WAV-confirmed signals)") + print(f" stream: {len(stream)} decodes (jt9 rc={jt9_rc})") + print(" identity = message text (containment); dFreq/dSNR/dDT are drift " + "diagnostics, not asserted") + print(f" {'status':<8}{'message':<24}{'dFreq':>7}{'dSNR':>6}{'dDT':>7}") + + missing: list[dict] = [] + for g in golden: + cands = by_msg.get(g["message"]) + if not cands: + missing.append(g) + print(f" {'MISSING':<8}{g['message']:<24}{'-':>7}{'-':>6}{'-':>7}") + continue + # If a message somehow appears more than once, diagnose against the + # nearest-frequency stream decode. + best = min(cands, key=lambda d: abs((d["freq"] or 0) - g["freq"])) + d_freq = (best["freq"] or 0) - g["freq"] + d_snr = (best["snr"] if best["snr"] is not None else 0) - g["snr"] + d_dt = (best["dt"] if best["dt"] is not None else 0.0) - g["dt"] + # int() casts guard the :d format codes against a spec-drift float + # freq/snr in the NDJSON (jt9 emits both as integers today). + print(f" {'OK':<8}{g['message']:<24}" + f"{int(d_freq):>7d}{int(d_snr):>6d}{d_dt:>+7.2f}") + + present = len(golden) - len(missing) + print(f" result: {present}/{len(golden)} WAV signals present; " + f"{len(stream)} stream decodes " + f"({len(stream) - present} extra — streaming may legitimately find more)") + if missing: + print(f" PARITY FAIL: {len(missing)} WAV-confirmed signal(s) dropped " + f"by the stream:") + for g in missing: + print(f" - {g['message']!r} (WAV freq {g['freq']} Hz, snr {g['snr']})") + return 1 + print(" PARITY OK: every WAV-confirmed signal is present in the stream.") + return 0 + + +def main() -> int: + p = argparse.ArgumentParser() + p.add_argument("jt9", type=Path) + p.add_argument("wav", type=Path) + p.add_argument("--mode", default="FT8") + p.add_argument("--mycall", default="KJ5HST", + help="Callsign for the main configure frame. Set to a key " + "token (e.g. 'mygrid') with --omit-mygrid to exercise " + "the value-vs-key aliasing guard.") + p.add_argument("--omit-mygrid", action="store_true", + help="Omit the mygrid key from the main configure frame.") + p.add_argument("--ntol", type=int, default=1000) + p.add_argument("--nfa", type=int, default=200) + p.add_argument("--nfb", type=int, default=3000) + p.add_argument("--nutc", type=int, default=None, + help="UTC HHMMSS for the configure frame.") + p.add_argument("--schema-version", type=int, default=None, + help="Body schema version on the configure frame. " + "A version != 1 must be declined with unknown_schema_version.") + p.add_argument("--bad-control", action="store_true", + help="Also send a malformed control frame (missing the required " + "\"t\" field) to exercise the configure_parse_error path.") + p.add_argument("--bad-type", action="store_true", + help="Make the MAIN configure frame carry a wrong-typed key " + "(depth as a JSON string) to exercise the " + "configure_type_error / atomic-decline path. " + "Combine with --mode to verify a co-present good key " + "(e.g. mode) is NOT applied when the frame is declined.") + p.add_argument("--bad-type-preamble", action="store_true", + help="Send a wrong-typed configure frame BEFORE the valid main " + "configure to verify recovery: the bad frame is " + "declined with configure_type_error and the following valid " + "frame applies normally.") + # --- Phase 4: operator identity + frequency-window keys ------------------- + p.add_argument("--his-call", dest="his_call", default=None, + help="Phase 4: his_call (-> hiscall, char12).") + p.add_argument("--his-grid", dest="his_grid", default=None, + help="Phase 4: his_grid (-> hisgrid, char6).") + p.add_argument("--my-b-call", dest="my_b_call", default=None, + help="Phase 4: my_b_call (-> mybcall, char12).") + p.add_argument("--his-b-call", dest="his_b_call", default=None, + help="Phase 4: his_b_call (-> hisbcall, char12).") + p.add_argument("--my-call-standard", dest="my_call_standard", + action="store_true", default=None, + help="Phase 4: my_call_standard=true (-> lmycallstd).") + p.add_argument("--his-call-standard", dest="his_call_standard", + action="store_true", default=None, + help="Phase 4: his_call_standard=true (-> lhiscallstd).") + p.add_argument("--tx-audio-offset-hz", dest="tx_audio_offset_hz", type=int, + default=None, + help="Phase 4: tx_audio_offset_hz (-> nftx; decouples tx " + "from rxfreq, which sets both nfqso+nftx).") + p.add_argument("--jt65-jt9-split-hz", dest="jt65_jt9_split_hz", type=int, + default=None, help="Phase 4: jt65_jt9_split_hz (-> nfsplit).") + p.add_argument("--max-drift-hz", dest="max_drift_hz", type=int, default=None, + help="Phase 4: max_drift_hz (-> max_drift, Q65 drift search).") + p.add_argument("--bad-phase4", action="store_true", + help="Make the MAIN configure carry a wrong-typed Phase 4 key " + "(my_call_standard as a number) to exercise " + "configure_type_error / atomic-decline for a Phase 4 key.") + # Phase 5: decoder-tuning basic fields. None => omit the key. + p.add_argument("--dt-tolerance-seconds", dest="dt_tolerance_seconds", + type=float, default=None, + help="Phase 5: dt tolerance seconds (-> real(c_float) dttol).") + p.add_argument("--eme-delay-seconds", dest="eme_delay_seconds", + type=float, default=None, + help="Phase 5: EME delay seconds (-> real(c_float) emedelay; " + "D1 — overwritten by per-mode policy on a mode/tr frame).") + p.add_argument("--kin-samples", dest="kin_samples", type=int, default=None, + help="Phase 5: kin sample count (-> kin; recomputed per period).") + p.add_argument("--nzhsym-per-period", dest="nzhsym_per_period", type=int, + default=None, + help="Phase 5: nzhsym per period (-> nzhsym; recomputed per period).") + p.add_argument("--npts-c0-array", dest="npts_c0_array", type=int, default=None, + help="Phase 5: npts for the c0() array (-> npts8; JT9 decode).") + p.add_argument("--min-width", dest="min_width", type=int, default=None, + help="Phase 5: min width (-> minw).") + p.add_argument("--min-sync", dest="min_sync", type=int, default=None, + help="Phase 5: min sync (-> minsync).") + p.add_argument("--n-2pass", dest="n_2pass", type=int, default=None, + help="Phase 5: 2-pass count (-> n2pass).") + p.add_argument("--robust-mode", dest="robust_mode", action="store_true", + default=None, help="Phase 5: robust mode flag (-> nrobust).") + p.add_argument("--nagain-flag", dest="nagain_flag", action="store_true", + default=None, help="Phase 5: decode-again flag (-> nagain).") + p.add_argument("--tx-mode", dest="tx_mode", default=None, + help="Phase 5: tx mode enum JT9/JT65 or int 9/65 (-> ntxmode).") + p.add_argument("--clear-average", dest="clear_average", action="store_true", + default=None, help="Phase 5: clear-average flag (-> nclearave).") + p.add_argument("--bad-phase5", action="store_true", + help="Make the MAIN configure carry a wrong-typed Phase 5 key " + "(dt_tolerance_seconds as a string) to exercise " + "configure_type_error / atomic-decline for a Phase 5 key.") + # Phase 6: FT8/FT4 specifics cluster. None => omit the key. The + # bool flags are store_true/default=None (presence => true); --no-* variants + # send an explicit false where a gate needs it (ft8_ap_on defaults true). + p.add_argument("--multithreaded-ft8", dest="multithreaded_ft8", + action="store_true", default=None, + help="Phase 6: multithreaded_ft8=true (-> lmultift8; " + "receiver-ignored on the single-pass stream path).") + p.add_argument("--ft8-cycles", dest="ft8_cycles", type=int, default=None, + help="Phase 6: ft8_cycles (-> nft8cycles).") + p.add_argument("--ft8-rxf-sensitivity", dest="ft8_rxf_sensitivity", type=int, + default=None, help="Phase 6: ft8_rxf_sensitivity (-> nft8rxfsens).") + p.add_argument("--ft8-threads", dest="ft8_threads", type=int, default=None, + help="Phase 6: ft8_threads (-> nmt).") + p.add_argument("--ft8-decoder-start", dest="ft8_decoder_start", type=int, + default=None, help="Phase 6: ft8_decoder_start (-> ndecoderstart).") + p.add_argument("--ft8-low-threshold", dest="ft8_low_threshold", + action="store_true", default=None, + help="Phase 6: ft8_low_threshold=true (-> lft8lowth).") + p.add_argument("--ft8-subpass", dest="ft8_subpass", action="store_true", + default=None, help="Phase 6: ft8_subpass=true (-> lft8subpass).") + p.add_argument("--ft8-ap-on", dest="ft8_ap_on", action="store_true", + default=None, help="Phase 6: ft8_ap_on=true (-> lft8apon, AP on).") + p.add_argument("--no-ft8-ap-on", dest="ft8_ap_on", action="store_false", + help="Phase 6: ft8_ap_on=false (-> lft8apon; AP off — observable, " + "reduces FT8 decodes vs the default-true).") + p.add_argument("--ap-cq-only", dest="ap_cq_only", action="store_true", + default=None, help="Phase 6: ap_cq_only=true (-> lapcqonly).") + p.add_argument("--ap-my-call", dest="ap_my_call", action="store_true", + default=None, help="Phase 6: ap_my_call=true (-> lapmyc).") + p.add_argument("--jt65-ap-on", dest="jt65_ap_on", action="store_true", + default=None, help="Phase 6: jt65_ap_on=true (-> ljt65apon).") + p.add_argument("--ap-width-hz", dest="ap_width_hz", type=int, default=None, + help="Phase 6: ap_width_hz (-> napwid, RAW; decoder halves it).") + p.add_argument("--hide-ft8-duplicates", dest="hide_ft8_duplicates", + action="store_true", default=None, + help="Phase 6: hide_ft8_duplicates=true (-> lhideft8dupes).") + p.add_argument("--common-ft8b", dest="common_ft8b", action="store_true", + default=None, help="Phase 6: common_ft8b=true (-> lcommonft8b).") + p.add_argument("--enable-dxc-search", dest="enable_dxc_search", + action="store_true", default=None, + help="Phase 6: enable_dxc_search=true (-> lenabledxcsearch).") + p.add_argument("--wide-dxc-search", dest="wide_dxc_search", + action="store_true", default=None, + help="Phase 6: wide_dxc_search=true (-> lwidedxcsearch).") + p.add_argument("--superfox-mode", dest="superfox_mode", action="store_true", + default=None, help="Phase 6: superfox_mode=true (-> b_superfox).") + p.add_argument("--even-sequence", dest="even_sequence", action="store_true", + default=None, help="Phase 6: even_sequence=true (-> b_even_seq).") + p.add_argument("--hound-mode", dest="hound_mode", action="store_true", + default=None, help="Phase 6: hound_mode=true (-> lhound).") + p.add_argument("--multi-instance", dest="multi_instance", action="store_true", + default=None, help="Phase 6: multi_instance=true (-> lmultinst).") + p.add_argument("--skip-tx1", dest="skip_tx1", action="store_true", + default=None, help="Phase 6: skip_tx1=true (-> lskiptx1).") + p.add_argument("--nagain-filter", dest="nagain_filter", action="store_true", + default=None, help="Phase 6: nagain_filter=true (-> nagainfil).") + p.add_argument("--stop-hint", dest="stop_hint", action="store_true", + default=None, help="Phase 6: stop_hint=true (-> nstophint).") + p.add_argument("--hint-mode", dest="hint_mode", action="store_true", + default=None, help="Phase 6: hint_mode=true (-> nhint).") + p.add_argument("--bad-phase6", action="store_true", + help="Make the MAIN configure carry a wrong-typed Phase 6 key " + "(ft8_ap_on as a number) to exercise " + "configure_type_error / atomic-decline for a Phase 6 key.") + # Phase 7: diagnostic / sequencing fields. None => omit the key. + # All 6 are inert on the FT8/JT9 stream fixtures (multithread-block-only / + # AP-only) — see lib/streaming_control.f90 Phase 7 comment. + p.add_argument("--last-tx-seconds-ago", dest="last_tx_seconds_ago", + type=int, default=None, + help="Phase 7: last_tx_seconds_ago (-> nlasttx).") + p.add_argument("--currently-txing", dest="currently_txing", + action="store_true", default=None, + help="Phase 7: currently_txing=true (-> ltxing).") + p.add_argument("--mode-changed", dest="mode_changed", + action="store_true", default=None, + help="Phase 7: mode_changed=true (-> lmodechanged).") + p.add_argument("--qso-progress-state", dest="qso_progress_state", + type=int, default=None, + help="Phase 7: qso_progress_state (-> nQSOProgress; steers AP " + "decode passes, inert without AP-only decodes). Apply " + "GUARDS the valid GUI range [0,5]; an out-of-range value is " + "ignored (it would crash the FT8 decoder's AP-array index).") + p.add_argument("--sec-band-changed", dest="sec_band_changed", + type=int, default=None, + help="Phase 7: sec_band_changed (-> nsecbandchanged; D3 inert, " + "multithread-block-only).") + p.add_argument("--delay-units", dest="delay_units", + type=int, default=None, + help="Phase 7: delay_units (-> ndelay; D3 inert, " + "multithread-block-only).") + p.add_argument("--bad-phase7", action="store_true", + help="Make the MAIN configure carry a wrong-typed Phase 7 key " + "(last_tx_seconds_ago as a string) to exercise " + "configure_type_error / atomic-decline for a Phase 7 key.") + # Phase 8: string & scaled / derived fields. None => omit. + p.add_argument("--utc", dest="utc", default=None, + help="Phase 8: utc ISO \"HH:MM:SS\" (-> nutc, full HHMMSS; " + "decode-observable in the time field; WINS over --nutc).") + p.add_argument("--date", dest="date", default=None, + help="Phase 8: date ISO \"YYYY-MM-DD\" (-> yymmdd; superfox-only, " + "inert on FT8/JT9). year>=2100 -> configure_type_error.") + p.add_argument("--n-trials", dest="n_trials", type=int, default=None, + help="Phase 8: n_trials (-> encoded nranera; JT65-only, inert on " + "FT8/JT9). Must be 10^N or 3*10^N else configure_type_error.") + p.add_argument("--candthin-threshold", dest="candthin_threshold", + type=float, default=None, + help="Phase 8: candthin_threshold (-> ncandthin = round(x*100)).") + p.add_argument("--dt-center-seconds", dest="dt_center_seconds", + type=float, default=None, + help="Phase 8: dt_center_seconds (-> ndtcenter = round(x*100)).") + # Phase 9: bit-packed fields. ndepth-group flags + # auto-drop the legacy --depth (precedence; co-present is a conflict error). + p.add_argument("--depth-level", dest="depth_level", type=int, default=None, + help="Phase 9: depth_level (ndepth bits 0-2). The one Phase-9 key " + "decode-observable on FT8/JT9 (depth_level=1 -> ndepth=1 " + "changes the FT8 pass structure). Drops the legacy depth key.") + p.add_argument("--q65-maxiters-level", dest="q65_maxiters_level", type=int, + default=None, + help="Phase 9: q65_maxiters_level (ndepth bits 0-1; Q65-only). " + "Must agree with depth_level's low 2 bits if both are set.") + p.add_argument("--use-averaging", dest="use_averaging", action="store_true", + default=None, + help="Phase 9: use_averaging (ndepth bit 4; Q65/JT65/JT4, inert FT8/JT9).") + p.add_argument("--deep-ap-search", dest="deep_ap_search", action="store_true", + default=None, + help="Phase 9: deep_ap_search (ndepth bit 5; JT4/JT65, inert FT8/JT9).") + p.add_argument("--q65-auto-clear-average", dest="q65_auto_clear_average", + action="store_true", default=None, + help="Phase 9: q65_auto_clear_average (ndepth bit 7; Q65, inert FT8/JT9).") + p.add_argument("--contest-type", dest="contest_type", default=None, + help="Phase 9: contest_type enum string -> ncontest (nexp_decode " + "bits 0-2; SpecOp 5/8/9 collapse to 1). Unknown -> silent skip.") + p.add_argument("--single-decode", dest="single_decode", action="store_true", + default=None, + help="Phase 9: single_decode (nexp_decode bit 5; FST4/JT65, not " + "the single-pass FT8 decoder).") + p.add_argument("--vhf-features", dest="vhf_features", action="store_true", + default=None, + help="Phase 9: vhf_features (nexp_decode bit 6; Q65/JT65, inert FT8/JT9).") + p.add_argument("--noise-blanker-level", dest="noise_blanker_level", type=int, + default=None, + help="Phase 9: noise_blanker_level (nexp_decode upper byte, +3 " + "offset; FST4-only, inert FT8/JT9).") + p.add_argument("--bad-phase9", action="store_true", + help="Make the MAIN configure carry a wrong-typed Phase 9 key " + "(depth_level as a string) to exercise the " + "configure_type_error / atomic-decline for a Phase 9 key.") + p.add_argument("--phase9-conflict", action="store_true", + help="Make the MAIN configure carry BOTH the legacy depth and the " + "unpacked depth_level (conflict) to exercise the " + "configure_type_error / atomic-decline on conflicting encodings.") + p.add_argument("--prepend-mode", default=None, + help="Send a configure with this mode FIRST (no audio), then " + "the main configure + audio. Used to test mode-change " + "semantics.") + p.add_argument("--prepend-with-explicit-narrowing", action="store_true", + help="When --prepend-mode is set, the prepended configure " + "also sets ntol/nfa/nfb to narrow values. Tests that " + "the subsequent main configure restores defaults.") + p.add_argument( + "--quiet", + action="store_true", + help="Suppress non-JSON stderr lines (e.g., TRACE, header-ok).", + ) + p.add_argument( + "--parity", + type=Path, + default=None, + help="Stream-vs-WAV decode-parity mode. Instead of " + "printing NDJSON, decode the WAV via --stream, parse the WSJT-X " + "text golden at this path, and assert CONTAINMENT: every " + "WAV-confirmed signal (by message text) is present in the stream. " + "Exit 0 if all present, 1 if any is dropped. snr/dt/freq are shown " + "as drift diagnostics only (they legitimately differ between the " + "WAV and stream decode paths); message text is the identity.", + ) + args = p.parse_args() + + if not args.jt9.is_file(): + print(f"ERROR: jt9 binary not found: {args.jt9}", file=sys.stderr) + return 2 + if not args.wav.is_file(): + print(f"ERROR: WAV file not found: {args.wav}", file=sys.stderr) + return 2 + if args.parity is not None and not args.parity.is_file(): + print(f"ERROR: parity golden not found: {args.parity}", file=sys.stderr) + return 2 + + with wave.open(str(args.wav)) as w: + if w.getnchannels() != 1: + print( + f"ERROR: WAV must be mono (got {w.getnchannels()} channels)", + file=sys.stderr, + ) + return 2 + if w.getsampwidth() != 2: + print( + f"ERROR: WAV must be 16-bit (got {w.getsampwidth()} byte samples)", + file=sys.stderr, + ) + return 2 + if w.getframerate() != 12000: + print( + f"ERROR: WAV must be 12 kHz (got {w.getframerate()} Hz)", + file=sys.stderr, + ) + return 2 + audio = w.readframes(w.getnframes()) + + proc = subprocess.Popen( + [str(args.jt9), "--stream"], + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, # mandatory: consumers must drain stderr + ) + + try: + proc.stdin.write(wsjt_session_header()) + + # Malformed control frame (missing "t") -> configure_parse_error. + # Sent before the normal configure; the stream must continue and decode. + if args.bad_control: + proc.stdin.write(frame(FRAME_CONTROL, b'{"mode":"FT8"}')) + + # Wrong-typed preamble frame -> configure_type_error, declined. + # Sent before the valid main configure; the stream must recover and the + # following valid frame must apply normally. + if args.bad_type_preamble: + proc.stdin.write(frame(FRAME_CONTROL, configure_json( + mode=args.mode, bad_depth=True, + ))) + + # Optional mode-change preamble (tests mode-change semantics). + if args.prepend_mode: + if args.prepend_with_explicit_narrowing: + proc.stdin.write(frame(FRAME_CONTROL, configure_json( + mode=args.prepend_mode, ntol=10, nfa=1400, nfb=1600, + ))) + else: + proc.stdin.write(frame(FRAME_CONTROL, configure_json( + mode=args.prepend_mode, + ntol=None, nfa=None, nfb=None, # rely on per-mode defaults + ))) + + # Main configure. When testing mode-change semantics, the bug being + # gated is "after a prior mode's state, the main configure with no + # ntol/nfa/nfb should reset to per-mode/baseline defaults." So pass + # None (omit fields) when prepending, to exercise the restore path. + # Phase 4 keys ride on the MAIN configure only (not the preambles). + phase4 = dict( + his_call=args.his_call, his_grid=args.his_grid, + my_b_call=args.my_b_call, his_b_call=args.his_b_call, + my_call_standard=args.my_call_standard, + his_call_standard=args.his_call_standard, + tx_audio_offset_hz=args.tx_audio_offset_hz, + jt65_jt9_split_hz=args.jt65_jt9_split_hz, + max_drift_hz=args.max_drift_hz, + bad_phase4=args.bad_phase4, + ) + # Phase 5 keys also ride on the MAIN configure only. + phase5 = dict( + dt_tolerance_seconds=args.dt_tolerance_seconds, + eme_delay_seconds=args.eme_delay_seconds, + kin_samples=args.kin_samples, + nzhsym_per_period=args.nzhsym_per_period, + npts_c0_array=args.npts_c0_array, + min_width=args.min_width, + min_sync=args.min_sync, + n_2pass=args.n_2pass, + robust_mode=args.robust_mode, + nagain_flag=args.nagain_flag, + tx_mode=args.tx_mode, + clear_average=args.clear_average, + bad_phase5=args.bad_phase5, + ) + # Phase 6 keys also ride on the MAIN configure only. + phase6 = dict( + multithreaded_ft8=args.multithreaded_ft8, + ft8_cycles=args.ft8_cycles, + ft8_rxf_sensitivity=args.ft8_rxf_sensitivity, + ft8_threads=args.ft8_threads, + ft8_decoder_start=args.ft8_decoder_start, + ft8_low_threshold=args.ft8_low_threshold, + ft8_subpass=args.ft8_subpass, + ft8_ap_on=args.ft8_ap_on, + ap_cq_only=args.ap_cq_only, + ap_my_call=args.ap_my_call, + jt65_ap_on=args.jt65_ap_on, + ap_width_hz=args.ap_width_hz, + hide_ft8_duplicates=args.hide_ft8_duplicates, + common_ft8b=args.common_ft8b, + enable_dxc_search=args.enable_dxc_search, + wide_dxc_search=args.wide_dxc_search, + superfox_mode=args.superfox_mode, + even_sequence=args.even_sequence, + hound_mode=args.hound_mode, + multi_instance=args.multi_instance, + skip_tx1=args.skip_tx1, + nagain_filter=args.nagain_filter, + stop_hint=args.stop_hint, + hint_mode=args.hint_mode, + bad_phase6=args.bad_phase6, + ) + # Phase 7 keys also ride on the MAIN configure only. + phase7 = dict( + last_tx_seconds_ago=args.last_tx_seconds_ago, + currently_txing=args.currently_txing, + mode_changed=args.mode_changed, + qso_progress_state=args.qso_progress_state, + sec_band_changed=args.sec_band_changed, + delay_units=args.delay_units, + bad_phase7=args.bad_phase7, + ) + # Phase 8 keys also ride on the MAIN configure only. + phase8 = dict( + utc=args.utc, + date=args.date, + n_trials=args.n_trials, + candthin_threshold=args.candthin_threshold, + dt_center_seconds=args.dt_center_seconds, + ) + # Phase 9 keys also ride on the MAIN configure only. + phase9 = dict( + depth_level=args.depth_level, + q65_maxiters_level=args.q65_maxiters_level, + use_averaging=args.use_averaging, + deep_ap_search=args.deep_ap_search, + q65_auto_clear_average=args.q65_auto_clear_average, + contest_type=args.contest_type, + single_decode=args.single_decode, + vhf_features=args.vhf_features, + noise_blanker_level=args.noise_blanker_level, + bad_phase9=args.bad_phase9, + phase9_conflict=args.phase9_conflict, + ) + if args.prepend_mode: + proc.stdin.write(frame(FRAME_CONTROL, configure_json( + mode=args.mode, ntol=None, nfa=None, nfb=None, + nutc=args.nutc, version=args.schema_version, + bad_depth=args.bad_type, mycall=args.mycall, + omit_mygrid=args.omit_mygrid, + **phase4, **phase5, **phase6, **phase7, **phase8, **phase9, + ))) + else: + proc.stdin.write(frame(FRAME_CONTROL, configure_json( + mode=args.mode, ntol=args.ntol, nfa=args.nfa, nfb=args.nfb, + nutc=args.nutc, version=args.schema_version, + bad_depth=args.bad_type, mycall=args.mycall, + omit_mygrid=args.omit_mygrid, + **phase4, **phase5, **phase6, **phase7, **phase8, **phase9, + ))) + + # Audio frames: CHUNK_SAMPLES * 2 bytes per chunk. + bytes_per_chunk = CHUNK_SAMPLES * 2 + for off in range(0, len(audio), bytes_per_chunk): + proc.stdin.write(frame(FRAME_AUDIO, audio[off : off + bytes_per_chunk])) + proc.stdin.write(frame(FRAME_CONTROL, halt_json())) + proc.stdin.flush() + proc.stdin.close() + except BrokenPipeError: + pass + + out_bytes = proc.stdout.read() + proc.wait(timeout=60) + out = out_bytes.decode("utf-8", errors="replace") + out_lines = out.splitlines() + + if args.parity is not None: + return run_parity( + args.parity, out_lines, proc.returncode, + f"{args.mode} {args.wav.name}", + ) + + for line in out_lines: + if args.quiet and not line.startswith("{"): + continue + print(line) + return proc.returncode + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/test/wav_to_stream_no_configure.py b/test/wav_to_stream_no_configure.py new file mode 100755 index 00000000..4611a974 --- /dev/null +++ b/test/wav_to_stream_no_configure.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python3 +""" +wav-to-stream validation harness — no-configure-frame variant. + +Pipes a 12 kHz mono int16 WAV file through `jt9 --stream` using the +streaming protocol, but does NOT send a configure frame. +Decode parameters come from jt9's CLI args (-F/-f/-L/-H/-d) instead. + +This exercises the CLI-arg threading path through init_default_params. +Earlier, streaming_io.f90 silently overrode the CLI +args with FT8-baseline hardcoded defaults — so a no-configure invocation +produced 0 decodes regardless of what the user passed on the CLI. + +Usage: + test/wav_to_stream_no_configure.py + [--mode-flag MODE_FLAG] [--ntol NTOL] [--nrxfreq HZ] + [--flow HZ] [--fhigh HZ] [--ndepth N] + +NDJSON lines and stderr are printed to stdout (consumers MUST drain +stderr). Exit code is jt9's exit code. +""" +from __future__ import annotations + +import argparse +import struct +import subprocess +import sys +import wave +from pathlib import Path + +FRAME_AUDIO = 0x01 +FRAME_CONTROL = 0x02 +CHUNK_SAMPLES = 12000 + + +def wsjt_session_header(rate_khz: int = 12) -> bytes: + return b"WSJT" + bytes([0, 1]) + struct.pack(" bytes: + return bytes([type_byte]) + struct.pack(" bytes: + return b'{"t":"halt"}' + + +def main() -> int: + p = argparse.ArgumentParser() + p.add_argument("jt9", type=Path) + p.add_argument("wav", type=Path) + p.add_argument("--mode-flag", default="-8", + help="jt9 mode flag (-8 FT8, -9 JT9, etc.)") + p.add_argument("--ntol", type=int, default=1000) + p.add_argument("--nrxfreq", type=int, default=1500) + p.add_argument("--flow", type=int, default=200) + p.add_argument("--fhigh", type=int, default=3000) + p.add_argument("--ndepth", type=int, default=1) + p.add_argument("--quiet", action="store_true", + help="Suppress non-JSON stderr lines.") + args = p.parse_args() + + if not args.jt9.is_file(): + print(f"ERROR: jt9 binary not found: {args.jt9}", file=sys.stderr) + return 2 + if not args.wav.is_file(): + print(f"ERROR: WAV file not found: {args.wav}", file=sys.stderr) + return 2 + + with wave.open(str(args.wav)) as w: + if w.getnchannels() != 1 or w.getsampwidth() != 2 or w.getframerate() != 12000: + print("ERROR: WAV must be 12 kHz mono 16-bit", file=sys.stderr) + return 2 + audio = w.readframes(w.getnframes()) + + cmd = [ + str(args.jt9), "--stream", args.mode_flag, + "-F", str(args.ntol), "-f", str(args.nrxfreq), + "-L", str(args.flow), "-H", str(args.fhigh), + "-d", str(args.ndepth), + ] + + proc = subprocess.Popen( + cmd, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + ) + + try: + proc.stdin.write(wsjt_session_header()) + # NOTE: NO configure frame here — that is the whole point of this + # harness. CLI args from -F/-f/-L/-H/-d above must be honored by + # init_default_params with no help from a runtime configure. + bytes_per_chunk = CHUNK_SAMPLES * 2 + for off in range(0, len(audio), bytes_per_chunk): + proc.stdin.write(frame(FRAME_AUDIO, audio[off : off + bytes_per_chunk])) + proc.stdin.write(frame(FRAME_CONTROL, halt_json())) + proc.stdin.flush() + proc.stdin.close() + except BrokenPipeError: + pass + + out_bytes = proc.stdout.read() + proc.wait(timeout=60) + out = out_bytes.decode("utf-8", errors="replace") + for line in out.splitlines(): + if args.quiet and not line.startswith("{"): + continue + print(line) + return proc.returncode + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/test/wav_to_wsprd_stream_harness.py b/test/wav_to_wsprd_stream_harness.py new file mode 100755 index 00000000..3d81f08c --- /dev/null +++ b/test/wav_to_wsprd_stream_harness.py @@ -0,0 +1,148 @@ +#!/usr/bin/env python3 +""" +wav-to-wsprd-stream validation harness. + +Pipes a 12 kHz mono int16 WAV file through `wsprd --stream` using the +streaming protocol, then prints the resulting NDJSON +decodes. Used to verify that streaming-mode decode results match the +file-mode ground truth. + +Usage: + test/wav_to_wsprd_stream_harness.py + [--dialfreq MHZ] [--wspr-type 2|15] + [--mycall CALL] [--mygrid GRID] + +Filename convention: YYMMDD_HHMM.wav (matches existing wsprd file-mode +behavior). Date/time get extracted from the filename and sent in the +configure frame. + +NDJSON lines are written to stdout. stderr is merged into stdout +(consumers MUST drain stderr). +""" +from __future__ import annotations + +import argparse +import json +import re +import struct +import subprocess +import sys +import wave +from pathlib import Path + +FRAME_AUDIO = 0x01 +FRAME_CONTROL = 0x02 + +# Audio chunk size in 12 kHz samples per frame. ~1 s per frame. +CHUNK_SAMPLES = 12000 + + +def wsjt_session_header(rate_khz: int = 12) -> bytes: + return b"WSJT" + bytes([0, 1]) + struct.pack(" bytes: + return bytes([type_byte]) + struct.pack(" bytes: + payload = { + "t": "configure", + "date": date, + "time": uttime, + "dialfreq": dialfreq, + "wspr_type": wspr_type, + "mycall": mycall, + "mygrid": mygrid, + } + return json.dumps(payload, separators=(",", ":")).encode("utf-8") + + +def halt_json() -> bytes: + return b'{"t":"halt"}' + + +def parse_filename_timestamp(wav_path: Path) -> tuple[str, str]: + """Extract YYMMDD and HHMM from a YYMMDD_HHMM.wav filename.""" + m = re.match(r"^(\d{6})_(\d{4})\.wav$", wav_path.name) + if not m: + raise ValueError(f"WAV filename must match YYMMDD_HHMM.wav: {wav_path.name}") + return m.group(1), m.group(2) + + +def main() -> int: + p = argparse.ArgumentParser() + p.add_argument("wsprd", type=Path) + p.add_argument("wav", type=Path) + p.add_argument("--dialfreq", type=float, default=14.0956) + p.add_argument("--wspr-type", type=int, default=2, choices=[2, 15]) + p.add_argument("--mycall", default="KJ5HST") + p.add_argument("--mygrid", default="EM18") + p.add_argument( + "--quiet", action="store_true", + help="Suppress non-JSON stderr lines (e.g., header-ok).", + ) + args = p.parse_args() + + if not args.wsprd.is_file(): + print(f"ERROR: wsprd binary not found: {args.wsprd}", file=sys.stderr) + return 2 + if not args.wav.is_file(): + print(f"ERROR: WAV file not found: {args.wav}", file=sys.stderr) + return 2 + + date, uttime = parse_filename_timestamp(args.wav) + + with wave.open(str(args.wav)) as w: + if w.getnchannels() != 1: + print(f"ERROR: WAV must be mono (got {w.getnchannels()} channels)", + file=sys.stderr) + return 2 + if w.getsampwidth() != 2: + print(f"ERROR: WAV must be 16-bit (got {w.getsampwidth()} byte samples)", + file=sys.stderr) + return 2 + if w.getframerate() != 12000: + print(f"ERROR: WAV must be 12 kHz (got {w.getframerate()} Hz)", + file=sys.stderr) + return 2 + audio = w.readframes(w.getnframes()) + + proc = subprocess.Popen( + [str(args.wsprd), "-0"], # -0 == streaming mode (wsprd uses getopt single-char only) + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT, + ) + + try: + proc.stdin.write(wsjt_session_header()) + proc.stdin.write(frame( + FRAME_CONTROL, + configure_json(date, uttime, args.dialfreq, args.wspr_type, + args.mycall, args.mygrid), + )) + bytes_per_chunk = CHUNK_SAMPLES * 2 + for off in range(0, len(audio), bytes_per_chunk): + proc.stdin.write(frame(FRAME_AUDIO, audio[off : off + bytes_per_chunk])) + proc.stdin.write(frame(FRAME_CONTROL, halt_json())) + proc.stdin.flush() + proc.stdin.close() + except BrokenPipeError: + pass + + out_bytes = proc.stdout.read() + proc.wait(timeout=120) + out = out_bytes.decode("utf-8", errors="replace") + for line in out.splitlines(): + if args.quiet and not line.startswith("{"): + continue + print(line) + return proc.returncode + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bf086f99..02b3a3e1 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,37 +1,59 @@ find_package (Qt5Test 5 REQUIRED) -# -# Compiler options -# -set (CMAKE_CXX_STANDARD 11) +add_test ( + NAME test_release_state + COMMAND ${CMAKE_COMMAND} + -D SOURCE_DIR=${CMAKE_SOURCE_DIR} + -D TEST_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/release-state + -P ${CMAKE_SOURCE_DIR}/tests/release/test_release_state.cmake) + +find_package (Git QUIET) +if (GIT_FOUND) + add_test ( + NAME test_release_git_archive + COMMAND ${CMAKE_COMMAND} + -D SOURCE_DIR=${CMAKE_SOURCE_DIR} + -D TEST_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}/release-git-archive + -D GIT_EXECUTABLE=${GIT_EXECUTABLE} + -P ${CMAKE_SOURCE_DIR}/tests/release/test_git_archive.cmake) +endif () + add_compile_options ("$<$:-Wall;-Wno-conversion;-fno-second-underscore;-fno-f2c>") add_compile_options ("$<$,$>:-fbounds-check>") add_compile_options ("$<$,$>>:-funroll-all-loops>") add_compile_options ("$<$,$>,$,$,$>>:-Wall;-Wextra>") add_compile_options ("$<$,$>:-Wno-pragmas>") add_compile_options ("$<$,$>,$>>:-fdata-sections;-ffunction-sections>") -if (${OPENMP_FOUND} OR APPLE) +if (WSJT_BUILD_FORTRAN_OPENMP) add_compile_options ("$<$,$>,$>:${OpenMP_C_FLAGS}>") endif () -# Tell CMake to run moc when necessary set (CMAKE_AUTOMOC ON) include_directories (${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}) -add_executable (test_qt_helpers test_qt_helpers.cpp) -target_link_libraries (test_qt_helpers wsjt_qt Qt5::Test) -add_test (test_qt_helpers test_qt_helpers) +add_subdirectory (unit/audio) +add_subdirectory (unit/band_hopping) +add_subdirectory (unit/common) +add_subdirectory (unit/decoder_ipc) add_subdirectory (unit/hrd) +add_subdirectory (unit/hash) +add_subdirectory (unit/message_filter) +add_subdirectory (unit/msk) +add_subdirectory (unit/network) +add_subdirectory (unit/qmap) +add_subdirectory (unit/jtty) +add_subdirectory (unit/jt9) +add_subdirectory (unit/jpl) +add_subdirectory (unit/logbook) +add_subdirectory (unit/map65) +add_subdirectory (unit/echo) +add_subdirectory (unit/ft8) +add_subdirectory (unit/fst4) +add_subdirectory (unit/legacy72) add_subdirectory (unit/packjt77) - -add_executable (test_http_user_agent test_http_user_agent.cpp) -target_link_libraries (test_http_user_agent wsjt_qt Qt5::Test) -add_test (test_http_user_agent test_http_user_agent) - -add_executable (test_emulate_split_transceiver test_emulate_split_transceiver.cpp) -target_link_libraries (test_emulate_split_transceiver Boost::log wsjt_qt Qt5::Test Qt5::Network Qt5::Widgets) -add_test (test_emulate_split_transceiver test_emulate_split_transceiver) - -add_executable (test_bwf_file test_bwf_file.cpp) -target_link_libraries (test_bwf_file wsjt_qt wsjt_qtmm Qt5::Test Qt5::Multimedia) -add_test (test_bwf_file test_bwf_file) +add_subdirectory (unit/q65) +add_subdirectory (unit/jt65) +add_subdirectory (unit/superfox) +add_subdirectory (unit/streaming) +add_subdirectory (unit/tci) +add_subdirectory (unit/wsprd) diff --git a/tests/fixtures/jtty/jtty_msgs.txt b/tests/fixtures/jtty/jtty_msgs.txt new file mode 100644 index 00000000..d1b1c04d --- /dev/null +++ b/tests/fixtures/jtty/jtty_msgs.txt @@ -0,0 +1,40 @@ +CQ KA1ABC CQ +WB9XYZ +WB9XYZ 599 0123 +KA1ABC 599 0456 +599 0456 +599 MA +TU KA1ABC CQ +WB9XYZ TU CQ KA1ABC CQ +TU NOW JA6DEF 599 123 + +WB9XYZ TU +WB9XYZ AGN? +WB9XYZ NR? +WB9XYZ 599 WI +WB9XYZ 599 05 MA +WB9XYZ GEORGE MA +WB9XYZ 599 GEORGE MA +CQ PJ4/KA1ABC CQ +VP2/KF2GHI +CQ KA1ABC +CQ KA1ABC FN42 +CQ DX KA1ABC +WB9XYZ KA1ABC -09 +WB9XYZ KA1ABC RR73 + +NOW IS THE TIME FOR ALL GOOD MEN TO COME TO THE AID OF THEIR PARTY. +THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG, TWICE. +0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ +-./?!"#$%,&*()_'=[]{}<>|:; + +CQ K7RU CQ +N6QEK/KL7 +N6QEK/KL7 599 123 +599 456 +TU K7RU CQ + +CQ N6QEK/KL7 CQ + EA7/HA3NZ +EA7/HA3NZ 599 124 + 599 457 +TU N6QEK/KL7 CQ diff --git a/tests/integration/ft8/run_tx_loopback.cmake b/tests/integration/ft8/run_tx_loopback.cmake new file mode 100644 index 00000000..52853949 --- /dev/null +++ b/tests/integration/ft8/run_tx_loopback.cmake @@ -0,0 +1,86 @@ +foreach (required_variable WSJTX WORK_DIR EXPECTED DATA_DIR) + if (NOT DEFINED ${required_variable} OR "${${required_variable}}" STREQUAL "") + message (FATAL_ERROR "${required_variable} is required") + endif () +endforeach () + +set (ipc_dir "${WORK_DIR}-ipc") +file (REMOVE_RECURSE "${WORK_DIR}") +file (MAKE_DIRECTORY + "${WORK_DIR}/capture/config" + "${WORK_DIR}/capture/data" + "${WORK_DIR}/capture/cache" + "${WORK_DIR}/replay/config" + "${WORK_DIR}/replay/data" + "${WORK_DIR}/replay/cache" + "${ipc_dir}/capture" + "${ipc_dir}/replay") + +set (capture "${WORK_DIR}/ft8-tx-loopback.wav") +set (capture_environment + "XDG_CONFIG_HOME=${WORK_DIR}/capture/config" + "XDG_DATA_HOME=${WORK_DIR}/capture/data" + "XDG_CACHE_HOME=${WORK_DIR}/capture/cache" + "WSJT_QMAP_SHARED_MEMORY_KEY=mem_qmap-test_wsjtx_ft8_tx_loopback") +set (replay_environment + "XDG_CONFIG_HOME=${WORK_DIR}/replay/config" + "XDG_DATA_HOME=${WORK_DIR}/replay/data" + "XDG_CACHE_HOME=${WORK_DIR}/replay/cache" + "WSJT_QMAP_SHARED_MEMORY_KEY=mem_qmap-test_wsjtx_ft8_tx_loopback") +if (NOT APPLE) + list (APPEND capture_environment "TMPDIR=${ipc_dir}/capture") + list (APPEND replay_environment "TMPDIR=${ipc_dir}/replay") +endif () + +execute_process ( + COMMAND "${CMAKE_COMMAND}" -E env + ${capture_environment} + "${WSJTX}" + --ft8-tx-loopback-test "${capture}" + --rig-name CTEST-FT8-TX-CAPTURE + WORKING_DIRECTORY "${WORK_DIR}/capture" + RESULT_VARIABLE capture_result + OUTPUT_VARIABLE capture_stdout + ERROR_VARIABLE capture_stderr) +if (NOT capture_result STREQUAL "0") + message (FATAL_ERROR + "WSJT-X FT8 transmit capture failed with exit code ${capture_result}\n" + "stdout:\n${capture_stdout}\n" + "stderr:\n${capture_stderr}") +endif () + +if (NOT EXISTS "${capture}") + message (FATAL_ERROR "WSJT-X did not create ${capture}") +endif () +file (SIZE "${capture}" capture_size) +if (NOT capture_size EQUAL 1440044) + message (FATAL_ERROR + "WSJT-X FT8 capture must contain a 44-byte header and 720000 frames; size=${capture_size}") +endif () +file (READ "${capture}" capture_header OFFSET 0 LIMIT 44 HEX) +if (NOT capture_header MATCHES + "^5249464624f9150057415645666d7420100000000100010080bb000000770100020010006461746100f91500$") + message (FATAL_ERROR + "WSJT-X capture is not an exact 48 kHz mono signed 16-bit PCM RIFF/WAVE period: ${capture_header}") +endif () + +execute_process ( + COMMAND "${CMAKE_COMMAND}" -E env + ${replay_environment} + "${WSJTX}" + --live-audio-test "${capture}" + --live-audio-expected "${EXPECTED}" + --live-audio-data-dir "${DATA_DIR}" + --rig-name CTEST-FT8-TX-REPLAY + WORKING_DIRECTORY "${WORK_DIR}/replay" + RESULT_VARIABLE replay_result + OUTPUT_VARIABLE replay_stdout + ERROR_VARIABLE replay_stderr) +if (NOT replay_result STREQUAL "0") + message (FATAL_ERROR + "WSJT-X FT8 transmit replay failed with exit code ${replay_result}\n" + "stdout:\n${replay_stdout}\n" + "stderr:\n${replay_stderr}") +endif () + +message (STATUS "WSJT-X FT8 transmit loopback smoke test passed") diff --git a/tests/integration/ft8/tx_loopback.expected.txt b/tests/integration/ft8/tx_loopback.expected.txt new file mode 100644 index 00000000..175fa871 --- /dev/null +++ b/tests/integration/ft8/tx_loopback.expected.txt @@ -0,0 +1,2 @@ +# Message identities are compared as a set; numeric metadata is informational. +000000 0 0.0 1500 ~ CQ KA1ABC FN42 diff --git a/tests/integration/jt9/compare_decoder_output.cmake b/tests/integration/jt9/compare_decoder_output.cmake new file mode 100644 index 00000000..a7d28827 --- /dev/null +++ b/tests/integration/jt9/compare_decoder_output.cmake @@ -0,0 +1,44 @@ +foreach (required_variable JT9 MODE SAMPLE EXPECTED WORK_DIR SOURCE_DIR) + if (NOT DEFINED ${required_variable} OR "${${required_variable}}" STREQUAL "") + message (FATAL_ERROR "${required_variable} is required") + endif () +endforeach () + +file (MAKE_DIRECTORY "${WORK_DIR}") +set (actual_file "${WORK_DIR}/actual.txt") +set (stderr_file "${WORK_DIR}/stderr.txt") + +execute_process ( + COMMAND "${JT9}" + -a "${WORK_DIR}" + -t "${WORK_DIR}" + -r "${SOURCE_DIR}" + ${MODE} + "${SAMPLE}" + WORKING_DIRECTORY "${WORK_DIR}" + RESULT_VARIABLE decoder_result + OUTPUT_VARIABLE decoder_stdout + ERROR_VARIABLE decoder_stderr) + +file (WRITE "${actual_file}" "${decoder_stdout}") +file (WRITE "${stderr_file}" "${decoder_stderr}") + +if (NOT "${decoder_result}" STREQUAL "0") + message (FATAL_ERROR + "jt9 exited with ${decoder_result}\n" + "stdout:\n${decoder_stdout}\n" + "stderr:\n${decoder_stderr}") +endif () + +if (NOT "${decoder_stderr}" STREQUAL "") + message (FATAL_ERROR "jt9 wrote to stderr:\n${decoder_stderr}") +endif () + +file (READ "${EXPECTED}" expected_output) +if (NOT "${decoder_stdout}" STREQUAL "${expected_output}") + message (FATAL_ERROR + "jt9 output differs from ${EXPECTED}\n" + "expected:\n${expected_output}\n" + "actual:\n${decoder_stdout}\n" + "preserved output: ${actual_file}") +endif () diff --git a/tests/integration/jt9/compare_mtd_messages.cmake b/tests/integration/jt9/compare_mtd_messages.cmake new file mode 100644 index 00000000..4011dca7 --- /dev/null +++ b/tests/integration/jt9/compare_mtd_messages.cmake @@ -0,0 +1,133 @@ +foreach (required_variable JT9 SAMPLE EXPECTED WORK_DIR SOURCE_DIR MTD_WORKERS + DECODE_CYCLES FFT_THREADS) + if (NOT DEFINED ${required_variable} OR "${${required_variable}}" STREQUAL "") + message (FATAL_ERROR "${required_variable} is required") + endif () +endforeach () + +file (MAKE_DIRECTORY "${WORK_DIR}") + +set (input_samples "${SAMPLE}") +set (expected_completion_count 1) +if (CONSECUTIVE_PERIODS) + set (input_samples) + foreach (utc IN ITEMS 133430 133445 133500 133515) + set (period_sample "${WORK_DIR}/210703_${utc}.wav") + configure_file ("${SAMPLE}" "${period_sample}" COPYONLY) + list (APPEND input_samples "${period_sample}") + endforeach () + list (LENGTH input_samples expected_completion_count) +endif () + +set (qso_arguments) +set (qso_variables MY_CALL DX_CALL QSO_FREQUENCY QSO_PROGRESS) +set (configured_qso_variable_count 0) +foreach (qso_variable IN LISTS qso_variables) + if (DEFINED ${qso_variable} AND NOT "${${qso_variable}}" STREQUAL "") + math (EXPR configured_qso_variable_count + "${configured_qso_variable_count} + 1") + endif () +endforeach () +if (configured_qso_variable_count GREATER 0 AND + NOT configured_qso_variable_count EQUAL 4) + message (FATAL_ERROR + "MY_CALL, DX_CALL, QSO_FREQUENCY, and QSO_PROGRESS must be set together") +elseif (configured_qso_variable_count EQUAL 4) + list (APPEND qso_arguments + -c "${MY_CALL}" -x "${DX_CALL}" -f "${QSO_FREQUENCY}" -Q "${QSO_PROGRESS}") +endif () + +set (actual_file "${WORK_DIR}/actual.txt") +set (stderr_file "${WORK_DIR}/stderr.txt") +file (WRITE "${stderr_file}" "") + +execute_process ( + COMMAND "${CMAKE_COMMAND}" -E env OMP_STACKSIZE=16M + "${JT9}" + -8 -M -N ${MTD_WORKERS} -d 3 -C ${DECODE_CYCLES} -E 3 -D 3 + -p 15 -m ${FFT_THREADS} -L 200 -H 3000 + -a "${WORK_DIR}" + -t "${WORK_DIR}" + -r "${SOURCE_DIR}" + ${qso_arguments} + ${input_samples} + WORKING_DIRECTORY "${WORK_DIR}" + RESULT_VARIABLE decoder_result + OUTPUT_VARIABLE decoder_stdout + ERROR_FILE "${stderr_file}") + +file (WRITE "${actual_file}" "${decoder_stdout}") +file (READ "${stderr_file}" decoder_stderr) + +if (NOT "${decoder_result}" STREQUAL "0") + message (FATAL_ERROR + "jt9 MTD exited with ${decoder_result}\n" + "stdout:\n${decoder_stdout}\n" + "stderr:\n${decoder_stderr}") +endif () + +if (NOT "${decoder_stderr}" STREQUAL "") + message (FATAL_ERROR "jt9 MTD wrote to stderr:\n${decoder_stderr}") +endif () + +string (REGEX MATCHALL "" completion_markers "${decoder_stdout}") +list (LENGTH completion_markers completion_count) +if (NOT completion_count EQUAL expected_completion_count) + message (FATAL_ERROR + "jt9 MTD completed ${completion_count} decode periods; " + "expected ${expected_completion_count}") +endif () + +file (READ "${EXPECTED}" expected_output) + +# OpenMP worker completion order and numeric decode metadata are not stable invariants. +function (extract_ft8_messages decoder_output output_variable) + set (required_period "${ARGV2}") + string (REPLACE "\r\n" "\n" normalized_output "${decoder_output}") + string (REPLACE "\n" ";" output_lines "${normalized_output}") + set (messages) + foreach (line IN LISTS output_lines) + if (NOT "${required_period}" STREQUAL "") + string (STRIP "${line}" stripped_line) + string (FIND "${stripped_line}" "${required_period} " period_position) + if (NOT period_position EQUAL 0) + continue () + endif () + endif () + string (FIND "${line}" "~" marker_position) + if (marker_position GREATER_EQUAL 0) + math (EXPR message_position "${marker_position} + 1") + string (SUBSTRING "${line}" ${message_position} -1 message) + string (STRIP "${message}" message) + if (NOT "${message}" STREQUAL "") + list (APPEND messages "${message}") + endif () + endif () + endforeach () + list (REMOVE_DUPLICATES messages) + list (SORT messages) + set (${output_variable} "${messages}" PARENT_SCOPE) +endfunction () + +extract_ft8_messages ("${expected_output}" expected_messages) +extract_ft8_messages ("${decoder_stdout}" actual_messages) + +if (CONSECUTIVE_PERIODS) + foreach (utc IN ITEMS 133430 133445 133500 133515) + extract_ft8_messages ("${decoder_stdout}" period_messages "${utc}") + if (NOT "${period_messages}" STREQUAL "${expected_messages}") + message (FATAL_ERROR + "jt9 MTD decoded message set differs in period ${utc}") + endif () + endforeach () +endif () + +if (NOT "${actual_messages}" STREQUAL "${expected_messages}") + string (REPLACE ";" "\n " expected_display "${expected_messages}") + string (REPLACE ";" "\n " actual_display "${actual_messages}") + message (FATAL_ERROR + "jt9 MTD decoded message set differs from ${EXPECTED}\n" + "expected:\n ${expected_display}\n" + "actual:\n ${actual_display}\n" + "preserved output: ${actual_file}") +endif () diff --git a/tests/integration/jt9/smoke_decoder_callback.cmake b/tests/integration/jt9/smoke_decoder_callback.cmake new file mode 100644 index 00000000..6a4e698f --- /dev/null +++ b/tests/integration/jt9/smoke_decoder_callback.cmake @@ -0,0 +1,47 @@ +foreach (required_variable JT9 SAMPLE EXPECTED_MESSAGE WORK_DIR SOURCE_DIR) + if (NOT DEFINED ${required_variable} OR "${${required_variable}}" STREQUAL "") + message (FATAL_ERROR "${required_variable} is required") + endif () +endforeach () + +file (MAKE_DIRECTORY "${WORK_DIR}") +set (actual_file "${WORK_DIR}/actual.txt") + +execute_process ( + COMMAND "${JT9}" + -a "${WORK_DIR}" + -t "${WORK_DIR}" + -r "${SOURCE_DIR}" + -8 + -d 1 + -x b + -L 1000 + -H 1400 + "${SAMPLE}" + WORKING_DIRECTORY "${WORK_DIR}" + RESULT_VARIABLE decoder_result + OUTPUT_VARIABLE decoder_stdout + ERROR_VARIABLE decoder_stderr) + +file (WRITE "${actual_file}" "${decoder_stdout}") + +if (NOT "${decoder_result}" STREQUAL "0") + message (FATAL_ERROR + "jt9 exited with ${decoder_result}\n" + "stdout:\n${decoder_stdout}\n" + "stderr:\n${decoder_stderr}") +endif () + +if (NOT "${decoder_stderr}" STREQUAL "") + message (FATAL_ERROR "jt9 wrote to stderr:\n${decoder_stderr}") +endif () + +string (FIND "${decoder_stdout}" "${EXPECTED_MESSAGE}" message_position) +string (FIND "${decoder_stdout}" "" completion_position) +if (message_position LESS 0 OR completion_position LESS 0) + message (FATAL_ERROR + "jt9 did not complete the expected FT8 callback path\n" + "expected message: ${EXPECTED_MESSAGE}\n" + "actual:\n${decoder_stdout}\n" + "preserved output: ${actual_file}") +endif () diff --git a/tests/integration/jt9/verify_elf_stack.cmake b/tests/integration/jt9/verify_elf_stack.cmake new file mode 100644 index 00000000..30db932b --- /dev/null +++ b/tests/integration/jt9/verify_elf_stack.cmake @@ -0,0 +1,30 @@ +foreach (required_variable READELF EXECUTABLE) + if (NOT DEFINED ${required_variable} OR "${${required_variable}}" STREQUAL "") + message (FATAL_ERROR "${required_variable} is required") + endif () +endforeach () + +execute_process ( + COMMAND "${READELF}" -W -l "${EXECUTABLE}" + RESULT_VARIABLE readelf_result + OUTPUT_VARIABLE readelf_stdout + ERROR_VARIABLE readelf_stderr) + +if (NOT "${readelf_result}" STREQUAL "0") + message (FATAL_ERROR + "readelf exited with ${readelf_result}\n" + "stdout:\n${readelf_stdout}\n" + "stderr:\n${readelf_stderr}") +endif () + +string (REGEX MATCH "GNU_STACK[^\r\n]*" stack_header "${readelf_stdout}") +if (NOT stack_header) + message (FATAL_ERROR "${EXECUTABLE} has no GNU_STACK program header") +endif () + +if (stack_header MATCHES "[ \t]RWE([ \t]|$)" OR + NOT stack_header MATCHES "[ \t]RW([ \t]|$)") + message (FATAL_ERROR + "${EXECUTABLE} does not have a non-executable read/write stack:\n" + "${stack_header}") +endif () diff --git a/tests/integration/jt9/verify_jt4_12000_read_extent.cmake b/tests/integration/jt9/verify_jt4_12000_read_extent.cmake new file mode 100644 index 00000000..7011cc39 --- /dev/null +++ b/tests/integration/jt9/verify_jt4_12000_read_extent.cmake @@ -0,0 +1,67 @@ +foreach (required_variable JT9 JT4SIM WORK_DIR) + if (NOT DEFINED ${required_variable} OR "${${required_variable}}" STREQUAL "") + message (FATAL_ERROR "${required_variable} is required") + endif () +endforeach () + +file (MAKE_DIRECTORY "${WORK_DIR}") +execute_process ( + COMMAND "${JT4SIM}" "G3WDG OK1KIR RRR" F 1 0 0 1 99 + WORKING_DIRECTORY "${WORK_DIR}" + RESULT_VARIABLE simulator_result + OUTPUT_QUIET + ERROR_VARIABLE simulator_stderr) +if (NOT "${simulator_result}" STREQUAL "0") + message (FATAL_ERROR + "jt4sim exited with ${simulator_result}\n${simulator_stderr}") +endif () + +set (full_wav "${WORK_DIR}/000000_0001.wav") +set (truncated_wav "${WORK_DIR}/000000_0001_truncated.wav") +# Keep enough samples to distinguish a complete JT4 read from premature termination. +set (truncate_script [=[ +import struct +import sys + +sample_count = 580000 +file_size = 44 + 2 * sample_count +with open(sys.argv[1], "rb") as source_file: + wav_data = bytearray(source_file.read(file_size)) +if len(wav_data) != file_size: + raise RuntimeError("generated JT4 WAV is too short") +struct.pack_into("&2; usage; exit 2 ;; + esac +done + +if [[ -z "${build_dir}" || ! -d "${build_dir}" ]]; then + echo "--build-dir must be an existing CMake build directory" >&2 + exit 2 +fi + +if ! command -v xvfb-run >/dev/null 2>&1; then + echo "xvfb-run is required" >&2 + exit 2 +fi + +if ! command -v ctest >/dev/null 2>&1; then + echo "ctest is required" >&2 + exit 2 +fi + +listed=$(ctest --test-dir "${build_dir}" -N -R "${experiment_re}" | awk '/Test #/{print $3}') +for expected in "${experiment_tests[@]}"; do + if [[ $'\n'"${listed}"$'\n' != *$'\n'"${expected}"$'\n'* ]]; then + echo "ctest did not list ${expected}:" >&2 + echo "${listed}" >&2 + exit 2 + fi +done +listed_count=$(printf '%s\n' "${listed}" | awk 'NF { count++ } END { print count + 0 }') +if [[ "${listed_count}" -ne "${#experiment_tests[@]}" ]]; then + echo "ctest listed unexpected experiment tests:" >&2 + echo "${listed}" >&2 + exit 2 +fi + +if [[ "${smoke}" -eq 1 ]]; then + echo "smoke: xvfb-run and ctest listing ok" + echo "smoke: tests:" + printf ' %s\n' "${experiment_tests[@]}" + echo "smoke: would run phase=${phase} soak=${repeats_soak} pair=${repeats_pair}" + echo "======== 3 load start/stop ========" + pids=() + for ((i = 0; i < 2; i++)); do + sleep 30 & + pids+=($!) + done + kill "${pids[@]}" 2>/dev/null || true + wait "${pids[@]}" 2>/dev/null || true + echo "smoke: harness ok" + exit 0 +fi + +run_ctest () { + local label=$1 + shift + echo + echo "======== ${label} ========" + printf '+' + printf ' %q' "${xvfb[@]}" ctest --test-dir "${build_dir}" "$@" + echo + ran=$((ran + 1)) + if "${xvfb[@]}" ctest --test-dir "${build_dir}" "$@"; then + echo "RESULT ${label}: pass" + else + echo "RESULT ${label}: fail (exit $?)" + failures=$((failures + 1)) + fi +} + +# Repeat whole matching suites N times. Do not use --repeat-until-fail: +# one flaky FT8 case must not skip later phases or later passes. +run_suite_repeats () { + local label=$1 + local n=$2 + shift 2 + local i + for ((i = 1; i <= n; i++)); do + run_ctest "${label} pass ${i}/${n}" "$@" + done +} + +phase1 () { + run_suite_repeats "1 serial" "${repeats_soak}" \ + -R "${experiment_re}" --output-on-failure + run_suite_repeats "1 parallel -j3" "${repeats_soak}" \ + -j3 -R "${experiment_re}" --output-on-failure +} + +phase2 () { + run_suite_repeats "2 FT8 live || JTTY live" "${repeats_pair}" \ + -j2 -R 'test_wsjtx_live_audio_ft8|test_wsjtx_live_audio_jtty' \ + --output-on-failure + run_suite_repeats "2 FT8 live || JTTY TX loopback" "${repeats_pair}" \ + -j2 -R 'test_wsjtx_live_audio_ft8|test_wsjtx_jtty_tx_loopback' \ + --output-on-failure + run_suite_repeats "2 JTTY live || JTTY TX loopback" "${repeats_pair}" \ + -j2 -R 'test_wsjtx_live_audio_jtty|test_wsjtx_jtty_tx_loopback' \ + --output-on-failure + run_suite_repeats "2 FT8 TX || FT8 live" "${repeats_pair}" \ + -j3 -R 'test_wsjtx_ft8_tx_loopback|test_wsjtx_live_audio_ft8' \ + --output-on-failure + run_suite_repeats "2 FT8 TX || JTTY live" "${repeats_pair}" \ + -j3 -R 'test_wsjtx_ft8_tx_loopback|test_wsjtx_live_audio_jtty' \ + --output-on-failure + run_suite_repeats "2 FT8 TX || JTTY TX loopback" "${repeats_pair}" \ + -j3 -R 'test_wsjtx_ft8_tx_loopback|test_wsjtx_jtty_tx_loopback' \ + --output-on-failure + run_suite_repeats "2 FT8 TX || canaries" "${repeats_pair}" \ + -j3 -R "test_wsjtx_ft8_tx_loopback|${canary_re}" \ + --output-on-failure + run_suite_repeats "2 startup || audio tests -j3" "${repeats_pair}" \ + -j3 -R "${gui_audio_re}" --output-on-failure + run_suite_repeats "2 all four audio tests -j3" "${repeats_pair}" \ + -j3 -R "${audio_re}" --output-on-failure +} + +phase3 () { + echo + echo "======== 3 contended: background gzip load ========" + local pids=() + local i + for ((i = 0; i < 4; i++)); do + (while true; do dd if=/dev/zero bs=1M count=64 2>/dev/null | gzip -1 >/dev/null; done) & + pids+=($!) + done + run_suite_repeats "3 parallel -j3 under load" "${repeats_pair}" \ + -j3 -R "${experiment_re}" --output-on-failure + kill "${pids[@]}" 2>/dev/null || true + wait "${pids[@]}" 2>/dev/null || true +} + +case "${phase}" in + 1) phase1 ;; + 2) phase2 ;; + 3) phase3 ;; + all) phase1; phase2; phase3 ;; + *) echo "phase must be 1, 2, 3, or all" >&2; exit 2 ;; +esac + +echo +echo "======== summary ========" +echo "suites_run=${ran} suites_failed=${failures}" +if [[ "${failures}" -ne 0 ]]; then + exit 1 +fi +exit 0 diff --git a/tests/integration/wsprd/compare_wsprd_output.cmake b/tests/integration/wsprd/compare_wsprd_output.cmake new file mode 100644 index 00000000..63e37ed0 --- /dev/null +++ b/tests/integration/wsprd/compare_wsprd_output.cmake @@ -0,0 +1,41 @@ +foreach (required_variable WSPRD SAMPLE EXPECTED WORK_DIR) + if (NOT DEFINED ${required_variable} OR "${${required_variable}}" STREQUAL "") + message (FATAL_ERROR "${required_variable} is required") + endif () +endforeach () + +file (MAKE_DIRECTORY "${WORK_DIR}") +set (actual_file "${WORK_DIR}/actual.txt") +set (stderr_file "${WORK_DIR}/stderr.txt") + +execute_process ( + COMMAND "${WSPRD}" + -a "${WORK_DIR}" + "${SAMPLE}" + WORKING_DIRECTORY "${WORK_DIR}" + RESULT_VARIABLE decoder_result + OUTPUT_VARIABLE decoder_stdout + ERROR_VARIABLE decoder_stderr) + +file (WRITE "${actual_file}" "${decoder_stdout}") +file (WRITE "${stderr_file}" "${decoder_stderr}") + +if (NOT "${decoder_result}" STREQUAL "0") + message (FATAL_ERROR + "wsprd exited with ${decoder_result}\n" + "stdout:\n${decoder_stdout}\n" + "stderr:\n${decoder_stderr}") +endif () + +if (NOT "${decoder_stderr}" STREQUAL "") + message (FATAL_ERROR "wsprd wrote to stderr:\n${decoder_stderr}") +endif () + +file (READ "${EXPECTED}" expected_output) +if (NOT "${decoder_stdout}" STREQUAL "${expected_output}") + message (FATAL_ERROR + "wsprd output differs from ${EXPECTED}\n" + "expected:\n${expected_output}\n" + "actual:\n${decoder_stdout}\n" + "preserved output: ${actual_file}") +endif () diff --git a/tests/manual/pskreporter/PSKReporter.IESpec b/tests/manual/pskreporter/PSKReporter.IESpec new file mode 100644 index 00000000..8e95ffd0 --- /dev/null +++ b/tests/manual/pskreporter/PSKReporter.IESpec @@ -0,0 +1,12 @@ +senderCallsign(30351/1)[65535] +receiverCallsign(30351/2)[65535] +senderLocator(30351/3)[65535] +receiverLocator(30351/4)[65535] +frequency(30351/5)[4] +sNR(30351/6)[1] +iMD(30351/7)[1] +decoderSoftware(30351/8)[65535] +antennaInformation(30351/9)[65535] +mode(30351/10)[65535] +informationSource(30351/11)[1] +persistentIdentifier(30351/12)[65535] diff --git a/tests/manual/pskreporter/listener.py b/tests/manual/pskreporter/listener.py new file mode 100644 index 00000000..4cc0e29c --- /dev/null +++ b/tests/manual/pskreporter/listener.py @@ -0,0 +1,94 @@ +from __future__ import unicode_literals +import sys +import argparse +import logging +import time +import threading +import ipfix.ie +import ipfix.reader +import ipfix.message +import socketserver +import socket + +class IPFixDatagramHandler (socketserver.DatagramRequestHandler): + + def handle (self): + logging.info (f'Connection from {self.client_address}') + try: + self.server.msg_buffer.from_bytes (self.packet) + for rec in self.server.msg_buffer.namedict_iterator (): + logging.info (f't: {self.server.msg_buffer.get_export_time()}: {rec}') + except: + logging.error ('Unexpected exception:', sys.exc_info ()[0]) + + +class IPFixUdpServer (socketserver.UDPServer): + + def __init__ (self, *args, **kwargs): + + self.msg_buffer = ipfix.message.MessageBuffer () + super ().__init__ (*args, **kwargs) + +class IPFixStreamHandler (socketserver.StreamRequestHandler): + + def handle (self): + logging.info (f'Connection from {self.client_address}') + try: + msg_reader = ipfix.reader.from_stream (self.rfile) + for rec in msg_reader.namedict_iterator (): + logging.info (f't: {msg_reader.msg.get_export_time()}: {rec}') + logging.info (f'{self.client_address} closed their connection') + except ConnectionResetError: + logging.info (f'{self.client_address} connection reset') + except TimeoutError: + logging.info (f'{self.client_address} connection timed out') + except: + logging.error ('Unexpected exception:', sys.exc_info ()[0]) + + +if __name__ == "__main__": + INTERFACE, PORT = '', 4739 + + ap = argparse.ArgumentParser (description='Dump IPFIX data collected over UDP') + ap.add_argument ('-l', '--log', metavar='loglevel', default='WARNING', help='logging level') + ap.add_argument ('-s', '--spec', metavar='specfile', help='iespec file to read') + args = ap.parse_args () + + log_level = getattr (logging, args.log.upper (), None) + if not isinstance (log_level, int): + raise ValueError (f'Invalif log level: {log_level}') + logging.basicConfig ( + level=log_level + , format='[%(levelname)s] (%(threadName)-10s) %(message)s' + , + ) + + logging.info (f'Starting IPFix servers on service port: {PORT}') + + ipfix.ie.use_iana_default () + ipfix.ie.use_5103_default () + if args.spec: + ipfix.ie.use_specfile (args.spec) + + udp_server = IPFixUdpServer ((INTERFACE, PORT), IPFixDatagramHandler) + udp_thread = threading.Thread (name='UDP Server', target=udp_server.serve_forever) + + tcp_server = socketserver.TCPServer ((INTERFACE, PORT), IPFixStreamHandler) + tcp_server.allow_reuse_address = True + tcp_server.socket.setsockopt (socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) + tcp_thread = threading.Thread (name='TCP/IP Server', target=tcp_server.serve_forever) + + udp_thread.start () + tcp_thread.start () + + try: + while True: + time.sleep (1000) + except KeyboardInterrupt: + logging.warning ('Closing down servers') + udp_server.shutdown () + tcp_server.shutdown () + + udp_thread.join () + tcp_thread.join () + logging.info ('Servers closed') diff --git a/tests/manual/pskreporter/python-ipfix.patch b/tests/manual/pskreporter/python-ipfix.patch new file mode 100644 index 00000000..cb679709 --- /dev/null +++ b/tests/manual/pskreporter/python-ipfix.patch @@ -0,0 +1,64 @@ +The following changes since commit e487dfbead9965c1a251d110dc55039a7ba4afef: + + sphinx doc update (2017-09-20 16:07:22 +0200) + +are available in the Git repository at: + + git@github.com:g4wjs/python-ipfix.git varlen-and-padding + +for you to fetch changes up to 6dcc106f22d25ac21b27f8ccb9b82be12e7eb18e: + + Parse and emit data elements correctly when variable length items included (2020-06-19 19:53:33 +0100) + +---------------------------------------------------------------- +Bill Somerville (2): + Allow for alignment padding when parsing sets + Parse and emit data elements correctly when variable length items included + + ipfix/message.py | 3 ++- + ipfix/template.py | 4 ++-- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/ipfix/message.py b/ipfix/message.py +index 0af2fad..71c1328 100644 +--- a/ipfix/message.py ++++ b/ipfix/message.py +@@ -398,7 +398,7 @@ class MessageBuffer(object): + offset += _sethdr_st.size # skip set header in decode + if setid == template.TEMPLATE_SET_ID or\ + setid == template.OPTIONS_SET_ID: +- while offset < setend: ++ while offset + 4 < setend: # allow for padding up to 4 byte alignment + (tmpl, offset) = template.decode_template_from( + self.mbuf, offset, setid) + # FIXME handle withdrawal +@@ -431,6 +431,7 @@ class MessageBuffer(object): + # KeyError on template lookup - unknown data set + self.unknown_data_set_hook(self, + self.mbuf[offset-_sethdr_st.size:setend]) ++ offset = setend # real end may be greater that accumulated offset + + def namedict_iterator(self): + """ +diff --git a/ipfix/template.py b/ipfix/template.py +index 1203e55..26cd8c1 100644 +--- a/ipfix/template.py ++++ b/ipfix/template.py +@@ -187,7 +187,7 @@ class Template(object): + offset += packplan.st.size + + # short circuit on no varlen +- if not self.varlenslice: ++ if self.varlenslice is None: + return (vals, offset) + + # direct iteration over remaining IEs +@@ -239,7 +239,7 @@ class Template(object): + offset += packplan.st.size + + # shortcircuit no varlen +- if not self.varlenslice: ++ if self.varlenslice is None: + return offset + + # direct iteration over remaining IEs diff --git a/tests/release/test_git_archive.cmake b/tests/release/test_git_archive.cmake new file mode 100644 index 00000000..96cf78bc --- /dev/null +++ b/tests/release/test_git_archive.cmake @@ -0,0 +1,84 @@ +cmake_minimum_required (VERSION 3.12) + +if (NOT SOURCE_DIR OR NOT TEST_BINARY_DIR OR NOT GIT_EXECUTABLE) + message (FATAL_ERROR "SOURCE_DIR, TEST_BINARY_DIR, and GIT_EXECUTABLE are required") +endif () + +set (archive "${TEST_BINARY_DIR}/source.tar") +set (extract_dir "${TEST_BINARY_DIR}/archive-source") +file (REMOVE_RECURSE "${extract_dir}") +file (MAKE_DIRECTORY "${extract_dir}") +# Job containers may see the runner-mounted checkout as owned by another user. +set (git_source_args -c "safe.directory=${SOURCE_DIR}" -C "${SOURCE_DIR}") +execute_process ( + COMMAND "${GIT_EXECUTABLE}" ${git_source_args} rev-parse HEAD + RESULT_VARIABLE revision_result + OUTPUT_VARIABLE revision + OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process ( + COMMAND "${GIT_EXECUTABLE}" ${git_source_args} archive --format=tar --output=${archive} HEAD + RESULT_VARIABLE archive_result) +execute_process ( + COMMAND "${CMAKE_COMMAND}" -E tar xf "${archive}" + WORKING_DIRECTORY "${extract_dir}" + RESULT_VARIABLE extract_result) +if (NOT revision_result EQUAL 0 OR NOT archive_result EQUAL 0 OR NOT extract_result EQUAL 0) + message (FATAL_ERROR "Could not create and extract the Git source archive") +endif () + +execute_process ( + COMMAND "${CMAKE_COMMAND}" + -D SOURCE_DIR=${extract_dir} + -D TEST_BINARY_DIR=${TEST_BINARY_DIR}/archive-fixtures + -D EXPECT_ARCHIVE_REVISION=${revision} + -P ${extract_dir}/tests/release/test_release_state.cmake + RESULT_VARIABLE state_result) +if (NOT state_result EQUAL 0) + message (FATAL_ERROR "Extracted Git archive did not preserve release identity") +endif () + +include ("${extract_dir}/CMake/Modules/read_release_state.cmake") +wsjt_read_release_state ( + "${extract_dir}/release-state.txt" + archive_version archive_channel archive_rc archive_revision) +include ("${extract_dir}/CMake/Modules/set_build_type.cmake") +set (PROJECT_NAME wsjtx) +string (REPLACE "." ";" archive_version_parts "${archive_version}") +list (GET archive_version_parts 0 PROJECT_VERSION_MAJOR) +list (GET archive_version_parts 1 PROJECT_VERSION_MINOR) +list (GET archive_version_parts 2 PROJECT_VERSION_PATCH) +set (WSJT_RELEASE_CHANNEL "${archive_channel}" CACHE STRING "" FORCE) +set (WSJT_RC_NUMBER "${archive_rc}" CACHE STRING "" FORCE) +set_build_type () +if (archive_channel STREQUAL "DEVEL") + set (expected_version "${archive_version}-devel") +elseif (archive_channel STREQUAL "RC") + set (expected_version "${archive_version}-rc${archive_rc}") +else () + set (expected_version "${archive_version}") +endif () +set (actual_version + "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}${BUILD_TYPE_REVISION}") +if (NOT actual_version STREQUAL expected_version) + message (FATAL_ERROR + "Archived source produced version '${actual_version}', expected '${expected_version}'") +endif () + +set (version_output_dir "${TEST_BINARY_DIR}/archive-version") +file (MAKE_DIRECTORY "${version_output_dir}") +execute_process ( + COMMAND "${CMAKE_COMMAND}" + -D SOURCE_DIR=${extract_dir} + -D BINARY_DIR=${version_output_dir} + -D OUTPUT_DIR=${version_output_dir} + -D SOURCE_REVISION=${archive_revision} + -P ${extract_dir}/CMake/getsvn.cmake + RESULT_VARIABLE version_result) +if (NOT version_result EQUAL 0) + message (FATAL_ERROR "Could not generate revision header from archived source") +endif () +string (SUBSTRING "${archive_revision}" 0 6 short_revision) +file (READ "${version_output_dir}/scs_version.h" revision_header) +if (NOT revision_header MATCHES "#define SCS_VERSION_STR \"${short_revision}\"") + message (FATAL_ERROR "Archived source revision was not written to scs_version.h") +endif () diff --git a/tests/release/test_release_state.cmake b/tests/release/test_release_state.cmake new file mode 100644 index 00000000..047669fe --- /dev/null +++ b/tests/release/test_release_state.cmake @@ -0,0 +1,123 @@ +cmake_minimum_required (VERSION 3.12) + +if (NOT SOURCE_DIR) + message (FATAL_ERROR "SOURCE_DIR is required") +endif () + +include ("${SOURCE_DIR}/CMake/Modules/read_release_state.cmake") + +function (assert_equal actual expected description) + if (NOT "${actual}" STREQUAL "${expected}") + message (FATAL_ERROR "${description}: expected '${expected}', got '${actual}'") + endif () +endfunction () + +function (expect_invalid name contents) + set (_fixture "${_fixture_dir}/${name}.txt") + file (WRITE "${_fixture}" "${contents}") + execute_process ( + COMMAND "${CMAKE_COMMAND}" + -D RELEASE_STATE_READER=${SOURCE_DIR}/CMake/Modules/read_release_state.cmake + -D RELEASE_STATE_FILE=${_fixture} + -P ${SOURCE_DIR}/tests/release/validate_release_state_fixture.cmake + RESULT_VARIABLE invalid_result + OUTPUT_QUIET + ERROR_QUIET) + if (invalid_result EQUAL 0) + message (FATAL_ERROR "Invalid release state was accepted: ${name}") + endif () +endfunction () + +wsjt_read_release_state ( + "${SOURCE_DIR}/release-state.txt" + version channel rc revision) + +if (EXPECT_ARCHIVE_REVISION) + assert_equal ("${revision}" "${EXPECT_ARCHIVE_REVISION}" "archive revision") +else () + assert_equal ("${revision}" "" "working-tree archive placeholder") +endif () + +if (TEST_BINARY_DIR) + set (_fixture_dir "${TEST_BINARY_DIR}") +else () + set (_fixture_dir "${CMAKE_CURRENT_BINARY_DIR}/release-state-test") +endif () +file (MAKE_DIRECTORY "${_fixture_dir}") +file (WRITE "${_fixture_dir}/rc.txt" + "version=3.2.0\nchannel=RC\nrc=7\nrevision=0123456789abcdef0123456789abcdef01234567\n") +wsjt_read_release_state ( + "${_fixture_dir}/rc.txt" + version channel rc revision) +assert_equal ("${channel}" "RC" "RC channel") +assert_equal ("${rc}" "7" "RC number") +assert_equal ("${revision}" "0123456789abcdef0123456789abcdef01234567" "expanded revision") + +file (WRITE "${_fixture_dir}/unsigned.txt" + "version=3.2.0\nchannel=RC\nrc=1\nrevision=$Format:%H$\nwindows_signing=unsigned\n") +wsjt_read_release_state ( + "${_fixture_dir}/unsigned.txt" + version channel rc revision) +assert_equal ("${channel}" "RC" "unsigned release channel") +assert_equal ("${rc}" "1" "unsigned release number") + +file (WRITE "${_fixture_dir}/ga.txt" + "version=3.2.0\nchannel=GA\nrc=\nrevision=$Format:%H$\n") +wsjt_read_release_state ( + "${_fixture_dir}/ga.txt" + version channel rc revision) +assert_equal ("${channel}" "GA" "GA channel") +assert_equal ("${rc}" "" "GA RC number") + +expect_invalid (ga_with_rc + "version=3.2.0\nchannel=GA\nrc=1\nrevision=$Format:%H$\n") +expect_invalid (rc_without_number + "version=3.2.0\nchannel=RC\nrc=\nrevision=$Format:%H$\n") +expect_invalid (invalid_version + "version=3.2\nchannel=DEVEL\nrc=\nrevision=$Format:%H$\n") +expect_invalid (invalid_revision + "version=3.2.0\nchannel=DEVEL\nrc=\nrevision=not-a-git-object-id\n") +expect_invalid (unknown_key + "version=3.2.0\nchannel=DEVEL\nrc=\ncommit=$Format:%H$\n") +expect_invalid (invalid_windows_signing + "version=3.2.0\nchannel=RC\nrc=1\nrevision=$Format:%H$\nwindows_signing=ephemeral\n") +expect_invalid (duplicate_windows_signing + "version=3.2.0\nchannel=RC\nrc=1\nrevision=$Format:%H$\nwindows_signing=unsigned\nwindows_signing=unsigned\n") + +set (_cache_source "${_fixture_dir}/cache-source") +set (_cache_build "${_fixture_dir}/cache-build") +file (MAKE_DIRECTORY "${_cache_source}") +file (WRITE "${_cache_source}/CMakeLists.txt" + "cmake_minimum_required(VERSION 3.12)\n" + "project(release_cache NONE)\n" + "include(\"${SOURCE_DIR}/CMake/Modules/read_release_state.cmake\")\n" + "wsjt_read_release_state(\"${_cache_source}/state.txt\" version channel rc revision)\n" + "wsjt_set_source_default_cache(WSJT_RELEASE_CHANNEL \"\${channel}\" \"channel\")\n" + "wsjt_set_source_default_cache(WSJT_RC_NUMBER \"\${rc}\" \"rc\")\n" + "file(WRITE \"\${CMAKE_BINARY_DIR}/result.txt\" \"\${WSJT_RELEASE_CHANNEL}:\${WSJT_RC_NUMBER}\")\n") +file (WRITE "${_cache_source}/state.txt" + "version=3.2.0\nchannel=DEVEL\nrc=\nrevision=$Format:%H$\n") +execute_process ( + COMMAND "${CMAKE_COMMAND}" -S "${_cache_source}" -B "${_cache_build}" + RESULT_VARIABLE cache_result OUTPUT_QUIET ERROR_QUIET) +if (NOT cache_result EQUAL 0) + message (FATAL_ERROR "Initial release cache configure failed") +endif () +file (WRITE "${_cache_source}/state.txt" + "version=3.2.0\nchannel=RC\nrc=2\nrevision=$Format:%H$\n") +execute_process ( + COMMAND "${CMAKE_COMMAND}" -S "${_cache_source}" -B "${_cache_build}" + RESULT_VARIABLE cache_result OUTPUT_QUIET ERROR_QUIET) +file (READ "${_cache_build}/result.txt" cache_result_value) +assert_equal ("${cache_result_value}" "RC:2" "tracked metadata refresh") + +set (_override_build "${_fixture_dir}/override-build") +execute_process ( + COMMAND "${CMAKE_COMMAND}" -S "${_cache_source}" -B "${_override_build}" + -D WSJT_RELEASE_CHANNEL=GA -D WSJT_RC_NUMBER= + RESULT_VARIABLE override_result OUTPUT_QUIET ERROR_QUIET) +if (NOT override_result EQUAL 0) + message (FATAL_ERROR "Explicit release cache override configure failed") +endif () +file (READ "${_override_build}/result.txt" override_result_value) +assert_equal ("${override_result_value}" "GA:" "explicit cache override") diff --git a/tests/release/validate_release_state_fixture.cmake b/tests/release/validate_release_state_fixture.cmake new file mode 100644 index 00000000..6218e55b --- /dev/null +++ b/tests/release/validate_release_state_fixture.cmake @@ -0,0 +1,6 @@ +cmake_minimum_required (VERSION 3.12) + +include ("${RELEASE_STATE_READER}") +wsjt_read_release_state ( + "${RELEASE_STATE_FILE}" + version channel rc revision) diff --git a/tests/sanitizers/tsan-fortran.supp b/tests/sanitizers/tsan-fortran.supp new file mode 100644 index 00000000..1c020cf2 --- /dev/null +++ b/tests/sanitizers/tsan-fortran.supp @@ -0,0 +1,7 @@ +# ThreadSanitizer suppressions for tests linked with the common Fortran +# runtime. +# +# libgfortran's I/O-unit lock ordering is a classified third-party false +# positive in deterministic Fortran tests. Keep this scope on tests that +# exercise that runtime path. Tracked as WSJT-X#292. +deadlock:libgfortran.so diff --git a/tests/sanitizers/tsan-gui.supp b/tests/sanitizers/tsan-gui.supp new file mode 100644 index 00000000..40aaa34b --- /dev/null +++ b/tests/sanitizers/tsan-gui.supp @@ -0,0 +1,56 @@ +# ThreadSanitizer suppressions for GUI, Qt-multimedia, and live-audio tests. +# +# These reports are dependency-internal startup, bearer, and event-loop +# reports observed with the Arch Qt/GLib/GIO/DBus stack. Keep the scope on +# GUI integration and JTTY multimedia tests so ordinary unit tests retain the +# baseline signal. +# CMake combines this file with tsan.supp before assigning TSAN_OPTIONS. + +# GLib/GIO gdbus cleanup and socket races. +race:g_main_context_unref +race:g_source_dup_context +race:g_hash_table_unref +race:g_str_equal +race:g_queue_pop_head +race:g_socket_send_message_with_timeout +race:g_bytes_unref +race:g_queue_foreach +race:g_slice_free_chain_with_offset +race:g_dbus_connection_signal_subscribe +race:g_dbus_message_set_num_unix_fds +race:g_dbus_connection_call_with_unix_fd_list_sync +race:g_dbus_proxy_new_for_bus_sync + +# Qt event-loop and network-bearer startup/teardown races. +race:QArrayData::allocate +race:QCoreApplication::event +race:QCoreApplication::removePostedEvents +race:QCoreApplicationPrivate::sendPostedEvents +race:QCoreApplication::postEvent +race:QWaitCondition::wakeAll +race:QWaitCondition::~QWaitCondition +race:QObjectPrivate::Connection::~Connection +race:QObjectPrivate::ConnectionData::deleteOrphaned +race:QThreadPoolPrivate::reset +race:QMetaType::destroy +race:QMetaCallEvent::~QMetaCallEvent +race:QMetaObjectBuilder::relatedMetaObjectCount +race:QMetaType::unregisterConverterFunction +race:dbus_connection_get_is_connected + +# Qt/DBus lock-order in the uninstrumented system library. +deadlock:libdbus-1.so + +# The JTTY live-audio harness also launches sjtty. Its only report is the +# same classified libgfortran I/O-unit lock ordering as the Fortran tests. +deadlock:libgfortran.so + +# Additional DBus internals reported by the Arch DBus build. +race:_dbus_message_loader_get_buffer +race:_dbus_user_database_unlock_system +race:_dbus_string_init_const +race:dbus_connection_preallocate_send +race:dbus_bus_register +race:dbus_connection_remove_filter +race:dbus_connection_close +race:g_variant_builder_add_parsed diff --git a/tests/sanitizers/tsan-network.supp b/tests/sanitizers/tsan-network.supp new file mode 100644 index 00000000..e201547c --- /dev/null +++ b/tests/sanitizers/tsan-network.supp @@ -0,0 +1,48 @@ +# ThreadSanitizer suppressions for the network unit-test family. +# +# These reports were observed with Qt 5.15's network bearer and the Arch +# GLib/GIO stack. The conflicting accesses remain inside the dependencies; +# application and test frames only initiate or exercise the network paths. +# Keep this file scoped to the tests that exercise those paths. CMake +# combines it with tsan.supp before assigning TSAN_OPTIONS. + +# GLib/GIO gdbus cleanup and socket races. +race:g_main_context_unref +race:g_source_dup_context +race:g_hash_table_unref +race:g_str_equal +race:g_queue_pop_head +race:g_socket_send_message_with_timeout +race:g_bytes_unref +race:g_queue_foreach +race:g_slice_free_chain_with_offset +race:g_dbus_connection_signal_subscribe +race:g_dbus_message_set_num_unix_fds +race:g_dbus_connection_call_with_unix_fd_list_sync +race:g_dbus_proxy_new_for_bus_sync + +# Qt 5.15 network bearer startup and teardown races. +race:QArrayData::allocate +race:QCoreApplication::event +race:QCoreApplication::removePostedEvents +race:QCoreApplicationPrivate::sendPostedEvents +race:QCoreApplication::postEvent +race:QWaitCondition::wakeAll +race:QWaitCondition::~QWaitCondition +race:QObjectPrivate::Connection::~Connection +race:QObjectPrivate::ConnectionData::deleteOrphaned +race:QMetaObjectBuilder::relatedMetaObjectCount +race:QMetaType::unregisterConverterFunction +race:dbus_connection_get_is_connected + +# Qt/DBus lock-order in the uninstrumented system library. +deadlock:libdbus-1.so + +# Additional DBus internals reported by the Arch DBus build. +race:_dbus_message_loader_get_buffer +race:_dbus_user_database_unlock_system +race:_dbus_string_init_const +race:dbus_connection_preallocate_send +race:dbus_bus_register +race:dbus_connection_remove_filter +race:dbus_connection_close diff --git a/tests/sanitizers/tsan.supp b/tests/sanitizers/tsan.supp new file mode 100644 index 00000000..83014c77 --- /dev/null +++ b/tests/sanitizers/tsan.supp @@ -0,0 +1,57 @@ +# ThreadSanitizer suppressions for cross-cutting classified third-party reports. +# +# Hamlib is statically linked in the TSan prefix, so called_from_lib +# cannot be used for it. Match the SUMMARY functions from the +# classified 4.7.2 reports instead. +# +# Local runs should use an absolute path: +# TSAN_OPTIONS=halt_on_error=0:second_deadlock_stack=1:suppressions=/abs/path/tests/sanitizers/tsan.supp +# +# Do not suppress MainWindow::decode, Detector::writeData, or other +# in-tree frames. Those remain the advisory TSan signal. + +# Hamlib 4.7.2 cache and routing races. +# Upstream: Hamlib#2146. Remove after the WSJT-X Hamlib pin includes it. +race:rig_set_cache_freq +race:rig_set_cache_mode +race:rig_get_freq +race:rig_get_vfo +race:rig_poll_routine_stop + +# Hamlib 4.7.x debug-buffer race during rig_open. +# Match only the known shared buffer; retain visibility for other rig_open races. +race:debugmsgsave2 + +# Hamlib 4.7 Morse worker stop-flag race. +# Upstream: Hamlib#2109 / backport Hamlib#2126. Remove after that release. +race:morse_data_handler_stop + +# Boost.Log 1.83 publishes asynchronous queue nodes with relaxed atomics; +# the Arch investigation used Boost.Log 1.92.0. Function names and report +# coverage may change between Boost releases, so revalidate after upgrades. +# These reports leave TSan without a producer/consumer happens-before edge for +# the record payload. Match the queue operations and resulting attribute +# detachment reports without suppressing application logging frames. +race:boost::log::v2_mt_posix::aux::threadsafe_queue +race:boost::log::v2_mt_posix::attribute_value::detach_from_thread + +# Additional Boost.Log asynchronous record and attribute lifetime reports. +# These match the reported Boost.Log classes/functions without suppressing +# WSJT-X logging call sites or the entire Boost library. +race:boost::log::v2_mt_posix::attributes::attribute_value_impl +race:boost::log::v2_mt_posix::attribute_value::dispatch +race:boost::log::v2_mt_posix::attribute_value::impl +race:boost::log::v2_mt_posix::attribute_value_set::~attribute_value_set +race:boost::log::v2_mt_posix::record_view::public_data::destroy +race:boost::log::v2_mt_posix::intrusive_ptr_release + +# Additional Boost 1.92 formatting and attribute lifetime frames from the +# asynchronous logging path. Keep these tied to the reported Boost types; +# do not suppress generic std::string or unsymbolized Boost frames. +race:boost::intrusive_ptr::operator bool +race:boost::date_time::int_adapter::as_number +race:boost::date_time::int_adapter::is_nan + +# Dependency suppressions that only apply to Fortran-backed, network, or GUI tests +# live in tsan-fortran.supp, tsan-network.supp, and tsan-gui.supp. CMake +# combines each scope file with this baseline before assigning TSAN_OPTIONS. diff --git a/tests/test_bwf_file.cpp b/tests/test_bwf_file.cpp deleted file mode 100644 index 55f42e32..00000000 --- a/tests/test_bwf_file.cpp +++ /dev/null @@ -1,354 +0,0 @@ -#include - -#include -#include -#include - -#include "Audio/BWFFile.hpp" - -namespace -{ - QByteArray le16 (quint16 value) - { - QByteArray bytes (2, '\0'); - bytes[0] = static_cast (value & 0xffu); - bytes[1] = static_cast ((value >> 8) & 0xffu); - return bytes; - } - - QByteArray le32 (quint32 value) - { - QByteArray bytes (4, '\0'); - bytes[0] = static_cast (value & 0xffu); - bytes[1] = static_cast ((value >> 8) & 0xffu); - bytes[2] = static_cast ((value >> 16) & 0xffu); - bytes[3] = static_cast ((value >> 24) & 0xffu); - return bytes; - } - - QByteArray chunk (char const * id, QByteArray const& payload) - { - QByteArray out; - out.append (id, 4); - out.append (le32 (static_cast (payload.size ()))); - out.append (payload); - if (payload.size () & 1) - { - out.append ('\0'); - } - return out; - } - - QByteArray wave_file (QList const& chunks) - { - QByteArray payload {"WAVE", 4}; - for (auto const& current : chunks) - { - payload.append (current); - } - - QByteArray out; - out.append ("RIFF", 4); - out.append (le32 (static_cast (payload.size ()))); - out.append (payload); - return out; - } - - QByteArray fmt_chunk (quint16 channels = 1, quint32 sample_rate = 12000, - quint16 bits_per_sample = 16, quint16 block_align = 0, - quint32 byte_rate = 0) - { - if (!block_align) - { - block_align = static_cast (channels * (bits_per_sample / 8u)); - } - if (!byte_rate) - { - byte_rate = sample_rate * block_align; - } - - QByteArray payload; - payload.append (le16 (1)); - payload.append (le16 (channels)); - payload.append (le32 (sample_rate)); - payload.append (le32 (byte_rate)); - payload.append (le16 (block_align)); - payload.append (le16 (bits_per_sample)); - return chunk ("fmt ", payload); - } - - QByteArray data_chunk (QByteArray const& data = {}) - { - return chunk ("data", data); - } - - QByteArray info_list_chunk () - { - QByteArray payload {"INFO", 4}; - payload.append (chunk ("INAM", QByteArray {"wsjtx", 5})); - return chunk ("LIST", payload); - } - - QByteArray info_list_chunk_with_terminal_pad_outside_size () - { - QByteArray payload {"INFO", 4}; - payload.append ("ISRC", 4); - payload.append (le32 (5)); - payload.append ("K1JT", 5); - - QByteArray out; - out.append ("LIST", 4); - out.append (le32 (static_cast (payload.size ()))); - out.append (payload); - out.append ('\0'); - return out; - } - - QByteArray bare_bext_payload () - { - return QByteArray (604, '\0'); - } - - QAudioFormat default_format () - { - QAudioFormat format; - format.setByteOrder (QAudioFormat::LittleEndian); - format.setChannelCount (1); - format.setCodec ("audio/pcm"); - format.setSampleRate (12000); - format.setSampleSize (16); - format.setSampleType (QAudioFormat::SignedInt); - return format; - } - - QString write_temp_file (QByteArray const& data) - { - QTemporaryFile file; - file.setAutoRemove (false); - if (!file.open ()) - { - return {}; - } - - if (file.write (data) != data.size ()) - { - return {}; - } - - auto const name = file.fileName (); - file.close (); - return name; - } -} - -class TestBWFFile - : public QObject -{ - Q_OBJECT - -private: - Q_SLOT void opens_valid_pcm_wave () - { - auto const name = write_temp_file (wave_file ({fmt_chunk (), data_chunk ()})); - QVERIFY (!name.isEmpty ()); - - BWFFile file {default_format (), name}; - QVERIFY (file.open (QIODevice::ReadOnly)); - QCOMPARE (file.format ().channelCount (), 1); - QCOMPARE (file.format ().sampleRate (), 12000); - file.close (); - QFile::remove (name); - } - - Q_SLOT void opens_valid_list_info_chunk () - { - auto const name = write_temp_file (wave_file ({fmt_chunk (), info_list_chunk (), data_chunk ()})); - QVERIFY (!name.isEmpty ()); - BWFFile::InfoDictionary::key_type const inam {{'I', 'N', 'A', 'M'}}; - QByteArray const expected_name {"wsjtx", 5}; - - BWFFile file {default_format (), name}; - QVERIFY (file.open (QIODevice::ReadOnly)); - QVERIFY (file.list_info ().contains (inam)); - QCOMPARE (file.list_info ().value (inam), expected_name); - file.close (); - QFile::remove (name); - } - - Q_SLOT void opens_list_info_with_terminal_subchunk_pad () - { - auto const name = write_temp_file (wave_file ({fmt_chunk (), data_chunk (), - info_list_chunk_with_terminal_pad_outside_size ()})); - QVERIFY (!name.isEmpty ()); - BWFFile::InfoDictionary::key_type const isrc {{'I', 'S', 'R', 'C'}}; - - BWFFile file {default_format (), name}; - QVERIFY (file.open (QIODevice::ReadOnly)); - QVERIFY (file.list_info ().contains (isrc)); - QCOMPARE (file.list_info ().value (isrc), QByteArray ("K1JT", 5)); - file.close (); - QFile::remove (name); - } - - Q_SLOT void bext_version_without_chunk_defaults_to_v0 () - { - auto const name = write_temp_file (wave_file ({fmt_chunk (), data_chunk ()})); - QVERIFY (!name.isEmpty ()); - - BWFFile file {default_format (), name}; - BWFFile const& const_file = file; - QVERIFY (file.open (QIODevice::ReadOnly)); - QCOMPARE (static_cast (const_file.bext_version ()), - static_cast (BWFFile::BextVersion::v_0)); - file.close (); - QFile::remove (name); - } - - Q_SLOT void bext_fixed_field_getter_stays_bounded () - { - QByteArray bext = bare_bext_payload (); - bext.replace (0, 256, QByteArray (256, 'B')); - auto const name = write_temp_file (wave_file ({fmt_chunk (), chunk ("bext", bext), data_chunk ()})); - QVERIFY (!name.isEmpty ()); - - BWFFile file {default_format (), name}; - QVERIFY (file.open (QIODevice::ReadOnly)); - QCOMPARE (file.bext_description (), QByteArray (256, 'B')); - file.close (); - QFile::remove (name); - } - - Q_SLOT void bext_origination_date_time_stays_bounded () - { - QByteArray bext = bare_bext_payload (); - bext.replace (320, 10, QByteArray {"2026-04-06", 10}); - bext.replace (330, 10, QByteArray {"12-34-56ZZ", 10}); - auto const name = write_temp_file (wave_file ({fmt_chunk (), chunk ("bext", bext), data_chunk ()})); - QVERIFY (!name.isEmpty ()); - - BWFFile file {default_format (), name}; - QVERIFY (file.open (QIODevice::ReadOnly)); - QCOMPARE (file.bext_origination_date_time ().date (), QDate (2026, 4, 6)); - QCOMPARE (file.bext_origination_date_time ().time (), QTime (12, 34, 56)); - file.close (); - QFile::remove (name); - } - - Q_SLOT void bext_origination_date_time_setter_handles_invalid_value () - { - QTemporaryFile temp; - temp.setAutoRemove (false); - QVERIFY (temp.open ()); - auto const name = temp.fileName (); - temp.close (); - - { - BWFFile file {default_format (), name}; - QVERIFY (file.open (QIODevice::WriteOnly)); - file.bext_origination_date_time ({}); - file.close (); - } - - { - BWFFile file {default_format (), name}; - QVERIFY (file.open (QIODevice::ReadOnly)); - QVERIFY (!file.bext_origination_date_time ().isValid ()); - file.close (); - } - - QFile::remove (name); - } - - Q_SLOT void bext_setter_truncates_without_overread () - { - QTemporaryFile temp; - temp.setAutoRemove (false); - QVERIFY (temp.open ()); - auto const name = temp.fileName (); - temp.close (); - - { - BWFFile file {default_format (), name}; - QVERIFY (file.open (QIODevice::WriteOnly)); - file.bext_description (QByteArray (300, 'A')); - file.close (); - } - - { - BWFFile file {default_format (), name}; - QVERIFY (file.open (QIODevice::ReadOnly)); - QCOMPARE (file.bext_description (), QByteArray (256, 'A')); - file.close (); - } - - QFile::remove (name); - } - - Q_SLOT void rejects_truncated_bext_chunk () - { - QByteArray bad_bext; - bad_bext.append ("bext", 4); - bad_bext.append (le32 (700)); - bad_bext.append (QByteArray (16, '\0')); - auto const name = write_temp_file (wave_file ({fmt_chunk (), bad_bext, data_chunk ()})); - QVERIFY (!name.isEmpty ()); - - BWFFile file {default_format (), name}; - QVERIFY (!file.open (QIODevice::ReadOnly)); - QFile::remove (name); - } - - Q_SLOT void rejects_list_info_subchunk_overrun () - { - QByteArray payload {"INFO", 4}; - payload.append ("INAM", 4); - payload.append (le32 (8)); - payload.append ("bad", 3); - auto const name = write_temp_file (wave_file ({fmt_chunk (), chunk ("LIST", payload), data_chunk ()})); - QVERIFY (!name.isEmpty ()); - - BWFFile file {default_format (), name}; - QVERIFY (!file.open (QIODevice::ReadOnly)); - QFile::remove (name); - } - - Q_SLOT void rejects_short_fmt_chunk () - { - QByteArray payload; - payload.append (le16 (1)); - payload.append (le16 (1)); - auto const name = write_temp_file (wave_file ({chunk ("fmt ", payload), data_chunk ()})); - QVERIFY (!name.isEmpty ()); - - BWFFile file {default_format (), name}; - QVERIFY (!file.open (QIODevice::ReadOnly)); - QFile::remove (name); - } - - Q_SLOT void rejects_zero_channel_fmt () - { - auto const name = write_temp_file (wave_file ({fmt_chunk (0), data_chunk ()})); - QVERIFY (!name.isEmpty ()); - - BWFFile file {default_format (), name}; - QVERIFY (!file.open (QIODevice::ReadOnly)); - QFile::remove (name); - } - - Q_SLOT void tolerates_inconsistent_fmt_rates () - { - auto const name = write_temp_file (wave_file ({fmt_chunk (1, 12000, 16, 4, 48000), data_chunk ()})); - QVERIFY (!name.isEmpty ()); - - BWFFile file {default_format (), name}; - QVERIFY (file.open (QIODevice::ReadOnly)); - QCOMPARE (file.format ().sampleRate (), 12000); - QCOMPARE (file.format ().sampleSize (), 16); - file.close (); - QFile::remove (name); - } -}; - -QTEST_MAIN (TestBWFFile) - -#include "test_bwf_file.moc" diff --git a/tests/test_emulate_split_transceiver.cpp b/tests/test_emulate_split_transceiver.cpp deleted file mode 100644 index 13482b62..00000000 --- a/tests/test_emulate_split_transceiver.cpp +++ /dev/null @@ -1,113 +0,0 @@ -#include - -#include - -#include "Transceiver/EmulateSplitTransceiver.hpp" - -class FakeTransceiver final - : public Transceiver -{ - Q_OBJECT - -public: - FakeTransceiver () - : Transceiver {nullptr, nullptr} - { - } - - void set (TransceiverState const& state, unsigned sequence_number) noexcept override - { - last_state = state; - last_sequence_number = sequence_number; - } - - void start (unsigned sequence_number) noexcept override - { - last_sequence_number = sequence_number; - } - - void stop () noexcept override {} - - void send_update (TransceiverState const& state, unsigned sequence_number) - { - Q_EMIT update (state, sequence_number); - } - - TransceiverState last_state; - unsigned last_sequence_number {0}; -}; - -class TestEmulateSplitTransceiver : public QObject -{ - Q_OBJECT - -private: - Q_SLOT void fakeSplitDoesNotPublishTransientTxDialAsRxDial () - { - auto * raw_fake = new FakeTransceiver; - EmulateSplitTransceiver transceiver {nullptr, std::unique_ptr {raw_fake}}; - QSignalSpy updates {&transceiver, &Transceiver::update}; - - Transceiver::TransceiverState requested; - requested.online (true); - requested.frequency (7074000); - requested.tx_frequency (7072500); - requested.split (true); - requested.ptt (true); - - transceiver.set (requested, 17); - - QCOMPARE (raw_fake->last_state.frequency (), requested.tx_frequency ()); - QCOMPARE (raw_fake->last_state.tx_frequency (), Transceiver::Frequency {0}); - QVERIFY (!raw_fake->last_state.split ()); - - Transceiver::TransceiverState wrapped_update; - wrapped_update.online (true); - wrapped_update.frequency (requested.tx_frequency ()); - wrapped_update.split (false); - wrapped_update.ptt (false); - - raw_fake->send_update (wrapped_update, 17); - - QCOMPARE (updates.size (), 1); - auto const published = qvariant_cast (updates.takeFirst ().at (0)); - QCOMPARE (published.frequency (), requested.frequency ()); - QCOMPARE (published.tx_frequency (), requested.tx_frequency ()); - QVERIFY (published.split ()); - QVERIFY (!published.ptt ()); - } - - Q_SLOT void receiveModeStillFollowsManualRigQsy () - { - auto * raw_fake = new FakeTransceiver; - EmulateSplitTransceiver transceiver {nullptr, std::unique_ptr {raw_fake}}; - QSignalSpy updates {&transceiver, &Transceiver::update}; - - Transceiver::TransceiverState requested; - requested.online (true); - requested.frequency (7074000); - requested.tx_frequency (7072500); - requested.split (true); - requested.ptt (false); - - transceiver.set (requested, 18); - - Transceiver::TransceiverState wrapped_update; - wrapped_update.online (true); - wrapped_update.frequency (14074000); - wrapped_update.split (false); - wrapped_update.ptt (false); - - raw_fake->send_update (wrapped_update, 18); - - QCOMPARE (updates.size (), 1); - auto const published = qvariant_cast (updates.takeFirst ().at (0)); - QCOMPARE (published.frequency (), wrapped_update.frequency ()); - QCOMPARE (published.tx_frequency (), requested.tx_frequency ()); - QVERIFY (published.split ()); - QVERIFY (!published.ptt ()); - } -}; - -QTEST_MAIN (TestEmulateSplitTransceiver) -#include "test_emulate_split_transceiver.moc" diff --git a/tests/test_http_user_agent.cpp b/tests/test_http_user_agent.cpp deleted file mode 100644 index 0bc09ea1..00000000 --- a/tests/test_http_user_agent.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include - -#include "revision_utils.hpp" - -class TestHttpUserAgent final - : public QObject -{ - Q_OBJECT - -private Q_SLOTS: - void includesApplicationIdentityAndPlatformContext () - { - auto const user_agent = http_user_agent (); - - QVERIFY (user_agent.startsWith ("WSJT-X/")); - QVERIFY (user_agent.contains (version ())); - - auto const build_revision = revision (); - if (!build_revision.isEmpty ()) - { - QVERIFY (user_agent.contains ("_" + build_revision)); - } - - QVERIFY (user_agent.contains ('(')); - QVERIFY (user_agent.contains (')')); - QVERIFY (!user_agent.contains ('\n')); - QVERIFY (!user_agent.contains ('\r')); - } -}; - -QTEST_GUILESS_MAIN (TestHttpUserAgent) - -#include "test_http_user_agent.moc" diff --git a/tests/test_qt_helpers.cpp b/tests/test_qt_helpers.cpp deleted file mode 100644 index 195c16e0..00000000 --- a/tests/test_qt_helpers.cpp +++ /dev/null @@ -1,212 +0,0 @@ -#include -#include -#include - -#include "qt_helpers.hpp" - -class TestQtHelpers - : public QObject -{ - Q_OBJECT - -public: - -private: - Q_SLOT void round_15s_date_time_up () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 500}}; - QCOMPARE (qt_round_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 30))); - } - - Q_SLOT void truncate_15s_date_time_up () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 500}}; - QCOMPARE (qt_truncate_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); - } - - Q_SLOT void round_15s_date_time_down () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 499}}; - QCOMPARE (qt_round_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); - } - - Q_SLOT void truncate_15s_date_time_down () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 499}}; - QCOMPARE (qt_truncate_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); - } - - Q_SLOT void round_15s_date_time_on () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 15}}; - QCOMPARE (qt_round_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); - } - - Q_SLOT void truncate_15s_date_time_on () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 15}}; - QCOMPARE (qt_truncate_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); - } - - Q_SLOT void round_15s_date_time_under () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 14, 999}}; - QCOMPARE (qt_round_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); - } - - Q_SLOT void truncate_15s_date_time_under () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 14, 999}}; - QCOMPARE (qt_truncate_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15))); - } - - Q_SLOT void round_15s_date_time_over () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 15, 1}}; - QCOMPARE (qt_round_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); - } - - Q_SLOT void truncate_15s_date_time_over () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 15, 1}}; - QCOMPARE (qt_truncate_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); - } - - Q_SLOT void round_7p5s_date_time_up () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 26, 250}}; - QCOMPARE (qt_round_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 30))); - } - - Q_SLOT void truncate_7p5s_date_time_up () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 26, 250}}; - QCOMPARE (qt_truncate_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); - } - - Q_SLOT void round_7p5s_date_time_down () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 26, 249}}; - QCOMPARE (qt_round_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); - } - - Q_SLOT void truncate_7p5s_date_time_down () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 26, 249}}; - QCOMPARE (qt_truncate_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); - } - - Q_SLOT void round_7p5s_date_time_on () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 500}}; - QCOMPARE (qt_round_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); - } - - Q_SLOT void truncate_7p5s_date_time_on () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 500}}; - QCOMPARE (qt_truncate_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); - } - - Q_SLOT void round_7p5s_date_time_under () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 499}}; - QCOMPARE (qt_round_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); - } - - Q_SLOT void truncate_7p5s_date_time_under () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 499}}; - QCOMPARE (qt_truncate_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); - } - - Q_SLOT void round_7p5s_date_time_over () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 501}}; - QCOMPARE (qt_round_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); - } - - Q_SLOT void truncate_7p5s_date_time_over () - { - QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 501}}; - QCOMPARE (qt_truncate_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); - } - - Q_SLOT void is_multicast_address_data () - { - QTest::addColumn ("addr"); - QTest::addColumn ("result"); - - QTest::newRow ("loopback") << "127.0.0.1" << false; - QTest::newRow ("looback IPv6") << "::1" << false; - QTest::newRow ("lowest-") << "223.255.255.255" << false; - QTest::newRow ("lowest") << "224.0.0.0" << true; - QTest::newRow ("lowest- IPv6") << "feff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" << false; - QTest::newRow ("lowest IPv6") << "ff00::" << true; - QTest::newRow ("highest") << "239.255.255.255" << true; - QTest::newRow ("highest+") << "240.0.0.0" << false; - QTest::newRow ("highest IPv6") << "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" << true; - } - - Q_SLOT void is_multicast_address () - { - QFETCH (QString, addr); - QFETCH (bool, result); - - QCOMPARE (::is_multicast_address (QHostAddress {addr}), result); - } - - Q_SLOT void is_MAC_ambiguous_multicast_address_data () - { - QTest::addColumn ("addr"); - QTest::addColumn ("result"); - - QTest::newRow ("loopback") << "127.0.0.1" << false; - QTest::newRow ("looback IPv6") << "::1" << false; - - QTest::newRow ("lowest- R1") << "223.255.255.255" << false; - QTest::newRow ("lowest R1") << "224.0.0.0" << false; - QTest::newRow ("highest R1") << "224.0.0.255" << false; - QTest::newRow ("highest+ R1") << "224.0.1.0" << false; - QTest::newRow ("lowest- R1A") << "224.127.255.255" << false; - QTest::newRow ("lowest R1A") << "224.128.0.0" << true; - QTest::newRow ("highest R1A") << "224.128.0.255" << true; - QTest::newRow ("highest+ R1A") << "224.128.1.0" << false; - - QTest::newRow ("lowest- R2") << "224.255.255.255" << false; - QTest::newRow ("lowest R2") << "225.0.0.0" << true; - QTest::newRow ("highest R2") << "225.0.0.255" << true; - QTest::newRow ("highest+ R2") << "225.0.1.0" << false; - QTest::newRow ("lowest- R2A") << "225.127.255.255" << false; - QTest::newRow ("lowest R2A") << "225.128.0.0" << true; - QTest::newRow ("highest R2A") << "225.128.0.255" << true; - QTest::newRow ("highest+ R2A") << "225.128.1.0" << false; - - QTest::newRow ("lowest- R3") << "238.255.255.255" << false; - QTest::newRow ("lowest R3") << "239.0.0.0" << true; - QTest::newRow ("highest R3") << "239.0.0.255" << true; - QTest::newRow ("highest+ R3") << "239.0.1.0" << false; - QTest::newRow ("lowest- R3A") << "239.127.255.255" << false; - QTest::newRow ("lowest R3A") << "239.128.0.0" << true; - QTest::newRow ("highest R3A") << "239.128.0.255" << true; - QTest::newRow ("highest+ R3A") << "239.128.1.0" << false; - - QTest::newRow ("lowest- IPv6") << "feff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" << false; - QTest::newRow ("lowest IPv6") << "ff00::" << false; - QTest::newRow ("highest") << "239.255.255.255" << false; - QTest::newRow ("highest+") << "240.0.0.0" << false; - QTest::newRow ("highest IPv6") << "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" << false; - } - - Q_SLOT void is_MAC_ambiguous_multicast_address () - { - QFETCH (QString, addr); - QFETCH (bool, result); - - QCOMPARE (::is_MAC_ambiguous_multicast_address (QHostAddress {addr}), result); - } -}; - -QTEST_MAIN (TestQtHelpers); - -#include "test_qt_helpers.moc" diff --git a/tests/unit/audio/CMakeLists.txt b/tests/unit/audio/CMakeLists.txt new file mode 100644 index 00000000..a279a713 --- /dev/null +++ b/tests/unit/audio/CMakeLists.txt @@ -0,0 +1,134 @@ +add_executable (test_bwf_file test_bwf_file.cpp) +target_link_libraries (test_bwf_file wsjt_qtmm wsjt_qt Qt5::Test Qt5::Multimedia) +add_test (NAME test_bwf_file COMMAND test_bwf_file) +if (WSJT_ENABLE_TSAN) + set_tests_properties (test_bwf_file PROPERTIES + ENVIRONMENT "QT_QPA_PLATFORM=offscreen") +endif () + +if (WSJT_BUILD_UTILS) + add_executable (test_echosim_wav_trailer test_echosim_wav_trailer.cpp) + target_link_libraries (test_echosim_wav_trailer wsjt_qtmm Qt5::Test Qt5::Multimedia) + target_compile_definitions (test_echosim_wav_trailer PRIVATE + ECHOSIM_EXECUTABLE="$") + add_dependencies (test_echosim_wav_trailer echosim) + add_test (NAME test_echosim_wav_trailer COMMAND test_echosim_wav_trailer) +endif () + +add_executable (test_wav_input_loading + test_wav_input_loading.cpp + ${CMAKE_SOURCE_DIR}/Audio/WavInputLoader.cpp) +target_link_libraries (test_wav_input_loading + wsjt_qtmm wsjt_qt wsjt_fort_common Qt5::Test Qt5::Multimedia) +add_test (NAME test_wav_input_loading COMMAND test_wav_input_loading) + +add_executable (test_wav_load_coordinator + test_wav_load_coordinator.cpp + ${CMAKE_SOURCE_DIR}/Audio/WavLoadCoordinator.cpp) +target_link_libraries (test_wav_load_coordinator wsjt_qt Qt5::Test) +add_test (NAME test_wav_load_coordinator COMMAND test_wav_load_coordinator) +set_tests_properties (test_wav_load_coordinator PROPERTIES TIMEOUT 15) + +add_executable (test_tx_playback_diagnostics + test_tx_playback_diagnostics.cpp + ${CMAKE_SOURCE_DIR}/Audio/TxPlaybackDiagnostics.cpp) +target_link_libraries (test_tx_playback_diagnostics Qt5::Core Qt5::Test) +add_test (NAME test_tx_playback_diagnostics COMMAND test_tx_playback_diagnostics) + +add_executable (test_tx_request test_tx_request.cpp) +target_link_libraries (test_tx_request Qt5::Test) +add_test (NAME test_tx_request COMMAND test_tx_request) + +add_executable (test_tx_audio_queue + test_tx_audio_queue.cpp + ${CMAKE_SOURCE_DIR}/Audio/TxAudioQueue.cpp + ${CMAKE_SOURCE_DIR}/Modulator/JttyPcmFifo.cpp) +target_link_libraries (test_tx_audio_queue Qt5::Core Qt5::Test) +add_test (NAME test_tx_audio_queue COMMAND test_tx_audio_queue) + +add_executable (test_audio_input_stream_descriptor + test_audio_input_stream_descriptor.cpp + ${CMAKE_SOURCE_DIR}/Audio/AudioDevice.cpp + ${CMAKE_SOURCE_DIR}/Audio/AudioInputSource.hpp + ${CMAKE_SOURCE_DIR}/Audio/FixtureAudioInput.cpp + ${CMAKE_SOURCE_DIR}/DecDataMutex.cpp + ${CMAKE_SOURCE_DIR}/Detector/Detector.cpp) +target_link_libraries (test_audio_input_stream_descriptor + wsjt_qtmm Qt5::Core Qt5::Test Qt5::Multimedia) +add_test (NAME test_audio_input_stream_descriptor + COMMAND test_audio_input_stream_descriptor) + +add_executable (test_receive_audio_handoff + test_receive_audio_handoff.cpp + receive_reference_probe.f90 + ${CMAKE_SOURCE_DIR}/Audio/AudioDevice.cpp + ${CMAKE_SOURCE_DIR}/DecDataMutex.cpp + ${CMAKE_SOURCE_DIR}/Detector/Detector.cpp) +target_link_libraries (test_receive_audio_handoff + wsjt_fort_common Qt5::Core Qt5::Test Qt5::Multimedia) +target_include_directories (test_receive_audio_handoff PRIVATE ${CMAKE_BINARY_DIR}) +set (receive_handoff_scenarios + downsamplersRetainIndependentHistory + producersRemainIsolatedAcrossSourceSwitch + queued_prefix_without_reuse + handoff_rejects_gaps_and_disk_stale_work + queued_period_must_retain_identity + reference_input_packetization + echo_metadata_vs_append + echo_metadata_vs_reset + stale_echo_metadata_must_not_modify_next_period) +add_test (NAME test_receive_audio_handoff + COMMAND test_receive_audio_handoff ${receive_handoff_scenarios}) + +# refspectrum has saved accumulation state, so keep DSP cases in fresh +# processes. +set (receive_handoff_isolated_scenarios + reference_measurement_vs_append + reference_measurement_vs_reset + reference_application_preserves_uncommitted_suffix + reference_application_packetization + reference_measurement_packetization) +set (receive_handoff_tests test_receive_audio_handoff) +foreach (scenario IN LISTS receive_handoff_isolated_scenarios) + add_test (NAME test_receive_${scenario} + COMMAND test_receive_audio_handoff ${scenario}) + list (APPEND receive_handoff_tests test_receive_${scenario}) +endforeach () +set_tests_properties (${receive_handoff_tests} PROPERTIES + TIMEOUT 30 LABELS "receive-handoff") +if (WSJT_ENABLE_TSAN) + # Do not inherit GUI event-dispatch suppressions: they can hide the very + # application callback accesses that these tests are intended to expose. + set_tests_properties (${receive_handoff_tests} PROPERTIES + ENVIRONMENT "TSAN_OPTIONS=halt_on_error=1:exitcode=66") + # Reference file I/O triggers a libgfortran-internal lock-order warning. + set_tests_properties ( + test_receive_reference_application_preserves_uncommitted_suffix + test_receive_reference_application_packetization + test_receive_reference_measurement_packetization PROPERTIES + ENVIRONMENT "TSAN_OPTIONS=halt_on_error=1:exitcode=66:detect_deadlocks=0") +endif () + +add_executable (test_fast_decode_ownership + test_fast_decode_ownership.cpp + ${CMAKE_SOURCE_DIR}/FastDecode.cpp + ${CMAKE_SOURCE_DIR}/Audio/AudioDevice.cpp + ${CMAKE_SOURCE_DIR}/DecDataMutex.cpp + ${CMAKE_SOURCE_DIR}/Detector/Detector.cpp) +target_link_libraries (test_fast_decode_ownership + wsjt_fort_common Qt5::Core Qt5::Test Qt5::Multimedia) +target_include_directories (test_fast_decode_ownership PRIVATE ${CMAKE_BINARY_DIR}) +add_test (NAME test_fast_decode_ownership COMMAND test_fast_decode_ownership + captures_submission_inputs capture_does_not_race_live_append + overlapping_jobs_retain_submission_identity) +set_tests_properties (test_fast_decode_ownership PROPERTIES + TIMEOUT 30 LABELS "receive-handoff;fast-decode-ownership") +if (WSJT_ENABLE_TSAN) + add_test (NAME test_fast_decode_overlap_does_not_race_decoder + COMMAND test_fast_decode_ownership + overlapping_submission_does_not_race_decoder) + set_tests_properties (test_fast_decode_ownership + test_fast_decode_overlap_does_not_race_decoder PROPERTIES + TIMEOUT 30 LABELS "receive-handoff;fast-decode-ownership" + ENVIRONMENT "TSAN_OPTIONS=halt_on_error=1:exitcode=66") +endif () diff --git a/tests/unit/audio/receive_reference_probe.f90 b/tests/unit/audio/receive_reference_probe.f90 new file mode 100644 index 00000000..71c43acd --- /dev/null +++ b/tests/unit/audio/receive_reference_probe.f90 @@ -0,0 +1,43 @@ +! Keep the production reference-spectrum implementation in this test. This +! bridge only supplies its flags and the compiler-specific CHARACTER argument. +subroutine receive_reference_probe(id2,ninput) bind(C) + use iso_c_binding, only: c_int16_t,c_int + implicit none + integer(c_int16_t) :: id2(*) + integer(c_int), value :: ninput + logical*1 :: clear, measure, apply + + clear=.false. + measure=.true. + apply=.false. + ! One measurement per process: refspectrum writes a file every fourth call. + call refspectrum(id2,ninput,clear,measure,apply,'unused-receive-reference.dat') +end subroutine + +! Exercise the production filter-application path. Build a deterministic, +! non-identity reference file in the test process so the write footprint is +! observable without relying on a user's writable-data directory. +subroutine receive_reference_apply_probe(id2,ninput) bind(C) + use iso_c_binding, only: c_int16_t,c_int + implicit none + integer(c_int16_t) :: id2(*) + integer(c_int), value :: ninput + logical*1 :: clear, measure, apply + integer :: i + real :: frequency + character(len=*), parameter :: path='receive-reference-apply.dat' + + open(16,file=path,status='replace') + write(16,'(3i5,5e25.16)') 400,2600,5,0.d0,0.d0,0.d0,0.d0,0.d0 + do i=1,3456 + frequency=12000.0*i/6912.0 + write(16,'(f10.3,e12.3,f12.6,e12.3,f12.6)') & + frequency,1.0,0.0,0.5,20.0*log10(0.5) + enddo + close(16) + + clear=.false. + measure=.false. + apply=.true. + call refspectrum(id2,ninput,clear,measure,apply,path) +end subroutine diff --git a/tests/unit/audio/test_audio_input_stream_descriptor.cpp b/tests/unit/audio/test_audio_input_stream_descriptor.cpp new file mode 100644 index 00000000..57698073 --- /dev/null +++ b/tests/unit/audio/test_audio_input_stream_descriptor.cpp @@ -0,0 +1,411 @@ +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "Audio/AudioDevice.hpp" +#include "Audio/AudioStreamClock.hpp" +#include "Audio/AudioStreamDescriptor.hpp" +#include "Audio/BWFFile.hpp" +#include "Audio/FixtureAudioInput.hpp" +#include "DecDataMutex.hpp" +#include "Detector/Detector.hpp" +#include "commons.h" + +namespace +{ + dec_data_t test_dec_data {}; + + void clear_dec_data (dec_data_t& data) + { + std::fill_n (data.ss, sizeof data.ss / sizeof *data.ss, 0.F); + std::fill_n (data.savg, sizeof data.savg / sizeof *data.savg, 0.F); + std::fill_n (data.sred, sizeof data.sred / sizeof *data.sred, 0.F); + std::fill_n (data.d2, sizeof data.d2 / sizeof *data.d2, 0); + data.params = {}; + } +} + +dec_data_t& dec_data = test_dec_data; + +extern "C" void fil4_state_ (qint16 *, qint32 *, qint16 *, qint32 *, float *) +{ +} + +namespace +{ + QAudioFormat pcmFormat (QAudioFormat::SampleType sampleType, + int sampleSize, QAudioFormat::Endian byteOrder, + int channels) + { + QAudioFormat format; + format.setByteOrder (byteOrder); + format.setChannelCount (channels); + format.setCodec ("audio/pcm"); + format.setSampleRate (12000); + format.setSampleSize (sampleSize); + format.setSampleType (sampleType); + return format; + } + + QString createJttyFixture () + { + QTemporaryFile temp; + temp.setAutoRemove (false); + if (!temp.open ()) + { + return {}; + } + auto const path = temp.fileName (); + temp.close (); + + BWFFile file { + pcmFormat (QAudioFormat::SignedInt, 16, + QAudioFormat::LittleEndian, 1), path}; + if (!file.open (QIODevice::WriteOnly)) + { + QFile::remove (path); + return {}; + } + char const samples[] = {'\0', '\0'}; + auto constexpr sampleBytes = qint64 {sizeof samples}; + if (file.write (samples, sampleBytes) != sampleBytes) + { + file.close (); + QFile::remove (path); + return {}; + } + file.close (); + return path; + } + + class TestAudioSink final + : public AudioDevice + { + protected: + qint64 readData (char *, qint64) override {return -1;} + qint64 writeData (char const *, qint64 size) override {return size;} + }; + + class TemporaryPathCleanup final + { + public: + explicit TemporaryPathCleanup (QString path) + : path_ {std::move (path)} + { + } + + ~TemporaryPathCleanup () + { + if (!path_.isEmpty ()) QFile::remove (path_); + } + + TemporaryPathCleanup (TemporaryPathCleanup const&) = delete; + TemporaryPathCleanup& operator= (TemporaryPathCleanup const&) = delete; + + private: + QString path_; + }; +} + +class TestAudioInputStreamDescriptor + : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void init () + { + set_dec_data_input_blocked (false); + clear_dec_data (dec_data); + } + + Q_SLOT void cleanup () + { + set_dec_data_input_blocked (false); + } + + Q_SLOT void default_descriptor_is_invalid () + { + AudioStreamDescriptor const descriptor; + QVERIFY (!descriptor.isValid ()); + QCOMPARE (descriptor.sample_rate_hz, 0); + QVERIFY (descriptor.sample_encoding + == AudioStreamDescriptor::SampleEncoding::Unknown); + QCOMPARE (descriptor.sample_size_bits, 0); + QVERIFY (descriptor.byte_order == AudioStreamDescriptor::ByteOrder::Unknown); + QCOMPARE (descriptor.channel_count, 0); + QCOMPARE (descriptor.capture_anchor_utc_ms, qint64 {0}); + QVERIFY (descriptor.channel_layout + == AudioStreamDescriptor::ChannelLayout::Unknown); + QVERIFY (descriptor.clock_domain + == AudioStreamDescriptor::ClockDomain::Unknown); + QVERIFY (descriptor.timing_evidence + == AudioStreamDescriptor::TimingEvidence::Unavailable); + QVERIFY (!descriptor.can_report_discontinuities); + } + + Q_SLOT void validity_and_equality_cover_all_facts () + { + AudioStreamDescriptor descriptor; + descriptor.sample_rate_hz = 48000; + descriptor.sample_encoding = + AudioStreamDescriptor::SampleEncoding::SignedInteger; + descriptor.sample_size_bits = 16; + descriptor.byte_order = AudioStreamDescriptor::ByteOrder::LittleEndian; + descriptor.channel_count = 2; + descriptor.channel_layout = AudioStreamDescriptor::ChannelLayout::Stereo; + descriptor.clock_domain = AudioStreamDescriptor::ClockDomain::DeviceClock; + descriptor.timing_evidence = + AudioStreamDescriptor::TimingEvidence::PositionCountable; + + QVERIFY (descriptor.isValid ()); + auto copy = descriptor; + QVERIFY (copy == descriptor); + copy.can_report_discontinuities = true; + QVERIFY (copy != descriptor); + + copy = descriptor; + copy.sample_rate_hz = 0; + QVERIFY (!copy.isValid ()); + copy = descriptor; + copy.sample_encoding = AudioStreamDescriptor::SampleEncoding::Unknown; + QVERIFY (!copy.isValid ()); + copy = descriptor; + copy.sample_size_bits = 0; + QVERIFY (!copy.isValid ()); + copy = descriptor; + copy.byte_order = AudioStreamDescriptor::ByteOrder::Unknown; + QVERIFY (!copy.isValid ()); + copy = descriptor; + copy.channel_count = 0; + QVERIFY (!copy.isValid ()); + + copy = descriptor; + copy.capture_anchor_utc_ms = 123; + QVERIFY (copy != descriptor); + } + + Q_SLOT void selects_capture_anchor_for_system_clock () + { + auto descriptor = audioStreamDescriptorFromQAudioFormat ( + pcmFormat (QAudioFormat::SignedInt, 16, + QAudioFormat::LittleEndian, 1)); + descriptor.clock_domain = AudioStreamDescriptor::ClockDomain::SystemClock; + descriptor.timing_evidence = + AudioStreamDescriptor::TimingEvidence::CaptureTimeAnchored; + descriptor.capture_anchor_utc_ms = 123456789000; + + AudioStreamClock clock; + clock.setDescriptor (descriptor); + QVERIFY (clock.reference () == AudioStreamClock::Reference::CaptureAnchor); + QCOMPARE (clock.timestamp (987654321000), qint64 {123456789000}); + + clock.advance (12000); + QCOMPARE (clock.timestamp (987654321000), qint64 {123456790000}); + } + + Q_SLOT void uses_arrival_clock_without_capture_evidence () + { + auto descriptor = audioStreamDescriptorFromQAudioFormat ( + pcmFormat (QAudioFormat::SignedInt, 16, + QAudioFormat::LittleEndian, 1)); + descriptor.clock_domain = AudioStreamDescriptor::ClockDomain::DeviceClock; + descriptor.timing_evidence = + AudioStreamDescriptor::TimingEvidence::PositionCountable; + descriptor.capture_anchor_utc_ms = 123456789000; + + AudioStreamClock clock; + clock.setDescriptor (descriptor); + QVERIFY (clock.reference () == AudioStreamClock::Reference::ArrivalWallClock); + QCOMPARE (clock.timestamp (987654321000), qint64 {987654321000}); + + descriptor.clock_domain = AudioStreamDescriptor::ClockDomain::Unknown; + clock.setDescriptor (descriptor); + QVERIFY (clock.reference () == AudioStreamClock::Reference::ArrivalWallClock); + QCOMPARE (clock.timestamp (987654321000), qint64 {987654321000}); + + clock.setDescriptor ({}); + QVERIFY (clock.reference () == AudioStreamClock::Reference::ArrivalWallClock); + QCOMPARE (clock.timestamp (987654321000), qint64 {987654321000}); + } + + Q_SLOT void maps_qt_pcm_formats () + { + auto descriptor = audioStreamDescriptorFromQAudioFormat ( + pcmFormat (QAudioFormat::SignedInt, 16, + QAudioFormat::LittleEndian, 1)); + QVERIFY (descriptor.isValid ()); + QCOMPARE (descriptor.sample_rate_hz, 12000); + QCOMPARE (descriptor.sample_size_bits, 16); + QCOMPARE (descriptor.channel_count, 1); + QVERIFY (descriptor.sample_encoding + == AudioStreamDescriptor::SampleEncoding::SignedInteger); + QVERIFY (descriptor.byte_order + == AudioStreamDescriptor::ByteOrder::LittleEndian); + QVERIFY (descriptor.channel_layout + == AudioStreamDescriptor::ChannelLayout::Mono); + + descriptor = audioStreamDescriptorFromQAudioFormat ( + pcmFormat (QAudioFormat::UnSignedInt, 8, + QAudioFormat::LittleEndian, 6)); + QVERIFY (descriptor.isValid ()); + QCOMPARE (descriptor.sample_rate_hz, 12000); + QCOMPARE (descriptor.sample_size_bits, 8); + QCOMPARE (descriptor.channel_count, 6); + QVERIFY (descriptor.sample_encoding + == AudioStreamDescriptor::SampleEncoding::UnsignedInteger); + QVERIFY (descriptor.byte_order == AudioStreamDescriptor::ByteOrder::Unknown); + QVERIFY (descriptor.channel_layout + == AudioStreamDescriptor::ChannelLayout::Unknown); + + descriptor = audioStreamDescriptorFromQAudioFormat ( + pcmFormat (QAudioFormat::Float, 32, QAudioFormat::BigEndian, 2)); + QVERIFY (descriptor.isValid ()); + QCOMPARE (descriptor.sample_rate_hz, 12000); + QCOMPARE (descriptor.sample_size_bits, 32); + QCOMPARE (descriptor.channel_count, 2); + QVERIFY (descriptor.sample_encoding + == AudioStreamDescriptor::SampleEncoding::FloatingPoint); + QVERIFY (descriptor.byte_order + == AudioStreamDescriptor::ByteOrder::BigEndian); + QVERIFY (descriptor.channel_layout + == AudioStreamDescriptor::ChannelLayout::Stereo); + } + + Q_SLOT void rejects_unrecognized_qt_formats () + { + QVERIFY (!audioStreamDescriptorFromQAudioFormat (QAudioFormat {}).isValid ()); + + auto unknown = pcmFormat (QAudioFormat::Unknown, 16, + QAudioFormat::LittleEndian, 1); + QVERIFY (!audioStreamDescriptorFromQAudioFormat (unknown).isValid ()); + + auto nonPcm = pcmFormat (QAudioFormat::SignedInt, 16, + QAudioFormat::LittleEndian, 1); + nonPcm.setCodec ("audio/example"); + QVERIFY (!audioStreamDescriptorFromQAudioFormat (nonPcm).isValid ()); + + auto nonByteAligned = pcmFormat (QAudioFormat::SignedInt, 7, + QAudioFormat::LittleEndian, 1); + QVERIFY (!audioStreamDescriptorFromQAudioFormat (nonByteAligned).isValid ()); + } + + Q_SLOT void fixture_reports_opened_stream () + { + auto const path = createJttyFixture (); + QVERIFY (!path.isEmpty ()); + TemporaryPathCleanup cleanup {path}; + + FixtureAudioInput source {path, FixtureAudioInput::Profile::Jtty}; + TestAudioSink sink; + QVector changes; + connect (&source, &AudioInputSource::streamDescriptorChanged, + [&changes] (AudioStreamDescriptor descriptor) { + changes.append (descriptor); + }); + + QVERIFY (!source.streamDescriptor ().isValid ()); + source.start (QAudioDeviceInfo {}, 0, &sink, 1, AudioDevice::Mono); + + QCOMPARE (changes.size (), 1); + auto const descriptor = source.streamDescriptor (); + QVERIFY (descriptor.isValid ()); + QCOMPARE (descriptor.sample_rate_hz, 12000); + QVERIFY (descriptor.sample_encoding + == AudioStreamDescriptor::SampleEncoding::SignedInteger); + QCOMPARE (descriptor.sample_size_bits, 16); + QVERIFY (descriptor.byte_order + == AudioStreamDescriptor::ByteOrder::LittleEndian); + QCOMPARE (descriptor.channel_count, 1); + QVERIFY (descriptor.channel_layout + == AudioStreamDescriptor::ChannelLayout::Mono); + QVERIFY (descriptor.clock_domain + == AudioStreamDescriptor::ClockDomain::SystemClock); + QVERIFY (descriptor.timing_evidence + == AudioStreamDescriptor::TimingEvidence::CaptureTimeAnchored); + QCOMPARE (descriptor.capture_anchor_utc_ms, qint64 {0}); + QVERIFY (!descriptor.can_report_discontinuities); + QVERIFY (changes.constFirst () == descriptor); + + auto constexpr fixturePeriodMs = qint64 {180000}; + auto const periodOffset = QDateTime::currentMSecsSinceEpoch () + % fixturePeriodMs; + auto const untilNextPeriod = fixturePeriodMs - periodOffset; + if (untilNextPeriod < 3000) + { + QTest::qWait (static_cast (untilNextPeriod + 100)); + } + + QSignalSpy emissions {&source, &FixtureAudioInput::emissionStarted}; + source.resume (); + source.arm (); + auto const anchored = source.streamDescriptor (); + QVERIFY (anchored.capture_anchor_utc_ms > 0); + QCOMPARE (changes.size (), 2); + QVERIFY (changes.constLast () == anchored); + + QTRY_VERIFY_WITH_TIMEOUT (emissions.count () > 0, 1000); + QCOMPARE (emissions.constFirst ().constFirst ().toLongLong (), + anchored.capture_anchor_utc_ms); + QTest::qWait (200); + source.suspend (); + auto const beforeResume = QDateTime::currentMSecsSinceEpoch (); + source.resume (); + auto const resumed = source.streamDescriptor (); + QVERIFY (resumed.capture_anchor_utc_ms >= beforeResume - 20); + QVERIFY (resumed.capture_anchor_utc_ms <= beforeResume + 20); + QCOMPARE (changes.size (), 3); + + source.stop (); + QCOMPARE (changes.size (), 4); + QVERIFY (!changes.constLast ().isValid ()); + QVERIFY (!source.streamDescriptor ().isValid ()); + } + + Q_SLOT void detector_clock_advances_for_consumed_frames () + { + Detector detector {12000, 1.0, 1}; + QVERIFY (detector.initialize (QIODevice::WriteOnly, AudioDevice::Mono)); + detector.setBlockSize (1200); + QSignalSpy framesWritten {&detector, &Detector::framesWritten}; + + auto descriptor = audioStreamDescriptorFromQAudioFormat ( + pcmFormat (QAudioFormat::SignedInt, 16, + QAudioFormat::LittleEndian, 1)); + descriptor.clock_domain = AudioStreamDescriptor::ClockDomain::SystemClock; + descriptor.timing_evidence = + AudioStreamDescriptor::TimingEvidence::CaptureTimeAnchored; + descriptor.capture_anchor_utc_ms = 100500; + detector.setStreamDescriptor (descriptor); + + QByteArray accepted {2400, '\0'}; + QCOMPARE (detector.write (accepted.constData (), accepted.size ()), + qint64 {accepted.size ()}); + QCOMPARE (framesWritten.constLast ().constFirst ().toLongLong (), qint64 {1200}); + + QByteArray blocked {14400, '\0'}; + set_dec_data_input_blocked (true); + QCOMPARE (detector.write (blocked.constData (), blocked.size ()), + qint64 {blocked.size ()}); + set_dec_data_input_blocked (false); + + detector.setBlockSize (1); + QByteArray finalFrame {2, '\0'}; + QCOMPARE (detector.write (finalFrame.constData (), finalFrame.size ()), + qint64 {finalFrame.size ()}); + QCOMPARE (framesWritten.constLast ().constFirst ().toLongLong (), qint64 {1}); + } +}; + +QTEST_GUILESS_MAIN (TestAudioInputStreamDescriptor) + +#include "test_audio_input_stream_descriptor.moc" diff --git a/tests/unit/audio/test_bwf_file.cpp b/tests/unit/audio/test_bwf_file.cpp new file mode 100644 index 00000000..61456aa1 --- /dev/null +++ b/tests/unit/audio/test_bwf_file.cpp @@ -0,0 +1,423 @@ +#include + +#include +#include +#include + +#include "Audio/BWFFile.hpp" +#include "Audio/WavFile.hpp" + +namespace +{ + QByteArray le16 (quint16 value) + { + QByteArray bytes (2, '\0'); + bytes[0] = static_cast (value & 0xffu); + bytes[1] = static_cast ((value >> 8) & 0xffu); + return bytes; + } + + QByteArray le32 (quint32 value) + { + QByteArray bytes (4, '\0'); + bytes[0] = static_cast (value & 0xffu); + bytes[1] = static_cast ((value >> 8) & 0xffu); + bytes[2] = static_cast ((value >> 16) & 0xffu); + bytes[3] = static_cast ((value >> 24) & 0xffu); + return bytes; + } + + QByteArray chunk (char const * id, QByteArray const& payload) + { + QByteArray out; + out.append (id, 4); + out.append (le32 (static_cast (payload.size ()))); + out.append (payload); + if (payload.size () & 1) + { + out.append ('\0'); + } + return out; + } + + QByteArray wave_file (QList const& chunks) + { + QByteArray payload {"WAVE", 4}; + for (auto const& current : chunks) + { + payload.append (current); + } + + QByteArray out; + out.append ("RIFF", 4); + out.append (le32 (static_cast (payload.size ()))); + out.append (payload); + return out; + } + + QByteArray fmt_chunk (quint16 channels = 1, quint32 sample_rate = 12000, + quint16 bits_per_sample = 16, quint16 block_align = 0, + quint32 byte_rate = 0) + { + if (!block_align) + { + block_align = static_cast (channels * (bits_per_sample / 8u)); + } + if (!byte_rate) + { + byte_rate = sample_rate * block_align; + } + + QByteArray payload; + payload.append (le16 (1)); + payload.append (le16 (channels)); + payload.append (le32 (sample_rate)); + payload.append (le32 (byte_rate)); + payload.append (le16 (block_align)); + payload.append (le16 (bits_per_sample)); + return chunk ("fmt ", payload); + } + + QByteArray data_chunk (QByteArray const& data = {}) + { + return chunk ("data", data); + } + + QByteArray info_list_chunk () + { + QByteArray payload {"INFO", 4}; + payload.append (chunk ("INAM", QByteArray {"wsjtx", 5})); + return chunk ("LIST", payload); + } + + QByteArray info_list_chunk_with_terminal_pad_outside_size () + { + QByteArray payload {"INFO", 4}; + payload.append ("ISRC", 4); + payload.append (le32 (5)); + payload.append ("K1JT", 5); + + QByteArray out; + out.append ("LIST", 4); + out.append (le32 (static_cast (payload.size ()))); + out.append (payload); + out.append ('\0'); + return out; + } + + QByteArray bare_bext_payload () + { + return QByteArray (604, '\0'); + } + + QAudioFormat default_format () + { + QAudioFormat format; + format.setByteOrder (QAudioFormat::LittleEndian); + format.setChannelCount (1); + format.setCodec ("audio/pcm"); + format.setSampleRate (12000); + format.setSampleSize (16); + format.setSampleType (QAudioFormat::SignedInt); + return format; + } + + QString write_temp_file (QByteArray const& data) + { + QTemporaryFile file; + file.setAutoRemove (false); + if (!file.open ()) + { + return {}; + } + + if (file.write (data) != data.size ()) + { + return {}; + } + + auto const name = file.fileName (); + file.close (); + return name; + } +} + +class TestBWFFile + : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void opens_valid_pcm_wave () + { + auto const name = write_temp_file (wave_file ({fmt_chunk (), data_chunk ()})); + QVERIFY (!name.isEmpty ()); + + BWFFile file {default_format (), name}; + QVERIFY (file.open (QIODevice::ReadOnly)); + QCOMPARE (file.format ().channelCount (), 1); + QCOMPARE (file.format ().sampleRate (), 12000); + file.close (); + QFile::remove (name); + } + + Q_SLOT void loads_supported_decode_wave () + { + QByteArray samples; + samples.append (le16 (0x1234)); + samples.append (le16 (0x5678)); + samples.append (le16 (0x9abc)); + auto const name = write_temp_file (wave_file ({fmt_chunk (), data_chunk (samples)})); + QVERIFY (!name.isEmpty ()); + + auto const result = Radio::WavFile::load (name, 2); + QVERIFY2 (result.isValid (), qPrintable (result.error)); + QCOMPARE (result.frames, 2); + QCOMPARE (result.samples, samples.left (4)); + QFile::remove (name); + } + + Q_SLOT void loads_legacy_decode_waves () + { + auto const eight_bit_name = write_temp_file ( + wave_file ({fmt_chunk (1, 11025, 8), data_chunk (QByteArray::fromHex ("7f80"))})); + QVERIFY (!eight_bit_name.isEmpty ()); + auto const eight_bit = Radio::WavFile::load (eight_bit_name, 2); + QVERIFY2 (eight_bit.isValid (), qPrintable (eight_bit.error)); + QCOMPARE (eight_bit.frames, 2); + QCOMPARE (eight_bit.samples, QByteArray::fromHex ("7f80")); + QFile::remove (eight_bit_name); + + auto const sixteen_bit_name = write_temp_file ( + wave_file ({fmt_chunk (1, 11025, 16), data_chunk (QByteArray::fromHex ("01000200"))})); + QVERIFY (!sixteen_bit_name.isEmpty ()); + auto const sixteen_bit = Radio::WavFile::load (sixteen_bit_name, 2); + QVERIFY2 (sixteen_bit.isValid (), qPrintable (sixteen_bit.error)); + QCOMPARE (sixteen_bit.frames, 2); + QCOMPARE (sixteen_bit.samples, QByteArray::fromHex ("01000200")); + QFile::remove (sixteen_bit_name); + } + + Q_SLOT void rejects_multichannel_decode_wave () + { + auto const name = write_temp_file ( + wave_file ({fmt_chunk (2000, 12000, 16), data_chunk (QByteArray::fromHex ("0000"))})); + QVERIFY (!name.isEmpty ()); + + BWFFile parsed {QAudioFormat {}, name}; + QVERIFY (parsed.open (QIODevice::ReadOnly)); + QCOMPARE (parsed.format ().channelCount (), 2000); + parsed.close (); + + auto const result = Radio::WavFile::load (name, 36000); + QVERIFY (!result.isValid ()); + QVERIFY (result.samples.isEmpty ()); + QCOMPARE (result.frames, 0); + QFile::remove (name); + } + + Q_SLOT void discards_partial_decode_frame () + { + auto const name = write_temp_file ( + wave_file ({fmt_chunk (), data_chunk (QByteArray::fromHex ("010002"))})); + QVERIFY (!name.isEmpty ()); + + auto const result = Radio::WavFile::load (name, 2); + QVERIFY2 (result.isValid (), qPrintable (result.error)); + QCOMPARE (result.frames, 1); + QCOMPARE (result.samples, QByteArray::fromHex ("0100")); + QFile::remove (name); + } + + Q_SLOT void opens_valid_list_info_chunk () + { + auto const name = write_temp_file (wave_file ({fmt_chunk (), info_list_chunk (), data_chunk ()})); + QVERIFY (!name.isEmpty ()); + BWFFile::InfoDictionary::key_type const inam {{'I', 'N', 'A', 'M'}}; + QByteArray const expected_name {"wsjtx", 5}; + + BWFFile file {default_format (), name}; + QVERIFY (file.open (QIODevice::ReadOnly)); + QVERIFY (file.list_info ().contains (inam)); + QCOMPARE (file.list_info ().value (inam), expected_name); + file.close (); + QFile::remove (name); + } + + Q_SLOT void opens_list_info_with_terminal_subchunk_pad () + { + auto const name = write_temp_file (wave_file ({fmt_chunk (), data_chunk (), + info_list_chunk_with_terminal_pad_outside_size ()})); + QVERIFY (!name.isEmpty ()); + BWFFile::InfoDictionary::key_type const isrc {{'I', 'S', 'R', 'C'}}; + + BWFFile file {default_format (), name}; + QVERIFY (file.open (QIODevice::ReadOnly)); + QVERIFY (file.list_info ().contains (isrc)); + QCOMPARE (file.list_info ().value (isrc), QByteArray ("K1JT", 5)); + file.close (); + QFile::remove (name); + } + + Q_SLOT void bext_version_without_chunk_defaults_to_v0 () + { + auto const name = write_temp_file (wave_file ({fmt_chunk (), data_chunk ()})); + QVERIFY (!name.isEmpty ()); + + BWFFile file {default_format (), name}; + BWFFile const& const_file = file; + QVERIFY (file.open (QIODevice::ReadOnly)); + QCOMPARE (static_cast (const_file.bext_version ()), + static_cast (BWFFile::BextVersion::v_0)); + file.close (); + QFile::remove (name); + } + + Q_SLOT void bext_fixed_field_getter_stays_bounded () + { + QByteArray bext = bare_bext_payload (); + bext.replace (0, 256, QByteArray (256, 'B')); + auto const name = write_temp_file (wave_file ({fmt_chunk (), chunk ("bext", bext), data_chunk ()})); + QVERIFY (!name.isEmpty ()); + + BWFFile file {default_format (), name}; + QVERIFY (file.open (QIODevice::ReadOnly)); + QCOMPARE (file.bext_description (), QByteArray (256, 'B')); + file.close (); + QFile::remove (name); + } + + Q_SLOT void bext_origination_date_time_stays_bounded () + { + QByteArray bext = bare_bext_payload (); + bext.replace (320, 10, QByteArray {"2026-04-06", 10}); + bext.replace (330, 10, QByteArray {"12-34-56ZZ", 10}); + auto const name = write_temp_file (wave_file ({fmt_chunk (), chunk ("bext", bext), data_chunk ()})); + QVERIFY (!name.isEmpty ()); + + BWFFile file {default_format (), name}; + QVERIFY (file.open (QIODevice::ReadOnly)); + QCOMPARE (file.bext_origination_date_time ().date (), QDate (2026, 4, 6)); + QCOMPARE (file.bext_origination_date_time ().time (), QTime (12, 34, 56)); + file.close (); + QFile::remove (name); + } + + Q_SLOT void bext_origination_date_time_setter_handles_invalid_value () + { + QTemporaryFile temp; + temp.setAutoRemove (false); + QVERIFY (temp.open ()); + auto const name = temp.fileName (); + temp.close (); + + { + BWFFile file {default_format (), name}; + QVERIFY (file.open (QIODevice::WriteOnly)); + file.bext_origination_date_time ({}); + file.close (); + } + + { + BWFFile file {default_format (), name}; + QVERIFY (file.open (QIODevice::ReadOnly)); + QVERIFY (!file.bext_origination_date_time ().isValid ()); + file.close (); + } + + QFile::remove (name); + } + + Q_SLOT void bext_setter_truncates_without_overread () + { + QTemporaryFile temp; + temp.setAutoRemove (false); + QVERIFY (temp.open ()); + auto const name = temp.fileName (); + temp.close (); + + { + BWFFile file {default_format (), name}; + QVERIFY (file.open (QIODevice::WriteOnly)); + file.bext_description (QByteArray (300, 'A')); + file.close (); + } + + { + BWFFile file {default_format (), name}; + QVERIFY (file.open (QIODevice::ReadOnly)); + QCOMPARE (file.bext_description (), QByteArray (256, 'A')); + file.close (); + } + + QFile::remove (name); + } + + Q_SLOT void rejects_truncated_bext_chunk () + { + QByteArray bad_bext; + bad_bext.append ("bext", 4); + bad_bext.append (le32 (700)); + bad_bext.append (QByteArray (16, '\0')); + auto const name = write_temp_file (wave_file ({fmt_chunk (), bad_bext, data_chunk ()})); + QVERIFY (!name.isEmpty ()); + + BWFFile file {default_format (), name}; + QVERIFY (!file.open (QIODevice::ReadOnly)); + QFile::remove (name); + } + + Q_SLOT void rejects_list_info_subchunk_overrun () + { + QByteArray payload {"INFO", 4}; + payload.append ("INAM", 4); + payload.append (le32 (8)); + payload.append ("bad", 3); + auto const name = write_temp_file (wave_file ({fmt_chunk (), chunk ("LIST", payload), data_chunk ()})); + QVERIFY (!name.isEmpty ()); + + BWFFile file {default_format (), name}; + QVERIFY (!file.open (QIODevice::ReadOnly)); + QFile::remove (name); + } + + Q_SLOT void rejects_short_fmt_chunk () + { + QByteArray payload; + payload.append (le16 (1)); + payload.append (le16 (1)); + auto const name = write_temp_file (wave_file ({chunk ("fmt ", payload), data_chunk ()})); + QVERIFY (!name.isEmpty ()); + + BWFFile file {default_format (), name}; + QVERIFY (!file.open (QIODevice::ReadOnly)); + QFile::remove (name); + } + + Q_SLOT void rejects_zero_channel_fmt () + { + auto const name = write_temp_file (wave_file ({fmt_chunk (0), data_chunk ()})); + QVERIFY (!name.isEmpty ()); + + BWFFile file {default_format (), name}; + QVERIFY (!file.open (QIODevice::ReadOnly)); + QFile::remove (name); + } + + Q_SLOT void tolerates_inconsistent_fmt_rates () + { + auto const name = write_temp_file (wave_file ({fmt_chunk (1, 12000, 16, 4, 48000), data_chunk ()})); + QVERIFY (!name.isEmpty ()); + + BWFFile file {default_format (), name}; + QVERIFY (file.open (QIODevice::ReadOnly)); + QCOMPARE (file.format ().sampleRate (), 12000); + QCOMPARE (file.format ().sampleSize (), 16); + file.close (); + QFile::remove (name); + } +}; + +QTEST_MAIN (TestBWFFile) + +#include "test_bwf_file.moc" diff --git a/tests/unit/audio/test_echosim_wav_trailer.cpp b/tests/unit/audio/test_echosim_wav_trailer.cpp new file mode 100644 index 00000000..3348b8d5 --- /dev/null +++ b/tests/unit/audio/test_echosim_wav_trailer.cpp @@ -0,0 +1,96 @@ +#include + +#include +#include +#include +#include +#include + +#include "Audio/BWFFile.hpp" + +namespace +{ + QAudioFormat default_format () + { + QAudioFormat format; + format.setByteOrder (QAudioFormat::LittleEndian); + format.setChannelCount (1); + format.setCodec ("audio/pcm"); + format.setSampleRate (12000); + format.setSampleSize (16); + format.setSampleType (QAudioFormat::SignedInt); + return format; + } +} + +class TestEchosimWavTrailer + : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void preserves_generated_sample_alignment () + { + QTemporaryDir dir; + QVERIFY (dir.isValid ()); + + QProcess process; + process.setWorkingDirectory (dir.path ()); + process.start (ECHOSIM_EXECUTABLE, {"1500", "0.0", "0.0", "1", "100"}); + QVERIFY (process.waitForFinished (30000)); + QCOMPARE (process.exitCode (), 0); + + QDir out {dir.path ()}; + auto const wavs = out.entryList ({"*.wav"}, QDir::Files); + QCOMPARE (wavs.size (), 1); + + BWFFile file {default_format (), out.filePath (wavs.first ())}; + QVERIFY (file.open (QIODevice::ReadOnly)); + + // The first ten samples contain Echo metadata; sample 11 is generated audio. + qint16 sample; + QVERIFY (file.seek (10 * sizeof sample)); + QCOMPARE (file.read (reinterpret_cast (&sample), sizeof sample), + static_cast (sizeof sample)); + sample = qFromLittleEndian (sample); + QVERIFY (sample >= 23168 && sample <= 23172); + + file.close (); + } + + Q_SLOT void writes_correct_data_size_and_list_info_trailer () + { + QTemporaryDir dir; + QVERIFY (dir.isValid ()); + + QProcess process; + process.setWorkingDirectory (dir.path ()); + process.start (ECHOSIM_EXECUTABLE, {"1500", "0.0", "4.0", "1", "-22"}); + QVERIFY (process.waitForFinished (30000)); + QCOMPARE (process.exitCode (), 0); + + QDir out {dir.path ()}; + auto const wavs = out.entryList ({"*.wav"}, QDir::Files); + QCOMPARE (wavs.size (), 1); + + BWFFile file {default_format (), out.filePath (wavs.first ())}; + QVERIFY (file.open (QIODevice::ReadOnly)); + + qint64 constexpr sample_count = 36000; + QCOMPARE (file.size (), 2 * sample_count); + + BWFFile::InfoDictionary::key_type const isft {{'I', 'S', 'F', 'T'}}; + BWFFile::InfoDictionary::key_type const icrd {{'I', 'C', 'R', 'D'}}; + BWFFile::InfoDictionary::key_type const icmt {{'I', 'C', 'M', 'T'}}; + QVERIFY (file.list_info ().contains (isft)); + QVERIFY (file.list_info ().contains (icrd)); + QVERIFY (file.list_info ().contains (icmt)); + QVERIFY (!file.list_info ().value (icmt).isEmpty ()); + + file.close (); + } +}; + +QTEST_GUILESS_MAIN (TestEchosimWavTrailer) + +#include "test_echosim_wav_trailer.moc" diff --git a/tests/unit/audio/test_fast_decode_ownership.cpp b/tests/unit/audio/test_fast_decode_ownership.cpp new file mode 100644 index 00000000..9375b527 --- /dev/null +++ b/tests/unit/audio/test_fast_decode_ownership.cpp @@ -0,0 +1,336 @@ +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "FastDecode.hpp" +#include "Detector/Detector.hpp" +#include "commons.h" +#include "wsjtx_config.h" + +namespace +{ +dec_data_t storage {}; +constexpr int capacity = 360000; +constexpr int committed = 7168; + +class Rendezvous +{ +public: + bool arrive () + { + std::unique_lock lock {mutex_}; + ++arrivals_; + changed_.notify_all (); + return changed_.wait_for (lock, std::chrono::seconds {5}, + [this] { return arrivals_ == 2; }); + } +private: + std::mutex mutex_; + std::condition_variable changed_; + int arrivals_ = 0; +}; + +struct DecoderProbe +{ + std::mutex mutex; + std::condition_variable changed; + bool entered = false; + bool released = false; + bool timedOut = false; + bool validCount = false; + bool offCallerThread = false; + QThread * callerThread = QThread::currentThread (); + std::vector samples; + std::array arguments; + double period = 0; + QByteArray myCall, hisCall; + std::array lengths; + Rendezvous * sampleAccessStart = nullptr; + + bool waitForEntry () + { + std::unique_lock lock {mutex}; + return changed.wait_for (lock, std::chrono::seconds {5}, + [this] { return entered; }); + } + + void release () + { + std::lock_guard lock {mutex}; + released = true; + changed.notify_all (); + } +}; + +DecoderProbe * activeProbe = nullptr; +std::array overlappingProbes {{nullptr, nullptr}}; + +struct Inputs +{ + std::array arguments {}; + double period = 15; + std::array messages {}; + std::array myCall, hisCall; + + Inputs () + { + arguments[0] = 123000; + arguments[1] = committed; + arguments[3] = 1; + arguments[8] = 2; + arguments[9] = 104; + arguments[10] = 1500; + arguments[11] = 100; + std::memcpy (myCall.data (), "K1ABC ", 12); + std::memcpy (hisCall.data (), "W9XYZ ", 12); + } + + QFuture submit (short const * samples = storage.d2) + { + return startFastDecode (samples, arguments.data (), period, + myCall.data (), hisCall.data ()); + } +}; +} + +dec_data_t& dec_data = storage; + +// Substitute only the decoder at its ABI boundary. The production helper +// still copies the source and launches the real QtConcurrent job. Delaying +// input consumption models an ordinarily scheduled-but-not-yet-running job. +extern "C" void fast_decode_ (short samples[], int arguments[], double * period, + char messages[], char myCall[], char hisCall[], + fortran_charlen_t messageLength, + fortran_charlen_t myCallLength, + fortran_charlen_t hisCallLength) +{ + auto * selected = activeProbe; + if (!selected && arguments[0] == 111000) selected = overlappingProbes[0]; + if (!selected && arguments[0] == 222000) selected = overlappingProbes[1]; + auto& probe = *selected; + { + std::unique_lock lock {probe.mutex}; + probe.entered = true; + probe.changed.notify_all (); + probe.timedOut = !probe.changed.wait_for (lock, std::chrono::seconds {5}, + [&] { return probe.released; }); + } + if (probe.timedOut) return; // A harness timeout must not introduce an unordered read. + if (probe.sampleAccessStart && !probe.sampleAccessStart->arrive ()) + { + probe.timedOut = true; + return; + } + probe.offCallerThread = QThread::currentThread () != probe.callerThread; + probe.validCount = arguments[1] >= 0 && arguments[1] <= capacity; + if (probe.validCount) probe.samples.assign (samples, samples + arguments[1]); + std::copy_n (arguments, 15, probe.arguments.begin ()); + probe.period = *period; + probe.lengths = {{messageLength, myCallLength, hisCallLength}}; + probe.myCall = QByteArray (myCall, 12); + probe.hisCall = QByteArray (hisCall, 12); + // Preserve the existing ABI's output behavior, including in/out arguments. + std::memcpy (messages, "PROBE", 6); + arguments[12] = 31; + arguments[13] = 248; +} + +class TestFastDecodeOwnership : public QObject +{ + Q_OBJECT +private Q_SLOTS: + void captures_submission_inputs () + { + std::fill_n (storage.d2, committed, short (1234)); + Inputs input; + auto const expectedArguments = input.arguments; + DecoderProbe probe; + activeProbe = &probe; + auto future = input.submit (); + bool const entered = probe.waitForEntry (); + // All caller storage remains alive. The release orders these mutations + // before the probe reads, so an assertion failure is an ownership defect, + // not undefined behavior deliberately introduced by the test. + std::fill_n (storage.d2, committed, short (5678)); + std::memcpy (input.myCall.data (), "N0NEW ", 12); + std::memcpy (input.hisCall.data (), "G4NEW ", 12); + input.period = 30; + input.arguments[10] = 2500; + probe.release (); + future.waitForFinished (); + activeProbe = nullptr; + + QVERIFY (entered); + QVERIFY (!probe.timedOut); + QVERIFY (probe.offCallerThread); + QVERIFY (probe.validCount); + QCOMPARE (probe.lengths[0], fortran_charlen_t (8000)); + QCOMPARE (probe.lengths[1], fortran_charlen_t (12)); + QCOMPARE (probe.lengths[2], fortran_charlen_t (12)); + auto const result = future.result (); + QCOMPARE (QByteArray (result.messages.data ()), QByteArray ("PROBE")); + QCOMPARE (result.arguments[12], 31); + QCOMPARE (result.arguments[13], 248); + QCOMPARE (input.arguments[12], 0); // worker never writes caller storage + QVERIFY (probe.arguments == expectedArguments); + QCOMPARE (probe.samples.size (), std::size_t (committed)); + QVERIFY (std::all_of (probe.samples.begin (), probe.samples.end (), + [] (short x) { return x == 1234; })); + QCOMPARE (probe.myCall, QByteArray ("K1ABC ", 12)); + QCOMPARE (probe.hisCall, QByteArray ("W9XYZ ", 12)); + QCOMPARE (probe.period, 15.0); + } + + void capture_does_not_race_live_append () + { + Detector detector {12000, 15.0, 1}; + QVERIFY (detector.initialize (QIODevice::WriteOnly, AudioDevice::Mono)); + AudioStreamDescriptor descriptor; + descriptor.sample_rate_hz = 12000; + descriptor.sample_encoding = AudioStreamDescriptor::SampleEncoding::SignedInteger; + descriptor.sample_size_bits = 16; + descriptor.byte_order = AudioStreamDescriptor::ByteOrder::LittleEndian; + descriptor.channel_count = 1; + descriptor.channel_layout = AudioStreamDescriptor::ChannelLayout::Mono; + descriptor.clock_domain = AudioStreamDescriptor::ClockDomain::SystemClock; + descriptor.timing_evidence = AudioStreamDescriptor::TimingEvidence::CaptureTimeAnchored; + descriptor.capture_anchor_utc_ms = 90000; + detector.setStreamDescriptor (descriptor); + ReceiveAudioConsumer consumer; + auto connection = connect (&detector, &Detector::audioBlock, this, + [&] (ReceiveAudio audio) { QVERIFY (consumer.accept (audio, storage)); }); + std::vector initial (committed, 1234); + QCOMPARE (detector.write (reinterpret_cast (initial.data ()), + initial.size () * sizeof (short)), qint64 (2 * committed)); + disconnect (connection); + + std::mutex mutex; + std::condition_variable changed; + bool ready = false, released = false, writerStarted = false; + qint64 written = -1; + auto * callerThread = QThread::currentThread (); + std::unique_ptr writer {QThread::create ([&] { + { + std::unique_lock lock {mutex}; + ready = true; + changed.notify_all (); + writerStarted = changed.wait_for (lock, std::chrono::seconds {5}, + [&] { return released; }); + } + if (writerStarted) + { + std::vector next (3584, 5678); + written = detector.write (reinterpret_cast (next.data ()), + next.size () * sizeof (short)); + } + detector.moveToThread (callerThread); + })}; + detector.moveToThread (writer.get ()); + writer->start (); + bool writerReady; + { + std::unique_lock lock {mutex}; + writerReady = changed.wait_for (lock, std::chrono::seconds {5}, [&] { return ready; }); + released = true; + changed.notify_all (); + } + // Both the production capture and the append execute after releasing the + // gate. No completion handshake orders one sample access before the other. + Inputs input; + DecoderProbe probe; + probe.released = true; + activeProbe = &probe; + auto future = input.submit (); + future.waitForFinished (); + writer->wait (); + activeProbe = nullptr; + QVERIFY (writerReady); + QVERIFY (writerStarted); + QCOMPARE (written, qint64 (2 * 3584)); + QCOMPARE (dec_data.params.kin, committed); + QVERIFY (probe.validCount); + QCOMPARE (probe.samples.size (), std::size_t (committed)); + QVERIFY (std::all_of (probe.samples.begin (), probe.samples.end (), + [] (short x) { return x == 1234; })); + // Producer appends cannot mutate the decoder's accepted snapshot. + } + + void overlapping_jobs_retain_submission_identity () + { + std::fill_n (storage.d2, committed, short (1234)); + std::vector secondSamples (committed, short (5678)); + Inputs first, second; + first.arguments[0] = 111000; + second.arguments[0] = 222000; + DecoderProbe firstProbe, secondProbe; + secondProbe.released = true; + overlappingProbes = {{&firstProbe, &secondProbe}}; + + auto firstFuture = first.submit (); + bool const firstEntered = firstProbe.waitForEntry (); + // Submission performs the production staging copy synchronously. The + // first decoder is already pending but has not consumed any samples. + auto secondFuture = second.submit (secondSamples.data ()); + firstProbe.release (); + firstFuture.waitForFinished (); + secondFuture.waitForFinished (); + overlappingProbes = {{nullptr, nullptr}}; + + QVERIFY (firstEntered); + QVERIFY (!firstProbe.timedOut); + QVERIFY (!secondProbe.timedOut); + QVERIFY (firstProbe.entered); + QVERIFY (secondProbe.entered); + QCOMPARE (firstProbe.samples.size (), std::size_t (committed)); + QCOMPARE (secondProbe.samples.size (), std::size_t (committed)); + QVERIFY (std::all_of (firstProbe.samples.begin (), firstProbe.samples.end (), + [] (short x) { return x == 1234; })); + QVERIFY (std::all_of (secondProbe.samples.begin (), secondProbe.samples.end (), + [] (short x) { return x == 5678; })); + } + + void overlapping_submission_does_not_race_decoder () + { + std::fill_n (storage.d2, committed, short (1234)); + std::vector secondSamples (committed, short (5678)); + Inputs first, second; + first.arguments[0] = 111000; + second.arguments[0] = 222000; + DecoderProbe firstProbe, secondProbe; + firstProbe.released = true; + secondProbe.released = true; + Rendezvous sampleAccessStart; + firstProbe.sampleAccessStart = &sampleAccessStart; + overlappingProbes = {{&firstProbe, &secondProbe}}; + + auto firstFuture = first.submit (); + QFuture secondFuture; + std::unique_ptr submitter {QThread::create ([&] { + if (sampleAccessStart.arrive ()) + secondFuture = second.submit (secondSamples.data ()); + })}; + submitter->start (); + submitter->wait (); + firstFuture.waitForFinished (); + secondFuture.waitForFinished (); + overlappingProbes = {{nullptr, nullptr}}; + + QVERIFY (!firstProbe.timedOut); + QVERIFY (!secondProbe.timedOut); + QVERIFY (firstProbe.entered); + QVERIFY (secondProbe.entered); + // Under TSan, the production staging memcpy conflicts with the first + // decoder's read. No data-value assertion relies on that C++ race. + } +}; + +QTEST_GUILESS_MAIN (TestFastDecodeOwnership) +#include "test_fast_decode_ownership.moc" diff --git a/tests/unit/audio/test_receive_audio_handoff.cpp b/tests/unit/audio/test_receive_audio_handoff.cpp new file mode 100644 index 00000000..07cc9865 --- /dev/null +++ b/tests/unit/audio/test_receive_audio_handoff.cpp @@ -0,0 +1,535 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Audio/AudioDevice.hpp" +#include "DecDataMutex.hpp" +#include "Detector/Detector.hpp" +#include "commons.h" +#include "ReferenceSpectrum.hpp" +#include "wsjtx_config.h" + +extern "C" void refspectrum_ (short *, int *, bool *, bool *, bool *, char const *, fortran_charlen_t); + +namespace +{ +dec_data_t storage {}; +constexpr int block = 3584; +constexpr int committed = 2 * block; +constexpr short patternA = 1234; +constexpr short patternB = 5678; + +// Both conflicting accesses take place AFTER this rendezvous. In particular, +// there is no producer-completion acknowledgement before the DSP read. +class Rendezvous +{ +public: + bool arrive () + { + std::unique_lock lock {mutex_}; + ++arrivals_; + changed_.notify_all (); + return changed_.wait_for (lock, std::chrono::seconds {5}, + [this] { return arrivals_ == 2; }); + } +private: + std::mutex mutex_; + std::condition_variable changed_; + int arrivals_ = 0; +}; + +AudioStreamDescriptor descriptor (bool rollover) +{ + AudioStreamDescriptor result; + result.sample_rate_hz = 12000; + result.sample_encoding = AudioStreamDescriptor::SampleEncoding::SignedInteger; + result.sample_size_bits = 16; + result.byte_order = AudioStreamDescriptor::ByteOrder::LittleEndian; + result.channel_count = 1; + result.channel_layout = AudioStreamDescriptor::ChannelLayout::Mono; + result.clock_domain = AudioStreamDescriptor::ClockDomain::SystemClock; + result.timing_evidence = AudioStreamDescriptor::TimingEvidence::CaptureTimeAnchored; + // With a one-second period, 7168 samples advance 100.500 s to 101.097 s. + // Detector's next write therefore takes its real period-reset path. + result.capture_anchor_utc_ms = rollover ? 100500 : 90000; + return result; +} + +bool writeSamples (Detector& detector, int count, short value) +{ + std::vector samples (count, value); + auto const bytes = qint64 (samples.size () * sizeof (short)); + return detector.write (reinterpret_cast (samples.data ()), bytes) == bytes; +} + +bool writeReferenceSpectrum (QFile& file) +{ + if (!file.open (QIODevice::WriteOnly)) return false; + file.write (QString::asprintf ("%5d%5d%5d", 400, 2600, 5).toLatin1 ()); + for (int i = 0; i < 5; ++i) + file.write (QString::asprintf ("%25.16e", 0.).toLatin1 ()); + file.write ("\n"); + for (int i = 1; i <= 3456; ++i) + file.write (QString::asprintf ("%10.3f%12.3e%12.6f%12.6f%12.6f\n", + 12000. * i / 6912., 1., 0., 0.5, -6.0206).toLatin1 ()); + file.close (); + return true; +} + +std::vector noiseSamples (int count) +{ + std::vector samples (count); + unsigned noise = 1; + for (auto& sample : samples) + { + noise = 1664525u * noise + 1013904223u; + sample = short (int (noise >> 20) - 2048); + } + return samples; +} + +std::vector runReferenceSpectrum (std::vector const& original, + int step, bool measure, + QByteArray const& path) +{ + auto samples = original; + bool clear = true, apply = !measure; + int zero = 0; + refspectrum_ (samples.data (), &zero, &clear, &measure, &apply, + path.constData (), fortran_charlen_t (path.size ())); + clear = false; + ReferenceSpectrumInput reference; + for (int end = std::min (step, int (samples.size ())); ; + end = std::min (end + step, int (samples.size ()))) + { + reference.consume (samples.data (), end, measure ? 1 : 2, + [&] (short * p, int count) { + refspectrum_ (p, &count, &clear, &measure, &apply, + path.constData (), fortran_charlen_t (path.size ())); + }); + if (end == int (samples.size ())) break; + } + return samples; +} +} + +dec_data_t& dec_data = storage; +extern "C" void receive_reference_probe (short *, int); +extern "C" void receive_reference_apply_probe (short *, int); +extern "C" void fil4_state_ (qint16 *, qint32 *, qint16 *, qint32 *, float *); +extern "C" void save_echo_params_ (int *, int *, int *, float *, float *, + int *, int *, short *, int *); + +struct EchoMetadata +{ + int total = 123456, audio = 789, rit = 123, spacing = 15; + float frequency = 1500.5f, spread = 2.5f; + std::array tones {{0, 1, 2, 3, 4, 5}}; + + void transfer (short * samples, int direction) + { + save_echo_params_ (&total, &audio, &rit, &frequency, &spread, + &spacing, tones.data (), samples, &direction); + } +}; + +class TestReceiveAudioHandoff : public QObject +{ + Q_OBJECT + + void notificationTest (bool rollover) + { + Detector detector {12000, 1.0, 1}; + detector.setBlockSize (block); + auto * guiThread = QThread::currentThread (); + std::vector observed; + std::vector counts; + auto received = std::make_unique (); + ReceiveAudioConsumer consumer; + int rejected = 0; + connect (&detector, &Detector::audioBlock, this, [&] (ReceiveAudio audio) { + if (!consumer.accept (audio, *received)) { ++rejected; return; } + counts.push_back (audio->end ()); + observed.push_back (received->d2[audio->end () - 1]); + }, Qt::QueuedConnection); + + bool wrote = false; + std::unique_ptr worker {QThread::create ([&] { + bool ok = detector.initialize (QIODevice::WriteOnly, AudioDevice::Mono); + detector.setStreamDescriptor (descriptor (true)); + ok = writeSamples (detector, committed, patternA) && ok; + if (rollover) ok = writeSamples (detector, committed, patternB) && ok; + wrote = ok; + detector.moveToThread (guiThread); + })}; + detector.moveToThread (worker.get ()); + worker->start (); + // Intentionally withhold GUI delivery until *all* writes have completed. + // There is no data race here: the assertion checks period identity. + worker->wait (); + QCoreApplication::sendPostedEvents (this, QEvent::MetaCall); + QVERIFY (wrote); + QCOMPARE (counts.size (), std::size_t (2)); + QCOMPARE (rejected, rollover ? 2 : 0); + QCOMPARE (counts[0], qint64 (block)); + QCOMPARE (counts[1], qint64 (committed)); + QCOMPARE (observed[0], rollover ? patternB : patternA); + QCOMPARE (observed[1], rollover ? patternB : patternA); + } + + void consumerRace (bool rollover, bool echo = false) + { + int const initialFrames = echo ? 8 * block : committed; + Detector detector {12000, rollover ? (echo ? 3.0 : 1.0) : 15.0, 1}; + detector.setBlockSize (block); + auto * guiThread = QThread::currentThread (); + Rendezvous start; + bool consumed = false; + bool consumerReady = false; + bool producerReady = false; + bool wrote = false; + auto received = std::make_unique (); + ReceiveAudioConsumer consumer; + QEventLoop events; + QTimer timeout; + timeout.setSingleShot (true); + connect (&timeout, &QTimer::timeout, &events, &QEventLoop::quit); + connect (&detector, &Detector::audioBlock, this, [&] (ReceiveAudio audio) { + if (consumed || !consumer.accept (audio, *received)) return; + int const frames = audio->end (); + if (frames != initialFrames) return; + consumed = true; + // Use the production committed-range adapter, independent of MSK's + // 3584-sample notification step or symbol length. + auto * input = echo ? received->d2 + : received->d2 + frames - 3456; + consumerReady = start.arrive (); + if (consumerReady) + { + if (echo) + { + EchoMetadata metadata; + metadata.transfer (input, 1); + } + else + { + ReferenceSpectrumInput reference; + reference.consume (input, 3456, 1, receive_reference_probe); + } + } + }, Qt::QueuedConnection); + + std::unique_ptr worker {QThread::create ([&] { + bool ok = detector.initialize (QIODevice::WriteOnly, AudioDevice::Mono); + detector.setStreamDescriptor (descriptor (rollover)); + ok = writeSamples (detector, initialFrames, patternA) && ok; + producerReady = start.arrive (); + if (producerReady) ok = writeSamples (detector, block, patternB) && ok; + wrote = ok; + detector.moveToThread (guiThread); + })}; + connect (worker.get (), &QThread::finished, &events, &QEventLoop::quit); + detector.moveToThread (worker.get ()); + timeout.start (15000); + worker->start (); + events.exec (); + worker->wait (); + QCoreApplication::sendPostedEvents (this, QEvent::MetaCall); + QVERIFY (wrote); + QVERIFY (consumed); + QVERIFY (producerReady); + QVERIFY (consumerReady); + QVERIFY (std::all_of (received->d2 + (echo ? 15 : 0), + received->d2 + initialFrames, + [] (short x) { return x == patternA; })); + if (echo) + { + EchoMetadata actual; + actual.total = actual.audio = actual.rit = actual.spacing = 0; + actual.frequency = actual.spread = 0; + actual.tones.fill (0); + actual.transfer (received->d2, -1); + EchoMetadata expected; + QCOMPARE (actual.total, expected.total); + QCOMPARE (actual.audio, expected.audio); + QCOMPARE (actual.rit, expected.rit); + QCOMPARE (actual.spacing, expected.spacing); + QCOMPARE (actual.frequency, expected.frequency); + QCOMPARE (actual.spread, expected.spread); + QVERIFY (actual.tones == expected.tones); + // Header insertion must leave all captured audio after sample 15 intact. + QVERIFY (std::all_of (received->d2 + 15, received->d2 + initialFrames, + [] (short x) { return x == patternA; })); + } + // TSan checks conflicting accesses when the compiler instruments them. + // See echo-jtty-ownership.md for the local Echo array-copy blind spot. + QCOMPARE (received->params.kin, initialFrames); + } + +private Q_SLOTS: + void downsamplersRetainIndependentHistory () + { + std::array firstState {}, secondState {}, referenceState {}; + std::array firstInput, secondInput, interferingInput; + firstInput.fill (1200); + secondInput.fill (2400); + interferingInput.fill (-3000); + std::array ignored {}, actual {}, expected {}; + qint32 inputFrames = int (firstInput.size ()); + qint32 outputFrames = 0; + + fil4_state_ (firstInput.data (), &inputFrames, ignored.data (), + &outputFrames, firstState.data ()); + fil4_state_ (interferingInput.data (), &inputFrames, ignored.data (), + &outputFrames, secondState.data ()); + fil4_state_ (secondInput.data (), &inputFrames, actual.data (), + &outputFrames, firstState.data ()); + fil4_state_ (firstInput.data (), &inputFrames, ignored.data (), + &outputFrames, referenceState.data ()); + fil4_state_ (secondInput.data (), &inputFrames, expected.data (), + &outputFrames, referenceState.data ()); + + QVERIFY (actual == expected); + } + + void producersRemainIsolatedAcrossSourceSwitch () + { + ReceiveAudioProducer first; + ReceiveAudioProducer second; + ReceiveAudio firstPrefix, firstContinuation, secondPrefix, secondContinuation; + { + QMutexLocker lock {&dec_data_mutex ()}; + first.reset (15.0); + std::fill_n (first.data ().d2, block, patternA); + first.setFrames (block); + firstPrefix = first.capture (block, 15.0); + + second.reset (15.0); + std::fill_n (second.data ().d2, block, patternB); + second.setFrames (block); + secondPrefix = second.capture (block, 15.0); + + std::fill_n (first.data ().d2 + block, block, patternA); + first.setFrames (committed); + firstContinuation = first.capture (committed, 15.0); + std::fill_n (second.data ().d2 + block, block, patternB); + second.setFrames (committed); + secondContinuation = second.capture (committed, 15.0); + } + + QCOMPARE (first.frames (), committed); + QCOMPARE (second.frames (), committed); + QCOMPARE (firstContinuation->start, block); + QCOMPARE (secondContinuation->start, block); + QVERIFY (std::all_of (firstContinuation->samples.begin (), + firstContinuation->samples.end (), + [] (short sample) { return sample == patternA; })); + QVERIFY (std::all_of (secondContinuation->samples.begin (), + secondContinuation->samples.end (), + [] (short sample) { return sample == patternB; })); + + auto target = std::make_unique (); + ReceiveAudioConsumer consumer; + QVERIFY (consumer.accept (firstPrefix, *target)); + QVERIFY (consumer.accept (secondPrefix, *target)); + QVERIFY (!consumer.accept (firstContinuation, *target)); + QVERIFY (consumer.accept (secondContinuation, *target)); + QCOMPARE (target->params.kin, committed); + QCOMPARE (target->d2[committed - 1], patternB); + } + + void handoff_rejects_gaps_and_disk_stale_work () + { + Detector detector {12000, 15.0, 1}; + detector.setBlockSize (block); + QVERIFY (detector.initialize (QIODevice::WriteOnly, AudioDevice::Mono)); + detector.setStreamDescriptor (descriptor (false)); + std::vector blocks; + connect (&detector, &Detector::audioBlock, this, + [&] (ReceiveAudio audio) { blocks.push_back (std::move (audio)); }); + QVERIFY (writeSamples (detector, committed, patternA)); + QCOMPARE (blocks.size (), std::size_t (2)); + ReceiveAudioConsumer consumer; + auto received = std::make_unique (); + QVERIFY (!consumer.accept (blocks[1], *received)); // missing prefix + QCOMPARE (received->params.kin, 0); + QVERIFY (consumer.accept (blocks[0], *received)); + QVERIFY (!consumer.accept (blocks[0], *received)); // duplicate + QVERIFY (consumer.accept (blocks[1], *received)); + QCOMPARE (received->params.kin, committed); + // Installing a WAV invalidates all queued work from the old live epoch. + consumer.invalidate (); + std::fill_n (received->d2, committed, short {-123}); + QVERIFY (!consumer.accept (blocks[0], *received)); + QCOMPARE (received->d2[0], short {-123}); + detector.reset (); + QVERIFY (writeSamples (detector, block, patternB)); + QCOMPARE (blocks.size (), std::size_t (3)); + QVERIFY (consumer.accept (blocks.back (), *received)); + QCOMPARE (received->params.kin, block); + QVERIFY (std::all_of (received->d2, received->d2 + block, + [] (short x) { return x == patternB; })); + QVERIFY (std::all_of (received->d2 + block, received->d2 + committed, + [] (short x) { return x == 0; })); + // Producer reset and consumer writes cannot change an already owned block. + QVERIFY (std::all_of (blocks[0]->samples.begin (), blocks[0]->samples.end (), + [] (short x) { return x == patternA; })); + detector.setTRPeriod (30.0); + QVERIFY (writeSamples (detector, block, patternA)); + QCOMPARE (blocks.size (), std::size_t (4)); + QVERIFY (!consumer.accept (blocks[2], *received)); + QVERIFY (consumer.accept (blocks[3], *received)); + QCOMPARE (received->params.kin, block); + QCOMPARE (received->d2[0], patternA); + QVERIFY (writeSamples (detector, 288, patternB)); + QCOMPARE (blocks.size (), std::size_t (4)); // incomplete notification + detector.flushBufferedFrames (block + 288); + QCOMPARE (blocks.size (), std::size_t (5)); + QVERIFY (consumer.accept (blocks.back (), *received)); + QCOMPARE (received->params.kin, block + 288); + QCOMPARE (received->d2[block + 287], patternB); + detector.flushBufferedFrames (block + 288); + QCOMPARE (blocks.size (), std::size_t (5)); // flush is idempotent + } + void stale_echo_metadata_must_not_modify_next_period () + { + constexpr int echoFrames = 8 * block; + Detector detector {12000, 3.0, 1}; + detector.setBlockSize (block); + auto * guiThread = QThread::currentThread (); + bool handled = false, wrote = false; + auto received = std::make_unique (); + ReceiveAudioConsumer consumer; + int rejected = 0; + connect (&detector, &Detector::audioBlock, this, [&] (ReceiveAudio audio) { + if (!consumer.accept (audio, *received)) { ++rejected; return; } + if (audio->end () != echoFrames) return; + handled = true; // B is still processed; stale A cannot change it. + EchoMetadata metadata; + metadata.transfer (received->d2, 1); + }, Qt::QueuedConnection); + std::unique_ptr worker {QThread::create ([&] { + bool ok = detector.initialize (QIODevice::WriteOnly, AudioDevice::Mono); + detector.setStreamDescriptor (descriptor (true)); + ok = writeSamples (detector, echoFrames, patternA) && ok; + ok = writeSamples (detector, echoFrames, patternB) && ok; + wrote = ok; + detector.moveToThread (guiThread); + })}; + detector.moveToThread (worker.get ()); + worker->start (); + worker->wait (); + QCoreApplication::sendPostedEvents (this, QEvent::MetaCall); + QVERIFY (wrote); + QVERIFY (handled); + QCOMPARE (rejected, 8); + QCOMPARE (received->params.kin, echoFrames); + QVERIFY (std::all_of (received->d2 + 15, received->d2 + echoFrames, + [] (short x) { return x == patternB; })); + } + + void queued_prefix_without_reuse () { notificationTest (false); } + void queued_period_must_retain_identity () { notificationTest (true); } + void reference_measurement_vs_append () { consumerRace (false); } + void reference_measurement_vs_reset () { consumerRace (true); } + void reference_application_preserves_uncommitted_suffix () + { + std::fill_n (dec_data.d2, committed, patternA); + dec_data.params.kin = committed; + std::fill_n (dec_data.d2 + committed, 3456, patternB); + std::array suffix; + std::copy_n (dec_data.d2 + committed, suffix.size (), suffix.begin ()); + + ReferenceSpectrumInput reference; + reference.consume (dec_data.d2, committed, 2, receive_reference_apply_probe); + QVERIFY (std::equal (suffix.begin (), suffix.end (), + dec_data.d2 + committed)); + } + void reference_input_packetization () + { + std::vector samples (13952); + std::vector> calls; + ReferenceSpectrumInput reference; + auto record = [&] (short * p, int count) { + calls.emplace_back (int (p - samples.data ()), count); + }; + + reference.consume (samples.data (), 128, 2, record); + reference.consume (samples.data (), 2176, 2, record); + reference.consume (samples.data (), 5760, 2, record); + reference.consume (samples.data (), 13952, 2, record); + reference.consume (samples.data (), 13952, 2, record); + + std::vector> const expected { + {0, 0}, {0, 128}, {128, 2048}, {2176, 3456}, {5632, 128}, + {5760, 3456}, {9216, 3456}, {12672, 1280} + }; + QVERIFY (calls == expected); + + calls.clear (); + reference.consume (samples.data (), 32, 2, record); + std::vector> const newPeriod {{0, 0}, {0, 32}}; + QVERIFY (calls == newPeriod); + + calls.clear (); + reference.reset (); + reference.consume (samples.data (), 64, 2, record); + std::vector> const reset {{0, 0}, {0, 64}}; + QVERIFY (calls == reset); + } + void reference_application_packetization () + { + QTemporaryDir directory; + QVERIFY (directory.isValid ()); + auto path = (directory.path () + "/refspec.dat").toLocal8Bit (); + QFile file (QString::fromLocal8Bit (path)); + QVERIFY (writeReferenceSpectrum (file)); + auto const original = noiseSamples (2 * 3456); + auto const baseline = runReferenceSpectrum (original, 3456, false, path); + QCOMPARE (baseline.size (), original.size ()); + QVERIFY (baseline != original); + QVERIFY (std::any_of (baseline.begin (), baseline.end (), [] (short s) {return s != 0;})); + auto const output = runReferenceSpectrum (original, 3584, false, path); + QCOMPARE (output.size (), baseline.size ()); + for (std::size_t i = 0; i < output.size (); ++i) + QVERIFY (std::abs (int (output[i]) - int (baseline[i])) <= 1); + } + void reference_measurement_packetization () + { + QTemporaryDir directory; + QVERIFY (directory.isValid ()); + auto path = (directory.path () + "/refspec.dat").toLocal8Bit (); + QFile file (QString::fromLocal8Bit (path)); + auto const original = noiseSamples (4 * 3456); + + QCOMPARE (runReferenceSpectrum (original, 3456, true, path), original); + QVERIFY (file.open (QIODevice::ReadOnly)); + auto const measured = file.readAll (); + file.close (); + QVERIFY (!measured.isEmpty ()); + QCOMPARE (runReferenceSpectrum (original, 3584, true, path), original); + QVERIFY (file.open (QIODevice::ReadOnly)); + QCOMPARE (file.readAll (), measured); + } + void echo_metadata_vs_append () { consumerRace (false, true); } + void echo_metadata_vs_reset () { consumerRace (true, true); } +}; + +QTEST_GUILESS_MAIN (TestReceiveAudioHandoff) +#include "test_receive_audio_handoff.moc" diff --git a/tests/unit/audio/test_tx_audio_queue.cpp b/tests/unit/audio/test_tx_audio_queue.cpp new file mode 100644 index 00000000..e73eb79e --- /dev/null +++ b/tests/unit/audio/test_tx_audio_queue.cpp @@ -0,0 +1,209 @@ +#include + +#include + +#include "Audio/TxAudioQueue.hpp" +#include "Audio/TxAudioQueueEpochSnapshot.hpp" +#include "Modulator/JttyPcmFifo.hpp" + +namespace +{ + TxAudioQueueEpoch epoch (qint64 value) + { + return TxAudioQueueEpoch {value}; + } +} + +class TestTxAudioQueue : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void epoch_snapshot_requires_stable_even_sequence () + { + TxAudioQueueEpoch snapshot; + QVERIFY (!TxAudioQueueDetail::tryMakeEpochSnapshot (1, 11, 1, snapshot)); + QVERIFY (!TxAudioQueueDetail::tryMakeEpochSnapshot (2, 11, 4, snapshot)); + QVERIFY (TxAudioQueueDetail::tryMakeEpochSnapshot (6, 11, 6, snapshot)); + QCOMPARE (snapshot, epoch (11)); + } + + Q_SLOT void exposes_value_types_and_capacity () + { + static_assert (!std::is_copy_constructible::value, + "the queue must not be copied"); + static_assert (!std::is_copy_assignable::value, + "the queue must not be copy assigned"); + + TxAudioQueue queue; + JttyPcmFifo fifo {TxAudioQueue::defaultCapacity ()}; + QCOMPARE (queue.capacity (), TxAudioQueue::defaultCapacity ()); + QCOMPARE (queue.capacity (), fifo.capacity ()); + QVERIFY (qMetaTypeId () != QMetaType::UnknownType); + QVERIFY (qMetaTypeId () != QMetaType::UnknownType); + QVERIFY (qMetaTypeId () != QMetaType::UnknownType); + QVERIFY (qMetaTypeId () != QMetaType::UnknownType); + QVERIFY (epoch (1) == epoch (1)); + QVERIFY (epoch (1) != epoch (2)); + } + + Q_SLOT void enqueues_vectors_and_raw_samples_gaplessly () + { + TxAudioQueue queue {5}; + auto const current = epoch (11); + queue.clear (current); + queue.applyPendingReset (); + + QVector const first {1, 2, 3}; + auto result = queue.enqueue (first, current); + QVERIFY (result.accepted); + QCOMPARE (result.progress.epoch, current); + QCOMPARE (result.progress.queued_samples, qint64 (3)); + QCOMPARE (result.progress.served_samples, qint64 (0)); + QCOMPARE (result.progress.total_samples, qint64 (3)); + + QCOMPARE (queue.pullSample (10), qint16 (1)); + QCOMPARE (queue.pullSample (10), qint16 (2)); + + qint16 const second[] {4, 5, 6}; + result = queue.enqueue (second, 3, current); + QVERIFY (result.accepted); + QCOMPARE (result.progress.queued_samples, qint64 (4)); + QCOMPARE (result.progress.served_samples, qint64 (2)); + QCOMPARE (result.progress.total_samples, qint64 (6)); + + QCOMPARE (queue.pullSample (10), qint16 (3)); + QCOMPARE (queue.pullSample (10), qint16 (4)); + QCOMPARE (queue.pullSample (10), qint16 (5)); + QCOMPARE (queue.pullSample (10), qint16 (6)); + QCOMPARE (queue.pullSample (10), qint16 (0)); + + auto const progress = queue.progress (); + QCOMPARE (progress.queued_samples, qint64 (0)); + QCOMPARE (progress.served_samples, qint64 (6)); + QCOMPARE (progress.total_samples, qint64 (6)); + } + + Q_SLOT void rejects_stale_epoch_with_authoritative_progress () + { + TxAudioQueue queue {4}; + auto const current = epoch (21); + queue.clear (current); + queue.applyPendingReset (); + QVERIFY (queue.enqueue (QVector {7, 8}, current).accepted); + + qint16 const stale_sample {9}; + auto const rejected = queue.enqueue (&stale_sample, 1, epoch (22)); + QVERIFY (!rejected.accepted); + QCOMPARE (rejected.progress.epoch, current); + QCOMPARE (rejected.progress.queued_samples, qint64 (2)); + QCOMPARE (rejected.progress.served_samples, qint64 (0)); + QCOMPARE (rejected.progress.total_samples, qint64 (2)); + + auto const empty = queue.enqueue (nullptr, 0, current); + QVERIFY (empty.accepted); + QCOMPARE (empty.progress.total_samples, qint64 (2)); + QVERIFY (!queue.enqueue (nullptr, 0, epoch (99)).accepted); + } + + Q_SLOT void pending_reset_excludes_aborted_samples () + { + TxAudioQueue queue {8}; + auto const aborted = epoch (31); + auto const replacement = epoch (32); + queue.clear (aborted); + queue.applyPendingReset (); + QVERIFY (queue.enqueue (QVector {1, 2, 3, 4}, aborted).accepted); + QCOMPARE (queue.pullSample (0), qint16 (1)); + + queue.clear (replacement); + auto progress = queue.progress (); + QCOMPARE (progress.epoch, replacement); + QCOMPARE (progress.queued_samples, qint64 (0)); + QCOMPARE (progress.served_samples, qint64 (0)); + QCOMPARE (progress.total_samples, qint64 (0)); + + qint16 const samples[] {8, 9}; + auto const result = queue.enqueue (samples, 2, replacement); + QVERIFY (result.accepted); + QCOMPARE (result.progress.queued_samples, qint64 (2)); + QCOMPARE (result.progress.total_samples, qint64 (2)); + + queue.applyPendingReset (); + QCOMPARE (queue.pullSample (0), qint16 (8)); + QCOMPARE (queue.pullSample (0), qint16 (9)); + progress = queue.progress (); + QCOMPARE (progress.served_samples, qint64 (2)); + QCOMPARE (progress.total_samples, qint64 (2)); + } + + Q_SLOT void overflow_leaves_accounting_unchanged () + { + TxAudioQueue queue {3}; + auto const current = epoch (41); + queue.clear (current); + queue.applyPendingReset (); + QVERIFY (queue.enqueue (QVector {10, 11}, current).accepted); + + auto const rejected = queue.enqueue (QVector {12, 13}, current); + QVERIFY (!rejected.accepted); + QCOMPARE (rejected.progress.queued_samples, qint64 (2)); + QCOMPARE (rejected.progress.total_samples, qint64 (2)); + + QCOMPARE (queue.pullSample (0), qint16 (10)); + QVERIFY (queue.enqueue (QVector {12, 13}, current).accepted); + QCOMPARE (queue.pullSample (0), qint16 (11)); + QCOMPARE (queue.pullSample (0), qint16 (12)); + QCOMPARE (queue.pullSample (0), qint16 (13)); + } + + Q_SLOT void reports_drain_epoch_total_and_rearms () + { + TxAudioQueue queue {4}; + auto const current = epoch (51); + queue.clear (current); + queue.applyPendingReset (); + QVERIFY (queue.enqueue (QVector {20, 21}, current).accepted); + + QCOMPARE (queue.pullSample (2), qint16 (20)); + QCOMPARE (queue.pullSample (2), qint16 (21)); + QCOMPARE (queue.pullSample (2), qint16 (0)); + QVERIFY (!queue.takeDrainReady ().ready); + QCOMPARE (queue.pullSample (2), qint16 (0)); + + auto drain = queue.takeDrainReady (); + QVERIFY (drain.ready); + QCOMPARE (drain.epoch, current); + QCOMPARE (drain.total_at_drain, qint64 (2)); + QVERIFY (!queue.takeDrainReady ().ready); + + qint16 const next {22}; + QVERIFY (queue.enqueue (&next, 1, current).accepted); + QCOMPARE (queue.pullSample (0), qint16 (22)); + drain = queue.takeDrainReady (); + QVERIFY (drain.ready); + QCOMPARE (drain.epoch, current); + QCOMPARE (drain.total_at_drain, qint64 (3)); + } + + Q_SLOT void reset_suppresses_stale_drain () + { + TxAudioQueue queue {2}; + auto const first = epoch (61); + auto const second = epoch (62); + queue.clear (first); + queue.applyPendingReset (); + QVERIFY (queue.enqueue (QVector {30}, first).accepted); + QCOMPARE (queue.pullSample (0), qint16 (30)); + + queue.clear (second); + auto const stale = queue.takeDrainReady (); + QVERIFY (!stale.ready); + QCOMPARE (stale.epoch, second); + QCOMPARE (stale.total_at_drain, qint64 (0)); + } +}; + +QTEST_GUILESS_MAIN (TestTxAudioQueue) + +#include "test_tx_audio_queue.moc" diff --git a/tests/unit/audio/test_tx_playback_diagnostics.cpp b/tests/unit/audio/test_tx_playback_diagnostics.cpp new file mode 100644 index 00000000..90d9ec7e --- /dev/null +++ b/tests/unit/audio/test_tx_playback_diagnostics.cpp @@ -0,0 +1,261 @@ +#include + +#include + +#include "Audio/TxPlaybackDiagnostics.hpp" + +namespace +{ + TxEvidence::TxRawPlayoutSnapshot deviceClockStart (qint64 sequence) + { + TxEvidence::TxRawPlayoutSnapshot raw; + raw.tier = TxEvidence::TxPlayoutTier::DeviceClock; + raw.backend_start_sequence = sequence; + raw.start_event = true; + raw.available = true; + raw.state = TxEvidence::TxBackendState::Active; + raw.sample_rate_hz = 12000; + raw.processed_usecs = 250000; + raw.successfully_written_frames = 3000; + raw.report_interval_ms = 25; + return raw; + } +} + +class TestTxPlaybackDiagnostics : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void identities_are_trivial_and_strong () + { + static_assert (std::is_trivially_copyable::value, + "session identities must remain trivially copyable"); + static_assert (std::is_trivially_copyable::value, + "generation identities must remain trivially copyable"); + static_assert (!std::is_convertible::value, + "session identity conversion must be explicit"); + QCOMPARE (TxEvidence::TxSessionId {}.value (), qint64 (0)); + QCOMPARE (TxEvidence::TxSessionId::invalid (), TxEvidence::TxSessionId {}); + QCOMPARE (TxEvidence::TxGeneration::invalid (), TxEvidence::TxGeneration {}); + QVERIFY (!TxEvidence::TxGeneration {}.isValid ()); + QVERIFY (TxEvidence::TxSessionId {4} < TxEvidence::TxSessionId {5}); + QVERIFY (TxEvidence::TxGeneration {4} < TxEvidence::TxGeneration {5}); + QVERIFY (qMetaTypeId () != QMetaType::UnknownType); + QVERIFY (qMetaTypeId () != QMetaType::UnknownType); + auto const generation1 = TxEvidence::TxPlaybackDiagnostics::allocateGeneration (); + auto const generation2 = TxEvidence::TxPlaybackDiagnostics::allocateGeneration (); + QVERIFY (generation1 < generation2); + } + + Q_SLOT void preserves_every_stop_reason_and_tail () + { + TxEvidence::TxPlaybackDiagnostics recorder; + TxEvidence::TxStopReason const reasons[] = { + TxEvidence::TxStopReason::NormalEnd, + TxEvidence::TxStopReason::UserHalt, + TxEvidence::TxStopReason::Watchdog, + TxEvidence::TxStopReason::Error, + TxEvidence::TxStopReason::ModeChange + }; + for (int index = 0; index != 5; ++index) + { + auto const session = recorder.beginSession ("FT8", 12000); + auto const generation = recorder.beginGeneration (session); + QVERIFY (generation.isValid ()); + auto const decision = recorder.stop (session, generation, reasons[index], index + 1); + QCOMPARE (decision.reason, reasons[index]); + QCOMPARE (decision.tail_ms, index + 1); + } + QCOMPARE (recorder.terminalSessions ().size (), 5); + } + + Q_SLOT void constructs_bounded_commit_extents () + { + QCOMPARE (TxEvidence::boundedCommittedEndSample (0, 0, 47999), qint64 (47999)); + QCOMPARE (TxEvidence::boundedCommittedEndSample (4800, 0, 47999), qint64 (52799)); + QCOMPARE (TxEvidence::boundedCommittedEndSample (0, 12000, 47999), qint64 (35999)); + QCOMPARE (TxEvidence::boundedCommittedEndSample (0, 48000, 47999), qint64 (-1)); + QCOMPARE (TxEvidence::interleavedFrameCount (2000, 2), qint64 (1000)); + QCOMPARE (TxEvidence::interleavedFrameCount (1999, 2), qint64 (-1)); + } + + Q_SLOT void rejects_invalid_session_start () + { + TxEvidence::TxPlaybackDiagnostics recorder; + QCOMPARE (recorder.beginSession ("FT8", 0), TxEvidence::TxSessionId::invalid ()); + } + + Q_SLOT void maps_legacy_tails_for_every_stop_reason () + { + TxEvidence::TxStopReason const reasons[] = { + TxEvidence::TxStopReason::NormalEnd, + TxEvidence::TxStopReason::UserHalt, + TxEvidence::TxStopReason::Watchdog, + TxEvidence::TxStopReason::Error, + TxEvidence::TxStopReason::ModeChange + }; + for (auto reason : reasons) + { + QCOMPARE (TxEvidence::TxPlaybackDiagnostics::decisionFor (reason, false).tail_ms, 200); + QCOMPARE (TxEvidence::TxPlaybackDiagnostics::decisionFor (reason, true).tail_ms, 0); + } + } + + Q_SLOT void captures_lifecycle_and_growing_target () + { + TxEvidence::TxPlaybackDiagnostics recorder; + auto const session = recorder.beginSession ("JTTY", 12000, 100, true); + auto const generation = recorder.beginGeneration (session); + QVERIFY (recorder.commitTarget (session, generation, 300)); + QVERIFY (!recorder.commitTarget (session, generation, 299)); + QVERIFY (recorder.observe (session, generation, deviceClockStart (7))); + QVERIFY (recorder.observeSourceProgress (session, generation, 250, 301, + "JTTY FIFO progress")); + QVERIFY (!recorder.observeSourceProgress (session, generation, 249, 301)); + recorder.stop (session, generation, TxEvidence::TxStopReason::NormalEnd, 42); + auto later = deviceClockStart (7); + later.start_event = false; + later.processed_usecs = 300000; + QVERIFY (recorder.observe (session, generation, later)); + + auto terminal = recorder.terminalSessions ().last (); + QCOMPARE (terminal.committed_end_sample, qint64 (300)); + QCOMPARE (terminal.consumed_samples, qint64 (3600)); + QCOMPARE (terminal.source_served_samples, qint64 (250)); + QCOMPARE (terminal.stop.tail_ms, 42); + QVERIFY (terminal.terminal_playout_observed); + QVERIFY (terminal.diagnostic.contains ("JTTY FIFO progress")); + + QVERIFY (recorder.commitTarget (session, generation, 400, true, + "Final JTTY source commitment")); + terminal = recorder.terminalSessions ().last (); + QCOMPARE (terminal.committed_end_sample, qint64 (400)); + QVERIFY (terminal.diagnostic.contains ("Final JTTY source commitment")); + QVERIFY (terminal.diagnostic.contains ("JTTY FIFO progress")); + QVERIFY (recorder.diagnosticDump ().contains ("Final JTTY source commitment")); + } + + Q_SLOT void normalizes_evidence_tiers_and_underrun () + { + TxEvidence::TxPlaybackDiagnostics recorder; + auto const session = recorder.beginSession ("FT4", 12000, 7999, true); + auto const generation = recorder.beginGeneration (session); + + auto raw = deviceClockStart (10); + raw.processed_usecs = 500000; + raw.source_served_frames = 5000; + raw.error = TxEvidence::TxBackendError::Underrun; + QVERIFY (recorder.observe (session, generation, raw)); + raw.start_event = false; + raw.processed_usecs = 600000; + raw.error = TxEvidence::TxBackendError::None; + QVERIFY (recorder.observe (session, generation, raw)); + recorder.stop (session, generation, TxEvidence::TxStopReason::Error); + auto terminal = recorder.terminalSessions ().last (); + QCOMPARE (terminal.consumed_samples, qint64 (7200)); + QVERIFY (terminal.underrun); + QVERIFY (terminal.truncated_known); + QVERIFY (terminal.truncated); + QVERIFY (recorder.diagnosticDump ().contains ("underrun=true")); + + auto const deadSession = recorder.beginSession ("FT8", 12000); + auto const deadGeneration = recorder.beginGeneration (deadSession); + raw = deviceClockStart (11); + raw.tier = TxEvidence::TxPlayoutTier::DeadReckoning; + raw.successfully_written_frames = 123; + QVERIFY (recorder.observe (deadSession, deadGeneration, raw)); + recorder.stop (deadSession, deadGeneration, TxEvidence::TxStopReason::NormalEnd); + QCOMPARE (recorder.terminalSessions ().last ().consumed_samples, qint64 (123)); + + auto const unavailableSession = recorder.beginSession ("FT8", 12000); + auto const unavailableGeneration = recorder.beginGeneration (unavailableSession); + raw = deviceClockStart (12); + raw.tier = TxEvidence::TxPlayoutTier::Unavailable; + QVERIFY (recorder.observe (unavailableSession, unavailableGeneration, raw)); + recorder.stop (unavailableSession, unavailableGeneration, + TxEvidence::TxStopReason::NormalEnd); + QCOMPARE (recorder.terminalSessions ().last ().consumed_samples, qint64 (-1)); + QVERIFY (!recorder.terminalSessions ().last ().terminal_playout_observed); + } + + Q_SLOT void unavailable_start_is_retained_and_obvious () + { + TxEvidence::TxPlaybackDiagnostics recorder; + auto const session = recorder.beginSession ("FT8", 48000, 47999, true); + auto const generation = recorder.beginGeneration (session); + TxEvidence::TxRawPlayoutSnapshot raw; + raw.start_event = true; + raw.backend_start_sequence = 20; + raw.tier = TxEvidence::TxPlayoutTier::Unavailable; + raw.state = TxEvidence::TxBackendState::Unavailable; + raw.diagnostic = "No audio output device configured"; + QVERIFY (recorder.observe (session, generation, raw)); + recorder.stop (session, generation, TxEvidence::TxStopReason::Error, 200); + auto const terminal = recorder.terminalSessions ().last (); + QCOMPARE (terminal.tier, TxEvidence::TxPlayoutTier::Unavailable); + QVERIFY (!terminal.terminal_playout_observed); + QVERIFY (recorder.diagnosticDump ().contains ("tier=unavailable")); + } + + Q_SLOT void weaker_snapshot_does_not_replace_device_clock_evidence () + { + TxEvidence::TxPlaybackDiagnostics recorder; + auto const session = recorder.beginSession ("JTTY", 12000, 2999, true); + auto const generation = recorder.beginGeneration (session); + auto raw = deviceClockStart (21); + QVERIFY (recorder.observe (session, generation, raw)); + recorder.stop (session, generation, TxEvidence::TxStopReason::NormalEnd); + + TxEvidence::TxRawPlayoutSnapshot unavailable; + unavailable.backend_start_sequence = 21; + unavailable.diagnostic = "No audio output stream is active"; + QVERIFY (!recorder.observe (session, generation, unavailable)); + + auto const terminal = recorder.terminalSessions ().last (); + QCOMPARE (terminal.tier, TxEvidence::TxPlayoutTier::DeviceClock); + QCOMPARE (terminal.consumed_samples, qint64 (3000)); + QVERIFY (terminal.terminal_playout_observed); + } + + Q_SLOT void rejects_stale_and_regressing_events () + { + TxEvidence::TxPlaybackDiagnostics recorder; + auto const session = recorder.beginSession ("FT8", 12000); + auto const generation = recorder.beginGeneration (session); + auto raw = deviceClockStart (17); + QVERIFY (recorder.observe (session, generation, raw)); + QVERIFY (!recorder.observe (session, generation, raw)); + QVERIFY (!recorder.observe (session, TxEvidence::TxGeneration {generation.value () - 1}, raw)); + raw.start_event = false; + raw.backend_start_sequence = 18; + QVERIFY (!recorder.observe (session, generation, raw)); + raw.backend_start_sequence = 17; + raw.processed_usecs = 1; + QVERIFY (!recorder.observe (session, generation, raw)); + + recorder.stop (session, generation, TxEvidence::TxStopReason::NormalEnd); + raw.processed_usecs = 750000; + QVERIFY (recorder.observe (session, generation, raw)); + QCOMPARE (recorder.terminalSessions ().last ().consumed_samples, qint64 (9000)); + } + + Q_SLOT void retains_the_last_sixteen_terminal_sessions () + { + TxEvidence::TxPlaybackDiagnostics recorder; + for (int index = 0; index != 20; ++index) + { + auto const session = recorder.beginSession ("FT8", 12000); + auto const generation = recorder.beginGeneration (session); + recorder.stop (session, generation, TxEvidence::TxStopReason::NormalEnd); + } + auto const terminals = recorder.terminalSessions (); + QCOMPARE (terminals.size (), 16); + QVERIFY (terminals.first ().session_id.value () < terminals.last ().session_id.value ()); + QVERIFY (recorder.diagnosticDump ().contains ("terminal")); + } +}; + +QTEST_GUILESS_MAIN (TestTxPlaybackDiagnostics) + +#include "test_tx_playback_diagnostics.moc" diff --git a/tests/unit/audio/test_tx_request.cpp b/tests/unit/audio/test_tx_request.cpp new file mode 100644 index 00000000..ee4b24f2 --- /dev/null +++ b/tests/unit/audio/test_tx_request.cpp @@ -0,0 +1,125 @@ +#include + +#include +#include + +#include "Audio/TxRequest.hpp" + +class TxRequestRelay : public QObject +{ + Q_OBJECT + +public: + TxEvidence::TxRequest received; + bool delivered {false}; + + Q_SIGNAL void requestReady (TxEvidence::TxRequest request); + + Q_SLOT void receive (TxEvidence::TxRequest request) + { + received = request; + delivered = true; + } +}; + +class TestTxRequest : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void has_ft8_defaults () + { + TxEvidence::TxRequest const request; + QCOMPARE (request.mode, QString {"FT8"}); + QCOMPARE (request.symbols_length, 79u); + QCOMPARE (request.frames_per_symbol, 1920.0); + QCOMPARE (request.frequency_hz, 1500.0); + QCOMPARE (request.tone_spacing, -3.0); + QCOMPARE (request.channel, AudioDevice::Mono); + QVERIFY (request.synchronize); + QVERIFY (!request.fast_mode); + QCOMPARE (request.snr_db, 99.0); + QCOMPARE (request.tr_period_s, 60.0); + QCOMPARE (request.session_id, TxEvidence::TxSessionId::invalid ()); + QCOMPARE (request.generation, TxEvidence::TxGeneration::invalid ()); + QCOMPARE (request.queue_epoch, TxAudioQueueEpoch::invalid ()); + QVERIFY (!request.tuning); + QVERIFY (request.cw_id.isEmpty ()); + QCOMPARE (request.start_window_open_ms, qint64 {-1}); + QCOMPARE (request.start_window_close_ms, qint64 {-1}); + } + + Q_SLOT void copies_every_distinct_field () + { + TxEvidence::TxRequest source; + source.mode = "JTTY"; + source.symbols_length = 101; + source.frames_per_symbol = 202.5; + source.frequency_hz = 303.5; + source.tone_spacing = 404.5; + source.channel = AudioDevice::Right; + source.synchronize = false; + source.fast_mode = true; + source.snr_db = 505.5; + source.tr_period_s = 606.5; + source.session_id = TxEvidence::TxSessionId {707}; + source.generation = TxEvidence::TxGeneration {808}; + source.queue_epoch = TxAudioQueueEpoch {909}; + source.tuning = true; + source.cw_id = {1, 0, 1}; + source.start_window_open_ms = 1010; + source.start_window_close_ms = 1111; + + auto const copy = source; + source = {}; + + QCOMPARE (copy.mode, QString {"JTTY"}); + QCOMPARE (copy.symbols_length, 101u); + QCOMPARE (copy.frames_per_symbol, 202.5); + QCOMPARE (copy.frequency_hz, 303.5); + QCOMPARE (copy.tone_spacing, 404.5); + QCOMPARE (copy.channel, AudioDevice::Right); + QVERIFY (!copy.synchronize); + QVERIFY (copy.fast_mode); + QCOMPARE (copy.snr_db, 505.5); + QCOMPARE (copy.tr_period_s, 606.5); + QCOMPARE (copy.session_id, TxEvidence::TxSessionId {707}); + QCOMPARE (copy.generation, TxEvidence::TxGeneration {808}); + QCOMPARE (copy.queue_epoch, TxAudioQueueEpoch {909}); + QVERIFY (copy.tuning); + QCOMPARE (copy.cw_id, QVector ({1, 0, 1})); + QCOMPARE (copy.start_window_open_ms, qint64 {1010}); + QCOMPARE (copy.start_window_close_ms, qint64 {1111}); + } + + Q_SLOT void registers_and_delivers_queued_requests () + { + TxEvidence::register_tx_request_type (); + QCOMPARE (QMetaType::type ("TxEvidence::TxRequest"), + qMetaTypeId ()); + + TxRequestRelay relay; + QVERIFY (connect (&relay, &TxRequestRelay::requestReady, + &relay, &TxRequestRelay::receive, + Qt::QueuedConnection)); + + TxEvidence::TxRequest request; + request.mode = "FT4"; + request.session_id = TxEvidence::TxSessionId {12}; + request.generation = TxEvidence::TxGeneration {34}; + request.queue_epoch = TxAudioQueueEpoch {56}; + request.cw_id = {0, 1, 0}; + Q_EMIT relay.requestReady (request); + + QTRY_VERIFY (relay.delivered); + QCOMPARE (relay.received.mode, QString {"FT4"}); + QCOMPARE (relay.received.session_id, TxEvidence::TxSessionId {12}); + QCOMPARE (relay.received.generation, TxEvidence::TxGeneration {34}); + QCOMPARE (relay.received.queue_epoch, request.queue_epoch); + QCOMPARE (relay.received.cw_id, QVector ({0, 1, 0})); + } +}; + +QTEST_GUILESS_MAIN (TestTxRequest) + +#include "test_tx_request.moc" diff --git a/tests/unit/audio/test_wav_input_loading.cpp b/tests/unit/audio/test_wav_input_loading.cpp new file mode 100644 index 00000000..d66e3f23 --- /dev/null +++ b/tests/unit/audio/test_wav_input_loading.cpp @@ -0,0 +1,203 @@ +#include + +#include +#include + +#include +#include +#include + +#include "Audio/WavInputLoader.hpp" + +namespace +{ +QByteArray le16 (quint16 value) +{ + QByteArray bytes (2, '\0'); + bytes[0] = static_cast (value & 0xffu); + bytes[1] = static_cast ((value >> 8) & 0xffu); + return bytes; +} + +QByteArray le32 (quint32 value) +{ + QByteArray bytes (4, '\0'); + bytes[0] = static_cast (value & 0xffu); + bytes[1] = static_cast ((value >> 8) & 0xffu); + bytes[2] = static_cast ((value >> 16) & 0xffu); + bytes[3] = static_cast ((value >> 24) & 0xffu); + return bytes; +} + +QByteArray wave_file (quint32 sample_rate, quint16 bits_per_sample, + QByteArray const& samples) +{ + auto const bytes_per_frame = static_cast (bits_per_sample / 8u); + QByteArray format; + format.append (le16 (1)); + format.append (le16 (1)); + format.append (le32 (sample_rate)); + format.append (le32 (sample_rate * bytes_per_frame)); + format.append (le16 (bytes_per_frame)); + format.append (le16 (bits_per_sample)); + + QByteArray payload {"WAVE", 4}; + payload.append ("fmt ", 4); + payload.append (le32 (static_cast (format.size ()))); + payload.append (format); + payload.append ("data", 4); + payload.append (le32 (static_cast (samples.size ()))); + payload.append (samples); + if (samples.size () & 1) + { + payload.append ('\0'); + } + + QByteArray result {"RIFF", 4}; + result.append (le32 (static_cast (payload.size ()))); + result.append (payload); + return result; +} + +QString write_temp_file (QByteArray const& contents) +{ + QTemporaryFile file; + file.setAutoRemove (false); + if (!file.open () || file.write (contents) != contents.size ()) + { + return {}; + } + auto const name = file.fileName (); + file.close (); + return name; +} + +QByteArray signed_samples (int count) +{ + QByteArray samples; + samples.reserve (count * 2); + for (int index = 0; index < count; ++index) + { + samples.append (le16 (static_cast (1000 + index % 100))); + } + return samples; +} +} + +class TestWavInputLoading : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void preserves_short_input_and_zero_fills_tail () + { + QByteArray samples; + samples.append (le16 (1234)); + samples.append (le16 (static_cast (-2345))); + samples.append (le16 (32767)); + auto const name = write_temp_file (wave_file (12000, 16, samples)); + QVERIFY (!name.isEmpty ()); + + auto const result = Radio::load_wav_input (name, 8); + QVERIFY (result.valid); + QCOMPARE (result.frames, 3); + QCOMPARE (result.samples.size (), std::size_t {8}); + QCOMPARE (result.samples[0], short {1234}); + QCOMPARE (result.samples[1], short {-2345}); + QCOMPARE (result.samples[2], short {32767}); + QVERIFY (std::all_of (result.samples.cbegin () + result.frames, + result.samples.cend (), [] (short sample) {return !sample;})); + QFile::remove (name); + } + + Q_SLOT void truncates_oversized_input_to_capacity () + { + int constexpr sample_limit = 13000; + auto const name = write_temp_file ( + wave_file (12000, 16, signed_samples (sample_limit + 1000))); + QVERIFY (!name.isEmpty ()); + + auto const result = Radio::load_wav_input (name, sample_limit); + QVERIFY (result.valid); + QCOMPARE (result.frames, sample_limit); + QCOMPARE (result.samples.size (), std::size_t {sample_limit}); + QCOMPARE (result.samples.back (), short {1000 + (sample_limit - 1) % 100}); + QFile::remove (name); + } + + Q_SLOT void resamples_legacy_input_data () + { + QTest::addColumn ("sampleSize"); + QTest::addColumn ("samples"); + + QTest::newRow ("unsigned-8-bit") << 8 << QByteArray (11025, static_cast (200)); + QTest::newRow ("signed-16-bit") << 16 << signed_samples (11025); + } + + Q_SLOT void resamples_legacy_input () + { + QFETCH (int, sampleSize); + QFETCH (QByteArray, samples); + int constexpr sample_limit = 13000; + auto const name = write_temp_file ( + wave_file (11025, static_cast (sampleSize), samples)); + QVERIFY (!name.isEmpty ()); + + auto const result = Radio::load_wav_input (name, sample_limit); + QVERIFY (result.valid); + QCOMPARE (result.frames, 12000); + QCOMPARE (result.samples.size (), std::size_t {sample_limit}); + QVERIFY (std::any_of (result.samples.cbegin (), result.samples.cbegin () + result.frames, + [] (short sample) {return sample != 0;})); + QVERIFY (std::all_of (result.samples.cbegin () + result.frames, result.samples.cend (), + [] (short sample) {return sample == 0;})); + QFile::remove (name); + } + + Q_SLOT void serializes_concurrent_legacy_resampling () + { + int constexpr input_frames = 60 * 11025; + int constexpr sample_limit = 60 * 12000; + auto const first_name = write_temp_file ( + wave_file (11025, 8, QByteArray (input_frames, static_cast (40)))); + auto const second_name = write_temp_file ( + wave_file (11025, 8, QByteArray (input_frames, static_cast (200)))); + QVERIFY (!first_name.isEmpty ()); + QVERIFY (!second_name.isEmpty ()); + + auto const expected_first = Radio::load_wav_input (first_name, sample_limit); + auto const expected_second = Radio::load_wav_input (second_name, sample_limit); + QVERIFY (expected_first.valid); + QVERIFY (expected_second.valid); + + QSemaphore ready; + QSemaphore start; + auto concurrent_load = [&] (QString name) { + return std::async (std::launch::async, [&, name] { + ready.release (); + start.acquire (); + return Radio::load_wav_input (name, sample_limit); + }); + }; + + auto first = concurrent_load (first_name); + auto second = concurrent_load (second_name); + ready.acquire (2); + start.release (2); + auto const actual_first = first.get (); + auto const actual_second = second.get (); + + QVERIFY (actual_first.valid); + QVERIFY (actual_second.valid); + QCOMPARE (actual_first.frames, expected_first.frames); + QCOMPARE (actual_second.frames, expected_second.frames); + QVERIFY (actual_first.samples == expected_first.samples); + QVERIFY (actual_second.samples == expected_second.samples); + QFile::remove (first_name); + QFile::remove (second_name); + } +}; + +QTEST_GUILESS_MAIN (TestWavInputLoading) + +#include "test_wav_input_loading.moc" diff --git a/tests/unit/audio/test_wav_load_coordinator.cpp b/tests/unit/audio/test_wav_load_coordinator.cpp new file mode 100644 index 00000000..a69c8c74 --- /dev/null +++ b/tests/unit/audio/test_wav_load_coordinator.cpp @@ -0,0 +1,117 @@ +#include + +#include + +#include +#include +#include +#include + +#include "Audio/WavLoadCoordinator.hpp" +#include "DecDataMutex.hpp" + +class TestWavLoadCoordinator : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void init () + { + set_dec_data_input_blocked (false); + } + + Q_SLOT void cleanup () + { + set_dec_data_input_blocked (false); + } + + Q_SLOT void delivers_single_flight_lifecycle_data () + { + QTest::addColumn ("valid"); + QTest::newRow ("valid-result") << true; + QTest::newRow ("invalid-result") << false; + } + + Q_SLOT void delivers_single_flight_lifecycle () + { + QFETCH (bool, valid); + + WavLoadCoordinator coordinator; + QSemaphore entered; + QSemaphore release; + std::atomic_bool rejected_work_ran {false}; + QStringList lifecycle; + int result_count {0}; + QThread * delivery_thread {nullptr}; + bool loading_during_result {false}; + bool gate_during_result {false}; + bool controls_enabled {true}; + bool gate_at_idle {true}; + bool loading_at_idle {true}; + + connect (&coordinator, &WavLoadCoordinator::loadingChanged, + this, [&] (bool loading) { + lifecycle.append (loading ? "loading" : "idle"); + controls_enabled = !loading; + if (!loading) + { + gate_at_idle = dec_data_input_blocked (); + loading_at_idle = coordinator.isLoading (); + } + }); + connect (&coordinator, &WavLoadCoordinator::resultReady, this, [&] { + lifecycle.append ("result"); + ++result_count; + delivery_thread = QThread::currentThread (); + loading_during_result = coordinator.isLoading (); + gate_during_result = dec_data_input_blocked (); + }); + + QVERIFY (coordinator.start ([&] { + entered.release (); + release.tryAcquire (1, 5000); + auto result = std::make_shared (); + result->valid = valid; + return result; + })); + QVERIFY2 (entered.tryAcquire (1, 5000), "load A did not enter its worker"); + QVERIFY (!coordinator.start ([&] { + rejected_work_ran.store (true, std::memory_order_release); + return std::make_shared (); + })); + + QCoreApplication::processEvents (QEventLoop::AllEvents, 100); + QCOMPARE (result_count, 0); + QVERIFY (!rejected_work_ran.load (std::memory_order_acquire)); + QVERIFY (coordinator.isLoading ()); + QVERIFY (dec_data_input_blocked ()); + QVERIFY (!controls_enabled); + + release.release (); + coordinator.waitForFinished (); + QTRY_VERIFY_WITH_TIMEOUT (!coordinator.isLoading (), 5000); + + QCOMPARE (lifecycle, QStringList ({"loading", "result", "idle"})); + QCOMPARE (result_count, 1); + QCOMPARE (delivery_thread, coordinator.thread ()); + QVERIFY (loading_during_result); + QVERIFY (gate_during_result); + QVERIFY (coordinator.result ()); + QCOMPARE (coordinator.result ()->valid, valid); + QVERIFY (controls_enabled); + QVERIFY (!gate_at_idle); + QVERIFY (!loading_at_idle); + QVERIFY (!dec_data_input_blocked ()); + + QVERIFY (coordinator.start ([] { + return std::make_shared (); + })); + coordinator.waitForFinished (); + QTRY_VERIFY_WITH_TIMEOUT (!coordinator.isLoading (), 5000); + QCOMPARE (result_count, 2); + } +}; + +QTEST_GUILESS_MAIN (TestWavLoadCoordinator) + +#include "test_wav_load_coordinator.moc" diff --git a/tests/unit/band_hopping/CMakeLists.txt b/tests/unit/band_hopping/CMakeLists.txt new file mode 100644 index 00000000..94d7485a --- /dev/null +++ b/tests/unit/band_hopping/CMakeLists.txt @@ -0,0 +1,6 @@ +add_executable (test_band_hopping + test_band_hopping.cpp + ${CMAKE_SOURCE_DIR}/widgets/BandHopping.cpp +) +target_link_libraries (test_band_hopping Qt5::Test) +add_test (NAME test_band_hopping COMMAND test_band_hopping) diff --git a/tests/unit/band_hopping/test_band_hopping.cpp b/tests/unit/band_hopping/test_band_hopping.cpp new file mode 100644 index 00000000..6555b149 --- /dev/null +++ b/tests/unit/band_hopping/test_band_hopping.cpp @@ -0,0 +1,52 @@ +#include + +#include "widgets/BandHopping.hpp" + +class TestBandHopping + : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void empty_selection_returns_no_hop () + { + QCOMPARE (next_band_hop_index ({false, false, false}, 0), -1); + } + + Q_SLOT void single_selection_returns_same_entry () + { + std::vector const selected {false, true, false}; + + QCOMPARE (next_band_hop_index (selected, 0), 1); + QCOMPARE (next_band_hop_index (selected, 1), 1); + QCOMPARE (next_band_hop_index (selected, 2), 1); + } + + Q_SLOT void multiple_selections_advance_from_start () + { + std::vector const selected {false, true, false, true}; + + QCOMPARE (next_band_hop_index (selected, 0), 1); + QCOMPARE (next_band_hop_index (selected, 2), 3); + } + + Q_SLOT void selection_wraps_after_end () + { + std::vector const selected {true, false, false, true}; + + QCOMPARE (next_band_hop_index (selected, 4), 0); + QCOMPARE (next_band_hop_index (selected, 5), 3); + } + + Q_SLOT void start_index_normalizes_safely () + { + std::vector const selected {false, false, true}; + + QCOMPARE (next_band_hop_index (selected, -1), 2); + QCOMPARE (next_band_hop_index (selected, 8), 2); + } +}; + +QTEST_MAIN (TestBandHopping); + +#include "test_band_hopping.moc" diff --git a/tests/unit/common/CMakeLists.txt b/tests/unit/common/CMakeLists.txt new file mode 100644 index 00000000..770aa0ec --- /dev/null +++ b/tests/unit/common/CMakeLists.txt @@ -0,0 +1,303 @@ +add_executable (test_qt_helpers + test_qt_helpers.cpp + ${CMAKE_SOURCE_DIR}/qt_helpers.cpp +) +target_include_directories (test_qt_helpers PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries (test_qt_helpers Qt5::Test Qt5::Network Qt5::Widgets) +add_test (NAME test_qt_helpers COMMAND test_qt_helpers) + +add_executable (test_callsign_validator + test_callsign_validator.cpp + ${CMAKE_SOURCE_DIR}/validators/CallsignValidator.cpp +) +target_link_libraries (test_callsign_validator Qt5::Test Qt5::Gui) +add_test (NAME test_callsign_validator COMMAND test_callsign_validator) + +add_executable (test_livecq_callsign + test_livecq_callsign.cpp +) +target_link_libraries (test_livecq_callsign wsjt_qt Qt5::Test) +add_test (NAME test_livecq_callsign COMMAND test_livecq_callsign) + +add_executable (test_decoded_message_fields test_decoded_message_fields.cpp) +target_link_libraries (test_decoded_message_fields wsjt_qt wsjt_fort_common Qt5::Test) +add_test (NAME test_decoded_message_fields COMMAND test_decoded_message_fields) + +add_executable (test_decoded_time + test_decoded_time.cpp + ${CMAKE_SOURCE_DIR}/Network/DecodedTime.cpp +) +target_link_libraries (test_decoded_time Qt5::Test) +add_test (NAME test_decoded_time COMMAND test_decoded_time) + +add_executable (test_displaytext + test_displaytext.cpp + ${CMAKE_SOURCE_DIR}/widgets/displaytext.cpp +) +target_link_libraries (test_displaytext wsjt_qt wsjt_fort_common Qt5::Test) +add_test (NAME test_displaytext COMMAND test_displaytext) + +add_executable (test_fox_operator_actions + test_fox_operator_actions.cpp +) +target_link_libraries (test_fox_operator_actions Qt5::Test) +add_test (NAME test_fox_operator_actions COMMAND test_fox_operator_actions) + +add_executable (test_wf_palette + test_wf_palette.cpp +) +target_link_libraries (test_wf_palette wsjt_qt Qt5::Test) +add_test (NAME test_wf_palette COMMAND test_wf_palette) + +add_executable (test_waterfall_scale + test_waterfall_scale.cpp +) +target_link_libraries (test_waterfall_scale Qt5::Test) +add_test (NAME test_waterfall_scale COMMAND test_waterfall_scale) + +add_executable (test_http_user_agent + test_http_user_agent.cpp + ) +target_link_libraries (test_http_user_agent wsjt_qt Qt5::Test) +add_test (NAME test_http_user_agent COMMAND test_http_user_agent) + +add_executable (test_fox_guard_bands + test_fox_guard_bands.cpp + ${CMAKE_SOURCE_DIR}/FoxGuardBands.cpp +) +target_link_libraries (test_fox_guard_bands Qt5::Test) +add_test (NAME test_fox_guard_bands COMMAND test_fox_guard_bands) + +add_executable (test_highlighting_rules + test_highlighting_rules.cpp + ${CMAKE_SOURCE_DIR}/HighlightingRules.cpp +) +target_link_libraries (test_highlighting_rules Qt5::Test) +add_test (NAME test_highlighting_rules COMMAND test_highlighting_rules) + +add_executable (test_tx_start_policy + test_tx_start_policy.cpp +) +target_link_libraries (test_tx_start_policy Qt5::Test) +add_test (NAME test_tx_start_policy COMMAND test_tx_start_policy) + +add_executable (test_beacon_tx_controller + test_beacon_tx_controller.cpp + ${CMAKE_SOURCE_DIR}/BeaconTxController.cpp +) +target_link_libraries (test_beacon_tx_controller Qt5::Test) +add_test (NAME test_beacon_tx_controller COMMAND test_beacon_tx_controller) + +add_executable (test_round_robin_selection + test_round_robin_selection.cpp + ${CMAKE_SOURCE_DIR}/widgets/RoundRobinSelection.cpp + ${CMAKE_SOURCE_DIR}/BeaconTxController.cpp +) +target_link_libraries (test_round_robin_selection Qt5::Test Qt5::Widgets) +add_test (NAME test_round_robin_selection COMMAND test_round_robin_selection) +set_tests_properties (test_round_robin_selection PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=offscreen") + +add_executable (test_rig_frequency_change_policy + test_rig_frequency_change_policy.cpp +) +target_link_libraries (test_rig_frequency_change_policy Qt5::Test) +add_test (NAME test_rig_frequency_change_policy COMMAND test_rig_frequency_change_policy) + +add_executable (test_wait_feature_policy + test_wait_feature_policy.cpp +) +target_link_libraries (test_wait_feature_policy Qt5::Test) +add_test (NAME test_wait_feature_policy COMMAND test_wait_feature_policy) + +add_executable (test_superfox_tx_planner + test_superfox_tx_planner.cpp + ${CMAKE_SOURCE_DIR}/SuperFoxTxPlanner.cpp +) +target_link_libraries (test_superfox_tx_planner Qt5::Test) +add_test (NAME test_superfox_tx_planner COMMAND test_superfox_tx_planner) + +add_executable (test_auto_respond_selection_latch + test_auto_respond_selection_latch.cpp + ${CMAKE_SOURCE_DIR}/AutoRespondSelectionLatch.cpp +) +target_link_libraries (test_auto_respond_selection_latch Qt5::Test) +add_test (NAME test_auto_respond_selection_latch COMMAND test_auto_respond_selection_latch) + +add_executable (test_auto_respond_scoring + test_auto_respond_scoring.cpp +) +target_link_libraries (test_auto_respond_scoring Qt5::Test) +add_test (NAME test_auto_respond_scoring COMMAND test_auto_respond_scoring) + +add_executable (test_auto_respond_period + test_auto_respond_period.cpp + ${CMAKE_SOURCE_DIR}/AutoRespondPeriod.cpp +) +target_link_libraries (test_auto_respond_period wsjt_qt wsjt_fort_common Qt5::Test) +add_test (NAME test_auto_respond_period COMMAND test_auto_respond_period) + +add_executable (test_emulate_split_transceiver + test_emulate_split_transceiver.cpp + ${CMAKE_SOURCE_DIR}/Transceiver/EmulateSplitTransceiver.cpp + ${CMAKE_SOURCE_DIR}/Transceiver/Transceiver.cpp + ${CMAKE_SOURCE_DIR}/qt_helpers.cpp +) +target_include_directories (test_emulate_split_transceiver PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries (test_emulate_split_transceiver Boost::log Qt5::Test Qt5::Network Qt5::Widgets) +add_test (NAME test_emulate_split_transceiver COMMAND test_emulate_split_transceiver) + +add_executable (test_tx_inhibit_transceiver + test_tx_inhibit_transceiver.cpp + ${CMAKE_SOURCE_DIR}/Transceiver/TxInhibitTransceiver.cpp + ${CMAKE_SOURCE_DIR}/Transceiver/TransceiverBase.cpp + ${CMAKE_SOURCE_DIR}/Transceiver/Transceiver.cpp + ${CMAKE_SOURCE_DIR}/qt_helpers.cpp +) +target_include_directories (test_tx_inhibit_transceiver PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries (test_tx_inhibit_transceiver Boost::log Qt5::Test Qt5::Network Qt5::Widgets) +add_test (NAME test_tx_inhibit_transceiver COMMAND test_tx_inhibit_transceiver) + +add_executable (test_hamlib_mode + test_hamlib_mode.cpp +) +target_link_libraries (test_hamlib_mode wsjt_qt Qt5::Test) +add_test (NAME test_hamlib_mode COMMAND test_hamlib_mode) + +add_executable (test_hamlib_vfo_role_state + test_hamlib_vfo_role_state.cpp +) +target_link_libraries (test_hamlib_vfo_role_state Hamlib::Hamlib Qt5::Test) +add_test (NAME test_hamlib_vfo_role_state COMMAND test_hamlib_vfo_role_state) + +add_executable (test_active_station_list + test_active_station_list.cpp + ${CMAKE_SOURCE_DIR}/ActiveStationList.cpp +) +target_link_libraries (test_active_station_list Qt5::Test) +add_test (NAME test_active_station_list COMMAND test_active_station_list) + +add_executable (test_frequency_editors + test_frequency_editors.cpp + ${CMAKE_SOURCE_DIR}/Logger.cpp +) +target_link_libraries (test_frequency_editors wsjt_qt Boost::log_setup Qt5::Test Qt5::Widgets) +add_test (NAME test_frequency_editors COMMAND test_frequency_editors) + +add_executable (test_decoded_message_reaction + test_decoded_message_reaction.cpp +) +target_link_libraries (test_decoded_message_reaction wsjt_qt wsjt_fort_common Qt5::Test) +add_test (NAME test_decoded_message_reaction COMMAND test_decoded_message_reaction) + +add_executable (test_decode_output_plan + test_decode_output_plan.cpp +) +target_link_libraries (test_decode_output_plan wsjt_qt wsjt_fort_common Qt5::Test) +add_test (NAME test_decode_output_plan COMMAND test_decode_output_plan) + +add_executable (test_auto_sequence_reaction + test_auto_sequence_reaction.cpp +) +target_link_libraries (test_auto_sequence_reaction wsjt_qt wsjt_fort_common Qt5::Test) +add_test (NAME test_auto_sequence_reaction COMMAND test_auto_sequence_reaction) + +add_executable (test_rr73_policy + test_rr73_policy.cpp + ${CMAKE_SOURCE_DIR}/Rr73Policy.cpp +) +target_link_libraries (test_rr73_policy Qt5::Test) +add_test (NAME test_rr73_policy COMMAND test_rr73_policy) + +add_executable (test_qso_reaction + test_qso_reaction.cpp +) +target_link_libraries (test_qso_reaction wsjt_qt wsjt_fort_common Qt5::Test) +add_test (NAME test_qso_reaction COMMAND test_qso_reaction) + +add_executable (test_hound_transmission_policy + test_hound_transmission_policy.cpp + ${CMAKE_SOURCE_DIR}/HoundTransmissionPolicy.cpp +) +target_link_libraries (test_hound_transmission_policy Qt5::Test) +add_test (NAME test_hound_transmission_policy COMMAND test_hound_transmission_policy) + +add_executable (test_qsy_message_parser + test_qsy_message_parser.cpp + ${CMAKE_SOURCE_DIR}/widgets/QSYMessageParser.cpp +) +target_link_libraries (test_qsy_message_parser Qt5::Test) +add_test (NAME test_qsy_message_parser COMMAND test_qsy_message_parser) + +add_executable (test_spec_op_label + test_spec_op_label.cpp + ${CMAKE_SOURCE_DIR}/widgets/SpecOpLabel.cpp +) +target_link_libraries (test_spec_op_label Qt5::Test) +add_test (NAME test_spec_op_label COMMAND test_spec_op_label) + +qt5_wrap_ui (test_active_stations_UIS ${CMAKE_SOURCE_DIR}/widgets/activeStations.ui) +add_executable (test_active_stations + test_active_stations.cpp + ${CMAKE_SOURCE_DIR}/widgets/activeStations.cpp + ${test_active_stations_UIS} +) +target_include_directories (test_active_stations PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +target_link_libraries (test_active_stations wsjt_qt Qt5::Test Qt5::Widgets) +add_test (NAME test_active_stations COMMAND test_active_stations) +set_tests_properties (test_active_stations PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=offscreen") + +if (WSJT_ENABLE_TSAN) + # These tests exercise Qt GUI classes but do not test the window-system + # integration. Offscreen QPA avoids Arch xcb/DBus startup reports while + # preserving the tests' widget and event-loop behavior. + set_tests_properties ( + test_qt_helpers + test_displaytext + test_wf_palette + test_emulate_split_transceiver + test_hamlib_mode + test_frequency_editors + test_decoded_message_reaction + test_decode_output_plan + test_auto_sequence_reaction + test_qso_reaction + PROPERTIES ENVIRONMENT "QT_QPA_PLATFORM=offscreen") +endif () +qt5_wrap_ui (test_configuration_dialog_layout_UIS + ${CMAKE_SOURCE_DIR}/Configuration.ui +) +add_executable (test_configuration_dialog_layout + test_configuration_dialog_layout.cpp + ${test_configuration_dialog_layout_UIS} +) +target_include_directories (test_configuration_dialog_layout PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +target_link_libraries (test_configuration_dialog_layout wsjt_qt Qt5::Test Qt5::Widgets) +add_test (NAME test_configuration_dialog_layout COMMAND test_configuration_dialog_layout) +add_test (NAME test_configuration_dialog_layout_fusion COMMAND test_configuration_dialog_layout) +set_tests_properties (test_configuration_dialog_layout_fusion PROPERTIES + ENVIRONMENT "QT_STYLE_OVERRIDE=Fusion" +) +add_test (NAME test_configuration_dialog_layout_scaled COMMAND test_configuration_dialog_layout) +set_tests_properties (test_configuration_dialog_layout_scaled PROPERTIES + ENVIRONMENT "QT_ENABLE_HIGHDPI_SCALING=1;QT_SCALE_FACTOR=1.5" +) + +add_executable (test_operating_frequency + test_operating_frequency.cpp + ${CMAKE_SOURCE_DIR}/OperatingFrequency.cpp +) +target_include_directories (test_operating_frequency PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries (test_operating_frequency Qt5::Test) +add_test (NAME test_operating_frequency COMMAND test_operating_frequency) + +add_executable (test_mainwindow_compact_controls + test_mainwindow_compact_controls.cpp + ${CMAKE_SOURCE_DIR}/widgets/TxDriveSlider.cpp +) +target_include_directories (test_mainwindow_compact_controls PRIVATE ${CMAKE_SOURCE_DIR}) +target_link_libraries (test_mainwindow_compact_controls Qt5::Test Qt5::Widgets) +add_test (NAME test_mainwindow_compact_controls COMMAND test_mainwindow_compact_controls) +add_test (NAME test_mainwindow_compact_controls_scaled COMMAND test_mainwindow_compact_controls) +set_tests_properties (test_mainwindow_compact_controls_scaled PROPERTIES + ENVIRONMENT "QT_ENABLE_HIGHDPI_SCALING=1;QT_SCALE_FACTOR=1.5" +) diff --git a/tests/unit/common/QsoReactionTestSupport.hpp b/tests/unit/common/QsoReactionTestSupport.hpp new file mode 100644 index 00000000..c344ed2a --- /dev/null +++ b/tests/unit/common/QsoReactionTestSupport.hpp @@ -0,0 +1,71 @@ +#ifndef QSOREACTIONTESTSUPPORT_HPP +#define QSOREACTIONTESTSUPPORT_HPP + +#include "DecodedMessageReaction.hpp" +#include "Decoder/decodedtext.h" + +namespace QsoReactionTestSupport +{ + using Effect = DecodedMessageReaction::QsoReactionEffect; + using Plan = DecodedMessageReaction::QsoReactionPlan; + using Snapshot = DecodedMessageReaction::QsoReactionSnapshot; + + inline DecodedText decode(QString const& payload, QString const& marker = "~", + QString const& time = "0605", int frequency = 1500) + { + return DecodedText { + QString {"%1 -10 0.3 %2 %3 %4"} + .arg(time).arg(frequency, 4, 10, QChar {'0'}).arg(marker).arg(payload)}; + } + + inline Snapshot neutralStationSnapshot() + { + Snapshot snapshot; + snapshot.myCall = "K1ABC"; + snapshot.baseCall = "K1ABC"; + snapshot.dxCall = "W1AW"; + snapshot.hisCall = "W1AW"; + snapshot.hisGrid = "FN31"; + snapshot.trPeriod = 15.0; + snapshot.nominalFrequency = 14074000; + snapshot.rxFrequency = 1500; + snapshot.txFrequency = 1500; + return snapshot; + } + + inline int effectIndex(Plan const& plan, Effect::Kind kind, int from = 0) + { + for (int i = from; i < plan.effects.size(); ++i) { + if (plan.effects[i].kind == kind) return i; + } + return -1; + } + + inline int effectCount(Plan const& plan, Effect::Kind kind) + { + int count = 0; + for (auto const& effect : plan.effects) { + if (effect.kind == kind) ++count; + } + return count; + } + + inline bool hasEffect(Plan const& plan, Effect::Kind kind) + { + return effectIndex(plan, kind) >= 0; + } + + inline int intEffect(Plan const& plan, Effect::Kind kind, int defaultValue = -1) + { + int const index = effectIndex(plan, kind); + return index >= 0 ? plan.effects[index].intValue : defaultValue; + } + + inline QString textEffect(Plan const& plan, Effect::Kind kind) + { + int const index = effectIndex(plan, kind); + return index >= 0 ? plan.effects[index].text : QString {}; + } +} + +#endif // QSOREACTIONTESTSUPPORT_HPP diff --git a/tests/unit/common/test_active_station_list.cpp b/tests/unit/common/test_active_station_list.cpp new file mode 100644 index 00000000..b07933fe --- /dev/null +++ b/tests/unit/common/test_active_station_list.cpp @@ -0,0 +1,67 @@ +#include + +#include "ActiveStationList.hpp" + +class TestActiveStationList : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void limitsAscendingRows(); + void limitsDescendingRows(); + void preservesEqualKeyOrder(); + void handlesEmptyAndZeroLimit(); +}; + +void TestActiveStationList::limitsAscendingRows() +{ + QVector rows; + for(int i=59; i>=0; --i) rows.append({float(i), QString::number(i)}); + + auto const limited=sorted_limited_active_station_items(rows, 50, false); + + QCOMPARE(limited.size(), 50); + QCOMPARE(limited.front().text, QString {"0"}); + QCOMPARE(limited.back().text, QString {"49"}); +} + +void TestActiveStationList::limitsDescendingRows() +{ + QVector rows; + for(int i=0; i<60; ++i) rows.append({float(i), QString::number(i)}); + + auto const limited=sorted_limited_active_station_items(rows, 50, true); + + QCOMPARE(limited.size(), 50); + QCOMPARE(limited.front().text, QString {"59"}); + QCOMPARE(limited.back().text, QString {"10"}); +} + +void TestActiveStationList::preservesEqualKeyOrder() +{ + QVector rows { + {2.0f, "first"}, + {1.0f, "low"}, + {2.0f, "second"}, + {2.0f, "third"} + }; + + auto const limited=sorted_limited_active_station_items(rows, 4, true); + + QCOMPARE(limited[0].text, QString {"first"}); + QCOMPARE(limited[1].text, QString {"second"}); + QCOMPARE(limited[2].text, QString {"third"}); + QCOMPARE(limited[3].text, QString {"low"}); +} + +void TestActiveStationList::handlesEmptyAndZeroLimit() +{ + QVERIFY(sorted_limited_active_station_items({}, 50, false).isEmpty()); + + QVector rows {{1.0f, "row"}}; + QVERIFY(sorted_limited_active_station_items(rows, 0, false).isEmpty()); +} + +QTEST_MAIN(TestActiveStationList) + +#include "test_active_station_list.moc" diff --git a/tests/unit/common/test_active_stations.cpp b/tests/unit/common/test_active_stations.cpp new file mode 100644 index 00000000..d53f58e0 --- /dev/null +++ b/tests/unit/common/test_active_stations.cpp @@ -0,0 +1,86 @@ +#include +#include +#include +#include +#include +#include + +#include "widgets/activeStations.h" + +class TestActiveStations : public QObject +{ + Q_OBJECT + +private slots: + void transitions(); + void clickRouting(); +}; + +void TestActiveStations::transitions() +{ + QTemporaryDir directory; + QVERIFY(directory.isValid()); + QSettings settings(directory.filePath("settings.ini"), QSettings::IniFormat); + ActiveStations widget(&settings, QFont{}); + using Mode = ActiveStations::DisplayMode; + auto const modes = {Mode::Standard, Mode::Q65, Mode::Q65Pileup, Mode::Fox}; + auto ready = widget.findChild("cbReadyOnly"); + auto wanted = widget.findChild("cbWantedOnly"); + auto label = widget.findChild("label"); + auto header = widget.findChild("header_label2"); + QVERIFY(ready && wanted && label && header); + + for (auto previous : modes) { + for (auto mode : modes) { + widget.setupUi(previous); + widget.setupUi(mode); + bool const fox = mode == Mode::Fox; + bool const pileup = mode == Mode::Q65Pileup; + QCOMPARE(ready->isHidden(), fox || pileup); + QCOMPARE(wanted->isHidden(), pileup); + QCOMPARE(wanted->text(), fox ? QString("My call only") : QString("# Wanted only")); + QCOMPARE(label->isHidden(), fox || pileup); + QCOMPARE(label->text(), mode == Mode::Q65 ? QString("QSOs:") : QString("Rate:")); + QCOMPARE(widget.findChild("score")->isHidden(), mode != Mode::Standard); + QCOMPARE(widget.findChild("sbMaxAge")->isHidden(), fox || pileup); + QCOMPARE(header->text().contains("Fsked"), mode == Mode::Q65); + QCOMPARE(header->text().contains("Age(h)"), pileup); + QCOMPARE(header->text().contains("Message"), fox); + } + } +} + +void TestActiveStations::clickRouting() +{ + QTemporaryDir directory; + QVERIFY(directory.isValid()); + QSettings settings(directory.filePath("settings.ini"), QSettings::IniFormat); + ActiveStations widget(&settings, QFont{}); + QSignalSpy station(&widget, SIGNAL(callSandP(int))); + QSignalSpy hound(&widget, SIGNAL(queueActiveWindowHound(QString))); + QVERIFY(station.isValid()); + QVERIFY(hound.isValid()); + auto editor = widget.findChild("RecentStationsPlainTextEdit"); + QVERIFY(editor); + using Mode = ActiveStations::DisplayMode; + for (auto mode : {Mode::Fox, Mode::Q65, Mode::Q65Pileup, Mode::Standard}) { + widget.displayRecentStations(mode, " 2. K1ABC FN42\n"); + widget.findChild("header_label2")->setText("Translated heading"); + widget.findChild("cbWantedOnly")->setText("Translated filter"); + widget.setClickOK(false); + editor->moveCursor(QTextCursor::Start); + station.clear(); + hound.clear(); + QVERIFY(QMetaObject::invokeMethod(&widget, "on_textEdit_clicked", Qt::DirectConnection)); + QCOMPARE(station.count() + hound.count(), 0); + widget.setClickOK(true); + QVERIFY(QMetaObject::invokeMethod(&widget, "on_textEdit_clicked", Qt::DirectConnection)); + QCOMPARE(hound.count(), mode == Mode::Fox ? 1 : 0); + QCOMPARE(station.count(), mode == Mode::Fox ? 0 : 1); + if (mode == Mode::Fox) QCOMPARE(hound.at(0).at(0).toString(), QString(" 2. K1ABC FN42")); + else QCOMPARE(station.at(0).at(0).toInt(), 2); + } +} + +QTEST_MAIN(TestActiveStations) +#include "test_active_stations.moc" diff --git a/tests/unit/common/test_auto_respond_period.cpp b/tests/unit/common/test_auto_respond_period.cpp new file mode 100644 index 00000000..3f1f7623 --- /dev/null +++ b/tests/unit/common/test_auto_respond_period.cpp @@ -0,0 +1,217 @@ +#include + +#include "AutoRespondPeriod.hpp" +#include "Decoder/decodedtext.h" + +namespace +{ + QDateTime utc(QString const& text) + { + auto value = QDateTime::fromString(text, Qt::ISODateWithMs); + value.setTimeSpec(Qt::UTC); + return value; + } + + AutoRespondPeriodState armedState(QDateTime const& period, + AutoRespondPolicy policy = AutoRespondPolicy::First) + { + AutoRespondPeriodState state; + state.setEnableTx(true); + state.observePeriod(period, true, true, policy); + return state; + } +} + +class TestAutoRespondPeriod final : public QObject +{ + Q_OBJECT + +private slots: + void enableTxAtReceiveBoundaryArmsPeriod() + { + auto const period = utc("2026-08-03T12:00:15.000Z"); + AutoRespondPeriodState state; + state.setEnableTx(true); + + QVERIFY(state.observePeriod(period, true, true, AutoRespondPolicy::First)); + QVERIFY(state.accepts(period)); + } + + void armedPeriodAcceptsOnlyItsDecodeSequence() + { + auto const period = utc("2026-08-03T12:00:15.000Z"); + auto state = armedState(period); + + QVERIFY(state.accepts(period)); + QVERIFY(!state.accepts(period.addSecs(-15))); + QVERIFY(!state.accepts(period.addSecs(15))); + } + + void enableDuringReceivePeriodArmsItProspectively() + { + auto const period = utc("2026-08-03T12:00:15.000Z"); + AutoRespondPeriodState state; + QVERIFY(!state.observePeriod(period, true, true, AutoRespondPolicy::First)); + QVERIFY(!state.claimFirst(period)); + + state.setEnableTx(true); + + QVERIFY(state.armCurrentReceivePeriod(true, AutoRespondPolicy::First)); + QVERIFY(state.claimFirst(period)); + } + + void disableAndReenableWithinReceivePeriodCanRearmIt() + { + auto const period = utc("2026-08-03T12:00:15.000Z"); + auto state = armedState(period); + + state.setEnableTx(false); + QVERIFY(!state.accepts(period)); + state.setEnableTx(true); + + QVERIFY(state.armCurrentReceivePeriod(true, AutoRespondPolicy::First)); + QVERIFY(state.accepts(period)); + } + + void enableDuringTransmitArmsNextReceivePeriodOnly() + { + auto const period = utc("2026-08-03T12:00:15.000Z"); + AutoRespondPeriodState state; + state.observePeriod(period, true, true, AutoRespondPolicy::First); + + auto const transmitPeriod = period.addSecs(15); + state.observePeriod(transmitPeriod, false, true, AutoRespondPolicy::First); + state.setEnableTx(true); + QVERIFY(!state.armCurrentReceivePeriod(true, AutoRespondPolicy::First)); + QVERIFY(!state.accepts(period)); + + auto const nextReceivePeriod = period.addSecs(30); + + QVERIFY(state.observePeriod(nextReceivePeriod, true, true, AutoRespondPolicy::First)); + QVERIFY(state.accepts(nextReceivePeriod)); + } + + void transmitPeriodKeepsDecodeWindowOpenUntilActualTransmit() + { + auto const receivePeriod = utc("2026-08-03T12:00:15.000Z"); + auto state = armedState(receivePeriod); + + state.observePeriod(receivePeriod.addSecs(15), false, true, AutoRespondPolicy::First); + QVERIFY(state.accepts(receivePeriod)); + + state.close(); + QVERIFY(!state.accepts(receivePeriod)); + } + + void firstPolicyClaimsOnlyOneCallerPerPeriod() + { + auto const period = utc("2026-08-03T12:00:15.000Z"); + auto state = armedState(period); + + QVERIFY(state.claimFirst(period)); + QVERIFY(!state.claimFirst(period)); + + auto const nextPeriod = period.addSecs(30); + state.observePeriod(period.addSecs(15), false, true, AutoRespondPolicy::First); + state.observePeriod(nextPeriod, true, true, AutoRespondPolicy::First); + QVERIFY(state.claimFirst(nextPeriod)); + } + + void repeatedEnableDoesNotResetFirstCallerClaim() + { + auto const period = utc("2026-08-03T12:00:15.000Z"); + auto state = armedState(period); + + QVERIFY(state.claimFirst(period)); + QVERIFY(!state.setEnableTx(true)); + QVERIFY(!state.armCurrentReceivePeriod(true, AutoRespondPolicy::First)); + QVERIFY(!state.claimFirst(period)); + } + + void responsePolicyIsSnapshottedForThePeriod() + { + auto const period = utc("2026-08-03T12:00:07.500Z"); + auto state = armedState(period, AutoRespondPolicy::MaxSignal); + + QCOMPARE(state.policy(), AutoRespondPolicy::MaxSignal); + state.observePeriod(period, true, true, AutoRespondPolicy::MinSignal); + QCOMPARE(state.policy(), AutoRespondPolicy::MaxSignal); + } + + void cqIntentAndActivePolicyAreRequired() + { + auto const period = utc("2026-08-03T12:00:15.000Z"); + AutoRespondPeriodState state; + state.setEnableTx(true); + + QVERIFY(!state.observePeriod(period, true, false, AutoRespondPolicy::First)); + state.observePeriod(period.addSecs(15), false, true, AutoRespondPolicy::First); + QVERIFY(!state.observePeriod(period.addSecs(30), true, true, AutoRespondPolicy::None)); + } + + void currentPeriodArmingRequiresCqIntentAndActivePolicy() + { + auto const period = utc("2026-08-03T12:00:15.000Z"); + AutoRespondPeriodState state; + state.observePeriod(period, true, true, AutoRespondPolicy::First); + state.setEnableTx(true); + + QVERIFY(!state.armCurrentReceivePeriod(false, AutoRespondPolicy::First)); + QVERIFY(!state.armCurrentReceivePeriod(true, AutoRespondPolicy::None)); + QVERIFY(state.armCurrentReceivePeriod(true, AutoRespondPolicy::MaxSignal)); + QCOMPARE(state.policy(), AutoRespondPolicy::MaxSignal); + } + + void directOpeningMessagesAreEligible_data() + { + QTest::addColumn("payload"); + + QTest::newRow("grid") << "K1ABC W1AW FN31"; + QTest::newRow("report") << "K1ABC W1AW -10"; + QTest::newRow("positive-report") << "K1ABC W1AW +03"; + } + + void directOpeningMessagesAreEligible() + { + QFETCH(QString, payload); + DecodedText message {"0605 -10 0.3 1500 ~ " + payload}; + + QVERIFY(message.isStandardMessage()); + QVERIFY(isDirectAutoRespondCandidate(message, "K1ABC")); + } + + void compoundConfiguredCallRequiresExactRecipient() + { + DecodedText exactCall {"0605 -10 0.3 1500 ~ K1ABC/P W1AW FN31"}; + DecodedText sharedBase {"0605 -10 0.3 1500 ~ K1ABC W1AW FN31"}; + + QVERIFY(exactCall.isStandardMessage()); + QVERIFY(sharedBase.isStandardMessage()); + QVERIFY(isDirectAutoRespondCandidate(exactCall, "K1ABC/P")); + QVERIFY(!isDirectAutoRespondCandidate(sharedBase, "K1ABC/P")); + } + + void nonOpeningMessagesAreRejected_data() + { + QTest::addColumn("payload"); + + QTest::newRow("generic-cq") << "CQ W1AW FN31"; + QTest::newRow("another-recipient") << "K9XYZ W1AW FN31"; + QTest::newRow("self") << "K1ABC K1ABC FN31"; + QTest::newRow("roger-report") << "K1ABC W1AW R-10"; + QTest::newRow("rrr") << "K1ABC W1AW RRR"; + QTest::newRow("rr73") << "K1ABC W1AW RR73"; + QTest::newRow("73") << "K1ABC W1AW 73"; + } + + void nonOpeningMessagesAreRejected() + { + QFETCH(QString, payload); + DecodedText message {"0605 -10 0.3 1500 ~ " + payload}; + + QVERIFY(!isDirectAutoRespondCandidate(message, "K1ABC")); + } +}; + +QTEST_MAIN(TestAutoRespondPeriod) +#include "test_auto_respond_period.moc" diff --git a/tests/unit/common/test_auto_respond_scoring.cpp b/tests/unit/common/test_auto_respond_scoring.cpp new file mode 100644 index 00000000..a8bf5db8 --- /dev/null +++ b/tests/unit/common/test_auto_respond_scoring.cpp @@ -0,0 +1,65 @@ +#include + +#include "AutoRespondScoring.hpp" + +class TestAutoRespondScoring final : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void firstDecodedSignalCandidateAlwaysWins() + { + AutoRespondScores scores; + + QVERIFY(scores.considerMaximumDb(-40)); + QVERIFY(scores.considerMinimumDb(40)); + } + + Q_SLOT void maximumDbKeepsStrongestCandidate() + { + AutoRespondScores scores; + + QVERIFY(scores.considerMaximumDb(-20)); + QVERIFY(scores.considerMaximumDb(-10)); + QVERIFY(!scores.considerMaximumDb(-10)); + QVERIFY(!scores.considerMaximumDb(-30)); + } + + Q_SLOT void minimumDbKeepsWeakestCandidate() + { + AutoRespondScores scores; + + QVERIFY(scores.considerMinimumDb(-10)); + QVERIFY(scores.considerMinimumDb(-20)); + QVERIFY(!scores.considerMinimumDb(-20)); + QVERIFY(!scores.considerMinimumDb(-5)); + } + + Q_SLOT void firstDistanceCandidateAlwaysWins() + { + AutoRespondScores scores; + + QVERIFY(scores.considerDistance(0)); + QVERIFY(!scores.considerDistance(0)); + QVERIFY(scores.considerDistance(1)); + QVERIFY(scores.considerDistance(100)); + QVERIFY(!scores.considerDistance(100)); + } + + Q_SLOT void resetAllowsNewCandidates() + { + AutoRespondScores scores; + QVERIFY(scores.considerDistance(100)); + QVERIFY(scores.considerMaximumDb(10)); + QVERIFY(scores.considerMinimumDb(-40)); + + scores.reset(); + + QVERIFY(scores.considerDistance(0)); + QVERIFY(scores.considerMaximumDb(-40)); + QVERIFY(scores.considerMinimumDb(40)); + } +}; + +QTEST_MAIN(TestAutoRespondScoring) +#include "test_auto_respond_scoring.moc" diff --git a/tests/unit/common/test_auto_respond_selection_latch.cpp b/tests/unit/common/test_auto_respond_selection_latch.cpp new file mode 100644 index 00000000..d81910e9 --- /dev/null +++ b/tests/unit/common/test_auto_respond_selection_latch.cpp @@ -0,0 +1,36 @@ +#include + +#include "AutoRespondSelectionLatch.hpp" + +class TestAutoRespondSelectionLatch : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void selectForClearsAfterDelay() + { + AutoRespondSelectionLatch latch; + + latch.selectFor(10); + + QVERIFY(latch.isSelected()); + QTRY_VERIFY_WITH_TIMEOUT(!latch.isSelected(), 250); + } + + Q_SLOT void selectForRestartsResetDelay() + { + AutoRespondSelectionLatch latch; + + latch.selectFor(30); + QTest::qWait(10); + latch.selectFor(100); + + QVERIFY(latch.isSelected()); + QTest::qWait(50); + QVERIFY(latch.isSelected()); + QTRY_VERIFY_WITH_TIMEOUT(!latch.isSelected(), 250); + } +}; + +QTEST_MAIN(TestAutoRespondSelectionLatch) +#include "test_auto_respond_selection_latch.moc" diff --git a/tests/unit/common/test_auto_sequence_reaction.cpp b/tests/unit/common/test_auto_sequence_reaction.cpp new file mode 100644 index 00000000..2964c1f7 --- /dev/null +++ b/tests/unit/common/test_auto_sequence_reaction.cpp @@ -0,0 +1,203 @@ +#include + +#include "QsoReactionTestSupport.hpp" + +namespace +{ + using namespace QsoReactionTestSupport; + + Snapshot baseSnapshot() + { + auto snapshot = neutralStationSnapshot(); + snapshot.mode = "FT8"; + snapshot.autoEnabled = true; + snapshot.autoSequenceEnabled = true; + snapshot.tx1Enabled = true; + snapshot.qsoProgress = QsoProgress::Calling; + return snapshot; + } +} + +class TestAutoSequenceReaction final + : public QObject +{ + Q_OBJECT + +private slots: + void stopsToAvoidQrmWhenPartnerRepliesNearOurTxFrequencyToAnotherCaller() + { + auto snapshot = baseSnapshot(); + snapshot.qsoProgress = QsoProgress::Replying; + snapshot.txFrequency = 815; + DecodedText message {"0605 -10 0.3 0815 ~ K9XYZ W1AW -10"}; + + auto const plan = DecodedMessageReaction::planAutoSequence( + message, snapshot, DecodedMessageReaction::AutoSequencePhase::StandardDecode, 25, 50); + + QCOMPARE(plan.disposition, DecodedMessageReaction::ReactionDisposition::Reacted); + QVERIFY(hasEffect(plan, Effect::Kind::ClickStopTx)); + } + + void processesDirectedReplyToOurCall() + { + auto snapshot = baseSnapshot(); + DecodedText message {"0605 -10 0.3 1500 ~ K1ABC W1AW -10"}; + + auto const plan = DecodedMessageReaction::planAutoSequence( + message, snapshot, DecodedMessageReaction::AutoSequencePhase::StandardDecode, 25, 50); + + QVERIFY(hasEffect(plan, Effect::Kind::ProcessSyntheticMessageNow)); + } + + void standard73DoesNotTreatEmptyDxCallAsMatch_data() + { + QTest::addColumn("dxCall"); + QTest::addColumn("advances"); + + QTest::newRow("selected-partner") << "W1AW" << true; + QTest::newRow("empty-partner") << "" << false; + } + + void standard73DoesNotTreatEmptyDxCallAsMatch() + { + QFETCH(QString, dxCall); + QFETCH(bool, advances); + auto snapshot = baseSnapshot(); + snapshot.dxCall = dxCall; + snapshot.hisCall = dxCall; + snapshot.qsoProgress = QsoProgress::RogerReport; + DecodedText message {"0605 -10 0.3 1500 ~ K9XYZ W1AW 73"}; + QVERIFY(message.isStandardMessage()); + + auto const plan = DecodedMessageReaction::planAutoSequence( + message, snapshot, DecodedMessageReaction::AutoSequencePhase::StandardDecode, 25, 50); + + QCOMPARE(hasEffect(plan, Effect::Kind::ProcessSyntheticMessageNow), advances); + } + + void processesTypeTwoDeReplyWithinTolerance() + { + auto snapshot = baseSnapshot(); + snapshot.callingCq = true; + snapshot.autoReply = true; + DecodedText message {"0605 -10 0.3 1500 ~ DE W1AW -10"}; + + auto const plan = DecodedMessageReaction::planAutoSequence( + message, snapshot, DecodedMessageReaction::AutoSequencePhase::StandardDecode, 25, 50); + + QVERIFY(hasEffect(plan, Effect::Kind::ProcessSyntheticMessageNow)); + } + + void ignoresProcessActionInFoxMode() + { + auto snapshot = baseSnapshot(); + snapshot.specOp = SpecialOperatingActivity::FOX; + DecodedText message {"0605 -10 0.3 1500 ~ K1ABC W1AW -10"}; + + auto const plan = DecodedMessageReaction::planAutoSequence( + message, snapshot, DecodedMessageReaction::AutoSequencePhase::StandardDecode, 25, 50); + + QCOMPARE(plan.disposition, DecodedMessageReaction::ReactionDisposition::NoReaction); + } + + void freeText73DoesNotAdvanceMsk144AutoSequence() + { + auto snapshot = baseSnapshot(); + snapshot.mode = "MSK144"; + snapshot.qsoProgress = QsoProgress::RogerReport; + DecodedText message {"060522 -10 0.3 1500 & RR73"}; + + auto const plan = DecodedMessageReaction::planAutoSequence( + message, snapshot, DecodedMessageReaction::AutoSequencePhase::StandardDecode, 25, 50); + + QCOMPARE(plan.disposition, DecodedMessageReaction::ReactionDisposition::NoReaction); + } + + void storesEuVhfExchangeForAutoSequenceCandidate() + { + auto snapshot = baseSnapshot(); + snapshot.mode = "MSK144"; + DecodedText message {"060522 -10 0.3 1500 & W1AW 520001 FN31 W1AW R X"}; + + auto const plan = DecodedMessageReaction::planAutoSequence( + message, snapshot, DecodedMessageReaction::AutoSequencePhase::StandardDecode, 25, 50); + + QCOMPARE(textEffect(plan, Effect::Kind::SetReceivedExchange), + message.clean_string().trimmed().right(13)); + } + + void ignoresEuVhfExchangeForRejectedDecode() + { + auto snapshot = baseSnapshot(); + DecodedText message {"0605 -10 0.3 1500 ~ RANDOM 520001 FN31"}; + + auto const plan = DecodedMessageReaction::planAutoSequence( + message, snapshot, DecodedMessageReaction::AutoSequencePhase::StandardDecode, 25, 50); + + QVERIFY(textEffect(plan, Effect::Kind::SetReceivedExchange).isEmpty()); + } + + void legacyShortMessages_data() + { + QTest::addColumn("payload"); + QTest::addColumn("expectedTxMessage"); + + QTest::newRow("ooo") << "K1ABC W1AW OOO" << 3; + QTest::newRow("ro") << "RO" << 4; + QTest::newRow("rrr") << "RRR" << 5; + QTest::newRow("73") << "73" << 5; + } + + void legacyShortMessages() + { + QFETCH(QString, payload); + QFETCH(int, expectedTxMessage); + auto snapshot = neutralStationSnapshot(); + + auto const plan = DecodedMessageReaction::planAutoSequence( + decode(payload, "#"), snapshot, + DecodedMessageReaction::AutoSequencePhase::LegacyShortMessage, 15, 15); + + QCOMPARE(plan.disposition, DecodedMessageReaction::ReactionDisposition::Reacted); + QCOMPARE(intEffect(plan, Effect::Kind::SetTxMessage), expectedTxMessage); + } + + void legacyShortMessageTolerance_data() + { + QTest::addColumn("frequency"); + QTest::addColumn("reacts"); + + QTest::newRow("minus-sixteen") << 1484 << false; + QTest::newRow("minus-fifteen") << 1485 << true; + QTest::newRow("plus-fifteen") << 1515 << true; + QTest::newRow("plus-sixteen") << 1516 << false; + } + + void legacyShortMessageTolerance() + { + QFETCH(int, frequency); + QFETCH(bool, reacts); + auto snapshot = neutralStationSnapshot(); + + auto const plan = DecodedMessageReaction::planAutoSequence( + decode("RRR", "#", "0605", frequency), snapshot, + DecodedMessageReaction::AutoSequencePhase::LegacyShortMessage, 15, 15); + + QCOMPARE(plan.disposition == DecodedMessageReaction::ReactionDisposition::Reacted, reacts); + } + + void legacyShortMessageHonorsStartToleranceArgument() + { + auto snapshot = neutralStationSnapshot(); + + auto const plan = DecodedMessageReaction::planAutoSequence( + decode("RRR", "#", "0605", 1516), snapshot, + DecodedMessageReaction::AutoSequencePhase::LegacyShortMessage, 16, 15); + + QCOMPARE(plan.disposition, DecodedMessageReaction::ReactionDisposition::Reacted); + QCOMPARE(intEffect(plan, Effect::Kind::SetTxMessage), 5); + } +}; + +QTEST_MAIN(TestAutoSequenceReaction) +#include "test_auto_sequence_reaction.moc" diff --git a/tests/unit/common/test_beacon_tx_controller.cpp b/tests/unit/common/test_beacon_tx_controller.cpp new file mode 100644 index 00000000..ba0cd7c7 --- /dev/null +++ b/tests/unit/common/test_beacon_tx_controller.cpp @@ -0,0 +1,586 @@ +#include + +#include "BeaconTxController.hpp" + +using namespace BeaconTx; + +namespace +{ + int count (Controller::Actions const& actions, ActionKind kind) + { + int result = 0; + for (auto const& action : actions) if (action.kind == kind) ++result; + return result; + } + + Action const * first (Controller::Actions const& actions, ActionKind kind) + { + for (auto const& action : actions) if (action.kind == kind) return &action; + return nullptr; + } + + ScheduleProposal proposal (Disposition disposition) + { + ScheduleProposal result; + result.disposition = disposition; + return result; + } + + ScheduleProposal hoppingProposal (Disposition disposition, bool tune = false) + { + auto result = proposal (disposition); + result.source = PlanSource::BandHop; + result.hasHoppingProposal = true; + result.hopping.frequenciesIndex = 3; + result.hopping.tuneRequired = tune; + return result; + } + + struct Harness + { + Controller controller; + + void initialize (RoundRobinPolicy policy = RoundRobinPolicy::random ()) + { + controller.enterMode (1000, policy); + controller.setAutoEnabled (true); + auto const actions = controller.observeUtc (100); + QCOMPARE (count (actions, ActionKind::SetTransmitWindow), 1); + QVERIFY (!actions.front ().enabled); + } + + PlanId prepare (Disposition disposition = Disposition::Transmit) + { + auto const actions = controller.receiveCompleted (); + auto const request = first (actions, ActionKind::RequestScheduleProposal); + if (!request) return {}; + auto const id = request->planId; + controller.proposalDelivered (id, proposal (disposition)); + return id; + } + + PlanId enterPreparedTransmit () + { + auto const id = prepare (); + controller.observeUtc (1100); + return id; + } + }; + + struct ActionRecorder + { + std::vector actions; + + void record (Controller::Actions const& newActions) + { + actions.insert (actions.end (), newActions.begin (), newActions.end ()); + } + + int countFor (PlanId id, ActionKind kind) const + { + int result = 0; + for (auto const& action : actions) + { + if (action.planId == id && action.kind == kind) ++result; + } + return result; + } + }; + +} + +class TestBeaconTxController final : public QObject +{ + Q_OBJECT + +private slots: + void roundRobinPolicyCodec (); + void delayedAdjacentPeriodAndDuplicateObservation (); + void resyncReceivesPartialSlotAndPreparesAtCompletion (); + void receiveCompletionPreparesOnce (); + void successfulTxLifecycleRecordsAndPreparesOnce (); + void failedTxStartRecordsNothingAndRecovers (); + void modeExitDuringPttTailDoesNotPrepare (); + void manualTuneAcrossBoundaryRestoresAutoAndPrepares (); + void automaticTuneCompletesExistingPlanWithoutRedraw (); + void staleAutomaticTuneEventsAreIgnored (); + void expiredAutomaticTunePreparesOnceAfterTail (); + void txNextSurvivesTuneAndResync (); + void txNextClearsOnlyWhenMessageStarts (); + void txNextCancellationReusesUnderlyingPlan (); + void suppressedTxNextCancellationDoesNotDraw (); + void fixedRoundRobinUsesUtcBoundaryWithoutProposal (); + void txNextPrecedesFixedRoundRobin (); + void policyChangeDuringTxDrawsOnceAtCompletion (); + void bandChangeFailureConvertsSamePlanToReceive (); + void staleAndDuplicateBandOutcomesAreIgnored (); + void proposalRequestDoesNotActuate (); + void startedSessionCrossesBoundaryAndPreparesOnStop (); + void oldStopCannotPrepareReenteredEpoch (); + void txNextWithdrawalAfterBoundaryUsesUnderlyingReceive (); + void txNextWithdrawalDuringStartWaitsForStop (); + void acceptedStartIgnoresConflictingDuplicateResult (); + void acceptedStartWithoutMessageRecordsNothingAndRecovers (); + void earlyTxStopClosesWindowAndPrepares (); + void autoDisabledForcesReceiveWithoutRedraw (); + void backwardClockStepResynchronizesToReceive (); + void oneProposalRequestAndApplicationPerPlanId (); +}; + +void TestBeaconTxController::roundRobinPolicyCodec () +{ + auto policy = parseRoundRobinPolicy ("2/4"); + QCOMPARE (policy.kind, RoundRobinPolicy::Kind::Fixed); + QCOMPARE (policy.selectedSlot, 1); + QCOMPARE (policy.slotCount, 4); + QVERIFY (formatRoundRobinPolicy (policy) == "2/4"); + + policy = parseRoundRobinPolicy ("7/12"); + QCOMPARE (policy.kind, RoundRobinPolicy::Kind::Fixed); + QCOMPARE (policy.selectedSlot, 6); + QCOMPARE (policy.slotCount, 12); + + QVERIFY (formatRoundRobinPolicy (parseRoundRobinPolicy (" +2 / 4 \t")) == "2/4"); + for (auto const& text : {"random", "Random", "randomized", "0/4", "5/4", "2/4x", + "2/4/6", "2/", "/4", "2/99999999999999999999", "-1/4"}) + { + QCOMPARE (parseRoundRobinPolicy (text).kind, RoundRobinPolicy::Kind::Random); + } + QVERIFY (formatRoundRobinPolicy (RoundRobinPolicy::random ()) == "random"); +} + +void TestBeaconTxController::delayedAdjacentPeriodAndDuplicateObservation () +{ + Harness h; + h.initialize (); + auto const request = h.controller.receiveCompleted (); + auto const id = first (request, ActionKind::RequestScheduleProposal)->planId; + + auto const boundary = h.controller.observeUtc (1101); + QVERIFY (!boundary.front ().enabled); + QVERIFY (h.controller.proposalDelivered (id, proposal (Disposition::Transmit)).empty ()); + QVERIFY (h.controller.observeUtc (1199).empty ()); +} + +void TestBeaconTxController::resyncReceivesPartialSlotAndPreparesAtCompletion () +{ + Harness h; + h.initialize (); + h.prepare (); + + auto const resync = h.controller.observeUtc (3100); + QCOMPARE (count (resync, ActionKind::SetTransmitWindow), 1); + QVERIFY (!resync.front ().enabled); + auto const completion = h.controller.receiveCompleted (); + QCOMPARE (count (completion, ActionKind::RequestScheduleProposal), 1); + QVERIFY (h.controller.receiveCompleted ().empty ()); +} + +void TestBeaconTxController::receiveCompletionPreparesOnce () +{ + Harness h; + h.initialize (); + QCOMPARE (count (h.controller.receiveCompleted (), ActionKind::RequestScheduleProposal), 1); + QVERIFY (h.controller.receiveCompleted ().empty ()); +} + +void TestBeaconTxController::successfulTxLifecycleRecordsAndPreparesOnce () +{ + Harness h; + h.initialize (); + auto const id = h.enterPreparedTransmit (); + h.controller.txStartRequested (); + QVERIFY (h.controller.txStartResult (id, true).empty ()); + auto const started = h.controller.messageStarted (id); + QCOMPARE (count (started, ActionKind::RecordBeaconTransmission), 1); + + h.controller.transmitWindowEnded (); + auto const stopped = h.controller.txStopped (id); + QCOMPARE (count (stopped, ActionKind::RequestScheduleProposal), 1); + QVERIFY (h.controller.txStopped (id).empty ()); +} + +void TestBeaconTxController::failedTxStartRecordsNothingAndRecovers () +{ + Harness h; + h.initialize (); + auto const id = h.enterPreparedTransmit (); + h.controller.txStartRequested (); + auto const failed = h.controller.txStartResult (id, false); + QCOMPARE (count (failed, ActionKind::RecordBeaconTransmission), 0); + QCOMPARE (count (failed, ActionKind::RequestScheduleProposal), 0); + QVERIFY (h.controller.txStartResult (id, false).empty ()); + QCOMPARE (count (h.controller.txStopped (id), ActionKind::RequestScheduleProposal), 1); +} + +void TestBeaconTxController::modeExitDuringPttTailDoesNotPrepare () +{ + Harness h; + h.initialize (); + auto const id = h.enterPreparedTransmit (); + h.controller.txStartRequested (); + h.controller.txStartResult (id, true); + QCOMPARE (count (h.controller.messageStarted (id), ActionKind::RecordBeaconTransmission), 1); + h.controller.transmitWindowEnded (); + h.controller.exitMode (); + QCOMPARE (count (h.controller.txStopped (id), ActionKind::RequestScheduleProposal), 0); + QCOMPARE (h.controller.txLifecycle (), TxLifecycle::None); +} + +void TestBeaconTxController::manualTuneAcrossBoundaryRestoresAutoAndPrepares () +{ + Harness h; + h.initialize (); + h.controller.tuneStarted (TuneKind::Manual); + auto const boundary = h.controller.observeUtc (1100); + QVERIFY (!boundary.front ().enabled); + QVERIFY (h.controller.receiveCompleted ().empty ()); + + auto const completed = h.controller.tuneCompleted (h.controller.tunePlanId ()); + QCOMPARE (count (completed, ActionKind::RestoreAuto), 1); + QCOMPARE (count (completed, ActionKind::RequestScheduleProposal), 1); +} + +void TestBeaconTxController::automaticTuneCompletesExistingPlanWithoutRedraw () +{ + Harness h; + h.initialize (); + auto const request = h.controller.receiveCompleted (); + auto const id = first (request, ActionKind::RequestScheduleProposal)->planId; + auto const apply = h.controller.proposalDelivered (id, hoppingProposal (Disposition::Transmit, true)); + QCOMPARE (count (apply, ActionKind::ApplyBandChange), 1); + auto const tune = h.controller.bandChangeOutcome (id, true); + QCOMPARE (count (tune, ActionKind::StartAutomaticTune), 1); + h.controller.tuneStarted (TuneKind::Automatic, id); + + auto const completed = h.controller.tuneCompleted (id); + QCOMPARE (count (completed, ActionKind::RestoreAuto), 1); + QCOMPARE (count (completed, ActionKind::RequestScheduleProposal), 0); + QVERIFY (h.controller.observeUtc (1100).front ().enabled); +} + +void TestBeaconTxController::staleAutomaticTuneEventsAreIgnored () +{ + Harness h; + h.initialize (); + auto const request = h.controller.receiveCompleted (); + auto const id = first (request, ActionKind::RequestScheduleProposal)->planId; + h.controller.proposalDelivered (id, hoppingProposal (Disposition::Transmit, true)); + h.controller.bandChangeOutcome (id, true); + auto stale = id; + ++stale.epoch; + + QVERIFY (h.controller.tuneStarted (TuneKind::Automatic, stale).empty ()); + QCOMPARE (h.controller.tuneKind (), TuneKind::None); + h.controller.tuneStarted (TuneKind::Automatic, id); + QVERIFY (h.controller.tuneCompleted (stale).empty ()); + QCOMPARE (h.controller.tuneKind (), TuneKind::Automatic); + QCOMPARE (count (h.controller.tuneCompleted (id), ActionKind::RestoreAuto), 1); +} + +void TestBeaconTxController::expiredAutomaticTunePreparesOnceAfterTail () +{ + Harness h; + h.initialize (); + auto const request = h.controller.receiveCompleted (); + auto const id = first (request, ActionKind::RequestScheduleProposal)->planId; + h.controller.proposalDelivered (id, hoppingProposal (Disposition::Transmit, true)); + h.controller.bandChangeOutcome (id, true); + h.controller.tuneStarted (TuneKind::Automatic, id); + QVERIFY (!h.controller.observeUtc (1100).front ().enabled); + + auto const completed = h.controller.tuneCompleted (id); + QCOMPARE (count (completed, ActionKind::RequestScheduleProposal), 1); + QVERIFY (h.controller.tuneCompleted (id).empty ()); +} + +void TestBeaconTxController::txNextSurvivesTuneAndResync () +{ + Harness h; + h.initialize (); + h.controller.setTxNext (true); + QVERIFY (h.controller.receiveCompleted ().empty ()); + h.controller.tuneStarted (TuneKind::Manual); + h.controller.observeUtc (3100); + h.controller.tuneCompleted (h.controller.tunePlanId ()); + QVERIFY (h.controller.txNextPending ()); + QVERIFY (h.controller.receiveCompleted ().empty ()); + QVERIFY (h.controller.observeUtc (4100).front ().enabled); +} + +void TestBeaconTxController::txNextClearsOnlyWhenMessageStarts () +{ + Harness h; + h.initialize (); + h.controller.setTxNext (true); + h.controller.receiveCompleted (); + auto const id = h.controller.observeUtc (1100).front ().planId; + h.controller.txStartRequested (); + h.controller.txStartResult (id, true); + QVERIFY (h.controller.txNextPending ()); + auto const started = h.controller.messageStarted (id); + QCOMPARE (count (started, ActionKind::ClearTxNextUi), 1); + QCOMPARE (count (started, ActionKind::RecordBeaconTransmission), 1); + QVERIFY (!h.controller.txNextPending ()); +} + +void TestBeaconTxController::txNextCancellationReusesUnderlyingPlan () +{ + Harness h; + h.initialize (); + h.prepare (Disposition::Transmit); + h.controller.setTxNext (true); + h.controller.setTxNext (false); + QVERIFY (h.controller.observeUtc (1100).front ().enabled); +} + +void TestBeaconTxController::suppressedTxNextCancellationDoesNotDraw () +{ + Harness h; + h.initialize (); + h.controller.setTxNext (true); + QVERIFY (h.controller.receiveCompleted ().empty ()); + h.controller.setTxNext (false); + QVERIFY (!h.controller.observeUtc (1100).front ().enabled); +} + +void TestBeaconTxController::fixedRoundRobinUsesUtcBoundaryWithoutProposal () +{ + Harness h; + h.initialize (RoundRobinPolicy::fixed (1, 2)); + QVERIFY (h.controller.receiveCompleted ().empty ()); + QVERIFY (h.controller.observeUtc (1100).front ().enabled); + auto const receiveBoundary = h.controller.observeUtc (2100); + QCOMPARE (count (receiveBoundary, ActionKind::SetTransmitWindow), 1); + QVERIFY (!receiveBoundary.front ().enabled); + QVERIFY (!h.controller.observeUtc (2199).size ()); +} + +void TestBeaconTxController::txNextPrecedesFixedRoundRobin () +{ + Harness h; + h.initialize (RoundRobinPolicy::fixed (0, 2)); + h.controller.setTxNext (true); + h.controller.receiveCompleted (); + QVERIFY (h.controller.observeUtc (1100).front ().enabled); +} + +void TestBeaconTxController::policyChangeDuringTxDrawsOnceAtCompletion () +{ + Harness h; + h.initialize (RoundRobinPolicy::fixed (1, 2)); + auto const id = h.controller.observeUtc (1100).front ().planId; + h.controller.txStartRequested (); + h.controller.txStartResult (id, true); + h.controller.messageStarted (id); + h.controller.setRoundRobinPolicy (RoundRobinPolicy::random ()); + h.controller.transmitWindowEnded (); + QCOMPARE (count (h.controller.txStopped (id), ActionKind::RequestScheduleProposal), 1); + QVERIFY (h.controller.txStopped (id).empty ()); +} + +void TestBeaconTxController::bandChangeFailureConvertsSamePlanToReceive () +{ + Harness h; + h.initialize (); + auto const request = h.controller.receiveCompleted (); + auto const id = first (request, ActionKind::RequestScheduleProposal)->planId; + auto const apply = h.controller.proposalDelivered (id, hoppingProposal (Disposition::Transmit)); + QCOMPARE (count (apply, ActionKind::ApplyBandChange), 1); + QVERIFY (h.controller.bandChangeOutcome (id, false).empty ()); + QVERIFY (!h.controller.observeUtc (1100).front ().enabled); +} + +void TestBeaconTxController::staleAndDuplicateBandOutcomesAreIgnored () +{ + Harness h; + h.initialize (); + auto const request = h.controller.receiveCompleted (); + auto const id = first (request, ActionKind::RequestScheduleProposal)->planId; + auto const apply = h.controller.proposalDelivered (id, hoppingProposal (Disposition::Transmit, true)); + QCOMPARE (count (apply, ActionKind::ApplyBandChange), 1); + auto stale = id; + ++stale.epoch; + QVERIFY (h.controller.bandChangeOutcome (stale, true).empty ()); + QCOMPARE (count (h.controller.bandChangeOutcome (id, true), ActionKind::StartAutomaticTune), 1); + QVERIFY (h.controller.bandChangeOutcome (id, true).empty ()); + QVERIFY (h.controller.proposalDelivered (id, hoppingProposal (Disposition::Transmit)).empty ()); +} + +void TestBeaconTxController::proposalRequestDoesNotActuate () +{ + Harness h; + h.initialize (); + auto const actions = h.controller.receiveCompleted (); + QCOMPARE (count (actions, ActionKind::RequestScheduleProposal), 1); + QCOMPARE (count (actions, ActionKind::ApplyBandChange), 0); + QCOMPARE (count (actions, ActionKind::StartAutomaticTune), 0); +} + +void TestBeaconTxController::startedSessionCrossesBoundaryAndPreparesOnStop () +{ + Harness h; + h.initialize (); + auto const id = h.enterPreparedTransmit (); + h.controller.txStartRequested (); + h.controller.txStartResult (id, true); + h.controller.messageStarted (id); + + auto const boundary = h.controller.observeUtc (2100); + QVERIFY (!boundary.front ().enabled); + QCOMPARE (h.controller.txLifecycle (), TxLifecycle::MessageStarted); + QCOMPARE (count (h.controller.txStopped (id), ActionKind::RequestScheduleProposal), 1); +} + +void TestBeaconTxController::oldStopCannotPrepareReenteredEpoch () +{ + Harness h; + h.initialize (); + auto const oldId = h.enterPreparedTransmit (); + h.controller.txStartRequested (); + h.controller.txStartResult (oldId, true); + h.controller.messageStarted (oldId); + h.controller.exitMode (); + h.controller.enterMode (1000); + h.controller.observeUtc (2100); + + QCOMPARE (count (h.controller.txStopped (oldId), ActionKind::RequestScheduleProposal), 0); + QVERIFY (!h.controller.futurePlan ()); + QCOMPARE (h.controller.txLifecycle (), TxLifecycle::None); + QVERIFY (!h.controller.txPlanId ().isValid ()); + QVERIFY (h.controller.txStopped (oldId).empty ()); + + auto const completion = h.controller.receiveCompleted (); + QCOMPARE (count (completion, ActionKind::RequestScheduleProposal), 1); + auto const nextId = first (completion, ActionKind::RequestScheduleProposal)->planId; + QVERIFY (h.controller.receiveCompleted ().empty ()); + QVERIFY (h.controller.txStopped (oldId).empty ()); + + h.controller.proposalDelivered (nextId, proposal (Disposition::Transmit)); + auto const boundary = h.controller.observeUtc (3100); + QCOMPARE (count (boundary, ActionKind::SetTransmitWindow), 1); + QVERIFY (first (boundary, ActionKind::SetTransmitWindow)->enabled); + QVERIFY (h.controller.currentPlanId () == nextId); +} + +void TestBeaconTxController::txNextWithdrawalAfterBoundaryUsesUnderlyingReceive () +{ + Harness h; + h.initialize (); + h.prepare (Disposition::Receive); + h.controller.setTxNext (true); + QVERIFY (h.controller.observeUtc (1100).front ().enabled); + + auto const withdrawn = h.controller.setTxNext (false); + QCOMPARE (count (withdrawn, ActionKind::SetTransmitWindow), 1); + QVERIFY (!withdrawn.front ().enabled); + QCOMPARE (h.controller.txLifecycle (), TxLifecycle::None); +} + +void TestBeaconTxController::txNextWithdrawalDuringStartWaitsForStop () +{ + Harness h; + h.initialize (); + h.prepare (Disposition::Receive); + h.controller.setTxNext (true); + auto const id = h.controller.observeUtc (1100).front ().planId; + h.controller.txStartRequested (); + + auto const withdrawn = h.controller.setTxNext (false); + QVERIFY (!first (withdrawn, ActionKind::SetTransmitWindow)->enabled); + QCOMPARE (h.controller.txLifecycle (), TxLifecycle::StartRequested); + QCOMPARE (count (withdrawn, ActionKind::RequestScheduleProposal), 0); + QCOMPARE (count (h.controller.txStopped (id), ActionKind::RequestScheduleProposal), 1); +} + +void TestBeaconTxController::acceptedStartIgnoresConflictingDuplicateResult () +{ + Harness h; + h.initialize (); + auto const id = h.enterPreparedTransmit (); + h.controller.txStartRequested (); + h.controller.txStartResult (id, true); + + QVERIFY (h.controller.txStartResult (id, false).empty ()); + QCOMPARE (h.controller.txLifecycle (), TxLifecycle::StartRequested); + QCOMPARE (count (h.controller.messageStarted (id), ActionKind::RecordBeaconTransmission), 1); +} + +void TestBeaconTxController::acceptedStartWithoutMessageRecordsNothingAndRecovers () +{ + Harness h; + h.initialize (); + auto const id = h.enterPreparedTransmit (); + h.controller.txStartRequested (); + h.controller.txStartResult (id, true); + + auto const ended = h.controller.transmitWindowEnded (); + QCOMPARE (count (ended, ActionKind::RecordBeaconTransmission), 0); + QCOMPARE (count (ended, ActionKind::RequestScheduleProposal), 0); + QCOMPARE (count (h.controller.txStopped (id), ActionKind::RequestScheduleProposal), 1); +} + +void TestBeaconTxController::earlyTxStopClosesWindowAndPrepares () +{ + Harness h; + h.initialize (); + auto const id = h.enterPreparedTransmit (); + h.controller.txStartRequested (); + h.controller.txStartResult (id, true); + h.controller.messageStarted (id); + + auto const stopped = h.controller.txStopped (id); + QCOMPARE (count (stopped, ActionKind::SetTransmitWindow), 1); + QVERIFY (!first (stopped, ActionKind::SetTransmitWindow)->enabled); + QCOMPARE (count (stopped, ActionKind::RequestScheduleProposal), 1); +} + +void TestBeaconTxController::autoDisabledForcesReceiveWithoutRedraw () +{ + Harness h; + h.initialize (); + h.prepare (Disposition::Transmit); + h.controller.setAutoEnabled (false); + + auto const boundary = h.controller.observeUtc (1100); + QVERIFY (!boundary.front ().enabled); + QCOMPARE (count (boundary, ActionKind::RequestScheduleProposal), 0); +} + +void TestBeaconTxController::backwardClockStepResynchronizesToReceive () +{ + Harness h; + h.initialize (); + h.prepare (Disposition::Transmit); + auto const epoch = h.controller.currentPlanId ().epoch; + + auto const resync = h.controller.observeUtc (50); + QCOMPARE (count (resync, ActionKind::SetTransmitWindow), 1); + QVERIFY (!resync.front ().enabled); + QVERIFY (h.controller.currentPlanId ().epoch != epoch); + QVERIFY (!h.controller.futurePlan ()); +} + +void TestBeaconTxController::oneProposalRequestAndApplicationPerPlanId () +{ + Harness h; + h.initialize (); + ActionRecorder recorder; + auto const requested = h.controller.receiveCompleted (); + recorder.record (requested); + auto const id = first (requested, ActionKind::RequestScheduleProposal)->planId; + auto const drawn = hoppingProposal (Disposition::Transmit); + auto const apply = h.controller.proposalDelivered (id, drawn); + recorder.record (apply); + h.controller.bandChangeOutcome (id, true); + + recorder.record (h.controller.receiveCompleted ()); + recorder.record (h.controller.proposalDelivered (id, drawn)); + recorder.record (h.controller.bandChangeOutcome (id, false)); + QCOMPARE (recorder.countFor (id, ActionKind::RequestScheduleProposal), 1); + QCOMPARE (recorder.countFor (id, ActionKind::ApplyBandChange), 1); +} + +QTEST_GUILESS_MAIN (TestBeaconTxController) + +#include "test_beacon_tx_controller.moc" diff --git a/tests/unit/common/test_callsign_validator.cpp b/tests/unit/common/test_callsign_validator.cpp new file mode 100644 index 00000000..6715dfd7 --- /dev/null +++ b/tests/unit/common/test_callsign_validator.cpp @@ -0,0 +1,48 @@ +#include + +#include "validators/CallsignValidator.hpp" + +class TestCallsignValidator final + : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void normalizeStoredInput_data (); + void normalizeStoredInput (); +}; + +void TestCallsignValidator::normalizeStoredInput_data () +{ + QTest::addColumn ("input"); + QTest::addColumn ("max_length"); + QTest::addColumn ("allow_compound"); + QTest::addColumn ("expected"); + + QTest::newRow ("valid") << QString {"K1JT"} << 6 << false << QString {"K1JT"}; + QTest::newRow ("lowercase") << QString {"k1jt"} << 6 << false << QString {"K1JT"}; + QTest::newRow ("boundary whitespace") << QString {" k1jt "} << 6 << false << QString {"K1JT"}; + QTest::newRow ("trim before truncation") << QString {" K1JT73"} << 6 << false << QString {"K1JT73"}; + QTest::newRow ("truncate valid") << QString {"K1JT73X"} << 6 << false << QString {"K1JT73"}; + QTest::newRow ("compound allowed") << QString {"K1JT/P"} << 6 << true << QString {"K1JT/P"}; + QTest::newRow ("compound rejected") << QString {"K1JT/P"} << 6 << false << QString {}; + QTest::newRow ("punctuation") << QString {"K1?JT"} << 6 << false << QString {}; + QTest::newRow ("internal whitespace") << QString {"K1 JT"} << 6 << false << QString {}; + QTest::newRow ("non-ASCII") << QString::fromUtf8 ("K1\xc3\x98JT") << 6 << false << QString {}; + QTest::newRow ("empty") << QString {} << 6 << false << QString {}; +} + +void TestCallsignValidator::normalizeStoredInput () +{ + QFETCH (QString, input); + QFETCH (int, max_length); + QFETCH (bool, allow_compound); + QFETCH (QString, expected); + + QCOMPARE (CallsignValidator::normalizeStoredInput ( + input, max_length, allow_compound), expected); +} + +QTEST_GUILESS_MAIN (TestCallsignValidator) + +#include "test_callsign_validator.moc" diff --git a/tests/unit/common/test_configuration_dialog_layout.cpp b/tests/unit/common/test_configuration_dialog_layout.cpp new file mode 100644 index 00000000..019147af --- /dev/null +++ b/tests/unit/common/test_configuration_dialog_layout.cpp @@ -0,0 +1,521 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "models/DecodeHighlightingModel.hpp" +#include "widgets/SettingsDialogLayout.hpp" + +#include "ui_Configuration.h" + +namespace +{ + struct DialogFixture + { + explicit DialogFixture (int font_delta = 0) + { + if (font_delta) + { + auto font = dialog.font (); + font.setPointSize (font.pointSize () + font_delta); + dialog.setFont (font); + } + + ui.setupUi (&dialog); + highlighting_model.set_font (dialog.font ()); + ui.highlighting_list_view->setModel (&highlighting_model); + SettingsDialogLayout::install (ui); + } + + QDialog dialog; + Ui::configuration_dialog ui; + DecodeHighlightingModel highlighting_model; + }; + + QList scrollablePages (Ui::configuration_dialog const& ui) + { + return { + ui.general_tab, + ui.radio_tab, + ui.audio_tab, + ui.reporting_tab, + ui.colors_tab, + ui.advanced_tab, + ui.alerts_tab, + ui.filters_tab, + }; + } + + QList allPages (Ui::configuration_dialog const& ui) + { + return { + ui.general_tab, + ui.radio_tab, + ui.audio_tab, + ui.tx_macros_tab, + ui.reporting_tab, + ui.frequencies_tab, + ui.colors_tab, + ui.advanced_tab, + ui.alerts_tab, + ui.filters_tab, + }; + } + + void settleLayouts () + { + QCoreApplication::sendPostedEvents (); + QApplication::processEvents (); + } + + void showDialog (QDialog& dialog, QSize size) + { + dialog.ensurePolished (); + dialog.layout ()->activate (); + dialog.resize (size); + dialog.show (); + settleLayouts (); + } + + QRect geometryIn (QWidget const * widget, QWidget const * ancestor) + { + return {widget->mapTo (ancestor, {}), widget->size ()}; + } + + bool isFullyInside (QWidget const * widget, QWidget const * ancestor) + { + return ancestor->contentsRect ().contains (geometryIn (widget, ancestor)); + } + + bool isFullyVisible (QWidget const * widget, QScrollArea const * scroll_area) + { + return scroll_area->viewport ()->rect ().contains ( + geometryIn (widget, scroll_area->viewport ())); + } + + QString sizeText (QSize size) + { + return QString {"%1x%2"}.arg (size.width ()).arg (size.height ()); + } + + QString scrollDiagnostics (QWidget const * page, QDialog const& dialog, + QScrollArea const * scroll_area) + { + auto const * content = scroll_area->widget (); + return QString {"%1 style=%2 font=%3/%4pt dialog=%5 viewport=%6 " + "content=%7 contentHint=%8 contentMinimumHint=%9 ranges=%10x%11"} + .arg (page->objectName (), qApp->style ()->objectName (), dialog.font ().family ()) + .arg (dialog.font ().pointSizeF ()) + .arg (sizeText (dialog.size ()), sizeText (scroll_area->viewport ()->size ()), + sizeText (content->size ()), sizeText (content->sizeHint ()), + sizeText (content->minimumSizeHint ())) + .arg (scroll_area->horizontalScrollBar ()->maximum ()) + .arg (scroll_area->verticalScrollBar ()->maximum ()); + } + + void sendWheelEvent (QWidget * target, QPoint angle_delta) + { + auto const local_position = QPointF {target->rect ().center ()}; + auto const global_position = QPointF {target->mapToGlobal (local_position.toPoint ())}; + QWheelEvent event {local_position, global_position, {}, angle_delta, + Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false}; + QApplication::sendEvent (target, &event); + settleLayouts (); + } +} + +class TestConfigurationDialogLayout final + : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void pagesRetainIdentityAndScrollingPolicy (); + void windowSizeIsBoundedByAvailableGeometry (); + void compactControlsKeepNaturalGeometry_data (); + void compactControlsKeepNaturalGeometry (); + void constrainedDialogKeepsNavigationAndActionsReachable_data (); + void constrainedDialogKeepsNavigationAndActionsReachable (); + void preferredDialogSizeKeepsPagesUsable_data (); + void preferredDialogSizeKeepsPagesUsable (); + void keyboardFocusRevealsOffscreenControls (); + void wheelEventsScrollThePage (); + void colorsPageOwnsVerticalScrolling (); +}; + +void TestConfigurationDialogLayout::pagesRetainIdentityAndScrollingPolicy () +{ + DialogFixture fixture; + auto& ui = fixture.ui; + + auto const pages = allPages (ui); + QStringList const page_names { + "general_tab", + "radio_tab", + "audio_tab", + "tx_macros_tab", + "reporting_tab", + "frequencies_tab", + "colors_tab", + "advanced_tab", + "alerts_tab", + "filters_tab", + }; + + QCOMPARE (ui.configuration_tabs->count (), page_names.size ()); + for (int index = 0; index < pages.size (); ++index) + { + QCOMPARE (ui.configuration_tabs->widget (index), pages.at (index)); + QCOMPARE (pages.at (index)->objectName (), page_names.at (index)); + QVERIFY (!ui.configuration_tabs->tabText (index).isEmpty ()); + } + + SettingsDialogLayout::install (ui); + for (auto * page : scrollablePages (ui)) + { + auto * scroll_area = SettingsDialogLayout::pageScrollArea (page); + QVERIFY (scroll_area); + QCOMPARE (scroll_area->parentWidget (), page); + QCOMPARE (scroll_area->objectName (), page->objectName () + "_scroll_area"); + QCOMPARE (scroll_area->focusPolicy (), Qt::NoFocus); + QCOMPARE (scroll_area->viewport ()->focusPolicy (), Qt::NoFocus); + QCOMPARE (scroll_area->horizontalScrollBar ()->focusPolicy (), Qt::NoFocus); + QCOMPARE (scroll_area->verticalScrollBar ()->focusPolicy (), Qt::NoFocus); + QCOMPARE (scroll_area->frameShape (), QFrame::NoFrame); + QCOMPARE (scroll_area->horizontalScrollBarPolicy (), Qt::ScrollBarAsNeeded); + QCOMPARE (scroll_area->verticalScrollBarPolicy (), Qt::ScrollBarAsNeeded); + QVERIFY (scroll_area->widgetResizable ()); + QVERIFY (scroll_area->widget ()); + QCOMPARE (scroll_area->widget ()->focusPolicy (), Qt::NoFocus); + QCOMPARE (page->findChildren (QString {}, Qt::FindDirectChildrenOnly).size (), 1); + QVERIFY (scroll_area->widget ()->findChildren().isEmpty ()); + } + + auto * general_scroll_area = SettingsDialogLayout::pageScrollArea (ui.general_tab); + QVERIFY (general_scroll_area->widget ()->isAncestorOf (ui.callsign_line_edit)); + QCOMPARE (ui.callsign_label->buddy (), ui.callsign_line_edit); + auto * colors_scroll_area = SettingsDialogLayout::pageScrollArea (ui.colors_tab); + QVERIFY (colors_scroll_area->widget ()->isAncestorOf (ui.highlighting_list_view)); + QCOMPARE (ui.highlighting_list_view->verticalScrollBarPolicy (), Qt::ScrollBarAlwaysOff); + QCOMPARE (SettingsDialogLayout::pageScrollArea (ui.tx_macros_tab), nullptr); + QCOMPARE (SettingsDialogLayout::pageScrollArea (ui.frequencies_tab), nullptr); + QVERIFY (ui.configuration_tabs->tabBar ()->usesScrollButtons ()); +} + +void TestConfigurationDialogLayout::windowSizeIsBoundedByAvailableGeometry () +{ + QMargins const frame_margins {10, 20, 10, 20}; + QSize const available {1200, 900}; + + QCOMPARE (SettingsDialogLayout::boundedWindowSize ({800, 600}, available, frame_margins), + QSize (800, 600)); + QCOMPARE (SettingsDialogLayout::boundedWindowSize ({1400, 1000}, available, frame_margins), + QSize (1180, 860)); + QCOMPARE (SettingsDialogLayout::boundedWindowSize ({1400, 500}, available, frame_margins), + QSize (1180, 500)); + QCOMPARE (SettingsDialogLayout::boundedWindowSize ({100, 100}, {10, 10}, frame_margins), + QSize (1, 1)); +} + +void TestConfigurationDialogLayout::compactControlsKeepNaturalGeometry_data () +{ + QTest::addColumn ("font_delta"); + QTest::newRow ("default-font") << 0; + QTest::newRow ("larger-accessibility-font") << 4; +} + +void TestConfigurationDialogLayout::compactControlsKeepNaturalGeometry () +{ + QFETCH (int, font_delta); + + DialogFixture fixture {font_delta}; + auto& dialog = fixture.dialog; + auto& ui = fixture.ui; + showDialog (dialog, {640, 480}); + + ui.configuration_tabs->setCurrentWidget (ui.general_tab); + settleLayouts (); + QVERIFY (qAbs (ui.grid_line_edit->geometry ().center ().y () + - ui.use_dynamic_grid->geometry ().center ().y ()) <= 2); + + ui.configuration_tabs->setCurrentWidget (ui.advanced_tab); + settleLayouts (); + for (auto const& group_and_controls : { + qMakePair (ui.groupBox_10, + QList {ui.cbx2ToneSpacing, ui.cbx4ToneSpacing}), + qMakePair (ui.groupBox_7, + QList {ui.rbLowSidelobes, ui.rbMaxSensitivity}), + }) + { + auto * group = group_and_controls.first; + QCOMPARE (group->sizePolicy ().verticalPolicy (), QSizePolicy::Minimum); + QVERIFY (group->height () >= group->sizeHint ().height ()); + for (auto * control : group_and_controls.second) + { + QVERIFY (isFullyInside (control, group)); + } + } +} + +void TestConfigurationDialogLayout::constrainedDialogKeepsNavigationAndActionsReachable_data () +{ + QTest::addColumn ("font_delta"); + QTest::newRow ("default-font") << 0; + QTest::newRow ("larger-accessibility-font") << 4; +} + +void TestConfigurationDialogLayout::constrainedDialogKeepsNavigationAndActionsReachable () +{ + QFETCH (int, font_delta); + + QWidget host; + DialogFixture fixture {font_delta}; + auto& dialog = fixture.dialog; + auto& ui = fixture.ui; + dialog.setParent (&host, Qt::Widget); + host.show (); + QSize const constrained_size {640, 480}; + showDialog (dialog, constrained_size); + + QCOMPARE (dialog.size (), constrained_size); + QVERIFY (ui.configuration_tabs->isVisibleTo (&dialog)); + QVERIFY (isFullyInside (ui.configuration_tabs, &dialog)); + QVERIFY (ui.configuration_dialog_button_box->isVisibleTo (&dialog)); + QVERIFY (isFullyInside (ui.configuration_dialog_button_box, &dialog)); + + auto * ok = ui.configuration_dialog_button_box->button (QDialogButtonBox::Ok); + auto * cancel = ui.configuration_dialog_button_box->button (QDialogButtonBox::Cancel); + QVERIFY (ok); + QVERIFY (cancel); + auto const button_box_geometry = geometryIn (ui.configuration_dialog_button_box, &dialog); + + for (int index = 0; index < ui.configuration_tabs->count (); ++index) + { + ui.configuration_tabs->setCurrentIndex (index); + settleLayouts (); + + QCOMPARE (ui.configuration_tabs->currentWidget (), allPages (ui).at (index)); + QVERIFY (ui.configuration_tabs->currentWidget ()->isVisibleTo (&dialog)); + QVERIFY (ui.configuration_tabs->tabBar ()->rect ().intersects ( + ui.configuration_tabs->tabBar ()->tabRect (index))); + QVERIFY (isFullyInside (ui.configuration_dialog_button_box, &dialog)); + QCOMPARE (geometryIn (ui.configuration_dialog_button_box, &dialog), button_box_geometry); + QVERIFY (ok->isVisibleTo (&dialog)); + QVERIFY (cancel->isVisibleTo (&dialog)); + QVERIFY (isFullyInside (ok, &dialog)); + QVERIFY (isFullyInside (cancel, &dialog)); + + if (auto * scroll_area = SettingsDialogLayout::pageScrollArea ( + ui.configuration_tabs->currentWidget ())) + { + auto const minimum_hint = scroll_area->widget ()->minimumSizeHint (); + auto const message = scrollDiagnostics (ui.configuration_tabs->currentWidget (), + dialog, scroll_area); + QVERIFY2 (scroll_area->widget ()->width () >= minimum_hint.width (), + qPrintable (message)); + QVERIFY2 (scroll_area->widget ()->height () >= minimum_hint.height (), + qPrintable (message)); + } + } + + ui.configuration_tabs->setCurrentWidget (ui.frequencies_tab); + settleLayouts (); + for (auto * table : {ui.frequencies_table_view, ui.stations_table_view}) + { + QVERIFY (table->height () >= table->minimumHeight ()); + QVERIFY (table->viewport ()->height () >= table->fontMetrics ().height ()); + QVERIFY (isFullyInside (table, ui.frequencies_tab)); + } + + ui.configuration_tabs->setCurrentWidget (ui.advanced_tab); + settleLayouts (); + auto * advanced_scroll_area = SettingsDialogLayout::pageScrollArea (ui.advanced_tab); + QVERIFY (advanced_scroll_area->verticalScrollBar ()->maximum () > 0); + advanced_scroll_area->verticalScrollBar ()->setValue ( + advanced_scroll_area->verticalScrollBar ()->maximum ()); + advanced_scroll_area->horizontalScrollBar ()->setValue ( + advanced_scroll_area->horizontalScrollBar ()->maximum ()); + settleLayouts (); + QCOMPARE (geometryIn (ui.configuration_dialog_button_box, &dialog), button_box_geometry); + + dialog.resize ({420, 480}); + settleLayouts (); + QVERIFY (ui.configuration_tabs->tabBar ()->width () + < ui.configuration_tabs->tabBar ()->sizeHint ().width ()); + for (int index = 0; index < ui.configuration_tabs->count (); ++index) + { + ui.configuration_tabs->setCurrentIndex (index); + settleLayouts (); + QVERIFY (ui.configuration_tabs->tabBar ()->rect ().intersects ( + ui.configuration_tabs->tabBar ()->tabRect (index))); + QVERIFY (isFullyInside (ui.configuration_dialog_button_box, &dialog)); + } +} + +void TestConfigurationDialogLayout::preferredDialogSizeKeepsPagesUsable_data () +{ + QTest::addColumn ("font_delta"); + QTest::newRow ("default-font") << 0; + QTest::newRow ("larger-accessibility-font") << 4; +} + +void TestConfigurationDialogLayout::preferredDialogSizeKeepsPagesUsable () +{ + QFETCH (int, font_delta); + + QWidget host; + DialogFixture fixture {font_delta}; + auto& dialog = fixture.dialog; + auto& ui = fixture.ui; + dialog.setParent (&host, Qt::Widget); + host.show (); + showDialog (dialog, {827, 705}); + auto const preferred_size = SettingsDialogLayout::preferredWindowSize (dialog, ui); + QVERIFY (preferred_size.width () >= dialog.sizeHint ().width ()); + QVERIFY (preferred_size.height () >= dialog.sizeHint ().height ()); + showDialog (dialog, preferred_size); + + int vertically_scrolling_pages = 0; + for (auto * page : scrollablePages (ui)) + { + ui.configuration_tabs->setCurrentWidget (page); + settleLayouts (); + auto * scroll_area = SettingsDialogLayout::pageScrollArea (page); + auto const message = scrollDiagnostics (page, dialog, scroll_area); + QVERIFY2 (scroll_area->horizontalScrollBar ()->maximum () == 0, + qPrintable (message)); + if (scroll_area->verticalScrollBar ()->maximum () > 0) + { + ++vertically_scrolling_pages; + } + } + QVERIFY (vertically_scrolling_pages <= 1); + + ui.configuration_tabs->setCurrentWidget (ui.general_tab); + settleLayouts (); + QVERIFY (ui.station_group_box->height () <= ui.station_group_box->sizeHint ().height () + 2); + + dialog.resize (preferred_size.width (), qMax (480, preferred_size.height () - 200)); + settleLayouts (); + for (auto * page : scrollablePages (ui)) + { + ui.configuration_tabs->setCurrentWidget (page); + settleLayouts (); + auto * scroll_area = SettingsDialogLayout::pageScrollArea (page); + auto const message = scrollDiagnostics (page, dialog, scroll_area); + QVERIFY2 (scroll_area->horizontalScrollBar ()->maximum () == 0, + qPrintable (message)); + } +} + +void TestConfigurationDialogLayout::keyboardFocusRevealsOffscreenControls () +{ + DialogFixture fixture; + auto& dialog = fixture.dialog; + auto& ui = fixture.ui; + ui.configuration_tabs->setCurrentWidget (ui.advanced_tab); + showDialog (dialog, {620, 360}); + QApplication::setActiveWindow (&dialog); + settleLayouts (); + + auto * advanced_scroll_area = SettingsDialogLayout::pageScrollArea (ui.advanced_tab); + auto * vertical_scroll_bar = advanced_scroll_area->verticalScrollBar (); + QVERIFY (vertical_scroll_bar->maximum () > 0); + vertical_scroll_bar->setValue (vertical_scroll_bar->minimum ()); + advanced_scroll_area->horizontalScrollBar ()->setValue ( + advanced_scroll_area->horizontalScrollBar ()->minimum ()); + settleLayouts (); + + QVERIFY (!isFullyVisible (ui.pbTestCloudlog, advanced_scroll_area)); + auto const button_box_geometry = geometryIn (ui.configuration_dialog_button_box, &dialog); + ui.pbTestCloudlog->setFocus (Qt::TabFocusReason); + + QTRY_COMPARE (QApplication::focusWidget (), ui.pbTestCloudlog); + QTRY_VERIFY (vertical_scroll_bar->value () > vertical_scroll_bar->minimum ()); + QTRY_VERIFY (isFullyVisible (ui.pbTestCloudlog, advanced_scroll_area)); + QCOMPARE (geometryIn (ui.configuration_dialog_button_box, &dialog), button_box_geometry); + + ui.configuration_tabs->setCurrentWidget (ui.filters_tab); + dialog.resize ({420, 480}); + settleLayouts (); + auto * filters_scroll_area = SettingsDialogLayout::pageScrollArea (ui.filters_tab); + auto * horizontal_scroll_bar = filters_scroll_area->horizontalScrollBar (); + QVERIFY (horizontal_scroll_bar->maximum () > 0); + auto * ok = ui.configuration_dialog_button_box->button (QDialogButtonBox::Ok); + ok->setFocus (Qt::TabFocusReason); + QTRY_COMPARE (QApplication::focusWidget (), ok); + horizontal_scroll_bar->setValue (horizontal_scroll_bar->maximum ()); + filters_scroll_area->verticalScrollBar ()->setValue ( + filters_scroll_area->verticalScrollBar ()->minimum ()); + settleLayouts (); + auto const filters_button_box_geometry = geometryIn ( + ui.configuration_dialog_button_box, &dialog); + + auto * left_side_control = ui.Territory1; + auto const initial_horizontal_position = horizontal_scroll_bar->value (); + QVERIFY (!isFullyVisible (left_side_control, filters_scroll_area)); + left_side_control->setFocus (Qt::TabFocusReason); + QTRY_COMPARE (QApplication::focusWidget (), left_side_control); + QTRY_VERIFY (horizontal_scroll_bar->value () < initial_horizontal_position); + QTRY_VERIFY (isFullyVisible (left_side_control, filters_scroll_area)); + QCOMPARE (geometryIn (ui.configuration_dialog_button_box, &dialog), + filters_button_box_geometry); +} + +void TestConfigurationDialogLayout::wheelEventsScrollThePage () +{ + DialogFixture fixture; + auto& dialog = fixture.dialog; + auto& ui = fixture.ui; + ui.configuration_tabs->setCurrentWidget (ui.advanced_tab); + showDialog (dialog, {620, 360}); + + auto * scroll_area = SettingsDialogLayout::pageScrollArea (ui.advanced_tab); + auto * scroll_bar = scroll_area->verticalScrollBar (); + QVERIFY (scroll_bar->maximum () > 0); + auto const button_box_geometry = geometryIn (ui.configuration_dialog_button_box, &dialog); + + scroll_bar->setValue (scroll_bar->minimum ()); + sendWheelEvent (scroll_area->viewport (), {0, -120}); + QVERIFY (scroll_bar->value () > scroll_bar->minimum ()); + QCOMPARE (geometryIn (ui.configuration_dialog_button_box, &dialog), button_box_geometry); + +} + +void TestConfigurationDialogLayout::colorsPageOwnsVerticalScrolling () +{ + DialogFixture fixture; + auto& dialog = fixture.dialog; + auto& ui = fixture.ui; + ui.configuration_tabs->setCurrentWidget (ui.colors_tab); + showDialog (dialog, {620, 360}); + + auto * page_scroll_area = SettingsDialogLayout::pageScrollArea (ui.colors_tab); + auto * page_scroll_bar = page_scroll_area->verticalScrollBar (); + QCOMPARE (ui.highlighting_list_view->model ()->rowCount (), 16); + QCOMPARE (ui.highlighting_list_view->verticalScrollBarPolicy (), Qt::ScrollBarAlwaysOff); + QCOMPARE (ui.highlighting_list_view->verticalScrollBar ()->maximum (), 0); + QVERIFY (page_scroll_bar->maximum () > 0); + + page_scroll_bar->setValue (page_scroll_bar->minimum ()); + sendWheelEvent (ui.highlighting_list_view->viewport (), {0, -120}); + QVERIFY (page_scroll_bar->value () > page_scroll_bar->minimum ()); + QCOMPARE (ui.highlighting_list_view->verticalScrollBar ()->value (), 0); +} + +QTEST_MAIN (TestConfigurationDialogLayout) + +#include "test_configuration_dialog_layout.moc" diff --git a/tests/unit/common/test_decode_output_plan.cpp b/tests/unit/common/test_decode_output_plan.cpp new file mode 100644 index 00000000..8e54f0c9 --- /dev/null +++ b/tests/unit/common/test_decode_output_plan.cpp @@ -0,0 +1,1146 @@ +#include + +#include "DecodeOutputPlan.hpp" +#include "Decoder/decodedtext.h" + +class TestDecodeOutputPlan final + : public QObject +{ + Q_OBJECT + + using ActionKind = DecodeOutputPlan::ActionKind; + using SpecOp = SpecialOperatingActivity; + + enum FilterOption + { + InitiallyFiltered = 1 << 0, + AlwaysPass = 1 << 1, + Blacklist = 1 << 2, + Whitelist = 1 << 3, + Bypass = 1 << 4, + WaitAndPounceOnly = 1 << 5, + ScoringPounce = 1 << 6, + NonScoringPounce = 1 << 7, + HideIgnored = 1 << 8, + HideWorkedToday = 1 << 9 + }; + + enum FilterOutcome + { + KeywordFiltered = 1 << 0, + FinallyFiltered = 1 << 1, + ContinueProcessing = 1 << 2, + AlwaysPassed = 1 << 3, + ResetPounceScores = 1 << 4, + DisplayLeft = 1 << 5 + }; + + static QString actionName(ActionKind kind) + { + switch (kind) { + case ActionKind::ShowQsyMessage: return "qsy"; + case ActionKind::AccumulateFoxActivity: return "fox-activity"; + case ActionKind::IncrementDecodeCount: return "count"; + case ActionKind::WriteAll: return "all.txt"; + case ActionKind::UploadWsprSpot: return "wspr"; + case ActionKind::UpdateArrlActivity: return "arrl"; + case ActionKind::FlushFoxActivity: return "flush-fox"; + } + return "unknown"; + } + + static QStringList actionNames(QVector const& actions) + { + QStringList names; + for (auto const& action : actions) names.append(actionName(action.kind)); + return names; + } + + static DecodeOutputPlan::PreparationContext preparationContext() + { + DecodeOutputPlan::PreparationContext context; + context.mode = "FT8"; + context.myCall = "K1ABC"; + context.qsyEnabled = true; + return context; + } + + static DecodeOutputPlan::RoutingContext routingContext() + { + DecodeOutputPlan::RoutingContext context; + context.mode = "FT8"; + context.myCall = "K1ABC"; + context.baseCall = "K1ABC"; + context.hisCall = "W1AW"; + context.rxFrequency = 1500; + context.wideGraphRxFrequency = 1500; + return context; + } + +private slots: + void wireFormatRegressionCorpus_data() + { + QTest::addColumn("rawLine"); + QTest::addColumn("expectedNormalizedLine"); + QTest::addColumn("mode"); + QTest::addColumn("specOp"); + QTest::addColumn("activeStationsAvailable"); + QTest::addColumn("expectedDisposition"); + QTest::addColumn("expectedAveraged"); + QTest::addColumn("expectedAverageCount"); + QTest::addColumn("expectedFrequencySpread"); + QTest::addColumn("expectedSpread"); + QTest::addColumn("expectedDecoded"); + QTest::addColumn("expectedSingleDecodes"); + QTest::addColumn("expectedAveragedDecodes"); + QTest::addColumn("expectedActions"); + + auto legacyNormalized = [] (QByteArray line) { + line.insert(qMin(44, line.size()), QByteArray(14, ' ')); + return line; + }; + auto addRow = [] (char const * name, QByteArray const& rawLine, + QByteArray const& normalizedLine, QString const& mode, + SpecOp specOp, bool activeStationsAvailable, + DecodeOutputPlan::LineDisposition disposition, + bool averaged, int averageCount, bool haveSpread, float spread, + bool decoded, int singleDecodes, int averagedDecodes, + QStringList const& actions) { + QTest::newRow(name) << rawLine << normalizedLine << mode << static_cast(specOp) + << activeStationsAvailable << static_cast(disposition) + << averaged << averageCount << haveSpread << spread << decoded + << singleDecodes << averagedDecodes << actions; + }; + + using Disposition = DecodeOutputPlan::LineDisposition; + QStringList const decodeActions {"qsy", "count", "all.txt"}; + QStringList const finishActions {"qsy"}; + + QByteArray const ft8 { + "133430 -2 -0.8 1197 ~ CQ F5RXL IN94 \r\n"}; + addRow("real FT8", ft8, ft8.left(ft8.size() - 2), "FT8", SpecOp::NONE, false, + Disposition::Decode, false, 0, false, 0.0f, false, 0, 0, decodeActions); + + QByteArray const ft8Ap = QByteArray {"060500 -10 0.3 1500 ~ "} + + QByteArray {"CQ W1AW FN31"}.leftJustified(36, ' ') + "? a7\n"; + addRow("FT8 AP low confidence", ft8Ap, ft8Ap.left(ft8Ap.size() - 1), + "FT8", SpecOp::NONE, false, Disposition::Decode, + false, 0, false, 0.0f, false, 0, 0, decodeActions); + + QByteArray const ft4 { + "000002 -10 -0.2 296 + N1TRK N4FKH 569 VA \n"}; + addRow("real FT4 contest", ft4, ft4.left(ft4.size() - 1), + "FT4", SpecOp::NONE, false, Disposition::Decode, + false, 0, false, 0.0f, false, 0, 0, decodeActions); + + QByteArray const jt9 {"1742 -5 1.2 1505 @ JA1KAU PD0JAC -23 \n"}; + auto jt9Normalized = jt9.left(jt9.size() - 1); + addRow("real JT9", jt9, legacyNormalized(jt9Normalized), + "JT9", SpecOp::NONE, false, Disposition::Decode, + false, 0, false, 0.0f, false, 0, 0, decodeActions); + + QByteArray const jt65 = QByteArray {"2343 -11 0.8 1259 # "} + + QByteArray {"YV6BFE F6GUU R-08"}.leftJustified(22, ' ') + " \n"; + auto jt65Normalized = jt65.left(jt65.size() - 1); + addRow("ordinary JT65", jt65, legacyNormalized(jt65Normalized), + "JT65", SpecOp::NONE, false, Disposition::Decode, + false, 0, false, 0.0f, false, 0, 0, decodeActions); + + QByteArray const jt65Average = QByteArray {"2343 -18 0.3 1500 # "} + + QByteArray {"K1ABC W1AW R-10"}.leftJustified(22, ' ') + " d22\n"; + auto jt65AverageNormalized = jt65Average.left(jt65Average.size() - 1); + addRow("averaged deep JT65", jt65Average, legacyNormalized(jt65AverageNormalized), + "JT65", SpecOp::NONE, false, Disposition::Decode, + true, 2, false, 0.0f, false, 0, 0, decodeActions); + + QByteArray const jt65NumericOnly {"2343 -20 0.3 1500\n"}; + auto jt65NumericOnlyNormalized = jt65NumericOnly.left(jt65NumericOnly.size() - 1); + addRow("numeric-only JT65", jt65NumericOnly, + legacyNormalized(jt65NumericOnlyNormalized), + "JT65", SpecOp::NONE, false, Disposition::Decode, + false, 0, false, 0.0f, false, 0, 0, decodeActions); + + QByteArray const q65 { + "1621 -24 2.8 697 : W7GJ N8JX EN73 q0 \n"}; + addRow("real long-period Q65", q65, q65.left(q65.size() - 1), + "Q65", SpecOp::NONE, false, Disposition::Decode, + false, 0, false, 0.0f, false, 0, 0, decodeActions); + + QByteArray const q65Average = QByteArray {"060500 -20 0.3 1500 : "} + + QByteArray {"K1ABC W1AW R-10"}.leftJustified(37, ' ') + " q23\n"; + addRow("short-period averaged Q65", q65Average, + q65Average.left(q65Average.size() - 1), + "Q65", SpecOp::NONE, false, Disposition::Decode, + true, 3, false, 0.0f, false, 0, 0, decodeActions); + + QByteArray const fst4Short = QByteArray {"060500 -18 0.3 1500 ` "} + .append(QByteArray {"CQ W1AW FN31"}.leftJustified(37, ' ')) + .append(" ").leftJustified(70, ' '); + addRow("short-period FST4", fst4Short + "\n", fst4Short, + "FST4", SpecOp::NONE, false, Disposition::Decode, + false, 0, false, 0.0f, false, 0, 0, decodeActions); + + QByteArray fst4Spread = QByteArray {"0058 16 0.4 1331 ` "} + .append(QByteArray {"CQ K9KFR EN71"}.leftJustified(37, ' ')) + .append(" ").leftJustified(70, ' '); + fst4Spread.replace(64, 6, " 1.250"); + addRow("long-period FST4 spread", fst4Spread + "\n", fst4Spread.left(64), + "FST4", SpecOp::NONE, false, Disposition::Decode, + false, 0, true, 1.25f, false, 0, 0, decodeActions); + + QByteArray const fst4w = QByteArray {"0058 -20 0.4 1500 ` "} + .append(QByteArray {"CQ W1AW FN31"}.leftJustified(37, ' ')) + .append(" ").leftJustified(70, ' '); + addRow("accepted FST4W", fst4w + "\n", fst4w, + "FST4W", SpecOp::NONE, false, Disposition::Decode, + false, 0, false, 0.0f, false, 0, 0, + {"qsy", "count", "all.txt", "wspr"}); + + QByteArray const msk144 { + "120500 8 8.7 1488 & K1JT WA4CQG EM72 \n"}; + auto msk144Normalized = msk144.left(msk144.size() - 1); + addRow("real MSK144", msk144, legacyNormalized(msk144Normalized), + "MSK144", SpecOp::NONE, false, Disposition::Decode, + false, 0, false, 0.0f, false, 0, 0, decodeActions); + + QByteArray const fox = QByteArray {"060500 -10 0.3 1500 ~ "} + + QByteArray {"K1ABC RR73; W9XYZ -12"}.leftJustified(37, ' ') + " \n"; + addRow("FOX dual reply", fox, fox.left(fox.size() - 1), + "FT8", SpecOp::FOX, true, Disposition::Decode, + false, 0, false, 0.0f, false, 0, 0, + {"qsy", "fox-activity", "count", "all.txt"}); + + QByteArray const hound {"060500 -10 0.3 1500 ~ $VERIFY$ KH1DX 920749\n"}; + addRow("variable-length SuperFox Hound", hound, hound.left(hound.size() - 1), + "FT8", SpecOp::HOUND, false, Disposition::Decode, + false, 0, false, 0.0f, false, 0, 0, decodeActions); + + QByteArray const completion {" 0 14 0\n"}; + addRow("ordinary completion", completion, completion.left(completion.size() - 1), + "FT8", SpecOp::NONE, false, Disposition::Finish, + false, 0, false, 0.0f, true, 0, 0, finishActions); + + QByteArray const q65Completion {" 1 6 2003\n"}; + addRow("packed Q65 completion", q65Completion, + q65Completion.left(q65Completion.size() - 1), + "Q65", SpecOp::NONE, false, Disposition::Finish, + false, 0, false, 0.0f, true, 2, 3, finishActions); + + QByteArray const truncatedRecord {"060500 -20 0.3 1500\n"}; + addRow("truncated decode record", truncatedRecord, + truncatedRecord.left(truncatedRecord.size() - 1), + "FT8", SpecOp::NONE, false, Disposition::Decode, + false, 0, false, 0.0f, false, 0, 0, decodeActions); + + QByteArray const truncatedCompletion {"\n"}; + addRow("truncated completion", truncatedCompletion, + truncatedCompletion.left(truncatedCompletion.size() - 1), + "FT8", SpecOp::NONE, false, Disposition::Finish, + false, 0, false, 0.0f, false, 0, 0, finishActions); + } + + void wireFormatRegressionCorpus() + { + QFETCH(QByteArray, rawLine); + QFETCH(QByteArray, expectedNormalizedLine); + QFETCH(QString, mode); + QFETCH(int, specOp); + QFETCH(bool, activeStationsAvailable); + QFETCH(int, expectedDisposition); + QFETCH(bool, expectedAveraged); + QFETCH(int, expectedAverageCount); + QFETCH(bool, expectedFrequencySpread); + QFETCH(float, expectedSpread); + QFETCH(bool, expectedDecoded); + QFETCH(int, expectedSingleDecodes); + QFETCH(int, expectedAveragedDecodes); + QFETCH(QStringList, expectedActions); + + auto context = preparationContext(); + context.mode = mode; + context.specOp = static_cast(specOp); + context.activeStationsAvailable = activeStationsAvailable; + + auto const plan = DecodeOutputPlan::prepareLine(rawLine, context); + + QCOMPARE(plan.rawLine, rawLine); + QCOMPARE(plan.normalizedLine, expectedNormalizedLine); + QCOMPARE(static_cast(plan.disposition), expectedDisposition); + QVERIFY(plan.reason.isEmpty()); + if (expectedDisposition == static_cast(DecodeOutputPlan::LineDisposition::Decode)) { + QCOMPARE(plan.logicMessage.string(), plan.decodedForLogic); + } else { + QVERIFY(plan.logicMessage.string().isEmpty()); + } + QCOMPARE(plan.averaged, expectedAveraged); + QCOMPARE(plan.averageCount, expectedAverageCount); + QCOMPARE(plan.haveFrequencySpread, expectedFrequencySpread); + QCOMPARE(plan.frequencySpread, expectedSpread); + QCOMPARE(plan.batchHasDecodes, expectedDecoded); + QCOMPARE(plan.q65SingleDecodes, expectedSingleDecodes); + QCOMPARE(plan.q65AveragedDecodes, expectedAveragedDecodes); + QCOMPARE(actionNames(plan.actions), expectedActions); + } + + void validityRejectionMatrix_data() + { + QTest::addColumn("rawLine"); + QTest::addColumn("reduceFalseDecodes"); + QTest::addColumn("specOp"); + QTest::addColumn("diskData"); + QTest::addColumn("noA7Decodes"); + QTest::addColumn("expectedDisposition"); + QTest::addColumn("expectedReason"); + QTest::addColumn("expectedActions"); + + auto const decode = static_cast(DecodeOutputPlan::LineDisposition::Decode); + auto const ignore = static_cast(DecodeOutputPlan::LineDisposition::Ignore); + auto const none = static_cast(SpecOp::NONE); + auto const hound = static_cast(SpecOp::HOUND); + auto const fox = static_cast(SpecOp::FOX); + QStringList const acceptedActions {"qsy", "count", "all.txt"}; + QStringList const rejectedActions {"qsy"}; + + auto addRow = [&] (char const * name, QByteArray const& line, bool reduce, + int operation, bool disk, bool suppressA7, int disposition, + QString const& reason, QStringList const& actions) { + QTest::newRow(name) << line << reduce << operation << disk << suppressA7 + << disposition << reason << actions; + }; + + QString const suspiciousReason {"suspicious low-SNR decode rejected"}; + addRow("two hashes below -12", "060500 -13 0.3 1500 ~ R-10", + false, none, false, false, ignore, suspiciousReason, rejectedActions); + addRow("two portable calls below -12", "060500 -13 0.3 1500 ~ W1AW/P K1ABC/P R-10", + false, none, false, false, ignore, suspiciousReason, rejectedActions); + addRow("two rover calls below -12", "060500 -13 0.3 1500 ~ W1AW/R K1ABC/R R-10", + false, none, false, false, ignore, suspiciousReason, rejectedActions); + addRow("rover question below -12", "060500 -13 0.3 1500 ~ W1AW/R K1ABC ?", + false, none, false, false, ignore, suspiciousReason, rejectedActions); + addRow("semicolon report below -12", "060500 -13 0.3 1500 ~ W1AW; K1ABC R -10", + false, none, false, false, ignore, suspiciousReason, rejectedActions); + addRow("suspicious shape at -12", "060500 -12 0.3 1500 ~ R-10", + false, none, false, false, decode, {}, acceptedActions); + + QString const reduceReason {"reduce-false-decodes rule rejected line"}; + addRow("suspicious shape at -16 enabled", "060500 -16 0.3 1500 ~ ABCDEFGH K1ABC -10", + true, none, false, false, ignore, reduceReason, rejectedActions); + addRow("suspicious shape at -16 disabled", "060500 -16 0.3 1500 ~ ABCDEFGH K1ABC -10", + false, none, false, false, decode, {}, acceptedActions); + addRow("suspicious shape at -15", "060500 -15 0.3 1500 ~ ABCDEFGH K1ABC -10", + true, none, false, false, decode, {}, acceptedActions); + addRow("rover report at -18", "060500 -18 0.3 1500 ~ W1AW/R K1ABC -10", + true, none, false, false, decode, {}, acceptedActions); + addRow("rover report below -18", "060500 -19 0.3 1500 ~ W1AW/R K1ABC -10", + true, none, false, false, ignore, reduceReason, rejectedActions); + addRow("3-dot timing shape at -15", "060500 -15 3.1 1500 ~ CQ W1AW FN31", + true, none, false, false, decode, {}, acceptedActions); + addRow("2-dot timing shape below -15", "060500 -16 2.1 1500 ~ CQ W1AW FN31", + true, none, false, false, ignore, reduceReason, rejectedActions); + addRow("3-dot timing shape at -20", "060500 -20 3.1 1500 ~ CQ W1AW FN31", + true, none, false, false, ignore, reduceReason, rejectedActions); + addRow("2-dot timing shape below -20", "060500 -21 2.1 1500 ~ CQ W1AW FN31", + true, none, false, false, ignore, reduceReason, rejectedActions); + + addRow("ordinary low-SNR CQ", "060500 -24 0.3 1500 ~ CQ W1AW FN31", + true, none, false, false, decode, {}, acceptedActions); + addRow("ordinary low-SNR direct report", "060500 -24 0.3 1500 ~ K1ABC W1AW -10", + true, none, false, false, decode, {}, acceptedActions); + addRow("hound bypasses suspicious low-SNR", "060500 -24 0.3 1500 ~ R-10", + false, hound, false, false, decode, {}, acceptedActions); + addRow("hound bypasses reduce false decodes", "060500 -24 0.3 1500 ~ ABCDEFGH K1ABC -10", + true, hound, false, false, decode, {}, acceptedActions); + + QString const a7Reason {"a7 decode rejected"}; + addRow("a7 suppression", "060500 -10 0.3 1500 ~ W1AW K1ABC -10 a7", + false, none, false, true, ignore, a7Reason, rejectedActions); + addRow("disk data bypasses a7 suppression", "060500 -10 0.3 1500 ~ W1AW K1ABC -10 a7", + false, none, true, true, decode, {}, acceptedActions); + addRow("special operation CQ a7 exemption", "060500 -10 0.3 1500 ~ CQ W1AW FN31 a7", + false, fox, false, false, decode, {}, acceptedActions); + addRow("special operation R a7 exemption", "060500 -10 0.3 1500 ~ W1AW K1ABC R -10 a7", + false, fox, false, false, decode, {}, acceptedActions); + addRow("special operation RR73 a7 exemption", "060500 -10 0.3 1500 ~ W1AW K1ABC RR73 a7", + false, fox, false, false, decode, {}, acceptedActions); + } + + void validityRejectionMatrix() + { + QFETCH(QByteArray, rawLine); + QFETCH(bool, reduceFalseDecodes); + QFETCH(int, specOp); + QFETCH(bool, diskData); + QFETCH(bool, noA7Decodes); + QFETCH(int, expectedDisposition); + QFETCH(QString, expectedReason); + QFETCH(QStringList, expectedActions); + + auto context = preparationContext(); + context.reduceFalseDecodes = reduceFalseDecodes; + context.specOp = static_cast(specOp); + context.diskData = diskData; + context.noA7Decodes = noA7Decodes; + + auto const plan = DecodeOutputPlan::prepareLine(rawLine, context); + + QCOMPARE(static_cast(plan.disposition), expectedDisposition); + QCOMPARE(plan.reason, expectedReason); + QCOMPARE(actionNames(plan.actions), expectedActions); + } + + void preparationActionInvariants_data() + { + QTest::addColumn("rawLine"); + QTest::addColumn("mode"); + QTest::addColumn("specOp"); + QTest::addColumn("activeStationsAvailable"); + QTest::addColumn("noA7Decodes"); + QTest::addColumn("noOwnCall"); + QTest::addColumn("displayPoints"); + QTest::addColumn("expectedDisposition"); + QTest::addColumn("expectedEarlyActions"); + QTest::addColumn("expectedUpdate"); + + auto addRow = [] (char const * name, QByteArray const& rawLine, QString const& mode, + SpecOp specOp, bool activeStationsAvailable, bool noA7Decodes, + bool noOwnCall, bool displayPoints, + DecodeOutputPlan::LineDisposition disposition, + QStringList const& earlyActions, bool update = false) { + QTest::newRow(name) << rawLine << mode << static_cast(specOp) + << activeStationsAvailable << noA7Decodes << noOwnCall + << displayPoints << static_cast(disposition) + << earlyActions << update; + }; + + using Disposition = DecodeOutputPlan::LineDisposition; + addRow("ignored false decode", "060500 -13 0.3 1500 ~ R-10\n", + "FT8", SpecOp::NONE, false, false, false, false, + Disposition::Ignore, {"qsy"}); + addRow("rejected FOX a7 retains early actions", + "060500 -10 0.3 1500 ~ W1AW K1ABC -10 a7\n", + "FT8", SpecOp::FOX, true, true, false, false, + Disposition::Ignore, {"qsy", "fox-activity"}); + addRow("decode completion", " 1 6 2003\n", + "FT8", SpecOp::NONE, false, false, false, false, + Disposition::Finish, {"qsy"}); + addRow("FST4W completion", " 0 0 0\n", + "FST4W", SpecOp::NONE, false, false, false, false, + Disposition::Finish, {"qsy"}); + addRow("ignored FST4W own call", "060500 -10 0.3 1500 ` CQ K1ABC FN31\n", + "FST4W", SpecOp::NONE, false, false, true, false, + Disposition::Ignore, {"qsy"}); + addRow("accepted FST4W ordinary decode", "060500 -10 0.3 1500 ` CQ W1AW FN31\n", + "FST4W", SpecOp::NONE, false, false, false, false, + Disposition::Decode, {"qsy"}); + addRow("accepted FT8 display-points update", "060500 -10 0.3 1500 ~ CQ W1AW FN31\n", + "FT8", SpecOp::NONE, false, false, false, true, + Disposition::Decode, {"qsy"}, true); + } + + void preparationActionInvariants() + { + QFETCH(QByteArray, rawLine); + QFETCH(QString, mode); + QFETCH(int, specOp); + QFETCH(bool, activeStationsAvailable); + QFETCH(bool, noA7Decodes); + QFETCH(bool, noOwnCall); + QFETCH(bool, displayPoints); + QFETCH(int, expectedDisposition); + QFETCH(QStringList, expectedEarlyActions); + QFETCH(bool, expectedUpdate); + + auto context = preparationContext(); + context.mode = mode; + context.specOp = static_cast(specOp); + context.activeStationsAvailable = activeStationsAvailable; + context.noA7Decodes = noA7Decodes; + context.noOwnCall = noOwnCall; + context.displayPoints = displayPoints; + + auto const plan = DecodeOutputPlan::prepareLine(rawLine, context); + auto const names = actionNames(plan.actions); + QStringList earlyActions; + for (auto const& action : plan.actions) { + if (action.kind == ActionKind::ShowQsyMessage + || action.kind == ActionKind::AccumulateFoxActivity) { + earlyActions.append(actionName(action.kind)); + QCOMPARE(action.text, QString {rawLine}); + } + } + + bool const accepted = expectedDisposition + == static_cast(DecodeOutputPlan::LineDisposition::Decode); + QCOMPARE(static_cast(plan.disposition), expectedDisposition); + QCOMPARE(earlyActions, expectedEarlyActions); + QCOMPARE(names.count("count"), accepted ? 1 : 0); + QCOMPARE(names.count("all.txt"), accepted ? 1 : 0); + QCOMPARE(names.count("wspr"), accepted && mode == "FST4W" ? 1 : 0); + QCOMPARE(names.count("arrl"), expectedUpdate ? 1 : 0); + QVERIFY(!names.contains("flush-fox")); + } + + void retainsRawFoxActivityBeforeRejectedA7Decode() + { + auto context = preparationContext(); + context.specOp = SpecOp::FOX; + context.activeStationsAvailable = true; + context.noA7Decodes = true; + QByteArray const rawLine {"060500 -20 0.3 1500 ~ CQ W1AW FN31 a7\n"}; + + auto const plan = DecodeOutputPlan::prepareLine(rawLine, context); + + QCOMPARE(plan.disposition, DecodeOutputPlan::LineDisposition::Ignore); + QCOMPARE(plan.reason, QString {"a7 decode rejected"}); + QCOMPARE(actionNames(plan.actions), QStringList({"qsy", "fox-activity"})); + } + + void displayPointsRemovesA7BeforeFalseDecodeClassification() + { + auto context = preparationContext(); + context.displayPoints = true; + context.noA7Decodes = true; + QByteArray const line {"060500 -20 0.3 1500 ~ CQ W1AW FN31 a7"}; + + auto const plan = DecodeOutputPlan::prepareLine(line, context); + + QCOMPARE(plan.disposition, DecodeOutputPlan::LineDisposition::Decode); + QVERIFY(!plan.normalizedLine.contains("a7")); + } + + void wantedOnlyFoxActivityRetainsRawNewline() + { + auto context = preparationContext(); + context.specOp = SpecOp::FOX; + context.activeStationsAvailable = true; + context.activeStationsWantedOnly = true; + QByteArray const line {"060500 -10 0.3 1500 ~ W1AW K1ABC -10\n"}; + + auto const plan = DecodeOutputPlan::prepareLine(line, context); + + QCOMPARE(actionNames(plan.actions).first(), QString {"qsy"}); + QCOMPARE(actionNames(plan.actions).at(1), QString {"fox-activity"}); + QCOMPARE(plan.actions.at(1).text, QString {line}); + } + + void ignoresFst4wOwnCallAfterQsyInspection() + { + auto context = preparationContext(); + context.mode = "FST4W"; + context.noOwnCall = true; + QByteArray const rawLine {"060500 -10 0.3 1500 ` CQ K1ABC FN31\n"}; + + auto const plan = DecodeOutputPlan::prepareLine(rawLine, context); + + QCOMPARE(plan.disposition, DecodeOutputPlan::LineDisposition::Ignore); + QCOMPARE(actionNames(plan.actions), QStringList({"qsy"})); + } + + void legacyPaddingDoesNotChangeDecodedRepresentations() + { + auto context = preparationContext(); + context.mode = "JT65"; + QByteArray const line { + "0605 -10 0.3 1500 # TU; K1ABC W1AW R-10 "}; + + auto const plan = DecodeOutputPlan::prepareLine(line, context); + + QCOMPARE(plan.normalizedLine.size(), line.size() + 14); + QCOMPARE(plan.decodedOriginal, QString {line}); + QVERIFY(plan.decodedOriginal.contains("TU; ")); + QVERIFY(!plan.decodedForLogic.contains("TU; ")); + QCOMPARE(plan.logicMessage.string(), plan.decodedForLogic); + } + + void rejectsEarlyDuplicateBeforeLogging() + { + auto context = preparationContext(); + context.nominalFrequency = 50313000; + QByteArray const line {"060500 -20 0.3 1500 ~ CQ W1AW FN31"}; + context.earlyDecodes = QString::fromUtf8(line.mid(23, 19)); + + auto const plan = DecodeOutputPlan::prepareLine(line, context); + + QCOMPARE(plan.disposition, DecodeOutputPlan::LineDisposition::Ignore); + QCOMPARE(plan.reason, QString {"early duplicate rejected"}); + QCOMPARE(actionNames(plan.actions), QStringList({"qsy"})); + } + + void shortLineIsNotAnEarlyDuplicate() + { + auto context = preparationContext(); + context.nominalFrequency = 50313000; + context.earlyDecodes = "060500 -20 0.3 1500 ~ CQ W1AW FN31"; + QByteArray const line {"060500 -20 0.3 1500"}; + + auto const plan = DecodeOutputPlan::prepareLine(line, context); + + QCOMPARE(plan.disposition, DecodeOutputPlan::LineDisposition::Decode); + } + + void decodeFinishedIsDetectedBeforeDuplicateRejection() + { + auto context = preparationContext(); + context.nominalFrequency = 50313000; + QByteArray const line {" 1 6 2003"}; + context.earlyDecodes = QString::fromUtf8(line); + + auto const plan = DecodeOutputPlan::prepareLine(line, context); + + QCOMPARE(plan.disposition, DecodeOutputPlan::LineDisposition::Finish); + QVERIFY(plan.batchHasDecodes); + } + + void parsesAveragingMarkers_data() + { + QTest::addColumn("line"); + QTest::addColumn("count"); + QTest::newRow("f2") << QByteArray {"0605 -10 0.3 1500 # K1ABC W1AW R-10 f2"} << 2; + QTest::newRow("f-star") << QByteArray {"0605 -10 0.3 1500 # K1ABC W1AW R-10 f*"} << 10; + QTest::newRow("d2") << QByteArray {"0605 -10 0.3 1500 # K1ABC W1AW R-10 d 2"} << 2; + QTest::newRow("a2") << QByteArray {"0605 -10 0.3 1500 # K1ABC W1AW R-10 a 2"} << 2; + QTest::newRow("q2") << QByteArray {"0605 -10 0.3 1500 # K1ABC W1AW R-10 q 2"} << 2; + } + + void parsesAveragingMarkers() + { + QFETCH(QByteArray, line); + QFETCH(int, count); + auto context = preparationContext(); + context.mode = "JT65"; + + auto const plan = DecodeOutputPlan::prepareLine(line, context); + + QVERIFY(plan.averaged); + QCOMPARE(plan.averageCount, count); + } + + void decodeFinishedWireFormats_data() + { + QTest::addColumn("line"); + QTest::addColumn("decoded"); + QTest::addColumn("singleDecodes"); + QTest::addColumn("averagedDecodes"); + + QTest::newRow("ft8 fixture") + << QByteArray {" 0 14 0"} << true << 0 << 0; + QTest::newRow("jt9 fixture") + << QByteArray {" 0 6 0"} << true << 0 << 0; + QTest::newRow("msk144 no messages") + << QByteArray {" 0 0 0"} << false << 0 << 0; + QTest::newRow("q65 packed counts") + << QByteArray {" 1 6 2003"} << true << 2 << 3; + } + + void decodeFinishedWireFormats() + { + QFETCH(QByteArray, line); + QFETCH(bool, decoded); + QFETCH(int, singleDecodes); + QFETCH(int, averagedDecodes); + + auto const plan = DecodeOutputPlan::prepareLine(line, preparationContext()); + + QCOMPARE(plan.disposition, DecodeOutputPlan::LineDisposition::Finish); + QCOMPARE(plan.batchHasDecodes, decoded); + QCOMPARE(plan.q65SingleDecodes, singleDecodes); + QCOMPARE(plan.q65AveragedDecodes, averagedDecodes); + QCOMPARE(actionNames(plan.actions), QStringList({"qsy"})); + } + + void blacklistCanRejectOrContinueWithScoreReset() + { + DecodedText const message {"060500 -10 0.3 1500 ~ CQ W1AW FN31"}; + DecodeOutputPlan::KeywordFilterContext context; + context.mode = "FT8"; + context.blacklistEnabled = true; + context.blacklistKeywords = QStringList {"W1AW"}; + + auto decision = DecodeOutputPlan::decideKeywordFilter(message, context); + QVERIFY(decision.filtered); + QVERIFY(!decision.continueProcessing); + QVERIFY(!decision.resetPounceScores); + + context.waitAndPounceOnly = true; + context.pounce = true; + context.respondPolicy = AutoRespondPolicy::MaxDistance; + decision = DecodeOutputPlan::decideKeywordFilter(message, context); + QVERIFY(decision.filtered); + QVERIFY(decision.continueProcessing); + QVERIFY(decision.resetPounceScores); + } + + void filterPrecedenceMatrix_data() + { + QTest::addColumn("options"); + QTest::addColumn("expectedOutcomes"); + QTest::addColumn("expectedKeywordReason"); + QTest::addColumn("expectedVisibilityReason"); + + auto addRow = [] (char const * name, int options, int outcomes, + QString const& keywordReason = {}, + QString const& visibilityReason = {}) { + QTest::newRow(name) << options << outcomes << keywordReason << visibilityReason; + }; + + addRow("baseline", 0, ContinueProcessing | DisplayLeft); + addRow("blacklist rejects message", Blacklist, KeywordFiltered | FinallyFiltered, + "blacklist matched"); + addRow("whitelist miss rejects message", Whitelist, KeywordFiltered | FinallyFiltered, + "whitelist did not match"); + addRow("blacklist precedes whitelist", Blacklist | Whitelist, + KeywordFiltered | FinallyFiltered, "blacklist matched"); + addRow("always-pass precedes keyword lists", AlwaysPass | Blacklist | Whitelist, + ContinueProcessing | AlwaysPassed | DisplayLeft); + addRow("always-pass preserves earlier filter", InitiallyFiltered | AlwaysPass | Blacklist, + KeywordFiltered | FinallyFiltered | ContinueProcessing | AlwaysPassed); + addRow("always-pass does not bypass ignore list", AlwaysPass | HideIgnored, + FinallyFiltered | ContinueProcessing | AlwaysPassed, {}, "ignore-list filter"); + addRow("always-pass does not bypass worked-today", AlwaysPass | HideWorkedToday, + FinallyFiltered | ContinueProcessing | AlwaysPassed, {}, "recently-worked filter"); + addRow("bypass suppresses all filters but resets scoring pounce", + Blacklist | Whitelist | Bypass | ScoringPounce | HideIgnored | HideWorkedToday, + ContinueProcessing | ResetPounceScores | DisplayLeft, "blacklist matched"); + addRow("wait-and-pounce filter continues and displays", + Blacklist | WaitAndPounceOnly | ScoringPounce, + KeywordFiltered | FinallyFiltered | ContinueProcessing | ResetPounceScores | DisplayLeft, + "blacklist matched"); + addRow("non-scoring pounce does not reset", Blacklist | WaitAndPounceOnly | NonScoringPounce, + KeywordFiltered | FinallyFiltered | ContinueProcessing | DisplayLeft, + "blacklist matched"); + addRow("rejected message does not reset scoring pounce", Blacklist | ScoringPounce, + KeywordFiltered | FinallyFiltered, "blacklist matched"); + } + + void filterPrecedenceMatrix() + { + QFETCH(int, options); + QFETCH(int, expectedOutcomes); + QFETCH(QString, expectedKeywordReason); + QFETCH(QString, expectedVisibilityReason); + + DecodedText const message {"060500 -10 0.3 1500 ~ CQ W1AW FN31"}; + DecodeOutputPlan::KeywordFilterContext keywordContext; + keywordContext.mode = "FT8"; + keywordContext.alreadyFiltered = options & InitiallyFiltered; + keywordContext.alwaysPass = options & AlwaysPass; + keywordContext.passKeywords = QStringList {"W1AW"}; + keywordContext.blacklistEnabled = options & Blacklist; + keywordContext.blacklistKeywords = QStringList {"W1AW"}; + keywordContext.whitelistEnabled = options & Whitelist; + keywordContext.whitelistKeywords = QStringList {"K9XYZ"}; + keywordContext.bypass = options & Bypass; + keywordContext.waitAndPounceOnly = options & WaitAndPounceOnly; + keywordContext.pounce = options & (ScoringPounce | NonScoringPounce); + keywordContext.respondPolicy = options & ScoringPounce + ? AutoRespondPolicy::MaxDistance : AutoRespondPolicy::First; + + auto const keywordDecision = DecodeOutputPlan::decideKeywordFilter(message, keywordContext); + bool finalFiltered = keywordDecision.filtered; + QString visibilityReason; + if (keywordDecision.continueProcessing) { + DecodeOutputPlan::VisibilityFilterContext visibilityContext; + visibilityContext.alreadyFiltered = finalFiltered; + visibilityContext.alwaysPassed = keywordDecision.alwaysPassed; + visibilityContext.bypass = keywordContext.bypass; + visibilityContext.hideIgnored = options & HideIgnored; + visibilityContext.ignoreList = "W1AW,"; + visibilityContext.hideWorkedToday = options & HideWorkedToday; + visibilityContext.today = "2026-07-11"; + visibilityContext.txLog = "2026-07-11,12:34:56,W1AW,FN31"; + auto const visibilityDecision = DecodeOutputPlan::decideVisibilityFilter(message, + visibilityContext); + finalFiltered = visibilityDecision.filtered; + visibilityReason = visibilityDecision.reason; + } + bool const displayLeft = keywordDecision.continueProcessing + && DecodeOutputPlan::shouldDisplayLeft(false, "FT8", SpecOp::NONE, finalFiltered, + keywordContext.waitAndPounceOnly); + + QCOMPARE(keywordDecision.filtered, bool(expectedOutcomes & KeywordFiltered)); + QCOMPARE(finalFiltered, bool(expectedOutcomes & FinallyFiltered)); + QCOMPARE(keywordDecision.continueProcessing, bool(expectedOutcomes & ContinueProcessing)); + QCOMPARE(keywordDecision.alwaysPassed, bool(expectedOutcomes & AlwaysPassed)); + QCOMPARE(keywordDecision.resetPounceScores, bool(expectedOutcomes & ResetPounceScores)); + QCOMPARE(keywordDecision.reason, expectedKeywordReason); + QCOMPARE(visibilityReason, expectedVisibilityReason); + QCOMPARE(displayLeft, bool(expectedOutcomes & DisplayLeft)); + } + + void wordFilterUsesConfiguredSecondPayloadWord() + { + DecodedText const message {"060500 -10 0.3 1500 ~ CQ DX W1AW FN31"}; + DecodeOutputPlan::KeywordFilterContext context; + context.mode = "FT8"; + context.filterBySecondWord = true; + context.blacklistEnabled = true; + context.blacklistKeywords = QStringList {"W1AW"}; + + auto const decision = DecodeOutputPlan::decideKeywordFilter(message, context); + + QCOMPARE(decision.selectedWord, QString {"W1AW"}); + QVERIFY(decision.filtered); + QVERIFY(!decision.continueProcessing); + } + + void alwaysPassSkipsGeographyLookupButNotIgnoreList() + { + DecodedText const message {"060500 -10 0.3 1500 ~ CQ W1AW FN31"}; + DecodeOutputPlan::VisibilityFilterContext context; + context.alwaysPassed = true; + context.hideEurope = true; + int continentLookups = 0; + context.continent = [&continentLookups] (QString const&) { + ++continentLookups; + return QString {"EU"}; + }; + + auto decision = DecodeOutputPlan::decideVisibilityFilter(message, context); + QVERIFY(!decision.filtered); + QCOMPARE(continentLookups, 0); + + context.hideIgnored = true; + context.ignoreList = "W1AW,"; + decision = DecodeOutputPlan::decideVisibilityFilter(message, context); + QVERIFY(decision.filtered); + QCOMPARE(decision.reason, QString {"ignore-list filter"}); + QCOMPARE(continentLookups, 0); + } + + void geographyAndRecentLogFiltersAreCharacterized() + { + DecodedText const message {"060500 -10 0.3 1500 ~ CQ W1AW FN31"}; + DecodeOutputPlan::VisibilityFilterContext context; + context.hideEurope = true; + context.continent = [] (QString const&) { return QString {"EU"}; }; + + auto decision = DecodeOutputPlan::decideVisibilityFilter(message, context); + QVERIFY(decision.filtered); + QCOMPARE(decision.reason, QString {"geography or worked-before filter"}); + + context = DecodeOutputPlan::VisibilityFilterContext {}; + context.hideWorkedToday = true; + context.today = "2026-07-11"; + context.yesterday = "2026-07-10"; + context.txLog = "2026-07-11,12:34:56,W1AW,FN31"; + decision = DecodeOutputPlan::decideVisibilityFilter(message, context); + QVERIFY(decision.filtered); + QCOMPARE(decision.reason, QString {"recently-worked filter"}); + } + + void workedBeforeLookupRunsOnlyWhenEnabled() + { + DecodedText const message {"060500 -10 0.3 1500 ~ CQ W1AW FN31"}; + DecodeOutputPlan::VisibilityFilterContext context; + int lookups = 0; + context.workedBeforeOnBand = [&lookups] (QString const&, QString const&) { + ++lookups; + return true; + }; + + auto decision = DecodeOutputPlan::decideVisibilityFilter(message, context); + QVERIFY(!decision.filtered); + QCOMPARE(lookups, 0); + + context.hideWorkedBefore = true; + decision = DecodeOutputPlan::decideVisibilityFilter(message, context); + QVERIFY(decision.filtered); + QCOMPARE(lookups, 1); + } + + void experimentalFilterMarksUnknownLowSnrPayload() + { + DecodedText const message {"060500 -24 0.3 1500 ~ BADWORD OTHER TEXT"}; + DecodeOutputPlan::ExperimentalFilterContext context; + context.mode = "FT8"; + context.reduceFalseDecodes = true; + context.allCallsigns = "W1AW K1ABC"; + + auto const decision = DecodeOutputPlan::decideExperimentalFilter(message, context); + + QVERIFY(decision.filtered); + QVERIFY(!decision.reason.isEmpty()); + } + + void routesNearDecodeToRightWindow() + { + DecodedText const message {"060500 -10 0.3 1500 ~ CQ W1AW FN31"}; + auto context = routingContext(); + + auto const decision = DecodeOutputPlan::decideRouting(message, message, false, context); + + QVERIFY(decision.displayRight); + } + + void farDecodeDoesNotRouteRight() + { + DecodedText const message {"060500 -10 0.3 1900 ~ CQ W1AW FN31"}; + auto context = routingContext(); + + auto const decision = DecodeOutputPlan::decideRouting(message, message, false, context); + + QVERIFY(!decision.displayRight); + } + + void currentQsoPairRoutingRequiresConfiguredCalls_data() + { + QTest::addColumn("line"); + QTest::addColumn("mode"); + QTest::addColumn("baseCall"); + QTest::addColumn("hisCall"); + QTest::addColumn("displayRight"); + + QTest::newRow("FT8 with empty calls") + << QString {"060500 -10 0.3 1900 ~ CQ W9XYZ EN50"} << QString {"FT8"} + << QString {} << QString {} << false; + QTest::newRow("FT4 with empty calls") + << QString {"060500 -10 0.3 1900 + CQ W9XYZ EN50"} << QString {"FT4"} + << QString {} << QString {} << false; + QTest::newRow("empty local call") + << QString {"060500 -10 0.3 1900 ~ CQ W1AW FN31"} << QString {"FT8"} + << QString {} << QString {"W1AW"} << false; + QTest::newRow("empty QSO partner") + << QString {"060500 -10 0.3 1900 ~ CQ K1ABC FN42"} << QString {"FT8"} + << QString {"K1ABC"} << QString {} << false; + QTest::newRow("configured FT8 QSO pair") + << QString {"060500 -10 0.3 1900 ~ CQ K1ABC W1AW"} << QString {"FT8"} + << QString {"K1ABC"} << QString {"W1AW"} << true; + QTest::newRow("configured FT4 QSO pair") + << QString {"060500 -10 0.3 1900 + CQ K1ABC W1AW"} << QString {"FT4"} + << QString {"K1ABC"} << QString {"W1AW"} << true; + } + + void currentQsoPairRoutingRequiresConfiguredCalls() + { + QFETCH(QString, line); + QFETCH(QString, mode); + QFETCH(QString, baseCall); + QFETCH(QString, hisCall); + QFETCH(bool, displayRight); + + DecodedText const message {line}; + auto context = routingContext(); + context.mode = mode; + context.baseCall = baseCall; + context.myCall = baseCall; + context.hisCall = hisCall; + + auto const decision = DecodeOutputPlan::decideRouting(message, message, false, context); + + QCOMPARE(decision.displayRight, displayRight); + } + + void routesAveragedQ65ToRight() + { + DecodedText const message {"060500 -10 0.3 1500 : K1ABC W1AW R-10"}; + auto context = routingContext(); + context.mode = "Q65"; + + auto const decision = DecodeOutputPlan::decideRouting(message, message, true, context); + + QVERIFY(decision.displayRight); + } + + void blockedRightDisplayOverridesRouting() + { + DecodedText const message {"060500 -10 0.3 1500 ~ CQ W1AW FN31"}; + auto context = routingContext(); + context.blockRightDisplay = true; + + auto const decision = DecodeOutputPlan::decideRouting(message, message, false, context); + + QVERIFY(!decision.displayRight); + } + + void houndNotForUsDoesNotRouteRight() + { + DecodedText const message {"060500 -10 0.3 1500 ~ CQ W1AW FN31"}; + auto context = routingContext(); + context.specOp = SpecOp::HOUND; + context.wideGraphRxFrequency = 2000; + + auto const decision = DecodeOutputPlan::decideRouting(message, message, false, context); + + QVERIFY(!decision.displayRight); + } + + void routingOperatorIntentMatrix_data() + { + QTest::addColumn("line"); + QTest::addColumn("mode"); + QTest::addColumn("specOp"); + QTest::addColumn("myCall"); + QTest::addColumn("baseCall"); + QTest::addColumn("hisCall"); + QTest::addColumn("rxFrequency"); + QTest::addColumn("wideGraphRxFrequency"); + QTest::addColumn("averaged"); + QTest::addColumn("enableVhfFeatures"); + QTest::addColumn("expectedForUs"); + QTest::addColumn("expectedDisplayRight"); + + auto addRow = [] (char const * name, QString const& line, QString const& mode, + SpecOp specOp, QString const& myCall, QString const& baseCall, + QString const& hisCall, int rxFrequency, int wideGraphRxFrequency, + bool averaged, bool enableVhfFeatures, bool forUs, bool displayRight) { + QTest::newRow(name) << line << mode << static_cast(specOp) << myCall << baseCall + << hisCall << rxFrequency << wideGraphRxFrequency << averaged + << enableVhfFeatures << forUs << displayRight; + }; + + addRow("compound local call does not claim base-call match", + "060500 -10 0.3 1900 ~ K1ABC/R W1AW R-10", "FT8", SpecOp::NONE, + "K1ABC/P", "K1ABC", "W1AW", 1500, 1500, false, false, false, false); + addRow("FT8 base-call and DX-call pair routes", + "060500 -10 0.3 1900 ~ CQ K1ABC W1AW", "FT8", SpecOp::NONE, + "K1ABC", "K1ABC", "W1AW", 1500, 1500, false, false, false, true); + addRow("FT4 base-call and DX-call pair routes", + "060500 -10 0.3 1900 + CQ K1ABC W1AW", "FT4", SpecOp::NONE, + "K1ABC", "K1ABC", "W1AW", 1500, 1500, false, false, false, true); + addRow("unaveraged Q65 not for operator stays out", + "060500 -10 0.3 1500 : W9XYZ W1AW R-10", "Q65", SpecOp::NONE, + "K1ABC", "K1ABC", "W1AW", 1500, 1500, false, false, false, false); + addRow("near JT65 routes without VHF features", + "060500 -10 0.3 1505 # CQ W1AW FN31", "JT65", SpecOp::NONE, + "K1ABC", "K1ABC", "W1AW", 1500, 1500, false, false, false, true); + addRow("near JT65 stays out with VHF features", + "060500 -10 0.3 1505 # CQ W1AW FN31", "JT65", SpecOp::NONE, + "K1ABC", "K1ABC", "W1AW", 1500, 1500, false, true, false, false); + addRow("FOX treats DE report as for operator", + "060500 -10 0.3 1900 ~ DE W1AW R-10", "FT8", SpecOp::FOX, + "K1ABC", "K1ABC", "W1AW", 1500, 1500, false, false, true, true); + addRow("Hound suppresses near decode not for operator", + "060500 -10 0.3 1500 ~ W9XYZ W1AW R-10", "FT8", SpecOp::HOUND, + "K1ABC", "K1ABC", "W1AW", 1500, 1500, false, false, false, false); + addRow("Hound retains decode for operator", + "060500 -10 0.3 1900 ~ K1ABC W1AW R-10", "FT8", SpecOp::HOUND, + "K1ABC", "K1ABC", "W1AW", 1500, 1500, false, false, true, true); + } + + void routingOperatorIntentMatrix() + { + QFETCH(QString, line); + QFETCH(QString, mode); + QFETCH(int, specOp); + QFETCH(QString, myCall); + QFETCH(QString, baseCall); + QFETCH(QString, hisCall); + QFETCH(int, rxFrequency); + QFETCH(int, wideGraphRxFrequency); + QFETCH(bool, averaged); + QFETCH(bool, enableVhfFeatures); + QFETCH(bool, expectedForUs); + QFETCH(bool, expectedDisplayRight); + + DecodedText const message {line}; + auto context = routingContext(); + context.mode = mode; + context.specOp = static_cast(specOp); + context.myCall = myCall; + context.baseCall = baseCall; + context.hisCall = hisCall; + context.rxFrequency = rxFrequency; + context.wideGraphRxFrequency = wideGraphRxFrequency; + context.enableVhfFeatures = enableVhfFeatures; + + auto const decision = DecodeOutputPlan::decideRouting(message, message, averaged, context); + + QCOMPARE(decision.forUs, expectedForUs); + QCOMPARE(decision.displayRight, expectedDisplayRight); + } + + void foxReportRequiresStandaloneReportToken_data() + { + QTest::addColumn("line"); + QTest::addColumn("displayRight"); + QTest::newRow("report") + << QString {"060500 -10 0.3 1900 ~ K1ABC W1AW R-10"} << true; + QTest::newRow("embedded-report-shape") + << QString {"060500 -10 0.3 1900 ~ K1ABC W1AW XR-10"} << false; + } + + void foxReportRequiresStandaloneReportToken() + { + QFETCH(QString, line); + QFETCH(bool, displayRight); + DecodedText const message {line}; + auto context = routingContext(); + context.specOp = SpecOp::FOX; + + auto const decision = DecodeOutputPlan::decideRouting(message, message, false, context); + + QCOMPARE(decision.displayRight, displayRight); + } + + void competingFoxAlertRequiresFullyFormedDecode_data() + { + QTest::addColumn("line"); + QTest::addColumn("competing"); + QTest::newRow("short-free-text-report") + << QString {"060500 -10 0.3 950 ~ R-10"} << false; + QTest::newRow("other-hound-report") + << QString {"060500 -10 0.3 950 ~ K1XYZ W9AAA R-10"} << true; + QTest::newRow("for-us-report") + << QString {"060500 -10 0.3 950 ~ K1ABC W9AAA R-10"} << false; + QTest::newRow("above-fox-band") + << QString {"060500 -10 0.3 1500 ~ K1XYZ W9AAA R-10"} << false; + } + + void competingFoxAlertRequiresFullyFormedDecode() + { + QFETCH(QString, line); + QFETCH(bool, competing); + DecodedText const message {line}; + auto context = routingContext(); + context.specOp = SpecOp::FOX; + + auto const decision = DecodeOutputPlan::decideRouting(message, message, false, context); + + QCOMPARE(decision.competingFoxReport, competing); + } + + void safelyMalformedDecodeDoesNotRouteRight() + { + DecodedText const message {"malformed"}; + auto context = routingContext(); + + auto const decision = DecodeOutputPlan::decideRouting(message, message, false, context); + + QVERIFY(!decision.displayRight); + QVERIFY(!decision.forUs); + } + + void displayLeftSkipsAveragedFoxAndFilteredLines() + { + using DecodeOutputPlan::shouldDisplayLeft; + QVERIFY(shouldDisplayLeft(false, "FT8", SpecOp::NONE, false, false)); + QVERIFY(!shouldDisplayLeft(true, "FT8", SpecOp::NONE, false, false)); + QVERIFY(!shouldDisplayLeft(false, "FT8", SpecOp::FOX, false, false)); + QVERIFY(!shouldDisplayLeft(false, "FT8", SpecOp::NONE, true, false)); + QVERIFY(shouldDisplayLeft(false, "FT8", SpecOp::NONE, true, true)); + } + + void pskPostingRequiresStandardMessageOutsideHoundMode() + { + using DecodeOutputPlan::shouldPostPsk; + QVERIFY(shouldPostPsk("FT8", SpecOp::NONE, false, true, true)); + QVERIFY(!shouldPostPsk("FT8", SpecOp::NONE, false, true, false)); + QVERIFY(!shouldPostPsk("FT8", SpecOp::NONE, false, false, true)); + QVERIFY(!shouldPostPsk("FT8", SpecOp::HOUND, false, true, true)); + QVERIFY(shouldPostPsk("FT8", SpecOp::HOUND, true, true, true)); + QVERIFY(shouldPostPsk("FST4W", SpecOp::NONE, false, false, true)); + } + + void flushesFoxActivityOnlyForFoxBatch() + { + auto const actions = DecodeOutputPlan::finishBatchActions("FT8", SpecOp::FOX, + true, "one\ntwo\n"); + QCOMPARE(actionNames(actions), QStringList({"flush-fox"})); + QCOMPARE(actions[0].text, QString {"one\ntwo\n"}); + QVERIFY(DecodeOutputPlan::finishBatchActions("FT8", SpecOp::NONE, + true, "one\n").isEmpty()); + } +}; + +QTEST_MAIN(TestDecodeOutputPlan) +#include "test_decode_output_plan.moc" diff --git a/tests/unit/common/test_decoded_message_fields.cpp b/tests/unit/common/test_decoded_message_fields.cpp new file mode 100644 index 00000000..5b12da63 --- /dev/null +++ b/tests/unit/common/test_decoded_message_fields.cpp @@ -0,0 +1,58 @@ +#include + +#include "Decoder/decodedtext.h" + +class TestDecodedMessageFields final : public QObject +{ + Q_OBJECT + +private slots: + void parsesMessage_data(); + void parsesMessage(); +}; + +void TestDecodedMessageFields::parsesMessage_data() +{ + QTest::addColumn ("message"); + QTest::addColumn ("destination"); + QTest::addColumn ("sender"); + QTest::addColumn ("grid"); + QTest::addColumn ("cq"); + + QTest::newRow ("cq") << "CQ K1ABC FN42" << "CQ" << "K1ABC" << "FN42" << true; + QTest::newRow ("cq-dx") << "CQ DX K1ABC FN42" << "CQ DX" << "K1ABC" << "FN42" << true; + QTest::newRow ("compact-cq-dx") << "CQDX K1ABC FN42" << "CQDX" << "K1ABC" << "FN42" << true; + QTest::newRow ("dx-prefix") << "CQ DX1ABC JO00" << "CQ" << "DX1ABC" << "JO00" << true; + QTest::newRow ("letter-modifier") << "CQ POTA W1AW FN31" << "CQ POTA" << "W1AW" << "FN31" << true; + QTest::newRow ("test-modifier") << "CQ TEST KA1GT FN54" << "CQ TEST" << "KA1GT" << "FN54" << true; + QTest::newRow ("numeric-modifier") << "CQ 123 K1ABC FN42" << "CQ 123" << "K1ABC" << "FN42" << true; + QTest::newRow ("directed-grid") << "K1ABC W1AW FN31" << "K1ABC" << "W1AW" << "FN31" << false; + QTest::newRow ("directed-report") << "K1ABC W1AW -10" << "K1ABC" << "W1AW" << "" << false; + QTest::newRow ("portable-suffix") << "CQ W3SZ/2 FN20" << "CQ" << "W3SZ/2" << "FN20" << true; + QTest::newRow ("rover-suffix") << "CQ K1ABC/R FN42" << "CQ" << "K1ABC/R" << "FN42" << true; + QTest::newRow ("portable-marker") << "CQ K1ABC/P FN42" << "CQ" << "K1ABC/P" << "FN42" << true; + QTest::newRow ("compound-prefix") << "CQ 3DA0RS JJ22" << "CQ" << "3DA0RS" << "JJ22" << true; + QTest::newRow ("bracketed-call") << "CQ FK52" << "CQ" << "PJ4/KA1ABC" << "FK52" << true; + QTest::newRow ("later-grid") << "K1ABC W1AW R 520001 FN31AA" << "K1ABC" << "W1AW" << "FN31AA" << false; + QTest::newRow ("incomplete") << "CQ TEST" << "CQ" << "TEST" << "" << true; + QTest::newRow ("free-text") << "HELLO WORLD" << "HELLO" << "WORLD" << "" << false; +} + +void TestDecodedMessageFields::parsesMessage() +{ + QFETCH (QString, message); + QFETCH (QString, destination); + QFETCH (QString, sender); + QFETCH (QString, grid); + QFETCH (bool, cq); + + auto const fields = parseDecodedMessage (message); + QCOMPARE (fields.destination, destination); + QCOMPARE (fields.sender, sender); + QCOMPARE (fields.grid, grid); + QCOMPARE (fields.cq, cq); +} + +QTEST_GUILESS_MAIN (TestDecodedMessageFields) + +#include "test_decoded_message_fields.moc" diff --git a/tests/unit/common/test_decoded_message_reaction.cpp b/tests/unit/common/test_decoded_message_reaction.cpp new file mode 100644 index 00000000..606f46d8 --- /dev/null +++ b/tests/unit/common/test_decoded_message_reaction.cpp @@ -0,0 +1,385 @@ +#include + +#include "QsoReactionTestSupport.hpp" + +namespace +{ + using namespace QsoReactionTestSupport; + + Snapshot baseContext() + { + auto context = neutralStationSnapshot(); + context.mode = "FT8"; + context.tx1Enabled = true; + context.nominalQsyAllowed = true; + return context; + } + + QString legacyDecode(QString const& mode, QString const& payload, + QString const& flags, bool lowConfidence) + { + auto field = payload.leftJustified(22, ' ', true); + if (lowConfidence) field[21] = '?'; + + auto line = QString {"0605 -10 0.3 0815 "} + mode + " " + field; + if (!flags.isEmpty()) line += " " + flags; + return line; + } + + bool isFastCqQsyEffect(Effect::Kind kind) + { + return kind == Effect::Kind::ApplyFastCqQsy + || kind == Effect::Kind::RejectNominalQsy; + } +} + +class TestDecodedMessageReaction final + : public QObject +{ + Q_OBJECT + +private slots: + void classifiesLegacy72Messages_data() + { + QTest::addColumn("mode"); + QTest::addColumn("payload"); + QTest::addColumn("flags"); + QTest::addColumn("lowConfidence"); + QTest::addColumn("expected"); + + QTest::newRow("jt4-type1-prefix") + << "$" << "1A/KA1ABC WB9XYZ" << "f" << false << true; + QTest::newRow("jt9-type1-suffix") + << "@" << "KA1ABC WB9XYZ/A" << "f1" << false << true; + QTest::newRow("jt9-short-standard") + << "@" << "A1 B1" << "" << false << true; + QTest::newRow("jt65-ap-type1-prefix") + << "#" << "1A/KA1ABC WB9XYZ" << "a1" << false << true; + QTest::newRow("jt65-standard") + << "#" << "KA1ABC WB9XYZ R-22" << "d*2" << false << true; + QTest::newRow("jt4-type2-prefix") + << "$" << "CQ ZL4/KA1ABC" << "f" << false << true; + QTest::newRow("jt65-type2-suffix") + << "#" << "CQ WB9XYZ/VE4" << "a12" << false << true; + QTest::newRow("jt4-deep-low-confidence") + << "$" << "KA1ABC WB9XYZ R-22" << "d1" << true << true; + QTest::newRow("question-without-deep-flag") + << "$" << "KA1ABC WB9XYZ R-22" << "" << true << false; + QTest::newRow("jt65-ooo") + << "#" << "KA1ABC WB9XYZ EN34 OOO" << "" << false << true; + QTest::newRow("jt65-short-ooo") + << "#" << "A1 B1 OOO" << "" << false << true; + QTest::newRow("jt9-ooo-is-not-sideband") + << "@" << "KA1ABC WB9XYZ EN34 OOO" << "" << false << false; + QTest::newRow("trailing-structured-field") + << "#" << "A1A B1B 73 X" << "d1" << false << false; + QTest::newRow("blank") + << "@" << "" << "" << false << false; + QTest::newRow("single-token-call") + << "@" << "A1AAA" << "" << false << false; + QTest::newRow("short-token") + << "@" << "1B" << "" << false << false; + QTest::newRow("single-digit") + << "@" << "0" << "" << false << false; + QTest::newRow("leading-space-short-token") + << "@" << " A1" << "" << false << false; + QTest::newRow("leading-space-d-token") + << "@" << " D12" << "" << false << false; + } + + void classifiesLegacy72Messages() + { + QFETCH(QString, mode); + QFETCH(QString, payload); + QFETCH(QString, flags); + QFETCH(bool, lowConfidence); + QFETCH(bool, expected); + + DecodedText message {legacyDecode(mode, payload, flags, lowConfidence)}; + + QCOMPARE(message.isStandardMessage(), expected); + } + + void rejectsDecodeWithTooFewFields() + { + auto context = baseContext(); + DecodedText message {"CQ K1ABC FN42"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QVERIFY(decision.disposition == DecodedMessageReaction::ReactionDisposition::NoReaction); + QCOMPARE(decision.reason, QString {"decode has too few fields"}); + } + + void rejectsMismatchedModeMarker() + { + auto context = baseContext(); + context.mode = "JT65"; + DecodedText message {"0605 -10 0.3 0815 @ K1ABC W1AW -10"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QVERIFY(decision.disposition == DecodedMessageReaction::ReactionDisposition::NoReaction); + QCOMPARE(decision.reason, QString {"decode mode marker does not match current mode"}); + } + + void txDecodeOnlyAdjustsRxFrequencyByDefault() + { + auto context = baseContext(); + DecodedText message {"0605 Tx 1259 # CQ K1ABC FN42"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QVERIFY(decision.disposition == DecodedMessageReaction::ReactionDisposition::NoReaction); + QCOMPARE(intEffect(decision, Effect::Kind::SetRxFrequency), 1259); + QVERIFY(!hasEffect(decision, Effect::Kind::SetTxFrequency)); + } + + void txDecodeWithCtrlAlsoAdjustsTxFrequencyWhenNotHeld() + { + auto context = baseContext(); + context.modifiers.ctrl = true; + DecodedText message {"0605 Tx 1259 # CQ K1ABC FN42"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QVERIFY(decision.disposition == DecodedMessageReaction::ReactionDisposition::NoReaction); + QCOMPARE(intEffect(decision, Effect::Kind::SetRxFrequency), 1259); + QCOMPARE(intEffect(decision, Effect::Kind::SetTxFrequency), 1259); + } + + void fastCqWithListeningFrequencyRequestsQsy() + { + auto context = baseContext(); + context.mode = "MSK144"; + context.fastMode = true; + context.transceiverOnline = true; + context.nominalFrequency = 50260000; + DecodedText message {"060522 -10 0.3 0815 & CQ 260 W1AW FN31"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + bool foundQsy = false; + for (auto const& action : decision.effects) { + if (action.kind == DecodedMessageReaction::QsoReactionEffect::Kind::ApplyFastCqQsy + && action.frequency == 50260000 + && action.text == "QSY 50.260" + && action.boolValue + && !action.userInitiated) foundQsy = true; + } + + QVERIFY(foundQsy); + } + + void blockedFastCqSuppressesOnlyNominalQsyEffects() + { + auto allowedContext = baseContext(); + allowedContext.mode = "MSK144"; + allowedContext.fastMode = true; + allowedContext.transceiverOnline = true; + allowedContext.nominalFrequency = 50260000; + auto blockedContext = allowedContext; + blockedContext.nominalQsyAllowed = false; + DecodedText message {"060522 -10 0.3 0815 & CQ 260 W1AW FN31"}; + + auto const allowed = DecodedMessageReaction::planProcessMessage(message, allowedContext); + auto const blocked = DecodedMessageReaction::planProcessMessage(message, blockedContext); + + QCOMPARE(effectCount(allowed, Effect::Kind::ApplyFastCqQsy), 1); + QCOMPARE(effectCount(blocked, Effect::Kind::ApplyFastCqQsy), 0); + QVERIFY(blocked.disposition == allowed.disposition); + QCOMPARE(blocked.reason, allowed.reason); + + QVector allowedUnrelated; + for (auto const& effect : allowed.effects) { + if (!isFastCqQsyEffect(effect.kind)) allowedUnrelated.append(&effect); + } + QCOMPARE(blocked.effects.size(), allowedUnrelated.size()); + for (int i = 0; i < blocked.effects.size(); ++i) { + auto const& actual = blocked.effects.at(i); + auto const& expected = *allowedUnrelated.at(i); + QVERIFY(actual.kind == expected.kind); + QCOMPARE(actual.intValue, expected.intValue); + QCOMPARE(actual.frequency, expected.frequency); + QCOMPARE(actual.text, expected.text); + QCOMPARE(actual.boolValue, expected.boolValue); + QCOMPARE(actual.userInitiated, expected.userInitiated); + QVERIFY(actual.progress == expected.progress); + QVERIFY(actual.contestHint == expected.contestHint); + } + } + + void blockedManualFastCqRejectsBeforeStartingQso() + { + auto context = baseContext(); + context.mode = "MSK144"; + context.fastMode = true; + context.transceiverOnline = true; + context.nominalFrequency = 50260000; + context.nominalQsyAllowed = false; + context.selectionOrigin = DecodedMessageReaction::SelectionOrigin::ManualLeftPane; + DecodedText message {"060522 -10 0.3 0815 & CQ 260 W1AW FN31"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QCOMPARE(decision.effects.size(), 1); + QVERIFY(decision.effects.first().kind == Effect::Kind::RejectNominalQsy); + QVERIFY(decision.disposition == DecodedMessageReaction::ReactionDisposition::NoReaction); + QCOMPARE(decision.reason, QString {"fast CQ requires a blocked nominal QSY"}); + } + + void fastCqQsyPermissionDefaultsClosed() + { + auto context = neutralStationSnapshot(); + context.mode = "MSK144"; + context.fastMode = true; + context.transceiverOnline = true; + context.nominalFrequency = 50260000; + DecodedText message {"060522 -10 0.3 0815 & CQ 260 W1AW FN31"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QCOMPARE(effectCount(decision, Effect::Kind::ApplyFastCqQsy), 0); + } + + void doubleClickDoesNotStartQsoWithOwnBaseCall() + { + auto context = baseContext(); + context.doubleClicked = true; + DecodedText message {"0605 -10 0.3 0815 ~ W1AW K1ABC FN42"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QVERIFY(decision.disposition == DecodedMessageReaction::ReactionDisposition::NoReaction); + QCOMPARE(decision.reason, QString {"double-click would start QSO with own base call"}); + } + + void udpReplyIsIgnoredWhileTransmittingOur73() + { + auto context = baseContext(); + context.selectionOrigin = DecodedMessageReaction::SelectionOrigin::Udp; + context.transmittingSignoff = true; + DecodedText message {"0605 -10 0.3 0815 ~ K1ABC W1AW RR73"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QVERIFY(decision.disposition == DecodedMessageReaction::ReactionDisposition::NoReaction); + QCOMPARE(decision.reason, QString {"udp reply ignored while transmitting 73"}); + } + + void udpInvalidCqReplyIsRejectedWhileTransmittingOur73() + { + auto context = baseContext(); + context.selectionOrigin = DecodedMessageReaction::SelectionOrigin::Udp; + context.transmittingSignoff = true; + DecodedText message {"0605 -10 0.3 0815 ~ CQ N0CALL FN31"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QVERIFY(decision.disposition == DecodedMessageReaction::ReactionDisposition::NoReaction); + QCOMPARE(decision.reason, QString {"non-standard free text is not processable"}); + } + + void udpDifferentSignoffIsHonoredWhileTransmittingOur73() + { + auto context = baseContext(); + context.selectionOrigin = DecodedMessageReaction::SelectionOrigin::Udp; + context.transmittingSignoff = true; + DecodedText message {"0605 -10 0.3 0815 ~ K1ABC N0CALL RR73"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QVERIFY(decision.disposition == DecodedMessageReaction::ReactionDisposition::Reacted); + } + + void manualDoubleClickStillHonoredWhileTransmittingOur73() + { + // Answering the partner's RR73 with a 73 by double-clicking it is an + // explicit operator override and must keep working even mid-transmission. + auto context = baseContext(); + context.doubleClicked = true; + context.selectionOrigin = DecodedMessageReaction::SelectionOrigin::ManualLeftPane; + context.transmittingSignoff = true; + DecodedText message {"0605 -10 0.3 0815 ~ K1ABC W1AW RR73"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QVERIFY(decision.disposition == DecodedMessageReaction::ReactionDisposition::Reacted); + } + + void udpReplyHonoredWhenNotSigningOff() + { + auto context = baseContext(); + context.doubleClicked = true; + context.selectionOrigin = DecodedMessageReaction::SelectionOrigin::Udp; + context.transmittingSignoff = false; + DecodedText message {"0605 -10 0.3 0815 ~ CQ W1AW FN31"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QVERIFY(decision.disposition == DecodedMessageReaction::ReactionDisposition::Reacted); + } + + void houndIgnoresOtherHoundNegativeReport() + { + auto context = baseContext(); + context.specOp = SpecialOperatingActivity::HOUND; + DecodedText message {"0605 -10 0.3 0815 ~ K1JT W10AAA R-10"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QVERIFY(decision.disposition == DecodedMessageReaction::ReactionDisposition::NoReaction); + QCOMPARE(decision.reason, QString {"hound ignores other hounds"}); + } + + void houndIgnoresOtherHoundPositiveReport() + { + auto context = baseContext(); + context.specOp = SpecialOperatingActivity::HOUND; + DecodedText message {"0605 -10 0.3 0815 ~ K1JT W10AAA R+03"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QVERIFY(decision.disposition == DecodedMessageReaction::ReactionDisposition::NoReaction); + QCOMPARE(decision.reason, QString {"hound ignores other hounds"}); + } + + void suffixedCallKeepsPriorQsoPartnerSnapshot() + { + auto context = baseContext(); + context.dxCall = "N0CALL"; + DecodedText message {"0605 -10 0.3 0815 ~ K1ABC W1AW/R -10"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QVERIFY(decision.disposition == DecodedMessageReaction::ReactionDisposition::Reacted); + int clearGrid = -1; + int setCall = -1; + for (int i = 0; i < decision.effects.size(); ++i) { + if (decision.effects[i].kind == DecodedMessageReaction::QsoReactionEffect::Kind::ClearDxGrid) { + clearGrid = i; + } + if (decision.effects[i].kind == DecodedMessageReaction::QsoReactionEffect::Kind::SetDxCall + && decision.effects[i].text == "W1AW/R") { + setCall = i; + } + } + QVERIFY(clearGrid >= 0); + QVERIFY(setCall > clearGrid); + } + + void maxSignalSignoffKeepsSelectedCall() + { + auto context = baseContext(); + context.respondPolicy = AutoRespondPolicy::MaxSignal; + DecodedText message {"0605 -10 0.3 0815 ~ K1ABC W1AW/R 73"}; + + auto const decision = DecodedMessageReaction::planProcessMessage(message, context); + + QVERIFY(decision.disposition == DecodedMessageReaction::ReactionDisposition::Reacted); + QVERIFY(!hasEffect(decision, Effect::Kind::SetDxCall)); + } +}; + +QTEST_MAIN(TestDecodedMessageReaction) +#include "test_decoded_message_reaction.moc" diff --git a/tests/unit/common/test_decoded_time.cpp b/tests/unit/common/test_decoded_time.cpp new file mode 100644 index 00000000..e6115823 --- /dev/null +++ b/tests/unit/common/test_decoded_time.cpp @@ -0,0 +1,54 @@ +#include + +#include "Network/DecodedTime.hpp" + +namespace +{ + QDateTime nowUtc() + { + return {QDate {2026, 8, 17}, QTime {12, 34, 56}, Qt::UTC}; + } +} + +class TestDecodedTime final : public QObject +{ + Q_OBJECT + +private slots: + void acceptsFourAndSixDigitTimes() + { + auto const fourDigitExpected = QDateTime {QDate {2026, 8, 17}, QTime {12, 34}, Qt::UTC}; + QCOMPARE(DecodedTime::spotTime("1234", nowUtc(), 60), fourDigitExpected); + auto const sixDigitExpected = nowUtc(); + QCOMPARE(DecodedTime::spotTime("123456", nowUtc(), 60), sixDigitExpected); + } + + void preservesMidnightConvention() + { + auto const firstExpected = QDateTime {QDate {2026, 8, 16}, QTime {23, 59}, Qt::UTC}; + auto const secondExpected = QDateTime {QDate {2026, 8, 16}, QTime {23, 59, 45}, Qt::UTC}; + auto const thirdExpected = QDateTime {QDate {2026, 8, 17}, QTime {23, 59, 30}, Qt::UTC}; + QCOMPARE(DecodedTime::spotTime("2359", nowUtc(), 60), firstExpected); + QCOMPARE(DecodedTime::spotTime("235945", nowUtc(), 15), secondExpected); + QCOMPARE(DecodedTime::spotTime("235930", nowUtc(), 15), thirdExpected); + } + + void roundsFractionalPeriodForMidnight() + { + auto const expected = QDateTime {QDate {2026, 8, 16}, QTime {23, 59, 52}, Qt::UTC}; + QCOMPARE(DecodedTime::spotTime("235952", nowUtc(), 7.5), expected); + } + + void rejectsMalformedTimes() + { + for (auto const& encodedTime : {QString {}, QString {"123"}, QString {"1234567"}, + QString {"2460"}, QString {"1260"}, + QString {"126099"}, QString {"12x4"}}) { + QVERIFY(!DecodedTime::spotTime(encodedTime, nowUtc(), 60).isValid()); + } + } +}; + +QTEST_APPLESS_MAIN(TestDecodedTime) + +#include "test_decoded_time.moc" diff --git a/tests/unit/common/test_displaytext.cpp b/tests/unit/common/test_displaytext.cpp new file mode 100644 index 00000000..d7fc4b94 --- /dev/null +++ b/tests/unit/common/test_displaytext.cpp @@ -0,0 +1,397 @@ +#include +#include +#include +#include +#include +#include +#include + +#include "commons.h" +#include "widgets/displaytext.h" + +namespace +{ + dec_data_t test_dec_data {}; + int constexpr tone_buffer_size {250}; +} + +// The transceiver objects linked through wsjt_qt reference globals normally owned by MainWindow. +dec_data_t& dec_data = test_dec_data; +int volatile itone[tone_buffer_size] {}; +int volatile icw[tone_buffer_size] {}; + +float gran () +{ + return 0.0f; +} + +class TestDisplayText final + : public QObject +{ + Q_OBJECT + +private: + static QPoint positionWithin (DisplayText const& display, QString const& text) + { + auto cursor = display.document ()->find (text); + cursor.setPosition (cursor.selectionStart () + text.size () / 2); + return display.cursorRect (cursor).center (); + } + + static void sendMouseEvent (DisplayText& display, QEvent::Type type, QPoint const& position, + Qt::MouseButton button, Qt::MouseButtons buttons, + Qt::KeyboardModifiers modifiers = Qt::NoModifier) + { + QMouseEvent event {type, position, button, buttons, modifiers}; + QApplication::sendEvent (display.viewport (), &event); + } + + static void sendClick (DisplayText& display, QPoint const& position) + { + sendMouseEvent (display, QEvent::MouseButtonPress, position, Qt::LeftButton, Qt::LeftButton); + sendMouseEvent (display, QEvent::MouseButtonRelease, position, Qt::LeftButton, Qt::NoButton); + } + + static void sendDoubleClick (DisplayText& display, QPoint const& position, + Qt::KeyboardModifiers modifiers = Qt::NoModifier) + { + sendMouseEvent (display, QEvent::MouseButtonDblClick, position, Qt::LeftButton, + Qt::LeftButton, modifiers); + sendMouseEvent (display, QEvent::MouseButtonRelease, position, Qt::LeftButton, + Qt::NoButton, modifiers); + } + + static void populateForScrolling (DisplayText& display, int count = 80) + { + for (int i = 0; i < count; ++i) + { + display.insertText (QString {"%1 decode"}.arg (i, 3, 10, QLatin1Char {'0'})); + } + QApplication::processEvents (); + } + + static QString topVisibleLine (DisplayText const& display) + { + return display.cursorForPosition (QPoint {1, 1}).block ().text (); + } + +private slots: + void insertionDoesNotRetargetDoubleClick () + { + DisplayText display; + display.resize (640, 240); + display.insertText ("K1ABC intended decode"); + display.show (); + QApplication::processEvents (); + + auto const position = positionWithin (display, "K1ABC"); + QCOMPARE (display.cursorForPosition (position).block ().text (), QString {"K1ABC intended decode"}); + + QString selected_line; + QString selected_word; + Qt::KeyboardModifiers selected_modifiers; + int selection_count {0}; + connect (&display, &DisplayText::selectCallsign, + [&] (QString const& line, QString const& word, Qt::KeyboardModifiers modifiers) { + selected_line = line; + selected_word = word; + selected_modifiers = modifiers; + ++selection_count; + }); + + sendClick (display, position); + display.insertText ("K9XYZ newest decode"); + + QCOMPARE (display.textCursor ().block ().text (), QString {"K9XYZ newest decode"}); + QCOMPARE (display.cursorForPosition (position).block ().text (), QString {"K1ABC intended decode"}); + + sendDoubleClick (display, position, Qt::ControlModifier); + + QCOMPARE (selection_count, 1); + QCOMPARE (selected_line, QString {"K1ABC intended decode"}); + QCOMPARE (selected_word, QString {"K1ABC"}); + QCOMPARE (selected_modifiers, Qt::KeyboardModifiers {Qt::ControlModifier}); + } + + void movedContentKeepsFirstPressedTarget () + { + DisplayText display; + display.resize (640, 240); + display.insertText ("K1ABC intended decode"); + display.show (); + QApplication::processEvents (); + + auto const position = positionWithin (display, "K1ABC"); + QString selected_line; + QString selected_word; + connect (&display, &DisplayText::selectCallsign, + [&] (QString const& line, QString const& word, Qt::KeyboardModifiers) { + selected_line = line; + selected_word = word; + }); + + sendClick (display, position); + QTextCursor insertion {display.document ()}; + insertion.insertText ("K9XYZ inserted above\n"); + QApplication::processEvents (); + + QCOMPARE (display.cursorForPosition (position).block ().text (), QString {"K9XYZ inserted above"}); + + sendDoubleClick (display, position); + + QCOMPARE (selected_line, QString {"K1ABC intended decode"}); + QCOMPARE (selected_word, QString {"K1ABC"}); + } + + void doubleClickWithoutPressUsesEventPosition () + { + DisplayText display; + display.resize (640, 240); + display.insertText ("N0CALL direct target"); + display.show (); + QApplication::processEvents (); + + auto const position = positionWithin (display, "N0CALL"); + QString selected_line; + QString selected_word; + connect (&display, &DisplayText::selectCallsign, + [&] (QString const& line, QString const& word, Qt::KeyboardModifiers) { + selected_line = line; + selected_word = word; + }); + + sendDoubleClick (display, position); + + QCOMPARE (selected_line, QString {"N0CALL direct target"}); + QCOMPARE (selected_word, QString {"N0CALL"}); + } + + void eraseCancelsCapturedTarget () + { + DisplayText display; + display.resize (640, 240); + display.insertText ("K1ABC stale target"); + display.show (); + QApplication::processEvents (); + + auto const stale_position = positionWithin (display, "K1ABC"); + int selection_count {0}; + connect (&display, &DisplayText::selectCallsign, + [&] (QString const&, QString const&, Qt::KeyboardModifiers) { + ++selection_count; + }); + + sendClick (display, stale_position); + display.erase (); + display.insertText ("K9XYZ replacement target"); + QApplication::processEvents (); + + sendDoubleClick (display, positionWithin (display, "K9XYZ")); + + QCOMPARE (selection_count, 0); + } + + void canceledDoubleClickRestoresDirectFallback () + { + DisplayText display; + display.resize (640, 240); + display.insertText ("K1ABC stale target"); + display.show (); + QApplication::processEvents (); + + auto const stale_position = positionWithin (display, "K1ABC"); + QString selected_line; + QString selected_word; + int selection_count {0}; + connect (&display, &DisplayText::selectCallsign, + [&] (QString const& line, QString const& word, Qt::KeyboardModifiers) { + selected_line = line; + selected_word = word; + ++selection_count; + }); + + sendClick (display, stale_position); + display.clear (); + display.insertText ("K9XYZ replacement target"); + QApplication::processEvents (); + auto const replacement_position = positionWithin (display, "K9XYZ"); + + sendDoubleClick (display, replacement_position); + QCOMPARE (selection_count, 0); + + sendDoubleClick (display, replacement_position); + QCOMPARE (selection_count, 1); + QCOMPARE (selected_line, QString {"K9XYZ replacement target"}); + QCOMPARE (selected_word, QString {"K9XYZ"}); + } + + void pressAfterClearCapturesReplacement () + { + DisplayText display; + display.resize (640, 240); + display.insertText ("K1ABC stale target"); + display.show (); + QApplication::processEvents (); + + auto const stale_position = positionWithin (display, "K1ABC"); + QString selected_line; + QString selected_word; + connect (&display, &DisplayText::selectCallsign, + [&] (QString const& line, QString const& word, Qt::KeyboardModifiers) { + selected_line = line; + selected_word = word; + }); + + sendClick (display, stale_position); + display.clear (); + display.insertText ("K9XYZ replacement target"); + QApplication::processEvents (); + auto const replacement_position = positionWithin (display, "K9XYZ"); + + sendClick (display, replacement_position); + sendDoubleClick (display, replacement_position); + + QCOMPARE (selected_line, QString {"K9XYZ replacement target"}); + QCOMPARE (selected_word, QString {"K9XYZ"}); + } + + void stickyScrollPreservesParkedContent () + { + DisplayText display; + display.set_configuration (nullptr); + display.resize (360, 140); + display.show (); + populateForScrolling (display); + + auto * scroll_bar = display.verticalScrollBar (); + auto * return_button = display.findChild ("returnToLiveActivityButton"); + QVERIFY (return_button); + QCOMPARE (scroll_bar->value (), scroll_bar->maximum ()); + + scroll_bar->triggerAction (QAbstractSlider::SliderPageStepSub); + QApplication::processEvents (); + QVERIFY (scroll_bar->value () < scroll_bar->maximum ()); + QVERIFY (return_button->isVisible ()); + auto const parked_line = topVisibleLine (display); + + display.insertText ("new live decode"); + QApplication::processEvents (); + + QCOMPARE (topVisibleLine (display), parked_line); + QVERIFY (return_button->isVisible ()); + } + + void formerLivePositionDoesNotResumeFollowing () + { + DisplayText display; + display.set_configuration (nullptr); + display.resize (360, 140); + display.show (); + populateForScrolling (display); + + auto * scroll_bar = display.verticalScrollBar (); + auto * return_button = display.findChild ("returnToLiveActivityButton"); + QVERIFY (return_button); + auto const former_live_position = scroll_bar->maximum (); + + scroll_bar->triggerAction (QAbstractSlider::SliderPageStepSub); + display.insertText ("first newer decode"); + QApplication::processEvents (); + QVERIFY (scroll_bar->maximum () > former_live_position); + + scroll_bar->setSliderPosition (former_live_position); + QVERIFY (QMetaObject::invokeMethod (scroll_bar, "sliderMoved", + Q_ARG (int, former_live_position))); + QApplication::processEvents (); + QCOMPARE (scroll_bar->value (), former_live_position); + QVERIFY (return_button->isVisible ()); + auto const parked_line = topVisibleLine (display); + + display.insertText ("second newer decode"); + QApplication::processEvents (); + + QCOMPARE (topVisibleLine (display), parked_line); + QVERIFY (scroll_bar->value () < scroll_bar->maximum ()); + } + + void returnControlIsAccessibleAndViewportBounded () + { + DisplayText display; + display.set_configuration (nullptr); + display.resize (360, 140); + display.show (); + populateForScrolling (display); + + auto * scroll_bar = display.verticalScrollBar (); + auto * return_button = display.findChild ("returnToLiveActivityButton"); + QVERIFY (return_button); + scroll_bar->triggerAction (QAbstractSlider::SliderPageStepSub); + QApplication::processEvents (); + + auto large_font = return_button->font (); + large_font.setPointSize (30); + return_button->setFont (large_font); + display.resize (120, 80); + QApplication::processEvents (); + + QVERIFY (return_button->isVisible ()); + QCOMPARE (return_button->focusPolicy (), Qt::StrongFocus); + QVERIFY (return_button->styleSheet ().isEmpty ()); + QVERIFY (display.viewport ()->rect ().contains (return_button->geometry ())); + + QTest::keyClick (return_button, Qt::Key_Space); + + QCOMPARE (scroll_bar->value (), scroll_bar->maximum ()); + QVERIFY (!return_button->isVisible ()); + } + + void unconfiguredDisplayKeepsOriginalFollowBehavior () + { + DisplayText display; + display.resize (360, 140); + display.show (); + populateForScrolling (display); + + auto * scroll_bar = display.verticalScrollBar (); + auto * return_button = display.findChild ("returnToLiveActivityButton"); + QVERIFY (return_button); + scroll_bar->triggerAction (QAbstractSlider::SliderPageStepSub); + QApplication::processEvents (); + QVERIFY (scroll_bar->value () < scroll_bar->maximum ()); + + display.insertText ("queue update"); + QApplication::processEvents (); + + QCOMPARE (display.textCursor ().block ().text (), QString {"queue update"}); + QVERIFY (display.viewport ()->rect ().intersects (display.cursorRect (display.textCursor ()))); + QVERIFY (!return_button->isVisible ()); + } + + void fontChangePreservesParkedContent () + { + DisplayText display; + display.set_configuration (nullptr); + display.resize (360, 140); + display.show (); + populateForScrolling (display); + + auto * scroll_bar = display.verticalScrollBar (); + auto * return_button = display.findChild ("returnToLiveActivityButton"); + QVERIFY (return_button); + scroll_bar->triggerAction (QAbstractSlider::SliderPageStepSub); + QApplication::processEvents (); + auto const parked_line = topVisibleLine (display); + + auto larger_font = display.contentFont (); + larger_font.setPointSize (larger_font.pointSize () + 2); + display.setContentFont (larger_font); + QApplication::processEvents (); + + QCOMPARE (topVisibleLine (display), parked_line); + QVERIFY (return_button->isVisible ()); + } +}; + +QTEST_MAIN (TestDisplayText) + +#include "test_displaytext.moc" diff --git a/tests/unit/common/test_emulate_split_transceiver.cpp b/tests/unit/common/test_emulate_split_transceiver.cpp new file mode 100644 index 00000000..1ed8f189 --- /dev/null +++ b/tests/unit/common/test_emulate_split_transceiver.cpp @@ -0,0 +1,129 @@ +#include + +#include + +#include "Transceiver/EmulateSplitTransceiver.hpp" + +class FakeTransceiver final + : public Transceiver +{ + Q_OBJECT + +public: + FakeTransceiver () + : Transceiver {nullptr, nullptr} + { + } + + void set (TransceiverState const& state, unsigned sequence_number) noexcept override + { + last_state = state; + last_sequence_number = sequence_number; + } + + void start (unsigned sequence_number) noexcept override + { + last_sequence_number = sequence_number; + } + + void stop () noexcept override {} + + void send_update (TransceiverState const& state, unsigned sequence_number) + { + Q_EMIT update (state, sequence_number); + } + + void send_receive_audio (ReceiveAudio audio) { Q_EMIT receiveAudio (audio); } + + TransceiverState last_state; + unsigned last_sequence_number {0}; +}; + +class TestEmulateSplitTransceiver : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void forwardsReceiveAudio () + { + auto * raw_fake = new FakeTransceiver; + EmulateSplitTransceiver transceiver {nullptr, std::unique_ptr {raw_fake}}; + ReceiveAudio observed; + connect (&transceiver, &Transceiver::receiveAudio, + this, [&observed] (ReceiveAudio audio) { observed = std::move (audio); }); + auto block = std::make_shared (); + + raw_fake->send_receive_audio (block); + + QCOMPARE (observed, ReceiveAudio {block}); + } + + Q_SLOT void fakeSplitDoesNotPublishTransientTxDialAsRxDial () + { + auto * raw_fake = new FakeTransceiver; + EmulateSplitTransceiver transceiver {nullptr, std::unique_ptr {raw_fake}}; + QSignalSpy updates {&transceiver, &Transceiver::update}; + + Transceiver::TransceiverState requested; + requested.online (true); + requested.frequency (7074000); + requested.tx_frequency (7072500); + requested.split (true); + requested.ptt (true); + + transceiver.set (requested, 17); + + QCOMPARE (raw_fake->last_state.frequency (), requested.tx_frequency ()); + QCOMPARE (raw_fake->last_state.tx_frequency (), Transceiver::Frequency {0}); + QVERIFY (!raw_fake->last_state.split ()); + + Transceiver::TransceiverState wrapped_update; + wrapped_update.online (true); + wrapped_update.frequency (requested.tx_frequency ()); + wrapped_update.split (false); + wrapped_update.ptt (false); + + raw_fake->send_update (wrapped_update, 17); + + QCOMPARE (updates.size (), 1); + auto const published = qvariant_cast (updates.takeFirst ().at (0)); + QCOMPARE (published.frequency (), requested.frequency ()); + QCOMPARE (published.tx_frequency (), requested.tx_frequency ()); + QVERIFY (published.split ()); + QVERIFY (!published.ptt ()); + } + + Q_SLOT void receiveModeStillFollowsManualRigQsy () + { + auto * raw_fake = new FakeTransceiver; + EmulateSplitTransceiver transceiver {nullptr, std::unique_ptr {raw_fake}}; + QSignalSpy updates {&transceiver, &Transceiver::update}; + + Transceiver::TransceiverState requested; + requested.online (true); + requested.frequency (7074000); + requested.tx_frequency (7072500); + requested.split (true); + requested.ptt (false); + + transceiver.set (requested, 18); + + Transceiver::TransceiverState wrapped_update; + wrapped_update.online (true); + wrapped_update.frequency (14074000); + wrapped_update.split (false); + wrapped_update.ptt (false); + + raw_fake->send_update (wrapped_update, 18); + + QCOMPARE (updates.size (), 1); + auto const published = qvariant_cast (updates.takeFirst ().at (0)); + QCOMPARE (published.frequency (), wrapped_update.frequency ()); + QCOMPARE (published.tx_frequency (), requested.tx_frequency ()); + QVERIFY (published.split ()); + QVERIFY (!published.ptt ()); + } +}; + +QTEST_MAIN (TestEmulateSplitTransceiver) +#include "test_emulate_split_transceiver.moc" diff --git a/tests/unit/common/test_fox_guard_bands.cpp b/tests/unit/common/test_fox_guard_bands.cpp new file mode 100644 index 00000000..a7d1839c --- /dev/null +++ b/tests/unit/common/test_fox_guard_bands.cpp @@ -0,0 +1,92 @@ +#include + +#include "FoxGuardBands.hpp" + +class TestFoxGuardBands + : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void standard_ft8_first_and_last_guards_block () + { + auto const first = FoxGuardBands::check (1840000); + QVERIFY (first.blocked); + QCOMPARE (static_cast (first.kind), static_cast (FoxGuardBands::GuardKind::StandardFT8)); + QCOMPARE (first.guard_frequency, Radio::Frequency {1840000}); + + auto const last = FoxGuardBands::check (70154000); + QVERIFY (last.blocked); + QCOMPARE (static_cast (last.kind), static_cast (FoxGuardBands::GuardKind::StandardFT8)); + QCOMPARE (last.guard_frequency, Radio::Frequency {70154000}); + } + + Q_SLOT void wspr_first_and_last_guards_block () + { + auto const first = FoxGuardBands::check (1836600); + QVERIFY (first.blocked); + QCOMPARE (static_cast (first.kind), static_cast (FoxGuardBands::GuardKind::WSPR)); + QCOMPARE (first.guard_frequency, Radio::Frequency {1836600}); + + auto const last = FoxGuardBands::check (28124600); + QVERIFY (last.blocked); + QCOMPARE (static_cast (last.kind), static_cast (FoxGuardBands::GuardKind::WSPR)); + QCOMPARE (last.guard_frequency, Radio::Frequency {28124600}); + } + + Q_SLOT void standard_ft8_boundaries_are_exclusive_at_3000_hz () + { + auto const below = FoxGuardBands::check (14074000 - 2999); + QVERIFY (below.blocked); + QCOMPARE (static_cast (below.kind), static_cast (FoxGuardBands::GuardKind::StandardFT8)); + QCOMPARE (below.guard_frequency, Radio::Frequency {14074000}); + + auto const above = FoxGuardBands::check (14074000 + 2999); + QVERIFY (above.blocked); + QCOMPARE (static_cast (above.kind), static_cast (FoxGuardBands::GuardKind::StandardFT8)); + QCOMPARE (above.guard_frequency, Radio::Frequency {14074000}); + + QVERIFY (!FoxGuardBands::check (14074000 - 3000).blocked); + QVERIFY (!FoxGuardBands::check (14074000 + 3000).blocked); + } + + Q_SLOT void wspr_boundaries_match_existing_thresholds () + { + auto const guard_frequency = Radio::Frequency {28124600}; + + auto const lower = FoxGuardBands::check (guard_frequency - 3499); + QVERIFY (lower.blocked); + QCOMPARE (static_cast (lower.kind), static_cast (FoxGuardBands::GuardKind::WSPR)); + QCOMPARE (lower.guard_frequency, guard_frequency); + + auto const upper = FoxGuardBands::check (guard_frequency + 299); + QVERIFY (upper.blocked); + QCOMPARE (static_cast (upper.kind), static_cast (FoxGuardBands::GuardKind::WSPR)); + QCOMPARE (upper.guard_frequency, guard_frequency); + + QVERIFY (!FoxGuardBands::check (guard_frequency - 3500).blocked); + QVERIFY (!FoxGuardBands::check (guard_frequency + 300).blocked); + } + + Q_SLOT void standard_ft8_match_wins_over_wspr_match () + { + auto const match = FoxGuardBands::check (1000000, {1000000}, {1000000}); + + QVERIFY (match.blocked); + QCOMPARE (static_cast (match.kind), static_cast (FoxGuardBands::GuardKind::StandardFT8)); + QCOMPARE (match.guard_frequency, Radio::Frequency {1000000}); + } + + Q_SLOT void unrelated_frequency_is_unblocked () + { + auto const match = FoxGuardBands::check (123456789); + + QVERIFY (!match.blocked); + QCOMPARE (static_cast (match.kind), static_cast (FoxGuardBands::GuardKind::None)); + QCOMPARE (match.guard_frequency, Radio::Frequency {0}); + } +}; + +QTEST_MAIN (TestFoxGuardBands); + +#include "test_fox_guard_bands.moc" diff --git a/tests/unit/common/test_fox_operator_actions.cpp b/tests/unit/common/test_fox_operator_actions.cpp new file mode 100644 index 00000000..f6870fa1 --- /dev/null +++ b/tests/unit/common/test_fox_operator_actions.cpp @@ -0,0 +1,124 @@ +#include +#include +#include + +#include "FoxOperatorActions.hpp" + +namespace +{ + QString queueLine (QString const& call, QString const& details) + { + return (call + QString (12, ' ')).left (12) + details; + } + + struct Qso + { + int ncall; + int sentinel; + }; +} + +class TestFoxOperatorActions final + : public QObject +{ + Q_OBJECT + +private slots: + void moveToFrontUsesLiveQueueLine () + { + auto const first = queueLine ("W1AAA", "-02 FN31"); + auto const live_target = queueLine ("K1ABC", "+04 FN42"); + QQueue queue; + queue.enqueue (first); + queue.enqueue (live_target); + + QVERIFY (FoxOperatorActions::moveQueuedHoundToFront ( + queue, queueLine ("K1ABC", "+01 stale snapshot"))); + + QCOMPARE (queue.size (), 2); + QCOMPARE (queue.at (0), live_target); + QCOMPARE (queue.at (1), first); + } + + void moveToFrontRejectsMissingHound () + { + auto const live_line = queueLine ("W1AAA", "-02 FN31"); + QQueue queue; + queue.enqueue (live_line); + + QVERIFY (!FoxOperatorActions::moveQueuedHoundToFront ( + queue, queueLine ("K1ABC", "+01 stale snapshot"))); + + QCOMPARE (queue.size (), 1); + QCOMPARE (queue.at (0), live_line); + } + + void removeUsesLiveQueueCallsign () + { + auto const retained = queueLine ("W1AAA", "-02 FN31"); + QQueue queue; + queue.enqueue (retained); + queue.enqueue (queueLine ("K1ABC", "+04 FN42")); + queue.enqueue (queueLine ("K1ABC", "+02 FN41")); + + QVERIFY (FoxOperatorActions::removeQueuedHound ( + queue, queueLine ("K1ABC", "+01 stale snapshot"))); + + QCOMPARE (queue.size (), 1); + QCOMPARE (queue.at (0), retained); + } + + void removeRejectsMissingHound () + { + auto const live_line = queueLine ("W1AAA", "-02 FN31"); + QQueue queue; + queue.enqueue (live_line); + + QVERIFY (!FoxOperatorActions::removeQueuedHound ( + queue, queueLine ("K1ABC", "+01 stale snapshot"))); + + QCOMPARE (queue.size (), 1); + QCOMPARE (queue.at (0), live_line); + } + + void timeoutRequiresActiveCallAndQso () + { + QQueue in_progress; + in_progress.enqueue ("K1ABC"); + QMap qsos {{"K1ABC", {2, 73}}}; + + QVERIFY (FoxOperatorActions::timeoutIfActive ( + in_progress, qsos, queueLine ("K1ABC", "3 (rx)"), 6)); + + QCOMPARE (qsos.value ("K1ABC").ncall, 6); + QCOMPARE (qsos.value ("K1ABC").sentinel, 73); + } + + void timeoutRejectsCallNoLongerInProgress () + { + QQueue in_progress; + QMap qsos {{"K1ABC", {2, 73}}}; + + QVERIFY (!FoxOperatorActions::timeoutIfActive ( + in_progress, qsos, queueLine ("K1ABC", "3 (rx)"), 6)); + + QCOMPARE (qsos.value ("K1ABC").ncall, 2); + QCOMPARE (qsos.value ("K1ABC").sentinel, 73); + } + + void timeoutDoesNotCreateMissingQso () + { + QQueue in_progress; + in_progress.enqueue ("K1ABC"); + QMap qsos; + + QVERIFY (!FoxOperatorActions::timeoutIfActive ( + in_progress, qsos, queueLine ("K1ABC", "3 (rx)"), 6)); + + QVERIFY (qsos.isEmpty ()); + } +}; + +QTEST_MAIN (TestFoxOperatorActions) + +#include "test_fox_operator_actions.moc" diff --git a/tests/unit/common/test_frequency_editors.cpp b/tests/unit/common/test_frequency_editors.cpp new file mode 100644 index 00000000..1d5dfd50 --- /dev/null +++ b/tests/unit/common/test_frequency_editors.cpp @@ -0,0 +1,273 @@ +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "Radio.hpp" +#include "models/Bands.hpp" +#include "models/FrequencyList.hpp" +#include "models/IARURegions.hpp" +#include "models/Modes.hpp" +#include "models/StationList.hpp" +#include "validators/LiveFrequencyValidator.hpp" +#include "widgets/FrequencyDeltaLineEdit.hpp" +#include "widgets/FrequencyLineEdit.hpp" + +namespace +{ + constexpr Radio::Frequency preferred_3cm_frequency {10368200000ULL}; + constexpr Radio::Frequency entered_3cm_frequency {10368799000ULL}; + constexpr Radio::Frequency preferred_20m_frequency {14074000ULL}; + + class LiveFrequencyEditorFixture + { + public: + LiveFrequencyEditorFixture () + : frequencies {&bands} + { + frequencies.add ({preferred_3cm_frequency, Modes::Q65, IARURegions::ALL, + {}, {}, {}, {}, true}); + frequencies.add ({preferred_20m_frequency, Modes::FT8, IARURegions::ALL, + {}, {}, {}, {}, true}); + band_editor.setEditable (true); + band_editor.setModel (&frequencies); + band_editor.setModelColumn (FrequencyList_v2_101::frequency_mhz_column); + validator = std::make_unique ( + &band_editor, &bands, &frequencies, &nominal_frequency, false); + band_editor.setValidator (validator.get ()); + band_editor.setCurrentText (bands.find (nominal_frequency)); + + QObject::connect (validator.get (), &LiveFrequencyValidator::valid, + [&] (Radio::Frequency frequency) { + requests.append (frequency); + bands_at_request.append (band_editor.currentText ()); + if (accept_requests) + { + nominal_frequency = frequency; + } + else + { + band_editor.setCurrentText (bands.find (nominal_frequency)); + } + }); + } + + void enter (QString const& text, QString const& completed_text = {}) + { + band_editor.setFocus (); + band_editor.lineEdit ()->selectAll (); + QTest::keyClicks (band_editor.lineEdit (), text); + if (!completed_text.isEmpty ()) band_editor.lineEdit ()->setText (completed_text); + QTest::keyClick (band_editor.lineEdit (), Qt::Key_Return); + QCoreApplication::processEvents (); + } + + void send_focus_out () + { + QFocusEvent event {QEvent::FocusOut, Qt::MouseFocusReason}; + QCoreApplication::sendEvent (band_editor.lineEdit (), &event); + QCoreApplication::processEvents (); + } + + Bands bands; + FrequencyList_v2_101 frequencies; + Radio::Frequency nominal_frequency {preferred_3cm_frequency}; + QComboBox band_editor; + QVector requests; + QVector bands_at_request; + bool accept_requests {true}; + std::unique_ptr validator; + }; +} + +class TestFrequencyEditors + : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void frequency_line_edit_requires_positive_frequency (); + void frequency_line_edit_accepts_frequency_above_signed_range (); + void frequency_conversion_rejects_unsigned_limit (); + void frequency_delta_line_edit_accepts_signed_offsets (); + void station_list_rejects_invalid_offset_variants (); + void frequency_list_rejects_invalid_frequency_variants (); + void live_frequency_entry_requests_one_qsy_data (); + void live_frequency_entry_requests_one_qsy (); + void live_frequency_band_entry_requests_working_frequency (); + void live_frequency_rejected_request_preserves_selection (); + void live_frequency_focus_loss_without_edit_is_harmless (); +}; + +void TestFrequencyEditors::frequency_line_edit_requires_positive_frequency () +{ + FrequencyLineEdit editor; + + bool ok {true}; + editor.setText ("0"); + QCOMPARE (editor.frequency (&ok), Radio::Frequency {0}); + QVERIFY (!ok); + + editor.setText ("0.000001"); + QCOMPARE (editor.frequency (&ok), Radio::Frequency {1}); + QVERIFY (ok); +} + +void TestFrequencyEditors::frequency_line_edit_accepts_frequency_above_signed_range () +{ + FrequencyLineEdit editor; + editor.setText ("9223372036864.000000"); + + QVERIFY (editor.hasAcceptableInput ()); + bool ok {false}; + QCOMPARE (editor.frequency (&ok), Radio::Frequency {9223372036864000000ULL}); + QVERIFY (ok); +} + +void TestFrequencyEditors::frequency_conversion_rejects_unsigned_limit () +{ + auto const limit = std::ldexp (1., std::numeric_limits::digits); + bool ok {true}; + + QCOMPARE (Radio::frequency (limit, 0, &ok), Radio::Frequency {0}); + QVERIFY (!ok); +} + +void TestFrequencyEditors::frequency_delta_line_edit_accepts_signed_offsets () +{ + FrequencyDeltaLineEdit editor; + + bool ok {false}; + editor.setText ("0"); + QCOMPARE (editor.frequency_delta (&ok), Radio::FrequencyDelta {0}); + QVERIFY (ok); + + editor.setText ("-0.001"); + QCOMPARE (editor.frequency_delta (&ok), Radio::FrequencyDelta {-1000}); + QVERIFY (ok); +} + +void TestFrequencyEditors::station_list_rejects_invalid_offset_variants () +{ + Bands bands; + StationList stations {&bands, {{"20m", 1000, "Yagi"}}}; + auto const offset_index = stations.index (0, StationList::offset_column); + + QVERIFY (!stations.setData (offset_index, QString {"abc"}, Qt::EditRole)); + QCOMPARE (stations.data (offset_index, Qt::EditRole).value (), + Radio::FrequencyDelta {1000}); + + QVERIFY (stations.setData (offset_index, Radio::FrequencyDelta {-2000}, Qt::EditRole)); + QCOMPARE (stations.data (offset_index, Qt::EditRole).value (), + Radio::FrequencyDelta {-2000}); +} + +void TestFrequencyEditors::frequency_list_rejects_invalid_frequency_variants () +{ + Bands bands; + FrequencyList_v2_101 frequencies {&bands}; + auto const added_index = frequencies.add ({14074000, Modes::FT8, IARURegions::ALL, + QString {}, QString {}, QDateTime {}, QDateTime {}, false}); + auto const frequency_index = frequencies.index (added_index.row (), FrequencyList_v2_101::frequency_column); + + QVERIFY (!frequencies.setData (QModelIndex {}, Radio::Frequency {14075000}, Qt::EditRole)); + QVERIFY (!frequencies.setData (frequency_index, QString {"abc"}, Qt::EditRole)); + QCOMPARE (frequencies.data (frequency_index, Qt::EditRole).value (), + Radio::Frequency {14074000}); + + QVERIFY (!frequencies.setData (frequency_index, Radio::Frequency {0}, Qt::EditRole)); + QCOMPARE (frequencies.data (frequency_index, Qt::EditRole).value (), + Radio::Frequency {14074000}); + + QVERIFY (frequencies.setData (frequency_index, Radio::Frequency {14075000}, Qt::EditRole)); + QCOMPARE (frequencies.data (frequency_index, Qt::EditRole).value (), + Radio::Frequency {14075000}); +} + +void TestFrequencyEditors::live_frequency_entry_requests_one_qsy_data () +{ + QTest::addColumn ("entry"); + QTest::addColumn ("completed_text"); + QTest::addColumn ("expected_frequency"); + + QTest::newRow ("full-frequency") + << QString {"10368.799000"} << QString {} << entered_3cm_frequency; + QTest::newRow ("relative-khz") + << QString {"799k"} << QString {} << entered_3cm_frequency; + QTest::newRow ("completed-working-frequency") + << QString {"14.074"} << QString {"14.074000"} << preferred_20m_frequency; +} + +void TestFrequencyEditors::live_frequency_entry_requests_one_qsy () +{ + QFETCH (QString, entry); + QFETCH (QString, completed_text); + QFETCH (Radio::Frequency, expected_frequency); + LiveFrequencyEditorFixture fixture; + + fixture.enter (entry, completed_text); + + QCOMPARE (fixture.requests, QVector {expected_frequency}); + QCOMPARE (fixture.bands_at_request, + QVector {fixture.bands.find (expected_frequency)}); + QCOMPARE (fixture.band_editor.currentText (), fixture.bands.find (expected_frequency)); + + fixture.send_focus_out (); + QCOMPARE (fixture.requests, QVector {expected_frequency}); + + fixture.send_focus_out (); + QCOMPARE (fixture.requests, QVector {expected_frequency}); +} + +void TestFrequencyEditors::live_frequency_band_entry_requests_working_frequency () +{ + LiveFrequencyEditorFixture fixture; + fixture.nominal_frequency = 14074000; + fixture.band_editor.setCurrentText (fixture.bands.find (fixture.nominal_frequency)); + + fixture.enter ("3cm"); + + QCOMPARE (fixture.requests, QVector {preferred_3cm_frequency}); + QCOMPARE (fixture.bands_at_request, QVector {QString {"3cm"}}); + QCOMPARE (fixture.band_editor.currentText (), QString {"3cm"}); +} + +void TestFrequencyEditors::live_frequency_rejected_request_preserves_selection () +{ + LiveFrequencyEditorFixture fixture; + fixture.accept_requests = false; + + fixture.enter ("14.074", "14.074000"); + + QCOMPARE (fixture.requests, QVector {preferred_20m_frequency}); + QCOMPARE (fixture.bands_at_request, QVector {QString {"20m"}}); + QCOMPARE (fixture.band_editor.currentText (), QString {"3cm"}); + + fixture.send_focus_out (); + QCOMPARE (fixture.requests, QVector {preferred_20m_frequency}); + QCOMPARE (fixture.band_editor.currentText (), QString {"3cm"}); +} + +void TestFrequencyEditors::live_frequency_focus_loss_without_edit_is_harmless () +{ + LiveFrequencyEditorFixture fixture; + fixture.band_editor.lineEdit ()->setText ("10368.200000"); + fixture.band_editor.setFocus (); + QCoreApplication::processEvents (); + + fixture.send_focus_out (); + QCOMPARE (fixture.band_editor.currentText (), QString {"3cm"}); + QVERIFY (fixture.requests.isEmpty ()); +} + +QTEST_MAIN (TestFrequencyEditors) + +#include "test_frequency_editors.moc" diff --git a/tests/unit/common/test_hamlib_mode.cpp b/tests/unit/common/test_hamlib_mode.cpp new file mode 100644 index 00000000..ddae2878 --- /dev/null +++ b/tests/unit/common/test_hamlib_mode.cpp @@ -0,0 +1,78 @@ +#include + +#include "Transceiver/HamlibMode.hpp" + +class TestHamlibMode : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void fromHamlib_data () + { + QTest::addColumn ("hamlib_mode"); + QTest::addColumn ("transceiver_mode"); + + QTest::newRow ("PKTUSB") << rmode_t {RIG_MODE_PKTUSB} << Transceiver::DIG_U; + QTest::newRow ("USBD1") << rmode_t {RIG_MODE_USBD1} << Transceiver::DIG_U; + QTest::newRow ("USBD2") << rmode_t {RIG_MODE_USBD2} << Transceiver::DIG_U; + QTest::newRow ("USBD3") << rmode_t {RIG_MODE_USBD3} << Transceiver::DIG_U; + QTest::newRow ("PKTLSB") << rmode_t {RIG_MODE_PKTLSB} << Transceiver::DIG_L; + QTest::newRow ("LSBD1") << rmode_t {RIG_MODE_LSBD1} << Transceiver::DIG_L; + QTest::newRow ("LSBD2") << rmode_t {RIG_MODE_LSBD2} << Transceiver::DIG_L; + QTest::newRow ("LSBD3") << rmode_t {RIG_MODE_LSBD3} << Transceiver::DIG_L; + } + + Q_SLOT void fromHamlib () + { + QFETCH (rmode_t, hamlib_mode); + QFETCH (Transceiver::MODE, transceiver_mode); + + QCOMPARE (HamlibMode::from_hamlib (hamlib_mode), transceiver_mode); + } + + Q_SLOT void toHamlib () + { + QCOMPARE (HamlibMode::to_hamlib (Transceiver::DIG_U), RIG_MODE_PKTUSB); + QCOMPARE (HamlibMode::to_hamlib (Transceiver::DIG_L), RIG_MODE_PKTLSB); + } + + Q_SLOT void satisfiesRequest_data () + { + QTest::addColumn ("requested"); + QTest::addColumn ("current"); + QTest::addColumn ("satisfied"); + + QTest::newRow ("exact-PKTUSB") << rmode_t {RIG_MODE_PKTUSB} << rmode_t {RIG_MODE_PKTUSB} << true; + QTest::newRow ("PKTUSB-USBD1") << rmode_t {RIG_MODE_PKTUSB} << rmode_t {RIG_MODE_USBD1} << true; + QTest::newRow ("PKTUSB-USBD2") << rmode_t {RIG_MODE_PKTUSB} << rmode_t {RIG_MODE_USBD2} << true; + QTest::newRow ("PKTUSB-USBD3") << rmode_t {RIG_MODE_PKTUSB} << rmode_t {RIG_MODE_USBD3} << true; + QTest::newRow ("PKTLSB-LSBD1") << rmode_t {RIG_MODE_PKTLSB} << rmode_t {RIG_MODE_LSBD1} << true; + QTest::newRow ("PKTLSB-LSBD2") << rmode_t {RIG_MODE_PKTLSB} << rmode_t {RIG_MODE_LSBD2} << true; + QTest::newRow ("PKTLSB-LSBD3") << rmode_t {RIG_MODE_PKTLSB} << rmode_t {RIG_MODE_LSBD3} << true; + QTest::newRow ("PKTUSB-USB") << rmode_t {RIG_MODE_PKTUSB} << rmode_t {RIG_MODE_USB} << false; + QTest::newRow ("USB-USBD2") << rmode_t {RIG_MODE_USB} << rmode_t {RIG_MODE_USBD2} << false; + QTest::newRow ("USBD1-USBD2") << rmode_t {RIG_MODE_USBD1} << rmode_t {RIG_MODE_USBD2} << false; + QTest::newRow ("PKTUSB-LSBD2") << rmode_t {RIG_MODE_PKTUSB} << rmode_t {RIG_MODE_LSBD2} << false; + QTest::newRow ("PKTLSB-USBD2") << rmode_t {RIG_MODE_PKTLSB} << rmode_t {RIG_MODE_USBD2} << false; + } + + Q_SLOT void satisfiesRequest () + { + QFETCH (rmode_t, requested); + QFETCH (rmode_t, current); + QFETCH (bool, satisfied); + + QCOMPARE (HamlibMode::satisfies_request (requested, current), satisfied); + } + + Q_SLOT void changeRequired () + { + QVERIFY (!HamlibMode::change_required (Transceiver::UNK, RIG_MODE_USBD2)); + QVERIFY (!HamlibMode::change_required (Transceiver::DIG_U, RIG_MODE_USBD2)); + QVERIFY (HamlibMode::change_required (Transceiver::DIG_U, RIG_MODE_USB)); + QVERIFY (HamlibMode::change_required (Transceiver::USB, RIG_MODE_USBD2)); + } +}; + +QTEST_MAIN (TestHamlibMode) +#include "test_hamlib_mode.moc" diff --git a/tests/unit/common/test_hamlib_vfo_role_state.cpp b/tests/unit/common/test_hamlib_vfo_role_state.cpp new file mode 100644 index 00000000..44edb39a --- /dev/null +++ b/tests/unit/common/test_hamlib_vfo_role_state.cpp @@ -0,0 +1,83 @@ +#include + +#include + +#include "Transceiver/HamlibVfoRoleState.hpp" + +class TestHamlibVfoRoleState : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void receivingOnVfoAUsesNormalRoles () + { + HamlibVfoRoleState state; + state.observe_active_vfo (RIG_VFO_A, false); + + auto const vfos = state.resolve (RIG_VFO_A, RIG_VFO_B); + QCOMPARE (std::get<0> (vfos), RIG_VFO_A); + QCOMPARE (std::get<1> (vfos), RIG_VFO_B); + } + + Q_SLOT void receivingOnVfoBReversesRoles () + { + HamlibVfoRoleState state; + state.observe_active_vfo (RIG_VFO_B, false); + + auto const vfos = state.resolve (RIG_VFO_A, RIG_VFO_B); + QCOMPARE (std::get<0> (vfos), RIG_VFO_B); + QCOMPARE (std::get<1> (vfos), RIG_VFO_A); + } + + Q_SLOT void splitPttPreservesNormalRoles () + { + HamlibVfoRoleState state; + state.observe_active_vfo (RIG_VFO_A, false); + state.observe_active_vfo (RIG_VFO_B, true); + + auto const vfos = state.resolve (RIG_VFO_A, RIG_VFO_B); + QCOMPARE (std::get<0> (vfos), RIG_VFO_A); + QCOMPARE (std::get<1> (vfos), RIG_VFO_B); + } + + Q_SLOT void splitPttPreservesReversedRoles () + { + HamlibVfoRoleState state; + state.observe_active_vfo (RIG_VFO_B, false); + state.observe_active_vfo (RIG_VFO_A, true); + + auto const vfos = state.resolve (RIG_VFO_A, RIG_VFO_B); + QCOMPARE (std::get<0> (vfos), RIG_VFO_B); + QCOMPARE (std::get<1> (vfos), RIG_VFO_A); + } + + Q_SLOT void observationResumesAfterSplitPtt () + { + HamlibVfoRoleState state; + state.observe_active_vfo (RIG_VFO_A, false); + state.observe_active_vfo (RIG_VFO_B, true); + state.observe_active_vfo (RIG_VFO_B, false); + + auto const vfos = state.resolve (RIG_VFO_A, RIG_VFO_B); + QCOMPARE (std::get<0> (vfos), RIG_VFO_B); + QCOMPARE (std::get<1> (vfos), RIG_VFO_A); + } + + Q_SLOT void resetRestoresNormalRoles () + { + HamlibVfoRoleState state; + auto vfos = state.resolve (RIG_VFO_A, RIG_VFO_B); + QCOMPARE (std::get<0> (vfos), RIG_VFO_A); + QCOMPARE (std::get<1> (vfos), RIG_VFO_B); + + state.observe_active_vfo (RIG_VFO_B, false); + state.reset (); + + vfos = state.resolve (RIG_VFO_A, RIG_VFO_B); + QCOMPARE (std::get<0> (vfos), RIG_VFO_A); + QCOMPARE (std::get<1> (vfos), RIG_VFO_B); + } +}; + +QTEST_APPLESS_MAIN (TestHamlibVfoRoleState) +#include "test_hamlib_vfo_role_state.moc" diff --git a/tests/unit/common/test_highlighting_rules.cpp b/tests/unit/common/test_highlighting_rules.cpp new file mode 100644 index 00000000..77e56852 --- /dev/null +++ b/tests/unit/common/test_highlighting_rules.cpp @@ -0,0 +1,86 @@ +#include + +#include "HighlightingRules.hpp" + +class TestHighlightingRules + : public QObject +{ + Q_OBJECT + +private: + Q_SLOT void directional_call_matching_data () + { + QTest::addColumn ("configured_entries"); + QTest::addColumn ("directional_call"); + QTest::addColumn ("matches"); + + QTest::newRow ("first entry") << "DX,POTA,SOTA," << "DX" << true; + QTest::newRow ("middle entry") << "DX,POTA,SOTA," << "POTA" << true; + QTest::newRow ("last entry") << "DX,POTA,SOTA," << "SOTA" << true; + QTest::newRow ("last without trailing comma") << "DX,POTA,SOTA" << "SOTA" << true; + QTest::newRow ("documented spaces") << "DX, POTA, SOTA," << "POTA" << true; + QTest::newRow ("single entry") << "POTA" << "POTA" << true; + QTest::newRow ("single trailing comma") << "POTA," << "POTA" << true; + QTest::newRow ("legacy leading comma") << ",POTA," << "POTA" << true; + QTest::newRow ("empty fields") << ",, POTA ,," << "POTA" << true; + QTest::newRow ("lowercase entry") << "dx,pota," << "POTA" << true; + QTest::newRow ("callsign suffix") << "K1DX," << "DX" << false; + QTest::newRow ("longer token") << "NOTPOTA," << "POTA" << false; + QTest::newRow ("prefix syntax") << "VK;ZL;T88;" << "VK" << false; + QTest::newRow ("missing entry") << "DX,POTA," << "SOTA" << false; + QTest::newRow ("empty configuration") << "" << "DX" << false; + QTest::newRow ("empty directional call") << "DX," << "" << false; + } + + Q_SLOT void directional_call_matching () + { + QFETCH (QString, configured_entries); + QFETCH (QString, directional_call); + QFETCH (bool, matches); + + QCOMPARE (HighlightingRules::matchesDirectionalCall (configured_entries, directional_call), matches); + } + + Q_SLOT void callsign_prefix_matching_data () + { + QTest::addColumn ("configured_entries"); + QTest::addColumn ("call"); + QTest::addColumn ("matches"); + + QTest::newRow ("exact callsign") << "W1AW," << "W1AW" << true; + QTest::newRow ("exact callsign, no match") << "W1AW," << "K1ABC" << false; + QTest::newRow ("3-char prefix") << ";OK9;" << "OK9ABC" << true; + QTest::newRow ("3-char prefix, unanchored substring is not a match") << ";HOK9;" << "OK9ABC" << false; + QTest::newRow ("2-char prefix") << ";VK;" << "VK2ABC" << true; + QTest::newRow ("bare 1-char prefix matches digit-second call") << ";K;" << "K1ABC" << true; + QTest::newRow ("bare 1-char prefix does not match compound entity") << ";K;" << "KH6ABC" << false; + QTest::newRow ("wildcard 1-char prefix matches digit-second call") << ";K*;" << "K1ABC" << true; + QTest::newRow ("wildcard 1-char prefix matches compound entity") << ";K*;" << "KH6ABC" << true; + QTest::newRow ("exclusion overrides wildcard for 3-char prefix") << ";K*;!KH6!" << "KH6ABC" << false; + QTest::newRow ("exclusion overrides wildcard for 2-char prefix") << ";K*;!KL!" << "KL7ABC" << false; + QTest::newRow ("all three named exclusions apply") << ";K*;!KH6!KL!KP!" << "KP4ABC" << false; + QTest::newRow ("exclusion does not affect plain matches") << ";K*;!KH6!" << "K1ABC" << true; + QTest::newRow ("exclusion does not affect an unrelated 2-char prefix") << ";K*;VK;!KH6!" << "VK2ABC" << true; + QTest::newRow ("no configured entries") << "" << "K1ABC" << false; + QTest::newRow ("call too short") << ";K*;" << "K1" << false; + QTest::newRow ("documented format's first prefix has no leading semicolon") + << "VK;ZL;T88;" << "VK2ABC" << true; + QTest::newRow ("exact callsign does not match as a substring tail of a longer entry") + << "AK1ABC," << "K1ABC" << false; + QTest::newRow ("exact callsign still matches when properly delimited alongside a longer entry") + << "AK1ABC,K1ABC," << "K1ABC" << true; + } + + Q_SLOT void callsign_prefix_matching () + { + QFETCH (QString, configured_entries); + QFETCH (QString, call); + QFETCH (bool, matches); + + QCOMPARE (HighlightingRules::matchesCallsignPrefix (configured_entries, call), matches); + } +}; + +QTEST_MAIN (TestHighlightingRules); + +#include "test_highlighting_rules.moc" diff --git a/tests/unit/common/test_hound_transmission_policy.cpp b/tests/unit/common/test_hound_transmission_policy.cpp new file mode 100644 index 00000000..5a71417b --- /dev/null +++ b/tests/unit/common/test_hound_transmission_policy.cpp @@ -0,0 +1,179 @@ +#include + +#include "HoundTransmissionPolicy.hpp" + +class TestHoundTransmissionPolicy final : public QObject +{ + Q_OBJECT + +private slots: + void planFoxReportReply_data (); + void planFoxReportReply (); + void planInitialCallingFrequency_data (); + void planInitialCallingFrequency (); + void planReplyTransmission_data (); + void planReplyTransmission (); +}; + +void TestHoundTransmissionPolicy::planFoxReportReply_data () +{ + QTest::addColumn ("protocol"); + QTest::addColumn ("tune"); + QTest::addColumn ("autoEnabled"); + QTest::addColumn ("priorReplyState"); + QTest::addColumn ("applyReply"); + QTest::addColumn ("enableAuto"); + QTest::addColumn ("frequencyAction"); + QTest::addColumn ("nextReplyState"); + + using namespace HoundTransmissionPolicy; + QTest::newRow ("classic") << int (Protocol::Classic) << false << false + << int (ReplyState::None) << true << true << int (FrequencyAction::Set) + << int (ReplyState::FirstReplyPending); + QTest::newRow ("auto already enabled") << int (Protocol::Classic) << false << true + << int (ReplyState::None) << true << false << int (FrequencyAction::Set) + << int (ReplyState::FirstReplyPending); + QTest::newRow ("SuperHound") << int (Protocol::SuperFox) << false << false + << int (ReplyState::None) << true << true << int (FrequencyAction::Keep) + << int (ReplyState::FirstReplyPending); + QTest::newRow ("tune") << int (Protocol::Classic) << true << false + << int (ReplyState::FirstReplySent) << false << false << int (FrequencyAction::Keep) + << int (ReplyState::FirstReplySent); +} + +void TestHoundTransmissionPolicy::planFoxReportReply () +{ + QFETCH (int, protocol); + QFETCH (bool, tune); + QFETCH (bool, autoEnabled); + QFETCH (int, priorReplyState); + QFETCH (bool, applyReply); + QFETCH (bool, enableAuto); + QFETCH (int, frequencyAction); + QFETCH (int, nextReplyState); + + using namespace HoundTransmissionPolicy; + State state; + state.replyState = static_cast (priorReplyState); + state.foxFrequency = 321; + ReplyInput input; + input.protocol = static_cast (protocol); + input.tune = tune; + input.autoEnabled = autoEnabled; + input.sentReport = -17; + input.decodedFoxFrequency = 654; + input.trPeriod = 15.0; + + auto const plan = HoundTransmissionPolicy::planFoxReportReply (state, input); + QCOMPARE (plan.applyReply, applyReply); + QCOMPARE (plan.enableAuto, enableAuto); + QCOMPARE (int (plan.frequencyDecision.action), frequencyAction); + QCOMPARE (int (plan.nextState.replyState), nextReplyState); + QCOMPARE (plan.nextState.foxFrequency, 654); + if (applyReply) + { + QCOMPARE (int (plan.txMessage), int (TxMessage::Tx3)); + QCOMPARE (plan.report, -17); + QCOMPARE (plan.timeoutMilliseconds, 165000); + if (FrequencyAction::Set == plan.frequencyDecision.action) + { + QCOMPARE (plan.frequencyDecision.frequency, 654); + } + } + else + { + QCOMPARE (int (plan.txMessage), int (TxMessage::None)); + QCOMPARE (plan.timeoutMilliseconds, 0); + } +} + +void TestHoundTransmissionPolicy::planInitialCallingFrequency_data () +{ + using namespace HoundTransmissionPolicy; + QTest::addColumn ("autoEnabled"); + QTest::addColumn ("tune"); + QTest::addColumn ("selectedTxMessage"); + QTest::addColumn ("currentTxFrequency"); + QTest::addColumn ("frequencyAction"); + + QTest::newRow ("eligible at 998 Hz") << true << false << 1 << 998 + << int (FrequencyAction::RandomizeCalling); + QTest::newRow ("Auto off") << false << false << 1 << 998 << int (FrequencyAction::Keep); + QTest::newRow ("Tune") << true << true << 1 << 998 << int (FrequencyAction::Keep); + QTest::newRow ("Tx3") << true << false << 3 << 998 << int (FrequencyAction::Keep); + QTest::newRow ("999 Hz") << true << false << 1 << 999 << int (FrequencyAction::Keep); +} + +void TestHoundTransmissionPolicy::planInitialCallingFrequency () +{ + QFETCH (bool, autoEnabled); + QFETCH (bool, tune); + QFETCH (int, selectedTxMessage); + QFETCH (int, currentTxFrequency); + QFETCH (int, frequencyAction); + + using namespace HoundTransmissionPolicy; + ClassicTxStartInput input; + input.autoEnabled = autoEnabled; + input.tune = tune; + input.selectedTxMessage = selectedTxMessage; + input.currentTxFrequency = currentTxFrequency; + auto const plan = planClassicTxStart (State {}, input); + QCOMPARE (int (plan.frequencyDecision.action), frequencyAction); +} + +void TestHoundTransmissionPolicy::planReplyTransmission_data () +{ + QTest::addColumn ("replyState"); + QTest::addColumn ("foxFrequency"); + QTest::addColumn ("selectedTxMessage"); + QTest::addColumn ("tune"); + QTest::addColumn ("frequencyAction"); + QTest::addColumn ("frequency"); + QTest::addColumn ("nextReplyState"); + + using namespace HoundTransmissionPolicy; + QTest::newRow ("first reply") << int (ReplyState::FirstReplyPending) << 600 << 3 << false + << int (FrequencyAction::Keep) << 0 << int (ReplyState::FirstReplySent); + QTest::newRow ("retry at 600 Hz") << int (ReplyState::FirstReplySent) << 600 << 3 << false + << int (FrequencyAction::Set) << 900 << int (ReplyState::FirstReplySent); + QTest::newRow ("retry at 601 Hz") << int (ReplyState::FirstReplySent) << 601 << 3 << false + << int (FrequencyAction::Set) << 301 << int (ReplyState::FirstReplySent); + QTest::newRow ("non-Tx3 retry") << int (ReplyState::FirstReplySent) << 600 << 2 << false + << int (FrequencyAction::Keep) << 0 << int (ReplyState::FirstReplySent); + QTest::newRow ("Tune retry") << int (ReplyState::FirstReplySent) << 600 << 3 << true + << int (FrequencyAction::Set) << 900 << int (ReplyState::FirstReplySent); + QTest::newRow ("non-Tx3 advances pending") << int (ReplyState::FirstReplyPending) << 600 << 2 << true + << int (FrequencyAction::Keep) << 0 << int (ReplyState::FirstReplySent); +} + +void TestHoundTransmissionPolicy::planReplyTransmission () +{ + QFETCH (int, replyState); + QFETCH (int, foxFrequency); + QFETCH (int, selectedTxMessage); + QFETCH (bool, tune); + QFETCH (int, frequencyAction); + QFETCH (int, frequency); + QFETCH (int, nextReplyState); + + using namespace HoundTransmissionPolicy; + State state; + state.replyState = static_cast (replyState); + state.foxFrequency = foxFrequency; + ClassicTxStartInput input; + input.autoEnabled = true; + input.tune = tune; + input.selectedTxMessage = selectedTxMessage; + input.currentTxFrequency = 1500; + + auto const plan = planClassicTxStart (state, input); + QCOMPARE (int (plan.frequencyDecision.action), frequencyAction); + QCOMPARE (plan.frequencyDecision.frequency, frequency); + QCOMPARE (int (plan.nextState.replyState), nextReplyState); + QCOMPARE (plan.nextState.foxFrequency, foxFrequency); +} + +QTEST_GUILESS_MAIN (TestHoundTransmissionPolicy) + +#include "test_hound_transmission_policy.moc" diff --git a/tests/unit/common/test_http_user_agent.cpp b/tests/unit/common/test_http_user_agent.cpp new file mode 100644 index 00000000..6539f8c0 --- /dev/null +++ b/tests/unit/common/test_http_user_agent.cpp @@ -0,0 +1,53 @@ +#include + +#include "revision_utils.hpp" + +class TestHttpUserAgent final + : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void labelsDisplayRevision () + { + auto const display = display_revision (); + auto const build_revision = revision (); + + if (build_revision.isEmpty ()) + { + QVERIFY (display == "(revision unavailable)" + || display.contains (", build unavailable)")); + } + else if (display.startsWith ("(source ")) + { + QVERIFY (display.endsWith (", build " + build_revision + ")")); + } + else + { + QCOMPARE (display, "(revision " + build_revision + ")"); + } + } + + void includesApplicationIdentityAndPlatformContext () + { + auto const user_agent = http_user_agent (); + + QVERIFY (user_agent.startsWith ("WSJT-X/")); + QVERIFY (user_agent.contains (version ())); + + auto const build_revision = revision (); + if (!build_revision.isEmpty ()) + { + QVERIFY (user_agent.contains ("_" + build_revision)); + } + + QVERIFY (user_agent.contains ('(')); + QVERIFY (user_agent.contains (')')); + QVERIFY (!user_agent.contains ('\n')); + QVERIFY (!user_agent.contains ('\r')); + } +}; + +QTEST_GUILESS_MAIN (TestHttpUserAgent) + +#include "test_http_user_agent.moc" diff --git a/tests/unit/common/test_livecq_callsign.cpp b/tests/unit/common/test_livecq_callsign.cpp new file mode 100644 index 00000000..24d81939 --- /dev/null +++ b/tests/unit/common/test_livecq_callsign.cpp @@ -0,0 +1,39 @@ +#include + +#include "validators/LiveCQCallsign.hpp" + +class TestLiveCQCallsign final : public QObject +{ + Q_OBJECT + +private slots: + void acceptsThreeCharacterCalls() + { + QVERIFY(LiveCQ::isValidCallsign("N5L")); + QVERIFY(LiveCQ::isValidCallsign("K1A")); + QVERIFY(LiveCQ::isValidCallsign("GM/N5L")); + } + + void preservesExistingValidCalls() + { + for (auto const& callsign : {QString {"K1ABC"}, QString {"YW18FIFA"}, + QString {"QU1RK"}, QString {""}, + QString {"K1ABC/P"}}) { + QVERIFY2(LiveCQ::isValidCallsign(callsign), qPrintable(callsign)); + } + } + + void rejectsEmptyShortAndInvalidCalls() + { + for (auto const& callsign : {QString {}, QString {"N"}, QString {"N5"}, + QString {"KABC"}, QString {"Q1ABC"}, + QString {"K1AB1"}, QString {"K1ABCDE"}, + QString {"K1AB-C"}, QString {"K1AB?"}}) { + QVERIFY2(!LiveCQ::isValidCallsign(callsign), qPrintable(callsign)); + } + } +}; + +QTEST_APPLESS_MAIN(TestLiveCQCallsign) + +#include "test_livecq_callsign.moc" diff --git a/tests/unit/common/test_mainwindow_compact_controls.cpp b/tests/unit/common/test_mainwindow_compact_controls.cpp new file mode 100644 index 00000000..a3a99fa5 --- /dev/null +++ b/tests/unit/common/test_mainwindow_compact_controls.cpp @@ -0,0 +1,114 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +#include +#include +#include +#include +#include +#include "widgets/CompactButtonSize.hpp" +#include "widgets/CurrentPageHeightStackedWidget.hpp" +#include "widgets/TxDriveSlider.hpp" + +class CompactControlsTest : public QObject +{ + Q_OBJECT +private Q_SLOTS: + void currentStackPageHeight () + { + CurrentPageHeightStackedWidget stack; + auto makePage = [&stack] (int rows) + { + auto * page = new QWidget {&stack}; + auto * layout = new QVBoxLayout {page}; + for (int row = 0; row < rows; ++row) + layout->addWidget (new QPushButton {QString::number (row), page}); + return page; + }; + auto * shortPage = makePage (2); + auto * tallPage = makePage (6); + stack.addWidget (shortPage); + stack.addWidget (tallPage); + stack.ensurePolished (); + + stack.setCurrentWidget (shortPage); + QCOMPARE (stack.sizeHint ().height (), shortPage->sizeHint ().height ()); + QVERIFY (stack.sizeHint ().height () < tallPage->sizeHint ().height ()); + + stack.setCurrentWidget (tallPage); + QCOMPARE (stack.sizeHint ().height (), tallPage->sizeHint ().height ()); + } + + void nativeSlider () + { +#ifndef Q_OS_WIN + QSKIP ("Native Windows slider contract"); +#else + for (int width : {27, 44}) + for (int value : {0, 225, 450}) + { + TxDriveSlider actual; + QSlider reference; + reference.setTickPosition (QSlider::TicksRight); + reference.setTickInterval (50); + for (auto * slider : {static_cast (&actual), &reference}) + { + slider->setOrientation (Qt::Vertical); + slider->setRange (0, 450); + slider->setInvertedAppearance (true); + slider->setValue (value); + slider->resize (width, 200); + slider->ensurePolished (); + } + QCOMPARE (actual.tickPosition (), reference.tickPosition ()); + QCOMPARE (actual.sizeHint (), reference.sizeHint ()); + QCOMPARE (actual.minimumSizeHint (), reference.minimumSizeHint ()); + QCOMPARE (actual.grab ().toImage (), reference.grab ().toImage ()); + } +#endif + } + void compactButtons () + { +#if defined (Q_OS_WIN) + auto const families = {QStringLiteral ("Arial"), QStringLiteral ("Segoe UI")}; +#elif defined (Q_OS_LINUX) + auto const families = {QStringLiteral ("DejaVu Sans"), QStringLiteral ("Liberation Sans")}; +#else + QSKIP ("Compact Windows and Linux button contract"); +#endif +#if defined (Q_OS_WIN) || defined (Q_OS_LINUX) + for (auto const& family : families) + for (int points : {8, 10, 13, 16}) + { + QPushButton button {QStringLiteral ("Tx &1")}; + button.setFont (QFont {family, points}); + button.ensurePolished (); + auto shortSize = compactButtonSize (&button); + QVERIFY (shortSize.width () < button.sizeHint ().width ()); + button.resize (shortSize); + QStyleOptionButton option; + option.initFrom (&button); + auto contents = button.style ()->subElementRect (QStyle::SE_PushButtonContents, &option, &button); + auto text = button.fontMetrics ().size (Qt::TextShowMnemonic, button.text ()); + QVERIFY (contents.width () >= text.width ()); + QVERIFY (contents.height () >= text.height ()); + for (auto const& label : {QStringLiteral ("&Lookup"), + QStringLiteral ("Add"), + QStringLiteral ("Ignore")}) + { + button.setText (label); + button.resize (compactButtonSize (&button)); + option.initFrom (&button); + contents = button.style ()->subElementRect ( + QStyle::SE_PushButtonContents, &option, &button); + text = button.fontMetrics ().size ( + Qt::TextShowMnemonic, button.text ()); + QVERIFY (contents.width () >= text.width ()); + QVERIFY (contents.height () >= text.height ()); + } + button.setText (QStringLiteral ("Translated action label")); + QVERIFY (compactButtonSize (&button).width () > shortSize.width ()); + } +#endif + } +}; +QTEST_MAIN (CompactControlsTest) +#include "test_mainwindow_compact_controls.moc" diff --git a/tests/unit/common/test_operating_frequency.cpp b/tests/unit/common/test_operating_frequency.cpp new file mode 100644 index 00000000..6564027f --- /dev/null +++ b/tests/unit/common/test_operating_frequency.cpp @@ -0,0 +1,211 @@ +#include +#include "OperatingFrequency.hpp" + +namespace +{ + using Owner = OperatingFrequency; + constexpr Radio::Frequency rf = 10368200000ULL; + constexpr Radio::Frequency intermediate = 144200000; + Owner::Observation offline {false, false, false, 0, 0}; + Owner::Observation initial {true, false, false, intermediate, 0}; + Owner::Context automatic {false, true, true, true, false, 0, 0}; + struct Recorder + { + QVector commands; + bool accepted = true; + bool operator() (Radio::Frequency value) + { + commands.append (value); + return accepted; + } + }; +} + +class TestOperatingFrequency : public QObject +{ + Q_OBJECT +private slots: + void startupAndDoppler_data () + { + QTest::addColumn ("responseFirst"); + QTest::addColumn ("initialCorrection"); + QTest::newRow ("correction-before-response") << false << qint64 (0); + QTest::newRow ("response-before-correction") << true << qint64 (0); + QTest::newRow ("nonzero-correction-before-response") << false << qint64 (125); + QTest::newRow ("nonzero-response-before-correction") << true << qint64 (125); + } + + void startupAndDoppler () + { + QFETCH (bool, responseFirst); + QFETCH (qint64, initialCorrection); + Owner frequency {rf}; + Recorder requests; + auto context = automatic; + context.rxCorrection = initialCorrection; + context.txCorrection = -50; + auto const transition = frequency.reconcile (offline, initial, context, std::ref (requests)); + QVERIFY (transition.restorationAccepted); + QVERIFY (transition.monitor && *transition.monitor); + QCOMPARE (transition.before.rx, 0ULL); + QCOMPARE (transition.after.rx, rf); + QCOMPARE (transition.after.tx, rf); + QCOMPARE (transition.after.remembered, rf); + QCOMPARE (requests.commands, QVector {rf + initialCorrection}); + context.monitoring = true; + Owner::Observation response {true, false, false, rf + initialCorrection, 0}; + if (responseFirst) + frequency.reconcile (initial, response, context, std::ref (requests)); + context.rxCorrection = 175; + requests (frequency.correctedRx (context.rxCorrection)); + QCOMPARE (requests.commands.last (), rf + 175); + // Configuration forwards RF plus correction and filters superseded responses. + Owner::Observation corrected {true, false, false, rf + 175, 0}; + frequency.reconcile (responseFirst ? response : initial, corrected, context, std::ref (requests)); + QCOMPARE (frequency.rx (), rf); + QCOMPARE (frequency.tx (), rf); + QCOMPARE (frequency.remembered (), rf); + auto const count = requests.commands.size (); + frequency.reconcile (corrected, corrected, context, std::ref (requests)); + QCOMPARE (requests.commands.size (), count); + corrected.rx += 1000; + frequency.reconcile (response, corrected, context, std::ref (requests)); + QCOMPARE (frequency.rx (), rf + 1000); + QCOMPARE (frequency.remembered (), rf + 1000); + } + + void manualMonitorPreservesSavedTarget () + { + Owner frequency {rf}; + Recorder requests; + auto context = automatic; + context.monitorAtStartup = false; + auto transition = frequency.reconcile (offline, initial, context, std::ref (requests)); + QVERIFY (transition.monitor && !*transition.monitor); + QCOMPARE (frequency.rx (), intermediate); + QCOMPARE (frequency.tx (), intermediate); + QCOMPARE (frequency.remembered (), rf); + auto tuned = initial; + tuned.rx += 2000; + frequency.reconcile (initial, tuned, context, std::ref (requests)); + QCOMPARE (frequency.rx (), tuned.rx); + QCOMPARE (frequency.remembered (), rf); + transition = frequency.enableMonitor (context, std::ref (requests)); + QVERIFY (transition.restorationAccepted); + QCOMPARE (requests.commands, QVector {rf}); + QCOMPARE (frequency.rx (), rf); + QCOMPARE (frequency.remembered (), rf); + } + + void restorationEligibility_data () + { + QTest::addColumn ("restore"); + QTest::addColumn ("echo"); + QTest::addColumn ("allowed"); + QTest::newRow ("disabled") << false << false << true; + QTest::newRow ("echo") << true << true << true; + QTest::newRow ("monitor-blocked") << true << false << false; + } + + void restorationEligibility () + { + QFETCH (bool, restore); + QFETCH (bool, echo); + QFETCH (bool, allowed); + Owner frequency {rf}; + Recorder requests; + auto context = automatic; + context.restore = restore; + context.echo = echo; + context.monitorAllowed = allowed; + auto transition = frequency.reconcile (offline, initial, context, std::ref (requests)); + QVERIFY (!transition.restorationAccepted); + QVERIFY (requests.commands.isEmpty ()); + QCOMPARE (frequency.rx (), intermediate); + QCOMPARE (frequency.remembered (), !restore && allowed && !echo ? intermediate : rf); + frequency.enableMonitor (context, std::ref (requests)); + QVERIFY (requests.commands.isEmpty ()); + } + + void rejectionAndReconnect () + { + Owner frequency {rf}; + Recorder requests; + requests.accepted = false; + auto context = automatic; + auto transition = frequency.reconcile (offline, initial, context, std::ref (requests)); + QVERIFY (!transition.restorationAccepted); + QCOMPARE (frequency.rx (), intermediate); + QCOMPARE (frequency.tx (), intermediate); + QCOMPARE (frequency.remembered (), rf); + context.monitoring = true; + frequency.reconcile (initial, initial, context, std::ref (requests)); + frequency.reconcile (initial, offline, context, std::ref (requests)); + QCOMPARE (frequency.rx (), intermediate); + QCOMPARE (frequency.remembered (), rf); + Owner::Observation zero {true, false, false, 0, 0}; + frequency.reconcile (initial, zero, context, std::ref (requests)); + QCOMPARE (frequency.remembered (), rf); + // A reconnect while already monitoring is not a new Monitor activation. + frequency.reconcile (offline, initial, context, std::ref (requests)); + QCOMPARE (requests.commands.size (), 1); + QCOMPARE (frequency.remembered (), rf); + context.monitoring = false; + requests.accepted = true; + transition = frequency.reconcile (offline, initial, context, std::ref (requests)); + QVERIFY (transition.restorationAccepted); + QCOMPARE (requests.commands.size (), 2); + QCOMPARE (frequency.rx (), rf); + QCOMPARE (frequency.remembered (), rf); + } + + void acceptedRequestsAndTxReports () + { + Owner frequency {rf}; + Recorder requests; + auto const* stableRx = &frequency.rx (); + QVERIFY (frequency.requestNominal (intermediate, 125, std::ref (requests))); + QCOMPARE (requests.commands.last (), intermediate + 125); + QCOMPARE (*stableRx, intermediate); + QCOMPARE (frequency.tx (), intermediate); + requests.accepted = false; + QVERIFY (!frequency.requestNominal (432200000, 0, std::ref (requests))); + QCOMPARE (frequency.rx (), intermediate); + QCOMPARE (frequency.tx (), intermediate); + QCOMPARE (frequency.remembered (), rf); + QVERIFY (!frequency.requestNominal (0, 0, std::ref (requests))); + auto context = automatic; + context.monitoring = true; + context.rxCorrection = 125; + context.txCorrection = 50; + Owner::Observation rx {true, false, false, 432200125, 0}; + frequency.reconcile (initial, rx, context, std::ref (requests)); + QCOMPARE (frequency.rx (), 432200000ULL); + QCOMPARE (frequency.remembered (), 432200000ULL); + Owner::Observation split {true, true, true, 432200125, 432201050}; + frequency.reconcile (rx, split, context, std::ref (requests)); + QCOMPARE (frequency.tx (), 432201000ULL); + QCOMPARE (frequency.rx (), 432200000ULL); + auto changedTx = split; + changedTx.tx += 500; + frequency.reconcile (split, changedTx, context, std::ref (requests)); + QCOMPARE (frequency.tx (), 432201500ULL); + Owner::Observation simplex {true, true, false, 432202000, 0}; + frequency.reconcile (split, simplex, context, std::ref (requests)); + QCOMPARE (frequency.tx (), 432202000ULL); + auto adjustTx = [&] (Radio::Frequency nominal) { + if (!requests (nominal + context.txCorrection)) return false; + frequency.commitAcceptedTx (nominal); + return true; + }; + QVERIFY (!adjustTx (432203000)); + QCOMPARE (frequency.tx (), 432202000ULL); + requests.accepted = true; + QVERIFY (adjustTx (432203000)); + QCOMPARE (frequency.correctedTx (-25), 432202975ULL); + QCOMPARE (frequency.rx (), 432200000ULL); + } +}; + +QTEST_GUILESS_MAIN (TestOperatingFrequency) +#include "test_operating_frequency.moc" diff --git a/tests/unit/common/test_qso_reaction.cpp b/tests/unit/common/test_qso_reaction.cpp new file mode 100644 index 00000000..310bb68a --- /dev/null +++ b/tests/unit/common/test_qso_reaction.cpp @@ -0,0 +1,712 @@ +#include + +#include "QsoReactionTestSupport.hpp" + +namespace +{ + using namespace QsoReactionTestSupport; + + Snapshot baseSnapshot() + { + auto snapshot = neutralStationSnapshot(); + snapshot.mode = "FT8"; + snapshot.tx1Enabled = true; + return snapshot; + } + + struct FinalState + { + int txMessage; + QsoProgress progress; + }; + + FinalState finalState(Plan const& plan, Snapshot const& snapshot) + { + FinalState state {snapshot.selectedTxMessage, snapshot.qsoProgress}; + for (auto const& effect : plan.effects) { + if (effect.kind == Effect::Kind::SetTxMessage + || effect.kind == Effect::Kind::SetTxMessageIndex + || effect.kind == Effect::Kind::CheckTxMessage + || effect.kind == Effect::Kind::ClickTxMessage) { + state.txMessage = effect.intValue; + } else if (effect.kind == Effect::Kind::SetQsoProgress) { + state.progress = effect.progress; + } + } + return state; + } +} + +class TestQsoReaction final + : public QObject +{ + Q_OBJECT + +private slots: + void qsoProgressValuesMatchDecoderContract() + { + QCOMPARE(static_cast(QsoProgress::Calling), 0); + QCOMPARE(static_cast(QsoProgress::Replying), 1); + QCOMPARE(static_cast(QsoProgress::Report), 2); + QCOMPARE(static_cast(QsoProgress::RogerReport), 3); + QCOMPARE(static_cast(QsoProgress::Rogers), 4); + QCOMPARE(static_cast(QsoProgress::Signoff), 5); + } + + void rrrAutoTxShutdownPolicy_data() + { + QTest::addColumn("mode"); + QTest::addColumn("repeatTx"); + QTest::addColumn("sendRr73"); + QTest::addColumn("expectedDefer"); + + QTest::newRow("MSK144 RRR") << "MSK144" << false << false << true; + QTest::newRow("MSK144 RRR repeat") << "MSK144" << true << false << true; + QTest::newRow("MSK144 RR73 repeat") << "MSK144" << true << true << false; + QTest::newRow("Q65 RRR") << "Q65" << false << false << false; + QTest::newRow("Q65 RRR repeat") << "Q65" << true << false << true; + QTest::newRow("Q65 RR73 repeat") << "Q65" << true << true << false; + QTest::newRow("FT8 RRR") << "FT8" << true << false << false; + } + + void rrrAutoTxShutdownPolicy() + { + QFETCH(QString, mode); + QFETCH(bool, repeatTx); + QFETCH(bool, sendRr73); + QFETCH(bool, expectedDefer); + + QCOMPARE(DecodedMessageReaction::shouldDeferAutoTxStopAfterRrr(mode, repeatTx, sendRr73), + expectedDefer); + + bool stopCalled {false}; + DecodedMessageReaction::applyAutoTxStopAfterLogging( + mode, repeatTx, sendRr73, [&stopCalled] { stopCalled = true; }); + QCOMPARE(stopCalled, !expectedDefer); + } + + void q65Final73LoggingStopsAutoTxWhenRepeatIsDisabled() + { + auto snapshot = baseSnapshot(); + snapshot.mode = "Q65"; + snapshot.qsoProgress = QsoProgress::Rogers; + snapshot.loggingEnabled = true; + snapshot.repeatTx = false; + snapshot.sendRr73 = false; + + auto const plan = DecodedMessageReaction::planProcessMessage( + decode("K1ABC W1AW 73", ":"), snapshot); + + QVERIFY(hasEffect(plan, Effect::Kind::RequestLogQso)); + QCOMPARE(intEffect(plan, Effect::Kind::SetTxMessageIndex), 6); + QVERIFY(!hasEffect(plan, Effect::Kind::ScheduleAutoFlagOff)); + QVERIFY(!DecodedMessageReaction::shouldDeferAutoTxStopAfterRrr( + snapshot.mode, snapshot.repeatTx, snapshot.sendRr73)); + } + + void responseTransitions_data() + { + QTest::addColumn("initialProgress"); + QTest::addColumn("response"); + QTest::addColumn("expectedTxMessage"); + QTest::addColumn("expectedProgress"); + QTest::addColumn("expectedReaction"); + + QStringList const responses {"FN31", "-10", "R", "R-10", "RRR", "RR73", "73"}; + for (int initial = 0; initial <= 5; ++initial) { + for (auto const& response : responses) { + int tx = -1; + int progress = initial; + bool reacts = true; + if (response == "FN31") { + tx = 2; + progress = 2; + } else if (response == "-10") { + tx = 3; + progress = 3; + } else if (response == "R") { + tx = initial == 3 ? 5 : 4; + if (initial == 2) progress = 4; + else if (initial >= 3) progress = 5; + } else if (response == "R-10") { + tx = 4; + progress = 4; + } else if (response == "RRR" || response == "RR73") { + tx = 5; + if (initial >= 3) progress = 5; + } else if (initial == 4) { + tx = 6; + progress = 5; + } else { + tx = 0; + } + QByteArray const name = QByteArray::number(initial) + '-' + response.toLatin1(); + QTest::newRow(name.constData()) << initial << response << tx << progress << reacts; + } + } + } + + void responseTransitions() + { + QFETCH(int, initialProgress); + QFETCH(QString, response); + QFETCH(int, expectedTxMessage); + QFETCH(int, expectedProgress); + QFETCH(bool, expectedReaction); + + auto snapshot = baseSnapshot(); + snapshot.qsoProgress = static_cast(initialProgress); + QString const payload = response == "R" + ? " W1AW R" : "K1ABC W1AW " + response; + auto const plan = DecodedMessageReaction::planProcessMessage(decode(payload), snapshot); + + QCOMPARE(plan.disposition == DecodedMessageReaction::ReactionDisposition::Reacted, + expectedReaction); + if (expectedReaction) { + auto const state = finalState(plan, snapshot); + QCOMPARE(state.txMessage, expectedTxMessage); + QCOMPARE(static_cast(state.progress), expectedProgress); + } + } + + void tx1AvailabilityControlsFallback_data() + { + QTest::addColumn("tx1Enabled"); + QTest::addColumn("expectedTxMessage"); + QTest::addColumn("expectedProgress"); + QTest::newRow("tx1") << true << 1 << 1; + QTest::newRow("tx2-fallback") << false << 2 << 2; + } + + void tx1AvailabilityControlsFallback() + { + QFETCH(bool, tx1Enabled); + QFETCH(int, expectedTxMessage); + QFETCH(int, expectedProgress); + auto snapshot = baseSnapshot(); + snapshot.tx1Enabled = tx1Enabled; + snapshot.dxCall.clear(); + snapshot.hisCall.clear(); + + auto const plan = DecodedMessageReaction::planProcessMessage(decode("CQ W1AW FN31"), snapshot); + auto const state = finalState(plan, snapshot); + QCOMPARE(state.txMessage, expectedTxMessage); + QCOMPARE(static_cast(state.progress), expectedProgress); + } + + void signoffLogsOrCeasesAuto_data() + { + QTest::addColumn("loggingEnabled"); + QTest::addColumn("expectedEffect"); + QTest::newRow("log") << true << static_cast(Effect::Kind::RequestLogQso); + QTest::newRow("cease") << false << static_cast(Effect::Kind::CeaseAutoTx); + } + + void signoffLogsOrCeasesAuto() + { + QFETCH(bool, loggingEnabled); + QFETCH(int, expectedEffect); + auto snapshot = baseSnapshot(); + snapshot.qsoProgress = QsoProgress::Rogers; + snapshot.loggingEnabled = loggingEnabled; + + auto const plan = DecodedMessageReaction::planProcessMessage(decode("K1ABC W1AW 73"), snapshot); + QVERIFY(effectIndex(plan, static_cast(expectedEffect)) >= 0); + } + + void sharedTailRequestsRestartQuickCallAndRegeneration() + { + auto snapshot = baseSnapshot(); + snapshot.doubleClicked = true; + snapshot.selectionOrigin = DecodedMessageReaction::SelectionOrigin::ManualLeftPane; + snapshot.quickCall = true; + snapshot.transmitting = true; + + auto const plan = DecodedMessageReaction::planProcessMessage(decode("K1ABC W1AW -10"), snapshot); + + QVERIFY(effectIndex(plan, Effect::Kind::SetReport) >= 0); + QVERIFY(effectIndex(plan, Effect::Kind::GenerateStandardMessages) >= 0); + QVERIFY(effectIndex(plan, Effect::Kind::SetRestart) >= 0); + QVERIFY(effectIndex(plan, Effect::Kind::SetAutoEnabled) >= 0); + } + + void jt65OooSelectsRogerReport() + { + auto snapshot = baseSnapshot(); + snapshot.mode = "JT65"; + auto const plan = DecodedMessageReaction::planProcessMessage( + decode("K1ABC W1AW FN31 OOO", "#"), snapshot); + auto const state = finalState(plan, snapshot); + QCOMPARE(state.txMessage, 3); + QCOMPARE(state.progress, QsoProgress::RogerReport); + } + + void dualFoxMessagePreservesCurrentDisposition() + { + auto snapshot = baseSnapshot(); + snapshot.loggingEnabled = true; + auto const message = decode("K1ABC RR73; W2XX W1AW -10"); + auto const plan = DecodedMessageReaction::planProcessMessage(message, snapshot); + QCOMPARE(message.messageWords().size(), 7); + QCOMPARE(plan.disposition, DecodedMessageReaction::ReactionDisposition::NoReaction); + QVERIFY(effectIndex(plan, Effect::Kind::RequestLogQso) < 0); + } + + void freeTextSignoffSelectsTx5() + { + auto snapshot = baseSnapshot(); + snapshot.qsoProgress = QsoProgress::RogerReport; + auto const plan = DecodedMessageReaction::planProcessMessage(decode("TNX QSO 73"), snapshot); + auto const state = finalState(plan, snapshot); + QCOMPARE(state.txMessage, 5); + QCOMPARE(state.progress, QsoProgress::Signoff); + int const select = effectIndex(plan, Effect::Kind::SetTxMessageIndex); + int const check = effectIndex(plan, Effect::Kind::CheckTxMessage, select + 1); + int const progress = effectIndex(plan, Effect::Kind::SetQsoProgress, check + 1); + QVERIFY(select >= 0 && check > select && progress > check); + } + + void repeatTxUsesClickableTx5AndLiveAutoTimer() + { + auto snapshot = baseSnapshot(); + snapshot.mode = "Q65"; + snapshot.qsoProgress = QsoProgress::Rogers; + snapshot.repeatTx = true; + auto const plan = DecodedMessageReaction::planProcessMessage( + decode("K1ABC W1AW 73", ":"), snapshot); + QCOMPARE(intEffect(plan, Effect::Kind::ClickTxMessage), 5); + QCOMPARE(intEffect(plan, Effect::Kind::ScheduleAutoFlagOff), 15000); + } + + void contestGridPolicies_data() + { + QTest::addColumn("specOp"); + QTest::addColumn("mode"); + QTest::addColumn("marker"); + QTest::addColumn("expectedTx"); + QTest::addColumn("expectedProgress"); + QTest::newRow("normal") << int(SpecialOperatingActivity::NONE) << "FT8" << "~" << 2 << 2; + QTest::newRow("na-vhf") << int(SpecialOperatingActivity::NA_VHF) << "FT8" << "~" << 3 << 3; + QTest::newRow("ww-digi") << int(SpecialOperatingActivity::WW_DIGI) << "FT8" << "~" << 3 << 3; + QTest::newRow("arrl-digi") << int(SpecialOperatingActivity::ARRL_DIGI) << "FT8" << "~" << 3 << 3; + QTest::newRow("q65-pileup") << int(SpecialOperatingActivity::Q65_PILEUP) << "Q65" << ":" << 3 << 3; + } + + void contestGridPolicies() + { + QFETCH(int, specOp); + QFETCH(QString, mode); + QFETCH(QString, marker); + QFETCH(int, expectedTx); + QFETCH(int, expectedProgress); + auto snapshot = baseSnapshot(); + snapshot.specOp = static_cast(specOp); + snapshot.mode = mode; + auto const state = finalState( + DecodedMessageReaction::planProcessMessage(decode("K1ABC W1AW FN31", marker), snapshot), + snapshot); + QCOMPARE(state.txMessage, expectedTx); + QCOMPARE(static_cast(state.progress), expectedProgress); + } + + void contestExchangePolicies() + { + auto eu = baseSnapshot(); + eu.specOp = SpecialOperatingActivity::EU_VHF; + auto euPlan = DecodedMessageReaction::planProcessMessage( + decode(" W1AW 520001 FN31"), eu); + QCOMPARE(finalState(euPlan, eu).progress, QsoProgress::RogerReport); + + auto rtty = baseSnapshot(); + rtty.specOp = SpecialOperatingActivity::RTTY; + auto rttyPlan = DecodedMessageReaction::planProcessMessage( + decode("K1ABC W1AW 599 0001"), rtty); + QCOMPARE(finalState(rttyPlan, rtty).progress, QsoProgress::RogerReport); + QVERIFY(effectIndex(rttyPlan, Effect::Kind::SetReceivedExchange) >= 0); + + auto fieldDay = baseSnapshot(); + fieldDay.specOp = SpecialOperatingActivity::FIELD_DAY; + auto fieldDayPlan = DecodedMessageReaction::planProcessMessage( + decode("K1ABC W1AW R 1D EMA"), fieldDay); + QCOMPARE(finalState(fieldDayPlan, fieldDay).progress, QsoProgress::Rogers); + } + + void euVhfReportBoundaries_data() + { + QTest::addColumn("exchange"); + QTest::addColumn("valid"); + QTest::newRow("below-report") << 510001 << false; + QTest::newRow("lower") << 520001 << true; + QTest::newRow("upper") << 592047 << true; + QTest::newRow("above-serial") << 592048 << false; + } + + void euVhfReportBoundaries() + { + QFETCH(int, exchange); + QFETCH(bool, valid); + auto snapshot = baseSnapshot(); + snapshot.dxCall.clear(); + snapshot.hisCall.clear(); + auto const plan = DecodedMessageReaction::planProcessMessage( + decode(QString {" W1AW %1 FN31"}.arg(exchange)), snapshot); + QCOMPARE(effectIndex(plan, Effect::Kind::QueueContestHint) >= 0, valid); + } + + void contestHints_data() + { + QTest::addColumn("payload"); + QTest::addColumn("expectedHint"); + + QTest::newRow("eu-vhf") + << " W1AW 520001 FN31" << int(DecodedMessageReaction::ContestHint::EuVhf); + QTest::newRow("field-day") + << "K1ABC W1AW R 1D EMA" << int(DecodedMessageReaction::ContestHint::FieldDay); + QTest::newRow("rtty") + << "K1ABC W1AW 599 0001" << int(DecodedMessageReaction::ContestHint::Rtty); + } + + void contestHints() + { + QFETCH(QString, payload); + QFETCH(int, expectedHint); + auto snapshot = baseSnapshot(); + + auto const plan = DecodedMessageReaction::planProcessMessage(decode(payload), snapshot); + + QCOMPARE(effectCount(plan, Effect::Kind::QueueContestHint), 1); + int const hint = effectIndex(plan, Effect::Kind::QueueContestHint); + QCOMPARE(int(plan.effects[hint].contestHint), expectedHint); + } + + void shownContestHintSuppressesFurtherHints() + { + QStringList const payloads { + " W1AW 520001 FN31", + "K1ABC W1AW R 1D EMA", + "K1ABC W1AW 599 0001" + }; + auto snapshot = baseSnapshot(); + snapshot.contestHintShown = true; + + for (auto const& payload : payloads) { + auto const plan = DecodedMessageReaction::planProcessMessage(decode(payload), snapshot); + QCOMPARE(effectCount(plan, Effect::Kind::QueueContestHint), 0); + } + } + + void fieldDayExchangePrecedesContestHint() + { + auto snapshot = baseSnapshot(); + + auto const plan = DecodedMessageReaction::planProcessMessage( + decode("K1ABC W1AW R 1D EMA"), snapshot); + + int const exchange = effectIndex(plan, Effect::Kind::SetReceivedExchange); + int const hint = effectIndex(plan, Effect::Kind::QueueContestHint); + QVERIFY(exchange >= 0 && hint > exchange); + } + + void msk144ReportNormalization_data() + { + QTest::addColumn("input"); + QTest::addColumn("expected"); + QTest::newRow("negative") << -2 << -3; + QTest::newRow("zero-low") << -1 << 0; + QTest::newRow("zero-high") << 1 << 0; + QTest::newRow("three-low") << 2 << 3; + QTest::newRow("three-high") << 4 << 3; + QTest::newRow("six-low") << 5 << 6; + QTest::newRow("six-high") << 7 << 6; + QTest::newRow("ten-low") << 8 << 10; + QTest::newRow("ten-high") << 11 << 10; + QTest::newRow("thirteen-low") << 12 << 13; + QTest::newRow("thirteen-high") << 14 << 13; + QTest::newRow("sixteen") << 15 << 16; + } + + void msk144ReportNormalization() + { + QFETCH(int, input); + QFETCH(int, expected); + auto snapshot = baseSnapshot(); + snapshot.mode = "MSK144"; + snapshot.shortMessages = true; + DecodedText const message { + QString {"060522 %1 0.3 1500 & K1ABC W1AW -10"}.arg(input, 3)}; + auto const plan = DecodedMessageReaction::planProcessMessage( + message, snapshot); + QVERIFY2(plan.disposition == DecodedMessageReaction::ReactionDisposition::Reacted, + qPrintable(plan.reason)); + QCOMPARE(intEffect(plan, Effect::Kind::SetReport), expected); + } + + void selectionOrigins_data() + { + QTest::addColumn("origin"); + QTest::addColumn("transmittingSignoff"); + QTest::addColumn("reacts"); + QTest::newRow("manual") << int(DecodedMessageReaction::SelectionOrigin::ManualLeftPane) << true << true; + QTest::newRow("synthetic") << int(DecodedMessageReaction::SelectionOrigin::Synthetic) << true << true; + QTest::newRow("udp-guard") << int(DecodedMessageReaction::SelectionOrigin::Udp) << true << false; + } + + void selectionOrigins() + { + QFETCH(int, origin); + QFETCH(bool, transmittingSignoff); + QFETCH(bool, reacts); + auto snapshot = baseSnapshot(); + snapshot.doubleClicked = true; + snapshot.selectionOrigin = static_cast(origin); + snapshot.transmittingSignoff = transmittingSignoff; + auto const plan = DecodedMessageReaction::planProcessMessage( + decode("K1ABC W1AW RR73"), snapshot); + QCOMPARE(plan.disposition == DecodedMessageReaction::ReactionDisposition::Reacted, reacts); + } + + void slowWaitReplyOrderingAndTimeout() + { + auto snapshot = baseSnapshot(); + snapshot.waitFeaturesEnabled = true; + auto const plan = DecodedMessageReaction::planWaitReplyCall( + decode("K1ABC W1AW -10"), snapshot, + DecodedMessageReaction::WaitDecodeSource::SlowDecoder); + int const watchdog = effectIndex(plan, Effect::Kind::ResetWatchdog); + int const selection = effectIndex(plan, Effect::Kind::SetDoubleClicked, watchdog + 1); + int const process = effectIndex(plan, Effect::Kind::ProcessSyntheticMessageNow, selection + 1); + int const enableAuto = effectIndex(plan, Effect::Kind::SetAutoEnabled, process + 1); + int const timer = effectIndex(plan, Effect::Kind::StartWaitReplyTimer, enableAuto + 1); + QVERIFY(watchdog >= 0 && selection > watchdog && process > selection + && enableAuto > process && timer > enableAuto); + QCOMPARE(plan.effects[timer].intValue, 120000); + } + + void slowWaitReplyAndCallCanBothFire() + { + auto snapshot = baseSnapshot(); + snapshot.waitFeaturesEnabled = true; + snapshot.waitAndCall = true; + snapshot.autoSequenceChecked = true; + auto const plan = DecodedMessageReaction::planWaitReplyCall( + decode("K1ABC W1AW CQ W1AW"), snapshot, + DecodedMessageReaction::WaitDecodeSource::SlowDecoder); + QCOMPARE(effectCount(plan, Effect::Kind::ProcessSyntheticMessageNow), 2); + int const replySelection = effectIndex(plan, Effect::Kind::SetDoubleClicked); + int const replyProcess = effectIndex( + plan, Effect::Kind::ProcessSyntheticMessageNow, replySelection + 1); + int const replyAuto = effectIndex(plan, Effect::Kind::SetAutoEnabled, replyProcess + 1); + int const callSelection = effectIndex(plan, Effect::Kind::SetDoubleClicked, replyAuto + 1); + int const callProcess = effectIndex( + plan, Effect::Kind::ProcessSyntheticMessageNow, callSelection + 1); + int const callAuto = effectIndex(plan, Effect::Kind::SetAutoEnabled, callProcess + 1); + QCOMPARE(replyProcess, replySelection + 1); + QCOMPARE(replyAuto, replyProcess + 1); + QCOMPARE(callProcess, callSelection + 1); + QCOMPARE(callAuto, callProcess + 1); + QCOMPARE(intEffect(plan, Effect::Kind::StartWaitCallTimer), 93000); + } + + void slowHoundWrongSlotIgnoresDecode() + { + auto snapshot = baseSnapshot(); + snapshot.specOp = SpecialOperatingActivity::HOUND; + snapshot.waitFeaturesEnabled = true; + auto const plan = DecodedMessageReaction::planWaitReplyCall( + decode("K1ABC W1AW -10", "~", "060515"), snapshot, + DecodedMessageReaction::WaitDecodeSource::SlowDecoder); + QCOMPARE(plan.disposition, DecodedMessageReaction::ReactionDisposition::IgnoreDecode); + } + + void msk144WaitPolicies() + { + auto snapshot = baseSnapshot(); + snapshot.mode = "MSK144"; + snapshot.waitFeaturesEnabled = true; + auto reply = DecodedMessageReaction::planWaitReplyCall( + decode("K1ABC W1AW -10", "&", "060522"), snapshot, + DecodedMessageReaction::WaitDecodeSource::Msk144FastDecoder); + QCOMPARE(intEffect(reply, Effect::Kind::StartWaitReplyTimer), 180000); + + snapshot.specOp = SpecialOperatingActivity::HOUND; + auto houndReply = DecodedMessageReaction::planWaitReplyCall( + decode("K1ABC W1AW -10", "&", "060515"), snapshot, + DecodedMessageReaction::WaitDecodeSource::Msk144FastDecoder); + QCOMPARE(houndReply.disposition, DecodedMessageReaction::ReactionDisposition::Reacted); + snapshot.specOp = SpecialOperatingActivity::NONE; + + snapshot.fullDuplexEnabled = true; + snapshot.txing = true; + auto blocked = DecodedMessageReaction::planWaitReplyCall( + decode("K1ABC W1AW -10", "&", "060522"), snapshot, + DecodedMessageReaction::WaitDecodeSource::Msk144FastDecoder); + QVERIFY(effectIndex(blocked, Effect::Kind::ProcessSyntheticMessageNow) < 0); + + snapshot.fullDuplexEnabled = false; + snapshot.txing = false; + snapshot.waitAndCall = true; + snapshot.waitAndCallControlChecked = true; + snapshot.autoSequenceChecked = true; + auto cancelled = DecodedMessageReaction::planWaitReplyCall( + decode("K1ABC W1AW CQ W1AW", "&", "060522"), snapshot, + DecodedMessageReaction::WaitDecodeSource::Msk144FastDecoder); + QVERIFY(effectIndex(cancelled, Effect::Kind::StopWaitCallTimer) >= 0); + QVERIFY(effectIndex(cancelled, Effect::Kind::DisableWaitAndCallControl) >= 0); + QVERIFY(effectIndex(cancelled, Effect::Kind::StartWaitCallTimer) < 0); + } + + void msk144WaitPolicyRequiresFastDecoderSource() + { + auto snapshot = baseSnapshot(); + snapshot.mode = "MSK144"; + snapshot.waitFeaturesEnabled = true; + snapshot.waitAndCall = true; + snapshot.waitAndCallControlChecked = true; + snapshot.autoSequenceChecked = true; + auto const message = decode("K1ABC W1AW CQ W1AW", "&", "060522"); + + auto const slowPlan = DecodedMessageReaction::planWaitReplyCall( + message, snapshot, DecodedMessageReaction::WaitDecodeSource::SlowDecoder); + QCOMPARE(slowPlan.disposition, DecodedMessageReaction::ReactionDisposition::NoReaction); + QVERIFY(!hasEffect(slowPlan, Effect::Kind::StopWaitCallTimer)); + QVERIFY(!hasEffect(slowPlan, Effect::Kind::DisableWaitAndCallControl)); + QVERIFY(!hasEffect(slowPlan, Effect::Kind::ProcessSyntheticMessageNow)); + QVERIFY(!hasEffect(slowPlan, Effect::Kind::SetAutoEnabled)); + QVERIFY(!hasEffect(slowPlan, Effect::Kind::StartWaitReplyTimer)); + QVERIFY(!hasEffect(slowPlan, Effect::Kind::StartWaitCallTimer)); + + auto const fastPlan = DecodedMessageReaction::planWaitReplyCall( + message, snapshot, DecodedMessageReaction::WaitDecodeSource::Msk144FastDecoder); + QVERIFY(hasEffect(fastPlan, Effect::Kind::StopWaitCallTimer)); + QVERIFY(hasEffect(fastPlan, Effect::Kind::DisableWaitAndCallControl)); + QVERIFY(hasEffect(fastPlan, Effect::Kind::ProcessSyntheticMessageNow)); + QVERIFY(hasEffect(fastPlan, Effect::Kind::SetAutoEnabled)); + QCOMPARE(intEffect(fastPlan, Effect::Kind::StartWaitReplyTimer), 180000); + QVERIFY(!hasEffect(fastPlan, Effect::Kind::StartWaitCallTimer)); + } + + void nonDirectWaitAndCallBlocksOnlySlowRightDisplay() + { + auto slowSnapshot = baseSnapshot(); + slowSnapshot.waitFeaturesEnabled = true; + slowSnapshot.waitAndCall = true; + slowSnapshot.autoSequenceChecked = true; + auto const slowPlan = DecodedMessageReaction::planWaitReplyCall( + decode("CQ W1AW FN31"), slowSnapshot, + DecodedMessageReaction::WaitDecodeSource::SlowDecoder); + QVERIFY(hasEffect(slowPlan, Effect::Kind::SetBlockRightDisplay)); + + auto fastSnapshot = slowSnapshot; + fastSnapshot.mode = "MSK144"; + auto const fastPlan = DecodedMessageReaction::planWaitReplyCall( + decode("CQ W1AW FN31", "&", "060522"), fastSnapshot, + DecodedMessageReaction::WaitDecodeSource::Msk144FastDecoder); + QVERIFY(hasEffect(fastPlan, Effect::Kind::ProcessSyntheticMessageNow)); + QVERIFY(!hasEffect(fastPlan, Effect::Kind::SetBlockRightDisplay)); + QCOMPARE(intEffect(fastPlan, Effect::Kind::StartWaitCallTimer), 93000); + } + + void ncccSprintAvoidsDuplicateLogging() + { + auto snapshot = baseSnapshot(); + snapshot.mode = "FT4"; + snapshot.specOp = SpecialOperatingActivity::NA_VHF; + snapshot.ncccSprint = true; + snapshot.loggingEnabled = true; + auto const plan = DecodedMessageReaction::planWaitReplyCall( + decode("K1ABC W1AW R FN31", "+"), snapshot, + DecodedMessageReaction::WaitDecodeSource::SlowDecoder); + QCOMPARE(effectCount(plan, Effect::Kind::RequestLogQso), 1); + QCOMPARE(effectCount(plan, Effect::Kind::RequestLogQsoUnlessSuppressed), 1); + QCOMPARE(intEffect(plan, Effect::Kind::ScheduleStopTx), 500); + QVERIFY(effectIndex(plan, Effect::Kind::ProcessSyntheticMessageNow) >= 0); + } + + void ncccReplyDefersLoggingSuppressionCheck() + { + auto snapshot = baseSnapshot(); + snapshot.mode = "FT4"; + snapshot.specOp = SpecialOperatingActivity::NA_VHF; + snapshot.ncccSprint = true; + snapshot.loggingEnabled = true; + auto const plan = DecodedMessageReaction::planWaitReplyCall( + decode("K1ABC W1AW -10", "+"), snapshot, + DecodedMessageReaction::WaitDecodeSource::SlowDecoder); + + QCOMPARE(plan.disposition, DecodedMessageReaction::ReactionDisposition::Reacted); + QCOMPARE(effectCount(plan, Effect::Kind::RequestLogQso), 0); + QCOMPARE(effectCount(plan, Effect::Kind::RequestLogQsoUnlessSuppressed), 1); + QVERIFY(effectIndex(plan, Effect::Kind::ProcessSyntheticMessageNow) + < effectIndex(plan, Effect::Kind::RequestLogQsoUnlessSuppressed)); + + snapshot.loggingEnabled = false; + auto const loggingDisabled = DecodedMessageReaction::planWaitReplyCall( + decode("K1ABC W1AW -10", "+"), snapshot, + DecodedMessageReaction::WaitDecodeSource::SlowDecoder); + QCOMPARE(effectCount(loggingDisabled, Effect::Kind::RequestLogQsoUnlessSuppressed), 1); + } + + void representativeProcessEffectOrdering() + { + auto snapshot = baseSnapshot(); + snapshot.qsoProgress = QsoProgress::Rogers; + snapshot.loggingEnabled = true; + auto const plan = DecodedMessageReaction::planProcessMessage( + decode("K1ABC W1AW 73"), snapshot); + int const log = effectIndex(plan, Effect::Kind::RequestLogQso); + int const select = effectIndex(plan, Effect::Kind::SetTxMessageIndex, log + 1); + int const check = effectIndex(plan, Effect::Kind::CheckTxMessage, select + 1); + int const progress = effectIndex(plan, Effect::Kind::SetQsoProgress, check + 1); + int const lookup = effectIndex(plan, Effect::Kind::Lookup, progress + 1); + int const generate = effectIndex(plan, Effect::Kind::GenerateStandardMessages, lookup + 1); + QVERIFY(log >= 0 && select > log && check > select && progress > check + && lookup > progress && generate > lookup); + } + + void qsoPaneRefreshFollowsSelectionOrigin_data() + { + QTest::addColumn("origin"); + QTest::addColumn("expectedRefresh"); + + using Origin = DecodedMessageReaction::SelectionOrigin; + QTest::newRow("automatic") << int(Origin::None) << true; + QTest::newRow("manual-left-pane") << int(Origin::ManualLeftPane) << true; + QTest::newRow("manual-right-pane") << int(Origin::ManualRightPane) << false; + QTest::newRow("synthetic") << int(Origin::Synthetic) << true; + QTest::newRow("udp") << int(Origin::Udp) << true; + } + + void qsoPaneRefreshFollowsSelectionOrigin() + { + QFETCH(int, origin); + QFETCH(bool, expectedRefresh); + + auto snapshot = baseSnapshot(); + snapshot.qsoProgress = QsoProgress::Rogers; + snapshot.loggingEnabled = true; + snapshot.selectionOrigin = static_cast(origin); + + auto const plan = DecodedMessageReaction::planProcessMessage( + decode("K1ABC W1AW 73"), snapshot); + + QCOMPARE(plan.disposition, DecodedMessageReaction::ReactionDisposition::Reacted); + QCOMPARE(finalState(plan, snapshot).progress, QsoProgress::Signoff); + QCOMPARE(effectCount(plan, Effect::Kind::RequestLogQso), 1); + QCOMPARE(effectCount(plan, Effect::Kind::GenerateStandardMessages), 1); + QCOMPARE(effectCount(plan, Effect::Kind::RefreshQsoPaneIfChanged), + expectedRefresh ? 1 : 0); + } + + void earlyTxDecodeEffectsPrecedeRejection() + { + auto snapshot = baseSnapshot(); + DecodedText message {"0605 Tx 1259 # CQ K1ABC FN42"}; + auto const plan = DecodedMessageReaction::planProcessMessage(message, snapshot); + QCOMPARE(plan.disposition, DecodedMessageReaction::ReactionDisposition::NoReaction); + QCOMPARE(plan.effects.size(), 1); + QCOMPARE(plan.effects.first().kind, Effect::Kind::SetRxFrequency); + } +}; + +QTEST_MAIN(TestQsoReaction) +#include "test_qso_reaction.moc" diff --git a/tests/unit/common/test_qsy_message_parser.cpp b/tests/unit/common/test_qsy_message_parser.cpp new file mode 100644 index 00000000..2fc2b12d --- /dev/null +++ b/tests/unit/common/test_qsy_message_parser.cpp @@ -0,0 +1,316 @@ +#include + +#include "widgets/QSYMessageParser.h" + +using QSYMessageParser::Type; +using QSYMessageParser::Message; + +class TestQSYMessageParser final + : public QObject +{ + Q_OBJECT + +private slots: + void decode_frequency_data () + { + QTest::addColumn ("payload"); + QTest::addColumn ("region"); + QTest::addColumn ("valid"); + QTest::addColumn ("frequency"); + QTest::addColumn ("mode"); + + // every band prefix, exercised with a letter mode (-> FT8) + QTest::newRow ("band-A") << "AL123" << 2 << true << "50.123" << "FT8"; + QTest::newRow ("band-B") << "BL123" << 2 << true << "144.123" << "FT8"; + QTest::newRow ("band-C") << "CL123" << 2 << true << "222.123" << "FT8"; + QTest::newRow ("band-D") << "DL123" << 2 << true << "432.123" << "FT8"; + QTest::newRow ("band-E") << "EL123" << 2 << true << "1296.123" << "FT8"; + QTest::newRow ("band-F") << "FL123" << 2 << true << "2304.123" << "FT8"; + QTest::newRow ("band-G") << "GL123" << 2 << true << "3400.123" << "FT8"; + QTest::newRow ("band-H") << "HL123" << 2 << true << "5760.123" << "FT8"; + QTest::newRow ("band-I") << "IL123" << 2 << true << "10368.123" << "FT8"; + QTest::newRow ("band-J-r2") << "JL123" << 2 << true << "24192.123" << "FT8"; + QTest::newRow ("band-J-r1") << "JL123" << 1 << true << "24048.123" << "FT8"; + QTest::newRow ("band-K") << "KL123" << 2 << true << "903.123" << "FT8"; + QTest::newRow ("band-X") << "XL123" << 2 << true << "24048.123" << "FT8"; + QTest::newRow ("band-9") << "9L123" << 2 << true << "902.123" << "FT8"; + QTest::newRow ("band-4") << "4L123" << 2 << true << "40.123" << "FT8"; + QTest::newRow ("band-7") << "7L123" << 2 << true << "70.123" << "FT8"; + QTest::newRow ("band-L") << "LL123" << 2 << true << "0.123" << "FT8"; + QTest::newRow ("band-M") << "ML123" << 2 << true << "1.123" << "FT8"; + QTest::newRow ("band-N") << "NL123" << 2 << true << "3.123" << "FT8"; + QTest::newRow ("band-O") << "OL123" << 2 << true << "5.123" << "FT8"; + QTest::newRow ("band-P") << "PL123" << 2 << true << "7.123" << "FT8"; + QTest::newRow ("band-Q") << "QL123" << 2 << true << "10.123" << "FT8"; + QTest::newRow ("band-R") << "RL123" << 2 << true << "14.123" << "FT8"; + QTest::newRow ("band-S") << "SL123" << 2 << true << "18.123" << "FT8"; + QTest::newRow ("band-T") << "TL123" << 2 << true << "21.123" << "FT8"; + QTest::newRow ("band-U") << "UL123" << 2 << true << "24.123" << "FT8"; + QTest::newRow ("band-V") << "VL123" << 2 << true << "28.123" << "FT8"; + QTest::newRow ("band-W") << "WL123" << 2 << true << "29.123" << "FT8"; + + // every digital mode name, on a fixed HF band (R -> 14.) + QTest::newRow ("mode-SSB") << "RV074" << 2 << true << "14.074" << "SSB"; + QTest::newRow ("mode-CW") << "RW074" << 2 << true << "14.074" << "CW"; + QTest::newRow ("mode-FT8") << "RL074" << 2 << true << "14.074" << "FT8"; + QTest::newRow ("mode-FT4") << "RJ074" << 2 << true << "14.074" << "FT4"; + QTest::newRow ("mode-MSK144") << "RK074" << 2 << true << "14.074" << "MSK144"; + QTest::newRow ("mode-JT9") << "RA074" << 2 << true << "14.074" << "JT9"; + QTest::newRow ("mode-JT65") << "RB074" << 2 << true << "14.074" << "JT65"; + QTest::newRow ("mode-FST4") << "RC074" << 2 << true << "14.074" << "FST4"; + QTest::newRow ("mode-Q65-30B") << "RD074" << 2 << true << "14.074" << "Q65-30B"; + QTest::newRow ("mode-Q65-60C") << "RE074" << 2 << true << "14.074" << "Q65-60C"; + QTest::newRow ("mode-Q65-60D") << "RF074" << 2 << true << "14.074" << "Q65-60D"; + QTest::newRow ("mode-Q65-60E") << "RG074" << 2 << true << "14.074" << "Q65-60E"; + QTest::newRow ("mode-Q65-120D") << "RH074" << 2 << true << "14.074" << "Q65-120D"; + + // FM digit sub-bands (numeric mode -> FM, per-digit MHz) + QTest::newRow ("fm-A0") << "A0123" << 2 << true << "50.123" << "FM"; + QTest::newRow ("fm-A3") << "A3123" << 2 << true << "53.123" << "FM"; + QTest::newRow ("fm-B4") << "B4123" << 2 << true << "144.123" << "FM"; + QTest::newRow ("fm-B7") << "B7123" << 2 << true << "147.123" << "FM"; + QTest::newRow ("fm-C2") << "C2123" << 2 << true << "222.123" << "FM"; + QTest::newRow ("fm-C3") << "C3123" << 2 << true << "223.123" << "FM"; + QTest::newRow ("fm-C0-r1") << "C0123" << 1 << true << "222.123" << "FM"; + QTest::newRow ("fm-D-r2") << "D5446" << 2 << true << "445.446" << "FM"; + QTest::newRow ("fm-D-r1") << "D5432" << 1 << true << "435.432" << "FM"; + QTest::newRow ("fm-E5") << "E5123" << 2 << true << "1295.123" << "FM"; + // user-guide example: QSY W3SZ to 145.550 FM -> "B5550" + QTest::newRow ("userguide-B5550") << "B5550" << 2 << true << "145.550" << "FM"; + + // ----- rejections (Type::Invalid) ----- + QTest::newRow ("empty") << "" << 2 << false << "" << ""; + QTest::newRow ("too-short") << "AL12" << 2 << false << "" << ""; + QTest::newRow ("too-long") << "AL1234" << 2 << false << "" << ""; + QTest::newRow ("bad-band-Y") << "YL123" << 2 << false << "" << ""; + QTest::newRow ("bad-mode-Z") << "AZ123" << 2 << false << "" << ""; + QTest::newRow ("bad-mode-I") << "RI123" << 2 << false << "" << ""; + QTest::newRow ("bad-mode-R") << "RR123" << 2 << false << "" << ""; + QTest::newRow ("bad-fm-digit") << "A5123" << 2 << false << "" << ""; // A only 0..3 + QTest::newRow ("bad-C0-r2") << "C0123" << 2 << false << "" << ""; + QTest::newRow ("bad-C2-r1") << "C2123" << 1 << false << "" << ""; + QTest::newRow ("nondigit-freq")<< "AL12X" << 2 << false << "" << ""; + QTest::newRow ("bare-call") << "KD0BTO" << 2 << false << "" << ""; + } + + void decode_frequency () + { + QFETCH (QString, payload); + QFETCH (int, region); + QFETCH (bool, valid); + QFETCH (QString, frequency); + QFETCH (QString, mode); + + Message const m = QSYMessageParser::decode (payload, region); + QCOMPARE (m.type == Type::Frequency, valid); + if (valid) + { + QCOMPARE (m.frequency_mhz, frequency); + QCOMPARE (m.mode, mode); + } + } + + void decode_general_data () + { + QTest::addColumn ("payload"); + QTest::addColumn ("valid"); + QTest::addColumn ("text"); + + QTest::newRow ("c01") << "ZA001" << true << "You are in the log"; + QTest::newRow ("c02") << "ZA002" << true << "Please call me by phone"; + QTest::newRow ("c03") << "ZA003" << true << "Check your email"; + QTest::newRow ("c04") << "ZA004" << true << "You are not in Contest Mode"; + QTest::newRow ("c05") << "ZA005" << true << "Please check your PC Clock"; + QTest::newRow ("c06") << "ZA006" << true << "You are transmitting in the wrong time slot"; + QTest::newRow ("c07") << "ZA007" << true << "Please transmit above 1000 Hz"; + QTest::newRow ("c08") << "ZA008" << true << "Your transmitter is overmodulated"; + QTest::newRow ("c09") << "ZA009" << true << "Your audio is distorted"; + QTest::newRow ("c10") << "ZA010" << true << "You are transmitting on top of a rare DX station"; + QTest::newRow ("c11") << "ZA011" << true << "Please check HB9Q Logger"; + QTest::newRow ("c12") << "ZA012" << true << "Please check Ping Jockey"; + QTest::newRow ("c13") << "ZA013" << true << "Please check ON4KST"; + QTest::newRow ("c14") << "ZA014" << true << "Please QSL via LoTW"; + + QTest::newRow ("code-000") << "ZA000" << false << ""; + QTest::newRow ("code-015") << "ZA015" << false << ""; + QTest::newRow ("code-999") << "ZA999" << false << ""; + QTest::newRow ("za-short") << "ZA" << false << ""; + QTest::newRow ("za-nondig") << "ZA0X1" << false << ""; + QTest::newRow ("non-za") << "AA007" << false << ""; + } + + void decode_general () + { + QFETCH (QString, payload); + QFETCH (bool, valid); + QFETCH (QString, text); + + Message const m = QSYMessageParser::decode (payload, 2); + QCOMPARE (m.type == Type::General, valid); + if (valid) QCOMPARE (m.text, text); + } + + void decode_reply_data () + { + QTest::addColumn ("payload"); + QTest::addColumn ("valid"); + QTest::addColumn ("call"); + QTest::addColumn ("response"); + + QTest::newRow ("ok") << "$ K1ABC OKQSY" << true << "K1ABC" << "OK"; + QTest::newRow ("no") << "$ N0CALL NOQSY" << true << "N0CALL" << "NO"; + QTest::newRow ("too-few") << "$ K1ABC" << false << "" << ""; + QTest::newRow ("bad-reply") << "$ K1ABC MAYBE" << false << "" << ""; + QTest::newRow ("too-many") << "$ K1ABC OKQSY X" << false << "" << ""; + QTest::newRow ("no-dollar") << "K1ABC OKQSY" << false << "" << ""; + QTest::newRow ("dollar-prefix-token") << "$junk K1ABC OKQSY" << false << "" << ""; + } + + void decode_reply () + { + QFETCH (QString, payload); + QFETCH (bool, valid); + QFETCH (QString, call); + QFETCH (QString, response); + + Message const m = QSYMessageParser::decode (payload, 2); + QCOMPARE (m.type == Type::Reply, valid); + if (valid) + { + QCOMPARE (m.call, call); + QCOMPARE (m.response, response); + } + } + + void roundtrip_frequency () + { + static int const kHzSamples[] = {0, 1, 74, 125, 500, 999}; + QString candidates; + for (char b = 'A'; b <= 'Z'; ++b) candidates += QChar (b); + for (char d = '0'; d <= '9'; ++d) candidates += QChar (d); + + int accepted = 0, rejected = 0; + for (int r = 1; r <= 2; ++r) + for (QChar band : candidates) + for (QChar mode : candidates) + for (int kHz : kHzSamples) + { + QString const wire = QString {band} + mode + QString {"%1"}.arg (kHz, 3, 10, QLatin1Char ('0')); + QString const enc = QSYMessageParser::encodeFrequency (band, mode, kHz, r); + Message const m = QSYMessageParser::decode (wire, r); + + if (enc.isEmpty ()) + { + QVERIFY2 (m.type != Type::Frequency, qPrintable (QString ("decode accepted as frequency but encode rejected: %1 r%2").arg (wire).arg (r))); + ++rejected; + } + else + { + QCOMPARE (enc, wire); + QVERIFY2 (m.type == Type::Frequency, qPrintable (QString ("encode accepted but decode rejected: %1 r%2").arg (wire).arg (r))); + QCOMPARE (m.band, band); + QCOMPARE (m.mode_char, mode); + QCOMPARE (m.kHz, kHz); + QCOMPARE (QSYMessageParser::encode (m), wire); + ++accepted; + } + } + QVERIFY (accepted > 0 && rejected > 0); + } + + void roundtrip_general () + { + for (int code = 0; code <= 20; ++code) + { + QString const enc = QSYMessageParser::encodeGeneral (code); + QString const wire = QStringLiteral ("ZA") + QString {"%1"}.arg (code, 3, 10, QLatin1Char ('0')); + Message const m = QSYMessageParser::decode (wire, 2); + if (code >= 1 && code <= 14) + { + QCOMPARE (enc, wire); + QVERIFY (m.type == Type::General); + QCOMPARE (m.code, code); + QCOMPARE (QSYMessageParser::encode (m), wire); + } + else + { + QVERIFY (enc.isEmpty ()); + QVERIFY (!m); + } + } + } + + void encode_boundaries () + { + QCOMPARE (QSYMessageParser::encodeFrequency ('A', 'L', 0, 2), QString ("AL000")); + QCOMPARE (QSYMessageParser::encodeFrequency ('A', 'L', 999, 2), QString ("AL999")); + QVERIFY (QSYMessageParser::encodeFrequency ('A', 'L', -1, 2).isEmpty ()); + QVERIFY (QSYMessageParser::encodeFrequency ('A', 'L', 1000, 2).isEmpty ()); + QVERIFY (QSYMessageParser::encodeFrequency ('Y', 'L', 123, 2).isEmpty ()); + QVERIFY (QSYMessageParser::encodeFrequency ('A', 'Z', 123, 2).isEmpty ()); + QVERIFY (QSYMessageParser::encodeFrequency ('A', '5', 123, 2).isEmpty ()); + QVERIFY (QSYMessageParser::encodeFrequency ('C', '0', 123, 2).isEmpty ()); + QVERIFY (QSYMessageParser::encodeFrequency ('C', '2', 123, 1).isEmpty ()); + + QCOMPARE (QSYMessageParser::encodeGeneral (1), QString ("ZA001")); + QCOMPARE (QSYMessageParser::encodeGeneral (14), QString ("ZA014")); + QVERIFY (QSYMessageParser::encodeGeneral (0).isEmpty ()); + QVERIFY (QSYMessageParser::encodeGeneral (15).isEmpty ()); + } + + void reply_wire () + { + QCOMPARE (QSYMessageParser::encodeReplyWire (true), QString ("OKQSY")); + QCOMPARE (QSYMessageParser::encodeReplyWire (false), QString ("NOQSY")); + } + + void decode_line_data () + { + QTest::addColumn ("line"); + QTest::addColumn ("found"); + QTest::addColumn ("call"); + QTest::addColumn ("payload"); + QTest::addColumn ("type"); // Type as int + + QTest::newRow ("freq") + << "120000 -10 0.2 1234 ~ W3SZ.B5550" << true << "W3SZ" << "B5550" << int (Type::Frequency); + QTest::newRow ("general") + << "120000 -10 0.2 1234 ~ KD0BTO.ZA007" << true << "KD0BTO" << "ZA007" << int (Type::General); + QTest::newRow ("dt-dot-then-msg") + << "120000 -10 0.2 1234 ~ K1ABC.AL125" << true << "K1ABC" << "AL125" << int (Type::Frequency); + QTest::newRow ("no-qsy") + << "120000 -10 0.2 1234 ~ CQ W3SZ FN20" << false << "" << "" << int (Type::Invalid); + QTest::newRow ("garbage-dot") + << "120000 -10 0.2 1234 ~ KD0BTO.NOTAMSG" << false << "" << "" << int (Type::Invalid); + } + + void decode_line () + { + QFETCH (QString, line); + QFETCH (bool, found); + QFETCH (QString, call); + QFETCH (QString, payload); + QFETCH (int, type); + + QSYMessageParser::LineResult const r = QSYMessageParser::decodeLine (line, 2); + QCOMPARE (bool (r.message), found); + if (found) + { + QCOMPARE (r.call, call); + QCOMPARE (r.payload, payload); + QCOMPARE (int (r.message.type), type); + } + } + + void prefilter_recall () + { + QVERIFY (QSYMessageParser::mightContainMessage ("xx W3SZ.B5550")); + QVERIFY (QSYMessageParser::mightContainMessage ("xx KD0BTO.ZA007")); + QVERIFY (QSYMessageParser::mightContainMessage ("xx N0CALL.OKQSY")); + QVERIFY (!QSYMessageParser::mightContainMessage ("CQ W3SZ FN20")); + } +}; + +QTEST_APPLESS_MAIN (TestQSYMessageParser) + +#include "test_qsy_message_parser.moc" diff --git a/tests/unit/common/test_qt_helpers.cpp b/tests/unit/common/test_qt_helpers.cpp new file mode 100644 index 00000000..b56627c0 --- /dev/null +++ b/tests/unit/common/test_qt_helpers.cpp @@ -0,0 +1,586 @@ +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "qt_helpers.hpp" + +class TestQtHelpers + : public QObject +{ + Q_OBJECT + +public: + +private: + Q_SLOT void round_15s_date_time_up () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 500}}; + QCOMPARE (qt_round_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 30))); + } + + Q_SLOT void truncate_15s_date_time_up () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 500}}; + QCOMPARE (qt_truncate_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); + } + + Q_SLOT void round_15s_date_time_down () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 499}}; + QCOMPARE (qt_round_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); + } + + Q_SLOT void truncate_15s_date_time_down () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 499}}; + QCOMPARE (qt_truncate_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); + } + + Q_SLOT void round_15s_date_time_on () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 15}}; + QCOMPARE (qt_round_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); + } + + Q_SLOT void truncate_15s_date_time_on () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 15}}; + QCOMPARE (qt_truncate_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); + } + + Q_SLOT void round_15s_date_time_under () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 14, 999}}; + QCOMPARE (qt_round_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); + } + + Q_SLOT void truncate_15s_date_time_under () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 14, 999}}; + QCOMPARE (qt_truncate_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15))); + } + + Q_SLOT void round_15s_date_time_over () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 15, 1}}; + QCOMPARE (qt_round_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); + } + + Q_SLOT void truncate_15s_date_time_over () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 15, 1}}; + QCOMPARE (qt_truncate_date_time_to (dt, 15000), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); + } + + Q_SLOT void round_7p5s_date_time_up () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 26, 250}}; + QCOMPARE (qt_round_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 30))); + } + + Q_SLOT void truncate_7p5s_date_time_up () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 26, 250}}; + QCOMPARE (qt_truncate_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); + } + + Q_SLOT void round_7p5s_date_time_down () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 26, 249}}; + QCOMPARE (qt_round_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); + } + + Q_SLOT void truncate_7p5s_date_time_down () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 26, 249}}; + QCOMPARE (qt_truncate_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); + } + + Q_SLOT void round_7p5s_date_time_on () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 500}}; + QCOMPARE (qt_round_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); + } + + Q_SLOT void truncate_7p5s_date_time_on () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 500}}; + QCOMPARE (qt_truncate_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); + } + + Q_SLOT void round_7p5s_date_time_under () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 499}}; + QCOMPARE (qt_round_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); + } + + Q_SLOT void truncate_7p5s_date_time_under () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 499}}; + QCOMPARE (qt_truncate_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 15))); + } + + Q_SLOT void round_7p5s_date_time_over () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 501}}; + QCOMPARE (qt_round_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); + } + + Q_SLOT void truncate_7p5s_date_time_over () + { + QDateTime dt {QDate {2020, 8, 6}, QTime {14, 15, 22, 501}}; + QCOMPARE (qt_truncate_date_time_to (dt, 7500), QDateTime (QDate (2020, 8, 6), QTime (14, 15, 22, 500))); + } + + Q_SLOT void date_time_alignment_rejects_non_positive_intervals_data () + { + QTest::addColumn ("milliseconds"); + + QTest::newRow ("zero") << 0; + QTest::newRow ("negative") << -1000; + } + + Q_SLOT void date_time_alignment_rejects_non_positive_intervals () + { + QFETCH (int, milliseconds); + auto const dt = QDateTime::fromMSecsSinceEpoch (1234, Qt::UTC); + + QVERIFY (!qt_round_date_time_to (dt, milliseconds).isValid ()); + QVERIFY (!qt_truncate_date_time_to (dt, milliseconds).isValid ()); + } + + Q_SLOT void date_time_alignment_rejects_invalid_date_times () + { + QDateTime const invalid; + + QVERIFY (!qt_round_date_time_to (invalid, 1000).isValid ()); + QVERIFY (!qt_truncate_date_time_to (invalid, 1000).isValid ()); + } + + Q_SLOT void date_time_alignment_handles_positive_boundaries () + { + auto const between_intervals = QDateTime::fromMSecsSinceEpoch (1600, Qt::UTC); + QCOMPARE (qt_round_date_time_to (between_intervals, 1000).toMSecsSinceEpoch (), qint64 {2000}); + QCOMPARE (qt_truncate_date_time_to (between_intervals, 1000).toMSecsSinceEpoch (), qint64 {1000}); + + auto const exact_boundary = QDateTime::fromMSecsSinceEpoch (2000, Qt::UTC); + QCOMPARE (qt_round_date_time_to (exact_boundary, 1000), exact_boundary); + QCOMPARE (qt_truncate_date_time_to (exact_boundary, 1000), exact_boundary); + } + + Q_SLOT void date_time_alignment_handles_pre_epoch_boundaries () + { + auto const before_epoch = QDateTime::fromMSecsSinceEpoch (-1, Qt::UTC); + QCOMPARE (qt_round_date_time_to (before_epoch, 1000).toMSecsSinceEpoch (), qint64 {0}); + QCOMPARE (qt_truncate_date_time_to (before_epoch, 1000).toMSecsSinceEpoch (), qint64 {-1000}); + + auto const midpoint = QDateTime::fromMSecsSinceEpoch (-1500, Qt::UTC); + QCOMPARE (qt_round_date_time_to (midpoint, 1000).toMSecsSinceEpoch (), qint64 {-1000}); + + auto const exact_boundary = QDateTime::fromMSecsSinceEpoch (-2000, Qt::UTC); + QCOMPARE (qt_round_date_time_to (exact_boundary, 1000), exact_boundary); + QCOMPARE (qt_truncate_date_time_to (exact_boundary, 1000), exact_boundary); + } + + Q_SLOT void date_time_alignment_rejects_overflow () + { + auto const maximum = QDateTime::fromMSecsSinceEpoch (std::numeric_limits::max (), Qt::UTC); + QVERIFY (maximum.isValid ()); + QVERIFY (!qt_round_date_time_to (maximum, 2).isValid ()); + QCOMPARE (qt_truncate_date_time_to (maximum, 2).toMSecsSinceEpoch (), + std::numeric_limits::max () - 1); + + auto const minimum = QDateTime::fromMSecsSinceEpoch (std::numeric_limits::min (), Qt::UTC); + QVERIFY (minimum.isValid ()); + QVERIFY (!qt_round_date_time_to (minimum, 3).isValid ()); + QVERIFY (!qt_truncate_date_time_to (minimum, 3).isValid ()); + } + + Q_SLOT void next_cyclic_index_advances_through_all_items () + { + QCOMPARE (next_cyclic_index (0, 5), 1); + QCOMPARE (next_cyclic_index (1, 5), 2); + QCOMPARE (next_cyclic_index (2, 5), 3); + QCOMPARE (next_cyclic_index (3, 5), 4); + QCOMPARE (next_cyclic_index (4, 5), 0); + } + + Q_SLOT void next_cyclic_index_starts_from_invalid_index () + { + QCOMPARE (next_cyclic_index (-1, 5), 0); + } + + Q_SLOT void next_cyclic_index_has_no_empty_index () + { + QCOMPARE (next_cyclic_index (0, 0), -1); + } + + Q_SLOT void next_cyclic_index_wraps_by_count () + { + QCOMPARE (next_cyclic_index (2, 3), 0); + } + + Q_SLOT void installed_data_directory_resolves_relative_destination () + { + QTemporaryDir temporary; + QVERIFY (temporary.isValid ()); + auto const application_directory = QDir {temporary.path ()}.absoluteFilePath ("bin"); + + auto const result = resolve_installed_data_directory (application_directory, "share/wsjtx", ".."); + + QCOMPARE (result.absolutePath (), QDir {temporary.path ()}.absoluteFilePath ("share/wsjtx")); + } + + Q_SLOT void installed_data_directory_preserves_absolute_destination () + { + QTemporaryDir temporary; + QVERIFY (temporary.isValid ()); + auto const destination = QDir {temporary.path ()}.absoluteFilePath ("system-share/wsjtx"); + + auto const result = resolve_installed_data_directory ("/ignored/bin", destination, ".."); + + QCOMPARE (result.absolutePath (), destination); + } + + Q_SLOT void installed_data_directory_resolves_macos_bundle_destination () + { + QTemporaryDir temporary; + QVERIFY (temporary.isValid ()); + auto const application_directory = QDir {temporary.path ()}.absoluteFilePath ("WSJT-X.app/Contents/MacOS"); + + auto const result = resolve_installed_data_directory ( + application_directory, "WSJT-X.app/Contents/Resources/wsjtx", "../../.."); + + QCOMPARE (result.absolutePath (), + QDir {temporary.path ()}.absoluteFilePath ("WSJT-X.app/Contents/Resources/wsjtx")); + QVERIFY (!result.absolutePath ().endsWith ("/wsjtx/wsjtx")); + } + + Q_SLOT void preferred_sounds_directory_uses_canonical_directory () + { + QTemporaryDir temporary; + QVERIFY (temporary.isValid ()); + QDir root {temporary.path ()}; + QVERIFY (root.mkpath ("share/wsjtx/sounds")); + QVERIFY (root.mkpath ("bin/sounds")); + QDir canonical {root.absoluteFilePath ("share/wsjtx/sounds")}; + QDir legacy {root.absoluteFilePath ("bin/sounds")}; + + QCOMPARE (preferred_sounds_directory (canonical, legacy).absolutePath (), canonical.absolutePath ()); + } + + Q_SLOT void preferred_sounds_directory_falls_back_to_legacy_directory () + { + QTemporaryDir temporary; + QVERIFY (temporary.isValid ()); + QDir root {temporary.path ()}; + QVERIFY (root.mkpath ("bin/sounds")); + QDir canonical {root.absoluteFilePath ("share/wsjtx/sounds")}; + QDir legacy {root.absoluteFilePath ("bin/sounds")}; + + QCOMPARE (preferred_sounds_directory (canonical, legacy).absolutePath (), legacy.absolutePath ()); + } + + Q_SLOT void preferred_sounds_directory_returns_canonical_when_neither_exists () + { + QTemporaryDir temporary; + QVERIFY (temporary.isValid ()); + QDir root {temporary.path ()}; + QDir canonical {root.absoluteFilePath ("share/wsjtx/sounds")}; + QDir legacy {root.absoluteFilePath ("bin/sounds")}; + + QCOMPARE (preferred_sounds_directory (canonical, legacy).absolutePath (), canonical.absolutePath ()); + } + + Q_SLOT void voice_manifest_path_prefers_readable_canonical_manifest () + { + QTemporaryDir temporary; + QVERIFY (temporary.isValid ()); + QDir root {temporary.path ()}; + QVERIFY (root.mkpath ("canonical")); + QVERIFY (root.mkpath ("legacy")); + QDir canonical {root.absoluteFilePath ("canonical")}; + QDir legacy {root.absoluteFilePath ("legacy")}; + QFile canonical_manifest {canonical.absoluteFilePath ("voices.dat")}; + QVERIFY (canonical_manifest.open (QIODevice::WriteOnly)); + canonical_manifest.close (); + QFile legacy_manifest {legacy.absoluteFilePath ("voices.dat")}; + QVERIFY (legacy_manifest.open (QIODevice::WriteOnly)); + legacy_manifest.close (); + + QCOMPARE (voice_manifest_path (canonical, legacy), canonical_manifest.fileName ()); + } + + Q_SLOT void voice_manifest_path_falls_back_when_canonical_base_has_no_manifest () + { + QTemporaryDir temporary; + QVERIFY (temporary.isValid ()); + QDir root {temporary.path ()}; + QVERIFY (root.mkpath ("canonical")); + QVERIFY (root.mkpath ("legacy")); + QDir canonical {root.absoluteFilePath ("canonical")}; + QDir legacy {root.absoluteFilePath ("legacy")}; + QFile legacy_manifest {legacy.absoluteFilePath ("voices.dat")}; + QVERIFY (legacy_manifest.open (QIODevice::WriteOnly)); + legacy_manifest.close (); + + QCOMPARE (voice_manifest_path (canonical, legacy), legacy_manifest.fileName ()); + } + + Q_SLOT void voice_manifest_path_is_empty_when_no_manifest_is_readable () + { + QTemporaryDir temporary; + QVERIFY (temporary.isValid ()); + QDir root {temporary.path ()}; + QVERIFY (root.mkpath ("canonical")); + QVERIFY (root.mkpath ("legacy")); + + QVERIFY (voice_manifest_path (QDir {root.absoluteFilePath ("canonical")}, + QDir {root.absoluteFilePath ("legacy")}).isEmpty ()); + } + + Q_SLOT void app_sounds_subdirectory_accepts_relative_children () + { + QVERIFY (app_sounds_subdirectory_is_safe ("")); + QVERIFY (app_sounds_subdirectory_is_safe ("/English")); + QVERIFY (app_sounds_subdirectory_is_safe ("voices/English")); + } + + Q_SLOT void app_sounds_subdirectory_rejects_traversal () + { + QVERIFY (!app_sounds_subdirectory_is_safe ("..")); + QVERIFY (!app_sounds_subdirectory_is_safe ("../outside")); + QVERIFY (!app_sounds_subdirectory_is_safe ("voices/../../outside")); + QVERIFY (!app_sounds_subdirectory_is_safe ("..\\outside")); + } + + Q_SLOT void sounds_subdirectory_falls_back_for_traversal () + { + QTemporaryDir temporary; + QVERIFY (temporary.isValid ()); + QDir root {temporary.path ()}; + + QCOMPARE (sounds_subdirectory (root, "../outside").absolutePath (), root.absolutePath ()); + } + + Q_SLOT void sounds_subdirectory_resolves_valid_child () + { + QTemporaryDir temporary; + QVERIFY (temporary.isValid ()); + QDir root {temporary.path ()}; + + QCOMPARE (sounds_subdirectory (root, "voices/German").absolutePath (), + root.absoluteFilePath ("voices/German")); + } + + Q_SLOT void app_voice_entry_parsing_data () + { + QTest::addColumn ("record"); + QTest::addColumn ("valid"); + QTest::addColumn ("subdirectory"); + QTest::addColumn ("display_name"); + + QTest::newRow ("legacy leading slash") << "/German|Deutsch" << true << "German" << "Deutsch"; + QTest::newRow ("nested and trimmed") << " voices/German | Deutsch " << true << "voices/German" << "Deutsch"; + QTest::newRow ("blank") << "" << false << "" << ""; + QTest::newRow ("missing delimiter") << "German" << false << "" << ""; + QTest::newRow ("empty directory") << "|Deutsch" << false << "" << ""; + QTest::newRow ("root directory") << "/|Deutsch" << false << "" << ""; + QTest::newRow ("empty name") << "German|" << false << "" << ""; + QTest::newRow ("extra delimiter") << "German|Deutsch|extra" << false << "" << ""; + QTest::newRow ("parent traversal") << "../outside|Bad" << false << "" << ""; + QTest::newRow ("nested traversal") << "voices/../../outside|Bad" << false << "" << ""; + QTest::newRow ("backslash traversal") << "..\\outside|Bad" << false << "" << ""; + } + + Q_SLOT void app_voice_entry_parsing () + { + QFETCH (QString, record); + QFETCH (bool, valid); + QFETCH (QString, subdirectory); + QFETCH (QString, display_name); + + QString parsed_subdirectory; + QString parsed_display_name; + QCOMPARE (::parse_app_voice_entry (record, parsed_subdirectory, parsed_display_name), valid); + if (valid) + { + QCOMPARE (parsed_subdirectory, subdirectory); + QCOMPARE (parsed_display_name, display_name); + } + } + + Q_SLOT void writable_file_path_uses_writable_dir () + { + QTemporaryDir writable; + QVERIFY (writable.isValid ()); + + QCOMPARE (writable_file_path (QDir {writable.path ()}, "wsjtx.log"), + QDir {writable.path ()}.absoluteFilePath ("wsjtx.log")); + } + + Q_SLOT void writable_override_or_installed_file_path_uses_installed_default () + { + QTemporaryDir writable; + QTemporaryDir installed; + QVERIFY (writable.isValid ()); + QVERIFY (installed.isValid ()); + QFile file {QDir {installed.path ()}.absoluteFilePath ("cty.dat")}; + QVERIFY (file.open (QIODevice::WriteOnly)); + file.close (); + + QCOMPARE (writable_override_or_installed_file_path (QDir {writable.path ()}, QDir {installed.path ()}, "cty.dat"), + QDir {installed.path ()}.absoluteFilePath ("cty.dat")); + } + + Q_SLOT void writable_override_or_installed_file_path_uses_installed_default_when_missing () + { + QTemporaryDir writable; + QTemporaryDir installed; + QVERIFY (writable.isValid ()); + QVERIFY (installed.isValid ()); + + QCOMPARE (writable_override_or_installed_file_path (QDir {writable.path ()}, QDir {installed.path ()}, "cty.dat"), + QDir {installed.path ()}.absoluteFilePath ("cty.dat")); + } + + Q_SLOT void writable_override_or_installed_file_path_prefers_writable_override () + { + QTemporaryDir writable; + QTemporaryDir installed; + QVERIFY (writable.isValid ()); + QVERIFY (installed.isValid ()); + QFile installed_file {QDir {installed.path ()}.absoluteFilePath ("cty.dat")}; + QVERIFY (installed_file.open (QIODevice::WriteOnly)); + installed_file.close (); + QFile writable_file {QDir {writable.path ()}.absoluteFilePath ("cty.dat")}; + QVERIFY (writable_file.open (QIODevice::WriteOnly)); + writable_file.close (); + + QCOMPARE (writable_override_or_installed_file_path (QDir {writable.path ()}, QDir {installed.path ()}, "cty.dat"), + QDir {writable.path ()}.absoluteFilePath ("cty.dat")); + } + + Q_SLOT void ensure_parent_directory_creates_append_parent () + { + QTemporaryDir writable; + QVERIFY (writable.isValid ()); + auto const& file_path = QDir {writable.path ()}.absoluteFilePath ("nested/wsjtx_log.adi"); + + QVERIFY (ensure_parent_directory (file_path)); + QVERIFY (QDir {writable.path ()}.exists ("nested")); + } + + Q_SLOT void is_multicast_address_data () + { + QTest::addColumn ("addr"); + QTest::addColumn ("result"); + + QTest::newRow ("loopback") << "127.0.0.1" << false; + QTest::newRow ("looback IPv6") << "::1" << false; + QTest::newRow ("lowest-") << "223.255.255.255" << false; + QTest::newRow ("lowest") << "224.0.0.0" << true; + QTest::newRow ("lowest- IPv6") << "feff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" << false; + QTest::newRow ("lowest IPv6") << "ff00::" << true; + QTest::newRow ("highest") << "239.255.255.255" << true; + QTest::newRow ("highest+") << "240.0.0.0" << false; + QTest::newRow ("highest IPv6") << "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" << true; + } + + Q_SLOT void is_multicast_address () + { + QFETCH (QString, addr); + QFETCH (bool, result); + + QCOMPARE (::is_multicast_address (QHostAddress {addr}), result); + } + + Q_SLOT void is_MAC_ambiguous_multicast_address_data () + { + QTest::addColumn ("addr"); + QTest::addColumn ("result"); + + QTest::newRow ("loopback") << "127.0.0.1" << false; + QTest::newRow ("looback IPv6") << "::1" << false; + + QTest::newRow ("lowest- R1") << "223.255.255.255" << false; + QTest::newRow ("lowest R1") << "224.0.0.0" << false; + QTest::newRow ("highest R1") << "224.0.0.255" << false; + QTest::newRow ("highest+ R1") << "224.0.1.0" << false; + QTest::newRow ("lowest- R1A") << "224.127.255.255" << false; + QTest::newRow ("lowest R1A") << "224.128.0.0" << true; + QTest::newRow ("highest R1A") << "224.128.0.255" << true; + QTest::newRow ("highest+ R1A") << "224.128.1.0" << false; + + QTest::newRow ("lowest- R2") << "224.255.255.255" << false; + QTest::newRow ("lowest R2") << "225.0.0.0" << true; + QTest::newRow ("highest R2") << "225.0.0.255" << true; + QTest::newRow ("highest+ R2") << "225.0.1.0" << false; + QTest::newRow ("lowest- R2A") << "225.127.255.255" << false; + QTest::newRow ("lowest R2A") << "225.128.0.0" << true; + QTest::newRow ("highest R2A") << "225.128.0.255" << true; + QTest::newRow ("highest+ R2A") << "225.128.1.0" << false; + + QTest::newRow ("lowest- R3") << "238.255.255.255" << false; + QTest::newRow ("lowest R3") << "239.0.0.0" << true; + QTest::newRow ("highest R3") << "239.0.0.255" << true; + QTest::newRow ("highest+ R3") << "239.0.1.0" << false; + QTest::newRow ("lowest- R3A") << "239.127.255.255" << false; + QTest::newRow ("lowest R3A") << "239.128.0.0" << true; + QTest::newRow ("highest R3A") << "239.128.0.255" << true; + QTest::newRow ("highest+ R3A") << "239.128.1.0" << false; + + QTest::newRow ("lowest- IPv6") << "feff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" << false; + QTest::newRow ("lowest IPv6") << "ff00::" << false; + QTest::newRow ("highest") << "239.255.255.255" << false; + QTest::newRow ("highest+") << "240.0.0.0" << false; + QTest::newRow ("highest IPv6") << "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" << false; + } + + Q_SLOT void is_MAC_ambiguous_multicast_address () + { + QFETCH (QString, addr); + QFETCH (bool, result); + + QCOMPARE (::is_MAC_ambiguous_multicast_address (QHostAddress {addr}), result); + } + + Q_SLOT void application_style_sheet_uses_light_base () + { + QFont font {"Test Font", 10}; + auto const base = QString {"QPushButton { color: red; }"}; + auto const style_sheet = application_style_sheet (base, "dark", false, font); + + QVERIFY (style_sheet.startsWith (base + '\n')); + QCOMPARE (style_sheet.count ("* {"), 1); + } + + Q_SLOT void application_style_sheet_uses_dark_base () + { + QFont font {"Test Font", 10}; + auto const style_sheet = application_style_sheet ("light", "dark", true, font); + + QVERIFY (style_sheet.startsWith ("dark\n")); + QVERIFY (!style_sheet.contains ("light")); + QCOMPARE (style_sheet.count ("* {"), 1); + } + + Q_SLOT void application_style_sheet_adds_font_without_base () + { + QFont font {"Test Font", 10}; + auto const style_sheet = application_style_sheet ({}, {}, false, font); + + QVERIFY (style_sheet.startsWith ("* {")); + QVERIFY (style_sheet.contains ("font-family: Test Font")); + } +}; + +QTEST_MAIN (TestQtHelpers); + +#include "test_qt_helpers.moc" diff --git a/tests/unit/common/test_rig_frequency_change_policy.cpp b/tests/unit/common/test_rig_frequency_change_policy.cpp new file mode 100644 index 00000000..baa674ee --- /dev/null +++ b/tests/unit/common/test_rig_frequency_change_policy.cpp @@ -0,0 +1,246 @@ +#include + +#include + +#include "RigFrequencyChangePolicy.hpp" + +Q_DECLARE_METATYPE (RigFrequencyChangePolicy::Activity) + +namespace +{ + using RigFrequencyChangePolicy::Activity; + using RigFrequencyChangePolicy::BlockReason; + using RigFrequencyChangePolicy::ChangeKind; + using RigFrequencyChangePolicy::Decision; + + using EvaluateFunction = Decision (*) (ChangeKind, Activity const&, bool); + static_assert (std::is_same::value, + "frequency-change policy must not depend on a frequency magnitude"); + + void addActivityRows () + { + QTest::newRow ("transmit-requested") + << Activity{true, false, false, false, false, false, false, false, false}; + QTest::newRow ("transmit-command-pending") + << Activity{false, true, false, false, false, false, false, false, false}; + QTest::newRow ("transmitting") + << Activity{false, false, true, false, false, false, false, false, false}; + QTest::newRow ("tuning") + << Activity{false, false, false, true, false, false, false, false, false}; + QTest::newRow ("jtty-transmitting") + << Activity{false, false, false, false, true, false, false, false, false}; + QTest::newRow ("start-delay-active") + << Activity{false, false, false, false, false, true, false, false, false}; + QTest::newRow ("stop-delay-active") + << Activity{false, false, false, false, false, false, true, false, false}; + QTest::newRow ("rig-ptt") + << Activity{false, false, false, false, false, false, false, true, false}; + QTest::newRow ("rig-tune") + << Activity{false, false, false, false, false, false, false, false, true}; + } + + void compareDecision (Decision const& actual, bool allowed, BlockReason reason) + { + QCOMPARE (actual.allowed, allowed); + QCOMPARE (static_cast (actual.reason), static_cast (reason)); + } +} + +class TestRigFrequencyChangePolicy final + : public QObject +{ + Q_OBJECT + +private slots: + void idleAllowsEveryChangeKind (); + void everyActivityBlocksNominalQsy_data (); + void everyActivityBlocksNominalQsy (); + void transmitRequestedAloneAllowsPreKeyCorrection (); + void activeRfCorrectionRequiresPermission_data (); + void activeRfCorrectionRequiresPermission (); + void combinedActivityUsesStableBlockReasons (); + void evaluationSignatureExcludesFrequencyMagnitude (); + void guardedApplyProtectsMutationBoundary (); + void txPathFrequencyRequiresSplit (); + void acceptedRequestControlsDependentCommit (); + void rejectedRequestStopsMonitoringItStarted (); +}; + +void TestRigFrequencyChangePolicy::idleAllowsEveryChangeKind () +{ + Activity const idle{}; + + for (auto const correctionsAllowed : {false, true}) + { + compareDecision (RigFrequencyChangePolicy::evaluate ( + ChangeKind::NominalQsy, idle, correctionsAllowed), + true, BlockReason::None); + compareDecision (RigFrequencyChangePolicy::evaluate ( + ChangeKind::TxPathCorrection, idle, correctionsAllowed), + true, BlockReason::None); + } +} + +void TestRigFrequencyChangePolicy::everyActivityBlocksNominalQsy_data () +{ + QTest::addColumn ("activity"); + addActivityRows (); +} + +void TestRigFrequencyChangePolicy::everyActivityBlocksNominalQsy () +{ + QFETCH (Activity, activity); + + for (auto const correctionsAllowed : {false, true}) + { + compareDecision (RigFrequencyChangePolicy::evaluate ( + ChangeKind::NominalQsy, activity, correctionsAllowed), + false, BlockReason::NominalQsyWhileRfActive); + } +} + +void TestRigFrequencyChangePolicy::transmitRequestedAloneAllowsPreKeyCorrection () +{ + Activity const requested{true, false, false, false, false, false, false, false, false}; + + for (auto const correctionsAllowed : {false, true}) + { + compareDecision (RigFrequencyChangePolicy::evaluate ( + ChangeKind::TxPathCorrection, requested, correctionsAllowed), + true, BlockReason::None); + } +} + +void TestRigFrequencyChangePolicy::activeRfCorrectionRequiresPermission_data () +{ + QTest::addColumn ("activity"); + + QTest::newRow ("transmit-command-pending") + << Activity{false, true, false, false, false, false, false, false, false}; + QTest::newRow ("transmitting") + << Activity{false, false, true, false, false, false, false, false, false}; + QTest::newRow ("tuning") + << Activity{false, false, false, true, false, false, false, false, false}; + QTest::newRow ("jtty-transmitting") + << Activity{false, false, false, false, true, false, false, false, false}; + QTest::newRow ("start-delay-active") + << Activity{false, false, false, false, false, true, false, false, false}; + QTest::newRow ("stop-delay-active") + << Activity{false, false, false, false, false, false, true, false, false}; + QTest::newRow ("rig-ptt") + << Activity{false, false, false, false, false, false, false, true, false}; + QTest::newRow ("rig-tune") + << Activity{false, false, false, false, false, false, false, false, true}; +} + +void TestRigFrequencyChangePolicy::activeRfCorrectionRequiresPermission () +{ + QFETCH (Activity, activity); + + compareDecision (RigFrequencyChangePolicy::evaluate ( + ChangeKind::TxPathCorrection, activity, false), + false, BlockReason::TxCorrectionDisabled); + compareDecision (RigFrequencyChangePolicy::evaluate ( + ChangeKind::TxPathCorrection, activity, true), + true, BlockReason::None); +} + +void TestRigFrequencyChangePolicy::combinedActivityUsesStableBlockReasons () +{ + Activity const allActive{true, true, true, true, true, true, true, true, true}; + + compareDecision (RigFrequencyChangePolicy::evaluate ( + ChangeKind::NominalQsy, allActive, true), + false, BlockReason::NominalQsyWhileRfActive); + compareDecision (RigFrequencyChangePolicy::evaluate ( + ChangeKind::TxPathCorrection, allActive, false), + false, BlockReason::TxCorrectionDisabled); +} + +void TestRigFrequencyChangePolicy::evaluationSignatureExcludesFrequencyMagnitude () +{ + EvaluateFunction const evaluator = &RigFrequencyChangePolicy::evaluate; + QVERIFY (evaluator); +} + +void TestRigFrequencyChangePolicy::guardedApplyProtectsMutationBoundary () +{ + Activity active; + active.rigPtt = true; + bool mutated = false; + + QVERIFY (!RigFrequencyChangePolicy::applyIfAllowed ( + ChangeKind::NominalQsy, active, true, [&] {mutated = true;})); + QVERIFY (!mutated); + + QVERIFY (RigFrequencyChangePolicy::applyIfAllowed ( + ChangeKind::TxPathCorrection, active, true, [&] {mutated = true;})); + QVERIFY (mutated); +} + +void TestRigFrequencyChangePolicy::txPathFrequencyRequiresSplit () +{ + QVERIFY (RigFrequencyChangePolicy::tx_path_frequency_supported (false, false)); + QVERIFY (RigFrequencyChangePolicy::tx_path_frequency_supported (false, true)); + QVERIFY (!RigFrequencyChangePolicy::tx_path_frequency_supported (true, false)); + QVERIFY (RigFrequencyChangePolicy::tx_path_frequency_supported (true, true)); +} + +void TestRigFrequencyChangePolicy::acceptedRequestControlsDependentCommit () +{ + bool committed = false; + QVERIFY (!RigFrequencyChangePolicy::commitIfAccepted ( + [] {return false;}, [&] {committed = true;})); + QVERIFY (!committed); + + QVERIFY (RigFrequencyChangePolicy::commitIfAccepted ( + [] {return true;}, [&] {committed = true;})); + QVERIFY (committed); +} + +void TestRigFrequencyChangePolicy::rejectedRequestStopsMonitoringItStarted () +{ + bool monitoring = false; + QVector transitions; + auto const setMonitoring = [&] (bool state) { + monitoring = state; + transitions.append (state); + }; + bool request_observed_monitoring = false; + + QVERIFY (!RigFrequencyChangePolicy::requestWhileMonitoring ( + monitoring, setMonitoring, [&] { + request_observed_monitoring = monitoring; + return false; + })); + QVERIFY (request_observed_monitoring); + QCOMPARE (transitions, QVector ({true, false})); + QVERIFY (!monitoring); + + transitions.clear (); + request_observed_monitoring = false; + QVERIFY (RigFrequencyChangePolicy::requestWhileMonitoring ( + monitoring, setMonitoring, [&] { + request_observed_monitoring = monitoring; + return true; + })); + QVERIFY (request_observed_monitoring); + QCOMPARE (transitions, QVector ({true})); + QVERIFY (monitoring); + + transitions.clear (); + request_observed_monitoring = false; + QVERIFY (!RigFrequencyChangePolicy::requestWhileMonitoring ( + monitoring, setMonitoring, [&] { + request_observed_monitoring = monitoring; + return false; + })); + QVERIFY (request_observed_monitoring); + QVERIFY (transitions.isEmpty ()); + QVERIFY (monitoring); +} + +QTEST_GUILESS_MAIN (TestRigFrequencyChangePolicy) + +#include "test_rig_frequency_change_policy.moc" diff --git a/tests/unit/common/test_round_robin_selection.cpp b/tests/unit/common/test_round_robin_selection.cpp new file mode 100644 index 00000000..5bf32351 --- /dev/null +++ b/tests/unit/common/test_round_robin_selection.cpp @@ -0,0 +1,103 @@ +#include +#include +#include + +#include "widgets/RoundRobinSelection.hpp" + +namespace +{ + QString selectedValue (QComboBox const& combo) + { + return QString::fromStdString ( + BeaconTx::formatRoundRobinPolicy (RoundRobinSelection::policy (combo))); + } +} + +class TestRoundRobinSelection final : public QObject +{ + Q_OBJECT + +private slots: + void presetsHaveCanonicalIdentity () + { + QComboBox combo; + combo.setEditable (true); + RoundRobinSelection::initialize (combo, "Localized random"); + QCOMPARE (combo.count (), 21); + QCOMPARE (combo.currentText (), QString {"Localized random"}); + QCOMPARE (selectedValue (combo), QString {"random"}); + for (int index = 1; index < combo.count (); ++index) + { + combo.setCurrentIndex (index); + QCOMPARE (selectedValue (combo), combo.currentData ().toString ()); + QVERIFY (RoundRobinSelection::policy (combo).kind == BeaconTx::RoundRobinPolicy::Kind::Fixed); + } + combo.setItemText (1, "Localized fixed preset"); + combo.setCurrentIndex (1); + QCOMPARE (selectedValue (combo), QString {"1/2"}); + } + + void editorOverridesSelectedPreset () + { + QComboBox combo; + combo.setEditable (true); + RoundRobinSelection::initialize (combo, "Random"); + QString observed; + connect (&combo, &QComboBox::currentTextChanged, this, + [&] {observed = selectedValue (combo);}); + combo.setEditText ("7/12"); + QCOMPARE (combo.currentIndex (), 0); + QCOMPARE (observed, QString {"7/12"}); + combo.setCurrentIndex (1); + combo.setEditText ("2/4"); + QCOMPARE (observed, QString {"2/4"}); + RoundRobinSelection::setPolicy (combo, BeaconTx::RoundRobinPolicy::fixed (0, 2)); + QCOMPARE (combo.currentText (), QString {"1/2"}); + QCOMPARE (observed, QString {"1/2"}); + combo.setEditText ("invalid"); + QCOMPARE (observed, QString {"random"}); + combo.setCurrentIndex (0); + QCOMPARE (observed, QString {"random"}); + } + + void committedCustomEntryDoesNotNeedPresetData () + { + QComboBox combo; + combo.setEditable (true); + RoundRobinSelection::initialize (combo, "Random"); + combo.setEditText ("7/12"); + QTest::keyClick (combo.lineEdit (), Qt::Key_Return); + QVERIFY (combo.currentIndex () > 0); + QVERIFY (!combo.currentData ().isValid ()); + QCOMPARE (selectedValue (combo), QString {"7/12"}); + } + + void selectionRestoration_data () + { + QTest::addColumn ("stored"); + QTest::addColumn ("expected"); + QTest::newRow ("custom") << "7/12" << "7/12"; + QTest::newRow ("preset") << "2/4" << "2/4"; + QTest::newRow ("whitespace") << " 2 / 4 " << "2/4"; + QTest::newRow ("canonical-random") << "random" << "random"; + QTest::newRow ("legacy-random-label") << "Localized random" << "random"; + QTest::newRow ("invalid") << "13/12" << "random"; + } + + void selectionRestoration () + { + QFETCH (QString, stored); + QFETCH (QString, expected); + QComboBox combo; + combo.setEditable (true); + RoundRobinSelection::initialize (combo, "Localized random"); + RoundRobinSelection::setPolicy (combo, BeaconTx::parseRoundRobinPolicy ( + stored.toStdString ())); + QCOMPARE (selectedValue (combo), expected); + QCOMPARE (combo.currentText (), expected == "random" ? QString {"Localized random"} : expected); + } +}; + +QTEST_MAIN (TestRoundRobinSelection) + +#include "test_round_robin_selection.moc" diff --git a/tests/unit/common/test_rr73_policy.cpp b/tests/unit/common/test_rr73_policy.cpp new file mode 100644 index 00000000..9f126f3b --- /dev/null +++ b/tests/unit/common/test_rr73_policy.cpp @@ -0,0 +1,43 @@ +#include + +#include "Rr73Policy.hpp" + +class TestRr73Policy final : public QObject +{ + Q_OBJECT + +private slots: + void tx4AllowsRr73_data (); + void tx4AllowsRr73 (); +}; + +void TestRr73Policy::tx4AllowsRr73_data () +{ + QTest::addColumn ("mode"); + QTest::addColumn ("shortMessages"); + QTest::addColumn ("allowed"); + + QTest::newRow ("FT8") << QString {"FT8"} << false << true; + QTest::newRow ("FT4") << QString {"FT4"} << false << true; + QTest::newRow ("FST4") << QString {"FST4"} << false << true; + QTest::newRow ("MSK144") << QString {"MSK144"} << false << true; + QTest::newRow ("MSK144 shorthand") << QString {"MSK144"} << true << false; + QTest::newRow ("Q65") << QString {"Q65"} << false << true; + QTest::newRow ("Q65 shorthand") << QString {"Q65"} << true << false; + QTest::newRow ("JT65") << QString {"JT65"} << false << false; + QTest::newRow ("JT4") << QString {"JT4"} << false << false; + QTest::newRow ("FST4W") << QString {"FST4W"} << false << false; +} + +void TestRr73Policy::tx4AllowsRr73 () +{ + QFETCH (QString, mode); + QFETCH (bool, shortMessages); + QFETCH (bool, allowed); + + QCOMPARE (Rr73Policy::tx4AllowsRr73 (mode, shortMessages), allowed); +} + +QTEST_GUILESS_MAIN (TestRr73Policy) + +#include "test_rr73_policy.moc" diff --git a/tests/unit/common/test_spec_op_label.cpp b/tests/unit/common/test_spec_op_label.cpp new file mode 100644 index 00000000..f5d45535 --- /dev/null +++ b/tests/unit/common/test_spec_op_label.cpp @@ -0,0 +1,55 @@ +#include + +#include "widgets/SpecOpLabel.h" + +Q_DECLARE_METATYPE (SpecialOperatingActivity) + +class TestSpecOpLabel : public QObject +{ + Q_OBJECT + +private slots: + void formatsLabel_data (); + void formatsLabel (); + void superFoxPreference (); +}; + +void TestSpecOpLabel::formatsLabel_data () +{ + QTest::addColumn ("specialOperation"); + QTest::addColumn ("ncccSprint"); + QTest::addColumn ("expected"); + + QTest::newRow ("na-vhf") << SpecialOperatingActivity::NA_VHF << false << QString {"NA VHF"}; + QTest::newRow ("nccc-sprint") << SpecialOperatingActivity::NA_VHF << true << QString {"NCCC Sprint"}; + QTest::newRow ("eu-vhf") << SpecialOperatingActivity::EU_VHF << false << QString {"EU VHF"}; + QTest::newRow ("field-day") << SpecialOperatingActivity::FIELD_DAY << false << QString {"Field Day"}; + QTest::newRow ("rtty") << SpecialOperatingActivity::RTTY << false << QString {"FT RU"}; + QTest::newRow ("ww-digi") << SpecialOperatingActivity::WW_DIGI << false << QString {"WW Digi"}; + QTest::newRow ("arrl-digi") << SpecialOperatingActivity::ARRL_DIGI << false << QString {"ARRL Digi"}; + QTest::newRow ("q65-pileup") << SpecialOperatingActivity::Q65_PILEUP << false << QString {"Q65 Pileup"}; + QTest::newRow ("nccc-ignored-outside-na-vhf") << SpecialOperatingActivity::EU_VHF << true << QString {"EU VHF"}; + QTest::newRow ("none") << SpecialOperatingActivity::NONE << false << QString {}; + QTest::newRow ("fox") << SpecialOperatingActivity::FOX << false << QString {"Fox"}; + QTest::newRow ("hound") << SpecialOperatingActivity::HOUND << false << QString {"Hound"}; +} + +void TestSpecOpLabel::formatsLabel () +{ + QFETCH (SpecialOperatingActivity, specialOperation); + QFETCH (bool, ncccSprint); + QFETCH (QString, expected); + + QCOMPARE (SpecOpLabel::label (specialOperation, ncccSprint), expected); +} + +void TestSpecOpLabel::superFoxPreference () +{ + QCOMPARE(SpecOpLabel::label(SpecialOperatingActivity::FOX, false, true), QString("Super Fox")); + QCOMPARE(SpecOpLabel::label(SpecialOperatingActivity::HOUND, false, true), QString("Super Hound")); + QCOMPARE(SpecOpLabel::label(SpecialOperatingActivity::NONE, false, true), QString{}); + QCOMPARE(SpecOpLabel::label(SpecialOperatingActivity::NA_VHF, true, true), QString("NCCC Sprint")); +} + +QTEST_MAIN (TestSpecOpLabel) +#include "test_spec_op_label.moc" diff --git a/tests/unit/common/test_superfox_tx_planner.cpp b/tests/unit/common/test_superfox_tx_planner.cpp new file mode 100644 index 00000000..f1c6dc84 --- /dev/null +++ b/tests/unit/common/test_superfox_tx_planner.cpp @@ -0,0 +1,125 @@ +#include "SuperFoxTxPlanner.h" + +#include + +class TestSuperFoxTxPlanner : public QObject +{ + Q_OBJECT + +private slots: + void freeTextCapsQueuedReportsAtFour(); + void noFreeTextAllowsNineRecords(); + void freeTextRR73UsesSharedRecordCapacity(); + void parseQueuedHoundLine(); + +private: + static SuperFoxTxPlanner::QsoState qso(QString const& call, + QString const& report = "-10", + int ncall = 0, + int tFoxRrpt = -1, + int tFoxTxRR73 = -1); + static QString queueLine(QString const& call, QString const& report, + QString const& grid); +}; + +SuperFoxTxPlanner::QsoState TestSuperFoxTxPlanner::qso(QString const& call, + QString const& report, + int ncall, + int tFoxRrpt, + int tFoxTxRR73) +{ + SuperFoxTxPlanner::QsoState result; + result.call = call; + result.grid = "FN20"; + result.sent = report; + result.rcvd = "-05"; + result.ncall = ncall; + result.tFoxRrpt = tFoxRrpt; + result.tFoxTxRR73 = tFoxTxRR73; + return result; +} + +QString TestSuperFoxTxPlanner::queueLine(QString const& call, QString const& report, + QString const& grid) +{ + return (call + " ").left(12) + report + " " + grid; +} + +void TestSuperFoxTxPlanner::freeTextCapsQueuedReportsAtFour() +{ + QVector qsos; + QQueue inProgress; + QVector queue; + for (auto const& call : {"K1AAA", "K1AAB", "K1AAC", "K1AAD", "K1AAE"}) + { + queue.push_back(SuperFoxTxPlanner::parseQueuedHound(queueLine(call, "-12", "FN31"))); + } + + auto const plan = SuperFoxTxPlanner::plan(qsos, inProgress, queue, 3, true); + + QCOMPARE(plan.records.size(), 4); + QCOMPARE(plan.reportCount(), 4); + QCOMPARE(plan.queuedReportCount(), 4); + QCOMPARE(plan.records.at(0).call, QString {"K1AAA"}); + QCOMPARE(plan.records.at(3).call, QString {"K1AAD"}); +} + +void TestSuperFoxTxPlanner::noFreeTextAllowsNineRecords() +{ + QVector qsos; + for (auto const& call : {"K1RR1", "K1RR2", "K1RR3", "K1RR4", "K1RR5"}) + { + qsos.push_back(qso(call, "-10", 0, 10, -1)); + } + + QQueue inProgress; + QVector queue; + for (auto const& call : {"K1RP1", "K1RP2", "K1RP3", "K1RP4", "K1RP5"}) + { + queue.push_back(SuperFoxTxPlanner::parseQueuedHound(queueLine(call, "-07", "FN32"))); + } + + auto const plan = SuperFoxTxPlanner::plan(qsos, inProgress, queue, 3, false); + + QCOMPARE(plan.records.size(), 9); + QCOMPARE(plan.rr73Count(), 5); + QCOMPARE(plan.reportCount(), 4); + QCOMPARE(plan.queuedReportCount(), 4); +} + +void TestSuperFoxTxPlanner::freeTextRR73UsesSharedRecordCapacity() +{ + QVector qsos; + for (auto const& call : {"K1RR1", "K1RR2", "K1RR3"}) + { + qsos.push_back(qso(call, "-10", 0, 10, -1)); + } + + QQueue inProgress; + QVector queue; + for (auto const& call : {"K1RP1", "K1RP2"}) + { + queue.push_back(SuperFoxTxPlanner::parseQueuedHound(queueLine(call, "-07", "FN32"))); + } + + auto const plan = SuperFoxTxPlanner::plan(qsos, inProgress, queue, 3, true); + + QCOMPARE(plan.records.size(), 4); + QCOMPARE(plan.rr73Count(), 3); + QCOMPARE(plan.reportCount(), 1); + QCOMPARE(plan.queuedReportCount(), 1); + QCOMPARE(plan.records.last().call, QString {"K1RP1"}); +} + +void TestSuperFoxTxPlanner::parseQueuedHoundLine() +{ + auto const hound = SuperFoxTxPlanner::parseQueuedHound(queueLine("K1ABC", "+03", "FN42")); + + QCOMPARE(hound.call, QString {"K1ABC"}); + QCOMPARE(hound.report, QString {"+03"}); + QCOMPARE(hound.grid, QString {"FN42"}); +} + +QTEST_MAIN(TestSuperFoxTxPlanner) + +#include "test_superfox_tx_planner.moc" diff --git a/tests/unit/common/test_tx_inhibit_transceiver.cpp b/tests/unit/common/test_tx_inhibit_transceiver.cpp new file mode 100644 index 00000000..8b67f2f1 --- /dev/null +++ b/tests/unit/common/test_tx_inhibit_transceiver.cpp @@ -0,0 +1,485 @@ +#include + +#include +#include + +#include "Transceiver/TransceiverBase.hpp" +#include "Transceiver/TransceiverFactory.hpp" +#include "Transceiver/TxInhibitTransceiver.hpp" + +class FakeInhibitTransceiver final + : public Transceiver +{ + Q_OBJECT + +public: + FakeInhibitTransceiver () + : Transceiver {nullptr, nullptr} + { + } + + void set (TransceiverState const& state, unsigned sequence_number) noexcept override + { + ++set_calls; + last_set_thread = QThread::currentThread (); + last_state = state; + last_sequence_number = sequence_number; + } + + void start (unsigned sequence_number) noexcept override + { + started = true; + last_sequence_number = sequence_number; + } + + void stop () noexcept override + { + stopped = true; + } + + void send_update (TransceiverState const& state, unsigned sequence_number) + { + Q_EMIT update (state, sequence_number); + } + + void send_receive_audio (ReceiveAudio audio) { Q_EMIT receiveAudio (audio); } + + TransceiverState last_state; + unsigned last_sequence_number {0}; + bool stopped {false}; + bool started {false}; + int set_calls {0}; + QThread * last_set_thread {nullptr}; +}; + +class RecordingTransceiverBase final + : public TransceiverBase +{ +public: + explicit RecordingTransceiverBase (logger_type * logger) + : TransceiverBase {logger, nullptr} + { + } + + QStringList operations; + +private: + int do_start () override {return 0;} + void do_stop () override {} + void do_frequency (Frequency, MODE, bool) override {} + void do_tx_frequency (Frequency, MODE, bool) override {} + void do_mode (MODE) override {} + + void do_ptt (bool on) override + { + operations.append (QStringLiteral ("ptt:%1").arg (on)); + update_PTT (on); + } + + void do_tune (bool on) override + { + operations.append (QStringLiteral ("tune:%1").arg (on)); + } +}; + +class TestTxInhibitTransceiver : public QObject +{ + Q_OBJECT + +private: + Q_SIGNAL void command (QString controller, quint32 ttl, QString station); + + Q_SLOT void forwardsReceiveAudio () + { + auto * fake = new FakeInhibitTransceiver; + TxInhibitTransceiver transceiver {nullptr, std::unique_ptr {fake}}; + ReceiveAudio observed; + connect (&transceiver, &Transceiver::receiveAudio, + this, [&observed] (ReceiveAudio audio) { observed = std::move (audio); }); + auto block = std::make_shared (); + + fake->send_receive_audio (block); + + QCOMPARE (observed, ReceiveAudio {block}); + } + + Q_SLOT void holdFiltersPttAndTuneWithoutChangingReportedRigState () + { + auto * fake = new FakeInhibitTransceiver; + TxInhibitTransceiver transceiver {nullptr, std::unique_ptr {fake}}; + QSignalSpy status {&transceiver, &TxInhibitTransceiver::statusChanged}; + QSignalSpy updates {&transceiver, &Transceiver::update}; + transceiver.start (10); + QVERIFY (!status.isEmpty ()); + + Transceiver::TransceiverState requested; + requested.online (true); + requested.ptt (true); + requested.tune (true); + transceiver.set (requested, 11); + QVERIFY (fake->last_state.ptt ()); + QVERIFY (fake->last_state.tune ()); + + transceiver.tx_inhibit_command (QStringLiteral ("W1AW"), 600, QStringLiteral ("W1AW")); + QTRY_VERIFY (!fake->last_state.ptt ()); + QVERIFY (!fake->last_state.tune ()); + + Transceiver::TransceiverState physical; + physical.online (true); + physical.ptt (false); + physical.tune (false); + fake->send_update (physical, 11); + QCOMPARE (updates.size (), 1); + auto const reported = qvariant_cast (updates.takeFirst ().at (0)); + QVERIFY (!reported.ptt ()); + QVERIFY (!reported.tune ()); + } + + Q_SLOT void pttAndTuneTransitionsReachTransceiverBaseInSafeOrder () + { + Transceiver::logger_type logger; + auto * recorder = new RecordingTransceiverBase {&logger}; + TxInhibitTransceiver transceiver { + &logger, std::unique_ptr {recorder}}; + QSignalSpy status {&transceiver, &TxInhibitTransceiver::statusChanged}; + transceiver.start (12); + + Transceiver::TransceiverState requested; + requested.online (true); + requested.ptt (true); + requested.tune (true); + transceiver.set (requested, 13); + QCOMPARE (recorder->operations.mid (recorder->operations.size () - 2), + QStringList ({QStringLiteral ("tune:1"), QStringLiteral ("ptt:1")})); + + transceiver.tx_inhibit_command (QStringLiteral ("W1AW"), 600, QStringLiteral ("W1AW")); + QTRY_COMPARE (recorder->operations.mid (recorder->operations.size () - 2), + QStringList ({QStringLiteral ("ptt:0"), QStringLiteral ("tune:0")})); + + transceiver.tx_inhibit_command (QStringLiteral ("W1AW"), 0, QStringLiteral ("W1AW")); + QTRY_COMPARE (recorder->operations.mid (recorder->operations.size () - 2), + QStringList ({QStringLiteral ("tune:1"), QStringLiteral ("ptt:1")})); + } + + Q_SLOT void holdBeforeFirstRequestDoesNotForwardAnOfflineState () + { + auto * fake = new FakeInhibitTransceiver; + TxInhibitTransceiver transceiver {nullptr, std::unique_ptr {fake}}; + QSignalSpy status {&transceiver, &TxInhibitTransceiver::statusChanged}; + transceiver.start (15); + + transceiver.tx_inhibit_command (QStringLiteral ("W1AW"), 600, QStringLiteral ("W1AW")); + QTRY_VERIFY (status.last ().at (1).toBool ()); + QCOMPARE (fake->set_calls, 0); + + Transceiver::TransceiverState requested; + requested.online (true); + requested.ptt (true); + transceiver.set (requested, 16); + QVERIFY (fake->last_state.online ()); + QVERIFY (!fake->last_state.ptt ()); + } + + Q_SLOT void releasesAreScopedToControllerIdentity () + { + auto * fake = new FakeInhibitTransceiver; + TxInhibitTransceiver transceiver {nullptr, std::unique_ptr {fake}}; + QSignalSpy status {&transceiver, &TxInhibitTransceiver::statusChanged}; + transceiver.start (20); + + Transceiver::TransceiverState requested; + requested.online (true); + requested.ptt (true); + transceiver.set (requested, 21); + + transceiver.tx_inhibit_command (QStringLiteral ("OWNER"), 600, QStringLiteral ("OWNER")); + QTRY_VERIFY (!fake->last_state.ptt ()); + + transceiver.tx_inhibit_command (QStringLiteral ("OTHER"), 0, QStringLiteral ("OTHER")); + QTest::qWait (30); + QVERIFY (!fake->last_state.ptt ()); + + transceiver.tx_inhibit_command (QStringLiteral ("OTHER"), 600, QStringLiteral ("OWNER")); + QTRY_COMPARE (status.last ().at (3).toUInt (), 2u); + transceiver.tx_inhibit_command (QStringLiteral ("OWNER"), 0, QStringLiteral ("OWNER")); + QTest::qWait (30); + QVERIFY (!fake->last_state.ptt ()); + + transceiver.tx_inhibit_command (QStringLiteral ("OTHER"), 0, QStringLiteral ("OTHER")); + QTRY_VERIFY (fake->last_state.ptt ()); + } + + Q_SLOT void excessHoldersRemainBoundedAndFailClosed () + { + auto * fake = new FakeInhibitTransceiver; + TxInhibitTransceiver transceiver {nullptr, std::unique_ptr {fake}}; + QSignalSpy status {&transceiver, &TxInhibitTransceiver::statusChanged}; + transceiver.start (22); + + Transceiver::TransceiverState requested; + requested.online (true); + requested.ptt (true); + transceiver.set (requested, 23); + + for (auto i = 0; i < TxInhibitTransceiver::maximum_tracked_holds; ++i) + { + transceiver.tx_inhibit_command (QStringLiteral ("HOLDER_%1").arg (i), 1200, QStringLiteral ("HOLDER_%1").arg (i)); + } + QTRY_COMPARE (status.last ().at (2).toString ().split (QStringLiteral (", ")).size (), + TxInhibitTransceiver::maximum_tracked_holds); + + transceiver.tx_inhibit_command (QStringLiteral ("HOLDER_0"), 2400, QStringLiteral ("HOLDER_0")); + + transceiver.tx_inhibit_command (QStringLiteral ("OVERFLOW"), 1800, QStringLiteral ("OVERFLOW")); + + transceiver.tx_inhibit_command (QStringLiteral ("OVERFLOW"), 0, QStringLiteral ("OVERFLOW")); + + QTRY_COMPARE_WITH_TIMEOUT (status.last ().at (2).toString (), + QStringLiteral ("HOLDER_0"), 1800); + + transceiver.tx_inhibit_command (QStringLiteral ("HOLDER_0"), 0, QStringLiteral ("HOLDER_0")); + QTRY_VERIFY (status.last ().at (2).toString ().isEmpty ()); + QVERIFY (status.last ().at (1).toBool ()); + QVERIFY (!fake->last_state.ptt ()); + QTRY_VERIFY_WITH_TIMEOUT (fake->last_state.ptt (), 1200); + } + + Q_SLOT void leaseExpiresAndClearedIntentDoesNotRekey () + { + auto * fake = new FakeInhibitTransceiver; + TxInhibitTransceiver transceiver {nullptr, std::unique_ptr {fake}}; + QSignalSpy status {&transceiver, &TxInhibitTransceiver::statusChanged}; + transceiver.start (30); + + Transceiver::TransceiverState requested; + requested.online (true); + requested.ptt (true); + transceiver.set (requested, 31); + + transceiver.tx_inhibit_command (QStringLiteral ("W2SZ"), 100, QStringLiteral ("W2SZ")); + QTRY_VERIFY (!fake->last_state.ptt ()); + QTRY_VERIFY_WITH_TIMEOUT (fake->last_state.ptt (), 300); + QCOMPARE (status.last ().at (5).toUInt (), 1u); + + transceiver.tx_inhibit_command (QStringLiteral ("W2SZ"), 600, QStringLiteral ("W2SZ")); + QTRY_VERIFY (!fake->last_state.ptt ()); + requested.ptt (false); + transceiver.set (requested, 32); + transceiver.tx_inhibit_command (QStringLiteral ("W2SZ"), 0, QStringLiteral ("W2SZ")); + QTest::qWait (30); + QVERIFY (!fake->last_state.ptt ()); + } + + Q_SLOT void refreshedHoldExtendsItsDeadline () + { + auto * fake = new FakeInhibitTransceiver; + TxInhibitTransceiver transceiver {nullptr, std::unique_ptr {fake}}; + QSignalSpy status {&transceiver, &TxInhibitTransceiver::statusChanged}; + transceiver.start (35); + + Transceiver::TransceiverState requested; + requested.online (true); + requested.ptt (true); + transceiver.set (requested, 36); + + transceiver.tx_inhibit_command (QStringLiteral ("W2SZ"), 800, QStringLiteral ("W2SZ")); + QTRY_VERIFY (!fake->last_state.ptt ()); + QTest::qWait (450); + transceiver.tx_inhibit_command (QStringLiteral ("W2SZ"), 800, QStringLiteral ("W2SZ")); + QTest::qWait (450); + QVERIFY (!fake->last_state.ptt ()); + QTRY_VERIFY_WITH_TIMEOUT (fake->last_state.ptt (), 600); + QCOMPARE (status.last ().at (3).toUInt (), 2u); + QCOMPARE (status.last ().at (5).toUInt (), 1u); + } + + Q_SLOT void stopDoesNotRestorePttFromAnActiveHold () + { + auto * fake = new FakeInhibitTransceiver; + TxInhibitTransceiver transceiver {nullptr, std::unique_ptr {fake}}; + QSignalSpy status {&transceiver, &TxInhibitTransceiver::statusChanged}; + transceiver.start (37); + + Transceiver::TransceiverState requested; + requested.online (true); + requested.ptt (true); + transceiver.set (requested, 38); + + transceiver.tx_inhibit_command (QStringLiteral ("W2SZ"), 100, QStringLiteral ("W2SZ")); + QTRY_VERIFY (!fake->last_state.ptt ()); + auto const set_calls = fake->set_calls; + + transceiver.stop (); + QVERIFY (fake->stopped); + QVERIFY (!status.last ().at (0).toBool ()); + QVERIFY (!status.last ().at (1).toBool ()); + QTest::qWait (200); + QCOMPARE (fake->set_calls, set_calls); + QVERIFY (!fake->last_state.ptt ()); + } + + Q_SLOT void counterOnlyChangesEmitStatus () + { + auto * fake = new FakeInhibitTransceiver; + TxInhibitTransceiver transceiver {nullptr, std::unique_ptr {fake}}; + QSignalSpy status {&transceiver, &TxInhibitTransceiver::statusChanged}; + transceiver.start (39); + + auto status_count = status.size (); + + transceiver.tx_inhibit_invalid (3); + QCOMPARE (status.size (), ++status_count); + QCOMPARE (status.last ().at (6).toUInt (), 3u); + + transceiver.tx_inhibit_command (QStringLiteral ("COUNTER"), 0, {}); + QCOMPARE (status.size (), ++status_count); + QCOMPARE (status.last ().at (4).toUInt (), 1u); + transceiver.tx_inhibit_command (QStringLiteral ("COUNTER"), 600, {}); + QCOMPARE (status.size (), ++status_count); + transceiver.tx_inhibit_command (QStringLiteral ("COUNTER"), 600, {}); + QCOMPARE (status.size (), ++status_count); + QCOMPARE (status.last ().at (3).toUInt (), 2u); + } + + Q_SLOT void pttOffWithChangedTxRequestForwardsFinalState () + { + auto * fake = new FakeInhibitTransceiver; + TxInhibitTransceiver transceiver {nullptr, std::unique_ptr {fake}}; + QSignalSpy status {&transceiver, &TxInhibitTransceiver::statusChanged}; + transceiver.start (41); + + Transceiver::TransceiverState requested; + requested.online (true); + requested.ptt (true); + transceiver.set (requested, 42); + + auto next_request = requested.tx_request (); + next_request.mode = QStringLiteral ("JT9"); + next_request.fast_mode = true; + requested.ptt (false); + requested.tx_request (next_request); + transceiver.set (requested, 43); + + QVERIFY (!fake->last_state.ptt ()); + QCOMPARE (fake->last_state.tx_request ().mode, QStringLiteral ("JT9")); + QVERIFY (fake->last_state.tx_request ().fast_mode); + } + + Q_SLOT void txRequestEqualityIncludesAllFields () + { + TxEvidence::TxRequest lhs; + auto rhs = lhs; + QVERIFY (lhs == rhs); + + rhs.mode = QStringLiteral ("JT9"); + QVERIFY (lhs != rhs); + rhs = lhs; + rhs.fast_mode = true; + QVERIFY (lhs != rhs); + rhs = lhs; + rhs.channel = AudioDevice::Right; + QVERIFY (lhs != rhs); + rhs = lhs; + rhs.queue_epoch = TxAudioQueueEpoch {1}; + QVERIFY (lhs != rhs); + rhs = lhs; + rhs.start_window_open_ms = 1; + QVERIFY (lhs != rhs); + } + + Q_SLOT void txInhibitCapabilityMatchesPttMethod () + { + QVERIFY (TransceiverFactory::supports_tx_inhibit (TransceiverFactory::PTT_method_DTR)); + QVERIFY (TransceiverFactory::supports_tx_inhibit (TransceiverFactory::PTT_method_RTS)); + QVERIFY (!TransceiverFactory::supports_tx_inhibit (TransceiverFactory::PTT_method_CAT)); + QVERIFY (!TransceiverFactory::supports_tx_inhibit (TransceiverFactory::PTT_method_VOX)); + } + + Q_SLOT void queuedCommandsApplyOnTransceiverThread () + { + auto * fake = new FakeInhibitTransceiver; + TxInhibitTransceiver transceiver {nullptr, std::unique_ptr {fake}}; + QThread worker; + auto * gui_thread = QThread::currentThread (); + fake->moveToThread (&worker); + transceiver.moveToThread (&worker); + connect (this, &TestTxInhibitTransceiver::command, + &transceiver, &TxInhibitTransceiver::tx_inhibit_command, Qt::QueuedConnection); + worker.start (); + QMetaObject::invokeMethod (&transceiver, [&] { + transceiver.start (70); + Transceiver::TransceiverState requested; + requested.online (true); + requested.ptt (true); + transceiver.set (requested, 71); + }, Qt::BlockingQueuedConnection); + Q_EMIT command (QStringLiteral ("KEY"), 600, {}); + bool held_on_worker {false}; + QMetaObject::invokeMethod (&transceiver, [&] { + held_on_worker = !fake->last_state.ptt () && fake->last_set_thread == &worker; + }, Qt::BlockingQueuedConnection); + Q_EMIT command (QStringLiteral ("KEY"), 0, {}); + bool released_on_worker {false}; + QMetaObject::invokeMethod (&transceiver, [&] { + released_on_worker = fake->last_state.ptt () && fake->last_set_thread == &worker; + transceiver.stop (); + fake->moveToThread (gui_thread); + transceiver.moveToThread (gui_thread); + }, Qt::BlockingQueuedConnection); + worker.quit (); + worker.wait (); + QVERIFY (held_on_worker); + QVERIFY (released_on_worker); + } + + Q_SLOT void noHoldAllowsPttAndTune () + { + auto * fake = new FakeInhibitTransceiver; + TxInhibitTransceiver transceiver {nullptr, std::unique_ptr {fake}}; + QSignalSpy status {&transceiver, &TxInhibitTransceiver::statusChanged}; + transceiver.start (50); + QVERIFY (fake->started); + QVERIFY (status.last ().at (0).toBool ()); + QVERIFY (!status.last ().at (1).toBool ()); + Transceiver::TransceiverState requested; + requested.online (true); + requested.ptt (true); + requested.tune (true); + transceiver.set (requested, 51); + QVERIFY (fake->last_state.ptt ()); + QVERIFY (fake->last_state.tune ()); + requested.ptt (false); + requested.tune (false); + transceiver.set (requested, 52); + QVERIFY (!fake->last_state.ptt ()); + QVERIFY (!fake->last_state.tune ()); + } + + Q_SLOT void endedTuneAndUpdatedMetadataDoNotRestartAfterRelease () + { + auto * fake = new FakeInhibitTransceiver; + TxInhibitTransceiver transceiver {nullptr, std::unique_ptr {fake}}; + transceiver.start (60); + Transceiver::TransceiverState requested; + requested.online (true); + requested.ptt (true); + requested.tune (true); + transceiver.set (requested, 61); + transceiver.tx_inhibit_command (QStringLiteral ("KEY"), 600, {}); + requested.ptt (false); + requested.tune (false); + auto request = requested.tx_request (); + request.mode = QStringLiteral ("JT9"); + request.fast_mode = true; + requested.tx_request (request); + transceiver.set (requested, 62); + transceiver.tx_inhibit_command (QStringLiteral ("KEY"), 0, {}); + QVERIFY (!fake->last_state.ptt ()); + QVERIFY (!fake->last_state.tune ()); + QVERIFY (fake->last_state.tx_request () == request); + } + +}; + +QTEST_MAIN (TestTxInhibitTransceiver) +#include "test_tx_inhibit_transceiver.moc" diff --git a/tests/unit/common/test_tx_start_policy.cpp b/tests/unit/common/test_tx_start_policy.cpp new file mode 100644 index 00000000..255476bb --- /dev/null +++ b/tests/unit/common/test_tx_start_policy.cpp @@ -0,0 +1,108 @@ +#include + +#include "TxStartPolicy.hpp" + +class TestTxStartPolicy final + : public QObject +{ + Q_OBJECT + +private slots: + void standardMessageModesRequireText (); + void generatedPayloadModesDoNotRequireText (); + void unknownModesDefaultToStandardMessages (); + void missingPayloadStopsOnlyStandardMessageModes (); + void canStartTransmitRequiresPayloadAndOpenWindow (); + void generatedPayloadModesRespectStartWindow (); + void tuningCanStartWithoutPayload (); + void rejectedGeneratedMessageBlocksTransmit (); +}; + +void TestTxStartPolicy::standardMessageModesRequireText () +{ + for (auto const& mode : {"FT8", "FT4", "MSK144", "Q65", "JT65", "JT4", "FST4"}) + { + QVERIFY (requires_standard_tx_message (mode)); + QVERIFY (!tx_payload_ready (mode, 0)); + QVERIFY (tx_payload_ready (mode, 1)); + } +} + +void TestTxStartPolicy::generatedPayloadModesDoNotRequireText () +{ + for (auto const& mode : {"Echo", "WSPR", "FST4W", "JTTY"}) + { + QVERIFY (!requires_standard_tx_message (mode)); + QVERIFY (tx_payload_ready (mode, 0)); + } +} + +void TestTxStartPolicy::unknownModesDefaultToStandardMessages () +{ + for (auto const& mode : {"", "Unknown"}) + { + QVERIFY (requires_standard_tx_message (mode)); + QVERIFY (!tx_payload_ready (mode, 0)); + QVERIFY (tx_payload_ready (mode, 1)); + } +} + +void TestTxStartPolicy::missingPayloadStopsOnlyStandardMessageModes () +{ + QVERIFY (should_stop_for_missing_tx_payload ("FT8", 0, false)); + QVERIFY (!should_stop_for_missing_tx_payload ("FT8", 1, false)); + QVERIFY (!should_stop_for_missing_tx_payload ("Echo", 0, false)); + QVERIFY (!should_stop_for_missing_tx_payload ("WSPR", 0, false)); + QVERIFY (!should_stop_for_missing_tx_payload ("FST4W", 0, false)); + QVERIFY (!should_stop_for_missing_tx_payload ("JTTY", 0, false)); + QVERIFY (!should_stop_for_missing_tx_payload ("FT8", 0, true)); +} + +void TestTxStartPolicy::canStartTransmitRequiresPayloadAndOpenWindow () +{ + QVERIFY (!can_start_transmit ("FT8", true, 0.5, 0, false)); + QVERIFY (can_start_transmit ("FT8", true, 0.5, 1, false)); + QVERIFY (!can_start_transmit ("FT8", true, 0.75, 1, false)); + QVERIFY (!can_start_transmit ("FT8", false, 0.5, 1, false)); + + QVERIFY (can_start_transmit ("Echo", true, 0.5, 0, false)); + QVERIFY (!can_start_transmit ("Echo", false, 0.5, 0, false)); + QVERIFY (can_start_transmit ("WSPR", true, 0.5, 0, false)); + QVERIFY (can_start_transmit ("FST4W", true, 0.5, 0, false)); + + QVERIFY (can_start_transmit ("JTTY", false, 0.95, 0, false)); +} + +void TestTxStartPolicy::generatedPayloadModesRespectStartWindow () +{ + QVERIFY (can_start_transmit ("Echo", true, 0.5, 0, false)); + QVERIFY (!can_start_transmit ("Echo", true, TxStartLatestPeriodFraction, 0, false)); + QVERIFY (!can_start_transmit ("Echo", true, 0.8, 0, false)); + QVERIFY (!can_start_transmit ("WSPR", true, TxStartLatestPeriodFraction, 0, false)); + QVERIFY (!can_start_transmit ("FST4W", true, 0.8, 0, false)); + QVERIFY (can_start_transmit ("JTTY", false, 0.95, 0, false)); +} + +void TestTxStartPolicy::tuningCanStartWithoutPayload () +{ + QVERIFY (can_start_transmit ("FT8", false, 0.95, 0, true)); +} + +void TestTxStartPolicy::rejectedGeneratedMessageBlocksTransmit () +{ + QVERIFY (should_block_generated_transmit ("*** bad message ***", false)); + QVERIFY (should_block_generated_transmit ( + QStringLiteral ("*** bad message ***").leftJustified (37, ' '), false)); + + QVERIFY (!should_block_generated_transmit ("*** bad message ***", true)); + QVERIFY (!should_block_generated_transmit ("TUNE", false)); + QVERIFY (!should_block_generated_transmit ("ECHO", false)); + QVERIFY (!should_block_generated_transmit ( + QStringLiteral ("K1ABC W9XYZ R-10").leftJustified (22, ' '), false)); + QVERIFY (!should_block_generated_transmit ( + QStringLiteral ("CQ K1ABC FN42").leftJustified (37, ' '), false)); +} + +QTEST_MAIN (TestTxStartPolicy) + +#include "test_tx_start_policy.moc" diff --git a/tests/unit/common/test_wait_feature_policy.cpp b/tests/unit/common/test_wait_feature_policy.cpp new file mode 100644 index 00000000..c50523b6 --- /dev/null +++ b/tests/unit/common/test_wait_feature_policy.cpp @@ -0,0 +1,162 @@ +#include + +#include "WaitFeaturePolicy.hpp" + +class TestWaitFeaturePolicy final + : public QObject +{ + Q_OBJECT + +private slots: + void enableTxWarning_data (); + void enableTxWarning (); + void waitAndCallEligibility_data (); + void waitAndCallEligibility (); +}; + +void TestWaitFeaturePolicy::enableTxWarning_data () +{ + QTest::addColumn ("mode"); + QTest::addColumn ("specialOperation"); + QTest::addColumn ("waitFeaturesEnabled"); + QTest::addColumn ("autoSequenceEnabled"); + QTest::addColumn ("hasDxCall"); + QTest::addColumn ("ncccSprint"); + QTest::addColumn ("expected"); + + using Op = SpecialOperatingActivity; + auto addRow = [] (char const * name, QString const& mode, Op operation, + bool waitEnabled, bool autoSeq, bool hasCall, bool nccc, + EnableTxWarning expected) { + QTest::newRow (name) << mode << static_cast (operation) << waitEnabled + << autoSeq << hasCall << nccc << static_cast (expected); + }; + + using Warning = EnableTxWarning; + addRow ("arrl-digi-auto-seq", "FT8", Op::ARRL_DIGI, true, true, true, false, + Warning::WAIT_AND_REPLY); + addRow ("arrl-digi-no-auto-seq", "FT8", Op::ARRL_DIGI, true, false, true, false, + Warning::WAIT_AND_REPLY); + addRow ("field-day", "FT4", Op::FIELD_DAY, true, true, true, false, + Warning::WAIT_AND_REPLY); + addRow ("ww-digi-no-auto-seq", "FT4", Op::WW_DIGI, true, false, true, false, + Warning::WAIT_AND_REPLY); + addRow ("ordinary-no-auto-seq", "Q65", Op::NONE, true, false, true, false, + Warning::WAIT_AND_REPLY); + + for (auto const& mode : {"FT8", "FT4", "Q65", "FST4", "MSK144", "JT65", "JT9", "JT4"}) + { + addRow (qPrintable (QString {"supported-%1"}.arg (mode)), mode, Op::NONE, + true, true, true, false, Warning::WAIT_AND_REPLY); + } + for (auto const& mode : {"WSPR", "FST4W", "Echo", "JTTY", "Unknown"}) + { + addRow (qPrintable (QString {"unsupported-%1"}.arg (mode)), mode, Op::NONE, + true, true, true, false, Warning::NONE); + } + + addRow ("missing-call", "FT8", Op::NONE, true, true, false, false, Warning::NONE); + addRow ("wait-features-disabled", "FT8", Op::NONE, false, true, true, false, + Warning::NONE); + addRow ("fox", "FT8", Op::FOX, true, true, true, false, Warning::NONE); + addRow ("nccc-sprint-override", "FT4", Op::NA_VHF, false, false, true, true, + Warning::NCCC_SPRINT); + addRow ("nccc-wrong-mode", "FT8", Op::NA_VHF, false, false, true, true, Warning::NONE); + addRow ("hound-wait-enabled", "FT8", Op::HOUND, true, false, true, false, + Warning::HOUND_AUTO_REPLY); + addRow ("hound-wait-disabled", "FT8", Op::HOUND, false, false, true, false, + Warning::HOUND_AUTO_REPLY); + addRow ("hound-without-call", "FT8", Op::HOUND, true, false, false, false, + Warning::NONE); + addRow ("non-ft8-hound", "FT4", Op::HOUND, true, true, true, false, + Warning::NONE); +} + +void TestWaitFeaturePolicy::enableTxWarning () +{ + QFETCH (QString, mode); + QFETCH (int, specialOperation); + QFETCH (bool, waitFeaturesEnabled); + QFETCH (bool, autoSequenceEnabled); + QFETCH (bool, hasDxCall); + QFETCH (bool, ncccSprint); + QFETCH (int, expected); + + WaitFeatureContext const context { + mode, + static_cast (specialOperation), + waitFeaturesEnabled, + autoSequenceEnabled, + hasDxCall, + ncccSprint + }; + QCOMPARE (static_cast (enable_tx_warning (context)), expected); +} + +void TestWaitFeaturePolicy::waitAndCallEligibility_data () +{ + QTest::addColumn ("mode"); + QTest::addColumn ("specialOperation"); + QTest::addColumn ("waitFeaturesEnabled"); + QTest::addColumn ("autoSequenceEnabled"); + QTest::addColumn ("hasDxCall"); + QTest::addColumn ("expectedArming"); + QTest::addColumn ("expectedWarning"); + + using Op = SpecialOperatingActivity; + auto addRow = [] (char const * name, QString const& mode, Op operation, + bool waitEnabled, bool autoSeq, bool hasCall, + bool expectedArming, bool expectedWarning) { + QTest::newRow (name) << mode << static_cast (operation) << waitEnabled + << autoSeq << hasCall << expectedArming << expectedWarning; + }; + + for (auto const& mode : {"FT8", "FT4", "Q65", "FST4", "MSK144"}) + { + addRow (qPrintable (QString {"ordinary-%1"}.arg (mode)), mode, Op::NONE, + true, true, true, true, true); + } + for (auto const& mode : {"JT65", "JT9", "JT4", "WSPR"}) + { + addRow (qPrintable (QString {"unsupported-%1"}.arg (mode)), mode, Op::NONE, + true, true, true, false, false); + } + + addRow ("missing-call", "FT8", Op::NONE, true, true, false, false, false); + addRow ("ft8-hound-with-call", "FT8", Op::HOUND, true, true, true, true, true); + addRow ("ft8-hound-no-call", "FT8", Op::HOUND, true, true, false, true, false); + addRow ("non-ft8-hound-with-call", "FT4", Op::HOUND, true, true, true, false, false); + addRow ("ft4-hound-no-call", "FT4", Op::HOUND, true, true, false, false, false); + addRow ("auto-seq-disabled", "FT8", Op::NONE, true, false, true, false, false); + addRow ("wait-features-disabled", "FT8", Op::NONE, false, true, true, false, false); + addRow ("arrl-digi", "FT8", Op::ARRL_DIGI, true, true, true, false, false); + addRow ("field-day", "FT4", Op::FIELD_DAY, true, true, true, false, false); + addRow ("nccc-sprint", "FT4", Op::NA_VHF, true, true, true, false, false); + addRow ("fox", "FT8", Op::FOX, true, true, true, false, false); +} + +void TestWaitFeaturePolicy::waitAndCallEligibility () +{ + QFETCH (QString, mode); + QFETCH (int, specialOperation); + QFETCH (bool, waitFeaturesEnabled); + QFETCH (bool, autoSequenceEnabled); + QFETCH (bool, hasDxCall); + QFETCH (bool, expectedArming); + QFETCH (bool, expectedWarning); + + WaitFeatureContext const context { + mode, + static_cast (specialOperation), + waitFeaturesEnabled, + autoSequenceEnabled, + hasDxCall, + false + }; + QCOMPARE (wait_and_call_arming_eligible (context), expectedArming); + QCOMPARE (wait_and_call_warning_eligible (context), expectedWarning); +} + +QTEST_MAIN (TestWaitFeaturePolicy) + +#include "test_wait_feature_policy.moc" diff --git a/tests/unit/common/test_waterfall_scale.cpp b/tests/unit/common/test_waterfall_scale.cpp new file mode 100644 index 00000000..c4b9a038 --- /dev/null +++ b/tests/unit/common/test_waterfall_scale.cpp @@ -0,0 +1,267 @@ +#include +#include + +#include + +#include "widgets/WaterfallScale.hpp" + +class TestWaterfallScale final + : public QObject +{ + Q_OBJECT + +private slots: + void frequencyToPixelClampsAtVisibleEndpoints (); + void pixelToFrequencyRemainsUnclamped (); + void conversionsRoundTripAtPixelResolution (); + void supportedConfigurationsPreserveScaleArithmetic (); + void emptyScaleQueriesAreSafe (); + void derivedValuesUpdateAfterEveryMutation (); + void maximumFrequencyPreservesFiveKilohertzRounding (); + void majorDivisionThresholdsPreserveStrictBoundaries (); + void gridLayoutPreservesAlignedLabelsAndCounts (); + void gridLayoutPreservesNonAlignedLabelOrigin (); + void divisionCountsIgnoreTinyFloatingPointOvershoot (); + void majorTickPositionsUseFullPrecision (); + void twoHundredHertzDivisionsUseFourMinorTicks (); +}; + +namespace +{ + WaterfallScale scaleWith(double hzPerPixel, int width = 1000, + int startHz = 0) + { + WaterfallScale scale; + scale.setWidth(width); + scale.setStartHz(startHz); + scale.setFftBinWidthHz(hzPerPixel); + return scale; + } +} + +void TestWaterfallScale::frequencyToPixelClampsAtVisibleEndpoints () +{ + auto scale = scaleWith(0.5, 1000, 200); + scale.setBinsPerPixel(4); + + QCOMPARE(scale.spanHz(), 2000.0f); + QCOMPARE(scale.xFromFreqHz(200.0f), 0); + QCOMPARE(scale.xFromFreqHz(2200.0f), 1000); + QCOMPARE(scale.xFromFreqHz(-1000.0f), 0); + QCOMPARE(scale.xFromFreqHz(4000.0f), 1000); + QCOMPARE(scale.xFromFreqHz(201.0f), 1); +} + +void TestWaterfallScale::pixelToFrequencyRemainsUnclamped () +{ + auto scale = scaleWith(2.0, 1000, 200); + + QCOMPARE(scale.freqHzFromX(-10), 180.0f); + QCOMPARE(scale.freqHzFromX(0), 200.0f); + QCOMPARE(scale.freqHzFromX(1000), 2200.0f); + QCOMPARE(scale.freqHzFromX(1010), 2220.0f); +} + +void TestWaterfallScale::conversionsRoundTripAtPixelResolution () +{ + auto scale = scaleWith(1500.0 / 2048.0, 1537, 125); + scale.setBinsPerPixel(7); + + for(int x : {0, 1, 127, 768, 1536, 1537}) { + QCOMPARE(scale.xFromFreqHz(scale.freqHzFromX(x)), x); + } + + double const halfPixel = scale.hzPerPixel() / 2.0; + for(float frequency : {125.0f, 126.0f, 999.25f, 4000.0f, 7999.0f}) { + int const x = scale.xFromFreqHz(frequency); + if(x > 0 && x < scale.width()) { + QVERIFY(std::abs(scale.freqHzFromX(x) - frequency) <= halfPixel); + } + } +} + +void TestWaterfallScale::supportedConfigurationsPreserveScaleArithmetic () +{ + double const fftBinWidths[] = { + 1500.0 / 2048.0, + 1500.0 / 6144.0, + 1500.0 / 12288.0, + 1500.0 / 32768.0 + }; + + for(double fftBinWidth : fftBinWidths) { + for(int startHz : {0, 100, 2500}) { + for(int width : {50, 1000, 2048}) { + for(int binsPerPixel : {1, 4, 1000}) { + WaterfallScale scale; + scale.setWidth(width); + scale.setStartHz(startHz); + scale.setBinsPerPixel(binsPerPixel); + scale.setFftBinWidthHz(fftBinWidth); + + QCOMPARE(scale.width(), width); + QCOMPARE(scale.startHz(), startHz); + QCOMPARE(scale.binsPerPixel(), binsPerPixel); + QCOMPARE(scale.fftBinWidthHz(), fftBinWidth); + QCOMPARE(scale.hzPerPixel(), binsPerPixel * fftBinWidth); + QCOMPARE(scale.spanHz(), float(width * binsPerPixel * fftBinWidth)); + QCOMPARE(scale.freqHzFromX(width), + float(startHz + width * binsPerPixel * fftBinWidth)); + } + } + } + } + + WaterfallScale scale; + scale.setBinsPerPixel(0); + QCOMPARE(scale.binsPerPixel(), 1); + scale.setBinsPerPixel(-100); + QCOMPARE(scale.binsPerPixel(), 1); + + scale.setWidth(-100); + QCOMPARE(scale.width(), 0); +} + +void TestWaterfallScale::emptyScaleQueriesAreSafe () +{ + WaterfallScale scale; + + QCOMPARE(scale.spanHz(), 0.0f); + QCOMPARE(scale.xFromFreqHz(5000.0f), 0); + QCOMPARE(scale.maxFreqHz(), 0); + + scale.setStartHz(200); + QCOMPARE(scale.xFromFreqHz(5000.0f), 0); + QCOMPARE(scale.maxFreqHz(), 200); +} + +void TestWaterfallScale::derivedValuesUpdateAfterEveryMutation () +{ + auto scale = scaleWith(1.0, 1000, 0); + + QCOMPARE(scale.spanHz(), 1000.0f); + QCOMPARE(scale.maxFreqHz(), 1000); + + scale.setWidth(2000); + QCOMPARE(scale.spanHz(), 2000.0f); + QCOMPARE(scale.maxFreqHz(), 2000); + + scale.setStartHz(1000); + QCOMPARE(scale.freqHzFromX(0), 1000.0f); + QCOMPARE(scale.maxFreqHz(), 3000); + + scale.setBinsPerPixel(2); + QCOMPARE(scale.spanHz(), 4000.0f); + QCOMPARE(scale.maxFreqHz(), 5000); + + scale.setFftBinWidthHz(0.25); + QCOMPARE(scale.spanHz(), 1000.0f); + QCOMPARE(scale.maxFreqHz(), 2000); +} + +void TestWaterfallScale::maximumFrequencyPreservesFiveKilohertzRounding () +{ + QCOMPARE(scaleWith(1.0, 4999).maxFreqHz(), 4999); + QCOMPARE(scaleWith(1.0, 5000).maxFreqHz(), 5000); + QCOMPARE(scaleWith(1.0, 6000).maxFreqHz(), 5000); + QCOMPARE(scaleWith(2.0, 1000, 4000).maxFreqHz(), 5000); + QCOMPARE(scaleWith(2.0, 1000, 4999).maxFreqHz(), 5001); + QCOMPARE(scaleWith(3.0, 1666).maxFreqHz(), 4998); +} + +void TestWaterfallScale::majorDivisionThresholdsPreserveStrictBoundaries () +{ + struct Threshold + { + float spanHz; + int atBoundary; + int aboveBoundary; + }; + + Threshold const thresholds[] = { + {100.0f, 10, 20}, + {250.0f, 20, 50}, + {500.0f, 50, 100}, + {1000.0f, 100, 200}, + {2500.0f, 200, 500} + }; + + for(auto const& threshold : thresholds) { + auto scale = scaleWith(threshold.spanHz, 1); + QCOMPARE(scale.gridLayout().majorSpacingHz, threshold.atBoundary); + + scale.setFftBinWidthHz(std::nextafter( + threshold.spanHz, std::numeric_limits::infinity())); + QCOMPARE(scale.gridLayout().majorSpacingHz, threshold.aboveBoundary); + } +} + +void TestWaterfallScale::gridLayoutPreservesAlignedLabelsAndCounts () +{ + auto const grid = scaleWith(1.0, 1000, 200).gridLayout(); + + QCOMPARE(grid.majorSpacingHz, 100); + QCOMPARE(grid.pixelsPerDivision, 100.0); + QCOMPARE(grid.overlayDivisionCount, 11); + QCOMPARE(grid.scaleDivisionCount, 10); + QCOMPARE(grid.firstMajorDivisionOffset, 0.0); + QCOMPARE(grid.verticalGridOffsetPixels, 0); + QCOMPARE(grid.minorDivisionCount, 5); + QCOMPARE(grid.labels.size(), 11); + QCOMPARE(grid.labels[0], QStringLiteral("200")); + QCOMPARE(grid.labels[1], QStringLiteral("300")); + QCOMPARE(grid.labels[10], QStringLiteral("1200")); +} + +void TestWaterfallScale::gridLayoutPreservesNonAlignedLabelOrigin () +{ + auto const grid = scaleWith(1.0, 1000, 225).gridLayout(); + + QCOMPARE(grid.majorSpacingHz, 100); + QCOMPARE(grid.firstMajorDivisionOffset, 0.75); + QCOMPARE(grid.verticalGridOffsetPixels, 25); + QCOMPARE(grid.labels[0], QStringLiteral("300")); + QCOMPARE(grid.labels[1], QStringLiteral("400")); + QCOMPARE(grid.labels.last(), QStringLiteral("1300")); +} + +void TestWaterfallScale::divisionCountsIgnoreTinyFloatingPointOvershoot () +{ + auto scale = scaleWith(3000.025, 1); + QCOMPARE(scale.gridLayout().majorSpacingHz, 500); + QCOMPARE(scale.gridLayout().scaleDivisionCount, 6); + QCOMPARE(scale.gridLayout().overlayDivisionCount, 7); + + scale.setFftBinWidthHz(3000.1); + QCOMPARE(scale.gridLayout().scaleDivisionCount, 7); + QCOMPARE(scale.gridLayout().overlayDivisionCount, 8); +} + +void TestWaterfallScale::majorTickPositionsUseFullPrecision () +{ + WaterfallScale scale; + scale.setWidth(1181); + scale.setStartHz(4349); + scale.setBinsPerPixel(213); + scale.setFftBinWidthHz(1500.0 / 12288.0); + auto const grid = scale.gridLayout(); + + QCOMPARE(grid.majorSpacingHz, 500); + QCOMPARE(grid.firstMajorDivisionOffset, 151.0 / 500.0); + QCOMPARE(int((grid.firstMajorDivisionOffset + 53) + * grid.pixelsPerDivision), 1024); +} + +void TestWaterfallScale::twoHundredHertzDivisionsUseFourMinorTicks () +{ + auto const grid = scaleWith(1.5, 1000).gridLayout(); + + QCOMPARE(grid.majorSpacingHz, 200); + QCOMPARE(grid.minorDivisionCount, 4); + QCOMPARE(grid.overlayDivisionCount, 9); + QCOMPARE(grid.scaleDivisionCount, 8); +} + +QTEST_APPLESS_MAIN (TestWaterfallScale) + +#include "test_waterfall_scale.moc" diff --git a/tests/unit/common/test_wf_palette.cpp b/tests/unit/common/test_wf_palette.cpp new file mode 100644 index 00000000..2e652a30 --- /dev/null +++ b/tests/unit/common/test_wf_palette.cpp @@ -0,0 +1,113 @@ +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "WFPalette.hpp" + +class TestWFPalette + : public QObject +{ + Q_OBJECT + +private: + QString write_palette (QString const& body) + { + QTemporaryFile file; + file.setAutoRemove (false); + if (!file.open ()) + { + throw std::runtime_error {"failed to open temporary palette file"}; + } + + QTextStream out {&file}; + out << body; + out.flush (); + if (out.status () != QTextStream::Ok) + { + throw std::runtime_error {"failed to write temporary palette file"}; + } + + auto const name = file.fileName (); + file.close (); + return name; + } + + QString palette_body (int lines) + { + QString body; + QTextStream out {&body}; + for (int i {0}; i < lines; ++i) + { + out << i % 256 << ';' << (i + 1) % 256 << ';' << (i + 2) % 256 << '\n'; + } + return body; + } + + void remove_file (QString const& file_name) + { + QVERIFY (QFile::remove (file_name)); + } + +private Q_SLOTS: + void constructor_accepts_256_colour_palette () + { + auto const file_name = write_palette (palette_body (256)); + + WFPalette palette {file_name}; + + QCOMPARE (palette.colours ().size (), 256); + QCOMPARE (palette.colours ().front (), QColor (0, 1, 2)); + QCOMPARE (palette.colours ().back (), QColor (255, 0, 1)); + QCOMPARE (palette.interpolate ().size (), 256); + + remove_file (file_name); + } + + void constructor_rejects_257_colour_palette () + { + auto const file_name = write_palette (palette_body (257)); + + QVERIFY_EXCEPTION_THROWN (WFPalette {file_name}, std::runtime_error); + + remove_file (file_name); + } + + void constructor_rejects_invalid_triplet () + { + auto const file_name = write_palette ("0;1\n"); + + QVERIFY_EXCEPTION_THROWN (WFPalette {file_name}, std::runtime_error); + + remove_file (file_name); + } + + void constructor_rejects_invalid_colour_component () + { + auto const file_name = write_palette ("0;1;256\n"); + + QVERIFY_EXCEPTION_THROWN (WFPalette {file_name}, std::runtime_error); + + remove_file (file_name); + } + + void constructor_rejects_missing_file () + { + auto const file_name = QDir::temp ().absoluteFilePath ( + QUuid::createUuid ().toString (QUuid::WithoutBraces) + ".pal"); + QVERIFY (!QFile::exists (file_name)); + + QVERIFY_EXCEPTION_THROWN (WFPalette {file_name}, std::runtime_error); + } +}; + +QTEST_MAIN (TestWFPalette); + +#include "test_wf_palette.moc" diff --git a/tests/unit/decoder_ipc/CMakeLists.txt b/tests/unit/decoder_ipc/CMakeLists.txt new file mode 100644 index 00000000..0d8c0083 --- /dev/null +++ b/tests/unit/decoder_ipc/CMakeLists.txt @@ -0,0 +1,42 @@ +if (APPLE) + add_library (test_decoder_ipc_fortran_probe STATIC decoder_ipc_fortran_probe.f90) + target_include_directories (test_decoder_ipc_fortran_probe PRIVATE ${CMAKE_SOURCE_DIR}/lib) + set (decoder_ipc_fortran_probe_sources) +else () + set (decoder_ipc_fortran_probe_sources decoder_ipc_fortran_probe.f90) +endif () + +add_executable (test_decoder_ipc_protocol + test_decoder_ipc_protocol.cpp + ${decoder_ipc_fortran_probe_sources} + ${CMAKE_SOURCE_DIR}/DecoderIpc.cpp + ${CMAKE_SOURCE_DIR}/lib/decoder_ipc_control.cpp +) +set_target_properties (test_decoder_ipc_protocol PROPERTIES LINKER_LANGUAGE CXX) +target_include_directories (test_decoder_ipc_protocol PRIVATE ${CMAKE_SOURCE_DIR}/lib) +if (APPLE) + target_link_libraries (test_decoder_ipc_protocol Qt5::Test test_decoder_ipc_fortran_probe) +else () + target_link_libraries (test_decoder_ipc_protocol Qt5::Test) +endif () +add_test (NAME test_decoder_ipc_protocol COMMAND test_decoder_ipc_protocol) + +add_executable (test_decoder_output_framer + test_decoder_output_framer.cpp + ${CMAKE_SOURCE_DIR}/DecoderOutputFramer.cpp + ${CMAKE_SOURCE_DIR}/DecoderIpc.cpp + ${CMAKE_SOURCE_DIR}/lib/decoder_ipc_control.cpp +) +target_include_directories (test_decoder_output_framer PRIVATE + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/lib +) +target_link_libraries (test_decoder_output_framer Qt5::Test) +add_test (NAME test_decoder_output_framer COMMAND test_decoder_output_framer) + +add_executable (test_decode_operating_context + test_decode_operating_context.cpp +) +target_include_directories (test_decode_operating_context PRIVATE ${CMAKE_SOURCE_DIR}) +target_link_libraries (test_decode_operating_context Qt5::Test) +add_test (NAME test_decode_operating_context COMMAND test_decode_operating_context) diff --git a/tests/unit/decoder_ipc/decoder_ipc_fortran_probe.f90 b/tests/unit/decoder_ipc/decoder_ipc_fortran_probe.f90 new file mode 100644 index 00000000..c1304ee7 --- /dev/null +++ b/tests/unit/decoder_ipc/decoder_ipc_fortran_probe.f90 @@ -0,0 +1,23 @@ +subroutine decoder_ipc_fortran_probe(address, values) bind(C) + use, intrinsic :: iso_c_binding, only: c_ptr, c_f_pointer, c_int, c_sizeof + include 'jt9com.f90' + + type(c_ptr), value :: address + integer(c_int), intent(out) :: values(10) + type(shared_dec_data), pointer :: shared + + call c_f_pointer(address, shared) + values(1) = c_sizeof(shared%control) + values(2) = c_sizeof(shared%payload%params) + values(3) = c_sizeof(shared%payload) + values(4) = c_sizeof(shared) + values(5) = DECODER_IPC_VERSION + values(6) = DECODER_IPC_IDLE + values(7) = DECODER_IPC_READY + values(8) = DECODER_IPC_DECODING + values(9) = DECODER_IPC_COMPLETE + values(10) = DECODER_IPC_SHUTDOWN + + shared%control%generation = shared%control%generation + 1 + shared%payload%id2(1) = 1234 +end subroutine decoder_ipc_fortran_probe diff --git a/tests/unit/decoder_ipc/test_decode_operating_context.cpp b/tests/unit/decoder_ipc/test_decode_operating_context.cpp new file mode 100644 index 00000000..0380434d --- /dev/null +++ b/tests/unit/decoder_ipc/test_decode_operating_context.cpp @@ -0,0 +1,152 @@ +#include + +#include "DecodeOperatingContext.hpp" + +class TestDecodeOperatingContext final : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void identityMatchesEquivalentContext (); + void sequenceStartIsAttributionOnly (); + void identityChangeMakesContextObsolete_data (); + void identityChangeMakesContextObsolete (); + void ft8PendingIdentityChangeMakesSnapshotObsolete_data (); + void ft8PendingIdentityChangeMakesSnapshotObsolete (); + void ft8PendingIdentityRejectsOtherModes (); +}; + +namespace +{ + DecodeOperatingContext context () + { + DecodeOperatingContext result; + result.mode = "FT8"; + result.specOp = SpecialOperatingActivity::NONE; + result.periodFrequency = 14074000; + result.band = "20m"; + result.sequenceStart = QDateTime::fromString ("2026-07-26T12:00:00Z", Qt::ISODate); + result.trPeriod = 15.0; + result.submode = 0; + result.diskData = false; + result.multithreadFt8 = true; + result.ft8DecoderStart = 1; + result.ft8ThreadCount = 4; + result.decodeDepth = 3; + result.ft8Cycles = 3; + result.ft8Sensitivity = 3; + result.ft8RxFrequencySensitivity = 3; + result.decodeLowFrequency = 200; + result.decodeHighFrequency = 3000; + result.ft8WideDxCallSearch = true; + result.hideFt8DuplicateMessages = true; + result.ft8ApEnabled = true; + result.superFox = false; + result.myCall = "K1ABC"; + return result; + } +} + +void TestDecodeOperatingContext::identityMatchesEquivalentContext () +{ + auto const captured = context (); + QVERIFY (captured.hasSameDecodeIdentity (context ())); +} + +void TestDecodeOperatingContext::sequenceStartIsAttributionOnly () +{ + auto captured = context (); + auto current = context (); + current.sequenceStart = current.sequenceStart.addSecs (15); + + QVERIFY (captured.hasSameDecodeIdentity (current)); +} + +void TestDecodeOperatingContext::identityChangeMakesContextObsolete_data () +{ + QTest::addColumn ("field"); + QTest::newRow ("mode") << QString {"mode"}; + QTest::newRow ("special operation") << QString {"special operation"}; + QTest::newRow ("frequency") << QString {"frequency"}; + QTest::newRow ("band") << QString {"band"}; + QTest::newRow ("TR period") << QString {"TR period"}; + QTest::newRow ("submode") << QString {"submode"}; + QTest::newRow ("disk data") << QString {"disk data"}; + QTest::newRow ("multithread FT8") << QString {"multithread FT8"}; + QTest::newRow ("FT8 start") << QString {"FT8 start"}; + QTest::newRow ("SuperFox") << QString {"SuperFox"}; + QTest::newRow ("callsign") << QString {"callsign"}; +} + +void TestDecodeOperatingContext::identityChangeMakesContextObsolete () +{ + QFETCH (QString, field); + auto captured = context (); + auto current = context (); + + if (field == "mode") current.mode = "FT4"; + else if (field == "special operation") current.specOp = SpecialOperatingActivity::HOUND; + else if (field == "frequency") ++current.periodFrequency; + else if (field == "band") current.band = "17m"; + else if (field == "TR period") current.trPeriod = 30.0; + else if (field == "submode") ++current.submode; + else if (field == "disk data") current.diskData = true; + else if (field == "multithread FT8") current.multithreadFt8 = false; + else if (field == "FT8 start") ++current.ft8DecoderStart; + else if (field == "SuperFox") current.superFox = true; + else if (field == "callsign") current.myCall = "K1XYZ"; + + QVERIFY (!captured.hasSameDecodeIdentity (current)); +} + +void TestDecodeOperatingContext::ft8PendingIdentityChangeMakesSnapshotObsolete_data () +{ + QTest::addColumn ("field"); + QTest::newRow ("FT8 threads") << QString {"FT8 threads"}; + QTest::newRow ("decode depth") << QString {"decode depth"}; + QTest::newRow ("FT8 cycles") << QString {"FT8 cycles"}; + QTest::newRow ("FT8 sensitivity") << QString {"FT8 sensitivity"}; + QTest::newRow ("FT8 RX sensitivity") << QString {"FT8 RX sensitivity"}; + QTest::newRow ("decode low frequency") << QString {"decode low frequency"}; + QTest::newRow ("decode high frequency") << QString {"decode high frequency"}; + QTest::newRow ("FT8 wide DX search") << QString {"FT8 wide DX search"}; + QTest::newRow ("hide FT8 duplicates") << QString {"hide FT8 duplicates"}; + QTest::newRow ("FT8 AP") << QString {"FT8 AP"}; +} + +void TestDecodeOperatingContext::ft8PendingIdentityChangeMakesSnapshotObsolete () +{ + QFETCH (QString, field); + auto captured = context (); + auto current = context (); + + if (field == "FT8 threads") ++current.ft8ThreadCount; + else if (field == "decode depth") ++current.decodeDepth; + else if (field == "FT8 cycles") ++current.ft8Cycles; + else if (field == "FT8 sensitivity") ++current.ft8Sensitivity; + else if (field == "FT8 RX sensitivity") ++current.ft8RxFrequencySensitivity; + else if (field == "decode low frequency") ++current.decodeLowFrequency; + else if (field == "decode high frequency") ++current.decodeHighFrequency; + else if (field == "FT8 wide DX search") current.ft8WideDxCallSearch = false; + else if (field == "hide FT8 duplicates") current.hideFt8DuplicateMessages = false; + else if (field == "FT8 AP") current.ft8ApEnabled = false; + + QVERIFY (captured.hasSameDecodeIdentity (current)); + QVERIFY (!captured.hasSameFt8PendingIdentity (current)); +} + +void TestDecodeOperatingContext::ft8PendingIdentityRejectsOtherModes () +{ + auto captured = context (); + auto current = context (); + captured.mode = "Q65"; + current.mode = "Q65"; + ++current.ft8ThreadCount; + + QVERIFY (captured.hasSameDecodeIdentity (current)); + QVERIFY (!captured.hasSameFt8PendingIdentity (current)); +} + +QTEST_GUILESS_MAIN (TestDecodeOperatingContext) + +#include "test_decode_operating_context.moc" diff --git a/tests/unit/decoder_ipc/test_decoder_ipc_protocol.cpp b/tests/unit/decoder_ipc/test_decoder_ipc_protocol.cpp new file mode 100644 index 00000000..85a414fa --- /dev/null +++ b/tests/unit/decoder_ipc/test_decoder_ipc_protocol.cpp @@ -0,0 +1,396 @@ +#include + +#include +#include +#include +#include +#include + +#include "DecoderIpc.hpp" +#include "lib/decoder_ipc_control.h" + +extern "C" +{ + void decoder_ipc_fortran_probe (void *, int[10]); +} + +class TestDecoderIpcProtocol final : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void layoutMatchesFortran (); + void sharedMemorySizeAllowsPlatformRounding (); + void publicationAndClaimValidateControl (); + void compactFt8MtdPublicationCopiesRequiredPayload (); + void compactFt8MtdPublicationRejectsInvalidRequests (); + void transitionsRequireMatchingGeneration (); + void sharedProgressTracksActiveGeneration (); + void delayedCompletionCannotClobberNextRequest (); + void compatibleShutdownReleasesWorkers (); + void shutdownReplacesAnyState_data (); + void shutdownReplacesAnyState (); + void generationWrapsWithoutUsingZero (); + void startMarkerParsing (); + void startMarkerRejections_data (); + void startMarkerRejections (); + void completionMarkerParsing (); + void completionMarkerRejections_data (); + void completionMarkerRejections (); +}; + +void TestDecoderIpcProtocol::layoutMatchesFortran () +{ + struct CompatibleSharedData + { + int ipc[4]; + dec_data_t payload; + }; + + QCOMPARE (sizeof (decoder_ipc_control_t), size_t {16}); + QCOMPARE (offsetof (decoder_ipc_control_t, state), size_t {4}); + QCOMPARE (offsetof (shared_dec_data_t, payload), size_t {16}); + QCOMPARE (sizeof (shared_dec_data_t), + sizeof (decoder_ipc_control_t) + sizeof (dec_data_t)); + QCOMPARE (sizeof (shared_dec_data_t), sizeof (CompatibleSharedData)); + QCOMPARE (offsetof (CompatibleSharedData, ipc) + sizeof (int), + offsetof (decoder_ipc_control_t, state)); + QCOMPARE (offsetof (CompatibleSharedData, payload), + offsetof (shared_dec_data_t, payload)); + + std::unique_ptr shared {new shared_dec_data_t}; + shared->control.generation = 41; + int values[10] {}; + decoder_ipc_fortran_probe (shared.get (), values); + + QCOMPARE (values[0], static_cast (sizeof (decoder_ipc_control_t))); + QCOMPARE (values[1], static_cast (sizeof (decoder_params_t))); + QCOMPARE (values[2], static_cast (sizeof (dec_data_t))); + QCOMPARE (values[3], static_cast (sizeof (shared_dec_data_t))); + QCOMPARE (values[4], int {DECODER_IPC_VERSION}); + QCOMPARE (values[5], int {DECODER_IPC_IDLE}); + QCOMPARE (values[6], int {DECODER_IPC_READY}); + QCOMPARE (values[7], int {DECODER_IPC_DECODING}); + QCOMPARE (values[8], int {DECODER_IPC_COMPLETE}); + QCOMPARE (values[9], int {DECODER_IPC_SHUTDOWN}); + QCOMPARE (shared->control.generation, 42); + QCOMPARE (shared->payload.d2[0], short {1234}); +} + +void TestDecoderIpcProtocol::sharedMemorySizeAllowsPlatformRounding () +{ + auto const required = static_cast (sizeof (shared_dec_data_t)); + auto const shutdownRequired = static_cast ( + offsetof (decoder_ipc_control_t, progress)); + QVERIFY (!DecoderIpc::hasShutdownControlSize (shutdownRequired - 1)); + QVERIFY (DecoderIpc::hasShutdownControlSize (shutdownRequired)); + QVERIFY (!DecoderIpc::hasUsableSize (required - 1)); + QVERIFY (DecoderIpc::hasUsableSize (required)); + QVERIFY (DecoderIpc::hasUsableSize (required + 80)); + + int compatibleControl[3] {17, DECODER_IPC_DECODING, 0}; + DecoderIpc::shutdownControl (compatibleControl); + QCOMPARE (compatibleControl[0], 17); + QCOMPARE (compatibleControl[1], int {DECODER_IPC_SHUTDOWN}); + QCOMPARE (compatibleControl[2], 1); +} + +void TestDecoderIpcProtocol::publicationAndClaimValidateControl () +{ + std::unique_ptr shared {new shared_dec_data_t}; + std::unique_ptr payload {new dec_data_t {}}; + DecoderIpc::initialize (*shared); + + QVERIFY (!DecoderIpc::publish (*shared, *payload, false, 0)); + QCOMPARE (shared->control.state, int {DECODER_IPC_IDLE}); + + shared->control.version = DECODER_IPC_VERSION + 1; + QVERIFY (!DecoderIpc::publish (*shared, *payload, false, 1)); + QCOMPARE (shared->control.state, int {DECODER_IPC_IDLE}); + + shared->control.version = DECODER_IPC_VERSION; + shared->control.generation = 0; + shared->control.state = DECODER_IPC_READY; + qint32 generation {0}; + QVERIFY (!DecoderIpc::claim (*shared, generation)); + QCOMPARE (shared->control.state, int {DECODER_IPC_READY}); +} + +void TestDecoderIpcProtocol::compactFt8MtdPublicationCopiesRequiredPayload () +{ + std::unique_ptr shared {new shared_dec_data_t}; + std::unique_ptr payload {new DecoderIpc::Ft8MtdPayload}; + DecoderIpc::initialize (*shared); + shared->payload.ss[0] = 3.5F; + shared->payload.savg[0] = 4.5F; + shared->payload.sred[0] = 5.5F; + shared->payload.d2[DecoderIpc::Ft8SampleCount] = 61; + shared->payload.d2[NTMAX * RX_SAMPLE_RATE - 1] = 62; + payload->params.nmode = 8; + payload->params.lmultift8 = true; + payload->params.nutc = 123456; + payload->samples.front () = 17; + payload->samples.back () = 29; + + QVERIFY (DecoderIpc::publishFt8Mtd (*shared, *payload, 7)); + + QCOMPARE (shared->control.state, int {DECODER_IPC_READY}); + QCOMPARE (shared->control.generation, 7); + QCOMPARE (shared->payload.params.nutc, 123456); + QCOMPARE (shared->payload.d2[0], short {17}); + QCOMPARE (shared->payload.d2[DecoderIpc::Ft8SampleCount - 1], short {29}); + QCOMPARE (shared->payload.d2[DecoderIpc::Ft8SampleCount], short {61}); + QCOMPARE (shared->payload.d2[NTMAX * RX_SAMPLE_RATE - 1], short {62}); + QCOMPARE (shared->payload.ss[0], 3.5F); + QCOMPARE (shared->payload.savg[0], 4.5F); + QCOMPARE (shared->payload.sred[0], 5.5F); +} + +void TestDecoderIpcProtocol::compactFt8MtdPublicationRejectsInvalidRequests () +{ + std::unique_ptr shared {new shared_dec_data_t}; + std::unique_ptr payload {new DecoderIpc::Ft8MtdPayload}; + DecoderIpc::initialize (*shared); + shared->payload.params.nutc = 111111; + shared->payload.d2[0] = 11; + payload->params.nmode = 9; + payload->params.lmultift8 = true; + payload->params.nutc = 222222; + payload->samples[0] = 22; + + QVERIFY (!DecoderIpc::publishFt8Mtd (*shared, *payload, 1)); + QCOMPARE (shared->control.state, int {DECODER_IPC_IDLE}); + QCOMPARE (shared->payload.params.nutc, 111111); + QCOMPARE (shared->payload.d2[0], short {11}); + + payload->params.nmode = 8; + payload->params.lmultift8 = false; + QVERIFY (!DecoderIpc::publishFt8Mtd (*shared, *payload, 1)); + QCOMPARE (shared->control.state, int {DECODER_IPC_IDLE}); + QCOMPARE (shared->payload.params.nutc, 111111); + QCOMPARE (shared->payload.d2[0], short {11}); + + payload->params.lmultift8 = true; + QVERIFY (!DecoderIpc::publishFt8Mtd (*shared, *payload, 0)); + shared->control.version = DECODER_IPC_VERSION + 1; + QVERIFY (!DecoderIpc::publishFt8Mtd (*shared, *payload, 1)); + shared->control.version = DECODER_IPC_VERSION; + QVERIFY (DecoderIpc::publishFt8Mtd (*shared, *payload, 1)); + payload->params.nutc = 333333; + payload->samples[0] = 33; + QVERIFY (!DecoderIpc::publishFt8Mtd (*shared, *payload, 2)); + QCOMPARE (shared->payload.params.nutc, 222222); + QCOMPARE (shared->payload.d2[0], short {22}); + + qint32 generation {0}; + QVERIFY (DecoderIpc::claim (*shared, generation)); + QVERIFY (!DecoderIpc::publishFt8Mtd (*shared, *payload, 2)); + QCOMPARE (shared->payload.params.nutc, 222222); + QCOMPARE (shared->payload.d2[0], short {22}); +} + +void TestDecoderIpcProtocol::transitionsRequireMatchingGeneration () +{ + std::unique_ptr shared {new shared_dec_data_t}; + std::unique_ptr payload {new dec_data_t {}}; + DecoderIpc::initialize (*shared); + payload->params.nutc = 123456; + payload->d2[0] = 17; + + QVERIFY (DecoderIpc::publish (*shared, *payload, true, 7)); + QCOMPARE (shared->control.state, int {DECODER_IPC_READY}); + QCOMPARE (shared->control.generation, 7); + QCOMPARE (shared->payload.params.nutc, 123456); + QCOMPARE (shared->payload.d2[0], short {17}); + + payload->params.nutc = 654321; + payload->d2[0] = 99; + QVERIFY (!DecoderIpc::publish (*shared, *payload, true, 8)); + QCOMPARE (shared->payload.params.nutc, 123456); + QCOMPARE (shared->payload.d2[0], short {17}); + + qint32 claimed {0}; + QVERIFY (DecoderIpc::claim (*shared, claimed)); + QCOMPARE (claimed, qint32 {7}); + QVERIFY (!DecoderIpc::publish (*shared, *payload, true, 8)); + QCOMPARE (shared->payload.params.nutc, 123456); + QCOMPARE (shared->payload.d2[0], short {17}); + QVERIFY (!DecoderIpc::consume (*shared, 6)); + QCOMPARE (shared->control.state, int {DECODER_IPC_DECODING}); + QVERIFY (!DecoderIpc::consume (*shared, 7)); + QCOMPARE (shared->control.state, int {DECODER_IPC_DECODING}); + QVERIFY (DecoderIpc::finish (*shared, 7)); + QVERIFY (DecoderIpc::consume (*shared, 7)); + QCOMPARE (shared->control.state, int {DECODER_IPC_IDLE}); + QVERIFY (!DecoderIpc::consume (*shared, 7)); + + QVERIFY (DecoderIpc::publish (*shared, *payload, false, 8)); + QCOMPARE (shared->payload.params.nutc, 654321); + QCOMPARE (shared->control.generation, 8); + QCOMPARE (shared->payload.d2[0], short {17}); + QVERIFY (!DecoderIpc::consume (*shared, 8)); + DecoderIpc::shutdown (*shared); +} + +void TestDecoderIpcProtocol::sharedProgressTracksActiveGeneration () +{ + std::unique_ptr shared {new shared_dec_data_t}; + std::unique_ptr payload {new dec_data_t {}}; + DecoderIpc::initialize (*shared); + + QVERIFY (DecoderIpc::publish (*shared, *payload, false, 7)); + qint32 claimed {0}; + QVERIFY (DecoderIpc::claim (*shared, claimed)); + QCOMPARE (DecoderIpc::progress (*shared), qint32 {0}); + + decoder_ipc_progress_bind (&shared->control.generation, + &shared->control.state, + &shared->control.version, + &shared->control.progress); + decoder_ipc_progress_report (6); + QCOMPARE (DecoderIpc::progress (*shared), qint32 {0}); + std::vector workers; + for (int worker = 0; worker < 4; ++worker) + { + workers.emplace_back ([] { + for (int report = 0; report < 1000; ++report) + { + decoder_ipc_progress_report (7); + } + }); + } + for (auto& worker: workers) worker.join (); + QCOMPARE (DecoderIpc::progress (*shared), qint32 {4000}); + + QVERIFY (DecoderIpc::finish (*shared, 7)); + decoder_ipc_progress_report (7); + QCOMPARE (DecoderIpc::progress (*shared), qint32 {4000}); + QVERIFY (DecoderIpc::consume (*shared, 7)); + QVERIFY (DecoderIpc::publish (*shared, *payload, false, 8)); + QCOMPARE (DecoderIpc::progress (*shared), qint32 {0}); + + decoder_ipc_progress_unbind (); + decoder_ipc_progress_report (8); + QCOMPARE (DecoderIpc::progress (*shared), qint32 {0}); +} + +void TestDecoderIpcProtocol::delayedCompletionCannotClobberNextRequest () +{ + std::unique_ptr shared {new shared_dec_data_t}; + std::unique_ptr payload {new dec_data_t}; + DecoderIpc::initialize (*shared); + payload->params = {}; + + QVERIFY (DecoderIpc::publish (*shared, *payload, false, 10)); + qint32 claimed {0}; + QVERIFY (DecoderIpc::claim (*shared, claimed)); + QVERIFY (DecoderIpc::finish (*shared, 10)); + QVERIFY (DecoderIpc::consume (*shared, 10)); + QVERIFY (DecoderIpc::publish (*shared, *payload, false, 11)); + + QVERIFY (!DecoderIpc::finish (*shared, 10)); + QCOMPARE (shared->control.generation, 11); + QCOMPARE (shared->control.state, int {DECODER_IPC_READY}); + + DecoderIpc::shutdown (*shared); + QCOMPARE (shared->control.state, int {DECODER_IPC_SHUTDOWN}); +} + +void TestDecoderIpcProtocol::compatibleShutdownReleasesWorkers () +{ + decoder_ipc_control_t control {17, 0, DECODER_IPC_VERSION, 4}; + DecoderIpc::shutdown (control); + + QCOMPARE (control.generation, 17); + QCOMPARE (control.state, int {DECODER_IPC_SHUTDOWN}); + QCOMPARE (control.version, 1); + QCOMPARE (control.progress, 4); +} + +void TestDecoderIpcProtocol::shutdownReplacesAnyState_data () +{ + QTest::addColumn ("state"); + QTest::newRow ("idle") << int {DECODER_IPC_IDLE}; + QTest::newRow ("ready") << int {DECODER_IPC_READY}; + QTest::newRow ("decoding") << int {DECODER_IPC_DECODING}; + QTest::newRow ("complete") << int {DECODER_IPC_COMPLETE}; +} + +void TestDecoderIpcProtocol::shutdownReplacesAnyState () +{ + QFETCH (int, state); + decoder_ipc_control_t control {17, state, DECODER_IPC_VERSION, 0}; + + DecoderIpc::shutdown (control); + + QCOMPARE (control.generation, 17); + QCOMPARE (control.state, int {DECODER_IPC_SHUTDOWN}); + QCOMPARE (control.version, 1); +} + +void TestDecoderIpcProtocol::generationWrapsWithoutUsingZero () +{ + QCOMPARE (DecoderIpc::nextGeneration (0), qint32 {1}); + QCOMPARE (DecoderIpc::nextGeneration (-1), qint32 {1}); + QCOMPARE (DecoderIpc::nextGeneration (41), qint32 {42}); + QCOMPARE (DecoderIpc::nextGeneration (std::numeric_limits::max ()), qint32 {1}); +} + +void TestDecoderIpcProtocol::startMarkerParsing () +{ + qint32 generation {0}; + QVERIFY (DecoderIpc::parseStart (" gen=42\r\n", &generation)); + QCOMPARE (generation, qint32 {42}); +} + +void TestDecoderIpcProtocol::startMarkerRejections_data () +{ + QTest::addColumn ("line"); + QTest::newRow ("embedded") << QByteArray {"noise gen=42"}; + QTest::newRow ("missing generation") << QByteArray {""}; + QTest::newRow ("zero generation") << QByteArray {" gen=0"}; + QTest::newRow ("negative generation") << QByteArray {" gen=-1"}; + QTest::newRow ("overflow generation") << QByteArray {" gen=2147483648"}; + QTest::newRow ("trailing garbage") << QByteArray {" gen=42 extra"}; +} + +void TestDecoderIpcProtocol::startMarkerRejections () +{ + QFETCH (QByteArray, line); + qint32 generation {0}; + QVERIFY (!DecoderIpc::parseStart (line, &generation)); +} + +void TestDecoderIpcProtocol::completionMarkerParsing () +{ + DecoderIpc::Completion completion {}; + QVERIFY (DecoderIpc::parseCompletion ( + " 2 17 123456 gen=42\r\n", &completion)); + QCOMPARE (completion.synchronized, qint32 {2}); + QCOMPARE (completion.decoded, qint32 {17}); + QCOMPARE (completion.average, qint32 {123456}); + QCOMPARE (completion.generation, qint32 {42}); +} + +void TestDecoderIpcProtocol::completionMarkerRejections_data () +{ + QTest::addColumn ("line"); + QTest::newRow ("embedded") << QByteArray {"noise 2 17 123456 gen=42"}; + QTest::newRow ("legacy") << QByteArray {" 2 17 123456"}; + QTest::newRow ("zero generation") << QByteArray {" 2 17 123456 gen=0"}; + QTest::newRow ("negative generation") << QByteArray {" 2 17 123456 gen=-1"}; + QTest::newRow ("overflow generation") << QByteArray {" 2 17 123456 gen=2147483648"}; + QTest::newRow ("overflow field") << QByteArray {"**** 17 123456 gen=42"}; + QTest::newRow ("trailing garbage") << QByteArray {" 2 17 123456 gen=42 extra"}; +} + +void TestDecoderIpcProtocol::completionMarkerRejections () +{ + QFETCH (QByteArray, line); + DecoderIpc::Completion completion {}; + QVERIFY (!DecoderIpc::parseCompletion (line, &completion)); +} + +QTEST_GUILESS_MAIN (TestDecoderIpcProtocol) + +#include "test_decoder_ipc_protocol.moc" diff --git a/tests/unit/decoder_ipc/test_decoder_output_framer.cpp b/tests/unit/decoder_ipc/test_decoder_output_framer.cpp new file mode 100644 index 00000000..5fbb2698 --- /dev/null +++ b/tests/unit/decoder_ipc/test_decoder_output_framer.cpp @@ -0,0 +1,281 @@ +#include + +#include +#include +#include +#include +#include + +#include +#include + +#ifdef Q_OS_WIN +#include +#include +#endif + +#include "DecoderOutputFramer.hpp" + +namespace +{ + char const fixtureOption[] = "--decoder-output-fixture"; + + int runFixture (QStringList const& arguments) + { + if (arguments.size () < 3) return 2; + + auto const payload = QByteArray::fromBase64 (arguments[2].toLatin1 ()); +#ifdef Q_OS_WIN + if (-1 == _setmode (_fileno (stdout), _O_BINARY)) return 3; +#endif + QFile output; + if (!output.open (stdout, QIODevice::WriteOnly, QFileDevice::DontCloseHandle)) + { + return 4; + } + if (output.write (payload) != payload.size () || !output.flush ()) return 5; + return arguments.contains ("--hold") ? QCoreApplication::exec () : 0; + } +} + +class TestDecoderOutputFramer final : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void rejectedRecordDoesNotStopDrain (); + void staleFramesRemainAssociatedWithTheirGeneration (); + void completeStateWaitsForStdoutDrain (); + void recordTerminatorsArePreserved (); + void malformedFramesAreReported (); + void killedFrameCanBeReplaced (); +}; + +void TestDecoderOutputFramer::rejectedRecordDoesNotStopDrain () +{ + QByteArray const output { + " gen=7\n" + "record rejected by policy\n" + " 2 17 123456 gen=7\n"}; + DecoderOutputFramer framer; + int started {0}; + int records {0}; + int finished {0}; + DecoderOutputFramer::EventHandler handler { + [&] (DecoderOutputFramer::Event const& event) { + if (DecoderOutputFramer::EventType::Started == event.type) ++started; + if (DecoderOutputFramer::EventType::Record == event.type) + { + ++records; + return; + } + if (DecoderOutputFramer::EventType::Finished == event.type) ++finished; + }}; + + QProcess process; + connect (&process, &QProcess::readyReadStandardOutput, this, [&] { + framer.drain (process, handler); + }); + process.start (QCoreApplication::applicationFilePath (), + {fixtureOption, QString::fromLatin1 (output.toBase64 ())}); + QVERIFY (process.waitForStarted ()); + QVERIFY (process.waitForFinished ()); + framer.drain (process, handler); + + QCOMPARE (started, 1); + QCOMPARE (records, 1); + QCOMPARE (finished, 1); + QCOMPARE (framer.currentGeneration (), qint32 {0}); +} + +void TestDecoderOutputFramer::staleFramesRemainAssociatedWithTheirGeneration () +{ + QByteArray const output { + " gen=7\n" + "stale record\n" + " 0 0 0 gen=7\n" + " gen=8\n" + "current record\n" + " 0 1 0 gen=8\n"}; + DecoderOutputFramer framer; + QVector recordGenerations; + QVector acceptedRecords; + QVector finishedGenerations; + qint32 const activeGeneration {8}; + DecoderOutputFramer::EventHandler handler { + [&] (DecoderOutputFramer::Event const& event) { + if (DecoderOutputFramer::EventType::Record == event.type) + { + recordGenerations.append (event.generation); + if (activeGeneration == event.generation) + { + acceptedRecords.append (event.rawLine); + } + } + else if (DecoderOutputFramer::EventType::Finished == event.type) + { + finishedGenerations.append (event.generation); + } + }}; + + QProcess process; + process.start (QCoreApplication::applicationFilePath (), + {fixtureOption, QString::fromLatin1 (output.toBase64 ())}); + QVERIFY (process.waitForStarted ()); + QVERIFY (process.waitForFinished ()); + framer.drain (process, handler); + + QCOMPARE (recordGenerations, QVector ({7, 8})); + QCOMPARE (acceptedRecords, QVector ({"current record\n"})); + QCOMPARE (finishedGenerations, QVector ({7, 8})); +} + +void TestDecoderOutputFramer::completeStateWaitsForStdoutDrain () +{ + std::unique_ptr shared {new shared_dec_data_t}; + std::unique_ptr payload {new dec_data_t {}}; + DecoderIpc::initialize (*shared); + QVERIFY (DecoderIpc::publish (*shared, *payload, false, 21)); + qint32 generation {0}; + QVERIFY (DecoderIpc::claim (*shared, generation)); + QVERIFY (DecoderIpc::finish (*shared, generation)); + + QByteArray output { + " gen=21\n" + "buffered record\n" + " 0 1 0 gen=21\n"}; + QBuffer buffer {&output}; + QVERIFY (buffer.open (QIODevice::ReadOnly)); + QCOMPARE (DecoderIpc::state (*shared), qint32 {DECODER_IPC_COMPLETE}); + + DecoderOutputFramer framer; + int records {0}; + bool consumed {false}; + framer.drain (buffer, [&] (DecoderOutputFramer::Event const& event) { + if (DecoderOutputFramer::EventType::Record == event.type) ++records; + if (DecoderOutputFramer::EventType::Finished == event.type) + { + consumed = DecoderIpc::consume (*shared, event.generation); + } + }); + + QCOMPARE (records, 1); + QVERIFY (consumed); + QCOMPARE (DecoderIpc::state (*shared), qint32 {DECODER_IPC_IDLE}); +} + +void TestDecoderOutputFramer::recordTerminatorsArePreserved () +{ + QByteArray const output { + " gen=9\r\n" + "first record\r\n" + "second record\n" + " 0 2 0 gen=9\r\n"}; + DecoderOutputFramer framer; + QVector records; + + QProcess process; + process.start (QCoreApplication::applicationFilePath (), + {fixtureOption, QString::fromLatin1 (output.toBase64 ())}); + QVERIFY (process.waitForStarted ()); + QVERIFY (process.waitForFinished ()); + framer.drain (process, [&] (DecoderOutputFramer::Event const& event) { + if (DecoderOutputFramer::EventType::Record == event.type) + { + records.append (event.rawLine); + } + }); + + QCOMPARE (records, QVector ({"first record\r\n", + "second record\n"})); +} + +void TestDecoderOutputFramer::malformedFramesAreReported () +{ + QByteArray output { + "unframed record\n" + " gen=0\n" + " gen=14\n" + " 0 0 0 gen=15\n" + " 0 0 0 gen=14\n"}; + QBuffer buffer {&output}; + QVERIFY (buffer.open (QIODevice::ReadOnly)); + + DecoderOutputFramer framer; + QVector eventTypes; + framer.drain (buffer, [&] (DecoderOutputFramer::Event const& event) { + eventTypes.append (event.type); + }); + + QCOMPARE (eventTypes, QVector ({ + DecoderOutputFramer::EventType::Malformed, + DecoderOutputFramer::EventType::Malformed, + DecoderOutputFramer::EventType::Started, + DecoderOutputFramer::EventType::Malformed, + DecoderOutputFramer::EventType::Finished})); + QCOMPARE (framer.currentGeneration (), qint32 {0}); +} + +void TestDecoderOutputFramer::killedFrameCanBeReplaced () +{ + DecoderOutputFramer framer; + QVector events; + DecoderOutputFramer::EventHandler handler { + [&] (DecoderOutputFramer::Event const& event) {events.append (event);}}; + + QProcess abandoned; + connect (&abandoned, &QProcess::readyReadStandardOutput, this, [&] { + framer.drain (abandoned, handler); + }); + QByteArray const abandonedOutput { + " gen=11\n" + "abandoned record\n"}; + abandoned.start (QCoreApplication::applicationFilePath (), + {fixtureOption, + QString::fromLatin1 (abandonedOutput.toBase64 ()), + "--hold"}); + QVERIFY (abandoned.waitForStarted ()); + QVERIFY (abandoned.waitForReadyRead ()); + framer.drain (abandoned, handler); + QCOMPARE (framer.currentGeneration (), qint32 {11}); + + abandoned.kill (); + QTRY_COMPARE_WITH_TIMEOUT (abandoned.state (), QProcess::NotRunning, 2000); + framer.reset (); + events.clear (); + + QByteArray const replacementOutput { + " gen=12\n" + "replacement record\n" + " 0 1 0 gen=12\n"}; + QProcess replacement; + connect (&replacement, &QProcess::readyReadStandardOutput, this, [&] { + framer.drain (replacement, handler); + }); + replacement.start (QCoreApplication::applicationFilePath (), + {fixtureOption, + QString::fromLatin1 (replacementOutput.toBase64 ())}); + QVERIFY (replacement.waitForStarted ()); + QVERIFY (replacement.waitForFinished ()); + framer.drain (replacement, handler); + + QCOMPARE (events.size (), 3); + QCOMPARE (events[0].type, DecoderOutputFramer::EventType::Started); + QCOMPARE (events[0].generation, qint32 {12}); + QCOMPARE (events[1].type, DecoderOutputFramer::EventType::Record); + QCOMPARE (events[1].rawLine, QByteArray {"replacement record\n"}); + QCOMPARE (events[2].type, DecoderOutputFramer::EventType::Finished); + QCOMPARE (events[2].generation, qint32 {12}); +} + +int main (int argc, char ** argv) +{ + QCoreApplication application {argc, argv}; + auto const arguments = application.arguments (); + if (arguments.contains (fixtureOption)) return runFixture (arguments); + + TestDecoderOutputFramer test; + return QTest::qExec (&test, argc, argv); +} + +#include "test_decoder_output_framer.moc" diff --git a/tests/unit/echo/CMakeLists.txt b/tests/unit/echo/CMakeLists.txt new file mode 100644 index 00000000..e526c873 --- /dev/null +++ b/tests/unit/echo/CMakeLists.txt @@ -0,0 +1,16 @@ +add_executable (test_echo_morse test_echo_morse.f90) +wsjt_link_common_fortran (test_echo_morse) + +add_test (NAME test_echo_morse COMMAND test_echo_morse) + +add_executable (test_avecho_disk_metadata test_avecho_disk_metadata.f90) +wsjt_link_common_fortran (test_avecho_disk_metadata) + +add_test (NAME test_avecho_disk_metadata COMMAND test_avecho_disk_metadata) +set_tests_properties (test_avecho_disk_metadata PROPERTIES + PASS_REGULAR_EXPRESSION "Echo disk metadata test passed") + +add_executable (test_avecho_silence test_avecho_silence.f90) +wsjt_link_common_fortran (test_avecho_silence) + +add_test (NAME test_avecho_silence COMMAND test_avecho_silence) diff --git a/tests/unit/echo/test_avecho_disk_metadata.f90 b/tests/unit/echo/test_avecho_disk_metadata.f90 new file mode 100644 index 00000000..5885ae6b --- /dev/null +++ b/tests/unit/echo/test_avecho_disk_metadata.f90 @@ -0,0 +1,52 @@ +program test_avecho_disk_metadata + + implicit none + + integer, parameter :: ntx=6*4096 + integer*2 id2(ntx+4096) + integer*4 itone(6) + integer idir,nauto,navg,ndf,ndop,ndop_total,nfrit,nqual + integer nclearave,nsum + real db_err,dfreq,f1,fspread_self,fspread_dx,snrdb,width,xlevel + real blue(4096),red(4096) + logical*1 disk_data,echo_call + character*6 rxcall,txcall + common/echocom/nclearave,nsum,blue,red + common/echocom2/fspread_self,fspread_dx + + id2=0 + id2(16:ntx)=1 + itone=0 + ndop_total=0 + ndop=0 + nfrit=10000 + f1=1500. + width=1. + ndf=-999 + idir=1 + call save_echo_params(ndop_total,ndop,nfrit,f1,width,ndf,itone,id2,idir) + + ndf=0 + idir=-1 + call save_echo_params(ndop_total,ndop,nfrit,f1,width,ndf,itone,id2,idir) + if(ndf.ne.-999) error stop 1 + + nauto=0 + navg=1 + nqual=0 + nclearave=1 + nsum=0 + fspread_self=1. + fspread_dx=1. + disk_data=.true. + echo_call=.false. + txcall=' ' + rxcall='BADBAD' + + call avecho(id2,ndop,nfrit,nauto,navg,nqual,f1,xlevel,snrdb,db_err,dfreq, & + width,disk_data,echo_call,txcall,rxcall) + if(rxcall.ne.' ') error stop 2 + + print*,'Echo disk metadata test passed' + +end program test_avecho_disk_metadata diff --git a/tests/unit/echo/test_avecho_silence.f90 b/tests/unit/echo/test_avecho_silence.f90 new file mode 100644 index 00000000..e0da549a --- /dev/null +++ b/tests/unit/echo/test_avecho_silence.f90 @@ -0,0 +1,53 @@ +program test_avecho_silence + + use, intrinsic :: ieee_arithmetic + implicit none + + integer, parameter :: ntx=6*4096 + integer*2 id2(ntx+4096) + integer nauto,navg,ndop,nfrit,nqual + integer nclearave,nsum + real blue(4096),db_err,dfreq,f1,fspread_dx,fspread_self + real red(4096),snrdb,width,xlevel + logical*1 disk_data,echo_call + character*6 rxcall,txcall + common/echocom/nclearave,nsum,blue,red + common/echocom2/fspread_self,fspread_dx + + id2=0 + ndop=0 + nfrit=0 + nauto=0 + navg=1 + nqual=-1 + nclearave=1 + nsum=0 + f1=1500. + fspread_self=1. + fspread_dx=1. + width=1. + disk_data=.false. + echo_call=.false. + txcall=' ' + rxcall='STALE!' + blue=1. + red=1. + + call avecho(id2,ndop,nfrit,nauto,navg,nqual,f1,xlevel,snrdb,db_err,dfreq, & + width,disk_data,echo_call,txcall,rxcall) + + if(.not.ieee_is_finite(xlevel)) error stop 1 + if(.not.ieee_is_finite(snrdb)) error stop 1 + if(.not.ieee_is_finite(db_err)) error stop 1 + if(.not.ieee_is_finite(dfreq)) error stop 1 + if(abs(xlevel+99.).gt.0.01) error stop 1 + if(abs(snrdb+99.).gt.0.01) error stop 1 + if(abs(dfreq).gt.0.01) error stop 1 + if(nqual.ne.0) error stop 1 + if(any(.not.ieee_is_finite(blue))) error stop 1 + if(any(.not.ieee_is_finite(red))) error stop 1 + if(any(blue.ne.0.) .or. any(red.ne.0.)) error stop 1 + + print*,'Silent Echo input test passed' + +end program test_avecho_silence diff --git a/tests/unit/echo/test_echo_morse.f90 b/tests/unit/echo/test_echo_morse.f90 new file mode 100644 index 00000000..fec95b3f --- /dev/null +++ b/tests/unit/echo/test_echo_morse.f90 @@ -0,0 +1,89 @@ +program test_echo_morse + + use, intrinsic :: ieee_arithmetic + use morse_encoder, only: encode_morse + implicit none + + integer cwsim_bits(500),ncwsim,ntests + + ntests=0 + call expect_valid_morse('0Az/ ',ntests) + call expect_invalid_morse('Z???',ntests) + call expect_valid_morse(repeat('E',59)//'T',ntests,246) + cwsim_bits=-1 + call encode_morse(repeat('0',22)//'EE',cwsim_bits,ncwsim) + call expect_valid_bits(cwsim_bits,ncwsim,ntests,498) + call expect_silent_wave(' ',ntests) + call expect_silent_wave('?',ntests) + call expect_signal_wave('O',ntests) + + write(*,1000) ntests +1000 format('Echo Morse tests passed: ',i0) + +contains + + subroutine expect_valid_morse(message,ntests,expected_n) + character(len=*), intent(in) :: message + integer, intent(inout) :: ntests + integer, intent(in), optional :: expected_n + integer bits(250),n + + bits=-1 + call morse(message,bits,n) + + call expect_valid_bits(bits,n,ntests,expected_n) + end subroutine expect_valid_morse + + subroutine expect_invalid_morse(message,ntests) + character(len=*), intent(in) :: message + integer, intent(inout) :: ntests + integer bits(250),n + + bits=-1 + call morse(message,bits,n) + + if(n.ne.0 .or. any(bits.ne.0)) error stop 1 + ntests=ntests+1 + end subroutine expect_invalid_morse + + subroutine expect_valid_bits(bits,n,ntests,expected_n) + integer, intent(in) :: bits(:),n + integer, intent(inout) :: ntests + integer, intent(in), optional :: expected_n + + if(n.le.0 .or. n.gt.size(bits)) error stop 1 + if(any(bits(1:n).lt.0) .or. any(bits(1:n).gt.1)) error stop 1 + if(present(expected_n)) then + if(n.ne.expected_n) error stop 1 + endif + ntests=ntests+1 + end subroutine expect_valid_bits + + subroutine expect_silent_wave(message,ntests) + character(len=*), intent(in) :: message + integer, intent(inout) :: ntests + real*4, allocatable :: wave(:) + + allocate(wave(98304)) + wave=1. + call gen_cw_wave(message,1500,wave) + + if(any(wave.ne.0.)) error stop 1 + ntests=ntests+1 + end subroutine expect_silent_wave + + subroutine expect_signal_wave(message,ntests) + character(len=*), intent(in) :: message + integer, intent(inout) :: ntests + real*4, allocatable :: wave(:) + + allocate(wave(98304)) + wave=0. + call gen_cw_wave(message,1500,wave) + + if(.not.all(ieee_is_finite(wave))) error stop 1 + if(maxval(abs(wave)).le.0.) error stop 1 + ntests=ntests+1 + end subroutine expect_signal_wave + +end program test_echo_morse diff --git a/tests/unit/echo/test_echocall_input.cmake b/tests/unit/echo/test_echocall_input.cmake new file mode 100644 index 00000000..1a88dd3a --- /dev/null +++ b/tests/unit/echo/test_echocall_input.cmake @@ -0,0 +1,131 @@ +if (NOT DEFINED ECHOCALLSIM OR NOT DEFINED TESTECHOCALL OR NOT DEFINED TEST_DIR) + message (FATAL_ERROR "EchoCall filename test is missing a required path") +endif () + +file (MAKE_DIRECTORY "${TEST_DIR}") +set (source_wav "${TEST_DIR}/000000_000000.wav") +file (REMOVE "${source_wav}") + +execute_process ( + COMMAND "${TESTECHOCALL}" + RESULT_VARIABLE no_argument_result + OUTPUT_VARIABLE no_argument_output + ERROR_VARIABLE no_argument_error +) +if (no_argument_result EQUAL 0) + message (FATAL_ERROR "testEchoCall accepted a missing input filename") +endif () +set (no_argument_output "${no_argument_output}${no_argument_error}") +if (NOT no_argument_output MATCHES "Usage: testEchoCall") + message (FATAL_ERROR + "testEchoCall missing-input output was unexpected:\n${no_argument_output}") +endif () + +execute_process ( + COMMAND "${ECHOCALLSIM}" K1JT 1500 0 0 10 1 99 + WORKING_DIRECTORY "${TEST_DIR}" + RESULT_VARIABLE simulator_result + OUTPUT_VARIABLE simulator_output + ERROR_VARIABLE simulator_error +) +if (NOT simulator_result EQUAL 0) + message (FATAL_ERROR + "EchoCallSim failed (${simulator_result}):\n${simulator_output}${simulator_error}") +endif () +if (NOT EXISTS "${source_wav}") + message (FATAL_ERROR "EchoCallSim did not create ${source_wav}") +endif () + +function (expect_accepted filename expected_timestamp) + configure_file ("${source_wav}" "${TEST_DIR}/${filename}" COPYONLY) + execute_process ( + COMMAND "${TESTECHOCALL}" "${TEST_DIR}/${filename}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error + ) + if (NOT result EQUAL 0) + message (FATAL_ERROR + "testEchoCall rejected ${filename} (${result}):\n${output}${error}") + endif () + if (NOT output MATCHES "${expected_timestamp}.*K1JT") + message (FATAL_ERROR + "testEchoCall output was unexpected for ${filename}:\n${output}") + endif () +endfunction () + +function (expect_rejected filename) + configure_file ("${source_wav}" "${TEST_DIR}/${filename}" COPYONLY) + execute_process ( + COMMAND "${TESTECHOCALL}" "${TEST_DIR}/${filename}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error + ) + if (result EQUAL 0) + message (FATAL_ERROR "testEchoCall accepted invalid filename ${filename}") + endif () + set (combined_output "${output}${error}") + if (NOT combined_output MATCHES + "filename must end with a valid HHMMSS\\.wav timestamp") + message (FATAL_ERROR + "testEchoCall rejection was unexpected for ${filename}:\n${combined_output}") + endif () + if (combined_output MATCHES "Fortran runtime error") + message (FATAL_ERROR + "testEchoCall raised a runtime error for ${filename}:\n${combined_output}") + endif () +endfunction () + +function (expect_io_failure filename expected_message) + execute_process ( + COMMAND "${TESTECHOCALL}" "${TEST_DIR}/${filename}" + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error + ) + if (result EQUAL 0) + message (FATAL_ERROR "testEchoCall accepted unreadable input ${filename}") + endif () + set (combined_output "${output}${error}") + if (NOT combined_output MATCHES "${expected_message}") + message (FATAL_ERROR + "testEchoCall I/O rejection was unexpected for ${filename}:\n${combined_output}") + endif () + if (combined_output MATCHES "Fortran runtime error") + message (FATAL_ERROR + "testEchoCall raised a runtime error for ${filename}:\n${combined_output}") + endif () +endfunction () + +expect_accepted ("123456.wav" "123456") +expect_accepted ("235959.WAV" "235959") + +set (long_path_component + "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") +file (MAKE_DIRECTORY "${TEST_DIR}/${long_path_component}") +expect_accepted ("${long_path_component}/123456.wav" "123456") + +expect_rejected ("badname") +expect_rejected ("abc.wav") +expect_rejected ("abcdef.wav") +expect_rejected ("240000.wav") +expect_rejected ("126000.wav") +expect_rejected ("125960.wav") + +set (missing_wav "${TEST_DIR}/010203.wav") +file (REMOVE "${missing_wav}") +expect_io_failure ("010203.wav" "testEchoCall: cannot open") +if (EXISTS "${missing_wav}") + message (FATAL_ERROR "testEchoCall created missing input ${missing_wav}") +endif () + +file (WRITE "${TEST_DIR}/010204.wav" "truncated") +expect_io_failure ("010204.wav" "testEchoCall: cannot read") + +set (invalid_wav_payload "not a RIFF/WAVE file") +foreach (iteration RANGE 1 12) + set (invalid_wav_payload "${invalid_wav_payload}${invalid_wav_payload}") +endforeach () +file (WRITE "${TEST_DIR}/010205.wav" "${invalid_wav_payload}") +expect_io_failure ("010205.wav" "not a RIFF/WAVE file") diff --git a/tests/unit/fst4/CMakeLists.txt b/tests/unit/fst4/CMakeLists.txt new file mode 100644 index 00000000..afd3f8e8 --- /dev/null +++ b/tests/unit/fst4/CMakeLists.txt @@ -0,0 +1,13 @@ +add_executable (test_fst4_generator + test_fst4_generator.f90) +target_include_directories (test_fst4_generator PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_fst4_generator) + +add_test (NAME test_fst4_generator COMMAND test_fst4_generator) + +add_executable (test_fst4_osd_depth + test_fst4_osd_depth.f90) +target_include_directories (test_fst4_osd_depth PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_fst4_osd_depth) + +add_test (NAME test_fst4_osd_depth COMMAND test_fst4_osd_depth) diff --git a/tests/unit/fst4/test_fst4_generator.f90 b/tests/unit/fst4/test_fst4_generator.f90 new file mode 100644 index 00000000..8fdd4cf8 --- /dev/null +++ b/tests/unit/fst4/test_fst4_generator.f90 @@ -0,0 +1,140 @@ +program test_fst4_generator + + implicit none + + integer :: ntests + + ntests=0 + + call expect_good_fst4w('K1ABC FN42 37',ntests) + call expect_bad_fst4w(' FK52A!',ntests) + call expect_bad_fst4w('K1ABC FN42 55',ntests) + call expect_bad_fst4w('K1ABC FN42 03',ntests) + call expect_bad_fst4w('K1ABC FN42 5!',ntests) + call expect_fst4_lossy_free_text('ABCDEFGHIJKLMN','ABCDEFGHIJKLM',ntests) + + write(*,1000) ntests +1000 format('FST4 generator tests passed: ',i0) + +contains + + subroutine expect_good_fst4w(input,ntests) + character(len=*), intent(in) :: input + integer, intent(inout) :: ntests + character(len=37) :: msg,msgsent + integer*1 :: msgbits(101) + integer*4 :: itone(160) + integer :: iwspr + + msg=' ' + msg=input + msgsent='sentinel' + msgbits=0 + itone=0 + iwspr=1 + + call genfst4(msg,0,msgsent,msgbits,itone,iwspr) + + if(trim(msgsent).ne.input) then + write(*,1080) trim(input), trim(msgsent) +1080 format('FST4W valid input "',a,'" returned "',a,'"') + error stop 1 + endif + if(iwspr.ne.1) then + write(*,1090) trim(input), iwspr +1090 format('FST4W valid input "',a,'" changed iwspr to ',i0) + error stop 1 + endif + if(all(itone.eq.0)) then + write(*,1100) trim(input) +1100 format('FST4W valid input "',a,'" produced all-zero tones') + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_good_fst4w + + subroutine expect_bad_fst4w(input,ntests) + character(len=*), intent(in) :: input + integer, intent(inout) :: ntests + character(len=37) :: msg,msgsent + integer*1 :: msgbits(101) + integer*4 :: itone(160) + integer :: iwspr + + msg=' ' + msg=input + msgsent='sentinel' + msgbits=1 + itone=3 + iwspr=1 + + call genfst4(msg,0,msgsent,msgbits,itone,iwspr) + + if(trim(msgsent).ne.'*** bad message ***') then + write(*,1010) trim(input), trim(msgsent) +1010 format('FST4W invalid input "',a,'" returned "',a,'"') + error stop 1 + endif + if(any(msgbits.ne.0)) then + write(*,1020) trim(input) +1020 format('FST4W invalid input "',a,'" left nonzero message bits') + error stop 1 + endif + if(any(itone.ne.0)) then + write(*,1030) trim(input) +1030 format('FST4W invalid input "',a,'" left nonzero tones') + error stop 1 + endif + if(iwspr.ne.1) then + write(*,1040) trim(input), iwspr +1040 format('FST4W invalid input "',a,'" changed iwspr to ',i0) + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_bad_fst4w + + subroutine expect_fst4_lossy_free_text(input,expected,ntests) + character(len=*), intent(in) :: input + character(len=*), intent(in) :: expected + integer, intent(inout) :: ntests + character(len=37) :: msg,msgsent + integer*1 :: msgbits(101) + integer*4 :: itone(160) + integer :: iwspr + + msg=' ' + msg=input + msgsent='sentinel' + msgbits=0 + itone=0 + iwspr=0 + + call genfst4(msg,0,msgsent,msgbits,itone,iwspr) + + if(trim(msgsent).eq.'*** bad message ***') then + write(*,1050) trim(input) +1050 format('FST4 lossy input "',a,'" was rejected') + error stop 1 + endif + if(trim(msgsent).ne.expected) then + write(*,1055) trim(input), trim(msgsent), trim(expected) +1055 format('FST4 lossy input "',a,'" returned "',a,'" expected "',a,'"') + error stop 1 + endif + if(iwspr.ne.0) then + write(*,1060) trim(input), iwspr +1060 format('FST4 lossy input "',a,'" changed iwspr to ',i0) + error stop 1 + endif + if(all(itone.eq.0)) then + write(*,1070) trim(input) +1070 format('FST4 lossy input "',a,'" produced all-zero tones') + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_fst4_lossy_free_text + +end program test_fst4_generator diff --git a/tests/unit/fst4/test_fst4_osd_depth.f90 b/tests/unit/fst4/test_fst4_osd_depth.f90 new file mode 100644 index 00000000..dc41ccdf --- /dev/null +++ b/tests/unit/fst4/test_fst4_osd_depth.f90 @@ -0,0 +1,78 @@ +program test_fst4_osd_depth + + implicit none + + integer, parameter :: n = 240 + real :: llr(n) + integer(kind=1) :: apmask(n) + integer(kind=1) :: message_zero(74), message_negative(74) + integer(kind=1) :: message101_zero(101), message101_negative(101) + integer(kind=1) :: cw_zero(n), cw_negative(n) + real :: llr128(128) + integer(kind=1) :: apmask128(128) + integer(kind=1) :: message77_zero(77), message77_negative(77) + integer(kind=1) :: cw128_zero(128), cw128_negative(128) + integer :: nhard_zero, nhard_negative + real :: dmin_zero, dmin_negative + integer :: i + integer :: nhard128_zero, nhard128_negative + real :: dmin128_zero, dmin128_negative + external :: osd240_74, osd240_101, osd128_90 + + do i = 1, n + llr(i) = real(mod(7*i, 23) - 11) + end do + apmask = 0 + + call osd240_74(llr, 50, apmask, 0, message_zero, cw_zero, nhard_zero, dmin_zero) + call osd240_74(llr, 50, apmask, -1, message_negative, cw_negative, & + nhard_negative, dmin_negative) + call require(all(message_zero == message_negative), & + 'negative (240,74) OSD depth matches zero depth') + call require(all(cw_zero == cw_negative), & + 'negative (240,74) OSD depth preserves the codeword') + call require(nhard_zero == nhard_negative .and. dmin_zero == dmin_negative, & + 'negative (240,74) OSD depth preserves metrics') + + call osd240_101(llr, 77, apmask, 0, message101_zero, cw_zero, & + nhard_zero, dmin_zero) + call osd240_101(llr, 77, apmask, -1, message101_negative, cw_negative, & + nhard_negative, dmin_negative) + call require(all(message101_zero == message101_negative), & + 'negative (240,101) OSD depth matches zero depth') + call require(all(cw_zero == cw_negative), & + 'negative (240,101) OSD depth preserves the codeword') + call require(nhard_zero == nhard_negative .and. dmin_zero == dmin_negative, & + 'negative (240,101) OSD depth preserves metrics') + + do i = 1, 128 + llr128(i) = real(mod(11*i, 29) - 14) + end do + apmask128 = 0 + call osd128_90(llr128, apmask128, 0, message77_zero, cw128_zero, & + nhard128_zero, dmin128_zero) + call osd128_90(llr128, apmask128, -1, message77_negative, cw128_negative, & + nhard128_negative, dmin128_negative) + call require(all(message77_zero == message77_negative), & + 'negative (128,90) OSD depth matches zero depth') + call require(all(cw128_zero == cw128_negative), & + 'negative (128,90) OSD depth preserves the codeword') + call require(nhard128_zero == nhard128_negative .and. & + dmin128_zero == dmin128_negative, & + 'negative (128,90) OSD depth preserves metrics') + + print '(a)', 'FST4 OSD depth tests passed' + +contains + + subroutine require(condition, description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + + if (.not. condition) then + print '(a)', 'FAIL: '//description + error stop 1 + end if + end subroutine require + +end program test_fst4_osd_depth diff --git a/tests/unit/ft8/CMakeLists.txt b/tests/unit/ft8/CMakeLists.txt new file mode 100644 index 00000000..18eb4557 --- /dev/null +++ b/tests/unit/ft8/CMakeLists.txt @@ -0,0 +1,51 @@ +add_executable (test_ft8_mtd_decode_scheduler + test_ft8_mtd_decode_scheduler.cpp + ${CMAKE_SOURCE_DIR}/Ft8MtdDecodeScheduler.cpp +) +target_include_directories (test_ft8_mtd_decode_scheduler PRIVATE ${CMAKE_SOURCE_DIR}) +target_link_libraries (test_ft8_mtd_decode_scheduler Qt5::Test) +add_test (NAME test_ft8_mtd_decode_scheduler COMMAND test_ft8_mtd_decode_scheduler) + +add_executable (test_ft8_mtd_decode_coordinator + test_ft8_mtd_decode_coordinator.cpp + ${CMAKE_SOURCE_DIR}/Ft8MtdDecodeCoordinator.cpp + ${CMAKE_SOURCE_DIR}/Ft8MtdDecodeScheduler.cpp + ${CMAKE_SOURCE_DIR}/DecoderIpc.cpp + ${CMAKE_SOURCE_DIR}/lib/decoder_ipc_control.cpp +) +target_include_directories (test_ft8_mtd_decode_coordinator PRIVATE + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/lib +) +target_link_libraries (test_ft8_mtd_decode_coordinator Qt5::Test) +add_test (NAME test_ft8_mtd_decode_coordinator COMMAND test_ft8_mtd_decode_coordinator) + +add_executable (test_ft8_decode_ranges + test_ft8_decode_ranges.f90) +target_include_directories (test_ft8_decode_ranges PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_ft8_decode_ranges) + +add_test (NAME test_ft8_decode_ranges COMMAND test_ft8_decode_ranges) + +add_executable (test_ft8_mtd_residual + test_ft8_mtd_residual.f90) +target_include_directories (test_ft8_mtd_residual PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_ft8_mtd_residual) + +add_test (NAME test_ft8_mtd_residual COMMAND test_ft8_mtd_residual) + +if (TARGET wsjt_fort_omp) + add_executable (test_ft8_mtd_transaction_concurrent + test_ft8_mtd_transaction_concurrent.f90) + target_include_directories (test_ft8_mtd_transaction_concurrent PRIVATE + ${WSJT_FORTRAN_OPENMP_MODULE_DIR}) + target_link_libraries (test_ft8_mtd_transaction_concurrent PRIVATE + wsjt_fort_omp wsjt_fortran_openmp) + + add_test (NAME test_ft8_mtd_transaction_concurrent + COMMAND test_ft8_mtd_transaction_concurrent) + set_tests_properties (test_ft8_mtd_transaction_concurrent PROPERTIES + ENVIRONMENT "OMP_DYNAMIC=FALSE;OMP_NUM_THREADS=4;OMP_THREAD_LIMIT=4" + PROCESSORS 4 + TIMEOUT 30) +endif () diff --git a/tests/unit/ft8/test_ft8_decode_ranges.f90 b/tests/unit/ft8/test_ft8_decode_ranges.f90 new file mode 100644 index 00000000..9f6f2466 --- /dev/null +++ b/tests/unit/ft8/test_ft8_decode_ranges.f90 @@ -0,0 +1,68 @@ +program test_ft8_decode_ranges + use ft8_decode_ranges, only: max_ft8_decode_ranges, partition_ft8_decode_range + implicit none + + integer :: requested_ranges + + do requested_ranges=1,max_ft8_decode_ranges + call assert_partition(200,1000,requested_ranges,requested_ranges) + enddo + + call assert_empty_partition(4900,1000,12) + call assert_partition(1000,1000,12,1) + call assert_partition(999,1000,12,2) + call assert_partition(4900,5000,12,12) + call assert_upper_bounds(200,1000,11, & + [272,345,418,491,564,637,710,783,856,928,1000]) + call assert_upper_bounds(200,1000,12, & + [266,333,400,467,534,601,668,735,802,868,934,1000]) + +contains + + subroutine assert_empty_partition(nfa,nfb,requested_ranges) + integer, intent(in) :: nfa,nfb,requested_ranges + integer :: range_low(max_ft8_decode_ranges) + integer :: range_high(max_ft8_decode_ranges) + integer :: nranges + + call partition_ft8_decode_range(nfa,nfb,requested_ranges,range_low,range_high,nranges) + if(nranges.ne.0) error stop 'reversed range must produce no partitions' + end subroutine assert_empty_partition + + subroutine assert_upper_bounds(nfa,nfb,requested_ranges,expected_high) + integer, intent(in) :: nfa,nfb,requested_ranges + integer, intent(in) :: expected_high(:) + integer :: range_low(max_ft8_decode_ranges) + integer :: range_high(max_ft8_decode_ranges) + integer :: nranges + + call partition_ft8_decode_range(nfa,nfb,requested_ranges,range_low,range_high,nranges) + if(nranges.ne.size(expected_high)) error stop 'unexpected exact partition count' + if(any(range_high(1:nranges).ne.expected_high)) error stop 'unexpected partition boundary' + end subroutine assert_upper_bounds + + subroutine assert_partition(nfa,nfb,requested_ranges,expected_ranges) + integer, intent(in) :: nfa,nfb,requested_ranges,expected_ranges + integer :: i,max_width,min_width,nranges + integer :: range_low(max_ft8_decode_ranges) + integer :: range_high(max_ft8_decode_ranges) + + call partition_ft8_decode_range(nfa,nfb,requested_ranges,range_low,range_high,nranges) + + if(nranges.ne.expected_ranges) error stop 'unexpected partition count' + if(range_low(1).ne.nfa) error stop 'partitioning changed the lower bound' + if(range_high(nranges).ne.nfb) error stop 'partitioning changed the upper bound' + + do i=1,nranges + if(range_low(i).gt.range_high(i)) error stop 'partition is reversed' + if(i.gt.1) then + if(range_low(i).ne.range_high(i-1)+1) error stop 'partitions are not contiguous' + endif + enddo + + min_width=minval(range_high(1:nranges)-range_low(1:nranges)+1) + max_width=maxval(range_high(1:nranges)-range_low(1:nranges)+1) + if(max_width-min_width.gt.1) error stop 'partitions are not balanced' + end subroutine assert_partition + +end program test_ft8_decode_ranges diff --git a/tests/unit/ft8/test_ft8_mtd_decode_coordinator.cpp b/tests/unit/ft8/test_ft8_mtd_decode_coordinator.cpp new file mode 100644 index 00000000..2debacb3 --- /dev/null +++ b/tests/unit/ft8/test_ft8_mtd_decode_coordinator.cpp @@ -0,0 +1,327 @@ +#include + +#include +#include + +#include "Ft8MtdDecodeCoordinator.hpp" + +namespace +{ + using Stage = Ft8MtdDecodeCoordinator::Stage; + using Action = Ft8MtdDecodeCoordinator::Action; + using DrainResult = Ft8MtdDecodeCoordinator::DrainResult; + using PendingPublishResult = Ft8MtdDecodeCoordinator::PendingPublishResult; + + std::unique_ptr pendingDecode ( + qint64 period, int nutc, short firstSample) + { + auto pending = std::make_unique (); + pending->period = period; + pending->payload.params.nmode = 8; + pending->payload.params.lmultift8 = true; + pending->payload.params.nutc = nutc; + pending->payload.samples[0] = firstSample; + pending->context.mode = "FT8"; + pending->context.periodFrequency = 14074000; + pending->context.band = "20m"; + pending->context.multithreadFt8 = true; + pending->context.ft8ThreadCount = 4; + pending->context.decodeDepth = 3; + return pending; + } + + class FakeBackend + { + public: + void startEarly (Stage stage, qint64 period, int earlyStageCount) + { + auto const decision = coordinator.request ( + stage, period, earlyStageCount, active); + QCOMPARE (decision.action, Action::Publish); + active = true; + activeStage = stage; + activePeriod = period; + coordinator.published (stage, period); + publishedPeriods.push_back (period); + } + + Action submitFinal (qint64 period, int nutc, short firstSample, + int earlyStageCount = 1) + { + auto const decision = coordinator.request ( + Stage::Final, period, earlyStageCount, + active || coordinator.hasPending ()); + if (Action::Publish == decision.action) + { + active = true; + activeStage = Stage::Final; + activePeriod = period; + coordinator.published (Stage::Final, period); + publishedPeriods.push_back (period); + publishedNutcs.push_back (nutc); + return decision.action; + } + + return coordinator.deferFinal ( + pendingDecode (period, nutc, firstSample)); + } + + void completeAndDrain () + { + QVERIFY (active); + coordinator.completed (activeStage, activePeriod); + active = false; + activeStage = Stage::None; + activePeriod = -1; + if (!coordinator.hasPending ()) return; + + auto const outcome = coordinator.drainPending ( + [] (Ft8MtdDecodeCoordinator::PendingMtdDecode const&) {return true;}, + [this] (Ft8MtdDecodeCoordinator::PendingMtdDecode const& pending) { + active = true; + activeStage = Stage::Final; + activePeriod = pending.period; + publishedPeriods.push_back (pending.period); + publishedNutcs.push_back (pending.payload.params.nutc); + publishedFirstSamples.push_back (pending.payload.samples[0]); + publishedContext = pending.context; + return PendingPublishResult::Published; + }); + QCOMPARE (outcome.result, DrainResult::Published); + } + + bool externallyBusy () const + { + return active || coordinator.hasPending (); + } + + Ft8MtdDecodeCoordinator coordinator; + bool active {false}; + Stage activeStage {Stage::None}; + qint64 activePeriod {-1}; + std::vector publishedPeriods; + std::vector publishedNutcs; + std::vector publishedFirstSamples; + DecodeOperatingContext publishedContext; + }; +} + +class TestFt8MtdDecodeCoordinator final : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void slowEarlyDecodeRetainsAndPublishesFinalOnce (); + void unrelatedCompletionDoesNotPublishPendingFinal (); + void multiPeriodOverrunPublishesOnlyNewestFinal (); + void pendingSnapshotIsImmutable (); + void pendingContextReachesFinalPublication (); + void pendingCountsAsBusyUntilDrain (); + void temporaryBackendFailurePreservesPending (); + void fatalBackendFailureDropsPending (); + void publicationFailureLeavesPendingForRestart (); + void changedContextDropsPendingWithoutPublishing (); + void cancellationDropsPendingAndSchedulingState (); +}; + +void TestFt8MtdDecodeCoordinator::slowEarlyDecodeRetainsAndPublishesFinalOnce () +{ + FakeBackend backend; + backend.startEarly (Stage::EarlyOne, 100, 1); + + QCOMPARE (backend.submitFinal (100, 120000, 17), Action::DeferFinal); + QVERIFY (backend.externallyBusy ()); + backend.completeAndDrain (); + + QVERIFY (backend.publishedPeriods == std::vector ({100, 100})); + QVERIFY (backend.publishedNutcs == std::vector ({120000})); + QCOMPARE (backend.activeStage, Stage::Final); + QCOMPARE (backend.activePeriod, qint64 {100}); + QVERIFY (backend.active); + QVERIFY (!backend.coordinator.hasPending ()); +} + +void TestFt8MtdDecodeCoordinator::unrelatedCompletionDoesNotPublishPendingFinal () +{ + FakeBackend backend; + backend.startEarly (Stage::EarlyOne, 150, 1); + backend.submitFinal (150, 120015, 18); + + backend.coordinator.completed (Stage::EarlyOne, 149); + + QVERIFY (backend.coordinator.hasPending ()); + QVERIFY (backend.publishedPeriods == std::vector ({150})); + + backend.completeAndDrain (); + QVERIFY (backend.publishedPeriods == std::vector ({150, 150})); +} + +void TestFt8MtdDecodeCoordinator::multiPeriodOverrunPublishesOnlyNewestFinal () +{ + FakeBackend backend; + backend.startEarly (Stage::EarlyOne, 200, 1); + QCOMPARE (backend.submitFinal (200, 130000, 20), Action::DeferFinal); + QCOMPARE (backend.submitFinal (201, 130015, 21), Action::ReplaceFinal); + QCOMPARE (backend.submitFinal (202, 130030, 22), Action::ReplaceFinal); + + backend.completeAndDrain (); + + QVERIFY (backend.publishedPeriods == std::vector ({200, 202})); + QVERIFY (backend.publishedNutcs == std::vector ({130030})); + QVERIFY (backend.publishedFirstSamples == std::vector ({22})); +} + +void TestFt8MtdDecodeCoordinator::pendingSnapshotIsImmutable () +{ + FakeBackend backend; + backend.startEarly (Stage::EarlyOne, 300, 1); + int sourceNutC {140000}; + short sourceSample {31}; + backend.submitFinal (300, sourceNutC, sourceSample); + sourceNutC = 140015; + sourceSample = 32; + + backend.completeAndDrain (); + + QCOMPARE (backend.publishedNutcs.back (), 140000); + QCOMPARE (backend.publishedFirstSamples.back (), short {31}); +} + +void TestFt8MtdDecodeCoordinator::pendingContextReachesFinalPublication () +{ + FakeBackend backend; + backend.startEarly (Stage::EarlyOne, 350, 1); + backend.submitFinal (350, 140015, 35); + + backend.completeAndDrain (); + + auto const& context = backend.publishedContext; + QCOMPARE (context.mode, QStringLiteral ("FT8")); + QCOMPARE (context.periodFrequency, Radio::Frequency {14074000}); + QCOMPARE (context.band, QStringLiteral ("20m")); + QVERIFY (context.multithreadFt8); + QCOMPARE (context.ft8ThreadCount, 4); + QCOMPARE (context.decodeDepth, 3); +} + +void TestFt8MtdDecodeCoordinator::pendingCountsAsBusyUntilDrain () +{ + FakeBackend backend; + backend.startEarly (Stage::EarlyOne, 400, 1); + backend.submitFinal (400, 150000, 41); + + backend.active = false; + QVERIFY (backend.coordinator.hasPending ()); + QVERIFY (backend.externallyBusy ()); + backend.active = true; + backend.completeAndDrain (); + QVERIFY (backend.externallyBusy ()); +} + +void TestFt8MtdDecodeCoordinator::temporaryBackendFailurePreservesPending () +{ + Ft8MtdDecodeCoordinator coordinator; + coordinator.deferFinal (pendingDecode (500, 160000, 51)); + + auto const unavailable = coordinator.drainPending ( + [] (Ft8MtdDecodeCoordinator::PendingMtdDecode const&) {return true;}, + [] (Ft8MtdDecodeCoordinator::PendingMtdDecode const&) { + return PendingPublishResult::Unavailable; + }); + QCOMPARE (unavailable.result, DrainResult::Retained); + QVERIFY (coordinator.hasPending ()); + + auto shared = std::make_unique (); + DecoderIpc::initialize (*shared); + int publishCalls {0}; + auto const published = coordinator.drainPending ( + [] (Ft8MtdDecodeCoordinator::PendingMtdDecode const&) {return true;}, + [&] (Ft8MtdDecodeCoordinator::PendingMtdDecode const& pending) { + ++publishCalls; + return DecoderIpc::publishFt8Mtd (*shared, pending.payload, 1) + ? PendingPublishResult::Published : PendingPublishResult::Failed; + }); + + QCOMPARE (published.result, DrainResult::Published); + QCOMPARE (publishCalls, 1); + QVERIFY (!coordinator.hasPending ()); + QCOMPARE (shared->payload.params.nutc, 160000); + QCOMPARE (shared->payload.d2[0], short {51}); + + auto const empty = coordinator.drainPending ( + [] (Ft8MtdDecodeCoordinator::PendingMtdDecode const&) {return true;}, + [&] (Ft8MtdDecodeCoordinator::PendingMtdDecode const&) { + ++publishCalls; + return PendingPublishResult::Published; + }); + QCOMPARE (empty.result, DrainResult::NoPending); + QCOMPARE (publishCalls, 1); +} + +void TestFt8MtdDecodeCoordinator::fatalBackendFailureDropsPending () +{ + Ft8MtdDecodeCoordinator coordinator; + coordinator.deferFinal (pendingDecode (510, 160015, 52)); + + auto const outcome = coordinator.drainPending ( + [] (Ft8MtdDecodeCoordinator::PendingMtdDecode const&) {return true;}, + [] (Ft8MtdDecodeCoordinator::PendingMtdDecode const&) { + return PendingPublishResult::Failed; + }); + + QCOMPARE (outcome.result, DrainResult::Failed); + QVERIFY (!coordinator.hasPending ()); +} + +void TestFt8MtdDecodeCoordinator::publicationFailureLeavesPendingForRestart () +{ + FakeBackend backend; + backend.startEarly (Stage::EarlyOne, 515, 1); + backend.submitFinal (515, 160020, 52); + + backend.coordinator.publicationFailed (Stage::EarlyOne, 515); + QVERIFY (backend.coordinator.hasPending ()); + + backend.completeAndDrain (); + + QVERIFY (backend.publishedPeriods == std::vector ({515, 515})); + QVERIFY (!backend.coordinator.hasPending ()); +} + +void TestFt8MtdDecodeCoordinator::changedContextDropsPendingWithoutPublishing () +{ + Ft8MtdDecodeCoordinator coordinator; + coordinator.request (Stage::Final, 520, 1, true); + coordinator.deferFinal (pendingDecode (520, 160030, 53)); + int publishCalls {0}; + + auto const outcome = coordinator.drainPending ( + [] (Ft8MtdDecodeCoordinator::PendingMtdDecode const&) {return false;}, + [&] (Ft8MtdDecodeCoordinator::PendingMtdDecode const&) { + ++publishCalls; + return PendingPublishResult::Published; + }); + + QCOMPARE (outcome.result, DrainResult::Obsolete); + QCOMPARE (publishCalls, 0); + QVERIFY (!coordinator.hasPending ()); + QVERIFY (!coordinator.degraded ()); +} + +void TestFt8MtdDecodeCoordinator::cancellationDropsPendingAndSchedulingState () +{ + Ft8MtdDecodeCoordinator coordinator; + coordinator.request (Stage::Final, 600, 1, true); + coordinator.deferFinal (pendingDecode (600, 170000, 61)); + QVERIFY (coordinator.degraded ()); + + coordinator.cancel (); + + QVERIFY (!coordinator.hasPending ()); + QVERIFY (!coordinator.degraded ()); + QCOMPARE (coordinator.nextProbePeriod (), qint64 {0}); +} + +QTEST_GUILESS_MAIN (TestFt8MtdDecodeCoordinator) + +#include "test_ft8_mtd_decode_coordinator.moc" diff --git a/tests/unit/ft8/test_ft8_mtd_decode_scheduler.cpp b/tests/unit/ft8/test_ft8_mtd_decode_scheduler.cpp new file mode 100644 index 00000000..13b96ce5 --- /dev/null +++ b/tests/unit/ft8/test_ft8_mtd_decode_scheduler.cpp @@ -0,0 +1,137 @@ +#include + +#include "Ft8MtdDecodeScheduler.hpp" + +class TestFt8MtdDecodeScheduler final : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void eligibilityRequiresIndependentMtdFinal (); + void idleRequestsPublishImmediately (); + void earlyRequestsNeverQueue (); + void finalRequestsDeferOrReplace (); + void failedProbesBackOffExponentially (); + void oneEarlyPassMtdConfigurationRecovers (); + void twoEarlyPassMtdConfigurationRequiresBothEarlyPasses (); + void cancelRestoresBoundedInitialState (); +}; + +using Stage = Ft8MtdDecodeScheduler::Stage; +using Action = Ft8MtdDecodeScheduler::Action; + +void TestFt8MtdDecodeScheduler::eligibilityRequiresIndependentMtdFinal () +{ + QVERIFY (!Ft8MtdDecodeScheduler::supportsBackpressure (false, false)); + QVERIFY (Ft8MtdDecodeScheduler::supportsBackpressure (true, false)); + QVERIFY (!Ft8MtdDecodeScheduler::supportsBackpressure (true, true)); +} + +void TestFt8MtdDecodeScheduler::idleRequestsPublishImmediately () +{ + Ft8MtdDecodeScheduler scheduler; + QCOMPARE (scheduler.request (Stage::EarlyOne, 10, 1, false, false).action, + Action::Publish); + QCOMPARE (scheduler.request (Stage::Final, 10, 1, false, false).action, + Action::Publish); + QVERIFY (!scheduler.degraded ()); +} + +void TestFt8MtdDecodeScheduler::earlyRequestsNeverQueue () +{ + Ft8MtdDecodeScheduler scheduler; + auto const decision = scheduler.request (Stage::EarlyOne, 20, 1, true, false); + QCOMPARE (decision.action, Action::SkipEarly); + QVERIFY (decision.enteredDegraded); + QVERIFY (scheduler.degraded ()); +} + +void TestFt8MtdDecodeScheduler::finalRequestsDeferOrReplace () +{ + Ft8MtdDecodeScheduler scheduler; + QCOMPARE (scheduler.request (Stage::Final, 30, 1, true, false).action, + Action::DeferFinal); + QCOMPARE (scheduler.request (Stage::Final, 31, 1, true, true).action, + Action::ReplaceFinal); +} + +void TestFt8MtdDecodeScheduler::failedProbesBackOffExponentially () +{ + Ft8MtdDecodeScheduler scheduler; + auto result = scheduler.request (Stage::EarlyOne, 40, 1, true, false); + QCOMPARE (result.skippedPeriods, 1); + QCOMPARE (scheduler.nextProbePeriod (), qint64 {42}); + QCOMPARE (scheduler.request (Stage::EarlyOne, 41, 1, false, false).action, + Action::SkipEarly); + + result = scheduler.request (Stage::EarlyOne, 42, 1, true, false); + QCOMPARE (result.skippedPeriods, 2); + QCOMPARE (scheduler.nextProbePeriod (), qint64 {45}); + result = scheduler.request (Stage::EarlyOne, 45, 1, true, false); + QCOMPARE (result.skippedPeriods, 4); + QCOMPARE (scheduler.nextProbePeriod (), qint64 {50}); + result = scheduler.request (Stage::EarlyOne, 50, 1, true, false); + QCOMPARE (result.skippedPeriods, 8); + QCOMPARE (scheduler.nextProbePeriod (), qint64 {59}); + result = scheduler.request (Stage::EarlyOne, 59, 1, true, false); + QCOMPARE (result.skippedPeriods, 8); + QCOMPARE (scheduler.nextProbePeriod (), qint64 {68}); +} + +void TestFt8MtdDecodeScheduler::oneEarlyPassMtdConfigurationRecovers () +{ + Ft8MtdDecodeScheduler scheduler; + scheduler.request (Stage::Final, 60, 1, true, false); + QCOMPARE (scheduler.request (Stage::EarlyOne, 62, 1, false, false).action, + Action::Publish); + scheduler.published (Stage::EarlyOne, 62); + scheduler.completed (Stage::EarlyOne, 62); + QCOMPARE (scheduler.request (Stage::Final, 62, 1, false, false).action, + Action::Publish); + QVERIFY (scheduler.published (Stage::Final, 62)); + QVERIFY (!scheduler.degraded ()); +} + +void TestFt8MtdDecodeScheduler::twoEarlyPassMtdConfigurationRequiresBothEarlyPasses () +{ + Ft8MtdDecodeScheduler complete; + complete.request (Stage::Final, 70, 2, true, false); + complete.request (Stage::EarlyOne, 72, 2, false, false); + complete.published (Stage::EarlyOne, 72); + complete.completed (Stage::EarlyOne, 72); + QCOMPARE (complete.request (Stage::EarlyTwo, 72, 2, false, false).action, + Action::Publish); + complete.published (Stage::EarlyTwo, 72); + complete.completed (Stage::EarlyTwo, 72); + QCOMPARE (complete.request (Stage::Final, 72, 2, false, false).action, + Action::Publish); + QVERIFY (complete.published (Stage::Final, 72)); + QVERIFY (!complete.degraded ()); + + Ft8MtdDecodeScheduler incomplete; + incomplete.request (Stage::Final, 80, 2, true, false); + incomplete.request (Stage::EarlyOne, 82, 2, false, false); + incomplete.published (Stage::EarlyOne, 82); + incomplete.completed (Stage::EarlyOne, 82); + incomplete.request (Stage::EarlyTwo, 82, 2, false, false); + incomplete.published (Stage::EarlyTwo, 82); + QCOMPARE (incomplete.request (Stage::Final, 82, 2, true, false).action, + Action::DeferFinal); + QVERIFY (incomplete.degraded ()); +} + +void TestFt8MtdDecodeScheduler::cancelRestoresBoundedInitialState () +{ + Ft8MtdDecodeScheduler scheduler; + scheduler.request (Stage::Final, 80, 1, true, true); + QVERIFY (scheduler.degraded ()); + scheduler.cancel (); + QVERIFY (!scheduler.degraded ()); + QCOMPARE (scheduler.nextProbePeriod (), qint64 {0}); + QCOMPARE (scheduler.request (Stage::EarlyOne, 81, 1, false, false).action, + Action::Publish); +} + +QTEST_GUILESS_MAIN (TestFt8MtdDecodeScheduler) + +#include "test_ft8_mtd_decode_scheduler.moc" diff --git a/tests/unit/ft8/test_ft8_mtd_residual.f90 b/tests/unit/ft8/test_ft8_mtd_residual.f90 new file mode 100644 index 00000000..c71957fb --- /dev/null +++ b/tests/unit/ft8/test_ft8_mtd_residual.f90 @@ -0,0 +1,281 @@ +program test_ft8_mtd_residual + use iso_fortran_env, only : int64 + use ft8_mtd_residual + use ft8_mod1, only : cw,endcorr + implicit none + + integer, parameter :: frame_samples=151680 + + call test_interaction_boundary() + call test_independent_delta_commits() + call test_conflict_and_duplicate() + call test_candidate_refresh() + call test_real_subtractor_equivalence() + call test_phase_epoch_conflict() + call test_half_sample_endpoints() + call test_pass7_restore() + +contains + + subroutine test_interaction_boundary() + type(ft8_subtraction_descriptor) :: left,right + integer :: tones(79) + + tones=1 + call mtd_prepare(spread(0.0,1,mtd_residual_samples),1) + call mtd_make_descriptor(left,1,tones,1000.0,0.5) + call mtd_make_descriptor(right,1,tones,1049.999,0.5) + if(.not.mtd_descriptors_conflict(left,right)) error stop & + 'frequencies less than 50 Hz apart must interact' + call mtd_make_descriptor(right,1,tones,1050.0,0.5) + if(mtd_descriptors_conflict(left,right)) error stop & + 'frequencies exactly 50 Hz apart must be independent' + call mtd_make_descriptor(left,1,tones,1000.0,-12.5) + call mtd_make_descriptor(right,1,tones,1000.0,14.9) + if(mtd_descriptors_conflict(left,right)) error stop & + 'disjoint subtraction supports must be independent' + if(mtd_start_sample(0.00005).ne.1) error stop & + 'positive fractional start samples must truncate toward zero' + if(mtd_start_sample(-0.00023333333).ne.-1) error stop & + 'negative fractional start samples must truncate toward zero' + end subroutine test_interaction_boundary + + subroutine test_independent_delta_commits() + type(ft8_subtraction_descriptor) :: first,second + real, allocatable :: source(:),worker_one(:),worker_two(:),actual(:) + real, allocatable :: first_delta(:),second_delta(:) + integer(int64) :: first_epoch,first_generation,second_epoch,second_generation + integer :: tones(79),outcome + + allocate(source(mtd_residual_samples),worker_one(mtd_residual_samples), & + worker_two(mtd_residual_samples),actual(mtd_residual_samples), & + first_delta(frame_samples),second_delta(frame_samples)) + source=0.0 + first_delta=0.0 + second_delta=0.0 + first_delta(1)=-1.0 + second_delta(1)=-2.0 + tones=1 + + call mtd_prepare(source,2) + call mtd_publish_worker(1) + call mtd_publish_worker(2) + worker_one=mtd_worker_residual(:,1) + worker_two=mtd_worker_residual(:,2) + call mtd_capture_generation(1,first_epoch,first_generation) + call mtd_capture_generation(2,second_epoch,second_generation) + call mtd_make_descriptor(first,1,tones,1000.0,0.0) + call mtd_make_descriptor(second,1,tones,1100.0,0.0) + + worker_one(1)=worker_one(1)+first_delta(1) + call mtd_try_commit_delta(1,worker_one,first,first_epoch,first_generation, & + first_delta,outcome) + if(outcome.ne.mtd_commit_current) error stop 'first commit was not current' + worker_two(1)=worker_two(1)+second_delta(1) + call mtd_try_commit_delta(2,worker_two,second,second_epoch,second_generation, & + second_delta,outcome) + if(outcome.ne.mtd_commit_independent) error stop & + 'stale independent commit did not use the fast path' + call mtd_finish(actual) + if(actual(1).ne.-3.0) error stop 'independent updates were not both preserved' + if(worker_two(1).ne.-3.0) error stop 'stale worker did not receive canonical state' + end subroutine test_independent_delta_commits + + subroutine test_conflict_and_duplicate() + type(ft8_subtraction_descriptor) :: first,second,duplicate + real, allocatable :: source(:),worker_one(:),worker_two(:),actual(:) + real, allocatable :: delta(:) + integer(int64) :: epoch_one,generation_one,epoch_two,generation_two + integer :: tones(79),outcome + + allocate(source(mtd_residual_samples),worker_one(mtd_residual_samples), & + worker_two(mtd_residual_samples),actual(mtd_residual_samples), & + delta(frame_samples)) + source=0.0 + delta=0.0 + delta(1)=-1.0 + tones=2 + call mtd_prepare(source,2) + call mtd_publish_worker(1) + call mtd_publish_worker(2) + worker_one=mtd_worker_residual(:,1) + worker_two=mtd_worker_residual(:,2) + call mtd_capture_generation(1,epoch_one,generation_one) + call mtd_capture_generation(2,epoch_two,generation_two) + call mtd_make_descriptor(first,1,tones,1000.0,0.0) + call mtd_make_descriptor(second,1,tones,1025.0,0.0) + worker_one(1)=worker_one(1)+delta(1) + call mtd_try_commit_delta(1,worker_one,first,epoch_one,generation_one,delta,outcome) + worker_two(1)=worker_two(1)+delta(1) + call mtd_try_commit_delta(2,worker_two,second,epoch_two,generation_two,delta,outcome) + if(outcome.ne.mtd_commit_conflict) error stop & + 'interacting stale commit must request a refit' + + call mtd_capture_generation(2,epoch_two,generation_two) + worker_two(1)=worker_two(1)+delta(1) + call mtd_try_commit_delta(2,worker_two,second,epoch_two,generation_two,delta,outcome) + if(outcome.ne.mtd_commit_current) error stop 'refitted commit was not published' + + duplicate=second + call mtd_capture_generation(1,epoch_one,generation_one) + worker_one(1)=worker_one(1)+delta(1) + call mtd_try_commit_delta(1,worker_one,duplicate,epoch_one,generation_one, & + delta,outcome) + if(outcome.ne.mtd_commit_duplicate) error stop 'duplicate subtraction was repeated' + call mtd_finish(actual) + if(actual(1).ne.-2.0) error stop 'conflict or duplicate lost transaction state' + end subroutine test_conflict_and_duplicate + + subroutine test_candidate_refresh() + type(ft8_subtraction_descriptor) :: descriptor + real, allocatable :: source(:),worker_one(:) + real, allocatable :: delta(:) + integer(int64) :: epoch,generation + integer :: tones(79),outcome + logical :: newdat1,rebuild + + allocate(source(mtd_residual_samples),worker_one(mtd_residual_samples), & + delta(frame_samples)) + source=0.0 + delta=0.0 + delta(1)=-1.0 + tones=3 + call mtd_prepare(source,2) + call mtd_publish_worker(1) + call mtd_publish_worker(2) + call mtd_mark_spectrum_current(2) + worker_one=mtd_worker_residual(:,1) + call mtd_capture_generation(1,epoch,generation) + call mtd_make_descriptor(descriptor,1,tones,1100.0,0.0) + worker_one(1)=worker_one(1)+delta(1) + call mtd_try_commit_delta(1,worker_one,descriptor,epoch,generation,delta,outcome) + + newdat1=.false. + call mtd_refresh_candidate(2,1000.0,newdat1,rebuild) + if(rebuild) error stop 'far publication unnecessarily invalidated the spectrum' + call mtd_refresh_candidate(2,1100.0,newdat1,rebuild) + if(.not.rebuild) error stop 'near publication did not invalidate the spectrum' + if(mtd_worker_residual(1,2).ne.-1.0) error stop & + 'near publication did not refresh the worker residual' + call mtd_mark_spectrum_current(2) + newdat1=.false. + call mtd_refresh_candidate(2,1100.0,newdat1,rebuild) + if(rebuild) error stop 'current spectrum was invalidated again' + end subroutine test_candidate_refresh + + subroutine test_real_subtractor_equivalence() + real, allocatable :: source(:),expected(:),actual(:) + integer :: i,tones(79),outcome + + allocate(source(mtd_residual_samples),expected(mtd_residual_samples), & + actual(mtd_residual_samples)) + do i=1,mtd_residual_samples + source(i)=0.01*sin(real(i)/300.0) + enddo + tones=0 + cw=cmplx(1.0,0.0) + endcorr=1.0 + expected=source + call subtractft8var(expected,tones,1000.0,0.5) + + call mtd_prepare(source,1) + call mtd_publish_worker(1) + call mtd_commit_subtraction(1,1,tones,1000.0,0.5, & + mtd_worker_residual(:,1),outcome) + call mtd_finish(actual) + if(outcome.ne.mtd_commit_current) error stop & + 'uncontended real subtraction did not use the current path' + if(any(actual.ne.expected)) error stop & + 'prepared delta publication differs from serial subtraction' + end subroutine test_real_subtractor_equivalence + + subroutine test_phase_epoch_conflict() + type(ft8_subtraction_descriptor) :: descriptor + real, allocatable :: source(:),delta(:),worker_residual(:) + integer(int64) :: epoch,generation + integer :: tones(79),outcome + + allocate(source(mtd_residual_samples),delta(frame_samples), & + worker_residual(mtd_residual_samples)) + source=0.0 + delta=0.0 + delta(1)=-1.0 + tones=4 + call mtd_prepare(source,1) + call mtd_publish_worker(1) + worker_residual=mtd_worker_residual(:,1) + call mtd_capture_generation(1,epoch,generation) + call mtd_make_descriptor(descriptor,3,tones,1000.0,0.0) + call mtd_transform_phase(4) + worker_residual(1)=worker_residual(1)+delta(1) + call mtd_try_commit_delta(1,worker_residual,descriptor,epoch,generation, & + delta,outcome) + if(outcome.ne.mtd_commit_conflict) error stop & + 'pre-transform transaction was not rejected' + call mtd_capture_generation(1,epoch,generation) + worker_residual(1)=worker_residual(1)+delta(1) + call mtd_try_commit_delta(1,worker_residual,descriptor,epoch,generation, & + delta,outcome) + if(outcome.ne.mtd_commit_conflict) error stop & + 'stale descriptor epoch was accepted after refresh' + end subroutine test_phase_epoch_conflict + + subroutine test_half_sample_endpoints() + real, allocatable :: residual(:) + + allocate(residual(mtd_residual_samples)) + residual=0.0 + residual(1:3)=[2.0,4.0,8.0] + residual(mtd_residual_samples)=16.0 + call mtd_forward_half_sample(residual) + if(residual(1).ne.3.0 .or. residual(2).ne.6.0) error stop & + 'forward half-sample transform changed interior behavior' + if(residual(mtd_residual_samples).ne.16.0) error stop & + 'forward half-sample transform changed the trailing endpoint' + + residual=0.0 + residual(1:3)=[2.0,4.0,8.0] + call mtd_backward_half_sample(residual) + if(residual(1).ne.2.0) error stop & + 'backward half-sample transform changed the leading endpoint' + if(residual(2).ne.3.0 .or. residual(3).ne.6.0) error stop & + 'backward half-sample transform changed interior behavior' + end subroutine test_half_sample_endpoints + + subroutine test_pass7_restore() + type(ft8_subtraction_descriptor) :: descriptor + real, allocatable :: source(:),expected(:),forward(:),actual(:),delta(:) + integer(int64) :: epoch,generation + integer :: i,tones(79),outcome + + allocate(source(mtd_residual_samples),expected(mtd_residual_samples), & + forward(mtd_residual_samples),actual(mtd_residual_samples), & + delta(frame_samples)) + do i=1,mtd_residual_samples + source(i)=real(mod(i,101)) + enddo + expected=source + call mtd_backward_half_sample(expected) + forward=source + call mtd_forward_half_sample(forward) + delta=0.0 + delta(1)=-1.0 + tones=5 + call mtd_prepare(source,1) + call mtd_transform_phase(4) + call mtd_publish_worker(1) + call mtd_capture_generation(1,epoch,generation) + call mtd_make_descriptor(descriptor,4,tones,1000.0,0.0) + mtd_worker_residual(1,1)=mtd_worker_residual(1,1)+delta(1) + call mtd_try_commit_delta(1,mtd_worker_residual(:,1),descriptor,epoch, & + generation,delta,outcome) + call mtd_finish(actual) + if(all(actual.eq.forward)) error stop & + 'cycle-two transaction did not mutate the forward residual' + call mtd_transform_phase(7) + call mtd_finish(actual) + if(any(actual.ne.expected)) error stop & + 'pass 7 must restore and shift the saved post-pass-3 residual' + end subroutine test_pass7_restore + +end program test_ft8_mtd_residual diff --git a/tests/unit/ft8/test_ft8_mtd_transaction_concurrent.f90 b/tests/unit/ft8/test_ft8_mtd_transaction_concurrent.f90 new file mode 100644 index 00000000..a69b8531 --- /dev/null +++ b/tests/unit/ft8/test_ft8_mtd_transaction_concurrent.f90 @@ -0,0 +1,195 @@ +program test_ft8_mtd_transaction_concurrent + use iso_fortran_env, only : int64 + use omp_lib + use ft8_mtd_residual + implicit none + + integer, parameter :: frame_samples=151680 + + if(omp_get_max_threads().lt.4) error stop 'four OpenMP workers are required' + call test_independent_publishers() + call test_duplicate_publishers() + call test_coherent_snapshots() + +contains + + subroutine test_independent_publishers() + real, allocatable :: source(:),actual(:) + integer :: outcomes(4),worker,tones(79) + integer(int64) :: epoch,generation + type(ft8_subtraction_descriptor) :: descriptor + + allocate(source(mtd_residual_samples),actual(mtd_residual_samples)) + source=0.0 + call mtd_prepare(source,4) + +!$omp parallel num_threads(4) private(worker,tones,epoch,generation,descriptor) + block + real, allocatable :: delta(:) + allocate(delta(frame_samples)) + worker=omp_get_thread_num()+1 + delta=0.0 + delta(1)=-real(worker) + tones=worker + call mtd_publish_worker(worker) + call mtd_capture_generation(worker,epoch,generation) + call mtd_make_descriptor(descriptor,1,tones, & + 800.0+100.0*real(worker),0.0) + mtd_worker_residual(1,worker)=mtd_worker_residual(1,worker)+delta(1) +!$omp barrier + call mtd_try_commit_delta(worker,mtd_worker_residual(:,worker),descriptor, & + epoch,generation,delta,outcomes(worker)) + deallocate(delta) + end block +!$omp end parallel + + call mtd_finish(actual) + if(actual(1).ne.-10.0) error stop 'parallel independent updates were lost' + if(count(outcomes.eq.mtd_commit_current).ne.1) error stop & + 'exactly one same-generation transaction must commit first' + if(count(outcomes.eq.mtd_commit_independent).ne.3) error stop & + 'stale independent transactions did not use the fast path' + end subroutine test_independent_publishers + + subroutine test_duplicate_publishers() + real, allocatable :: source(:),actual(:) + integer :: outcomes(4),worker,tones(79) + integer(int64) :: epoch,generation + type(ft8_subtraction_descriptor) :: descriptor + + allocate(source(mtd_residual_samples),actual(mtd_residual_samples)) + source=0.0 + call mtd_prepare(source,4) + +!$omp parallel num_threads(4) private(worker,epoch,generation,descriptor,tones) + block + real, allocatable :: delta(:) + allocate(delta(frame_samples)) + worker=omp_get_thread_num()+1 + delta=0.0 + delta(1)=-1.0 + tones=7 + call mtd_publish_worker(worker) + call mtd_capture_generation(worker,epoch,generation) + call mtd_make_descriptor(descriptor,1,tones,1000.0,0.0) + mtd_worker_residual(1,worker)=mtd_worker_residual(1,worker)+delta(1) +!$omp barrier + call mtd_try_commit_delta(worker,mtd_worker_residual(:,worker),descriptor, & + epoch,generation,delta,outcomes(worker)) + deallocate(delta) + end block +!$omp end parallel + + call mtd_finish(actual) + if(actual(1).ne.-1.0) error stop 'duplicate transaction was applied more than once' + if(count(outcomes.eq.mtd_commit_current).ne.1) error stop & + 'duplicate race did not produce one winner' + if(count(outcomes.eq.mtd_commit_duplicate).ne.3) error stop & + 'duplicate race did not reject all later publishers' + end subroutine test_duplicate_publishers + + subroutine test_coherent_snapshots() + integer, parameter :: writer_iterations=50,reader_iterations=500 + real, allocatable :: source(:),actual(:) + real :: snapshot_value + integer :: worker,iteration,tones(79),outcome,writers_started,reader_ready, & + first_commits,reader_observed + integer(int64) :: epoch,generation + logical :: torn_snapshot,intermediate_observed + type(ft8_subtraction_descriptor) :: descriptor + + allocate(source(mtd_residual_samples),actual(mtd_residual_samples)) + source=0.0 + torn_snapshot=.false. + intermediate_observed=.false. + writers_started=0 + reader_ready=0 + first_commits=0 + reader_observed=0 + call mtd_prepare(source,4) + +!$omp parallel num_threads(4) private(worker,iteration,tones,outcome,epoch, & +!$omp generation,descriptor,snapshot_value) & +!$omp shared(torn_snapshot,intermediate_observed,writers_started,reader_ready, & +!$omp first_commits,reader_observed) + block + real, allocatable :: delta(:) + allocate(delta(frame_samples)) + worker=omp_get_thread_num()+1 + call mtd_publish_worker(worker) +!$omp barrier + if(worker.le.3) then + delta=-1.0 +!$omp atomic update + writers_started=writers_started+1 + do +!$omp atomic read + outcome=reader_ready + if(outcome.eq.1) exit + enddo + do iteration=1,writer_iterations + tones=0 + tones(1)=iteration + tones(2)=worker + call mtd_make_descriptor(descriptor,1,tones, & + 700.0+100.0*real(worker),0.0) + do + call mtd_capture_generation(worker,epoch,generation) + mtd_worker_residual(1:frame_samples,worker)= & + mtd_worker_residual(1:frame_samples,worker)+delta + call mtd_try_commit_delta(worker,mtd_worker_residual(:,worker), & + descriptor,epoch,generation,delta,outcome) + if(outcome.ne.mtd_commit_conflict) exit + enddo + if(iteration.eq.1) then +!$omp atomic update + first_commits=first_commits+1 + do +!$omp atomic read + outcome=reader_observed + if(outcome.eq.1) exit + enddo + endif + enddo + else + do +!$omp atomic read + outcome=writers_started + if(outcome.eq.3) exit + enddo +!$omp atomic write + reader_ready=1 + do +!$omp atomic read + outcome=first_commits + if(outcome.eq.3) exit + enddo + call mtd_publish_worker(worker) + snapshot_value=-mtd_worker_residual(1,worker) + intermediate_observed=snapshot_value.eq.3.0 +!$omp atomic write + reader_observed=1 + do iteration=1,reader_iterations + call mtd_publish_worker(worker) + if(minval(mtd_worker_residual(1:frame_samples,worker)).ne. & + maxval(mtd_worker_residual(1:frame_samples,worker))) & + torn_snapshot=.true. + snapshot_value=-mtd_worker_residual(1,worker) + if(snapshot_value.gt.0.0 .and. & + snapshot_value.lt.real(3*writer_iterations)) & + intermediate_observed=.true. + enddo + endif + deallocate(delta) + end block +!$omp end parallel + + if(torn_snapshot) error stop 'reader observed a torn canonical snapshot' + if(.not.intermediate_observed) error stop & + 'coherence reader did not overlap the publishers' + call mtd_finish(actual) + if(actual(1).ne.-real(3*writer_iterations)) error stop & + 'coherence stress did not publish every transaction' + end subroutine test_coherent_snapshots + +end program test_ft8_mtd_transaction_concurrent diff --git a/tests/unit/hash/CMakeLists.txt b/tests/unit/hash/CMakeLists.txt new file mode 100644 index 00000000..79dfd8c0 --- /dev/null +++ b/tests/unit/hash/CMakeLists.txt @@ -0,0 +1,8 @@ +add_executable (test_lookup3 + test_lookup3.c + ${CMAKE_SOURCE_DIR}/lib/lookup3.c + ${CMAKE_SOURCE_DIR}/lib/wsprd/nhash.c + ${CMAKE_SOURCE_DIR}/lib/wsprcode/nhash.c + ${CMAKE_SOURCE_DIR}/lib/superfox/qpc/nhash2.c) + +add_test (NAME test_lookup3 COMMAND test_lookup3) diff --git a/tests/unit/hash/test_lookup3.c b/tests/unit/hash/test_lookup3.c new file mode 100644 index 00000000..11ea1ac8 --- /dev/null +++ b/tests/unit/hash/test_lookup3.c @@ -0,0 +1,111 @@ +#include +#include +#include + +#include "lib/lookup3.h" +#include "lib/superfox/qpc/nhash2.h" +#include "lib/wsprd/nhash.h" + +uint32_t nhash_(const void *key, int *length, uint32_t *initval); + +static const uint32_t expected_hashes[] = { + UINT32_C(0xdeadc12a), UINT32_C(0x1b94435d), UINT32_C(0xd2deb219), + UINT32_C(0x6155e046), UINT32_C(0xf9db3ff3), UINT32_C(0x999875df), + UINT32_C(0xcf4a698e), UINT32_C(0x11d73cee), UINT32_C(0x06349a85), + UINT32_C(0x434bac56), UINT32_C(0x11ead3ab), UINT32_C(0x4c191765), + UINT32_C(0xf4195417), UINT32_C(0xe8d7137c), UINT32_C(0x2e8d5a88), + UINT32_C(0xb0414d93), UINT32_C(0x07c55374), UINT32_C(0x110c468c), + UINT32_C(0x4afa5bbc), UINT32_C(0x4944bccc), UINT32_C(0x4cbb7a1b), + UINT32_C(0x18516846), UINT32_C(0x3b97ae23), UINT32_C(0x44867164), + UINT32_C(0x3002d5f9), UINT32_C(0x595cdc5d), UINT32_C(0xec15a036), + UINT32_C(0xc0d1e3b0), UINT32_C(0x7f471a40), UINT32_C(0x04391f70), + UINT32_C(0xbceebda2), UINT32_C(0xa5721abb), UINT32_C(0x365f9634), + UINT32_C(0x086509a4), UINT32_C(0xc87ed5da), UINT32_C(0xd16fd5fd), + UINT32_C(0xa7ca90d1), UINT32_C(0xfe888aa0), UINT32_C(0xab82ce67), + UINT32_C(0xbd2683b1), UINT32_C(0x5ce3f5eb), UINT32_C(0xe526881b), + UINT32_C(0x4f2ad0bc), UINT32_C(0x083f24ee), UINT32_C(0xee9ebcad), + UINT32_C(0x7b890b41), UINT32_C(0x5f600c7a), UINT32_C(0xf9307a08), + UINT32_C(0x9025c6d7), UINT32_C(0x8bf9cd5c), UINT32_C(0x5e7fc68f), + UINT32_C(0x980ec2aa), UINT32_C(0xcfef4469), UINT32_C(0x51df097b), + UINT32_C(0xf716bb46), UINT32_C(0x5ccbf75a), UINT32_C(0x2b345185), + UINT32_C(0x6a53fdc1), UINT32_C(0x4b3f9153), UINT32_C(0x0c5cb07a), + UINT32_C(0xcdad2a44), UINT32_C(0x434b9089), UINT32_C(0x08a090f3), + UINT32_C(0x504ccef9), UINT32_C(0x8183308b) +}; + +static int failures; + +static void expect_hash(const char *api, size_t offset, size_t length, + uint32_t actual, uint32_t expected) +{ + if (actual != expected) { + fprintf(stderr, + "%s offset %zu length %zu: expected %08x, got %08x\n", + api, offset, length, expected, actual); + ++failures; + } +} + +static unsigned char test_byte(size_t index, size_t length) +{ + return (unsigned char)(index * 37U + length * 11U); +} + +int main(void) +{ + const uint32_t seed = UINT32_C(571); + + for (size_t offset = 0; offset < 4; ++offset) { + for (size_t length = 0; length < sizeof expected_hashes / sizeof *expected_hashes; + ++length) { + size_t allocation_size = offset + length; + if (allocation_size == 0) allocation_size = 1; + unsigned char *allocation = malloc(allocation_size); + if (allocation == NULL) { + fputs("allocation failed\n", stderr); + return 2; + } + + unsigned char *key = allocation + offset; + for (size_t i = 0; i < length; ++i) key[i] = test_byte(i, length); + + uint32_t expected = expected_hashes[length]; + expect_hash("wsjt_hashlittle", offset, length, + wsjt_hashlittle(key, length, seed), expected); + expect_hash("nhash2", offset, length, + nhash2(key, length, seed), expected); + + uint32_t wspr_expected = length == 0 ? expected : expected & UINT32_C(0x7fff); + expect_hash("nhash", offset, length, + nhash(key, length, seed), wspr_expected); + + int legacy_length = (int)length; + uint32_t legacy_seed = seed; + expect_hash("nhash_", offset, length, + nhash_(key, &legacy_length, &legacy_seed), expected); + free(allocation); + } + } + + unsigned char superfox_symbols[47]; + for (size_t i = 0; i < sizeof superfox_symbols; ++i) { + superfox_symbols[i] = (unsigned char)i; + } + uint32_t superfox_crc = nhash2(superfox_symbols, sizeof superfox_symbols, + seed) & UINT32_C(0x1fffff); + expect_hash("SuperFox CRC21", 0, sizeof superfox_symbols, + superfox_crc, UINT32_C(0x14d1ab)); + + unsigned char abc[] = {'a', 'b', 'c'}; + expect_hash("seed 146 empty", 0, 0, + wsjt_hashlittle(abc, 0, UINT32_C(146)), UINT32_C(0xdeadbf81)); + expect_hash("seed 146 abc", 0, sizeof abc, + wsjt_hashlittle(abc, sizeof abc, UINT32_C(146)), + UINT32_C(0x3f227c14)); + expect_hash("WSPR seed 146 abc", 0, sizeof abc, + nhash(abc, sizeof abc, UINT32_C(146)), UINT32_C(0x7c14)); + + if (failures != 0) return 1; + puts("lookup3 tests passed: 260 aligned and unaligned vectors"); + return 0; +} diff --git a/tests/unit/jpl/CMakeLists.txt b/tests/unit/jpl/CMakeLists.txt new file mode 100644 index 00000000..afaf718f --- /dev/null +++ b/tests/unit/jpl/CMakeLists.txt @@ -0,0 +1,48 @@ +add_executable (test_jpl_setup test_jpl_setup.f90) +wsjt_link_common_fortran (test_jpl_setup) + +add_test (NAME test_jpl_setup COMMAND test_jpl_setup) + +add_executable (test_emedop ../../../lib/emedop.f90) +wsjt_link_common_fortran (test_emedop) + +add_test (NAME test_emedop_invalid_start + COMMAND test_emedop emedop_invalid_start.txt) +set_tests_properties (test_emedop_invalid_start PROPERTIES + PASS_REGULAR_EXPRESSION "Invalid date or time in input file" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +add_test (NAME test_emedop_cross_date + COMMAND test_emedop emedop_cross_date.txt) +set_tests_properties (test_emedop_cross_date PROPERTIES + PASS_REGULAR_EXPRESSION "Start and stop dates must be the same" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +add_executable (test_jpl_resilience test_jpl_resilience.f90) +wsjt_link_common_fortran (test_jpl_resilience) + +set (jpl_ephemeris_file "${CMAKE_SOURCE_DIR}/contrib/Ephemeris/JPLEPH") +set (jpl_resilience_scenarios + valid_reference + unit_collision + missing_fallback + analytic_failure + truncated_header + truncated_coefficients + absurd_coefficients + invalid_header + out_of_range + nonfinite_epoch + invalid_input + blank_grid_compatibility + optional_sections + source_transition) + +foreach (scenario IN LISTS jpl_resilience_scenarios) + set (test_name "test_jpl_resilience_${scenario}") + add_test (NAME ${test_name} + COMMAND test_jpl_resilience ${scenario} ${jpl_ephemeris_file}) + set_tests_properties (${test_name} PROPERTIES + PASS_REGULAR_EXPRESSION "PASS ${scenario}" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +endforeach () diff --git a/tests/unit/jpl/emedop_cross_date.txt b/tests/unit/jpl/emedop_cross_date.txt new file mode 100644 index 00000000..d30f109c --- /dev/null +++ b/tests/unit/jpl/emedop_cross_date.txt @@ -0,0 +1,8 @@ + 40 + 105 + 41 + 75 + 144000000 + 20240101 12 00 00 + 20240102 12 01 00 + 60 diff --git a/tests/unit/jpl/emedop_invalid_start.txt b/tests/unit/jpl/emedop_invalid_start.txt new file mode 100644 index 00000000..587a6889 --- /dev/null +++ b/tests/unit/jpl/emedop_invalid_start.txt @@ -0,0 +1,8 @@ + 40 + 105 + 41 + 75 + 144000000 + 20240230 12 00 00 + 20240230 12 01 00 + 60 diff --git a/tests/unit/jpl/test_jpl_resilience.f90 b/tests/unit/jpl/test_jpl_resilience.f90 new file mode 100644 index 00000000..b37cd470 --- /dev/null +++ b/tests/unit/jpl/test_jpl_resilience.f90 @@ -0,0 +1,693 @@ +program test_jpl_resilience + use iso_c_binding, only: c_bool, c_char, c_double, c_int, c_loc, & + c_null_char + use iso_fortran_env, only: int8, real64 + use ieee_arithmetic, only: ieee_is_finite, ieee_value, & + ieee_quiet_nan, ieee_positive_inf + use astro_module, only: astrosub + use jpl_ephemeris_status + implicit none + + character(len=64) :: scenario + character(len=1024) :: source_path + + call get_command_argument(1,scenario) + call get_command_argument(2,source_path) + if(len_trim(scenario).eq.0 .or. len_trim(source_path).eq.0) error stop 1 + + select case(trim(scenario)) + case('valid_reference') + call test_valid_reference(trim(source_path)) + case('unit_collision') + call test_unit_collision(trim(source_path)) + case('missing_fallback') + call test_missing_fallback() + case('analytic_failure') + call test_analytic_failure() + case('truncated_header') + call test_truncated_header(trim(source_path)) + case('truncated_coefficients') + call test_truncated_coefficients(trim(source_path)) + case('absurd_coefficients') + call test_absurd_coefficients(trim(source_path)) + case('invalid_header') + call test_invalid_header(trim(source_path)) + case('out_of_range') + call test_out_of_range(trim(source_path)) + case('nonfinite_epoch') + call test_nonfinite_epoch(trim(source_path)) + case('invalid_input') + call test_invalid_input() + case('blank_grid_compatibility') + call test_blank_grid_compatibility(trim(source_path)) + case('optional_sections') + call test_optional_sections(trim(source_path)) + case('source_transition') + call test_source_transition(trim(source_path)) + case default + error stop 2 + end select + + print '(a)', 'PASS '//trim(scenario) + +contains + + subroutine test_valid_reference(path) + character(len=*), intent(in) :: path + real(real64) :: vector(6) + real(real64), parameter :: expected(6) = [ & + -6.141033948345347e-4_real64,-2.105916028962251e-3_real64, & + -9.713000936360162e-4_real64, 6.128034786394336e-4_real64, & + -1.145724331397477e-4_real64,-1.097685197949237e-4_real64] + integer :: status + + call configure(path) + call pleph(2459580.5_real64,10,3,vector,status) + call require(status.eq.JPL_STATUS_OK,'valid JPL status') + call require(maxval(abs(vector-expected)).lt.1.0e-14_real64, & + 'fixed reference vector') + end subroutine test_valid_reference + + subroutine test_unit_collision(path) + character(len=*), intent(in) :: path + real(real64) :: vector(6) + integer :: status + logical :: opened + + open(12,status='scratch',action='readwrite') + call configure(path) + call pleph(2459580.5_real64,10,3,vector,status) + inquire(unit=12,opened=opened) + call require(status.eq.JPL_STATUS_OK,'JPL with occupied unit 12') + call require(opened,'unit 12 preserved') + close(12) + end subroutine test_unit_collision + + subroutine test_missing_fallback() + real(real64) :: fallback(8),forced(8) + real(real64) :: vector(6),pvsun(6) + integer :: result,status + logical :: km,bary + common/stcomx/km,bary,pvsun + + call configure('missing-jpleph') + call ephem_values(60310.5_real64,0,fallback,result) + call require(result.eq.EPHEMERIS_ANALYTIC_FALLBACK, & + 'missing file fallback status') + call ephem_values(60310.5_real64,8,forced,result) + call require(result.eq.EPHEMERIS_ANALYTIC_FALLBACK, & + 'forced analytic status') + call require(maxval(abs(fallback-forced)).lt.1.0e-10_real64, & + 'missing file matches analytic calculation') + + bary=.false. + km=.false. + call configure('another-missing-jpleph') + call pleph(2459580.5_real64,10,3,vector,status) + call require(status.eq.JPL_STATUS_IO_ERROR,'missing file status') + call require(all(vector.eq.0.0_real64),'failed PLEPH zero output') + call require(.not.bary,'failed PLEPH restores BARY') + end subroutine test_missing_fallback + + subroutine test_analytic_failure() + real(real64) :: outputs(8) + integer :: result + + call configure('missing-analytic-failure.jpl') + call ephem_values(1.0e200_real64,0,outputs,result) + call require(result.eq.EPHEMERIS_UNAVAILABLE, & + 'analytic failure status') + call require(all(outputs.eq.0.0_real64), & + 'analytic failure zero outputs') + end subroutine test_analytic_failure + + subroutine test_truncated_header(path) + character(len=*), intent(in) :: path + integer(int8) :: bytes(128) + integer :: input,output,ios,result + real(real64) :: values(8) + + open(newunit=input,file=path,access='stream',form='unformatted', & + status='old',action='read') + read(input,iostat=ios) bytes + call require(ios.eq.0,'read source header prefix') + close(input) + open(newunit=output,file='truncated-header.jpl',access='stream', & + form='unformatted',status='replace',action='write') + write(output) bytes + close(output) + call configure('truncated-header.jpl') + call ephem_values(60310.5_real64,0,values,result) + call require(result.eq.EPHEMERIS_ANALYTIC_FALLBACK, & + 'truncated header fallback') + end subroutine test_truncated_header + + subroutine test_truncated_coefficients(path) + character(len=*), intent(in) :: path + character(len=6) :: names(1000) + integer :: result,status,n + real(real64) :: values(8),constants(1000),range(3),vector(6) + + call copy_records(path,'header-only.jpl',2) + call configure('header-only.jpl') + call ephem_values(60310.5_real64,0,values,result) + call require(result.eq.EPHEMERIS_ANALYTIC_FALLBACK, & + 'missing coefficient record fallback') + + call configure(path) + call const(names,constants,range,n) + call require(n.gt.0,'read source ephemeris range') + call copy_records(path,'truncated-coefficients.jpl',3) + call truncate_last_record('truncated-coefficients.jpl') + call configure('truncated-coefficients.jpl') + call pleph(range(1)+0.5_real64*range(3),10,3,vector,status) + call require(status.eq.JPL_STATUS_IO_ERROR, & + 'partial third coefficient record status') + call require(all(vector.eq.0.0_real64), & + 'partial coefficient read zero output') + end subroutine test_truncated_coefficients + + subroutine test_absurd_coefficients(path) + character(len=*), intent(in) :: path + real(real64) :: fallback(8),forced(8),mjd + integer :: result + + call copy_records(path,'absurd-coefficients.jpl',3) + call rewrite_absurd_lunar_coefficients('absurd-coefficients.jpl',mjd) + call configure('absurd-coefficients.jpl') + call ephem_values(mjd,0,fallback,result) + call require(result.eq.EPHEMERIS_ANALYTIC_FALLBACK, & + 'absurd finite coefficients trigger fallback') + call require(all(ieee_is_finite(fallback)), & + 'absurd coefficient fallback remains finite') + call ephem_values(mjd,8,forced,result) + call require(maxval(abs(fallback-forced)).lt.1.0e-10_real64, & + 'absurd coefficient fallback is atomic') + end subroutine test_absurd_coefficients + + subroutine test_invalid_header(path) + character(len=*), intent(in) :: path + integer :: result,status + real(real64) :: values(8),vector(6),record_epoch + + call copy_records(path,'invalid-header.jpl',3) + call rewrite_header('invalid-header.jpl',.true.,.false.,.false.) + call configure('invalid-header.jpl') + call ephem_values(60310.5_real64,0,values,result) + call require(result.eq.EPHEMERIS_ANALYTIC_FALLBACK, & + 'invalid header fallback') + + call copy_records(path,'invalid-ncon.jpl',3) + call rewrite_ncon('invalid-ncon.jpl') + call configure('invalid-ncon.jpl') + call ephem_values(60310.5_real64,0,values,result) + call require(result.eq.EPHEMERIS_ANALYTIC_FALLBACK, & + 'oversized constant count fallback') + + call copy_records(path,'invalid-coefficient-count.jpl',3) + call rewrite_header('invalid-coefficient-count.jpl',.false., & + .false.,.true.) + call configure('invalid-coefficient-count.jpl') + call ephem_values(60310.5_real64,0,values,result) + call require(result.eq.EPHEMERIS_ANALYTIC_FALLBACK, & + 'oversized interpolation coefficient count fallback') + + call copy_records(path,'invalid-record-step.jpl',3) + call rewrite_header('invalid-record-step.jpl',.false.,.false., & + .false.,.true.,record_epoch) + call configure('invalid-record-step.jpl') + call pleph(record_epoch,10,3,vector,status) + call require(status.eq.JPL_STATUS_INVALID_HEADER, & + 'unrepresentable record index status') + call require(all(vector.eq.0.0_real64), & + 'unrepresentable record index zero output') + end subroutine test_invalid_header + + subroutine test_out_of_range(path) + character(len=*), intent(in) :: path + real(real64) :: vector(6) + integer :: status + + call configure(path) + call pleph(1.0_real64,10,3,vector,status) + call require(status.eq.JPL_STATUS_OUT_OF_RANGE,'early range status') + call pleph(1.0e9_real64,10,3,vector,status) + call require(status.eq.JPL_STATUS_OUT_OF_RANGE,'late range status') + call pleph(2459580.5_real64,16,3,vector,status) + call require(status.eq.JPL_STATUS_INVALID_REQUEST, & + 'invalid target status') + call require(all(vector.eq.0.0_real64),'invalid target zero output') + call pleph(2459580.5_real64,16,16,vector,status) + call require(status.eq.JPL_STATUS_INVALID_REQUEST, & + 'equal invalid target status') + end subroutine test_out_of_range + + subroutine test_nonfinite_epoch(path) + character(len=*), intent(in) :: path + real(real64) :: vector(6),epoch + integer :: status + + call configure(path) + epoch=ieee_value(0.0_real64,ieee_quiet_nan) + call pleph(epoch,10,3,vector,status) + call require(status.eq.JPL_STATUS_INVALID_REQUEST,'NaN epoch status') + call require(all(vector.eq.0.0_real64),'NaN epoch zero output') + + epoch=ieee_value(0.0_real64,ieee_positive_inf) + call pleph(epoch,10,3,vector,status) + call require(status.eq.JPL_STATUS_INVALID_REQUEST, & + 'infinite epoch status') + call require(all(vector.eq.0.0_real64),'infinite epoch zero output') + end subroutine test_nonfinite_epoch + + subroutine test_invalid_input() + real :: outputs(8),astro_outputs(19) + real :: uth + integer :: result,values(8),year,month,day,ntsky + + call moon_values(2024,2,30,12.0,outputs,result) + call require(result.eq.EPHEMERIS_INVALID_INPUT,'invalid date status') + call require(all(outputs.eq.0.0),'invalid date zero outputs') + call moon_values(2024,1,1,24.0,outputs,result) + call require(result.eq.EPHEMERIS_INVALID_INPUT,'invalid UT status') + call require(all(outputs.eq.0.0),'invalid UT zero outputs') + call direct_astro_values(24.0,astro_outputs,ntsky,result) + call require(result.eq.EPHEMERIS_INVALID_INPUT, & + 'astro propagates integer invalid status') + call require(ntsky.eq.0 .and. all(astro_outputs.eq.0.0), & + 'astro clears invalid derived outputs') + + values=[2024,1,1,60,0,15,0,0] + call normalize_utc_calendar(values,year,month,day,uth) + call require(year.eq.2023 .and. month.eq.12 .and. day.eq.31, & + 'UTC calendar borrows across year') + call require(abs(uth-23.25).lt.1.0e-5,'UTC hour after borrow') + + values=[2023,12,31,-60,23,45,0,0] + call normalize_utc_calendar(values,year,month,day,uth) + call require(year.eq.2024 .and. month.eq.1 .and. day.eq.1, & + 'UTC calendar carries across year') + call require(abs(uth-0.75).lt.1.0e-5,'UTC hour after carry') + + values=[2024,3,1,60,0,30,0,0] + call normalize_utc_calendar(values,year,month,day,uth) + call require(year.eq.2024 .and. month.eq.2 .and. day.eq.29, & + 'UTC calendar handles leap day') + end subroutine test_invalid_input + + subroutine test_blank_grid_compatibility(path) + character(len=*), intent(in) :: path + character(len=6) :: blank_grid=' ' + character(len=6) :: legacy_grid='BB44mm' + character(len=6) :: valid_grid='FN20qi' + character(len=6) :: dx_grid='JN18du' + real(real64) :: blank_values(20),legacy_values(20),blank_dx_values(20) + real(real64) :: both_blank_values(20) + real(c_double) :: blank_sub_values(14),legacy_sub_values(14) + real(c_double) :: blank_dx_sub_values(14) + integer :: blank_integers(3),legacy_integers(3),blank_dx_integers(3) + integer :: both_blank_integers(3),result + integer(c_int) :: blank_sub_integers(3),legacy_sub_integers(3) + integer(c_int) :: blank_dx_sub_integers(3),sub_result + + call configure(path) + call grid_astro_values(blank_grid,dx_grid,blank_values, & + blank_integers,result) + call require(result.eq.EPHEMERIS_JPL,'blank local grid status') + + call grid_astro_values(legacy_grid,dx_grid,legacy_values, & + legacy_integers,result) + call require(result.eq.EPHEMERIS_JPL,'legacy local grid status') + call require(maxval(abs(blank_values(1:15)- & + legacy_values(1:15))).lt.1.0e-10_real64, & + 'blank local grid legacy values') + call require(maxval(abs(blank_values(17:20)- & + legacy_values(17:20))).lt.1.0e-10_real64, & + 'blank local grid legacy widths and delay') + call require(all(blank_integers.eq.legacy_integers), & + 'blank local grid legacy integer values') + + call astrosub_values(blank_grid,dx_grid,path,blank_sub_values, & + blank_sub_integers,sub_result) + call require(sub_result.eq.EPHEMERIS_JPL, & + 'blank local grid astrosub status') + call astrosub_values(legacy_grid,dx_grid,path,legacy_sub_values, & + legacy_sub_integers,sub_result) + call require(sub_result.eq.EPHEMERIS_JPL, & + 'legacy local grid astrosub status') + call require(maxval(abs(blank_sub_values-legacy_sub_values)).lt. & + 1.0e-10_real64,'blank local grid astrosub legacy values') + call require(all(blank_sub_integers.eq.legacy_sub_integers), & + 'blank local grid astrosub legacy integer values') + + call grid_astro_values(valid_grid,blank_grid,blank_dx_values, & + blank_dx_integers,result) + call require(result.eq.EPHEMERIS_JPL,'blank DX grid status') + call require(blank_dx_values(18).eq.blank_dx_values(17), & + 'blank DX grid uses self width') + call require(blank_dx_values(14).eq.0.0_real64, & + 'blank DX grid clears MNR') + + call astrosub_values(valid_grid,blank_grid,path, & + blank_dx_sub_values,blank_dx_sub_integers,sub_result) + call require(sub_result.eq.EPHEMERIS_JPL, & + 'blank DX grid astrosub status') + call require(all(blank_dx_sub_values([5,6,11,14]).eq. & + 0.0_real64),'blank DX grid clears astrosub DX values') + call require(blank_dx_sub_integers(2).eq.0, & + 'blank DX grid clears astrosub Doppler') + call require(maxval(abs(blank_dx_sub_values(1:4)- & + blank_dx_values(1:4))).lt.1.0e-10_real64, & + 'blank DX grid preserves local azimuth and elevation') + call require(blank_dx_sub_values(13).eq.blank_dx_values(17), & + 'blank DX grid preserves self width') + call require(blank_dx_sub_integers(1).eq.blank_dx_integers(1) & + .and. blank_dx_sub_integers(3).eq.blank_dx_integers(3), & + 'blank DX grid preserves local integer values') + + call grid_astro_values(blank_grid,blank_grid,both_blank_values, & + both_blank_integers,result) + call require(result.eq.EPHEMERIS_JPL,'both grids blank status') + call require(all(ieee_is_finite(both_blank_values)), & + 'both grids blank finite values') + call require(both_blank_values(20).gt.0.0_real64, & + 'both grids blank echo delay') + + call configure('missing-blank-grid.jpl') + call grid_astro_values(blank_grid,blank_grid,both_blank_values, & + both_blank_integers,result) + call require(result.eq.EPHEMERIS_ANALYTIC_FALLBACK, & + 'blank grids preserve analytic fallback') + call astrosub_values(blank_grid,blank_grid, & + 'missing-blank-grid.jpl',blank_dx_sub_values, & + blank_dx_sub_integers,sub_result) + call require(sub_result.eq.EPHEMERIS_ANALYTIC_FALLBACK, & + 'blank grids preserve astrosub analytic fallback') + call require(all(blank_dx_sub_values([5,6,11,14]).eq. & + 0.0_real64) .and. blank_dx_sub_integers(2).eq.0, & + 'blank grids preserve astrosub DX clearing') + end subroutine test_blank_grid_compatibility + + subroutine test_optional_sections(path) + character(len=*), intent(in) :: path + real(real64) :: vector(6) + integer :: status + + call copy_records(path,'no-optional-sections.jpl',3) + call rewrite_header('no-optional-sections.jpl',.false.,.true., & + .false.) + call configure('no-optional-sections.jpl') + call pleph(2459580.5_real64,14,0,vector,status) + call require(status.eq.JPL_STATUS_NOT_AVAILABLE, & + 'absent nutation status') + call pleph(2459580.5_real64,15,0,vector,status) + call require(status.eq.JPL_STATUS_NOT_AVAILABLE, & + 'absent libration status') + end subroutine test_optional_sections + + subroutine test_source_transition(path) + character(len=*), intent(in) :: path + real(real64) :: dfdt,dfdt0 + integer :: result + real :: fspread_self,fspread_dx + common/echocom2/fspread_self,fspread_dx + + call configure(path) + call astro_values(12.0_real64,dfdt,dfdt0,result) + call require(result.eq.EPHEMERIS_JPL,'transition starts with JPL') + call astro_values(12.001_real64,dfdt,dfdt0,result) + call require(abs(dfdt)+abs(dfdt0).gt.0.0_real64, & + 'transition establishes derivative history') + call configure(path) + call astro_values(12.002_real64,dfdt,dfdt0,result) + call require(result.eq.EPHEMERIS_JPL,'reader reset retains JPL') + call require(dfdt.eq.0.0_real64 .and. dfdt0.eq.0.0_real64, & + 'reader generation resets derivative') + call astro_values(24.0_real64,dfdt,dfdt0,result) + call require(result.eq.EPHEMERIS_INVALID_INPUT, & + 'transition rejects invalid input') + call require(fspread_self.eq.0.0 .and. fspread_dx.eq.0.0, & + 'invalid input clears saved echo spreads') + call astro_values(12.003_real64,dfdt,dfdt0,result) + call require(result.eq.EPHEMERIS_JPL,'transition recovers JPL') + call require(dfdt.eq.0.0_real64 .and. dfdt0.eq.0.0_real64, & + 'invalid input resets derivative history') + call configure('missing-transition.jpl') + call astro_values(12.004_real64,dfdt,dfdt0,result) + call require(result.eq.EPHEMERIS_ANALYTIC_FALLBACK, & + 'transition enters fallback') + call require(dfdt.eq.0.0_real64 .and. dfdt0.eq.0.0_real64, & + 'source transition resets derivative') + call astro_values(12.005_real64,dfdt,dfdt0,result) + call require(result.eq.EPHEMERIS_ANALYTIC_FALLBACK, & + 'failed configuration remains in fallback') + call configure(path) + call astro_values(12.006_real64,dfdt,dfdt0,result) + call require(result.eq.EPHEMERIS_JPL, & + 'configuration reset retries JPL') + call require(dfdt.eq.0.0_real64 .and. dfdt0.eq.0.0_real64, & + 'configuration reset clears derivative history') + end subroutine test_source_transition + + subroutine configure(path) + character(len=*), intent(in) :: path + character(len=256) :: configured + + configured=path + call jpl_setup(configured) + end subroutine configure + + subroutine ephem_values(mjd,nspecial,values,result) + real(real64), intent(in) :: mjd + integer, intent(in) :: nspecial + real(real64), intent(out) :: values(8) + integer, intent(out) :: result + + call ephem(mjd,-0.460_real64,-1.8326_real64,0.7106_real64, & + 40.0_real64,nspecial,values(1),values(2),values(3), & + values(4),values(5),values(6),values(7),values(8),result) + end subroutine ephem_values + + subroutine moon_values(year,month,day,uth,outputs,result) + integer, intent(in) :: year,month,day + real, intent(in) :: uth + real, intent(out) :: outputs(8) + integer, intent(out) :: result + + call MoonDopJPL(year,month,day,uth,-105.0,40.0,outputs(1), & + outputs(2),outputs(3),outputs(4),outputs(5),outputs(6), & + outputs(7),outputs(8),result) + end subroutine moon_values + + subroutine direct_astro_values(uth,outputs,ntsky,result) + real, intent(in) :: uth + real, intent(out) :: outputs(19) + integer, intent(out) :: ntsky,result + character(len=6) :: grid='FN20qi' + + call astro(2024,1,1,uth,144000000.0_real64,grid,1,1, & + outputs(1),outputs(2),outputs(3),outputs(4),ntsky, & + outputs(5),outputs(6),outputs(7),outputs(8),outputs(9), & + outputs(10),outputs(11),outputs(12),outputs(13), & + outputs(14),outputs(15),outputs(16),outputs(17), & + outputs(18),outputs(19),result) + end subroutine direct_astro_values + + subroutine astro_values(uth,dfdt,dfdt0,result) + real(real64), intent(in) :: uth + real(real64), intent(out) :: dfdt,dfdt0 + integer, intent(out) :: result + real(real64) :: output(17),width1,width2,techo + integer :: ntsky,ndop,ndop00 + character(len=6) :: mygrid='FN20qi',hisgrid='JN18du' + + call astro0(2024,1,1,uth,144000000.0_real64,mygrid,hisgrid, & + output(1),output(2),output(3),output(4),output(5), & + output(6),ntsky,ndop,ndop00,output(7),output(8),output(9), & + output(10),output(11),output(12),output(13),output(14), & + dfdt,dfdt0,width1,width2,output(15),techo,result) + end subroutine astro_values + + subroutine grid_astro_values(mygrid,hisgrid,values,integer_values, & + result) + character(len=6), intent(in) :: mygrid,hisgrid + real(real64), intent(out) :: values(20) + integer, intent(out) :: integer_values(3),result + + call astro0(2024,1,1,12.0_real64,144000000.0_real64,mygrid, & + hisgrid,values(1),values(2),values(3),values(4),values(5), & + values(6),integer_values(1),integer_values(2), & + integer_values(3),values(7),values(8),values(9),values(10),& + values(11),values(12),values(13),values(14),values(15), & + values(16),values(17),values(18),values(19),values(20), & + result) + end subroutine grid_astro_values + + subroutine astrosub_values(mygrid,hisgrid,jpl_path,values, & + integer_values,result) + character(len=*), intent(in) :: mygrid,hisgrid,jpl_path + real(c_double), intent(out) :: values(14) + integer(c_int), intent(out) :: integer_values(3),result + character(kind=c_char), target :: mygrid_c(7),hisgrid_c(7) + character(kind=c_char), target :: azel_file_c(64),jpl_path_c(1025) + + call assign_c_string(mygrid,mygrid_c) + call assign_c_string(hisgrid,hisgrid_c) + call assign_c_string('blank-grid-azel.dat',azel_file_c) + call assign_c_string(jpl_path,jpl_path_c) + call astrosub(2024_c_int,1_c_int,1_c_int,12.0_c_double, & + 144000000.0_c_double,c_loc(mygrid_c),c_loc(hisgrid_c), & + values(1),values(2),values(3),values(4),values(5), & + values(6),integer_values(1),integer_values(2), & + integer_values(3),values(7),values(8),values(9),values(10),& + values(11),.false._c_bool,values(12),values(13),values(14), & + .false._c_bool,c_loc(azel_file_c),c_loc(jpl_path_c),result) + end subroutine astrosub_values + + subroutine assign_c_string(value,buffer) + character(len=*), intent(in) :: value + character(kind=c_char), intent(out) :: buffer(:) + integer :: i,count + + buffer=c_null_char + count=min(len_trim(value),size(buffer)-1) + do i=1,count + buffer(i)=value(i:i) + enddo + end subroutine assign_c_string + + subroutine copy_records(source,destination,count) + character(len=*), intent(in) :: source,destination + integer, intent(in) :: count + integer(int8) :: record(8144) + integer :: input,output,index,ios + + open(newunit=input,file=source,access='stream',form='unformatted',& + status='old',action='read') + open(newunit=output,file=destination,access='stream', & + form='unformatted',status='replace',action='write') + do index=1,count + read(input,iostat=ios) record + call require(ios.eq.0,'copy source record') + write(output) record + enddo + close(input) + close(output) + end subroutine copy_records + + subroutine truncate_last_record(path) + character(len=*), intent(in) :: path + integer(int8) :: bytes(2*8144+256) + integer :: input,output,ios + + open(newunit=input,file=path,access='stream',form='unformatted', & + status='old',action='read') + read(input,iostat=ios) bytes + call require(ios.eq.0,'read truncated coefficient prefix') + close(input) + open(newunit=output,file=path,access='stream',form='unformatted',& + status='replace',action='write') + write(output) bytes + close(output) + end subroutine truncate_last_record + + subroutine rewrite_absurd_lunar_coefficients(path,mjd) + character(len=*), intent(in) :: path + real(real64), intent(out) :: mjd + character(len=6) :: ttl(14,3),cnam(1000) + real(real64) :: ss(3),au,emrat,coefficients(1018) + integer :: unit,ios,ncon,numde,ipt(3,13),index,j,set_index,first,ncf + + open(newunit=unit,file=path,access='direct',form='unformatted', & + recl=8144,status='old',action='readwrite') + read(unit,rec=1,iostat=ios) ttl,(cnam(index),index=1,400),ss, & + ncon,au,emrat,((ipt(index,j),index=1,3),j=1,12),numde, & + (ipt(index,13),index=1,3) + call require(ios.eq.0,'read absurd coefficient header') + read(unit,rec=3,iostat=ios) coefficients + call require(ios.eq.0,'read coefficient record for corruption') + ncf=ipt(2,10) + do set_index=1,ipt(3,10) + first=ipt(1,10)+(set_index-1)*3*ncf + coefficients(first:first+3*ncf-1)=0.0_real64 + coefficients(first)=1.0e200_real64 + coefficients(first+ncf)=1.0e200_real64 + coefficients(first+2*ncf)=1.0e200_real64 + enddo + write(unit,rec=3,iostat=ios) coefficients + call require(ios.eq.0,'write absurd lunar coefficients') + close(unit) + mjd=ss(1)+0.5_real64*ss(3)-2400000.5_real64 + end subroutine rewrite_absurd_lunar_coefficients + + subroutine rewrite_header(path,invalid_range,remove_optional, & + invalid_coefficient_count,tiny_record_step,record_epoch) + character(len=*), intent(in) :: path + logical, intent(in) :: invalid_range,remove_optional + logical, intent(in) :: invalid_coefficient_count + logical, intent(in), optional :: tiny_record_step + real(real64), intent(out), optional :: record_epoch + character(len=6) :: ttl(14,3),cnam(1000) + real(real64) :: ss(3),au,emrat + integer :: unit,ios,ncon,numde,ipt(3,13),index,j + + open(newunit=unit,file=path,access='direct',form='unformatted', & + recl=8144,status='old',action='readwrite') + read(unit,rec=1,iostat=ios) ttl,(cnam(index),index=1,400),ss, & + ncon,au,emrat,((ipt(index,j),index=1,3),j=1,12),numde, & + (ipt(index,13),index=1,3) + call require(ios.eq.0,'read structured header') + if(invalid_range) ss(3)=0.0_real64 + if(present(tiny_record_step)) then + if(tiny_record_step) then + ss(3)=0.25_real64/(4.0_real64*real(huge(0),real64)) + if(present(record_epoch)) record_epoch=ss(1)+0.25_real64 + endif + endif + if(remove_optional) ipt(:,12:13)=0 + if(invalid_coefficient_count) ipt(2,1)=19 + if(ncon.le.400) then + write(unit,rec=1,iostat=ios) ttl,(cnam(index),index=1,400),ss,& + ncon,au,emrat,((ipt(index,j),index=1,3),j=1,12),numde, & + (ipt(index,13),index=1,3) + else + write(unit,rec=1,iostat=ios) ttl,(cnam(index),index=1,400),ss,& + ncon,au,emrat,((ipt(index,j),index=1,3),j=1,12),numde, & + (ipt(index,13),index=1,3), & + (cnam(index),index=401,ncon) + endif + call require(ios.eq.0,'write structured header') + close(unit) + end subroutine rewrite_header + + subroutine rewrite_ncon(path) + character(len=*), intent(in) :: path + character(len=6) :: ttl(14,3),cnam(400) + real(real64) :: ss(3),au,emrat + integer :: unit,ios,ncon,numde,ipt(3,13),index,j + + open(newunit=unit,file=path,access='direct',form='unformatted', & + recl=8144,status='old',action='readwrite') + read(unit,rec=1,iostat=ios) ttl,(cnam(index),index=1,400),ss, & + ncon,au,emrat,((ipt(index,j),index=1,3),j=1,12),numde, & + (ipt(index,13),index=1,3) + call require(ios.eq.0,'read constant count header') + ncon=1001 + write(unit,rec=1,iostat=ios) ttl,(cnam(index),index=1,400),ss, & + ncon,au,emrat,((ipt(index,j),index=1,3),j=1,12),numde, & + (ipt(index,13),index=1,3) + call require(ios.eq.0,'write oversized constant count') + close(unit) + end subroutine rewrite_ncon + + subroutine require(condition,message) + logical, intent(in) :: condition + character(len=*), intent(in) :: message + + if(.not.condition) then + print '(a)', 'FAIL '//trim(message) + error stop 1 + endif + end subroutine require + +end program test_jpl_resilience diff --git a/tests/unit/jpl/test_jpl_setup.f90 b/tests/unit/jpl/test_jpl_setup.f90 new file mode 100644 index 00000000..d640f778 --- /dev/null +++ b/tests/unit/jpl/test_jpl_setup.f90 @@ -0,0 +1,18 @@ +program test_jpl_setup + + implicit none + + character*256 fname,jpleph_file_name + common/jplcom/jpleph_file_name + + fname=repeat('x',len(fname)) + call jpl_setup(fname) + if(jpleph_file_name.ne.fname) error stop 1 + + fname='short/path'//char(0) + call jpl_setup(fname) + if(jpleph_file_name.ne.'short/path') error stop 2 + + print*,'JPLEPH path setup test passed' + +end program test_jpl_setup diff --git a/tests/unit/jt65/CMakeLists.txt b/tests/unit/jt65/CMakeLists.txt new file mode 100644 index 00000000..e718d200 --- /dev/null +++ b/tests/unit/jt65/CMakeLists.txt @@ -0,0 +1,33 @@ +# Compile the shared vectors once so parallel test builds have one producer +# for the Fortran module interface. +add_library (jt65_test_vectors STATIC jt65_test_vectors.f90) +set_target_properties (jt65_test_vectors PROPERTIES + Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/jt65_test_vectors") +target_include_directories (jt65_test_vectors PUBLIC + "${CMAKE_CURRENT_BINARY_DIR}/jt65_test_vectors") + +add_executable (test_jt65_source_encoding + test_jt65_source_encoding.f90) +wsjt_link_common_fortran (test_jt65_source_encoding) +target_link_libraries (test_jt65_source_encoding PRIVATE jt65_test_vectors) + +add_test (NAME test_jt65_source_encoding COMMAND test_jt65_source_encoding) + +add_executable (test_jt65_decode_pipeline + jt65_test_fixture.f90 + test_jt65_decode_pipeline.f90) +set_source_files_properties (test_jt65_decode_pipeline.f90 PROPERTIES + COMPILE_FLAGS "-Wno-unused-dummy-argument") +wsjt_link_common_fortran (test_jt65_decode_pipeline) +target_link_libraries (test_jt65_decode_pipeline PRIVATE jt65_test_vectors) + +add_test (NAME test_jt65_decode_pipeline COMMAND test_jt65_decode_pipeline) +set_tests_properties (test_jt65_decode_pipeline PROPERTIES + COST 18 + TIMEOUT 180) + +add_executable (test_jt65_xcor_silence + test_jt65_xcor_silence.f90) +wsjt_link_common_fortran (test_jt65_xcor_silence) + +add_test (NAME test_jt65_xcor_silence COMMAND test_jt65_xcor_silence) diff --git a/tests/unit/jt65/jt65_test_fixture.f90 b/tests/unit/jt65/jt65_test_fixture.f90 new file mode 100644 index 00000000..a317f706 --- /dev/null +++ b/tests/unit/jt65/jt65_test_fixture.f90 @@ -0,0 +1,82 @@ +module jt65_test_fixture + + use iso_fortran_env, only: int64, real32, real64 + implicit none + + integer, parameter :: jt65_sample_rate = 12000 + integer, parameter :: jt65_sample_count = 60 * jt65_sample_rate + integer, parameter :: jt65_symbol_count = 126 + real(real64), parameter :: jt65_baud = 11025.0_real64 / 4096.0_real64 + real(real64), parameter :: jt65_pi = 3.1415926535897932384626433832795_real64 + real(real64), parameter :: jt65_amplitude = 28000.0_real64 + +contains + + subroutine make_jt65_wave(samples, tones, mode65, f0, amplitude, noise_amplitude, noise_seed) + real(real32), intent(out) :: samples(:) + integer, intent(in) :: tones(jt65_symbol_count) + integer, intent(in) :: mode65 + real(real64), intent(in) :: f0 + real(real64), intent(in), optional :: amplitude + real(real64), intent(in), optional :: noise_amplitude + integer, intent(in), optional :: noise_seed + real(real64) :: signal_amplitude + real(real64) :: noise_scale, sample_noise, u1, u2 + real(real64) :: phase, frequency, samples_per_symbol + integer(int64) :: noise_state + integer :: sample, signal_sample, output_sample, symbol + + signal_amplitude = jt65_amplitude + if (present(amplitude)) signal_amplitude = amplitude + noise_scale = 0.0_real64 + if (present(noise_amplitude)) noise_scale = noise_amplitude + noise_state = 104729_int64 + if (present(noise_seed)) noise_state = 104729_int64 + int(noise_seed, int64) + if (noise_scale == 0.0_real64) then + samples = 0.0_real32 + else + do sample = 1, size(samples) + noise_state = modulo(16807_int64 * noise_state, 2147483647_int64) + u1 = max(real(noise_state, real64) / 2147483647.0_real64, tiny(1.0_real64)) + noise_state = modulo(16807_int64 * noise_state, 2147483647_int64) + u2 = real(noise_state, real64) / 2147483647.0_real64 + sample_noise = sqrt(-2.0_real64 * log(u1)) * cos(2.0_real64 * jt65_pi * u2) + samples(sample) = real(noise_scale * sample_noise, real32) + end do + end if + phase = 0.0_real64 + samples_per_symbol = real(jt65_sample_rate, real64) / jt65_baud + do signal_sample = 1, size(samples) - jt65_sample_rate + symbol = int(floor(real(signal_sample, real64) / samples_per_symbol)) + 1 + if (symbol > jt65_symbol_count) exit + frequency = f0 + real(tones(symbol), real64) * jt65_baud * real(mode65, real64) + phase = phase + 2.0_real64 * jt65_pi * frequency / real(jt65_sample_rate, real64) + output_sample = jt65_sample_rate + signal_sample + samples(output_sample) = samples(output_sample) + real(signal_amplitude * sin(phase), real32) + end do + end subroutine make_jt65_wave + + subroutine make_map65_wave(dd, tones, mode65, f0) + real(real32), intent(out) :: dd(:,:) + integer, intent(in) :: tones(jt65_symbol_count) + integer, intent(in) :: mode65 + real(real64), intent(in) :: f0 + real(real64) :: phase, frequency, samples_per_symbol + integer :: signal_sample, output_sample, symbol + integer, parameter :: map65_sample_rate = 96000 + + dd = 0.0_real32 + phase = 0.0_real64 + samples_per_symbol = real(map65_sample_rate, real64) / jt65_baud + do signal_sample = 1, size(dd, 2) - map65_sample_rate + symbol = int(floor(real(signal_sample, real64) / samples_per_symbol)) + 1 + if (symbol > jt65_symbol_count) exit + frequency = f0 + real(tones(symbol), real64) * jt65_baud * real(mode65, real64) + phase = phase + 2.0_real64 * jt65_pi * frequency / real(map65_sample_rate, real64) + output_sample = map65_sample_rate + signal_sample + dd(1, output_sample) = real(jt65_amplitude * cos(phase), real32) + dd(2, output_sample) = real(-jt65_amplitude * sin(phase), real32) + end do + end subroutine make_map65_wave + +end module jt65_test_fixture diff --git a/tests/unit/jt65/jt65_test_vectors.f90 b/tests/unit/jt65/jt65_test_vectors.f90 new file mode 100644 index 00000000..ab1ac1e8 --- /dev/null +++ b/tests/unit/jt65/jt65_test_vectors.f90 @@ -0,0 +1,43 @@ +module jt65_test_vectors + implicit none + + integer, parameter :: jt65_symbol_count = 126 + + integer, parameter :: standard_tones(jt65_symbol_count) = [ & + 0, 3, 62, 0, 0, 50, 13, 40, 0, 0, 0, 0, & + 0, 0, 23, 0, 52, 0, 10, 39, 13, 0, 15, 0, & + 0, 3, 58, 0, 26, 47, 63, 0, 0, 0, 62, 21, & + 0, 0, 0, 0, 20, 0, 0, 4, 0, 0, 0, 0, & + 21, 24, 60, 0, 0, 56, 0, 46, 0, 37, 0, 0, & + 46, 30, 0, 0, 30, 0, 53, 0, 13, 0, 6, 17, & + 0, 62, 42, 59, 31, 44, 17, 0, 0, 56, 43, 48, & + 8, 42, 49, 40, 0, 0, 59, 0, 15, 3, 0, 37, & + 0, 0, 31, 0, 20, 0, 52, 0, 51, 35, 0, 0, & + 20, 19, 0, 10, 9, 0, 59, 56, 52, 62, 0, 0, & + 0, 0, 0, 0, 0, 0 ] + + integer, parameter :: ooo_tones(jt65_symbol_count) = [ & + 3, 0, 0, 62, 50, 0, 0, 0, 13, 40, 23, 52, & + 10, 39, 0, 13, 0, 15, 0, 0, 0, 3, 0, 58, & + 26, 0, 0, 47, 0, 0, 0, 63, 62, 21, 0, 0, & + 20, 4, 21, 24, 0, 60, 56, 0, 46, 37, 46, 30, & + 0, 0, 0, 30, 53, 0, 13, 0, 6, 0, 17, 62, & + 0, 0, 42, 59, 0, 31, 0, 44, 0, 17, 0, 0, & + 56, 0, 0, 0, 0, 0, 0, 43, 48, 0, 0, 0, & + 0, 0, 0, 0, 8, 42, 0, 49, 0, 0, 40, 0, & + 59, 15, 0, 3, 0, 37, 0, 31, 0, 0, 20, 52, & + 0, 0, 51, 0, 0, 35, 0, 0, 0, 0, 20, 19, & + 10, 9, 59, 56, 52, 62 ] + +contains + + pure function padded_message(text) result(message) + character(len=*), intent(in) :: text + character(len=22) :: message + + message = ' ' + message(1:min(len_trim(text), len(message))) = & + text(1:min(len_trim(text), len(message))) + end function padded_message + +end module jt65_test_vectors diff --git a/tests/unit/jt65/test_ccf65_correlator.f90 b/tests/unit/jt65/test_ccf65_correlator.f90 new file mode 100644 index 00000000..3dd8917c --- /dev/null +++ b/tests/unit/jt65/test_ccf65_correlator.f90 @@ -0,0 +1,118 @@ +program test_ccf65_correlator + + use ccf65_legacy_mod, only: ccf65 + use four2a_legacy_wrap_mod, only: c2r_legacy, r2c_legacy, JT65_NFFT, JT65_NH + use, intrinsic :: ieee_arithmetic, only: ieee_is_finite, ieee_quiet_nan, ieee_value + implicit none + + integer, parameter :: nhsym = 254 + real, parameter :: expected_sync = 25.8397 + real :: ss(4,322) + integer :: i + real :: sync1, dt, flipk, syncshort, snr2, dt2 + integer :: ipol1, ipol2 + + call test_fft_roundtrip() + + call make_sync_plane(ss, 1.0) + call ccf65(ss, nhsym, 1.0e30, sync1, ipol1, 1, dt, flipk, syncshort, snr2, ipol2, dt2) + call require(sync1 > 0.0, 'normal JT65 sync is detected') + call require(abs(sync1 - expected_sync) < 0.05, 'normal JT65 sync strength') + call require(flipk > 0.0, 'normal JT65 polarity') + call require(ipol1 == 1, 'normal JT65 polarization') + call require(abs(dt + 2.5) < 0.02, 'normal JT65 timing') + call require(syncshort < 0.0, 'normal JT65 is not shorthand') + + call make_sync_plane(ss, -1.0) + call ccf65(ss, nhsym, 1.0e30, sync1, ipol1, 1, dt, flipk, syncshort, snr2, ipol2, dt2) + call require(sync1 > 0.0, 'inverted JT65 sync is detected') + call require(abs(sync1 - expected_sync) < 0.05, 'inverted JT65 sync strength') + call require(flipk < 0.0, 'inverted JT65 polarity') + call require(ipol1 == 1, 'inverted JT65 polarization') + call require(abs(dt + 2.5) < 0.02, 'inverted JT65 timing') + call require(syncshort < 0.0, 'inverted JT65 is not shorthand') + + ss = 0.0 + sync1 = -99.0 + do i = 1, nhsym - 1 + ss(1,i) = 0.01 * real(mod(i,3) - 1) + end do + call ccf65(ss, nhsym, 1.0e30, sync1, ipol1, 1, dt, flipk, syncshort, snr2, ipol2, dt2) + call require(sync1 < 0.0, 'low-signal input is rejected') + call require(syncshort < 0.0, 'low-signal input is not shorthand') + + ss = 0.0 + call ccf65(ss, nhsym, 1.0e30, sync1, ipol1, 1, dt, flipk, syncshort, snr2, ipol2, dt2) + call require(sync1 == -4.0 .and. syncshort == -4.0, 'zero signal has explicit sync defaults') + call require(all_finite(sync1, dt, flipk, syncshort, snr2, dt2), 'zero signal outputs are finite') + + call make_sync_plane(ss, 1.0) + ss(2:4,:) = ieee_value(0.0, ieee_quiet_nan) + call ccf65(ss, nhsym, 1.0e30, sync1, ipol1, 1, dt, flipk, syncshort, snr2, ipol2, dt2) + call require(sync1 > 0.0, 'inactive polarization data does not affect JT65 detection') + call require(all_finite(sync1, dt, flipk, syncshort, snr2, dt2), & + 'inactive polarization data produces finite correlator outputs') + print '(a)', 'ccf65 correlator tests passed' + +contains + + subroutine require(condition, description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + + if (.not. condition) then + print '(a)', 'FAIL: '//description + error stop 1 + end if + end subroutine require + + subroutine test_fft_roundtrip() + real :: input(JT65_NFFT), output(JT65_NFFT) + complex :: spectrum(0:JT65_NH) + integer :: k + + do k = 1, JT65_NFFT + input(k) = sin(0.013*real(k)) + 0.25*cos(0.071*real(k)) + end do + + call r2c_legacy(input, spectrum) + call c2r_legacy(spectrum, output) + call require(maxval(abs(output/JT65_NFFT - input)) < 1.0e-5, & + 'legacy packed FFT round trip preserves real samples') + end subroutine test_fft_roundtrip + + logical function all_finite(v1, v2, v3, v4, v5, v6) + real, intent(in) :: v1, v2, v3, v4, v5, v6 + + all_finite = ieee_is_finite(v1) .and. ieee_is_finite(v2) .and. & + ieee_is_finite(v3) .and. ieee_is_finite(v4) .and. & + ieee_is_finite(v5) .and. ieee_is_finite(v6) + end function all_finite + + subroutine make_sync_plane(ss_plane, polarity) + real, intent(out) :: ss_plane(4,322) + real, intent(in) :: polarity + integer, parameter :: npr(126) = [ & + 1,0,0,1,1,0,0,0,1,1,1,1,1,1,0,1,0,1,0,0, & + 0,1,0,1,1,0,0,1,0,0,0,1,1,1,0,0,1,1,1,1, & + 0,1,1,0,1,1,1,1,0,0,0,1,1,0,1,0,1,0,1,1, & + 0,0,1,1,0,1,0,1,0,1,0,0,1,0,0,0,0,0,0,1, & + 1,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,1,1,0,1, & + 0,1,0,1,0,0,1,1,0,0,1,0,0,1,0,0,0,0,1,1, & + 1,1,1,1,1,1] + integer :: i + real :: target_sum + + ! Build a non-negative spectrum whose adjacent-bin sums have one lag only. + ss_plane = 0.0 + ss_plane(1,1) = 2.0 + do i = 1, nhsym - 1 + target_sum = 4.0 + if (mod(i,2) == 1 .and. (i+1)/2 <= size(npr)) then + target_sum = target_sum + polarity * real(2*npr((i+1)/2) - 1) + endif + ss_plane(1,i+1) = target_sum - ss_plane(1,i) + end do + end subroutine make_sync_plane + +end program test_ccf65_correlator diff --git a/tests/unit/jt65/test_jt65_decode_pipeline.f90 b/tests/unit/jt65/test_jt65_decode_pipeline.f90 new file mode 100644 index 00000000..414b6f80 --- /dev/null +++ b/tests/unit/jt65/test_jt65_decode_pipeline.f90 @@ -0,0 +1,293 @@ +module jt65_pipeline_callback + + use jt65_decode + use jt65_mod, only: s1, s3a + use jt65_test_vectors, only: padded_message + implicit none + + integer :: callback_count + integer :: callback_snr, callback_freq, callback_drift, callback_nflip + integer :: callback_ft, callback_qual, callback_nsmo, callback_nsum, callback_minsync + integer :: callback_message_count, callback_max_nsum + real :: callback_sync, callback_dt, callback_width + character(len=22) :: callback_message + +contains + + subroutine capture_callback(this, sync, snr, dt, freq, drift, nflip, width, & + decoded, ft, qual, nsmo, nsum, minsync) + class(jt65_decoder), intent(inout) :: this + real, intent(in) :: sync, dt, width + integer, intent(in) :: snr, freq, drift, nflip, ft, qual, nsmo, nsum, minsync + character(len=22), intent(in) :: decoded + + callback_count = callback_count + 1 + callback_sync = sync + callback_snr = snr + callback_dt = dt + callback_freq = freq + callback_drift = drift + callback_nflip = nflip + callback_width = width + callback_message = decoded + callback_ft = ft + callback_qual = qual + callback_nsmo = nsmo + callback_nsum = nsum + callback_minsync = minsync + callback_max_nsum = max(callback_max_nsum, nsum) + if (decoded /= padded_message('')) callback_message_count = callback_message_count + 1 + end subroutine capture_callback + +end module jt65_pipeline_callback + +program test_jt65_decode_pipeline + + use iso_fortran_env, only: real32 + use, intrinsic :: ieee_arithmetic, only: ieee_is_finite + use jt65_decode + use jt65_pipeline_callback + use jt65_test_fixture + use jt65_test_vectors + implicit none + + type(jt65_decoder) :: decoder + real(real32), allocatable :: samples(:) + allocate(samples(jt65_sample_count)) + call test_clean_modes(samples) + call test_ooo_signal(samples) + call test_silence_and_frequency_rejection(samples) + call test_decoder_reuse(samples, decoder) + call test_auto_clear_average(samples, decoder) + call test_duplicate_average_cursor + print '(a)', 'JT65 decoder pipeline tests passed' + +contains + + subroutine reset_capture() + callback_count = 0 + callback_snr = 0 + callback_freq = 0 + callback_drift = 0 + callback_nflip = 0 + callback_ft = 0 + callback_qual = 0 + callback_nsmo = 0 + callback_nsum = 0 + callback_minsync = 0 + callback_message_count = 0 + callback_max_nsum = 0 + callback_sync = 0.0 + callback_dt = 0.0 + callback_width = 0.0 + callback_message = ' ' + end subroutine reset_capture + + subroutine require(condition, description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + + if (.not. condition) then + print '(a)', 'FAIL: '//description + error stop 1 + end if + end subroutine require + + subroutine decode_signal(decoder_to_use, waveform, nsubmode, clearave, decode_flags, & + decode_nutc, decode_depth, decode_again) + type(jt65_decoder), intent(inout) :: decoder_to_use + real(real32), intent(in) :: waveform(:) + integer, intent(in) :: nsubmode + logical, intent(in) :: clearave + integer, intent(in), optional :: decode_flags, decode_nutc, decode_depth + logical, intent(in), optional :: decode_again + logical :: newdat, nagain, nrobust, ljt65apon + integer :: npts, nutc, nf1, nf2, nfqso, ntol, minsync, n2pass + integer :: ntrials, naggressive, ndepth, nexp_decode, nQSOProgress + real :: emedelay + character(len=12) :: mycall, hiscall + character(len=6) :: hisgrid + + npts = min(size(waveform), 52 * jt65_sample_rate) + nutc = 1 + if (present(decode_nutc)) nutc = decode_nutc + nf1 = 1300 + nf2 = 1700 + nfqso = 1500 + ntol = 100 + minsync = 0 + n2pass = 1 + ntrials = 1000 + naggressive = 5 + ndepth = 3 + if (present(decode_depth)) ndepth = decode_depth + emedelay = -999.9 + nexp_decode = 32 + if (present(decode_flags)) nexp_decode = decode_flags + nQSOProgress = 6 + newdat = .true. + nagain = .true. + if (present(decode_again)) nagain = decode_again + nrobust = .false. + ljt65apon = .false. + mycall = 'K1ABC ' + hiscall = 'W9XYZ ' + hisgrid = 'FN42 ' + + call decoder_to_use%decode(capture_callback, waveform, npts, newdat, nutc, nf1, nf2, & + nfqso, ntol, nsubmode, minsync, nagain, n2pass, nrobust, ntrials, naggressive, & + ndepth, emedelay, clearave, mycall, hiscall, hisgrid, nexp_decode, nQSOProgress, & + ljt65apon) + end subroutine decode_signal + + subroutine require_decode(expected_message, description) + character(len=*), intent(in) :: expected_message, description + character(len=22) :: expected + + expected = padded_message(expected_message) + call require(callback_count == 1, description//' emits exactly one callback') + call require(callback_message == expected, description//' message') + call require(abs(real(callback_freq) - 1500.0) <= 4.0, description//' frequency') + call require(abs(callback_dt) <= 1.0, description//' timing') + call require(callback_sync > 0.0, description//' sync metric') + call require(ieee_is_finite(callback_sync), description//' finite sync metric') + call require(ieee_is_finite(callback_dt), description//' finite timing') + call require(ieee_is_finite(callback_width), description//' finite width metric') + end subroutine require_decode + + subroutine test_clean_modes(waveform) + real(real32), intent(inout) :: waveform(:) + call reset_capture() + call make_jt65_wave(waveform, standard_tones, 1, 1500.0_real64) + call decode_signal(decoder, waveform, 0, .true.) + call require_decode('K1ABC W9XYZ FN42', 'JT65A clean signal') + + call reset_capture() + call make_jt65_wave(waveform, standard_tones, 4, 1500.0_real64) + call decode_signal(decoder, waveform, 2, .true.) + call require_decode('K1ABC W9XYZ FN42', 'JT65C clean signal') + + call reset_capture() + call make_jt65_wave(waveform, standard_tones, 2, 1500.0_real64) + call decode_signal(decoder, waveform, 1, .true.) + call require_decode('K1ABC W9XYZ FN42', 'JT65B clean signal') + end subroutine test_clean_modes + + subroutine test_ooo_signal(waveform) + real(real32), intent(inout) :: waveform(:) + type(jt65_decoder) :: ooo_decoder + + call reset_capture() + call make_jt65_wave(waveform, ooo_tones, 1, 1500.0_real64) + call decode_signal(ooo_decoder, waveform, 0, .true., 64) + call require_decode('K1ABC W9XYZ FN42', 'JT65A VHF OOO signal') + call require(callback_nflip < 0, 'JT65A VHF OOO signal polarity') + + call reset_capture() + call decode_signal(ooo_decoder, waveform, 0, .true.) + call require(callback_count == 0, 'JT65A HF OOO signal is rejected') + end subroutine test_ooo_signal + + subroutine test_silence_and_frequency_rejection(waveform) + real(real32), intent(inout) :: waveform(:) + + waveform = 0.0_real32 + call reset_capture() + call decode_signal(decoder, waveform, 0, .true.) + call require(callback_count == 0, 'silence produces no callback') + + call make_jt65_wave(waveform, standard_tones, 1, 3000.0_real64) + call reset_capture() + call decode_signal(decoder, waveform, 0, .true.) + call require(callback_count == 0, 'out-of-window signal produces no callback') + end subroutine test_silence_and_frequency_rejection + + subroutine test_decoder_reuse(waveform, decoder_to_use) + real(real32), intent(inout) :: waveform(:) + type(jt65_decoder), intent(inout) :: decoder_to_use + + call make_jt65_wave(waveform, standard_tones, 1, 1500.0_real64) + call reset_capture() + call decode_signal(decoder_to_use, waveform, 0, .true.) + call require_decode('K1ABC W9XYZ FN42', 'first reused-decoder signal') + + waveform = 0.0_real32 + call reset_capture() + call decode_signal(decoder_to_use, waveform, 0, .true.) + call require(callback_count == 0, 'reused decoder silence produces no callback') + + call make_jt65_wave(waveform, standard_tones, 1, 1500.0_real64) + call reset_capture() + call decode_signal(decoder_to_use, waveform, 0, .true.) + call require_decode('K1ABC W9XYZ FN42', 'second reused-decoder signal') + end subroutine test_decoder_reuse + + subroutine test_auto_clear_average(waveform, decoder_to_use) + real(real32), intent(inout) :: waveform(:) + type(jt65_decoder), intent(inout) :: decoder_to_use + integer, parameter :: averaging_depth = 16 + 128 + real(real64), parameter :: weak_amplitude = 1.1_real64 + real(real64), parameter :: noise_amplitude = 25.0_real64 + + call make_jt65_wave(waveform, standard_tones, 1, 1500.0_real64, weak_amplitude, & + noise_amplitude, 1) + call reset_capture() + call decode_signal(decoder_to_use, waveform, 0, .true., 64, 1, averaging_depth, .false.) + call require(callback_message_count == 0, 'weak JT65 signal is saved without decoding') + + call make_jt65_wave(waveform, standard_tones, 1, 1500.0_real64, weak_amplitude, & + noise_amplitude, 3) + call reset_capture() + call decode_signal(decoder_to_use, waveform, 0, .false., 64, 3, averaging_depth, .false.) + call require(callback_message_count == 1, 'two weak JT65 signals produce an averaged decode') + call require(callback_max_nsum >= 2, 'averaged JT65 decode reports multiple periods') + + call make_jt65_wave(waveform, standard_tones, 1, 1500.0_real64, weak_amplitude, & + noise_amplitude, 5) + call reset_capture() + call decode_signal(decoder_to_use, waveform, 0, .false., 64, 5, averaging_depth, .false.) + call require(callback_message_count == 0, & + 'auto-clear prevents a previous JT65 average from decoding again') + end subroutine test_auto_clear_average + + subroutine test_duplicate_average_cursor + integer :: nsave, ndepth, neme, nftt, nsum, ndeepave, nQSOProgress + integer :: ntrials, naggressive + logical :: clear_avg65, ljt65apon + character(len=12) :: mycall, hiscall + character(len=6) :: hisgrid + character(len=22) :: avemsg, deepave + real :: qave + + s1=0.0 + s3a=0.0 + nsave=0 + ndepth=3 + neme=0 + nftt=-1 + nsum=-1 + ndeepave=0 + nQSOProgress=0 + ntrials=1000 + naggressive=5 + clear_avg65=.true. + ljt65apon=.false. + mycall='K1ABC ' + hiscall='W9XYZ ' + hisgrid='FN42 ' + + call avg65(1,nsave,1.0,0.0,1,1500,1,100,ndepth,.false.,ntrials, & + naggressive,clear_avg65,neme,mycall,hiscall,hisgrid,nftt,avemsg, & + qave,deepave,nsum,ndeepave,nQSOProgress,ljt65apon) + call require(nsave == 1 .and. nsum == 1, & + 'first average observation occupies the initial slot') + + nsave=2 + call avg65(1,nsave,1.0,0.0,1,1500,1,100,ndepth,.false.,ntrials, & + naggressive,clear_avg65,neme,mycall,hiscall,hisgrid,nftt,avemsg, & + qave,deepave,nsum,ndeepave,nQSOProgress,ljt65apon) + call require(nsave == 1 .and. nsum == 1 .and. nftt == 0, & + 'duplicate average observation does not advance the ring') + end subroutine test_duplicate_average_cursor + +end program test_jt65_decode_pipeline diff --git a/tests/unit/jt65/test_jt65_source_encoding.f90 b/tests/unit/jt65/test_jt65_source_encoding.f90 new file mode 100644 index 00000000..4462cbd9 --- /dev/null +++ b/tests/unit/jt65/test_jt65_source_encoding.f90 @@ -0,0 +1,201 @@ +program test_jt65_source_encoding + use iso_c_binding, only: c_char, c_int + use jt65_test_vectors + implicit none + + interface + subroutine gen65(message, ichk, sent, tones, itype) bind(C, name='gen65') + import c_char, c_int + character(kind=c_char) :: message(23), sent(23) + integer(kind=c_int) :: ichk, tones(126), itype + end subroutine gen65 + end interface + + call test_standard_message() + call test_ooo_message() + call test_message_forms() + call test_shorthand_messages() + print '(a)', 'JT65 source encoding tests passed' + +contains + + subroutine encode(text, ichk, sent, tones, itype) + character(len=*), intent(in) :: text + integer, intent(in) :: ichk + character(len=1), intent(out) :: sent(23) + integer, intent(out) :: tones(jt65_symbol_count), itype + character(len=1) :: message(23) + integer :: i + + message = char(0) + do i = 1, min(len_trim(text), 22) + message(i) = text(i:i) + end do + sent = char(0) + tones = -1 + itype = -1 + call gen65(message, ichk, sent, tones, itype) + end subroutine encode + + subroutine require(condition, description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + + if (.not. condition) then + print '(a)', 'FAIL: '//description + error stop 1 + end if + end subroutine require + + subroutine require_message(sent, expected, description) + character(len=1), intent(in) :: sent(23) + character(len=22), intent(in) :: expected + character(len=*), intent(in) :: description + character(len=22) :: actual + integer :: i + + actual = ' ' + do i = 1, 22 + actual(i:i) = sent(i) + end do + call require(actual == expected, description) + call require(ichar(sent(23)) == 0, description//' has a null terminator') + end subroutine require_message + + subroutine require_tone_domain(tones, description) + integer, intent(in) :: tones(jt65_symbol_count) + character(len=*), intent(in) :: description + + call require(all(tones == 0 .or. (tones >= 2 .and. tones <= 65)), & + description//' stays in the JT65 tone domain') + end subroutine require_tone_domain + + subroutine test_standard_message() + character(len=1) :: sent(23) + integer :: tones(jt65_symbol_count), itype + character(len=22) :: expected + + call encode('K1ABC W9XYZ FN42', 0, sent, tones, itype) + expected = padded_message('K1ABC W9XYZ FN42') + call require_message(sent, expected, 'standard message') + call require(itype == 1, 'standard message type') + call require(all(tones == standard_tones), 'standard message tone vector') + call require_tone_domain(tones, 'standard message') + call require(count(tones == 0) == 63, 'standard message sync-symbol count') + call require(count(tones /= 0) == 63, 'standard message data-symbol count') + end subroutine test_standard_message + + subroutine test_ooo_message() + character(len=1) :: sent(23), normal_sent(23) + integer :: tones(jt65_symbol_count), normal_tones(jt65_symbol_count), itype + integer :: normal_data(63), ooo_data(63) + character(len=22) :: expected + integer :: i, normal_data_index, ooo_data_index + + call encode('K1ABC W9XYZ FN42', 0, normal_sent, normal_tones, itype) + call encode('K1ABC W9XYZ FN42 OOO', 0, sent, tones, itype) + expected = padded_message('K1ABC W9XYZ FN42 OOO') + call require_message(sent, expected, 'OOO message') + call require(itype == 1, 'OOO message type') + call require(all(tones == ooo_tones), 'OOO message tone vector') + call require_tone_domain(tones, 'OOO message') + call require(count(tones == 0) == 63, 'OOO sync-symbol count') + call require(count(tones /= 0) == 63, 'OOO data-symbol count') + + normal_data_index = 0 + ooo_data_index = 0 + do i = 1, jt65_symbol_count + if (normal_tones(i) /= 0) then + normal_data_index = normal_data_index + 1 + normal_data(normal_data_index) = normal_tones(i) + call require(tones(i) == 0, 'OOO reverses the normal sync polarity') + end if + if (tones(i) /= 0) then + ooo_data_index = ooo_data_index + 1 + ooo_data(ooo_data_index) = tones(i) + call require(normal_tones(i) == 0, 'normal reverses the OOO sync polarity') + end if + end do + call require(normal_data_index == 63, 'normal data count for OOO comparison') + call require(ooo_data_index == 63, 'OOO data count for comparison') + call require(all(normal_data == ooo_data), 'OOO preserves the data codeword') + end subroutine test_ooo_message + + subroutine test_message_forms() + character(len=1) :: sent(23) + integer :: tones(jt65_symbol_count), itype + character(len=22) :: expected + + call encode('1A/KA1ABC WB9XYZ', 0, sent, tones, itype) + expected = padded_message('1A/KA1ABC WB9XYZ') + call require_message(sent, expected, 'type 1 prefix message') + call require(itype == 2, 'type 1 prefix message type') + call require_tone_domain(tones, 'type 1 prefix message') + + call encode('KA1ABC WB9XYZ/P', 0, sent, tones, itype) + expected = padded_message('KA1ABC WB9XYZ/P') + call require_message(sent, expected, 'type 1 suffix message') + call require(itype == 3, 'type 1 suffix message type') + call require_tone_domain(tones, 'type 1 suffix message') + + call encode('CQ A000/KA1ABC FM07', 0, sent, tones, itype) + expected = padded_message('CQ A000/KA1ABC FM07') + call require_message(sent, expected, 'type 2 prefix message') + call require(itype == 4, 'type 2 prefix message type') + call require_tone_domain(tones, 'type 2 prefix message') + + call encode('CQ WB9XYZ/W4 FM07', 0, sent, tones, itype) + expected = padded_message('CQ WB9XYZ/W4 FM07') + call require_message(sent, expected, 'type 2 suffix message') + call require(itype == 5, 'type 2 suffix message type') + call require_tone_domain(tones, 'type 2 suffix message') + + call encode('HELLO WORLD', 0, sent, tones, itype) + expected = padded_message('HELLO WORLD') + call require_message(sent, expected, 'free text message') + call require(itype == 6, 'free text message type') + call require_tone_domain(tones, 'free text message') + end subroutine test_message_forms + + subroutine test_shorthand_messages() + character(len=1) :: sent(23) + integer :: tones(jt65_symbol_count), itype + character(len=22) :: expected + integer :: i, group + + call encode('RO', 0, sent, tones, itype) + expected = padded_message('RO') + call require_message(sent, expected, 'RO shorthand') + call require(itype == 7, 'RO shorthand type') + do i = 1, jt65_symbol_count + group = 1 + (i - 1) / 4 + call require(tones(i) == merge(0, 20, mod(group, 2) == 1), & + 'RO shorthand symbol group') + end do + + call encode('RRR', 0, sent, tones, itype) + expected = padded_message('RRR') + call require_message(sent, expected, 'RRR shorthand') + call require(itype == 7, 'RRR shorthand type') + call require(all(tones(1:4) == 0), 'RRR shorthand first group') + call require(all(tones(5:8) == 30), 'RRR shorthand second group') + + call encode('73', 0, sent, tones, itype) + expected = padded_message('73') + call require_message(sent, expected, '73 shorthand') + call require(itype == 7, '73 shorthand type') + call require(all(tones(1:4) == 0), '73 shorthand first group') + call require(all(tones(5:8) == 40), '73 shorthand second group') + + call encode(' k1abc w9xyz fn42 ', 0, sent, tones, itype) + expected = padded_message('K1ABC W9XYZ FN42') + call require_message(sent, expected, 'message normalization') + call require(itype == 1, 'normalized message type') + + call encode('K1ABC W9XYZ FN42 OO', 0, sent, tones, itype) + expected = padded_message('K1ABC W9XYZ FN42 OOO') + call require_message(sent, expected, 'legacy OO suffix') + call require(itype == 1, 'legacy OO suffix type') + end subroutine test_shorthand_messages + +end program test_jt65_source_encoding diff --git a/tests/unit/jt65/test_jt65_xcor_silence.f90 b/tests/unit/jt65/test_jt65_xcor_silence.f90 new file mode 100644 index 00000000..d43049b2 --- /dev/null +++ b/tests/unit/jt65/test_jt65_xcor_silence.f90 @@ -0,0 +1,34 @@ +program test_jt65_xcor_silence + + implicit none + + integer, parameter :: lag1 = -32, lag2 = 82, nhmax = 3413, nsmax = 552 + real :: ss(nsmax,nhmax), ccf(lag1:lag2), ccf0, flip + integer :: lagpk + + common /sync/ ss + + call setup65 + ss = 0.0 + lagpk = huge(0) + + call xcor(1,nsmax,126,lag1,lag2,ccf,ccf0,lagpk,flip,0.0,0) + + call require(lagpk == lag1, 'silence returns the first valid lag') + call require(all(ccf == 0.0), 'silence produces zero correlation') + call require(ccf0 == 0.0, 'silence produces a zero peak') + call require(flip == 1.0, 'silence keeps normal polarity') + +contains + + subroutine require(condition, description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + + if (.not. condition) then + print '(a)', 'FAIL: '//description + error stop 1 + end if + end subroutine require + +end program test_jt65_xcor_silence diff --git a/tests/unit/jt65/test_map65_jt65_candidate_consistency.f90 b/tests/unit/jt65/test_map65_jt65_candidate_consistency.f90 new file mode 100644 index 00000000..433ce775 --- /dev/null +++ b/tests/unit/jt65/test_map65_jt65_candidate_consistency.f90 @@ -0,0 +1,39 @@ +program test_map65_jt65_candidate_consistency + use extract_mod, only: jt65_candidate_is_consistent + implicit none + + call require(jt65_candidate_is_consistent(48,79,0.806,5.509), & + 'a weak faded decode with high hard distance remains eligible') + call require(jt65_candidate_is_consistent(26,28,0.0,24.628), & + 'a strong decode with high matched power remains eligible') + call require(jt65_candidate_is_consistent(45,81,0.844,4.463), & + 'the randomized holdout decode remains eligible') + + call require(.not.jt65_candidate_is_consistent(47,83,0.829,12.700), & + 'the reproduced wideband false decode is rejected') + call require(.not.jt65_candidate_is_consistent(42,72,0.0,16.740), & + 'a high-power distant codeword is rejected') + call require(.not.jt65_candidate_is_consistent(44,81,0.844,7.819), & + 'an elevated-power high-burden codeword is rejected') + call require(.not.jt65_candidate_is_consistent(44,80,0.893,4.772), & + 'an ambiguous high-burden codeword is rejected') + + call require(jt65_candidate_is_consistent(41,79,0.0,20.0), & + 'matched power alone does not reject a nearby codeword') + call require(jt65_candidate_is_consistent(49,80,0.869,7.499), & + 'sub-threshold evidence remains eligible') + + print '(a)', 'MAP65 JT65 candidate consistency tests passed.' + +contains + + subroutine require(condition,description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + + if(.not.condition) then + print '(a)', 'FAIL: '//description + error stop 1 + endif + end subroutine require +end program test_map65_jt65_candidate_consistency diff --git a/tests/unit/jt65/test_map65_jt65_handoff.f90 b/tests/unit/jt65/test_map65_jt65_handoff.f90 new file mode 100644 index 00000000..d263bccd --- /dev/null +++ b/tests/unit/jt65/test_map65_jt65_handoff.f90 @@ -0,0 +1,150 @@ +program test_map65_jt65_handoff + + use iso_fortran_env, only: real32, real64 + use, intrinsic :: ieee_arithmetic, only: ieee_get_flag, ieee_invalid, ieee_is_finite, & + ieee_quiet_nan, ieee_set_flag, ieee_value + use decode1a_mod + use filbig_mod + use afc65b_mod, only: afc65b + use jt65_test_fixture + use jt65_test_vectors + use npar_ptrs_mod, only: nsmax_active + implicit none + + real(real32), allocatable :: dd(:,:) + real(real64), parameter :: map65_base_frequency = 118.0_real64 * 11025.0_real64 / 1024.0_real64 + + allocate(dd(4, nsmax_active)) + call test_mono_filter_output(dd) + call test_afc_zero_signal() + call test_mode(dd, standard_tones, 1, 1, 'JT65A MAP65 handoff') + call test_mode(dd, standard_tones, 2, 1, 'JT65B MAP65 handoff') + call test_mode(dd, standard_tones, 4, 1, 'JT65C MAP65 handoff') + call test_mode(dd, ooo_tones, 1, -1, 'JT65A OOO MAP65 handoff') + call test_mode(dd, standard_tones, 2, 1, 'JT65B xpol MAP65 handoff', .true.) + print '(a)', 'MAP65 JT65 handoff tests passed' + +contains + + subroutine require(condition, description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + + if (.not. condition) then + print '(a)', 'FAIL: '//description + error stop 1 + end if + end subroutine require + + subroutine test_mono_filter_output(waveform) + real(real32), intent(inout) :: waveform(:,:) + complex(real32), allocatable :: cx(:), cy(:) + integer :: newdat, n5 + logical :: invalid_raised + + allocate(cx(nsmax_active/64), cy(nsmax_active/64)) + call make_map65_wave(waveform, standard_tones, 2, map65_base_frequency) + waveform(3:4,:) = ieee_value(0.0_real32, ieee_quiet_nan) + newdat = 1 + call ieee_set_flag(ieee_invalid, .false.) + call filbig(waveform, nsmax_active, map65_base_frequency, newdat, 96000, .false., cx, cy, n5) + call ieee_get_flag(ieee_invalid, invalid_raised) + + call require(.not. invalid_raised, 'mono filter avoids invalid inactive-channel arithmetic') + call require(all(ieee_is_finite(real(cy(:n5)))) .and. & + all(ieee_is_finite(aimag(cy(:n5)))), 'mono filter output is finite') + call require(all(abs(cy(:n5)) == 0.0), 'mono filter output is zero') + end subroutine test_mono_filter_output + + subroutine test_afc_zero_signal() + integer, parameter :: npts = 1024 + complex :: cx(npts), cy(npts) + real :: a(5), ccfbest, dtbest + integer :: ipol, nflip, ndphi + logical :: invalid_raised + + cx = (0.0, 0.0) + cy = (0.0, 0.0) + a = 0.0 + ipol = 1 + nflip = 1 + ndphi = 0 + call ieee_set_flag(ieee_invalid, .false.) + call afc65b(cx, cy, npts, 1378.125/4.0, nflip, ipol, .false., ndphi, a, ccfbest, dtbest) + call ieee_get_flag(ieee_invalid, invalid_raised) + + call require(.not. invalid_raised, 'flat AFC objective avoids invalid arithmetic') + call require(all(ieee_is_finite(a(1:4))) .and. ieee_is_finite(ccfbest) .and. & + ieee_is_finite(dtbest), 'flat AFC objective produces finite outputs') + call require(all(a(1:3) == 0.0) .and. a(4) == 0.0, & + 'flat AFC objective preserves the accepted parameter point') + call require(ccfbest == 0.0 .and. dtbest == 0.0 .and. ipol == 1, & + 'flat AFC objective has explicit detection defaults') + end subroutine test_afc_zero_signal + + subroutine test_mode(waveform, tones, mode65, polarity, description, cross_polarized) + real(real32), intent(inout) :: waveform(:,:) + integer, intent(in) :: tones(:) + integer, intent(in) :: mode65 + integer, intent(in) :: polarity + character(len=*), intent(in) :: description + logical, intent(in), optional :: cross_polarized + integer :: newdat, nflip, nfsample, neme, ndepth, nqd, ndphi + integer :: nutc, nkhz, ndf, ipol, ntol, nkv, nhist, nsum, nsave + logical :: invalid_raised, xpol + character(len=12) :: mycall, hiscall + character(len=6) :: hisgrid + character(len=22) :: decoded + real :: dphi, sync2, a(5), dt, pol, qual + + call make_map65_wave(waveform, tones, mode65, map65_base_frequency) + xpol = .false. + if (present(cross_polarized)) xpol = cross_polarized + if (xpol) then + waveform(3:4,:) = waveform(1:2,:) + else + waveform(3:4,:) = ieee_value(0.0_real32, ieee_quiet_nan) + endif + newdat = 1 + nflip = polarity + nfsample = 96000 + mycall = 'K1ABC ' + hiscall = 'W9XYZ ' + hisgrid = 'FN42 ' + neme = 0 + ndepth = 3 + nqd = 1 + dphi = 0.0 + ndphi = 0 + nutc = 1 + nkhz = 1 + ndf = 0 + ipol = 0 + ntol = 100 + sync2 = 0.0 + a = 0.0 + dt = -1.7 + pol = 0.0 + nkv = -1 + nhist = -1 + nsum = 0 + nsave = 0 + qual = -999.0 + decoded = ' ' + call ieee_set_flag(ieee_invalid, .false.) + call decode1a(waveform, newdat, map65_base_frequency, nflip, mode65, nfsample, xpol, mycall, hiscall, & + hisgrid, neme, ndepth, nqd, dphi, ndphi, nutc, nkhz, ndf, ipol, ntol, sync2, & + a, dt, pol, nkv, nhist, nsum, nsave, qual, decoded) + call ieee_get_flag(ieee_invalid, invalid_raised) + + call require(decoded == padded_message('K1ABC W9XYZ FN42'), description//' message') + call require(.not. invalid_raised, description//' avoids invalid arithmetic') + call require(newdat == 0, description//' consumes new data') + call require(ieee_is_finite(sync2), description//' finite sync metric') + call require(ieee_is_finite(dt), description//' finite timing') + call require(ieee_is_finite(pol), description//' finite polarization') + call require(ieee_is_finite(qual), description//' finite quality') + call require(ieee_is_finite(a(1)) .and. ieee_is_finite(a(2)), description//' finite AFC') + end subroutine test_mode + +end program test_map65_jt65_handoff diff --git a/tests/unit/jt65/test_map65_jt65_message_validity.f90 b/tests/unit/jt65/test_map65_jt65_message_validity.f90 new file mode 100644 index 00000000..ec1f3dff --- /dev/null +++ b/tests/unit/jt65/test_map65_jt65_message_validity.f90 @@ -0,0 +1,77 @@ +program test_map65_jt65_message_validity + use packjt, only: is_valid_jt65_codeword, packmsg, packcall, packgrid + implicit none + + integer, parameter :: NBASE = 37*36*10*27*27*27 + integer :: dat(12), itype, nc1, ng + logical :: text + character(len=4) :: grid + character(len=6) :: call + character(len=22) :: message + + message = 'K1ABC W9XYZ FN42' + call packmsg(message, dat, itype) + call require(is_valid_jt65_codeword(dat), 'a standard structured message is valid') + + message = 'THIS IS FREE TEXT' + call packmsg(message, dat, itype) + call require(is_valid_jt65_codeword(dat), 'a free-text message is valid') + + call = '498IVA' + call packcall(call, nc1, text) + grid = 'EE84' + call packgrid(grid, ng, text) + call pack_fields(nc1, 265779995, ng, dat) + call require(.not. is_valid_jt65_codeword(dat), & + 'the reproduced false decode has an impossible second callsign') + + call pack_fields(NBASE + 1, NBASE - 1, 0, dat) + call require(is_valid_jt65_codeword(dat), 'a reserved first-field message is valid') + + call pack_fields(267796945, NBASE - 1, 0, dat) + call require(is_valid_jt65_codeword(dat), 'the final JT65v2 first-field value is valid') + + call pack_fields(NBASE, 0, 0, dat) + call require(.not. is_valid_jt65_codeword(dat), & + 'the unassigned first-field value is invalid') + + call pack_fields(267796946, 0, 0, dat) + call require(.not. is_valid_jt65_codeword(dat), & + 'a first field above the JT65v2 range is invalid') + + call pack_fields(0, NBASE, 0, dat) + call require(.not. is_valid_jt65_codeword(dat), & + 'a non-callsign second field is invalid') + + print '(a)', 'MAP65 JT65 message validity tests passed.' + +contains + + subroutine pack_fields(first_call, second_call, packed_grid, symbols) + integer, intent(in) :: first_call, second_call, packed_grid + integer, intent(out) :: symbols(12) + + symbols(1) = iand(ishft(first_call,-22),63) + symbols(2) = iand(ishft(first_call,-16),63) + symbols(3) = iand(ishft(first_call,-10),63) + symbols(4) = iand(ishft(first_call,-4),63) + symbols(5) = 4*iand(first_call,15) + iand(ishft(second_call,-26),3) + symbols(6) = iand(ishft(second_call,-20),63) + symbols(7) = iand(ishft(second_call,-14),63) + symbols(8) = iand(ishft(second_call,-8),63) + symbols(9) = iand(ishft(second_call,-2),63) + symbols(10) = 16*iand(second_call,3) + iand(ishft(packed_grid,-12),15) + symbols(11) = iand(ishft(packed_grid,-6),63) + symbols(12) = iand(packed_grid,63) + end subroutine pack_fields + + subroutine require(condition, description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + + if (.not. condition) then + print '(a)', 'FAIL: '//description + error stop 1 + endif + end subroutine require +end program test_map65_jt65_message_validity diff --git a/tests/unit/jt65/test_map65_s3avg_contracts.f90 b/tests/unit/jt65/test_map65_s3avg_contracts.f90 new file mode 100644 index 00000000..9a8b1bce --- /dev/null +++ b/tests/unit/jt65/test_map65_s3avg_contracts.f90 @@ -0,0 +1,137 @@ +program test_map65_s3avg_contracts + use encode65_mod, only: encode65 + use s3avg_mod, only: s3avg + implicit none + + call test_group_isolation_and_tolerance + call test_timing_and_duplicates + print '(a)', 'MAP65 s3avg contract tests passed.' + +contains + + subroutine test_group_isolation_and_tolerance + real :: s3(64,63) + character(len=22) :: target, decoded + integer :: code(63), nsave, nsum, nkv + + target='K1ABC W9XYZ FN42' + call make_spectrum(target,code,s3) + nsave=0 + + call next_slot(nsave) + nsum=-77 + call s3avg(nsave,1,1000,1000,0.0,1,1,100,s3,nsum,nkv,decoded) + call require(nsum == 1 .and. nkv == 0 .and. len_trim(decoded) == 0, & + 'first frequency observation is isolated') + + call next_slot(nsave) + call s3avg(nsave,1,1002,1000,0.0,2,1,100,s3,nsum,nkv,decoded) + call require(nsum == 2 .and. nkv == 2 .and. decoded(1:len_trim(target)) == target, & + 'same-parity frequency observations decode as a pair') + + call next_slot(nsave) + call s3avg(nsave,1,1003,3000,0.0,1,1,100,s3,nsum,nkv,decoded) + call require(nsum == 1 .and. nkv == 0 .and. len_trim(decoded) == 0, & + 'frequency-separated observations do not join the group') + + call next_slot(nsave) + call s3avg(nsave,1,1101,5000,0.0,1,1,100,s3,nsum,nkv,decoded) + call require(nsum == 1 .and. nkv == 0, 'dynamic tolerance starts a new group') + + call next_slot(nsave) + call s3avg(nsave,1,1103,5050,0.0,1,1,50,s3,nsum,nkv,decoded) + call require(nsum == 2 .and. nkv == 2 .and. decoded(1:len_trim(target)) == target, & + 'dynamic tolerance includes its inclusive boundary') + + call next_slot(nsave) + call s3avg(nsave,1,1105,5000,0.0,1,1,10,s3,nsum,nkv,decoded) + call require(nsum == 2 .and. nkv == 2 .and. decoded(1:len_trim(target)) == target, & + 'dynamic tolerance excludes the saved 5050-Hz frame') + + call next_slot(nsave) + call s3avg(nsave,1,1107,5011,0.0,1,1,10,s3,nsum,nkv,decoded) + call require(nsum == 1 .and. nkv == 0 .and. len_trim(decoded) == 0, & + 'dynamic tolerance rejects frequencies outside its boundary') + end subroutine test_group_isolation_and_tolerance + + subroutine test_timing_and_duplicates + real :: s3(64,63) + character(len=22) :: target, decoded + integer :: code(63), nsave, nsum, nkv, duplicate_slot + + target='K1ABC W9XYZ FN42' + call make_spectrum(target,code,s3) + nsave=7 + + call next_slot(nsave) + call s3avg(nsave,1,1200,7000,0.00,1,1,100,s3,nsum,nkv,decoded) + call require(nsum == 1 .and. nkv == 0, 'timing fixture starts alone') + + call next_slot(nsave) + call s3avg(nsave,1,1202,7000,0.19,1,1,100,s3,nsum,nkv,decoded) + call require(nsum == 2 .and. nkv == 2 .and. decoded(1:len_trim(target)) == target, & + 'nearby timing observations join the group') + + call next_slot(nsave) + call s3avg(nsave,1,1204,7000,0.50,1,1,100,s3,nsum,nkv,decoded) + call require(nsum == 1 .and. nkv == 0 .and. len_trim(decoded) == 0, & + 'distant timing observations remain isolated') + + call next_slot(nsave) + call s3avg(nsave,1,1300,9000,0.00,1,1,100,s3,nsum,nkv,decoded) + call require(nsum == 1 .and. nkv == 0, 'duplicate fixture starts alone') + duplicate_slot=nsave + + call next_slot(nsave) + call s3avg(nsave,1,1300,9000,0.01,1,1,100,s3,nsum,nkv,decoded) + call require(nsum == 1 .and. nkv == 0 .and. nsave == duplicate_slot, & + 'same-UTC duplicate is suppressed and ring position rolls back') + + call next_slot(nsave) + call s3avg(nsave,1,1302,9000,0.02,1,1,100,s3,nsum,nkv,decoded) + call require(nsum == 2 .and. nkv == 2 .and. decoded(1:len_trim(target)) == target, & + 'next same-parity observation forms exactly a pair after duplicate') + + call next_slot(nsave) + call s3avg(nsave,1,1400,11000,0.00,1,1,100,s3,nsum,nkv,decoded) + call require(nsum == 1 .and. nkv == 0, 'sync-polarity fixture starts alone') + + call next_slot(nsave) + call s3avg(nsave,1,1402,11000,0.00,1,-1,100,s3,nsum,nkv,decoded) + call require(nsum == 1 .and. nkv == 0 .and. len_trim(decoded) == 0, & + 'opposite sync polarities do not join the group') + + call next_slot(nsave) + call s3avg(nsave,1,1404,11000,0.00,1,-1,100,s3,nsum,nkv,decoded) + call require(nsum == 2 .and. nkv == 2 .and. decoded(1:len_trim(target)) == target, & + 'matching negative sync polarities decode as a pair') + end subroutine test_timing_and_duplicates + + subroutine make_spectrum(message,code,s3) + character(len=*), intent(in) :: message + integer, intent(out) :: code(63) + real, intent(out) :: s3(64,63) + integer :: j + + call encode65(message,code) + s3=1.0 + do j=1,63 + s3(code(j)+1,j)=100.0 + enddo + end subroutine make_spectrum + + subroutine next_slot(nsave) + integer, intent(inout) :: nsave + nsave=mod(nsave,64)+1 + end subroutine next_slot + + subroutine require(condition, description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + if (.not. condition) then + print '(a)', 'FAIL: '//description + error stop 1 + endif + end subroutine require + +end program test_map65_s3avg_contracts diff --git a/tests/unit/jt9/CMakeLists.txt b/tests/unit/jt9/CMakeLists.txt new file mode 100644 index 00000000..724bff19 --- /dev/null +++ b/tests/unit/jt9/CMakeLists.txt @@ -0,0 +1,11 @@ +add_executable (test_jt9_input_validation test_jt9_input_validation.f90) +wsjt_link_common_fortran (test_jt9_input_validation) +add_test (NAME test_jt9_input_validation COMMAND test_jt9_input_validation) + +add_executable (test_readwav_validation test_readwav_validation.f90) +wsjt_link_common_fortran (test_readwav_validation) +add_test (NAME test_readwav_validation COMMAND test_readwav_validation) +if (WSJT_ENABLE_TSAN) + set_tests_properties (test_readwav_validation PROPERTIES + ENVIRONMENT "TSAN_OPTIONS=${wsjt_tsan_fortran_options}") +endif () diff --git a/tests/unit/jt9/test_jt9_cli_validation.cmake b/tests/unit/jt9/test_jt9_cli_validation.cmake new file mode 100644 index 00000000..16f2499e --- /dev/null +++ b/tests/unit/jt9/test_jt9_cli_validation.cmake @@ -0,0 +1,17 @@ +function (require_rejection option value) + execute_process ( + COMMAND "${JT9}" "${option}" "${value}" + RESULT_VARIABLE result + ERROR_VARIABLE stderr) + if (result EQUAL 0) + message (FATAL_ERROR "${option}=${value} unexpectedly succeeded") + endif () + if (NOT stderr MATCHES "jt9: invalid value") + message (FATAL_ERROR "${option}=${value} did not report a validation error: ${stderr}") + endif () +endfunction () + +require_rejection (-Q 6) +require_rejection (-Q invalid) +require_rejection (-p invalid) +require_rejection (-m invalid) diff --git a/tests/unit/jt9/test_jt9_input_validation.f90 b/tests/unit/jt9/test_jt9_input_validation.f90 new file mode 100644 index 00000000..c9c88370 --- /dev/null +++ b/tests/unit/jt9/test_jt9_input_validation.f90 @@ -0,0 +1,63 @@ +program test_jt9_input_validation + use jt9_input_validation, only: parse_integer, parse_real, parse_wav_filename_nutc + implicit none + + integer :: integer_value, nutc + real(kind=8) :: real_value + logical :: ok + + call parse_integer('42', integer_value, ok) + call assert_true(ok .and. integer_value == 42, 'integer parsing accepts integers') + + call parse_integer('-42', integer_value, ok) + call assert_true(ok .and. integer_value == -42, 'integer parsing accepts signs') + + call parse_integer('not-a-number', integer_value, ok) + call assert_true(.not. ok, 'integer parsing rejects text') + + call parse_integer('42x', integer_value, ok) + call assert_true(.not. ok, 'integer parsing requires one complete token') + + call parse_real('7.5', real_value, ok) + call assert_true(ok .and. real_value == 7.5d0, 'real parsing accepts finite values') + + call parse_real('60', real_value, ok) + call assert_true(ok .and. real_value == 60.d0, 'real parsing accepts whole numbers') + + call parse_real('7.5e1', real_value, ok) + call assert_true(ok .and. real_value == 75.d0, 'real parsing accepts decimal exponents') + + call parse_real('NaN', real_value, ok) + call assert_true(.not. ok, 'real parsing rejects NaN') + + call parse_real('7.5x', real_value, ok) + call assert_true(.not. ok, 'real parsing requires one complete token') + + call parse_wav_filename_nutc('240101_1234.wav', nutc) + call assert_true(nutc == 1234, 'four-digit timestamp is read') + + call parse_wav_filename_nutc('240101_123456.WAV', nutc) + call assert_true(nutc == 123456, 'six-digit timestamp is read') + + call parse_wav_filename_nutc('recording2026.wav', nutc) + call assert_true(nutc == 0, 'four-digit suffix without separator defaults to midnight') + + call parse_wav_filename_nutc('valid-audio', nutc) + call assert_true(nutc == 0, 'extensionless files default to midnight') + + call parse_wav_filename_nutc('a.wav', nutc) + call assert_true(nutc == 0, 'short names default to midnight') + +contains + + subroutine assert_true(condition, message) + logical, intent(in) :: condition + character(len=*), intent(in) :: message + + if (.not. condition) then + write(*, '(A)') message + error stop 1 + end if + end subroutine assert_true + +end program test_jt9_input_validation diff --git a/tests/unit/jt9/test_readwav_validation.f90 b/tests/unit/jt9/test_readwav_validation.f90 new file mode 100644 index 00000000..fd3d4603 --- /dev/null +++ b/tests/unit/jt9/test_readwav_validation.f90 @@ -0,0 +1,162 @@ +program test_readwav_validation + use readwav, only: wav_header + implicit none + + type(wav_header) :: wav + integer :: samples_read, status, unit + integer*2 :: samples(4) + character(len=128) :: message + + call write_valid_wav('test_readwav_validation.wav') + call wav%read('test_readwav_validation.wav', status, message) + call assert_true(status == 0, 'valid WAV is accepted') + call assert_true(wav%audio_format%sample_rate == 12000, 'format chunk is read') + close(wav%lun) + + call write_format_wav('test_readwav_11025.wav', 1, 1, 11025, 16) + call wav%read('test_readwav_11025.wav', status, message) + call assert_true(status == 0, 'supported JT4 sample rate is accepted') + close(wav%lun) + + call write_format_wav('test_readwav_stereo.wav', 1, 2, 12000, 16) + call wav%read('test_readwav_stereo.wav', status, message) + call assert_true(status /= 0, 'unsupported sample representation is rejected') + + call write_format_wav('test_readwav_48000.wav', 1, 1, 48000, 16) + call wav%read('test_readwav_48000.wav', status, message) + call assert_true(status /= 0, 'unsupported sample rate is rejected') + + call write_short_file('test_readwav_short.wav') + call wav%read('test_readwav_short.wav', status, message) + call assert_true(status /= 0, 'short WAV is rejected') + + call write_non_wave_file('test_readwav_not_wave.wav') + call wav%read('test_readwav_not_wave.wav', status, message) + call assert_true(status /= 0, 'non-WAVE RIFF file is rejected') + + call write_unpadded_odd_data('test_readwav_odd_data.wav') + call wav%read('test_readwav_odd_data.wav', status, message) + call assert_true(status == 0 .and. wav%data_size == 1, 'unpadded final data chunk is accepted') + close(wav%lun) + + call write_wav_with_trailing_chunk('test_readwav_trailing_chunk.wav') + call wav%read('test_readwav_trailing_chunk.wav', status, message) + call assert_true(status == 0, 'WAV with trailing metadata is accepted') + call wav%read_samples(samples, samples_read, status, message) + call assert_true(status == 0 .and. samples_read == 1, 'only data chunk samples are read') + call assert_true(samples(1) == 1234 .and. all(samples(2:) == 0), & + 'sample reads zero-fill without consuming metadata') + call wav%read_samples(samples, samples_read, status, message) + call assert_true(status == 0 .and. samples_read == 0, 'data chunk exhaustion is reported') + close(wav%lun) + + call write_truncated_chunk('test_readwav_truncated.wav') + call wav%read('test_readwav_truncated.wav', status, message) + call assert_true(status /= 0, 'truncated chunk is rejected') + +contains + + subroutine write_valid_wav(filename) + character(len=*), intent(in) :: filename + integer*2 :: audio_format, channels, block_align, bits_per_sample + integer :: sample_rate, byte_rate + + audio_format = 1 + channels = 1 + sample_rate = 12000 + byte_rate = 24000 + block_align = 2 + bits_per_sample = 16 + open(newunit=unit, file=filename, access='stream', form='unformatted', status='replace') + write(unit) 'RIFF', 36, 'WAVE', 'fmt ', 16, audio_format, channels, sample_rate, & + byte_rate, block_align, bits_per_sample, 'data', 0 + close(unit) + end subroutine write_valid_wav + + subroutine write_short_file(filename) + character(len=*), intent(in) :: filename + + open(newunit=unit, file=filename, access='stream', form='unformatted', status='replace') + write(unit) 'RIFF' + close(unit) + end subroutine write_short_file + + subroutine write_format_wav(filename, audio_format, channels, sample_rate, bits_per_sample) + character(len=*), intent(in) :: filename + integer, intent(in) :: audio_format, channels, sample_rate, bits_per_sample + integer*2 :: format_value, channel_value, block_align, bits_value + integer :: byte_rate + + format_value = audio_format + channel_value = channels + bits_value = bits_per_sample + block_align = channels * bits_per_sample / 8 + byte_rate = sample_rate * block_align + open(newunit=unit, file=filename, access='stream', form='unformatted', status='replace') + write(unit) 'RIFF', 36, 'WAVE', 'fmt ', 16, format_value, channel_value, sample_rate, & + byte_rate, block_align, bits_value, 'data', 0 + close(unit) + end subroutine write_format_wav + + subroutine write_non_wave_file(filename) + character(len=*), intent(in) :: filename + + open(newunit=unit, file=filename, access='stream', form='unformatted', status='replace') + write(unit) 'RIFF', 36, 'NOPE' + close(unit) + end subroutine write_non_wave_file + + subroutine write_unpadded_odd_data(filename) + character(len=*), intent(in) :: filename + integer*2 :: audio_format, channels, block_align, bits_per_sample + integer :: sample_rate, byte_rate + + audio_format = 1 + channels = 1 + sample_rate = 12000 + byte_rate = 24000 + block_align = 2 + bits_per_sample = 16 + open(newunit=unit, file=filename, access='stream', form='unformatted', status='replace') + write(unit) 'RIFF', 37, 'WAVE', 'fmt ', 16, audio_format, channels, sample_rate, & + byte_rate, block_align, bits_per_sample, 'data', 1, 'x' + close(unit) + end subroutine write_unpadded_odd_data + + subroutine write_truncated_chunk(filename) + character(len=*), intent(in) :: filename + + open(newunit=unit, file=filename, access='stream', form='unformatted', status='replace') + write(unit) 'RIFF', 36, 'WAVE', 'fmt ', 32 + close(unit) + end subroutine write_truncated_chunk + + subroutine write_wav_with_trailing_chunk(filename) + character(len=*), intent(in) :: filename + integer*2 :: audio_format, channels, block_align, bits_per_sample, sample + integer :: sample_rate, byte_rate + + audio_format = 1 + channels = 1 + sample_rate = 12000 + byte_rate = 24000 + block_align = 2 + bits_per_sample = 16 + sample = 1234 + open(newunit=unit, file=filename, access='stream', form='unformatted', status='replace') + write(unit) 'RIFF', 50, 'WAVE', 'fmt ', 16, audio_format, channels, sample_rate, & + byte_rate, block_align, bits_per_sample, 'data', 2, sample, 'JUNK', 4, 'abcd' + close(unit) + end subroutine write_wav_with_trailing_chunk + + subroutine assert_true(condition, text) + logical, intent(in) :: condition + character(len=*), intent(in) :: text + + if (.not. condition) then + write(*, '(A)') text + error stop 1 + end if + end subroutine assert_true + +end program test_readwav_validation diff --git a/tests/unit/jtty/CMakeLists.txt b/tests/unit/jtty/CMakeLists.txt new file mode 100644 index 00000000..8dd698d0 --- /dev/null +++ b/tests/unit/jtty/CMakeLists.txt @@ -0,0 +1,198 @@ +add_executable (test_jtty_pack test_jtty_pack.f90) +target_include_directories (test_jtty_pack PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_jtty_pack) + +add_executable (test_jtty_source_codec test_jtty_source_codec.f90) +target_include_directories (test_jtty_source_codec PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_jtty_source_codec) +add_test (NAME test_jtty_source_codec COMMAND test_jtty_source_codec) +set_tests_properties (test_jtty_source_codec PROPERTIES + PASS_REGULAR_EXPRESSION "test_jtty_source_codec: all checks passed" +) + +add_executable (test_tbcc test_tbcc.f90) +target_include_directories (test_tbcc PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_tbcc) +add_test (NAME test_tbcc COMMAND test_tbcc) +set_tests_properties (test_tbcc PROPERTIES + PASS_REGULAR_EXPRESSION "test_tbcc: all checks passed" +) + +add_executable (test_jtty_block_pow test_jtty_block_pow.f90) +target_include_directories (test_jtty_block_pow PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_jtty_block_pow) +add_test (NAME test_jtty_block_pow COMMAND test_jtty_block_pow) +set_tests_properties (test_jtty_block_pow PROPERTIES + PASS_REGULAR_EXPRESSION "test_jtty_block_pow: all checks passed" +) + +add_executable (test_jtty_message_matching test_jtty_message_matching.f90) +target_include_directories (test_jtty_message_matching PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_jtty_message_matching) +add_test (NAME test_jtty_message_matching COMMAND test_jtty_message_matching) +set_tests_properties (test_jtty_message_matching PROPERTIES + PASS_REGULAR_EXPRESSION "test_jtty_message_matching: all checks passed" +) + +add_executable (test_jtty_receive_state test_jtty_receive_state.f90) +target_include_directories (test_jtty_receive_state PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_jtty_receive_state) +add_test (NAME test_jtty_receive_state COMMAND test_jtty_receive_state) +set_tests_properties (test_jtty_receive_state PROPERTIES + PASS_REGULAR_EXPRESSION "test_jtty_receive_state: all checks passed" +) + +add_executable (test_jtty_adjacent_decode test_jtty_adjacent_decode.f90) +target_include_directories (test_jtty_adjacent_decode PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_jtty_adjacent_decode) +add_test (NAME test_jtty_adjacent_decode COMMAND test_jtty_adjacent_decode) +# These decoder tests are compute-heavy under ARM emulation. Their timeouts +# include headroom for hosted-runner variability. +set_tests_properties (test_jtty_adjacent_decode PROPERTIES + PASS_REGULAR_EXPRESSION "test_jtty_adjacent_decode: all checks passed" + TIMEOUT 180 +) + +add_executable (test_jtty_structured_decode + test_jtty_structured_decode.f90 + jtty_cpp_n1mm_smoke.cpp) +target_include_directories (test_jtty_structured_decode PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_jtty_structured_decode) +target_link_libraries (test_jtty_structured_decode PRIVATE Qt5::Core) +add_test (NAME test_jtty_structured_decode COMMAND test_jtty_structured_decode) +set_tests_properties (test_jtty_structured_decode PROPERTIES + PASS_REGULAR_EXPRESSION "test_jtty_structured_decode: all checks passed" + TIMEOUT 240 +) + +add_executable (test_jtty_overlap_decode test_jtty_overlap_decode.f90) +target_include_directories (test_jtty_overlap_decode PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_jtty_overlap_decode) +add_test (NAME test_jtty_overlap_decode COMMAND test_jtty_overlap_decode) +set_tests_properties (test_jtty_overlap_decode PROPERTIES + PASS_REGULAR_EXPRESSION "test_jtty_overlap_decode: all checks passed" + TIMEOUT 180 +) + +add_test (NAME test_jtty_overlap_decode_480 COMMAND test_jtty_overlap_decode 480) +set_tests_properties (test_jtty_overlap_decode_480 PROPERTIES + PASS_REGULAR_EXPRESSION "test_jtty_overlap_decode: all checks passed" + TIMEOUT 240 +) + +add_executable (test_jtty_sticky_retry test_jtty_sticky_retry.f90) +target_include_directories (test_jtty_sticky_retry PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_jtty_sticky_retry) +add_test (NAME test_jtty_sticky_retry COMMAND test_jtty_sticky_retry) +set_tests_properties (test_jtty_sticky_retry PROPERTIES + PASS_REGULAR_EXPRESSION "test_jtty_sticky_retry: all checks passed" + TIMEOUT 60 +) + +add_executable (test_jtty_windowed_decode test_jtty_windowed_decode.f90) +target_include_directories (test_jtty_windowed_decode PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_jtty_windowed_decode) +add_test (NAME test_jtty_windowed_decode COMMAND test_jtty_windowed_decode) +set_tests_properties (test_jtty_windowed_decode PROPERTIES + PASS_REGULAR_EXPRESSION "test_jtty_windowed_decode: all checks passed" + TIMEOUT 180 +) + +add_executable (test_jtty_gap_merge test_jtty_gap_merge.f90) +target_include_directories (test_jtty_gap_merge PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_jtty_gap_merge) +add_test (NAME test_jtty_gap_merge COMMAND test_jtty_gap_merge) +set_tests_properties (test_jtty_gap_merge PROPERTIES + PASS_REGULAR_EXPRESSION "test_jtty_gap_merge: all checks passed" + TIMEOUT 180 +) + +configure_file(${CMAKE_SOURCE_DIR}/tests/fixtures/jtty/jtty_msgs.txt "${CMAKE_CURRENT_BINARY_DIR}/jtty_msgs.txt" COPYONLY) + +add_test (NAME test_jtty_pack COMMAND test_jtty_pack) +set_tests_properties (test_jtty_pack PROPERTIES + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + PASS_REGULAR_EXPRESSION "^ 3 3 67 14 NOW IS THE TIME FOR ALL GOOD MEN TO COME TO THE AID OF THEIR PARTY\.;^ 3 3 52 11 THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG, TWICE\.;\nTotal messages: 36 Number of errors: 0\n$" +) + +add_executable (test_jtty_frequency_window test_jtty_frequency_window.f90) +wsjt_link_common_fortran (test_jtty_frequency_window) +add_test (NAME test_jtty_frequency_window COMMAND test_jtty_frequency_window) + +add_executable (test_jtty_surface_ranges test_jtty_surface_ranges.f90) +wsjt_link_common_fortran (test_jtty_surface_ranges) +add_test (NAME test_jtty_surface_ranges COMMAND test_jtty_surface_ranges) +set_tests_properties (test_jtty_surface_ranges PROPERTIES TIMEOUT 180) + +add_executable (test_jtty_get_updates test_jtty_get_updates.f90) +target_include_directories (test_jtty_get_updates PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_jtty_get_updates) +add_test (NAME test_jtty_get_updates COMMAND test_jtty_get_updates) +set_tests_properties (test_jtty_get_updates PROPERTIES + PASS_REGULAR_EXPRESSION "test_jtty_get_updates: all checks passed" +) + +add_executable (test_jtty_txstream + test_jtty_txstream.cpp + ${CMAKE_SOURCE_DIR}/Logger.cpp + ${CMAKE_SOURCE_DIR}/Modulator/JttyPcmFifo.cpp + ${CMAKE_SOURCE_DIR}/Audio/TxAudioQueue.cpp + ${CMAKE_SOURCE_DIR}/Modulator/JttyTxStream.cpp + ${CMAKE_SOURCE_DIR}/Audio/soundout.cpp) +target_link_libraries (test_jtty_txstream wsjt_qt Boost::log_setup Qt5::Test Qt5::Multimedia) +add_test (NAME test_jtty_txstream COMMAND test_jtty_txstream) +if (WSJT_ENABLE_TSAN) + set_tests_properties (test_jtty_txstream PROPERTIES + ENVIRONMENT + "QT_QPA_PLATFORM=offscreen;TSAN_OPTIONS=${wsjt_tsan_gui_options}") +endif () + +add_executable (test_jtty_messages test_jtty_messages.cpp) +target_link_libraries (test_jtty_messages Qt5::Test) +add_test (NAME test_jtty_messages COMMAND test_jtty_messages) + +add_executable (test_jtty_draft_acceptance test_jtty_draft_acceptance.cpp) +target_link_libraries (test_jtty_draft_acceptance Qt5::Test) +add_test (NAME test_jtty_draft_acceptance COMMAND test_jtty_draft_acceptance) + +add_executable (test_jtty_n1mm test_jtty_n1mm.cpp) +target_link_libraries (test_jtty_n1mm Qt5::Test) +add_test (NAME test_jtty_n1mm COMMAND test_jtty_n1mm) + +add_executable (test_mmttyif + test_mmttyif.cpp + ${CMAKE_SOURCE_DIR}/widgets/MMTTYIF.cpp +) +target_link_libraries (test_mmttyif Qt5::Test Qt5::Network) +add_test (NAME test_mmttyif COMMAND test_mmttyif) +# Connection setup may retry for several seconds on slow Windows runners. +set_tests_properties (test_mmttyif PROPERTIES TIMEOUT 30) + +add_executable (test_jtty_tbcc_list_decoder test_jtty_tbcc_list_decoder.f90) +wsjt_link_common_fortran (test_jtty_tbcc_list_decoder) +add_test (NAME test_jtty_tbcc_list_decoder COMMAND test_jtty_tbcc_list_decoder) + +add_executable (test_jtty_tbcc_decoder test_jtty_tbcc_decoder.f90) +wsjt_link_common_fortran (test_jtty_tbcc_decoder) +add_test (NAME test_jtty_tbcc_decoder COMMAND test_jtty_tbcc_decoder) + +add_executable (test_jtty_tbcc_code_profile test_jtty_tbcc_code_profile.f90) +wsjt_link_common_fortran (test_jtty_tbcc_code_profile) +add_test (NAME test_jtty_tbcc_code_profile COMMAND test_jtty_tbcc_code_profile) + +add_executable (test_jtty_payload_correlators test_jtty_payload_correlators.f90) +wsjt_link_common_fortran (test_jtty_payload_correlators) +add_test (NAME test_jtty_payload_correlators COMMAND test_jtty_payload_correlators) + +add_executable (test_jtty_replay_ownership + test_jtty_replay_ownership.cpp + ${CMAKE_SOURCE_DIR}/DecDataMutex.cpp) +target_link_libraries (test_jtty_replay_ownership + Qt5::Core Qt5::Test) +add_test (NAME test_jtty_replay_ownership COMMAND test_jtty_replay_ownership) +set_tests_properties (test_jtty_replay_ownership PROPERTIES + TIMEOUT 30 LABELS "receive-handoff;jtty-replay") +if (WSJT_ENABLE_TSAN) + set_tests_properties (test_jtty_replay_ownership PROPERTIES + ENVIRONMENT "TSAN_OPTIONS=halt_on_error=1:exitcode=66") +endif () diff --git a/tests/unit/jtty/jtty_cpp_n1mm_smoke.cpp b/tests/unit/jtty/jtty_cpp_n1mm_smoke.cpp new file mode 100644 index 00000000..1d666113 --- /dev/null +++ b/tests/unit/jtty/jtty_cpp_n1mm_smoke.cpp @@ -0,0 +1,78 @@ +#include "widgets/JttyN1mm.hpp" +#include "wsjtx_config.h" + +#include +#include + +extern "C" void genjtty_atoms_c (Jtty::NativeAtomDescriptor const atoms[], int natoms, + int tones[], int* nsym, int* status); +extern "C" void genjtty_profile_ (char*, int const*, int*, int*, fortran_charlen_t); + +extern "C" int jtty_cpp_n1mm_smoke (int tones[], int* nsym) +{ + auto const compiled = Jtty::compileN1mmMessage ( + QStringLiteral ("[[JTTY:CALL_EXCH]] W9XYZ 32D EMA"), + Jtty::NativeExchangeProfile::FieldDay); + *nsym = 0; + int status = static_cast (Jtty::NativeEncodeStatus::InvalidDescriptor); + if (compiled.isNative ()) { + genjtty_atoms_c (compiled.atoms.constData (), compiled.atoms.size (), + tones, nsym, &status); + } + return status; +} + +extern "C" int jtty_cpp_cq_smoke (int tones[], int* nsym, char text[], int chained) +{ + Jtty::NativeMacroContext const context {QStringLiteral ("K1ABC"), {}, 0}; + auto const compiled = Jtty::compileNativeMacro ( + 1, Jtty::nativeMacroTemplate (1), context); + *nsym = 0; + int status = static_cast (Jtty::NativeEncodeStatus::InvalidDescriptor); + if (compiled.isNative ()) { + auto const frame = Jtty::transmitFrame (compiled.text, chained != 0).toLatin1 (); + std::copy (frame.cbegin (), frame.cend (), text); + genjtty_atoms_c (compiled.atoms.constData (), compiled.atoms.size (), + tones, nsym, &status); + } + return status; +} + +extern "C" int jtty_cpp_rtty_smoke (int tones[], int* nsym) +{ + Jtty::NativeMacroContext context { + QStringLiteral ("K1ABC"), {}, 1, Jtty::NativeExchangeProfile::RttyRoundup, + QStringLiteral ("DX")}; + *nsym = 0; + int status = static_cast (Jtty::NativeEncodeStatus::InvalidDescriptor); + std::array packedTones {}; + struct Example {int serial; QString raw; QString canonical;}; + std::array const examples {{ + {1, QStringLiteral ("599 001"), QStringLiteral ("599 001")}, + {5, QStringLiteral ("599 05"), QStringLiteral ("599 005")}, + {123, QStringLiteral ("599 0123"), QStringLiteral ("599 123")}}}; + for (auto const& example : examples) { + context.serialNumber = example.serial; + auto const compiled = Jtty::compileNativeMacro (8, Jtty::nativeMacroTemplate (8), context); + if (!compiled.isNative () || compiled.text != example.canonical) { + return static_cast (Jtty::NativeEncodeStatus::InvalidDescriptor); + } + genjtty_atoms_c (compiled.atoms.constData (), compiled.atoms.size (), tones, nsym, &status); + if (status != static_cast (Jtty::NativeEncodeStatus::Ok) || *nsym <= 0) return status; + auto text = Jtty::transmitFrame (example.raw, false).toLatin1 (); + int packedSymbols {}; + auto profile = static_cast (context.exchangeProfile); + genjtty_profile_ (text.data (), &profile, packedTones.data (), &packedSymbols, text.size ()); + if (packedSymbols != *nsym || !std::equal (tones, tones + *nsym, packedTones.cbegin ()) || + text != Jtty::transmitFrame (example.canonical, false).toLatin1 ()) { + return static_cast (Jtty::NativeEncodeStatus::InvalidDescriptor); + } + text = Jtty::transmitFrame (example.raw, false).toLatin1 (); + profile = static_cast (Jtty::NativeExchangeProfile::None); + genjtty_profile_ (text.data (), &profile, packedTones.data (), &packedSymbols, text.size ()); + if (packedSymbols != 2 * *nsym || text != Jtty::transmitFrame (example.raw, false).toLatin1 ()) { + return static_cast (Jtty::NativeEncodeStatus::InvalidDescriptor); + } + } + return status; +} diff --git a/tests/unit/jtty/test_jtty_adjacent_decode.f90 b/tests/unit/jtty/test_jtty_adjacent_decode.f90 new file mode 100644 index 00000000..dc3e6cdd --- /dev/null +++ b/tests/unit/jtty/test_jtty_adjacent_decode.f90 @@ -0,0 +1,105 @@ +program test_jtty_adjacent_decode + + use iso_fortran_env, only: int16 + use jtty_fec, only: is13, TOTAL_K + use jtty_mdec, only: npending,pending_updates,discard_pending_updates + use jtty_mod, only: MAX_FRAMES + implicit none + + integer :: failures + + failures=0 + call run_case('CQ KA1ABC CQ','WB9XYZ TU',1,1,failures) + call run_case('WB9XYZ 599 0123','WB9XYZ TU CQ KA1ABC CQ',3,2,failures) + + if(failures.ne.0) then + write(*,'(a,i0)') 'test_jtty_adjacent_decode: failures=',failures + stop 1 + endif + write(*,'(a)') 'test_jtty_adjacent_decode: all checks passed' + +contains + + subroutine run_case(first_message,second_message,first_frames,second_frames, & + count) + character(len=*), intent(in) :: first_message,second_message + integer, intent(in) :: first_frames,second_frames + integer, intent(inout) :: count + integer, parameter :: nsps=384 + integer, parameter :: frame_symbols=size(is13)+TOTAL_K + integer :: first_tones(MAX_FRAMES*frame_symbols) + integer :: second_tones(MAX_FRAMES*frame_symbols) + integer :: first_symbols,second_symbols,first_samples,second_samples + integer :: total_samples + integer(int16), allocatable :: pcm(:) + real, allocatable :: first_wave(:),second_wave(:) + complex, allocatable :: complex_wave(:) + character(len=80) :: first_input,second_input + + call discard_pending_updates() + first_input=first_message + second_input=second_message + call genjtty(first_input,first_tones,first_symbols) + call genjtty(second_input,second_tones,second_symbols) + call expect(first_symbols.eq.first_frames*frame_symbols, & + 'the first message has the expected frame count',count) + call expect(second_symbols.eq.second_frames*frame_symbols, & + 'the second message has the expected frame count',count) + + first_samples=first_symbols*nsps + second_samples=second_symbols*nsps + total_samples=first_samples+second_samples+frame_symbols*nsps + allocate(first_wave(first_samples),second_wave(second_samples)) + allocate(complex_wave(max(first_samples,second_samples))) + allocate(pcm(total_samples)) + + call gen_jttywave(first_tones,first_symbols,nsps,2.0,12000.0,1500.0, & + complex_wave,first_wave,0,first_samples) + call gen_jttywave(second_tones,second_symbols,nsps,2.0,12000.0,1500.0, & + complex_wave,second_wave,0,second_samples) + pcm=0_int16 + pcm(1:first_samples)=int(nint(30000.0*first_wave),int16) + pcm(first_samples+1:first_samples+second_samples)= & + int(nint(30000.0*second_wave),int16) + + call rjtty_sub(pcm,1,nsps,200,2800,1500.0,50.0) + call rjtty_sub(pcm,total_samples,nsps,200,2800,1500.0,50.0) + + call expect(npending.eq.2,'the decoder keeps two adjacent messages',count) + if(npending.eq.2) then + call expect(trim(normalized(pending_updates(1)%decoded)).eq.trim(first_message), & + 'the first decoded text is retained in order',count) + call expect(trim(normalized(pending_updates(2)%decoded)).eq.trim(second_message), & + 'the second decoded text is retained in order',count) + call expect(pending_updates(1)%complete, & + 'the first message reaches end of message',count) + call expect(pending_updates(2)%complete, & + 'the second message reaches end of message',count) + endif + + deallocate(pcm,first_wave,second_wave,complex_wave) + end subroutine run_case + + function normalized(value) result(result_value) + character(len=*), intent(in) :: value + character(len=80) :: result_value + integer :: i + + result_value=adjustl(value) + do i=1,len_trim(result_value) + if(result_value(i:i).eq.'~') result_value(i:i)=' ' + enddo + end function normalized + + subroutine expect(condition,description,count) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + integer, intent(inout) :: count + + if(.not.condition) then + count=count+1 + write(*,'(a)') 'FAIL: '//description + endif + end subroutine expect + +end program test_jtty_adjacent_decode diff --git a/tests/unit/jtty/test_jtty_block_pow.f90 b/tests/unit/jtty/test_jtty_block_pow.f90 new file mode 100644 index 00000000..e4366970 --- /dev/null +++ b/tests/unit/jtty/test_jtty_block_pow.f90 @@ -0,0 +1,144 @@ +program test_jtty_block_pow + + ! Focused tests for coherent block detection (lib/jtty/jtty_block_pow.f90), + ! used as a fallback by jtty_mdecode.f90's decode_and_merge when ordinary + ! blocksize-1 (single-symbol) detection fails to decode a candidate. + + use, intrinsic :: iso_fortran_env, only: real32, int32 + use jtty_fec ! re-exports tbcc's public API: TOTAL_K, PAYLOAD_BITS, + ! tbcc_init, tbcc_encode, tbcc_wava_fsk_decode + implicit none + + call expect_block_roundtrip_and_phase_invariance() + call expect_block_detection_rescues_a_misleading_symbol() + call expect_clean_signal_unaffected_by_block_detection() + + print *, 'test_jtty_block_pow: all checks passed' + +contains + + subroutine expect_block_roundtrip_and_phase_invariance() + ! Noiseless round trip through jtty_block_pow at iblock=2 and iblock=4, + ! then through tbcc_wava_fsk_decode, at an arbitrary global carrier + ! phase -- block detection must not need to know absolute phase, only + ! stay coherent within each short block, so the result must not depend + ! on this offset. + integer(int32) :: payload(PAYLOAD_BITS), decoded(PAYLOAD_BITS) + integer(int32) :: tone_symbols(TOTAL_K) + complex(real32) :: z(0:3, TOTAL_K), phase + real(real32) :: pow_block(0:3, TOTAL_K) + logical :: success + integer :: i, t, iblk + + call tbcc_init(9) + + do i = 1, PAYLOAD_BITS + payload(i) = mod(i, 2) + end do + payload(JTTY_RESERVED_BIT) = 0 ! reserved_zero_bit requires this below + call tbcc_encode(payload, tone_symbols) + + phase = cmplx(cos(0.7_real32), sin(0.7_real32), real32) ! arbitrary global carrier phase + z = cmplx(0.0_real32, 0.0_real32, real32) + do t = 1, TOTAL_K + z(tone_symbols(t), t) = phase + end do + + do iblk = 2, 4, 2 + call jtty_block_pow(z, TOTAL_K, iblk, pow_block) + call tbcc_wava_fsk_decode(pow_block, 4, 2, & + decoded, success, reserved_zero_bit=JTTY_RESERVED_BIT) + if (.not. success) then + print *, 'test_jtty_block_pow: noiseless block decode failed, iblock=', iblk + error stop 1 + end if + if (any(decoded /= payload)) then + print *, 'test_jtty_block_pow: noiseless block decode mismatch, iblock=', iblk + error stop 1 + end if + end do + end subroutine expect_block_roundtrip_and_phase_invariance + + subroutine expect_block_detection_rescues_a_misleading_symbol() + ! A minimal, hand-verified 2-symbol block where blocksize-1 detection + ! picks the WRONG tone at position 1 (tone 1's raw |z|^2 = 1.1025 + ! exceeds tone 0's |z|^2 = 1.0 there), but tone 1's value is phase- + ! rotated 120 degrees away from the block's coherent reference (the + ! phase shared by position 1's correct tone and position 2's tone). + ! Coherently summing across the block must favor the true sequence + ! (tone 0 @ position 1, tone 2 @ position 2) despite tone 1's larger + ! single-symbol magnitude, because it doesn't add constructively: + ! |z(0,1)+z(2,2)|^2 = |1.0+1.0|^2 = 4.0 + ! |z(1,1)+z(2,2)|^2 = |1.05*exp(i*2pi/3)+1.0|^2 ~= 1.05 + ! This is the actual mechanism block detection is meant to exploit -- + ! not merely averaging out noise, but that a misleading single-symbol + ! reading doesn't survive being coherently combined with its neighbor. + complex(real32) :: z(0:3, 2) + real(real32) :: pow_block(0:3, 2) + real(real32) :: twopi, pow1_correct, pow1_wrong + + twopi = 8.0_real32*atan(1.0_real32) + + z = cmplx(0.0_real32, 0.0_real32, real32) + z(0,1) = cmplx(1.0_real32, 0.0_real32, real32) ! correct tone, position 1 + z(1,1) = 1.05_real32 * cmplx(cos(twopi/3.0_real32), & + sin(twopi/3.0_real32), real32) ! misleading tone, position 1 + z(2,2) = cmplx(1.0_real32, 0.0_real32, real32) ! correct tone, position 2 + + pow1_correct = real(z(0,1)*conjg(z(0,1))) + pow1_wrong = real(z(1,1)*conjg(z(1,1))) + if (.not. (pow1_wrong > pow1_correct)) then + print *, 'test_jtty_block_pow: test setup error -- expected tone 1 to look', & + ' stronger than tone 0 at blocksize 1' + error stop 1 + end if + + call jtty_block_pow(z, 2, 2, pow_block) + + if (.not. (pow_block(0,1) > pow_block(1,1))) then + print *, 'test_jtty_block_pow: block detection failed to rescue the', & + ' misleading symbol at position 1' + error stop 1 + end if + if (maxloc(pow_block(:,1),dim=1)-1 /= 0) then + print *, 'test_jtty_block_pow: block-detected tone at position 1 is not the correct one' + error stop 1 + end if + if (maxloc(pow_block(:,2),dim=1)-1 /= 2) then + print *, 'test_jtty_block_pow: block-detected tone at position 2 is not the correct one' + error stop 1 + end if + end subroutine expect_block_detection_rescues_a_misleading_symbol + + subroutine expect_clean_signal_unaffected_by_block_detection() + ! Non-regression: on an unambiguous, noiseless signal, blocksize-2 and + ! blocksize-4 detection must pick exactly the same tone at every + ! position as blocksize-1 already does -- block detection is a fallback + ! that should never second-guess an already-clean reading. + integer(int32) :: tone_symbols(TOTAL_K) + complex(real32) :: z(0:3, TOTAL_K) + real(real32) :: pow_block(0:3, TOTAL_K) + integer :: i, t, iblk + + do t = 1, TOTAL_K + tone_symbols(t) = mod(t, 4) ! deterministic, exercises all 4 tones + end do + + z = cmplx(0.0_real32, 0.0_real32, real32) + do t = 1, TOTAL_K + z(tone_symbols(t), t) = cmplx(1.0_real32, 0.0_real32, real32) + end do + + do iblk = 2, 4, 2 + call jtty_block_pow(z, TOTAL_K, iblk, pow_block) + do i = 1, TOTAL_K + if (maxloc(pow_block(:,i),dim=1)-1 /= tone_symbols(i)) then + print *, 'test_jtty_block_pow: clean-signal regression at position', i, & + ' iblock=', iblk + error stop 1 + end if + end do + end do + end subroutine expect_clean_signal_unaffected_by_block_detection + +end program test_jtty_block_pow diff --git a/tests/unit/jtty/test_jtty_draft_acceptance.cpp b/tests/unit/jtty/test_jtty_draft_acceptance.cpp new file mode 100644 index 00000000..f321aaf5 --- /dev/null +++ b/tests/unit/jtty/test_jtty_draft_acceptance.cpp @@ -0,0 +1,128 @@ +#include + +#include "widgets/JttyDraftAcceptanceTracker.hpp" + +class TestJttyDraftAcceptance final + : public QObject +{ + Q_OBJECT + +private slots: + void acceptedCurrentSubmissionClearsDraft () + { + JttyDraftAcceptanceTracker tracker; + tracker.trackSubmission (1); + + QVERIFY (tracker.accept (1)); + } + + void rejectedSubmissionPreservesDraft () + { + JttyDraftAcceptanceTracker tracker; + tracker.trackSubmission (1); + tracker.reject (1); + + QVERIFY (!tracker.accept (1)); + } + + void delayedAcceptancePreservesNewerDraft () + { + JttyDraftAcceptanceTracker tracker; + tracker.trackSubmission (1); + tracker.noteDraftChanged (); + + QVERIFY (!tracker.accept (1)); + } + + void identicalRetypedDraftHasNewIdentity () + { + JttyDraftAcceptanceTracker tracker; + tracker.trackSubmission (1); + tracker.noteDraftChanged (); + tracker.noteDraftChanged (); + + QVERIFY (!tracker.accept (1)); + } + + void unrelatedAcceptancePreservesDraft () + { + JttyDraftAcceptanceTracker tracker; + + QVERIFY (!tracker.accept (1)); + } + + void currentDraftReportsPendingSubmission () + { + JttyDraftAcceptanceTracker tracker; + tracker.trackSubmission (1); + + QVERIFY (tracker.hasPendingSubmissionForCurrentDraft ()); + QVERIFY (tracker.isPending (1)); + QVERIFY (!tracker.isPending (2)); + } + + void rejectedCurrentDraftCanBeRetried () + { + JttyDraftAcceptanceTracker tracker; + tracker.trackSubmission (1); + tracker.reject (1); + + QVERIFY (!tracker.hasPendingSubmissionForCurrentDraft ()); + QVERIFY (!tracker.isPending (1)); + + tracker.trackSubmission (2); + QVERIFY (tracker.hasPendingSubmissionForCurrentDraft ()); + QVERIFY (tracker.isPending (2)); + } + + void newerDraftCanBeSubmittedWhileOlderDraftIsPending () + { + JttyDraftAcceptanceTracker tracker; + tracker.trackSubmission (1); + tracker.noteDraftChanged (); + + QVERIFY (!tracker.hasPendingSubmissionForCurrentDraft ()); + + tracker.trackSubmission (2); + QVERIFY (tracker.hasPendingSubmissionForCurrentDraft ()); + QVERIFY (tracker.isPending (1)); + QVERIFY (tracker.isPending (2)); + } + + void acceptedRequestIsNoLongerPending () + { + JttyDraftAcceptanceTracker tracker; + tracker.trackSubmission (1); + + QVERIFY (tracker.accept (1)); + QVERIFY (!tracker.hasPendingSubmissionForCurrentDraft ()); + QVERIFY (!tracker.isPending (1)); + } + + void successiveAcceptedDraftsCanClear () + { + JttyDraftAcceptanceTracker tracker; + tracker.trackSubmission (1); + QVERIFY (tracker.accept (1)); + + tracker.noteDraftChanged (); + tracker.noteDraftChanged (); + tracker.trackSubmission (2); + QVERIFY (tracker.accept (2)); + } + + void olderAcceptanceDoesNotClearSuccessiveDraft () + { + JttyDraftAcceptanceTracker tracker; + tracker.trackSubmission (1); + tracker.noteDraftChanged (); + tracker.trackSubmission (2); + + QVERIFY (!tracker.accept (1)); + QVERIFY (tracker.accept (2)); + } +}; + +QTEST_GUILESS_MAIN (TestJttyDraftAcceptance) + +#include "test_jtty_draft_acceptance.moc" diff --git a/tests/unit/jtty/test_jtty_frequency_window.f90 b/tests/unit/jtty/test_jtty_frequency_window.f90 new file mode 100644 index 00000000..897fd823 --- /dev/null +++ b/tests/unit/jtty/test_jtty_frequency_window.f90 @@ -0,0 +1,89 @@ +program test_jtty_frequency_window + use jtty_mdec, only: jtty_search_window + implicit none + + integer, parameter :: first_bin=3,last_bin=4094 + real, parameter :: df=6000.0/8192.0 + integer :: ja,jb + real :: fc + logical :: usable + + fc=1500.0 + call jtty_search_window(fc,50.0,200,2800,.true.,df,first_bin,last_bin, & + ja,jb,usable) + call assert_true(usable, 'nominal window is usable') + call assert_true(fc.eq.1500.0, 'nominal center is unchanged') + call assert_true(ja.eq.int(1450.0/df), 'nominal lower bin is unchanged') + call assert_true(jb.eq.int(1550.0/df), 'nominal upper bin is unchanged') + + fc=2500.0 + call jtty_search_window(fc,1000.0,0,5000,.true.,df,first_bin,last_bin, & + ja,jb,usable) + call assert_true(usable, 'partially overlapping upper window is usable') + call assert_true(ja.eq.int(1500.0/df), 'partial upper window keeps its lower bin') + call assert_true(jb.eq.last_bin, 'partial upper window is clipped to the spectrum') + + fc=5000.0 + call jtty_search_window(fc,1000.0,0,5000,.true.,df,first_bin,last_bin, & + ja,jb,usable) + call assert_true(.not.usable, 'window above the spectrum is rejected') + + fc=1500.0 + call jtty_search_window(fc,20.0,4900,5000,.true.,df,first_bin,last_bin, & + ja,jb,usable) + call assert_true(fc.eq.4900.0, 'center is clamped to the graph lower edge') + call assert_true(.not.usable, 'graph above the spectrum is rejected') + + fc=1500.0 + call jtty_search_window(fc,20.0,4900,5000,.false.,df,first_bin,last_bin, & + ja,jb,usable) + call assert_true(usable, 'QSO window ignores an unrelated graph range') + call assert_true(fc.eq.1500.0, 'QSO center is not moved to the graph edge') + call assert_true(ja.eq.int(1480.0/df), 'QSO lower bin follows Rx tolerance') + call assert_true(jb.eq.int(1520.0/df), 'QSO upper bin follows Rx tolerance') + + fc=1500.0 + call jtty_search_window(fc,20.0,1800,1200,.false.,df,first_bin,last_bin, & + ja,jb,usable) + call assert_true(usable, 'QSO window ignores inverted graph limits') + call assert_true(fc.eq.1500.0, 'inverted graph limits do not move QSO center') + + fc=1350.0 + call jtty_search_window(fc,150.0,1400,1600,.true.,df,first_bin,last_bin, & + ja,jb,usable) + call assert_true(usable, 'lower auxiliary edge is usable') + call assert_true(fc.eq.1400.0, 'lower auxiliary center is clamped') + call assert_true(ja.eq.ceiling(1400.0/df), 'lower graph edge clips the window') + + fc=1650.0 + call jtty_search_window(fc,150.0,1400,1600,.true.,df,first_bin,last_bin, & + ja,jb,usable) + call assert_true(usable, 'upper auxiliary edge is usable') + call assert_true(fc.eq.1600.0, 'upper auxiliary center is clamped') + call assert_true(jb.eq.floor(1600.0/df), 'upper graph edge clips the window') + + fc=1500.0 + call jtty_search_window(fc,50.0,1800,1200,.true.,df,first_bin,last_bin, & + ja,jb,usable) + call assert_true(.not.usable, 'inverted graph limits are rejected') + + fc=1500.0 + call jtty_search_window(fc,-1.0,200,2800,.true.,df,first_bin,last_bin, & + ja,jb,usable) + call assert_true(.not.usable, 'negative window width is rejected') + + print *, 'JTTY frequency window tests passed' + +contains + + subroutine assert_true(condition,message) + logical, intent(in) :: condition + character(len=*), intent(in) :: message + + if(.not.condition) then + write(*,'(a)') message + error stop 1 + endif + end subroutine assert_true + +end program test_jtty_frequency_window diff --git a/tests/unit/jtty/test_jtty_gap_merge.f90 b/tests/unit/jtty/test_jtty_gap_merge.f90 new file mode 100644 index 00000000..ff13e28e --- /dev/null +++ b/tests/unit/jtty/test_jtty_gap_merge.f90 @@ -0,0 +1,135 @@ +program test_jtty_gap_merge + + ! When a frame in the middle of a multi-frame message fails to decode + ! (common at marginal SNR), the message must still remain one message with + ! a gap marker between the surviving fragments, not split into two + ! messages (the bug Joe reported on 000000_000011.wav: "THE QUICK BROWN FOX + ! JUMPED OVER THE LAZY DOG." decoded as two separate lines, "THE Q" and + ! "BROWN FOX JUMPED OVER THE LAZY DOG.", losing "UICK " with no trace). + + use iso_fortran_env, only: int16 + use jtty_fec, only: is13, TOTAL_K + use jtty_mdec, only: npending,pending_updates,discard_pending_updates + use jtty_mod, only: MAX_FRAMES + implicit none + + character(len=*), parameter :: msg='THE QUICK BROWN FOX JUMPED OVER THE LAZY DOG.' + integer, parameter :: nsps=384 + integer, parameter :: frame_symbols=size(is13)+TOTAL_K + integer :: failures,total_samples,nframes + integer(int16), allocatable :: reference_pcm(:) + + failures=0 + + call build_message_pcm(msg,reference_pcm,total_samples,nframes) + call run_dropped_frame_case(msg,reference_pcm,total_samples,nframes,1,failures) + + if(failures.ne.0) then + write(*,'(a,i0)') 'test_jtty_gap_merge: failures=',failures + stop 1 + endif + write(*,'(a)') 'test_jtty_gap_merge: all checks passed' + +contains + + subroutine build_message_pcm(message,pcm,total_samples,nframes) + character(len=*), intent(in) :: message + integer(int16), allocatable, intent(out) :: pcm(:) + integer, intent(out) :: total_samples,nframes + integer :: tones(MAX_FRAMES*frame_symbols) + integer :: nsymbols + real, allocatable :: wave(:) + complex, allocatable :: complex_wave(:) + character(len=80) :: input + + input=message + call genjtty(input,tones,nsymbols) + nframes=nsymbols/frame_symbols + total_samples=(nsymbols+frame_symbols)*nsps + allocate(wave(nsymbols*nsps),complex_wave(nsymbols*nsps),pcm(total_samples)) + call gen_jttywave(tones,nsymbols,nsps,2.0,12000.0,1500.0, & + complex_wave,wave,0,nsymbols*nsps) + pcm=0_int16 + pcm(1:nsymbols*nsps)=int(nint(30000.0*wave),int16) + end subroutine build_message_pcm + + ! Drops consecutive middle frames and confirms the message still merges + ! into one slot with a fixed-width gap marker. + subroutine run_dropped_frame_case(expected_text,reference_pcm, & + total_samples,nframes,n_dropped,count) + character(len=*), intent(in) :: expected_text + integer(int16), intent(in) :: reference_pcm(:) + integer, intent(in) :: total_samples,nframes,n_dropped + integer, intent(inout) :: count + integer :: idrop + integer :: drop_start,drop_end + integer(int16), allocatable :: pcm(:) + character(len=80) :: before,after + character(len=200) :: description + integer :: gap_pos + logical :: surviving_text_matches + + pcm=reference_pcm + idrop=nframes/2 + + ! Zero out idrop..idrop+n_dropped-1's audio so those frames can't sync. + drop_start=(idrop-1)*frame_symbols*nsps+1 + drop_end=(idrop+n_dropped-1)*frame_symbols*nsps + pcm(drop_start:drop_end)=0_int16 + + call discard_pending_updates() + call rjtty_sub(pcm,1,nsps,200,2800,1500.0,50.0) + call rjtty_sub(pcm,total_samples,nsps,200,2800,1500.0,50.0) + + write(description,'(a,i0,a)') 'dropping ',n_dropped, & + ' consecutive frame(s) still merges into one message' + call expect(npending.eq.1,trim(description),count) + if(npending.ne.1) return + + ! The gap sentinel is a fixed-width 5-tilde run regardless of how many + ! frames were actually dropped -- " ... " is a generic "something's + ! missing" marker, not a precise character count (matches Joe's own + ! suggested display). + gap_pos=index(pending_updates(1)%decoded,'~~~~~') + write(description,'(a,i0,a)') 'dropping ',n_dropped, & + ' consecutive frame(s) leaves a gap sentinel' + call expect(gap_pos.gt.0,trim(description),count) + if(gap_pos.le.0) return + + before=trim(normalized(adjustl(pending_updates(1)%decoded(1:gap_pos-1)))) + after=trim(normalized(adjustl(pending_updates(1)%decoded(gap_pos+5:)))) + write(description,'(a,i0,a)') 'dropping ',n_dropped, & + ' consecutive frame(s): surviving text matches the original message' + surviving_text_matches=.false. + if(len_trim(before).gt.0 .and. len_trim(after).gt.0 .and. & + len_trim(after).le.len_trim(expected_text)) then + surviving_text_matches=index(expected_text,trim(before)).eq.1 .and. & + expected_text(len_trim(expected_text)-len_trim(after)+1: & + len_trim(expected_text)).eq.trim(after) + endif + call expect(surviving_text_matches,trim(description),count) + end subroutine run_dropped_frame_case + + function normalized(value) result(result_value) + character(len=*), intent(in) :: value + character(len=80) :: result_value + integer :: i + + result_value=adjustl(value) + do i=1,len_trim(result_value) + if(result_value(i:i).eq.'~') result_value(i:i)=' ' + enddo + end function normalized + + subroutine expect(condition,description,count) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + integer, intent(inout) :: count + + if(.not.condition) then + count=count+1 + write(*,'(a)') 'FAIL: '//description + endif + end subroutine expect + +end program test_jtty_gap_merge diff --git a/tests/unit/jtty/test_jtty_get_updates.f90 b/tests/unit/jtty/test_jtty_get_updates.f90 new file mode 100644 index 00000000..0ecf61dc --- /dev/null +++ b/tests/unit/jtty/test_jtty_get_updates.f90 @@ -0,0 +1,113 @@ +program test_jtty_get_updates + use iso_fortran_env, only: int64 + use jtty_mdec, only: message_assembly,npending,discard_pending_updates, & + queue_message_update + implicit none + + integer, parameter :: BATCH_SIZE=30,TEXT_WIDTH=80 + character(len=BATCH_SIZE*TEXT_WIDTH) :: text_blocks + integer(int64) :: message_ids(BATCH_SIZE) + real :: frequencies(BATCH_SIZE),start_tsync(BATCH_SIZE) + logical*1 :: eom(BATCH_SIZE) + type(message_assembly) :: message + integer :: i,count + + call discard_pending_updates() + + message=make_message(41_int64,1500.4,1.25,'CQ K1ABC') + call queue_message_update(message,.false.) + message%decoded='CQ K1ABC FN20' + call queue_message_update(message,.true.) + call expect(npending.eq.1, & + 'updates for one logical message coalesce before delivery') + + call jtty_get_updates(text_blocks,message_ids,frequencies,start_tsync,eom,count) + call expect(count.eq.1 .and. npending.eq.0, & + 'retrieving an update drains it exactly once') + call expect(message_ids(1).eq.41_int64 .and. & + trim(block_text(text_blocks,1)).eq.'CQ K1ABC FN20', & + 'the batch contains the newest state and stable identity') + call expect(abs(frequencies(1)-1500.4).lt.0.001 .and. & + abs(start_tsync(1)-1.25).lt.0.001 .and. eom(1), & + 'the batch preserves structured message metadata') + call jtty_get_updates(text_blocks,message_ids,frequencies,start_tsync,eom,count) + call expect(count.eq.0, 'a drained update is not returned again') + + message=make_message(42_int64,1501.0,2.5,'UNCHANGED TEXT') + call queue_message_update(message,.false.) + call queue_message_update(message,.true.) + call jtty_get_updates(text_blocks,message_ids,frequencies,start_tsync,eom,count) + call expect(count.eq.1 .and. eom(1) .and. & + trim(block_text(text_blocks,1)).eq.'UNCHANGED TEXT', & + 'completion metadata coalesces when message text is unchanged') + + do i=1,35 + message=make_message(int(100+i,int64),1400.0+real(i), & + 10.0+real(i),'MESSAGE') + write(message%decoded,'(a,i0)') 'MESSAGE ',i + message%k=len_trim(message%decoded) + call queue_message_update(message,mod(i,2).eq.0) + enddo + call expect(npending.eq.35, & + 'the pending store retains more than one ABI batch') + + call jtty_get_updates(text_blocks,message_ids,frequencies,start_tsync,eom,count) + call expect(count.eq.BATCH_SIZE .and. npending.eq.5, & + 'the first batch drains the oldest thirty updates') + do i=1,BATCH_SIZE + call expect(message_ids(i).eq.int(100+i,int64), & + 'the first batch preserves update order') + call expect(abs(frequencies(i)-(1400.0+real(i))).lt.0.001 .and. & + abs(start_tsync(i)-(10.0+real(i))).lt.0.001, & + 'the first batch preserves numeric metadata') + call expect(eom(i) .eqv. (mod(i,2).eq.0), & + 'the first batch preserves completion state') + enddo + + call jtty_get_updates(text_blocks,message_ids,frequencies,start_tsync,eom,count) + call expect(count.eq.5 .and. npending.eq.0, & + 'a second batch drains every remaining update') + do i=1,5 + call expect(message_ids(i).eq.int(130+i,int64), & + 'the second batch continues in update order') + enddo + + print *, 'test_jtty_get_updates: all checks passed' + +contains + + function make_message(id,frequency,tsync,text) result(value) + integer(int64), intent(in) :: id + real, intent(in) :: frequency,tsync + character(len=*), intent(in) :: text + type(message_assembly) :: value + + value%message_id=id + value%f1=frequency + value%tsync=tsync + value%start_tsync=tsync + value%decoded=text + value%k=len_trim(value%decoded) + end function make_message + + function block_text(blocks,index) result(text) + character(len=*), intent(in) :: blocks + integer, intent(in) :: index + character(len=TEXT_WIDTH) :: text + integer :: first + + first=(index-1)*TEXT_WIDTH+1 + text=blocks(first:first+TEXT_WIDTH-1) + end function block_text + + subroutine expect(condition,message) + logical, intent(in) :: condition + character(len=*), intent(in) :: message + + if(.not.condition) then + write(*,'(a)') message + error stop 1 + endif + end subroutine expect + +end program test_jtty_get_updates diff --git a/tests/unit/jtty/test_jtty_message_matching.f90 b/tests/unit/jtty/test_jtty_message_matching.f90 new file mode 100644 index 00000000..1308009a --- /dev/null +++ b/tests/unit/jtty/test_jtty_message_matching.f90 @@ -0,0 +1,99 @@ +program test_jtty_message_matching + use jtty_mdec, only: decode,message_assembly,classify_active_candidate + implicit none + + real, parameter :: frame_period=2.0 + type(message_assembly) :: existing + type(decode) :: candidate + logical :: match,is_window_dupe + integer :: failures,nframes_gap + + failures=0 + existing%f1=1500.0 + existing%tsync=10.0 + existing%decoded='OPEN MESSAGE' + + candidate%f1=1501.0 + candidate%tsync=existing%tsync+frame_period + candidate%decoded='CONTINUATION' + call classify_active_candidate(existing,candidate,frame_period, & + match,is_window_dupe,nframes_gap) + call expect(match .and. .not.is_window_dupe .and. nframes_gap.eq.1, & + 'an active message accepts the next frame',failures) + + candidate%f1=1505.0 + candidate%tsync=existing%tsync+frame_period/4.0 + candidate%decoded='SHIFTED REDISCOVERY' + call classify_active_candidate(existing,candidate,frame_period, & + match,is_window_dupe,nframes_gap) + call expect(match .and. is_window_dupe, & + 'an active message rejects a quarter-frame rediscovery',failures) + + candidate%f1=1505.0 + candidate%tsync=existing%tsync+frame_period + candidate%decoded='WIDE CONTINUATION' + call classify_active_candidate(existing,candidate,frame_period, & + match,is_window_dupe,nframes_gap) + call expect(match .and. .not.is_window_dupe, & + 'an active message accepts a 5 Hz next frame',failures) + + candidate%f1=1501.0 + candidate%tsync=existing%tsync+2*frame_period + candidate%decoded='ONE MISSED FRAME' + call classify_active_candidate(existing,candidate,frame_period, & + match,is_window_dupe,nframes_gap) + call expect(match .and. .not.is_window_dupe .and. nframes_gap.eq.2, & + 'an active message bridges one missed frame',failures) + + candidate%f1=1501.0 + candidate%tsync=existing%tsync+3*frame_period + candidate%decoded='TWO MISSED FRAMES' + call classify_active_candidate(existing,candidate,frame_period, & + match,is_window_dupe,nframes_gap) + call expect(match .and. .not.is_window_dupe .and. nframes_gap.eq.3, & + 'an active message bridges two missed frames',failures) + + candidate%f1=1501.0 + candidate%tsync=existing%tsync+4*frame_period + candidate%decoded='THREE MISSED FRAMES' + call classify_active_candidate(existing,candidate,frame_period, & + match,is_window_dupe,nframes_gap) + call expect(.not.match, & + 'an active message does not bridge beyond the continuation limit', & + failures) + + candidate%f1=1505.0 + candidate%tsync=existing%tsync+3*frame_period/4.0 + candidate%decoded='LAST RETRO STEP' + call classify_active_candidate(existing,candidate,frame_period, & + match,is_window_dupe,nframes_gap) + call expect(match .and. is_window_dupe, & + 'the final actual retro step is classified as rediscovery',failures) + + candidate%tsync=existing%tsync+5*frame_period/4.0 + candidate%decoded='OUTSIDE RETRO HORIZON' + call classify_active_candidate(existing,candidate,frame_period, & + match,is_window_dupe,nframes_gap) + call expect(.not.match, & + 'a later quarter-phase frame is not mistaken for rediscovery',failures) + + if(failures.ne.0) then + write(*,'(a,i0)') 'test_jtty_message_matching: failures=',failures + stop 1 + endif + write(*,'(a)') 'test_jtty_message_matching: all checks passed' + +contains + + subroutine expect(condition,description,count) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + integer, intent(inout) :: count + + if(.not.condition) then + count=count+1 + write(*,'(a)') 'FAIL: '//description + endif + end subroutine expect + +end program test_jtty_message_matching diff --git a/tests/unit/jtty/test_jtty_messages.cpp b/tests/unit/jtty/test_jtty_messages.cpp new file mode 100644 index 00000000..7c38dfa4 --- /dev/null +++ b/tests/unit/jtty/test_jtty_messages.cpp @@ -0,0 +1,938 @@ +#include + +#include "widgets/JttyMessages.hpp" + +class TestJttyMessages final + : public QObject +{ + Q_OBJECT + +private slots: + void nativeMacroMappings () + { + Jtty::NativeMacroContext const context {QString {"k1abc"}, QString {"w9xyz"}, 7}; + + struct Expected + { + QString text; + QVector kinds; + QVector subtypes; + QVector calls; + }; + QVector const expected { + {QString {"CQ K1ABC CQ"}, {0}, {0}, {QString {"K1ABC"}}}, + {QString {"W9XYZ 599 007"}, {0, 1}, {1, 0}, {QString {"W9XYZ"}, QString {}}}, + {QString {"W9XYZ TU CQ K1ABC CQ"}, {0, 0}, {3, 0}, + {QString {"W9XYZ"}, QString {"K1ABC"}}}, + {QString {"K1ABC"}, {0}, {1}, {QString {"K1ABC"}}}, + {QString {"W9XYZ"}, {0}, {1}, {QString {"W9XYZ"}}}, + {QString {"TU NOW W9XYZ 599 007"}, {0, 1}, {5, 0}, + {QString {"W9XYZ"}, QString {}}}, + {QString {"W9XYZ AGN?"}, {0}, {4}, {QString {"W9XYZ"}}}, + {QString {"599 007"}, {1}, {0}, {QString {}}} + }; + + for (int functionKey = 1; functionKey <= 8; ++functionKey) { + auto const compiled = Jtty::compileNativeMacro ( + functionKey, Jtty::nativeMacroTemplate (functionKey), context); + auto const& wanted = expected.at (functionKey - 1); + QCOMPARE (compiled.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (compiled.text, wanted.text); + QCOMPARE (compiled.atoms.size (), wanted.kinds.size ()); + for (int i = 0; i < compiled.atoms.size (); ++i) { + auto const& atom = compiled.atoms.at (i); + QCOMPARE (int {atom.kind}, wanted.kinds.at (i)); + QCOMPARE (int {atom.subtype}, wanted.subtypes.at (i)); + QCOMPARE (int {atom.reserved}, 0); + QCOMPARE (QString::fromLatin1 (atom.text), wanted.calls.at (i)); + if (atom.kind == static_cast (Jtty::NativeAtomKind::ExchangeNumber)) { + QCOMPARE (int {atom.role}, static_cast (Jtty::ExchangeRole::Full)); + QCOMPARE (atom.value, qint32 {7}); + } else { + QCOMPARE (int {atom.role}, 0); + QCOMPARE (atom.value, qint32 {0}); + } + } + } + } + + void nativeMacroMatchesCaseAndWhitespaceBeforeExpansion () + { + Jtty::NativeMacroContext const context {QString {" k1abc "}, QString {" w9xyz "}, 42}; + auto const compiled = Jtty::compileNativeMacro ( + 3, QString {" \t%h tu\n cq %m cq "}, context); + + QCOMPARE (compiled.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (compiled.text, QString {"W9XYZ TU CQ K1ABC CQ"}); + QCOMPARE (compiled.atoms.size (), 2); + QCOMPARE (QString::fromLatin1 (compiled.atoms.at (0).text), QString {"W9XYZ"}); + QCOMPARE (QString::fromLatin1 (compiled.atoms.at (1).text), QString {"K1ABC"}); + } + + void customizedMacroFallsBackToExpandedLiteral () + { + Jtty::NativeMacroContext const context {QString {"K1ABC"}, QString {"W9XYZ"}, 7}; + auto const customized = Jtty::compileNativeMacro ( + 2, QString {"TEST %H 599 %N"}, context); + QCOMPARE (customized.status, Jtty::NativeMacroStatus::LiteralFallback); + QCOMPARE (customized.text, QString {"TEST W9XYZ 599 007"}); + QVERIFY (customized.atoms.isEmpty ()); + + auto const movedDefault = Jtty::compileNativeMacro ( + 4, QString {"%H"}, context); + QCOMPARE (movedDefault.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (movedDefault.text, QString {"W9XYZ"}); + QCOMPARE (movedDefault.atoms.size (), 1); + QCOMPARE (int {movedDefault.atoms.at (0).subtype}, + static_cast (Jtty::CallAction::Call)); + + auto const unknownPlaceholder = Jtty::compileNativeMacro ( + 8, QString {"599 %R"}, context); + QCOMPARE (unknownPlaceholder.status, Jtty::NativeMacroStatus::LiteralFallback); + QCOMPARE (unknownPlaceholder.text, QString {"599 %R"}); + + auto const editedLegacyCase = Jtty::compileNativeMacro ( + 2, QString {"%h 599 %n"}, context); + QCOMPARE (editedLegacyCase.status, Jtty::NativeMacroStatus::LiteralFallback); + QCOMPARE (editedLegacyCase.text, QString {"%h 599 %n"}); + + auto const editedLegacySpacing = Jtty::compileNativeMacro ( + 8, QString {" 599 %N "}, context); + QCOMPARE (editedLegacySpacing.status, Jtty::NativeMacroStatus::LiteralFallback); + QCOMPARE (editedLegacySpacing.text, QString {" 599 007 "}); + } + + void blankMacroDoesNotSelectNativeCq () + { + Jtty::NativeMacroContext const context {QString {"K1ABC"}, QString {"W9XYZ"}, 7}; + for (int functionKey = 1; functionKey <= 8; ++functionKey) { + for (QString const& macro : {QString {}, QString {" \t "}}) { + auto const compiled = Jtty::compileNativeMacro (functionKey, macro, context); + QCOMPARE (compiled.status, Jtty::NativeMacroStatus::LiteralFallback); + QVERIFY (compiled.atoms.isEmpty ()); + QVERIFY (compiled.text.trimmed ().isEmpty ()); + } + } + } + + void nativeCallDescriptorTextIsBounded () + { + auto const atom = Jtty::nativeCallAtom ( + Jtty::CallAction::Call, QStringLiteral ("K1ABCDEFGHIJK")); + QCOMPARE (QString::fromLatin1 (atom.text), QStringLiteral ("K1ABCDEF")); + } + + void recognizedMacroRejectsInvalidRuntime_data () + { + QTest::addColumn ("functionKey"); + QTest::addColumn ("myCall"); + QTest::addColumn ("hisCall"); + QTest::addColumn ("serialNumber"); + + QTest::newRow ("missing-my-call") << 1 << QString {} << QString {"W9XYZ"} << 1; + QTest::newRow ("missing-his-call") << 2 << QString {"K1ABC"} << QString {} << 1; + QTest::newRow ("call-without-area") << 4 << QString {"KABC"} << QString {"W9XYZ"} << 1; + QTest::newRow ("call-without-suffix") << 5 << QString {"K1ABC"} << QString {"W9"} << 1; + QTest::newRow ("q-prefix") << 7 << QString {"K1ABC"} << QString {"Q1ABC"} << 1; + QTest::newRow ("portable-call") << 3 << QString {"K1ABC/P"} << QString {"W9XYZ"} << 1; + QTest::newRow ("negative-serial") << 8 << QString {"K1ABC"} << QString {"W9XYZ"} << -1; + QTest::newRow ("serial-overflow") << 6 << QString {"K1ABC"} << QString {"W9XYZ"} + << (1 << 17); + } + + void recognizedMacroRejectsInvalidRuntime () + { + QFETCH (int, functionKey); + QFETCH (QString, myCall); + QFETCH (QString, hisCall); + QFETCH (int, serialNumber); + Jtty::NativeMacroContext const context {myCall, hisCall, serialNumber}; + + auto const compiled = Jtty::compileNativeMacro ( + functionKey, Jtty::nativeMacroTemplate (functionKey), context); + + QCOMPARE (compiled.status, Jtty::NativeMacroStatus::InvalidRuntime); + QVERIFY (compiled.atoms.isEmpty ()); + QVERIFY (compiled.text.isEmpty ()); + } + + void nativeRuntimeBoundariesAndUnusedFields () + { + auto const minimum = Jtty::compileNativeMacro ( + 8, Jtty::nativeMacroTemplate (8), {QString {}, QString {}, 0}); + QCOMPARE (minimum.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (minimum.text, QString {"599 000"}); + QCOMPARE (minimum.atoms.at (0).value, qint32 {0}); + + auto const maximum = Jtty::compileNativeMacro ( + 8, Jtty::nativeMacroTemplate (8), {QString {}, QString {}, (1 << 17) - 1}); + QCOMPARE (maximum.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (maximum.text, QString {"599 131071"}); + QCOMPARE (maximum.atoms.at (0).value, qint32 {(1 << 17) - 1}); + + auto const unusedInvalidFields = Jtty::compileNativeMacro ( + 1, Jtty::nativeMacroTemplate (1), {QString {"K1ABC"}, QString {}, -1}); + QCOMPARE (unusedInvalidFields.status, Jtty::NativeMacroStatus::Native); + } + + void functionKeyApiIsParityFriendly () + { + Jtty::NativeMacroContext const context {QString {"K1ABC"}, QString {"W9XYZ"}, 123}; + for (int functionKey = 1; functionKey <= 8; ++functionKey) { + QString const configuredText = Jtty::nativeMacroTemplate (functionKey); + auto const keyboard = Jtty::compileNativeMacro (functionKey, configuredText, context); + auto const button = Jtty::compileNativeMacro (functionKey, configuredText, context); + QCOMPARE (keyboard.status, button.status); + QCOMPARE (keyboard.text, button.text); + QCOMPARE (keyboard.atoms.size (), button.atoms.size ()); + for (int i = 0; i < keyboard.atoms.size (); ++i) { + QCOMPARE (keyboard.atoms.at (i).kind, button.atoms.at (i).kind); + QCOMPARE (keyboard.atoms.at (i).subtype, button.atoms.at (i).subtype); + QCOMPARE (keyboard.atoms.at (i).role, button.atoms.at (i).role); + QCOMPARE (keyboard.atoms.at (i).value, button.atoms.at (i).value); + QCOMPARE (QString::fromLatin1 (keyboard.atoms.at (i).text), + QString::fromLatin1 (button.atoms.at (i).text)); + } + } + } + + void legacyAndProfileAwareTemplatesRemainNative () + { + Jtty::NativeMacroContext const context {QString {"K1ABC"}, QString {"W9XYZ"}, 12}; + for (int functionKey = 1; functionKey <= 8; ++functionKey) { + auto const current = Jtty::compileNativeMacro ( + functionKey, Jtty::nativeMacroTemplate (functionKey), context); + auto const legacy = Jtty::compileNativeMacro ( + functionKey, Jtty::legacyNativeMacroTemplate (functionKey), context); + QCOMPARE (current.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (legacy.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (current.text, legacy.text); + QCOMPARE (current.atoms.size (), legacy.atoms.size ()); + } + + QCOMPARE (Jtty::nativeMacroTemplate (2), QString {"%H %E"}); + QCOMPARE (Jtty::nativeMacroTemplate (6), QString {"TU NOW %Q %E"}); + QCOMPARE (Jtty::nativeMacroTemplate (8), QString {"%E"}); + } + + void savedDefaultMigrationIsExactAndNarrow () + { + for (int functionKey : {2, 6, 8}) { + QCOMPARE (Jtty::migratedNativeMacroTemplate ( + functionKey, Jtty::legacyNativeMacroTemplate (functionKey)), + Jtty::nativeMacroTemplate (functionKey)); + } + + QCOMPARE (Jtty::migratedNativeMacroTemplate (1, QString {"CQ %M CQ"}), + QString {"CQ %M CQ"}); + QCOMPARE (Jtty::migratedNativeMacroTemplate (2, QString {"%h 599 %n"}), + QString {"%h 599 %n"}); + QCOMPARE (Jtty::migratedNativeMacroTemplate (8, QString {" 599 %N "}), + QString {" 599 %N "}); + QCOMPARE (Jtty::migratedNativeMacroTemplate (8, QString {"TEST 599 %N"}), + QString {"TEST 599 %N"}); + } + + void noneProfileUsesLiveSerial () + { + Jtty::NativeMacroContext const context { + QString {"K1ABC"}, QString {"W9XYZ"}, 7, Jtty::NativeExchangeProfile::None}; + auto const compiled = Jtty::compileNativeMacro (QString {"%H %E"}, context); + + QCOMPARE (compiled.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (compiled.text, QString {"W9XYZ 599 007"}); + QCOMPARE (compiled.atoms.size (), 2); + QCOMPARE (int {compiled.atoms.at (1).kind}, + static_cast (Jtty::NativeAtomKind::ExchangeNumber)); + QCOMPARE (int {compiled.atoms.at (1).subtype}, + static_cast (Jtty::NumberKind::Serial)); + QCOMPARE (int {compiled.atoms.at (1).role}, + static_cast (Jtty::ExchangeRole::Full)); + QCOMPARE (compiled.atoms.at (1).value, qint32 {7}); + } + + void fieldDayProfileParsesClassAndSection_data () + { + QTest::addColumn ("exchange"); + QTest::addColumn ("text"); + QTest::addColumn ("count"); + QTest::addColumn ("classIndex"); + QTest::addColumn ("section"); + + QTest::newRow ("minimum") << QString {"1A AB"} << QString {"1A AB"} + << 1 << 0 << QString {"AB"}; + QTest::newRow ("maximum") << QString {"32F EMA"} << QString {"32F EMA"} + << 32 << 5 << QString {"EMA"}; + QTest::newRow ("normalizes-case-and-spacing") + << QString {" 2d wma "} << QString {"2D WMA"} << 2 << 3 << QString {"WMA"}; + } + + void compactFieldDayConfigurationIsNormalized () + { + QCOMPARE (Jtty::normalizedFieldDayExchange (QStringLiteral ("3AOR")), + QStringLiteral ("3A OR")); + QCOMPARE (Jtty::normalizedFieldDayExchange (QStringLiteral (" 32fema ")), + QStringLiteral ("32F EMA")); + QCOMPARE (Jtty::normalizedFieldDayExchange (QStringLiteral ("3A OR")), + QStringLiteral ("3A OR")); + + Jtty::NativeMacroContext context; + context.exchangeProfile = Jtty::NativeExchangeProfile::FieldDay; + context.configuredExchange = Jtty::normalizedFieldDayExchange ( + QStringLiteral ("3AOR")); + auto const compiled = Jtty::compileNativeMacro (QStringLiteral ("%E"), context); + QCOMPARE (compiled.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (compiled.text, QStringLiteral ("3A OR")); + } + + void fieldDayProfileParsesClassAndSection () + { + QFETCH (QString, exchange); + QFETCH (QString, text); + QFETCH (int, count); + QFETCH (int, classIndex); + QFETCH (QString, section); + Jtty::NativeMacroContext const context { + QString {}, QString {}, 1, Jtty::NativeExchangeProfile::FieldDay, exchange}; + auto const compiled = Jtty::compileNativeMacro (QString {"%E"}, context); + + QCOMPARE (compiled.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (compiled.text, text); + QCOMPARE (compiled.atoms.size (), 1); + auto const& atom = compiled.atoms.constFirst (); + QCOMPARE (int {atom.kind}, static_cast (Jtty::NativeAtomKind::ExchangePair)); + QCOMPARE (int {atom.subtype}, static_cast (Jtty::PairSchema::ClassSection)); + QCOMPARE (int {atom.role}, classIndex); + QCOMPARE (atom.value, qint32 {count}); + QCOMPARE (QString::fromLatin1 (atom.text), section); + } + + void profileExchangeComposesWithCallActions () + { + Jtty::NativeMacroContext const context { + QString {"K1ABC"}, QString {"W9XYZ"}, 1, + Jtty::NativeExchangeProfile::FieldDay, QString {"2D WMA"}}; + + auto const reply = Jtty::compileNativeMacro (QString {"%H %E"}, context); + QCOMPARE (reply.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (reply.text, QString {"W9XYZ 2D WMA"}); + QCOMPARE (reply.atoms.size (), 2); + QCOMPARE (int {reply.atoms.at (0).kind}, static_cast (Jtty::NativeAtomKind::Call)); + QCOMPARE (int {reply.atoms.at (1).kind}, + static_cast (Jtty::NativeAtomKind::ExchangePair)); + + auto const queued = Jtty::compileNativeMacro (QString {"TU NOW %Q %E"}, context); + QCOMPARE (queued.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (queued.text, QString {"TU NOW W9XYZ 2D WMA"}); + QCOMPARE (queued.atoms.size (), 2); + QCOMPARE (int {queued.atoms.at (0).subtype}, + static_cast (Jtty::CallAction::TuNowCall)); + QCOMPARE (int {queued.atoms.at (1).kind}, + static_cast (Jtty::NativeAtomKind::ExchangePair)); + } + + void invalidFieldDayExchangeIsRejected_data () + { + QTest::addColumn ("exchange"); + QTest::newRow ("missing") << QString {}; + QTest::newRow ("zero-count") << QString {"0A EMA"}; + QTest::newRow ("count-overflow") << QString {"33A EMA"}; + QTest::newRow ("bad-class") << QString {"1G EMA"}; + QTest::newRow ("short-section") << QString {"1A E"}; + QTest::newRow ("long-section") << QString {"1A WMAA"}; + QTest::newRow ("non-base36-section") << QString {"1A E-A"}; + QTest::newRow ("noncanonical-three-character-section") << QString {"1A 0AB"}; + } + + void invalidFieldDayExchangeIsRejected () + { + QFETCH (QString, exchange); + Jtty::NativeMacroContext const context { + QString {}, QString {}, 1, Jtty::NativeExchangeProfile::FieldDay, exchange}; + auto const compiled = Jtty::compileNativeMacro (QString {"%E"}, context); + QCOMPARE (compiled.status, Jtty::NativeMacroStatus::InvalidRuntime); + QVERIFY (!compiled.error.isEmpty ()); + QVERIFY (compiled.atoms.isEmpty ()); + } + + void rttyProfileParsesConfiguredExchange_data () + { + QTest::addColumn ("exchange"); + QTest::addColumn ("serial"); + QTest::addColumn ("kind"); + QTest::addColumn ("value"); + QTest::addColumn ("atomText"); + QTest::addColumn ("rendered"); + + QTest::newRow ("dx-live-serial") << QString {"DX"} << 42 + << static_cast (Jtty::NativeAtomKind::ExchangeNumber) << 42 << QString {} + << QString {"599 042"}; + QTest::newRow ("hash-live-serial") << QString {"#"} << 1234 + << static_cast (Jtty::NativeAtomKind::ExchangeNumber) << 1234 << QString {} + << QString {"599 1234"}; + QTest::newRow ("decimal-serial") << QString {"0013"} << 99 + << static_cast (Jtty::NativeAtomKind::ExchangeNumber) << 13 << QString {} + << QString {"599 013"}; + QTest::newRow ("state") << QString {" ma "} << 99 + << static_cast (Jtty::NativeAtomKind::ExchangeLocation) << 0 << QString {"MA"} + << QString {"599 MA"}; + QTest::newRow ("province") << QString {"nwt"} << 99 + << static_cast (Jtty::NativeAtomKind::ExchangeLocation) << 0 << QString {"NWT"} + << QString {"599 NWT"}; + } + + void rttyProfileParsesConfiguredExchange () + { + QFETCH (QString, exchange); + QFETCH (int, serial); + QFETCH (int, kind); + QFETCH (int, value); + QFETCH (QString, atomText); + QFETCH (QString, rendered); + Jtty::NativeMacroContext const context { + QString {}, QString {}, serial, Jtty::NativeExchangeProfile::RttyRoundup, exchange}; + auto const compiled = Jtty::compileNativeMacro (QString {"%E"}, context); + + QCOMPARE (compiled.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (compiled.text, rendered); + auto const& atom = compiled.atoms.constFirst (); + QCOMPARE (int {atom.kind}, kind); + QCOMPARE (atom.value, qint32 {value}); + QCOMPARE (QString::fromLatin1 (atom.text), atomText); + if (kind == static_cast (Jtty::NativeAtomKind::ExchangeLocation)) { + QCOMPARE (int {atom.subtype}, static_cast (Jtty::LocationKind::StateProvince)); + QCOMPARE (int {atom.role}, static_cast (Jtty::ExchangeRole::Full)); + } + } + + void invalidRttyExchangeIsRejected_data () + { + QTest::addColumn ("exchange"); + QTest::newRow ("empty") << QString {}; + QTest::newRow ("one-character") << QString {"M"}; + QTest::newRow ("too-long") << QString {"NWTX"}; + QTest::newRow ("punctuation") << QString {"M-A"}; + QTest::newRow ("noncanonical-three-character-token") << QString {"0MA"}; + QTest::newRow ("decimal-overflow") << QString {"131072"}; + } + + void invalidRttyExchangeIsRejected () + { + QFETCH (QString, exchange); + Jtty::NativeMacroContext const context { + QString {}, QString {}, 7, Jtty::NativeExchangeProfile::RttyRoundup, exchange}; + auto const compiled = Jtty::compileNativeMacro (QString {"%E"}, context); + QCOMPARE (compiled.status, Jtty::NativeMacroStatus::InvalidRuntime); + QVERIFY (!compiled.error.isEmpty ()); + } + + void gridMacroUsesFieldOnlyAndFullRoles_data () + { + QTest::addColumn ("macro"); + QTest::addColumn ("grid"); + QTest::addColumn ("role"); + QTest::addColumn ("text"); + QTest::newRow ("field-only-lower-bound") << QString {"%G"} << QString {"aa00"} + << static_cast (Jtty::ExchangeRole::FieldOnly) << QString {"AA00"}; + QTest::newRow ("field-only-upper-bound") << QString {"%G"} << QString {"RR99"} + << static_cast (Jtty::ExchangeRole::FieldOnly) << QString {"RR99"}; + QTest::newRow ("full") << QString {"599 %G"} << QString {"FN42"} + << static_cast (Jtty::ExchangeRole::Full) << QString {"599 FN42"}; + } + + void gridMacroUsesFieldOnlyAndFullRoles () + { + QFETCH (QString, macro); + QFETCH (QString, grid); + QFETCH (int, role); + QFETCH (QString, text); + Jtty::NativeMacroContext const context { + QString {}, QString {}, 1, Jtty::NativeExchangeProfile::None, QString {}, grid}; + auto const compiled = Jtty::compileNativeMacro (macro, context); + QCOMPARE (compiled.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (compiled.text, text); + QCOMPARE (compiled.atoms.size (), 1); + QCOMPARE (int {compiled.atoms.constFirst ().kind}, + static_cast (Jtty::NativeAtomKind::Grid4)); + QCOMPARE (int {compiled.atoms.constFirst ().role}, role); + QCOMPARE (QString::fromLatin1 (compiled.atoms.constFirst ().text), grid.toUpper ()); + } + + void callAndQueuedGridTemplatesKeepGridFieldOnly () + { + Jtty::NativeMacroContext const context { + QString {"K1ABC"}, QString {"W9XYZ"}, 1, + Jtty::NativeExchangeProfile::None, QString {}, QString {"FN42"}}; + + auto const call = Jtty::compileNativeMacro (QString {"%H %G"}, context); + QCOMPARE (call.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (call.text, QString {"W9XYZ FN42"}); + QCOMPARE (call.atoms.size (), 2); + QCOMPARE (int {call.atoms.at (1).kind}, static_cast (Jtty::NativeAtomKind::Grid4)); + QCOMPARE (int {call.atoms.at (1).role}, + static_cast (Jtty::ExchangeRole::FieldOnly)); + + auto const queued = Jtty::compileNativeMacro (QString {"TU NOW %Q %G"}, context); + QCOMPARE (queued.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (queued.text, QString {"TU NOW W9XYZ FN42"}); + QCOMPARE (queued.atoms.size (), 2); + QCOMPARE (int {queued.atoms.at (1).role}, + static_cast (Jtty::ExchangeRole::FieldOnly)); + } + + void configuredSubsquareProducesGrid4WithoutChangingLiteralExpansion () + { + Jtty::NativeMacroContext const context { + QString {"K1ABC"}, QString {"W9XYZ"}, 1, + Jtty::NativeExchangeProfile::None, QString {}, QString {"fn42ab"}}; + auto const native = Jtty::compileNativeMacro (QString {"%H %G"}, context); + QCOMPARE (native.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (native.text, QString {"W9XYZ FN42"}); + QCOMPARE (QString::fromLatin1 (native.atoms.at (1).text), QString {"FN42"}); + + auto const literal = Jtty::compileNativeMacro (QString {"GRID %G"}, context); + QCOMPARE (literal.status, Jtty::NativeMacroStatus::LiteralFallback); + QCOMPARE (literal.text, QString {"GRID fn42ab"}); + } + + void invalidGridIsRejected_data () + { + QTest::addColumn ("grid"); + QTest::newRow ("empty") << QString {}; + QTest::newRow ("short") << QString {"AA0"}; + QTest::newRow ("field-overflow") << QString {"AS00"}; + QTest::newRow ("square-letter") << QString {"AA0A"}; + QTest::newRow ("invalid-subsquare") << QString {"FN42AZ"}; + } + + void invalidGridIsRejected () + { + QFETCH (QString, grid); + Jtty::NativeMacroContext const context { + QString {}, QString {}, 1, Jtty::NativeExchangeProfile::None, QString {}, grid}; + auto const compiled = Jtty::compileNativeMacro (QString {"%G"}, context); + QCOMPARE (compiled.status, Jtty::NativeMacroStatus::InvalidRuntime); + QVERIFY (!compiled.error.isEmpty ()); + } + + void registeredControlPhrasesCompileNatively () + { + Jtty::NativeMacroContext const context; + for (int phraseId = 0; phraseId < 18; ++phraseId) { + auto const compiled = Jtty::compileNativeMacro ( + QString {" %1 "}.arg (Jtty::controlPhrase (phraseId).toLower ()), context); + QCOMPARE (compiled.status, Jtty::NativeMacroStatus::Native); + QCOMPARE (compiled.text, Jtty::controlPhrase (phraseId)); + QCOMPARE (compiled.atoms.size (), 1); + QCOMPARE (int {compiled.atoms.constFirst ().kind}, + static_cast (Jtty::NativeAtomKind::Control)); + QCOMPARE (int {compiled.atoms.constFirst ().subtype}, phraseId); + } + } + + void customLiteralExpandsProfileFields () + { + Jtty::NativeMacroContext const context { + QString {"K1ABC"}, QString {"W9XYZ"}, 7, + Jtty::NativeExchangeProfile::RttyRoundup, QString {" dx "}, QString {"fn42"}}; + auto const compiled = Jtty::compileNativeMacro (QString {"TEST %E %G"}, context); + QCOMPARE (compiled.status, Jtty::NativeMacroStatus::LiteralFallback); + QCOMPARE (compiled.text, QString {"TEST 007 fn42"}); + QVERIFY (compiled.error.isEmpty ()); + } + + void prepareTransmitText_data () + { + QTest::addColumn ("message"); + QTest::addColumn ("expected"); + QTest::addColumn ("substituted"); + QTest::addColumn ("truncated"); + + QTest::newRow ("empty") << QString {} << QString {} + << false << false; + QTest::newRow ("supported") << QString {"CQ KA1ABC CQ"} << QString {"CQ KA1ABC CQ"} + << false << false; + QTest::newRow ("lowercase-preserved") << QString {"cq ka1abc cq"} << QString {"cq ka1abc cq"} + << false << false; + QTest::newRow ("tab") << QString {"HELLO\tWORLD"} << QString {"HELLO#WORLD"} + << true << false; + QTest::newRow ("cr-lf") << QString {"HELLO\r\nWORLD"} << QString {"HELLO##WORLD"} + << true << false; + QTest::newRow ("nul") << (QString {"A"} + QChar::Null + QString {"B"}) << QString {"A B"} + << true << false; + QTest::newRow ("display-space-marker") << QString {"A~B"} << QString {"A B"} + << true << false; + QTest::newRow ("exactly-80") << QString (80, QLatin1Char {'A'}) << QString (80, QLatin1Char {'A'}) + << false << false; + QTest::newRow ("truncated") << QString (81, QLatin1Char {'A'}) << QString (80, QLatin1Char {'A'}) + << false << true; + QTest::newRow ("unsupported-past-limit") + << (QString (80, QLatin1Char {'A'}) + QString {"\t"}) + << QString (80, QLatin1Char {'A'}) + << false << true; + QTest::newRow ("substitution-and-truncation") + << (QString (79, QLatin1Char {'A'}) + QString {"\tB"}) + << (QString (79, QLatin1Char {'A'}) + QString {"#"}) + << true << true; + } + + void prepareTransmitText () + { + QFETCH (QString, message); + QFETCH (QString, expected); + QFETCH (bool, substituted); + QFETCH (bool, truncated); + + auto const prepared = Jtty::prepareTransmitText (message); + + QCOMPARE (prepared.text, expected); + QCOMPARE (prepared.substituted, substituted); + QCOMPARE (prepared.truncated, truncated); + QCOMPARE (prepared.changed (), substituted || truncated); + } + + void withChainedSpacing_data () + { + QTest::addColumn ("message"); + QTest::addColumn ("isChained"); + QTest::addColumn ("expected"); + + QTest::newRow ("not-chained-unchanged") << QString {"CQ KA1ABC CQ"} << false + << QString {"CQ KA1ABC CQ"}; + QTest::newRow ("chained-gets-leading-space") << QString {"TU DE KA1ABC"} << true + << QString {" TU DE KA1ABC"}; + QTest::newRow ("not-chained-empty-stays-empty") << QString {} << false << QString {}; + QTest::newRow ("chained-at-max-length-drops-last-char") + << QString (Jtty::maxTransmitLength, QLatin1Char {'A'}) << true + << (QString {" "} + QString (Jtty::maxTransmitLength - 1, QLatin1Char {'A'})); + } + + void withChainedSpacing () + { + QFETCH (QString, message); + QFETCH (bool, isChained); + QFETCH (QString, expected); + + QCOMPARE (Jtty::withChainedSpacing (message, isChained), expected); + } + + void transmitFrame_data () + { + QTest::addColumn ("message"); + QTest::addColumn ("isChained"); + QTest::addColumn ("expected"); + + auto const padded = [] (QString const& text) { + return text + QString (Jtty::maxTransmitLength - text.size (), QLatin1Char {' '}); + }; + + QTest::newRow ("not-chained-padded-to-width") + << QString {"CQ KA1ABC CQ"} << false << padded (QString {"CQ KA1ABC CQ"}); + QTest::newRow ("chained-prefixed-and-padded") + << QString {"TU K1ABC CQ"} << true << padded (QString {" TU K1ABC CQ"}); + QTest::newRow ("chained-at-max-length-stays-exact") + << QString (Jtty::maxTransmitLength, QLatin1Char {'A'}) << true + << (QString {" "} + QString (Jtty::maxTransmitLength - 1, QLatin1Char {'A'})); + QTest::newRow ("empty-not-chained-all-spaces") + << QString {} << false << QString (Jtty::maxTransmitLength, QLatin1Char {' '}); + } + + void transmitFrame () + { + QFETCH (QString, message); + QFETCH (bool, isChained); + QFETCH (QString, expected); + + QString const frame = Jtty::transmitFrame (message, isChained); + + QCOMPARE (frame, expected); + QCOMPARE (frame.size (), Jtty::maxTransmitLength); + } + + void wavCaptureValid_data () + { + QTest::addColumn ("k0"); + QTest::addColumn ("expected"); + + QTest::newRow ("zero") << qint32 {0} << false; + QTest::newRow ("negative") << qint32 {-1} << false; + QTest::newRow ("below-one-frame") << qint32 {Jtty::jttyFrameSamples - 1} << false; + QTest::newRow ("exactly-one-frame") << qint32 {Jtty::jttyFrameSamples} << false; + QTest::newRow ("just-over-one-frame") << qint32 {Jtty::jttyFrameSamples + 1} << true; + QTest::newRow ("typical-interval") << qint32 {1000000} << true; + QTest::newRow ("sentinel-minus-one") << qint32 {Jtty::invalidCaptureSamples - 1} << true; + QTest::newRow ("sentinel") << qint32 {Jtty::invalidCaptureSamples} << false; + QTest::newRow ("sentinel-plus-one") << qint32 {Jtty::invalidCaptureSamples + 1} << false; + } + + void wavCaptureValid () + { + QFETCH (qint32, k0); + QFETCH (bool, expected); + + QCOMPARE (Jtty::wavCaptureValid (k0), expected); + } + + void formatSerialNumber_data () + { + QTest::addColumn ("serialNumber"); + QTest::addColumn ("expected"); + + QTest::newRow ("minimum") << 1 << QString {"001"}; + QTest::newRow ("single-digit") << 5 << QString {"005"}; + QTest::newRow ("two-digit") << 57 << QString {"057"}; + QTest::newRow ("three-digit") << 101 << QString {"101"}; + QTest::newRow ("four-digit") << 1234 << QString {"1234"}; + QTest::newRow ("spinbox-maximum") << 5000 << QString {"5000"}; + } + + void formatSerialNumber () + { + QFETCH (int, serialNumber); + QFETCH (QString, expected); + + QCOMPARE (Jtty::formatSerialNumber (serialNumber), expected); + } + + void jttyLineTimeLabel_data () + { + QTest::addColumn ("diskDateTime"); + QTest::addColumn ("utcDiskRaw"); + QTest::addColumn ("tsyncSeconds"); + QTest::addColumn ("expected"); + + QTest::newRow ("real-date-anchors-tsync") + << QDateTime {QDate {2026, 8, 28}, QTime {19, 45, 7}, Qt::UTC} + << qint32 {194507} << 3.0f << QString {"194510"}; + QTest::newRow ("real-date-wraps-past-midnight") + << QDateTime {QDate {2026, 8, 28}, QTime {23, 59, 58}, Qt::UTC} + << qint32 {235958} << 5.0f << QString {"000003"}; + QTest::newRow ("subsecond-offset-preserves-current-second") + << QDateTime {QDate {2026, 8, 28}, QTime {19, 45, 7}, Qt::UTC} + << qint32 {194507} << 0.6f << QString {"194507"}; + QTest::newRow ("dummy-date-falls-back-to-raw-digits") + << QDateTime {} << qint32 {2} << 0.0f << QString {"000002"}; + QTest::newRow ("dummy-date-fallback-still-anchors-tsync") + << QDateTime {} << qint32 {2} << 5.0f << QString {"000007"}; + QTest::newRow ("neither-anchor-usable") + << QDateTime {} << qint32 {999999} << 0.0f << QString {}; + } + + void jttyLineTimeLabel () + { + QFETCH (QDateTime, diskDateTime); + QFETCH (qint32, utcDiskRaw); + QFETCH (float, tsyncSeconds); + QFETCH (QString, expected); + + QCOMPARE (Jtty::jttyLineTimeLabel (diskDateTime, utcDiskRaw, tsyncSeconds), expected); + } + + void jttyLineStartTimeUtc () + { + QDateTime const diskDateTime {QDate {2026, 8, 28}, QTime {23, 59, 58}, Qt::UTC}; + QDateTime const expectedMidnight {QDate {2026, 8, 29}, QTime {0, 0, 3}, Qt::UTC}; + QDateTime const expectedFallback {QDate {2000, 1, 1}, QTime {0, 0, 7}, Qt::UTC}; + QCOMPARE (Jtty::jttyLineStartTimeUtc (diskDateTime, 235958, 5.0f), expectedMidnight); + QCOMPARE (Jtty::jttyLineStartTimeUtc (QDateTime {}, 2, 5.0f), expectedFallback); + QVERIFY (!Jtty::jttyLineStartTimeUtc (QDateTime {}, 999999, 0.0f).isValid ()); + } + + void jttyLineTimeLabelForStoredTimestamp () + { + QCOMPARE (Jtty::jttyLineTimeLabel ( + QDateTime {QDate {2026, 8, 28}, QTime {19, 45, 7}, Qt::UTC}), + QString {"194507"}); + QCOMPARE (Jtty::jttyLineTimeLabel (QDateTime {}), QString {}); + } + + void parseDecodeLine_data () + { + QTest::addColumn ("line"); + QTest::addColumn ("frequency"); + QTest::addColumn ("message"); + QTest::addColumn ("valid"); + + QTest::newRow ("four-digit-frequency") + << QString {"1500 CQ K1ABC"} << 1500 << QString {"CQ K1ABC"} << true; + QTest::newRow ("three-digit-frequency-with-padding") + << QString {" 500 599 K1ABC "} << 500 << QString {"599 K1ABC"} << true; + QTest::newRow ("numeric-leading-message-is-preserved") + << QString {"1500 599 K1ABC"} << 1500 << QString {"599 K1ABC"} << true; + QTest::newRow ("frequency-only") + << QString {"1500"} << 1500 << QString {} << true; + QTest::newRow ("malformed-frequency") + << QString {"CQ K1ABC"} << 0 << QString {"CQ K1ABC"} << false; + QTest::newRow ("empty") + << QString {} << 0 << QString {} << false; + } + + void parseDecodeLine () + { + QFETCH (QString, line); + QFETCH (int, frequency); + QFETCH (QString, message); + QFETCH (bool, valid); + + auto const decoded = Jtty::parseDecodeLine (line); + + QCOMPARE (decoded.frequency, frequency); + QCOMPARE (decoded.message, message); + QCOMPARE (decoded.valid, valid); + } + + void wrapMessage_data () + { + QTest::addColumn ("text"); + QTest::addColumn ("expected"); + + QTest::newRow ("short-unchanged") << QString {"HELLO"} << QString {"HELLO"}; + QTest::newRow ("exactly-40-unchanged") + << QString (40, QLatin1Char {'A'}) << QString (40, QLatin1Char {'A'}); + QTest::newRow ("joes-example") + << QString {"MAYBE CLAUDE COULD HELP US MAKE THE 3 MIN TRANSITION SEAMLESS"} + << QString {"MAYBE CLAUDE COULD HELP US MAKE THE 3\n MIN TRANSITION SEAMLESS"}; + QTest::newRow ("break-at-boundary") + << (QString (39, QLatin1Char {'A'}) + QString {" B"}) + << (QString (39, QLatin1Char {'A'}) + QString {"\n B"}); + QTest::newRow ("hard-break-no-blank") + << QString (50, QLatin1Char {'A'}) + << (QString (40, QLatin1Char {'A'}) + QString {"\n "} + + QString (10, QLatin1Char {'A'})); + QTest::newRow ("leading-space-does-not-create-empty-line") + << (QString {" "} + QString (79, QLatin1Char {'A'})) + << (QString {" "} + QString (39, QLatin1Char {'A'}) + QString {"\n "} + + QString (40, QLatin1Char {'A'})); + QTest::newRow ("multiple-wrap-points") + << QString {"AAAAAAAAAA BBBBBBBBBB CCCCCCCCCC DDDDDDDDDD EEEEEEEEEE FFFFFFFFFF GGGGGGGGGG"} + << QString {"AAAAAAAAAA BBBBBBBBBB CCCCCCCCCC\n DDDDDDDDDD EEEEEEEEEE FFFFFFFFFF\n GGGGGGGGGG"}; + } + + void wrapMessage () + { + QFETCH (QString, text); + QFETCH (QString, expected); + + QCOMPARE (Jtty::wrapMessage (text), expected); + } + + void compareMessagesTracksMessageSemantics () + { + auto const unchanged = Jtty::compareMessages ( + QStringLiteral ("CQ K1ABC"), QStringLiteral ("CQ K1ABC")); + QVERIFY (!unchanged.messageChanged); + QVERIFY (!unchanged.extendsMessage); + QVERIFY (!unchanged.startsMessage); + QVERIFY (unchanged.appendedText.isEmpty ()); + + auto const growth = Jtty::compareMessages ( + QStringLiteral ("CQ K1"), QStringLiteral ("CQ K1ABC")); + QVERIFY (growth.messageChanged); + QVERIFY (growth.extendsMessage); + QVERIFY (!growth.startsMessage); + QCOMPARE (growth.appendedText, QStringLiteral ("ABC")); + + auto const replacement = Jtty::compareMessages ( + QStringLiteral ("FIRST"), QStringLiteral ("SECOND")); + QVERIFY (replacement.messageChanged); + QVERIFY (!replacement.extendsMessage); + QVERIFY (!replacement.startsMessage); + QVERIFY (replacement.appendedText.isEmpty ()); + + auto const textAfterEmptyFrame = Jtty::compareMessages ( + QString {}, QStringLiteral ("ABC")); + QVERIFY (textAfterEmptyFrame.messageChanged); + QVERIFY (textAfterEmptyFrame.extendsMessage); + QVERIFY (textAfterEmptyFrame.startsMessage); + QCOMPARE (textAfterEmptyFrame.appendedText, QStringLiteral ("ABC")); + } + + void messageUpdatesDoNotRemoveHistory () + { + QVector history { + {1, 1000.f, QStringLiteral ("FIRST"), 1.f, false}, + {2, 1100.f, QStringLiteral ("SECOND"), 2.f, false}, + }; + QVector updates { + {2, 1100.f, QStringLiteral ("SECOND"), 2.f, false}, + }; + + QVERIFY (!Jtty::mergeMessageUpdates (history, updates)); + QCOMPARE (history.size (), 2); + QCOMPARE (history.at (0).messageId, qint64 {1}); + QCOMPARE (history.at (1).messageId, qint64 {2}); + } + + void messageUpdatesReplaceSameId () + { + QVector history { + {8, 1400.f, QStringLiteral ("CQ K1"), 3.f, false}, + }; + QVector updates { + {8, 1401.f, QStringLiteral ("CQ K1ABC"), 3.f, true}, + }; + + QVERIFY (Jtty::mergeMessageUpdates (history, updates)); + QCOMPARE (history.size (), 1); + QCOMPARE (history.at (0).frequency, 1401.f); + QCOMPARE (history.at (0).text, QStringLiteral ("CQ K1ABC")); + QVERIFY (history.at (0).complete); + } + + void messageUpdatesPreserveCompletionAndInitialStart () + { + QVector history { + {12, 1600.f, QStringLiteral ("TEST"), 4.f, true}, + }; + QVector updates { + {12, 1600.f, QStringLiteral ("TEST"), 9.f, false}, + }; + + QVERIFY (!Jtty::mergeMessageUpdates (history, updates)); + QVERIFY (history.at (0).complete); + QCOMPARE (history.at (0).sequenceStart, 4.f); + } + + void messageUpdatesDistinguishIdenticalTextById () + { + QVector history { + {qint64 {1} << 35, 1600.f, QStringLiteral ("TEST"), 1.f, false}, + }; + QVector updates { + {(qint64 {1} << 35) + 1, 1600.f, QStringLiteral ("TEST"), 2.f, false}, + }; + + QVERIFY (Jtty::mergeMessageUpdates (history, updates)); + QCOMPARE (history.size (), 2); + QVERIFY (history.at (0).messageId != history.at (1).messageId); + QCOMPARE (history.at (0).text, history.at (1).text); + } + + void messageUpdatesOrderByStartTimeThenId () + { + QVector history; + QVector updates { + {9, 1000.f, QStringLiteral ("FOURTH"), 5.f, false}, + {4, 2000.f, QStringLiteral ("FIRST"), 1.f, false}, + {7, 900.f, QStringLiteral ("THIRD"), 3.f, false}, + {2, 1800.f, QStringLiteral ("SECOND"), 3.f, false}, + }; + + QVERIFY (Jtty::mergeMessageUpdates (history, updates)); + QCOMPARE (history.size (), 4); + QCOMPARE (history.at (0).messageId, qint64 {4}); + QCOMPARE (history.at (1).messageId, qint64 {2}); + QCOMPARE (history.at (2).messageId, qint64 {7}); + QCOMPARE (history.at (3).messageId, qint64 {9}); + } + + void qsoHistoryRetainsAdmittedMessageAcrossDrift () + { + QVERIFY (Jtty::shouldApplyToQsoHistory (false, 1504.f, 1500.f, 5.f)); + QVERIFY (!Jtty::shouldApplyToQsoHistory (false, 1505.f, 1500.f, 5.f)); + QVERIFY (Jtty::shouldApplyToQsoHistory (true, 1510.f, 1500.f, 5.f)); + } +}; + +QTEST_MAIN (TestJttyMessages) +#include "test_jtty_messages.moc" diff --git a/tests/unit/jtty/test_jtty_n1mm.cpp b/tests/unit/jtty/test_jtty_n1mm.cpp new file mode 100644 index 00000000..7f2f167f --- /dev/null +++ b/tests/unit/jtty/test_jtty_n1mm.cpp @@ -0,0 +1,245 @@ +#include + +#include "widgets/JttyN1mm.hpp" +#include "widgets/JttyN1mmOutput.hpp" + +class TestJttyN1mm final : public QObject +{ + Q_OBJECT + + using Kind = Jtty::NativeAtomKind; + using Profile = Jtty::NativeExchangeProfile; + using Status = Jtty::N1mmCompileStatus; + +private slots: + void rejectedOutputCompletesOnceAtOff () + { + Jtty::N1mmOutput output; + output.submit (1); + QVERIFY (output.resolve (1)); + QVERIFY (!output.takeCompletion (false)); + QVERIFY (!output.takeCompletion (false, true)); + output.start (); + output.finish (); + QVERIFY (output.takeCompletion (false)); + QVERIFY (!output.takeCompletion (false, true)); + output.finish (); + QVERIFY (!output.finishRequested ()); + } + + void mixedOutputWaitsForAcceptedAudio () + { + Jtty::N1mmOutput output; + output.start (); + output.submit (1); + QVERIFY (output.resolve (1)); + QVERIFY (!output.takeCompletion (false)); + QVERIFY (output.startRequested ()); + output.submit (2); + output.finish (); + QVERIFY (output.startRequested ()); + QVERIFY (!output.takeCompletion (false)); + QVERIFY (!output.takeCompletion (true)); + QVERIFY (output.accept (2)); + output.started (); + QVERIFY (output.resolve (2)); + QVERIFY (!output.takeCompletion (true)); + QVERIFY (output.takeCompletion (false, true)); + } + + void asynchronousRejectionAfterOffCompletesWithoutDrain () + { + Jtty::N1mmOutput output; + output.start (); + output.submit (1); + output.finish (); + QVERIFY (!output.takeCompletion (true)); + QVERIFY (output.resolve (1)); + QVERIFY (!output.takeCompletion (true)); + QVERIFY (output.takeCompletion (false)); + } + + void drainBeforeOffAndAbortDoNotDuplicateCompletion () + { + Jtty::N1mmOutput output; + output.submit (1); + output.start (); + QVERIFY (output.accept (1)); + QVERIFY (output.resolve (1)); + QVERIFY (output.takeCompletion (false, true)); + output.finish (); + QVERIFY (!output.takeCompletion (false)); + output.submit (2); + output.abort (); + QVERIFY (!output.resolve (2)); + output.finish (); + QVERIFY (!output.takeCompletion (false, true)); + } + + void everyActionCompiles () + { + struct Example + { + QString message; + Profile profile; + QString canonical; + QVector kinds; + }; + QVector const examples { + {"[[JTTY:CQ]] K1ABC", Profile::None, "CQ K1ABC CQ", {Kind::Call}}, + {"[[JTTY:CALL_EXCH]] W9XYZ 7", Profile::None, "W9XYZ 599 007", + {Kind::Call, Kind::ExchangeNumber}}, + {"[[JTTY:CALL_TU_CQ]] W9XYZ K1ABC", Profile::None, "W9XYZ TU CQ K1ABC CQ", + {Kind::Call, Kind::Call}}, + {"[[JTTY:MYCALL]] K1ABC", Profile::None, "K1ABC", {Kind::Call}}, + {"[[JTTY:HISCALL]] W9XYZ", Profile::None, "W9XYZ", {Kind::Call}}, + {"[[JTTY:TU_NOW_EXCH]] W9XYZ 42", Profile::None, "TU NOW W9XYZ 599 042", + {Kind::Call, Kind::ExchangeNumber}}, + {"[[JTTY:CALL_MY]] W9XYZ K1ABC", Profile::None, "W9XYZ K1ABC", + {Kind::Call, Kind::Call}}, + {"[[JTTY:CALL_TU_MY]] W9XYZ K1ABC", Profile::None, "W9XYZ TU K1ABC", + {Kind::Call, Kind::Call}}, + {"[[JTTY:EXCH]] 1D EMA", Profile::FieldDay, "1D EMA", {Kind::ExchangePair}}, + {"[[JTTY:GRID]] fn42", Profile::None, "FN42", {Kind::Grid4}}, + {"[[JTTY:CONTROL]] qsl tu", Profile::None, "QSL TU", {Kind::Control}} + }; + + for (auto const& example : examples) { + auto const result = Jtty::compileN1mmMessage (example.message, example.profile); + QCOMPARE (result.status, Status::Native); + QCOMPARE (result.canonicalText, example.canonical); + QCOMPARE (result.atoms.size (), example.kinds.size ()); + for (int i = 0; i < result.atoms.size (); ++i) { + QCOMPARE (int {result.atoms.at (i).kind}, static_cast (example.kinds.at (i))); + } + } + } + + void tagMatchingIsCaseAndWhitespaceNormalized () + { + auto const result = Jtty::compileN1mmMessage ( + QStringLiteral (" \t[[jtty:call_tu_cq]] w9xyz\n k1abc ")); + QCOMPARE (result.status, Status::Native); + QCOMPARE (result.canonicalText, QStringLiteral ("W9XYZ TU CQ K1ABC CQ")); + } + + void tagClassification () + { + QString const literal = QStringLiteral (" W9XYZ 599 007"); + auto const untagged = Jtty::compileN1mmMessage (literal); + QCOMPARE (untagged.status, Status::Literal); + QCOMPARE (untagged.literalText, literal); + QVERIFY (untagged.atoms.isEmpty ()); + + auto const notFirst = Jtty::compileN1mmMessage ( + QStringLiteral ("CQ [[JTTY:CQ]] K1ABC")); + QCOMPARE (notFirst.status, Status::Literal); + + auto const malformed = Jtty::compileN1mmMessage ( + QStringLiteral (" [[JTTY:CQ K1ABC")); + QCOMPARE (malformed.status, Status::Error); + QVERIFY (!malformed.error.isEmpty ()); + + auto const malformedStem = Jtty::compileN1mmMessage ( + QStringLiteral ("[[JTTY]] K1ABC")); + QCOMPARE (malformedStem.status, Status::Error); + QVERIFY (!malformedStem.error.isEmpty ()); + + auto const unknown = Jtty::compileN1mmMessage ( + QStringLiteral ("[[JTTY:MAGIC]] K1ABC")); + QCOMPARE (unknown.status, Status::Error); + QVERIFY (unknown.error.contains (QStringLiteral ("unknown"))); + } + + void profileDrivenExchange () + { + auto const serial = Jtty::compileN1mmMessage ( + QStringLiteral ("[[JTTY:EXCH]] 00042"), Profile::RttyRoundup); + QCOMPARE (serial.status, Status::Native); + QCOMPARE (serial.canonicalText, QStringLiteral ("599 042")); + QCOMPARE (int {serial.atoms.first ().kind}, static_cast (Kind::ExchangeNumber)); + QCOMPARE (serial.atoms.first ().value, qint32 {42}); + + auto const state = Jtty::compileN1mmMessage ( + QStringLiteral ("[[JTTY:CALL_EXCH]] W9XYZ az"), Profile::RttyRoundup); + QCOMPARE (state.status, Status::Native); + QCOMPARE (state.canonicalText, QStringLiteral ("W9XYZ 599 AZ")); + QCOMPARE (int {state.atoms.last ().kind}, static_cast (Kind::ExchangeLocation)); + QCOMPARE (int {state.atoms.last ().subtype}, + static_cast (Jtty::LocationKind::StateProvince)); + + auto const dx = Jtty::compileN1mmMessage ( + QStringLiteral ("[[JTTY:EXCH]] DX"), Profile::RttyRoundup); + QCOMPARE (dx.status, Status::Native); + QCOMPARE (dx.canonicalText, QStringLiteral ("599 DX")); + QCOMPARE (int {dx.atoms.first ().kind}, static_cast (Kind::ExchangeLocation)); + + auto const fieldDay = Jtty::compileN1mmMessage ( + QStringLiteral ("[[JTTY:EXCH]] 32f ema"), Profile::FieldDay); + QCOMPARE (fieldDay.status, Status::Native); + QCOMPARE (fieldDay.canonicalText, QStringLiteral ("32F EMA")); + QCOMPARE (fieldDay.atoms.first ().value, qint32 {32}); + QCOMPARE (int {fieldDay.atoms.first ().role}, 5); + QCOMPARE (QString::fromLatin1 (fieldDay.atoms.first ().text), QStringLiteral ("EMA")); + } + + void payloadValidation_data () + { + QTest::addColumn ("message"); + QTest::addColumn ("profile"); + + QTest::newRow ("empty") << QStringLiteral ("[[JTTY:CQ]]") << int (Profile::None); + QTest::newRow ("cq-extra") << QStringLiteral ("[[JTTY:CQ]] K1ABC CQ") + << int (Profile::None); + QTest::newRow ("bad-call") << QStringLiteral ("[[JTTY:HISCALL]] NOTACALL") + << int (Profile::None); + QTest::newRow ("call-extra") << QStringLiteral ("[[JTTY:MYCALL]] K1ABC EXTRA") + << int (Profile::None); + QTest::newRow ("missing-exchange") << QStringLiteral ("[[JTTY:CALL_EXCH]] W9XYZ") + << int (Profile::None); + QTest::newRow ("serial-junk") << QStringLiteral ("[[JTTY:EXCH]] 12A") + << int (Profile::None); + QTest::newRow ("serial-overflow") << QStringLiteral ("[[JTTY:EXCH]] 131072") + << int (Profile::RttyRoundup); + QTest::newRow ("unexpanded-hash") << QStringLiteral ("[[JTTY:EXCH]] #") + << int (Profile::RttyRoundup); + QTest::newRow ("field-day-shape") << QStringLiteral ("[[JTTY:EXCH]] 1D") + << int (Profile::FieldDay); + QTest::newRow ("field-day-compact") << QStringLiteral ("[[JTTY:EXCH]] 3AOR") + << int (Profile::FieldDay); + QTest::newRow ("field-day-count") << QStringLiteral ("[[JTTY:EXCH]] 33A EMA") + << int (Profile::FieldDay); + QTest::newRow ("grid-extra") << QStringLiteral ("[[JTTY:GRID]] 599 FN42") + << int (Profile::None); + QTest::newRow ("grid-field") << QStringLiteral ("[[JTTY:GRID]] SA00") + << int (Profile::None); + QTest::newRow ("grid-digit") << QStringLiteral ("[[JTTY:GRID]] FN4A") + << int (Profile::None); + QTest::newRow ("control") << QStringLiteral ("[[JTTY:CONTROL]] THANKS") + << int (Profile::None); + } + + void payloadValidation () + { + QFETCH (QString, message); + QFETCH (int, profile); + auto const result = Jtty::compileN1mmMessage ( + message, static_cast (profile)); + QCOMPARE (result.status, Status::Error); + QVERIFY (!result.error.isEmpty ()); + QVERIFY (result.atoms.isEmpty ()); + } + + void contextOverloadUsesSelectedProfile () + { + Jtty::NativeMacroContext context; + context.exchangeProfile = Profile::FieldDay; + auto const result = Jtty::compileN1mmMessage ( + QStringLiteral ("[[JTTY:EXCH]] 1D EMA"), context); + QCOMPARE (result.status, Status::Native); + QCOMPARE (int {result.atoms.first ().kind}, static_cast (Kind::ExchangePair)); + } +}; + +QTEST_GUILESS_MAIN (TestJttyN1mm) +#include "test_jtty_n1mm.moc" diff --git a/tests/unit/jtty/test_jtty_overlap_decode.f90 b/tests/unit/jtty/test_jtty_overlap_decode.f90 new file mode 100644 index 00000000..b440d1f3 --- /dev/null +++ b/tests/unit/jtty/test_jtty_overlap_decode.f90 @@ -0,0 +1,202 @@ +program test_jtty_overlap_decode + + ! Overlap two generated JTTY transmissions and decode them through + ! rjtty_sub. This is a stand-in for the private W2PU on-air corpus. + ! + ! The 4 Hz case reproduces leftover extra-slot fragments: a real next + ! frame lands just outside the 3 Hz continuation gate and opens a new + ! message instead of staying on its assembly. Isolated and 2 Hz cases are + ! controls that already pass. + + use iso_fortran_env, only: int16 + use jtty_fec, only: is13, TOTAL_K + use jtty_mdec, only: npending,pending_updates,discard_pending_updates + use jtty_mod, only: MAX_FRAMES + implicit none + + character(len=*), parameter :: msg_a='MAYBE YOU SHOULD HELP' + character(len=*), parameter :: msg_b='CLAUDE CO 3 MIN TRANSITION' + integer :: failures,nsps + character(len=16) :: rate_arg + integer :: failures_before_overlap + + nsps=384 + call get_command_argument(1,rate_arg) + if(len_trim(rate_arg).gt.0) read(rate_arg,*) nsps + failures=0 + + call expect_complete_pair('isolated first message',msg_a,1500.0,0.2, & + '',1500.0,0.6,1,failures) + call expect_complete_pair('isolated second message','',1500.0,0.2, & + msg_b,1504.0,0.6,1,failures) + call expect_complete_pair('2 Hz overlap stays two complete messages', & + msg_a,1500.0,0.2,msg_b,1502.0,0.6,2,failures) + + failures_before_overlap=failures + call expect_complete_pair('4 Hz overlap stays two complete messages', & + msg_a,1500.0,0.2,msg_b,1504.0,0.6,2,failures) + if(failures.gt.failures_before_overlap) then + write(*,'(a)') '4 Hz overlap messages: '//trim(message_summary()) + endif + + if(failures.ne.0) then + write(*,'(a,i0)') 'test_jtty_overlap_decode: failures=',failures + stop 1 + endif + write(*,'(a)') 'test_jtty_overlap_decode: all checks passed' + +contains + + subroutine expect_complete_pair(description,first_message,first_hz, & + first_dt,second_message,second_hz,second_dt,expected_messages,count) + character(len=*), intent(in) :: description,first_message,second_message + real, intent(in) :: first_hz,first_dt,second_hz,second_dt + integer, intent(in) :: expected_messages + integer, intent(inout) :: count + logical :: found_a,found_b + + call decode_overlap(first_message,first_hz,first_dt,second_message, & + second_hz,second_dt,50.0) + call message_coverage(first_message,second_message,found_a,found_b) + call expect(npending.eq.expected_messages,description//': message count',count) + if(len_trim(first_message).gt.0) then + call expect(found_a,description//': first message complete',count) + endif + if(len_trim(second_message).gt.0) then + call expect(found_b,description//': second message complete',count) + endif + end subroutine expect_complete_pair + + subroutine decode_overlap(first_message,first_hz,first_dt,second_message, & + second_hz,second_dt,ftol) + character(len=*), intent(in) :: first_message,second_message + real, intent(in) :: first_hz,first_dt,second_hz,second_dt,ftol + integer, parameter :: frame_symbols=size(is13)+TOTAL_K + integer :: first_tones(MAX_FRAMES*frame_symbols) + integer :: second_tones(MAX_FRAMES*frame_symbols) + integer :: first_symbols,second_symbols + integer :: first_samples,second_samples,first_start,second_start + integer :: total_samples,i,idx + integer :: first_pcm,second_pcm,mixed + integer(int16), allocatable :: pcm(:) + real, allocatable :: first_wave(:),second_wave(:) + complex, allocatable :: complex_wave(:) + character(len=80) :: first_input,second_input + + call discard_pending_updates() + first_symbols=0 + second_symbols=0 + first_samples=0 + second_samples=0 + first_start=1 + second_start=1 + + if(len_trim(first_message).gt.0) then + first_input=first_message + call genjtty(first_input,first_tones,first_symbols) + first_samples=first_symbols*nsps + first_start=max(1,nint(first_dt*12000.0)+1) + endif + if(len_trim(second_message).gt.0) then + second_input=second_message + call genjtty(second_input,second_tones,second_symbols) + second_samples=second_symbols*nsps + second_start=max(1,nint(second_dt*12000.0)+1) + endif + + total_samples=max(first_start+first_samples-1, & + second_start+second_samples-1)+frame_symbols*nsps + allocate(pcm(total_samples)) + pcm=0_int16 + + if(first_samples.gt.0) then + allocate(first_wave(first_samples),complex_wave(first_samples)) + call gen_jttywave(first_tones,first_symbols,nsps,2.0,12000.0,first_hz, & + complex_wave,first_wave,0,first_samples) + do i=1,first_samples + idx=first_start+i-1 + first_pcm=nint(14000.0*first_wave(i)) + pcm(idx)=int(max(-32767,min(32767,first_pcm)),int16) + enddo + deallocate(first_wave,complex_wave) + endif + + if(second_samples.gt.0) then + allocate(second_wave(second_samples),complex_wave(second_samples)) + call gen_jttywave(second_tones,second_symbols,nsps,2.0,12000.0, & + second_hz,complex_wave,second_wave,0,second_samples) + do i=1,second_samples + idx=second_start+i-1 + second_pcm=nint(14000.0*second_wave(i)) + mixed=int(pcm(idx))+second_pcm + pcm(idx)=int(max(-32767,min(32767,mixed)),int16) + enddo + deallocate(second_wave,complex_wave) + endif + + call rjtty_sub(pcm,1,nsps,200,2800,1500.0,ftol) + call rjtty_sub(pcm,total_samples,nsps,200,2800,1500.0,ftol) + deallocate(pcm) + end subroutine decode_overlap + + subroutine message_coverage(first_message,second_message,found_a,found_b) + character(len=*), intent(in) :: first_message,second_message + logical, intent(out) :: found_a,found_b + integer :: i + + found_a=len_trim(first_message).eq.0 + found_b=len_trim(second_message).eq.0 + do i=1,npending + if(len_trim(first_message).gt.0) then + if(trim(normalized(pending_updates(i)%decoded)).eq.trim(first_message)) & + found_a=.true. + endif + if(len_trim(second_message).gt.0) then + if(trim(normalized(pending_updates(i)%decoded)).eq.trim(second_message)) & + found_b=.true. + endif + enddo + end subroutine message_coverage + + function message_summary() result(text) + character(len=240) :: text + character(len=80) :: body + integer :: i,pos + + text='' + pos=1 + do i=1,npending + body=normalized(pending_updates(i)%decoded) + if(pos.gt.1) then + text(pos:pos)='|' + pos=pos+1 + endif + text(pos:pos+len_trim(body)-1)=trim(body) + pos=pos+len_trim(body) + if(pos.ge.len(text)-1) exit + enddo + end function message_summary + + function normalized(value) result(result_value) + character(len=*), intent(in) :: value + character(len=80) :: result_value + integer :: i + + result_value=adjustl(value) + do i=1,len_trim(result_value) + if(result_value(i:i).eq.'~') result_value(i:i)=' ' + enddo + end function normalized + + subroutine expect(condition,description,count) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + integer, intent(inout) :: count + + if(.not.condition) then + count=count+1 + write(*,'(a)') 'FAIL: '//description + endif + end subroutine expect + +end program test_jtty_overlap_decode diff --git a/tests/unit/jtty/test_jtty_pack.f90 b/tests/unit/jtty/test_jtty_pack.f90 new file mode 100644 index 00000000..31541cfb --- /dev/null +++ b/tests/unit/jtty/test_jtty_pack.f90 @@ -0,0 +1,460 @@ +program test_jtty_pack + + use jtty_mod + use packjt77, only: pack28 + character*80 msg0,msg,expected + character*34 c32(MAX_FRAMES) + character*17 cparms + character*1 err + integer, parameter :: expected_errors = 0 + + open(10,file='jtty_msgs.txt',status='old') + write(*,1000) +1000 format('i2.n2 i2.n2 NC NF err Message'/87('-')) + nerr=0 + nz=0 + c32='' + do imsg=1,99 + read(10,'(a80)',end=100) msg0 + call normalize_jtty_message(msg0,expected) + nlength=len_trim(expected) + if(nlength.eq.0) then + write(*,*) + cycle + endif + nz=nz+1 + call pack_jtty(msg0,c32,nframes) + if(nframes.lt.0) then + err='*' + nerr=nerr+1 + cycle + endif + call expect_no_reserved_frame_ids(c32,nframes,msg0) + call unpack_jtty(c32,nframes,msg) + call display_jtty_message(msg) + err=' ' + if(msg.ne.expected) then + err='*' + nerr=nerr+1 + write(12,1010) trim(expected),trim(msg) +1010 format(a/a) + endif + read(c32(1),1012) n2a,i2a + read(c32(2),1012) n2b,i2b +1012 format(28x,2b2) + write(cparms,1018) i2a,n2a,i2b,n2b,nlength,nframes +1018 format(i2,'.',i1,2x,i2,'.',i1,i4,i3) + if(i2a.ge.2) cparms(3:4)=' ' + if(i2b.ge.2) cparms(9:10)=' ' + if(nframes.eq.1) cparms(7:10)=' ' + write(*,1020) cparms,err,trim(msg) +1020 format(a17,2x,a1,2x,a) + enddo + +100 write(*,1100) nz,nerr +1100 format(/'Total messages:',i3,' Number of errors:',i3) + if(nerr.ne.expected_errors) error stop 1 + + call expect_pack('CQ KA1ABC CQ',1,0,0,-1,-1) + call expect_pack('CQ K1ABC CQ',1,0,0,-1,-1) + call expect_pack('K1A',1,0,1,-1,-1) + call expect_pack('WB9XYZ',1,0,1,-1,-1) + call expect_pack('TU WB9XYZ CQ',1,0,2,-1,-1) + call expect_pack('WB9XYZ TU',1,0,3,-1,-1) + call expect_pack('WB9XYZ AGN?',1,1,0,-1,-1) + call expect_pack('TU NOW WB9XYZ',1,1,1,-1,-1) + call expect_pack('WB9XYZ TU CQ KA1ABC CQ',2,0,3,0,0) + call expect_pack('K1ABC TU NOW W1XYZ',2,0,1,1,1) + call expect_pack('WB9XYZ 599 123',2,0,1,2,-1) + call expect_pack('599 MA',1,2,-1,-1,-1) + call expect_pack('599 FN42',1,2,-1,-1,-1) + call expect_pack('FN42',1,2,-1,-1,-1) + call expect_pack('1D EMA',1,2,-1,-1,-1) + call expect_pack('32F EMA',1,2,-1,-1,-1) + call expect_pack('0',1,2,-1,-1,-1) + call expect_pack('131071',1,2,-1,-1,-1) + call expect_pack('599 131071',1,2,-1,-1,-1) + call expect_pack('599 001',2,-1,-1,-1,-1) + call expect_pack('599 05',2,-1,-1,-1,-1) + call expect_pack('599 BRUCE',2,-1,-1,-1,-1) + call expect_pack('131072',2,3,-1,3,-1) + call expect_pack('000001',2,3,-1,3,-1) + call expect_pack('01D EMA',2,3,-1,3,-1) + call expect_pack('33D EMA',2,3,-1,3,-1) + call expect_pack('1G EMA',2,3,-1,3,-1) + call expect_pack('1D ZZZ',2,3,-1,3,-1) + call expect_pack('599 SA00',2,-1,-1,-1,-1) + call expect_pack('599 A!',2,-1,-1,-1,-1) + call expect_pack('599 XYZ',1,2,-1,-1,-1) + call expect_pack('599 0AB',2,-1,-1,-1,-1) + call expect_pack('CQ K1ABC CQ!',3,-1,-1,-1,-1) + call expect_pack('TEST WB9XYZ',2,3,-1,0,1) + call expect_pack('HI WB9XYZ',2,3,-1,3,-1) + call expect_pack('K1ABC HELLO',2,0,1,3,-1) + call expect_pack('TEST AGN NR',2,3,-1,2,-1) + call expect_pack(repeat('A',80),16,3,-1,3,-1) + call expect_pack('',0,-1,-1,-1,-1) + call expect_pack(' ',0,-1,-1,-1,-1) + call expect_pack('599 A',1,3,-1,-1,-1) + call expect_pack('599 BRUCE F',3,-1,-1,-1,-1) + call expect_pack('A599 MA',2,3,-1,3,-1) + call expect_pack('VP2/KF2GHI',2,3,-1,3,-1) + call expect_pack('VP2/KA1ABC',2,3,-1,3,-1) + call expect_pack('QU1RK',1,3,-1,-1,-1) + call expect_pack('TU QU1RKP CQ',3,2,-1,3,-1) + call expect_pack('WB9XYZABC',2,3,-1,3,-1) + call expect_pack('K1A A',1,3,-1,-1,-1) + call expect_pack('PSE AGN NR',2,-1,-1,-1,-1) + call expect_pack('AGN NR PSE',2,2,-1,3,-1) + call expect_control_phrase_literals() + call expect_atom('599 123',jtty_exch_num_atom(JTTY_ROLE_FULL,JTTY_NUM_GENERIC,123)) + call expect_atom('123',jtty_exch_num_atom(JTTY_ROLE_FIELD_ONLY,JTTY_NUM_GENERIC,123)) + call expect_atom('599 MA',jtty_exch_loc_atom(JTTY_ROLE_FULL,JTTY_LOC_QTH,'MA')) + call expect_atom('599 FN42',jtty_grid4_atom(JTTY_ROLE_FULL,'FN42')) + call expect_exchange_profiles() + ! Normalization is part of the round-trip contract for operator input. + call expect_pack('cq ka1abc cq',1,0,0,-1,-1) + call expect_pack(' vp2/kf2ghi ',2,3,-1,3,-1) + call expect_pack('A'//char(0)//'B',1,3,-1,-1,-1) + call expect_pack('A~B',1,3,-1,-1,-1) + call expect_pack('HELLO~',1,3,-1,-1,-1) + call expect_pack('HELLO'//char(9)//'WORLD',3,3,-1,3,-1) + call expect_pack('HELLO'//char(10)//'WORLD',3,3,-1,3,-1) + call expect_pack('HELLO'//char(13)//'WORLD',3,3,-1,3,-1) + call expect_unassigned_unpack_empty(1,2) + call expect_unassigned_unpack_empty(1,3) + call expect_structured_unpack_boundary() + call expect_empty_waveform_guard() + call expect_last_frame_flag() + +contains + + subroutine expect_atom(text,atom,exchange_profile) + character(len=*), intent(in) :: text + type(jtty_source_atom), intent(in) :: atom + integer, intent(in), optional :: exchange_profile + character(len=80) :: input + character(len=34) :: frames(MAX_FRAMES),expected_frame + integer :: nframes + logical :: valid + + input=text + call pack_jtty(input,frames,nframes,exchange_profile) + call pack_jtty_atom(atom,expected_frame,.true.,valid) + if(.not.valid .or. nframes.ne.1 .or. frames(1).ne.expected_frame) then + write(*,'(a)') 'Unexpected inferred atom for "'//text//'"' + error stop 1 + endif + end subroutine expect_atom + + subroutine expect_exchange_profiles() + character(len=80), parameter :: examples(*)=[character(len=80) :: & + '599 001','K1ABC 599 001','599 05','599 0123','001','599 123', & + '599 MA','599 131071','599 0AB','1D EMA','CQ K1ABC CQ','K1A A'] + character(len=80) :: input,decoded + character(len=34) :: baseline(MAX_FRAMES),frames(MAX_FRAMES) + integer :: i,profile,baseline_nf,nframes + + call expect_pack('599 001',1,2,-1,-1,-1,JTTY_EXCHANGE_RTTY) + call expect_pack('K1ABC 599 001',2,0,1,2,-1,JTTY_EXCHANGE_RTTY) + call expect_pack('K1ABC 599 001',3,0,1,-1,-1,JTTY_EXCHANGE_UNKNOWN) + call expect_pack('599 05',1,2,-1,-1,-1,JTTY_EXCHANGE_RTTY,'599 005') + call expect_pack('599 0123',1,2,-1,-1,-1,JTTY_EXCHANGE_RTTY,'599 123') + call expect_pack('K1ABC 599 05 QSL TU',3,0,1,2,-1,JTTY_EXCHANGE_RTTY,'K1ABC 599 005 QSL TU') + call expect_pack('599 05 599 0123',2,2,-1,2,-1,JTTY_EXCHANGE_RTTY,'599 005 599 123') + call expect_pack('599 000005',1,2,-1,-1,-1,JTTY_EXCHANGE_RTTY,'599 005') + call expect_pack('599 0',1,2,-1,-1,-1,JTTY_EXCHANGE_RTTY,'599 000') + call expect_pack('599 0000005',3,-1,-1,-1,-1,JTTY_EXCHANGE_RTTY) + call expect_pack('599 131072',2,-1,-1,-1,-1,JTTY_EXCHANGE_RTTY) + call expect_pack('599 05A',2,-1,-1,-1,-1,JTTY_EXCHANGE_RTTY) + call expect_pack('A599 05',2,3,-1,3,-1,JTTY_EXCHANGE_RTTY) + call expect_pack('599 05!',2,-1,-1,-1,-1,JTTY_EXCHANGE_RTTY) + call expect_pack('05',1,3,-1,-1,-1,JTTY_EXCHANGE_RTTY) + call expect_pack('599 05',2,-1,-1,-1,-1,JTTY_EXCHANGE_FIELD_DAY) + call expect_pack(repeat('A',72)//' 599 05',16,3,-1,3,-1,JTTY_EXCHANGE_RTTY, & + repeat('A',72)//' 599 005') + call expect_pack(repeat('A',64)//' 599 05 599 0123',15,3,-1,3,-1,JTTY_EXCHANGE_RTTY, & + repeat('A',64)//' 599 005 599 123') + call expect_pack('001',1,3,-1,-1,-1,JTTY_EXCHANGE_RTTY) + call expect_atom('599 001',jtty_exch_num_atom(JTTY_ROLE_FULL,JTTY_NUM_SERIAL,1),JTTY_EXCHANGE_RTTY) + call expect_atom('599 123',jtty_exch_num_atom(JTTY_ROLE_FULL,JTTY_NUM_SERIAL,123),JTTY_EXCHANGE_RTTY) + call expect_atom('599 MA',jtty_exch_loc_atom(JTTY_ROLE_FULL,JTTY_LOC_STATE_PROVINCE,'MA'),JTTY_EXCHANGE_RTTY) + call expect_atom('123',jtty_exch_num_atom(JTTY_ROLE_FIELD_ONLY,JTTY_NUM_GENERIC,123),JTTY_EXCHANGE_RTTY) + call expect_atom('599 123',jtty_exch_num_atom(JTTY_ROLE_FULL,JTTY_NUM_GENERIC,123),JTTY_EXCHANGE_FIELD_DAY) + call expect_atom('599 MA',jtty_exch_loc_atom(JTTY_ROLE_FULL,JTTY_LOC_QTH,'MA'),JTTY_EXCHANGE_FIELD_DAY) + + do i=1,size(examples) + input=examples(i) + call pack_jtty(input,baseline,baseline_nf) + do profile=JTTY_EXCHANGE_UNKNOWN,JTTY_EXCHANGE_RTTY + input=examples(i) + call pack_jtty(input,frames,nframes,profile) + if(nframes.lt.1 .or. nframes.gt.baseline_nf) error stop 'Profile worsened frame count' + if(profile.ne.JTTY_EXCHANGE_RTTY) then + if(nframes.ne.baseline_nf .or. any(frames.ne.baseline)) error stop 'Unexpected non-RTTY inference' + endif + call unpack_jtty(frames,nframes,decoded) + call display_jtty_message(decoded) + if(decoded.ne.input) error stop 'Profile changed rendered text' + enddo + input=examples(i) + call pack_jtty(input,frames,nframes) + if(nframes.ne.baseline_nf .or. any(frames.ne.baseline)) error stop 'Profile leaked between calls' + enddo + input='599 001' + call pack_jtty(input,frames,nframes,-1) + if(nframes.ne.-1 .or. any(frames.ne.'')) error stop 'Accepted invalid negative profile' + call pack_jtty(input,frames,nframes,JTTY_EXCHANGE_RTTY+1) + if(nframes.ne.-1 .or. any(frames.ne.'')) error stop 'Accepted unknown profile' + input=repeat('A',73)//' 599 05' + call pack_jtty(input,frames,nframes,JTTY_EXCHANGE_RTTY) + if(nframes.ne.-1 .or. any(frames.ne.'')) error stop 'Accepted canonical text exceeding 80 characters' + end subroutine expect_exchange_profiles + + subroutine expect_control_phrase_literals() + type(jtty_source_atom) atom + character*80 input,decoded,expected + character*34 frame,frames(MAX_FRAMES) + integer phrase_id,got_nf + logical valid,eom + + do phrase_id=lbound(CONTROL_TEXT,1),ubound(CONTROL_TEXT,1) + input='' + if(phrase_id.eq.JTTY_CONTROL_AGN_NR) then + input=' agn nr ' + else + input=trim(CONTROL_TEXT(phrase_id)) + endif + call normalize_jtty_message(input,expected) + call pack_jtty(input,frames,got_nf) + if(got_nf.ne.1) then + write(*,1030) trim(expected),got_nf +1030 format('Control phrase "',a,'" encoded in ',i0,' frames') + error stop 1 + endif + frame=frames(1) + call unpack_jtty_atom(frame,atom,valid,eom) + if(.not.valid .or. .not.eom .or. atom%kind.ne.JTTY_ATOM_CONTROL .or. & + atom%subtype.ne.phrase_id .or. frames(1)(33:33).ne.'0') then + write(*,1040) trim(expected),phrase_id +1040 format('Control phrase "',a,'" did not encode as CONTROL ',i0) + error stop 1 + endif + call unpack_jtty(frames,got_nf,decoded) + call display_jtty_message(decoded) + if(decoded.ne.expected) then + write(*,1050) trim(expected),trim(decoded) +1050 format('Control phrase "',a,'" decoded as "',a,'"') + error stop 1 + endif + enddo + end subroutine expect_control_phrase_literals + + subroutine display_jtty_message(text) + character*80 text + + do i=1,len_trim(text) + if(text(i:i).eq.'~') text(i:i)=' ' + enddo + end subroutine display_jtty_message + + subroutine expect_pack(text,want_nf,want_i2a,want_n2a,want_i2b,want_n2b,exchange_profile,canonical_text) + character*(*) text + character*80 input,decoded,want_decoded,part,incremental + character*34 frames(MAX_FRAMES),single(MAX_FRAMES) + integer want_nf,want_i2a,want_n2a,want_i2b,want_n2b + integer, intent(in), optional :: exchange_profile + character(len=*), intent(in), optional :: canonical_text + integer got_nf,got_i2a,got_n2a,got_i2b,got_n2b,iframe + logical trailing_sep,is_last,valid + + input='' + input=text + call normalize_jtty_message(input,want_decoded) + if(present(canonical_text)) want_decoded=canonical_text + frames='' + call pack_jtty(input,frames,got_nf,exchange_profile) + if(input.ne.want_decoded) error stop 'Returned message differs from canonical text' + if(got_nf.lt.0) then + write(*,1195) trim(input) +1195 format('Unexpected pack failure for "',a,'"') + error stop 1 + endif + call expect_no_reserved_frame_ids(frames,got_nf,input) + call unpack_jtty(frames,got_nf,decoded) + call display_jtty_message(decoded) + if(decoded.ne.want_decoded) then + write(*,1200) trim(want_decoded),trim(decoded) +1200 format('Round-trip failure for "',a,'"; decoded "',a,'"') + error stop 1 + endif + if(got_nf.ne.want_nf) then + write(*,1210) trim(input),want_nf,got_nf +1210 format('Frame-count failure for "',a,'"; wanted ',i0,' got ',i0) + error stop 1 + endif + incremental='' + do iframe=1,got_nf + single='' + single(1)=frames(iframe) + call unpack_jtty(single,1,part,trailing_sep,is_last,valid) + if(.not.valid .or. (is_last.neqv.(iframe.eq.got_nf))) error stop 'Invalid incremental frame' + incremental=trim(incremental)//trim(part) + if(trailing_sep .and. iframe.lt.got_nf) incremental=trim(incremental)//'~' + if(frames(iframe)(33:33).ne.'0') error stop 'Nonzero reserved bit' + enddo + call display_jtty_message(incremental) + if(incremental.ne.want_decoded) error stop 'Incremental text differs from whole-message text' + if(got_nf.eq.0) return + read(frames(1),'(28x,2b2)') got_n2a,got_i2a + if(want_i2a.ge.0 .and. got_i2a.ne.want_i2a) then + write(*,1220) trim(input),want_i2a,got_i2a +1220 format('First-frame i2 failure for "',a,'"; wanted ',i0,' got ',i0) + error stop 1 + endif + if(want_n2a.ge.0 .and. got_n2a.ne.want_n2a) then + write(*,1230) trim(input),want_n2a,got_n2a +1230 format('First-frame n2 failure for "',a,'"; wanted ',i0,' got ',i0) + error stop 1 + endif + if(want_i2b.ge.0) then + read(frames(2),'(28x,2b2)') got_n2b,got_i2b + if(got_i2b.ne.want_i2b) then + write(*,1240) trim(input),want_i2b,got_i2b +1240 format('Second-frame i2 failure for "',a,'"; wanted ',i0,' got ',i0) + error stop 1 + endif + if(want_n2b.ge.0 .and. got_n2b.ne.want_n2b) then + write(*,1250) trim(input),want_n2b,got_n2b +1250 format('Second-frame n2 failure for "',a,'"; wanted ',i0,' got ',i0) + error stop 1 + endif + endif + end subroutine expect_pack + + subroutine expect_no_reserved_frame_ids(frames,nframes,input) + character*34 frames(MAX_FRAMES) + character*(*) input + integer nframes, iframe, got_i2, got_n2 + + do iframe=1,nframes + read(frames(iframe),'(28x,2b2)') got_n2, got_i2 + if(got_i2.eq.1 .and. got_n2.ge.2) then + write(*,1260) trim(input),iframe,got_i2,got_n2 +1260 format('Reserved frame id for "',a,'" frame ',i0,': ',i0,'.',i0) + error stop 1 + endif + enddo + end subroutine expect_no_reserved_frame_ids + + subroutine expect_unassigned_unpack_empty(i2,n2) + character*34 frames(MAX_FRAMES) + character*80 decoded + character*13 c13 + integer i2,n2,n28,n32 + + frames='' + c13='K1ABC ' + call pack28(c13,n28) + n32=shiftl(n28,4) + 4*n2 + i2 + write(frames(1),'(b32.32,a2)') n32,'00' + call unpack_jtty(frames,1,decoded) + if(len_trim(decoded).ne.0) then + write(*,1280) i2,n2,trim(decoded) +1280 format('Unassigned frame ',i0,'.',i0,' decoded unexpectedly as "',a,'"') + error stop 1 + endif + end subroutine expect_unassigned_unpack_empty + + subroutine expect_structured_unpack_boundary() + character*34 frames(MAX_FRAMES) + character*80 decoded,expected + character*13 c13 + integer iframe,n28,n32,n30 + + ! A long structured append that straddles column 80 must be truncated exactly. + frames='' + n30=0 + do i=1,5 + n30=64*n30 + jchar('A') + enddo + n32=ishft(n30,2) + 3 + do iframe=1,14 + write(frames(iframe),'(b32.32,a2)') n32,'00' + enddo + c13='KA1ABC ' + call pack28(c13,n28) + n32=shiftl(n28,4) + 4*1 + 1 + write(frames(15),'(b32.32,a2)') n32,'00' + + expected='' + do i=1,70 + expected(i:i)='A' + enddo + expected(71:80)='TU NOW KA1' + call unpack_jtty(frames,15,decoded) + if(len_trim(decoded).ne.80 .or. decoded.ne.expected) then + write(*,1300) len_trim(decoded),trim(decoded) +1300 format('Structured-boundary unpack test decoded length ',i0,' as "',a,'"') + error stop 1 + endif + end subroutine expect_structured_unpack_boundary + + subroutine expect_empty_waveform_guard() + integer, parameter :: TEST_NSPS=4*384 + integer tones(1) + integer nsym, nsps, icmplx, nwave + real bt, fsample, f0 + real wave(TEST_NSPS) + complex cwave(TEST_NSPS) + + tones=0 + nsym=0 + nsps=TEST_NSPS + bt=2.0 + fsample=48000.0 + f0=1500.0 + icmplx=0 + nwave=nsps + + call gen_jttywave(tones,nsym,nsps,bt,fsample,f0,cwave,wave,icmplx,nwave) + if(nwave.ne.0) then + write(*,1310) nwave +1310 format('Empty waveform guard returned nwave ',i0) + error stop 1 + endif + end subroutine expect_empty_waveform_guard + + subroutine expect_last_frame_flag() + ! Bit 34 of each 34-bit frame word must be 0 on every frame except the + ! last, and 1 on the last frame of a multi-frame message -- matching how + ! the real decode drivers call unpack_jtty one frame at a time. + character*80 input, decoded + character*34 frames(MAX_FRAMES) + integer got_nf, iframe + logical is_last + + input='TU NOW JA6DEF 599 123' + frames='' + call pack_jtty(input,frames,got_nf) + if(got_nf.lt.2) then + write(*,1400) got_nf +1400 format('expect_last_frame_flag: expected >=2 frames, got ',i0) + error stop 1 + endif + do iframe=1,got_nf + call unpack_jtty(frames(iframe:iframe),1,decoded,is_last_frame=is_last) + if(iframe.lt.got_nf .and. is_last) then + write(*,1410) iframe +1410 format('expect_last_frame_flag: frame ',i0,' unexpectedly flagged as last') + error stop 1 + endif + if(iframe.eq.got_nf .and. .not.is_last) then + write(*,1420) iframe +1420 format('expect_last_frame_flag: final frame ',i0,' not flagged as last') + error stop 1 + endif + enddo + end subroutine expect_last_frame_flag + +end program test_jtty_pack diff --git a/tests/unit/jtty/test_jtty_payload_correlators.f90 b/tests/unit/jtty/test_jtty_payload_correlators.f90 new file mode 100644 index 00000000..a87fd6c4 --- /dev/null +++ b/tests/unit/jtty/test_jtty_payload_correlators.f90 @@ -0,0 +1,107 @@ +program test_jtty_payload_correlators + use, intrinsic :: iso_fortran_env, only: int32, int64, real32, real64 + use jtty_payload_correlators + implicit none + + integer(int32), parameter :: lengths(4) = [120,160,192,240] + type(jtty_payload_correlator) :: correlator + complex(real32), allocatable :: samples(:) + complex(real32) :: whole(0:3,46), halves(0:3,46), expected(0:3,46) + integer :: length_index, nss, offset, segment_count + + do length_index = 1, size(lengths) + nss = lengths(length_index) + allocate(samples(0:7+46*nss-1)) + do offset = 0, size(samples)-1 + samples(offset) = cmplx(real(modulo(offset*17,113)-56,real32)/19.0_real32, & + real(modulo(offset*31,127)-63,real32)/23.0_real32,real32) + end do + call jtty_payload_correlator_prepare(correlator,int(nss,int32)) + call jtty_correlate_payload_symbols(correlator,samples,7_int32,whole,halves) + do segment_count = 1, 2 + call separate_reference(samples,7,nss,segment_count,expected) + if (segment_count == 1) then + call require(identical(whole,expected),'shared M1 differs from separate original-order accumulation') + else + call require(identical(halves,expected),'shared M2 differs from separate half-symbol accumulation') + end if + end do + + samples = cmplx(0.0_real32,0.0_real32,real32) + samples(7:7+nss/2-1) = cmplx(1.0_real32,0.0_real32,real32) + samples(7+nss/2:7+nss-1) = cmplx(-1.0_real32,0.0_real32,real32) + call jtty_correlate_payload_symbols(correlator,samples,7_int32,whole,halves) + call require(abs(whole(0,1)) == 0.0_real32,'opposite halves did not cancel in M1') + call require(abs(real(halves(0,1))-real(nss,real32)/sqrt(2.0_real32)) < 0.0001_real32, & + 'M2 failed to retain opposite-phase half energy') + call require(all(abs(whole(:,2:)) == 0.0_real32) .and. & + all(abs(halves(:,2:)) == 0.0_real32),'payload symbol windows overlap') + + samples = cmplx(1.0_real32,0.0_real32,real32) + call jtty_correlate_payload_symbols(correlator,samples(0:7+2*nss-2),7_int32,whole,halves) + call require(abs(whole(0,1)) == real(nss,real32),'complete payload symbol was lost') + call require(all(abs(whole(:,2:)) == 0.0_real32) .and. & + all(abs(halves(:,2:)) == 0.0_real32),'partial symbol was decoded or left stale data') + call jtty_correlate_payload_symbols(correlator,samples,int(size(samples),int32),whole,halves) + call require(all(abs(whole) == 0.0_real32) .and. all(abs(halves) == 0.0_real32), & + 'out-of-range payload left stale observations') + deallocate(samples) + end do + print *, 'test_jtty_payload_correlators: all checks passed' + +contains + + subroutine separate_reference(samples,start,nss,segments,values) + complex(real32), intent(in) :: samples(0:) + integer, intent(in) :: start,nss,segments + complex(real32), intent(out) :: values(0:3,46) + real(real32) :: reference_real(0:nss-1),reference_imaginary(0:nss-1) + real(real32) :: phase,step,sum_real,sum_imaginary,sample_real,sample_imaginary + real(real64) :: energy + integer :: tone,offset,symbol,segment,first,segment_length + + segment_length = nss/segments + do tone = 0, 3 + phase = 0.0_real32 + step = 6.2831853071795864769_real32*real(tone,real32)/real(nss,real32) + do offset = 0, nss-1 + reference_real(offset) = cos(phase) + reference_imaginary(offset) = sin(phase) + phase = phase + step + end do + do symbol = 1, 46 + first = start + (symbol-1)*nss + energy = 0.0_real64 + do segment = 0, segments-1 + sum_real = 0.0_real32 + sum_imaginary = 0.0_real32 + do offset = segment*segment_length, (segment+1)*segment_length-1 + sample_real = real(samples(first+offset),real32) + sample_imaginary = aimag(samples(first+offset)) + sum_real = sum_real + reference_real(offset)*sample_real + & + reference_imaginary(offset)*sample_imaginary + sum_imaginary = sum_imaginary + reference_real(offset)*sample_imaginary - & + reference_imaginary(offset)*sample_real + end do + energy = energy + real(sum_real*sum_real + sum_imaginary*sum_imaginary,real64) + end do + if (segments == 1) then + values(tone,symbol) = cmplx(sum_real,sum_imaginary,real32) + else + values(tone,symbol) = cmplx(real(sqrt(max(0.0_real64,energy)),real32),0.0_real32,real32) + end if + end do + end do + end subroutine separate_reference + + logical function identical(left,right) + complex(real32), intent(in) :: left(:,:),right(:,:) + identical = all(transfer(left,[0_int64],size(left)) == transfer(right,[0_int64],size(right))) + end function identical + + subroutine require(condition,message) + logical, intent(in) :: condition + character(len=*), intent(in) :: message + if (.not.condition) error stop message + end subroutine require +end program test_jtty_payload_correlators diff --git a/tests/unit/jtty/test_jtty_receive_state.f90 b/tests/unit/jtty/test_jtty_receive_state.f90 new file mode 100644 index 00000000..232679ce --- /dev/null +++ b/tests/unit/jtty/test_jtty_receive_state.f90 @@ -0,0 +1,201 @@ +program test_jtty_receive_state + use iso_fortran_env, only: int64 + use jtty_mdec, only: decode,message_assembly,MAX_ACTIVE_MESSAGES,MAX_RECENT_FRAMES, & + nactive,active_messages, & + nrecent,npending,pending_updates,reset_decode_search_state, & + discard_pending_updates,start_message,append_active_message, & + remove_active_message,is_recent_frame,remember_recent_frame, & + prune_receive_state,classify_active_candidate + implicit none + + real, parameter :: frame_period=2.0 + type(decode) :: candidate,oldest_candidate + type(message_assembly) :: accepted_message,classification_existing + integer(int64) :: first_id,last_id + integer :: i,index,nrecent_before,npending_before,nframes_gap,nmissing + logical :: accepted,match,is_window_dupe + + call reset_all() + + candidate=make_candidate(1500.0,10.0,'FIRST FRAME',.false.) + call start_message(candidate,accepted_message,accepted) + index=nactive + call expect(accepted .and. index.eq.1 .and. nactive.eq.1, & + 'an open message enters the active store') + call expect(npending.eq.1 .and. .not.pending_updates(1)%complete, & + 'an open message publishes its initial state') + call expect(nrecent.eq.1 .and. is_recent_frame(candidate), & + 'an accepted frame enters recent history') + first_id=active_messages(1)%message_id + + candidate=make_candidate(1500.0,12.0,' COMPLETE',.true.) + call append_active_message(1,candidate,1,accepted_message,accepted) + call expect(nactive.eq.0 .and. npending.eq.1, & + 'completion frees active capacity without losing its update') + call expect(pending_updates(1)%message_id.eq.first_id .and. & + pending_updates(1)%complete .and. & + trim(pending_updates(1)%decoded).eq.'FIRST FRAME COMPLETE', & + 'completion coalesces the final state by logical identity') + + call reset_all() + candidate=make_candidate(1500.0,10.0,'BEFORE',.false.) + call start_message(candidate,accepted_message,accepted) + first_id=active_messages(1)%message_id + candidate=make_candidate(1500.0,16.0,'~AFTER',.true.) + call append_active_message(1,candidate,3,accepted_message,accepted) + call expect(accepted .and. nactive.eq.0 .and. npending.eq.1, & + 'a maximum in-range gap completes one logical message') + call expect(pending_updates(1)%message_id.eq.first_id .and. & + pending_updates(1)%complete .and. & + trim(pending_updates(1)%decoded).eq.'BEFORE~~~~~AFTER', & + 'gap assembly inserts one sentinel and strips continuation filler') + + do nmissing=1,3 + classification_existing%f1=1500.0 + classification_existing%tsync=10.0 + candidate=make_candidate(1500.0,10.0+real(nmissing+1)*frame_period, & + 'AFTER',.true.) + call classify_active_candidate(classification_existing,candidate,frame_period, & + match,is_window_dupe,nframes_gap) + if(nmissing.le.2) then + call expect(match .and. .not.is_window_dupe .and. & + nframes_gap.eq.nmissing+1, & + 'classification accepts an in-range missing-frame gap') + else + call expect(.not.match, & + 'classification rejects a gap beyond the merge limit') + endif + enddo + + call reset_decode_search_state() + call expect(nactive.eq.0 .and. nrecent.eq.0 .and. npending.eq.1, & + 'a search reset preserves undelivered updates') + candidate=make_candidate(1510.0,20.0,'AFTER RESET',.true.) + call start_message(candidate,accepted_message,accepted) + call expect(accepted .and. nactive.eq.0 .and. npending.eq.2, & + 'a single-frame completion never occupies active capacity') + call expect(pending_updates(2)%message_id.gt.first_id, & + 'logical identities remain monotonic across search resets') + + call reset_all() + do i=1,MAX_ACTIVE_MESSAGES + candidate=make_candidate(1000.0+real(i),real(i),'OPEN',.false.) + call start_message(candidate,accepted_message,accepted) + call expect(accepted .and. nactive.eq.i, & + 'active messages fill capacity without replacement') + enddo + last_id=active_messages(MAX_ACTIVE_MESSAGES)%message_id + nrecent_before=nrecent + npending_before=npending + candidate=make_candidate(2000.0,100.0,'REFUSED',.false.) + call start_message(candidate,accepted_message,accepted) + call expect(.not.accepted, & + 'a full active store declines a new open message') + call expect(nactive.eq.MAX_ACTIVE_MESSAGES .and. & + nrecent.eq.nrecent_before .and. npending.eq.npending_before, & + 'a declined message leaves every store unchanged') + call remove_active_message(7) + call start_message(candidate,accepted_message,accepted) + index=nactive + call expect(accepted .and. nactive.eq.MAX_ACTIVE_MESSAGES, & + 'freeing one active entry restores capacity') + call expect(active_messages(index)%message_id.eq.last_id+1_int64, & + 'a declined message does not consume a logical identity') + + call reset_all() + candidate=make_candidate(1500.0,10.0,'HISTORY',.true.) + call start_message(candidate,accepted_message,accepted) + call expect(is_recent_frame(candidate), & + 'completion does not remove its frame fingerprint') + call prune_receive_state(11.54,frame_period) + call expect(is_recent_frame(candidate), & + 'history remains until the oldest retro window passes it') + call prune_receive_state(11.56,frame_period) + call expect(.not.is_recent_frame(candidate), & + 'history expires after the rediscovery horizon') + + call reset_all() + candidate=make_candidate(1500.0,10.0,'HISTORY',.true.) + call start_message(candidate,accepted_message,accepted) + candidate=make_candidate(1504.0,10.01,'NEAR SIMULTANEOUS',.true.) + call expect(is_recent_frame(candidate), & + 'recent history rejects a near-simultaneous 4 Hz rediscovery') + candidate=make_candidate(1511.9,10.01,'INSIDE FREQUENCY LIMIT',.true.) + call expect(is_recent_frame(candidate), & + 'recent history catches just inside 12 Hz') + candidate=make_candidate(1512.1,10.01,'OUTSIDE FREQUENCY LIMIT',.true.) + call expect(.not.is_recent_frame(candidate), & + 'recent history allows just outside 12 Hz') + candidate=make_candidate(1505.0,10.049,'INSIDE TIME LIMIT',.true.) + call expect(is_recent_frame(candidate), & + 'recent history catches just inside 0.05 seconds') + candidate=make_candidate(1505.0,10.051,'OUTSIDE TIME LIMIT',.true.) + call expect(.not.is_recent_frame(candidate), & + 'recent history allows just outside 0.05 seconds') + candidate=make_candidate(1500.0,12.0,'ADJACENT MESSAGE',.true.) + call expect(.not.is_recent_frame(candidate), & + 'recent history allows a message one full frame later') + + call reset_all() + do i=1,MAX_RECENT_FRAMES + candidate=make_candidate(1000.0+real(i),real(i),'HISTORY',.true.) + call remember_recent_frame(candidate) + enddo + oldest_candidate=make_candidate(1001.0,1.0,'HISTORY',.true.) + candidate=make_candidate(2500.0,1000.0,'AFTER HISTORY CAPACITY',.true.) + call start_message(candidate,accepted_message,accepted) + call expect(accepted .and. npending.eq.1, & + 'full duplicate history does not block message delivery') + call expect(nrecent.eq.MAX_RECENT_FRAMES .and. is_recent_frame(candidate) .and. & + .not.is_recent_frame(oldest_candidate), & + 'full duplicate history replaces its oldest fingerprint') + + call reset_all() + candidate=make_candidate(1500.0,10.0,'PARTIAL',.false.) + call start_message(candidate,accepted_message,accepted) + index=nactive + active_messages(index)%decoded='PARTIAL GROWN' + active_messages(index)%k=len_trim(active_messages(index)%decoded) + call prune_receive_state(17.59,frame_period) + call expect(nactive.eq.1, & + 'an assembly remains active through its continuation horizon') + call prune_receive_state(17.61,frame_period) + call expect(nactive.eq.0, & + 'an abandoned assembly expires beyond its continuation horizon') + call expect(npending.eq.1 .and. & + trim(pending_updates(1)%decoded).eq.'PARTIAL GROWN' .and. & + .not.pending_updates(1)%complete, & + 'expiration preserves the newest partial state for delivery') + + print *, 'test_jtty_receive_state: all checks passed' + +contains + + function make_candidate(frequency,tsync,text,complete) result(value) + real, intent(in) :: frequency,tsync + character(len=*), intent(in) :: text + logical, intent(in) :: complete + type(decode) :: value + + value%f1=frequency + value%tsync=tsync + value%decoded=text + value%is_last_frame=complete + end function make_candidate + + subroutine reset_all() + call reset_decode_search_state() + call discard_pending_updates() + end subroutine reset_all + + subroutine expect(condition,message) + logical, intent(in) :: condition + character(len=*), intent(in) :: message + + if(.not.condition) then + write(*,'(a)') message + error stop 1 + endif + end subroutine expect + +end program test_jtty_receive_state diff --git a/tests/unit/jtty/test_jtty_replay_ownership.cpp b/tests/unit/jtty/test_jtty_replay_ownership.cpp new file mode 100644 index 00000000..36876033 --- /dev/null +++ b/tests/unit/jtty/test_jtty_replay_ownership.cpp @@ -0,0 +1,107 @@ +#include +#include +#include +#include +#include +#include + +#include "JttyReplay.hpp" + +namespace +{ +constexpr int step = 3456; +} + +class TestJttyReplayOwnership : public QObject +{ + Q_OBJECT + + void verifyReplayBoundWithLiveInput () + { + std::atomic liveFrames {3 * step}; + std::mutex mutex; + std::condition_variable changed; + bool ready = false, released = false, done = false; + bool producerReleased = false, producerReady = false, appendFinished = false; + std::thread writer {[&] { + { + std::unique_lock lock {mutex}; + ready = true; + changed.notify_all (); + producerReleased = changed.wait_for (lock, std::chrono::seconds {5}, + [&] { return released; }); + } + if (producerReleased) + liveFrames.store (4 * step); + { + std::lock_guard lock {mutex}; + done = true; + changed.notify_all (); + } + }}; + { + std::unique_lock lock {mutex}; + producerReady = changed.wait_for (lock, std::chrono::seconds {5}, [&] { return ready; }); + } + QVector visited; + int const replayFrames = liveFrames.load (); + replayJttyFrames (replayFrames, [&] (int k) { + visited.append (k); + if (k == step) + { + std::unique_lock lock {mutex}; + released = true; + changed.notify_all (); + appendFinished = changed.wait_for (lock, std::chrono::seconds {5}, + [&] { return done; }); + } + return false; + }); + writer.join (); + QVERIFY (producerReady); + QVERIFY (producerReleased); + QCOMPARE (liveFrames.load (), 4 * step); + QVERIFY (appendFinished); + // Manual replay is a finite request over its starting receive range; + // audio arriving during a decode belongs to subsequent processing. + QCOMPARE (visited, QVector ({step, 2 * step})); + } + +private Q_SLOTS: + void fixed_range_data () + { + QTest::addColumn ("frames"); + QTest::addColumn> ("expected"); + QTest::newRow ("empty") << 0 << QVector {}; + QTest::newRow ("short") << step - 1 << QVector {}; + QTest::newRow ("boundary") << step << QVector {}; + QTest::newRow ("past-boundary") << step + 1 << QVector {step}; + QTest::newRow ("multiple") << 3 * step << QVector {step, 2 * step}; + } + + void fixed_range () + { + QFETCH (int, frames); + QFETCH (QVector, expected); + QVector visited; + replayJttyFrames (frames, [&] (int k) { visited.append (k); return false; }); + QCOMPARE (visited, expected); + } + + void picked_stop_processed_once () + { + int frames = 8 * step; + int stop = 5000; + QVector visited; + replayJttyFrames (frames, [&] (int k) { + visited.append (k); + return k >= stop; + }); + QCOMPARE (visited, QVector ({step, 2 * step})); + } + + void replay_is_bounded_at_start () { verifyReplayBoundWithLiveInput (); } +}; + +QTEST_GUILESS_MAIN (TestJttyReplayOwnership) +#include "test_jtty_replay_ownership.moc" diff --git a/tests/unit/jtty/test_jtty_source_codec.f90 b/tests/unit/jtty/test_jtty_source_codec.f90 new file mode 100644 index 00000000..dead01d8 --- /dev/null +++ b/tests/unit/jtty/test_jtty_source_codec.f90 @@ -0,0 +1,202 @@ +program test_jtty_source_codec + use jtty_mod + implicit none + type(jtty_source_atom) :: atom,decoded,atoms(2) + character(len=34) :: frame,frames(MAX_FRAMES) + character(len=80) :: text + logical :: valid,eom + integer :: i,nframes + character(len=34), parameter :: CALL_VECTORS(0:5)=[character(len=34) :: & + '0000100110111101111000110101000001','0000100110111101111000110101010001', & + '0000100110111101111000110101100001','0000100110111101111000110101110001', & + '0000100110111101111000110101000101','0000100110111101111000110101010101'] + character(len=34), parameter :: NUM_VECTORS(0:7)=[character(len=34) :: & + '1000000000000000000001000000001001','1000100000000000000001000000001001', & + '1001000000000000000001000000001001','1001100000000000000001000000001001', & + '1010000000000000000001000000001001','1010100000000000000001000000001001', & + '1011000000000000000001000000001001','1011100000000000000001000000001001'] + character(len=34), parameter :: LOC_VECTORS(0:4)=[character(len=34) :: & + '1000000000000110111010000000011001','1000100000000110111010000000011001', & + '1001000000000110111010000000011001','1001100000000110111010000000011001', & + '1010000000000110111010000000011001'] + character(len=34), parameter :: CONTROL_VECTORS(0:17)=[character(len=34) :: & + '0000000000000000000000000001001001','0000000000100000000000000001001001', & + '0000000001000000000000000001001001','0000000001100000000000000001001001', & + '0000000010000000000000000001001001','0000000010100000000000000001001001', & + '0000000011000000000000000001001001','0000000011100000000000000001001001', & + '0000000100000000000000000001001001','0000000100100000000000000001001001', & + '0000000101000000000000000001001001','0000000101100000000000000001001001', & + '0000000110000000000000000001001001','0000000110100000000000000001001001', & + '0000000111000000000000000001001001','0000000111100000000000000001001001', & + '0000001000000000000000000001001001','0000001000100000000000000001001001'] + + do i=0,5 + call expect_vector(jtty_call_atom(i,'K1ABC'),CALL_VECTORS(i)) + enddo + do i=0,7 + call expect_vector(jtty_exch_num_atom(JTTY_ROLE_FULL,i,1),NUM_VECTORS(i)) + enddo + do i=0,4 + call expect_vector(jtty_exch_loc_atom(JTTY_ROLE_FULL,i,'CA'),LOC_VECTORS(i)) + enddo + call expect_vector(jtty_zone_loc_atom(5,'NWT'), & + '0000001011011110010000110100101001') + call expect_vector(jtty_class_section_atom(1,'D',11), & + '0010000010110001011000000000101001') + call expect_vector(jtty_exch_num_time_atom(JTTY_ROLE_FULL,156,17*60+49), & + '1000000100111001000010110100111001') + call expect_vector(jtty_control_atom(JTTY_CONTROL_AGN), & + '0000000000000000000000000001001001') + call expect_vector(jtty_grid4_atom(JTTY_ROLE_FIELD_ONLY,'FN42'), & + '0001001010000110011000000001001001') + call expect_vector(jtty_text5_atom('HELLO'), & + '0100010011100101010101010110001101') + + do i=0,17 + atom=jtty_control_atom(i) + call expect_vector(atom,CONTROL_VECTORS(i)) + call round_trip(atom,text) + if(trim(text).ne.trim(CONTROL_TEXT(i))) error stop 'control rendering mismatch' + enddo + + atoms(1)=jtty_call_atom(JTTY_CALL_CALL,'K1ABC') + atoms(2)=jtty_exch_num_atom(JTTY_ROLE_FULL,JTTY_NUM_SERIAL,7) + call pack_jtty_atoms(atoms,2,frames,nframes,valid) + if(.not.valid .or. nframes.ne.2) error stop 'atom sequence rejected' + if(frames(1)(33:34).ne.'00' .or. frames(2)(33:34).ne.'01') error stop 'EOM mismatch' + + atom=jtty_exch_loc_atom(JTTY_ROLE_FULL,JTTY_LOC_QTH,'0CA') + call expect_rejected(atom,'noncanonical base36') + call expect_rejected(jtty_exch_loc_atom(1,0,'A-'),'invalid base36 digit') + call expect_rejected(jtty_exch_num_atom(1,JTTY_NUM_CQ_ZONE,0),'CQ zone minimum') + call expect_rejected(jtty_exch_num_atom(1,JTTY_NUM_CQ_ZONE,41),'CQ zone maximum') + call expect_rejected(jtty_exch_num_atom(1,JTTY_NUM_ITU_ZONE,0),'ITU zone minimum') + call expect_rejected(jtty_exch_num_atom(1,JTTY_NUM_ITU_ZONE,91),'ITU zone maximum') + call expect_rejected(jtty_exch_num_atom(1,JTTY_NUM_LICENSE_YEAR,10000),'license year') + call expect_rejected(jtty_exch_num_time_atom(1,16384,0),'time serial') + call expect_rejected(jtty_exch_num_time_atom(1,0,1440),'minute') + call expect_rejected(jtty_zone_loc_atom(0,'CA'),'pair zone') + call expect_rejected(jtty_class_section_atom(0,'A',1),'transmitter count') + call expect_rejected(jtty_class_section_atom(33,'A',1),'transmitter count') + call expect_rejected(jtty_class_section_atom(1,'G',1),'class') + call expect_rejected(jtty_class_section_atom(1,'A',0),'section') + call expect_rejected(jtty_class_section_atom(1,'A',87),'section') + call expect_rejected(jtty_grid4_atom(1,'SA00'),'grid field') + call expect_rejected(jtty_grid4_atom(1,'AA0A'),'grid digit') + call expect_rejected(jtty_call_atom(JTTY_CALL_CALL,'BAD'),'malformed call') + + call expect_legal(jtty_exch_num_atom(1,JTTY_NUM_SERIAL,0)) + call expect_legal(jtty_exch_num_atom(1,JTTY_NUM_SERIAL,131071)) + call expect_legal(jtty_exch_num_atom(1,JTTY_NUM_CQ_ZONE,1)) + call expect_legal(jtty_exch_num_atom(1,JTTY_NUM_CQ_ZONE,40)) + call expect_legal(jtty_exch_num_atom(1,JTTY_NUM_ITU_ZONE,1)) + call expect_legal(jtty_exch_num_atom(1,JTTY_NUM_ITU_ZONE,90)) + call expect_legal(jtty_exch_num_atom(1,JTTY_NUM_LICENSE_YEAR,9999)) + call expect_legal(jtty_exch_loc_atom(1,0,'00')) + call expect_legal(jtty_exch_loc_atom(1,0,'100')) + call expect_legal(jtty_exch_num_time_atom(1,0,0)) + call expect_legal(jtty_exch_num_time_atom(1,16383,1439)) + call expect_legal(jtty_class_section_atom(1,'A',1)) + call expect_legal(jtty_class_section_atom(32,'F',86)) + call expect_legal(jtty_grid4_atom(1,'AA00')) + call expect_legal(jtty_grid4_atom(1,'RR99')) + + call expect_render(jtty_exch_num_atom(1,JTTY_NUM_SERIAL,999),'599 999') + call expect_render(jtty_exch_num_atom(1,JTTY_NUM_SERIAL,1000),'599 1000') + call expect_render(jtty_exch_num_atom(1,JTTY_NUM_SERIAL,131071),'599 131071') + call expect_render(jtty_exch_num_atom(0,JTTY_NUM_CHECK,7),'07') + call expect_render(jtty_exch_num_atom(0,JTTY_NUM_CHECK,100),'100') + call expect_render(jtty_exch_num_time_atom(1,16383,1439),'599 16383 2359') + + frame=repeat('0',34) + call unpack_jtty_atom(frame,decoded,valid,eom) + if(valid .or. eom) error stop 'all-zero sentinel accepted' + atom=jtty_control_atom(0); call pack_jtty_atom(atom,frame,.true.,valid) + frame(33:33)='1'; call unpack_jtty_atom(frame,decoded,valid,eom) + if(valid .or. eom) error stop 'reserved bit 33 accepted' + atom=jtty_exch_num_atom(JTTY_ROLE_FULL,JTTY_NUM_SERIAL,1) + call pack_jtty_atom(atom,frame,.true.,valid) + frame(27:27)='1'; call unpack_jtty_atom(frame,decoded,valid,eom) + if(valid .or. eom) error stop 'reserved STRUCT30 field accepted' + atom=jtty_control_atom(0); call pack_jtty_atom(atom,frame,.true.,valid) + frame(28:30)='101'; call expect_invalid_frame(frame,'reserved family') + atom=jtty_control_atom(0); call pack_jtty_atom(atom,frame,.true.,valid) + frame(1:4)='0010'; call expect_invalid_frame(frame,'reserved MISC subtype') + atom=jtty_zone_loc_atom(1,'CA'); call pack_jtty_atom(atom,frame,.true.,valid) + frame(1:3)='010'; call expect_invalid_frame(frame,'reserved pair schema') + + write(*,'(a)') 'test_jtty_source_codec: all checks passed' + +contains + subroutine expect_vector(source,want) + type(jtty_source_atom), intent(in) :: source + character(len=34), intent(in) :: want + type(jtty_source_atom) :: result + character(len=34) :: got + logical :: ok,last + call pack_jtty_atom(source,got,.true.,ok) + if(.not.ok .or. got.ne.want) then + write(*,'(a,/,a,/,a)') 'golden vector mismatch',want,got + error stop 1 + endif + call unpack_jtty_atom(got,result,ok,last) + if(.not.ok .or. .not.last) error stop 'golden vector did not unpack' + end subroutine expect_vector + + subroutine round_trip(source,rendered) + type(jtty_source_atom), intent(in) :: source + character(len=80), intent(out) :: rendered + type(jtty_source_atom) :: result + character(len=34) :: got + logical :: ok,last + call pack_jtty_atom(source,got,.true.,ok) + if(.not.ok) error stop 'round-trip pack failed' + call unpack_jtty_atom(got,result,ok,last) + if(.not.ok) error stop 'round-trip unpack failed' + call render_jtty_atom(result,rendered,ok) + if(.not.ok) error stop 'round-trip render failed' + end subroutine round_trip + + subroutine expect_legal(source) + type(jtty_source_atom), intent(in) :: source + character(len=34) :: got + logical :: ok + call pack_jtty_atom(source,got,.true.,ok) + if(.not.ok) error stop 'legal boundary rejected' + end subroutine expect_legal + + subroutine expect_render(source,want) + type(jtty_source_atom), intent(in) :: source + character(len=*), intent(in) :: want + character(len=80) :: got + call round_trip(source,got) + if(trim(got).ne.want) then + write(*,'(a,/,a,/,a)') 'canonical rendering mismatch',want,trim(got) + error stop 1 + endif + end subroutine expect_render + + subroutine expect_rejected(source,label) + type(jtty_source_atom), intent(in) :: source + character(len=*), intent(in) :: label + character(len=34) :: got + logical :: ok + call pack_jtty_atom(source,got,.true.,ok) + if(ok) then + write(*,'(a,a)') 'invalid atom accepted: ',label + error stop 1 + endif + end subroutine expect_rejected + + subroutine expect_invalid_frame(got,label) + character(len=34), intent(in) :: got + character(len=*), intent(in) :: label + type(jtty_source_atom) :: result + logical :: ok,last + call unpack_jtty_atom(got,result,ok,last) + if(ok .or. last) then + write(*,'(a,a)') 'invalid frame accepted or completed EOM: ',label + error stop 1 + endif + end subroutine expect_invalid_frame +end program test_jtty_source_codec diff --git a/tests/unit/jtty/test_jtty_sticky_retry.f90 b/tests/unit/jtty/test_jtty_sticky_retry.f90 new file mode 100644 index 00000000..719b1ecf --- /dev/null +++ b/tests/unit/jtty/test_jtty_sticky_retry.f90 @@ -0,0 +1,155 @@ +program test_jtty_sticky_retry + + ! decode_and_merge's sticky-sync retry rescues a continuation frame whose + ! own sync symbols are too degraded for the blind search to find, by + ! redecoding directly at the position remembered from the slot it + ! continues -- bypassing the blind search's sync-quality gate entirely. + ! Two bugs in that retry (found in PR #337 review by David Christle, + ! fixed in 48b9e6d74) meant it could silently fail or read the wrong + ! frequency's data. Reproducing the real stochastic conditions that + ! trigger it (weak SNR, fading) isn't reliable for a regression test, so + ! this instead forces it deterministically: frame 2's 13 sync tones are + ! shifted by 2 (mod 4), guaranteeing zero matches against the true sync + ! pattern -- so the blind search's nsync<=6 gate rejects it outright, + ! regardless of what the coarse candidate search finds -- while frame + ! 2's 46 payload tones are left untouched. If the retry works, it merges + ! anyway; if not, frame 2's contribution is silently missing. A second, + ! in-band signal is superimposed so the shared c1 work array actually + ! gets shifted away from the target's own frequency before the retry + ! runs -- see the comment at its construction below for why. + + use iso_fortran_env, only: int16 + use jtty_fec, only: is13, TOTAL_K + use jtty_mdec, only: npending,pending_updates,discard_pending_updates + use jtty_mod, only: MAX_FRAMES + implicit none + + integer :: failures + + failures=0 + call run_case('WB9XYZ 599 0123',3,failures) + + if(failures.ne.0) then + write(*,'(a,i0)') 'test_jtty_sticky_retry: failures=',failures + stop 1 + endif + write(*,'(a)') 'test_jtty_sticky_retry: all checks passed' + +contains + + subroutine run_case(message,nframes,count) + character(len=*), intent(in) :: message + integer, intent(in) :: nframes + integer, intent(inout) :: count + integer, parameter :: nsps=384 + integer, parameter :: frame_symbols=size(is13)+TOTAL_K + integer :: tones(MAX_FRAMES*frame_symbols) + integer :: qrm_tones(frame_symbols) + integer :: nsym,qrm_nsym,nsamples,total_samples,ib,i0 + integer(int16), allocatable :: pcm(:) + real, allocatable :: wave(:),qrm_wave(:),combined(:) + complex, allocatable :: complex_wave(:) + character(len=80) :: input,qrm_input + + call discard_pending_updates() + input=message + call genjtty(input,tones,nsym) + call expect(nsym.eq.nframes*frame_symbols, & + 'the message has the expected frame count',count) + + ! Frame 2's sync tones start right after frame 1's 59 symbols. + ib=frame_symbols+1 + tones(ib:ib+size(is13)-1)=mod(is13+2,4) + + ! rjtty_sub only processes a window once nchunk (1.25 frame periods) + ! more data is available past its start; without a trailing pad past + ! the message's own end, the internal quarter-step sweep runs out of + ! data before ever reaching the window that would check frame 2's + ! continuation, blind or sticky-retry alike (matches the same padding + ! test_jtty_adjacent_decode.f90 uses for the same reason). + nsamples=nsym*nsps + total_samples=nsamples+frame_symbols*nsps + allocate(wave(nsamples),complex_wave(total_samples),combined(total_samples)) + allocate(pcm(total_samples)) + call gen_jttywave(tones,nsym,nsps,2.0,12000.0,1500.0, & + complex_wave,wave,0,nsamples) + combined=0. + combined(1:nsamples)=wave + + ! twkfreq unconditionally re-shifts the shared c1 work array for + ! every candidate the blind search tries this call, whether or not + ! it decodes -- so by the time the sticky retry runs, c1 reflects + ! whichever candidate was tried last, not necessarily the target's + ! own frequency. A single clean signal with no competing candidate + ! doesn't exercise that (verified: reverting 48b9e6d74 didn't fail + ! this test until the interferer below was added) -- an in-band + ! interferer (within ftol=50 Hz of f0=1500, so channel 0's own + ! search sees it) gives c1 something else to be shifted to. Tiled + ! from one short message repeated across the buffer, at lower + ! amplitude so it can't preempt the target's own frame 1 decode. + qrm_input='N2PPI' + call genjtty(qrm_input,qrm_tones,qrm_nsym) + allocate(qrm_wave(qrm_nsym*nsps)) + call gen_jttywave(qrm_tones,qrm_nsym,nsps,2.0,12000.0,1540.0, & + complex_wave(1:qrm_nsym*nsps),qrm_wave,0,qrm_nsym*nsps) + i0=1 + do while(i0.le.total_samples) + ib=min(total_samples,i0+qrm_nsym*nsps-1) + combined(i0:ib)=combined(i0:ib)+0.3*qrm_wave(1:ib-i0+1) + i0=i0+qrm_nsym*nsps + enddo + + pcm=int(nint(30000.0*combined),int16) + + ! nfb=1499 (not the usual Wide Graph range) keeps channels 1 and 2 -- + ! whose hardwired bands, [1200,1500] and [1500,1800], meet exactly at + ! the target's own f0 -- from independently retrying the same slot + ! themselves and masking a channel-0-specific failure: the target's + ! own estimated frequency lands a couple of Hz above 1500, just + ! inside channel 2's band too, so without this its own sticky retry + ! can coincidentally rescue the frame channel 0's retry failed to. + call rjtty_sub(pcm,1,nsps,200,1499,1500.0,50.0) + call rjtty_sub(pcm,total_samples,nsps,200,1499,1500.0,50.0) + + call expect(npending.eq.2,'the decoder keeps the target and interferer', & + count) + call expect(found_complete(message), & + 'the full message decodes despite the corrupted sync',count) + + deallocate(pcm,wave,complex_wave,combined,qrm_wave) + end subroutine run_case + + logical function found_complete(message) + character(len=*), intent(in) :: message + integer :: i + + found_complete=.false. + do i=1,npending + if(trim(normalized(pending_updates(i)%decoded)).eq.trim(message) .and. & + pending_updates(i)%complete) found_complete=.true. + enddo + end function found_complete + + function normalized(value) result(result_value) + character(len=*), intent(in) :: value + character(len=80) :: result_value + integer :: i + + result_value=adjustl(value) + do i=1,len_trim(result_value) + if(result_value(i:i).eq.'~') result_value(i:i)=' ' + enddo + end function normalized + + subroutine expect(condition,description,count) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + integer, intent(inout) :: count + + if(.not.condition) then + count=count+1 + write(*,'(a)') 'FAIL: '//description + endif + end subroutine expect + +end program test_jtty_sticky_retry diff --git a/tests/unit/jtty/test_jtty_structured_decode.f90 b/tests/unit/jtty/test_jtty_structured_decode.f90 new file mode 100644 index 00000000..e74b9c2a --- /dev/null +++ b/tests/unit/jtty/test_jtty_structured_decode.f90 @@ -0,0 +1,330 @@ +program test_jtty_structured_decode + + use iso_c_binding, only: c_int,c_char,c_null_char,c_sizeof + use iso_fortran_env, only: int16,int32 + use jtty_fec, only: is13,PAYLOAD_BITS,TOTAL_K,tbcc_encode + use jtty_tbcc_code_profiles + use jtty_mdec, only: npending,pending_updates,nactive,discard_pending_updates,display_message_text + use jtty_mod, only: jtty_source_atom,jtty_source_atom_c,jtty_call_atom, & + jtty_exch_num_atom,unpack_jtty,MAX_FRAMES,JTTY_CALL_CALL,JTTY_ROLE_FULL, & + JTTY_NUM_SERIAL,JTTY_ATOM_CALL,JTTY_ATOM_EXCH_NUM,JTTY_ATOM_EXCH_LOC, & + JTTY_ATOM_EXCH_PAIR, & + JTTY_ATOM_CONTROL,JTTY_ATOM_GRID4,JTTY_LOC_STATE_PROVINCE, & + JTTY_PAIR_CLASS_SECTION,JTTY_CONTROL_QSL_TU,JTTY_ROLE_FIELD_ONLY, & + JTTY_ENCODE_OK,JTTY_ENCODE_INVALID_DESCRIPTOR, & + JTTY_ENCODE_UNKNOWN_SECTION + implicit none + + integer, parameter :: nsps=384 + integer, parameter :: frame_symbols=size(is13)+TOTAL_K + integer :: failures + + interface + function jtty_cpp_n1mm_smoke(tones,nsym) result(status) bind(C) + import :: c_int + integer(c_int), intent(out) :: tones(*),nsym + integer(c_int) :: status + end function jtty_cpp_n1mm_smoke + function jtty_cpp_cq_smoke(tones,nsym,text,chained) result(status) bind(C) + import :: c_int,c_char + integer(c_int), intent(out) :: tones(*),nsym + character(kind=c_char), intent(out) :: text(*) + integer(c_int), value :: chained + integer(c_int) :: status + end function jtty_cpp_cq_smoke + function jtty_cpp_rtty_smoke(tones,nsym) result(status) bind(C) + import :: c_int + integer(c_int), intent(out) :: tones(*),nsym + integer(c_int) :: status + end function jtty_cpp_rtty_smoke + subroutine genjtty_atoms(atoms,natoms,itone,nsym) + use jtty_mod, only: jtty_source_atom + type(jtty_source_atom), intent(in) :: atoms(:) + integer, intent(in) :: natoms + integer, intent(out) :: itone(*) + integer, intent(out) :: nsym + end subroutine genjtty_atoms + subroutine genjtty_atoms_c(atoms,natoms,itone,nsym,status) bind(C,name='genjtty_atoms_c') + import :: c_int,jtty_source_atom_c + type(jtty_source_atom_c), intent(in) :: atoms(*) + integer(c_int), value, intent(in) :: natoms + integer(c_int), intent(out) :: itone(*) + integer(c_int), intent(out) :: nsym + integer(c_int), intent(out) :: status + end subroutine genjtty_atoms_c + end interface + + failures=0 + call reject_reserved_struct_family(failures) + call decode_native_call_and_serial(failures) + call decode_c_adapter_atoms(failures) + call reject_invalid_c_descriptors(failures) + call decode_cpp_compiled_n1mm(failures) + call decode_compact_text(failures) + call decode_profile_text(failures) + + if(failures.ne.0) then + write(*,'(a,i0)') 'test_jtty_structured_decode: failures=',failures + stop 1 + endif + write(*,'(a)') 'test_jtty_structured_decode: all checks passed' + +contains + + subroutine decode_profile_text(count) + integer, intent(inout) :: count + integer(c_int) :: tones(MAX_FRAMES*frame_symbols),nsymbols,status + + status=jtty_cpp_rtty_smoke(tones,nsymbols) + call expect(status.eq.JTTY_ENCODE_OK .and. nsymbols.eq.frame_symbols, & + 'C++ RTTY profile text matches native F8 while unknown text uses two frames',count) + if(status.ne.JTTY_ENCODE_OK .or. nsymbols.ne.frame_symbols) return + call decode_waveform(tones,int(nsymbols)) + call expect(npending.eq.1,'RTTY serial text produces one update',count) + if(npending.eq.1) then + call expect(trim(normalized(pending_updates(1)%decoded)).eq.'599 123' .and. & + pending_updates(1)%complete .and. nactive.eq.0, & + 'RTTY serial text uses canonical rendering and completes',count) + endif + end subroutine decode_profile_text + + subroutine decode_compact_text(count) + integer, intent(inout) :: count + integer(c_int) :: native_tones(MAX_FRAMES*frame_symbols),native_nsymbols,status + character(kind=c_char) :: c_text(80) + character(len=80) :: text + integer :: tones(MAX_FRAMES*frame_symbols),nsymbols,chained,i + + do chained=0,1 + status=jtty_cpp_cq_smoke(native_tones,native_nsymbols,c_text,int(chained,c_int)) + call expect(status.eq.JTTY_ENCODE_OK .and. native_nsymbols.eq.frame_symbols, & + 'native F1 generates one frame',count) + if(status.ne.JTTY_ENCODE_OK .or. native_nsymbols.ne.frame_symbols) return + do i=1,len(text) + text(i:i)=c_text(i) + enddo + call genjtty(text,tones,nsymbols) + call expect(nsymbols.eq.native_nsymbols,'GUI CQ text generates one frame',count) + if(nsymbols.ne.native_nsymbols) return + call expect(all(tones(1:nsymbols).eq.native_tones(1:nsymbols)), & + 'GUI CQ text and native F1 generate identical channel symbols',count) + enddo + call decode_waveform(tones,nsymbols) + call expect(npending.eq.1,'compact CQ produces one update',count) + if(npending.eq.1) then + call expect(trim(normalized(pending_updates(1)%decoded)).eq.'CQ K1ABC CQ' .and. & + pending_updates(1)%complete .and. nactive.eq.0, & + 'compact CQ preserves text and completes',count) + endif + + text='TEST WB9XYZ 599 123 QSL TU' + call genjtty(text,tones,nsymbols) + call expect(nsymbols.eq.4*frame_symbols,'mixed text generates four frames',count) + if(nsymbols.ne.4*frame_symbols) return + call decode_waveform(tones,nsymbols,10.0) + call expect(npending.eq.1,'mixed text produces one update on the transmitted channel',count) + if(npending.eq.1) then + call expect(trim(normalized(pending_updates(1)%decoded)).eq.trim(text) .and. & + pending_updates(1)%complete .and. nactive.eq.0, & + 'mixed TEXT5/call/exchange/control preserves spacing and EOM',count) + endif + end subroutine decode_compact_text + + subroutine decode_cpp_compiled_n1mm(count) + integer, intent(inout) :: count + integer(c_int) :: tones(MAX_FRAMES*frame_symbols),nsymbols,status + + status=jtty_cpp_n1mm_smoke(tones,nsymbols) + call expect(status.eq.JTTY_ENCODE_OK .and. nsymbols.eq.2*frame_symbols, & + 'C++ compiled descriptors cross the native encoder ABI',count) + if(status.ne.JTTY_ENCODE_OK .or. nsymbols.ne.2*frame_symbols) return + call decode_waveform(tones,int(nsymbols)) + call expect(npending.eq.1,'C++ compiled N1MM message produces one update',count) + if(npending.ne.1) return + call expect(trim(normalized(pending_updates(1)%decoded)).eq.'W9XYZ 32D EMA' .and. & + pending_updates(1)%complete .and. nactive.eq.0, & + 'C++ call/exchange descriptors preserve canonical text and EOM',count) + end subroutine decode_cpp_compiled_n1mm + + subroutine decode_native_call_and_serial(count) + integer, intent(inout) :: count + type(jtty_source_atom) :: atoms(2) + integer :: tones(MAX_FRAMES*frame_symbols),nsymbols + + atoms(1)=jtty_call_atom(JTTY_CALL_CALL,'WB9XYZ') + atoms(2)=jtty_exch_num_atom(JTTY_ROLE_FULL,JTTY_NUM_SERIAL,1234) + call genjtty_atoms(atoms,size(atoms),tones,nsymbols) + + call expect(nsymbols.eq.size(atoms)*frame_symbols, & + 'native call plus serial generates two frames',count) + if(nsymbols.le.0) return + + call decode_waveform(tones,nsymbols) + + call expect(npending.eq.1, & + 'native call plus serial produces one update',count) + if(npending.ne.1) return + call expect(trim(normalized(pending_updates(1)%decoded)).eq.'WB9XYZ 599 1234', & + 'merged native atoms use canonical call and serial rendering',count) + call expect(pending_updates(1)%complete .and. nactive.eq.0, & + 'final native atom completes and releases the message',count) + end subroutine decode_native_call_and_serial + + subroutine decode_c_adapter_atoms(count) + integer, intent(inout) :: count + type(jtty_source_atom_c) :: atoms(6) + integer(c_int) :: tones(MAX_FRAMES*frame_symbols),nsymbols,status + + call expect(c_sizeof(atoms(1)).eq.20,'C atom descriptor remains 20 bytes',count) + call initialize_c_atom(atoms(1),JTTY_ATOM_CALL,JTTY_CALL_CALL,0,0,'K1ABC') + call initialize_c_atom(atoms(2),JTTY_ATOM_EXCH_NUM,JTTY_NUM_SERIAL, & + JTTY_ROLE_FULL,12,'') + call initialize_c_atom(atoms(3),JTTY_ATOM_EXCH_LOC,JTTY_LOC_STATE_PROVINCE, & + JTTY_ROLE_FULL,0,'CA') + call initialize_c_atom(atoms(4),JTTY_ATOM_EXCH_PAIR,JTTY_PAIR_CLASS_SECTION, & + 3,1,'EMA') + call initialize_c_atom(atoms(5),JTTY_ATOM_GRID4,0,JTTY_ROLE_FIELD_ONLY,0,'FN42') + call initialize_c_atom(atoms(6),JTTY_ATOM_CONTROL,JTTY_CONTROL_QSL_TU,0,0,'') + call genjtty_atoms_c(atoms,size(atoms),tones,nsymbols,status) + call expect(nsymbols.eq.size(atoms)*frame_symbols, & + 'C adapter generates serial/state/FD/grid/control frames',count) + call expect(status.eq.JTTY_ENCODE_OK,'C adapter reports successful encoding',count) + if(nsymbols.le.0) return + + call decode_waveform(tones,int(nsymbols)) + call expect(npending.eq.1,'C adapter atoms produce one update',count) + if(npending.ne.1) return + call expect(trim(normalized(pending_updates(1)%decoded)).eq. & + 'K1ABC 599 012 599 CA 1D EMA FN42 QSL TU', & + 'C adapter atoms retain canonical structured rendering',count) + call expect(pending_updates(1)%complete .and. nactive.eq.0, & + 'final C adapter atom completes and releases the message',count) + end subroutine decode_c_adapter_atoms + + subroutine reject_invalid_c_descriptors(count) + integer, intent(inout) :: count + type(jtty_source_atom_c) :: atom(1) + integer(c_int) :: tones(frame_symbols),nsymbols,status + + call initialize_c_atom(atom(1),JTTY_ATOM_EXCH_LOC,JTTY_LOC_STATE_PROVINCE,1,0,'CA') + atom(1)%reserved=1 + call genjtty_atoms_c(atom,1,tones,nsymbols,status) + call expect(nsymbols.eq.0,'C adapter rejects nonzero reserved byte',count) + call expect(status.eq.JTTY_ENCODE_INVALID_DESCRIPTOR, & + 'C adapter identifies invalid descriptor',count) + + call initialize_c_atom(atom(1),JTTY_ATOM_CALL,JTTY_CALL_CALL,0,0,'K1ABC') + atom(1)%text='A' + call genjtty_atoms_c(atom,1,tones,nsymbols,status) + call expect(nsymbols.eq.0,'C adapter rejects unterminated text',count) + + call initialize_c_atom(atom(1),JTTY_ATOM_EXCH_PAIR,JTTY_PAIR_CLASS_SECTION,0,1,'ZZZ') + call genjtty_atoms_c(atom,1,tones,nsymbols,status) + call expect(nsymbols.eq.0,'C adapter rejects unknown Field Day section',count) + call expect(status.eq.JTTY_ENCODE_UNKNOWN_SECTION, & + 'C adapter identifies unknown Field Day section',count) + + call initialize_c_atom(atom(1),JTTY_ATOM_EXCH_PAIR,0,0,1,'EMA') + call genjtty_atoms_c(atom,1,tones,nsymbols,status) + call expect(nsymbols.eq.0,'C adapter rejects non-CLASS_SECTION pair schema',count) + + call initialize_c_atom(atom(1),JTTY_ATOM_GRID4,0,0,0,'SA00') + call genjtty_atoms_c(atom,1,tones,nsymbols,status) + call expect(nsymbols.eq.0,'C adapter rejects invalid GRID4',count) + + call initialize_c_atom(atom(1),JTTY_ATOM_CONTROL,18,0,0,'') + call genjtty_atoms_c(atom,1,tones,nsymbols,status) + call expect(nsymbols.eq.0,'C adapter rejects unassigned control phrase',count) + end subroutine reject_invalid_c_descriptors + + subroutine initialize_c_atom(atom,kind,subtype,role,value,text) + type(jtty_source_atom_c), intent(out) :: atom + integer, intent(in) :: kind,subtype,role,value + character(len=*), intent(in) :: text + integer :: i,n + + atom%kind=kind; atom%subtype=subtype; atom%role=role; atom%reserved=0 + atom%value=value; atom%text=c_null_char + n=min(8,len_trim(text)) + do i=1,n + atom%text(i)=text(i:i) + enddo + end subroutine initialize_c_atom + + subroutine reject_reserved_struct_family(count) + integer, intent(inout) :: count + character(len=34) :: frame,frames(MAX_FRAMES) + character(len=80) :: decoded + integer(int32) :: payload(PAYLOAD_BITS),encoded(TOTAL_K) + integer :: tones(frame_symbols) + logical :: source_valid,is_last_frame + + ! With an otherwise-zero STRUCT30 body, n32=22 selects reserved family 101. + write(frame(1:32),'(b32.32)') 22_int32 + frame(33:34)='01' + frames='' + frames(1)=frame + call unpack_jtty(frames,1,decoded,is_last_frame=is_last_frame, & + source_valid=source_valid) + call expect(.not.source_valid, & + 'reserved STRUCT30 family is source-invalid',count) + call expect(.not.is_last_frame, & + 'source-invalid frame cannot report EOM',count) + + read(frame,'(34i1)') payload + call tbcc_encode(payload,encoded,JTTY_TBCC_PROFILE_1167_1545_80F) + tones(1:size(is13))=is13 + tones(size(is13)+1:frame_symbols)=encoded + call decode_waveform(tones,frame_symbols) + call expect(npending.eq.0 .and. nactive.eq.0, & + 'CRC/FEC-valid source-invalid frame creates no message or update',count) + end subroutine reject_reserved_struct_family + + subroutine decode_waveform(tones,nsymbols,channel_width) + integer, intent(in) :: tones(:),nsymbols + real, intent(in), optional :: channel_width + integer :: nsamples,total_samples,nfa,nfb + real :: tolerance + integer(int16), allocatable :: pcm(:) + real, allocatable :: wave(:) + complex, allocatable :: complex_wave(:) + + nsamples=nsymbols*nsps + total_samples=(nsymbols+frame_symbols)*nsps + allocate(wave(nsamples),complex_wave(nsamples),pcm(total_samples)) + call gen_jttywave(tones,nsymbols,nsps,2.0,12000.0,1500.0, & + complex_wave,wave,0,nsamples) + pcm=0_int16 + pcm(1:nsamples)=int(nint(30000.0*wave),int16) + + nfa=200; nfb=2800; tolerance=50.0 + if(present(channel_width)) then + tolerance=channel_width + nfa=ceiling(1500.0-tolerance) + nfb=floor(1500.0+tolerance) + endif + call discard_pending_updates() + call rjtty_sub(pcm,1,nsps,nfa,nfb,1500.0,tolerance) + call rjtty_sub(pcm,total_samples,nsps,nfa,nfb,1500.0,tolerance) + + deallocate(pcm,wave,complex_wave) + end subroutine decode_waveform + + function normalized(value) result(result_value) + character(len=*), intent(in) :: value + character(len=80) :: result_value + result_value=display_message_text(value) + end function normalized + + subroutine expect(condition,description,count) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + integer, intent(inout) :: count + + if(.not.condition) then + count=count+1 + write(*,'(a)') 'FAIL: '//description + endif + end subroutine expect + +end program test_jtty_structured_decode diff --git a/tests/unit/jtty/test_jtty_surface_ranges.f90 b/tests/unit/jtty/test_jtty_surface_ranges.f90 new file mode 100644 index 00000000..97f9b65c --- /dev/null +++ b/tests/unit/jtty/test_jtty_surface_ranges.f90 @@ -0,0 +1,98 @@ +program test_jtty_surface_ranges + use iso_fortran_env, only: int16 + use fftw3, only: fftwf_cleanup + use jtty_fec, only: is13,TOTAL_K + use jtty_mod, only: MAX_FRAMES + use jtty_mdec, only: npending,pending_updates,discard_pending_updates, & + jtty_release_fft_resources + implicit none + integer, parameter :: ncases=8 + integer, parameter :: rates(ncases)=[240,320,384,240,480,480,384,240] + integer, parameter :: scenarios(ncases)=[1,1,1,4,2,1,3,1] + integer :: icase + complex :: fft_scratch(1) + + ! Direct tests own the frequency-window Cartesian product. Keep integration + ! cases for every FFT geometry and each distinct surface-search behavior. + do icase=1,ncases + if(icase.eq.ncases) then + ! Prove that a populated geometry can be recreated after teardown. + call jtty_release_fft_resources() + call four2a(fft_scratch,-1,1,1,1) + call fftwf_cleanup() + endif + call verify_surface_case(rates(icase),scenarios(icase)) + enddo + + call jtty_release_fft_resources() + print *, 'JTTY surface range tests passed' + +contains + + subroutine verify_surface_case(nsps,icase) + integer, parameter :: frame_symbols=size(is13)+TOTAL_K + integer, intent(in) :: nsps,icase + integer :: nsym,nsamples,nlead,total_samples + integer :: tones(MAX_FRAMES*frame_symbols),nfa,nfb + integer(int16), allocatable :: pcm(:) + real, allocatable :: wave(:) + complex, allocatable :: cwave(:) + real :: hz,fc,width + character(len=80) :: message + + call discard_pending_updates() + hz=1500.0 + fc=hz + width=50.0 + nfa=200 + nfb=2800 + select case(icase) + case(2) + ! Auxiliary channels follow graph limits away from their nominal bands. + hz=2700.0 + fc=900.0 + width=3.0 + nfa=2600 + nfb=2750 + case(3) + ! The QSO channel remains usable with an inverted graph range. + hz=400.0 + fc=hz + width=3.0 + nfa=1800 + nfb=1200 + case(4) + ! Narrow, non-bin-aligned limits still need the smoothing halo. + hz=1504.0 + fc=hz + width=0.5 + nfa=1504 + nfb=1505 + end select + + message='N2PPI' + call genjtty(message,tones,nsym) + nsamples=nsym*nsps + nlead=1800 + ! One 1.25-frame chunk contains the lead-in and complete signal. A + ! longer buffer only schedules empty trailing decoder windows. + total_samples=frame_symbols*nsps+(frame_symbols*nsps)/4 + if(nlead+nsamples.gt.total_samples) & + error stop 'surface fixture exceeds one decoder chunk' + allocate(pcm(total_samples),wave(nsamples),cwave(nsamples)) + call gen_jttywave(tones,nsym,nsps,2.0,12000.0,hz,cwave,wave,0,nsamples) + pcm=0_int16 + pcm(nlead+1:nlead+nsamples)=int(nint(14000.0*wave),int16) + call rjtty_sub(pcm,1,nsps,nfa,nfb,fc,width) + call rjtty_sub(pcm,total_samples,nsps,nfa,nfb,fc,width) + if(npending.ne.1) then + print *, 'Unexpected message count',nsps,icase,npending + stop 1 + endif + if(trim(pending_updates(1)%decoded).ne.'N2PPI' .or. & + .not.pending_updates(1)%complete) then + print *, 'Unexpected message',nsps,icase,pending_updates(1)%decoded + stop 1 + endif + end subroutine verify_surface_case +end program diff --git a/tests/unit/jtty/test_jtty_tbcc_code_profile.f90 b/tests/unit/jtty/test_jtty_tbcc_code_profile.f90 new file mode 100644 index 00000000..f49bcf60 --- /dev/null +++ b/tests/unit/jtty/test_jtty_tbcc_code_profile.f90 @@ -0,0 +1,115 @@ +program test_jtty_tbcc_code_profile + use, intrinsic :: iso_fortran_env, only: int32, real32 + use jtty_tbcc_code_profiles + use jtty_tbcc_decoder, only: jtty_tbcc_decode + use jtty_tbcc_list_decoder, only: jtty_tbcc_crc_valid + use jtty_mdec, only: jtty_tbcc_reencode_for_subtraction + use tbcc, only: PAYLOAD_BITS, TOTAL_K, encode_crc12, tbcc_encode, & + tbcc_wava_fsk_decode + implicit none + + integer(int32), parameter :: golden_payload(PAYLOAD_BITS) = [ & + 1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0, & + 1,0,0,1,0,0,1,0,0,1 ] + integer(int32), parameter :: golden_information_bits(TOTAL_K) = [ & + 1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0, & + 1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,1,0 ] + integer(int32), parameter :: golden_encoded_bits(2, TOTAL_K) = reshape([ & + 1,0, 0,0, 0,1, 0,0, 1,0, 1,1, 0,1, 1,1, 0,1, 1,1, & + 0,0, 0,1, 1,1, 0,0, 0,1, 1,1, 0,0, 0,1, 1,1, 0,0, & + 0,1, 1,1, 0,0, 0,1, 1,1, 0,0, 0,1, 1,1, 0,0, 0,1, & + 1,1, 0,0, 0,1, 1,1, 0,0, 0,1, 1,1, 0,0, 0,1, 1,1, & + 0,0, 0,1, 1,1, 0,0, 1,0, 1,0 ], [2, TOTAL_K]) + integer(int32), parameter :: golden_tones(TOTAL_K) = [ & + 3,0,1,0,3,2,1,2,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1, & + 2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,1,2,0,3,3 ] + + call expect_descriptor() + call expect_golden_code() + + print *, 'test_jtty_tbcc_code_profile: all checks passed' + +contains + + subroutine expect_descriptor() + type(jtty_tbcc_code_profile) :: unsupported + + call require(jtty_tbcc_code_profile_is_valid(JTTY_TBCC_PROFILE_1167_1545_80F), & + 'established code descriptor is invalid') + call require(jtty_tbcc_code_profile_is_supported(JTTY_TBCC_PROFILE_1167_1545_80F), & + 'established code descriptor is unsupported') + call require(JTTY_TBCC_PROFILE_1167_1545_80F%memory_nu == 9_int32 .and. & + JTTY_TBCC_PROFILE_1167_1545_80F%state_count == 512_int32, & + 'established code trellis dimensions changed') + call require(JTTY_TBCC_PROFILE_1167_1545_80F%generator_0 == int(o'1167', int32) .and. & + JTTY_TBCC_PROFILE_1167_1545_80F%generator_1 == int(o'1545', int32), & + 'established generator polynomials changed') + call require(JTTY_TBCC_PROFILE_1167_1545_80F%outer_polynomial == int(z'80F', int32), & + 'established outer polynomial changed') + + unsupported = JTTY_TBCC_PROFILE_1167_1545_80F + unsupported%generator_1 = int(o'1547', int32) + call require(jtty_tbcc_code_profile_is_valid(unsupported), & + 'unsupported-code fixture is not structurally valid') + call require(.not.jtty_tbcc_code_profile_is_supported(unsupported), & + 'noncanonical code was reported as supported') + end subroutine expect_descriptor + + subroutine expect_golden_code() + integer(int32) :: encoded_information(2, TOTAL_K), encoded_bits(2, TOTAL_K) + integer(int32) :: invalid_information(TOTAL_K) + integer(int32) :: tones(TOTAL_K), subtraction_tones(TOTAL_K) + integer(int32) :: decoded(PAYLOAD_BITS) + real(real32) :: tone_energies(0:3, TOTAL_K) + complex(real32) :: correlations(0:3, TOTAL_K) + logical :: success + + call encode_crc12(golden_payload, encoded_information, JTTY_TBCC_PROFILE_1167_1545_80F) + call require(all(encoded_information(1, :) == golden_information_bits), & + 'outer-check bits changed from the golden vector') + call require(jtty_tbcc_crc_valid(JTTY_TBCC_PROFILE_1167_1545_80F, & + encoded_information(1, :)), 'golden outer-check word was rejected') + invalid_information = encoded_information(1, :) + invalid_information(TOTAL_K) = 1_int32 - invalid_information(TOTAL_K) + call require(.not.jtty_tbcc_crc_valid(JTTY_TBCC_PROFILE_1167_1545_80F, & + invalid_information), 'outer check accepted a corrupted word') + + call tbcc_encode(golden_payload, tones, JTTY_TBCC_PROFILE_1167_1545_80F, encoded_bits) + call require(all(encoded_bits == golden_encoded_bits), & + 'encoded bits changed from the golden vector') + call require(all(tones == golden_tones), 'tones changed from the golden vector') + + call make_noiseless_observations(tones, tone_energies, correlations) + call tbcc_wava_fsk_decode(tone_energies, 4_int32, 2_int32, decoded, success, & + reserved_zero_bit=33_int32, code_profile=JTTY_TBCC_PROFILE_1167_1545_80F) + call require(success .and. all(decoded == golden_payload), 'WAVA decode failed') + call jtty_tbcc_decode(correlations, correlations, decoded, success) + call require(success .and. all(decoded == golden_payload), 'coherent decode failed') + + call jtty_tbcc_reencode_for_subtraction(golden_payload, subtraction_tones) + call require(all(subtraction_tones == golden_tones), & + 'subtraction re-encoding did not reproduce the established tones') + end subroutine expect_golden_code + + subroutine make_noiseless_observations(tones, tone_energies, correlations) + integer(int32), intent(in) :: tones(TOTAL_K) + real(real32), intent(out) :: tone_energies(0:3, TOTAL_K) + complex(real32), intent(out) :: correlations(0:3, TOTAL_K) + integer(int32) :: symbol + + tone_energies = 0.0_real32 + correlations = cmplx(0.0_real32, 0.0_real32, real32) + do symbol = 1, TOTAL_K + tone_energies(tones(symbol), symbol) = 100.0_real32 + correlations(tones(symbol), symbol) = cmplx(100.0_real32, 0.0_real32, real32) + end do + end subroutine make_noiseless_observations + + subroutine require(condition, message) + logical, intent(in) :: condition + character(len=*), intent(in) :: message + + if (.not.condition) error stop message + end subroutine require + +end program test_jtty_tbcc_code_profile diff --git a/tests/unit/jtty/test_jtty_tbcc_decoder.f90 b/tests/unit/jtty/test_jtty_tbcc_decoder.f90 new file mode 100644 index 00000000..50fb6f63 --- /dev/null +++ b/tests/unit/jtty/test_jtty_tbcc_decoder.f90 @@ -0,0 +1,143 @@ +program test_jtty_tbcc_decoder + use, intrinsic :: iso_fortran_env, only: int32, int64, real32 + use jtty_tbcc_code_profiles, only: JTTY_TBCC_PROFILE_1167_1545_80F + use jtty_tbcc_decoder, only: jtty_tbcc_decode, jtty_tbcc_decode_result + use tbcc, only: PAYLOAD_BITS, TOTAL_K, tbcc_encode + implicit none + + complex(real32) :: correlations(0:3, TOTAL_K), halves(0:3, TOTAL_K) + integer(int32) :: payload(PAYLOAD_BITS), decoded(PAYLOAD_BITS), tones(TOTAL_K) + type(jtty_tbcc_decode_result) :: result + logical :: success + integer(int32) :: bit_index + + do bit_index = 1, PAYLOAD_BITS + payload(bit_index) = modulo(bit_index + bit_index/3, 2) + end do + payload(33) = 0_int32 + halves = cmplx(0.0_real32, 0.0_real32, real32) + call tbcc_encode(payload, tones, JTTY_TBCC_PROFILE_1167_1545_80F) + call make_noiseless_correlations(tones, correlations) + + call jtty_tbcc_decode(correlations, halves, decoded, success, result) + call require(success, 'coherence ladder rejected a noiseless payload') + call require(all(decoded == payload), 'coherence ladder changed the payload') + call require(result%accepted_hypothesis_rank == 1_int32, & + 'noiseless payload was not the first hypothesis') + call require(result%coherent_block_length == 1_int32, & + 'noiseless payload did not stop at one-symbol coherence') + call require(result%evaluated_rung_count == 1_int32, & + 'noiseless payload evaluated unnecessary coherence rungs') + call require(.not.result%used_half_symbol_observation, & + 'rank-one payload unexpectedly evaluated half-symbol fallback') + call require(result%exported_candidate_count <= 4_int32, & + 'coherence ladder exposed more than four hypotheses per rung') + + payload(33) = 1_int32 + call tbcc_encode(payload, tones, JTTY_TBCC_PROFILE_1167_1545_80F) + call make_noiseless_correlations(tones, correlations) + decoded = huge(0_int32) + call jtty_tbcc_decode(correlations, halves, decoded, success, result) + call require(.not.success, 'coherence ladder accepted reserved bit one') + call require(all(decoded == 0_int32), & + 'reserved-bit rejection left a stale payload') + + halves = correlations + correlations = cmplx(0.0_real32, 0.0_real32, real32) + decoded = huge(0_int32) + call jtty_tbcc_decode(correlations, halves, decoded, success, result) + call require(.not.success, 'half-symbol fallback accepted reserved bit one') + call require(all(decoded == 0_int32), & + 'half-symbol reserved-bit rejection left a stale payload') + + payload(33) = 0_int32 + call tbcc_encode(payload, tones, JTTY_TBCC_PROFILE_1167_1545_80F) + call make_noiseless_correlations(tones, halves) + decoded = huge(0_int32) + call jtty_tbcc_decode(correlations, halves, decoded, success, result) + call require(success .and. all(decoded == payload), 'half-symbol fallback failed to rescue payload') + call require(result%used_half_symbol_observation .and. result%coherent_block_length == 1, & + 'half-symbol fallback used the wrong observation or coherence') + call require(result%evaluated_rung_count == 4, 'fallback skipped an M1 rung') + halves = cmplx(0.0_real32, 0.0_real32, real32) + + payload = 0_int32 + call tbcc_encode(payload, tones, JTTY_TBCC_PROFILE_1167_1545_80F) + call make_noiseless_correlations(tones, correlations) + decoded = huge(0_int32) + call jtty_tbcc_decode(correlations, halves, decoded, success, result) + call require(.not.success, 'coherence ladder accepted the all-zero payload') + call require(all(decoded == 0_int32), 'failed ladder decode left stale payload') + call require(result%evaluated_rung_count == 4_int32, & + 'failed decode did not report all evaluated rungs') + + correlations = cmplx(0.0_real32, 0.0_real32, real32) + decoded = huge(0_int32) + call jtty_tbcc_decode(correlations, halves, decoded, success, result) + call require(.not.success, 'coherence ladder accepted flat correlations') + call require(all(decoded == 0_int32), 'flat-correlation decode left stale payload') + call require(result%evaluated_rung_count == 4_int32, & + 'flat-correlation decode did not report all evaluated rungs') + + call expect_coherent_decodes() + + print *, 'test_jtty_tbcc_decoder: all checks passed' + +contains + + subroutine expect_coherent_decodes() + ! Seed 6 verifies that reserved-bit pruning retains the valid L1 path. + integer(int32), parameter :: seeds(2) = [2,6], lengths(2) = [2,1], & + ranks(2) = [2,1], evaluated_rungs(2) = [2,1] + integer(int64) :: state + integer :: fixture, symbol, tone, bit + real(real32) :: in_phase, quadrature + + do bit = 1, PAYLOAD_BITS + payload(bit) = modulo(bit + bit/3,2) + end do + payload(33) = 0 + call tbcc_encode(payload,tones,JTTY_TBCC_PROFILE_1167_1545_80F) + halves = cmplx(0.0_real32,0.0_real32,real32) + do fixture = 1, size(seeds) + state = seeds(fixture) + do symbol = 1, TOTAL_K + do tone = 0, 3 + state = modulo(48271_int64*state,2147483647_int64) + in_phase = real(state,real32)/2147483647.0_real32 - 0.5_real32 + state = modulo(48271_int64*state,2147483647_int64) + quadrature = real(state,real32)/2147483647.0_real32 - 0.5_real32 + correlations(tone,symbol) = cmplx(in_phase,quadrature,real32) + end do + correlations(tones(symbol),symbol) = correlations(tones(symbol),symbol) + & + cmplx(0.55_real32,0.0_real32,real32) + end do + call jtty_tbcc_decode(correlations,halves,decoded,success,result) + call require(success .and. all(decoded == payload),'coherent rung failed to decode fixed payload') + call require(result%coherent_block_length == lengths(fixture), 'coherent decode used wrong rung') + call require(result%accepted_hypothesis_rank == ranks(fixture), 'coherent decode candidate rank changed') + call require(result%evaluated_rung_count == evaluated_rungs(fixture), & + 'accepted candidate triggered unnecessary confirmation or fallback') + call require(.not.result%used_half_symbol_observation, 'coherent decode fell through to M2') + end do + end subroutine expect_coherent_decodes + + subroutine make_noiseless_correlations(symbols, values) + integer(int32), intent(in) :: symbols(TOTAL_K) + complex(real32), intent(out) :: values(0:3, TOTAL_K) + integer(int32) :: symbol + + values = cmplx(0.0_real32, 0.0_real32, real32) + do symbol = 1, TOTAL_K + values(symbols(symbol), symbol) = cmplx(100.0_real32, 0.0_real32, real32) + end do + end subroutine make_noiseless_correlations + + subroutine require(condition, message) + logical, intent(in) :: condition + character(len=*), intent(in) :: message + + if (.not.condition) error stop message + end subroutine require + +end program test_jtty_tbcc_decoder diff --git a/tests/unit/jtty/test_jtty_tbcc_list_decoder.f90 b/tests/unit/jtty/test_jtty_tbcc_list_decoder.f90 new file mode 100644 index 00000000..d8b4eed7 --- /dev/null +++ b/tests/unit/jtty/test_jtty_tbcc_list_decoder.f90 @@ -0,0 +1,300 @@ +program test_jtty_tbcc_list_decoder + use, intrinsic :: iso_fortran_env, only: int32, int64, real32, real64 + use jtty_tbcc_code_profiles, only: jtty_tbcc_code_profile, & + JTTY_TBCC_PROFILE_1167_1545_80F + use tbcc, only: tbcc_encode, encode_crc12 + use jtty_tbcc_list_decoder + implicit none + + call expect_optimized_reference_parity() + call expect_noiseless_tailbiting_decode() + call expect_reserved_bit_pruning() + call expect_deterministic_hypothesis_budget() + call expect_coherent_normalization() + + print *, 'test_jtty_tbcc_list_decoder: all checks passed' + +contains + + subroutine expect_optimized_reference_parity() + integer(int32), parameter :: coherent_lengths(3) = [1_int32, 2_int32, 4_int32] + integer(int32), parameter :: survivor_widths(2) = [1_int32, 4_int32] + type(jtty_tbcc_decoder_plan) :: plan + type(jtty_tbcc_decoder_workspace) :: workspace + complex(real32) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + integer(int32) :: coherent_index, width_index, symbol, tone, wraps + + do symbol = 1, JTTY_TBCC_INFORMATION_BITS + do tone = 0, 3 + correlations(tone, symbol) = cmplx( & + real(modulo(17*tone + 11*symbol, 29) - 14, real32)/8.0_real32, & + real(modulo(7*tone + 19*symbol, 31) - 15, real32)/9.0_real32, & + real32) + end do + end do + + do wraps = 1, 2 + do coherent_index = 1, size(coherent_lengths) + do width_index = 1, size(survivor_widths) + call jtty_tbcc_init_decoder_plan(plan, JTTY_TBCC_PROFILE_1167_1545_80F, & + coherent_lengths(coherent_index), survivor_widths(width_index), wraps, & + JTTY_TBCC_MAX_HYPOTHESES) + call jtty_tbcc_init_decoder_workspace(workspace, plan) + call expect_decode_parity(JTTY_TBCC_PROFILE_1167_1545_80F, plan, workspace, correlations, & + coherent_lengths(coherent_index), survivor_widths(width_index), wraps, .false.) + call expect_decode_parity(JTTY_TBCC_PROFILE_1167_1545_80F, plan, workspace, correlations, & + coherent_lengths(coherent_index), survivor_widths(width_index), wraps, .true.) + end do + end do + end do + + ! Equal branch energies exercise deterministic ties and wrap deduplication. + correlations = cmplx(0.0_real32, 0.0_real32, real32) + do width_index = 1, 4 + call jtty_tbcc_init_decoder_plan(plan, JTTY_TBCC_PROFILE_1167_1545_80F, 4_int32, & + width_index, 2_int32, JTTY_TBCC_MAX_HYPOTHESES) + call jtty_tbcc_init_decoder_workspace(workspace, plan) + call expect_decode_parity(JTTY_TBCC_PROFILE_1167_1545_80F, plan, workspace, correlations, & + 4_int32, width_index, 2_int32, .false.) + end do + + ! A common large branch collapses distinct accumulated metrics into ties. + do symbol = 1, JTTY_TBCC_INFORMATION_BITS + do tone = 0, 3 + correlations(tone, symbol) = scale(1.0_real32, -18)*cmplx( & + real(modulo(17*tone + 11*symbol, 29) - 14, real32)/8.0_real32, & + real(modulo(7*tone + 19*symbol, 31) - 15, real32)/9.0_real32, real32) + end do + end do + correlations(:, 13) = cmplx(scale(1.0_real32, 20), 0.0_real32, real32) + do coherent_index = 1, size(coherent_lengths) + call jtty_tbcc_init_decoder_plan(plan, JTTY_TBCC_PROFILE_1167_1545_80F, & + coherent_lengths(coherent_index), 4_int32, 2_int32, JTTY_TBCC_MAX_HYPOTHESES) + call jtty_tbcc_init_decoder_workspace(workspace, plan) + call expect_decode_parity(JTTY_TBCC_PROFILE_1167_1545_80F, plan, workspace, correlations, & + coherent_lengths(coherent_index), 4_int32, 2_int32, .false.) + end do + end subroutine expect_optimized_reference_parity + + subroutine expect_decode_parity(code, plan, workspace, correlations, & + coherent_length, survivor_width, wraps, prune) + type(jtty_tbcc_code_profile), intent(in) :: code + type(jtty_tbcc_decoder_plan), intent(in) :: plan + type(jtty_tbcc_decoder_workspace), intent(inout) :: workspace + complex(real32), intent(in) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + integer(int32), intent(in) :: coherent_length, survivor_width, wraps + logical, intent(in) :: prune + integer(int32) :: reference_bits(JTTY_TBCC_INFORMATION_BITS, JTTY_TBCC_MAX_HYPOTHESES) + integer(int32) :: optimized_bits(JTTY_TBCC_INFORMATION_BITS, JTTY_TBCC_MAX_HYPOTHESES) + integer(int32) :: reference_states(JTTY_TBCC_MAX_HYPOTHESES) + integer(int32) :: optimized_states(JTTY_TBCC_MAX_HYPOTHESES) + integer(int32) :: reference_count, optimized_count, reference_pool, optimized_pool + integer(int64) :: reference_ids(JTTY_TBCC_MAX_HYPOTHESES) + integer(int64) :: optimized_ids(JTTY_TBCC_MAX_HYPOTHESES) + real(real64) :: reference_clean(JTTY_TBCC_MAX_HYPOTHESES) + real(real64) :: optimized_clean(JTTY_TBCC_MAX_HYPOTHESES) + real(real64) :: reference_wava(JTTY_TBCC_MAX_HYPOTHESES) + real(real64) :: optimized_wava(JTTY_TBCC_MAX_HYPOTHESES) + logical :: reference_crc(JTTY_TBCC_MAX_HYPOTHESES) + logical :: optimized_crc(JTTY_TBCC_MAX_HYPOTHESES) + integer(int32) :: tracked_bits(JTTY_TBCC_INFORMATION_BITS) = 0_int32 + integer(int32) :: reference_pool_rank, optimized_pool_rank, reference_h_rank, optimized_h_rank + logical :: reference_present, optimized_present + + call jtty_tbcc_list_wava_reference(correlations, code, coherent_length, & + survivor_width, wraps, JTTY_TBCC_MAX_HYPOTHESES, reference_bits, & + reference_ids, reference_clean, reference_wava, reference_states, & + reference_crc, reference_count, reference_pool, prune_reserved_zero=prune, & + reference_bits=tracked_bits, reference_present=reference_present, & + reference_pool_rank=reference_pool_rank, reference_h_rank=reference_h_rank) + call jtty_tbcc_list_wava_optimized(plan, workspace, correlations, optimized_bits, & + optimized_ids, optimized_clean, optimized_wava, optimized_states, & + optimized_crc, optimized_count, optimized_pool, prune_reserved_zero=prune, & + reference_bits=tracked_bits, reference_present=optimized_present, & + reference_pool_rank=optimized_pool_rank, reference_h_rank=optimized_h_rank) + + if (reference_count /= optimized_count .or. reference_pool /= optimized_pool .or. & + any(reference_bits /= optimized_bits) .or. any(reference_ids /= optimized_ids) .or. & + .not.real_arrays_agree(reference_clean, optimized_clean) .or. & + .not.real_arrays_agree(reference_wava, optimized_wava) .or. & + any(reference_states /= optimized_states) .or. & + any(reference_crc .neqv. optimized_crc) .or. & + (reference_present .neqv. optimized_present) .or. & + reference_pool_rank /= optimized_pool_rank .or. reference_h_rank /= optimized_h_rank) & + error stop 'TBCC list decoder optimized/reference mismatch' + end subroutine expect_decode_parity + + subroutine expect_noiseless_tailbiting_decode() + type(jtty_tbcc_code_profile) :: code + complex(real32) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + integer(int32) :: information_bits(JTTY_TBCC_INFORMATION_BITS) + integer(int32) :: tones(JTTY_TBCC_INFORMATION_BITS) + integer(int32) :: candidates(JTTY_TBCC_INFORMATION_BITS, JTTY_TBCC_MAX_HYPOTHESES) + integer(int32) :: states(JTTY_TBCC_MAX_HYPOTHESES), candidate_count, pool_count + integer(int64) :: identities(JTTY_TBCC_MAX_HYPOTHESES) + real(real64) :: clean_metrics(JTTY_TBCC_MAX_HYPOTHESES) + real(real64) :: path_metrics(JTTY_TBCC_MAX_HYPOTHESES), rescored_metric + logical :: crc_valid(JTTY_TBCC_MAX_HYPOTHESES), closed + + code = JTTY_TBCC_PROFILE_1167_1545_80F + call make_codeword(.false., information_bits, tones) + call make_noiseless_correlations(tones, correlations) + call jtty_tbcc_list_wava(correlations, code, 4_int32, 4_int32, 2_int32, & + JTTY_TBCC_MAX_HYPOTHESES, candidates, identities, clean_metrics, path_metrics, & + states, crc_valid, candidate_count, pool_count, prune_reserved_zero=.true.) + + if (candidate_count < 1_int32 .or. pool_count < candidate_count) & + error stop 'TBCC list decoder returned no noiseless candidate' + if (any(candidates(:, 1) /= information_bits) .or. .not.crc_valid(1)) & + error stop 'TBCC list decoder noiseless candidate mismatch' + if (states(1) /= jtty_tbcc_tailbiting_state(code, information_bits)) & + error stop 'TBCC list decoder tail-biting state mismatch' + call jtty_tbcc_score_candidate(code, correlations, 4_int32, candidates(:, 1), & + rescored_metric, closed) + if (.not.closed .or. rescored_metric /= clean_metrics(1) .or. & + abs(clean_metrics(1) - 46.0_real64) > 1.0e-12_real64) & + error stop 'TBCC list decoder final L2 block or clean rescore mismatch' + end subroutine expect_noiseless_tailbiting_decode + + subroutine expect_reserved_bit_pruning() + type(jtty_tbcc_code_profile) :: code + complex(real32) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + integer(int32) :: information_bits(JTTY_TBCC_INFORMATION_BITS) + integer(int32) :: tones(JTTY_TBCC_INFORMATION_BITS) + integer(int32) :: candidates(JTTY_TBCC_INFORMATION_BITS, JTTY_TBCC_MAX_HYPOTHESES) + integer(int32) :: states(JTTY_TBCC_MAX_HYPOTHESES), candidate_count, pool_count + integer(int64) :: identities(JTTY_TBCC_MAX_HYPOTHESES), forbidden_identity + real(real64) :: clean_metrics(JTTY_TBCC_MAX_HYPOTHESES) + real(real64) :: path_metrics(JTTY_TBCC_MAX_HYPOTHESES) + logical :: crc_valid(JTTY_TBCC_MAX_HYPOTHESES) + + code = JTTY_TBCC_PROFILE_1167_1545_80F + call make_codeword(.true., information_bits, tones) + call make_noiseless_correlations(tones, correlations) + forbidden_identity = jtty_tbcc_candidate_identity(information_bits) + call jtty_tbcc_list_wava(correlations, code, 4_int32, 4_int32, 2_int32, & + JTTY_TBCC_MAX_HYPOTHESES, candidates, identities, clean_metrics, path_metrics, & + states, crc_valid, candidate_count, pool_count, prune_reserved_zero=.false.) + if (candidate_count < 1_int32 .or. identities(1) /= forbidden_identity) & + error stop 'TBCC list decoder unpruned control mismatch' + + call jtty_tbcc_list_wava(correlations, code, 4_int32, 4_int32, 2_int32, & + JTTY_TBCC_MAX_HYPOTHESES, candidates, identities, clean_metrics, path_metrics, & + states, crc_valid, candidate_count, pool_count, prune_reserved_zero=.true.) + if (candidate_count > 0_int32) then + if (any(candidates(JTTY_TBCC_RESERVED_BIT, 1:candidate_count) /= 0_int32)) & + error stop 'TBCC list decoder reserved-bit pruning failed' + if (any(identities(1:candidate_count) == forbidden_identity)) & + error stop 'TBCC list decoder retained reserved-invalid identity' + end if + end subroutine expect_reserved_bit_pruning + + subroutine expect_deterministic_hypothesis_budget() + type(jtty_tbcc_code_profile) :: code + complex(real32) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + integer(int32) :: bits_a(JTTY_TBCC_INFORMATION_BITS, JTTY_TBCC_MAX_HYPOTHESES) + integer(int32) :: bits_b(JTTY_TBCC_INFORMATION_BITS, JTTY_TBCC_MAX_HYPOTHESES) + integer(int32) :: states_a(JTTY_TBCC_MAX_HYPOTHESES) + integer(int32) :: states_b(JTTY_TBCC_MAX_HYPOTHESES) + integer(int32) :: count_a, count_b, pool_a, pool_b, rank + integer(int64) :: ids_a(JTTY_TBCC_MAX_HYPOTHESES), ids_b(JTTY_TBCC_MAX_HYPOTHESES) + real(real64) :: clean_a(JTTY_TBCC_MAX_HYPOTHESES), clean_b(JTTY_TBCC_MAX_HYPOTHESES) + real(real64) :: path_a(JTTY_TBCC_MAX_HYPOTHESES), path_b(JTTY_TBCC_MAX_HYPOTHESES) + logical :: crc_a(JTTY_TBCC_MAX_HYPOTHESES), crc_b(JTTY_TBCC_MAX_HYPOTHESES) + integer(int32) :: one_bit(JTTY_TBCC_INFORMATION_BITS, 1), one_state(1) + integer(int32) :: one_count, one_pool + integer(int64) :: one_id(1) + real(real64) :: one_clean(1), one_path(1) + logical :: one_crc(1) + + code = JTTY_TBCC_PROFILE_1167_1545_80F + correlations = cmplx(0.0_real32, 0.0_real32, real32) + call jtty_tbcc_list_wava(correlations, code, 4_int32, 4_int32, 2_int32, & + JTTY_TBCC_MAX_HYPOTHESES, bits_a, ids_a, clean_a, path_a, states_a, & + crc_a, count_a, pool_a, prune_reserved_zero=.true.) + call jtty_tbcc_list_wava(correlations, code, 4_int32, 4_int32, 2_int32, & + JTTY_TBCC_MAX_HYPOTHESES, bits_b, ids_b, clean_b, path_b, states_b, & + crc_b, count_b, pool_b, prune_reserved_zero=.true.) + + if (count_a /= JTTY_TBCC_MAX_HYPOTHESES .or. count_b /= count_a .or. & + pool_a < count_a .or. pool_b /= pool_a) & + error stop 'TBCC list decoder did not enforce the H4 budget' + if (any(bits_a /= bits_b) .or. any(ids_a /= ids_b) .or. & + any(states_a /= states_b) .or. .not.real_arrays_agree(clean_a, clean_b) .or. & + .not.real_arrays_agree(path_a, path_b) .or. any(crc_a .neqv. crc_b)) & + error stop 'TBCC list decoder tie order is not deterministic' + do rank = 2, count_a + if (ids_a(rank) <= ids_a(rank - 1)) & + error stop 'TBCC list decoder did not deduplicate tied identities' + end do + + call jtty_tbcc_list_wava(correlations, code, 4_int32, 4_int32, 2_int32, & + 1_int32, one_bit, one_id, one_clean, one_path, one_state, one_crc, & + one_count, one_pool, prune_reserved_zero=.true.) + if (one_count /= 1_int32 .or. one_id(1) /= ids_a(1) .or. one_pool /= pool_a) & + error stop 'TBCC list decoder did not enforce the H1 budget' + end subroutine expect_deterministic_hypothesis_budget + + subroutine expect_coherent_normalization() + complex(real32) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + integer(int32) :: tones4(4), tones2(2) + real(real64) :: metric + + correlations = cmplx(0.0_real32, 0.0_real32, real32) + tones4 = [0_int32, 1_int32, 2_int32, 3_int32] + correlations(0, 3) = cmplx(1.0_real32, 0.0_real32, real32) + correlations(1, 4) = cmplx(2.0_real32, 0.0_real32, real32) + correlations(2, 5) = cmplx(3.0_real32, 0.0_real32, real32) + correlations(3, 6) = cmplx(4.0_real32, 0.0_real32, real32) + metric = jtty_tbcc_coherent_metric(correlations, 3_int32, tones4) + if (metric /= 25.0_real64) error stop 'TBCC L4 normalization mismatch' + + tones2 = [1_int32, 3_int32] + correlations(1, 45) = cmplx(2.0_real32, 0.0_real32, real32) + correlations(3, 46) = cmplx(4.0_real32, 0.0_real32, real32) + metric = jtty_tbcc_coherent_metric(correlations, 45_int32, tones2) + if (metric /= 18.0_real64) error stop 'TBCC final L2 normalization mismatch' + end subroutine expect_coherent_normalization + + subroutine make_codeword(set_reserved_bit, information_bits, tones) + logical, intent(in) :: set_reserved_bit + integer(int32), intent(out) :: information_bits(JTTY_TBCC_INFORMATION_BITS) + integer(int32), intent(out) :: tones(JTTY_TBCC_INFORMATION_BITS) + integer(int32) :: payload(34), encoded(2, JTTY_TBCC_INFORMATION_BITS), bit_index + + do bit_index = 1, size(payload) + payload(bit_index) = modulo(5*bit_index + bit_index/3, 2) + end do + payload(JTTY_TBCC_RESERVED_BIT) = merge(1_int32, 0_int32, set_reserved_bit) + call encode_crc12(payload, encoded, JTTY_TBCC_PROFILE_1167_1545_80F) + call tbcc_encode(payload, tones, JTTY_TBCC_PROFILE_1167_1545_80F) + information_bits = encoded(1, :) + end subroutine make_codeword + + subroutine make_noiseless_correlations(tones, correlations) + integer(int32), intent(in) :: tones(JTTY_TBCC_INFORMATION_BITS) + complex(real32), intent(out) :: correlations(0:3, JTTY_TBCC_INFORMATION_BITS) + integer(int32) :: symbol + + correlations = cmplx(0.0_real32, 0.0_real32, real32) + do symbol = 1, JTTY_TBCC_INFORMATION_BITS + correlations(tones(symbol), symbol) = cmplx(1.0_real32, 0.0_real32, real32) + end do + end subroutine make_noiseless_correlations + + pure logical function real_arrays_agree(left, right) result(agree) + real(real64), intent(in) :: left(:), right(:) + integer(int32) :: element + + agree = size(left) == size(right) + if (.not.agree) return + do element = 1, size(left) + if (left(element) == right(element)) cycle + if (abs(left(element)-right(element)) <= 64.0_real64*epsilon(0.0_real64)* & + max(1.0_real64, abs(left(element)), abs(right(element)))) cycle + agree = .false. + return + end do + end function real_arrays_agree + +end program test_jtty_tbcc_list_decoder diff --git a/tests/unit/jtty/test_jtty_txstream.cpp b/tests/unit/jtty/test_jtty_txstream.cpp new file mode 100644 index 00000000..d71be2a6 --- /dev/null +++ b/tests/unit/jtty/test_jtty_txstream.cpp @@ -0,0 +1,487 @@ +#include +#include +#include +#include +#include + +#include "Audio/AudioDevice.hpp" +#include "Audio/TxAudioQueue.hpp" +#include "Audio/TxIdentity.hpp" +#include "Audio/TxPlaybackEvidence.hpp" +#include "Audio/TxRequest.hpp" +#include "Modulator/JttyPcmFifo.hpp" +#include "Modulator/JttyTxStream.hpp" + +// Unit tests for the JTTY async transmit source. These exercise the FIFO / +// served-sample mechanics, the drain predicate, and the drained() edge signal +// without any audio hardware: readData() is driven through the public +// QIODevice::read() API after opening the device with initialize(). + +class TestJttyTxStream : public QObject +{ + Q_OBJECT + +private slots: + void initTestCase (); + void gaplessConcatAndSilencePad (); + void clearResetsCounters (); + void clearThenEnqueueSkipsOldSamples (); + void clearDuringPartialPlaybackSkipsRemainder (); + void pendingResetProgressExcludesAbortedAudio (); + void fifoOverflowRejectsWithoutTruncating (); + void fifoWrappedEnqueuePreservesOrder (); + void enqueueFitPredicate (); + void fifoDrainStateCarriesEpochAndTotal (); + void fifoDrainAfterResetUsesNewEpochAndTotal (); + void fifoEpochBoundaryAfterNaturalDrainResetsTotal (); + void drainedPredicate (); + void readDoesNotEmitDrainedDirectly (); + void timerEmitsDrainedEdge (); + void drainedEmittedFromWorkerThread (); + void sourceCommitUsesCurrentRealExtent (); + void staleQueueEpochDoesNotStart (); + void sourceCommitIsEmittedOncePerStart (); +}; + +namespace +{ + // Default drain guard baked into JttyTxStream when start() has not run (no + // device buffer to measure). Mirrors DEFAULT_DRAIN_GUARD in JttyTxStream.cpp. + constexpr int DEFAULT_GUARD = 9600; + + TxEvidence::TxRequest jttyRequest (qint64 sessionId, qint64 generation, + qint64 queueEpoch = -1) + { + TxEvidence::TxRequest request; + request.mode = QStringLiteral ("JTTY"); + request.session_id = TxEvidence::TxSessionId {sessionId}; + request.generation = TxEvidence::TxGeneration {generation}; + request.queue_epoch = TxAudioQueueEpoch { + queueEpoch >= 0 ? queueEpoch : sessionId}; + return request; + } + + TxAudioQueueEpoch queueEpoch (qint64 value) + { + return TxAudioQueueEpoch {value}; + } + + QVector readFrames (JttyTxStream & s, int frames) + { + QByteArray buf (frames * 2, '\xff'); + qint64 got = s.read (buf.data (), buf.size ()); + QVector out; + if (got <= 0) return out; + int n = int (got / 2); + qint16 const * p = reinterpret_cast (buf.constData ()); + for (int i = 0; i < n; ++i) out.append (p[i]); + return out; + } +} + +void TestJttyTxStream::initTestCase () +{ + qRegisterMetaType ("TxAudioQueueDrainState"); +} + +void TestJttyTxStream::gaplessConcatAndSilencePad () +{ + TxAudioQueue queue; + auto const epoch = queueEpoch (1); + queue.clear (epoch); + JttyTxStream s {queue}; + QVERIFY (s.initialize (QIODevice::ReadOnly, AudioDevice::Mono)); + + // Two messages queued before any are consumed: they must chain with no gap. + QVERIFY (queue.enqueue (QVector {10, 20, 30}, epoch).accepted); + QVERIFY (queue.enqueue (QVector {40, 50}, epoch).accepted); + QCOMPARE (queue.progress ().total_samples, qint64 (5)); + + // Pull 7 frames: 5 real samples concatenated in order, then silence padding. + QVector got = readFrames (s, 7); + QCOMPARE (got.size (), 7); + QCOMPARE (got, (QVector {10, 20, 30, 40, 50, 0, 0})); + + QCOMPARE (queue.progress ().served_samples, qint64 (5)); // padding is not counted as real + + // A late message resumes real audio after the silence (late-message path). + QVERIFY (queue.enqueue (QVector {60}, epoch).accepted); + QCOMPARE (queue.progress ().total_samples, qint64 (6)); + QVector more = readFrames (s, 2); + QCOMPARE (more, (QVector {60, 0})); + QCOMPARE (queue.progress ().served_samples, qint64 (6)); +} + +void TestJttyTxStream::clearResetsCounters () +{ + TxAudioQueue queue; + auto const firstEpoch = queueEpoch (1); + queue.clear (firstEpoch); + JttyTxStream s {queue}; + QVERIFY (s.initialize (QIODevice::ReadOnly, AudioDevice::Mono)); + QVERIFY (queue.enqueue (QVector {1, 2, 3}, firstEpoch).accepted); + (void) readFrames (s, 2); + queue.clear (queueEpoch (2)); + QCOMPARE (queue.progress ().total_samples, qint64 (0)); + QCOMPARE (queue.progress ().served_samples, qint64 (0)); + // After clear the device pads pure silence. + QCOMPARE (readFrames (s, 3), (QVector {0, 0, 0})); +} + +void TestJttyTxStream::clearThenEnqueueSkipsOldSamples () +{ + JttyPcmFifo fifo {16}; + QVERIFY (fifo.enqueue (QVector {1, 2, 3}, 1)); + fifo.clear (2); + QVERIFY (fifo.enqueue (QVector {4, 5}, 2)); + + QCOMPARE (fifo.totalReal (), qint64 (2)); + QCOMPARE (fifo.servedReal (), qint64 (0)); + QCOMPARE (fifo.queuedReal (), qint64 (2)); + + QVector got; + for (int i = 0; i < 4; ++i) got.append (fifo.pullSample (2)); + QCOMPARE (got, (QVector {4, 5, 0, 0})); + QCOMPARE (fifo.totalReal (), qint64 (2)); + QCOMPARE (fifo.servedReal (), qint64 (2)); +} + +void TestJttyTxStream::clearDuringPartialPlaybackSkipsRemainder () +{ + JttyPcmFifo fifo {16}; + QVERIFY (fifo.enqueue (QVector {1, 2, 3, 4, 5}, 1)); + QCOMPARE (fifo.pullSample (2), qint16 (1)); + QCOMPARE (fifo.pullSample (2), qint16 (2)); + + fifo.clear (2); + QCOMPARE (fifo.totalReal (), qint64 (0)); + QCOMPARE (fifo.servedReal (), qint64 (0)); + QCOMPARE (fifo.queuedReal (), qint64 (0)); + + QVERIFY (fifo.enqueue (QVector {6}, 2)); + QCOMPARE (fifo.pullSample (2), qint16 (6)); + QCOMPARE (fifo.pullSample (2), qint16 (0)); + QCOMPARE (fifo.totalReal (), qint64 (1)); + QCOMPARE (fifo.servedReal (), qint64 (1)); +} + +void TestJttyTxStream::pendingResetProgressExcludesAbortedAudio () +{ + JttyPcmFifo fifo {16}; + QVERIFY (fifo.enqueue (QVector {1, 2, 3, 4, 5}, 1)); + QCOMPARE (fifo.pullSample (2), qint16 (1)); + QCOMPARE (fifo.pullSample (2), qint16 (2)); + + fifo.clear (2); + QVERIFY (fifo.enqueue (QVector {6, 7}, 2)); + + QCOMPARE (fifo.totalReal (), qint64 (2)); + QCOMPARE (fifo.servedReal (), qint64 (0)); + QCOMPARE (fifo.queuedReal (), qint64 (2)); + QCOMPARE (fifo.pullSample (2), qint16 (6)); + QCOMPARE (fifo.totalReal (), qint64 (2)); + QCOMPARE (fifo.servedReal (), qint64 (1)); + QCOMPARE (fifo.queuedReal (), qint64 (1)); +} + +void TestJttyTxStream::fifoOverflowRejectsWithoutTruncating () +{ + JttyPcmFifo fifo {4}; + QVERIFY (fifo.enqueue (QVector {1, 2, 3}, 11)); + QVERIFY (!fifo.enqueue (QVector {4, 5}, 11)); + QCOMPARE (fifo.totalReal (), qint64 (3)); + + QVector got; + for (int i = 0; i < 5; ++i) got.append (fifo.pullSample (2)); + QCOMPARE (got, (QVector {1, 2, 3, 0, 0})); +} + +void TestJttyTxStream::fifoWrappedEnqueuePreservesOrder () +{ + JttyPcmFifo fifo {5}; + QVERIFY (fifo.enqueue (QVector {1, 2, 3, 4}, 11)); + QCOMPARE (fifo.pullSample (2), qint16 (1)); + QCOMPARE (fifo.pullSample (2), qint16 (2)); + QCOMPARE (fifo.pullSample (2), qint16 (3)); + + QVERIFY (fifo.enqueue (QVector {5, 6, 7}, 11)); + + QVector got; + for (int i = 0; i < 5; ++i) got.append (fifo.pullSample (2)); + QCOMPARE (got, (QVector {4, 5, 6, 7, 0})); + QCOMPARE (fifo.totalReal (), qint64 (7)); + QCOMPARE (fifo.servedReal (), qint64 (7)); +} + +void TestJttyTxStream::enqueueFitPredicate () +{ + QVERIFY (jttyPcmEnqueueFits (4, 0, 4)); + QVERIFY (jttyPcmEnqueueFits (4, 2, 2)); + QVERIFY (jttyPcmEnqueueFits (4, 4, 0)); + QVERIFY (!jttyPcmEnqueueFits (4, 1, 4)); + QVERIFY (!jttyPcmEnqueueFits (4, 5, 1)); + QVERIFY (!jttyPcmEnqueueFits (0, 0, 1)); + QVERIFY (!jttyPcmEnqueueFits (4, -1, 1)); +} + +void TestJttyTxStream::fifoDrainStateCarriesEpochAndTotal () +{ + JttyPcmFifo fifo {16}; + QVERIFY (fifo.enqueue (QVector {1, 2, 3}, 21)); + for (int i = 0; i < 5; ++i) (void) fifo.pullSample (2); + + auto drain = fifo.takeDrainReady (); + QVERIFY (drain.ready); + QCOMPARE (drain.epoch, qint64 (21)); + QCOMPARE (drain.totalAtDrain, qint64 (3)); + + QVERIFY (fifo.enqueue (QVector {4}, 21)); + for (int i = 0; i < 3; ++i) (void) fifo.pullSample (2); + drain = fifo.takeDrainReady (); + QVERIFY (drain.ready); + QCOMPARE (drain.epoch, qint64 (21)); + QCOMPARE (drain.totalAtDrain, qint64 (4)); + + fifo.clear (22); + QCOMPARE (fifo.totalReal (), qint64 (0)); + QCOMPARE (fifo.servedReal (), qint64 (0)); + QVERIFY (!fifo.takeDrainReady ().ready); +} + +void TestJttyTxStream::fifoDrainAfterResetUsesNewEpochAndTotal () +{ + JttyPcmFifo fifo {16}; + QVERIFY (fifo.enqueue (QVector {1, 2, 3}, 21)); + fifo.clear (22); + QVERIFY (!fifo.takeDrainReady ().ready); + QVERIFY (fifo.enqueue (QVector {4, 5}, 22)); + + for (int i = 0; i < 4; ++i) (void) fifo.pullSample (2); + auto drain = fifo.takeDrainReady (); + QVERIFY (drain.ready); + QCOMPARE (drain.epoch, qint64 (22)); + QCOMPARE (drain.totalAtDrain, qint64 (2)); +} + +void TestJttyTxStream::fifoEpochBoundaryAfterNaturalDrainResetsTotal () +{ + JttyPcmFifo fifo {16}; + QVERIFY (fifo.enqueue (QVector {1, 2, 3}, 21)); + for (int i = 0; i < 5; ++i) (void) fifo.pullSample (2); + + auto drain = fifo.takeDrainReady (); + QVERIFY (drain.ready); + QCOMPARE (drain.epoch, qint64 (21)); + QCOMPARE (drain.totalAtDrain, qint64 (3)); + + fifo.clear (22); + QVERIFY (fifo.enqueue (QVector {4, 5}, 22)); + for (int i = 0; i < 4; ++i) (void) fifo.pullSample (2); + + drain = fifo.takeDrainReady (); + QVERIFY (drain.ready); + QCOMPARE (drain.epoch, qint64 (22)); + QCOMPARE (drain.totalAtDrain, qint64 (2)); +} + +void TestJttyTxStream::drainedPredicate () +{ + // Nothing queued yet => not drained. + QVERIFY (!jttyTxDrained (0, 0, 100, 0, 10)); + + // Real audio still to be pulled => not drained. + QVERIFY (!jttyTxDrained (3, 5, 50, 5, 10)); + + // All pulled but trailing silence has not yet covered the buffer depth. + QVERIFY (!jttyTxDrained (5, 5, 12, 5, 10)); // 12-5 = 7 < 10 + + // All pulled and trailing silence covers the buffer depth => drained. + QVERIFY (jttyTxDrained (5, 5, 15, 5, 10)); // 15-5 = 10 >= 10 + QVERIFY (jttyTxDrained (5, 5, 99, 5, 10)); +} + +void TestJttyTxStream::readDoesNotEmitDrainedDirectly () +{ + TxAudioQueue queue; + auto const epoch = queueEpoch (31); + queue.clear (epoch); + JttyTxStream s {queue}; + QVERIFY (s.initialize (QIODevice::ReadOnly, AudioDevice::Mono)); + QSignalSpy spy (&s, &JttyTxStream::drained); + + QVERIFY (queue.enqueue (QVector {7, 7, 7}, epoch).accepted); + (void) readFrames (s, 3 + DEFAULT_GUARD); + QCOMPARE (spy.count (), 0); +} + +void TestJttyTxStream::timerEmitsDrainedEdge () +{ + TxAudioQueue queue; + auto const epoch = queueEpoch (41); + queue.clear (epoch); + JttyTxStream s {queue}; + QSignalSpy spy (&s, &JttyTxStream::drained); + + QVERIFY (queue.enqueue (QVector {7, 7, 7}, epoch).accepted); + s.start (jttyRequest (41, 1), nullptr); + + // Serve the 3 real samples plus exactly the guard worth of trailing silence. + (void) readFrames (s, 3 + DEFAULT_GUARD); + QTRY_COMPARE (spy.count (), 1); + auto drain = qvariant_cast (spy.at (0).at (0)); + QCOMPARE (drain.epoch, epoch); + QCOMPARE (drain.total_at_drain, qint64 (3)); + + // Further silence must not re-emit (edge-triggered). + (void) readFrames (s, 1000); + QCOMPARE (spy.count (), 1); + + // A new message clears the drain edge; draining again emits once more. + QVERIFY (queue.enqueue (QVector {9}, epoch).accepted); + (void) readFrames (s, 1 + DEFAULT_GUARD); + QTRY_COMPARE (spy.count (), 2); + drain = qvariant_cast (spy.at (1).at (0)); + QCOMPARE (drain.epoch, epoch); + QCOMPARE (drain.total_at_drain, qint64 (4)); + s.stop (); +} + +void TestJttyTxStream::drainedEmittedFromWorkerThread () +{ + // Integration test: drive the stream the way the app does, with the object + // moved onto a dedicated worker thread (m_audioThread in production). The + // drain timer is a parented child, so it must ride to the worker thread and + // tick there; a value-member timer could not be started cross-thread and + // drained() would never fire (this test would then time out). start() and the + // audio pull run on the worker thread; drained() must cross back to the + // main-thread receiver. + TxAudioQueue queue; + auto const epoch = queueEpoch (51); + queue.clear (epoch); + auto * stream = new JttyTxStream {queue}; + QPointer streamWitness {stream}; + qint64 drainedSession {-1}; + qint64 drainedTotal {-1}; + int drainedCount {0}; + QObject receiver; + // Qt 5's QSignalSpy records through a direct connection, so explicitly queue + // cross-thread test state onto a main-thread receiver. + connect (stream, &JttyTxStream::drained, &receiver, + [&drainedSession, &drainedTotal, &drainedCount] + (TxAudioQueueDrainState drain) { + drainedSession = drain.epoch.value (); + drainedTotal = drain.total_at_drain; + ++drainedCount; + }, Qt::QueuedConnection); + + QVERIFY (queue.enqueue (QVector {7, 7, 7}, epoch).accepted); + + QThread worker; + stream->moveToThread (&worker); + connect (&worker, &QThread::finished, stream, &QObject::deleteLater); + + // Queue before starting the worker so thread creation establishes the + // cross-thread handoff. + QMetaObject::invokeMethod (stream, [stream] { + stream->start (jttyRequest (51, 1), nullptr); + QByteArray buf ((3 + DEFAULT_GUARD) * 2, '\0'); + stream->read (buf.data (), buf.size ()); + }, Qt::QueuedConnection); + worker.start (); + + QTRY_COMPARE_WITH_TIMEOUT (drainedCount, 1, 2000); + QCOMPARE (drainedSession, qint64 (51)); + QCOMPARE (drainedTotal, qint64 (3)); + + // The stream owns timers that must stop and be destroyed on their thread. + QVERIFY (QMetaObject::invokeMethod ( + stream, "stop", Qt::BlockingQueuedConnection)); + worker.quit (); + QVERIFY (worker.wait (2000)); + QVERIFY (streamWitness.isNull ()); +} + +void TestJttyTxStream::sourceCommitUsesCurrentRealExtent () +{ + auto const snapshot = makeJttyTxStartSnapshot (jttyRequest (61, 7), 3); + QCOMPARE (snapshot.session_id.value (), qint64 (61)); + QCOMPARE (snapshot.generation.value (), qint64 (7)); + QCOMPARE (snapshot.mode, QString {"JTTY"}); + QCOMPARE (snapshot.sample_rate_hz, 48000); + QCOMPARE (snapshot.committed_end_sample, qint64 (3)); + QVERIFY (!snapshot.target_known); + QVERIFY (!snapshot.diagnostic.isEmpty ()); + + TxAudioQueue queue; + auto const epoch = queueEpoch (61); + queue.clear (epoch); + JttyTxStream stream {queue}; + QVERIFY (queue.enqueue (QVector {1, 2, 3}, epoch).accepted); + TxEvidence::TxStartSnapshot committed; + int commitCount {0}; + connect (&stream, &JttyTxStream::txSourceCommitted, &stream, + [&committed, &commitCount] (TxEvidence::TxStartSnapshot snapshot) { + committed = snapshot; + ++commitCount; + }); + + stream.start (jttyRequest (61, 7), nullptr); + QCOMPARE (commitCount, 1); + QCOMPARE (committed.committed_end_sample, qint64 (2)); + (void) readFrames (stream, 3 + DEFAULT_GUARD); + QCOMPARE (queue.progress ().served_samples, qint64 (3)); + stream.stop (); +} + +void TestJttyTxStream::staleQueueEpochDoesNotStart () +{ + TxAudioQueue queue; + auto const current = queueEpoch (81); + queue.clear (current); + QVERIFY (queue.enqueue (QVector {7, 8, 9}, current).accepted); + + JttyTxStream stream {queue}; + TxEvidence::TxStartSnapshot committed; + int commitCount {0}; + connect (&stream, &JttyTxStream::txSourceCommitted, &stream, + [&committed, &commitCount] (TxEvidence::TxStartSnapshot snapshot) { + committed = snapshot; + ++commitCount; + }); + stream.start (jttyRequest (80, 1), nullptr); + QVERIFY (!stream.isActive ()); + QCOMPARE (commitCount, 0); + + stream.start (jttyRequest (81, 2), nullptr); + QVERIFY (stream.isActive ()); + QCOMPARE (commitCount, 1); + QCOMPARE (committed.committed_end_sample, qint64 (2)); + stream.stop (); +} + +void TestJttyTxStream::sourceCommitIsEmittedOncePerStart () +{ + TxAudioQueue queue; + JttyTxStream stream {queue}; + QVector commits; + connect (&stream, &JttyTxStream::txSourceCommitted, &stream, + [&commits] (TxEvidence::TxStartSnapshot snapshot) {commits.append (snapshot);}); + + queue.clear (queueEpoch (71)); + stream.start (jttyRequest (71, 1), nullptr); + stream.start (jttyRequest (71, 1), nullptr); + QCOMPARE (commits.size (), 1); + QCOMPARE (commits.at (0).committed_end_sample, qint64 (-1)); + stream.stop (); + + queue.clear (queueEpoch (72)); + stream.start (jttyRequest (72, 2), nullptr); + QCOMPARE (commits.size (), 2); + QCOMPARE (commits.at (0).session_id.value (), qint64 (71)); + QCOMPARE (commits.at (1).session_id.value (), qint64 (72)); + QCOMPARE (commits.at (1).generation.value (), qint64 (2)); + stream.stop (); +} + +QTEST_MAIN (TestJttyTxStream) +#include "test_jtty_txstream.moc" diff --git a/tests/unit/jtty/test_jtty_windowed_decode.f90 b/tests/unit/jtty/test_jtty_windowed_decode.f90 new file mode 100644 index 00000000..19bb345f --- /dev/null +++ b/tests/unit/jtty/test_jtty_windowed_decode.f90 @@ -0,0 +1,160 @@ +program test_jtty_windowed_decode + + ! rjtty_sub_windowed bounds the scan to [istart0,istop] instead of the + ! whole buffer -- used by MainWindow::jttyDecodeAgainAt() for a WideGraph + ! click-driven re-decode. Two messages placed far apart in time: a window + ! covering only one message must find only that one; a window covering + ! both (or the unwindowed rjtty_sub) must find both; and decoded content + ! for a message fully inside its window must match the unwindowed result + ! exactly (windowing must not corrupt what it does decode). + + use iso_fortran_env, only: int16 + use jtty_fec, only: is13, TOTAL_K + use jtty_mdec, only: npending,pending_updates,discard_pending_updates + use jtty_mod, only: MAX_FRAMES + implicit none + + character(len=*), parameter :: msg_a='MAYBE YOU SHOULD HELP' + character(len=*), parameter :: msg_b='CLAUDE CO 3 MIN TRANSITION' + integer, parameter :: nsps=384 + integer, parameter :: frame_symbols=size(is13)+TOTAL_K + real, parameter :: dt_a=0.2, dt_b=40.0 + integer :: failures + integer :: first_start,second_start,first_samples,second_samples,total_samples + integer(int16), allocatable :: pcm(:) + character(len=80) :: decoded_a_full,decoded_a_windowed + + failures=0 + + call build_pair(pcm,total_samples,first_start,first_samples,second_start,second_samples) + + ! Baseline: unwindowed scan finds both messages. + call rjtty_sub(pcm,1,nsps,200,2800,1500.0,50.0) + call rjtty_sub(pcm,total_samples,nsps,200,2800,1500.0,50.0) + call expect(found(msg_a),'unwindowed: first message found',failures) + call expect(found(msg_b),'unwindowed: second message found',failures) + decoded_a_full=decoded_text(msg_a) + + ! Window covering only the first message: second must not appear. + call discard_pending_updates() + call rjtty_sub_windowed(pcm,1,nsps,200,2800,1500.0,50.0,1,1) + call rjtty_sub_windowed(pcm,first_start+first_samples+2*chunk(), & + nsps,200,2800,1500.0,50.0,1,first_start+first_samples+2*chunk()) + call expect(found(msg_a),'window on first message: first message found',failures) + call expect(.not.found(msg_b),'window on first message: second message absent',failures) + decoded_a_windowed=decoded_text(msg_a) + call expect(trim(decoded_a_windowed).eq.trim(decoded_a_full), & + 'windowed decode content matches unwindowed content',failures) + + ! Window covering only the second message: first must not appear. + call discard_pending_updates() + call rjtty_sub_windowed(pcm,1,nsps,200,2800,1500.0,50.0, & + max(1,second_start-2*chunk()),total_samples) + call rjtty_sub_windowed(pcm,total_samples,nsps,200,2800,1500.0,50.0, & + max(1,second_start-2*chunk()),total_samples) + call expect(.not.found(msg_a),'window on second message: first message absent',failures) + call expect(found(msg_b),'window on second message: second message found',failures) + + if(failures.ne.0) then + write(*,'(a,i0)') 'test_jtty_windowed_decode: failures=',failures + stop 1 + endif + write(*,'(a)') 'test_jtty_windowed_decode: all checks passed' + +contains + + integer function chunk() + integer :: nframe + nframe=59*nsps + chunk=nframe+nframe/4 + end function chunk + + subroutine build_pair(pcm,total_samples,first_start,first_samples, & + second_start,second_samples) + integer(int16), allocatable, intent(out) :: pcm(:) + integer, intent(out) :: total_samples,first_start,first_samples + integer, intent(out) :: second_start,second_samples + integer :: first_tones(MAX_FRAMES*frame_symbols) + integer :: second_tones(MAX_FRAMES*frame_symbols) + integer :: first_symbols,second_symbols,i,idx,pcm_val + real, allocatable :: first_wave(:),second_wave(:) + complex, allocatable :: complex_wave(:) + character(len=80) :: first_input,second_input + + first_input=msg_a + call genjtty(first_input,first_tones,first_symbols) + first_samples=first_symbols*nsps + first_start=max(1,nint(dt_a*12000.0)+1) + + second_input=msg_b + call genjtty(second_input,second_tones,second_symbols) + second_samples=second_symbols*nsps + second_start=max(1,nint(dt_b*12000.0)+1) + + total_samples=max(first_start+first_samples-1, & + second_start+second_samples-1)+frame_symbols*nsps + allocate(pcm(total_samples)) + pcm=0_int16 + + allocate(first_wave(first_samples),complex_wave(first_samples)) + call gen_jttywave(first_tones,first_symbols,nsps,2.0,12000.0,1500.0, & + complex_wave,first_wave,0,first_samples) + do i=1,first_samples + idx=first_start+i-1 + pcm_val=nint(14000.0*first_wave(i)) + pcm(idx)=int(max(-32767,min(32767,pcm_val)),int16) + enddo + deallocate(first_wave,complex_wave) + + allocate(second_wave(second_samples),complex_wave(second_samples)) + call gen_jttywave(second_tones,second_symbols,nsps,2.0,12000.0,1504.0, & + complex_wave,second_wave,0,second_samples) + do i=1,second_samples + idx=second_start+i-1 + pcm_val=nint(14000.0*second_wave(i)) + pcm(idx)=int(max(-32767,min(32767,pcm_val)),int16) + enddo + deallocate(second_wave,complex_wave) + end subroutine build_pair + + logical function found(message) + character(len=*), intent(in) :: message + integer :: i + found=.false. + do i=1,npending + if(trim(normalized(pending_updates(i)%decoded)).eq.trim(message)) found=.true. + enddo + end function found + + function decoded_text(message) result(text) + character(len=*), intent(in) :: message + character(len=80) :: text + integer :: i + text='' + do i=1,npending + if(trim(normalized(pending_updates(i)%decoded)).eq.trim(message)) & + text=normalized(pending_updates(i)%decoded) + enddo + end function decoded_text + + function normalized(value) result(result_value) + character(len=*), intent(in) :: value + character(len=80) :: result_value + integer :: i + result_value=adjustl(value) + do i=1,len_trim(result_value) + if(result_value(i:i).eq.'~') result_value(i:i)=' ' + enddo + end function normalized + + subroutine expect(condition,description,count) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + integer, intent(inout) :: count + if(.not.condition) then + count=count+1 + write(*,'(a)') 'FAIL: '//description + endif + end subroutine expect + +end program test_jtty_windowed_decode diff --git a/tests/unit/jtty/test_mmttyif.cpp b/tests/unit/jtty/test_mmttyif.cpp new file mode 100644 index 00000000..8333d6c9 --- /dev/null +++ b/tests/unit/jtty/test_mmttyif.cpp @@ -0,0 +1,265 @@ +#include + +#include + +#include +#include +#include +#include +#include + +#include "widgets/MMTTYIF.hpp" + +namespace +{ + int constexpr maximumHeaderBytes {64}; + int constexpr maximumPayloadBytes {64 * 1024}; +} + +class TestMMTTYIF final + : public QObject +{ + Q_OBJECT + +private slots: + void init () + { + server_.reset (new QTcpServer); + // MMTTYIF connects to 127.0.0.1 (IPv4). Bind the same family so Windows + // does not leave the server on ::1 while the client dials IPv4. + QVERIFY (server_->listen (QHostAddress {QStringLiteral ("127.0.0.1")}, 0)); + QCoreApplication::processEvents (); + + interface_.reset (new MMTTYIF); + interface_->initialize (server_->serverPort ()); + + QTRY_VERIFY_WITH_TIMEOUT (server_->hasPendingConnections (), 5000); + peer_ = server_->nextPendingConnection (); + QVERIFY (peer_); + QTRY_VERIFY_WITH_TIMEOUT (interface_->isConnected (), 5000); + } + + void cleanup () + { + interface_.reset (); + peer_ = nullptr; + server_.reset (); + QCoreApplication::processEvents (); + } + + void parsesFragmentedFrame () + { + QSignalSpy text {interface_.get (), &MMTTYIF::app_tx_string}; + + QVERIFY (writeToInterface ("HELLO")); + QTest::qWait (20); + QCOMPARE (text.count (), 0); + + QVERIFY (writeToInterface (" WORLD")); + QTRY_COMPARE_WITH_TIMEOUT (text.count (), 1, 1000); + QCOMPARE (text.at (0).at (0).toString (), QString {"HELLO WORLD"}); + } + + void dispatchesFragmentedTaggedTextBeforeStart () + { + QStringList events; + connect (interface_.get (), &MMTTYIF::app_tx_string, this, + [&events] (QString const& message) { events.append ("text:" + message); }); + connect (interface_.get (), &MMTTYIF::app_start_tx, this, + [&events] { events.append (QStringLiteral ("start")); }); + + QByteArray const payload {"[[JTTY:CALL_EXCH]] W9XYZ 7"}; + QByteArray frame {"ON")); + QTRY_COMPARE_WITH_TIMEOUT (events.size (), 2, 1000); + QCOMPARE (events.at (0), QStringLiteral ("text:[[JTTY:CALL_EXCH]] W9XYZ 7")); + QCOMPARE (events.at (1), QStringLiteral ("start")); + } + + void parsesCoalescedFrames () + { + QSignalSpy text {interface_.get (), &MMTTYIF::app_tx_string}; + QSignalSpy start {interface_.get (), &MMTTYIF::app_start_tx}; + + QVERIFY (writeToInterface ("ACON")); + + QTRY_COMPARE_WITH_TIMEOUT (text.count (), 1, 1000); + QTRY_COMPARE_WITH_TIMEOUT (start.count (), 1, 1000); + QCOMPARE (text.at (0).at (0).toString (), QString {"AC"}); + } + + void dispatchesControlCommands () + { + QSignalSpy stop {interface_.get (), &MMTTYIF::app_stop_tx}; + QSignalSpy abort {interface_.get (), &MMTTYIF::app_abort_tx}; + QSignalSpy close {interface_.get (), &MMTTYIF::app_is_quitting}; + + QVERIFY (writeToInterface ("OFFABORTCLOSE")); + + QTRY_COMPARE_WITH_TIMEOUT (stop.count (), 1, 1000); + QTRY_COMPARE_WITH_TIMEOUT (abort.count (), 1, 1000); + QTRY_COMPARE_WITH_TIMEOUT (close.count (), 1, 1000); + } + + void delaysOutputCompleteUntilDrainReport () + { + QSignalSpy stop {interface_.get (), &MMTTYIF::app_stop_tx}; + peer_->readAll (); + + QVERIFY (writeToInterface ("OFF")); + QTRY_COMPARE_WITH_TIMEOUT (stop.count (), 1, 1000); + QTest::qWait (20); + QCOMPARE (peer_->bytesAvailable (), qint64 {0}); + + interface_->report_output_complete (); + QTRY_VERIFY_WITH_TIMEOUT (peer_->bytesAvailable () > 0, 1000); + QCOMPARE (peer_->readAll (), QByteArray {""}); + } + + void parsesFragmentedImplicitControl () + { + QSignalSpy abort {interface_.get (), &MMTTYIF::app_abort_tx}; + QSignalSpy received {interface_.get (), &MMTTYIF::message_received}; + + QVERIFY (writeToInterface ("AB")); + QTRY_VERIFY_WITH_TIMEOUT (received.count () >= 1, 1000); + QCOMPARE (abort.count (), 0); + + QVERIFY (writeToInterface ("ORT")); + QTRY_COMPARE_WITH_TIMEOUT (abort.count (), 1, 1000); + } + + void recoversAfterInvalidLength () + { + QSignalSpy start {interface_.get (), &MMTTYIF::app_start_tx}; + QSignalSpy logs {interface_.get (), &MMTTYIF::log_message}; + + QVERIFY (writeToInterface ("ON")); + + QTRY_COMPARE_WITH_TIMEOUT (start.count (), 1, 1000); + QTRY_VERIFY_WITH_TIMEOUT (logs.count () >= 2, 1000); + } + + void acceptsMaximumDeclaredPayload () + { + QSignalSpy text {interface_.get (), &MMTTYIF::app_tx_string}; + QByteArray const payload (maximumPayloadBytes, 'a'); + QByteArray frame {"ON")); + + QTRY_COMPARE_WITH_TIMEOUT (start.count (), 1, 1000); + QTRY_VERIFY_WITH_TIMEOUT (hasLogContaining (logs, "payload length exceeds"), 1000); + } + + void rejectsOversizedUndeclaredPayload () + { + QSignalSpy start {interface_.get (), &MMTTYIF::app_start_tx}; + QSignalSpy abort {interface_.get (), &MMTTYIF::app_abort_tx}; + QSignalSpy logs {interface_.get (), &MMTTYIF::log_message}; + QSignalSpy received {interface_.get (), &MMTTYIF::message_received}; + + QByteArray firstFragment {""}; + firstFragment += QByteArray (maximumPayloadBytes / 2, 'A'); + QVERIFY (writeToInterface (firstFragment)); + QTRY_VERIFY_WITH_TIMEOUT (received.count () >= 1, 1000); + QCOMPARE (abort.count (), 0); + + QByteArray secondFragment (maximumPayloadBytes / 2 + 1, 'A'); + secondFragment += "ON"; + QVERIFY (writeToInterface (secondFragment)); + + QTRY_COMPARE_WITH_TIMEOUT (start.count (), 1, 2000); + QCOMPARE (abort.count (), 0); + QTRY_VERIFY_WITH_TIMEOUT (hasLogContaining (logs, "payload exceeds"), 1000); + } + + void rejectsOverlongIncompleteHeader () + { + QSignalSpy start {interface_.get (), &MMTTYIF::app_start_tx}; + QSignalSpy logs {interface_.get (), &MMTTYIF::log_message}; + + QByteArray header {"<"}; + header += QByteArray (maximumHeaderBytes, 'A'); + QVERIFY (writeToInterface (header)); + QTRY_VERIFY_WITH_TIMEOUT (hasLogContaining (logs, "header exceeds"), 1000); + + QVERIFY (writeToInterface ("ON")); + QTRY_COMPARE_WITH_TIMEOUT (start.count (), 1, 1000); + } + + void rejectsOverlongTerminatedHeader () + { + QSignalSpy start {interface_.get (), &MMTTYIF::app_start_tx}; + QSignalSpy logs {interface_.get (), &MMTTYIF::log_message}; + + QByteArray header {"<"}; + header += QByteArray (maximumHeaderBytes - 1, 'A'); + header += '>'; + QVERIFY (writeToInterface (header)); + QTRY_VERIFY_WITH_TIMEOUT (hasLogContaining (logs, "header exceeds"), 1000); + + QVERIFY (writeToInterface ("ON")); + QTRY_COMPARE_WITH_TIMEOUT (start.count (), 1, 1000); + } + +private: + static bool hasLogContaining (QSignalSpy const& logs, QString const& text) + { + for (auto const& arguments : logs) { + if (arguments.at (0).toString ().contains (text)) return true; + } + return false; + } + + bool writeToInterface (QByteArray const& data) + { + if (!peer_ || peer_->write (data) != data.size ()) return false; + return !peer_->bytesToWrite () || peer_->waitForBytesWritten (1000); + } + + std::unique_ptr server_; + std::unique_ptr interface_; + QTcpSocket * peer_ {nullptr}; +}; + +QTEST_GUILESS_MAIN (TestMMTTYIF) + +#include "test_mmttyif.moc" diff --git a/tests/unit/jtty/test_tbcc.f90 b/tests/unit/jtty/test_tbcc.f90 new file mode 100644 index 00000000..97fe50d1 --- /dev/null +++ b/tests/unit/jtty/test_tbcc.f90 @@ -0,0 +1,141 @@ +program test_tbcc + + ! Transition invariants across supported memories and JTTY candidate acceptance. + + use, intrinsic :: iso_fortran_env, only: real32, int32 + use tbcc + implicit none + + call expect_incoming_tones() + call expect_empty_and_tied_candidates() + call expect_encode_decode_roundtrip() + call expect_reserved_zero_bit_filters_candidates() + + print *, 'test_tbcc: all checks passed' + +contains + + subroutine expect_incoming_tones() + integer, parameter :: memories(5) = [9, 12, 10, 11, 9] + integer, parameter :: gray_tones(0:3) = [0, 1, 3, 2] + integer :: n, predecessor, bit, destination, register_value, expected + + do n = 1, size(memories) + call tbcc_init(memories(n)) + if (size(incoming_tones, 2) /= num_states) error stop 'incorrect transition table size' + do predecessor = 0, num_states-1 + do bit = 0, 1 + register_value = 2*predecessor + bit + destination = mod(register_value, num_states) + expected = gray_tones(2*mod(popcnt(iand(register_value, g0_poly)), 2) + & + mod(popcnt(iand(register_value, g1_poly)), 2)) + if (incoming_tones(predecessor/(num_states/2), destination) /= expected) & + error stop 'incoming tone differs from encoder polynomial parity' + end do + end do + end do + end subroutine expect_incoming_tones + + subroutine expect_empty_and_tied_candidates() + integer :: decoded(PAYLOAD_BITS) + real(real32) :: energies(0:3, TOTAL_K) + logical :: success + + call tbcc_init(9) + energies = 1.0_real32 + call tbcc_wava_fsk_decode(energies, 0, 2, decoded, success) + if (success .or. any(decoded /= 0)) error stop 'empty candidate list must fail cleanly' + + ! Equal branch metrics select the all-one circular path, which fails CRC. + call tbcc_wava_fsk_decode(energies, 4, 2, decoded, success) + if (success .or. any(decoded /= 0)) error stop 'tied candidate CRC rejection changed' + end subroutine expect_empty_and_tied_candidates + + subroutine expect_encode_decode_roundtrip() + integer(int32) :: payload(PAYLOAD_BITS), decoded(PAYLOAD_BITS) + integer(int32) :: tone_symbols(TOTAL_K) + real(real32) :: tone_energies(0:3, TOTAL_K) + logical :: success + integer :: i, t + + call tbcc_init(9) + + do i = 1, PAYLOAD_BITS + payload(i) = mod(i, 2) ! deterministic, not all-zero + end do + + call tbcc_encode(payload, tone_symbols) + + ! Noiseless channel: all of a symbol's energy on the transmitted tone. + tone_energies = 0.0_real32 + do t = 1, TOTAL_K + tone_energies(tone_symbols(t), t) = 1.0_real32 + end do + + call tbcc_wava_fsk_decode(tone_energies, 4, 2, decoded, success) + if (.not. success) then + print *, 'test_tbcc: noiseless decode failed' + error stop 1 + end if + if (any(decoded /= payload)) then + print *, 'test_tbcc: noiseless decode mismatch' + error stop 1 + end if + end subroutine expect_encode_decode_roundtrip + + subroutine expect_reserved_zero_bit_filters_candidates() + integer(int32) :: payload(PAYLOAD_BITS), decoded(PAYLOAD_BITS) + integer(int32) :: tone_symbols(TOTAL_K) + real(real32) :: tone_energies(0:3, TOTAL_K) + logical :: success + integer :: i, t, one_bit_pos + + call tbcc_init(9) + + do i = 1, PAYLOAD_BITS + payload(i) = mod(i, 2) + end do + ! A payload-bit position this payload sets to 1, so requiring it to be + ! 0 must reject this exact (otherwise noiseless-decodable) codeword. + one_bit_pos = 0 + do i = 1, PAYLOAD_BITS + if (payload(i) == 1) then + one_bit_pos = i + exit + end if + end do + if (one_bit_pos == 0) then + print *, 'test_tbcc: test payload unexpectedly all-zero' + error stop 1 + end if + + call tbcc_encode(payload, tone_symbols) + tone_energies = 0.0_real32 + do t = 1, TOTAL_K + tone_energies(tone_symbols(t), t) = 1.0_real32 + end do + + ! Control case: no reserved_zero_bit, decode succeeds as above. + call tbcc_wava_fsk_decode(tone_energies, 4, 2, decoded, success) + if (.not. success) then + print *, 'test_tbcc: control decode (no reserved_zero_bit) failed' + error stop 1 + end if + + ! With the filter on a bit this payload actually sets to 1, the only + ! codeword consistent with these noiseless tone energies fails the + ! filter, so decoding must now report failure. + decoded = huge(0_int32) + call tbcc_wava_fsk_decode(tone_energies, 4, 2, decoded, success, & + reserved_zero_bit=one_bit_pos) + if (success) then + print *, 'test_tbcc: reserved_zero_bit did not filter the candidate' + error stop 1 + end if + if (any(decoded /= 0_int32)) then + print *, 'test_tbcc: failed decode did not clear its payload' + error stop 1 + end if + end subroutine expect_reserved_zero_bit_filters_candidates + +end program test_tbcc diff --git a/tests/unit/legacy72/CMakeLists.txt b/tests/unit/legacy72/CMakeLists.txt new file mode 100644 index 00000000..10f31905 --- /dev/null +++ b/tests/unit/legacy72/CMakeLists.txt @@ -0,0 +1,5 @@ +add_executable (test_packjt_legacy72 test_packjt_legacy72.f90) +target_include_directories (test_packjt_legacy72 PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_packjt_legacy72) + +add_test (NAME test_packjt_legacy72 COMMAND test_packjt_legacy72) diff --git a/tests/unit/legacy72/test_packjt_legacy72.f90 b/tests/unit/legacy72/test_packjt_legacy72.f90 new file mode 100644 index 00000000..abf118c2 --- /dev/null +++ b/tests/unit/legacy72/test_packjt_legacy72.f90 @@ -0,0 +1,107 @@ +program test_packjt_legacy72 + + use packjt, only: packmsg, unpackmsg + implicit none + + integer :: ntests + + ntests=0 + call expect_control_suffix_falls_back(ntests) + call expect_type2_suffix_round_trip(ntests) + call expect_rr73_is_encoded_as_grid(ntests) + + write(*,1000) ntests +1000 format('Legacy 72-bit codec tests passed: ',i0) + +contains + + subroutine expect_control_suffix_falls_back(ntests) + integer, intent(inout) :: ntests + character(len=22) :: decoded,message + integer :: itype,symbols(12) + + message=' ' + message(1:1)='/' + message(2:2)=achar(1) + + call packmsg(message,symbols,itype) + call unpackmsg(symbols,decoded) + + if(itype.ne.6) then + write(*,1010) itype +1010 format('Control suffix returned type ',i0,' instead of free text') + error stop 1 + endif + if(any(symbols.lt.0) .or. any(symbols.gt.63)) then + write(*,1020) +1020 format('Control suffix produced an out-of-range symbol') + error stop 1 + endif + if(trim(decoded).ne.'/') then + write(*,1030) trim(decoded) +1030 format('Control suffix decoded as "',a,'" instead of "/"') + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_control_suffix_falls_back + + subroutine expect_type2_suffix_round_trip(ntests) + integer, intent(inout) :: ntests + character(len=*), parameter :: expected='CQ KA1ABC/VE6 -22' + character(len=22) :: decoded,message + integer :: itype,symbols(12) + + message=expected + call packmsg(message,symbols,itype) + call unpackmsg(symbols,decoded) + + if(itype.ne.5) then + write(*,1040) itype +1040 format('Type 2 suffix returned type ',i0,' instead of 5') + error stop 1 + endif + if(any(symbols.lt.0) .or. any(symbols.gt.63)) then + write(*,1050) +1050 format('Type 2 suffix produced an out-of-range symbol') + error stop 1 + endif + if(trim(decoded).ne.expected) then + write(*,1060) trim(decoded),expected +1060 format('Type 2 suffix decoded as "',a,'" instead of "',a,'"') + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_type2_suffix_round_trip + + subroutine expect_rr73_is_encoded_as_grid(ntests) + integer, intent(inout) :: ntests + character(len=*), parameter :: expected='K1ABC W9XYZ RR73' + character(len=22) :: decoded,message + integer :: itype,symbols(12) + + message=expected + call packmsg(message,symbols,itype) + call unpackmsg(symbols,decoded) + + if(itype.ne.1) then + write(*,1070) itype +1070 format('RR73 returned type ',i0,' instead of a standard message') + error stop 1 + endif + if(any(symbols.lt.0) .or. any(symbols.gt.63)) then + write(*,1080) +1080 format('RR73 produced an out-of-range symbol') + error stop 1 + endif + if(trim(decoded).ne.expected) then + write(*,1090) trim(decoded),expected +1090 format('RR73 decoded as "',a,'" instead of "',a,'"') + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_rr73_is_encoded_as_grid + +end program test_packjt_legacy72 diff --git a/tests/unit/logbook/CMakeLists.txt b/tests/unit/logbook/CMakeLists.txt new file mode 100644 index 00000000..611136de --- /dev/null +++ b/tests/unit/logbook/CMakeLists.txt @@ -0,0 +1,10 @@ +add_executable (test_logbook_adif + test_logbook_adif.cpp + ${CMAKE_SOURCE_DIR}/logbook/AdifQso.cpp +) +target_link_libraries (test_logbook_adif Qt5::Test) +add_test (NAME test_logbook_adif COMMAND test_logbook_adif) + +add_executable (test_worked_before_load_state test_worked_before_load_state.cpp) +target_link_libraries (test_worked_before_load_state Qt5::Test) +add_test (NAME test_worked_before_load_state COMMAND test_worked_before_load_state) diff --git a/tests/unit/logbook/test_logbook_adif.cpp b/tests/unit/logbook/test_logbook_adif.cpp new file mode 100644 index 00000000..36878226 --- /dev/null +++ b/tests/unit/logbook/test_logbook_adif.cpp @@ -0,0 +1,254 @@ +#include +#include +#include +#include + +#include "logbook/AdifQso.hpp" + +namespace +{ + //! QSO inputs for AdifQso::to_adif with sensible defaults; tests override + //! only the fields they exercise. + struct Qso + { + QString call = "K1ABC"; + QString grid = "FN42"; + QString mode = "FT8"; + QString rptSent = "-10"; + QString rptRcvd = "-12"; + QDateTime on = QDateTime (QDate (2024, 1, 2), QTime (3, 4, 5), Qt::UTC); + QDateTime off = QDateTime (QDate (2024, 1, 2), QTime (3, 5, 6), Qt::UTC); + QString band = "20m"; + QString comments; + QString name; + QString freq = "14.074000"; + QString myCall = "W1AW"; + QString myGrid = "FN31"; + QString txPower; + QString op; + QString xSent; + QString xRcvd; + QString prop; + QString sat; + QString satMode; + QString freqRx; + AdifQso::Contest contest = AdifQso::Contest::None; + }; + + QByteArray run (Qso const& q) + { + return AdifQso::to_adif (q.call, q.grid, q.mode, q.rptSent, q.rptRcvd, q.on, q.off, + q.band, q.comments, q.name, q.freq, q.myCall, q.myGrid, + q.txPower, q.op, q.xSent, q.xRcvd, q.prop, q.sat, q.satMode, + q.freqRx, q.contest); + } +} + +#define VERIFY_HAS(rec, sub) \ + QVERIFY2 ((rec).contains (QByteArray (sub)), \ + qPrintable (QStringLiteral ("missing \"%1\" in: %2") \ + .arg (QString::fromUtf8 (QByteArray (sub))) \ + .arg (QString::fromUtf8 (rec)))) + +#define VERIFY_LACKS(rec, sub) \ + QVERIFY2 (!(rec).contains (QByteArray (sub)), \ + qPrintable (QStringLiteral ("unexpected \"%1\" in: %2") \ + .arg (QString::fromUtf8 (QByteArray (sub))) \ + .arg (QString::fromUtf8 (rec)))) + +class TestLogbookAdif : public QObject +{ + Q_OBJECT + +private slots: + void record_structure () + { + auto r = run (Qso {}); + QVERIFY2 (r.startsWith ("K1ABC"), r.constData ()); // no leading space on first field + VERIFY_HAS (r, "FN42"); + VERIFY_HAS (r, "FT8"); + VERIFY_HAS (r, "-10"); + VERIFY_HAS (r, "-12"); + VERIFY_HAS (r, "20240102"); + VERIFY_HAS (r, "030405"); + VERIFY_HAS (r, "20240102"); + VERIFY_HAS (r, "030506"); + VERIFY_HAS (r, "20m"); + VERIFY_HAS (r, "14.074000"); + VERIFY_HAS (r, "W1AW"); + VERIFY_HAS (r, "FN31"); + VERIFY_LACKS (r, ""); // terminator is the caller's responsibility + } + + void mfsk_modes_use_submode () + { + Qso q; q.mode = "FT4"; + VERIFY_HAS (run (q), "MFSK FT4"); + q.mode = "FST4"; + VERIFY_HAS (run (q), "MFSK FST4"); + q.mode = "Q65"; + VERIFY_HAS (run (q), "MFSK Q65"); + } + + void empty_gridsquare_still_emitted () + { + Qso q; q.grid = ""; + VERIFY_HAS (run (q), ""); + } + + void empty_optionals_omitted () + { + auto r = run (Qso {}); // comments/name/op/txPower/prop/sat all empty by default + VERIFY_LACKS (r, "M?ller ?"); + VERIFY_HAS (r, "Jos?"); + for (auto ch : r) + { + QVERIFY2 (ch >= ' ' && ch <= '~', r.constData ()); + } + } + + void free_text_delimiters_stripped () + { + Qso q; + q.comments = "hello there"; // 15 chars after removing '<' and '>' + q.name = "a>bhello eor there"); + VERIFY_HAS (r, "abc"); + VERIFY_LACKS (r, ""); + } + + void structured_field_delimiters_stripped () + { + Qso q; + q.call = ""; + q.grid = ""; + auto r = run (q); + VERIFY_HAS (r, "K1ABC"); + VERIFY_HAS (r, "FN42"); + VERIFY_LACKS (r, ""); + VERIFY_LACKS (r, ""); + } + + void sent_serial_exchange () + { + Qso q; q.xSent = "599 001"; + VERIFY_HAS (run (q), "001"); + } + + void sent_non_serial_exchange_kept () + { + Qso q; q.xSent = "2A NC"; q.contest = AdifQso::Contest::FieldDay; + VERIFY_HAS (run (q), "2A NC"); + } + + void sent_exchange_delimiters_stripped () + { + Qso q; q.xSent = "2A NC"; + auto r = run (q); + VERIFY_HAS (r, "2A eor NC"); + VERIFY_LACKS (r, ""); + } + + void sent_unknown_multiword_numeric_exchange_kept_as_string () + { + Qso q; q.xSent = "ABC DEF 123"; + auto r = run (q); + VERIFY_HAS (r, "ABC DEF 123"); + VERIFY_LACKS (r, "59123 JN88 EXTRA"); + VERIFY_LACKS (r, "042"); + } + + void received_eu_vhf_strips_report () + { + Qso q; q.xRcvd = "59123 JN88"; // report 59 + serial 123 + VERIFY_HAS (run (q), "123"); + } + + void received_field_day_exchange () + { + Qso q; q.xRcvd = "2A NC"; q.contest = AdifQso::Contest::FieldDay; + auto r = run (q); + VERIFY_HAS (r, "ARRL-FIELD-DAY"); + VERIFY_HAS (r, "2A NC"); + VERIFY_HAS (r, "2A"); + VERIFY_HAS (r, "NC"); + } + + void received_rtty_state () + { + Qso q; q.xRcvd = "599 MA"; q.contest = AdifQso::Contest::Rtty; + VERIFY_HAS (run (q), "MA"); + } + + void received_multiword_exchange_kept () + { + Qso q; q.xRcvd = "59 123 JN88"; + VERIFY_HAS (run (q), "59 123 JN88"); + VERIFY_LACKS (run (q), "ABC eor DEF"); + VERIFY_LACKS (r, ""); + } + + void received_unknown_multiword_numeric_exchange_kept_as_string () + { + Qso q; q.xRcvd = "ABC DEF 123"; + auto r = run (q); + VERIFY_HAS (r, "ABC DEF 123"); + VERIFY_LACKS (r, "59123 JN88 EXTRA"); + VERIFY_LACKS (r, " + +#include "logbook/WorkedBeforeLoadState.hpp" + +class TestWorkedBeforeLoadState final : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void starts_first_reload (); + void coalesces_repeated_reload_requests (); + void keeps_completion_active_for_reentrant_reload (); + void starts_a_fresh_reload_after_idle (); +}; + +void TestWorkedBeforeLoadState::starts_first_reload () +{ + WorkedBeforeLoadState state; + + QCOMPARE (state.request_reload (), WorkedBeforeLoadState::ReloadResult::Start); + QVERIFY (state.active ()); +} + +void TestWorkedBeforeLoadState::coalesces_repeated_reload_requests () +{ + WorkedBeforeLoadState state; + + QCOMPARE (state.request_reload (), WorkedBeforeLoadState::ReloadResult::Start); + QCOMPARE (state.request_reload (), WorkedBeforeLoadState::ReloadResult::Coalesced); + QCOMPARE (state.request_reload (), WorkedBeforeLoadState::ReloadResult::Coalesced); + + state.begin_completion (); + QCOMPARE (state.finish_completion (), WorkedBeforeLoadState::CompletionResult::Restart); + QVERIFY (state.active ()); + + state.begin_completion (); + QCOMPARE (state.finish_completion (), WorkedBeforeLoadState::CompletionResult::Idle); + QVERIFY (!state.active ()); +} + +void TestWorkedBeforeLoadState::keeps_completion_active_for_reentrant_reload () +{ + WorkedBeforeLoadState state; + + QCOMPARE (state.request_reload (), WorkedBeforeLoadState::ReloadResult::Start); + state.begin_completion (); + QVERIFY (state.active ()); + + QCOMPARE (state.request_reload (), WorkedBeforeLoadState::ReloadResult::Coalesced); + QCOMPARE (state.finish_completion (), WorkedBeforeLoadState::CompletionResult::Restart); + QVERIFY (state.active ()); +} + +void TestWorkedBeforeLoadState::starts_a_fresh_reload_after_idle () +{ + WorkedBeforeLoadState state; + + QCOMPARE (state.request_reload (), WorkedBeforeLoadState::ReloadResult::Start); + state.begin_completion (); + QCOMPARE (state.finish_completion (), WorkedBeforeLoadState::CompletionResult::Idle); + QVERIFY (!state.active ()); + + QCOMPARE (state.request_reload (), WorkedBeforeLoadState::ReloadResult::Start); + QVERIFY (state.active ()); +} + +QTEST_GUILESS_MAIN (TestWorkedBeforeLoadState) + +#include "test_worked_before_load_state.moc" diff --git a/tests/unit/map65/CMakeLists.txt b/tests/unit/map65/CMakeLists.txt new file mode 100644 index 00000000..88064d64 --- /dev/null +++ b/tests/unit/map65/CMakeLists.txt @@ -0,0 +1,22 @@ +add_executable (test_map65_decode_display_filter + test_map65_decode_display_filter.cpp + ${CMAKE_SOURCE_DIR}/map65/map65_decode_display_filter.cpp +) +target_include_directories (test_map65_decode_display_filter PRIVATE ${CMAKE_SOURCE_DIR}/map65) +target_link_libraries (test_map65_decode_display_filter Qt5::Test) +add_test (NAME test_map65_decode_display_filter COMMAND test_map65_decode_display_filter) + +add_executable (test_map65_half_symbol_scheduler + test_map65_half_symbol_scheduler.cpp +) +target_include_directories (test_map65_half_symbol_scheduler PRIVATE ${CMAKE_SOURCE_DIR}/map65) +target_link_libraries (test_map65_half_symbol_scheduler Qt5::Test) +add_test (NAME test_map65_half_symbol_scheduler COMMAND test_map65_half_symbol_scheduler) + +add_executable (test_map65_runtime_paths + test_map65_runtime_paths.cpp + ${CMAKE_SOURCE_DIR}/map65/runtime_paths.cpp +) +target_include_directories (test_map65_runtime_paths PRIVATE ${CMAKE_SOURCE_DIR}/map65) +target_link_libraries (test_map65_runtime_paths Qt5::Test) +add_test (NAME test_map65_runtime_paths COMMAND test_map65_runtime_paths) diff --git a/tests/unit/map65/decode_history/CMakeLists.txt b/tests/unit/map65/decode_history/CMakeLists.txt new file mode 100644 index 00000000..6c8dc65d --- /dev/null +++ b/tests/unit/map65/decode_history/CMakeLists.txt @@ -0,0 +1,18 @@ +# Compile the production control flow against deterministic DSP boundaries. +# Keep replacement module files out of the production module directory. +add_executable (test_map65_decode_history + decode_history_stubs.f90 + test_map65_decode_history.f90 + ${CMAKE_SOURCE_DIR}/map65/libm65/map65a.f90 + ${CMAKE_SOURCE_DIR}/map65/libm65/getdphi.f90) +target_include_directories (test_map65_decode_history BEFORE PRIVATE + ${CMAKE_CURRENT_BINARY_DIR} + ${PROJECT_BINARY_DIR}/map65/libm65) +target_link_libraries (test_map65_decode_history PRIVATE m65impl) +target_compile_options (test_map65_decode_history PRIVATE + $<$:-fcheck=bounds>) +set_source_files_properties (decode_history_stubs.f90 PROPERTIES + COMPILE_OPTIONS "$<$:-Wno-unused-dummy-argument>") +add_test (NAME test_map65_decode_history COMMAND test_map65_decode_history) +set_tests_properties (test_map65_decode_history PROPERTIES + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} TIMEOUT 30) diff --git a/tests/unit/map65/decode_history/decode_history_stubs.f90 b/tests/unit/map65/decode_history/decode_history_stubs.f90 new file mode 100644 index 00000000..9582e19a --- /dev/null +++ b/tests/unit/map65/decode_history/decode_history_stubs.f90 @@ -0,0 +1,159 @@ +! These stand-ins supply one successful signal per mode. The production +! map65a loop owns all JT65 suppression and both modes' history resets. +module decode_history_observations + implicit none + integer :: jt65_attempts = 0, q65_successes = 0 + integer :: phase_attempts(0:12) = 0 + integer :: summary_count = 0, fitted_phase = -999 + logical :: phase_has_signal(0:12) = .true. +end module + +module stdout_channel_mod + use decode_history_observations + implicit none +contains + subroutine write_stdout(line) + character(len=*), intent(in) :: line + if (index(line, '!Best-fit Dphi =') == 1) then + summary_count = summary_count + 1 + read(line(index(line, '=')+1:), *) fitted_phase + endif + end subroutine +end module + +module wideband_sync + implicit none + integer, parameter :: MAX_CANDIDATES = 50 + integer :: nkhz_center + type candidate + real :: snr, f, xdt, pol + integer :: ipol, iflip, indx + end type +contains + subroutine init_wideband_sync() + end subroutine + + subroutine get_candidates(ss, savg, xpol, jz, nfa, nfb, nts_jt65, nts_q65, cand, ncand) + use npar_ptrs_mod, only: nfft_active + real, intent(in) :: ss(4,322,nfft_active), savg(4,nfft_active) + logical, intent(in) :: xpol + integer, intent(in) :: jz, nfa, nfb, nts_jt65, nts_q65 + type(candidate), intent(out) :: cand(MAX_CANDIDATES) + integer, intent(out) :: ncand + ncand = 1 + ! With nfcal=-1270, this places the Q65 signal at the zero-kHz cursor. + cand(1) = candidate(10.0, 48.00046, 0.0, 0.0, 1, 0, 1) + end subroutine +end module + +module ccf65_legacy_mod + implicit none +contains + subroutine ccf65(ss_plane, nhsym, ssmax, sync1, ipol1, jpz, dt1, flipk, & + syncshort, snr2, ipol2, dt2) + real, intent(in) :: ss_plane(4,322), ssmax + integer, intent(in) :: nhsym, jpz + real, intent(out) :: sync1, dt1, flipk, syncshort, snr2, dt2 + integer, intent(out) :: ipol1, ipol2 + sync1 = 10.0 + dt1 = 0.0 + flipk = 1.0 + syncshort = -99.0 + snr2 = 0.0 + dt2 = 0.0 + ipol1 = 1 + ipol2 = 1 + end subroutine +end module + +module decode1a_mod + use iso_fortran_env, only: real64 + use decode_history_observations + implicit none +contains + subroutine decode1a(dd,newdat,f0,nflip,mode65,nfsample,xpol, & + mycall,hiscall,hisgrid,neme,ndepth,nqd,dphi,ndphi, & + nutc,nkhz,ndf,ipol,ntol,sync2,a,dt,pol,nkv,nhist,nsum,nsave,qual,decoded) + use npar_ptrs_mod, only: nsmax_active + real, intent(in) :: dd(4,nsmax_active), dphi + real(real64), intent(in) :: f0 + integer, intent(in) :: nflip, mode65, nfsample, neme, ndepth, nqd, ndphi, nutc, nkhz, ndf, ntol + logical, intent(in) :: xpol + character(len=12), intent(in) :: mycall, hiscall + character(len=6), intent(in) :: hisgrid + integer, intent(inout) :: newdat, ipol, nkv, nhist, nsum, nsave + real, intent(inout) :: sync2, a(5), dt, pol, qual + character(len=22), intent(out) :: decoded + integer :: trial + newdat = 0 + decoded = ' ' + if (mode65 == 0) return + jt65_attempts = jt65_attempts + 1 + trial = nint(dphi * 57.2957795 / 30.0) + if (ndphi == 1) then + phase_attempts(trial) = phase_attempts(trial) + 1 + if (.not. phase_has_signal(trial)) return + endif + decoded = 'K1ABC W9XYZ FN42' + sync2 = 100.0 + a = 0.0 + dt = 0.0 + pol = 0.0 + qual = 5.0 + 4.0*sin(dphi) + nkv = 1 + nhist = 0 + nsum = 0 + nsave = 0 + ipol = 1 + end subroutine +end module + +module q65b_mod + use iso_fortran_env, only: real64 + use decode_history_observations + implicit none +contains + subroutine q65b(nutc,nqd,nxant,fcenter,nfcal,nfsample,ikhz,mousedf,ntol,xpol,configured_dphi_deg, & + mycall,mygrid,hiscall,hisgrid,mode_q65,f0,fqso,newdat,nagain,max_drift,ndop00,idec,cursor_fallback) + use decodes_mod, only: ldecoded + use q65_decode, only: nsnr0 + integer, intent(in) :: nutc,nqd,nxant,nfcal,nfsample,ikhz,mousedf,ntol,mode_q65 + integer, intent(in) :: newdat,nagain,max_drift,ndop00,configured_dphi_deg + real(real64), intent(in) :: fcenter,f0 + real, intent(in) :: fqso + logical, intent(in) :: xpol + logical, optional, intent(in) :: cursor_fallback + character(len=12), intent(in) :: mycall,hiscall + character(len=6), intent(in) :: mygrid,hisgrid + integer, intent(out) :: idec + nsnr0 = -99 + idec = -1 + ! Model q65b's successful-bin guard, not its signal processing. This + ! observes whether the caller retained or discarded the Q65 history. + if (ldecoded(1)) return + ldecoded(1) = .true. + q65_successes = q65_successes + 1 + nsnr0 = -10 + idec = 1 + end subroutine +end module + +module display_mod + implicit none +contains + subroutine display(nkeep, ftol) + integer, intent(in) :: nkeep + real, intent(in) :: ftol + end subroutine +end module + +module sec0_mod + implicit none +contains + subroutine sec0(mode, t) + integer, intent(in) :: mode + real, intent(out) :: t + ! The tests cover state transitions, not elapsed-time abort policy. + t = 0.0 + end subroutine +end module diff --git a/tests/unit/map65/decode_history/test_map65_decode_history.f90 b/tests/unit/map65/decode_history/test_map65_decode_history.f90 new file mode 100644 index 00000000..eb5ce18c --- /dev/null +++ b/tests/unit/map65/decode_history/test_map65_decode_history.f90 @@ -0,0 +1,90 @@ +program test_map65_decode_history + use iso_fortran_env, only: real64 + use npar_ptrs_mod, only: nfft_active, nsmax_active, t_start, manualDecodeFlag, active_input_generation + use datcom_ptrs_mod, only: ss_old, savg_old + use decodes_mod, only: nhsym1, nhsym2 + use map65a_mod, only: map65a + use decode_history_observations + implicit none + real, allocatable :: samples(:,:) + integer :: unit, before_jt65, before_q65 + + ! Only the center bin has signal power; DSP stand-ins never read samples. + nfft_active = 1024 + nsmax_active = 1 + allocate(samples(4,nsmax_active), ss_old(4,322,nfft_active), savg_old(4,nfft_active)) + samples = 0.0 + ss_old = 1.0 + savg_old = 1.0 + savg_old(1,nfft_active/2+1) = 10.0 + nhsym1 = 280 + nhsym2 = 302 + manualDecodeFlag = 0 + do unit = 12, 27 + open(unit, status='scratch') + enddo + close(23) + + active_input_generation = 1 + call run_pass(nhsym1, 0, 0) + call require(jt65_attempts == 1 .and. q65_successes == 1, 'early pass decodes both signals') + call run_pass(nhsym2, 0, 0) + call require(jt65_attempts == 1 .and. q65_successes == 1, 'final pass retains early successes') + + jt65_attempts = 0 + q65_successes = 0 + call run_pass(nhsym2, 1, 1) + call require(all(phase_attempts == 1), 'each JT65 trial remains eligible after an earlier success') + call require(jt65_attempts == 13, 'JT65 runs once per trial, without replaying prior successes') + call require(q65_successes == 1, 'unchanged Q65 input is decoded once across phase trials') + call require(summary_count == 1 .and. fitted_phase == 90, 'later better trials determine the fitted phase') + + ! A second calibration must not inherit quality scores from the first. + phase_has_signal = .false. + phase_has_signal(6) = .true. + phase_attempts = 0 + call run_pass(nhsym2, 1, 1) + call require(all(phase_attempts == 1), 'unsuccessful trials remain eligible in a new calibration') + call require(summary_count == 2 .and. abs(fitted_phase) == 180, 'missing trials do not retain old quality scores') + + before_jt65 = jt65_attempts + before_q65 = q65_successes + active_input_generation = 2 + call run_pass(nhsym1, 0, 0) + call require(jt65_attempts == before_jt65+1 .and. q65_successes == before_q65+1, & + 'next receive period makes both frequencies eligible') + active_input_generation = 3 + call run_pass(nhsym1, 0, 0) + call require(jt65_attempts == before_jt65+2 .and. q65_successes == before_q65+2, & + 'next early pass resets history even without a preceding final pass') + call run_pass(nhsym2, 0, 0) + call require(jt65_attempts == before_jt65+2 .and. q65_successes == before_q65+2, & + 'final pass retains successes after a skipped-period boundary') + print '(a)', 'MAP65 decode history tests passed.' + +contains + subroutine run_pass(half_symbols, again, find_phase) + integer, intent(in) :: half_symbols, again, find_phase + integer :: newdat, utc, done, ndphi, mcall3b, nsum, nsave + newdat = 1 + utc = 1200 + int(active_input_generation) + done = 0 + ndphi = find_phase + mcall3b = 0 + nsum = 0 + nsave = 0 + call system_clock(t_start) + call map65a(samples,newdat,utc,144.0_real64,100,0,0,0,0,0,again,done,0,ndphi,0, & + -1270,20,mcall3b,nsum,nsave,0,'K1ABC ','FN42 ',0,3,0, & + 'W9XYZ ','EN50 ',half_symbols,96000,0,1,11,0) + end subroutine + + subroutine require(condition, description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + if (.not. condition) then + print '(a)', 'FAIL: '//description + error stop 1 + endif + end subroutine +end program diff --git a/tests/unit/map65/test_map65_astro.f90 b/tests/unit/map65/test_map65_astro.f90 new file mode 100644 index 00000000..275106d7 --- /dev/null +++ b/tests/unit/map65/test_map65_astro.f90 @@ -0,0 +1,62 @@ +program test_map65_astro + use iso_fortran_env, only: real64 + use astro_mod, only: astro, nt144 + implicit none + + integer :: ntsky_144, ntsky_1296 + real :: db_moon_144, degradation_144 + real :: db_moon_1296, degradation_1296 + real(real64) :: expected_tsky, expected_degradation + + call run_astro(144, ntsky_144, db_moon_144, degradation_144) + call require(any(int(nt144) == ntsky_144), & + '144 MHz sky temperature comes from the lookup table') + + call run_astro(1296, ntsky_1296, db_moon_1296, degradation_1296) + expected_tsky = (real(ntsky_144, real64) - 2.7_real64) * & + (144.0_real64 / 1296.0_real64)**2.6_real64 + 2.7_real64 + call require(ntsky_1296 == nint(expected_tsky), & + 'sky temperature scales from 144 MHz to the selected band') + + expected_degradation = -10.0_real64 * log10( & + (real(ntsky_144, real64) + 80.0_real64) / & + (13.0_real64 * (408.0_real64 / 144.0_real64)**2.6_real64 + 80.0_real64)) + & + real(db_moon_144, real64) + call require(abs(real(degradation_144, real64) - expected_degradation) < 1.0e-4_real64, & + 'degradation uses the cold-sky temperature for the selected band') + + print '(a)', 'MAP65 Astro tests passed.' + +contains + + subroutine run_astro(frequency_mhz, ntsky, db_moon, degradation) + integer, intent(in) :: frequency_mhz + integer, intent(out) :: ntsky + real, intent(out) :: db_moon, degradation + real :: az_sun, el_sun, az_moon, el_moon + real :: doppler00, doppler, ra_moon, dec_moon, hour_angle + real :: semidiameter, polarization_offset, nonreciprocal_loss + real :: day, longitude, latitude, local_sidereal_time + + call astro(2025, 1, 15, 12.0, frequency_mhz, 'FN20rx', 2, 0.0, & + az_sun, el_sun, az_moon, el_moon, ntsky, doppler00, doppler, & + db_moon, ra_moon, dec_moon, hour_angle, degradation, semidiameter, & + polarization_offset, nonreciprocal_loss, day, longitude, latitude, & + local_sidereal_time) + call astro(2025, 1, 15, 12.0, frequency_mhz, 'FN20rx', 1, 0.0, & + az_sun, el_sun, az_moon, el_moon, ntsky, doppler00, doppler, & + db_moon, ra_moon, dec_moon, hour_angle, degradation, semidiameter, & + polarization_offset, nonreciprocal_loss, day, longitude, latitude, & + local_sidereal_time) + end subroutine run_astro + + subroutine require(condition, description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + + if (.not. condition) then + print '(a)', 'FAIL: '//description + error stop 1 + end if + end subroutine require +end program test_map65_astro diff --git a/tests/unit/map65/test_map65_decode_display_filter.cpp b/tests/unit/map65/test_map65_decode_display_filter.cpp new file mode 100644 index 00000000..ad7ec1e1 --- /dev/null +++ b/tests/unit/map65/test_map65_decode_display_filter.cpp @@ -0,0 +1,94 @@ +#include "map65_decode_display_filter.h" + +#include + +namespace +{ +QString jt65Line(int frequencyHz, int utc, QString const& message) +{ + QByteArray const text = message.leftJustified(22, ' ').toLatin1(); + return QString::asprintf("%3d%5d%4d%6.4d%5.1f%5d # %-22s", + frequencyHz / 1000, frequencyHz % 1000, 0, utc, + 0.0, -20, text.constData()); +} + +QString q65Line(int frequencyHz, int utc, QString const& message) +{ + QByteArray const text = message.leftJustified(28, ' ').toLatin1(); + return QString::asprintf("%3d%5d%4d%6.4d%5.1f%5d : %-28s", + frequencyHz / 1000, frequencyHz % 1000, 0, utc, + 0.0, -20, text.constData()); +} +} + +class TestMap65DecodeDisplayFilter final : public QObject +{ + Q_OBJECT + +private slots: + void suppressesOnlyMatchingFinalDecode() + { + Map65DecodeDisplayFilter filter; + QVERIFY(filter.handleControlLine(" early\n")); + QVERIFY(filter.shouldDisplay(jt65Line(125000, 1234, "CQ K1ABC FN42"))); + filter.completeEarlyPass(); + + QVERIFY(filter.handleControlLine(" final\n")); + QVERIFY(!filter.shouldDisplay(jt65Line(125020, 1234, "CQ K1ABC FN42"))); + QVERIFY(filter.shouldDisplay(jt65Line(125021, 1234, "CQ K1ABC FN42"))); + QVERIFY(filter.shouldDisplay(jt65Line(125000, 1235, "CQ K1ABC FN42"))); + QVERIFY(filter.shouldDisplay(jt65Line(125000, 1234, "CQ K2XYZ EM00"))); + QVERIFY(filter.shouldDisplay(q65Line(125000, 1234, "CQ K1ABC FN42"))); + } + + void displaysFinalOnlyDecode() + { + Map65DecodeDisplayFilter filter; + QVERIFY(filter.handleControlLine(" early")); + filter.completeEarlyPass(); + QVERIFY(filter.handleControlLine(" final")); + + QString const decode = q65Line(125000, 2, "W1AAA K2BBB EM00"); + QVERIFY(filter.shouldDisplay(decode)); + QVERIFY(filter.shouldDisplay(decode)); + } + + void manualDiskAndUnknownPassesFailOpen() + { + Map65DecodeDisplayFilter filter; + QString const decode = jt65Line(125000, 2, "CQ K1ABC FN42"); + + QVERIFY(filter.shouldDisplay(decode)); + QVERIFY(filter.handleControlLine(" manual")); + QVERIFY(filter.shouldDisplay(decode)); + QVERIFY(filter.shouldDisplay(decode)); + QVERIFY(filter.handleControlLine(" disk")); + QVERIFY(filter.shouldDisplay(decode)); + QVERIFY(filter.handleControlLine(" invalid")); + QVERIFY(filter.shouldDisplay(decode)); + QVERIFY(filter.shouldDisplay("Signal too strong, or suspect data?")); + + QString malformed = decode; + malformed.replace(28, 3, " ? "); + QVERIFY(filter.shouldDisplay(malformed)); + } + + void completedCycleDoesNotRetainDuplicates() + { + Map65DecodeDisplayFilter filter; + QString const decode = q65Line(125000, 2, "W1AAA K2BBB EM00"); + + QVERIFY(filter.handleControlLine(" early")); + QVERIFY(filter.shouldDisplay(decode)); + filter.completeEarlyPass(); + QVERIFY(filter.handleControlLine(" final")); + QVERIFY(!filter.shouldDisplay(decode)); + filter.completeCycle(); + QVERIFY(filter.handleControlLine(" final")); + QVERIFY(filter.shouldDisplay(decode)); + } +}; + +QTEST_APPLESS_MAIN(TestMap65DecodeDisplayFilter) + +#include "test_map65_decode_display_filter.moc" diff --git a/tests/unit/map65/test_map65_decode_requests.f90 b/tests/unit/map65/test_map65_decode_requests.f90 new file mode 100644 index 00000000..e06c4c6d --- /dev/null +++ b/tests/unit/map65/test_map65_decode_requests.f90 @@ -0,0 +1,112 @@ +program test_map65_decode_requests + use iso_c_binding + use npar_ptrs_mod + implicit none + + integer(c_int64_t) :: early_id, final_id, manual_id + character(kind=c_char) :: dx(12) + + call set_nhsym(280) + call set_nagain(0) + call set_ndepth(1) + call set_fcenter(144.125_c_double) + dx = transfer('K1ABC ', dx) + call set_hiscall(dx) + early_id = publish_decode_request() + if (.not. claim_decode_request()) error stop 'early request missing' + if (active_request_id /= early_id .or. nhsym /= 280) error stop 'early identity changed' + if (claim_decode_request()) error stop 'early request repeated' + + ! Publish the final pass while the early pass is still using its parameters. + call set_decoder_ready(0) + call set_nhsym(302) + call set_ndepth(3) + call set_fcenter(144.135_c_double) + dx = transfer('K2DEF ', dx) + call set_hiscall(dx) + final_id = publish_decode_request() + if (nhsym /= 280 .or. ndepth /= 1 .or. hiscall /= 'K1ABC') error stop 'active parameters changed' + if (abs(fcenter - 144.125_c_double) > 1.e-8_c_double) error stop 'active center frequency changed' + if (is_current_decode_request(early_id)) error stop 'stale early completion accepted' + newdat = 0 + if (.not. claim_decode_request()) error stop 'pending final lost' + if (active_request_id /= final_id .or. nhsym /= 302 .or. newdat /= 1) error stop 'final identity changed' + if (ndepth /= 3 .or. hiscall /= 'K2DEF') error stop 'final parameters changed' + if (.not. is_current_decode_request(final_id)) error stop 'current final completion rejected' + if (claim_decode_request()) error stop 'final request repeated' + + ! Both automatic triggers can arrive before the decoder claims either. + call set_nhsym(280) + early_id = publish_decode_request() + call set_nhsym(302) + final_id = publish_decode_request() + call set_decoder_ready(0) + if (claim_decode_request()) error stop 'unready request claimed' + call set_decoder_ready(1) + if (.not. claim_decode_request()) error stop 'queued early missing' + if (active_request_id /= early_id .or. nhsym /= 280) error stop 'queued early out of order' + if (.not. claim_decode_request()) error stop 'queued final missing' + if (active_request_id /= final_id .or. nhsym /= 302) error stop 'queued final out of order' + if (claim_decode_request()) error stop 'queue did not drain' + + ! Completing a manual request cannot clear a newer automatic request. + call set_manual_decode_flag(1) + call set_nagain(1) + manual_id = publish_decode_request() + if (get_manual_decode_flag() /= 0) error stop 'manual flag not consumed' + if (.not. claim_decode_request()) error stop 'manual request missing' + if (manualDecodeFlag /= 1 .or. nagain /= 1) error stop 'manual parameters changed' + call set_nagain(0) + final_id = publish_decode_request() + if (manualDecodeFlag /= 1 .or. nagain /= 1) error stop 'pending update changed active manual' + manualDecodeFlag = 0 + newdat = 0 + if (is_current_decode_request(manual_id)) error stop 'stale manual completion accepted' + if (.not. claim_decode_request()) error stop 'final lost after manual completion' + if (active_request_id /= final_id .or. manualDecodeFlag /= 0 .or. nagain /= 0) error stop 'final inherited manual parameters' + if (claim_decode_request()) error stop 'manual sequence did not drain' + + ! A final request waiting beyond rollover must not decode the next interval. + call set_ndiskdat(0) + call set_nagain(0) + final_id = publish_decode_request() + call advance_live_input_generation() + if (.not. claim_decode_request()) error stop 'expired final missing' + if (active_request_id /= final_id .or. .not. active_request_expired) error stop 'old final did not expire' + if (.not. is_current_decode_request(final_id)) error stop 'expired current request cannot clear busy' + early_id = publish_decode_request() + if (is_current_decode_request(final_id)) error stop 'old skipped completion accepted' + if (.not. claim_decode_request()) error stop 'current interval request missing' + if (active_request_id /= early_id .or. active_request_expired) error stop 'current interval request expired' + if (active_input_generation /= live_input_generation) error stop 'claimed input generation changed' + + call set_nagain(1) + manual_id = publish_decode_request() + call advance_live_input_generation() + if (.not. claim_decode_request()) error stop 'manual repeat missing after rollover' + if (active_request_id /= manual_id .or. active_request_expired) error stop 'manual repeat expired on rollover' + call set_nagain(0) + call set_manual_decode_flag(1) + manual_id = publish_decode_request() + call advance_live_input_generation() + if (.not. claim_decode_request()) error stop 'freeze request missing after rollover' + if (active_request_id /= manual_id .or. active_request_expired) error stop 'freeze request expired on rollover' + call set_ndiskdat(1) + final_id = publish_decode_request() + call advance_live_input_generation() + if (.not. claim_decode_request()) error stop 'disk request missing after rollover' + if (active_request_id /= final_id .or. active_request_expired) error stop 'disk request expired on rollover' + call set_ndiskdat(0) + + early_id = publish_decode_request() + final_id = publish_decode_request() + call cancel_pending_decode_requests() + if (claim_decode_request()) error stop 'canceled request claimed' + if (is_current_decode_request(final_id)) error stop 'canceled completion accepted' + final_id = publish_decode_request() + if (.not. claim_decode_request()) error stop 'request missing after cancel' + if (active_request_id /= final_id) error stop 'wrong request after cancel' + early_id = publish_decode_request() + call set_stop_m65(1) + if (get_stop_m65() /= 1 .or. claim_decode_request()) error stop 'shutdown did not discard requests' +end program diff --git a/tests/unit/map65/test_map65_deep_search_cache.f90 b/tests/unit/map65/test_map65_deep_search_cache.f90 new file mode 100644 index 00000000..6479bcad --- /dev/null +++ b/tests/unit/map65/test_map65_deep_search_cache.f90 @@ -0,0 +1,188 @@ +program test_map65_deep_search_cache + use decodes_mod, only: mcall3a + use deep65_mod, only: build_call3_candidates, testmsg, ncode, ntot + use encode65_mod, only: encode65 + implicit none + + character(len=12), parameter :: mycall = 'K1ABC', hiscall = 'W9XYZ', no_call = '' + character(len=6), parameter :: hisgrid = 'EN37' + integer :: fixture_unit, ios + logical :: fixture_owned = .false. + + ! Run in a dedicated test directory; never overwrite an existing callsign database. + open(newunit=fixture_unit, file='CALL3.TXT', status='new', action='write', iostat=ios) + call require(ios == 0, 'create an isolated CALL3.TXT fixture') + fixture_owned = .true. + call write_fixture(fixture_unit, 'G4XYZ,IO91,NONE,') + close(fixture_unit) + + call test_startup_transition + call test_mycall_transition + call test_hiscall_transition + call test_grid_transition + call test_eme_transition + call test_file_invalidation + + call remove_fixture + print '(a)', 'MAP65 Deep Search cache tests passed.' + +contains + + subroutine build_fresh(local_call, dx_call, dx_grid, eme_only) + character(len=12), intent(in) :: local_call, dx_call + character(len=6), intent(in) :: dx_grid + integer, intent(in) :: eme_only + + mcall3a = 1 + call build_call3_candidates(local_call, dx_call, dx_grid, eme_only) + call require(mcall3a == 0, 'building consumes file invalidation') + end subroutine build_fresh + + subroutine test_startup_transition + call build_fresh(mycall, no_call, hisgrid, 0) + call require(.not. any(testmsg(1:ntot) == 'K1ABC W9XYZ R-01'), & + 'startup without a DX call has no directed report candidates') + call build_call3_candidates(mycall, hiscall, hisgrid, 0) + call require(ntot == 132, 'a supplied DX call adds all report variants and file candidates') + call require_message('K1ABC W9XYZ EN37') + call require_message('K1ABC W9XYZ -01') + call require_message('K1ABC W9XYZ R-30') + call require_message('K1ABC W9XYZ 73') + call require_message('CQ K2ABC FN20') + call require_message('CQ G4XYZ IO91') + call require_fresh_equivalent(mycall, hiscall, hisgrid, 0, 'startup DX entry') + call build_call3_candidates(mycall, hiscall, hisgrid, 0) + call require_fresh_equivalent(mycall, hiscall, hisgrid, 0, 'unchanged settings') + end subroutine test_startup_transition + + subroutine test_mycall_transition + character(len=12), parameter :: changed_call = 'K3ABC' + + call build_fresh(mycall, hiscall, hisgrid, 0) + call build_call3_candidates(changed_call, hiscall, hisgrid, 0) + call require_message('K3ABC W9XYZ EN37') + call require_message('K3ABC K2ABC FN20') + call require(.not. any(index(testmsg(1:ntot), 'K1ABC ') == 1), 'old MyCall candidates disappear') + call require_fresh_equivalent(changed_call, hiscall, hisgrid, 0, 'MyCall change') + end subroutine test_mycall_transition + + subroutine test_hiscall_transition + character(len=12), parameter :: changed_call = 'W8XYZ' + + call build_fresh(mycall, hiscall, hisgrid, 0) + call build_call3_candidates(mycall, changed_call, hisgrid, 0) + call require_message('K1ABC W8XYZ EN37') + call require_message('K1ABC W8XYZ R-01') + call require(.not. any(index(testmsg(1:ntot), 'W9XYZ') > 0), 'old DX call candidates disappear') + call require_fresh_equivalent(mycall, changed_call, hisgrid, 0, 'DX call change') + end subroutine test_hiscall_transition + + subroutine test_grid_transition + character(len=6), parameter :: changed_grid = 'FN42' + + call build_fresh(mycall, hiscall, hisgrid, 0) + call build_call3_candidates(mycall, hiscall, changed_grid, 0) + call require_message('K1ABC W9XYZ FN42') + call require_message('CQ W9XYZ FN42') + call require(.not. any(testmsg(1:ntot) == 'K1ABC W9XYZ EN37'), 'old DX grid candidate disappears') + call require_fresh_equivalent(mycall, hiscall, changed_grid, 0, 'DX grid change') + end subroutine test_grid_transition + + subroutine test_eme_transition + call build_fresh(mycall, hiscall, hisgrid, 0) + call build_call3_candidates(mycall, hiscall, hisgrid, 1) + call require(ntot == 130, 'EME filtering removes only the non-EME file entry') + call require_message('K1ABC K2ABC FN20') + call require_message('K1ABC W9XYZ R-01') + call require(.not. any(index(testmsg(1:ntot), 'G4XYZ') > 0), 'non-EME candidates disappear') + call require_fresh_equivalent(mycall, hiscall, hisgrid, 1, 'enable EME filter') + call build_call3_candidates(mycall, hiscall, hisgrid, 0) + call require_message('CQ G4XYZ IO91') + call require_fresh_equivalent(mycall, hiscall, hisgrid, 0, 'disable EME filter') + end subroutine test_eme_transition + + subroutine test_file_invalidation + call build_fresh(mycall, hiscall, hisgrid, 0) + close(23) + open(newunit=fixture_unit, file='CALL3.TXT', status='replace', action='write') + call write_fixture(fixture_unit, 'G3ABC,IO92,NONE,') + close(fixture_unit) + + call build_call3_candidates(mycall, hiscall, hisgrid, 0) + call require_message('CQ G4XYZ IO91') + call require(.not. any(testmsg(1:ntot) == 'CQ G3ABC IO92'), & + 'unchanged settings reuse the cache until explicit file invalidation') + mcall3a = 1 + call build_call3_candidates(mycall, hiscall, hisgrid, 0) + call require(mcall3a == 0, 'a file reload consumes its invalidation flag') + call require_message('CQ G3ABC IO92') + call require(.not. any(index(testmsg(1:ntot), 'G4XYZ') > 0), 'file reload removes deleted stations') + call require_fresh_equivalent(mycall, hiscall, hisgrid, 0, 'CALL3.TXT reload') + end subroutine test_file_invalidation + + subroutine require_fresh_equivalent(local_call, dx_call, dx_grid, eme_only, description) + character(len=12), intent(in) :: local_call, dx_call + character(len=6), intent(in) :: dx_grid + integer, intent(in) :: eme_only + character(len=*), intent(in) :: description + character(len=22), allocatable :: cached_messages(:) + integer, allocatable :: cached_symbols(:, :) + integer :: cached_count + + cached_count = ntot + cached_messages = testmsg(1:ntot) + cached_symbols = ncode(:, 1:ntot) + call build_fresh(local_call, dx_call, dx_grid, eme_only) + call require(ntot == cached_count, description//': cached and fresh candidate counts match') + call require(all(testmsg(1:ntot) == cached_messages), description//': cached and fresh messages match') + call require(all(ncode(:, 1:ntot) == cached_symbols), description//': cached and fresh encoded symbols match') + end subroutine require_fresh_equivalent + + subroutine require_message(message) + character(len=*), intent(in) :: message + character(len=22) :: padded_message + integer :: i, expected_symbols(63) + + padded_message = message + call encode65(padded_message, expected_symbols) + do i = 1, ntot + if (testmsg(i) /= message) cycle + call require(all(ncode(:, i) == expected_symbols), 'matching encoded symbols for '//message) + return + end do + call require(.false., 'expected candidate '//message) + end subroutine require_message + + subroutine write_fixture(unit, terrestrial_entry) + integer, intent(in) :: unit + character(len=*), intent(in) :: terrestrial_entry + + write(unit, '(a)') '// Controlled Deep Search candidates', 'K2ABC,FN20,EME,', terrestrial_entry, 'ZZZZ' + end subroutine write_fixture + + subroutine remove_fixture + logical :: opened + integer :: unit, status + + if (.not. fixture_owned) return + inquire(file='CALL3.TXT', opened=opened, number=unit, iostat=status) + if (status /= 0) return + if (.not. opened) then + open(newunit=unit, file='CALL3.TXT', status='old', iostat=status) + if (status /= 0) return + end if + close(unit, status='delete', iostat=status) + if (status == 0) fixture_owned = .false. + end subroutine remove_fixture + + subroutine require(condition, description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + + if (.not. condition) then + print '(a)', 'FAIL: '//description + call remove_fixture + error stop 1 + end if + end subroutine require +end program test_map65_deep_search_cache diff --git a/tests/unit/map65/test_map65_half_symbol_scheduler.cpp b/tests/unit/map65/test_map65_half_symbol_scheduler.cpp new file mode 100644 index 00000000..984c37a8 --- /dev/null +++ b/tests/unit/map65/test_map65_half_symbol_scheduler.cpp @@ -0,0 +1,61 @@ +#include "half_symbol_scheduler.h" + +#include + +class TestMap65HalfSymbolScheduler final : public QObject +{ + Q_OBJECT + +private slots: + void retries_busy_half_symbols (); + void catches_up_one_half_symbol_at_a_time (); + void resets_for_the_next_period (); +}; + +void TestMap65HalfSymbolScheduler::retries_busy_half_symbols () +{ + Map65HalfSymbolScheduler scheduler; + std::atomic_bool busy {false}; + + QVERIFY (scheduler.claim_next (1, busy)); + QCOMPARE (scheduler.scheduled_half_symbol (), 1); + QVERIFY (!scheduler.claim_next (2, busy)); + QCOMPARE (scheduler.scheduled_half_symbol (), 1); + + busy.store (false, std::memory_order_release); + QVERIFY (scheduler.claim_next (2, busy)); + QCOMPARE (scheduler.scheduled_half_symbol (), 2); +} + +void TestMap65HalfSymbolScheduler::catches_up_one_half_symbol_at_a_time () +{ + Map65HalfSymbolScheduler scheduler; + std::atomic_bool busy {false}; + + for (int expected = 1; expected <= 5; ++expected) + { + QVERIFY (scheduler.claim_next (5, busy)); + QCOMPARE (scheduler.scheduled_half_symbol (), expected); + busy.store (false, std::memory_order_release); + } + + QVERIFY (!scheduler.claim_next (5, busy)); + QVERIFY (!busy.load (std::memory_order_acquire)); +} + +void TestMap65HalfSymbolScheduler::resets_for_the_next_period () +{ + Map65HalfSymbolScheduler scheduler; + std::atomic_bool busy {false}; + + QVERIFY (scheduler.claim_next (1, busy)); + busy.store (false, std::memory_order_release); + scheduler.reset (); + + QCOMPARE (scheduler.scheduled_half_symbol (), 0); + QVERIFY (scheduler.claim_next (1, busy)); +} + +QTEST_GUILESS_MAIN (TestMap65HalfSymbolScheduler) + +#include "test_map65_half_symbol_scheduler.moc" diff --git a/tests/unit/map65/test_map65_q65_dphi.f90 b/tests/unit/map65/test_map65_q65_dphi.f90 new file mode 100644 index 00000000..a9c0527d --- /dev/null +++ b/tests/unit/map65/test_map65_q65_dphi.f90 @@ -0,0 +1,126 @@ +program test_map65_q65_dphi + use iso_fortran_env, only: int8, real32, real64 + use datcom_ptrs_mod, only: dd, ss, savg + use decodes_mod, only: decodes_init + use filbig_mod, only: filbig, MAXFFT2 + use ftninit_mod, only: ftninit + use gen_q65_cwave_mod, only: gen_q65_cwave + use npar_ptrs_mod, only: abort_decode, fcenter, idphi, manualDecodeFlag, ndepth, & + nfft_active, nsmax_active, set_runtime_params, t_start + use q65_decode, only: msg0, nsnr0 + use q65b_mod, only: q65b + use symspec_mod, only: symspec + use timer_impl, only: init_timer, fini_timer + use wideband_sync, only: candidate, get_candidates, init_wideband_sync, & + MAX_CANDIDATES, nkhz_center + implicit none + + integer, parameter :: sample_rate = 96000, fft_size = 32768 + character(len=24), parameter :: message = 'W1AAA K2BBB EM00' + complex(real32), allocatable :: waveform(:), c4a(:), c4b(:) + real(real32), allocatable :: display_spectrum(:) + integer, allocatable :: seed(:) + type(candidate) :: candidates(MAX_CANDIDATES) + character(len=24) :: sent_message + integer(int8) :: lstrong(0:1023) + integer :: i, k, nwave, seed_size, ncand, selected, newdat, n4, idec + integer :: nb, nbslider, ihsym, nzap, nkh + real(real32) :: gainx, gainy, phasex, phasey, rejectx, rejecty, pxdb, pydb, slimit + + call set_runtime_params(sample_rate, fft_size, 56 * sample_rate) + allocate(dd(4, nsmax_active), ss(4, 322, nfft_active), savg(4, nfft_active)) + allocate(waveform(nsmax_active), display_spectrum(nfft_active)) + allocate(c4a(MAXFFT2), c4b(MAXFFT2)) + ss = 0.0 + savg = 0.0 + waveform = cmplx(0.0, 0.0) + + call random_seed(size=seed_size) + allocate(seed(seed_size)) + seed = 104729 + call random_seed(put=seed) + call random_number(dd) + dd = 60.0 * (dd - 0.5) + + ! The capture is centered at 48 kHz; transmission starts one second in. + call gen_q65_cwave(message, 48000 + 1270, 2, real(sample_rate, real64), & + sent_message, waveform, nwave) + call require(nwave > 0 .and. trim(sent_message) == trim(message), 'generate the Q65 message') + call require(sample_rate + nwave <= nsmax_active, 'waveform fits in the capture') + do i = 1, nwave + k = sample_rate + i + ! Equal signal amplitudes with a 180-degree receiver phase offset. + dd(1,k) = dd(1,k) + real(waveform(i)) + dd(2,k) = dd(2,k) + aimag(waveform(i)) + dd(3,k) = dd(3,k) - real(waveform(i)) + dd(4,k) = dd(4,k) - aimag(waveform(i)) + end do + dd = real(nint(dd), real32) + deallocate(waveform) + + call init_timer() + call ftninit('.') + open(unit=19, status='scratch') + open(unit=20, status='scratch') + call decodes_init() + call init_wideband_sync() + abort_decode = .false. + manualDecodeFlag = 0 + ndepth = 1 + idphi = 180 + fcenter = 144.125_real64 + nkhz_center = 125 + + nb = 0 + nbslider = 40 + gainx = 1.0 + gainy = 1.0 + phasex = 0.0 + phasey = 0.0 + slimit = 0.0 + ihsym = 0 + nzap = 0 + do i = 1, 302 + k = fft_size + nint(real(i - 1, real64) * 2048.0_real64 * sample_rate / 11025.0_real64) + call symspec(k, 1, 1, nb, nbslider, idphi, 0, 0, gainx, gainy, & + phasex, phasey, rejectx, rejecty, pxdb, pydb, display_spectrum, & + nkh, ihsym, nzap, slimit, lstrong) + end do + call require(ihsym == 302, 'complete the symbol spectra') + + call get_candidates(ss, savg, .true., ihsym, 48, 56, 0, 2, candidates, ncand) + selected = 0 + do i = 1, ncand + if (candidates(i)%iflip /= 0) cycle + if (abs(1000.0 * candidates(i)%f - 49270.0) > 10.0) cycle + selected = i + exit + end do + call require(selected > 0, 'acquire the Q65 signal with calibrated spectra') + + newdat = 1 + call filbig(dd, nsmax_active, 1000.0_real64 * candidates(selected)%f, newdat, & + sample_rate, .true., c4a, c4b, n4) + call system_clock(t_start) + call q65b(1, 0, 0, fcenter, 0, sample_rate, nkhz_center, 0, 100, .true., idphi, & + 'N0CALL ', 'FN31 ', ' ', ' ', 2, & + real(candidates(selected)%f, real64), 1.270, newdat, 0, 0, 0, idec) + + call require(.not. logical(abort_decode), 'decode within the time budget') + call require(nsnr0 > -99 .and. trim(msg0) == trim(message), & + 'recover the Q65 message despite opposite-phase receiver channels') + call fini_timer() + print '(a)', 'MAP65 Q65 Dphi test passed.' + +contains + + subroutine require(condition, description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + + if (.not. condition) then + print '(a)', 'FAIL: '//description + error stop 1 + end if + end subroutine require +end program test_map65_q65_dphi diff --git a/tests/unit/map65/test_map65_q65b_timeout.f90 b/tests/unit/map65/test_map65_q65b_timeout.f90 new file mode 100644 index 00000000..bf7b2c9c --- /dev/null +++ b/tests/unit/map65/test_map65_q65b_timeout.f90 @@ -0,0 +1,46 @@ +program test_map65_q65b_timeout + use iso_fortran_env, only: real64 + use npar_ptrs_mod, only: abort_decode, t_start + use q65_decode, only: cq0, msg0, nfreq0, nsnr0, xdt0 + use q65b_mod, only: q65b + implicit none + + integer :: idec, now, rate + + call system_clock(now, rate) + t_start = now - 41*rate + abort_decode = .false. + idec = 123 + nsnr0 = 7 + msg0 = 'STALE MESSAGE' + cq0 = 'q1 ' + xdt0 = 2.5 + nfreq0 = 1000 + + call q65b(1, 0, 0, 144.125_real64, 0, 96000, 125, 0, 100, .false., 0, & + 'K1ABC ', 'FN42 ', 'W9XYZ ', 'EN50 ', 2, 1000.0_real64, 125.0, & + 1, 0, 0, 0, idec) + + if (.not. abort_decode) then + print '(a)', 'FAIL: expired decode budget sets the abort flag' + error stop 1 + end if + call require(idec == -1, 'timeout returns a defined failure status') + call require(nsnr0 == -99, 'timeout clears stale Q65 SNR state') + call require(len_trim(msg0) == 0 .and. len_trim(cq0) == 0, & + 'timeout clears stale Q65 message state') + call require(xdt0 == 0.0 .and. nfreq0 == 0, 'timeout clears stale Q65 signal state') + print '(a)', 'MAP65 Q65 timeout test passed.' + +contains + + subroutine require(condition, description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + + if (.not. condition) then + print '(a)', 'FAIL: '//description + error stop 1 + end if + end subroutine require +end program test_map65_q65b_timeout diff --git a/tests/unit/map65/test_map65_result_selection.f90 b/tests/unit/map65/test_map65_result_selection.f90 new file mode 100644 index 00000000..dd76ea4c --- /dev/null +++ b/tests/unit/map65/test_map65_result_selection.f90 @@ -0,0 +1,96 @@ +program test_map65_result_selection + use trimlist_mod, only: select_unique_decodes + implicit none + + integer, parameter :: MAXMSG = 1000 + real :: sig(MAXMSG, 30) + character(len=22) :: msg(MAXMSG) + integer :: indx(MAXMSG), nz + + call test_result_identity + call test_empty_and_full_lists + print '(a)', 'MAP65 result selection tests passed.' + +contains + + subroutine test_result_identity + sig = 0.0 + msg = ' ' + + call set_result(1, 1, 100.000, 0.20, 1, 'K1ABC W9XYZ FN42', 1.0) + call set_result(2, 1, 100.005, 0.25, 1, 'K1ABC W9XYZ FN42', 2.0) + call set_result(3, 1, 100.005, 0.20, 1, 'W1AAA K2BBB EM00') + call set_result(4, 1, 100.005, 0.50, 1, 'K1ABC W9XYZ FN42') + call set_result(5, 1, 100.005, 0.20, -1, 'K1ABC W9XYZ FN42') + call set_result(6, 1, 100.020, 0.20, 1, 'K1ABC W9XYZ FN42') + call set_result(7, 1, 100.005, 0.20, 1, ' ') + call set_result(8, 2, 100.005, 0.20, 1, 'K1ABC W9XYZ FN42') + + call select_unique_decodes(sig, msg, 8, 0.010, 0.2, indx, nz) + call require(nz == 6, 'only a matching message and signal identity is deduplicated') + call require(selected_count('W1AAA K2BBB EM00', 1, 1) == 1, & + 'a different message at the same frequency survives') + call require(selected_count('K1ABC W9XYZ FN42', 1, -1) == 1, & + 'opposite-sync results survive') + call require(selected_count('K1ABC W9XYZ FN42', 2, 1) == 1, & + 'results from another UTC survive') + call require(any(indx(1:nz) == 2) .and. .not. any(indx(1:nz) == 1), & + 'the stronger duplicate supplies the displayed metrics') + end subroutine test_result_identity + + subroutine test_empty_and_full_lists + integer :: i + + sig = 0.0 + msg = ' ' + call select_unique_decodes(sig, msg, 0, 0.010, 0.2, indx, nz) + call require(nz == 0, 'an empty result list stays empty') + + do i = 1, MAXMSG + sig(i, 2) = 1.0 + sig(i, 3) = 0.020*i + sig(i, 5) = 0.2 + sig(i, 7) = 1.0 + write(msg(i), '("MSG",I4.4)') i + end do + call select_unique_decodes(sig, msg, MAXMSG, 0.010, 0.2, indx, nz) + call require(nz == MAXMSG, 'the maximum result list does not overrun selection storage') + end subroutine test_empty_and_full_lists + + subroutine set_result(index, utc, frequency, dt, flip, message, strength) + integer, intent(in) :: index, utc, flip + real, intent(in) :: frequency, dt + character(len=*), intent(in) :: message + real, intent(in), optional :: strength + + sig(index, 2) = utc + sig(index, 3) = frequency + sig(index, 5) = dt + sig(index, 7) = flip + if (present(strength)) sig(index, 8) = strength + msg(index) = message + end subroutine set_result + + integer function selected_count(message, utc, flip) + character(len=*), intent(in) :: message + integer, intent(in) :: utc, flip + integer :: i, source + + selected_count = 0 + do i = 1, nz + source = indx(i) + if (msg(source) == message .and. nint(sig(source, 2)) == utc .and. & + nint(sig(source, 7)) == flip) selected_count = selected_count + 1 + end do + end function selected_count + + subroutine require(condition, description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + + if (.not. condition) then + print '(a)', 'FAIL: '//description + error stop 1 + end if + end subroutine require +end program test_map65_result_selection diff --git a/tests/unit/map65/test_map65_runtime_paths.cpp b/tests/unit/map65/test_map65_runtime_paths.cpp new file mode 100644 index 00000000..7cca6ca4 --- /dev/null +++ b/tests/unit/map65/test_map65_runtime_paths.cpp @@ -0,0 +1,225 @@ +#include "runtime_paths.h" + +#include +#include +#include +#include +#include + +namespace +{ +bool writeFile(QString const& path, QByteArray const& contents) +{ + QFile file {path}; + if (!file.open(QIODevice::WriteOnly | QIODevice::Truncate)) { + return false; + } + return file.write(contents) == contents.size(); +} + +QByteArray readFile(QString const& path) +{ + QFile file {path}; + if (!file.open(QIODevice::ReadOnly)) { + return {}; + } + return file.readAll(); +} + +class CurrentDirectoryGuard +{ +public: + explicit CurrentDirectoryGuard(QString const& path) + : previous_ {QDir::currentPath()} + , changed_ {QDir::setCurrent(path)} + { + } + + ~CurrentDirectoryGuard() + { + if (changed_) { + QDir::setCurrent(previous_); + } + } + + bool changed() const { return changed_; } + +private: + QString previous_; + bool changed_; +}; +} + +class TestMap65RuntimePaths final : public QObject +{ + Q_OBJECT + +private slots: + void canonicalSourcePrecedesLegacyCandidates() + { + QTemporaryDir root; + QVERIFY(root.isValid()); + QDir dir {root.path()}; + QVERIFY(dir.mkpath("app/resources")); + QVERIFY(dir.mkpath("installed")); + QVERIFY(dir.mkpath("writable")); + QString const canonical = dir.absoluteFilePath("installed/eclipse.txt"); + QString const legacy = dir.absoluteFilePath("app/resources/eclipse.txt"); + QVERIFY(writeFile(canonical, "canonical")); + QVERIFY(writeFile(legacy, "legacy")); + + QCOMPARE(map65RuntimeSourceFile(dir.absoluteFilePath("app"), + dir.absoluteFilePath("installed"), + dir.absoluteFilePath("writable"), "eclipse.txt"), + QFileInfo {canonical}.absoluteFilePath()); + } + + void legacySourceRemainsAvailable() + { + QTemporaryDir root; + QVERIFY(root.isValid()); + QDir dir {root.path()}; + QVERIFY(dir.mkpath("app/resources")); + QVERIFY(dir.mkpath("installed")); + QVERIFY(dir.mkpath("writable")); + QString const legacy = dir.absoluteFilePath("app/resources/eclipse.txt"); + QVERIFY(writeFile(legacy, "legacy")); + + QCOMPARE(map65RuntimeSourceFile(dir.absoluteFilePath("app"), + dir.absoluteFilePath("installed"), + dir.absoluteFilePath("writable"), "eclipse.txt"), + QFileInfo {legacy}.absoluteFilePath()); + } + + void writableEclipseCannotShadowPackagedData() + { + QTemporaryDir root; + QVERIFY(root.isValid()); + QDir dir {root.path()}; + QVERIFY(dir.mkpath("app")); + QVERIFY(dir.mkpath("installed")); + QVERIFY(dir.mkpath("writable")); + QString const canonical = dir.absoluteFilePath("installed/eclipse.txt"); + QString const stale = dir.absoluteFilePath("writable/eclipse.txt"); + QVERIFY(writeFile(canonical, "current package")); + QVERIFY(writeFile(stale, "stale copy")); + CurrentDirectoryGuard cwd {dir.absoluteFilePath("writable")}; + QVERIFY(cwd.changed()); + + QCOMPARE(map65RuntimeSourceFile(dir.absoluteFilePath("app"), + dir.absoluteFilePath("installed"), + dir.absoluteFilePath("writable"), "eclipse.txt"), + QFileInfo {canonical}.absoluteFilePath()); + QCOMPARE(readFile(stale), QByteArray {"stale copy"}); + } + + void writableDirectoryIsNotASourceFallback() + { + QTemporaryDir root; + QVERIFY(root.isValid()); + QDir dir {root.path()}; + QVERIFY(dir.mkpath("app")); + QVERIFY(dir.mkpath("installed")); + QVERIFY(dir.mkpath("writable")); + QString const stale = dir.absoluteFilePath("writable/unique-runtime-data.txt"); + QVERIFY(writeFile(stale, "stale copy")); + CurrentDirectoryGuard cwd {dir.absoluteFilePath("writable")}; + QVERIFY(cwd.changed()); + + QCOMPARE(map65RuntimeSourceFile(dir.absoluteFilePath("app"), + dir.absoluteFilePath("installed"), + dir.absoluteFilePath("writable"), + "unique-runtime-data.txt"), + dir.absoluteFilePath("installed/unique-runtime-data.txt")); + } + + void writableDirectoryAliasIsNotASourceFallback() + { + QTemporaryDir root; + QVERIFY(root.isValid()); + QDir dir {root.path()}; + QVERIFY(dir.mkpath("app")); + QVERIFY(dir.mkpath("installed")); + QVERIFY(dir.mkpath("writable")); + QString const writable = dir.absoluteFilePath("writable"); + QString const writableAlias = dir.absoluteFilePath("writable-alias"); + if (!QFile::link(writable, writableAlias)) { + QSKIP("Directory links are unavailable"); + } + QString const stale = QDir {writable}.absoluteFilePath("unique-runtime-data.txt"); + QVERIFY(writeFile(stale, "stale copy")); + QString const aliasedStale = + QDir {writableAlias}.absoluteFilePath("unique-runtime-data.txt"); + if (QFileInfo {aliasedStale}.canonicalFilePath() + != QFileInfo {stale}.canonicalFilePath()) { + QSKIP("Traversable directory links are unavailable"); + } + CurrentDirectoryGuard cwd {writable}; + QVERIFY(cwd.changed()); + + QCOMPARE(map65RuntimeSourceFile(dir.absoluteFilePath("app"), + dir.absoluteFilePath("installed"), writableAlias, + "unique-runtime-data.txt"), + dir.absoluteFilePath("installed/unique-runtime-data.txt")); + } + + void seedsMissingWritableFile() + { + QTemporaryDir root; + QVERIFY(root.isValid()); + QDir dir {root.path()}; + QVERIFY(dir.mkpath("app")); + QVERIFY(dir.mkpath("installed")); + QVERIFY(dir.mkpath("writable")); + QVERIFY(writeFile(dir.absoluteFilePath("installed/CALL3.TXT"), "packaged calls")); + + QString const writable = ensureMap65RuntimeFile(dir.absoluteFilePath("app"), + dir.absoluteFilePath("installed"), + dir.absoluteFilePath("writable"), + "CALL3.TXT"); + QCOMPARE(writable, dir.absoluteFilePath("writable/CALL3.TXT")); + QCOMPARE(readFile(writable), QByteArray {"packaged calls"}); + } + + void replacesEmptyWritableFile() + { + QTemporaryDir root; + QVERIFY(root.isValid()); + QDir dir {root.path()}; + QVERIFY(dir.mkpath("app")); + QVERIFY(dir.mkpath("installed")); + QVERIFY(dir.mkpath("writable")); + QString const writable = dir.absoluteFilePath("writable/CALL3.TXT"); + QVERIFY(writeFile(dir.absoluteFilePath("installed/CALL3.TXT"), "packaged calls")); + QVERIFY(writeFile(writable, {})); + + QCOMPARE(ensureMap65RuntimeFile(dir.absoluteFilePath("app"), + dir.absoluteFilePath("installed"), + dir.absoluteFilePath("writable"), "CALL3.TXT"), + writable); + QCOMPARE(readFile(writable), QByteArray {"packaged calls"}); + } + + void preservesNonemptyWritableFile() + { + QTemporaryDir root; + QVERIFY(root.isValid()); + QDir dir {root.path()}; + QVERIFY(dir.mkpath("app")); + QVERIFY(dir.mkpath("installed")); + QVERIFY(dir.mkpath("writable")); + QString const writable = dir.absoluteFilePath("writable/CALL3.TXT"); + QVERIFY(writeFile(dir.absoluteFilePath("installed/CALL3.TXT"), "packaged calls")); + QVERIFY(writeFile(writable, "user calls")); + + QCOMPARE(ensureMap65RuntimeFile(dir.absoluteFilePath("app"), + dir.absoluteFilePath("installed"), + dir.absoluteFilePath("writable"), "CALL3.TXT"), + writable); + QCOMPARE(readFile(writable), QByteArray {"user calls"}); + } +}; + +QTEST_APPLESS_MAIN(TestMap65RuntimePaths) + +#include "test_map65_runtime_paths.moc" diff --git a/tests/unit/message_filter/CMakeLists.txt b/tests/unit/message_filter/CMakeLists.txt new file mode 100644 index 00000000..e698f955 --- /dev/null +++ b/tests/unit/message_filter/CMakeLists.txt @@ -0,0 +1,14 @@ +add_executable (test_message_filter + test_message_filter.cpp + ${CMAKE_SOURCE_DIR}/MessageFilter.cpp +) +target_link_libraries (test_message_filter Qt5::Test) +add_test (NAME test_message_filter COMMAND test_message_filter) + +add_executable (test_msk144_filter_rules + test_msk144_filter_rules.cpp + ${CMAKE_SOURCE_DIR}/MessageFilter.cpp + ${CMAKE_SOURCE_DIR}/MessageFilterRules.cpp +) +target_link_libraries (test_msk144_filter_rules Qt5::Test) +add_test (NAME test_msk144_filter_rules COMMAND test_msk144_filter_rules) diff --git a/tests/unit/message_filter/test_message_filter.cpp b/tests/unit/message_filter/test_message_filter.cpp new file mode 100644 index 00000000..36cfb2fe --- /dev/null +++ b/tests/unit/message_filter/test_message_filter.cpp @@ -0,0 +1,37 @@ +#include +#include "MessageFilter.hpp" + +class TestMessageFilter : public QObject +{ + Q_OBJECT + +private slots: + void testContainsAny() + { + QString text = "The quick brown fox jumps over the lazy dog"; + QStringList keywords = QStringList() << "fox" << "cat" << ""; + QVERIFY(MessageFilter::containsAny(text, keywords)); + + keywords = QStringList() << "cat" << "bird"; + QVERIFY(!MessageFilter::containsAny(text, keywords)); + + keywords = QStringList(); + QVERIFY(!MessageFilter::containsAny(text, keywords)); + } + + void testStartsWithAny() + { + QString text = "WSJT-X is great"; + QStringList keywords = QStringList() << "WSJT" << "GWS" << ""; + QVERIFY(MessageFilter::startsWithAny(text, keywords)); + + keywords = QStringList() << "is" << "great"; + QVERIFY(!MessageFilter::startsWithAny(text, keywords)); + + keywords = QStringList(); + QVERIFY(!MessageFilter::startsWithAny(text, keywords)); + } +}; + +QTEST_MAIN(TestMessageFilter) +#include "test_message_filter.moc" diff --git a/tests/unit/message_filter/test_msk144_filter_rules.cpp b/tests/unit/message_filter/test_msk144_filter_rules.cpp new file mode 100644 index 00000000..5ab1c5b2 --- /dev/null +++ b/tests/unit/message_filter/test_msk144_filter_rules.cpp @@ -0,0 +1,99 @@ +#include + +#include "MessageFilterRules.hpp" + +class TestMSK144FilterRules : public QObject +{ + Q_OBJECT + +private slots: + void testBlacklist() + { + MessageFilterLogic::FilterContext ctx; + ctx.filtersForWord2 = true; + ctx.blacklisted = true; + ctx.blacklistKeywords = QStringList() << "K1ABC"; + + auto result = MessageFilterRules::evaluateMSK144Text("060522 -10 0.3 815 # CQ K1ABC FN20", ctx).result; + QVERIFY(result.filtered); + QVERIFY(result.shouldReturn); + } + + void testWhitelist() + { + MessageFilterLogic::FilterContext ctx; + ctx.filtersForWord2 = true; + ctx.whitelisted = true; + ctx.whitelistKeywords = QStringList() << "K1ABC"; + + auto result1 = MessageFilterRules::evaluateMSK144Text("060522 -10 0.3 815 # CQ K1ABC FN20", ctx).result; + QVERIFY(!result1.filtered); + QVERIFY(!result1.shouldReturn); + + auto result2 = MessageFilterRules::evaluateMSK144Text("060522 -10 0.3 815 # CQ W1AW FN20", ctx).result; + QVERIFY(result2.filtered); + QVERIFY(result2.shouldReturn); + } + + void testBypass() + { + MessageFilterLogic::FilterContext ctx; + ctx.bypass = true; + ctx.filtersForWord2 = true; + ctx.blacklisted = true; + ctx.blacklistKeywords = QStringList() << "K1ABC"; + + auto result = MessageFilterRules::evaluateMSK144Text("060522 -10 0.3 815 # CQ K1ABC FN20", ctx).result; + QVERIFY(!result.filtered); + QVERIFY(!result.shouldReturn); + } + + void testDirectionalCQ() + { + MessageFilterLogic::FilterContext ctx; + ctx.filtersForWord2 = true; + ctx.blacklisted = true; + ctx.blacklistKeywords = QStringList() << "K1ABC"; + + auto result = MessageFilterRules::evaluateMSK144Text("060522 -10 0.3 815 # CQ DX K1ABC FN20", ctx).result; + QVERIFY(result.filtered); + QVERIFY(result.shouldReturn); + } + + void testAlwaysPass() + { + MessageFilterLogic::FilterContext ctx; + ctx.filtersForWord2 = true; + ctx.alwaysPass = true; + ctx.blacklisted = true; + ctx.passKeywords = QStringList() << "K1ABC"; + ctx.blacklistKeywords = QStringList() << "K1ABC"; + + auto result = MessageFilterRules::evaluateMSK144Text("060522 -10 0.3 815 # CQ K1ABC FN20", ctx).result; + QVERIFY(!result.filtered); + QVERIFY(!result.shouldReturn); + } + + void testScoringPounceResetsScores() + { + MessageFilterLogic::FilterContext ctx; + ctx.filtersForWord2 = true; + ctx.filtersForWaitAndPounceOnly = true; + ctx.blacklisted = true; + ctx.blacklistKeywords = QStringList() << "K1ABC"; + ctx.pounce = true; + ctx.respondPolicy = AutoRespondPolicy::MaxDistance; + + auto result = MessageFilterRules::evaluateMSK144Text( + "060522 -10 0.3 815 # CQ K1ABC FN20", ctx).result; + QVERIFY(result.resetPoints); + + ctx.respondPolicy = AutoRespondPolicy::First; + result = MessageFilterRules::evaluateMSK144Text( + "060522 -10 0.3 815 # CQ K1ABC FN20", ctx).result; + QVERIFY(!result.resetPoints); + } +}; + +QTEST_MAIN(TestMSK144FilterRules) +#include "test_msk144_filter_rules.moc" diff --git a/tests/unit/msk/CMakeLists.txt b/tests/unit/msk/CMakeLists.txt new file mode 100644 index 00000000..92c7762d --- /dev/null +++ b/tests/unit/msk/CMakeLists.txt @@ -0,0 +1,15 @@ +add_executable (test_msk_spectrum_edges test_msk_spectrum_edges.f90) +wsjt_link_common_fortran (test_msk_spectrum_edges) +add_test (NAME test_msk_spectrum_edges COMMAND test_msk_spectrum_edges) + +add_executable (test_hspec_committed_boundary test_hspec_committed_boundary.f90) +set_source_files_properties (test_hspec_committed_boundary.f90 PROPERTIES + COMPILE_FLAGS "-Wno-unused-dummy-argument") +wsjt_link_common_fortran (test_hspec_committed_boundary) +add_test (NAME test_hspec_committed_boundary COMMAND test_hspec_committed_boundary) +set_tests_properties (test_hspec_committed_boundary PROPERTIES + TIMEOUT 30 LABELS "receive-handoff") +if (WSJT_ENABLE_TSAN) + set_tests_properties (test_hspec_committed_boundary PROPERTIES + ENVIRONMENT "TSAN_OPTIONS=halt_on_error=1:exitcode=66") +endif () diff --git a/tests/unit/msk/test_hspec_committed_boundary.f90 b/tests/unit/msk/test_hspec_committed_boundary.f90 new file mode 100644 index 00000000..c9e7c432 --- /dev/null +++ b/tests/unit/msk/test_hspec_committed_boundary.f90 @@ -0,0 +1,69 @@ +! hspec is production code. Substitute only its downstream decoder with a +! recording probe: verify the actual slice delivered, not decoder success. +module hspec_input_probe + implicit none + integer :: calls=0 + integer*2 :: received(7168) +end module + +program test_hspec_committed_boundary + use hspec_input_probe + implicit none + integer*2 :: samples(0:120*12000-1) + real :: green(0:702), spectrum(0:63,0:702), pxmax, dbnogain + real*8 :: coefficients(5) + integer :: i, jh, k + character*80 :: line + + samples=0 + coefficients=0 + green=0 + spectrum=0 + jh=0 + k=7168 ! Detector emits an end-exclusive count, not a last-sample index. + call run_hspec(.true.) + if(calls.ne.0) stop 1 ! Silence must not invoke the downstream decoder. + + ! Reset hspec's saved sequence position, then provide two nonzero blocks. + k=512 + call run_hspec(.false.) + do i=0,7167 + samples(i)=int(1+mod(i,30000),kind=2) + enddo + samples(7168)=-12345 ! The first uncommitted sample must never be consumed. + k=7168 + call run_hspec(.true.) + if(calls.ne.1) stop 2 + if(any(received.ne.samples(0:7167))) then + print *, 'FAIL: MSK input must be the completed range [k-7168,k).' + print *, 'Expected first/last:',samples(0),samples(7167) + print *, 'Observed first/last:',received(1),received(7168) + stop 3 + endif + print *, 'MSK committed-boundary test passed' + +contains + subroutine run_hspec(msk) + logical, intent(in) :: msk + logical*1 :: enabled + enabled=msk + call hspec(samples,k,0,15,1500,100,enabled,.false._1,coefficients, & + 0,'K1ABC ','W9XYZ ',.false._1,.false._1,'.', & + green,spectrum,jh,pxmax,dbnogain,line) + end subroutine +end program + +subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,mycall,hiscall, & + bshmsg,btrain,pcoeffs,bswl,datadir,line) + use hspec_input_probe + implicit none + integer*2 :: id2(7168) + integer :: nutc0, ntol, nrxfreq, ndepth + real :: tsec + real*8 :: pcoeffs(5) + logical*1 :: bshmsg,btrain,bswl + character*(*) :: mycall,hiscall,datadir,line + received=id2 + calls=calls+1 + line=char(0) +end subroutine diff --git a/tests/unit/msk/test_msk_spectrum_edges.f90 b/tests/unit/msk/test_msk_spectrum_edges.f90 new file mode 100644 index 00000000..61a2b548 --- /dev/null +++ b/tests/unit/msk/test_msk_spectrum_edges.f90 @@ -0,0 +1,297 @@ +program test_msk_spectrum_edges + use msk_spectrum, only: msk_clip_spectrum_window,msk_peak_offset + use packjt77, only: MAXRECENT + use, intrinsic :: iso_fortran_env, only: real64 + use, intrinsic :: ieee_arithmetic, only: ieee_quiet_nan,ieee_value + implicit none + + call test_windows + call test_peak_offsets + call test_frequency_searches + call test_msk40_sync_column + call test_short_ping_input_bounds + + print *, 'MSK spectrum edge tests passed' + +contains + + subroutine test_windows + integer :: lo,hi + logical :: usable + + call msk_clip_spectrum_window(240,-3d0,2d0,lo,hi,usable) + call assert_true(usable .and. lo.eq.1 .and. hi.eq.2, & + 'lower partial window is clipped') + + call msk_clip_spectrum_window(864,863d0,867d0,lo,hi,usable) + call assert_true(usable .and. lo.eq.863 .and. hi.eq.864, & + 'upper partial window is clipped') + + call msk_clip_spectrum_window(240,1d0,1d0,lo,hi,usable) + call assert_true(usable .and. lo.eq.1 .and. hi.eq.1, & + 'first FFT bin is usable') + + call msk_clip_spectrum_window(864,864d0,864d0,lo,hi,usable) + call assert_true(usable .and. lo.eq.864 .and. hi.eq.864, & + 'last FFT bin is usable') + + call assert_rejected_window(240,-5d0,0d0,'window below the FFT is rejected') + call assert_rejected_window(240,241d0,245d0,'window above the FFT is rejected') + call assert_rejected_window(240,20d0,10d0,'reversed window is rejected') + call assert_rejected_window(0,1d0,1d0,'invalid FFT size is rejected') + end subroutine test_windows + + subroutine assert_rejected_window(nfft,requested_lo,requested_hi,message) + integer, intent(in) :: nfft + real(real64), intent(in) :: requested_lo,requested_hi + character(len=*), intent(in) :: message + integer :: lo,hi + logical :: usable + + call msk_clip_spectrum_window(nfft,requested_lo,requested_hi,lo,hi,usable) + call assert_true(.not.usable .and. lo.eq.1 .and. hi.eq.0,message) + end subroutine assert_rejected_window + + subroutine test_peak_offsets + integer, parameter :: NFFT40=240,NFFT144=864 + complex :: spectrum40(NFFT40),spectrum144(NFFT144) + real :: offset + + spectrum40=cmplx(0.0,0.0) + spectrum144=cmplx(0.0,0.0) + spectrum40(1)=cmplx(2.0,1.0) + spectrum40(NFFT40)=cmplx(3.0,-1.0) + spectrum144(1)=cmplx(2.0,1.0) + spectrum144(NFFT144)=cmplx(3.0,-1.0) + call assert_close(msk_peak_offset(spectrum40,1),0.0, & + 'MSK40 first-bin offset is zero') + call assert_close(msk_peak_offset(spectrum40,NFFT40),0.0, & + 'MSK40 last-bin offset is zero') + call assert_close(msk_peak_offset(spectrum144,1),0.0, & + 'MSK144 first-bin offset is zero') + call assert_close(msk_peak_offset(spectrum144,NFFT144),0.0, & + 'MSK144 last-bin offset is zero') + + spectrum40=cmplx(0.0,0.0) + offset=msk_peak_offset(spectrum40,120) + call assert_close(offset,0.0,'all-zero offset is zero') + + spectrum40(119:121)=cmplx(2.0,1.0) + offset=msk_peak_offset(spectrum40,120) + call assert_close(offset,0.0,'flat offset is zero') + + spectrum40=cmplx(0.0,0.0) + spectrum40(119)=cmplx(1.0,0.0) + spectrum40(120)=cmplx(2.0,0.0) + spectrum40(121)=cmplx(3.0,0.0) + offset=msk_peak_offset(spectrum40,120) + call assert_close(offset,0.0,'zero-curvature offset is zero') + + spectrum40(119)=cmplx(1.0,0.0) + spectrum40(120)=cmplx(4.0,0.0) + spectrum40(121)=cmplx(3.0,0.0) + offset=msk_peak_offset(spectrum40,120) + call assert_close(offset,0.5,'ordinary interpolation is preserved') + end subroutine test_peak_offsets + + subroutine test_frequency_searches + integer, parameter :: NSPM40=240,NFRAMES40=3 + integer, parameter :: NSPM144=864,NFRAMES144=8 + complex :: cb40(42),cb144(42) + complex :: cdat40(NSPM40*NFRAMES40),cdat2_40(NSPM40*NFRAMES40) + complex :: cdat144(NSPM144*NFRAMES144),cdat2_144(NSPM144*NFRAMES144) + complex :: cs40(NSPM40),cs144(NSPM144) + integer :: navmask40(NFRAMES40),navmask144(NFRAMES144) + real :: bestf,nan_value,xccs40(0:NSPM40-1),xccs144(0:NSPM144-1),xmax + + cb144=cmplx(0.0,0.0) + cdat144=cmplx(0.0,0.0) + cdat2_144=cmplx(1.0,1.0) + cs144=cmplx(1.0,1.0) + xccs144=1.0 + navmask144=1 + xmax=1.0 + bestf=1.0 + call msk144_freq_search(cdat144,0.0,-1,1,2.0,NFRAMES144,navmask144, & + cb144,cdat2_144,xmax,bestf,cs144,xccs144) + call assert_close(xmax,0.0,'MSK144 zero correlation has zero metric') + call assert_close(bestf,-2.0,'MSK144 zero correlation selects first frequency') + call assert_true(all(cs144.eq.cmplx(0.0,0.0)), & + 'MSK144 zero correlation initializes averaged data') + call assert_true(all(xccs144.eq.0.0), & + 'MSK144 zero correlation initializes correlation data') + + cb40=cmplx(0.0,0.0) + cdat40=cmplx(0.0,0.0) + cdat2_40=cmplx(1.0,1.0) + cs40=cmplx(1.0,1.0) + xccs40=1.0 + navmask40=0 + xmax=1.0 + bestf=1.0 + call msk40_freq_search(cdat40,0.0,0,0,1.0,NFRAMES40,navmask40,cb40, & + cdat2_40,xmax,bestf,cs40,xccs40) + call assert_close(xmax,0.0,'empty MSK40 average has zero metric') + call assert_close(bestf,0.0,'empty MSK40 average has zero frequency') + call assert_true(all(cs40.eq.cmplx(0.0,0.0)), & + 'empty MSK40 average initializes averaged data') + call assert_true(all(xccs40.eq.0.0), & + 'empty MSK40 average initializes correlation data') + + nan_value=ieee_value(0.0,ieee_quiet_nan) + cdat40=cmplx(0.0,0.0) + cdat40(1)=cmplx(nan_value,0.0) + cs40=cmplx(1.0,1.0) + xccs40=1.0 + navmask40=1 + xmax=1.0 + bestf=1.0 + call msk40_freq_search(cdat40,0.0,0,0,1.0,NFRAMES40,navmask40,cb40, & + cdat2_40,xmax,bestf,cs40,xccs40) + call assert_close(xmax,0.0,'non-finite MSK40 correlation has zero metric') + call assert_close(bestf,0.0,'non-finite MSK40 correlation has zero frequency') + call assert_true(all(cs40.eq.cmplx(0.0,0.0)), & + 'non-finite MSK40 correlation keeps averaged data initialized') + call assert_true(all(xccs40.eq.0.0), & + 'non-finite MSK40 correlation keeps correlation data initialized') + end subroutine test_frequency_searches + + subroutine test_msk40_sync_column + integer, parameter :: NSPM=240 + complex :: cb(42),c(NSPM),cdat(NSPM) + integer :: navmask(1),npklocs(1),nsuccess + real :: fest + + call make_msk40_sync_word(cb) + cdat=cmplx(0.0,0.0) + cdat(1:42)=cb + navmask=1 + call msk40sync(cdat,1,0,1.0,navmask,1,0.0,fest,npklocs,nsuccess,c) + call assert_true(npklocs(1).eq.1, & + 'MSK40 lag-zero correlation remains in the first column bin') + end subroutine test_msk40_sync_column + + subroutine make_msk40_sync_word(cb) + complex, intent(out) :: cb(42) + integer :: i,s8r(8) + real :: angle,cbi(42),cbq(42),pi,pp(12) + + pi=4.0*atan(1.0) + do i=1,12 + angle=(i-1)*pi/12.0 + pp(i)=sin(angle) + enddo + s8r=(/1,0,1,1,0,0,0,1/) + s8r=2*s8r-1 + cbq(1:6)=pp(7:12)*s8r(1) + cbq(7:18)=pp*s8r(3) + cbq(19:30)=pp*s8r(5) + cbq(31:42)=pp*s8r(7) + cbi(1:12)=pp*s8r(2) + cbi(13:24)=pp*s8r(4) + cbi(25:36)=pp*s8r(6) + cbi(37:42)=pp(1:6)*s8r(8) + cb=cmplx(cbi,cbq) + end subroutine make_msk40_sync_word + + subroutine test_short_ping_input_bounds + integer, parameter :: NSPM40=240,MAXSTEPS40=150 + integer, parameter :: NSPM144=864,MAXSTEPS144=100 + integer, parameter :: N40=NSPM40+(MAXSTEPS40+1)*60 + integer, parameter :: N144=NSPM144+(MAXSTEPS144+1)*216 + character(len=12) :: hiscall,mycall + character(len=37) :: message + complex, allocatable :: c40(:),c144(:) + complex :: ct(NSPM144) + integer :: navg,nhasharray(MAXRECENT,MAXRECENT),nsuccess + logical(kind=1) :: bswl + real :: fret,nan_value,softbits(144),tret + + allocate(c40(N40),c144(N144)) + c144=cmplx(0.0,0.0) + c40=cmplx(0.0,0.0) + mycall='K1ABC' + hiscall='W9XYZ' + bswl=.false. + nhasharray=0 + + nsuccess=-1 + call msk144spd(c144,1,50,nsuccess,message,1500.0,fret,tret,navg,ct, & + softbits) + call assert_true(nsuccess.eq.0 .and. len_trim(message).eq.0, & + 'short MSK144 input returns no decode') + + nsuccess=-1 + call msk40spd(c40,1,50,mycall,hiscall,bswl,nhasharray,nsuccess, & + message,1500.0,fret,tret,navg) + call assert_true(nsuccess.eq.0 .and. len_trim(message).eq.0, & + 'short MSK40 input returns no decode') + + nsuccess=-1 + call msk144spd(c144,N144,50,nsuccess,message,1500.0,fret,tret,navg,ct, & + softbits) + call assert_true(nsuccess.eq.0 .and. len_trim(message).eq.0, & + 'oversized MSK144 input returns no decode within metric bounds') + + nsuccess=-1 + call msk40spd(c40,N40,50,mycall,hiscall,bswl,nhasharray,nsuccess, & + message,1500.0,fret,tret,navg) + call assert_true(nsuccess.eq.0 .and. len_trim(message).eq.0, & + 'oversized MSK40 input returns no decode within metric bounds') + + nsuccess=-1 + call msk144spd(c144,N144,-1,nsuccess,message,1500.0,fret,tret,navg,ct, & + softbits) + call assert_true(nsuccess.eq.0 .and. len_trim(message).eq.0, & + 'reversed MSK144 windows return no decode') + + nsuccess=-1 + call msk40spd(c40,N40,-1,mycall,hiscall,bswl,nhasharray,nsuccess, & + message,1500.0,fret,tret,navg) + call assert_true(nsuccess.eq.0 .and. len_trim(message).eq.0, & + 'reversed MSK40 windows return no decode') + + nsuccess=-1 + call msk144spd(c144,N144,huge(0),nsuccess,message,1500.0,fret,tret,navg, & + ct,softbits) + call assert_true(nsuccess.eq.0 .and. len_trim(message).eq.0, & + 'extreme MSK144 tolerance returns no decode without overflow') + + nsuccess=-1 + call msk40spd(c40,N40,huge(0),mycall,hiscall,bswl,nhasharray,nsuccess, & + message,1500.0,fret,tret,navg) + call assert_true(nsuccess.eq.0 .and. len_trim(message).eq.0, & + 'extreme MSK40 tolerance returns no decode without overflow') + + nsuccess=-1 + call msk144spd(c144,N144,50,nsuccess,message,huge(1.0),fret,tret,navg, & + ct,softbits) + call assert_true(nsuccess.eq.0 .and. len_trim(message).eq.0, & + 'out-of-range MSK144 frequency returns no decode') + + nan_value=ieee_value(0.0,ieee_quiet_nan) + nsuccess=-1 + call msk40spd(c40,N40,50,mycall,hiscall,bswl,nhasharray,nsuccess, & + message,nan_value,fret,tret,navg) + call assert_true(nsuccess.eq.0 .and. len_trim(message).eq.0, & + 'non-finite MSK40 frequency returns no decode') + end subroutine test_short_ping_input_bounds + + subroutine assert_close(actual,expected,message) + real, intent(in) :: actual,expected + character(len=*), intent(in) :: message + + call assert_true(abs(actual-expected).lt.1.0e-6,message) + end subroutine assert_close + + subroutine assert_true(condition,message) + logical, intent(in) :: condition + character(len=*), intent(in) :: message + + if(.not.condition) then + write(*,'(a)') message + error stop 1 + endif + end subroutine assert_true + +end program test_msk_spectrum_edges diff --git a/tests/unit/network/CMakeLists.txt b/tests/unit/network/CMakeLists.txt new file mode 100644 index 00000000..6087a11d --- /dev/null +++ b/tests/unit/network/CMakeLists.txt @@ -0,0 +1,77 @@ +add_executable (test_pskreporter_ipfix + test_pskreporter_ipfix.cpp + ${CMAKE_SOURCE_DIR}/Network/PSKReporterIPFIX.cpp + ) +target_link_libraries (test_pskreporter_ipfix Qt5::Test) +add_test (NAME test_pskreporter_ipfix COMMAND test_pskreporter_ipfix) + +add_executable (test_pskreporter_transport + test_pskreporter_transport.cpp + ${CMAKE_SOURCE_DIR}/Network/PSKReporter.cpp + ${CMAKE_SOURCE_DIR}/Network/PSKReporterIPFIX.cpp + ) +target_link_libraries (test_pskreporter_transport wsjt_cxx Qt5::Test Qt5::Network) +add_test (NAME test_pskreporter_transport COMMAND test_pskreporter_transport) + +add_executable (test_map65_pskreporter_settings + test_map65_pskreporter_settings.cpp + ${CMAKE_SOURCE_DIR}/map65/pskreporter_settings.cpp + ) +target_link_libraries (test_map65_pskreporter_settings Qt5::Test) +add_test (NAME test_map65_pskreporter_settings COMMAND test_map65_pskreporter_settings) + +add_executable (test_map65_pskreporter_decode + test_map65_pskreporter_decode.cpp + ${CMAKE_SOURCE_DIR}/map65/pskreporter_decode.cpp + ${CMAKE_SOURCE_DIR}/Network/DecodedTime.cpp + ${CMAKE_SOURCE_DIR}/validators/LiveCQCallsign.cpp +) +target_link_libraries (test_map65_pskreporter_decode Qt5::Test) +add_test (NAME test_map65_pskreporter_decode COMMAND test_map65_pskreporter_decode) + +add_executable (test_wsprnet_upload + test_wsprnet_upload.cpp + ${CMAKE_SOURCE_DIR}/Network/wsprnet.cpp + ) +target_link_libraries (test_wsprnet_upload Qt5::Test Qt5::Network) +add_test (NAME test_wsprnet_upload COMMAND test_wsprnet_upload) + +add_executable (test_message_client_replay + test_message_client_replay.cpp + ) +target_link_libraries (test_message_client_replay wsjt_qt Qt5::Test Qt5::Network) +add_test (NAME test_message_client_replay COMMAND test_message_client_replay) + +add_executable (test_message_client_inhibit_status + test_message_client_inhibit_status.cpp + ) +target_link_libraries (test_message_client_inhibit_status wsjt_qt Qt5::Test Qt5::Network) +add_test (NAME test_message_client_inhibit_status COMMAND test_message_client_inhibit_status) + +add_executable (test_message_server + test_message_server.cpp + ) +target_link_libraries (test_message_server wsjtx_udp-static Qt5::Test Qt5::Network) +add_test (NAME test_message_server COMMAND test_message_server) + +add_executable (test_cloudlog_connection_check + test_cloudlog_connection_check.cpp + test_cloudlog_revision_stub.cpp + ${CMAKE_SOURCE_DIR}/Network/Cloudlog.cpp + ) +add_dependencies (test_cloudlog_connection_check revisiontag) +target_include_directories (test_cloudlog_connection_check PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries (test_cloudlog_connection_check Boost::log Qt5::Test Qt5::Network Qt5::Widgets) +add_test (NAME test_cloudlog_connection_check COMMAND test_cloudlog_connection_check) + +if (WSJT_ENABLE_TSAN) + set (wsjt_tsan_network_test_environment + "QT_QPA_PLATFORM=offscreen" + "TSAN_OPTIONS=${wsjt_tsan_network_options}") + set_tests_properties ( + test_pskreporter_transport + test_message_client_replay + test_message_server + test_cloudlog_connection_check + PROPERTIES ENVIRONMENT "${wsjt_tsan_network_test_environment}") +endif () diff --git a/tests/unit/network/test_cloudlog_connection_check.cpp b/tests/unit/network/test_cloudlog_connection_check.cpp new file mode 100644 index 00000000..b9808ac5 --- /dev/null +++ b/tests/unit/network/test_cloudlog_connection_check.cpp @@ -0,0 +1,650 @@ +#include + +#include +#include +#include +#include +#include +#include + +#include "Network/Cloudlog.hpp" + +class TestCloudlogConfiguration final + : public CloudlogConfiguration +{ +public: + TestCloudlogConfiguration (QString const& url, QString const& apiKey, qint32 stationId) + : url {url} + , apiKey {apiKey} + , stationId {stationId} + { + } + + QString url; + QString apiKey; + qint32 stationId {0}; + + QString cloudlog_api_url () const override + { + return url; + } + + QString cloudlog_api_key () const override + { + return apiKey; + } + + qint32 cloudlog_api_station_id () const override + { + return stationId; + } +}; + +namespace +{ + struct FakeResponse + { + FakeResponse () = default; + FakeResponse (int status, QByteArray const& body, QNetworkReply::NetworkError error = QNetworkReply::NoError, + QString const& errorString = {}, bool autoFinish = true) + : status {status} + , body {body} + , error {error} + , errorString {errorString} + , autoFinish {autoFinish} + { + } + + int status {200}; + QByteArray body; + QNetworkReply::NetworkError error {QNetworkReply::NoError}; + QString errorString; + bool autoFinish {true}; + }; + + struct CapturedRequest + { + QString method; + QUrl url; + QByteArray payload; + QByteArray contentType; + QByteArray accept; + }; + + class FakeReply final + : public QNetworkReply + { + Q_OBJECT + + public: + FakeReply (QNetworkRequest const& request, FakeResponse const& response, QObject * parent) + : QNetworkReply {parent} + , data_ {response.body} + { + setRequest (request); + setUrl (request.url ()); + setOpenMode (QIODevice::ReadOnly); + if (response.status) + { + setAttribute (QNetworkRequest::HttpStatusCodeAttribute, response.status); + } + if (QNetworkReply::NoError != response.error) + { + setError (response.error, response.errorString); + } + + if (response.autoFinish) + { + QTimer::singleShot (0, this, [this] { + finishNow (); + }); + } + } + + void finishNow () + { + if (finished_) + { + return; + } + finished_ = true; + setFinished (true); + Q_EMIT readyRead (); + Q_EMIT finished (); + } + + void abort () override + { + setError (QNetworkReply::OperationCanceledError, QStringLiteral ("operation canceled")); + } + + qint64 bytesAvailable () const override + { + return data_.size () - offset_ + QNetworkReply::bytesAvailable (); + } + + protected: + qint64 readData (char * buffer, qint64 maxSize) override + { + auto const remaining = data_.size () - offset_; + if (remaining <= 0) + { + return -1; + } + auto const size = qMin (maxSize, static_cast (remaining)); + memcpy (buffer, data_.constData () + offset_, static_cast (size)); + offset_ += size; + return size; + } + + private: + QByteArray data_; + qint64 offset_ {0}; + bool finished_ {false}; + }; + + class FakeNetworkAccessManager final + : public QNetworkAccessManager + { + Q_OBJECT + + public: + void queueResponse (FakeResponse const& response) + { + responses_.append (response); + } + + void queueJson (int status, QByteArray const& body, QNetworkReply::NetworkError error = QNetworkReply::NoError, + QString const& errorString = {}) + { + queueResponse ({status, body, error, errorString}); + } + + void queueWritableJsonAuth () + { + queueJson (200, QByteArray {R"({"status":"valid","rights":"rw"})"}); + } + + void queueStationInfo (QByteArray const& body) + { + queueJson (200, body); + } + + void queueManifest (QByteArray const& body, int status = 200) + { + queueJson (status, body, status >= 400 ? QNetworkReply::ContentNotFoundError : QNetworkReply::NoError, + status >= 400 ? QStringLiteral ("not found") : QString {}); + } + + QList requests () const + { + return requests_; + } + + QList> replies () const + { + return replies_; + } + + protected: + QNetworkReply * createRequest (Operation operation, QNetworkRequest const& request, QIODevice * outgoingData) override + { + CapturedRequest captured; + captured.method = operation == GetOperation ? QStringLiteral ("GET") : QStringLiteral ("POST"); + captured.url = request.url (); + captured.contentType = request.header (QNetworkRequest::ContentTypeHeader).toByteArray (); + captured.accept = request.rawHeader ("Accept"); + if (outgoingData) + { + captured.payload = outgoingData->readAll (); + } + requests_.append (captured); + + auto response = responses_.isEmpty () ? FakeResponse {404, QByteArray {"not found"}, QNetworkReply::ContentNotFoundError, QStringLiteral ("not found")} : responses_.takeFirst (); + auto * reply = new FakeReply {request, response, this}; + replies_.append (reply); + return reply; + } + + private: + QList responses_; + QList requests_; + QList> replies_; + }; + + Cloudlog::ConnectionCheckResult runCheck (FakeNetworkAccessManager& network, int stationId = 7) + { + Cloudlog cloudlog {nullptr, &network}; + QSignalSpy spy {&cloudlog, &Cloudlog::connection_check_finished}; + cloudlog.checkConnection ({QStringLiteral (" https://example.test/api/qso/ "), + QStringLiteral ("secret/key"), + stationId}); + if (spy.isEmpty ()) + { + spy.wait (1000); + } + Q_ASSERT (!spy.isEmpty ()); + return qvariant_cast (spy.takeFirst ().at (0)); + } + + QByteArray json (QString const& text) + { + return text.toUtf8 (); + } + + Cloudlog::UploadResult runLogQso (FakeNetworkAccessManager& network, FakeResponse const& response) + { + TestCloudlogConfiguration configuration { + QStringLiteral (" https://example.test/index.php/api/qso/ "), + QStringLiteral ("secret/key"), + 7}; + network.queueResponse (response); + + Cloudlog cloudlog {&configuration, &network}; + QSignalSpy spy {&cloudlog, &Cloudlog::qso_upload_finished}; + cloudlog.logQso (QByteArray {"K1ABC"}); + if (spy.isEmpty ()) + { + spy.wait (1000); + } + Q_ASSERT (!spy.isEmpty ()); + return qvariant_cast (spy.takeFirst ().at (0)); + } + + int qsoTruePostCount (QList const& requests) + { + int count {0}; + for (auto const& request : requests) + { + if (request.method == QStringLiteral ("POST") && request.url.path ().endsWith (QStringLiteral ("/qso/true"))) + { + ++count; + } + } + return count; + } +} + +class TestCloudlogConnectionCheck final + : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void initTestCase () + { + qRegisterMetaType ("Cloudlog::ConnectionCheckResult"); + qRegisterMetaType ("ConnectionCheckResult"); + qRegisterMetaType ("Cloudlog::UploadResult"); + qRegisterMetaType ("UploadResult"); + } + + void normalizesBaseUrl_data () + { + QTest::addColumn ("input"); + QTest::addColumn ("expected"); + + QTest::newRow ("base") << "https://log.example" << "https://log.example"; + QTest::newRow ("trailing slash") << "https://log.example/" << "https://log.example"; + QTest::newRow ("api qso") << " https://log.example/api/qso/ " << "https://log.example"; + QTest::newRow ("index qso") << "https://log.example/index.php/api/qso/" << "https://log.example"; + } + + void normalizesBaseUrl () + { + QFETCH (QString, input); + QFETCH (QString, expected); + + QCOMPARE (Cloudlog::normalizeBaseUrl (input), expected); + } + + void buildsEscapedJsonPayload () + { + auto const payload = Cloudlog::qsoUploadPayload (QStringLiteral ("key\"with\\chars"), 42, QByteArray {"K1\"ABCa\\b\nc"}); + auto const document = QJsonDocument::fromJson (payload); + QVERIFY (document.isObject ()); + auto const object = document.object (); + QCOMPARE (object.value (QStringLiteral ("key")).toString (), QStringLiteral ("key\"with\\chars")); + QCOMPARE (object.value (QStringLiteral ("station_profile_id")).toString (), QStringLiteral ("42")); + QCOMPARE (object.value (QStringLiteral ("type")).toString (), QStringLiteral ("adif")); + QCOMPARE (object.value (QStringLiteral ("string")).toString (), QStringLiteral ("K1\"ABCa\\b\nc")); + } + + void classifiesQsoUploadReplies_data () + { + QTest::addColumn ("httpStatus"); + QTest::addColumn ("networkError"); + QTest::addColumn ("errorString"); + QTest::addColumn ("body"); + QTest::addColumn ("expectedStatus"); + QTest::addColumn ("expectedDetail"); + + QTest::newRow ("success created") + << 201 + << static_cast (QNetworkReply::NoError) + << QString {} + << json (R"({"status":"created"})") + << Cloudlog::UploadStatus::Success + << QString {}; + + QTest::newRow ("transport") + << 0 + << static_cast (QNetworkReply::HostNotFoundError) + << QStringLiteral ("host not found") + << QByteArray {} + << Cloudlog::UploadStatus::NetworkError + << QStringLiteral ("host not found"); + + QTest::newRow ("http non-json") + << 500 + << static_cast (QNetworkReply::InternalServerError) + << QStringLiteral ("server error") + << QByteArray {"internal error"} + << Cloudlog::UploadStatus::HttpError + << QStringLiteral ("HTTP status 500"); + + QTest::newRow ("http json") + << 403 + << static_cast (QNetworkReply::ContentAccessDenied) + << QStringLiteral ("forbidden") + << json (R"({"message":"missing upload rights"})") + << Cloudlog::UploadStatus::HttpError + << QStringLiteral ("missing upload rights"); + + QTest::newRow ("server failed") + << 200 + << static_cast (QNetworkReply::NoError) + << QString {} + << json (R"({"status":"failed","reason":"bad ADIF"})") + << Cloudlog::UploadStatus::Rejected + << QStringLiteral ("bad ADIF"); + + QTest::newRow ("non-json success code") + << 200 + << static_cast (QNetworkReply::NoError) + << QString {} + << QByteArray {"ok"} + << Cloudlog::UploadStatus::UnexpectedResponse + << QStringLiteral ("illegal value"); + } + + void classifiesQsoUploadReplies () + { + QFETCH (int, httpStatus); + QFETCH (int, networkError); + QFETCH (QString, errorString); + QFETCH (QByteArray, body); + QFETCH (Cloudlog::UploadStatus, expectedStatus); + QFETCH (QString, expectedDetail); + + FakeNetworkAccessManager network; + auto const result = runLogQso (network, {httpStatus, body, static_cast (networkError), errorString}); + + QCOMPARE (result.status, expectedStatus); + QCOMPARE (result.httpStatusCode, httpStatus); + QCOMPARE (network.requests ().size (), 1); + QCOMPARE (network.requests ().at (0).method, QStringLiteral ("POST")); + QCOMPARE (network.requests ().at (0).url.path (), QStringLiteral ("/index.php/api/qso")); + QCOMPARE (network.requests ().at (0).contentType, QByteArray {"application/json"}); + QCOMPARE (network.requests ().at (0).accept, QByteArray {"application/json"}); + if (!expectedDetail.isEmpty ()) + { + QVERIFY2 (result.detail.contains (expectedDetail), qPrintable (result.detail)); + } + } + + void emitsOnlySuccessForAcceptedQsoUpload () + { + FakeNetworkAccessManager network; + auto const result = runLogQso (network, {201, json (R"({"status":"created"})")}); + + QCOMPARE (result.status, Cloudlog::UploadStatus::Success); + QVERIFY (result.message.isEmpty ()); + QVERIFY (result.detail.isEmpty ()); + QCOMPARE (result.httpStatusCode, 201); + } + + void acceptsWritableClassicWithoutDryRun () + { + FakeNetworkAccessManager network; + network.queueResponse ({404, QByteArray {"not found"}, QNetworkReply::ContentNotFoundError, QStringLiteral ("not found")}); + network.queueResponse ({404, QByteArray {"not found"}, QNetworkReply::ContentNotFoundError, QStringLiteral ("not found")}); + network.queueResponse ({200, QByteArray {"Validrw"}}); + network.queueResponse ({200, json (R"([{"station_id":"7","station_profile_name":"Home","station_callsign":"K1ABC"}])")}); + network.queueResponse ({200, json (R"({"name":"Cloudlog","short_name":"Cloudlog"})")}); + + auto const result = runCheck (network); + + QCOMPARE (result.status, Cloudlog::ConnectionCheckStatus::Success); + QVERIFY (result.detail.contains (QStringLiteral ("No safe dry-run QSO endpoint"))); + auto const requests = network.requests (); + QCOMPARE (requests.size (), 5); + QCOMPARE (requests.at (0).url.path (QUrl::FullyEncoded), QStringLiteral ("/api/check_auth/secret%2Fkey")); + QCOMPARE (requests.at (2).url.path (QUrl::FullyEncoded), QStringLiteral ("/index.php/api/auth/secret%2Fkey")); + QCOMPARE (requests.at (3).url.path (QUrl::FullyEncoded), QStringLiteral ("/index.php/api/station_info/secret%2Fkey")); + QCOMPARE (requests.at (4).url.path (), QStringLiteral ("/manifest.json")); + QCOMPARE (qsoTruePostCount (requests), 0); + } + + void acceptsJsonCloudlogWithoutDryRun () + { + FakeNetworkAccessManager network; + network.queueWritableJsonAuth (); + network.queueStationInfo (json (R"([{"station_id":7,"station_profile_name":"Home"}])")); + network.queueManifest (json (R"({"name":"Cloudlog"})")); + + auto const result = runCheck (network); + + QCOMPARE (result.status, Cloudlog::ConnectionCheckStatus::Success); + QVERIFY (result.detail.contains (QStringLiteral ("No safe dry-run QSO endpoint"))); + auto const requests = network.requests (); + QCOMPARE (requests.size (), 3); + QCOMPARE (requests.at (2).url.path (), QStringLiteral ("/manifest.json")); + QCOMPARE (qsoTruePostCount (requests), 0); + } + + void reportsReadOnlyKey () + { + FakeNetworkAccessManager network; + network.queueResponse ({200, json (R"({"status":"valid","rights":"r"})")}); + + auto const result = runCheck (network); + + QCOMPARE (result.status, Cloudlog::ConnectionCheckStatus::ReadOnlyKey); + QVERIFY (result.detail.contains (QStringLiteral ("read/write API key"))); + QCOMPARE (network.requests ().size (), 1); + } + + void reportsInvalidKey () + { + FakeNetworkAccessManager network; + network.queueResponse ({200, json (R"({"status":"invalid","message":"bad key"})")}); + + auto const result = runCheck (network); + + QCOMPARE (result.status, Cloudlog::ConnectionCheckStatus::InvalidKey); + QCOMPARE (result.detail, QStringLiteral ("bad key")); + } + + void rejectsAuthWithoutRights () + { + FakeNetworkAccessManager network; + network.queueResponse ({200, json (R"({"status":"valid"})")}); + + auto const result = runCheck (network); + + QCOMPARE (result.status, Cloudlog::ConnectionCheckStatus::UnexpectedResponse); + QVERIFY (result.detail.contains (QStringLiteral ("rights"))); + } + + void rejectsXmlAuthWithoutRights () + { + FakeNetworkAccessManager network; + network.queueResponse ({404, QByteArray {"not found"}, QNetworkReply::ContentNotFoundError, QStringLiteral ("not found")}); + network.queueResponse ({404, QByteArray {"not found"}, QNetworkReply::ContentNotFoundError, QStringLiteral ("not found")}); + network.queueResponse ({200, QByteArray {"Valid"}}); + + auto const result = runCheck (network); + + QCOMPARE (result.status, Cloudlog::ConnectionCheckStatus::UnexpectedResponse); + QVERIFY (result.detail.contains (QStringLiteral ("rights"))); + } + + void reportsMissingStationProfile () + { + FakeNetworkAccessManager network; + network.queueResponse ({200, json (R"({"status":"valid","rights":"rw"})")}); + network.queueResponse ({200, json (R"([{"station_id":"8","station_profile_name":"Portable","station_callsign":"K1ABC/P"}])")}); + + auto const result = runCheck (network); + + QCOMPARE (result.status, Cloudlog::ConnectionCheckStatus::StationProfileUnavailable); + QVERIFY (result.detail.contains (QStringLiteral ("8 - Portable - K1ABC/P"))); + QCOMPARE (result.stationProfiles.size (), 1); + QCOMPARE (result.stationProfiles.at (0).id, 8); + QCOMPARE (result.stationProfiles.at (0).name, QStringLiteral ("Portable")); + QCOMPARE (result.stationProfiles.at (0).callsign, QStringLiteral ("K1ABC/P")); + } + + void ignoresNestedNonStationObjects () + { + FakeNetworkAccessManager network; + network.queueResponse ({200, json (R"({"status":"valid","rights":"rw"})")}); + network.queueResponse ({200, json (R"({"metadata":{"id":7,"name":"Not a station"},"stations":[{"station_id":8,"station_profile_name":"Portable"}]})")}); + + auto const result = runCheck (network); + + QCOMPARE (result.status, Cloudlog::ConnectionCheckStatus::StationProfileUnavailable); + QVERIFY (!result.detail.contains (QStringLiteral ("Not a station"))); + QVERIFY (result.detail.contains (QStringLiteral ("8 - Portable"))); + QCOMPARE (result.stationProfiles.size (), 1); + QCOMPARE (result.stationProfiles.at (0).id, 8); + } + + void acceptsCurrentWavelogDryRunResponse () + { + FakeNetworkAccessManager network; + network.queueWritableJsonAuth (); + network.queueStationInfo (json (R"({"stations":[{"station_id":7,"station_profile_name":"Home"}]})")); + network.queueManifest (json (R"({"name":"Wavelog","short_name":"Wavelog"})")); + network.queueJson (201, json (R"({"status":"created","type":"adif","string":"","adif_count":0,"adif_errors":0,"messages":["Dryrun works"]})")); + + auto const result = runCheck (network); + + QCOMPARE (result.status, Cloudlog::ConnectionCheckStatus::Success); + QVERIFY (result.detail.contains (QStringLiteral ("dry-run QSO upload"))); + QCOMPARE (result.stationProfiles.size (), 1); + QCOMPARE (result.stationProfiles.at (0).id, 7); + auto const requests = network.requests (); + QCOMPARE (requests.size (), 4); + QCOMPARE (requests.at (2).method, QStringLiteral ("GET")); + QCOMPARE (requests.at (2).url.path (), QStringLiteral ("/manifest.json")); + QCOMPARE (requests.at (3).method, QStringLiteral ("POST")); + QCOMPARE (requests.at (3).url.path (), QStringLiteral ("/api/qso/true")); + QCOMPARE (requests.at (3).contentType, QByteArray {"application/json"}); + QCOMPARE (requests.at (3).accept, QByteArray {"application/json"}); + auto const payload = QJsonDocument::fromJson (requests.at (3).payload).object (); + QCOMPARE (payload.value (QStringLiteral ("station_profile_id")).toString (), QStringLiteral ("7")); + QCOMPARE (payload.value (QStringLiteral ("type")).toString (), QStringLiteral ("adif")); + } + + void acceptsUnknownManifestWithoutDryRun () + { + FakeNetworkAccessManager network; + network.queueWritableJsonAuth (); + network.queueStationInfo (json (R"([{"station_id":7}])")); + network.queueManifest (QByteArray {"not found"}, 404); + + auto const result = runCheck (network); + + QCOMPARE (result.status, Cloudlog::ConnectionCheckStatus::Success); + QVERIFY (result.detail.contains (QStringLiteral ("No safe dry-run QSO endpoint"))); + QCOMPARE (qsoTruePostCount (network.requests ()), 0); + } + + void reportsDryRunForbidden () + { + FakeNetworkAccessManager network; + network.queueResponse ({200, json (R"({"status":"valid","rights":"rw"})")}); + network.queueResponse ({200, json (R"([{"station_id":7}])")}); + network.queueResponse ({200, json (R"({"short_name":"Wavelog"})")}); + network.queueResponse ({403, json (R"({"status":"failed","reason":"read-only upload key"})"), QNetworkReply::ContentAccessDenied, QStringLiteral ("forbidden")}); + + auto const result = runCheck (network); + + QCOMPARE (result.status, Cloudlog::ConnectionCheckStatus::UploadShapeRejected); + QCOMPARE (result.detail, QStringLiteral ("read-only upload key")); + } + + void reportsDryRunAdifMessages () + { + FakeNetworkAccessManager network; + network.queueResponse ({200, json (R"({"status":"valid","rights":"rw"})")}); + network.queueResponse ({200, json (R"([{"station_id":7}])")}); + network.queueResponse ({200, json (R"({"name":"Wavelog"})")}); + network.queueResponse ({400, json (R"({"status":"failed","messages":["station_profile_id is required","bad ADIF"]})"), QNetworkReply::ProtocolInvalidOperationError, QStringLiteral ("bad request")}); + + auto const result = runCheck (network); + + QCOMPARE (result.status, Cloudlog::ConnectionCheckStatus::UploadShapeRejected); + QVERIFY (result.detail.contains (QStringLiteral ("station_profile_id is required"))); + QVERIFY (result.detail.contains (QStringLiteral ("bad ADIF"))); + } + + void reportsNetworkFailure () + { + FakeNetworkAccessManager network; + network.queueResponse ({0, {}, QNetworkReply::HostNotFoundError, QStringLiteral ("host not found")}); + + auto const result = runCheck (network); + + QCOMPARE (result.status, Cloudlog::ConnectionCheckStatus::NetworkError); + QCOMPARE (result.detail, QStringLiteral ("host not found")); + } + + void reportsStationInfoNotJson () + { + FakeNetworkAccessManager network; + network.queueWritableJsonAuth (); + network.queueJson (404, QByteArray {"not found"}, QNetworkReply::ContentNotFoundError, QStringLiteral ("not found")); + + auto const result = runCheck (network); + + QCOMPARE (result.status, Cloudlog::ConnectionCheckStatus::UnexpectedResponse); + QVERIFY (result.message.contains (QStringLiteral ("Station profile response"))); + } + + void ignoresStaleOverlappingConnectionCheckReply () + { + FakeNetworkAccessManager network; + network.queueResponse ({200, json (R"({"status":"valid","rights":"rw"})"), QNetworkReply::NoError, {}, false}); + network.queueResponse ({200, json (R"({"status":"valid","rights":"rw"})")}); + network.queueResponse ({200, json (R"([{"station_id":9}])")}); + network.queueResponse ({200, json (R"({"name":"Cloudlog"})")}); + + Cloudlog cloudlog {nullptr, &network}; + QSignalSpy spy {&cloudlog, &Cloudlog::connection_check_finished}; + cloudlog.checkConnection ({QStringLiteral ("https://first.example"), QStringLiteral ("first"), 7}); + auto replies = network.replies (); + QCOMPARE (replies.size (), 1); + QVERIFY (replies.at (0)); + auto * stale = replies.at (0).data (); + + cloudlog.checkConnection ({QStringLiteral ("https://second.example"), QStringLiteral ("second"), 9}); + stale->finishNow (); + + if (spy.isEmpty ()) + { + spy.wait (1000); + } + QCOMPARE (spy.size (), 1); + auto const result = qvariant_cast (spy.takeFirst ().at (0)); + QCOMPARE (result.status, Cloudlog::ConnectionCheckStatus::Success); + QCOMPARE (result.normalizedBaseUrl, QStringLiteral ("https://second.example")); + QCOMPARE (qsoTruePostCount (network.requests ()), 0); + } +}; + +QTEST_GUILESS_MAIN (TestCloudlogConnectionCheck) + +#include "test_cloudlog_connection_check.moc" diff --git a/tests/unit/network/test_cloudlog_revision_stub.cpp b/tests/unit/network/test_cloudlog_revision_stub.cpp new file mode 100644 index 00000000..9b63084c --- /dev/null +++ b/tests/unit/network/test_cloudlog_revision_stub.cpp @@ -0,0 +1,6 @@ +#include "revision_utils.hpp" + +QString http_user_agent () +{ + return QStringLiteral ("WSJT-X/test"); +} diff --git a/tests/unit/network/test_map65_pskreporter_decode.cpp b/tests/unit/network/test_map65_pskreporter_decode.cpp new file mode 100644 index 00000000..a2c847d9 --- /dev/null +++ b/tests/unit/network/test_map65_pskreporter_decode.cpp @@ -0,0 +1,166 @@ +#include + +#include + +#include "map65/pskreporter_decode.h" + +namespace +{ + QDateTime nowUtc() + { + return {QDate {2026, 8, 17}, QTime {12, 34, 56}, Qt::UTC}; + } + + QString decodeLine(QStringList const& message, QString const& time = "1234") + { + return (QStringList {"50313.0", "1000", "0.1", time, "-12"} + message) + .join(' '); + } + +} + +class TestMap65PSKReporterDecode final : public QObject +{ + Q_OBJECT + +private slots: + void acceptsMap65Callsigns() + { + const auto valid = QStringList { + "K1ABC", "YW18FIFA", "QU1RK", "", "K1ABC/P", "N5L", "GM/N5L" + }; + for (auto const& callsign : valid) { + QVERIFY2(Map65PSKReporter::isValidMap65Callsign(callsign), + qPrintable(callsign)); + } + + const auto invalid = QStringList { + "", "N", "N5", "KABC", "Q1ABC", "K1AB1", "K1ABCDE", "K1AB-C", "K1AB?" + }; + for (auto const& callsign : invalid) { + QVERIFY2(!Map65PSKReporter::isValidMap65Callsign(callsign), + qPrintable(callsign)); + } + } + + void parsesFourDecodeLayouts() + { + QStringList seen; + auto const spots = Map65PSKReporter::parseMap65PSKReporterSpots( + { + decodeLine({"CQ", "K1ABC", "1200.0", "#A"}), + decodeLine({"CQ", "K1ABC", "FN20", "1200.0", ":B"}), + decodeLine({"CQ", "DX", "K1ABC", "1200.0", "#C"}), + decodeLine({"CQ", "DX", "K1ABC", "FN20", "1200.0", ":D"}) + }, "N0CALL", "FN21", nowUtc(), seen); + + QCOMPARE(spots.size(), 4); + QCOMPARE(spots.at(0).callsign, QString {"K1ABC"}); + QCOMPARE(spots.at(0).locator, QString {"--"}); + QCOMPARE(spots.at(0).mode, QString {"JT65A"}); + QCOMPARE(spots.at(1).locator, QString {"FN20"}); + QCOMPARE(spots.at(1).mode, QString {"Q65-60B"}); + QCOMPARE(spots.at(2).locator, QString {"--"}); + QCOMPARE(spots.at(2).mode, QString {"JT65C"}); + QCOMPARE(spots.at(3).locator, QString {"FN20"}); + QCOMPARE(spots.at(3).mode, QString {"Q65-60D"}); + } + + void acceptsAllReportableMessageTypes() + { + QStringList seen; + QStringList lines; + for (auto const& type : {QString {"CQ"}, QString {"QRZ"}, QString {"CQV"}, + QString {"CQH"}, QString {"QRT"}}) { + lines.append(decodeLine({type, "K1ABC", "1200.0", "#A"})); + } + lines.append(decodeLine({"DE", "K1ABC", "1200.0", "#A"})); + + auto const spots = Map65PSKReporter::parseMap65PSKReporterSpots( + lines, "N0CALL", "FN21", nowUtc(), seen); + QCOMPARE(spots.size(), 5); + } + + void preservesSpotFieldsAndLegacySnr() + { + QStringList seen; + auto const spots = Map65PSKReporter::parseMap65PSKReporterSpots( + {decodeLine({"CQ", "k1abc", "1200.0", "#A"})}, + "N0CALL", "FN21", nowUtc(), seen); + QCOMPARE(spots.size(), 1); + auto const& spot = spots.first(); + QCOMPARE(spot.callsign, QString {"K1ABC"}); + QCOMPARE(spot.frequency, Radio::Frequency {50313000000LL}); + QCOMPARE(spot.snr, -10); + auto const expectedTime = QDateTime { + QDate {2026, 8, 17}, QTime {12, 34, 0}, Qt::UTC}; + QCOMPARE(spot.time, expectedTime); + } + + void rollsLateDecodeToPreviousUtcDate() + { + QStringList seen; + auto const spots = Map65PSKReporter::parseMap65PSKReporterSpots( + {decodeLine({"CQ", "K1ABC", "235940.0", "#A"}, "235940")}, + "N0CALL", "FN21", nowUtc(), seen); + QCOMPARE(spots.size(), 1); + auto const expectedTime = QDateTime { + QDate {2026, 8, 16}, QTime {23, 59, 40}, Qt::UTC}; + QCOMPARE(spots.first().time, expectedTime); + } + + void acceptsThreeCharacterCallsignDecode() + { + QStringList seen; + auto const spots = Map65PSKReporter::parseMap65PSKReporterSpots( + {decodeLine({"CQ", "N5L", "1200.0", "#A"})}, + "N0CALL", "FN21", nowUtc(), seen); + QCOMPARE(spots.size(), 1); + QCOMPARE(spots.first().callsign, QString {"N5L"}); + } + + void suppressesDuplicateDecodeKeys() + { + auto const first = decodeLine({"CQ", "K1ABC", "1200.0", "#A"}) + + " trailing-one"; + auto const second = decodeLine({"CQ", "K1ABC", "1200.0", "#A"}) + + " trailing-two"; + QCOMPARE(first.left(53), second.left(53)); + + QStringList seen; + auto const spots = Map65PSKReporter::parseMap65PSKReporterSpots( + {first, second}, "N0CALL", "FN21", nowUtc(), seen); + QCOMPARE(spots.size(), 1); + QCOMPARE(seen.size(), 1); + } + + void rejectsMalformedInput() + { + const auto valid = decodeLine({"CQ", "K1ABC", "1200.0", "#A"}); + const auto malformed = QStringList { + QString {}, + "50313.0 1000 0.1 1234 -12 CQ", + decodeLine({"DE", "K1ABC", "1200.0", "#A"}), + decodeLine({"CQ", "KABC", "1200.0", "#A"}), + decodeLine({"CQ", "K1ABC", "not-a-time", "#A"}), + decodeLine({"CQ", "K1ABC", "1200.0", "?A"}) + }; + + for (auto const& line : malformed) { + QStringList seen; + QVERIFY(Map65PSKReporter::parseMap65PSKReporterSpots( + {line}, "N0CALL", "FN21", nowUtc(), seen).isEmpty()); + } + + QStringList seen; + QVERIFY(Map65PSKReporter::parseMap65PSKReporterSpots( + {valid}, "NO", "FN21", nowUtc(), seen).isEmpty()); + QVERIFY(seen.isEmpty()); + QVERIFY(Map65PSKReporter::parseMap65PSKReporterSpots( + {valid}, "N0CALL", "FN", nowUtc(), seen).isEmpty()); + } +}; + +QTEST_APPLESS_MAIN(TestMap65PSKReporterDecode) + +#include "test_map65_pskreporter_decode.moc" diff --git a/tests/unit/network/test_map65_pskreporter_settings.cpp b/tests/unit/network/test_map65_pskreporter_settings.cpp new file mode 100644 index 00000000..432d533e --- /dev/null +++ b/tests/unit/network/test_map65_pskreporter_settings.cpp @@ -0,0 +1,49 @@ +#include + +#include +#include + +#include "map65/pskreporter_settings.h" + +class TestMap65PSKReporterSettings final : public QObject +{ + Q_OBJECT + +private slots: + void defaultsToEnabledUdp() + { + QTemporaryDir directory; + QVERIFY(directory.isValid()); + + QSettings settings {directory.filePath("map65.ini"), QSettings::IniFormat}; + auto const values = readMap65PSKReporterSettings(settings); + + QVERIFY(values.enabled); + QVERIFY(!values.use_tcpip); + } + + void preservesExplicitEnableAndTransportValues() + { + QTemporaryDir directory; + QVERIFY(directory.isValid()); + auto const filename = directory.filePath("map65.ini"); + { + QSettings settings {filename, QSettings::IniFormat}; + settings.beginGroup("Common"); + settings.setValue("spotPSK", false); + settings.setValue("PSKReporterTCPIP", true); + settings.endGroup(); + settings.sync(); + } + + QSettings settings {filename, QSettings::IniFormat}; + auto const values = readMap65PSKReporterSettings(settings); + + QVERIFY(!values.enabled); + QVERIFY(values.use_tcpip); + } +}; + +QTEST_MAIN(TestMap65PSKReporterSettings) + +#include "test_map65_pskreporter_settings.moc" diff --git a/tests/unit/network/test_message_client_inhibit_status.cpp b/tests/unit/network/test_message_client_inhibit_status.cpp new file mode 100644 index 00000000..6dc77367 --- /dev/null +++ b/tests/unit/network/test_message_client_inhibit_status.cpp @@ -0,0 +1,315 @@ +#include + +#include +#include +#include + +#include + +#include "Network/MessageClient.hpp" +#include "Network/NetworkMessage.hpp" + +class TestMessageClientInhibitStatus final + : public QObject +{ + Q_OBJECT + +private: + static QByteArray command (quint32 ttl = 1000, QByteArray controller = "key-agent", + QByteArray station = "W2SZ", QString id = "test-client", + quint32 schema = 2) + { + QByteArray message; + NetworkMessage::Builder out {&message, NetworkMessage::TxInhibit, id, schema}; + out << controller << ttl << station; + return message; + } + +private Q_SLOTS: + void acceptUdpRequestsAuthorizesCommands () + { + QUdpSocket receiver; + QVERIFY (receiver.bind (QHostAddress {QHostAddress::LocalHost}, 0)); + MessageClient client {"test-client", "version", "revision", "127.0.0.1", + receiver.localPort (), {}, 1}; + QTRY_VERIFY (receiver.hasPendingDatagrams ()); + auto const endpoint = receiver.receiveDatagram (); + QSignalSpy commands {&client, &MessageClient::tx_inhibit_command}; + QSignalSpy clears {&client, &MessageClient::clear_decodes}; + QSignalSpy invalid {&client, &MessageClient::tx_inhibit_invalid}; + QByteArray clear; + NetworkMessage::Builder out {&clear, NetworkMessage::Clear, "test-client", 2}; + out << quint8 {2}; + auto send = [&] (QByteArray const& bytes) { + QCOMPARE (receiver.writeDatagram (bytes, endpoint.senderAddress (), endpoint.senderPort ()), + qint64 (bytes.size ())); + }; + send (command ()); + send (command (99)); + send (clear); + QTest::qWait (150); + QCOMPARE (commands.size (), 0); + QCOMPARE (invalid.size (), 0); + QCOMPARE (clears.size (), 0); + client.enable (true); + send (command (100)); + send (command (30000, "key-agent", "Priority", "test-client", 3)); + send (command (0, "key-agent", {})); + QTRY_COMPARE (commands.size (), 3); + QCOMPARE (commands[0][0].toString (), QString {"key-agent"}); + QCOMPARE (commands[0][1].toUInt (), 100u); + QCOMPARE (commands[1][1].toUInt (), 30000u); + QCOMPARE (commands[1][2].toString (), QString {"Priority"}); + QCOMPARE (commands[2][1].toUInt (), 0u); + QVERIFY (commands[2][2].toString ().isEmpty ()); + send (command (1000, "key-agent", {}, "other-instance")); + send (clear); + QTRY_COMPARE (clears.size (), 1); + QCOMPARE (commands.size (), 3); + client.enable (false); + send (command ()); + send (command (99)); + send (clear); + QTest::qWait (150); + QCOMPARE (commands.size (), 3); + QCOMPARE (invalid.size (), 0); + QCOMPARE (clears.size (), 1); + } + + void rejectsMalformedCommands () + { + QUdpSocket receiver; + QVERIFY (receiver.bind (QHostAddress {QHostAddress::LocalHost}, 0)); + MessageClient client {"test-client", "version", "revision", "127.0.0.1", + receiver.localPort (), {}, 1}; + client.enable (true); + QTRY_VERIFY (receiver.hasPendingDatagrams ()); + auto const endpoint = receiver.receiveDatagram (); + QSignalSpy commands {&client, &MessageClient::tx_inhibit_command}; + QSignalSpy invalid {&client, &MessageClient::tx_inhibit_invalid}; + QList bad { + command (99), command (30001), command (0xffffffff), command (1000, {}), + command (1000, "two words"), command (1000, QByteArray (129, 'a')), + command (1000, QByteArray ("\xc0\xaf", 2)), command (1000, "key", QByteArray (129, 'a')), + command (1000, "key", QByteArray ("\xff", 1)), command (1000, "key", "line\nbreak"), + command (1000, "key", {}, "test-client", 1), command () + QByteArray (4096, 'a') + }; + auto const valid = command (); + for (int length = 12; length < valid.size (); ++length) bad.append (valid.left (length)); + auto corrupt = valid; + corrupt[0] = 0; + bad.append (corrupt); + corrupt = valid; + corrupt[7] = 99; + bad.append (corrupt); + corrupt = valid; + for (int index = 12; index < 16; ++index) corrupt[index] = char (0xff); + bad.append (corrupt); + for (auto const& bytes : bad) + QCOMPARE (receiver.writeDatagram (bytes, endpoint.senderAddress (), endpoint.senderPort ()), + qint64 (bytes.size ())); + auto count = [&] { + quint64 result {0}; + for (auto const& event : invalid) result += event[0].toULongLong (); + return result; + }; + QTRY_COMPARE (count (), quint64 (bad.size ())); + QCOMPARE (commands.size (), 0); + QVERIFY (invalid.size () < bad.size ()); + auto extended = command () + QByteArray {"future fields"}; + receiver.writeDatagram (extended, endpoint.senderAddress (), endpoint.senderPort ()); + QTRY_COMPARE (commands.size (), 1); + } + + void receivesCommandsWhenOutgoingReportingIsDisabled () + { + QUdpSocket receiver; + QVERIFY (receiver.bind (QHostAddress {QHostAddress::LocalHost}, 0)); + MessageClient client {"test-client", "version", "revision", "127.0.0.1", + receiver.localPort (), {}, 1}; + client.enable (true); + QTRY_VERIFY (receiver.hasPendingDatagrams ()); + auto const endpoint = receiver.receiveDatagram (); + QSignalSpy commands {&client, &MessageClient::tx_inhibit_command}; + client.set_server_port (0); + auto const bytes = command (); + QCOMPARE (receiver.writeDatagram (bytes, endpoint.senderAddress (), endpoint.senderPort ()), + qint64 (bytes.size ())); + QTRY_COMPARE (commands.size (), 1); + } + + void reportsInvalidServerThroughExistingErrorSignal () + { + MessageClient client {"test-client", "version", "revision", "", 0, {}, 1}; + QSignalSpy errors {&client, &MessageClient::error}; + client.set_server ("255.255.255.255", {}); + QCOMPARE (errors.size (), 1); + QVERIFY (errors[0][0].toString ().contains ("IPv4 broadcast not supported")); + } + + void portChangeDuringLookupDoesNotCloseClient () + { + QUdpSocket receiver; + QVERIFY (receiver.bind (QHostAddress {QHostAddress::Any}, 0)); + MessageClient client {"test-client", "version", "revision", "127.0.0.1", 0, {}, 1}; + QSignalSpy closed {&client, &MessageClient::close}; + client.set_server ("localhost", {}); + client.set_server_port (receiver.localPort ()); + QCOMPARE (closed.size (), 0); + QTRY_VERIFY (receiver.hasPendingDatagrams ()); + QCOMPARE (closed.size (), 0); + } + + void advertisementTracksRequestAuthorization () + { + QUdpSocket receiver; + QVERIFY (receiver.bind (QHostAddress {QHostAddress::LocalHost}, 0)); + MessageClient client {"test-client", "version", "revision", "127.0.0.1", + receiver.localPort (), {}, 1}; + QTRY_VERIFY (receiver.hasPendingDatagrams ()); + while (receiver.hasPendingDatagrams ()) receiver.receiveDatagram (); + + client.inhibit_status (true, true, QStringLiteral ("W2SZ"), 11, 12, 13, 14); + QTest::qWait (50); + QVERIFY (!receiver.hasPendingDatagrams ()); + + client.enable (true); + QTRY_VERIFY (receiver.hasPendingDatagrams ()); + NetworkMessage::Reader available {receiver.receiveDatagram ().data ()}; + bool supported {false}; + bool inhibited {false}; + QByteArray source; + quint32 hold_rx {0}; + quint32 release_rx {0}; + quint32 expiries {0}; + quint32 invalid {0}; + available >> supported >> inhibited >> source >> hold_rx >> release_rx + >> expiries >> invalid; + QCOMPARE (available.type (), NetworkMessage::InhibitStatus); + QVERIFY (supported); + QVERIFY (inhibited); + QCOMPARE (source, QByteArrayLiteral ("W2SZ")); + + client.enable (false); + QTRY_VERIFY (receiver.hasPendingDatagrams ()); + NetworkMessage::Reader withdrawn {receiver.receiveDatagram ().data ()}; + withdrawn >> supported >> inhibited >> source >> hold_rx >> release_rx + >> expiries >> invalid; + QCOMPARE (withdrawn.type (), NetworkMessage::InhibitStatus); + QVERIFY (!supported); + QVERIFY (inhibited); + QCOMPARE (source, QByteArrayLiteral ("W2SZ")); + QCOMPARE (hold_rx, 11u); + QCOMPARE (release_rx, 12u); + QCOMPARE (expiries, 13u); + QCOMPARE (invalid, 14u); + + client.inhibit_status (true, false, QString {}, 15, 16, 17, 18); + QTest::qWait (50); + QVERIFY (!receiver.hasPendingDatagrams ()); + } + + void heartbeatRefreshesAvailableStatus () + { + QUdpSocket original_receiver; + QVERIFY (original_receiver.bind (QHostAddress {QHostAddress::LocalHost}, 0)); + MessageClient client {"test-client", "version", "revision", "127.0.0.1", + original_receiver.localPort (), {}, 1}; + client.enable (true); + client.inhibit_status (true, false, QString {}, 1, 2, 3, 4); + QTRY_VERIFY (original_receiver.hasPendingDatagrams ()); + QTest::qWait (25); + while (original_receiver.hasPendingDatagrams ()) original_receiver.receiveDatagram (); + + QUdpSocket refreshed_receiver; + QVERIFY (refreshed_receiver.bind (QHostAddress {QHostAddress::LocalHost}, 0)); + client.set_server_port (refreshed_receiver.localPort ()); + QTRY_VERIFY (refreshed_receiver.hasPendingDatagrams ()); + NetworkMessage::Reader heartbeat {refreshed_receiver.receiveDatagram ().data ()}; + QCOMPARE (heartbeat.type (), NetworkMessage::Heartbeat); + QTRY_VERIFY (refreshed_receiver.hasPendingDatagrams ()); + NetworkMessage::Reader refreshed {refreshed_receiver.receiveDatagram ().data ()}; + QCOMPARE (refreshed.type (), NetworkMessage::InhibitStatus); + bool supported {false}; + bool inhibited {true}; + QByteArray source; + quint32 hold_rx {0}; + quint32 release_rx {0}; + quint32 expiries {0}; + quint32 invalid {0}; + refreshed >> supported >> inhibited >> source >> hold_rx >> release_rx + >> expiries >> invalid; + QVERIFY (supported); + QVERIFY (!inhibited); + QVERIFY (source.isEmpty ()); + QCOMPARE (hold_rx, 1u); + QCOMPARE (release_rx, 2u); + QCOMPARE (expiries, 3u); + QCOMPARE (invalid, 4u); + + client.inhibit_status (false, false, QString {}, 0, 0, 0, 0); + QTRY_VERIFY (refreshed_receiver.hasPendingDatagrams ()); + NetworkMessage::Reader withdrawn {refreshed_receiver.receiveDatagram ().data ()}; + supported = true; + withdrawn >> supported; + QCOMPARE (withdrawn.type (), NetworkMessage::InhibitStatus); + QVERIFY (!supported); + + QUdpSocket unsupported_receiver; + QVERIFY (unsupported_receiver.bind (QHostAddress {QHostAddress::LocalHost}, 0)); + client.set_server_port (unsupported_receiver.localPort ()); + QTRY_VERIFY (unsupported_receiver.hasPendingDatagrams ()); + NetworkMessage::Reader unsupported_heartbeat { + unsupported_receiver.receiveDatagram ().data ()}; + QCOMPARE (unsupported_heartbeat.type (), NetworkMessage::Heartbeat); + QTest::qWait (50); + QVERIFY (!unsupported_receiver.hasPendingDatagrams ()); + } + + void preservesType17FieldOrder () + { + QUdpSocket receiver; + QVERIFY (receiver.bind (QHostAddress {QHostAddress::LocalHost}, 0)); + + auto client = std::unique_ptr {new MessageClient { + "test-client", "test-version", "test-revision", + "127.0.0.1", receiver.localPort (), {}, 1}}; + QTRY_VERIFY (receiver.hasPendingDatagrams ()); + while (receiver.hasPendingDatagrams ()) + { + receiver.receiveDatagram (); + } + + client->enable (true); + client->inhibit_status (true, true, QStringLiteral ("W2SZ"), 11, 12, 13, 14); + QTRY_VERIFY (receiver.hasPendingDatagrams ()); + auto const datagram = receiver.receiveDatagram ().data (); + + NetworkMessage::Reader reader {datagram}; + QCOMPARE (reader.type (), NetworkMessage::InhibitStatus); + QCOMPARE (reader.id (), QStringLiteral ("test-client")); + + bool supported {false}; + bool inhibited {false}; + QByteArray source; + quint32 hold_rx {0}; + quint32 release_rx {0}; + quint32 expiries {0}; + quint32 invalid {0}; + reader >> supported >> inhibited >> source >> hold_rx >> release_rx + >> expiries >> invalid; + + QCOMPARE (reader.status (), QDataStream::Ok); + QVERIFY (supported); + QVERIFY (reader.atEnd ()); + QVERIFY (inhibited); + QCOMPARE (source, QByteArrayLiteral ("W2SZ")); + QCOMPARE (hold_rx, 11u); + QCOMPARE (release_rx, 12u); + QCOMPARE (expiries, 13u); + QCOMPARE (invalid, 14u); + } +}; + +QTEST_GUILESS_MAIN (TestMessageClientInhibitStatus) +#include "test_message_client_inhibit_status.moc" diff --git a/tests/unit/network/test_message_client_replay.cpp b/tests/unit/network/test_message_client_replay.cpp new file mode 100644 index 00000000..a13b74d4 --- /dev/null +++ b/tests/unit/network/test_message_client_replay.cpp @@ -0,0 +1,326 @@ +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include "Network/MessageClient.hpp" +#include "Network/NetworkMessage.hpp" + +namespace +{ + class DatagramReceiver final + { + public: + DatagramReceiver () + { + QObject::connect (&socket_, &QUdpSocket::readyRead, [&] {drain ();}); + } + + bool bind () + { + return socket_.bind (QHostAddress {QHostAddress::LocalHost}, 0); + } + + quint16 port () const + { + return socket_.localPort (); + } + + QUdpSocket * socket () + { + return &socket_; + } + + bool hasPendingDatagrams () const + { + return socket_.hasPendingDatagrams (); + } + + QVector const& datagrams () const + { + return datagrams_; + } + + QHostAddress senderAddress () const + { + return sender_address_; + } + + quint16 senderPort () const + { + return sender_port_; + } + + void clear () + { + drain (); + datagrams_.clear (); + } + + private: + void drain () + { + while (socket_.hasPendingDatagrams ()) + { + QByteArray datagram; + datagram.resize (static_cast (socket_.pendingDatagramSize ())); + if (0 <= socket_.readDatagram (datagram.data (), datagram.size (), + &sender_address_, &sender_port_)) + { + datagrams_.append (datagram); + } + } + } + + QUdpSocket socket_; + QVector datagrams_; + QHostAddress sender_address_; + quint16 sender_port_ {0}; + }; + + NetworkMessage::Type messageType (QByteArray const& datagram) + { + NetworkMessage::Reader reader {datagram}; + return reader.type (); + } + + bool decodeIsNew (QByteArray const& datagram) + { + NetworkMessage::Reader reader {datagram}; + bool is_new {false}; + reader >> is_new; + return is_new; + } + + void sendDecode (MessageClient& client, bool is_new, int sequence) + { + client.decode (is_new, QTime {12, 0, sequence % 60}, -10, 0.1f, + static_cast (1000 + sequence), "FT8", + QString {"CQ TEST%1 AA00"}.arg (sequence), false, false); + } + + void sendStatus (MessageClient& client, QString const& tx_message = QString {}) + { + client.status_update (static_cast (14074000), "FT8", QString {}, QString {}, + "FT8", false, false, false, 1500, 1500, "N0CALL", "AA00", + QString {}, false, QString {}, false, static_cast (0), + 50, 15, "Default", tx_message); + } + + void sendReply (DatagramReceiver& receiver, QTime time, qint32 snr, float delta_time, + quint32 delta_frequency, QString const& mode, QString const& message, + bool low_confidence = false) + { + QByteArray datagram; + NetworkMessage::Builder out {&datagram, NetworkMessage::Reply, "test-client", 2}; + out << time << snr << delta_time << delta_frequency << mode.toUtf8 () << message.toUtf8 () + << low_confidence << quint8 {0}; + QCOMPARE (receiver.socket ()->writeDatagram (datagram, receiver.senderAddress (), + receiver.senderPort ()), + static_cast (datagram.size ())); + } + + std::unique_ptr makeClient (quint16 port) + { + return std::unique_ptr {new MessageClient { + "test-client", "test-version", "test-revision", "127.0.0.1", port, QStringList {}, 1}}; + } + + void discardInitialHeartbeat (DatagramReceiver& receiver) + { + QTRY_VERIFY (!receiver.datagrams ().isEmpty ()); + QCOMPARE (messageType (receiver.datagrams ().front ()), NetworkMessage::Heartbeat); + receiver.clear (); + } +} + +class TestMessageClientReplay final + : public QObject +{ + Q_OBJECT + +private Q_SLOTS: + void replyMatchesSentDecodeIndependentlyOfDisplay () + { + DatagramReceiver receiver; + QVERIFY (receiver.bind ()); + auto client = makeClient (receiver.port ()); + client->enable (true); + discardInitialHeartbeat (receiver); + + QSignalSpy replies {client.get (), &MessageClient::reply}; + QTime const time {12, 34, 45}; + QString const message {"K1ABC N0CALL -10"}; + client->decode (true, time, -12, 0.2f, 1425, "~", message, false, false); + QTRY_COMPARE (receiver.datagrams ().size (), 1); + + sendReply (receiver, time, -12, 0.2f, 1425, "~", message); + + QTRY_COMPARE (replies.size (), 1); + QCOMPARE (replies.front ().at (5).toString (), message); + } + + void replyRequiresUnclearedExactDecode () + { + DatagramReceiver receiver; + QVERIFY (receiver.bind ()); + auto client = makeClient (receiver.port ()); + client->enable (true); + discardInitialHeartbeat (receiver); + + QSignalSpy replies {client.get (), &MessageClient::reply}; + QTime const time {12, 34, 45}; + QString const message {"CQ K1ABC FN42"}; + client->decode (true, time, -12, 0.2f, 1425, "~", message, false, false); + QTRY_COMPARE (receiver.datagrams ().size (), 1); + + sendReply (receiver, time, -12, 0.2f, 1425, "~", "CQ K1ABC FN43"); + QTest::qWait (20); + QCOMPARE (replies.size (), 0); + + sendReply (receiver, time, -12, 0.2f, 1425, "~", message); + QTRY_COMPARE (replies.size (), 1); + + client->decodes_cleared (); + sendReply (receiver, time, -12, 0.2f, 1425, "~", message); + QTest::qWait (20); + QCOMPARE (replies.size (), 1); + } + + void replayIsDeferredPacedAndOrdered () + { + DatagramReceiver receiver; + QVERIFY (receiver.bind ()); + auto client = makeClient (receiver.port ()); + discardInitialHeartbeat (receiver); + QElapsedTimer replay_clock; + QVector replay_batch_sizes; + QVector replay_batch_times; + QObject::connect (client.get (), &MessageClient::replay_batch_processed, + [&] (int message_count) { + replay_batch_sizes.append (message_count); + replay_batch_times.append (replay_clock.elapsed ()); + }); + + QVERIFY (client->begin_replay ()); + for (int sequence = 0; sequence != 24; ++sequence) + { + sendDecode (*client, false, sequence); + } + client->WSPR_decode (false, QTime {12, 1}, -20, 0.2f, + static_cast (14095600), 0, + "K1ABC", "FN42", 37, false); + sendStatus (*client, "replay-status"); + replay_clock.start (); + client->end_replay (); + + sendDecode (*client, true, 24); + client->decodes_cleared (); + + QVERIFY (!receiver.hasPendingDatagrams ()); + QCOMPARE (replay_batch_sizes.size (), 0); + bool yielded_to_event_loop {false}; + QTimer::singleShot (0, [&] {yielded_to_event_loop = true;}); + + QTRY_COMPARE (receiver.datagrams ().size (), 28); + QVERIFY (yielded_to_event_loop); + + for (int index = 0; index != 24; ++index) + { + QCOMPARE (messageType (receiver.datagrams ()[index]), NetworkMessage::Decode); + QVERIFY (!decodeIsNew (receiver.datagrams ()[index])); + } + QCOMPARE (messageType (receiver.datagrams ()[24]), NetworkMessage::WSPRDecode); + QVERIFY (!decodeIsNew (receiver.datagrams ()[24])); + QCOMPARE (messageType (receiver.datagrams ()[25]), NetworkMessage::Status); + QCOMPARE (messageType (receiver.datagrams ()[26]), NetworkMessage::Decode); + QVERIFY (decodeIsNew (receiver.datagrams ()[26])); + QCOMPARE (messageType (receiver.datagrams ()[27]), NetworkMessage::Clear); + + int replayed_messages {0}; + for (auto const batch_size : replay_batch_sizes) + { + QVERIFY (batch_size > 0); + QVERIFY (batch_size <= 10); + replayed_messages += batch_size; + } + QCOMPARE (replayed_messages, 28); + QVERIFY (replay_batch_sizes.size () >= 3); + QVERIFY (replay_batch_times.front () >= 8); + QVERIFY (replay_batch_times.back () - replay_batch_times.front () >= 15); + } + + void repeatedReplayIsCoalesced () + { + DatagramReceiver receiver; + QVERIFY (receiver.bind ()); + auto client = makeClient (receiver.port ()); + discardInitialHeartbeat (receiver); + + QVERIFY (client->begin_replay ()); + for (int sequence = 0; sequence != 11; ++sequence) + { + sendDecode (*client, false, sequence); + } + sendStatus (*client); + client->end_replay (); + + QVERIFY (!client->begin_replay ()); + QTRY_COMPARE (receiver.datagrams ().size (), 12); + QVERIFY (client->begin_replay ()); + sendStatus (*client); + client->end_replay (); + QTRY_COMPARE (receiver.datagrams ().size (), 13); + } + + void destinationChangeCancelsReplay () + { + DatagramReceiver original_receiver; + DatagramReceiver new_receiver; + QVERIFY (original_receiver.bind ()); + QVERIFY (new_receiver.bind ()); + auto client = makeClient (original_receiver.port ()); + discardInitialHeartbeat (original_receiver); + + QSignalSpy first_batch {original_receiver.socket (), &QUdpSocket::readyRead}; + QVERIFY (client->begin_replay ()); + for (int sequence = 0; sequence != 25; ++sequence) + { + sendDecode (*client, false, sequence); + } + sendStatus (*client); + client->end_replay (); + + QVERIFY (first_batch.wait (1000)); + QVERIFY (original_receiver.datagrams ().size () > 0); + + // Cancel as soon as the first paced batch is observed. Packets already + // written to the OS before cancel can still arrive after the first + // readyRead, so settle the original socket before taking a baseline. + client->set_server_port (new_receiver.port ()); + QTest::qWait (50); + QCoreApplication::processEvents (); + auto const delivered_after_cancel = original_receiver.datagrams ().size (); + QVERIFY (delivered_after_cancel > 0); + QVERIFY (delivered_after_cancel <= 10); + + sendDecode (*client, true, 25); + + QTRY_COMPARE (new_receiver.datagrams ().size (), 2); + QTest::qWait (50); + QCOMPARE (original_receiver.datagrams ().size (), delivered_after_cancel); + QCOMPARE (messageType (new_receiver.datagrams ().front ()), NetworkMessage::Heartbeat); + QCOMPARE (messageType (new_receiver.datagrams ().back ()), NetworkMessage::Decode); + QVERIFY (decodeIsNew (new_receiver.datagrams ().back ())); + } +}; + +QTEST_GUILESS_MAIN (TestMessageClientReplay) + +#include "test_message_client_replay.moc" diff --git a/tests/unit/network/test_message_server.cpp b/tests/unit/network/test_message_server.cpp new file mode 100644 index 00000000..bde89f09 --- /dev/null +++ b/tests/unit/network/test_message_server.cpp @@ -0,0 +1,96 @@ +#include + +#include +#include + +#include "Network/NetworkMessage.hpp" +#include "UDPExamples/MessageServer.hpp" + +namespace +{ + QByteArray heartbeat (QString const& id) + { + QByteArray message; + NetworkMessage::Builder out {&message, NetworkMessage::Heartbeat, id, 2}; + out << quint32 {2} << QByteArray {"test"} << QByteArray {}; + return message; + } + + QByteArray decode (QString const& id, QTime time, qint32 snr, float delta_time + , quint32 delta_frequency, QByteArray const& mode + , QByteArray const& text) + { + QByteArray message; + NetworkMessage::Builder out {&message, NetworkMessage::Decode, id, 2}; + out << true << time << snr << delta_time << delta_frequency << mode << text + << false << false; + return message; + } + + QByteArray receiveDatagram (QUdpSocket& socket) + { + QByteArray message; + message.resize (socket.pendingDatagramSize ()); + socket.readDatagram (message.data (), message.size ()); + return message; + } +} + +class TestMessageServer final + : public QObject +{ + Q_OBJECT + +private slots: + void refreshesClientEndpointWhenSourcePortChanges () + { + qRegisterMetaType ("ClientKey"); + + QHostAddress const loopback {QHostAddress::LocalHost}; + QUdpSocket port_reservation; + QVERIFY (port_reservation.bind (loopback, 0)); + auto const server_port = port_reservation.localPort (); + port_reservation.close (); + + QObject owner; + auto *server = new MessageServer {&owner}; + QSignalSpy clients {server, &MessageServer::client_opened}; + QSignalSpy decodes {server, &MessageServer::decode}; + server->start (server_port); + + QString const id {"WSJT-X"}; + QUdpSocket original_client; + QVERIFY (original_client.bind (loopback, 0)); + auto const heartbeat_message = heartbeat (id); + QCOMPARE (original_client.writeDatagram (heartbeat_message, loopback, server_port) + , qint64 (heartbeat_message.size ())); + QTRY_COMPARE (clients.count (), 1); + auto const client_key = clients.at (0).at (0).value (); + + QTime const time {18, 6}; + qint32 constexpr snr {-5}; + float constexpr delta_time {-0.5f}; + quint32 constexpr delta_frequency {1269}; + QByteArray const mode {"~"}; + QByteArray const text {"CQ NP4TX FK68"}; + + QUdpSocket restarted_client; + QVERIFY (restarted_client.bind (loopback, 0)); + QVERIFY (restarted_client.localPort () != original_client.localPort ()); + auto const decode_message = decode (id, time, snr, delta_time, delta_frequency, mode, text); + QCOMPARE (restarted_client.writeDatagram (decode_message, loopback, server_port) + , qint64 (decode_message.size ())); + QTRY_COMPARE (decodes.count (), 1); + + server->reply (client_key, time, snr, delta_time, delta_frequency + , QString::fromUtf8 (mode), QString::fromUtf8 (text), false, 0); + + QTRY_VERIFY_WITH_TIMEOUT (restarted_client.hasPendingDatagrams (), 1000); + NetworkMessage::Reader reply {receiveDatagram (restarted_client)}; + QCOMPARE (reply.type (), NetworkMessage::Reply); + } +}; + +QTEST_GUILESS_MAIN (TestMessageServer) + +#include "test_message_server.moc" diff --git a/tests/unit/network/test_pskreporter_ipfix.cpp b/tests/unit/network/test_pskreporter_ipfix.cpp new file mode 100644 index 00000000..94125299 --- /dev/null +++ b/tests/unit/network/test_pskreporter_ipfix.cpp @@ -0,0 +1,222 @@ +#include + +#include "Network/PSKReporterIPFIX.hpp" + +namespace +{ + quint16 u16 (QByteArray const& bytes, int offset) + { + return (static_cast (bytes[offset]) << 8) + | static_cast (bytes[offset + 1]); + } + + quint32 u32 (QByteArray const& bytes, int offset) + { + return (static_cast (static_cast (bytes[offset])) << 24) + | (static_cast (static_cast (bytes[offset + 1])) << 16) + | (static_cast (static_cast (bytes[offset + 2])) << 8) + | static_cast (bytes[offset + 3]); + } + + QList setIds (QByteArray const& payload) + { + QList ids; + int offset = 16; + while (offset + 4 <= payload.size ()) + { + auto const id = u16 (payload, offset); + auto const length = u16 (payload, offset + 2); + ids.append (id); + if (length < 4) + { + break; + } + offset += length; + } + return ids; + } + + PSKReporterIPFIX::Receiver receiver () + { + return {"K1ABC", "FN20", "WSJT-X test", "N/A", "N/A"}; + } + + PSKReporterIPFIX::Spot spot (int index) + { + return { + QString {"K%1ABC"}.arg (index), + "FN21", + -10, + 14074000u + static_cast (index), + "FT8", + QDateTime {{2026, 5, 6}, {12, 0, 0}, Qt::UTC} + }; + } + + QList buildUdpPackets (PSKReporterIPFIX::Receiver const& rx + , QList const& spots + , bool include_descriptors + , quint32 sequence_number + , quint32 observation_id + , quint32 export_time) + { + return PSKReporterIPFIX::buildPackets ( + rx, spots, include_descriptors, sequence_number, observation_id, export_time + , PSKReporterIPFIX::maxUdpIpfixPayloadBytes ()); + } + + QList buildTcpPackets (PSKReporterIPFIX::Receiver const& rx + , QList const& spots + , bool include_descriptors + , quint32 sequence_number + , quint32 observation_id + , quint32 export_time) + { + return PSKReporterIPFIX::buildPackets ( + rx, spots, include_descriptors, sequence_number, observation_id, export_time + , PSKReporterIPFIX::maxTcpIpfixPayloadBytes ()); + } +} + +class TestPSKReporterIPFIX final + : public QObject +{ + Q_OBJECT + +private slots: + void splitsManySpotsIntoBoundedUdpPayloads () + { + QList spots; + for (int i = 0; i != 200; ++i) + { + spots.append (spot (i)); + } + + auto const packets = buildUdpPackets (receiver (), spots, true, 17, 23, 29); + + QVERIFY (packets.size () > 1); + int spot_count = 0; + for (auto const& packet : packets) + { + QVERIFY2 (packet.payload.size () <= PSKReporterIPFIX::maxUdpIpfixPayloadBytes (), qPrintable (QString::number (packet.payload.size ()))); + spot_count += packet.spot_count; + } + QCOMPARE (spot_count, spots.size ()); + } + + void truncatesLongFieldsAndKeepsPacketsBounded () + { + auto long_text = QString (300, QChar {0x00f8}); + PSKReporterIPFIX::Receiver rx {long_text, long_text, long_text, long_text, long_text}; + QList spots { + {long_text, long_text, -1, 50313000u, long_text, QDateTime {{2026, 5, 6}, {12, 0, 0}, Qt::UTC}} + }; + + auto const packets = buildUdpPackets (rx, spots, true, 1, 2, 3); + + QCOMPARE (packets.size (), 1); + QCOMPARE (packets.front ().spot_count, 1); + QVERIFY (packets.front ().payload.size () <= PSKReporterIPFIX::maxUdpIpfixPayloadBytes ()); + } + + void receiverOptionsTemplateUsesOneScopeField () + { + auto const packets = buildUdpPackets (receiver (), {}, true, 1, 2, 3); + auto const payload = packets.front ().payload; + + int offset = 16; + QCOMPARE (u16 (payload, offset), quint16 (2u)); + offset += u16 (payload, offset + 2); + QCOMPARE (u16 (payload, offset), quint16 (3u)); + QCOMPARE (u16 (payload, offset + 8), quint16 (1u)); + } + + void sequenceNumberAdvancesBySpotRecords () + { + QList spots; + for (int i = 0; i != 200; ++i) + { + spots.append (spot (i)); + } + + auto const packets = buildUdpPackets (receiver (), spots, true, 100, 23, 29); + + quint32 expected = 100; + for (auto const& packet : packets) + { + QCOMPARE (u32 (packet.payload, 8), expected); + expected += packet.spot_count; + } + QCOMPARE (expected, quint32 (100 + spots.size ())); + } + + void descriptorOnlyPacketDoesNotAdvanceSequence () + { + auto const packets = buildUdpPackets (receiver (), {}, true, 44, 23, 29); + + QCOMPARE (packets.size (), 1); + QCOMPARE (packets.front ().spot_count, 0); + QCOMPARE (u32 (packets.front ().payload, 8), quint32 (44)); + } + + void splitPacketsOnlyCarryDescriptorsInFirstPacket () + { + QList spots; + for (int i = 0; i != 200; ++i) + { + spots.append (spot (i)); + } + + auto const packets = buildUdpPackets (receiver (), spots, true, 1, 2, 3); + + QVERIFY (packets.size () > 1); + QVERIFY (setIds (packets.front ().payload).contains (quint16 (2u))); + QVERIFY (setIds (packets.front ().payload).contains (quint16 (3u))); + for (int i = 1; i != packets.size (); ++i) + { + QVERIFY (!setIds (packets[i].payload).contains (quint16 (2u))); + QVERIFY (!setIds (packets[i].payload).contains (quint16 (3u))); + } + } + + void everyPacketCarriesReceiverAndSenderSetsWhenSpotsSplit () + { + QList spots; + for (int i = 0; i != 200; ++i) + { + spots.append (spot (i)); + } + + auto const packets = buildUdpPackets (receiver (), spots, true, 1, 2, 3); + + QVERIFY (packets.size () > 1); + for (auto const& packet : packets) + { + auto const ids = setIds (packet.payload); + QVERIFY (ids.contains (quint16 (0x50e2))); + QVERIFY (ids.contains (quint16 (0x50e3))); + } + } + + void tcpCanUseLargerIpfixPayloads () + { + QList spots; + for (int i = 0; i != 200; ++i) + { + spots.append (spot (i)); + } + + auto const udp_packets = buildUdpPackets (receiver (), spots, true, 1, 2, 3); + auto const tcp_packets = buildTcpPackets (receiver (), spots, true, 1, 2, 3); + + QVERIFY (udp_packets.size () > 1); + QCOMPARE (tcp_packets.size (), 1); + QVERIFY (tcp_packets.front ().payload.size () > PSKReporterIPFIX::maxUdpIpfixPayloadBytes ()); + QVERIFY (tcp_packets.front ().payload.size () <= PSKReporterIPFIX::maxTcpIpfixPayloadBytes ()); + QCOMPARE (tcp_packets.front ().spot_count, spots.size ()); + } +}; + +QTEST_MAIN (TestPSKReporterIPFIX) + +#include "test_pskreporter_ipfix.moc" diff --git a/tests/unit/network/test_pskreporter_transport.cpp b/tests/unit/network/test_pskreporter_transport.cpp new file mode 100644 index 00000000..59b48aba --- /dev/null +++ b/tests/unit/network/test_pskreporter_transport.cpp @@ -0,0 +1,179 @@ +#include + +#include +#include +#include +#include +#include + +#include "Network/PSKReporter.hpp" + +namespace +{ + quint16 u16(QByteArray const& bytes, int offset) + { + return (static_cast(bytes[offset]) << 8) + | static_cast(bytes[offset + 1]); + } + + QList setIds(QByteArray const& payload) + { + QList ids; + int offset = 16; + while (offset + 4 <= payload.size()) { + auto const length = u16(payload, offset + 2); + ids.append(u16(payload, offset)); + if (length < 4) { + break; + } + offset += length; + } + return ids; + } + + void verifyReport(QByteArray const& payload, bool includeDescriptors) + { + QVERIFY(payload.size() >= 16); + QCOMPARE(u16(payload, 0), quint16(10)); + QCOMPARE(u16(payload, 2), static_cast(payload.size())); + + auto const ids = setIds(payload); + QVERIFY(ids.contains(quint16(0x50e2))); + QVERIFY(ids.contains(quint16(0x50e3))); + QCOMPARE(ids.contains(quint16(2)), includeDescriptors); + QCOMPARE(ids.contains(quint16(3)), includeDescriptors); + } + + PSKReporter::Options options(bool useTcpIp, quint16 port) + { + return {useTcpIp, QString {}, "MAP65 transport test", "127.0.0.1", port}; + } + + bool addSpots(PSKReporter& reporter, QString const& prefix, + QStringList& callsigns) + { + for (int i = 0; i < 2048; ++i) { + auto suffixIndex = i; + QString suffix; + for (int j = 0; j < 4; ++j) { + suffix.prepend(QChar { + static_cast('A' + (suffixIndex % 26))}); + suffixIndex /= 26; + } + auto const callsign = prefix + QString::number((i / 26) % 10) + suffix; + if (!reporter.addRemoteStation( + callsign, "FN20", 50313000u, "Q65-60A", -12, + QDateTime {{2026, 8, 17}, {12, 0, 0}, Qt::UTC})) { + return false; + } + callsigns.append(callsign); + } + return true; + } + + void accountForPayload(QByteArray const& payload, QSet& remaining) + { + for (auto const& callsign : remaining.values()) { + if (payload.contains(callsign.toUtf8())) { + remaining.remove(callsign); + } + } + } + + QList takeCompleteFrames(QByteArray& stream) + { + QList frames; + while (stream.size() >= 4) { + auto const length = u16(stream, 2); + if (length < 16 || stream.size() < length) { + break; + } + frames.append(stream.left(length)); + stream.remove(0, length); + } + return frames; + } +} + +class TestPSKReporterTransport final : public QObject +{ + Q_OBJECT + +private slots: + void sendsAllIpfixReportsOverUdp() + { + QUdpSocket receiver; + QVERIFY(receiver.bind(QHostAddress {QHostAddress::LocalHost}, 0)); + // sendReport writes the maximum queue synchronously, before this test + // begins draining received datagrams. + receiver.setSocketOption(QAbstractSocket::ReceiveBufferSizeSocketOption, + 256 * 1024); + + PSKReporter reporter {options(false, receiver.localPort())}; + reporter.setLocalStation("K1ABC", "FN21", "N/A", "N/A (MAP65)"); + QStringList callsigns; + QVERIFY(addSpots(reporter, "UA", callsigns)); + QSet remaining {callsigns.begin(), callsigns.end()}; + + reporter.sendReport(); + QList reports; + QTRY_VERIFY_WITH_TIMEOUT(([&] { + while (receiver.hasPendingDatagrams()) { + QByteArray payload; + payload.resize(static_cast(receiver.pendingDatagramSize())); + if (receiver.readDatagram(payload.data(), payload.size()) + != static_cast(payload.size())) { + return false; + } + reports.append(payload); + accountForPayload(payload, remaining); + } + return reports.size() > 1 && remaining.isEmpty(); + }()), 5000); + + QVERIFY(reports.size() > 1); + for (int i = 0; i < reports.size(); ++i) { + verifyReport(reports.at(i), i == 0); + } + reporter.sendReport(true); + } + + void sendsAllIpfixReportsOverTcp() + { + QTcpServer server; + QVERIFY(server.listen(QHostAddress {QHostAddress::LocalHost}, 0)); + + PSKReporter reporter {options(true, server.serverPort())}; + reporter.setLocalStation("K1ABC", "FN21", "N/A", "N/A (MAP65)"); + QTRY_VERIFY_WITH_TIMEOUT(server.hasPendingConnections(), 3000); + auto *peer = server.nextPendingConnection(); + QVERIFY(peer); + + QStringList callsigns; + QVERIFY(addSpots(reporter, "TA", callsigns)); + QSet remaining {callsigns.begin(), callsigns.end()}; + QByteArray stream; + QList reports; + reporter.sendReport(); + + QTRY_VERIFY_WITH_TIMEOUT(([&] { + stream.append(peer->readAll()); + auto const newFrames = takeCompleteFrames(stream); + for (auto const& frame : newFrames) { + reports.append(frame); + accountForPayload(frame, remaining); + } + return reports.size() > 1 && remaining.isEmpty(); + }()), 5000); + + QVERIFY(reports.size() > 1); + for (int i = 0; i < reports.size(); ++i) { + verifyReport(reports.at(i), i == 0); + } + reporter.sendReport(true); + } +}; + +QTEST_MAIN(TestPSKReporterTransport) + +#include "test_pskreporter_transport.moc" diff --git a/tests/unit/network/test_wsprnet_upload.cpp b/tests/unit/network/test_wsprnet_upload.cpp new file mode 100644 index 00000000..f2615722 --- /dev/null +++ b/tests/unit/network/test_wsprnet_upload.cpp @@ -0,0 +1,749 @@ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Network/wsprnet.h" + +namespace +{ + struct NetworkResponse + { + NetworkResponse () = default; + + NetworkResponse (QNetworkReply::NetworkError error, QString error_string, QByteArray body) + : error {error} + , error_string {error_string} + , body {body} + { + } + + QNetworkReply::NetworkError error = QNetworkReply::NoError; + QString error_string; + QByteArray body = "1 spot(s) added"; + }; + + class FakeReply final + : public QNetworkReply + { + public: + FakeReply (QNetworkRequest const& request, NetworkResponse response, QObject *parent = nullptr) + : QNetworkReply {parent} + , response_ {response} + , body_ {response.body} + , offset_ {0} + { + setRequest (request); + setUrl (request.url ()); + setOperation (QNetworkAccessManager::PostOperation); + open (QIODevice::ReadOnly | QIODevice::Unbuffered); + } + + void abort () override + { + response_.error = QNetworkReply::OperationCanceledError; + response_.error_string = "aborted"; + finish (); + } + + qint64 bytesAvailable () const override + { + return body_.size () - offset_ + QNetworkReply::bytesAvailable (); + } + + bool isSequential () const override + { + return true; + } + + void finish () + { + if (isFinished ()) + { + return; + } + setFinished (true); + if (QNetworkReply::NoError != response_.error) + { + setError (response_.error, response_.error_string); + } + if (!body_.isEmpty ()) + { + Q_EMIT readyRead (); + } + Q_EMIT finished (); + } + + protected: + qint64 readData (char *data, qint64 max_size) override + { + auto const bytes = qMin (max_size, body_.size () - offset_); + if (bytes <= 0) + { + return -1; + } + memcpy (data, body_.constData () + offset_, static_cast (bytes)); + offset_ += bytes; + return bytes; + } + + private: + NetworkResponse response_; + QByteArray body_; + qint64 offset_; + }; + + class FakeNetworkAccessManager final + : public QObject + , public WSPRNet::Transport + { + public: + struct Request + { + QUrl url; + QByteArray body; + }; + + explicit FakeNetworkAccessManager (QObject *parent = nullptr) + : QObject {parent} + , auto_finish {true} + , next_reply_to_finish_ {0} + { + } + + void enqueueResponse (NetworkResponse response) + { + responses_.append (response); + } + + void finishAll () + { + for (auto const& reply : replies_) + { + if (reply) + { + reply->finish (); + } + } + } + + void finishNext () + { + while (next_reply_to_finish_ < replies_.size () + && (!replies_[next_reply_to_finish_] || replies_[next_reply_to_finish_]->isFinished ())) + { + ++next_reply_to_finish_; + } + QVERIFY (next_reply_to_finish_ < replies_.size ()); + replies_[next_reply_to_finish_++]->finish (); + } + + void finishHost (QString const& host) + { + for (auto const& reply : replies_) + { + if (reply && !reply->isFinished () && reply->url ().host () == host) + { + reply->finish (); + return; + } + } + QFAIL (qPrintable (QString {"no unfinished reply for %1"}.arg (host))); + } + + QList requests; + bool auto_finish; + + QNetworkReply *post (QNetworkRequest const& request, QByteArray const& body) override + { + Request recorded {request.url (), body}; + requests.append (recorded); + + NetworkResponse response; + if (!responses_.isEmpty ()) + { + response = responses_.takeFirst (); + } + auto *reply = new FakeReply {request, response, this}; + replies_.append (reply); + if (auto_finish) + { + QTimer::singleShot (0, reply, [reply] () { reply->finish (); }); + } + return reply; + } + + private: + QList responses_; + QList> replies_; + int next_reply_to_finish_; + }; + + WSPRNet::RetryPolicy retryPolicy (int max_attempts = 2, int max_pending = 1024, int ttl_ms = 60000) + { + WSPRNet::RetryPolicy policy; + policy.max_attempts = max_attempts; + policy.max_pending = max_pending; + policy.ttl_ms = ttl_ms; + policy.jitter_fraction = 0.; + policy.retry_delays_ms = {0}; + return policy; + } + + QString fst4wDecode () + { + return "1234 -10 0.1 1500 ` K1ABC FN20 37"; + } + + QString spotFileLine () + { + return "130223 2256 7 -21 -0.3 14.097090 K1ABC FN20 37 0 40 0\n"; + } + + QString secondSpotFileLine () + { + return "130223 2258 7 -19 -0.2 14.097120 K2DEF FN31 33 0 35 0\n"; + } + + QString type2SpotFileLine () + { + return "130223 2258 7 -19 -0.2 14.097120 K1ABC/P 37 0 35 0\n"; + } + + QString unresolvedHashSpotFileLine () + { + return "130223 2258 7 -19 -0.2 14.097120 <...> IO81UT 37 0 35 0\n"; + } + + QString twoSpotFileLines () + { + return spotFileLine () + secondSpotFileLine (); + } + + void postFst4w (WSPRNet& wspr, QString const& decode_text = QString {}) + { + wspr.post ("N0CALL", "FN20", "14.097000", "14.097100", "FST4W", 120.F, + "10", "37", "test-version", decode_text); + } + + void uploadFile (WSPRNet& wspr, QString const& file_name) + { + wspr.upload ("N0CALL", "FN20", "14.097000", "14.097100", "WSPR", 120.F, + "10", "37", "test-version", file_name); + } + + QString writeSpotFile (QTemporaryDir& dir, QString const& contents = spotFileLine ()) + { + auto const path = dir.path () + "/wspr_spots.txt"; + QFile file {path}; + if (!file.open (QIODevice::WriteOnly | QIODevice::Text)) + { + qFatal ("could not create temporary spot file"); + } + file.write (contents.toUtf8 ()); + file.close (); + return path; + } + + bool sawStatus (QSignalSpy const& spy, QString const& status) + { + for (auto const& arguments : spy) + { + if (!arguments.isEmpty () && arguments.front ().toString () == status) + { + return true; + } + } + return false; + } + + bool sawStatusContaining (QSignalSpy const& spy, QString const& text) + { + for (auto const& arguments : spy) + { + if (!arguments.isEmpty () && arguments.front ().toString ().contains (text)) + { + return true; + } + } + return false; + } + + int requestCountForHost (QList const& requests, + QString const& host) + { + auto count = 0; + for (auto const& request : requests) + { + if (request.url.host () == host) + { + ++count; + } + } + return count; + } +} + +class TestWSPRNetUpload final + : public QObject +{ + Q_OBJECT + +private slots: + void fst4wDecodeQueuesSpotButDoesNotSendUntilFlush () + { + FakeNetworkAccessManager manager; + WSPRNet wspr {&manager, retryPolicy (), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + postFst4w (wspr, fst4wDecode ()); + QCoreApplication::processEvents (); + + QCOMPARE (manager.requests.size (), 0); + + postFst4w (wspr); + wspr.work (); + + QTRY_VERIFY (sawStatus (statuses, "done")); + QCOMPARE (manager.requests.size (), 2); + QVERIFY (manager.requests.front ().body.contains ("function=wspr")); + QVERIFY (manager.requests.front ().body.contains ("tcall=K1ABC")); + } + + void primaryUploadsContinueWhileAlternateUploadIsOutstanding () + { + FakeNetworkAccessManager manager; + manager.auto_finish = false; + WSPRNet wspr {&manager, retryPolicy (1), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + postFst4w (wspr, fst4wDecode ()); + postFst4w (wspr, "1235 -11 0.2 1505 ` K2DEF FN31 33"); + postFst4w (wspr); + wspr.work (); + + QCOMPARE (requestCountForHost (manager.requests, "wsprnet.org"), 1); + QCOMPARE (requestCountForHost (manager.requests, "wsprnet.eu"), 1); + + manager.finishHost ("wsprnet.org"); + QTRY_COMPARE (requestCountForHost (manager.requests, "wsprnet.org"), 2); + QCOMPARE (requestCountForHost (manager.requests, "wsprnet.eu"), 1); + + manager.finishHost ("wsprnet.eu"); + QTRY_COMPARE (requestCountForHost (manager.requests, "wsprnet.eu"), 2); + manager.finishHost ("wsprnet.org"); + manager.finishHost ("wsprnet.eu"); + QTRY_VERIFY (sawStatus (statuses, "done")); + } + + void alternateRetryDoesNotSuppressLaterPrimaryStatus () + { + FakeNetworkAccessManager manager; + manager.auto_finish = false; + manager.enqueueResponse ({QNetworkReply::NoError, {}, "1 spot(s) added"}); + manager.enqueueResponse ({QNetworkReply::TimeoutError, "timeout", {}}); + WSPRNet wspr {&manager, retryPolicy (2), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + postFst4w (wspr, fst4wDecode ()); + postFst4w (wspr); + wspr.work (); + manager.finishHost ("wsprnet.org"); + manager.finishHost ("wsprnet.eu"); + + postFst4w (wspr); + wspr.work (); + + QCOMPARE (requestCountForHost (manager.requests, "wsprnet.org"), 2); + QCOMPARE (requestCountForHost (manager.requests, "wsprnet.eu"), 2); + QVERIFY (manager.requests.at (2).body.contains ("function=wsprstat")); + + manager.finishHost ("wsprnet.org"); + manager.finishHost ("wsprnet.eu"); + QTRY_VERIFY (sawStatus (statuses, "done")); + } + + void fst4wRetrySurvivesLaterDecodeCycles () + { + FakeNetworkAccessManager manager; + manager.enqueueResponse ({QNetworkReply::TimeoutError, "timeout", {}}); + WSPRNet wspr {&manager, retryPolicy (3), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + postFst4w (wspr, fst4wDecode ()); + postFst4w (wspr); + wspr.work (); + QVERIFY (manager.requests.front ().body.contains ("tcall=K1ABC")); + + postFst4w (wspr, "1235 -11 0.2 1505 ` K2DEF FN31 33"); + postFst4w (wspr); + + QTRY_VERIFY (sawStatus (statuses, "done")); + + int k1abc = 0, k2def = 0; + for (auto const& request : manager.requests) + { + if (request.body.contains ("tcall=K1ABC")) ++k1abc; + if (request.body.contains ("tcall=K2DEF")) ++k2def; + } + QVERIFY (k1abc >= 3); + QCOMPARE (k2def, 2); + } + + void emptyFst4wFlushUploadsStatusAndCompletes () + { + FakeNetworkAccessManager manager; + WSPRNet wspr {&manager, retryPolicy (), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + postFst4w (wspr); + wspr.work (); + + QTRY_VERIFY (sawStatus (statuses, "done")); + QCOMPARE (manager.requests.size (), 1); + QVERIFY (manager.requests.front ().body.contains ("function=wsprstat")); + } + + void spotWithoutTargetGridUploadsOnlyToPrimary () + { + QTemporaryDir dir; + QVERIFY (dir.isValid ()); + auto const path = writeSpotFile (dir, type2SpotFileLine ()); + + FakeNetworkAccessManager manager; + WSPRNet wspr {&manager, retryPolicy (), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + uploadFile (wspr, path); + wspr.work (); + + QTRY_VERIFY (sawStatus (statuses, "done")); + QCOMPARE (manager.requests.size (), 1); + QCOMPARE (manager.requests.front ().url.host (), QString {"wsprnet.org"}); + QUrlQuery query {QString::fromUtf8 (manager.requests.front ().body)}; + QCOMPARE (query.queryItemValue ("tcall", QUrl::FullyDecoded), QString {"K1ABC/P"}); + QCOMPARE (query.queryItemValue ("tgrid", QUrl::FullyDecoded), QString {}); + QVERIFY (!QFile::exists (path)); + } + + void unresolvedHashCallsignIsNotUploadedAsSpot () + { + QTemporaryDir dir; + QVERIFY (dir.isValid ()); + auto const path = writeSpotFile (dir, unresolvedHashSpotFileLine ()); + + FakeNetworkAccessManager manager; + WSPRNet wspr {&manager, retryPolicy (), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + uploadFile (wspr, path); + wspr.work (); + + QTRY_VERIFY (sawStatus (statuses, "done")); + QCOMPARE (manager.requests.size (), 1); + QUrlQuery query {QString::fromUtf8 (manager.requests.front ().body)}; + QCOMPARE (query.queryItemValue ("function", QUrl::FullyDecoded), QString {"wsprstat"}); + QCOMPARE (query.queryItemValue ("tcall", QUrl::FullyDecoded), QString {}); + } + + void directUploadSuccessDoesNotDeleteStaleFilePath () + { + QTemporaryDir dir; + QVERIFY (dir.isValid ()); + auto const path = writeSpotFile (dir); + + FakeNetworkAccessManager manager; + WSPRNet wspr {&manager, retryPolicy (), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + postFst4w (wspr, fst4wDecode ()); + postFst4w (wspr); + wspr.work (); + + QTRY_VERIFY (sawStatus (statuses, "done")); + QVERIFY (QFile::exists (path)); + } + + void directStatusCompletionDoesNotPoisonNextFileUpload () + { + QTemporaryDir dir; + QVERIFY (dir.isValid ()); + auto const path = writeSpotFile (dir); + + FakeNetworkAccessManager manager; + manager.enqueueResponse ({QNetworkReply::NoError, {}, "status accepted"}); + manager.enqueueResponse ({QNetworkReply::NoError, {}, "1 spot(s) added"}); + WSPRNet wspr {&manager, retryPolicy (), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + postFst4w (wspr); + wspr.work (); + QTRY_VERIFY (sawStatus (statuses, "done")); + + statuses.clear (); + uploadFile (wspr, path); + wspr.work (); + + QTRY_VERIFY (sawStatus (statuses, "done")); + QCOMPARE (manager.requests.size (), 3); + QVERIFY (!QFile::exists (path)); + } + + void fileBackedAllSuccessDeletesSpotFile () + { + QTemporaryDir dir; + QVERIFY (dir.isValid ()); + auto const path = writeSpotFile (dir); + + FakeNetworkAccessManager manager; + WSPRNet wspr {&manager, retryPolicy (), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + uploadFile (wspr, path); + wspr.work (); + + QTRY_VERIFY (sawStatus (statuses, "done")); + QCOMPARE (requestCountForHost (manager.requests, "wsprnet.org"), 1); + QCOMPARE (requestCountForHost (manager.requests, "wsprnet.eu"), 1); + QVERIFY (!QFile::exists (path)); + } + + void fileBackedSuccessDoesNotDeleteRewrittenSpotFile () + { + QTemporaryDir dir; + QVERIFY (dir.isValid ()); + auto const path = writeSpotFile (dir); + + FakeNetworkAccessManager manager; + manager.auto_finish = false; + WSPRNet wspr {&manager, retryPolicy (), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + uploadFile (wspr, path); + wspr.work (); + QCOMPARE (manager.requests.size (), 2); + QVERIFY (manager.requests.front ().body.contains ("tcall=K1ABC")); + + writeSpotFile (dir, secondSpotFileLine ()); + manager.finishNext (); + QCoreApplication::processEvents (); + manager.finishNext (); + QCoreApplication::processEvents (); + + QVERIFY (sawStatus (statuses, "done")); + QVERIFY (QFile::exists (path)); + + QFile file {path}; + QVERIFY (file.open (QIODevice::ReadOnly | QIODevice::Text)); + auto const contents = file.readAll (); + QVERIFY (contents.contains ("K2DEF")); + QVERIFY (!contents.contains ("K1ABC")); + } + + void fileBackedAlternateFailureDoesNotRetainAcceptedSpotFile () + { + QTemporaryDir dir; + QVERIFY (dir.isValid ()); + auto const path = writeSpotFile (dir, twoSpotFileLines ()); + + FakeNetworkAccessManager manager; + manager.enqueueResponse ({QNetworkReply::NoError, {}, "1 spot(s) added"}); + manager.enqueueResponse ({QNetworkReply::NoError, {}, "rejected"}); + WSPRNet wspr {&manager, retryPolicy (1), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + uploadFile (wspr, path); + wspr.work (); + + QTRY_VERIFY (sawStatus (statuses, "done")); + QCOMPARE (manager.requests.size (), 4); + QVERIFY (!QFile::exists (path)); + } + + void fileBackedPrimaryRejectionCanBeDeliveredByAlternate () + { + QTemporaryDir dir; + QVERIFY (dir.isValid ()); + auto const path = writeSpotFile (dir); + + FakeNetworkAccessManager manager; + manager.enqueueResponse ({QNetworkReply::NoError, {}, "rejected"}); + manager.enqueueResponse ({QNetworkReply::NoError, {}, "1 spot(s) added"}); + WSPRNet wspr {&manager, retryPolicy (1), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + uploadFile (wspr, path); + wspr.work (); + + QTRY_VERIFY (sawStatus (statuses, "done")); + QCOMPARE (manager.requests.size (), 2); + QVERIFY (!QFile::exists (path)); + } + + void fileBackedTransportFailureRetriesThenRetainsSpotFile () + { + QTemporaryDir dir; + QVERIFY (dir.isValid ()); + auto const path = writeSpotFile (dir); + + FakeNetworkAccessManager manager; + manager.enqueueResponse ({QNetworkReply::TimeoutError, "timeout", {}}); + manager.enqueueResponse ({QNetworkReply::TimeoutError, "timeout", {}}); + manager.enqueueResponse ({QNetworkReply::TimeoutError, "timeout", {}}); + manager.enqueueResponse ({QNetworkReply::TimeoutError, "timeout", {}}); + WSPRNet wspr {&manager, retryPolicy (2), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + uploadFile (wspr, path); + wspr.work (); + + QTRY_VERIFY (sawStatus (statuses, "done")); + QCOMPARE (manager.requests.size (), 4); + QVERIFY (QFile::exists (path)); + } + + void directUploadStopsAfterConfiguredAttempts () + { + FakeNetworkAccessManager manager; + for (int i = 0; i != 6; ++i) + { + manager.enqueueResponse ({QNetworkReply::TimeoutError, "timeout", {}}); + } + WSPRNet wspr {&manager, retryPolicy (3), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + postFst4w (wspr, fst4wDecode ()); + postFst4w (wspr); + wspr.work (); + + QTRY_VERIFY (sawStatus (statuses, "done")); + QCOMPARE (manager.requests.size (), 6); + } + + void fileBackedBadServerResponseRetriesThenRetainsSpotFile () + { + QTemporaryDir dir; + QVERIFY (dir.isValid ()); + auto const path = writeSpotFile (dir); + + FakeNetworkAccessManager manager; + manager.enqueueResponse ({QNetworkReply::NoError, {}, "rejected"}); + manager.enqueueResponse ({QNetworkReply::NoError, {}, "rejected"}); + manager.enqueueResponse ({QNetworkReply::NoError, {}, "still rejected"}); + manager.enqueueResponse ({QNetworkReply::NoError, {}, "still rejected"}); + WSPRNet wspr {&manager, retryPolicy (2), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + uploadFile (wspr, path); + wspr.work (); + + QTRY_VERIFY (sawStatus (statuses, "done")); + QCOMPARE (manager.requests.size (), 4); + QVERIFY (QFile::exists (path)); + } + + void alternateSiteFailureDoesNotResendAcceptedPrimary () + { + FakeNetworkAccessManager manager; + manager.enqueueResponse ({QNetworkReply::NoError, {}, "1 spot(s) added"}); + manager.enqueueResponse ({QNetworkReply::TimeoutError, "timeout", {}}); + manager.enqueueResponse ({QNetworkReply::TimeoutError, "timeout", {}}); + WSPRNet wspr {&manager, retryPolicy (2), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + postFst4w (wspr, fst4wDecode ()); + postFst4w (wspr); + wspr.work (); + + QTRY_VERIFY (sawStatus (statuses, "done")); + + QCOMPARE (requestCountForHost (manager.requests, "wsprnet.org"), 1); + QCOMPARE (requestCountForHost (manager.requests, "wsprnet.eu"), 2); + QCOMPARE (manager.requests.size (), 3); + } + + void expiredPendingUploadsAreDroppedAndFinalize () + { + FakeNetworkAccessManager manager; + WSPRNet wspr {&manager, retryPolicy (2, 1024, 50), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + postFst4w (wspr, fst4wDecode ()); + QTest::qWait (100); + postFst4w (wspr); + + QTRY_VERIFY (sawStatus (statuses, "done")); + QCOMPARE (manager.requests.size (), 0); + QVERIFY (sawStatusContaining (statuses, "expired")); + } + + void queueCapDropsOldestPendingUploads () + { + FakeNetworkAccessManager manager; + WSPRNet wspr {&manager, retryPolicy (2, 2), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + for (int i = 0; i != 5; ++i) + { + postFst4w (wspr, fst4wDecode ()); + } + postFst4w (wspr); + wspr.work (); + + QTRY_VERIFY (sawStatus (statuses, "done")); + QCOMPARE (manager.requests.size (), 4); + QCOMPARE (requestCountForHost (manager.requests, "wsprnet.org"), 2); + QCOMPARE (requestCountForHost (manager.requests, "wsprnet.eu"), 2); + QVERIFY (sawStatusContaining (statuses, "oldest pending")); + } + + void queueCapDoesNotDropPrimaryForAlternateLegs () + { + FakeNetworkAccessManager manager; + WSPRNet wspr {&manager, retryPolicy (1, 1), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + postFst4w (wspr, fst4wDecode ()); + postFst4w (wspr, "1235 -11 0.2 1505 ` K2DEF FN31 33"); + postFst4w (wspr); + wspr.work (); + + QTRY_VERIFY (sawStatus (statuses, "done")); + QCOMPARE (requestCountForHost (manager.requests, "wsprnet.org"), 1); + QCOMPARE (requestCountForHost (manager.requests, "wsprnet.eu"), 1); + } + + void abortClearsQueuedRetriesAndIgnoresStaleReplies () + { + QTemporaryDir dir; + QVERIFY (dir.isValid ()); + auto const path = writeSpotFile (dir); + + FakeNetworkAccessManager manager; + manager.auto_finish = false; + WSPRNet wspr {&manager, retryPolicy (), false}; + QSignalSpy statuses {&wspr, &WSPRNet::uploadStatus}; + + uploadFile (wspr, path); + wspr.work (); + QCOMPARE (manager.requests.size (), 2); + + wspr.abortOutstandingRequests (); + manager.finishAll (); + QCoreApplication::processEvents (); + + QVERIFY (QFile::exists (path)); + QVERIFY (!sawStatus (statuses, "done")); + } +}; + +QTEST_MAIN (TestWSPRNetUpload) + +#include "test_wsprnet_upload.moc" diff --git a/tests/unit/packjt77/CMakeLists.txt b/tests/unit/packjt77/CMakeLists.txt index f4ceff02..2ce41135 100644 --- a/tests/unit/packjt77/CMakeLists.txt +++ b/tests/unit/packjt77/CMakeLists.txt @@ -1,6 +1,132 @@ -add_executable (test_packjt77_hash_vectors - test_packjt77_hash_vectors.f90) -target_include_directories (test_packjt77_hash_vectors PRIVATE ${CMAKE_BINARY_DIR}) -target_link_libraries (test_packjt77_hash_vectors wsjt_fort wsjt_cxx) +# Build the shared helper module once so parallel test targets do not race +# while writing the same Fortran .mod interface file. +add_library (packjt77_test_helpers STATIC packjt77_test_helpers.f90) +set_target_properties (packjt77_test_helpers PROPERTIES + Fortran_MODULE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/packjt77_test_helpers") +target_include_directories (packjt77_test_helpers PUBLIC + "${CMAKE_CURRENT_BINARY_DIR}/packjt77_test_helpers") +wsjt_link_common_fortran (packjt77_test_helpers) -add_test (NAME test_packjt77_hash_vectors COMMAND test_packjt77_hash_vectors) +add_executable (test_packjt77_grammar_gate + test_packjt77_grammar_gate.f90) +target_include_directories (test_packjt77_grammar_gate PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_packjt77_grammar_gate) + +add_test (NAME test_packjt77_grammar_gate COMMAND test_packjt77_grammar_gate) + +add_executable (test_packjt77_invariants + test_packjt77_invariants.f90) +target_include_directories (test_packjt77_invariants PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries (test_packjt77_invariants PRIVATE packjt77_test_helpers) +wsjt_link_common_fortran (test_packjt77_invariants) + +add_test (NAME test_packjt77_invariants COMMAND test_packjt77_invariants) + +add_executable (test_packjt77var_invariants + test_packjt77var_invariants.f90) +target_include_directories (test_packjt77var_invariants PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries (test_packjt77var_invariants PRIVATE packjt77_test_helpers) +wsjt_link_common_fortran (test_packjt77var_invariants) + +add_test (NAME test_packjt77var_invariants COMMAND test_packjt77var_invariants) + +add_executable (test_packjt77sdvar_invariants + test_packjt77sdvar_invariants.f90) +target_include_directories (test_packjt77sdvar_invariants PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries (test_packjt77sdvar_invariants PRIVATE packjt77_test_helpers) +wsjt_link_common_fortran (test_packjt77sdvar_invariants) + +add_test (NAME test_packjt77sdvar_invariants COMMAND test_packjt77sdvar_invariants) + +add_executable (test_packjt77_protocol_vectors + test_packjt77_protocol_vectors.f90) +target_include_directories (test_packjt77_protocol_vectors PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries (test_packjt77_protocol_vectors PRIVATE packjt77_test_helpers) +wsjt_link_common_fortran (test_packjt77_protocol_vectors) + +add_test (NAME test_packjt77_protocol_vectors COMMAND test_packjt77_protocol_vectors) + +add_executable (test_packjt77_schema_encoder + test_packjt77_schema_encoder.f90) +target_include_directories (test_packjt77_schema_encoder PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries (test_packjt77_schema_encoder PRIVATE packjt77_test_helpers) +wsjt_link_common_fortran (test_packjt77_schema_encoder) + +add_test (NAME test_packjt77_schema_encoder COMMAND test_packjt77_schema_encoder) + +add_executable (test_packjt77_schema_decoder + test_packjt77_schema_decoder.f90) +target_include_directories (test_packjt77_schema_decoder PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries (test_packjt77_schema_decoder PRIVATE packjt77_test_helpers) +wsjt_link_common_fortran (test_packjt77_schema_decoder) + +add_test (NAME test_packjt77_schema_decoder COMMAND test_packjt77_schema_decoder) + +add_executable (test_packjt77_hash_state + test_packjt77_hash_state.f90) +target_include_directories (test_packjt77_hash_state PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries (test_packjt77_hash_state PRIVATE packjt77_test_helpers) +wsjt_link_common_fortran (test_packjt77_hash_state) + +add_test (NAME test_packjt77_hash_state COMMAND test_packjt77_hash_state) + +if (WSJT_BUILD_FORTRAN_OPENMP) + add_executable (test_packjt77_concurrent_unpack + test_packjt77_concurrent_unpack.f90) + target_include_directories (test_packjt77_concurrent_unpack PRIVATE + ${WSJT_FORTRAN_OPENMP_MODULE_DIR}) + target_link_libraries (test_packjt77_concurrent_unpack PRIVATE + wsjt_fort_omp wsjt_fortran_openmp) + + add_test (NAME test_packjt77_concurrent_unpack + COMMAND test_packjt77_concurrent_unpack) + set_tests_properties (test_packjt77_concurrent_unpack PROPERTIES + ENVIRONMENT "OMP_DYNAMIC=FALSE;OMP_NUM_THREADS=4;OMP_THREAD_LIMIT=4" + PROCESSORS 4 + TIMEOUT 30) +endif () + +add_executable (test_packjt77_pack28_sweep + test_packjt77_pack28_sweep.f90) +target_include_directories (test_packjt77_pack28_sweep PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_packjt77_pack28_sweep) + +add_test (NAME test_packjt77_pack28_sweep COMMAND test_packjt77_pack28_sweep) + +add_executable (test_packjt77_domain_sweeps + test_packjt77_domain_sweeps.f90) +target_include_directories (test_packjt77_domain_sweeps PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries (test_packjt77_domain_sweeps PRIVATE packjt77_test_helpers) +wsjt_link_common_fortran (test_packjt77_domain_sweeps) + +add_test (NAME test_packjt77_domain_sweeps COMMAND test_packjt77_domain_sweeps) + +add_executable (test_packjt77_mutation_sweep + test_packjt77_mutation_sweep.f90) +target_include_directories (test_packjt77_mutation_sweep PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries (test_packjt77_mutation_sweep PRIVATE packjt77_test_helpers) +wsjt_link_common_fortran (test_packjt77_mutation_sweep) + +add_test (NAME test_packjt77_mutation_sweep COMMAND test_packjt77_mutation_sweep) + +find_program (WSJT_SH_EXECUTABLE NAMES sh) +if (NOT WSJT_SH_EXECUTABLE) + message (FATAL_ERROR "sh is required to run lint_packjt77_idioms") +endif () + +add_test (NAME lint_packjt77_idioms + COMMAND "${WSJT_SH_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/lint_packjt77_idioms.sh" + "${CMAKE_SOURCE_DIR}") + +add_executable (test_packjt77_silent_rewrite_corpus + test_packjt77_silent_rewrite_corpus.f90) +target_include_directories (test_packjt77_silent_rewrite_corpus PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_packjt77_silent_rewrite_corpus) + +add_test (NAME test_packjt77_silent_rewrite_corpus + COMMAND test_packjt77_silent_rewrite_corpus + ${CMAKE_CURRENT_SOURCE_DIR}/silent_rewrite_corpus.txt --assert-zero-silent) +if (WSJT_ENABLE_TSAN) + set_tests_properties (test_packjt77_silent_rewrite_corpus PROPERTIES + ENVIRONMENT "TSAN_OPTIONS=${wsjt_tsan_fortran_options}") +endif () diff --git a/tests/unit/packjt77/encode77_test_messages.txt b/tests/unit/packjt77/encode77_test_messages.txt new file mode 100644 index 00000000..50f45596 --- /dev/null +++ b/tests/unit/packjt77/encode77_test_messages.txt @@ -0,0 +1,3 @@ +CQ K1ABC FN42 +HELLO@WORLD +K1ABC W9XYZ EN37 diff --git a/tests/unit/packjt77/lint_packjt77_idioms.sh b/tests/unit/packjt77/lint_packjt77_idioms.sh new file mode 100755 index 00000000..b221f9f0 --- /dev/null +++ b/tests/unit/packjt77/lint_packjt77_idioms.sh @@ -0,0 +1,88 @@ +#!/bin/sh + +root=${1:-.} +fail=0 + +show_violation() { + label=$1 + lines=$2 + echo "$label" + echo "$lines" + fail=1 +} + +pack_reads=$(grep -En "read *\(.*,\*" "$root/lib/77bit/packjt77.f90" || true) +if [ -n "$pack_reads" ]; then + show_violation "list-directed read in packjt77.f90:" "$pack_reads" +fi + +grammar_reads=$(grep -En "read *\(.*,\*" "$root/lib/77bit/packjt77_grammar.f90" || true) +grammar_read_count=0 +grammar_read_extra= +while IFS= read -r line; do + [ -z "$line" ] && continue + case "$line" in + *": read(token,*,err=10) value") + grammar_read_count=$((grammar_read_count + 1)) + ;; + *) + grammar_read_extra="${grammar_read_extra} +$line" + ;; + esac +done <]'" "$root/lib/77bit/packjt77.f90" || true) +bracket_extra= +while IFS= read -r line; do + [ -z "$line" ] && continue + case "$line" in + *": i=index(cw,'>')"|\ + *": i=index(cw,'>')"|\ + *": i2=index(c13,'>')"|\ + *": if(index(call_1,'<').le.0) then"|\ + *": if(index(call_2,'<').le.0) then") + ;; + *) + bracket_extra="${bracket_extra} +$line" + ;; + esac +done <') + if(i.gt.0) c13(i:)=' ' + end subroutine normalize_call + + subroutine assert_message_type(label,input,want_i3,want_n3,got_i3,got_n3) + character(len=*), intent(in) :: label, input + integer, intent(in) :: want_i3, want_n3, got_i3, got_n3 + + if(got_i3.ne.want_i3 .or. got_n3.ne.want_n3) then + write(*,1000) trim(label), trim(input), want_i3, want_n3, got_i3, got_n3 +1000 format(a,' message type failure for "',a,'"; wanted ',i0,'.',i0, & + ' got ',i0,'.',i0) + error stop 1 + endif + end subroutine assert_message_type + + subroutine assert_binary_payload(label,input,c77) + character(len=*), intent(in) :: label, input + character(len=77), intent(in) :: c77 + + if(.not.is_binary_payload(c77)) then + write(*,1010) trim(label), trim(input), c77 +1010 format(a,' emitted non-binary payload for "',a,'": ',a) + error stop 1 + endif + end subroutine assert_binary_payload + + subroutine assert_pack77_result(label,input,encoded) + character(len=*), intent(in) :: label, input + type(pack77_result), intent(in) :: encoded + + if(.not.encoded%encoded) then + write(*,1015) trim(label), trim(input) +1015 format(a,' failed to encode "',a,'"') + error stop 1 + endif + if(encoded%i3.lt.0 .or. encoded%i3.gt.7 .or. encoded%n3.lt.0 .or. & + encoded%n3.gt.7) then + write(*,1016) trim(label), trim(input), encoded%i3, encoded%n3 +1016 format(a,' emitted invalid type for "',a,'": ',i0,'.',i0) + error stop 1 + endif + call assert_binary_payload(label,input,encoded%c77) + end subroutine assert_pack77_result + + type(pack77_result) function pack77_result_from_api(msg,options) result(encoded) + character(len=*), intent(in) :: msg + type(pack77_options), intent(in), optional :: options + + encoded=pack77_result() + call pack77(msg,encoded%i3,encoded%n3,encoded%c77,options, & + status=encoded%status) + encoded%encoded=encoded%i3.ge.0 + end function pack77_result_from_api + + type(pack77_result) function pack77_legacy_result_from_api(msg,options) & + result(encoded) + character(len=*), intent(in) :: msg + type(pack77_options), intent(in), optional :: options + + encoded=pack77_result() + call pack77_legacy_truncating_fallback(msg,encoded%i3,encoded%n3, & + encoded%c77,options,status=encoded%status) + encoded%encoded=encoded%i3.ge.0 + end function pack77_legacy_result_from_api + + type(pack77_result) function pack77_with_hint(msg,pack_i3,pack_n3) result(encoded) + character(len=*), intent(in) :: msg + integer, intent(in) :: pack_i3, pack_n3 + + encoded=pack77_result() + if(pack_i3.eq.0 .and. pack_n3.eq.5) then + encoded=strict_telemetry_result_from_schema(msg) + else if(pack_i3.eq.0 .and. pack_n3.eq.6) then + encoded=pack77_result_from_api(msg, & + pack77_options(prefer_wspr_50bit=.true.)) + else + encoded=pack77_result_from_api(msg) + endif + end function pack77_with_hint + + type(pack77_result) function strict_telemetry_result_from_schema(msg) & + result(encoded) + character(len=*), intent(in) :: msg + character(len=37) :: text + character(len=18) :: c18 + character(len=1) :: ch + integer :: i,n + integer :: ntel(3) + logical :: ok + + encoded=pack77_result() + text=adjustl(msg) + n=len_trim(text) + if(n.lt.1 .or. n.gt.18) return + do i=1,n + ch=text(i:i) + if(ch.ge.'a' .and. ch.le.'z') ch=char(ichar(ch)-32) + if(index('0123456789ABCDEF',ch).eq.0) return + text(i:i)=ch + enddo + + c18=text(1:n) + c18=adjustr(c18) + ntel=-99 + read(c18,1005,err=6) ntel +1005 format(3z6) +6 if(ntel(1).lt.0 .or. ntel(2).lt.0 .or. ntel(3).lt.0) return + + call encode_pack77_telemetry(ntel(1),ntel(2),ntel(3),encoded%c77,ok) + if(ok) then + encoded%encoded=.true. + encoded%status=PACK77_STATUS_ENCODED + encoded%i3=0 + encoded%n3=5 + endif + end function strict_telemetry_result_from_schema + + logical function is_binary_payload(c77) + character(len=77), intent(in) :: c77 + integer :: i + + is_binary_payload=.true. + do i=1,77 + if(c77(i:i).ne.'0' .and. c77(i:i).ne.'1') then + is_binary_payload=.false. + return + endif + enddo + end function is_binary_payload + + subroutine assert_decode(label,input,expected,decoded,ok) + character(len=*), intent(in) :: label, input, expected, decoded + logical, intent(in) :: ok + + if(.not.ok) then + write(*,1020) trim(label), trim(input) +1020 format(a,' unpack failure for "',a,'"') + error stop 1 + endif + if(trim(decoded).ne.expected) then + write(*,1030) trim(label), trim(input), trim(expected), trim(decoded) +1030 format(a,' decode failure for "',a,'"; expected "',a,'"; got "',a,'"') + error stop 1 + endif + end subroutine assert_decode + + subroutine assert_text_equal(label,left,right) + character(len=*), intent(in) :: label, left, right + + if(trim(left).ne.trim(right)) then + write(*,1040) trim(label), trim(left), trim(right) +1040 format(a,' mismatch; left "',a,'" right "',a,'"') + error stop 1 + endif + end subroutine assert_text_equal + + subroutine assert_canonical_text(label,input,canonical,decoded) + character(len=*), intent(in) :: label, input, canonical, decoded + + if(canonical.ne.decoded) then + write(*,1045) trim(label), trim(input), trim(canonical), trim(decoded) +1045 format(a,' canonical mismatch for "',a,'"; canonical "',a, & + '"; decoded "',a,'"') + error stop 1 + endif + end subroutine assert_canonical_text + + logical function normalized_equal(left,right) result(equal) + character(len=*), intent(in) :: left, right + character(len=37) :: left_norm, right_norm + + call normalize_message(left,left_norm) + call normalize_message(right,right_norm) + equal=trim(left_norm).eq.trim(right_norm) + end function normalized_equal + + logical function canonical_match(left,right) result(matches) + character(len=*), intent(in) :: left, right + character(len=37) :: left_tokens(19), right_tokens(19), wrapped + integer :: left_n, right_n, i + + matches=.false. + call split_tokens(left,left_tokens,left_n) + call split_tokens(right,right_tokens,right_n) + if(left_n.ne.right_n) return + do i=1,left_n + if(trim(left_tokens(i)).eq.trim(right_tokens(i))) cycle + if(plausible_auto_hash_source(left_tokens(i))) then + wrapped=' ' + wrapped='<'//trim(left_tokens(i))//'>' + if(trim(right_tokens(i)).eq.trim(wrapped)) cycle + endif + if(trim(right_tokens(i)).eq.'<...>' .and. & + hash_placeholder_source(left_tokens(i))) cycle + return + enddo + matches=.true. + end function canonical_match + + logical function telemetry_match(left,right) result(matches) + character(len=*), intent(in) :: left, right + character(len=37) :: left_tokens(19), right_tokens(19) + integer :: left_n, right_n + + ! Telemetry messages allow a documented leading-zero canonical form. + matches=.false. + call split_tokens(left,left_tokens,left_n) + call split_tokens(right,right_tokens,right_n) + if(left_n.ne.1 .or. right_n.ne.1) return + matches=telemetry_token_match(left_tokens(1),right_tokens(1)) + end function telemetry_match + + subroutine assert_call(label,got,expected) + character(len=*), intent(in) :: label, got, expected + + if(trim(got).ne.expected) then + write(*,1050) trim(label), trim(expected), trim(got) +1050 format(a,' failure; expected "',a,'"; got "',a,'"') + error stop 1 + endif + end subroutine assert_call + + subroutine assert_int(label,expected,got) + character(len=*), intent(in) :: label + integer, intent(in) :: expected, got + + if(got.ne.expected) then + write(*,1060) trim(label), expected, got +1060 format(a,' failure; expected ',i0,' got ',i0) + error stop 1 + endif + end subroutine assert_int + + subroutine normalize_message(input_msg,normalized) + character(len=*), intent(in) :: input_msg + character(len=37), intent(out) :: normalized + character(len=37) :: tokens(19) + integer :: nwords, i + + normalized=' ' + call split_tokens(input_msg,tokens,nwords) + do i=1,nwords + if(len_trim(normalized).gt.0) normalized=trim(normalized)//' ' + normalized=trim(normalized)//trim(tokens(i)) + enddo + end subroutine normalize_message + + subroutine split_tokens(input_msg,tokens,nwords) + character(len=*), intent(in) :: input_msg + character(len=37), intent(out) :: tokens(19) + integer, intent(out) :: nwords + character(len=1) :: c, previous + integer :: i, n + + tokens=' ' + nwords=0 + n=0 + previous=' ' + do i=1,len_trim(input_msg) + c=input_msg(i:i) + if(ichar(c).eq.0) c=' ' + if(c.ge.'a' .and. c.le.'z') c=char(ichar(c)-32) + if(c.eq.' ' .and. previous.eq.' ') cycle + if(c.ne.' ' .and. previous.eq.' ') then + nwords=nwords+1 + n=0 + if(nwords.gt.size(tokens)) return + endif + if(c.ne.' ') then + n=n+1 + if(n.le.len(tokens(1))) tokens(nwords)(n:n)=c + endif + previous=c + enddo + end subroutine split_tokens + + logical function plausible_auto_hash_source(token) result(ok) + character(len=*), intent(in) :: token + integer :: i,n,slash + + n=len_trim(token) + ok=.false. + if(n.lt.3 .or. n.gt.11) return + slash=index(token(1:n),'/') + if(slash.lt.2 .or. slash.ge.n) return + if(index(token(slash+1:n),'/').gt.0) return + do i=1,n + if(i.eq.slash) cycle + if(.not.((token(i:i).ge.'A' .and. token(i:i).le.'Z') .or. & + (token(i:i).ge.'0' .and. token(i:i).le.'9'))) return + enddo + ok=.true. + end function plausible_auto_hash_source + + logical function hash_placeholder_source(token) result(ok) + character(len=*), intent(in) :: token + integer :: n + + n=len_trim(token) + ok=plausible_auto_hash_source(token) + if(ok) return + if(n.lt.3 .or. n.gt.13) return + ok=token(1:1).eq.'<' .and. token(n:n).eq.'>' .and. n-2.le.11 + end function hash_placeholder_source + + logical function telemetry_token_match(left,right) result(matches) + character(len=*), intent(in) :: left, right + character(len=18) :: left_hex, right_hex + integer :: left_n, right_n + + matches=.false. + left_hex=upper_token(left) + right_hex=upper_token(right) + left_n=len_trim(left_hex) + right_n=len_trim(right_hex) + if(left_n.lt.17 .or. left_n.gt.18) return + if(right_n.lt.17 .or. right_n.gt.18) return + if(.not.is_hex_token(left_hex,left_n)) return + if(.not.is_hex_token(right_hex,right_n)) return + if(left_n.eq.right_n .and. trim(left_hex).eq.trim(right_hex)) then + matches=.true. + else if(left_n.eq.right_n+1 .and. left_hex(1:1).eq.'0' .and. & + left_hex(2:left_n).eq.right_hex(1:right_n)) then + matches=.true. + else if(right_n.eq.left_n+1 .and. right_hex(1:1).eq.'0' .and. & + right_hex(2:right_n).eq.left_hex(1:left_n)) then + matches=.true. + endif + end function telemetry_token_match + + logical function is_hex_token(token,n) result(ok) + character(len=*), intent(in) :: token + integer, intent(in) :: n + integer :: i + + ok=.true. + do i=1,n + if(index('0123456789ABCDEF',token(i:i)).eq.0) then + ok=.false. + return + endif + enddo + end function is_hex_token + + character(len=18) function upper_token(token) result(upper) + character(len=*), intent(in) :: token + integer :: i, n + character :: c + + upper=' ' + n=min(len_trim(token),len(upper)) + do i=1,n + c=token(i:i) + if(c.ge.'a' .and. c.le.'z') c=char(ichar(c)-32) + upper(i:i)=c + enddo + end function upper_token + + subroutine assert_true(label,condition) + character(len=*), intent(in) :: label + logical, intent(in) :: condition + + if(.not.condition) then + write(*,1070) trim(label) +1070 format(a,' failure') + error stop 1 + endif + end subroutine assert_true + + subroutine assert_shared_hash_tables_empty(label) + character(len=*), intent(in) :: label + + call assert_int(trim(label)//' nzhash',0,nzhash) + call assert_true(trim(label)//' calls10',all(calls10.eq.'')) + call assert_true(trim(label)//' calls12',all(calls12.eq.'')) + call assert_true(trim(label)//' calls22',all(calls22.eq.'')) + call assert_true(trim(label)//' recent calls',all(recent_calls.eq.'')) + call assert_true(trim(label)//' ihash22',all(ihash22.eq.-1)) + call assert_true(trim(label)//' queued hash counts', & + all(nqueued_calls_by_thread.eq.0)) + call assert_true(trim(label)//' queued recent counts', & + all(nqueued_recent_calls_by_thread.eq.0)) + call assert_true(trim(label)//' queued calls', & + all(queued_calls_by_thread.eq.'')) + call assert_true(trim(label)//' queued recent calls', & + all(queued_recent_calls_by_thread.eq.'')) + end subroutine assert_shared_hash_tables_empty + + subroutine run_packjt77_common_invariants(configured_var,ntests) + logical, intent(in) :: configured_var + integer, intent(inout) :: ntests + + call expect_round_trip('K1ABC W9XYZ FN42', & + 'K1ABC W9XYZ FN42', 1, 0, 0) + call expect_round_trip('K1ABC W9XYZ R-11', & + 'K1ABC W9XYZ R-11', 1, 0, 0) + call expect_round_trip('K1ABC W9XYZ', & + 'K1ABC W9XYZ', 1, 0, 0) + call expect_round_trip('K1ABC W9XYZ RRR', & + 'K1ABC W9XYZ RRR', 1, 0, 0) + call expect_round_trip('K1ABC W9XYZ RR73', & + 'K1ABC W9XYZ RR73', 1, 0, 0) + call expect_round_trip('K1ABC W9XYZ 73', & + 'K1ABC W9XYZ 73', 1, 0, 0) + call expect_round_trip('K1ABC W9XYZ +00', & + 'K1ABC W9XYZ +00', 1, 0, 0) + call expect_round_trip('K1ABC W9XYZ -30', & + 'K1ABC W9XYZ -30', 1, 0, 0) + call expect_round_trip('K1ABC W9XYZ -31', & + 'K1ABC W9XYZ -31', 1, 0, 0) + call expect_round_trip('K1ABC W9XYZ -50', & + 'K1ABC W9XYZ -50', 1, 0, 0) + call expect_round_trip('K1ABC W9XYZ +50', & + 'K1ABC W9XYZ +50', 1, 0, 0) + call expect_pack77_failure('K1ABC W9XYZ -55') + call expect_pack77_failure('K1ABC W9XYZ +51') + call expect_round_trip('K1ABC W9XYZ R+00', & + 'K1ABC W9XYZ R+00', 1, 0, 0) + call expect_round_trip('K1ABC W9XYZ R-31', & + 'K1ABC W9XYZ R-31', 1, 0, 0) + call expect_round_trip('K1ABC W9XYZ R-50', & + 'K1ABC W9XYZ R-50', 1, 0, 0) + call expect_round_trip('K1ABC W9XYZ R+50', & + 'K1ABC W9XYZ R+50', 1, 0, 0) + call expect_pack77_failure('K1ABC W9XYZ R-55') + call expect_pack77_failure('K1ABC W9XYZ R+51') + call expect_round_trip('K1ABC W9XYZ R FN42', & + 'K1ABC W9XYZ R FN42', 1, 0, 0) + call expect_pack77_failure('K1ABC W9XYZ FN42X') + call expect_pack77_failure('K1ABC W9XYZ R FN42X') + call expect_round_trip('K1ABC/P W9XYZ/P R FN42', & + 'K1ABC/P W9XYZ/P R FN42', 2, 0, 0) + call expect_round_trip('K1ABC/P W9XYZ/P FN42', & + 'K1ABC/P W9XYZ/P FN42', 2, 0, 0) + call expect_not_message_type('K1ABC/R W9XYZ/P FN42', 2, 0) + call expect_not_message_type('K1ABC W9XYZ +3', 1, 0) + call expect_round_trip('HELLO WORLD', & + 'HELLO WORLD', 0, 0, 0) + call expect_round_trip('hello', & + 'HELLO', 0, 0, 0) + call expect_round_trip('FREE TEXT MSG', & + 'FREE TEXT MSG', 0, 0, 0) + call expect_round_trip('ABCDEFGHIJKLM', & + 'ABCDEFGHIJKLM', 0, 0, 0) + call expect_pack77_failure('ABCDEFGHIJKLMN') + call expect_pack77_failure('HELLO WORLD 73') + call expect_pack77_failure('HELLO@WORLD') + call expect_pack77_failure('K1ABC PJ4/K9XYZ') + call expect_free_text_rejection('HELLO@WORLD', & + PACK77_STATUS_FREE_TEXT_INVALID) + call expect_free_text_rejection('THIS MESSAGE IS TOO LONG', & + PACK77_STATUS_FREE_TEXT_TOO_LONG) + call expect_pack77_structured('K1ABC W9XYZ FN42', 1, 0) + call expect_free_text_rejection('K1ABC W9XYZ@', & + PACK77_STATUS_FREE_TEXT_INVALID) + call expect_free_text_rejection('ABCDEFGHIJKLMN', & + PACK77_STATUS_FREE_TEXT_TOO_LONG) + call expect_free_text_rejection('A:B', & + PACK77_STATUS_FREE_TEXT_INVALID) + call expect_free_text_fallback('K1ABC R BOGUS', 'K1ABC R BOGUS') + call expect_legacy_truncating_fallback('ABCDEFGHIJKLMN', & + 'ABCDEFGHIJKLM') + call expect_legacy_truncating_fallback('K1ABCW9XYZ FN42', & + 'K1ABCW9XYZ FN') + call expect_legacy_matches_strict('K1ABC W9XYZ FN42') + call expect_legacy_matches_strict('FREE TEXT MSG') + call expect_legacy_fallback_failure('HELLO@WORLD 73', & + PACK77_STATUS_FREE_TEXT_INVALID) + call expect_round_trip('WA9XYZ KA1ABC R 16A EMA', & + 'WA9XYZ KA1ABC R 16A EMA', 0, 3, 0) + call expect_round_trip('WA9XYZ KA1ABC R 32A EMA', & + 'WA9XYZ KA1ABC R 32A EMA', 0, 4, 0) + call expect_round_trip('WA9XYZ KA1ABC 1A EMA', & + 'WA9XYZ KA1ABC 1A EMA', 0, 3, 0) + call expect_round_trip('WA9XYZ KA1ABC R 1A EMA', & + 'WA9XYZ KA1ABC R 1A EMA', 0, 3, 0) + call expect_round_trip_with_hashes('W1AW/P K1ABC 5A CT', & + ' K1ABC 5A CT', 0, 3, 0, 'W1AW/P', '', '') + call expect_round_trip_with_hashes('ABCDEFG/HIJ KLMNOPQ/RST R 32A EMA', & + ' R 32A EMA', 0, 4, 0, & + 'ABCDEFG/HIJ', 'KLMNOPQ/RST', '') + call expect_round_trip('WA9XYZ KA1ABC 15F DX', & + 'WA9XYZ KA1ABC 15F DX', 0, 3, 0) + call expect_round_trip('WA9XYZ KA1ABC 17A EMA', & + 'WA9XYZ KA1ABC 17A EMA', 0, 4, 0) + call expect_round_trip_with_hashes('Y8W MW8WA/A R 17A ONE', & + 'Y8W R 17A ONE', 0, 4, 0, 'MW8WA/A', '', '') + call expect_round_trip('WA9XYZ KA1ABC R 32A NB', & + 'WA9XYZ KA1ABC R 32A NB', 0, 4, 0) + call expect_pack77_failure('WA9XYZ KA1ABC R 1H EMA') + call expect_round_trip('PJ2/W1AW KA1ABC R 1A EMA', & + '<...> KA1ABC R 1A EMA', 0, 3, 0) + call expect_pack77_failure('WA9XYZ KA1ABC R 0A EMA') + call expect_pack77_failure('WA9XYZ KA1ABC R 33A EMA') + call expect_pack77_failure('WA9XYZ KA1ABC R 1A XYZ') + call expect_not_message_type('WA9XYZ KA1ABC +1A EMA', 0, 3) + call expect_not_message_type('WA9XYZ KA1ABC 01A EMA', 0, 3) + call expect_not_message_type('WA9XYZ KA1ABC R 1A EM', 0, 3) + call expect_not_message_type('WA9XYZ KA1ABC X 1A EMA', 0, 3) + call expect_not_message_type(' KA1ABC R 1A EMA', 0, 3) + call expect_pack77_failure('K1ABC/ K1A 1A CT') + call expect_pack77_failure('/K1ABC K1A 1A CT') + call expect_pack77_failure('A//B K1A 1A CT') + call expect_pack77_failure('K1ABC//P K1A 1A CT') + call expect_pack77_failure('ABCDEFGHI/JKL MNOPQRSTU/VWX 1A EMA') + call expect_round_trip('123456789ABCDEF012', & + '123456789ABCDEF012', 0, 5, 0) + call expect_round_trip_with_hint('0de', & + '0000000000000000DE', 0, 5, 0, 5, 0, '', '', '') + call expect_round_trip('TU; W9XYZ K1ABC R 579 MA', & + 'TU; W9XYZ K1ABC R 579 MA', 3, 0, 0) + call expect_round_trip('W9XYZ K1ABC R 579 MA', & + 'W9XYZ K1ABC R 579 MA', 3, 0, 0) + call expect_round_trip('W9XYZ K1ABC 579 MA', & + 'W9XYZ K1ABC 579 MA', 3, 0, 0) + call expect_round_trip('TU; W9XYZ G8ABC R 559 0013', & + 'TU; W9XYZ G8ABC R 559 0013', 3, 0, 0) + call expect_round_trip('W9XYZ G8ABC 559 0013', & + 'W9XYZ G8ABC 559 0013', 3, 0, 0) + call expect_round_trip('W9XYZ K1ABC 529 MA', & + 'W9XYZ K1ABC 529 MA', 3, 0, 0) + call expect_round_trip_with_hashes('W9XYZ W1AW/P R 599 MA', & + 'W9XYZ R 599 MA', 3, 0, 0, 'W1AW/P', '', '') + call expect_round_trip('TU; W9XYZ K1ABC 599 MA', & + 'TU; W9XYZ K1ABC 599 MA', 3, 0, 0) + call expect_round_trip('TU; W9XYZ K1ABC R 589 DC', & + 'TU; W9XYZ K1ABC R 589 DC', 3, 0, 0) + call expect_round_trip('W9XYZ VE3ABC 559 ON', & + 'W9XYZ VE3ABC 559 ON', 3, 0, 0) + call expect_round_trip('W9XYZ G8ABC 529 0001', & + 'W9XYZ G8ABC 529 0001', 3, 0, 0) + call expect_round_trip('W9XYZ G8ABC R 599 7999', & + 'W9XYZ G8ABC R 599 7999', 3, 0, 0) + call expect_round_trip('TU; W9XYZ G8ABC 529 0001', & + 'TU; W9XYZ G8ABC 529 0001', 3, 0, 0) + call expect_pack77_failure('W9XYZ K1ABC 509 MA') + call expect_pack77_failure('W9XYZ K1ABC R 519 MA') + call expect_pack77_failure('W9XYZ K1ABC R 609 MA') + call expect_pack77_failure('W9XYZ K1ABC R 579 XYZ') + call expect_pack77_failure('W9XYZ K1ABC 579 MAX') + call expect_pack77_failure('W9XYZ G8ABC R 559 13') + call expect_pack77_failure('W9XYZ G8ABC R 559 0000') + call expect_pack77_failure('W9XYZ G8ABC R 559 8000') + call expect_not_message_type('W9XYZ K1ABC R 579 MA JUNK', 3, 0) + call expect_not_message_type(' K1ABC R 579 MA', 3, 0) + call expect_not_message_type('TU; GF9/XJ4PIE GP5MZC/1 R 539 1843', 3, 0) + call expect_raw_type3_unpack_failure(0) + call expect_raw_type3_unpack_success(1, & + 'W9XYZ K1ABC R 579 0001') + call expect_raw_type3_unpack_success(7999, & + 'W9XYZ K1ABC R 579 7999') + call expect_raw_type3_unpack_failure(8000) + call expect_raw_type3_unpack_failure(8191) + call expect_nonbinary_unpack_failure() + call expect_not_message_type(' R 579 MA', 3, 0) + call expect_round_trip('CQ PJ4/K1ABC', & + 'CQ PJ4/K1ABC', 4, 0, 0) + call expect_pack77_failure('CQ PJ4/K1ABC RR73') + call expect_not_message_type('CQ PJ4/K1ABC FK52', 1, 0) + call expect_round_trip('CQ N0CALL', & + 'CQ N0CALL', 4, 0, 0) + call expect_round_trip('CQ N0CAL FN31', & + 'CQ N0CAL FN31', 1, 0, 0) + call expect_not_message_type('CQ N0CALL FN31', 1, 0) + call expect_not_message_type('CQ N0CALL FN31', 4, 0) + call expect_pack77_failure('CQ N0CALL FN31') + call expect_pack77_failure('K1ABC PJ4/K9XYZ') + call expect_not_message_type('CQ 3DA0RS/W1ABC', 4, 0) + call expect_round_trip('CQ K1ABC FN42', & + 'CQ K1ABC FN42', 1, 0, 0) + call expect_round_trip('CQ 146 K1ABC FN42', & + 'CQ 146 K1ABC FN42', 1, 0, 0) + call expect_round_trip('CQ DX K1ABC FN42', & + 'CQ DX K1ABC FN42', 1, 0, 0) + call expect_round_trip('DE K1ABC FN42', & + 'DE K1ABC FN42', 1, 0, 0) + + call expect_round_trip('K1ABC FN42 37', & + 'K1ABC FN42 37', 0, 6, 0) + call expect_round_trip('PJ2/K1ABC 37', & + 'PJ2/K1ABC 37', 0, 6, 0) + call expect_round_trip('DL/K1ABC 37', & + 'DL/K1ABC 37', 0, 6, 0) + call expect_round_trip('K1ABC/P 37', & + 'K1ABC/P 37', 0, 6, 0) + call expect_not_message_type('00/K1ABC 37', 0, 6) + call expect_not_message_type('K1ABC/00 37', 0, 6) + call expect_round_trip_with_hint(' FK52AB', & + ' FK52AB', 0, 6, 0, 6, 0, 'PJ4/K1ABC', '', '') + call expect_not_message_type('PJ2/K1ABC FN42 37', 0, 6) + call expect_not_message_type('K1ABC FN4 37', 0, 6) + call expect_not_message_type('Q5A FN20 37', 0, 6) + call expect_not_message_type('VK9X/W1ABC 37', 0, 6) + call expect_not_message_type('A$/K1ABC 37', 0, 6) + call expect_not_message_type('K1ABC/A$ 37', 0, 6) + call expect_not_message_type('K1ABC/ABCD 37', 0, 6) + call expect_not_message_type('PJ2/Q5A 37', 0, 6) + call expect_not_message_type('K1ABC FN42 55', 0, 6) + call expect_not_message_type('K1ABC FN42 03', 0, 6) + call expect_not_message_type(' FK52AB', 0, 6) + call expect_strict_telemetry_rejects('K1ABC W9XYZ') + call expect_strict_telemetry_rejects('') + call expect_strict_telemetry_rejects(' ') + call expect_strict_telemetry_rejects('+1') + call expect_strict_telemetry_rejects('-1') + call expect_strict_telemetry_rejects('ABC DEF') + call expect_strict_telemetry_rejects('123G') + call expect_strict_telemetry_rejects('123456789ABCDEF0123') + call expect_not_message_type('6666AAAAAAAA66666661ZZ', 0, 5) + call expect_prefer_wspr_rejects_invalid_type3(' FK52A!') + call expect_prefer_wspr_rejects_invalid_type3('X FK52AB') + call expect_legacy_prefer_wspr_rejects('PJ4/K1ABC FK52A!') + + call expect_round_trip_with_hashes(' W9XYZ RR73', & + ' W9XYZ RR73', 1, 0, 0, 'PJ4/K1ABC', '', '') + call expect_round_trip_with_hashes(' W9XYZ RRR', & + ' W9XYZ RRR', 1, 0, 0, 'PJ4/K1ABC', '', '') + call expect_round_trip_with_hashes(' W9XYZ 73', & + ' W9XYZ 73', 1, 0, 0, 'PJ4/K1ABC', '', '') + if(configured_var) then + call expect_type_unpack_failure_with_hashes('PJ2/W1AW ', & + 4, 0, 0, 'W7ABC', '', '') + else + call expect_round_trip_with_hashes('PJ2/W1AW ', & + 'PJ2/W1AW ', 4, 0, 0, 'W7ABC', '', '') + endif + call expect_round_trip_with_hashes('PJ2/W1AW RRR', & + 'PJ2/W1AW RRR', 4, 0, 0, 'W7ABC', '', '') + call expect_round_trip_with_hashes('PJ2/W1AW RR73', & + 'PJ2/W1AW RR73', 4, 0, 0, 'W7ABC', '', '') + call expect_round_trip_with_hashes('PJ2/W1AW 73', & + 'PJ2/W1AW 73', 4, 0, 0, 'W7ABC', '', '') + call expect_round_trip_with_hashes(' PJ2/W1AW RR73', & + ' PJ2/W1AW RR73', 4, 0, 0, 'W7ABC', '', '') + call expect_round_trip_with_context('PJ2/W1AW 73', & + 'PJ2/W1AW 73', 4, 0, 0, 'W7ABC', 'N0BBB', '', '', '') + call expect_round_trip_with_context(' W9XYZ RR73', & + ' W9XYZ RR73', 1, 0, 1, 'PJ4/K1ABC', 'W9XYZ', '', '', '') + call expect_round_trip_with_hashes(' W9XYZ -12', & + ' W9XYZ -12', 1, 0, 0, 'PJ4/K1ABC', '', '') + call expect_not_message_type(' W9XYZ -12', 4, 0) + call expect_not_message_type('X W9XYZ RR73', 1, 0) + call expect_not_message_type('W9XYZ X RR73', 1, 0) + call expect_not_message_type('K1ABC RR73', 4, 0) + call expect_not_message_type(' K1ABC RR73', 4, 0) + call expect_not_message_type(' RR73', 4, 0) + call expect_pack77_failure('CQ ') + + call expect_round_trip_with_hashes(' 590001 FN20QI', & + ' 590001 FN20QI', 5, 0, 0, 'W3CCX', 'K1JT/P', '') + call expect_round_trip_with_hashes(' 520001 FN20QI', & + ' 520001 FN20QI', 5, 0, 0, 'W3CCX', 'K1JT/P', '') + call expect_round_trip_with_hashes(' R 520001 FN20QI', & + ' R 520001 FN20QI', 5, 0, 0, 'W3CCX', 'K1JT/P', '') + call expect_round_trip_with_hashes(' R 592047 FN20QI', & + ' R 592047 FN20QI', 5, 0, 0, 'W3CCX', 'K1JT/P', '') + call expect_round_trip(' 590001 FN20QI', & + '<...> <...> 590001 FN20QI', 5, 0, 0) + call expect_not_message_type(' 520000 FN20QI', 5, 0) + call expect_not_message_type(' 530000 FN20QI', 5, 0) + call expect_not_message_type(' 592048 FN20QI', 5, 0) + call expect_not_message_type(' 582048 FN20QI', 5, 0) + call expect_not_message_type(' 594095 FN20QI', 5, 0) + call expect_not_message_type(' 590001 FN20QY', 5, 0) + call expect_not_message_type(' 590001 FN20Q', 5, 0) + call expect_not_message_type(' X 590001 FN20QI', 5, 0) + call expect_not_message_type(' RR 590001 FN20QI', 5, 0) + call expect_not_message_type('W3CCX 590001 FN20QI', 5, 0) + call expect_not_message_type(' 590001 FN20QI', 5, 0) + call expect_not_message_type(' X 590001 FN20QI', 5, 0) + call expect_not_message_type(' 0590001 FN20QI', 5, 0) + + call expect_round_trip_with_context('K1ABC RR73; W9XYZ -12', & + 'K1ABC RR73; W9XYZ -12', 0, 1, 1, & + 'N0AAA', 'KH1/KH7Z', '', '', '') + call expect_round_trip_with_context('K1ABC RR73; W9XYZ -30', & + 'K1ABC RR73; W9XYZ -30', 0, 1, 1, & + 'N0AAA', 'KH1/KH7Z', '', '', '') + call expect_round_trip_with_context('K1ABC RR73; W9XYZ +00', & + 'K1ABC RR73; W9XYZ +00', 0, 1, 1, & + 'N0AAA', 'KH1/KH7Z', '', '', '') + call expect_round_trip_with_context('K1ABC RR73; W9XYZ +32', & + 'K1ABC RR73; W9XYZ +32', 0, 1, 1, & + 'N0AAA', 'KH1/KH7Z', '', '', '') + call expect_pack77_failure('K1ABC RR73; W9XYZ -11') + call expect_pack77_failure('K1ABC RR73; W9XYZ -31') + call expect_pack77_failure('K1ABC RR73; W9XYZ +33') + call expect_pack77_failure('K1ABC RR73; W9XYZ +34') + call expect_round_trip_with_context('K1ABC RR73; W9XYZ -12', & + 'K1ABC RR73; W9XYZ -12', 0, 1, 0, & + 'KH1/KH7Z', 'N0BBB', '', '', '') + call expect_not_message_type('K1ABC RR73: W9XYZ -12', 0, 1) + call expect_not_message_type('K1ABC RRR; W9XYZ -12', 0, 1) + call expect_round_trip_with_context('PJ2/W1AW RR73; W9XYZ -12', & + '<...> RR73; W9XYZ -12', 0, 1, 1, & + 'N0AAA', 'KH1/KH7Z', '', '', '') + call expect_round_trip_with_context('K1ABC RR73; PJ2/W1AW -12', & + 'K1ABC RR73; <...> -12', 0, 1, 1, & + 'N0AAA', 'KH1/KH7Z', '', '', '') + call expect_round_trip_with_hashes('PJ2/W1AW RR73; W9XYZ -12', & + ' RR73; W9XYZ -12', 0, 1, 0, & + 'PJ2/W1AW', 'KH1/KH7Z', '') + call expect_pack77_failure('PJ2/W1AW RR73; W9/YZ -12') + call expect_not_message_type(' RR73; W9XYZ -12', 0, 1) + call expect_not_message_type('K1ABC RR73; W9XYZ KH1/KH7Z -12', 0, 1) + call expect_not_message_type('K1ABC RR73; W9XYZ X -12', 0, 1) + call expect_not_message_type('K1ABC RR73; W9XYZ 3', 0, 1) + call expect_not_message_type('K1ABC RR73; W9XYZ -12 JUNK', 0, 1) + + call expect_round_trip(' k1abc w9xyz fn42', & + 'K1ABC W9XYZ FN42', 1, 0, 0) + call expect_round_trip('K1ABC/R W9XYZ/R R FN42', & + 'K1ABC/R W9XYZ/R R FN42', 1, 0, 0) + call expect_round_trip('CQ PJ2/W1AW', & + 'CQ PJ2/W1AW', 4, 0, 0) + call expect_round_trip('CQ TEST/W1AW', & + 'CQ TEST/W1AW', 4, 0, 0) + call expect_round_trip('QRZ PJ4/K1ABC', & + 'QRZ PJ4/K1ABC', 0, 0, 0) + call expect_pack77_failure('CQ K1ABC R FN42') + call expect_not_message_type('CQ K1A W1AW FN20', 1, 0) + call expect_not_message_type('CQ TJ. K1ABC FN20', 1, 0) + call expect_not_message_type(' TEST', 5, 0) + call expect_not_message_type(' ', 1, 0) + call expect_not_message_type(' ', 5, 0) + + call expect_dual_angle_type1_placeholders(' ', '<...> <...>') + call expect_dual_angle_type1_placeholders(' RR73', & + '<...> <...> RR73') + + contains + + subroutine expect_round_trip(input,expected,want_i3,want_n3,nrx) + character(len=*), intent(in) :: input, expected + integer, intent(in) :: want_i3, want_n3, nrx + + call expect_round_trip_with_context(input,expected,want_i3,want_n3,nrx, & + 'N0AAA', 'N0BBB', '', '', '') + end subroutine expect_round_trip + + subroutine expect_round_trip_with_hashes(input,expected,want_i3,want_n3, & + nrx,hash_call_1,hash_call_2,hash_call_3) + character(len=*), intent(in) :: input, expected + integer, intent(in) :: want_i3, want_n3, nrx + character(len=*), intent(in) :: hash_call_1, hash_call_2, hash_call_3 + + call expect_round_trip_with_context(input,expected,want_i3,want_n3,nrx, & + 'N0AAA', 'N0BBB', hash_call_1, hash_call_2, hash_call_3) + end subroutine expect_round_trip_with_hashes + + subroutine expect_round_trip_with_context(input,expected,want_i3,want_n3, & + nrx,mycall,dxcall,hash_call_1,hash_call_2,hash_call_3) + character(len=*), intent(in) :: input, expected + integer, intent(in) :: want_i3, want_n3, nrx + character(len=*), intent(in) :: mycall, dxcall + character(len=*), intent(in) :: hash_call_1, hash_call_2, hash_call_3 + + call expect_round_trip_with_pack_state(input,expected,want_i3,want_n3, & + -1,-1,nrx,mycall,dxcall,hash_call_1,hash_call_2,hash_call_3) + end subroutine expect_round_trip_with_context + + subroutine expect_round_trip_with_hint(input,expected,want_i3,want_n3, & + pack_i3,pack_n3,nrx,hash_call_1,hash_call_2,hash_call_3) + character(len=*), intent(in) :: input, expected + integer, intent(in) :: want_i3, want_n3, pack_i3, pack_n3, nrx + character(len=*), intent(in) :: hash_call_1, hash_call_2, hash_call_3 + + call expect_round_trip_with_pack_state(input,expected,want_i3,want_n3, & + pack_i3,pack_n3,nrx,'N0AAA','N0BBB',hash_call_1,hash_call_2, & + hash_call_3) + end subroutine expect_round_trip_with_hint + + subroutine expect_round_trip_with_pack_state(input,expected,want_i3,want_n3, & + pack_i3,pack_n3,nrx,mycall,dxcall,hash_call_1,hash_call_2,hash_call_3) + character(len=*), intent(in) :: input, expected + integer, intent(in) :: want_i3, want_n3, pack_i3, pack_n3, nrx + character(len=*), intent(in) :: mycall, dxcall + character(len=*), intent(in) :: hash_call_1, hash_call_2, hash_call_3 + character(len=77) :: c77 + character(len=37) :: canonical, canonical_decoded, decoded, packed_input + integer :: got_i3, got_n3 + logical :: canonical_ok, ok + + packed_input=' ' + packed_input=input + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + + got_i3=pack_i3 + got_n3=pack_n3 + c77='' + block + type(pack77_result) :: encoded + encoded=pack77_with_hint(packed_input,pack_i3,pack_n3) + call assert_pack77_result('pack77',input,encoded) + call assert_true('pack77 gate not rejected',encoded%status.ne.PACK77_STATUS_INTERNAL_ROUNDTRIP_REJECTED) + got_i3=encoded%i3 + got_n3=encoded%n3 + c77=encoded%c77 + end block + + call assert_message_type('pack77',input,want_i3,want_n3,got_i3,got_n3) + canonical_decoded=' ' + canonical_ok=.false. + call unpack77(c77,0,canonical_decoded,canonical_ok) + call assert_decode('pack77 canonical',input,canonical_decoded, & + canonical_decoded,canonical_ok) + canonical=canonical_decoded + call assert_canonical_text('pack77',input,canonical,canonical_decoded) + + call reset_packjt77_mode_state(mycall, dxcall) + call prime_hash_call_mode(hash_call_1) + call prime_hash_call_mode(hash_call_2) + call prime_hash_call_mode(hash_call_3) + + decoded=' ' + ok=.false. + call unpack77_mode(c77,nrx,decoded,ok) + if(.not.ok) then + write(*,1010) trim(input) +1010 format('Unpack failure for "',a,'"') + error stop 1 + endif + if(trim(decoded).ne.expected) then + write(*,1020) trim(input), trim(expected), trim(decoded) +1020 format('Round-trip failure for "',a,'"; expected "',a,'"; got "',a,'"') + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_round_trip_with_pack_state + + subroutine expect_not_message_type(input,blocked_i3,blocked_n3) + character(len=*), intent(in) :: input + integer, intent(in) :: blocked_i3, blocked_n3 + character(len=37) :: packed_input + integer :: got_i3, got_n3 + + packed_input=' ' + packed_input=input + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + + got_i3=-1 + got_n3=-1 + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input) + if(.not.encoded%encoded) then + ntests=ntests+1 + return + endif + got_i3=encoded%i3 + got_n3=encoded%n3 + end block + if(got_i3.eq.blocked_i3 .and. got_n3.eq.blocked_n3) then + write(*,1060) trim(input), blocked_i3, blocked_n3 +1060 format('Message "',a,'" packed as blocked type ',i0,'.',i0) + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_not_message_type + + subroutine expect_raw_type3_unpack_failure(nexch) + integer, intent(in) :: nexch + character(len=77) :: c77 + character(len=37) :: decoded + logical :: ok, unpack_ok + + call encode_pack77_type3(0,12751800,10214965,1,5,nexch,c77,ok) + call assert_true('raw Type 3 payload encoded',ok) + + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + decoded=' ' + unpack_ok=.true. + call unpack77_mode(c77,0,decoded,unpack_ok) + if(unpack_ok) then + write(*,1080) nexch, trim(decoded) +1080 format('Raw Type 3 exchange ',i0,' decoded successfully as "',a,'"') + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_raw_type3_unpack_failure + + subroutine expect_raw_type3_unpack_success(nexch,expected) + integer, intent(in) :: nexch + character(len=*), intent(in) :: expected + character(len=77) :: c77 + character(len=37) :: decoded + logical :: ok, unpack_ok + + call encode_pack77_type3(0,12751800,10214965,1,5,nexch,c77,ok) + call assert_true('raw Type 3 payload encoded',ok) + + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + decoded=' ' + unpack_ok=.false. + call unpack77_mode(c77,0,decoded,unpack_ok) + call assert_decode('raw Type 3 exchange boundary',expected,expected, & + decoded,unpack_ok) + + ntests=ntests+1 + end subroutine expect_raw_type3_unpack_success + + subroutine expect_nonbinary_unpack_failure() + character(len=77) :: c77 + character(len=37) :: decoded + logical :: ok + + c77=repeat('0',77) + c77(10:10)='x' + c77(75:77)='001' + + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + decoded=' ' + ok=.true. + call unpack77_mode(c77,0,decoded,ok) + if(ok) then + write(*,1082) trim(decoded) +1082 format('Non-binary payload decoded successfully as "',a,'"') + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_nonbinary_unpack_failure + + subroutine expect_pack77_failure(input) + character(len=*), intent(in) :: input + character(len=37) :: packed_input + + packed_input=' ' + packed_input=input + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input) + if(encoded%encoded) then + write(*,1095) trim(input), encoded%i3, encoded%n3 +1095 format('Message "',a,'" unexpectedly packed as ',i0,'.',i0) + error stop 1 + endif + end block + + ntests=ntests+1 + end subroutine expect_pack77_failure + + subroutine expect_free_text_rejection(input,want_status) + character(len=*), intent(in) :: input + integer, intent(in) :: want_status + character(len=37) :: packed_input + + packed_input=' ' + packed_input=input + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input) + if(encoded%encoded) then + write(*,1098) trim(input), encoded%i3, encoded%n3 +1098 format('Free text "',a,'" unexpectedly packed as ',i0, & + '.',i0) + error stop 1 + endif + call assert_int('free text reject status '//trim(input), & + want_status,encoded%status) + end block + + ntests=ntests+1 + end subroutine expect_free_text_rejection + + subroutine expect_strict_telemetry_rejects(input) + character(len=*), intent(in) :: input + character(len=37) :: packed_input + + packed_input=' ' + packed_input=input + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + + block + type(pack77_result) :: encoded + encoded=strict_telemetry_result_from_schema(packed_input) + if(encoded%encoded) then + write(*,1097) trim(input), encoded%i3, encoded%n3 +1097 format('Strict telemetry message "',a,'" unexpectedly packed as ', & + i0,'.',i0) + error stop 1 + endif + end block + + ntests=ntests+1 + end subroutine expect_strict_telemetry_rejects + + subroutine expect_prefer_wspr_rejects_invalid_type3(input) + character(len=*), intent(in) :: input + + call expect_prefer_wspr_rejects_invalid_type3_impl(input) + end subroutine expect_prefer_wspr_rejects_invalid_type3 + + subroutine expect_prefer_wspr_rejects_invalid_type3_impl(input) + character(len=*), intent(in) :: input + character(len=37) :: packed_input + character(len=24) :: prefix + + prefix='Preferred WSPR' + packed_input=' ' + packed_input=input + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input, & + pack77_options(prefer_wspr_50bit=.true.)) + if(encoded%encoded) then + write(*,1096) trim(prefix), trim(input), encoded%i3, encoded%n3 +1096 format(a,' message "',a,'" unexpectedly packed as ',i0,'.',i0) + error stop 1 + endif + call assert_true('failed preferred WSPR status', & + encoded%status.eq.PACK77_STATUS_PREFERRED_FAMILY_REJECTED) + end block + + ntests=ntests+1 + end subroutine expect_prefer_wspr_rejects_invalid_type3_impl + + subroutine expect_type_unpack_failure_with_hashes(input,want_i3,want_n3, & + nrx,hash_call_1,hash_call_2,hash_call_3) + character(len=*), intent(in) :: input + integer, intent(in) :: want_i3, want_n3, nrx + character(len=*), intent(in) :: hash_call_1, hash_call_2, hash_call_3 + character(len=77) :: c77 + character(len=37) :: decoded, packed_input + integer :: got_i3, got_n3 + logical :: ok + + packed_input=' ' + packed_input=input + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + + c77='' + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input) + call assert_pack77_result('pack77',packed_input,encoded) + got_i3=encoded%i3 + got_n3=encoded%n3 + c77=encoded%c77 + end block + call assert_message_type('pack77',input,want_i3,want_n3,got_i3,got_n3) + + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + call prime_hash_call_mode(hash_call_1) + call prime_hash_call_mode(hash_call_2) + call prime_hash_call_mode(hash_call_3) + + decoded=' ' + ok=.true. + call unpack77_mode(c77,nrx,decoded,ok) + if(ok) then + write(*,1100) trim(input), trim(decoded) +1100 format('Message "',a,'" decoded successfully as "',a,'"') + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_type_unpack_failure_with_hashes + + subroutine expect_free_text_fallback(input,expected) + character(len=*), intent(in) :: input, expected + + call expect_free_text_fallback_impl(input,expected) + end subroutine expect_free_text_fallback + + subroutine expect_free_text_fallback_impl(input,expected) + character(len=*), intent(in) :: input, expected + character(len=77) :: c77 + character(len=37) :: canonical, decoded, packed_input + character(len=40) :: pack_label + character(len=16) :: prefix + integer :: got_i3, got_n3 + logical :: ok + + pack_label='pack77' + prefix='Free-text' + packed_input=' ' + packed_input=input + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + + got_i3=-1 + got_n3=-1 + c77='' + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input) + call assert_pack77_result(trim(pack_label),packed_input,encoded) + got_i3=encoded%i3 + got_n3=encoded%n3 + c77=encoded%c77 + end block + call assert_message_type(trim(pack_label),input,0,0,got_i3,got_n3) + + decoded=' ' + ok=.false. + call unpack77_mode(c77,0,decoded,ok) + if(.not.ok) then + write(*,1070) trim(prefix), trim(input) +1070 format(a,' unpack failure for "',a,'"') + error stop 1 + endif + if(trim(decoded).ne.expected) then + write(*,1085) trim(prefix), trim(input), trim(expected), trim(decoded) +1085 format(a,' failure for "',a,'"; expected "',a,'"; got "',a,'"') + error stop 1 + endif + canonical=decoded + call assert_canonical_text('pack77 free text',input,canonical,decoded) + + ntests=ntests+1 + end subroutine expect_free_text_fallback_impl + + subroutine expect_legacy_truncating_fallback(input,expected) + character(len=*), intent(in) :: input, expected + character(len=37) :: decoded, packed_input + logical :: ok + + packed_input=' ' + packed_input=input + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + + block + type(pack77_result) :: strict_encoded, legacy_encoded + strict_encoded=pack77_result_from_api(packed_input) + if(strict_encoded%encoded) then + write(*,1105) trim(input), strict_encoded%i3, strict_encoded%n3 +1105 format('Strict message "',a,'" unexpectedly packed as ',i0,'.',i0) + error stop 1 + endif + + legacy_encoded=pack77_legacy_result_from_api(packed_input) + call assert_pack77_result('legacy truncating fallback', & + packed_input,legacy_encoded) + call assert_message_type('legacy truncating fallback',input, & + 0,0,legacy_encoded%i3,legacy_encoded%n3) + + decoded=' ' + ok=.false. + call unpack77_mode(legacy_encoded%c77,0,decoded,ok) + call assert_decode('legacy truncating fallback',input,expected, & + decoded,ok) + end block + + ntests=ntests+1 + end subroutine expect_legacy_truncating_fallback + + subroutine expect_legacy_matches_strict(input) + character(len=*), intent(in) :: input + character(len=37) :: packed_input + + packed_input=' ' + packed_input=input + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + + block + type(pack77_result) :: strict_encoded, legacy_encoded + strict_encoded=pack77_result_from_api(packed_input) + legacy_encoded=pack77_legacy_result_from_api(packed_input) + call assert_pack77_result('strict pack77',packed_input,strict_encoded) + call assert_pack77_result('legacy wrapper',packed_input,legacy_encoded) + call assert_int('legacy matches strict i3',strict_encoded%i3, & + legacy_encoded%i3) + call assert_int('legacy matches strict n3',strict_encoded%n3, & + legacy_encoded%n3) + call assert_text_equal('legacy matches strict c77', & + strict_encoded%c77,legacy_encoded%c77) + end block + + ntests=ntests+1 + end subroutine expect_legacy_matches_strict + + subroutine expect_legacy_fallback_failure(input,want_status) + character(len=*), intent(in) :: input + integer, intent(in) :: want_status + character(len=37) :: packed_input + + packed_input=' ' + packed_input=input + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + + block + type(pack77_result) :: encoded + encoded=pack77_legacy_result_from_api(packed_input) + if(encoded%encoded) then + write(*,1110) trim(input), encoded%i3, encoded%n3 +1110 format('Legacy fallback message "',a,'" unexpectedly packed as ', & + i0,'.',i0) + error stop 1 + endif + call assert_int('legacy fallback reject status '//trim(input), & + want_status,encoded%status) + end block + + ntests=ntests+1 + end subroutine expect_legacy_fallback_failure + + subroutine expect_legacy_prefer_wspr_rejects(input) + character(len=*), intent(in) :: input + character(len=37) :: packed_input + + packed_input=' ' + packed_input=input + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + + block + type(pack77_result) :: encoded + encoded=pack77_legacy_result_from_api(packed_input, & + pack77_options(prefer_wspr_50bit=.true.)) + if(encoded%encoded) then + write(*,1115) trim(input), encoded%i3, encoded%n3 +1115 format('Legacy WSPR message "',a,'" unexpectedly packed as ', & + i0,'.',i0) + error stop 1 + endif + call assert_int('legacy preferred WSPR status', & + PACK77_STATUS_PREFERRED_FAMILY_REJECTED,encoded%status) + end block + + ntests=ntests+1 + end subroutine expect_legacy_prefer_wspr_rejects + + subroutine expect_pack77_structured(input,want_i3,want_n3) + character(len=*), intent(in) :: input + integer, intent(in) :: want_i3, want_n3 + character(len=37) :: packed_input + + packed_input=' ' + packed_input=input + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input) + call assert_pack77_result('pack77 structured', & + packed_input,encoded) + call assert_message_type('pack77 structured',input, & + want_i3,want_n3,encoded%i3,encoded%n3) + end block + + ntests=ntests+1 + end subroutine expect_pack77_structured + + subroutine expect_dual_angle_type1_placeholders(input,expected) + character(len=*), intent(in) :: input, expected + character(len=77) :: c77 + character(len=37) :: canonical, canonical_decoded, decoded, packed_input + integer :: got_i3, got_n3 + logical :: canonical_ok, ok + + packed_input=' ' + packed_input=input + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + + c77='' + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input) + call assert_pack77_result('pack77',packed_input,encoded) + got_i3=encoded%i3 + got_n3=encoded%n3 + c77=encoded%c77 + end block + call assert_message_type('pack77',input,1,0,got_i3,got_n3) + canonical_decoded=' ' + canonical_ok=.false. + call unpack77(c77,0,canonical_decoded,canonical_ok) + call assert_decode('dual-angle Type 1 canonical',input,canonical_decoded, & + canonical_decoded,canonical_ok) + canonical=canonical_decoded + call assert_canonical_text('dual-angle Type 1',input,canonical, & + canonical_decoded) + + call reset_packjt77_mode_state('N0AAA', 'N0BBB') + decoded=' ' + ok=.false. + call unpack77_mode(c77,0,decoded,ok) + if(.not.ok) then + write(*,1040) trim(input) +1040 format('Dual-angle Type 1 unpack failure for "',a,'"') + error stop 1 + endif + if(trim(decoded).ne.expected) then + write(*,1050) trim(input), trim(expected), trim(decoded) +1050 format('Dual-angle Type 1 placeholder failure for "',a, & + '"; expected "',a,'"; got "',a,'"') + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_dual_angle_type1_placeholders + + subroutine reset_packjt77_mode_state(mycall,dxcall) + character(len=*), intent(in) :: mycall, dxcall + + if(configured_var) then + call reset_packjt77var_state(mycall,dxcall) + else + call reset_packjt77_state(mycall,dxcall) + endif + end subroutine reset_packjt77_mode_state + + subroutine prime_hash_call_mode(callsign) + character(len=*), intent(in) :: callsign + + if(configured_var) then + call prime_hash_call_var(callsign) + else + call prime_hash_call(callsign) + endif + end subroutine prime_hash_call_mode + + subroutine unpack77_mode(c77,nrx,decoded,ok) + character(len=77), intent(in) :: c77 + integer, intent(in) :: nrx + character(len=37), intent(out) :: decoded + logical, intent(out) :: ok + + if(configured_var) then + call unpack77_configured(c77,nrx,decoded,ok,unpack77_options(thread_index=1)) + else + call unpack77(c77,nrx,decoded,ok) + endif + end subroutine unpack77_mode + + end subroutine run_packjt77_common_invariants + + subroutine run_packjt77_standard_schema_invariants(ntests) + integer, intent(inout) :: ntests + + call expect_type12_qso_tail_mapping() + + contains + + subroutine expect_type12_qso_tail_mapping() + call expect_type12_qso_tail_irpt('Type 1 no tail', & + 1,32400+1,'K1ABC W9XYZ') + call expect_type12_qso_tail_irpt('Type 1 RRR', & + 1,32400+2,'K1ABC W9XYZ RRR') + call expect_type12_qso_tail_irpt('Type 1 RR73', & + 1,32400+3,'K1ABC W9XYZ RR73') + call expect_type12_qso_tail_irpt('Type 1 73', & + 1,32400+4,'K1ABC W9XYZ 73') + + call expect_type12_qso_tail_irpt('Type 2 no tail', & + 2,32400+1,'K1ABC/P W9XYZ/P') + call expect_type12_qso_tail_irpt('Type 2 RRR', & + 2,32400+2,'K1ABC/P W9XYZ/P RRR') + call expect_type12_qso_tail_irpt('Type 2 RR73', & + 2,32400+3,'K1ABC/P W9XYZ/P RR73') + call expect_type12_qso_tail_irpt('Type 2 73', & + 2,32400+4,'K1ABC/P W9XYZ/P 73') + + ntests=ntests+1 + end subroutine expect_type12_qso_tail_mapping + + subroutine expect_type12_qso_tail_irpt(label,want_i3,want_igrid4,expected) + character(len=*), intent(in) :: label, expected + integer, intent(in) :: want_i3, want_igrid4 + character(len=37) :: decoded + character(len=77) :: c77 + type(pack77_type12_fields) :: fields + logical :: ok, unpack_ok + + ok=.false. + if(want_i3.eq.1) then + call encode_pack77_type1(10214965,0,12751800,0,0,want_igrid4,c77,ok) + else + call encode_pack77_type2(10214965,1,12751800,1,0,want_igrid4,c77,ok) + endif + call assert_true(trim(label)//' Type 1/2 schema encode',ok) + + fields=pack77_type12_fields() + if(want_i3.eq.1) then + call decode_pack77_type1(c77,fields,ok) + else + call decode_pack77_type2(c77,fields,ok) + endif + call assert_true(trim(label)//' Type 1/2 schema decode',ok) + call assert_int(trim(label)//' igrid4',want_igrid4,fields%igrid4) + + call reset_packjt77_state('N0AAA', 'N0BBB') + decoded=' ' + unpack_ok=.false. + call unpack77(c77,0,decoded,unpack_ok) + call assert_true(trim(label)//' unpack',unpack_ok) + call assert_text_equal(trim(label)//' decoded tail',expected,decoded) + end subroutine expect_type12_qso_tail_irpt + + end subroutine run_packjt77_standard_schema_invariants + + subroutine reset_packjt77_state(mycall,dxcall) + character(len=*), intent(in) :: mycall, dxcall + + call clear_standard_state(mycall,dxcall) + end subroutine reset_packjt77_state + + subroutine reset_packjt77var_state(mycall,dxcall) + character(len=*), intent(in) :: mycall, dxcall + integer :: n10, n12, n22 + + call clear_all_state(mycall,dxcall) + if(len_trim(mycall).gt.2) then + call save_hash_call(mycall13,hashmy10_configured,hashmy12_configured, & + hashmy22_configured) + endif + if(len_trim(dxcall).gt.2) then + call prime_hash_call_var(dxcall) + call save_hash_call(dxcall13,n10,n12,n22) + endif + end subroutine reset_packjt77var_state + + subroutine prime_hash_call(callsign) + character(len=*), intent(in) :: callsign + integer :: n10, n12, n22 + character(len=13) :: c13 + + if(len_trim(callsign).le.0) return + c13=' ' + c13=callsign + call save_hash_call(c13,n10,n12,n22) + end subroutine prime_hash_call + + subroutine prime_hash_call_var(callsign) + character(len=*), intent(in) :: callsign + integer :: n10, n12, n22 + character(len=13) :: c13 + + if(len_trim(callsign).le.0) return + call normalize_call(callsign,c13) + if(len_trim(c13).le.0) return + call save_hash_call(c13,n10,n12,n22) + call store_rx_hash_var(c13) + end subroutine prime_hash_call_var + + subroutine store_rx_hash_var(c13) + character(len=*), intent(in) :: c13 + integer :: n10, n12, n22, i + + n10=ihashcall(c13,10) + if(n10.ge.0 .and. n10.le.1023) calls10(n10)=c13 + n12=ihashcall(c13,12) + if(n12.ge.0 .and. n12.le.4095) calls12(n12)=c13 + n22=ihashcall(c13,22) + do i=1,nzhash + if(ihash22(i).eq.n22) then + calls22(i)=c13 + return + endif + enddo + if(nzhash.lt.MAXHASH) then + if(nzhash.ge.1) then + ihash22(nzhash+1:2:-1)=ihash22(nzhash:1:-1) + calls22(nzhash+1:2:-1)=calls22(nzhash:1:-1) + endif + nzhash=nzhash+1 + ihash22(1)=n22 + calls22(1)=c13 + endif + end subroutine store_rx_hash_var + +end module packjt77_test_helpers diff --git a/tests/unit/packjt77/silent_rewrite_corpus.txt b/tests/unit/packjt77/silent_rewrite_corpus.txt new file mode 100644 index 00000000..ed668d6d --- /dev/null +++ b/tests/unit/packjt77/silent_rewrite_corpus.txt @@ -0,0 +1,54 @@ +W1AW/P K1ABC 5A CT | compound-call-regression +K1ABC/R W9XYZ/P FN42 | compound-call-regression +CQ PJ4/K1ABC FK52 | compound-call-regression +VK9X/W1ABC 37 | compound-call-regression +K1ABC FN42 55 | compound-call-regression +CQ 3DA0RS/W1ABC | compound-call-regression +CQ PJ4/K1ABC | compound-call-regression +CQ | compound-call-regression +PJ2/W1AW RR73 | silent-rewrite-regression + W9XYZ RR73 | silent-rewrite-regression +K1ABC RR73; W9XYZ -12 | silent-rewrite-regression + 590001 FN20QI | silent-rewrite-regression +PJ2/W1AW KA1ABC R 1A EMA | silent-rewrite-regression +Y8W MW8WA/A R 17A ONE | silent-rewrite-regression +W9XYZ W1AW/P R 599 MA | silent-rewrite-regression +K1ABC FN42 37 | silent-rewrite-regression +PJ2/K1ABC 37 | silent-rewrite-regression +K1ABC/P 37 | silent-rewrite-regression +X W9XYZ RR73 | malformed-bracket +W9XYZ X RR73 | malformed-bracket + FK52A! | malformed-bracket +X FK52AB | malformed-bracket + 590001 FN20QI | malformed-bracket + X 590001 FN20QI | malformed-bracket +K1ABC RR73; W9XYZ X -12 | malformed-bracket +K1ABC/ K1A 1A CT | grammar-edge +/K1ABC K1A 1A CT | grammar-edge +A//B K1A 1A CT | grammar-edge +K1ABC//P K1A 1A CT | grammar-edge +K1ABC RR73 | grammar-edge + K1ABC RR73 | grammar-edge + RR73 | grammar-edge + | grammar-edge +K1ABC RR73; PJ2/W1AW -12 | grammar-edge +PJ2/W1AW RR73; W9XYZ -12 | grammar-edge +K1ABC RR73: W9XYZ -12 | grammar-edge +K1ABC RRR; W9XYZ -12 | grammar-edge +WA9XYZ KA1ABC R 1H EMA | grammar-edge +WA9XYZ KA1ABC R 0A EMA | grammar-edge +WA9XYZ KA1ABC 01A EMA | grammar-edge +W9XYZ K1ABC 579 MAX | grammar-edge +W9XYZ G8ABC R 559 8000 | grammar-edge +K1ABC FN42 03 | grammar-edge +A$/K1ABC 37 | grammar-edge +K1ABC/ABCD 37 | grammar-edge +Q5A FN20 37 | grammar-edge +CQ K1ABC R FN42 | grammar-edge +CQ N0CALL FN31 | grammar-edge +K1ABC PJ4/K9XYZ | grammar-edge +QRZ PJ4/K1ABC | grammar-edge +K1ABC RR73; W9XYZ -12 JUNK | overlong-field + 590001 FN20QI EXTRA | overlong-field +PJ2/W1AW RR73; W9/YZ -12 | overlong-field diff --git a/tests/unit/packjt77/test_encode77.cmake b/tests/unit/packjt77/test_encode77.cmake new file mode 100644 index 00000000..f614241a --- /dev/null +++ b/tests/unit/packjt77/test_encode77.cmake @@ -0,0 +1,39 @@ +execute_process( + COMMAND "${ENCODE77}" "CQ K1ABC FN42" + RESULT_VARIABLE valid_result + OUTPUT_VARIABLE valid_output + ERROR_VARIABLE valid_error +) +if (NOT valid_result EQUAL 0) + message(FATAL_ERROR "Valid message failed (${valid_result}):\n${valid_output}${valid_error}") +endif () +if (NOT valid_output MATCHES "1[ ]+OK[ ]+CQ K1ABC FN42[ ]+CQ K1ABC FN42") + message(FATAL_ERROR "Valid message output was unexpected:\n${valid_output}") +endif () + +execute_process( + COMMAND "${ENCODE77}" "THIS FREE TEXT IS TOO LONG" + RESULT_VARIABLE rejected_result + OUTPUT_VARIABLE rejected_output + ERROR_VARIABLE rejected_error +) +if (rejected_result EQUAL 0) + message(FATAL_ERROR "Rejected message returned success:\n${rejected_output}") +endif () +if (NOT rejected_output MATCHES "REJECTED[ ]+THIS FREE TEXT IS TOO LONG[ ]+free text too long") + message(FATAL_ERROR "Rejected message output was unexpected:\n${rejected_output}${rejected_error}") +endif () + +execute_process( + COMMAND "${ENCODE77}" -f "${INPUT_FILE}" + WORKING_DIRECTORY "${INPUT_DIR}" + RESULT_VARIABLE batch_result + OUTPUT_VARIABLE batch_output + ERROR_VARIABLE batch_error +) +if (batch_result EQUAL 0) + message(FATAL_ERROR "Batch with a rejection returned success:\n${batch_output}") +endif () +if (NOT batch_output MATCHES "Summary: 2 encoded, 1 rejected, 0 unpack failures, 0 differences") + message(FATAL_ERROR "Batch summary was unexpected:\n${batch_output}${batch_error}") +endif () diff --git a/tests/unit/packjt77/test_pack77_cli_fallbacks.cmake b/tests/unit/packjt77/test_pack77_cli_fallbacks.cmake new file mode 100644 index 00000000..ed3d3aa1 --- /dev/null +++ b/tests/unit/packjt77/test_pack77_cli_fallbacks.cmake @@ -0,0 +1,75 @@ +function(expect_fallback label executable expected_output) + execute_process( + COMMAND "${executable}" ${ARGN} + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error + ) + if (NOT result EQUAL 0) + message(FATAL_ERROR "${label} fallback failed (${result}):\n${output}${error}") + endif () + if (NOT output MATCHES "${expected_output}") + message(FATAL_ERROR "${label} fallback output was unexpected:\n${output}") + endif () +endfunction() + +function(expect_rejected label executable) + execute_process( + COMMAND "${executable}" "HELLO@WORLD" ${ARGN} + RESULT_VARIABLE result + OUTPUT_VARIABLE output + ERROR_VARIABLE error + ) + if (result EQUAL 0) + message(FATAL_ERROR "${label} accepted an unrepresentable message:\n${output}${error}") + endif () + if (NOT output MATCHES "Cannot encode message:[ ]+HELLO@WORLD") + message(FATAL_ERROR "${label} rejection output was unexpected:\n${output}${error}") + endif () +endfunction() + +expect_fallback("ft4code" "${FT4CODE}" + "THIS FREE TEX.*0\\.0[ ]+Free text" "THIS FREE TEXT IS TOO LONG") +expect_rejected("ft4code" "${FT4CODE}") + +expect_fallback("ft4sim" "${FT4SIM}" + "THIS FREE TEX.*i3.n3:[ ]+0\\.0" "THIS FREE TEXT IS TOO LONG" + 1500 0.0 0.0 0.0 0 99) +expect_rejected("ft4sim" "${FT4SIM}" 1500 0.0 0.0 0.0 0 99) + +execute_process( + COMMAND "${FST4SIM}" "THIS FREE TEXT IS TOO LONG" 60 1500 0.0 0.0 0.0 0 99 F + RESULT_VARIABLE fst4_result + OUTPUT_VARIABLE fst4_output + ERROR_VARIABLE fst4_error +) +if (NOT fst4_result EQUAL 0) + message(FATAL_ERROR "fst4sim fallback failed (${fst4_result}):\n${fst4_output}${fst4_error}") +endif () +if (NOT fst4_output MATCHES "THIS FREE TEX") + message(FATAL_ERROR "fst4sim did not report the canonical fallback message:\n${fst4_output}") +endif () +if (NOT fst4_output MATCHES "iwspr:[ ]+0") + message(FATAL_ERROR "fst4sim did not select FST4 for the fallback message:\n${fst4_output}") +endif () +expect_rejected("fst4sim" "${FST4SIM}" 60 1500 0.0 0.0 0.0 0 99 F) + +expect_fallback("ldpcsim240_101" "${LDPCSIM240_101}" + "Message sent:[ ]+THIS FREE TEX" 1 -1 0 1.0 101 + "THIS FREE TEXT IS TOO LONG") +execute_process( + COMMAND "${LDPCSIM240_101}" 1 -1 0 1.0 101 "HELLO@WORLD" + RESULT_VARIABLE ldpc_rejected_result + OUTPUT_VARIABLE ldpc_rejected_output + ERROR_VARIABLE ldpc_rejected_error +) +if (ldpc_rejected_result EQUAL 0) + message(FATAL_ERROR "ldpcsim240_101 accepted an unrepresentable message:\n${ldpc_rejected_output}${ldpc_rejected_error}") +endif () +if (NOT ldpc_rejected_output MATCHES "Cannot encode message:[ ]+HELLO@WORLD") + message(FATAL_ERROR "ldpcsim240_101 rejection output was unexpected:\n${ldpc_rejected_output}${ldpc_rejected_error}") +endif () + +expect_fallback("msk144code" "${MSK144CODE}" + "THIS FREE TEX.*0\\.0[ ]+Free text" "THIS FREE TEXT IS TOO LONG") +expect_rejected("msk144code" "${MSK144CODE}") diff --git a/tests/unit/packjt77/test_packjt77_concurrent_unpack.f90 b/tests/unit/packjt77/test_packjt77_concurrent_unpack.f90 new file mode 100644 index 00000000..5f72a4b6 --- /dev/null +++ b/tests/unit/packjt77/test_packjt77_concurrent_unpack.f90 @@ -0,0 +1,101 @@ +program test_packjt77_concurrent_unpack + + use omp_lib + use packjt77 + implicit none + + integer, parameter :: worker_count=4 + integer, parameter :: phase_count=5 + integer, parameter :: iteration_count=1000 + character(len=37) :: source_messages(worker_count,phase_count) + character(len=77) :: payloads(worker_count,phase_count) + character(len=37) :: expected_messages(worker_count,phase_count) + character(len=37) :: decoded + integer :: failures,i3,iteration,n3,observed_threads,phase,status,worker + logical :: ok + + failures=0 + observed_threads=0 + source_messages(1,1)='A92EE F5PSR -14' + source_messages(2,1)='WM3PEN EA6VQ -09' + source_messages(3,1)='W1FC F5BZB -08' + source_messages(4,1)='N1JFU EA6EE R-07' + source_messages(1,2)='K1ABC/P W9XYZ/P R FN42' + source_messages(2,2)='N0AAA/P N0BBB/P -10' + source_messages(3,2)='W3ABC/P K4XYZ/P RR73' + source_messages(4,2)='F1ABC/P G2XYZ/P 73' + source_messages(1,3)='K1ABC RR73; W9XYZ -12' + source_messages(2,3)='N0AAA RR73; N0BBB -14' + source_messages(3,3)='W3ABC RR73; K4XYZ -16' + source_messages(4,3)='F1ABC RR73; G2XYZ -18' + source_messages(1,4)='WA9XYZ KA1ABC R 16A EMA' + source_messages(2,4)='N0AAA N0BBB 1B CT' + source_messages(3,4)='W3ABC K4XYZ R 2C WMA' + source_messages(4,4)='F1ABC G2XYZ 3D DX' + source_messages(1,5)='TU; K1ABC W9XYZ R 529 MA' + source_messages(2,5)='TU; W9XYZ K1ABC R 559 CT' + source_messages(3,5)='TU; W9XYZ G8ABC R 559 0013' + source_messages(4,5)='W9XYZ VE3ABC 559 ON' + + do phase=1,phase_count + do worker=1,worker_count + call pack77(source_messages(worker,phase),i3,n3, & + payloads(worker,phase), & + pack77_options(record_tx_hashes=.false.),status) + if(status.ne.PACK77_STATUS_ENCODED) then + write(*,1000) phase,worker,status,trim(source_messages(worker,phase)) +1000 format('failed to encode phase ',i0,' worker ',i0,' status ',i0,': ',a) + error stop 1 + endif + call unpack77_configured(payloads(worker,phase),0, & + expected_messages(worker,phase),ok, & + unpack77_options(thread_index=worker,record_hashes=.false., & + record_recent_calls=.false.)) + if(.not.ok) then + write(*,1010) phase,worker,trim(source_messages(worker,phase)) +1010 format('failed expected decode for phase ',i0,' worker ',i0,': ',a) + error stop 1 + endif + enddo + enddo + + call omp_set_dynamic(.false.) + call omp_set_num_threads(worker_count) + +!$omp parallel default(none) & +!$omp shared(expected_messages,failures,observed_threads,payloads) & +!$omp private(decoded,iteration,ok,phase,worker) + worker=omp_get_thread_num()+1 +!$omp single + observed_threads=omp_get_num_threads() +!$omp end single + do phase=1,phase_count + do iteration=1,iteration_count +!$omp barrier + call unpack77_configured(payloads(worker,phase),0,decoded,ok, & + unpack77_options(thread_index=worker,record_hashes=.false., & + record_recent_calls=.false.)) + if(.not.ok .or. decoded.ne.expected_messages(worker,phase)) then +!$omp atomic update + failures=failures+1 + endif +!$omp barrier + enddo + enddo +!$omp end parallel + + if(observed_threads.ne.worker_count) then + write(*,1020) worker_count,observed_threads +1020 format('expected ',i0,' OpenMP workers, got ',i0) + error stop 1 + endif + if(failures.ne.0) then + write(*,1030) failures,worker_count*phase_count*iteration_count +1030 format('concurrent unpack mismatches: ',i0,' of ',i0) + error stop 1 + endif + + write(*,1040) worker_count*phase_count*iteration_count,worker_count +1040 format('concurrent unpack decodes passed: ',i0,' across ',i0,' threads') + +end program test_packjt77_concurrent_unpack diff --git a/tests/unit/packjt77/test_packjt77_domain_sweeps.f90 b/tests/unit/packjt77/test_packjt77_domain_sweeps.f90 new file mode 100644 index 00000000..eee14cc9 --- /dev/null +++ b/tests/unit/packjt77/test_packjt77_domain_sweeps.f90 @@ -0,0 +1,333 @@ +program test_packjt77_domain_sweeps + use packjt77_grammar + use packjt77_test_helpers, only: assert_true + implicit none + + integer, parameter :: GRID4_TOTAL=18*18*10*10 + integer, parameter :: GRID6_TOTAL=18*18*10*10*24*24 + integer, parameter :: GRID6_WSPR_TOTAL=18*18*10*10*25*25 + integer :: nchecked + + nchecked=0 + call sweep_arrl_sections() + call sweep_rtty_multipliers() + call sweep_rtty_reports() + call sweep_snr_reports() + call sweep_qso_tails() + call sweep_dxpedition_reports() + call sweep_wspr_dbm() + call sweep_field_day_exchanges() + call sweep_wspr_affixes() + call sweep_grid4() + call sweep_grid6_samples() + + print '(a,i0,a)', 'test_packjt77_domain_sweeps: ', nchecked, & + ' values enumerated' + +contains + + subroutine sweep_arrl_sections() + character(len=3) :: section + integer :: i + + call assert_true('ARRL invalid text', & + pack77_arrl_section_index('ZZZ').eq.-1) + do i=1,PACK77_NSEC + section=pack77_arrl_section_name(i) + call assert_true('ARRL inverse', pack77_arrl_section_index(section).eq.i) + if(section(1:1).ge.'A' .and. section(1:1).le.'Z') then + section(1:1)=achar(iachar(section(1:1))+32) + call assert_true('ARRL lowercase reject', & + pack77_arrl_section_index(section).eq.-1) + endif + nchecked=nchecked+1 + enddo + call assert_true('ARRL low index', pack77_arrl_section_name(0).eq.' ') + call assert_true('ARRL high index', & + pack77_arrl_section_name(PACK77_NSEC+1).eq.' ') + end subroutine sweep_arrl_sections + + subroutine sweep_rtty_multipliers() + character(len=3) :: multiplier + integer :: i + + call assert_true('RTTY multiplier invalid text', & + pack77_rtty_multiplier_index('ZZZ').eq.-1) + do i=1,PACK77_NUSCAN + multiplier=pack77_rtty_multiplier_name(i) + call assert_true('RTTY multiplier inverse', & + pack77_rtty_multiplier_index(multiplier).eq.i) + if(multiplier(1:1).ge.'A' .and. multiplier(1:1).le.'Z') then + multiplier(1:1)=achar(iachar(multiplier(1:1))+32) + call assert_true('RTTY multiplier lowercase reject', & + pack77_rtty_multiplier_index(multiplier).eq.-1) + endif + nchecked=nchecked+1 + enddo + call assert_true('RTTY multiplier low index', & + pack77_rtty_multiplier_name(0).eq.' ') + call assert_true('RTTY multiplier high index', & + pack77_rtty_multiplier_name(PACK77_NUSCAN+1).eq.' ') + end subroutine sweep_rtty_multipliers + + subroutine sweep_rtty_reports() + character(len=3) :: report + integer :: i + + do i=0,7 + report=pack77_format_rtty_report(i) + call assert_true('RTTY report inverse', & + pack77_rtty_report_index(report).eq.i) + nchecked=nchecked+1 + enddo + call assert_true('RTTY report low reject', & + pack77_rtty_report_index('519').eq.-1) + call assert_true('RTTY report high reject', & + pack77_rtty_report_index('609').eq.-1) + call assert_true('RTTY report wrong length reject', & + pack77_rtty_report_index('5799').eq.-1) + end subroutine sweep_rtty_reports + + subroutine sweep_snr_reports() + character(len=3) :: report + integer :: isnr,irpt + + do isnr=-50,50 + irpt=pack77_report_index_from_snr(isnr) + call assert_true('SNR report accepts legal value', irpt.ge.0) + call assert_true('SNR report inverse', & + pack77_snr_from_report_index(irpt).eq.isnr) + report=pack77_format_snr_report(isnr) + call assert_true('SNR report format width', len_trim(report).eq.3) + nchecked=nchecked+1 + enddo + do isnr=-75,-51 + call assert_true('SNR report low reject', & + pack77_report_index_from_snr(isnr).eq.-1) + enddo + do isnr=51,75 + call assert_true('SNR report high reject', & + pack77_report_index_from_snr(isnr).eq.-1) + enddo + end subroutine sweep_snr_reports + + subroutine sweep_qso_tails() + character(len=4), parameter :: tails(3)=(/'RRR ','RR73','73 '/) + integer :: i,irpt,nrpt + + do i=1,3 + call assert_true('QSO tail index', pack77_qso_tail_index(tails(i)).eq.i) + irpt=pack77_type12_irpt_from_tail(i) + call assert_true('Type 1/2 tail inverse', & + pack77_tail_from_type12_irpt(irpt).eq.i) + nrpt=pack77_type4_nrpt_from_tail(i) + call assert_true('Type 4 tail inverse', & + pack77_tail_from_type4_nrpt(nrpt).eq.i) + nchecked=nchecked+1 + enddo + call assert_true('QSO tail near miss', pack77_qso_tail_index('RR').eq.0) + call assert_true('Type 1/2 tail low', pack77_tail_from_type12_irpt(1).eq.0) + call assert_true('Type 4 tail high', pack77_tail_from_type4_nrpt(4).eq.0) + end subroutine sweep_qso_tails + + subroutine sweep_dxpedition_reports() + character(len=3) :: report + integer :: isnr,n5 + logical :: ok + + do isnr=-31,33 + call format_signed_report(isnr,report) + call pack77_parse_dxpedition_report(report,n5,ok) + if(isnr.ge.-30 .and. isnr.le.32 .and. mod(isnr,2).eq.0) then + call assert_true('DXpedition report accepts legal value', ok) + call assert_true('DXpedition report inverse', 2*n5-30.eq.isnr) + nchecked=nchecked+1 + else + call assert_true('DXpedition report rejects illegal value', .not.ok) + endif + enddo + end subroutine sweep_dxpedition_reports + + subroutine sweep_wspr_dbm() + character(len=3) :: token + integer :: dbm,idbm,decoded + logical :: ok + + do dbm=-5,65 + write(token,'(i0)') dbm + call pack77_parse_wspr_dbm(token,idbm,ok) + if(ok) then + decoded=nint(idbm*10.0/3.0) + call assert_true('WSPR dBm inverse', decoded.eq.dbm) + nchecked=nchecked+1 + else if(dbm.ge.0 .and. dbm.le.60) then + call assert_true('WSPR dBm legal codebook only', & + nint(nint(0.3*dbm)*10.0/3.0).ne.dbm) + endif + enddo + call pack77_parse_wspr_dbm('03',idbm,ok) + call assert_true('WSPR dBm leading zero reject', .not.ok) + end subroutine sweep_wspr_dbm + + subroutine sweep_field_day_exchanges() + character(len=4) :: token + integer :: ntx,nclass,parsed_ntx,parsed_class + logical :: ok + + do ntx=1,32 + do nclass=0,5 + write(token,'(i0,a1)') ntx, achar(iachar('A')+nclass) + call pack77_parse_field_day_exchange(token,parsed_ntx,parsed_class,ok) + call assert_true('Field Day exchange accepts legal value', ok) + call assert_true('Field Day exchange inverse', & + parsed_ntx.eq.ntx .and. parsed_class.eq.nclass) + nchecked=nchecked+1 + enddo + enddo + call pack77_parse_field_day_exchange('0A',parsed_ntx,parsed_class,ok) + call assert_true('Field Day ntx low reject', .not.ok) + call pack77_parse_field_day_exchange('33A',parsed_ntx,parsed_class,ok) + call assert_true('Field Day ntx high reject', .not.ok) + call pack77_parse_field_day_exchange('1G',parsed_ntx,parsed_class,ok) + call assert_true('Field Day class reject', .not.ok) + call pack77_parse_field_day_exchange('01A',parsed_ntx,parsed_class,ok) + call assert_true('Field Day leading zero reject', .not.ok) + end subroutine sweep_field_day_exchanges + + subroutine sweep_wspr_affixes() + character(len=13) :: token + character(len=3) :: affix,affix_text + integer :: i,npfx,slash_index + logical :: is_prefix,ok + + do i=0,PACK77_WSPR_NZZZ+12959 + call pack77_wspr_affix_text(i,affix,is_prefix,ok) + call assert_true('WSPR affix index renders', ok) + affix_text=adjustl(affix) + if(is_prefix) then + token=trim(affix_text)//'/K1ABC' + slash_index=len_trim(affix_text)+1 + else + token='K1ABC/'//trim(affix_text) + slash_index=6 + endif + npfx=pack77_wspr_affix_index(token,slash_index,len_trim(token),ok) + call assert_true('WSPR affix index inverse', ok .and. npfx.eq.i) + call require_wspr_source(token//' 37', i) + nchecked=nchecked+1 + enddo + + token='ABCD/K1ABC' + npfx=pack77_wspr_affix_index(token,5,len_trim(token),ok) + call assert_true('WSPR four-character prefix reject', .not.ok) + token='K1ABC/ABA' + npfx=pack77_wspr_affix_index(token,6,len_trim(token),ok) + call assert_true('WSPR suffix non-digit third reject', .not.ok) + call require_wspr_source_reject('00/K1ABC 37') + call require_wspr_source_reject('K1ABC/00 37') + end subroutine sweep_wspr_affixes + + subroutine require_wspr_source(msg,want_npfx) + character(len=*), intent(in) :: msg + integer, intent(in) :: want_npfx + type(pack77_wspr_source) :: source + logical :: ok,matched_shape + + call pack77_parse_wspr_source(msg,source,ok,matched_shape) + call assert_true('WSPR source affix parse', & + ok .and. source%npfx.eq.want_npfx) + end subroutine require_wspr_source + + subroutine require_wspr_source_reject(msg) + character(len=*), intent(in) :: msg + type(pack77_wspr_source) :: source + logical :: ok,matched_shape + + call pack77_parse_wspr_source(msg,source,ok,matched_shape) + call assert_true('WSPR source alias reject '//trim(msg), .not.ok) + end subroutine require_wspr_source_reject + + subroutine sweep_grid4() + character(len=4) :: grid4 + integer :: i,narg + logical :: ok + + do i=0,GRID4_TOTAL-1 + narg=i + call to_grid4(narg,grid4,ok) + call assert_true('Grid4 renders', ok) + call assert_true('Grid4 validates', pack77_is_grid4(grid4)) + call assert_true('Grid4 inverse', pack77_grid4_index(grid4).eq.i) + nchecked=nchecked+1 + enddo + narg=-1 + call to_grid4(narg,grid4,ok) + call assert_true('Grid4 low index reject', .not.ok) + narg=GRID4_TOTAL + call to_grid4(narg,grid4,ok) + call assert_true('Grid4 high index reject', .not.ok) + call assert_true('Grid4 short reject', .not.pack77_is_grid4('AA0')) + call assert_true('Grid4 lowercase reject', .not.pack77_is_grid4('aa00')) + end subroutine sweep_grid4 + + subroutine sweep_grid6_samples() + integer, parameter :: NSAMPLE=10000 + integer(kind=8) :: state + integer :: i,n + + call check_grid6_index(0) + call check_grid6_index(GRID6_TOTAL-1) + call check_grid6_index(18*10*10*24*24-1) + call check_grid6_index(18*10*10*24*24) + call check_wspr_grid_index(0) + call check_wspr_grid_index(GRID6_WSPR_TOTAL-1) + call check_wspr_grid_index(18*10*10*25*25-1) + call check_wspr_grid_index(18*10*10*25*25) + + state=123456789_8 + do i=1,NSAMPLE + state=mod(1103515245_8*state+12345_8,2147483648_8) + n=int(mod(state,int(GRID6_TOTAL,kind=8))) + call check_grid6_index(n) + state=mod(1103515245_8*state+12345_8,2147483648_8) + n=int(mod(state,int(GRID6_WSPR_TOTAL,kind=8))) + call check_wspr_grid_index(n) + enddo + end subroutine sweep_grid6_samples + + subroutine check_grid6_index(n) + integer, intent(in) :: n + character(len=6) :: grid6 + integer :: narg + logical :: ok + + narg=n + call to_grid6(narg,grid6,ok) + call assert_true('Grid6 renders', ok) + call assert_true('Grid6 validates', pack77_is_grid6(grid6,.false.)) + call assert_true('Grid6 inverse', pack77_grid6_index(grid6).eq.n) + nchecked=nchecked+1 + end subroutine check_grid6_index + + subroutine check_wspr_grid_index(n) + integer, intent(in) :: n + character(len=6) :: grid6 + integer :: narg + logical :: ok + + narg=n + call to_grid(narg,grid6,ok) + call assert_true('WSPR Grid6 renders', ok) + call assert_true('WSPR Grid6 inverse', pack77_grid6_wspr_index(grid6).eq.n) + nchecked=nchecked+1 + end subroutine check_wspr_grid_index + + subroutine format_signed_report(value,token) + integer, intent(in) :: value + character(len=3), intent(out) :: token + + write(token,'(sp,i3.2)') value + if(value.ge.0 .and. token(1:1).eq.' ') token(1:1)='+' + end subroutine format_signed_report + +end program test_packjt77_domain_sweeps diff --git a/tests/unit/packjt77/test_packjt77_grammar_gate.f90 b/tests/unit/packjt77/test_packjt77_grammar_gate.f90 new file mode 100644 index 00000000..2698baa1 --- /dev/null +++ b/tests/unit/packjt77/test_packjt77_grammar_gate.f90 @@ -0,0 +1,73 @@ +program test_packjt77_grammar_gate + + use packjt77_grammar, only: pack77_gate_messages_match + implicit none + + integer :: ntests + character(len=13) :: no_calls(1), staged_calls(2) + + ntests=0 + no_calls='' + staged_calls='' + staged_calls(1)='PJ4/K1ABC' + staged_calls(2)='W3CCX' + + call expect_match('equal messages', & + ' k1abc w9xyz fn42', 'K1ABC W9XYZ FN42', no_calls, 0) + call expect_match('auto-hash canonicalization', & + 'W1AW/P K1ABC 5A CT', ' K1ABC 5A CT', no_calls, 0) + call expect_match('staged placeholder', & + ' W9XYZ RR73', '<...> W9XYZ RR73', staged_calls, 2) + + call expect_no_match('unstaged placeholder', & + ' W9XYZ RR73', '<...> W9XYZ RR73', no_calls, 0) + call expect_no_match('CQ bracketed C11 mismatch', & + 'CQ ', 'CQ PJ4/K1ABC', no_calls, 0) + call expect_no_match('wrong bracket body', & + ' W9XYZ RR73', ' W9XYZ RR73', no_calls, 0) + call expect_no_match('different token count', & + 'K1ABC W9XYZ FN42', 'K1ABC W9XYZ', no_calls, 0) + call expect_no_match('changed first call', & + 'K1ABC W9XYZ FN42', 'N1ABC W9XYZ FN42', no_calls, 0) + call expect_no_match('changed second call', & + 'K1ABC W9XYZ FN42', 'K1ABC W9XYA FN42', no_calls, 0) + call expect_no_match('changed report', & + 'K1ABC W9XYZ -12', 'K1ABC W9XYZ -13', no_calls, 0) + call expect_no_match('changed grid', & + 'K1ABC W9XYZ FN42', 'K1ABC W9XYZ FN43', no_calls, 0) + call expect_no_match('changed serial', & + 'K1ABC FN42 37', 'K1ABC FN42 38', no_calls, 0) + + write(*,1000) ntests +1000 format('packjt77 grammar gate tests passed: ',i0) + +contains + + subroutine expect_match(label,input_msg,decoded_msg,staged_calls,nstaged) + character(len=*), intent(in) :: label,input_msg,decoded_msg + character(len=13), intent(in) :: staged_calls(:) + integer, intent(in) :: nstaged + + if(.not.pack77_gate_messages_match(input_msg,decoded_msg,staged_calls, & + nstaged)) then + write(*,1010) trim(label), trim(input_msg), trim(decoded_msg) +1010 format(a,' expected match for input "',a,'" decoded "',a,'"') + error stop 1 + endif + ntests=ntests+1 + end subroutine expect_match + + subroutine expect_no_match(label,input_msg,decoded_msg,staged_calls,nstaged) + character(len=*), intent(in) :: label,input_msg,decoded_msg + character(len=13), intent(in) :: staged_calls(:) + integer, intent(in) :: nstaged + + if(pack77_gate_messages_match(input_msg,decoded_msg,staged_calls,nstaged)) then + write(*,1020) trim(label), trim(input_msg), trim(decoded_msg) +1020 format(a,' expected mismatch for input "',a,'" decoded "',a,'"') + error stop 1 + endif + ntests=ntests+1 + end subroutine expect_no_match + +end program test_packjt77_grammar_gate diff --git a/tests/unit/packjt77/test_packjt77_hash_state.f90 b/tests/unit/packjt77/test_packjt77_hash_state.f90 new file mode 100644 index 00000000..b122ba46 --- /dev/null +++ b/tests/unit/packjt77/test_packjt77_hash_state.f90 @@ -0,0 +1,1293 @@ +program test_packjt77_hash_state + + use packjt77 + use packjt77_test_helpers + use ft8_mod1, only : mycall, hiscall, lhound, mybcall, hisbcall, hisgrid4 + implicit none + + integer :: ntests + external :: fillhashvar + external :: ft8apsetvar + external :: genft8 + + ntests=0 + + call expect_standard_hash_save_contract() + call expect_var_hash_save_contract() + call expect_var_hash_save_thread_bounds() + call expect_var_thread_queue_capacity() + call expect_var_thread_rx_accumulation() + call expect_type4_literal_call_staged_until_fill() + call expect_configured_type12_addressee_staged_until_fill() + call expect_legacy_type12_addressee_not_hashed() + call expect_service_unpack_does_not_consume_dx_edge() + call expect_configured_call_clear_blanks_stale_state() + call expect_dxpedition_dxcall_reentry_substitution() + call expect_shared_hash_tables_survive_mode_sync() + call expect_default_pack77_tx_hash_recording() + call expect_pack77_record_tx_hashes_option_suppresses_commit() + call expect_pack77_encode_rejects_dx_macro_by_default() + call expect_pack77_free_text_fallback_rejects_unexpanded_dx_macro() + call expect_pack_unpack_hash_state_matches_pack_only() + call expect_genft8_failure_state() + call expect_dx_macro_option_uses_explicit_base() + call expect_failed_pack77_candidates_do_not_record_hashes() + call expect_ft8apsetvar_does_not_record_template_hashes() + call expect_var_tx_rx_separation() + call expect_mycall_dxcall_substitutions() + call expect_invalid_standard_call_decode_failure() + + call expect_hash_resolution_case( & + 'K1ABC RR73; W9XYZ -12', 0, 1, & + 'K1ABC RR73; W9XYZ <...> -12', & + 'K1ABC RR73; W9XYZ -12', & + 10, 'KH1/KH7Z', 0, '', 0, '') + call expect_hash_resolution_case( & + ' W9XYZ RR73', 1, 0, & + '<...> W9XYZ RR73', & + ' W9XYZ RR73', & + 22, 'PJ4/K1ABC', 0, '', 0, '') + call expect_hash_resolution_case( & + 'PJ2/W1AW RR73', 4, 0, & + 'PJ2/W1AW <...> RR73', & + 'PJ2/W1AW RR73', & + 12, 'W7ABC', 0, '', 0, '') + call expect_hash_resolution_case( & + ' 590001 FN20QI', 5, 0, & + '<...> <...> 590001 FN20QI', & + ' 590001 FN20QI', & + 12, 'W3CCX', 22, 'K1JT/P', 0, '') + + write(*,1000) ntests +1000 format('packjt77 hash-state tests passed: ',i0) + +contains + + subroutine expect_standard_hash_save_contract() + character(len=13) :: c13 + integer :: n10, n12, n22 + + call clear_all_state('N0AAA','N0BBB') + + c13=' ' + c13='' + call save_hash_call(c13,n10,n12,n22) + call assert_int('standard n10',346,n10) + call assert_int('standard n12',1387,n12) + call assert_int('standard n22',1420834,n22) + call assert_call('standard calls10',calls10(n10),'PJ4/K1ABC') + call assert_call('standard calls12',calls12(n12),'PJ4/K1ABC') + call assert_int('standard nzhash',1,nzhash) + call assert_int('standard ihash22(1)',n22,ihash22(1)) + call assert_call('standard calls22(1)',calls22(1),'PJ4/K1ABC') + + call save_hash_call(c13,n10,n12,n22) + call assert_int('standard duplicate nzhash',1,nzhash) + call assert_call('standard duplicate calls22(1)',calls22(1),'PJ4/K1ABC') + + call clear_all_state('K1ABC','N0BBB') + c13=' ' + c13='K1ABC' + call save_hash_call(c13,n10,n12,n22) + call assert_call('standard mycall calls10 excluded',calls10(n10),'') + call assert_call('standard mycall calls12 excluded',calls12(n12),'') + call assert_call('standard mycall calls22 retained',calls22(1),'K1ABC') + + call clear_all_state('N0AAA','N0BBB') + n10=-99 + n12=-99 + n22=-99 + c13=' ' + c13='<...>' + call save_hash_call(c13,n10,n12,n22) + call assert_int('standard placeholder ignored nzhash',0,nzhash) + call assert_int('standard placeholder ignored n10',-99,n10) + + c13=' ' + c13='K1' + call save_hash_call(c13,n10,n12,n22) + call assert_int('standard short call ignored nzhash',0,nzhash) + + ntests=ntests+1 + end subroutine expect_standard_hash_save_contract + + subroutine expect_var_hash_save_contract() + character(len=13) :: c13 + integer :: n10, n12, n22 + integer :: slot + + call clear_all_state('N0AAA','N0BBB') + + c13=' ' + c13='' + call save_hash_call(c13,n10,n12,n22) + call assert_int('var rx n10',346,n10) + call assert_int('var rx n12',1387,n12) + call assert_int('var rx n22',1420834,n22) + call assert_call('var rx calls10',calls10(n10),'PJ4/K1ABC') + call assert_call('var rx calls12',calls12(n12),'PJ4/K1ABC') + call assert_int('var rx nzhash',1,nzhash) + call assert_int('var rx ihash22(1)',n22,ihash22(1)) + call assert_call('var rx calls22(1)',calls22(1),'PJ4/K1ABC') + + call clear_all_state('N0AAA','N0BBB') + c13=' ' + c13='' + n10=ihashcall('PJ4/K1ABC ',10) + n12=ihashcall('PJ4/K1ABC ',12) + n22=ihashcall('PJ4/K1ABC ',22) + call assert_int('var tx disabled count',0,nzhash) + call assert_call('var tx disabled calls12',calls12(1387),'') + + call save_hash_call(c13,n10,n12,n22) + call assert_int('var tx n10',346,n10) + call assert_int('var tx n12',1387,n12) + call assert_int('var tx n22',1420834,n22) + call assert_call('var tx calls10',calls10(n10),'PJ4/K1ABC') + call assert_call('var tx calls12',calls12(n12),'PJ4/K1ABC') + call assert_int('var tx nzhash',1,nzhash) + call assert_int('var tx ihash22(1)',n22,ihash22(1)) + call assert_call('var tx calls22(1)',calls22(1),'PJ4/K1ABC') + + call clear_all_state('N0AAA','N0BBB') + c13=' ' + c13='' + call queue_hash_call_for_thread(c13,3) + slot=thread_call_index(3)+1 + call assert_int('var thread 3 count',1,nqueued_calls_by_thread(3)) + call assert_int('var thread 2 count',0,nqueued_calls_by_thread(2)) + call assert_int('var thread 4 count',0,nqueued_calls_by_thread(4)) + call assert_call('var thread 3 call',queued_calls_by_thread(slot),'W7ABC') + call assert_call('var thread call not folded',calls12(ihashcall('W7ABC ',12)),'') + + ntests=ntests+1 + end subroutine expect_var_hash_save_contract + + subroutine expect_var_hash_save_thread_bounds() + character(len=13) :: c13 + + call clear_all_state('N0AAA','N0BBB') + call normalize_call('W7ABC',c13) + + call queue_hash_call_for_thread(c13,0) + call queue_hash_call_for_thread(c13,-1) + call queue_hash_call_for_thread(c13,25) + + call assert_true('var invalid thread indices ignored', & + all(nqueued_calls_by_thread(1:24).eq.0)) + call assert_call('var first queued call untouched',queued_calls_by_thread(1),'') + + ntests=ntests+1 + end subroutine expect_var_hash_save_thread_bounds + + subroutine expect_var_thread_queue_capacity() + character(len=13) :: c13, last_call, overflow_call + integer :: capacity, i, nthr + + call clear_all_state('N0AAA','N0BBB') + + nthr=24 + capacity=thread_call_index(nthr+1)-thread_call_index(nthr) + do i=1,capacity + c13=' ' + write(c13,'("K0",i2.2)') i + call queue_hash_call_for_thread(c13,nthr) + enddo + + overflow_call=' ' + write(overflow_call,'("K0",i2.2)') 99 + call queue_hash_call_for_thread(overflow_call,nthr) + + last_call=' ' + write(last_call,'("K0",i2.2)') capacity + call assert_int('var thread capacity count',capacity, & + nqueued_calls_by_thread(nthr)) + call assert_call('var thread capacity last call', & + queued_calls_by_thread(thread_call_index(nthr)+capacity),last_call) + call assert_true('var thread capacity overflow dropped', & + .not.any(queued_calls_by_thread.eq.overflow_call)) + call assert_int('var thread capacity nzhash before fold',0,nzhash) + + call fillhashvar(nthr,.true.) + + call assert_int('var thread capacity nzhash after fold',capacity,nzhash) + call assert_true('var thread capacity last hash after fold', & + shared_hash22_contains(last_call)) + call assert_true('var thread capacity overflow absent after fold', & + .not.shared_hash22_contains(overflow_call)) + + ntests=ntests+1 + end subroutine expect_var_thread_queue_capacity + + subroutine expect_var_thread_rx_accumulation() + character(len=13) :: rx_call, later_thread_call + integer :: n10, n12, n22 + integer :: later_n10, later_n12 + + call clear_all_state('N0AAA','N0BBB') + + call normalize_call('W7ABC',rx_call) + call normalize_call('K9XYZ',later_thread_call) + + ! queue_hash_call_for_thread queues RX hashes per thread until fillhashvar folds them. + call queue_hash_call_for_thread(rx_call,3) + call queue_hash_call_for_thread(later_thread_call,7) + + n10=ihashcall(rx_call,10) + n12=ihashcall(rx_call,12) + n22=ihashcall(rx_call,22) + later_n10=ihashcall(later_thread_call,10) + later_n12=ihashcall(later_thread_call,12) + + call assert_int('var thread 3 count before fold',1,nqueued_calls_by_thread(3)) + call assert_int('var thread 7 count before fold',1,nqueued_calls_by_thread(7)) + call assert_int('var thread 2 count before fold',0,nqueued_calls_by_thread(2)) + call assert_int('var thread 4 count before fold',0,nqueued_calls_by_thread(4)) + call assert_call('var thread 3 first call',queued_calls_by_thread(thread_call_index(3)+1), & + 'W7ABC') + call assert_call('var thread 7 first call',queued_calls_by_thread(thread_call_index(7)+1), & + 'K9XYZ') + call assert_call('var thread 2 first slot untouched', & + queued_calls_by_thread(thread_call_index(2)+1),'') + call assert_call('var thread 4 first slot untouched', & + queued_calls_by_thread(thread_call_index(4)+1),'') + call assert_call('var rx calls10 before fold',calls10(n10),'') + call assert_call('var rx calls12 before fold',calls12(n12),'') + call assert_int('var rx nzhash before fold',0,nzhash) + + call fillhashvar(3,.true.) + + call assert_call('var rx calls10 after fold',calls10(n10),'W7ABC') + call assert_call('var rx calls12 after fold',calls12(n12),'W7ABC') + call assert_int('var rx nzhash after fold',1,nzhash) + call assert_int('var rx ihash22 after fold',n22,ihash22(1)) + call assert_call('var rx calls22 after fold',calls22(1),'W7ABC') + call assert_call('var later thread not folded calls10',calls10(later_n10),'') + call assert_call('var later thread not folded calls12',calls12(later_n12),'') + call assert_int('var thread 3 count after fold',1,nqueued_calls_by_thread(3)) + call assert_int('var thread 7 count after fold',1,nqueued_calls_by_thread(7)) + call assert_call('var thread 7 call retained after fold', & + queued_calls_by_thread(thread_call_index(7)+1),'K9XYZ') + + ntests=ntests+1 + end subroutine expect_var_thread_rx_accumulation + + subroutine expect_type4_literal_call_staged_until_fill() + character(len=77) :: c77 + character(len=37) :: decoded + character(len=13) :: literal_call + integer :: n10, n12 + logical :: ok + + call pack_and_assert_type('PJ2/W1AW RR73',4,0,c77) + call clear_all_state('N0AAA','N0BBB') + call normalize_call('PJ2/W1AW',literal_call) + n10=ihashcall(literal_call,10) + n12=ihashcall(literal_call,12) + + call unpack_var_current_state_thread(c77,1,3,decoded,ok) + + call assert_decode('type 4 staged literal decode', & + 'PJ2/W1AW RR73','PJ2/W1AW <...> RR73',decoded,ok) + call assert_int('type 4 thread 3 queued count',1,nqueued_calls_by_thread(3)) + call assert_call('type 4 thread 3 queued call', & + queued_calls_by_thread(thread_call_index(3)+1),'PJ2/W1AW') + call assert_int('type 4 thread 3 queued recent count',1, & + nqueued_recent_calls_by_thread(3)) + call assert_call('type 4 thread 3 queued recent call', & + queued_recent_calls_by_thread(thread_call_index(3)+1),'PJ2/W1AW') + call assert_call('type 4 calls10 before fill',calls10(n10),'') + call assert_call('type 4 calls12 before fill',calls12(n12),'') + call assert_call('type 4 recent before fill',recent_calls(1),'') + + call fillhashvar(3,.true.) + + call assert_call('type 4 calls10 after fill',calls10(n10),'PJ2/W1AW') + call assert_call('type 4 calls12 after fill',calls12(n12),'PJ2/W1AW') + call assert_true('type 4 calls22 after fill',shared_hash22_contains(literal_call)) + call assert_call('type 4 recent after fill',recent_calls(1),'PJ2/W1AW') + + ntests=ntests+1 + end subroutine expect_type4_literal_call_staged_until_fill + + subroutine expect_configured_type12_addressee_staged_until_fill() + character(len=77) :: c77 + character(len=37) :: decoded + character(len=13) :: call1, call2 + logical :: ok + + call pack_and_assert_type('W9XYZ K1ABC FN42',1,0,c77) + call clear_all_state('N0AAA','N0BBB') + call normalize_call('W9XYZ',call1) + call normalize_call('K1ABC',call2) + + call unpack_var_current_state_thread(c77,1,3,decoded,ok) + + call assert_decode('type 1 staged addressee decode', & + 'W9XYZ K1ABC FN42','W9XYZ K1ABC FN42',decoded,ok) + call assert_int('type 1 thread 3 queued hash count',2, & + nqueued_calls_by_thread(3)) + call assert_call('type 1 thread 3 queued first call', & + queued_calls_by_thread(thread_call_index(3)+1),'W9XYZ') + call assert_call('type 1 thread 3 queued second call', & + queued_calls_by_thread(thread_call_index(3)+2),'K1ABC') + call assert_true('type 1 addressee hash absent before fill', & + .not.shared_hash22_contains(call1)) + + call fillhashvar(3,.true.) + + call assert_true('type 1 addressee hash after fill', & + shared_hash22_contains(call1)) + call assert_true('type 1 second call hash after fill', & + shared_hash22_contains(call2)) + + ntests=ntests+1 + end subroutine expect_configured_type12_addressee_staged_until_fill + + subroutine expect_legacy_type12_addressee_not_hashed() + character(len=77) :: c77 + character(len=37) :: decoded + character(len=13) :: call1, call2 + integer :: n10a, n12a, n10b, n12b + logical :: ok + + call pack_and_assert_type('W9XYZ K1ABC FN42',1,0,c77) + call clear_all_state('N0AAA','N0BBB') + call normalize_call('W9XYZ',call1) + call normalize_call('K1ABC',call2) + n10a=ihashcall(call1,10) + n12a=ihashcall(call1,12) + n10b=ihashcall(call2,10) + n12b=ihashcall(call2,12) + + call unpack_standard_current_state(c77,1,decoded,ok) + + call assert_decode('legacy type 1 addressee decode', & + 'W9XYZ K1ABC FN42','W9XYZ K1ABC FN42',decoded,ok) + call assert_call('legacy type 1 recent sender',recent_calls(1),'K1ABC') + call assert_call('legacy type 1 recent addressee',recent_calls(2),'W9XYZ') + call assert_call('legacy type 1 addressee calls10',calls10(n10a),'') + call assert_call('legacy type 1 addressee calls12',calls12(n12a),'') + call assert_true('legacy type 1 addressee hash22 absent', & + .not.shared_hash22_contains(call1)) + call assert_call('legacy type 1 sender calls10',calls10(n10b),'K1ABC') + call assert_call('legacy type 1 sender calls12',calls12(n12b),'K1ABC') + call assert_true('legacy type 1 sender hash22 present', & + shared_hash22_contains(call2)) + + ntests=ntests+1 + end subroutine expect_legacy_type12_addressee_not_hashed + + subroutine expect_service_unpack_does_not_consume_dx_edge() + character(len=77) :: c77 + character(len=37) :: decoded + logical :: ok + + call pack_and_assert_type('K1ABC W9XYZ RR73',1,0,c77) + call clear_all_state('N0AAA','') + + mycall='N0AAA' + hiscall='KH1/KH7Z' + dxcall13='KH1/KH7Z ' + dxcall13_configured_prev=' ' + dxcall13_configured=' ' + dxcall13_configured_set=.false. + hashdx10_configured=-1 + + decoded=' ' + ok=.false. + call unpack77_configured(c77,1,decoded,ok, & + unpack77_options(record_hashes=.false.,record_recent_calls=.false.)) + + call assert_true('service unpack leaves recent queue empty', & + all(nqueued_recent_calls_by_thread(1:24).eq.0)) + call assert_call('service unpack leaves recent calls empty',recent_calls(1),'') + + call fillhashvar(1,.false.) + + call assert_int('service unpack leaves dx edge queued count',1, & + nqueued_calls_by_thread(1)) + call assert_call('service unpack leaves dx edge queued call', & + queued_calls_by_thread(thread_call_index(1)+1),'KH1/KH7Z') + call assert_true('service unpack dx configured set',dxcall13_configured_set) + call assert_call('service unpack dx configured',dxcall13_configured,'KH1/KH7Z') + call assert_call('service unpack dx configured prev',dxcall13_configured_prev, & + 'KH1/KH7Z') + call assert_int('service unpack dx configured hash', & + ihashcall(dxcall13_configured,10),hashdx10_configured) + + ntests=ntests+1 + end subroutine expect_service_unpack_does_not_consume_dx_edge + + subroutine expect_configured_call_clear_blanks_stale_state() + integer :: old_hash + + call clear_all_state('N0AAA','KH1/KH7Z') + mycall='N0AAA' + hiscall='KH1/KH7Z' + call fillhashvar(1,.false.) + + call assert_true('configured clear seeded dx',dxcall13_configured_set) + call assert_call('configured clear seeded dx call',dxcall13_configured, & + 'KH1/KH7Z') + old_hash=hashdx10_configured + + hiscall='' + call fillhashvar(1,.false.) + + call assert_true('configured clear dx flag',.not.dxcall13_configured_set) + call assert_call('configured clear dx configured blank',dxcall13_configured,'') + call assert_call('configured clear dx previous blank',dxcall13_configured_prev,'') + call assert_int('configured clear dx hash reset',-1,hashdx10_configured) + call assert_int('configured clear dx queue count',0,nqueued_calls_by_thread(1)) + call assert_true('configured clear changed dx hash',hashdx10_configured.ne.old_hash) + + call clear_all_state('KH1/KH7Z','N0BBB') + mycall='KH1/KH7Z' + hiscall='N0BBB' + call fillhashvar(1,.false.) + + call assert_true('configured clear seeded mycall',mycall13_configured_set) + call assert_call('configured clear seeded mycall value',mycall13_configured, & + 'KH1/KH7Z') + + mycall='' + call fillhashvar(1,.false.) + + call assert_true('configured clear mycall flag',.not.mycall13_configured_set) + call assert_call('configured clear mycall configured blank', & + mycall13_configured,'') + call assert_call('configured clear mycall previous blank', & + mycall13_configured_prev,'') + call assert_int('configured clear mycall hash10 reset',-1,hashmy10_configured) + call assert_int('configured clear mycall hash12 reset',-1,hashmy12_configured) + call assert_int('configured clear mycall hash22 reset',-1,hashmy22_configured) + + ntests=ntests+1 + end subroutine expect_configured_call_clear_blanks_stale_state + + subroutine expect_dxpedition_dxcall_reentry_substitution() + character(len=77) :: c77 + character(len=37) :: decoded + logical :: ok + + call pack_and_assert_type('K1ABC RR73; W9XYZ -12',0,1,c77) + call clear_all_state('N0AAA','') + + mycall='N0AAA' + hiscall='KH1/KH7Z' + call fillhashvar(1,.false.) + call unpack_var_current_state(c77,1,decoded,ok) + call assert_decode('DXpedition dx configured first entry', & + 'K1ABC RR73; W9XYZ -12', & + 'K1ABC RR73; W9XYZ -12',decoded,ok) + + hiscall='' + call fillhashvar(1,.false.) + call assert_true('DXpedition dx cleared',.not.dxcall13_configured_set) + + hiscall='KH1/KH7Z' + call fillhashvar(1,.false.) + call unpack_var_current_state(c77,1,decoded,ok) + call assert_decode('DXpedition dx configured re-entry', & + 'K1ABC RR73; W9XYZ -12', & + 'K1ABC RR73; W9XYZ -12',decoded,ok) + + ntests=ntests+1 + end subroutine expect_dxpedition_dxcall_reentry_substitution + + subroutine expect_shared_hash_tables_survive_mode_sync() + character(len=13) :: c13 + integer :: n10, n12, n22 + + call clear_all_state('N0AAA','KH1/KH7Z') + + call normalize_call('PJ4/K1ABC',c13) + call save_hash_call(c13,n10,n12,n22) + call assert_call('persistent hash calls10 seeded',calls10(n10),'PJ4/K1ABC') + call assert_true('persistent hash calls22 seeded',shared_hash22_contains(c13)) + + mycall='W1AW' + hiscall='W9XYZ' + call fillhashvar(1,.false.) + + call assert_call('persistent hash calls10 after mode sync', & + calls10(n10),'PJ4/K1ABC') + call assert_call('persistent hash calls12 after mode sync', & + calls12(n12),'PJ4/K1ABC') + call assert_true('persistent hash calls22 after mode sync', & + shared_hash22_contains(c13)) + + ntests=ntests+1 + end subroutine expect_shared_hash_tables_survive_mode_sync + + subroutine expect_default_pack77_tx_hash_recording() + character(len=37) :: input, packed_input, decoded + character(len=77) :: c77 + character(len=13) :: call1, call2, call12, call22, forced_call + integer :: n10a, n12a, n10b, n12b, got_i3, got_n3 + integer :: forced_n10, forced_n12, forced_n22 + logical :: ok + + input='K1ABC W9XYZ RR73' + packed_input=' ' + packed_input=input + call normalize_call('K1ABC',call1) + call normalize_call('W9XYZ',call2) + n10a=ihashcall(call1,10) + n12a=ihashcall(call1,12) + n10b=ihashcall(call2,10) + n12b=ihashcall(call2,12) + + call clear_all_state('N0AAA','N0BBB') + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input) + call assert_pack77_result('default Type 1 tx hashes',packed_input,encoded) + got_i3=encoded%i3 + got_n3=encoded%n3 + end block + call assert_message_type('default Type 1 tx hashes',input,1,0,got_i3,got_n3) + call assert_call('default Type 1 calls10 first call',calls10(n10a),'K1ABC') + call assert_call('default Type 1 calls12 first call',calls12(n12a),'K1ABC') + call assert_call('default Type 1 calls10 second call',calls10(n10b),'W9XYZ') + call assert_call('default Type 1 calls12 second call',calls12(n12b),'W9XYZ') + call assert_int('default Type 1 nzhash after pack',2,nzhash) + call assert_true('default Type 1 hash22 first call',shared_hash22_contains(call1)) + call assert_true('default Type 1 hash22 second call',shared_hash22_contains(call2)) + + input='PJ2/W1AW RR73' + packed_input=' ' + packed_input=input + call normalize_call('W7ABC',call12) + n10a=ihashcall(call12,10) + n12a=ihashcall(call12,12) + + call clear_all_state('N0AAA','N0BBB') + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input) + call assert_pack77_result('default Type 4 tx hashes',packed_input,encoded) + got_i3=encoded%i3 + got_n3=encoded%n3 + end block + call assert_message_type('default Type 4 tx hashes',input,4,0,got_i3,got_n3) + call assert_call('default Type 4 calls10 hashed call',calls10(n10a),'W7ABC') + call assert_call('default Type 4 calls12 hashed call',calls12(n12a),'W7ABC') + call assert_int('default Type 4 nzhash after pack',1,nzhash) + call assert_true('default Type 4 hash22 hashed call',shared_hash22_contains(call12)) + + input=' 590001 FN20QI' + packed_input=' ' + packed_input=input + call normalize_call('W3CCX',call12) + call normalize_call('K1JT/P',call22) + n10a=ihashcall(call12,10) + n12a=ihashcall(call12,12) + n10b=ihashcall(call22,10) + n12b=ihashcall(call22,12) + + call clear_all_state('N0AAA','N0BBB') + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input) + call assert_pack77_result('default pack77 tx hashes',packed_input,encoded) + got_i3=encoded%i3 + got_n3=encoded%n3 + c77=encoded%c77 + end block + call assert_message_type('default pack77 tx hashes',input,5,0,got_i3,got_n3) + call assert_call('default tx calls10 first hashed call',calls10(n10a), & + 'W3CCX') + call assert_call('default tx calls12 first hashed call',calls12(n12a), & + 'W3CCX') + call assert_call('default tx calls10 second hashed call',calls10(n10b), & + 'K1JT/P') + call assert_call('default tx calls12 second hashed call',calls12(n12b), & + 'K1JT/P') + call assert_int('default tx nzhash after pack',2,nzhash) + call assert_true('default tx hash22 second hashed call', & + shared_hash22_contains(call22)) + + decoded=' ' + ok=.false. + call unpack77(c77,0,decoded,ok) + call assert_decode('default tx decode uses recorded hashes',input,input,decoded,ok) + + input=' FK52AB' + packed_input=' ' + packed_input=input + call normalize_call('PJ4/K1ABC',forced_call) + forced_n10=ihashcall(forced_call,10) + forced_n12=ihashcall(forced_call,12) + forced_n22=ihashcall(forced_call,22) + + call clear_all_state('N0AAA','N0BBB') + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input,pack77_options(prefer_wspr_50bit=.true.)) + call assert_pack77_result('prefer WSPR tx hashes',packed_input,encoded) + got_i3=encoded%i3 + got_n3=encoded%n3 + c77=encoded%c77 + end block + call assert_message_type('prefer WSPR tx hashes',input,0,6,got_i3,got_n3) + call assert_call('prefer WSPR calls10',calls10(forced_n10),'PJ4/K1ABC') + call assert_call('prefer WSPR calls12',calls12(forced_n12),'PJ4/K1ABC') + call assert_int('prefer WSPR hash22',forced_n22,ihash22(1)) + call assert_call('prefer WSPR calls22',calls22(1),'PJ4/K1ABC') + + decoded=' ' + ok=.false. + call unpack77(c77,0,decoded,ok) + call assert_decode('prefer WSPR decode uses recorded hashes',input,input,decoded,ok) + + ntests=ntests+1 + end subroutine expect_default_pack77_tx_hash_recording + + subroutine expect_pack77_record_tx_hashes_option_suppresses_commit() + character(len=37) :: input, packed_input + + input='K1ABC W9XYZ RR73' + call assert_record_tx_disabled_same_payload(input,1,0) + + input='PJ2/W1AW RR73' + call assert_record_tx_disabled_same_payload(input,4,0) + + input=' 590001 FN20QI' + call assert_record_tx_disabled_same_payload(input,5,0) + + input=' FK52AB' + packed_input=' ' + packed_input=input + call clear_all_state('N0AAA','N0BBB') + block + type(pack77_result) :: default_encoded, disabled_encoded + default_encoded=pack77_result_from_api(packed_input,pack77_options(prefer_wspr_50bit=.true.)) + call assert_pack77_result('default preferred WSPR payload',packed_input, & + default_encoded) + call clear_all_state('N0AAA','N0BBB') + disabled_encoded=pack77_result_from_api(packed_input, & + pack77_options(prefer_wspr_50bit=.true.,record_tx_hashes=.false.)) + call assert_pack77_result('disabled preferred WSPR payload',packed_input, & + disabled_encoded) + call assert_text_equal('disabled preferred WSPR c77',default_encoded%c77, & + disabled_encoded%c77) + call assert_message_type('disabled preferred WSPR type',input,0,6, & + disabled_encoded%i3,disabled_encoded%n3) + end block + call assert_shared_hash_tables_empty('disabled preferred WSPR hashes') + + ntests=ntests+1 + end subroutine expect_pack77_record_tx_hashes_option_suppresses_commit + + subroutine expect_pack77_encode_rejects_dx_macro_by_default() + character(len=37) :: shorthand + + shorthand='$DX K1ABC FN42' + call clear_all_state('N0AAA','N0BBB') + + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(shorthand) + call assert_true('pure Pack77 encode rejects DX macro', & + .not.encoded%encoded) + end block + + ntests=ntests+1 + end subroutine expect_pack77_encode_rejects_dx_macro_by_default + + subroutine expect_pack77_free_text_fallback_rejects_unexpanded_dx_macro() + character(len=37) :: input, direct + + direct='W9XYZ K1ABC FN42' + call clear_all_state('N0AAA','N0BBB') + + input='$DX K1ABC FN42' + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(input) + call assert_true('Pack77 free-text fallback rejects DX macro', & + .not.encoded%encoded) + end block + + input='$dx K1ABC FN42' + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(input) + call assert_true('Pack77 free-text fallback rejects lowercase DX macro', & + .not.encoded%encoded) + end block + + input=' $DX K1ABC FN42' + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(input) + call assert_true('Pack77 free-text fallback rejects leading-space DX macro', & + .not.encoded%encoded) + end block + + input='$DXCALL K1ABC FN42' + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(input) + call assert_true('Pack77 free-text fallback rejects DXCALL macro', & + .not.encoded%encoded) + end block + + input='$dxcall K1ABC FN42' + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(input) + call assert_true('Pack77 free-text fallback rejects lowercase DXCALL macro', & + .not.encoded%encoded) + end block + + input='$DXFOO K1ABC FN42' + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(input) + call assert_true('Pack77 free-text fallback rejects invalid DX prefix', & + .not.encoded%encoded) + call assert_true('Pack77 free-text fallback invalid DX prefix status', & + encoded%status.eq.PACK77_STATUS_FREE_TEXT_INVALID) + end block + + input='$DX K1ABC FN42' + block + type(pack77_result) :: shorthand_encoded, direct_encoded + shorthand_encoded=pack77_result_from_api(input, & + pack77_options(expand_dx_macro=.true.,dx_macro_base='W9XYZ')) + direct_encoded=pack77_result_from_api(direct) + call assert_pack77_result('Pack77 free-text fallback explicit DX expansion',input, & + shorthand_encoded) + call assert_text_equal('Pack77 free-text fallback explicit DX expansion c77', & + direct_encoded%c77,shorthand_encoded%c77) + end block + + ntests=ntests+1 + end subroutine expect_pack77_free_text_fallback_rejects_unexpanded_dx_macro + + subroutine expect_pack_unpack_hash_state_matches_pack_only() + call assert_pack_unpack_hash_state_matches_pack_only( & + 'K1ABC RR73; W9XYZ -12') + call assert_pack_unpack_hash_state_matches_pack_only('W1AW/P K1A 1A CT') + call assert_pack_unpack_hash_state_matches_pack_only('PJ2/W1AW RR73') + call assert_pack_unpack_hash_state_matches_pack_only( & + ' 590001 FN20QI') + + ntests=ntests+1 + end subroutine expect_pack_unpack_hash_state_matches_pack_only + + subroutine expect_genft8_failure_state() + character(len=37) :: input, msgsent + integer*1 :: msgbits(77) + integer :: itone(79) + integer :: i3,n3 + + input='$DX K1ABC FN42' + call genft8(input,i3,n3,msgsent,msgbits,itone) + + call assert_int('genft8 failure i3',-1,i3) + call assert_int('genft8 failure n3',-1,n3) + call assert_text_equal('genft8 failure msgsent', & + '*** bad message *** ',msgsent) + call assert_true('genft8 failure msgbits',all(msgbits.eq.0)) + call assert_true('genft8 failure itone',all(itone.eq.0)) + + ntests=ntests+1 + end subroutine expect_genft8_failure_state + + subroutine expect_dx_macro_option_uses_explicit_base() + character(len=37) :: shorthand, direct, decoded + logical :: ok + + shorthand='$DX K1ABC FN42' + direct='W9XYZ K1ABC FN42' + call clear_all_state('N0AAA','N0BBB') + + block + type(pack77_result) :: shorthand_encoded, direct_encoded + shorthand_encoded=pack77_result_from_api(shorthand, & + pack77_options(expand_dx_macro=.true.,dx_macro_base='W9XYZ')) + direct_encoded=pack77_result_from_api(direct) + call assert_pack77_result('DX rewrite shorthand',shorthand, & + shorthand_encoded) + call assert_pack77_result('DX rewrite direct',direct,direct_encoded) + call assert_message_type('DX rewrite type',shorthand,1,0, & + shorthand_encoded%i3,shorthand_encoded%n3) + call assert_text_equal('DX rewrite c77',direct_encoded%c77, & + shorthand_encoded%c77) + + decoded=' ' + ok=.false. + call unpack77(shorthand_encoded%c77,0,decoded,ok) + call assert_decode('DX rewrite decode',shorthand,direct,decoded,ok) + end block + + shorthand='$DXCALL K1ABC FN42' + block + type(pack77_result) :: shorthand_encoded, direct_encoded + shorthand_encoded=pack77_result_from_api(shorthand, & + pack77_options(expand_dx_macro=.true.,dx_macro_base='W9XYZ')) + direct_encoded=pack77_result_from_api(direct) + call assert_pack77_result('DXCALL rewrite shorthand',shorthand, & + shorthand_encoded) + call assert_text_equal('DXCALL rewrite c77',direct_encoded%c77, & + shorthand_encoded%c77) + end block + + shorthand='$dx K1ABC FN42' + block + type(pack77_result) :: shorthand_encoded, direct_encoded + shorthand_encoded=pack77_result_from_api(shorthand, & + pack77_options(expand_dx_macro=.true.,dx_macro_base='W9XYZ')) + direct_encoded=pack77_result_from_api(direct) + call assert_pack77_result('lowercase DX rewrite shorthand',shorthand, & + shorthand_encoded) + call assert_text_equal('lowercase DX rewrite c77',direct_encoded%c77, & + shorthand_encoded%c77) + end block + + shorthand=' $DX K1ABC FN42' + block + type(pack77_result) :: shorthand_encoded, direct_encoded + shorthand_encoded=pack77_result_from_api(shorthand, & + pack77_options(expand_dx_macro=.true.,dx_macro_base='W9XYZ')) + direct_encoded=pack77_result_from_api(direct) + call assert_pack77_result('DX rewrite leading whitespace',shorthand, & + shorthand_encoded) + call assert_text_equal('DX rewrite leading whitespace c77', & + direct_encoded%c77,shorthand_encoded%c77) + end block + + ntests=ntests+1 + end subroutine expect_dx_macro_option_uses_explicit_base + + subroutine expect_failed_pack77_candidates_do_not_record_hashes() + call assert_rejected_candidate_does_not_record('W9XYZ K1ABC R BAD MA') + call assert_rejected_candidate_does_not_record(' K1ABC BOGUS') + call assert_rejected_candidate_does_not_record('CQ PJ2/W1AW BOGUS') + call assert_rejected_candidate_does_not_record('X W9XYZ RR73') + call assert_rejected_candidate_does_not_record( & + 'K1ABC RR73; W9XYZ X -12') + call assert_rejected_candidate_does_not_record( & + ' 590001 FN20QI') + call assert_rejected_candidate_does_not_record( & + ' <...> 590001 FN20QI',decoded,ok) + + ntests=ntests+1 + end subroutine expect_var_tx_rx_separation + + subroutine expect_mycall_dxcall_substitutions() + character(len=77) :: c77 + character(len=37) :: decoded_standard, decoded_var + logical :: ok_standard, ok_var + + ! These decode paths substitute local my/dx calls without hash-table priming. + call pack_and_assert_type(' W9XYZ RR73',1,0,c77) + call clear_all_state('PJ4/K1ABC','N0BBB') + call unpack_standard_current_state(c77,1,decoded_standard,ok_standard) + call clear_all_state('PJ4/K1ABC','N0BBB') + call unpack_var_current_state(c77,1,decoded_var,ok_var) + call assert_decode('standard Type 1 mycall hash22',' W9XYZ RR73', & + ' W9XYZ RR73',decoded_standard,ok_standard) + call assert_decode('var Type 1 mycall hash22',' W9XYZ RR73', & + ' W9XYZ RR73',decoded_var,ok_var) + + call pack_and_assert_type('K1ABC RR73; W9XYZ -12',0,1,c77) + call clear_all_state('N0AAA','KH1/KH7Z') + call unpack_standard_current_state(c77,1,decoded_standard,ok_standard) + call clear_all_state('N0AAA','KH1/KH7Z') + call unpack_var_current_state(c77,1,decoded_var,ok_var) + call assert_decode('standard DXpedition dxcall hash10', & + 'K1ABC RR73; W9XYZ -12', & + 'K1ABC RR73; W9XYZ -12',decoded_standard,ok_standard) + call assert_decode('var DXpedition dxcall hash10', & + 'K1ABC RR73; W9XYZ -12', & + 'K1ABC RR73; W9XYZ -12',decoded_var,ok_var) + + call clear_all_state('KH1/KH7Z','N0BBB') + call unpack_standard_current_state(c77,0,decoded_standard,ok_standard) + call clear_all_state('KH1/KH7Z','N0BBB') + call unpack_var_current_state(c77,0,decoded_var,ok_var) + call assert_decode('standard DXpedition mycall hash10', & + 'K1ABC RR73; W9XYZ -12', & + 'K1ABC RR73; W9XYZ -12',decoded_standard,ok_standard) + call assert_decode('var DXpedition mycall hash10', & + 'K1ABC RR73; W9XYZ -12', & + 'K1ABC RR73; W9XYZ -12',decoded_var,ok_var) + + call pack_and_assert_type(' 590001 FN20QI',5,0,c77) + call clear_all_state('W3CCX','N0BBB') + call unpack_standard_current_state(c77,1,decoded_standard,ok_standard) + call clear_all_state('W3CCX','N0BBB') + call unpack_var_current_state(c77,1,decoded_var,ok_var) + call assert_decode('standard Type 5 mycall hash12', & + ' 590001 FN20QI', & + ' <...> 590001 FN20QI',decoded_standard,ok_standard) + call assert_decode('var Type 5 mycall hash12', & + ' 590001 FN20QI', & + ' <...> 590001 FN20QI',decoded_var,ok_var) + + ntests=ntests+1 + end subroutine expect_mycall_dxcall_substitutions + + subroutine expect_invalid_standard_call_decode_failure() + character(len=13) :: decoded_standard, decoded_var + integer, parameter :: n28_q1abc = 11395945 + logical :: ok_standard, ok_var + + call unpack28(n28_q1abc,decoded_standard,ok_standard) + call unpack28(n28_q1abc,decoded_var,ok_var) + + call assert_true('standard invalid raw call fails',.not.ok_standard) + call assert_true('var invalid raw call fails',.not.ok_var) + + ntests=ntests+1 + end subroutine expect_invalid_standard_call_decode_failure + + subroutine expect_hash_resolution_case(input,want_i3,want_n3,blank_expected, & + primed_expected,width1,call1,width2,call2,width3,call3) + character(len=*), intent(in) :: input, blank_expected, primed_expected + character(len=*), intent(in) :: call1, call2, call3 + integer, intent(in) :: want_i3, want_n3, width1, width2, width3 + character(len=77) :: c77 + character(len=37) :: decoded_standard, decoded_var + logical :: ok_standard, ok_var + + call pack_and_assert_type(input,want_i3,want_n3,c77) + + call decode_standard(c77,1,decoded_standard,ok_standard) + call decode_var(c77,1,decoded_var,ok_var) + call assert_decode('standard blank',input,blank_expected,decoded_standard,ok_standard) + call assert_decode('var blank',input,blank_expected,decoded_var,ok_var) + call assert_text_equal('blank standard/var',decoded_standard,decoded_var) + + call prime_hash_width(width1,call1,'standard') + call prime_hash_width(width2,call2,'standard') + call prime_hash_width(width3,call3,'standard') + call unpack_standard_current_state(c77,1,decoded_standard,ok_standard) + + call prime_hash_width(width1,call1,'var') + call prime_hash_width(width2,call2,'var') + call prime_hash_width(width3,call3,'var') + call unpack_var_current_state(c77,1,decoded_var,ok_var) + + call assert_decode('standard primed',input,primed_expected,decoded_standard,ok_standard) + call assert_decode('var primed',input,primed_expected,decoded_var,ok_var) + call assert_text_equal('primed standard/var',decoded_standard,decoded_var) + + ntests=ntests+1 + end subroutine expect_hash_resolution_case + + subroutine pack_and_assert_type(input,want_i3,want_n3,c77) + character(len=*), intent(in) :: input + integer, intent(in) :: want_i3, want_n3 + character(len=77), intent(out) :: c77 + character(len=37) :: packed_input + integer :: got_i3, got_n3 + + call clear_all_state('N0AAA','N0BBB') + packed_input=' ' + packed_input=input + got_i3=-1 + got_n3=-1 + c77='' + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input) + call assert_pack77_result('pack77',packed_input,encoded) + got_i3=encoded%i3 + got_n3=encoded%n3 + c77=encoded%c77 + end block + call assert_message_type('pack77',input,want_i3,want_n3,got_i3,got_n3) + end subroutine pack_and_assert_type + + subroutine decode_standard(c77,nrx,decoded,ok) + character(len=77), intent(in) :: c77 + integer, intent(in) :: nrx + character(len=37), intent(out) :: decoded + logical, intent(out) :: ok + + call clear_all_state('N0AAA','N0BBB') + call unpack_standard_current_state(c77,nrx,decoded,ok) + end subroutine decode_standard + + subroutine decode_var(c77,nrx,decoded,ok) + character(len=77), intent(in) :: c77 + integer, intent(in) :: nrx + character(len=37), intent(out) :: decoded + logical, intent(out) :: ok + + call clear_all_state('N0AAA','N0BBB') + call unpack_var_current_state(c77,nrx,decoded,ok) + end subroutine decode_var + + subroutine unpack_standard_current_state(c77,nrx,decoded,ok) + character(len=77), intent(in) :: c77 + integer, intent(in) :: nrx + character(len=37), intent(out) :: decoded + logical, intent(out) :: ok + + decoded=' ' + ok=.false. + call unpack77(c77,nrx,decoded,ok) + end subroutine unpack_standard_current_state + + subroutine unpack_var_current_state(c77,nrx,decoded,ok) + character(len=77), intent(in) :: c77 + integer, intent(in) :: nrx + character(len=37), intent(out) :: decoded + logical, intent(out) :: ok + + call unpack_var_current_state_thread(c77,nrx,1,decoded,ok) + end subroutine unpack_var_current_state + + subroutine unpack_var_current_state_thread(c77,nrx,nthr,decoded,ok) + character(len=77), intent(in) :: c77 + integer, intent(in) :: nrx, nthr + character(len=37), intent(out) :: decoded + logical, intent(out) :: ok + + decoded=' ' + ok=.false. + call unpack77_configured(c77,nrx,decoded,ok,unpack77_options(thread_index=nthr)) + end subroutine unpack_var_current_state_thread + + subroutine pack_var_current_state(input,want_i3,want_n3,ntxhash,c77) + character(len=*), intent(in) :: input + integer, intent(in) :: want_i3, want_n3, ntxhash + character(len=77), intent(out) :: c77 + character(len=37) :: packed_input + integer :: got_i3, got_n3 + + packed_input=' ' + packed_input=input + got_i3=-1 + got_n3=-1 + c77='' + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input,pack77_options(record_tx_hashes=ntxhash.eq.1)) + call assert_pack77_result('pack77',packed_input,encoded) + got_i3=encoded%i3 + got_n3=encoded%n3 + c77=encoded%c77 + end block + call assert_message_type('pack77',input,want_i3,want_n3,got_i3,got_n3) + end subroutine pack_var_current_state + + subroutine assert_record_tx_disabled_same_payload(input,want_i3,want_n3) + character(len=*), intent(in) :: input + integer, intent(in) :: want_i3, want_n3 + character(len=37) :: packed_input + + packed_input=' ' + packed_input=input + call clear_all_state('N0AAA','N0BBB') + block + type(pack77_result) :: default_encoded, disabled_encoded + default_encoded=pack77_result_from_api(packed_input) + call assert_pack77_result('default record_tx payload',packed_input, & + default_encoded) + call clear_all_state('N0AAA','N0BBB') + disabled_encoded=pack77_result_from_api(packed_input,pack77_options(record_tx_hashes=.false.)) + call assert_pack77_result('disabled record_tx payload',packed_input, & + disabled_encoded) + call assert_text_equal('disabled record_tx c77',default_encoded%c77, & + disabled_encoded%c77) + call assert_message_type('disabled record_tx type',input,want_i3,want_n3, & + disabled_encoded%i3,disabled_encoded%n3) + end block + call assert_shared_hash_tables_empty('disabled record_tx hashes') + end subroutine assert_record_tx_disabled_same_payload + + subroutine assert_rejected_candidate_does_not_record(input) + character(len=*), intent(in) :: input + character(len=37) :: packed_input + + packed_input=' ' + packed_input=input + call clear_all_state('N0AAA','N0BBB') + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input) + if(encoded%encoded) then + call assert_message_type('rejected candidate fallback type',input,0,0, & + encoded%i3,encoded%n3) + endif + end block + call assert_shared_hash_tables_empty('rejected candidate hashes') + end subroutine assert_rejected_candidate_does_not_record + + subroutine assert_pack_unpack_hash_state_matches_pack_only(input) + character(len=*), intent(in) :: input + character(len=37) :: packed_input, decoded + character(len=77) :: c77 + character(len=13) :: calls10_after_unpack(0:1023) + character(len=13) :: calls12_after_unpack(0:4095) + character(len=13) :: calls22_after_unpack(1:MAXHASH) + integer :: ihash22_after_unpack(1:MAXHASH) + integer :: nzhash_after_unpack + integer :: i3,n3 + logical :: ok + + packed_input=' ' + packed_input=input + + call clear_all_state('N0AAA','N0BBB') + i3=-1 + n3=-1 + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input) + i3=encoded%i3 + n3=encoded%n3 + c77=encoded%c77 + end block + call assert_true('pack/unpack hash-state packed '//trim(input),i3.ge.0) + decoded=' ' + ok=.false. + call unpack77(c77,0,decoded,ok) + call assert_true('pack/unpack hash-state unpacked '//trim(input),ok) + nzhash_after_unpack=nzhash + calls10_after_unpack=calls10 + calls12_after_unpack=calls12 + calls22_after_unpack=calls22 + ihash22_after_unpack=ihash22 + + call clear_all_state('N0AAA','N0BBB') + i3=-1 + n3=-1 + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input) + i3=encoded%i3 + n3=encoded%n3 + c77=encoded%c77 + end block + call assert_true('pack-only hash-state packed '//trim(input),i3.ge.0) + + call assert_int('pack/unpack nzhash '//trim(input),nzhash_after_unpack,nzhash) + call assert_true('pack/unpack calls10 '//trim(input), & + all(calls10_after_unpack.eq.calls10)) + call assert_true('pack/unpack calls12 '//trim(input), & + all(calls12_after_unpack.eq.calls12)) + call assert_true('pack/unpack calls22 '//trim(input), & + all(calls22_after_unpack.eq.calls22)) + call assert_true('pack/unpack ihash22 '//trim(input), & + all(ihash22_after_unpack.eq.ihash22)) + end subroutine assert_pack_unpack_hash_state_matches_pack_only + + subroutine prime_hash_width(width,callsign,label) + integer, intent(in) :: width + character(len=*), intent(in) :: callsign, label + character(len=13) :: c13 + integer :: n + + if(width.le.0 .or. len_trim(callsign).le.0) return + call normalize_call(callsign,c13) + if(len_trim(c13).le.0) return + n=ihashcall(c13,width) + if(width.eq.10) then + calls10(n)=c13 + else if(width.eq.12) then + calls12(n)=c13 + else if(width.eq.22) then + if(nzhash.lt.MAXHASH) nzhash=nzhash+1 + ihash22(nzhash)=n + calls22(nzhash)=c13 + else + write(*,1010) trim(label), width +1010 format('Unsupported ',a,' hash width ',i0) + error stop 1 + endif + end subroutine prime_hash_width + + logical function shared_hash22_contains(callsign) + character(len=*), intent(in) :: callsign + character(len=13) :: c13 + integer :: n22 + + call normalize_call(callsign,c13) + n22=ihashcall(c13,22) + shared_hash22_contains=any(ihash22(1:nzhash).eq.n22) + end function shared_hash22_contains + +end program test_packjt77_hash_state diff --git a/tests/unit/packjt77/test_packjt77_hash_vectors.f90 b/tests/unit/packjt77/test_packjt77_hash_vectors.f90 deleted file mode 100644 index 09ea0779..00000000 --- a/tests/unit/packjt77/test_packjt77_hash_vectors.f90 +++ /dev/null @@ -1,77 +0,0 @@ -program test_packjt77_hash_vectors - - use packjt77 - implicit none - - integer :: ntests - - ntests=0 - - call expect_hash_vector('K1ABC', 712, 2851, 2920267) - call expect_hash_vector('W9XYZ', 972, 3889, 3982604) - call expect_hash_vector('PJ4/K1ABC', 346, 1387, 1420834) - call expect_hash_vector('KH1/KH7Z', 201, 806, 825805) - call expect_hash_vector('K1JT/P', 959, 3839, 3931158) - call expect_hash_vector('W3CCX', 665, 2662, 2726483) - call expect_hash_vector('3DA0ABC', 48, 192, 196695) - call expect_hash_vector('3XABC', 563, 2254, 2308721) - call expect_hash_vector('///////////', 671, 2685, 2749801) - call expect_hash_vector('ZZZZZZZZZZZ', 902, 3609, 3695718) - call expect_hash_vector('99999999999', 762, 3050, 3123740) - call expect_hash_vector('A23456789Z/', 122, 488, 499902) - call expect_hash_vector(' ', 0, 0, 0) - - write(*,1000) ntests -1000 format('packjt77 hash vector tests passed: ',i0) - -contains - - subroutine expect_hash_vector(callsign,want10,want12,want22) - character(len=*), intent(in) :: callsign - integer, intent(in) :: want10, want12, want22 - character(len=13) :: c13 - integer :: got10, got12, got22 - integer :: got10var, got12var, got22var - - c13=' ' - c13=callsign - got10=ihashcall(c13,10) - got12=ihashcall(c13,12) - got22=ihashcall(c13,22) - got10var=ihashcallvar(c13,10) - got12var=ihashcallvar(c13,12) - got22var=ihashcallvar(c13,22) - - if(got10.ne.want10 .or. got12.ne.want12 .or. got22.ne.want22) then - write(*,1010) trim(callsign), got10, got12, got22, want10, want12, want22 -1010 format('Hash vector failure for "',a,'"; got ',i0,1x,i0,1x,i0, & - ' wanted ',i0,1x,i0,1x,i0) - error stop 1 - endif - - if(got10var.ne.want10 .or. got12var.ne.want12 .or. got22var.ne.want22) then - write(*,1020) trim(callsign), got10var, got12var, got22var, & - want10, want12, want22 -1020 format('Var hash vector failure for "',a,'"; got ',i0,1x,i0,1x,i0, & - ' wanted ',i0,1x,i0,1x,i0) - error stop 1 - endif - - if(got10.ne.got10var .or. got12.ne.got12var .or. got22.ne.got22var) then - write(*,1030) trim(callsign), got10, got12, got22, got10var, got12var, got22var -1030 format('Hash helper mismatch for "',a,'"; standard ',i0,1x,i0,1x,i0, & - ' var ',i0,1x,i0,1x,i0) - error stop 1 - endif - - if(got10.lt.0 .or. got10.gt.1023 .or. got12.lt.0 .or. got12.gt.4095 .or. & - got22.lt.0 .or. got22.gt.4194303) then - write(*,1040) trim(callsign), got10, got12, got22 -1040 format('Hash range failure for "',a,'"; got ',i0,1x,i0,1x,i0) - error stop 1 - endif - - ntests=ntests+1 - end subroutine expect_hash_vector - -end program test_packjt77_hash_vectors diff --git a/tests/unit/packjt77/test_packjt77_invariants.f90 b/tests/unit/packjt77/test_packjt77_invariants.f90 new file mode 100644 index 00000000..3fd14493 --- /dev/null +++ b/tests/unit/packjt77/test_packjt77_invariants.f90 @@ -0,0 +1,150 @@ +program test_packjt77_invariants + + use packjt77_test_helpers + implicit none + + integer :: ntests + external :: genft8 + external :: genft4 + external :: genfst4 + external :: genmsk_128_90 + external :: genq65 + + ntests=0 + + call run_packjt77_common_invariants(.false.,ntests) + call run_packjt77_standard_schema_invariants(ntests) + call expect_callok_suffix_bounds(ntests) + call expect_tx_generators_use_legacy_fallback(ntests) + call expect_tx_generators_reject_invalid_fallback(ntests) + call expect_fst4w_keeps_preferred_wspr_strict(ntests) + + write(*,1000) ntests +1000 format('packjt77 invariant tests passed: ',i0) + +contains + + subroutine expect_callok_suffix_bounds(ntests) + integer, intent(inout) :: ntests + logical :: callok + + call assert_true('callok accepts normal suffix length',callok('K1ABC')) + call assert_true('callok rejects overlength suffix',.not.callok('N0CALL')) + + ntests=ntests+1 + end subroutine expect_callok_suffix_bounds + + subroutine expect_tx_generators_use_legacy_fallback(ntests) + integer, intent(inout) :: ntests + character(len=37) :: input, msgsent + integer :: i3, n3, iwspr, itype + integer :: itone79(79), itone85(85), itone105(105), itone144(144) + integer :: itone160(160) + integer*1 :: msgbits77(77), msgbits101(101) + + input='ABCDEFGHIJKLMN' + + call genft8(input,i3,n3,msgsent,msgbits77,itone79) + call assert_int('FT8 legacy fallback i3',0,i3) + call assert_int('FT8 legacy fallback n3',0,n3) + call assert_text_equal('FT8 legacy fallback message', & + 'ABCDEFGHIJKLM',msgsent) + call assert_true('FT8 legacy fallback tones',any(itone79.ne.0)) + + call genft4(input,0,msgsent,msgbits77,itone105) + call assert_text_equal('FT4 legacy fallback message', & + 'ABCDEFGHIJKLM',msgsent) + call assert_true('FT4 legacy fallback bits',any(msgbits77.ne.0)) + call assert_true('FT4 legacy fallback tones',any(itone105.ne.0)) + + iwspr=0 + call genfst4(input,0,msgsent,msgbits101,itone160,iwspr) + call assert_text_equal('FST4 legacy fallback message', & + 'ABCDEFGHIJKLM',msgsent) + call assert_int('FST4 legacy fallback iwspr',0,iwspr) + call assert_true('FST4 legacy fallback bits',any(msgbits101.ne.0)) + call assert_true('FST4 legacy fallback tones',any(itone160.ne.0)) + + itype=1 + call genmsk_128_90(input,0,msgsent,itone144,itype) + call assert_int('MSK144 legacy fallback type',1,itype) + call assert_text_equal('MSK144 legacy fallback message', & + 'ABCDEFGHIJKLM',msgsent) + call assert_true('MSK144 legacy fallback tones',any(itone144.ne.0)) + + call genq65(input,0,msgsent,itone85,i3,n3,0) + call assert_int('Q65 legacy fallback i3',0,i3) + call assert_int('Q65 legacy fallback n3',0,n3) + call assert_text_equal('Q65 legacy fallback message', & + 'ABCDEFGHIJKLM',msgsent) + call assert_true('Q65 legacy fallback tones',any(itone85.ne.0)) + + ntests=ntests+1 + end subroutine expect_tx_generators_use_legacy_fallback + + subroutine expect_fst4w_keeps_preferred_wspr_strict(ntests) + integer, intent(inout) :: ntests + character(len=37) :: input, msgsent + integer :: iwspr + integer :: itone160(160) + integer*1 :: msgbits101(101) + + input='PJ4/K1ABC FK52A!' + iwspr=1 + msgsent=' ' + msgbits101=1 + itone160=1 + + call genfst4(input,0,msgsent,msgbits101,itone160,iwspr) + + call assert_int('FST4W strict iwspr',1,iwspr) + call assert_text_equal('FST4W strict message','*** bad message ***', & + msgsent) + call assert_true('FST4W strict bits',all(msgbits101.eq.0)) + call assert_true('FST4W strict tones',all(itone160.eq.0)) + + ntests=ntests+1 + end subroutine expect_fst4w_keeps_preferred_wspr_strict + + subroutine expect_tx_generators_reject_invalid_fallback(ntests) + integer, intent(inout) :: ntests + character(len=37) :: input, msgsent + integer :: i3, n3, itype + integer :: itone85(85), itone105(105), itone144(144) + integer*1 :: msgbits77(77) + + input='$DX K1ABC FN42' + + msgsent=' ' + msgbits77=1 + itone105=1 + call genft4(input,1,msgsent,msgbits77,itone105) + call assert_text_equal('FT4 invalid fallback message', & + '*** bad message ***',msgsent) + call assert_true('FT4 invalid fallback bits',all(msgbits77.eq.0)) + call assert_true('FT4 invalid fallback tones',all(itone105(1:103).eq.0)) + + itype=1 + msgsent=' ' + itone144=1 + call genmsk_128_90(input,0,msgsent,itone144,itype) + call assert_int('MSK144 invalid fallback type',-1,itype) + call assert_text_equal('MSK144 invalid fallback message', & + '*** bad message ***',msgsent) + call assert_true('MSK144 invalid fallback tones',all(itone144.eq.0)) + + i3=0 + n3=0 + msgsent=' ' + itone85=1 + call genq65(input,0,msgsent,itone85,i3,n3,0) + call assert_int('Q65 invalid fallback i3',-1,i3) + call assert_int('Q65 invalid fallback n3',-1,n3) + call assert_text_equal('Q65 invalid fallback message', & + '*** bad message ***',msgsent) + call assert_true('Q65 invalid fallback tones',all(itone85.eq.0)) + + ntests=ntests+1 + end subroutine expect_tx_generators_reject_invalid_fallback + +end program test_packjt77_invariants diff --git a/tests/unit/packjt77/test_packjt77_mutation_sweep.f90 b/tests/unit/packjt77/test_packjt77_mutation_sweep.f90 new file mode 100644 index 00000000..58abdb60 --- /dev/null +++ b/tests/unit/packjt77/test_packjt77_mutation_sweep.f90 @@ -0,0 +1,280 @@ + program test_packjt77_mutation_sweep + use packjt77 + use packjt77_test_helpers + implicit none + + integer, parameter :: MAX_SEEDS=400,MAX_MUTANTS=50000 + character(len=37) :: seeds(MAX_SEEDS) + integer :: nseeds,nmutants,nexact,ncanon,nreject + + nseeds=0 + nmutants=0 + nexact=0 + ncanon=0 + nreject=0 + + call check_canonical_matcher() + call generate_seeds() + call assert_true('seed generator coverage', nseeds.ge.200) + call sweep_mutations() + + print '(a,i0,a,i0,a,i0,a,i0)', & + 'test_packjt77_mutation_sweep: mutants=', nmutants, & + ' encoded-exact=', nexact, ' encoded-canonical=', ncanon, & + ' rejected=', nreject + +contains + + subroutine check_canonical_matcher() + call assert_true('canonical compound bracket', & + canonical_match('W1AW/P','')) + call assert_true('canonical compound placeholder', & + canonical_match('PJ2/W1AW','<...>')) + call assert_true('canonical bracket placeholder', & + canonical_match('','<...>')) + call assert_true('canonical grid bracket reject', & + .not.canonical_match('FN42','')) + call assert_true('canonical trailing slash reject', & + .not.canonical_match('K1ABC/','')) + call assert_true('canonical leading slash reject', & + .not.canonical_match('/K1ABC','')) + call assert_true('canonical double slash reject', & + .not.canonical_match('A//B','')) + end subroutine check_canonical_matcher + + subroutine generate_seeds() + character(len=13), parameter :: calls(6)=(/'K1ABC ', & + 'W9XYZ ','KA1ABC ','WA9XYZ ','PJ2/W1AW ', & + 'W1AW/P '/) + character(len=4), parameter :: grids(4)=(/'FN42','EM10','DM79','IO91'/) + character(len=3), parameter :: snrs(4)=(/'-12','+00','+20','R-7'/) + character(len=3), parameter :: rtty_reports(4)=(/'529','559','579','599'/) + character(len=3), parameter :: mults(4)=(/'MA ','CT ','DX ','EMA'/) + character(len=6), parameter :: vhf_exch(4)=(/'520001','590001', & + '592047','582047'/) + integer :: i,j + character(len=13) :: free_seed + + do i=1,4 + do j=1,4 + call add_seed(trim(calls(i))//' '//trim(calls(j))//' '//grids(j)) + call add_seed(trim(calls(i))//' '//trim(calls(j))//' '//snrs(i)) + call add_seed(trim(calls(i))//' '//trim(calls(j))//' R '//grids(j)) + call add_seed(trim(calls(i))//' '//trim(calls(j))//' RRR') + enddo + enddo + + do i=1,4 + call add_seed(trim(calls(i))//' RR73; W9XYZ -12') + call add_seed(trim(calls(5))//' RR73; W9XYZ -12') + call add_seed(trim(calls(i))//' '//trim(calls(j_index(i)))//' R 1A EMA') + call add_seed(trim(calls(6))//' '//trim(calls(i))//' 5A CT') + call add_seed('TU; '//trim(calls(i))//' W9XYZ R '//rtty_reports(i)// & + ' '//trim(mults(i))) + call add_seed(trim(calls(i))//' W9XYZ '//rtty_reports(i)// & + ' '//trim(mults(i))) + call add_seed(' '//trim(calls(i))//' RR73') + call add_seed(trim(calls(5))//' RR73') + call add_seed(' '//vhf_exch(i)//' FN20QI') + call add_seed(' R '//vhf_exch(i)//' FN20QI') + call add_seed(trim(calls(i))//' '//grids(i)//' 37') + call add_seed('0/'//trim(calls(i))//' 37') + call add_seed(trim(calls(i))//'/1 37') + enddo + + call add_seed('CQ PJ2/W1AW') + call add_seed('CQ K1ABC FN42') + call add_seed('123456789ABCDEF012') + call add_seed('0000000000000000DE') + call add_seed('HELLO WORLD 73') + call add_seed('FREE TEXT MSG') + + do i=1,80 + call add_seed('K1ABC W9XYZ +'//digit2(mod(i,50))) + call add_seed('K1ABC W9XYZ R+'//digit2(mod(i,50))) + call add_seed('WA9XYZ KA1ABC '//field_day_exchange(i)) + enddo + + do i=1,160 + write(free_seed,'("TXT",i3.3," MSG")') i + call add_seed(free_seed) + enddo + end subroutine generate_seeds + + integer function j_index(i) result(j) + integer, intent(in) :: i + + j=mod(i,4)+1 + end function j_index + + character(len=2) function digit2(n) result(text) + integer, intent(in) :: n + + write(text,'(i2.2)') n + end function digit2 + + character(len=3) function field_day_exchange(i) result(text) + integer, intent(in) :: i + + write(text,'(i0,a1)') mod(i-1,32)+1, achar(iachar('A')+mod(i,6)) + end function field_day_exchange + + subroutine add_seed(text) + character(len=*), intent(in) :: text + character(len=37) :: msg,decoded + logical :: ok + type(pack77_result) :: encoded + + if(nseeds.ge.MAX_SEEDS) return + msg=' ' + msg=text + call clear_all_state('N0AAA','N0BBB') + encoded=pack77_result_from_api(msg) + if(.not.encoded%encoded) return + decoded=' ' + ok=.false. + call unpack77(encoded%c77,0,decoded,ok) + call assert_true('seed decodes', ok) + nseeds=nseeds+1 + seeds(nseeds)=msg + end subroutine add_seed + + subroutine sweep_mutations() + integer :: i + + do i=1,nseeds + call mutate_seed(seeds(i)) + if(nmutants.ge.MAX_MUTANTS) exit + enddo + end subroutine sweep_mutations + + subroutine mutate_seed(seed) + character(len=*), intent(in) :: seed + character(len=8), parameter :: probes='A0/<>+. ' + character(len=37) :: mutant + integer :: i,j,n + + n=len_trim(seed) + do i=1,n + do j=1,len(probes) + mutant=seed + mutant(i:i)=probes(j:j) + call check_mutant(mutant) + if(nmutants.ge.MAX_MUTANTS) return + enddo + enddo + + do i=1,n + mutant=' ' + if(i.gt.1) mutant(1:i-1)=seed(1:i-1) + if(i.lt.n) mutant(i:n-1)=seed(i+1:n) + call check_mutant(mutant) + if(nmutants.ge.MAX_MUTANTS) return + enddo + + call mutate_tokens(seed) + end subroutine mutate_seed + + subroutine mutate_tokens(seed) + character(len=*), intent(in) :: seed + character(len=37) :: tokens(19),mutant + integer :: ntokens,i,j + + call split_tokens(seed,tokens,ntokens) + do i=1,ntokens + mutant=join_tokens(tokens,ntokens,i,i) + call check_mutant(mutant) + if(nmutants.ge.MAX_MUTANTS) return + enddo + do i=1,ntokens-1 + do j=i+1,ntokens + mutant=join_tokens(tokens,ntokens,i,j) + call check_mutant(mutant) + if(nmutants.ge.MAX_MUTANTS) return + enddo + enddo + end subroutine mutate_tokens + + character(len=37) function join_tokens(tokens,ntokens,a,b) result(msg) + character(len=37), intent(in) :: tokens(:) + integer, intent(in) :: ntokens,a,b + integer :: i + character(len=37) :: work(19) + + work=tokens + if(a.eq.b) then + msg=' ' + do i=1,ntokens + call append_token(msg,tokens(i)) + if(i.eq.a) call append_token(msg,tokens(i)) + enddo + else + work(a)=tokens(b) + work(b)=tokens(a) + msg=' ' + do i=1,ntokens + call append_token(msg,work(i)) + enddo + endif + end function join_tokens + + subroutine append_token(msg,token) + character(len=37), intent(inout) :: msg + character(len=*), intent(in) :: token + integer :: n,m + + n=len_trim(msg) + m=len_trim(token) + if(m.eq.0) return + if(n.eq.0) then + if(m.le.37) msg(1:m)=token(1:m) + else if(n+m+1.le.37) then + msg(n+1:n+1)=' ' + msg(n+2:n+m+1)=token(1:m) + endif + end subroutine append_token + + subroutine check_mutant(mutant) + character(len=*), intent(in) :: mutant + character(len=37) :: msg,decoded + logical :: ok,is_exact,is_canonical,is_telemetry + type(pack77_result) :: encoded + + if(nmutants.ge.MAX_MUTANTS) return + nmutants=nmutants+1 + msg=' ' + msg=mutant + call clear_all_state('N0AAA','N0BBB') + encoded=pack77_result_from_api(msg) + if(.not.encoded%encoded) then + nreject=nreject+1 + return + endif + call assert_true('encoded gate rejected', encoded%status.ne.PACK77_STATUS_INTERNAL_ROUNDTRIP_REJECTED) + decoded=' ' + ok=.false. + call unpack77(encoded%c77,0,decoded,ok) + if(.not.ok) then + write(*,'(a,a,a,a,a)') 'silent rewrite: input="', trim(msg), & + '" c77="', trim(encoded%c77), '"' + error stop 1 + endif + is_exact=normalized_equal(msg,decoded) + is_canonical=canonical_match(msg,decoded) + is_telemetry=telemetry_match(msg,decoded) + if(.not.is_exact .and. .not.is_canonical .and. .not.is_telemetry) then + write(*,'(a,a,a,a,a,a,a)') 'silent rewrite: input="', trim(msg), & + '" decoded="', trim(decoded), '" c77="', trim(encoded%c77), '"' + error stop 1 + endif + if(is_exact) then + nexact=nexact+1 + else if(is_telemetry) then + ncanon=ncanon+1 + else + call assert_true('canonical mutation decode', is_canonical) + ncanon=ncanon+1 + endif + end subroutine check_mutant + +end program test_packjt77_mutation_sweep diff --git a/tests/unit/packjt77/test_packjt77_pack28_sweep.f90 b/tests/unit/packjt77/test_packjt77_pack28_sweep.f90 new file mode 100644 index 00000000..66433692 --- /dev/null +++ b/tests/unit/packjt77/test_packjt77_pack28_sweep.f90 @@ -0,0 +1,231 @@ +program test_packjt77_pack28_sweep + + use packjt77 + use packjt77_grammar, only: PACK77_NTOKENS,PACK77_MAX22 + implicit none + + integer, parameter :: ncat=20 + integer, parameter :: nsweep=260 + integer, parameter :: expected_n28(nsweep) = (/ & + 5950126, 5950126, 5121162, 5121162, 3532835, 5950126, 5950126, & + 5950126, 2063592, 5950126, 4386540, 3225066, 3225066, 3959688, & + 5121162, 5002078, 5002078, 3532835, 5950126, 4907736, 4396757, & + 4636842, 3214849, 5375614, 6173770, 4396757, 4396757, 4396757, & + 2063592, 4396757, 4993936, 2, 2, 0, 3454934, & + 4168964, 4776360, 4253090, 4636842, 5755217, 8246608, 86387389, & + 11395888, 204642853, 22417639, 84419089, 8246608, 8246608, 2063592, & + 8246608, 194269912, 2195446, 2195446, 2111640, 1, 2913946, & + 3521341, 4940621, 86387389, 10214908, 8246635, 86388118, 11395915, & + 204661807, 22418368, 84419818, 4873537, 5750231, 2063592, 5750231, & + 6256420, 5239844, 1023, 4175765, 3318227, 2338993, 5010514, & + 2065856, 86388118, 10214962, 8246636, 86388145, 11395916, 204662509, & + 22418395, 84419872, 5574985, 2257374, 2063592, 2257374, 3991096, & + 5415206, 1548, 6216860, 5359321, 4380087, 4372313, 2416579, & + 86388172, 10214965, 6022918, 86388146, 5193953, 204662535, 22418396, & + 84419875, 3165162, 4041856, 2363507, 4041856, 5686611, 126, & + 15737, 2959280, 2101742, 6164569, 3835940, 4156578, 86388175, & + 4447486, 2074017, 3976499, 5439357, 4585084, 5513427, 2444633, & + 3432875, 4309569, 2063592, 4309569, 5932014, 4857335, 398841, & + 3204683, 2347145, 2260287, 4594460, 4335053, 4845483, 5206005, & + 2080475, 3982957, 5445815, 4591542, 5519885, 2464594, 3439920, & + 4316614, 2063592, 4316614, 5951388, 4863793, 2695765, 3211141, & + 2353603, 2280248, 4614421, 4340337, 4865444, 5225967, 2080645, & + 3983127, 5445985, 4591712, 5520055, 2465120, 3440106, 4316799, & + 2063592, 4316799, 5951558, 4863963, 2695935, 3211311, 2353773, & + 2280774, 4614946, 4340491, 4865970, 5226492, 2080650, 3983132, & + 5445989, 4591716, 5520059, 2465134, 3440111, 4316804, 2063592, & + 4316804, 5951563, 4863968, 2695939, 3211316, 2353778, 2280788, & + 4614960, 4340492, 4865984, 5226506, 2080650, 3983132, 5445989, & + 4591716, 5520059, 2465134, 3440111, 4316804, 2063592, 4316804, & + 5951563, 4863968, 2695940, 3211316, 2353778, 2280788, 4614960, & + 4340492, 4865984, 5226506, 2080650, 3983132, 5445989, 4591716, & + 5520059, 2465134, 3440111, 4316804, 2063592, 4316804, 5951563, & + 4863968, 2695940, 3211316, 2353778, 2280788, 4614960, 4340492, & + 4865984, 5226506, 2080650, 3983132, 5445989, 4591716, 5520059, & + 2465134, 3440111, 4316804, 2063592, 4316804, 5951563, 4863968, & + 2695940, 3211316, 2353778, 2280788, 4614960, 4340492, 4865984, & + 5226506 /) + integer :: i,n28 + character(len=13) :: decoded, token + logical :: ok + + call check_cq_modifier_edges() + + do i=1,nsweep + token=sweep_token(i) + call pack28(token,n28) + if(n28.ne.expected_n28(i)) then + write(*,1000) i, trim(token), expected_n28(i), n28 +1000 format('pack28 sweep case ',i0,' "',a,'" expected ',i0,' got ',i0) + error stop 1 + endif + decoded=' ' + ok=.false. + call unpack28(n28,decoded,ok) + enddo + + print '(a,i0,a)', 'test_packjt77_pack28_sweep: ', nsweep, ' checks passed' + +contains + + character(len=13) function sweep_token(i) result(token) + integer, intent(in) :: i + integer :: category,n + + category=mod(i-1,ncat)+1 + n=(i-1)/ncat+1 + token=' ' + select case(category) + case(1) + if(n.lt.3) then + token=take_prefix('AAAAAAAAAAAAA',n) + else + token=take_prefix('A1AAAAAAAAAAA',n) + endif + case(2) + token=take_prefix('AB1AAAAAAAAAA',n) + case(3) + if(n.lt.3) then + token=take_prefix('QQQQQQQQQQQQQ',n) + else + token=take_prefix('Q1AAAAAAAAAAA',n) + endif + case(4) + token=take_prefix('QZ9ZZZAAAAAAA',n) + case(5) + token=take_prefix('1A1AAAAAAAAAA',n) + case(6) + if(n.lt.3) then + token=take_prefix('AAAAAAAAAAAAA',n) + else + token=take_prefix('A11ABCXXXXXXX',n) + endif + case(7) + if(n.lt.3) then + token=take_prefix('AAAAAAAAAAAAA',n) + else + token=take_prefix('A1A/BBBBBBBBB',n) + endif + case(8) + if(n.lt.3) then + token=take_prefix('AAAAAAAAAAAAA',n) + else + token=take_prefix('A1A$BBBBBBBBB',n) + endif + case(9) + token=take_prefix('AAAAAAA',n) + case(10) + if(n.lt.3) then + token=take_prefix('AAAAAAAAAAAAA',n) + else + token=take_prefix('A1A>BBBBBBBBB',n) + endif + case(11) + token=take_prefix('PJ2/W1AWAAAAA',n) + case(12) + token=take_prefix('CQ_123AAAAAAA',n) + case(13) + token=take_prefix('CQ_TESTAAAAAA',n) + case(14) + token=take_prefix('DEAAAAAAAAAAA',n) + case(15) + token=take_prefix('QRZAAAAAAAAAA',n) + case(16) + token=take_prefix('3DA0ABCXXXXXX',n) + case(17) + token=take_prefix('3XABCXXXXXXXX',n) + case(18) + token=take_prefix('1234567890123',n) + case(19) + token=take_prefix('AB1ABCXXXXXXX',n) + case(20) + if(n.lt.3) then + token=take_prefix('KKKKKKKKKKKKK',n) + else + token=take_prefix('K1ABCXXXXXXXX',n) + endif + end select + end function sweep_token + + character(len=13) function take_prefix(seed,n) result(token) + character(len=*), intent(in) :: seed + integer, intent(in) :: n + + token=' ' + token(1:n)=seed(1:n) + end function take_prefix + + subroutine check_cq_modifier_edges() + call assert_cq_modifier_special('CQ_A') + call assert_cq_modifier_special('CQ_AB') + call assert_cq_modifier_special('CQ_ABC') + call assert_cq_modifier_special('CQ_ABCD') + call assert_cq_modifier_special('CQ_000') + call assert_cq_modifier_special('CQ_123') + call assert_cq_modifier_special('CQ_999') + + call assert_cq_modifier_hash('CQ_') + call assert_cq_modifier_hash('CQ_1') + call assert_cq_modifier_hash('CQ_12') + call assert_cq_modifier_hash('CQ_1234') + call assert_cq_modifier_hash('CQ_ABCDE') + call assert_cq_modifier_hash('CQ_A1') + call assert_cq_modifier_hash('CQ_1A') + call assert_cq_modifier_hash('CQ_AB12') + call assert_cq_modifier_hash('CQ_A/B') + call assert_cq_modifier_hash('CQ_A-B') + end subroutine check_cq_modifier_edges + + subroutine assert_cq_modifier_special(input) + character(len=*), intent(in) :: input + character(len=13) :: c13 + integer :: got + + call clear_hash_state() + c13=' ' + c13=input + call pack28(c13,got) + if(got.lt.3 .or. got.ge.PACK77_NTOKENS) then + write(*,1010) trim(input), got +1010 format('CQ modifier "',a,'" expected special token, got ',i0) + error stop 1 + endif + if(nzhash.ne.0) then + write(*,1011) trim(input), nzhash +1011 format('CQ modifier "',a,'" unexpectedly staged ',i0,' hashes') + error stop 1 + endif + end subroutine assert_cq_modifier_special + + subroutine assert_cq_modifier_hash(input) + character(len=*), intent(in) :: input + character(len=13) :: c13 + integer :: got + + call clear_hash_state() + c13=' ' + c13=input + call pack28(c13,got) + if(got.lt.PACK77_NTOKENS .or. got.ge.PACK77_NTOKENS+PACK77_MAX22) then + write(*,1020) trim(input), got +1020 format('CQ modifier "',a,'" expected hash token, got ',i0) + error stop 1 + endif + if(nzhash.ne.1 .or. calls22(1).ne.c13) then + write(*,1021) trim(input), nzhash, trim(calls22(1)) +1021 format('CQ modifier "',a,'" expected one committed hash, got nzhash=', & + i0,' calls22(1)="',a,'"') + error stop 1 + endif + end subroutine assert_cq_modifier_hash + + subroutine clear_hash_state() + calls10='' + calls12='' + calls22='' + recent_calls='' + ihash22=-1 + nzhash=0 + end subroutine clear_hash_state + +end program test_packjt77_pack28_sweep diff --git a/tests/unit/packjt77/test_packjt77_protocol_vectors.f90 b/tests/unit/packjt77/test_packjt77_protocol_vectors.f90 new file mode 100644 index 00000000..70930127 --- /dev/null +++ b/tests/unit/packjt77/test_packjt77_protocol_vectors.f90 @@ -0,0 +1,228 @@ +program test_packjt77_protocol_vectors + + use packjt77 + use packjt77_test_helpers + implicit none + + integer :: ntests + + ntests=0 + + call expect_hash_vector('K1ABC', 712, 2851, 2920267) + call expect_hash_vector('W9XYZ', 972, 3889, 3982604) + call expect_hash_vector('PJ4/K1ABC', 346, 1387, 1420834) + call expect_hash_vector('KH1/KH7Z', 201, 806, 825805) + call expect_hash_vector('K1JT/P', 959, 3839, 3931158) + call expect_hash_vector('W3CCX', 665, 2662, 2726483) + call expect_hash_vector('3DA0ABC', 48, 192, 196695) + call expect_hash_vector('3XABC', 563, 2254, 2308721) + call expect_hash_vector('///////////', 671, 2685, 2749801) + call expect_hash_vector('ZZZZZZZZZZZ', 902, 3609, 3695718) + call expect_hash_vector('99999999999', 762, 3050, 3123740) + call expect_hash_vector('A23456789Z/', 122, 488, 499902) + call expect_hash_vector(' ', 0, 0, 0) + + call expect_pack_bits('K1ABC W9XYZ FN42', 1, 0, -1, -1, & + '00001001101111011110001101010000011000010100100111011100000010100001100110001') + call expect_pack_bits(' W9XYZ RR73', 1, 0, -1, -1, & + '00000011010100101011000010100000011000010100100111011100000111111001110101001') + call expect_pack_bits('K1ABC RR73; W9XYZ -12', 0, 1, -1, -1, & + '00001001101111011110001101010000110000101001001110111000001100100101001001000') + call expect_pack_bits('PJ2/W1AW RR73', 4, 0, -1, -1, & + '00100100001100000000000000001011000010101110000110010100011010110100111100100') + call expect_pack_bits(' 592047 RR99XX', 5, 0, -1, -1, & + '10100110011011101111111100000101100111111111111111000111001100001111111111101') + call expect_pack_bits('K1ABC FN42 37', 0, 6, -1, -1, & + '00001001101111011110001101010101000011001100101100000000000000000000000110000') + ! WSPR Type 2 prefix/suffix vectors need both exact bits and decoded text. + call expect_pack_bits('PJ2/K1ABC 37', 0, 6, -1, -1, & + '00001001101111011110001101011000000100111110010111000000000000000000000110000', & + 'PJ2/K1ABC 37') + call expect_pack_bits(' FK52AB', 0, 6, 0, 6, & + '01010110101110001000100010111111101110100000101010000000000000000000000110000') + + call expect_unified_codec_bits('K1ABC W9XYZ FN42', -1, -1) + call expect_unified_codec_bits('FREE TEXT MSG', -1, -1) + call expect_unified_codec_bits('WA9XYZ KA1ABC R 16A EMA', -1, -1) + call expect_unified_codec_bits('WA9XYZ KA1ABC R 32A EMA', -1, -1) + call expect_unified_codec_bits('TU; W9XYZ G8ABC R 559 0013', -1, -1) + call expect_unified_codec_bits('K1ABC RR73; W9XYZ -12', -1, -1) + call expect_unified_codec_bits(' W9XYZ RR73', -1, -1) + call expect_unified_codec_bits('PJ2/W1AW RR73', -1, -1) + call expect_unified_codec_bits(' 592047 RR99XX', -1, -1) + call expect_unified_codec_bits('K1ABC FN42 37', -1, -1) + call expect_unified_codec_bits(' FK52AB', 0, 6) + + call expect_binary_payload_for_wspr_message('PJ4/K1ABC 37') + call expect_not_wspr_payload('K1ABC/ABCD 37') + + write(*,1000) ntests +1000 format('packjt77 protocol vector tests passed: ',i0) + +contains + + subroutine expect_hash_vector(callsign,want10,want12,want22) + character(len=*), intent(in) :: callsign + integer, intent(in) :: want10, want12, want22 + character(len=13) :: c13 + integer :: got10, got12, got22 + + c13=' ' + c13=callsign + got10=ihashcall(c13,10) + got12=ihashcall(c13,12) + got22=ihashcall(c13,22) + if(got10.ne.want10 .or. got12.ne.want12 .or. got22.ne.want22) then + write(*,1010) trim(callsign), got10, got12, got22, want10, want12, want22 +1010 format('Hash vector failure for "',a,'"; got ',i0,1x,i0,1x,i0, & + ' wanted ',i0,1x,i0,1x,i0) + error stop 1 + endif + + if(got10.lt.0 .or. got10.gt.1023 .or. got12.lt.0 .or. got12.gt.4095 .or. & + got22.lt.0 .or. got22.gt.4194303) then + write(*,1040) trim(callsign), got10, got12, got22 +1040 format('Hash range failure for "',a,'"; got ',i0,1x,i0,1x,i0) + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_hash_vector + + subroutine expect_pack_bits(input,want_i3,want_n3,pack_i3,pack_n3,expected_c77, & + expected_decode) + character(len=*), intent(in) :: input, expected_c77 + character(len=*), intent(in), optional :: expected_decode + integer, intent(in) :: want_i3, want_n3, pack_i3, pack_n3 + character(len=77) :: c77 + character(len=37) :: decoded + integer :: got_i3, got_n3 + logical :: ok + + call pack_standard(input,pack_i3,pack_n3,got_i3,got_n3,c77) + call assert_message_type('pack77',input,want_i3,want_n3,got_i3,got_n3) + call assert_binary_payload('pack77',input,c77) + if(c77.ne.expected_c77) then + write(*,1030) trim(input), c77, expected_c77 +1030 format('77-bit vector failure for "',a,'"; got ',a,' wanted ',a) + error stop 1 + endif + + if(present(expected_decode)) then + call reset_packjt77_state() + decoded=' ' + ok=.false. + call unpack77(c77,0,decoded,ok) + call assert_decode('pack77 vector',input,expected_decode,decoded,ok) + endif + + ntests=ntests+1 + end subroutine expect_pack_bits + + subroutine expect_unified_codec_bits(input,pack_i3,pack_n3) + character(len=*), intent(in) :: input + integer, intent(in) :: pack_i3, pack_n3 + character(len=77) :: first_c77, second_c77 + integer :: first_i3, first_n3, second_i3, second_n3 + + call pack_standard(input,pack_i3,pack_n3,first_i3,first_n3,first_c77) + call pack_standard(input,pack_i3,pack_n3,second_i3,second_n3,second_c77) + if(first_i3.ne.second_i3 .or. first_n3.ne.second_n3) then + write(*,1040) trim(input), first_i3, first_n3, second_i3, second_n3 +1040 format('Unified codec type failure for "',a,'"; first pack77 got ',i0,'.',i0, & + ' second pack77 got ',i0,'.',i0) + error stop 1 + endif + call assert_binary_payload('pack77',input,first_c77) + call assert_binary_payload('pack77',input,second_c77) + if(first_c77.ne.second_c77) then + write(*,1050) trim(input), first_c77, second_c77 +1050 format('Unified codec bit failure for "',a,'"; first pack77 ',a, & + ' second pack77 ',a) + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_unified_codec_bits + + subroutine expect_binary_payload_for_wspr_message(input) + character(len=*), intent(in) :: input + character(len=77) :: c77 + character(len=37) :: packed_input + integer :: got_i3, got_n3 + + packed_input=' ' + packed_input=input + call reset_packjt77_state() + + got_i3=-1 + got_n3=-1 + c77='' + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(packed_input) + call assert_pack77_result('pack77',packed_input,encoded) + got_i3=encoded%i3 + got_n3=encoded%n3 + c77=encoded%c77 + end block + call assert_message_type('pack77',input,0,6,got_i3,got_n3) + call assert_binary_payload('pack77',input,c77) + + ntests=ntests+1 + end subroutine expect_binary_payload_for_wspr_message + + subroutine expect_not_wspr_payload(input) + character(len=*), intent(in) :: input + character(len=37) :: packed_input + type(pack77_result) :: encoded + + packed_input=' ' + packed_input=input + call reset_packjt77_state() + + encoded=pack77_result_from_api(packed_input) + if(encoded%encoded .and. encoded%i3.eq.0 .and. encoded%n3.eq.6) then + write(*,1060) trim(input) +1060 format('WSPR reject failure for "',a,'"; still packed as 0.6') + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_not_wspr_payload + + subroutine pack_standard(input,pack_i3,pack_n3,got_i3,got_n3,c77) + character(len=*), intent(in) :: input + integer, intent(in) :: pack_i3, pack_n3 + integer, intent(out) :: got_i3, got_n3 + character(len=77), intent(out) :: c77 + character(len=37) :: packed_input + + packed_input=' ' + packed_input=input + call reset_packjt77_state() + got_i3=pack_i3 + got_n3=pack_n3 + c77='' + block + type(pack77_result) :: encoded + encoded=pack77_with_hint(packed_input,pack_i3,pack_n3) + call assert_pack77_result('pack77',packed_input,encoded) + call assert_true('pack77 gate not rejected',encoded%status.ne.PACK77_STATUS_INTERNAL_ROUNDTRIP_REJECTED) + got_i3=encoded%i3 + got_n3=encoded%n3 + c77=encoded%c77 + end block + end subroutine pack_standard + + subroutine reset_packjt77_state() + integer :: n10, n12, n22 + + call clear_all_state('N0AAA','N0BBB') + call save_hash_call(mycall13,hashmy10_configured,hashmy12_configured,hashmy22_configured) + hashdx10_configured=ihashcall(dxcall13,10) + call save_hash_call(dxcall13,n10,n12,n22) + call queue_hash_call_for_thread(dxcall13,1) + end subroutine reset_packjt77_state + +end program test_packjt77_protocol_vectors diff --git a/tests/unit/packjt77/test_packjt77_schema_decoder.f90 b/tests/unit/packjt77/test_packjt77_schema_decoder.f90 new file mode 100644 index 00000000..7c9816f5 --- /dev/null +++ b/tests/unit/packjt77/test_packjt77_schema_decoder.f90 @@ -0,0 +1,205 @@ +program test_packjt77_schema_decoder + + use packjt77_schema + use packjt77 + use packjt77_test_helpers + implicit none + + integer :: ntests + + ntests=0 + + call expect_type1_exact_fields() + call expect_type2_tag_decode() + call expect_invalid_binary_and_tag_fail() + call expect_type1_grid_boundary() + call expect_wspr_selector_padding_and_power_checks() + call expect_type5_grid_range_check() + call expect_type5_raw_invalid_serial_rejected() + call expect_failure_has_no_shared_state_side_effects() + + write(*,1000) ntests +1000 format('packjt77 schema decoder tests passed: ',i0) + +contains + + subroutine expect_type1_exact_fields() + character(len=77) :: c77 + type(pack77_type12_fields) :: fields + integer :: i3,n3 + logical :: ok + + c77='00001001101111011110001101010000011000010100100111011100000010100001100110001' + + call decode_pack77_tag(c77,i3,n3,ok) + call assert_true('Type 1 tag decode',ok) + call assert_int('Type 1 i3',1,i3) + call assert_int('Type 1 n3',0,n3) + + call decode_pack77_type1(c77,fields,ok) + call assert_true('Type 1 field decode',ok) + call assert_int('Type 1 n28a',10214965,fields%n28a) + call assert_int('Type 1 ipa',0,fields%ipa) + call assert_int('Type 1 n28b',12751800,fields%n28b) + call assert_int('Type 1 ipb',0,fields%ipb) + call assert_int('Type 1 ir',0,fields%ir) + call assert_int('Type 1 igrid4',10342,fields%igrid4) + + ntests=ntests+1 + end subroutine expect_type1_exact_fields + + subroutine expect_type2_tag_decode() + character(len=77) :: c77 + type(pack77_type12_fields) :: fields + integer :: i3,n3 + logical :: ok + + c77='00001001101111011110001101010000011000010100100111011100000010100001100110010' + + call decode_pack77_tag(c77,i3,n3,ok) + call assert_true('Type 2 tag decode',ok) + call assert_int('Type 2 i3',2,i3) + call assert_int('Type 2 n3',0,n3) + call decode_pack77_type2(c77,fields,ok) + call assert_true('Type 2 field decode',ok) + call assert_int('Type 2 n28a',10214965,fields%n28a) + call assert_int('Type 2 igrid4',10342,fields%igrid4) + + ntests=ntests+1 + end subroutine expect_type2_tag_decode + + subroutine expect_invalid_binary_and_tag_fail() + character(len=77) :: c77 + type(pack77_type12_fields) :: fields + integer :: i3,n3 + logical :: ok + + c77='00001001101111011110001101010000011000010100100111011100000010100001100110001' + c77(10:10)='x' + call decode_pack77_tag(c77,i3,n3,ok) + call assert_true('non-binary tag rejected',.not.ok) + + c77='00001001101111011110001101010000011000010100100111011100000010100001100110001' + c77(75:77)='010' + call decode_pack77_type1(c77,fields,ok) + call assert_true('wrong fixed i3 rejected',.not.ok) + + ntests=ntests+1 + end subroutine expect_invalid_binary_and_tag_fail + + subroutine expect_type1_grid_boundary() + character(len=37) :: input, decoded + character(len=77) :: c77 + logical :: ok + + input='K1ABC W9XYZ FN42' + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(input) + call assert_pack77_result('pack77',input,encoded) + call assert_int('Type 1 boundary i3',1,encoded%i3) + call assert_int('Type 1 boundary n3',0,encoded%n3) + c77=encoded%c77 + end block + + write(c77(60:74),'(b15.15)') 32399 + decoded=' ' + ok=.false. + call unpack77_configured(c77,0,decoded,ok, & + unpack77_options(record_hashes=.false.,record_recent_calls=.false.)) + call assert_true('Type 1 grid boundary succeeds',ok) + call assert_text_equal('Type 1 grid boundary decode', & + 'K1ABC W9XYZ RR99',decoded) + + write(c77(60:74),'(b15.15)') 32400 + decoded=' ' + ok=.true. + call unpack77_configured(c77,0,decoded,ok, & + unpack77_options(record_hashes=.false.,record_recent_calls=.false.)) + call assert_true('Type 1 invalid grid boundary fails',.not.ok) + + ntests=ntests+1 + end subroutine expect_type1_grid_boundary + + subroutine expect_wspr_selector_padding_and_power_checks() + character(len=77) :: c77 + type(pack77_wspr_type1_fields) :: type1_fields + type(pack77_wspr_type3_fields) :: type3_fields + logical :: ok + + c77=repeat('0',77) + c77(72:77)='110000' + c77(48:50)='110' + call decode_pack77_wspr_type1(c77,type1_fields,ok) + call assert_true('invalid WSPR Type 1 selector rejected',.not.ok) + call decode_pack77_wspr_type3(c77,type3_fields,ok) + call assert_true('invalid WSPR Type 3 selector rejected',.not.ok) + + c77=repeat('0',77) + c77(72:77)='110000' + c77(48:50)='010' + c77(51:51)='1' + call decode_pack77_wspr_type3(c77,type3_fields,ok) + call assert_true('nonzero WSPR padding rejected',.not.ok) + + c77=repeat('0',77) + c77(44:48)='11111' + c77(49:50)='00' + c77(72:77)='110000' + call decode_pack77_wspr_type1(c77,type1_fields,ok) + call assert_true('invalid WSPR raw power rejected',.not.ok) + + ntests=ntests+1 + end subroutine expect_wspr_selector_padding_and_power_checks + + subroutine expect_type5_grid_range_check() + character(len=77) :: c77 + type(pack77_type5_fields) :: fields + logical :: ok + + c77=repeat('0',77) + c77(50:74)=repeat('1',25) + c77(75:77)='101' + call decode_pack77_type5(c77,fields,ok) + call assert_true('Type 5 invalid grid rejected',.not.ok) + + ntests=ntests+1 + end subroutine expect_type5_grid_range_check + + subroutine expect_type5_raw_invalid_serial_rejected() + character(len=77) :: c77 + character(len=37) :: decoded + logical :: ok, unpack_ok + + call encode_pack77_type5(0,0,0,0,1,0,c77,ok) + call assert_true('Type 5 raw serial one encoded',ok) + write(c77(39:49),'(b11.11)') 0 + + decoded=' ' + unpack_ok=.true. + call unpack77(c77,0,decoded,unpack_ok) + call assert_true('Type 5 raw serial zero rejected',.not.unpack_ok) + + ntests=ntests+1 + end subroutine expect_type5_raw_invalid_serial_rejected + + subroutine expect_failure_has_no_shared_state_side_effects() + character(len=77) :: c77 + type(pack77_wspr_type3_fields) :: fields + logical :: ok + + call clear_all_state('','') + c77=repeat('0',77) + c77(48:50)='010' + c77(51:51)='1' + c77(72:77)='110000' + + call decode_pack77_wspr_type3(c77,fields,ok) + + call assert_true('schema decode failure rejected',.not.ok) + call assert_shared_hash_tables_empty('decoder failure') + + ntests=ntests+1 + end subroutine expect_failure_has_no_shared_state_side_effects + +end program test_packjt77_schema_decoder diff --git a/tests/unit/packjt77/test_packjt77_schema_encoder.f90 b/tests/unit/packjt77/test_packjt77_schema_encoder.f90 new file mode 100644 index 00000000..439f5e76 --- /dev/null +++ b/tests/unit/packjt77/test_packjt77_schema_encoder.f90 @@ -0,0 +1,99 @@ +program test_packjt77_schema_encoder + + use packjt77_schema + use packjt77_test_helpers + implicit none + + integer :: ntests + + ntests=0 + + call expect_type1_exact_bits() + call expect_type2_tag_bits() + call expect_range_failures() + call expect_bitstring_validation() + call expect_failure_has_no_shared_state_side_effects() + + write(*,1000) ntests +1000 format('packjt77 schema encoder tests passed: ',i0) + +contains + + subroutine expect_type1_exact_bits() + character(len=77) :: c77 + logical :: ok + + call encode_pack77_type1(10214965,0,12751800,0,0,10342,c77,ok) + + call assert_true('Type 1 schema encode',ok) + call assert_binary_payload('Type 1 schema','K1ABC W9XYZ FN42',c77) + call assert_text_equal('Type 1 c77',c77, & + '00001001101111011110001101010000011000010100100111011100000010100001100110001') + call assert_text_equal('Type 1 i3 bits',c77(75:77),'001') + ntests=ntests+1 + end subroutine expect_type1_exact_bits + + subroutine expect_type2_tag_bits() + character(len=77) :: c77 + logical :: ok + + call encode_pack77_type2(10214965,0,12751800,0,0,10342,c77,ok) + + call assert_true('Type 2 schema encode',ok) + call assert_binary_payload('Type 2 schema','tag-only portable layout',c77) + call assert_text_equal('Type 2 c77',c77, & + '00001001101111011110001101010000011000010100100111011100000010100001100110010') + call assert_text_equal('Type 2 i3 bits',c77(75:77),'010') + ntests=ntests+1 + end subroutine expect_type2_tag_bits + + subroutine expect_range_failures() + character(len=77) :: c77 + logical :: ok + + call encode_pack77_type1(-1,0,12751800,0,0,10342,c77,ok) + call assert_true('negative field rejected',.not.ok) + + call encode_pack77_type1(10214965,0,12751800,0,0,32768,c77,ok) + call assert_true('too-wide field rejected',.not.ok) + + call encode_pack77_type5(0,0,0,0,0,0,c77,ok) + call assert_true('Type 5 serial zero rejected',.not.ok) + + ntests=ntests+1 + end subroutine expect_range_failures + + subroutine expect_bitstring_validation() + character(len=77) :: c77 + logical :: ok + + call encode_pack77_free_text(repeat('1',71),c77,ok) + call assert_true('free-text bitstring accepted',ok) + call assert_text_equal('free-text tag bits',c77(72:77),'000000') + + call encode_pack77_free_text(repeat('1',70),c77,ok) + call assert_true('short bitstring rejected',.not.ok) + + call encode_pack77_free_text(repeat('1',72),c77,ok) + call assert_true('long bitstring rejected',.not.ok) + + call encode_pack77_free_text(repeat('1',70)//'X',c77,ok) + call assert_true('non-binary bitstring rejected',.not.ok) + + ntests=ntests+1 + end subroutine expect_bitstring_validation + + subroutine expect_failure_has_no_shared_state_side_effects() + character(len=77) :: c77 + logical :: ok + + call clear_all_state('','') + call encode_pack77_type1(10214965,0,12751800,0,0,32768,c77,ok) + + call assert_true('side-effect failure rejected',.not.ok) + call assert_shared_hash_tables_empty('schema failure') + + ntests=ntests+1 + end subroutine expect_failure_has_no_shared_state_side_effects + +end program test_packjt77_schema_encoder diff --git a/tests/unit/packjt77/test_packjt77_silent_rewrite_corpus.f90 b/tests/unit/packjt77/test_packjt77_silent_rewrite_corpus.f90 new file mode 100644 index 00000000..0fb12d82 --- /dev/null +++ b/tests/unit/packjt77/test_packjt77_silent_rewrite_corpus.f90 @@ -0,0 +1,206 @@ +program test_packjt77_silent_rewrite_corpus + + use packjt77 + implicit none + + integer, parameter :: max_line=256 + character(len=max_line) :: corpus_path, arg, line, input, origin + character(len=37) :: decoded + character(len=77) :: c77 + integer :: unit, ios, sep, i3, n3 + integer :: total, exact, canon, reject, silent + logical :: success, assert_zero + + total=0 + exact=0 + canon=0 + reject=0 + silent=0 + assert_zero=.false. + + corpus_path='tests/unit/packjt77/silent_rewrite_corpus.txt' + if(command_argument_count().ge.1) call get_command_argument(1,corpus_path) + if(command_argument_count().ge.2) then + call get_command_argument(2,arg) + assert_zero=trim(arg).eq.'--assert-zero-silent' + endif + + open(newunit=unit,file=trim(corpus_path),status='old',action='read',iostat=ios) + if(ios.ne.0) then + write(*,1000) trim(corpus_path), ios +1000 format('failed to open silent-rewrite corpus "',a,'": ',i0) + error stop 1 + endif + + do + read(unit,'(a)',iostat=ios) line + if(ios.ne.0) exit + if(len_trim(line).eq.0) cycle + sep=index(line,'|') + if(sep.le.0) cycle + input=' ' + origin=' ' + input=adjustl(line(1:sep-1)) + origin=adjustl(line(sep+1:)) + call classify_case(trim(input),trim(origin),exact,canon,reject,silent) + total=total+1 + enddo + close(unit) + + write(*,1010) total, exact, canon, reject, silent +1010 format('SILENT_REWRITE_SUMMARY total=',i0,' exact=',i0,' canon=',i0, & + ' reject=',i0,' silent_rewrite=',i0) + if(assert_zero .and. silent.ne.0) error stop 1 + + ! Self-contained on purpose: this driver must also compile against older + ! source snapshots where shared grammar/test helper APIs may not exist. +contains + + subroutine classify_case(input_msg,origin,exact,canon,reject,silent) + character(len=*), intent(in) :: input_msg, origin + integer, intent(inout) :: exact, canon, reject, silent + character(len=37) :: packed_input + character(len=16) :: class + + packed_input=' ' + packed_input=input_msg + call reset_hash_state() + call pack77(packed_input,i3,n3,c77) + success=i3.ge.0 + if(.not.success) then + reject=reject+1 + class='REJECT' + call print_case(input_msg,origin,.false.,i3,n3,' ',class) + return + endif + + decoded=' ' + success=.false. + call reset_hash_state() + call unpack77(c77,0,decoded,success) + if(.not.success) then + silent=silent+1 + class='SILENT_REWRITE' + call print_case(input_msg,origin,.true.,i3,n3,decoded,class) + return + endif + + if(normalized_equal(input_msg,decoded)) then + exact=exact+1 + class='EXACT' + else if(canonical_match(input_msg,decoded)) then + canon=canon+1 + class='CANON' + else + silent=silent+1 + class='SILENT_REWRITE' + endif + call print_case(input_msg,origin,.true.,i3,n3,decoded,class) + end subroutine classify_case + + subroutine print_case(input_msg,origin,encoded,i3,n3,decoded_msg,class) + character(len=*), intent(in) :: input_msg, origin, decoded_msg, class + logical, intent(in) :: encoded + integer, intent(in) :: i3, n3 + + write(*,1020) trim(input_msg), trim(origin), encoded, i3, n3, & + trim(decoded_msg), trim(class) +1020 format(a,' | ',a,' | encoded=',l1,' | type=',i0,'.',i0, & + ' | decoded=',a,' | ',a) + end subroutine print_case + + logical function normalized_equal(left,right) result(equal) + character(len=*), intent(in) :: left, right + character(len=37) :: left_norm, right_norm + + call normalize_message(left,left_norm) + call normalize_message(right,right_norm) + equal=trim(left_norm).eq.trim(right_norm) + end function normalized_equal + + logical function canonical_match(left,right) result(matches) + character(len=*), intent(in) :: left, right + character(len=37) :: left_tokens(19), right_tokens(19), wrapped + integer :: left_n, right_n, i + + matches=.false. + call split_tokens(left,left_tokens,left_n) + call split_tokens(right,right_tokens,right_n) + if(left_n.ne.right_n) return + do i=1,left_n + if(trim(left_tokens(i)).eq.trim(right_tokens(i))) cycle + wrapped=' ' + wrapped='<'//trim(left_tokens(i))//'>' + if(trim(right_tokens(i)).eq.trim(wrapped)) cycle + if(trim(right_tokens(i)).eq.'<...>' .and. hash_like(left_tokens(i))) cycle + return + enddo + matches=.true. + end function canonical_match + + logical function hash_like(token) result(ok) + character(len=*), intent(in) :: token + integer :: n + + n=len_trim(token) + ok=.false. + if(n.le.0) return + ok=index(token(1:n),'/').gt.0 + if(n.ge.2) ok=ok .or. (token(1:1).eq.'<' .and. token(n:n).eq.'>') + end function hash_like + + subroutine normalize_message(input_msg,normalized) + character(len=*), intent(in) :: input_msg + character(len=37), intent(out) :: normalized + character(len=37) :: tokens(19) + integer :: nwords, i + + normalized=' ' + call split_tokens(input_msg,tokens,nwords) + do i=1,nwords + if(len_trim(normalized).gt.0) normalized=trim(normalized)//' ' + normalized=trim(normalized)//trim(tokens(i)) + enddo + end subroutine normalize_message + + subroutine split_tokens(input_msg,tokens,nwords) + character(len=*), intent(in) :: input_msg + character(len=37), intent(out) :: tokens(19) + integer, intent(out) :: nwords + character(len=1) :: c, previous + integer :: i, n + + tokens=' ' + nwords=0 + n=0 + previous=' ' + do i=1,len_trim(input_msg) + c=input_msg(i:i) + if(ichar(c).eq.0) c=' ' + if(c.ge.'a' .and. c.le.'z') c=char(ichar(c)-32) + if(c.eq.' ' .and. previous.eq.' ') cycle + if(c.ne.' ' .and. previous.eq.' ') then + nwords=nwords+1 + n=0 + if(nwords.gt.size(tokens)) return + endif + if(c.ne.' ') then + n=n+1 + if(n.le.len(tokens(1))) tokens(nwords)(n:n)=c + endif + previous=c + enddo + end subroutine split_tokens + + subroutine reset_hash_state() + calls10='' + calls12='' + calls22='' + recent_calls='' + ihash22=-1 + nzhash=0 + mycall13=' ' + dxcall13=' ' + end subroutine reset_hash_state + +end program test_packjt77_silent_rewrite_corpus diff --git a/tests/unit/packjt77/test_packjt77sdvar_invariants.f90 b/tests/unit/packjt77/test_packjt77sdvar_invariants.f90 new file mode 100644 index 00000000..d0ffac93 --- /dev/null +++ b/tests/unit/packjt77/test_packjt77sdvar_invariants.f90 @@ -0,0 +1,234 @@ +program test_packjt77sdvar_invariants + + use packjt77 + use packjt77_test_helpers + use ft8_mod1, only : idtone56_valid,idtone56,itone56,msg,lastrxmsg,mycall, & + hiscall,nlasttx,csyncsd_valid,csyncsdcq_valid + implicit none + + integer :: ntests + external :: genft8sdvar + external :: ft8sdvar + external :: ft8svar + external :: tonesdvar + + ntests=0 + + call expect_genft8sdvar_accepts_type1_template() + call expect_genft8sdvar_requires_expanded_dx_macro() + call expect_genft8sdvar_rejects_free_text_template() + call expect_invalid_sd_template_is_not_scored() + call expect_ft8svar_last_grid_template_is_valid() + call expect_failed_qso_template_invalidates_sync() + call expect_failed_cq_template_invalidates_sync() + call expect_genft8sdvar_rejects_hash_call_without_recording_hashes() + + write(*,1000) ntests +1000 format('packjt77 unified SD-var invariant tests passed: ',i0) + +contains + + subroutine expect_genft8sdvar_accepts_type1_template() + character(len=37) :: input, msgsent + integer :: i3, n3 + integer :: itone(79) + integer*1 :: msgbits(77) + + input='K1ABC W9XYZ RR73' + msgsent=' ' + msgbits=0 + itone=0 + i3=-1 + n3=-1 + + call genft8sdvar(input,i3,n3,msgsent,msgbits,itone) + + call assert_int('sdvar Type 1 template i3',1,i3) + call assert_int('sdvar Type 1 template n3',0,n3) + call assert_text_equal('sdvar Type 1 template decode','K1ABC W9XYZ RR73',msgsent) + call assert_true('sdvar Type 1 template message bits',any(msgbits.ne.0)) + call assert_true('sdvar Type 1 template tones',any(itone.ne.0)) + + ntests=ntests+1 + end subroutine expect_genft8sdvar_accepts_type1_template + + subroutine expect_genft8sdvar_requires_expanded_dx_macro() + character(len=37) :: input, direct, msgsent + integer :: i3, n3 + integer :: itone(79) + integer*1 :: msgbits(77) + + input='$DX K1ABC FN42' + direct='W9XYZ K1ABC FN42' + msgsent=' ' + msgbits=0 + itone=0 + i3=-1 + n3=-1 + + call genft8sdvar(input,i3,n3,msgsent,msgbits,itone) + + call assert_int('sdvar unexpanded DX macro i3',-1,i3) + call assert_int('sdvar unexpanded DX macro n3',-1,n3) + call assert_text_equal('sdvar unexpanded DX macro message', & + '*** bad message ***',msgsent) + call assert_true('sdvar unexpanded DX macro message bits', & + all(msgbits.eq.0)) + call assert_true('sdvar unexpanded DX macro tones',all(itone.eq.0)) + + call genft8sdvar(direct,i3,n3,msgsent,msgbits,itone) + + call assert_int('sdvar pre-expanded DX macro i3',1,i3) + call assert_int('sdvar pre-expanded DX macro n3',0,n3) + call assert_text_equal('sdvar pre-expanded DX macro decode',direct, & + msgsent) + call assert_true('sdvar pre-expanded DX macro message bits', & + any(msgbits.ne.0)) + call assert_true('sdvar pre-expanded DX macro tones',any(itone.ne.0)) + + ntests=ntests+1 + end subroutine expect_genft8sdvar_requires_expanded_dx_macro + + subroutine expect_invalid_sd_template_is_not_scored() + real :: s8(0:7,79) + integer :: itone(79) + character(len=37) :: msgd + character(len=37) :: msg37 + logical(1) :: lft8sd, lcq + + msgd='CQ PJ4/K1ABC' + s8=0.0 + s8(0,:)=1.0 + itone=-1 + msg37='' + lft8sd=.false. + lcq=.true. + + call ft8sdvar(s8,0.0,itone,msgd,msg37,lft8sd,lcq) + + call assert_true('invalid SD template not scored',.not.logical(lft8sd)) + call assert_text_equal('invalid SD template message unchanged','',msg37) + + ntests=ntests+1 + end subroutine expect_invalid_sd_template_is_not_scored + + subroutine expect_ft8svar_last_grid_template_is_valid() + real :: s8(0:7,79) + integer :: itone(79) + character(len=37) :: decoded + logical(1) :: lft8s + + call clear_all_state('','') + + mycall='N0AAA' + hiscall='W9XYZ' + nlasttx=1 + msg(53)='N0AAA W9XYZ AA00' + lastrxmsg(1)%lstate=.true. + lastrxmsg(1)%lastmsg='N0AAA W9XYZ FN42' + idtone56(53,1:58)=0 + itone56(53,1:79)=0 + idtone56_valid(53)=.false. + s8=0.0 + itone=0 + decoded='' + lft8s=.false. + + call ft8svar(s8,0.0,itone,decoded,lft8s,1,.false.) + + call assert_true('ft8svar last grid row valid',logical(idtone56_valid(53))) + call assert_text_equal('ft8svar last grid message', & + 'N0AAA W9XYZ FN42',msg(53)) + call assert_true('ft8svar last grid tones',any(itone56(53,1:79).ne.0)) + + ntests=ntests+1 + end subroutine expect_ft8svar_last_grid_template_is_valid + + subroutine expect_failed_qso_template_invalidates_sync() + character(len=37) :: msgd + + csyncsd_valid=.true. + msgd=' W9XYZ -01' + + call tonesdvar(msgd,.false.) + + call assert_true('failed QSO template invalidates sync', & + .not.logical(csyncsd_valid)) + + ntests=ntests+1 + end subroutine expect_failed_qso_template_invalidates_sync + + subroutine expect_failed_cq_template_invalidates_sync() + character(len=37) :: msgd + + csyncsdcq_valid=.true. + msgd='CQ PJ4/K1ABC' + + call tonesdvar(msgd,.true.) + + call assert_true('failed CQ template invalidates sync', & + .not.logical(csyncsdcq_valid)) + + ntests=ntests+1 + end subroutine expect_failed_cq_template_invalidates_sync + + subroutine expect_genft8sdvar_rejects_free_text_template() + character(len=37) :: input, msgsent + integer :: i3, n3 + integer :: itone(79) + integer*1 :: msgbits(77) + + input='FREE TEXT MSG' + msgsent=' ' + msgbits=1 + itone=1 + i3=-1 + n3=-1 + + call genft8sdvar(input,i3,n3,msgsent,msgbits,itone) + + call assert_bad_sd_template('sdvar free-text template',i3,n3,msgsent,msgbits,itone) + + ntests=ntests+1 + end subroutine expect_genft8sdvar_rejects_free_text_template + + subroutine expect_genft8sdvar_rejects_hash_call_without_recording_hashes() + character(len=37) :: input, msgsent + integer :: i3, n3, itone(79) + integer*1 :: msgbits(77) + + call clear_all_state('','') + + input=' W9XYZ RR73' + msgsent=' ' + msgbits=0 + itone=0 + i3=-1 + n3=-1 + + call genft8sdvar(input,i3,n3,msgsent,msgbits,itone) + + call assert_bad_sd_template('sdvar hash-call template',i3,n3,msgsent,msgbits,itone) + call assert_int('sdvar generator does not record nzhash',0,nzhash) + call assert_true('sdvar generator leaves calls10 empty',all(calls10.eq.'')) + call assert_true('sdvar generator leaves calls12 empty',all(calls12.eq.'')) + call assert_true('sdvar generator leaves calls22 empty',all(calls22.eq.'')) + call assert_true('sdvar generator leaves ihash22 empty',all(ihash22.eq.-1)) + + ntests=ntests+1 + end subroutine expect_genft8sdvar_rejects_hash_call_without_recording_hashes + + subroutine assert_bad_sd_template(label,i3,n3,msgsent,msgbits,itone) + character(len=*), intent(in) :: label + integer, intent(in) :: i3, n3, itone(79) + integer*1, intent(in) :: msgbits(77) + character(len=37), intent(in) :: msgsent + + call assert_int(trim(label)//' rejected i3',-1,i3) + call assert_int(trim(label)//' rejected n3',-1,n3) + call assert_text_equal(trim(label)//' rejected message','*** bad message ***',msgsent) + call assert_true(trim(label)//' zero message bits',all(msgbits.eq.0)) + call assert_true(trim(label)//' zero tones',all(itone.eq.0)) + end subroutine assert_bad_sd_template + +end program test_packjt77sdvar_invariants diff --git a/tests/unit/packjt77/test_packjt77var_invariants.f90 b/tests/unit/packjt77/test_packjt77var_invariants.f90 new file mode 100644 index 00000000..a2395c9c --- /dev/null +++ b/tests/unit/packjt77/test_packjt77var_invariants.f90 @@ -0,0 +1,93 @@ +program test_packjt77var_invariants + + use packjt77 + use packjt77_test_helpers + implicit none + + integer :: ntests + external :: genft8var + + ntests=0 + + call expect_genft8var_rejects_unexpanded_dx_macro() + call expect_configured_var_rejects_unqualified_hash_only_message() + + write(*,1000) ntests +1000 format('packjt77var invariant tests passed: ',i0) + +contains + + subroutine expect_genft8var_rejects_unexpanded_dx_macro() + character(len=37) :: input, direct, msgsent + integer :: i3, n3 + integer :: itone(79) + integer*1 :: msgbits(77) + + input='$DX K1ABC FN42' + direct='W9XYZ K1ABC FN42' + msgsent=' ' + msgbits=0 + itone=0 + i3=-1 + n3=-1 + + call genft8var(input,i3,n3,0,msgsent,msgbits,itone) + + call assert_int('var unexpanded DX macro i3',-1,i3) + call assert_int('var unexpanded DX macro n3',-1,n3) + call assert_text_equal('var unexpanded DX macro message', & + '*** bad message ***',msgsent) + call assert_true('var unexpanded DX macro message bits', & + all(msgbits.eq.0)) + call assert_true('var unexpanded DX macro tones',all(itone.eq.0)) + + call genft8var(direct,i3,n3,0,msgsent,msgbits,itone) + + call assert_int('var pre-expanded DX macro i3',1,i3) + call assert_int('var pre-expanded DX macro n3',0,n3) + call assert_text_equal('var pre-expanded DX macro decode',direct,msgsent) + call assert_true('var pre-expanded DX macro message bits', & + any(msgbits.ne.0)) + call assert_true('var pre-expanded DX macro tones',any(itone.ne.0)) + + ntests=ntests+1 + end subroutine expect_genft8var_rejects_unexpanded_dx_macro + + subroutine expect_configured_var_rejects_unqualified_hash_only_message() + character(len=77) :: c77 + character(len=13) :: c13 + character(len=37) :: decoded, input + integer :: n10, n12, n22 + logical :: ok + + input='PJ2/W1AW ' + call reset_packjt77var_state('N0AAA', 'N0BBB') + block + type(pack77_result) :: encoded + encoded=pack77_result_from_api(input) + call assert_pack77_result('configured-var delta',input,encoded) + call assert_int('configured-var delta i3',4,encoded%i3) + call assert_int('configured-var delta n3',0,encoded%n3) + c77=encoded%c77 + end block + + call reset_packjt77var_state('N0AAA', 'N0BBB') + call normalize_call('W7ABC',c13) + n10=ihashcall(c13,10) + n12=ihashcall(c13,12) + n22=ihashcall(c13,22) + call save_hash_call(c13,n10,n12,n22) + + decoded=' ' + ok=.true. + call unpack77_configured(c77,0,decoded,ok,unpack77_options(thread_index=1)) + if(ok) then + write(*,1010) trim(decoded) +1010 format('Configured-var hash-only delta decoded as "',a,'"') + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_configured_var_rejects_unqualified_hash_only_message + +end program test_packjt77var_invariants diff --git a/tests/unit/q65/CMakeLists.txt b/tests/unit/q65/CMakeLists.txt new file mode 100644 index 00000000..698ea12d --- /dev/null +++ b/tests/unit/q65/CMakeLists.txt @@ -0,0 +1,35 @@ +add_executable (test_q65_workspace + test_q65_workspace.f90 + ${CMAKE_SOURCE_DIR}/lib/qra/q65/q65_workspace.f90) + +add_test (NAME test_q65_workspace COMMAND test_q65_workspace) + +add_executable (test_q65_source_encoding + test_q65_source_encoding.f90) +wsjt_link_common_fortran (test_q65_source_encoding) + +add_test (NAME test_q65_source_encoding COMMAND test_q65_source_encoding) + +add_executable (test_q65_decode_pipeline + q65_test_fixture.f90 + test_q65_decode_pipeline.f90) +set_source_files_properties (test_q65_decode_pipeline.f90 PROPERTIES + COMPILE_FLAGS "-Wno-unused-dummy-argument") +wsjt_link_common_fortran (test_q65_decode_pipeline) + +add_test (NAME test_q65_decode_pipeline COMMAND test_q65_decode_pipeline) +set_tests_properties (test_q65_decode_pipeline PROPERTIES + COST 10 + # Allow for hosted ARM emulation without leaving the test unbounded. + TIMEOUT 180) +if (WSJT_ENABLE_TSAN) + set_tests_properties (test_q65_decode_pipeline PROPERTIES + ENVIRONMENT "TSAN_OPTIONS=${wsjt_tsan_fortran_options}") +endif () + +add_executable (test_q65_llh_contracts + test_q65_llh_contracts.c) +target_include_directories (test_q65_llh_contracts PRIVATE + ${CMAKE_SOURCE_DIR}/lib/qra/q65) +target_link_libraries (test_q65_llh_contracts PRIVATE wsjt_cxx) +add_test (NAME test_q65_llh_contracts COMMAND test_q65_llh_contracts) diff --git a/tests/unit/q65/q65_test_fixture.f90 b/tests/unit/q65/q65_test_fixture.f90 new file mode 100644 index 00000000..9c3097b4 --- /dev/null +++ b/tests/unit/q65/q65_test_fixture.f90 @@ -0,0 +1,44 @@ +module q65_test_fixture + + use iso_fortran_env, only: int16 + implicit none + + integer, parameter :: q65_ntrperiod=60 + integer, parameter :: q65_nsamples=300*12000 + integer, parameter :: q65_nsymbols=85 + integer, parameter :: q65_tones(q65_nsymbols)=[ & + 0,3,28,56,36,21,7,6,0,10,56,0,0,1,0,41,26,35,54,33, & + 4,0,0,24,9,0,0,42,42,8,12,9,0,60,0,51,61,0,48,22, & + 22,10,46,60,20,0,5,3,4,0,11,41,23,5,0,54,47,56,1,0, & + 1,0,29,26,29,0,33,1,0,32,41,31,31,0,29,0,50,28,38,24, & + 33,30,41,10,0] + +contains + + subroutine make_q65_wave(iwave,nsubmode) + integer(int16), intent(out) :: iwave(:) + integer, intent(in) :: nsubmode + integer, parameter :: complex_rate=6000 + integer, parameter :: samples_per_symbol=3600 + integer, parameter :: leading_silence=complex_rate + real, parameter :: pi=3.14159265358979323846 + real, parameter :: amplitude=28000.0 + real :: phase,frequency,tone_spacing + integer :: symbol,sample,complex_sample + + iwave=0_int16 + phase=0.0 + tone_spacing=12000.0/7200.0*real(2**nsubmode) + do symbol=1,q65_nsymbols + frequency=1000.0+real(q65_tones(symbol))*tone_spacing + do sample=0,samples_per_symbol-1 + complex_sample=leading_silence+(symbol-1)*samples_per_symbol+sample + if(2*complex_sample+2.gt.size(iwave)) return + phase=phase+2.0*pi*frequency/real(complex_rate) + iwave(2*complex_sample+1)=int(nint(amplitude*cos(phase)),int16) + iwave(2*complex_sample+2)=int(nint(-amplitude*sin(phase)),int16) + enddo + enddo + end subroutine make_q65_wave + +end module q65_test_fixture diff --git a/tests/unit/q65/test_map65_polarization_score.f90 b/tests/unit/q65/test_map65_polarization_score.f90 new file mode 100644 index 00000000..9b4c1793 --- /dev/null +++ b/tests/unit/q65/test_map65_polarization_score.f90 @@ -0,0 +1,100 @@ +program test_map65_polarization_score + use iso_fortran_env, only: real64 + use map65_polarization_score_mod, only: generalized_polarization_score,polarization_matrix + implicit none + + real(real64), parameter :: pi=acos(-1.0_real64) + real(real64) :: angle,combine_angle,expected,g00,g01,g11,score + real(real64) :: projections(4),u0,u1 + logical :: valid + + projections=[3.0_real64,4.0_real64,5.0_real64,4.0_real64] + call polarization_matrix(projections,g00,g11,g01) + call assert_close(g00,3.0_real64,0.0_real64,'G00 reconstruction') + call assert_close(g11,5.0_real64,0.0_real64,'G11 reconstruction') + call assert_close(g01,0.0_real64,0.0_real64,'G01 reconstruction') + + call rank_one(22.5_real64,3.0_real64,g00,g11,g01) + call generalized_polarization_score(g00,g11,g01,1.0_real64,1.0_real64,0.0_real64, & + score,angle,combine_angle,valid) + if (.not.valid) error stop 'balanced background was rejected' + call assert_close(score,3.0_real64,1.0e-12_real64,'balanced rank-one score') + call assert_angle(angle,22.5_real64,1.0e-10_real64,'balanced physical angle') + call assert_angle(combine_angle,22.5_real64,1.0e-10_real64,'balanced combining angle') + expected=10.0_real64*log10(1.0_real64/cos(22.5_real64*pi/180.0_real64)**2) + call assert_close(expected,0.687693_real64,1.0e-6_real64,'worst-angle scalloping') + + call rank_one(30.0_real64,2.0_real64,g00,g11,g01) + call generalized_polarization_score(g00,g11,g01,4.0_real64,1.0_real64,0.0_real64, & + score,angle,combine_angle,valid) + u0=cos(30.0_real64*pi/180.0_real64) + u1=sin(30.0_real64*pi/180.0_real64) + expected=2.0_real64*(u0*u0/4.0_real64+u1*u1) + call assert_close(score,expected,1.0e-12_real64,'unequal-noise score') + call assert_angle(angle,30.0_real64,1.0e-10_real64,'unequal-noise physical angle') + call assert_angle(combine_angle,atan2(u1,u0/4.0_real64)*180.0_real64/pi, & + 1.0e-10_real64,'unequal-noise combining angle') + call rank_one(40.0_real64,1.7_real64,g00,g11,g01) + call generalized_polarization_score(g00,g11,g01,2.0_real64,3.0_real64,0.8_real64, & + score,angle,combine_angle,valid) + u0=cos(40.0_real64*pi/180.0_real64) + u1=sin(40.0_real64*pi/180.0_real64) + expected=1.7_real64*(3.0_real64*u0*u0-1.6_real64*u0*u1+2.0_real64*u1*u1)/5.36_real64 + call assert_close(score,expected,1.0e-12_real64,'correlated-noise score') + call assert_angle(angle,40.0_real64,1.0e-10_real64,'correlated-noise physical angle') + + call generalized_polarization_score(9.0_real64*g00,6.0_real64*g11, & + sqrt(54.0_real64)*g01,18.0_real64,18.0_real64,sqrt(54.0_real64)*0.8_real64, & + score,angle,combine_angle,valid) + call assert_close(score,expected,1.0e-11_real64,'receiver-gain invariance') + call assert_angle(angle,atan2(sqrt(6.0_real64)*u1,3.0_real64*u0)*180.0_real64/pi, & + 1.0e-10_real64,'receiver-gain physical angle') + + call generalized_polarization_score(g00,g11,g01,1.0_real64,1.0_real64,1.0_real64, & + score,angle,combine_angle,valid) + if (.not.valid) error stop 'singular background was rejected' + if (.not.(score >= 0.0_real64 .and. score < huge(score))) & + error stop 'regularized score was not finite' + + call generalized_polarization_score(g00,g11,g01,-1.0_real64,1.0_real64,0.0_real64, & + score,angle,combine_angle,valid) + if (valid) error stop 'invalid background was accepted' + + call generalized_polarization_score(g00,g11,g01,1.0_real64,1.0_real64,1.1_real64, & + score,angle,combine_angle,valid) + if (valid) error stop 'invalid background correlation was accepted' + +contains + + subroutine rank_one(degrees,amplitude,a00,a11,a01) + real(real64), intent(in) :: degrees,amplitude + real(real64), intent(out) :: a00,a11,a01 + real(real64) :: x,y + + x=cos(degrees*pi/180.0_real64) + y=sin(degrees*pi/180.0_real64) + a00=amplitude*x*x + a11=amplitude*y*y + a01=amplitude*x*y + end subroutine rank_one + + subroutine assert_close(actual,wanted,tolerance,label) + real(real64), intent(in) :: actual,wanted,tolerance + character(len=*), intent(in) :: label + + if (abs(actual-wanted) > tolerance) then + print '(a,2es24.15)', trim(label)//': ',actual,wanted + error stop 'numeric assertion failed' + endif + end subroutine assert_close + + subroutine assert_angle(actual,wanted,tolerance,label) + real(real64), intent(in) :: actual,wanted,tolerance + character(len=*), intent(in) :: label + real(real64) :: difference + + difference=abs(modulo(actual-wanted+90.0_real64,180.0_real64)-90.0_real64) + call assert_close(difference,0.0_real64,tolerance,label) + end subroutine assert_angle + +end program test_map65_polarization_score diff --git a/tests/unit/q65/test_map65_wideband_sync_rows.f90 b/tests/unit/q65/test_map65_wideband_sync_rows.f90 new file mode 100644 index 00000000..143f0c3a --- /dev/null +++ b/tests/unit/q65/test_map65_wideband_sync_rows.f90 @@ -0,0 +1,108 @@ +program test_map65_wideband_sync_rows + use wideband_sync, only: candidate,get_candidates,init_wideband_sync,outside_row_count,sync,wb_sync + use npar_ptrs_mod, only: nfft_active, nrate_active + implicit none + + integer, parameter :: jz=280, lag=11 + integer :: expanded_sync(22) + integer :: ia, ib, i, j, k, ncand, offset, peak(1), target_bin + real :: angle_error,ccf_before,df,response(4),xdt_before + real, allocatable :: savg(:,:), ss(:,:,:) + type(candidate) :: candidates(50) + logical :: found + + expanded_sync = [1,27,37,40,46,69,72,82,85,104,111,121,146,159,175,192, & + 198,211,221,237,243,272] + nrate_active=96000 + nfft_active=32768 + df=real(nrate_active)/real(nfft_active) + ia=nint(1000.0/df)+1 + ib=nint(2000.0/df)+1 + target_bin=(ia+ib)/2 + + allocate(ss(4,322,nfft_active),savg(4,nfft_active)) + ss=1.0 + savg=real(jz) + do i=ia,ib + do j=1,jz + ss(1,j,i)=1.0+0.001*real(mod(37*j+17*i,23)) + enddo + savg(1,i)=sum(ss(1,1:jz,i)) + enddo + + do j=1,size(expanded_sync) + k=expanded_sync(j)+lag + do offset=0,2 + if (k+offset <= jz) ss(1,k+offset,target_bin)= & + ss(1,k+offset,target_bin)+50.0 + enddo + enddo + savg(1,target_bin)=sum(ss(1,1:jz,target_bin)) + + call init_wideband_sync() + call wb_sync(ss,savg,.false.,.true.,jz,1,2) + peak=maxloc(sync(ia:ib)%ccfmax) + if (peak(1)+ia-1 /= target_bin) error stop 'late Q65 partial sync peak was not found' + if (sync(target_bin)%iflip /= 0) error stop 'late Q65 partial sync was misclassified' + if (abs(sync(target_bin)%xdt-(lag*2048.0/11025.0-1.0)) > 0.001) & + error stop 'late Q65 partial sync used the wrong lag' + + ccf_before=sync(target_bin)%ccfmax + xdt_before=sync(target_bin)%xdt + ss(1,jz+1:322,ia:ib)=1.0e20 + call wb_sync(ss,savg,.false.,.true.,jz,1,2) + + if (sync(target_bin)%ccfmax /= ccf_before) & + error stop 'unavailable spectrum rows changed Q65 sync strength' + if (sync(target_bin)%xdt /= xdt_before) & + error stop 'unavailable spectrum rows changed Q65 sync lag' + + if (outside_row_count(24,300,280) /= 24) & + error stop 'early Q65 carrier baseline used the wrong row count' + if (outside_row_count(-1,276,280) /= 5) & + error stop 'negative leading rows changed the carrier baseline count' + + do i=ia,ib + do j=1,jz + ss(:,j,i)=1.0+0.001*[real(mod(37*j+17*i,23)),real(mod(31*j+13*i,19)), & + real(mod(29*j+11*i,17)),real(mod(23*j+7*i,13))] + enddo + savg(:,i)=[sum(ss(1,1:jz,i)),sum(ss(2,1:jz,i)), & + sum(ss(3,1:jz,i)),sum(ss(4,1:jz,i))] + enddo + response=[cos(22.5*acos(-1.0)/180.0)**2,cos(-22.5*acos(-1.0)/180.0)**2, & + cos(-67.5*acos(-1.0)/180.0)**2,cos(-112.5*acos(-1.0)/180.0)**2] + do j=1,size(expanded_sync) + k=expanded_sync(j)+lag + do offset=0,2 + if (k+offset <= jz) ss(:,k+offset,target_bin)=ss(:,k+offset,target_bin)+50.0*response + enddo + enddo + do i=1,4 + savg(i,target_bin)=sum(ss(i,1:jz,target_bin)) + enddo + + call wb_sync(ss,savg,.true.,.false.,jz,1,2) + ccf_before=sync(target_bin)%ccfmax + call get_candidates(ss,savg,.true.,jz,1,2,0,1,candidates,ncand) + if (sync(target_bin)%ccfmax <= ccf_before) & + error stop 'continuous polarization did not improve the production Q65 score' + angle_error=abs(modulo(sync(target_bin)%pol-22.5+90.0,180.0)-90.0) + if (angle_error > 0.05) error stop 'continuous polarization recovered the wrong physical angle' + angle_error=abs(modulo(sync(target_bin)%combine_pol-22.5+90.0,180.0)-90.0) + if (angle_error > 0.05) error stop 'continuous polarization selected the wrong combining angle' + found=.false. + do i=1,ncand + if (candidates(i)%iflip == 0 .and. & + abs(candidates(i)%f-0.001*(target_bin-1)*df) < 0.0005*df) found=.true. + enddo + if (.not.found) error stop 'continuous polarization score did not reach Q65 candidate admission' + + savg(2,ia:ib)=4.0*real(jz) + savg(4,ia:ib)=0.0 + call wb_sync(ss,savg,.true.,.false.,jz,1,2) + ccf_before=sync(target_bin)%ccfmax + call get_candidates(ss,savg,.true.,jz,1,2,0,1,candidates,ncand) + if (sync(target_bin)%ccfmax /= ccf_before) & + error stop 'invalid covariance did not preserve the legacy Q65 score' +end program test_map65_wideband_sync_rows diff --git a/tests/unit/q65/test_q65_decode_pipeline.f90 b/tests/unit/q65/test_q65_decode_pipeline.f90 new file mode 100644 index 00000000..84b34dc0 --- /dev/null +++ b/tests/unit/q65/test_q65_decode_pipeline.f90 @@ -0,0 +1,209 @@ +module q65_pipeline_callback + + use q65_decode, only: q65_decoder + implicit none + + integer :: callback_count + integer :: callback_idec,callback_nused,callback_ntrperiod + integer :: callback_nutc,callback_nsnr + integer :: callback_iflagdec + real :: callback_snr1,callback_dt,callback_freq + character(len=37) :: callback_message + +contains + + + subroutine capture_callback(this,nutc,snr1,nsnr,dt,freq,decoded,idec, & + nused,ntrperiod,iflagdec) + class(q65_decoder), intent(inout) :: this + integer, intent(in) :: nutc,nsnr,idec,nused,ntrperiod,iflagdec + real, intent(in) :: snr1,dt,freq + character(len=37), intent(in) :: decoded + + callback_count=callback_count+1 + callback_nutc=nutc + callback_snr1=snr1 + callback_nsnr=nsnr + callback_dt=dt + callback_freq=freq + callback_message=decoded + callback_idec=idec + callback_nused=nused + callback_ntrperiod=ntrperiod + callback_iflagdec=iflagdec + end subroutine capture_callback + +end module q65_pipeline_callback + +program test_q65_decode_pipeline + + use iso_fortran_env, only: int16 + use map65_mmdec_mod, only: map65_mmdec + use q65_pipeline_callback + use prog_args, only: data_dir,temp_dir + use q65_decode, only: q65_decoder,cq0,msg0,nsnr0,nfreq0,xdt0 + use q65_test_fixture, only: make_q65_wave,q65_nsamples,q65_ntrperiod + use types, only: q3list + implicit none + + integer(int16), allocatable :: iwave(:) + integer, parameter :: map65_submodes(2)=[0,4] + integer :: nqf(20),navg0,nsubmode,isubmode + logical :: lclearave,single_decode,lagain,lnewdat,lapcqonly + type(q65_decoder) :: decoder + character(len=12) :: mycall,hiscall + character(len=6) :: hisgrid + + data_dir='.' + temp_dir='.' + mycall=' ' + hiscall=' ' + hisgrid=' ' + nqf=0 + navg0=0 + lclearave=.true. + single_decode=.true. + lagain=.false. + lnewdat=.false. + lapcqonly=.false. + call check_q65_ap_flag_masks() + allocate(iwave(q65_nsamples)) + + do nsubmode=0,4 + call make_q65_wave(iwave,nsubmode) + call run_direct_decode(decoder,iwave,nsubmode,1,want_iflagdec=0) + enddo + + ! The direct decoder loop owns exhaustive submode coverage. MAP65 is a thin + ! handoff, so exercise both ends of its forwarded submode range. + do isubmode=1,size(map65_submodes) + nsubmode=map65_submodes(isubmode) + call make_q65_wave(iwave,nsubmode) + call run_map65_decode(iwave,nsubmode,.true.) + enddo + + ! The wrapper's silent case also proves that the decoder emits no callback, + ! while additionally checking that no stale MAP65 state escapes. + iwave=0_int16 + call run_map65_decode(iwave,0,.false.) + + write(*,'(a)') 'Q65 raw decoder and MAP65 handoff tests passed' + +contains + + subroutine check_q65_ap_flag_masks() + integer :: apsym0(58),apmask(78),apsymbols(78),iaptype + integer :: codewords(63,411),ncw,j + character(len=12) :: list_mycall,list_hiscall + character(len=6) :: list_hisgrid + type(q3list) :: callers(50) + + apsym0=0 + call q65_ap(5,1,0,.false.,.false.,iaptype,apsym0,apmask,apsymbols) + if(iaptype.ne.3 .or. apmask(78).ne.1 .or. apsymbols(78).ne.0) then + error stop 'ordinary Q65 AP decoding changed bit 78 policy' + endif + + call q65_ap(5,1,1,.true.,.false.,iaptype,apsym0,apmask,apsymbols) + if(iaptype.ne.3 .or. apmask(78).ne.0) then + error stop 'Q65 Pileup AP decoding fixed bit 78 for call/grid messages' + endif + + list_mycall='K1ABC' + list_hiscall='W9XYZ' + list_hisgrid='FN42' + do j=1,40 + write(callers(j)%call,'(a2,i4.4)') 'K1',j + callers(j)%grid='FN42' + enddo + call q65_set_list2(list_mycall,list_hiscall,list_hisgrid,callers,40,codewords,ncw) + if(ncw.ne.411) error stop 'Q65 Pileup full AP list truncated at 40 callers' + end subroutine check_q65_ap_flag_masks + + subroutine run_direct_decode(decoder,samples,nsubmode,want_callback,want_iflagdec) + type(q65_decoder), intent(inout) :: decoder + integer(int16), intent(in) :: samples(:) + integer, intent(in) :: nsubmode,want_callback + integer, intent(in), optional :: want_iflagdec + logical :: want_success + + callback_count=0 + callback_message=' ' + callback_idec=-1 + callback_nused=-1 + callback_ntrperiod=-1 + callback_nutc=-1 + callback_nsnr=-999 + callback_snr1=0.0 + callback_dt=0.0 + callback_freq=0.0 + callback_iflagdec=-1 + want_success=want_callback.ne.0 + call decoder%decode(capture_callback,samples,1,100,q65_ntrperiod,nsubmode, & + 1000,150,3,850,1150,lclearave,single_decode,lagain,0,lnewdat,2.5, & + mycall,hiscall,hisgrid,0,0,.false.,lapcqonly,navg0,nqf) + if(want_success) then + if(callback_count.ne.1) error stop 'direct Q65 decode callback count changed' + if(trim(callback_message).ne.'K1ABC W9XYZ FN42') then + error stop 'direct Q65 decoder returned the wrong message' + endif + if(callback_idec.lt.0 .or. callback_ntrperiod.ne.q65_ntrperiod) then + error stop 'direct Q65 callback metadata changed' + endif + if(abs(callback_freq-1000.0).gt.8.0) error stop 'direct Q65 frequency changed' + if(abs(callback_dt).gt.0.15) error stop 'direct Q65 timing changed' + if(present(want_iflagdec)) then + if(callback_iflagdec.ne.want_iflagdec) then + error stop 'direct Q65 decode did not recover the expected flag bit' + endif + endif + else + if(callback_count.ne.0) error stop 'silent Q65 input produced a callback' + endif + end subroutine run_direct_decode + + subroutine run_map65_decode(samples,nsubmode,want_callback) + integer(int16), intent(in) :: samples(:) + integer, intent(in) :: nsubmode + logical, intent(in) :: want_callback + character(len=37) :: previous_message + integer :: nutc,nqd,nfa,nfb,nfqso,ntol,newdat,nagain,max_drift,ndepth + + nutc=100 + nqd=1 + nfa=850 + nfb=1150 + nfqso=1000 + ntol=150 + newdat=0 + nagain=1 + max_drift=0 + ndepth=3 + + nsnr0=-99 + nfreq0=-1 + xdt0=-99.0 + msg0=' ' + cq0=' ' + previous_message=msg0 + + call map65_mmdec(nutc,samples,nqd,q65_ntrperiod,nsubmode,nfa,nfb,nfqso, & + ntol,newdat,nagain,max_drift,ndepth,mycall,hiscall,hisgrid) + if(want_callback) then + if(nsnr0.le.-99) error stop 'MAP65 Q65 handoff missed a decode' + if(trim(msg0).ne.'K1ABC W9XYZ FN42') then + error stop 'MAP65 Q65 handoff returned the wrong message' + endif + if(cq0(1:2).ne.'q0') error stop 'MAP65 Q65 decode type changed' + if(abs(nfreq0-1000).gt.8) error stop 'MAP65 Q65 frequency changed' + if(abs(xdt0).gt.0.15) error stop 'MAP65 Q65 timing changed' + else + if(nsnr0.ne.-99 .or. nfreq0.ne.-1 .or. xdt0.ne.-99.0 .or. & + msg0.ne.previous_message .or. cq0.ne.' ') then + error stop 'MAP65 Q65 handoff exposed stale decode state' + endif + endif + end subroutine run_map65_decode + + +end program test_q65_decode_pipeline diff --git a/tests/unit/q65/test_q65_llh_contracts.c b/tests/unit/q65/test_q65_llh_contracts.c new file mode 100644 index 00000000..888674bd --- /dev/null +++ b/tests/unit/q65/test_q65_llh_contracts.c @@ -0,0 +1,42 @@ +#include "q65.h" + +#include +#include +#include + +static void require (int condition, char const * message) +{ + if (!condition) + { + fprintf (stderr, "FAIL: %s\n", message); + exit (1); + } +} + +int main (void) +{ + float intrinsics[64] = {0}; + int symbol = 0; + + for (int i = 0; i < 64; ++i) + intrinsics[i] = 1.0f; + + require (q65_check_llh (NULL, &symbol, 1, 64, intrinsics) == 1, + "valid codeword symbol rejected"); + + symbol = -1; + float llh = 123.0f; + require (q65_check_llh (&llh, &symbol, 1, 64, intrinsics) == 0, + "negative codeword symbol accepted"); + require (isinf (llh) && llh < 0.0f, + "invalid codeword symbol left LLH undefined"); + + symbol = 64; + llh = 123.0f; + require (q65_check_llh (&llh, &symbol, 1, 64, intrinsics) == 0, + "out-of-range codeword symbol accepted"); + require (isinf (llh) && llh < 0.0f, + "out-of-range codeword symbol left LLH undefined"); + + return 0; +} diff --git a/tests/unit/q65/test_q65_source_encoding.f90 b/tests/unit/q65/test_q65_source_encoding.f90 new file mode 100644 index 00000000..1b7eed2a --- /dev/null +++ b/tests/unit/q65/test_q65_source_encoding.f90 @@ -0,0 +1,194 @@ +program test_q65_source_encoding + + use q65_encoding, only: get_q65_tones + implicit none + + external :: genq65 + + integer :: ntests + + ntests=0 + + call expect_shared_vector('K1ABC W9XYZ FN42', & + [2,27,55,35,20,6,5,9,55,0,40,25,34,53,28,53,32,3,23,8, & + 41,41,7,11,8,59,50,60,47,21,21,9,45,59,19,4,2,3,10,40, & + 22,4,53,46,55,0,0,28,25,28,32,0,31,40,30,30,28,49,27,37, & + 23,32,29,40,9], & + [0,3,28,56,36,21,7,6,0,10,56,0,0,1,0,41,26,35,54,33, & + 4,0,0,24,9,0,0,42,42,8,12,9,0,60,0,51,61,0,48,22, & + 22,10,46,60,20,0,5,3,4,0,11,41,23,5,0,54,47,56,1,0, & + 1,0,29,26,29,0,33,1,0,32,41,31,31,0,29,0,50,28,38,24, & + 33,30,41,10,0]) + + call expect_shared_vector('K1ABC W9XYZ RR73', & + [2,27,55,35,20,6,5,9,55,1,62,36,50,51,52,51,38,5,17,14, & + 50,51,39,19,16,35,42,36,4,62,46,52,16,6,56,47,41,40,7,53, & + 11,25,40,51,23,32,1,53,48,53,41,9,29,20,34,18,16,57,19,45, & + 13,58,55,2,35], & + [0,3,28,56,36,21,7,6,0,10,56,0,0,2,0,63,37,51,52,39, & + 6,0,0,18,15,0,0,51,52,40,20,17,0,36,0,43,37,0,5,63, & + 47,53,17,7,57,0,48,42,41,0,8,54,12,26,0,41,52,24,33,0, & + 2,0,54,49,54,0,42,10,0,30,21,35,19,0,17,0,58,20,46,14, & + 59,56,3,36,0]) + + call expect_legacy_vector('K1ABC W9XYZ FN42', & + [0,3,28,56,36,21,7,6,0,10,56,0,0,1,0,41,26,35,54,33, & + 4,0,0,24,9,0,0,42,42,8,12,9,0,60,0,51,61,0,48,22, & + 22,10,46,60,20,0,5,3,4,0,11,41,23,5,0,54,47,56,1,0, & + 1,0,29,26,29,0,33,1,0,32,41,31,31,0,29,0,50,28,38,24, & + 33,30,41,10,0]) + + call expect_legacy_vector('K1ABC W9XYZ RR73', & + [0,3,28,56,36,21,7,6,0,10,56,0,0,2,0,63,37,51,52,39, & + 6,0,0,18,15,0,0,51,52,40,20,17,0,36,0,43,37,0,5,63, & + 47,53,17,7,57,0,48,42,41,0,8,54,12,26,0,41,52,24,33,0, & + 2,0,54,49,54,0,42,10,0,30,21,35,19,0,17,0,58,20,46,14, & + 59,56,3,36,0]) + + call expect_legacy_vector_flagged('K1ABC W9XYZ FN42', & + [0,3,28,56,36,21,7,6,0,10,56,0,0,1,0,41,26,36,29,10, & + 43,0,0,63,34,0,0,45,45,57,53,56,0,5,0,14,4,0,17,43, & + 43,63,27,13,37,0,52,54,53,0,48,13,51,33,0,18,11,20,37,0, & + 37,0,17,22,17,0,24,56,0,14,59,13,13,0,15,0,36,10,56,24, & + 33,30,41,10,0]) + + call expect_invalid_shared_message() + call expect_invalid_legacy_message() + + write(*,'(a,i0)') 'Q65 source encoding tests passed: ', ntests + +contains + + subroutine expect_shared_vector(input,want_codeword,want_tones) + character(len=*), intent(in) :: input + integer, intent(in) :: want_codeword(65), want_tones(85) + character(len=37) :: msg37,msgsent,want_msg + integer :: codeword(65), itone(85) + integer :: sync(22),i,k + logical :: success + + msg37=' ' + msg37=input + want_msg=' ' + want_msg=input + call get_q65_tones(msg37,codeword,itone,msgsent,success) + if(.not.success) error stop 'shared Q65 encoder rejected a vector' + call assert_message('shared Q65 encoder',msgsent,want_msg) + call assert_vector('shared Q65 codeword',codeword,want_codeword) + call assert_vector('shared Q65 tones',itone,want_tones) + + sync=[1,9,12,13,15,22,23,26,27,33,35,38,46,50,55,60,62,66,69,74,76,85] + k=0 + do i=1,85 + if(any(sync.eq.i)) then + if(itone(i).ne.0) error stop 'Q65 sync tone is not zero' + else + k=k+1 + if(itone(i).ne.want_codeword(merge(k,k+2,k.le.13))+1) then + error stop 'Q65 tone does not match shortened codeword' + endif + endif + enddo + if(k.ne.63) error stop 'Q65 shortened codeword length changed' + + ntests=ntests+1 + end subroutine expect_shared_vector + + subroutine expect_legacy_vector(input,want_tones) + character(len=*), intent(in) :: input + integer, intent(in) :: want_tones(85) + character(len=37) :: msg37,msgsent,want_msg + integer :: itone(85),i3,n3 + + msg37=' ' + msg37=input + want_msg=' ' + want_msg=input + itone=-1 + i3=-1 + n3=-1 + call genq65(msg37,0,msgsent,itone,i3,n3,0) + if(i3.lt.0 .or. n3.lt.0) error stop 'legacy Q65 encoder rejected a vector' + call assert_message('legacy Q65 encoder',msgsent,want_msg) + call assert_vector('legacy Q65 tones',itone,want_tones) + ntests=ntests+1 + end subroutine expect_legacy_vector + + subroutine expect_legacy_vector_flagged(input,want_tones) + ! Same as expect_legacy_vector, but with iflag=1 (the spare 78th bit + ! set) -- verifies the bit actually reaches the transmitted symbols, + ! and that it's the *only* difference from the unflagged encoding + ! (bar the accumulator's cascade through later symbols, expected of + ! a repeat-accumulate code). + character(len=*), intent(in) :: input + integer, intent(in) :: want_tones(85) + character(len=37) :: msg37,msgsent,want_msg + integer :: itone(85),i3,n3 + + msg37=' ' + msg37=input + want_msg=' ' + want_msg=input + itone=-1 + i3=-1 + n3=-1 + call genq65(msg37,0,msgsent,itone,i3,n3,1) + if(i3.lt.0 .or. n3.lt.0) error stop 'flagged Q65 encoder rejected a vector' + call assert_message('flagged Q65 encoder',msgsent,want_msg) + call assert_vector('flagged Q65 tones',itone,want_tones) + ntests=ntests+1 + end subroutine expect_legacy_vector_flagged + + subroutine expect_invalid_shared_message() + character(len=37) :: msg37,msgsent + integer :: codeword(65),itone(85) + logical :: success + + msg37='HELLO@WORLD' + call get_q65_tones(msg37,codeword,itone,msgsent,success) + if(success) error stop 'shared Q65 encoder accepted invalid input' + call assert_message('shared Q65 invalid message',msgsent, & + '*** bad message *** ') + if(any(codeword.ne.0) .or. any(itone.ne.0)) then + error stop 'shared Q65 invalid output was not cleared' + endif + ntests=ntests+1 + end subroutine expect_invalid_shared_message + + subroutine expect_invalid_legacy_message() + character(len=37) :: msg37,msgsent + integer :: itone(85),i3,n3 + + msg37='HELLO@WORLD' + call genq65(msg37,0,msgsent,itone,i3,n3,0) + if(i3.ne.-1 .or. n3.ne.-1) error stop 'legacy Q65 encoder accepted invalid input' + call assert_message('legacy Q65 invalid message',msgsent, & + '*** bad message *** ') + if(any(itone.ne.0)) error stop 'legacy Q65 invalid tones were not cleared' + ntests=ntests+1 + end subroutine expect_invalid_legacy_message + + subroutine assert_message(label,got,want) + character(len=*), intent(in) :: label,got,want + if(got.ne.want) then + write(*,'(a,": got [",a,"] wanted [",a,"]")') trim(label),got,want + error stop 1 + endif + end subroutine assert_message + + subroutine assert_vector(label,got,want) + character(len=*), intent(in) :: label + integer, intent(in) :: got(:),want(:) + integer :: i + + if(size(got).ne.size(want)) error stop 'vector size changed' + do i=1,size(got) + if(got(i).ne.want(i)) then + write(*,'(a,": index ",i0,": got ",i0," wanted ",i0)') & + trim(label),i,got(i),want(i) + error stop 1 + endif + enddo + end subroutine assert_vector + +end program test_q65_source_encoding diff --git a/tests/unit/q65/test_q65_waveform_generator.f90 b/tests/unit/q65/test_q65_waveform_generator.f90 new file mode 100644 index 00000000..b97fef13 --- /dev/null +++ b/tests/unit/q65/test_q65_waveform_generator.f90 @@ -0,0 +1,163 @@ +program test_q65_waveform_generator + + use iso_fortran_env, only: real32, real64 + use, intrinsic :: ieee_arithmetic, only: ieee_is_finite + use cgen65_mod, only: cgen65 + use gen_q65_cwave_mod, only: gen_q65_cwave + implicit none + + external :: gen_q65_wave + + integer, parameter :: sample_rate = 96000 + integer, parameter :: waveform_capacity = 60 * sample_rate + real(real64), parameter :: pi = 3.1415926535897932384626433832795_real64 + real(real64), parameter :: q65_symbol_duration = 7200.0_real64 / 12000.0_real64 + real(real64), parameter :: jt65_base_frequency = 118.0_real64 * 11025.0_real64 / 1024.0_real64 + + complex, allocatable :: q65_wave(:), jt65_wave(:) + integer*2, allocatable :: legacy_q65_wave(:) + + allocate(q65_wave(waveform_capacity), jt65_wave(waveform_capacity)) + allocate(legacy_q65_wave(2 * 60 * 11025)) + call test_q65_complex_wave(q65_wave, 1) + call test_q65_complex_wave(q65_wave, 2) + call test_q65_invalid_message(q65_wave) + call test_q65_legacy_wave(legacy_q65_wave) + call test_jt65_complex_wave(jt65_wave) + print '(a)', 'Q65 waveform generator tests passed' + +contains + + subroutine require(condition, description) + logical, intent(in) :: condition + character(len=*), intent(in) :: description + + if (.not. condition) then + print '(a)', 'FAIL: '//description + error stop 1 + end if + end subroutine require + + subroutine test_q65_complex_wave(waveform, tone_spacing) + complex, intent(inout) :: waveform(:) + integer, intent(in) :: tone_spacing + character(len=24) :: message, msgsent + integer :: nwave, expected_nwave, sample + real(real64) :: fsample, expected_frequency, measured_frequency + complex :: step + + fsample = real(sample_rate, real64) + message = 'K1ABC W9XYZ FN42' + waveform = cmplx(0.0_real32, 0.0_real32) + + call gen_q65_cwave(message, 1000, tone_spacing, fsample, msgsent, waveform, nwave) + + expected_nwave = int(85.0_real64 * q65_symbol_duration * fsample + 0.5_real64) + call require(nwave == expected_nwave, 'Q65 waveform length') + call require(trim(msgsent) == trim(message), 'Q65 generated message') + call require(all(ieee_is_finite(real(waveform(1:nwave)))), 'Q65 real samples are finite') + call require(all(ieee_is_finite(aimag(waveform(1:nwave)))), 'Q65 imaginary samples are finite') + call require(maxval(abs(abs(waveform(1:nwave)) - 1.0)) < 1.0e-5, & + 'Q65 complex envelope is constant') + + step = waveform(1) + call require(abs(real(step) - real(cos(2.0_real64*pi*1000.0_real64/fsample), real32)) < 1.0e-5, & + 'Q65 I orientation') + call require(abs(aimag(step) + real(sin(2.0_real64*pi*1000.0_real64/fsample), real32)) < 1.0e-5, & + 'Q65 Q orientation') + + sample = int(q65_symbol_duration * fsample) + 1000 + step = conjg(waveform(sample)) * waveform(sample + 1) + measured_frequency = -atan2(real(aimag(step), real64), real(real(step), real64)) * & + fsample / (2.0_real64*pi) + expected_frequency = 1000.0_real64 + 3.0_real64 * tone_spacing * 12000.0_real64 / 7200.0_real64 + call require(abs(measured_frequency - expected_frequency) < 0.2_real64, & + 'Q65 tone spacing') + call require_phase_steps(waveform, nwave - 1, 'Q65') + end subroutine test_q65_complex_wave + + subroutine test_q65_invalid_message(waveform) + complex, intent(inout) :: waveform(:) + character(len=24) :: message, msgsent + integer :: nwave + + message = 'HELLO@WORLD' + waveform = cmplx(1.0_real32, 1.0_real32) + call gen_q65_cwave(message, 1000, 1, real(sample_rate, real64), msgsent, waveform, nwave) + + call require(nwave == 0, 'invalid Q65 waveform length') + call require(trim(msgsent) == '*** bad message ***', 'invalid Q65 generated message') + call require(all(waveform == cmplx(0.0_real32, 0.0_real32)), 'invalid Q65 output is cleared') + end subroutine test_q65_invalid_message + + subroutine test_q65_legacy_wave(waveform) + integer*2, intent(inout) :: waveform(:) + character(len=22) :: message, msgsent + integer :: nwave, expected_nwave, sample + real(real64) :: envelope + + message = 'K1ABC W9XYZ FN42' + waveform = 0 + call gen_q65_wave(message, 1000, 1, msgsent, waveform, nwave) + + expected_nwave = 2 * int(85.0_real64 * q65_symbol_duration * 11025.0_real64 + 0.5_real64) + call require(nwave == expected_nwave, 'legacy Q65 waveform length') + call require(trim(msgsent) == trim(message), 'legacy Q65 generated message') + do sample = 1, nwave, 2 + envelope = sqrt(real(waveform(sample), real64)**2 + & + real(waveform(sample + 1), real64)**2) + call require(abs(envelope - 32767.0_real64) < 2.0_real64, & + 'legacy Q65 I/Q envelope stays constant') + end do + call require(abs(real(waveform(1)) - real(32767.0_real64 * & + cos(2.0_real64*pi*1000.0_real64/11025.0_real64), real32)) < 1.0, & + 'legacy Q65 I orientation') + call require(abs(real(waveform(2)) - real(32767.0_real64 * & + sin(2.0_real64*pi*1000.0_real64/11025.0_real64), real32)) < 1.0, & + 'legacy Q65 Q orientation') + end subroutine test_q65_legacy_wave + + subroutine test_jt65_complex_wave(waveform) + complex, intent(inout) :: waveform(:) + character(len=22) :: message, msgsent + integer :: nsendingsh, nwave, ndata + real(real64) :: samfac + complex :: step + + message = 'K1ABC W9XYZ FN42' + samfac = 1.0_real64 + waveform = cmplx(0.0_real32, 0.0_real32) + call cgen65(message, 1, samfac, nsendingsh, msgsent, waveform, nwave) + + ndata = int(126.0_real64 * real(sample_rate, real64) * samfac * 4096.0_real64 / 11025.0_real64) + call require(nsendingsh == 0, 'JT65 normal message shorthand flag') + call require(trim(msgsent) == trim(message), 'JT65 generated message') + call require(nwave == ndata + 48000, 'JT65 waveform length') + call require(all(ieee_is_finite(real(waveform(1:nwave)))), 'JT65 real samples are finite') + call require(all(ieee_is_finite(aimag(waveform(1:nwave)))), 'JT65 imaginary samples are finite') + call require(all(abs(waveform(ndata+1:nwave)) < 1.0e-5), 'JT65 padding is silent') + + step = waveform(1) + call require(abs(real(step) - real(cos(2.0_real64*pi*jt65_base_frequency/sample_rate), real32)) < 1.0e-5, & + 'JT65 I orientation') + call require(abs(aimag(step) + real(sin(2.0_real64*pi*jt65_base_frequency/sample_rate), real32)) < 1.0e-5, & + 'JT65 Q orientation') + call require_phase_steps(waveform, ndata - 1, 'JT65') + end subroutine test_jt65_complex_wave + + subroutine require_phase_steps(waveform, last_sample, description) + complex, intent(in) :: waveform(:) + integer, intent(in) :: last_sample + character(len=*), intent(in) :: description + complex :: step + real(real64) :: phase_step + integer :: sample + + do sample = 1, last_sample + step = conjg(waveform(sample)) * waveform(sample + 1) + phase_step = atan2(real(aimag(step), real64), real(real(step), real64)) + call require(abs(phase_step) < 0.25_real64, description//' phase step stays bounded') + end do + end subroutine require_phase_steps + +end program test_q65_waveform_generator diff --git a/tests/unit/q65/test_q65_workspace.f90 b/tests/unit/q65/test_q65_workspace.f90 new file mode 100644 index 00000000..3a0421bb --- /dev/null +++ b/tests/unit/q65/test_q65_workspace.f90 @@ -0,0 +1,44 @@ +program test_q65_workspace + + use q65_workspace, only: Q65_MAXFFT, Q65_NN, q65_workspace_type + + implicit none + + integer, parameter :: npts2=400 + integer, parameter :: ll=256 + type(q65_workspace_type) :: workspace + + call workspace%ensure(npts2,ll) + call assert_workspace_sizes(workspace,npts2,ll) + + workspace%c0(0)=cmplx(3.0,4.0) + workspace%s3(1)=7.0 + workspace%cs(0)=cmplx(5.0,6.0) + + call workspace%ensure(npts2/2,ll/2) + call assert_workspace_sizes(workspace,npts2/2,ll/2) + if(workspace%c0(0).ne.cmplx(3.0,4.0)) error stop 'c0 was reallocated' + if(workspace%s3(1).ne.7.0) error stop 's3 was reallocated' + if(workspace%cs(0).ne.cmplx(5.0,6.0)) error stop 'cs was reallocated' + + call workspace%ensure(2*npts2,2*ll) + call assert_workspace_sizes(workspace,2*npts2,2*ll) + +contains + + subroutine assert_workspace_sizes(workspace,npts2,ll) + type(q65_workspace_type), intent(in) :: workspace + integer, intent(in) :: npts2,ll + + if(.not.allocated(workspace%c0)) error stop 'c0 is not allocated' + if(.not.allocated(workspace%s3)) error stop 's3 is not allocated' + if(.not.allocated(workspace%cs)) error stop 'cs is not allocated' + if(lbound(workspace%c0,1).ne.0) error stop 'c0 lower bound changed' + if(lbound(workspace%cs,1).ne.0) error stop 'cs lower bound changed' + if(lbound(workspace%s3,1).ne.1) error stop 's3 lower bound changed' + if(size(workspace%c0).lt.npts2) error stop 'c0 capacity is too small' + if(size(workspace%s3).lt.ll*Q65_NN) error stop 's3 capacity is too small' + if(size(workspace%cs).ne.Q65_MAXFFT) error stop 'cs size changed' + end subroutine assert_workspace_sizes + +end program test_q65_workspace diff --git a/tests/unit/q65/test_q65code.cmake b/tests/unit/q65/test_q65code.cmake new file mode 100644 index 00000000..cfbb9939 --- /dev/null +++ b/tests/unit/q65/test_q65code.cmake @@ -0,0 +1,25 @@ +execute_process( + COMMAND "${Q65CODE}" "THIS FREE TEXT IS TOO LONG" + RESULT_VARIABLE fallback_result + OUTPUT_VARIABLE fallback_output + ERROR_VARIABLE fallback_error +) +if (NOT fallback_result EQUAL 0) + message(FATAL_ERROR "Legacy fallback failed (${fallback_result}):\n${fallback_output}${fallback_error}") +endif () +if (NOT fallback_output MATCHES "Message sent:[ ]+THIS FREE TEX") + message(FATAL_ERROR "Fallback output was unexpected:\n${fallback_output}") +endif () + +execute_process( + COMMAND "${Q65CODE}" "HELLO@WORLD" + RESULT_VARIABLE rejected_result + OUTPUT_VARIABLE rejected_output + ERROR_VARIABLE rejected_error +) +if (rejected_result EQUAL 0) + message(FATAL_ERROR "Unrepresentable message returned success:\n${rejected_output}") +endif () +if (NOT rejected_output MATCHES "Cannot encode message:[ ]+HELLO@WORLD") + message(FATAL_ERROR "Rejected message output was unexpected:\n${rejected_output}${rejected_error}") +endif () diff --git a/tests/unit/qmap/CMakeLists.txt b/tests/unit/qmap/CMakeLists.txt new file mode 100644 index 00000000..0d0b73ac --- /dev/null +++ b/tests/unit/qmap/CMakeLists.txt @@ -0,0 +1,45 @@ +add_executable (test_qmap_livecq_parser + test_livecq_parser.cpp + ${CMAKE_SOURCE_DIR}/qmap/livecq_parser.cpp + ${CMAKE_SOURCE_DIR}/validators/LiveCQCallsign.cpp +) +target_link_libraries (test_qmap_livecq_parser Qt5::Test) +add_test (NAME test_qmap_livecq_parser COMMAND test_qmap_livecq_parser) + +add_executable (test_qmap_plotter_initialization + test_plotter_initialization.cpp + ${CMAKE_SOURCE_DIR}/qmap/decode_click_coalescer.cpp + ${CMAKE_SOURCE_DIR}/qmap/plotter.cpp +) +target_link_libraries (test_qmap_plotter_initialization + wsjt_qt + qmap_impl + ${FFTW3_LIBRARIES} + Qt5::Test + Qt5::Widgets +) +add_test (NAME test_qmap_plotter_initialization COMMAND test_qmap_plotter_initialization) +if (WIN32) + set_tests_properties (test_qmap_plotter_initialization PROPERTIES + ENVIRONMENT "QT_QPA_PLATFORM=windows" + ) +else () + set_tests_properties (test_qmap_plotter_initialization PROPERTIES + ENVIRONMENT "QT_QPA_PLATFORM=offscreen" + ) +endif () + +add_executable (test_qmap_ipc test_qmap_ipc.cpp) +target_link_libraries (test_qmap_ipc Qt5::Test) +add_test (NAME test_qmap_ipc COMMAND test_qmap_ipc) + +add_executable (test_qmap_decode_record test_qmap_decode_record.cpp) +target_link_libraries (test_qmap_decode_record wsjt_qt wsjt_fort_common Qt5::Test) +add_test (NAME test_qmap_decode_record COMMAND test_qmap_decode_record) + +add_executable (test_qmap_decode_click_coalescer + test_decode_click_coalescer.cpp + ${CMAKE_SOURCE_DIR}/qmap/decode_click_coalescer.cpp +) +target_link_libraries (test_qmap_decode_click_coalescer Qt5::Test Qt5::Widgets) +add_test (NAME test_qmap_decode_click_coalescer COMMAND test_qmap_decode_click_coalescer) diff --git a/tests/unit/qmap/test_decode_click_coalescer.cpp b/tests/unit/qmap/test_decode_click_coalescer.cpp new file mode 100644 index 00000000..284aa5e5 --- /dev/null +++ b/tests/unit/qmap/test_decode_click_coalescer.cpp @@ -0,0 +1,95 @@ +#include + +#include "qmap/decode_click_coalescer.h" +#include "qmap/qmap_click_policy.h" + +class TestDecodeClickCoalescer final : public QObject +{ + Q_OBJECT + +private slots: + void disarmsBeforeSingleClick(); + void coalescesUpdatedRecordByIdentity(); + void keepsDifferentRecordsSeparate(); + void protectsDoubleClickWhenDisarmIsOverwritten(); +}; + +namespace +{ + struct DispatchEvent + { + QByteArray row; + DecodeClickGesture gesture; + }; +} + +void TestDecodeClickCoalescer::disarmsBeforeSingleClick() +{ + QList dispatched; + DecodeClickCoalescer coalescer {this, [&dispatched] (QByteArray const& row, + DecodeClickGesture gesture) { + dispatched.append ({row, gesture}); + }, 20}; + + coalescer.press ("K1ABC", "first"); + QCOMPARE (dispatched.size (), 1); + QVERIFY (dispatched.first ().gesture == DecodeClickGesture::Press); + QTRY_COMPARE_WITH_TIMEOUT (dispatched.size (), 2, 100); + QCOMPARE (dispatched.last ().row, QByteArray {"first"}); + QVERIFY (dispatched.last ().gesture == DecodeClickGesture::SingleClick); +} + +void TestDecodeClickCoalescer::coalescesUpdatedRecordByIdentity() +{ + QList dispatched; + DecodeClickCoalescer coalescer {this, [&dispatched] (QByteArray const& row, + DecodeClickGesture gesture) { + dispatched.append ({row, gesture}); + }, 20}; + + coalescer.press ("K1ABC", "old record"); + coalescer.doubleClick ("K1ABC", "new record"); + QCOMPARE (dispatched.size (), 2); + QCOMPARE (dispatched.last ().row, QByteArray {"new record"}); + QVERIFY (dispatched.last ().gesture == DecodeClickGesture::DoubleClick); + QTest::qWait (30); + QCOMPARE (dispatched.size (), 2); +} + +void TestDecodeClickCoalescer::keepsDifferentRecordsSeparate() +{ + QList dispatched; + DecodeClickCoalescer coalescer {this, [&dispatched] (QByteArray const& row, + DecodeClickGesture gesture) { + dispatched.append ({row, gesture}); + }, 20}; + + coalescer.press ("K1ABC", "first"); + coalescer.press ("K2XYZ", "second"); + QCOMPARE (dispatched.size (), 3); + QCOMPARE (dispatched.at (1).row, QByteArray {"first"}); + QVERIFY (dispatched.at (1).gesture == DecodeClickGesture::SingleClick); + QVERIFY (dispatched.last ().gesture == DecodeClickGesture::Press); + QTRY_COMPARE_WITH_TIMEOUT (dispatched.size (), 4, 100); + QCOMPARE (dispatched.last ().row, QByteArray {"second"}); + QVERIFY (dispatched.last ().gesture == DecodeClickGesture::SingleClick); +} + +void TestDecodeClickCoalescer::protectsDoubleClickWhenDisarmIsOverwritten() +{ + auto const failedDoubleClick = qmapClickPolicy (true, false, true, true); + QVERIFY (failedDoubleClick.disarmBeforeQsy); + QVERIFY (!failedDoubleClick.enableAutoTx); + QVERIFY (!failedDoubleClick.restartTransmission); + + auto const acceptedDoubleClick = qmapClickPolicy (true, true, false, true); + QVERIFY (acceptedDoubleClick.enableAutoTx); + QVERIFY (acceptedDoubleClick.restartTransmission); + + auto const failedSingleClick = qmapClickPolicy (false, false, true, false); + QVERIFY (failedSingleClick.disableAutoTx); +} + +QTEST_GUILESS_MAIN (TestDecodeClickCoalescer) + +#include "test_decode_click_coalescer.moc" diff --git a/tests/unit/qmap/test_livecq_parser.cpp b/tests/unit/qmap/test_livecq_parser.cpp new file mode 100644 index 00000000..4f0ff9ea --- /dev/null +++ b/tests/unit/qmap/test_livecq_parser.cpp @@ -0,0 +1,84 @@ +#include + +#include "qmap/livecq_parser.h" + +class TestQMapLiveCQParser final : public QObject +{ + Q_OBJECT + +private slots: + void parsesSupportedLayouts() + { + QMapLiveCQ::Record record; + QVERIFY(QMapLiveCQ::parse( + {"123456", "-10", "0.1", "1234", "-12", "60", "CQ", "N5L", "1200.0"}, + 100, record)); + QCOMPARE(record.callsign, QString {"N5L"}); + QCOMPARE(record.grid, QString {"--"}); + QCOMPARE(record.message, QString {"CQ N5L"}); + QCOMPARE(record.receiveFrequency, 100); + QCOMPARE(record.scheduledFrequency, 1200); + + QVERIFY(QMapLiveCQ::parse( + {"123456", "-10", "0.1", "1234", "-12", "60", "CQ", "N5L", "FN20", "1200.0"}, + 100, record)); + QCOMPARE(record.grid, QString {"FN20"}); + QCOMPARE(record.message, QString {"CQ N5L FN20"}); + + QVERIFY(QMapLiveCQ::parse( + {"123456", "-10", "0.1", "1234", "-12", "60", "CQ", "DX", "N5L", "1200.0"}, + 100, record)); + QCOMPARE(record.callsign, QString {"N5L"}); + QCOMPARE(record.grid, QString {"--"}); + QCOMPARE(record.message, QString {"CQ N5L"}); + + QVERIFY(QMapLiveCQ::parse( + {"123456", "-10", "0.1", "1234", "-12", "60", "CQ", "DX", "N5L", "FN20", "1200.0"}, + 100, record)); + QCOMPARE(record.grid, QString {"FN20"}); + QCOMPARE(record.message, QString {"CQ N5L FN20"}); + } + + void parsesHighFrequencyFraction() + { + QMapLiveCQ::Record record; + QVERIFY(QMapLiveCQ::parse( + {"123456", "-10", "0.1", "1234", "-12", "60", "CQ", "N5L", "1200.750"}, + 100, record)); + QCOMPARE(record.receiveFrequency, -150); + QCOMPARE(record.scheduledFrequency, 1201); + } + + void rejectsMalformedRecordsBeforeIndexing() + { + QMapLiveCQ::Record record; + for (auto const& tokens : { + QStringList {}, + QStringList {"123456", "-10", "0.1", "1234", "-12", "60", "CQ"}, + QStringList {"123456", "-10", "0.1", "1234", "-12", "60", "CQ", "N5L"}, + QStringList {"123456", "-10", "0.1", "1234", "-12", "60", "CQ", "N5L", "FN20", "1200.0", "extra", "too-much"}}) { + QVERIFY(!QMapLiveCQ::parse(tokens, 100, record)); + } + } + + void rejectsMalformedFrequencyAndCalls() + { + QMapLiveCQ::Record record; + for (auto const& frequency : {QString {"1200"}, QString {"1200."}, + QString {"1200.x"}, QString {"1200.0.1"}}) { + QVERIFY(!QMapLiveCQ::parse( + {"123456", "-10", "0.1", "1234", "-12", "60", "CQ", "N5L", frequency}, + 100, record)); + } + QVERIFY(!QMapLiveCQ::parse( + {"123456", "-10", "0.1", "1234", "-12", "60", "CQ", "N5", "1200.0"}, + 100, record)); + QVERIFY(!QMapLiveCQ::parse( + {"123456", "-10", "0.1", "1234", "-12", "60", "CQ", "DX", "N5", "1200.0"}, + 100, record)); + } +}; + +QTEST_APPLESS_MAIN(TestQMapLiveCQParser) + +#include "test_livecq_parser.moc" diff --git a/tests/unit/qmap/test_plotter_initialization.cpp b/tests/unit/qmap/test_plotter_initialization.cpp new file mode 100644 index 00000000..f022a300 --- /dev/null +++ b/tests/unit/qmap/test_plotter_initialization.cpp @@ -0,0 +1,127 @@ +#include + +#include +#include +#include +#include +#include + +#include "qmap/plotter.h" + +class TestablePlotter final : public CPlotter +{ +public: + using CPlotter::mousePressEvent; +}; + +class TestPlotterInitialization final : public QObject +{ + Q_OBJECT + +private slots: + void sizesHiddenPlotter(); + void ignoresOutOfSpanAndControlClicks(); + void paintsLabelsInTwoDSpectrumMode(); +}; + +void TestPlotterInitialization::sizesHiddenPlotter() +{ + // CPlotter embeds a ~12.5 MB m_zwf array as a direct member (qmap/plotter.h), + // so it must be heap-allocated -- a stack-local instance overflows the + // default thread stack. + auto const plotter = std::make_unique (); + + QVERIFY (!plotter->isVisible ()); + plotter->ensureSized (1000, 280); + + QCOMPARE (plotter->plotWidth (), 1000); + QVERIFY (plotter->centerFreq () >= 0); + QVERIFY (plotter->binsPerPixel () > 0); +} + +void TestPlotterInitialization::ignoresOutOfSpanAndControlClicks() +{ + qRegisterMetaType ("DecodeClickGesture"); + auto const plotter = std::make_unique (); + plotter->ensureSized (1000, 280); + plotter->setFsample (96000); + plotter->show (); + QCoreApplication::processEvents (); + plotter->SetStartFreq (100); + plotter->m_fSpan = 100.f; + + QMapDecodeLabel label; + label.callsign = "K1ABC"; + label.receiveFrequencyKHz = 150.; + label.raw = QByteArray (static_cast (QMapDecodeRowSize), 'x'); + plotter->setDecodeLabels ({label}); + + QSignalSpy clicked (plotter.get (), &CPlotter::decodeLabelClicked); + QVERIFY (clicked.isValid ()); + QImage image (plotter->size (), QImage::Format_ARGB32); + image.fill (Qt::transparent); + plotter->render (&image); + QPoint labelPoint; + for (int y = 30; y < 60 && labelPoint.isNull (); ++y) { + for (int x = 0; x < image.width () && labelPoint.isNull (); ++x) { + auto const color = image.pixelColor (x, y); + if (color.red () > 200 && color.green () > 200 && color.blue () < 100) + labelPoint = {x, y}; + } + } + QVERIFY (!labelPoint.isNull ()); + QMouseEvent event {QEvent::MouseButtonPress, QPointF (labelPoint), + Qt::LeftButton, Qt::LeftButton, Qt::NoModifier}; + plotter->mousePressEvent (&event); + QCOMPARE (clicked.size (), 1); + + clicked.clear (); + label.receiveFrequencyKHz = 1000.; + plotter->setDecodeLabels ({label}); + QMouseEvent outOfSpanEvent {QEvent::MouseButtonPress, QPointF (999, 35), + Qt::LeftButton, Qt::LeftButton, Qt::NoModifier}; + plotter->mousePressEvent (&outOfSpanEvent); + QCOMPARE (clicked.size (), 0); + + label.receiveFrequencyKHz = 150.; + plotter->setDecodeLabels ({label}); + QMouseEvent controlEvent {QEvent::MouseButtonPress, + QPointF (labelPoint.x (), labelPoint.y ()), + Qt::LeftButton, Qt::LeftButton, Qt::ControlModifier}; + plotter->mousePressEvent (&controlEvent); + QCOMPARE (clicked.size (), 0); +} + +void TestPlotterInitialization::paintsLabelsInTwoDSpectrumMode() +{ + auto const plotter = std::make_unique (); + plotter->ensureSized (1000, 280); + plotter->setFsample (96000); + plotter->set2Dspec (true); + plotter->SetStartFreq (100); + + QMapDecodeLabel label; + label.callsign = "K1ABC"; + label.receiveFrequencyKHz = plotter->startFreq () + plotter->m_fSpan / 2.; + plotter->setDecodeLabels ({label}); + plotter->show (); + QCoreApplication::processEvents (); + + QImage image (plotter->size (), QImage::Format_ARGB32); + image.fill (Qt::transparent); + plotter->render (&image); + + int yellowPixels = 0; + for (int y = 30; y < 60; ++y) { + for (int x = 470; x < 530; ++x) { + auto const color = image.pixelColor (x, y); + if (color.red () > 200 && color.green () > 200 && color.blue () < 100) + ++yellowPixels; + } + } + QVERIFY (yellowPixels > 0); +} + +QTEST_MAIN (TestPlotterInitialization) + +#include "test_plotter_initialization.moc" diff --git a/tests/unit/qmap/test_qmap_decode_record.cpp b/tests/unit/qmap/test_qmap_decode_record.cpp new file mode 100644 index 00000000..54b165ec --- /dev/null +++ b/tests/unit/qmap/test_qmap_decode_record.cpp @@ -0,0 +1,97 @@ +#include + +#include "qmap/decode_label.h" +#include "qmap/qmap_decode_record.h" + +namespace +{ + QByteArray makeRow (QByteArray const& message) + { + QByteArray row (static_cast (QMapDecodeRowSize), ' '); + row.replace (0, 6, "123430"); + row.replace (6, 9, " 123.456"); + row.replace (15, 7, " 120.0"); + row.replace (22, 7, " 0.12"); + row.replace (29, 5, " -15"); + row.replace (36, 3, "30A"); + row.replace (41, message.size (), message); + return row; + } +} + +class TestQMapDecodeRecord final : public QObject +{ + Q_OBJECT + +private slots: + void parsesFixedWidthRecord(); + void rejectsMalformedRecord(); + void replacesLabelWithLatestRecord(); + void prunesExpiredLabelsAcrossMidnight(); +}; + +void TestQMapDecodeRecord::parsesFixedWidthRecord() +{ + auto const row = makeRow ("CQ POTA W3SZ/2 FN20"); + auto const record = parseQMapDecodeRecord (row); + + QVERIFY (record); + QCOMPARE (record->raw, row); + QCOMPARE (record->time, QString {"123430"}); + QCOMPARE (record->callsign, QString {"W3SZ/2"}); + QCOMPARE (record->grid, QString {"FN20"}); + QCOMPARE (record->submode, QString {"30A"}); + QCOMPARE (record->receiveFrequencyKHz, 123.456); + QCOMPARE (record->scheduledFrequencyKHz, 120.0); + QCOMPARE (record->snr, -15); + QCOMPARE (record->secondsSinceMidnight, 12 * 3600 + 34 * 60 + 30); + QVERIFY (record->secondHalf); + QVERIFY (record->cq); +} + +void TestQMapDecodeRecord::rejectsMalformedRecord() +{ + QVERIFY (!parseQMapDecodeRecord (QByteArray {"short"})); + + auto row = makeRow ("CQ K1ABC FN42"); + row.replace (0, 6, "256099"); + QVERIFY (!parseQMapDecodeRecord (row)); +} + +void TestQMapDecodeRecord::replacesLabelWithLatestRecord() +{ + auto firstRow = makeRow ("CQ K1ABC FN42"); + auto secondRow = firstRow; + secondRow.replace (6, 9, " 222.333"); + secondRow.replace (29, 5, " -07"); + auto const first = parseQMapDecodeRecord (firstRow); + auto const second = parseQMapDecodeRecord (secondRow); + QVERIFY (first); + QVERIFY (second); + + QList labels; + upsertQMapDecodeLabel (labels, *first); + upsertQMapDecodeLabel (labels, *second); + + QCOMPARE (labels.size (), 1); + QCOMPARE (labels.first ().raw, secondRow); + QCOMPARE (labels.first ().receiveFrequencyKHz, 222.333); + QCOMPARE (labels.first ().snr, -7); +} + +void TestQMapDecodeRecord::prunesExpiredLabelsAcrossMidnight() +{ + auto record = *parseQMapDecodeRecord (makeRow ("CQ K1ABC FN42")); + record.secondsSinceMidnight = 23 * 3600 + 59 * 60; + QList labels {record}; + + pruneQMapDecodeLabels (labels, 60); + QCOMPARE (labels.size (), 1); + + pruneQMapDecodeLabels (labels, 3 * 60 + 1); + QVERIFY (labels.isEmpty ()); +} + +QTEST_GUILESS_MAIN (TestQMapDecodeRecord) + +#include "test_qmap_decode_record.moc" diff --git a/tests/unit/qmap/test_qmap_ipc.cpp b/tests/unit/qmap/test_qmap_ipc.cpp new file mode 100644 index 00000000..61524fbd --- /dev/null +++ b/tests/unit/qmap/test_qmap_ipc.cpp @@ -0,0 +1,98 @@ +#include + +#include +#include + +#include "qmap/qmap_ipc.h" + +class TestQMapIpc final : public QObject +{ + Q_OBJECT + +private slots: + void leavesIncompleteBatchPending(); + void acknowledgesCompletedBatch_data(); + void acknowledgesCompletedBatch(); + void decoderPublicationPreservesRequests(); + void reportsMappingCapabilities(); + void clearsOnlyMappedProtocolBytes(); +}; + +void TestQMapIpc::leavesIncompleteBatchPending() +{ + QMapDecodeBlock shared {}; + shared.ndecodes = 3; + + QVERIFY (!acknowledgeQMapDecodeBatch (shared)); + QCOMPARE (shared.ndecodes, 3); +} + +void TestQMapIpc::acknowledgesCompletedBatch_data() +{ + QTest::addColumn ("completion"); + QTest::newRow ("live") << 1; + QTest::newRow ("disk") << 2; +} + +void TestQMapIpc::acknowledgesCompletedBatch() +{ + QFETCH (int, completion); + QMapDecodeBlock shared {}; + shared.ndecodes = 3; + shared.nQDecoderDone = completion; + + QVERIFY (acknowledgeQMapDecodeBatch (shared)); + QCOMPARE (shared.ndecodes, 0); + QCOMPARE (shared.nQDecoderDone, 0); +} + +void TestQMapIpc::decoderPublicationPreservesRequests() +{ + QMapSharedMemory shared {}; + shared.decodes.nWDecoderBusy = 1; + shared.decodes.nWTransmitting = 60; + shared.decodes.kHzRequested = 144; + shared.click.action = QMapClickAction::Select; + std::memset (shared.click.selectedDecode, 'x', sizeof shared.click.selectedDecode); + QMapDecodeBlock publication {}; + publication.ndecodes = 2; + + publishQMapDecodeBlock (shared, publication); + + QCOMPARE (shared.decodes.ndecodes, 2); + QCOMPARE (shared.decodes.nWDecoderBusy, 1); + QCOMPARE (shared.decodes.nWTransmitting, 60); + QCOMPARE (shared.decodes.kHzRequested, 144); + QCOMPARE (shared.click.action, QMapClickAction::Select); + QByteArray const selectedDecode {shared.click.selectedDecode, + static_cast (sizeof shared.click.selectedDecode)}; + QCOMPARE (selectedDecode, QByteArray (static_cast (QMapDecodeRowSize), 'x')); +} + +void TestQMapIpc::reportsMappingCapabilities() +{ + QVERIFY (!qmapDecoderRegionAvailable (qmap_decode_ipc::shared_memory_size - 1)); + QVERIFY (qmapDecoderRegionAvailable (qmap_decode_ipc::shared_memory_size)); + QVERIFY (!qmapClickMailboxAvailable (sizeof (QMapSharedMemory) - 1)); + QVERIFY (qmapClickMailboxAvailable (sizeof (QMapSharedMemory))); + QVERIFY (qmapClickMailboxAvailable (QMapSharedMemorySize)); +} + +void TestQMapIpc::clearsOnlyMappedProtocolBytes() +{ + std::array bytes; + bytes.fill (0xA5); + + clearQMapSharedMemory (bytes.data (), sizeof (QMapSharedMemory)); + + for (std::size_t i = 0; i < sizeof (QMapSharedMemory); ++i) + QCOMPARE (bytes[i], static_cast (0)); + for (std::size_t i = sizeof (QMapSharedMemory); i < bytes.size (); ++i) + QCOMPARE (bytes[i], static_cast (0xA5)); + QCOMPARE (qmapClearLength (0), std::size_t {0}); + QCOMPARE (qmapClearLength (QMapSharedMemorySize + 1), QMapSharedMemorySize); +} + +QTEST_GUILESS_MAIN (TestQMapIpc) + +#include "test_qmap_ipc.moc" diff --git a/tests/unit/streaming/CMakeLists.txt b/tests/unit/streaming/CMakeLists.txt new file mode 100644 index 00000000..5a367f45 --- /dev/null +++ b/tests/unit/streaming/CMakeLists.txt @@ -0,0 +1,16 @@ +add_executable (test_streaming_consumers test_streaming_consumers.cpp) +target_link_libraries (test_streaming_consumers Qt5::Test) +target_compile_definitions (test_streaming_consumers PRIVATE + JT9_EXECUTABLE="$" + WSPRD_EXECUTABLE="$" +) + +add_test (NAME test_streaming_consumers COMMAND test_streaming_consumers) +set_tests_properties (test_streaming_consumers PROPERTIES + LABELS "streaming;runtime" + TIMEOUT 120 +) +if (WSJT_ENABLE_TSAN) + set_tests_properties (test_streaming_consumers PROPERTIES + ENVIRONMENT "TSAN_OPTIONS=${wsjt_tsan_fortran_options}") +endif () diff --git a/tests/unit/streaming/test_streaming_consumers.cpp b/tests/unit/streaming/test_streaming_consumers.cpp new file mode 100644 index 00000000..ba605fe1 --- /dev/null +++ b/tests/unit/streaming/test_streaming_consumers.cpp @@ -0,0 +1,373 @@ +#include + +#include +#include +#include +#include +#include + +namespace +{ +constexpr quint32 Jt9AudioCapacityBytes = 30u * 60u * 12000u * 2u; +constexpr quint32 WsprdAudioCapacityBytes = 8u * 114u * 12000u * 2u; +constexpr int Ft4PeriodSamples = 21 * 3456; +constexpr int Jt9TenSecondPeriodSamples = 10 * 12000; + +struct ProcessResult +{ + bool started {}; + bool timedOut {}; + int exitCode {-1}; + QProcess::ExitStatus exitStatus {QProcess::CrashExit}; + QByteArray standardOutput; + QByteArray standardError; +}; + +struct ParsedEvents +{ + QList values; + QString error; +}; + +void appendLittleEndian32 (QByteArray& bytes, quint32 value) +{ + bytes.append (char (value & 0xffu)); + bytes.append (char ((value >> 8) & 0xffu)); + bytes.append (char ((value >> 16) & 0xffu)); + bytes.append (char ((value >> 24) & 0xffu)); +} + +QByteArray sessionHeader () +{ + QByteArray bytes {"WSJT", 4}; + bytes.append ('\0'); + bytes.append ('\1'); + bytes.append ('\x0c'); + bytes.append ('\0'); + return bytes; +} + +QByteArray declaredFrame (quint8 type, quint32 length) +{ + QByteArray bytes; + bytes.append (char (type)); + appendLittleEndian32 (bytes, length); + return bytes; +} + +QByteArray frame (quint8 type, QByteArray const& body) +{ + auto bytes = declaredFrame (type, quint32 (body.size ())); + bytes.append (body); + return bytes; +} + +QByteArray silentAudioFrame (int samples) +{ + return frame (0x01u, QByteArray (samples * 2, '\0')); +} + +QByteArray controlFrame (QByteArray const& json) +{ + return frame (0x02u, json); +} + +ProcessResult runProcess (QString const& executable, QStringList const& arguments, + QByteArray const& input, + QString const& workingDirectory, + int timeoutMs = 30000, + bool closeInput = true) +{ + QProcess process; + process.setProcessChannelMode (QProcess::SeparateChannels); + process.setWorkingDirectory (workingDirectory); + process.start (executable, arguments); + + ProcessResult result; + result.started = process.waitForStarted (5000); + if (!result.started) + { + result.standardError = process.errorString ().toUtf8 (); + return result; + } + + process.write (input); + if (closeInput) + { + process.closeWriteChannel (); + } + if (!process.waitForFinished (timeoutMs)) + { + result.timedOut = true; + process.kill (); + process.waitForFinished (5000); + } + + result.exitCode = process.exitCode (); + result.exitStatus = process.exitStatus (); + result.standardOutput = process.readAllStandardOutput (); + result.standardError = process.readAllStandardError (); + return result; +} + +ParsedEvents parseEvents (QByteArray const& output) +{ + ParsedEvents parsed; + auto const lines = output.split ('\n'); + for (auto const& line : lines) + { + if (line.trimmed ().isEmpty ()) + { + continue; + } + QJsonParseError jsonError; + auto const document = QJsonDocument::fromJson (line, &jsonError); + if (jsonError.error != QJsonParseError::NoError || !document.isObject ()) + { + parsed.error = QString {"invalid JSON event: %1"}.arg ( + QString::fromUtf8 (line)); + return parsed; + } + auto const event = document.object (); + if (event.value ("v").toInt (-1) != 1 || !event.value ("t").isString ()) + { + parsed.error = QString {"invalid event envelope: %1"}.arg ( + QString::fromUtf8 (line)); + return parsed; + } + auto const type = event.value ("t").toString (); + if (type == "error" && event.contains ("code")) + { + auto const code = event.value ("code"); + if (!code.isString () || code.toString ().isEmpty ()) + { + parsed.error = QString {"invalid coded error event: %1"}.arg ( + QString::fromUtf8 (line)); + return parsed; + } + auto const requiresDetail = + code.toString () == "frame_too_large" || + code.toString () == "unknown_mode" || + code.toString () == "invalid_trperiod" || + code.toString () == "invalid_wspr_type" || + code.toString () == "insufficient_audio"; + if (requiresDetail && !event.value ("detail").isString ()) + { + parsed.error = QString {"coded error is missing detail: %1"}.arg ( + QString::fromUtf8 (line)); + return parsed; + } + } + if (type == "warning" && + (!event.value ("code").isString () || + event.value ("code").toString ().isEmpty () || + !event.value ("discarded_samples").isDouble () || + event.value ("discarded_samples").toDouble () < 0.0)) + { + parsed.error = QString {"invalid warning event: %1"}.arg ( + QString::fromUtf8 (line)); + return parsed; + } + parsed.values.append (event); + } + return parsed; +} + +QList eventsMatching (QList const& events, + QString const& type, + QString const& code = {}) +{ + QList matching; + for (auto const& event : events) + { + if (event.value ("t").toString () == type && + (code.isEmpty () || event.value ("code").toString () == code)) + { + matching.append (event); + } + } + return matching; +} + +ProcessResult runJt9 (QByteArray const& input, QStringList options = {}) +{ + QTemporaryDir directory; + if (!directory.isValid ()) + { + return {}; + } + options << "-a" << directory.path () + << "-t" << directory.path () + << "--stream"; + return runProcess (QString::fromUtf8 (JT9_EXECUTABLE), options, input, + directory.path ()); +} + +ProcessResult runWsprd (QByteArray const& input, int timeoutMs = 30000, + bool closeInput = true) +{ + QTemporaryDir directory; + if (!directory.isValid ()) + { + return {}; + } + return runProcess (QString::fromUtf8 (WSPRD_EXECUTABLE), + {"-a", directory.path (), "-H", "-0"}, input, + directory.path (), timeoutMs, closeInput); +} + +void verifyCompleted (ProcessResult const& result, int expectedExitCode) +{ + QVERIFY2 (result.started, result.standardError.constData ()); + QVERIFY2 (!result.timedOut, result.standardError.constData ()); + QCOMPARE (result.exitStatus, QProcess::NormalExit); + QCOMPARE (result.exitCode, expectedExitCode); +} + +ParsedEvents verifyEvents (ProcessResult const& result) +{ + auto const parsed = parseEvents (result.standardOutput); + if (!parsed.error.isEmpty ()) + { + QTest::qFail (qPrintable (parsed.error), __FILE__, __LINE__); + } + if (parsed.values.isEmpty ()) + { + QTest::qFail ("consumer emitted no JSON events", __FILE__, __LINE__); + } + return parsed; +} +} + +class TestStreamingConsumers final : public QObject +{ + Q_OBJECT + +private slots: + void jt9RejectsOversizedFrames_data () + { + QTest::addColumn ("declaredLength"); + QTest::newRow ("over capacity") << Jt9AudioCapacityBytes + 2u; + QTest::newRow ("uint32 max") << std::numeric_limits::max (); + } + + void jt9RejectsOversizedFrames () + { + QFETCH (quint32, declaredLength); + auto const result = runJt9 (sessionHeader () + + declaredFrame (0x01u, declaredLength)); + verifyCompleted (result, 1); + auto const events = verifyEvents (result); + QCOMPARE (eventsMatching (events.values, "error", "frame_too_large").size (), 1); + QCOMPARE (eventsMatching (events.values, "decode").size (), 0); + } + + void jt9RejectsUnknownMode_data () + { + QTest::addColumn ("configure"); + QTest::newRow ("string") + << QByteArray {R"({"t":"configure","mode":"BOGUS","trperiod":1})"}; + QTest::newRow ("numeric") + << QByteArray {R"({"t":"configure","mode":999,"trperiod":1})"}; + } + + void jt9RejectsUnknownMode () + { + QFETCH (QByteArray, configure); + auto const input = sessionHeader () + controlFrame (configure) + + silentAudioFrame (Jt9TenSecondPeriodSamples + 2); + auto const result = runJt9 (input, {"-9", "-p", "10"}); + verifyCompleted (result, 0); + auto const events = verifyEvents (result); + QCOMPARE (eventsMatching (events.values, "error", "unknown_mode").size (), 1); + auto const warnings = eventsMatching ( + events.values, "warning", "period_boundary_discard"); + QCOMPARE (warnings.size (), 1); + QCOMPARE (warnings.front ().value ("discarded_samples").toInt (), 2); + } + + void jt9RejectsOutOfRangeTrperiod_data () + { + QTest::addColumn ("configure"); + QTest::newRow ("zero") + << QByteArray {R"({"t":"configure","trperiod":0})"}; + QTest::newRow ("above maximum") + << QByteArray {R"({"t":"configure","trperiod":1801})"}; + } + + void jt9RejectsOutOfRangeTrperiod () + { + QFETCH (QByteArray, configure); + auto const result = runJt9 (sessionHeader () + controlFrame (configure) + + controlFrame (R"({"t":"halt"})")); + verifyCompleted (result, 0); + auto const events = verifyEvents (result); + QCOMPARE (eventsMatching (events.values, "error", "invalid_trperiod").size (), 1); + QCOMPARE (eventsMatching (events.values, "decode").size (), 0); + } + + void jt9ReportsBoundaryDiscardOnce () + { + auto const exact = runJt9 (sessionHeader () + + silentAudioFrame (Ft4PeriodSamples), {"--ft4"}); + verifyCompleted (exact, 0); + auto const exactEvents = verifyEvents (exact); + QCOMPARE (eventsMatching (exactEvents.values, "warning").size (), 0); + + auto const overflow = runJt9 ( + sessionHeader () + silentAudioFrame (Ft4PeriodSamples + 2), {"--ft4"}); + verifyCompleted (overflow, 0); + auto const overflowEvents = verifyEvents (overflow); + auto const warnings = eventsMatching ( + overflowEvents.values, "warning", "period_boundary_discard"); + QCOMPARE (warnings.size (), 1); + QCOMPARE (warnings.front ().value ("discarded_samples").toInt (), 2); + } + + void wsprdRejectsOversizedFrames_data () + { + QTest::addColumn ("declaredLength"); + QTest::newRow ("over capacity") << WsprdAudioCapacityBytes + 2u; + QTest::newRow ("uint32 max") << std::numeric_limits::max (); + } + + void wsprdRejectsOversizedFrames () + { + QFETCH (quint32, declaredLength); + auto const result = runWsprd (sessionHeader () + + declaredFrame (0x01u, declaredLength)); + verifyCompleted (result, 1); + auto const events = verifyEvents (result); + QCOMPARE (eventsMatching (events.values, "error", "frame_too_large").size (), 1); + QCOMPARE (eventsMatching (events.values, "decode").size (), 0); + } + + void wsprdDispatchesConfigureStructurally () + { + auto const configure = QByteArray { + R"({"t":"configure","date":"260822","time":"1200","dialfreq":14.0956,"wspr_type":2,"mycall":"halt","mygrid":"FN20"})"}; + auto const result = runWsprd (sessionHeader () + controlFrame (configure) + + controlFrame (R"({"t":"halt"})")); + verifyCompleted (result, 1); + auto const events = verifyEvents (result); + QCOMPARE (eventsMatching (events.values, "error", "insufficient_audio").size (), 1); + QCOMPARE (eventsMatching (events.values, "error", "missing_configure").size (), 0); + } + + void wsprdRejectsInvalidWsprType () + { + auto const configure = QByteArray { + R"({"t":"configure","date":"260822","time":"1200","dialfreq":14.0956,"wspr_type":3})"}; + auto const result = runWsprd (sessionHeader () + controlFrame (configure), + 3000, false); + verifyCompleted (result, 1); + auto const events = verifyEvents (result); + QCOMPARE (eventsMatching (events.values, "error", "invalid_wspr_type").size (), 1); + QCOMPARE (eventsMatching (events.values, "decode").size (), 0); + QCOMPARE (eventsMatching (events.values, "decode_finished").size (), 0); + } +}; + +QTEST_GUILESS_MAIN (TestStreamingConsumers) + +#include "test_streaming_consumers.moc" diff --git a/tests/unit/superfox/CMakeLists.txt b/tests/unit/superfox/CMakeLists.txt new file mode 100644 index 00000000..3334a12c --- /dev/null +++ b/tests/unit/superfox/CMakeLists.txt @@ -0,0 +1,31 @@ +add_executable (test_superfox_pack test_superfox_pack.f90) +target_include_directories (test_superfox_pack PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_superfox_pack) + +add_test (NAME test_superfox_pack COMMAND test_superfox_pack) + +add_executable (test_superfox_tx_handoff test_superfox_tx_handoff.f90) +target_include_directories (test_superfox_tx_handoff PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_superfox_tx_handoff) + +add_test (NAME test_superfox_tx_handoff COMMAND test_superfox_tx_handoff) + +add_executable (test_superfox_unpack test_superfox_unpack.f90) +target_include_directories (test_superfox_unpack PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_superfox_unpack) + +add_test (NAME test_superfox_unpack COMMAND test_superfox_unpack) +set_tests_properties (test_superfox_unpack PROPERTIES + PASS_REGULAR_EXPRESSION "CQ K1JT FN20;.*2S/IZFUZBRXJF") + +add_executable (test_superfox_unpack_unsupported + test_superfox_unpack_unsupported.f90) +target_include_directories (test_superfox_unpack_unsupported + PRIVATE ${CMAKE_BINARY_DIR}) +wsjt_link_common_fortran (test_superfox_unpack_unsupported) + +add_test (NAME test_superfox_unpack_unsupported + COMMAND test_superfox_unpack_unsupported) +set_tests_properties (test_superfox_unpack_unsupported PROPERTIES + PASS_REGULAR_EXPRESSION "unsupported i3=1 ignored" + FAIL_REGULAR_EXPRESSION "~") diff --git a/tests/unit/superfox/test_superfox_pack.f90 b/tests/unit/superfox/test_superfox_pack.f90 new file mode 100644 index 00000000..e204262f --- /dev/null +++ b/tests/unit/superfox/test_superfox_pack.f90 @@ -0,0 +1,456 @@ +program test_superfox_pack + + implicit none + + integer :: ntests + integer, parameter :: SFOX_PACK_OK=0 + integer, parameter :: SFOX_PACK_BAD_TOKEN=1 + integer, parameter :: SFOX_PACK_BAD_OTP=2 + integer, parameter :: SFOX_PACK_BAD_CQ=3 + integer, parameter :: SFOX_PACK_BAD_CALL=4 + integer, parameter :: SFOX_PACK_BAD_REPORT=5 + integer, parameter :: SFOX_PACK_BAD_FREE_TEXT=6 + + ntests=0 + + call expect_cq_round_trip('CQ K1JT FN20','K1JT','FN20') + call expect_cq_round_trip('CQ PJ4/K1ABC FK52','PJ4/K1ABC','FK52') + call expect_cq_round_trip('CQ K1JT AA00','K1JT','AA00') + call expect_cq_round_trip('CQ K1JT RR99','K1JT','RR99') + call expect_crc_vector() + call expect_invalid_pack('CQ',SFOX_PACK_BAD_CQ) + call expect_invalid_pack('CQ K1JT',SFOX_PACK_BAD_CQ) + call expect_invalid_pack('CQ K1@JT FN20',SFOX_PACK_BAD_CQ) + call expect_invalid_pack('CQ K1JT FN2@',SFOX_PACK_BAD_CQ) + call expect_invalid_pack('CQ K1JT FN2',SFOX_PACK_BAD_CQ) + call expect_invalid_pack('CQ K1JT FN200',SFOX_PACK_BAD_CQ) + call expect_invalid_pack('CQ K1JT SS00',SFOX_PACK_BAD_CQ) + call expect_invalid_pack('CQ AB FN20',SFOX_PACK_BAD_CQ) + call expect_invalid_pack('CQ 123456789012 FN20',SFOX_PACK_BAD_CQ) + call expect_invalid_pack('CQ k1jt FN20',SFOX_PACK_BAD_CQ) + call expect_invalid_pack('CQ K1JT FN20 EXTRA',SFOX_PACK_BAD_CQ) + call expect_invalid_pack(' ',SFOX_PACK_BAD_TOKEN) + + call expect_standard_message('K1JT W1AW','K1JT','W1AW') + call expect_standard_report('K1JT W1AW +05','K1JT','W1AW',5) + call expect_standard_report('K1JT W1AW +12','K1JT','W1AW',12) + call expect_standard_report('K1JT W1AW -18','K1JT','W1AW',-18) + call expect_standard_message('K1JT W1AW AA5AU K9AN','K1JT','W1AW') + call expect_standard_message('K1JT W1AW AA5AU K9AN','K1JT','AA5AU') + call expect_standard_message('K1JT W1AW AA5AU K9AN','K1JT','K9AN') + call expect_invalid_pack('K1JT Q1ABC',SFOX_PACK_BAD_CALL) + call expect_invalid_pack('K1JT W1AW +13',SFOX_PACK_BAD_REPORT) + call expect_invalid_pack('K1JT W1AW -19',SFOX_PACK_BAD_REPORT) + call expect_invalid_pack('K1JT W1AW +XX',SFOX_PACK_BAD_REPORT) + call expect_invalid_pack('K1JT VERYLONGTOKEN1',SFOX_PACK_BAD_TOKEN) + call expect_too_many_words() + + call expect_free_text_message('K1JT W1AW','HELLO SUPERFOX') + call expect_free_text_message('K1JT W1AW','ABC+-./? 123') + call expect_free_text_four_report_records() + call expect_free_text_four_mixed_records() + call expect_invalid_free_text_capacity() + call expect_no_free_text_full_capacity() + call expect_invalid_no_free_text_capacity() + call expect_invalid_free_text('K1JT W1AW','hello superfox') + call expect_invalid_free_text('K1JT W1AW','HELLO:SUPERFOX') + call expect_invalid_otp('K1JT W1AW') + + call expect_more_cqs('K1JT') + call expect_otp_bits('K1JT W1AW',123456) + + write(*,1000) ntests +1000 format('superfox pack tests passed: ',i0) + +contains + + subroutine expect_crc_vector() + character(len=120) :: line + character(len=26) :: free_text + character(len=10) :: ckey + integer(kind=1) :: xin(0:49), raw(0:49) + integer :: crc21, i, pack_error + logical(kind=1) :: more_cqs, send_msg + + line='CQ K1JT FN20' + free_text=' ' + ckey='0000000000' + more_cqs=.false. + send_msg=.false. + call sfox_pack(line,ckey,more_cqs,send_msg,free_text,xin,pack_error) + call assert_int('SuperFox CRC pack status',SFOX_PACK_OK,pack_error) + do i=0,49 + raw(i)=xin(49-i) + enddo + crc21=128*128*raw(47)+128*raw(48)+raw(49) + call assert_int('SuperFox CRC21',1361017,crc21) + ntests=ntests+1 + end subroutine expect_crc_vector + + subroutine expect_standard_message(input,expected_fox,expected_hound) + character(len=*), intent(in) :: input, expected_fox, expected_hound + character(len=329) :: msgbits + character(len=13) :: got_fox + integer :: i3 + + call pack_and_decode_bits(input,.false.,.false.,' ',0,msgbits,i3) + call assert_int('SuperFox standard type',0,i3) + call decode_pack28_field(msgbits,1,got_fox) + call assert_text('SuperFox fox call',expected_fox,got_fox) + call assert_hound_present(msgbits,expected_hound) + + ntests=ntests+1 + end subroutine expect_standard_message + + subroutine expect_standard_report(input,expected_fox,expected_hound, & + expected_report) + character(len=*), intent(in) :: input, expected_fox, expected_hound + integer, intent(in) :: expected_report + character(len=329) :: msgbits + character(len=13) :: got_fox, got_hound + integer :: i3, report + + call pack_and_decode_bits(input,.false.,.false.,' ',0,msgbits,i3) + call assert_int('SuperFox report type',0,i3) + call decode_pack28_field(msgbits,1,got_fox) + call assert_text('SuperFox report fox call',expected_fox,got_fox) + call decode_pack28_field(msgbits,169,got_hound) + call assert_text('SuperFox report hound call',expected_hound,got_hound) + read(msgbits(281:285),'(b5)') report + call assert_int('SuperFox report',expected_report,report-18) + + ntests=ntests+1 + end subroutine expect_standard_report + + subroutine expect_free_text_message(input,free_text) + use packjt77, only: unpacktext77 + character(len=*), intent(in) :: input, free_text + character(len=329) :: msgbits + character(len=26) :: decoded + integer :: i3 + + call pack_and_decode_bits(input,.false.,.true.,free_text,0,msgbits,i3) + call assert_int('SuperFox free-text type',2,i3) + call unpacktext77(msgbits(161:231),decoded(1:13)) + call unpacktext77(msgbits(232:302),decoded(14:26)) + call trim_dots(decoded) + call assert_text('SuperFox free text',free_text,decoded) + + ntests=ntests+1 + end subroutine expect_free_text_message + + subroutine expect_invalid_free_text(input,free_text) + character(len=*), intent(in) :: input, free_text + character(len=329) :: msgbits + integer :: i3 + + call pack_and_decode_bits_allow_failure(input,.false.,.true.,free_text, & + 0,msgbits,i3,SFOX_PACK_BAD_FREE_TEXT) + ntests=ntests+1 + end subroutine expect_invalid_free_text + + subroutine expect_free_text_four_report_records() + character(len=329) :: msgbits + integer :: i3 + + call pack_and_decode_bits('K1JT K1RAA -01 K1RAB -02 K1RAC -03 K1RAD -04', & + .false.,.true.,'HELLO SUPERFOX',0,msgbits,i3) + call assert_int('SuperFox free-text four reports type',2,i3) + call assert_hound_present(msgbits,'K1RAA') + call assert_hound_present(msgbits,'K1RAB') + call assert_hound_present(msgbits,'K1RAC') + call assert_hound_present(msgbits,'K1RAD') + + ntests=ntests+1 + end subroutine expect_free_text_four_report_records + + subroutine expect_free_text_four_mixed_records() + character(len=329) :: msgbits + integer :: i3 + + call pack_and_decode_bits('K1JT K1RRA K1RRB K1RPC -03 K1RPD -04', & + .false.,.true.,'HELLO SUPERFOX',0,msgbits,i3) + call assert_int('SuperFox free-text mixed type',2,i3) + call assert_hound_present(msgbits,'K1RRA') + call assert_hound_present(msgbits,'K1RRB') + call assert_hound_present(msgbits,'K1RPC') + call assert_hound_present(msgbits,'K1RPD') + + ntests=ntests+1 + end subroutine expect_free_text_four_mixed_records + + subroutine expect_invalid_free_text_capacity() + call expect_invalid_pack_with_free_text( & + 'K1JT K1RAA -01 K1RAB -02 K1RAC -03 K1RAD -04 K1RAE -05', & + SFOX_PACK_BAD_TOKEN) + end subroutine expect_invalid_free_text_capacity + + subroutine expect_no_free_text_full_capacity() + character(len=329) :: msgbits + integer :: i3 + + call pack_and_decode_bits( & + 'K1JT K1AAA K1AAB K1AAC K1AAD K1AAE K1AAF -01 K1AAG -02 K1AAH -03 K1AAI -04', & + .false.,.false.,' ',0,msgbits,i3) + call assert_int('SuperFox no-free-text full capacity type',0,i3) + call assert_hound_present(msgbits,'K1AAA') + call assert_hound_present(msgbits,'K1AAE') + call assert_hound_present(msgbits,'K1AAF') + call assert_hound_present(msgbits,'K1AAI') + + ntests=ntests+1 + end subroutine expect_no_free_text_full_capacity + + subroutine expect_invalid_no_free_text_capacity() + call expect_invalid_pack( & + 'K1JT K1AAA K1AAB K1AAC K1AAD K1AAE K1AAF', & + SFOX_PACK_BAD_TOKEN) + end subroutine expect_invalid_no_free_text_capacity + + subroutine expect_more_cqs(input) + character(len=*), intent(in) :: input + character(len=329) :: msgbits + integer :: i3 + + call pack_and_decode_bits(input,.true.,.false.,' ',0,msgbits,i3) + if(msgbits(306:306).ne.'1') then + write(*,1040) trim(input) +1040 format('SuperFox more-CQs bit was not set for "',a,'"') + error stop 1 + endif + + ntests=ntests+1 + end subroutine expect_more_cqs + + subroutine expect_otp_bits(input,expected_otp) + character(len=*), intent(in) :: input + integer, intent(in) :: expected_otp + character(len=329) :: msgbits + integer :: i3, got_otp + + call pack_and_decode_bits(input,.false.,.false.,' ',expected_otp,msgbits,i3) + read(msgbits(307:326),'(b20)') got_otp + call assert_int('SuperFox OTP bits',expected_otp,got_otp) + + ntests=ntests+1 + end subroutine expect_otp_bits + + subroutine expect_cq_round_trip(input,expected_call,expected_grid) + character(len=*), intent(in) :: input, expected_call, expected_grid + character(len=11) :: got_call + character(len=4) :: got_grid + integer :: i3 + + call pack_and_decode_cq(input,i3,got_call,got_grid) + call assert_int('SuperFox CQ type',3,i3) + call assert_text('SuperFox CQ call',expected_call,got_call) + call assert_text('SuperFox CQ grid',expected_grid,got_grid) + + ntests=ntests+1 + end subroutine expect_cq_round_trip + + subroutine expect_invalid_pack(input,expected_error) + character(len=*), intent(in) :: input + integer, intent(in) :: expected_error + character(len=329) :: msgbits + integer :: i3 + + call pack_and_decode_bits_allow_failure(input,.false.,.false.,' ',0, & + msgbits,i3,expected_error) + ntests=ntests+1 + end subroutine expect_invalid_pack + + subroutine expect_invalid_pack_with_free_text(input,expected_error) + character(len=*), intent(in) :: input + integer, intent(in) :: expected_error + character(len=329) :: msgbits + integer :: i3 + + call pack_and_decode_bits_allow_failure(input,.false.,.true., & + 'HELLO SUPERFOX',0,msgbits,i3,expected_error) + ntests=ntests+1 + end subroutine expect_invalid_pack_with_free_text + + subroutine expect_too_many_words() + call expect_invalid_pack( & + 'K1JT K1AA K1AB K1AC K1AD K1AE K1AF K1AG K1AH K1AI ' // & + 'K1AJ K1AK K1AL K1AM K1AN K1AO K1AP', & + SFOX_PACK_BAD_TOKEN) + end subroutine expect_too_many_words + + subroutine expect_invalid_otp(input) + character(len=*), intent(in) :: input + character(len=329) :: msgbits + integer :: i3 + + call pack_and_decode_bits_with_ckey(input,.false.,.false.,' ', & + 'OTP:BROKEN',msgbits,i3,SFOX_PACK_BAD_OTP) + ntests=ntests+1 + end subroutine expect_invalid_otp + + subroutine pack_and_decode_cq(input,i3,call_out,grid_out) + character(len=*), intent(in) :: input + integer, intent(out) :: i3 + character(len=11), intent(out) :: call_out + character(len=4), intent(out) :: grid_out + character(len=329) :: msgbits + character(len=38) :: c + integer(kind=8) :: n58 + integer :: i, j, n15 + + c=' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/' + call pack_and_decode_bits(input,.false.,.false.,' ',0,msgbits,i3) + + call_out=' ' + grid_out=' ' + if(i3.ne.3) return + + read(msgbits(1:58),'(b58)') n58 + do i=11,1,-1 + j=mod(n58,38_8)+1 + call_out(i:i)=c(j:j) + n58=n58/38_8 + enddo + call_out=adjustl(call_out) + read(msgbits(59:73),'(b15)') n15 + call unpackgrid(n15,grid_out) + end subroutine pack_and_decode_cq + + subroutine pack_and_decode_bits(input,more_cqs,send_msg,free_text,otp, & + msgbits,i3) + character(len=*), intent(in) :: input, free_text + logical, intent(in) :: more_cqs, send_msg + integer, intent(in) :: otp + character(len=329), intent(out) :: msgbits + integer, intent(out) :: i3 + + call pack_and_decode_bits_allow_failure(input,more_cqs,send_msg, & + free_text,otp,msgbits,i3,SFOX_PACK_OK) + end subroutine pack_and_decode_bits + + subroutine pack_and_decode_bits_allow_failure(input,more_cqs,send_msg, & + free_text,otp,msgbits,i3,expected_error) + character(len=*), intent(in) :: input, free_text + logical, intent(in) :: more_cqs, send_msg + integer, intent(in) :: otp + integer, intent(in) :: expected_error + character(len=329), intent(out) :: msgbits + integer, intent(out) :: i3 + character(len=10) :: ckey + + write(ckey,1000) otp +1000 format('0000',i6.6) + call pack_and_decode_bits_with_ckey(input,more_cqs,send_msg,free_text, & + ckey,msgbits,i3,expected_error) + end subroutine pack_and_decode_bits_allow_failure + + subroutine pack_and_decode_bits_with_ckey(input,more_cqs,send_msg, & + free_text,ckey,msgbits,i3,expected_error) + character(len=*), intent(in) :: input, free_text, ckey + logical, intent(in) :: more_cqs, send_msg + integer, intent(in) :: expected_error + character(len=329), intent(out) :: msgbits + integer, intent(out) :: i3 + character(len=120) :: line + character(len=26) :: free_text_26 + integer(kind=1) :: xin(0:49), raw(0:49) + logical(kind=1) :: more_cqs_1, send_msg_1 + integer :: i, pack_error + + line=' ' + line=input + free_text_26=' ' + free_text_26=free_text + more_cqs_1=more_cqs + send_msg_1=send_msg + xin=0 + raw=0 + + call sfox_pack(line,ckey,more_cqs_1,send_msg_1,free_text_26,xin, & + pack_error) + if(pack_error.ne.expected_error) then + write(*,1010) trim(input), expected_error, pack_error +1010 format('SuperFox pack status mismatch for "',a,'"; expected ',i0, & + ' got ',i0) + error stop 1 + endif + if(expected_error.ne.SFOX_PACK_OK) then + msgbits='0' + i3=-1 + return + endif + + do i=0,49 + raw(i)=xin(49-i) + enddo + write(msgbits,1020) raw(0:46) +1020 format(47b7.7) + read(msgbits(327:329),'(b3)') i3 + end subroutine pack_and_decode_bits_with_ckey + + subroutine decode_pack28_field(msgbits,first_bit,call_out) + use packjt77, only: unpack28 + character(len=*), intent(in) :: msgbits + integer, intent(in) :: first_bit + character(len=13), intent(out) :: call_out + logical :: success + integer :: n28 + + call_out=' ' + read(msgbits(first_bit:first_bit+27),'(b28)') n28 + call unpack28(n28,call_out,success) + if(.not.success) then + write(*,1050) first_bit, n28 +1050 format('SuperFox pack28 decode failed at bit ',i0,' n28=',i0) + error stop 1 + endif + end subroutine decode_pack28_field + + subroutine assert_hound_present(msgbits,expected_hound) + character(len=*), intent(in) :: msgbits, expected_hound + character(len=13) :: got_hound + integer :: i, first_bit + + do i=1,9 + first_bit=28*i + 1 + call decode_pack28_field(msgbits,first_bit,got_hound) + if(trim(got_hound).eq.expected_hound) return + enddo + + write(*,1060) trim(expected_hound) +1060 format('SuperFox hound call "',a,'" was not present') + error stop 1 + end subroutine assert_hound_present + + subroutine trim_dots(text) + character(len=*), intent(inout) :: text + integer :: i + + do i=len(text),1,-1 + if(text(i:i).ne.'.') exit + text(i:i)=' ' + enddo + end subroutine trim_dots + + subroutine assert_int(label,expected,got) + character(len=*), intent(in) :: label + integer, intent(in) :: expected, got + + if(got.ne.expected) then + write(*,1070) trim(label), expected, got +1070 format(a,' failure; expected ',i0,' got ',i0) + error stop 1 + endif + end subroutine assert_int + + subroutine assert_text(label,expected,got) + character(len=*), intent(in) :: label, expected, got + + if(trim(got).ne.expected) then + write(*,1080) trim(label), trim(expected), trim(got) +1080 format(a,' failure; expected "',a,'" got "',a,'"') + error stop 1 + endif + end subroutine assert_text + +end program test_superfox_pack diff --git a/tests/unit/superfox/test_superfox_tx_handoff.f90 b/tests/unit/superfox/test_superfox_tx_handoff.f90 new file mode 100644 index 00000000..52a8033c --- /dev/null +++ b/tests/unit/superfox/test_superfox_tx_handoff.f90 @@ -0,0 +1,121 @@ +program test_superfox_tx_handoff + + implicit none + + integer, parameter :: NN=79 + integer, parameter :: NWAVE=(160+2)*134400*4 + real :: wave(NWAVE) + integer :: nslots, nfreq, i3bit(5), itone2(NN), itone3(151) + integer :: nslots2, nDataSlots + integer :: pack_error, i3 + integer(kind=1) :: mycall(12), msgbits2(77), xin(0:49), raw(0:49) + logical(kind=1) :: bSuperFox, bMoreCQs, bSendMsg + character(len=40) :: cmsg(5), cmsg2(5) + character(len=26) :: textMsg, freeTextMsg + character(len=120) :: line + character(len=11) :: foxcall + character(len=10) :: ckey + character(len=329) :: msgbits + character(len=13) :: got + integer :: i + + common/foxcom/wave,nslots,nfreq,i3bit,cmsg,mycall,textMsg,bMoreCQs,bSendMsg + common/foxcom2/itone2,msgbits2 + common/foxcom3/nslots2,cmsg2,itone3 + + wave=0.0 + nslots=4 + nfreq=750 + i3bit=0 + cmsg=' ' + mycall=0 + textMsg='HELLO SUPERFOX' + bMoreCQs=.false. + bSendMsg=.true. + + cmsg(1)='K1RAA K1JT -01' + cmsg(2)='K1RAB K1JT -02' + cmsg(3)='K1RAC K1JT -03' + cmsg(4)='K1RAD K1JT -04' + + bSuperFox=.true. + call foxgen(bSuperFox,' ') + + call assert_int('foxgen SuperFox row count',5,nslots2) + call assert_text('foxgen fourth data row','K1RAD K1JT -04',cmsg2(4)(1:14)) + call assert_text('foxgen free text row','HELLO SUPERFOX',cmsg2(5)(1:14)) + if(cmsg2(5)(39:39).ne.'1') error stop 'foxgen did not flag free text row' + + freeTextMsg=' ' + bMoreCQs=cmsg2(1)(40:40).eq.'1' + bSendMsg=cmsg2(nslots2)(39:39).eq.'1' + nDataSlots=nslots2 + if(bSendMsg) then + freeTextMsg=cmsg2(nslots2)(1:26) + nDataSlots=nslots2-1 + if(nDataSlots.gt.4) nDataSlots=4 + endif + + call foxgen2(nDataSlots,cmsg2,line,foxcall) + ckey='0000000000' + call sfox_pack(line,ckey,bMoreCQs,bSendMsg,freeTextMsg,xin,pack_error) + call assert_int('SuperFox handoff pack status',0,pack_error) + + do i=0,49 + raw(i)=xin(49-i) + enddo + write(msgbits,1000) raw(0:46) +1000 format(47b7.7) + read(msgbits(327:329),'(b3)') i3 + call assert_int('SuperFox handoff message type',2,i3) + + call decode_pack28_field(msgbits,29,got) + call assert_text('first SuperFox report hound','K1RAA',got) + call decode_pack28_field(msgbits,57,got) + call assert_text('second SuperFox report hound','K1RAB',got) + call decode_pack28_field(msgbits,85,got) + call assert_text('third SuperFox report hound','K1RAC',got) + call decode_pack28_field(msgbits,113,got) + call assert_text('fourth SuperFox report hound','K1RAD',got) + call assert_text('SuperFox handoff free text','HELLO SUPERFOX',freeTextMsg(1:14)) + + write(*,*) 'superfox tx handoff test passed' + +contains + + subroutine decode_pack28_field(bits,first_bit,call_out) + use packjt77, only: unpack28 + character(len=*), intent(in) :: bits + integer, intent(in) :: first_bit + character(len=13), intent(out) :: call_out + logical :: success + integer :: n28 + + call_out=' ' + read(bits(first_bit:first_bit+27),'(b28)') n28 + call unpack28(n28,call_out,success) + if(.not.success) error stop 'pack28 decode failed' + end subroutine decode_pack28_field + + subroutine assert_int(label,expected,got) + character(len=*), intent(in) :: label + integer, intent(in) :: expected, got + + if(got.ne.expected) then + write(*,1010) trim(label), expected, got +1010 format(a,' failure; expected ',i0,' got ',i0) + error stop 1 + endif + end subroutine assert_int + + subroutine assert_text(label,expected,got) + character(len=*), intent(in) :: label, expected, got + + if(trim(got).ne.expected) then + write(*,1020) trim(label), trim(expected), trim(got) +1020 format(a,' failure; expected "',a,'" got "',a,'"') + error stop 1 + endif + end subroutine assert_text + +end program test_superfox_tx_handoff diff --git a/tests/unit/superfox/test_superfox_unpack.f90 b/tests/unit/superfox/test_superfox_unpack.f90 new file mode 100644 index 00000000..8a243ed4 --- /dev/null +++ b/tests/unit/superfox/test_superfox_unpack.f90 @@ -0,0 +1,28 @@ +program test_superfox_unpack + + implicit none + + integer*1 xin(0:49), xdec(0:49) + logical*1 more_cqs, send_msg + character*120 line + character*26 free_text + character*10 ckey + character*13 foxcall + integer notp, pack_error + + line='CQ K1JT FN20' + free_text='2S/IZFUZBRXJF ' + ckey='0000123456' + more_cqs=.false. + send_msg=.true. + + call sfox_pack(line,ckey,more_cqs,send_msg,free_text,xin,pack_error) + if(pack_error.ne.0) error stop 'sfox_pack failed' + + xdec=xin(49:0:-1) + + notp=0 + foxcall='' + call sfox_unpack(123456,xdec,0,1500.0,0.0,foxcall,notp) + +end program test_superfox_unpack diff --git a/tests/unit/superfox/test_superfox_unpack_unsupported.f90 b/tests/unit/superfox/test_superfox_unpack_unsupported.f90 new file mode 100644 index 00000000..c4f5d86c --- /dev/null +++ b/tests/unit/superfox/test_superfox_unpack_unsupported.f90 @@ -0,0 +1,35 @@ +program test_superfox_unpack_unsupported + + implicit none + + integer*1 xin(0:49), xdec(0:49) + logical*1 more_cqs, send_msg + character*120 line + character*26 free_text + character*10 ckey + character*13 foxcall + character*329 msgbits + integer notp, pack_error + + line='K1JT W1AW' + free_text=' ' + ckey='0000123456' + more_cqs=.false. + send_msg=.false. + + call sfox_pack(line,ckey,more_cqs,send_msg,free_text,xin,pack_error) + if(pack_error.ne.0) error stop 'sfox_pack failed' + + xdec=xin(49:0:-1) + write(msgbits,1000) xdec(0:46) +1000 format(47b7.7) + msgbits(327:329)='001' + read(msgbits,1001) xdec(0:46) +1001 format(47b7) + + notp=0 + foxcall='' + call sfox_unpack(123456,xdec,0,1500.0,0.0,foxcall,notp) + write(*,*) 'unsupported i3=1 ignored' + +end program test_superfox_unpack_unsupported diff --git a/tests/unit/tci/CMakeLists.txt b/tests/unit/tci/CMakeLists.txt new file mode 100644 index 00000000..abe6fed1 --- /dev/null +++ b/tests/unit/tci/CMakeLists.txt @@ -0,0 +1,55 @@ +add_executable (test_tci_stream + test_tci_stream.cpp +) +target_link_libraries (test_tci_stream Qt5::Test) +add_test (NAME test_tci_stream COMMAND test_tci_stream) + +add_executable (test_tci_protocol + test_tci_protocol.cpp +) +target_link_libraries (test_tci_protocol Qt5::Test) +add_test (NAME test_tci_protocol COMMAND test_tci_protocol) + +add_library (tci_simulator STATIC + TciSimScript.cpp + TciSimScript.hpp + TciSimServer.cpp + TciSimServer.hpp +) +target_include_directories (tci_simulator PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries (tci_simulator PUBLIC Qt5::Core Qt5::Network Qt5::WebSockets) + +add_executable (test_tci_sim_smoke test_tci_sim_smoke.cpp) +target_link_libraries (test_tci_sim_smoke PRIVATE tci_simulator Qt5::Test) +add_test (NAME test_tci_sim_smoke COMMAND test_tci_sim_smoke) +set_tests_properties (test_tci_sim_smoke PROPERTIES TIMEOUT 30) + +add_executable (test_tci_transceiver_characterization + test_tci_transceiver_characterization.cpp +) +target_link_libraries (test_tci_transceiver_characterization PRIVATE + tci_simulator wsjt_qt wsjt_fort_common Qt5::Test) +add_test (NAME test_tci_transceiver_characterization + COMMAND test_tci_transceiver_characterization) +set_tests_properties (test_tci_transceiver_characterization PROPERTIES + COST 32 + TIMEOUT 120) + +add_executable (test_transceiver_base_period test_transceiver_base_period.cpp) +target_include_directories (test_transceiver_base_period PRIVATE ${CMAKE_SOURCE_DIR}) +target_link_libraries (test_transceiver_base_period PRIVATE wsjt_qt Qt5::Test) +add_test (NAME test_transceiver_base_period COMMAND test_transceiver_base_period) + +add_executable (test_tci_receive_ownership + test_tci_receive_ownership.cpp + ${CMAKE_SOURCE_DIR}/FastDecode.cpp) +target_include_directories (test_tci_receive_ownership PRIVATE ${CMAKE_BINARY_DIR}) +target_link_libraries (test_tci_receive_ownership PRIVATE + tci_simulator wsjt_qt wsjt_fort_common Qt5::Test) +add_test (NAME test_tci_receive_ownership COMMAND test_tci_receive_ownership) +set_tests_properties (test_tci_receive_ownership PROPERTIES + TIMEOUT 120 LABELS "receive-handoff;tci-receive") +if (WSJT_ENABLE_TSAN) + set_tests_properties (test_tci_receive_ownership PROPERTIES + ENVIRONMENT "TSAN_OPTIONS=halt_on_error=1:exitcode=66") +endif () diff --git a/tests/unit/tci/TciSimScript.cpp b/tests/unit/tci/TciSimScript.cpp new file mode 100644 index 00000000..ff8b6400 --- /dev/null +++ b/tests/unit/tci/TciSimScript.cpp @@ -0,0 +1,416 @@ +#include "TciSimScript.hpp" + +#include + +#include + +#include "moc_TciSimScript.cpp" + +TciSimScript::TciSimScript (TciSimServer * server, QObject * parent) + : QObject {parent} + , server_ {server} +{ + poll_timer_.setInterval (5); + delay_timer_.setSingleShot (true); + overall_timer_.setSingleShot (true); + connect (&poll_timer_, &QTimer::timeout, + this, &TciSimScript::poll_step); + connect (&delay_timer_, &QTimer::timeout, + this, &TciSimScript::delayed_step_ready); + connect (&overall_timer_, &QTimer::timeout, + this, &TciSimScript::overall_timeout); + connect (server_, &TciSimServer::client_gone, this, + [this] (int generation) + { + if (generation != close_generation_) return; + close_observed_ = true; + cursor_ = server_->cursor (server_->transcript ().size ()); + }); +} + +TciSimScript& TciSimScript::greet ( + TciSimGreeting greeting_value, int timeout_ms) +{ + steps_.push_back ({StepKind::Greet, {}, {}, qMax (0, timeout_ms), + greeting_value}); + return *this; +} + +TciSimScript& TciSimScript::expect ( + QString verb, ArgsPredicate predicate, int timeout_ms) +{ + append_expectation (StepKind::Expect, std::move (verb), + std::move (predicate), timeout_ms); + return *this; +} + +TciSimScript& TciSimScript::reply (QString text, int delay_ms) +{ + steps_.push_back ({StepKind::Reply, std::move (text), {}, + qMax (0, delay_ms), TciSimGreeting::Minimal}); + return *this; +} + +TciSimScript& TciSimScript::push (QString text, int delay_ms) +{ + steps_.push_back ({StepKind::Push, std::move (text), {}, + qMax (0, delay_ms), TciSimGreeting::Minimal}); + return *this; +} + +TciSimScript& TciSimScript::withhold ( + QString verb, ArgsPredicate predicate, int timeout_ms) +{ + append_expectation (StepKind::Withhold, std::move (verb), + std::move (predicate), timeout_ms); + return *this; +} + +TciSimScript& TciSimScript::delay (int delay_ms) +{ + steps_.push_back ({StepKind::Delay, {}, {}, qMax (0, delay_ms), + TciSimGreeting::Minimal}); + return *this; +} + +TciSimScript& TciSimScript::close_normally (QString reason) +{ + steps_.push_back ({StepKind::CloseNormally, std::move (reason), {}, 2000, + TciSimGreeting::Minimal}); + return *this; +} + +TciSimScript& TciSimScript::reconnect (int timeout_ms) +{ + steps_.push_back ({StepKind::Reconnect, {}, {}, qMax (0, timeout_ms), + TciSimGreeting::Minimal}); + return *this; +} + +void TciSimScript::start (int overall_timeout_ms) +{ + if (running_) return; + + running_ = true; + succeeded_ = false; + current_step_ = 0; + reconnect_after_generation_ = server_->connection_generation (); + active_connection_generation_ = server_->client_connected () + ? server_->connection_generation () : 0; + last_consumed_generation_ = 0; + delayed_step_generation_ = 0; + close_generation_ = 0; + close_observed_ = false; + has_consumed_expectation_ = false; + close_requested_ = false; + cursor_ = server_->cursor (); + last_error_.clear (); + overall_timer_.start (qMax (1, overall_timeout_ms)); + QTimer::singleShot (0, this, &TciSimScript::execute_step); +} + +bool TciSimScript::run (int overall_timeout_ms) +{ + QEventLoop loop; + connect (this, &TciSimScript::finished, &loop, &QEventLoop::quit); + start (overall_timeout_ms); + if (running_) loop.exec (); + return succeeded_; +} + +void TciSimScript::stop () +{ + if (running_) fail (QStringLiteral ("script stopped")); +} + +bool TciSimScript::running () const +{ + return running_; +} + +bool TciSimScript::succeeded () const +{ + return succeeded_; +} + +int TciSimScript::failed_step () const +{ + return succeeded_ ? -1 : current_step_ + 1; +} + +QString TciSimScript::last_error () const +{ + return last_error_; +} + +QStringList TciSimScript::greeting_messages (TciSimGreeting greeting) +{ + switch (greeting) + { + case TciSimGreeting::Thetis: + return { + QStringLiteral ("protocol:Thetis,1.6"), + QStringLiteral ("device:HermesLite"), + QStringLiteral ("trx_count:1"), + QStringLiteral ("channels_count:2"), + QStringLiteral ("vfo:0,0,14074000"), + QStringLiteral ("vfo:0,1,14075000"), + QStringLiteral ("modulation:0,digu"), + QStringLiteral ("split_enable:0,false"), + QStringLiteral ("trx:0,false"), + QStringLiteral ("start"), + QStringLiteral ("ready"), + }; + case TciSimGreeting::Minimal: + return { + QStringLiteral ("protocol:TCI,1.6"), + QStringLiteral ("start"), + QStringLiteral ("ready"), + }; + } + return {}; +} + +void TciSimScript::execute_step () +{ + if (!running_) return; + if (current_step_ >= static_cast (steps_.size ())) + { + finish (true); + return; + } + + auto const& step = steps_.at (current_step_); + switch (step.kind) + { + case StepKind::Greet: + if (!server_->client_connected ()) + { + start_polling (step.timeout_ms); + return; + } + active_connection_generation_ = server_->connection_generation (); + last_consumed_generation_ = 0; + has_consumed_expectation_ = false; + for (auto const& message : greeting_messages (step.greeting)) + { + server_->send_text (message); + } + complete_step (); + return; + case StepKind::Expect: + case StepKind::Withhold: + if (current_expectation_satisfied ()) + { + complete_step (); + return; + } + start_polling (step.timeout_ms); + return; + case StepKind::Reply: + if (!has_consumed_expectation_ + || last_consumed_generation_ != active_connection_generation_) + { + fail (QStringLiteral ( + "reply requires an expectation consumed on the active connection")); + return; + } + delayed_step_generation_ = last_consumed_generation_; + if (step.timeout_ms > 0) + { + delay_timer_.start (step.timeout_ms); + } + else + { + delayed_step_ready (); + } + return; + case StepKind::Push: + case StepKind::Delay: + delayed_step_generation_ = active_connection_generation_; + if (step.timeout_ms > 0) + { + delay_timer_.start (step.timeout_ms); + } + else + { + delayed_step_ready (); + } + return; + case StepKind::CloseNormally: + if (!close_requested_) + { + if (!server_->client_connected ()) + { + fail (QStringLiteral ("cannot close without a connected client")); + return; + } + close_generation_ = server_->connection_generation (); + reconnect_after_generation_ = close_generation_; + close_observed_ = false; + close_requested_ = true; + server_->close_client (step.text); + start_polling (step.timeout_ms); + } + return; + case StepKind::Reconnect: + if (server_->client_connected () + && server_->connection_generation () > reconnect_after_generation_) + { + active_connection_generation_ = server_->connection_generation (); + last_consumed_generation_ = 0; + has_consumed_expectation_ = false; + complete_step (); + return; + } + start_polling (step.timeout_ms); + return; + } +} + +void TciSimScript::poll_step () +{ + if (!running_) return; + auto const& step = steps_.at (current_step_); + bool complete {false}; + if (step.kind == StepKind::Greet) + { + complete = server_->client_connected (); + if (complete) + { + poll_timer_.stop (); + execute_step (); + return; + } + } + else if (step.kind == StepKind::Reconnect) + { + complete = server_->client_connected () + && server_->connection_generation () > reconnect_after_generation_; + } + else if (step.kind == StepKind::CloseNormally) + { + complete = close_observed_; + } + else + { + complete = current_expectation_satisfied (); + } + + if (complete) + { + poll_timer_.stop (); + if (step.kind == StepKind::CloseNormally) + { + close_requested_ = false; + } + else if (step.kind == StepKind::Reconnect) + { + active_connection_generation_ = server_->connection_generation (); + last_consumed_generation_ = 0; + has_consumed_expectation_ = false; + } + complete_step (); + } + else if (step_elapsed_.elapsed () >= step.timeout_ms) + { + fail (QStringLiteral ("%1 timed out after %2 ms") + .arg (step_description (step)).arg (step.timeout_ms)); + } +} + +void TciSimScript::delayed_step_ready () +{ + if (!running_) return; + auto const& step = steps_.at (current_step_); + if (step.kind == StepKind::Reply || step.kind == StepKind::Push) + { + if (server_->client_connected () + && server_->connection_generation () == delayed_step_generation_) + { + server_->send_text (step.text); + } + else if (step.kind == StepKind::Reply) + { + fail (QStringLiteral ("reply target connection is no longer active")); + return; + } + } + complete_step (); +} + +void TciSimScript::overall_timeout () +{ + if (running_) fail (QStringLiteral ("overall script timeout")); +} + +void TciSimScript::append_expectation ( + StepKind kind, QString verb, ArgsPredicate predicate, int timeout_ms) +{ + steps_.push_back ({kind, std::move (verb), std::move (predicate), + qMax (0, timeout_ms), TciSimGreeting::Minimal}); +} + +void TciSimScript::start_polling (int) +{ + step_elapsed_.restart (); + poll_timer_.start (); +} + +void TciSimScript::complete_step () +{ + poll_timer_.stop (); + delay_timer_.stop (); + ++current_step_; + QTimer::singleShot (0, this, &TciSimScript::execute_step); +} + +void TciSimScript::fail (QString reason) +{ + auto const step_number = current_step_ + 1; + last_error_ = QStringLiteral ("step %1: %2\nTranscript:\n%3") + .arg (step_number).arg (reason, server_->transcript_text ()); + finish (false); +} + +void TciSimScript::finish (bool succeeded_value) +{ + poll_timer_.stop (); + delay_timer_.stop (); + overall_timer_.stop (); + running_ = false; + succeeded_ = succeeded_value; + emit finished (succeeded_); +} + +bool TciSimScript::current_expectation_satisfied () +{ + auto const& step = steps_.at (current_step_); + TciSimServer::Message message; + if (!server_->consume (&cursor_, TciSimServer::Direction::ClientToServer, + step.text, &message, step.predicate, + active_connection_generation_)) + { + return false; + } + last_consumed_generation_ = message.connection_generation; + has_consumed_expectation_ = true; + return true; +} + +QString TciSimScript::step_description (Step const& step) const +{ + switch (step.kind) + { + case StepKind::Greet: return QStringLiteral ("waiting to greet a client"); + case StepKind::Expect: return QStringLiteral ("expecting %1").arg (step.text); + case StepKind::Reply: return QStringLiteral ("replying with %1").arg (step.text); + case StepKind::Push: return QStringLiteral ("pushing %1").arg (step.text); + case StepKind::Withhold: + return QStringLiteral ("expecting and withholding %1").arg (step.text); + case StepKind::Delay: return QStringLiteral ("delaying"); + case StepKind::CloseNormally: return QStringLiteral ("closing the client"); + case StepKind::Reconnect: return QStringLiteral ("waiting for reconnection"); + } + return QStringLiteral ("running script step"); +} diff --git a/tests/unit/tci/TciSimScript.hpp b/tests/unit/tci/TciSimScript.hpp new file mode 100644 index 00000000..c8f0a3b1 --- /dev/null +++ b/tests/unit/tci/TciSimScript.hpp @@ -0,0 +1,116 @@ +#ifndef TCI_SIM_SCRIPT_HPP__ +#define TCI_SIM_SCRIPT_HPP__ + +#include +#include + +#include +#include +#include +#include +#include + +#include "TciSimServer.hpp" + +enum class TciSimGreeting +{ + Thetis, + Minimal, +}; + +class TciSimScript final + : public QObject +{ + Q_OBJECT + +public: + using ArgsPredicate = std::function; + + explicit TciSimScript (TciSimServer * server, QObject * parent = nullptr); + + TciSimScript& greet (TciSimGreeting greeting = TciSimGreeting::Thetis, + int timeout_ms = 2000); + TciSimScript& expect (QString verb, ArgsPredicate predicate = {}, + int timeout_ms = 2000); + TciSimScript& reply (QString text, int delay_ms = 0); + TciSimScript& push (QString text, int delay_ms = 0); + TciSimScript& withhold (QString verb, ArgsPredicate predicate = {}, + int timeout_ms = 2000); + TciSimScript& delay (int delay_ms); + TciSimScript& close_normally ( + QString reason = QStringLiteral ("scripted disconnect")); + TciSimScript& reconnect (int timeout_ms = 2000); + + void start (int overall_timeout_ms = 10000); + bool run (int overall_timeout_ms = 10000); + void stop (); + + bool running () const; + bool succeeded () const; + int failed_step () const; + QString last_error () const; + + static QStringList greeting_messages (TciSimGreeting greeting); + +signals: + void finished (bool succeeded); + +private slots: + void execute_step (); + void poll_step (); + void delayed_step_ready (); + void overall_timeout (); + +private: + enum class StepKind + { + Greet, + Expect, + Reply, + Push, + Withhold, + Delay, + CloseNormally, + Reconnect, + }; + + struct Step + { + StepKind kind; + QString text; + ArgsPredicate predicate; + int timeout_ms {0}; + TciSimGreeting greeting {TciSimGreeting::Minimal}; + }; + + void append_expectation (StepKind kind, QString verb, + ArgsPredicate predicate, int timeout_ms); + void start_polling (int timeout_ms); + void complete_step (); + void fail (QString reason); + void finish (bool succeeded); + bool current_expectation_satisfied (); + QString step_description (Step const& step) const; + + TciSimServer * server_; + std::vector steps_; + TciSimServer::Cursor cursor_; + QTimer poll_timer_; + QTimer delay_timer_; + QTimer overall_timer_; + QElapsedTimer step_elapsed_; + int current_step_ {-1}; + int reconnect_after_generation_ {0}; + int active_connection_generation_ {0}; + int last_consumed_generation_ {0}; + int delayed_step_generation_ {0}; + int close_generation_ {0}; + bool close_observed_ {false}; + bool has_consumed_expectation_ {false}; + bool close_requested_ {false}; + bool running_ {false}; + bool succeeded_ {false}; + QString last_error_; +}; + +#endif // TCI_SIM_SCRIPT_HPP__ diff --git a/tests/unit/tci/TciSimServer.cpp b/tests/unit/tci/TciSimServer.cpp new file mode 100644 index 00000000..95296232 --- /dev/null +++ b/tests/unit/tci/TciSimServer.cpp @@ -0,0 +1,328 @@ +#include "TciSimServer.hpp" + +#include + +#include +#include +#include +#include +#include +#include + +#include "moc_TciSimServer.cpp" + +TciSimServer::TciSimServer (QObject * parent) + : QObject {parent} + , server_ {new QWebSocketServer {QStringLiteral ("TCI simulator"), + QWebSocketServer::NonSecureMode, this}} + , client_ {nullptr} +{ + connect (server_, &QWebSocketServer::newConnection, + this, &TciSimServer::on_new_connection); +} + +TciSimServer::~TciSimServer () +{ + close (); +} + +bool TciSimServer::listen () +{ + if (server_->isListening ()) return true; + if (!server_->listen (QHostAddress::LocalHost, 0)) return false; + port_ = server_->serverPort (); + return true; +} + +void TciSimServer::close () +{ + if (client_) + { + client_->close (QWebSocketProtocol::CloseCodeNormal, + QStringLiteral ("simulator done")); + client_ = nullptr; + } + server_->close (); + port_ = 0; +} + +quint16 TciSimServer::port () const +{ + return port_; +} + +QString TciSimServer::url () const +{ + return QStringLiteral ("ws://127.0.0.1:%1").arg (port_); +} + +bool TciSimServer::client_connected () const +{ + return client_ && client_->state () == QAbstractSocket::ConnectedState; +} + +bool TciSimServer::client_disconnected () const +{ + return !client_; +} + +int TciSimServer::connection_generation () const +{ + return connection_generation_; +} + +int TciSimServer::connection_count () const +{ + return connection_count_; +} + +void TciSimServer::send_text (QString text) +{ + if (!client_connected ()) return; + if (!text.endsWith (';')) text += ';'; + record_text (Direction::ServerToClient, text, connection_generation_); + client_->sendTextMessage (text); +} + +bool TciSimServer::send_binary (QByteArray const& data) +{ + return client_connected () && client_->sendBinaryMessage (data) == data.size (); +} + +bool TciSimServer::flush () +{ + return client_connected () && client_->flush (); +} + +void TciSimServer::send_text_later (QString text, int delay_ms) +{ + auto const generation = connection_generation_; + QTimer::singleShot (qMax (0, delay_ms), this, + [this, generation, text = std::move (text)] () mutable + { + if (client_connected () + && connection_generation_ == generation) + { + send_text (std::move (text)); + } + }); +} + +void TciSimServer::close_client (QString const& reason) +{ + if (client_) + { + client_->close (QWebSocketProtocol::CloseCodeNormal, reason); + } +} + +void TciSimServer::abort_client () +{ + if (client_) client_->abort (); +} + +QVector const& TciSimServer::transcript () const +{ + return transcript_; +} + +QVector const& TciSimServer::frames () const +{ + return frames_; +} + +TciSimServer::Cursor TciSimServer::cursor (int start_index) const +{ + return {qBound (0, start_index, transcript_.size ())}; +} + +bool TciSimServer::consume ( + Cursor * cursor_value, Direction direction, QString const& verb, + Message * message, + std::function const& predicate, + int connection_generation) const +{ + if (!cursor_value) return false; + + for (int i = qMax (0, cursor_value->next_index); i < transcript_.size (); ++i) + { + auto const& candidate = transcript_.at (i); + cursor_value->next_index = i + 1; + if (candidate.direction != direction || candidate.verb != verb) continue; + if (connection_generation > 0 + && candidate.connection_generation != connection_generation) continue; + if (predicate && !predicate (candidate.args)) continue; + if (message) *message = candidate; + return true; + } + cursor_value->next_index = transcript_.size (); + return false; +} + +QVector TciSimServer::messages ( + Direction direction, QString const& verb) const +{ + QVector result; + for (auto const& message : transcript_) + { + if (message.direction == direction + && (verb.isEmpty () || message.verb == verb)) + { + result.append (message); + } + } + return result; +} + +int TciSimServer::count (Direction direction, QString const& verb) const +{ + int result {0}; + for (auto const& message : transcript_) + { + if (message.direction == direction + && (verb.isEmpty () || message.verb == verb)) + { + ++result; + } + } + return result; +} + +int TciSimServer::index_of ( + Direction direction, QString const& verb, int occurrence) const +{ + if (occurrence < 0) return -1; + for (int i = 0; i < transcript_.size (); ++i) + { + auto const& message = transcript_.at (i); + if (message.direction == direction && message.verb == verb + && occurrence-- == 0) + { + return i; + } + } + return -1; +} + +bool TciSimServer::occurs_before ( + Direction first_direction, QString const& first_verb, + Direction second_direction, QString const& second_verb) const +{ + auto const first = index_of (first_direction, first_verb); + auto const second = index_of (second_direction, second_verb); + return first >= 0 && second >= 0 && first < second; +} + +QString TciSimServer::transcript_text () const +{ + QStringList lines; + lines.reserve (frames_.size ()); + for (auto const& frame : frames_) + { + auto const arrow = frame.direction == Direction::ClientToServer + ? QStringLiteral ("client -> server") + : QStringLiteral ("server -> client"); + lines.append (QStringLiteral ("frame #%1 connection %2 %3: %4") + .arg (frame.ordinal) + .arg (frame.connection_generation) + .arg (arrow, frame.raw)); + } + return lines.join ('\n'); +} + +bool TciSimServer::wait_for ( + std::function const& predicate, int timeout_ms) +{ + if (predicate ()) return true; + + QEventLoop loop; + QTimer poller; + QTimer timeout; + bool matched {false}; + poller.setInterval (5); + timeout.setSingleShot (true); + connect (&poller, &QTimer::timeout, &loop, + [&predicate, &matched, &loop] () + { + if (!predicate ()) return; + matched = true; + loop.quit (); + }); + connect (&timeout, &QTimer::timeout, &loop, &QEventLoop::quit); + poller.start (); + timeout.start (qMax (0, timeout_ms)); + loop.exec (); + return matched || predicate (); +} + +void TciSimServer::on_new_connection () +{ + while (auto * candidate = server_->nextPendingConnection ()) + { + if (client_) + { + candidate->close (QWebSocketProtocol::CloseCodePolicyViolated, + QStringLiteral ("one client at a time")); + candidate->deleteLater (); + continue; + } + + client_ = candidate; + connection_generation_ = ++connection_count_; + client_->setProperty ("tciConnectionGeneration", connection_generation_); + connect (client_, &QWebSocket::textMessageReceived, + this, &TciSimServer::on_text_message); + connect (client_, &QWebSocket::disconnected, + this, &TciSimServer::on_disconnected); + emit client_arrived (connection_generation_); + } +} + +void TciSimServer::on_text_message (QString const& text) +{ + auto * socket = qobject_cast (sender ()); + auto const generation = socket + ? socket->property ("tciConnectionGeneration").toInt () + : connection_generation_; + record_text (Direction::ClientToServer, text, generation); + emit text_received (text, generation); +} + +void TciSimServer::on_disconnected () +{ + auto * socket = qobject_cast (sender ()); + auto const generation = socket + ? socket->property ("tciConnectionGeneration").toInt () + : connection_generation_; + if (socket == client_) client_ = nullptr; + if (socket) socket->deleteLater (); + emit client_gone (generation); +} + +void TciSimServer::record_text ( + Direction direction, QString const& text, int generation) +{ + frames_.append ({direction, generation, next_frame_ordinal_++, text}); + auto const commands = text.split (';', Qt::SkipEmptyParts); + for (auto const& command : commands) + { + transcript_.append (parse_message (direction, generation, + next_ordinal_++, command)); + } +} + +TciSimServer::Message TciSimServer::parse_message ( + Direction direction, int generation, quint64 ordinal, QString const& raw) +{ + Message result {direction, generation, ordinal, raw, {}, {}}; + auto const separator = raw.indexOf (':'); + if (separator < 0) + { + result.verb = raw.trimmed (); + return result; + } + + result.verb = raw.left (separator).trimmed (); + result.args = raw.mid (separator + 1).split (',', Qt::KeepEmptyParts); + return result; +} diff --git a/tests/unit/tci/TciSimServer.hpp b/tests/unit/tci/TciSimServer.hpp new file mode 100644 index 00000000..c64c0a09 --- /dev/null +++ b/tests/unit/tci/TciSimServer.hpp @@ -0,0 +1,111 @@ +#ifndef TCI_SIM_SERVER_HPP__ +#define TCI_SIM_SERVER_HPP__ + +#include + +#include +#include +#include +#include + +class QWebSocket; +class QWebSocketServer; + +class TciSimServer final + : public QObject +{ + Q_OBJECT + +public: + enum class Direction + { + ClientToServer, + ServerToClient, + }; + + struct Message + { + Direction direction; + int connection_generation; + quint64 ordinal; + QString raw; + QString verb; + QStringList args; + }; + + struct Frame + { + Direction direction; + int connection_generation; + quint64 ordinal; + QString raw; + }; + + struct Cursor + { + int next_index {0}; + }; + + explicit TciSimServer (QObject * parent = nullptr); + ~TciSimServer () override; + + bool listen (); + void close (); + quint16 port () const; + QString url () const; + + bool client_connected () const; + bool client_disconnected () const; + int connection_generation () const; + int connection_count () const; + + void send_text (QString text); + bool send_binary (QByteArray const& data); + bool flush (); + void send_text_later (QString text, int delay_ms); + void close_client (QString const& reason = QStringLiteral ("simulator close")); + void abort_client (); + + QVector const& transcript () const; + QVector const& frames () const; + Cursor cursor (int start_index = 0) const; + bool consume (Cursor * cursor, Direction direction, QString const& verb, + Message * message = nullptr, + std::function const& predicate = {}, + int connection_generation = 0) const; + QVector messages (Direction direction, QString const& verb = {}) const; + int count (Direction direction, QString const& verb = {}) const; + int index_of (Direction direction, QString const& verb, int occurrence = 0) const; + bool occurs_before (Direction first_direction, QString const& first_verb, + Direction second_direction, QString const& second_verb) const; + QString transcript_text () const; + + bool wait_for (std::function const& predicate, int timeout_ms); + +signals: + void client_arrived (int connection_generation); + void client_gone (int connection_generation); + void text_received (QString const& raw, int connection_generation); + +private slots: + void on_new_connection (); + void on_text_message (QString const& text); + void on_disconnected (); + +private: + void record_text (Direction direction, QString const& text, int generation); + static Message parse_message (Direction direction, int generation, + quint64 ordinal, QString const& raw); + + QWebSocketServer * server_; + QWebSocket * client_; + quint16 port_ {0}; + int connection_generation_ {0}; + int connection_count_ {0}; + quint64 next_ordinal_ {0}; + quint64 next_frame_ordinal_ {0}; + QVector transcript_; + QVector frames_; +}; + +#endif // TCI_SIM_SERVER_HPP__ diff --git a/tests/unit/tci/test_tci_protocol.cpp b/tests/unit/tci/test_tci_protocol.cpp new file mode 100644 index 00000000..95b4e01d --- /dev/null +++ b/tests/unit/tci/test_tci_protocol.cpp @@ -0,0 +1,110 @@ +#include + +#include + +#include "Transceiver/TCIProtocol.hpp" + +class TestTciProtocol final + : public QObject +{ + Q_OBJECT + +private slots: + void parsesFrequency_data () + { + QTest::addColumn ("text"); + QTest::addColumn ("expected"); + + QTest::newRow ("ordinary HF") << QString {"14074000"} << quint64 {14074000u}; + QTest::newRow ("below signed 32-bit boundary") << QString {"2147483647"} << quint64 {2147483647u}; + QTest::newRow ("at signed 32-bit boundary") << QString {"2147483648"} << quint64 {2147483648u}; + QTest::newRow ("above signed 32-bit boundary") << QString {"2147483649"} << quint64 {2147483649u}; + QTest::newRow ("10.368 GHz") << QString {"10368000000"} << quint64 {10368000000u}; + QTest::newRow ("upper supported TCI range") << QString {"250000000000"} << quint64 {250000000000u}; + QTest::newRow ("leading zeros") << QString {"00014074000"} << quint64 {14074000u}; + QTest::newRow ("zero") << QString {"0"} << quint64 {0u}; + QTest::newRow ("quint64 maximum") + << QString {"18446744073709551615"} << (std::numeric_limits::max) (); + } + + void parsesFrequency () + { + QFETCH (QString, text); + QFETCH (quint64, expected); + + quint64 frequency {99u}; + QVERIFY (TciProtocol::parse_frequency (text, &frequency)); + QCOMPARE (frequency, expected); + } + + void rejectsMalformedFrequency_data () + { + QTest::addColumn ("text"); + + QTest::newRow ("empty") << QString {}; + QTest::newRow ("negative") << QString {"-14074000"}; + QTest::newRow ("positive sign") << QString {"+14074000"}; + QTest::newRow ("leading whitespace") << QString {" 14074000"}; + QTest::newRow ("trailing whitespace") << QString {"14074000 "}; + QTest::newRow ("group separator") << QString {"14,074,000"}; + QTest::newRow ("decimal") << QString {"14074.000"}; + QTest::newRow ("exponent") << QString {"14074e3"}; + QTest::newRow ("trailing text") << QString {"14074000Hz"}; + QTest::newRow ("unicode digit") << QString::fromUtf8 ("١٤٠٧٤٠٠٠"); + QTest::newRow ("replacement character") + << QString {"14"} + QChar {QChar::ReplacementCharacter} + QString {"074000"}; + QTest::newRow ("overflow") << QString {"18446744073709551616"}; + } + + void rejectsMalformedFrequency () + { + QFETCH (QString, text); + + quint64 frequency {99u}; + QVERIFY (!TciProtocol::parse_frequency (text, &frequency)); + QCOMPARE (frequency, quint64 {99u}); + } + + void rejectsMissingOutput () + { + QVERIFY (!TciProtocol::parse_frequency (QString {"14074000"}, nullptr)); + } + + void comparesFrequencyDifference_data () + { + QTest::addColumn ("lhs"); + QTest::addColumn ("rhs"); + QTest::addColumn ("expected"); + + QTest::newRow ("ordinary HF below threshold") + << quint64 {14074000u} << quint64 {15073999u} << false; + QTest::newRow ("below threshold") + << quint64 {10368000000u} << quint64 {10368999999u} << false; + QTest::newRow ("exact threshold") + << quint64 {10368000000u} << quint64 {10369000000u} << false; + QTest::newRow ("above threshold") + << quint64 {10368000000u} << quint64 {10369000001u} << true; + QTest::newRow ("above threshold reversed") + << quint64 {10369000001u} << quint64 {10368000000u} << true; + QTest::newRow ("signed boundary adjacent") + << quint64 {2147483647u} << quint64 {2147483648u} << false; + QTest::newRow ("upper supported range") + << quint64 {250000000000u} << quint64 {249998999999u} << true; + QTest::newRow ("quint64 upper edge") + << (std::numeric_limits::max) () + << (std::numeric_limits::max) () - quint64 {1000001u} << true; + } + + void comparesFrequencyDifference () + { + QFETCH (quint64, lhs); + QFETCH (quint64, rhs); + QFETCH (bool, expected); + + QCOMPARE (TciProtocol::frequency_difference_exceeds (lhs, rhs, quint64 {1000000u}), expected); + } +}; + +QTEST_MAIN (TestTciProtocol) + +#include "test_tci_protocol.moc" diff --git a/tests/unit/tci/test_tci_receive_ownership.cpp b/tests/unit/tci/test_tci_receive_ownership.cpp new file mode 100644 index 00000000..3f061130 --- /dev/null +++ b/tests/unit/tci/test_tci_receive_ownership.cpp @@ -0,0 +1,451 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "DecDataMutex.hpp" +#include "FastDecode.hpp" +#include "TciSimScript.hpp" +#include "TciSimServer.hpp" +#include "Transceiver/TCITransceiver.hpp" +#include "widgets/itoneAndicw.h" +#include "wsjtx_config.h" + +namespace +{ +dec_data_t storage {}; +constexpr int block = 3456; +constexpr int captureCount = block; + +struct ReceiveClock +{ + std::mutex mutex; + std::condition_variable changed; + qint64 timestamp = 104000; // 14 s into a 15 s period; 105000 wraps to zero. + bool armed = false, paused = false, released = false, timedOut = false; + + qint64 now () + { + std::unique_lock lock {mutex}; + if (armed) + { + armed = false; + paused = true; + changed.notify_all (); + timedOut = !changed.wait_for (lock, std::chrono::seconds {5}, [&] { return released; }); + } + return timestamp; + } + void set (qint64 value) { std::lock_guard lock {mutex}; timestamp = value; } + void arm () { std::lock_guard lock {mutex}; armed = true; } + bool waitPaused () + { + std::unique_lock lock {mutex}; + return changed.wait_for (lock, std::chrono::seconds {5}, [&] { return paused; }); + } + void release () + { + std::lock_guard lock {mutex}; + released = true; + changed.notify_all (); + } +}; + +// The real decoder launcher is linked; only the downstream decoder is a probe. +struct DecodeProbe +{ + std::mutex mutex; + std::condition_variable changed; + bool released = false, timedOut = false; + std::vector samples; + int frames = 0; + double period = 0; + QByteArray myCall, hisCall; + void release () + { + std::lock_guard lock {mutex}; + released = true; + changed.notify_all (); + } +}; +DecodeProbe * activeProbe = nullptr; + +struct Job +{ + std::array arguments {}; + std::array messages {}; + char myCall[12], hisCall[12]; + double period = 15; + Job () + { + arguments[1] = captureCount; + arguments[3] = 1; + arguments[9] = 104; + std::memcpy (myCall, "K1ABC ", 12); + std::memcpy (hisCall, "W9XYZ ", 12); + } + QFuture submit (short const * samples = storage.d2) + { + return startFastDecode (samples, arguments.data (), period, + myCall, hisCall); + } +}; + +class Harness +{ +public: + Harness () : logger_ {boost::log::keywords::channel = "TCI_RECEIVE_TEST"} + { + QObject::connect (&server, &TciSimServer::client_arrived, &server, [this] (int) { + server.send_text (TciSimScript::greeting_messages (TciSimGreeting::Thetis).join (';')); + }); + QObject::connect (&server, &TciSimServer::text_received, &server, + [this] (QString const& text, int) { + for (auto const& command : text.split (';', Qt::SkipEmptyParts)) + { + auto const verb = command.section (':', 0, 0); + if (verb == "split_enable") server.send_text ("split_enable:0,false"); + else if (verb == "audio_start" || verb == "audio_stop" + || verb == "modulation" || verb == "rx_enable" + || verb == "trx" || verb == "start" || verb == "stop") + server.send_text (command); + else if (verb == "vfo") + server.send_text (command.count (',') >= 2 ? command : "vfo:0,0,14074000"); + } + }); + context_ = new QObject; + context_->moveToThread (&thread_); + QObject::connect (&thread_, &QThread::finished, context_, &QObject::deleteLater); + thread_.start (); + } + + ~Harness () + { + clock.release (); + auto stopped = std::make_shared (false); + QMetaObject::invokeMethod (context_, [this, stopped] { + if (rig) { rig->stop (); delete rig; rig = nullptr; } + stopped->store (true); + }, Qt::QueuedConnection); + server.wait_for ([&] { return stopped->load (); }, 10000); + // Complete destruction before logger, clock and transport storage expire. + thread_.quit (); + thread_.wait (); + server.close (); + } + + bool start () + { + if (!server.listen ()) return false; + QString const address = QStringLiteral ("127.0.0.1:%1").arg (server.port ()); + QMetaObject::invokeMethod (context_, [this, address] { + rig = new TCITransceiver (&logger_, {}, "0", address, true, tci__audio, + context_, [this] { return clock.now (); }); + QObject::connect (rig, &Transceiver::failure, rig, [this] (QString const&) { + failed_.store (true); + }); + QObject::connect (rig, &Transceiver::tciframeswritten, rig, [this] (qint64) { + ++notifications_; + }); + QObject::connect (rig, &Transceiver::receiveAudio, &audioContext_, + [this] (ReceiveAudio audio) { + receiver_.accept (audio, storage); + }, Qt::QueuedConnection); + // A ready message is an ordered fence behind preceding binary frames. + QObject::connect (rig, &TCITransceiver::tci_done7, rig, [this] { + std::lock_guard lock {fenceMutex_}; + ++fences_; + fenceChanged_.notify_all (); + }); + rig->start (1); + state_.online (true); + state_.frequency (14074000); + state_.mode (Transceiver::USB); + state_.period (15); + state_.audio (true); + state_.volume (0); + rig->set (state_, 2); + started_.store (true); + }, Qt::QueuedConnection); + return server.wait_for ([this] { return started_.load (); }, 10000) + && !failed_.load () && server.client_connected (); + } + + bool enableAudio (bool enabled) + { + QMetaObject::invokeMethod (context_, [this, enabled] { + state_.audio (enabled); + rig->set (state_, ++sequence_); + }, Qt::BlockingQueuedConnection); + return !failed_.load (); + } + + bool fence () + { + std::unique_lock lock {fenceMutex_}; + auto const before = fences_; + server.send_text ("ready"); + server.flush (); + // No GUI event dispatch here: queued audio notifications may stay pending. + return fenceChanged_.wait_for (lock, std::chrono::seconds {5}, + [&] { return fences_ > before; }); + } + + bool packet (std::vector const& pcm, int offset, int count, int receiver = 0) + { + QByteArray bytes; + if (!TciStream::prepare_float_frame (&bytes, 2 * count)) return false; + auto * header = TciStream::header (&bytes); + header->receiver = receiver; + header->sampleRate = 48000; + header->format = TciStream::Float32Format; + header->type = TciStream::RxAudioStream; + header->length = 2 * count; + header->channels = 2; + auto * payload = TciStream::float_payload (&bytes); + for (int i = 0; i < count; ++i) + { + payload[2 * i] = pcm[offset + i]; + payload[2 * i + 1] = -pcm[offset + i]; // Distinct unused right channel. + } + bool const sent = server.send_binary (bytes); + return sent; + } + + bool feed (std::vector const& pcm, std::vector const& chunks = {4096}, + int receiver = 0) + { + int offset = 0, index = 0; + while (offset < int (pcm.size ())) + { + int count = std::min (chunks[index++ % chunks.size ()], int (pcm.size ()) - offset); + if (!packet (pcm, offset, count, receiver)) return false; + offset += count; + } + return fence (); + } + + std::vector snapshot () + { + QCoreApplication::sendPostedEvents (&audioContext_, QEvent::MetaCall); + QMutexLocker lock {&dec_data_mutex ()}; + return {storage.d2, storage.d2 + storage.params.kin}; + } + int notifications () const { return notifications_.load (); } + + TciSimServer server; + ReceiveClock clock; + TCITransceiver * rig = nullptr; +private: + Transceiver::logger_type logger_; + QThread thread_; + QObject * context_ = nullptr; + QObject audioContext_; + ReceiveAudioConsumer receiver_; + Transceiver::TransceiverState state_; + unsigned sequence_ = 2; + std::atomic_bool started_ {false}, failed_ {false}; + std::atomic_int notifications_ {0}; + std::mutex fenceMutex_; + std::condition_variable fenceChanged_; + int fences_ = 0; +}; + +std::vector signal (int outputFrames, float value) +{ + return std::vector (4 * outputFrames, value); +} +} + +dec_data_t& dec_data = storage; +int volatile itone[MAX_NUM_SYMBOLS] {}; +int volatile icw[NUM_CW_SYMBOLS] {}; +float gran () { return 0; } + +extern "C" void fast_decode_ (short samples[], int arguments[], double * period, + char[], char myCall[], char hisCall[], + fortran_charlen_t, fortran_charlen_t, fortran_charlen_t) +{ + auto& probe = *activeProbe; + std::unique_lock lock {probe.mutex}; + probe.timedOut = !probe.changed.wait_for (lock, std::chrono::seconds {5}, + [&] { return probe.released; }); + if (probe.timedOut) return; + probe.frames = arguments[1]; + if (probe.frames >= 0 && probe.frames <= 360000) + probe.samples.assign (samples, samples + probe.frames); + probe.period = *period; + probe.myCall = QByteArray (myCall, 12); + probe.hisCall = QByteArray (hisCall, 12); +} + +class TestTciReceiveOwnership : public QObject +{ + Q_OBJECT +private Q_SLOTS: + void packetization_preserves_audio () + { + Harness h; + QVERIFY (h.start ()); + auto pcm = signal (captureCount, 0.0f); + for (std::size_t i = 0; i < pcm.size (); ++i) + pcm[i] = (int (i % 31) - 15) / 32.0f; + // fil4 has persistent FIR history. Feed the same silent pre-roll for each + // run; do not reset it through test-only access to Fortran saved state. + QVERIFY (h.feed (signal (block, 0.0f))); + QVERIFY (h.feed (pcm)); + auto first = h.snapshot (); + QVERIFY (h.enableAudio (false)); + QVERIFY (h.enableAudio (true)); + QVERIFY (h.feed (signal (block, 0.0f), {4095})); + QVERIFY (h.feed (pcm, {4095})); + auto second = h.snapshot (); + QCOMPARE (first.size (), std::size_t (2 * block)); + QCOMPARE (second.size (), first.size ()); + QVERIFY (std::any_of (first.begin () + block, first.end (), [] (short x) { return x != 0; })); + // Discard pre-roll output: its first taps legitimately contain history + // from the preceding stream. Compare only identically conditioned audio. + QVERIFY (std::equal (first.begin () + block, first.end (), second.begin () + block)); + } + + void ignored_audio_does_not_change_reception () + { + Harness h; + QVERIFY (h.start ()); + QVERIFY (h.feed (signal (captureCount, 0.125f))); + auto before = h.snapshot (); + int const notifications = h.notifications (); + + QVERIFY (h.feed (signal (block, -0.25f), {4096}, 1)); + QVERIFY (before == h.snapshot ()); + QCOMPARE (h.notifications (), notifications); + + QVERIFY (h.enableAudio (false)); + QVERIFY (h.feed (signal (block, -0.25f))); + QVERIFY (before == h.snapshot ()); + QCOMPARE (h.notifications (), notifications); + // An accepted block is a positive control proving the transport and gate + // work, rather than mistaking an idle or disconnected receiver for success. + QVERIFY (h.enableAudio (true)); + QVERIFY (h.feed (signal (block, -0.25f))); + QCOMPARE (h.snapshot ().size (), std::size_t (block)); + } + + void submitted_job_survives_period_reuse () + { + Harness h; + QVERIFY (h.start ()); + QVERIFY (h.feed (signal (captureCount, 0.125f))); + auto const expected = h.snapshot (); + Job job; + DecodeProbe probe; + activeProbe = &probe; + auto future = job.submit (); + h.clock.set (105000); + bool const fed = h.feed (signal (captureCount, -0.25f)); + auto const replacement = h.snapshot (); + probe.release (); + future.waitForFinished (); + activeProbe = nullptr; + QVERIFY (fed); + QVERIFY (!probe.timedOut); + QCOMPARE (replacement.size (), expected.size ()); + QVERIFY (replacement != expected); + QCOMPARE (probe.samples.size (), expected.size ()); + QCOMPARE (probe.samples.back (), expected.back ()); + QVERIFY (probe.samples == expected); + QCOMPARE (probe.frames, captureCount); + QCOMPARE (probe.period, 15.0); + QCOMPARE (probe.myCall, QByteArray ("K1ABC ", 12)); + QCOMPARE (probe.hisCall, QByteArray ("W9XYZ ", 12)); + } + + void capture_vs_transport_append () + { + Harness h; + QVERIFY (h.start ()); + QVERIFY (h.feed (signal (captureCount, 0.125f))); + auto const expected = h.snapshot (); + // Leave one stereo frame before the next real downsampler output block. + auto next = signal (block, -0.25f); + next.pop_back (); + QVERIFY (h.feed (next)); + h.clock.arm (); + QVERIFY (h.packet (std::vector { -0.25f }, 0, 1)); + h.server.flush (); + bool const paused = h.clock.waitPaused (); + Job job; + DecodeProbe probe; + probe.released = true; + activeProbe = &probe; + h.clock.release (); + // Both real sample accesses follow release, with no completion ordering. + auto future = job.submit (); + bool const finished = h.fence (); + future.waitForFinished (); + activeProbe = nullptr; + QVERIFY (paused); + QVERIFY (finished); + QVERIFY (!h.clock.timedOut); + QVERIFY (!probe.timedOut); + QCOMPARE (h.snapshot ().size (), std::size_t (captureCount + block)); + QVERIFY (probe.samples == expected); + } + + void delayed_notification_retains_period_identity () + { + Harness h; + QVERIFY (h.start ()); + Job job; + DecodeProbe probe; + probe.released = true; + activeProbe = &probe; + QObject consumer; + bool handled = false; + int rejected = 0; + auto received = std::make_unique (); + ReceiveAudioConsumer receiver; + QFuture future; + QObject::connect (h.rig, &Transceiver::receiveAudio, &consumer, [&] (ReceiveAudio audio) { + if (!receiver.accept (audio, *received)) { ++rejected; return; } + if (handled || audio->end () != captureCount) return; + handled = true; + future = job.submit (received->d2); + }, Qt::QueuedConnection); + // Transport fences do not dispatch the main thread's queued callbacks. + bool const fedA = h.feed (signal (captureCount, 0.125f)); + auto const expected = h.snapshot (); + h.clock.set (105000); + bool const fedB = h.feed (signal (captureCount, -0.25f)); + auto const replacement = h.snapshot (); + QCoreApplication::sendPostedEvents (&consumer, QEvent::MetaCall); + future.waitForFinished (); + activeProbe = nullptr; + QVERIFY (fedA); + QVERIFY (fedB); + QVERIFY (handled); + QVERIFY (rejected > 0); + QVERIFY (!probe.timedOut); + QCOMPARE (expected.size (), std::size_t (captureCount)); + QCOMPARE (replacement.size (), expected.size ()); + QVERIFY (replacement != expected); + QCOMPARE (probe.samples.size (), expected.size ()); + QCOMPARE (probe.samples.back (), replacement.back ()); + QVERIFY (probe.samples == replacement); + // Stale A is rejected; B still reaches the production decode boundary. + } +}; + +QTEST_GUILESS_MAIN (TestTciReceiveOwnership) +#include "test_tci_receive_ownership.moc" diff --git a/tests/unit/tci/test_tci_sim_smoke.cpp b/tests/unit/tci/test_tci_sim_smoke.cpp new file mode 100644 index 00000000..582bb66a --- /dev/null +++ b/tests/unit/tci/test_tci_sim_smoke.cpp @@ -0,0 +1,387 @@ +#include "TciSimScript.hpp" +#include "TciSimServer.hpp" + +#include + +#include +#include +#include +#include + +namespace +{ + struct ReconnectState + { + bool client_disconnected {false}; + bool server_disconnected {false}; + bool reopened {false}; + }; + + void reconnect_once_after_retirement ( + QWebSocket& client, TciSimServer& server) + { + auto state = std::make_shared (); + auto reopen = [state, &client, &server] + { + if (state->reopened || !state->client_disconnected + || !state->server_disconnected) + { + return; + } + state->reopened = true; + QTimer::singleShot (0, &client, + [&client, &server] + { + client.open (QUrl {server.url ()}); + }); + }; + + QObject::connect (&client, &QWebSocket::disconnected, &client, + [state, reopen] + { + state->client_disconnected = true; + reopen (); + }); + QObject::connect (&server, &TciSimServer::client_gone, &client, + [state, reopen] (int) + { + state->server_disconnected = true; + reopen (); + }); + } +} + +class TestTciSim final + : public QObject +{ + Q_OBJECT + +private slots: + void recordsOrderedFullDuplexTranscript () + { + TciSimServer server; + QVERIFY (server.listen ()); + + QWebSocket client; + client.open (QUrl {server.url ()}); + QVERIFY (server.wait_for ([&client, &server] + { + return server.client_connected () + && client.state () == QAbstractSocket::ConnectedState; + }, 1000)); + + client.sendTextMessage (QStringLiteral ( + "vfo:0,0,14074000;vfo:0,1,14075000;split_enable:0,true;")); + QVERIFY (server.wait_for ([&server] + { + return server.count ( + TciSimServer::Direction::ClientToServer) == 3; + }, 1000)); + server.send_text (QStringLiteral ("vfo:0,0,14074000;trx:0,false")); + + auto const& frames = server.frames (); + QCOMPARE (frames.size (), 2); + QCOMPARE (frames.at (0).raw, QStringLiteral ( + "vfo:0,0,14074000;vfo:0,1,14075000;split_enable:0,true;")); + QCOMPARE (frames.at (1).raw, + QStringLiteral ("vfo:0,0,14074000;trx:0,false;")); + QCOMPARE (frames.at (0).ordinal, quint64 {0}); + QCOMPARE (frames.at (1).ordinal, quint64 {1}); + + auto const& transcript = server.transcript (); + QCOMPARE (transcript.size (), 5); + QCOMPARE (transcript.at (0).direction, + TciSimServer::Direction::ClientToServer); + QCOMPARE (transcript.at (0).connection_generation, 1); + QCOMPARE (transcript.at (0).ordinal, quint64 {0}); + QCOMPARE (transcript.at (0).raw, QStringLiteral ("vfo:0,0,14074000")); + QCOMPARE (transcript.at (0).verb, QStringLiteral ("vfo")); + QCOMPARE (transcript.at (0).args, + QStringList ({"0", "0", "14074000"})); + QCOMPARE (transcript.at (1).verb, QStringLiteral ("vfo")); + QCOMPARE (transcript.at (2).verb, QStringLiteral ("split_enable")); + QCOMPARE (transcript.at (3).direction, + TciSimServer::Direction::ServerToClient); + QCOMPARE (transcript.at (4).verb, QStringLiteral ("trx")); + QVERIFY (server.occurs_before (TciSimServer::Direction::ClientToServer, + QStringLiteral ("vfo"), + TciSimServer::Direction::ClientToServer, + QStringLiteral ("split_enable"))); + } + + void cursorConsumesRepeatedCommands () + { + TciSimServer server; + QVERIFY (server.listen ()); + + QWebSocket client; + client.open (QUrl {server.url ()}); + QVERIFY (server.wait_for ([&client, &server] + { + return server.client_connected () + && client.state () == QAbstractSocket::ConnectedState; + }, 1000)); + client.sendTextMessage (QStringLiteral ( + "vfo:0,0,7074000;vfo:0,0,14074000;vfo:0,0,21074000;")); + QVERIFY (server.wait_for ([&server] + { + return server.count ( + TciSimServer::Direction::ClientToServer, + QStringLiteral ("vfo")) == 3; + }, 1000)); + + auto cursor = server.cursor (); + TciSimServer::Message message; + QVERIFY (server.consume (&cursor, TciSimServer::Direction::ClientToServer, + QStringLiteral ("vfo"), &message)); + QCOMPARE (message.args.at (2), QStringLiteral ("7074000")); + QVERIFY (server.consume (&cursor, TciSimServer::Direction::ClientToServer, + QStringLiteral ("vfo"), &message)); + QCOMPARE (message.args.at (2), QStringLiteral ("14074000")); + QVERIFY (server.consume (&cursor, TciSimServer::Direction::ClientToServer, + QStringLiteral ("vfo"), &message, + [] (QStringList const& args) + { + return args.value (2) == QStringLiteral ("21074000"); + })); + QCOMPARE (message.ordinal, quint64 {2}); + QVERIFY (!server.consume (&cursor, TciSimServer::Direction::ClientToServer, + QStringLiteral ("vfo"))); + QCOMPARE (server.count (TciSimServer::Direction::ClientToServer, + QStringLiteral ("vfo")), 3); + QCOMPARE (server.index_of (TciSimServer::Direction::ClientToServer, + QStringLiteral ("vfo"), 2), 2); + } + + void scriptGreetsDelaysAndWithholds () + { + TciSimServer server; + QVERIFY (server.listen ()); + + QWebSocket client; + QStringList received; + bool command_sent {false}; + QElapsedTimer delayed_reply; + connect (&client, &QWebSocket::textMessageReceived, this, + [&client, &received, &command_sent, + &delayed_reply] (QString const& text) + { + received.append (text); + if (text != QStringLiteral ("ready;") || command_sent) return; + command_sent = true; + delayed_reply.start (); + client.sendTextMessage (QStringLiteral ("vfo:0,0,14074000;")); + }); + + TciSimScript script {&server}; + script.greet (TciSimGreeting::Thetis) + .withhold (QStringLiteral ("vfo"), + [] (QStringList const& args) + { + return args.value (2) == QStringLiteral ("14074000"); + }) + .delay (30) + .push (QStringLiteral ("vfo:0,0,14074000")); + client.open (QUrl {server.url ()}); + QVERIFY2 (script.run (2000), qPrintable (script.last_error ())); + QVERIFY (received.contains (QStringLiteral ("ready;"))); + QVERIFY (command_sent); + QVERIFY (delayed_reply.elapsed () >= 20); + QCOMPARE (server.count (TciSimServer::Direction::ClientToServer, + QStringLiteral ("vfo")), 1); + QCOMPARE (server.count (TciSimServer::Direction::ServerToClient, + QStringLiteral ("vfo")), 3); + } + + void scriptClosesAndAcceptsReconnect () + { + TciSimServer server; + QVERIFY (server.listen ()); + + QWebSocket client; + reconnect_once_after_retirement (client, server); + + TciSimScript script {&server}; + script.greet (TciSimGreeting::Minimal) + .close_normally () + .reconnect () + .greet (TciSimGreeting::Minimal); + client.open (QUrl {server.url ()}); + QVERIFY2 (script.run (3000), qPrintable (script.last_error ())); + QCOMPARE (server.connection_count (), 2); + QCOMPARE (server.count (TciSimServer::Direction::ServerToClient, + QStringLiteral ("ready")), 2); + auto const ready = server.messages (TciSimServer::Direction::ServerToClient, + QStringLiteral ("ready")); + QCOMPARE (ready.at (0).connection_generation, 1); + QCOMPARE (ready.at (1).connection_generation, 2); + } + + void reconnectExpectationsIgnoreOldConnectionCommands () + { + TciSimServer server; + QVERIFY (server.listen ()); + + QWebSocket client; + reconnect_once_after_retirement (client, server); + int client_connection_count {0}; + connect (&client, &QWebSocket::connected, this, + [&client, &client_connection_count] + { + ++client_connection_count; + if (client_connection_count == 2) + { + QTimer::singleShot (30, &client, + [&client] + { + client.sendTextMessage ( + QStringLiteral ("future:2;")); + }); + } + }); + + TciSimScript script {&server}; + script.expect (QStringLiteral ("trigger")) + .close_normally () + .reconnect () + .expect (QStringLiteral ("future"), + [] (QStringList const& args) {return args == QStringList {"2"};}); + client.open (QUrl {server.url ()}); + QVERIFY (server.wait_for ([&client, &server] + { + return server.client_connected () + && client.state () == QAbstractSocket::ConnectedState; + }, 1000)); + QTimer::singleShot (0, &client, + [&client] + { + client.sendTextMessage ( + QStringLiteral ("trigger;future:1;")); + }); + QVERIFY2 (script.run (3000), qPrintable (script.last_error ())); + auto const future = server.messages (TciSimServer::Direction::ClientToServer, + QStringLiteral ("future")); + QCOMPARE (future.size (), 2); + QCOMPARE (future.at (0).connection_generation, 1); + QCOMPARE (future.at (1).connection_generation, 2); + } + + void delayedPushDoesNotCrossConnectionGeneration () + { + TciSimServer server; + QVERIFY (server.listen ()); + + QWebSocket client; + reconnect_once_after_retirement (client, server); + client.open (QUrl {server.url ()}); + QVERIFY (server.wait_for ([&client, &server] + { + return server.client_connected () + && client.state () == QAbstractSocket::ConnectedState; + }, 1000)); + + TciSimScript script {&server}; + script.push (QStringLiteral ("old-generation"), 50); + QTimer::singleShot (10, &server, [&server] {server.close_client ();}); + QVERIFY2 (script.run (1000), qPrintable (script.last_error ())); + QVERIFY (server.wait_for ([&server] {return server.connection_count () == 2;}, 1000)); + QCOMPARE (server.count (TciSimServer::Direction::ServerToClient, + QStringLiteral ("old-generation")), 0); + } + + void replyUsesTheConsumedExpectationGeneration () + { + TciSimServer server; + QVERIFY (server.listen ()); + + QWebSocket client; + QStringList received; + connect (&client, &QWebSocket::textMessageReceived, this, + [&client, &received] (QString const& text) + { + received.append (text); + if (text == QStringLiteral ("ready;")) + { + client.sendTextMessage (QStringLiteral ("request:1;")); + } + }); + + TciSimScript script {&server}; + script.greet (TciSimGreeting::Minimal) + .expect (QStringLiteral ("request")) + .reply (QStringLiteral ("ack:1")); + client.open (QUrl {server.url ()}); + + QVERIFY2 (script.run (2000), qPrintable (script.last_error ())); + QVERIFY (server.wait_for ([&received] + { + return received.contains (QStringLiteral ("ack:1;")); + }, 1000)); + auto const replies = server.messages ( + TciSimServer::Direction::ServerToClient, QStringLiteral ("ack")); + QCOMPARE (replies.size (), 1); + QCOMPARE (replies.first ().connection_generation, 1); + } + + void replyWithoutAnExpectationFails () + { + TciSimServer server; + QVERIFY (server.listen ()); + + QWebSocket client; + TciSimScript script {&server}; + script.greet (TciSimGreeting::Minimal) + .reply (QStringLiteral ("ack:1")); + client.open (QUrl {server.url ()}); + + QVERIFY (!script.run (1000)); + QVERIFY (script.last_error ().contains ( + QStringLiteral ("reply requires an expectation"))); + QCOMPARE (server.count (TciSimServer::Direction::ServerToClient, + QStringLiteral ("ack")), 0); + } + + void closeWithoutAClientFails () + { + TciSimServer server; + QVERIFY (server.listen ()); + + TciSimScript script {&server}; + script.close_normally (); + + QVERIFY (!script.run (100)); + QVERIFY (script.last_error ().contains ( + QStringLiteral ("cannot close without a connected client"))); + QCOMPARE (server.connection_count (), 0); + } + + void failureIncludesTranscript () + { + TciSimServer server; + QVERIFY (server.listen ()); + QWebSocket client; + client.open (QUrl {server.url ()}); + QVERIFY (server.wait_for ([&server] { return server.client_connected (); }, 1000)); + client.sendTextMessage (QStringLiteral ("vfo:0,0,7074000;")); + + TciSimScript script {&server}; + script.expect (QStringLiteral ("trx"), {}, 20); + QVERIFY (!script.run (500)); + QCOMPARE (script.failed_step (), 1); + QVERIFY (script.last_error ().contains (QStringLiteral ("expecting trx"))); + QVERIFY (script.last_error ().contains (QStringLiteral ("vfo:0,0,7074000"))); + } + + void waitForShortCircuits () + { + TciSimServer server; + QElapsedTimer elapsed; + elapsed.start (); + QVERIFY (server.wait_for ([] { return true; }, 1000)); + QVERIFY (elapsed.elapsed () < 100); + } +}; + +QTEST_MAIN (TestTciSim) + +#include "test_tci_sim_smoke.moc" diff --git a/tests/unit/tci/test_tci_stream.cpp b/tests/unit/tci/test_tci_stream.cpp new file mode 100644 index 00000000..a9c8cfb4 --- /dev/null +++ b/tests/unit/tci/test_tci_stream.cpp @@ -0,0 +1,204 @@ +#include + +#include + +#include "Transceiver/TCIStream.hpp" + +class TestTciStream final + : public QObject +{ + Q_OBJECT + +private slots: + void preservesWireHeaderLayout () + { + QCOMPARE (sizeof (TciStream::Header), size_t {64}); + QCOMPARE (offsetof (TciStream::Header, length), size_t {20}); + QCOMPARE (offsetof (TciStream::Header, type), size_t {24}); + QCOMPARE (offsetof (TciStream::Header, channels), size_t {28}); + } + + void preparesExactZeroedFloatFrame () + { + QByteArray frame (128, '\x7f'); + + QVERIFY (TciStream::prepare_float_frame (&frame, 2048u)); + QCOMPARE (frame.size (), 64 + 2048 * int (sizeof (float))); + for (auto byte : frame) + { + QCOMPARE (byte, char {0}); + } + QVERIFY (TciStream::has_complete_float_payload (frame, 2048u)); + QVERIFY (!TciStream::has_complete_float_payload (frame.left (frame.size () - 1), 2048u)); + } + + void rejectsOversizedFloatFrame () + { + QByteArray frame; + QVERIFY (!TciStream::prepare_float_frame (&frame, TciStream::MaxFloatSamples + 1u)); + QVERIFY (!TciStream::checked_float_frame_size (1u, nullptr)); + } + + void recognizesChannelHeaderVersions_data () + { + QTest::addColumn ("version"); + QTest::addColumn ("expected"); + + QTest::newRow ("pre-channel header") << QString {"1.8"} << false; + QTest::newRow ("first channel header") << QString {"1.9"} << true; + QTest::newRow ("patch version") << QString {"1.9.1"} << true; + QTest::newRow ("current protocol") << QString {"2.0"} << true; + QTest::newRow ("invalid") << QString {"ExpertSDR3"} << false; + QTest::newRow ("missing") << QString {} << false; + } + + void recognizesChannelHeaderVersions () + { + QFETCH (QString, version); + QFETCH (bool, expected); + + QCOMPARE (TciStream::protocol_has_channels (version), expected); + } + + void validatesChronoParameters_data () + { + QTest::addColumn ("modern"); + QTest::addColumn ("header_channels"); + QTest::addColumn ("length"); + QTest::addColumn ("format"); + QTest::addColumn ("codec"); + QTest::addColumn ("sample_rate"); + QTest::addColumn ("expected_valid"); + QTest::addColumn ("expected_channels"); + + QTest::newRow ("legacy ignores reserved") + << false << quint32 {0xdeadbeefu} << quint32 {2048} + << TciStream::Float32Format << TciStream::UncompressedCodec << quint32 {48000} + << true << quint32 {2}; + QTest::newRow ("modern mono") + << true << quint32 {1} << quint32 {3} + << TciStream::Float32Format << TciStream::UncompressedCodec << quint32 {48000} + << true << quint32 {1}; + QTest::newRow ("modern stereo") + << true << quint32 {2} << quint32 {2048} + << TciStream::Float32Format << TciStream::UncompressedCodec << quint32 {48000} + << true << quint32 {2}; + QTest::newRow ("zero-length mono") + << true << quint32 {1} << quint32 {0} + << TciStream::Float32Format << TciStream::UncompressedCodec << quint32 {48000} + << true << quint32 {1}; + QTest::newRow ("odd stereo") + << true << quint32 {2} << quint32 {3} + << TciStream::Float32Format << TciStream::UncompressedCodec << quint32 {48000} + << false << quint32 {0}; + QTest::newRow ("invalid modern channels") + << true << quint32 {0} << quint32 {2048} + << TciStream::Float32Format << TciStream::UncompressedCodec << quint32 {48000} + << false << quint32 {0}; + QTest::newRow ("unsupported format") + << true << quint32 {2} << quint32 {2048} + << quint32 {0} << TciStream::UncompressedCodec << quint32 {48000} + << false << quint32 {0}; + QTest::newRow ("unsupported codec") + << true << quint32 {2} << quint32 {2048} + << TciStream::Float32Format << quint32 {1} << quint32 {48000} + << false << quint32 {0}; + QTest::newRow ("unsupported sample rate") + << true << quint32 {2} << quint32 {2048} + << TciStream::Float32Format << TciStream::UncompressedCodec << quint32 {24000} + << false << quint32 {0}; + QTest::newRow ("oversized") + << true << quint32 {1} << TciStream::MaxFloatSamples + 1u + << TciStream::Float32Format << TciStream::UncompressedCodec << quint32 {48000} + << false << quint32 {0}; + } + + void validatesChronoParameters () + { + QFETCH (bool, modern); + QFETCH (quint32, header_channels); + QFETCH (quint32, length); + QFETCH (quint32, format); + QFETCH (quint32, codec); + QFETCH (quint32, sample_rate); + QFETCH (bool, expected_valid); + QFETCH (quint32, expected_channels); + + TciStream::Header chrono {}; + chrono.sampleRate = sample_rate; + chrono.format = format; + chrono.codec = codec; + chrono.length = length; + chrono.channels = header_channels; + quint32 channels {99u}; + + QCOMPARE (TciStream::valid_tx_chrono (chrono, modern, 48000u, &channels), expected_valid); + if (expected_valid) + { + QCOMPARE (channels, expected_channels); + } + } + + void buildsConformingStereoResponse () + { + TciStream::Header chrono {}; + chrono.receiver = 1u; + chrono.sampleRate = 48000u; + chrono.length = 2048u; + QByteArray response; + + QVERIFY (TciStream::prepare_tx_audio_frame (&response, chrono, 2u)); + QCOMPARE (response.size (), 8256); + auto const * header = TciStream::header (response); + QCOMPARE (header->receiver, quint32 {1}); + QCOMPARE (header->sampleRate, quint32 {48000}); + QCOMPARE (header->format, TciStream::Float32Format); + QCOMPARE (header->codec, TciStream::UncompressedCodec); + QCOMPARE (header->length, quint32 {2048}); + QCOMPARE (header->type, quint32 {TciStream::TxAudioStream}); + QCOMPARE (header->channels, quint32 {2}); + for (auto reserved : header->reserved) + { + QCOMPARE (reserved, quint32 {0}); + } + for (quint32 i = 0u; i < header->length; ++i) + { + QCOMPARE (TciStream::float_payload (response)[i], 0.0f); + } + } + + void rejectsInvalidResponseChannelShape () + { + TciStream::Header chrono {}; + chrono.length = 3u; + QByteArray response; + + QVERIFY (!TciStream::prepare_tx_audio_frame (&response, chrono, 0u)); + QVERIFY (!TciStream::prepare_tx_audio_frame (&response, chrono, 2u)); + QVERIFY (TciStream::prepare_tx_audio_frame (&response, chrono, 1u)); + QCOMPARE (response.size (), 64 + 3 * int (sizeof (float))); + } + + void packsMonoAndStereoChannelFrames () + { + float mono[2] {}; + auto * mono_end = TciStream::write_channel_frame (0.25f, 1u, mono); + mono_end = TciStream::write_channel_frame (-0.5f, 1u, mono_end); + QCOMPARE (mono_end, mono + 2); + QCOMPARE (mono[0], 0.25f); + QCOMPARE (mono[1], -0.5f); + + float stereo[4] {}; + auto * stereo_end = TciStream::write_channel_frame (0.25f, 2u, stereo); + stereo_end = TciStream::write_channel_frame (-0.5f, 2u, stereo_end); + QCOMPARE (stereo_end, stereo + 4); + QCOMPARE (stereo[0], 0.25f); + QCOMPARE (stereo[1], 0.25f); + QCOMPARE (stereo[2], -0.5f); + QCOMPARE (stereo[3], -0.5f); + } +}; + +QTEST_MAIN (TestTciStream) + +#include "test_tci_stream.moc" diff --git a/tests/unit/tci/test_tci_transceiver_characterization.cpp b/tests/unit/tci/test_tci_transceiver_characterization.cpp new file mode 100644 index 00000000..17c3a395 --- /dev/null +++ b/tests/unit/tci/test_tci_transceiver_characterization.cpp @@ -0,0 +1,912 @@ +#include +#include + +#include + +#include +#include +#include +#include +#include + +#include "commons.h" +#include "TciSimScript.hpp" +#include "TciSimServer.hpp" +#include "Transceiver/TCITransceiver.hpp" +#include "widgets/itoneAndicw.h" + +namespace +{ + dec_data_t test_dec_data {}; + + using Direction = TciSimServer::Direction; + using Message = TciSimServer::Message; + using State = Transceiver::TransceiverState; + using Frequency = Transceiver::Frequency; + using CommandHandler = std::function; + + Frequency constexpr initial_frequency {14074000}; + + using RigFactory = std::function ( + Transceiver::logger_type *, QString const&)>; + + RigFactory legacy_rig_factory () + { + return [] (Transceiver::logger_type * logger, QString const& address) + { + return std::unique_ptr { + new TCITransceiver {logger, {}, QStringLiteral ("0"), address, + true, 0}}; + }; + } + + int message_index ( + TciSimServer const& server, int start, Direction direction, + QString const& verb, + std::function const& predicate = {}) + { + auto const& transcript = server.transcript (); + for (int i = qMax (0, start); i < transcript.size (); ++i) + { + auto const& message = transcript.at (i); + if (message.direction == direction && message.verb == verb + && (!predicate || predicate (message))) + { + return i; + } + } + return -1; + } + + bool has_args (Message const& message, QStringList const& args) + { + return message.args == args; + } + + class RigHarness + { + public: + using StatePredicate = std::function; + + explicit RigHarness (RigFactory factory = legacy_rig_factory ()) + : logger_ {boost::log::keywords::channel = "TCI_CHARACTERIZATION"} + , factory_ {std::move (factory)} + { + QObject::connect (&server_, &TciSimServer::client_arrived, &server_, + [this] (int) + { + server_.send_text (startup_greeting ()); + }); + QObject::connect (&server_, &TciSimServer::text_received, &server_, + [this] (QString const& text, int generation) + { + handle_client_text (text, generation); + }); + } + + ~RigHarness () + { + tearing_down_ = true; + command_handler_ = {}; + destroy_rig (); + server_.close (); + } + + bool listen () + { + if (!server_.listen ()) return false; + create_rig (); + return true; + } + + bool start (unsigned sequence_number = 1) + { + auto const update_cursor = observations_.size (); + auto const previous_generation = server_.connection_generation (); + auto * rig = rig_.get (); + QTimer::singleShot (0, rig, + [rig, sequence_number] + { + rig->start (sequence_number); + }); + auto const completed = server_.wait_for ( + [this, update_cursor, previous_generation, sequence_number] + { + return server_.client_connected () + && server_.connection_generation () > previous_generation + && observed_state_since ( + update_cursor, sequence_number, + [] (State const& state) {return state.online ();}); + }, 7000); + return completed && server_.client_connected () + && server_.connection_generation () > previous_generation + && observed_state_since ( + update_cursor, sequence_number, + [] (State const& state) {return state.online ();}); + } + + bool restart (unsigned sequence_number) + { + return start (sequence_number); + } + + bool stop () + { + auto const completed = std::make_shared (false); + auto * rig = rig_.get (); + QTimer::singleShot (0, rig, + [rig, completed] + { + rig->stop (); + *completed = true; + }); + return server_.wait_for ( + [this, completed] + { + return *completed && server_.client_disconnected (); + }, 7000); + } + + int set (State state, unsigned sequence_number) + { + auto const update_cursor = observations_.size (); + auto * rig = rig_.get (); + QTimer::singleShot (0, rig, + [rig, state, sequence_number] + { + rig->set (state, sequence_number); + }); + return update_cursor; + } + + void set_now (State const& state, unsigned sequence_number) + { + rig_->set (state, sequence_number); + } + + void schedule_set (State state, unsigned sequence_number) + { + QTimer::singleShot (0, &server_, + [this, state, sequence_number] + { + if (!tearing_down_ && rig_) + { + rig_->set (state, sequence_number); + } + }); + } + + void set_command_handler (CommandHandler handler) + { + command_handler_ = std::move (handler); + } + + TciSimServer& server () {return server_;} + Transceiver& rig () {return *rig_;} + State const& state () const {return state_;} + int observation_count () const {return observations_.size ();} + int failure_count () const {return failures_.size ();} + + bool observed_state_since ( + int cursor, StatePredicate const& predicate) const + { + for (int i = qMax (0, cursor); i < observations_.size (); ++i) + { + if (predicate (observations_.at (i).state)) return true; + } + return false; + } + + bool observed_state_since ( + int cursor, unsigned sequence_number, + StatePredicate const& predicate) const + { + for (int i = qMax (0, cursor); i < observations_.size (); ++i) + { + auto const& observation = observations_.at (i); + if (observation.sequence_number == sequence_number + && predicate (observation.state)) + { + return true; + } + } + return false; + } + + bool wait_for_state ( + int cursor, unsigned sequence_number, + StatePredicate predicate, int timeout_ms = 6000) + { + auto const failure_cursor = failures_.size (); + auto const completed = server_.wait_for ( + [this, cursor, sequence_number, &predicate, failure_cursor] + { + return failures_.size () > failure_cursor + || observed_state_since (cursor, sequence_number, predicate); + }, timeout_ms); + return completed && failures_.size () == failure_cursor + && observed_state_since (cursor, sequence_number, predicate); + } + + bool wait_for_current_state (StatePredicate predicate, int timeout_ms = 1000) + { + return server_.wait_for ([this, &predicate] {return predicate (state_);}, + timeout_ms); + } + + bool wait_for_failure (int cursor, int timeout_ms = 6000) + { + return server_.wait_for ([this, cursor] {return failures_.size () > cursor;}, + timeout_ms); + } + + QString diagnostics () const + { + auto const sequence = observations_.isEmpty () + ? 0u : observations_.last ().sequence_number; + auto const failure = failures_.isEmpty () + ? QStringLiteral ("none") : failures_.last (); + return QStringLiteral ( + "connected=%1 generation=%2 updates=%3 sequence=%4 online=%5 " + "rx=%6 tx=%7 split=%8 ptt=%9 failure=%10\n%11") + .arg (server_.client_connected ()) + .arg (server_.connection_generation ()) + .arg (observations_.size ()) + .arg (sequence) + .arg (state_.online ()) + .arg (state_.frequency ()) + .arg (state_.tx_frequency ()) + .arg (state_.split ()) + .arg (state_.ptt ()) + .arg (failure, server_.transcript_text ()); + } + + private: + struct StateObservation + { + State state; + unsigned sequence_number; + }; + + static QString startup_greeting () + { + return TciSimScript::greeting_messages (TciSimGreeting::Thetis).join (';') + + ';'; + } + + void create_rig () + { + auto const address = QStringLiteral ("127.0.0.1:%1").arg (server_.port ()); + rig_ = factory_ (&logger_, address); + QObject::connect ( + rig_.get (), &Transceiver::update, &server_, + [this] (State const& state, unsigned sequence_number) + { + state_ = state; + observations_.append ({state, sequence_number}); + }); + QObject::connect ( + rig_.get (), &Transceiver::failure, &server_, + [this] (QString const& reason) {failures_.append (reason);}); + } + + void destroy_rig () + { + if (!rig_) return; + + bool client_gone = !server_.client_connected (); + auto const connection = QObject::connect ( + &server_, &TciSimServer::client_gone, &server_, + [&client_gone] (int) {client_gone = true;}); + rig_->stop (); + if (!client_gone) + { + server_.wait_for ([&client_gone] {return client_gone;}, 1000); + } + QObject::disconnect (connection); + rig_.reset (); + QCoreApplication::processEvents (QEventLoop::AllEvents, 20); + } + + void handle_client_text (QString const& text, int generation) + { + auto const commands = text.split (';', Qt::SkipEmptyParts); + for (auto const& command : commands) + { + auto const separator = command.indexOf (':'); + auto const verb = separator < 0 + ? command.trimmed () : command.left (separator).trimmed (); + auto const args = separator < 0 + ? QStringList {} : command.mid (separator + 1).split (',', Qt::KeepEmptyParts); + if (command_handler_ && command_handler_ (verb, args, generation)) continue; + acknowledge (verb, args); + } + } + + void acknowledge (QString const& verb, QStringList const& args) + { + if (verb == QStringLiteral ("vfo") && args.size () >= 3) + { + server_.send_text (QStringLiteral ("vfo:%1,%2,%3") + .arg (args.at (0), args.at (1), args.at (2))); + } + else if (verb == QStringLiteral ("modulation") && args.size () >= 2) + { + server_.send_text (QStringLiteral ("modulation:%1,%2") + .arg (args.at (0), args.at (1))); + } + else if (verb == QStringLiteral ("split_enable")) + { + auto const enabled = args.size () >= 2 ? args.at (1) : args.value (0); + server_.send_text (QStringLiteral ("split_enable:0,%1").arg (enabled)); + } + else if (verb == QStringLiteral ("trx") && args.size () >= 2) + { + server_.send_text (QStringLiteral ("trx:%1,%2") + .arg (args.at (0), args.at (1))); + } + else if (verb == QStringLiteral ("rx_enable") && args.size () >= 2) + { + server_.send_text (QStringLiteral ("rx_enable:%1,%2") + .arg (args.at (0), args.at (1))); + } + else if (verb == QStringLiteral ("start") || verb == QStringLiteral ("stop")) + { + server_.send_text (verb); + } + } + + TciSimServer server_; + Transceiver::logger_type logger_; + RigFactory factory_; + std::unique_ptr rig_; + CommandHandler command_handler_; + QVector observations_; + QStringList failures_; + State state_; + bool tearing_down_ {false}; + }; + + State state_from (RigHarness const& harness) + { + auto state = harness.state (); + state.online (true); + return state; + } +} + +// The TCI object references application-owned DSP globals through wsjt_qt. +dec_data_t& dec_data = test_dec_data; +int volatile itone[MAX_NUM_SYMBOLS] {}; +int volatile icw[NUM_CW_SYMBOLS] {}; + +float gran () +{ + return 0.0f; +} + +class TestTciTransceiverCharacterization final + : public QObject +{ + Q_OBJECT + +private slots: + void initTestCase () + { + Logger::disable (); + qRegisterMetaType (); + } + + void startup_adopts_greeting_and_preserves_framing () + { + RigHarness harness; + QVERIFY (harness.listen ()); + QVERIFY2 (harness.start (), qPrintable (harness.diagnostics ())); + + auto const& server = harness.server (); + QCOMPARE (server.connection_count (), 1); + QCOMPARE (harness.state ().frequency (), initial_frequency); + QCOMPARE (harness.state ().tx_frequency (), Frequency {0}); + QCOMPARE (harness.state ().mode (), Transceiver::DIG_U); + QVERIFY (!harness.state ().split ()); + + auto const& frames = server.frames (); + QVERIFY (!frames.isEmpty ()); + QCOMPARE (frames.first ().raw, + TciSimScript::greeting_messages (TciSimGreeting::Thetis).join (';') + + ';'); + + auto const device = message_index (server, 0, Direction::ServerToClient, + QStringLiteral ("device")); + auto const rx_vfo = message_index (server, device + 1, Direction::ServerToClient, + QStringLiteral ("vfo")); + auto const mode = message_index (server, rx_vfo + 1, Direction::ServerToClient, + QStringLiteral ("modulation")); + auto const ready = message_index (server, mode + 1, Direction::ServerToClient, + QStringLiteral ("ready")); + QVERIFY2 (device >= 0 && rx_vfo > device && mode > rx_vfo + && ready > mode, + qPrintable (harness.diagnostics ())); + } + + void rx_vfo_acknowledgement_precedes_dependent_mode () + { + RigHarness harness; + QVERIFY (harness.listen ()); + QVERIFY2 (harness.start (), qPrintable (harness.diagnostics ())); + + Frequency constexpr target {14074100}; + auto const operation_start = harness.server ().transcript ().size (); + harness.set_command_handler ( + [&harness] (QString const& verb, QStringList const& args, int) + { + if (verb == QStringLiteral ("vfo") && args == QStringList {"0", "0", "14074100"}) + { + harness.server ().send_text_later ( + QStringLiteral ("unexpected:payload;vfo:1,0,14074100"), 5); + harness.server ().send_text_later (QStringLiteral ("vfo:0,0,14074100"), 30); + return true; + } + return false; + }); + + auto requested = state_from (harness); + requested.frequency (target); + requested.mode (Transceiver::USB); + auto const update_cursor = harness.set (requested, 10); + QVERIFY2 (harness.wait_for_state ( + update_cursor, 10, + [] (State const& state) + { + return state.frequency () == target && state.mode () == Transceiver::USB; + }), qPrintable (harness.diagnostics ())); + + auto const& server = harness.server (); + auto const vfo_command = message_index ( + server, operation_start, Direction::ClientToServer, QStringLiteral ("vfo"), + [] (Message const& message) {return has_args (message, {"0", "0", "14074100"});}); + auto const vfo_ack = message_index ( + server, vfo_command + 1, Direction::ServerToClient, QStringLiteral ("vfo"), + [] (Message const& message) {return has_args (message, {"0", "0", "14074100"});}); + auto const mode_command = message_index ( + server, operation_start, Direction::ClientToServer, QStringLiteral ("modulation"), + [] (Message const& message) {return has_args (message, {"0", "usb"});}); + QVERIFY2 (vfo_command >= 0 && vfo_ack > vfo_command && mode_command > vfo_ack, + qPrintable (harness.diagnostics ())); + QCOMPARE (harness.state ().frequency (), target); + QCOMPARE (harness.state ().mode (), Transceiver::USB); + + auto const vfo_count = server.count (Direction::ClientToServer, + QStringLiteral ("vfo")); + auto const mode_count = server.count (Direction::ClientToServer, + QStringLiteral ("modulation")); + QTest::qWait (75); + QCOMPARE (server.count (Direction::ClientToServer, QStringLiteral ("vfo")), + vfo_count); + QCOMPARE (server.count (Direction::ClientToServer, + QStringLiteral ("modulation")), mode_count); + } + + void unacknowledged_rx_vfo_fails_boundedly_without_dependent_commands () + { + RigHarness harness; + QVERIFY (harness.listen ()); + QVERIFY2 (harness.start (), qPrintable (harness.diagnostics ())); + auto const failure_cursor = harness.failure_count (); + + Frequency constexpr target {7074125}; + auto const operation_start = harness.server ().transcript ().size (); + harness.set_command_handler ( + [] (QString const& verb, QStringList const& args, int) + { + return verb == QStringLiteral ("vfo") + && args == QStringList {"0", "0", "7074125"}; + }); + auto requested = state_from (harness); + requested.frequency (target); + requested.mode (Transceiver::USB); + + QElapsedTimer deadline; + deadline.start (); + harness.set (requested, 20); + QVERIFY2 (harness.wait_for_failure (failure_cursor), + qPrintable (harness.diagnostics ())); + + auto const& server = harness.server (); + auto const attempts = server.messages (Direction::ClientToServer, + QStringLiteral ("vfo")); + int matching_attempts {0}; + for (auto const& attempt : attempts) + { + if (attempt.ordinal < static_cast (operation_start)) continue; + QVERIFY2 (has_args (attempt, {"0", "0", "7074125"}), + qPrintable (harness.diagnostics ())); + ++matching_attempts; + } + QVERIFY2 (matching_attempts >= 1, qPrintable (harness.diagnostics ())); + QCOMPARE (message_index (server, operation_start, Direction::ClientToServer, + QStringLiteral ("modulation")), -1); + QVERIFY (deadline.elapsed () < 6000); + QVERIFY (harness.failure_count () - failure_cursor <= 1); + QVERIFY (harness.wait_for_current_state ( + [] (State const& state) {return !state.online ();})); + + auto const attempts_after_failure = matching_attempts; + QTest::qWait (50); + int attempts_after_wait {0}; + for (auto const& attempt : server.messages (Direction::ClientToServer, + QStringLiteral ("vfo"))) + { + if (attempt.ordinal >= static_cast (operation_start) + && has_args (attempt, {"0", "0", "7074125"})) + { + ++attempts_after_wait; + } + } + QCOMPARE (attempts_after_wait, attempts_after_failure); + } + + void split_and_tx_vfo_settle_before_ptt () + { + RigHarness harness; + QVERIFY (harness.listen ()); + QVERIFY2 (harness.start (), qPrintable (harness.diagnostics ())); + + Frequency constexpr tx_frequency {14076000}; + auto const operation_start = harness.server ().transcript ().size (); + struct AcknowledgementState + { + bool split_scheduled {false}; + bool split_sent {false}; + bool tx_vfo_scheduled {false}; + bool tx_vfo_sent {false}; + bool ptt_before_prerequisites {false}; + }; + auto const acknowledgements = std::make_shared (); + harness.set_command_handler ( + [&harness, acknowledgements] (QString const& verb, + QStringList const& args, int) + { + if (verb == QStringLiteral ("split_enable") + && args == QStringList {"0", "true"}) + { + if (!acknowledgements->split_scheduled + && !acknowledgements->split_sent) + { + acknowledgements->split_scheduled = true; + QTimer::singleShot ( + 25, &harness.server (), + [&harness, acknowledgements] + { + acknowledgements->split_sent = true; + harness.server ().send_text ( + QStringLiteral ("split_enable:0,true")); + }); + } + return !acknowledgements->split_sent; + } + if (verb == QStringLiteral ("vfo") + && args == QStringList {"0", "1", "14076000"}) + { + if (!acknowledgements->tx_vfo_scheduled + && !acknowledgements->tx_vfo_sent) + { + acknowledgements->tx_vfo_scheduled = true; + QTimer::singleShot ( + 25, &harness.server (), + [&harness, acknowledgements] + { + acknowledgements->tx_vfo_sent = true; + harness.server ().send_text ( + QStringLiteral ("vfo:0,1,14076000")); + }); + } + return !acknowledgements->tx_vfo_sent; + } + if (verb == QStringLiteral ("trx") + && args == QStringList {"0", "true"}) + { + acknowledgements->ptt_before_prerequisites = + acknowledgements->ptt_before_prerequisites + || !acknowledgements->split_sent + || !acknowledgements->tx_vfo_sent; + } + return false; + }); + auto requested = state_from (harness); + requested.tx_frequency (tx_frequency); + requested.split (true); + requested.ptt (true); + auto const update_cursor = harness.set (requested, 30); + QVERIFY2 (harness.wait_for_state ( + update_cursor, 30, + [] (State const& state) + { + return state.split () && state.tx_frequency () == tx_frequency + && state.ptt (); + }), qPrintable (harness.diagnostics ())); + + auto const& server = harness.server (); + auto const split_command = message_index ( + server, operation_start, Direction::ClientToServer, + QStringLiteral ("split_enable"), + [] (Message const& message) {return has_args (message, {"0", "true"});}); + auto const split_ack = message_index ( + server, operation_start, Direction::ServerToClient, QStringLiteral ("split_enable"), + [] (Message const& message) {return has_args (message, {"0", "true"});}); + auto const tx_vfo_command = message_index ( + server, operation_start, Direction::ClientToServer, QStringLiteral ("vfo"), + [] (Message const& message) + { + return has_args (message, {"0", "1", "14076000"}); + }); + auto const tx_vfo_ack = message_index ( + server, operation_start, Direction::ServerToClient, QStringLiteral ("vfo"), + [] (Message const& message) {return has_args (message, {"0", "1", "14076000"});}); + auto const ptt_command = message_index ( + server, operation_start, Direction::ClientToServer, QStringLiteral ("trx"), + [] (Message const& message) {return message.args.size () >= 2 + && message.args.at (0) == "0" + && message.args.at (1) == "true";}); + QVERIFY2 (!acknowledgements->ptt_before_prerequisites && split_command >= 0 + && split_ack > split_command && tx_vfo_command >= 0 + && tx_vfo_ack > tx_vfo_command && ptt_command > split_ack + && ptt_command > tx_vfo_ack, + qPrintable (harness.diagnostics ())); + QVERIFY (harness.state ().split ()); + QCOMPARE (harness.state ().tx_frequency (), tx_frequency); + QVERIFY (harness.state ().ptt ()); + } + + void unsolicited_split_divergence_converges_without_ptt () + { + RigHarness harness; + QVERIFY (harness.listen ()); + QVERIFY2 (harness.start (), qPrintable (harness.diagnostics ())); + + auto requested = state_from (harness); + requested.tx_frequency (14076050); + requested.split (true); + auto const setup_cursor = harness.set (requested, 35); + QVERIFY2 (harness.wait_for_state ( + setup_cursor, 35, + [] (State const& state) {return state.split ();}), + qPrintable (harness.diagnostics ())); + QVERIFY (harness.state ().split ()); + + auto const operation_start = harness.server ().transcript ().size (); + auto const observation_cursor = harness.observation_count (); + harness.server ().send_text (QStringLiteral ("split_enable:0,false")); + + QVERIFY (harness.server ().wait_for ( + [&harness, operation_start, observation_cursor] + { + return message_index ( + harness.server (), operation_start, Direction::ClientToServer, + QStringLiteral ("split_enable"), + [] (Message const& message) {return has_args (message, {"0", "true"});}) + >= 0 + || harness.observed_state_since ( + observation_cursor, + [] (State const& state) {return !state.split ();}); + }, 1000)); + + auto const correction = message_index ( + harness.server (), operation_start, Direction::ClientToServer, + QStringLiteral ("split_enable"), + [] (Message const& message) {return has_args (message, {"0", "true"});}); + if (correction >= 0) + { + QVERIFY (harness.server ().wait_for ( + [&harness] {return harness.state ().split ();}, 1000)); + } + else + { + QVERIFY2 (!harness.state ().split (), + qPrintable (harness.diagnostics ())); + } + QCOMPARE (message_index (harness.server (), operation_start, + Direction::ClientToServer, + QStringLiteral ("trx")), -1); + } + + void explicit_stop_can_restart_on_a_new_connection_generation () + { + RigHarness harness; + QVERIFY (harness.listen ()); + QVERIFY2 (harness.start (), qPrintable (harness.diagnostics ())); + auto const first_generation = harness.server ().connection_generation (); + + QVERIFY2 (harness.stop (), qPrintable (harness.diagnostics ())); + QVERIFY2 (harness.restart (41), qPrintable (harness.diagnostics ())); + + QVERIFY (harness.server ().connection_generation () > first_generation); + auto const second_generation = harness.server ().connection_generation (); + QVERIFY (harness.state ().online ()); + QCOMPARE (harness.state ().frequency (), initial_frequency); + + auto requested = state_from (harness); + requested.frequency (14074125); + auto const update_cursor = harness.set (requested, 42); + QVERIFY2 (harness.wait_for_state ( + update_cursor, 42, + [] (State const& state) {return state.frequency () == 14074125;}), + qPrintable (harness.diagnostics ())); + QCOMPARE (harness.state ().frequency (), Frequency {14074125}); + auto const fresh_command = message_index ( + harness.server (), 0, Direction::ClientToServer, QStringLiteral ("vfo"), + [second_generation] (Message const& message) + { + return message.connection_generation == second_generation + && has_args (message, {"0", "0", "14074125"}); + }); + QVERIFY2 (fresh_command >= 0, qPrintable (harness.diagnostics ())); + } + + void in_flight_disconnect_is_bounded () + { + RigHarness harness; + QVERIFY (harness.listen ()); + QVERIFY2 (harness.start (), qPrintable (harness.diagnostics ())); + auto const failure_cursor = harness.failure_count (); + + harness.set_command_handler ( + [&harness] (QString const& verb, QStringList const& args, int) + { + if (verb != QStringLiteral ("vfo") + || args != QStringList {"0", "0", "14074150"}) return false; + QTimer::singleShot (0, &harness.server (), + [&harness] {harness.server ().close_client ();}); + return true; + }); + auto requested = state_from (harness); + requested.frequency (14074150); + + QElapsedTimer deadline; + deadline.start (); + harness.set (requested, 42); + QVERIFY (harness.server ().wait_for ( + [&harness] {return harness.server ().client_disconnected ();}, 1000)); + + harness.set_command_handler ({}); + QVERIFY2 (harness.stop (), qPrintable (harness.diagnostics ())); + QVERIFY (deadline.elapsed () < 8000); + QVERIFY (harness.failure_count () - failure_cursor <= 1); + } + + void unexpected_stale_and_duplicate_messages_leave_coherent_state () + { + RigHarness harness; + QVERIFY (harness.listen ()); + QVERIFY2 (harness.start (), qPrintable (harness.diagnostics ())); + auto const failure_cursor = harness.failure_count (); + + Frequency constexpr target {14074200}; + auto const operation_start = harness.server ().transcript ().size (); + bool injected {false}; + harness.set_command_handler ( + [&harness, &injected] (QString const& verb, QStringList const& args, int) + { + if (injected || verb != QStringLiteral ("vfo") + || args != QStringList {"0", "0", "14074200"}) return false; + injected = true; + harness.server ().send_text ( + QStringLiteral ("unexpected:payload;vfo:1,0,not-a-frequency")); + harness.server ().send_text_later (QStringLiteral ("vfo:0,0,14074199"), 10); + harness.server ().send_text_later ( + QStringLiteral ("vfo:0,0,14074200;vfo:0,0,14074200"), 25); + return true; + }); + auto requested = state_from (harness); + requested.frequency (target); + harness.set (requested, 50); + + QVERIFY (harness.server ().wait_for ( + [&harness] + { + int correct_acks {0}; + for (auto const& message : harness.server ().messages ( + Direction::ServerToClient, QStringLiteral ("vfo"))) + { + if (has_args (message, {"0", "0", "14074200"})) ++correct_acks; + } + return correct_acks == 2; + }, 1000)); + QCOMPARE (harness.failure_count (), failure_cursor); + QVERIFY (harness.wait_for_current_state ( + [] (State const& state) {return state.frequency () == target;})); + QCOMPARE (harness.state ().frequency (), target); + + int requested_attempts {0}; + for (auto const& message : harness.server ().messages ( + Direction::ClientToServer, QStringLiteral ("vfo"))) + { + if (message.ordinal >= static_cast (operation_start) + && has_args (message, {"0", "0", "14074200"})) + { + ++requested_attempts; + } + } + QVERIFY (requested_attempts >= 1); + } + + void reentrant_duplicate_request_is_bounded_and_coherent () + { + RigHarness harness; + QVERIFY (harness.listen ()); + QVERIFY2 (harness.start (), qPrintable (harness.diagnostics ())); + auto const failure_cursor = harness.failure_count (); + + Frequency constexpr target {14074250}; + auto requested = state_from (harness); + requested.frequency (target); + bool reentered {false}; + harness.set_command_handler ( + [&harness, &reentered, requested] (QString const& verb, + QStringList const& args, int) + { + if (reentered || verb != QStringLiteral ("vfo") + || args != QStringList {"0", "0", "14074250"}) return false; + reentered = true; + harness.schedule_set (requested, 61); + harness.server ().send_text_later (QStringLiteral ("vfo:0,0,14074250"), 25); + return true; + }); + + auto const reentrant_cursor = harness.observation_count (); + harness.set_now (requested, 60); + QCOMPARE (harness.failure_count (), failure_cursor); + QCOMPARE (harness.state ().frequency (), target); + QVERIFY (reentered); + QVERIFY2 (harness.observed_state_since ( + reentrant_cursor, 61, + [] (State const& state) {return state.frequency () == target;}), + qPrintable (harness.diagnostics ())); + } + + void reentrant_superseding_request_remains_recoverable () + { + RigHarness harness; + QVERIFY (harness.listen ()); + QVERIFY2 (harness.start (), qPrintable (harness.diagnostics ())); + auto const failure_cursor = harness.failure_count (); + + Frequency constexpr first_target {14074300}; + Frequency constexpr latest_target {14074350}; + auto first = state_from (harness); + first.frequency (first_target); + auto latest = first; + latest.frequency (latest_target); + bool reentered {false}; + harness.set_command_handler ( + [&harness, &reentered, latest] (QString const& verb, + QStringList const& args, int) + { + if (reentered || verb != QStringLiteral ("vfo") + || args != QStringList {"0", "0", "14074300"}) return false; + reentered = true; + harness.schedule_set (latest, 71); + harness.server ().send_text_later (QStringLiteral ("vfo:0,0,14074300"), 25); + return true; + }); + + auto const reentrant_cursor = harness.observation_count (); + harness.set_now (first, 70); + auto const settled = harness.state ().frequency (); + QVERIFY (settled == first_target || settled == latest_target); + QCOMPARE (harness.failure_count (), failure_cursor); + QVERIFY2 (harness.observed_state_since ( + reentrant_cursor, 71, + [] (State const&) {return true;}), + qPrintable (harness.diagnostics ())); + + harness.set_now (latest, 72); + QCOMPARE (harness.failure_count (), failure_cursor); + QCOMPARE (harness.state ().frequency (), latest_target); + QVERIFY (reentered); + } +}; + +QTEST_GUILESS_MAIN (TestTciTransceiverCharacterization) + +#include "test_tci_transceiver_characterization.moc" diff --git a/tests/unit/tci/test_transceiver_base_period.cpp b/tests/unit/tci/test_transceiver_base_period.cpp new file mode 100644 index 00000000..976e6651 --- /dev/null +++ b/tests/unit/tci/test_transceiver_base_period.cpp @@ -0,0 +1,164 @@ +#include "Transceiver/TransceiverBase.hpp" + +#include + +#include + +#include +#include + +namespace +{ + class PeriodRecordingTransceiver final + : public TransceiverBase + { + public: + explicit PeriodRecordingTransceiver (logger_type * logger) + : TransceiverBase {logger, nullptr} + { + } + + QVector applied_periods; + QStringList events; + double backend_period {15.0}; + bool fail_next_period {false}; + + protected: + int do_start () override {return 0;} + void do_stop () override {backend_period = 15.0;} + void do_frequency (Frequency, MODE, bool) override {} + void do_tx_frequency (Frequency, MODE, bool) override {} + void do_mode (MODE) override {} + void do_ptt (bool) override {} + + void do_period (double period) override + { + events.append (QStringLiteral ("period")); + if (fail_next_period) + { + fail_next_period = false; + throw std::runtime_error {"period rejected"}; + } + backend_period = period; + applied_periods.append (period); + } + + void do_modulator_start (TxEvidence::TxRequest const&) override + { + events.append (QStringLiteral ("modulator")); + } + }; + + Transceiver::TransceiverState online_state () + { + Transceiver::TransceiverState state; + state.online (true); + return state; + } +} + +class TestTransceiverBasePeriod final + : public QObject +{ + Q_OBJECT + +private slots: + void initial_period_is_applied_even_when_it_matches_state_default () + { + Transceiver::logger_type logger { + boost::log::keywords::channel = "TEST"}; + PeriodRecordingTransceiver rig {&logger}; + QVector expected {120.0}; + + rig.set (online_state (), 1); + + QCOMPARE (rig.applied_periods, expected); + QCOMPARE (rig.backend_period, 120.0); + } + + void unchanged_period_is_not_reapplied () + { + Transceiver::logger_type logger { + boost::log::keywords::channel = "TEST"}; + PeriodRecordingTransceiver rig {&logger}; + auto state = online_state (); + QVector expected {120.0}; + + rig.set (state, 1); + rig.set (state, 2); + + QCOMPARE (rig.applied_periods, expected); + } + + void changed_period_is_applied_once () + { + Transceiver::logger_type logger { + boost::log::keywords::channel = "TEST"}; + PeriodRecordingTransceiver rig {&logger}; + auto state = online_state (); + QVector expected {120.0, 15.0}; + + rig.set (state, 1); + state.period (15.0); + rig.set (state, 2); + rig.set (state, 3); + + QCOMPARE (rig.applied_periods, expected); + QCOMPARE (rig.backend_period, 15.0); + } + + void period_is_reapplied_after_restart () + { + Transceiver::logger_type logger { + boost::log::keywords::channel = "TEST"}; + PeriodRecordingTransceiver rig {&logger}; + auto state = online_state (); + QVector expected {120.0, 120.0}; + + rig.set (state, 1); + rig.stop (); + rig.start (2); + state = online_state (); + rig.set (state, 3); + + QCOMPARE (rig.applied_periods, expected); + QCOMPARE (rig.backend_period, 120.0); + } + + void period_is_applied_before_modulator_start () + { + Transceiver::logger_type logger { + boost::log::keywords::channel = "TEST"}; + PeriodRecordingTransceiver rig {&logger}; + auto state = online_state (); + QStringList expected {QStringLiteral ("period"), + QStringLiteral ("modulator")}; + state.tx_audio (true); + + rig.set (state, 1); + + QCOMPARE (rig.events, expected); + } + + void failed_period_is_retried () + { + Transceiver::logger_type logger { + boost::log::keywords::channel = "TEST"}; + PeriodRecordingTransceiver rig {&logger}; + QSignalSpy failures {&rig, &Transceiver::failure}; + auto state = online_state (); + QVector expected {120.0}; + rig.fail_next_period = true; + + rig.set (state, 1); + rig.set (state, 2); + + QCOMPARE (failures.count (), 1); + QCOMPARE (rig.applied_periods, expected); + QCOMPARE (rig.backend_period, 120.0); + } +}; + +QTEST_GUILESS_MAIN (TestTransceiverBasePeriod) + +#include "test_transceiver_base_period.moc" diff --git a/tests/unit/wsprd/CMakeLists.txt b/tests/unit/wsprd/CMakeLists.txt new file mode 100644 index 00000000..47580f6c --- /dev/null +++ b/tests/unit/wsprd/CMakeLists.txt @@ -0,0 +1,7 @@ +add_executable (test_wsprd_utils + test_wsprd_utils.c + ${CMAKE_SOURCE_DIR}/lib/lookup3.c + ${CMAKE_SOURCE_DIR}/lib/wsprd/wsprd_utils.c + ${CMAKE_SOURCE_DIR}/lib/wsprd/nhash.c) + +add_test (NAME test_wsprd_utils COMMAND test_wsprd_utils) diff --git a/tests/unit/wsprd/test_wsprd_utils.c b/tests/unit/wsprd/test_wsprd_utils.c new file mode 100644 index 00000000..6a840f22 --- /dev/null +++ b/tests/unit/wsprd/test_wsprd_utils.c @@ -0,0 +1,253 @@ +#include +#include +#include + +#include "lib/wsprd/nhash.h" +#include "lib/wsprd/wsprd_utils.h" + +struct wspr_vector { + const char *name; + signed char data[11]; + const char *message; + const char *callsign; +}; + +static int failures = 0; + +static void expect_string(const char *label, const char *actual, + const char *expected) +{ + if( strcmp(actual, expected) != 0 ) { + fprintf(stderr, "%s: expected '%s', got '%s'\n", + label, expected, actual); + failures++; + } +} + +static void expect_int(const char *label, int actual, int expected) +{ + if( actual != expected ) { + fprintf(stderr, "%s: expected %d, got %d\n", + label, expected, actual); + failures++; + } +} + +static void decode_vector(const struct wspr_vector *vector, + char *hashtab, char *loctab) +{ + char call_loc_pow[23] = {0}; + char callsign[13] = {0}; + int noprint = unpk_((signed char *)vector->data, hashtab, loctab, + call_loc_pow, callsign); + + expect_int(vector->name, noprint, 0); + expect_string(vector->name, call_loc_pow, vector->message); + expect_string(vector->name, callsign, vector->callsign); +} + +static void expect_hash_entry(const char *callsign, const char *grid, + char *hashtab, char *loctab) +{ + int ihash = nhash(callsign, strlen(callsign), (uint32_t)146); + expect_string(callsign, hashtab + ihash * WSPRD_CALLSIGN_SIZE, callsign); + if( grid != NULL ) { + expect_string(callsign, loctab + ihash * WSPRD_GRID4_SIZE, grid); + } +} + +static void expect_hash_slot(int ihash, const char *callsign, const char *grid, + char *hashtab, char *loctab) +{ + expect_string(callsign, hashtab + ihash * WSPRD_CALLSIGN_SIZE, callsign); + expect_string(callsign, loctab + ihash * WSPRD_GRID4_SIZE, grid); +} + +static void run_with_fresh_tables(void (*test)(char *, char *)) +{ + char *hashtab = calloc(WSPRD_HASH_COUNT * WSPRD_CALLSIGN_SIZE, 1); + char *loctab = calloc(WSPRD_HASH_COUNT * WSPRD_GRID4_SIZE, 1); + if( hashtab == NULL || loctab == NULL ) { + fprintf(stderr, "failed to allocate WSPR hash tables\n"); + exit(2); + } + + test(hashtab, loctab); + + free(hashtab); + free(loctab); +} + +static const struct wspr_vector k1abc = { + "K1ABC FN42 33", + {-9, 12, 35, -117, 13, 24, 64, 0, 0, 0, 0}, + "K1ABC FN42 33", + "K1ABC" +}; + +static const struct wspr_vector n1d = { + "N1D FN42 33", + {-9, -99, 1, -117, 13, 24, 64, 0, 0, 0, 0}, + "N1D FN42 33", + "N1D" +}; + +static const struct wspr_vector five_n = { + "5N/6O0O 37", + {45, 15, -83, 104, 42, -103, -64, 0, 0, 0, 0}, + "5N/6O0O 37", + "5N/6O0O" +}; + +static const struct wspr_vector pj4 = { + "PJ4/K1ABC 37", + {-9, 12, 35, -127, 14, -103, -64, 0, 0, 0, 0}, + "PJ4/K1ABC 37", + "PJ4/K1ABC" +}; + +static const struct wspr_vector rover = { + "K1ABC/R 37", + {-9, 12, 35, -115, 79, 121, -64, 0, 0, 0, 0}, + "K1ABC/R 37", + "K1ABC/R" +}; + +static const struct wspr_vector k1abc_type3_unresolved = { + " FN42AA 33", + {-100, 54, -76, -77, 47, 39, -128, 0, 0, 0, 0}, + "<...> FN42AA 33", + "<...>" +}; + +static const struct wspr_vector k1abc_type3_resolved = { + " FN42AA 33", + {-100, 54, -76, -77, 47, 39, -128, 0, 0, 0, 0}, + " FN42AA 33", + "" +}; + +static const struct wspr_vector pj4_type3_unresolved = { + " FK52UD 37", + {-120, 36, 124, 105, -94, -26, -128, 0, 0, 0, 0}, + "<...> FK52UD 37", + "<...>" +}; + +static const struct wspr_vector pj4_type3_resolved = { + " FK52UD 37", + {-120, 36, 124, 105, -94, -26, -128, 0, 0, 0, 0}, + " FK52UD 37", + "" +}; + +static void test_standard_and_compound_messages(char *hashtab, char *loctab) +{ + decode_vector(&k1abc, hashtab, loctab); + expect_hash_entry("K1ABC", "FN42", hashtab, loctab); + + decode_vector(&n1d, hashtab, loctab); + expect_hash_entry("N1D", "FN42", hashtab, loctab); + + decode_vector(&five_n, hashtab, loctab); + expect_hash_entry("5N/6O0O", NULL, hashtab, loctab); + + decode_vector(&pj4, hashtab, loctab); + expect_hash_entry("PJ4/K1ABC", NULL, hashtab, loctab); + + decode_vector(&rover, hashtab, loctab); + expect_hash_entry("K1ABC/R", NULL, hashtab, loctab); +} + +static void test_type3_unresolved(char *hashtab, char *loctab) +{ + decode_vector(&k1abc_type3_unresolved, hashtab, loctab); + decode_vector(&pj4_type3_unresolved, hashtab, loctab); +} + +static void test_type3_resolved_k1abc(char *hashtab, char *loctab) +{ + decode_vector(&k1abc, hashtab, loctab); + decode_vector(&k1abc_type3_resolved, hashtab, loctab); +} + +static void test_type3_resolved_pj4(char *hashtab, char *loctab) +{ + decode_vector(&pj4, hashtab, loctab); + decode_vector(&pj4_type3_resolved, hashtab, loctab); +} + +static void test_hash_table_line_loading(char *hashtab, char *loctab) +{ + expect_int("load hash line with grid", + wsprd_load_hash_line(" 42 K1ABC FN42\n", hashtab, loctab), 1); + expect_hash_slot(42, "K1ABC", "FN42", hashtab, loctab); + + expect_int("load hash line without grid", + wsprd_load_hash_line("43 PJ4/K1ABC\n", hashtab, loctab), 1); + expect_hash_slot(43, "PJ4/K1ABC", "", hashtab, loctab); + + expect_int("load hash line with suffix call", + wsprd_load_hash_line("46 K1ABC/R\n", hashtab, loctab), 1); + expect_hash_slot(46, "K1ABC/R", "", hashtab, loctab); + + expect_int("load hash line with numeric suffix", + wsprd_load_hash_line("47 K1ABC/10\n", hashtab, loctab), 1); + expect_hash_slot(47, "K1ABC/10", "", hashtab, loctab); + + expect_int("load hash line with short prefix", + wsprd_load_hash_line("48 5N/6O0O\n", hashtab, loctab), 1); + expect_hash_slot(48, "5N/6O0O", "", hashtab, loctab); + + strcpy(loctab + 44 * WSPRD_GRID4_SIZE, "ABCD"); + expect_int("load hash line preserves missing grid", + wsprd_load_hash_line("44 K1ABC\n", hashtab, loctab), 1); + expect_hash_slot(44, "K1ABC", "ABCD", hashtab, loctab); + + strcpy(loctab + 49 * WSPRD_GRID4_SIZE, "ABCD"); + expect_int("load hash line preserves writer whitespace", + wsprd_load_hash_line(" 49\tPJ4/K1ABC \r\n", hashtab, loctab), 1); + expect_hash_slot(49, "PJ4/K1ABC", "ABCD", hashtab, loctab); + + expect_int("load hash line ignores trailing tokens", + wsprd_load_hash_line("45 K1ABC FN42 ignored\n", hashtab, loctab), 1); + expect_hash_slot(45, "K1ABC", "FN42", hashtab, loctab); + + expect_int("load max-size hash line", + wsprd_load_hash_line("32767 123456789012 ABCD\n", hashtab, loctab), 1); + expect_hash_slot(32767, "123456789012", "ABCD", hashtab, loctab); +} + +static void expect_rejected_hash_line(const char *line, + char *hashtab, char *loctab) +{ + const int slot = 7; + strcpy(hashtab + slot * WSPRD_CALLSIGN_SIZE, "KEEP"); + strcpy(loctab + slot * WSPRD_GRID4_SIZE, "ABCD"); + + expect_int(line, wsprd_load_hash_line(line, hashtab, loctab), 0); + expect_hash_slot(slot, "KEEP", "ABCD", hashtab, loctab); +} + +static void test_invalid_hash_table_lines(char *hashtab, char *loctab) +{ + expect_rejected_hash_line("", hashtab, loctab); + expect_rejected_hash_line("7\n", hashtab, loctab); + expect_rejected_hash_line("slot K1ABC FN42\n", hashtab, loctab); + expect_rejected_hash_line("-1 K1ABC FN42\n", hashtab, loctab); + expect_rejected_hash_line("32768 K1ABC FN42\n", hashtab, loctab); + expect_rejected_hash_line("7 1234567890123 FN42\n", hashtab, loctab); + expect_rejected_hash_line("7 K1ABC FN421\n", hashtab, loctab); +} + +int main(void) +{ + run_with_fresh_tables(test_standard_and_compound_messages); + run_with_fresh_tables(test_type3_unresolved); + run_with_fresh_tables(test_type3_resolved_k1abc); + run_with_fresh_tables(test_type3_resolved_pj4); + run_with_fresh_tables(test_hash_table_line_loading); + run_with_fresh_tables(test_invalid_hash_table_lines); + + return failures == 0 ? 0 : 1; +} diff --git a/translations/wsjtx_ca.ts b/translations/wsjtx_ca.ts index e581ea6c..a1625409 100644 --- a/translations/wsjtx_ca.ts +++ b/translations/wsjtx_ca.ts @@ -115,18 +115,17 @@ - - + Wanted only - + Message Missatge - + My call only @@ -134,149 +133,158 @@ Astro - - + + Doppler tracking Seguiment de Doppler - + <html><head/><body><p>One station does all Doppler shift correction, their QSO partner receives and transmits on the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>Una estació realitza totes les correccions de desplaçament Doppler, l'altra corresponsal de QSO rep i transmet a la freqüència de desplaçament.</p><p>Si l'equip no accepta comandes CAT QSY mentre es transmet, només s'aplicarà una sola correcció durant tot el període de transmissió.</p></body></html> - + Full Doppler to DX Grid Doppler complet a graella de DX - + <html><head/><body><p>Transmit takes place on sked frequency and receive frequency is corrected for own echoes. </p><p>This mode can be used for calling CQ, or when using Echo mode.</p></body></html> <html><head/><body><p>La transmissió té lloc en freqüència de desplaçament i la freqüència de recepció es corregeix per els ecos propis. </p><p>Aquest mode es pot utilitzar per trucar a CQ o per utilitzar el mode Eco.</p></body></html> - + Own Echo Eco propi - + <html><head/><body><p>Both stations correct for Doppler shift such that they would be heard on the moon at the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p><p>Use this option also for Echo mode.</p></body></html> <html><head/><body><p>Ambdues estacions corregeixen pel canvi Doppler de manera que seran escoltades a la Lluna amb la freqüència de desplaçament.</p><p>Si l'equip no accepta comandes CAT QSY mentre es transmet, només s'aplicarà una sola correcció durant tot el període de transmissió.</p><p>Fes servir aquesta opció també per al mode eco.</p></body></html> - + Constant frequency on Moon Freqüència constant a la Lluna - + <html><head/><body><p>DX station announces their TX Freq, which is entered as the Sked Freq. Correction applied to RX and TX so you appear on the DX's station's own echo Freq.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>L'estació DX anuncia la seva freqüència de TX, que s'introdueix com a Sked Freq. La correcció aplicada a RX i TX per tal que aparegui al propi eco Freq de l'estació del DX.</p><p>Si l'equip no accepta comandes CAT QSY mentre es transmet, només s'aplicarà una sola correcció durant tot el període de transmissió.</p></body></html> - + On DX Echo Encès DX Eco - + <html><head/><body><p>Tune radio manually and select this mode to put your echo on the same frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>Sintonitza l'equip manualment i selecciona aquest mode per posar el teu eco a la mateixa freqüència.</p><p>Si l'equip no accepta comandes CAT QSY mentre es transmet, només s'aplicarà una sola correcció durant tot el període de transmissió.</p></body></html> - + Call DX Indicatiu de DX - + <html><head/><body><p>No Doppler shift correction is applied. This may be used when the QSO partner does full Doppler correction to your grid square.</p></body></html> <html><head/><body><p>No s'aplica cap correcció de desplaçament Doppler. Això es pot utilitzar quan l'altra corresponsal de QSO fa la correcció completa del Doppler al teu Locator.</p></body></html> - + None Cap - + Sked frequency Freqüència Sked - - + + 0 0 - + + kHz + + + + + Set kHz + + + + + <html><head/><body><p>Tx shift relative to Rx sked frequency</p></body></html> + + + + + MHz + + + + + Tx Shift + + + + Rx: RX: - + Tx: TX: - <html><head/><body><p>Press and hold the CTRL key to adjust the sked frequency manually with the rig's VFO dial or enter frequency directly into the band entry field on the main window.</p></body></html> - <html><head/><body><p>Manten premuda la tecla CTRL per ajustar la freqüència de desplaçament manualment amb el dial VFO del equip o introdueix la freqüència directament al camp d’entrada de banda de la finestra principal.</p></body></html> + <html><head/><body><p>Manten premuda la tecla CTRL per ajustar la freqüència de desplaçament manualment amb el dial VFO del equip o introdueix la freqüència directament al camp d’entrada de banda de la finestra principal.</p></body></html> - + Echo Mode - + Hz Hz - + RIT - - Dither - - - - - Tx Shift relative to Rx Sked Freq - - - - - Enter large offset - - - - - MHz + + Enable - - Shift + + Dither - - Enable + + Ctl-Lock Sked Freq - + Astro Data Dades Astro - + Astronomical Data Dades astronòmiques @@ -415,6 +423,166 @@ Indicatiu + + Cloudlog + + + + QSO could not be sent to Cloudlog. + + + + + + QSO upload was rejected by Cloudlog. + + + + + HTTP status %1. Response was not JSON. + + + + + Cloudlog returned an unexpected upload response. + + + + + Cloudlog reported upload status: %1 + + + + + HTTP status %1. + + + + + Cloudlog::impl + + + Enter a Cloudlog or Wavelog URL. + + + + + The connection check needs a base URL before it can contact the API. + + + + + Cloudlog or Wavelog authentication endpoint was not found. + + + + + Tried /api/check_auth, /index.php/api/check_auth, and /index.php/api/auth. + + + + + API key is valid but read-only. + + + + + Generate a read/write API key before enabling QSO uploads. + + + + + API key is invalid. + + + + + Authentication response was not usable. + + + + + Station profile response was not JSON. + + + + + Configured station profile was not found. + + + + + No station profiles were returned by the server. + + + + + Available station profiles: %1 + + + + + Wavelog dry-run QSO endpoint was not found. + + + + + Tried /api/qso/true and /index.php/api/qso/true after Wavelog was identified. + + + + + Dry-run upload response was not usable. + + + + + + Connection check passed. + + + + + Writable API key, station profile, and dry-run QSO upload were validated. + + + + + Dry-run QSO upload was rejected. + + + + + + The QSO dry-run upload was rejected. + + + + + Dry-run QSO upload returned an unexpected response. + + + + + Writable API key and station profile were validated. No safe dry-run QSO endpoint was identified, so no test QSO was uploaded. + + + + + Network error while checking Cloudlog or Wavelog. + + + + + Cloudlog Error! + + + + + Reason: %1 + + + ColorHighlighting @@ -521,358 +689,581 @@ Configuration::impl - - - + + + &Delete &Esborrar - - + + &Insert ... &Insereix ... - - Failed to create save directory - No s'ha pogut crear el directori per desar + + Wanted territory %1 + - - path: "%1% - ruta: "%1% + + Blacklist keyword %1 + - - Failed to create samples directory - No s'ha pogut crear el directori d'exemples + + Whitelist keyword %1 + - - path: "%1" - ruta: "%1" + + Always pass keyword %1 + - - API key OK + + CAT control port - - API key read-only + + CAT baud rate - - API key invalid + + Default CAT data bits - - &Load ... - &Carrega ... + + Seven CAT data bits + - - &Save as ... - &Guardar com ... + + Eight CAT data bits + - - &Merge ... - &Combinar ... + + Default CAT stop bits + - - &Reset - &Restablir + + One CAT stop bit + - - Serial Port: - Port sèrie: + + Two CAT stop bits + - - Serial port used for CAT control - Port sèrie utilitzat per al control CAT + + Default CAT handshake + - - TCI Server: + + No CAT handshake - - Optional hostname and port of TCI service. -Leave blank for a sensible default on this machine. -Formats: - hostname:port - IPv4-address:port - [IPv6-address]:port + + XON/XOFF CAT handshake - - Network Server: - Servidor de xarxa: + + Hardware CAT handshake + - - Optional hostname and port of network service. -Leave blank for a sensible default on this machine. -Formats: - hostname:port - IPv4-address:port - [IPv6-address]:port - Hostname opcional i port d'accés del servei de xarxa. -Deixa-ho en blanc per a un valor predeterminat raonable en aquesta màquina. -Formats: - hostname:port - adreça IPv4:port - [adreça IPv6]:port + + Force DTR control line + - - USB Device: - Dispositiu USB: + + Force RTS control line + - - Optional device identification. -Leave blank for a sensible default for the rig. -Format: - [VID[:PID[:VENDOR[:PRODUCT]]]] - Identificació opcional del dispositiu. -Deixa en blanc un valor predeterminat raonable per a l'equip. -Format: - [VID[:PID[:VENDOR[:PRODUCT]]]] + + VOX PTT method + - - - Invalid audio input device - El dispositiu d'entrada d'àudio no és vàlid + + DTR PTT method + - - Invalid audio output device - El dispositiu de sortida d'àudio no és vàlid + + CAT PTT method + - - Invalid PTT method - El mètode de PTT no és vàlid + + RTS PTT method + - - Invalid PTT port - El port del PTT no és vàlid + + PTT control port + - - - Invalid Contest Exchange - Intercanvi de concurs no vàlid + + Rear or data transmit audio source + - - You must input a valid ARRL Field Day exchange - Has d’introduir un intercanvi de Field Day de l'ARRL vàlid + + Front or mic transmit audio source + - - You must input a valid ARRL RTTY Roundup exchange - Has d’introduir un intercanvi vàlid de l'ARRL RTTY Roundup + + No radio mode control + - - Pending DNS lookup, please try again later - Pendent de cerca de DNS, torna-ho a provar més tard + + USB radio mode + - - - Reset Decode Highlighting - Restableix Ressaltat de Descodificació + + Data or packet radio mode + - - - Reset all decode highlighting and priorities to default values - Restableix tot el ressaltat i les prioritats de descodificació als valors predeterminats + + No split operation + - - Error Loading CTY.DAT + + Rig split operation - - Error Loading CALL3.TXT file + + Fake It split operation - - WSJT-X Decoded Text Font Chooser - Tipus de text de pantalla de descodificació WSJT-X + + CAT poll interval + - - - Hamlib update only available on Windows. + + Frequency calibration slope - - Error Loading libhamlib-4.dll + + Frequency calibration intercept - - Hamlib Update successful - -New Hamlib will be used after restart + + Working frequencies table - - Hamlib successfully reverted - -Reverted Hamlib will be used after restart + + Station information table - - No Hamlib update found that could be reverted + + Decode highlighting rules - - Error in network address + + Highlighting rules and priorities for decoded messages. - - UDP server DNS lookup failed - Ha fallat la cerca de DNS del servidor UDP + + Decode highlighting actions + - - MAC-ambiguous multicast groups addresses not supported - No s'admeten adreces de grups de multidifusió MAC ambigües + + Change or reset colors for the selected highlighting rule. + - - Load Working Frequencies - Càrrega les freqüències de treball + + Move selected highlighting rule up + - - - - Frequency files (*.qrg *.qrg.json);;All files (*.*) + + Move the selected highlighting rule earlier in priority order. - Frequency files (*.qrg);;All files (*.*) - Arxius de freqüència (*.qrg);;Tots els arxius (*.*) + + Move selected highlighting rule down + - - Replace Working Frequencies - Substitueix les freqüències de treball + + Move the selected highlighting rule later in priority order. + - - Are you sure you want to discard your current working frequencies and replace them with the loaded ones? - Segur que vols descartar les teves freqüències actuals de treball i reemplaçar-les per les carregades ? + + Orange highlight callsigns and grids + - - Merge Working Frequencies - Combina les freqüències de treball + + Blue highlight callsigns and grids + - - Error reading frequency file + + Failed to create save directory + No s'ha pogut crear el directori per desar + + + + path: "%1% + ruta: "%1% + + + + Failed to create samples directory + No s'ha pogut crear el directori d'exemples + + + + path: "%1" + ruta: "%1" + + + + Reset all decode highlighting and priorities to Default 1 values + + + + + Reset all decode highlighting and priorities to Default 2 values + + + + + &Load ... + &Carrega ... + + + + &Save as ... + &Guardar com ... + + + + &Merge ... + &Combinar ... + + + + &Reset + &Restablir + + + + Serial Port: + Port sèrie: + + + + Serial port used for CAT control + Port sèrie utilitzat per al control CAT + + + + TCI Server: + + + + + Optional hostname and port of TCI service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port + + + + + Network Server: + Servidor de xarxa: + + + + Optional hostname and port of network service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port + Hostname opcional i port d'accés del servei de xarxa. +Deixa-ho en blanc per a un valor predeterminat raonable en aquesta màquina. +Formats: + hostname:port + adreça IPv4:port + [adreça IPv6]:port + + + + USB Device: + Dispositiu USB: + + + + Optional device identification. +Leave blank for a sensible default for the rig. +Format: + [VID[:PID[:VENDOR[:PRODUCT]]]] + Identificació opcional del dispositiu. +Deixa en blanc un valor predeterminat raonable per a l'equip. +Format: + [VID[:PID[:VENDOR[:PRODUCT]]]] + + + + + Invalid audio input device + El dispositiu d'entrada d'àudio no és vàlid + + + + Invalid audio output device + El dispositiu de sortida d'àudio no és vàlid + + + + Invalid PTT method + El mètode de PTT no és vàlid + + + + Invalid PTT port + El port del PTT no és vàlid + + + + + Invalid Contest Exchange + Intercanvi de concurs no vàlid + + + + You must input a valid ARRL Field Day exchange + Has d’introduir un intercanvi de Field Day de l'ARRL vàlid + + + + You must input a valid ARRL RTTY Roundup exchange + Has d’introduir un intercanvi vàlid de l'ARRL RTTY Roundup + + + + Pending DNS lookup, please try again later + Pendent de cerca de DNS, torna-ho a provar més tard + + + + + Reset Decode Highlighting + Restableix Ressaltat de Descodificació + + + Reset all decode highlighting and priorities to default values + Restableix tot el ressaltat i les prioritats de descodificació als valors predeterminats + + + + Error Loading CTY.DAT + + + + + Error Loading CALL3.TXT file + + + + + WSJT-X Decoded Text Font Chooser + Tipus de text de pantalla de descodificació WSJT-X + + + + + Hamlib update only available on Windows. + + + + + Error Loading libhamlib-4.dll + + + + + Hamlib Update successful + +New Hamlib will be used after restart + + + + + Hamlib successfully reverted + +Reverted Hamlib will be used after restart + + + + + No Hamlib update found that could be reverted + + + + + Error in network address + + + + + UDP server DNS lookup failed + Ha fallat la cerca de DNS del servidor UDP + + + + MAC-ambiguous multicast groups addresses not supported + No s'admeten adreces de grups de multidifusió MAC ambigües + + + + Load Working Frequencies + Càrrega les freqüències de treball + + + + + + Frequency files (*.qrg *.qrg.json);;All files (*.*) + + + + Frequency files (*.qrg);;All files (*.*) + Arxius de freqüència (*.qrg);;Tots els arxius (*.*) + + + + Replace Working Frequencies + Substitueix les freqüències de treball + + + + Are you sure you want to discard your current working frequencies and replace them with the loaded ones? + Segur que vols descartar les teves freqüències actuals de treball i reemplaçar-les per les carregades ? + + + + Merge Working Frequencies + Combina les freqüències de treball + + + + Error reading frequency file - - - + + + Not a valid frequencies file L'arxiu de freqüències no és vàlid - + Incorrect file magic L'arxiu màgic es incorrecte - + Version is too new La versió és massa nova - + Contents corrupt Continguts corruptes - + Save Working Frequencies Desa les freqüències de treball - + Only Save Selected Working Frequencies Desa només les freqüències de treball seleccionades - + Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. Estàs segur que vols desar només les freqüències de treball seleccionades actualment? Fes clic a No per desar-ho tot. - + Reset Working Frequencies Restablir les freqüències de treball - + Are you sure you want to discard your current working frequencies and replace them with default ones? Segur que vols descartar les teves freqüències actuals de treball i reemplaçar-les per altres? - + Save Directory Directori de Guardar - + AzEl Directory Directori AzEl - + Rig control error Error de control de l'equip - + Failed to open connection to rig No s'ha pogut obrir la connexió al equip - + Rig failure Fallada en l'equip - + Not found audio device missing falta un dispositiu d'àudio @@ -984,32 +1375,32 @@ or contact DXLab support at DXLab@groups.io. &Color del primer pla ... - + Choose %1 Foreground Color Tria %1 el color del primer pla - + &Unset foreground color &Desactivar el color del primer pla - + &Background color ... &Color de fons ... - + Choose %1 Background Color Tria %1 un color de fons - + U&nset background color E&limina el color de fons - + &Reset this item to defaults &Restableix aquest element per defecte @@ -1097,17 +1488,17 @@ or contact DXLab support at DXLab@groups.io. Usuari LoTW - + f/g unset f/g desestablert - + b/g unset b/g desestablert - + Highlight Type Tipus de relleu @@ -1115,41 +1506,56 @@ or contact DXLab support at DXLab@groups.io. Designer - + &Delete &Esborrar - + &Insert ... &Insereix ... - + Insert &after ... Insereix &després ... - + Import Palette Importa la paleta - - + + Palettes (*.pal) Paletes (*.pal) + Import Palette Failed + + + + Export Palette Exporta la paleta + + + Export Palette Failed + + + + + Error writing waterfall palette file "%1": %2. + Error d'escriptura de l'arxiu de paleta de la cascada "%1": %2. + Dialog - + Gray time: Temps gris: @@ -1252,16 +1658,31 @@ Error: %2 - %3 DisplayText - + &Erase &Esborrar + + + Return to live activity + + + + + Return to the live activity position + + + + + Live activity is paused while earlier entries are visible. + + EchoGraph - + Echo Graph Gràfic eco @@ -1334,7 +1755,7 @@ Error: %2 - %3 EmulateSplitTransceiver - + Emulated split mode requires rig to be in simplex mode El mode de SPLIT requereix que l'equip estigui en mode simplex @@ -1421,12 +1842,12 @@ Error: %2 - %3 ExistingNameDialog - + Configuration to Clone From Configuració per clonar des de - + &Source Configuration Name: &Nom de la configuració de la font: @@ -1564,7 +1985,7 @@ Error: %2 - %3 FastGraph - + Fast Graph Gràfic ràpid @@ -1619,48 +2040,199 @@ Error: %2 - %3 - FoxLog::impl + FixtureAudioInput - - Date & Time(UTC) - Data i Hora en UTC + + Synthetic audio input has no detector sink. + - - Call - Indicatiu + + Synthetic FT8 audio input requires a downsample factor of 1 or 4. + - - Grid - Locator + + Synthetic JTTY audio input requires a downsample factor of 1 or 4. + - - Sent - Enviat + + Synthetic audio input requires the mono input channel. + - - Rcvd - Rebut + + Unable to open synthetic audio fixture %1: %2 + - - Band - Banda + + Synthetic audio fixture must be mono, signed 16-bit little-endian PCM. + - - - FoxLogWindow - - Fox Log - Log Fox + + Synthetic audio fixture must be %1 Hz for downsample factor %2; found %3 Hz. + - - <html><head/><body><p>Right-click here for available actions.</p></body></html> + + Synthetic FT8 audio fixture must contain exactly %1 frames; found %2. + + + + + Synthetic JTTY audio fixture must contain complete PCM frames. + + + + + Unable to read all PCM data from synthetic audio fixture. + + + + + Synthetic audio input does not yet support big-endian hosts. + + + + + Unable to initialize the detector for synthetic audio input. + + + + + Synthetic audio fixture ready + + + + + Synthetic audio input suspended + + + + + Synthetic audio input receiving + + + + + Detector accepted %1 of %2 synthetic PCM bytes. + + + + + Synthetic audio fixture exhausted + + + + + FixtureSoundOutput + + + Synthetic audio output requires a readable source. + + + + + Synthetic audio output requires a capture path. + + + + + Synthetic audio output does not yet support big-endian hosts. + + + + + Synthetic audio output received an unsupported source frame size. + + + + + Unable to open synthetic audio output capture %1: %2 + + + + + Synthetic audio output received a partial captured frame. + + + + + Synthetic FT8 audio output exceeded its 15-second capture period. + + + + + Synthetic audio output wrote %1 of %2 capture bytes: %3 + + + + + Synthetic audio output source disappeared during capture. + + + + + Synthetic FT8 audio output continued beyond its 15-second capture period. + + + + + Synthetic audio output received %1 of %2 source bytes. + + + + + Synthetic audio output received an invalid source byte count. + + + + + FoxLog::impl + + + Date & Time(UTC) + Data i Hora en UTC + + + + Call + Indicatiu + + + + Grid + Locator + + + + Sent + Enviat + + + + Rcvd + Rebut + + + + Band + Banda + + + + FoxLogWindow + + + Fox Log + Log Fox + + + + <html><head/><body><p>Right-click here for available actions.</p></body></html> <html><head/><body><p>Fes clic amb el botó dret per a les accions disponibles.</p></body></html> @@ -1731,69 +2303,101 @@ Error: %2 - %3 Estàs segur que vols esborrar l'arxiu FoxQSO.txt i començar un log nou de FOX ? + + FrequencyDeltaLineEdit + + + Offset in MHz + + + + + Frequency offset in MHz + + + + + Enter a frequency offset in MHz. + + + FrequencyDialog - + Add Frequency Afedueix Freqüència - + IARU &Region: Regió &IARU: - + &Mode: &Mode: - + &Frequency (MHz): &Freqüència en MHz.: - + &Preferred for Band/Mode: - + &Description: - + &Enable Date Range: - + S&tart: - + &End: - + &Source: - + Invalid Date Range - + Start date must be before end date + + FrequencyLineEdit + + + + Frequency in MHz + + + + + Enter a positive frequency in MHz. + + + FrequencyList_v2_100 @@ -1817,37 +2421,37 @@ Error: %2 - %3 FrequencyList_v2_101 - + IARU Region Regió IARU - + Mode Mode - + Frequency Freqüència - + Frequency (MHz) Freqüència en MHz - + Description - + Source @@ -1863,129 +2467,241 @@ Error: %2 - %3 - + Pref - + Start Date/Time - + End Date/Time - + Failed to parse JSON file - + Information Missing - + No Frequencies were found - + Loaded Frequencies from %1 - + Entries Valid/Skipped %1 + + Ft8TxLoopbackTestController + + + Timed out after 60 seconds. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + The FT8 output stream did not start exactly once. + + + + + The FT8 Auto control was not found. + + + + + Disabling Auto stopped the active FT8 transmission. + + + + + Synthetic output reported non-silent FT8 audio more than once. + + + + + The FT8 capture did not stop exactly once at the requested path. + + + + + Synthetic audio output failed: %1 + + + + + A required FT8 transmit GUI control was not found. + + + + + The application did not enter FT8 mode. + + + + + Unable to configure the requested FT8 transmission. + + + + + The FT8 transmit controls disappeared before transmission. + + + + + Unable to start the synthetic FT8 transmission. + + + + + The FT8 Auto control disappeared before retry. + + + + + The FT8 output lifecycle was not one start, non-silent transmission, and natural stop. + + + + + FT8 audio began at frame %1; expected %2 +/- %3 frames. + + + + + The FT8 capture file was not created or is empty: %1 + + + + + Unable to reopen FT8 capture %1: %2 + + + + + The FT8 capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The FT8 capture must contain exactly %1 frames; file=%2 reported=%3. + + + + + Unexpected modal window: %1 + + + HRDTransceiver - - + + Failed to connect to Ham Radio Deluxe No s'ha pogut connectar amb el Ham Radio Deluxe - + Failed to open file "%1": %2. Error a l'obrir l'arxiu "%1": %2. - - + + Ham Radio Deluxe: no rig found Ham Radio Deluxe: no s'ha trobat cap equip - + Ham Radio Deluxe: rig doesn't support mode Ham Radio Deluxe: l'equip no admet el mode - + Ham Radio Deluxe: sent an unrecognised mode Ham Radio Deluxe: ha enviat un mode desconegut - + Ham Radio Deluxe: item not found in %1 dropdown list Ham Radio Deluxe: element no trobat %1 a la llista desplegable - + Ham Radio Deluxe: button not available Ham Radio Deluxe: botó no disponible - + Ham Radio Deluxe didn't respond as expected La resposta del Ham Radio Deluxe no és l'esperada - + Ham Radio Deluxe: rig has disappeared or changed Ham Radio Deluxe: l'equip ha desaparegut o s'ha modificat - + Ham Radio Deluxe send command "%1" failed %2 La instrucció %1 del Ham Radio Deluxe ha fallat %2 - - + + Ham Radio Deluxe: failed to write command "%1" Ham Radio Deluxe: error a l'escriure la instrucció "%1" - + + Ham Radio Deluxe sent an invalid reply to our command "%1": %2 + + + Ham Radio Deluxe sent an invalid reply to our command "%1" - La resposta del Ham Radio Deluxe no és vàlida per a la instrucció "%1" + La resposta del Ham Radio Deluxe no és vàlida per a la instrucció "%1" - + Ham Radio Deluxe failed to reply to command "%1" %2 Fallada a la resposta del Ham Radio Deluxe a la instrucció "%1" %2 - + Ham Radio Deluxe retries exhausted sending command "%1" El Ham Radio Deluxe ha esgotat els reintents de la instrucció "%1" - + Ham Radio Deluxe didn't respond to command "%1" as expected La resposta del Ham Radio Deluxe a la instrucció "%1" no és l'esperada @@ -1993,186 +2709,182 @@ Error: %2 - %3 HamlibTransceiver - - + + Hamlib initialisation error Error d'inicialització de Hamlib - + Hamlib settings file error: %1 at character offset %2 Error de l'arxiu de configuració de Hamlib: %1 en el desplaçament de caràcters %2 - + Hamlib settings file error: top level must be a JSON object Error de l'arxiu de configuració de Hamlib: el nivell superior ha de ser un objecte JSON - + Hamlib settings file error: config must be a JSON object Error de l'arxiu de configuració de Hamlib: config ha de ser un objecte JSON - + Unsupported CAT type Tipus CAT no admès - + Hamlib error: %1 while %2 Error de Hamlib: %1 mentre %2 - + opening connection to rig connexió d'obertura a l'equip - + getting current frequency obtenir la freqüència actual - + getting current mode obtenir el mode actual - - + + exchanging VFOs intercanviant VFOs - - + + getting other VFO frequency obtenint una altra freqüència de VFO - + getting other VFO mode obtenint un altre mode VFO - - + + setting current VFO ajustar el VFO actual - + getting frequency obtenint la freqüència - + getting mode obtenint el mode - - - + + + getting current VFO obtenir VFO actual - - - - + + + + getting current VFO frequency obtenir la freqüència actual del VFO - - - - - - + + + + + + setting frequency ajust de freqüència - - - - + + + + getting current VFO mode obtenir el mode VFO actual - - - - - + + + + + setting current VFO mode ajust del mode VFO actual - - setting VFOB mode - - - - - + + setting/unsetting split mode ajustar/desajustar mode dividid (split) - - + + setting split mode ajustar mode dividid (Split) - + setting split TX frequency and mode ajust de freqüència i mode de transmissió dividida (Split) - + setting split TX frequency ajust de freqüència dividida (Split) en TX - + getting split TX VFO mode obtenir el mode dividit (Split) en TX del VFO - + setting split TX VFO mode ajustar del mode dividid (Split) en TX del VFO - + getting PTT state obtenir l'estat del PTT - + setting PTT on activant el PTT - - + + setting PTT off desactivant el PTT - + setting a configuration item establir un element de configuració - + + getting a configuration item obtenir un element de configuració @@ -2207,47 +2919,363 @@ Error: %2 - %3 - LogQSO + JttyTxLoopbackTestController - - Click OK to confirm the following QSO: - Clica Acceptar per confirmar el següent QSO: + + Timed out after 60 seconds. + - - Call - Indicatiu + + JTTY request %1 was accepted more than once. + - - Start - Inici + + JTTY request %1 was rejected with reason %2. + - - - dd/MM/yyyy HH:mm:ss - dd/MM/aaaa HH:mm:ss + + JTTY request %1 completed more than once. + - - End - Final + + More than one JTTY transmit session drained. + - - Mode - Mode + + Synthetic output opened the wrong capture path: %1 + - - Band - Banda + + JTTY output stream restarted more than once. + - - Rpt Sent - Senyal Env + + Synthetic output reported non-silent playback more than once. + + + + + Synthetic output stopped the wrong capture path: %1 + + + + + JTTY output stream stopped more than once. + + + + + Synthetic audio output failed: %1 + + + + + The JTTY mode action was not found. + + + + + The application did not enter JTTY mode. + + + + + The JTTY encoder did not produce a valid test waveform extent. + + + + + The first JTTY text request was not accepted synchronously. + + + + + Non-silent playback began before the first request was accepted. + + + + + The output stream restarted or stopped before the gapless append. + + + + + The gapless append occurred before one second of real playback. + + + + + The second JTTY text request was not accepted during playback. + + + + + Appending the second JTTY message restarted or stopped playback. + + + + + The accepted-request set did not contain exactly both submitted messages. + + + + + JTTY text requests were not accepted in submission order. + + + + + The completed-request set did not contain exactly both submitted messages. + + + + + JTTY text requests did not complete in FIFO order. + + + + + The output stream lifecycle was not one start, one drain, and one stop. + + + + + The captured JTTY session contains an unexpected internal audio gap. + + + + + The JTTY capture file was not created or is empty: %1 + + + + + Unable to reopen JTTY capture %1: %2 + + + + + The JTTY capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The JTTY capture has an invalid PCM extent: file frames=%1, expected audio frames=%2, reported frames=%3. + + + + + Unexpected modal window: %1 + + + + + LiveAudioTestController + + + Timed out after 110 seconds. + + + + + Timed out after 100 seconds. + + + + + Decoder backend failed: %1 + + + + + JTTY display did not settle to the expected text after input ended. + + + + + Synthetic audio source failed: %1 + + + + + Unable to open expected decode file %1: %2 + + + + + Expected decode file %1 contains no messages. + + + + + Unable to open expected JTTY text file %1: %2 + + + + + Expected JTTY text file %1 contains no messages. + + + + + A required FT8 decoder or monitoring GUI control was not found. + + + + + Unable to configure the %1-%2 Hz waterfall decode range. + + + + + Unable to prepare the complete FT8 fixture decode. + + + + + Unable to configure the FT8 multithreaded decoder as requested. + + + + + Monitor did not enter the active state. + + + + + Synthetic input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic audio source. + + + + + A required JTTY mode, monitoring, or decode display control was not found. + + + + + The JTTY GUI action did not select JTTY mode. + + + + + Monitor did not enter the active state for JTTY. + + + + + Synthetic JTTY input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic JTTY audio source. + + + + + The expected early standard and final configured MTD decoder invocations were not both observed. + + + + + The configured MTD invocation produced no decoder output. + + + + + live MTD missing: %1 + + + + + processed missing: %1 + + + + + display missing: %1 + + + + + Reference-message validation failed: %1; live MTD output: %2; processed output: %3 + + + + + Decoder messages were processed but none reached the GUI display path. + + + + + The expected JTTY messages did not reach both panes in FIFO order. + + + + + The expected JTTY message reached both panes without an observed growing prefix. + + + + + Unexpected modal window: %1 + + + + + LogQSO + + + Click OK to confirm the following QSO: + Clica Acceptar per confirmar el següent QSO: + + + + Call + Indicatiu + + + + Start + Inici + + + + + dd/MM/yyyy HH:mm:ss + dd/MM/aaaa HH:mm:ss + + + + End + Final + + + + Mode + Mode + + + + Band + Banda + + + + Rpt Sent + Senyal Env @@ -2325,188 +3353,188 @@ Error: %2 - %3 - + Aircraft scatter Aircraft scatter - + Aurora-E Aurora-E - + Aurora Aurora - + Back scatter Back scatter - + Echolink Echolink - + Earth-moon-earth Terra-Lluna-Terra - + Sporadic E Esporàdica - + F2 Reflection Reflexió F2 - + Field aligned irregularities Irregularitats alineades al camp - + Internet-assisted Assistit per Internet - + Ionoscatter Ionoscatter - + IRLP IRLP - + Meteor scatter Meteor scatter - + Non-satellite repeater or transponder Repetidor o transpondedor no satèl·lit - + Rain scatter Rain scatter - + Tropospheric ducting - + A - + B - + BS - + JA - + JD - + K - + KA - + KT - + L - + LS - + LU - + LX - + S - + SX - + T - + US - + UV - + VS - + VU - + Satellite Satèl·lit - + Trans-equatorial Trans-equatorial @@ -2515,33 +3543,33 @@ Error: %2 - %3 Tropo - - + + Invalid QSO Data Les dades de QSO no són vàlides - + Check exchange sent and received Comprovació de l’intercanvi enviat i rebut - + Check all fields Comprova tots els camps - + Log file error Error a l'arxiu de log - + Cannot open "%1" for append No es pot obrir "%1" per afegir - + Error: %1 Error: %1 @@ -2592,62 +3620,61 @@ Error(%2): %3 MainWindow - WSJT-X by K1JT - WSJT-X de K1JT - - - - - - - - - - - + WSJT-X de K1JT + + + + + + + + + + + Band Activity Activitat a la banda - - + + UTC dB DT Freq Dr UTC dB DH Freq Dr - - - - - - - + + + + + + + Rx Frequency Freqüència de RX - + CQ only només CQ - + Enter this QSO in log Introdueix aquest QSO al log - + Log &QSO Log &QSO - + Stop monitoring Atura la monitorització - + &Stop &Aturar @@ -2656,77 +3683,77 @@ Error(%2): %3 Activació / desactivació del control de monitorització - + &Monitor &Monitor - + <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> <html><head/><body><p>Esborra la finestra dreta, fes doble clic per esborrar les dues finestres.</p></body></html> - + Erase right window. Double-click to erase both windows. Esborra la finestra dreta, fes doble clic per esborrar les dues finestres. - + &Erase &Esborrar - + <html><head/><body><p>Clear the accumulating message average.</p></body></html> <html><head/><body><p>Neteja la mitjana de missatges acumulats.</p></body></html> - + Clear the accumulating message average. Neteja la mitjana de missatges acumulats. - + Clear Avg Esborra mitjana - + <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> <html><head/><body><p>Descodificar el període de RX més recent en la freqüència de QSO</p></body></html> - + Decode most recent Rx period at QSO Frequency Descodificar el període de RX més recent en la freqüència de QSO - + &Decode &Descodificar - + <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> <html><head/><body><p>Activar/Desactivar TX</p></body></html> - + Toggle Auto-Tx On/Off Activar/Desactivar TX - + E&nable Tx A&ctivar TX - + Stop transmitting immediately Deixa de transmetre immediatament - + &Halt Tx Aturar &TX @@ -2735,87 +3762,89 @@ Error(%2): %3 <html><head/><body><p>Activa/Desactiva el to de TX pur per a sintonització</p></body></html> - + Toggle a pure Tx tone On/Off Activa/Desactiva el to TX pur per a sintonització - + &Tune &Sintonitzar - + + Menus Menús - + Decode other Hounds calling above 1000 Hz audio offset Descodifica altres Hounds cridant per sobre de 1000 Hz de compensació d'àudio - + Enable auto response to the first decode from a new DXCC or new call on the current band. Habilita la resposta automàtica a la primera descodificació d'un nou DXCC o d'una nova crida a la banda actual. - + Maximum drift rate in units of symbol rate per transmission. Taxa de deriva màxima en unitats de taxa de símbols per transmissió. - + Max Drift Deriva màxima - + Percentage of minute sequences devoted to transmitting. Percentatge de seqüències de minuts dedicades a transmetre. - + Prefer Type 1 messages Preferiu els missatges de tipus 1 - + <html><head/><body><p>Transmit during the next sequence.</p></body></html> <html><head/><body><p>Transmetre durant la següent seqüència.</p></body></html> - + Quick-Start Guide to Q65 Guia d'inici ràpid de Q65 - + Auto Clear Avg after decode Esborra la mitjana automàticament després de la descodificació - + + USB dial frequency freqüència de dial USB - + 14.078 000 14.078 000 - + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> <html><head/><body><p>30dB recomanat quan només hi ha soroll,<br/>en Verd és un bon nivell,<br/>en Vermell és poden produir retalls, i<br/>en Groc quan és massa baix.</p></body></html> - + Rx Signal Senyal de RX - + 30dB recommended when only noise present Green when good Red when clipping may occur @@ -2826,17 +3855,17 @@ en Vermell és poden produir retalls i en Groc quan és massa baix - + DX Call Indicatiu DX - + DX Grid Locator DX - + Callsign of station to be worked Indiatiu de l'estació per ser treballada @@ -2845,17 +3874,17 @@ en Groc quan és massa baix Buscar el indicatiu a la base de dades - + &Lookup &Cercar - + Locator of station to be worked Locator de l'estació a treballar - + Az: 251 16553 km Az: 251 16553 km @@ -2864,7 +3893,7 @@ en Groc quan és massa baix Afegir indicatiu i locator a la base de dades - + Add Afegir @@ -2873,172 +3902,184 @@ en Groc quan és massa baix Potència - + <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> <html><head/><body><p>Si hi ha hagut un error en el control de l'equip, fes clic per restablir i llegir la freqüència del dial. S implica mode dividit o split.</p></body></html> - + If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. Si hi ha hagut un error en el control de l'equip, fes clic per restablir i llegir la freqüència del dial. S implica mode dividit o split. - + ? ? - + Adjust Tx audio level Ajust del nivell d'àudio de TX - + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> <html><head/><body><p>Selecciona la banda operativa, introdueix la freqüència en MHz o introdueix un increment de kHz seguit de k.</p></body></html> - + Frequency entry Freqüència d'entrada - + Select operating band or enter frequency in MHz or enter kHz increment followed by k. Selecciona la banda operativa, introdueix la freqüència en MHz o introdueix un increment de kHz seguit de k. - + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> - + <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> <html><head/><body><p>Marca per que es mantingui la freqüència de TX fixada quan facis doble clic sobre un text descodificat.</p></body></html> - + Check to keep Tx frequency fixed when double-clicking on decoded text. Marca per que es mantingui la freqüència de TX fixada quan facis doble clic sobre un text descodificat. - + Hold Tx Freq Manté TX Freq - + + Audio Rx frequency Freqüència d'Àudio en RX - - - - - - + + + + + + + + Hz Hz - - + + + Rx RX - - + + + + Set Tx frequency to Rx Frequency Estableix la freqüència de RX en la de TX - + + ▲ ▲ - + + Frequency tolerance (Hz) Freqüència de Tolerància (Hz) - - + + + F Tol F Tol - - + + + + Set Rx frequency to Tx Frequency Estableix la freqüència de TX en la de RX - + + ▼ ▼ - + <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> <html><head/><body><p>Sincronització del llindar. Els nombres més baixos accepten senyals de sincronització més febles.</p></body></html> - + Synchronizing threshold. Lower numbers accept weaker sync signals. Sincronització del llindar. Els nombres més baixos accepten senyals de sincronització més febles. - + Sync Sinc - + <html><head/><body><p>Check to use short-format messages.</p></body></html> <html><head/><body><p>Marcar per utilitzar missatges de format curt.</p></body></html> - + Check to use short-format messages. Marcar per utilitzar missatges de format curt. - + Sh Sh - + <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> <html><head/><body><p>Comprova que actives els modes ràpids JT9</p></body></html> - + Check to enable JT9 fast modes Comprova que actives els modes ràpids JT9 - - + + Fast Ràpid - + <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> <html><head/><body><p>Activa la seqüència automàtica dels missatges de TX en funció dels missatges rebuts.</p></body></html> - + Check to enable automatic sequencing of Tx messages based on received messages. Activa la seqüència automàtica dels missatges de TX en funció dels missatges rebuts. - + Auto Seq Seqüència Automàtica @@ -3055,12 +4096,12 @@ en Groc quan és massa baix Contesta al primer CQ - + Check to generate "@1250 (SEND MSGS)" in Tx6. Marca per generar "@1250 (SEND MSGS)" a TX6. - + Tx6 TX6 @@ -3073,90 +4114,90 @@ en Groc quan és massa baix Marca a TX en minuts o seqüències de números parells, a partir de 0; desmarca les seqüències senars. - + Tx even/1st Alternar període TX Parell/Senar - + <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> <html><head/><body><p>Freqüència per cridar CQ en kHz per sobre dels MHz actuals</p></body></html> - + Frequency to call CQ on in kHz above the current MHz Freqüència per cridar CQ en kHz per sobre dels MHz actuals - + Tx CQ TX CQ - + <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> <html><head/><body><p>Marca això per trucar a CQ a la freqüència &quot;TX CQ&quot;. RX serà a la freqüència actual i el missatge CQ inclourà la freqüència de RX actual perquè els corresponsals sàpiguen a quina freqüència respondre.</p><p>No està disponible per als titulars de indicatiu no estàndard.</p></body></html> - + Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. Not available to nonstandard callsign holders. Marca això per trucar a CQ a la freqüència "TX CQ". RX serà a la freqüència actual i el missatge CQ inclourà la freqüència de RX actual perquè els corresponsals sàpiguen a quina freqüència respondre. No està disponible per als titulars de indicatiu no estàndard. - + Rx All Freqs RX a totes les freqüències - + <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> <html><head/><body><p>La submode determina l'espai entre tons; A és més estret.</p></body></html> - + Submode determines tone spacing; A is narrowest. La submode determina l'espai entre tons; A és més estret. - + Submode Submode - - + + Fox Fox - + <html><head/><body><p>Check to monitor Sh messages.</p></body></html> <html><head/><body><p>Marca per monitoritzar els missatges Sh.</p></body></html> - + Check to monitor Sh messages. Marca per monitoritzar els missatges Sh. - + SWL SWL - + Best S+P El millor S+P - + <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> <html><head/><body><p>Marca per començar a enregistrar dades de calibració.<br/>Mentre es mesura la correcció de calibratge, es desactiva.<br/>Si no està marcat, pots veure els resultats de la calibració.</p></body></html> - + Check this to start recording calibration data. While measuring calibration correction is disabled. When not checked you can view the calibration results. @@ -3165,226 +4206,224 @@ Mentre es mesura la correcció de calibratge, es desactiva. Si no està marcat, pots veure els resultats de la calibració. - + Measure Mesura - + <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> <html><head/><body><p>Informe de senyal: Relació senyal/soroll en amplada de banda de referència de 2500 Hz (dB).</p></body></html> - + Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). Informe de senyal: Relació senyal/soroll en amplada de banda de referència de 2500 Hz (dB). - + Report Informe de senyal - + <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> <html><head/><body><p>TX/RX o Longitud de la seqüència de calibratge de la freqüència</p></body></html> - + Tx/Rx or Frequency calibration sequence length TX/RX o Longitud de la seqüència de calibratge de la freqüència - - + + s s - - + + T/R T/R - + + Audio Tx frequency Freqüència d'àudio de TX - - + + + Tx TX - + Tx# TX# - + F High F Alt - + F Low F Baixa - - - + + + 1 1 - - - + + + Send this message in next Tx interval Envia aquest missatge al següent interval de TX - + Ctrl+2 Ctrl+2 - + <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> <html><head/><body><p>Envia aquest missatge al següent interval de TX.</p><p>Fes doble clic per canviar l’ús del missatge TX1 per iniciar un QSO amb una estació (no està permès per a titulars de indicatius compostos de tipus 1).</p></body></html> - + Send this message in next Tx interval Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) Envia aquest missatge al següent interval de TX. Fes doble clic per canviar l’ús del missatge TX1 per iniciar un QSO amb una estació (no està permès per a titulars de indicatius compostos de tipus 1) - + Ctrl+1 Ctrl+1 - - - - + + + + Switch to this Tx message NOW Canvia a aquest missatge de TX ARA - + Tx &2 TX &2 - + Alt+2 Alt+2 - + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> <html><head/><body><p>Canvia a aquest missatge de TX ARA.</p><p>Fes doble clic per canviar l’ús del missatge TX1 per iniciar un QSO amb una estació (no està permès per a titulars de indicatius compostos de tipus 1).</p></body></html> - + Switch to this Tx message NOW Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) Canvia a aquest missatge de TX ARA. Fes doble clic per canviar l’ús del missatge TX1 per iniciar un QSO amb una estació (no està permès per a titulars de indicatius compostos de tipus 1) - + Tx &1 TX &1 - + Alt+1 Alt+1 - + Ctrl+6 Ctrl+6 - + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> <html><head/><body><p>Envia aquest missatge al següent interval de TX.</p><p>Fes doble clic per restablir el missatge estàndard 73.</p></body></html> - + Send this message in next Tx interval Double-click to reset to the standard 73 message Envia aquest missatge al següent interval de TX. Fes doble clic per restablir el missatge estàndard 73 - + Ctrl+5 Ctrl+5 - + Ctrl+3 Ctrl+3 - + Tx &3 TX &3 - + Alt+3 Alt+3 - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>Envia aquest missatge al següent interval de TX.</p><p>Fes doble clic per alternar entre els missatges RRR i RR73 a TX4 (no està permès per a titulars d'indicatius compostos del tipus 2)</p><p>Els missatges RR73 només s’han d’utilitzar quan teniu una confiança raonable que no caldrà repetir cap missatge.</p></body></html> + <html><head/><body><p>Envia aquest missatge al següent interval de TX.</p><p>Fes doble clic per alternar entre els missatges RRR i RR73 a TX4 (no està permès per a titulars d'indicatius compostos del tipus 2)</p><p>Els missatges RR73 només s’han d’utilitzar quan teniu una confiança raonable que no caldrà repetir cap missatge.</p></body></html> - Send this message in next Tx interval Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - Envia aquest missatge al següent interval de TX. + Envia aquest missatge al següent interval de TX. Fes doble clic per alternar entre els missatges RRR i RR73 a TX4 (no està permès per a titulars d'indicatius compostos del tipus 2) Els missatges RR73 només s’han d’utilitzar quan teniu una confiança raonable que no caldrà repetir cap missatge - + Ctrl+4 Ctrl+4 - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>Canvia a aquest missatge de TX ARA.</p><p>Fes doble clic per alternar entre els missatges RRR i RR73 a TX4 (no està permès per a titulars d'indicatius compostos del tipus 2)</p><p>Els missatges RR73 només s’han d’utilitzar quan teniu una confiança raonable que no caldrà repetir cap missatge.</p></body></html> + <html><head/><body><p>Canvia a aquest missatge de TX ARA.</p><p>Fes doble clic per alternar entre els missatges RRR i RR73 a TX4 (no està permès per a titulars d'indicatius compostos del tipus 2)</p><p>Els missatges RR73 només s’han d’utilitzar quan teniu una confiança raonable que no caldrà repetir cap missatge.</p></body></html> - Switch to this Tx message NOW Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - Canvia a aquest missatge de TX ARA. + Canvia a aquest missatge de TX ARA. Fes doble clic per alternar entre els missatges RRR i RR73 a TX4 (no està permès per a titulars d'indicatius compostos del tipus 2) Els missatges RR73 només s’han d’utilitzar quan teniu una confiança raonable que no caldrà repetir cap missatge - + Tx &4 TX &4 - + Alt+4 Alt+4 @@ -3399,42 +4438,42 @@ Double-click to reset to the standard 73 message Fes doble clic per restablir el missatge estàndard 73 - + Tx &5 TX &5 - + Alt+5 Alt+5 - + Now Ara - + Generate standard messages for minimal QSO Genera missatges estàndard per a un QSO mínim - + Generate Std Msgs Generar Std Msgs - + Tx &6 TX &6 - + Alt+6 Alt+6 - + Enter a free text message (maximum 13 characters) or select a predefined macro from the dropdown list. Press ENTER to add the current text to the predefined @@ -3445,54 +4484,55 @@ Prem ENTER per afegir el text actual a la llista predefinida La llista es pot mantenir a la configuració (F2). - + Queue up the next Tx message Posa a la cua el següent missatge de TX - + Next Pròxim - - - - - - + + + + + + 2 2 - + FST4W FST4W - - + + Q65 Q65 - + SWL Mode Mode SWL - + Hide lower panel controls to maximize deocde windows Amaga els controls del panell inferior per a maximitzar les finestres de descodificació - - + + + CQ CQ - + Grid Locator @@ -3501,289 +4541,375 @@ La llista es pot mantenir a la configuració (F2). Màx dB - + CQ AF CQ AF - + CQ AN CQ AN - + CQ AS CA AS - + CQ EU CQ EU - + CQ NA CQ NA - + CQ OC CQ OC - + CQ SA CQ SA - + CQ 0 CQ 0 - + CQ 1 CQ 1 - + CQ 2 CQ 2 - + CQ 3 CQ 3 - + CQ 4 CQ 3 - + CQ 5 CQ 4 - + CQ 6 CQ 6 - + CQ 7 CQ 7 - + CQ 8 CQ 8 - + CQ 9 CQ 9 - + Reset Restablir - + N List N List - + N Slots N Slots - - - - - - - + + + + + + + Random a l’atzar - + Call Indicatiu - + S/N (dB) S/N (dB) - + Distance Distància - + More CQs Més CQ's - - + + % % - + Tx Pct TX Pct - + Band Hopping Salt de Banda - + Choose bands and times of day for band-hopping. Tria bandes i hores del dia per al salt de bandes. - + Schedule ... Programació ... - + 1/2 1/2 - + + WSJT-X by K1JT et al. + + + + + Band Activity decode pane title + + + + + Title for the Band Activity decoded messages pane. + + + + + Band Activity decoded messages headings + + + + + + Columns: UTC dB DT Freq Message. + + + + + Band Activity decoded messages + + + + + Decoded messages in the Band Activity pane. Columns: UTC dB DT Freq Message. + + + + + Rx Frequency decode pane title + + + + + Title for the Rx Frequency decoded messages pane. + + + + + Rx Frequency decoded messages headings + + + + + Rx Frequency decoded messages + + + + + Decoded messages in the Rx Frequency pane. Columns: UTC dB DT Freq Message. + + + + + Check to display received messages in lower case. + + + + + Lower case + + + + + Include Time + + + + + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the strongest station's reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the weakest station's reply to your CQ.</p><p>When CQ or QRZ is pending, Enable Tx may be armed before or during a receive period. Only eligible direct callers decoded after it is armed in that period can replace the pending transmission; earlier callers are not retained.</p></body></html> + + + + 2/2 2/2 - + 1/3 1/3 - + 2/3 2/3 - + 3/3 3/3 - + 1/4 1/4 - + 2/4 2/4 - + 3/4 3/4 - + 4/4 4/4 - + 1/5 1/5 - + 2/5 2/5 - + 3/5 3/5 - + 4/5 4/5 - + 5/5 5/5 - + 1/6 1/6 - + 2/6 2/6 - + 3/6 3/6 - + 4/6 4/6 - + 5/6 5/6 - + 6/6 6/6 - + Upload decoded messages to WSPRnet.org. Carrega missatges descodificats a WSPRnet.org. - + Upload spots Carrega Spots - + <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> <html><head/><body><p>Els locator de 6 dígits fan que s’enviïn 2 missatges diferents, el segon conté el locator complet, però només un indicatiu trossejat, les altres estacions han d’haver descodificat el primer una vegada abans de poder descodificar el segon. Marca aquesta opció per enviar només locators de 4 dígits i s’evitarà el protocol de dos missatges.</p></body></html> - + 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. Els locator de 6 dígits fan que s’enviïn 2 missatges diferents, el segon conté el locator complet, però només un indicatiu trossejat, les altres estacions han d’haver descodificat el primer una vegada abans de poder descodificar el segon. Marca aquesta opció per enviar només locators de 4 dígits i s’evitarà el protocol de dos missatges. - + + Alt+X + + + + Quick-Start Guide to FST4 and FST4W Guia d'inici ràpid de FST4 i FST4W - + FST4 FST4 @@ -3792,1265 +4918,1429 @@ La llista es pot mantenir a la configuració (F2). FT240W - + No own call decodes No es descodifica cap indicatiu pròpi - + Tx Next Proper TX - + Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. Configura la potència de TX en dBm (dB per sobre d'1 mW) com a part del vostre missatge WSPR. - + NB NB - + 40 40 - - - + + + 10 10 - + 17 17 - + 60 60 - - + + 12 12 - + 160 160 - + 20 20 - + 80 80 - - + + 70 70 - + 15 15 - + 30 30 - - - - + + + + 6 6 - + 24G 24G - + 10G 10G - + 5G 5G - - - + + + 9 9 - + 13 13 - + 23 23 - + 33 33 - + 1.25 1.25 - - + + 4 4 - - + + 8 8 - + CQ messages only. - + Bypass Filters toggled via Settings or the Filters menu. - + BP - + <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> - + Avg - + <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> - + <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> - + <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> - + <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> - + <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> - + Ignore - + Pwr - - <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the the strongest station's reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the the weakest station's reply to your CQ. </p></body></html> - - - - - + + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> - + <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> - + 15C 15C - + <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> - + 15A 15A - + <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> - + 30B 30B - + <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> - + 60C 60C - + <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> - + 60D 60D - + <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> - + 60E 60E - - + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> - + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> - + Send msg - + <html><head/><body><p>Enter a free text message.</p></body></html> - + Free Text - + <html><head/><body><p>Select a specific CQ message.</p></body></html> - + Queue - + Allow Dupes - + <html><head/><body><p>Clear all queues.</p></body></html> - + <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> - + <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> - + Age - + Continent - + Score - + <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> - + In Progress - + <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> - - - - + + + + 3 3 - + 70cm FT8 - + 70cm - + 30m FT8 - + 30m 30m - + <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> - + Band Hopping - + 12m FT8 - + 12m 12m - + 40m FT8 - + 40m 40m - + 2m MSK144 - + 2m MSK - + 10m FT8 - + 10m 10m - + 6m FT8 - + 6m 6m - + 60m FT8 - + 60m 60m - + 160m FT8 - + 160m 160m - + 80m FT8 - + 80m 80m - + 20m FT8 - + 20m 20m - + 17m FT8 - + 17m 17m - + 4m FT8 - + 4m 4m - + 15m FT8 - + 15m 15m - + 2m FT8 - + 2m 2m - - + + 10m FT4 - - + + 12m FT4 - - + + 15m FT4 - - + + 17m FT4 - - + + 20m FT4 - - + + 30m FT4 - - + + 40m FT4 - - + + 80m FT4 - + FT8 QRG6 - + FT8 QRG1 - + FT8 QRG2 - + FT8 QRG7 - + FT8 QRG8 in kHz. - + FT8 QRG5 - + FT8 QRG3 - + FT8 QRG4 - + FT8 QRG8 - + FT8 QRG7 in kHz. - + FT8 QRG6 in kHz. - + FT8 QRG5 in kHz. - + FT8 QRG4 in kHz. - + FT8 QRG3 in kHz. - + FT8 QRG2 in kHz. - + FT8 QRG1 in kHz. - + + GroupBox + + + + + CQ %M CQ + + + + + %H 599 %N + + + + + %H TU CQ %M CQ + + + + + %M + + + + + %H + + + + + TU NOW %Q 599 %N + + + + + %H AGN? + + + + + 599 %N + + + + + F1 + F1 + + + + HisCall Exchange + + + + + F2 + F2 + + + + TU CQ + + + + + F3 + F3 + + + + MyCall + + + + + F4 + F4 + + + + HisCall + + + + + F5 + F5 + + + + Now QueuedCall Exchange + + + + + F6 + F6 + + + + HisCall AGN ? + + + + + Exchange + + + + + Serial number of QSO for contest exchange. + + + + + Click to transmit a message. + + + + + Send message + + + + + Call next + + + + + Message to be transmitted + + + + + Serial Number + + + + + Callsign to be worked next. + + + + Spacing - + Fixed Tone - + K1JT - + CW - + Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. - + H - + Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. - + Switch to FT4 mode - + Switch to MSK144 mode - + MSK - + <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> - + <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> - + <html><head/><body><p>Switch to Echo mode</p></body></html> - + File Arxiu - + View Veure - + Filters - + Decode Descodificar - + Parameters - + Decoder sensitivity - + Decoder start - + Number of threads - + QSO RX freq sensitivity - + Decoding cycles - + Save Guardar - + Help Ajuda - + + Mode Mode - + Configurations Configuracions - + Tools Eines - + Exit Sortir - + About WSJT-X Quant a WSJT-X - + Waterfall Cascada - + Open Obrir - + Ctrl+O Ctrl+O - + Open next in directory Obre el següent directori - + + Ctrl+X + + + + Decode remaining files in directory Descodificar els arxius restants al directori - + + Download EME Ephemeris Chart + + + + + Hide AP information + + + + + <html><head/><body><p>Hide AP information</p></body></html> + + + + + Highlight Whitelist entries + + + + + JTTY + + + Shift+F6 - Maj.+F6 + Maj.+F6 - + Delete all *.wav && *.c2 files in SaveDir Esborrar tots els arxius *.wav i *.c2 - + None Cap - + Save all Guardar-ho tot - + Remove saved files after 30 days - + Online User Guide Guia d'usuari online - + Keyboard shortcuts Dreceres de teclat - + Special mouse commands Ordres especials del ratolí - + JT9 JT9 - + Save decoded Guarda el descodificat - - + + Normal Normal - + Deep Profunda - + Erase ALL.TXT Esborrar l'arxiu ALL.TXT - + Erase wsjtx_log.adi Esborrar l'arxiu wsjtx_log.adi - + Erase wsjtx.log - + Erase Ignore List - + F7 F7 - + Don't split ALL.TXT - + Split ALL.TXT yearly - + Split ALL.TXT monthly - + Disable writing of ALL.TXT - + Active Stations - + Band Buttons - + Use Dark Style - + Reduce false decodes - + Default event logging - + Diagnostic mode - + Disable event logging - + Quick-Start Guide to WSJT-X 2.7 and QMAP - - WSJT-X_improved Home Page - - - - - <html><head/><body><p>Go to the wsjt-x_improved home page.</p></body></html> - - - - - The additional features of wsjt-x_improved - - - - - <html><head/><body><p>Overview on the additional features of wsjt-x_improved.</p></body></html> - - - - - Recommended audio settings - - - - - <html><head/><body><p>Recommended Audio Settings.</p></body></html> - - - - + How to deal with rig control errors - + <html><head/><body><p>How to deal with rig control errors.</p></body></html> - + Erase list of Q65 callers - + SuperFox User Guide - + Message Creator - + Hide stations worked before on band - + Hide stations worked today or yesterday - + Hide stations from Ignore List - + Ignore stations worked today or yesterday - + Ignore stations from Ignore List - + Hide stations from Territory 1 - + Hide stations from Territory 2 - + Hide stations from Territory 3 - + Hide stations from Territory 4 - + Hide stations from Europe - + Hide stations from North America - + Hide stations from South America - + Hide stations from Asia - + Hide stations from Africa - + Hide stations from Oceania - + Hide stations from Antarctica - + Full Duplex Mode - + Highlight callsigns worked before on band - + Highlight callsigns worked today or yesterday - + Highlight callsigns from Ignore List - + Enable Message Popups - + QSY Monitor - + Ignore stations worked before on band - + Use multithreaded FT8 decoder - + Auto - - + + 5 5 - - + + 7 7 - - + + 11 11 - + Low Baix - + Medium - + High Alt - + Minimum - + Use low thresholds - + Use subpass - + 2-Stage - + 3-Stage - + Early - + Late - + Wideband DX Call search - + Hide FT8 dupe messages - + VHF / UHF Buttons - + Highlight stations from Territory 1 - + Highlight stations from Territory 2 - + Highlight stations from Territory 3 - + Highlight stations from Territory 4 - + Disable clicks on waterfall @@ -5059,467 +6349,452 @@ La llista es pot mantenir a la configuració (F2). Seguretat de TX - - + + JT65 JT65 - + Astronomical data Dades astronòmiques - + List of Type 1 prefixes and suffixes Llista de prefixos i sufixos de tipus 1 - + Settings... Configuració... - + Local User Guide Guia d'usuari local - + Open log directory Obre el directori del log - + JT4 JT4 - + Message averaging Mitjana de missatges - + Enable averaging Activa la mitjana - + Enable deep search Activa la cerca profunda - + WSPR WSPR - + Echo Graph Gràfic d'Eco - + F8 F8 - - + + Echo Eco - + EME Echo mode Mode EME Eco - + ISCAT ISCAT - + Fast Graph Gràfic ràpid - F9 - F9 + F9 - + &Download Samples ... &Descarrega mostres ... - + <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> <html><head/><body><p>Descarrega els arxius d’àudio d’exemple mostrant els diversos modes.</p></body></html> - + MSK144 MSK144 - + QRA64 QRA64 - + Release Notes Notes de llançament - + Enable AP for DX Call Habilita AP per al indicatiu de DX - + FreqCal FreqCal - + Measure reference spectrum Mesura l’espectre de referència - + Measure phase response Mesura la resposta en fase - + Erase reference spectrum Esborra l'espectre de referència - + Execute frequency calibration cycle Executa el cicle de calibració de freqüència - + Equalization tools ... Eines d'equalització ... - - + + FT8 FT8 - - + + Enable AP Activa AP - + Solve for calibration parameters Resol els paràmetres de calibratge - + Copyright notice Avís de drets d’autor - + Shift+F1 Maj.+F1 - + Fox log Log Fox - + FT8 DXpedition Mode User Guide Guia de l'usuari del mode DXpedition a FT8 - + Reset Cabrillo log ... Restableix el log de Cabrillo ... - + Color highlighting scheme Esquema de ressaltar el color - + Export Cabrillo log ... Exporta el log de Cabrillo ... - + Contest log Log de Concurs - + Erase WSPR hashtable Esborra la taula WSPR - - + + FT4 FT4 - + Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 Guia d'inici ràpid de WSJT-X 2.5.0 i MAP65 3.0 - + Rig Control Error Error del control del equip - - - + + + Receiving Rebent - + Do you want to reconfigure the radio interface? Vols reconfigurar la interfície de la ràdio ? - + Error Scanning ADIF Log Error d'escaneig del log ADIF - + Scanned ADIF log, %1 worked-before records created. CTY: %2 Log ADIF escanejat, %1 funcionava abans de la creació de registres. CTY: %2 - + Error Loading LotW Users Data S'ha produït un error al carregar les dades dels usuaris de LotW - + + + + Decoder Error + + + + + The decoder subprocess exited unexpectedly. + + + + + jt9 exited unexpectedly with code %1. + + + + + Error Writing WAV File S'ha produït un error al escriure l'arxiu WAV - + Enumerating audio devices Enumeració de dispositius d’àudio - + Configurations... Configuracions... - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Message Missatge - + Error Killing jt9.exe Process Error en matar el procés jt9.exe - + KillByName return code: %1 Codi de retorn de KillByName: %1 - + Error removing "%1" Error en eliminar "%1" - + Click OK to retry Fes clic a D'acord per tornar-ho a provar - - + + %1.wav: invalid sample count %2 + + + + + Improper mode Mode inadequat - - + + File Open Error Error al obrir l'arxiu - - - - - + + + + + Cannot open "%1" for append: %2 No es pot obrir "%1" per annexar: %2 - + Error saving c2 file Error en desar l'arxiu c2 - + Error in Sound Input Error a la entrada de so - + Error in Sound Output Error en la sortida de so - - + + Single-Period Decodes Descodificacions d'un sol període - - + + Average Decodes Mitjans descodificats - + Change Operator Canvi d'Operador - + New operator: Operador Nou: - + Status File Error Error d'estat de l'arxiu - - + + Cannot open "%1" for writing: %2 No es pot obrir "%1" per escriure: %2 - + Decodes containing My Call - + Subprocess Error Error de subprocés - + Subprocess failed with exit code %1 Ha fallat el subprocés amb el codi de sortida %1 - - + + Running: %1 %2 Corrent: %1 %2 - + Subprocess error Error de subprocés - Reference spectrum saved - Guarda l'espectre de referència - - - - It is very important to avoid audio harmonics and distorted audio signals. -This is usually achieved by the following step-by-step approach: - -1. Select 'Fake it' in the Settings/Radio menu as your 'Split mode'. If your - rig does not support this, select 'Rig'. But really try to avoid 'None'! - -2. Set the transmission power of your transceiver to maximum. - -3. Set the Pwr slider to the minimum and click on the 'Tune' button. - -4. Observe the actual transmission power of your rig as well as ALC. - -5. Carefully increase the Pwr slider until you have reached the - maximum transmit powe of your transceiver. - -6. VERY IMPORTANT: Now reduce the Pwr slider until you reach approx. - 90% of your max. Tx power. ALC should be close to zero. - -7. This is the maximum audio level permitted with your setup. - Always stay with the Pwr slider below this max. value. - -If possible, check your transmission from time to time with a webSDR -to ensure the signal is clean and not distorted. - + Guarda l'espectre de referència - - <b>Recommended Audio Settings</b> - - - - + Invalid data in fmt.all at line %1 Les dades no són vàlides a fmt.all a la línia %1 - + Good Calibration Solution Solució de bona calibració - + <pre>%1%L2 ±%L3 ppm %4%L5 ±%L6 Hz @@ -5532,12 +6807,12 @@ to ensure the signal is clean and not distorted. %9%L10 Hz</pre> - + Delete Calibration Measurements Suprimeix les mesures de calibració - + The "fmt.all" file will be renamed as "fmt.bak" L'arxiu "fmt.all" serà renombrat com a "fmt.bak" @@ -5550,22 +6825,22 @@ to ensure the signal is clean and not distorted. "Els algoritmes, el codi font, l'aparença de WSJT-X, els programes relacionats i les especificacions de protocol per als modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 són Copyright (C) 2001-2021 per un o més dels següents autors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q i altres membres del grup de desenvolupament WSJT. " - + No data read from disk. Wrong file format? No es llegeixen dades del disc. Format de l'arxiu incorrecte ? - + Confirm Delete Confirma Esborrar - + Are you sure you want to delete all *.wav and *.c2 files in "%1"? Estàs segur que vols esborrar tots els arxius *.wav i *.c2"%1" ? - + Keyboard Shortcuts Dreceres de teclat @@ -5663,7 +6938,7 @@ to ensure the signal is clean and not distorted. </table> - + Special Mouse Commands Ordres especials del ratolí @@ -5733,23 +7008,21 @@ to ensure the signal is clean and not distorted. </table> - + No more files to open. No s’obriran més arxius. - - Spotting to PSK Reporter unavailable - No hi ha espots a PSK Reporter + No hi ha espots a PSK Reporter - + Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. Tria una altra freqüència de TX. El WSJT-X no transmetrà de manera conscient un altre mode a la sub-banda WSPR a 30 m. - + WSPR Guard Band Banda de Guàrdia WSPR @@ -5758,184 +7031,7 @@ to ensure the signal is clean and not distorted. Tria una altra freqüència de treball. WSJT-X no funcionarà en mode Fox a les sub-bandes FT8 estàndard. - - If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: - -"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2025 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; and other members of the WSJT Development Group." - - - - - <table cellspacing=1> - <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> - <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> - <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> - <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> - <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> - <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> - <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> - <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> - <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> - <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: toggle "Call 1st")</td></tr> - <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> - <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> - <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> - <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> - <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> - <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> - <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> - <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> - <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> - <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> - <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> - <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> - <tr><td><b>Alt+C </b></td><td>Toggle "Call 1st" checkbox</td></tr> - <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> - <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> - <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> - <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> - <tr><td><b>Alt+E </b></td><td>Erase</td></tr> - <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> - <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> - <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> - <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> - <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> - <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> - <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> - <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> - <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> - <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> - <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> - <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> - <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> - <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> - <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> - <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> - -</table> - Keyboard shortcuts help window contents - - - - - <table cellpadding=5> - <tr> - <th align="right">Click on</th> - <th align="left">Action</th> - </tr> - <tr> - <td align="right">Waterfall:</td> - <td><b>Click</b> to set Rx frequency.<br/> - <b>Right-click</b> to set Tx frequency.<br/> - <b>Double-right-click</b> to set Rx and Tx frequencies. - </td> - </tr> - <tr> - <td align="right">Decoded text:</td> - <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> - and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> - Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> - If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> - own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. - </td> - </tr> - <tr> - <td align="right">Dial Frequency:</td> - <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> - <b>Right-click</b> to increase frequency by 1 kHz.<br/> - <b>Left-click</b> to decrease frequency by 1 kHz.<br/> - The mouse pointer must be over the Dial Frequency indicator. - </td> - </tr> - <tr> - <td align="right">H Button:</td> - <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> - <b>Right-click</b> to activate or deactivate SuperFox mode. - </td> - </tr> - <tr> - <td align="right">FT8 Button:</td> - <td><b>Click</b> to switch to FT8 Hound Mode.<br/> - <b>Right-click</b> to toggle last used Special Operating Activity On/Off. - </td> - </tr> - <tr> - <td align="right">Q65 Button:</td> - <td><b>Click</b> to switch to Q65 Mode.<br/> - <b>Right-click</b> to switch to Q65 Pileup Mode. - </td> - </tr> - <tr> - <td align="right">JT65 Button:</td> - <td><b>Click</b> to switch to JT65 Mode.<br/> - <b>Right-click</b> to switch to JT9 Mode. - </td> - </tr> - <tr> - <td align="right">Tx5 Button:</td> - <td><b>Right-click</b> to retain Tx5 free text. - </td> - </tr> - <tr> - <td align="right">Tx Even/1st:</td> - <td><b>Right-click</b> to freeze the state of the checkbox.<br/> - <b>Right-click on the FT8 Button</b> to unfreeze. - </td> - </tr> - <tr> - <td align="right">Enable Tx Button:</td> - <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> - <b>Right-click</b> to toggle Wait & Pounce On/Off. - </td> - </tr> - <tr> - <td align="right">Erase button:</td> - <td><b>Click</b> to erase Rx Frequency window.<br/> - <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> - If <b>Alternate Erase button behavior</b> is checked:<br/> - <b>Click</b> to erase Band Activity window.<br/> - <b>Right-click</b> to erase Rx Frequency window.<br/> - <b>Double-click</b> to erase Rx Frequency and Band Activity windows. - </td> - </tr> - <tr> - <td align="right">DX Call Button:</td> - <td><b>Click</b> to toggle Wait & Call On/Off.<br/> - <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. - </td> - </tr> - <tr> - <td align="right">Lookup Button:</td> - <td><b>Click</b> to search for callsign in database.<br/> - <b>Right-click</b> to search for Dx Call on qrz.com. - </td> - </tr> - <tr> - <td align="right">Add Button:</td> - <td><b>Click</b> to add callsign and locator to database.<br/> - <b>Right-click</b> to search for Dx Call on hamqth.com. - </td> - </tr> - <tr> - <td align="right">Ignore Button:</td> - <td><b>Click</b> to add callsign to the Ignore List.<br/> - <b>Right-click</b> to search for Dx Call on qrzcq.com. - </td> - </tr> - <tr> - <td align="right">Band Buttons:</td> - <td><b>Click</b> to toggle band / mode default frequencies.<br/> - <b>Right-click</b> to toggle FT8 DXpedition frequencies. - </td> - </tr> -</table> - Mouse commands help window contents - - - - + Please choose another dial frequency. Must be 3Khz away from %1. WSJT-X will not operate in Fox mode @@ -5943,193 +7039,730 @@ overlapping the standard FT8 sub-bands. - - + Fox Mode warning Avís de mode Fox - + Please choose another dial frequency. WSJT-X will not operate in Fox mode overlapping the WSPR sub-bands. - - Last Tx: %1 - Últim TX: %1 + + The decoder subprocess could not be stopped. + - - This station transmits in the same time slot as you do. - -You must not start a QSO if both stations Tx even/1st -or Tx odd/2nd, while the Tx even/1st checkbox is disabled. - -Click the MSK144 mode button to re-enable the Tx even/1st -checkbox, or choose another station. + + The decoder subprocess could not be restarted. - - Should you switch to EU VHF Contest mode? - -To do so, check 'Special operating activity' and -'EU VHF Contest' on the Settings | Advanced tab. - Has de canviar al mode Concurs EU VHF? - -Per fer-ho, comprova "Activitat operativa especial" i - Concurs EU VHF a la Configuració | Pestanya avançada. + + Application status + - - Should you switch to ARRL Field Day mode? - Has de canviar al mode de Field Day de l'ARRL ? + + Current WSJT-X status messages and operating indicators. + - - Should you switch to RTTY contest mode? - Has de canviar al mode de concurs RTTY? + + Transmit status + - - - - - Add to CALL3.TXT - Afegeix a CALL3.TXT + + Configuration + - - Please enter a valid grid locator - Introduïu un locator vàlid + + Decode count + - - Cannot open "%1" for read/write: %2 - No es pot obrir "%1" per llegir o escriure: %2 + + Last transmitted message + - - %1 -is already in CALL3.TXT, do you wish to replace it? - %1 -ja és a CALL3.TXT, vols substituir-lo ? + + Power and SWR status + - - Warning: DX Call field is empty. - Avís: el camp de indicatiu DX està buit. + + Decode progress + - - Log file error - Error a l'arxiu de log + + Progress for the current decode operation. + - - Cannot open "%1" - No es pot obrir "%1" + + Transmit watchdog + - - Error sending log to N1MM - Error al enviar el log a N1MM + + The selected transmit message cannot be encoded. Enable Tx has been turned off. Edit the selected message or check station settings before trying again. + - - Write returned "%1" + + Tx message cannot be encoded; Enable Tx is off + + + + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2026 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; Roger Rehr, W3SZ; John Nelson, G4KLA; Charlie Suckling, DL3WDG; Terrell Deppe, KJ5HST; and other members of the WSJT Development Group." + + + + + EME Chart + + + + + Select Year + + + + + FT8 input completion was rejected: automated=%1 awaiting=%2 frames=%3. + + + + + Unable to flush the final FT8 downsampling block. + + + + + FT8 input completed with %1 of %2 samples in the decode buffer. + + + + + FT8 decoding is running behind; early passes are temporarily reduced. + + + + + FT8 decoding caught up; configured early passes restored. + + + + + + PSK Reporter spot queue full; oldest spot dropped + + + + + Last Tx: %1 + Últim TX: %1 + + + + A QSO between two stations with nonstandard callsigns won't work. + +Auto Seq would get stuck in an endless loop. + + + + + This station transmits in the same time slot as you do. + +You must not start a QSO if both stations Tx even/1st +or Tx odd/2nd, while the Tx even/1st checkbox is disabled. + +Click the MSK144 mode button to re-enable the Tx even/1st +checkbox, or choose another station. + + + + + Should you switch to EU VHF Contest mode? + +To do so, check 'Special operating activity' and +'EU VHF Contest' on the Settings | Advanced tab. + Has de canviar al mode Concurs EU VHF? + +Per fer-ho, comprova "Activitat operativa especial" i + Concurs EU VHF a la Configuració | Pestanya avançada. + + + + Should you switch to ARRL Field Day mode? + Has de canviar al mode de Field Day de l'ARRL ? + + + + Should you switch to RTTY contest mode? + Has de canviar al mode de concurs RTTY? + + + + %1 shorthand-message mode + + + + + RR73 is not available in %1. Tx4 uses RRR in this mode. + + + + + Wait & Pounce requires a CQ response mode. +Change CQ: None to another option. + + + + + + Decoder is starting; decode request skipped. + + + + + + + + Add to CALL3.TXT + Afegeix a CALL3.TXT + + + + Please enter a valid grid locator + Introduïu un locator vàlid + + + + Cannot open "%1" for read/write: %2 + No es pot obrir "%1" per llegir o escriure: %2 + + + + %1 +is already in CALL3.TXT, do you wish to replace it? + %1 +ja és a CALL3.TXT, vols substituir-lo ? + + + + Warning: DX Call field is empty. + Avís: el camp de indicatiu DX està buit. + + + + SuperFox free text may only contain spaces, digits, uppercase letters, and + - . / ?. + + + + + Log file error + Error a l'arxiu de log + + + + Cannot open "%1" + No es pot obrir "%1" + + + + Error sending log to N1MM + Error al enviar el log a N1MM + + + + Write returned "%1" Escriptura retornada "%1" - + + DX call + + + + + Callsign of station to be worked. + + + + + DX grid + + + + + Locator of station to be worked. + + + + + Wait and Call + + + + + Lookup DX call + + + + + Add DX call + + + + + Ignore DX call + + + + + CQ response mode + + + + + Selects a station automatically from replies to your pending CQ after Enable Tx is armed in the current receive period, or from CQ messages for Wait & Pounce. + + + + + Transmit audio frequency + + + + + Receive audio frequency + + + + + Signal report + + + + + Operating band + + + + + Operating band text + + + + + Transmit power attenuation + + + + + Adjust Tx audio level attenuation. + + + + + Show or hide the menu bar. + + + + + Rig control status + + + + + Hound mode + + + + + Toggle FT8 hound mode. Right-click to toggle SuperFox mode. + + + + + Message panel selector + + + + + Switches between standard messages, Fox queue, and band hopping pages. Press 1, 2, or 3 while focused to select a page. + + + + + Standard messages + + + + + Fox queue + + + + + + Band hopping + + + + + Standard messages page + + + + + Fox queue page + + + + + Band hopping page + + + + + Hound queue + + + + + Queued Hound callers available for Fox transmissions. + + + + + Fox transmissions in progress + + + + + Hound callers currently in progress for Fox transmissions. + + + + + Hound queue sort order + + + + + Hound queue list size + + + + + Fox transmission slots + + + + + Fox CQ message + + + + + Reset Fox queues + + + + + Fox free text + + + + + Send Fox free text + + + + + Enable FT8 QRG 1 + + + + + Enable FT8 QRG 2 + + + + + Enable FT8 QRG 3 + + + + + Enable FT8 QRG 4 + + + + + Enable FT8 QRG 5 + + + + + Enable FT8 QRG 6 + + + + + Enable FT8 QRG 7 + + + + + Enable FT8 QRG 8 + + + + + FT8 QRG 1 frequency + + + + + FT8 QRG 2 frequency + + + + + FT8 QRG 3 frequency + + + + + FT8 QRG 4 frequency + + + + + FT8 QRG 5 frequency + + + + + FT8 QRG 6 frequency + + + + + FT8 QRG 7 frequency + + + + + FT8 QRG 8 frequency + + + + + Tx1 message + + + + + Tx2 message + + + + + Tx3 message + + + + + Tx4 message + + + + + Tx5 message macro + + + + + Tx6 message + + + + + Tx5 message macro text + + + + + Select Tx1 for next transmission + + + + + Select Tx2 for next transmission + + + + + Select Tx3 for next transmission + + + + + Select Tx4 for next transmission + + + + + Select Tx5 for next transmission + + + + + Select Tx6 for next transmission + + + + + Transmit Tx1 now + + + + + Transmit Tx2 now + + + + + Transmit Tx3 now + + + + + Transmit Tx4 now + + + + + Transmit Tx5 now + + + + + Transmit Tx6 now + + + + Stations calling DXpedition %1 Estacions que criden a DXpedition %1 - + Show Already Worked - + + All Decodes + + + + + QSO Frequency + + + + Super Fox - + Super Hound - + Hound Hound - + Tx Messages Missatges de TX - - - - - - + + + + + + Confirm Erase Confirma Esborrar - + Are you sure you want to erase file ALL.TXT? Estàs segur que vols esborrar l'arxiu ALL.TXT ? - + Are you sure you want to erase the list of Q65 callers? - - + + Confirm Reset Confirma que vols Restablir - + Are you sure you want to erase your contest log? Estàs segur que vols esborrar el log del concurs ? - + Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. Si fas això, suprimiràs tots els registres de QSO del concurs actual. Es conservaran a l'arxiu de log ADIF, però no es podran exportar al log de Cabrillo. - + Cabrillo Log saved Log Cabrillo desat - + Are you sure you want to erase file wsjtx_log.adi? Estàs segur que vols esborrar l'arxiu wsjtx_log.adi ? - + Are you sure you want to erase the WSPR hashtable? Estàs segur que vols esborrar la taula del WSPR ? - + %1 W - + SWR > 2.5 !!! Transmission was stopped @@ -6138,119 +7771,400 @@ Check your antenna - + Tune digital gain Guany de sintonització digital - + Transmit digital gain Guany digital de transmissió - + Prefixes Prefixos - + Network Error Error de xarxa - + Error: %1 UDP server %2:%3 Error: %1 UDP server %2:%3 - + + File Error Error a l'arxiu - + + + Stop transmitting or tuning before changing the dial frequency. + + + + + + Measuring reference spectrum: %1 s remaining + + + + + Reference spectrum measurement stopped; Ref Spec is available + + + + + Reference spectrum saved; Ref Spec is available + + + + + Reference spectrum measurement stopped; no reference spectrum is available + + + + Phase Training Disabled Entrenament de fase Desactivat - + Phase Training Enabled Entrenament de fase activat - + + Cannot remove "%1": %2 + + + + WD:0m - + Runaway Tx watchdog - + WD:%1m - - + + + Free Text Message - - + + Message: - + Directional calls not yet supported in SuperFox mode - + TOTP: No seed entered in fox configuration to generate verification code. - + + SuperFox cannot queue %1: unsupported callsign. + + + + TOTP SF: seed not long enough. - + + SuperFox Tx stopped: invalid message tokens. + + + + + SuperFox Tx stopped: invalid verification code. + + + + + SuperFox Tx stopped: invalid CQ call or grid. + + + + + SuperFox Tx stopped: invalid callsign. + + + + + SuperFox Tx stopped: report is outside the SuperFox range. + + + + + SuperFox Tx stopped: free text contains unsupported characters. + + + + + SuperFox Tx stopped: message could not be packed. + + + + Are you sure you want to erase the Tx Log? - + "%1" added to Ignore List - - Are you sure you want to erase the Ignore List? + + Are you sure you want to erase the Ignore List? + + + + WD:%1m + WD:%1m + + + + + Log File Error + Error a l'arxiu de log + + + + Are you sure you want to clear the QSO queues? + Estàs segur que vols esborrar les cues de QSO ? + + + + Band hopping has no selected frequencies. + + + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: cycle CQ response mode)</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Cycle CQ response mode</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Ctrl+X </b></td><td>Open next file in directory</td></tr> + <tr><td><b>Alt+x </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> + +</table> + + + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Right-click</b> to set Tx frequency.<br/> + <b>Double-right-click</b> to set Rx and Tx frequencies. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> + and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> + Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> + own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">Dial Frequency:</td> + <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> + <b>Right-click</b> to increase frequency by 1 kHz.<br/> + <b>Left-click</b> to decrease frequency by 1 kHz.<br/> + The mouse pointer must be over the Dial Frequency indicator. + </td> + </tr> + <tr> + <td align="right">H Button:</td> + <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to activate or deactivate SuperFox mode. + </td> + </tr> + <tr> + <td align="right">FT8 Button:</td> + <td><b>Click</b> to switch to FT8 Hound Mode.<br/> + <b>Right-click</b> to toggle last used Special Operating Activity On/Off. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> + <tr> + <td align="right">Tx5 Button:</td> + <td><b>Right-click</b> to retain Tx5 free text. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Right-click</b> to freeze the state of the checkbox.<br/> + <b>Right-click on the FT8 Button</b> to unfreeze. + </td> + </tr> + <tr> + <td align="right">Enable Tx Button:</td> + <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> + <b>Right-click</b> to toggle Wait & Pounce On/Off after selecting<br/> + any CQ response mode other than CQ: None. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> + If <b>Alternate Erase button behavior</b> is checked:<br/> + <b>Click</b> to erase Band Activity window.<br/> + <b>Right-click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">DX Call Button:</td> + <td><b>Click</b> to toggle Wait & Call On/Off.<br/> + <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. + </td> + </tr> + <tr> + <td align="right">Lookup Button:</td> + <td><b>Click</b> to search for callsign in database.<br/> + <b>Right-click</b> to search for Dx Call on qrz.com. + </td> + </tr> + <tr> + <td align="right">Add Button:</td> + <td><b>Click</b> to add callsign and locator to database.<br/> + <b>Right-click</b> to search for Dx Call on hamqth.com. + </td> + </tr> + <tr> + <td align="right">Ignore Button:</td> + <td><b>Click</b> to add callsign to the Ignore List.<br/> + <b>Right-click</b> to search for Dx Call on qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Band Buttons:</td> + <td><b>Click</b> to toggle band / mode default frequencies.<br/> + <b>Right-click</b> to toggle FT8 DXpedition frequencies. + </td> + </tr> +</table> + + + + + Type 1 Prefixes: + + 1A 1S 3A 3B6 3B8 3B9 3C 3C0 3D2 3D2C 3D2R 3DA 3V 3W 3X + 3Y 3YB 3YP 4J 4L 4S 4U1I 4U1U 4W 4X 5A 5B 5H 5N 5R + 5T 5U 5V 5W 5X 5Z 6W 6Y 7O 7P 7Q 7X 8P 8Q 8R + 9A 9G 9H 9J 9K 9L 9M2 9M6 9N 9Q 9U 9V 9X 9Y A2 + A3 A4 A5 A6 A7 A9 AP BS7 BV BV9 BY C2 C3 C5 C6 + C9 CE CE0X CE0Y CE0Z CE9 CM CN CP CT CT3 CU CX CY0 CY9 + D2 D4 D6 DL DU E3 E4 EA EA6 EA8 EA9 EI EK EL EP + ER ES ET EU EX EY EZ F FG FH FJ FK FKC FM FO + FOA FOC FOM FP FR FRG FRJ FRT FT5W FT5X FT5Z FW FY M MD + MI MJ MM MU MW H4 H40 HA HB HB0 HC HC8 HH HI HK + HK0A HK0M HL HM HP HR HS HV HZ I IS IS0 J2 J3 J5 + J6 J7 J8 JA JDM JDO JT JW JX JY K KG4 KH0 KH1 KH2 + KH3 KH4 KH5 KH5K KH6 KH7 KH8 KH9 KL KP1 KP2 KP4 KP5 LA LU + LX LY LZ OA OD OE OH OH0 OJ0 OK OM ON OX OY OZ + P2 P4 PA PJ2 PJ7 PY PY0F PT0S PY0T PZ R1F R1M S0 S2 S5 + S7 S9 SM SP ST SU SV SVA SV5 SV9 T2 T30 T31 T32 T33 + T5 T7 T8 T9 TA TF TG TI TI9 TJ TK TL TN TR TT + TU TY TZ UA UA2 UA9 UK UN UR V2 V3 V4 V5 V6 V7 + V8 VE VK VK0H VK0M VK9C VK9L VK9M VK9N VK9W VK9X VP2E VP2M VP2V VP5 + VP6 VP6D VP8 VP8G VP8H VP8O VP8S VP9 VQ9 VR VU VU4 VU7 XE XF4 + XT XU XW XX9 XZ YA YB YI YJ YK YL YN YO YS YU + YV YV0 Z2 Z3 ZA ZB ZC4 ZD7 ZD8 ZD9 ZF ZK1N ZK1S ZK2 ZK3 + ZL ZL7 ZL8 ZL9 ZP ZS ZS8 KC4 E5 + +Type 1 Suffixes: /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /P - - WD:%1m - WD:%1m - - - - - Log File Error - Error a l'arxiu de log - - - - Are you sure you want to clear the QSO queues? - Estàs segur que vols esborrar les cues de QSO ? - MessageAveraging @@ -6269,8 +8183,8 @@ UDP server %2:%3 Modes - - + + Mode Mode @@ -6278,7 +8192,7 @@ UDP server %2:%3 MultiSettings - + Default Per defecte @@ -6286,62 +8200,62 @@ UDP server %2:%3 MultiSettings::impl - + &Switch To &Canviar a - + &Clone &Clon - + Clone &Into ... Clon &a ... - + R&eset R&establir - + &Rename ... &Canviar el nom ... - + &Delete &Esborrar - + Clone Into Configuration Clonar-se a la configuració - + Confirm overwrite of all values for configuration "%1" with values from "%2"? Vols sobreescriure de tots els valors de la configuració "%1" amb valors de "%2"? - + Reset Configuration Restableix la configuració - + Confirm reset to default values for configuration "%1"? Vols restablir els valors per defecte de la configuració "%1"? - + Delete Configuration Esborrar la configuració - + Confirm deletion of configuration "%1"? vols esborrar la configuració "%1"? @@ -6349,17 +8263,17 @@ UDP server %2:%3 NameDialog - + New Configuration Name Nou nom de configuració - + Old name: Nom antic: - + &New name: &Nou nom: @@ -6385,7 +8299,7 @@ UDP server %2:%3 No s'ha pogut iniciar el servidor COM OmniRig - + OmniRig: don't know how to set rig frequency OmniRig: no sé com establir la freqüència de l'equip @@ -6394,7 +8308,7 @@ UDP server %2:%3 OmniRig: el temps d'espera a finalitzat per actualitzar des de l'equip - + OmniRig COM/OLE error: %1 at %2: %3 (%4) OmniRig Error COM/OLE: %1 a %2: %3 (%4) @@ -6420,34 +8334,33 @@ UDP server %2:%3 OOB - + Too many colours in palette. Massa colors a la paleta. - + Error reading waterfall palette file "%1:%2" too many colors. Error de lectura de l'arxiu de paleta de la cascada "%1:%2" massa colors. - + Error reading waterfall palette file "%1:%2" invalid triplet. Error de lectura de l'arxiu de paleta de la cascada "%1:%2" triplet no vàlid. - + Error reading waterfall palette file "%1:%2" invalid color. Error de lectura de l'arxiu de paleta de la cascada "%1:%2" color no vàlid. - + Error opening waterfall palette file "%1": %2. Error obrint l'arxiu de paleta de la cascada "%1": %2. - Error writing waterfall palette file "%1": %2. - Error d'escriptura de l'arxiu de paleta de la cascada "%1": %2. + Error d'escriptura de l'arxiu de paleta de la cascada "%1": %2. @@ -6848,7 +8761,7 @@ Message - + MessageCreator @@ -6866,7 +8779,7 @@ Message - + QSY Monitor @@ -7003,62 +8916,62 @@ Error(%2): %3 SoundInput - + An error opening the audio input device has occurred. S'ha produït un error obrint el dispositiu d'entrada d'àudio. - + An error occurred during read from the audio input device. S'ha produït un error de lectura des del dispositiu d'entrada d'àudio. - + Non-recoverable error, audio input device not usable at this time. Error no recuperable, el dispositiu d'entrada d'àudio no es pot utilitzar ara. - + Requested input audio format is not valid. El format sol·licitat d'àudio d'entrada no és vàlid. - + Requested input audio format is not supported on device. El format d'àudio d'entrada sol·licitat no és compatible amb el dispositiu. - + Failed to initialize audio sink device Error a l'inicialitzar el dispositiu de descarrega d'àudio - + Idle Inactiu - + Receiving Rebent - + Suspended Suspès - + Interrupted Interromput - + Error Error - + Stopped Aturat @@ -7066,90 +8979,114 @@ Error(%2): %3 SoundOutput - + An error opening the audio output device has occurred. S'ha produït un error obrint el dispositiu de sortida d'àudio. - + An error occurred during write to the audio output device. S'ha produït un error escribint en el dispositiu de sortida d'àudio. - + Audio data not being fed to the audio output device fast enough. Les dades d'àudio no s'envien al dispositiu de sortida d'àudio prou ràpid. - + Non-recoverable error, audio output device not usable at this time. Error no recuperable, dispositiu de sortida d'àudio no utilitzable ara. - + Requested output audio format is not valid. El format sol·licitat d'àudio de sortida no és vàlid. - + Requested output audio format is not supported on device. El format sol·licitat d'àudio de sortida no és compatible amb el dispositiu. - + + Audio output restart attempt failed. + + + + + No audio output device configured. No hi ha configurat cap dispositiu de sortida d'àudio. - + + No audio output stream is active. + + + + Idle Inactiu - + Sending Enviant - + Suspended Suspès - + Interrupted Interromput - + Error Error - + Stopped Aturat + + SplashScreen + + + WSJT-X — Welcome + + + + + WSJT-X startup information. Press Escape to close. + + + StationDialog - + Add Station Afegir estació - + &Band: &Banda: - + &Offset (MHz): &Desplaçament en MHz: - + &Antenna: &Antena: @@ -7190,184 +9127,206 @@ Error(%2): %3 TCITransceiver - + ConnectionRefused - + RemoteHostClosed - + HostNotFound - + SocketAccess - + SocketResource - + SocketTimeout - + DatagramTooLarge - + Network - + AddressInUse - + SocketAddressNotAvailable - + UnsupportedSocketOperation - + UnfinishedSocketOperation - + ProxyAuthenticationRequired - + SslHandshakeFailed - + ProxyConnectionRefused - + ProxyConnectionClosed - + ProxyConnectionTimeout - + ProxyNotFound - + ProxyProtocol - + Operation - + SslInternal - + SslInvalidUserData - + Temporary - + UnknownSocket - + + UnknownSocketError + + + + TCI websocket error: %1 - + TCI SDR could not be switched on - + TCI SDR is not switched on - + TCI RX2 could not be enabled - + TCI Audio could not be switched on - - + + TCI could not be opened - - + + + + TCI sent an invalid VFO frequency + + + + + TCI failed to set ptt - + TCI should use PTT via CAT - - + + TCI failed set rxfreq - - + + TCI failed set mode - + TCI modulator not Idle + + + TCI source commitment; playout evidence is protocol-send dead reckoning, not DAC confirmation + + + + + TCI WebSocket send progress; no radio DAC or RF playback confirmation + + TransceiverBase @@ -7389,7 +9348,7 @@ Error(%2): %3 Controls - + Spectrum gain Augment de l’espectre @@ -7398,220 +9357,229 @@ Error(%2): %3 Paleta - + <html><head/><body><p>Enter definition for a new color palette.</p></body></html> <html><head/><body><p>Introdueix la definició per a una nova paleta de colors.</p></body></html> - + Adjust... Ajusta ... - + Total power (dB) - + Waterfall gain Guany de la cascada - + <html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html> <html><head/><body><p>Estableix la mida fraccional de l'espectre en aquesta finestra.</p></body></html> - + % % - + Spec Espec - + <html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html> <html><head/><body><p>Aplica la línia base espectral sobre l'interval complet mostrat.</p></body></html> - + Flatten Aplanar - <html><head/><body><p>Compute and save a reference spectrum. (Not yet fully implemented.)</p></body></html> - <html><head/><body><p>Calcula i desa un espectre de referència. (Encara no està completament implementat.)</p></body></html> + <html><head/><body><p>Calcula i desa un espectre de referència. (Encara no està completament implementat.)</p></body></html> - + Ref Spec Ref Espec - + Smoothing of Linear Average spectrum Suavització de l'espectre mitjà lineal - + Smooth Llis - + Compression factor for frequency scale Factor de compressió per a l'escala de freqüència - + + <html><head/><body><p>Controls</p></body></html> + + + + Bins/Pixel Bins/Pixel - - + + <html><head/><body><p>Position of time stamp above each interval line</p></body></html> - + Time stamp - - + + Off - + Left Esquerra - + Right Dreta - + Palette - + Select waterfall palette Selecciona la paleta de la cascada - + Bars - + Freq - + + <html><head/><body><p>Apply a saved reference spectrum to flatten the received passband. Available after a reference spectrum has been measured. (Not yet fully implemented.)</p></body></html> + + + + <html><head/><body><p>Select data for spectral display</p></body></html> <html><head/><body><p>Selecciona les dades per a la visualització espectral</p></body></html> - + Current Actual - + Cumulative Acumulatiu - + Linear Avg Avg Lineal - + Reference Referència - + Q65_Sync Sincronització Q65 - + <html><head/><body><p>Frequency at left edge of waterfall</p></body></html> <html><head/><body><p>Freqüència a la vora esquerra de la cascada</p></body></html> - + Hz Hz - + Start Començar - + <html><head/><body><p>Decode JT9 only above this frequency</p></body></html> <html><head/><body><p>Descodificar JT9 només per sobre d’aquesta freqüència</p></body></html> - + Hz Hz - + Split Dividit - + Number of FFTs averaged (controls waterfall scrolling rate) Nombre mitjà de FFT's (controla la velocitat de desplaçament de la cascada) - + N Avg Mitjana N - + Waterfall zero Cascada zero - + Spectrum zero Espectre zero - + User Defined Definit per l'usuari - + Wide Graph Gràfic Ampli - - + + Read Palette Llegiu Paleta @@ -7619,22 +9587,22 @@ Error(%2): %3 WorkedBefore - + Invalid ADIF field %0: %1 El camp ADIF no és vàlid %0: %1 - + Malformed ADIF field %0: %1 Camp ADIF amb format incorrecte %0: %1 - + Invalid ADIF header Capçalera ADIF no vàlid - + Error opening ADIF log file for read: %0 Error en obrir l'arxiu de registre ADIF per llegir-lo: %0 @@ -7677,7 +9645,7 @@ Error(%2): %3 El meu L&ocator: - + <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> <html><head/><body><p>Locator Maidenhead, preferiblement de 6 caràcters.</p></body></html> @@ -7692,57 +9660,57 @@ Error(%2): %3 Locator Automàtic - + IARU Region: Regió IARU: - + <html><head/><body><p>Select your IARU region.</p></body></html> <html><head/><body><p>Selecciona la teva regió IARU.</p></body></html> - + Message generation for type 2 compound callsign holders: Generació de missatges per a indicatius de tipus 2: - + <html><head/><body><p>Type 2 compound callsigns are those with prefixes or suffixes not included in the allowed shortlist (See Help-&gt;Add-on prefixes and suffixes).</p><p>This option determines which generated messages should contain your full type 2 compound call sign rather than your base callsign. It only applies if you have a type 2 compound callsign.</p><p>This option controls the way the messages that are used to answer CQ calls are generated. Generated messages 6 (CQ) and 5 (73) will always contain your full callsign. The JT65 and JT9 protocols allow for some standard messages with your full call at the expense of another piece of information such as the DX call or your locator.</p><p>Choosing message 1 omits the DX callsign which may be an issue when replying to CQ calls. Choosing message 3 also omits the DX callsign and many versions of this and other software will not extract the report. Choosing neither means that your full callsign only goes in your message 5 (73) so your QSO partner may log the wrong callsign.</p><p>None of these options are perfect, message 3 is usually best but be aware your QSO partner may not log the report you send them.</p></body></html> <html><head/><body><p>Els indicatius compostos del tipus 2 són aquells amb prefixos o sufixos no inclosos a la llista prèvia permesa (Consulta Ajuda,Prefixos i sufixos addicionals).</p><p>Aquesta opció determina quins missatges generats han de contenir el teu indicatiu de tipus complet 2 en lloc del teu indicatiu base. Només s’aplica si tens un indicatiu compost de tipus 2.</p><p>Aquesta opció controla la manera com es generen els missatges que s’utilitzen per respondre trucades de CQ. Els missatges generats 6 (CQ) i 5 (73) sempre contindran el teu indicatiu complet. Els protocols JT65 i JT9 permeten alguns missatges estàndard amb el teu indicatiu complet a costa d’una altra informació, com ara la trucada DX o el locator.</p><p>L'elecció del missatge 1 omet l'indicatiu de DX, que pot ser un problema quan es respon a les trucades de CQ. L'elecció del missatge 3 també omet l'indicatiu de DX i moltes versions d'aquest altre programari no extreuran l'informe. Si esculls cap, no significa que només el teu indicatiu complet aparegui al missatge 5 (73) de manera que l'altra operador de QSO pot registrar l'indicatiu erròni.</p><p>Cap d’aquestes opcions és perfecta, el missatge 3 sol ser el millor, però tingues en compte que l'altra operador de QSO pot no registrar l’informe que li envies.</p></body></html> - + Full call in Tx1 Indicatiu complet a TX1 - + Full call in Tx3 Indicatiu complet a TX3 - + Full call in Tx5 only Indicatiu complet a TX5 només - + Display Pantalla - + Show outgoing transmitted messages in the Rx frequency window. Mostra els missatges transmesos sortints a la finestra de freqüència de RX. - + &Tx messages to Rx frequency window Missatges de &TX a la finestra de la freqüència de RX - + Show if decoded stations are new DXCC entities or worked before. Mostra si les estacions descodificades són entitats DXCC noves o les has treballat abans. @@ -7751,12 +9719,12 @@ Error(%2): %3 Mostra &DXCC, Locator i si s'ha treballat abans - + <html><head/><body><p>Check to have decodes for a new period start at the top of the Band Activity window and not scroll off the top when the window is full.</p><p>This is to aid selecting decodes to double-click while decoding is still in progress. Use the Band Activity vertical scroll bar to reveal decodes past the bottom of the window.</p></body></html> <html><head/><body><p>Comprova que tinguis descodificacions per començar un nou període a la part superior de la finestra d'Activitat de banda i no moguis la part superior quan la finestra estigui plena.</p><p>Això serveix per ajudar a seleccionar descodificacions, pots fer doble clic mentre la descodificació encara està en curs. Utilitza la barra de desplaçament vertical d'Activitat de banda per veure descodificacions passades a la part inferior de la finestra.</p></body></html> - + Start new period decodes at top Inicia un nou període de descodificacions a la part superior @@ -7765,52 +9733,52 @@ Error(%2): %3 Mostra el prefix principal en lloc del nom del país - + Set the font characteristics for the application. Defineix les característiques del tipus de lletra per a l'aplicació. - + Font... Font... - + Set the font characteristics for the Band Activity and Rx Frequency areas. Defineix les característiques del tipus de lletra per a les àrees de freqüència i activitat de la banda. - + Decoded Text Font... Tipus de font a l'àrea de descodificat ... - + Include a separator line between periods in the band activity window. Inclou una línia separadora entre períodes a la finestra d'activitat de la banda. - + &Blank line between decoding periods Línia en &blanc entre els períodes de descodificació - + Show distance to DX station in miles rather than kilometers. Mostra la distància a l'estació de DX en milles i no en quilòmetres. - + Display dista&nce in miles Distà&ncia de visualització en milles - + Behavior Comportament - + Decode after EME delay Descodificar després del retard d'EME @@ -7819,79 +9787,77 @@ Error(%2): %3 Seguretat de TX: - + <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> <html><head/><body><p>Nombre de minuts abans que s’abandonin les transmissions sense atenció</p></body></html> - + Disabled Desactivat - + minutes minuts - + Single decode Descodificació única - <html><head/><body><p>Some rigs are not able to process CAT commands while transmitting. This means that if you are operating in split mode you may have to uncheck this option.</p></body></html> - <html><head/><body><p>Alguns equips no poden processar ordres CAT durant la transmissió. Això significa que si estàs operant en mode dividit (split), potser hauràs de desmarcar aquesta opció.</p></body></html> + <html><head/><body><p>Alguns equips no poden processar ordres CAT durant la transmissió. Això significa que si estàs operant en mode dividit (split), potser hauràs de desmarcar aquesta opció.</p></body></html> - Allow Tx frequency changes while transmitting - Permet canviar la freqüència de TX durant la transmissió + Permet canviar la freqüència de TX durant la transmissió - + Don't start decoding until the monitor button is clicked. No comença a descodificar fins que no facis clic al botó de monitor. - + Mon&itor off at startup Monitor apa&gat a l'inici - + <html><head/><body><p>Check this if you wish to automatically return to the last monitored frequency when monitor is enabled, leave it unchecked if you wish to have the current rig frequency maintained.</p></body></html> <html><head/><body><p>Comprova-ho si vols tornar automàticament a l’última freqüència controlada quan el monitor estigui habilitat, deixa-ho sense marcar si vols mantenir la freqüència actual de l'equip.</p></body></html> - + Monitor returns to last used frequency El monitor torna a la darrera freqüència utilitzada - + Alternate F1-F6 bindings Enllaços alternatius F1-F6 - + Turns off automatic transmissions after sending a 73 or any other free text message. Desactiva les transmissions automàtiques després d’enviar un 73 o qualsevol altre missatge de text lliure. - + Di&sable Tx after sending 73 Desa&ctiva TX després d’enviar 73 - + Send a CW ID after every 73 or free text message. Envia un ID de CW després de cada 73 o un missatge de text lluire. - + CW ID a&fter 73 CW ID després del &73 @@ -7900,7 +9866,7 @@ missatge de text lliure. Inter&val d'ID periòdic en CW: - + Send a CW ID periodically every few minutes. This might be required under your countries licence regulations. It will not interfere with other users as it is always sent in the @@ -7911,411 +9877,446 @@ No interferirà amb altres usuaris ja que s'envia sempre en el període tranquil quan es fa la descodificació. - + Automatic transmission mode. Mode de transmissió automàtica. - + Show &DXCC, grid, and worked-before status - + Highlight DX Grid in message - + Show DXCC for all messages - + Show the separator line between periods with time stamp of the decode period. - + Show blank line with time stamp - + Show principal prefix instead of country name - + Highlight DX Call in message - + Doubl&e-click on call sets Tx enable Fes dobl&e clic sobre els conjunts d'indicatius de TX habilitat - + <html><head/><body><p>Open the Astronomical Data window automatically when switching to Q65 or JT65 mode and Decode after EME delay is enabled, and close it when no longer needed.</p><p>Open the QSYMessage Creator automatically if the VHF Features are enabled and such QSY messages are applicable.</p></body></html> - + Auto-open/close Astronomical data window - + Calling CQ forces Call 1st Trucar a CQ obliga a trucar primer - + <html><head/><body><p>Tx until 73 is received when in MSK144 or Q65 mode. </p></body></html> - + MSK144/Q65: Tx until 73 is received - + <html><head/><body><p>Allow kHz frequency offset entry without 'k' suffix.</p></body></html> - + kHz entry without k (restart required) - + + <html><head/><body><p>Allow automatic Doppler tracking and split/Fake It/XIT to correct the transmit frequency while transmitting, including corrections of tens of kHz on microwave bands.</p><p>This option does not allow nominal dial or band changes while transmitting or tuning. Leave it unchecked if your rig cannot accept frequency-setting CAT commands while transmitting; WSJT-X will then make one midpoint Doppler correction before transmission starts.</p></body></html> + + + + + Allow Tx-frequency corrections while transmitting + + + + <html><head/><body><p>Disable the Tune watchdog.</p></body></html> - + Tune watchdog - + <html><head/><body><p>Number of seconds before Tune is aborted</p></body></html> - + + Tune watchdog timeout + + + + seconds - + Tx watchdog: - + + Tx watchdog timeout + + + + ID Inter&val: - + + CW ID interval + + + + <html><head/><body><p>Turn the progress bar red while transmitting.</p></body></html> - + Turn progress bar red while transmitting - + Additional features - + Set Rx frequency to Tx frequency after QSO - + <html><head/><body><p>If a station sends locator, calculate and show the distance in Band Activity pane.</p></body></html> - + Show distance in messages with grid - + <html><head/><body><p>Erase Band Activity and Rx frequency windows after band change.</p></body></html> - + Erase decodes after band change - + Clear DX Grid after QSO - + Show U.S. States in messages with grid - + Map Grid locator to U.S. State - + <html><head/><body><p>Align the text for DXCC, distance and azimuth.</p></body></html> - + Align DXCC/distance/azimuth - + Alternate Erase button behavior - + Clear DX Call after QSO - + <html><head/><body><p>Increase or decrease the space between message text and DXCC.</p></body></html> + DXCC alignment spacing + + + + Enable Wait features - + <html><head/><body><p>If a station sends a valid Maidenhead locator, calculate and show the great-circle azimuth in Band Activity pane.</p></body></html> - + Show azimuth in messages with grid - + <html><head/><body><p>Increase or decrease the space between DXCC and distance/azimuth.</p></body></html> - + + Distance and azimuth alignment spacing + + + + Less button coloring (restart required) - + &Radio &Ràdio - + Radio interface configuration settings. Paràmetres de configuració de la interfície de ràdio. - + <html><head/><body><p>Use only VFO A for split operation (the program temporarily changes the QRG of your rig during transmission).</p></body></html> - + <html><head/><body><p>Use VFO A+B for split operation (works with many rigs, but requires the use of both VFOs).</p></body></html> - + <html><head/><body><p>Don't use split (not recommended).</p></body></html> - + Settings that control your CAT interface. Configuració que controla el teu interfície CAT. - + CAT Control Control CAT - - + + Port: Port: - + Serial port used for CAT control. Port sèrie utilitzat per al control CAT. - - + + Serial Port Parameters Paràmetres de port sèrie - + Baud Rate: Velocitat de transmissió: - + Serial port data rate which must match the setting of your radio. Velocitat de dades del port sèrie que ha de coincidir amb la configuració del equip. - + 1200 1200 - + 2400 2400 - + 4800 4800 - + 9600 9600 - + 19200 19200 - + 38400 38400 - + 57600 57600 - + 115200 115200 - + <html><head/><body><p>Number of data bits used to communicate with your radio's CAT interface (usually eight).</p></body></html> <html><head/><body><p>Nombre de bits de dades utilitzats per a comunicar-se amb la interfície CAT del equip (generalment vuit).</p></body></html> - + Data bits Bits de dades - + Data Bits Bits de dades - + D&efault &Per defecte - + Se&ven S&et - + E&ight &Vuit - + <html><head/><body><p>Number of stop bits used when communicating with your radio's CAT interface</p><p>(consult you radio's manual for details).</p></body></html> <html><head/><body><p>Nombre de bits de parada utilitzats per a comunicar-se amb la interfície CAT del equip</p><p>(consulta el manual del equip per a més detalls).</p></body></html> - + Stop bits Bits de parada - + Stop Bits Bits de parada - - + + Default Per defecte - + On&e U&n - + T&wo D&os - + <html><head/><body><p>Flow control protocol used between this computer and your radio's CAT interface (usually &quot;None&quot; but some require &quot;Hardware&quot;).</p></body></html> <html><head/><body><p>Protocol de control de flux que s’utilitza entre aquest ordinador i la interfície CAT del equip (generalment &quot;Cap&quot; però alguns requereixen &quot;Maquinari&quot;).</p></body></html> - - + + Handshake Handshake - + &None &Cap - + Software flow control (very rare on CAT interfaces). Control de flux de programari (molt rar a les interfícies CAT). - + XON/XOFF XON/XOFF - + Flow control using the RTS and CTS RS-232 control lines not often used but some radios have it as an option and a few, particularly some Kenwood rigs, require it). @@ -8324,276 +10325,367 @@ no s’utilitza sovint, però alguns equips ho tenen com a opció i uns pocs, particularment alguns equips de Kenwood, ho requereixen. - + &Hardware Ma&quinari - + Special control of CAT port control lines. Control especial de les línies de control de ports CAT. - - + + Force Control Lines Línies de control de força - - + + High Alt - - + + Low Baix - + DTR: DTR: - + RTS: RTS: - - + + Update Hamlib - + 32-bit - + <html><head/><body><p>Revert the last Hamlib update. </p><p>Note: This function is only available on Windows.</p></body></html> - + Revert Update - - <html><head/><body><p>Download the latest libhamlib-4.dll file from https://n0nb.users.sourceforge.net/. </p><p>Note: This function is only available on Windows.</p></body></html> - - - - + In use: - + Backed up: - + 64-bit - + Rig Data - + <html><head/><body><p>Stop transmitting immediately when SWR exceeds 2.5.</p></body></html> - + Halt Tx when SWR > 2.5 - + <html><head/><body><p>Read and display transmit PWR and SWR of your rig.</p></body></html> - + Read and display PWR and SWR - + + Output audio channel + + + + + Input audio channel + + + + <html><head/><body><p>Refresh audio device list.</p></body></html> - + Refresh Actualització - + <html><head/><body><p>Use TCI Audio when available.</p></body></html> - + Use TCI Audio (restart required) - + <html><head/><body><p>Rx audio level</p></body></html> - + + TCI receive audio level + + + + Rx - + <html><head/><body><p>Sort audio device names alphabetically.</p></body></html> - + Sort alphabetically - + <html><head/><body><p>Hide the usually unusable ALSA CARD subdevices on Linux.</p></body></html> - + Hide ALSA CARD subdevices (Linux only) - + <html><head/><body><p>Enables additional line in azel.dat for Dpol parameter.</p></body></html> - + Enable extra line in azel.dat - + + New &macro: + + + + + Add Tx macro + + + + + Adds the entered message to the saved Tx macro list. + + + + + New Tx macro message + + + + + Enter a saved free-text message for the Tx5 dropdown. Free-text messages are limited to 13 characters including spaces. + + + + + Delete Tx macro + + + + + Deletes the selected Tx macro, or the focused macro if no row is selected. + + + + + Move &Up + + + + + Move Tx macro up + + + + + Moves the selected Tx macro one position earlier in the list. + + + + + Move D&own + + + + + Move Tx macro down + + + + + Moves the selected Tx macro one position later in the list. + + + + + Drag and drop items to rearrange order +Right click for item specific actions +Click, SHIFT+Click and, CTRL+Click to select items + + + + + Saved Tx macro messages + + + + + Saved free-text messages for the main window Tx5 dropdown. Use Move Up and Move Down or drag and drop to reorder messages. + + + + <html><head/><body><p>Check this option to note any Special Operating Activity in the comments field.</p></body></html> - + Special operating activity to comments - + <html><head/><body><p>Log 'ZZ00' as grid if the other station doesn't send you a grid.</p></body></html> - + Fill missing grids with 'ZZ00' - + Log automatically - + <html><head/><body><p>Use 'Log automatically' only for special operating activities.</p></body></html> - + Contesting only - + <html><head/><body><p>Shorten 6-digit grid entries and log 4-digit grids instead.</p></body></html> - + Log 4-digit grids - + <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> <html><head/><body><p>Introdueix el número de port del servei del servidor UDP al qual WSJT-X hauria d'enviar les actualitzacions. Si és zero, no s'enviaran les actualitzacions.</p></body></html> - + Outgoing interfaces: Interfícies de sortida: - + <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> <html><head/><body><p>A l'enviar actualitzacions a una adreça de grup de multidifusió, cal especificar a quina interfície de xarxa enviar. Si la interfície de bucle de retorn té capacitat de multidifusió, es seleccionarà el menys aquesta.</p><p>Per a la majoria dels usuaris, la interfície de bucle de retorn és tot el que es necessita, el que permetrà que moltes altres aplicacions en la mateixa màquina interoperin amb WSJT-X. Si les aplicacions que s'executen en altres hosts han de rebre actualitzacions d'estat, s'ha d'utilitzar una interfície de xarxa adequada.</p><p>En alguns sistemes Linux, pot ser necessari habilitar la multidifusió a la interfície de xarxa de bucle de retorn.</p></body></html> - + <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> <html><head/><body><p>Estableix el nombre de salts de l'encaminador que els datagrames de multidifusió poden realitzar. Gairebé tothom hauria d'establir això en 1 per a mantenir el trànsit de multidifusió sortint dins de la subxarxa local.</p></body></html> - + Multicast TTL: Multidifusió TTL: - + Days since last upload Dies des de la darrera càrrega - How this program activates the PTT on your radio? - Com activa aquest programa el PTT del teu equip ? + Com activa aquest programa el PTT del teu equip ? - + PTT Method Mètode PTT - + <html><head/><body><p>No PTT activation, instead the radio's automatic VOX is used to key the transmitter.</p><p>Use this if you have no radio interface hardware.</p></body></html> <html><head/><body><p>No hi ha cap activació PTT, en canvi, el VOX automàtic de l'equip s'utilitza per teclejar el transmissor.</p><p>Fes-la servir si no tens maquinari d'interfície de l'equip.</p></body></html> - + VO&X VO&X - + <html><head/><body><p>Use the RS-232 DTR control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The DTR control line of the CAT serial port may be used for this or a DTR control line on a different serial port may be used.</p></body></html> <html><head/><body><p>Utilitza la línia de control RS-232 DTR per alternar el PTT del teu equip, requereix maquinari per interconnectar la línia.</p><p>Algunes unitats d'interfície comercial també utilitzen aquest mètode.</p><p>Es pot utilitzar la línia de control DTR del port sèrie CAT o es pot utilitzar una línia de control DTR en un port sèrie diferent.</p></body></html> - + &DTR &DTR - + Some radios support PTT via CAT commands, use this option if your radio supports it and you have no other hardware interface for PTT. @@ -8602,47 +10694,47 @@ utilitza aquesta opció si l'equip li dóna suport i no en tens cap altra interfície de maquinari per a PTT. - + C&AT C&AT - + <html><head/><body><p>Use the RS-232 RTS control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The RTS control line of the CAT serial port may be used for this or a RTS control line on a different serial port may be used. Note that this option is not available on the CAT serial port when hardware flow control is used.</p></body></html> <html><head/><body><p>Utilitza la línia de control RS-232 RTS per canviar el PTT del teu equip, requereix que el maquinari interfereixi a la línia.</p><p>Algunes unitats d'interfície comercial també utilitzen aquest mètode.</p><p>Es pot utilitzar la línia de control RTS del port sèrie CAT o es pot utilitzar una línia de control RTS en un port sèrie diferent. Tingues en compte que aquesta opció no està disponible al port sèrie CAT quan s'utilitza el control del flux de maquinari.</p></body></html> - + R&TS R&TS - + <html><head/><body><p>Select the RS-232 serial port utilised for PTT control, this option is available when DTR or RTS is selected above as a transmit method.</p><p>This port can be the same one as the one used for CAT control.</p><p>For some interface types the special value CAT may be chosen, this is used for non-serial CAT interfaces that can control serial port control lines remotely (OmniRig for example).</p></body></html> <html><head/><body><p>Selecciona el port sèrie RS-232 utilitzat per al control PTT, aquesta opció està disponible quan es selecciona DTR o RTS a dalt com a mètode de transmissió.</p><p>Aquest port pot ser el que s'utilitza per al control CAT.</p><p>Per a alguns tipus d'interfície es pot triar el valor especial CAT, aquest s'utilitza per a interfícies CAT no serials que puguin controlar les línies de control de ports sèrie de forma remota (per exemple, OmniRig).</p></body></html> - + Modulation mode selected on radio. Mode de modulació seleccionat al equip. - + Mode Mode - + <html><head/><body><p>USB is usually the correct modulation mode,</p><p>unless the radio has a special data or packet mode setting</p><p>for AFSK operation.</p></body></html> <html><head/><body><p>USB sol ser el mode de modulació correcte,</p><p>tret que l'equip tingui una configuració especial del mode de dades o paquets</p><p>per a l’operació AFSK.</p></body></html> - + US&B US&B - + Don't allow the program to set the radio mode (not recommended but use if the wrong mode or bandwidth is selected). @@ -8651,23 +10743,23 @@ or bandwidth is selected). o es selecciona l'ample de banda). - - + + None Cap - + If this is available then it is usually the correct mode for this program. Si està disponible, normalment és el mode correcte per a aquest programa. - + Data/P&kt Dades/P&kt - + Some radios can select the audio input using a CAT command, this setting allows you to select which audio input will be used (if it is available then generally the Rear/Data option is best). @@ -8676,52 +10768,52 @@ aquest paràmetre et permet seleccionar quina entrada d'àudio s'utili (si està disponible, en general, l'opció posterior/dades és la millor). - + Transmit Audio Source Font d’àudio de transmissió - + Rear&/Data Part poster&ior/dades - + &Front/Mic &Frontal/Micròfon - + Rig: Equip: - + Poll Interval: Interval de sondeig: - + <html><head/><body><p>Interval to poll rig for status. Longer intervals will mean that changes to the rig will take longer to be detected.</p></body></html> <html><head/><body><p>Interval del sondeig de l'equip per a l'estat. Intervals més llargs significa que els canvis a l'equip triguen més a detectar-se.</p></body></html> - + s s - + <html><head/><body><p>Attempt to connect to the radio with these settings.</p><p>The button will turn green if the connection is successful or red if there is a problem.</p></body></html> <html><head/><body><p>Intenta connectar-te a l'equip amb aquests paràmetres.</p><p>El botó es posarà de color verd si la connexió és correcta o vermella si hi ha algun problema.</p></body></html> - + Test CAT Prova de CAT - + Attempt to activate the transmitter. Click again to deactivate. Normally no power should be output since there is no audio being generated at this time. @@ -8734,47 +10826,47 @@ Comprova que hi hagi alguna indicació de TX a l'equip i el teu interfície de ràdio funcioni correctament. - + Test PTT Prova PTT - + Split Operation Operació Split - + Fake It Falseja-ho - + Rig Equip - + A&udio À&udio - + Audio interface settings Configuració de la interfície d'àudio - + Souncard Targeta de so - + Soundcard Targeta de so - + Select the audio CODEC to use for transmitting. If this is your default device for system sounds then ensure that all system sounds are disabled otherwise @@ -8787,46 +10879,46 @@ desactivats, en cas contrari emetreu els sons del sistema generats durant els períodes de transmissió. - + Select the audio CODEC to use for receiving. Selecciona el CODEC d'àudio que cal utilitzar per rebre. - + &Input: &Entrada: - + Select the channel to use for receiving. Selecciona el canal a utilitzar per a rebre. - - + + Mono Mono - - + + Left Esquerra - - + + Right Dreta - - + + Both Tots dos - + Select the audio channel used for transmission. Unless you have multiple radios connected on different channels; then you will usually want to select mono or @@ -8837,154 +10929,158 @@ canals, llavors normalment voldràs seleccionar mono o els dos canals. - + Enable VHF and submode features Activa les funcions de VHF i submode - + + <html><head/><body><p>Download the latest libhamlib-4.dll file from Hamlib SourceForge snapshots. </p><p>Note: This function is only available on Windows.</p></body></html> + + + + Ou&tput: Sor&tida: - - + + Save Directory Directori de Guardar - + Loc&ation: Ubic&ació: - + Path to which .WAV files are saved. Ruta a la qual es desen els arxius .WAV. - - + + TextLabel Etiqueta de text - + Click to select a different save directory for .WAV files. Fes clic per seleccionar un directori diferent per desar els arxius .WAV. - + S&elect Sele&cciona - - + + AzEl Directory Directori AzEl - + Location: Ubicació: - + Select Selecciona - + Power Memory By Band Memòria de potència per banda - + Remember power settings by band Recorda els ajustos de potència per banda - + Enable power memory during transmit Habilita la memòria de potència durant la transmissió - + Transmit Transmetre - + Enable power memory during tuning Habilita la memòria de potència durant la sintonització - + Tune Sintonitzar - + Tx &Macros &Macros de TX - + Canned free text messages setup Configuració de missatges de text lliures - + &Add &Afegir - + &Delete &Esborrar - Drag and drop items to rearrange order Right click for item specific actions Click, SHIFT+Click and, CRTL+Click to select items - Arrossega i deixa anar els elements per reorganitzar l'ordre. + Arrossega i deixa anar els elements per reorganitzar l'ordre. Fes clic amb el botó dret per a les accions específiques de l’element. Fes clic, MAJ. + clic i, CTRL+clic per seleccionar els elements - + Reportin&g Informe&s - + Reporting and logging settings Configuració d'informes i registres - + Logging Registres - + The program will pop up a partially completed Log QSO dialog when you send a 73 or free text message. El programa apareixerà un diàleg de QSO de registre parcialment completat quan enviïs un missatge de text 73 o lliure. - + Promp&t me to log QSO Regis&tra el QSO - + Op Call: Indicatiu de l'Operador: - + Some logging programs will not accept the type of reports saved by this program. Check this option to save the sent and received reports in the @@ -8995,7 +11091,7 @@ Comprova aquesta opció per desar els informes enviats i rebuts al camp de comentaris. - + d&B reports to comments informa dels d&B's als comentaris @@ -9010,22 +11106,22 @@ Indicatiu DX i Locator DX quan s’envia un missatge de text 73 o lliure.Buida les graelles Indicatiu DX i Locator &DX després del registre - + <html><head/><body><p>Some logging programs will not accept WSJT-X mode names.</p></body></html> <html><head/><body><p>Alguns programes de log no accepten noms del mode WSJT-X.</p></body></html> - + Con&vert mode to RTTY Con&verteix el mode a RTTY - + <html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html> <html><head/><body><p>L'Indicatiu de l'operador, si és diferent del indicatiu de l'estació.</p></body></html> - + <html><head/><body><p>Check to have QSOs logged automatically, when complete.</p></body></html> <html><head/><body><p>Marca perquè els QSO's es registrin automàticament, quan es completin.</p></body></html> @@ -9034,209 +11130,228 @@ Indicatiu DX i Locator DX quan s’envia un missatge de text 73 o lliure.Log automàtic (només concurs) - + Network Services Serveis de xarxa - + <html><head/><body><p>The program can send your station details and all decoded signals with grid squares as spots to the http://pskreporter.info web site.</p><p>This is used for reverse beacon analysis which is very useful for assessing propagation and system performance.</p></body></html> <html><head/><body><p>El programa pot enviar els detalls de l'estació i tots els senyals descodificats amb locators com a spots a la web http://pskreporter.info.</p><p>S'utilitza per a l'anàlisi de balises inverses, que és molt útil per avaluar la propagació i el rendiment del sistema.</p></body></html> - + Enable &PSK Reporter Spotting Activa &PSK Reporter - + <html><head/><body><p>Check this option if a reliable connection is needed</p><p>Most users do not need this, the default uses UDP which is more efficient. Only check this if you have evidence that UDP traffic from you to PSK Reporter is being lost.</p></body></html> <html><head/><body><p>Marca aquesta opció si cal una connexió fiable</p><p>La majoria dels usuaris no ho necessiten, el valor per defecte utilitza UDP, que és més eficient. Comprova-ho només si tens proves que es perd el trànsit UDP que envies a PSK Reporter.</p></body></html> - + Use TCP/IP connection Utilitza la connexió TCP/IP - + UDP Server Servidor UDP - + UDP Server: Servidor UDP: - + <html><head/><body><p>Optional hostname of network service to receive decodes.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the broadcasting of UDP status updates.</p></body></html> <html><head/><body><p>Nom de l'amfitrió opcional del servei de xarxa per rebre descodificacions.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Nom d'amfitrió</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">adreça IPv4</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">adreça IPv6</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Adreça de grup multicast IPv4</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Adreça de grup multicast IPv6</li></ul><p>Si esborreu aquest camp, es desactivarà la difusió de les actualitzacions d’estat d’UDP.</p></body></html> - + UDP Server port number: Número de port del servidor UDP: - + <html><head/><body><p>With this enabled WSJT-X will accept certain requests back from a UDP server that receives decode messages.</p></body></html> <html><head/><body><p>Amb aquesta habilitat, WSJT-X acceptarà de nou algunes sol·licituds d’un servidor UDP que rep missatges de descodificació.</p></body></html> - + Accept UDP requests Accepta sol·licituds UDP - + <html><head/><body><p>Indicate acceptance of an incoming UDP request. The effect of this option varies depending on the operating system and window manager, its intent is to notify the acceptance of an incoming UDP request even if this application is minimized or hidden.</p></body></html> <html><head/><body><p>Indica l'acceptació d'una sol·licitud UDP entrant. L’efecte d’aquesta opció varia en funció del sistema operatiu i del gestor de finestres, la seva intenció és notificar l’acceptació d’una sol·licitud UDP entrant encara que aquesta aplicació estigui minimitzada o oculta.</p></body></html> - + Notify on accepted UDP request Notifica-la sobre la sol·licitud acceptada d’UDP - + <html><head/><body><p>Restore the window from minimized if an UDP request is accepted.</p></body></html> <html><head/><body><p>Restaura la finestra al mínim si s’accepta una sol·licitud UDP.</p></body></html> - + Accepted UDP request restores window La finestra de restauració de la sol·licitud UDP es acceptada - + Secondary UDP Server (deprecated) Servidor UDP secundari (obsolet) - + <html><head/><body><p>When checked, WSJT-X will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html> <html><head/><body><p>Quan es marca, WSJT-X transmetrà un contacte registrat en format ADIF al nom d'amfitrió i port configurats. </p></body></html> - + Enable logged contact ADIF broadcast Habilita la transmissió ADIF de contacte registrad - + Server name or IP address: Nom del servidor o adreça IP: - + <html><head/><body><p>Optional host name of N1MM Logger+ program to receive ADIF UDP broadcasts. This is usually 'localhost' or ip address 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable broadcasting of ADIF information via UDP.</p></body></html> <html><head/><body><p>Nom d'amfitrió opcional del programa N1MM Logger+ per rebre transmissions ADIF UDP. Generalment és "localhost" o adreça IP 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Nom d'amfitrió</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">adreça IPv4</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">adreça IPv6</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Adreça de grup multicast IPv4</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Adreça de grup multicast IPv6</li></ul><p>Si esborres aquest camp, es desactivarà la transmissió d’informació ADIF a través d’UDP.</p></body></html> - + Server port number: Número de port del servidor: - + <html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html> <html><head/><body><p>Introdueix el número de port que hauria d’utilitzar WSJT-X per a les emissions d'UDP d’informació de registre ADIF. Per N1MM Logger+, aquest valor hauria de ser 2333. Si aquest és zero, no es transmetran actualitzacions.</p></body></html> - + Frequencies Freqüències - + Default frequencies and band specific station details setup Configuració predeterminada de les freqüències i bandes amb detalls específics de l'estació - + <html><head/><body><p>See &quot;Frequency Calibration&quot; in the WSJT-X User Guide for details of how to determine these parameters for your radio.</p></body></html> <html><head/><body><p>Veure &quot;Freqüència de Calibració&quot; a la Guia de l'usuari de WSJT-X per obtenir més informació sobre com determinar aquests paràmetres per al teu equip.</p></body></html> - + Frequency Calibration Freqüència de Calibració - + Slope: Pendent: - + ppm ppm - + Intercept: Intercepte: - + Hz Hz - + Working Frequencies Freqüències de treball - + + + Insert, delete, load, save, merge, or reset working frequencies. + + + + + Working frequencies actions + + + + + + + Actions... + + + + <html><head/><body><p>Right click to maintain the working frequencies list.</p></body></html> <html><head/><body><p>Fes clic amb el botó dret per mantenir la llista de freqüències de treball.</p></body></html> - + Station Information Informació de l'estació - + + + Insert or delete station information rows. + + + + + Station information actions + + + + Items may be edited. Right click for insert and delete options. Es poden editar ítems. Fes clic amb el botó dret per a les opcions d'inserció i eliminació. - + Colors Colors - + Decode Highlightling Ressaltar Descodificar - - Reset Highlighting to WSJT-X default - - - - - Reset Highlighting to WSJT-X Improved default - - - - + <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> <html><head/><body><p>Fes clic per analitzar l'arxiu ADIF wsjtx_log.adi de nou per obtenir la informació abans treballada</p></body></html> - + Rescan ADIF Log Escaneig de nou el log ADIF - + <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> <html><head/><body><p>Prem per restablir tots els elements destacats anteriors als valors i prioritats predeterminats.</p></body></html> @@ -9245,126 +11360,125 @@ Fes clic amb el botó dret per a les opcions d'inserció i eliminació.Restableix Ressaltat - + <html><head/><body><p>Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.</p><p>Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.</p></body></html> <html><head/><body><p>Activar o desactivar l'ús de les caselles de verificació fes clic amb el botó dret en un element per canviar o desactivar el color del primer pla, el color de fons o restablir l'element als valors predeterminats. Arrossega i deixa anar els elements per canviar la seva prioritat, major a la llista és major en prioritat.</p><p>Recorda que cada color de primer pla o de fons pot estar configurat o no, el que vol dir que no està assignat per al tipus d'element i poden aplicar-se elements de menor prioritat.</p></body></html> - + <html><head/><body><p>Check to indicate new DXCC entities, grid squares, and callsigns per mode.</p></body></html> <html><head/><body><p>Marca per indicar noves entitats DXCC, Locators i indicatius per modes.</p></body></html> - + Highlight by Mode Ressaltar per mode - + Include extra WAE entities Incloure entitats WAE addicionals - + Check to for grid highlighting to only apply to unworked grid fields Marca perquè el ressaltat de Locator només s'aplica als camps de Locator no treballats - + Only grid Fields sought Només camps de Locator buscats - + <html><head/><body><p>Controls for Logbook of the World user lookup.</p></body></html> <html><head/><body><p>Controls per a la recerca d'usuaris de Logbook of the World (LoTW).</p></body></html> - + Logbook of the World User Validation Validació de l’usuari a Logbook of the World (LoTW) - + Users CSV file URL: URL de l'arxiu CSV dels usuaris: - + <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> <html><head/><body><p>URL de l'últim arxiu de dades de dates i hores de càrrega de ARRL LotW que s'utilitza per ressaltar descodificacions d'estacions que se sap que carreguen el seu arxiu de log a LotW.</p></body></html> - URL - URL + URL https://lotw.arrl.org/lotw-user-activity.csv https://lotw.arrl.org/lotw-user-activity.csv - + <html><head/><body><p>Push this button to fetch the latest LotW user's upload date and time data file.</p></body></html> <html><head/><body><p>Fes clic sobre aquest botó per obtenir l'últim arxiu de dades de data i hora de càrrega dels usuaris de LotW.</p></body></html> - + Fetch Now Obtenir ara - + Age of last upload less than: Edat de la darrera càrrega inferior a: - + <html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html> <html><head/><body><p>Ajusta aquest quadre de selecció per establir el llindar d'edat de l'última data de càrrega dels usuaris de LotW que s'accepta com a usuari actual de LotW.</p></body></html> - + days dies - + Advanced Avançat - + <html><head/><body><p>User-selectable parameters for JT65 VHF/UHF/Microwave decoding.</p></body></html> <html><head/><body><p>Paràmetres seleccionables per l'usuari per descodificació JT65 VHF/UHF/Microones.</p></body></html> - + JT65 VHF/UHF/Microwave decoding parameters Paràmetres de descodificació JT65 VHF/UHF/Microones - + Random erasure patterns: Patrons d'esborrament aleatoris: - + <html><head/><body><p>Maximum number of erasure patterns for stochastic soft-decision Reed Solomon decoder is 10^(n/2).</p></body></html> <html><head/><body><p>El nombre màxim de patrons d'esborrat per al descodificador estoic de decisió suau Reed Solomon és 10^(n/2).</p></body></html> - + Aggressive decoding level: Nivell de descodificació agressiu: - + <html><head/><body><p>Higher levels will increase the probability of decoding, but will also increase probability of a false decode.</p></body></html> <html><head/><body><p>A nivells més elevats augmentarà la probabilitat de descodificació, però també augmentarà la probabilitat de fals descodificació.</p></body></html> - + Two-pass decoding Descodificació a dos passos @@ -9373,45 +11487,45 @@ Fes clic amb el botó dret per a les opcions d'inserció i eliminació.Activitat operativa especial: Generació de missatges FT4, FT8 i MSK144 - + <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> <html><head/><body><p>Mode FT8 DXpedition: operador Hound que truca al DX.</p></body></html> - - + + Hound Hound - + <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> <html><head/><body><p>Concursos de VHF/UHF/Microones nord-americans i altres en què es necessita un intercanvi de locators de quatre caràcters.</p></body></html> - + NA VHF Contest Concurs NA VHF - + <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> <html><head/><body><p>Mode FT8 DXpedition: operador Fox (DXpedition).</p></body></html> - - + + Fox Fox - + <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> <html><head/><body><p>Concursos europeus de VHF i superiors que requereixen el informe de senyal, número de sèrie i locator de 6 caràcters.</p></body></html> - - + + EU VHF Contest Concurs EU VHF @@ -9420,661 +11534,867 @@ Fes clic amb el botó dret per a les opcions d'inserció i eliminació.<html><head/><body><p>ARRL RTTY Roundup i concursos similars. L’intercanvi és estat nord-americà, província canadenca o &quot;DX&quot;.</p></body></html> - R T T Y Roundup - Arrodoniment R T T Y + Arrodoniment R T T Y RTTY Roundup messages Missatges d'arrodoniment RTTY - RTTY Roundup exchange - Intercanvi d'arrodoniment RTTY + Intercanvi d'arrodoniment RTTY RTTY RU Exch: Intercanvi RTTY RU: - + NJ NJ - - + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> <html><head/><body><p>ARRL Field Day exchange: nombre de transmissors, classe i secció ARRL / RAC o &quot;DX&quot;.</p></body></html> - A R R L Field Day - A R R L Field Day + A R R L Field Day - + + ARRL Field Day ARRL Field Day - + + Field Day exchange Intercanvi Field Day - + FD Exch: Intercanvi FD: - + 6A SNJ 6A SNJ - + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> <html><head/><body><p>Concurs World-Wide Digi-mode</p><p><br/></p></body></html> - WW Digital Contest - WW Digital Contest + WW Digital Contest - + + WW Digi Contest Concurs WW Digi - + Miscellaneous Divers - + Degrade S/N of .wav file: Grau S/N de l'arxiu .wav: - - + + For offline sensitivity tests Per a proves de sensibilitat fora de línia - - + + dB dB - + Highlight also messages with 73 or RR73 - - - <html><head/><body><p>Highlight callsigns or grids with orange background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - - - - + Highlight orange: - - - <html><head/><body><p>Highlight callsigns or grids with blue background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - - - - + Highlight blue: - + http://lotw.arrl.org/lotw-user-activity.csv - + CTY File Download - + CTY File Version: - + Download Latest CTY.dat - + CALL3 File Download - + CALL3 File Version: - + Dowload latest CALL3.TXT file. - + Download CALL3.TXT for terrestrial use - + Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. - + Download CALL3.TXT for EME - + GUI tweaks for high-resolution monitors - + <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> - + HighDPI scaling (restart required) - + <html><head/><body><p>Increased height of some control elements.</p></body></html> - + Increased height of the tab widget (restart required) - - Enable Cloudlog Features - - - - + API URL: - + API Key: - - Station ID: - - - - - <html><head/><body><p>Test the Cloudlog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> - - - - - Test API Key - - - - + Special operating activity - + <html><head/><body><p>ARRL International Digital Contest</p></body></html> - + ARRL Digi Contest - + <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> - + NCCC Sprint - - + + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> - + + FT Roundup messages - + FT RU Exch: - + <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> - + SuperFox mode - + <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> - + Show OTP messages - + OTP URL: - + <html><head/><body><p>URL used to verify OTP codes.</p></body></html> - + https://www.9dx.cc - + NA VHF - + <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> - + OTP - + Key: - + <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> - + M2ZUU5CW6EVOY2HU - + Interval - + <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> - + <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> - + CQ with individual contest name - + Contest name: - + <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> - + Q65 Pileup - + Receiver bandwidth: Amplada de banda del receptor: - + + Change or reset colors for the selected highlighting rule. + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move Up + + + + + Move the selected highlighting rule later in priority order. + + + + + Move Down + + + + + Reset Highlighting to Default 1 + + + + + Reset Highlighting to Default 2 + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with orange background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with blue background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + LotW users CSV URL + + + + + + <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> + + + + + Cloudlog or Wavelog + + + + + + Upload QSOs to Cloudlog or Wavelog + + + + + + <html><head/><body><p>API URL for Cloudlog or Wavelog.</p></body></html> + + + + + + <html><head/><body><p>Your API key.</p></body></html> + + + + + + <html><head/><body><p>Your Cloudlog or Wavelog station profile.</p></body></html> + + + + + Station profile: + + + + + <html><head/><body><p>Check the Cloudlog or Wavelog connection, API key, station profile, and upload path where safe.</p><p>The button will turn green if the connection can upload QSOs, orange if the key is valid but read-only, and red if the configuration is unusable.</p></body></html> + + + + + Check Connection + + + + Hz Hz - + Tx delay: Retard de TX: - + Minimum delay between assertion of PTT and start of Tx audio. Retard mínim entre el PTT i l'inici de l'àudio TX. - + s s - - + + Tone spacing Espaiat de to - + <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> <html><head/><body><p>Genera l’àudio de TX amb el doble de l'espaiament normal. Destinat a transmissors especials de LF/MF que utilitzen un dividit per 2 abans de generar la RF.</p></body></html> - + + 2x tone spacing + + + + x 2 x 2 - + <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> <html><head/><body><p>Genera l'àudio de TX amb quatre vegades l'espaiat del to normal. Destinat a transmissors especials de LF/MF que usen una divisió per 4 abans de generar la RF.</p></body></html> - + + 4x tone spacing + + + + x 4 x 4 - - + + Waterfall spectra Espectres de cascades - + Low sidelobes Lòbuls laterals baixos - + Most sensitive El més sensible - + + + <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> + + + + + eQSL.cc + + + + + + Upload QSOs to eQSL.cc + + + + + + <html><head/><body><p>Your username.</p></body></html> + + + + + Username: + + + + + + <html><head/><body><p>Your logon password.</p></body></html> + + + + + Password: + + + + + + <html><head/><body><p>Your QTH nickname, if you have more than one QTH.</p></body></html> + + + + + QTH: + + + + + + Enable special operating activity + + + + + Enable OTP verification + + + + + + OTP key + + + + + + OTP interval + + + + + + OTP URL + + + + + + FT Roundup exchange + + + + + + Contest name + + + + Alerts - - Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. + + NOTES + + + + + "Wanted callsigns, grids, prefixes and directional calls" uses the entries from "Highlight orange" and "Highlight blue". + + + + + <html><head/><body><p>Wanted callsigns, grids, prefixes and directional calls. This alert category uses the entries from &quot;Highlight orange&quot; and &quot;Highlight blue&quot;.</p></body></html> - - THIS FEATURE IS FOR EXPERIENCED USERS ONLY + + Wanted callsigns, grids, prefixes and directional calls - + + IMPORTANT + + + + + Voices: + + + + + default + + + + + <html><head/><body><p>Test the alert sounds.</p></body></html> + + + + + Test + + + + + Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. + + + + Ensure that you have made meaningful settings on the Colors tab, so that you see which message triggered the alert. - + Ensure that your rig is NOT connected via "Default Device". - + Audio Alerts - - + + New ITU Zone on Band Nova Zona ITU en banda - - + + New Continent Nou Continent - - + + DX Call or DX Grid in message - - + + New Grid Nou Locator - - + + New Continent on Band Nou Continent en banda - + Message received - - + + New ITU Zone Nova Zona ITU - - + + New CQ Zone Nova Zona CQ - - + + New DXCC on Band Nou DXCC en banda - + My Call in message El meu Indicatiu en el missatge - + My Call - - + + New CQ Zone on Band Nova Zona CQ en banda - - + + New DXCC Nou DXCC - - + + New Grid on Band Nou Locator en banda - - + + CQ in message CQ al missatge - + Toggle Audio Alerts on/off. Alerts will be played on "DefaultAudioDevice". DON'T ENABLE AUDIO ALERTS WHEN YOUR RIG IS CONNECTED VIA THIS SOUNDCARD !!! - + Enable Audio Alerts - + This requirement is fulfilled when your rig is connected via USB audio. - + Audio Alerts will be played on the default audio device (usually the loudspeaker of your PC). - - IMPORTANT NOTES - - - - + Use of this feature requires that your computer is equipped with two sound cards. - + Filters - + Territories 1-4 for the Hide checkboxes in the View menu - + Blacklist - + Filters for the Band Activity window - + Hide messages containing the following callsigns or keywords: - + Show only messages containing the following callsigns or keywords: - + <html><head/><body><p>Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed).</p></body></html> - + Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed) - + Always pass messages with the following keywords: - + Whitelist - + <html><head/><body><p>Apply filters only to the callsigns of the calling stations. Usually the second word of the messages is analyzed, for directional calls the third word.</p></body></html> - + Apply filters only to the callsigns of the calling stations - + Always Pass - + <html><head/><body><p>Use “worked today and yesterday” instead of “worked today” for the 3 related Quick Filters.</p></body></html> - + Quick Filters: Hide/Ignore/Highlight "worked today and yesterday" instead of "worked today" (UTC) - + <html><head/><body><p>Discard (Cancel) or apply (OK) configuration changes including</p><p>resetting the radio interface and applying any soundcard changes</p></body></html> <html><head/><body><p>Eliminar (Cancel·la) o aplicar (D'acord) canvis de configuració inclosos.</p><p>Restablint la interfície de ràdio i aplicant els canvis a la targeta de so</p></body></html> @@ -10082,53 +12402,114 @@ Fes clic amb el botó dret per a les opcions d'inserció i eliminació. main - + + Lock file: %1 + + + + + Owner process: %1 + + + + + Owner application: %1 + + + + + Owner host: %1 + + + + + Owner information is not available. + + + + + Remove error: %1 + + + + + Another instance may be running + + + + + WSJT-X could not lock its temporary instance file. + +If another WSJT-X window is still running, choose No. +Use a unique rig name to run more than one instance. + +If WSJT-X crashed or will not restart, choose Remove Lock File. +Choose Retry after closing the other instance. + + + + + Remove Lock File + + + + + Unable to remove stale lock file + + + + + Close any running WSJT-X instance or remove the lock file manually after confirming WSJT-X is not running. + + + + Failed to create a temporary directory No s'ha pogut crear el directori temporal - - + + Path: "%1" Ruta: "%1" - + Failed to create a usable temporary directory No s'ha pogut crear un directori temporal utilitzable - + Another application may be locking the directory Una altra aplicació pot ser que bloquegi del directori - + Failed to create data directory No s'ha pogut crear el directori de dades - + path: "%1" Ruta: "%1" - + Shared memory error Error de memòria compartida - + Unable to create shared memory segment No es pot crear el segment de memòria compartida - + Sub-process error Error de subprocés - + Failed to close orphaned jt9 process No s'ha pogut tancar el procés jt9 orfe diff --git a/translations/wsjtx_da.ts b/translations/wsjtx_da.ts index e6b47c78..0ce38209 100644 --- a/translations/wsjtx_da.ts +++ b/translations/wsjtx_da.ts @@ -115,18 +115,17 @@ Aktive stationer - - + Wanted only Kun Wanted - + Message Meddelse - + My call only Kun My Call @@ -134,150 +133,174 @@ Astro - - + + Doppler tracking Doppler-tracking - + <html><head/><body><p>One station does all Doppler shift correction, their QSO partner receives and transmits on the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body> <p> En station udfører alle Doppler-skift-korrektioner. QSO-partner modtager og sender på sked-frekvensen. </p> <p> Hvis radioen ikke accepterer CAT QSY-kommandoer, mens der sendes anvendes en enkelt korrektion for hele sendeperioden. </p> </body> </html> - + Full Doppler to DX Grid Fuld Doppler til DX Grid lokator - + <html><head/><body><p>Transmit takes place on sked frequency and receive frequency is corrected for own echoes. </p><p>This mode can be used for calling CQ, or when using Echo mode.</p></body></html> <html><head/><body> <p> Transmission finder sted på sked-frekvens og modtagefrekvens korrigeres for egne ekko. </p> <p> Denne tilstand kan bruges til at kalde til CQ, eller når du bruger Echo-tilstand. </p> </body> </html> - + Own Echo Eget Ekko - + <html><head/><body><p>Both stations correct for Doppler shift such that they would be heard on the moon at the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p><p>Use this option also for Echo mode.</p></body></html> <html><head/><body> <p> Begge stationer korrigerer for Doppler-skift, så de ville blive via månen på sked-frekvensen. </p> <p> Hvis radioen ikke accepterer CAT QSY-kommandoer, mens der sendes. Anvendes en enkelt korrektion for hele sendeperioden. </p> <p> Brug denne indstilling også til Echo-tilstand. </p> </body> </html> - + Constant frequency on Moon Konstant frevens på månen - + <html><head/><body><p>DX station announces their TX Freq, which is entered as the Sked Freq. Correction applied to RX and TX so you appear on the DX's station's own echo Freq.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body> <p> DX-station annoncerer deres TX Freq, der indtastes som Sked Freq. Korrektion anvendt på RX og TX, så du vises på DX's stations eget ekko Freq. </p> <p> Hvis radioen ikke accepterer CAT QSY-kommandoer, mens der sendes, anvendes en enkelt korrektion for hele sendeperioden. </p> </ body> </ html> - + On DX Echo On DX Ekko - + <html><head/><body><p>Tune radio manually and select this mode to put your echo on the same frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body> <p> Indstil radio manuelt og vælg denne tilstand for at sætte dit ekko på den samme frekvens. </p> <p> Hvis radioen ikke accepterer CAT QSY-kommandoer, mens der sendes, anvendes en enkelt korrektion for hele sendeperioden. </p> </body> </html> - + Call DX Call DX - + <html><head/><body><p>No Doppler shift correction is applied. This may be used when the QSO partner does full Doppler correction to your grid square.</p></body></html> <html><head/><body> <p> Ingen Doppler-skiftkorrektion anvendes. Dette kan bruges, når QSO-partneren udfører fuld Doppler-korrektion til dit Locatorfelt. </p> </body> </html> - + None Ingen - + Sked frequency Sked Frekvens - - + + 0 0 - + + kHz + + + + + Set kHz + + + + + <html><head/><body><p>Tx shift relative to Rx sked frequency</p></body></html> + + + + + MHz + + + + + Tx Shift + + + + Rx: Rx: - + Tx: Tx: - <html><head/><body><p>Press and hold the CTRL key to adjust the sked frequency manually with the rig's VFO dial or enter frequency directly into the band entry field on the main window.</p></body></html> - <html><head/><body> <p> Tryk på CTRL-tasten og hold den nede for at justere sked-frekvensen manuelt med riggens VFO-skive eller indtast frekvens direkte i båndindtastningsfeltet i hovedvinduet. </p> </ krop> </ html> + <html><head/><body> <p> Tryk på CTRL-tasten og hold den nede for at justere sked-frekvensen manuelt med riggens VFO-skive eller indtast frekvens direkte i båndindtastningsfeltet i hovedvinduet. </p> </ krop> </ html> - + Echo Mode Ekko Mode - + Hz Hz - + RIT RIT - Dither - Dither + Dither - Tx Shift relative to Rx Sked Freq - TX Skift relativ til RX Sked Freq + TX Skift relativ til RX Sked Freq - Enter large offset - Indsæt større offset + Indsæt større offset - MHz - Mhz - - - - Shift - Skift - + Mhz - + Enable Enable - + + Dither + + + + + Ctl-Lock Sked Freq + + + + Astro Data Astro Data - + Astronomical Data Astronomiske Data @@ -416,6 +439,166 @@ Kaldesignal + + Cloudlog + + + + QSO could not be sent to Cloudlog. + + + + + + QSO upload was rejected by Cloudlog. + + + + + HTTP status %1. Response was not JSON. + + + + + Cloudlog returned an unexpected upload response. + + + + + Cloudlog reported upload status: %1 + + + + + HTTP status %1. + + + + + Cloudlog::impl + + + Enter a Cloudlog or Wavelog URL. + + + + + The connection check needs a base URL before it can contact the API. + + + + + Cloudlog or Wavelog authentication endpoint was not found. + + + + + Tried /api/check_auth, /index.php/api/check_auth, and /index.php/api/auth. + + + + + API key is valid but read-only. + + + + + Generate a read/write API key before enabling QSO uploads. + + + + + API key is invalid. + + + + + Authentication response was not usable. + + + + + Station profile response was not JSON. + + + + + Configured station profile was not found. + + + + + No station profiles were returned by the server. + + + + + Available station profiles: %1 + + + + + Wavelog dry-run QSO endpoint was not found. + + + + + Tried /api/qso/true and /index.php/api/qso/true after Wavelog was identified. + + + + + Dry-run upload response was not usable. + + + + + + Connection check passed. + + + + + Writable API key, station profile, and dry-run QSO upload were validated. + + + + + Dry-run QSO upload was rejected. + + + + + + The QSO dry-run upload was rejected. + + + + + Dry-run QSO upload returned an unexpected response. + + + + + Writable API key and station profile were validated. No safe dry-run QSO endpoint was identified, so no test QSO was uploaded. + + + + + Network error while checking Cloudlog or Wavelog. + + + + + Cloudlog Error! + + + + + Reason: %1 + + + ColorHighlighting @@ -522,90 +705,317 @@ Configuration::impl - - - + + + &Delete &Slet - - + + &Insert ... &indsæt ... - + + Wanted territory %1 + + + + + Blacklist keyword %1 + + + + + Whitelist keyword %1 + + + + + Always pass keyword %1 + + + + + CAT control port + + + + + CAT baud rate + + + + + Default CAT data bits + + + + + Seven CAT data bits + + + + + Eight CAT data bits + + + + + Default CAT stop bits + + + + + One CAT stop bit + + + + + Two CAT stop bits + + + + + Default CAT handshake + + + + + No CAT handshake + + + + + XON/XOFF CAT handshake + + + + + Hardware CAT handshake + + + + + Force DTR control line + + + + + Force RTS control line + + + + + VOX PTT method + + + + + DTR PTT method + + + + + CAT PTT method + + + + + RTS PTT method + + + + + PTT control port + + + + + Rear or data transmit audio source + + + + + Front or mic transmit audio source + + + + + No radio mode control + + + + + USB radio mode + + + + + Data or packet radio mode + + + + + No split operation + + + + + Rig split operation + + + + + Fake It split operation + + + + + CAT poll interval + + + + + Frequency calibration slope + + + + + Frequency calibration intercept + + + + + Working frequencies table + + + + + Station information table + + + + + Decode highlighting rules + + + + + Highlighting rules and priorities for decoded messages. + + + + + Decode highlighting actions + + + + + Change or reset colors for the selected highlighting rule. + + + + + Move selected highlighting rule up + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move selected highlighting rule down + + + + + Move the selected highlighting rule later in priority order. + + + + + Orange highlight callsigns and grids + + + + + Blue highlight callsigns and grids + + + + Failed to create save directory Fejl ved oprettelse af mappe til at gemme i - + path: "%1% sti: "%1% - + Failed to create samples directory Fejl i oprettelsen af mappe til eksempler - + path: "%1" sti: "%1" - API key OK - API key OK + API key OK - API key read-only - API key read-only + API key read-only - API key invalid - API key invalid + API key invalid - + &Load ... &Hent ... - + &Save as ... &Gem som ... - + &Merge ... &Indflette ... - + &Reset &Reset - + Serial Port: Seriel Port: - + Serial port used for CAT control Seriel port til CAT kontrol - + TCI Server: TCI Server: - + Optional hostname and port of TCI service. Leave blank for a sensible default on this machine. Formats: @@ -620,12 +1030,12 @@ IPv4-adresse:port [IPv6-adresse]:port - + Network Server: Netværk Server: - + Optional hostname and port of network service. Leave blank for a sensible default on this machine. Formats: @@ -640,12 +1050,12 @@ Formater: [IPv6-address]:port - + USB Device: USB Enhed: - + Optional device identification. Leave blank for a sensible default for the rig. Format: @@ -656,15 +1066,25 @@ Format: [VID[:PID[:VENDOR[:PRODUCT]]]] - - + + Invalid audio input device Foekert audio input enhed - - - + + Reset all decode highlighting and priorities to Default 1 values + + + + + Reset all decode highlighting and priorities to Default 2 values + + + + + + Frequency files (*.qrg *.qrg.json);;All files (*.*) Frekvens filer (*.qrg *.qrg.json);;All files (*.*) @@ -673,81 +1093,79 @@ Format: Forkert audio output enhed - + Invalid audio output device Forkert Audio output Enhed - + Invalid PTT method Forkert PTT metode - + Invalid PTT port Forkert PTT port - - + + Invalid Contest Exchange Forkert Contest Udveksling - + You must input a valid ARRL Field Day exchange Indsæt et valid ARRL Field Day exchange - + You must input a valid ARRL RTTY Roundup exchange Indsæt et valid ARRL RTTY Roundup exchange - + Pending DNS lookup, please try again later Afventer DNS-opslag. Prøv igen senere - - + + Reset Decode Highlighting Nulstil dekode markering - - Reset all decode highlighting and priorities to default values - Indstil alle dekode markeringer og prioriteringer til default + Indstil alle dekode markeringer og prioriteringer til default - + Error Loading CTY.DAT Fejl ved indlæsning af CTY.DAT - + Error Loading CALL3.TXT file Fejl ved indlæsning af CALL3.TXT filen - + WSJT-X Decoded Text Font Chooser WSJT-X Dekodet tekst Font vælger - - + + Hamlib update only available on Windows. Hamlib opdatering kun muligt med Windows. - + Error Loading libhamlib-4.dll Fejl ved indlæsning af libhamlib-4.dll - + Hamlib Update successful New Hamlib will be used after restart @@ -756,7 +1174,7 @@ New Hamlib will be used after restart Ny Hamlib vil blive brugt efter genstart - + Hamlib successfully reverted Reverted Hamlib will be used after restart @@ -765,27 +1183,27 @@ Reverted Hamlib will be used after restart Gendannet Hamlib vil blive brugt efter genstart - + No Hamlib update found that could be reverted Ingen Hamlib som kan gendannes fundet - + Error in network address Fejl i netværks adresse - + UDP server DNS lookup failed UDP-server DNS-opslag mislykkedes - + MAC-ambiguous multicast groups addresses not supported MAC-tvetydige multicast-grupper adresser understøttes ikke - + Load Working Frequencies Hent Frekvens liste @@ -794,99 +1212,99 @@ Gendannet Hamlib vil blive brugt efter genstart Frekvens fil *.qrg);;All files (*.*) - + Replace Working Frequencies Erstat frekvensliste - + Are you sure you want to discard your current working frequencies and replace them with the loaded ones? Er du sikker på du vil kassere dine nuværende frekvensliste og erstatte den med denne frekvensliste? - + Merge Working Frequencies Indflet Frevens liste - + Error reading frequency file Frekvens filen kan ikke læses - - - + + + Not a valid frequencies file Ikke en gyldig Frekvens liste fil - + Incorrect file magic Forkert fil Magic - + Version is too new Version for ny - + Contents corrupt Inhold ugyldigt - + Save Working Frequencies Gem frekvens liste - + Only Save Selected Working Frequencies Gemmer kun de valgte frekvenser til listen - + Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. Er du sikker på du kun vil gemme de valgte frekvenser i Frekvenslisten. Klik nej for gemme alle. - + Reset Working Frequencies Reset frekvens liste - + Are you sure you want to discard your current working frequencies and replace them with default ones? Er du sikker på du vil kassere dine nuværende frekvensliste og erstatte dem med standard frekvenser? - + Save Directory Gemme Mappe - + AzEl Directory AzEL Mappe - + Rig control error Radio kontrol fejl - + Failed to open connection to rig Fejl i etablering af forbindelse til radio - + Rig failure Radio fejl - + Not found audio device missing Audio device mangler @@ -1004,32 +1422,32 @@ eller kontakt DXLab support på DXLab@groups.io. &Forgrunds farve ... - + Choose %1 Foreground Color Vælg %1 Forgrunds farve - + &Unset foreground color &Fjern forgrundsfarve - + &Background color ... &Baggrunds farve ... - + Choose %1 Background Color Vælg %1 Baggrunds farve - + U&nset background color F&jern baggrundsfarve - + &Reset this item to defaults &Reset til default @@ -1117,17 +1535,17 @@ eller kontakt DXLab support på DXLab@groups.io. LoTW Bruger - + f/g unset f/g fjernet - + b/g unset b/g fjernet - + Highlight Type Fremhæv skrift @@ -1135,41 +1553,56 @@ eller kontakt DXLab support på DXLab@groups.io. Designer - + &Delete &Slet - + &Insert ... &Indsæt... - + Insert &after ... Indsæt &Efter... - + Import Palette Importer Palette - - + + Palettes (*.pal) Paletter (*.pal) + Import Palette Failed + + + + Export Palette Eksporter Palette + + + Export Palette Failed + + + + + Error writing waterfall palette file "%1": %2. + Fejl ved skrivning til Vandfald palette fil "%1":%2. + Dialog - + Gray time: Gray time: @@ -1272,16 +1705,31 @@ Error: %2 - %3 DisplayText - + &Erase &Slet + + + Return to live activity + + + + + Return to the live activity position + + + + + Live activity is paused while earlier entries are visible. + + EchoGraph - + Echo Graph Ekko Graf @@ -1354,7 +1802,7 @@ Error: %2 - %3 EmulateSplitTransceiver - + Emulated split mode requires rig to be in simplex mode Emuleret spit mode kræver at radioen er i simplex mode @@ -1441,12 +1889,12 @@ Error: %2 - %3 ExistingNameDialog - + Configuration to Clone From Konfiguration der klones fra - + &Source Configuration Name: &Kildekonfigurations navn: @@ -1584,7 +2032,7 @@ Error: %2 - %3 FastGraph - + Fast Graph Fast Graf @@ -1639,100 +2087,251 @@ Error: %2 - %3 - FoxLog::impl + FixtureAudioInput - - Date & Time(UTC) - Dato & Tid (UTC) + + Synthetic audio input has no detector sink. + - - Call - Kaldesignal + + Synthetic FT8 audio input requires a downsample factor of 1 or 4. + - - Grid - Grid + + Synthetic JTTY audio input requires a downsample factor of 1 or 4. + - - Sent - + + Synthetic audio input requires the mono input channel. + - - Rcvd - Modtaget + + Unable to open synthetic audio fixture %1: %2 + - - Band - Bånd + + Synthetic audio fixture must be mono, signed 16-bit little-endian PCM. + - - - FoxLogWindow - - Fox Log - Fox Log + + Synthetic audio fixture must be %1 Hz for downsample factor %2; found %3 Hz. + - - <html><head/><body><p>Right-click here for available actions.</p></body></html> - <html><head/><body> <p> Højreklik her for mulige handlinger. </p> </body> </html> + + Synthetic FT8 audio fixture must contain exactly %1 frames; found %2. + - - Callers: - Callers: + + Synthetic JTTY audio fixture must contain complete PCM frames. + - - - - N - N + + Unable to read all PCM data from synthetic audio fixture. + - - In progress: - I gang: + + Synthetic audio input does not yet support big-endian hosts. + - - Rate: - Rate: + + Unable to initialize the detector for synthetic audio input. + - - <html><head/><body><p>Last 10: Average rate (QSOs/hour) for the last 10 QSOs.<br/>Last 100: Average rate (QSOs/hour) for the last 100 QSOs. <br/>Last 60m: Average rate (QSOs/hour) for the last 60 minutes.</span></p></body></html> - <html><head/><body><p>Sidste 10: Gennemsnitshastighed (QSO'er/time) for de sidste 10 QSO'er.<br/>Sidste 100: Gennemsnitshastighed (QSO'er/time) for de sidste 100 QSO'er. <br/>Sidste 60m: Gennemsnitshastighed (QSO'er/time) for de sidste 60 minutter.</span></p></body></html> + + Synthetic audio fixture ready + - - &Export ADIF ... - &Export ADIF ... + + Synthetic audio input suspended + - - Export ADIF Log File - Eksport ADIF Log Fil + + Synthetic audio input receiving + - - ADIF Log (*.adi) - ADIF Log (*.adi) + + Detector accepted %1 of %2 synthetic PCM bytes. + - - Export ADIF File Error - Fejl ved Eksport af ADIF Fil + + Synthetic audio fixture exhausted + + + + FixtureSoundOutput - - Cannot open "%1" for writing: %2 + + Synthetic audio output requires a readable source. + + + + + Synthetic audio output requires a capture path. + + + + + Synthetic audio output does not yet support big-endian hosts. + + + + + Synthetic audio output received an unsupported source frame size. + + + + + Unable to open synthetic audio output capture %1: %2 + + + + + Synthetic audio output received a partial captured frame. + + + + + Synthetic FT8 audio output exceeded its 15-second capture period. + + + + + Synthetic audio output wrote %1 of %2 capture bytes: %3 + + + + + Synthetic audio output source disappeared during capture. + + + + + Synthetic FT8 audio output continued beyond its 15-second capture period. + + + + + Synthetic audio output received %1 of %2 source bytes. + + + + + Synthetic audio output received an invalid source byte count. + + + + + FoxLog::impl + + + Date & Time(UTC) + Dato & Tid (UTC) + + + + Call + Kaldesignal + + + + Grid + Grid + + + + Sent + + + + + Rcvd + Modtaget + + + + Band + Bånd + + + + FoxLogWindow + + + Fox Log + Fox Log + + + + <html><head/><body><p>Right-click here for available actions.</p></body></html> + <html><head/><body> <p> Højreklik her for mulige handlinger. </p> </body> </html> + + + + Callers: + Callers: + + + + + + N + N + + + + In progress: + I gang: + + + + Rate: + Rate: + + + + <html><head/><body><p>Last 10: Average rate (QSOs/hour) for the last 10 QSOs.<br/>Last 100: Average rate (QSOs/hour) for the last 100 QSOs. <br/>Last 60m: Average rate (QSOs/hour) for the last 60 minutes.</span></p></body></html> + <html><head/><body><p>Sidste 10: Gennemsnitshastighed (QSO'er/time) for de sidste 10 QSO'er.<br/>Sidste 100: Gennemsnitshastighed (QSO'er/time) for de sidste 100 QSO'er. <br/>Sidste 60m: Gennemsnitshastighed (QSO'er/time) for de sidste 60 minutter.</span></p></body></html> + + + + &Export ADIF ... + &Export ADIF ... + + + + Export ADIF Log File + Eksport ADIF Log Fil + + + + ADIF Log (*.adi) + ADIF Log (*.adi) + + + + Export ADIF File Error + Fejl ved Eksport af ADIF Fil + + + + Cannot open "%1" for writing: %2 Kan ikke åbne "%1" for at skrive: %2 @@ -1751,69 +2350,101 @@ Error: %2 - %3 Er du sikker på du vil slette filen FoxQSO.txt og starte en ny Fox Log? + + FrequencyDeltaLineEdit + + + Offset in MHz + + + + + Frequency offset in MHz + + + + + Enter a frequency offset in MHz. + + + FrequencyDialog - + Add Frequency Tilføj Frekvens - + IARU &Region: IARU &Region: - + &Mode: &Mode: - + &Frequency (MHz): &Frekvens (Mhz): - + &Preferred for Band/Mode: &Foretrukket for bånd/mode: - + &Description: &Beskrivelse: - + &Enable Date Range: &Aktivér datointerval: - + S&tart: S&tart: - + &End: &End: - + &Source: &Kilde: - + Invalid Date Range Ugyldigt datointerval - + Start date must be before end date Start dato skal være før slut dato + + FrequencyLineEdit + + + + Frequency in MHz + + + + + Enter a positive frequency in MHz. + + + FrequencyList_v2_100 @@ -1837,37 +2468,37 @@ Error: %2 - %3 FrequencyList_v2_101 - + IARU Region IARU Region - + Mode Mode - + Frequency Frekvens - + Frequency (MHz) Frekvens (Mhz) - + Description Beskrivelse - + Source Kilde @@ -1883,129 +2514,241 @@ Error: %2 - %3 - + Pref Pref - + Start Date/Time Start Dato/Tid - + End Date/Time Slutdato/tid - + Failed to parse JSON file Fejl fortolkining af JSON filen - + Information Missing Information manlger - + No Frequencies were found Ingen frekvenser fundet - + Loaded Frequencies from %1 Indlæst frekvenser fra %1 - + Entries Valid/Skipped %1 Indtastninger gyldige/sprunget over %1 + + Ft8TxLoopbackTestController + + + Timed out after 60 seconds. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + The FT8 output stream did not start exactly once. + + + + + The FT8 Auto control was not found. + + + + + Disabling Auto stopped the active FT8 transmission. + + + + + Synthetic output reported non-silent FT8 audio more than once. + + + + + The FT8 capture did not stop exactly once at the requested path. + + + + + Synthetic audio output failed: %1 + + + + + A required FT8 transmit GUI control was not found. + + + + + The application did not enter FT8 mode. + + + + + Unable to configure the requested FT8 transmission. + + + + + The FT8 transmit controls disappeared before transmission. + + + + + Unable to start the synthetic FT8 transmission. + + + + + The FT8 Auto control disappeared before retry. + + + + + The FT8 output lifecycle was not one start, non-silent transmission, and natural stop. + + + + + FT8 audio began at frame %1; expected %2 +/- %3 frames. + + + + + The FT8 capture file was not created or is empty: %1 + + + + + Unable to reopen FT8 capture %1: %2 + + + + + The FT8 capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The FT8 capture must contain exactly %1 frames; file=%2 reported=%3. + + + + + Unexpected modal window: %1 + + + HRDTransceiver - - + + Failed to connect to Ham Radio Deluxe Fejl i kommunikation med HRD - + Failed to open file "%1": %2. Kan ikke åbne fil "%1": %2. - - + + Ham Radio Deluxe: no rig found Ham Radio Deluxe: Ingen radio fundet - + Ham Radio Deluxe: rig doesn't support mode Ham Radio Deluxe: Radioen understøtter ikke denne mode - + Ham Radio Deluxe: sent an unrecognised mode Ham Radio Deluxe: Har sendt en ikke genkendt mode - + Ham Radio Deluxe: item not found in %1 dropdown list Ham Radio Deluxe: Enheden ikke fundet i %1 på listen - + Ham Radio Deluxe: button not available Ham Radio Deluxe: Knap ikke tilgængelig - + Ham Radio Deluxe didn't respond as expected Ham Radio Deluxe svarede ikke som forventet - + Ham Radio Deluxe: rig has disappeared or changed Ham Radio Deluxe: Radio er forsvundet eller er ændret - + Ham Radio Deluxe send command "%1" failed %2 Ham Radio Deluxe sendte kommando "%1" fejl %2 - - + + Ham Radio Deluxe: failed to write command "%1" Ham Radio Deluxe: Fejl ved skrivning af kommando "%1" - + + Ham Radio Deluxe sent an invalid reply to our command "%1": %2 + + + Ham Radio Deluxe sent an invalid reply to our command "%1" - Ham Radio Deluxe sendte en forkert svar på kommando "%1" + Ham Radio Deluxe sendte en forkert svar på kommando "%1" - + Ham Radio Deluxe failed to reply to command "%1" %2 Ham Radio Deluxe fejl ved svar på kommando "%1" %2 - + Ham Radio Deluxe retries exhausted sending command "%1" Ham Radio Deluxe ikke flere forsøg for afsendelse af kommando "%1" - + Ham Radio Deluxe didn't respond to command "%1" as expected Ham Radio Deluxe svarede ikke på kommando "%1" som forventet @@ -2013,186 +2756,186 @@ Error: %2 - %3 HamlibTransceiver - - + + Hamlib initialisation error Hamlib initialiseringsfejl - + Hamlib settings file error: %1 at character offset %2 Hamlib fejl i ved indstillings fil : %1 ved karakter offset %2 - + Hamlib settings file error: top level must be a JSON object Hamlib indstillings fil fejl: Top niveau skal være et JSON objekt - + Hamlib settings file error: config must be a JSON object Hamlib indstillings fil fejl: konfiguration skal være et JSON objekt - + Unsupported CAT type Ikke under støttet CAT type - + Hamlib error: %1 while %2 Hamlib fejl: %1 med %2 - + opening connection to rig Åbner forbindelse til radio - + getting current frequency Henter nuværende frekvens - + getting current mode Henter nuværende mode - - + + exchanging VFOs Skifter VFOer - - + + getting other VFO frequency Henter anden VFO - + getting other VFO mode Henter anden VFO Mode - - + + setting current VFO Inderstiller nuværende VFO - + getting frequency Henter frekvens - + getting mode Henter mode - - - + + + getting current VFO Henter nuværende VFO - - - - + + + + getting current VFO frequency Henter nuværende VFO frekvens - - - - - - + + + + + + setting frequency Indstiller frekvens - - - - + + + + getting current VFO mode Henter nuværende VFO mode - - - - - + + + + + setting current VFO mode Indstiller nuværende VFO mode - setting VFOB mode - indstilling VFOB mode + indstilling VFOB mode - - + + setting/unsetting split mode Indstiller/Fjerner spilt mode - - + + setting split mode Indstiller split mode - + setting split TX frequency and mode Indstiller split TX frekvens og mode - + setting split TX frequency Indstiller split frekvens - + getting split TX VFO mode Henter split TX VFO mode - + setting split TX VFO mode Indstiller split TX VFO mode - + getting PTT state Henter PTT status - + setting PTT on Sætter PTT on - - + + setting PTT off Sætter PTT off - + setting a configuration item Indstilling af konfigurations element - + + getting a configuration item Henter konfigirations element @@ -2241,6 +2984,322 @@ Error: %2 - %3 IARU Region + + JttyTxLoopbackTestController + + + Timed out after 60 seconds. + + + + + JTTY request %1 was accepted more than once. + + + + + JTTY request %1 was rejected with reason %2. + + + + + JTTY request %1 completed more than once. + + + + + More than one JTTY transmit session drained. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + JTTY output stream restarted more than once. + + + + + Synthetic output reported non-silent playback more than once. + + + + + Synthetic output stopped the wrong capture path: %1 + + + + + JTTY output stream stopped more than once. + + + + + Synthetic audio output failed: %1 + + + + + The JTTY mode action was not found. + + + + + The application did not enter JTTY mode. + + + + + The JTTY encoder did not produce a valid test waveform extent. + + + + + The first JTTY text request was not accepted synchronously. + + + + + Non-silent playback began before the first request was accepted. + + + + + The output stream restarted or stopped before the gapless append. + + + + + The gapless append occurred before one second of real playback. + + + + + The second JTTY text request was not accepted during playback. + + + + + Appending the second JTTY message restarted or stopped playback. + + + + + The accepted-request set did not contain exactly both submitted messages. + + + + + JTTY text requests were not accepted in submission order. + + + + + The completed-request set did not contain exactly both submitted messages. + + + + + JTTY text requests did not complete in FIFO order. + + + + + The output stream lifecycle was not one start, one drain, and one stop. + + + + + The captured JTTY session contains an unexpected internal audio gap. + + + + + The JTTY capture file was not created or is empty: %1 + + + + + Unable to reopen JTTY capture %1: %2 + + + + + The JTTY capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The JTTY capture has an invalid PCM extent: file frames=%1, expected audio frames=%2, reported frames=%3. + + + + + Unexpected modal window: %1 + + + + + LiveAudioTestController + + + Timed out after 110 seconds. + + + + + Timed out after 100 seconds. + + + + + Decoder backend failed: %1 + + + + + JTTY display did not settle to the expected text after input ended. + + + + + Synthetic audio source failed: %1 + + + + + Unable to open expected decode file %1: %2 + + + + + Expected decode file %1 contains no messages. + + + + + Unable to open expected JTTY text file %1: %2 + + + + + Expected JTTY text file %1 contains no messages. + + + + + A required FT8 decoder or monitoring GUI control was not found. + + + + + Unable to configure the %1-%2 Hz waterfall decode range. + + + + + Unable to prepare the complete FT8 fixture decode. + + + + + Unable to configure the FT8 multithreaded decoder as requested. + + + + + Monitor did not enter the active state. + + + + + Synthetic input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic audio source. + + + + + A required JTTY mode, monitoring, or decode display control was not found. + + + + + The JTTY GUI action did not select JTTY mode. + + + + + Monitor did not enter the active state for JTTY. + + + + + Synthetic JTTY input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic JTTY audio source. + + + + + The expected early standard and final configured MTD decoder invocations were not both observed. + + + + + The configured MTD invocation produced no decoder output. + + + + + live MTD missing: %1 + + + + + processed missing: %1 + + + + + display missing: %1 + + + + + Reference-message validation failed: %1; live MTD output: %2; processed output: %3 + + + + + Decoder messages were processed but none reached the GUI display path. + + + + + The expected JTTY messages did not reach both panes in FIFO order. + + + + + The expected JTTY message reached both panes without an observed growing prefix. + + + + + Unexpected modal window: %1 + + + LogQSO @@ -2360,189 +3419,189 @@ Error: %2 - %3 RX Frekvens - + Aircraft scatter Flyscatter - + Aurora-E Aurora-E - + Aurora Aurora - + Back scatter Back scatter - + Echolink Echolink - + Earth-moon-earth Earth-moon-earth - + Sporadic E Sporadisk E - + F2 Reflection F2 Reflektion - + Field aligned irregularities Uregelmæssigheder i feltet - + Internet-assisted Internet assistance - + Ionoscatter Ionoscatter - + IRLP IRLP - + Meteor scatter Meteor scatter - + Non-satellite repeater or transponder Non-satelit eller transponder - + Rain scatter Regn scatter - + Tropospheric ducting Troposfærisk udbredelse - + A A - + B B - + BS BS - + JA JA - + JD JD - + K K - + KA KA - + KT KT - + L L - + LS LS - + LU LU - + LX LX - + S S - + SX SX - + T T - + US US - + UV UV - + VS VS - + VU VU - + Satellite Satelit - + Trans-equatorial Transækvatorial @@ -2551,33 +3610,33 @@ Error: %2 - %3 Troposfærisk udbredelse - - + + Invalid QSO Data Forkerte QSO Data - + Check exchange sent and received Kontroller Exch sendt og modtager - + Check all fields Kontroller alle felter - + Log file error Log fil fejl - + Cannot open "%1" for append Kan ikke åbne "%1" for tilføjelse - + Error: %1 Fejl: %1 @@ -2636,62 +3695,61 @@ Fejl(%2): %3 MainWindow - WSJT-X by K1JT - WSJT-X by K1JT - - - - - - - - - - - + WSJT-X by K1JT + + + + + + + + + + + Band Activity Bånd Aktivitet - - + + UTC dB DT Freq Dr UTC dB DT Frekv Dr - - - - - - - + + + + + + + Rx Frequency Rx frekvens - + CQ only Kun CQ - + Enter this QSO in log Indsæt denne QSO i Log - + Log &QSO Log &QSO - + Stop monitoring Stop monitorering - + &Stop &Stop @@ -2700,77 +3758,77 @@ Fejl(%2): %3 Skift monitorering On/Off - + &Monitor &Monitor - + <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> <html><head/><body><p>Slet hjre vindue. Dobbelt-klik for at slette begge vinduer.</p></body></html> - + Erase right window. Double-click to erase both windows. Slet højre vindue. Dobbelt klik for at slette begge vinduer. - + &Erase &Slet - + <html><head/><body><p>Clear the accumulating message average.</p></body></html> <html><head/><body> <p> Slet det samlede meddelelsesgennemsnit. </p> </body> </html> - + Clear the accumulating message average. Slet det samlede meddelses gennemsnit. - + Clear Avg Slet AVG - + <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> <html><head/><body> <p> Dekod den seneste Rx-periode på QSO-frekvens </p> </body> </html> - + Decode most recent Rx period at QSO Frequency Dekod den seneste Rx-periode på QSO-frekvens - + &Decode &Dekode - + <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> <html><head/><body><p>Skift af Auto-Tx On/Off</p></body></html> - + Toggle Auto-Tx On/Off Skift Auto Tx On/Off - + E&nable Tx A&ktiver Tx - + Stop transmitting immediately Stop TX med det samme - + &Halt Tx &Stop Tx @@ -2779,93 +3837,95 @@ Fejl(%2): %3 <html><head/><body><p>Skift mellem On/Off af TX Tone</p></body></html> - + Toggle a pure Tx tone On/Off Skift mellem On/Off af TX Tone - + &Tune &Tune - + + Menus Menu - + Decode other Hounds calling above 1000 Hz audio offset Afkod andre Hounds, der kalder over 1000 Hz offset - + Enable auto response to the first decode from a new DXCC or new call on the current band. Aktivér automatisk reaktion på den første afkodning fra et nyt DXCC eller nyt opkald på det aktuelle bånd. - + Maximum drift rate in units of symbol rate per transmission. Maksimal hastighed i enheder af symbol rate pr. transmission. - + Max Drift Maks Drift - + Percentage of minute sequences devoted to transmitting. Procentdel af minut sekvens dedikeret til sending. - + Prefer Type 1 messages Foretræk Type 1 meddelse - + <html><head/><body><p>Transmit during the next sequence.</p></body></html> <html><head/><body><p>Send i næste sekvens.</p></body></html> - + Quick-Start Guide to Q65 Quick Start Guide for Q65 - + Auto Clear Avg after decode Auto Slet Avg efter Dekodning - + Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 Quick-Start Guide til WSJT-X 2.5.0 og MAP65 3.0 - + + USB dial frequency USB dial frekvens - + 14.078 000 14.078 000 - + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> <html><head/><body> <p> 30dB anbefales, når der kun er støj til stede <br/> Grønt er godt <br/> Rødt ved klipning kan forekomme <br/> Gul, når den er for lav </p> </ body > </ html> - + Rx Signal Rx Signal - + 30dB recommended when only noise present Green when good Red when clipping may occur @@ -2876,17 +3936,17 @@ Rød ved klipping kan forekomme Gul er for lavt - + DX Call DX kaldesignal - + DX Grid DX Grid - + Callsign of station to be worked Kaldesignal på den der køres @@ -2895,17 +3955,17 @@ Gul er for lavt Kig efter kaldesignalet i databasen - + &Lookup &Slå op - + Locator of station to be worked Lokator på den der køres - + Az: 251 16553 km Az: 251 16553 km @@ -2914,7 +3974,7 @@ Gul er for lavt Tilføj kaldesignal og locator til Log databasen - + Add Tilføj @@ -2923,172 +3983,184 @@ Gul er for lavt Pwr - + <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> <html><head/><body> <p> Er den orange eller rød er der sket en Radiokontrol fejl og så skal du klikke for at nulstille og læse frekvensen. S betyder split mode. </p> </body> </html> - + If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. Hvis den er orange eller rød har der været en Radiokontrol fejl. Så skal der klikkes for nulstille og læse frekvensen. S betyder split mode. - + ? ? - + Adjust Tx audio level Juster Tx audio niveau - + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> <html><head/><body> <p> Vælg bånd eller indtast frekvens i MHz eller indtast kHz forøgelse efterfulgt af k. </p> </body> </html> - + Frequency entry Indsæt Frekvens - + Select operating band or enter frequency in MHz or enter kHz increment followed by k. Vælg bånd du vil operere på eller indtast frekvens i Mhz eller indtast Khz efterfulgt af k. - + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> - + <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> <html><head/><body> <p> Marker for at holde Tx-frekvensen, når du dobbeltklikker på dekodet tekst. </p> </body> </html> - + Check to keep Tx frequency fixed when double-clicking on decoded text. Marker for at låse Tx frekvens når der dobbeltklikkes på en dekodet tekst. - + Hold Tx Freq Hold Tx Frekv - + + Audio Rx frequency Audio Rx frekvens - - - - - - + + + + + + + + Hz Hz - - + + + Rx Rx - - + + + + Set Tx frequency to Rx Frequency Sæt Tx frekvens til Rx frekvens - + + ▲ ▲ - + + Frequency tolerance (Hz) Frekvens tolerance (Hz) - - + + + F Tol F Tol - - + + + + Set Rx frequency to Tx Frequency Sæt Rx frekevens til Tx Frekvens - + + ▼ ▼ - + <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> <html><head/><body> <p> Synkroniseringsgrænse. Lavere tal accepterer svagere synkroniseringssignaler. </p> </body> </html> - + Synchronizing threshold. Lower numbers accept weaker sync signals. Synkroniseringsgrænse. Lavere tal accepterer svagere synkroniseringssignaler. - + Sync Synk - + <html><head/><body><p>Check to use short-format messages.</p></body></html> <html><head/><body><p>Marker for at bruge kort msg format.</p></body></html> - + Check to use short-format messages. Marker for at bruge kort msg format. - + Sh Sh - + <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> <html><head/><body><p>Marker for at aktivere JT9 Fast Mode</p></body></html> - + Check to enable JT9 fast modes Marker for aktivering af JT9 Fast Mode - - + + Fast Hurtig - + <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> <html><head/><body> <p> Marker for at aktivere automatisk sekventering af Tx-meddelelser baseret på modtagne meddelelser. </p> </body> </html> - + Check to enable automatic sequencing of Tx messages based on received messages. Marker for at aktivere automatisk sekventering af Tx-meddelelser baseret på modtagne meddelelser. - + Auto Seq Auto Sekv @@ -3105,12 +4177,12 @@ Gul er for lavt Kald 1st - + Check to generate "@1250 (SEND MSGS)" in Tx6. Marker for at generere "@1250 (SEND MSGS)" in Tx6. - + Tx6 Tx6 @@ -3123,89 +4195,165 @@ Gul er for lavt Marker til Tx på lige sekunder i minuttet eller sekvenser, der starter ved 0; fjern markeringen for ulige sekvenser. - + Tx even/1st Tx Lige/1st - + <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> <html><head/><body><p>Frekvens hvor der kaldes CQ på i kHz over de nuværende Mhz</p></body></html> - + Frequency to call CQ on in kHz above the current MHz Frekvens hvor der kaldes CQ i Khz over de nuværende Mhz - + Tx CQ Tx CQ - + <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> <html><head/><body> <p> Marker for at kalde CQ på &quot; Tx CQ &quot; frekvens. Rx vil være på den aktuelle frekvens, og CQ-meddelelsen vil indeholde den aktuelle Rx-frekvens, så modparten ved, hvilken frekvens der skal svares på. </p> <p> Ikke tilgængelig for ikke-standard kaldesignaler. </p> </body> </ html> - + Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. Not available to nonstandard callsign holders. Marker for at kalde CQ på "TX CQ" frekvens. Rx vil være på den aktuelle frekvens, og CQ-meddelelsen vil indeholde den aktuelle Rx-frekvens, så modparten ved, hvilken frekvens der skal svares på. Ikke tilgængelig for ikke-standard kaldesignaler. - + Rx All Freqs Rx Alle Frekv - + <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> <html><head/><body> <p> Submode bestemmer toneafstanden; A er det smalleste. </p> </body> </html> - + Submode determines tone spacing; A is narrowest. Submode bestemmer toneafstanden; A er det smalleste. - + Submode Submode - - + + Fox Fox - + + WSJT-X by K1JT et al. + + + + + Band Activity decode pane title + + + + + Title for the Band Activity decoded messages pane. + + + + + Band Activity decoded messages headings + + + + + + Columns: UTC dB DT Freq Message. + + + + + Band Activity decoded messages + + + + + Decoded messages in the Band Activity pane. Columns: UTC dB DT Freq Message. + + + + + Rx Frequency decode pane title + + + + + Title for the Rx Frequency decoded messages pane. + + + + + Rx Frequency decoded messages headings + + + + + Rx Frequency decoded messages + + + + + Decoded messages in the Rx Frequency pane. Columns: UTC dB DT Freq Message. + + + + + Check to display received messages in lower case. + + + + + Lower case + + + + + Include Time + + + + <html><head/><body><p>Check to monitor Sh messages.</p></body></html> <html><head/><body><p>Marker for at monitere Sh meddelser.</p></body></html> - + Check to monitor Sh messages. Marker for monitering af Sh meddelser. - + SWL SWL - + Best S+P Best S+P - + <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> <html><head/><body> <p> Marker dennee for at starte opsamling af kalibreringsdata. <br/> Mens måling af kalibreringskorrektion er visning deaktiveret. <br/> Når denne ikke er markeret, kan du se kalibreringsresultaterne. </p> </ body> </ html> - + Check this to start recording calibration data. While measuring calibration correction is disabled. When not checked you can view the calibration results. @@ -3214,44 +4362,49 @@ Mens foregår måling af kalibreringskorrektion er visning deaktiveret. Når den ikke er markeret, kan du se kalibreringsresultaterne. - + Measure Mål kalibrering - + + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the strongest station's reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the weakest station's reply to your CQ.</p><p>When CQ or QRZ is pending, Enable Tx may be armed before or during a receive period. Only eligible direct callers decoded after it is armed in that period can replace the pending transmission; earlier callers are not retained.</p></body></html> + + + + <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> <html><head/><body> <p> Signalrapport: Signal-til-støj-forhold i 2500 Hz referencebåndbredde (dB). </p> </body> </html> - + Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). Signalrapport: Signal-til-støj-forhold i 2500 Hz referencebåndbredde (dB). - + Report Rapport - + <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> <html><head/><body><p>Tx/Rx eller Frekvens kalibrerings sekvenslængde</p></body></html> - + Tx/Rx or Frequency calibration sequence length Tx/Rx eller Frekvens kalibrerings sekvenslængde</p></body></html> - - + + s s - - + + T/R T/R @@ -3264,18 +4417,20 @@ Når den ikke er markeret, kan du se kalibreringsresultaterne. Tx JT9@ - + + Audio Tx frequency Audio Tx frekvens - - + + + Tx TX - + Tx# TX# @@ -3284,12 +4439,12 @@ Når den ikke er markeret, kan du se kalibreringsresultaterne. <html><head/><body> <p> Dobbeltklik på et CQ opkald for at den pågældende kommer i kø til næste QSO. </p> </body> </html> - + F High F Høj - + F Low F Lav @@ -3302,158 +4457,154 @@ Når den ikke er markeret, kan du se kalibreringsresultaterne. Næste Kaldesignal - - - + + + 1 1 - - - + + + Send this message in next Tx interval Send denne meddelse i næste Tx periode - + Ctrl+2 Ctrl+2 - + <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> <html><head/><body> <p> Send denne meddelelse i næste Tx-interval </p> <p> Dobbeltklik for at skifte brug af Tx1-meddelelsen til at starte en QSO med en station (ikke tilladt for type 1 sammensatte opkald) </p> </body> </html> - + Send this message in next Tx interval Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) Send denne meddelelse i næste Tx-periode. Dobbeltklik for at skifte brug af Tx1-meddelelsen til at starte en QSO med en station (ikke tilladt for type 1 indehavere af sammensatte opkald) - + Ctrl+1 CTRL+1 - - - - + + + + Switch to this Tx message NOW Skift til denne Tx meddelse nu - + Tx &2 TX &2 - + Alt+2 Alt+2 - + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> html><head/><body> <p> Skift til denne Tx-meddelelse NU </p> <p> Dobbeltklik for at skifte brug af Tx1-meddelelsen til at starte en QSO med en station (ikke tilladt for type 1 sammensatte kaldesignaler) </p> </body> </html> - + Switch to this Tx message NOW Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) Skift til denne Tx meddelse NU Dobbelt klik for at skifte brug af Tx1 meddelse for at starte QSO med en station (ikke tilladt for type 1 sammensatte kaldesignaler) - + Tx &1 Tx &1 - + Alt+1 Alt+1 - + Ctrl+6 CTRL+6 - + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> <html><head/><body><p>Send denne meddelse i næste Tx periode</p><p>Dobbelt klik for at resette til standard 73 message</p></body></html> - + Send this message in next Tx interval Double-click to reset to the standard 73 message Send denne meddelse i næste Tx periode Dobbelt klik for at resette til standard 73 message - + Ctrl+5 Ctrl+5 - + Ctrl+3 CTRL+3 - + Tx &3 Tx &3 - + Alt+3 Alt+3 - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p> Send denne meddelelse i næste Tx periode </p> <p> Dobbeltklik for at skifte mellem RRR og RR73-meddelelser i Tx4 (ikke tilladt for type 2 sammensatte kaldesignaler)</p><p> RR73 meddelelser skal kun bruges, når du med rimelig sikkerhed er overbevist om, at der ikke kræves gentagne meddelelser</p></body></html> + <html><head/><body><p> Send denne meddelelse i næste Tx periode </p> <p> Dobbeltklik for at skifte mellem RRR og RR73-meddelelser i Tx4 (ikke tilladt for type 2 sammensatte kaldesignaler)</p><p> RR73 meddelelser skal kun bruges, når du med rimelig sikkerhed er overbevist om, at der ikke kræves gentagne meddelelser</p></body></html> - Send this message in next Tx interval Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - Send denne meddelelse i næste Tx-intervall + Send denne meddelelse i næste Tx-intervall Dobbeltklik for at skifte mellem RRR og RR73-meddelelser i Tx4 (ikke tilladt for type 2 sammensatte kaldesignaler) RR73-meddelelser skal kun bruges, når du med rimelig sikkerhed er overbevist om, at der ikke kræves gentagne meddelelser - + Ctrl+4 Ctrl+4 - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p> Skift til denne Tx-meddelelse NU</p><p>Dobbeltklik for at skifte mellem RRR og RR73-meddelelser i Tx4 (ikke tilladt for type2 sammensatte kaldesignaler)</p><p>RR73-meddelelser skal kun bruges, når du med rimelighed er overbevist om, at der ikke kræves gentagne meddelelser </p></body></html> + <html><head/><body><p> Skift til denne Tx-meddelelse NU</p><p>Dobbeltklik for at skifte mellem RRR og RR73-meddelelser i Tx4 (ikke tilladt for type2 sammensatte kaldesignaler)</p><p>RR73-meddelelser skal kun bruges, når du med rimelighed er overbevist om, at der ikke kræves gentagne meddelelser </p></body></html> - Switch to this Tx message NOW Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - Skift til denne Tx-meddelelse NU + Skift til denne Tx-meddelelse NU Dobbeltklik for at skifte mellem RRR og RR73-meddelelser i Tx4 (ikke tilladt for type2 sammensatte kaldesignaler) RR73-meddelelser skal kun bruges, når du med rimelig sikkerhed er overbevist om, at der ikke kræves gentagne meddelelser - + Tx &4 TX &4 - + Alt+4 Alt+4 @@ -3468,42 +4619,42 @@ Double-click to reset to the standard 73 message Dobbelt klik for at vende tilbage til standard 73 meddelse - + Tx &5 Tx&5 - + Alt+5 Alt+5 - + Now Nu - + Generate standard messages for minimal QSO Generer standard meddelse til minimal QSO - + Generate Std Msgs Generate Std Medd - + Tx &6 Tx&6 - + Alt+6 Alt+6 - + Enter a free text message (maximum 13 characters) or select a predefined macro from the dropdown list. Press ENTER to add the current text to the predefined @@ -3514,44 +4665,44 @@ Tryk på på Enter for indsætte teksten til makro listen. Makro listen kan også ændfres i Inderstillinger (F2). - + Queue up the next Tx message Sat i kø til næste Tx meddelse - + Next Næste - - - - - - + + + + + + 2 ? 2 - + FST4W FST4W - - + + Q65 Q65 - + SWL Mode SWL Mode - + Hide lower panel controls to maximize deocde windows Skjul nederste del af Control Panel for at maksimere dekoder vinduet @@ -3564,8 +4715,9 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). Generer CQ meddelse - - + + + CQ CQ @@ -3594,7 +4746,7 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). Generer meddelse som svar på et CQ - + Grid Grid @@ -3631,10 +4783,10 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). Fri medd - - - - + + + + 3 3 @@ -3643,133 +4795,133 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). Maks dB - + CQ AF CQ AF - + CQ AN CQ AN - + CQ AS CQ AS - + CQ EU CQ EU - + CQ NA CQ NA - + CQ OC CQ OC - + CQ SA CQ SA - + CQ 0 CQ 0 - + CQ 1 CQ 1 - + CQ 2 CQ 2 - + CQ 3 CQ 3 - + CQ 4 CQ 4 - + CQ 5 CQ 5 - + CQ 6 CQ 6 - + CQ 7 CQ 7 - + CQ 8 CQ 8 - + CQ 9 CQ 9 - + Reset Reset - + N List N Liste - + N Slots N slots - - - - - - - + + + + + + + Random Tilfældig - + Call Kaldesignal - + S/N (dB) S/N (dB) - + Distance Distance - + More CQs Flere CQ @@ -3778,1248 +4930,1424 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). Procen af en 2 minutters sekvens dedikeret til sending. - - + + % % - + Tx Pct Tx Pct - + Band Hopping Bånd hopping - + Choose bands and times of day for band-hopping. Vælg bånd og tid på dagen for Bånd-Hopping. - + Schedule ... Tidskema ... - + 1/2 1/2 - + 40 40 - - - + + + 10 10 - + 17 17 - + 60 60 - - + + 12 12 - + 160 160 - + 20 20 - + 80 80 - - + + 70 70 - + 15 15 - + 30 30 - - - - + + + + 6 6 - + 24G 24G - + 10G 10G - + 5G 5G - - - + + + 9 9 - + 13 13 - + 23 23 - + 33 33 - + 1.25 1.25 - - + + 4 4 - - + + 8 8 - + CQ messages only. Kun CQ msg. - + Bypass Filters toggled via Settings or the Filters menu. Bypass Filter toggled via Indstillinger eller i Filterr menu. - + BP BP - + <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> <html><head/><body><p>Slå monitorering til/fra. <br>Gul ved lagring af .wav-filer.</p></body></html> - + Avg Avg - + <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> <html><head/><body><p>Slå en ren Tx-tone til/fra <br>Højreklik for at Tune Radioen</p></body></html> - + <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> <html><head/><body><p>Slå Vent og Call til/fra. Højreklik for at rydde feltet DX-Call.</p></body></html> - + <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> <html><head/><body><p>Søg efter kaldesignal i databasen. <br>Højreklik søger efter kaldesignal på QRZ.com.</p></body></html> - + <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> <html><head/><body><p>Tilføj kaldesignal og locator til databasen. <br>Højreklik søger efter kaldesignal på hamqth.com.</p></body></html> - + <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> <html><head/><body><p>Sæt kaldesignal på ignorer slisten.<br>Højreklik søger efter kaldesignal på qrzcq.com.</p></body></html> - + Ignore Ignorer - + Pwr Pwr - <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the the strongest station's reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the the weakest station's reply to your CQ. </p></body></html> - <html><head/><body><p>Vælg <span style=" font-weight:600;">CQ: Ingen</span> for at vælge kaldere manuelt.</p><p>Vælg <span style=" font-weight:600;">CQ: Første</span> for at svare automatisk på det første afkodede svar på din CQ. </p><p>Vælg <span style=" font-weight:600;">CQ: Maks. Afst.</span> for at svare automatisk på det svar, der giver flest point i ARRL International Digital Contest, eller generelt på den fjerneste station, hvis dens besked har en gyldig Grid.</p><p>Vælg <span style=" font-weight:600;">CQ: Maks. dB</span> for at svare automatisk på den kraftigeste stations svar på dit CQ. </p><p>Vælg <span style=" font-weight:600;">CQ: Min. dB</span> for at svare automatisk på den svageste stations svar på dit CQ. </p></body></html> + <html><head/><body><p>Vælg <span style=" font-weight:600;">CQ: Ingen</span> for at vælge kaldere manuelt.</p><p>Vælg <span style=" font-weight:600;">CQ: Første</span> for at svare automatisk på det første afkodede svar på din CQ. </p><p>Vælg <span style=" font-weight:600;">CQ: Maks. Afst.</span> for at svare automatisk på det svar, der giver flest point i ARRL International Digital Contest, eller generelt på den fjerneste station, hvis dens besked har en gyldig Grid.</p><p>Vælg <span style=" font-weight:600;">CQ: Maks. dB</span> for at svare automatisk på den kraftigeste stations svar på dit CQ. </p><p>Vælg <span style=" font-weight:600;">CQ: Min. dB</span> for at svare automatisk på den svageste stations svar på dit CQ. </p></body></html> - - + + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> <html><head/><body><p>Marker for Tx i lige minutter eller sekvenser, startende ved 0; fjern markeringen for ulige sekvenser. Højreklik for at låse afkrydsningsfeltets tilstand. Højreklik på enten FT8- eller MSK-knappen for at låse op.</p></body></html> - + <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> <html><head/><body><p>Skift til T/R 15 s og Submode C.</p></body></html> - + 15C 15C - + <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> <html><head/><body><p>Skift til T/R 15 s og Submode A.</p></body></html> - + 15A 15A - + <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> <html><head/><body><p>Skift til T/R 60 s og Submode B.</p></body></html> - + 30B 30B - + <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> <html><head/><body><p>Skift til T/R 60 s og Submode C.</p></body></html> - + 60C 60C - + <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> <html><head/><body><p>Skift til T/R 60 s og Submode D.</p></body></html> - + 60D 60D - + <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> <html><head/><body><p>Skift til T/R 60 s og Submode E.</p></body></html> - + 60E 60E - - + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> <html><head/><body><p>Skift til denne Tx-msg NU</p><p>Dobbeltklik for at nulstille til standard 73-msg</p><p>Højreklik for at bevare Tx5-free tekst</p></body></html> - + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> <html><head/><body><p>Send en Free tekstbesked så snart det er muligt.</p></body></html> - + Send msg Send msg - + <html><head/><body><p>Enter a free text message.</p></body></html> <html><head/><body><p>Indtast en free tekstbesked.</p></body></html> - + Free Text Free Tekst - + <html><head/><body><p>Select a specific CQ message.</p></body></html> <html><head/><body><p>Vælg en specifik CQ-msg.</p></body></html> - + Queue Kø - + Allow Dupes Tillad Dupletter - + <html><head/><body><p>Clear all queues.</p></body></html> <html><head/><body><p>Ryd alle køer.</p></body></html> - + <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> <html><head/><body><p>Maksimalt antal kaldesignaler, der skal vises i køen.</p></body></html> - + <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> <html><head/><body><p>Vælg en ønsket sorteringsrækkefølge for kaldesignaler i køen.</p></body></html> - + Age Alder - + Continent Kontinent - + Score Score - + <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> <html><head/><body><p>Medtag CQ-beskeder sammen med andre beskeder.</p></body></html> - + In Progress I Gang - + <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> <html><head/><body><p>Maksimalt antal samtidige streams for Fox-transmissioner.</p></body></html> - + 70cm FT8 70cm FT8 - + 70cm 70cm - + 30m FT8 30m FT8 - + 30m 30m - + <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> <html><head/><body><p>Slå båndhop til/fra. Båndhop sker hvert andet hele minut. Ændringer i afkrydsningsfelterne træder i kraft med det samme.<br/>Højreklik for at skifte til den næste valgte båndhop frekvens eller for at teste standardlyd enheden, når båndhop er deaktiveret.</p></body></html> - + Band Hopping Bånd Hop - + 12m FT8 12m FT8 - + 12m 12m - + 40m FT8 40m FT8 - + 40m 40m - + 2m MSK144 2m MSK144 - + 2m MSK 2m MSK - + 10m FT8 10m FT8 - + 10m 10m - + 6m FT8 6m FT8 - + 6m 6m - + 60m FT8 60m FT8 - + 60m 60m - + 160m FT8 160m FT8 - + 160m 160m - + 80m FT8 80m FT8 - + 80m 80m - + 20m FT8 20m FT8 - + 20m 20m - + 17m FT8 17m FT8 - + 17m 17m - + 4m FT8 4m FT8 - + 4m 4m - + 15m FT8 15m FT8 - + 15m 15m - + 2m FT8 2m FT8 - + 2m 2m - - + + 10m FT4 10m FT4 - - + + 12m FT4 12m FT4 - - + + 15m FT4 15m FT4 - - + + 17m FT4 17m FT4 - - + + 20m FT4 20m FT4 - - + + 30m FT4 30m FT4 - - + + 40m FT4 - - + + 80m FT4 80m FT4 - + FT8 QRG6 FT8 QRG6 - + FT8 QRG1 FT8 QRG1 - + FT8 QRG2 FT8 QRG2 - + FT8 QRG7 FT8 QRG7 - + FT8 QRG8 in kHz. FT8 QRG8 i Khz. - + FT8 QRG5 FT8 QRG5 - + FT8 QRG3 FT8 QRG3 - + FT8 QRG4 FT8 QRG4 - + FT8 QRG8 FT8 QRG8 - + FT8 QRG7 in kHz. FT8 QRG7 i Khz. - + FT8 QRG6 in kHz. FT8 QRG6 i Khz. - + FT8 QRG5 in kHz. FT8 QRG5 i Khz. - + FT8 QRG4 in kHz. FT8 QRG4 i Khz. - + FT8 QRG3 in kHz. FT8 QRG3 i Khz. - + FT8 QRG2 in kHz. FT8 QRG2 i Khz. - + FT8 QRG1 in kHz. FT8 QRG1 i Khz. - + + GroupBox + + + + + CQ %M CQ + + + + + %H 599 %N + + + + + %H TU CQ %M CQ + + + + + %M + + + + + %H + + + + + TU NOW %Q 599 %N + + + + + %H AGN? + + + + + 599 %N + + + + + F1 + F1 + + + + HisCall Exchange + + + + + TU CQ + + + + + F3 + F3 + + + + MyCall + + + + + F4 + F4 + + + + HisCall + + + + + F5 + F5 + + + + Now QueuedCall Exchange + + + + + F6 + F6 + + + + HisCall AGN ? + + + + + Exchange + + + + + Serial number of QSO for contest exchange. + + + + + Click to transmit a message. + + + + + Send message + + + + + Call next + + + + + Message to be transmitted + + + + + Serial Number + + + + + Callsign to be worked next. + + + + 2/2 2/2 - + 1/3 1/3 - + 2/3 2/3 - + 3/3 3/3 - + 1/4 1/4 - + 2/4 2/4 - + 3/4 3/4 - + 4/4 4/4 - + 1/5 1/5 - + 2/5 2/5 - + 3/5 3/5 - + 4/5 4/5 - + 5/5 5/5 - + 1/6 1/6 - + 2/6 2/6 - + 3/6 3/6 - + 4/6 4/6 - + 5/6 5/6 - + 6/6 6/6 - + Upload decoded messages to WSPRnet.org. Uoload dekodet meddelser til WSPRnet.org. - + Upload spots Upload spots - + <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> <html><head/><body><p>6-cifrede locatorer kræver 2 forskellige meddelelser for at blive sendt, den anden indeholder den fulde locator, men kun et hashet kaldesignal. Andre stationer skal have dekodet den første gang, før de kan dekode dit kaldesignal i den anden meddelse. Marker denne indstilling for kun at sende 4-cifrede locatorer, hvis den vil undgå to meddelelsesprotokollen.</p></body></html> - + 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. 6 cifrede locatorer kræver 2 forskellige meddelelser for at blive sendt, den anden indeholder den fulde locator, men kun et hashet kaldesignal. Andre stationer skal have dekodet den første gang, før de kan dekode dit kaldesignal i den anden meddelse. Marker denne indstilling for kun at sende 4-cifrede locatorer, hvis du vil undgå to meddelelses protokollen. - + Spacing Afstand - + Fixed Tone Fast Tone - + K1JT K1JT - + CW CW - + Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. Slå FT8 Hound mode til/fra.<br>Højreklik for at aktivere eller deaktivere SuperFox mode. - + H H - + Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. Skift til FT8-tils mode.<br>Højreklik for at slå den sidst brugteContest mode til/fra. - + Switch to FT4 mode Skift til FT4 mode - + Switch to MSK144 mode Skift til MSK144 mode - + MSK MSK - + <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> <html><head/><body><p>Skift til Q65-mode.<br> Højreklik for at skifte til Q65 Pileup-mode.</p></body></html> - + <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> <html><head/><body><p>Skift til JT65-mode. <br>Højreklik for at skifte til JT9-mode.</p></body></html> - + <html><head/><body><p>Switch to Echo mode</p></body></html> <html><head/><body><p>Skift til Echo mode</p></body></html> - + Filters Filtre - + Parameters Parametre - + Decoder sensitivity Dekoder følsomhed - + Decoder start Dekoder start - + Number of threads Antal tråde - + QSO RX freq sensitivity QSO RX frekv følsomhed - + Decoding cycles Dekodede cycles - + + Ctrl+X + + + + + Alt+X + + + + Remove saved files after 30 days Fjern gemte filer efter 30 dage - + Erase wsjtx.log Slet wsjtx.log - + Erase Ignore List Slet Ignore liste - + Quick-Start Guide to FST4 and FST4W Quick Start Guide for FST4 og FST4W - + FST4 FST4 - + Don't split ALL.TXT Del ikke ALL.TXT - + Split ALL.TXT yearly Del ALL.TXT årligt - + Split ALL.TXT monthly Del ALL.TXT månedsvis - + Disable writing of ALL.TXT Disbable skrivning til ALL.TXT - + Active Stations Aktive Stationer - + Band Buttons Bånd Knapper - + Use Dark Style Brug Dark Style - + Reduce false decodes Reducer falske dekodninger - + Default event logging Default event logging - + Diagnostic mode Diagnostik mode - + Disable event logging Disable event logging - + Quick-Start Guide to WSJT-X 2.7 and QMAP Quick-Start Guide til WSJT-X 2.7 og QMAP - - WSJT-X_improved Home Page - WSJT-X_improved Hjemmeside + + Download EME Ephemeris Chart + - - <html><head/><body><p>Go to the wsjt-x_improved home page.</p></body></html> - <html><head/><body><p>Gå til wsjt-x_improved-hjemmesiden.</p></body></html> + + Hide AP information + - - The additional features of wsjt-x_improved - De ekstra funktioner i wsjt-x_improved + + <html><head/><body><p>Hide AP information</p></body></html> + - - <html><head/><body><p>Overview on the additional features of wsjt-x_improved.</p></body></html> - <html><head/><body><p>Oversigt over de ekstra funktioner i wsjt-x_improved.</p></body></html> + + Highlight Whitelist entries + + + + + JTTY + - Recommended audio settings - Anbefalede Audio indstillinger + Anbefalede Audio indstillinger - <html><head/><body><p>Recommended Audio Settings.</p></body></html> - <html><head/><body><p>Anbefalede lydindstillinger.</p></body></html> + <html><head/><body><p>Anbefalede lydindstillinger.</p></body></html> - + How to deal with rig control errors Sådan håndterer du fejl i radiostyringen - + <html><head/><body><p>How to deal with rig control errors.</p></body></html> <html><head/><body><p>Sådan håndteres fejl i forbindelse med radiostyring.</p></body></html> - + Erase list of Q65 callers Slet liste med Q65 kaldere - + SuperFox User Guide SuperFox User Guide - + Message Creator Message Creator - + Hide stations worked before on band Skjul stationer kørt på båndet - + Hide stations worked today or yesterday Skjul stationer kørt i dag eller igår - + Hide stations from Ignore List Skjul stationer på Ignore listen - + Ignore stations worked today or yesterday Ignorer stationer, kørt i dag eller i går - + Ignore stations from Ignore List Ignorer stationer fra ignorer listen - + Hide stations from Territory 1 Skjul stationer fra område 1 - + Hide stations from Territory 2 Skjul stationer fra område 2 - + Hide stations from Territory 3 Skjul stationer fra område 3 - + Hide stations from Territory 4 Skjul stationer fra område 4 - + Hide stations from Europe Skjul stationer fra Europa - + Hide stations from North America Skjul stationer fra Nord Amerika - + Hide stations from South America Skjul stationer fra Sydamerika - + Hide stations from Asia Skjul stationer fra Asien - + Hide stations from Africa Skjul stationer fra Afrika - + Hide stations from Oceania Skjul stationer fra Oceanien - + Hide stations from Antarctica Skjul stationer fra Antarktis - + Full Duplex Mode Fuld Duplex mode - + Highlight callsigns worked before on band Fremhævede kaldesignaler kørt før på båndet - + Highlight callsigns worked today or yesterday Fremhævede kaldesignaler kørt i dag eller i går - + Highlight callsigns from Ignore List Fremhæv kaldesignaler fra ignore listen - + Enable Message Popups Enable _Msg Popup - + QSY Monitor QSY Monitor - + Ignore stations worked before on band Ignorer stationer kørt før på båndet - + Use multithreaded FT8 decoder Brug multitrådet FT8-dekoder - + Auto Auto - - + + 5 5 - - + + 7 7 - - + + 11 11 - + Low Lav - + Medium Medium - + High Høj - + Minimum Minimum - + Use low thresholds Brug lave tærskler - + Use subpass Brug subpass - + 2-Stage 2 trins - + 3-Stage 3 trins - + Early Tidlig - + Late Sent - + Wideband DX Call search Bred DX Call søgning - + Hide FT8 dupe messages Skjul FT8 Duplet msg - + VHF / UHF Buttons VHF /UHF knapper - + Highlight stations from Territory 1 Fremhæv stationer fra område 1 - + Highlight stations from Territory 2 Fremhæv stationer fra område 2 - + Highlight stations from Territory 3 Fremhæv stationer fra område 3 - + Highlight stations from Territory 4 Fremhæv stationer fra område 4 - + Disable clicks on waterfall Disable klik på Vandfaldet @@ -5032,7 +6360,7 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). Fortrækker type 1 meddelse - + No own call decodes Ingen dekodning af eget kaldesignal @@ -5041,156 +6369,158 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). Tx i den næste 2 minutters sekvens. - + Tx Next Tx Næste - + Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. Indsæt Tx power i dBm (dB over 1mW) som en del af WSPR meddelse. - + NB NB - + File Fil - + View Vis/Se - + Decode Dekod - + Save Gem - + Help Hjælp - + + Mode Mode - + Configurations Konfiguration - + Tools Værktøjer - + Exit Afslut + Configuration - Konfiguiration + Konfiguiration + F2 - F2 + F2 - + About WSJT-X Om WSJT-X - + Waterfall Vandfald - + Open Åbne - + Ctrl+O Ctrl+o - + Open next in directory Åben den næste i mappe - + Decode remaining files in directory Dekod resterende filer i mappen - Shift+F6 - Shift+F6 + Shift+F6 - + Delete all *.wav && *.c2 files in SaveDir Slet alle *.wav && *.c2 filer i mappen Gemt - + None Ingen - + Save all Gem alt - + Online User Guide Online Bruger Manual - + Keyboard shortcuts Tastetur genveje - + Special mouse commands Specielle muse kommandoer - + JT9 JT9 - + Save decoded Gem dekodet - - + + Normal Normal - + Deep Dybt @@ -5199,12 +6529,12 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). Monitor OFF ved start - + Erase ALL.TXT Slet ALL.TXT - + Erase wsjtx_log.adi Slet wsjtx_log.adi @@ -5237,7 +6567,7 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). Dobbelt-klik på et kaldesignal for at sætte TX ON - + F7 F7 @@ -5254,8 +6584,8 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). Tx frekv låst til Rx frekv - - + + JT65 JT65 @@ -5276,148 +6606,147 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). Vis DXCC og Worked B4 status - + Astronomical data Astronomi data - + List of Type 1 prefixes and suffixes Liste over Type 1 prefix og suffix - + Settings... Indstillinger... - + Local User Guide Lokal User Manual - + Open log directory Åben Logfil mappe - + JT4 JT4 - + Message averaging Meddelse gennemsnit - + Enable averaging Aktiver gennemsnit - + Enable deep search Aktiver Dyb dekodning - + WSPR WSPR - + Echo Graph Ekko graf - + F8 F8 - - + + Echo Ekko - + EME Echo mode EME Ekko mode - + ISCAT ISCAT - + Fast Graph Fast Graph - F9 - F9 + F9 - + &Download Samples ... &Download eksempler ... - + <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> <html><head/><body><p>Download audio filer eksempler som demonstrerer de forskellige modes.</p></body></html> - + MSK144 MSK144 - + QRA64 QRA64 - + Release Notes Release Notes - + Enable AP for DX Call Aktiver AP for DX kaldesignal - + FreqCal FrekvCal - + Measure reference spectrum Måler reference spectrum - + Measure phase response Måler fase response - + Erase reference spectrum Slet reference spektrum - + Execute frequency calibration cycle Kør en frekvens kalibrerings sekvens - + Equalization tools ... Equalization værktøjer ... @@ -5430,49 +6759,49 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). Eksperimental LF/MF mode - - + + FT8 FT8 - - + + Enable AP Aktiver AP - + Solve for calibration parameters Løs for kalibrerings parametre - + Copyright notice Copyright notits - + Shift+F1 Shift+F1 - + Fox log Fox Log - + FT8 DXpedition Mode User Guide FT8 DXpedition Mode bruger guide - + Reset Cabrillo log ... Reset Cabrillo log ... - + Color highlighting scheme Farve skema @@ -5481,7 +6810,7 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). Contest Log - + Export Cabrillo log ... Eksporter Cabrillo log ... @@ -5490,35 +6819,35 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). Quick-Start Guide til WSJT-X 2.0 - + Contest log Contest log - + Erase WSPR hashtable Slet WSPR Hash tabel - - + + FT4 FT4 - + Rig Control Error Radio kontrol fejl - - - + + + Receiving Modtager - + Do you want to reconfigure the radio interface? Vil du rekonfigurere radio interface? @@ -5544,183 +6873,200 @@ listen. Makro listen kan også ændfres i Inderstillinger (F2). For stort tab i - %1 (%2 sec) audio frames stoppet i periode startende %3 - + Error Scanning ADIF Log Fejl ved scanning af Adif Log - + Scanned ADIF log, %1 worked-before records created. CTY: %2 Scannet ADIF log, %1 worked B4 oprettede poster - + Error Loading LotW Users Data Fejl ved indlæsning af LotW bruger Data - + + + + Decoder Error + + + + + The decoder subprocess exited unexpectedly. + + + + + jt9 exited unexpectedly with code %1. + + + + + Error Writing WAV File Fejl ved skrivning af WAV Fil - + Enumerating audio devices Opsumering af audio enheder - + Configurations... Konfigurationer... - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Message Meddelse - + Error Killing jt9.exe Process Fejl ved lukning af jt9.exe processen - + KillByName return code: %1 KillByName return code: %1 - + Error removing "%1" Fejl ved fjernelse af "%1" - + Click OK to retry Klik OK for at prøve igen - - + + %1.wav: invalid sample count %2 + + + + + Improper mode Forkert mode - - + + File Open Error Fejl ved åbning af fil - - - - - + + + + + Cannot open "%1" for append: %2 Kan ikke åbne "%1" for at tilføje: %2 - + Error saving c2 file Fejl da c2 fil skulle gemmes - + Error in Sound Input Fejl i Audio input - + Error in Sound Output Fejl i Audio output - - + + Single-Period Decodes Enkel-Periode Dekodning - - + + Average Decodes Gennemsnitlig dekodning - + Change Operator Skift Operatør - + New operator: Ny Operatør: - + Status File Error Fejl i status Fil - - + + Cannot open "%1" for writing: %2 Kan ikke åbne "%1" for at skrive: %2 - + Decodes containing My Call Dekodet inholdende Mit Call - + Subprocess Error Underprocess fejl - + Subprocess failed with exit code %1 Underprocess fejlede med fejlkode %1 - - + + Running: %1 %2 Kører: %1 %2 - + Subprocess error Underprocess fejl - Reference spectrum saved - Reference spectrum gemt + Reference spectrum gemt - It is very important to avoid audio harmonics and distorted audio signals. This is usually achieved by the following step-by-step approach: @@ -5744,7 +7090,7 @@ This is usually achieved by the following step-by-step approach: If possible, check your transmission from time to time with a webSDR to ensure the signal is clean and not distorted. - Det er meget vigtigt at undgå harmoniske og forvrængede signaler. + Det er meget vigtigt at undgå harmoniske og forvrængede signaler. Dette opnås normalt ved følgende trinvise fremgangsmåde: @@ -5766,22 +7112,21 @@ Hold altid Pwr-skyderen under denne maksimale værdi. Hvis det er muligt, så tjek din transmission fra tid til anden med en webSDR for at sikre, at signalet er rent og ikke forvrænget. - <b>Recommended Audio Settings</b> - <b>Anbefalede lydindstillinger</b> + <b>Anbefalede lydindstillinger</b> - + Invalid data in fmt.all at line %1 Forkert data i fmt.all ved linje %1 - + Good Calibration Solution God Kalibrerings løsning - + <pre>%1%L2 ±%L3 ppm %4%L5 ±%L6 Hz @@ -5794,26 +7139,24 @@ Hvis det er muligt, så tjek din transmission fra tid til anden med en webSDR fo %9%L10 Hz</pre> - + Delete Calibration Measurements Slet Kalibrerings måling - + The "fmt.all" file will be renamed as "fmt.bak" Filen fmt.all vil blive omdøbt til "fmt.bak" - If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: "The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2025 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; and other members of the WSJT Development Group." - Hvis du bruger noget af eller en del af WSJT-X i henhold til GNU General Public License, skal du vise følgende copyright-meddelelse fremtrædende sted i det du udgiver: + Hvis du bruger noget af eller en del af WSJT-X i henhold til GNU General Public License, skal du vise følgende copyright-meddelelse fremtrædende sted i det du udgiver: "Algoritmerne, kildekoden, udseendet og følelsen af ​​WSJT-X og relaterede programmer samt protokolspecifikationerne for disse modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 er Copyright (C) 2001-2025 af en eller flere af følgende forfattere: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; og andre medlemmer af WSJT Development." Gruppe." - <table cellspacing=1> <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> @@ -5864,7 +7207,7 @@ Hvis det er muligt, så tjek din transmission fra tid til anden med en webSDR fo </table> Keyboard shortcuts help window contents - <table cellspacing=1> + <table cellspacing=1> <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> @@ -5915,7 +7258,6 @@ Hvis det er muligt, så tjek din transmission fra tid til anden med en webSDR fo </table> - <table cellpadding=5> <tr> <th align="right">Click on</th> @@ -6028,7 +7370,7 @@ Hvis det er muligt, så tjek din transmission fra tid til anden med en webSDR fo </tr> </table> Mouse commands help window contents - <table cellpadding=5> + <table cellpadding=5> <tr> <th align="right">Click on</th> <th align="left">Action</th> @@ -6141,23 +7483,425 @@ Hvis det er muligt, så tjek din transmission fra tid til anden med en webSDR fo </table> - - Please choose another dial frequency. -Must be 3Khz away from %1. -WSJT-X will not operate in Fox mode -overlapping the standard FT8 sub-bands. - Vælg venligst en anden Tx-frekvens. -Skal være 3 kHz væk fra %1. -WSJT-X fungerer ikke i Fox-mode -da der overlappes med standard FT8-frekvenserne. + + Please choose another dial frequency. +Must be 3Khz away from %1. +WSJT-X will not operate in Fox mode +overlapping the standard FT8 sub-bands. + Vælg venligst en anden Tx-frekvens. +Skal være 3 kHz væk fra %1. +WSJT-X fungerer ikke i Fox-mode +da der overlappes med standard FT8-frekvenserne. + + + + %1 shorthand-message mode + + + + + RR73 is not available in %1. Tx4 uses RRR in this mode. + + + + + Wait & Pounce requires a CQ response mode. +Change CQ: None to another option. + + + + + DX call + + + + + Callsign of station to be worked. + + + + + DX grid + + + + + Locator of station to be worked. + + + + + Wait and Call + + + + + Lookup DX call + + + + + Add DX call + + + + + Ignore DX call + + + + + CQ response mode + + + + + Selects a station automatically from replies to your pending CQ after Enable Tx is armed in the current receive period, or from CQ messages for Wait & Pounce. + + + + + Transmit audio frequency + + + + + Receive audio frequency + + + + + Signal report + + + + + Operating band + + + + + Operating band text + + + + + Transmit power attenuation + + + + + Adjust Tx audio level attenuation. + + + + + Show or hide the menu bar. + + + + + Rig control status + + + + + Hound mode + + + + + Toggle FT8 hound mode. Right-click to toggle SuperFox mode. + + + + + Message panel selector + + + + + Switches between standard messages, Fox queue, and band hopping pages. Press 1, 2, or 3 while focused to select a page. + + + + + Standard messages + + + + + Fox queue + + + + + + Band hopping + + + + + Standard messages page + + + + + Fox queue page + + + + + Band hopping page + + + + + Hound queue + + + + + Queued Hound callers available for Fox transmissions. + + + + + Fox transmissions in progress + + + + + Hound callers currently in progress for Fox transmissions. + + + + + Hound queue sort order + + + + + Hound queue list size + + + + + Fox transmission slots + + + + + Fox CQ message + + + + + Reset Fox queues + + + + + Fox free text + + + + + Send Fox free text + + + + + Enable FT8 QRG 1 + + + + + Enable FT8 QRG 2 + + + + + Enable FT8 QRG 3 + + + + + Enable FT8 QRG 4 + + + + + Enable FT8 QRG 5 + + + + + Enable FT8 QRG 6 + + + + + Enable FT8 QRG 7 + + + + + Enable FT8 QRG 8 + + + + + FT8 QRG 1 frequency + + + + + FT8 QRG 2 frequency + + + + + FT8 QRG 3 frequency + + + + + FT8 QRG 4 frequency + + + + + FT8 QRG 5 frequency + + + + + FT8 QRG 6 frequency + + + + + FT8 QRG 7 frequency + + + + + FT8 QRG 8 frequency + + + + + Tx1 message + + + + + Tx2 message + + + + + Tx3 message + + + + + Tx4 message + + + + + Tx5 message macro + + + + + Tx6 message + + + + + Tx5 message macro text + + + + + Select Tx1 for next transmission + + + + + Select Tx2 for next transmission + + + + + Select Tx3 for next transmission + + + + + Select Tx4 for next transmission + + + + + Select Tx5 for next transmission + + + + + Select Tx6 for next transmission + + + + + Transmit Tx1 now + + + + + Transmit Tx2 now + + + + + Transmit Tx3 now + + + + + Transmit Tx4 now + + + + + Transmit Tx5 now + + + + + Transmit Tx6 now + + + + + All Decodes + + + + + QSO Frequency + - + %1 W %1 W - + SWR > 2.5 !!! Transmission was stopped @@ -6170,59 +7914,132 @@ Transmissionen blev stoppet Tjek din antenne - + + + Stop transmitting or tuning before changing the dial frequency. + + + + + + Measuring reference spectrum: %1 s remaining + + + + + Reference spectrum measurement stopped; Ref Spec is available + + + + + Reference spectrum saved; Ref Spec is available + + + + + Reference spectrum measurement stopped; no reference spectrum is available + + + + + Cannot remove "%1": %2 + + + + WD:0m WD:0m - + Runaway Tx watchdog Runaway Tx watchdog - + WD:%1m WD:%1m - - + + + Free Text Message Free Tekst Msg - - + + Message: Message: - + Directional calls not yet supported in SuperFox mode Styret Call understøttes endnu ikke i SuperFox-tilstand - + TOTP: No seed entered in fox configuration to generate verification code. TOTP: Ingen seed indtastet i Fox-konfigurationen for at generere bekræftelseskode. - + + SuperFox cannot queue %1: unsupported callsign. + + + + TOTP SF: seed not long enough. TOTP SF: seed ikke langt nok. - + + SuperFox Tx stopped: invalid message tokens. + + + + + SuperFox Tx stopped: invalid verification code. + + + + + SuperFox Tx stopped: invalid CQ call or grid. + + + + + SuperFox Tx stopped: invalid callsign. + + + + + SuperFox Tx stopped: report is outside the SuperFox range. + + + + + SuperFox Tx stopped: free text contains unsupported characters. + + + + + SuperFox Tx stopped: message could not be packed. + + + + Are you sure you want to erase the Tx Log? Er du sikker på du vil slette Tx Loggen? - + "%1" added to Ignore List "%1" tilføjet til ignore listen - + Are you sure you want to erase the Ignore List? Er du sikker på du vil slette Ignore Listen? @@ -6242,22 +8059,22 @@ Tjek din antenne "Algoritmerne, kildekoden, udseendet og funktionen af ​​WSJT-X og relaterede programmer og protokolspecifikationer for Mode FSK441, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, ISCAT, MSK144 er Copyright (C) 2001-2021 af en eller flere af følgende forfattere: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; og andre medlemmer af WSJT Development Group. " - + No data read from disk. Wrong file format? Ingen data indlæst. Forkert fil format? - + Confirm Delete Bekræft sletning - + Are you sure you want to delete all *.wav and *.c2 files in "%1"? Er du sikker på du vil slette alle *.wav og *.c2 filer i "%1"? - + Keyboard Shortcuts Tastetur Genveje @@ -6455,7 +8272,7 @@ Tjek din antenne </table> - + Special Mouse Commands Specielle muse kommandoer @@ -6525,23 +8342,21 @@ Tjek din antenne </table> - + No more files to open. Ikke flere filer at åbne. - - Spotting to PSK Reporter unavailable - Afsendelse af Spot til PSK Reporter ikke muligt + Afsendelse af Spot til PSK Reporter ikke muligt - + Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. Venligst vælg en ande Tx frekvens. WSJT-X vil ikke sende med en anden Mode i WSPR området på 30m. - + WSPR Guard Band WSPR Guard bånd @@ -6550,13 +8365,12 @@ Tjek din antenne Vælg venligst en anden VFO frekvens. WSJT-x vil ikke operere med Fox mode i standard FT8 områder - - + Fox Mode warning Fox Mode advarsel - + Please choose another dial frequency. WSJT-X will not operate in Fox mode overlapping the WSPR sub-bands. @@ -6565,12 +8379,132 @@ WSJT-X fungerer ikke i Fox-tilstand da den valgte frekvens overlapper med WSPR-båndet. - + + The decoder subprocess could not be stopped. + + + + + The decoder subprocess could not be restarted. + + + + + Application status + + + + + Current WSJT-X status messages and operating indicators. + + + + + Transmit status + + + + + Decode count + + + + + Last transmitted message + + + + + Power and SWR status + + + + + Decode progress + + + + + Progress for the current decode operation. + + + + + Transmit watchdog + + + + + The selected transmit message cannot be encoded. Enable Tx has been turned off. Edit the selected message or check station settings before trying again. + + + + + Tx message cannot be encoded; Enable Tx is off + + + + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2026 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; Roger Rehr, W3SZ; John Nelson, G4KLA; Charlie Suckling, DL3WDG; Terrell Deppe, KJ5HST; and other members of the WSJT Development Group." + + + + + EME Chart + + + + + Select Year + + + + + FT8 input completion was rejected: automated=%1 awaiting=%2 frames=%3. + + + + + Unable to flush the final FT8 downsampling block. + + + + + FT8 input completed with %1 of %2 samples in the decode buffer. + + + + + FT8 decoding is running behind; early passes are temporarily reduced. + + + + + FT8 decoding caught up; configured early passes restored. + + + + + + PSK Reporter spot queue full; oldest spot dropped + + + + Last Tx: %1 Senest Tx: %1 - + + A QSO between two stations with nonstandard callsigns won't work. + +Auto Seq would get stuck in an endless loop. + + + + This station transmits in the same time slot as you do. You must not start a QSO if both stations Tx even/1st @@ -6585,7 +8519,7 @@ Du må ikke starte en QSO, hvis begge stationer sender lige/1. eller ulige/2., m Klik på MSK144-mode for at genaktivere afkrydsningsfeltet Tx lige/1., eller vælg en anden station. - + Should you switch to EU VHF Contest mode? To do so, check 'Special operating activity' and @@ -6596,143 +8530,154 @@ For at gøre dette skal du markere 'Speciel aktivitet' og 'EU VHF-Contest' på indstillingerne | Avanceret fane. - + Should you switch to ARRL Field Day mode? Bør du skifte til ARRL Field Day mode? - + Should you switch to RTTY contest mode? Bør du skifte til RTTY Contest mode? - - - - + + + Decoder is starting; decode request skipped. + + + + + + + Add to CALL3.TXT Tilføj til CALL3.TXT - + Please enter a valid grid locator Indsæt en gyldig Grid lokator - + Cannot open "%1" for read/write: %2 Kan ikke åbne "%1" for Læse/Skrive: %2 - + %1 is already in CALL3.TXT, do you wish to replace it? %1 er allerede i CALL3.TXT. Vil du erstatte den? - + Warning: DX Call field is empty. Advarsel: DX Call feltet er tomt. - + + SuperFox free text may only contain spaces, digits, uppercase letters, and + - . / ?. + + + + Log file error Log fil fejl - + Cannot open "%1" Kan ikke åbne "%1" - + Error sending log to N1MM Fejl ved afsendelse af log til N1MM - + Write returned "%1" Skrivning vendte tilbage med "%1" - + Stations calling DXpedition %1 Stationer som kalder DXpedition %1 - + Show Already Worked Vis allerede kørte - + Super Fox Super Fox - + Super Hound Super Hound - + Hound Hound - + Tx Messages Tx meddelse - - - - - - + + + + + + Confirm Erase Bekræft Slet - + Are you sure you want to erase file ALL.TXT? Er du sikker på du vil slette filen ALL.TXT? - + Are you sure you want to erase the list of Q65 callers? Er du sikker på du vil slette Q65 listen? - - + + Confirm Reset Bekræft Reset - + Are you sure you want to erase your contest log? Er du sikker på du vil slette din contest log? - + Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. Gør du dette vil alle QSOer for pågældende contest blive slettet. De bliver dog gemt i en ADIF fik, men det vil ikke være muligt at eksportere dem som Cabrillo log. - + Cabrillo Log saved Cabrillo Log gemt - + Are you sure you want to erase file wsjtx_log.adi? Er du sikker på du vil slette filen wsjtx_log.adi? - + Are you sure you want to erase the WSPR hashtable? Er du sikker på du vil slette WSPR Hash tabellen? @@ -6741,44 +8686,45 @@ er allerede i CALL3.TXT. Vil du erstatte den? VHF feature advarsel - + Tune digital gain Tune digital gain - + Transmit digital gain Transmit digital gain - + Prefixes Prefixer - + Network Error Netværks Fejl - + Error: %1 UDP server %2:%3 Error: %1 UDP server %2:%3 - + + File Error Fil fejl - + Phase Training Disabled Phase Training Deaktiveret - + Phase Training Enabled Phase Training Aktiveret @@ -6787,15 +8733,222 @@ UDP server %2:%3 WD:%1m - - - Log File Error - Log Fil Fejl + + + Log File Error + Log Fil Fejl + + + + Are you sure you want to clear the QSO queues? + Er du sikker du vil slette QSO køen? + + + + Band hopping has no selected frequencies. + + + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: cycle CQ response mode)</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Cycle CQ response mode</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Ctrl+X </b></td><td>Open next file in directory</td></tr> + <tr><td><b>Alt+x </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> + +</table> + + + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Right-click</b> to set Tx frequency.<br/> + <b>Double-right-click</b> to set Rx and Tx frequencies. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> + and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> + Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> + own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">Dial Frequency:</td> + <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> + <b>Right-click</b> to increase frequency by 1 kHz.<br/> + <b>Left-click</b> to decrease frequency by 1 kHz.<br/> + The mouse pointer must be over the Dial Frequency indicator. + </td> + </tr> + <tr> + <td align="right">H Button:</td> + <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to activate or deactivate SuperFox mode. + </td> + </tr> + <tr> + <td align="right">FT8 Button:</td> + <td><b>Click</b> to switch to FT8 Hound Mode.<br/> + <b>Right-click</b> to toggle last used Special Operating Activity On/Off. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> + <tr> + <td align="right">Tx5 Button:</td> + <td><b>Right-click</b> to retain Tx5 free text. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Right-click</b> to freeze the state of the checkbox.<br/> + <b>Right-click on the FT8 Button</b> to unfreeze. + </td> + </tr> + <tr> + <td align="right">Enable Tx Button:</td> + <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> + <b>Right-click</b> to toggle Wait & Pounce On/Off after selecting<br/> + any CQ response mode other than CQ: None. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> + If <b>Alternate Erase button behavior</b> is checked:<br/> + <b>Click</b> to erase Band Activity window.<br/> + <b>Right-click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">DX Call Button:</td> + <td><b>Click</b> to toggle Wait & Call On/Off.<br/> + <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. + </td> + </tr> + <tr> + <td align="right">Lookup Button:</td> + <td><b>Click</b> to search for callsign in database.<br/> + <b>Right-click</b> to search for Dx Call on qrz.com. + </td> + </tr> + <tr> + <td align="right">Add Button:</td> + <td><b>Click</b> to add callsign and locator to database.<br/> + <b>Right-click</b> to search for Dx Call on hamqth.com. + </td> + </tr> + <tr> + <td align="right">Ignore Button:</td> + <td><b>Click</b> to add callsign to the Ignore List.<br/> + <b>Right-click</b> to search for Dx Call on qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Band Buttons:</td> + <td><b>Click</b> to toggle band / mode default frequencies.<br/> + <b>Right-click</b> to toggle FT8 DXpedition frequencies. + </td> + </tr> +</table> + - - Are you sure you want to clear the QSO queues? - Er du sikker du vil slette QSO køen? + + Type 1 Prefixes: + + 1A 1S 3A 3B6 3B8 3B9 3C 3C0 3D2 3D2C 3D2R 3DA 3V 3W 3X + 3Y 3YB 3YP 4J 4L 4S 4U1I 4U1U 4W 4X 5A 5B 5H 5N 5R + 5T 5U 5V 5W 5X 5Z 6W 6Y 7O 7P 7Q 7X 8P 8Q 8R + 9A 9G 9H 9J 9K 9L 9M2 9M6 9N 9Q 9U 9V 9X 9Y A2 + A3 A4 A5 A6 A7 A9 AP BS7 BV BV9 BY C2 C3 C5 C6 + C9 CE CE0X CE0Y CE0Z CE9 CM CN CP CT CT3 CU CX CY0 CY9 + D2 D4 D6 DL DU E3 E4 EA EA6 EA8 EA9 EI EK EL EP + ER ES ET EU EX EY EZ F FG FH FJ FK FKC FM FO + FOA FOC FOM FP FR FRG FRJ FRT FT5W FT5X FT5Z FW FY M MD + MI MJ MM MU MW H4 H40 HA HB HB0 HC HC8 HH HI HK + HK0A HK0M HL HM HP HR HS HV HZ I IS IS0 J2 J3 J5 + J6 J7 J8 JA JDM JDO JT JW JX JY K KG4 KH0 KH1 KH2 + KH3 KH4 KH5 KH5K KH6 KH7 KH8 KH9 KL KP1 KP2 KP4 KP5 LA LU + LX LY LZ OA OD OE OH OH0 OJ0 OK OM ON OX OY OZ + P2 P4 PA PJ2 PJ7 PY PY0F PT0S PY0T PZ R1F R1M S0 S2 S5 + S7 S9 SM SP ST SU SV SVA SV5 SV9 T2 T30 T31 T32 T33 + T5 T7 T8 T9 TA TF TG TI TI9 TJ TK TL TN TR TT + TU TY TZ UA UA2 UA9 UK UN UR V2 V3 V4 V5 V6 V7 + V8 VE VK VK0H VK0M VK9C VK9L VK9M VK9N VK9W VK9X VP2E VP2M VP2V VP5 + VP6 VP6D VP8 VP8G VP8H VP8O VP8S VP9 VQ9 VR VU VU4 VU7 XE XF4 + XT XU XW XX9 XZ YA YB YI YJ YK YL YN YO YS YU + YV YV0 Z2 Z3 ZA ZB ZC4 ZD7 ZD8 ZD9 ZF ZK1N ZK1S ZK2 ZK3 + ZL ZL7 ZL8 ZL9 ZP ZS ZS8 KC4 E5 + +Type 1 Suffixes: /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /P + @@ -6815,8 +8968,8 @@ UDP server %2:%3 Modes - - + + Mode Mode @@ -6824,7 +8977,7 @@ UDP server %2:%3 MultiSettings - + Default Standard @@ -6832,62 +8985,62 @@ UDP server %2:%3 MultiSettings::impl - + &Switch To &Skift til - + &Clone &Klone - + Clone &Into ... Klone &Til... - + R&eset R&eset - + &Rename ... &Omdøb ... - + &Delete &Slet - + Clone Into Configuration Klone til konfiguration - + Confirm overwrite of all values for configuration "%1" with values from "%2"? Bekræft overskrivning af alle indstillinger for konfiguration "%1" med indstillinger fra "%2"? - + Reset Configuration Reset Konfiguration - + Confirm reset to default values for configuration "%1"? Bekræft reset til default indstillinger for konfiguration "%1"? - + Delete Configuration Slet Konfiguration - + Confirm deletion of configuration "%1"? Bekræft sletning af konfiguration "%1"? @@ -6895,17 +9048,17 @@ UDP server %2:%3 NameDialog - + New Configuration Name Ny Konfigurations navn - + Old name: Gammelt navn: - + &New name: &Nyt navn: @@ -6931,7 +9084,7 @@ UDP server %2:%3 Fejl ved start af OmniRig Com server - + OmniRig: don't know how to set rig frequency OmniRig: Ved ikke hvordan frekvensen på radioen skal indstilles @@ -6940,7 +9093,7 @@ UDP server %2:%3 OmniRig: Timeout for opdatering fra radioe - + OmniRig COM/OLE error: %1 at %2: %3 (%4) OmniRig Com/OLE fejl: %1 ved %2: %3 (%4) @@ -6970,34 +9123,33 @@ UDP server %2:%3 OOB - + Too many colours in palette. For mange farver i Paletten. - + Error reading waterfall palette file "%1:%2" too many colors. Fejl ved læsning af Vandfald palette fil "%1:%2" for mange farver. - + Error reading waterfall palette file "%1:%2" invalid triplet. Fejl ved læsning af Vandfald palette fil "%1:%2" forkert triplet. - + Error reading waterfall palette file "%1:%2" invalid color. Fejl ved læsning af Vandfald palette fil "%1:%2" forkert farve. - + Error opening waterfall palette file "%1": %2. Fejl ved åbning af Vandfald palette fil "%1": %2. - Error writing waterfall palette file "%1": %2. - Fejl ved skrivning til Vandfald palette fil "%1":%2. + Fejl ved skrivning til Vandfald palette fil "%1":%2. @@ -7400,7 +9552,7 @@ Message Send MSG - + MessageCreator MessageCreator @@ -7418,7 +9570,7 @@ Message Clear - + QSY Monitor QSY Monitor @@ -7559,12 +9711,12 @@ Fejl(%2): %3 SoundInput - + An error opening the audio input device has occurred. En fejl er opstået ved åbning af Audio indgangsenheden. - + An error occurred during read from the audio input device. En fejl er opstået ved læsning fra Audio enheden. @@ -7573,52 +9725,52 @@ Fejl(%2): %3 Audio bliverr ikke overført hurtigt nok til Audio enheden. - + Non-recoverable error, audio input device not usable at this time. Fejl, der ikke kan gendannes, lydindgangs enhed kan ikke bruges på dette tidspunkt. - + Requested input audio format is not valid. Det ønskede Audio ingangs format er ikke gyldigt. - + Requested input audio format is not supported on device. Det ønskede Audio indgangs format understøttes ikke af enheden. - + Failed to initialize audio sink device Kunne ikke initialisere lydenheden - + Idle Venter - + Receiving Modtager - + Suspended Suspenderet - + Interrupted Afbrudt - + Error Fejl - + Stopped Stoppet @@ -7626,90 +9778,114 @@ Fejl(%2): %3 SoundOutput - + An error opening the audio output device has occurred. Fejl ved åbning af Audio udgangs enheden. - + An error occurred during write to the audio output device. Fejl ved skrivning til Audio udgangs enheden. - + Audio data not being fed to the audio output device fast enough. Audio data bliver ikke sendt hurtigt nok Audio udgangs enheden. - + Non-recoverable error, audio output device not usable at this time. Fejl, der ikke kan gendannes, lydudgangs enhed kan ikke bruges på dette tidspunkt. - + Requested output audio format is not valid. Det ønskede udgangs Audio format er ikke gyldig. - + Requested output audio format is not supported on device. Det ønskede Audio udgangs format understøttes ikke af enheden. - + + Audio output restart attempt failed. + + + + + No audio output device configured. Ingen audio output enhed er konfigureret. - + + No audio output stream is active. + + + + Idle Venter - + Sending Sender - + Suspended Suspenderet - + Interrupted Afbrudt - + Error Fejl - + Stopped Stoppet + + SplashScreen + + + WSJT-X — Welcome + + + + + WSJT-X startup information. Press Escape to close. + + + StationDialog - + Add Station Tilføj Station - + &Band: &Bånd: - + &Offset (MHz): &Offset (Mhz): - + &Antenna: &Antenne: @@ -7750,185 +9926,207 @@ Fejl(%2): %3 TCITransceiver - + ConnectionRefused Connection afvist Forbindelse afvist - + RemoteHostClosed RemoteHostClosed - + HostNotFound HostNotFound - + SocketAccess SocketAccess - + SocketResource SocketResource - + SocketTimeout SocketTimeout - + DatagramTooLarge DatagramTooLarge - + Network Network - + AddressInUse AddressInUse - + SocketAddressNotAvailable SocketAddressNotAvailable - + UnsupportedSocketOperation UnsupportedSocketOperation - + UnfinishedSocketOperation UnfinishedSocketOperation - + ProxyAuthenticationRequired ProxyAuthenticationRequired - + SslHandshakeFailed SslHandshakeFailed - + ProxyConnectionRefused ProxyConnectionRefused - + ProxyConnectionClosed ProxyConnectionClosed - + ProxyConnectionTimeout ProxyConnectionTimeout - + ProxyNotFound ProxyNotFound - + ProxyProtocol ProxyProtocol - + Operation Operation - + SslInternal SslInternal - + SslInvalidUserData SslInvalidUserData - + Temporary Temporary - + UnknownSocket UnknownSocket - + + UnknownSocketError + + + + TCI websocket error: %1 TCI websocket error: %1 - + TCI SDR could not be switched on TCI SDR could not be switched on - + TCI SDR is not switched on TCI SDR is not switched on - + TCI RX2 could not be enabled TCI RX2 could not be enabled - + TCI Audio could not be switched on TCI Audio could not be switched on - - + + TCI could not be opened TCI could not be opened - - + + + + TCI sent an invalid VFO frequency + + + + + TCI failed to set ptt TCI failed to set ptt - + TCI should use PTT via CAT TCI should use PTT via CAT - - + + TCI failed set rxfreq TCI failed set rxfreq - - + + TCI failed set mode TCI failed set mode - + TCI modulator not Idle TCI modulator not Idle + + + TCI source commitment; playout evidence is protocol-send dead reckoning, not DAC confirmation + + + + + TCI WebSocket send progress; no radio DAC or RF playback confirmation + + TransceiverBase @@ -7950,7 +10148,7 @@ Fejl(%2): %3 Indstillinger - + Spectrum gain Spectrum forstærkning @@ -7959,184 +10157,193 @@ Fejl(%2): %3 Palette - + <html><head/><body><p>Enter definition for a new color palette.</p></body></html> <html><head/><body> <p> Indtast definition for en ny farvepalet. </p> </body> </html> - + Adjust... Juster... - + Total power (dB) Total power (dB) - + Waterfall gain Vandfald forstærkning - + <html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html> <html><head/><body> <p> Indstil procent størrelse af spektret i dette vindue. </p> </body> </html> - + % % - + Spec Spec - + <html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html> <html><head/><body> <p> Kompensering af forstærkning over den fulde viste båndbredde. </p> </body> </html> - + Flatten Midling - <html><head/><body><p>Compute and save a reference spectrum. (Not yet fully implemented.)</p></body></html> - <html><head/><body> <p> Beregn og gem et referencespektrum. (Ikke endnu fuldt implementeret.) </p> </body> </html> + <html><head/><body> <p> Beregn og gem et referencespektrum. (Ikke endnu fuldt implementeret.) </p> </body> </html> - + Ref Spec Ref Spec - + Smoothing of Linear Average spectrum Udjævning af lineært gennemsnitspektrum - + Smooth Smooth - + Compression factor for frequency scale Kompressions faktor for frekvens skala - + + <html><head/><body><p>Controls</p></body></html> + + + + Bins/Pixel Bins/Pixel - - + + <html><head/><body><p>Position of time stamp above each interval line</p></body></html> <html><head/><body><p>Placering af tidsstempel over hver intervallinje</p></body></html> - + Time stamp Tidsstempel - - + + Off Off - + Left Venstre - + Right Højre - + Palette Palette - + Select waterfall palette Vælg Palette for vandfald - + Bars Bars - + Freq Frekv - + + <html><head/><body><p>Apply a saved reference spectrum to flatten the received passband. Available after a reference spectrum has been measured. (Not yet fully implemented.)</p></body></html> + + + + <html><head/><body><p>Select data for spectral display</p></body></html> <html><head/><body> <p> Vælg data til spektral visning </p> </body> </html> - + Current Current - + Cumulative Cumulative - + Linear Avg Liniær Avg - + Reference Reference - + Q65_Sync Q65_Sync - + <html><head/><body><p>Frequency at left edge of waterfall</p></body></html> <html><head/><body><p>Frekvens ved venstre side af Vandfaldet</p></body></html> - + Hz Hz - + Start Start - + <html><head/><body><p>Decode JT9 only above this frequency</p></body></html> <html><head/><body><p>Dekod kun JT9 over denne frekvens</p></body></html> - + Hz Hz - + Split Split @@ -8149,38 +10356,38 @@ Fejl(%2): %3 JY65 - + Number of FFTs averaged (controls waterfall scrolling rate) Antal af FFT Avg (bestemmer vandfaldets hastighed over skærmen) - + N Avg N Avg - + Waterfall zero Vandfald Nul - + Spectrum zero Spectrum Nul - + User Defined Bruger Defineret - + Wide Graph Wide Graf - - + + Read Palette Læs Palette @@ -8188,22 +10395,22 @@ Fejl(%2): %3 WorkedBefore - + Invalid ADIF field %0: %1 Forkert ADIF field %0: %1 - + Malformed ADIF field %0: %1 Misdannet ADIF field %0: %1 - + Invalid ADIF header Forkert ADIF header - + Error opening ADIF log file for read: %0 Fejl ved åbning af ADIF log filen for læsning: %0 @@ -8246,7 +10453,7 @@ Fejl(%2): %3 M&in Grid: - + <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> <html><head/><body><p>Maidenhead locator, fortrinvis 6 karakterer.</p></body></html> @@ -8261,57 +10468,57 @@ Fejl(%2): %3 AutoGrid - + IARU Region: IARU Region: - + <html><head/><body><p>Select your IARU region.</p></body></html> <html><head/><body><p>Vælg din IARU region.</p></body></html> - + Message generation for type 2 compound callsign holders: Generering af meddelelser for type 2 sammensatte kaldesignaler: - + <html><head/><body><p>Type 2 compound callsigns are those with prefixes or suffixes not included in the allowed shortlist (See Help-&gt;Add-on prefixes and suffixes).</p><p>This option determines which generated messages should contain your full type 2 compound call sign rather than your base callsign. It only applies if you have a type 2 compound callsign.</p><p>This option controls the way the messages that are used to answer CQ calls are generated. Generated messages 6 (CQ) and 5 (73) will always contain your full callsign. The JT65 and JT9 protocols allow for some standard messages with your full call at the expense of another piece of information such as the DX call or your locator.</p><p>Choosing message 1 omits the DX callsign which may be an issue when replying to CQ calls. Choosing message 3 also omits the DX callsign and many versions of this and other software will not extract the report. Choosing neither means that your full callsign only goes in your message 5 (73) so your QSO partner may log the wrong callsign.</p><p>None of these options are perfect, message 3 is usually best but be aware your QSO partner may not log the report you send them.</p></body></html> <html><head/><body><p> Type 2 sammensatte kaldesignaler er dem med præfikser eller suffikser, der ikke er inkluderet i den tilladte shortlist (Se Hjælp &gt; tilføjelsespræfikser og suffikser). </p> <p> Denne mulighed bestemmer, hvilke genererede meddelelser der skal indeholde dit fulde type 2 sammensatte opkaldstegn snarere end dit basis kaldsignalsignal. Det gælder kun, hvis du har et sammensat kaldesignal af type 2.</p><p> Denne indstilling styrer, hvordan de meddelelser, der bruges til at besvare CQ-opkald, genereres. Genererede meddelelser 6 (CQ) og 5 (73) vil altid indeholde dit fulde kaldesignal. Protokollerne JT65 og JT9 giver mulighed for nogle standardmeddelelser med dit fulde kaldesignal på bekostning af et andet stykke information, såsom DX-kaldesignal eller din lokator.</p><p> Valg af meddelelse 1 udelader DX-kaldesignalet, som kan være et problem når du besvarer CQ-kald. Valg af meddelelse 3 udelader også DX-kaldesignalet, og mange versioner af denne og anden software viser ikke rapporten. At vælge ingen betyder, at dit fulde kaldesignal kun indgår i din meddelelse 5 (73), så din QSO-partner muligvis logger det forkerte kaldesignal.</p><p> Ingen af ​​disse indstillinger er perfekte, meddelse 3 er normalt bedst, men vær opmærksom på din QSO partner muligvis ikke logger den rapport, du sender dem.</p></body></html> - + Full call in Tx1 Fuldt kaldesignal i Tx1 - + Full call in Tx3 Fuldt kaldesignal i Tx3 - + Full call in Tx5 only Fuldt kaldessignal kun i Tx5 - + Display Dsiplay - + Show outgoing transmitted messages in the Rx frequency window. Vis sendte Tx meddelser i Rx frekvens vinduet. - + &Tx messages to Rx frequency window &Tx meddelser til Rx frekvens vindue - + Show if decoded stations are new DXCC entities or worked before. Vis hvis dekodede stationer er nyt DXCC eller Worked B4. @@ -8320,12 +10527,12 @@ Fejl(%2): %3 Vis &DXCC, gird og Worked B4 status - + <html><head/><body><p>Check to have decodes for a new period start at the top of the Band Activity window and not scroll off the top when the window is full.</p><p>This is to aid selecting decodes to double-click while decoding is still in progress. Use the Band Activity vertical scroll bar to reveal decodes past the bottom of the window.</p></body></html> <html><head/><body><p> Marker her for at dekodede meddelser vises øverst i Båndaktivitets vinduet, og ruller ikke fra toppen, når vinduet er fuldt.</p><p> Dette er med til at hjælpe med at udvælge dekodet signal til dobbeltklik, mens afkodning stadig er i gang. Brug den lodrette rullebjælke i båndaktivitet vinduet til at vise dekodede signaler i bunden af ​​vinduet.</p> </body></html> - + Start new period decodes at top Start ny dekode periode fra toppen @@ -8334,52 +10541,52 @@ Fejl(%2): %3 Vis prefix for land i stedet for landets fulde navn - + Set the font characteristics for the application. Vælg font for appplikationen. - + Font... Font... - + Set the font characteristics for the Band Activity and Rx Frequency areas. Vælg font for Bånd Activitet og RX-Frekvens vinduerne. - + Decoded Text Font... Dekodet Tekst Font... - + Include a separator line between periods in the band activity window. Indsæt en stiplet linje i Bånd Aktivitets Vinduet imellem hver periode. - + &Blank line between decoding periods &Stiplet linje mellem dekodnings perioder - + Show distance to DX station in miles rather than kilometers. Vis distance til DX station i miles i stedet for kilometer. - + Display dista&nce in miles Vis dista&nce i miles - + Behavior Opførsel - + Decode after EME delay Dekod efter EME forsinkelse @@ -8388,17 +10595,17 @@ Fejl(%2): %3 Tx vagthund: - + <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> <html><head/><body><p>Antal minutter før uovervåget sending stoppes</p></body></html> - + Disabled Deaktiveret - + minutes minutter @@ -8407,64 +10614,62 @@ Fejl(%2): %3 Aktiver VHF/UHF/Mikrobølge funktioner - + Single decode Enkelt dekodning - <html><head/><body><p>Some rigs are not able to process CAT commands while transmitting. This means that if you are operating in split mode you may have to uncheck this option.</p></body></html> - <html><head/><body><p> Nogle radioer kan ikke håndtere CAT-kommandoer, mens de sender. Dette betyder, at hvis du opererer i Split Mode skal du muligvis fjerne markeringen af ​​denne indstilling.</p></body></html> + <html><head/><body><p> Nogle radioer kan ikke håndtere CAT-kommandoer, mens de sender. Dette betyder, at hvis du opererer i Split Mode skal du muligvis fjerne markeringen af ​​denne indstilling.</p></body></html> - Allow Tx frequency changes while transmitting - Tillad ændring af Tx frekvens mens der sendes + Tillad ændring af Tx frekvens mens der sendes - + Don't start decoding until the monitor button is clicked. Start ikke dekodning før der trykke på monitor knappen. - + Mon&itor off at startup Mon&itor OFF ved start - + <html><head/><body><p>Check this if you wish to automatically return to the last monitored frequency when monitor is enabled, leave it unchecked if you wish to have the current rig frequency maintained.</p></body></html> <html><head/><body><p>Marker her hvis du have at programmet skal vende tilbage til seneste frekvens da det blev stoppet. Lad den være umarkeret, hvis du vil programmet skal blive på den frekvens radioen er indstillet til når det startes.</p></body></html> - + Monitor returns to last used frequency Monitor til seneste brugte frekvens - + Alternate F1-F6 bindings Alternative F1-F6 bindinger - + Turns off automatic transmissions after sending a 73 or any other free text message. Stopper Tx automatisk efter der er sendt en 73 eller Fri meddelse tekst meddelse. - + Di&sable Tx after sending 73 De&aktiver Tx efter der er sendt 73 - + Send a CW ID after every 73 or free text message. Send CW ID efter hver 73 eller fri tekst meddelse. - + CW ID a&fter 73 CW ID e&fter 73 @@ -8473,7 +10678,7 @@ tekst meddelse. Periodisk CW ID Inter&val: - + Send a CW ID periodically every few minutes. This might be required under your countries licence regulations. It will not interfere with other users as it is always sent in the @@ -8484,411 +10689,446 @@ Det vil ikke forstyrre andre brugere, da det altid sendes i den stille periode, når dekodningen er udført. - + Automatic transmission mode. Automatisk Tx Mode. - + Show &DXCC, grid, and worked-before status Vis &DXCC, grid, og worked-b4 status - + Highlight DX Grid in message Highlight DX Grid i message - + Show DXCC for all messages Vis DXCC for alle messages - + Show the separator line between periods with time stamp of the decode period. Vis separator linje mellem perioder med time stamp for den dekodede periode. - + Show blank line with time stamp Vis blank linje med time stamp - + Show principal prefix instead of country name Vis hovedpræfiks i stedet for landenavn - + Highlight DX Call in message Highlight DX Call i message - + Doubl&e-click on call sets Tx enable Dobb&elt-klik på et kaldesignal Aktivere Tx - + <html><head/><body><p>Open the Astronomical Data window automatically when switching to Q65 or JT65 mode and Decode after EME delay is enabled, and close it when no longer needed.</p><p>Open the QSYMessage Creator automatically if the VHF Features are enabled and such QSY messages are applicable.</p></body></html> <html><head/><body><p>Åbner automatisk vinduet Astronomiske data, når der skiftes til Q65- eller JT65-tilstand, og afkodning efter EME-forsinkelse er aktiveret, og luk det, når det ikke længere er nødvendigt.</p><p>Åbner automatisk QSYMessage Creator, hvis VHF-funktionerne er aktiveret, og sådanne QSY-meddelelser er relevante.</p></body></html> - + Auto-open/close Astronomical data window Auto-åbne/lukke Astronomisk data vindue - + Calling CQ forces Call 1st CQ kald fremtvinger Besvar 1st - + <html><head/><body><p>Tx until 73 is received when in MSK144 or Q65 mode. </p></body></html> <html><head/><body><p>Send indtil 73 modtages i MSK144- eller Q65-mode.</p></body></html> - + MSK144/Q65: Tx until 73 is received MSK144/Q65: Tx indtil 73 er modtaget - + <html><head/><body><p>Allow kHz frequency offset entry without 'k' suffix.</p></body></html> <html><head/><body><p>Tillad indtastning af kHz frekvens-offset uden 'k'-suffiks.</p></body></html> - + kHz entry without k (restart required) kHz-indtastning uden k (genstart nødvendig) - + + <html><head/><body><p>Allow automatic Doppler tracking and split/Fake It/XIT to correct the transmit frequency while transmitting, including corrections of tens of kHz on microwave bands.</p><p>This option does not allow nominal dial or band changes while transmitting or tuning. Leave it unchecked if your rig cannot accept frequency-setting CAT commands while transmitting; WSJT-X will then make one midpoint Doppler correction before transmission starts.</p></body></html> + + + + + Allow Tx-frequency corrections while transmitting + + + + <html><head/><body><p>Disable the Tune watchdog.</p></body></html> <html><head/><body><p>Deaktiver Tune watchdog.</p></body></html> - + Tune watchdog Tune watchdog - + <html><head/><body><p>Number of seconds before Tune is aborted</p></body></html> <html><head/><body><p>Antal sekunder før Tune afbrydes</p></body></html> - + + Tune watchdog timeout + + + + seconds sekunder - + Tx watchdog: Tx watchdog: - + + Tx watchdog timeout + + + + ID Inter&val: ID Inter&val: - + + CW ID interval + + + + <html><head/><body><p>Turn the progress bar red while transmitting.</p></body></html> <html><head/><body><p>Gør statuslinjen rød under transmission.</p></body></html> - + Turn progress bar red while transmitting Gør statuslinjen rød under TX - + Additional features Yderligere funktioner - + Set Rx frequency to Tx frequency after QSO Indstil Rx-frekvens til Tx-frekvens efter QSO - + <html><head/><body><p>If a station sends locator, calculate and show the distance in Band Activity pane.</p></body></html> <html><head/><body><p>Hvis en station sender en Grid, skal afstanden beregnes og vises i Båndaktivitet vinduet.</p></body></html> - + Show distance in messages with grid Vis distance i msg med Grid - + <html><head/><body><p>Erase Band Activity and Rx frequency windows after band change.</p></body></html> <html><head/><body><p>Slet båndaktivitet og Rx-frekvensvinduer efter båndskift.</p></body></html> - + Erase decodes after band change Slet dekodet efter båndskift - + Clear DX Grid after QSO Slet DX Grid efter QSO - + Show U.S. States in messages with grid Vis USA stat i msg med Grid - + Map Grid locator to U.S. State Sæt Grid locator til US State - + <html><head/><body><p>Align the text for DXCC, distance and azimuth.</p></body></html> <html><head/><body><p>Tekst for DXCC, afstand og azimut.</p></body></html> - + Align DXCC/distance/azimuth DXCC/afstand/azimut - + Alternate Erase button behavior Fuktion af alternativ sletteknap - + Clear DX Call after QSO Slet DX-Call efter QSO - + <html><head/><body><p>Increase or decrease the space between message text and DXCC.</p></body></html> <html><head/><body><p>Øg eller formindsk afstanden mellem beskedtekst og DXCC.</p></body></html> + DXCC alignment spacing + + + + Enable Wait features Enable wait funktion - + <html><head/><body><p>If a station sends a valid Maidenhead locator, calculate and show the great-circle azimuth in Band Activity pane.</p></body></html> <html><head/><body><p>Hvis en station sender en gyldig Maidenhead-locator, skal storcirkelazimuten beregnes og vises i Båndaktivitet vinduet.</p></body></html> - + Show azimuth in messages with grid Vis azimut i msg med Grid - + <html><head/><body><p>Increase or decrease the space between DXCC and distance/azimuth.</p></body></html> <html><head/><body><p>Øg eller formindsk afstanden mellem DXCC og afstand/azimuth.</p></body></html> - + + Distance and azimuth alignment spacing + + + + Less button coloring (restart required) Mindre farvelægning af knapper (genstart kræves) - + &Radio &Radio - + Radio interface configuration settings. Radio interface konfigurations indstillinger. - + <html><head/><body><p>Use only VFO A for split operation (the program temporarily changes the QRG of your rig during transmission).</p></body></html> <html><head/><body><p>Brug kun VFO A til split-operation (programmet ændrer midlertidigt QRG på din Radio under transmission).</p></body></html> - + <html><head/><body><p>Use VFO A+B for split operation (works with many rigs, but requires the use of both VFOs).</p></body></html> <html><head/><body><p>Brug VFO A+B til split-operation (fungerer med mange Radioer, men kræver brug af begge VFO'er).</p></body></html> - + <html><head/><body><p>Don't use split (not recommended).</p></body></html> <html><head/><body><p>Brug ikke split operation(anbefales ikke).</p></body></html> - + Settings that control your CAT interface. Indstillinger der kontrollerer CAT Interface. - + CAT Control Cat Kontrol - - + + Port: Port: - + Serial port used for CAT control. Seriel port til CAT kontrol. - - + + Serial Port Parameters Seriel Port Parametre - + Baud Rate: Baud Rate: - + Serial port data rate which must match the setting of your radio. Seriel data hastighed som skal være den samme som på din radio. - + 1200 1200 - + 2400 2400 - + 4800 4800 - + 9600 9600 - + 19200 19200 - + 38400 38400 - + 57600 57600 - + 115200 115200 - + <html><head/><body><p>Number of data bits used to communicate with your radio's CAT interface (usually eight).</p></body></html> <html><head/><body><p>Antallet af data bits der skal bruges for at kommunikerer med din radio via CAT interface (normalt otte).</p></body></html> - + Data bits Data bits - + Data Bits Data Bits - + D&efault D&efault - + Se&ven Sy&v - + E&ight O&tte - + <html><head/><body><p>Number of stop bits used when communicating with your radio's CAT interface</p><p>(consult you radio's manual for details).</p></body></html> <html><head/><body><p>Antallet af stop bits der bruges til kommunikation via din radio CAT interface</p><p>(Se i din radio manual for detaljer).</p></body></html> - + Stop bits Stop bits - + Stop Bits Stop Bit - - + + Default Default - + On&e E&n - + T&wo T&o - + <html><head/><body><p>Flow control protocol used between this computer and your radio's CAT interface (usually &quot;None&quot; but some require &quot;Hardware&quot;).</p></body></html> <html><head/><body><p>Flow kontrol protokol der bruges mellem computer og radioens CAT interface (Normal &quot;None&quot; men nogle radioer kræver &quot;Hardware&quot;).</p></body></html> - - + + Handshake Handshake - + &None &ingen - + Software flow control (very rare on CAT interfaces). Software flow kontrol (sjælden på CAT interface). - + XON/XOFF XON/XOFF - + Flow control using the RTS and CTS RS-232 control lines not often used but some radios have it as an option and a few, particularly some Kenwood rigs, require it). @@ -8897,75 +11137,74 @@ ikke ofte brugt, men nogle radioer har det som en mulighed og et par, især nogle Kenwood radioer, kræver det). - + &Hardware &Hardware - + Special control of CAT port control lines. Special kontrol af CAT port kontrol linjer. - - + + Force Control Lines Tving Kontrol Linjer - - + + High Høj - - + + Low Lav - + DTR: DTR: - + RTS: RTS: - How this program activates the PTT on your radio? - Hvorledes dette program skal aktivere PTT på din radio? + Hvorledes dette program skal aktivere PTT på din radio? - + PTT Method PTT metode - + <html><head/><body><p>No PTT activation, instead the radio's automatic VOX is used to key the transmitter.</p><p>Use this if you have no radio interface hardware.</p></body></html> <html><head/><body><p>Ingen PTT aktivering. I stedet bruges radioens automatis VOX til at nøgle senderen.</p><p>Bruge denne hvis du ingen hardware interface har.</p></body></html> - + VO&X VO&X - + <html><head/><body><p>Use the RS-232 DTR control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The DTR control line of the CAT serial port may be used for this or a DTR control line on a different serial port may be used.</p></body></html> <html><head/><body><p> Brug RS-232 DTR-kontrollinjen til at skifte radioens PTT, kræver hardware for at interface. </p><p> Nogle kommercielle interface-enheder bruger også denne metode. </p> <p> DTR-kontrollinjen i CAT-seriel port kan bruges til dette, eller en DTR-kontrollinje på en anden seriel port kan bruges.</p></body></html> - + &DTR &DTR - + Some radios support PTT via CAT commands, use this option if your radio supports it and you have no other hardware interface for PTT. @@ -8974,47 +11213,47 @@ Brug denne option if din radio understøtter det, og hvis du ikke har andre muligheder eller andet hardware interface til PTT. - + C&AT C&AT - + <html><head/><body><p>Use the RS-232 RTS control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The RTS control line of the CAT serial port may be used for this or a RTS control line on a different serial port may be used. Note that this option is not available on the CAT serial port when hardware flow control is used.</p></body></html> <html><head/><body><p> Brug RS-232 RTS kontrollinjen til at skifte radioens PTT, kræver hardware for at interface grænsen.</p><p> Nogle kommercielle interfaceenheder bruger også denne metode.</p><p> RTS-kontrollinjen i CAT-seriel port kan bruges til dette, eller en RTS-kontrollinje på en anden seriel port kan bruges. Bemærk, at denne indstilling ikke er tilgængelig på den serielle CAT-port, når hardwarestrømstyring bruges. </p></body></html> - + R&TS R&TS - + <html><head/><body><p>Select the RS-232 serial port utilised for PTT control, this option is available when DTR or RTS is selected above as a transmit method.</p><p>This port can be the same one as the one used for CAT control.</p><p>For some interface types the special value CAT may be chosen, this is used for non-serial CAT interfaces that can control serial port control lines remotely (OmniRig for example).</p></body></html> <html><head/><body><p> Vælg den serielle RS-232-port, der bruges til PTT-kontrol, denne indstilling er tilgængelig, når DTR eller RTS vælges ovenfor som en sendemetode.</p><p>Denne port kan være den samme som den, der bruges til CAT-kontrol.</p><p> For nogle grænsefladetyper kan den særlige værdi CAT vælges, dette bruges til ikke-serielle CAT-grænseflader, der kan kontrollere serielle portkontrollinier eksternt (OmniRig for eksempel).</p></body></html> - + Modulation mode selected on radio. Modulation type valgt på Radio. - + Mode Mode - + <html><head/><body><p>USB is usually the correct modulation mode,</p><p>unless the radio has a special data or packet mode setting</p><p>for AFSK operation.</p></body></html> <html><head/><body><p>USB er normalt den korrekte modulations mode,</p><p>med mindre radioenunless the radio har en speciel data eller packet mode indstilling så som USB-D</p><p>til AFSK operation.</p></body></html> - + US&B US&B - + Don't allow the program to set the radio mode (not recommended but use if the wrong mode or bandwidth is selected). @@ -9023,23 +11262,23 @@ or bandwidth is selected). forkert mode eller båndbredde). - - + + None Ingen - + If this is available then it is usually the correct mode for this program. Hvis denne mulighed er til stede er det sædvanligvis den korrekte mode for dette program. - + Data/P&kt Data/P&kt - + Some radios can select the audio input using a CAT command, this setting allows you to select which audio input will be used (if it is available then generally the Rear/Data option is best). @@ -9048,52 +11287,52 @@ Denne indstilling tillader dig og vælge hvilken audio indgang der bruges (Hvis Bag/Data er muligt er det generelt den bedste). - + Transmit Audio Source Tx audio kilde - + Rear&/Data Bag&/Data - + &Front/Mic &Front/Mic - + Rig: Rig: - + Poll Interval: Poll Interval: - + <html><head/><body><p>Interval to poll rig for status. Longer intervals will mean that changes to the rig will take longer to be detected.</p></body></html> <html><head/><body><p> Interval mellem poll radio for status. Længere intervaller betyder, at det vil tage længere tid at opdage ændringer i radioen.</p></body></html> - + s s - + <html><head/><body><p>Attempt to connect to the radio with these settings.</p><p>The button will turn green if the connection is successful or red if there is a problem.</p></body></html> <html><head/><body><p>Forsøger og kontakte radioen med disse indstillinger.</p><p>Knappen vil blive grøn hvis kontakten lykkedes og rød hvis der er et problem.</p></body></html> - + Test CAT Test CAT - + Attempt to activate the transmitter. Click again to deactivate. Normally no power should be output since there is no audio being generated at this time. @@ -9106,47 +11345,47 @@ Kontroller, at Tx-indikation på din radio og / eller dit radio interface opfører sig som forventet. - + Test PTT Test PTT - + Split Operation Split Operation - + Fake It Fake It - + Rig Rig - + A&udio A&udio - + Audio interface settings Audio interface indstillinger - + Souncard Lydkort - + Soundcard Lydkort - + Select the audio CODEC to use for transmitting. If this is your default device for system sounds then ensure that all system sounds are disabled otherwise @@ -9159,76 +11398,76 @@ vil du sende alle systemlyde der genereres i løbet af transmissionsperioder. - + <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> <html><head/><body> <p> Indtast serviceportnummeret på den UDP-server, som WSJT-X skal sende opdateringer til. Hvis denne er nul, sendes der ingen opdateringer. </p> </body> </html> - + Outgoing interfaces: Udgående Interface: - + <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> <html><head/><body><p> Når der sendes opdateringer til en multicast-gruppeadresse, er det nødvendigt at angive, hvilke (n) netværksgrænseflade (r) de skal sendes til. Hvis loop-back-grænsefladen er multicast-kompatibel, vælges i det mindste den ene.</p> <p> For de fleste brugere er loop-back-interface alt, hvad der er behov for, hvilket gør det muligt for flere andre applikationer på den samme maskine at interoperere med WSJT-X. Hvis applikationer, der kører på andre værter, skal modtage statusopdateringer, skal der anvendes en passende netværksgrænseflade.</p><p> På nogle Linux-systemer kan det være nødvendigt at aktivere multicast på loop-back-netværksgrænsefladen. </p></body></html> - + <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> <html><head/><body><p>Indstiller antallet eller routerhop, som multicast-datagrammer har tilladelse til at lave. Næsten alle skal sætte dette til 1 for at holde udgående multicast-trafik i det lokale subneet.</p></body></html> - + Multicast TTL: Multicast TTL: - + Days since last upload Dage siden sidste upload - + Select the audio CODEC to use for receiving. Vælg Audio CODEC for modtagelse. - + &Input: &Input: - + Select the channel to use for receiving. Vælg kanal til modtagelse. - - + + Mono Mono - - + + Left Venstre - - + + Right Højre - - + + Both Begge - + Select the audio channel used for transmission. Unless you have multiple radios connected on different channels; then you will usually want to select mono or @@ -9239,300 +11478,338 @@ kanaler skal du normalt vælge mono her eller begge. - + Enable VHF and submode features Aktiver VHF and submode funktioner - - + + Update Hamlib Opdater Hamlib - + 32-bit 32-bit - + <html><head/><body><p>Revert the last Hamlib update. </p><p>Note: This function is only available on Windows.</p></body></html> <html><head/><body><p>Gå tilbage til den forrige Hamlib.</p><p>Bemærk: Denne funktion er kun tilgængelig på Windows.</p></body></html> - + Revert Update - <html><head/><body><p>Download the latest libhamlib-4.dll file from https://n0nb.users.sourceforge.net/. </p><p>Note: This function is only available on Windows.</p></body></html> - <html><head/><body><p>Download den seneste libhamlib-4.dll-fil fra https://n0nb.users.sourceforge.net/. </p><p>Bemærk: Denne funktion er kun tilgængelig i Windows.</p></body></html> + <html><head/><body><p>Download den seneste libhamlib-4.dll-fil fra https://n0nb.users.sourceforge.net/. </p><p>Bemærk: Denne funktion er kun tilgængelig i Windows.</p></body></html> - + In use: I brug: - + Backed up: Backed up: - + 64-bit 64-bit - + Rig Data Radio Data - + <html><head/><body><p>Stop transmitting immediately when SWR exceeds 2.5.</p></body></html> <html><head/><body><p>Stop Tx øjeblikkeligt, når SWR overstiger 2,5.</p></body></html> - + Halt Tx when SWR > 2.5 Stop Tx når SWR > 2.5 - + <html><head/><body><p>Read and display transmit PWR and SWR of your rig.</p></body></html> <html><head/><body><p>Læs og vis transmitteret PWR og SWR fra din Radio.</p></body></html> - + Read and display PWR and SWR Læs og vis PWR samt SWR - + Ou&tput: Ou&tput: - + + Output audio channel + + + + + Input audio channel + + + + <html><head/><body><p>Refresh audio device list.</p></body></html> <html><head/><body><p>Opdater listen over lydenheder.</p></body></html> - + Refresh Genindlæs - + <html><head/><body><p>Use TCI Audio when available.</p></body></html> <html><head/><body><p>Brug TCI-lyd, når det er muligt.</p></body></html> - + Use TCI Audio (restart required) Brug TCI Audio (genstart kræves) - + <html><head/><body><p>Rx audio level</p></body></html> <html><head/><body><p>Rx audio level</p></body></html> - + + TCI receive audio level + + + + Rx RX - + <html><head/><body><p>Sort audio device names alphabetically.</p></body></html> <html><head/><body><p>Sorter lydenheder alfabetisk.</p></body></html> - + Sort alphabetically Sorter Alfabestisk - + <html><head/><body><p>Hide the usually unusable ALSA CARD subdevices on Linux.</p></body></html> <html><head/><body><p>Hide the usually unusable ALSA CARD subdevices on Linux.</p></body></html> - + Hide ALSA CARD subdevices (Linux only) Hide ALSA CARD subdevices (Linux only) - - + + Save Directory Gemme Mappe - + Loc&ation: Lok&ation: - + Path to which .WAV files are saved. Sti hvor .WAV filerne er gemt. - - + + TextLabel Tekst Felt - + Click to select a different save directory for .WAV files. Klik for at vælge et andet sted og gemme .WAV filerne. - + S&elect Væ&lg - - + + AzEl Directory AzEl Mappe - + Location: Lokation: - + Select Vælg - + <html><head/><body><p>Enables additional line in azel.dat for Dpol parameter.</p></body></html> <html><head/><body><p>Aktiverer en ekstra linje i azel.dat for Dpol-parameteren.</p></body></html> - + Enable extra line in azel.dat Aktiver ekstra linje i azel.dat - + Power Memory By Band Power hukommelse per bånd - + Remember power settings by band Husk power indstilling per Bånd - + Enable power memory during transmit Husk power instillinger ved sending - + Transmit Transmit - + Enable power memory during tuning Husk power ved Tuning - + Tune Tune - + Tx &Macros TX &Makroer - + Canned free text messages setup Gemte Fri tekst meddelser indstilling - + + New &macro: + + + + &Add &Tilføj - + + Add Tx macro + + + + + Adds the entered message to the saved Tx macro list. + + + + + New Tx macro message + + + + + Enter a saved free-text message for the Tx5 dropdown. Free-text messages are limited to 13 characters including spaces. + + + + &Delete &Slet - Drag and drop items to rearrange order Right click for item specific actions Click, SHIFT+Click and, CRTL+Click to select items - Træk og slip emne for at omarrangere rækkefølge + Træk og slip emne for at omarrangere rækkefølge Højreklik for emne specifikke handlinger Klik, SHIFT + Klik og, CRTL + Klik for at vælge emner - + Reportin&g Rapporterin&g - + Reporting and logging settings Rapportering og Logging indstillinger - + Logging Logging - + <html><head/><body><p>Check this option to note any Special Operating Activity in the comments field.</p></body></html> <html><head/><body><p>Marker denne mulighed for at notere eventuelle Special Operating Aktivitet i kommentarfeltet.</p></body></html> - + Special operating activity to comments Special operating activitet til kommentarer - + The program will pop up a partially completed Log QSO dialog when you send a 73 or free text message. Programmet vil poppe op med en delvis udfyldt QSO Log når du sender 73 eller en Fri tekst meddelse. - + Promp&t me to log QSO Promp&t mig for at logge QSO - + <html><head/><body><p>Log 'ZZ00' as grid if the other station doesn't send you a grid.</p></body></html> <html><head/><body><p>Log 'ZZ00' som grid, hvis den anden station ikke sender dig en grid.</p></body></html> - + Fill missing grids with 'ZZ00' Udfyld manglende grids med 'ZZ00' - + Op Call: Op kaldesignal: - + Some logging programs will not accept the type of reports saved by this program. Check this option to save the sent and received reports in the @@ -9543,7 +11820,7 @@ Marker denne option for at gemme rapporterne i kommentar feltet. - + d&B reports to comments c&B rapporter til kommentar felt @@ -9558,22 +11835,22 @@ og DX Grid-felter, når der sendes en 73 eller fri tekstbesked. Slet &DX kaldesignal og Grid efter logging - + <html><head/><body><p>Some logging programs will not accept WSJT-X mode names.</p></body></html> <html><head/><body><p>Nogle logging programmer vil ikke acceptere mode navne.</p></body></html> - + Con&vert mode to RTTY Kon&verter mode til RTTY - + <html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html> <html><head/><body><p>Kaldesignal på Operatør, hvis det er forskelligt fra stations kaldesignal.</p></body></html> - + <html><head/><body><p>Check to have QSOs logged automatically, when complete.</p></body></html> <html><head/><body><p>Marker hvis du vil have at QSO'er logges automatisk når de er slut.</p></body></html> @@ -9582,12 +11859,12 @@ og DX Grid-felter, når der sendes en 73 eller fri tekstbesked. Log automatisk (kun Contest) - + Network Services Netværks Service - + <html><head/><body><p>The program can send your station details and all decoded signals with grid squares as spots to the http://pskreporter.info web site.</p><p>This is used for reverse beacon analysis which is very useful for assessing propagation and system performance.</p></body></html> <html><head/><body> <p> Programmet kan sende dine stationsoplysninger og alle dekodede signaler med Grid som SPOTS til http://pskreporter.info webstedet. </p> <p> Dette er bruges til reverse beacon-analyse, som er meget nyttig til vurdering af udbredelse og systemydelse. </p> </body> </html> @@ -9602,37 +11879,37 @@ Dette bruges til analyse af reverse beacon, hvilket er meget nyttigt til vurdering af udbrednings forhold og systemydelse. - + Enable &PSK Reporter Spotting Aktiver &PSK Reporter Spotting - + <html><head/><body><p>Check this option if a reliable connection is needed</p><p>Most users do not need this, the default uses UDP which is more efficient. Only check this if you have evidence that UDP traffic from you to PSK Reporter is being lost.</p></body></html> <html><head/><body> <p> Marker denne indstilling, hvis der er behov for en pålidelig forbindelse </p> <p> De fleste brugere har ikke brug for dette, da standard UDP er mere effektiv. Marker kun dette, hvis du er sikker på, at UDP-trafik fra dig til PSK Reporter går tabt. </p> </body> </html> - + Use TCP/IP connection Brug TCP/IP forbindelse - + UDP Server UDP Server - + UDP Server: UDP Server: - + <html><head/><body><p>Optional hostname of network service to receive decodes.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the broadcasting of UDP status updates.</p></body></html> <html><head/><body><p>Alternativ værtsnavn på netværks service som skal modtage det dekodede.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Værtsnavn</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 adresse</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 adresse</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast gruppe adresse</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast gruppe adresse</li></ul><p>Slettes dette felt vil der ikke blive udsendt UDP status opdateringer.</p></body></html> - + UDP Server port number: UDP Server port nummer: @@ -9641,164 +11918,187 @@ til vurdering af udbrednings forhold og systemydelse. <html><head/><body><p> Indtast serviceportnummeret på den UDP-server, som WSJT-X skal sende opdateringer til. Hvis dette er nul, udsendes ingen opdateringer.</p></body></html> - + <html><head/><body><p>With this enabled WSJT-X will accept certain requests back from a UDP server that receives decode messages.</p></body></html> <html><head/><body><p> Med denne aktiveret vil WSJT-X acceptere visse anmodninger tilbage fra en UDP-server, som modtager dekodede meddelelser.</p></body></html> - + Accept UDP requests Accepter UDP anmodninger - + <html><head/><body><p>Indicate acceptance of an incoming UDP request. The effect of this option varies depending on the operating system and window manager, its intent is to notify the acceptance of an incoming UDP request even if this application is minimized or hidden.</p></body></html> <html><head/><body><p> Angiv accept af en indgående UDP-anmodning. Effekten af ​​denne indstilling varierer afhængigt af operativsystemet og window manager, dens formål er at underrette accept af en indgående UDP-anmodning, selvom denne applikation er minimeret eller skjult.</p></body></html> - + Notify on accepted UDP request Meddelse om accepteret UDP anmodning - + <html><head/><body><p>Restore the window from minimized if an UDP request is accepted.</p></body></html> <html><head/><body><p> Gendan vinduet fra minimeret, hvis en UDP-anmodning accepteres.</p></body></html> - + Accepted UDP request restores window Gendan vindue fra minimeret, hvis en UDP anmodning accepteres - + Secondary UDP Server (deprecated) Sekundær UDP-server (udskrevet) - + <html><head/><body><p>When checked, WSJT-X will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html> <html><head/><body><p> Når denne er markeret, vil WSJT-X sende en logget kontakt i ADIF-format til det konfigurerede værtsnavn og port.</P></body></html> - + Enable logged contact ADIF broadcast Aktiver Logged kontankt ADIF afsendelse - + Server name or IP address: Server navn eller IP adresse: - + <html><head/><body><p>Optional host name of N1MM Logger+ program to receive ADIF UDP broadcasts. This is usually 'localhost' or ip address 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable broadcasting of ADIF information via UDP.</p></body></html> <html><head/><body><p>Alternativ host navn i N1MM Logger+ program der skal modtage ADIF UDP broadcasts. Det e rnormalt 'localhost' eller ip adresse 127.0.0.1</p><p>Format:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostnavn</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 adresse</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast gruppe adresse</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Slettes dette felt vil der ikke blive udsendt broadcasting af ADIF information via UDP.</p></body></html> - + Server port number: Server port nummer: - + <html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html> <html><head/><body><p>Indsæt portnummer som WSJT-X skal bruge til UDP broadcasts af ADIF log information. For N1MM Logger+, skal det være 2333. Hvis det er NUL vil der ikke blive udsendt broadcast.</p></body></html> - + Frequencies Frekvenser - + Default frequencies and band specific station details setup Default frekvenser og bånd specifikke stations deltalje indstillinger - + <html><head/><body><p>See &quot;Frequency Calibration&quot; in the WSJT-X User Guide for details of how to determine these parameters for your radio.</p></body></html> <html><head/><body><p>Se &quot;Frekvens Kalibrering&quot; i WSJT-X User Guide for detaljer om hvorledes disse parametre indstilles for din radio.</p></body></html> - + Frequency Calibration Frekvens Kalibrering - + Slope: Stigning: - + ppm ppm - + Intercept: Intercept: - + Hz Hz - + Working Frequencies Arbejds Frekvenser - + + + Insert, delete, load, save, merge, or reset working frequencies. + + + + + Working frequencies actions + + + + + + + Actions... + + + + <html><head/><body><p>Right click to maintain the working frequencies list.</p></body></html> <html><head/><body><p>Højre klik for at ændre i frekvenslisten.</p></body></html> - + Station Information Stations Information - + + + Insert or delete station information rows. + + + + + Station information actions + + + + Items may be edited. Right click for insert and delete options. Listen kan editeres Højre klik for at indsætte eller slette elementer. - + Colors Farver - + Decode Highlightling Dekode Farvelade - Reset Highlighting to WSJT-X default - Nulstil fremhævning til WSJT-X standard - - - - Reset Highlighting to WSJT-X Improved default - Nulstil fremhævning til WSJT-X Improved standard + Nulstil fremhævning til WSJT-X standard - + <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> <html><head/><body><p>Klik for at scanne wsjtx_log.adi ADIF filen igen for worked before information</p></body></html> - + Rescan ADIF Log Rescan Adif Log - + <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> <html><head/><body><p>Tryk for at resette alle Highligt oven over til default værdier og prioriteter.</p></body></html> @@ -9807,126 +12107,125 @@ Højre klik for at indsætte eller slette elementer. Reset Higlighting - + <html><head/><body><p>Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.</p><p>Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.</p></body></html> <html><head/><body> <p> Aktivér eller deaktiver ved hjælp af afkrydsningsfelterne og højreklik på et element for at ændre eller deaktivere forgrundsfarve, baggrundsfarve eller nulstille elementet til standardværdier. Træk og slip emnerne for at ændre deres prioritet, højere på listen har højere prioritet. </p> <p> Bemærk, at hver forgrunds- eller baggrundsfarve enten er indstillet eller frakoblet, ikke indstillet betyder, at den ikke er tildelt til det pågældende element type og lavere prioriterede poster kan muligvis anvendes. </p> </body> </html> - + <html><head/><body><p>Check to indicate new DXCC entities, grid squares, and callsigns per mode.</p></body></html> <html><head/><body><p>Marker for at indikere nye DXCC Lande, Grid og Kaldesignaler pr Mode.</p></body></html> - + Highlight by Mode Highlight by Mode - + Include extra WAE entities Inkluder ekstra WAE lande - + Check to for grid highlighting to only apply to unworked grid fields Marker for kun at vise ikke kørte Lokator felter (Contest) - + Only grid Fields sought Vis kun ikke kørte GRID felter (Contest) - + <html><head/><body><p>Controls for Logbook of the World user lookup.</p></body></html> <html><head/><body><p>Kontrol for Logbook of the World bruger lookup.</p></body></html> - + Logbook of the World User Validation Logbook of the World Bruger Validering - + Users CSV file URL: Sti til Bruger CSV fil: - + <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> <html><head/><body> <p> URL til ARRL LotW-brugerens sidste uploaddatoer og -tidsdatafil, som bruges til at fremhæve dekodninger fra stationer, der vides at uploade deres logfil til LotW. </p> < / body> </ html> - URL - URL + URL https://lotw.arrl.org/lotw-user-activity.csv https://lotw.arrl.org/lotw-user-activity.csv - + <html><head/><body><p>Push this button to fetch the latest LotW user's upload date and time data file.</p></body></html> <html><head/><body><p>Tryk på denne knap for at hente seneste LotW bruger upload dato og tids data file.</p></body></html> - + Fetch Now Hent Nu - + Age of last upload less than: Alder på seneste upload mindre end: - + <html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html> <html><head/><body><p> Juster dette spin-felt for at indstille grænsen for alderen på LotW-brugers sidste upload-dato, der accepteres som en nuværende LotW-bruger.</p></body></html> - + days dage - + Advanced Avanceret - + <html><head/><body><p>User-selectable parameters for JT65 VHF/UHF/Microwave decoding.</p></body></html> <html><head/><body><p>Bruger valgte parametre for JT65 VHF/UHF/Microwave dekoning.</p></body></html> - + JT65 VHF/UHF/Microwave decoding parameters JT65/VHF/UHF/Microwave parametre - + Random erasure patterns: Tilfældige sletningsmønstre: - + <html><head/><body><p>Maximum number of erasure patterns for stochastic soft-decision Reed Solomon decoder is 10^(n/2).</p></body></html> <html><head/><body><p> Maksimum antal sletningsmønstre til stokastisk soft-beslutning Reed Solomon-dekoder er 10^(n/2).</p></body></html> - + Aggressive decoding level: Aggressiv dekoder niveau: - + <html><head/><body><p>Higher levels will increase the probability of decoding, but will also increase probability of a false decode.</p></body></html> <html><head/><body><p>Højere niveau vil øge dekodningen, men vil også øge chanchen for falske dekodninger.</p></body></html> - + Two-pass decoding To-pass dekodning @@ -9935,45 +12234,45 @@ Højre klik for at indsætte eller slette elementer. Special operations aktivitet: Generering af FT4, FT8 og MSK 144 meddelser - + <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> <html><head/><body><p>FT8 DXpedition mode: Hound operatører der kalder på DX.</p></body></html> - - + + Hound Hound - + <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> <html><head/><body><p>Nord Amerikansk VHF/UHF/Microwave contests og andre hvor 4 karakter Grid lokator er påkrævet for Contest rpt udveksling.</p></body></html> - + NA VHF Contest NA VHF Contest - + <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operatør.</p></body></html> - - + + Fox Fox - + <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> <html><head/><body><p>European VHF+ contests kræver en siganl rapport, serie nummer og 6 karakters lokator.</p></body></html> - - + + EU VHF Contest EU VHF Contest @@ -9982,687 +12281,987 @@ Højre klik for at indsætte eller slette elementer. <html><head/><body><p>ARRL RTTY Roundup og ligende contests. Exchange er US state, Canadian province, eller &quot;DX&quot;.</p></body></html> - R T T Y Roundup - R T T Y Roundup + R T T Y Roundup RTTY Roundup messages RTTY Roundup meddelser - RTTY Roundup exchange - RTTY Roundup udveksling + RTTY Roundup udveksling RTTY RU Exch: RTTU RU Exch: - + NJ NJ - - + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> <html><head/><body><p>ARRL Field Day exchange: antal transmittere, Class, og ARRL/RAC sektion eller &quot;DX&quot;.</p></body></html> - A R R L Field Day - A R R L Field Day + A R R L Field Day - + + ARRL Field Day ARRL Field Day - + + Field Day exchange Fiels Day udveksling - + FD Exch: FD Exch: - + 6A SNJ 6A SNJ - + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> - WW Digital Contest - WW Digital Contest + WW Digital Contest - + + WW Digi Contest WW Digi Contest - + Miscellaneous Diverse - + Degrade S/N of .wav file: Degrade S/N .wav.fil: - - + + For offline sensitivity tests Til offline følsomheds test - - + + dB dB - + Log automatically Log automatisk - + <html><head/><body><p>Use 'Log automatically' only for special operating activities.</p></body></html> <html><head/><body><p>Brug kun 'Log automatisk' til Special Operationer.</p></body></html> - + Contesting only Kun Contest - + <html><head/><body><p>Shorten 6-digit grid entries and log 4-digit grids instead.</p></body></html> <html><head/><body><p>Forkort 6-cifrede grids og log 4-cifrede grids i stedet.</p></body></html> - + Log 4-digit grids Log 4-digit grids - + Highlight also messages with 73 or RR73 Fremhæv også msg med 73 eller RR73 - - <html><head/><body><p>Highlight callsigns or grids with orange background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - <html><head/><body><p>Fremhæv kaldesignaler eller grid med orange baggrundsfarve. Kaldesignaler og/eller grid skal adskilles af et komma, og der skal være et komma efter hvert kaldesignal.</p></body></html> + <html><head/><body><p>Fremhæv kaldesignaler eller grid med orange baggrundsfarve. Kaldesignaler og/eller grid skal adskilles af et komma, og der skal være et komma efter hvert kaldesignal.</p></body></html> - + Highlight orange: Highlight orange - - <html><head/><body><p>Highlight callsigns or grids with blue background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - <html><head/><body><p>Fremhæv kaldesignaler eller grid med blå baggrundsfarve. Kaldesignaler og/eller grid skal adskilles af et komma, og der skal være et komma efter hvert kaldesignal.</p></body></html> + <html><head/><body><p>Fremhæv kaldesignaler eller grid med blå baggrundsfarve. Kaldesignaler og/eller grid skal adskilles af et komma, og der skal være et komma efter hvert kaldesignal.</p></body></html> - + Highlight blue: Highlight Blå - + http://lotw.arrl.org/lotw-user-activity.csv http://lotw.arrl.org/lotw-user-activity.csv - + CTY File Download CTY Fil Download - + CTY File Version: CTY Fil Version: - + Download Latest CTY.dat Download seneste CTY.dat - + CALL3 File Download CALL3 Fil Download - + CALL3 File Version: CALL3 Fil Version: - + Dowload latest CALL3.TXT file. Dowload seneste CALL3.TXT fil. - + Download CALL3.TXT for terrestrial use Download CALL3.TXT for terrestrial brug - + Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. Download den seneste CALL3.TXT-fil til EME. Denne version er egnet til JT65 Deep Search. - + Download CALL3.TXT for EME Download CALL3.TXT for EME - + GUI tweaks for high-resolution monitors GUI tweaks for high-resolution monitors - + <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> - + HighDPI scaling (restart required) HighDPI scaling (restart required) - + <html><head/><body><p>Increased height of some control elements.</p></body></html> <html><head/><body><p>Øget størrelse på nogle kontrolelementer.</p></body></html> - + Increased height of the tab widget (restart required) Øget højde på fanebladswidgeten (genstart kræves) - Enable Cloudlog Features - Aktiver Cloudlog funktioner + Aktiver Cloudlog funktioner - + API URL: API URL: - + API Key: API Key: - Station ID: - Station ID: + Station ID: - <html><head/><body><p>Test the Cloudlog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> - <html><head/><body><p>Test Cloudlog API-nøglen.</p><p>Knappen bliver grøn, hvis API-nøglen er skrivbar. Den bliver orange, hvis API-nøglen er skrivebeskyttet. Hvis API-nøglen er ugyldig, bliver den rød.</p></body></html> + <html><head/><body><p>Test Cloudlog API-nøglen.</p><p>Knappen bliver grøn, hvis API-nøglen er skrivbar. Den bliver orange, hvis API-nøglen er skrivebeskyttet. Hvis API-nøglen er ugyldig, bliver den rød.</p></body></html> - Test API Key - Test API Key + Test API Key - + Special operating activity Special operating aktivitet - + <html><head/><body><p>ARRL International Digital Contest</p></body></html> <html><head/><body><p>ARRL International Digital Contest</p></body></html> - + ARRL Digi Contest ARRL Digi Contest - + <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> <html><head/><body><p>Slå NCCC Sprint FT4-protokollen for korte msg til/fra.</p></body></html> - + NCCC Sprint NCCC Sprint - - + + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> <html><head/><body><p>FT Roundup og ligende contester. Exchange er US state, Canadian province, eller &quot;DX&quot;.</p></body></html> - + + FT Roundup messages FT Roundup messages - + FT RU Exch: FT RU Exch: - + <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> <html><head/><body><p>Markér dette felt for at sende (Fox) eller modtage (Hound) SuperFox Mode.</p></body></html> - + SuperFox mode SuperFox mode - + <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> <html><head/><body><p>Vis OTP messages i Bånd Aktivitets vinduet.</p></body></html> - + Show OTP messages Vis OTP Msg - + OTP URL: OTP URL: - + <html><head/><body><p>URL used to verify OTP codes.</p></body></html> <html><head/><body><p>URL brugt til at verificere OTP-koder.</p></body></html> - + https://www.9dx.cc https://www.9dx.cc - + NA VHF NA VHF - + <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> <html><head/><body><p>Klik for at aktivere OTP-metoden til Fox-verifiktion. Kræver internet.</p></body></html> - + OTP OTP - + Key: Key: - + <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> <html><head/><body><p>Fox key til at generere OTP-koder.</p></body></html> - + M2ZUU5CW6EVOY2HU M2ZUU5CW6EVOY2HU - + Interval Interval - + <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> <html><head/><body><p>Interval, hvormed OTP-msg sendes. Vælg 1 for at signere alle beskeder.</p></body></html> - + <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> <html><head/><body><p>Kald CQ med et individuelt Contest i stedet for TEST, RU eller WW (for eksempel CQ PACC).</p></body></html> - + CQ with individual contest name CQ med inviduel contest navn - + Contest name: Contest navn: - + <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> <html><head/><body><p>Brug 4-tegns lokator i stedet for signalrapport. Giver q3-niveau følsomheder for DX-operatøren. Især nyttig til 6m EME DX-peditioner.</p></body></html> - + Q65 Pileup Q65 Pileup - + Receiver bandwidth: Modtager båndbredde: - + + <html><head/><body><p>Download the latest libhamlib-4.dll file from Hamlib SourceForge snapshots. </p><p>Note: This function is only available on Windows.</p></body></html> + + + + + Delete Tx macro + + + + + Deletes the selected Tx macro, or the focused macro if no row is selected. + + + + + Move &Up + + + + + Move Tx macro up + + + + + Moves the selected Tx macro one position earlier in the list. + + + + + Move D&own + + + + + Move Tx macro down + + + + + Moves the selected Tx macro one position later in the list. + + + + + Drag and drop items to rearrange order +Right click for item specific actions +Click, SHIFT+Click and, CTRL+Click to select items + + + + + Saved Tx macro messages + + + + + Saved free-text messages for the main window Tx5 dropdown. Use Move Up and Move Down or drag and drop to reorder messages. + + + + + Change or reset colors for the selected highlighting rule. + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move Up + + + + + Move the selected highlighting rule later in priority order. + + + + + Move Down + + + + + Reset Highlighting to Default 1 + + + + + Reset Highlighting to Default 2 + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with orange background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with blue background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + LotW users CSV URL + + + + + + <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> + + + + + Cloudlog or Wavelog + + + + + + Upload QSOs to Cloudlog or Wavelog + + + + + + <html><head/><body><p>API URL for Cloudlog or Wavelog.</p></body></html> + + + + + + <html><head/><body><p>Your API key.</p></body></html> + + + + + + <html><head/><body><p>Your Cloudlog or Wavelog station profile.</p></body></html> + + + + + Station profile: + + + + + <html><head/><body><p>Check the Cloudlog or Wavelog connection, API key, station profile, and upload path where safe.</p><p>The button will turn green if the connection can upload QSOs, orange if the key is valid but read-only, and red if the configuration is unusable.</p></body></html> + + + + + Check Connection + + + + Hz Hz - + Tx delay: Tx delay: - + Minimum delay between assertion of PTT and start of Tx audio. Minimum forsinkelse mellen aktivering af PTT og start af Tx audio. - + s s - - + + Tone spacing Tone afstand - + <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> <html><head/><body><p>Generer Tx audio med dobbelt af den normale tone afstand. Beregnet til special LF/MF transmittere som bruger divideret med-2 før generering af RF.</p></body></html> - + + 2x tone spacing + + + + x 2 x2 - + <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> <html><head/><body><p>Generer Tx audio med 4 gange den normale tone afstand. Beregnet til special LF/MF transmittere som bruger divideret med-4 før generering af RF.</p></body></html> - + + 4x tone spacing + + + + x 4 x4 - - + + Waterfall spectra Vandfald Spektrum - + Low sidelobes Lave sidelobes - + Most sensitive Mest følsom - + + + <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> + + + + + eQSL.cc + + + + + + Upload QSOs to eQSL.cc + + + + + + <html><head/><body><p>Your username.</p></body></html> + + + + + Username: + + + + + + <html><head/><body><p>Your logon password.</p></body></html> + + + + + Password: + + + + + + <html><head/><body><p>Your QTH nickname, if you have more than one QTH.</p></body></html> + + + + + QTH: + + + + + + Enable special operating activity + + + + + Enable OTP verification + + + + + + OTP key + + + + + + OTP interval + + + + + + OTP URL + + + + + + FT Roundup exchange + + + + + + Contest name + + + + Alerts Alerts - + + NOTES + + + + + "Wanted callsigns, grids, prefixes and directional calls" uses the entries from "Highlight orange" and "Highlight blue". + + + + + <html><head/><body><p>Wanted callsigns, grids, prefixes and directional calls. This alert category uses the entries from &quot;Highlight orange&quot; and &quot;Highlight blue&quot;.</p></body></html> + + + + + Wanted callsigns, grids, prefixes and directional calls + + + + + IMPORTANT + + + + + Voices: + + + + + default + + + + + <html><head/><body><p>Test the alert sounds.</p></body></html> + + + + + Test + + + + Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. Advarselskategorier over linjen kræver, at feltet "Vis DXCC, grid og Work-B4-status" på fanen Generelt er markeret. - THIS FEATURE IS FOR EXPERIENCED USERS ONLY - DENNE FUNKTION ER KUN FOR ERFARNE BRUGERE + DENNE FUNKTION ER KUN FOR ERFARNE BRUGERE - + Ensure that you have made meaningful settings on the Colors tab, so that you see which message triggered the alert. Sørg for, at du har foretaget meningsfulde indstillinger på fanen Farver, så du kan se, hvilken besked der udløste advarslen. - + Ensure that your rig is NOT connected via "Default Device". Sørg for, at din Radio IKKE er tilsluttet via "Standardenhed". - + Audio Alerts Audio Alarm - - + + New ITU Zone on Band Ny ITU Zone på bånd - - + + New Continent Nyt Kontinent - - + + DX Call or DX Grid in message DX Call eller DX Grid i msg - - + + New Grid Ny Grid - - + + New Continent on Band Nyt kontinent på bånd - + Message received Msg modtaget - - + + New ITU Zone Ny ITU Zone - - + + New CQ Zone Ny CQ Zone - - + + New DXCC on Band Nyt DXCC på bånd - + My Call in message Mit kaldesignal i msg - + My Call Mit kaldesignal - - + + New CQ Zone on Band Ny CQ Zone på bånd - - + + New DXCC Nyt DXCC - - + + New Grid on Band Ny Grind på Bånd - - + + CQ in message CQ i meddelse - + Toggle Audio Alerts on/off. Alerts will be played on "DefaultAudioDevice". DON'T ENABLE AUDIO ALERTS WHEN YOUR RIG IS CONNECTED VIA THIS SOUNDCARD !!! Slå lydalarmer til/fra. Alarmer afspilles på "Standardlydenhed". AKTIVER IKKE LYDALARMER, NÅR DIN RADIO ER FORBUNDET VIA DETTE LYDKORT!!! - + Enable Audio Alerts Enable Audio Alamer - + This requirement is fulfilled when your rig is connected via USB audio. Dette krav er opfyldt, når dit udstyr er tilsluttet via USB-audio. - + Audio Alerts will be played on the default audio device (usually the loudspeaker of your PC). Audio alarmer afspilles på standardlydenheden (normalt højttaleren på din pc). - IMPORTANT NOTES - VIGTIGE BEMÆRKNINGER + VIGTIGE BEMÆRKNINGER - + Use of this feature requires that your computer is equipped with two sound cards. Brug af denne funktion kræver, at din computer er udstyret med to lydkort. - + Filters Filtre - + Territories 1-4 for the Hide checkboxes in the View menu Områder 1-4 for Skjul afkrydsningsfelterne i menuen Vis - + Blacklist Blacklist - + Filters for the Band Activity window Filtre for Band Activity vinduet - + Hide messages containing the following callsigns or keywords: Skjul msg, der indeholder følgende kaldesignaler eller nøgleord: - + Show only messages containing the following callsigns or keywords: Vis kun meddelser, der indeholder følgende kaldesignaler eller nøgleord: - + <html><head/><body><p>Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed).</p></body></html> <html><head/><body><p>Brug kun filtre til Wait og Pounce, CQ: Først osv. (alle msg vises stadig).</p></body></html> - + Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed) Brug kun filtre til Wait og Pounced, CQ: Først osv. (alle msg vises stadig) - + Always pass messages with the following keywords: Vis altid msg med følgende nøgleord: - + Whitelist Whitelist - + <html><head/><body><p>Apply filters only to the callsigns of the calling stations. Usually the second word of the messages is analyzed, for directional calls the third word.</p></body></html> <html><head/><body><p>Anvend kun filtre på kaldesignalerne fra de kaldende stationer. Normalt analyseres det andet ord i msg, for styret kald det tredje ord.</p></body></html> - + Apply filters only to the callsigns of the calling stations Anvend kun filtre på kaldesignalerne fra de kaldende stationer - + Always Pass Always Pass - + <html><head/><body><p>Use “worked today and yesterday” instead of “worked today” for the 3 related Quick Filters.</p></body></html> <html><head/><body><p>Brug "kørt i dag og i går" i stedet for "kørt i dag" for de 3 relaterede Quickfiltre.</p></body></html> - + Quick Filters: Hide/Ignore/Highlight "worked today and yesterday" instead of "worked today" (UTC) Hurtige filtre: Skjul/ignorer/fremhæv "kørt i dag og i går" i stedet for "kørt i dag" (UTC) - + <html><head/><body><p>Discard (Cancel) or apply (OK) configuration changes including</p><p>resetting the radio interface and applying any soundcard changes</p></body></html> <html><head/><body><p> Forkast (Annuller) eller anvend (OK) konfigurationsændringer inklusive</p><p>nulstilling af radiog interface og anvendelse af lydkortændringer</p></body></html> @@ -10678,61 +13277,118 @@ Højre klik for at indsætte eller slette elementer. Uventet fatal fejl + Another instance may be running - En anden udgave af programmet kører måske + En anden udgave af programmet kører måske try to remove stale lock file? forsøg at fjerne uaktuelle låste filer? - + + Lock file: %1 + + + + + Owner process: %1 + + + + + Owner application: %1 + + + + + Owner host: %1 + + + + + Owner information is not available. + + + + + Remove error: %1 + + + + + WSJT-X could not lock its temporary instance file. + +If another WSJT-X window is still running, choose No. +Use a unique rig name to run more than one instance. + +If WSJT-X crashed or will not restart, choose Remove Lock File. +Choose Retry after closing the other instance. + + + + + Remove Lock File + + + + + Unable to remove stale lock file + + + + + Close any running WSJT-X instance or remove the lock file manually after confirming WSJT-X is not running. + + + + Failed to create a temporary directory Fejl ved forsøg på at oprette midlertidig mappe - - + + Path: "%1" Sti: "%1" - + Failed to create a usable temporary directory Fejl i forsøg på at oprette brugbar midlertidig mappe - + Another application may be locking the directory En anden applikation spærrer måske mappen - + Failed to create data directory Kan ikke oprette Data mappe - + path: "%1" Sti: "%1" - + Shared memory error Delt hukommelse fejl - + Unable to create shared memory segment Kan ikke oprette delt hukommelse segment - + Sub-process error Under-rutine fejl - + Failed to close orphaned jt9 process Fejl ved lukning af jt9 proces diff --git a/translations/wsjtx_de.ts b/translations/wsjtx_de.ts new file mode 100644 index 00000000..8065b8ef --- /dev/null +++ b/translations/wsjtx_de.ts @@ -0,0 +1,9953 @@ + + + + AbstractLogWindow + + + &Delete ... + &Löschen ... + + + + AbstractLogWindow::impl + + + Confirm Delete + Löschen bestätigen + + + + Are you sure you want to delete the %n selected QSO(s) from the log? + + Möchten Sie das %n ausgewählte QSO wirklich aus dem Log löschen? + Möchten Sie die %n ausgewählten QSOs wirklich aus dem Log löschen? + + + + + ActiveStations + + + Message Averaging + Nachrichtenmittelung + + + + Band Changes: + Bandwechsel: + + + + <html><head/><body><p>Total score accumulated since most recent reset of Cabrillo log.</p></body></html> + <html><head/><body><p>Gesamtpunktzahl seit dem letzten Zurücksetzen des Cabrillo-Logs.</p></body></html> + + + + + + 0 + 0 + + + + <html><head/><body><p>Points logged during the past hour.</p></body></html> + <html><head/><body><p>In der letzten Stunde protokollierte Punkte.</p></body></html> + + + + <html><head/><body><p>Check this box to show only stations ready to be called.</p></body></html> + <html><head/><body><p>Aktivieren Sie dieses Kontrollkästchen, um nur Stationen anzuzeigen, die angerufen werden können.</p></body></html> + + + + Ready only + Nur bereit + + + + # Wanted only + # Nur gesuchte + + + + Score: + Punktzahl: + + + + Rate: + Rate: + + + + <html><head/><body><p>Set maximum elapsed number of T/R sequences.</p></body></html> + <html><head/><body><p>Maximale Anzahl abgelaufener Sende-/Empfangssequenzen festlegen.</p></body></html> + + + + Max Age + Max. Alter + + + + <html><head/><body><p>Set maximum number of displayed lines.</p></body></html> + <html><head/><body><p>Maximale Anzahl angezeigter Zeilen festlegen.</p></body></html> + + + + Max N + Max. N + + + + <html><head/><body><p>Number of band changes during the past hour.</p></body></html> + <html><head/><body><p>Anzahl der Bandwechsel in der letzten Stunde.</p></body></html> + + + + <html><head/><body><p>Click on a line to call that station. </p><p>When using QMAP, single click to transfer QSO data and sked frequency to WSJT-X, and double click to call that station.</p></body></html> + <html><head/><body><p>Klicken Sie auf eine Zeile, um diese Station anzurufen.</p><p>Bei Verwendung von QMAP: Einmal klicken, um QSO-Daten und Sked-Frequenz an WSJT-X zu übertragen, doppelt klicken, um die Station anzurufen.</p></body></html> + + + + Active Stations + Aktive Stationen + + + + + Wanted only + Nur gesuchte + + + + Message + Nachricht + + + + My call only + Nur mein Rufzeichen + + + + Astro + + + + Doppler tracking + Doppler-Nachführung + + + + <html><head/><body><p>One station does all Doppler shift correction, their QSO partner receives and transmits on the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> + <html><head/><body><p>Eine Station führt die gesamte Doppler-Korrektur durch; der QSO-Partner empfängt und sendet auf der Sked-Frequenz.</p><p>Wenn das Funkgerät während des Sendens keine CAT-QSY-Befehle akzeptiert, wird eine einzige Korrektur für die gesamte Sendeperiode angewendet.</p></body></html> + + + + Full Doppler to DX Grid + Volle Doppler-Korrektur zum DX-Locator + + + + <html><head/><body><p>Transmit takes place on sked frequency and receive frequency is corrected for own echoes. </p><p>This mode can be used for calling CQ, or when using Echo mode.</p></body></html> + <html><head/><body><p>Gesendet wird auf der Sked-Frequenz; die Empfangsfrequenz wird für das eigene Echo korrigiert.</p><p>Dieser Modus kann zum CQ-Rufen oder im Echo-Modus verwendet werden.</p></body></html> + + + + Own Echo + Eigenes Echo + + + + <html><head/><body><p>Both stations correct for Doppler shift such that they would be heard on the moon at the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p><p>Use this option also for Echo mode.</p></body></html> + <html><head/><body><p>Beide Stationen korrigieren die Doppler-Verschiebung so, dass sie auf dem Mond auf der Sked-Frequenz zu hören wären.</p><p>Wenn das Funkgerät während des Sendens keine CAT-QSY-Befehle akzeptiert, wird eine einzige Korrektur für die gesamte Sendeperiode angewendet.</p><p>Verwenden Sie diese Option auch für den Echo-Modus.</p></body></html> + + + + Constant frequency on Moon + Konstante Frequenz auf dem Mond + + + + <html><head/><body><p>DX station announces their TX Freq, which is entered as the Sked Freq. Correction applied to RX and TX so you appear on the DX's station's own echo Freq.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> + <html><head/><body><p>Die DX-Station gibt ihre TX-Frequenz an, die als Sked-Frequenz eingegeben wird. Die Korrektur wird auf RX und TX angewendet, sodass Sie auf der Eigen-Echo-Frequenz der DX-Station erscheinen.</p><p>Wenn das Funkgerät während des Sendens keine CAT-QSY-Befehle akzeptiert, wird eine einzige Korrektur für die gesamte Sendeperiode angewendet.</p></body></html> + + + + On DX Echo + Auf DX-Echo + + + + <html><head/><body><p>Tune radio manually and select this mode to put your echo on the same frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> + <html><head/><body><p>Stimmen Sie das Funkgerät manuell ab und wählen Sie diesen Modus, um Ihr Echo auf dieselbe Frequenz zu legen.</p><p>Wenn das Funkgerät während des Sendens keine CAT-QSY-Befehle akzeptiert, wird eine einzige Korrektur für die gesamte Sendeperiode angewendet.</p></body></html> + + + + Call DX + DX anrufen + + + + <html><head/><body><p>No Doppler shift correction is applied. This may be used when the QSO partner does full Doppler correction to your grid square.</p></body></html> + <html><head/><body><p>Es wird keine Doppler-Korrektur angewendet. Dies kann verwendet werden, wenn der QSO-Partner die vollständige Doppler-Korrektur zu Ihrem Locator durchführt.</p></body></html> + + + + None + Keine + + + + Sked frequency + Sked-Frequenz + + + + + 0 + 0 + + + + Rx: + Rx: + + + + Tx: + Tx: + + + + <html><head/><body><p>Press and hold the CTRL key to adjust the sked frequency manually with the rig's VFO dial or enter frequency directly into the band entry field on the main window.</p></body></html> + <html><head/><body><p>Halten Sie die STRG-Taste gedrückt, um die Sked-Frequenz manuell mit dem VFO des Funkgeräts einzustellen, oder geben Sie die Frequenz direkt in das Band-Eingabefeld des Hauptfensters ein.</p></body></html> + + + + Echo Mode + Echo-Modus + + + + Hz + Hz + + + + RIT + RIT + + + + Dither + Dither + + + + Tx Shift relative to Rx Sked Freq + Tx-Verschiebung relativ zur Rx-Sked-Frequenz + + + + Enter large offset + Großen Offset eingeben + + + + MHz + MHz + + + + Shift + Verschiebung + + + + Enable + Aktivieren + + + + Astro Data + Astro-Daten + + + + Astronomical Data + Astronomische Daten + + + + Bands + + + Band name + Bandname + + + + Lower frequency limit + Untere Frequenzgrenze + + + + Upper frequency limit + Obere Frequenzgrenze + + + + Band + Band + + + + Lower Limit + Untere Grenze + + + + Upper Limit + Obere Grenze + + + + CAboutDlg + + + About WSJT-X + Über WSJT-X + + + + OK + OK + + + + CabrilloLog + + + Freq(MHz) + Freq (MHz) + + + + Mode + Modus + + + + Date & Time(UTC) + Datum & Zeit (UTC) + + + + Call + Rufzeichen + + + + Sent + Gesendet + + + + Rcvd + Empfangen + + + + Band + Band + + + + CabrilloLogWindow + + + Contest Log + Contest-Log + + + + <html><head/><body><p>Right-click here for available actions.</p></body></html> + <html><head/><body><p>Rechtsklick für verfügbare Aktionen.</p></body></html> + + + + Right-click here for available actions. + Rechtsklick für verfügbare Aktionen. + + + + 0 QSOs + 0 QSOs + + + + CallsignDialog + + + Callsign + Rufzeichen + + + + ColorHighlighting + + + + + + + + + + + + + + + + + + K1ABC + K1ABC + + + + CQ in message + CQ in Nachricht + + + + My Call in message + Mein Rufzeichen in Nachricht + + + + Transmitted message + Gesendete Nachricht + + + + New DXCC + Neues DXCC + + + + New Grid + Neuer Locator + + + + New DXCC on Band + Neues DXCC auf Band + + + + New Call + Neues Rufzeichen + + + + New Grid on Band + Neuer Locator auf Band + + + + New Call on Band + Neues Rufzeichen auf Band + + + + Uploads to LotW + Lädt zu LoTW hoch + + + + New Continent + Neuer Kontinent + + + + New Continent on Band + Neuer Kontinent auf Band + + + + New CQ Zone + Neue CQ-Zone + + + + New CQ Zone on Band + Neue CQ-Zone auf Band + + + + New ITU Zone + Neue ITU-Zone + + + + New ITU Zone on Band + Neue ITU-Zone auf Band + + + + Configuration::impl + + + + + &Delete + &Löschen + + + + + &Insert ... + &Einfügen ... + + + + Failed to create save directory + Speicherverzeichnis konnte nicht erstellt werden + + + + path: "%1% + Pfad: "%1% + + + + Failed to create samples directory + Beispielverzeichnis konnte nicht erstellt werden + + + + path: "%1" + Pfad: "%1" + + + + API key OK + API-Schlüssel OK + + + + API key read-only + API-Schlüssel nur lesbar + + + + API key invalid + API-Schlüssel ungültig + + + + &Load ... + &Laden ... + + + + &Save as ... + &Speichern unter ... + + + + &Merge ... + &Zusammenführen ... + + + + &Reset + &Zurücksetzen + + + + Serial Port: + Serieller Port: + + + + Serial port used for CAT control + Serieller Port für CAT-Steuerung + + + + TCI Server: + TCI-Server: + + + + Optional hostname and port of TCI service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port + Optionaler Hostname und Port des TCI-Dienstes. +Leer lassen für einen sinnvollen Standardwert auf diesem Rechner. +Formate: + Hostname:Port + IPv4-Adresse:Port + [IPv6-Adresse]:Port + + + + Network Server: + Netzwerkserver: + + + + Optional hostname and port of network service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port + Optionaler Hostname und Port des Netzwerkdienstes. +Leer lassen für einen sinnvollen Standardwert auf diesem Rechner. +Formate: + Hostname:Port + IPv4-Adresse:Port + [IPv6-Adresse]:Port + + + + USB Device: + USB-Gerät: + + + + Optional device identification. +Leave blank for a sensible default for the rig. +Format: + [VID[:PID[:VENDOR[:PRODUCT]]]] + Optionale Gerätekennung. +Leer lassen für einen sinnvollen Standardwert für das Funkgerät. +Format: + [VID[:PID[:VENDOR[:PRODUCT]]]] + + + + + Invalid audio input device + Ungültiges Audio-Eingabegerät + + + + Invalid audio output device + Ungültiges Audio-Ausgabegerät + + + + Invalid PTT method + Ungültige PTT-Methode + + + + Invalid PTT port + Ungültiger PTT-Port + + + + + Invalid Contest Exchange + Ungültiger Contest-Austausch + + + + You must input a valid ARRL Field Day exchange + Sie müssen einen gültigen ARRL-Field-Day-Austausch eingeben + + + + You must input a valid ARRL RTTY Roundup exchange + Sie müssen einen gültigen ARRL-RTTY-Roundup-Austausch eingeben + + + + Pending DNS lookup, please try again later + DNS-Abfrage läuft, bitte später erneut versuchen + + + + + Reset Decode Highlighting + Dekodierungs-Hervorhebung zurücksetzen + + + + + Reset all decode highlighting and priorities to default values + Alle Dekodierungs-Hervorhebungen und Prioritäten auf Standardwerte zurücksetzen + + + + Error Loading CTY.DAT + Fehler beim Laden von CTY.DAT + + + + Error Loading CALL3.TXT file + Fehler beim Laden der Datei CALL3.TXT + + + + WSJT-X Decoded Text Font Chooser + Schriftauswahl für dekodierten WSJT-X-Text + + + + + Hamlib update only available on Windows. + Hamlib-Aktualisierung nur unter Windows verfügbar. + + + + Error Loading libhamlib-4.dll + Fehler beim Laden von libhamlib-4.dll + + + + Hamlib Update successful + +New Hamlib will be used after restart + Hamlib-Aktualisierung erfolgreich + +Die neue Hamlib-Version wird nach einem Neustart verwendet + + + + Hamlib successfully reverted + +Reverted Hamlib will be used after restart + Hamlib erfolgreich zurückgesetzt + +Die zurückgesetzte Hamlib-Version wird nach einem Neustart verwendet + + + + No Hamlib update found that could be reverted + Keine Hamlib-Aktualisierung gefunden, die zurückgesetzt werden konnte + + + + Error in network address + Fehler in der Netzwerkadresse + + + + UDP server DNS lookup failed + DNS-Abfrage des UDP-Servers fehlgeschlagen + + + + MAC-ambiguous multicast groups addresses not supported + MAC-mehrdeutige Multicast-Gruppenadressen werden nicht unterstützt + + + + Load Working Frequencies + Arbeitsfrequenzen laden + + + + + + Frequency files (*.qrg *.qrg.json);;All files (*.*) + Frequenzdateien (*.qrg *.qrg.json);;Alle Dateien (*.*) + + + + Replace Working Frequencies + Arbeitsfrequenzen ersetzen + + + + Are you sure you want to discard your current working frequencies and replace them with the loaded ones? + Möchten Sie Ihre aktuellen Arbeitsfrequenzen wirklich verwerfen und durch die geladenen ersetzen? + + + + Merge Working Frequencies + Arbeitsfrequenzen zusammenführen + + + + Error reading frequency file + Fehler beim Lesen der Frequenzdatei + + + + + + Not a valid frequencies file + Keine gültige Frequenzdatei + + + + Incorrect file magic + Falsche Dateikennung + + + + Version is too new + Version ist zu neu + + + + Contents corrupt + Inhalt beschädigt + + + + Save Working Frequencies + Arbeitsfrequenzen speichern + + + + Only Save Selected Working Frequencies + Nur ausgewählte Arbeitsfrequenzen speichern + + + + Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. + Möchten Sie wirklich nur die aktuell ausgewählten Arbeitsfrequenzen speichern? Klicken Sie auf Nein, um alle zu speichern. + + + + Reset Working Frequencies + Arbeitsfrequenzen zurücksetzen + + + + Are you sure you want to discard your current working frequencies and replace them with default ones? + Möchten Sie Ihre aktuellen Arbeitsfrequenzen wirklich verwerfen und durch die Standardwerte ersetzen? + + + + Save Directory + Speicherverzeichnis + + + + AzEl Directory + AzEl-Verzeichnis + + + + Rig control error + Fehler bei der Funkgerätesteuerung + + + + Failed to open connection to rig + Verbindung zum Funkgerät konnte nicht geöffnet werden + + + + Rig failure + Funkgerätfehler + + + + Not found + audio device missing + Nicht gefunden + + + + DXLabSuiteCommanderTransceiver + + + Failed to connect to DX Lab Suite Commander + + Verbindung zu DX Lab Suite Commander fehlgeschlagen + + + + + DX Lab Suite Commander didn't respond correctly reading frequency: + DX Lab Suite Commander antwortete beim Lesen der Frequenz nicht korrekt: + + + + DX Lab Suite Commander sent an unrecognised TX state: + DX Lab Suite Commander meldete einen unbekannten TX-Status: + + + + DX Lab Suite Commander didn't respond correctly polling TX status: + DX Lab Suite Commander antwortete beim Abfragen des TX-Status nicht korrekt: + + + + Transceiver did not respond to PTT On/Off quickly enough; +reduce DX Lab Suite Commander's 'Command Interval' setting +or contact DXLab support at DXLab@groups.io. + Der Transceiver reagierte nicht schnell genug auf PTT Ein/Aus; +verringern Sie in DX Lab Suite Commander die Einstellung „Command Interval“ +oder wenden Sie sich an den DXLab-Support unter DXLab@groups.io. + + + + DX Lab Suite Commander didn't respond correctly polling frequency: + DX Lab Suite Commander antwortete beim Abfragen der Frequenz nicht korrekt: + + + + DX Lab Suite Commander didn't respond correctly polling TX frequency: + DX Lab Suite Commander antwortete beim Abfragen der TX-Frequenz nicht korrekt: + + + + DX Lab Suite Commander sent an unrecognised split state: + DX Lab Suite Commander meldete einen unbekannten Split-Status: + + + + DX Lab Suite Commander didn't respond correctly polling split status: + DX Lab Suite Commander antwortete beim Abfragen des Split-Status nicht korrekt: + + + + DX Lab Suite Commander sent an unrecognised mode: " + DX Lab Suite Commander meldete einen unbekannten Modus: " + + + + DX Lab Suite Commander didn't respond correctly polling mode: + DX Lab Suite Commander antwortete beim Abfragen des Modus nicht korrekt: + + + + DX Lab Suite Commander send command failed + + Senden des Befehls an DX Lab Suite Commander fehlgeschlagen + + + + + DX Lab Suite Commander send command failed "%1": %2 + + Senden des Befehls an DX Lab Suite Commander fehlgeschlagen "%1": %2 + + + + + DX Lab Suite Commander send command "%1" read reply failed: %2 + + Antwort auf den an DX Lab Suite Commander gesendeten Befehl "%1" konnte nicht gelesen werden: %2 + + + + + DX Lab Suite Commander retries exhausted sending command "%1" + Maximale Anzahl Wiederholungen beim Senden des Befehls "%1" an DX Lab Suite Commander erreicht + + + + DX Lab Suite Commander sent an unrecognized frequency + DX Lab Suite Commander meldete eine nicht erkannte Frequenz + + + + DecodeHighlightingListView + + + &Foreground color ... + &Vordergrundfarbe ... + + + + Choose %1 Foreground Color + Vordergrundfarbe für %1 wählen + + + + &Unset foreground color + Vordergrundfarbe &aufheben + + + + &Background color ... + &Hintergrundfarbe ... + + + + Choose %1 Background Color + Hintergrundfarbe für %1 wählen + + + + U&nset background color + Hintergrundfarbe a&ufheben + + + + &Reset this item to defaults + &Diesen Eintrag auf Standardwerte zurücksetzen + + + + DecodeHighlightingModel + + + CQ in message + CQ in Nachricht + + + + My Call in message + Mein Rufzeichen in Nachricht + + + + Transmitted message + Gesendete Nachricht + + + + New DXCC + Neues DXCC + + + + New DXCC on Band + Neues DXCC auf Band + + + + New Grid + Neuer Locator + + + + New Grid on Band + Neuer Locator auf Band + + + + New Call + Neues Rufzeichen + + + + New Call on Band + Neues Rufzeichen auf Band + + + + New Continent + Neuer Kontinent + + + + New Continent on Band + Neuer Kontinent auf Band + + + + New CQ Zone + Neue CQ-Zone + + + + New CQ Zone on Band + Neue CQ-Zone auf Band + + + + New ITU Zone + Neue ITU-Zone + + + + New ITU Zone on Band + Neue ITU-Zone auf Band + + + + LoTW User + LoTW-Benutzer + + + + f/g unset + Vordergrund nicht gesetzt + + + + b/g unset + Hintergrund nicht gesetzt + + + + Highlight Type + Hervorhebungstyp + + + + Designer + + + &Delete + &Löschen + + + + &Insert ... + &Einfügen ... + + + + Insert &after ... + &Danach einfügen ... + + + + Import Palette + Palette importieren + + + + + Palettes (*.pal) + Paletten (*.pal) + + + + Export Palette + Palette exportieren + + + + Dialog + + + Gray time: + Graue Zeit: + + + + Directory + + + File + Datei + + + + Progress + Fortschritt + + + + + URL Error + URL-Fehler + + + + + Invalid URL: +"%1" + Ungültige URL: +"%1" + + + + + + + + + + JSON Error + JSON-Fehler + + + + Contents file syntax error %1 at character offset %2 + Syntaxfehler in Inhaltsdatei %1 bei Zeichenposition %2 + + + + Contents file top level must be a JSON array + Oberste Ebene der Inhaltsdatei muss ein JSON-Array sein + + + + File System Error + Dateisystemfehler + + + + Failed to open "%1" +Error: %2 - %3 + "%1" konnte nicht geöffnet werden +Fehler: %2 - %3 + + + + Contents entries must be a JSON array + Inhaltseinträge müssen ein JSON-Array sein + + + + Contents entries must have a valid type + Inhaltseinträge müssen einen gültigen Typ haben + + + + Contents entries must have a valid name + Inhaltseinträge müssen einen gültigen Namen haben + + + + Contents entries must be JSON objects + Inhaltseinträge müssen JSON-Objekte sein + + + + Contents directories must be relative and within "%1" + Inhaltsverzeichnisse müssen relativ sein und innerhalb von "%1" liegen + + + + Network Error + Netzwerkfehler + + + + Authentication required + Authentifizierung erforderlich + + + + DisplayText + + + &Erase + &Löschen + + + + EchoGraph + + + + Echo Graph + Echo-Diagramm + + + + <html><head/><body><p>Compression factor for frequency scale</p></body></html> + <html><head/><body><p>Kompressionsfaktor der Frequenzskala</p></body></html> + + + + Bins/Pixel + Bins/Pixel + + + + Gain + Verstärkung + + + + <html><head/><body><p>Echo spectrum gain</p></body></html> + <html><head/><body><p>Verstärkung des Echo-Spektrums</p></body></html> + + + + Zero + Null + + + + <html><head/><body><p>Echo spectrum zero</p></body></html> + <html><head/><body><p>Nullpunkt des Echo-Spektrums</p></body></html> + + + + Baseline + Basislinie + + + + <html><head/><body><p>Smoothing of echo spectrum</p></body></html> + <html><head/><body><p>Glättung des Echo-Spektrums</p></body></html> + + + + Smooth + Glätten + + + + <html><head/><body><p>Number of echo transmissions averaged</p></body></html> + <html><head/><body><p>Anzahl gemittelter Echo-Sendungen</p></body></html> + + + + N: 0 + N: 0 + + + + <html><head/><body><p>Click to cycle through a sequence of colors and line widths.</p></body></html> + <html><head/><body><p>Klicken, um durch eine Folge von Farben und Linienbreiten zu wechseln.</p></body></html> + + + + Colors + Farben + + + + EmulateSplitTransceiver + + + Emulated split mode requires rig to be in simplex mode + Emulierter Split-Modus erfordert, dass das Funkgerät im Simplex-Modus ist + + + + EqualizationToolsDialog::impl + + + Equalization Tools + Entzerrungswerkzeuge + + + + Phase + Phase + + + + + Freq (Hz) + Freq (Hz) + + + + Phase (Π) + Phase (Π) + + + + Delay (ms) + Verzögerung (ms) + + + + Measured + Gemessen + + + + Proposed + Vorgeschlagen + + + + Current + Aktuell + + + + Group Delay + Gruppenlaufzeit + + + + Amplitude + Amplitude + + + + Relative Power (dB) + Relative Leistung (dB) + + + + Reference + Referenz + + + + Phase ... + Phase ... + + + + Refresh + Aktualisieren + + + + Discard Measured + Messwerte verwerfen + + + + ExistingNameDialog + + + Configuration to Clone From + Zu klonende Konfiguration + + + + &Source Configuration Name: + &Name der Quellkonfiguration: + + + + ExportCabrillo + + + Dialog + Dialog + + + + Location: + Standort: + + + + SNJ + SNJ + + + + Contest: + Contest: + + + + ARRL-RTTY + ARRL-RTTY + + + + Callsign: + Rufzeichen: + + + + Category-Operator: + Kategorie-Operator: + + + + SINGLE-OP + SINGLE-OP + + + + Category-Transmitter: + Kategorie-Sender: + + + + ONE + ONE + + + + Category-Power: + Kategorie-Leistung: + + + + LOW + LOW + + + + Category-Assisted: + Kategorie-Unterstützung: + + + + NON-ASSISTED + NON-ASSISTED + + + + Category-Band: + Kategorie-Band: + + + + ALL + ALL + + + + Claimed-Score: + Beanspruchte Punktzahl: + + + + Operators: + Operatoren: + + + + Club: + Club: + + + + Name: + Name: + + + + + Address: + Adresse: + + + + Save Log File + Logdatei speichern + + + + Cabrillo Log (*.cbr) + Cabrillo-Log (*.cbr) + + + + Cannot open "%1" for writing: %2 + "%1" kann nicht zum Schreiben geöffnet werden: %2 + + + + Export Cabrillo File Error + Fehler beim Export der Cabrillo-Datei + + + + FastGraph + + + + Fast Graph + Schnelles Diagramm + + + + Waterfall gain + Wasserfall-Verstärkung + + + + Waterfall zero + Wasserfall-Nullpunkt + + + + Spectrum zero + Spektrum-Nullpunkt + + + + <html><head/><body><p>Set reasonable levels for gain and zero sliders.</p></body></html> + <html><head/><body><p>Sinnvolle Werte für Verstärkungs- und Nullpunktregler einstellen.</p></body></html> + + + + Auto Level + Auto-Pegel + + + + FileDownload + + + Network Error - SSL/TLS support not installed, cannot fetch: +'%1' + Netzwerkfehler – SSL/TLS-Unterstützung nicht installiert, Abruf nicht möglich: +'%1' + + + + Network Error - Too many redirects: +'%1' + Netzwerkfehler – Zu viele Weiterleitungen: +'%1' + + + + Network Error: +%1 + Netzwerkfehler: +%1 + + + + FoxLog::impl + + + Date & Time(UTC) + Datum & Zeit (UTC) + + + + Call + Rufzeichen + + + + Grid + Locator + + + + Sent + Gesendet + + + + Rcvd + Empfangen + + + + Band + Band + + + + FoxLogWindow + + + Fox Log + Fox-Log + + + + <html><head/><body><p>Right-click here for available actions.</p></body></html> + <html><head/><body><p>Rechtsklick für verfügbare Aktionen.</p></body></html> + + + + Callers: + Anrufer: + + + + + + N + N + + + + In progress: + In Bearbeitung: + + + + Rate: + Rate: + + + + <html><head/><body><p>Last 10: Average rate (QSOs/hour) for the last 10 QSOs.<br/>Last 100: Average rate (QSOs/hour) for the last 100 QSOs. <br/>Last 60m: Average rate (QSOs/hour) for the last 60 minutes.</span></p></body></html> + <html><head/><body><p>Letzte 10: Durchschnittsrate (QSOs/Stunde) der letzten 10 QSOs.<br/>Letzte 100: Durchschnittsrate (QSOs/Stunde) der letzten 100 QSOs.<br/>Letzte 60 Min.: Durchschnittsrate (QSOs/Stunde) der letzten 60 Minuten.</p></body></html> + + + + &Export ADIF ... + &ADIF exportieren ... + + + + Export ADIF Log File + ADIF-Logdatei exportieren + + + + ADIF Log (*.adi) + ADIF-Log (*.adi) + + + + Export ADIF File Error + Fehler beim Export der ADIF-Datei + + + + Cannot open "%1" for writing: %2 + "%1" kann nicht zum Schreiben geöffnet werden: %2 + + + + &Reset ... + &Zurücksetzen ... + + + + Confirm Reset + Zurücksetzen bestätigen + + + + Are you sure you want to erase file FoxQSO.txt and start a new Fox log? + Möchten Sie die Datei FoxQSO.txt wirklich löschen und ein neues Fox-Log beginnen? + + + + FrequencyDialog + + + Add Frequency + Frequenz hinzufügen + + + + IARU &Region: + IARU-&Region: + + + + &Mode: + &Modus: + + + + &Frequency (MHz): + &Frequenz (MHz): + + + + &Preferred for Band/Mode: + &Bevorzugt für Band/Modus: + + + + &Description: + &Beschreibung: + + + + &Enable Date Range: + &Datumsbereich aktivieren: + + + + S&tart: + S&tart: + + + + &End: + &Ende: + + + + &Source: + &Quelle: + + + + Invalid Date Range + Ungültiger Datumsbereich + + + + Start date must be before end date + Das Startdatum muss vor dem Enddatum liegen + + + + FrequencyList_v2_101 + + + + IARU Region + IARU-Region + + + + + Mode + Modus + + + + + Frequency + Frequenz + + + + + Frequency (MHz) + Frequenz (MHz) + + + + + Description + Beschreibung + + + + + Source + Quelle + + + + Start Time + Startzeit + + + + End Time + Endzeit + + + + + Pref + Bevorzugt + + + + Start Date/Time + Startdatum/-zeit + + + + End Date/Time + Enddatum/-zeit + + + + Failed to parse JSON file + JSON-Datei konnte nicht ausgewertet werden + + + + Information Missing + Information fehlt + + + + No Frequencies were found + Keine Frequenzen gefunden + + + + Loaded Frequencies from %1 + Frequenzen aus %1 geladen + + + + Entries Valid/Skipped %1 + Einträge gültig/übersprungen %1 + + + + HRDTransceiver + + + + Failed to connect to Ham Radio Deluxe + + Verbindung zu Ham Radio Deluxe fehlgeschlagen + + + + + Failed to open file "%1": %2. + Datei "%1" konnte nicht geöffnet werden: %2. + + + + + Ham Radio Deluxe: no rig found + Ham Radio Deluxe: kein Funkgerät gefunden + + + + Ham Radio Deluxe: rig doesn't support mode + Ham Radio Deluxe: Funkgerät unterstützt diesen Modus nicht + + + + Ham Radio Deluxe: sent an unrecognised mode + Ham Radio Deluxe: unbekannter Modus gemeldet + + + + Ham Radio Deluxe: item not found in %1 dropdown list + Ham Radio Deluxe: Eintrag nicht in der Auswahlliste %1 gefunden + + + + Ham Radio Deluxe: button not available + Ham Radio Deluxe: Schaltfläche nicht verfügbar + + + + Ham Radio Deluxe didn't respond as expected + Ham Radio Deluxe antwortete nicht wie erwartet + + + + Ham Radio Deluxe: rig has disappeared or changed + Ham Radio Deluxe: Funkgerät ist verschwunden oder wurde geändert + + + + Ham Radio Deluxe send command "%1" failed %2 + + Ham Radio Deluxe: Senden des Befehls "%1" fehlgeschlagen %2 + + + + + + Ham Radio Deluxe: failed to write command "%1" + Ham Radio Deluxe: Schreiben des Befehls "%1" fehlgeschlagen + + + + Ham Radio Deluxe sent an invalid reply to our command "%1" + Ham Radio Deluxe sendete eine ungültige Antwort auf unseren Befehl "%1" + + + + Ham Radio Deluxe failed to reply to command "%1" %2 + + Ham Radio Deluxe antwortete nicht auf Befehl "%1" %2 + + + + + Ham Radio Deluxe retries exhausted sending command "%1" + Maximale Anzahl Wiederholungen beim Senden des Befehls "%1" an Ham Radio Deluxe erreicht + + + + Ham Radio Deluxe didn't respond to command "%1" as expected + Ham Radio Deluxe antwortete auf Befehl "%1" nicht wie erwartet + + + + HamlibTransceiver + + + + Hamlib initialisation error + Hamlib-Initialisierungsfehler + + + + Hamlib settings file error: %1 at character offset %2 + Fehler in Hamlib-Einstellungsdatei: %1 bei Zeichenposition %2 + + + + Hamlib settings file error: top level must be a JSON object + Fehler in Hamlib-Einstellungsdatei: oberste Ebene muss ein JSON-Objekt sein + + + + Hamlib settings file error: config must be a JSON object + Fehler in Hamlib-Einstellungsdatei: Konfiguration muss ein JSON-Objekt sein + + + + Unsupported CAT type + Nicht unterstützter CAT-Typ + + + + Hamlib error: %1 while %2 + Hamlib-Fehler: %1 beim %2 + + + + opening connection to rig + Öffnen der Verbindung zum Funkgerät + + + + getting current frequency + Abfragen der aktuellen Frequenz + + + + getting current mode + Abfragen des aktuellen Modus + + + + + exchanging VFOs + Vertauschen der VFOs + + + + + getting other VFO frequency + Abfragen der Frequenz des anderen VFO + + + + getting other VFO mode + Abfragen des Modus des anderen VFO + + + + + setting current VFO + Setzen des aktuellen VFO + + + + getting frequency + Abfragen der Frequenz + + + + getting mode + Abfragen des Modus + + + + + + getting current VFO + Abfragen des aktuellen VFO + + + + + + + getting current VFO frequency + Abfragen der aktuellen VFO-Frequenz + + + + + + + + + setting frequency + Setzen der Frequenz + + + + + + + getting current VFO mode + Abfragen des aktuellen VFO-Modus + + + + + + + + setting current VFO mode + Setzen des aktuellen VFO-Modus + + + + setting VFOB mode + Setzen des VFOB-Modus + + + + + setting/unsetting split mode + Split-Modus ein-/ausschalten + + + + + setting split mode + Split-Modus setzen + + + + setting split TX frequency and mode + Split-TX-Frequenz und -Modus setzen + + + + setting split TX frequency + Split-TX-Frequenz setzen + + + + getting split TX VFO mode + Split-TX-VFO-Modus abfragen + + + + setting split TX VFO mode + Split-TX-VFO-Modus setzen + + + + getting PTT state + PTT-Status abfragen + + + + setting PTT on + PTT einschalten + + + + + setting PTT off + PTT ausschalten + + + + setting a configuration item + Konfigurationseintrag setzen + + + + getting a configuration item + Konfigurationseintrag abfragen + + + + IARURegions + + + All + Alle + + + + Region 1 + Region 1 + + + + Region 2 + Region 2 + + + + Region 3 + Region 3 + + + + + IARU Region + IARU-Region + + + + LogQSO + + + Click OK to confirm the following QSO: + Klicken Sie auf OK, um folgendes QSO zu bestätigen: + + + + Call + Rufzeichen + + + + Start + Start + + + + + dd/MM/yyyy HH:mm:ss + dd/MM/yyyy HH:mm:ss + + + + End + Ende + + + + Mode + Modus + + + + Band + Band + + + + Rpt Sent + Rapport gesendet + + + + Rpt Rcvd + Rapport empfangen + + + + Grid + Locator + + + + Name + Name + + + + Tx power + TX-Leistung + + + + <html><head/><body><p>Add comment to the comments list.</p></body></html> + <html><head/><body><p>Kommentar zur Kommentarliste hinzufügen.</p></body></html> + + + + Add + Hinzufügen + + + + + + + + + Retain + Beibehalten + + + + Comments + Kommentare + + + + Operator + Operator + + + + Exch sent + Austausch gesendet + + + + Rcvd + Empfangen + + + + Prop Mode + Ausbreitungsmodus + + + + Sat Mode + Satellitenmodus + + + + RX Frequency + RX-Frequenz + + + + Aircraft scatter + Flugzeugstreuung + + + + Aurora-E + Aurora-E + + + + Aurora + Aurora + + + + Back scatter + Rückstreuung + + + + Echolink + Echolink + + + + Earth-moon-earth + Erde-Mond-Erde + + + + Sporadic E + Sporadische E-Schicht + + + + F2 Reflection + F2-Reflexion + + + + Field aligned irregularities + Feldparallele Irregularitäten + + + + Internet-assisted + Internet-unterstützt + + + + Ionoscatter + Ionosphärenstreuung + + + + IRLP + IRLP + + + + Meteor scatter + Meteorscatter + + + + Non-satellite repeater or transponder + Nicht-Satelliten-Repeater oder -Transponder + + + + Rain scatter + Regenstreuung + + + + Tropospheric ducting + Troposphärischer Duct + + + + A + A + + + + B + B + + + + BS + BS + + + + JA + JA + + + + JD + JD + + + + K + K + + + + KA + KA + + + + KT + KT + + + + L + L + + + + LS + LS + + + + LU + LU + + + + LX + LX + + + + S + S + + + + SX + SX + + + + T + T + + + + US + US + + + + UV + UV + + + + VS + VS + + + + VU + VU + + + + + Satellite + Satellit + + + + Trans-equatorial + Transäquatorial + + + + + Invalid QSO Data + Ungültige QSO-Daten + + + + Check exchange sent and received + Gesendeten und empfangenen Austausch prüfen + + + + Check all fields + Alle Felder prüfen + + + + Log file error + Logdateifehler + + + + Cannot open "%1" for append + "%1" kann nicht zum Anhängen geöffnet werden + + + + Error: %1 + Fehler: %1 + + + + MainWindow + + + WSJT-X by K1JT + WSJT-X von K1JT + + + + + + + + + + + + Band Activity + Bandaktivität + + + + + UTC dB DT Freq Dr + UTC dB DT Freq Dr + + + + + + + + + + Rx Frequency + Rx-Frequenz + + + + CQ only + Nur CQ + + + + Enter this QSO in log + Dieses QSO ins Log eintragen + + + + Log &QSO + QSO &loggen + + + + Stop monitoring + Überwachung beenden + + + + &Stop + &Stopp + + + + &Monitor + &Monitor + + + + <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> + <html><head/><body><p>Rechtes Fenster löschen. Doppelklick löscht beide Fenster.</p></body></html> + + + + Erase right window. Double-click to erase both windows. + Rechtes Fenster löschen. Doppelklick löscht beide Fenster. + + + + &Erase + &Löschen + + + + <html><head/><body><p>Clear the accumulating message average.</p></body></html> + <html><head/><body><p>Den laufenden Nachrichtenmittelwert löschen.</p></body></html> + + + + Clear the accumulating message average. + Den laufenden Nachrichtenmittelwert löschen. + + + + Clear Avg + Mittelwert löschen + + + + <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> + <html><head/><body><p>Letzte Rx-Periode auf der QSO-Frequenz dekodieren</p></body></html> + + + + Decode most recent Rx period at QSO Frequency + Letzte Rx-Periode auf der QSO-Frequenz dekodieren + + + + &Decode + &Dekodieren + + + + <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> + <html><head/><body><p>Auto-Tx ein-/ausschalten</p></body></html> + + + + Toggle Auto-Tx On/Off + Auto-Tx ein-/ausschalten + + + + E&nable Tx + Tx &aktivieren + + + + Stop transmitting immediately + Senden sofort beenden + + + + &Halt Tx + Tx &abbrechen + + + + Toggle a pure Tx tone On/Off + Reinen Tx-Ton ein-/ausschalten + + + + &Tune + &Abstimmen + + + + Menus + Menüs + + + + Decode other Hounds calling above 1000 Hz audio offset + Andere Hounds dekodieren, die oberhalb von 1000 Hz Audio-Offset rufen + + + + Enable auto response to the first decode from a new DXCC or new call on the current band. + Automatische Antwort auf die erste Dekodierung eines neuen DXCC oder neuen Rufzeichens auf dem aktuellen Band aktivieren. + + + + F High + F Hoch + + + + F Low + F Niedrig + + + + 1/2 + 1/2 + + + + 2/2 + 2/2 + + + + 1/3 + 1/3 + + + + 2/3 + 2/3 + + + + 3/3 + 3/3 + + + + 1/4 + 1/4 + + + + 2/4 + 2/4 + + + + 3/4 + 3/4 + + + + 4/4 + 4/4 + + + + 1/5 + 1/5 + + + + 2/5 + 2/5 + + + + 3/5 + 3/5 + + + + 4/5 + 4/5 + + + + 5/5 + 5/5 + + + + 1/6 + 1/6 + + + + 2/6 + 2/6 + + + + 3/6 + 3/6 + + + + 4/6 + 4/6 + + + + 5/6 + 5/6 + + + + 6/6 + 6/6 + + + + Percentage of minute sequences devoted to transmitting. + Prozentanteil der Minutensequenzen, die dem Senden gewidmet sind. + + + + Prefer Type 1 messages + Typ-1-Nachrichten bevorzugen + + + + <html><head/><body><p>Transmit during the next sequence.</p></body></html> + <html><head/><body><p>Während der nächsten Sequenz senden.</p></body></html> + + + + + Q65 + Q65 + + + + SWL Mode + SWL-Modus + + + + Hide lower panel controls to maximize deocde windows + Untere Bedienelemente ausblenden, um die Dekodierfenster zu maximieren + + + + USB dial frequency + USB-Wählfrequenz + + + + 14.078 000 + 14.078 000 + + + + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> + <html><head/><body><p>30 dB empfohlen, wenn nur Rauschen vorhanden ist<br/>Grün bei gutem Pegel<br/>Rot bei möglicher Übersteuerung<br/>Gelb bei zu niedrigem Pegel</p></body></html> + + + + Rx Signal + Rx-Signal + + + + 30dB recommended when only noise present +Green when good +Red when clipping may occur +Yellow when too low + 30 dB empfohlen, wenn nur Rauschen vorhanden ist +Grün bei gutem Pegel +Rot bei möglicher Übersteuerung +Gelb bei zu niedrigem Pegel + + + + DX Call + DX-Rufzeichen + + + + DX Grid + DX-Locator + + + + Callsign of station to be worked + Rufzeichen der zu arbeitenden Station + + + + &Lookup + &Nachschlagen + + + + Locator of station to be worked + Locator der zu arbeitenden Station + + + + Az: 251 16553 km + Az: 251 16553 km + + + + Add + Hinzufügen + + + + <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> + <html><head/><body><p>Bei Orange oder Rot ist ein Fehler der Funkgerätesteuerung aufgetreten. Klicken Sie zum Zurücksetzen und Einlesen der Wählfrequenz. S bedeutet Split-Modus.</p></body></html> + + + + If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. + Bei Orange oder Rot ist ein Fehler der Funkgerätesteuerung aufgetreten. Klicken Sie zum Zurücksetzen und Einlesen der Wählfrequenz. S bedeutet Split-Modus. + + + + ? + ? + + + + Adjust Tx audio level + Tx-Audiopegel einstellen + + + + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> + <html><head/><body><p>Betriebsband wählen oder Frequenz in MHz eingeben bzw. kHz-Schritt gefolgt von k eingeben.</p></body></html> + + + + Frequency entry + Frequenzeingabe + + + + Select operating band or enter frequency in MHz or enter kHz increment followed by k. + Betriebsband wählen oder Frequenz in MHz eingeben bzw. kHz-Schritt gefolgt von k eingeben. + + + + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> + + + + <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> + <html><head/><body><p>Aktivieren, um die Tx-Frequenz beim Doppelklick auf dekodierten Text festzuhalten.</p></body></html> + + + + Check to keep Tx frequency fixed when double-clicking on decoded text. + Aktivieren, um die Tx-Frequenz beim Doppelklick auf dekodierten Text festzuhalten. + + + + Hold Tx Freq + Tx-Frequenz halten + + + + Audio Rx frequency + Audio-Rx-Frequenz + + + + + + + + + Hz + Hz + + + + + Rx + Rx + + + + + Set Tx frequency to Rx Frequency + Tx-Frequenz auf Rx-Frequenz setzen + + + + ▲ + ▲ + + + + Frequency tolerance (Hz) + Frequenztoleranz (Hz) + + + + + F Tol + F Tol + + + + + Set Rx frequency to Tx Frequency + Rx-Frequenz auf Tx-Frequenz setzen + + + + ▼ + ▼ + + + + <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> + <html><head/><body><p>Synchronisationsschwelle. Niedrigere Werte akzeptieren schwächere Synchronisationssignale.</p></body></html> + + + + Synchronizing threshold. Lower numbers accept weaker sync signals. + Synchronisationsschwelle. Niedrigere Werte akzeptieren schwächere Synchronisationssignale. + + + + Sync + Sync + + + + <html><head/><body><p>Check to use short-format messages.</p></body></html> + <html><head/><body><p>Aktivieren, um Nachrichten im Kurzformat zu verwenden.</p></body></html> + + + + Check to use short-format messages. + Aktivieren, um Nachrichten im Kurzformat zu verwenden. + + + + Sh + Sh + + + + <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> + <html><head/><body><p>Aktivieren, um schnelle JT9-Modi zu verwenden</p></body></html> + + + + Check to enable JT9 fast modes + Aktivieren, um schnelle JT9-Modi zu verwenden + + + + + Fast + Schnell + + + + <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> + <html><head/><body><p>Aktivieren, um die automatische Sequenzierung der Tx-Nachrichten anhand empfangener Nachrichten zu verwenden.</p></body></html> + + + + Check to enable automatic sequencing of Tx messages based on received messages. + Aktivieren, um die automatische Sequenzierung der Tx-Nachrichten anhand empfangener Nachrichten zu verwenden. + + + + Auto Seq + Auto Seq + + + + Check to generate "@1250 (SEND MSGS)" in Tx6. + Aktivieren, um „@1250 (SEND MSGS)“ in Tx6 zu erzeugen. + + + + Tx6 + Tx6 + + + + Tx even/1st + Tx gerade/1. + + + + <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> + <html><head/><body><p>Frequenz für CQ-Rufe in kHz oberhalb des aktuellen MHz-Werts</p></body></html> + + + + Frequency to call CQ on in kHz above the current MHz + Frequenz für CQ-Rufe in kHz oberhalb des aktuellen MHz-Werts + + + + Tx CQ + Tx CQ + + + + <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> + <html><head/><body><p>Aktivieren, um CQ auf der Frequenz „Tx CQ“ zu rufen. Rx bleibt auf der aktuellen Frequenz und die CQ-Nachricht enthält die aktuelle Rx-Frequenz, damit Anrufer wissen, auf welcher Frequenz sie antworten sollen.</p><p>Für Inhaber nicht standardmäßiger Rufzeichen nicht verfügbar.</p></body></html> + + + + Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. +Not available to nonstandard callsign holders. + Aktivieren, um CQ auf der Frequenz „Tx CQ“ zu rufen. Rx bleibt auf der aktuellen Frequenz und die CQ-Nachricht enthält die aktuelle Rx-Frequenz, damit Anrufer wissen, auf welcher Frequenz sie antworten sollen. +Für Inhaber nicht standardmäßiger Rufzeichen nicht verfügbar. + + + + Rx All Freqs + Rx alle Frequenzen + + + + <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> + <html><head/><body><p>Der Submodus bestimmt den Tonabstand; A ist am schmalsten.</p></body></html> + + + + Submode determines tone spacing; A is narrowest. + Der Submodus bestimmt den Tonabstand; A ist am schmalsten. + + + + Submode + Submodus + + + + + Fox + Fox + + + + <html><head/><body><p>Check to monitor Sh messages.</p></body></html> + <html><head/><body><p>Aktivieren, um Sh-Nachrichten zu überwachen.</p></body></html> + + + + Check to monitor Sh messages. + Aktivieren, um Sh-Nachrichten zu überwachen. + + + + SWL + SWL + + + + Best S+P + Bestes S+P + + + + <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> + <html><head/><body><p>Aktivieren, um Kalibrierdaten aufzuzeichnen.<br/>Während der Messung ist die Kalibrierkorrektur deaktiviert.<br/>Wenn nicht aktiviert, können die Kalibrierergebnisse angezeigt werden.</p></body></html> + + + + Check this to start recording calibration data. +While measuring calibration correction is disabled. +When not checked you can view the calibration results. + Aktivieren, um Kalibrierdaten aufzuzeichnen. +Während der Messung ist die Kalibrierkorrektur deaktiviert. +Wenn nicht aktiviert, können die Kalibrierergebnisse angezeigt werden. + + + + Measure + Messen + + + + <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> + <html><head/><body><p>Signalrapport: Signal-Rausch-Verhältnis in 2500-Hz-Referenzbandbreite (dB).</p></body></html> + + + + Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). + Signalrapport: Signal-Rausch-Verhältnis in 2500-Hz-Referenzbandbreite (dB). + + + + Report + Rapport + + + + <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> + <html><head/><body><p>Länge der Tx/Rx- oder Frequenzkalibriersequenz</p></body></html> + + + + Tx/Rx or Frequency calibration sequence length + Länge der Tx/Rx- oder Frequenzkalibriersequenz + + + + + s + s + + + + + T/R + T/R + + + + Audio Tx frequency + Audio-Tx-Frequenz + + + + + Tx + Tx + + + + Tx# + Tx# + + + + + + 1 + 1 + + + + + + Send this message in next Tx interval + Diese Nachricht im nächsten Tx-Intervall senden + + + + Ctrl+2 + Strg+2 + + + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + <html><head/><body><p>Diese Nachricht im nächsten Tx-Intervall senden</p><p>Doppelklick schaltet die Verwendung der Tx1-Nachricht zum Start eines QSOs mit einer Station um (nicht erlaubt für Inhaber zusammengesetzter Rufzeichen Typ 1)</p></body></html> + + + + Send this message in next Tx interval +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + Diese Nachricht im nächsten Tx-Intervall senden +Doppelklick schaltet die Verwendung der Tx1-Nachricht zum Start eines QSOs mit einer Station um (nicht erlaubt für Inhaber zusammengesetzter Rufzeichen Typ 1) + + + + Ctrl+1 + Strg+1 + + + + + + + Switch to this Tx message NOW + JETZT zu dieser Tx-Nachricht wechseln + + + + Tx &2 + Tx &2 + + + + Alt+2 + Alt+2 + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + <html><head/><body><p>JETZT zu dieser Tx-Nachricht wechseln</p><p>Doppelklick schaltet die Verwendung der Tx1-Nachricht zum Start eines QSOs mit einer Station um (nicht erlaubt für Inhaber zusammengesetzter Rufzeichen Typ 1)</p></body></html> + + + + Switch to this Tx message NOW +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + JETZT zu dieser Tx-Nachricht wechseln +Doppelklick schaltet die Verwendung der Tx1-Nachricht zum Start eines QSOs mit einer Station um (nicht erlaubt für Inhaber zusammengesetzter Rufzeichen Typ 1) + + + + Tx &1 + Tx &1 + + + + Alt+1 + Alt+1 + + + + Ctrl+6 + Strg+6 + + + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> + <html><head/><body><p>Diese Nachricht im nächsten Tx-Intervall senden</p><p>Doppelklick setzt auf die Standard-73-Nachricht zurück</p></body></html> + + + + Send this message in next Tx interval +Double-click to reset to the standard 73 message + Diese Nachricht im nächsten Tx-Intervall senden +Doppelklick setzt auf die Standard-73-Nachricht zurück + + + + Ctrl+5 + Strg+5 + + + + Ctrl+3 + Strg+3 + + + + Tx &3 + Tx &3 + + + + Alt+3 + Alt+3 + + + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + <html><head/><body><p>Diese Nachricht im nächsten Tx-Intervall senden</p><p>Doppelklick schaltet in Tx4 zwischen RRR- und RR73-Nachrichten um (nicht erlaubt für Inhaber zusammengesetzter Rufzeichen Typ 2)</p><p>RR73 sollte nur verwendet werden, wenn Sie ausreichend sicher sind, dass keine Wiederholungen erforderlich sind.</p></body></html> + + + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + Diese Nachricht im nächsten Tx-Intervall senden +Doppelklick schaltet in Tx4 zwischen RRR- und RR73-Nachrichten um (nicht erlaubt für Inhaber zusammengesetzter Rufzeichen Typ 2) +RR73 sollte nur verwendet werden, wenn Sie ausreichend sicher sind, dass keine Wiederholungen erforderlich sind. + + + + Ctrl+4 + Strg+4 + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + <html><head/><body><p>JETZT zu dieser Tx-Nachricht wechseln</p><p>Doppelklick schaltet in Tx4 zwischen RRR- und RR73-Nachrichten um (nicht erlaubt für Inhaber zusammengesetzter Rufzeichen Typ 2)</p><p>RR73 sollte nur verwendet werden, wenn Sie ausreichend sicher sind, dass keine Wiederholungen erforderlich sind.</p></body></html> + + + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + JETZT zu dieser Tx-Nachricht wechseln +Doppelklick schaltet in Tx4 zwischen RRR- und RR73-Nachrichten um (nicht erlaubt für Inhaber zusammengesetzter Rufzeichen Typ 2) +RR73 sollte nur verwendet werden, wenn Sie ausreichend sicher sind, dass keine Wiederholungen erforderlich sind. + + + + Tx &4 + Tx &4 + + + + Alt+4 + Alt+4 + + + + Tx &5 + Tx &5 + + + + Alt+5 + Alt+5 + + + + Now + Jetzt + + + + Generate standard messages for minimal QSO + Standardnachrichten für minimales QSO erzeugen + + + + Generate Std Msgs + Std.-Nachrichten erzeugen + + + + Tx &6 + Tx &6 + + + + Alt+6 + Alt+6 + + + + Enter a free text message (maximum 13 characters) +or select a predefined macro from the dropdown list. +Press ENTER to add the current text to the predefined +list. The list can be maintained in Settings (F2). + Freitextnachricht eingeben (maximal 13 Zeichen) +oder ein vordefiniertes Makro aus der Auswahlliste wählen. +ENTER drücken, um den aktuellen Text zur vordefinierten +Liste hinzuzufügen. Die Liste kann unter Einstellungen (F2) verwaltet werden. + + + + Queue up the next Tx message + Nächste Tx-Nachricht vormerken + + + + Next + Weiter + + + + + + + + + 2 + 2 + + + + Quick-Start Guide to FST4 and FST4W + Schnellstartanleitung für FST4 und FST4W + + + + FST4 + FST4 + + + + FST4W + FST4W + + + + + CQ + CQ + + + + Grid + Locator + + + + CQ AF + CQ AF + + + + CQ AN + CQ AN + + + + CQ AS + CQ AS + + + + CQ EU + CQ EU + + + + CQ NA + CQ NA + + + + CQ OC + CQ OC + + + + CQ SA + CQ SA + + + + CQ 0 + CQ 0 + + + + CQ 1 + CQ 1 + + + + CQ 2 + CQ 2 + + + + CQ 3 + CQ 3 + + + + CQ 4 + CQ 4 + + + + CQ 5 + CQ 5 + + + + CQ 6 + CQ 6 + + + + CQ 7 + CQ 7 + + + + CQ 8 + CQ 8 + + + + CQ 9 + CQ 9 + + + + Reset + Zurücksetzen + + + + N List + N-Liste + + + + N Slots + N-Slots + + + + + + + + + + Random + Zufällig + + + + Call + Rufzeichen + + + + S/N (dB) + S/N (dB) + + + + Distance + Entfernung + + + + More CQs + Mehr CQs + + + + + % + % + + + + Tx Pct + Tx-Anteil + + + + Band Hopping + Band-Hopping + + + + Choose bands and times of day for band-hopping. + Bänder und Tageszeiten für Band-Hopping auswählen. + + + + Schedule ... + Zeitplan ... + + + + Upload decoded messages to WSPRnet.org. + Dekodierte Nachrichten zu WSPRnet.org hochladen. + + + + Upload spots + Spots hochladen + + + + <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> + <html><head/><body><p>6-stellige Locator führen dazu, dass 2 verschiedene Nachrichten gesendet werden. Die zweite enthält den vollständigen Locator, aber nur ein gehashtes Rufzeichen; andere Stationen müssen die erste Nachricht mindestens einmal dekodiert haben, bevor sie Ihr Rufzeichen in der zweiten dekodieren können. Aktivieren Sie diese Option, um nur 4-stellige Locator zu senden, wenn dadurch das Zwei-Nachrichten-Protokoll vermieden wird.</p></body></html> + + + + 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. + 6-stellige Locator führen dazu, dass 2 verschiedene Nachrichten gesendet werden. Die zweite enthält den vollständigen Locator, aber nur ein gehashtes Rufzeichen; andere Stationen müssen die erste Nachricht mindestens einmal dekodiert haben, bevor sie Ihr Rufzeichen in der zweiten dekodieren können. Aktivieren Sie diese Option, um nur 4-stellige Locator zu senden, wenn dadurch das Zwei-Nachrichten-Protokoll vermieden wird. + + + + No own call decodes + Keine Dekodierungen des eigenen Rufzeichens + + + + Tx Next + Tx als Nächstes + + + + Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. + Tx-Leistung in dBm (dB über 1 mW) als Teil Ihrer WSPR-Nachricht festlegen. + + + + NB + NB + + + + 40 + 40 + + + + + + 10 + 10 + + + + 17 + 17 + + + + 60 + 60 + + + + + 12 + 12 + + + + 160 + 160 + + + + 20 + 20 + + + + 80 + 80 + + + + + 70 + 70 + + + + 15 + 15 + + + + 30 + 30 + + + + + + + 6 + 6 + + + + 24G + 24G + + + + 10G + 10G + + + + 5G + 5G + + + + + + 9 + 9 + + + + 13 + 13 + + + + 23 + 23 + + + + 33 + 33 + + + + 1.25 + 1.25 + + + + + 4 + 4 + + + + + 8 + 8 + + + + CQ messages only. + Nur CQ-Nachrichten. + + + + Bypass Filters toggled via Settings or the Filters menu. + Filter umgehen, die über Einstellungen oder das Filter-Menü geschaltet werden. + + + + BP + BP + + + + <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> + <html><head/><body><p>Überwachung ein-/ausschalten.<br/>Gelb beim Speichern von .wav-Dateien.</p></body></html> + + + + Avg + Mittelw. + + + + <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> + <html><head/><body><p>Reinen Tx-Ton ein-/ausschalten<br/>Rechtsklick zum Abstimmen des Funkgeräts</p></body></html> + + + + <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> + <html><head/><body><p>Wait &amp; Call ein-/ausschalten. Rechtsklick leert das Feld DX-Rufzeichen.</p></body></html> + + + + <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> + <html><head/><body><p>Rufzeichen in der Datenbank suchen.<br/>Rechtsklick sucht das Rufzeichen auf QRZ.com.</p></body></html> + + + + <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> + <html><head/><body><p>Rufzeichen und Locator zur Datenbank hinzufügen.<br/>Rechtsklick sucht das Rufzeichen auf hamqth.com.</p></body></html> + + + + <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> + <html><head/><body><p>Rufzeichen auf die Ignorierliste setzen.<br/>Rechtsklick sucht das Rufzeichen auf qrzcq.com.</p></body></html> + + + + Ignore + Ignorieren + + + + Pwr + Pwr + + + + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the the strongest station's reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the the weakest station's reply to your CQ. </p></body></html> + <html><head/><body><p>Wählen Sie <span style=" font-weight:600;">CQ: None</span>, um Anrufer manuell auszuwählen.</p><p>Wählen Sie <span style=" font-weight:600;">CQ: First</span>, um automatisch auf die erste dekodierte Antwort auf Ihren CQ-Ruf zu reagieren.</p><p>Wählen Sie <span style=" font-weight:600;">CQ: Max Dist</span>, um automatisch auf die Antwort mit den meisten Punkten im ARRL International Digital Contest bzw. allgemein auf die am weitesten entfernte Station zu reagieren, wenn deren Nachricht einen gültigen Locator enthält.</p><p>Wählen Sie <span style=" font-weight:600;">CQ: Max dB</span>, um automatisch auf die stärkste Station zu reagieren.</p><p>Wählen Sie <span style=" font-weight:600;">CQ: Min dB</span>, um automatisch auf die schwächste Station zu reagieren.</p></body></html> + + + + + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> + <html><head/><body><p>Aktivieren, um in geradzahligen Minuten oder Sequenzen ab 0 zu senden; deaktivieren für ungerade Sequenzen. Rechtsklick friert den Zustand des Kontrollkästchens ein. Rechtsklick auf FT8 oder MSK hebt die Sperre wieder auf.</p></body></html> + + + + <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> + <html><head/><body><p>Auf T/R 15 s und Submodus C umschalten.</p></body></html> + + + + 15C + 15C + + + + <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> + <html><head/><body><p>Auf T/R 15 s und Submodus A umschalten.</p></body></html> + + + + 15A + 15A + + + + <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> + <html><head/><body><p>Auf T/R 30 s und Submodus B umschalten.</p></body></html> + + + + 30B + 30B + + + + <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> + <html><head/><body><p>Auf T/R 60 s und Submodus C umschalten.</p></body></html> + + + + 60C + 60C + + + + <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> + <html><head/><body><p>Auf T/R 60 s und Submodus D umschalten.</p></body></html> + + + + 60D + 60D + + + + <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> + <html><head/><body><p>Auf T/R 60 s und Submodus E umschalten.</p></body></html> + + + + 60E + 60E + + + + Maximum drift rate in units of symbol rate per transmission. + Maximale Driftgeschwindigkeit in Einheiten der Symbolrate pro Aussendung. + + + + Max Drift + Max. Drift + + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> + <html><head/><body><p>JETZT zu dieser Tx-Nachricht wechseln</p><p>Doppelklick setzt auf die Standard-73-Nachricht zurück</p><p>Rechtsklick behält den freien Text von Tx5 bei</p></body></html> + + + + <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> + <html><head/><body><p>Freitextnachricht bei nächster Gelegenheit senden.</p></body></html> + + + + Send msg + Nachricht senden + + + + <html><head/><body><p>Enter a free text message.</p></body></html> + <html><head/><body><p>Freitextnachricht eingeben.</p></body></html> + + + + Free Text + Freitext + + + + <html><head/><body><p>Select a specific CQ message.</p></body></html> + <html><head/><body><p>Bestimmte CQ-Nachricht auswählen.</p></body></html> + + + + Queue + Warteschlange + + + + Allow Dupes + Duplikate erlauben + + + + <html><head/><body><p>Clear all queues.</p></body></html> + <html><head/><body><p>Alle Warteschlangen leeren.</p></body></html> + + + + <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> + <html><head/><body><p>Maximale Anzahl der in der Warteschlange angezeigten Rufzeichen.</p></body></html> + + + + <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> + <html><head/><body><p>Gewünschte Sortierreihenfolge für Rufzeichen in der Warteschlange wählen.</p></body></html> + + + + Age + Alter + + + + Continent + Kontinent + + + + Score + Punktzahl + + + + <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> + <html><head/><body><p>Eine CQ-Nachricht zusammen mit anderen Nachrichten einfügen.</p></body></html> + + + + In Progress + In Bearbeitung + + + + <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> + <html><head/><body><p>Maximale Anzahl gleichzeitiger Streams für Fox-Aussendungen.</p></body></html> + + + + + + + 3 + 3 + + + + 70cm FT8 + 70cm FT8 + + + + 70cm + 70cm + + + + 30m FT8 + 30m FT8 + + + + 30m + 30m + + + + <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> + <html><head/><body><p>Band-Hopping ein-/ausschalten. Band-Hopping erfolgt jede zweite volle Minute. Änderungen an den Kontrollkästchen werden sofort wirksam.<br/>Rechtsklick wechselt zur nächsten ausgewählten Band-Hopping-Frequenz oder testet das Standard-Audiogerät, wenn Band-Hopping deaktiviert ist.</p></body></html> + + + + Band Hopping + Band-Hopping + + + + 12m FT8 + 12m FT8 + + + + 12m + 12m + + + + 40m FT8 + 40m FT8 + + + + 40m + 40m + + + + 2m MSK144 + 2m MSK144 + + + + 2m MSK + 2m MSK + + + + 10m FT8 + 10m FT8 + + + + 10m + 10m + + + + 6m FT8 + 6m FT8 + + + + 6m + 6m + + + + 60m FT8 + 60m FT8 + + + + 60m + 60m + + + + 160m FT8 + 160m FT8 + + + + 160m + 160m + + + + 80m FT8 + 80m FT8 + + + + 80m + 80m + + + + 20m FT8 + 20m FT8 + + + + 20m + 20m + + + + 17m FT8 + 17m FT8 + + + + 17m + 17m + + + + 4m FT8 + 4m FT8 + + + + 4m + 4m + + + + 15m FT8 + 15m FT8 + + + + 15m + 15m + + + + 2m FT8 + 2m FT8 + + + + 2m + 2m + + + + + 10m FT4 + 10m FT4 + + + + + 12m FT4 + 12m FT4 + + + + + 15m FT4 + 15m FT4 + + + + + 17m FT4 + 17m FT4 + + + + + 20m FT4 + 20m FT4 + + + + + 30m FT4 + 30m FT4 + + + + + 40m FT4 + 40m FT4 + + + + + 80m FT4 + 80m FT4 + + + + FT8 QRG6 + FT8 QRG6 + + + + FT8 QRG1 + FT8 QRG1 + + + + FT8 QRG2 + FT8 QRG2 + + + + FT8 QRG7 + FT8 QRG7 + + + + FT8 QRG8 in kHz. + FT8 QRG8 in kHz. + + + + FT8 QRG5 + FT8 QRG5 + + + + FT8 QRG3 + FT8 QRG3 + + + + FT8 QRG4 + FT8 QRG4 + + + + FT8 QRG8 + FT8 QRG8 + + + + FT8 QRG7 in kHz. + FT8 QRG7 in kHz. + + + + FT8 QRG6 in kHz. + FT8 QRG6 in kHz. + + + + FT8 QRG5 in kHz. + FT8 QRG5 in kHz. + + + + FT8 QRG4 in kHz. + FT8 QRG4 in kHz. + + + + FT8 QRG3 in kHz. + FT8 QRG3 in kHz. + + + + FT8 QRG2 in kHz. + FT8 QRG2 in kHz. + + + + FT8 QRG1 in kHz. + FT8 QRG1 in kHz. + + + + Spacing + Abstand + + + + Fixed Tone + Fester Ton + + + + K1JT + K1JT + + + + CW + CW + + + + Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. + FT8-Hound-Modus ein-/ausschalten.<br>Rechtsklick aktiviert oder deaktiviert den SuperFox-Modus. + + + + H + H + + + + Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. + Auf FT8-Modus umschalten.<br>Rechtsklick schaltet den zuletzt verwendeten Contest-Modus ein/aus. + + + + Switch to FT4 mode + Auf FT4-Modus umschalten + + + + Switch to MSK144 mode + Auf MSK144-Modus umschalten + + + + MSK + MSK + + + + <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> + <html><head/><body><p>Auf Q65-Modus umschalten.<br>Rechtsklick schaltet auf Q65-Pileup-Modus.</p></body></html> + + + + <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> + <html><head/><body><p>Auf JT65-Modus umschalten.<br>Rechtsklick schaltet auf JT9-Modus.</p></body></html> + + + + <html><head/><body><p>Switch to Echo mode</p></body></html> + <html><head/><body><p>Auf Echo-Modus umschalten</p></body></html> + + + + File + Datei + + + + View + Ansicht + + + + Filters + Filter + + + + Decode + Dekodieren + + + + Parameters + Parameter + + + + Decoder sensitivity + Decoder-Empfindlichkeit + + + + Decoder start + Decoder-Start + + + + Number of threads + Anzahl Threads + + + + QSO RX freq sensitivity + QSO-RX-Frequenzempfindlichkeit + + + + Decoding cycles + Dekodierzyklen + + + + Save + Speichern + + + + Help + Hilfe + + + + Mode + Modus + + + + Configurations + Konfigurationen + + + + Tools + Werkzeuge + + + + Exit + Beenden + + + + About WSJT-X + Über WSJT-X + + + + Waterfall + Wasserfall + + + + Open + Öffnen + + + + Ctrl+O + Strg+O + + + + Open next in directory + Nächste Datei im Verzeichnis öffnen + + + + Decode remaining files in directory + Verbleibende Dateien im Verzeichnis dekodieren + + + + Shift+F6 + Umschalt+F6 + + + + Delete all *.wav && *.c2 files in SaveDir + Alle *.wav- und *.c2-Dateien in SaveDir löschen + + + + None + Keine + + + + Save all + Alle speichern + + + + Remove saved files after 30 days + Gespeicherte Dateien nach 30 Tagen entfernen + + + + Online User Guide + Online-Benutzerhandbuch + + + + Keyboard shortcuts + Tastenkürzel + + + + Special mouse commands + Spezielle Mausbefehle + + + + JT9 + JT9 + + + + Save decoded + Dekodierte speichern + + + + + Normal + Normal + + + + Deep + Tief + + + + Erase ALL.TXT + ALL.TXT löschen + + + + Erase wsjtx_log.adi + wsjtx_log.adi löschen + + + + Erase wsjtx.log + wsjtx.log löschen + + + + Erase Ignore List + Ignorierliste löschen + + + + F7 + F7 + + + + Don't split ALL.TXT + ALL.TXT nicht aufteilen + + + + Split ALL.TXT yearly + ALL.TXT jährlich aufteilen + + + + Split ALL.TXT monthly + ALL.TXT monatlich aufteilen + + + + Disable writing of ALL.TXT + Schreiben von ALL.TXT deaktivieren + + + + Active Stations + Aktive Stationen + + + + Band Buttons + Band-Schaltflächen + + + + Use Dark Style + Dunkles Design verwenden + + + + Reduce false decodes + Falschdekodierungen reduzieren + + + + Default event logging + Standard-Ereignisprotokollierung + + + + Diagnostic mode + Diagnosemodus + + + + Disable event logging + Ereignisprotokollierung deaktivieren + + + + Quick-Start Guide to WSJT-X 2.7 and QMAP + Schnellstartanleitung zu WSJT-X 2.7 und QMAP + + + + WSJT-X_improved Home Page + WSJT-X_improved-Startseite + + + + <html><head/><body><p>Go to the wsjt-x_improved home page.</p></body></html> + <html><head/><body><p>Zur wsjt-x_improved-Startseite wechseln.</p></body></html> + + + + The additional features of wsjt-x_improved + Zusätzliche Funktionen von wsjt-x_improved + + + + <html><head/><body><p>Overview on the additional features of wsjt-x_improved.</p></body></html> + <html><head/><body><p>Übersicht über die zusätzlichen Funktionen von wsjt-x_improved.</p></body></html> + + + + Recommended audio settings + Empfohlene Audioeinstellungen + + + + <html><head/><body><p>Recommended Audio Settings.</p></body></html> + <html><head/><body><p>Empfohlene Audioeinstellungen.</p></body></html> + + + + How to deal with rig control errors + Umgang mit Fehlern der Funkgerätesteuerung + + + + <html><head/><body><p>How to deal with rig control errors.</p></body></html> + <html><head/><body><p>Umgang mit Fehlern der Funkgerätesteuerung.</p></body></html> + + + + Erase list of Q65 callers + Liste der Q65-Anrufer löschen + + + + SuperFox User Guide + SuperFox-Benutzerhandbuch + + + + Message Creator + Nachrichtenersteller + + + + Hide stations worked before on band + Bereits auf dem Band gearbeitete Stationen ausblenden + + + + Hide stations worked today or yesterday + Heute oder gestern gearbeitete Stationen ausblenden + + + + Hide stations from Ignore List + Stationen aus der Ignorierliste ausblenden + + + + Ignore stations worked today or yesterday + Heute oder gestern gearbeitete Stationen ignorieren + + + + Ignore stations from Ignore List + Stationen aus der Ignorierliste ignorieren + + + + Hide stations from Territory 1 + Stationen aus Gebiet 1 ausblenden + + + + Hide stations from Territory 2 + Stationen aus Gebiet 2 ausblenden + + + + Hide stations from Territory 3 + Stationen aus Gebiet 3 ausblenden + + + + Hide stations from Territory 4 + Stationen aus Gebiet 4 ausblenden + + + + Hide stations from Europe + Stationen aus Europa ausblenden + + + + Hide stations from North America + Stationen aus Nordamerika ausblenden + + + + Hide stations from South America + Stationen aus Südamerika ausblenden + + + + Hide stations from Asia + Stationen aus Asien ausblenden + + + + Hide stations from Africa + Stationen aus Afrika ausblenden + + + + Hide stations from Oceania + Stationen aus Ozeanien ausblenden + + + + Hide stations from Antarctica + Stationen aus der Antarktis ausblenden + + + + Full Duplex Mode + Vollduplex-Modus + + + + Highlight callsigns worked before on band + Bereits auf dem Band gearbeitete Rufzeichen hervorheben + + + + Highlight callsigns worked today or yesterday + Heute oder gestern gearbeitete Rufzeichen hervorheben + + + + Highlight callsigns from Ignore List + Rufzeichen aus der Ignorierliste hervorheben + + + + Enable Message Popups + Nachrichten-Popups aktivieren + + + + QSY Monitor + QSY-Monitor + + + + Ignore stations worked before on band + Bereits auf dem Band gearbeitete Stationen ignorieren + + + + Use multithreaded FT8 decoder + Multithreaded-FT8-Decoder verwenden + + + + Auto + Auto + + + + + 5 + 5 + + + + + 7 + 7 + + + + + 11 + 11 + + + + Low + Niedrig + + + + Medium + Mittel + + + + High + Hoch + + + + Minimum + Minimum + + + + Use low thresholds + Niedrige Schwellen verwenden + + + + Use subpass + Subpass verwenden + + + + 2-Stage + 2-stufig + + + + 3-Stage + 3-stufig + + + + Early + Früh + + + + Late + Spät + + + + Wideband DX Call search + Breitbandige DX-Rufzeichensuche + + + + Hide FT8 dupe messages + Doppelte FT8-Nachrichten ausblenden + + + + VHF / UHF Buttons + VHF-/UHF-Schaltflächen + + + + Highlight stations from Territory 1 + Stationen aus Gebiet 1 hervorheben + + + + Highlight stations from Territory 2 + Stationen aus Gebiet 2 hervorheben + + + + Highlight stations from Territory 3 + Stationen aus Gebiet 3 hervorheben + + + + Highlight stations from Territory 4 + Stationen aus Gebiet 4 hervorheben + + + + Disable clicks on waterfall + Klicks auf den Wasserfall deaktivieren + + + + + JT65 + JT65 + + + + Astronomical data + Astronomische Daten + + + + List of Type 1 prefixes and suffixes + Liste der Typ-1-Präfixe und -Suffixe + + + + Settings... + Einstellungen... + + + + Local User Guide + Lokales Benutzerhandbuch + + + + Open log directory + Log-Verzeichnis öffnen + + + + JT4 + JT4 + + + + Message averaging + Nachrichtenmittelung + + + + Enable averaging + Mittelung aktivieren + + + + Enable deep search + Tiefe Suche aktivieren + + + + WSPR + WSPR + + + + Echo Graph + Echo-Diagramm + + + + F8 + F8 + + + + + Echo + Echo + + + + EME Echo mode + EME-Echo-Modus + + + + ISCAT + ISCAT + + + + Fast Graph + Schnelles Diagramm + + + + F9 + F9 + + + + &Download Samples ... + &Beispiele herunterladen ... + + + + <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> + <html><head/><body><p>Beispiel-Audiodateien herunterladen, die die verschiedenen Modi demonstrieren.</p></body></html> + + + + MSK144 + MSK144 + + + + QRA64 + QRA64 + + + + Release Notes + Versionshinweise + + + + Enable AP for DX Call + AP für DX-Rufzeichen aktivieren + + + + FreqCal + FreqCal + + + + Measure reference spectrum + Referenzspektrum messen + + + + Measure phase response + Phasengang messen + + + + Erase reference spectrum + Referenzspektrum löschen + + + + Execute frequency calibration cycle + Frequenzkalibrierzyklus ausführen + + + + Equalization tools ... + Entzerrungswerkzeuge ... + + + + + FT8 + FT8 + + + + + Enable AP + AP aktivieren + + + + Solve for calibration parameters + Kalibrierparameter berechnen + + + + Copyright notice + Urheberrechtshinweis + + + + Shift+F1 + Umschalt+F1 + + + + Fox log + Fox-Log + + + + FT8 DXpedition Mode User Guide + Benutzerhandbuch zum FT8-DXpedition-Modus + + + + Reset Cabrillo log ... + Cabrillo-Log zurücksetzen ... + + + + Color highlighting scheme + Farbschema der Hervorhebung + + + + Export Cabrillo log ... + Cabrillo-Log exportieren ... + + + + Contest log + Contest-Log + + + + Erase WSPR hashtable + WSPR-Hashtabelle löschen + + + + + FT4 + FT4 + + + + Quick-Start Guide to Q65 + Schnellstartanleitung zu Q65 + + + + Auto Clear Avg after decode + Mittelwert nach Dekodierung automatisch löschen + + + + Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 + Schnellstartanleitung zu WSJT-X 2.5.0 und MAP65 3.0 + + + + Rig Control Error + Fehler der Funkgerätesteuerung + + + + + + Receiving + Empfang + + + + Do you want to reconfigure the radio interface? + Möchten Sie die Funkgeräteschnittstelle neu konfigurieren? + + + + Error Scanning ADIF Log + Fehler beim Scannen des ADIF-Logs + + + + Scanned ADIF log, %1 worked-before records created. CTY: %2 + ADIF-Log gescannt, %1 Datensätze früherer QSOs erstellt. CTY: %2 + + + + Error Loading LotW Users Data + Fehler beim Laden der LoTW-Benutzerdaten + + + + Error Writing WAV File + Fehler beim Schreiben der WAV-Datei + + + + Enumerating audio devices + Audiogeräte werden ermittelt + + + + Configurations... + Konfigurationen... + + + + + + + + + + + + + + + + + + + + + + + Message + Nachricht + + + + Error Killing jt9.exe Process + Fehler beim Beenden des Prozesses jt9.exe + + + + KillByName return code: %1 + Rückgabecode von KillByName: %1 + + + + Error removing "%1" + Fehler beim Entfernen von "%1" + + + + Click OK to retry + Klicken Sie auf OK, um es erneut zu versuchen + + + + + Improper mode + Unzulässiger Modus + + + + + File Open Error + Fehler beim Öffnen der Datei + + + + + + + + Cannot open "%1" for append: %2 + "%1" kann nicht zum Anhängen geöffnet werden: %2 + + + + Error saving c2 file + Fehler beim Speichern der c2-Datei + + + + Error in Sound Input + Fehler im Audioeingang + + + + Error in Sound Output + Fehler im Audioausgang + + + + + Single-Period Decodes + Dekodierungen einer einzelnen Periode + + + + + Average Decodes + Gemittelte Dekodierungen + + + + Change Operator + Operator wechseln + + + + New operator: + Neuer Operator: + + + + Status File Error + Fehler der Statusdatei + + + + + Cannot open "%1" for writing: %2 + "%1" kann nicht zum Schreiben geöffnet werden: %2 + + + + Decodes containing My Call + Dekodierungen mit meinem Rufzeichen + + + + Subprocess Error + Fehler im Unterprozess + + + + Subprocess failed with exit code %1 + Unterprozess mit Exit-Code %1 fehlgeschlagen + + + + + Running: %1 +%2 + Wird ausgeführt: %1 +%2 + + + + Subprocess error + Unterprozessfehler + + + + Reference spectrum saved + Referenzspektrum gespeichert + + + + It is very important to avoid audio harmonics and distorted audio signals. +This is usually achieved by the following step-by-step approach: + +1. Select 'Fake it' in the Settings/Radio menu as your 'Split mode'. If your + rig does not support this, select 'Rig'. But really try to avoid 'None'! + +2. Set the transmission power of your transceiver to maximum. + +3. Set the Pwr slider to the minimum and click on the 'Tune' button. + +4. Observe the actual transmission power of your rig as well as ALC. + +5. Carefully increase the Pwr slider until you have reached the + maximum transmit powe of your transceiver. + +6. VERY IMPORTANT: Now reduce the Pwr slider until you reach approx. + 90% of your max. Tx power. ALC should be close to zero. + +7. This is the maximum audio level permitted with your setup. + Always stay with the Pwr slider below this max. value. + +If possible, check your transmission from time to time with a webSDR +to ensure the signal is clean and not distorted. + Es ist sehr wichtig, Audio-Oberwellen und verzerrte Audiosignale zu vermeiden. +Dies wird normalerweise mit folgendem schrittweisen Vorgehen erreicht: + +1. Wählen Sie im Menü Einstellungen/Radio als „Split-Modus“ die Option „Fake it“. Wenn Ihr + Funkgerät dies nicht unterstützt, wählen Sie „Rig“. Vermeiden Sie nach Möglichkeit „None“! + +2. Stellen Sie die Sendeleistung Ihres Transceivers auf Maximum. + +3. Stellen Sie den Pwr-Regler auf Minimum und klicken Sie auf „Tune“. + +4. Beobachten Sie die tatsächliche Sendeleistung Ihres Funkgeräts sowie die ALC. + +5. Erhöhen Sie den Pwr-Regler vorsichtig, bis die maximale + Sendeleistung Ihres Transceivers erreicht ist. + +6. SEHR WICHTIG: Reduzieren Sie nun den Pwr-Regler, bis etwa + 90 % Ihrer maximalen Tx-Leistung erreicht sind. Die ALC sollte nahe null liegen. + +7. Dies ist der maximal zulässige Audiopegel für Ihre Konfiguration. + Bleiben Sie mit dem Pwr-Regler immer unter diesem Maximalwert. + +Prüfen Sie Ihre Aussendung nach Möglichkeit gelegentlich mit einem webSDR, +um sicherzustellen, dass das Signal sauber und unverzerrt ist. + + + + <b>Recommended Audio Settings</b> + <b>Empfohlene Audioeinstellungen</b> + + + + Invalid data in fmt.all at line %1 + Ungültige Daten in fmt.all in Zeile %1 + + + + Good Calibration Solution + Gute Kalibrierlösung + + + + <pre>%1%L2 ±%L3 ppm +%4%L5 ±%L6 Hz + +%7%L8 +%9%L10 Hz</pre> + <pre>%1%L2 ±%L3 ppm +%4%L5 ±%L6 Hz + +%7%L8 +%9%L10 Hz</pre> + + + + Delete Calibration Measurements + Kalibriermessungen löschen + + + + The "fmt.all" file will be renamed as "fmt.bak" + Die Datei „fmt.all“ wird in „fmt.bak“ umbenannt + + + + No data read from disk. Wrong file format? + Keine Daten von Festplatte gelesen. Falsches Dateiformat? + + + + Confirm Delete + Löschen bestätigen + + + + Are you sure you want to delete all *.wav and *.c2 files in "%1"? + Möchten Sie wirklich alle *.wav- und *.c2-Dateien in „%1“ löschen? + + + + Keyboard Shortcuts + Tastenkürzel + + + + Special Mouse Commands + Spezielle Mausbefehle + + + + No more files to open. + Keine weiteren Dateien zum Öffnen. + + + + + Spotting to PSK Reporter unavailable + Spot-Übertragung an PSK Reporter nicht verfügbar + + + + Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. + Bitte wählen Sie eine andere Tx-Frequenz. WSJT-X sendet wissentlich keinen anderen Modus im WSPR-Teilband auf 30 m. + + + + WSPR Guard Band + WSPR-Schutzband + + + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2025 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; and other members of the WSJT Development Group." + Wenn Sie Teile von WSJT-X im Rahmen der GNU General Public License verwenden, müssen Sie folgenden Urheberrechtshinweis in Ihrem abgeleiteten Werk deutlich sichtbar anzeigen: + +„Die Algorithmen, der Quellcode, das Erscheinungsbild von WSJT-X und verwandten Programmen sowie die Protokollspezifikationen für die Modi FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 sind Copyright (C) 2001-2025 eines oder mehrerer der folgenden Autoren: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; und weitere Mitglieder der WSJT Development Group.“ + + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: toggle "Call 1st")</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Toggle "Call 1st" checkbox</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> + +</table> + Keyboard shortcuts help window contents + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Tx stoppen, QSO abbrechen, Warteschlange für nächsten Anruf leeren</td></tr> + <tr><td><b>F1 </b></td><td>Online-Benutzerhandbuch (Alt: Tx6 senden)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Urheberrechtshinweis</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>Über WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Einstellungsfenster öffnen (Alt: Tx2 senden)</td></tr> + <tr><td><b>F3 </b></td><td>Tastenkürzel anzeigen (Alt: Tx3 senden)</td></tr> + <tr><td><b>F4 </b></td><td>DX-Rufzeichen, DX-Locator und Tx-Nachrichten 1-4 löschen (Alt: Tx4 senden)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Programm beenden</td></tr> + <tr><td><b>F5 </b></td><td>Spezielle Mausbefehle anzeigen (Alt: Tx5 senden)</td></tr> + <tr><td><b>F6 </b></td><td>Nächste Datei im Verzeichnis öffnen (Alt: „Call 1st“ umschalten)</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Alle verbleibenden Dateien im Verzeichnis dekodieren</td></tr> + <tr><td><b>F7 </b></td><td>Fenster Nachrichtenmittelung anzeigen</td></tr> + <tr><td><b>F11 </b></td><td>Rx-Frequenz um 1 Hz verringern</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Gleiche Rx- und Tx-Frequenzen um 1 Hz verringern</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Tx-Frequenz um 60 Hz (FT8) bzw. 90 Hz (FT4) verringern</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Wählfrequenz um 1000 Hz verringern</td></tr> + <tr><td><b>F12 </b></td><td>Rx-Frequenz um 1 Hz erhöhen</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Gleiche Rx- und Tx-Frequenzen um 1 Hz erhöhen</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Tx-Frequenz um 60 Hz (FT8) bzw. 90 Hz (FT4) erhöhen</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Wählfrequenz um 1000 Hz erhöhen</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Diese Nummer auf Register 1 jetzt senden</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Diese Nummer auf Register 1 als nächste Aussendung setzen</td></tr> + <tr><td><b>Alt+A </b></td><td>Aktive Stationen für QMAP löschen</td></tr> + <tr><td><b>Alt+B </b></td><td>Status „Best S+P“ umschalten</td></tr> + <tr><td><b>Alt+C </b></td><td>Kontrollkästchen „Call 1st“ umschalten</td></tr> + <tr><td><b>Alt+D </b></td><td>Auf QSO-Frequenz erneut dekodieren</td></tr> + <tr><td><b>Shift+D </b></td><td>Vollständige Dekodierung (beide Fenster)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>TX gerade/1. einschalten</td></tr> + <tr><td><b>Shift+E </b></td><td>TX gerade/1. ausschalten</td></tr> + <tr><td><b>Alt+E </b></td><td>Löschen</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Freitext-Nachrichtenfeld bearbeiten</td></tr> + <tr><td><b>Alt+G </b></td><td>Standardnachrichten erzeugen</td></tr> + <tr><td><b>Alt+H </b></td><td>Tx abbrechen</td></tr> + <tr><td><b>Ctrl+I </b></td><td>DX-Rufzeichen zur Ignorierliste hinzufügen</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Rufzeichen in Datenbank suchen, Standardnachrichten erzeugen</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>„Tx aktivieren“ umschalten</td></tr> + <tr><td><b>Ctrl+O </b></td><td>.wav-Datei öffnen</td></tr> + <tr><td><b>Alt+O </b></td><td>Operator wechseln</td></tr> + <tr><td><b>Alt+Q </b></td><td>Fenster „QSO loggen“ öffnen</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Tx4-Nachricht auf RRR setzen (nicht in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Tx4-Nachricht auf RR73 setzen</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Fenster Aktive Stationen aktualisieren</td></tr> + <tr><td><b>Alt+S </b></td><td>Überwachung beenden</td></tr> + <tr><td><b>Alt+T </b></td><td>Abstimmstatus umschalten</td></tr> + <tr><td><b>Alt+Z </b></td><td>Hängenden Decoderstatus löschen</td></tr> + +</table> + + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Right-click</b> to set Tx frequency.<br/> + <b>Double-right-click</b> to set Rx and Tx frequencies. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> + and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> + Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> + own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">Dial Frequency:</td> + <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> + <b>Right-click</b> to increase frequency by 1 kHz.<br/> + <b>Left-click</b> to decrease frequency by 1 kHz.<br/> + The mouse pointer must be over the Dial Frequency indicator. + </td> + </tr> + <tr> + <td align="right">H Button:</td> + <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to activate or deactivate SuperFox mode. + </td> + </tr> + <tr> + <td align="right">FT8 Button:</td> + <td><b>Click</b> to switch to FT8 Hound Mode.<br/> + <b>Right-click</b> to toggle last used Special Operating Activity On/Off. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> + <tr> + <td align="right">Tx5 Button:</td> + <td><b>Right-click</b> to retain Tx5 free text. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Right-click</b> to freeze the state of the checkbox.<br/> + <b>Right-click on the FT8 Button</b> to unfreeze. + </td> + </tr> + <tr> + <td align="right">Enable Tx Button:</td> + <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> + <b>Right-click</b> to toggle Wait & Pounce On/Off. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> + If <b>Alternate Erase button behavior</b> is checked:<br/> + <b>Click</b> to erase Band Activity window.<br/> + <b>Right-click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">DX Call Button:</td> + <td><b>Click</b> to toggle Wait & Call On/Off.<br/> + <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. + </td> + </tr> + <tr> + <td align="right">Lookup Button:</td> + <td><b>Click</b> to search for callsign in database.<br/> + <b>Right-click</b> to search for Dx Call on qrz.com. + </td> + </tr> + <tr> + <td align="right">Add Button:</td> + <td><b>Click</b> to add callsign and locator to database.<br/> + <b>Right-click</b> to search for Dx Call on hamqth.com. + </td> + </tr> + <tr> + <td align="right">Ignore Button:</td> + <td><b>Click</b> to add callsign to the Ignore List.<br/> + <b>Right-click</b> to search for Dx Call on qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Band Buttons:</td> + <td><b>Click</b> to toggle band / mode default frequencies.<br/> + <b>Right-click</b> to toggle FT8 DXpedition frequencies. + </td> + </tr> +</table> + Mouse commands help window contents + <table cellpadding=5> + <tr><th align="right">Klick auf</th><th align="left">Aktion</th></tr> + <tr><td align="right">Wasserfall:</td><td><b>Klick</b> setzt die Rx-Frequenz.<br/><b>Rechtsklick</b> setzt die Tx-Frequenz.<br/><b>Doppel-Rechtsklick</b> setzt Rx- und Tx-Frequenz.</td></tr> + <tr><td align="right">Dekodierter Text:</td><td><b>Doppelklick</b> kopiert das zweite Rufzeichen nach DX Call und den Locator nach DX Grid, setzt Rx- und Tx-Frequenz auf die Frequenz des dekodierten Signals und erzeugt Standardnachrichten.<br/><b>Alt</b> gedrückt halten, um zu verhindern, dass Tx beim <b>Doppelklick</b> aktiviert wird.<br/>Wenn <b>Tx-Frequenz halten</b> aktiviert ist oder das erste Rufzeichen in der Nachricht das eigene ist, wird die Tx-Frequenz nur bei gedrückter <b>Strg</b>-Taste geändert.</td></tr> + <tr><td align="right">Wählfrequenz:</td><td><b>Mausrad drehen</b>, um die kHz-Werte zu ändern, oder:<br/><b>Rechtsklick</b> erhöht die Frequenz um 1 kHz.<br/><b>Linksklick</b> verringert die Frequenz um 1 kHz.<br/>Der Mauszeiger muss über der Anzeige der Wählfrequenz stehen.</td></tr> + <tr><td align="right">H-Schaltfläche:</td><td><b>Klick</b> schaltet den FT8-Hound-Modus ein/aus.<br/><b>Rechtsklick</b> aktiviert oder deaktiviert SuperFox.</td></tr> + <tr><td align="right">FT8-Schaltfläche:</td><td><b>Klick</b> schaltet auf FT8-Hound-Modus.<br/><b>Rechtsklick</b> schaltet die zuletzt verwendete besondere Betriebsaktivität ein/aus.</td></tr> + <tr><td align="right">Q65-Schaltfläche:</td><td><b>Klick</b> schaltet auf Q65.<br/><b>Rechtsklick</b> schaltet auf Q65-Pileup.</td></tr> + <tr><td align="right">JT65-Schaltfläche:</td><td><b>Klick</b> schaltet auf JT65.<br/><b>Rechtsklick</b> schaltet auf JT9.</td></tr> + <tr><td align="right">Tx5-Schaltfläche:</td><td><b>Rechtsklick</b> behält den Tx5-Freitext bei.</td></tr> + <tr><td align="right">Tx gerade/1.:</td><td><b>Rechtsklick</b> friert den Zustand des Kontrollkästchens ein.<br/><b>Rechtsklick auf FT8</b> hebt die Sperre auf.</td></tr> + <tr><td align="right">Tx aktivieren:</td><td><b>Klick</b> schaltet Auto-Tx ein/aus.<br/><b>Rechtsklick</b> schaltet Wait &amp; Pounce ein/aus.</td></tr> + <tr><td align="right">Löschen:</td><td><b>Klick</b> löscht das Rx-Frequenzfenster.<br/><b>Doppelklick</b> löscht Rx-Frequenz- und Bandaktivitätsfenster.<br/>Bei aktiviertem alternativen Löschverhalten löscht <b>Klick</b> die Bandaktivität, <b>Rechtsklick</b> das Rx-Frequenzfenster und <b>Doppelklick</b> beide.</td></tr> + <tr><td align="right">DX Call:</td><td><b>Klick</b> schaltet Wait &amp; Call ein/aus.<br/><b>Rechtsklick</b> löscht DX Call, DX Grid und Standardnachrichten.</td></tr> + <tr><td align="right">Nachschlagen:</td><td><b>Klick</b> sucht das Rufzeichen in der Datenbank.<br/><b>Rechtsklick</b> sucht DX Call auf qrz.com.</td></tr> + <tr><td align="right">Hinzufügen:</td><td><b>Klick</b> fügt Rufzeichen und Locator zur Datenbank hinzu.<br/><b>Rechtsklick</b> sucht DX Call auf hamqth.com.</td></tr> + <tr><td align="right">Ignorieren:</td><td><b>Klick</b> fügt das Rufzeichen zur Ignorierliste hinzu.<br/><b>Rechtsklick</b> sucht DX Call auf qrzcq.com.</td></tr> + <tr><td align="right">Band-Schaltflächen:</td><td><b>Klick</b> schaltet Standardfrequenzen für Band/Modus um.<br/><b>Rechtsklick</b> schaltet FT8-DXpedition-Frequenzen um.</td></tr> +</table> + + + + Please choose another dial frequency. +Must be 3Khz away from %1. +WSJT-X will not operate in Fox mode +overlapping the standard FT8 sub-bands. + Bitte wählen Sie eine andere Wählfrequenz. +Sie muss mindestens 3 kHz von %1 entfernt sein. +WSJT-X arbeitet im Fox-Modus nicht +überlappend mit den Standard-FT8-Teilbändern. + + + + + Fox Mode warning + Warnung zum Fox-Modus + + + + Please choose another dial frequency. +WSJT-X will not operate in Fox mode +overlapping the WSPR sub-bands. + Bitte wählen Sie eine andere Wählfrequenz. +WSJT-X arbeitet im Fox-Modus nicht +überlappend mit den WSPR-Teilbändern. + + + + Last Tx: %1 + Letzte Tx: %1 + + + + This station transmits in the same time slot as you do. + +You must not start a QSO if both stations Tx even/1st +or Tx odd/2nd, while the Tx even/1st checkbox is disabled. + +Click the MSK144 mode button to re-enable the Tx even/1st +checkbox, or choose another station. + Diese Station sendet im selben Zeitschlitz wie Sie. + +Sie dürfen kein QSO beginnen, wenn beide Stationen Tx gerade/1. +oder Tx ungerade/2. verwenden, während das Kontrollkästchen Tx gerade/1. deaktiviert ist. + +Klicken Sie auf die MSK144-Modusschaltfläche, um das Kontrollkästchen Tx gerade/1. +wieder zu aktivieren, oder wählen Sie eine andere Station. + + + + Should you switch to EU VHF Contest mode? + +To do so, check 'Special operating activity' and +'EU VHF Contest' on the Settings | Advanced tab. + Möchten Sie in den EU-VHF-Contest-Modus wechseln? + +Aktivieren Sie dazu „Besondere Betriebsaktivität“ und +„EU VHF Contest“ auf Einstellungen | Erweitert. + + + + Should you switch to ARRL Field Day mode? + Möchten Sie in den ARRL-Field-Day-Modus wechseln? + + + + Should you switch to RTTY contest mode? + Möchten Sie in den RTTY-Contest-Modus wechseln? + + + + + + + Add to CALL3.TXT + Zu CALL3.TXT hinzufügen + + + + Please enter a valid grid locator + Bitte geben Sie einen gültigen Locator ein + + + + Cannot open "%1" for read/write: %2 + "%1" kann nicht zum Lesen/Schreiben geöffnet werden: %2 + + + + %1 +is already in CALL3.TXT, do you wish to replace it? + %1 +ist bereits in CALL3.TXT vorhanden. Möchten Sie den Eintrag ersetzen? + + + + Warning: DX Call field is empty. + Warnung: Das Feld DX-Rufzeichen ist leer. + + + + Log file error + Logdateifehler + + + + Cannot open "%1" + "%1" kann nicht geöffnet werden + + + + Error sending log to N1MM + Fehler beim Senden des Logs an N1MM + + + + Write returned "%1" + Schreibvorgang gab "%1" zurück + + + + Stations calling DXpedition %1 + Stationen, die DXpedition %1 rufen + + + + Show Already Worked + Bereits gearbeitete anzeigen + + + + Super Fox + Super Fox + + + + Super Hound + Super Hound + + + + Hound + Hound + + + + Tx Messages + Tx-Nachrichten + + + + + + + + + Confirm Erase + Löschen bestätigen + + + + Are you sure you want to erase file ALL.TXT? + Möchten Sie die Datei ALL.TXT wirklich löschen? + + + + Are you sure you want to erase the list of Q65 callers? + Möchten Sie die Liste der Q65-Anrufer wirklich löschen? + + + + + Confirm Reset + Zurücksetzen bestätigen + + + + Are you sure you want to erase your contest log? + Möchten Sie Ihr Contest-Log wirklich löschen? + + + + Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. + Dadurch werden alle QSO-Datensätze des aktuellen Contests entfernt. Sie bleiben in der ADIF-Logdatei erhalten, stehen aber nicht mehr für den Export in das Cabrillo-Log zur Verfügung. + + + + Cabrillo Log saved + Cabrillo-Log gespeichert + + + + Are you sure you want to erase file wsjtx_log.adi? + Möchten Sie die Datei wsjtx_log.adi wirklich löschen? + + + + Are you sure you want to erase the WSPR hashtable? + Möchten Sie die WSPR-Hashtabelle wirklich löschen? + + + + %1 W + %1 W + + + + SWR > 2.5 !!! + +Transmission was stopped + +Check your antenna + SWR > 2.5 !!! + +Aussendung wurde gestoppt + +Antenne prüfen + + + + Tune digital gain + Digitalverstärkung beim Abstimmen + + + + Transmit digital gain + Digitalverstärkung beim Senden + + + + Prefixes + Präfixe + + + + Network Error + Netzwerkfehler + + + + Error: %1 +UDP server %2:%3 + Fehler: %1 +UDP-Server %2:%3 + + + + File Error + Dateifehler + + + + Phase Training Disabled + Phasentraining deaktiviert + + + + Phase Training Enabled + Phasentraining aktiviert + + + + WD:0m + WD:0m + + + + Runaway Tx watchdog + Tx-Watchdog + + + + WD:%1m + WD:%1m + + + + + Free Text Message + Freitextnachricht + + + + + Message: + Nachricht: + + + + Directional calls not yet supported in SuperFox mode + Gerichtete Anrufe werden im SuperFox-Modus noch nicht unterstützt + + + + TOTP: No seed entered in fox configuration to generate verification code. + TOTP: Kein Seed in der Fox-Konfiguration zur Erzeugung des Verifizierungscodes eingegeben. + + + + TOTP SF: seed not long enough. + TOTP SF: Seed ist nicht lang genug. + + + + Are you sure you want to erase the Tx Log? + Möchten Sie das Tx-Log wirklich löschen? + + + + "%1" added to Ignore List + „%1“ zur Ignorierliste hinzugefügt + + + + Are you sure you want to erase the Ignore List? + Möchten Sie die Ignorierliste wirklich löschen? + + + + + Log File Error + Logdateifehler + + + + Are you sure you want to clear the QSO queues? + Möchten Sie die QSO-Warteschlangen wirklich leeren? + + + Download EME Ephemeris Chart + EME-Ephemeriden-Diagramm herunterladen + + + Highlight Whitelist entries + Einträge der Positivliste hervorheben + + + + MessageAveraging + + + + Message Averaging + Nachrichtenmittelung + + + + UTC Sync DT Freq + UTC Sync DT Freq + + + + Modes + + + + Mode + Modus + + + + MultiSettings + + + Default + Standard + + + + MultiSettings::impl + + + &Switch To + &Wechseln zu + + + + &Clone + &Klonen + + + + Clone &Into ... + Klonen &nach ... + + + + R&eset + &Zurücksetzen + + + + &Rename ... + &Umbenennen ... + + + + &Delete + &Löschen + + + + Clone Into Configuration + In Konfiguration klonen + + + + Confirm overwrite of all values for configuration "%1" with values from "%2"? + Alle Werte der Konfiguration „%1“ wirklich mit den Werten aus „%2“ überschreiben? + + + + Reset Configuration + Konfiguration zurücksetzen + + + + Confirm reset to default values for configuration "%1"? + Konfiguration „%1“ wirklich auf Standardwerte zurücksetzen? + + + + Delete Configuration + Konfiguration löschen + + + + Confirm deletion of configuration "%1"? + Konfiguration „%1“ wirklich löschen? + + + + NameDialog + + + New Configuration Name + Neuer Konfigurationsname + + + + Old name: + Alter Name: + + + + &New name: + &Neuer Name: + + + + NetworkAccessManager + + + Network SSL/TLS Errors + SSL/TLS-Netzwerkfehler + + + + OmniRigTransceiver + + + OmniRig: unrecognized mode + OmniRig: unbekannter Modus + + + + Failed to start OmniRig COM server + OmniRig-COM-Server konnte nicht gestartet werden + + + + OmniRig: don't know how to set rig frequency + OmniRig: unbekannt, wie die Funkfrequenz gesetzt werden soll + + + + OmniRig COM/OLE error: %1 at %2: %3 (%4) + OmniRig COM/OLE-Fehler: %1 bei %2: %3 (%4) + + + + PollingTransceiver + + + Unexpected rig error + Unerwarteter Funkgerätfehler + + + + QObject + + + Failed to open LotW users CSV file: '%1' + LoTW-Benutzer-CSV-Datei konnte nicht geöffnet werden: '%1' + + + + OOB + OOB + + + + Too many colours in palette. + Zu viele Farben in der Palette. + + + + Error reading waterfall palette file "%1:%2" too many colors. + Fehler beim Lesen der Wasserfall-Palettendatei "%1:%2": zu viele Farben. + + + + Error reading waterfall palette file "%1:%2" invalid triplet. + Fehler beim Lesen der Wasserfall-Palettendatei "%1:%2": ungültiges Tripel. + + + + Error reading waterfall palette file "%1:%2" invalid color. + Fehler beim Lesen der Wasserfall-Palettendatei "%1:%2": ungültige Farbe. + + + + Error opening waterfall palette file "%1": %2. + Fehler beim Öffnen der Wasserfall-Palettendatei "%1": %2. + + + + Error writing waterfall palette file "%1": %2. + Fehler beim Schreiben der Wasserfall-Palettendatei "%1": %2. + + + + QSYMessage + + + WSJT-X Popup + WSJT-X-Popup + + + + TextLabel + TextLabel + + + + Reply +Yes + Antwort +Ja + + + + Reply +No + Antwort +Nein + + + + QSYMessageCreator + + + Message Creator + Nachrichtenersteller + + + + HF + HF + + + + + SSB + SSB + + + + + + CW + CW + + + + + FM + FM + + + + FST4 + FST4 + + + + FT4 + FT4 + + + + + FT8 + FT8 + + + + JT9 + JT9 + + + + JT65 + JT65 + + + + + + + Message + Nachricht + + + + 630 M + 630 M + + + + 160 M + 160 M + + + + 80 M + 80 M + + + + 60 M + 60 M + + + + 40 M + 40 M + + + + 30 M + 30 M + + + + 20 M + 20 M + + + + 17 M + 17 M + + + + 15 M + 15 M + + + + 12 M + 12 M + + + + 28 MHz + 28 MHz + + + + 29 MHz + 29 MHz + + + + + + Mode + Modus + + + + + + Band + Band + + + + + + SAVE + SPEICHERN + + + + + + kHz + kHz + + + + + + Send +Message + Nachricht +senden + + + + VHF + VHF + + + + + 50 MHz + 50 MHz + + + + + 144 MHz + 144 MHz + + + + + 222 MHz + 222 MHz + + + + + 432 MHz + 432 MHz + + + + + 902 MHz + 902 MHz + + + + + 903 MHz + 903 MHz + + + + + 1296 MHz + 1296 MHz + + + + + 2304 MHz + 2304 MHz + + + + + 3400 MHz + 3400 MHz + + + + + 5760 MHz + 5760 MHz + + + + + 10368 MHz + 10368 MHz + + + + 24192 MHz + 24192 MHz + + + + 40 MHz + 40 MHz + + + + 70 MHz + 70 MHz + + + + MSK144 + MSK144 + + + + FM MHz + FM MHz + + + + EME + EME + + + + 24048 MHz + 24048 MHz + + + + Q65-30B + Q65-30B + + + + Q65-60C + Q65-60C + + + + Q65-60D + Q65-60D + + + + Q65-60E + Q65-60E + + + + Q65-120D + Q65-120D + + + + General + Allgemein + + + + Please call me by phone + Bitte rufen Sie mich telefonisch an + + + + Please check Ping Jockey + Bitte Ping Jockey prüfen + + + + You are in the log + Sie stehen im Log + + + + You are transmitting in the wrong time slot + Sie senden im falschen Zeitschlitz + + + + You are not in Contest Mode + Sie befinden sich nicht im Contest-Modus + + + + Your audio is distorted + Ihr Audio ist verzerrt + + + + Your transmitter is overmodulated + Ihr Sender ist übersteuert + + + + Please check ON4KST + Bitte ON4KST prüfen + + + + Please transmit above 1000 Hz + Bitte oberhalb von 1000 Hz senden + + + + Check your email + E-Mail prüfen + + + + Please check HB9Q Logger + Bitte HB9Q Logger prüfen + + + + Please check your PC Clock + Bitte PC-Uhr prüfen + + + + You are transmitting on top of a rare DX station + Sie senden auf der Frequenz einer seltenen DX-Station + + + + Please QSL via LoTW + Bitte QSL über LoTW + + + + Send Message + Nachricht senden + + + + MessageCreator + Nachrichtenersteller + + + + QSYMonitor + + + QSYMonitor + QSY-Monitor + + + + Clear + Löschen + + + + QSY Monitor + QSY-Monitor + + + + RemoteFile + + + + + + + + File System Error + Dateisystemfehler + + + + Cannot rename file: +"%1" +to: "%2" +Error(%3): %4 + Datei kann nicht umbenannt werden: +"%1" +in: "%2" +Fehler(%3): %4 + + + + Cannot delete file: +"%1" + Datei kann nicht gelöscht werden: +"%1" + + + + + + Network Error + Netzwerkfehler + + + + Too many redirects: %1 + Zu viele Weiterleitungen: %1 + + + + Redirect not followed: %1 + Weiterleitung nicht verfolgt: %1 + + + + Cannot commit changes to: +"%1" + Änderungen können nicht übernommen werden für: +"%1" + + + + Cannot open file: +"%1" +Error(%2): %3 + Datei kann nicht geöffnet werden: +"%1" +Fehler(%2): %3 + + + + Cannot make path: +"%1" + Pfad kann nicht erstellt werden: +"%1" + + + + Cannot write to file: +"%1" +Error(%2): %3 + In Datei kann nicht geschrieben werden: +"%1" +Fehler(%2): %3 + + + + SampleDownloader::impl + + + + Download Samples + Beispiele herunterladen + + + + &Abort + &Abbrechen + + + + &Refresh + &Aktualisieren + + + + &Details + &Details + + + + Base URL for samples: + Basis-URL für Beispiele: + + + + Only use HTTP: + Nur HTTP verwenden: + + + + Check this if you get SSL/TLS errors + Aktivieren, wenn SSL/TLS-Fehler auftreten + + + + Input Error + Eingabefehler + + + + Invalid URL format + Ungültiges URL-Format + + + + SoundInput + + + An error opening the audio input device has occurred. + Beim Öffnen des Audio-Eingabegeräts ist ein Fehler aufgetreten. + + + + An error occurred during read from the audio input device. + Beim Lesen vom Audio-Eingabegerät ist ein Fehler aufgetreten. + + + + Non-recoverable error, audio input device not usable at this time. + Nicht behebbarer Fehler; Audio-Eingabegerät ist derzeit nicht verwendbar. + + + + Requested input audio format is not valid. + Angefordertes Audio-Eingabeformat ist ungültig. + + + + Requested input audio format is not supported on device. + Angefordertes Audio-Eingabeformat wird vom Gerät nicht unterstützt. + + + + Failed to initialize audio sink device + Audio-Sink-Gerät konnte nicht initialisiert werden + + + + Idle + Leerlauf + + + + Receiving + Empfang + + + + Suspended + Angehalten + + + + Interrupted + Unterbrochen + + + + Error + Fehler + + + + Stopped + Gestoppt + + + + SoundOutput + + + An error opening the audio output device has occurred. + Beim Öffnen des Audio-Ausgabegeräts ist ein Fehler aufgetreten. + + + + An error occurred during write to the audio output device. + Beim Schreiben auf das Audio-Ausgabegerät ist ein Fehler aufgetreten. + + + + Audio data not being fed to the audio output device fast enough. + Audiodaten werden dem Audio-Ausgabegerät nicht schnell genug zugeführt. + + + + Non-recoverable error, audio output device not usable at this time. + Nicht behebbarer Fehler; Audio-Ausgabegerät ist derzeit nicht verwendbar. + + + + Requested output audio format is not valid. + Angefordertes Audio-Ausgabeformat ist ungültig. + + + + Requested output audio format is not supported on device. + Angefordertes Audio-Ausgabeformat wird vom Gerät nicht unterstützt. + + + + No audio output device configured. + Kein Audio-Ausgabegerät konfiguriert. + + + + Idle + Leerlauf + + + + Sending + Senden + + + + Suspended + Angehalten + + + + Interrupted + Unterbrochen + + + + Error + Fehler + + + + Stopped + Gestoppt + + + + StationDialog + + + Add Station + Station hinzufügen + + + + &Band: + &Band: + + + + &Offset (MHz): + &Offset (MHz): + + + + &Antenna: + &Antenne: + + + + StationList::impl + + + Band name + Bandname + + + + Frequency offset + Frequenzoffset + + + + Antenna description + Antennenbeschreibung + + + + Band + Band + + + + Offset + Offset + + + + Antenna Description + Antennenbeschreibung + + + + TCITransceiver + + + ConnectionRefused + VerbindungAbgelehnt + + + + RemoteHostClosed + RemoteHostGeschlossen + + + + HostNotFound + HostNichtGefunden + + + + SocketAccess + SocketZugriff + + + + SocketResource + SocketRessource + + + + SocketTimeout + SocketZeitüberschreitung + + + + DatagramTooLarge + DatagrammZuGroß + + + + Network + Netzwerk + + + + AddressInUse + AdresseInVerwendung + + + + SocketAddressNotAvailable + SocketAdresseNichtVerfügbar + + + + UnsupportedSocketOperation + NichtUnterstützteSocketOperation + + + + UnfinishedSocketOperation + UnbeendeteSocketOperation + + + + ProxyAuthenticationRequired + ProxyAuthentifizierungErforderlich + + + + SslHandshakeFailed + SslHandshakeFehlgeschlagen + + + + ProxyConnectionRefused + ProxyVerbindungAbgelehnt + + + + ProxyConnectionClosed + ProxyVerbindungGeschlossen + + + + ProxyConnectionTimeout + ProxyVerbindungZeitüberschreitung + + + + ProxyNotFound + ProxyNichtGefunden + + + + ProxyProtocol + ProxyProtokoll + + + + Operation + Operation + + + + SslInternal + SslIntern + + + + SslInvalidUserData + SslUngültigeBenutzerdaten + + + + Temporary + Temporär + + + + UnknownSocket + UnbekannterSocket + + + + TCI websocket error: %1 + TCI-Websocket-Fehler: %1 + + + + TCI SDR could not be switched on + TCI-SDR konnte nicht eingeschaltet werden + + + + TCI SDR is not switched on + TCI-SDR ist nicht eingeschaltet + + + + TCI RX2 could not be enabled + TCI RX2 konnte nicht aktiviert werden + + + + TCI Audio could not be switched on + TCI-Audio konnte nicht eingeschaltet werden + + + + + TCI could not be opened + TCI konnte nicht geöffnet werden + + + + + TCI failed to set ptt + TCI konnte PTT nicht setzen + + + + TCI should use PTT via CAT + TCI sollte PTT über CAT verwenden + + + + + TCI failed set rxfreq + TCI konnte rxfreq nicht setzen + + + + + TCI failed set mode + TCI konnte den Modus nicht setzen + + + + TCI modulator not Idle + TCI-Modulator ist nicht im Leerlauf + + + + TransceiverBase + + + Unexpected rig error + Unerwarteter Funkgerätfehler + + + + WideGraph + + + Dialog + Dialog + + + + Spectrum gain + Spektrum-Verstärkung + + + + <html><head/><body><p>Enter definition for a new color palette.</p></body></html> + <html><head/><body><p>Definition für eine neue Farbpalette eingeben.</p></body></html> + + + + Adjust... + Anpassen... + + + + Total power (dB) + Gesamtleistung (dB) + + + + Waterfall gain + Wasserfall-Verstärkung + + + + <html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html> + <html><head/><body><p>Prozentualen Anteil des Spektrums in diesem Fenster festlegen.</p></body></html> + + + + % + % + + + + Spec + Spektr. + + + + <html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html> + <html><head/><body><p>Spektrale Basislinie über das gesamte angezeigte Intervall glätten.</p></body></html> + + + + Flatten + Glätten + + + + <html><head/><body><p>Compute and save a reference spectrum. (Not yet fully implemented.)</p></body></html> + <html><head/><body><p>Referenzspektrum berechnen und speichern. (Noch nicht vollständig implementiert.)</p></body></html> + + + + Ref Spec + Ref.-Spektrum + + + + Smoothing of Linear Average spectrum + Glättung des linear gemittelten Spektrums + + + + Smooth + Glätten + + + + Compression factor for frequency scale + Kompressionsfaktor der Frequenzskala + + + + Bins/Pixel + Bins/Pixel + + + + + <html><head/><body><p>Position of time stamp above each interval line</p></body></html> + <html><head/><body><p>Position des Zeitstempels über jeder Intervalllinie</p></body></html> + + + + Time stamp + Zeitstempel + + + + + Off + Aus + + + + Left + Links + + + + Right + Rechts + + + + Palette + Palette + + + + Select waterfall palette + Wasserfall-Palette auswählen + + + + Bars + Balken + + + + Freq + Freq + + + + <html><head/><body><p>Select data for spectral display</p></body></html> + <html><head/><body><p>Daten für die Spektralanzeige auswählen</p></body></html> + + + + Current + Aktuell + + + + Cumulative + Kumulativ + + + + Linear Avg + Linearer Mittelwert + + + + Reference + Referenz + + + + Q65_Sync + Q65_Sync + + + + <html><head/><body><p>Frequency at left edge of waterfall</p></body></html> + <html><head/><body><p>Frequenz am linken Rand des Wasserfalls</p></body></html> + + + + Hz + Hz + + + + Start + Start + + + + <html><head/><body><p>Decode JT9 only above this frequency</p></body></html> + <html><head/><body><p>JT9 nur oberhalb dieser Frequenz dekodieren</p></body></html> + + + + Hz + Hz + + + + Split + Split + + + + Number of FFTs averaged (controls waterfall scrolling rate) + Anzahl gemittelter FFTs (steuert die Scrollrate des Wasserfalls) + + + + N Avg + N Mittel + + + + Waterfall zero + Wasserfall-Nullpunkt + + + + Spectrum zero + Spektrum-Nullpunkt + + + + User Defined + Benutzerdefiniert + + + + Wide Graph + Breitbanddiagramm + + + + + Read Palette + Palette lesen + + + + WorkedBefore + + + Invalid ADIF field %0: %1 + Ungültiges ADIF-Feld %0: %1 + + + + Malformed ADIF field %0: %1 + Fehlerhaftes ADIF-Feld %0: %1 + + + + Invalid ADIF header + Ungültiger ADIF-Header + + + + Error opening ADIF log file for read: %0 + Fehler beim Öffnen der ADIF-Logdatei zum Lesen: %0 + + + + configuration_dialog + + + Settings + Einstellungen + + + + Genera&l + All&gemein + + + + General station details and settings. + Allgemeine Stationsdaten und Einstellungen. + + + + Station Details + Stationsdaten + + + + My C&all: + Mein &Rufzeichen: + + + + Station callsign. + Stationsrufzeichen. + + + + M&y Grid: + Mein &Locator: + + + + <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> + <html><head/><body><p>Maidenhead-Locator, vorzugsweise 6 Zeichen.</p></body></html> + + + + Check to allow grid changes from external programs + Aktivieren, um Locator-Änderungen durch externe Programme zuzulassen + + + + AutoGrid + AutoGrid + + + + IARU Region: + IARU-Region: + + + + <html><head/><body><p>Select your IARU region.</p></body></html> + <html><head/><body><p>Ihre IARU-Region auswählen.</p></body></html> + + + + Message generation for type 2 compound callsign holders: + Nachrichtenerzeugung für Inhaber zusammengesetzter Rufzeichen Typ 2: + + + + <html><head/><body><p>Type 2 compound callsigns are those with prefixes or suffixes not included in the allowed shortlist (See Help-&gt;Add-on prefixes and suffixes).</p><p>This option determines which generated messages should contain your full type 2 compound call sign rather than your base callsign. It only applies if you have a type 2 compound callsign.</p><p>This option controls the way the messages that are used to answer CQ calls are generated. Generated messages 6 (CQ) and 5 (73) will always contain your full callsign. The JT65 and JT9 protocols allow for some standard messages with your full call at the expense of another piece of information such as the DX call or your locator.</p><p>Choosing message 1 omits the DX callsign which may be an issue when replying to CQ calls. Choosing message 3 also omits the DX callsign and many versions of this and other software will not extract the report. Choosing neither means that your full callsign only goes in your message 5 (73) so your QSO partner may log the wrong callsign.</p><p>None of these options are perfect, message 3 is usually best but be aware your QSO partner may not log the report you send them.</p></body></html> + <html><head/><body><p>Zusammengesetzte Rufzeichen Typ 2 enthalten Präfixe oder Suffixe, die nicht in der erlaubten Kurzliste stehen (siehe Hilfe-&gt;Zusätzliche Präfixe und Suffixe).</p><p>Diese Option legt fest, welche erzeugten Nachrichten Ihr vollständiges zusammengesetztes Rufzeichen Typ 2 anstelle des Basisrufzeichens enthalten sollen. Sie gilt nur, wenn Sie ein zusammengesetztes Rufzeichen Typ 2 haben.</p><p>Diese Option steuert, wie Nachrichten zur Beantwortung von CQ-Rufen erzeugt werden. Die erzeugten Nachrichten 6 (CQ) und 5 (73) enthalten immer Ihr vollständiges Rufzeichen. Die Protokolle JT65 und JT9 erlauben einige Standardnachrichten mit Ihrem vollständigen Rufzeichen auf Kosten anderer Informationen wie DX-Rufzeichen oder Locator.</p><p>Bei Auswahl von Nachricht 1 fehlt das DX-Rufzeichen, was beim Beantworten von CQ problematisch sein kann. Bei Nachricht 3 fehlt es ebenfalls, und viele Versionen dieser und anderer Software extrahieren den Rapport nicht. Wenn Sie keine der beiden wählen, steht Ihr vollständiges Rufzeichen nur in Nachricht 5 (73), sodass Ihr QSO-Partner möglicherweise das falsche Rufzeichen loggt.</p><p>Keine dieser Optionen ist perfekt; Nachricht 3 ist meist die beste Wahl. Beachten Sie jedoch, dass Ihr QSO-Partner den gesendeten Rapport eventuell nicht loggt.</p></body></html> + + + + Full call in Tx1 + Vollständiges Rufzeichen in Tx1 + + + + Full call in Tx3 + Vollständiges Rufzeichen in Tx3 + + + + Full call in Tx5 only + Vollständiges Rufzeichen nur in Tx5 + + + + Display + Anzeige + + + + Show outgoing transmitted messages in the Rx frequency window. + Ausgehende gesendete Nachrichten im Rx-Frequenzfenster anzeigen. + + + + &Tx messages to Rx frequency window + &Tx-Nachrichten im Rx-Frequenzfenster + + + + Show if decoded stations are new DXCC entities or worked before. + Anzeigen, ob dekodierte Stationen neue DXCC-Gebiete sind oder bereits gearbeitet wurden. + + + + <html><head/><body><p>Check to have decodes for a new period start at the top of the Band Activity window and not scroll off the top when the window is full.</p><p>This is to aid selecting decodes to double-click while decoding is still in progress. Use the Band Activity vertical scroll bar to reveal decodes past the bottom of the window.</p></body></html> + <html><head/><body><p>Aktivieren, damit Dekodierungen einer neuen Periode oben im Bandaktivitätsfenster beginnen und bei vollem Fenster nicht nach oben herausrollen.</p><p>Dies erleichtert die Auswahl von Dekodierungen per Doppelklick, während die Dekodierung noch läuft. Mit der vertikalen Bildlaufleiste können Dekodierungen unterhalb des sichtbaren Bereichs angezeigt werden.</p></body></html> + + + + Start new period decodes at top + Dekodierungen neuer Periode oben beginnen + + + + Set the font characteristics for the application. + Schrifteigenschaften der Anwendung festlegen. + + + + Font... + Schrift... + + + + Set the font characteristics for the Band Activity and Rx Frequency areas. + Schrifteigenschaften für Bandaktivität und Rx-Frequenzbereiche festlegen. + + + + Decoded Text Font... + Schrift für dekodierten Text... + + + + Include a separator line between periods in the band activity window. + Trennlinie zwischen Perioden im Bandaktivitätsfenster einfügen. + + + + &Blank line between decoding periods + &Leerzeile zwischen Dekodierperioden + + + + Show distance to DX station in miles rather than kilometers. + Entfernung zur DX-Station in Meilen statt Kilometern anzeigen. + + + + Display dista&nce in miles + Entfernung in &Meilen anzeigen + + + + Behavior + Verhalten + + + + Decode after EME delay + Nach EME-Verzögerung dekodieren + + + + <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> + <html><head/><body><p>Anzahl Minuten, bevor unbeaufsichtigte Aussendungen abgebrochen werden</p></body></html> + + + + Disabled + Deaktiviert + + + + minutes + Minuten + + + + Single decode + Einzeldekodierung + + + + <html><head/><body><p>Some rigs are not able to process CAT commands while transmitting. This means that if you are operating in split mode you may have to uncheck this option.</p></body></html> + <html><head/><body><p>Manche Funkgeräte können während des Sendens keine CAT-Befehle verarbeiten. Wenn Sie im Split-Modus arbeiten, müssen Sie diese Option möglicherweise deaktivieren.</p></body></html> + + + + Allow Tx frequency changes while transmitting + Änderungen der Tx-Frequenz während des Sendens zulassen + + + + Don't start decoding until the monitor button is clicked. + Dekodierung erst starten, nachdem die Monitor-Schaltfläche angeklickt wurde. + + + + Mon&itor off at startup + Mon&itor beim Start aus + + + + <html><head/><body><p>Check this if you wish to automatically return to the last monitored frequency when monitor is enabled, leave it unchecked if you wish to have the current rig frequency maintained.</p></body></html> + <html><head/><body><p>Aktivieren, um beim Einschalten des Monitors automatisch zur zuletzt überwachten Frequenz zurückzukehren. Deaktiviert lassen, wenn die aktuelle Funkfrequenz beibehalten werden soll.</p></body></html> + + + + Monitor returns to last used frequency + Monitor kehrt zur zuletzt verwendeten Frequenz zurück + + + + Alternate F1-F6 bindings + Alternative F1-F6-Belegung + + + + Turns off automatic transmissions after sending a 73 or any other free +text message. + Schaltet automatische Aussendungen nach dem Senden von 73 oder einer anderen Freitextnachricht aus. + + + + Di&sable Tx after sending 73 + Tx nach Senden von 73 &deaktivieren + + + + Send a CW ID after every 73 or free text message. + Nach jeder 73- oder Freitextnachricht eine CW-ID senden. + + + + CW ID a&fter 73 + CW-ID &nach 73 + + + + Send a CW ID periodically every few minutes. +This might be required under your countries licence regulations. +It will not interfere with other users as it is always sent in the +quiet period when decoding is done. + Eine CW-ID regelmäßig alle paar Minuten senden. +Dies kann aufgrund der Lizenzbestimmungen Ihres Landes erforderlich sein. +Andere Benutzer werden dadurch nicht gestört, da sie immer in der +Ruhephase während der Dekodierung gesendet wird. + + + + Automatic transmission mode. + Automatischer Sendemodus. + + + + Show &DXCC, grid, and worked-before status + &DXCC-, Locator- und Bereits-gearbeitet-Status anzeigen + + + + Highlight DX Grid in message + DX-Locator in Nachricht hervorheben + + + + Show DXCC for all messages + DXCC für alle Nachrichten anzeigen + + + + Show the separator line between periods with time stamp of the decode period. + Trennlinie zwischen Perioden mit Zeitstempel der Dekodierperiode anzeigen. + + + + Show blank line with time stamp + Leerzeile mit Zeitstempel anzeigen + + + + Show principal prefix instead of country name + Hauptpräfix statt Ländernamen anzeigen + + + + Highlight DX Call in message + DX-Rufzeichen in Nachricht hervorheben + + + + Doubl&e-click on call sets Tx enable + Doppel&klick auf Rufzeichen aktiviert Tx + + + + <html><head/><body><p>Open the Astronomical Data window automatically when switching to Q65 or JT65 mode and Decode after EME delay is enabled, and close it when no longer needed.</p><p>Open the QSYMessage Creator automatically if the VHF Features are enabled and such QSY messages are applicable.</p></body></html> + <html><head/><body><p>Das Fenster Astronomische Daten automatisch öffnen, wenn auf Q65 oder JT65 gewechselt wird und „Nach EME-Verzögerung dekodieren“ aktiviert ist; schließen, wenn es nicht mehr benötigt wird.</p><p>Den QSY-Nachrichtenersteller automatisch öffnen, wenn VHF-Funktionen aktiviert sind und entsprechende QSY-Nachrichten anwendbar sind.</p></body></html> + + + + Auto-open/close Astronomical data window + Fenster Astronomische Daten automatisch öffnen/schließen + + + + Calling CQ forces Call 1st + CQ-Ruf erzwingt „Call 1st“ + + + + <html><head/><body><p>Tx until 73 is received when in MSK144 or Q65 mode. </p></body></html> + <html><head/><body><p>In MSK144- oder Q65-Modus senden, bis 73 empfangen wurde.</p></body></html> + + + + MSK144/Q65: Tx until 73 is received + MSK144/Q65: Tx bis 73 empfangen wird + + + + <html><head/><body><p>Allow kHz frequency offset entry without 'k' suffix.</p></body></html> + <html><head/><body><p>Eingabe eines kHz-Frequenzoffsets ohne Suffix „k“ zulassen.</p></body></html> + + + + kHz entry without k (restart required) + kHz-Eingabe ohne k (Neustart erforderlich) + + + + <html><head/><body><p>Disable the Tune watchdog.</p></body></html> + <html><head/><body><p>Tune-Watchdog deaktivieren.</p></body></html> + + + + Tune watchdog + Tune-Watchdog + + + + <html><head/><body><p>Number of seconds before Tune is aborted</p></body></html> + <html><head/><body><p>Anzahl Sekunden, bevor Tune abgebrochen wird</p></body></html> + + + + seconds + Sekunden + + + + Tx watchdog: + Tx-Watchdog: + + + + ID Inter&val: + ID-Inter&vall: + + + + <html><head/><body><p>Turn the progress bar red while transmitting.</p></body></html> + <html><head/><body><p>Fortschrittsbalken während des Sendens rot anzeigen.</p></body></html> + + + + Turn progress bar red while transmitting + Fortschrittsbalken beim Senden rot anzeigen + + + + Additional features + Zusätzliche Funktionen + + + + Set Rx frequency to Tx frequency after QSO + Rx-Frequenz nach QSO auf Tx-Frequenz setzen + + + + <html><head/><body><p>If a station sends locator, calculate and show the distance in Band Activity pane.</p></body></html> + <html><head/><body><p>Wenn eine Station einen Locator sendet, Entfernung berechnen und im Bandaktivitätsfenster anzeigen.</p></body></html> + + + + Show distance in messages with grid + Entfernung in Nachrichten mit Locator anzeigen + + + + <html><head/><body><p>Erase Band Activity and Rx frequency windows after band change.</p></body></html> + <html><head/><body><p>Bandaktivitäts- und Rx-Frequenzfenster nach Bandwechsel löschen.</p></body></html> + + + + Erase decodes after band change + Dekodierungen nach Bandwechsel löschen + + + + Clear DX Grid after QSO + DX-Locator nach QSO löschen + + + + Show U.S. States in messages with grid + US-Bundesstaaten in Nachrichten mit Locator anzeigen + + + + Map Grid locator to U.S. State + Locator einem US-Bundesstaat zuordnen + + + + <html><head/><body><p>Align the text for DXCC, distance and azimuth.</p></body></html> + <html><head/><body><p>Text für DXCC, Entfernung und Azimut ausrichten.</p></body></html> + + + + Align DXCC/distance/azimuth + DXCC/Entfernung/Azimut ausrichten + + + + Alternate Erase button behavior + Alternatives Verhalten der Löschen-Schaltfläche + + + + Clear DX Call after QSO + DX-Rufzeichen nach QSO löschen + + + + <html><head/><body><p>Increase or decrease the space between message text and DXCC.</p></body></html> + <html><head/><body><p>Abstand zwischen Nachrichtentext und DXCC vergrößern oder verkleinern.</p></body></html> + + + + Enable Wait features + Wait-Funktionen aktivieren + + + + <html><head/><body><p>If a station sends a valid Maidenhead locator, calculate and show the great-circle azimuth in Band Activity pane.</p></body></html> + <html><head/><body><p>Wenn eine Station einen gültigen Maidenhead-Locator sendet, Großkreis-Azimut berechnen und im Bandaktivitätsfenster anzeigen.</p></body></html> + + + + Show azimuth in messages with grid + Azimut in Nachrichten mit Locator anzeigen + + + + <html><head/><body><p>Increase or decrease the space between DXCC and distance/azimuth.</p></body></html> + <html><head/><body><p>Abstand zwischen DXCC und Entfernung/Azimut vergrößern oder verkleinern.</p></body></html> + + + + Less button coloring (restart required) + Weniger Schaltflächenfarben (Neustart erforderlich) + + + + &Radio + &Radio + + + + Radio interface configuration settings. + Einstellungen der Funkgeräteschnittstelle. + + + + <html><head/><body><p>Use only VFO A for split operation (the program temporarily changes the QRG of your rig during transmission).</p></body></html> + <html><head/><body><p>Nur VFO A für Split-Betrieb verwenden (das Programm ändert während des Sendens vorübergehend die QRG des Funkgeräts).</p></body></html> + + + + <html><head/><body><p>Use VFO A+B for split operation (works with many rigs, but requires the use of both VFOs).</p></body></html> + <html><head/><body><p>VFO A+B für Split-Betrieb verwenden (funktioniert mit vielen Funkgeräten, erfordert aber beide VFOs).</p></body></html> + + + + <html><head/><body><p>Don't use split (not recommended).</p></body></html> + <html><head/><body><p>Kein Split verwenden (nicht empfohlen).</p></body></html> + + + + Settings that control your CAT interface. + Einstellungen zur Steuerung Ihrer CAT-Schnittstelle. + + + + CAT Control + CAT-Steuerung + + + + + Port: + Port: + + + + Serial port used for CAT control. + Serieller Port für CAT-Steuerung. + + + + + Serial Port Parameters + Parameter des seriellen Ports + + + + Baud Rate: + Baudrate: + + + + Serial port data rate which must match the setting of your radio. + Datenrate des seriellen Ports; muss mit der Einstellung Ihres Funkgeräts übereinstimmen. + + + + 1200 + 1200 + + + + 2400 + 2400 + + + + 4800 + 4800 + + + + 9600 + 9600 + + + + 19200 + 19200 + + + + 38400 + 38400 + + + + 57600 + 57600 + + + + 115200 + 115200 + + + + <html><head/><body><p>Number of data bits used to communicate with your radio's CAT interface (usually eight).</p></body></html> + <html><head/><body><p>Anzahl der Datenbits zur Kommunikation mit der CAT-Schnittstelle Ihres Funkgeräts (normalerweise acht).</p></body></html> + + + + Data Bits + Datenbits + + + + D&efault + Stan&dard + + + + Se&ven + Sie&ben + + + + E&ight + A&cht + + + + <html><head/><body><p>Number of stop bits used when communicating with your radio's CAT interface</p><p>(consult you radio's manual for details).</p></body></html> + <html><head/><body><p>Anzahl der Stoppbits bei der Kommunikation mit der CAT-Schnittstelle Ihres Funkgeräts.</p><p>Details finden Sie im Handbuch Ihres Funkgeräts.</p></body></html> + + + + Stop Bits + Stoppbits + + + + + Default + Standard + + + + On&e + Ei&ns + + + + T&wo + Z&wei + + + + <html><head/><body><p>Flow control protocol used between this computer and your radio's CAT interface (usually &quot;None&quot; but some require &quot;Hardware&quot;).</p></body></html> + <html><head/><body><p>Flusssteuerungsprotokoll zwischen diesem Computer und der CAT-Schnittstelle Ihres Funkgeräts (normalerweise „Keine“, manche Geräte benötigen „Hardware“).</p></body></html> + + + + + Handshake + Handshake + + + + &None + &Keine + + + + Software flow control (very rare on CAT interfaces). + Software-Flusssteuerung (bei CAT-Schnittstellen sehr selten). + + + + XON/XOFF + XON/XOFF + + + + Flow control using the RTS and CTS RS-232 control lines +not often used but some radios have it as an option and +a few, particularly some Kenwood rigs, require it). + Flusssteuerung über die RS-232-Steuerleitungen RTS und CTS. +Wird selten verwendet, ist aber bei manchen Funkgeräten optional und +bei einigen, insbesondere bestimmten Kenwood-Geräten, erforderlich. + + + + &Hardware + &Hardware + + + + Special control of CAT port control lines. + Spezielle Steuerung der CAT-Port-Steuerleitungen. + + + + + Force Control Lines + Steuerleitungen erzwingen + + + + + High + Hoch + + + + + Low + Niedrig + + + + DTR: + DTR: + + + + RTS: + RTS: + + + + How this program activates the PTT on your radio? + Wie soll dieses Programm PTT am Funkgerät aktivieren? + + + + PTT Method + PTT-Methode + + + + <html><head/><body><p>No PTT activation, instead the radio's automatic VOX is used to key the transmitter.</p><p>Use this if you have no radio interface hardware.</p></body></html> + <html><head/><body><p>Keine PTT-Aktivierung; stattdessen wird das automatische VOX des Funkgeräts verwendet.</p><p>Verwenden Sie dies, wenn keine Hardware-Schnittstelle vorhanden ist.</p></body></html> + + + + VO&X + VO&X + + + + <html><head/><body><p>Use the RS-232 DTR control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The DTR control line of the CAT serial port may be used for this or a DTR control line on a different serial port may be used.</p></body></html> + <html><head/><body><p>Die RS-232-DTR-Steuerleitung zum Schalten von PTT verwenden; dafür ist eine entsprechende Hardware-Schnittstelle erforderlich.</p><p>Einige kommerzielle Interface-Geräte verwenden ebenfalls diese Methode.</p><p>Es kann die DTR-Leitung des CAT-Ports oder die DTR-Leitung eines anderen seriellen Ports verwendet werden.</p></body></html> + + + + &DTR + &DTR + + + + Some radios support PTT via CAT commands, +use this option if your radio supports it and you have no +other hardware interface for PTT. + Einige Funkgeräte unterstützen PTT über CAT-Befehle. +Verwenden Sie diese Option, wenn Ihr Funkgerät dies unterstützt und +keine andere Hardware-Schnittstelle für PTT vorhanden ist. + + + + C&AT + C&AT + + + + <html><head/><body><p>Use the RS-232 RTS control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The RTS control line of the CAT serial port may be used for this or a RTS control line on a different serial port may be used. Note that this option is not available on the CAT serial port when hardware flow control is used.</p></body></html> + <html><head/><body><p>Die RS-232-RTS-Steuerleitung zum Schalten von PTT verwenden; dafür ist eine entsprechende Hardware-Schnittstelle erforderlich.</p><p>Einige kommerzielle Interface-Geräte verwenden ebenfalls diese Methode.</p><p>Es kann die RTS-Leitung des CAT-Ports oder eines anderen seriellen Ports verwendet werden. Beachten Sie, dass diese Option am CAT-Port nicht verfügbar ist, wenn Hardware-Flusssteuerung verwendet wird.</p></body></html> + + + + R&TS + R&TS + + + + <html><head/><body><p>Select the RS-232 serial port utilised for PTT control, this option is available when DTR or RTS is selected above as a transmit method.</p><p>This port can be the same one as the one used for CAT control.</p><p>For some interface types the special value CAT may be chosen, this is used for non-serial CAT interfaces that can control serial port control lines remotely (OmniRig for example).</p></body></html> + <html><head/><body><p>Wählen Sie den RS-232-Port für die PTT-Steuerung. Diese Option ist verfügbar, wenn oben DTR oder RTS als Sendemethode gewählt wurde.</p><p>Dieser Port kann derselbe wie für die CAT-Steuerung sein.</p><p>Für einige Schnittstellentypen kann der Sonderwert CAT gewählt werden. Er wird für nichtserielle CAT-Schnittstellen verwendet, die serielle Steuerleitungen fernsteuern können, z. B. OmniRig.</p></body></html> + + + + Modulation mode selected on radio. + Am Funkgerät ausgewählter Modulationsmodus. + + + + Mode + Modus + + + + <html><head/><body><p>USB is usually the correct modulation mode,</p><p>unless the radio has a special data or packet mode setting</p><p>for AFSK operation.</p></body></html> + <html><head/><body><p>USB ist normalerweise der richtige Modulationsmodus,</p><p>außer das Funkgerät besitzt einen speziellen Daten- oder Paketmodus</p><p>für AFSK-Betrieb.</p></body></html> + + + + US&B + US&B + + + + Don't allow the program to set the radio mode +(not recommended but use if the wrong mode +or bandwidth is selected). + Dem Programm nicht erlauben, den Funkmodus zu setzen +(nicht empfohlen; nur verwenden, wenn sonst ein falscher Modus +oder eine falsche Bandbreite gewählt wird). + + + + + None + Keine + + + + If this is available then it is usually the correct mode for this program. + Wenn verfügbar, ist dies normalerweise der richtige Modus für dieses Programm. + + + + Data/P&kt + Data/P&kt + + + + Some radios can select the audio input using a CAT command, +this setting allows you to select which audio input will be used +(if it is available then generally the Rear/Data option is best). + Einige Funkgeräte können den Audioeingang per CAT-Befehl wählen. +Mit dieser Einstellung können Sie festlegen, welcher Audioeingang verwendet wird. +Falls verfügbar, ist „Rear/Data“ normalerweise die beste Wahl. + + + + Transmit Audio Source + Audioquelle beim Senden + + + + Rear&/Data + Rear&/Data + + + + &Front/Mic + &Front/Mic + + + + Rig: + Funkgerät: + + + + Poll Interval: + Abfrageintervall: + + + + <html><head/><body><p>Interval to poll rig for status. Longer intervals will mean that changes to the rig will take longer to be detected.</p></body></html> + <html><head/><body><p>Intervall zur Statusabfrage des Funkgeräts. Bei längeren Intervallen werden Änderungen am Funkgerät später erkannt.</p></body></html> + + + + s + s + + + + <html><head/><body><p>Attempt to connect to the radio with these settings.</p><p>The button will turn green if the connection is successful or red if there is a problem.</p></body></html> + <html><head/><body><p>Mit diesen Einstellungen eine Verbindung zum Funkgerät herstellen.</p><p>Die Schaltfläche wird bei erfolgreicher Verbindung grün und bei einem Problem rot.</p></body></html> + + + + Test CAT + CAT testen + + + + Attempt to activate the transmitter. +Click again to deactivate. Normally no power should be +output since there is no audio being generated at this time. +Check that any Tx indication on your radio and/or your +radio interface behave as expected. + Versucht, den Sender zu aktivieren. +Erneut klicken, um ihn zu deaktivieren. Normalerweise sollte keine Leistung +ausgegeben werden, da zu diesem Zeitpunkt kein Audio erzeugt wird. +Prüfen Sie, ob die Tx-Anzeige am Funkgerät und/oder an Ihrer +Funkgeräteschnittstelle wie erwartet reagiert. + + + + Test PTT + PTT testen + + + + Split Operation + Split-Betrieb + + + + Fake It + Fake It + + + + Rig + Funkgerät + + + + A&udio + A&udio + + + + Audio interface settings + Einstellungen der Audioschnittstelle + + + + Souncard + Soundkarte + + + + Soundcard + Soundkarte + + + + Select the audio CODEC to use for transmitting. +If this is your default device for system sounds then +ensure that all system sounds are disabled otherwise +you will broadcast any systems sounds generated during +transmitting periods. + Wählen Sie den Audio-CODEC zum Senden. +Wenn dies Ihr Standardgerät für Systemsounds ist, +müssen alle Systemsounds deaktiviert sein, da sonst +während der Sendeperioden erzeugte Systemsounds +mit ausgesendet werden. + + + + <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> + <html><head/><body><p>Portnummer des UDP-Servers eingeben, an den WSJT-X Aktualisierungen senden soll. Bei 0 werden keine Aktualisierungen gesendet.</p></body></html> + + + + Outgoing interfaces: + Ausgehende Schnittstellen: + + + + <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> + <html><head/><body><p>Beim Senden von Aktualisierungen an eine Multicast-Gruppenadresse muss angegeben werden, über welche Netzwerkschnittstelle(n) gesendet werden soll. Ist die Loopback-Schnittstelle multicastfähig, wird mindestens diese ausgewählt.</p><p>Für die meisten Benutzer reicht die Loopback-Schnittstelle aus; damit können mehrere Anwendungen auf demselben Rechner mit WSJT-X zusammenarbeiten. Sollen Anwendungen auf anderen Rechnern Statusaktualisierungen empfangen, muss eine geeignete Netzwerkschnittstelle verwendet werden.</p><p>Auf einigen Linux-Systemen muss Multicast auf der Loopback-Schnittstelle aktiviert werden.</p></body></html> + + + + <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> + <html><head/><body><p>Legt die Anzahl der Router-Hops fest, die Multicast-Datagramme durchlaufen dürfen. Fast alle Benutzer sollten 1 einstellen, damit ausgehender Multicast-Verkehr im lokalen Subnetz bleibt.</p></body></html> + + + + Multicast TTL: + Multicast-TTL: + + + + Days since last upload + Tage seit letztem Upload + + + + Select the audio CODEC to use for receiving. + Audio-CODEC für den Empfang auswählen. + + + + &Input: + &Eingang: + + + + Select the channel to use for receiving. + Kanal für den Empfang auswählen. + + + + + Mono + Mono + + + + + Left + Links + + + + + Right + Rechts + + + + + Both + Beide + + + + Select the audio channel used for transmission. +Unless you have multiple radios connected on different +channels; then you will usually want to select mono or +both here. + Audio-Kanal für die Aussendung auswählen. +Wenn nicht mehrere Funkgeräte an unterschiedlichen Kanälen angeschlossen sind, +sollten Sie hier normalerweise Mono oder Beide wählen. + + + + Enable VHF and submode features + VHF- und Submodus-Funktionen aktivieren + + + + Data bits + Datenbits + + + + Stop bits + Stoppbits + + + + + Update Hamlib + Hamlib aktualisieren + + + + 32-bit + 32-Bit + + + + <html><head/><body><p>Revert the last Hamlib update. </p><p>Note: This function is only available on Windows.</p></body></html> + <html><head/><body><p>Letzte Hamlib-Aktualisierung zurücksetzen.</p><p>Hinweis: Diese Funktion ist nur unter Windows verfügbar.</p></body></html> + + + + Revert Update + Aktualisierung zurücksetzen + + + + <html><head/><body><p>Download the latest libhamlib-4.dll file from https://n0nb.users.sourceforge.net/. </p><p>Note: This function is only available on Windows.</p></body></html> + <html><head/><body><p>Neueste Datei libhamlib-4.dll von https://n0nb.users.sourceforge.net/ herunterladen.</p><p>Hinweis: Diese Funktion ist nur unter Windows verfügbar.</p></body></html> + + + + In use: + In Verwendung: + + + + Backed up: + Gesichert: + + + + 64-bit + 64-Bit + + + + Rig Data + Funkgerätedaten + + + + <html><head/><body><p>Stop transmitting immediately when SWR exceeds 2.5.</p></body></html> + <html><head/><body><p>Senden sofort beenden, wenn SWR 2,5 überschreitet.</p></body></html> + + + + Halt Tx when SWR > 2.5 + Tx beenden bei SWR > 2,5 + + + + <html><head/><body><p>Read and display transmit PWR and SWR of your rig.</p></body></html> + <html><head/><body><p>Sendeleistung PWR und SWR des Funkgeräts lesen und anzeigen.</p></body></html> + + + + Read and display PWR and SWR + PWR und SWR lesen und anzeigen + + + + Ou&tput: + A&usgang: + + + + <html><head/><body><p>Refresh audio device list.</p></body></html> + <html><head/><body><p>Liste der Audiogeräte aktualisieren.</p></body></html> + + + + Refresh + Aktualisieren + + + + <html><head/><body><p>Use TCI Audio when available.</p></body></html> + <html><head/><body><p>TCI-Audio verwenden, wenn verfügbar.</p></body></html> + + + + Use TCI Audio (restart required) + TCI-Audio verwenden (Neustart erforderlich) + + + + <html><head/><body><p>Rx audio level</p></body></html> + <html><head/><body><p>Rx-Audiopegel</p></body></html> + + + + Rx + Rx + + + + <html><head/><body><p>Sort audio device names alphabetically.</p></body></html> + <html><head/><body><p>Namen der Audiogeräte alphabetisch sortieren.</p></body></html> + + + + Sort alphabetically + Alphabetisch sortieren + + + + <html><head/><body><p>Hide the usually unusable ALSA CARD subdevices on Linux.</p></body></html> + <html><head/><body><p>Die unter Linux meist unbrauchbaren ALSA-CARD-Untergeräte ausblenden.</p></body></html> + + + + Hide ALSA CARD subdevices (Linux only) + ALSA-CARD-Untergeräte ausblenden (nur Linux) + + + + + Save Directory + Speicherverzeichnis + + + + Loc&ation: + Speicher&ort: + + + + Path to which .WAV files are saved. + Pfad, in dem .WAV-Dateien gespeichert werden. + + + + + TextLabel + TextLabel + + + + Click to select a different save directory for .WAV files. + Klicken, um ein anderes Speicherverzeichnis für .WAV-Dateien auszuwählen. + + + + S&elect + A&uswählen + + + + + AzEl Directory + AzEl-Verzeichnis + + + + Location: + Standort: + + + + Select + Auswählen + + + + <html><head/><body><p>Enables additional line in azel.dat for Dpol parameter.</p></body></html> + <html><head/><body><p>Aktiviert eine zusätzliche Zeile in azel.dat für den Parameter Dpol.</p></body></html> + + + + Enable extra line in azel.dat + Zusätzliche Zeile in azel.dat aktivieren + + + + Power Memory By Band + Leistungsspeicher nach Band + + + + Remember power settings by band + Leistungseinstellungen pro Band merken + + + + Enable power memory during transmit + Leistungsspeicher während des Sendens aktivieren + + + + Transmit + Senden + + + + Enable power memory during tuning + Leistungsspeicher beim Abstimmen aktivieren + + + + Tune + Abstimmen + + + + Tx &Macros + Tx-&Makros + + + + Canned free text messages setup + Vordefinierte Freitextnachrichten einrichten + + + + &Add + &Hinzufügen + + + + &Delete + &Löschen + + + + Drag and drop items to rearrange order +Right click for item specific actions +Click, SHIFT+Click and, CRTL+Click to select items + Einträge per Drag-and-drop neu anordnen +Rechtsklick für eintragsspezifische Aktionen +Klick, UMSCHALT+Klick und STRG+Klick zum Auswählen von Einträgen + + + + Reportin&g + Bericht&erstattung + + + + Reporting and logging settings + Einstellungen für Berichte und Logging + + + + Logging + Logging + + + + <html><head/><body><p>Check this option to note any Special Operating Activity in the comments field.</p></body></html> + <html><head/><body><p>Aktivieren, um besondere Betriebsaktivitäten im Kommentarfeld zu vermerken.</p></body></html> + + + + Special operating activity to comments + Besondere Betriebsaktivität in Kommentare + + + + The program will pop up a partially completed Log QSO dialog when you send a 73 or free text message. + Das Programm öffnet einen teilweise ausgefüllten Dialog „QSO loggen“, wenn Sie 73 oder eine Freitextnachricht senden. + + + + Promp&t me to log QSO + Zum Loggen des QSO &auffordern + + + + <html><head/><body><p>Log 'ZZ00' as grid if the other station doesn't send you a grid.</p></body></html> + <html><head/><body><p>„ZZ00“ als Locator loggen, wenn die Gegenstation keinen Locator sendet.</p></body></html> + + + + Fill missing grids with 'ZZ00' + Fehlende Locator mit „ZZ00“ füllen + + + + Op Call: + Op-Rufzeichen: + + + + Some logging programs will not accept the type of reports +saved by this program. +Check this option to save the sent and received reports in the +comments field. + Einige Logging-Programme akzeptieren die von diesem Programm +gespeicherten Rapporttypen nicht. +Aktivieren Sie diese Option, um gesendete und empfangene Rapporte +im Kommentarfeld zu speichern. + + + + d&B reports to comments + d&B-Rapporte in Kommentare + + + + <html><head/><body><p>Some logging programs will not accept WSJT-X mode names.</p></body></html> + <html><head/><body><p>Einige Logging-Programme akzeptieren die WSJT-X-Modusnamen nicht.</p></body></html> + + + + Con&vert mode to RTTY + Modus in RTTY &umwandeln + + + + <html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html> + <html><head/><body><p>Rufzeichen des Operators, falls es vom Stationsrufzeichen abweicht.</p></body></html> + + + + <html><head/><body><p>Check to have QSOs logged automatically, when complete.</p></body></html> + <html><head/><body><p>Aktivieren, damit abgeschlossene QSOs automatisch geloggt werden.</p></body></html> + + + + Network Services + Netzwerkdienste + + + + <html><head/><body><p>The program can send your station details and all decoded signals with grid squares as spots to the http://pskreporter.info web site.</p><p>This is used for reverse beacon analysis which is very useful for assessing propagation and system performance.</p></body></html> + <html><head/><body><p>Das Programm kann Ihre Stationsdaten und alle dekodierten Signale mit Locator als Spots an http://pskreporter.info senden.</p><p>Dies dient der Reverse-Beacon-Analyse und ist sehr nützlich zur Beurteilung von Ausbreitung und Systemleistung.</p></body></html> + + + + Enable &PSK Reporter Spotting + &PSK-Reporter-Spotting aktivieren + + + + <html><head/><body><p>Check this option if a reliable connection is needed</p><p>Most users do not need this, the default uses UDP which is more efficient. Only check this if you have evidence that UDP traffic from you to PSK Reporter is being lost.</p></body></html> + <html><head/><body><p>Aktivieren Sie diese Option, wenn eine zuverlässige Verbindung erforderlich ist.</p><p>Die meisten Benutzer benötigen dies nicht; standardmäßig wird UDP verwendet, was effizienter ist. Aktivieren Sie es nur, wenn Sie Hinweise darauf haben, dass UDP-Verkehr von Ihnen zu PSK Reporter verloren geht.</p></body></html> + + + + Use TCP/IP connection + TCP/IP-Verbindung verwenden + + + + UDP Server + UDP-Server + + + + UDP Server: + UDP-Server: + + + + <html><head/><body><p>Optional hostname of network service to receive decodes.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the broadcasting of UDP status updates.</p></body></html> + <html><head/><body><p>Optionaler Hostname des Netzwerkdienstes, der Dekodierungen empfangen soll.</p><p>Formate:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4-Adresse</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6-Adresse</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4-Multicast-Gruppenadresse</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6-Multicast-Gruppenadresse</li></ul><p>Das Leeren dieses Feldes deaktiviert das Senden von UDP-Statusaktualisierungen.</p></body></html> + + + + UDP Server port number: + UDP-Server-Portnummer: + + + + <html><head/><body><p>With this enabled WSJT-X will accept certain requests back from a UDP server that receives decode messages.</p></body></html> + <html><head/><body><p>Wenn aktiviert, akzeptiert WSJT-X bestimmte Rückanfragen von einem UDP-Server, der Dekodiernachrichten empfängt.</p></body></html> + + + + Accept UDP requests + UDP-Anfragen akzeptieren + + + + <html><head/><body><p>Indicate acceptance of an incoming UDP request. The effect of this option varies depending on the operating system and window manager, its intent is to notify the acceptance of an incoming UDP request even if this application is minimized or hidden.</p></body></html> + <html><head/><body><p>Die Annahme einer eingehenden UDP-Anfrage anzeigen. Die Wirkung hängt vom Betriebssystem und Fenstermanager ab; die Option soll über die angenommene UDP-Anfrage informieren, auch wenn diese Anwendung minimiert oder verborgen ist.</p></body></html> + + + + Notify on accepted UDP request + Bei angenommener UDP-Anfrage benachrichtigen + + + + <html><head/><body><p>Restore the window from minimized if an UDP request is accepted.</p></body></html> + <html><head/><body><p>Fenster aus minimiertem Zustand wiederherstellen, wenn eine UDP-Anfrage akzeptiert wird.</p></body></html> + + + + Accepted UDP request restores window + Angenommene UDP-Anfrage stellt Fenster wieder her + + + + Secondary UDP Server (deprecated) + Sekundärer UDP-Server (veraltet) + + + + <html><head/><body><p>When checked, WSJT-X will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html> + <html><head/><body><p>Wenn aktiviert, sendet WSJT-X eine geloggte Verbindung im ADIF-Format an den konfigurierten Hostnamen und Port.</p></body></html> + + + + Enable logged contact ADIF broadcast + ADIF-Broadcast geloggter Kontakte aktivieren + + + + Server name or IP address: + Servername oder IP-Adresse: + + + + <html><head/><body><p>Optional host name of N1MM Logger+ program to receive ADIF UDP broadcasts. This is usually 'localhost' or ip address 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable broadcasting of ADIF information via UDP.</p></body></html> + <html><head/><body><p>Optionaler Hostname des N1MM Logger+-Programms zum Empfang von ADIF-UDP-Broadcasts. Dies ist normalerweise „localhost“ oder die IP-Adresse 127.0.0.1.</p><p>Formate:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4-Adresse</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6-Adresse</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4-Multicast-Gruppenadresse</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6-Multicast-Gruppenadresse</li></ul><p>Das Leeren dieses Feldes deaktiviert das Senden von ADIF-Informationen über UDP.</p></body></html> + + + + Server port number: + Server-Portnummer: + + + + <html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html> + <html><head/><body><p>Portnummer eingeben, die WSJT-X für UDP-Broadcasts der ADIF-Logdaten verwenden soll. Für N1MM Logger+ sollte dieser Wert 2333 sein. Bei 0 werden keine Aktualisierungen gesendet.</p></body></html> + + + + Frequencies + Frequenzen + + + + Default frequencies and band specific station details setup + Standardfrequenzen und bandspezifische Stationsdaten einrichten + + + + <html><head/><body><p>See &quot;Frequency Calibration&quot; in the WSJT-X User Guide for details of how to determine these parameters for your radio.</p></body></html> + <html><head/><body><p>Details zur Bestimmung dieser Parameter für Ihr Funkgerät finden Sie im WSJT-X-Benutzerhandbuch unter „Frequenzkalibrierung“.</p></body></html> + + + + Frequency Calibration + Frequenzkalibrierung + + + + Slope: + Steigung: + + + + ppm + ppm + + + + Intercept: + Achsenabschnitt: + + + + Hz + Hz + + + + Working Frequencies + Arbeitsfrequenzen + + + + <html><head/><body><p>Right click to maintain the working frequencies list.</p></body></html> + <html><head/><body><p>Rechtsklick, um die Liste der Arbeitsfrequenzen zu verwalten.</p></body></html> + + + + Station Information + Stationsinformationen + + + + Items may be edited. +Right click for insert and delete options. + Einträge können bearbeitet werden. +Rechtsklick für Einfüge- und Löschoptionen. + + + + Colors + Farben + + + + Decode Highlightling + Dekodier-Hervorhebung + + + + Reset Highlighting to WSJT-X default + Hervorhebung auf WSJT-X-Standard zurücksetzen + + + + Reset Highlighting to WSJT-X Improved default + Hervorhebung auf verbesserten WSJT-X-Standard zurücksetzen + + + + <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> + <html><head/><body><p>Klicken, um die ADIF-Datei wsjtx_log.adi erneut nach Informationen über frühere QSOs zu durchsuchen.</p></body></html> + + + + Rescan ADIF Log + ADIF-Log erneut scannen + + + + <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> + <html><head/><body><p>Klicken, um alle oben aufgeführten Hervorhebungseinträge auf Standardwerte und -prioritäten zurückzusetzen.</p></body></html> + + + + <html><head/><body><p>Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.</p><p>Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.</p></body></html> + <html><head/><body><p>Mit den Kontrollkästchen aktivieren oder deaktivieren. Rechtsklick auf einen Eintrag, um Vordergrund- oder Hintergrundfarbe zu ändern bzw. aufzuheben oder den Eintrag auf Standardwerte zurückzusetzen. Einträge per Drag-and-drop verschieben, um ihre Priorität zu ändern; weiter oben bedeutet höhere Priorität.</p><p>Jede Vorder- oder Hintergrundfarbe kann gesetzt oder nicht gesetzt sein. Nicht gesetzt bedeutet, dass sie diesem Eintragstyp nicht zugeordnet ist und Einträge niedrigerer Priorität angewendet werden können.</p></body></html> + + + + <html><head/><body><p>Check to indicate new DXCC entities, grid squares, and callsigns per mode.</p></body></html> + <html><head/><body><p>Aktivieren, um neue DXCC-Gebiete, Locator und Rufzeichen pro Modus zu kennzeichnen.</p></body></html> + + + + Highlight by Mode + Nach Modus hervorheben + + + + Include extra WAE entities + Zusätzliche WAE-Gebiete einbeziehen + + + + Check to for grid highlighting to only apply to unworked grid fields + Aktivieren, damit Locator-Hervorhebung nur für noch nicht gearbeitete Locator-Felder gilt + + + + Only grid Fields sought + Nur gesuchte Locator-Felder + + + + <html><head/><body><p>Controls for Logbook of the World user lookup.</p></body></html> + <html><head/><body><p>Steuerung für die Benutzersuche in Logbook of the World.</p></body></html> + + + + Logbook of the World User Validation + Logbook-of-the-World-Benutzerprüfung + + + + Users CSV file URL: + URL der Benutzer-CSV-Datei: + + + + <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> + <html><head/><body><p>URL der ARRL-LoTW-Datei mit Datum und Uhrzeit des letzten Uploads der Benutzer. Sie wird verwendet, um Dekodierungen von Stationen hervorzuheben, die bekanntermaßen ihre Logs zu LoTW hochladen.</p></body></html> + + + + URL + URL + + + + <html><head/><body><p>Push this button to fetch the latest LotW user's upload date and time data file.</p></body></html> + <html><head/><body><p>Diese Schaltfläche drücken, um die aktuelle Datei mit den letzten Upload-Daten und -Zeiten der LoTW-Benutzer abzurufen.</p></body></html> + + + + Fetch Now + Jetzt abrufen + + + + Age of last upload less than: + Alter des letzten Uploads kleiner als: + + + + <html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html> + <html><head/><body><p>Mit diesem Zahlenfeld den Altersgrenzwert für den letzten Upload eines LoTW-Benutzers festlegen, der noch als aktueller LoTW-Benutzer gilt.</p></body></html> + + + + days + Tage + + + + Advanced + Erweitert + + + + <html><head/><body><p>User-selectable parameters for JT65 VHF/UHF/Microwave decoding.</p></body></html> + <html><head/><body><p>Vom Benutzer wählbare Parameter für JT65-Dekodierung auf VHF/UHF/Mikrowelle.</p></body></html> + + + + JT65 VHF/UHF/Microwave decoding parameters + JT65-Dekodierparameter VHF/UHF/Mikrowelle + + + + Random erasure patterns: + Zufällige Löschmuster: + + + + <html><head/><body><p>Maximum number of erasure patterns for stochastic soft-decision Reed Solomon decoder is 10^(n/2).</p></body></html> + <html><head/><body><p>Die maximale Anzahl von Löschmustern für den stochastischen Reed-Solomon-Soft-Decision-Decoder ist 10^(n/2).</p></body></html> + + + + Aggressive decoding level: + Aggressivitätsstufe der Dekodierung: + + + + <html><head/><body><p>Higher levels will increase the probability of decoding, but will also increase probability of a false decode.</p></body></html> + <html><head/><body><p>Höhere Stufen erhöhen die Wahrscheinlichkeit einer Dekodierung, aber auch die Wahrscheinlichkeit einer Falschdekodierung.</p></body></html> + + + + Two-pass decoding + Zweipass-Dekodierung + + + + <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> + <html><head/><body><p>FT8-DXpedition-Modus: Hound-Operator ruft DX.</p></body></html> + + + + + Hound + Hound + + + + <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> + <html><head/><body><p>Nordamerikanische VHF/UHF/Mikrowellen-Contests und andere Wettbewerbe, bei denen ein 4-stelliger Locator als Austausch erforderlich ist.</p></body></html> + + + + NA VHF Contest + NA-VHF-Contest + + + + <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> + <html><head/><body><p>FT8-DXpedition-Modus: Fox-Operator (DXpedition).</p></body></html> + + + + + Fox + Fox + + + + <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> + <html><head/><body><p>Europäische VHF+-Contests mit Signalrapport, laufender Nummer und 6-stelligem Locator als Austausch.</p></body></html> + + + + + EU VHF Contest + EU-VHF-Contest + + + + R T T Y Roundup + R T T Y Roundup + + + + RTTY Roundup exchange + RTTY-Roundup-Austausch + + + + NJ + NJ + + + + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> + <html><head/><body><p>ARRL-Field-Day-Austausch: Anzahl Sender, Klasse und ARRL/RAC-Sektion oder „DX“.</p></body></html> + + + + A R R L Field Day + A R R L Field Day + + + + ARRL Field Day + ARRL Field Day + + + + Field Day exchange + Field-Day-Austausch + + + + FD Exch: + FD-Austausch: + + + + 6A SNJ + 6A SNJ + + + + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> + <html><head/><body><p>Weltweiter Digitalmode-Contest</p><p><br/></p></body></html> + + + + WW Digital Contest + WW-Digital-Contest + + + + WW Digi Contest + WW-Digi-Contest + + + + Miscellaneous + Verschiedenes + + + + Degrade S/N of .wav file: + S/N der .wav-Datei verschlechtern: + + + + + For offline sensitivity tests + Für Offline-Empfindlichkeitstests + + + + + dB + dB + + + + Log automatically + Automatisch loggen + + + + <html><head/><body><p>Use 'Log automatically' only for special operating activities.</p></body></html> + <html><head/><body><p>„Automatisch loggen“ nur für besondere Betriebsaktivitäten verwenden.</p></body></html> + + + + Contesting only + Nur Contestbetrieb + + + + <html><head/><body><p>Shorten 6-digit grid entries and log 4-digit grids instead.</p></body></html> + <html><head/><body><p>6-stellige Locator kürzen und stattdessen 4-stellige Locator loggen.</p></body></html> + + + + Log 4-digit grids + 4-stellige Locator loggen + + + + Highlight also messages with 73 or RR73 + Auch Nachrichten mit 73 oder RR73 hervorheben + + + + + <html><head/><body><p>Highlight callsigns or grids with orange background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> + <html><head/><body><p>Rufzeichen oder Locator mit orangefarbenem Hintergrund hervorheben. Rufzeichen und/oder Locator müssen durch Kommas getrennt sein; nach jedem Rufzeichen muss ein Komma stehen.</p></body></html> + + + + Highlight orange: + Orange hervorheben: + + + + + <html><head/><body><p>Highlight callsigns or grids with blue background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> + <html><head/><body><p>Rufzeichen oder Locator mit blauem Hintergrund hervorheben. Rufzeichen und/oder Locator müssen durch Kommas getrennt sein; nach jedem Rufzeichen muss ein Komma stehen.</p></body></html> + + + + Highlight blue: + Blau hervorheben: + + + + http://lotw.arrl.org/lotw-user-activity.csv + http://lotw.arrl.org/lotw-user-activity.csv + + + + CTY File Download + CTY-Datei herunterladen + + + + CTY File Version: + CTY-Dateiversion: + + + + Download Latest CTY.dat + Neueste CTY.dat herunterladen + + + + CALL3 File Download + CALL3-Datei herunterladen + + + + CALL3 File Version: + CALL3-Dateiversion: + + + + Dowload latest CALL3.TXT file. + Neueste CALL3.TXT-Datei herunterladen. + + + + Download CALL3.TXT for terrestrial use + CALL3.TXT für terrestrischen Betrieb herunterladen + + + + Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. + Neueste CALL3.TXT-Datei für EME herunterladen. Diese Version ist für JT65 Deep Search geeignet. + + + + Download CALL3.TXT for EME + CALL3.TXT für EME herunterladen + + + + GUI tweaks for high-resolution monitors + GUI-Anpassungen für hochauflösende Monitore + + + + <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> + <html><head/><body><p>HighDPI-Skalierung ermöglicht eine größere und proportional korrektere Darstellung der Bedienelemente auf 4K-Monitoren, sofern vom Betriebssystem unterstützt.</p></body></html> + + + + HighDPI scaling (restart required) + HighDPI-Skalierung (Neustart erforderlich) + + + + <html><head/><body><p>Increased height of some control elements.</p></body></html> + <html><head/><body><p>Erhöhte Höhe einiger Bedienelemente.</p></body></html> + + + + Increased height of the tab widget (restart required) + Erhöhte Höhe des Register-Widgets (Neustart erforderlich) + + + + Enable Cloudlog Features + Cloudlog-Funktionen aktivieren + + + + API URL: + API-URL: + + + + API Key: + API-Schlüssel: + + + + Station ID: + Stations-ID: + + + + <html><head/><body><p>Test the Cloudlog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> + <html><head/><body><p>Cloudlog-API-Schlüssel testen.</p><p>Die Schaltfläche wird grün, wenn der API-Schlüssel Schreibzugriff besitzt. Bei Nur-Lesezugriff wird sie orange. Ist der API-Schlüssel ungültig, wird sie rot.</p></body></html> + + + + Test API Key + API-Schlüssel testen + + + + Special operating activity + Besondere Betriebsaktivität + + + + <html><head/><body><p>ARRL International Digital Contest</p></body></html> + <html><head/><body><p>ARRL International Digital Contest</p></body></html> + + + + ARRL Digi Contest + ARRL-Digi-Contest + + + + <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> + <html><head/><body><p>Das NCCC-Sprint-FT4-Kurznachrichtenprotokoll ein-/ausschalten.</p></body></html> + + + + NCCC Sprint + NCCC Sprint + + + + + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> + <html><head/><body><p>FT Roundup und ähnliche Contests. Austausch ist US-Bundesstaat, kanadische Provinz oder „DX“.</p></body></html> + + + + FT Roundup messages + FT-Roundup-Nachrichten + + + + FT RU Exch: + FT-RU-Austausch: + + + + <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> + <html><head/><body><p>Aktivieren, um die SuperFox-Wellenform zu senden (Fox) oder zu empfangen (Hound).</p></body></html> + + + + SuperFox mode + SuperFox-Modus + + + + <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> + <html><head/><body><p>OTP-Nachrichten im Bandaktivitätsfenster anzeigen.</p></body></html> + + + + Show OTP messages + OTP-Nachrichten anzeigen + + + + OTP URL: + OTP-URL: + + + + <html><head/><body><p>URL used to verify OTP codes.</p></body></html> + <html><head/><body><p>URL zur Überprüfung von OTP-Codes.</p></body></html> + + + + https://www.9dx.cc + https://www.9dx.cc + + + + NA VHF + NA VHF + + + + <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> + <html><head/><body><p>Klicken, um die OTP-Methode der Fox-Verifizierung zu aktivieren. Internetverbindung erforderlich.</p></body></html> + + + + OTP + OTP + + + + Key: + Schlüssel: + + + + <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> + <html><head/><body><p>Schlüssel des Fox zur Erzeugung von OTP-Codes.</p></body></html> + + + + M2ZUU5CW6EVOY2HU + M2ZUU5CW6EVOY2HU + + + + Interval + Intervall + + + + <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> + <html><head/><body><p>Intervall, in dem OTP-Nachrichten gesendet werden. 1 wählen, um jede Nachricht zu signieren.</p></body></html> + + + + <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> + + <html><head/><body><p>CQ mit einem individuellen Contestnamen statt TEST, RU oder WW rufen, zum Beispiel CQ PACC.</p></body></html> + + + + CQ with individual contest name + CQ mit individuellem Contestnamen + + + + Contest name: + Contestname: + + + + <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> + <html><head/><body><p>4-stelligen Locator statt Signalrapport austauschen. Bietet q3-Empfindlichkeit für den DX-Operator. Besonders nützlich für 6-m-EME-DXpeditionen.</p></body></html> + + + + Q65 Pileup + Q65-Pileup + + + + Receiver bandwidth: + Empfängerbandbreite: + + + + Hz + Hz + + + + Tx delay: + Tx-Verzögerung: + + + + Minimum delay between assertion of PTT and start of Tx audio. + Mindestverzögerung zwischen Aktivierung von PTT und Beginn des Tx-Audios. + + + + s + s + + + + + Tone spacing + Tonabstand + + + + <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> + <html><head/><body><p>Tx-Audio mit doppeltem normalen Tonabstand erzeugen. Für spezielle LF/MF-Sender vorgesehen, die vor der HF-Erzeugung durch 2 teilen.</p></body></html> + + + + x 2 + x 2 + + + + <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> + <html><head/><body><p>Tx-Audio mit vierfachem normalen Tonabstand erzeugen. Für spezielle LF/MF-Sender vorgesehen, die vor der HF-Erzeugung durch 4 teilen.</p></body></html> + + + + x 4 + x 4 + + + + + Waterfall spectra + Wasserfall-Spektren + + + + Low sidelobes + Niedrige Nebenkeulen + + + + Most sensitive + Höchste Empfindlichkeit + + + + Alerts + Alarme + + + + Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. + Für Alarmkategorien oberhalb der Linie muss auf der Registerkarte Allgemein das Feld „DXCC-, Locator- und Bereits-gearbeitet-Status anzeigen“ aktiviert sein. + + + + THIS FEATURE IS FOR EXPERIENCED USERS ONLY + DIESE FUNKTION IST NUR FÜR ERFAHRENE BENUTZER + + + + Ensure that you have made meaningful settings on the Colors tab, so that you see which message triggered the alert. + Stellen Sie auf der Registerkarte Farben sinnvolle Einstellungen ein, damit erkennbar ist, welche Nachricht den Alarm ausgelöst hat. + + + + Ensure that your rig is NOT connected via "Default Device". + Stellen Sie sicher, dass Ihr Funkgerät NICHT über „Standardgerät“ verbunden ist. + + + + Audio Alerts + Audioalarme + + + + + New ITU Zone on Band + Neue ITU-Zone auf Band + + + + + New Continent + Neuer Kontinent + + + + + DX Call or DX Grid in message + DX-Rufzeichen oder DX-Locator in Nachricht + + + + + New Grid + Neuer Locator + + + + + New Continent on Band + Neuer Kontinent auf Band + + + + Message received + Nachricht empfangen + + + + + New ITU Zone + Neue ITU-Zone + + + + + New CQ Zone + Neue CQ-Zone + + + + + New DXCC on Band + Neues DXCC auf Band + + + + My Call in message + Mein Rufzeichen in Nachricht + + + + My Call + Mein Rufzeichen + + + + + New CQ Zone on Band + Neue CQ-Zone auf Band + + + + + New DXCC + Neues DXCC + + + + + New Grid on Band + Neuer Locator auf Band + + + + + CQ in message + CQ in Nachricht + + + + Toggle Audio Alerts on/off. Alerts will be played on "DefaultAudioDevice". DON'T ENABLE AUDIO ALERTS WHEN YOUR RIG IS CONNECTED VIA THIS SOUNDCARD !!! + Audioalarme ein-/ausschalten. Alarme werden über „DefaultAudioDevice“ abgespielt. AUDIOALARME NICHT AKTIVIEREN, WENN IHR FUNKGERÄT ÜBER DIESE SOUNDCARD ANGESCHLOSSEN IST!!! + + + + Enable Audio Alerts + Audioalarme aktivieren + + + + This requirement is fulfilled when your rig is connected via USB audio. + Diese Voraussetzung ist erfüllt, wenn Ihr Funkgerät über USB-Audio verbunden ist. + + + + Audio Alerts will be played on the default audio device (usually the loudspeaker of your PC). + Audioalarme werden über das Standard-Audiogerät abgespielt, normalerweise den Lautsprecher Ihres PCs. + + + + IMPORTANT NOTES + WICHTIGE HINWEISE + + + + Use of this feature requires that your computer is equipped with two sound cards. + Für diese Funktion muss Ihr Computer mit zwei Soundkarten ausgestattet sein. + + + + Filters + Filter + + + + Territories 1-4 for the Hide checkboxes in the View menu + Gebiete 1-4 für die Ausblenden-Kontrollkästchen im Ansicht-Menü + + + + Blacklist + Schwarze Liste + + + + Filters for the Band Activity window + Filter für das Bandaktivitätsfenster + + + + Hide messages containing the following callsigns or keywords: + Nachrichten mit folgenden Rufzeichen oder Schlüsselwörtern ausblenden: + + + + Show only messages containing the following callsigns or keywords: + Nur Nachrichten mit folgenden Rufzeichen oder Schlüsselwörtern anzeigen: + + + + <html><head/><body><p>Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed).</p></body></html> + <html><head/><body><p>Filter nur für Wait and Pounce, CQ: First usw. verwenden; alle Nachrichten werden weiterhin angezeigt.</p></body></html> + + + + Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed) + Filter nur für Wait and Pounce, CQ: First usw. verwenden (alle Nachrichten werden weiterhin angezeigt) + + + + Always pass messages with the following keywords: + Nachrichten mit folgenden Schlüsselwörtern immer durchlassen: + + + + Whitelist + Weiße Liste + + + + <html><head/><body><p>Apply filters only to the callsigns of the calling stations. Usually the second word of the messages is analyzed, for directional calls the third word.</p></body></html> + <html><head/><body><p>Filter nur auf die Rufzeichen der anrufenden Stationen anwenden. Normalerweise wird das zweite Wort der Nachrichten ausgewertet, bei gerichteten Anrufen das dritte.</p></body></html> + + + + Apply filters only to the callsigns of the calling stations + Filter nur auf Rufzeichen der anrufenden Stationen anwenden + + + + Always Pass + Immer durchlassen + + + + <html><head/><body><p>Use “worked today and yesterday” instead of “worked today” for the 3 related Quick Filters.</p></body></html> + <html><head/><body><p>Für die 3 zugehörigen Schnellfilter „heute und gestern gearbeitet“ statt „heute gearbeitet“ verwenden.</p></body></html> + + + + Quick Filters: Hide/Ignore/Highlight "worked today and yesterday" instead of "worked today" (UTC) + Schnellfilter: Ausblenden/Ignorieren/Hervorheben „heute und gestern gearbeitet“ statt „heute gearbeitet“ (UTC) + + + + <html><head/><body><p>Discard (Cancel) or apply (OK) configuration changes including</p><p>resetting the radio interface and applying any soundcard changes</p></body></html> + <html><head/><body><p>Konfigurationsänderungen verwerfen (Abbrechen) oder anwenden (OK), einschließlich</p><p>Zurücksetzen der Funkgeräteschnittstelle und Anwenden von Soundkartenänderungen.</p></body></html> + + + Upload QSOs to Cloudlog or Wavelog + QSOs zu Cloudlog oder Wavelog hochladen + + + <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> + <html><head/><body><p>Protokollierte QSOs zu Cloudlog oder Wavelog hochladen.</p></body></html> + + + <html><head/><body><p>API URL for Cloudlog or Wavelog.</p></body></html> + <html><head/><body><p>API-URL für Cloudlog oder Wavelog.</p></body></html> + + + <html><head/><body><p>Your API key.</p></body></html> + <html><head/><body><p>Ihr API-Schlüssel.</p></body></html> + + + <html><head/><body><p>Your Station ID.</p></body></html> + <html><head/><body><p>Ihre Stations-ID.</p></body></html> + + + <html><head/><body><p>Test the Cloudlog or Wavelog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> + <html><head/><body><p>Den API-Schlüssel für Cloudlog oder Wavelog testen.</p><p>Die Schaltfläche wird grün, wenn der API-Schlüssel Schreibzugriff erlaubt. Sie wird orange, wenn der API-Schlüssel nur Lesezugriff erlaubt. Ist der API-Schlüssel ungültig, wird sie rot.</p></body></html> + + + Upload QSOs to eQSL.cc + QSOs zu eQSL.cc hochladen + + + <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> + <html><head/><body><p>Protokollierte QSOs zu eQSL.cc hochladen.</p></body></html> + + + Username: + Benutzername: + + + Password: + Passwort: + + + <html><head/><body><p>Your username.</p></body></html> + <html><head/><body><p>Ihr Benutzername.</p></body></html> + + + <html><head/><body><p>Your logon password.</p></body></html> + <html><head/><body><p>Ihr Anmeldepasswort.</p></body></html> + + + Voices: + Stimmen: + + + IMPORTANT + WICHTIG + + + NOTES + HINWEISE + + + not available + nicht verfügbar + + + Wanted callsigns, grids, prefixes and directional calls + Gesuchte Rufzeichen, Locator, Präfixe und gerichtete Anrufe + + + "Wanted callsigns, grids, prefixes and directional calls" uses the entries from "Highlight orange" and "Highlight blue". + „Gesuchte Rufzeichen, Locator, Präfixe und gerichtete Anrufe“ verwendet die Einträge aus „Orange hervorheben“ und „Blau hervorheben“. + + + <html><head/><body><p>Wanted callsigns, grids, prefixes and directional calls. This alert category uses the entries from &quot;Highlight orange&quot; and &quot;Highlight blue&quot;.</p></body></html> + <html><head/><body><p>Gesuchte Rufzeichen, Locator, Präfixe und gerichtete Anrufe. Diese Alarmkategorie verwendet die Einträge aus „Orange hervorheben“ und „Blau hervorheben“.</p></body></html> + + + + main + + + Failed to create a temporary directory + Temporäres Verzeichnis konnte nicht erstellt werden + + + + + Path: "%1" + Pfad: "%1" + + + + Failed to create a usable temporary directory + Es konnte kein verwendbares temporäres Verzeichnis erstellt werden + + + + Another application may be locking the directory + Möglicherweise sperrt eine andere Anwendung das Verzeichnis + + + + Failed to create data directory + Datenverzeichnis konnte nicht erstellt werden + + + + path: "%1" + Pfad: "%1" + + + + Shared memory error + Fehler im gemeinsamen Speicher + + + + Unable to create shared memory segment + Segment im gemeinsamen Speicher konnte nicht erstellt werden + + + + Sub-process error + Unterprozessfehler + + + + Failed to close orphaned jt9 process + Verwaister jt9-Prozess konnte nicht beendet werden + + + + wf_palette_design_dialog + + + Palette Designer + Paletten-Designer + + + + <html><head/><body><p>Double click a color to edit it.</p><p>Right click to insert or delete colors.</p><p>Colors at the top represent weak signals</p><p>and colors at the bottom represent strong</p><p>signals. You can have up to 256 colors.</p></body></html> + <html><head/><body><p>Doppelklick auf eine Farbe, um sie zu bearbeiten.</p><p>Rechtsklick, um Farben einzufügen oder zu löschen.</p><p>Farben oben stehen für schwache Signale,</p><p>Farben unten für starke Signale.</p><p>Es können bis zu 256 Farben verwendet werden.</p></body></html> + + + diff --git a/translations/wsjtx_en.ts b/translations/wsjtx_en.ts index 1c2c9b0a..b2ac33ff 100644 --- a/translations/wsjtx_en.ts +++ b/translations/wsjtx_en.ts @@ -115,18 +115,17 @@ - - + Wanted only - + Message - + My call only @@ -134,149 +133,154 @@ Astro - - + + Doppler tracking - + <html><head/><body><p>One station does all Doppler shift correction, their QSO partner receives and transmits on the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> - + Full Doppler to DX Grid - + <html><head/><body><p>Transmit takes place on sked frequency and receive frequency is corrected for own echoes. </p><p>This mode can be used for calling CQ, or when using Echo mode.</p></body></html> - + Own Echo - + <html><head/><body><p>Both stations correct for Doppler shift such that they would be heard on the moon at the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p><p>Use this option also for Echo mode.</p></body></html> - + Constant frequency on Moon - + <html><head/><body><p>DX station announces their TX Freq, which is entered as the Sked Freq. Correction applied to RX and TX so you appear on the DX's station's own echo Freq.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> - + On DX Echo - + <html><head/><body><p>Tune radio manually and select this mode to put your echo on the same frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> - + Call DX - + <html><head/><body><p>No Doppler shift correction is applied. This may be used when the QSO partner does full Doppler correction to your grid square.</p></body></html> - + None - + Sked frequency - - + + 0 - - Rx: + + kHz - - Tx: + + Set kHz - - <html><head/><body><p>Press and hold the CTRL key to adjust the sked frequency manually with the rig's VFO dial or enter frequency directly into the band entry field on the main window.</p></body></html> + + <html><head/><body><p>Tx shift relative to Rx sked frequency</p></body></html> - - Echo Mode + + MHz - - Hz + + Tx Shift - - RIT + + Rx: - - Dither + + Tx: - - Tx Shift relative to Rx Sked Freq + + Echo Mode - - Enter large offset + + Hz - - MHz + + RIT - - Shift + + Enable - - Enable + + Dither - + + Ctl-Lock Sked Freq + + + + Astro Data - + Astronomical Data @@ -396,6 +400,166 @@ + + Cloudlog + + + + QSO could not be sent to Cloudlog. + + + + + + QSO upload was rejected by Cloudlog. + + + + + HTTP status %1. Response was not JSON. + + + + + Cloudlog returned an unexpected upload response. + + + + + Cloudlog reported upload status: %1 + + + + + HTTP status %1. + + + + + Cloudlog::impl + + + Enter a Cloudlog or Wavelog URL. + + + + + The connection check needs a base URL before it can contact the API. + + + + + Cloudlog or Wavelog authentication endpoint was not found. + + + + + Tried /api/check_auth, /index.php/api/check_auth, and /index.php/api/auth. + + + + + API key is valid but read-only. + + + + + Generate a read/write API key before enabling QSO uploads. + + + + + API key is invalid. + + + + + Authentication response was not usable. + + + + + Station profile response was not JSON. + + + + + Configured station profile was not found. + + + + + No station profiles were returned by the server. + + + + + Available station profiles: %1 + + + + + Wavelog dry-run QSO endpoint was not found. + + + + + Tried /api/qso/true and /index.php/api/qso/true after Wavelog was identified. + + + + + Dry-run upload response was not usable. + + + + + + Connection check passed. + + + + + Writable API key, station profile, and dry-run QSO upload were validated. + + + + + Dry-run QSO upload was rejected. + + + + + + The QSO dry-run upload was rejected. + + + + + Dry-run QSO upload returned an unexpected response. + + + + + Writable API key and station profile were validated. No safe dry-run QSO endpoint was identified, so no test QSO was uploaded. + + + + + Network error while checking Cloudlog or Wavelog. + + + + + Cloudlog Error! + + + + + Reason: %1 + + + ColorHighlighting @@ -502,415 +666,634 @@ Configuration::impl - - - + + + &Delete - - + + &Insert ... - - Failed to create save directory + + Wanted territory %1 - - path: "%1% + + Blacklist keyword %1 - - Failed to create samples directory + + Whitelist keyword %1 - - path: "%1" + + Always pass keyword %1 - - API key OK + + CAT control port - - API key read-only + + CAT baud rate - - API key invalid + + Default CAT data bits - - &Load ... + + Seven CAT data bits - - &Save as ... + + Eight CAT data bits - - &Merge ... + + Default CAT stop bits - - &Reset + + One CAT stop bit - - Serial Port: + + Two CAT stop bits - - Serial port used for CAT control + + Default CAT handshake - - TCI Server: + + No CAT handshake - - Optional hostname and port of TCI service. -Leave blank for a sensible default on this machine. -Formats: - hostname:port - IPv4-address:port - [IPv6-address]:port + + XON/XOFF CAT handshake - - Network Server: + + Hardware CAT handshake - - Optional hostname and port of network service. -Leave blank for a sensible default on this machine. -Formats: - hostname:port - IPv4-address:port - [IPv6-address]:port + + Force DTR control line - - USB Device: + + Force RTS control line - - Optional device identification. -Leave blank for a sensible default for the rig. -Format: - [VID[:PID[:VENDOR[:PRODUCT]]]] + + VOX PTT method - - - Invalid audio input device + + DTR PTT method - - Invalid audio output device + + CAT PTT method - - Invalid PTT method + + RTS PTT method - - Invalid PTT port + + PTT control port - - - Invalid Contest Exchange + + Rear or data transmit audio source - - You must input a valid ARRL Field Day exchange + + Front or mic transmit audio source - - You must input a valid ARRL RTTY Roundup exchange + + No radio mode control - - Pending DNS lookup, please try again later + + USB radio mode - - - Reset Decode Highlighting + + Data or packet radio mode - - - Reset all decode highlighting and priorities to default values + + No split operation - - Error Loading CTY.DAT + + Rig split operation - - Error Loading CALL3.TXT file + + Fake It split operation - - WSJT-X Decoded Text Font Chooser + + CAT poll interval - - - Hamlib update only available on Windows. + + Frequency calibration slope - - Error Loading libhamlib-4.dll + + Frequency calibration intercept - - Hamlib Update successful - -New Hamlib will be used after restart + + Working frequencies table - - Hamlib successfully reverted - -Reverted Hamlib will be used after restart + + Station information table - - No Hamlib update found that could be reverted + + Decode highlighting rules - - Error in network address + + Highlighting rules and priorities for decoded messages. - - UDP server DNS lookup failed + + Decode highlighting actions - - MAC-ambiguous multicast groups addresses not supported + + Change or reset colors for the selected highlighting rule. - - Load Working Frequencies + + Move selected highlighting rule up - - - - Frequency files (*.qrg *.qrg.json);;All files (*.*) + + Move the selected highlighting rule earlier in priority order. - - Replace Working Frequencies + + Move selected highlighting rule down - - Are you sure you want to discard your current working frequencies and replace them with the loaded ones? + + Move the selected highlighting rule later in priority order. - - Merge Working Frequencies + + Orange highlight callsigns and grids - - Error reading frequency file + + Blue highlight callsigns and grids - - - - Not a valid frequencies file + + Failed to create save directory - - Incorrect file magic + + path: "%1% - - Version is too new + + Failed to create samples directory - - Contents corrupt + + path: "%1" - - Save Working Frequencies + + Reset all decode highlighting and priorities to Default 1 values - - Only Save Selected Working Frequencies + + Reset all decode highlighting and priorities to Default 2 values - - Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. + + &Load ... - - Reset Working Frequencies + + &Save as ... - - Are you sure you want to discard your current working frequencies and replace them with default ones? + + &Merge ... - - Save Directory + + &Reset - - AzEl Directory + + Serial Port: - - Rig control error + + Serial port used for CAT control - - Failed to open connection to rig + + TCI Server: - - Rig failure + + Optional hostname and port of TCI service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port - - Not found - audio device missing + + Network Server: - - - DXLabSuiteCommanderTransceiver - - Failed to connect to DX Lab Suite Commander - + + Optional hostname and port of network service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port - - DX Lab Suite Commander didn't respond correctly reading frequency: + + USB Device: - - DX Lab Suite Commander sent an unrecognised TX state: + + Optional device identification. +Leave blank for a sensible default for the rig. +Format: + [VID[:PID[:VENDOR[:PRODUCT]]]] - - DX Lab Suite Commander didn't respond correctly polling TX status: + + + Invalid audio input device - - Transceiver did not respond to PTT On/Off quickly enough; -reduce DX Lab Suite Commander's 'Command Interval' setting -or contact DXLab support at DXLab@groups.io. + + Invalid audio output device - - DX Lab Suite Commander didn't respond correctly polling frequency: + + Invalid PTT method - - DX Lab Suite Commander didn't respond correctly polling TX frequency: + + Invalid PTT port - - DX Lab Suite Commander sent an unrecognised split state: + + + Invalid Contest Exchange - - DX Lab Suite Commander didn't respond correctly polling split status: + + You must input a valid ARRL Field Day exchange - - DX Lab Suite Commander sent an unrecognised mode: " + + You must input a valid ARRL RTTY Roundup exchange - - DX Lab Suite Commander didn't respond correctly polling mode: + + Pending DNS lookup, please try again later - - DX Lab Suite Commander send command failed - + + + Reset Decode Highlighting + + + + + Error Loading CTY.DAT + + + + + Error Loading CALL3.TXT file + + + + + WSJT-X Decoded Text Font Chooser + + + + + + Hamlib update only available on Windows. + + + + + Error Loading libhamlib-4.dll + + + + + Hamlib Update successful + +New Hamlib will be used after restart + + + + + Hamlib successfully reverted + +Reverted Hamlib will be used after restart + + + + + No Hamlib update found that could be reverted + + + + + Error in network address + + + + + UDP server DNS lookup failed + + + + + MAC-ambiguous multicast groups addresses not supported + + + + + Load Working Frequencies + + + + + + + Frequency files (*.qrg *.qrg.json);;All files (*.*) + + + + + Replace Working Frequencies + + + + + Are you sure you want to discard your current working frequencies and replace them with the loaded ones? + + + + + Merge Working Frequencies + + + + + Error reading frequency file + + + + + + + Not a valid frequencies file + + + + + Incorrect file magic + + + + + Version is too new + + + + + Contents corrupt + + + + + Save Working Frequencies + + + + + Only Save Selected Working Frequencies + + + + + Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. + + + + + Reset Working Frequencies + + + + + Are you sure you want to discard your current working frequencies and replace them with default ones? + + + + + Save Directory + + + + + AzEl Directory + + + + + Rig control error + + + + + Failed to open connection to rig + + + + + Rig failure + + + + + Not found + audio device missing + + + + + DXLabSuiteCommanderTransceiver + + + Failed to connect to DX Lab Suite Commander + + + + + + DX Lab Suite Commander didn't respond correctly reading frequency: + + + + + DX Lab Suite Commander sent an unrecognised TX state: + + + + + DX Lab Suite Commander didn't respond correctly polling TX status: + + + + + Transceiver did not respond to PTT On/Off quickly enough; +reduce DX Lab Suite Commander's 'Command Interval' setting +or contact DXLab support at DXLab@groups.io. + + + + + DX Lab Suite Commander didn't respond correctly polling frequency: + + + + + DX Lab Suite Commander didn't respond correctly polling TX frequency: + + + + + DX Lab Suite Commander sent an unrecognised split state: + + + + + DX Lab Suite Commander didn't respond correctly polling split status: + + + + + DX Lab Suite Commander sent an unrecognised mode: " + + + + + DX Lab Suite Commander didn't respond correctly polling mode: + + + + + DX Lab Suite Commander send command failed + @@ -944,32 +1327,32 @@ or contact DXLab support at DXLab@groups.io. - + Choose %1 Foreground Color - + &Unset foreground color - + &Background color ... - + Choose %1 Background Color - + U&nset background color - + &Reset this item to defaults @@ -1057,17 +1440,17 @@ or contact DXLab support at DXLab@groups.io. - + f/g unset - + b/g unset - + Highlight Type @@ -1075,41 +1458,56 @@ or contact DXLab support at DXLab@groups.io. Designer - + &Delete - + &Insert ... - + Insert &after ... - + Import Palette - - + + Palettes (*.pal) + Import Palette Failed + + + + Export Palette + + + Export Palette Failed + + + + + Error writing waterfall palette file "%1": %2. + + Dialog - + Gray time: @@ -1210,16 +1608,31 @@ Error: %2 - %3 DisplayText - + &Erase + + + Return to live activity + + + + + Return to the live activity position + + + + + Live activity is paused while earlier entries are visible. + + EchoGraph - + Echo Graph @@ -1292,7 +1705,7 @@ Error: %2 - %3 EmulateSplitTransceiver - + Emulated split mode requires rig to be in simplex mode @@ -1379,12 +1792,12 @@ Error: %2 - %3 ExistingNameDialog - + Configuration to Clone From - + &Source Configuration Name: @@ -1522,7 +1935,7 @@ Error: %2 - %3 FastGraph - + Fast Graph @@ -1574,84 +1987,235 @@ Error: %2 - %3 - FoxLog::impl + FixtureAudioInput - - Date & Time(UTC) + + Synthetic audio input has no detector sink. - - Call + + Synthetic FT8 audio input requires a downsample factor of 1 or 4. - - Grid + + Synthetic JTTY audio input requires a downsample factor of 1 or 4. - - Sent + + Synthetic audio input requires the mono input channel. - - Rcvd + + Unable to open synthetic audio fixture %1: %2 - - Band + + Synthetic audio fixture must be mono, signed 16-bit little-endian PCM. - - - FoxLogWindow - - Fox Log + + Synthetic audio fixture must be %1 Hz for downsample factor %2; found %3 Hz. - - <html><head/><body><p>Right-click here for available actions.</p></body></html> + + Synthetic FT8 audio fixture must contain exactly %1 frames; found %2. - - Callers: + + Synthetic JTTY audio fixture must contain complete PCM frames. - - - - N + + Unable to read all PCM data from synthetic audio fixture. - - In progress: + + Synthetic audio input does not yet support big-endian hosts. - - Rate: + + Unable to initialize the detector for synthetic audio input. - - <html><head/><body><p>Last 10: Average rate (QSOs/hour) for the last 10 QSOs.<br/>Last 100: Average rate (QSOs/hour) for the last 100 QSOs. <br/>Last 60m: Average rate (QSOs/hour) for the last 60 minutes.</span></p></body></html> + + Synthetic audio fixture ready - - &Export ADIF ... + + Synthetic audio input suspended - + + Synthetic audio input receiving + + + + + Detector accepted %1 of %2 synthetic PCM bytes. + + + + + Synthetic audio fixture exhausted + + + + + FixtureSoundOutput + + + Synthetic audio output requires a readable source. + + + + + Synthetic audio output requires a capture path. + + + + + Synthetic audio output does not yet support big-endian hosts. + + + + + Synthetic audio output received an unsupported source frame size. + + + + + Unable to open synthetic audio output capture %1: %2 + + + + + Synthetic audio output received a partial captured frame. + + + + + Synthetic FT8 audio output exceeded its 15-second capture period. + + + + + Synthetic audio output wrote %1 of %2 capture bytes: %3 + + + + + Synthetic audio output source disappeared during capture. + + + + + Synthetic FT8 audio output continued beyond its 15-second capture period. + + + + + Synthetic audio output received %1 of %2 source bytes. + + + + + Synthetic audio output received an invalid source byte count. + + + + + FoxLog::impl + + + Date & Time(UTC) + + + + + Call + + + + + Grid + + + + + Sent + + + + + Rcvd + + + + + Band + + + + + FoxLogWindow + + + Fox Log + + + + + <html><head/><body><p>Right-click here for available actions.</p></body></html> + + + + + Callers: + + + + + + + N + + + + + In progress: + + + + + Rate: + + + + + <html><head/><body><p>Last 10: Average rate (QSOs/hour) for the last 10 QSOs.<br/>Last 100: Average rate (QSOs/hour) for the last 100 QSOs. <br/>Last 60m: Average rate (QSOs/hour) for the last 60 minutes.</span></p></body></html> + + + + + &Export ADIF ... + + + + Export ADIF Log File @@ -1686,104 +2250,136 @@ Error: %2 - %3 + + FrequencyDeltaLineEdit + + + Offset in MHz + + + + + Frequency offset in MHz + + + + + Enter a frequency offset in MHz. + + + FrequencyDialog - + Add Frequency - + IARU &Region: - + &Mode: - + &Frequency (MHz): - + &Preferred for Band/Mode: - + &Description: - + &Enable Date Range: - + S&tart: - + &End: - + &Source: - + Invalid Date Range - + Start date must be before end date + + FrequencyLineEdit + + + + Frequency in MHz + + + + + Enter a positive frequency in MHz. + + + FrequencyList_v2_101 - + IARU Region - + Mode - + Frequency - + Frequency (MHz) - + Description - + Source @@ -1799,126 +2395,234 @@ Error: %2 - %3 - + Pref - + Start Date/Time - + End Date/Time - + Failed to parse JSON file - + Information Missing - + No Frequencies were found - + Loaded Frequencies from %1 - + Entries Valid/Skipped %1 + + Ft8TxLoopbackTestController + + + Timed out after 60 seconds. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + The FT8 output stream did not start exactly once. + + + + + The FT8 Auto control was not found. + + + + + Disabling Auto stopped the active FT8 transmission. + + + + + Synthetic output reported non-silent FT8 audio more than once. + + + + + The FT8 capture did not stop exactly once at the requested path. + + + + + Synthetic audio output failed: %1 + + + + + A required FT8 transmit GUI control was not found. + + + + + The application did not enter FT8 mode. + + + + + Unable to configure the requested FT8 transmission. + + + + + The FT8 transmit controls disappeared before transmission. + + + + + Unable to start the synthetic FT8 transmission. + + + + + The FT8 Auto control disappeared before retry. + + + + + The FT8 output lifecycle was not one start, non-silent transmission, and natural stop. + + + + + FT8 audio began at frame %1; expected %2 +/- %3 frames. + + + + + The FT8 capture file was not created or is empty: %1 + + + + + Unable to reopen FT8 capture %1: %2 + + + + + The FT8 capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The FT8 capture must contain exactly %1 frames; file=%2 reported=%3. + + + + + Unexpected modal window: %1 + + + HRDTransceiver - - + + Failed to connect to Ham Radio Deluxe - + Failed to open file "%1": %2. - - + + Ham Radio Deluxe: no rig found - + Ham Radio Deluxe: rig doesn't support mode - + Ham Radio Deluxe: sent an unrecognised mode - + Ham Radio Deluxe: item not found in %1 dropdown list - + Ham Radio Deluxe: button not available - + Ham Radio Deluxe didn't respond as expected - + Ham Radio Deluxe: rig has disappeared or changed - + Ham Radio Deluxe send command "%1" failed %2 - - + + Ham Radio Deluxe: failed to write command "%1" - - Ham Radio Deluxe sent an invalid reply to our command "%1" + + Ham Radio Deluxe sent an invalid reply to our command "%1": %2 - + Ham Radio Deluxe failed to reply to command "%1" %2 - + Ham Radio Deluxe retries exhausted sending command "%1" - + Ham Radio Deluxe didn't respond to command "%1" as expected @@ -1926,186 +2630,182 @@ Error: %2 - %3 HamlibTransceiver - - + + Hamlib initialisation error - + Hamlib settings file error: %1 at character offset %2 - + Hamlib settings file error: top level must be a JSON object - + Hamlib settings file error: config must be a JSON object - + Unsupported CAT type - + Hamlib error: %1 while %2 - + opening connection to rig - + getting current frequency - + getting current mode - - + + exchanging VFOs - - + + getting other VFO frequency - + getting other VFO mode - - + + setting current VFO - + getting frequency - + getting mode - - - + + + getting current VFO - - - - + + + + getting current VFO frequency - - - - - - + + + + + + setting frequency - - - - + + + + getting current VFO mode - - - - - + + + + + setting current VFO mode - - setting VFOB mode - - - - - + + setting/unsetting split mode - - + + setting split mode - + setting split TX frequency and mode - + setting split TX frequency - + getting split TX VFO mode - + setting split TX VFO mode - + getting PTT state - + setting PTT on - - + + setting PTT off - + setting a configuration item - + + getting a configuration item @@ -2140,3625 +2840,4506 @@ Error: %2 - %3 - LogQSO + JttyTxLoopbackTestController - - Click OK to confirm the following QSO: + + Timed out after 60 seconds. - - Call + + JTTY request %1 was accepted more than once. - - Start + + JTTY request %1 was rejected with reason %2. - - - dd/MM/yyyy HH:mm:ss + + JTTY request %1 completed more than once. - - End + + More than one JTTY transmit session drained. - - Mode + + Synthetic output opened the wrong capture path: %1 - - Band + + JTTY output stream restarted more than once. - - Rpt Sent + + Synthetic output reported non-silent playback more than once. - - Rpt Rcvd + + Synthetic output stopped the wrong capture path: %1 - - Grid + + JTTY output stream stopped more than once. - - Name + + Synthetic audio output failed: %1 - - Tx power + + The JTTY mode action was not found. - - <html><head/><body><p>Add comment to the comments list.</p></body></html> + + The application did not enter JTTY mode. - - Add + + The JTTY encoder did not produce a valid test waveform extent. - - - - - - - Retain + + The first JTTY text request was not accepted synchronously. - - Comments + + Non-silent playback began before the first request was accepted. - - Operator + + The output stream restarted or stopped before the gapless append. - - Exch sent + + The gapless append occurred before one second of real playback. - - Rcvd + + The second JTTY text request was not accepted during playback. - - Prop Mode + + Appending the second JTTY message restarted or stopped playback. - - Sat Mode + + The accepted-request set did not contain exactly both submitted messages. - - RX Frequency + + JTTY text requests were not accepted in submission order. - - Aircraft scatter + + The completed-request set did not contain exactly both submitted messages. - - Aurora-E + + JTTY text requests did not complete in FIFO order. - - Aurora + + The output stream lifecycle was not one start, one drain, and one stop. - - Back scatter + + The captured JTTY session contains an unexpected internal audio gap. - - Echolink + + The JTTY capture file was not created or is empty: %1 - - Earth-moon-earth + + Unable to reopen JTTY capture %1: %2 - - Sporadic E + + The JTTY capture is not 48 kHz mono signed 16-bit little-endian PCM. - - F2 Reflection + + The JTTY capture has an invalid PCM extent: file frames=%1, expected audio frames=%2, reported frames=%3. - - Field aligned irregularities + + Unexpected modal window: %1 + + + LiveAudioTestController - - Internet-assisted + + Timed out after 110 seconds. - - Ionoscatter + + Timed out after 100 seconds. - - IRLP + + Decoder backend failed: %1 - - Meteor scatter + + JTTY display did not settle to the expected text after input ended. - - Non-satellite repeater or transponder + + Synthetic audio source failed: %1 - - Rain scatter + + Unable to open expected decode file %1: %2 - - Tropospheric ducting + + Expected decode file %1 contains no messages. - - A + + Unable to open expected JTTY text file %1: %2 - - B + + Expected JTTY text file %1 contains no messages. - - BS + + A required FT8 decoder or monitoring GUI control was not found. - - JA + + Unable to configure the %1-%2 Hz waterfall decode range. - - JD + + Unable to prepare the complete FT8 fixture decode. - - K + + Unable to configure the FT8 multithreaded decoder as requested. - - KA + + Monitor did not enter the active state. - - KT + + Synthetic input unexpectedly selected the disk-data path. - - L + + Unable to arm the synthetic audio source. - - LS + + A required JTTY mode, monitoring, or decode display control was not found. - - LU + + The JTTY GUI action did not select JTTY mode. - - LX + + Monitor did not enter the active state for JTTY. - - S + + Synthetic JTTY input unexpectedly selected the disk-data path. - - SX + + Unable to arm the synthetic JTTY audio source. - - T + + The expected early standard and final configured MTD decoder invocations were not both observed. - - US + + The configured MTD invocation produced no decoder output. - - UV + + live MTD missing: %1 - - VS + + processed missing: %1 - - VU + + display missing: %1 - - - Satellite + + Reference-message validation failed: %1; live MTD output: %2; processed output: %3 - - Trans-equatorial + + Decoder messages were processed but none reached the GUI display path. - - - Invalid QSO Data + + The expected JTTY messages did not reach both panes in FIFO order. - - Check exchange sent and received + + The expected JTTY message reached both panes without an observed growing prefix. - - Check all fields + + Unexpected modal window: %1 + + + LogQSO - - Log file error + + Click OK to confirm the following QSO: - - Cannot open "%1" for append + + Call - - Error: %1 + + Start - - - MainWindow - - WSJT-X by K1JT + + + dd/MM/yyyy HH:mm:ss - - - - - - - - - - Band Activity + + End - - - UTC dB DT Freq Dr + + Mode - - - - - - - - Rx Frequency + + Band - - CQ only + + Rpt Sent - - Enter this QSO in log + + Rpt Rcvd - - Log &QSO + + Grid - - Stop monitoring + + Name - - &Stop + + Tx power - - &Monitor + + <html><head/><body><p>Add comment to the comments list.</p></body></html> - - <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> + + Add - - Erase right window. Double-click to erase both windows. + + + + + + + Retain - - &Erase + + Comments - - <html><head/><body><p>Clear the accumulating message average.</p></body></html> + + Operator - - Clear the accumulating message average. + + Exch sent - - Clear Avg + + Rcvd - - <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> + + Prop Mode - - Decode most recent Rx period at QSO Frequency + + Sat Mode - - &Decode + + RX Frequency - - <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> + + Aircraft scatter - - Toggle Auto-Tx On/Off + + Aurora-E - - E&nable Tx + + Aurora - - Stop transmitting immediately + + Back scatter - - &Halt Tx + + Echolink - - Toggle a pure Tx tone On/Off + + Earth-moon-earth - - &Tune + + Sporadic E - - Menus + + F2 Reflection - - Decode other Hounds calling above 1000 Hz audio offset + + Field aligned irregularities - - Enable auto response to the first decode from a new DXCC or new call on the current band. + + Internet-assisted - - F High + + Ionoscatter - - F Low + + IRLP - - 1/2 + + Meteor scatter - - 2/2 + + Non-satellite repeater or transponder - - 1/3 + + Rain scatter - - 2/3 + + Tropospheric ducting - - 3/3 + + A - - 1/4 + + B - - 2/4 + + BS - - 3/4 + + JA - - 4/4 + + JD - - 1/5 + + K - - 2/5 + + KA - - 3/5 + + KT - - 4/5 + + L - - 5/5 + + LS - - 1/6 + + LU - - 2/6 + + LX - - 3/6 + + S - - 4/6 + + SX - - 5/6 + + T - - 6/6 + + US - - Percentage of minute sequences devoted to transmitting. + + UV - - Prefer Type 1 messages + + VS - - <html><head/><body><p>Transmit during the next sequence.</p></body></html> + + VU - - - Q65 + + + Satellite - - SWL Mode + + Trans-equatorial - - Hide lower panel controls to maximize deocde windows + + + Invalid QSO Data - - USB dial frequency + + Check exchange sent and received - - 14.078 000 + + Check all fields - - <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> + + Log file error - - Rx Signal + + Cannot open "%1" for append - - 30dB recommended when only noise present -Green when good -Red when clipping may occur -Yellow when too low + + Error: %1 + + + MainWindow - - DX Call + + + + + + + + + + Band Activity - - DX Grid + + + UTC dB DT Freq Dr - - Callsign of station to be worked + + + + + + + + Rx Frequency - - &Lookup + + CQ only - - Locator of station to be worked + + Enter this QSO in log - - Az: 251 16553 km + + Log &QSO - - Add + + Stop monitoring - - <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> + + &Stop - - If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. + + &Monitor - - ? + + <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> - - Adjust Tx audio level + + Erase right window. Double-click to erase both windows. - - <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> + + &Erase - - Frequency entry + + <html><head/><body><p>Clear the accumulating message average.</p></body></html> - - Select operating band or enter frequency in MHz or enter kHz increment followed by k. + + Clear the accumulating message average. - - <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> + + Clear Avg - - <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> + + <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> - - Check to keep Tx frequency fixed when double-clicking on decoded text. + + Decode most recent Rx period at QSO Frequency - - Hold Tx Freq + + &Decode - - Audio Rx frequency + + <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> - - - - - - - Hz + + Toggle Auto-Tx On/Off - - - Rx + + E&nable Tx - - - Set Tx frequency to Rx Frequency + + Stop transmitting immediately - - ▲ + + &Halt Tx - - Frequency tolerance (Hz) + + Toggle a pure Tx tone On/Off - - - F Tol + + &Tune - - - Set Rx frequency to Tx Frequency + + + Menus - - ▼ + + Decode other Hounds calling above 1000 Hz audio offset - - <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> + + Enable auto response to the first decode from a new DXCC or new call on the current band. - - Synchronizing threshold. Lower numbers accept weaker sync signals. + + F High - - Sync + + F Low - - <html><head/><body><p>Check to use short-format messages.</p></body></html> + + WSJT-X by K1JT et al. - - Check to use short-format messages. + + Band Activity decode pane title - - Sh + + Title for the Band Activity decoded messages pane. - - <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> + + Band Activity decoded messages headings - - Check to enable JT9 fast modes + + + Columns: UTC dB DT Freq Message. - - - Fast + + Band Activity decoded messages - - <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> + + Decoded messages in the Band Activity pane. Columns: UTC dB DT Freq Message. - - Check to enable automatic sequencing of Tx messages based on received messages. + + Rx Frequency decode pane title - - Auto Seq + + Title for the Rx Frequency decoded messages pane. - - Check to generate "@1250 (SEND MSGS)" in Tx6. + + Rx Frequency decoded messages headings - - Tx6 + + Rx Frequency decoded messages - - Tx even/1st + + Decoded messages in the Rx Frequency pane. Columns: UTC dB DT Freq Message. - - <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> + + Check to display received messages in lower case. - - Frequency to call CQ on in kHz above the current MHz + + Lower case - - Tx CQ + + Include Time - - <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> + + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the strongest station's reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the weakest station's reply to your CQ.</p><p>When CQ or QRZ is pending, Enable Tx may be armed before or during a receive period. Only eligible direct callers decoded after it is armed in that period can replace the pending transmission; earlier callers are not retained.</p></body></html> - - Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. -Not available to nonstandard callsign holders. + + 1/2 - - Rx All Freqs + + 2/2 - - <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> + + 1/3 - - Submode determines tone spacing; A is narrowest. + + 2/3 - - Submode + + 3/3 - - - Fox + + 1/4 - - <html><head/><body><p>Check to monitor Sh messages.</p></body></html> + + 2/4 - - Check to monitor Sh messages. + + 3/4 - - SWL + + 4/4 - - Best S+P + + 1/5 - - <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> + + 2/5 - - Check this to start recording calibration data. -While measuring calibration correction is disabled. -When not checked you can view the calibration results. + + 3/5 - - Measure + + 4/5 - - <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> + + 5/5 - - Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). + + 1/6 - - Report + + 2/6 - - <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> + + 3/6 - - Tx/Rx or Frequency calibration sequence length + + 4/6 - - - s + + 5/6 - - - T/R + + 6/6 - - Audio Tx frequency + + Percentage of minute sequences devoted to transmitting. - - - Tx + + Prefer Type 1 messages - - Tx# + + <html><head/><body><p>Transmit during the next sequence.</p></body></html> - - - - 1 + + + Q65 - - - - Send this message in next Tx interval + + Alt+X - - Ctrl+2 + + SWL Mode - - <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + + Hide lower panel controls to maximize deocde windows - - Send this message in next Tx interval -Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + + + USB dial frequency - - Ctrl+1 + + 14.078 000 - - - - - Switch to this Tx message NOW + + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> - - Tx &2 + + Rx Signal - - Alt+2 + + 30dB recommended when only noise present +Green when good +Red when clipping may occur +Yellow when too low - - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + + DX Call - - Switch to this Tx message NOW -Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + + DX Grid - - Tx &1 + + Callsign of station to be worked - - Alt+1 + + &Lookup - - Ctrl+6 + + Locator of station to be worked - - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> + + Az: 251 16553 km - - Send this message in next Tx interval -Double-click to reset to the standard 73 message + + Add - - Ctrl+5 + + <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> - - Ctrl+3 + + If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. - - Tx &3 + + ? - - Alt+3 + + Adjust Tx audio level - - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> - - Send this message in next Tx interval -Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) -RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + Frequency entry - - Ctrl+4 + + Select operating band or enter frequency in MHz or enter kHz increment followed by k. - - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> - - Switch to this Tx message NOW -Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) -RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> - - Tx &4 + + Check to keep Tx frequency fixed when double-clicking on decoded text. - - Alt+4 + + Hold Tx Freq - - Tx &5 + + + Audio Rx frequency - - Alt+5 + + + + + + + + + Hz - - Now + + + + Rx - - Generate standard messages for minimal QSO + + + + + Set Tx frequency to Rx Frequency - - Generate Std Msgs + + + ▲ - - Tx &6 + + + Frequency tolerance (Hz) - - Alt+6 + + + + F Tol - - Enter a free text message (maximum 13 characters) -or select a predefined macro from the dropdown list. -Press ENTER to add the current text to the predefined -list. The list can be maintained in Settings (F2). + + + + + Set Rx frequency to Tx Frequency - - Queue up the next Tx message + + + ▼ - - Next + + <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> - - - - - - - 2 + + Synchronizing threshold. Lower numbers accept weaker sync signals. - - Quick-Start Guide to FST4 and FST4W + + Sync - - FST4 + + <html><head/><body><p>Check to use short-format messages.</p></body></html> - - FST4W + + Check to use short-format messages. - - - CQ + + Sh - - Grid + + <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> - - CQ AF + + Check to enable JT9 fast modes - - CQ AN + + + Fast - - CQ AS + + <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> - - CQ EU + + Check to enable automatic sequencing of Tx messages based on received messages. - - CQ NA + + Auto Seq - - CQ OC + + Check to generate "@1250 (SEND MSGS)" in Tx6. - - CQ SA + + Tx6 - - CQ 0 + + Tx even/1st - - CQ 1 + + <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> - - CQ 2 + + Frequency to call CQ on in kHz above the current MHz - - CQ 3 + + Tx CQ - - CQ 4 + + <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> - - CQ 5 + + Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. +Not available to nonstandard callsign holders. - - CQ 6 + + Rx All Freqs - - CQ 7 + + <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> - - CQ 8 + + Submode determines tone spacing; A is narrowest. - - CQ 9 + + Submode - - Reset + + + Fox - - N List + + <html><head/><body><p>Check to monitor Sh messages.</p></body></html> - - N Slots + + Check to monitor Sh messages. - - - - - - - - Random + + SWL - - Call + + Best S+P - - S/N (dB) + + <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> - - Distance + + Check this to start recording calibration data. +While measuring calibration correction is disabled. +When not checked you can view the calibration results. - - More CQs + + Measure - - - % + + <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> - - Tx Pct + + Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). - - Band Hopping + + Report - - Choose bands and times of day for band-hopping. + + <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> - - Schedule ... + + Tx/Rx or Frequency calibration sequence length - - Upload decoded messages to WSPRnet.org. + + + s - - Upload spots + + + T/R - - <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> + + + Audio Tx frequency - - 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. + + + + Tx - - No own call decodes + + Tx# - - Tx Next + + + + 1 - - Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. + + + + Send this message in next Tx interval - - NB + + Ctrl+2 - - 40 + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> - - - - 10 + + Send this message in next Tx interval +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) - - 17 + + Ctrl+1 - - 60 + + + + + Switch to this Tx message NOW - - - 12 + + Tx &2 - - 160 + + Alt+2 - - 20 + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> - - 80 + + Switch to this Tx message NOW +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) - - - 70 + + Tx &1 - - 15 + + Alt+1 - - 30 + + Ctrl+6 - - - - - 6 + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> - - 24G + + Send this message in next Tx interval +Double-click to reset to the standard 73 message - - 10G + + Ctrl+5 - - 5G + + Ctrl+3 - - - - 9 + + Tx &3 - - 13 + + Alt+3 - - 23 + + Ctrl+4 - - 33 + + Tx &4 - - 1.25 + + Alt+4 - - - 4 + + Tx &5 - - - 8 + + Alt+5 - - CQ messages only. + + Now - - Bypass Filters toggled via Settings or the Filters menu. + + Generate standard messages for minimal QSO - - BP + + Generate Std Msgs - - <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> + + Tx &6 - - Avg + + Alt+6 - - <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> + + Enter a free text message (maximum 13 characters) +or select a predefined macro from the dropdown list. +Press ENTER to add the current text to the predefined +list. The list can be maintained in Settings (F2). - - <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> + + Queue up the next Tx message - - <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> + + Next - - <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> + + + + + + + 2 - - <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> + + Quick-Start Guide to FST4 and FST4W - - Ignore + + FST4 - - Pwr + + FST4W - - <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the the strongest station's reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the the weakest station's reply to your CQ. </p></body></html> + + + + CQ - - - <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> + + Grid - - <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> + + CQ AF - - 15C + + CQ AN - - <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> + + CQ AS - - 15A + + CQ EU - - <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> + + CQ NA - - 30B + + CQ OC - - <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> + + CQ SA - - 60C + + CQ 0 - - <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> + + CQ 1 - - 60D + + CQ 2 - - <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> + + CQ 3 - - 60E + + CQ 4 - - Maximum drift rate in units of symbol rate per transmission. + + CQ 5 - - Max Drift + + CQ 6 - - - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> + + CQ 7 - - <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> + + CQ 8 - - Send msg + + CQ 9 - - <html><head/><body><p>Enter a free text message.</p></body></html> + + Reset - - Free Text + + N List - - <html><head/><body><p>Select a specific CQ message.</p></body></html> + + N Slots - - Queue + + + + + + + + Random - - Allow Dupes + + Call - - <html><head/><body><p>Clear all queues.</p></body></html> + + S/N (dB) - - <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> + + Distance - - <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> + + More CQs - - Age + + + % - - Continent + + Tx Pct - - Score + + Band Hopping - - <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> + + Choose bands and times of day for band-hopping. - - In Progress + + Schedule ... - - <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> + + Upload decoded messages to WSPRnet.org. - - - - - 3 + + Upload spots - - 70cm FT8 + + <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> - - 70cm + + 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. - - 30m FT8 + + No own call decodes - - 30m + + Tx Next - - <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> + + Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. - - Band Hopping + + NB - - 12m FT8 + + 40 - - 12m + + + + 10 - - 40m FT8 + + 17 - - 40m + + 60 - - 2m MSK144 + + + 12 - - 2m MSK + + 160 - - 10m FT8 + + 20 - - 10m + + 80 - - 6m FT8 + + + 70 - - 6m + + 15 - - 60m FT8 + + 30 - - 60m + + + + + 6 - - 160m FT8 + + 24G - - 160m + + 10G - - 80m FT8 + + 5G - - 80m + + + + 9 - - 20m FT8 + + 13 - - 20m + + 23 - - 17m FT8 + + 33 - - 17m + + 1.25 - - 4m FT8 + + + 4 - - 4m + + + 8 - - 15m FT8 + + CQ messages only. - - 15m + + Bypass Filters toggled via Settings or the Filters menu. - - 2m FT8 + + BP - - 2m + + <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> - - - 10m FT4 + + Avg - - - 12m FT4 + + <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> - - - 15m FT4 + + <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> - - - 17m FT4 + + <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> - - - 20m FT4 + + <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> - - - 30m FT4 + + <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> - - - 40m FT4 + + Ignore - - - 80m FT4 + + Pwr - - FT8 QRG6 + + + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> - - FT8 QRG1 + + <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> - - FT8 QRG2 + + 15C - - FT8 QRG7 + + <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> - - FT8 QRG8 in kHz. + + 15A - - FT8 QRG5 + + <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> - - FT8 QRG3 + + 30B - - FT8 QRG4 + + <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> - - FT8 QRG8 + + 60C - - FT8 QRG7 in kHz. + + <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> - - FT8 QRG6 in kHz. + + 60D - - FT8 QRG5 in kHz. + + <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> - - FT8 QRG4 in kHz. + + 60E - - FT8 QRG3 in kHz. + + Maximum drift rate in units of symbol rate per transmission. - - FT8 QRG2 in kHz. + + Max Drift - - FT8 QRG1 in kHz. + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - - Spacing + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - - Fixed Tone + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> - - K1JT + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - - CW + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - - Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. + + <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> - - H + + Send msg - - Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. + + <html><head/><body><p>Enter a free text message.</p></body></html> - - Switch to FT4 mode + + Free Text - - Switch to MSK144 mode + + <html><head/><body><p>Select a specific CQ message.</p></body></html> - - MSK + + Queue - - <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> + + Allow Dupes - - <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> + + <html><head/><body><p>Clear all queues.</p></body></html> - - <html><head/><body><p>Switch to Echo mode</p></body></html> + + <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> - - File + + <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> - - View + + Age - - Filters + + Continent - - Decode + + Score - - Parameters + + <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> - - Decoder sensitivity + + In Progress - - Decoder start + + <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> - - Number of threads + + + + + 3 - - QSO RX freq sensitivity + + 70cm FT8 - - Decoding cycles + + 70cm - - Save + + 30m FT8 - - Help + + 30m - - Mode + + <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> - - Configurations + + Band Hopping - - Tools + + 12m FT8 - - Exit + + 12m - - About WSJT-X + + 40m FT8 - - Waterfall + + 40m - - Open + + 2m MSK144 - - Ctrl+O + + 2m MSK - - Open next in directory + + 10m FT8 - - Decode remaining files in directory + + 10m - - Shift+F6 + + 6m FT8 - - Delete all *.wav && *.c2 files in SaveDir + + 6m - - None + + 60m FT8 - - Save all + + 60m - - Remove saved files after 30 days + + 160m FT8 - - Online User Guide + + 160m - - Keyboard shortcuts + + 80m FT8 - - Special mouse commands + + 80m - - JT9 + + 20m FT8 - - Save decoded + + 20m - - - Normal + + 17m FT8 - - Deep + + 17m - - Erase ALL.TXT + + 4m FT8 - - Erase wsjtx_log.adi + + 4m - - Erase wsjtx.log + + 15m FT8 - - Erase Ignore List + + 15m - - F7 + + 2m FT8 - - Don't split ALL.TXT + + 2m - - Split ALL.TXT yearly + + + 10m FT4 - - Split ALL.TXT monthly + + + 12m FT4 - - Disable writing of ALL.TXT + + + 15m FT4 - - Active Stations + + + 17m FT4 - - Band Buttons + + + 20m FT4 - - Use Dark Style + + + 30m FT4 - - Reduce false decodes + + + 40m FT4 - - Default event logging + + + 80m FT4 - - Diagnostic mode + + FT8 QRG6 - - Disable event logging + + FT8 QRG1 - - Quick-Start Guide to WSJT-X 2.7 and QMAP + + FT8 QRG2 - - WSJT-X_improved Home Page + + FT8 QRG7 - - <html><head/><body><p>Go to the wsjt-x_improved home page.</p></body></html> + + FT8 QRG8 in kHz. - - The additional features of wsjt-x_improved + + FT8 QRG5 - - <html><head/><body><p>Overview on the additional features of wsjt-x_improved.</p></body></html> + + FT8 QRG3 - - Recommended audio settings + + FT8 QRG4 - - <html><head/><body><p>Recommended Audio Settings.</p></body></html> + + FT8 QRG8 - - How to deal with rig control errors + + FT8 QRG7 in kHz. - - <html><head/><body><p>How to deal with rig control errors.</p></body></html> + + FT8 QRG6 in kHz. - - Erase list of Q65 callers + + FT8 QRG5 in kHz. - - SuperFox User Guide + + FT8 QRG4 in kHz. - - Message Creator + + FT8 QRG3 in kHz. - - Hide stations worked before on band + + FT8 QRG2 in kHz. - - Hide stations worked today or yesterday + + FT8 QRG1 in kHz. - - Hide stations from Ignore List + + GroupBox - - Ignore stations worked today or yesterday + + CQ %M CQ - - Ignore stations from Ignore List + + %H 599 %N - - Hide stations from Territory 1 + + %H TU CQ %M CQ - - Hide stations from Territory 2 + + %M - - Hide stations from Territory 3 + + %H - - Hide stations from Territory 4 + + TU NOW %Q 599 %N - - Hide stations from Europe + + %H AGN? - - Hide stations from North America + + 599 %N - - Hide stations from South America + + F1 - - Hide stations from Asia + + HisCall Exchange - - Hide stations from Africa + + F2 - - Hide stations from Oceania + + TU CQ - - Hide stations from Antarctica + + F3 - - Full Duplex Mode + + MyCall - - Highlight callsigns worked before on band + + F4 - - Highlight callsigns worked today or yesterday + + HisCall - - Highlight callsigns from Ignore List + + F5 - - Enable Message Popups + + Now QueuedCall Exchange - - QSY Monitor + + F6 - - Ignore stations worked before on band + + HisCall AGN ? - - Use multithreaded FT8 decoder + + Exchange - - Auto + + Serial number of QSO for contest exchange. - - - 5 + + Click to transmit a message. - - - 7 + + Send message - - - 11 + + Call next - - Low + + Message to be transmitted - - Medium + + Serial Number - - High + + Callsign to be worked next. - - Minimum + + Spacing - - Use low thresholds + + Fixed Tone - - Use subpass + + K1JT - - 2-Stage + + CW - - 3-Stage + + Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. - - Early + + H - - Late + + Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. - - Wideband DX Call search + + Switch to FT4 mode - - Hide FT8 dupe messages + + Switch to MSK144 mode - - VHF / UHF Buttons + + MSK - - Highlight stations from Territory 1 + + <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> - - Highlight stations from Territory 2 + + <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> - - Highlight stations from Territory 3 + + <html><head/><body><p>Switch to Echo mode</p></body></html> - - Highlight stations from Territory 4 + + File - - Disable clicks on waterfall + + View - - - JT65 + + Filters - - Astronomical data + + Decode - - List of Type 1 prefixes and suffixes + + Parameters - - Settings... + + Decoder sensitivity - - Local User Guide + + Decoder start - - Open log directory + + Number of threads - - JT4 + + QSO RX freq sensitivity - - Message averaging + + Decoding cycles - - Enable averaging + + Save - - Enable deep search + + Help - - WSPR + + + Mode - - Echo Graph + + Configurations - - F8 + + Tools - - - Echo + + Exit - - EME Echo mode + + About WSJT-X - - ISCAT + + Waterfall - - Fast Graph + + Open - - F9 + + Ctrl+O - - &Download Samples ... + + Open next in directory - - <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> + + Ctrl+X - - MSK144 + + Decode remaining files in directory - - QRA64 + + Download EME Ephemeris Chart - - Release Notes + + Hide AP information - - Enable AP for DX Call + + <html><head/><body><p>Hide AP information</p></body></html> - - FreqCal + + Highlight Whitelist entries - - Measure reference spectrum + + JTTY - - Measure phase response + + Delete all *.wav && *.c2 files in SaveDir - - Erase reference spectrum + + None - - Execute frequency calibration cycle + + Save all - - Equalization tools ... + + Remove saved files after 30 days - - - FT8 + + Online User Guide - - - Enable AP + + Keyboard shortcuts - - Solve for calibration parameters + + Special mouse commands - - Copyright notice + + JT9 - - Shift+F1 + + Save decoded - - Fox log + + + Normal - - FT8 DXpedition Mode User Guide + + Deep - - Reset Cabrillo log ... + + Erase ALL.TXT - - Color highlighting scheme + + Erase wsjtx_log.adi - - Export Cabrillo log ... + + Erase wsjtx.log - - Contest log + + Erase Ignore List - - Erase WSPR hashtable + + F7 - - - FT4 + + Don't split ALL.TXT - - Quick-Start Guide to Q65 + + Split ALL.TXT yearly - - Auto Clear Avg after decode + + Split ALL.TXT monthly - - Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 + + Disable writing of ALL.TXT - - Rig Control Error + + Active Stations - - - - Receiving + + Band Buttons - - Do you want to reconfigure the radio interface? + + Use Dark Style - - Error Scanning ADIF Log + + Reduce false decodes - - Scanned ADIF log, %1 worked-before records created. CTY: %2 + + Default event logging - - Error Loading LotW Users Data + + Diagnostic mode - - Error Writing WAV File + + Disable event logging - - Enumerating audio devices + + Quick-Start Guide to WSJT-X 2.7 and QMAP - - Configurations... + + How to deal with rig control errors - - - - - - - - - - - - - - - - - - - - - Message + + <html><head/><body><p>How to deal with rig control errors.</p></body></html> - - Error Killing jt9.exe Process + + Erase list of Q65 callers - - KillByName return code: %1 + + SuperFox User Guide - - Error removing "%1" + + Message Creator - - Click OK to retry + + Hide stations worked before on band - - - Improper mode + + Hide stations worked today or yesterday - - - File Open Error + + Hide stations from Ignore List - - - - - - Cannot open "%1" for append: %2 + + Ignore stations worked today or yesterday - - Error saving c2 file + + Ignore stations from Ignore List - - Error in Sound Input + + Hide stations from Territory 1 - - Error in Sound Output + + Hide stations from Territory 2 - - - Single-Period Decodes + + Hide stations from Territory 3 - - - Average Decodes + + Hide stations from Territory 4 - - Change Operator + + Hide stations from Europe - - New operator: + + Hide stations from North America - - Status File Error + + Hide stations from South America - - - Cannot open "%1" for writing: %2 + + Hide stations from Asia - - Decodes containing My Call + + Hide stations from Africa - - Subprocess Error + + Hide stations from Oceania - - Subprocess failed with exit code %1 + + Hide stations from Antarctica - - - Running: %1 -%2 + + Full Duplex Mode - - Subprocess error + + Highlight callsigns worked before on band - - Reference spectrum saved + + Highlight callsigns worked today or yesterday - - It is very important to avoid audio harmonics and distorted audio signals. -This is usually achieved by the following step-by-step approach: - -1. Select 'Fake it' in the Settings/Radio menu as your 'Split mode'. If your - rig does not support this, select 'Rig'. But really try to avoid 'None'! - -2. Set the transmission power of your transceiver to maximum. - -3. Set the Pwr slider to the minimum and click on the 'Tune' button. - -4. Observe the actual transmission power of your rig as well as ALC. - -5. Carefully increase the Pwr slider until you have reached the - maximum transmit powe of your transceiver. - -6. VERY IMPORTANT: Now reduce the Pwr slider until you reach approx. - 90% of your max. Tx power. ALC should be close to zero. - -7. This is the maximum audio level permitted with your setup. - Always stay with the Pwr slider below this max. value. - -If possible, check your transmission from time to time with a webSDR -to ensure the signal is clean and not distorted. + + Highlight callsigns from Ignore List - - <b>Recommended Audio Settings</b> + + Enable Message Popups - - Invalid data in fmt.all at line %1 + + QSY Monitor - - Good Calibration Solution + + Ignore stations worked before on band - - <pre>%1%L2 ±%L3 ppm -%4%L5 ±%L6 Hz - -%7%L8 -%9%L10 Hz</pre> + + Use multithreaded FT8 decoder - - Delete Calibration Measurements + + Auto - - The "fmt.all" file will be renamed as "fmt.bak" + + + 5 + + + + + + 7 + + + + + + 11 + + + + + Low + + + + + Medium + + + + + High + + + + + Minimum + + + + + Use low thresholds + + + + + Use subpass + + + + + 2-Stage + + + + + 3-Stage + + + + + Early + + + + + Late + + + + + Wideband DX Call search + + + + + Hide FT8 dupe messages + + + + + VHF / UHF Buttons + + + + + Highlight stations from Territory 1 + + + + + Highlight stations from Territory 2 + + + + + Highlight stations from Territory 3 + + + + + Highlight stations from Territory 4 + + + + + Disable clicks on waterfall + + + + + + JT65 + + + + + Astronomical data + + + + + List of Type 1 prefixes and suffixes + + + + + Settings... + + + + + Local User Guide + + + + + Open log directory + + + + + JT4 + + + + + Message averaging + + + + + Enable averaging + + + + + Enable deep search + + + + + WSPR + + + + + Echo Graph + + + + + F8 + + + + + + Echo + + + + + EME Echo mode + + + + + ISCAT + + + + + Fast Graph + + + + + &Download Samples ... + + + + + <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> + + + + + MSK144 + + + + + QRA64 + + + + + Release Notes + + + + + Enable AP for DX Call + + + + + FreqCal + + + + + Measure reference spectrum + + + + + Measure phase response + + + + + Erase reference spectrum + + + + + Execute frequency calibration cycle + + + + + Equalization tools ... + + + + + + FT8 + + + + + + Enable AP + + + + + Solve for calibration parameters + + + + + Copyright notice + + + + + Shift+F1 + + + + + Fox log + + + + + FT8 DXpedition Mode User Guide + + + + + Reset Cabrillo log ... + + + + + Color highlighting scheme + + + + + Export Cabrillo log ... + + + + + Contest log + + + + + Erase WSPR hashtable + + + + + + FT4 + + + + + Quick-Start Guide to Q65 + + + + + Auto Clear Avg after decode + + + + + Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 + + + + + Rig Control Error + + + + + + + Receiving + + + + + Do you want to reconfigure the radio interface? + + + + + Error Scanning ADIF Log + + + + + Scanned ADIF log, %1 worked-before records created. CTY: %2 + + + + + Error Loading LotW Users Data + + + + + + + Decoder Error + + + + + The decoder subprocess exited unexpectedly. + + + + + jt9 exited unexpectedly with code %1. + + + + + + Error Writing WAV File + + + + + Enumerating audio devices + + + + + Configurations... + + + + + + + + + + + + + + + + + + + + Message + + + + + Error Killing jt9.exe Process + + + + + KillByName return code: %1 + + + + + Error removing "%1" + + + + + Click OK to retry + + + + + %1.wav: invalid sample count %2 + + + + + + Improper mode + + + + + + File Open Error + + + + + + + + + Cannot open "%1" for append: %2 + + + + + Error saving c2 file + + + + + Error in Sound Input + + + + + Error in Sound Output + + + + + + Single-Period Decodes + + + + + + Average Decodes + + + + + Change Operator + + + + + New operator: + + + + + Status File Error + + + + + + Cannot open "%1" for writing: %2 + + + + + Decodes containing My Call + + + + + Subprocess Error + + + + + Subprocess failed with exit code %1 + + + + + + Running: %1 +%2 + + + + + Subprocess error + + + + + Invalid data in fmt.all at line %1 + + + + + Good Calibration Solution + + + + + <pre>%1%L2 ±%L3 ppm +%4%L5 ±%L6 Hz + +%7%L8 +%9%L10 Hz</pre> + + + + + Delete Calibration Measurements + + + + + The "fmt.all" file will be renamed as "fmt.bak" + + + + + No data read from disk. Wrong file format? + + + + + Confirm Delete + + + + + Are you sure you want to delete all *.wav and *.c2 files in "%1"? + + + + + Keyboard Shortcuts + + + + + Special Mouse Commands + + + + + No more files to open. + + + + + Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. + + + + + WSPR Guard Band + + + + + Please choose another dial frequency. +Must be 3Khz away from %1. +WSJT-X will not operate in Fox mode +overlapping the standard FT8 sub-bands. + + + + + Fox Mode warning + + + + + Please choose another dial frequency. +WSJT-X will not operate in Fox mode +overlapping the WSPR sub-bands. + + + + + The decoder subprocess could not be stopped. + + + + + The decoder subprocess could not be restarted. + + + + + Application status + + + + + Current WSJT-X status messages and operating indicators. + + + + + Transmit status + + + + + Configuration + + + + + Decode count + + + + + Last transmitted message + + + + + Power and SWR status + + + + + Decode progress + + + + + Progress for the current decode operation. + + + + + Transmit watchdog + + + + + The selected transmit message cannot be encoded. Enable Tx has been turned off. Edit the selected message or check station settings before trying again. + + + + + Tx message cannot be encoded; Enable Tx is off + + + + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2026 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; Roger Rehr, W3SZ; John Nelson, G4KLA; Charlie Suckling, DL3WDG; Terrell Deppe, KJ5HST; and other members of the WSJT Development Group." + + + + + EME Chart + + + + + Select Year + + + + + FT8 input completion was rejected: automated=%1 awaiting=%2 frames=%3. + + + + + Unable to flush the final FT8 downsampling block. + + + + + FT8 input completed with %1 of %2 samples in the decode buffer. + + + + + FT8 decoding is running behind; early passes are temporarily reduced. + + + + + FT8 decoding caught up; configured early passes restored. + + + + + + PSK Reporter spot queue full; oldest spot dropped + + + + + Last Tx: %1 + + + + + A QSO between two stations with nonstandard callsigns won't work. + +Auto Seq would get stuck in an endless loop. + + + + + This station transmits in the same time slot as you do. + +You must not start a QSO if both stations Tx even/1st +or Tx odd/2nd, while the Tx even/1st checkbox is disabled. + +Click the MSK144 mode button to re-enable the Tx even/1st +checkbox, or choose another station. + + + + + Should you switch to EU VHF Contest mode? + +To do so, check 'Special operating activity' and +'EU VHF Contest' on the Settings | Advanced tab. + + + + + Should you switch to ARRL Field Day mode? + + + + + Should you switch to RTTY contest mode? + + + + + %1 shorthand-message mode + + + + + RR73 is not available in %1. Tx4 uses RRR in this mode. + + + + + Wait & Pounce requires a CQ response mode. +Change CQ: None to another option. + + + + + + Decoder is starting; decode request skipped. + + + + + + + + Add to CALL3.TXT + + + + + Please enter a valid grid locator + + + + + Cannot open "%1" for read/write: %2 + + + + + %1 +is already in CALL3.TXT, do you wish to replace it? + + + + + Warning: DX Call field is empty. + + + + + SuperFox free text may only contain spaces, digits, uppercase letters, and + - . / ?. + + + + + Log file error + + + + + Cannot open "%1" + + + + + Error sending log to N1MM + + + + + Write returned "%1" + + + + + DX call + + + + + Callsign of station to be worked. + + + + + DX grid + + + + + Locator of station to be worked. + + + + + Wait and Call + + + + + Lookup DX call + + + + + Add DX call + + + + + Ignore DX call + + + + + CQ response mode + + + + + Selects a station automatically from replies to your pending CQ after Enable Tx is armed in the current receive period, or from CQ messages for Wait & Pounce. + + + + + Transmit audio frequency + + + + + Receive audio frequency + + + + + Signal report + + + + + Operating band + + + + + Operating band text + + + + + Transmit power attenuation + + + + + Adjust Tx audio level attenuation. + + + + + Show or hide the menu bar. + + + + + Rig control status + + + + + Hound mode + + + + + Toggle FT8 hound mode. Right-click to toggle SuperFox mode. - - No data read from disk. Wrong file format? + + Message panel selector - - Confirm Delete + + Switches between standard messages, Fox queue, and band hopping pages. Press 1, 2, or 3 while focused to select a page. - - Are you sure you want to delete all *.wav and *.c2 files in "%1"? + + Standard messages - - Keyboard Shortcuts + + Fox queue - - Special Mouse Commands + + + Band hopping - - No more files to open. + + Standard messages page - - - Spotting to PSK Reporter unavailable + + Fox queue page - - Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. + + Band hopping page - - WSPR Guard Band + + Hound queue - - If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: - -"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2025 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; and other members of the WSJT Development Group." + + Queued Hound callers available for Fox transmissions. - - <table cellspacing=1> - <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> - <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> - <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> - <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> - <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> - <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> - <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> - <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> - <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> - <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: toggle "Call 1st")</td></tr> - <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> - <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> - <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> - <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> - <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> - <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> - <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> - <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> - <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> - <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> - <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> - <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> - <tr><td><b>Alt+C </b></td><td>Toggle "Call 1st" checkbox</td></tr> - <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> - <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> - <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> - <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> - <tr><td><b>Alt+E </b></td><td>Erase</td></tr> - <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> - <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> - <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> - <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> - <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> - <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> - <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> - <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> - <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> - <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> - <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> - <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> - <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> - <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> - <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> - <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> - -</table> - Keyboard shortcuts help window contents + + Fox transmissions in progress - - <table cellpadding=5> - <tr> - <th align="right">Click on</th> - <th align="left">Action</th> - </tr> - <tr> - <td align="right">Waterfall:</td> - <td><b>Click</b> to set Rx frequency.<br/> - <b>Right-click</b> to set Tx frequency.<br/> - <b>Double-right-click</b> to set Rx and Tx frequencies. - </td> - </tr> - <tr> - <td align="right">Decoded text:</td> - <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> - and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> - Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> - If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> - own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. - </td> - </tr> - <tr> - <td align="right">Dial Frequency:</td> - <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> - <b>Right-click</b> to increase frequency by 1 kHz.<br/> - <b>Left-click</b> to decrease frequency by 1 kHz.<br/> - The mouse pointer must be over the Dial Frequency indicator. - </td> - </tr> - <tr> - <td align="right">H Button:</td> - <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> - <b>Right-click</b> to activate or deactivate SuperFox mode. - </td> - </tr> - <tr> - <td align="right">FT8 Button:</td> - <td><b>Click</b> to switch to FT8 Hound Mode.<br/> - <b>Right-click</b> to toggle last used Special Operating Activity On/Off. - </td> - </tr> - <tr> - <td align="right">Q65 Button:</td> - <td><b>Click</b> to switch to Q65 Mode.<br/> - <b>Right-click</b> to switch to Q65 Pileup Mode. - </td> - </tr> - <tr> - <td align="right">JT65 Button:</td> - <td><b>Click</b> to switch to JT65 Mode.<br/> - <b>Right-click</b> to switch to JT9 Mode. - </td> - </tr> - <tr> - <td align="right">Tx5 Button:</td> - <td><b>Right-click</b> to retain Tx5 free text. - </td> - </tr> - <tr> - <td align="right">Tx Even/1st:</td> - <td><b>Right-click</b> to freeze the state of the checkbox.<br/> - <b>Right-click on the FT8 Button</b> to unfreeze. - </td> - </tr> - <tr> - <td align="right">Enable Tx Button:</td> - <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> - <b>Right-click</b> to toggle Wait & Pounce On/Off. - </td> - </tr> - <tr> - <td align="right">Erase button:</td> - <td><b>Click</b> to erase Rx Frequency window.<br/> - <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> - If <b>Alternate Erase button behavior</b> is checked:<br/> - <b>Click</b> to erase Band Activity window.<br/> - <b>Right-click</b> to erase Rx Frequency window.<br/> - <b>Double-click</b> to erase Rx Frequency and Band Activity windows. - </td> - </tr> - <tr> - <td align="right">DX Call Button:</td> - <td><b>Click</b> to toggle Wait & Call On/Off.<br/> - <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. - </td> - </tr> - <tr> - <td align="right">Lookup Button:</td> - <td><b>Click</b> to search for callsign in database.<br/> - <b>Right-click</b> to search for Dx Call on qrz.com. - </td> - </tr> - <tr> - <td align="right">Add Button:</td> - <td><b>Click</b> to add callsign and locator to database.<br/> - <b>Right-click</b> to search for Dx Call on hamqth.com. - </td> - </tr> - <tr> - <td align="right">Ignore Button:</td> - <td><b>Click</b> to add callsign to the Ignore List.<br/> - <b>Right-click</b> to search for Dx Call on qrzcq.com. - </td> - </tr> - <tr> - <td align="right">Band Buttons:</td> - <td><b>Click</b> to toggle band / mode default frequencies.<br/> - <b>Right-click</b> to toggle FT8 DXpedition frequencies. - </td> - </tr> -</table> - Mouse commands help window contents + + Hound callers currently in progress for Fox transmissions. - - Please choose another dial frequency. -Must be 3Khz away from %1. -WSJT-X will not operate in Fox mode -overlapping the standard FT8 sub-bands. + + Hound queue sort order + + + + + Hound queue list size + + + + + Fox transmission slots + + + + + Fox CQ message + + + + + Reset Fox queues + + + + + Fox free text + + + + + Send Fox free text + + + + + Enable FT8 QRG 1 + + + + + Enable FT8 QRG 2 + + + + + Enable FT8 QRG 3 + + + + + Enable FT8 QRG 4 + + + + + Enable FT8 QRG 5 + + + + + Enable FT8 QRG 6 + + + + + Enable FT8 QRG 7 + + + + + Enable FT8 QRG 8 + + + + + FT8 QRG 1 frequency + + + + + FT8 QRG 2 frequency + + + + + FT8 QRG 3 frequency + + + + + FT8 QRG 4 frequency + + + + + FT8 QRG 5 frequency + + + + + FT8 QRG 6 frequency + + + + + FT8 QRG 7 frequency + + + + + FT8 QRG 8 frequency + + + + + Tx1 message + + + + + Tx2 message + + + + + Tx3 message + + + + + Tx4 message + + + + + Tx5 message macro - - - Fox Mode warning + + Tx6 message - - Please choose another dial frequency. -WSJT-X will not operate in Fox mode -overlapping the WSPR sub-bands. + + Tx5 message macro text - - Last Tx: %1 + + Select Tx1 for next transmission - - This station transmits in the same time slot as you do. - -You must not start a QSO if both stations Tx even/1st -or Tx odd/2nd, while the Tx even/1st checkbox is disabled. - -Click the MSK144 mode button to re-enable the Tx even/1st -checkbox, or choose another station. + + Select Tx2 for next transmission - - Should you switch to EU VHF Contest mode? - -To do so, check 'Special operating activity' and -'EU VHF Contest' on the Settings | Advanced tab. + + Select Tx3 for next transmission - - Should you switch to ARRL Field Day mode? + + Select Tx4 for next transmission - - Should you switch to RTTY contest mode? + + Select Tx5 for next transmission - - - - - Add to CALL3.TXT + + Select Tx6 for next transmission - - Please enter a valid grid locator + + Transmit Tx1 now - - Cannot open "%1" for read/write: %2 + + Transmit Tx2 now - - %1 -is already in CALL3.TXT, do you wish to replace it? + + Transmit Tx3 now - - Warning: DX Call field is empty. + + Transmit Tx4 now - - Log file error + + Transmit Tx5 now - - Cannot open "%1" + + Transmit Tx6 now - - Error sending log to N1MM + + Stations calling DXpedition %1 - - Write returned "%1" + + Show Already Worked - - Stations calling DXpedition %1 + + All Decodes - - Show Already Worked + + QSO Frequency - + Super Fox - + Super Hound - + Hound - + Tx Messages - - - - - - + + + + + + Confirm Erase - + Are you sure you want to erase file ALL.TXT? - + Are you sure you want to erase the list of Q65 callers? - - + + Confirm Reset - + Are you sure you want to erase your contest log? - + Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. - + Cabrillo Log saved - + Are you sure you want to erase file wsjtx_log.adi? - + Are you sure you want to erase the WSPR hashtable? - + %1 W - + SWR > 2.5 !!! Transmission was stopped @@ -5767,114 +7348,395 @@ Check your antenna - + Tune digital gain - + Transmit digital gain - + Prefixes - + Network Error - + Error: %1 UDP server %2:%3 - + + File Error - + + + Stop transmitting or tuning before changing the dial frequency. + + + + + + Measuring reference spectrum: %1 s remaining + + + + + Reference spectrum measurement stopped; Ref Spec is available + + + + + Reference spectrum saved; Ref Spec is available + + + + + Reference spectrum measurement stopped; no reference spectrum is available + + + + Phase Training Disabled - + Phase Training Enabled - + + Cannot remove "%1": %2 + + + + WD:0m - + Runaway Tx watchdog - + WD:%1m - - + + + Free Text Message - - + + Message: - + Directional calls not yet supported in SuperFox mode - + TOTP: No seed entered in fox configuration to generate verification code. - + + SuperFox cannot queue %1: unsupported callsign. + + + + TOTP SF: seed not long enough. - + + SuperFox Tx stopped: invalid message tokens. + + + + + SuperFox Tx stopped: invalid verification code. + + + + + SuperFox Tx stopped: invalid CQ call or grid. + + + + + SuperFox Tx stopped: invalid callsign. + + + + + SuperFox Tx stopped: report is outside the SuperFox range. + + + + + SuperFox Tx stopped: free text contains unsupported characters. + + + + + SuperFox Tx stopped: message could not be packed. + + + + Are you sure you want to erase the Tx Log? - + "%1" added to Ignore List - + Are you sure you want to erase the Ignore List? - - + + Log File Error - + Are you sure you want to clear the QSO queues? + + + Band hopping has no selected frequencies. + + + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: cycle CQ response mode)</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Cycle CQ response mode</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Ctrl+X </b></td><td>Open next file in directory</td></tr> + <tr><td><b>Alt+x </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> + +</table> + + + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Right-click</b> to set Tx frequency.<br/> + <b>Double-right-click</b> to set Rx and Tx frequencies. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> + and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> + Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> + own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">Dial Frequency:</td> + <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> + <b>Right-click</b> to increase frequency by 1 kHz.<br/> + <b>Left-click</b> to decrease frequency by 1 kHz.<br/> + The mouse pointer must be over the Dial Frequency indicator. + </td> + </tr> + <tr> + <td align="right">H Button:</td> + <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to activate or deactivate SuperFox mode. + </td> + </tr> + <tr> + <td align="right">FT8 Button:</td> + <td><b>Click</b> to switch to FT8 Hound Mode.<br/> + <b>Right-click</b> to toggle last used Special Operating Activity On/Off. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> + <tr> + <td align="right">Tx5 Button:</td> + <td><b>Right-click</b> to retain Tx5 free text. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Right-click</b> to freeze the state of the checkbox.<br/> + <b>Right-click on the FT8 Button</b> to unfreeze. + </td> + </tr> + <tr> + <td align="right">Enable Tx Button:</td> + <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> + <b>Right-click</b> to toggle Wait & Pounce On/Off after selecting<br/> + any CQ response mode other than CQ: None. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> + If <b>Alternate Erase button behavior</b> is checked:<br/> + <b>Click</b> to erase Band Activity window.<br/> + <b>Right-click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">DX Call Button:</td> + <td><b>Click</b> to toggle Wait & Call On/Off.<br/> + <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. + </td> + </tr> + <tr> + <td align="right">Lookup Button:</td> + <td><b>Click</b> to search for callsign in database.<br/> + <b>Right-click</b> to search for Dx Call on qrz.com. + </td> + </tr> + <tr> + <td align="right">Add Button:</td> + <td><b>Click</b> to add callsign and locator to database.<br/> + <b>Right-click</b> to search for Dx Call on hamqth.com. + </td> + </tr> + <tr> + <td align="right">Ignore Button:</td> + <td><b>Click</b> to add callsign to the Ignore List.<br/> + <b>Right-click</b> to search for Dx Call on qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Band Buttons:</td> + <td><b>Click</b> to toggle band / mode default frequencies.<br/> + <b>Right-click</b> to toggle FT8 DXpedition frequencies. + </td> + </tr> +</table> + + + + + Type 1 Prefixes: + + 1A 1S 3A 3B6 3B8 3B9 3C 3C0 3D2 3D2C 3D2R 3DA 3V 3W 3X + 3Y 3YB 3YP 4J 4L 4S 4U1I 4U1U 4W 4X 5A 5B 5H 5N 5R + 5T 5U 5V 5W 5X 5Z 6W 6Y 7O 7P 7Q 7X 8P 8Q 8R + 9A 9G 9H 9J 9K 9L 9M2 9M6 9N 9Q 9U 9V 9X 9Y A2 + A3 A4 A5 A6 A7 A9 AP BS7 BV BV9 BY C2 C3 C5 C6 + C9 CE CE0X CE0Y CE0Z CE9 CM CN CP CT CT3 CU CX CY0 CY9 + D2 D4 D6 DL DU E3 E4 EA EA6 EA8 EA9 EI EK EL EP + ER ES ET EU EX EY EZ F FG FH FJ FK FKC FM FO + FOA FOC FOM FP FR FRG FRJ FRT FT5W FT5X FT5Z FW FY M MD + MI MJ MM MU MW H4 H40 HA HB HB0 HC HC8 HH HI HK + HK0A HK0M HL HM HP HR HS HV HZ I IS IS0 J2 J3 J5 + J6 J7 J8 JA JDM JDO JT JW JX JY K KG4 KH0 KH1 KH2 + KH3 KH4 KH5 KH5K KH6 KH7 KH8 KH9 KL KP1 KP2 KP4 KP5 LA LU + LX LY LZ OA OD OE OH OH0 OJ0 OK OM ON OX OY OZ + P2 P4 PA PJ2 PJ7 PY PY0F PT0S PY0T PZ R1F R1M S0 S2 S5 + S7 S9 SM SP ST SU SV SVA SV5 SV9 T2 T30 T31 T32 T33 + T5 T7 T8 T9 TA TF TG TI TI9 TJ TK TL TN TR TT + TU TY TZ UA UA2 UA9 UK UN UR V2 V3 V4 V5 V6 V7 + V8 VE VK VK0H VK0M VK9C VK9L VK9M VK9N VK9W VK9X VP2E VP2M VP2V VP5 + VP6 VP6D VP8 VP8G VP8H VP8O VP8S VP9 VQ9 VR VU VU4 VU7 XE XF4 + XT XU XW XX9 XZ YA YB YI YJ YK YL YN YO YS YU + YV YV0 Z2 Z3 ZA ZB ZC4 ZD7 ZD8 ZD9 ZF ZK1N ZK1S ZK2 ZK3 + ZL ZL7 ZL8 ZL9 ZP ZS ZS8 KC4 E5 + +Type 1 Suffixes: /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /P + + MessageAveraging @@ -5893,8 +7755,8 @@ UDP server %2:%3 Modes - - + + Mode @@ -5902,7 +7764,7 @@ UDP server %2:%3 MultiSettings - + Default @@ -5910,62 +7772,62 @@ UDP server %2:%3 MultiSettings::impl - + &Switch To - + &Clone - + Clone &Into ... - + R&eset - + &Rename ... - + &Delete - + Clone Into Configuration - + Confirm overwrite of all values for configuration "%1" with values from "%2"? - + Reset Configuration - + Confirm reset to default values for configuration "%1"? - + Delete Configuration - + Confirm deletion of configuration "%1"? @@ -5973,17 +7835,17 @@ UDP server %2:%3 NameDialog - + New Configuration Name - + Old name: - + &New name: @@ -6009,12 +7871,12 @@ UDP server %2:%3 - + OmniRig: don't know how to set rig frequency - + OmniRig COM/OLE error: %1 at %2: %3 (%4) @@ -6040,35 +7902,30 @@ UDP server %2:%3 - + Too many colours in palette. - + Error reading waterfall palette file "%1:%2" too many colors. - + Error reading waterfall palette file "%1:%2" invalid triplet. - + Error reading waterfall palette file "%1:%2" invalid color. - + Error opening waterfall palette file "%1": %2. - - - Error writing waterfall palette file "%1": %2. - - QSYMessage @@ -6468,7 +8325,7 @@ Message - + MessageCreator @@ -6486,7 +8343,7 @@ Message - + QSY Monitor @@ -6613,62 +8470,62 @@ Error(%2): %3 SoundInput - + An error opening the audio input device has occurred. - + An error occurred during read from the audio input device. - + Non-recoverable error, audio input device not usable at this time. - + Requested input audio format is not valid. - + Requested input audio format is not supported on device. - + Failed to initialize audio sink device - + Idle - + Receiving - + Suspended - + Interrupted - + Error - + Stopped @@ -6676,90 +8533,114 @@ Error(%2): %3 SoundOutput - + An error opening the audio output device has occurred. - + An error occurred during write to the audio output device. - + Audio data not being fed to the audio output device fast enough. - + Non-recoverable error, audio output device not usable at this time. - + Requested output audio format is not valid. - + Requested output audio format is not supported on device. - + + Audio output restart attempt failed. + + + + + No audio output device configured. - + + No audio output stream is active. + + + + Idle - + Sending - + Suspended - + Interrupted - + Error - + Stopped + + SplashScreen + + + WSJT-X — Welcome + + + + + WSJT-X startup information. Press Escape to close. + + + StationDialog - + Add Station - + &Band: - + &Offset (MHz): - + &Antenna: @@ -6800,184 +8681,206 @@ Error(%2): %3 TCITransceiver - + ConnectionRefused - + RemoteHostClosed - + HostNotFound - + SocketAccess - + SocketResource - + SocketTimeout - + DatagramTooLarge - + Network - + AddressInUse - + SocketAddressNotAvailable - + UnsupportedSocketOperation - + UnfinishedSocketOperation - + ProxyAuthenticationRequired - + SslHandshakeFailed - + ProxyConnectionRefused - + ProxyConnectionClosed - + ProxyConnectionTimeout - + ProxyNotFound - + ProxyProtocol - + Operation - + SslInternal - + SslInvalidUserData - + Temporary - + UnknownSocket - + + UnknownSocketError + + + + TCI websocket error: %1 - + TCI SDR could not be switched on - + TCI SDR is not switched on - + TCI RX2 could not be enabled - + TCI Audio could not be switched on - - + + TCI could not be opened - - + + + + TCI sent an invalid VFO frequency + + + + + TCI failed to set ptt - + TCI should use PTT via CAT - - + + TCI failed set rxfreq - - + + TCI failed set mode - + TCI modulator not Idle + + + TCI source commitment; playout evidence is protocol-send dead reckoning, not DAC confirmation + + + + + TCI WebSocket send progress; no radio DAC or RF playback confirmation + + TransceiverBase @@ -6995,225 +8898,230 @@ Error(%2): %3 - + Spectrum gain - + <html><head/><body><p>Enter definition for a new color palette.</p></body></html> - + Adjust... - + Total power (dB) - + Waterfall gain - + <html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html> - + % - + Spec - + <html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html> - + Flatten - - <html><head/><body><p>Compute and save a reference spectrum. (Not yet fully implemented.)</p></body></html> - - - - + Ref Spec - + Smoothing of Linear Average spectrum - + Smooth - + Compression factor for frequency scale - + + <html><head/><body><p>Controls</p></body></html> + + + + Bins/Pixel - - + + <html><head/><body><p>Position of time stamp above each interval line</p></body></html> - + Time stamp - - + + Off - + Left - + Right - + Palette - + Select waterfall palette - + Bars - + Freq - + + <html><head/><body><p>Apply a saved reference spectrum to flatten the received passband. Available after a reference spectrum has been measured. (Not yet fully implemented.)</p></body></html> + + + + <html><head/><body><p>Select data for spectral display</p></body></html> - + Current - + Cumulative - + Linear Avg - + Reference - + Q65_Sync - + <html><head/><body><p>Frequency at left edge of waterfall</p></body></html> - + Hz - + Start - + <html><head/><body><p>Decode JT9 only above this frequency</p></body></html> - + Hz - + Split - + Number of FFTs averaged (controls waterfall scrolling rate) - + N Avg - + Waterfall zero - + Spectrum zero - + User Defined - + Wide Graph - - + + Read Palette @@ -7221,22 +9129,22 @@ Error(%2): %3 WorkedBefore - + Invalid ADIF field %0: %1 - + Malformed ADIF field %0: %1 - + Invalid ADIF header - + Error opening ADIF log file for read: %0 @@ -7279,7 +9187,7 @@ Error(%2): %3 - + <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> @@ -7294,198 +9202,188 @@ Error(%2): %3 - + IARU Region: - + <html><head/><body><p>Select your IARU region.</p></body></html> - + Message generation for type 2 compound callsign holders: - + <html><head/><body><p>Type 2 compound callsigns are those with prefixes or suffixes not included in the allowed shortlist (See Help-&gt;Add-on prefixes and suffixes).</p><p>This option determines which generated messages should contain your full type 2 compound call sign rather than your base callsign. It only applies if you have a type 2 compound callsign.</p><p>This option controls the way the messages that are used to answer CQ calls are generated. Generated messages 6 (CQ) and 5 (73) will always contain your full callsign. The JT65 and JT9 protocols allow for some standard messages with your full call at the expense of another piece of information such as the DX call or your locator.</p><p>Choosing message 1 omits the DX callsign which may be an issue when replying to CQ calls. Choosing message 3 also omits the DX callsign and many versions of this and other software will not extract the report. Choosing neither means that your full callsign only goes in your message 5 (73) so your QSO partner may log the wrong callsign.</p><p>None of these options are perfect, message 3 is usually best but be aware your QSO partner may not log the report you send them.</p></body></html> - + Full call in Tx1 - + Full call in Tx3 - + Full call in Tx5 only - + Display - + Show outgoing transmitted messages in the Rx frequency window. - + &Tx messages to Rx frequency window - + Show if decoded stations are new DXCC entities or worked before. - + <html><head/><body><p>Check to have decodes for a new period start at the top of the Band Activity window and not scroll off the top when the window is full.</p><p>This is to aid selecting decodes to double-click while decoding is still in progress. Use the Band Activity vertical scroll bar to reveal decodes past the bottom of the window.</p></body></html> - + Start new period decodes at top - + Set the font characteristics for the application. - + Font... - + Set the font characteristics for the Band Activity and Rx Frequency areas. - + Decoded Text Font... - + Include a separator line between periods in the band activity window. - + &Blank line between decoding periods - + Show distance to DX station in miles rather than kilometers. - + Display dista&nce in miles - + Behavior - + Decode after EME delay - + <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> - + Disabled - + minutes - + Single decode - - <html><head/><body><p>Some rigs are not able to process CAT commands while transmitting. This means that if you are operating in split mode you may have to uncheck this option.</p></body></html> - - - - - Allow Tx frequency changes while transmitting - - - - + Don't start decoding until the monitor button is clicked. - + Mon&itor off at startup - + <html><head/><body><p>Check this if you wish to automatically return to the last monitored frequency when monitor is enabled, leave it unchecked if you wish to have the current rig frequency maintained.</p></body></html> - + Monitor returns to last used frequency - + Alternate F1-F6 bindings - + Turns off automatic transmissions after sending a 73 or any other free text message. - + Di&sable Tx after sending 73 - + Send a CW ID after every 73 or free text message. - + CW ID a&fter 73 - + Send a CW ID periodically every few minutes. This might be required under your countries licence regulations. It will not interfere with other users as it is always sent in the @@ -7493,598 +9391,628 @@ quiet period when decoding is done. - + Automatic transmission mode. - + Show &DXCC, grid, and worked-before status - + Highlight DX Grid in message - + Show DXCC for all messages - + Show the separator line between periods with time stamp of the decode period. - + Show blank line with time stamp - + Show principal prefix instead of country name - + Highlight DX Call in message - + Doubl&e-click on call sets Tx enable - + <html><head/><body><p>Open the Astronomical Data window automatically when switching to Q65 or JT65 mode and Decode after EME delay is enabled, and close it when no longer needed.</p><p>Open the QSYMessage Creator automatically if the VHF Features are enabled and such QSY messages are applicable.</p></body></html> - + Auto-open/close Astronomical data window - + Calling CQ forces Call 1st - + <html><head/><body><p>Tx until 73 is received when in MSK144 or Q65 mode. </p></body></html> - + MSK144/Q65: Tx until 73 is received - + <html><head/><body><p>Allow kHz frequency offset entry without 'k' suffix.</p></body></html> - + kHz entry without k (restart required) - + + <html><head/><body><p>Allow automatic Doppler tracking and split/Fake It/XIT to correct the transmit frequency while transmitting, including corrections of tens of kHz on microwave bands.</p><p>This option does not allow nominal dial or band changes while transmitting or tuning. Leave it unchecked if your rig cannot accept frequency-setting CAT commands while transmitting; WSJT-X will then make one midpoint Doppler correction before transmission starts.</p></body></html> + + + + + Allow Tx-frequency corrections while transmitting + + + + <html><head/><body><p>Disable the Tune watchdog.</p></body></html> - + Tune watchdog - + <html><head/><body><p>Number of seconds before Tune is aborted</p></body></html> - + + Tune watchdog timeout + + + + seconds - + Tx watchdog: - + + Tx watchdog timeout + + + + ID Inter&val: - + + CW ID interval + + + + <html><head/><body><p>Turn the progress bar red while transmitting.</p></body></html> - + Turn progress bar red while transmitting - + Additional features - + Set Rx frequency to Tx frequency after QSO - + <html><head/><body><p>If a station sends locator, calculate and show the distance in Band Activity pane.</p></body></html> - + Show distance in messages with grid - + <html><head/><body><p>Erase Band Activity and Rx frequency windows after band change.</p></body></html> - + Erase decodes after band change - + Clear DX Grid after QSO - + Show U.S. States in messages with grid - + Map Grid locator to U.S. State - + <html><head/><body><p>Align the text for DXCC, distance and azimuth.</p></body></html> - + Align DXCC/distance/azimuth - + Alternate Erase button behavior - + Clear DX Call after QSO - + <html><head/><body><p>Increase or decrease the space between message text and DXCC.</p></body></html> + DXCC alignment spacing + + + + Enable Wait features - + <html><head/><body><p>If a station sends a valid Maidenhead locator, calculate and show the great-circle azimuth in Band Activity pane.</p></body></html> - + Show azimuth in messages with grid - + <html><head/><body><p>Increase or decrease the space between DXCC and distance/azimuth.</p></body></html> - + + Distance and azimuth alignment spacing + + + + Less button coloring (restart required) - + &Radio - + Radio interface configuration settings. - + <html><head/><body><p>Use only VFO A for split operation (the program temporarily changes the QRG of your rig during transmission).</p></body></html> - + <html><head/><body><p>Use VFO A+B for split operation (works with many rigs, but requires the use of both VFOs).</p></body></html> - + <html><head/><body><p>Don't use split (not recommended).</p></body></html> - + Settings that control your CAT interface. - + CAT Control - - + + Port: - + Serial port used for CAT control. - - + + Serial Port Parameters - + Baud Rate: - + Serial port data rate which must match the setting of your radio. - + 1200 - + 2400 - + 4800 - + 9600 - + 19200 - + 38400 - + 57600 - + 115200 - + <html><head/><body><p>Number of data bits used to communicate with your radio's CAT interface (usually eight).</p></body></html> - + Data Bits - + D&efault - + Se&ven - + E&ight - + <html><head/><body><p>Number of stop bits used when communicating with your radio's CAT interface</p><p>(consult you radio's manual for details).</p></body></html> - + Stop Bits - - + + Default - + On&e - + T&wo - + <html><head/><body><p>Flow control protocol used between this computer and your radio's CAT interface (usually &quot;None&quot; but some require &quot;Hardware&quot;).</p></body></html> - - + + Handshake - + &None - + Software flow control (very rare on CAT interfaces). - + XON/XOFF - + Flow control using the RTS and CTS RS-232 control lines not often used but some radios have it as an option and a few, particularly some Kenwood rigs, require it). - + &Hardware - + Special control of CAT port control lines. - - + + Force Control Lines - - + + High - - + + Low - + DTR: - + RTS: - - How this program activates the PTT on your radio? - - - - + PTT Method - + <html><head/><body><p>No PTT activation, instead the radio's automatic VOX is used to key the transmitter.</p><p>Use this if you have no radio interface hardware.</p></body></html> - + VO&X - + <html><head/><body><p>Use the RS-232 DTR control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The DTR control line of the CAT serial port may be used for this or a DTR control line on a different serial port may be used.</p></body></html> - + &DTR - + Some radios support PTT via CAT commands, use this option if your radio supports it and you have no other hardware interface for PTT. - + C&AT - + <html><head/><body><p>Use the RS-232 RTS control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The RTS control line of the CAT serial port may be used for this or a RTS control line on a different serial port may be used. Note that this option is not available on the CAT serial port when hardware flow control is used.</p></body></html> - + R&TS - + <html><head/><body><p>Select the RS-232 serial port utilised for PTT control, this option is available when DTR or RTS is selected above as a transmit method.</p><p>This port can be the same one as the one used for CAT control.</p><p>For some interface types the special value CAT may be chosen, this is used for non-serial CAT interfaces that can control serial port control lines remotely (OmniRig for example).</p></body></html> - + Modulation mode selected on radio. - + Mode - + <html><head/><body><p>USB is usually the correct modulation mode,</p><p>unless the radio has a special data or packet mode setting</p><p>for AFSK operation.</p></body></html> - + US&B - + Don't allow the program to set the radio mode (not recommended but use if the wrong mode or bandwidth is selected). - - + + None - + If this is available then it is usually the correct mode for this program. - + Data/P&kt - + Some radios can select the audio input using a CAT command, this setting allows you to select which audio input will be used (if it is available then generally the Rear/Data option is best). - + Transmit Audio Source - + Rear&/Data - + &Front/Mic - + Rig: - + Poll Interval: - + <html><head/><body><p>Interval to poll rig for status. Longer intervals will mean that changes to the rig will take longer to be detected.</p></body></html> - + s - + <html><head/><body><p>Attempt to connect to the radio with these settings.</p><p>The button will turn green if the connection is successful or red if there is a problem.</p></body></html> - + Test CAT - + Attempt to activate the transmitter. Click again to deactivate. Normally no power should be output since there is no audio being generated at this time. @@ -8093,47 +10021,47 @@ radio interface behave as expected. - + Test PTT - + Split Operation - + Fake It - + Rig - + A&udio - + Audio interface settings - + Souncard - + Soundcard - + Select the audio CODEC to use for transmitting. If this is your default device for system sounds then ensure that all system sounds are disabled otherwise @@ -8142,76 +10070,76 @@ transmitting periods. - + <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> - + Outgoing interfaces: - + <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> - + <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> - + Multicast TTL: - + Days since last upload - + Select the audio CODEC to use for receiving. - + &Input: - + Select the channel to use for receiving. - - + + Mono - - + + Left - - + + Right - - + + Both - + Select the audio channel used for transmission. Unless you have multiple radios connected on different channels; then you will usually want to select mono or @@ -8219,308 +10147,336 @@ both here. - + Enable VHF and submode features - + Data bits - + Stop bits - - + + Update Hamlib - + 32-bit - + <html><head/><body><p>Revert the last Hamlib update. </p><p>Note: This function is only available on Windows.</p></body></html> - + Revert Update - - <html><head/><body><p>Download the latest libhamlib-4.dll file from https://n0nb.users.sourceforge.net/. </p><p>Note: This function is only available on Windows.</p></body></html> - - - - + In use: - + Backed up: - + 64-bit - + Rig Data - + <html><head/><body><p>Stop transmitting immediately when SWR exceeds 2.5.</p></body></html> - + Halt Tx when SWR > 2.5 - + <html><head/><body><p>Read and display transmit PWR and SWR of your rig.</p></body></html> - + Read and display PWR and SWR - + Ou&tput: - + + Output audio channel + + + + + Input audio channel + + + + <html><head/><body><p>Refresh audio device list.</p></body></html> - + Refresh - + <html><head/><body><p>Use TCI Audio when available.</p></body></html> - + Use TCI Audio (restart required) - + <html><head/><body><p>Rx audio level</p></body></html> - + + TCI receive audio level + + + + Rx - + <html><head/><body><p>Sort audio device names alphabetically.</p></body></html> - + Sort alphabetically - + <html><head/><body><p>Hide the usually unusable ALSA CARD subdevices on Linux.</p></body></html> - + Hide ALSA CARD subdevices (Linux only) - - + + Save Directory - + Loc&ation: - + Path to which .WAV files are saved. - - + + TextLabel - + Click to select a different save directory for .WAV files. - + S&elect - - + + AzEl Directory - + Location: - + Select - + <html><head/><body><p>Enables additional line in azel.dat for Dpol parameter.</p></body></html> - + Enable extra line in azel.dat - + Power Memory By Band - + Remember power settings by band - + Enable power memory during transmit - + Transmit - + Enable power memory during tuning - + Tune - + Tx &Macros - + Canned free text messages setup - + + New &macro: + + + + &Add - - &Delete + + Add Tx macro - - Drag and drop items to rearrange order -Right click for item specific actions -Click, SHIFT+Click and, CRTL+Click to select items + + Adds the entered message to the saved Tx macro list. + + + + + New Tx macro message + + + + + Enter a saved free-text message for the Tx5 dropdown. Free-text messages are limited to 13 characters including spaces. + + + + + &Delete - + Reportin&g - + Reporting and logging settings - + Logging - + <html><head/><body><p>Check this option to note any Special Operating Activity in the comments field.</p></body></html> - + Special operating activity to comments - + The program will pop up a partially completed Log QSO dialog when you send a 73 or free text message. - + Promp&t me to log QSO - + <html><head/><body><p>Log 'ZZ00' as grid if the other station doesn't send you a grid.</p></body></html> - + Fill missing grids with 'ZZ00' - + Op Call: - + Some logging programs will not accept the type of reports saved by this program. Check this option to save the sent and received reports in the @@ -8528,1072 +10484,1338 @@ comments field. - + d&B reports to comments - + <html><head/><body><p>Some logging programs will not accept WSJT-X mode names.</p></body></html> - + Con&vert mode to RTTY - + <html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html> - + + <html><head/><body><p>Download the latest libhamlib-4.dll file from Hamlib SourceForge snapshots. </p><p>Note: This function is only available on Windows.</p></body></html> + + + + + Delete Tx macro + + + + + Deletes the selected Tx macro, or the focused macro if no row is selected. + + + + + Move &Up + + + + + Move Tx macro up + + + + + Moves the selected Tx macro one position earlier in the list. + + + + + Move D&own + + + + + Move Tx macro down + + + + + Moves the selected Tx macro one position later in the list. + + + + + Drag and drop items to rearrange order +Right click for item specific actions +Click, SHIFT+Click and, CTRL+Click to select items + + + + + Saved Tx macro messages + + + + + Saved free-text messages for the main window Tx5 dropdown. Use Move Up and Move Down or drag and drop to reorder messages. + + + + <html><head/><body><p>Check to have QSOs logged automatically, when complete.</p></body></html> - + Network Services - + <html><head/><body><p>The program can send your station details and all decoded signals with grid squares as spots to the http://pskreporter.info web site.</p><p>This is used for reverse beacon analysis which is very useful for assessing propagation and system performance.</p></body></html> - + Enable &PSK Reporter Spotting - + <html><head/><body><p>Check this option if a reliable connection is needed</p><p>Most users do not need this, the default uses UDP which is more efficient. Only check this if you have evidence that UDP traffic from you to PSK Reporter is being lost.</p></body></html> - + Use TCP/IP connection - + UDP Server - + UDP Server: - + <html><head/><body><p>Optional hostname of network service to receive decodes.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the broadcasting of UDP status updates.</p></body></html> - + UDP Server port number: - + <html><head/><body><p>With this enabled WSJT-X will accept certain requests back from a UDP server that receives decode messages.</p></body></html> - + Accept UDP requests - + <html><head/><body><p>Indicate acceptance of an incoming UDP request. The effect of this option varies depending on the operating system and window manager, its intent is to notify the acceptance of an incoming UDP request even if this application is minimized or hidden.</p></body></html> - + Notify on accepted UDP request - + <html><head/><body><p>Restore the window from minimized if an UDP request is accepted.</p></body></html> - + Accepted UDP request restores window - + Secondary UDP Server (deprecated) - + <html><head/><body><p>When checked, WSJT-X will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html> - + Enable logged contact ADIF broadcast - + Server name or IP address: - + <html><head/><body><p>Optional host name of N1MM Logger+ program to receive ADIF UDP broadcasts. This is usually 'localhost' or ip address 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable broadcasting of ADIF information via UDP.</p></body></html> - + Server port number: - + <html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html> - + Frequencies - + Default frequencies and band specific station details setup - + <html><head/><body><p>See &quot;Frequency Calibration&quot; in the WSJT-X User Guide for details of how to determine these parameters for your radio.</p></body></html> - + Frequency Calibration - + Slope: - + ppm - + Intercept: - + Hz - + Working Frequencies - + + + Insert, delete, load, save, merge, or reset working frequencies. + + + + + Working frequencies actions + + + + + + + Actions... + + + + <html><head/><body><p>Right click to maintain the working frequencies list.</p></body></html> - + Station Information - - Items may be edited. -Right click for insert and delete options. + + + Insert or delete station information rows. - - Colors + + Station information actions - - Decode Highlightling + + Items may be edited. +Right click for insert and delete options. - - Reset Highlighting to WSJT-X default + + Colors - - Reset Highlighting to WSJT-X Improved default + + Decode Highlightling - + <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> - + Rescan ADIF Log - + <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> - + <html><head/><body><p>Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.</p><p>Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.</p></body></html> - + <html><head/><body><p>Check to indicate new DXCC entities, grid squares, and callsigns per mode.</p></body></html> - + Highlight by Mode - + Include extra WAE entities - + Check to for grid highlighting to only apply to unworked grid fields - + Only grid Fields sought - + <html><head/><body><p>Controls for Logbook of the World user lookup.</p></body></html> - + Logbook of the World User Validation - + Users CSV file URL: - + <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> - - URL - - - - + <html><head/><body><p>Push this button to fetch the latest LotW user's upload date and time data file.</p></body></html> - + Fetch Now - + Age of last upload less than: - + <html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html> - + days - + Advanced - + <html><head/><body><p>User-selectable parameters for JT65 VHF/UHF/Microwave decoding.</p></body></html> - + JT65 VHF/UHF/Microwave decoding parameters - + Random erasure patterns: - + <html><head/><body><p>Maximum number of erasure patterns for stochastic soft-decision Reed Solomon decoder is 10^(n/2).</p></body></html> - + Aggressive decoding level: - + <html><head/><body><p>Higher levels will increase the probability of decoding, but will also increase probability of a false decode.</p></body></html> - + Two-pass decoding - + <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> - - + + Hound - + <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> - + NA VHF Contest - + <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> - - + + Fox - + <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> - - + + EU VHF Contest - - R T T Y Roundup - - - - - RTTY Roundup exchange - - - - + NJ - - + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> - - A R R L Field Day - - - - + + ARRL Field Day - + + Field Day exchange - + FD Exch: - + 6A SNJ - + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> - - WW Digital Contest - - - - + + WW Digi Contest - + Miscellaneous - + Degrade S/N of .wav file: - - + + For offline sensitivity tests - - + + dB - + Log automatically - + <html><head/><body><p>Use 'Log automatically' only for special operating activities.</p></body></html> - + Contesting only - + <html><head/><body><p>Shorten 6-digit grid entries and log 4-digit grids instead.</p></body></html> - + Log 4-digit grids - + Highlight also messages with 73 or RR73 - - - <html><head/><body><p>Highlight callsigns or grids with orange background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - - - - + Highlight orange: - - - <html><head/><body><p>Highlight callsigns or grids with blue background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - - - - + Highlight blue: - + http://lotw.arrl.org/lotw-user-activity.csv - + CTY File Download - + CTY File Version: - + Download Latest CTY.dat - + CALL3 File Download - + CALL3 File Version: - + Dowload latest CALL3.TXT file. - + Download CALL3.TXT for terrestrial use - + Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. - + Download CALL3.TXT for EME - + GUI tweaks for high-resolution monitors - + <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> - + HighDPI scaling (restart required) - + <html><head/><body><p>Increased height of some control elements.</p></body></html> - + Increased height of the tab widget (restart required) - - Enable Cloudlog Features - - - - + API URL: - + API Key: - - Station ID: - - - - - <html><head/><body><p>Test the Cloudlog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> - - - - - Test API Key - - - - + Special operating activity - + <html><head/><body><p>ARRL International Digital Contest</p></body></html> - + ARRL Digi Contest - + <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> - + NCCC Sprint - - + + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> - + + FT Roundup messages - + FT RU Exch: - + <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> - + SuperFox mode - + <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> - + Show OTP messages - + OTP URL: - + <html><head/><body><p>URL used to verify OTP codes.</p></body></html> - + https://www.9dx.cc - + NA VHF - + <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> - + OTP - + Key: - + <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> - + M2ZUU5CW6EVOY2HU - + Interval - + <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> - + <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> - + CQ with individual contest name - + Contest name: - + <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> - + Q65 Pileup - + Receiver bandwidth: - + + Change or reset colors for the selected highlighting rule. + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move Up + + + + + Move the selected highlighting rule later in priority order. + + + + + Move Down + + + + + Reset Highlighting to Default 1 + + + + + Reset Highlighting to Default 2 + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with orange background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with blue background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + LotW users CSV URL + + + + + + <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> + + + + + Cloudlog or Wavelog + + + + + + Upload QSOs to Cloudlog or Wavelog + + + + + + <html><head/><body><p>API URL for Cloudlog or Wavelog.</p></body></html> + + + + + + <html><head/><body><p>Your API key.</p></body></html> + + + + + + <html><head/><body><p>Your Cloudlog or Wavelog station profile.</p></body></html> + + + + + Station profile: + + + + + <html><head/><body><p>Check the Cloudlog or Wavelog connection, API key, station profile, and upload path where safe.</p><p>The button will turn green if the connection can upload QSOs, orange if the key is valid but read-only, and red if the configuration is unusable.</p></body></html> + + + + + Check Connection + + + + Hz - + Tx delay: - + Minimum delay between assertion of PTT and start of Tx audio. - + s - - + + Tone spacing - + <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> - + + 2x tone spacing + + + + x 2 - + <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> - + + 4x tone spacing + + + + x 4 - - + + Waterfall spectra - + Low sidelobes - + Most sensitive - + + + <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> + + + + + eQSL.cc + + + + + + Upload QSOs to eQSL.cc + + + + + + <html><head/><body><p>Your username.</p></body></html> + + + + + Username: + + + + + + <html><head/><body><p>Your logon password.</p></body></html> + + + + + Password: + + + + + + <html><head/><body><p>Your QTH nickname, if you have more than one QTH.</p></body></html> + + + + + QTH: + + + + + + Enable special operating activity + + + + + Enable OTP verification + + + + + + OTP key + + + + + + OTP interval + + + + + + OTP URL + + + + + + FT Roundup exchange + + + + + + Contest name + + + + Alerts - - Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. + + NOTES + + + + + "Wanted callsigns, grids, prefixes and directional calls" uses the entries from "Highlight orange" and "Highlight blue". + + + + + <html><head/><body><p>Wanted callsigns, grids, prefixes and directional calls. This alert category uses the entries from &quot;Highlight orange&quot; and &quot;Highlight blue&quot;.</p></body></html> - - THIS FEATURE IS FOR EXPERIENCED USERS ONLY + + Wanted callsigns, grids, prefixes and directional calls - + + IMPORTANT + + + + + Voices: + + + + + default + + + + + <html><head/><body><p>Test the alert sounds.</p></body></html> + + + + + Test + + + + + Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. + + + + Ensure that you have made meaningful settings on the Colors tab, so that you see which message triggered the alert. - + Ensure that your rig is NOT connected via "Default Device". - + Audio Alerts - - + + New ITU Zone on Band - - + + New Continent - - + + DX Call or DX Grid in message - - + + New Grid - - + + New Continent on Band - + Message received - - + + New ITU Zone - - + + New CQ Zone - - + + New DXCC on Band - + My Call in message - + My Call - - + + New CQ Zone on Band - - + + New DXCC - - + + New Grid on Band - - + + CQ in message - + Toggle Audio Alerts on/off. Alerts will be played on "DefaultAudioDevice". DON'T ENABLE AUDIO ALERTS WHEN YOUR RIG IS CONNECTED VIA THIS SOUNDCARD !!! - + Enable Audio Alerts - + This requirement is fulfilled when your rig is connected via USB audio. - + Audio Alerts will be played on the default audio device (usually the loudspeaker of your PC). - - IMPORTANT NOTES - - - - + Use of this feature requires that your computer is equipped with two sound cards. - + Filters - + Territories 1-4 for the Hide checkboxes in the View menu - + Blacklist - + Filters for the Band Activity window - + Hide messages containing the following callsigns or keywords: - + Show only messages containing the following callsigns or keywords: - + <html><head/><body><p>Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed).</p></body></html> - + Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed) - + Always pass messages with the following keywords: - + Whitelist - + <html><head/><body><p>Apply filters only to the callsigns of the calling stations. Usually the second word of the messages is analyzed, for directional calls the third word.</p></body></html> - + Apply filters only to the callsigns of the calling stations - + Always Pass - + <html><head/><body><p>Use “worked today and yesterday” instead of “worked today” for the 3 related Quick Filters.</p></body></html> - + Quick Filters: Hide/Ignore/Highlight "worked today and yesterday" instead of "worked today" (UTC) - + <html><head/><body><p>Discard (Cancel) or apply (OK) configuration changes including</p><p>resetting the radio interface and applying any soundcard changes</p></body></html> @@ -9601,53 +11823,114 @@ Right click for insert and delete options. main - + + Lock file: %1 + + + + + Owner process: %1 + + + + + Owner application: %1 + + + + + Owner host: %1 + + + + + Owner information is not available. + + + + + Remove error: %1 + + + + + Another instance may be running + + + + + WSJT-X could not lock its temporary instance file. + +If another WSJT-X window is still running, choose No. +Use a unique rig name to run more than one instance. + +If WSJT-X crashed or will not restart, choose Remove Lock File. +Choose Retry after closing the other instance. + + + + + Remove Lock File + + + + + Unable to remove stale lock file + + + + + Close any running WSJT-X instance or remove the lock file manually after confirming WSJT-X is not running. + + + + Failed to create a temporary directory - - + + Path: "%1" - + Failed to create a usable temporary directory - + Another application may be locking the directory - + Failed to create data directory - + path: "%1" - + Shared memory error - + Unable to create shared memory segment - + Sub-process error - + Failed to close orphaned jt9 process diff --git a/translations/wsjtx_en_GB.ts b/translations/wsjtx_en_GB.ts index f81006f0..e0719ab5 100644 --- a/translations/wsjtx_en_GB.ts +++ b/translations/wsjtx_en_GB.ts @@ -115,18 +115,17 @@ - - + Wanted only - + Message - + My call only @@ -134,149 +133,154 @@ Astro - - + + Doppler tracking - + <html><head/><body><p>One station does all Doppler shift correction, their QSO partner receives and transmits on the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> - + Full Doppler to DX Grid - + <html><head/><body><p>Transmit takes place on sked frequency and receive frequency is corrected for own echoes. </p><p>This mode can be used for calling CQ, or when using Echo mode.</p></body></html> - + Own Echo - + <html><head/><body><p>Both stations correct for Doppler shift such that they would be heard on the moon at the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p><p>Use this option also for Echo mode.</p></body></html> - + Constant frequency on Moon - + <html><head/><body><p>DX station announces their TX Freq, which is entered as the Sked Freq. Correction applied to RX and TX so you appear on the DX's station's own echo Freq.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> - + On DX Echo - + <html><head/><body><p>Tune radio manually and select this mode to put your echo on the same frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> - + Call DX - + <html><head/><body><p>No Doppler shift correction is applied. This may be used when the QSO partner does full Doppler correction to your grid square.</p></body></html> - + None - + Sked frequency - - + + 0 - - Rx: + + kHz - - Tx: + + Set kHz - - <html><head/><body><p>Press and hold the CTRL key to adjust the sked frequency manually with the rig's VFO dial or enter frequency directly into the band entry field on the main window.</p></body></html> + + <html><head/><body><p>Tx shift relative to Rx sked frequency</p></body></html> - - Echo Mode + + MHz - - Hz + + Tx Shift - - RIT + + Rx: - - Dither + + Tx: - - Tx Shift relative to Rx Sked Freq + + Echo Mode - - Enter large offset + + Hz - - MHz + + RIT - - Shift + + Enable - - Enable + + Dither - + + Ctl-Lock Sked Freq + + + + Astro Data - + Astronomical Data @@ -396,6 +400,166 @@ + + Cloudlog + + + + QSO could not be sent to Cloudlog. + + + + + + QSO upload was rejected by Cloudlog. + + + + + HTTP status %1. Response was not JSON. + + + + + Cloudlog returned an unexpected upload response. + + + + + Cloudlog reported upload status: %1 + + + + + HTTP status %1. + + + + + Cloudlog::impl + + + Enter a Cloudlog or Wavelog URL. + + + + + The connection check needs a base URL before it can contact the API. + + + + + Cloudlog or Wavelog authentication endpoint was not found. + + + + + Tried /api/check_auth, /index.php/api/check_auth, and /index.php/api/auth. + + + + + API key is valid but read-only. + + + + + Generate a read/write API key before enabling QSO uploads. + + + + + API key is invalid. + + + + + Authentication response was not usable. + + + + + Station profile response was not JSON. + + + + + Configured station profile was not found. + + + + + No station profiles were returned by the server. + + + + + Available station profiles: %1 + + + + + Wavelog dry-run QSO endpoint was not found. + + + + + Tried /api/qso/true and /index.php/api/qso/true after Wavelog was identified. + + + + + Dry-run upload response was not usable. + + + + + + Connection check passed. + + + + + Writable API key, station profile, and dry-run QSO upload were validated. + + + + + Dry-run QSO upload was rejected. + + + + + + The QSO dry-run upload was rejected. + + + + + Dry-run QSO upload returned an unexpected response. + + + + + Writable API key and station profile were validated. No safe dry-run QSO endpoint was identified, so no test QSO was uploaded. + + + + + Network error while checking Cloudlog or Wavelog. + + + + + Cloudlog Error! + + + + + Reason: %1 + + + ColorHighlighting @@ -502,415 +666,634 @@ Configuration::impl - - - + + + &Delete - - + + &Insert ... - - Failed to create save directory + + Wanted territory %1 - - path: "%1% + + Blacklist keyword %1 - - Failed to create samples directory + + Whitelist keyword %1 - - path: "%1" + + Always pass keyword %1 - - API key OK + + CAT control port - - API key read-only + + CAT baud rate - - API key invalid + + Default CAT data bits - - &Load ... + + Seven CAT data bits - - &Save as ... + + Eight CAT data bits - - &Merge ... + + Default CAT stop bits - - &Reset + + One CAT stop bit - - Serial Port: + + Two CAT stop bits - - Serial port used for CAT control + + Default CAT handshake - - TCI Server: + + No CAT handshake - - Optional hostname and port of TCI service. -Leave blank for a sensible default on this machine. -Formats: - hostname:port - IPv4-address:port - [IPv6-address]:port + + XON/XOFF CAT handshake - - Network Server: + + Hardware CAT handshake - - Optional hostname and port of network service. -Leave blank for a sensible default on this machine. -Formats: - hostname:port - IPv4-address:port - [IPv6-address]:port + + Force DTR control line - - USB Device: + + Force RTS control line - - Optional device identification. -Leave blank for a sensible default for the rig. -Format: - [VID[:PID[:VENDOR[:PRODUCT]]]] + + VOX PTT method - - - Invalid audio input device + + DTR PTT method - - Invalid audio output device + + CAT PTT method - - Invalid PTT method + + RTS PTT method - - Invalid PTT port + + PTT control port - - - Invalid Contest Exchange + + Rear or data transmit audio source - - You must input a valid ARRL Field Day exchange + + Front or mic transmit audio source - - You must input a valid ARRL RTTY Roundup exchange + + No radio mode control - - Pending DNS lookup, please try again later + + USB radio mode - - - Reset Decode Highlighting + + Data or packet radio mode - - - Reset all decode highlighting and priorities to default values + + No split operation - - Error Loading CTY.DAT + + Rig split operation - - Error Loading CALL3.TXT file + + Fake It split operation - - WSJT-X Decoded Text Font Chooser + + CAT poll interval - - - Hamlib update only available on Windows. + + Frequency calibration slope - - Error Loading libhamlib-4.dll + + Frequency calibration intercept - - Hamlib Update successful - -New Hamlib will be used after restart + + Working frequencies table - - Hamlib successfully reverted - -Reverted Hamlib will be used after restart + + Station information table - - No Hamlib update found that could be reverted + + Decode highlighting rules - - Error in network address + + Highlighting rules and priorities for decoded messages. - - UDP server DNS lookup failed + + Decode highlighting actions - - MAC-ambiguous multicast groups addresses not supported + + Change or reset colors for the selected highlighting rule. - - Load Working Frequencies + + Move selected highlighting rule up - - - - Frequency files (*.qrg *.qrg.json);;All files (*.*) + + Move the selected highlighting rule earlier in priority order. - - Replace Working Frequencies + + Move selected highlighting rule down - - Are you sure you want to discard your current working frequencies and replace them with the loaded ones? + + Move the selected highlighting rule later in priority order. - - Merge Working Frequencies + + Orange highlight callsigns and grids - - Error reading frequency file + + Blue highlight callsigns and grids - - - - Not a valid frequencies file + + Failed to create save directory - - Incorrect file magic + + path: "%1% - - Version is too new + + Failed to create samples directory - - Contents corrupt + + path: "%1" - - Save Working Frequencies + + Reset all decode highlighting and priorities to Default 1 values - - Only Save Selected Working Frequencies + + Reset all decode highlighting and priorities to Default 2 values - - Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. + + &Load ... - - Reset Working Frequencies + + &Save as ... - - Are you sure you want to discard your current working frequencies and replace them with default ones? + + &Merge ... - - Save Directory + + &Reset - - AzEl Directory + + Serial Port: - - Rig control error + + Serial port used for CAT control - - Failed to open connection to rig + + TCI Server: - - Rig failure + + Optional hostname and port of TCI service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port - - Not found - audio device missing + + Network Server: - - - DXLabSuiteCommanderTransceiver - - Failed to connect to DX Lab Suite Commander - + + Optional hostname and port of network service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port - - DX Lab Suite Commander didn't respond correctly reading frequency: + + USB Device: - - DX Lab Suite Commander sent an unrecognised TX state: + + Optional device identification. +Leave blank for a sensible default for the rig. +Format: + [VID[:PID[:VENDOR[:PRODUCT]]]] - - DX Lab Suite Commander didn't respond correctly polling TX status: + + + Invalid audio input device - - Transceiver did not respond to PTT On/Off quickly enough; -reduce DX Lab Suite Commander's 'Command Interval' setting -or contact DXLab support at DXLab@groups.io. + + Invalid audio output device - - DX Lab Suite Commander didn't respond correctly polling frequency: + + Invalid PTT method - - DX Lab Suite Commander didn't respond correctly polling TX frequency: + + Invalid PTT port - - DX Lab Suite Commander sent an unrecognised split state: + + + Invalid Contest Exchange - - DX Lab Suite Commander didn't respond correctly polling split status: + + You must input a valid ARRL Field Day exchange - - DX Lab Suite Commander sent an unrecognised mode: " + + You must input a valid ARRL RTTY Roundup exchange - - DX Lab Suite Commander didn't respond correctly polling mode: + + Pending DNS lookup, please try again later - - DX Lab Suite Commander send command failed - + + + Reset Decode Highlighting + + + + + Error Loading CTY.DAT + + + + + Error Loading CALL3.TXT file + + + + + WSJT-X Decoded Text Font Chooser + + + + + + Hamlib update only available on Windows. + + + + + Error Loading libhamlib-4.dll + + + + + Hamlib Update successful + +New Hamlib will be used after restart + + + + + Hamlib successfully reverted + +Reverted Hamlib will be used after restart + + + + + No Hamlib update found that could be reverted + + + + + Error in network address + + + + + UDP server DNS lookup failed + + + + + MAC-ambiguous multicast groups addresses not supported + + + + + Load Working Frequencies + + + + + + + Frequency files (*.qrg *.qrg.json);;All files (*.*) + + + + + Replace Working Frequencies + + + + + Are you sure you want to discard your current working frequencies and replace them with the loaded ones? + + + + + Merge Working Frequencies + + + + + Error reading frequency file + + + + + + + Not a valid frequencies file + + + + + Incorrect file magic + + + + + Version is too new + + + + + Contents corrupt + + + + + Save Working Frequencies + + + + + Only Save Selected Working Frequencies + + + + + Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. + + + + + Reset Working Frequencies + + + + + Are you sure you want to discard your current working frequencies and replace them with default ones? + + + + + Save Directory + + + + + AzEl Directory + + + + + Rig control error + + + + + Failed to open connection to rig + + + + + Rig failure + + + + + Not found + audio device missing + + + + + DXLabSuiteCommanderTransceiver + + + Failed to connect to DX Lab Suite Commander + + + + + + DX Lab Suite Commander didn't respond correctly reading frequency: + + + + + DX Lab Suite Commander sent an unrecognised TX state: + + + + + DX Lab Suite Commander didn't respond correctly polling TX status: + + + + + Transceiver did not respond to PTT On/Off quickly enough; +reduce DX Lab Suite Commander's 'Command Interval' setting +or contact DXLab support at DXLab@groups.io. + + + + + DX Lab Suite Commander didn't respond correctly polling frequency: + + + + + DX Lab Suite Commander didn't respond correctly polling TX frequency: + + + + + DX Lab Suite Commander sent an unrecognised split state: + + + + + DX Lab Suite Commander didn't respond correctly polling split status: + + + + + DX Lab Suite Commander sent an unrecognised mode: " + + + + + DX Lab Suite Commander didn't respond correctly polling mode: + + + + + DX Lab Suite Commander send command failed + @@ -944,32 +1327,32 @@ or contact DXLab support at DXLab@groups.io. - + Choose %1 Foreground Color - + &Unset foreground color - + &Background color ... - + Choose %1 Background Color - + U&nset background color - + &Reset this item to defaults @@ -1057,17 +1440,17 @@ or contact DXLab support at DXLab@groups.io. - + f/g unset - + b/g unset - + Highlight Type @@ -1075,41 +1458,56 @@ or contact DXLab support at DXLab@groups.io. Designer - + &Delete - + &Insert ... - + Insert &after ... - + Import Palette - - + + Palettes (*.pal) + Import Palette Failed + + + + Export Palette + + + Export Palette Failed + + + + + Error writing waterfall palette file "%1": %2. + + Dialog - + Gray time: @@ -1210,16 +1608,31 @@ Error: %2 - %3 DisplayText - + &Erase + + + Return to live activity + + + + + Return to the live activity position + + + + + Live activity is paused while earlier entries are visible. + + EchoGraph - + Echo Graph @@ -1292,7 +1705,7 @@ Error: %2 - %3 EmulateSplitTransceiver - + Emulated split mode requires rig to be in simplex mode @@ -1379,12 +1792,12 @@ Error: %2 - %3 ExistingNameDialog - + Configuration to Clone From - + &Source Configuration Name: @@ -1522,7 +1935,7 @@ Error: %2 - %3 FastGraph - + Fast Graph @@ -1574,84 +1987,235 @@ Error: %2 - %3 - FoxLog::impl + FixtureAudioInput - - Date & Time(UTC) + + Synthetic audio input has no detector sink. - - Call + + Synthetic FT8 audio input requires a downsample factor of 1 or 4. - - Grid + + Synthetic JTTY audio input requires a downsample factor of 1 or 4. - - Sent + + Synthetic audio input requires the mono input channel. - - Rcvd + + Unable to open synthetic audio fixture %1: %2 - - Band + + Synthetic audio fixture must be mono, signed 16-bit little-endian PCM. - - - FoxLogWindow - - Fox Log + + Synthetic audio fixture must be %1 Hz for downsample factor %2; found %3 Hz. - - <html><head/><body><p>Right-click here for available actions.</p></body></html> + + Synthetic FT8 audio fixture must contain exactly %1 frames; found %2. - - Callers: + + Synthetic JTTY audio fixture must contain complete PCM frames. - - - - N + + Unable to read all PCM data from synthetic audio fixture. - - In progress: + + Synthetic audio input does not yet support big-endian hosts. - - Rate: + + Unable to initialize the detector for synthetic audio input. - - <html><head/><body><p>Last 10: Average rate (QSOs/hour) for the last 10 QSOs.<br/>Last 100: Average rate (QSOs/hour) for the last 100 QSOs. <br/>Last 60m: Average rate (QSOs/hour) for the last 60 minutes.</span></p></body></html> + + Synthetic audio fixture ready - - &Export ADIF ... + + Synthetic audio input suspended - + + Synthetic audio input receiving + + + + + Detector accepted %1 of %2 synthetic PCM bytes. + + + + + Synthetic audio fixture exhausted + + + + + FixtureSoundOutput + + + Synthetic audio output requires a readable source. + + + + + Synthetic audio output requires a capture path. + + + + + Synthetic audio output does not yet support big-endian hosts. + + + + + Synthetic audio output received an unsupported source frame size. + + + + + Unable to open synthetic audio output capture %1: %2 + + + + + Synthetic audio output received a partial captured frame. + + + + + Synthetic FT8 audio output exceeded its 15-second capture period. + + + + + Synthetic audio output wrote %1 of %2 capture bytes: %3 + + + + + Synthetic audio output source disappeared during capture. + + + + + Synthetic FT8 audio output continued beyond its 15-second capture period. + + + + + Synthetic audio output received %1 of %2 source bytes. + + + + + Synthetic audio output received an invalid source byte count. + + + + + FoxLog::impl + + + Date & Time(UTC) + + + + + Call + + + + + Grid + + + + + Sent + + + + + Rcvd + + + + + Band + + + + + FoxLogWindow + + + Fox Log + + + + + <html><head/><body><p>Right-click here for available actions.</p></body></html> + + + + + Callers: + + + + + + + N + + + + + In progress: + + + + + Rate: + + + + + <html><head/><body><p>Last 10: Average rate (QSOs/hour) for the last 10 QSOs.<br/>Last 100: Average rate (QSOs/hour) for the last 100 QSOs. <br/>Last 60m: Average rate (QSOs/hour) for the last 60 minutes.</span></p></body></html> + + + + + &Export ADIF ... + + + + Export ADIF Log File @@ -1686,104 +2250,136 @@ Error: %2 - %3 + + FrequencyDeltaLineEdit + + + Offset in MHz + + + + + Frequency offset in MHz + + + + + Enter a frequency offset in MHz. + + + FrequencyDialog - + Add Frequency - + IARU &Region: - + &Mode: - + &Frequency (MHz): - + &Preferred for Band/Mode: - + &Description: - + &Enable Date Range: - + S&tart: - + &End: - + &Source: - + Invalid Date Range - + Start date must be before end date + + FrequencyLineEdit + + + + Frequency in MHz + + + + + Enter a positive frequency in MHz. + + + FrequencyList_v2_101 - + IARU Region - + Mode - + Frequency - + Frequency (MHz) - + Description - + Source @@ -1799,126 +2395,234 @@ Error: %2 - %3 - + Pref - + Start Date/Time - + End Date/Time - + Failed to parse JSON file - + Information Missing - + No Frequencies were found - + Loaded Frequencies from %1 - + Entries Valid/Skipped %1 + + Ft8TxLoopbackTestController + + + Timed out after 60 seconds. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + The FT8 output stream did not start exactly once. + + + + + The FT8 Auto control was not found. + + + + + Disabling Auto stopped the active FT8 transmission. + + + + + Synthetic output reported non-silent FT8 audio more than once. + + + + + The FT8 capture did not stop exactly once at the requested path. + + + + + Synthetic audio output failed: %1 + + + + + A required FT8 transmit GUI control was not found. + + + + + The application did not enter FT8 mode. + + + + + Unable to configure the requested FT8 transmission. + + + + + The FT8 transmit controls disappeared before transmission. + + + + + Unable to start the synthetic FT8 transmission. + + + + + The FT8 Auto control disappeared before retry. + + + + + The FT8 output lifecycle was not one start, non-silent transmission, and natural stop. + + + + + FT8 audio began at frame %1; expected %2 +/- %3 frames. + + + + + The FT8 capture file was not created or is empty: %1 + + + + + Unable to reopen FT8 capture %1: %2 + + + + + The FT8 capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The FT8 capture must contain exactly %1 frames; file=%2 reported=%3. + + + + + Unexpected modal window: %1 + + + HRDTransceiver - - + + Failed to connect to Ham Radio Deluxe - + Failed to open file "%1": %2. - - + + Ham Radio Deluxe: no rig found - + Ham Radio Deluxe: rig doesn't support mode - + Ham Radio Deluxe: sent an unrecognised mode - + Ham Radio Deluxe: item not found in %1 dropdown list - + Ham Radio Deluxe: button not available - + Ham Radio Deluxe didn't respond as expected - + Ham Radio Deluxe: rig has disappeared or changed - + Ham Radio Deluxe send command "%1" failed %2 - - + + Ham Radio Deluxe: failed to write command "%1" - - Ham Radio Deluxe sent an invalid reply to our command "%1" + + Ham Radio Deluxe sent an invalid reply to our command "%1": %2 - + Ham Radio Deluxe failed to reply to command "%1" %2 - + Ham Radio Deluxe retries exhausted sending command "%1" - + Ham Radio Deluxe didn't respond to command "%1" as expected @@ -1926,186 +2630,182 @@ Error: %2 - %3 HamlibTransceiver - - + + Hamlib initialisation error - + Hamlib settings file error: %1 at character offset %2 - + Hamlib settings file error: top level must be a JSON object - + Hamlib settings file error: config must be a JSON object - + Unsupported CAT type - + Hamlib error: %1 while %2 - + opening connection to rig - + getting current frequency - + getting current mode - - + + exchanging VFOs - - + + getting other VFO frequency - + getting other VFO mode - - + + setting current VFO - + getting frequency - + getting mode - - - + + + getting current VFO - - - - + + + + getting current VFO frequency - - - - - - + + + + + + setting frequency - - - - + + + + getting current VFO mode - - - - - + + + + + setting current VFO mode - - setting VFOB mode - - - - - + + setting/unsetting split mode - - + + setting split mode - + setting split TX frequency and mode - + setting split TX frequency - + getting split TX VFO mode - + setting split TX VFO mode - + getting PTT state - + setting PTT on - - + + setting PTT off - + setting a configuration item - + + getting a configuration item @@ -2140,3625 +2840,4506 @@ Error: %2 - %3 - LogQSO + JttyTxLoopbackTestController - - Click OK to confirm the following QSO: + + Timed out after 60 seconds. - - Call + + JTTY request %1 was accepted more than once. - - Start + + JTTY request %1 was rejected with reason %2. - - - dd/MM/yyyy HH:mm:ss + + JTTY request %1 completed more than once. - - End + + More than one JTTY transmit session drained. - - Mode + + Synthetic output opened the wrong capture path: %1 - - Band + + JTTY output stream restarted more than once. - - Rpt Sent + + Synthetic output reported non-silent playback more than once. - - Rpt Rcvd + + Synthetic output stopped the wrong capture path: %1 - - Grid + + JTTY output stream stopped more than once. - - Name + + Synthetic audio output failed: %1 - - Tx power + + The JTTY mode action was not found. - - <html><head/><body><p>Add comment to the comments list.</p></body></html> + + The application did not enter JTTY mode. - - Add + + The JTTY encoder did not produce a valid test waveform extent. - - - - - - - Retain + + The first JTTY text request was not accepted synchronously. - - Comments + + Non-silent playback began before the first request was accepted. - - Operator + + The output stream restarted or stopped before the gapless append. - - Exch sent + + The gapless append occurred before one second of real playback. - - Rcvd + + The second JTTY text request was not accepted during playback. - - Prop Mode + + Appending the second JTTY message restarted or stopped playback. - - Sat Mode + + The accepted-request set did not contain exactly both submitted messages. - - RX Frequency + + JTTY text requests were not accepted in submission order. - - Aircraft scatter + + The completed-request set did not contain exactly both submitted messages. - - Aurora-E + + JTTY text requests did not complete in FIFO order. - - Aurora + + The output stream lifecycle was not one start, one drain, and one stop. - - Back scatter + + The captured JTTY session contains an unexpected internal audio gap. - - Echolink + + The JTTY capture file was not created or is empty: %1 - - Earth-moon-earth + + Unable to reopen JTTY capture %1: %2 - - Sporadic E + + The JTTY capture is not 48 kHz mono signed 16-bit little-endian PCM. - - F2 Reflection + + The JTTY capture has an invalid PCM extent: file frames=%1, expected audio frames=%2, reported frames=%3. - - Field aligned irregularities + + Unexpected modal window: %1 + + + LiveAudioTestController - - Internet-assisted + + Timed out after 110 seconds. - - Ionoscatter + + Timed out after 100 seconds. - - IRLP + + Decoder backend failed: %1 - - Meteor scatter + + JTTY display did not settle to the expected text after input ended. - - Non-satellite repeater or transponder + + Synthetic audio source failed: %1 - - Rain scatter + + Unable to open expected decode file %1: %2 - - Tropospheric ducting + + Expected decode file %1 contains no messages. - - A + + Unable to open expected JTTY text file %1: %2 - - B + + Expected JTTY text file %1 contains no messages. - - BS + + A required FT8 decoder or monitoring GUI control was not found. - - JA + + Unable to configure the %1-%2 Hz waterfall decode range. - - JD + + Unable to prepare the complete FT8 fixture decode. - - K + + Unable to configure the FT8 multithreaded decoder as requested. - - KA + + Monitor did not enter the active state. - - KT + + Synthetic input unexpectedly selected the disk-data path. - - L + + Unable to arm the synthetic audio source. - - LS + + A required JTTY mode, monitoring, or decode display control was not found. - - LU + + The JTTY GUI action did not select JTTY mode. - - LX + + Monitor did not enter the active state for JTTY. - - S + + Synthetic JTTY input unexpectedly selected the disk-data path. - - SX + + Unable to arm the synthetic JTTY audio source. - - T + + The expected early standard and final configured MTD decoder invocations were not both observed. - - US + + The configured MTD invocation produced no decoder output. - - UV + + live MTD missing: %1 - - VS + + processed missing: %1 - - VU + + display missing: %1 - - - Satellite + + Reference-message validation failed: %1; live MTD output: %2; processed output: %3 - - Trans-equatorial + + Decoder messages were processed but none reached the GUI display path. - - - Invalid QSO Data + + The expected JTTY messages did not reach both panes in FIFO order. - - Check exchange sent and received + + The expected JTTY message reached both panes without an observed growing prefix. - - Check all fields + + Unexpected modal window: %1 + + + LogQSO - - Log file error + + Click OK to confirm the following QSO: - - Cannot open "%1" for append + + Call - - Error: %1 + + Start - - - MainWindow - - WSJT-X by K1JT + + + dd/MM/yyyy HH:mm:ss - - - - - - - - - - Band Activity + + End - - - UTC dB DT Freq Dr + + Mode - - - - - - - - Rx Frequency + + Band - - CQ only + + Rpt Sent - - Enter this QSO in log + + Rpt Rcvd - - Log &QSO + + Grid - - Stop monitoring + + Name - - &Stop + + Tx power - - &Monitor + + <html><head/><body><p>Add comment to the comments list.</p></body></html> - - <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> + + Add - - Erase right window. Double-click to erase both windows. + + + + + + + Retain - - &Erase + + Comments - - <html><head/><body><p>Clear the accumulating message average.</p></body></html> + + Operator - - Clear the accumulating message average. + + Exch sent - - Clear Avg + + Rcvd - - <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> + + Prop Mode - - Decode most recent Rx period at QSO Frequency + + Sat Mode - - &Decode + + RX Frequency - - <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> + + Aircraft scatter - - Toggle Auto-Tx On/Off + + Aurora-E - - E&nable Tx + + Aurora - - Stop transmitting immediately + + Back scatter - - &Halt Tx + + Echolink - - Toggle a pure Tx tone On/Off + + Earth-moon-earth - - &Tune + + Sporadic E - - Menus + + F2 Reflection - - Decode other Hounds calling above 1000 Hz audio offset + + Field aligned irregularities - - Enable auto response to the first decode from a new DXCC or new call on the current band. + + Internet-assisted - - F High + + Ionoscatter - - F Low + + IRLP - - 1/2 + + Meteor scatter - - 2/2 + + Non-satellite repeater or transponder - - 1/3 + + Rain scatter - - 2/3 + + Tropospheric ducting - - 3/3 + + A - - 1/4 + + B - - 2/4 + + BS - - 3/4 + + JA - - 4/4 + + JD - - 1/5 + + K - - 2/5 + + KA - - 3/5 + + KT - - 4/5 + + L - - 5/5 + + LS - - 1/6 + + LU - - 2/6 + + LX - - 3/6 + + S - - 4/6 + + SX - - 5/6 + + T - - 6/6 + + US - - Percentage of minute sequences devoted to transmitting. + + UV - - Prefer Type 1 messages + + VS - - <html><head/><body><p>Transmit during the next sequence.</p></body></html> + + VU - - - Q65 + + + Satellite - - SWL Mode + + Trans-equatorial - - Hide lower panel controls to maximize deocde windows + + + Invalid QSO Data - - USB dial frequency + + Check exchange sent and received - - 14.078 000 + + Check all fields - - <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> + + Log file error - - Rx Signal + + Cannot open "%1" for append - - 30dB recommended when only noise present -Green when good -Red when clipping may occur -Yellow when too low + + Error: %1 + + + MainWindow - - DX Call + + + + + + + + + + Band Activity - - DX Grid + + + UTC dB DT Freq Dr - - Callsign of station to be worked + + + + + + + + Rx Frequency - - &Lookup + + CQ only - - Locator of station to be worked + + Enter this QSO in log - - Az: 251 16553 km + + Log &QSO - - Add + + Stop monitoring - - <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> + + &Stop - - If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. + + &Monitor - - ? + + <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> - - Adjust Tx audio level + + Erase right window. Double-click to erase both windows. - - <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> + + &Erase - - Frequency entry + + <html><head/><body><p>Clear the accumulating message average.</p></body></html> - - Select operating band or enter frequency in MHz or enter kHz increment followed by k. + + Clear the accumulating message average. - - <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> + + Clear Avg - - <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> + + <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> - - Check to keep Tx frequency fixed when double-clicking on decoded text. + + Decode most recent Rx period at QSO Frequency - - Hold Tx Freq + + &Decode - - Audio Rx frequency + + <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> - - - - - - - Hz + + Toggle Auto-Tx On/Off - - - Rx + + E&nable Tx - - - Set Tx frequency to Rx Frequency + + Stop transmitting immediately - - ▲ + + &Halt Tx - - Frequency tolerance (Hz) + + Toggle a pure Tx tone On/Off - - - F Tol + + &Tune - - - Set Rx frequency to Tx Frequency + + + Menus - - ▼ + + Decode other Hounds calling above 1000 Hz audio offset - - <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> + + Enable auto response to the first decode from a new DXCC or new call on the current band. - - Synchronizing threshold. Lower numbers accept weaker sync signals. + + F High - - Sync + + F Low - - <html><head/><body><p>Check to use short-format messages.</p></body></html> + + WSJT-X by K1JT et al. - - Check to use short-format messages. + + Band Activity decode pane title - - Sh + + Title for the Band Activity decoded messages pane. - - <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> + + Band Activity decoded messages headings - - Check to enable JT9 fast modes + + + Columns: UTC dB DT Freq Message. - - - Fast + + Band Activity decoded messages - - <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> + + Decoded messages in the Band Activity pane. Columns: UTC dB DT Freq Message. - - Check to enable automatic sequencing of Tx messages based on received messages. + + Rx Frequency decode pane title - - Auto Seq + + Title for the Rx Frequency decoded messages pane. - - Check to generate "@1250 (SEND MSGS)" in Tx6. + + Rx Frequency decoded messages headings - - Tx6 + + Rx Frequency decoded messages - - Tx even/1st + + Decoded messages in the Rx Frequency pane. Columns: UTC dB DT Freq Message. - - <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> + + Check to display received messages in lower case. - - Frequency to call CQ on in kHz above the current MHz + + Lower case - - Tx CQ + + Include Time - - <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> + + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the strongest station's reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the weakest station's reply to your CQ.</p><p>When CQ or QRZ is pending, Enable Tx may be armed before or during a receive period. Only eligible direct callers decoded after it is armed in that period can replace the pending transmission; earlier callers are not retained.</p></body></html> - - Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. -Not available to nonstandard callsign holders. + + 1/2 - - Rx All Freqs + + 2/2 - - <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> + + 1/3 - - Submode determines tone spacing; A is narrowest. + + 2/3 - - Submode + + 3/3 - - - Fox + + 1/4 - - <html><head/><body><p>Check to monitor Sh messages.</p></body></html> + + 2/4 - - Check to monitor Sh messages. + + 3/4 - - SWL + + 4/4 - - Best S+P + + 1/5 - - <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> + + 2/5 - - Check this to start recording calibration data. -While measuring calibration correction is disabled. -When not checked you can view the calibration results. + + 3/5 - - Measure + + 4/5 - - <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> + + 5/5 - - Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). + + 1/6 - - Report + + 2/6 - - <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> + + 3/6 - - Tx/Rx or Frequency calibration sequence length + + 4/6 - - - s + + 5/6 - - - T/R + + 6/6 - - Audio Tx frequency + + Percentage of minute sequences devoted to transmitting. - - - Tx + + Prefer Type 1 messages - - Tx# + + <html><head/><body><p>Transmit during the next sequence.</p></body></html> - - - - 1 + + + Q65 - - - - Send this message in next Tx interval + + Alt+X - - Ctrl+2 + + SWL Mode - - <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + + Hide lower panel controls to maximize deocde windows - - Send this message in next Tx interval -Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + + + USB dial frequency - - Ctrl+1 + + 14.078 000 - - - - - Switch to this Tx message NOW + + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> - - Tx &2 + + Rx Signal - - Alt+2 + + 30dB recommended when only noise present +Green when good +Red when clipping may occur +Yellow when too low - - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + + DX Call - - Switch to this Tx message NOW -Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + + DX Grid - - Tx &1 + + Callsign of station to be worked - - Alt+1 + + &Lookup - - Ctrl+6 + + Locator of station to be worked - - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> + + Az: 251 16553 km - - Send this message in next Tx interval -Double-click to reset to the standard 73 message + + Add - - Ctrl+5 + + <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> - - Ctrl+3 + + If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. - - Tx &3 + + ? - - Alt+3 + + Adjust Tx audio level - - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> - - Send this message in next Tx interval -Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) -RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + Frequency entry - - Ctrl+4 + + Select operating band or enter frequency in MHz or enter kHz increment followed by k. - - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> - - Switch to this Tx message NOW -Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) -RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> - - Tx &4 + + Check to keep Tx frequency fixed when double-clicking on decoded text. - - Alt+4 + + Hold Tx Freq - - Tx &5 + + + Audio Rx frequency - - Alt+5 + + + + + + + + + Hz - - Now + + + + Rx - - Generate standard messages for minimal QSO + + + + + Set Tx frequency to Rx Frequency - - Generate Std Msgs + + + ▲ - - Tx &6 + + + Frequency tolerance (Hz) - - Alt+6 + + + + F Tol - - Enter a free text message (maximum 13 characters) -or select a predefined macro from the dropdown list. -Press ENTER to add the current text to the predefined -list. The list can be maintained in Settings (F2). + + + + + Set Rx frequency to Tx Frequency - - Queue up the next Tx message + + + ▼ - - Next + + <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> - - - - - - - 2 + + Synchronizing threshold. Lower numbers accept weaker sync signals. - - Quick-Start Guide to FST4 and FST4W + + Sync - - FST4 + + <html><head/><body><p>Check to use short-format messages.</p></body></html> - - FST4W + + Check to use short-format messages. - - - CQ + + Sh - - Grid + + <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> - - CQ AF + + Check to enable JT9 fast modes - - CQ AN + + + Fast - - CQ AS + + <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> - - CQ EU + + Check to enable automatic sequencing of Tx messages based on received messages. - - CQ NA + + Auto Seq - - CQ OC + + Check to generate "@1250 (SEND MSGS)" in Tx6. - - CQ SA + + Tx6 - - CQ 0 + + Tx even/1st - - CQ 1 + + <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> - - CQ 2 + + Frequency to call CQ on in kHz above the current MHz - - CQ 3 + + Tx CQ - - CQ 4 + + <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> - - CQ 5 + + Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. +Not available to nonstandard callsign holders. - - CQ 6 + + Rx All Freqs - - CQ 7 + + <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> - - CQ 8 + + Submode determines tone spacing; A is narrowest. - - CQ 9 + + Submode - - Reset + + + Fox - - N List + + <html><head/><body><p>Check to monitor Sh messages.</p></body></html> - - N Slots + + Check to monitor Sh messages. - - - - - - - - Random + + SWL - - Call + + Best S+P - - S/N (dB) + + <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> - - Distance + + Check this to start recording calibration data. +While measuring calibration correction is disabled. +When not checked you can view the calibration results. - - More CQs + + Measure - - - % + + <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> - - Tx Pct + + Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). - - Band Hopping + + Report - - Choose bands and times of day for band-hopping. + + <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> - - Schedule ... + + Tx/Rx or Frequency calibration sequence length - - Upload decoded messages to WSPRnet.org. + + + s - - Upload spots + + + T/R - - <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> + + + Audio Tx frequency - - 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. + + + + Tx - - No own call decodes + + Tx# - - Tx Next + + + + 1 - - Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. + + + + Send this message in next Tx interval - - NB + + Ctrl+2 - - 40 + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> - - - - 10 + + Send this message in next Tx interval +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) - - 17 + + Ctrl+1 - - 60 + + + + + Switch to this Tx message NOW - - - 12 + + Tx &2 - - 160 + + Alt+2 - - 20 + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> - - 80 + + Switch to this Tx message NOW +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) - - - 70 + + Tx &1 - - 15 + + Alt+1 - - 30 + + Ctrl+6 - - - - - 6 + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> - - 24G + + Send this message in next Tx interval +Double-click to reset to the standard 73 message - - 10G + + Ctrl+5 - - 5G + + Ctrl+3 - - - - 9 + + Tx &3 - - 13 + + Alt+3 - - 23 + + Ctrl+4 - - 33 + + Tx &4 - - 1.25 + + Alt+4 - - - 4 + + Tx &5 - - - 8 + + Alt+5 - - CQ messages only. + + Now - - Bypass Filters toggled via Settings or the Filters menu. + + Generate standard messages for minimal QSO - - BP + + Generate Std Msgs - - <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> + + Tx &6 - - Avg + + Alt+6 - - <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> + + Enter a free text message (maximum 13 characters) +or select a predefined macro from the dropdown list. +Press ENTER to add the current text to the predefined +list. The list can be maintained in Settings (F2). - - <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> + + Queue up the next Tx message - - <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> + + Next - - <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> + + + + + + + 2 - - <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> + + Quick-Start Guide to FST4 and FST4W - - Ignore + + FST4 - - Pwr + + FST4W - - <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the the strongest station's reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the the weakest station's reply to your CQ. </p></body></html> + + + + CQ - - - <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> + + Grid - - <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> + + CQ AF - - 15C + + CQ AN - - <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> + + CQ AS - - 15A + + CQ EU - - <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> + + CQ NA - - 30B + + CQ OC - - <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> + + CQ SA - - 60C + + CQ 0 - - <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> + + CQ 1 - - 60D + + CQ 2 - - <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> + + CQ 3 - - 60E + + CQ 4 - - Maximum drift rate in units of symbol rate per transmission. + + CQ 5 - - Max Drift + + CQ 6 - - - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> + + CQ 7 - - <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> + + CQ 8 - - Send msg + + CQ 9 - - <html><head/><body><p>Enter a free text message.</p></body></html> + + Reset - - Free Text + + N List - - <html><head/><body><p>Select a specific CQ message.</p></body></html> + + N Slots - - Queue + + + + + + + + Random - - Allow Dupes + + Call - - <html><head/><body><p>Clear all queues.</p></body></html> + + S/N (dB) - - <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> + + Distance - - <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> + + More CQs - - Age + + + % - - Continent + + Tx Pct - - Score + + Band Hopping - - <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> + + Choose bands and times of day for band-hopping. - - In Progress + + Schedule ... - - <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> + + Upload decoded messages to WSPRnet.org. - - - - - 3 + + Upload spots - - 70cm FT8 + + <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> - - 70cm + + 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. - - 30m FT8 + + No own call decodes - - 30m + + Tx Next - - <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> + + Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. - - Band Hopping + + NB - - 12m FT8 + + 40 - - 12m + + + + 10 - - 40m FT8 + + 17 - - 40m + + 60 - - 2m MSK144 + + + 12 - - 2m MSK + + 160 - - 10m FT8 + + 20 - - 10m + + 80 - - 6m FT8 + + + 70 - - 6m + + 15 - - 60m FT8 + + 30 - - 60m + + + + + 6 - - 160m FT8 + + 24G - - 160m + + 10G - - 80m FT8 + + 5G - - 80m + + + + 9 - - 20m FT8 + + 13 - - 20m + + 23 - - 17m FT8 + + 33 - - 17m + + 1.25 - - 4m FT8 + + + 4 - - 4m + + + 8 - - 15m FT8 + + CQ messages only. - - 15m + + Bypass Filters toggled via Settings or the Filters menu. - - 2m FT8 + + BP - - 2m + + <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> - - - 10m FT4 + + Avg - - - 12m FT4 + + <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> - - - 15m FT4 + + <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> - - - 17m FT4 + + <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> - - - 20m FT4 + + <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> - - - 30m FT4 + + <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> - - - 40m FT4 + + Ignore - - - 80m FT4 + + Pwr - - FT8 QRG6 + + + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> - - FT8 QRG1 + + <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> - - FT8 QRG2 + + 15C - - FT8 QRG7 + + <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> - - FT8 QRG8 in kHz. + + 15A - - FT8 QRG5 + + <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> - - FT8 QRG3 + + 30B - - FT8 QRG4 + + <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> - - FT8 QRG8 + + 60C - - FT8 QRG7 in kHz. + + <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> - - FT8 QRG6 in kHz. + + 60D - - FT8 QRG5 in kHz. + + <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> - - FT8 QRG4 in kHz. + + 60E - - FT8 QRG3 in kHz. + + Maximum drift rate in units of symbol rate per transmission. - - FT8 QRG2 in kHz. + + Max Drift - - FT8 QRG1 in kHz. + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - - Spacing + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - - Fixed Tone + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> - - K1JT + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - - CW + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - - Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. + + <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> - - H + + Send msg - - Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. + + <html><head/><body><p>Enter a free text message.</p></body></html> - - Switch to FT4 mode + + Free Text - - Switch to MSK144 mode + + <html><head/><body><p>Select a specific CQ message.</p></body></html> - - MSK + + Queue - - <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> + + Allow Dupes - - <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> + + <html><head/><body><p>Clear all queues.</p></body></html> - - <html><head/><body><p>Switch to Echo mode</p></body></html> + + <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> - - File + + <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> - - View + + Age - - Filters + + Continent - - Decode + + Score - - Parameters + + <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> - - Decoder sensitivity + + In Progress - - Decoder start + + <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> - - Number of threads + + + + + 3 - - QSO RX freq sensitivity + + 70cm FT8 - - Decoding cycles + + 70cm - - Save + + 30m FT8 - - Help + + 30m - - Mode + + <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> - - Configurations + + Band Hopping - - Tools + + 12m FT8 - - Exit + + 12m - - About WSJT-X + + 40m FT8 - - Waterfall + + 40m - - Open + + 2m MSK144 - - Ctrl+O + + 2m MSK - - Open next in directory + + 10m FT8 - - Decode remaining files in directory + + 10m - - Shift+F6 + + 6m FT8 - - Delete all *.wav && *.c2 files in SaveDir + + 6m - - None + + 60m FT8 - - Save all + + 60m - - Remove saved files after 30 days + + 160m FT8 - - Online User Guide + + 160m - - Keyboard shortcuts + + 80m FT8 - - Special mouse commands + + 80m - - JT9 + + 20m FT8 - - Save decoded + + 20m - - - Normal + + 17m FT8 - - Deep + + 17m - - Erase ALL.TXT + + 4m FT8 - - Erase wsjtx_log.adi + + 4m - - Erase wsjtx.log + + 15m FT8 - - Erase Ignore List + + 15m - - F7 + + 2m FT8 - - Don't split ALL.TXT + + 2m - - Split ALL.TXT yearly + + + 10m FT4 - - Split ALL.TXT monthly + + + 12m FT4 - - Disable writing of ALL.TXT + + + 15m FT4 - - Active Stations + + + 17m FT4 - - Band Buttons + + + 20m FT4 - - Use Dark Style + + + 30m FT4 - - Reduce false decodes + + + 40m FT4 - - Default event logging + + + 80m FT4 - - Diagnostic mode + + FT8 QRG6 - - Disable event logging + + FT8 QRG1 - - Quick-Start Guide to WSJT-X 2.7 and QMAP + + FT8 QRG2 - - WSJT-X_improved Home Page + + FT8 QRG7 - - <html><head/><body><p>Go to the wsjt-x_improved home page.</p></body></html> + + FT8 QRG8 in kHz. - - The additional features of wsjt-x_improved + + FT8 QRG5 - - <html><head/><body><p>Overview on the additional features of wsjt-x_improved.</p></body></html> + + FT8 QRG3 - - Recommended audio settings + + FT8 QRG4 - - <html><head/><body><p>Recommended Audio Settings.</p></body></html> + + FT8 QRG8 - - How to deal with rig control errors + + FT8 QRG7 in kHz. - - <html><head/><body><p>How to deal with rig control errors.</p></body></html> + + FT8 QRG6 in kHz. - - Erase list of Q65 callers + + FT8 QRG5 in kHz. - - SuperFox User Guide + + FT8 QRG4 in kHz. - - Message Creator + + FT8 QRG3 in kHz. - - Hide stations worked before on band + + FT8 QRG2 in kHz. - - Hide stations worked today or yesterday + + FT8 QRG1 in kHz. - - Hide stations from Ignore List + + GroupBox - - Ignore stations worked today or yesterday + + CQ %M CQ - - Ignore stations from Ignore List + + %H 599 %N - - Hide stations from Territory 1 + + %H TU CQ %M CQ - - Hide stations from Territory 2 + + %M - - Hide stations from Territory 3 + + %H - - Hide stations from Territory 4 + + TU NOW %Q 599 %N - - Hide stations from Europe + + %H AGN? - - Hide stations from North America + + 599 %N - - Hide stations from South America + + F1 - - Hide stations from Asia + + HisCall Exchange - - Hide stations from Africa + + F2 - - Hide stations from Oceania + + TU CQ - - Hide stations from Antarctica + + F3 - - Full Duplex Mode + + MyCall - - Highlight callsigns worked before on band + + F4 - - Highlight callsigns worked today or yesterday + + HisCall - - Highlight callsigns from Ignore List + + F5 - - Enable Message Popups + + Now QueuedCall Exchange - - QSY Monitor + + F6 - - Ignore stations worked before on band + + HisCall AGN ? - - Use multithreaded FT8 decoder + + Exchange - - Auto + + Serial number of QSO for contest exchange. - - - 5 + + Click to transmit a message. - - - 7 + + Send message - - - 11 + + Call next - - Low + + Message to be transmitted - - Medium + + Serial Number - - High + + Callsign to be worked next. - - Minimum + + Spacing - - Use low thresholds + + Fixed Tone - - Use subpass + + K1JT - - 2-Stage + + CW - - 3-Stage + + Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. - - Early + + H - - Late + + Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. - - Wideband DX Call search + + Switch to FT4 mode - - Hide FT8 dupe messages + + Switch to MSK144 mode - - VHF / UHF Buttons + + MSK - - Highlight stations from Territory 1 + + <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> - - Highlight stations from Territory 2 + + <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> - - Highlight stations from Territory 3 + + <html><head/><body><p>Switch to Echo mode</p></body></html> - - Highlight stations from Territory 4 + + File - - Disable clicks on waterfall + + View - - - JT65 + + Filters - - Astronomical data + + Decode - - List of Type 1 prefixes and suffixes + + Parameters - - Settings... + + Decoder sensitivity - - Local User Guide + + Decoder start - - Open log directory + + Number of threads - - JT4 + + QSO RX freq sensitivity - - Message averaging + + Decoding cycles - - Enable averaging + + Save - - Enable deep search + + Help - - WSPR + + + Mode - - Echo Graph + + Configurations - - F8 + + Tools - - - Echo + + Exit - - EME Echo mode + + About WSJT-X - - ISCAT + + Waterfall - - Fast Graph + + Open - - F9 + + Ctrl+O - - &Download Samples ... + + Open next in directory - - <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> + + Ctrl+X - - MSK144 + + Decode remaining files in directory - - QRA64 + + Download EME Ephemeris Chart - - Release Notes + + Hide AP information - - Enable AP for DX Call + + <html><head/><body><p>Hide AP information</p></body></html> - - FreqCal + + Highlight Whitelist entries - - Measure reference spectrum + + JTTY - - Measure phase response + + Delete all *.wav && *.c2 files in SaveDir - - Erase reference spectrum + + None - - Execute frequency calibration cycle + + Save all - - Equalization tools ... + + Remove saved files after 30 days - - - FT8 + + Online User Guide - - - Enable AP + + Keyboard shortcuts - - Solve for calibration parameters + + Special mouse commands - - Copyright notice + + JT9 - - Shift+F1 + + Save decoded - - Fox log + + + Normal - - FT8 DXpedition Mode User Guide + + Deep - - Reset Cabrillo log ... + + Erase ALL.TXT - - Color highlighting scheme + + Erase wsjtx_log.adi - - Export Cabrillo log ... + + Erase wsjtx.log - - Contest log + + Erase Ignore List - - Erase WSPR hashtable + + F7 - - - FT4 + + Don't split ALL.TXT - - Quick-Start Guide to Q65 + + Split ALL.TXT yearly - - Auto Clear Avg after decode + + Split ALL.TXT monthly - - Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 + + Disable writing of ALL.TXT - - Rig Control Error + + Active Stations - - - - Receiving + + Band Buttons - - Do you want to reconfigure the radio interface? + + Use Dark Style - - Error Scanning ADIF Log + + Reduce false decodes - - Scanned ADIF log, %1 worked-before records created. CTY: %2 + + Default event logging - - Error Loading LotW Users Data + + Diagnostic mode - - Error Writing WAV File + + Disable event logging - - Enumerating audio devices + + Quick-Start Guide to WSJT-X 2.7 and QMAP - - Configurations... + + How to deal with rig control errors - - - - - - - - - - - - - - - - - - - - - Message + + <html><head/><body><p>How to deal with rig control errors.</p></body></html> - - Error Killing jt9.exe Process + + Erase list of Q65 callers - - KillByName return code: %1 + + SuperFox User Guide - - Error removing "%1" + + Message Creator - - Click OK to retry + + Hide stations worked before on band - - - Improper mode + + Hide stations worked today or yesterday - - - File Open Error + + Hide stations from Ignore List - - - - - - Cannot open "%1" for append: %2 + + Ignore stations worked today or yesterday - - Error saving c2 file + + Ignore stations from Ignore List - - Error in Sound Input + + Hide stations from Territory 1 - - Error in Sound Output + + Hide stations from Territory 2 - - - Single-Period Decodes + + Hide stations from Territory 3 - - - Average Decodes + + Hide stations from Territory 4 - - Change Operator + + Hide stations from Europe - - New operator: + + Hide stations from North America - - Status File Error + + Hide stations from South America - - - Cannot open "%1" for writing: %2 + + Hide stations from Asia - - Decodes containing My Call + + Hide stations from Africa - - Subprocess Error + + Hide stations from Oceania - - Subprocess failed with exit code %1 + + Hide stations from Antarctica - - - Running: %1 -%2 + + Full Duplex Mode - - Subprocess error + + Highlight callsigns worked before on band - - Reference spectrum saved + + Highlight callsigns worked today or yesterday - - It is very important to avoid audio harmonics and distorted audio signals. -This is usually achieved by the following step-by-step approach: - -1. Select 'Fake it' in the Settings/Radio menu as your 'Split mode'. If your - rig does not support this, select 'Rig'. But really try to avoid 'None'! - -2. Set the transmission power of your transceiver to maximum. - -3. Set the Pwr slider to the minimum and click on the 'Tune' button. - -4. Observe the actual transmission power of your rig as well as ALC. - -5. Carefully increase the Pwr slider until you have reached the - maximum transmit powe of your transceiver. - -6. VERY IMPORTANT: Now reduce the Pwr slider until you reach approx. - 90% of your max. Tx power. ALC should be close to zero. - -7. This is the maximum audio level permitted with your setup. - Always stay with the Pwr slider below this max. value. - -If possible, check your transmission from time to time with a webSDR -to ensure the signal is clean and not distorted. + + Highlight callsigns from Ignore List - - <b>Recommended Audio Settings</b> + + Enable Message Popups - - Invalid data in fmt.all at line %1 + + QSY Monitor - - Good Calibration Solution + + Ignore stations worked before on band - - <pre>%1%L2 ±%L3 ppm -%4%L5 ±%L6 Hz - -%7%L8 -%9%L10 Hz</pre> + + Use multithreaded FT8 decoder - - Delete Calibration Measurements + + Auto - - The "fmt.all" file will be renamed as "fmt.bak" + + + 5 + + + + + + 7 + + + + + + 11 + + + + + Low + + + + + Medium + + + + + High + + + + + Minimum + + + + + Use low thresholds + + + + + Use subpass + + + + + 2-Stage + + + + + 3-Stage + + + + + Early + + + + + Late + + + + + Wideband DX Call search + + + + + Hide FT8 dupe messages + + + + + VHF / UHF Buttons + + + + + Highlight stations from Territory 1 + + + + + Highlight stations from Territory 2 + + + + + Highlight stations from Territory 3 + + + + + Highlight stations from Territory 4 + + + + + Disable clicks on waterfall + + + + + + JT65 + + + + + Astronomical data + + + + + List of Type 1 prefixes and suffixes + + + + + Settings... + + + + + Local User Guide + + + + + Open log directory + + + + + JT4 + + + + + Message averaging + + + + + Enable averaging + + + + + Enable deep search + + + + + WSPR + + + + + Echo Graph + + + + + F8 + + + + + + Echo + + + + + EME Echo mode + + + + + ISCAT + + + + + Fast Graph + + + + + &Download Samples ... + + + + + <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> + + + + + MSK144 + + + + + QRA64 + + + + + Release Notes + + + + + Enable AP for DX Call + + + + + FreqCal + + + + + Measure reference spectrum + + + + + Measure phase response + + + + + Erase reference spectrum + + + + + Execute frequency calibration cycle + + + + + Equalization tools ... + + + + + + FT8 + + + + + + Enable AP + + + + + Solve for calibration parameters + + + + + Copyright notice + + + + + Shift+F1 + + + + + Fox log + + + + + FT8 DXpedition Mode User Guide + + + + + Reset Cabrillo log ... + + + + + Color highlighting scheme + + + + + Export Cabrillo log ... + + + + + Contest log + + + + + Erase WSPR hashtable + + + + + + FT4 + + + + + Quick-Start Guide to Q65 + + + + + Auto Clear Avg after decode + + + + + Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 + + + + + Rig Control Error + + + + + + + Receiving + + + + + Do you want to reconfigure the radio interface? + + + + + Error Scanning ADIF Log + + + + + Scanned ADIF log, %1 worked-before records created. CTY: %2 + + + + + Error Loading LotW Users Data + + + + + + + Decoder Error + + + + + The decoder subprocess exited unexpectedly. + + + + + jt9 exited unexpectedly with code %1. + + + + + + Error Writing WAV File + + + + + Enumerating audio devices + + + + + Configurations... + + + + + + + + + + + + + + + + + + + + Message + + + + + Error Killing jt9.exe Process + + + + + KillByName return code: %1 + + + + + Error removing "%1" + + + + + Click OK to retry + + + + + %1.wav: invalid sample count %2 + + + + + + Improper mode + + + + + + File Open Error + + + + + + + + + Cannot open "%1" for append: %2 + + + + + Error saving c2 file + + + + + Error in Sound Input + + + + + Error in Sound Output + + + + + + Single-Period Decodes + + + + + + Average Decodes + + + + + Change Operator + + + + + New operator: + + + + + Status File Error + + + + + + Cannot open "%1" for writing: %2 + + + + + Decodes containing My Call + + + + + Subprocess Error + + + + + Subprocess failed with exit code %1 + + + + + + Running: %1 +%2 + + + + + Subprocess error + + + + + Invalid data in fmt.all at line %1 + + + + + Good Calibration Solution + + + + + <pre>%1%L2 ±%L3 ppm +%4%L5 ±%L6 Hz + +%7%L8 +%9%L10 Hz</pre> + + + + + Delete Calibration Measurements + + + + + The "fmt.all" file will be renamed as "fmt.bak" + + + + + No data read from disk. Wrong file format? + + + + + Confirm Delete + + + + + Are you sure you want to delete all *.wav and *.c2 files in "%1"? + + + + + Keyboard Shortcuts + + + + + Special Mouse Commands + + + + + No more files to open. + + + + + Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. + + + + + WSPR Guard Band + + + + + Please choose another dial frequency. +Must be 3Khz away from %1. +WSJT-X will not operate in Fox mode +overlapping the standard FT8 sub-bands. + + + + + Fox Mode warning + + + + + Please choose another dial frequency. +WSJT-X will not operate in Fox mode +overlapping the WSPR sub-bands. + + + + + The decoder subprocess could not be stopped. + + + + + The decoder subprocess could not be restarted. + + + + + Application status + + + + + Current WSJT-X status messages and operating indicators. + + + + + Transmit status + + + + + Configuration + + + + + Decode count + + + + + Last transmitted message + + + + + Power and SWR status + + + + + Decode progress + + + + + Progress for the current decode operation. + + + + + Transmit watchdog + + + + + The selected transmit message cannot be encoded. Enable Tx has been turned off. Edit the selected message or check station settings before trying again. + + + + + Tx message cannot be encoded; Enable Tx is off + + + + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2026 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; Roger Rehr, W3SZ; John Nelson, G4KLA; Charlie Suckling, DL3WDG; Terrell Deppe, KJ5HST; and other members of the WSJT Development Group." + + + + + EME Chart + + + + + Select Year + + + + + FT8 input completion was rejected: automated=%1 awaiting=%2 frames=%3. + + + + + Unable to flush the final FT8 downsampling block. + + + + + FT8 input completed with %1 of %2 samples in the decode buffer. + + + + + FT8 decoding is running behind; early passes are temporarily reduced. + + + + + FT8 decoding caught up; configured early passes restored. + + + + + + PSK Reporter spot queue full; oldest spot dropped + + + + + Last Tx: %1 + + + + + A QSO between two stations with nonstandard callsigns won't work. + +Auto Seq would get stuck in an endless loop. + + + + + This station transmits in the same time slot as you do. + +You must not start a QSO if both stations Tx even/1st +or Tx odd/2nd, while the Tx even/1st checkbox is disabled. + +Click the MSK144 mode button to re-enable the Tx even/1st +checkbox, or choose another station. + + + + + Should you switch to EU VHF Contest mode? + +To do so, check 'Special operating activity' and +'EU VHF Contest' on the Settings | Advanced tab. + + + + + Should you switch to ARRL Field Day mode? + + + + + Should you switch to RTTY contest mode? + + + + + %1 shorthand-message mode + + + + + RR73 is not available in %1. Tx4 uses RRR in this mode. + + + + + Wait & Pounce requires a CQ response mode. +Change CQ: None to another option. + + + + + + Decoder is starting; decode request skipped. + + + + + + + + Add to CALL3.TXT + + + + + Please enter a valid grid locator + + + + + Cannot open "%1" for read/write: %2 + + + + + %1 +is already in CALL3.TXT, do you wish to replace it? + + + + + Warning: DX Call field is empty. + + + + + SuperFox free text may only contain spaces, digits, uppercase letters, and + - . / ?. + + + + + Log file error + + + + + Cannot open "%1" + + + + + Error sending log to N1MM + + + + + Write returned "%1" + + + + + DX call + + + + + Callsign of station to be worked. + + + + + DX grid + + + + + Locator of station to be worked. + + + + + Wait and Call + + + + + Lookup DX call + + + + + Add DX call + + + + + Ignore DX call + + + + + CQ response mode + + + + + Selects a station automatically from replies to your pending CQ after Enable Tx is armed in the current receive period, or from CQ messages for Wait & Pounce. + + + + + Transmit audio frequency + + + + + Receive audio frequency + + + + + Signal report + + + + + Operating band + + + + + Operating band text + + + + + Transmit power attenuation + + + + + Adjust Tx audio level attenuation. + + + + + Show or hide the menu bar. + + + + + Rig control status + + + + + Hound mode + + + + + Toggle FT8 hound mode. Right-click to toggle SuperFox mode. + + + + + Message panel selector - - No data read from disk. Wrong file format? + + Switches between standard messages, Fox queue, and band hopping pages. Press 1, 2, or 3 while focused to select a page. - - Confirm Delete + + Standard messages - - Are you sure you want to delete all *.wav and *.c2 files in "%1"? + + Fox queue - - Keyboard Shortcuts + + + Band hopping - - Special Mouse Commands + + Standard messages page - - No more files to open. + + Fox queue page - - - Spotting to PSK Reporter unavailable + + Band hopping page - - Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. + + Hound queue - - WSPR Guard Band + + Queued Hound callers available for Fox transmissions. - - If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: - -"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2025 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; and other members of the WSJT Development Group." + + Fox transmissions in progress - - <table cellspacing=1> - <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> - <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> - <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> - <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> - <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> - <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> - <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> - <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> - <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> - <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: toggle "Call 1st")</td></tr> - <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> - <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> - <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> - <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> - <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> - <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> - <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> - <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> - <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> - <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> - <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> - <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> - <tr><td><b>Alt+C </b></td><td>Toggle "Call 1st" checkbox</td></tr> - <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> - <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> - <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> - <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> - <tr><td><b>Alt+E </b></td><td>Erase</td></tr> - <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> - <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> - <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> - <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> - <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> - <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> - <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> - <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> - <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> - <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> - <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> - <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> - <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> - <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> - <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> - <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> - -</table> - Keyboard shortcuts help window contents + + Hound callers currently in progress for Fox transmissions. - - <table cellpadding=5> - <tr> - <th align="right">Click on</th> - <th align="left">Action</th> - </tr> - <tr> - <td align="right">Waterfall:</td> - <td><b>Click</b> to set Rx frequency.<br/> - <b>Right-click</b> to set Tx frequency.<br/> - <b>Double-right-click</b> to set Rx and Tx frequencies. - </td> - </tr> - <tr> - <td align="right">Decoded text:</td> - <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> - and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> - Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> - If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> - own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. - </td> - </tr> - <tr> - <td align="right">Dial Frequency:</td> - <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> - <b>Right-click</b> to increase frequency by 1 kHz.<br/> - <b>Left-click</b> to decrease frequency by 1 kHz.<br/> - The mouse pointer must be over the Dial Frequency indicator. - </td> - </tr> - <tr> - <td align="right">H Button:</td> - <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> - <b>Right-click</b> to activate or deactivate SuperFox mode. - </td> - </tr> - <tr> - <td align="right">FT8 Button:</td> - <td><b>Click</b> to switch to FT8 Hound Mode.<br/> - <b>Right-click</b> to toggle last used Special Operating Activity On/Off. - </td> - </tr> - <tr> - <td align="right">Q65 Button:</td> - <td><b>Click</b> to switch to Q65 Mode.<br/> - <b>Right-click</b> to switch to Q65 Pileup Mode. - </td> - </tr> - <tr> - <td align="right">JT65 Button:</td> - <td><b>Click</b> to switch to JT65 Mode.<br/> - <b>Right-click</b> to switch to JT9 Mode. - </td> - </tr> - <tr> - <td align="right">Tx5 Button:</td> - <td><b>Right-click</b> to retain Tx5 free text. - </td> - </tr> - <tr> - <td align="right">Tx Even/1st:</td> - <td><b>Right-click</b> to freeze the state of the checkbox.<br/> - <b>Right-click on the FT8 Button</b> to unfreeze. - </td> - </tr> - <tr> - <td align="right">Enable Tx Button:</td> - <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> - <b>Right-click</b> to toggle Wait & Pounce On/Off. - </td> - </tr> - <tr> - <td align="right">Erase button:</td> - <td><b>Click</b> to erase Rx Frequency window.<br/> - <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> - If <b>Alternate Erase button behavior</b> is checked:<br/> - <b>Click</b> to erase Band Activity window.<br/> - <b>Right-click</b> to erase Rx Frequency window.<br/> - <b>Double-click</b> to erase Rx Frequency and Band Activity windows. - </td> - </tr> - <tr> - <td align="right">DX Call Button:</td> - <td><b>Click</b> to toggle Wait & Call On/Off.<br/> - <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. - </td> - </tr> - <tr> - <td align="right">Lookup Button:</td> - <td><b>Click</b> to search for callsign in database.<br/> - <b>Right-click</b> to search for Dx Call on qrz.com. - </td> - </tr> - <tr> - <td align="right">Add Button:</td> - <td><b>Click</b> to add callsign and locator to database.<br/> - <b>Right-click</b> to search for Dx Call on hamqth.com. - </td> - </tr> - <tr> - <td align="right">Ignore Button:</td> - <td><b>Click</b> to add callsign to the Ignore List.<br/> - <b>Right-click</b> to search for Dx Call on qrzcq.com. - </td> - </tr> - <tr> - <td align="right">Band Buttons:</td> - <td><b>Click</b> to toggle band / mode default frequencies.<br/> - <b>Right-click</b> to toggle FT8 DXpedition frequencies. - </td> - </tr> -</table> - Mouse commands help window contents + + Hound queue sort order - - Please choose another dial frequency. -Must be 3Khz away from %1. -WSJT-X will not operate in Fox mode -overlapping the standard FT8 sub-bands. + + Hound queue list size - - - Fox Mode warning + + Fox transmission slots - - Please choose another dial frequency. -WSJT-X will not operate in Fox mode -overlapping the WSPR sub-bands. + + Fox CQ message - - Last Tx: %1 + + Reset Fox queues - - This station transmits in the same time slot as you do. - -You must not start a QSO if both stations Tx even/1st -or Tx odd/2nd, while the Tx even/1st checkbox is disabled. - -Click the MSK144 mode button to re-enable the Tx even/1st -checkbox, or choose another station. + + Fox free text + + + + + Send Fox free text + + + + + Enable FT8 QRG 1 + + + + + Enable FT8 QRG 2 + + + + + Enable FT8 QRG 3 + + + + + Enable FT8 QRG 4 + + + + + Enable FT8 QRG 5 + + + + + Enable FT8 QRG 6 + + + + + Enable FT8 QRG 7 + + + + + Enable FT8 QRG 8 + + + + + FT8 QRG 1 frequency + + + + + FT8 QRG 2 frequency + + + + + FT8 QRG 3 frequency + + + + + FT8 QRG 4 frequency + + + + + FT8 QRG 5 frequency + + + + + FT8 QRG 6 frequency + + + + + FT8 QRG 7 frequency + + + + + FT8 QRG 8 frequency + + + + + Tx1 message + + + + + Tx2 message + + + + + Tx3 message + + + + + Tx4 message + + + + + Tx5 message macro + + + + + Tx6 message - - Should you switch to EU VHF Contest mode? - -To do so, check 'Special operating activity' and -'EU VHF Contest' on the Settings | Advanced tab. + + Tx5 message macro text - - Should you switch to ARRL Field Day mode? + + Select Tx1 for next transmission - - Should you switch to RTTY contest mode? + + Select Tx2 for next transmission - - - - - Add to CALL3.TXT + + Select Tx3 for next transmission - - Please enter a valid grid locator + + Select Tx4 for next transmission - - Cannot open "%1" for read/write: %2 + + Select Tx5 for next transmission - - %1 -is already in CALL3.TXT, do you wish to replace it? + + Select Tx6 for next transmission - - Warning: DX Call field is empty. + + Transmit Tx1 now - - Log file error + + Transmit Tx2 now - - Cannot open "%1" + + Transmit Tx3 now - - Error sending log to N1MM + + Transmit Tx4 now - - Write returned "%1" + + Transmit Tx5 now + + + + + Transmit Tx6 now - + Stations calling DXpedition %1 - + Show Already Worked - + + All Decodes + + + + + QSO Frequency + + + + Super Fox - + Super Hound - + Hound - + Tx Messages - - - - - - + + + + + + Confirm Erase - + Are you sure you want to erase file ALL.TXT? - + Are you sure you want to erase the list of Q65 callers? - - + + Confirm Reset - + Are you sure you want to erase your contest log? - + Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. - + Cabrillo Log saved - + Are you sure you want to erase file wsjtx_log.adi? - + Are you sure you want to erase the WSPR hashtable? - + %1 W - + SWR > 2.5 !!! Transmission was stopped @@ -5767,114 +7348,395 @@ Check your antenna - + Tune digital gain - + Transmit digital gain - + Prefixes - + Network Error - + Error: %1 UDP server %2:%3 - + + File Error - + + + Stop transmitting or tuning before changing the dial frequency. + + + + + + Measuring reference spectrum: %1 s remaining + + + + + Reference spectrum measurement stopped; Ref Spec is available + + + + + Reference spectrum saved; Ref Spec is available + + + + + Reference spectrum measurement stopped; no reference spectrum is available + + + + Phase Training Disabled - + Phase Training Enabled - + + Cannot remove "%1": %2 + + + + WD:0m - + Runaway Tx watchdog - + WD:%1m - - + + + Free Text Message - - + + Message: - + Directional calls not yet supported in SuperFox mode - + TOTP: No seed entered in fox configuration to generate verification code. - + + SuperFox cannot queue %1: unsupported callsign. + + + + TOTP SF: seed not long enough. - + + SuperFox Tx stopped: invalid message tokens. + + + + + SuperFox Tx stopped: invalid verification code. + + + + + SuperFox Tx stopped: invalid CQ call or grid. + + + + + SuperFox Tx stopped: invalid callsign. + + + + + SuperFox Tx stopped: report is outside the SuperFox range. + + + + + SuperFox Tx stopped: free text contains unsupported characters. + + + + + SuperFox Tx stopped: message could not be packed. + + + + Are you sure you want to erase the Tx Log? - + "%1" added to Ignore List - + Are you sure you want to erase the Ignore List? - - + + Log File Error - + Are you sure you want to clear the QSO queues? + + + Band hopping has no selected frequencies. + + + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: cycle CQ response mode)</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Cycle CQ response mode</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Ctrl+X </b></td><td>Open next file in directory</td></tr> + <tr><td><b>Alt+x </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> + +</table> + + + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Right-click</b> to set Tx frequency.<br/> + <b>Double-right-click</b> to set Rx and Tx frequencies. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> + and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> + Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> + own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">Dial Frequency:</td> + <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> + <b>Right-click</b> to increase frequency by 1 kHz.<br/> + <b>Left-click</b> to decrease frequency by 1 kHz.<br/> + The mouse pointer must be over the Dial Frequency indicator. + </td> + </tr> + <tr> + <td align="right">H Button:</td> + <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to activate or deactivate SuperFox mode. + </td> + </tr> + <tr> + <td align="right">FT8 Button:</td> + <td><b>Click</b> to switch to FT8 Hound Mode.<br/> + <b>Right-click</b> to toggle last used Special Operating Activity On/Off. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> + <tr> + <td align="right">Tx5 Button:</td> + <td><b>Right-click</b> to retain Tx5 free text. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Right-click</b> to freeze the state of the checkbox.<br/> + <b>Right-click on the FT8 Button</b> to unfreeze. + </td> + </tr> + <tr> + <td align="right">Enable Tx Button:</td> + <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> + <b>Right-click</b> to toggle Wait & Pounce On/Off after selecting<br/> + any CQ response mode other than CQ: None. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> + If <b>Alternate Erase button behavior</b> is checked:<br/> + <b>Click</b> to erase Band Activity window.<br/> + <b>Right-click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">DX Call Button:</td> + <td><b>Click</b> to toggle Wait & Call On/Off.<br/> + <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. + </td> + </tr> + <tr> + <td align="right">Lookup Button:</td> + <td><b>Click</b> to search for callsign in database.<br/> + <b>Right-click</b> to search for Dx Call on qrz.com. + </td> + </tr> + <tr> + <td align="right">Add Button:</td> + <td><b>Click</b> to add callsign and locator to database.<br/> + <b>Right-click</b> to search for Dx Call on hamqth.com. + </td> + </tr> + <tr> + <td align="right">Ignore Button:</td> + <td><b>Click</b> to add callsign to the Ignore List.<br/> + <b>Right-click</b> to search for Dx Call on qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Band Buttons:</td> + <td><b>Click</b> to toggle band / mode default frequencies.<br/> + <b>Right-click</b> to toggle FT8 DXpedition frequencies. + </td> + </tr> +</table> + + + + + Type 1 Prefixes: + + 1A 1S 3A 3B6 3B8 3B9 3C 3C0 3D2 3D2C 3D2R 3DA 3V 3W 3X + 3Y 3YB 3YP 4J 4L 4S 4U1I 4U1U 4W 4X 5A 5B 5H 5N 5R + 5T 5U 5V 5W 5X 5Z 6W 6Y 7O 7P 7Q 7X 8P 8Q 8R + 9A 9G 9H 9J 9K 9L 9M2 9M6 9N 9Q 9U 9V 9X 9Y A2 + A3 A4 A5 A6 A7 A9 AP BS7 BV BV9 BY C2 C3 C5 C6 + C9 CE CE0X CE0Y CE0Z CE9 CM CN CP CT CT3 CU CX CY0 CY9 + D2 D4 D6 DL DU E3 E4 EA EA6 EA8 EA9 EI EK EL EP + ER ES ET EU EX EY EZ F FG FH FJ FK FKC FM FO + FOA FOC FOM FP FR FRG FRJ FRT FT5W FT5X FT5Z FW FY M MD + MI MJ MM MU MW H4 H40 HA HB HB0 HC HC8 HH HI HK + HK0A HK0M HL HM HP HR HS HV HZ I IS IS0 J2 J3 J5 + J6 J7 J8 JA JDM JDO JT JW JX JY K KG4 KH0 KH1 KH2 + KH3 KH4 KH5 KH5K KH6 KH7 KH8 KH9 KL KP1 KP2 KP4 KP5 LA LU + LX LY LZ OA OD OE OH OH0 OJ0 OK OM ON OX OY OZ + P2 P4 PA PJ2 PJ7 PY PY0F PT0S PY0T PZ R1F R1M S0 S2 S5 + S7 S9 SM SP ST SU SV SVA SV5 SV9 T2 T30 T31 T32 T33 + T5 T7 T8 T9 TA TF TG TI TI9 TJ TK TL TN TR TT + TU TY TZ UA UA2 UA9 UK UN UR V2 V3 V4 V5 V6 V7 + V8 VE VK VK0H VK0M VK9C VK9L VK9M VK9N VK9W VK9X VP2E VP2M VP2V VP5 + VP6 VP6D VP8 VP8G VP8H VP8O VP8S VP9 VQ9 VR VU VU4 VU7 XE XF4 + XT XU XW XX9 XZ YA YB YI YJ YK YL YN YO YS YU + YV YV0 Z2 Z3 ZA ZB ZC4 ZD7 ZD8 ZD9 ZF ZK1N ZK1S ZK2 ZK3 + ZL ZL7 ZL8 ZL9 ZP ZS ZS8 KC4 E5 + +Type 1 Suffixes: /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /P + + MessageAveraging @@ -5893,8 +7755,8 @@ UDP server %2:%3 Modes - - + + Mode @@ -5902,7 +7764,7 @@ UDP server %2:%3 MultiSettings - + Default @@ -5910,62 +7772,62 @@ UDP server %2:%3 MultiSettings::impl - + &Switch To - + &Clone - + Clone &Into ... - + R&eset - + &Rename ... - + &Delete - + Clone Into Configuration - + Confirm overwrite of all values for configuration "%1" with values from "%2"? - + Reset Configuration - + Confirm reset to default values for configuration "%1"? - + Delete Configuration - + Confirm deletion of configuration "%1"? @@ -5973,17 +7835,17 @@ UDP server %2:%3 NameDialog - + New Configuration Name - + Old name: - + &New name: @@ -6009,12 +7871,12 @@ UDP server %2:%3 - + OmniRig: don't know how to set rig frequency - + OmniRig COM/OLE error: %1 at %2: %3 (%4) @@ -6040,35 +7902,30 @@ UDP server %2:%3 - + Too many colours in palette. - + Error reading waterfall palette file "%1:%2" too many colors. - + Error reading waterfall palette file "%1:%2" invalid triplet. - + Error reading waterfall palette file "%1:%2" invalid color. - + Error opening waterfall palette file "%1": %2. - - - Error writing waterfall palette file "%1": %2. - - QSYMessage @@ -6468,7 +8325,7 @@ Message - + MessageCreator @@ -6486,7 +8343,7 @@ Message - + QSY Monitor @@ -6613,62 +8470,62 @@ Error(%2): %3 SoundInput - + An error opening the audio input device has occurred. - + An error occurred during read from the audio input device. - + Non-recoverable error, audio input device not usable at this time. - + Requested input audio format is not valid. - + Requested input audio format is not supported on device. - + Failed to initialize audio sink device - + Idle - + Receiving - + Suspended - + Interrupted - + Error - + Stopped @@ -6676,90 +8533,114 @@ Error(%2): %3 SoundOutput - + An error opening the audio output device has occurred. - + An error occurred during write to the audio output device. - + Audio data not being fed to the audio output device fast enough. - + Non-recoverable error, audio output device not usable at this time. - + Requested output audio format is not valid. - + Requested output audio format is not supported on device. - - No audio output device configured. + + Audio output restart attempt failed. + + + + + + No audio output device configured. + + + + + No audio output stream is active. - + Idle - + Sending - + Suspended - + Interrupted - + Error - + Stopped + + SplashScreen + + + WSJT-X — Welcome + + + + + WSJT-X startup information. Press Escape to close. + + + StationDialog - + Add Station - + &Band: - + &Offset (MHz): - + &Antenna: @@ -6800,184 +8681,206 @@ Error(%2): %3 TCITransceiver - + ConnectionRefused - + RemoteHostClosed - + HostNotFound - + SocketAccess - + SocketResource - + SocketTimeout - + DatagramTooLarge - + Network - + AddressInUse - + SocketAddressNotAvailable - + UnsupportedSocketOperation - + UnfinishedSocketOperation - + ProxyAuthenticationRequired - + SslHandshakeFailed - + ProxyConnectionRefused - + ProxyConnectionClosed - + ProxyConnectionTimeout - + ProxyNotFound - + ProxyProtocol - + Operation - + SslInternal - + SslInvalidUserData - + Temporary - + UnknownSocket - + + UnknownSocketError + + + + TCI websocket error: %1 - + TCI SDR could not be switched on - + TCI SDR is not switched on - + TCI RX2 could not be enabled - + TCI Audio could not be switched on - - + + TCI could not be opened - - + + + + TCI sent an invalid VFO frequency + + + + + TCI failed to set ptt - + TCI should use PTT via CAT - - + + TCI failed set rxfreq - - + + TCI failed set mode - + TCI modulator not Idle + + + TCI source commitment; playout evidence is protocol-send dead reckoning, not DAC confirmation + + + + + TCI WebSocket send progress; no radio DAC or RF playback confirmation + + TransceiverBase @@ -6995,225 +8898,230 @@ Error(%2): %3 - + Spectrum gain - + <html><head/><body><p>Enter definition for a new color palette.</p></body></html> - + Adjust... - + Total power (dB) - + Waterfall gain - + <html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html> - + % - + Spec - + <html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html> - + Flatten - - <html><head/><body><p>Compute and save a reference spectrum. (Not yet fully implemented.)</p></body></html> - - - - + Ref Spec - + Smoothing of Linear Average spectrum - + Smooth - + Compression factor for frequency scale - + + <html><head/><body><p>Controls</p></body></html> + + + + Bins/Pixel - - + + <html><head/><body><p>Position of time stamp above each interval line</p></body></html> - + Time stamp - - + + Off - + Left - + Right - + Palette - + Select waterfall palette - + Bars - + Freq - + + <html><head/><body><p>Apply a saved reference spectrum to flatten the received passband. Available after a reference spectrum has been measured. (Not yet fully implemented.)</p></body></html> + + + + <html><head/><body><p>Select data for spectral display</p></body></html> - + Current - + Cumulative - + Linear Avg - + Reference - + Q65_Sync - + <html><head/><body><p>Frequency at left edge of waterfall</p></body></html> - + Hz - + Start - + <html><head/><body><p>Decode JT9 only above this frequency</p></body></html> - + Hz - + Split - + Number of FFTs averaged (controls waterfall scrolling rate) - + N Avg - + Waterfall zero - + Spectrum zero - + User Defined - + Wide Graph - - + + Read Palette @@ -7221,22 +9129,22 @@ Error(%2): %3 WorkedBefore - + Invalid ADIF field %0: %1 - + Malformed ADIF field %0: %1 - + Invalid ADIF header - + Error opening ADIF log file for read: %0 @@ -7279,7 +9187,7 @@ Error(%2): %3 - + <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> @@ -7294,198 +9202,188 @@ Error(%2): %3 - + IARU Region: - + <html><head/><body><p>Select your IARU region.</p></body></html> - + Message generation for type 2 compound callsign holders: - + <html><head/><body><p>Type 2 compound callsigns are those with prefixes or suffixes not included in the allowed shortlist (See Help-&gt;Add-on prefixes and suffixes).</p><p>This option determines which generated messages should contain your full type 2 compound call sign rather than your base callsign. It only applies if you have a type 2 compound callsign.</p><p>This option controls the way the messages that are used to answer CQ calls are generated. Generated messages 6 (CQ) and 5 (73) will always contain your full callsign. The JT65 and JT9 protocols allow for some standard messages with your full call at the expense of another piece of information such as the DX call or your locator.</p><p>Choosing message 1 omits the DX callsign which may be an issue when replying to CQ calls. Choosing message 3 also omits the DX callsign and many versions of this and other software will not extract the report. Choosing neither means that your full callsign only goes in your message 5 (73) so your QSO partner may log the wrong callsign.</p><p>None of these options are perfect, message 3 is usually best but be aware your QSO partner may not log the report you send them.</p></body></html> - + Full call in Tx1 - + Full call in Tx3 - + Full call in Tx5 only - + Display - + Show outgoing transmitted messages in the Rx frequency window. - + &Tx messages to Rx frequency window - + Show if decoded stations are new DXCC entities or worked before. - + <html><head/><body><p>Check to have decodes for a new period start at the top of the Band Activity window and not scroll off the top when the window is full.</p><p>This is to aid selecting decodes to double-click while decoding is still in progress. Use the Band Activity vertical scroll bar to reveal decodes past the bottom of the window.</p></body></html> - + Start new period decodes at top - + Set the font characteristics for the application. - + Font... - + Set the font characteristics for the Band Activity and Rx Frequency areas. - + Decoded Text Font... - + Include a separator line between periods in the band activity window. - + &Blank line between decoding periods - + Show distance to DX station in miles rather than kilometers. - + Display dista&nce in miles - + Behavior - + Decode after EME delay - + <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> - + Disabled - + minutes - + Single decode - - <html><head/><body><p>Some rigs are not able to process CAT commands while transmitting. This means that if you are operating in split mode you may have to uncheck this option.</p></body></html> - - - - - Allow Tx frequency changes while transmitting - - - - + Don't start decoding until the monitor button is clicked. - + Mon&itor off at startup - + <html><head/><body><p>Check this if you wish to automatically return to the last monitored frequency when monitor is enabled, leave it unchecked if you wish to have the current rig frequency maintained.</p></body></html> - + Monitor returns to last used frequency - + Alternate F1-F6 bindings - + Turns off automatic transmissions after sending a 73 or any other free text message. - + Di&sable Tx after sending 73 - + Send a CW ID after every 73 or free text message. - + CW ID a&fter 73 - + Send a CW ID periodically every few minutes. This might be required under your countries licence regulations. It will not interfere with other users as it is always sent in the @@ -7493,588 +9391,623 @@ quiet period when decoding is done. - + Automatic transmission mode. - + Show &DXCC, grid, and worked-before status - + Highlight DX Grid in message - + Show DXCC for all messages - + Show the separator line between periods with time stamp of the decode period. - + Show blank line with time stamp - + Show principal prefix instead of country name - + Highlight DX Call in message - + Doubl&e-click on call sets Tx enable - + <html><head/><body><p>Open the Astronomical Data window automatically when switching to Q65 or JT65 mode and Decode after EME delay is enabled, and close it when no longer needed.</p><p>Open the QSYMessage Creator automatically if the VHF Features are enabled and such QSY messages are applicable.</p></body></html> - + Auto-open/close Astronomical data window - + Calling CQ forces Call 1st - + <html><head/><body><p>Tx until 73 is received when in MSK144 or Q65 mode. </p></body></html> - + MSK144/Q65: Tx until 73 is received - + <html><head/><body><p>Allow kHz frequency offset entry without 'k' suffix.</p></body></html> - + kHz entry without k (restart required) - + + <html><head/><body><p>Allow automatic Doppler tracking and split/Fake It/XIT to correct the transmit frequency while transmitting, including corrections of tens of kHz on microwave bands.</p><p>This option does not allow nominal dial or band changes while transmitting or tuning. Leave it unchecked if your rig cannot accept frequency-setting CAT commands while transmitting; WSJT-X will then make one midpoint Doppler correction before transmission starts.</p></body></html> + + + + + Allow Tx-frequency corrections while transmitting + + + + <html><head/><body><p>Disable the Tune watchdog.</p></body></html> - + Tune watchdog - + <html><head/><body><p>Number of seconds before Tune is aborted</p></body></html> - + + Tune watchdog timeout + + + + seconds - + Tx watchdog: - + + Tx watchdog timeout + + + + ID Inter&val: - + + CW ID interval + + + + <html><head/><body><p>Turn the progress bar red while transmitting.</p></body></html> - + Turn progress bar red while transmitting - + Additional features - + Set Rx frequency to Tx frequency after QSO - + <html><head/><body><p>If a station sends locator, calculate and show the distance in Band Activity pane.</p></body></html> - + Show distance in messages with grid - + <html><head/><body><p>Erase Band Activity and Rx frequency windows after band change.</p></body></html> - + Erase decodes after band change - + Clear DX Grid after QSO - + Show U.S. States in messages with grid - + Map Grid locator to U.S. State - + <html><head/><body><p>Align the text for DXCC, distance and azimuth.</p></body></html> - + Align DXCC/distance/azimuth - + Alternate Erase button behavior - + Clear DX Call after QSO - + <html><head/><body><p>Increase or decrease the space between message text and DXCC.</p></body></html> + DXCC alignment spacing + + + + Enable Wait features - + <html><head/><body><p>If a station sends a valid Maidenhead locator, calculate and show the great-circle azimuth in Band Activity pane.</p></body></html> - + Show azimuth in messages with grid - + <html><head/><body><p>Increase or decrease the space between DXCC and distance/azimuth.</p></body></html> - + + Distance and azimuth alignment spacing + + + + Less button coloring (restart required) - + &Radio - + Radio interface configuration settings. - + <html><head/><body><p>Use only VFO A for split operation (the program temporarily changes the QRG of your rig during transmission).</p></body></html> - + <html><head/><body><p>Use VFO A+B for split operation (works with many rigs, but requires the use of both VFOs).</p></body></html> - + <html><head/><body><p>Don't use split (not recommended).</p></body></html> - + Settings that control your CAT interface. - + CAT Control - - + + Port: - + Serial port used for CAT control. - - + + Serial Port Parameters - + Baud Rate: - + Serial port data rate which must match the setting of your radio. - + 1200 - + 2400 - + 4800 - + 9600 - + 19200 - + 38400 - + 57600 - + 115200 - + <html><head/><body><p>Number of data bits used to communicate with your radio's CAT interface (usually eight).</p></body></html> - + Data bits - + Data Bits - + D&efault - + Se&ven - + E&ight - + <html><head/><body><p>Number of stop bits used when communicating with your radio's CAT interface</p><p>(consult you radio's manual for details).</p></body></html> - + Stop bits - + Stop Bits - - + + Default - + On&e - + T&wo - + <html><head/><body><p>Flow control protocol used between this computer and your radio's CAT interface (usually &quot;None&quot; but some require &quot;Hardware&quot;).</p></body></html> - - + + Handshake - + &None - + Software flow control (very rare on CAT interfaces). - + XON/XOFF - + Flow control using the RTS and CTS RS-232 control lines not often used but some radios have it as an option and a few, particularly some Kenwood rigs, require it). - + &Hardware - + Special control of CAT port control lines. - - + + Force Control Lines - - + + High - - + + Low - + DTR: - + RTS: - + PTT Method - + <html><head/><body><p>No PTT activation, instead the radio's automatic VOX is used to key the transmitter.</p><p>Use this if you have no radio interface hardware.</p></body></html> - + VO&X - + &DTR - + Some radios support PTT via CAT commands, use this option if your radio supports it and you have no other hardware interface for PTT. - + C&AT - + R&TS - + <html><head/><body><p>Select the RS-232 serial port utilised for PTT control, this option is available when DTR or RTS is selected above as a transmit method.</p><p>This port can be the same one as the one used for CAT control.</p><p>For some interface types the special value CAT may be chosen, this is used for non-serial CAT interfaces that can control serial port control lines remotely (OmniRig for example).</p></body></html> - + Modulation mode selected on radio. - + Mode - + <html><head/><body><p>USB is usually the correct modulation mode,</p><p>unless the radio has a special data or packet mode setting</p><p>for AFSK operation.</p></body></html> - + US&B - + Don't allow the program to set the radio mode (not recommended but use if the wrong mode or bandwidth is selected). - - + + None - + Data/P&kt - + Some radios can select the audio input using a CAT command, this setting allows you to select which audio input will be used (if it is available then generally the Rear/Data option is best). - + Transmit Audio Source - + Rear&/Data - + &Front/Mic - + Rig: - + Poll Interval: - + <html><head/><body><p>Interval to poll rig for status. Longer intervals will mean that changes to the rig will take longer to be detected.</p></body></html> - + s - + <html><head/><body><p>Attempt to connect to the radio with these settings.</p><p>The button will turn green if the connection is successful or red if there is a problem.</p></body></html> - + Test CAT - + Attempt to activate the transmitter. Click again to deactivate. Normally no power should be output since there is no audio being generated at this time. @@ -8083,47 +10016,47 @@ radio interface behave as expected. - + Test PTT - + Split Operation - + Fake It - + Rig - + A&udio - + Audio interface settings - + Souncard - + Soundcard - + Select the audio CODEC to use for transmitting. If this is your default device for system sounds then ensure that all system sounds are disabled otherwise @@ -8132,76 +10065,76 @@ transmitting periods. - + <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> - + Outgoing interfaces: - + <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> - + <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> - + Multicast TTL: - + Days since last upload - + Select the audio CODEC to use for receiving. - + &Input: - + Select the channel to use for receiving. - - + + Mono - - + + Left - - + + Right - - + + Both - + Select the audio channel used for transmission. Unless you have multiple radios connected on different channels; then you will usually want to select mono or @@ -8209,298 +10142,326 @@ both here. - + Enable VHF and submode features - - + + Update Hamlib - + 32-bit - + <html><head/><body><p>Revert the last Hamlib update. </p><p>Note: This function is only available on Windows.</p></body></html> - + Revert Update - - <html><head/><body><p>Download the latest libhamlib-4.dll file from https://n0nb.users.sourceforge.net/. </p><p>Note: This function is only available on Windows.</p></body></html> - - - - + In use: - + Backed up: - + 64-bit - + Rig Data - + <html><head/><body><p>Stop transmitting immediately when SWR exceeds 2.5.</p></body></html> - + Halt Tx when SWR > 2.5 - + <html><head/><body><p>Read and display transmit PWR and SWR of your rig.</p></body></html> - + Read and display PWR and SWR - + Ou&tput: - + + Output audio channel + + + + + Input audio channel + + + + <html><head/><body><p>Refresh audio device list.</p></body></html> - + Refresh - + <html><head/><body><p>Use TCI Audio when available.</p></body></html> - + Use TCI Audio (restart required) - + <html><head/><body><p>Rx audio level</p></body></html> - + + TCI receive audio level + + + + Rx - + <html><head/><body><p>Sort audio device names alphabetically.</p></body></html> - + Sort alphabetically - + <html><head/><body><p>Hide the usually unusable ALSA CARD subdevices on Linux.</p></body></html> - + Hide ALSA CARD subdevices (Linux only) - - + + Save Directory - + Loc&ation: - + Path to which .WAV files are saved. - - + + TextLabel - + Click to select a different save directory for .WAV files. - + S&elect - - + + AzEl Directory - + Location: - + Select - + <html><head/><body><p>Enables additional line in azel.dat for Dpol parameter.</p></body></html> - + Enable extra line in azel.dat - + Power Memory By Band - + Remember power settings by band - + Enable power memory during transmit - + Transmit - + Enable power memory during tuning - + Tune - + Tx &Macros - + Canned free text messages setup - + + New &macro: + + + + &Add - - &Delete + + Add Tx macro - - Drag and drop items to rearrange order -Right click for item specific actions -Click, SHIFT+Click and, CRTL+Click to select items + + Adds the entered message to the saved Tx macro list. + + + + + New Tx macro message + + + + + Enter a saved free-text message for the Tx5 dropdown. Free-text messages are limited to 13 characters including spaces. + + + + + &Delete - + Reportin&g - + Reporting and logging settings - + Logging - + <html><head/><body><p>Check this option to note any Special Operating Activity in the comments field.</p></body></html> - + Special operating activity to comments - + The program will pop up a partially completed Log QSO dialog when you send a 73 or free text message. - + Promp&t me to log QSO - + <html><head/><body><p>Log 'ZZ00' as grid if the other station doesn't send you a grid.</p></body></html> - + Fill missing grids with 'ZZ00' - + Op Call: - + Some logging programs will not accept the type of reports saved by this program. Check this option to save the sent and received reports in the @@ -8508,1092 +10469,1353 @@ comments field. - + d&B reports to comments - + <html><head/><body><p>Some logging programs will not accept WSJT-X mode names.</p></body></html> - + Con&vert mode to RTTY - + <html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html> - + + <html><head/><body><p>Download the latest libhamlib-4.dll file from Hamlib SourceForge snapshots. </p><p>Note: This function is only available on Windows.</p></body></html> + + + + + Delete Tx macro + + + + + Deletes the selected Tx macro, or the focused macro if no row is selected. + + + + + Move &Up + + + + + Move Tx macro up + + + + + Moves the selected Tx macro one position earlier in the list. + + + + + Move D&own + + + + + Move Tx macro down + + + + + Moves the selected Tx macro one position later in the list. + + + + + Drag and drop items to rearrange order +Right click for item specific actions +Click, SHIFT+Click and, CTRL+Click to select items + + + + + Saved Tx macro messages + + + + + Saved free-text messages for the main window Tx5 dropdown. Use Move Up and Move Down or drag and drop to reorder messages. + + + + <html><head/><body><p>Check to have QSOs logged automatically, when complete.</p></body></html> - + Network Services - + Enable &PSK Reporter Spotting - + UDP Server - + UDP Server: - + <html><head/><body><p>Optional hostname of network service to receive decodes.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the broadcasting of UDP status updates.</p></body></html> - + UDP Server port number: - + <html><head/><body><p>With this enabled WSJT-X will accept certain requests back from a UDP server that receives decode messages.</p></body></html> - + Accept UDP requests - + <html><head/><body><p>Indicate acceptance of an incoming UDP request. The effect of this option varies depending on the operating system and window manager, its intent is to notify the acceptance of an incoming UDP request even if this application is minimized or hidden.</p></body></html> - + Notify on accepted UDP request - + <html><head/><body><p>Restore the window from minimized if an UDP request is accepted.</p></body></html> - + Accepted UDP request restores window - + Secondary UDP Server (deprecated) - + <html><head/><body><p>When checked, WSJT-X will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html> - + Enable logged contact ADIF broadcast - + Server name or IP address: - + <html><head/><body><p>Optional host name of N1MM Logger+ program to receive ADIF UDP broadcasts. This is usually 'localhost' or ip address 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable broadcasting of ADIF information via UDP.</p></body></html> - + Server port number: - + <html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html> - + Frequencies - + Default frequencies and band specific station details setup - + <html><head/><body><p>See &quot;Frequency Calibration&quot; in the WSJT-X User Guide for details of how to determine these parameters for your radio.</p></body></html> - + Frequency Calibration - + Slope: - + ppm - + Intercept: - + Hz - + Working Frequencies - + + + Insert, delete, load, save, merge, or reset working frequencies. + + + + + Working frequencies actions + + + + + + + Actions... + + + + <html><head/><body><p>Right click to maintain the working frequencies list.</p></body></html> - + Station Information - - Items may be edited. -Right click for insert and delete options. + + + Insert or delete station information rows. - - Colors - Colours + + Station information actions + - - Decode Highlightling + + Items may be edited. +Right click for insert and delete options. - - Reset Highlighting to WSJT-X default - + + Colors + Colours - - Reset Highlighting to WSJT-X Improved default + + Decode Highlightling - + <html><head/><body><p>Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.</p><p>Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.</p></body></html> - + <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> - + <html><head/><body><p>Check to indicate new DXCC entities, grid squares, and callsigns per mode.</p></body></html> - + Highlight by Mode - + <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> - - How this program activates the PTT on your radio? - - - - + <html><head/><body><p>Use the RS-232 DTR control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The DTR control line of the CAT serial port may be used for this or a DTR control line on a different serial port may be used.</p></body></html> - + <html><head/><body><p>Use the RS-232 RTS control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The RTS control line of the CAT serial port may be used for this or a RTS control line on a different serial port may be used. Note that this option is not available on the CAT serial port when hardware flow control is used.</p></body></html> - + If this is available then it is usually the correct mode for this program. - + <html><head/><body><p>The program can send your station details and all decoded signals with grid squares as spots to the http://pskreporter.info web site.</p><p>This is used for reverse beacon analysis which is very useful for assessing propagation and system performance.</p></body></html> - + <html><head/><body><p>Check this option if a reliable connection is needed</p><p>Most users do not need this, the default uses UDP which is more efficient. Only check this if you have evidence that UDP traffic from you to PSK Reporter is being lost.</p></body></html> - + Use TCP/IP connection - + Rescan ADIF Log - + Include extra WAE entities - + Check to for grid highlighting to only apply to unworked grid fields - + Only grid Fields sought - + <html><head/><body><p>Controls for Logbook of the World user lookup.</p></body></html> - + Logbook of the World User Validation - + Users CSV file URL: - + <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> - - URL - - - - + <html><head/><body><p>Push this button to fetch the latest LotW user's upload date and time data file.</p></body></html> - + Fetch Now - + Age of last upload less than: - + <html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html> - + days - + Advanced - + <html><head/><body><p>User-selectable parameters for JT65 VHF/UHF/Microwave decoding.</p></body></html> - + JT65 VHF/UHF/Microwave decoding parameters - + Random erasure patterns: - + <html><head/><body><p>Maximum number of erasure patterns for stochastic soft-decision Reed Solomon decoder is 10^(n/2).</p></body></html> - + Aggressive decoding level: - + <html><head/><body><p>Higher levels will increase the probability of decoding, but will also increase probability of a false decode.</p></body></html> - + Two-pass decoding - + <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> - - + + Hound - + <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> - + NA VHF Contest - + <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> - - + + Fox - + <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> - - + + EU VHF Contest - - R T T Y Roundup - - - - - RTTY Roundup exchange - - - - + NJ - - + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> - - A R R L Field Day - - - - + + ARRL Field Day - + + Field Day exchange - + FD Exch: - + 6A SNJ - + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> - - WW Digital Contest - - - - + + WW Digi Contest - + Miscellaneous - + Degrade S/N of .wav file: - - + + For offline sensitivity tests - - + + dB - + Log automatically - + <html><head/><body><p>Use 'Log automatically' only for special operating activities.</p></body></html> - + Contesting only - + <html><head/><body><p>Shorten 6-digit grid entries and log 4-digit grids instead.</p></body></html> - + Log 4-digit grids - + Highlight also messages with 73 or RR73 - - - <html><head/><body><p>Highlight callsigns or grids with orange background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - - - - + Highlight orange: - - - <html><head/><body><p>Highlight callsigns or grids with blue background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - - - - + Highlight blue: - + http://lotw.arrl.org/lotw-user-activity.csv - + CTY File Download - + CTY File Version: - + Download Latest CTY.dat - + CALL3 File Download - + CALL3 File Version: - + Dowload latest CALL3.TXT file. - + Download CALL3.TXT for terrestrial use - + Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. - + Download CALL3.TXT for EME - + GUI tweaks for high-resolution monitors - + <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> - + HighDPI scaling (restart required) - + <html><head/><body><p>Increased height of some control elements.</p></body></html> - + Increased height of the tab widget (restart required) - - Enable Cloudlog Features - - - - + API URL: - + API Key: - - Station ID: - - - - - <html><head/><body><p>Test the Cloudlog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> - - - - - Test API Key - - - - + Special operating activity - + <html><head/><body><p>ARRL International Digital Contest</p></body></html> - + ARRL Digi Contest - + <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> - + NCCC Sprint - - + + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> - + + FT Roundup messages - + FT RU Exch: - + <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> - + SuperFox mode - + <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> - + Show OTP messages - + OTP URL: - + <html><head/><body><p>URL used to verify OTP codes.</p></body></html> - + https://www.9dx.cc - + NA VHF - + <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> - + OTP - + Key: - + <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> - + M2ZUU5CW6EVOY2HU - + Interval - + <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> - + <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> - + CQ with individual contest name - + Contest name: - + <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> - + Q65 Pileup - + Receiver bandwidth: - + + Change or reset colors for the selected highlighting rule. + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move Up + + + + + Move the selected highlighting rule later in priority order. + + + + + Move Down + + + + + Reset Highlighting to Default 1 + + + + + Reset Highlighting to Default 2 + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with orange background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with blue background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + LotW users CSV URL + + + + + + <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> + + + + + Cloudlog or Wavelog + + + + + + Upload QSOs to Cloudlog or Wavelog + + + + + + <html><head/><body><p>API URL for Cloudlog or Wavelog.</p></body></html> + + + + + + <html><head/><body><p>Your API key.</p></body></html> + + + + + + <html><head/><body><p>Your Cloudlog or Wavelog station profile.</p></body></html> + + + + + Station profile: + + + + + <html><head/><body><p>Check the Cloudlog or Wavelog connection, API key, station profile, and upload path where safe.</p><p>The button will turn green if the connection can upload QSOs, orange if the key is valid but read-only, and red if the configuration is unusable.</p></body></html> + + + + + Check Connection + + + + Hz - + Tx delay: - + Minimum delay between assertion of PTT and start of Tx audio. - + s - - + + Tone spacing - + <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> - + + 2x tone spacing + + + + x 2 - + <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> - + + 4x tone spacing + + + + x 4 - - + + Waterfall spectra - + Low sidelobes - + Most sensitive - + + + <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> + + + + + eQSL.cc + + + + + + Upload QSOs to eQSL.cc + + + + + + <html><head/><body><p>Your username.</p></body></html> + + + + + Username: + + + + + + <html><head/><body><p>Your logon password.</p></body></html> + + + + + Password: + + + + + + <html><head/><body><p>Your QTH nickname, if you have more than one QTH.</p></body></html> + + + + + QTH: + + + + + + Enable special operating activity + + + + + Enable OTP verification + + + + + + OTP key + + + + + + OTP interval + + + + + + OTP URL + + + + + + FT Roundup exchange + + + + + + Contest name + + + + Alerts - - Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. + + NOTES + + + + + "Wanted callsigns, grids, prefixes and directional calls" uses the entries from "Highlight orange" and "Highlight blue". + + + + + <html><head/><body><p>Wanted callsigns, grids, prefixes and directional calls. This alert category uses the entries from &quot;Highlight orange&quot; and &quot;Highlight blue&quot;.</p></body></html> - - THIS FEATURE IS FOR EXPERIENCED USERS ONLY + + Wanted callsigns, grids, prefixes and directional calls - + + IMPORTANT + + + + + Voices: + + + + + default + + + + + <html><head/><body><p>Test the alert sounds.</p></body></html> + + + + + Test + + + + + Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. + + + + Ensure that you have made meaningful settings on the Colors tab, so that you see which message triggered the alert. - + Ensure that your rig is NOT connected via "Default Device". - + Audio Alerts - - + + New ITU Zone on Band - - + + New Continent - - + + DX Call or DX Grid in message - - + + New Grid - - + + New Continent on Band - + Message received - - + + New ITU Zone - - + + New CQ Zone - - + + New DXCC on Band - + My Call in message - + My Call - - + + New CQ Zone on Band - - + + New DXCC - - + + New Grid on Band - - + + CQ in message - + Toggle Audio Alerts on/off. Alerts will be played on "DefaultAudioDevice". DON'T ENABLE AUDIO ALERTS WHEN YOUR RIG IS CONNECTED VIA THIS SOUNDCARD !!! - + Enable Audio Alerts - + This requirement is fulfilled when your rig is connected via USB audio. - + Audio Alerts will be played on the default audio device (usually the loudspeaker of your PC). - - IMPORTANT NOTES - - - - + Use of this feature requires that your computer is equipped with two sound cards. - + Filters - + Territories 1-4 for the Hide checkboxes in the View menu - + Blacklist - + Filters for the Band Activity window - + Hide messages containing the following callsigns or keywords: - + Show only messages containing the following callsigns or keywords: - + <html><head/><body><p>Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed).</p></body></html> - + Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed) - + Always pass messages with the following keywords: - + Whitelist - + <html><head/><body><p>Apply filters only to the callsigns of the calling stations. Usually the second word of the messages is analyzed, for directional calls the third word.</p></body></html> - + Apply filters only to the callsigns of the calling stations - + Always Pass - + <html><head/><body><p>Use “worked today and yesterday” instead of “worked today” for the 3 related Quick Filters.</p></body></html> - + Quick Filters: Hide/Ignore/Highlight "worked today and yesterday" instead of "worked today" (UTC) - + <html><head/><body><p>Discard (Cancel) or apply (OK) configuration changes including</p><p>resetting the radio interface and applying any soundcard changes</p></body></html> @@ -9601,53 +11823,114 @@ Right click for insert and delete options. main - + + Lock file: %1 + + + + + Owner process: %1 + + + + + Owner application: %1 + + + + + Owner host: %1 + + + + + Owner information is not available. + + + + + Remove error: %1 + + + + + Another instance may be running + + + + + WSJT-X could not lock its temporary instance file. + +If another WSJT-X window is still running, choose No. +Use a unique rig name to run more than one instance. + +If WSJT-X crashed or will not restart, choose Remove Lock File. +Choose Retry after closing the other instance. + + + + + Remove Lock File + + + + + Unable to remove stale lock file + + + + + Close any running WSJT-X instance or remove the lock file manually after confirming WSJT-X is not running. + + + + Failed to create a temporary directory - - + + Path: "%1" - + Failed to create a usable temporary directory - + Another application may be locking the directory - + Failed to create data directory - + path: "%1" - + Shared memory error - + Unable to create shared memory segment - + Sub-process error - + Failed to close orphaned jt9 process diff --git a/translations/wsjtx_es.ts b/translations/wsjtx_es.ts index d456451d..c154174b 100644 --- a/translations/wsjtx_es.ts +++ b/translations/wsjtx_es.ts @@ -6,7 +6,6 @@ &Delete ... - &Borrar ... &Borrar... @@ -20,7 +19,6 @@ Are you sure you want to delete the %n selected QSO(s) from the log? - ¿Estás seguro de que deseas eliminar los %n QSO's seleccionados en el log? NO HABÍA TRADUCCIÓN PARA EL PLURAL ¿Está seguro de que desea borrar los %n QSO's seleccionados del log? ¿Está seguro de que desea borrar los %n QSO's seleccionados del log? @@ -61,12 +59,12 @@ <html><head/><body><p>Points logged during the past hour.</p></body></html> - <html><head/><body><p>Puntos registados durante la última hora</p></body></html> + <html><head/><body><p>Puntos registrados durante la última hora</p></body></html> <html><head/><body><p>Check this box to show only stations ready to be called.</p></body></html> - <html><head/><body><p>Marca esta casilla pra mostrar solo estaciones listas para ser llamadas</p></body></html> + <html><head/><body><p>Marca esta casilla para mostrar solo estaciones listas para ser llamadas</p></body></html> @@ -101,7 +99,7 @@ <html><head/><body><p>Set maximum number of displayed lines.</p></body></html> - <html><head/><body><p>Ajustar número máximo de líneas mostrdas</p></body></html> + <html><head/><body><p>Ajustar número máximo de líneas mostradas</p></body></html> @@ -116,7 +114,7 @@ <html><head/><body><p>Click on a line to call that station. </p><p>When using QMAP, single click to transfer QSO data and sked frequency to WSJT-X, and double click to call that station.</p></body></html> - <html><head/><body><p>Haga clic sobre una línea pra llama a esa estación. </p><p>Cuando se use QMAP, un clic para transfereir los datos del QSO y frecuencia programada a WSJT-X, y doble clic para llamar a esa estación</p></body></html> + <html><head/><body><p>Haga clic sobre una línea para llamar a esa estación. </p><p>Cuando se use QMAP, un clic para transferir los datos del QSO y frecuencia programada a WSJT-X, y doble clic para llamar a esa estación</p></body></html> @@ -124,18 +122,17 @@ Estaciones activas - - + Wanted only Solo buscados - + Message Mensaje - + My call only Solo mi indicativo @@ -143,176 +140,191 @@ Astro - - + + Doppler tracking Seguimiento Doppler - + <html><head/><body><p>One station does all Doppler shift correction, their QSO partner receives and transmits on the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> - <html><head/><body><p>Una estación realiza toda la corrección de desplazamiento Doppler, su corresponsal de QSO recibe y transmite en la frecuencia marcada.</p><p>Si el equipo no acepta comandos CAT QSY mientras se transmite, se aplica una única corrección para todo el período de transmisión.</p></body></html> <html><head/><body><p>Una estación realiza toda la corrección de desplazamiento Doppler, su corresponsal recibe y transmite en la frecuencia pactada.</p><p>Si el equipo no acepta comandos CAT QSY mientras se transmite, se aplica una única corrección para todo el período de transmisión.</p></body></html> - + Full Doppler to DX Grid - Doppler completo en la parrilla de DX "Full Doppler" al locator DX - + <html><head/><body><p>Transmit takes place on sked frequency and receive frequency is corrected for own echoes. </p><p>This mode can be used for calling CQ, or when using Echo mode.</p></body></html> - <html><head/><body><p>La transmisión tiene lugar en la frecuencia marcada y la frecuencia de recepción se corrige por los propios ecos.</p><p>Este modo se puede usar para llamar a CQ o cuando se usa el modo Eco.</p></body></html> <html><head/><body><p>La transmisión tiene lugar en la frecuencia pactada y la frecuencia de recepción se corrige por los propios ecos.</p><p>Este modo se puede usar para llamar CQ o cuando se usa el modo Eco.</p></body></html> - + Own Echo Propio Eco - + <html><head/><body><p>Both stations correct for Doppler shift such that they would be heard on the moon at the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p><p>Use this option also for Echo mode.</p></body></html> - <html><head/><body><p>Ambas estaciones corrigen el cambio Doppler de tal manera que se escuchen en la Luna a la frecuencia marcada.</p><p>Si el equipo no acepta comandos CAT QSY mientras se transmite, se aplica una única corrección para todo el período de transmisión.</p><p>Usa esta opción también para el modo Eco.</p></body></html> <html><head/><body><p>Ambas estaciones corrigen el efecto Doppler de tal manera que se escuchen en la luna a la frecuencia pactada.</p><p>Si el equipo no acepta comandos CAT QSY mientras se transmite, se aplica una única corrección para todo el período de transmisión.</p><p>Use esta opción también para el modo Eco.</p></body></html> - + Constant frequency on Moon Frecuencia constante en la luna - + <html><head/><body><p>DX station announces their TX Freq, which is entered as the Sked Freq. Correction applied to RX and TX so you appear on the DX's station's own echo Freq.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> - <html><head/><body><p>La estación DX anuncia su frecuencia de TX, que se ingresa como Sked Freq. La corrección aplicada a RX y TX para que aparezca en la propia frecuencia de eco de la estación DX.</p><p>Si el equipo no acepta comandos CAT QSY mientras se transmite, se aplica una única corrección para todo el período de transmisión.</p></body></html> - <html><head/><body><p>Las estaciónes DX anuncian su frecuencia de TX, la cual es escrita en la frecuencia pactada. La corrección se aplica a RX y TX para que aparezca en la propia frecuencia de eco de la estación DX.</p><p>Si el equipo no acepta comandos CAT QSY mientras se transmite, se aplica una única corrección para todo el período de transmisión.</p></body></html> + <html><head/><body><p>Las estaciones DX anuncian su frecuencia de TX, la cual es escrita en la frecuencia pactada. La corrección se aplica a RX y TX para que aparezca en la propia frecuencia de eco de la estación DX.</p><p>Si el equipo no acepta comandos CAT QSY mientras se transmite, se aplica una única corrección para todo el período de transmisión.</p></body></html> - + On DX Echo Encender DX Eco - + <html><head/><body><p>Tune radio manually and select this mode to put your echo on the same frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> - <html><head/><body><p>Sintoniza el equipo manualmente y selecciona este modo para poner tú eco en la misma frecuencia.</p><p>Si el equipo no acepta comandos CAT QSY mientras se transmite, se aplica una única corrección para todo el período de transmisión.</p></body></html> <html><head/><body><p>Sintoniza el equipo manualmente y selecciona este modo para poner tu eco en la misma frecuencia.</p><p>Si el equipo no acepta comandos CAT QSY mientras se transmite, se aplica una única corrección para todo el período de transmisión.</p></body></html> - + Call DX - Indicativo de DX Llamar DX - + <html><head/><body><p>No Doppler shift correction is applied. This may be used when the QSO partner does full Doppler correction to your grid square.</p></body></html> - <html><head/><body><p>No se aplica la corrección de desplazamiento Doppler. Esto se puede utilizar cuando el otro corresponsal de QSO realiza una corrección Doppler completa en tú locator.</p></body></html> <html><head/><body><p>No se aplica la corrección de efecto Doppler. Esto puede utilizarse cuando el corresponsal realice una corrección Doppler completa hacia tu locator.</p></body></html> - + None Ninguno - + Sked frequency - Frecuencia Sked Frecuencia pactada - - + + 0 0 - + + kHz + + + + + Set kHz + + + + + <html><head/><body><p>Tx shift relative to Rx sked frequency</p></body></html> + + + + + MHz + + + + + Tx Shift + + + + Rx: RX: - + Tx: TX: - <html><head/><body><p>Press and hold the CTRL key to adjust the sked frequency manually with the rig's VFO dial or enter frequency directly into the band entry field on the main window.</p></body></html> - <html><head/><body><p>Presiona y mantén presionada la tecla CTRL para ajustar la frecuencia sked manualmente con el dial VFO del equipo o introduce la frecuencia directamente en el campo de entrada de banda en la ventana principal.</p></body></html> - <html><head/><body><p>Presiona y mantén presionada la tecla CTRL para ajustar la frecuencia pactada manualmente con el VFO del equipo o introduce la frecuencia directamente en el campo de entrada de banda en la ventana principal.</p></body></html> + <html><head/><body><p>Presiona y mantén presionada la tecla CTRL para ajustar la frecuencia pactada manualmente con el VFO del equipo o introduce la frecuencia directamente en el campo de entrada de banda en la ventana principal.</p></body></html> - + Echo Mode Modo Echo - + Hz Hz - + RIT RIT - Dither - Dither + Dither - Tx Shift relative to Rx Sked Freq - Desplazamiento TX relativo a RX frec pautada + Desplazamiento de TX relativo a la frecuencia RX pactada - Enter large offset - Escriba un desplazamiento grande + Introduzca un desplazamiento grande - MHz - MHz + MHz - Shift - Desplazamiento + Desplazamiento - + Enable Activado - + + Dither + + + + + Ctl-Lock Sked Freq + + + + Astro Data Datos Astro - + Astronomical Data - Configuración para clonar desde Datos astronómicos Datos Astronómicos Doppler Tracking Error - Error de seguimiento de Doppler Seguimiento de error Doppler Split operating is required for Doppler tracking - Se requiere un funcionamiento dividido para el seguimiento Doppler Operación en "Split" es requerida para seguimiento Doppler Go to "Menu->File->Settings->Radio" to enable split operation - Ves a "Menú-> Archivo-> Configuración-> Radio" para habilitar la operación dividida Ir a "Menú - Archivo - Ajustes - Radio" para habilitar la operación en "Split" @@ -321,7 +333,6 @@ Band name - Nombre de la Banda Nombre de la banda @@ -367,7 +378,6 @@ CPlotter &Set Rx && Tx Offset - &Define el desplazamiento de RX && TX E&stablecer frecuencia de RX y TX @@ -376,7 +386,6 @@ Freq(MHz) - Frecuencia en MHz Freq.(MHz) @@ -387,7 +396,6 @@ Date & Time(UTC) - Fecha y Hora en UTC Fecha y Hora (UTC) @@ -421,13 +429,11 @@ <html><head/><body><p>Right-click here for available actions.</p></body></html> - <html><head/><body><p>Haz clic derecho aquí para ver las acciones disponibles.</p></body></html> <html><head/><body><p>Clic derecho aquí para ver las opciones disponibles.</p></body></html> Right-click here for available actions. - Haz clic derecho aquí para ver las acciones disponibles. Clic derecho aquí para ver las opciones disponibles. @@ -444,6 +450,166 @@ Indicativo + + Cloudlog + + + + QSO could not be sent to Cloudlog. + + + + + + QSO upload was rejected by Cloudlog. + + + + + HTTP status %1. Response was not JSON. + + + + + Cloudlog returned an unexpected upload response. + + + + + Cloudlog reported upload status: %1 + + + + + HTTP status %1. + + + + + Cloudlog::impl + + + Enter a Cloudlog or Wavelog URL. + + + + + The connection check needs a base URL before it can contact the API. + + + + + Cloudlog or Wavelog authentication endpoint was not found. + + + + + Tried /api/check_auth, /index.php/api/check_auth, and /index.php/api/auth. + + + + + API key is valid but read-only. + + + + + Generate a read/write API key before enabling QSO uploads. + + + + + API key is invalid. + + + + + Authentication response was not usable. + + + + + Station profile response was not JSON. + + + + + Configured station profile was not found. + + + + + No station profiles were returned by the server. + + + + + Available station profiles: %1 + + + + + Wavelog dry-run QSO endpoint was not found. + + + + + Tried /api/qso/true and /index.php/api/qso/true after Wavelog was identified. + + + + + Dry-run upload response was not usable. + + + + + + Connection check passed. + + + + + Writable API key, station profile, and dry-run QSO upload were validated. + + + + + Dry-run QSO upload was rejected. + + + + + + The QSO dry-run upload was rejected. + + + + + Dry-run QSO upload returned an unexpected response. + + + + + Writable API key and station profile were validated. No safe dry-run QSO endpoint was identified, so no test QSO was uploaded. + + + + + Network error while checking Cloudlog or Wavelog. + + + + + Cloudlog Error! + + + + + Reason: %1 + + + ColorHighlighting @@ -464,7 +630,6 @@ K1ABC - EA3RDG EA1ABC @@ -490,7 +655,6 @@ New Grid - Nuevo Locator/Grid Nuevo locator @@ -506,7 +670,6 @@ New Grid on Band - Nuevo Locator/Grid en banda Nuevo locator en banda @@ -517,19 +680,16 @@ Uploads to LotW - Subidas a LotW Subidas a LoTW New Continent - Nuevo Continente Nuevo continente New Continent on Band - Nuevo Continente en banda Nuevo continente en banda @@ -556,266 +716,476 @@ Configuration::impl - - - + + + &Delete &Borrar - - + + &Insert ... - &Introducir ... &Agregar... - - Failed to create save directory - No se pudo crear el directorio para guardar - No se pudo crear el directorio "Save" + + Wanted territory %1 + - - path: "%1% - ruta: "%1% + + Blacklist keyword %1 + - - Failed to create samples directory - No se pudo crear el directorio de ejemplos - No se pudo crear el directorio "Samples" + + Whitelist keyword %1 + - - path: "%1" - ruta: "%1" + + Always pass keyword %1 + - - API key OK - Clave API OK + + CAT control port + - - API key read-only - Clave API solo lectura + + CAT baud rate + - - API key invalid - Clave API invalida + + Default CAT data bits + - - &Load ... - &Carga ... - &Cargar ... + + Seven CAT data bits + - - &Save as ... - &Guardar como ... - &Guardar como ... + + Eight CAT data bits + - - &Merge ... - &Fusionar ... - &Fusionar ... + + Default CAT stop bits + - - &Reset - &Reiniciar + + One CAT stop bit + - - Serial Port: - Puerto Serie: + + Two CAT stop bits + - - Serial port used for CAT control - Puerto serie utilizado para el control CAT + + Default CAT handshake + - - TCI Server: - Servidor TCI: + + No CAT handshake + - - Optional hostname and port of TCI service. -Leave blank for a sensible default on this machine. -Formats: - hostname:port - IPv4-address:port - [IPv6-address]:port - Hostname y puerto opcionales del servicio TCI. -Dejar en blanco para un valor predeterminado. -Formatos: - hostname:puerto - Dirección IP IPv4-:puerto - [Dirección IP IPv6]:puerto + + XON/XOFF CAT handshake + - - Network Server: - Servidor de red: + + Hardware CAT handshake + - - Optional hostname and port of network service. -Leave blank for a sensible default on this machine. -Formats: - hostname:port - IPv4-address:port - [IPv6-address]:port - Hostname opcional y puerto de acceso del servicio de red. -Déjalo en blanco para un valor predeterminado razonable en esta máquina. -Formatos: - hostname:port - dirección IPv4:port - [dirección IPv6]:port - "Hostname" y puerto del servicio de red. -Dejar en blanco para un valor predeterminado en esta máquina. -Formatos: - hostname:port - dirección IPv4:port - [dirección IPv6]:port + + Force DTR control line + - - USB Device: - Dispositivo USB: + + Force RTS control line + - - Optional device identification. -Leave blank for a sensible default for the rig. -Format: - [VID[:PID[:VENDOR[:PRODUCT]]]] - Identificación opcional del dispositivo. -Deja en blanco un valor predeterminado razonable para el equipo. -Formato: - [VID[:PID[:VENDOR[:PRODUCT]]]] - Identificación opcional del dispositivo. -Deja en blanco un valor predeterminado para el equipo. -Formato: - [VID[:PID[:VENDOR[:PRODUCT]]]] + + VOX PTT method + - - - Invalid audio input device - El dispositivo de entrada de audio no es válido - Dispositivo de entrada de audio no válido + + DTR PTT method + - - - - Frequency files (*.qrg *.qrg.json);;All files (*.*) - Archivos de frecuencias (*.qrg *.qrg.json);;Todos los archivos (*.*) + + CAT PTT method + - Invalid audio out device - El dispositivo de salida de audio no es válido - Dispositivo de salida de audio no válido + + RTS PTT method + - - Invalid audio output device - Dispositivo de salida de audio no válido + + PTT control port + - - Invalid PTT method - El método de PTT no es válido - Método PTT no válido + + Rear or data transmit audio source + - - Invalid PTT port - El puerto del PTT no es válido - Puerto PTT no válido + + Front or mic transmit audio source + - - - Invalid Contest Exchange - Intercambio de concurso no válido + + No radio mode control + - - You must input a valid ARRL Field Day exchange - Debes introducir un intercambio de Field Day del ARRL válido - Debe introducir un intercambio válido para el ARRL Field Day + + USB radio mode + - - You must input a valid ARRL RTTY Roundup exchange - Debes introducir un intercambio válido de la ARRL RTTY Roundup - Debe introducir un intercambio válido para el ARRL RTTY Roundup + + Data or packet radio mode + - - Pending DNS lookup, please try again later - Búsqueda de DNS pendiente, inténtelo de nuevo más tarde + + No split operation + - - - Reset Decode Highlighting - Restablecer Resaltado de Decodificación - Restablecer resaltado de colores de decodificados + + Rig split operation + - - - Reset all decode highlighting and priorities to default values - Restablecer todo el resaltado y las prioridades de decodificación a los valores predeterminados - Restablecer todo el resaltado de colores y prioridades a los valores predeterminados + + Fake It split operation + - - Error Loading CTY.DAT - Error cargando CTY.DAT + + CAT poll interval + - - Error Loading CALL3.TXT file - Error cargando archivo CALL3.TXT + + Frequency calibration slope + - - WSJT-X Decoded Text Font Chooser - Tipo de texto de pantalla de descodificación WSJT-X - Seleccionar un tipo de letra + + Frequency calibration intercept + - - - Hamlib update only available on Windows. - Actualización de Hamlib solo está disponible en Windows + + Working frequencies table + - - Error Loading libhamlib-4.dll - Error cargando libhamlib-4.dll + + Station information table + - - Hamlib Update successful - -New Hamlib will be used after restart + + Decode highlighting rules + + + + + Highlighting rules and priorities for decoded messages. + + + + + Decode highlighting actions + + + + + Change or reset colors for the selected highlighting rule. + + + + + Move selected highlighting rule up + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move selected highlighting rule down + + + + + Move the selected highlighting rule later in priority order. + + + + + Orange highlight callsigns and grids + + + + + Blue highlight callsigns and grids + + + + + Failed to create save directory + No se pudo crear el directorio "Save" + + + + path: "%1% + ruta: "%1% + + + + Failed to create samples directory + No se pudo crear el directorio "Samples" + + + + path: "%1" + ruta: "%1" + + + API key OK + Clave API OK + + + API key read-only + Clave API solo lectura + + + API key invalid + Clave API inválida + + + + &Load ... + &Cargar ... + + + + &Save as ... + &Guardar como ... + + + + &Merge ... + &Fusionar ... + + + + &Reset + &Reiniciar + + + + Serial Port: + Puerto Serie: + + + + Serial port used for CAT control + Puerto serie utilizado para el control CAT + + + + TCI Server: + Servidor TCI: + + + + Optional hostname and port of TCI service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port + Hostname y puerto opcionales del servicio TCI. +Dejar en blanco para un valor predeterminado. +Formatos: + hostname:puerto + Dirección IP IPv4-:puerto + [Dirección IP IPv6]:puerto + + + + Network Server: + Servidor de red: + + + + Optional hostname and port of network service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port + "Hostname" y puerto del servicio de red. +Dejar en blanco para un valor predeterminado en esta máquina. +Formatos: + hostname:port + dirección IPv4:port + [dirección IPv6]:port + + + + USB Device: + Dispositivo USB: + + + + Optional device identification. +Leave blank for a sensible default for the rig. +Format: + [VID[:PID[:VENDOR[:PRODUCT]]]] + Identificación opcional del dispositivo. +Deja en blanco un valor predeterminado para el equipo. +Formato: + [VID[:PID[:VENDOR[:PRODUCT]]]] + + + + + Invalid audio input device + Dispositivo de entrada de audio no válido + + + + Reset all decode highlighting and priorities to Default 1 values + + + + + Reset all decode highlighting and priorities to Default 2 values + + + + + + + Frequency files (*.qrg *.qrg.json);;All files (*.*) + Archivos de frecuencias (*.qrg *.qrg.json);;Todos los archivos (*.*) + + + Invalid audio out device + Dispositivo de salida de audio no válido + + + + Invalid audio output device + Dispositivo de salida de audio no válido + + + + Invalid PTT method + Método PTT no válido + + + + Invalid PTT port + Puerto PTT no válido + + + + + Invalid Contest Exchange + Intercambio de concurso no válido + + + + You must input a valid ARRL Field Day exchange + Debe introducir un intercambio válido para el ARRL Field Day + + + + You must input a valid ARRL RTTY Roundup exchange + Debe introducir un intercambio válido para el ARRL RTTY Roundup + + + + Pending DNS lookup, please try again later + Búsqueda de DNS pendiente, inténtelo de nuevo más tarde + + + + + Reset Decode Highlighting + Restablecer resaltado de colores de decodificados + + + Reset all decode highlighting and priorities to default values + Restablecer todo el resaltado de colores y prioridades a los valores predeterminados + + + + Error Loading CTY.DAT + Error cargando CTY.DAT + + + + Error Loading CALL3.TXT file + Error cargando archivo CALL3.TXT + + + + WSJT-X Decoded Text Font Chooser + Seleccionar un tipo de letra + + + + + Hamlib update only available on Windows. + Actualización de Hamlib solo está disponible en Windows + + + + Error Loading libhamlib-4.dll + Error cargando libhamlib-4.dll + + + + Hamlib Update successful + +New Hamlib will be used after restart Hamlib actualizado con éxito -Nuevo Hamlib estará diponible en el siguiente reinicio +Nuevo Hamlib estará disponible en el siguiente reinicio - + Hamlib successfully reverted Reverted Hamlib will be used after restart @@ -824,29 +1194,28 @@ Reverted Hamlib will be used after restart Hamlib restaurado estará disponible en el siguiente reinicio - + No Hamlib update found that could be reverted No se encontró actualización de Hamlib que pueda revertirse - + Error in network address Error en dirección de red - + UDP server DNS lookup failed Error en la búsqueda de DNS del servidor UDP - + MAC-ambiguous multicast groups addresses not supported No se admiten direcciones MAC ambiguas de grupos "multicast" - + Load Working Frequencies - Carga las frecuencias de trabajo Cargar las frecuencias de trabajo @@ -854,109 +1223,99 @@ Hamlib restaurado estará disponible en el siguiente reinicio Archivos de frecuencia (*.qrg);;Todos los archivos (*.*) - + Replace Working Frequencies - Sustituye las frecuencias de trabajo Sustituir las frecuencias de trabajo - + Are you sure you want to discard your current working frequencies and replace them with the loaded ones? - ¿Seguro que quieres descartar tus frecuencias actuales de trabajo y reemplazarlas por las cargadas? ¿Seguro que quiere descartar las frecuencias de trabajo actuales y reemplazarlas por las cargadas? - + Merge Working Frequencies - Combinar las frecuencias de trabajo Combina las frecuencias de trabajo - + Error reading frequency file Error leyendo archivo de frecuencias - - - + + + Not a valid frequencies file - El archivo de frecuencias no es válido Archivo de frecuencias no válido - + Incorrect file magic Archivo mágico incorrecto - + Version is too new La versión es demasiado nueva - + Contents corrupt - contenidos corruptos Contenido corrupto - + Save Working Frequencies Guardar las frecuencias de trabajo - + Only Save Selected Working Frequencies - Guarda sólo las frecuencias de trabajo seleccionadas Sólo guarda las frecuencias de trabajo seleccionadas - + Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. - ¿Seguro que quieres guardar sólo las frecuencias de trabajo seleccionadas actualmente? Haz clic en No para guardar todo. ¿Seguro que quiere guardar sólo las frecuencias de trabajo seleccionadas actualmente? Clic en No para guardar todo. - + Reset Working Frequencies Reiniciar las frecuencias de trabajo - + Are you sure you want to discard your current working frequencies and replace them with default ones? - ¿Seguro que quieres descartar tus frecuencias actuales de trabajo y reemplazarlas por otras? ¿Seguro que quiere descartar las frecuencias de trabajo actuales y reemplazarlas por las de defecto? - + Save Directory - Guardar directorio Directorio "Save" - + AzEl Directory Directorio AzEl - + Rig control error Error de control del equipo - + Failed to open connection to rig - No se pudo abrir la conexión al equipo Fallo al abrir la conexión al equipo - + Rig failure Fallo en el equipo - + Not found audio device missing No encontrado @@ -974,13 +1333,11 @@ Hamlib restaurado estará disponible en el siguiente reinicio DX Lab Suite Commander didn't respond correctly reading frequency: - DX Lab Suite Commander no respondió correctamente la frecuencia de lectura: DX Lab Suite Commander no respondió correctamente leyendo la frecuencia: DX Lab Suite Commander sent an unrecognised TX state: - DX Lab Suite Commander envió un estado TX no reconocido: DX Lab Suite Commander envió un estado de TX no reconocido: @@ -1004,7 +1361,6 @@ o contacte al soporte de DXLab en DXLab@groups.io DX Lab Suite Commander didn't respond correctly polling frequency: - DX Lab Suite Commander no respondió correctamente a la frecuencia de sondeo: DX Lab Suite Commander no respondió correctamente sondeando la frecuencia: @@ -1015,13 +1371,11 @@ o contacte al soporte de DXLab en DXLab@groups.io DX Lab Suite Commander sent an unrecognised split state: - DX Lab Suite Commander envió un split no reconocido: DX Lab Suite Commander envió un estado de split no reconocido: DX Lab Suite Commander didn't respond correctly polling split status: - DX Lab Suite Commander no respondió correctamente al split de sondeo: DX Lab Suite Commander no respondió correctamente sondeando el estado del split: @@ -1032,14 +1386,12 @@ o contacte al soporte de DXLab en DXLab@groups.io DX Lab Suite Commander didn't respond correctly polling mode: - DX Lab Suite Commander no respondió correctamente el modo de sondeo: DX Lab Suite Commander no respondió correctamente sondeando el modo: DX Lab Suite Commander send command failed - El comando de envío de DX Lab Suite Commander falló DX Lab Suite Commander, el comando "enviar" ha fallado @@ -1059,15 +1411,12 @@ o contacte al soporte de DXLab en DXLab@groups.io DX Lab Suite Commander send command "%1" read reply failed: %2 - Comando de envío de DX Lab Suite Commander "%1" lectura de respuesta fallida: %2 - DX Lab Suite Commander ha enviado el comando"%1" y lectura de respuesta ha fallido: %2 DX Lab Suite Commander retries exhausted sending command "%1" - DX Lab Suite Commander reintenta el comando de envío agotado "%1" DX Lab Suite Commander ha excedido los intentos enviando el comando "%1" @@ -1081,40 +1430,35 @@ o contacte al soporte de DXLab en DXLab@groups.io &Foreground color ... - &Color de primer plano ... &Color de letras ... - + Choose %1 Foreground Color - Olvide copiar el texto original Escoga %1 color de letras - + &Unset foreground color - &Color de primer plano desarmado &Reiniciar color de letras - + &Background color ... &Color de fondo ... - + Choose %1 Background Color - Olvide copiar el texto original Escoge %1 color de fondo - + U&nset background color - C&olor de fondo desarmado Rei&niciar Color de fondo - + &Reset this item to defaults &Restablece este elemento a los valores predeterminados @@ -1149,13 +1493,11 @@ o contacte al soporte de DXLab en DXLab@groups.io New Grid - Nuevo Locator/Grid Nuevo locator New Grid on Band - Nuevo Locator/Grid en banda Nuevo locator en banda @@ -1171,13 +1513,11 @@ o contacte al soporte de DXLab en DXLab@groups.io New Continent - Nuevo Continente Nuevo continente New Continent on Band - Nuevo Continente en banda Nuevo continente en banda @@ -1206,19 +1546,17 @@ o contacte al soporte de DXLab en DXLab@groups.io Usuario LoTW - + f/g unset - f/g desarmado Color letras prederminado - + b/g unset - b/g desarmado Color fondo predeterminado - + Highlight Type Tipo de resaltado @@ -1226,47 +1564,57 @@ o contacte al soporte de DXLab en DXLab@groups.io Designer - + &Delete &Borrar - + &Insert ... - &Introducir ... &Agregar ... - + Insert &after ... - Introducir &después ... &Agregar después ... - + Import Palette - Importar la paleta Importar Paleta - - + + Palettes (*.pal) Paletas (.pal) + Import Palette Failed + + + + Export Palette - Exportar la paleta Exportar Paleta + + + Export Palette Failed + + + + + Error writing waterfall palette file "%1": %2. + Error al escribir el archivo de paleta de la cascada (waterfall) "%1": %2. + Dialog - + Gray time: - Tiempo Gris: Penumbra: @@ -1286,7 +1634,6 @@ o contacte al soporte de DXLab en DXLab@groups.io URL Error - Error al URL Enrror en el enlace @@ -1294,8 +1641,6 @@ o contacte al soporte de DXLab en DXLab@groups.io Invalid URL: "%1" - URL no válida: -"%1" Enlace no válido: "%1" @@ -1313,58 +1658,48 @@ o contacte al soporte de DXLab en DXLab@groups.io Contents file syntax error %1 at character offset %2 - Error de sintaxis %1 en el desplazamiento de caracteres %2 Error de sintaxis %1 en el desplazamiento de caracteres %2 Contents file top level must be a JSON array - El nivel superior del archivo de contenido debe ser una matriz JSON El nivel superior del archivo debe ser una matriz JSON File System Error - Error del sistema de archivos Error en el sistema de archivos Failed to open "%1" Error: %2 - %3 - Falló al abrir "%1" -Error: %2 - %3 Fallo al abrir "%1" Error: %2 - %3 Contents entries must be a JSON array - Las entradas de contenido deben ser una matriz JSON Las entradas deben ser una matriz JSON Contents entries must have a valid type - Las entradas de contenido deben tener un tipo válido Las entradas deben tener un tipo válido Contents entries must have a valid name - Las entradas de contenido deben tener un nombre válido Las entradas deben tener un nombre válido Contents entries must be JSON objects - Las entradas de contenido deben ser objetos JSON Las entradas deben ser objetos JSON Contents directories must be relative and within "%1" - Los directorios de contenido deben ser relativos y dentro de "%1" Los directorios deben ser relativos y dentro de "%1" @@ -1381,18 +1716,32 @@ Error: %2 - %3 DisplayText - + &Erase &Borrar + + + Return to live activity + + + + + Return to the live activity position + + + + + Live activity is paused while earlier entries are visible. + + EchoGraph - + Echo Graph - Gráfico de eco Gráfico de Eco @@ -1413,7 +1762,6 @@ Error: %2 - %3 <html><head/><body><p>Echo spectrum gain</p></body></html> - <html><head/><body><p>Ganancia de espectro de eco</p></body></html> <html><head/><body><p>Ganancia de espectro de Eco</p></body></html> @@ -1424,7 +1772,6 @@ Error: %2 - %3 <html><head/><body><p>Echo spectrum zero</p></body></html> - <html><head/><body><p>Espectro de eco cero</p></body></html> <html><head/><body><p>Eco, espectro cero</p></body></html> @@ -1435,7 +1782,6 @@ Error: %2 - %3 <html><head/><body><p>Smoothing of echo spectrum</p></body></html> - <html><head/><body><p>Suavizado del espectro de eco</p></body></html> <html><head/><body><p>Suavizado del espectro de Eco</p></body></html> @@ -1446,7 +1792,6 @@ Error: %2 - %3 <html><head/><body><p>Number of echo transmissions averaged</p></body></html> - <html><head/><body><p>Número promedio de transmisiones de eco</p></body></html> <html><head/><body><p>Número de transmisiones de Eco promedidas</p></body></html> @@ -1457,7 +1802,6 @@ Error: %2 - %3 <html><head/><body><p>Click to cycle through a sequence of colors and line widths.</p></body></html> - <html><head/><body><p>Haz clic para recorrer una secuencia de colores y anchos de línea.</p></body></html> <html><head/><body><p>Clic para cambiar entre una secuencia de colores y anchos de línea.</p></body></html> @@ -1469,9 +1813,8 @@ Error: %2 - %3 EmulateSplitTransceiver - + Emulated split mode requires rig to be in simplex mode - El modo dividido emulado requiere que el equipo esté en modo simplex Emular el modo "Split" el equipo requiere estar en modo simplex @@ -1506,13 +1849,11 @@ Error: %2 - %3 Measured - Medida Medido Proposed - Propuesta Propuesto @@ -1553,22 +1894,19 @@ Error: %2 - %3 Discard Measured - Rechaza la medición Rechazar lo medido ExistingNameDialog - + Configuration to Clone From - Configuración para clonar desde Clonar desde - + &Source Configuration Name: - &Nombre de la configuración/ajuste de la fuente: &Nombre de la configuración de origen: @@ -1607,7 +1945,6 @@ Error: %2 - %3 Category-Operator: - Categoria del Operador: Categoria - Operador: @@ -1618,19 +1955,16 @@ Error: %2 - %3 Category-Transmitter: - Categoria del Transmisor: Categoria - Transmisor: ONE - Uno UNO Category-Power: - Categoria de Potencia: Categoria - Potencia: @@ -1641,25 +1975,21 @@ Error: %2 - %3 Category-Assisted: - Categoria Asistida: Categoria - Asistida: NON-ASSISTED - No Asistida NO ASISTIDA Category-Band: - Categoria Banda: Categoria - Banda: ALL - Todas TODAS @@ -1675,7 +2005,6 @@ Error: %2 - %3 Club: - Radio Club: Club: @@ -1692,7 +2021,6 @@ Error: %2 - %3 Save Log File - Guardar archivo de log Guardar log @@ -1703,13 +2031,11 @@ Error: %2 - %3 Cannot open "%1" for writing: %2 - No se puede abrir "%1" para la escritura: %2 No se puede abrir "%1" para escritura: %2 Export Cabrillo File Error - Error al exportar el archivo Cabrillo Error al exportar log Cabrillo @@ -1717,15 +2043,13 @@ Error: %2 - %3 FastGraph - + Fast Graph - Gráfico rápido "Fast Graph" Waterfall gain - Ganancia de la cascada Ganancia de la cascada (waterfall) @@ -1774,52 +2098,199 @@ Error: %2 - %3 - FoxLog::impl + FixtureAudioInput - - Date & Time(UTC) - Fecha y Hora en UTC - Fecha y Hora (UTC) + + Synthetic audio input has no detector sink. + - - Call - Indicativo + + Synthetic FT8 audio input requires a downsample factor of 1 or 4. + - - Grid - Locator - Locator + + Synthetic JTTY audio input requires a downsample factor of 1 or 4. + - - Sent - Enviado + + Synthetic audio input requires the mono input channel. + - - Rcvd - Recibido + + Unable to open synthetic audio fixture %1: %2 + - - Band - Banda + + Synthetic audio fixture must be mono, signed 16-bit little-endian PCM. + - - - FoxLogWindow - - Fox Log - Log Fox - Log "Fox" + + Synthetic audio fixture must be %1 Hz for downsample factor %2; found %3 Hz. + + + + + Synthetic FT8 audio fixture must contain exactly %1 frames; found %2. + + + + + Synthetic JTTY audio fixture must contain complete PCM frames. + + + + + Unable to read all PCM data from synthetic audio fixture. + + + + + Synthetic audio input does not yet support big-endian hosts. + + + + + Unable to initialize the detector for synthetic audio input. + + + + + Synthetic audio fixture ready + + + + + Synthetic audio input suspended + + + + + Synthetic audio input receiving + + + + + Detector accepted %1 of %2 synthetic PCM bytes. + + + + + Synthetic audio fixture exhausted + + + + + FixtureSoundOutput + + + Synthetic audio output requires a readable source. + + + + + Synthetic audio output requires a capture path. + + + + + Synthetic audio output does not yet support big-endian hosts. + + + + + Synthetic audio output received an unsupported source frame size. + + + + + Unable to open synthetic audio output capture %1: %2 + + + + + Synthetic audio output received a partial captured frame. + + + + + Synthetic FT8 audio output exceeded its 15-second capture period. + + + + + Synthetic audio output wrote %1 of %2 capture bytes: %3 + + + + + Synthetic audio output source disappeared during capture. + + + + + Synthetic FT8 audio output continued beyond its 15-second capture period. + + + + + Synthetic audio output received %1 of %2 source bytes. + + + + + Synthetic audio output received an invalid source byte count. + + + + + FoxLog::impl + + + Date & Time(UTC) + Fecha y Hora (UTC) + + + + Call + Indicativo + + + + Grid + Locator + + + + Sent + Enviado + + + + Rcvd + Recibido + + + + Band + Banda + + + + FoxLogWindow + + + Fox Log + Log "Fox" <html><head/><body><p>Right-click here for available actions.</p></body></html> - <html><head/><body><p>Haz clic derecho para ver las acciones disponibles.</p></body></html> <html><head/><body><p>Clic derecho para ver las opciones disponibles.</p></body></html> @@ -1857,7 +2328,6 @@ Error: %2 - %3 Export ADIF Log File - Exportar archivo log ADIF Exportar log ADIF @@ -1873,7 +2343,6 @@ Error: %2 - %3 Cannot open "%1" for writing: %2 - No se puede abrir "%1" para la escritura: %2 No se puede abrir "%1" para escritura: %2 @@ -1889,75 +2358,104 @@ Error: %2 - %3 Are you sure you want to erase file FoxQSO.txt and start a new Fox log? - ¿Estás seguro de que deseas borrar el archivo FoxQSO.txt e iniciar un nuevo log de Fox? ¿Está seguro que desea borrar el archivo FoxQSO.txt e iniciar un nuevo log de "Fox"? + + FrequencyDeltaLineEdit + + + Offset in MHz + + + + + Frequency offset in MHz + + + + + Enter a frequency offset in MHz. + + + FrequencyDialog - + Add Frequency - Agregar frecuencia Añadir frecuencia - + IARU &Region: &Región IARU: - + &Mode: &Modo: - + &Frequency (MHz): - &Frecuencia en MHz: &Frecuencia (MHz): - + &Preferred for Band/Mode: &Preferido para Banda/Modo: - + &Description: &Descripción: - + &Enable Date Range: &Activar rango de fechas: - + S&tart: &Iniciar: - + &End: &Fin: - + &Source: &Fuente: - + Invalid Date Range Rango invalido de fechas - + Start date must be before end date Fecha de inicio debe ser anterior a fecha de finalización + + FrequencyLineEdit + + + + Frequency in MHz + + + + + Enter a positive frequency in MHz. + + + FrequencyList_v2_100 @@ -1974,7 +2472,6 @@ Error: %2 - %3 Frequency (MHz) - Frecuencia en MHz Frecuencia (MHz) @@ -1982,37 +2479,37 @@ Error: %2 - %3 FrequencyList_v2_101 - + IARU Region Región IARU - + Mode Modo - + Frequency Frecuencia - + Frequency (MHz) Frecuencia (MHz) - + Description Descripción - + Source Fuente @@ -2028,136 +2525,241 @@ Error: %2 - %3 - + Pref Pref - + Start Date/Time Fecha/hora inicio - + End Date/Time Fecha/hora fin - + Failed to parse JSON file Fallo al analizar archivo JSON - + Information Missing Falta de información - + No Frequencies were found No se encontraron frecuencias - + Loaded Frequencies from %1 Frecuencias cargadas desde %1 - + Entries Valid/Skipped %1 Entradas validas/omitdas %1 + + Ft8TxLoopbackTestController + + + Timed out after 60 seconds. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + The FT8 output stream did not start exactly once. + + + + + The FT8 Auto control was not found. + + + + + Disabling Auto stopped the active FT8 transmission. + + + + + Synthetic output reported non-silent FT8 audio more than once. + + + + + The FT8 capture did not stop exactly once at the requested path. + + + + + Synthetic audio output failed: %1 + + + + + A required FT8 transmit GUI control was not found. + + + + + The application did not enter FT8 mode. + + + + + Unable to configure the requested FT8 transmission. + + + + + The FT8 transmit controls disappeared before transmission. + + + + + Unable to start the synthetic FT8 transmission. + + + + + The FT8 Auto control disappeared before retry. + + + + + The FT8 output lifecycle was not one start, non-silent transmission, and natural stop. + + + + + FT8 audio began at frame %1; expected %2 +/- %3 frames. + + + + + The FT8 capture file was not created or is empty: %1 + + + + + Unable to reopen FT8 capture %1: %2 + + + + + The FT8 capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The FT8 capture must contain exactly %1 frames; file=%2 reported=%3. + + + + + Unexpected modal window: %1 + + + HRDTransceiver - - + + Failed to connect to Ham Radio Deluxe - No se pudo conectar a Ham Radio Deluxe Fallo al conectar con el Ham Radio Deluxe - + Failed to open file "%1": %2. Fallo al abrir el archivo "%1": %2. - - + + Ham Radio Deluxe: no rig found Ham Radio Deluxe: no se encontró ningún equipo - + Ham Radio Deluxe: rig doesn't support mode Ham Radio Deluxe: el equipo no admite el modo - + Ham Radio Deluxe: sent an unrecognised mode - Ham Radio Deluxe: envió un modo no desconocido Ham Radio Deluxe: envió un modo desconocido - + Ham Radio Deluxe: item not found in %1 dropdown list - Ham Radio Deluxe: artículo no encontrado en %1 la lista desplegable Ham Radio Deluxe: elemento no encontrado en %1 la lista desplegable - + Ham Radio Deluxe: button not available Ham Radio Deluxe: botón no disponible - + Ham Radio Deluxe didn't respond as expected Ham Radio Deluxe no respondió como se esperaba - + Ham Radio Deluxe: rig has disappeared or changed Ham Radio Deluxe: equipo ha desaparecido o cambiado - + Ham Radio Deluxe send command "%1" failed %2 - Comando de envío Ham Radio Deluxe "%1" ha fallado %2 Ham Radio Deluxe envió comando "%1" ha fallado %2 - - + + Ham Radio Deluxe: failed to write command "%1" Ham Radio Deluxe: error al escribir el comando "%1" - + + Ham Radio Deluxe sent an invalid reply to our command "%1": %2 + + + Ham Radio Deluxe sent an invalid reply to our command "%1" - Ham Radio Deluxe envió una respuesta no válida a nuestro comando "%1" + Ham Radio Deluxe envió una respuesta no válida a nuestro comando "%1" - + Ham Radio Deluxe failed to reply to command "%1" %2 - Ham Radio Deluxe no respondió al comando "%1" %2 - Ham Radio Deluxe falló al responder al comando "%1" %2 - + Ham Radio Deluxe retries exhausted sending command "%1" - Ham Radio Deluxe reintenta agotado enviando comando "%1" Ham Radio Deluxe ha excedido los intentos enviando comando "%1" - + Ham Radio Deluxe didn't respond to command "%1" as expected Ham Radio Deluxe no respondió al comando "%1" como se esperaba @@ -2165,207 +2767,186 @@ Error: %2 - %3 HamlibTransceiver - - + + Hamlib initialisation error Error de inicialización de Hamlib - + Hamlib settings file error: %1 at character offset %2 - Error de archivo de configuración de Hamlib:%1 en el desplazamiento de caracteres %2 Error en archivo de configuración de Hamlib:%1 en el desplazamiento de caracteres %2 - + Hamlib settings file error: top level must be a JSON object - Error en archivo de configuración de Hamlib: el nivel superior debe ser un objeto JSON Error de archivo de configuración de Hamlib: el nivel superior debe ser un objeto JSON - + Hamlib settings file error: config must be a JSON object - Error de archivo de configuración de Hamlib: config debe ser un objeto JSON Error en archivo de configuración de Hamlib: config debe ser un objeto JSON - + Unsupported CAT type Tipo CAT no admitido - + Hamlib error: %1 while %2 Error Hamlib: %1 mientras %2 - + opening connection to rig - conexión de apertura al equipo se abre la conexión al equipo - + getting current frequency obteniendo frecuencia actual - + getting current mode - obteniendo el modo actual obteniendo modo actual - - + + exchanging VFOs intercambiando VFO's - - + + getting other VFO frequency - obteniendo otra frecuencia de VFO obteniendo la frecuencia del otro VFO - + getting other VFO mode - obteniendo otro modo VFO obteniendo modo del otro VFO - - + + setting current VFO - ajuste al VFO actual ajustando VFO actual - + getting frequency obteniendo frecuencia - + getting mode obteniendo modo - - - + + + getting current VFO - obteniendo el VFO actual obteniendo VFO actual - - - - + + + + getting current VFO frequency - obteniendo la frecuencia actual de VFO obteniendo frecuencia del VFO actual - - - - - - + + + + + + setting frequency - ajuste de frecuencia ajustando frecuencia - - - - + + + + getting current VFO mode obteniendo modo del VFO actual - - - - - + + + + + setting current VFO mode - ajuste del modo VFO actual ajustando modo del VFO actual - setting VFOB mode - ajustando modo VFOB + ajustando modo VFOB - - + + setting/unsetting split mode - activación/desactivación del modo dividido (split) activar/desactivar modo "Split" - - + + setting split mode - activar modo dividido (split) ajustando modo "Split" - + setting split TX frequency and mode - Ajuste de frecuencia y modo de transmisión dividida (split) ajustando la frecuencia de TX y modo del "Split" - + setting split TX frequency - ajuste de frecuencia dividida en TX ajustando frecuencia de TX del "Split" - + getting split TX VFO mode - obteniendo el modo dividido de TX en el VFO obteniendo modo del VFO de TX en "Split" - + setting split TX VFO mode - ajuste del modo dividido (split) en TX del VFO ajustando modo del VFO de TX en "Split" - + getting PTT state obteniendo el estado del PTT - + setting PTT on - activar el PTT activando PTT - - + + setting PTT off - desactivar el PTT desactivando PTT - + setting a configuration item - activar un elemento de configuración ajustando un elemento de configuración - + + getting a configuration item obteniendo un elemento de configuración @@ -2374,12 +2955,10 @@ Error: %2 - %3 HelpTextWindow Help file error - Error del archivo de ayuda Error en el archivo de ayuda Cannot open "%1" for reading - No se puede abrir "%1" para leer No se puede abrir "%1" para lectura @@ -2417,62 +2996,372 @@ Error: %2 - %3 - LogQSO + JttyTxLoopbackTestController - - Click OK to confirm the following QSO: - Haz clic en Aceptar para confirmar el siguiente QSO: - Clic en "Aceptar" para guardar el siguiente QSO: + + Timed out after 60 seconds. + - - Call - Indicativo + + JTTY request %1 was accepted more than once. + - - Start - Comienzo - Inicio + + JTTY request %1 was rejected with reason %2. + - - - dd/MM/yyyy HH:mm:ss - dd/MM/yyyy HH:mm:ss + + JTTY request %1 completed more than once. + - - End - Final - Fin + + More than one JTTY transmit session drained. + - - Mode - Modo + + Synthetic output opened the wrong capture path: %1 + - - Band - Banda + + JTTY output stream restarted more than once. + - - Rpt Sent - Reporte Enviado - Rpt. Enviado + + Synthetic output reported non-silent playback more than once. + - - Rpt Rcvd - Reporte Recibido - Rpt. Recibido + + Synthetic output stopped the wrong capture path: %1 + - + + JTTY output stream stopped more than once. + + + + + Synthetic audio output failed: %1 + + + + + The JTTY mode action was not found. + + + + + The application did not enter JTTY mode. + + + + + The JTTY encoder did not produce a valid test waveform extent. + + + + + The first JTTY text request was not accepted synchronously. + + + + + Non-silent playback began before the first request was accepted. + + + + + The output stream restarted or stopped before the gapless append. + + + + + The gapless append occurred before one second of real playback. + + + + + The second JTTY text request was not accepted during playback. + + + + + Appending the second JTTY message restarted or stopped playback. + + + + + The accepted-request set did not contain exactly both submitted messages. + + + + + JTTY text requests were not accepted in submission order. + + + + + The completed-request set did not contain exactly both submitted messages. + + + + + JTTY text requests did not complete in FIFO order. + + + + + The output stream lifecycle was not one start, one drain, and one stop. + + + + + The captured JTTY session contains an unexpected internal audio gap. + + + + + The JTTY capture file was not created or is empty: %1 + + + + + Unable to reopen JTTY capture %1: %2 + + + + + The JTTY capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The JTTY capture has an invalid PCM extent: file frames=%1, expected audio frames=%2, reported frames=%3. + + + + + Unexpected modal window: %1 + + + + + LiveAudioTestController + + + Timed out after 110 seconds. + + + + + Timed out after 100 seconds. + + + + + Decoder backend failed: %1 + + + + + JTTY display did not settle to the expected text after input ended. + + + + + Synthetic audio source failed: %1 + + + + + Unable to open expected decode file %1: %2 + + + + + Expected decode file %1 contains no messages. + + + + + Unable to open expected JTTY text file %1: %2 + + + + + Expected JTTY text file %1 contains no messages. + + + + + A required FT8 decoder or monitoring GUI control was not found. + + + + + Unable to configure the %1-%2 Hz waterfall decode range. + + + + + Unable to prepare the complete FT8 fixture decode. + + + + + Unable to configure the FT8 multithreaded decoder as requested. + + + + + Monitor did not enter the active state. + + + + + Synthetic input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic audio source. + + + + + A required JTTY mode, monitoring, or decode display control was not found. + + + + + The JTTY GUI action did not select JTTY mode. + + + + + Monitor did not enter the active state for JTTY. + + + + + Synthetic JTTY input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic JTTY audio source. + + + + + The expected early standard and final configured MTD decoder invocations were not both observed. + + + + + The configured MTD invocation produced no decoder output. + + + + + live MTD missing: %1 + + + + + processed missing: %1 + + + + + display missing: %1 + + + + + Reference-message validation failed: %1; live MTD output: %2; processed output: %3 + + + + + Decoder messages were processed but none reached the GUI display path. + + + + + The expected JTTY messages did not reach both panes in FIFO order. + + + + + The expected JTTY message reached both panes without an observed growing prefix. + + + + + Unexpected modal window: %1 + + + + + LogQSO + + + Click OK to confirm the following QSO: + Clic en "Aceptar" para guardar el siguiente QSO: + + + + Call + Indicativo + + + + Start + Inicio + + + + + dd/MM/yyyy HH:mm:ss + dd/MM/yyyy HH:mm:ss + + + + End + Fin + + + + Mode + Modo + + + + Band + Banda + + + + Rpt Sent + Rpt. Enviado + + + + Rpt Rcvd + Rpt. Recibido + + + Grid - Locator/Grid Locator @@ -2483,7 +3372,6 @@ Error: %2 - %3 Tx power - Poténcia de TX Potencia TX @@ -2542,188 +3430,188 @@ Error: %2 - %3 Frecuencia RX - + Aircraft scatter Scatter por aeronaves - + Aurora-E Aurora-E - + Aurora Aurora - + Back scatter Back scatter - + Echolink Echolink - + Earth-moon-earth Tierra-Luna-Tierra - + Sporadic E Esporádica E - + F2 Reflection Reflección F2 - + Field aligned irregularities Irregularidades alineadas de campo - + Internet-assisted Asistido por Internet - + Ionoscatter Scatter Ionosférico - + IRLP IRLP - + Meteor scatter Meteor scatter - + Non-satellite repeater or transponder Repetidor o transponder sin satelite - + Rain scatter Scatter por lluvia - + Tropospheric ducting Conductos troposféricos - + A A - + B B - + BS BS - + JA JA - + JD JD - + K K - + KA KA - + KT KT - + L L - + LS LS - + LU LU - + LX LX - + S S - + SX SX - + T T - + US US - + UV UV - + VS VS - + VU VU - + Satellite Satelite - + Trans-equatorial Transecuatorial @@ -2732,38 +3620,33 @@ Error: %2 - %3 Conductos troposfericos - - + + Invalid QSO Data - Datos de QSO no válidos Datos del QSO no válidos - + Check exchange sent and received - Comprobación del intercambio enviado y recibido Verificar intercambio enviado y recibido - + Check all fields - Verifica todos los campos Verificar todos los campos - + Log file error - Error de archivo log Error en log - + Cannot open "%1" for append - No puedo abrir "%1" para anexar No se puede abrir "%1" para anexar - + Error: %1 Error: %1 @@ -2773,16 +3656,12 @@ Error: %2 - %3 Network Error - SSL/TLS support not installed, cannot fetch: '%1' - Error de red: el soporte SSL/TLS no está instalado, no se puede recuperar: -'%1' Error de red - Certificado SSL/TLS no instalado, no se puede recuperar: '%1' Network Error - Too many redirects: '%1' - Error de red: demasiados redireccionamientos: -'%1' Error de red - Demasiados redireccionamientos: '%1' @@ -2795,8 +3674,6 @@ Error: %2 - %3 File System Error - Cannot commit changes to: "%1" - Error del sistema de archivos: no se pueden confirmar los cambios en: -"%1" Error de archivo - No se pueden grabar los cambios en: "%1" @@ -2804,9 +3681,6 @@ Error: %2 - %3 File System Error - Cannot open file: "%1" Error(%2): %3 - Error del sistema de archivos: no se puede abrir el archivo: -"%1" -Error(%2): %3 Error de archivo - No se puede abrir el archivo: "%1" Error(%2): %3 @@ -2815,9 +3689,6 @@ Error(%2): %3 File System Error - Cannot write to file: "%1" Error(%2): %3 - Error del sistema de archivos: no se puede escribir en el archivo: -"%1" -Error(%2): %3 Error de archivo - No se puede escribir el archivo: "%1" Error(%2): %3 @@ -2826,1497 +3697,1669 @@ Error(%2): %3 MainWindow - WSJT-X by K1JT - WSJT-X por K1JT - - - - - - - - - - - + WSJT-X por K1JT + + + + + + + + + + + Band Activity Actividad en la banda - - + + UTC dB DT Freq Dr UTC dB DH Freq Dr - - - - - - - + + + + + + + Rx Frequency Frecuencia de RX - + CQ only Solo CQ - + Enter this QSO in log - Entra este QSO al log Guarda este QSO en el log - + Log &QSO Guardar QSO (&Q) - + Stop monitoring - Deja de monitorizar Detener la monitorización - + &Stop Detener (&S) Toggle monitoring On/Off - Activar/desactivar la monitorización Activa/Desactiva la monitorización - + &Monitor Monitor (&M) - + <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> - <html><head/><body><p>Borrar ventana derecha. Haz doble clic para borrar ambas ventanas.</p></body></html> <html><head/><body><p>Clic para borrar ventana derecha.</p><p> Doble clic para borrar ambas ventanas.</p></body></html> - + Erase right window. Double-click to erase both windows. - Borrar ventana derecha. Haz doble clic para borrar ambas ventanas. Borra ventana derecha. Doble clic para borrar ambas ventanas. - + &Erase Borrar (&E) - + <html><head/><body><p>Clear the accumulating message average.</p></body></html> - <html><head/><body><p>Borrar el promedio de mensajes acumulados.</p></body></html> <html><head/><body><p>Borrar el promedio de mensajes acumulados.</p></body></html> - + Clear the accumulating message average. Borrar el promedio de mensajes acumulados. - + Clear Avg Borrar media - + <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> - <html><head/><body><p>Decodificar el período de RX más reciente en la frecuencia QSO</p></body></html> <html><head/><body><p>Decodifica el período de RX más reciente en la frecuencia del QSO</p></body></html> - + Decode most recent Rx period at QSO Frequency - Decodificar el período de RX más reciente en la frecuencia QSO Decodifica el período más reciente de RX en la frecuencia del QSO - + &Decode - &Decodificar Decodifica (&D) - + <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> - <html><head/><body><p>Activar/desactivar TX</p></body></html> <html><head/><body><p>Activar/Desactivar TX</p></body></html> - + Toggle Auto-Tx On/Off - Activar/desactivar TX Activa/Desactiva Auto-TX - + E&nable Tx Activar TX (&N) - + Stop transmitting immediately - Detiene TX inmediatamente Detener TX inmediatamente - + &Halt Tx Detener TX (&H) <html><head/><body><p>Toggle a pure Tx tone On/Off</p></body></html> - <html><head/><body><p>Activar/desactivar un tono de transmisión puro</p></body></html> <html><head/><body><p>Activa/Desactiva TX de un tono puro. Botón derecho para ajustar la radio</p></body></html> - + Toggle a pure Tx tone On/Off - Activar/desactivar un tono de transmisión puro Activar/Desactivar TX con tono continuo - + &Tune TX Tono (&T) - + + Menus Menús - + Decode other Hounds calling above 1000 Hz audio offset Decodifica otros "Hounds" llamando por encima de 1000 Hz - + Enable auto response to the first decode from a new DXCC or new call on the current band. Habilite la respuesta automática por un nuevo DXCC o un nuevo indicativo en la banda actual. - + F High F Alto - + Maximum drift rate in units of symbol rate per transmission. Tasa de deriva máxima en unidades de tasa de símbolos por transmisión. - + Max Drift Máxima deriva - + Quick-Start Guide to Q65 Guía de inicio rápido de Q65 (inglés) - + Auto Clear Avg after decode Auto Clear Avg después de decodificar - + Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 Guía de inicio rápido para WSJT-X 2.5.0 y MAP65 3.0 (inglés) - + F Low F Bajo - + 40 40 - - - + + + 10 10 - + 17 17 - + 60 60 - - + + 12 12 - + 160 160 - + 20 20 - + 80 80 - - + + 70 70 - + 15 15 - + 30 30 - - - - + + + + 6 6 - + 24G 24G - + 10G 10G - + 5G 5G - - - + + + 9 9 - + 13 13 - + 23 23 - + 33 33 - + 1.25 1.25 - - + + 4 4 - - + + 8 8 - + CQ messages only. Mesnajes CQ solamente. - + Bypass Filters toggled via Settings or the Filters menu. - + Los filtros de omisión se activan mediante Configuración o el menú Filtros. - + BP Omitir - + <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> <html><head/><body><p>Activar o desactivar la monitorización. <br>Amarillo al guardar archivos .wav.</p></body></html> - + Avg Avg - + <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> <html><head/><body><p>Activar o desactivar un tono TX puro <br>Haga clic derecho para sintonizar el equipo</p></body></html> - + <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> - + <html><head/><body><p>Activar&amp;desactivar función llamada. Botón derecho para borrar la casilla Indicativo DX.</p></body></html> - + <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> <html><head/><body><p>Buscar indicativo en la base de datos. <br>Haga clic derecho para buscar el indicativo en QRZ.com.</p></body></html> - + <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> <html><head/><body><p>Añadir indicativo y locator a la base de datos. <br>Haga clic derecho para buscar el indicativo en hamqth.com.</p></body></html> - + <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> <html><head/><body><p>Colocar indicativo en la lista de ignorados.<br>Haga clic derecho para buscar el indicativo en qrzcq.com.</p></body></html> - + Ignore Ignorar - + Pwr Pwr - <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the the strongest station's reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the the weakest station's reply to your CQ. </p></body></html> - + <html><head/><body><p>Seleccione <span style=" font-weight:600;">CQ: None</span> para elegir manualmente las estaciones que llaman.</p><p>Seleccione <span style=" font-weight:600;">CQ: First</span> para responder automáticamente a la primera respuesta decodificada a su CQ.</p><p>Seleccione <span style=" font-weight:600;">CQ: Max Dist</span> para responder automáticamente a la respuesta que proporcione más puntos en el ARRL International Digital Contest o, en general, a la estación más distante si su mensaje contiene un locator válido.</p><p>Seleccione <span style=" font-weight:600;">CQ: Max dB</span> para responder automáticamente a la estación más fuerte que responda a su CQ.</p><p>Seleccione <span style=" font-weight:600;">CQ: Min dB</span> para responder automáticamente a la estación más débil que responda a su CQ.</p></body></html> - - + + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> - + <html><head/><body><p>Marque para TX en minutos o secuencias pares, comenzando desde 0; desmarque para secuencias impares. Haga clic derecho para congelar el estado de la casilla. Haga clic derecho en el botón FT8 o MSK para liberarlo.</p></body></html> - + <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> - <html><head/><body><p>Cambiar a T/R 15 s y submodo C.</p></body></html> + <html><head/><body><p>Cambiar a T/R 15 s y submodo C.</p></body></html> - + 15C 15C - + <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> - <html><head/><body><p>Cambar a T/R 15 s y submodo A.</p></body></html> + <html><head/><body><p>Cambar a T/R 15 s y submodo A.</p></body></html> - + 15A 15A - + <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> <html><head/><body><p>Cambiar a T/R 30 s y submodo B.</p></body></html> - + 30B 30B - + <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> <html><head/><body><p>Cambiar a T/R 60 s y submodo C.</p></body></html> - + 60C 60C - + <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> <html><head/><body><p>Cambiar a T/R 60 s y submodo D.</p></body></html> - + 60D 60D - + <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> <html><head/><body><p>Cambiar a T/R 60 s y submodo E.</p></body></html> - + 60E 60E - - + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> <html><head/><body><p>Cambiar a este mensaje TX AHORA</p><p>Haga doble clic para restablecer al mensaje estándar 73</p><p>Haga clic derecho para conservar el texto libre TX5</p></body></html> - + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> <html><head/><body><p>Transmite un mensaje de texto libre en la próxima oportunidad.</p></body></html> - + Send msg Enviar Mensaje - + <html><head/><body><p>Enter a free text message.</p></body></html> <html><head/><body><p>Escriba un mensaje de texto libre.</p></body></html> - + Free Text Texto libre - + <html><head/><body><p>Select a specific CQ message.</p></body></html> <html><head/><body><p>Seleccione un mensaje CQ específico.</p></body></html> - + Queue Cola - + Allow Dupes Permitir duplicados - + <html><head/><body><p>Clear all queues.</p></body></html> - + <html><head/><body><p>Borrar todas las colas.</p></body></html> - + <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> <html><head/><body><p>Número máximo de indicativos que se mostrarán en la cola.</p></body></html> - + <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> <html><head/><body><p>Seleccione el orden de clasificación deseado para los indicativos en la cola.</p></body></html> - + Age Age - + Continent Continente - + Score Puntuación - + <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> <html><head/><body><p>Incluya un mensaje CQ junto con otros mensajes.</p></body></html> - + In Progress En progreso - + <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> <html><head/><body><p>Número máximo de transmisiones simultáneas para modo Fox.</p></body></html> - + 70cm FT8 70cm FT8 - + 70cm 70cm - + 30m FT8 30m FT8 - + 30m 30m - + <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> - <html><head/><body><p>Activar/Desactivar el salto de banda. El salto de banda se produce cada dos minutos. Los cambios en las casillas de verificación se aplican inmediatamente.<br/>Haga clic derecho para cambiar a la siguiente frecuencia de salto de banda seleccionada o para probar el dispositivo de audio predeterminado cuando el salto de banda esté desactivado.</p></body></html> + <html><head/><body><p>Activar/Desactivar el salto entre bandas. El salto entre bandas se produce cada dos minutos. Los cambios en las casillas de verificación se aplican inmediatamente.<br/>Haga clic derecho para cambiar a la siguiente frecuencia de salto de banda seleccionada o para probar el dispositivo de audio predeterminado cuando el salto de banda esté desactivado.</p></body></html> - + Band Hopping - Saltar de bandas + Saltar rentre bandas - + 12m FT8 12m FT8 - + 12m 12m - + 40m FT8 40m FT8 - + 40m 40m - + 2m MSK144 2m MSK144 - + 2m MSK 2m MSK - + 10m FT8 10m FT8 - + 10m 10m - + 6m FT8 6m FT8 - + 6m 6m - + 60m FT8 60m FT8 - + 60m 60m - + 160m FT8 160m FT8 - + 160m 160m - + 80m FT8 80m FT8 - + 80m 80m - + 20m FT8 20m FT8 - + 20m 20m - + 17m FT8 17m FT8 - + 17m 17m - + 4m FT8 4m FT8 - + 4m 4m - + 15m FT8 15m FT8 - + 15m 15m - + 2m FT8 2m FT8 - + 2m 2m - - + + 10m FT4 10m FT4 - - + + 12m FT4 12m FT4 - - + + 15m FT4 15m FT4 - - + + 17m FT4 17m FT4 - - + + 20m FT4 20m FT4 - - + + 30m FT4 30m FT4 - - + + 40m FT4 40m FT4 - - + + 80m FT4 80m FT4 - + FT8 QRG6 FT8 QRG6 - + FT8 QRG1 FT8 QRG1 - + FT8 QRG2 FT8 QRG2 - + FT8 QRG7 FT8 QRG7 - + FT8 QRG8 in kHz. FT8 QRG8 en kHz. - + FT8 QRG5 FT8 QRG5 - + FT8 QRG3 FT8 QRG3 - + FT8 QRG4 FT8 QRG4 - + FT8 QRG8 FT8 QRG8 - + FT8 QRG7 in kHz. FT8 QRG7 en kHz. - + FT8 QRG6 in kHz. FT8 QRG6 en kHz. - + FT8 QRG5 in kHz. FT8 QRG5ein kHz. - + FT8 QRG4 in kHz. FT8 QRG4 en kHz. - + FT8 QRG3 in kHz. FT8 QRG3 en kHz. - + FT8 QRG2 in kHz. FT8 QRG2 en kHz. - + FT8 QRG1 in kHz. FT8 QRG1 en kHz. - + + GroupBox + + + + + CQ %M CQ + + + + + %H 599 %N + + + + + %H TU CQ %M CQ + + + + + %M + + + + + %H + + + + + TU NOW %Q 599 %N + + + + + %H AGN? + + + + + 599 %N + + + + + F1 + F1 + + + + HisCall Exchange + + + + + TU CQ + + + + + F3 + F3 + + + + MyCall + + + + + F4 + F4 + + + + HisCall + + + + + F5 + F5 + + + + Now QueuedCall Exchange + + + + + F6 + F6 + + + + HisCall AGN ? + + + + + Exchange + + + + + Serial number of QSO for contest exchange. + + + + + Click to transmit a message. + + + + + Send message + + + + + Call next + + + + + Message to be transmitted + + + + + Serial Number + + + + + Callsign to be worked next. + + + + 1/2 1/2 - + 2/2 2/2 - + 1/3 1/3 - + 2/3 2/3 - + 3/3 3/3 - + 1/4 1/4 - + 2/4 2/4 - + 3/4 3/4 - + 4/4 4/4 - + 1/5 1/5 - + 2/5 2/5 - + 3/5 3/5 - + 4/5 4/5 - + 5/5 5/5 - + 1/6 1/6 - + 2/6 2/6 - + 3/6 3/6 - + 4/6 4/6 - + 5/6 5/6 - + 6/6 6/6 - + Percentage of minute sequences devoted to transmitting. Porcentaje de minutos dedicados a transmisión. - + Prefer Type 1 messages Preferir mensajes tipo 1 - + <html><head/><body><p>Transmit during the next sequence.</p></body></html> <html><head/><body><p>Transmitir durante la siguiente secuencia.</p></body></html> - + Spacing Espaciado - + Fixed Tone Tono fijo - + K1JT K1JT - + CW CW - + Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. Activa o desactiva el modo FT8 Hound.<br>Haga clic con el botón derecho para activar o desactivar el modo SuperFox. - + H H - + Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. Cambiar al modo FT8.<br>Haga clic derecho para activar o desactivar el último modo de concurso utilizado. - + Switch to FT4 mode Cambiar a modo FT4 - + Switch to MSK144 mode Cambiar a modo MSK144 - + MSK MSK - + <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> <html><head/><body><p>Cambiar al modo Q65.<br>Haga clic derecho para cambiar al modo Q65 Pileup.</p></body></html> - - + + Q65 Q65 - + <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> <html><head/><body><p>Cambiar al modo JT65. <br>Haga clic derecho para cambiar al modo JT9.</p></body></html> - + <html><head/><body><p>Switch to Echo mode</p></body></html> - <html><head/><body><p>Cambiar a modo Echo</p></body></html> + <html><head/><body><p>Cambiar a modo Echo</p></body></html> - + Filters Filtros - + Parameters Parámetros - + Decoder sensitivity Sensibilidad del decodificador - + Decoder start - + Inicio del decodificador - + Number of threads Número de hilos - + QSO RX freq sensitivity - + Sensibilidad de frecuencia RX del QSO - + Decoding cycles + Ciclos de decodificación + + + + Ctrl+X - + + Alt+X + + + + Remove saved files after 30 days Eliminar archivos guardados después de 30 días - + Erase wsjtx.log Borrar wsjtx.log - + Erase Ignore List Borrar lista de ignorados - + SWL Mode Modo Escucha - + Hide lower panel controls to maximize deocde windows Ocultar panel de controles inferior para maximizar la ventana de decodificados - + Don't split ALL.TXT No dividir ALL.TXT - + Split ALL.TXT yearly Dividir ALL.TXT anualmente - + Split ALL.TXT monthly Dividir ALL.TXT mensualmente - + Disable writing of ALL.TXT Deshabilitar la escritura en ALL.TXT - + Active Stations Estaciones activas - + Band Buttons Botones de banda - + Use Dark Style Utilizar Modo Oscuro - + Reduce false decodes Reducir las falsas decodificaciones - + Default event logging - + Registro de eventos predeterminado - + Diagnostic mode Modo Diagnóstico - + Disable event logging - + Deshabilitar el registro de eventos - + Quick-Start Guide to WSJT-X 2.7 and QMAP Guía de inicio rápido para WSJT-X 2.7 y QMAP - + + Download EME Ephemeris Chart + + + + + Hide AP information + + + + + <html><head/><body><p>Hide AP information</p></body></html> + + + + + Highlight Whitelist entries + + + + + JTTY + + + WSJT-X_improved Home Page - Página Web WSJT-X_improved + Página Web WSJT-X_improved - <html><head/><body><p>Go to the wsjt-x_improved home page.</p></body></html> - <html><head/><body><p>Vaya a la página de inicio de wsjt-x_improved.</p></body></html> + <html><head/><body><p>Vaya a la página de inicio de wsjt-x_improved.</p></body></html> - The additional features of wsjt-x_improved - Las características adicionales de wsjt-x_improved + Las características adicionales de wsjt-x_improved - <html><head/><body><p>Overview on the additional features of wsjt-x_improved.</p></body></html> - <html><head/><body><p>Descripción general de las características adicionales de wsjt-x_improved.</p></body></html> + <html><head/><body><p>Descripción general de las características adicionales de wsjt-x_improved.</p></body></html> - Recommended audio settings - Configuraciones de audio recomendadas + Configuraciones de audio recomendadas - <html><head/><body><p>Recommended Audio Settings.</p></body></html> - <html><head/><body><p>Configuración de audio recomendada.</p></body></html> + <html><head/><body><p>Configuración de audio recomendada.</p></body></html> - + How to deal with rig control errors - + Como gestionar los errores de control del equipo - + <html><head/><body><p>How to deal with rig control errors.</p></body></html> <html><head/><body><p>Cómo gestionar los errores de control del equipo.</p></body></html> - + Erase list of Q65 callers - + Borrar lista de estaciones que llaman en Q65 - + SuperFox User Guide Guía del usuario de SuperFox - + Message Creator Creador de Mensajes - + Hide stations worked before on band Ocultar estaciones trabajadas anteriormente en la banda - + Hide stations worked today or yesterday Ocultar estaciones trabajadas hoy o ayer - + Hide stations from Ignore List Ocultar estaciones de la lista de ignorados - + Ignore stations worked today or yesterday Ignorar estaciones trabajadas hoy o ayer - + Ignore stations from Ignore List Ignorar estaciones de la lista de ignorados - + Hide stations from Territory 1 Ocultar estaciones del Territorio 1 - + Hide stations from Territory 2 Ocultar estaciones del Territorio 2 - + Hide stations from Territory 3 Ocultar estaciones del Territorio 3 - + Hide stations from Territory 4 Ocultar estaciones del Territorio 4 - + Hide stations from Europe Ocultar estaciones de Europa - + Hide stations from North America Ocultar estaciones de Norteamérica - + Hide stations from South America Ocultar estaciones de Suramérica - + Hide stations from Asia Ocultar estaciones de Asia - + Hide stations from Africa Ocultar estaciones de África - + Hide stations from Oceania Ocultar estaciones de Oceanía - + Hide stations from Antarctica Ocultar estaciones de Antárctica - + Full Duplex Mode Modo Full Duplex - + Highlight callsigns worked before on band Resaltar los indicativos trabajados anteriormente en la banda - + Highlight callsigns worked today or yesterday Resaltar los indicativos trabajados hoy o ayer - + Highlight callsigns from Ignore List Resaltar indicativos de la lista de ignorados - + Enable Message Popups - + Habilitar ventanas emergentes de mensajes - + QSY Monitor Monitor QSY - + Ignore stations worked before on band Ignorar estaciones trabajadas anteriormente en la banda - + Use multithreaded FT8 decoder Utilice un decodificador FT8 multiproceso - + Auto Auto - - + + 5 5 - - + + 7 7 - - + + 11 11 - + Low Bajo - + Medium Medio - + High Alto - + Minimum Mínimo - + Use low thresholds - + Utilice umbrales bajos - + Use subpass - + Usar subpass - + 2-Stage - 2-Stage + 2 Etapas - + 3-Stage - 3-Stage + 3 etapas - + Early Temprano - + Late Tarde - + Wideband DX Call search - + Búsqueda de indicativo DX en banda ancha - + Hide FT8 dupe messages Ocultar mensajes duplicados de FT8 - + VHF / UHF Buttons Botones VHF/UHF - + Highlight stations from Territory 1 Destacar estaciones del Territorio 1 - + Highlight stations from Territory 2 Destacar estaciones del Territorio 2 - + Highlight stations from Territory 3 Destacar estaciones del Territorio 3 - + Highlight stations from Territory 4 Destacar estaciones del Territorio 4 - + Disable clicks on waterfall Deshabilitar clics en cascada (waterfall) - + + USB dial frequency Frecuencia de dial USB - + 14.078 000 14.078 000 - + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> - <html><head/><body><p>30dB recomendado cuando solo hay ruido presente,<br/>Verde cuando el nivel es bueno,<br/>Rojo cuando puede ocurrir recortes y<br/>Amarillo cuando esta muy bajo.</p></body></html> <html><head/><body><p>30 dB recomendado cuando solo hay ruido presente.<br>Verde: Nivel de audio aceptable.<br>Rojo: Pueden ocurrir fallos de audio.<br>Amarillo: Nivel de audio muy bajo.</p></body></html> - + Rx Signal - Señal de RX Señal RX - + 30dB recommended when only noise present Green when good Red when clipping may occur Yellow when too low - 30dB recomendado cuando solo hay ruido presente, -Verde cuando el nivel es bueno, -Rojo cuando puede ocurrir recortes y -Amarillo cuando esta muy bajo. 30dB recomendado cuando solo hay ruido presente, Verde cuando el nivel es bueno, Rojo pueden ocurrir fallos de audio Amarillo cuando esta muy bajo. - + NB NB - + DX Call Indicativo DX - + DX Grid - Locator/Grid DX Locator DX - + Callsign of station to be worked Indicativo de la estación a trabajar @@ -4325,28 +5368,26 @@ Amarillo cuando esta muy bajo. Buscar el indicativo en la base de datos (CALL3.TXT) - + &Lookup Buscar (&L) - + Locator of station to be worked - Locator/Grid de la estación a trabajar Locator de la estación a trabajar - + Az: 251 16553 km Az: 251 16553 km Add callsign and locator to database - Agregar indicativo y locator/Grid a la base de datos Agregar indicativo y locator a la base de datos (CALL3.TXT) - + Add Agregar @@ -4355,383 +5396,433 @@ Amarillo cuando esta muy bajo. Potencia - + <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> - <html><head/><body><p>Si ha habido un error en el control del equipo, haz clic para restablecer y leer la frecuencia del dial. S implica modo dividido o split.</p></body></html> <html><head/><body><p>Si está naranja o rojo, ha habido un error en el control del equipo</p><p>Clic para reiniciar y leer la frecuencia del dial. </p><p>S indica modo "Split".</p></body></html> - + If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. - Si ha habido un error en el control del equipo, haz clic para restablecer y leer la frecuencia del dial. S implica modo dividido o split. Si está naranja o rojo, ha habido un error en el control del equipo, clic para restablecer y leer la frecuencia del dial. S indica "Split". - + ? ? - + Adjust Tx audio level - Ajuste del nivel de audio de TX Ajustar nivel de audio de TX - + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> - <html><head/><body><p>Selecciona la banda operativa, introduce la frecuencia en MHz o introduce el incremento de kHz seguido de k.</p></body></html> <html><head/><body><p>Selecciona la banda, o escriba la frecuencia en MHz o escriba el incremento en kHz seguido de k.</p></body></html> - + Frequency entry Frecuencia de entrada - + Select operating band or enter frequency in MHz or enter kHz increment followed by k. - Selecciona la banda operativa, introduce la frecuencia en MHz o introduce el incremento de kHz seguido de k. Selecciona la banda o introduce la frecuencia en MHz o ecribe el incremento en kHz seguido de la letra k. - + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> - + <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> - <html><head/><body><p>Marca para mantener fija la frecuencia de transmisión al hacer doble clic en el texto decodificado.</p></body></html> <html><head/><body><p>Marcar para mantener fija la frecuencia de TX al hacer doble clic en el texto decodificado.</p></body></html> - + Check to keep Tx frequency fixed when double-clicking on decoded text. - Marca para mantener fija la frecuencia de transmisión al hacer doble clic en el texto decodificado. Marcar para mantener fija la frecuencia de TX al hacer doble clic en un texto decodificado. - + Hold Tx Freq - Mantén TX Freq Mantener Frec. TX - + + Audio Rx frequency - Frecuencia de audio en RX Frecuencia de RX - - - - - - + + + + + + + + Hz Hz - - + + + Rx RX - - + + + + Set Tx frequency to Rx Frequency - Coloca la frecuencia de RX en la de TX Coloca la frecuencia de TX en la de RX - + + ▲ ▲ - + + Frequency tolerance (Hz) Frecuencia de tolerancia (Hz) - - + + + F Tol F Tol - - + + + + Set Rx frequency to Tx Frequency - Coloca la frecuencia de TX en la de RX Coloca la frecuencia de RX en la de TX - + + ▼ ▼ - + <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> <html><head/><body><p>Umbral de sincronización. Los números más bajos aceptan señales de sincronización más débiles.</p></body></html> - + Synchronizing threshold. Lower numbers accept weaker sync signals. Umbral de sincronización. Los números más bajos aceptan señales de sincronización más débiles. - + Sync Sinc - + <html><head/><body><p>Check to use short-format messages.</p></body></html> - <html><head/><body><p>Marca para usar mensajes de formato corto.</p></body></html> <html><head/><body><p>Marcar para usar mensajes de formato corto.</p></body></html> - + Check to use short-format messages. - Marcar para usar mensajes de formato corto. Marca para usar mensajes de formato corto. - + Sh Sh - + <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> - <html><head/><body><p>Marca para habilitar los modos rápidos JT9</p></body></html> <html><head/><body><p>Marcar para habilitar los modos rápidos JT9</p></body></html> - + Check to enable JT9 fast modes - Marca para habilitar los modos rápidos JT9 Marcar para habilitar los modos rápidos JT9 - - + + Fast Rápido - + <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> - <html><head/><body><p>Marca para habilitar la secuencia automática de mensajes de TX en función de los mensajes recibidos.</p></body></html> <html><head/><body><p>Marcar para habilitar la secuencia automática de mensajes de TX en función de los mensajes recibidos.</p></body></html> - + Check to enable automatic sequencing of Tx messages based on received messages. - Marca para habilitar la secuencia automática de mensajes de TX en función de los mensajes recibidos. Marcar para habilitar la secuencia automática de mensajes de TX en función de los mensajes recibidos. - + Auto Seq - Secuencia Automática Secuencia Auto. <html><head/><body><p>Check to call the first decoded responder to my CQ.</p></body></html> - <html><head/><body><p>Responde al 1er. CQ decodificado.</p></body></html> <html><head/><body><p>Marcar para responder a la 1ra estación decodificada.</p></body></html> Check to call the first decoded responder to my CQ. - Responde al 1er. CQ decodificado. Marcar para responder al 1ra. estación decodificada. Call 1st - Responde al 1er. CQ 1er decodificado - + Check to generate "@1250 (SEND MSGS)" in Tx6. Marcar para generar "@1250 (SEND MSGS)" en TX6. - + Tx6 TX6 <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences.</p></body></html> - <html><head/><body><p>Marca a TX en minutos o secuencias de números pares, a partir de 0; desmarca las secuencias impares.</p></body></html> <html><head/><body><p>Marcar para transmitir en secuencias o minutos pares, comenzando por 0; desmarca para transmitir en las secuencias o minutos impares.</p></body></html> Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. - Marca a TX en minutos o secuencias de números pares, a partir de 0; desmarca las secuencias impares. Marcar para transmitir en secuencias o minutos pares, comenzando por 0; desmarca para transmitir en las secuencias o minutos impares. - + Tx even/1st - Alternar periodo TX Par/Impar Tx par/1ro - + <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> - <html><head/><body><p>Frecuencia para llamar a CQ en kHz por encima del MHz actual</p></body></html> <html><head/><body><p>Frecuencia para llamar CQ en kHz por sobre el MHz actual</p></body></html> - + Frequency to call CQ on in kHz above the current MHz - Frecuencia para llamar a CQ en kHz por encima del MHz actual Frecuencia para llamar CQ en kHz por encima del MHz actual - + Tx CQ TX CQ - + <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> - <html><head/><body><p>Marca esto para llamar a CQ en la frecuencia&quot;TX CQ&quot;. RX será a la frecuencia actual y el mensaje CQ incluirá la frecuencia de RX actual para que los corresponsales sepan en qué frecuencia responder.</p><p>No está disponible para los titulares de indicativo no estándar.</p></body></html> <html><head/><body><p>Marcar para llamar CQ en la frecuencia "TX CQ". RX será a la frecuencia actual y el mensaje CQ incluirá la frecuencia de RX actual para que los corresponsales sepan en qué frecuencia responder.</p><p>No está disponible para los titulares de indicativo no estándar.</p></body></html> - + Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. Not available to nonstandard callsign holders. - Marca esto para llamar a CQ en la frecuencia "TX CQ". RX será a la frecuencia actual y el mensaje CQ incluirá la frecuencia de RX actual para que los corresponsales sepan en qué frecuencia responder. -No está disponible para los titulares de indicativo no estándar. Marcar para llamar CQ en la frecuencia "TX CQ". RX será a la frecuencia actual y el mensaje CQ incluirá la frecuencia de RX actual para que los corresponsales sepan en qué frecuencia responder. No está disponible para los titulares de indicativo no estándar. - + Rx All Freqs RX en todas las frecuencias - + <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> <html><head/><body><p>El submodo determina el espaciado de tono; "A" es más estrecho.</p></body></html> - + Submode determines tone spacing; A is narrowest. El submodo determina el espaciado de tono; "A" es más estrecho. - + Submode Submodo - - + + Fox - Fox "Fox" - + + WSJT-X by K1JT et al. + + + + + Band Activity decode pane title + + + + + Title for the Band Activity decoded messages pane. + + + + + Band Activity decoded messages headings + + + + + + Columns: UTC dB DT Freq Message. + + + + + Band Activity decoded messages + + + + + Decoded messages in the Band Activity pane. Columns: UTC dB DT Freq Message. + + + + + Rx Frequency decode pane title + + + + + Title for the Rx Frequency decoded messages pane. + + + + + Rx Frequency decoded messages headings + + + + + Rx Frequency decoded messages + + + + + Decoded messages in the Rx Frequency pane. Columns: UTC dB DT Freq Message. + + + + + Check to display received messages in lower case. + + + + + Lower case + + + + + Include Time + + + + <html><head/><body><p>Check to monitor Sh messages.</p></body></html> - <html><head/><body><p>Marca para monitorear los mensajes Sh.</p></body></html> <html><head/><body><p>Marcar para escuchar los mensajes Sh.</p></body></html> - + Check to monitor Sh messages. - Marca para monitorear los mensajes Sh. Marcar para escuchar los mensajes Sh. - + SWL SWL - + Best S+P - El mejor S+P Mejor S+P - + <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> - <html><head/><body><p>Marca para comenzar a registrar los datos de calibración.<br/>Mientras se mide la corrección de calibración, se desactiva.<br/>Cuando no está marcado, puedes ver los resultados de la calibración.</p></body></html> <html><head/><body><p>Marcar para comenzar a grabar los datos de calibración.<br/>Mientras se mide, la corrección de calibración está desactivada.<br/>Cuando no está marcado, puede verse los resultados de la calibración.</p></body></html> - + Check this to start recording calibration data. While measuring calibration correction is disabled. When not checked you can view the calibration results. - Marca para comenzar a registrar los datos de calibración. -Mientras se mide la corrección de calibración, se desactiva. -Cuando no está marcado, puedes ver los resultados de la calibración. Marcar para comenzar a grabar los datos de calibración. Mientras se mide, la corrección de calibración está desactivada. Cuando no está marcado, puede verse los resultados de la calibración. - + Measure Medida - + + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the strongest station's reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the weakest station's reply to your CQ.</p><p>When CQ or QRZ is pending, Enable Tx may be armed before or during a receive period. Only eligible direct callers decoded after it is armed in that period can replace the pending transmission; earlier callers are not retained.</p></body></html> + + + + <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> - <html><head/><body><p>Informe de señal: relación señal/ruido en ancho de banda de referencia de 2500 Hz (dB).</p></body></html> <html><head/><body><p>Reporte de señal: Relación señal/ruido en ancho de banda de referencia de 2500 Hz (dB).</p></body></html> - + Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). - Informe de señal: relación señal/ruido en ancho de banda de referencia de 2500 Hz (dB). Reporte de señal: Relación señal/ruido en ancho de banda de referencia de 2500 Hz (dB). - + Report - No -> Señal de Recepción Reporte - + <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> - <html><head/><body><p>Tx/Rx o longitud de secuencia de calibración de frecuencia</p></body></html> <html><head/><body><p>TX/RX o longitud de secuencia de calibración de frecuencia</p></body></html> - + Tx/Rx or Frequency calibration sequence length - Tx/Rx o longitud de secuencia de calibración de frecuencia TX/RX o longitud de secuencia de calibración de frecuencia - - + + s s - - + + T/R T/R Toggle Tx mode - Conmuta el modo TX Conmuta modo TX @@ -4739,30 +5830,29 @@ Cuando no está marcado, puede verse los resultados de la calibración.TX JT9 @ - + + Audio Tx frequency - Frecuencia de audio de TX Frecuencia de TX - - + + + Tx TX - + Tx# TX# <html><head/><body><p>Double-click on another caller to queue that call for your next QSO.</p></body></html> - <html><head/><body><p>Haz doble clic en otro indicativo que llama para poner en la cola esa llamada para tú siguiente QSO.</p></body></html> <html><head/><body><p>Doble clic en otra estación llamando para poner en la cola ese indicativo para tu siguiente QSO.</p></body></html> Double-click on another caller to queue that call for your next QSO. - Haz doble clic en otro indicativo que llama para poner en la cola esa llamada para tú siguiente QSO. Doble clic en otra estación llamando para poner en la cola ese indicativo para tu siguiente QSO. @@ -4770,269 +5860,242 @@ Cuando no está marcado, puede verse los resultados de la calibración.Siguiente Indicativo - - - + + + 1 1 - - - + + + Send this message in next Tx interval - Enviar este mensaje en el siguiente intervalo de transmisión Enviar este mensaje en el siguiente intervalo de TX - + Ctrl+2 Ctrl+2 - + <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> - <html><head/><body><p>Enviar este mensaje en el siguiente intervalo de transmisión.</p><p>Haz doble clic para alternar el uso del mensaje TX1 para iniciar un QSO con una estación (no está permitido para titulares de indicativos compuestos de tipo 1).</p></body></html> <html><head/><body><p>Enviar este mensaje en el siguiente intervalo de TX.</p><p>Doble clic para alternar el uso del mensaje TX1 para iniciar un QSO con una estación (no está permitido para titulares de indicativos compuestos de tipo 1).</p></body></html> - + Send this message in next Tx interval Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) - Enviar este mensaje en el siguiente intervalo de transmisión. -Haz doble clic para alternar el uso del mensaje TX1 para iniciar un QSO con una estación (no está permitido para titulares de indicativos compuestos de tipo 1). Enviar este mensaje en el siguiente intervalo de TX. Doble clic para alternar el uso del mensaje TX1 para iniciar un QSO con una estación (no está permitido para titulares de indicativos compuestos de tipo 1). - + Ctrl+1 Ctrl+1 - - - - + + + + Switch to this Tx message NOW - Cambia a este mensaje de TX AHORA Cambiar a este mensaje de TX AHORA - + Tx &2 TX &2 - + Alt+2 Alt+2 - + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> - <html><head/><body><p>Cambia a este mensaje de TX AHORA.</p><p>Haz doble clic para alternar el uso del mensaje TX1 para iniciar un QSO con una estación (no está permitido para titulares de indicativos compuestos de tipo 1).</p></body></html> <html><head/><body><p>Cambiar a este mensaje de TX AHORA.</p><p>Doble clic para alternar el uso del mensaje TX1 para iniciar un QSO con una estación (no está permitido para titulares de indicativos compuestos de tipo 1).</p></body></html> - + Switch to this Tx message NOW Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) - Cambia a este mensaje de TX AHORA. -Haz doble clic para alternar el uso del mensaje TX1 para iniciar un QSO con una estación (no está permitido para titulares de indicativos compuestos de tipo 1). Cambiar a este mensaje de TX AHORA.Doble clic para alternar el uso del mensaje TX1 para iniciar un QSO con una estación (no está permitido para titulares de indicativos compuestos de tipo 1) - + Tx &1 TX &1 - + Alt+1 Alt+1 - + Ctrl+6 Ctrl+6 - + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> - <html><head/><body><p>Enviar este mensaje en el siguiente intervalo de transmisión</p><p>Haz doble clic para restablecer el mensaje estándar 73.</p></body></html> <html><head/><body><p>Enviar este mensaje en el siguiente intervalo de TX</p><p>Doble clic para restablecer el mensaje 73 estándar.</p></body></html> - + Send this message in next Tx interval Double-click to reset to the standard 73 message Enviar este mensaje en el siguiente intervalo de TX. Doble clic para restablecer el mensaje 73 estándar. - + Ctrl+5 Ctrl+5 - + Ctrl+3 Ctrl+3 - + Tx &3 TX &3 - + Alt+3 Alt+3 - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>Envia este mensaje en el siguiente intervalo de transmisión.</p><p>Haz doble clic para alternar entre los mensajes RRR y RR73 en TX4 (no está permitido para titulares de indicativos compuestos de tipo 2).</p><p>Los mensajes RR73 solo deben usarse cuando esté razonablemente seguro de que no se requerirán repeticiones de mensajes.</p></body></html> - <html><head/><body><p>Envia este mensaje en el siguiente intervalo de TX.</p><p>Doble clic para alternar entre los mensajes RRR y RR73 en TX4 (no está permitido para titulares de indicativos compuestos de tipo 2).</p><p>Los mensajes RR73 solo deben usarse cuando esté razonablemente seguro de que no se requerirán repeticiones de mensajes.</p></body></html> + <html><head/><body><p>Envia este mensaje en el siguiente intervalo de TX.</p><p>Doble clic para alternar entre los mensajes RRR y RR73 en TX4 (no está permitido para titulares de indicativos compuestos de tipo 2).</p><p>Los mensajes RR73 solo deben usarse cuando esté razonablemente seguro de que no se requerirán repeticiones de mensajes.</p></body></html> - Send this message in next Tx interval Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - Envia este mensaje en el siguiente intervalo de TX. Doble clic para alternar entre los mensajes RRR y RR73 en TX4 (no está permitido para titulares de indicativos compuestos de tipo 2). Los mensajes RR73 solo deben usarse cuando esté razonablemente seguro de que no se requerirán repeticiones de mensajes + Envia este mensaje en el siguiente intervalo de TX. Doble clic para alternar entre los mensajes RRR y RR73 en TX4 (no está permitido para titulares de indicativos compuestos de tipo 2). Los mensajes RR73 solo deben usarse cuando esté razonablemente seguro de que no se requerirán repeticiones de mensajes - + Ctrl+4 Ctrl+4 - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>Cambia a este mensaje de TX AHORA.</p><p>Haz doble clic para alternar entre los mensajes RRR y RR73 en TX4 (no está permitido para titulares de indicativos compuestos de tipo 2).</p><p>Los mensajes RR73 solo deben usarse cuando esté razonablemente seguro de que no se requerirán repeticiones de mensajes.</p></body></html> - <html><head/><body><p>Cambiar a este mensaje de TX AHORA.</p><p>Doble clic para alternar entre los mensajes RRR y RR73 en TX4 (no está permitido para titulares de indicativos compuestos de tipo 2).</p><p>Los mensajes RR73 solo deben usarse cuando esté razonablemente seguro de que no se requerirán repeticiones de mensajes.</p></body></html> + <html><head/><body><p>Cambiar a este mensaje de TX AHORA.</p><p>Doble clic para alternar entre los mensajes RRR y RR73 en TX4 (no está permitido para titulares de indicativos compuestos de tipo 2).</p><p>Los mensajes RR73 solo deben usarse cuando esté razonablemente seguro de que no se requerirán repeticiones de mensajes.</p></body></html> - Switch to this Tx message NOW Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - Cambia a este mensaje de TX AHORA. -Haz doble clic para alternar entre los mensajes RRR y RR73 en TX4 (no está permitido para titulares de indicativos compuestos de tipo 2). -Los mensajes RR73 solo deben usarse cuando esté razonablemente seguro de que no se requerirán repeticiones de mensajes. - Cambiar a este mensaje de TX AHORA. + Cambiar a este mensaje de TX AHORA. Doble clic para alternar entre los mensajes RRR y RR73 en TX4 (no está permitido para titulares de indicativos compuestos de tipo 2). Los mensajes RR73 solo deben usarse cuando esté razonablemente seguro de que no se requerirán repeticiones de mensajes. - + Tx &4 TX &4 - + Alt+4 Alt+4 <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p></body></html> - <html><head/><body><p>Cambia a este mensaje de TX AHORA.</p><p>Haz doble clic para restablecer el mensaje estándar 73.</p></body></html> <html><head/><body><p>Cambiar a este mensaje de TX AHORA.</p><p>Doble clic para restablecer el mensaje estándar 73.</p></body></html> Switch to this Tx message NOW Double-click to reset to the standard 73 message - Cambia a este mensaje de TX AHORA. -Haz doble clic para restablecer el mensaje estándar 73. Cambiar a este mensaje de TX AHORA. Doble clic para cambiar al mensaje estándar 73. - + Tx &5 TX &5 - + Alt+5 Alt+5 - + Now Ahora - + Generate standard messages for minimal QSO - Genera mensajes estándar para un QSO mínimo Genera mensajes estándares para realizar un QSO - + Generate Std Msgs - Genera Mensaje Standar Genera Mensajes Estándar - + Tx &6 TX &6 - + Alt+6 Alt+6 - + Enter a free text message (maximum 13 characters) or select a predefined macro from the dropdown list. Press ENTER to add the current text to the predefined list. The list can be maintained in Settings (F2). - Introduce un mensaje de texto libre (máximo 13 caracteres) -o selecciona una macro predefinida de la lista desplegable. -Presiona ENTRAR para agregar el texto actual al predefinido -de la lista. La lista se puede mantener en Configuración (F2). Escribe un mensaje de texto libre (máximo 13 caracteres) o selecciona una macro predefinida de la lista desplegable. Presiona INTRO para agregar el texto actual a la lista predefinida. La lista se puede modificar en "Ajustes" (F2). - + Queue up the next Tx message Poner en cola el siguiente mensaje de TX - + Next Siguiente - - - - - - + + + + + + 2 2 - + Quick-Start Guide to FST4 and FST4W Guía de inicio rápido a FST4 y FST4W (inglés) - + FST4 FST4 - + FST4W FST4W @@ -5045,8 +6108,9 @@ predefinida. La lista se puede modificar en "Ajustes" (F2).Genera mensaje CQ - - + + + CQ CQ @@ -5060,7 +6124,6 @@ predefinida. La lista se puede modificar en "Ajustes" (F2). Generate message with report - Generar mensaje con informe de señal Genera mensaje con informe de señal @@ -5073,18 +6136,15 @@ predefinida. La lista se puede modificar en "Ajustes" (F2). Generate message for replying to a CQ - Generar mensaje para responder a un CQ Genera mensaje para responder a un CQ - + Grid - Locator/grid Locator Generate message with R+report - Generar mensaje con R+informe de señal Genera mensaje con R más informe de señal @@ -5093,7 +6153,6 @@ predefinida. La lista se puede modificar en "Ajustes" (F2). Generate message with 73 - Generar mensaje con 73 Genera mensaje con 73 @@ -5102,17 +6161,14 @@ predefinida. La lista se puede modificar en "Ajustes" (F2). Send this standard (generated) message - Enviar este mensaje estándar (generado) Envia este mensaje estándar (generado) Gen msg - Gen msg Msg Gen Send this free-text message (max 13 characters) - Enviar este mensaje de texto libre (máximo 13 caracteres) Envia este mensaje de texto libre (máximo 13 caracteres) @@ -5120,10 +6176,10 @@ predefinida. La lista se puede modificar en "Ajustes" (F2).Msg Libre - - - - + + + + 3 3 @@ -5132,133 +6188,133 @@ predefinida. La lista se puede modificar en "Ajustes" (F2).Max dB - + CQ AF CQ AF - + CQ AN CQ AN - + CQ AS CQ AS - + CQ EU CQ EU - + CQ NA CQ NA - + CQ OC CQ OC - + CQ SA CQ SA - + CQ 0 CQ 0 - + CQ 1 CQ 1 - + CQ 2 CQ 2 - + CQ 3 CQ 3 - + CQ 4 CQ 4 - + CQ 5 CQ 5 - + CQ 6 CQ 6 - + CQ 7 CQ 7 - + CQ 8 CQ 8 - + CQ 9 CQ 9 - + Reset Reiniciar - + N List N List - + N Slots N Slots - - - - - - - + + + + + + + Random Aleatorio - + Call Indicativo - + S/N (dB) S/N (dB) - + Distance Distancia - + More CQs Más CQ's @@ -5267,66 +6323,58 @@ predefinida. La lista se puede modificar en "Ajustes" (F2).Porcentaje de secuencias de 2 minutos dedicadas a la transmisión. - - + + % % - + Tx Pct - TX Pct Pct TX - + Band Hopping - Salto de banda + Saltar entre bandas - + Choose bands and times of day for band-hopping. - Elija bandas y momentos del día para saltar de banda. Escoja bandas y momentos del día para saltos de banda. - + Schedule ... - Calendario ... Programar ... - + Upload decoded messages to WSPRnet.org. - Cargue mensajes decodificados a WSPRnet.org. Subir mensajes decodificados a WSPRnet.org. - + Upload spots Subir "Spots" - + <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> - <html><head/><body><p>Los Locator/Grid de 6 dígitos hacen que se envíen 2 mensajes diferentes, el segundo contiene el locator completo, pero sólo un indicativo troceado, las otras estaciones deben haber decodificado el primero una vez antes de poder descodificar el segundo. Marca esta opción para enviar sólo locators de 4 dígitos y se evitará el protocolo de dos mensajes.</p></body></html> <html><head/><body><p>Los locator de 6 dígitos hace que se envíen 2 mensajes diferentes, el segundo contiene el locator completo, pero sólo un indicativo, otras estaciones deben haber decodificado el primero antes de poder descodificar el segundo. Marcar esta opción para enviar sólo locators de 4 dígitos y se evitará el protocolo de dos mensajes.</p></body></html> - + 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. - Los Locator/Grid de 6 dígitos hacen que se envíen 2 mensajes diferentes, el segundo contiene el locator completo, pero sólo un indicativo troceado, las otras estaciones deben haber decodificado el primero una vez antes de poder descodificar el segundo. Marca esta opción para enviar sólo locators de 4 dígitos y se evitará el protocolo de dos mensajes. Los locator de 6 dígitos hace que se envíen 2 mensajes diferentes, el segundo contiene el locator completo, pero sólo un indicativo, otras estaciones deben haber decodificado el primero antes de poder descodificar el segundo. Marcar esta opción para enviar sólo locators de 4 dígitos y se evitará el protocolo de dos mensajes. Prefer type 1 messages - Prefieres mensajes de tipo 1 Preferir mensajes de tipo 1 - + No own call decodes - No se descodifica ningún indicativo propio No se descodifica mi indicativo @@ -5334,190 +6382,180 @@ predefinida. La lista se puede modificar en "Ajustes" (F2).Transmite durante la siguiente secuencia de 2 minutos. - + Tx Next Siguiente TX - + Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. - Configura la potencia de transmisión en dBm (dB por encima de 1 mW) como parte de tú mensaje WSPR. Configurar la potencia de TX en dBm (dB por encima de 1 mW) como parte de su mensaje WSPR. - + File Archivo - + View Ver - + Decode - Decodifica Decodificar - + Save Guardar - + Help Ayuda - + + Mode Modo - + Configurations - No es valido utilizar Ajustes Configuraciones - + Tools Herramientas - + Exit Salir + Configuration - Ajustes + Ajustes + F2 - F2 + F2 - + About WSJT-X Acerca de WSJT-X - + Waterfall - Cascada Cascada (Waterfall) - + Open Abrir - + Ctrl+O Ctrl+O - + Open next in directory Abrir siguiente en el directorio - + Decode remaining files in directory Decodifica los archivos restantes en el directorio - Shift+F6 - Mayúsculas+F6 - Mayúsculas+F6 + Mayúsculas+F6 - + Delete all *.wav && *.c2 files in SaveDir Borrar todos los archivos *.wav y *.c2 - + None - Ninguno Nada - + Save all Guardar todo - + Online User Guide Guía de usuario en línea - + Keyboard shortcuts Atajos de teclado - + Special mouse commands Comandos especiales de ratón - + JT9 JT9 - + Save decoded - Guarda el decodificado Guardar lo decodificado - - + + Normal Normal - + Deep Profundo Monitor OFF at startup - Monitor apagado al inicio "Monitor" apagado al inicio - + Erase ALL.TXT Borrar ALL.TXT - + Erase wsjtx_log.adi - Borrar el archivo wsjtx_log.adi Borrar archivo wsjtx_log.adi Convert mode to RTTY for logging - Convierte el modo a RTTY después de registrar el QSO Convierte el modo a RTTY para guardar el QSO Log dB reports to Comments - Pon los informes de recepción en dB en Comentarios Guardar reportes dB en los Comentarios Prompt me to log QSO - Pedirme que registre QSO Preguntarme antes de guardar el QSO @@ -5526,7 +6564,6 @@ predefinida. La lista se puede modificar en "Ajustes" (F2). Clear DX Call and Grid after logging - Borrar Indicativo DX y Locator/Grid DX después de registrar un QSO Borrar Indicativo y Locator del DX después de guardar QSO @@ -5535,17 +6572,15 @@ predefinida. La lista se puede modificar en "Ajustes" (F2). Double-click on call sets Tx Enable - Haz doble clic en los conjuntos de indicativos de activar TX Doble clic en el indicativo activa la TX - + F7 F7 Tx disabled after sending 73 - Tx deshabilitado después de enviar 73 Dehabilita TX después de enviar 73 @@ -5558,12 +6593,11 @@ predefinida. La lista se puede modificar en "Ajustes" (F2). Tx freq locked to Rx freq - TX frec bloqueado a RX frec Freq. de TX bloqueda a freq. de RX - - + + JT65 JT65 @@ -5573,7 +6607,6 @@ predefinida. La lista se puede modificar en "Ajustes" (F2). Tx messages to Rx Frequency window - Mensajes de texto a la ventana de frecuencia de RX Mensajes de TX a la ventana de "Frecuencia de RX" @@ -5582,159 +6615,150 @@ predefinida. La lista se puede modificar en "Ajustes" (F2). Show DXCC entity and worked B4 status - Mostrar entidad DXCC y estado B4 trabajado Mostrar DXCC y estado B4 trabajado - + Astronomical data Datos astronómicos - + List of Type 1 prefixes and suffixes - Lista de prefijos y sufijos de tipo 1 Lista de prefijos y sufijos tipo 1 - + Settings... - Configuración Ajustes... - + Local User Guide Guía de usuario local - + Open log directory Abrir directorio de log - + JT4 JT4 - + Message averaging Promedio de mensajes - + Enable averaging Habilitar el promedio - + Enable deep search Habilitar búsqueda profunda - + WSPR WSPR - + Echo Graph Gráfico de eco - + F8 F8 - - + + Echo - Echo Eco - + EME Echo mode Modo EME Eco - + ISCAT ISCAT - + Fast Graph - Gráfico rápido "Fast Graph" - F9 - F9 + F9 - + &Download Samples ... - &Descargar muestras ... &Descargar muestras de audio ... - + <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> - <html><head/><body><p>Descarga archivos de audio de muestra que demuestren los distintos modos.</p></body></html> <html><head/><body><p>Descargar archivos de audio de los distintos modos.</p></body></html> - + MSK144 MSK144 - + QRA64 QRA64 - + Release Notes Cambios en la nueva versión - + Enable AP for DX Call - Habilitar AP para llamada DX Habilitar AP para indicativo DX - + FreqCal FreqCal - + Measure reference spectrum Medir espectro de referencia - + Measure phase response Medir la respuesta de fase - + Erase reference spectrum Borrar espectro de referencia - + Execute frequency calibration cycle Ejecutar ciclo de calibración de frecuencia - + Equalization tools ... Herramientas de ecualización ... @@ -5747,54 +6771,50 @@ predefinida. La lista se puede modificar en "Ajustes" (F2).Modo experimental LF/MF - - + + FT8 FT8 - - + + Enable AP Habilitar AP - + Solve for calibration parameters - Resolver para parámetros de calibración Resolver parámetros de calibración - + Copyright notice Derechos de Autor - + Shift+F1 Mayúsculas+F1 - + Fox log - Log Fox Log "Fox" - + FT8 DXpedition Mode User Guide Guía de usuario del modo FT8 DXpedition (inglés) - + Reset Cabrillo log ... - Restablecer log de Cabrillo ... Borrar log Cabrillo ... - + Color highlighting scheme - Esquema de resaltado de color Esquema de resaltado de colores @@ -5802,9 +6822,8 @@ predefinida. La lista se puede modificar en "Ajustes" (F2).Log de Concurso - + Export Cabrillo log ... - Exportar log de Cabrillo ... Exportar log Cabrillo ... @@ -5812,35 +6831,35 @@ predefinida. La lista se puede modificar en "Ajustes" (F2).Guía de inicio rápido para WSJT-X 2.0 (inglés) - + Contest log Log de Concurso - + Erase WSPR hashtable Borrar la tabla de WSPR - - + + FT4 FT4 - + Rig Control Error Error de control del equipo - - - + + + Receiving Recibiendo - + Do you want to reconfigure the radio interface? ¿Desea reconfigurar la interfaz de radio? @@ -5865,197 +6884,200 @@ predefinida. La lista se puede modificar en "Ajustes" (F2).Excesiva muestras rechazadas - %1 (%2 seg) de audio rechazados en periodo %3 - + Error Scanning ADIF Log Error al escanear el log ADIF - + Scanned ADIF log, %1 worked-before records created. CTY: %2 - Log ADIF escaneado, %1 funcionaba antes de la creación de registros Log ADIF escaneado, %1 registros trabajados B4 creados. CTY: %2 - + Error Loading LotW Users Data - -Error al cargar datos de usuarios de LotW Error al cargar datos de usuarios de LoTW - - Error Writing WAV File - Error al escribir el archivo WAV + + + + Decoder Error + - + + The decoder subprocess exited unexpectedly. + + + + + jt9 exited unexpectedly with code %1. + + + + + + Error Writing WAV File + Error al escribir el archivo WAV + + + Enumerating audio devices Listando dispositivos de audio - + Configurations... - Conmfiguraciones... Configuraciones... - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Message Mensaje - + Error Killing jt9.exe Process Error al matar el proceso jt9.exe - + KillByName return code: %1 - Código de retorno de KillByName: %1 KillByName regresa código: %1 - + Error removing "%1" Error al eliminar "%1" - + Click OK to retry - Haga clic en Aceptar para volver a intentar Clic en "Aceptar" para reintentar - - + + %1.wav: invalid sample count %2 + + + + + Improper mode Modo incorrecto - - + + File Open Error - Error de apertura del archivo Error al abrir archivo - - - - - + + + + + Cannot open "%1" for append: %2 - No puedo abrir "%1" para anexar: %2 No se puedo abrir "%1" para anexar: %2 - + Error saving c2 file - Error al guardar el archivo c2 Error al guardar archivo c2 - + Error in Sound Input Error en entrada de sonido - + Error in Sound Output - Error en la salida de sonido Error en salida de audio - - + + Single-Period Decodes Decodificaciones de un solo período - - + + Average Decodes Promedio de decodificaciones - + Change Operator Cambiar operador - + New operator: Nuevo operador: - + Status File Error - Error de estado del archivo Error en el archivo de estado - - + + Cannot open "%1" for writing: %2 - No se puede abrir "%1" para la escritura: %2 No se puede abrir "%1" para escritura: %2 - + Decodes containing My Call Decodificaciones que contienen mi indicativo - + Subprocess Error Error de subproceso - + Subprocess failed with exit code %1 El subproceso falló con el código de salida %1 - - + + Running: %1 %2 - Corriendo: %1 -%2 Ejecutando: %1 %2 - + Subprocess error Error de subproceso - Reference spectrum saved - Espectro de referencia guardado + Espectro de referencia guardado - It is very important to avoid audio harmonics and distorted audio signals. This is usually achieved by the following step-by-step approach: @@ -6079,25 +7101,46 @@ This is usually achieved by the following step-by-step approach: If possible, check your transmission from time to time with a webSDR to ensure the signal is clean and not distorted. - + Es muy importante evitar los armónicos de audio y las señales de audio distorsionadas. +Normalmente se consigue siguiendo estos pasos: + +1. Seleccione 'Fake it' en el menú Ajustes/Radio como 'Modo Split'. Si su + equipo no lo admite, seleccione 'Rig'. ¡Intente evitar realmente 'None'! + +2. Ajuste al máximo la potencia de transmisión del transceptor. + +3. Ajuste el control Pwr al mínimo y haga clic en el botón 'Tune'. + +4. Observe la potencia real de transmisión del equipo y también el ALC. + +5. Aumente cuidadosamente el control Pwr hasta alcanzar la + potencia máxima de transmisión del transceptor. + +6. MUY IMPORTANTE: reduzca ahora el control Pwr hasta alcanzar aproximadamente + el 90 % de la potencia máxima de TX. El ALC debe estar próximo a cero. + +7. Este es el nivel máximo de audio permitido con su configuración. + Mantenga siempre el control Pwr por debajo de este valor máximo. + +Si es posible, compruebe de vez en cuando su transmisión con un webSDR +para asegurarse de que la señal sea limpia y no esté distorsionada. - <b>Recommended Audio Settings</b> - <b>Configuración de audio recomendada</b> + <b>Configuración de audio recomendada</b> - + Invalid data in fmt.all at line %1 Datos no válidos en fmt.all en la línea %1 - + Good Calibration Solution Buena solución de calibración - + <pre>%1%L2 ±%L3 ppm %4%L5 ±%L6 Hz @@ -6110,27 +7153,24 @@ to ensure the signal is clean and not distorted. %9%L10 Hz</pre> - + Delete Calibration Measurements - Eliminar mediciones de calibración Borrar mediciones de calibración - + The "fmt.all" file will be renamed as "fmt.bak" El archivo "fmt.all" será renombrado como "fmt.bak" - If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: "The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2025 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; and other members of the WSJT Development Group." - Si hace un uso justo de cualquier parte de WSJT-X según los términos de la Licencia Pública General de GNU, debe mostrar el siguiente aviso de copyright de forma destacada en su trabajo derivado: + Si hace un uso justo de cualquier parte de WSJT-X según los términos de la Licencia Pública General de GNU, debe mostrar el siguiente aviso de copyright de forma destacada en su trabajo derivado: "Los algoritmos, el código fuente, la apariencia de WSJT-X y los programas relacionados, así como las especificaciones de protocolo para los modos FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65 y MSK144, están protegidos por derechos de autor (C) 2001-2025 por uno o más de los siguientes autores: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; y otros miembros del Grupo de Desarrollo de WSJT." - <table cellspacing=1> <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> @@ -6181,139 +7221,701 @@ to ensure the signal is clean and not distorted. </table> Keyboard shortcuts help window contents + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Detener TX, cancelar QSO y borrar la cola de próximas llamadas</td></tr> + <tr><td><b>F1 </b></td><td>Guía de usuario en línea (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Aviso de copyright</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>Acerca de WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Abrir la ventana de ajustes (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Mostrar atajos de teclado (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Borrar Indicativo DX, Locator DX y mensajes TX 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Salir del programa</td></tr> + <tr><td><b>F5 </b></td><td>Mostrar comandos especiales del ratón (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Abrir el siguiente archivo del directorio (Alt: toggle "Call 1st")</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decodificar todos los archivos restantes del directorio</td></tr> + <tr><td><b>F7 </b></td><td>Mostrar la ventana Promedio de mensajes</td></tr> + <tr><td><b>F11 </b></td><td>Bajar 1 Hz la frecuencia RX</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Bajar 1 Hz las frecuencias RX y TX idénticas</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Bajar la frecuencia TX 60 Hz (FT8) o 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Bajar 1000 Hz la frecuencia del dial</td></tr> + <tr><td><b>F12 </b></td><td>Subir 1 Hz la frecuencia RX</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Subir 1 Hz las frecuencias RX y TX idénticas</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Subir la frecuencia TX 60 Hz (FT8) o 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Subir 1000 Hz la frecuencia del dial</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Establecer ahora la transmisión con este número en la pestaña 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Establecer la próxima transmisión con este número en la pestaña 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Borrar Estaciones activas para QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Alternar el estado «Best S+P»</td></tr> + <tr><td><b>Alt+C </b></td><td>Alternar la casilla «Call 1st»</td></tr> + <tr><td><b>Alt+D </b></td><td>Decodificar de nuevo en la frecuencia del QSO</td></tr> + <tr><td><b>Shift+D </b></td><td>Decodificación completa (ambas ventanas)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Activar TX par/1.º</td></tr> + <tr><td><b>Shift+E </b></td><td>Desactivar TX par/1.º</td></tr> + <tr><td><b>Alt+E </b></td><td>Borrar</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Editar el cuadro de mensaje de texto libre</td></tr> + <tr><td><b>Alt+G </b></td><td>Generar mensajes estándar</td></tr> + <tr><td><b>Alt+H </b></td><td>Detener TX</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Añadir Indicativo DX a la lista de ignorados</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Buscar indicativo en la base de datos y generar mensajes estándar</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitorizar</td></tr> + <tr><td><b>Alt+N </b></td><td>Alternar «Habilitar TX»</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Abrir un archivo .wav</td></tr> + <tr><td><b>Alt+O </b></td><td>Cambiar operador</td></tr> + <tr><td><b>Alt+Q </b></td><td>Abrir la ventana «Registrar QSO»</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Establecer el mensaje Tx4 como RRR (no en FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Establecer el mensaje Tx4 como RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Actualizar la ventana Estaciones activas</td></tr> + <tr><td><b>Alt+S </b></td><td>Detener monitorización</td></tr> + <tr><td><b>Alt+T </b></td><td>Alternar estado de Tune</td></tr> + <tr><td><b>Alt+Z </b></td><td>Borrar estado de decodificador bloqueado</td></tr> + +</table> + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Right-click</b> to set Tx frequency.<br/> + <b>Double-right-click</b> to set Rx and Tx frequencies. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> + and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> + Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> + own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">Dial Frequency:</td> + <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> + <b>Right-click</b> to increase frequency by 1 kHz.<br/> + <b>Left-click</b> to decrease frequency by 1 kHz.<br/> + The mouse pointer must be over the Dial Frequency indicator. + </td> + </tr> + <tr> + <td align="right">H Button:</td> + <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to activate or deactivate SuperFox mode. + </td> + </tr> + <tr> + <td align="right">FT8 Button:</td> + <td><b>Click</b> to switch to FT8 Hound Mode.<br/> + <b>Right-click</b> to toggle last used Special Operating Activity On/Off. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> + <tr> + <td align="right">Tx5 Button:</td> + <td><b>Right-click</b> to retain Tx5 free text. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Right-click</b> to freeze the state of the checkbox.<br/> + <b>Right-click on the FT8 Button</b> to unfreeze. + </td> + </tr> + <tr> + <td align="right">Enable Tx Button:</td> + <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> + <b>Right-click</b> to toggle Wait & Pounce On/Off. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> + If <b>Alternate Erase button behavior</b> is checked:<br/> + <b>Click</b> to erase Band Activity window.<br/> + <b>Right-click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">DX Call Button:</td> + <td><b>Click</b> to toggle Wait & Call On/Off.<br/> + <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. + </td> + </tr> + <tr> + <td align="right">Lookup Button:</td> + <td><b>Click</b> to search for callsign in database.<br/> + <b>Right-click</b> to search for Dx Call on qrz.com. + </td> + </tr> + <tr> + <td align="right">Add Button:</td> + <td><b>Click</b> to add callsign and locator to database.<br/> + <b>Right-click</b> to search for Dx Call on hamqth.com. + </td> + </tr> + <tr> + <td align="right">Ignore Button:</td> + <td><b>Click</b> to add callsign to the Ignore List.<br/> + <b>Right-click</b> to search for Dx Call on qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Band Buttons:</td> + <td><b>Click</b> to toggle band / mode default frequencies.<br/> + <b>Right-click</b> to toggle FT8 DXpedition frequencies. + </td> + </tr> +</table> + Mouse commands help window contents + <table cellpadding=5> + <tr> + <th align="right">Hacer clic en</th> + <th align="left">Acción</th> + </tr> + <tr> + <td align="right">Cascada:</td> + <td><b>Clic</b> para establecer la frecuencia RX.<br/> + <b>Clic derecho</b> para establecer la frecuencia TX.<br/> + <b>Doble clic derecho</b> para establecer las frecuencias RX y TX. + </td> + </tr> + <tr> + <td align="right">Texto decodificado:</td> + <td><b>Doble clic</b> para copiar el segundo indicativo a Indicativo DX, el locator a Locator DX, cambiar las frecuencias RX<br/> + y TX a la frecuencia de la señal decodificada y generar mensajes estándar.<br/> + Mantenga pulsado <b>Alt</b> para evitar que TX se habilite al hacer <b>doble clic</b>.<br/> + Si está marcado <b>Hold Tx Freq</b> o el primer indicativo del mensaje es el suyo,<br/> + la frecuencia TX no cambia salvo que mantenga pulsado <b>Ctrl</b>. + </td> + </tr> + <tr> + <td align="right">Frecuencia del dial:</td> + <td><b>Gire la rueda del ratón</b> to change the kHz values, or:<br/> + <b>Clic derecho</b> para aumentar la frecuencia 1 kHz.<br/> + <b>Clic izquierdo</b> para disminuir la frecuencia 1 kHz.<br/> + El puntero del ratón debe estar sobre el indicador de frecuencia del dial. + </td> + </tr> + <tr> + <td align="right">Botón H:</td> + <td><b>Clic</b> para activar/desactivar el modo Hound de FT8.<br/> + <b>Clic derecho</b> para activar o desactivar el modo SuperFox. + </td> + </tr> + <tr> + <td align="right">Botón FT8:</td> + <td><b>Clic</b> para cambiar al modo Hound de FT8.<br/> + <b>Clic derecho</b> para activar/desactivar la última Actividad operativa especial utilizada. + </td> + </tr> + <tr> + <td align="right">Botón Q65:</td> + <td><b>Clic</b> para cambiar al modo Q65.<br/> + <b>Clic derecho</b> para cambiar al modo Q65 Pileup. + </td> + </tr> + <tr> + <td align="right">Botón JT65:</td> + <td><b>Clic</b> para cambiar al modo JT65.<br/> + <b>Clic derecho</b> para cambiar al modo JT9. + </td> + </tr> + <tr> + <td align="right">Botón Tx5:</td> + <td><b>Clic derecho</b> para conservar el texto libre de Tx5. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Clic derecho</b> para bloquear el estado de la casilla.<br/> + <b>Right-click on the FT8 Button</b> para desbloquearla. + </td> + </tr> + <tr> + <td align="right">Botón Habilitar TX:</td> + <td><b>Clic</b> para activar/desactivar el modo Auto-TX.<br/> + <b>Clic derecho</b> para activar/desactivar Wait & Pounce. + </td> + </tr> + <tr> + <td align="right">Botón Borrar:</td> + <td><b>Clic</b> para borrar la ventana Frecuencia RX.<br/> + <b>Doble clic</b> para borrar las ventanas Frecuencia RX y Actividad de banda.<br/> + Si está marcada la opción <b>Comportamiento alternativo del botón Borrar</b>:<br/> + <b>Clic</b> para borrar la ventana Actividad de banda.<br/> + <b>Clic derecho</b> para borrar la ventana Frecuencia RX.<br/> + <b>Doble clic</b> para borrar las ventanas Frecuencia RX y Actividad de banda. + </td> + </tr> + <tr> + <td align="right">Botón Indicativo DX:</td> + <td><b>Clic</b> para activar/desactivar Wait & Call.<br/> + <b>Clic derecho</b> para borrar Indicativo DX, Locator DX y mensajes estándar. + </td> + </tr> + <tr> + <td align="right">Botón Buscar:</td> + <td><b>Clic</b> para buscar el indicativo en la base de datos.<br/> + <b>Clic derecho</b> para buscar el Indicativo DX en qrz.com. + </td> + </tr> + <tr> + <td align="right">Botón Añadir:</td> + <td><b>Clic</b> para añadir el indicativo y el locator a la base de datos.<br/> + <b>Clic derecho</b> para buscar el Indicativo DX en hamqth.com. + </td> + </tr> + <tr> + <td align="right">Botón Ignorar:</td> + <td><b>Clic</b> para añadir el indicativo a la lista de ignorados.<br/> + <b>Clic derecho</b> para buscar el Indicativo DX en qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Botones de banda:</td> + <td><b>Clic</b> para alternar las frecuencias predeterminadas de banda/modo.<br/> + <b>Clic derecho</b> para alternar las frecuencias de DXpedición FT8. + </td> + </tr> +</table> + + + + Please choose another dial frequency. +Must be 3Khz away from %1. +WSJT-X will not operate in Fox mode +overlapping the standard FT8 sub-bands. + Por favor escoja otra frecuencia. +Debe estar separada 3Khz de %1. +WSJT-X no operará en modo Fox +superponiendo las subbandas de FT8 estándar. + + + + %1 shorthand-message mode + + + + + RR73 is not available in %1. Tx4 uses RRR in this mode. + + + + + Wait & Pounce requires a CQ response mode. +Change CQ: None to another option. + + + + + DX call + + + + + Callsign of station to be worked. + + + + + DX grid + + + + + Locator of station to be worked. + + + + + Wait and Call + + + + + Lookup DX call + + + + + Add DX call + + + + + Ignore DX call + + + + + CQ response mode + + + + + Selects a station automatically from replies to your pending CQ after Enable Tx is armed in the current receive period, or from CQ messages for Wait & Pounce. + + + + + Transmit audio frequency + + + + + Receive audio frequency + + + + + Signal report + + + + + Operating band + + + + + Operating band text + + + + + Transmit power attenuation + + + + + Adjust Tx audio level attenuation. + + + + + Show or hide the menu bar. + + + + + Rig control status + + + + + Hound mode + + + + + Toggle FT8 hound mode. Right-click to toggle SuperFox mode. + + + + + Message panel selector + + + + + Switches between standard messages, Fox queue, and band hopping pages. Press 1, 2, or 3 while focused to select a page. + + + + + Standard messages + + + + + Fox queue + + + + + + Band hopping + + + + + Standard messages page + + + + + Fox queue page + + + + + Band hopping page + + + + + Hound queue + + + + + Queued Hound callers available for Fox transmissions. + + + + + Fox transmissions in progress + + + + + Hound callers currently in progress for Fox transmissions. + + + + + Hound queue sort order + + + + + Hound queue list size + + + + + Fox transmission slots + + + + + Fox CQ message + + + + + Reset Fox queues + + + + + Fox free text + + + + + Send Fox free text + + + + + Enable FT8 QRG 1 + + + + + Enable FT8 QRG 2 + + + + + Enable FT8 QRG 3 + + + + + Enable FT8 QRG 4 + + + + + Enable FT8 QRG 5 + + + + + Enable FT8 QRG 6 + + + + + Enable FT8 QRG 7 + + + + + Enable FT8 QRG 8 + + + + + FT8 QRG 1 frequency + + + + + FT8 QRG 2 frequency + + + + + FT8 QRG 3 frequency + + + + + FT8 QRG 4 frequency + + + + + FT8 QRG 5 frequency + + + + + FT8 QRG 6 frequency + + + + + FT8 QRG 7 frequency + + + + + FT8 QRG 8 frequency + + + + + Tx1 message + + + + + Tx2 message + + + + + Tx3 message - - <table cellpadding=5> - <tr> - <th align="right">Click on</th> - <th align="left">Action</th> - </tr> - <tr> - <td align="right">Waterfall:</td> - <td><b>Click</b> to set Rx frequency.<br/> - <b>Right-click</b> to set Tx frequency.<br/> - <b>Double-right-click</b> to set Rx and Tx frequencies. - </td> - </tr> - <tr> - <td align="right">Decoded text:</td> - <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> - and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> - Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> - If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> - own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. - </td> - </tr> - <tr> - <td align="right">Dial Frequency:</td> - <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> - <b>Right-click</b> to increase frequency by 1 kHz.<br/> - <b>Left-click</b> to decrease frequency by 1 kHz.<br/> - The mouse pointer must be over the Dial Frequency indicator. - </td> - </tr> - <tr> - <td align="right">H Button:</td> - <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> - <b>Right-click</b> to activate or deactivate SuperFox mode. - </td> - </tr> - <tr> - <td align="right">FT8 Button:</td> - <td><b>Click</b> to switch to FT8 Hound Mode.<br/> - <b>Right-click</b> to toggle last used Special Operating Activity On/Off. - </td> - </tr> - <tr> - <td align="right">Q65 Button:</td> - <td><b>Click</b> to switch to Q65 Mode.<br/> - <b>Right-click</b> to switch to Q65 Pileup Mode. - </td> - </tr> - <tr> - <td align="right">JT65 Button:</td> - <td><b>Click</b> to switch to JT65 Mode.<br/> - <b>Right-click</b> to switch to JT9 Mode. - </td> - </tr> - <tr> - <td align="right">Tx5 Button:</td> - <td><b>Right-click</b> to retain Tx5 free text. - </td> - </tr> - <tr> - <td align="right">Tx Even/1st:</td> - <td><b>Right-click</b> to freeze the state of the checkbox.<br/> - <b>Right-click on the FT8 Button</b> to unfreeze. - </td> - </tr> - <tr> - <td align="right">Enable Tx Button:</td> - <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> - <b>Right-click</b> to toggle Wait & Pounce On/Off. - </td> - </tr> - <tr> - <td align="right">Erase button:</td> - <td><b>Click</b> to erase Rx Frequency window.<br/> - <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> - If <b>Alternate Erase button behavior</b> is checked:<br/> - <b>Click</b> to erase Band Activity window.<br/> - <b>Right-click</b> to erase Rx Frequency window.<br/> - <b>Double-click</b> to erase Rx Frequency and Band Activity windows. - </td> - </tr> - <tr> - <td align="right">DX Call Button:</td> - <td><b>Click</b> to toggle Wait & Call On/Off.<br/> - <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. - </td> - </tr> - <tr> - <td align="right">Lookup Button:</td> - <td><b>Click</b> to search for callsign in database.<br/> - <b>Right-click</b> to search for Dx Call on qrz.com. - </td> - </tr> - <tr> - <td align="right">Add Button:</td> - <td><b>Click</b> to add callsign and locator to database.<br/> - <b>Right-click</b> to search for Dx Call on hamqth.com. - </td> - </tr> - <tr> - <td align="right">Ignore Button:</td> - <td><b>Click</b> to add callsign to the Ignore List.<br/> - <b>Right-click</b> to search for Dx Call on qrzcq.com. - </td> - </tr> - <tr> - <td align="right">Band Buttons:</td> - <td><b>Click</b> to toggle band / mode default frequencies.<br/> - <b>Right-click</b> to toggle FT8 DXpedition frequencies. - </td> - </tr> -</table> - Mouse commands help window contents + + Tx4 message - - Please choose another dial frequency. -Must be 3Khz away from %1. -WSJT-X will not operate in Fox mode -overlapping the standard FT8 sub-bands. + + Tx5 message macro + + + + + Tx6 message + + + + + Tx5 message macro text + + + + + Select Tx1 for next transmission + + + + + Select Tx2 for next transmission + + + + + Select Tx3 for next transmission + + + + + Select Tx4 for next transmission + + + + + Select Tx5 for next transmission + + + + + Select Tx6 for next transmission + + + + + Transmit Tx1 now + + + + + Transmit Tx2 now + + + + + Transmit Tx3 now + + + + + Transmit Tx4 now + + + + + Transmit Tx5 now + + + + + Transmit Tx6 now + + + + + All Decodes + + + + + QSO Frequency - + %1 W %1 W - + SWR > 2.5 !!! Transmission was stopped @@ -6326,59 +7928,132 @@ Transmisión detenida Chequee su antena - + + + Stop transmitting or tuning before changing the dial frequency. + + + + + + Measuring reference spectrum: %1 s remaining + + + + + Reference spectrum measurement stopped; Ref Spec is available + + + + + Reference spectrum saved; Ref Spec is available + + + + + Reference spectrum measurement stopped; no reference spectrum is available + + + + + Cannot remove "%1": %2 + + + + WD:0m WD:0m - + Runaway Tx watchdog - + Temporizador de seguridad de TX continuo - + WD:%1m WD:%1m - - + + + Free Text Message Mensaje texto libre - - + + Message: Mensaje: - + Directional calls not yet supported in SuperFox mode - + Las llamadas direccionales aún no está soportadas en el modo SuperFox - + TOTP: No seed entered in fox configuration to generate verification code. + TOTP: No se ingresó ninguna clave en la configuración de Fox para generar el código de verificación. + + + + SuperFox cannot queue %1: unsupported callsign. - + TOTP SF: seed not long enough. + TOTP SF: la clave no es lo suficientemente larga + + + + SuperFox Tx stopped: invalid message tokens. + + + + + SuperFox Tx stopped: invalid verification code. - + + SuperFox Tx stopped: invalid CQ call or grid. + + + + + SuperFox Tx stopped: invalid callsign. + + + + + SuperFox Tx stopped: report is outside the SuperFox range. + + + + + SuperFox Tx stopped: free text contains unsupported characters. + + + + + SuperFox Tx stopped: message could not be packed. + + + + Are you sure you want to erase the Tx Log? Está seguro de que quiere borrar el log de TX? - + "%1" added to Ignore List "%1" añadido a la lista de ignorados - + Are you sure you want to erase the Ignore List? Está seguro que quiere borrar la lista de ignorados? @@ -6394,35 +8069,28 @@ Chequee su antena If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: "The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, ISCAT, MSK144 are Copyright (C) 2001-2021 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; and other members of the WSJT Development Group." - Si haces un uso justo de cualquier parte de WSJT-X bajo los términos de la Licencia Pública General de GNU, debes mostrar el siguiente aviso de copyright de manera destacada en tú trabajo derivado: - -"Los algoritmos, el código fuente, la apariencia de WSJT-X y los programas relacionados, y las especificaciones del protocolo para los modos FSK441, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, ISCAT, MSK144 son Copyright (C) 2001-2021 por uno o más de los siguientes autores: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q y otros miembros del Grupo de Desarrollo WSJT ". Si haces un uso justo de cualquier parte de WSJT-X bajo los términos de la Licencia Pública General de GNU, debes mostrar el siguiente aviso de derechos de autor (copyright) de manera destacada en tu trabajo derivado: "Los algoritmos, el código fuente, la apariencia y comportamiento del WSJT-X y los programas relacionados, y las especificaciones del protocolo para los modos FSK441, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, ISCAT, MSK144 son Copyright (C) 2001-2021 por uno o más de los siguientes autores: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q y otros miembros del Grupo de Desarrollo WSJT ". - + No data read from disk. Wrong file format? - No se leen datos del disco. Formato de archivo incorrecto? No se han leido datos del disco. Formato de archivo incorrecto? - + Confirm Delete - Confirmar eliminación Confirmar borrado - + Are you sure you want to delete all *.wav and *.c2 files in "%1"? - ¿Estas seguro de que deseas eliminar todos los archivos *.wav y *.c2 en "%1"? ¿Esta seguro de que desea borrar todos los archivos *.wav y *.c2 en "%1"? - + Keyboard Shortcuts - Atajo de teclado Atajos de teclado @@ -6612,9 +8280,8 @@ Chequee su antena </table> - + Special Mouse Commands - Comandos especiales del ratón Comandos especiales de ratón @@ -6682,55 +8349,169 @@ Chequee su antena </table> - - No more files to open. - No hay más archivos para abrir. + + No more files to open. + No hay más archivos para abrir. + + + Spotting to PSK Reporter unavailable + "Spotting" a PSK Reporter no disponible + + + + Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. + Elije otra frecuencia de transmisión. WSJT-X no transmitirá a sabiendas otro modo en la sub-banda WSPR en 30M. + + + + WSPR Guard Band + WSPR protección de banda + + + Please choose another dial frequency. WSJT-X will not operate in Fox mode in the standard FT8 sub-bands. + Por favor elija otra frecuencia. WSJT-X no operá en modo "Fox" en las sub-bandas de FT8 estándar. + + + + Fox Mode warning + Advertencia de modo "Fox" + + + + Please choose another dial frequency. +WSJT-X will not operate in Fox mode +overlapping the WSPR sub-bands. + Por favor escoja otra frecuencia. +WSJT-X no operará en modo Fox +superponiendo las subbandas WSPR. + + + + The decoder subprocess could not be stopped. + + + + + The decoder subprocess could not be restarted. + + + + + Application status + + + + + Current WSJT-X status messages and operating indicators. + + + + + Transmit status + + + + + Decode count + + + + + Last transmitted message + + + + + Power and SWR status + - - - Spotting to PSK Reporter unavailable - "Spotting" a PSK Reporter no disponible + + Decode progress + - - Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. - Por favor, elije otra frecuencia de transmisión. WSJT-X no transmitirá a sabiendas otro modo en la sub-banda WSPR en 30m. - Elije otra frecuencia de transmisión. WSJT-X no transmitirá a sabiendas otro modo en la sub-banda WSPR en 30M. + + Progress for the current decode operation. + - - WSPR Guard Band - Banda de Guardia WSPR - WSPR protección de banda + + Transmit watchdog + - Please choose another dial frequency. WSJT-X will not operate in Fox mode in the standard FT8 sub-bands. - Elige otra frecuencia de dial. WSJT-X no funcionará en modo Fox en las sub-bandas FT8 estándar. - Por favor elija otra frecuencia. WSJT-X no operá en modo "Fox" en las sub-bandas de FT8 estándar. + + The selected transmit message cannot be encoded. Enable Tx has been turned off. Edit the selected message or check station settings before trying again. + - - - Fox Mode warning - Advertencia del modo Fox - Advertencia de modo "Fox" + + Tx message cannot be encoded; Enable Tx is off + - - Please choose another dial frequency. -WSJT-X will not operate in Fox mode -overlapping the WSPR sub-bands. + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2026 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; Roger Rehr, W3SZ; John Nelson, G4KLA; Charlie Suckling, DL3WDG; Terrell Deppe, KJ5HST; and other members of the WSJT Development Group." + + + + + EME Chart + + + + + Select Year + + + + + FT8 input completion was rejected: automated=%1 awaiting=%2 frames=%3. - + + Unable to flush the final FT8 downsampling block. + + + + + FT8 input completed with %1 of %2 samples in the decode buffer. + + + + + FT8 decoding is running behind; early passes are temporarily reduced. + + + + + FT8 decoding caught up; configured early passes restored. + + + + + + PSK Reporter spot queue full; oldest spot dropped + + + + Last Tx: %1 - Última TX: %1 Últ TX: %1 - + + A QSO between two stations with nonstandard callsigns won't work. + +Auto Seq would get stuck in an endless loop. + + + + This station transmits in the same time slot as you do. You must not start a QSO if both stations Tx even/1st @@ -6738,179 +8519,175 @@ or Tx odd/2nd, while the Tx even/1st checkbox is disabled. Click the MSK144 mode button to re-enable the Tx even/1st checkbox, or choose another station. - + Esta estación transmite en el mismo intervalo de tiempo que usted. + +No debe iniciar un QSO si ambas estaciones transmiten en par/1.º +o ambas en impar/2.º mientras la casilla TX par/1.º está deshabilitada. + +Haga clic en el botón de modo MSK144 para volver a habilitar la casilla +TX par/1.º, o elija otra estación. - + Should you switch to EU VHF Contest mode? To do so, check 'Special operating activity' and 'EU VHF Contest' on the Settings | Advanced tab. - ¿Cambiar al modo Concurso VHF EU? - -Para hacerlo, marca 'Actividad operativa especial' y -'Concurso VHF EU' en la Configuración | Lengüeta avanzada. ¿Cambiar al modo Concurso VHF EU? Para hacerlo, marca "Actividad operativa especial" y luego "Concurso VHF EU" en "Archivo" - "Ajustes" - "Avanzado". - + Should you switch to ARRL Field Day mode? ¿Cambiar al modo ARRL Field Day? - + Should you switch to RTTY contest mode? ¿Cambiar al modo de concurso RTTY? - - - - + + + Decoder is starting; decode request skipped. + + + + + + + Add to CALL3.TXT Añadir a CALL3.TXT - + Please enter a valid grid locator - Por favor, introduce un locator/Grid válido Por favor escriba un locator válido - + Cannot open "%1" for read/write: %2 - No se puede abrir "%1" para leer/escribir: %2 No se puede abrir "%1" para lectura/escritura: %2 - + %1 is already in CALL3.TXT, do you wish to replace it? - %1 -ya está en CALL3.TXT, ¿deseas reemplazarlo? %1 ya está en CALL3.TXT, ¿desea reemplazarlo? - + Warning: DX Call field is empty. - Advertencia: el campo de Indicativo DX está vacío. Advertencia: El campo "Indicativo DX" está vacío. - + + SuperFox free text may only contain spaces, digits, uppercase letters, and + - . / ?. + + + + Log file error - Error de archivo de log Error en el archivo de log - + Cannot open "%1" - No puedo abrir "%1" No se puede abrir "%1" - + Error sending log to N1MM Error al enviar el log a N1MM - + Write returned "%1" - Escritura devuelta "%1" Escritura devuelve "%1" - + Stations calling DXpedition %1 - Estaciones que llaman a DXpedition %1 Estaciones llamando a DXpedition %1 - + Show Already Worked Mostrar ya trabajados - + Super Fox Súper Fox - + Super Hound Super Hound - + Hound - Hound "Hound" - + Tx Messages - Mensajes de TX Mensajes TX - - - - - - + + + + + + Confirm Erase Confirmar borrado - + Are you sure you want to erase file ALL.TXT? ¿Estás seguro de que quiere borrar el archivo ALL.TXT? - + Are you sure you want to erase the list of Q65 callers? - Está seguro que quiere borrar la lsita de estacione que llaman en Q65? + Está seguro que quiere borrar la lsita de estaciones que llaman en Q65? - - + + Confirm Reset - Confirmar reinicio Confirmar borrado - + Are you sure you want to erase your contest log? - ¿Estás seguro de que quieres borrar el log de tú concurso? ¿Está seguro que quiere borrar el log de concurso? - + Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. - Hacer esto eliminará todos los registros de QSO para el concurso actual. Se guardarán en el archivo log de ADIF, pero no estarán disponibles para la exportación en tú log de Cabrillo. Hacer esto eliminará todos los QSOs del concurso actual. Se mantendrán en el log ADIF, pero no estarán disponibles para la exportación como log de Cabrillo. - + Cabrillo Log saved - Cabrillo Log guardado Log Cabrillo guardado - + Are you sure you want to erase file wsjtx_log.adi? - ¿Estás seguro de que quieres borrar el archivo wsjtx_log.adi? ¿Está seguro que quiere borrar el archivo wsjtx_log.adi? - + Are you sure you want to erase the WSPR hashtable? - ¿Estás seguro de que quieres borrar la tabla WSPR? ¿Está seguro de que quiere borrar la tabla hash WSPR? @@ -6918,50 +8695,46 @@ ya está en CALL3.TXT, ¿desea reemplazarlo? Advertencia de características VHF - + Tune digital gain - Ganancia de sintonización digital Ajustar ganancia digital - + Transmit digital gain - Ganancia de transmisión digital Transmitir ganancia digital - + Prefixes - Prefijos Prefijos y sufijos tipo 1 - + Network Error Error de red - + Error: %1 UDP server %2:%3 Error: %1 Servidor UDP %2:%3 - + + File Error Error en el archivo - + Phase Training Disabled - Fase de entrenamiento deshabilitado Entrenamieno de Fase deshabilitado - + Phase Training Enabled - Fase de entrenamiento habilitado Entrenamiento de Fase habilitado @@ -6969,18 +8742,223 @@ Servidor UDP %2:%3 WD:%1m - - + + Log File Error - Error de archivo log Error en archivo log - + Are you sure you want to clear the QSO queues? - ¿Estás seguro de que quieres borrar las colas QSO? ¿Está seguro que quiere borrar las colas de QSOs? + + + Band hopping has no selected frequencies. + + + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: cycle CQ response mode)</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Cycle CQ response mode</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Ctrl+X </b></td><td>Open next file in directory</td></tr> + <tr><td><b>Alt+x </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> + +</table> + + + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Right-click</b> to set Tx frequency.<br/> + <b>Double-right-click</b> to set Rx and Tx frequencies. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> + and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> + Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> + own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">Dial Frequency:</td> + <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> + <b>Right-click</b> to increase frequency by 1 kHz.<br/> + <b>Left-click</b> to decrease frequency by 1 kHz.<br/> + The mouse pointer must be over the Dial Frequency indicator. + </td> + </tr> + <tr> + <td align="right">H Button:</td> + <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to activate or deactivate SuperFox mode. + </td> + </tr> + <tr> + <td align="right">FT8 Button:</td> + <td><b>Click</b> to switch to FT8 Hound Mode.<br/> + <b>Right-click</b> to toggle last used Special Operating Activity On/Off. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> + <tr> + <td align="right">Tx5 Button:</td> + <td><b>Right-click</b> to retain Tx5 free text. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Right-click</b> to freeze the state of the checkbox.<br/> + <b>Right-click on the FT8 Button</b> to unfreeze. + </td> + </tr> + <tr> + <td align="right">Enable Tx Button:</td> + <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> + <b>Right-click</b> to toggle Wait & Pounce On/Off after selecting<br/> + any CQ response mode other than CQ: None. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> + If <b>Alternate Erase button behavior</b> is checked:<br/> + <b>Click</b> to erase Band Activity window.<br/> + <b>Right-click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">DX Call Button:</td> + <td><b>Click</b> to toggle Wait & Call On/Off.<br/> + <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. + </td> + </tr> + <tr> + <td align="right">Lookup Button:</td> + <td><b>Click</b> to search for callsign in database.<br/> + <b>Right-click</b> to search for Dx Call on qrz.com. + </td> + </tr> + <tr> + <td align="right">Add Button:</td> + <td><b>Click</b> to add callsign and locator to database.<br/> + <b>Right-click</b> to search for Dx Call on hamqth.com. + </td> + </tr> + <tr> + <td align="right">Ignore Button:</td> + <td><b>Click</b> to add callsign to the Ignore List.<br/> + <b>Right-click</b> to search for Dx Call on qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Band Buttons:</td> + <td><b>Click</b> to toggle band / mode default frequencies.<br/> + <b>Right-click</b> to toggle FT8 DXpedition frequencies. + </td> + </tr> +</table> + + + + + Type 1 Prefixes: + + 1A 1S 3A 3B6 3B8 3B9 3C 3C0 3D2 3D2C 3D2R 3DA 3V 3W 3X + 3Y 3YB 3YP 4J 4L 4S 4U1I 4U1U 4W 4X 5A 5B 5H 5N 5R + 5T 5U 5V 5W 5X 5Z 6W 6Y 7O 7P 7Q 7X 8P 8Q 8R + 9A 9G 9H 9J 9K 9L 9M2 9M6 9N 9Q 9U 9V 9X 9Y A2 + A3 A4 A5 A6 A7 A9 AP BS7 BV BV9 BY C2 C3 C5 C6 + C9 CE CE0X CE0Y CE0Z CE9 CM CN CP CT CT3 CU CX CY0 CY9 + D2 D4 D6 DL DU E3 E4 EA EA6 EA8 EA9 EI EK EL EP + ER ES ET EU EX EY EZ F FG FH FJ FK FKC FM FO + FOA FOC FOM FP FR FRG FRJ FRT FT5W FT5X FT5Z FW FY M MD + MI MJ MM MU MW H4 H40 HA HB HB0 HC HC8 HH HI HK + HK0A HK0M HL HM HP HR HS HV HZ I IS IS0 J2 J3 J5 + J6 J7 J8 JA JDM JDO JT JW JX JY K KG4 KH0 KH1 KH2 + KH3 KH4 KH5 KH5K KH6 KH7 KH8 KH9 KL KP1 KP2 KP4 KP5 LA LU + LX LY LZ OA OD OE OH OH0 OJ0 OK OM ON OX OY OZ + P2 P4 PA PJ2 PJ7 PY PY0F PT0S PY0T PZ R1F R1M S0 S2 S5 + S7 S9 SM SP ST SU SV SVA SV5 SV9 T2 T30 T31 T32 T33 + T5 T7 T8 T9 TA TF TG TI TI9 TJ TK TL TN TR TT + TU TY TZ UA UA2 UA9 UK UN UR V2 V3 V4 V5 V6 V7 + V8 VE VK VK0H VK0M VK9C VK9L VK9M VK9N VK9W VK9X VP2E VP2M VP2V VP5 + VP6 VP6D VP8 VP8G VP8H VP8O VP8S VP9 VQ9 VR VU VU4 VU7 XE XF4 + XT XU XW XX9 XZ YA YB YI YJ YK YL YN YO YS YU + YV YV0 Z2 Z3 ZA ZB ZC4 ZD7 ZD8 ZD9 ZF ZK1N ZK1S ZK2 ZK3 + ZL ZL7 ZL8 ZL9 ZP ZS ZS8 KC4 E5 + +Type 1 Suffixes: /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /P + + MessageAveraging @@ -6993,15 +8971,14 @@ Servidor UDP %2:%3 UTC Sync DT Freq - UTC Sync DH Freq UTC Sync DT Freq Modes - - + + Mode Modo @@ -7009,7 +8986,7 @@ Servidor UDP %2:%3 MultiSettings - + Default Por defecto @@ -7017,93 +8994,81 @@ Servidor UDP %2:%3 MultiSettings::impl - + &Switch To &Cambiar a - + &Clone - &Clon &Clonar - + Clone &Into ... - Clon &a ... &Clonar a ... - + R&eset &Reiniciar - + &Rename ... &Renombrar ... - + &Delete - &Borrar &Borrar - + Clone Into Configuration - Clonar a la configuración Clonar a la Configuración - + Confirm overwrite of all values for configuration "%1" with values from "%2"? - ¿Confirmas la sobrescritura de todos los valores para la configuración "%1" con valores de "%2"? ¿Confirmar la sobrescritura de todos los valores para la configuración "%1" con los valores de "%2"? - + Reset Configuration - Restablecer configuración/ajuste Restablecer configuración - + Confirm reset to default values for configuration "%1"? - ¿Quieres restablecer a los valores predeterminados para la configuración "%1"? ¿Confirmar restablecer a los valores predeterminados para la configuración "%1"? - + Delete Configuration - Eliminar configuración/ajuste Borrar Configuración - + Confirm deletion of configuration "%1"? - ¿quieres eliminar la configuración "%1"? ¿Confirmar borrado de la configuración "%1"? NameDialog - + New Configuration Name - Nuevo nombre de configuración/ajuste Nuevo nombre de la configuración - + Old name: - Nombre Anterior: Nombre anterior: - + &New name: - Nuevo &Nombre: &Nuevo nombre: @@ -7125,21 +9090,19 @@ Servidor UDP %2:%3 Failed to start OmniRig COM server - Error al iniciar el servidor COM para OmniRig Error al iniciar servidor COM de OmniRig - + OmniRig: don't know how to set rig frequency OmniRig: no sé cómo configurar la frecuencia del equipo OmniRig: timeout waiting for update from rig - OmniRig: el tiempo de espera finalizó en la actualización del equipo OmniRig: el tiempo de espera agotado esperando la actualización del equipo - + OmniRig COM/OLE error: %1 at %2: %3 (%4) Error de OmniRig COM/OLE: %1 a %2: %3 (%4 @@ -7156,7 +9119,6 @@ Servidor UDP %2:%3 QObject Invalid rig name - \ & / not allowed - Nombre del equipo inválido - \ & / No permitido Nombre del equipo no válido - \ y / no permitidos @@ -7166,7 +9128,6 @@ Servidor UDP %2:%3 Failed to open LotW users CSV file: '%1' - Error al abrir el archivo CSV de los usuarios de LotW: '%1' Error al abrir archivo CSV de usuarios del LoTW: '%1' @@ -7175,39 +9136,33 @@ Servidor UDP %2:%3 OOB - + Too many colours in palette. Demasiados colores en la paleta. - + Error reading waterfall palette file "%1:%2" too many colors. - Error al leer el archivo de paleta en cascada "%1:%2" demasiados colores. Error al leer el archivo de paleta de la cascada (waterfall) "%1:%2" demasiados colores. - + Error reading waterfall palette file "%1:%2" invalid triplet. - Error al leer el archivo de paleta en cascada "%1:%2" triplete inválido. Error al leer el archivo de paleta de la cascada (waterfall) "%1:%2" triplete inválido. - + Error reading waterfall palette file "%1:%2" invalid color. - Error al leer el archivo de paleta en cascada "%1:%2" color inválido. Error al leer el archivo de paleta de la cascada (waterfall) "%1:%2" color inválido. - + Error opening waterfall palette file "%1": %2. - Error al abrir el archivo de paleta en cascada "%1": %2. Error al abrir el archivo de paleta de la cascada (waterfall) "%1": %2. - Error writing waterfall palette file "%1": %2. - Error al escribir el archivo de paleta en cascada "%1": %2. - Error al escribir el archivo de paleta de la cascada (waterfall) "%1": %2. + Error al escribir el archivo de paleta de la cascada (waterfall) "%1": %2. @@ -7426,7 +9381,7 @@ Mensaje 432 MHz - + 432 MHz @@ -7611,9 +9566,9 @@ Mensaje Enviar mensaje - + MessageCreator - MessageCreator + Creador de mensajes @@ -7629,7 +9584,7 @@ Mensaje Borrar - + QSY Monitor Monitor QSY @@ -7701,8 +9656,6 @@ Error(%2): %3 Cannot make path: "%1" - No se puede hacer camino: -"%1" No se puede hacer la ruta: "%1" @@ -7711,9 +9664,6 @@ Error(%2): %3 Cannot write to file: "%1" Error(%2): %3 - No se puede escribir en el archivo: -"%1" -Error(%2): %3 No se puede escribir al archivo: "%1" Error(%2): %3 @@ -7765,21 +9715,19 @@ Error(%2): %3 Invalid URL format - Formato de URL no válido Formato de enlace no válido SoundInput - + An error opening the audio input device has occurred. Se produjo un error al abrir el dispositivo de entrada de audio. - + An error occurred during read from the audio input device. - Se produjo un error durante la lectura desde el dispositivo de entrada de audio. Se produjo un error durante la lectura del dispositivo de entrada de audio. @@ -7787,54 +9735,52 @@ Error(%2): %3 Los datos de audio no se envían al dispositivo de entrada de audio lo suficientemente rápido. - + Non-recoverable error, audio input device not usable at this time. - Error no recuperable, el dispositivo de entrada de audio no se puede utilizar en este momento. Error no recuperable, dispositivo de entrada de audio no disponible en este momento. - + Requested input audio format is not valid. El formato de audio de entrada solicitado no es válido. - + Requested input audio format is not supported on device. - El formato de audio de entrada solicitado no es compatible con el dispositivo. El formato de audio de entrada solicitado no está soportado en el dispositivo. - + Failed to initialize audio sink device Error al inicializar el dispositivo receptor de audio - + Idle Inactivo - + Receiving Recibiendo - + Suspended Suspendido - + Interrupted Interrumpido - + Error Error - + Stopped Detenido @@ -7842,91 +9788,114 @@ Error(%2): %3 SoundOutput - + An error opening the audio output device has occurred. Se produjo un error al abrir el dispositivo de salida de audio. - + An error occurred during write to the audio output device. Se produjo un error durante la escritura en el dispositivo de salida de audio. - + Audio data not being fed to the audio output device fast enough. Los datos de audio no se envían al dispositivo de salida de audio lo suficientemente rápido. - + Non-recoverable error, audio output device not usable at this time. Error no recuperable, dispositivo de salida de audio no utilizable en este momento. - + Requested output audio format is not valid. El formato de audio de salida solicitado no es válido. - + Requested output audio format is not supported on device. El formato de audio de salida solicitado no es compatible con el dispositivo. - + + Audio output restart attempt failed. + + + + + No audio output device configured. No hay dispositivo de salida de audio configurado. - + + No audio output stream is active. + + + + Idle Inactivo - + Sending Recibiendo - + Suspended Suspendido - + Interrupted Interrumpido - - Error - Error + + Error + Error + + + + Stopped + Detenido + + + + SplashScreen + + + WSJT-X — Welcome + - - Stopped - Detenido + + WSJT-X startup information. Press Escape to close. + StationDialog - + Add Station Agregar estación - + &Band: &Banda: - + &Offset (MHz): - &Desplazamiento en MHz: Desplazamient&o (MHz): - + &Antenna: &Antena: @@ -7941,7 +9910,6 @@ Error(%2): %3 Frequency offset - Frecuencia de desplazamiento Desplazamiento de la frecuencia @@ -7968,184 +9936,206 @@ Error(%2): %3 TCITransceiver - + ConnectionRefused ConnectionRefused - + RemoteHostClosed RemoteHostClosed - + HostNotFound HostNotFound - + SocketAccess SocketAccess - + SocketResource SocketResource - + SocketTimeout SocketTimeout - + DatagramTooLarge DatagramTooLarge - + Network Network - + AddressInUse AddressInUse - + SocketAddressNotAvailable SocketAddressNotAvailable - + UnsupportedSocketOperation UnsupportedSocketOperation - + UnfinishedSocketOperation UnfinishedSocketOperation - + ProxyAuthenticationRequired ProxyAuthenticationRequired - + SslHandshakeFailed SslHandshakeFailed - + ProxyConnectionRefused ProxyConnectionRefused - + ProxyConnectionClosed ProxyConnectionClosed - + ProxyConnectionTimeout ProxyConnectionTimeout - + ProxyNotFound ProxyNotFound - + ProxyProtocol ProxyProtocol - + Operation Operation - + SslInternal SslInternal - + SslInvalidUserData SslInvalidUserData - + Temporary Temporal - + UnknownSocket UnknownSocket - + + UnknownSocketError + + + + TCI websocket error: %1 TCI websocket error: %1 - + TCI SDR could not be switched on No se pudo activar TCI SDR - + TCI SDR is not switched on TCI SDR no está encendido - + TCI RX2 could not be enabled TCI RX2 no puede ser activado - + TCI Audio could not be switched on Audio TCI no puede ser encendido - - + + TCI could not be opened TCI no puede ser abierto - - + + + + TCI sent an invalid VFO frequency + + + + + TCI failed to set ptt TCI ha fallado al ajustra PTT - + TCI should use PTT via CAT TCi debe usar PTT vía CAT - - + + TCI failed set rxfreq TCI ha fallado al ajustar rxfreq - - + + TCI failed set mode TCI ha fallado al configurar modo - + TCI modulator not Idle Modulador TCI no activo + + + TCI source commitment; playout evidence is protocol-send dead reckoning, not DAC confirmation + + + + + TCI WebSocket send progress; no radio DAC or RF playback confirmation + + TransceiverBase @@ -8167,7 +10157,7 @@ Error(%2): %3 Controles - + Spectrum gain Ganancia del espectro @@ -8176,192 +10166,193 @@ Error(%2): %3 Paleta - + <html><head/><body><p>Enter definition for a new color palette.</p></body></html> <html><head/><body><p>Introduce la definición para una nueva paleta de colores.</p></body></html> - + Adjust... Ajustar... - + Total power (dB) Potebcia total (dB) - + Waterfall gain - Ganancia de la cascada Ganancia de la cascada (waterfall) - + <html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html> - <html><head/><body><p>Establece el tamaño fraccional del espectro en esta ventana.</p></body></html> <html><head/><body><p>Establece el tamaño porcentual del espectro en esta ventana.</p></body></html> - + % % - + Spec - Espec Espec - + <html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html> - <html><head/><body><p>Acoplar la línea base espectral sobre el intervalo visualizado completo.</p></body></html> <html><head/><body><p>Línea base del espectro sobre el intervalo visualizado completo.</p></body></html> - + Flatten Flatten - <html><head/><body><p>Compute and save a reference spectrum. (Not yet fully implemented.)</p></body></html> - <html><head/><body><p>Calcula y guarda un espectro de referencia. (Todavía no está completamente implementado).</p></body></html> + <html><head/><body><p>Calcula y guarda un espectro de referencia. (Todavía no está completamente implementado).</p></body></html> - + Ref Spec Ref Espec - + Smoothing of Linear Average spectrum Suavizado del espectro promedio lineal - + Smooth Suave - + Compression factor for frequency scale Factor de compresión para escala de frecuencia - + + <html><head/><body><p>Controls</p></body></html> + + + + Bins/Pixel Bins/Pixel - - + + <html><head/><body><p>Position of time stamp above each interval line</p></body></html> <html><head/><body><p>Posición de la fecha/hora sobre cada línea de intervalo</p></body></html> - + Time stamp Fecha/hora - - + + Off Apagado - + Left Izquierdo - + Right Derecho - + Palette Paleta - + Select waterfall palette - Seleccionar Paleta de la cascasa Seleccionar paleta de la cascasa (waterfall) - + Bars Barras - + Freq Frec - + + <html><head/><body><p>Apply a saved reference spectrum to flatten the received passband. Available after a reference spectrum has been measured. (Not yet fully implemented.)</p></body></html> + + + + <html><head/><body><p>Select data for spectral display</p></body></html> <html><head/><body><p>Seleccionar datos para visualización espectral</p></body></html> - + Current Actual - + Cumulative Acumulativo - + Linear Avg - Promedio lineal Linear Avg - + Reference Referencia - + Q65_Sync Q65_Sync - + <html><head/><body><p>Frequency at left edge of waterfall</p></body></html> - <html><head/><body><p>Frecuencia en el borde izquierdo de la cascada.</p></body></html> <html><head/><body><p>Frecuencia en el borde izquierdo de la cascada (waterfall)</p></body></html> - + Hz Hz - + Start - Empezar Inicio - + <html><head/><body><p>Decode JT9 only above this frequency</p></body></html> <html><head/><body><p>Decodifica JT9 solo por encima de esta frecuencia</p></body></html> - + Hz Hz - + Split "Split" @@ -8374,42 +10365,38 @@ Error(%2): %3 JT65 - + Number of FFTs averaged (controls waterfall scrolling rate) - Número promedio de FFT (controla la velocidad de desplazamiento en la cascada) Número de FFTs promediados (controla la velocidad de desplazamiento en la cascada - waterfall) - + N Avg - Promedio N N Avg - + Waterfall zero - Cascada cero Cascada (waterfall) cero - + Spectrum zero Espectro cero - + User Defined Definido por el usuario - + Wide Graph - Gráfico amplio Cascada - Waterfall - - + + Read Palette Leer Paleta @@ -8417,22 +10404,22 @@ Error(%2): %3 WorkedBefore - + Invalid ADIF field %0: %1 Campo ADIF no válido %0: %1 - + Malformed ADIF field %0: %1 Campo ADIF malformado %0: %1 - + Invalid ADIF header Cabecera ADIF no valida - + Error opening ADIF log file for read: %0 Error abriendo log ADIF para lectura: %0 @@ -8442,7 +10429,6 @@ Error(%2): %3 Settings - Configuración Ajustes @@ -8453,7 +10439,6 @@ Error(%2): %3 General station details and settings. - Detalles generales de la estación, configuraciones y ajustes. Detalles generales de la estación y ajustes. @@ -8469,111 +10454,95 @@ Error(%2): %3 Station callsign. - Indicativo de la Estación. Indicativo de la estación. M&y Grid: - M&i Locator/Grid: Mi L&ocator: - + <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> - <html><head/><body><p>Locator/Grid tipo Maidenhead, preferiblemente 6 caracteres.</p></body></html> <html><head/><body><p>Locator, preferiblemente 6 caracteres.</p></body></html> Check to allow grid changes from external programs - Marca para permitir cambios de Locator/Grid de programas externos Marca para permitir cambios de locator por programas externos AutoGrid - Locator/Grid automático AutoLocator - + IARU Region: Región IARU: - + <html><head/><body><p>Select your IARU region.</p></body></html> - <html><head/><body><p>Seleccions tú región IARU.</p></body></html> <html><head/><body><p>Selecciona tu región IARU.</p></body></html> - + Message generation for type 2 compound callsign holders: - Generación de mensajes para titulares de indicativos compuestos de tipo 2: Generación mensajes indicativos compuestos tipo 2: - + <html><head/><body><p>Type 2 compound callsigns are those with prefixes or suffixes not included in the allowed shortlist (See Help-&gt;Add-on prefixes and suffixes).</p><p>This option determines which generated messages should contain your full type 2 compound call sign rather than your base callsign. It only applies if you have a type 2 compound callsign.</p><p>This option controls the way the messages that are used to answer CQ calls are generated. Generated messages 6 (CQ) and 5 (73) will always contain your full callsign. The JT65 and JT9 protocols allow for some standard messages with your full call at the expense of another piece of information such as the DX call or your locator.</p><p>Choosing message 1 omits the DX callsign which may be an issue when replying to CQ calls. Choosing message 3 also omits the DX callsign and many versions of this and other software will not extract the report. Choosing neither means that your full callsign only goes in your message 5 (73) so your QSO partner may log the wrong callsign.</p><p>None of these options are perfect, message 3 is usually best but be aware your QSO partner may not log the report you send them.</p></body></html> - <html><head/><body><p>Los indicativos compuestos del tipo 2 son aquellos con prefijos o sufijos no incluidos en la lista previa permitida (Consulta Ayuda, Prefijos y sufijos adicionales). </P><p>Esta opción determina qué mensajes generados deben contener tu indicativo de tipo completo 2 en lugar de tu indicativo base. Sólo se aplica si tienes un indicativo compuesto de tipo 2.</P><p>Esta opción controla la forma en que se generan los mensajes que se utilizan para responder a llamadas de CQ. Los mensajes generados 6 (CQ) y 5 (73) siempre contendrán tu indicativo completo. Los protocolos JT65 y JT9 permiten algunos mensajes estándar con tu indicativo completo a costa de otra información, como la llamada DX o el locator/Grid.</P> <p>La elección del mensaje 1 omite el indicativo de DX , que puede ser un problema cuando se responde a las llamadas de CQ. La elección del mensaje 3 también omite el indicativo de DX y muchas versiones de este software, puede no extraer el informe. Si escoges ninguno, no significa que sólo tu indicativo completo aparezca al mensaje 5 (73) de manera que el otro operador de QSO puede registrar el indicativo erróneo.</P><p> Ninguna de estas opciones es perfecta, el mensaje 3 suele ser el mejor, pero ten en cuenta que el otro operador de QSO puede no registrar el informe que le envías.</p></body></html> <html><head/><body><p>Los indicativos compuestos del tipo 2 son aquellos con prefijos o sufijos no incluidos en la lista previa permitida (Consulta en "Ayuda - Lista de prefijos y sufijos tipo 1). </P><p>Esta opción determina qué mensajes generados deben contener tu indicativo de tipo completo 2 en lugar de tu indicativo base. Sólo se aplica si tienes un indicativo compuesto de tipo 2.</P><p>Esta opción controla la forma en que se generan los mensajes que se utilizan para responder a llamadas de CQ. Los mensajes generados 6 (CQ) y 5 (73) siempre contendrán tu indicativo completo. Los protocolos JT65 y JT9 permiten algunos mensajes estándar con tu indicativo completo a costa de otra información, como la llamada DX o el locator/Grid.</P> <p>La elección del mensaje 1 omite el indicativo de DX , que puede ser un problema cuando se responde a las llamadas de CQ. La elección del mensaje 3 también omite el indicativo de DX y muchas versiones de este software, puede no extraer el informe. Si escoges ninguno, no significa que sólo tu indicativo completo aparezca al mensaje 5 (73) de manera que el otro operador de QSO puede registrar el indicativo erróneo.</P><p> Ninguna de estas opciones es perfecta, el mensaje 3 suele ser el mejor, pero ten en cuenta que el otro operador de QSO puede no registrar el informe que le envías.</p></body></html> - + Full call in Tx1 Indicativo completo en TX1 - + Full call in Tx3 Indicativo completo en TX3 - + Full call in Tx5 only - Indicativo completo solo en TX5 Indicativo completo en TX5 solamente - + Display - Monitor Mostrar - + Show outgoing transmitted messages in the Rx frequency window. - Mostrar mensajes transmitidos salientes en la ventana de frecuencia de RX. Mostrar mensajes transmitidos en la ventana "Frecuencia de RX". - + &Tx messages to Rx frequency window - &Mensajes de texto en la ventana de frecuencia RX Mensajes de &TX en la ventana "Frecuencia de RX" - + Show if decoded stations are new DXCC entities or worked before. - Mostrar si las estaciones decodificadas son entidades DXCC nuevas o las has trabajado antes. Mostrar si las estaciones decodificadas son nuevas entidades DXCC o se ha trabajado antes. Show &DXCC, grid, and worked-before status - Mostrar &DXCC, Locator/Grid y si se ha trabajado antes Mostrar &DXCC, locator y estatus trabajado B4 - + <html><head/><body><p>Check to have decodes for a new period start at the top of the Band Activity window and not scroll off the top when the window is full.</p><p>This is to aid selecting decodes to double-click while decoding is still in progress. Use the Band Activity vertical scroll bar to reveal decodes past the bottom of the window.</p></body></html> - <html><head/><body><p>Comprueba que tengas decodificaciones para comenzar un nuevo período en la parte superior de la ventana de Actividad de banda y no muevas la parte superior cuando la ventana esté llena.</p><p> Esto sirve para ayudar a seleccionar decodificaciones, puedes hacer doble clic mientras la decodificación aún está en curso. Utiliza la barra de desplazamiento vertical de Actividad de banda para ver decodificaciones pasadas en la parte inferior de la ventana.</P></body></html> <html><head/><body><p>Marcar para que las nuevas decodificaciones comiencen en la parte superior de la ventana de "Actividad en la banda" y no se desplacen hacia arriba cuando la ventana esté llena.</p><p> Esto sirve para seleccionar decodificaciones y hacerles doble clic mientras la decodificación aún está en curso. Utiliza la barra de desplazamiento vertical de la ventana "Actividad en la banda" para ver decodificaciones que esten en la parte inferior de la ventana.</P></body></html> - + Start new period decodes at top - Inicia un nuevo periodo de decodificaciones en la parte superior Nuevo periodo de decodificaciones desde la parte superior de la ventana @@ -8581,593 +10550,593 @@ Error(%2): %3 Mostrar el prefijo principal en lugar del nombre del país - + Set the font characteristics for the application. - Define las características de la fuente para la aplicación. Cambia el tipo de letras para la aplicación. - + Font... - Letra... Tipo de letra para la aplicación.. - + Set the font characteristics for the Band Activity and Rx Frequency areas. - Establece las características de la fuente para las áreas de Actividad de banda y Frecuencia de RX. Cambiar el tipo de letras para las ventanas "Actividad en la banda" y "Frecuencia de RX". - + Decoded Text Font... - Tipo de fuente en el área de decodificada ... Tipo de letras decodificados... - + Include a separator line between periods in the band activity window. - Incluye una línea de separación entre períodos en la ventana de actividad de la banda. Incluye una línea de separación entre períodos de decodificación en la ventana "Actividad en la banda". - + &Blank line between decoding periods - &Línea en blanco entre períodos de decodificación Línea de &separación entre períodos de decodificación - + Show distance to DX station in miles rather than kilometers. - Muestra la distancia a la estación DX en millas en lugar de kilómetros. Muestra la distancia a la estación de DX en millas en lugar de kilómetros. - + Display dista&nce in miles Mostrar dista&ncia en millas - + Behavior Comportamiento - + Decode after EME delay - Decodificar después del retardo de EME Decodificar después de retardo EME Tx watchdog: - Seguridad de TX: Temporizador de TX: - + <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> - <html><head/><body><p>Número de minutos antes de que se cancelen las transmisiones desatendidas</p></body></html> <html><head/><body><p>Número de minutos antes que se cancelen las transmisiones desatendidas</p></body></html> - + Disabled Desactivado - + minutes minutos Enable VHF/UHF/Microwave features - Habilita las funciones VHF/UHF/Microondas Habilita características en VHF/UHF/Microondas - + Single decode - Decodificación individual Una sola decodificación - <html><head/><body><p>Some rigs are not able to process CAT commands while transmitting. This means that if you are operating in split mode you may have to uncheck this option.</p></body></html> - <html><head/><body><p>Algunos equipos no pueden procesar comandos CAT mientras transmiten. Esto significa que si estás operando en modo dividido (split) puede que tengas que desmarcar esta opción.</p></body></html> - <html><head/><body><p>Algunos equipos no pueden procesar comandos CAT mientras transmiten. Esto significa que si está operando en modo "split", puede que tenga que desmarcar esta opción.</p></body></html> + <html><head/><body><p>Algunos equipos no pueden procesar comandos CAT mientras transmiten. Esto significa que si está operando en modo "split", puede que tenga que desmarcar esta opción.</p></body></html> - Allow Tx frequency changes while transmitting - Permitir cambios de frecuencia de transmisión mientras se transmite - Permitir cambios de frecuencia TX mientras se transmite + Permitir cambios de frecuencia TX mientras se transmite - + Don't start decoding until the monitor button is clicked. - No empieza a decodificar hasta que hagas clic en el botón de monitor. No se inicia la decodificación hasta se haga clic en el botón "Monitor". - + Mon&itor off at startup "Mon&itor" apagado al inicio - + <html><head/><body><p>Check this if you wish to automatically return to the last monitored frequency when monitor is enabled, leave it unchecked if you wish to have the current rig frequency maintained.</p></body></html> - <html><head/><body><p>Marca esto si deseas volver automáticamente a la última frecuencia monitoreada cuando el monitor está habilitado, déjalo sin marcar si deseas mantener la frecuencia actual del equipo.</p></body></html> <html><head/><body><p>Marcar si desea volver automáticamente a la última frecuencia escuchada cuando el "Monitor" está habilitado, déjar sin marcar si desea mantener la frecuencia actual del equipo.</p></body></html> - + Monitor returns to last used frequency - El monitor vuelve a la última frecuencia utilizada La escucha vuelve a la última frecuencia utilizada - + Alternate F1-F6 bindings Enlaces alternativos F1-F6 - + Turns off automatic transmissions after sending a 73 or any other free text message. - Apaga las transmisiones automáticas después de enviar un 73 o -cualquier otro mensaje de texto libre. Desactiva TX después de enviar un 73 o cualquier mensaje de texto libre. - + Di&sable Tx after sending 73 De&shabilita TX después de enviar un 73 - + Send a CW ID after every 73 or free text message. - Envía una ID de CW después de cada 73 o mensaje de texto libre. Envía una ID en CW después de cada 73 o mensaje de texto libre. - + CW ID a&fter 73 - ID de CW d&espués de 73 &ID en CW después de 73 Periodic CW ID Inter&val: - Inter&valo de ID de CW periódico: Inter&valo de ID en CW: - + Send a CW ID periodically every few minutes. This might be required under your countries licence regulations. It will not interfere with other users as it is always sent in the quiet period when decoding is done. - Envía una identificación de CW periódicamente cada pocos minutos. -Esto puede ser requerido bajo las regulaciones de licencia de tú país. -No interferirá con otros usuarios, ya que siempre se envía en el -período tranquilo cuando se realiza la decodificación. Envía una identificación en CW periódicamente cada pocos minutos. Esto puede ser requerido bajo las regulaciones de licencia de tu país. No interferirá con otros usuarios, ya que siempre se envía en el período de silencio cuando se ha realizado la decodificación. - + Automatic transmission mode. - Modo de transmisión automática. Activa TX cuando se hace doble clic sobre indicativo. - + Show &DXCC, grid, and worked-before status - + Mostrar &DXCC, locator y estado trabajado anteriormente - + Highlight DX Grid in message - + Resaltar Locator DX en el mensaje - + Show DXCC for all messages - + Mostrar DXCC para todos los mensajes - + Show the separator line between periods with time stamp of the decode period. - + Muestra línea separadora entre períodos con fecha/hora del período de decodificado. - + Show blank line with time stamp - + Mostrar línea en blanco con fecha/hora - + Show principal prefix instead of country name - + Mostrar el prefijo principal en lugar del nombre del país - + Highlight DX Call in message - + Resaltar Indicativo DX en el mensaje - + Doubl&e-click on call sets Tx enable - Haz dobl&e clic en los conjuntos de indicativos de habilitación de TX Dobl&e clic en indicativo activa TX - + <html><head/><body><p>Open the Astronomical Data window automatically when switching to Q65 or JT65 mode and Decode after EME delay is enabled, and close it when no longer needed.</p><p>Open the QSYMessage Creator automatically if the VHF Features are enabled and such QSY messages are applicable.</p></body></html> - + <html><head/><body><p>Abrir automáticamente la ventana Datos astronómicos al cambiar a Q65 o JT65 cuando esté habilitada la decodificación tras el retardo EME, y cerrarla cuando ya no sea necesaria.</p><p>Abrir automáticamente el Creador de mensajes QSY si están habilitadas las funciones VHF y son aplicables dichos mensajes QSY.</p></body></html> - + Auto-open/close Astronomical data window - + Apertura y cierre automáticos de la ventana de datos astronómicos - + Calling CQ forces Call 1st - Llamar a CQ obliga a llamar primero Llamar CQ habilita 1er decodificado - + <html><head/><body><p>Tx until 73 is received when in MSK144 or Q65 mode. </p></body></html> - + <html><head/><body><p>TX hasta que se recibe 73 cuando está en modo MSK144 o Q65. </p></body></html> - + MSK144/Q65: Tx until 73 is received - + MSK144/Q65: TX hasta recibir 73 - + <html><head/><body><p>Allow kHz frequency offset entry without 'k' suffix.</p></body></html> - + <html><head/><body><p>Permitir la entrada de desplazamiento de frecuencia en kHz sin el sufijo "k".</p></body></html> - + kHz entry without k (restart required) + entrada de kHz sin k (se requiere reiniciar) + + + + <html><head/><body><p>Allow automatic Doppler tracking and split/Fake It/XIT to correct the transmit frequency while transmitting, including corrections of tens of kHz on microwave bands.</p><p>This option does not allow nominal dial or band changes while transmitting or tuning. Leave it unchecked if your rig cannot accept frequency-setting CAT commands while transmitting; WSJT-X will then make one midpoint Doppler correction before transmission starts.</p></body></html> - - <html><head/><body><p>Disable the Tune watchdog.</p></body></html> + + Allow Tx-frequency corrections while transmitting - + + <html><head/><body><p>Disable the Tune watchdog.</p></body></html> + <html><head/><body><p>Desactivar el temporizador de seguridad de Tune.</p></body></html> + + + Tune watchdog - + Temporizador de seguridad de Tune - + <html><head/><body><p>Number of seconds before Tune is aborted</p></body></html> + <html><head/><body><p>Número de segundos antes de que se cancele el TX Tono</p></body></html> + + + + Tune watchdog timeout - + seconds - + segundos - + Tx watchdog: + Temporizador de seguridad de TX: + + + + Tx watchdog timeout - + ID Inter&val: + ID Inter&valo: + + + + CW ID interval - + <html><head/><body><p>Turn the progress bar red while transmitting.</p></body></html> - + <html><head/><body><p>Mostrar en rojo la barra de progreso durante la transmisión.</p></body></html> - + Turn progress bar red while transmitting - + Cambie a rojo la barra de progreso mientras transmite - + Additional features Características adicionales - + Set Rx frequency to Tx frequency after QSO - + Establecer la frecuencia RX a la frecuencia TX después del QSO - + <html><head/><body><p>If a station sends locator, calculate and show the distance in Band Activity pane.</p></body></html> - + <html><head/><body><p>Si una estación envía su locato, calcula y muestra la distancia en el panel "Actividad en la banda".</p></body></html> - + Show distance in messages with grid - + Mostrar la distancia en los mensajes con locator - + <html><head/><body><p>Erase Band Activity and Rx frequency windows after band change.</p></body></html> - + <html><head/><body><p>Borrar las ventanas de "Actividad en la banda" y "Frecuencia de RX" después de cambio de banda.</p></body></html> - + Erase decodes after band change - + Borrar decodificaciones después de cambiar de banda - + Clear DX Grid after QSO - + Borrar la Locator DX después del QSO - + Show U.S. States in messages with grid - + Mostrar estados de EE. UU. en mensajes con locator - + Map Grid locator to U.S. State - + Asociar locator con estado de EE. UU. - + <html><head/><body><p>Align the text for DXCC, distance and azimuth.</p></body></html> - + <html><head/><body><p>Alinear el texto para DXCC, distancia y acimut.</p></body></html> - + Align DXCC/distance/azimuth - A + Alinear DXCC/distancia/acimut - + Alternate Erase button behavior Comportamiento alternativo del botón Borrar - + Clear DX Call after QSO Borrar indicativo DX después del QSO - + <html><head/><body><p>Increase or decrease the space between message text and DXCC.</p></body></html> - + <html><head/><body><p>Aumentar o disminuir el espacio entre el texto del mensaje y DXCC.</p></body></html> - Enable Wait features + DXCC alignment spacing - + + Enable Wait features + Habilitar funciones de espera + + + <html><head/><body><p>If a station sends a valid Maidenhead locator, calculate and show the great-circle azimuth in Band Activity pane.</p></body></html> - + <html><head/><body><p>Si una estación envía un locator Maidenhead válido, calcular y mostrar el azimut de círculo máximo en el panel Actividad de banda.</p></body></html> - + Show azimuth in messages with grid - + Mostrar azimut en mensajes con locator - + <html><head/><body><p>Increase or decrease the space between DXCC and distance/azimuth.</p></body></html> + <html><head/><body><p>Aumentar o disminuir el espacio entre DXCC y distancia/azimut.</p></body></html> + + + + Distance and azimuth alignment spacing - + Less button coloring (restart required) - + Menos color en los botones (requiere reiniciar) - + &Radio &Radio - + Radio interface configuration settings. Ajustes de configuración de la interfaz de radio. - + <html><head/><body><p>Use only VFO A for split operation (the program temporarily changes the QRG of your rig during transmission).</p></body></html> - + <html><head/><body><p>Usar solo el VFO A para operar en split (el programa cambia temporalmente la QRG del equipo durante la transmisión).</p></body></html> - + <html><head/><body><p>Use VFO A+B for split operation (works with many rigs, but requires the use of both VFOs).</p></body></html> - + <html><head/><body><p>Usar VFO A+B para operar en split (funciona con muchos equipos, pero requiere utilizar ambos VFO).</p></body></html> - + <html><head/><body><p>Don't use split (not recommended).</p></body></html> - + <html><head/><body><p>No usar split (no recomendado).</p></body></html> - + Settings that control your CAT interface. - Ajustes que controlan tú interfaz CAT. Ajustes que controlan el interface CAT. - + CAT Control Control CAT - - + + Port: Puerto: - + Serial port used for CAT control. Puerto serie usado para el control CAT. - - + + Serial Port Parameters Parámetros del puerto serie - + Baud Rate: Velocidad de transmisión: - + Serial port data rate which must match the setting of your radio. Velocidad de datos del puerto serie que debe coincidir con los ajustes de tu radio. - + 1200 1200 - + 2400 2400 - + 4800 4800 - + 9600 9600 - + 19200 19200 - + 38400 38400 - + 57600 57600 - + 115200 115200 - + <html><head/><body><p>Number of data bits used to communicate with your radio's CAT interface (usually eight).</p></body></html> - <html><head/><body><p>Número de bits de datos utilizados para comunicarse con la interfaz CAT de tú equipo (generalmente ocho).</p></body></html> <html><head/><body><p>Número de bits de datos utilizados para comunicarse con la interface CAT del equipo (generalmente ocho).</p></body></html> - + Data bits Bits de datos - + Data Bits Bits de datos - + D&efault Por d&efecto - + Se&ven &Siete - + E&ight O&cho - + <html><head/><body><p>Number of stop bits used when communicating with your radio's CAT interface</p><p>(consult you radio's manual for details).</p></body></html> - <html><head/><body><p>Número de bits de parada utilizados al comunicarse con la interfaz CAT de tú equipo</p><p>(consulta el manual de tú equipo para más detalles).</p></body></html> <html><head/><body><p>Número de bits de parada utilizados al comunicarse con la interface CAT del equipo</p><p>(consulta el manual del equipo para más detalles).</p></body></html> - + Stop bits Bits de parada - + Stop Bits Bits de parada - - + + Default Por defecto - + On&e Un&o - + T&wo &Dos - + <html><head/><body><p>Flow control protocol used between this computer and your radio's CAT interface (usually &quot;None&quot; but some require &quot;Hardware&quot;).</p></body></html> - <html><head/><body><p>Protocolo de control de flujo utilizado entre este PC y la interfaz CAT de tú equipo (generalmente &quot;Ninguno&quot;pero algunos requieren&quot;Hardware&quot;).</p></body></html> <html><head/><body><p>Protocolo de control de flujo utilizado entre este PC y la interfaz CAT del equipo (generalmente "Ninguno", pero algunos requieren "Hardware").</p></body></html> - - + + Handshake Handshake - + &None &Ninguno - + Software flow control (very rare on CAT interfaces). Control de flujo de software (muy raro en interfaces CAT). - + XON/XOFF XON/XOFF - + Flow control using the RTS and CTS RS-232 control lines not often used but some radios have it as an option and a few, particularly some Kenwood rigs, require it). @@ -9176,41 +11145,40 @@ no se usa con frecuencia, pero algunos equipos lo tienen como una opción y unos pocos, particularmente algunos equipos de Kenwood, lo requieren. - + &Hardware &Hardware - + Special control of CAT port control lines. Control especial de líneas de control de puertos CAT. - - + + Force Control Lines - Líneas de control de fuerza Forzar "Control de Líneas" - - + + High Alto - - + + Low Bajo - + DTR: DTR: - + RTS: RTS: @@ -9219,197 +11187,169 @@ unos pocos, particularmente algunos equipos de Kenwood, lo requieren.¿ Cómo este programa activa el PTT en tú equipo ? - How this program activates the PTT on your radio? - ¿Cómo este programa activa el PTT en tú equipo? - ¿Cómo activa este programa el PTT del equipo? + ¿Cómo activa este programa el PTT del equipo? - + PTT Method Método de PTT - + <html><head/><body><p>No PTT activation, instead the radio's automatic VOX is used to key the transmitter.</p><p>Use this if you have no radio interface hardware.</p></body></html> - <html><head/><body><p>Sin activación de PTT, en cambio, el VOX automático del equipo se usa para conectar el transmisor.</p><p>Usa esto si no tienes hardware de interfaz de radio.</p></body></html> <html><head/><body><p>Sin activación de PTT, se use el VOX del equipo para activar el transmisor.</p><p>Use esta opción si no se tiene una interface de radio.</p></body></html> - + VO&X VO&X - + <html><head/><body><p>Use the RS-232 DTR control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The DTR control line of the CAT serial port may be used for this or a DTR control line on a different serial port may be used.</p></body></html> - <html><head/><body><p>Usa la línea de control RS-232 DTR para alternar el PTT de tú equipo, requiere hardware para interconectar la línea.</p><p>Algunas unidades de interfaz comerciales también usan este método.</p><p>La línea de control DTR del puerto serie CAT se puede usar para esto o se puede usar una línea de control DTR en un puerto serie diferente.</p></body></html> <html><head/><body><p>Use la línea de control RS-232 DTR para activar el PTT del equipo, se requiere de "hardware" para el envio de señales.</p><p>Algunas unidades de interfaz comerciales también usan este método.</p><p>La línea de control DTR del puerto serie CAT se puede usar para esto o se puede usar una línea de control DTR en un puerto serie diferente.</p></body></html> - + &DTR &DTR - + Some radios support PTT via CAT commands, use this option if your radio supports it and you have no other hardware interface for PTT. - Algunos equipos admiten PTT a través de comandos CAT, -usa esta opción si tú equipo lo admite y no tiene -una interface para PTT. Algunos equipos admiten PTT a través de comandos CAT, use esta opción si el equipo lo admite y no tiene una interface para PTT. - + C&AT C&AT - + <html><head/><body><p>Use the RS-232 RTS control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The RTS control line of the CAT serial port may be used for this or a RTS control line on a different serial port may be used. Note that this option is not available on the CAT serial port when hardware flow control is used.</p></body></html> - <html><head/><body><p>Usa la línea de control RS-232 RTS para alternar el PTT de tú equipo, requiere hardware para interconectar la línea.</p><p>Algunas unidades de interfaz comerciales también usan este método.</p><p>La línea de control RTS del puerto serie CAT se puede usar para esto o se puede usar una línea de control RTS en un puerto serie diferente. Ten en cuenta que esta opción no está disponible en el puerto serie CAT cuando se usa el control de flujo de hardware.</p></body></html> <html><head/><body><p>Use la línea de control RS-232 RTS para activar el PTT del equipo, requiere hardware para interconectar la línea.</p><p>Algunas unidades de interfaz comerciales también usan este método.</p><p>La línea de control RTS del puerto serie CAT se puede usar para esto o se puede usar una línea de control RTS en un puerto serie diferente. Esta opción no está disponible en el puerto serie CAT cuando se usa el control de flujo de hardware.</p></body></html> - + R&TS R&TS - + <html><head/><body><p>Select the RS-232 serial port utilised for PTT control, this option is available when DTR or RTS is selected above as a transmit method.</p><p>This port can be the same one as the one used for CAT control.</p><p>For some interface types the special value CAT may be chosen, this is used for non-serial CAT interfaces that can control serial port control lines remotely (OmniRig for example).</p></body></html> - <html><head/><body><p>Selecciona el puerto serie RS-232 utilizado para el control PTT, esta opción está disponible cuando se selecciona DTR o RTS arriba como método de transmisión.</p><p>Este puerto puede ser el mismo que el utilizado para el control CAT.</p><p>Para algunos tipos de interfaz, se puede elegir el valor especial CAT, esto se usa para interfaces CAT no seriales que pueden controlar líneas de control de puerto serie de forma remota (OmniRig, por ejemplo).</p></body></html> <html><head/><body><p>Seleccione el puerto serie RS-232 utilizado para el control PTT, esta opción está disponible cuando se selecciona DTR o RTS como método de transmisión.</p><p>Este puerto puede ser el mismo que el utilizado para el control CAT.</p><p>Para algunos tipos de interfaz, se puede elegir el valor especial CAT, esto se usa para interfaces CAT no seriales que pueden controlar líneas de control de puerto serie de forma remota (OmniRig, por ejemplo).</p></body></html> - + Modulation mode selected on radio. Modo de modulación seleccionado en el equipo. - + Mode Modo - + <html><head/><body><p>USB is usually the correct modulation mode,</p><p>unless the radio has a special data or packet mode setting</p><p>for AFSK operation.</p></body></html> - <html><head/><body><p>USB suele ser el modo de modulación correcto,</p><p>a menos que la radio tenga una configuración/ajuste especial de datos o modo de paquete</p><p>para operación AFSK.</p></body></html> <html><head/><body><p>USB suele ser usualmente el modo correcto,</p><p>a menos que la radio tenga un ajuste de modo especifico para "data o packet"</p><p>para operación en AFSK.</p></body></html> - + US&B US&B - + Don't allow the program to set the radio mode (not recommended but use if the wrong mode or bandwidth is selected). - No permitas que el programa configure el modo del equipo -(no se recomienda pero se usa si el modo es incorrecto -o se selecciona el ancho de banda). No permite que el programa configure el modo en el equipo (no se recomienda, pero usese si un modo incorrecto o ancho de banda es seleccionado). - - + + None Ninguno - + If this is available then it is usually the correct mode for this program. - Si está disponible, generalmente es el modo correcto para este programa. Si está disponible, entonces usualmente es el modo correcto para este programa. - + Data/P&kt - Datos/P&kt Data/P&kt - + Some radios can select the audio input using a CAT command, this setting allows you to select which audio input will be used (if it is available then generally the Rear/Data option is best). - Algunos equipos pueden seleccionar la entrada de audio usando un comando CAT, -esta configuración/ajuste te permite seleccionar qué entrada de audio se usará -(si está disponible, generalmente la opción Posterior/Datos es la mejor). Algunos equipos pueden seleccionar la entrada de audio usando un comando CAT, este ajuste permite seleccionar qué entrada de audio se usará (si está disponible, generalmente la opción "Parte posterior" es la mejor). - + Transmit Audio Source Fuente de audio de transmisión - + Rear&/Data - Parte posterior/Datos Parte posterior - + &Front/Mic &Frontal/Micrófono - + Rig: Equipo: - + Poll Interval: Intervalo de sondeo: - + <html><head/><body><p>Interval to poll rig for status. Longer intervals will mean that changes to the rig will take longer to be detected.</p></body></html> - <html><head/><body><p>Intervalo de sondeo al equipo para el estado. Intervalos más largos significarán que los cambios en el equipo tardarán más en detectarse.</p></body></html> <html><head/><body><p>Intervalo para sondeo del estado del equipo. Intervalos más largos significará que los cambios en el equipo tardarán más en detectarse.</p></body></html> - + s s - + <html><head/><body><p>Attempt to connect to the radio with these settings.</p><p>The button will turn green if the connection is successful or red if there is a problem.</p></body></html> - <html><head/><body><p>Intenta conectarte al equipo con esta configuración.</p><p>El botón se pondrá verde si la conexión es correcta o rojo si hay un problema.</p></body></html> <html><head/><body><p>Prueba de conexión al equipo por CAT utilizando esta configuración.</p><p>El botón cambiará a verde si la conexión es correcta o rojo si hay un problema.</p></body></html> - + Test CAT - Test de CAT Probar CAT - + Attempt to activate the transmitter. Click again to deactivate. Normally no power should be output since there is no audio being generated at this time. Check that any Tx indication on your radio and/or your radio interface behave as expected. - Intenta activar el transmisor. -Haz clic nuevamente para desactivar. Normalmente no debe haber potencia -de salida ya que no se genera audio en este momento. - -Verifica cualquier indicación de TX en tú equipo y/o en tú -interfaz de radio se comporta como se espera. Prueba de activación del PTT. Clic nuevamente para desactivar. Normalmente no debe haber potencia @@ -9419,60 +11359,52 @@ Verifica que cualquier indicación de TX en tu equipo y/o en el interfaz de radio se comporte como se esperaba. - + Test PTT - Test de PTT Probar PTT - + Split Operation - Operación dividida (Split) Operación en "Split" - + Fake It - Fíngelo Fingir "Split" - + Rig Equipo - + A&udio A&udio - + Audio interface settings Ajustes del interfaz de audio - + Souncard Tarjeta de Sonido - + Soundcard Tarjeta de Sonido - + Select the audio CODEC to use for transmitting. If this is your default device for system sounds then ensure that all system sounds are disabled otherwise you will broadcast any systems sounds generated during transmitting periods. - Selecciona el CODEC de audio a utilizar para transmitir -Si este es tú dispositivo predeterminado para los sonidos del sistema, -entonces, asegúrate de que todos los sonidos del sistema estén deshabilitados -de lo contrario transmitiras cualquier sonido del sistema generado durante -los períodos de transmisión. Seleccione el CODEC de audio a utilizar para transmitir Si este es el dispositivo predeterminado para los sonidos del sistema, entonces, asegúrese de que todos los sonidos del sistema estén deshabilitados @@ -9480,380 +11412,392 @@ de lo contrario transmitirá cualquier sonido del sistema generado durante los períodos de transmisión. - + Select the audio CODEC to use for receiving. - Selecciona el CODEC de audio que se usará para recibir. Selecciona el CODEC a usar para recibir. - + &Input: &Entrada: - + Select the channel to use for receiving. - Selecciona el canal a usar para recibir. Seleccione el canal a usar para recibir. - - + + Mono Mono - - + + Left Izquierdo - - + + Right Derecho - - + + Both Ambos - + Select the audio channel used for transmission. Unless you have multiple radios connected on different channels; then you will usually want to select mono or both here. - Selecciona el canal de audio utilizado para la transmisión. -A menos de que tengas varios equipos conectados en diferentes -canales, entonces, generalmente querrás seleccionar mono o -ambos canales. Selecciona el canal de audio utilizado para la transmisión. A menos que tenga varios equipos conectados en diferentes canales, entonces, generalmente debe seleccionar "Mono" o "Ambos". - + Enable VHF and submode features Habilitar funciones de VHF y submodo - - + + Update Hamlib - + Actualizar Hamlib - + 32-bit 32-bit - + <html><head/><body><p>Revert the last Hamlib update. </p><p>Note: This function is only available on Windows.</p></body></html> - + <html><head/><body><p>Revertir la última actualización de Hamlib.</p><p>Nota: esta función solo está disponible en Windows.</p></body></html> - + Revert Update - + Revertir actualización - <html><head/><body><p>Download the latest libhamlib-4.dll file from https://n0nb.users.sourceforge.net/. </p><p>Note: This function is only available on Windows.</p></body></html> - + <html><head/><body><p>Descargar el archivo libhamlib-4.dll más reciente desde https://n0nb.users.sourceforge.net/.</p><p>Nota: esta función solo está disponible en Windows.</p></body></html> - + In use: - + En uso: - + Backed up: - + Respaldado: - + 64-bit 64-bit - + Rig Data - + Datos del equipo - + <html><head/><body><p>Stop transmitting immediately when SWR exceeds 2.5.</p></body></html> - + <html><head/><body><p>Detener inmediatamente la transmisión cuando la SWR supere 2,5.</p></body></html> - + Halt Tx when SWR > 2.5 - + Detener TX cuando SWR > 2.5 - + <html><head/><body><p>Read and display transmit PWR and SWR of your rig.</p></body></html> - + <html><head/><body><p>Leer y mostrar la PWR y la SWR de transmisión del equipo.</p></body></html> - + Read and display PWR and SWR - + Leer y mostrar PWR y SWR - + Ou&tput: &Salida: - - <html><head/><body><p>Refresh audio device list.</p></body></html> + + Output audio channel + + + + + Input audio channel - + + <html><head/><body><p>Refresh audio device list.</p></body></html> + <html><head/><body><p>Refrescar lista de dispositivos de audio.</p></body></html> + + + Refresh - Actualizar + Actualizar - + <html><head/><body><p>Use TCI Audio when available.</p></body></html> - + <html><head/><body><p>Utilizar audio TCI cuando disponible.</p></body></html> - + Use TCI Audio (restart required) - + Utilizar audio TCI (se requiere reiniciar) - + <html><head/><body><p>Rx audio level</p></body></html> + <html><head/><body><p>Nivel de audio de RX</p></body></html> + + + + TCI receive audio level - + Rx - + RX - + <html><head/><body><p>Sort audio device names alphabetically.</p></body></html> - + <html><head/><body><p>Ordenar alfabéticamente los nombres de los dispositivos de audio.</p></body></html> - + Sort alphabetically - + Ordenar alfabéticamente - + <html><head/><body><p>Hide the usually unusable ALSA CARD subdevices on Linux.</p></body></html> - + <html><head/><body><p>Ocultar en Linux los subdispositivos ALSA CARD que normalmente no son utilizables.</p></body></html> - + Hide ALSA CARD subdevices (Linux only) - + Ocultar subdispositivos de la tarjeta ALSA (solo Linux) - - + + Save Directory - Guardar directorio Directorio "save" - + Loc&ation: Ubic&ación: - + Path to which .WAV files are saved. Ruta en la que se guardan los archivos .WAV. - - + + TextLabel Etiqueta de texto - + Click to select a different save directory for .WAV files. - Haz clic para seleccionar un directorio de guardado diferente para los archivos .WAV. Clic para seleccionar un directorio "Save" diferente donde guardar los los archivos .WAV. - + S&elect - S&elecciona S&eleccionar - - + + AzEl Directory Directorio AzEl - + Location: Ubicación: - + Select Seleccionar - + <html><head/><body><p>Enables additional line in azel.dat for Dpol parameter.</p></body></html> - + <html><head/><body><p>Habilita una línea adicional en azel.dat para el parámetro Dpol.</p></body></html> - + Enable extra line in azel.dat - + Habilitar línea adicional en azel.dat - + Power Memory By Band - Memoriza la potencia por banda Recuerda la potencia por banda - + Remember power settings by band - Recuerde los ajustes de potencia por banda Recuerda ajustes de potencia por banda - + Enable power memory during transmit Habilita memoria de potencia durante la transmisión - + Transmit Transmitir - + Enable power memory during tuning Habilita memoria de potencia durante la sintonización - + Tune Tono TX - + Tx &Macros - Macros de T&X Macros T&X - + Canned free text messages setup - Configuración de mensajes de texto libres Ajuste de mensajes de texto libre - + + New &macro: + + + + &Add - &Añadir &Agregar - + + Add Tx macro + + + + + Adds the entered message to the saved Tx macro list. + + + + + New Tx macro message + + + + + Enter a saved free-text message for the Tx5 dropdown. Free-text messages are limited to 13 characters including spaces. + + + + &Delete &Borrar - Drag and drop items to rearrange order Right click for item specific actions Click, SHIFT+Click and, CRTL+Click to select items - Arrastra y suelta elementos para reorganizar el orden -Haz clic derecho para acciones específicas del artículo. -Clic, Mayúsculas+Clic y, CTRL+Clic para seleccionar elementos. - Arrastre y suelte elementos para reorganizar el orden + Arrastre y suelte elementos para reorganizar el orden Clic derecho para acciones específicas del elemento. Clic, Mayús+Clic y CTRL+Clic para seleccionar elementos - + Reportin&g - Informe&s &Reportes - + Reporting and logging settings - Ajuste de informes y logs Ajustes de reportes y gaurdado de logs - + Logging - Registros Guardado de log - + <html><head/><body><p>Check this option to note any Special Operating Activity in the comments field.</p></body></html> - + <html><head/><body><p>Marque esta opción para anotar cualquier Actividad operativa especial en el campo de comentarios.</p></body></html> - + Special operating activity to comments - + Actividad operativa especial a comentarios - + The program will pop up a partially completed Log QSO dialog when you send a 73 or free text message. - El programa mostrará un cuadro de diálogo Log QSO parcialmente completado cuando envíe un mensaje de texto 73 o libre. El programa mostrará un cuadro de diálogo con datos del QSO parcialmente completados cuando envíe un 73 o mensaje de texto libre. - + Promp&t me to log QSO - Regis&tra el QSO Pregun&tarme para guardar el QSO - + <html><head/><body><p>Log 'ZZ00' as grid if the other station doesn't send you a grid.</p></body></html> - + <html><head/><body><p>Registrar 'ZZ00' como locator si la otra estación no envía un locator.</p></body></html> - + Fill missing grids with 'ZZ00' - + Completar locators ausentes con 'ZZ00' - + Op Call: Indicativo del Operador: - + Some logging programs will not accept the type of reports saved by this program. Check this option to save the sent and received reports in the comments field. - Algunos programas de log no aceptarán el tipo de informes -guardado por este programa. -Marca esta opción para guardar los informes enviados y recibidos en -el campo de comentarios. Algunos libros de guardia no aceptan el tipo de reportes guardados por este programa. @@ -9861,52 +11805,46 @@ Marca esta opción para guardar los reportes enviados y recibidos en el campo de comentarios. - + d&B reports to comments - Informes de los d&B en los comentarios Guardar reportes d&B en los comentarios Check this option to force the clearing of the DX Call and DX Grid fields when a 73 or free text message is sent. - Marca esta opción para forzar la eliminación de los campos -Llamada DX y Locator/Grid DX cuando se envía un mensaje de texto 73 o libre. Marca esta opción para eliminar los campos Indicativo DX y Locator DX cuando se envíe un 73 o un mensaje de texto libre. Clear &DX call and grid after logging - Borrar la Llamada &DX y Locator/Grid después del registro Borrar Indicativo &DX y Locator DX después de guardado el QSO - + <html><head/><body><p>Some logging programs will not accept WSJT-X mode names.</p></body></html> <html><head/><body><p>Algunos programas de log no aceptarán nombres de modo WSJT-X.</p></body></html> - + Con&vert mode to RTTY Con&vertir modo a RTTY - + <html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html> <html><head/><body><p>El indicativo del operador, si es diferente del indicativo de la estación.</p></body></html> - + <html><head/><body><p>Check to have QSOs logged automatically, when complete.</p></body></html> - <html><head/><body><p>Marca para que los QSO's se registren automáticamente, cuando se completen.</p></body></html> <html><head/><body><p>Marca para que los QSO's se guarden automáticamente, cuando se completen.</p></body></html> Log automatically (contesting only) - Log automático (sólo concursos) Guardar QSO automáticamente (sólo concursos) - + Network Services Servicios de red @@ -9915,10 +11853,6 @@ Locator DX cuando se envíe un 73 o un mensaje de texto libre. decoded signals as spots to the http://pskreporter.info web site. This is used for reverse beacon analysis which is very useful for assessing propagation and system performance. - El programa puede enviar los detalles de su estación y todas las -señales decodificadas como puntos en el sitio web http://pskreporter.info. -Esto se utiliza para el análisis de baliza inversa que es muy útil -para evaluar la propagación y el rendimiento del sistema. Este programa puede enviar los detalles de su estación y todas las señales decodificadas como "spots" a la página web http://pskreporter.info. @@ -9926,275 +11860,347 @@ Esto se utiliza para el análisis de "reverse beacon", lo cual es muy para evaluar la propagación y el rendimiento del sistema. - + <html><head/><body><p>The program can send your station details and all decoded signals with grid squares as spots to the http://pskreporter.info web site.</p><p>This is used for reverse beacon analysis which is very useful for assessing propagation and system performance.</p></body></html> <html><head/><body><p>El programa puede enviar los detalles de su estación y todas las señales decodificadas con locator como "spots" a la página http://pskreporter.info. </p> <p> Esto se usa para el análisis de "reverse beacon", lo cual es muy útil para evaluar la propagación y rendimiento de sistema.</p></body></html> - + Enable &PSK Reporter Spotting - Activa &PSK Reporter Activar "spotting" en &PSK Reporter - + <html><head/><body><p>Check this option if a reliable connection is needed</p><p>Most users do not need this, the default uses UDP which is more efficient. Only check this if you have evidence that UDP traffic from you to PSK Reporter is being lost.</p></body></html> <html><head/><body><p>Marque esta opción si se necesita una conexión confiable</p><p> La mayoría de los usuarios no la necesitan, el valor predeterminado usa UDP que es más eficiente. Solo marque esta casilla si tiene evidencia de que se está perdiendo el tráfico UDP hacia PSK Reporter.</p></body></html> - + Use TCP/IP connection Usar conexión TCP/IP - + UDP Server Servidor UDP - + UDP Server: Servidor UDP: - + <html><head/><body><p>Optional hostname of network service to receive decodes.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the broadcasting of UDP status updates.</p></body></html> <html><head/><body><p>"Hostname" del servicio de red para recibir decodificaciones.</p><p>Formatos:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Dirección IPv4</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Dirección IPv6</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Dirección IPv4 multicast</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Dirección IPv6 multicast</li></ul><p>Borrar este campo deshabilitará la transmisión de actualizaciones de estado UDP.</p></body></html> - + UDP Server port number: Número de puerto del servidor UDP: - <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be broadcast.</p></body></html> - <html><head/><body><p>Introduce el número de puerto del servicio del servidor UDP al que WSJT-X debe enviar actualizaciones. Si esto es cero, no se transmitirán actualizaciones.</p></body></html> - <html><head/><body><p>Escriba el número del puerto del servidor UDP al que WSJT-X debe enviar actualizaciones. Si este es cero, no se transmitirán actualizaciones.</p></body></html> + <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be broadcast.</p></body></html> + <html><head/><body><p>Escriba el número del puerto del servidor UDP al que WSJT-X debe enviar actualizaciones. Si este es cero, no se transmitirán actualizaciones.</p></body></html> + + + + <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> + <html><head/><body><p>Ingrese el puerto UDP del servidor al que WSJT-X debe enviar actualizaciones. Si es cero, no se enviarán actualizaciones.</p></body></html> + + + + Outgoing interfaces: + Interfaces salientes: + + + + <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> + <html><head/><body><p>Al enviar actualizaciones a una dirección de grupo "multicast", es necesario especificar a qué interfaces de red enviarlas. Si la interfaz "loop-back" permite "multicast", al menos se seleccionará esa. </p> <p> Para la mayoría de los usuarios, la interfaz "loop-back" es todo lo que se necesita, que permitirá que otras múltiples aplicaciones en el mismo ordenador interoperar con WSJT-X. Si las aplicaciones que se ejecutan en otros "hosts" van a recibir actualizaciones de estado, se debe usar una interfaz de red adecuada. </p> <p> En algunos sistemas Linux, puede ser necesario habilitar "multicast" en la interfaz de red "loop-back".</p></body></html> + + + + <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> + <html><head/><body><p>Establece el número de saltos que los datagramas de "multicast" pueden realizar. Casi todo el mundo debería establecer esto en 1 para mantener el tráfico de "multicast" saliente dentro de la subred local.</p></body></html> + + + + Multicast TTL: + Multicast TTL: + + + + <html><head/><body><p>Download the latest libhamlib-4.dll file from Hamlib SourceForge snapshots. </p><p>Note: This function is only available on Windows.</p></body></html> + + + + + Delete Tx macro + + + + + Deletes the selected Tx macro, or the focused macro if no row is selected. + + + + + Move &Up + + + + + Move Tx macro up + + + + + Moves the selected Tx macro one position earlier in the list. + + + + + Move D&own + - - <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> - <html><head/><body><p>Ingrese el puerto UDP del servidor al que WSJT-X debe enviar actualizaciones. Si es cero, no se enviarán actualizaciones.</p></body></html> + + Move Tx macro down + - - Outgoing interfaces: - Interfaces salientes: + + Moves the selected Tx macro one position later in the list. + - - <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> - <html><head/><body><p>Al enviar actualizaciones a una dirección de grupo "multicast", es necesario especificar a qué interfaces de red enviarlas. Si la interfaz "loop-back" permite "multicast", al menos se seleccionará esa. </p> <p> Para la mayoría de los usuarios, la interfaz "loop-back" es todo lo que se necesita, que permitirá que otras múltiples aplicaciones en el mismo ordenador interoperar con WSJT-X. Si las aplicaciones que se ejecutan en otros "hosts" van a recibir actualizaciones de estado, se debe usar una interfaz de red adecuada. </p> <p> En algunos sistemas Linux, puede ser necesario habilitar "multicast" en la interfaz de red "loop-back".</p></body></html> + + Drag and drop items to rearrange order +Right click for item specific actions +Click, SHIFT+Click and, CTRL+Click to select items + - - <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> - <html><head/><body><p>Establece el número de saltos que los datagramas de "multicast" pueden realizar. Casi todo el mundo debería establecer esto en 1 para mantener el tráfico de "multicast" saliente dentro de la subred local.</p></body></html> + + Saved Tx macro messages + - - Multicast TTL: - Multicast TTL: + + Saved free-text messages for the main window Tx5 dropdown. Use Move Up and Move Down or drag and drop to reorder messages. + - + Log automatically - + Guardar automáticamente - + <html><head/><body><p>Use 'Log automatically' only for special operating activities.</p></body></html> - + <html><head/><body><p>Usar 'Registrar automáticamente' solo para actividades operativas especiales.</p></body></html> - + Contesting only - + Solo concurso - + <html><head/><body><p>Shorten 6-digit grid entries and log 4-digit grids instead.</p></body></html> - + <html><head/><body><p>Acortar los locators de 6 caracteres y registrar en su lugar locators de 4 caracteres.</p></body></html> - + Log 4-digit grids - + Guardar locators de 4 digitos - + <html><head/><body><p>With this enabled WSJT-X will accept certain requests back from a UDP server that receives decode messages.</p></body></html> - <html><head/><body><p>Con esto habilitado, WSJT-X aceptará ciertas solicitudes de un servidor UDP que recibe mensajes de decodificación.</p></body></html> <html><head/><body><p>Si se habilita, WSJT-X aceptará ciertas solicitudes de un servidor UDP que recibe mensajes decodificados.</p></body></html> - + Accept UDP requests Aceptar solicitudes UDP - + <html><head/><body><p>Indicate acceptance of an incoming UDP request. The effect of this option varies depending on the operating system and window manager, its intent is to notify the acceptance of an incoming UDP request even if this application is minimized or hidden.</p></body></html> - <html><head/><body><p>Indica la aceptación de una solicitud UDP entrante. El efecto de esta opción varía según el sistema operativo y el administrador de ventanas, su intención es notificar la aceptación de una solicitud UDP entrante, incluso si esta aplicación está minimizada u oculta.</p></body></html> <html><head/><body><p>Indica la aceptación de una solicitud UDP entrante. El efecto de esta opción varía según el sistema operativo y el "Window Manager", su intención es notificar la aceptación de una solicitud UDP entrante, incluso si esta aplicación está minimizada u oculta.</p></body></html> - + Notify on accepted UDP request Notificar sobre una solicitud UDP aceptada - + <html><head/><body><p>Restore the window from minimized if an UDP request is accepted.</p></body></html> <html><head/><body><p>Restaura la ventana minimizada si se acepta una solicitud UDP.</p></body></html> - + Accepted UDP request restores window - La solicitud UDP aceptada restaura la ventana Una solicitud UDP aceptada restaura la ventana - + Secondary UDP Server (deprecated) Servidor UDP secundario (en desuso) - + <html><head/><body><p>When checked, WSJT-X will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html> - <html><head/><body><p>Cuando se marca, WSJT-X transmitirá un contacto registrado en formato ADIF al nombre de host y puerto configurados. </p></body></html> <html><head/><body><p>Si se marca , WSJT-X difundirá el contacto guardado, en formato ADIF, al servidor y puerto configurados. </p></body></html> - + Enable logged contact ADIF broadcast - Habilita la transmisión ADIF de contacto registrado Habilita "broadcast" de contacto guardado (ADIF) - + Server name or IP address: Nombre del servidor o dirección IP: - + <html><head/><body><p>Optional host name of N1MM Logger+ program to receive ADIF UDP broadcasts. This is usually 'localhost' or ip address 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable broadcasting of ADIF information via UDP.</p></body></html> <html><head/><body><p>"Hostname" del programa N1MM Logger + donde se recibirán las transmisiones ADIF UDP. Este suele ser 'localhost' o dirección IP 127.0.0.1</p><p>Formatos:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Dirección IPv4</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Dirección IPv6</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Dirección IPv4 multicast</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Dirección IPv6 multicast</li></ul><p>Borrar este campo deshabilitará la transmisión de información ADIF a través de UDP.</p></body></html> - + Server port number: Número de puerto del servidor: - + <html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html> - <html><head/><body><p>Introduce el número de puerto que WSJT-X debe usar para las transmisiones UDP de información de registro ADIF. Para N1MM Logger +, este valor debe ser 2333. Si es cero, no se transmitirán actualizaciones.</p></body></html> <html><head/><body><p>Escriba el número de puerto que WSJT-X debe usar para las transmisiones UDP del log ADIF guardado. Para N1MM Logger + este valor debe ser 2333. Si es cero, no se transmitirán actualizaciones.</p></body></html> - + Frequencies Frecuencias - + Default frequencies and band specific station details setup - Configuración predeterminada de las frecuencias y banda con detalles específicos de la estación Ajustes de frecuencias predeterminada y detalles de especificos de la banda - + <html><head/><body><p>See &quot;Frequency Calibration&quot; in the WSJT-X User Guide for details of how to determine these parameters for your radio.</p></body></html> - <html><head/><body><p>Ver&quot;Calibración de Frecuencia&quot;en la Guía de usuario de WSJT-X para obtener detalles sobre cómo determinar estos parámetros para tú equipo.</p></body></html> <html><head/><body><p>Ver "Calibración de Frecuencia" en la Guía de usuario de WSJT-X para obtener detalles sobre cómo determinar estos parámetros para el equipo.</p></body></html> - + Frequency Calibration Calibración de frecuencia - + Slope: - Pendiente: Cadencia: - + ppm ppm - + Intercept: - Interceptar: Intercepción: - + Hz Hz - + Working Frequencies Frecuencias de trabajo - + + + Insert, delete, load, save, merge, or reset working frequencies. + + + + + Working frequencies actions + + + + + + + Actions... + + + + <html><head/><body><p>Right click to maintain the working frequencies list.</p></body></html> - <html><head/><body><p>Haz clic derecho para mantener la lista de frecuencias de trabajo.</p></body></html> <html><head/><body><p>Clic derecho para mantener la lista de frecuencias de trabajo.</p></body></html> - + Station Information Información de la estación - + + + Insert or delete station information rows. + + + + + Station information actions + + + + Items may be edited. Right click for insert and delete options. - Se pueden editar ítems. -Haz clic derecho para insertar y eliminar opciones. Se puede editar elementos. Clic derecho para insertar y eliminar opciones. - + Colors Colores - + Decode Highlightling Resaltar Decodificado - Reset Highlighting to WSJT-X default - + Restablecer el resaltado a los valores predeterminados de WSJT-X - Reset Highlighting to WSJT-X Improved default - + Restablecer el resaltado a WSJT-X Improved predeterminado - + <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> - <html><head/><body><p>Haz clic para escanear el archivo ADIF wsjtx_log.adi nuevamente para obtener información trabajada antes</p></body></html> <html><head/><body><p>Clic para procesar nuevamente el archivo ADIF wsjtx_log.adi para obtener información de estaciones trabajadas anteriormente</p></body></html> - + Rescan ADIF Log - Escaneo de nuevo el log ADIF Procesar nuevamente log ADIF - + <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> <html><head/><body><p>Presiona para restablecer todos los elementos resaltados arriba a los valores y prioridades predeterminados.</p></body></html> @@ -10203,874 +12209,1080 @@ Clic derecho para insertar y eliminar opciones. Restablecer resaltado - + <html><head/><body><p>Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.</p><p>Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.</p></body></html> - <html><head/><body><p>Activa o desactiva las casillas de verificación y haz clic con el botón derecho en un elemento para cambiar o desactivar el color del primer plano, el color de fondo o restablecer el elemento a los valores predeterminados. Arrastra y suelta los elementos para cambiar su prioridad, mayor en la lista es mayor en prioridad.</p><p>Ten en cuenta que cada color de primer plano o de fondo puede estar configurado o no, lo que significa que no está asignado para ese tipo de elemento y pueden aplicarse elementos de menor prioridad.</p></body></html> <html><head/><body><p>Activar o desactivar usando las casillas de verificación. Clic con el botón derecho en un elemento para cambiar o volver al color predeterminado tanto de las letras como el color de fondo. Arrastrar y soltar los elementos para cambiar su prioridad; los primeros en la lista tienen mayor prioridad.</p><p>Cada color de letras o fondo puede estar configurado o no, no configurado significa que no está asignado para este elemento y pueden aplicarse elementos de menor prioridad.</p></body></html> - + <html><head/><body><p>Check to indicate new DXCC entities, grid squares, and callsigns per mode.</p></body></html> - <html><head/><body><p>Marca para indicar nuevas entidades DXCC, Locator y indicativos por modo.</p></body></html> <html><head/><body><p>Marcar para indicar nueva entidad DXCC, locator e indicativos por modo.</p></body></html> - + Highlight by Mode Destacar por modo - + Include extra WAE entities Incluir entidades WAE adicionales - + Check to for grid highlighting to only apply to unworked grid fields - Marca para que el resaltado de Locator sólo se aplique a los campos de Locator no trabajados Marcar para que el resaltado de locator sólo se aplique a los no trabajados - + Only grid Fields sought - Solo campos de Locator/Grid buscados Solo campos de locator buscados - + <html><head/><body><p>Controls for Logbook of the World user lookup.</p></body></html> - <html><head/><body><p>Controles para la búsqueda de usuarios de Logbook of the World (LoTW).</p></body></html> <html><head/><body><p>Búsqueda de usuarios de LoTW.</p></body></html> - + Logbook of the World User Validation - Validación de Usuario de Logbook of the World (LoTW) Validación de usuario de LoTW - + Users CSV file URL: - URL del archivo CSV de los usuarios: Enlace del archivo CSV de los usuarios: - + <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> - <html><head/><body><p>URL del último archivo de datos de fechas y horas de carga de ARRL LotW que se utiliza para resaltar decodificaciones de estaciones que se sabe que cargan su archivo de log a LotW.</p></body></html> <html><head/><body><p>Enlace del último archivo con fechas y horas de subidas de usuarios del LoTW, que se utiliza para resaltar decodificaciones de estaciones que suben su log al LoTW.</p></body></html> - URL - Enlace + Enlace https://lotw.arrl.org/lotw-user-activity.csv https://lotw.arrl.org/lotw-user-activity.csv - + <html><head/><body><p>Push this button to fetch the latest LotW user's upload date and time data file.</p></body></html> - <html><head/><body><p>Presiona este botón para obtener el último archivo de datos de fecha y hora de carga de los usuarios de LotW.</p></body></html> <html><head/><body><p>Presionar este botón para descargar archivo de LoTW con la última fecha/hora de subida de los usuarios.</p></body></html> - + Fetch Now Buscar ahora - + Age of last upload less than: - Edad de la última carga inferior a: Fecha última subida a LoTW inferior a: - + <html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html> - <html><head/><body><p>Ajusta este cuadro de selección para establecer el umbral de edad de la última fecha de carga del usuario de LotW que se acepta como usuario actual de LotW.</p></body></html> <html><head/><body><p>Ajusta este cuadro de selección para establecer la última fecha de subida de logs del usuario de LoTW.</p></body></html> - + Days since last upload Días desde última subida - + days dias - + Advanced Avanzado - + <html><head/><body><p>User-selectable parameters for JT65 VHF/UHF/Microwave decoding.</p></body></html> <html><head/><body><p>Parámetros seleccionables por el usuario para decodificación JT65 VHF/UHF/Microondas.</p></body></html> - + JT65 VHF/UHF/Microwave decoding parameters - Parámetros de decodificación JT65 VHF/UHF/Microondas Parámetros decodificación JT65 VHF/UHF/Microondas - + Random erasure patterns: Patrones de borrado aleatorio: - + <html><head/><body><p>Maximum number of erasure patterns for stochastic soft-decision Reed Solomon decoder is 10^(n/2).</p></body></html> - <html><head/><body><p>El número máximo de patrones de borrado para el decodificador estoico de decisión suave Reed Solomon es 10^(n/2).</p></body></html> <html><head/><body><p>El número máximo de patrones de borrado para el decodificador linear Reed Solomon es 10^(n/2).</p></body></html> - + Aggressive decoding level: Nivel de decodificación agresivo: - + <html><head/><body><p>Higher levels will increase the probability of decoding, but will also increase probability of a false decode.</p></body></html> - <html><head/><body><p>Los niveles más altos aumentarán la probabilidad de decodificación, pero también aumentarán la probabilidad de una decodificación falsa.</p></body></html> <html><head/><body><p>Los niveles más altos aumentarán la probabilidad de decodificación, pero también aumentarán la probabilidad de una falsa decodificación.</p></body></html> - + Two-pass decoding - Decodificación de dos pasos Decodificación en dos pasos Special operating activity: Generation of FT4, FT8, and MSK144 messages - Actividad operativa especial: generación de mensajes FT4, FT8 y MSK144 Actividad operativa especial: Generación de mensajes FT4, FT8 y MSK144 - + <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> - <html><head/><body><p>Modo FT8 DXpedition: operador Hound llamando al DX.</p></body></html> <html><head/><body><p>Modo FT8 DXpedition: Operador "Hound" llamando al DX.</p></body></html> - - + + Hound "Hound" - + <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> - <html><head/><body><p>Concursos norteamericanos de VHF/UHF/microondas y otros en los que se requiere un locator de 4 caracteres.</p></body></html> <html><head/><body><p>Concursos VHF/UHF/Microondas de norteamérica y otros en los cuales se requiere un intercambio de locator de 4 caracteres.</p></body></html> - + NA VHF Contest Concurso NA VHF - + <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> - <html><head/><body><p>Modo FT8 DXpedition: operador FOX (DXpedition).</p></body></html> <html><head/><body><p>Modo FT8 DXpedition: Operador "FOX" (DXpedition).</p></body></html> - - + + Fox - Fox "Fox" - + <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> - <html><head/><body><p>Concursos europeos de VHF y superiores que requieren un informe de señal, número de serie y locator de 6 caracteres.</p></body></html> <html><head/><body><p>Concursos europeos de VHF y concursos que requieran reporte de señal, número de serie y locator de 6 caracteres.</p></body></html> - - + + EU VHF Contest - Concurso EU de VHF Concurso EU VHF <html><head/><body><p>ARRL RTTY Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> - <html><head/><body><p>Resumen de ARRL RTTY y concursos similares. El intercambio es el estado de EE.UU., La provincia canadiense o &quot;DX&quot;.</p></body></html> <html><head/><body><p>ARRL RTTY Roundup y concursos similares. Intercambio, estado de EE.UU., provincia de Canadá o "DX".</p></body></html> - R T T Y Roundup - R T T Y Roundup + R T T Y Roundup RTTY Roundup messages - Mensajes de resumen de RTTY Mensajes para el RTTY Roundup - RTTY Roundup exchange - Intercambio RTTY Roundup + Intercambio RTTY Roundup RTTY RU Exch: Intercambio RTTY RU: - + NJ NJ - - + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> - <html><head/><body><p>Intercambio de ARRL Field Day: número de transmisores, clase y sección ARRL/RAC o &quot;DX&quot;.</p></body></html> <html><head/><body><p>Intercambiio para el ARRL Field Day: número de transmisores, "Class" y sección ARRL/RAC o "DX".</p></body></html> - A R R L Field Day - A R R L Field Day + A R R L Field Day - + + ARRL Field Day ARRL Field Day - + + Field Day exchange Intercambio "Field Day" - + FD Exch: Intercambio FD: - + 6A SNJ 6A SNJ - + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> - <html><head/><body><p>Concurso World-Wide Digi-mode</p><p><br/></p></body></html> <html><head/><body><p>Concurso World-Wide Digi DX</p><p><br/></p></body></html> - WW Digital Contest - WW Digital Contest + WW Digital Contest - + + WW Digi Contest - Concurso WW Digi Concurso WW Digi DX - + Miscellaneous - Diverso Otros - + Degrade S/N of .wav file: Degradar S/N del archivo .wav: - - - For offline sensitivity tests - Para pruebas de sensibilidad fuera de línea + + + For offline sensitivity tests + Para pruebas de sensibilidad fuera de línea + + + + + dB + dB + + + + Highlight also messages with 73 or RR73 + Resaltar también los mensajes con 73 o RR73 + + + <html><head/><body><p>Highlight callsigns or grids with orange background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> + <html><head/><body><p>Resaltar indicativos o locators con fondo naranja. Los indicativos y/o locators deben estar separados por comas y debe haber una coma después de cada indicativo.</p></body></html> + + + + Highlight orange: + Resaltar naranja: + + + <html><head/><body><p>Highlight callsigns or grids with blue background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> + <html><head/><body><p>Resaltar indicativos o locators con fondo azul. Los indicativos y/o locators deben estar separados por comas y debe haber una coma después de cada indicativo.</p></body></html> + + + + Highlight blue: + Resaltar azul: + + + + http://lotw.arrl.org/lotw-user-activity.csv + http://lotw.arrl.org/lotw-user-activity.csv + + + + CTY File Download + Descargar archivo CTY + + + + CTY File Version: + Versión archivo CTY: + + + + Download Latest CTY.dat + Descargar último CTY.dat + + + + CALL3 File Download + Descargar archivo CALL3 + + + + CALL3 File Version: + Versión archivo CALL3 + + + + Dowload latest CALL3.TXT file. + Descargar último archivo CALL3.TXT. + + + + Download CALL3.TXT for terrestrial use + Descargar CALL3.TXT para uso terrestre + + + + Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. + Descargue el archivo CALL3.TXT más reciente para EME. Esta versión es compatible JT65.Deep Search. + + + + Download CALL3.TXT for EME + Descargar CALL3.TXT para EME + + + + GUI tweaks for high-resolution monitors + Ajustes GUI para monitores de alta resolución + + + + <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> + <html><head/><body><p>El escalado HighDPI permite mostrar los controles con mayor tamaño y proporciones más correctas en monitores 4K (si el sistema operativo lo admite).</p></body></html> + + + + HighDPI scaling (restart required) + Escalado HighDPI (requiere reiniciar) + + + + <html><head/><body><p>Increased height of some control elements.</p></body></html> + <html><head/><body><p>Aumentar la altura de algunos elementos de control.</p></body></html> + + + + Increased height of the tab widget (restart required) + Se aumentó la altura de la pestaña widget (se requiere reiniciar) + + + Enable Cloudlog Features + Habilitar funciones de Cloudlog + + + + API URL: + Enlace de la API: + + + + API Key: + Clave API: + + + Station ID: + ID estación: + + + <html><head/><body><p>Test the Cloudlog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> + <html><head/><body><p>Probar la clave API de Cloudlog.</p><p>El botón se pondrá verde si la clave API permite escritura, naranja si es de solo lectura y rojo si la clave API no es válida.</p></body></html> + + + Test API Key + Probar clave API + + + + Special operating activity + Actividad operativa especial + + + + <html><head/><body><p>ARRL International Digital Contest</p></body></html> + <html><head/><body><p>ARRL International Digital Contest</p></body></html> + + + + ARRL Digi Contest + ARRL Digi Contest + + + + <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> + <html><head/><body><p>Activar/desactivar el protocolo de mensajes cortos NCCC Sprint FT4.</p></body></html> + + + + NCCC Sprint + NCCC Sprint + + + + + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> + <html><head/><body><p>FT Roundup y concursos similares. El intercambio es el estado de EE. UU., la provincia canadiense o &quot;DX&quot;.</p></body></html> + + + + + FT Roundup messages + Mensajes FT Roundup + + + + FT RU Exch: + Intercambio FT RU: + + + + <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> + <html><head/><body><p>Marque esta casilla para transmitir (Fox) o recibir (Hound) la forma de onda SuperFox.</p></body></html> + + + + SuperFox mode + Modo SuperFox + + + + <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> + <html><head/><body><p>Mostrar los mensajes OTP en la ventana Actividad de banda.</p></body></html> + + + + Show OTP messages + Mostrar mensaje OTP + + + + OTP URL: + Enlace OTP: + + + + <html><head/><body><p>URL used to verify OTP codes.</p></body></html> + <html><head/><body><p>URL utilizada para verificar los códigos OTP.</p></body></html> + + + + https://www.9dx.cc + https://www.9dx.cc + + + + NA VHF + NA VHF + + + + <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> + <html><head/><body><p>Haga clic para habilitar el método OTP de verificación de Fox. Requiere conexión a Internet.</p></body></html> + + + + OTP + OTP + + + + Key: + Clave: + + + + <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> + <html><head/><body><p>Clave de Fox para generar códigos OTP.</p></body></html> + + + + M2ZUU5CW6EVOY2HU + M2ZUU5CW6EVOY2HU + + + + Interval + Intervalo + + + + <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> + <html><head/><body><p>Intervalo con el que se envían los mensajes OTP. Seleccione 1 para firmar cada mensaje.</p></body></html> + + + + <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> + + <html><head/><body><p>Llamar CQ con un nombre de concurso específico en lugar de TEST, RU o WW (por ejemplo, CQ PACC).</p></body></html> + + + + + CQ with individual contest name + CQ con nombre de concurso individual + + + + Contest name: + Nombre del concurso: + + + + <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> + <html><head/><body><p>Intercambiar un locator de 4 caracteres en lugar del reporte de señal. Proporciona sensibilidades de nivel q3 al operador DX. Especialmente útil para DXpediciones EME en 6 m.</p></body></html> - - - dB - dB + + Q65 Pileup + Q65 Pileup - - Highlight also messages with 73 or RR73 - + + Receiver bandwidth: + Ancho de banda del receptor: - - - <html><head/><body><p>Highlight callsigns or grids with orange background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> + + Change or reset colors for the selected highlighting rule. - - Highlight orange: + + Move the selected highlighting rule earlier in priority order. - - - <html><head/><body><p>Highlight callsigns or grids with blue background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> + + Move Up - - Highlight blue: + + Move the selected highlighting rule later in priority order. - - http://lotw.arrl.org/lotw-user-activity.csv + + Move Down - - CTY File Download + + Reset Highlighting to Default 1 - - CTY File Version: + + Reset Highlighting to Default 2 - - Download Latest CTY.dat + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with orange background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> - - CALL3 File Download - Descargar archivo CALL3 - - - - CALL3 File Version: - Versión archivo CALL3 + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with blue background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + - - Dowload latest CALL3.TXT file. + + LotW users CSV URL - - Download CALL3.TXT for terrestrial use + + + <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> - - Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. + + Cloudlog or Wavelog - - Download CALL3.TXT for EME + + + Upload QSOs to Cloudlog or Wavelog - - GUI tweaks for high-resolution monitors + + + <html><head/><body><p>API URL for Cloudlog or Wavelog.</p></body></html> - - <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> + + + <html><head/><body><p>Your API key.</p></body></html> - - HighDPI scaling (restart required) + + + <html><head/><body><p>Your Cloudlog or Wavelog station profile.</p></body></html> - - <html><head/><body><p>Increased height of some control elements.</p></body></html> + + Station profile: - - Increased height of the tab widget (restart required) + + <html><head/><body><p>Check the Cloudlog or Wavelog connection, API key, station profile, and upload path where safe.</p><p>The button will turn green if the connection can upload QSOs, orange if the key is valid but read-only, and red if the configuration is unusable.</p></body></html> - - Enable Cloudlog Features + + Check Connection - - API URL: - Enlace de la API: + + Hz + Hz - - API Key: - Clave API: + + Tx delay: + Retardo de TX: - - Station ID: - + + Minimum delay between assertion of PTT and start of Tx audio. + Retraso mínimo entre el PTT y el inicio del audio TX. - - <html><head/><body><p>Test the Cloudlog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> - + + s + s - - Test API Key - + + + Tone spacing + Espaciado de tono - - Special operating activity - + + <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> + <html><head/><body><p>Genera audio de TX con el doble del espaciado del tono normal. Destinado a transmisores especiales de LF/MF que usan una división por 2 antes de generar RF.</p></body></html> - - <html><head/><body><p>ARRL International Digital Contest</p></body></html> + + 2x tone spacing - - ARRL Digi Contest - ARRL Digi Contest + + x 2 + x 2 - - <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> - + + <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> + <html><head/><body><p>Genera audio de TX con cuatro veces el espaciado de tono normal. Destinado a transmisores especiales de LF/MF que usan una división por 4 antes de generar RF.</p></body></html> - - NCCC Sprint + + 4x tone spacing - - - <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> - + + x 4 + x 4 - - FT Roundup messages - + + + Waterfall spectra + Cascada (Waterfall) - - FT RU Exch: - + + Low sidelobes + Lóbulos laterales bajos - - <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> - + + Most sensitive + Más sensible - - SuperFox mode + + + <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> - - <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> + + eQSL.cc - - Show OTP messages + + + Upload QSOs to eQSL.cc - - OTP URL: + + + <html><head/><body><p>Your username.</p></body></html> - - <html><head/><body><p>URL used to verify OTP codes.</p></body></html> + + Username: - - https://www.9dx.cc + + + <html><head/><body><p>Your logon password.</p></body></html> - - NA VHF + + Password: - - <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> + + + <html><head/><body><p>Your QTH nickname, if you have more than one QTH.</p></body></html> - - OTP + + QTH: - - Key: + + + Enable special operating activity - - <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> + + Enable OTP verification - - M2ZUU5CW6EVOY2HU + + + OTP key - - Interval + + + OTP interval - - <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> + + + OTP URL - - <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> - + + + FT Roundup exchange - - CQ with individual contest name + + + Contest name - - Contest name: - Nombre del concurso: + + Alerts + Alertas - - <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> + + NOTES - - Q65 Pileup + + "Wanted callsigns, grids, prefixes and directional calls" uses the entries from "Highlight orange" and "Highlight blue". - - Receiver bandwidth: - Ancho de banda del receptor: - - - - Hz - Hz - - - - Tx delay: - Retardo de TX: - - - - Minimum delay between assertion of PTT and start of Tx audio. - Retraso mínimo entre el PTT y el inicio del audio TX. - - - - s - s - - - - - Tone spacing - Espaciado de tono - - - - <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> - <html><head/><body><p>Genera el audio de TX con el doble del espaciado de tono normal. Destinado a transmisores especiales de LF/MF que usan una división por 2 antes de generar RF.</p></body></html> - <html><head/><body><p>Genera audio de TX con el doble del espaciado del tono normal. Destinado a transmisores especiales de LF/MF que usan una división por 2 antes de generar RF.</p></body></html> - - - - x 2 - x 2 + + <html><head/><body><p>Wanted callsigns, grids, prefixes and directional calls. This alert category uses the entries from &quot;Highlight orange&quot; and &quot;Highlight blue&quot;.</p></body></html> + - - <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> - <html><head/><body><p>Genera el audio de TX con cuatro veces el espaciado de tono normal. Destinado a transmisores especiales de LF/MF que usan una división por 4 antes de generar RF.</p></body></html> - <html><head/><body><p>Genera audio de TX con cuatro veces el espaciado de tono normal. Destinado a transmisores especiales de LF/MF que usan una división por 4 antes de generar RF.</p></body></html> + + Wanted callsigns, grids, prefixes and directional calls + - - x 4 - x 4 + + IMPORTANT + - - - Waterfall spectra - Espectros de la cascada - Cascada (Waterfall) + + Voices: + - - Low sidelobes - Lóbulos laterales bajos + + default + - - Most sensitive - Más sensible + + <html><head/><body><p>Test the alert sounds.</p></body></html> + - - Alerts - Alertas + + Test + - + Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. - + Las categorías de alerta situadas sobre la línea requieren que esté marcada la casilla «Mostrar DXCC, locator y estado de trabajado anteriormente» en la pestaña General. - THIS FEATURE IS FOR EXPERIENCED USERS ONLY - + ESTA FUNCIÓN ES SOLO PARA USUARIOS EXPERIMENTADOS - + Ensure that you have made meaningful settings on the Colors tab, so that you see which message triggered the alert. - + Asegúrese de haber realizado configuraciones significativas en la pestaña Colores, para que pueda ver qué mensaje activó la alerta. - + Ensure that your rig is NOT connected via "Default Device". - + Asegúrese de que su equipo NO esté conectado mediante «Dispositivo predeterminado». - + Audio Alerts Alertas de audio - - + + New ITU Zone on Band - Nueva zona ITU en banda + Nueva zona ITU en banda - - + + New Continent - Nuevo continente + Nuevo continente - - + + DX Call or DX Grid in message - + Indicativo DX o Locato DX en el mensaje - - + + New Grid - Nuevo locator + Nuevo locator - - + + New Continent on Band - Nuevo continente en banda + Nuevo continente en banda - + Message received - + Mensaje recibido - - + + New ITU Zone - Nueva zona ITU + Nueva zona ITU - - + + New CQ Zone - Nueva zona CQ + Nueva zona CQ - - + + New DXCC on Band - Nuevo DXCC en banda + Nuevo DXCC en banda - + My Call in message - Mi indicativo en el mensaje + Mi indicativo en el mensaje - + My Call - + Mi indicativo - - + + New CQ Zone on Band - Nueva zona CQ en banda + Nueva zona CQ en banda - - + + New DXCC - Nuevo DXCC + Nuevo DXCC - - + + New Grid on Band - Nuevo locator en banda + Nuevo locator en banda - - + + CQ in message - CQ en el mensaje + CQ en el mensaje - + Toggle Audio Alerts on/off. Alerts will be played on "DefaultAudioDevice". DON'T ENABLE AUDIO ALERTS WHEN YOUR RIG IS CONNECTED VIA THIS SOUNDCARD !!! - + Activar/desactivar las alertas de audio. Las alertas se reproducirán en «DefaultAudioDevice». ¡NO ACTIVE LAS ALERTAS DE AUDIO CUANDO SU EQUIPO ESTÉ CONECTADO MEDIANTE ESTA TARJETA DE SONIDO! - + Enable Audio Alerts - + Habilitar alertas de audio - + This requirement is fulfilled when your rig is connected via USB audio. - + Este requisito se cumple cuando el equipo está conectado mediante audio USB. - + Audio Alerts will be played on the default audio device (usually the loudspeaker of your PC). - + Las alertas de audio se reproducirán en el dispositivo de audio predeterminado (normalmente, los altavoces del PC). - IMPORTANT NOTES - + NOTAS IMPORTANTES - + Use of this feature requires that your computer is equipped with two sound cards. - + El uso de esta función requiere que el ordenador disponga de dos tarjetas de sonido. - + Filters - + Filtros - + Territories 1-4 for the Hide checkboxes in the View menu - + Territorios 1-4 para las casillas Ocultar del menú Ver - + Blacklist Lista negra - + Filters for the Band Activity window - + Filtros para la ventana Actividad de banda - + Hide messages containing the following callsigns or keywords: - + Ocultar mensajes que contengan los siguientes indicativos o palabras clave: - + Show only messages containing the following callsigns or keywords: - + Mostrar sólo mensajes que contengan los siguientes indicativos o palabras clave: - + <html><head/><body><p>Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed).</p></body></html> - + <html><head/><body><p>Usar filtros solo para Wait and Pounce, CQ: First, etc. (se siguen mostrando todos los mensajes).</p></body></html> - + Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed) - + Usar filtros solo para Wait and Pounce, CQ: First, etc. (se siguen mostrando todos los mensajes) - + Always pass messages with the following keywords: - + Permitir siempre los mensajes con las siguientes palabras clave: - + Whitelist - + Lista permitidos - + <html><head/><body><p>Apply filters only to the callsigns of the calling stations. Usually the second word of the messages is analyzed, for directional calls the third word.</p></body></html> - + <html><head/><body><p>Aplicar los filtros solo a los indicativos de las estaciones que llaman. Normalmente se analiza la segunda palabra de los mensajes; en las llamadas direccionales, la tercera.</p></body></html> - + Apply filters only to the callsigns of the calling stations - + Aplicar filtros solo a los indicativos de las estaciones que llaman - + Always Pass - + Permitir siempre - + <html><head/><body><p>Use “worked today and yesterday” instead of “worked today” for the 3 related Quick Filters.</p></body></html> - + <html><head/><body><p>Usar «trabajado hoy y ayer» en lugar de «trabajado hoy» para los 3 filtros rápidos relacionados.</p></body></html> - + Quick Filters: Hide/Ignore/Highlight "worked today and yesterday" instead of "worked today" (UTC) - + Filtros rápidos: Ocultar/Ignorar/Resaltar «trabajado hoy y ayer» en lugar de «trabajado hoy» (UTC) - + <html><head/><body><p>Discard (Cancel) or apply (OK) configuration changes including</p><p>resetting the radio interface and applying any soundcard changes</p></body></html> - <html><head/><body><p>Descartar (Cancelar) o aplicar (OK) cambios de configuración/ajuste que incluyen</p><p>restablecer la interfaz de radio y aplicar cualquier cambio en la tarjeta de sonido</p></body></html> <html><head/><body><p>"Aceptar" o "Cancelar" cambios de configuración, incluyendo el restablecer la interface de radio y aplicar cualquier cambio en la tarjeta de sonido</p></body></html> @@ -11086,22 +13298,18 @@ Clic derecho para insertar y eliminar opciones. Where <rig-name> is for multi-instance support. - Dónde <rig-name> es para soporte de múltiples instancias. Dónde <rig-name> es para soporte múlti instancias. rig-name - No se puede traducir esta parte, es parte del código rig-name Where <configuration> is an existing one. - Dónde <configuration> es ya existente. Dónde <configuration> es una ya existente. configuration - Ajustes configuración @@ -11110,12 +13318,10 @@ Clic derecho para insertar y eliminar opciones. language - Idioma idioma Writable files in test location. Use with caution, for testing only. - Archivos grabables en la ubicación de prueba. Usa con precaución, solo para pruebas. Archivos escribibles en la ubicación de prueba. Usa con precaución, solo para pruebas. @@ -11131,63 +13337,118 @@ Clic derecho para insertar y eliminar opciones. Versión de la aplicación + Another instance may be running - Otra instancia puede estar ejecutándose + Otra instancia puede estar ejecutándose try to remove stale lock file? - ¿intentas eliminar el archivo de bloqueo obsoleto? ¿intentar eliminar el archivo de bloqueo? - + + Lock file: %1 + + + + + Owner process: %1 + + + + + Owner application: %1 + + + + + Owner host: %1 + + + + + Owner information is not available. + + + + + Remove error: %1 + + + + + WSJT-X could not lock its temporary instance file. + +If another WSJT-X window is still running, choose No. +Use a unique rig name to run more than one instance. + +If WSJT-X crashed or will not restart, choose Remove Lock File. +Choose Retry after closing the other instance. + + + + + Remove Lock File + + + + + Unable to remove stale lock file + + + + + Close any running WSJT-X instance or remove the lock file manually after confirming WSJT-X is not running. + + + + Failed to create a temporary directory Error al crear un directorio temporal - - + + Path: "%1" Ruta: "%1" - + Failed to create a usable temporary directory - Error al crear un directorio temporal utilizable Error al crear un directorio temporal - + Another application may be locking the directory Otra aplicación puede estar bloqueando el directorio - + Failed to create data directory Error al crear el directorio de datos - + path: "%1" ruta: "%1" - + Shared memory error Error de memoria compartida - + Unable to create shared memory segment No se puede crear un segmento de memoria compartida - + Sub-process error Error en subproceso - + Failed to close orphaned jt9 process No se pudo cerrar los procesos huerfanos de JT9 @@ -11202,7 +13463,6 @@ Clic derecho para insertar y eliminar opciones. <html><head/><body><p>Double click a color to edit it.</p><p>Right click to insert or delete colors.</p><p>Colors at the top represent weak signals</p><p>and colors at the bottom represent strong</p><p>signals. You can have up to 256 colors.</p></body></html> - <html><head/><body><p>Haz doble clic en un color para editarlo.</p><p>Haz clic derecho para insertar o eliminar colores.</p><p>Los colores en la parte superior representan señales débiles</p><p>y los colores en la parte inferior representan señales fuertes</p><p>Puedes tener hasta 256 colores.</p></body></html> <html><head/><body><p>Doble clic en un color para editarlo.</p><p>Clic derecho para insertar o eliminar colores.</p><p>Los colores en la parte superior representan señales débiles</p><p>y los colores en la parte inferior representan señales fuertes</p><p>Puedes utilizar hasta 256 colores.</p></body></html> diff --git a/translations/wsjtx_hu.ts b/translations/wsjtx_hu.ts index 49dbb2f6..e750b407 100644 --- a/translations/wsjtx_hu.ts +++ b/translations/wsjtx_hu.ts @@ -4,7 +4,7 @@ AbstractLogWindow - + &Delete ... Törlés ... @@ -12,136 +12,292 @@ AbstractLogWindow::impl - + Confirm Delete Törlés megerősítése - + Are you sure you want to delete the %n selected QSO(s) from the log? Biztos, hogy törölni akarja a %n kiválasztott QSO(ka)t a naplóból? + + ActiveStations + + + Message Averaging + Üzenet átlagolás + + + + Band Changes: + + + + + <html><head/><body><p>Total score accumulated since most recent reset of Cabrillo log.</p></body></html> + + + + + + + 0 + + + + + <html><head/><body><p>Points logged during the past hour.</p></body></html> + + + + + <html><head/><body><p>Check this box to show only stations ready to be called.</p></body></html> + + + + + Ready only + + + + + # Wanted only + + + + + Score: + + + + + Rate: + Arány: + + + + <html><head/><body><p>Set maximum elapsed number of T/R sequences.</p></body></html> + + + + + Max Age + + + + + <html><head/><body><p>Set maximum number of displayed lines.</p></body></html> + + + + + Max N + + + + + <html><head/><body><p>Number of band changes during the past hour.</p></body></html> + + + + + <html><head/><body><p>Click on a line to call that station. </p><p>When using QMAP, single click to transfer QSO data and sked frequency to WSJT-X, and double click to call that station.</p></body></html> + + + + + Active Stations + + + + + Wanted only + + + + + Message + Üzenet + + + + My call only + + + Astro - - + + Doppler tracking Doppler követés - + <html><head/><body><p>One station does all Doppler shift correction, their QSO partner receives and transmits on the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>Az egyik állomás végzi a Doppler-eltolódás korrekcióját, a QSO partnere pedig a sked (megbeszélt) frekvencián vesz és ad.</p><p>Ha a rig nem fogadja el a CAT QSY parancsokat adás közben, akkor egyetlen korrekció lesz alkalmazva a teljes adási időszakra.</p></body></html> - + Full Doppler to DX Grid Teljes Doppler a DX-QRA-hoz - + <html><head/><body><p>Transmit takes place on sked frequency and receive frequency is corrected for own echoes. </p><p>This mode can be used for calling CQ, or when using Echo mode.</p></body></html> <html><head/><body><p>Az adás a sked (megbeszélt) frekvencián történik, a vételi frekvencia pedig korrigálva van a saját visszhangok számára. </p><p>Ez a mód használható CQ hívásra, vagy ha Echo üzemmódot használunk.</p></body></html> - + Own Echo Saját Echo - + <html><head/><body><p>Both stations correct for Doppler shift such that they would be heard on the moon at the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p><p>Use this option also for Echo mode.</p></body></html> <html><head/><body><p>Mindkét állomás korrigálja a Doppler-eltolódást, hogy a Holdról a sked frekvencián hallható legyen.</p><p>Ha a rig adás közben nem fogadja el a CAT QSY parancsokat, akkor egyetlen korrekció lesz alkalmazva a teljes adási időszakra.</p><p>Ezt az opciót használja Echo üzemmódban is.</p></body></html> - + Constant frequency on Moon Konstans frekvencia a Holdra - + <html><head/><body><p>DX station announces their TX Freq, which is entered as the Sked Freq. Correction applied to RX and TX so you appear on the DX's station's own echo Freq.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>A DX állomás bejelenti a TX Frekvenciáját, amelyet Sked Frekvenciaként írunk be. RX és TX korrekció lesz végrehajtva, így Ön a DX állomás saját visszhang Frekvenciáján jelenik meg.</p><p>Ha a rig nem fogadja el a CAT QSY parancsokat adás közben, akkor egyetlen korrekció lesz alkalmazva a teljes adási időszakra.</p></body></html> - + On DX Echo A DX Echo-ján - + <html><head/><body><p>Tune radio manually and select this mode to put your echo on the same frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>Hangolja a rádiót kézzel, és válassza ezt a módot, hogy az Ön visszhangját ugyanerre a frekvenciára állítsa.</p><p>Ha a rig nem fogadja el a CAT QSY parancsokat adás közben, akkor egyetlen korrekció lesz alkalmazva a teljes adási időszakra.</p></body></html> - + Call DX DX Hívójel - + <html><head/><body><p>No Doppler shift correction is applied. This may be used when the QSO partner does full Doppler correction to your grid square.</p></body></html> <html><head/><body><p>Nem történik Doppler-eltolódás korrekció. Ezt akkor használhatja, ha a QSO partnere teljes Doppler korrekciót végez az Ön QRA-négyzetéhez.</p></body></html> - + None Nincs - + Sked frequency Sked frekvencia - - + + 0 - + + kHz + + + + + Set kHz + + + + + <html><head/><body><p>Tx shift relative to Rx sked frequency</p></body></html> + + + + + MHz + + + + + Tx Shift + + + + + Enable + + + + + Echo Mode + + + + + Hz + Hz + + + + RIT + + + + + Dither + + + + + Ctl-Lock Sked Freq + + + + Rx: Rx: - + Tx: Tx: - <html><head/><body><p>Press and hold the CTRL key to adjust the sked frequency manually with the rig's VFO dial or enter frequency directly into the band entry field on the main window.</p></body></html> - <html><head/><body><p>Nyomja meg és tartsa lenyomva a CTRL billentyűt a sked frekvencia kézi beállításához a rig VFO tárcsájával, vagy írja be a frekvenciát közvetlenül a főablak sávbeviteli mezőjébe.</p></body></html> + <html><head/><body><p>Nyomja meg és tartsa lenyomva a CTRL billentyűt a sked frekvencia kézi beállításához a rig VFO tárcsájával, vagy írja be a frekvenciát közvetlenül a főablak sávbeviteli mezőjébe.</p></body></html> - + Astro Data Astro Data - + Astronomical Data Csillagászati adatok - Doppler Tracking Error - Doppler követési hiba + Doppler követési hiba - Split operating is required for Doppler tracking - A Doppler-követéshez osztott (split) működésre van szükség. + A Doppler-követéshez osztott (split) működésre van szükség. - Go to "Menu->File->Settings->Radio" to enable split operation - Menjen a "Menü->Fájl->Beállítások->Rádió" menüpontba az osztott (split) működés engedélyezéséhez. + Menjen a "Menü->Fájl->Beállítások->Rádió" menüpontba az osztott (split) működés engedélyezéséhez. @@ -193,45 +349,44 @@ CPlotter - &Set Rx && Tx Offset - Rx && Tx offset beállítása + Rx && Tx offset beállítása CabrilloLog - + Freq(MHz) Freq(MHz) - + Mode Mode - + Date & Time(UTC) Date & Time(UTC) - + Call Call - + Sent Sent - + Rcvd Rcvd - + Band Band @@ -253,6 +408,11 @@ Right-click here for available actions. Kattintson ide a jobb egérgombbal a rendelkezésre álló műveletekért. + + + 0 QSOs + + CallsignDialog @@ -262,6 +422,166 @@ + + Cloudlog + + + + QSO could not be sent to Cloudlog. + + + + + + QSO upload was rejected by Cloudlog. + + + + + HTTP status %1. Response was not JSON. + + + + + Cloudlog returned an unexpected upload response. + + + + + Cloudlog reported upload status: %1 + + + + + HTTP status %1. + + + + + Cloudlog::impl + + + Enter a Cloudlog or Wavelog URL. + + + + + The connection check needs a base URL before it can contact the API. + + + + + Cloudlog or Wavelog authentication endpoint was not found. + + + + + Tried /api/check_auth, /index.php/api/check_auth, and /index.php/api/auth. + + + + + API key is valid but read-only. + + + + + Generate a read/write API key before enabling QSO uploads. + + + + + API key is invalid. + + + + + Authentication response was not usable. + + + + + Station profile response was not JSON. + + + + + Configured station profile was not found. + + + + + No station profiles were returned by the server. + + + + + Available station profiles: %1 + + + + + Wavelog dry-run QSO endpoint was not found. + + + + + Tried /api/qso/true and /index.php/api/qso/true after Wavelog was identified. + + + + + Dry-run upload response was not usable. + + + + + + Connection check passed. + + + + + Writable API key, station profile, and dry-run QSO upload were validated. + + + + + Dry-run QSO upload was rejected. + + + + + + The QSO dry-run upload was rejected. + + + + + Dry-run QSO upload returned an unexpected response. + + + + + Writable API key and station profile were validated. No safe dry-run QSO endpoint was identified, so no test QSO was uploaded. + + + + + Network error while checking Cloudlog or Wavelog. + + + + + Cloudlog Error! + + + + + Reason: %1 + + + ColorHighlighting @@ -368,75 +688,320 @@ Configuration::impl - - - + + + &Delete Törlés - - + + &Insert ... Beillesztés… - + + Wanted territory %1 + + + + + Blacklist keyword %1 + + + + + Whitelist keyword %1 + + + + + Always pass keyword %1 + + + + + CAT control port + + + + + CAT baud rate + + + + + Default CAT data bits + + + + + Seven CAT data bits + + + + + Eight CAT data bits + + + + + Default CAT stop bits + + + + + One CAT stop bit + + + + + Two CAT stop bits + + + + + Default CAT handshake + + + + + No CAT handshake + + + + + XON/XOFF CAT handshake + + + + + Hardware CAT handshake + + + + + Force DTR control line + + + + + Force RTS control line + + + + + VOX PTT method + + + + + DTR PTT method + + + + + CAT PTT method + + + + + RTS PTT method + + + + + PTT control port + + + + + Rear or data transmit audio source + + + + + Front or mic transmit audio source + + + + + No radio mode control + + + + + USB radio mode + + + + + Data or packet radio mode + + + + + No split operation + + + + + Rig split operation + + + + + Fake It split operation + + + + + CAT poll interval + + + + + Frequency calibration slope + + + + + Frequency calibration intercept + + + + + Working frequencies table + + + + + Station information table + + + + + Decode highlighting rules + + + + + Highlighting rules and priorities for decoded messages. + + + + + Decode highlighting actions + + + + + Change or reset colors for the selected highlighting rule. + + + + + Move selected highlighting rule up + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move selected highlighting rule down + + + + + Move the selected highlighting rule later in priority order. + + + + + Orange highlight callsigns and grids + + + + + Blue highlight callsigns and grids + + + + Failed to create save directory A mentési könyvtár létrehozása sikertelen - + path: "%1% út: "%1% - + Failed to create samples directory A minták könyvtár létrehozása sikertelen - + path: "%1" út: "%1" - + &Load ... Betöltés ... - + &Save as ... Mentés másként ... - + &Merge ... Összevonás ... - + &Reset &Reset - + Serial Port: COM Port: - + Serial port used for CAT control CAT-vezérléshez használt soros port - + + TCI Server: + + + + + Optional hostname and port of TCI service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port + + + + Network Server: Hálózati Szerver: - + Optional hostname and port of network service. Leave blank for a sensible default on this machine. Formats: @@ -451,12 +1016,12 @@ Formátumok: [IPv6-address]:port - + USB Device: USB eszköz: - + Optional device identification. Leave blank for a sensible default for the rig. Format: @@ -467,173 +1032,237 @@ Formátum: [VID[:PID[:VENDOR[:PRODUCT]]]] - - + + Invalid audio input device Helytelen audió bemeneti eszköz - + Invalid audio output device Helytelen audió kimeneti eszköz - + Invalid PTT method Helytelen PTT módszer - + Invalid PTT port Helytelen PTT port - - + + Invalid Contest Exchange Helytelen Verseny Kontrol-szám - + You must input a valid ARRL Field Day exchange A kontrol-számot az ARRL Field Day-nek megfelelően kell megadni - + You must input a valid ARRL RTTY Roundup exchange A kontrol-számot az ARRL RTTY Roundup-nek megfelelően kell megadni - + Pending DNS lookup, please try again later DNS-keresés függőben, próbálja meg később újra - + + Reset Decode Highlighting Dekódolás kiemelten jelölés Reset - - Reset all decode highlighting and priorities to default values - Az összes dekódolási kiemeltenjelölés és prioritás alapértelmezett értékre történő visszaállítása + + Reset all decode highlighting and priorities to Default 1 values + - - WSJT-X Decoded Text Font Chooser - WSJT-X dekódolt szöveg betűtípus választó + + Reset all decode highlighting and priorities to Default 2 values + - - UDP server DNS lookup failed - Az UDP-szerver DNS-keresése sikertelen + + Error Loading CTY.DAT + - - MAC-ambiguous multicast groups addresses not supported - A nem egyértelmű MAC-címmel rendelkező multicast csoportcímek nem támogatottak + + Error Loading CALL3.TXT file + - + + + + Frequency files (*.qrg *.qrg.json);;All files (*.*) + + + + Reset all decode highlighting and priorities to default values + Az összes dekódolási kiemeltenjelölés és prioritás alapértelmezett értékre történő visszaállítása + + + + WSJT-X Decoded Text Font Chooser + WSJT-X dekódolt szöveg betűtípus választó + + + + + Hamlib update only available on Windows. + + + + + Error Loading libhamlib-4.dll + + + + + Hamlib Update successful + +New Hamlib will be used after restart + + + + + Hamlib successfully reverted + +Reverted Hamlib will be used after restart + + + + + No Hamlib update found that could be reverted + + + + + Error in network address + + + + + UDP server DNS lookup failed + Az UDP-szerver DNS-keresése sikertelen + + + + MAC-ambiguous multicast groups addresses not supported + A nem egyértelmű MAC-címmel rendelkező multicast csoportcímek nem támogatottak + + + Load Working Frequencies Munkafrekvenciák betöltése - - - Frequency files (*.qrg);;All files (*.*) - Frekvencia fájlok (*.qrg);;Minden fájl (*.*) + Frekvencia fájlok (*.qrg);;Minden fájl (*.*) - + Replace Working Frequencies Munkafrekvenciák kicserélése - + Are you sure you want to discard your current working frequencies and replace them with the loaded ones? Biztos, hogy el akarja távolítani a jelenlegi munkafrekvenciákat, és lecseréli ezeket a betöltöttekkel? - + Merge Working Frequencies Munkafrekvenciák összevonása - - - + + Error reading frequency file + + + + + + Not a valid frequencies file Helytelen frekvencia fájl - + Incorrect file magic Helytelen fájlformátum - + Version is too new Verzió fejlesztés alatt - + Contents corrupt A tartalom sérült - + Save Working Frequencies Munkafrekvenciák mentése - + Only Save Selected Working Frequencies Csak a kiválasztott munkafrekvenciák mentése - + Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. Biztos, hogy csak az aktuálisan kiválasztott munkafrekvenciákat szeretné elmenteni? Kattintson a Nem gombra az összes mentéséhez. - + Reset Working Frequencies Munkafrekvenciák visszaállítása - + Are you sure you want to discard your current working frequencies and replace them with default ones? Biztos, hogy el akarja távolítani a jelenlegi munkafrekvenciákat, és lecseréli ezeket az alapértelmezettekre? - + Save Directory Mentési könyvtár - + AzEl Directory AzEl könyvtár - + Rig control error Rig vezérlési hiba - + Failed to open connection to rig Hiba az adó-vevőhöz való csatlakozáskor - + Rig failure Az adó-vevő nem válaszol - + Not found audio device missing audio eszköz hiányzik @@ -665,68 +1294,74 @@ Formátum: A DX Lab Suite Commander nem reagált helyesen a TX állapotának lekérdezésére: - DX Lab Suite Commander rig did not respond to PTT: - A DX Lab Suite Commander rig nem reagált a PTT-re: + A DX Lab Suite Commander rig nem reagált a PTT-re: - + + Transceiver did not respond to PTT On/Off quickly enough; +reduce DX Lab Suite Commander's 'Command Interval' setting +or contact DXLab support at DXLab@groups.io. + + + + DX Lab Suite Commander didn't respond correctly polling frequency: A DX Lab Suite Commander nem reagált helyesen a frekvencia lekérdezésére: - + DX Lab Suite Commander didn't respond correctly polling TX frequency: A DX Lab Suite Commander nem reagált helyesen a TX frekvencia lekérdezésére: - + DX Lab Suite Commander sent an unrecognised split state: A DX Lab Suite Commander egy ismeretlen osztott (split) állapotot küldött: - + DX Lab Suite Commander didn't respond correctly polling split status: A DX Lab Suite Commander nem reagált helyesen az osztott (split) állapot lekérdezésére: - + DX Lab Suite Commander sent an unrecognised mode: " A DX Lab Suite Commander egy ismeretlen üzemmódot küldött: " - + DX Lab Suite Commander didn't respond correctly polling mode: A DX Lab Suite Commander nem reagált helyesen az üzemmód lekérdezésére: - + DX Lab Suite Commander send command failed A DX Lab Suite Commander parancsküldés sikertelen - + DX Lab Suite Commander send command failed "%1": %2 A DX Lab Suite Commander "%1" parancs küldése sikertelen: %2 - + DX Lab Suite Commander send command "%1" read reply failed: %2 A DX Lab Suite Commander "%1" küldött parancsára a válasz sikertelen volt: %2 - + DX Lab Suite Commander retries exhausted sending command "%1" A DX Lab Suite Commander újra megpróbálja elküldeni a megszakadt "%1" parancsot - + DX Lab Suite Commander sent an unrecognized frequency A DX Lab Suite Commander egy helytelen frekvenciát küldött @@ -739,32 +1374,32 @@ Formátum: Elülső szín ... - + Choose %1 Foreground Color Válassza ki a %1 elülső színt - + &Unset foreground color Alap elülső szín - + &Background color ... Háttérszín ... - + Choose %1 Background Color Válassza ki a %1 háttérszínt - + U&nset background color Alap háttérszín - + &Reset this item to defaults Ezt az elemet visszaállítja az alapértelmezettre @@ -772,97 +1407,97 @@ Formátum: DecodeHighlightingModel - + CQ in message CQ az üzenetben - + My Call in message Saját hívójel az üzenetben - + Transmitted message Adás üzenet - + New DXCC Új DXCC - + New DXCC on Band Új DXCC a Sávban - + New Grid Új QRA - + New Grid on Band Új QRA a Sávban - + New Call Új Hívójel - + New Call on Band Új Hívójel a Sávban - + New Continent Új Kontinens - + New Continent on Band Új Kontinens a Sávban - + New CQ Zone Új CQ Zóna - + New CQ Zone on Band Új CQ Zóna a Sávban - + New ITU Zone Új ITU Zóna - + New ITU Zone on Band Új ITU Zóna a Sávban - + LoTW User LoTW felhasználók - + f/g unset - + b/g unset - + Highlight Type Kiemelés típusa @@ -870,41 +1505,56 @@ Formátum: Designer - + &Delete Törlés - + &Insert ... Beillesztés… - + Insert &after ... Beillesztés ezután ... - + Import Palette Paletta importálása - - + + Palettes (*.pal) Paletták (*.pal) + Import Palette Failed + + + + Export Palette Paletta exportálása + + + Export Palette Failed + + + + + Error writing waterfall palette file "%1": %2. + Hiba a "%1" vízesés paletta fájl írásakor: %2. + Dialog - + Gray time: Szürkületi idő: @@ -1007,16 +1657,31 @@ Hiba: %2 - %3 DisplayText - + &Erase Törlés + + + Return to live activity + + + + + Return to the live activity position + + + + + Live activity is paused while earlier entries are visible. + + EchoGraph - + Echo Graph Echo-grafikon @@ -1051,32 +1716,37 @@ Hiba: %2 - %3 <html><head/><body><p>Nulla echospektrum. (eltolás)</p></body></html> - + + Baseline + + + + <html><head/><body><p>Smoothing of echo spectrum</p></body></html> <html><head/><body><p>A kirajzolt visszhangspektrum finomítása</p></body></html> - + Smooth Finomítás - + <html><head/><body><p>Number of echo transmissions averaged</p></body></html> <html><head/><body><p>Az átlagolt visszhangadások száma</p></body></html> - + N: 0 - + <html><head/><body><p>Click to cycle through a sequence of colors and line widths.</p></body></html> <html><head/><body><p>A gombra kattintva a színek és vonalszélességek között váltogathat.</p></body></html> - + Colors Színek @@ -1084,7 +1754,7 @@ Hiba: %2 - %3 EmulateSplitTransceiver - + Emulated split mode requires rig to be in simplex mode Az emulált osztott (split) mód megköveteli, hogy a rig szimplex módban legyen. @@ -1171,12 +1841,12 @@ Hiba: %2 - %3 ExistingNameDialog - + Configuration to Clone From Konfiguráció a klónozáshoz - + &Source Configuration Name: Az eredeti konfiguráció neve: @@ -1314,7 +1984,7 @@ Hiba: %2 - %3 FastGraph - + Fast Graph Gyors-grafikon @@ -1344,35 +2014,210 @@ Hiba: %2 - %3 Auto szint + + FileDownload + + + Network Error - SSL/TLS support not installed, cannot fetch: +'%1' + Hálózati hiba - SSL/TLS támogatás nincs telepítve, nem lehet lekérni: +'%1' + + + + Network Error - Too many redirects: +'%1' + Hálózati hiba - Túl sok átirányítás: +'%1' + + + + Network Error: +%1 + Hálózati hiba: +%1 + + + + FixtureAudioInput + + + Synthetic audio input has no detector sink. + + + + + Synthetic FT8 audio input requires a downsample factor of 1 or 4. + + + + + Synthetic JTTY audio input requires a downsample factor of 1 or 4. + + + + + Synthetic audio input requires the mono input channel. + + + + + Unable to open synthetic audio fixture %1: %2 + + + + + Synthetic audio fixture must be mono, signed 16-bit little-endian PCM. + + + + + Synthetic audio fixture must be %1 Hz for downsample factor %2; found %3 Hz. + + + + + Synthetic FT8 audio fixture must contain exactly %1 frames; found %2. + + + + + Synthetic JTTY audio fixture must contain complete PCM frames. + + + + + Unable to read all PCM data from synthetic audio fixture. + + + + + Synthetic audio input does not yet support big-endian hosts. + + + + + Unable to initialize the detector for synthetic audio input. + + + + + Synthetic audio fixture ready + + + + + Synthetic audio input suspended + + + + + Synthetic audio input receiving + + + + + Detector accepted %1 of %2 synthetic PCM bytes. + + + + + Synthetic audio fixture exhausted + + + + + FixtureSoundOutput + + + Synthetic audio output requires a readable source. + + + + + Synthetic audio output requires a capture path. + + + + + Synthetic audio output does not yet support big-endian hosts. + + + + + Synthetic audio output received an unsupported source frame size. + + + + + Unable to open synthetic audio output capture %1: %2 + + + + + Synthetic audio output received a partial captured frame. + + + + + Synthetic FT8 audio output exceeded its 15-second capture period. + + + + + Synthetic audio output wrote %1 of %2 capture bytes: %3 + + + + + Synthetic audio output source disappeared during capture. + + + + + Synthetic FT8 audio output continued beyond its 15-second capture period. + + + + + Synthetic audio output received %1 of %2 source bytes. + + + + + Synthetic audio output received an invalid source byte count. + + + FoxLog::impl - + Date & Time(UTC) - + Call Hívójel - + Grid QRA - + Sent - + Rcvd - + Band Sáv @@ -1397,7 +2242,7 @@ Hiba: %2 - %3 - + N @@ -1411,6 +2256,11 @@ Hiba: %2 - %3 Rate: Arány: + + + <html><head/><body><p>Last 10: Average rate (QSOs/hour) for the last 10 QSOs.<br/>Last 100: Average rate (QSOs/hour) for the last 100 QSOs. <br/>Last 60m: Average rate (QSOs/hour) for the last 60 minutes.</span></p></body></html> + + &Export ADIF ... @@ -1452,139 +2302,405 @@ Hiba: %2 - %3 Biztos, hogy törölni akarja a FoxQSO.txt fájlt, és egy új Fox naplót akar indítani? + + FrequencyDeltaLineEdit + + + Offset in MHz + + + + + Frequency offset in MHz + + + + + Enter a frequency offset in MHz. + + + FrequencyDialog - + Add Frequency Frekv hozzáadása - + IARU &Region: IARU &Region: - + &Mode: Üzemmód: - + &Frequency (MHz): Frekvencia (MHz): + + + &Preferred for Band/Mode: + + + + + &Description: + + + + + &Enable Date Range: + + + + + S&tart: + + + + + &End: + + + + + &Source: + + + + + Invalid Date Range + + + + + Start date must be before end date + + + + + FrequencyLineEdit + + + + Frequency in MHz + + + + + Enter a positive frequency in MHz. + + FrequencyList_v2 - - IARU Region - IARU Region + IARU Region - - Mode - Üzemmód + Üzemmód + + + Frequency + Frekvencia + + + Frequency (MHz) + Frekvencia (MHz) + + + + FrequencyList_v2_101 + + + + IARU Region + IARU Region + + + + + Mode + - - + + Frequency - Frekvencia + Frekvencia - - + + Frequency (MHz) - Frekvencia (MHz) + Frekvencia (MHz) + + + + + Description + + + + + + Source + + + + + Start Time + + + + + End Time + + + + + + Pref + + + + + Start Date/Time + + + + + End Date/Time + + + + + Failed to parse JSON file + + + + + Information Missing + + + + + No Frequencies were found + + + + + Loaded Frequencies from %1 + + + + + Entries Valid/Skipped %1 + + + + + Ft8TxLoopbackTestController + + + Timed out after 60 seconds. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + The FT8 output stream did not start exactly once. + + + + + The FT8 Auto control was not found. + + + + + Disabling Auto stopped the active FT8 transmission. + + + + + Synthetic output reported non-silent FT8 audio more than once. + + + + + The FT8 capture did not stop exactly once at the requested path. + + + + + Synthetic audio output failed: %1 + + + + + A required FT8 transmit GUI control was not found. + + + + + The application did not enter FT8 mode. + + + + + Unable to configure the requested FT8 transmission. + + + + + The FT8 transmit controls disappeared before transmission. + + + + + Unable to start the synthetic FT8 transmission. + + + + + The FT8 Auto control disappeared before retry. + + + + + The FT8 output lifecycle was not one start, non-silent transmission, and natural stop. + + + + + FT8 audio began at frame %1; expected %2 +/- %3 frames. + + + + + The FT8 capture file was not created or is empty: %1 + + + + + Unable to reopen FT8 capture %1: %2 + + + + + The FT8 capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The FT8 capture must contain exactly %1 frames; file=%2 reported=%3. + + + + + Unexpected modal window: %1 + HRDTransceiver - - + + Failed to connect to Ham Radio Deluxe Nem sikerült csatlakozni a Ham Radio Deluxe-hoz - + Failed to open file "%1": %2. Nem sikerült megnyitni a "%1" fájlt: %2. - - + + Ham Radio Deluxe: no rig found Ham Radio Deluxe: nem található rig - + Ham Radio Deluxe: rig doesn't support mode Ham Radio Deluxe: a rig nem támogatja az üzemmódot - + Ham Radio Deluxe: sent an unrecognised mode Ham Radio Deluxe: küldött egy ismeretlen üzemmódot - + Ham Radio Deluxe: item not found in %1 dropdown list Ham Radio Deluxe: az elem nem található a %1 legördülő listában - + Ham Radio Deluxe: button not available Ham Radio Deluxe: gomb nem áll rendelkezésre - + Ham Radio Deluxe didn't respond as expected A Ham Radio Deluxe nem a várt módon reagált - + Ham Radio Deluxe: rig has disappeared or changed Ham Radio Deluxe: a rig hiányzik vagy megváltoztatták - + Ham Radio Deluxe send command "%1" failed %2 Ham Radio Deluxe "%1" elküldött parancsa sikertelen %2 - - + + Ham Radio Deluxe: failed to write command "%1" Ham Radio Deluxe: a "%1" parancs az íráshoz sikertelen volt - + + Ham Radio Deluxe sent an invalid reply to our command "%1": %2 + + + Ham Radio Deluxe sent an invalid reply to our command "%1" - A Ham Radio Deluxe érvénytelen választ küldött a "%1" parancsunkra + A Ham Radio Deluxe érvénytelen választ küldött a "%1" parancsunkra - + Ham Radio Deluxe failed to reply to command "%1" %2 A Ham Radio Deluxe nem válaszolt a "%1" %2 parancsra - + Ham Radio Deluxe retries exhausted sending command "%1" A Ham Radio Deluxe újra megpróbálja elküldeni a megszakadt "%1" parancsot - + Ham Radio Deluxe didn't respond to command "%1" as expected A Ham Radio Deluxe nem a várt módon reagált a "%1" parancsra @@ -1592,180 +2708,182 @@ Hiba: %2 - %3 HamlibTransceiver - - + + Hamlib initialisation error Hamlib inicializálási hiba - + Hamlib settings file error: %1 at character offset %2 Hamlib-beállítási fájl hiba: %1, a %2 karaktereltolásnál - + Hamlib settings file error: top level must be a JSON object Hamlib beállítási fájl hiba: a legfelső szintnek egy JSON objektumnak kell lennie - + Hamlib settings file error: config must be a JSON object Hamlib beállítási fájl hiba: a config-nak egy JSON objektumnak kell lennie - + Unsupported CAT type Nem támogatott CAT-típus - + Hamlib error: %1 while %2 Hamlib hiba: %1 amíg %2 - + opening connection to rig jelenlegi kapcsolat az adó-vevővel - + getting current frequency aktuális frekvencia lekérése - + getting current mode aktuális üzemmód lekérése - - + + exchanging VFOs VFO-k cseréje - - + + getting other VFO frequency másik VFO frekvencia lekérése - + getting other VFO mode másik VFO üzemmód lekérése - - + + setting current VFO aktuális VFO beállítása - + getting frequency frekvencia lekérése - + getting mode üzemmód lekérése - - - + + + getting current VFO aktuálisi VFO választása - - - - + + + + getting current VFO frequency aktuális VFO frekvencia lekérése - - - - - - + + + + + + setting frequency frekvencia beállítása - - - - + + + + getting current VFO mode aktuális VFO üzemmód lekérése - - - - - + + + + + setting current VFO mode aktuális VFO üzemmód beállítása - - + + setting/unsetting split mode osztott üzemmód beállítása/feloldása - - + + setting split mode osztott (split) üzemmód beállítása - + setting split TX frequency and mode osztott TX frekvencia és üzemmód beállítása - + setting split TX frequency osztott TX frekvencia beállítása - + getting split TX VFO mode osztott TX VFO üzemmód lekérése - + setting split TX VFO mode osztott TX VFO üzemmód beállítása - + getting PTT state PTT állapot lekérése - + setting PTT on PTT aktiválása - + + setting PTT off PTT deaktiválása - + setting a configuration item konfigurációs elem beállítása - + + getting a configuration item konfigurációs elem lekérése @@ -1799,6 +2917,322 @@ Hiba: %2 - %3 IARU Region + + JttyTxLoopbackTestController + + + Timed out after 60 seconds. + + + + + JTTY request %1 was accepted more than once. + + + + + JTTY request %1 was rejected with reason %2. + + + + + JTTY request %1 completed more than once. + + + + + More than one JTTY transmit session drained. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + JTTY output stream restarted more than once. + + + + + Synthetic output reported non-silent playback more than once. + + + + + Synthetic output stopped the wrong capture path: %1 + + + + + JTTY output stream stopped more than once. + + + + + Synthetic audio output failed: %1 + + + + + The JTTY mode action was not found. + + + + + The application did not enter JTTY mode. + + + + + The JTTY encoder did not produce a valid test waveform extent. + + + + + The first JTTY text request was not accepted synchronously. + + + + + Non-silent playback began before the first request was accepted. + + + + + The output stream restarted or stopped before the gapless append. + + + + + The gapless append occurred before one second of real playback. + + + + + The second JTTY text request was not accepted during playback. + + + + + Appending the second JTTY message restarted or stopped playback. + + + + + The accepted-request set did not contain exactly both submitted messages. + + + + + JTTY text requests were not accepted in submission order. + + + + + The completed-request set did not contain exactly both submitted messages. + + + + + JTTY text requests did not complete in FIFO order. + + + + + The output stream lifecycle was not one start, one drain, and one stop. + + + + + The captured JTTY session contains an unexpected internal audio gap. + + + + + The JTTY capture file was not created or is empty: %1 + + + + + Unable to reopen JTTY capture %1: %2 + + + + + The JTTY capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The JTTY capture has an invalid PCM extent: file frames=%1, expected audio frames=%2, reported frames=%3. + + + + + Unexpected modal window: %1 + + + + + LiveAudioTestController + + + Timed out after 110 seconds. + + + + + Timed out after 100 seconds. + + + + + Decoder backend failed: %1 + + + + + JTTY display did not settle to the expected text after input ended. + + + + + Synthetic audio source failed: %1 + + + + + Unable to open expected decode file %1: %2 + + + + + Expected decode file %1 contains no messages. + + + + + Unable to open expected JTTY text file %1: %2 + + + + + Expected JTTY text file %1 contains no messages. + + + + + A required FT8 decoder or monitoring GUI control was not found. + + + + + Unable to configure the %1-%2 Hz waterfall decode range. + + + + + Unable to prepare the complete FT8 fixture decode. + + + + + Unable to configure the FT8 multithreaded decoder as requested. + + + + + Monitor did not enter the active state. + + + + + Synthetic input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic audio source. + + + + + A required JTTY mode, monitoring, or decode display control was not found. + + + + + The JTTY GUI action did not select JTTY mode. + + + + + Monitor did not enter the active state for JTTY. + + + + + Synthetic JTTY input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic JTTY audio source. + + + + + The expected early standard and final configured MTD decoder invocations were not both observed. + + + + + The configured MTD invocation produced no decoder output. + + + + + live MTD missing: %1 + + + + + processed missing: %1 + + + + + display missing: %1 + + + + + Reference-message validation failed: %1; live MTD output: %2; processed output: %3 + + + + + Decoder messages were processed but none reached the GUI display path. + + + + + The expected JTTY messages did not reach both panes in FIFO order. + + + + + The expected JTTY message reached both panes without an observed growing prefix. + + + + + Unexpected modal window: %1 + + + LogQSO @@ -1863,155 +3297,278 @@ Hiba: %2 - %3 Tx power - - - + + <html><head/><body><p>Add comment to the comments list.</p></body></html> + + + + + Add + Hozzáad + + + + + + + + Retain Megőriz - + Comments Megjegyzések - + Operator Operátor - + Exch sent Kontr.szám küld - + Rcvd Vett - + Prop Mode Terjedési mód - + + Sat Mode + + + + + RX Frequency + + + + Aircraft scatter Repülőgép scatter - + Aurora-E Aurora-E - + Aurora Aurora - + Back scatter Back scatter - + Echolink Echolink - + Earth-moon-earth Föld-Hold_Föld - + Sporadic E Sporadic E - + F2 Reflection F2 Visszaverődés - + Field aligned irregularities Térben létrejövő egyenetlenségek - + Internet-assisted Internetes támogatás - + Ionoscatter Ionoszférikus visszaverődés - + IRLP IRLP - + Meteor scatter Meteor scatter - + Non-satellite repeater or transponder Nem műholdas átjátszó vagy transzponder - + Rain scatter Csapadék scatter - + + Tropospheric ducting + + + + + A + + + + + B + + + + + BS + + + + + JA + + + + + JD + + + + + K + + + + + KA + + + + + KT + + + + + L + + + + + LS + + + + + LU + + + + + LX + + + + + S + + + + + SX + + + + + T + + + + + US + + + + + UV + + + + + VS + + + + + VU + + + + + Satellite Műhold - + Trans-equatorial Transz-ekvatoriális - Troposheric ducting - Troposzférikus csatorna + Troposzférikus csatorna - - + + Invalid QSO Data Helytelen QSO adat - + Check exchange sent and received Küldött és vett kontrol-szám ellenőrzés - + Check all fields Minden mező ellenőrzése - + Log file error Log fájl hiba - + Cannot open "%1" for append A "%1" nem nyitható meg a hozzáadáshoz - + Error: %1 Hiba: %1 @@ -2019,48 +3576,42 @@ Hiba: %2 - %3 LotWUsers::impl - Network Error - SSL/TLS support not installed, cannot fetch: '%1' - Hálózati hiba - SSL/TLS támogatás nincs telepítve, nem lehet lekérni: + Hálózati hiba - SSL/TLS támogatás nincs telepítve, nem lehet lekérni: '%1' - Network Error - Too many redirects: '%1' - Hálózati hiba - Túl sok átirányítás: + Hálózati hiba - Túl sok átirányítás: '%1' - Network Error: %1 - Hálózati hiba: + Hálózati hiba: %1 - File System Error - Cannot commit changes to: "%1" - Fájlrendszer hiba - Nem lehet végrehajtani a módosításokat a következőkben: + Fájlrendszer hiba - Nem lehet végrehajtani a módosításokat a következőkben: "%1" - File System Error - Cannot open file: "%1" Error(%2): %3 - Fájlrendszer hiba - A fájl nem nyitható meg: + Fájlrendszer hiba - A fájl nem nyitható meg: "%1" Hiba(%2): %3 - File System Error - Cannot write to file: "%1" Error(%2): %3 - Fájlrendszer hiba - Nem lehet írni a fájlba: + Fájlrendszer hiba - Nem lehet írni a fájlba: "%1" Hiba(%2): %3 @@ -2068,4582 +3619,8872 @@ Hiba(%2): %3 MainWindow - WSJT-X by K1JT - WSJT-X by K1JT - - - - - - - - - + WSJT-X by K1JT + + + + + + + + + + + Band Activity Sáv-aktivítás - - + + UTC dB DT Freq Dr UTC dB DT Freq Dr - - - - - - + + + + + + + Rx Frequency Rx-frekvencia - + CQ only Csak CQ - + Enter this QSO in log Beírja ezt a QSO-t a naplóba. - + Log &QSO Log &QSO - + Stop monitoring Megállítja a vételt. - + &Stop &Stop - Toggle monitoring On/Off - Vétel be/ki kapcsolása. + Vétel be/ki kapcsolása. - + &Monitor Vétel - + <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> <html><head/><body><p>Törli a jobb oldali ablakot. Duplán rákattintva mindkét ablakot törli.</p></body></html> - + Erase right window. Double-click to erase both windows. Törli a jobb oldali ablakot. Duplán rákattintva mindkét ablakot törli. - + &Erase Törlés - + <html><head/><body><p>Clear the accumulating message average.</p></body></html> <html><head/><body><p>Törli a felgyülemlett üzenetátlag adatokat.</p></body></html> - + Clear the accumulating message average. Törli a felgyülemlett üzenetátlag adatokat. - + Clear Avg Átl.törlés - + <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> Újra dekódolja az utolsó RX-periódust, vagy az utoljára lejátszott hangfájlt (wav). <html><head/><body><p>A legutóbbi Rx periódus dekódolása a QSO frekvencián.</p></body></html> - + Decode most recent Rx period at QSO Frequency A legutóbbi Rx periódus dekódolása a QSO frekvencián. - + &Decode &Dekódolás - + <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> <html><head/><body><p>Tx automatikus be/ki kapcsolása.</p></body></html> - + Toggle Auto-Tx On/Off Tx automatikus be/ki kapcsolása. - + E&nable Tx Tx e&nged - + Stop transmitting immediately Azonnal leállítja az adást. - + &Halt Tx Tx Állj - <html><head/><body><p>Toggle a pure Tx tone On/Off</p></body></html> - <html><head/><body><p>Tiszta Tx hang Be/Ki kapcsolása. (Adó, végeősítő, antennahangoló hangolásához.)</p></body></html> + <html><head/><body><p>Tiszta Tx hang Be/Ki kapcsolása. (Adó, végeősítő, antennahangoló hangolásához.)</p></body></html> - + Toggle a pure Tx tone On/Off Tiszta Tx hang Be/Ki kapcsolása. (Adó, végeősítő, antennahangoló hangolásához.) Tiszta Tx hang Be/Ki kapcsolása. - + &Tune Hangolás - + + Menus Menük - + Decode other Hounds calling above 1000 Hz audio offset Dekódoljon más, 1000 Hz-es hangeltolás felett hívó Vadászokat. - + Enable auto response to the first decode from a new DXCC or new call on the current band. Engedélyezi az automatikus választ az első új DXCC vagy új hívójel dekódolására az aktuális sávban. - + F High F Felső - + F Low F Alsó - - 1/2 - + + WSJT-X by K1JT et al. + - - 2/2 - + + Band Activity decode pane title + - - 1/3 - + + Title for the Band Activity decoded messages pane. + - - 2/3 - + + Band Activity decoded messages headings + - - 3/3 - + + + Columns: UTC dB DT Freq Message. + - - 1/4 - + + Band Activity decoded messages + - - 2/4 - + + Decoded messages in the Band Activity pane. Columns: UTC dB DT Freq Message. + - - 3/4 - + + Rx Frequency decode pane title + - - 4/4 - + + Title for the Rx Frequency decoded messages pane. + - - 1/5 - + + Rx Frequency decoded messages headings + - - 2/5 - + + Rx Frequency decoded messages + - - 3/5 - + + Decoded messages in the Rx Frequency pane. Columns: UTC dB DT Freq Message. + - - 4/5 - + + Check to display received messages in lower case. + - - 5/5 - + + Lower case + - - 1/6 - + + Include Time + - - 2/6 - + + 15 + - - 3/6 - + + 17 + - - 4/6 - + + 23 + - - 5/6 - + + + + 10 + - - 6/6 - + + + + + 6 + - - Percentage of minute sequences devoted to transmitting. - Az adásra fordított percek százalékos aránya. + + 33 + - - Prefer Type 1 messages - 1.típusú üzenetek választása + + + 70 + - - <html><head/><body><p>Transmit during the next sequence.</p></body></html> - <html><head/><body><p>Adás a következő sorozat során.</p></body></html> + + 80 + - - Q65 - + + 10G + - - SWL Mode - SWL mód + + 40 + - - Hide lower panel controls to maximize deocde windows - Az alsó panel vezérlőelemeinek elrejtése a dekódoló ablakok maximalizálásához. + + 60 + - - USB dial frequency - A Rádió USB frekvenciájának kijelzése. + + 13 + - - 14.078 000 - + + 24G + - - <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> - <html><head/><body><p>30dB ajánlott, ha csak zaj van jelen<br/>Zöld, ha jó<br/>Piros, ha túlvezérlés várható<br/>Sárga, ha túl alacsony</p></body></html> + + + 4 + - - Rx Signal - + + + 8 + - - 30dB recommended when only noise present -Green when good -Red when clipping may occur -Yellow when too low - 30dB ajánlott, ha csak zaj van jelen -Zöld, ha jó -Piros, ha túlvezérlés várható -Sárga, ha túl alacsony + + 1.25 + - - DX Call - DX Hívójel + + 30 + - - DX Grid - DX QRA + + 160 + - - Callsign of station to be worked - Ellenállomás hívójele + + 20 + - - Search for callsign in database - Hívójel keresése az adatbázisban. + + 5G + - - &Lookup - Keresés + + + + 9 + - - Locator of station to be worked - Ellenállomás QRA lokátora + + + 12 + - - Az: 251 16553 km - + + CQ messages only. + - - Add callsign and locator to database - Hívójel és lokátor hozzáadása az adatbázishoz. + + Bypass Filters toggled via Settings or the Filters menu. + - - Add - Hozzáad + + BP + - - Pwr - Pwr + + <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> + - - <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> - <html><head/><body><p>Ha a kör narancssárga vagy piros, a CAT vezérlés nem működik. Próbálja meg a körre kattintva resetelni, szinkronizálni az adó-vevő vezérlését, ellenőrizze, hogy az adó-vevő megfelelően van-e csatlakoztatva a számítógéphez, ellenőrizze az adó-vevő beállításait, konfigurálja újra a CAT-ot a WSJT-X-ben. A körben levő S osztott (Split) módot jelent.</p></body></html> + + Avg + - - If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. - Ha a kör narancssárga vagy piros, a CAT vezérlés nem működik. Próbálja meg a körre kattintva szinkronizálni az adó-vevő vezérlését, ellenőrizze, hogy az adó-vevő megfelelően van-e csatlakoztatva a számítógéphez, ellenőrizze az adó-vevő beállításait, konfigurálja újra a CAT-ot a WSJT-X-ben. + + <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> + - - ? - + + <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> + - - Adjust Tx audio level - A Tx szint hanggal történő beállítása + + <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> + - - <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> - <html><head/><body><p>Válassza ki a működési sávot, vagy adja meg a frekvenciát MHz-ben, vagy adja meg a lépésközt kHz-ben megnyomva utána a k billentyűt.</p></body></html> + + <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> + - - Frequency entry - + + <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> + - - Select operating band or enter frequency in MHz or enter kHz increment followed by k. - Válassza ki a működési sávot, vagy adja meg a frekvenciát MHz-ben, vagy adja meg a lépésközt kHz-ben megnyomva utána a k billentyűt. + + Ignore + - - <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> - <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> + + Pwr + - - <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> - <html><head/><body><p>Jelölje be a négyzetet, hogy a Tx-frekvencia rögzítve maradjon, amikor duplán kattint a dekódolt szövegre.</p></body></html> + + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the strongest station's reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the weakest station's reply to your CQ.</p><p>When CQ or QRZ is pending, Enable Tx may be armed before or during a receive period. Only eligible direct callers decoded after it is armed in that period can replace the pending transmission; earlier callers are not retained.</p></body></html> + - - Check to keep Tx frequency fixed when double-clicking on decoded text. - Jelölje be a négyzetet, hogy a Tx-frekvencia rögzítve maradjon, amikor duplán kattint a dekódolt szövegre. + + + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> + - - Hold Tx Freq - Tx frekv.marad + + <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> + - - Audio Rx frequency - Audio Rx frekvencia + + 15C + - - - - - - Hz - Hz + + <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> + - - - Rx - Rx + + 15A + - - - Set Tx frequency to Rx Frequency - Tx frekvencia beállítása az Rx frekvenciára + + <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> + - - ▲ - + + 30B + - - Frequency tolerance (Hz) - Frekvencia tűrés (Hz) + + <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> + - - - F Tol - + + 60C + - - - Set Rx frequency to Tx Frequency - Rx frekvencia beállítása a Tx frekvenciára + + <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> + - - ▼ - + + 60D + - - <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> - <html><head/><body><p>Szinkronizálási küszöbérték. Az alacsonyabb számok gyengébb szinkronizáló jeleket fogadnak el.</p></body></html> + + <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> + - - Synchronizing threshold. Lower numbers accept weaker sync signals. - Szinkronizálási küszöbérték. Az alacsonyabb számok gyengébb szinkronizáló jeleket fogadnak el. + + 60E + - - Sync - + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + - - <html><head/><body><p>Check to use short-format messages.</p></body></html> - <html><head/><body><p>Jelölje be, ha rövid formátumú üzeneteket szeretne használni.</p></body></html> + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + - - Check to use short-format messages. - Jelölje be, ha rövid formátumú üzeneteket szeretne használni. + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> + - - Sh - Sh + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + - - <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> - <html><head/><body><p>Jelölje be a JT9 gyors módok engedélyezéséhez.</p></body></html> + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + - - Check to enable JT9 fast modes - Jelölje be a JT9 gyors módok engedélyezéséhez. + + <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> + - - - Fast - Gyors + + Send msg + - - <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> - <html><head/><body><p>Bejelölésével engedélyezi, a vett üzenetek figyelembevételével, a Tx-üzenetek automatikus sorrendbe állítását.</p></body></html> + + <html><head/><body><p>Enter a free text message.</p></body></html> + - - Check to enable automatic sequencing of Tx messages based on received messages. - Bejelölésével engedélyezi, a vett üzenetek figyelembevételével, a Tx-üzenetek automatikus sorrendbe állítását. + + Free Text + - - Auto Seq - Auto-Vál. + + <html><head/><body><p>Select a specific CQ message.</p></body></html> + - - <html><head/><body><p>Check to call the first decoded responder to my CQ.</p></body></html> - <html><head/><body><p>Jelölje ezt be, hogy az Ön CQ-jára az első dekódolt válaszolót hívja meg.</p></body></html> + + Queue + - - Check to call the first decoded responder to my CQ. - Jelölje ezt be, hogy az Ön CQ-jára az itt kiválasztott első dekódolt válaszolót hívja meg. + + Allow Dupes + - - Call 1st - 1.Hívás + + <html><head/><body><p>Clear all queues.</p></body></html> + - - Check to generate "@1250 (SEND MSGS)" in Tx6. - Jelölje be az "@1250 (SEND MSGS)" létrehozásához a Tx6-ban. + + <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> + - - Tx6 - + + <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> + - - <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences.</p></body></html> - <html><head/><body><p>Jelölje be, hogy az adás a páros percekben vagy szekvenciákban történjen, kezdve 0-tól; páratlan szekvenciák esetén pedig törölje a jelölést.</p></body></html> + + Age + - - Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. - Jelölje be, hogy az adás a páros percekben vagy szekvenciákban történjen, kezdve 0-tól; páratlan szekvenciák esetén pedig törölje a jelölést. + + Continent + - - Tx even/1st - TX páros/1. + + Score + - - <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> - <html><head/><body><p>CQ hívás frekvenciája kHz-ben az aktuális MHz fölött</p></body></html> + + <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> + - - Frequency to call CQ on in kHz above the current MHz - CQ hívás frekvenciája kHz-ben az aktuális MHz fölött + + In Progress + - - Tx CQ - + + <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> + - - <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> - <html><head/><body><p>Jelölje be ezt, a CQ adáshoz a &quot;Tx CQ&quot; frekvencián. Az Rx az aktuális frekvencián lesz, és a CQ üzenet tartalmazza az aktuális Rx frekvenciát, hogy a hívók tudják, melyik frekvencián kell válaszolniuk.</p><p>Ez nem áll rendelkezésre a nem szabványos hívójelek tulajdonosai számára.</p></body></html> + + + + + 3 + - - Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. -Not available to nonstandard callsign holders. - Jelölje be ezt, a CQ adáshoz a Tx CQ frekvencián. Az Rx az aktuális frekvencián lesz, és a CQ üzenet tartalmazza az aktuális Rx frekvenciát, hogy a hívók tudják, melyik frekvencián kell válaszolniuk. -Ez nem áll rendelkezésre a nem szabványos hívójelek tulajdonosai számára. + + 70cm FT8 + - - Rx All Freqs - Rx Minden frekvencia + + 70cm + - - <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> - <html><head/><body><p>Az almód határozza meg a hangtávolságot; az A a legkeskenyebb.</p></body></html> + + 30m FT8 + - - Submode determines tone spacing; A is narrowest. - Az almód határozza meg a hangtávolságot; az A a legkeskenyebb. + + 30m + - - Submode - + + <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> + - - - Fox - + + Band Hopping + - - <html><head/><body><p>Check to monitor Sh messages.</p></body></html> - <html><head/><body><p>Jelölje be, hogy figyelhesse az Sh (rövid) üzeneteket.</p></body></html> + + 12m FT8 + - - Check to monitor Sh messages. - Jelölje be, hogy figyelhesse az Sh (rövid) üzeneteket. + + 12m + - - SWL - SWL + + 40m FT8 + - - Best S+P - Legjobb S+P + + 40m + - - <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> - <html><head/><body><p>Jelölje be ezt a kalibrálási adatok rögzítésének megkezdéséhez.<br/>Mérés közben a kalibrálási korrekció le van tiltva.<br/>Ha nincs bejelölve, akkor megtekintheti a kalibrálási eredményeket.</p></body></html> + + 2m MSK144 + - - Check this to start recording calibration data. -While measuring calibration correction is disabled. -When not checked you can view the calibration results. - Jelölje be ezt a kalibrálási adatok rögzítésének megkezdéséhez. -Mérés közben a kalibrálási korrekció le van tiltva. -Ha nincs bejelölve, akkor megtekintheti a kalibrálási eredményeket. + + 2m MSK + - - Measure - Mérés + + 10m FT8 + - - <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> - <html><head/><body><p>Jel riport: Jel-zaj viszony a 2500 Hz-es referencia-sávszélességben (dB).</p></body></html> + + 10m + - - Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). - Jel riport: Jel-zaj viszony a 2500 Hz-es referencia-sávszélességben (dB). + + 6m FT8 + - - Report - Riport + + 6m + - - <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> - <html><head/><body><p>Tx/Rx vagy Frekvencia kalibrációs sorozat hossza</p></body></html> + + 60m FT8 + - - Tx/Rx or Frequency calibration sequence length - Tx/Rx vagy Frekvencia kalibrációs sorozat hossza + + 60m + - - - s - + + 160m FT8 + - - - T/R - + + 160m + - - Audio Tx frequency - Audio Tx frekvencia + + 80m FT8 + - - - Tx - + + 80m + - - Tx# - + + 20m FT8 + - - 1 - + + 20m + - - - - Send this message in next Tx interval - Küldje ezt az üzenetet a következő Tx intervallumban. + + 17m FT8 + - - Ctrl+2 - + + 17m + - - <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> - <html><head/><body><p>Ezt a bejelölt üzenetet küldje el a következő Tx intervallumban</p><p>Dupla kattintással kapcsolja be a Tx1 üzenet használatát egy állomással való QSO indításához (nem engedélyezett az 1.típusú összetett hívójelesek számára)</p></body></html> + + 4m FT8 + - - Send this message in next Tx interval -Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) - Ezt a bejelölt üzenetet küldje el a következő Tx intervallumban -Dupla kattintással kapcsolja be a Tx1 üzenet használatát egy állomással való QSO indításához (nem engedélyezett az 1.típusú összetett hívójelesek számára) + + 4m + - - Ctrl+1 - + + 15m FT8 + - - - - - Switch to this Tx message NOW - Váltás erre a Tx üzenetre MOST + + 15m + - - Tx &2 - + + 2m FT8 + - - Alt+2 - + + 2m + - - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> - <html><head/><body><p>Váltson erre a Tx üzenetre MOST</p><p>Dupla kattintással kapcsolja be a Tx1 üzenet használatát egy állomással való QSO indításához (nem engedélyezett az 1.típusú összetett hívójelesek számára)</p></body></html> + + + 10m FT4 + - - Switch to this Tx message NOW -Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) - Váltson erre a Tx üzenetre MOST -Dupla kattintással kapcsolja be a Tx1 üzenet használatát egy állomással való QSO indításához (nem engedélyezett az 1.típusú összetett hívójelesek számára) + + + 12m FT4 + - - Tx &1 - + + + 15m FT4 + - - Alt+1 - + + + 17m FT4 + - - Ctrl+6 - + + + 20m FT4 + - - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> - <html><head/><body><p>Ezt a bejelölt üzenetet küldje el a következő Tx intervallumban</p><p>Kattintson rá duplán a szabványos 73-as üzenet visszaállításához</p></body></html> + + + 30m FT4 + - - Send this message in next Tx interval -Double-click to reset to the standard 73 message - Ezt a bejelölt üzenetet küldje el a következő Tx intervallumban -Kattintson rá duplán a szabványos 73-as üzenet visszaállításához + + + 40m FT4 + - - Ctrl+5 - + + + 80m FT4 + - - Ctrl+3 - + + FT8 QRG6 + - - Tx &3 - + + FT8 QRG1 + - - Alt+3 - + + FT8 QRG2 + - - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>Ezt a bejelölt üzenetet küldje el a következő Tx intervallumban</p><p>Dupla kattintással válthat a Tx4-ben az RRR és RR73 üzenetek között (2.típusú összetett hívójeleseknek nem megengedett)</p><p>RR73 üzeneteket csak akkor szabad használni, ha eléggé biztos abban, hogy nem lesz szükség üzenetismétlésre</p></body></html> + + FT8 QRG7 + - - Send this message in next Tx interval -Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) -RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - Ezt a bejelölt üzenetet küldje el a következő Tx intervallumban -Dupla kattintással válthat a Tx4-ben az RRR és RR73 üzenetek között (2.típusú összetett hívójeleseknek nem megengedett) -RR73 üzeneteket csak akkor szabad használni, ha eléggé biztos abban, hogy nem lesz szükség üzenetismétlésre. + + FT8 QRG8 in kHz. + - - Ctrl+4 - + + FT8 QRG5 + - - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>Váltson erre a Tx üzenetre MOST</p><p>Dupla kattintással válthat a Tx4-ben az RRR és RR73 üzenetek között (nem megengedett a 2.típusú összetett hívójelesek esetében)</p><p>RR73 üzeneteket csak akkor szabad használni, ha eléggé biztos benne, hogy nem lesz szükség üzenetismétlésre.</p></body></html> + + FT8 QRG3 + - - Switch to this Tx message NOW -Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) -RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - Váltson erre a Tx üzenetre MOST -Dupla kattintással válthat a Tx4-ben az RRR és RR73 üzenetek között (nem megengedett a 2.típusú összetett hívójelesek esetében) -RR73 üzeneteket csak akkor szabad használni, ha eléggé biztos benne, hogy nem lesz szükség üzenetismétlésre + + FT8 QRG4 + - - Tx &4 - + + FT8 QRG8 + - - Alt+4 - + + FT8 QRG7 in kHz. + - - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p></body></html> - <html><head/><body><p>Váltson erre a Tx üzenetre MOST</p><p>Kattintson duplán rá a szabványos 73-as üzenet visszaállításához</p></body></html> + + FT8 QRG6 in kHz. + - - Switch to this Tx message NOW -Double-click to reset to the standard 73 message - Váltson erre a Tx üzenetre MOST -Kattintson duplán rá a szabványos 73-as üzenet visszaállításához + + FT8 QRG5 in kHz. + - - Tx &5 - + + FT8 QRG4 in kHz. + - - Alt+5 - + + FT8 QRG3 in kHz. + - - Now - Most + + FT8 QRG2 in kHz. + - - Generate standard messages for minimal QSO - Szabványos üzenetek létrehozása a minimális QSO-hoz + + FT8 QRG1 in kHz. + - - Generate Std Msgs - Std Üzenet létrehozása + + GroupBox + - - Tx &6 - + + CQ %M CQ + - - Alt+6 - + + %H 599 %N + - - Enter a free text message (maximum 13 characters) -or select a predefined macro from the dropdown list. -Press ENTER to add the current text to the predefined -list. The list can be maintained in Settings (F2). - Írjon be egy tetszőleges szöveges üzenetet (maximum 13 karakter), -vagy válasszon egy előre meghatározott makrót a legördülő listából. -Nyomja meg az ENTER-t az aktuális szöveg hozzáadásához az előre -meghatározott listához. A listát a Beállításokban (F2) lehet karbantartani. + + %H TU CQ %M CQ + - - Queue up the next Tx message - A következő Tx üzenet sorbaállítása + + %M + - - Next - Következő + + %H + - - 2 - + + TU NOW %Q 599 %N + - - Quick-Start Guide to FST4 and FST4W - FST4 és FST4W Gyors útmutató + + %H AGN? + - - FST4 - + + 599 %N + - - FST4W - + + F1 + - - - CQ - + + HisCall Exchange + - - Grid - QRA + + F2 + - - Max dB - + + TU CQ + - - CQ AF - + + F3 + - - CQ AN - + + MyCall + - - CQ AS - + + F4 + - - CQ EU + + HisCall + + + + + F5 + + + + + Now QueuedCall Exchange + + + + + F6 + + + + + HisCall AGN ? + + + + + Exchange + + + + + Serial number of QSO for contest exchange. + + + + + Click to transmit a message. + + + + + Send message + + + + + Call next + + + + + Message to be transmitted + + + + + Serial Number + + + + + Callsign to be worked next. + + + + + 1/2 - - CQ NA + + 2/2 - - CQ OC + + 1/3 - - CQ SA + + 2/3 - - CQ 0 + + 3/3 - - CQ 1 + + 1/4 - - CQ 2 + + 2/4 - - CQ 3 + + 3/4 - - CQ 4 + + 4/4 - - CQ 5 + + 1/5 - - CQ 6 + + 2/5 - - CQ 7 + + 3/5 - - CQ 8 + + 4/5 - - CQ 9 + + 5/5 - - Reset + + 1/6 - - N List + + 2/6 - - N Slots + + 3/6 - - - - - - - - Random - Véletlen + + 4/6 + - - Call - Hívójel + + 5/6 + - - S/N (dB) + + 6/6 - - Distance - Távolság + + Percentage of minute sequences devoted to transmitting. + Az adásra fordított percek százalékos aránya. - - More CQs - Több CQ + + Prefer Type 1 messages + 1.típusú üzenetek választása - - - % - + + <html><head/><body><p>Transmit during the next sequence.</p></body></html> + <html><head/><body><p>Adás a következő sorozat során.</p></body></html> - - Tx Pct - + + Spacing + - - Band Hopping - Sáv ugrás + + Fixed Tone + - - Choose bands and times of day for band-hopping. - Sáv és napszakok választása a Sáv ugráshoz. + + K1JT + - - Schedule ... - Ütemezés … + + CW + - - Upload decoded messages to WSPRnet.org. - Feltöltil a dekódolt üzeneteket a WSPRnet.org -ra. + + Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. + - - Upload spots - Spot feltöltés + + H + - - <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> - <html><head/><body><p>A 6 számjegyű lokátorok 2 különböző üzenet küldését eredményezik, a második tartalmazza a teljes lokátort, de csak egy hashed (kivonatolt) hívójelet, ezért a többi állomásnak előbb dekódolnia kell az elsőt, mielőtt a másodikban dekódolhatnák az Ön hívójelét. Jelölje be ezt az opciót, hogy csak 4 számjegyű lokátorokat küldjön, ezzel elkerülhető a kétüzenetes protokoll.</p></body></html> + + Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. + - - 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. - A 6 számjegyű lokátorok 2 különböző üzenet küldését eredményezik, a második tartalmazza a teljes lokátort, de csak egy hashed (kivonatolt) hívójelet, ezért a többi állomásnak előbb dekódolnia kell az elsőt, mielőtt a másodikban dekódolhatnák az Ön hívójelét. Jelölje be ezt az opciót, hogy csak 4 számjegyű lokátorokat küldjön, ezzel elkerülhető a kétüzenetes protokoll. + + Switch to FT4 mode + - - No own call decodes - Saját hívás dekódolás nincs + + Switch to MSK144 mode + - - Tx Next - Tx következik + + MSK + - - Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. - Adja meg a Tx teljesítményt dBm-ben (1 mW-ra vonatkoztatva) a WSPR üzenet részeként. + + <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> + - - NB + + + Q65 - - Maximum drift rate in units of symbol rate per transmission. - Maximális elcsúszási (drift) sebesség a szimbólumsebesség egységében adásonként. + + <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> + - - Max Drift - + + <html><head/><body><p>Switch to Echo mode</p></body></html> + - - File - Fájl + + Filters + - - View - Nézet + + Parameters + - - Decode - Dekódolás + + Decoder sensitivity + - - Save - Mentés + + Decoder start + - - Help - Súgó + + Number of threads + - - Mode - Üzemmód + + QSO RX freq sensitivity + - - Configurations - Konfigurációk + + Decoding cycles + - - Tools - Eszközök + + Ctrl+X + - - Exit - Kilépés + + Alt+X + - - About WSJT-X - WSJT-X névjegy + + Remove saved files after 30 days + - - Waterfall - Vízesés + + Erase wsjtx.log + - - Open - Megnyit + + Erase Ignore List + - - Ctrl+O - + + SWL Mode + SWL mód - - Open next in directory - Következő megnyitása a könyvtárban + + Hide lower panel controls to maximize deocde windows + Az alsó panel vezérlőelemeinek elrejtése a dekódoló ablakok maximalizálásához. - - Decode remaining files in directory - A könyvtárban maradt fájlok dekódolása + + Don't split ALL.TXT + - - Shift+F6 - + + Split ALL.TXT yearly + - - Delete all *.wav && *.c2 files in SaveDir - Az összes *.wav és *.c2 fájl törlése a mentési könyvtárból (save-ból) + + Split ALL.TXT monthly + - - None - Nincs + + Disable writing of ALL.TXT + - - Save all - Összes mentése + + Active Stations + - - Online User Guide - Online Felhasználói kézikönyv + + Band Buttons + - - Keyboard shortcuts - Gyorsbillentyűk + + Use Dark Style + - - Special mouse commands - Speciális egérparancsok + + Reduce false decodes + - - JT9 - + + Default event logging + - - Save decoded - Dekódolás mentése (Rx szöveg) + + Diagnostic mode + - - Normal - Normál + + Disable event logging + - - Deep - Mély + + Quick-Start Guide to WSJT-X 2.7 and QMAP + - - Erase ALL.TXT - Az ALL.TXT fájl törlése + + How to deal with rig control errors + - - Erase wsjtx_log.adi - A wsjtx_log.adi, Napló fájl törlése ! + + <html><head/><body><p>How to deal with rig control errors.</p></body></html> + - - F7 - + + Erase list of Q65 callers + - - Runaway Tx watchdog - Lejárt a Tx időfigyelő ideje. + + SuperFox User Guide + - - JT65 - + + Message Creator + - - Astronomical data - Csillagászati adatok + + Hide stations worked before on band + - - List of Type 1 prefixes and suffixes - Az 1.típusú prefixek és suffixek listája + + Hide stations worked today or yesterday + - - Settings... - Beállítások... + + Hide stations from Ignore List + - - Local User Guide - Helyi Felhasználói kézikönyv + + Ignore stations worked today or yesterday + - - Open log directory - A napló könyvtár megnyitása + + Ignore stations from Ignore List + - - JT4 - + + Hide stations from Territory 1 + - - Message averaging - Üzenet átlagolás + + Hide stations from Territory 2 + - - Enable averaging - Átlagolás engedélyezése + + Hide stations from Territory 3 + - - Enable deep search - Mély keresés engedélyezése + + Hide stations from Territory 4 + - - WSPR - + + Hide stations from Europe + - - Echo Graph - Echo-grafikon + + Hide stations from North America + - - F8 - + + Hide stations from South America + - - Echo - Echo + + Hide stations from Asia + - - EME Echo mode - EME Echo üzemmód + + Hide stations from Africa + - - ISCAT - + + Hide stations from Oceania + - - Fast Graph - Gyors-grafikon + + Hide stations from Antarctica + - - F9 - + + Full Duplex Mode + - - &Download Samples ... - Minták letöltése ... + + Highlight callsigns worked before on band + - - <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> - <html><head/><body><p>A különböző üzemmódokat bemutató minta hangfájlok letöltése.</p></body></html> + + Highlight callsigns worked today or yesterday + - - MSK144 - + + Highlight callsigns from Ignore List + - - QRA64 - + + Enable Message Popups + - - Release Notes - Verzió megjegyzések + + QSY Monitor + - - Enable AP for DX Call - AP (elözetes információk) engedélyezése a DX Hívójelhez + + Ignore stations worked before on band + - - FreqCal - + + Use multithreaded FT8 decoder + - - Measure reference spectrum - Referencia spektrum mérése + + Auto + - - Measure phase response - Fázismenet mérése + + + 5 + - - Erase reference spectrum - Referencia spektrum törlése + + + 7 + - - Execute frequency calibration cycle - Frekvencia kalibráló ciklus végrehajtása + + + 11 + - - Equalization tools ... - Kiegyenlítő eszközök ... + + Low + Alacsony - - FT8 - + + Medium + - - - Enable AP - AP engedélyezése + + High + Magas - - Solve for calibration parameters - Kalibrációs paraméterek megoldása + + Minimum + - - Copyright notice - Szerzői jogi nyilatkozat + + Use low thresholds + - - Shift+F1 - + + Use subpass + - - Fox log - Fox napló + + 2-Stage + - - FT8 DXpedition Mode User Guide - FT8 DXpedíció mód felhasználói kézikönyv + + 3-Stage + - - Reset Cabrillo log ... - Cabrillo log visszaállítása ... + + Early + - - Color highlighting scheme - Színkiemelési séma + + Late + - - Export Cabrillo log ... - Cabrillo log exportálása ... + + Wideband DX Call search + - - Contest log - Verseny napló + + Hide FT8 dupe messages + - - Erase WSPR hashtable - A WSPR hash-táblázat törlése + + VHF / UHF Buttons + - - FT4 - + + Highlight stations from Territory 1 + - - Quick-Start Guide to Q65 - Q65 Gyors útmutató + + Highlight stations from Territory 2 + - - Auto Clear Avg after decode - Átlag automatikus törlése a dekódolás után + + Highlight stations from Territory 3 + - - Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 - WSJT-X 2.5.0, és MAP65 3.0 Gyors útmutató + + Highlight stations from Territory 4 + - - Rig Control Error - Rig vezérlési hiba + + Disable clicks on waterfall + - - - - Receiving - Vétel + + Download EME Ephemeris Chart + - - Do you want to reconfigure the radio interface? - Újra kívánja konfigurálni a rádió interfészt? + + Hide AP information + - - Error Scanning ADIF Log - Hiba az ADIF Log beolvasásakor + + <html><head/><body><p>Hide AP information</p></body></html> + - - Scanned ADIF log, %1 worked before records created - ADIF log beolvasva, %1 megcsinálva a rekordok létrehozása előtt + + Highlight Whitelist entries + - - Error Loading LotW Users Data - Hiba a LotW felhasználói adatok betöltésekor + + JTTY + - - Error Writing WAV File - Hiba a WAV fájl írásakor + + + USB dial frequency + A Rádió USB frekvenciájának kijelzése. - - Enumerating audio devices - Audió eszközök felsorolása + + 14.078 000 + - - Configurations... - Konfigurációk... + + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> + <html><head/><body><p>30dB ajánlott, ha csak zaj van jelen<br/>Zöld, ha jó<br/>Piros, ha túlvezérlés várható<br/>Sárga, ha túl alacsony</p></body></html> - - - - - - - - - - - - - - - - - - - - Message - Üzenet + + Rx Signal + - - Error Killing jt9.exe Process - Hiba a jt9.exe folyamat leállításakor + + 30dB recommended when only noise present +Green when good +Red when clipping may occur +Yellow when too low + 30dB ajánlott, ha csak zaj van jelen +Zöld, ha jó +Piros, ha túlvezérlés várható +Sárga, ha túl alacsony - - KillByName return code: %1 - KillByName visszatérési kód: %1 + + DX Call + DX Hívójel - - Error removing "%1" - Hiba a "%1" eltávolításakor + + DX Grid + DX QRA - - Click OK to retry - Kattintson az OK gombra az újbóli próbálkozáshoz + + Callsign of station to be worked + Ellenállomás hívójele - - - Improper mode - Helytelen üzemmód + Search for callsign in database + Hívójel keresése az adatbázisban. - - - File Open Error - Fájl megnyitási hiba + + &Lookup + Keresés - - - - - - Cannot open "%1" for append: %2 - Nem lehet megnyitni a "%1"-et a hozzáfűzéshez: %2 + + Locator of station to be worked + Ellenállomás QRA lokátora - - Error saving c2 file - Hiba a c2 fájl mentésekor + + Az: 251 16553 km + - - Error in Sound Input - Hiba a Sound Input-ban + Add callsign and locator to database + Hívójel és lokátor hozzáadása az adatbázishoz. - - Error in Sound Output - Hiba a Sound Output-ban + + Add + Hozzáad - - - - - Single-Period Decodes - Egy periódusú dekódolások + Pwr + Pwr - - - - - Average Decodes - Átlag dekódolások + + <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> + <html><head/><body><p>Ha a kör narancssárga vagy piros, a CAT vezérlés nem működik. Próbálja meg a körre kattintva resetelni, szinkronizálni az adó-vevő vezérlését, ellenőrizze, hogy az adó-vevő megfelelően van-e csatlakoztatva a számítógéphez, ellenőrizze az adó-vevő beállításait, konfigurálja újra a CAT-ot a WSJT-X-ben. A körben levő S osztott (Split) módot jelent.</p></body></html> - - Change Operator - Operátor váltás + + If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. + Ha a kör narancssárga vagy piros, a CAT vezérlés nem működik. Próbálja meg a körre kattintva szinkronizálni az adó-vevő vezérlését, ellenőrizze, hogy az adó-vevő megfelelően van-e csatlakoztatva a számítógéphez, ellenőrizze az adó-vevő beállításait, konfigurálja újra a CAT-ot a WSJT-X-ben. - - New operator: - Új operátor: + + ? + - - Status File Error - Status File hiba + + Adjust Tx audio level + A Tx szint hanggal történő beállítása - - - Cannot open "%1" for writing: %2 - Nem lehet megnyitni a "%1"-et írásra: %2 + + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> + <html><head/><body><p>Válassza ki a működési sávot, vagy adja meg a frekvenciát MHz-ben, vagy adja meg a lépésközt kHz-ben megnyomva utána a k billentyűt.</p></body></html> - - Subprocess Error - Alfolyamat hiba + + Frequency entry + - - Subprocess failed with exit code %1 - Az alfolyamat meghiúsult a %1 kilépési kóddal + + Select operating band or enter frequency in MHz or enter kHz increment followed by k. + Válassza ki a működési sávot, vagy adja meg a frekvenciát MHz-ben, vagy adja meg a lépésközt kHz-ben megnyomva utána a k billentyűt. - - - Running: %1 -%2 - Indítás: %1 -%2 + + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> - - Subprocess error - Alfolyamat hiba + + <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> + <html><head/><body><p>Jelölje be a négyzetet, hogy a Tx-frekvencia rögzítve maradjon, amikor duplán kattint a dekódolt szövegre.</p></body></html> - - Reference spectrum saved - Referencia spektrum elmentve + + Check to keep Tx frequency fixed when double-clicking on decoded text. + Jelölje be a négyzetet, hogy a Tx-frekvencia rögzítve maradjon, amikor duplán kattint a dekódolt szövegre. - - Invalid data in fmt.all at line %1 - Érvénytelen adat az fmt.all-ban a %1 sorban + + Hold Tx Freq + Tx frekv.marad - - Good Calibration Solution - Jó kalibrálási megoldás + + + Audio Rx frequency + Audio Rx frekvencia - - <pre>%1%L2 ±%L3 ppm -%4%L5 ±%L6 Hz - -%7%L8 -%9%L10 Hz</pre> - <pre>%1%L2 ±%L3 ppm -%4%L5 ±%L6 Hz - -%7%L8 -%9%L10 Hz</pre> + + + + + + + + + Hz + Hz - - Delete Calibration Measurements - Kalibrálási mérések törlése + + + + Rx + Rx - - The "fmt.all" file will be renamed as "fmt.bak" - Az "fmt.all" fájl neve "fmt.bak" lesz. + + + + + Set Tx frequency to Rx Frequency + Tx frekvencia beállítása az Rx frekvenciára - - If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + + + ▲ + + + + + + Frequency tolerance (Hz) + Frekvencia tűrés (Hz) + + + + + + F Tol + + + + + + + + Set Rx frequency to Tx Frequency + Rx frekvencia beállítása a Tx frekvenciára + + + + + ▼ + + + + + <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> + <html><head/><body><p>Szinkronizálási küszöbérték. Az alacsonyabb számok gyengébb szinkronizáló jeleket fogadnak el.</p></body></html> + + + + Synchronizing threshold. Lower numbers accept weaker sync signals. + Szinkronizálási küszöbérték. Az alacsonyabb számok gyengébb szinkronizáló jeleket fogadnak el. + + + + Sync + + + + + <html><head/><body><p>Check to use short-format messages.</p></body></html> + <html><head/><body><p>Jelölje be, ha rövid formátumú üzeneteket szeretne használni.</p></body></html> + + + + Check to use short-format messages. + Jelölje be, ha rövid formátumú üzeneteket szeretne használni. + + + + Sh + Sh + + + + <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> + <html><head/><body><p>Jelölje be a JT9 gyors módok engedélyezéséhez.</p></body></html> + + + + Check to enable JT9 fast modes + Jelölje be a JT9 gyors módok engedélyezéséhez. + + + + + Fast + Gyors + + + + <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> + <html><head/><body><p>Bejelölésével engedélyezi, a vett üzenetek figyelembevételével, a Tx-üzenetek automatikus sorrendbe állítását.</p></body></html> + + + + Check to enable automatic sequencing of Tx messages based on received messages. + Bejelölésével engedélyezi, a vett üzenetek figyelembevételével, a Tx-üzenetek automatikus sorrendbe állítását. + + + + Auto Seq + Auto-Vál. + + + <html><head/><body><p>Check to call the first decoded responder to my CQ.</p></body></html> + <html><head/><body><p>Jelölje ezt be, hogy az Ön CQ-jára az első dekódolt válaszolót hívja meg.</p></body></html> + + + Check to call the first decoded responder to my CQ. + Jelölje ezt be, hogy az Ön CQ-jára az itt kiválasztott első dekódolt válaszolót hívja meg. + + + Call 1st + 1.Hívás + + + + Check to generate "@1250 (SEND MSGS)" in Tx6. + Jelölje be az "@1250 (SEND MSGS)" létrehozásához a Tx6-ban. + + + + Tx6 + + + + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences.</p></body></html> + <html><head/><body><p>Jelölje be, hogy az adás a páros percekben vagy szekvenciákban történjen, kezdve 0-tól; páratlan szekvenciák esetén pedig törölje a jelölést.</p></body></html> + + + Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. + Jelölje be, hogy az adás a páros percekben vagy szekvenciákban történjen, kezdve 0-tól; páratlan szekvenciák esetén pedig törölje a jelölést. + + + + Tx even/1st + TX páros/1. + + + + <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> + <html><head/><body><p>CQ hívás frekvenciája kHz-ben az aktuális MHz fölött</p></body></html> + + + + Frequency to call CQ on in kHz above the current MHz + CQ hívás frekvenciája kHz-ben az aktuális MHz fölött + + + + Tx CQ + + + + + <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> + <html><head/><body><p>Jelölje be ezt, a CQ adáshoz a &quot;Tx CQ&quot; frekvencián. Az Rx az aktuális frekvencián lesz, és a CQ üzenet tartalmazza az aktuális Rx frekvenciát, hogy a hívók tudják, melyik frekvencián kell válaszolniuk.</p><p>Ez nem áll rendelkezésre a nem szabványos hívójelek tulajdonosai számára.</p></body></html> + + + + Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. +Not available to nonstandard callsign holders. + Jelölje be ezt, a CQ adáshoz a Tx CQ frekvencián. Az Rx az aktuális frekvencián lesz, és a CQ üzenet tartalmazza az aktuális Rx frekvenciát, hogy a hívók tudják, melyik frekvencián kell válaszolniuk. +Ez nem áll rendelkezésre a nem szabványos hívójelek tulajdonosai számára. + + + + Rx All Freqs + Rx Minden frekvencia + + + + <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> + <html><head/><body><p>Az almód határozza meg a hangtávolságot; az A a legkeskenyebb.</p></body></html> + + + + Submode determines tone spacing; A is narrowest. + Az almód határozza meg a hangtávolságot; az A a legkeskenyebb. + + + + Submode + + + + + + Fox + + + + + <html><head/><body><p>Check to monitor Sh messages.</p></body></html> + <html><head/><body><p>Jelölje be, hogy figyelhesse az Sh (rövid) üzeneteket.</p></body></html> + + + + Check to monitor Sh messages. + Jelölje be, hogy figyelhesse az Sh (rövid) üzeneteket. + + + + SWL + SWL + + + + Best S+P + Legjobb S+P + + + + <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> + <html><head/><body><p>Jelölje be ezt a kalibrálási adatok rögzítésének megkezdéséhez.<br/>Mérés közben a kalibrálási korrekció le van tiltva.<br/>Ha nincs bejelölve, akkor megtekintheti a kalibrálási eredményeket.</p></body></html> + + + + Check this to start recording calibration data. +While measuring calibration correction is disabled. +When not checked you can view the calibration results. + Jelölje be ezt a kalibrálási adatok rögzítésének megkezdéséhez. +Mérés közben a kalibrálási korrekció le van tiltva. +Ha nincs bejelölve, akkor megtekintheti a kalibrálási eredményeket. + + + + Measure + Mérés + + + + <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> + <html><head/><body><p>Jel riport: Jel-zaj viszony a 2500 Hz-es referencia-sávszélességben (dB).</p></body></html> + + + + Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). + Jel riport: Jel-zaj viszony a 2500 Hz-es referencia-sávszélességben (dB). + + + + Report + Riport + + + + <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> + <html><head/><body><p>Tx/Rx vagy Frekvencia kalibrációs sorozat hossza</p></body></html> + + + + Tx/Rx or Frequency calibration sequence length + Tx/Rx vagy Frekvencia kalibrációs sorozat hossza + + + + + s + + + + + + T/R + + + + + + Audio Tx frequency + Audio Tx frekvencia + + + + + + Tx + + + + + Tx# + + + + + + + 1 + + + + + + + Send this message in next Tx interval + Küldje ezt az üzenetet a következő Tx intervallumban. + + + + Ctrl+2 + + + + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + <html><head/><body><p>Ezt a bejelölt üzenetet küldje el a következő Tx intervallumban</p><p>Dupla kattintással kapcsolja be a Tx1 üzenet használatát egy állomással való QSO indításához (nem engedélyezett az 1.típusú összetett hívójelesek számára)</p></body></html> + + + + Send this message in next Tx interval +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + Ezt a bejelölt üzenetet küldje el a következő Tx intervallumban +Dupla kattintással kapcsolja be a Tx1 üzenet használatát egy állomással való QSO indításához (nem engedélyezett az 1.típusú összetett hívójelesek számára) + + + + Ctrl+1 + + + + + + + + Switch to this Tx message NOW + Váltás erre a Tx üzenetre MOST + + + + Tx &2 + + + + + Alt+2 + + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + <html><head/><body><p>Váltson erre a Tx üzenetre MOST</p><p>Dupla kattintással kapcsolja be a Tx1 üzenet használatát egy állomással való QSO indításához (nem engedélyezett az 1.típusú összetett hívójelesek számára)</p></body></html> + + + + Switch to this Tx message NOW +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + Váltson erre a Tx üzenetre MOST +Dupla kattintással kapcsolja be a Tx1 üzenet használatát egy állomással való QSO indításához (nem engedélyezett az 1.típusú összetett hívójelesek számára) + + + + Tx &1 + + + + + Alt+1 + + + + + Ctrl+6 + + + + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> + <html><head/><body><p>Ezt a bejelölt üzenetet küldje el a következő Tx intervallumban</p><p>Kattintson rá duplán a szabványos 73-as üzenet visszaállításához</p></body></html> + + + + Send this message in next Tx interval +Double-click to reset to the standard 73 message + Ezt a bejelölt üzenetet küldje el a következő Tx intervallumban +Kattintson rá duplán a szabványos 73-as üzenet visszaállításához + + + + Ctrl+5 + + + + + Ctrl+3 + + + + + Tx &3 + + + + + Alt+3 + + + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + <html><head/><body><p>Ezt a bejelölt üzenetet küldje el a következő Tx intervallumban</p><p>Dupla kattintással válthat a Tx4-ben az RRR és RR73 üzenetek között (2.típusú összetett hívójeleseknek nem megengedett)</p><p>RR73 üzeneteket csak akkor szabad használni, ha eléggé biztos abban, hogy nem lesz szükség üzenetismétlésre</p></body></html> + + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + Ezt a bejelölt üzenetet küldje el a következő Tx intervallumban +Dupla kattintással válthat a Tx4-ben az RRR és RR73 üzenetek között (2.típusú összetett hívójeleseknek nem megengedett) +RR73 üzeneteket csak akkor szabad használni, ha eléggé biztos abban, hogy nem lesz szükség üzenetismétlésre. + + + + Ctrl+4 + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + <html><head/><body><p>Váltson erre a Tx üzenetre MOST</p><p>Dupla kattintással válthat a Tx4-ben az RRR és RR73 üzenetek között (nem megengedett a 2.típusú összetett hívójelesek esetében)</p><p>RR73 üzeneteket csak akkor szabad használni, ha eléggé biztos benne, hogy nem lesz szükség üzenetismétlésre.</p></body></html> + + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + Váltson erre a Tx üzenetre MOST +Dupla kattintással válthat a Tx4-ben az RRR és RR73 üzenetek között (nem megengedett a 2.típusú összetett hívójelesek esetében) +RR73 üzeneteket csak akkor szabad használni, ha eléggé biztos benne, hogy nem lesz szükség üzenetismétlésre + + + + Tx &4 + + + + + Alt+4 + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p></body></html> + <html><head/><body><p>Váltson erre a Tx üzenetre MOST</p><p>Kattintson duplán rá a szabványos 73-as üzenet visszaállításához</p></body></html> + + + Switch to this Tx message NOW +Double-click to reset to the standard 73 message + Váltson erre a Tx üzenetre MOST +Kattintson duplán rá a szabványos 73-as üzenet visszaállításához + + + + Tx &5 + + + + + Alt+5 + + + + + Now + Most + + + + Generate standard messages for minimal QSO + Szabványos üzenetek létrehozása a minimális QSO-hoz + + + + Generate Std Msgs + Std Üzenet létrehozása + + + + Tx &6 + + + + + Alt+6 + + + + + Enter a free text message (maximum 13 characters) +or select a predefined macro from the dropdown list. +Press ENTER to add the current text to the predefined +list. The list can be maintained in Settings (F2). + Írjon be egy tetszőleges szöveges üzenetet (maximum 13 karakter), +vagy válasszon egy előre meghatározott makrót a legördülő listából. +Nyomja meg az ENTER-t az aktuális szöveg hozzáadásához az előre +meghatározott listához. A listát a Beállításokban (F2) lehet karbantartani. + + + + Queue up the next Tx message + A következő Tx üzenet sorbaállítása + + + + Next + Következő + + + + + + + + + 2 + + + + + Quick-Start Guide to FST4 and FST4W + FST4 és FST4W Gyors útmutató + + + + FST4 + + + + + FST4W + + + + + + + CQ + + + + + Grid + QRA + + + + CQ AF + + + + + CQ AN + + + + + CQ AS + + + + + CQ EU + + + + + CQ NA + + + + + CQ OC + + + + + CQ SA + + + + + CQ 0 + + + + + CQ 1 + + + + + CQ 2 + + + + + CQ 3 + + + + + CQ 4 + + + + + CQ 5 + + + + + CQ 6 + + + + + CQ 7 + + + + + CQ 8 + + + + + CQ 9 + + + + + Reset + + + + + N List + + + + + N Slots + + + + + + + + + + + Random + Véletlen + + + + Call + Hívójel + + + + S/N (dB) + + + + + Distance + Távolság + + + + More CQs + Több CQ + + + + + % + + + + + Tx Pct + + + + + Band Hopping + Sáv ugrás + + + + Choose bands and times of day for band-hopping. + Sáv és napszakok választása a Sáv ugráshoz. + + + + Schedule ... + Ütemezés … + + + + Upload decoded messages to WSPRnet.org. + Feltöltil a dekódolt üzeneteket a WSPRnet.org -ra. + + + + Upload spots + Spot feltöltés + + + + <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> + <html><head/><body><p>A 6 számjegyű lokátorok 2 különböző üzenet küldését eredményezik, a második tartalmazza a teljes lokátort, de csak egy hashed (kivonatolt) hívójelet, ezért a többi állomásnak előbb dekódolnia kell az elsőt, mielőtt a másodikban dekódolhatnák az Ön hívójelét. Jelölje be ezt az opciót, hogy csak 4 számjegyű lokátorokat küldjön, ezzel elkerülhető a kétüzenetes protokoll.</p></body></html> + + + + 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. + A 6 számjegyű lokátorok 2 különböző üzenet küldését eredményezik, a második tartalmazza a teljes lokátort, de csak egy hashed (kivonatolt) hívójelet, ezért a többi állomásnak előbb dekódolnia kell az elsőt, mielőtt a másodikban dekódolhatnák az Ön hívójelét. Jelölje be ezt az opciót, hogy csak 4 számjegyű lokátorokat küldjön, ezzel elkerülhető a kétüzenetes protokoll. + + + + No own call decodes + Saját hívás dekódolás nincs + + + + Tx Next + Tx következik + + + + Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. + Adja meg a Tx teljesítményt dBm-ben (1 mW-ra vonatkoztatva) a WSPR üzenet részeként. + + + + NB + + + + + Maximum drift rate in units of symbol rate per transmission. + Maximális elcsúszási (drift) sebesség a szimbólumsebesség egységében adásonként. + + + + Max Drift + + + + + File + Fájl + + + + View + Nézet + + + + Decode + Dekódolás + + + + Save + Mentés + + + + Help + Súgó + + + + + Mode + Üzemmód + + + + Configurations + Konfigurációk + + + + Tools + Eszközök + + + + Exit + Kilépés + + + + About WSJT-X + WSJT-X névjegy + + + + Waterfall + Vízesés + + + + Open + Megnyit + + + + Ctrl+O + + + + + Open next in directory + Következő megnyitása a könyvtárban + + + + Decode remaining files in directory + A könyvtárban maradt fájlok dekódolása + + + + Delete all *.wav && *.c2 files in SaveDir + Az összes *.wav és *.c2 fájl törlése a mentési könyvtárból (save-ból) + + + + None + Nincs + + + + Save all + Összes mentése + + + + Online User Guide + Online Felhasználói kézikönyv + + + + Keyboard shortcuts + Gyorsbillentyűk + + + + Special mouse commands + Speciális egérparancsok + + + + JT9 + + + + + Save decoded + Dekódolás mentése (Rx szöveg) + + + + + Normal + Normál + + + + Deep + Mély + + + + Erase ALL.TXT + Az ALL.TXT fájl törlése + + + + Erase wsjtx_log.adi + A wsjtx_log.adi, Napló fájl törlése ! + + + + F7 + + + + Runaway Tx watchdog + Lejárt a Tx időfigyelő ideje. + + + + + JT65 + + + + + Astronomical data + Csillagászati adatok + + + + List of Type 1 prefixes and suffixes + Az 1.típusú prefixek és suffixek listája + + + + Settings... + Beállítások... + + + + Local User Guide + Helyi Felhasználói kézikönyv + + + + Open log directory + A napló könyvtár megnyitása + + + + JT4 + + + + + Message averaging + Üzenet átlagolás + + + + Enable averaging + Átlagolás engedélyezése + + + + Enable deep search + Mély keresés engedélyezése + + + + WSPR + + + + + Echo Graph + Echo-grafikon + + + + F8 + + + + + + Echo + Echo + + + + EME Echo mode + EME Echo üzemmód + + + + ISCAT + + + + + Fast Graph + Gyors-grafikon + + + + &Download Samples ... + Minták letöltése ... + + + + <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> + <html><head/><body><p>A különböző üzemmódokat bemutató minta hangfájlok letöltése.</p></body></html> + + + + MSK144 + + + + + QRA64 + + + + + Release Notes + Verzió megjegyzések + + + + Enable AP for DX Call + AP (elözetes információk) engedélyezése a DX Hívójelhez + + + + FreqCal + + + + + Measure reference spectrum + Referencia spektrum mérése + + + + Measure phase response + Fázismenet mérése + + + + Erase reference spectrum + Referencia spektrum törlése + + + + Execute frequency calibration cycle + Frekvencia kalibráló ciklus végrehajtása + + + + Equalization tools ... + Kiegyenlítő eszközök ... + + + + + FT8 + + + + + + Enable AP + AP engedélyezése + + + + Solve for calibration parameters + Kalibrációs paraméterek megoldása + + + + Copyright notice + Szerzői jogi nyilatkozat + + + + Shift+F1 + + + + + Fox log + Fox napló + + + + FT8 DXpedition Mode User Guide + FT8 DXpedíció mód felhasználói kézikönyv + + + + Reset Cabrillo log ... + Cabrillo log visszaállítása ... + + + + Color highlighting scheme + Színkiemelési séma + + + + Export Cabrillo log ... + Cabrillo log exportálása ... + + + + Contest log + Verseny napló + + + + Erase WSPR hashtable + A WSPR hash-táblázat törlése + + + + + FT4 + + + + + Quick-Start Guide to Q65 + Q65 Gyors útmutató + + + + Auto Clear Avg after decode + Átlag automatikus törlése a dekódolás után + + + + Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 + WSJT-X 2.5.0, és MAP65 3.0 Gyors útmutató + + + + Rig Control Error + Rig vezérlési hiba + + + + + + Receiving + Vétel + + + + Do you want to reconfigure the radio interface? + Újra kívánja konfigurálni a rádió interfészt? + + + + Error Scanning ADIF Log + Hiba az ADIF Log beolvasásakor + + + Scanned ADIF log, %1 worked before records created + ADIF log beolvasva, %1 megcsinálva a rekordok létrehozása előtt + + + + Error Loading LotW Users Data + Hiba a LotW felhasználói adatok betöltésekor + + + + + Error Writing WAV File + Hiba a WAV fájl írásakor + + + + Enumerating audio devices + Audió eszközök felsorolása + + + + Configurations... + Konfigurációk... + + + + + + + + + + + + + + + + + + + Message + Üzenet + + + + Error Killing jt9.exe Process + Hiba a jt9.exe folyamat leállításakor + + + + KillByName return code: %1 + KillByName visszatérési kód: %1 + + + + Error removing "%1" + Hiba a "%1" eltávolításakor + + + + Click OK to retry + Kattintson az OK gombra az újbóli próbálkozáshoz + + + + + Improper mode + Helytelen üzemmód + + + + + File Open Error + Fájl megnyitási hiba + + + + + + + + Cannot open "%1" for append: %2 + Nem lehet megnyitni a "%1"-et a hozzáfűzéshez: %2 + + + + Error saving c2 file + Hiba a c2 fájl mentésekor + + + + Error in Sound Input + Hiba a Sound Input-ban + + + + Error in Sound Output + Hiba a Sound Output-ban + + + + + Single-Period Decodes + Egy periódusú dekódolások + + + + + Average Decodes + Átlag dekódolások + + + + Change Operator + Operátor váltás + + + + New operator: + Új operátor: + + + + Status File Error + Status File hiba + + + + + Cannot open "%1" for writing: %2 + Nem lehet megnyitni a "%1"-et írásra: %2 + + + + Subprocess Error + Alfolyamat hiba + + + + Subprocess failed with exit code %1 + Az alfolyamat meghiúsult a %1 kilépési kóddal + + + + + Running: %1 +%2 + Indítás: %1 +%2 + + + + Subprocess error + Alfolyamat hiba + + + Reference spectrum saved + Referencia spektrum elmentve + + + + Invalid data in fmt.all at line %1 + Érvénytelen adat az fmt.all-ban a %1 sorban + + + + Good Calibration Solution + Jó kalibrálási megoldás + + + + <pre>%1%L2 ±%L3 ppm +%4%L5 ±%L6 Hz + +%7%L8 +%9%L10 Hz</pre> + <pre>%1%L2 ±%L3 ppm +%4%L5 ±%L6 Hz + +%7%L8 +%9%L10 Hz</pre> + + + + Delete Calibration Measurements + Kalibrálási mérések törlése + + + + The "fmt.all" file will be renamed as "fmt.bak" + Az "fmt.all" fájl neve "fmt.bak" lesz. + + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2021 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; and other members of the WSJT Development Group." + Ha a WSJT-X bármely részét a GNU General Public License feltételei szerint jogszerűen felhasználja, akkor a következő szerzői jogi megjegyzést kell jól láthatóan feltüntetnie az Ön létrehozott művében: + +"A WSJT-X és a kapcsolódó programok algoritmusai, forráskódja, megjelenése és működése, valamint az FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 üzemmódok protokollspecifikációi az alábbi szerzők egy vagy többjének szerzői joga (C) 2001-2021: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; és a WSJT fejlesztőcsoport többi tagja." + + + + No data read from disk. Wrong file format? + Nincs adatolvasás a lemezről. Rossz fájlformátum? + + + + Confirm Delete + Törlés megerősítése + + + + Are you sure you want to delete all *.wav and *.c2 files in "%1"? + Biztos, hogy törölni akarja az összes *.wav és *.c2 fájlt a "%1"-ben? + + + + Keyboard Shortcuts + Gyorsbillentyűk + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: toggle "Call 1st")</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 2000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 2000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Toggle "Call 1st" checkbox</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Enable Tx</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Log QSO</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> +</table> + Keyboard shortcuts help window contents + A billentyűparancsok segítik az ablak tartalmát + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Tx leállítása, QSO megszakítása, következő hívás törlése</td></tr> + <tr><td><b>F1 </b></td><td>Online felhasználói kézikönyv (Vagy: Tx6 adása)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Szerzői jogi nyilatkozat</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>WSJT-X névjegy</td></tr> + <tr><td><b>F2 </b></td><td>Beállítások ablak megnyitása (Vagy: Tx2 adása)</td></tr> + <tr><td><b>F3 </b></td><td>Billentyűparancsok megjelenítése (Vagy: Tx3 adása)</td></tr> + <tr><td><b>F4 </b></td><td>DX Hívójel, DX QRA, Tx 1-4 üzenetek törlése (Vagy: Tx4 adása)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Kilépés a programból</td></tr> + <tr><td><b>F5 </b></td><td>Speciális egérparancsok megjelenítése (Vagy: Tx5 adása)</td></tr> + <tr><td><b>F6 </b></td><td>Következő fájl megnyitása a könyvtárban (Vagy: "Call 1st" választó)</td></tr> + <tr><td><b>Shift+F6 </b></td><td>A könyvtárban maradt összes fájl dekódolása</td></tr> + <tr><td><b>F7 </b></td><td>Üzenet átlagolás ablak megjelenítése</td></tr> + <tr><td><b>F11 </b></td><td>Az Rx-frekvenciát 1 Hz-el lejjebb mozgatja</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Az azonos Rx és Tx frekvenciát 1 Hz-cel lejjebb mozgatja</td></tr> + <tr><td><b>Shift+F11 </b></td><td>A Tx-frekvencia 60 Hz-cel (FT8) vagy 90 Hz-cel (FT4) lejjebb mozgatása</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>A skála (dial) frekvenciát 2000 Hz-el lejjebb mozgatja</td></tr> + <tr><td><b>F12 </b></td><td>Az Rx frekvenciát 1 Hz-el feljebb mozgatja</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Az azonos Rx és Tx frekvenciát 1 Hz-el feljebb mozgatja</td></tr> + <tr><td><b>Shift+F12 </b></td><td>A Tx-frekvenciát 60 Hz-el (FT8), vagy 90 Hz-el (FT4) feljebb mozgatja</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>A skála (dial) frekvenciát 2000 Hz-el feljebb mozgatja</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Állítsa most az adást erre a számra az 1-es fülön</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Állítsa a következő adást erre a számra az 1-es fülön.</td></tr> + <tr><td><b>Alt+B </b></td><td>A "Legjobb S+P" állapot átváltása</td></tr> + <tr><td><b>Alt+C </b></td><td>A "Call 1st"-választó mező átváltása</td></tr> + <tr><td><b>Alt+D </b></td><td>Dekódolás újra a QSO frekvencián</td></tr> + <tr><td><b>Shift+D </b></td><td>Teljes dekódolás (mindkét ablak)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Bekapcsolja a Tx páros/1.-et</td></tr> + <tr><td><b>Shift+E </b></td><td>Kikapcsolja a Tx páros/1.-et</td></tr> + <tr><td><b>Alt+E </b></td><td>Törlés</td></tr> + <tr><td><b>Ctrl+F </b></td><td>A szabad szöveges üzenet mező szerkesztése</td></tr> + <tr><td><b>Alt+G </b></td><td>Szabványos üzenetek létrehozása</td></tr> + <tr><td><b>Alt+H </b></td><td>Tx Állj</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Hívójel keresése az adatbázisban, szabványos üzenetek generálása</td></tr> + <tr><td><b>Alt+M </b></td><td>Vétel. BE/KI</td></tr> + <tr><td><b>Alt+N </b></td><td>Tx engedélyezése. BE/KI</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Egy .wav fájl megnyitása</td></tr> + <tr><td><b>Alt+O </b></td><td>Operátor váltás</td></tr> + <tr><td><b>Alt+Q </b></td><td>QSO naplózása</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Tx4 üzenet beállítása RRR-re (FT4-ben nem)</td></tr> + <tr><td><b>Alt+R </b></td><td>Tx4 üzenet beállítása RR73-ra</td></tr> + <tr><td><b>Alt+S </b></td><td>Vétel megállítása (Monitorozás megállítása)</td></tr> + <tr><td><b>Alt+T </b></td><td>Hangolás állapotának váltása</td></tr> + <tr><td><b>Alt+Z </b></td><td>Kiakadt dekóder állapotának törlése</td></tr> +</table> + + + + Special Mouse Commands + Speciális egérparancsok + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Shift-click</b> to set Tx frequency.<br/> + <b>Ctrl-click</b> or <b>Right-click</b> to set Rx and Tx frequencies.<br/> + <b>Double-click</b> to also decode at Rx frequency.<br/> + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call,<br/> + locator to Dx Grid, change Rx and Tx frequency to<br/> + decoded signal's frequency, and generate standard<br/> + messages.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message<br/> + is your own call, Tx frequency is not changed unless <br/> + <b>Ctrl</b> is held down.<br/> + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase QSO window.<br/> + <b>Double-click</b> to erase QSO and Band Activity windows. + </td> + </tr> +</table> + Mouse commands help window contents + Az Egérparancsok segítik az ablak tartalmát + <table cellpadding=5> + <tr> + <th align="right">Rákattintva</th> + <th align="left">Művelet</th> + </tr> + <tr> + <td align="right">Vízesésre:</td> + <td><b>Rákattintás</b> az Rx frekvencia beállításához.<br/> + <b>Shift+Kattintás</b> a Tx frekvencia beállításához.<br/> + <b>Ctrl+Kattintás</b> vagy <b>Jobb kattintás</b> az Rx és Tx frekvencia azonos beállításához.<br/> + <b>Dupla-kattintás</b> az Rx frekvencián is dekódol.<br/> + </td> + </tr> + <tr> + <td align="right">Dekódolt szövegre:</td> + <td><b>Dupla-kattintás</b> bemásolja a második hívójelet a Dx Hívójel-be,<br/> + a lokátort a DX QRA-ba, az Rx és Tx frekvenciát a dekódolt jel frekvenciájára<br/> + állítja, és generál szabványos üzeneteket.<br/> + Ha a <b>Tx frekv.marad</b> négyzet be van jelölve, vagy az üzenetben<br/> + az első hívójel a saját hívójele, a Tx frekvencia nem változik, kivéve ha a<br/> + <b>Ctrl</b>-t lenyomva tartja.<br/> + </td> + </tr> + <tr> + <td align="right">Törlés gombra:</td> + <td><b>Kattintás</b> a gombra, törli a QSO ablakot.<br/> + <b>Dupla-kattintás</b> törli a QSO és a Sáv-aktivítás ablakokat. + </td> + </tr> +</table> + + + + No more files to open. + Nincs több megnyitható fájl. + + + Spotting to PSK Reporter unavailable + A PSK Reporterhez a spottolás nem működik + + + + Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. + Kérjük, válasszon másik Tx frekvenciát. A WSJT-X szándélosan nem fog más üzemmódban adni a WSPR alsávban a 30m-en. + + + + WSPR Guard Band + WSPR Védett Sáv, más típusú modulációs adás blokkolva van benne. + + + Please choose another dial frequency. WSJT-X will not operate in Fox mode in the standard FT8 sub-bands. + Kérjük, válasszon másik rádióskála frekvenciát. A WSJT-X nem működik Fox módban a szabványos FT8 al-sávokban. + + + + Fox Mode warning + Fox mód figyelmeztetés + + + + Last Tx: %1 + Utolsó Tx: %1 + + + + Should you switch to EU VHF Contest mode? + +To do so, check 'Special operating activity' and +'EU VHF Contest' on the Settings | Advanced tab. + Át akar vátani EU VHF Contest módra? + +Ehhez jelölje be a „Speciális tevékenységek” négyzetet és +az „EU VHFContest” lehetőséget a Beállítások | Haladó fülön. + + + + Should you switch to ARRL Field Day mode? + Át akar vátani ARRL Field Day módra? + + + + Should you switch to RTTY contest mode? + Át akar váltani RTTY contest módra? + + + + + Decoder is starting; decode request skipped. + + + + + + + + Add to CALL3.TXT + Hozzáadás a CALL3.TXT-hez + + + + Please enter a valid grid locator + Adjon meg egy érvényes QRA lokátort + + + + Cannot open "%1" for read/write: %2 + A "%1" nem nyitható meg olvasásra/írásra: %2 + + + + %1 +is already in CALL3.TXT, do you wish to replace it? + %1 +már szerepel a CALL3.TXT ben, szeretné ezt kicserélni? + + + + Warning: DX Call field is empty. + Figyelmeztetés: A DX Hívójel mező üres. + + + + + + Free Text Message + + + + + + Message: + + + + + SuperFox free text may only contain spaces, digits, uppercase letters, and + - . / ?. + + + + + Log file error + Log fájl hiba + + + + Cannot open "%1" + "%1" nem nyitható meg + + + + Error sending log to N1MM + Hiba történt a napló N1MM-hez küldésekor + + + + Write returned "%1" + A beírás "%1" ad vissza + + + + Stations calling DXpedition %1 + A(z) %1 DXpeditiont hívó állomások + + + + Super Fox + + + + + Super Hound + + + + + Hound + Vadász + + + + Tx Messages + Tx üzenetek + + + + + + + + + Confirm Erase + Törlés megerősítése + + + + Are you sure you want to erase file ALL.TXT? + Biztos, hogy törölni akarja a ALL.TXT fájlt? + + + + + Confirm Reset + Reset megerősítése + + + + Scanned ADIF log, %1 worked-before records created. CTY: %2 + + + + + + + Decoder Error + + + + + The decoder subprocess exited unexpectedly. + + + + + jt9 exited unexpectedly with code %1. + + + + + The decoder subprocess could not be stopped. + + + + + The decoder subprocess could not be restarted. + + + + + %1.wav: invalid sample count %2 + + + + + Decodes containing My Call + + + + + Application status + + + + + Current WSJT-X status messages and operating indicators. + + + + + Transmit status + + + + + Configuration + + + + + Decode count + + + + + Last transmitted message + + + + + Power and SWR status + + + + + Decode progress + + + + + Progress for the current decode operation. + + + + + Transmit watchdog + + + + + The selected transmit message cannot be encoded. Enable Tx has been turned off. Edit the selected message or check station settings before trying again. + + + + + Tx message cannot be encoded; Enable Tx is off + + + + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2026 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; Roger Rehr, W3SZ; John Nelson, G4KLA; Charlie Suckling, DL3WDG; Terrell Deppe, KJ5HST; and other members of the WSJT Development Group." + + + + + EME Chart + + + + + Select Year + + + + + FT8 input completion was rejected: automated=%1 awaiting=%2 frames=%3. + + + + + Unable to flush the final FT8 downsampling block. + + + + + FT8 input completed with %1 of %2 samples in the decode buffer. + + + + + FT8 decoding is running behind; early passes are temporarily reduced. + + + + + FT8 decoding caught up; configured early passes restored. + + + + + + PSK Reporter spot queue full; oldest spot dropped + + + + + Please choose another dial frequency. +Must be 3Khz away from %1. +WSJT-X will not operate in Fox mode +overlapping the standard FT8 sub-bands. + + + + + Please choose another dial frequency. +WSJT-X will not operate in Fox mode +overlapping the WSPR sub-bands. + + + + + A QSO between two stations with nonstandard callsigns won't work. + +Auto Seq would get stuck in an endless loop. + + + + + This station transmits in the same time slot as you do. + +You must not start a QSO if both stations Tx even/1st +or Tx odd/2nd, while the Tx even/1st checkbox is disabled. + +Click the MSK144 mode button to re-enable the Tx even/1st +checkbox, or choose another station. + + + + + %1 shorthand-message mode + + + + + RR73 is not available in %1. Tx4 uses RRR in this mode. + + + + + Wait & Pounce requires a CQ response mode. +Change CQ: None to another option. + + + + + DX call + + + + + Callsign of station to be worked. + + + + + DX grid + + + + + Locator of station to be worked. + + + + + Wait and Call + + + + + Lookup DX call + + + + + Add DX call + + + + + Ignore DX call + + + + + CQ response mode + + + + + Selects a station automatically from replies to your pending CQ after Enable Tx is armed in the current receive period, or from CQ messages for Wait & Pounce. + + + + + Transmit audio frequency + + + + + Receive audio frequency + + + + + Signal report + + + + + Operating band + + + + + Operating band text + + + + + Transmit power attenuation + + + + + Adjust Tx audio level attenuation. + + + + + Show or hide the menu bar. + + + + + Rig control status + + + + + Hound mode + + + + + Toggle FT8 hound mode. Right-click to toggle SuperFox mode. + + + + + Message panel selector + + + + + Switches between standard messages, Fox queue, and band hopping pages. Press 1, 2, or 3 while focused to select a page. + + + + + Standard messages + + + + + Fox queue + + + + + + Band hopping + + + + + Standard messages page + + + + + Fox queue page + + + + + Band hopping page + + + + + Hound queue + + + + + Queued Hound callers available for Fox transmissions. + + + + + Fox transmissions in progress + + + + + Hound callers currently in progress for Fox transmissions. + + + + + Hound queue sort order + + + + + Hound queue list size + + + + + Fox transmission slots + + + + + Fox CQ message + + + + + Reset Fox queues + + + + + Fox free text + + + + + Send Fox free text + + + + + Enable FT8 QRG 1 + + + + + Enable FT8 QRG 2 + + + + + Enable FT8 QRG 3 + + + + + Enable FT8 QRG 4 + + + + + Enable FT8 QRG 5 + + + + + Enable FT8 QRG 6 + + + + + Enable FT8 QRG 7 + + + + + Enable FT8 QRG 8 + + + + + FT8 QRG 1 frequency + + + + + FT8 QRG 2 frequency + + + + + FT8 QRG 3 frequency + + + + + FT8 QRG 4 frequency + + + + + FT8 QRG 5 frequency + + + + + FT8 QRG 6 frequency + + + + + FT8 QRG 7 frequency + + + + + FT8 QRG 8 frequency + + + + + Tx1 message + + + + + Tx2 message + + + + + Tx3 message + + + + + Tx4 message + + + + + Tx5 message macro + + + + + Tx6 message + + + + + Tx5 message macro text + + + + + Select Tx1 for next transmission + + + + + Select Tx2 for next transmission + + + + + Select Tx3 for next transmission + + + + + Select Tx4 for next transmission + + + + + Select Tx5 for next transmission + + + + + Select Tx6 for next transmission + + + + + Transmit Tx1 now + + + + + Transmit Tx2 now + + + + + Transmit Tx3 now + + + + + Transmit Tx4 now + + + + + Transmit Tx5 now + + + + + Transmit Tx6 now + + + + + Show Already Worked + + + + + All Decodes + + + + + QSO Frequency + + + + + Are you sure you want to erase the list of Q65 callers? + + + + + Are you sure you want to erase your contest log? + Biztos, hogy törölni akarja a versenynaplót? + + + + Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. + Ezáltal az aktuális verseny összes QSO-rekordja törlődik. Ezek az ADIF log fájlban megmaradnak, de nem exportálhatók a Cabrillo logba. + + + + Cabrillo Log saved + Cabrillo Log mentve + + + + Are you sure you want to erase file wsjtx_log.adi? + Biztos, hogy törölni akarja a wsjtx_log.adi fájlt? + + + + Are you sure you want to erase the WSPR hashtable? + Biztos, hogy törölni akarja a WSPR hash-táblázatot? + + + + %1 W + + + + + SWR > 2.5 !!! + +Transmission was stopped + +Check your antenna + + + + + Tune digital gain + Hangolás digitális erősítése + + + + Transmit digital gain + Adás digitális erősítése + + + + Prefixes + Prefixek + + + + Network Error + Hálózati hiba + + + + Error: %1 +UDP server %2:%3 + Hiba: %1 +UDP szerver %2:%3 + + + + + File Error + Fájl hiba + + + + + Stop transmitting or tuning before changing the dial frequency. + + + + + + Measuring reference spectrum: %1 s remaining + + + + + Reference spectrum measurement stopped; Ref Spec is available + + + + + Reference spectrum saved; Ref Spec is available + + + + + Reference spectrum measurement stopped; no reference spectrum is available + + + + + Phase Training Disabled + Gyakorlási fázis letiltva + + + + Phase Training Enabled + Gyakorlási fázis engedélyezve + + + + Cannot remove "%1": %2 + + + + + WD:0m + + + + + Runaway Tx watchdog + + + + + WD:%1m + + + + + Directional calls not yet supported in SuperFox mode + + + + + TOTP: No seed entered in fox configuration to generate verification code. + + + + + SuperFox cannot queue %1: unsupported callsign. + + + + + TOTP SF: seed not long enough. + + + + + SuperFox Tx stopped: invalid message tokens. + + + + + SuperFox Tx stopped: invalid verification code. + + + + + SuperFox Tx stopped: invalid CQ call or grid. + + + + + SuperFox Tx stopped: invalid callsign. + + + + + SuperFox Tx stopped: report is outside the SuperFox range. + + + + + SuperFox Tx stopped: free text contains unsupported characters. + + + + + SuperFox Tx stopped: message could not be packed. + + + + + Are you sure you want to erase the Tx Log? + + + + + "%1" added to Ignore List + + + + + Are you sure you want to erase the Ignore List? + + + + WD:%1m + WD:%1m + + + + + Log File Error + Napló fájl hiba + + + + Are you sure you want to clear the QSO queues? + Biztos, hogy törölni akarja a QSO-várólistát? + + + + Band hopping has no selected frequencies. + + + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: cycle CQ response mode)</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Cycle CQ response mode</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Ctrl+X </b></td><td>Open next file in directory</td></tr> + <tr><td><b>Alt+x </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> + +</table> + + + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Right-click</b> to set Tx frequency.<br/> + <b>Double-right-click</b> to set Rx and Tx frequencies. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> + and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> + Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> + own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">Dial Frequency:</td> + <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> + <b>Right-click</b> to increase frequency by 1 kHz.<br/> + <b>Left-click</b> to decrease frequency by 1 kHz.<br/> + The mouse pointer must be over the Dial Frequency indicator. + </td> + </tr> + <tr> + <td align="right">H Button:</td> + <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to activate or deactivate SuperFox mode. + </td> + </tr> + <tr> + <td align="right">FT8 Button:</td> + <td><b>Click</b> to switch to FT8 Hound Mode.<br/> + <b>Right-click</b> to toggle last used Special Operating Activity On/Off. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> + <tr> + <td align="right">Tx5 Button:</td> + <td><b>Right-click</b> to retain Tx5 free text. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Right-click</b> to freeze the state of the checkbox.<br/> + <b>Right-click on the FT8 Button</b> to unfreeze. + </td> + </tr> + <tr> + <td align="right">Enable Tx Button:</td> + <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> + <b>Right-click</b> to toggle Wait & Pounce On/Off after selecting<br/> + any CQ response mode other than CQ: None. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> + If <b>Alternate Erase button behavior</b> is checked:<br/> + <b>Click</b> to erase Band Activity window.<br/> + <b>Right-click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">DX Call Button:</td> + <td><b>Click</b> to toggle Wait & Call On/Off.<br/> + <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. + </td> + </tr> + <tr> + <td align="right">Lookup Button:</td> + <td><b>Click</b> to search for callsign in database.<br/> + <b>Right-click</b> to search for Dx Call on qrz.com. + </td> + </tr> + <tr> + <td align="right">Add Button:</td> + <td><b>Click</b> to add callsign and locator to database.<br/> + <b>Right-click</b> to search for Dx Call on hamqth.com. + </td> + </tr> + <tr> + <td align="right">Ignore Button:</td> + <td><b>Click</b> to add callsign to the Ignore List.<br/> + <b>Right-click</b> to search for Dx Call on qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Band Buttons:</td> + <td><b>Click</b> to toggle band / mode default frequencies.<br/> + <b>Right-click</b> to toggle FT8 DXpedition frequencies. + </td> + </tr> +</table> + + + + + Type 1 Prefixes: -"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2021 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; and other members of the WSJT Development Group." - Ha a WSJT-X bármely részét a GNU General Public License feltételei szerint jogszerűen felhasználja, akkor a következő szerzői jogi megjegyzést kell jól láthatóan feltüntetnie az Ön létrehozott művében: + 1A 1S 3A 3B6 3B8 3B9 3C 3C0 3D2 3D2C 3D2R 3DA 3V 3W 3X + 3Y 3YB 3YP 4J 4L 4S 4U1I 4U1U 4W 4X 5A 5B 5H 5N 5R + 5T 5U 5V 5W 5X 5Z 6W 6Y 7O 7P 7Q 7X 8P 8Q 8R + 9A 9G 9H 9J 9K 9L 9M2 9M6 9N 9Q 9U 9V 9X 9Y A2 + A3 A4 A5 A6 A7 A9 AP BS7 BV BV9 BY C2 C3 C5 C6 + C9 CE CE0X CE0Y CE0Z CE9 CM CN CP CT CT3 CU CX CY0 CY9 + D2 D4 D6 DL DU E3 E4 EA EA6 EA8 EA9 EI EK EL EP + ER ES ET EU EX EY EZ F FG FH FJ FK FKC FM FO + FOA FOC FOM FP FR FRG FRJ FRT FT5W FT5X FT5Z FW FY M MD + MI MJ MM MU MW H4 H40 HA HB HB0 HC HC8 HH HI HK + HK0A HK0M HL HM HP HR HS HV HZ I IS IS0 J2 J3 J5 + J6 J7 J8 JA JDM JDO JT JW JX JY K KG4 KH0 KH1 KH2 + KH3 KH4 KH5 KH5K KH6 KH7 KH8 KH9 KL KP1 KP2 KP4 KP5 LA LU + LX LY LZ OA OD OE OH OH0 OJ0 OK OM ON OX OY OZ + P2 P4 PA PJ2 PJ7 PY PY0F PT0S PY0T PZ R1F R1M S0 S2 S5 + S7 S9 SM SP ST SU SV SVA SV5 SV9 T2 T30 T31 T32 T33 + T5 T7 T8 T9 TA TF TG TI TI9 TJ TK TL TN TR TT + TU TY TZ UA UA2 UA9 UK UN UR V2 V3 V4 V5 V6 V7 + V8 VE VK VK0H VK0M VK9C VK9L VK9M VK9N VK9W VK9X VP2E VP2M VP2V VP5 + VP6 VP6D VP8 VP8G VP8H VP8O VP8S VP9 VQ9 VR VU VU4 VU7 XE XF4 + XT XU XW XX9 XZ YA YB YI YJ YK YL YN YO YS YU + YV YV0 Z2 Z3 ZA ZB ZC4 ZD7 ZD8 ZD9 ZF ZK1N ZK1S ZK2 ZK3 + ZL ZL7 ZL8 ZL9 ZP ZS ZS8 KC4 E5 -"A WSJT-X és a kapcsolódó programok algoritmusai, forráskódja, megjelenése és működése, valamint az FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 üzemmódok protokollspecifikációi az alábbi szerzők egy vagy többjének szerzői joga (C) 2001-2021: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; és a WSJT fejlesztőcsoport többi tagja." +Type 1 Suffixes: /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /P + + + + + MessageAveraging + + + + Message Averaging + Üzenet átlagolás + + + + UTC Sync DT Freq + UTC Sync DT Freq + + + + Modes + + + + Mode + Mód + + + + MultiSettings + + + Default + + + + + MultiSettings::impl + + + &Switch To + Átkapcsolás + + + + &Clone + Klónoz + + + + Clone &Into ... + Klónoz ide ... + + + + R&eset + Reset + + + + &Rename ... + Átnevez ... + + + + &Delete + Törlés + + + + Clone Into Configuration + Klónozás a Konfigurációba + + + + Confirm overwrite of all values for configuration "%1" with values from "%2"? + Megerősíti a "%1" konfiguráció összes értékének felülírását a "%2" értékekkel? + + + + Reset Configuration + Konfiguráció Reset + + + + Confirm reset to default values for configuration "%1"? + Megerősíti a "%1" konfiguráció alapértelmezett értékeinek visszaállítását? + + + + Delete Configuration + Konfiguráció törlése + + + + Confirm deletion of configuration "%1"? + Megerősíti a "%1" konfiguráció törlését? + + + + NameDialog + + + New Configuration Name + Új konfiguráció név + + + + Old name: + Régi név: + + + + &New name: + Új név: + + + + NetworkAccessManager + + + Network SSL/TLS Errors + Hálózati SSL/TLS hibák + + + + OmniRigTransceiver + + + OmniRig: unrecognized mode + OmniRig: nem felismert üzemmód + + + + Failed to start OmniRig COM server + Nem sikerült elindítani az OmniRig COM-szervert + + + + OmniRig: don't know how to set rig frequency + OmniRig: nem tudja, hogyan állítsa be a rig frekvenciáját + + + + OmniRig COM/OLE error: %1 at %2: %3 (%4) + OmniRig COM/OLE hiba: %1 a %2-nél: %3 (%4) + + + + PollingTransceiver + + + Unexpected rig error + Váratlan rig hiba + + + + QObject + + + Failed to open LotW users CSV file: '%1' + Nem sikerült megnyitni a LotW felhasználók CSV fájlját: '%1' + + + + OOB + OOB + + + + Too many colours in palette. + Túl sok színt tartalmaz a paletta. + + + + Error reading waterfall palette file "%1:%2" too many colors. + Hiba a vízesés paletta fájl olvasásakor "%1: %2" túl sok a szín. + + + + Error reading waterfall palette file "%1:%2" invalid triplet. + Hiba a vízesés paletta fájl olvasásakor "%1:%2" helytelen triplet. + + + + Error reading waterfall palette file "%1:%2" invalid color. + Hiba a vízesés paletta fájl olvasásakor "%1: %2" helytelen szín. + + + + Error opening waterfall palette file "%1": %2. + Hiba a "%1" vízesés paletta fájl megnyitásakor: %2. + + + Error writing waterfall palette file "%1": %2. + Hiba a "%1" vízesés paletta fájl írásakor: %2. + + + + QSYMessage + + + WSJT-X Popup + + + + + TextLabel + TextLabel + + + + Reply +Yes + + + + + Reply +No + + + + + QSYMessageCreator + + + Message Creator + + + + + HF + + + + + + SSB + + + + + + + CW + + + + + + FM + + + + + FST4 + + + + + FT4 + + + + + + FT8 + + + + + JT9 + + + + + JT65 + + + + + + + + Message + Üzenet + + + + 630 M + + + + + 160 M + + + + + 80 M + + + + + 60 M + + + + + 40 M + + + + + 30 M + + + + + 20 M + + + + + 17 M + + + + + 15 M + + + + + 12 M + + + + + 28 MHz + + + + + 29 MHz + + + + + + + Mode + + + + + + + Band + + + + + + + SAVE + + + + + + + kHz + + + + + + + Send +Message + + + + + VHF + + + + + + 50 MHz + + + + + + 144 MHz + + + + + + 222 MHz + + + + + + 432 MHz + + + + + + 902 MHz + + + + + + 903 MHz + + + + + + 1296 MHz + + + + + + 2304 MHz + + + + + + 3400 MHz + + + + + + 5760 MHz + + + + + + 10368 MHz + + + + + 24192 MHz + + + + + 40 MHz + + + + + 70 MHz + + + + + MSK144 + + + + + FM MHz + + + + + EME + + + + + 24048 MHz + + + + + Q65-30B + + + + + Q65-60C + + + + + Q65-60D + + + + + Q65-60E + + + + + Q65-120D + + + + + General + + + + + Please call me by phone + + + + + Please check Ping Jockey + + + + + You are in the log + + + + + You are transmitting in the wrong time slot + + + + + You are not in Contest Mode + + + + + Your audio is distorted + + + + + Your transmitter is overmodulated + + + + + Please check ON4KST + + + + + Please transmit above 1000 Hz + + + + + Check your email + + + + + Please check HB9Q Logger + + + + + Please check your PC Clock + + + + + You are transmitting on top of a rare DX station + + + + + Please QSL via LoTW + + + + + Send Message + + + + + MessageCreator + + + + + QSYMonitor + + + QSYMonitor + + + + + Clear + + + + + QSY Monitor + + + + + RemoteFile + + + + + + + + File System Error + Fájlrendszer hiba + + + + Cannot rename file: +"%1" +to: "%2" +Error(%3): %4 + Nem lehet átnevezni a fájlt: +"%1" +erre: "%2" +Hiba(%3): %4 + + + + Cannot delete file: +"%1" + Nem lehet törölni a fájlt: +"%1" + + + + + + Network Error + Hálózati hiba + + + + Too many redirects: %1 + Túl sok átirányítás: %1 + + + + Redirect not followed: %1 + Az átirányítás sikertelen: %1 + + + + Cannot commit changes to: +"%1" + Nem lehet végrehajtani a módosításokat a következőben: +"%1" + + + + Cannot open file: +"%1" +Error(%2): %3 + Nem lehet megnyitni a fájlt: +"%1" +Hiba(%2): %3 + + + + Cannot make path: +"%1" + Nem lehet útvonalat létrehozni: +"%1" + + + + Cannot write to file: +"%1" +Error(%2): %3 + Nem lehet írni a fájlba: +"%1" +Hiba(%2): %3 + + + + SampleDownloader::impl + + + + Download Samples + Minták letöltése + + + + &Abort + Megszakít + + + + &Refresh + Frissít + + + + &Details + Részletek + + + + Base URL for samples: + A minták elérési URL címe: + + + + Only use HTTP: + Csak HTTP használata: + + + + Check this if you get SSL/TLS errors + Jelölje be ezt, ha SSL/TLS hibákat kap + + + + Input Error + Beviteli hiba + + + + Invalid URL format + Helytelen URL formátum + + + + SoundInput + + + An error opening the audio input device has occurred. + Hiba történt az audio bemeneti eszköz megnyitásakor. + + + + An error occurred during read from the audio input device. + Hiba történt az audio bemeneti eszközről történő olvasás során. + + + + Non-recoverable error, audio input device not usable at this time. + Nem javítható hiba, az audio bemeneti eszköz jelenleg nem használható. + + + + Requested input audio format is not valid. + A kért bemeneti hangformátum nem érvényes. + + + + Requested input audio format is not supported on device. + A kért bemeneti hangformátum nem támogatott az eszközön. + + + + Failed to initialize audio sink device + Nem sikerült inicializálni a hangforrás eszközt. + + + + Idle + Inaktív + + + + Receiving + Felvétel + + + + Suspended + Felfüggesztve + + + + Interrupted + Megszakítva + + + + Error + Hiba + + + + Stopped + Leállítva + + + + SoundOutput + + + An error opening the audio output device has occurred. + Hiba történt az audió kimeneti eszköz megnyitásakor. + + + + An error occurred during write to the audio output device. + Hiba történt az audió kimeneti eszközre történő írás során. + + + + Audio data not being fed to the audio output device fast enough. + A hangadatok nem elég gyorsan jutnak el a hangkimeneti eszközhöz. + + + + Non-recoverable error, audio output device not usable at this time. + Nem javítható hiba, a hangkimeneti eszköz jelenleg nem használható. + + + + Requested output audio format is not valid. + A kért kimeneti hangformátum nem érvényes. + + + + Requested output audio format is not supported on device. + A kért kimeneti hangformátum nem támogatott az eszközön. + + + + Audio output restart attempt failed. + + + + + + No audio output device configured. + Nincs audió kimeneti eszköz konfigurálva. + + + + No audio output stream is active. + + + + + Idle + Inaktív + + + + Sending + Elküldve + + + + Suspended + Felfüggesztve + + + + Interrupted + Megszakítva + + + + Error + Hiba + + + + Stopped + Leállítva + + + + SplashScreen + + + WSJT-X — Welcome + + + + + WSJT-X startup information. Press Escape to close. + + + + + StationDialog + + + Add Station + Állomás hozzáadása + + + + &Band: + Sáv: + + + + &Offset (MHz): + Offset (MHz): + + + + &Antenna: + Antenna: + + + + StationList::impl + + + Band name + Sáv név + + + + Frequency offset + Frekvencia eltolás + + + + Antenna description + Antenna leírása + + + + Band + Sáv + + + + Offset + Offset + + + + Antenna Description + Antenna Leírás + + + + TCITransceiver + + + ConnectionRefused + + + + + RemoteHostClosed + + + + + HostNotFound + + + + + SocketAccess + + + + + SocketResource + + + + + SocketTimeout + + + + + DatagramTooLarge + + + + + Network + + + + + AddressInUse + + + + + SocketAddressNotAvailable + + + + + UnsupportedSocketOperation + + + + + UnfinishedSocketOperation + + + + + ProxyAuthenticationRequired + + + + + SslHandshakeFailed + + + + + ProxyConnectionRefused + + + + + ProxyConnectionClosed + + + + + ProxyConnectionTimeout + + + + + ProxyNotFound + + + + + ProxyProtocol + + + + + Operation + + + + + SslInternal + + + + + SslInvalidUserData + + + + + Temporary + + + + + UnknownSocket + + + + + UnknownSocketError + + + + + TCI websocket error: %1 + + + + + TCI SDR could not be switched on + + + + + TCI SDR is not switched on + + + + + TCI RX2 could not be enabled + + + + + TCI Audio could not be switched on + + + + + + TCI could not be opened + + + + + + + TCI sent an invalid VFO frequency + + + + + + TCI failed to set ptt + + + + + TCI should use PTT via CAT + + + + + + TCI failed set rxfreq + + + + + + TCI failed set mode + + + + + TCI modulator not Idle + + + + + TCI source commitment; playout evidence is protocol-send dead reckoning, not DAC confirmation + + + + + TCI WebSocket send progress; no radio DAC or RF playback confirmation + + + + + TransceiverBase + + + Unexpected rig error + Váratlan rig hiba + + + + WideGraph + + + Dialog + Dialog + + + Controls + Vezérlők + + + + Spectrum gain + Spektrum erősítése, (nagyítása) + + + Palette + Színek + + + + <html><head/><body><p>Enter definition for a new color palette.</p></body></html> + <html><head/><body><p>Adja meg egy új színpaletta paramétereit.</p></body></html> + + + + Adjust... + Beállítás... + + + + Total power (dB) + + + + + Waterfall gain + Vízesés fényereje + + + + <html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html> + <html><head/><body><p>A vízesés alatti spektrum-grafikon terület méretének beállítására szolgál.</p></body></html> + + + + % + % + + + + Spec + Rész + + + + <html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html> + <html><head/><body><p>A spektrum szintjének simítása a teljes megjelenített frekvenciatartományban.</p></body></html> + + + + Flatten + Simít + + + <html><head/><body><p>Compute and save a reference spectrum. (Not yet fully implemented.)</p></body></html> + <html><head/><body><p>Referencia spektrum kiszámítása és mentése. (Még nincs teljesen megvalósítva.)</p></body></html> + + + + Ref Spec + Ref.Spekt. + + + + Smoothing of Linear Average spectrum + A Lineáris Átlag opció spektrum simítása + + + + Smooth + Finomítás + + + + Compression factor for frequency scale + A frekvenciaskála felbontása szabályozható a használatával + + + + <html><head/><body><p>Controls</p></body></html> + + + + + Bins/Pixel + Bins/Pixel + + + + + <html><head/><body><p>Position of time stamp above each interval line</p></body></html> + + + + + Time stamp + + + + + + Off + + + + + Left + Bal + + + + Right + Jobb + + + + Palette + + + + + Select waterfall palette + Válasszon ki egy vízesés palettát + + + + Bars + + + + + Freq + + + + + <html><head/><body><p>Apply a saved reference spectrum to flatten the received passband. Available after a reference spectrum has been measured. (Not yet fully implemented.)</p></body></html> + + + + + <html><head/><body><p>Select data for spectral display</p></body></html> + <html><head/><body><p>Adatok kiválasztása, hogy a spektrum hogyan jelenjen meg</p></body></html> + + + + Current + Jelenlegi + + + + Cumulative + Átlagolt + + + + Linear Avg + Lineáris Átlag + + + + Reference + Referencia + + + + Q65_Sync + Q65_Sync + + + + <html><head/><body><p>Frequency at left edge of waterfall</p></body></html> + <html><head/><body><p>A Frekvencia értéke a vízesés bal szélén</p></body></html> + + + + Hz + Hz + + + + Start + Kezdő + + + + <html><head/><body><p>Decode JT9 only above this frequency</p></body></html> + <html><head/><body><p>JT9 dekódolása csak ezen frekvencia felett</p></body></html> + + + + Hz + Hz + + + + Split + Split + + + + Number of FFTs averaged (controls waterfall scrolling rate) + Az átlagolt FFT-k száma (a vízesés görgetési sebességét szabályozza) + + + + N Avg + N Átlag + + + + Waterfall zero + Vízesés kontraszt + + + + Spectrum zero + Nulla Spektrum + + + + User Defined + Felhasználó definiált + + + + Wide Graph + Széles-grafikon + + + + + Read Palette + Paletta olvasása + + + + WorkedBefore + + + Invalid ADIF field %0: %1 + Helytelen %0 ADIF-mező: %1 + + + + Malformed ADIF field %0: %1 + Rosszul formázott %0 ADIF mező: %1 + + + + Invalid ADIF header + Helytelen ADIF fejléc + + + + Error opening ADIF log file for read: %0 + Hiba az ADIF Log-fájl olvasásra megnyitásakor: %0 + + + + configuration_dialog + + + Settings + Beállítások + + + + Genera&l + Á&ltalános + + + + General station details and settings. + Az állomás általános adatai és beállításai. + + + + Station Details + Saját állomás adatok + + + + My C&all: + Hívójel: + + + + Station callsign. + Saját állomás hívójele. + + + + M&y Grid: + QRA: + + + + <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> + <html><head/><body><p>Saját QRA lokátor, lehetőleg 6 karakter.</p></body></html> + + + + Check to allow grid changes from external programs + Jelölje be, ha engedélyezi a QRA módosítását külső programokból. + + + + AutoGrid + AutoQRA + + + + IARU Region: + IARU Region: + + + + <html><head/><body><p>Select your IARU region.</p></body></html> + <html><head/><body><p>Válassza ki az IARU régióját.</p></body></html> + + + + Message generation for type 2 compound callsign holders: + Üzenet létrehozása a 2.típusú összetett hívójel használatakor: + + + + <html><head/><body><p>Type 2 compound callsigns are those with prefixes or suffixes not included in the allowed shortlist (See Help-&gt;Add-on prefixes and suffixes).</p><p>This option determines which generated messages should contain your full type 2 compound call sign rather than your base callsign. It only applies if you have a type 2 compound callsign.</p><p>This option controls the way the messages that are used to answer CQ calls are generated. Generated messages 6 (CQ) and 5 (73) will always contain your full callsign. The JT65 and JT9 protocols allow for some standard messages with your full call at the expense of another piece of information such as the DX call or your locator.</p><p>Choosing message 1 omits the DX callsign which may be an issue when replying to CQ calls. Choosing message 3 also omits the DX callsign and many versions of this and other software will not extract the report. Choosing neither means that your full callsign only goes in your message 5 (73) so your QSO partner may log the wrong callsign.</p><p>None of these options are perfect, message 3 is usually best but be aware your QSO partner may not log the report you send them.</p></body></html> + <html><head/><body><p>A 2.típusú összetett hívójelek olyan elő- vagy utótagokat tartalmaznak, amelyek nem szerepelnek a megadott rövid listában (lásd Súgó-&gt;Prefixek és Suffixek listája).</p><p>Ez az opció határozza meg, hogy mely generált üzeneteknek kell tartalmazniuk az Ön teljes 2.típusú összetett hívójelét az alap hívójele helyett. Csak akkor alkalmazható, ha Ön 2.típusú összetett hívójellel rendelkezik.</p><p>Ez az opció szabályozza a CQ-hívások megválaszolásához használt üzenetek létrehozásának módját. A generált 6. (CQ) és 5. (73) üzenetek mindig tartalmazni fogják az Ön teljes hívójelét. A JT65 és JT9 protokollok lehetővé teszik, hogy néhány szabványos üzenet az Ön teljes hívójelét tartalmazza egy másik információ, például a DX-Hívójel vagy az Ön lokátora rovására.</p><p>Az 1. üzenet választása esetén a DX-Hívójel kimarad, ami problémát jelenthet a CQ hívásokra való válaszadáskor. A 3. üzenet kiválasztása szintén kihagyja a DX-Hívójelet, és ennek és más szoftvereknek számos verziója nem fogja kinyerni a riportot. Egyiket sem választva, akkor az Ön teljes hívójele csak az 5. üzenetben szerepel (73), így a QSO partnere rossz hívójelet naplózhat.</p><p>Ezek közül egyik lehetőség sem tökéletes, a 3. üzenet még a legjobb, de ne feledje, hogy a QSO partnere nem biztos, hogy naplózza az Ön által küldött riportot.</p></body></html> + + + + Full call in Tx1 + Teljes hívójele a Tx1-ben + + + + Full call in Tx3 + Teljes hívójele a Tx3-ban + + + + Full call in Tx5 only + Teljes hívójele csak a Tx5-ben + + + + Display + Megjelenítés + + + + Show outgoing transmitted messages in the Rx frequency window. + A kimenő továbbított üzenetek megjelenítése az Rx-frekvencia ablakban. + + + + &Tx messages to Rx frequency window + Tx üzenetek az Rx-frekvencia ablakban + + + + Show if decoded stations are new DXCC entities or worked before. + Megmutatja, hogy a dekódolt állomások új DXCC entitások-e, vagy már volt-e QSO velük korábban. + + + Show &DXCC, grid, and worked-before status + DXCC, QRA és a volt QSO állapot megjelenítése + + + + <html><head/><body><p>Check to have decodes for a new period start at the top of the Band Activity window and not scroll off the top when the window is full.</p><p>This is to aid selecting decodes to double-click while decoding is still in progress. Use the Band Activity vertical scroll bar to reveal decodes past the bottom of the window.</p></body></html> + <html><head/><body><p>Jelölje be, hogy az új periódus dekódolásai a Sáv-aktivitás ablak tetején kezdődjenek, és ne gördüljön le felülről, amikor az ablak megtelt.</p><p>Ez megkönnyíti a dekódolás kiválasztását a dupla kattintáshoz, miközben a dekódolás még folyamatban van. A Sáv-aktivítás függőleges görgetősávjának segítségével az ablak alján túlfutó dekódolásokat is megjelenítheti.</p></body></html> - - No data read from disk. Wrong file format? - Nincs adatolvasás a lemezről. Rossz fájlformátum? + + Start new period decodes at top + Új periódus dekódolásának kezdése fentről - - Confirm Delete - Törlés megerősítése + Show principal prefix instead of country name + Prefix megjelenítése az ország neve helyett - - Are you sure you want to delete all *.wav and *.c2 files in "%1"? - Biztos, hogy törölni akarja az összes *.wav és *.c2 fájlt a "%1"-ben? + + Set the font characteristics for the application. + Az alkalmazás betűjének beállítása. - - Keyboard Shortcuts - Gyorsbillentyűk + + Font... + Alkalmazás betű... - - <table cellspacing=1> - <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> - <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> - <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> - <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> - <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> - <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> - <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> - <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> - <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> - <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: toggle "Call 1st")</td></tr> - <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> - <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> - <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> - <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> - <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 2000 Hz</td></tr> - <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> - <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> - <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 2000 Hz</td></tr> - <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> - <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> - <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> - <tr><td><b>Alt+C </b></td><td>Toggle "Call 1st" checkbox</td></tr> - <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> - <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> - <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> - <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> - <tr><td><b>Alt+E </b></td><td>Erase</td></tr> - <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> - <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> - <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> - <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> - <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> - <tr><td><b>Alt+N </b></td><td>Enable Tx</td></tr> - <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> - <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> - <tr><td><b>Alt+Q </b></td><td>Log QSO</td></tr> - <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> - <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> - <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> - <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> - <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> -</table> - Keyboard shortcuts help window contents - A billentyűparancsok segítik az ablak tartalmát - <table cellspacing=1> - <tr><td><b>Esc </b></td><td>Tx leállítása, QSO megszakítása, következő hívás törlése</td></tr> - <tr><td><b>F1 </b></td><td>Online felhasználói kézikönyv (Vagy: Tx6 adása)</td></tr> - <tr><td><b>Shift+F1 </b></td><td>Szerzői jogi nyilatkozat</td></tr> - <tr><td><b>Ctrl+F1 </b></td><td>WSJT-X névjegy</td></tr> - <tr><td><b>F2 </b></td><td>Beállítások ablak megnyitása (Vagy: Tx2 adása)</td></tr> - <tr><td><b>F3 </b></td><td>Billentyűparancsok megjelenítése (Vagy: Tx3 adása)</td></tr> - <tr><td><b>F4 </b></td><td>DX Hívójel, DX QRA, Tx 1-4 üzenetek törlése (Vagy: Tx4 adása)</td></tr> - <tr><td><b>Alt+F4 </b></td><td>Kilépés a programból</td></tr> - <tr><td><b>F5 </b></td><td>Speciális egérparancsok megjelenítése (Vagy: Tx5 adása)</td></tr> - <tr><td><b>F6 </b></td><td>Következő fájl megnyitása a könyvtárban (Vagy: "Call 1st" választó)</td></tr> - <tr><td><b>Shift+F6 </b></td><td>A könyvtárban maradt összes fájl dekódolása</td></tr> - <tr><td><b>F7 </b></td><td>Üzenet átlagolás ablak megjelenítése</td></tr> - <tr><td><b>F11 </b></td><td>Az Rx-frekvenciát 1 Hz-el lejjebb mozgatja</td></tr> - <tr><td><b>Ctrl+F11 </b></td><td>Az azonos Rx és Tx frekvenciát 1 Hz-cel lejjebb mozgatja</td></tr> - <tr><td><b>Shift+F11 </b></td><td>A Tx-frekvencia 60 Hz-cel (FT8) vagy 90 Hz-cel (FT4) lejjebb mozgatása</td></tr> - <tr><td><b>Ctrl+Shift+F11 </b></td><td>A skála (dial) frekvenciát 2000 Hz-el lejjebb mozgatja</td></tr> - <tr><td><b>F12 </b></td><td>Az Rx frekvenciát 1 Hz-el feljebb mozgatja</td></tr> - <tr><td><b>Ctrl+F12 </b></td><td>Az azonos Rx és Tx frekvenciát 1 Hz-el feljebb mozgatja</td></tr> - <tr><td><b>Shift+F12 </b></td><td>A Tx-frekvenciát 60 Hz-el (FT8), vagy 90 Hz-el (FT4) feljebb mozgatja</td></tr> - <tr><td><b>Ctrl+Shift+F12 </b></td><td>A skála (dial) frekvenciát 2000 Hz-el feljebb mozgatja</td></tr> - <tr><td><b>Alt+1-6 </b></td><td>Állítsa most az adást erre a számra az 1-es fülön</td></tr> - <tr><td><b>Ctl+1-6 </b></td><td>Állítsa a következő adást erre a számra az 1-es fülön.</td></tr> - <tr><td><b>Alt+B </b></td><td>A "Legjobb S+P" állapot átváltása</td></tr> - <tr><td><b>Alt+C </b></td><td>A "Call 1st"-választó mező átváltása</td></tr> - <tr><td><b>Alt+D </b></td><td>Dekódolás újra a QSO frekvencián</td></tr> - <tr><td><b>Shift+D </b></td><td>Teljes dekódolás (mindkét ablak)</td></tr> - <tr><td><b>Ctrl+E </b></td><td>Bekapcsolja a Tx páros/1.-et</td></tr> - <tr><td><b>Shift+E </b></td><td>Kikapcsolja a Tx páros/1.-et</td></tr> - <tr><td><b>Alt+E </b></td><td>Törlés</td></tr> - <tr><td><b>Ctrl+F </b></td><td>A szabad szöveges üzenet mező szerkesztése</td></tr> - <tr><td><b>Alt+G </b></td><td>Szabványos üzenetek létrehozása</td></tr> - <tr><td><b>Alt+H </b></td><td>Tx Állj</td></tr> - <tr><td><b>Ctrl+L </b></td><td>Hívójel keresése az adatbázisban, szabványos üzenetek generálása</td></tr> - <tr><td><b>Alt+M </b></td><td>Vétel. BE/KI</td></tr> - <tr><td><b>Alt+N </b></td><td>Tx engedélyezése. BE/KI</td></tr> - <tr><td><b>Ctrl+O </b></td><td>Egy .wav fájl megnyitása</td></tr> - <tr><td><b>Alt+O </b></td><td>Operátor váltás</td></tr> - <tr><td><b>Alt+Q </b></td><td>QSO naplózása</td></tr> - <tr><td><b>Ctrl+R </b></td><td>Tx4 üzenet beállítása RRR-re (FT4-ben nem)</td></tr> - <tr><td><b>Alt+R </b></td><td>Tx4 üzenet beállítása RR73-ra</td></tr> - <tr><td><b>Alt+S </b></td><td>Vétel megállítása (Monitorozás megállítása)</td></tr> - <tr><td><b>Alt+T </b></td><td>Hangolás állapotának váltása</td></tr> - <tr><td><b>Alt+Z </b></td><td>Kiakadt dekóder állapotának törlése</td></tr> -</table> + + Set the font characteristics for the Band Activity and Rx Frequency areas. + A Sáv-aktivitás és az Rx-frekvencia területek betűjének beállítása. + + + + Decoded Text Font... + Dekódolt szöveg betű... + + + + Include a separator line between periods in the band activity window. + Helyezzen elválasztó sort a periódusok közé a Sáv-aktivitás ablakban. + + + + &Blank line between decoding periods + Üres sor a dekódolási periódusok között + + + + Show distance to DX station in miles rather than kilometers. + A DX állomástól mért távolság megjelenítése kilométer helyett mérföldben. + + + + Display dista&nce in miles + Távolság megjelenítése mérföldben + + + + Behavior + Viselkedés + + + + Decode after EME delay + Dekódolás az EME késedelem után + + + Tx watchdog: + Tx időfigyelő: + + + + <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> + <html><head/><body><p>A felügyelet nélkül hagyott adások megszakítása előtti percek száma</p></body></html> + + + + Disabled + Letiltva + + + + minutes + perc + + + + Single decode + Egyszeres dekódolás + + + <html><head/><body><p>Some rigs are not able to process CAT commands while transmitting. This means that if you are operating in split mode you may have to uncheck this option.</p></body></html> + <html><head/><body><p>Egyes rigek nem képesek feldolgozni a CAT-parancsokat adás közben. Ez azt jelenti, hogy ha osztott (split) módban dolgozik, akkor előfordulhat, hogy ezt az opciót ki kell kapcsolnia.</p></body></html> + + + Allow Tx frequency changes while transmitting + Tx frekvencia változtatások engedélyezése adás közben + + + + Don't start decoding until the monitor button is clicked. + Nem kezdi el a dekódolást, amíg a Vétel gombra nem kattint. + + + + Mon&itor off at startup + Induláskor a Vétel ki van kapcsolva + + + + <html><head/><body><p>Check this if you wish to automatically return to the last monitored frequency when monitor is enabled, leave it unchecked if you wish to have the current rig frequency maintained.</p></body></html> + <html><head/><body><p>Jelölje be ezt, ha automatikusan vissza kíván térni az utoljára használt vételi frekvenciára amikor a Vétel engedélyezve van; ne jelölje ezt be, ha azt szeretné, hogy a rig aktuális frekvenciája maradjon meg.</p></body></html> + + + + Monitor returns to last used frequency + A Vétel visszatér a legutóbbi frekvenciára + + + + Alternate F1-F6 bindings + Alternatív F1-F6 hozzárendelések + + + + Turns off automatic transmissions after sending a 73 or any other free +text message. + Kikapcsolja az automatikus adást a 73 vagy bármely más +szabad szöveges üzenet elküldése után. + + + + Di&sable Tx after sending 73 + Tx letiltása a 73 elküldése után + + + + Send a CW ID after every 73 or free text message. + Elküld egy CW azonosítót minden 73 vagy szabad szöveges üzenet után. + + + + CW ID a&fter 73 + CW ID adása a 73 után + + + Periodic CW ID Inter&val: + CW ID adás periódusa: + + + + Send a CW ID periodically every few minutes. +This might be required under your countries licence regulations. +It will not interfere with other users as it is always sent in the +quiet period when decoding is done. + Küld egy CW azonosítót néhány percenként. +Ezt megkövetelhetik az Ön országának engedélyezési szabályai. +Ez nem zavarja a többi felhasználót, mivel ez mindig a nyugodt +időszakban kerül elküldésre, amikor a dekódolás megtörtént. + + + + Automatic transmission mode. + Automatikus adás mód. Hívás elindul, aktiválja a Tx-et. + + + + Show &DXCC, grid, and worked-before status + + + + + Highlight DX Grid in message + + + + + Show DXCC for all messages + + + + + Show the separator line between periods with time stamp of the decode period. + + + + + Show blank line with time stamp + + + + + Show principal prefix instead of country name + + + + + Highlight DX Call in message + + + + + Doubl&e-click on call sets Tx enable + Dupla klikk a hívójelre, Tx engedélyezése + + + + <html><head/><body><p>Open the Astronomical Data window automatically when switching to Q65 or JT65 mode and Decode after EME delay is enabled, and close it when no longer needed.</p><p>Open the QSYMessage Creator automatically if the VHF Features are enabled and such QSY messages are applicable.</p></body></html> + + + + + Auto-open/close Astronomical data window + + + + + Calling CQ forces Call 1st + CQ-ra válasz az 1.Hívás-választóból + + + + <html><head/><body><p>Tx until 73 is received when in MSK144 or Q65 mode. </p></body></html> + - - Special Mouse Commands - Speciális egérparancsok + + MSK144/Q65: Tx until 73 is received + - - <table cellpadding=5> - <tr> - <th align="right">Click on</th> - <th align="left">Action</th> - </tr> - <tr> - <td align="right">Waterfall:</td> - <td><b>Click</b> to set Rx frequency.<br/> - <b>Shift-click</b> to set Tx frequency.<br/> - <b>Ctrl-click</b> or <b>Right-click</b> to set Rx and Tx frequencies.<br/> - <b>Double-click</b> to also decode at Rx frequency.<br/> - </td> - </tr> - <tr> - <td align="right">Decoded text:</td> - <td><b>Double-click</b> to copy second callsign to Dx Call,<br/> - locator to Dx Grid, change Rx and Tx frequency to<br/> - decoded signal's frequency, and generate standard<br/> - messages.<br/> - If <b>Hold Tx Freq</b> is checked or first callsign in message<br/> - is your own call, Tx frequency is not changed unless <br/> - <b>Ctrl</b> is held down.<br/> - </td> - </tr> - <tr> - <td align="right">Erase button:</td> - <td><b>Click</b> to erase QSO window.<br/> - <b>Double-click</b> to erase QSO and Band Activity windows. - </td> - </tr> -</table> - Mouse commands help window contents - Az Egérparancsok segítik az ablak tartalmát - <table cellpadding=5> - <tr> - <th align="right">Rákattintva</th> - <th align="left">Művelet</th> - </tr> - <tr> - <td align="right">Vízesésre:</td> - <td><b>Rákattintás</b> az Rx frekvencia beállításához.<br/> - <b>Shift+Kattintás</b> a Tx frekvencia beállításához.<br/> - <b>Ctrl+Kattintás</b> vagy <b>Jobb kattintás</b> az Rx és Tx frekvencia azonos beállításához.<br/> - <b>Dupla-kattintás</b> az Rx frekvencián is dekódol.<br/> - </td> - </tr> - <tr> - <td align="right">Dekódolt szövegre:</td> - <td><b>Dupla-kattintás</b> bemásolja a második hívójelet a Dx Hívójel-be,<br/> - a lokátort a DX QRA-ba, az Rx és Tx frekvenciát a dekódolt jel frekvenciájára<br/> - állítja, és generál szabványos üzeneteket.<br/> - Ha a <b>Tx frekv.marad</b> négyzet be van jelölve, vagy az üzenetben<br/> - az első hívójel a saját hívójele, a Tx frekvencia nem változik, kivéve ha a<br/> - <b>Ctrl</b>-t lenyomva tartja.<br/> - </td> - </tr> - <tr> - <td align="right">Törlés gombra:</td> - <td><b>Kattintás</b> a gombra, törli a QSO ablakot.<br/> - <b>Dupla-kattintás</b> törli a QSO és a Sáv-aktivítás ablakokat. - </td> - </tr> -</table> + + <html><head/><body><p>Allow kHz frequency offset entry without 'k' suffix.</p></body></html> + - - No more files to open. - Nincs több megnyitható fájl. + + kHz entry without k (restart required) + - - Spotting to PSK Reporter unavailable - A PSK Reporterhez a spottolás nem működik + + <html><head/><body><p>Allow automatic Doppler tracking and split/Fake It/XIT to correct the transmit frequency while transmitting, including corrections of tens of kHz on microwave bands.</p><p>This option does not allow nominal dial or band changes while transmitting or tuning. Leave it unchecked if your rig cannot accept frequency-setting CAT commands while transmitting; WSJT-X will then make one midpoint Doppler correction before transmission starts.</p></body></html> + - - Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. - Kérjük, válasszon másik Tx frekvenciát. A WSJT-X szándélosan nem fog más üzemmódban adni a WSPR alsávban a 30m-en. + + Allow Tx-frequency corrections while transmitting + - - WSPR Guard Band - WSPR Védett Sáv, más típusú modulációs adás blokkolva van benne. + + <html><head/><body><p>Disable the Tune watchdog.</p></body></html> + - - Please choose another dial frequency. WSJT-X will not operate in Fox mode in the standard FT8 sub-bands. - Kérjük, válasszon másik rádióskála frekvenciát. A WSJT-X nem működik Fox módban a szabványos FT8 al-sávokban. + + Tune watchdog + - - Fox Mode warning - Fox mód figyelmeztetés + + <html><head/><body><p>Number of seconds before Tune is aborted</p></body></html> + - - Last Tx: %1 - Utolsó Tx: %1 + + Tune watchdog timeout + - - Should you switch to EU VHF Contest mode? - -To do so, check 'Special operating activity' and -'EU VHF Contest' on the Settings | Advanced tab. - Át akar vátani EU VHF Contest módra? - -Ehhez jelölje be a „Speciális tevékenységek” négyzetet és -az „EU VHFContest” lehetőséget a Beállítások | Haladó fülön. + + seconds + - - Should you switch to ARRL Field Day mode? - Át akar vátani ARRL Field Day módra? + + Tx watchdog: + - - Should you switch to RTTY contest mode? - Át akar váltani RTTY contest módra? + + Tx watchdog timeout + - - - - - Add to CALL3.TXT - Hozzáadás a CALL3.TXT-hez + + ID Inter&val: + - - Please enter a valid grid locator - Adjon meg egy érvényes QRA lokátort + + CW ID interval + - - Cannot open "%1" for read/write: %2 - A "%1" nem nyitható meg olvasásra/írásra: %2 + + <html><head/><body><p>Turn the progress bar red while transmitting.</p></body></html> + - - %1 -is already in CALL3.TXT, do you wish to replace it? - %1 -már szerepel a CALL3.TXT ben, szeretné ezt kicserélni? + + Turn progress bar red while transmitting + - - Warning: DX Call field is empty. - Figyelmeztetés: A DX Hívójel mező üres. + + Additional features + - - Log file error - Log fájl hiba + + Set Rx frequency to Tx frequency after QSO + - - Cannot open "%1" - "%1" nem nyitható meg + + <html><head/><body><p>If a station sends locator, calculate and show the distance in Band Activity pane.</p></body></html> + - - Error sending log to N1MM - Hiba történt a napló N1MM-hez küldésekor + + Show distance in messages with grid + - - Write returned "%1" - A beírás "%1" ad vissza + + <html><head/><body><p>Erase Band Activity and Rx frequency windows after band change.</p></body></html> + - - Stations calling DXpedition %1 - A(z) %1 DXpeditiont hívó állomások + + Erase decodes after band change + - - Hound - Vadász + + Clear DX Grid after QSO + - - Tx Messages - Tx üzenetek + + Show U.S. States in messages with grid + - - - - Confirm Erase - Törlés megerősítése + + Map Grid locator to U.S. State + - - Are you sure you want to erase file ALL.TXT? - Biztos, hogy törölni akarja a ALL.TXT fájlt? + + <html><head/><body><p>Align the text for DXCC, distance and azimuth.</p></body></html> + - - - Confirm Reset - Reset megerősítése + + Align DXCC/distance/azimuth + - - Are you sure you want to erase your contest log? - Biztos, hogy törölni akarja a versenynaplót? + + Alternate Erase button behavior + - - Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. - Ezáltal az aktuális verseny összes QSO-rekordja törlődik. Ezek az ADIF log fájlban megmaradnak, de nem exportálhatók a Cabrillo logba. + + Clear DX Call after QSO + - - Cabrillo Log saved - Cabrillo Log mentve + + <html><head/><body><p>Increase or decrease the space between message text and DXCC.</p></body></html> + - - Are you sure you want to erase file wsjtx_log.adi? - Biztos, hogy törölni akarja a wsjtx_log.adi fájlt? + + DXCC alignment spacing + - - Are you sure you want to erase the WSPR hashtable? - Biztos, hogy törölni akarja a WSPR hash-táblázatot? + + Enable Wait features + - - Tune digital gain - Hangolás digitális erősítése + + <html><head/><body><p>If a station sends a valid Maidenhead locator, calculate and show the great-circle azimuth in Band Activity pane.</p></body></html> + - - Transmit digital gain - Adás digitális erősítése + + Show azimuth in messages with grid + - - Prefixes - Prefixek + + <html><head/><body><p>Increase or decrease the space between DXCC and distance/azimuth.</p></body></html> + - - Network Error - Hálózati hiba + + Distance and azimuth alignment spacing + - - Error: %1 -UDP server %2:%3 - Hiba: %1 -UDP szerver %2:%3 + + Less button coloring (restart required) + - - File Error - Fájl hiba + + &Radio + &Rádió - - Phase Training Disabled - Gyakorlási fázis letiltva + + Radio interface configuration settings. + Rádió interfész konfigurációs beállítások. - - Phase Training Enabled - Gyakorlási fázis engedélyezve + + <html><head/><body><p>Use only VFO A for split operation (the program temporarily changes the QRG of your rig during transmission).</p></body></html> + - - WD:%1m - WD:%1m + + <html><head/><body><p>Use VFO A+B for split operation (works with many rigs, but requires the use of both VFOs).</p></body></html> + - - - Log File Error - Napló fájl hiba + + <html><head/><body><p>Don't use split (not recommended).</p></body></html> + - - Are you sure you want to clear the QSO queues? - Biztos, hogy törölni akarja a QSO-várólistát? + + Settings that control your CAT interface. + A CAT interfészt vezérlő beállítások. - - - MessageAveraging - - - Message Averaging - Üzenet átlagolás + + CAT Control + CAT Vezérlés - - UTC Sync DT Freq - UTC Sync DT Freq + + + Port: + Port: - - - Modes - - - Mode - Mód + + Serial port used for CAT control. + CAT vezérléshez használt soros port. - - - MultiSettings - - Default + + + Serial Port Parameters + COM Port paraméterek + + + + Baud Rate: + Baud Rate: + + + + Serial port data rate which must match the setting of your radio. + Soros port adatátviteli sebessége, amelynek meg kell egyeznie a rádió beállításával. + + + + 1200 - - - MultiSettings::impl - - &Switch To - Átkapcsolás + + 2400 + - - &Clone - Klónoz + + 4800 + - - Clone &Into ... - Klónoz ide ... + + 9600 + - - R&eset - Reset + + 19200 + + + + + 38400 + + + + + 57600 + + + + + 115200 + + + + + <html><head/><body><p>Number of data bits used to communicate with your radio's CAT interface (usually eight).</p></body></html> + <html><head/><body><p>A rádió CAT interfészével való kommunikációhoz használt adatbitek száma (általában nyolc).</p></body></html> + + + + Data bits + Adat bitek + + + + Data Bits + Data Bits + + + + D&efault + Alapért. + + + + Se&ven + Hét + + + + E&ight + Nyolc - - &Rename ... - Átnevez ... + + <html><head/><body><p>Number of stop bits used when communicating with your radio's CAT interface</p><p>(consult you radio's manual for details).</p></body></html> + <html><head/><body><p>A rádió CAT interfészével való kommunikáció során használt stop bitek száma</p><p>(a részletekért tekintse meg a rádió kézikönyvét).</p></body></html> - - &Delete - Törlés + + Stop bits + Stop bitek - - Clone Into Configuration - Klónozás a Konfigurációba + + Stop Bits + Stop Bits - - Confirm overwrite of all values for configuration "%1" with values from "%2"? - Megerősíti a "%1" konfiguráció összes értékének felülírását a "%2" értékekkel? + + + Default + Alapért. - - Reset Configuration - Konfiguráció Reset + + On&e + Egy - - Confirm reset to default values for configuration "%1"? - Megerősíti a "%1" konfiguráció alapértelmezett értékeinek visszaállítását? + + T&wo + Kettő - - Delete Configuration - Konfiguráció törlése + + <html><head/><body><p>Flow control protocol used between this computer and your radio's CAT interface (usually &quot;None&quot; but some require &quot;Hardware&quot;).</p></body></html> + <html><head/><body><p>A számítógép és a rádió CAT interfésze között használt adatáramlás-szabályozás (Flow control) protokoll (általában a &quot;Nincs&quot;, de egyes esetekben a &quot;Hardver&quot; a szükséges).</p></body></html> - - Confirm deletion of configuration "%1"? - Megerősíti a "%1" konfiguráció törlését? + + + Handshake + Handshake (Áramlás szabályozás) - - - NameDialog - - New Configuration Name - Új konfiguráció név + + &None + Nincs - - Old name: - Régi név: + + Software flow control (very rare on CAT interfaces). + Szoftveres adatáramlás-szabályozás (flow control) (CAT-interfészeken nagyon ritka). - - &New name: - Új név: + + XON/XOFF + XON/XOFF (szoftveres) - - - NetworkAccessManager - - Network SSL/TLS Errors - Hálózati SSL/TLS hibák + + Flow control using the RTS and CTS RS-232 control lines +not often used but some radios have it as an option and +a few, particularly some Kenwood rigs, require it). + Adatáramlás-szabályozás (Flow control) az RTS és CTS RS-232 vezérlővonalakkal, +amelyeket nem gyakran használnak, de egyes rádióknál lehetőség van rá +és néhány, különösen egyes Kenwood készülékek megkövetelik ezt. - - - OmniRigTransceiver - - OmniRig: unrecognized mode - OmniRig: nem felismert üzemmód + + &Hardware + Hardver - - Failed to start OmniRig COM server - Nem sikerült elindítani az OmniRig COM-szervert + + Special control of CAT port control lines. + Egyes állomás beállítások megkövetelik, hogy a CAT soros port RTS és/vagy DTR vezérlővonalait magas- vagy alacsony- állapotba kényszerítsük. - - - OmniRig: don't know how to set rig frequency - OmniRig: nem tudja, hogyan állítsa be a rig frekvenciáját + + + Force Control Lines + DTR/RTS CAT port vezérlő-vonalak - - OmniRig COM/OLE error: %1 at %2: %3 (%4) - OmniRig COM/OLE hiba: %1 a %2-nél: %3 (%4) + + + High + Magas - - - PollingTransceiver - - Unexpected rig error - Váratlan rig hiba + + + Low + Alacsony - - - QObject - - Failed to open LotW users CSV file: '%1' - Nem sikerült megnyitni a LotW felhasználók CSV fájlját: '%1' + + DTR: + DTR: - - OOB - OOB + + RTS: + RTS: - - Too many colours in palette. - Túl sok színt tartalmaz a paletta. + + PTT Method + PTT Vezérlés - - Error reading waterfall palette file "%1:%2" too many colors. - Hiba a vízesés paletta fájl olvasásakor "%1: %2" túl sok a szín. + + <html><head/><body><p>No PTT activation, instead the radio's automatic VOX is used to key the transmitter.</p><p>Use this if you have no radio interface hardware.</p></body></html> + <html><head/><body><p>Nincs PTT-aktiválás, helyette a rádió automatikus VOX-át használja az adó kapcsolására.</p><p>Használja ezt, ha nincs rádióinterfész hardvere.</p></body></html> - - Error reading waterfall palette file "%1:%2" invalid triplet. - Hiba a vízesés paletta fájl olvasásakor "%1:%2" helytelen triplet. + + VO&X + VOX - - Error reading waterfall palette file "%1:%2" invalid color. - Hiba a vízesés paletta fájl olvasásakor "%1: %2" helytelen szín. + + &DTR + DTR - - Error opening waterfall palette file "%1": %2. - Hiba a "%1" vízesés paletta fájl megnyitásakor: %2. + + Some radios support PTT via CAT commands, +use this option if your radio supports it and you have no +other hardware interface for PTT. + Egyes rádiók CAT-parancsokon keresztül támogatják a PTT-t; +használja ezt az opciót, ha a rádiója támogatja ezt, és nincs +más hardveres interfész a PTT-hez. - - Error writing waterfall palette file "%1": %2. - Hiba a "%1" vízesés paletta fájl írásakor: %2. + + C&AT + CAT - - - RemoteFile - - - - - - - File System Error - Fájlrendszer hiba + + R&TS + RTS - - Cannot rename file: -"%1" -to: "%2" -Error(%3): %4 - Nem lehet átnevezni a fájlt: -"%1" -erre: "%2" -Hiba(%3): %4 + + <html><head/><body><p>Select the RS-232 serial port utilised for PTT control, this option is available when DTR or RTS is selected above as a transmit method.</p><p>This port can be the same one as the one used for CAT control.</p><p>For some interface types the special value CAT may be chosen, this is used for non-serial CAT interfaces that can control serial port control lines remotely (OmniRig for example).</p></body></html> + <html><head/><body><p>Válassza ki a PTT-vezérléshez használt RS-232 soros portot, ez az opció akkor érhető el, ha fentebb a DTR vagy az RTS van kiválasztva az adás metódushoz.</p><p>Ez a port lehet ugyanaz, mint a CAT-vezérléshez használt port.</p><p>Egyes interfész típusok esetében speciális CAT-érték választható ki; ez olyan nem soros CAT interfészeknél használatos, amelyek távolról vezérelhetik a soros port vezérlővonalait (például OmniRig).</p></body></html> - - Cannot delete file: -"%1" - Nem lehet törölni a fájlt: -"%1" + + Modulation mode selected on radio. + A rádión kiválasztott modulációs mód. - - - - Network Error - Hálózati hiba + + Mode + Üzemmód - - Too many redirects: %1 - Túl sok átirányítás: %1 + + <html><head/><body><p>USB is usually the correct modulation mode,</p><p>unless the radio has a special data or packet mode setting</p><p>for AFSK operation.</p></body></html> + <html><head/><body><p>Általában az USB a helyes modulációs mód,</p><p>kivéve, ha a rádió rendelkezik speciális adat- vagy packet mód beállítási lehetőséggel</p><p>az AFSK működéshez.</p></body></html> - - Redirect not followed: %1 - Az átirányítás sikertelen: %1 + + US&B + USB - - Cannot commit changes to: -"%1" - Nem lehet végrehajtani a módosításokat a következőben: -"%1" + + Don't allow the program to set the radio mode +(not recommended but use if the wrong mode +or bandwidth is selected). + Ne engedje, hogy a program állítsa be a rádió üzemmódját +(ez nem ajánlott, de használ, ha rossz üzemmód +vagy sávszélesség van kiválasztva.) - - Cannot open file: -"%1" -Error(%2): %3 - Nem lehet megnyitni a fájlt: -"%1" -Hiba(%2): %3 + + + None + Nincs - - Cannot make path: -"%1" - Nem lehet útvonalat létrehozni: -"%1" + + Data/P&kt + Data/Pkt - - Cannot write to file: -"%1" -Error(%2): %3 - Nem lehet írni a fájlba: -"%1" -Hiba(%2): %3 + + Some radios can select the audio input using a CAT command, +this setting allows you to select which audio input will be used +(if it is available then generally the Rear/Data option is best). + Egyes rádiók CAT-paranccsal ki tudják választani a hangbemenetet, +ez a beállítás lehetővé teszi, hogy kiválassza, melyik hangbemenetet használja a készülék +(ha rendelkezésre áll, akkor általában a Hátul/Data opció a legjobb). - - - SampleDownloader::impl - - - Download Samples - Minták letöltése + + Transmit Audio Source + Adás hangforrása - - &Abort - Megszakít + + Rear&/Data + Hátul/Data - - &Refresh - Frissít + + &Front/Mic + Elöl/Mic - - &Details - Részletek + + Rig: + Rig: - - Base URL for samples: - A minták elérési URL címe: + + Poll Interval: + Lekérd.időköz: - - Only use HTTP: - Csak HTTP használata: + + <html><head/><body><p>Interval to poll rig for status. Longer intervals will mean that changes to the rig will take longer to be detected.</p></body></html> + <html><head/><body><p>Időköz a rádió állapotának lekérdezéséhez. A hosszabb időközök azt jelentik, hogy a rádió változásainak észlelése ritkábban történik meg.</p></body></html> - - Check this if you get SSL/TLS errors - Jelölje be ezt, ha SSL/TLS hibákat kap + + s + s - - Input Error - Beviteli hiba + + <html><head/><body><p>Attempt to connect to the radio with these settings.</p><p>The button will turn green if the connection is successful or red if there is a problem.</p></body></html> + <html><head/><body><p>Próbáljon meg a beállított beállításokkal csatlakozni a rádióhoz.</p><p>A gomb zöldre vált, ha a kapcsolat sikeres, vagy pirosra, ha probléma van.</p></body></html> - - Invalid URL format - Helytelen URL formátum + + Test CAT + CAT ellenőrzése - - - SoundInput - - An error opening the audio input device has occurred. - Hiba történt az audio bemeneti eszköz megnyitásakor. + + Attempt to activate the transmitter. +Click again to deactivate. Normally no power should be +output since there is no audio being generated at this time. +Check that any Tx indication on your radio and/or your +radio interface behave as expected. + Próbálja meg aktiválni az adót. +A deaktiválásához pedig kattintson újra rá. Normális esetben +nincs kimenő teljesítmény, mivel ekkor nem keletkezik hang. +Ellenőrizze, hogy a rádió és/vagy a rádióinterfész Tx-jelzései +az elvárásoknak megfelelően viselkednek-e. - - An error occurred during read from the audio input device. - Hiba történt az audio bemeneti eszközről történő olvasás során. + + Test PTT + PTT ellenőrzése - - Non-recoverable error, audio input device not usable at this time. - Nem javítható hiba, az audio bemeneti eszköz jelenleg nem használható. + + Split Operation + Osztott (Split) működés - - Requested input audio format is not valid. - A kért bemeneti hangformátum nem érvényes. + + Fake It + Szimulál - - Requested input audio format is not supported on device. - A kért bemeneti hangformátum nem támogatott az eszközön. + + Rig + Rig - - Failed to initialize audio sink device - Nem sikerült inicializálni a hangforrás eszközt. + + A&udio + A&udio - - Idle - Inaktív + + Audio interface settings + Audio interfész beállítások. - - Receiving - Felvétel + + Souncard + Hangkártya - - Suspended - Felfüggesztve + + Soundcard + Hangkártya - - Interrupted - Megszakítva + + Select the audio CODEC to use for transmitting. +If this is your default device for system sounds then +ensure that all system sounds are disabled otherwise +you will broadcast any systems sounds generated during +transmitting periods. + Válassza ki az adáshoz használni kívánt audio CODEC-et. +Ha ez az alapértelmezett eszköz a rendszerhangok számára, +akkor győződjön meg arról, hogy minden rendszerhang le van-e tiltva, +különben az adási periódusok alatt keletkező rendszerhangokat is adni fogja. - - Error - Hiba + + <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> + <html><head/><body><p>Adja meg annak az UDP-szervernek a portszámát, amelyre a WSJT-X-nek frissítéseket kell küldenie. Ha ez nulla, nem fog küldeni frissítéseket.</p></body></html> - - Stopped - Leállítva + + Outgoing interfaces: + Kimenő interfészek: - - - SoundOutput - - An error opening the audio output device has occurred. - Hiba történt az audió kimeneti eszköz megnyitásakor. + + <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> + <html><head/><body><p>Amikor frissítéseket küldünk egy multicast csoportcímre, meg kell adni, hogy melyik hálózati interfész(ek)re küldjük a frissítéseket. Ha a loop-back interfész (visszacsatolási felület) multicast-képes, akkor az legyen kiválasztva.</p><p>A legtöbb felhasználó számára csak a visszacsatolási felületre van szükség, amely lehetővé teszi, hogy ugyanazon a gépen több más alkalmazás is együttműködjön a WSJT-X-el. Ha a más gépeken futó alkalmazásoknak állapotfrissítéseket kell kapniuk, akkor egy megfelelő hálózati interfészt kell használni.</p><p>Némely Linux rendszereken szükség lehet a multicast engedélyezésére a loop-back hálózati interfészen.</p></body></html> - - An error occurred during write to the audio output device. - Hiba történt az audió kimeneti eszközre történő írás során. + + <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> + <html><head/><body><p>Beállítja a multicast (többes-küldéses) adatcsomag átvitelnek engedélyezett útválasztó ugrások számát. Ezt szinte mindenkinek 1-re kell állítania, hogy a kimenő multicast forgalom a helyi alhálózaton belül maradjon.</p></body></html> - - Audio data not being fed to the audio output device fast enough. - A hangadatok nem elég gyorsan jutnak el a hangkimeneti eszközhöz. + + Multicast TTL: + Multicast (többcímű) TTL: - - Non-recoverable error, audio output device not usable at this time. - Nem javítható hiba, a hangkimeneti eszköz jelenleg nem használható. + + Days since last upload + Az utolsó feltöltés óta eltelt napok - - Requested output audio format is not valid. - A kért kimeneti hangformátum nem érvényes. + + Select the audio CODEC to use for receiving. + Válassza ki a vételhez használni kívánt audio CODEC-et. - - Requested output audio format is not supported on device. - A kért kimeneti hangformátum nem támogatott az eszközön. + + &Input: + Bemenet: - - No audio output device configured. - Nincs audió kimeneti eszköz konfigurálva. + + Select the channel to use for receiving. + Válassza ki a vételhez használni kívánt hangcsatornát. - - Idle - Inaktív + + + Mono + Mono - - Sending - Elküldve + + + Left + Bal - - Suspended - Felfüggesztve + + + Right + Jobb - - Interrupted - Megszakítva + + + Both + Sztereo - - Error - Hiba + + Select the audio channel used for transmission. +Unless you have multiple radios connected on different +channels; then you will usually want to select mono or +both here. + Válassza ki az adáshoz használt hangcsatornát. +Hacsak nincs több rádiója, amelyek csatlakoztatva vannak +a különböző csatornákhoz, akkor itt általában a mono, vagy +a sztereo csatornát kell kiválasztani. - - Stopped - Leállítva + + Enable VHF and submode features + VHF és almód funkciók engedélyezése - - - StationDialog - - Add Station - Állomás hozzáadása + + + Update Hamlib + - - &Band: - Sáv: + + 32-bit + - - &Offset (MHz): - Offset (MHz): + + <html><head/><body><p>Revert the last Hamlib update. </p><p>Note: This function is only available on Windows.</p></body></html> + - - &Antenna: - Antenna: + + Revert Update + - - - StationList::impl - - Band name - Sáv név + + <html><head/><body><p>Download the latest libhamlib-4.dll file from Hamlib SourceForge snapshots. </p><p>Note: This function is only available on Windows.</p></body></html> + - - Frequency offset - Frekvencia eltolás + + In use: + - - Antenna description - Antenna leírása + + Backed up: + - - Band - Sáv + + 64-bit + - - Offset - Offset + + Rig Data + - - Antenna Description - Antenna Leírás + + <html><head/><body><p>Stop transmitting immediately when SWR exceeds 2.5.</p></body></html> + - - - TransceiverBase - - Unexpected rig error - Váratlan rig hiba + + Halt Tx when SWR > 2.5 + - - - WideGraph - - Dialog - Dialog + + <html><head/><body><p>Read and display transmit PWR and SWR of your rig.</p></body></html> + - - Controls - Vezérlők + + Read and display PWR and SWR + - - Spectrum gain - Spektrum erősítése, (nagyítása) + + Ou&tput: + Kimenet: - - Palette - Színek + + Output audio channel + - - <html><head/><body><p>Enter definition for a new color palette.</p></body></html> - <html><head/><body><p>Adja meg egy új színpaletta paramétereit.</p></body></html> + + Input audio channel + - - Adjust... - Beállítás... + + <html><head/><body><p>Refresh audio device list.</p></body></html> + - - Waterfall gain - Vízesés fényereje + + Refresh + Frissítés - - <html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html> - <html><head/><body><p>A vízesés alatti spektrum-grafikon terület méretének beállítására szolgál.</p></body></html> + + <html><head/><body><p>Use TCI Audio when available.</p></body></html> + - - % - % + + Use TCI Audio (restart required) + - - Spec - Rész + + <html><head/><body><p>Rx audio level</p></body></html> + - - <html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html> - <html><head/><body><p>A spektrum szintjének simítása a teljes megjelenített frekvenciatartományban.</p></body></html> + + TCI receive audio level + - - Flatten - Simít + + Rx + - - <html><head/><body><p>Compute and save a reference spectrum. (Not yet fully implemented.)</p></body></html> - <html><head/><body><p>Referencia spektrum kiszámítása és mentése. (Még nincs teljesen megvalósítva.)</p></body></html> + + <html><head/><body><p>Sort audio device names alphabetically.</p></body></html> + - - Ref Spec - Ref.Spekt. + + Sort alphabetically + - - Smoothing of Linear Average spectrum - A Lineáris Átlag opció spektrum simítása + + <html><head/><body><p>Hide the usually unusable ALSA CARD subdevices on Linux.</p></body></html> + - - Smooth - Finomítás + + Hide ALSA CARD subdevices (Linux only) + - - Compression factor for frequency scale - A frekvenciaskála felbontása szabályozható a használatával + + + Save Directory + Mentési könyvtár - - Bins/Pixel - Bins/Pixel + + Loc&ation: + Helye: - - Select waterfall palette - Válasszon ki egy vízesés palettát + + Path to which .WAV files are saved. + A .WAV fájlok mentésének elérési útja. - - <html><head/><body><p>Select data for spectral display</p></body></html> - <html><head/><body><p>Adatok kiválasztása, hogy a spektrum hogyan jelenjen meg</p></body></html> + + + TextLabel + TextLabel - - Current - Jelenlegi + + Click to select a different save directory for .WAV files. + Kattintson erre a gombra egy másik mentési könyvtár kiválasztásához a .WAV fájlok számára. - - Cumulative - Átlagolt + + S&elect + Választás - - Linear Avg - Lineáris Átlag + + + AzEl Directory + AzEl könyvtár - - Reference - Referencia + + Location: + Helye: - - Q65_Sync - Q65_Sync + + Select + Választás - - <html><head/><body><p>Frequency at left edge of waterfall</p></body></html> - <html><head/><body><p>A Frekvencia értéke a vízesés bal szélén</p></body></html> + + <html><head/><body><p>Enables additional line in azel.dat for Dpol parameter.</p></body></html> + - - Hz - Hz + + Enable extra line in azel.dat + - - Start - Kezdő + + Power Memory By Band + Emlékezzen a sávonkénti teljesítmény beállításokra. - - <html><head/><body><p>Decode JT9 only above this frequency</p></body></html> - <html><head/><body><p>JT9 dekódolása csak ezen frekvencia felett</p></body></html> + + Remember power settings by band + Teljesítmény sávonkénti megőrzése - - Hz - Hz + + Enable power memory during transmit + Adásteljesítmény megőrzésének engedélyezése - - Split - Split + + Transmit + Adás - - Number of FFTs averaged (controls waterfall scrolling rate) - Az átlagolt FFT-k száma (a vízesés görgetési sebességét szabályozza) + + Enable power memory during tuning + Hangolási teljesítmény megőrzésének engedélyezése - - N Avg - N Átlag + + Tune + Hangolás - - Waterfall zero - Vízesés kontraszt + + Tx &Macros + Tx &Makrók - - Spectrum zero - Nulla Spektrum + + Canned free text messages setup + Szabad "konzerv" szöveges üzenetek beállítása. - - User Defined - Felhasználó definiált + + New &macro: + - - Wide Graph - Széles-grafikon + + &Add + Hozzáad - - - Read Palette - Paletta olvasása + + Add Tx macro + - - - WorkedBefore - - Invalid ADIF field %0: %1 - Helytelen %0 ADIF-mező: %1 + + Adds the entered message to the saved Tx macro list. + - - Malformed ADIF field %0: %1 - Rosszul formázott %0 ADIF mező: %1 + + New Tx macro message + - - Invalid ADIF header - Helytelen ADIF fejléc + + Enter a saved free-text message for the Tx5 dropdown. Free-text messages are limited to 13 characters including spaces. + - - Error opening ADIF log file for read: %0 - Hiba az ADIF Log-fájl olvasásra megnyitásakor: %0 + + &Delete + Töröl - - - configuration_dialog - - Settings - Beállítások + Drag and drop items to rearrange order +Right click for item specific actions +Click, SHIFT+Click and, CRTL+Click to select items + A sorrend átrendezéséhez húzza át az elemeket. +Kattintson a jobb gombbal ide az elemspecifikus műveletekhez. +Kattintás, SHIFT+Kattintás és CRTL+Kattintás az elemek kiválasztásához használhatók. - - Genera&l - Á&ltalános + + Reportin&g + Riport - - General station details and settings. - Az állomás általános adatai és beállításai. + + Reporting and logging settings + Riport és naplózási beállítások. - - Station Details - Saját állomás adatok + + Logging + Naplózás - - My C&all: - Hívójel: + + The program will pop up a partially completed Log QSO dialog when you send a 73 or free text message. + Egy 73, vagy szabad szöveges üzenet elküldésekor felugrik egy részben kitöltött QSO naplózó párbeszédpanel. - - Station callsign. - Saját állomás hívójele. + + Promp&t me to log QSO + A QSO naplózásakor megerősítést kér - - M&y Grid: - QRA: + + Op Call: + Op. hívójele: - - <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> - <html><head/><body><p>Saját QRA lokátor, lehetőleg 6 karakter.</p></body></html> + + Some logging programs will not accept the type of reports +saved by this program. +Check this option to save the sent and received reports in the +comments field. + Egyes naplózó programok nem fogadják el az e program által mentett riport típusokat. +Jelölje be ezt az opciót, ha az elküldött és vett riportokat a megjegyzés mezőbe szeretné menteni. - - Check to allow grid changes from external programs - Jelölje be, ha engedélyezi a QRA módosítását külső programokból. + + d&B reports to comments + dB riport mentése a megjegyzéshez - - AutoGrid - AutoQRA + Check this option to force the clearing of the DX Call +and DX Grid fields when a 73 or free text message is sent. + Jelölje be ezt a lehetőséget a DX Hívójel és DX QRA mezők törléséhez, +amikor egy 73 vagy szabad szöveges üzenet elküldésre kerül. - - IARU Region: - IARU Region: + Clear &DX call and grid after logging + DX Hívójel és QRA törlése a naplózás után - - <html><head/><body><p>Select your IARU region.</p></body></html> - <html><head/><body><p>Válassza ki az IARU régióját.</p></body></html> + + <html><head/><body><p>Some logging programs will not accept WSJT-X mode names.</p></body></html> + <html><head/><body><p>Egyes naplózó programok nem fogadják el a WSJT-X üzemmódneveket.</p></body></html> - - Message generation for type 2 compound callsign holders: - Üzenet létrehozása a 2.típusú összetett hívójel használatakor: + + Con&vert mode to RTTY + Üzemmód átalakítása RTTY-re - - <html><head/><body><p>Type 2 compound callsigns are those with prefixes or suffixes not included in the allowed shortlist (See Help-&gt;Add-on prefixes and suffixes).</p><p>This option determines which generated messages should contain your full type 2 compound call sign rather than your base callsign. It only applies if you have a type 2 compound callsign.</p><p>This option controls the way the messages that are used to answer CQ calls are generated. Generated messages 6 (CQ) and 5 (73) will always contain your full callsign. The JT65 and JT9 protocols allow for some standard messages with your full call at the expense of another piece of information such as the DX call or your locator.</p><p>Choosing message 1 omits the DX callsign which may be an issue when replying to CQ calls. Choosing message 3 also omits the DX callsign and many versions of this and other software will not extract the report. Choosing neither means that your full callsign only goes in your message 5 (73) so your QSO partner may log the wrong callsign.</p><p>None of these options are perfect, message 3 is usually best but be aware your QSO partner may not log the report you send them.</p></body></html> - <html><head/><body><p>A 2.típusú összetett hívójelek olyan elő- vagy utótagokat tartalmaznak, amelyek nem szerepelnek a megadott rövid listában (lásd Súgó-&gt;Prefixek és Suffixek listája).</p><p>Ez az opció határozza meg, hogy mely generált üzeneteknek kell tartalmazniuk az Ön teljes 2.típusú összetett hívójelét az alap hívójele helyett. Csak akkor alkalmazható, ha Ön 2.típusú összetett hívójellel rendelkezik.</p><p>Ez az opció szabályozza a CQ-hívások megválaszolásához használt üzenetek létrehozásának módját. A generált 6. (CQ) és 5. (73) üzenetek mindig tartalmazni fogják az Ön teljes hívójelét. A JT65 és JT9 protokollok lehetővé teszik, hogy néhány szabványos üzenet az Ön teljes hívójelét tartalmazza egy másik információ, például a DX-Hívójel vagy az Ön lokátora rovására.</p><p>Az 1. üzenet választása esetén a DX-Hívójel kimarad, ami problémát jelenthet a CQ hívásokra való válaszadáskor. A 3. üzenet kiválasztása szintén kihagyja a DX-Hívójelet, és ennek és más szoftvereknek számos verziója nem fogja kinyerni a riportot. Egyiket sem választva, akkor az Ön teljes hívójele csak az 5. üzenetben szerepel (73), így a QSO partnere rossz hívójelet naplózhat.</p><p>Ezek közül egyik lehetőség sem tökéletes, a 3. üzenet még a legjobb, de ne feledje, hogy a QSO partnere nem biztos, hogy naplózza az Ön által küldött riportot.</p></body></html> + + <html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html> + <html><head/><body><p>Az operátor hívójele, ha eltér az állomás hívójelétől.</p></body></html> - - Full call in Tx1 - Teljes hívójele a Tx1-ben + + <html><head/><body><p>Check to have QSOs logged automatically, when complete.</p></body></html> + <html><head/><body><p>Jelölje be, hogy a QSO-k automatikusan naplózva legyenek, ha befejeződtek.</p></body></html> - - Full call in Tx3 - Teljes hívójele a Tx3-ban + Log automatically (contesting only) + Automatikus naplózás (csak versenyzéskor) - - Full call in Tx5 only - Teljes hívójele csak a Tx5-ben + + Network Services + Hálózati szolgáltatások - - Display - Megjelenítés + + Enable &PSK Reporter Spotting + PSK Reporter-hez spot küldés engedélyezése - - Show outgoing transmitted messages in the Rx frequency window. - A kimenő továbbított üzenetek megjelenítése az Rx-frekvencia ablakban. + + UDP Server + UDP-Szerver - - &Tx messages to Rx frequency window - Tx üzenetek az Rx-frekvencia ablakban + + UDP Server: + UDP-Szerver: - - Show if decoded stations are new DXCC entities or worked before. - Megmutatja, hogy a dekódolt állomások új DXCC entitások-e, vagy már volt-e QSO velük korábban. + + <html><head/><body><p>Optional hostname of network service to receive decodes.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the broadcasting of UDP status updates.</p></body></html> + <html><head/><body><p>A dekódolások fogadására szolgáló hálózati szolgáltatás opcionális hostneve.</p><p>Formátumok:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>A mező törlése letiltja az UDP állapotfrissítések továbbítását.</p></body></html> - - Show &DXCC, grid, and worked-before status - DXCC, QRA és a volt QSO állapot megjelenítése + + UDP Server port number: + UDP-Szerver port száma: - - <html><head/><body><p>Check to have decodes for a new period start at the top of the Band Activity window and not scroll off the top when the window is full.</p><p>This is to aid selecting decodes to double-click while decoding is still in progress. Use the Band Activity vertical scroll bar to reveal decodes past the bottom of the window.</p></body></html> - <html><head/><body><p>Jelölje be, hogy az új periódus dekódolásai a Sáv-aktivitás ablak tetején kezdődjenek, és ne gördüljön le felülről, amikor az ablak megtelt.</p><p>Ez megkönnyíti a dekódolás kiválasztását a dupla kattintáshoz, miközben a dekódolás még folyamatban van. A Sáv-aktivítás függőleges görgetősávjának segítségével az ablak alján túlfutó dekódolásokat is megjelenítheti.</p></body></html> + + <html><head/><body><p>With this enabled WSJT-X will accept certain requests back from a UDP server that receives decode messages.</p></body></html> + <html><head/><body><p>Ha ez engedélyezve van, a WSJT-X elfogad bizonyos viszontkéréseket a dekódoló üzeneteket fogadó UDP-szervertől.</p></body></html> - - Start new period decodes at top - Új periódus dekódolásának kezdése fentről + + Accept UDP requests + Fogadja el az UDP kéréseket - - Show principal prefix instead of country name - Prefix megjelenítése az ország neve helyett + + <html><head/><body><p>Indicate acceptance of an incoming UDP request. The effect of this option varies depending on the operating system and window manager, its intent is to notify the acceptance of an incoming UDP request even if this application is minimized or hidden.</p></body></html> + <html><head/><body><p>Egy bejövő UDP-kérés elfogadását jelzi. Ennek az opciónak a hatása az operációs rendszertől és az ablakkezelőtől függően változik, a célja az, hogy a bejövő UDP-kérés elfogadásáról értesítsen, még akkor is, ha ez az alkalmazás minimalizálva vagy elrejtve van.</p></body></html> - - Set the font characteristics for the application. - Az alkalmazás betűjének beállítása. + + Notify on accepted UDP request + Értesítsen elfogadott UDP kérésről - - Font... - Alkalmazás betű... + + <html><head/><body><p>Restore the window from minimized if an UDP request is accepted.</p></body></html> + <html><head/><body><p>Visszaállítja az ablakot a minimalizált állapotból, ha egy UDP-kérés elfogadásra kerül.</p></body></html> - - Set the font characteristics for the Band Activity and Rx Frequency areas. - A Sáv-aktivitás és az Rx-frekvencia területek betűjének beállítása. + + Accepted UDP request restores window + Elfogadott UDP kérés visszaállítja az ablakot - - Decoded Text Font... - Dekódolt szöveg betű... + + Secondary UDP Server (deprecated) + Másodlagos UDP-Szerver (elavult) - - Include a separator line between periods in the band activity window. - Helyezzen elválasztó sort a periódusok közé a Sáv-aktivitás ablakban. + + <html><head/><body><p>When checked, WSJT-X will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html> + <html><head/><body><p>Ha be van jelölve, a WSJT-X a naplózott QSO-t ADIF formátumban továbbítja a megadott hostnévre és portra. </p></body></html> - - &Blank line between decoding periods - Üres sor a dekódolási periódusok között + + Enable logged contact ADIF broadcast + Engedélyezi a naplózott QSO ADIF formátumú küldését - - Show distance to DX station in miles rather than kilometers. - A DX állomástól mért távolság megjelenítése kilométer helyett mérföldben. + + Server name or IP address: + Szerver neve, vagy IP-címe: - - Display dista&nce in miles - Távolság megjelenítése mérföldben + + <html><head/><body><p>Optional host name of N1MM Logger+ program to receive ADIF UDP broadcasts. This is usually 'localhost' or ip address 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable broadcasting of ADIF information via UDP.</p></body></html> + <html><head/><body><p>Az N1MM Logger+ program opcionális gépneve az ADIF UDP továbbítások fogadására. Ez általában a 'localhost' vagy a 127.0.0.1 ip cím.</p><p>Formátumok:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>A mező törlése letiltja az ADIF-információk UDP-n keresztüli továbbítását.</p></body></html> - - Behavior - Viselkedés + + Server port number: + Szerver port száma: - - Decode after EME delay - Dekódolás az EME késedelem után + + <html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html> + <html><head/><body><p>Adja meg a portszámot, amelyet a WSJT-X az ADIF-naplóadatok UDP-továbbításához használ. Az N1MM Logger-nél ennek 2333-nak kell lennie. Ha ez nulla, akkor nem fog frissítéseket sugározni.</p></body></html> - - Tx watchdog: - Tx időfigyelő: + + Frequencies + Frekvenciák - - <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> - <html><head/><body><p>A felügyelet nélkül hagyott adások megszakítása előtti percek száma</p></body></html> + + Default frequencies and band specific station details setup + Alapértelmezett frekvenciák és sávspecifikus állomásadatok beállítása. - - Disabled - Letiltva + + <html><head/><body><p>See &quot;Frequency Calibration&quot; in the WSJT-X User Guide for details of how to determine these parameters for your radio.</p></body></html> + <html><head/><body><p>A WSJT-X felhasználói kézikönyvben a &quot;Frekvencia kalibrálás&quot; című fejezetben talál részleteket arról, hogyan határozza meg ezeket a paramétereket a rádiója számára.</p></body></html> - - minutes - perc + + Frequency Calibration + Frekvencia kalibrálás - - Single decode - Egyszeres dekódolás + + Slope: + Meredekség: - - <html><head/><body><p>Some rigs are not able to process CAT commands while transmitting. This means that if you are operating in split mode you may have to uncheck this option.</p></body></html> - <html><head/><body><p>Egyes rigek nem képesek feldolgozni a CAT-parancsokat adás közben. Ez azt jelenti, hogy ha osztott (split) módban dolgozik, akkor előfordulhat, hogy ezt az opciót ki kell kapcsolnia.</p></body></html> + + ppm + ppm - - Allow Tx frequency changes while transmitting - Tx frekvencia változtatások engedélyezése adás közben + + Intercept: + Eltérés: - - Don't start decoding until the monitor button is clicked. - Nem kezdi el a dekódolást, amíg a Vétel gombra nem kattint. + + Hz + Hz - - Mon&itor off at startup - Induláskor a Vétel ki van kapcsolva + + Working Frequencies + Munkafrekvenciák - - <html><head/><body><p>Check this if you wish to automatically return to the last monitored frequency when monitor is enabled, leave it unchecked if you wish to have the current rig frequency maintained.</p></body></html> - <html><head/><body><p>Jelölje be ezt, ha automatikusan vissza kíván térni az utoljára használt vételi frekvenciára amikor a Vétel engedélyezve van; ne jelölje ezt be, ha azt szeretné, hogy a rig aktuális frekvenciája maradjon meg.</p></body></html> + + <html><head/><body><p>Right click to maintain the working frequencies list.</p></body></html> + <html><head/><body><p>Kattintson a jobb gombbal a munkafrekvenciák listájának kezeléséhez.</p></body></html> - - Monitor returns to last used frequency - A Vétel visszatér a legutóbbi frekvenciára + + Station Information + Állomás információk - - Alternate F1-F6 bindings - Alternatív F1-F6 hozzárendelések + + Items may be edited. +Right click for insert and delete options. + Az egyes tételek szerkeszthetők. +Jobb klikk a beillesztési és törlési lehetőségekhez. - - Turns off automatic transmissions after sending a 73 or any other free -text message. - Kikapcsolja az automatikus adást a 73 vagy bármely más -szabad szöveges üzenet elküldése után. + + Colors + Színek - - Di&sable Tx after sending 73 - Tx letiltása a 73 elküldése után + + Decode Highlightling + A dekódolt üzenetek színjelölése - - Send a CW ID after every 73 or free text message. - Elküld egy CW azonosítót minden 73 vagy szabad szöveges üzenet után. + + <html><head/><body><p>Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.</p><p>Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.</p></body></html> + <html><head/><body><p>Engedélyezhet vagy tilthat a jelölőnégyzetek segítségével; és rákattintva a jobb gombbal egy elemre,annak előtérszínét, háttérszínét módosíthatja vagy megszüntetheti, vagy visszaállíthatja az elemet az alapértelmezett értékeire. Húzza át az elemeket a prioritásuk módosításához; a listában a feljebb lévő pozíció a magasabb prioritású.</p><p>Vegye figyelembe, hogy minden egyes előtér- vagy háttérszín lehet beállított vagy nem beállított; a be nem állított azt jelenti, hogy az nincs hozzárendelve az adott elem típusához, és alacsonyabb prioritású elemként lehet érvényben.</p></body></html> - - CW ID a&fter 73 - CW ID adása a 73 után + + <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> + <html><head/><body><p>Nyomja meg az összes fenti kiemelt elem alapértelmezett értékre és prioritásra való visszaállításához.</p></body></html> - - Periodic CW ID Inter&val: - CW ID adás periódusa: + Reset Highlighting + Alapértelmezettre visszaállítás - - Send a CW ID periodically every few minutes. -This might be required under your countries licence regulations. -It will not interfere with other users as it is always sent in the -quiet period when decoding is done. - Küld egy CW azonosítót néhány percenként. -Ezt megkövetelhetik az Ön országának engedélyezési szabályai. -Ez nem zavarja a többi felhasználót, mivel ez mindig a nyugodt -időszakban kerül elküldésre, amikor a dekódolás megtörtént. + + <html><head/><body><p>Check to indicate new DXCC entities, grid squares, and callsigns per mode.</p></body></html> + <html><head/><body><p>Jelölje be az új DXCC entitások,QRA négyzetek és hívójelek üzemmódonkénti kiemelten jelöléséhez.</p></body></html> - - Automatic transmission mode. - Automatikus adás mód. Hívás elindul, aktiválja a Tx-et. + + Highlight by Mode + Kiemelten jelölés üzemmódonként - - Doubl&e-click on call sets Tx enable - Dupla klikk a hívójelre, Tx engedélyezése + + <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> + <html><head/><body><p>Kattintson a gombra a wsjtx_log.adi ADIF fájl ismételt átvizsgálásához a korábbi információk feldolgozásához.</p></body></html> - - Calling CQ forces Call 1st - CQ-ra válasz az 1.Hívás-választóból + How this program activates the PTT on your radio? + Így aktiválhatja ez a program a PTT-t a rádión - - &Radio - &Rádió + + <html><head/><body><p>Use the RS-232 DTR control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The DTR control line of the CAT serial port may be used for this or a DTR control line on a different serial port may be used.</p></body></html> + <html><head/><body><p>Használja az RS-232 DTR vezérlővonalat a rádió PTT-jének kapcsolásához, a vonal csatlakoztatásához hardver szükséges.</p><p>Egyes kereskedelmi interfészegységek is használják ezt a módszert.</p><p>A CAT soros portjának DTR vezérlővonala használható erre a célra, vagy egy másik soros porton lévő DTR vezérlővonal is használható.</p></body></html> - - Radio interface configuration settings. - Rádió interfész konfigurációs beállítások. + + <html><head/><body><p>Use the RS-232 RTS control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The RTS control line of the CAT serial port may be used for this or a RTS control line on a different serial port may be used. Note that this option is not available on the CAT serial port when hardware flow control is used.</p></body></html> + <html><head/><body><p>Használja az RS-232 RTS vezérlővonalat a rádió PTT-jének kapcsolásához, a vonal csatlakoztatásához hardver szükséges.</p><p>Egyes kereskedelmi interfészegységek is használják ezt a módszert.</p><p>A CAT soros portjának RTS vezérlővonala használható erre a célra, vagy egy másik soros porton lévő RTS vezérlővonal is használható. Vegye figyelembe, hogy ez az opció nem áll rendelkezésre a CAT soros porton, ha hardveres adatáramlás szabályozás (flow control) van használva.</p></body></html> - - Settings that control your CAT interface. - A CAT interfészt vezérlő beállítások. + + If this is available then it is usually the correct mode for this program. + Ha ez rendelkezésre áll, akkor általában ez a megfelelő üzemmód ehhez a programhoz. - - CAT Control - CAT Vezérlés + + <html><head/><body><p>The program can send your station details and all decoded signals with grid squares as spots to the http://pskreporter.info web site.</p><p>This is used for reverse beacon analysis which is very useful for assessing propagation and system performance.</p></body></html> + <html><head/><body><p>A program el tudja küldeni az Ön állomásának adatait és az összes dekódolt jelet a QRA négyzetekkel együtt spot-ként a http://pskreporter.info weboldalra.</p><p>Ez a fordított jeladóelemzésre (reverse beacon) szolgál, ami nagyon hasznos a terjedés és a rendszer hatékonyságának felméréséhez.</p></body></html> - - - Port: - Port: + + <html><head/><body><p>Check this option if a reliable connection is needed</p><p>Most users do not need this, the default uses UDP which is more efficient. Only check this if you have evidence that UDP traffic from you to PSK Reporter is being lost.</p></body></html> + <html><head/><body><p>Jelölje be ezt az opciót, ha megbízható kapcsolatra van szükség.</p><p>A legtöbb felhasználónak erre nincs szüksége, az alapértelmezett UDP-t használja, ami hatékonyabb. Csak akkor jelölje be ezt, ha bizonyítéka van arra, hogy az Öntől a PSK Reporter felé irányuló UDP-forgalom elveszik.</p></body></html> - - Serial port used for CAT control. - CAT vezérléshez használt soros port. + + Use TCP/IP connection + TCP/IP kapcsolat használat - - - Serial Port Parameters - COM Port paraméterek + + Rescan ADIF Log + ADIF Log újra - - Baud Rate: - Baud Rate: + + Include extra WAE entities + Extra WAE entitások feltüntetése - - Serial port data rate which must match the setting of your radio. - Soros port adatátviteli sebessége, amelynek meg kell egyeznie a rádió beállításával. + + Check to for grid highlighting to only apply to unworked grid fields + Jelölje be, ha csak a nem megcsinált QRA lokátormezőkre szeretné alkalmazni a QRA kiemelten jelölést. - - 1200 - + + Only grid Fields sought + Csak a QRA mezők keresettek - - 2400 - + + <html><head/><body><p>Controls for Logbook of the World user lookup.</p></body></html> + <html><head/><body><p>A LoTW felhasználóinak keresésének vezérlő elemei.</p></body></html> - - 4800 - + + Logbook of the World User Validation + LoTW hiteles felhasználók - - 9600 - + + Users CSV file URL: + Felhasználók CSV-fájl URL-e: - - 19200 - + + <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> + <html><head/><body><p>Az ARRL LotW felhasználók, utolsó feltöltési dátumát és időpontját tartalmazó adatfájljának URL-címe, amely azon állomások dekódolásainak kiemelésére szolgál, amelyekről tudható, hogy feltöltik naplófájljukat a LotW-be.</p></body></html> - - 38400 - + URL + URL - - 57600 - + + <html><head/><body><p>Push this button to fetch the latest LotW user's upload date and time data file.</p></body></html> + <html><head/><body><p>Nyomja meg ezt a gombot a LotW-felhasználók legutóbbi feltöltési dátum és idő adatfájljának letöltéséhez.</p></body></html> - - 115200 - + + Fetch Now + Lekérés most - - <html><head/><body><p>Number of data bits used to communicate with your radio's CAT interface (usually eight).</p></body></html> - <html><head/><body><p>A rádió CAT interfészével való kommunikációhoz használt adatbitek száma (általában nyolc).</p></body></html> + + Age of last upload less than: + Utolsó feltöltések ezen belül: - - Data bits - Adat bitek + + <html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html> + <html><head/><body><p>Állítsa be ezt a görgethető mezőt, az ezen időkorláton belül feltöltő LoTW felhasználók lesznek kiemelten jelölve.</p></body></html> - - Data Bits - Data Bits + + days + nap - - D&efault - Alapért. + + Advanced + Haladó - - Se&ven - Hét + + <html><head/><body><p>User-selectable parameters for JT65 VHF/UHF/Microwave decoding.</p></body></html> + <html><head/><body><p>Felhasználó által választható paraméterek a JT65 VHF/UHF/Mikrohullámú dekódoláshoz.</p></body></html> - - E&ight - Nyolc + + JT65 VHF/UHF/Microwave decoding parameters + JT65 VHF/UHF/Mikrohullámú dekódolási paraméterek - - <html><head/><body><p>Number of stop bits used when communicating with your radio's CAT interface</p><p>(consult you radio's manual for details).</p></body></html> - <html><head/><body><p>A rádió CAT interfészével való kommunikáció során használt stop bitek száma</p><p>(a részletekért tekintse meg a rádió kézikönyvét).</p></body></html> + + Random erasure patterns: + Véletlen törlési minták: - - Stop bits - Stop bitek + + <html><head/><body><p>Maximum number of erasure patterns for stochastic soft-decision Reed Solomon decoder is 10^(n/2).</p></body></html> + <html><head/><body><p>A törlési minták maximális száma a sztochasztikus (véletlenszerű) lágy döntési Reed Solomon dekóder esetén 10^(n/2).</p></body></html> - - Stop Bits - Stop Bits + + Aggressive decoding level: + Agresszív dekódolási szint: - - - Default - Alapért. + + <html><head/><body><p>Higher levels will increase the probability of decoding, but will also increase probability of a false decode.</p></body></html> + <html><head/><body><p>A magasabb szintek növelik a dekódolás valószínűségét, de növelik a téves dekódolás valószínűségét is.</p></body></html> - - On&e - Egy + + Two-pass decoding + Kétmenetes dekódolás - - T&wo - Kettő + Special operating activity: Generation of FT4, FT8, and MSK144 messages + Speciális működési tevékenység: FT4, FT8 és MSK144 üzenetek generálása - - <html><head/><body><p>Flow control protocol used between this computer and your radio's CAT interface (usually &quot;None&quot; but some require &quot;Hardware&quot;).</p></body></html> - <html><head/><body><p>A számítógép és a rádió CAT interfésze között használt adatáramlás-szabályozás (Flow control) protokoll (általában a &quot;Nincs&quot;, de egyes esetekben a &quot;Hardver&quot; a szükséges).</p></body></html> + + <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> + <html><head/><body><p>FT8 DXpedíció mód: Vadász operátor hívja a DX-et.</p></body></html> - - - Handshake - Handshake (Áramlás szabályozás) + + + Hound + Vadász - - &None - Nincs + + <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> + <html><head/><body><p>Észak-amerikai VHF/UHF/Mikrohullámú versenyek és egyéb olyan versenyek, amelyeken a 4 karakteres QRA lokátor a szükséges kontrol-szám.</p></body></html> - - Software flow control (very rare on CAT interfaces). - Szoftveres adatáramlás-szabályozás (flow control) (CAT-interfészeken nagyon ritka). + + NA VHF Contest + NA VHF Contest - - XON/XOFF - XON/XOFF (szoftveres) + + <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> + <html><head/><body><p>FT8 DXpedíció mód: Fox (DXpedíció) operátor.</p></body></html> - - Flow control using the RTS and CTS RS-232 control lines -not often used but some radios have it as an option and -a few, particularly some Kenwood rigs, require it). - Adatáramlás-szabályozás (Flow control) az RTS és CTS RS-232 vezérlővonalakkal, -amelyeket nem gyakran használnak, de egyes rádióknál lehetőség van rá -és néhány, különösen egyes Kenwood készülékek megkövetelik ezt. + + + Fox + Fox - - &Hardware - Hardver + + <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> + <html><head/><body><p>Európai VHF+ versenyek, amelyek jel-jellemzést, sorozatszámot és 6 karakteres lokátort igényelnek.</p></body></html> - - Special control of CAT port control lines. - Egyes állomás beállítások megkövetelik, hogy a CAT soros port RTS és/vagy DTR vezérlővonalait magas- vagy alacsony- állapotba kényszerítsük. + + + EU VHF Contest + EU VHF Contest - - - Force Control Lines - DTR/RTS CAT port vezérlő-vonalak + <html><head/><body><p>ARRL RTTY Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> + <html><head/><body><p>ARRL RTTY Roundup és hasonló versenyek. A kontrol-szám az US állam, kanadai tartomány, vagy &quot;DX&quot;.</p></body></html> - - - High - Magas + R T T Y Roundup + R T T Y Roundup - - - Low - Alacsony + RTTY Roundup exchange + RTTY Roundup exchange - - DTR: - DTR: + RTTY RU Exch: + RTTY RU Exch: - - RTS: - RTS: + + NJ + - - PTT Method - PTT Vezérlés + + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> + <html><head/><body><p>ARRL Field Day kontrol-szám: adók száma, Class, és ARRL/RAC szekció vagy &quot;DX&quot;.</p></body></html> - - <html><head/><body><p>No PTT activation, instead the radio's automatic VOX is used to key the transmitter.</p><p>Use this if you have no radio interface hardware.</p></body></html> - <html><head/><body><p>Nincs PTT-aktiválás, helyette a rádió automatikus VOX-át használja az adó kapcsolására.</p><p>Használja ezt, ha nincs rádióinterfész hardvere.</p></body></html> + A R R L Field Day + A R R L Field Day - - VO&X - VOX + + + ARRL Field Day + ARRL Field Day - - &DTR - DTR + + + Field Day exchange + Field Day exchange - - Some radios support PTT via CAT commands, -use this option if your radio supports it and you have no -other hardware interface for PTT. - Egyes rádiók CAT-parancsokon keresztül támogatják a PTT-t; -használja ezt az opciót, ha a rádiója támogatja ezt, és nincs -más hardveres interfész a PTT-hez. + + FD Exch: + FD Exch: - - C&AT - CAT + + 6A SNJ + - - R&TS - RTS + + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> - - <html><head/><body><p>Select the RS-232 serial port utilised for PTT control, this option is available when DTR or RTS is selected above as a transmit method.</p><p>This port can be the same one as the one used for CAT control.</p><p>For some interface types the special value CAT may be chosen, this is used for non-serial CAT interfaces that can control serial port control lines remotely (OmniRig for example).</p></body></html> - <html><head/><body><p>Válassza ki a PTT-vezérléshez használt RS-232 soros portot, ez az opció akkor érhető el, ha fentebb a DTR vagy az RTS van kiválasztva az adás metódushoz.</p><p>Ez a port lehet ugyanaz, mint a CAT-vezérléshez használt port.</p><p>Egyes interfész típusok esetében speciális CAT-érték választható ki; ez olyan nem soros CAT interfészeknél használatos, amelyek távolról vezérelhetik a soros port vezérlővonalait (például OmniRig).</p></body></html> + WW Digital Contest + WW Digital Contest - - Modulation mode selected on radio. - A rádión kiválasztott modulációs mód. + + + WW Digi Contest + WW Digi Contest - - Mode - Üzemmód + + Miscellaneous + Egyebek - - <html><head/><body><p>USB is usually the correct modulation mode,</p><p>unless the radio has a special data or packet mode setting</p><p>for AFSK operation.</p></body></html> - <html><head/><body><p>Általában az USB a helyes modulációs mód,</p><p>kivéve, ha a rádió rendelkezik speciális adat- vagy packet mód beállítási lehetőséggel</p><p>az AFSK működéshez.</p></body></html> + + Degrade S/N of .wav file: + .wav fájl S/N rontás: - - US&B - USB + + + For offline sensitivity tests + Egyedi érzékenységi tesztekhez. - - Don't allow the program to set the radio mode -(not recommended but use if the wrong mode -or bandwidth is selected). - Ne engedje, hogy a program állítsa be a rádió üzemmódját -(ez nem ajánlott, de használ, ha rossz üzemmód -vagy sávszélesség van kiválasztva.) + + + dB + dB - - - None - Nincs + + Delete Tx macro + - - Data/P&kt - Data/Pkt + + Deletes the selected Tx macro, or the focused macro if no row is selected. + - - Some radios can select the audio input using a CAT command, -this setting allows you to select which audio input will be used -(if it is available then generally the Rear/Data option is best). - Egyes rádiók CAT-paranccsal ki tudják választani a hangbemenetet, -ez a beállítás lehetővé teszi, hogy kiválassza, melyik hangbemenetet használja a készülék -(ha rendelkezésre áll, akkor általában a Hátul/Data opció a legjobb). + + Move &Up + - - Transmit Audio Source - Adás hangforrása + + Move Tx macro up + - - Rear&/Data - Hátul/Data + + Moves the selected Tx macro one position earlier in the list. + - - &Front/Mic - Elöl/Mic + + Move D&own + - - Rig: - Rig: + + Move Tx macro down + - - Poll Interval: - Lekérd.időköz: + + Moves the selected Tx macro one position later in the list. + - - <html><head/><body><p>Interval to poll rig for status. Longer intervals will mean that changes to the rig will take longer to be detected.</p></body></html> - <html><head/><body><p>Időköz a rádió állapotának lekérdezéséhez. A hosszabb időközök azt jelentik, hogy a rádió változásainak észlelése ritkábban történik meg.</p></body></html> + + Drag and drop items to rearrange order +Right click for item specific actions +Click, SHIFT+Click and, CTRL+Click to select items + - - s - s + + Saved Tx macro messages + - - <html><head/><body><p>Attempt to connect to the radio with these settings.</p><p>The button will turn green if the connection is successful or red if there is a problem.</p></body></html> - <html><head/><body><p>Próbáljon meg a beállított beállításokkal csatlakozni a rádióhoz.</p><p>A gomb zöldre vált, ha a kapcsolat sikeres, vagy pirosra, ha probléma van.</p></body></html> + + Saved free-text messages for the main window Tx5 dropdown. Use Move Up and Move Down or drag and drop to reorder messages. + - - Test CAT - CAT ellenőrzése + + <html><head/><body><p>Check this option to note any Special Operating Activity in the comments field.</p></body></html> + - - Attempt to activate the transmitter. -Click again to deactivate. Normally no power should be -output since there is no audio being generated at this time. -Check that any Tx indication on your radio and/or your -radio interface behave as expected. - Próbálja meg aktiválni az adót. -A deaktiválásához pedig kattintson újra rá. Normális esetben -nincs kimenő teljesítmény, mivel ekkor nem keletkezik hang. -Ellenőrizze, hogy a rádió és/vagy a rádióinterfész Tx-jelzései -az elvárásoknak megfelelően viselkednek-e. + + Special operating activity to comments + - - Test PTT - PTT ellenőrzése + + <html><head/><body><p>Log 'ZZ00' as grid if the other station doesn't send you a grid.</p></body></html> + - - Split Operation - Osztott (Split) működés + + Fill missing grids with 'ZZ00' + - - Fake It - Szimulál + + Log automatically + - - Rig - Rig + + <html><head/><body><p>Use 'Log automatically' only for special operating activities.</p></body></html> + - - A&udio - A&udio + + Contesting only + - - Audio interface settings - Audio interfész beállítások. + + <html><head/><body><p>Shorten 6-digit grid entries and log 4-digit grids instead.</p></body></html> + - - Souncard - Hangkártya + + Log 4-digit grids + - - Soundcard - Hangkártya + + + Insert, delete, load, save, merge, or reset working frequencies. + - - Select the audio CODEC to use for transmitting. -If this is your default device for system sounds then -ensure that all system sounds are disabled otherwise -you will broadcast any systems sounds generated during -transmitting periods. - Válassza ki az adáshoz használni kívánt audio CODEC-et. -Ha ez az alapértelmezett eszköz a rendszerhangok számára, -akkor győződjön meg arról, hogy minden rendszerhang le van-e tiltva, -különben az adási periódusok alatt keletkező rendszerhangokat is adni fogja. + + Working frequencies actions + - - <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> - <html><head/><body><p>Adja meg annak az UDP-szervernek a portszámát, amelyre a WSJT-X-nek frissítéseket kell küldenie. Ha ez nulla, nem fog küldeni frissítéseket.</p></body></html> + + + + Actions... + - - Outgoing interfaces: - Kimenő interfészek: + + + Insert or delete station information rows. + - - <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> - <html><head/><body><p>Amikor frissítéseket küldünk egy multicast csoportcímre, meg kell adni, hogy melyik hálózati interfész(ek)re küldjük a frissítéseket. Ha a loop-back interfész (visszacsatolási felület) multicast-képes, akkor az legyen kiválasztva.</p><p>A legtöbb felhasználó számára csak a visszacsatolási felületre van szükség, amely lehetővé teszi, hogy ugyanazon a gépen több más alkalmazás is együttműködjön a WSJT-X-el. Ha a más gépeken futó alkalmazásoknak állapotfrissítéseket kell kapniuk, akkor egy megfelelő hálózati interfészt kell használni.</p><p>Némely Linux rendszereken szükség lehet a multicast engedélyezésére a loop-back hálózati interfészen.</p></body></html> + + Station information actions + - - <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> - <html><head/><body><p>Beállítja a multicast (többes-küldéses) adatcsomag átvitelnek engedélyezett útválasztó ugrások számát. Ezt szinte mindenkinek 1-re kell állítania, hogy a kimenő multicast forgalom a helyi alhálózaton belül maradjon.</p></body></html> + + Change or reset colors for the selected highlighting rule. + - - Multicast TTL: - Multicast (többcímű) TTL: + + Move the selected highlighting rule earlier in priority order. + - - Days since last upload - Az utolsó feltöltés óta eltelt napok + + Move Up + - - Select the audio CODEC to use for receiving. - Válassza ki a vételhez használni kívánt audio CODEC-et. + + Move the selected highlighting rule later in priority order. + - - &Input: - Bemenet: + + Move Down + - - Select the channel to use for receiving. - Válassza ki a vételhez használni kívánt hangcsatornát. + + Reset Highlighting to Default 1 + - - - Mono - Mono + + Reset Highlighting to Default 2 + - - - Left - Bal + + Highlight also messages with 73 or RR73 + - - - Right - Jobb + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with orange background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + - - - Both - Sztereo + + Highlight orange: + - - Select the audio channel used for transmission. -Unless you have multiple radios connected on different -channels; then you will usually want to select mono or -both here. - Válassza ki az adáshoz használt hangcsatornát. -Hacsak nincs több rádiója, amelyek csatlakoztatva vannak -a különböző csatornákhoz, akkor itt általában a mono, vagy -a sztereo csatornát kell kiválasztani. + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with blue background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + - - Enable VHF and submode features - VHF és almód funkciók engedélyezése + + Highlight blue: + - - Ou&tput: - Kimenet: + + LotW users CSV URL + - - - Save Directory - Mentési könyvtár + + http://lotw.arrl.org/lotw-user-activity.csv + - - Loc&ation: - Helye: + + CTY File Download + - - Path to which .WAV files are saved. - A .WAV fájlok mentésének elérési útja. + + CTY File Version: + - - - TextLabel - TextLabel + + Download Latest CTY.dat + - - Click to select a different save directory for .WAV files. - Kattintson erre a gombra egy másik mentési könyvtár kiválasztásához a .WAV fájlok számára. + + CALL3 File Download + - - S&elect - Választás + + CALL3 File Version: + - - - AzEl Directory - AzEl könyvtár + + Dowload latest CALL3.TXT file. + - - Location: - Helye: + + Download CALL3.TXT for terrestrial use + - - Select - Választás + + Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. + - - Power Memory By Band - Emlékezzen a sávonkénti teljesítmény beállításokra. + + Download CALL3.TXT for EME + - - Remember power settings by band - Teljesítmény sávonkénti megőrzése + + + <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> + - - Enable power memory during transmit - Adásteljesítmény megőrzésének engedélyezése + + Cloudlog or Wavelog + - - Transmit - Adás + + + Upload QSOs to Cloudlog or Wavelog + - - Enable power memory during tuning - Hangolási teljesítmény megőrzésének engedélyezése + + + <html><head/><body><p>API URL for Cloudlog or Wavelog.</p></body></html> + - - Tune - Hangolás + + API URL: + - - Tx &Macros - Tx &Makrók + + + <html><head/><body><p>Your API key.</p></body></html> + - - Canned free text messages setup - Szabad "konzerv" szöveges üzenetek beállítása. + + API Key: + - - &Add - Hozzáad + + + <html><head/><body><p>Your Cloudlog or Wavelog station profile.</p></body></html> + - - &Delete - Töröl + + Station profile: + - - Drag and drop items to rearrange order -Right click for item specific actions -Click, SHIFT+Click and, CRTL+Click to select items - A sorrend átrendezéséhez húzza át az elemeket. -Kattintson a jobb gombbal ide az elemspecifikus műveletekhez. -Kattintás, SHIFT+Kattintás és CRTL+Kattintás az elemek kiválasztásához használhatók. + + <html><head/><body><p>Check the Cloudlog or Wavelog connection, API key, station profile, and upload path where safe.</p><p>The button will turn green if the connection can upload QSOs, orange if the key is valid but read-only, and red if the configuration is unusable.</p></body></html> + - - Reportin&g - Riport + + Check Connection + - - Reporting and logging settings - Riport és naplózási beállítások. + + Receiver bandwidth: + Vevő sávszélesség: - - Logging - Naplózás + + Hz + Hz - - The program will pop up a partially completed Log QSO dialog when you send a 73 or free text message. - Egy 73, vagy szabad szöveges üzenet elküldésekor felugrik egy részben kitöltött QSO naplózó párbeszédpanel. + + Tx delay: + Tx késleltetés: - - Promp&t me to log QSO - A QSO naplózásakor megerősítést kér + + Minimum delay between assertion of PTT and start of Tx audio. + Minimális késleltetés a PTT aktívvá válása és a Tx hang indítása között. - - Op Call: - Op. hívójele: + + s + s - - Some logging programs will not accept the type of reports -saved by this program. -Check this option to save the sent and received reports in the -comments field. - Egyes naplózó programok nem fogadják el az e program által mentett riport típusokat. -Jelölje be ezt az opciót, ha az elküldött és vett riportokat a megjegyzés mezőbe szeretné menteni. + + + Tone spacing + Hangok közötti távolság - - d&B reports to comments - dB riport mentése a megjegyzéshez + + <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> + <html><head/><body><p>Tx hangot generál a normál hangtávolság kétszeresével. Olyan speciális LF/MF adókhoz szánták, amelyek 2-vel osztást használnak az RF generálása előtt.</p></body></html> - - Check this option to force the clearing of the DX Call -and DX Grid fields when a 73 or free text message is sent. - Jelölje be ezt a lehetőséget a DX Hívójel és DX QRA mezők törléséhez, -amikor egy 73 vagy szabad szöveges üzenet elküldésre kerül. + + 2x tone spacing + - - Clear &DX call and grid after logging - DX Hívójel és QRA törlése a naplózás után + + x 2 + x 2 - - <html><head/><body><p>Some logging programs will not accept WSJT-X mode names.</p></body></html> - <html><head/><body><p>Egyes naplózó programok nem fogadják el a WSJT-X üzemmódneveket.</p></body></html> + + <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> + <html><head/><body><p>Tx hangot generál a normál hangtávolság négyszeresével. Olyan speciális LF/MF adókhoz szánták, amelyek 4-gyel osztást használnak az RF generálása előtt.</p></body></html> - - Con&vert mode to RTTY - Üzemmód átalakítása RTTY-re + + 4x tone spacing + - - <html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html> - <html><head/><body><p>Az operátor hívójele, ha eltér az állomás hívójelétől.</p></body></html> + + x 4 + x 4 - - <html><head/><body><p>Check to have QSOs logged automatically, when complete.</p></body></html> - <html><head/><body><p>Jelölje be, hogy a QSO-k automatikusan naplózva legyenek, ha befejeződtek.</p></body></html> + + + Waterfall spectra + Vízesés spektrum - - Log automatically (contesting only) - Automatikus naplózás (csak versenyzéskor) + + Low sidelobes + Kis oldaljelek - - Network Services - Hálózati szolgáltatások + + Most sensitive + Legérzékenyebb - - Enable &PSK Reporter Spotting - PSK Reporter-hez spot küldés engedélyezése + + + <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> + - - UDP Server - UDP-Szerver + + eQSL.cc + - - UDP Server: - UDP-Szerver: + + + Upload QSOs to eQSL.cc + - - <html><head/><body><p>Optional hostname of network service to receive decodes.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the broadcasting of UDP status updates.</p></body></html> - <html><head/><body><p>A dekódolások fogadására szolgáló hálózati szolgáltatás opcionális hostneve.</p><p>Formátumok:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>A mező törlése letiltja az UDP állapotfrissítések továbbítását.</p></body></html> + + + <html><head/><body><p>Your username.</p></body></html> + - - UDP Server port number: - UDP-Szerver port száma: + + Username: + - - <html><head/><body><p>With this enabled WSJT-X will accept certain requests back from a UDP server that receives decode messages.</p></body></html> - <html><head/><body><p>Ha ez engedélyezve van, a WSJT-X elfogad bizonyos viszontkéréseket a dekódoló üzeneteket fogadó UDP-szervertől.</p></body></html> + + + <html><head/><body><p>Your logon password.</p></body></html> + - - Accept UDP requests - Fogadja el az UDP kéréseket + + Password: + - - <html><head/><body><p>Indicate acceptance of an incoming UDP request. The effect of this option varies depending on the operating system and window manager, its intent is to notify the acceptance of an incoming UDP request even if this application is minimized or hidden.</p></body></html> - <html><head/><body><p>Egy bejövő UDP-kérés elfogadását jelzi. Ennek az opciónak a hatása az operációs rendszertől és az ablakkezelőtől függően változik, a célja az, hogy a bejövő UDP-kérés elfogadásáról értesítsen, még akkor is, ha ez az alkalmazás minimalizálva vagy elrejtve van.</p></body></html> + + + <html><head/><body><p>Your QTH nickname, if you have more than one QTH.</p></body></html> + - - Notify on accepted UDP request - Értesítsen elfogadott UDP kérésről + + QTH: + - - <html><head/><body><p>Restore the window from minimized if an UDP request is accepted.</p></body></html> - <html><head/><body><p>Visszaállítja az ablakot a minimalizált állapotból, ha egy UDP-kérés elfogadásra kerül.</p></body></html> + + GUI tweaks for high-resolution monitors + - - Accepted UDP request restores window - Elfogadott UDP kérés visszaállítja az ablakot + + <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> + - - Secondary UDP Server (deprecated) - Másodlagos UDP-Szerver (elavult) + + HighDPI scaling (restart required) + - - <html><head/><body><p>When checked, WSJT-X will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html> - <html><head/><body><p>Ha be van jelölve, a WSJT-X a naplózott QSO-t ADIF formátumban továbbítja a megadott hostnévre és portra. </p></body></html> + + <html><head/><body><p>Increased height of some control elements.</p></body></html> + - - Enable logged contact ADIF broadcast - Engedélyezi a naplózott QSO ADIF formátumú küldését + + Increased height of the tab widget (restart required) + - - Server name or IP address: - Szerver neve, vagy IP-címe: + + Special operating activity + - - <html><head/><body><p>Optional host name of N1MM Logger+ program to receive ADIF UDP broadcasts. This is usually 'localhost' or ip address 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable broadcasting of ADIF information via UDP.</p></body></html> - <html><head/><body><p>Az N1MM Logger+ program opcionális gépneve az ADIF UDP továbbítások fogadására. Ez általában a 'localhost' vagy a 127.0.0.1 ip cím.</p><p>Formátumok:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>A mező törlése letiltja az ADIF-információk UDP-n keresztüli továbbítását.</p></body></html> + + + Enable special operating activity + - - Server port number: - Szerver port száma: + + <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> + - - <html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html> - <html><head/><body><p>Adja meg a portszámot, amelyet a WSJT-X az ADIF-naplóadatok UDP-továbbításához használ. Az N1MM Logger-nél ennek 2333-nak kell lennie. Ha ez nulla, akkor nem fog frissítéseket sugározni.</p></body></html> + + SuperFox mode + - - Frequencies - Frekvenciák + + <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> + - - Default frequencies and band specific station details setup - Alapértelmezett frekvenciák és sávspecifikus állomásadatok beállítása. + + Enable OTP verification + - - <html><head/><body><p>See &quot;Frequency Calibration&quot; in the WSJT-X User Guide for details of how to determine these parameters for your radio.</p></body></html> - <html><head/><body><p>A WSJT-X felhasználói kézikönyvben a &quot;Frekvencia kalibrálás&quot; című fejezetben talál részleteket arról, hogyan határozza meg ezeket a paramétereket a rádiója számára.</p></body></html> + + OTP + - - Frequency Calibration - Frekvencia kalibrálás + + + OTP key + - - Slope: - Meredekség: + + Key: + - - ppm - ppm + + <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> + - - Intercept: - Eltérés: + + M2ZUU5CW6EVOY2HU + - - Hz - Hz + + + OTP interval + - - Working Frequencies - Munkafrekvenciák + + Interval + - - <html><head/><body><p>Right click to maintain the working frequencies list.</p></body></html> - <html><head/><body><p>Kattintson a jobb gombbal a munkafrekvenciák listájának kezeléséhez.</p></body></html> + + <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> + - - Station Information - Állomás információk + + <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> + - - Items may be edited. -Right click for insert and delete options. - Az egyes tételek szerkeszthetők. -Jobb klikk a beillesztési és törlési lehetőségekhez. + + Show OTP messages + - - Colors - Színek + + + OTP URL + - - Decode Highlightling - A dekódolt üzenetek színjelölése + + OTP URL: + - - <html><head/><body><p>Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.</p><p>Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.</p></body></html> - <html><head/><body><p>Engedélyezhet vagy tilthat a jelölőnégyzetek segítségével; és rákattintva a jobb gombbal egy elemre,annak előtérszínét, háttérszínét módosíthatja vagy megszüntetheti, vagy visszaállíthatja az elemet az alapértelmezett értékeire. Húzza át az elemeket a prioritásuk módosításához; a listában a feljebb lévő pozíció a magasabb prioritású.</p><p>Vegye figyelembe, hogy minden egyes előtér- vagy háttérszín lehet beállított vagy nem beállított; a be nem állított azt jelenti, hogy az nincs hozzárendelve az adott elem típusához, és alacsonyabb prioritású elemként lehet érvényben.</p></body></html> + + <html><head/><body><p>URL used to verify OTP codes.</p></body></html> + - - <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> - <html><head/><body><p>Nyomja meg az összes fenti kiemelt elem alapértelmezett értékre és prioritásra való visszaállításához.</p></body></html> + + https://www.9dx.cc + - - Reset Highlighting - Alapértelmezettre visszaállítás + + NA VHF + - - <html><head/><body><p>Check to indicate new DXCC entities, grid squares, and callsigns per mode.</p></body></html> - <html><head/><body><p>Jelölje be az új DXCC entitások,QRA négyzetek és hívójelek üzemmódonkénti kiemelten jelöléséhez.</p></body></html> + + <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> + - - Highlight by Mode - Kiemelten jelölés üzemmódonként + + NCCC Sprint + - - <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> - <html><head/><body><p>Kattintson a gombra a wsjtx_log.adi ADIF fájl ismételt átvizsgálásához a korábbi információk feldolgozásához.</p></body></html> + + + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> + - - How this program activates the PTT on your radio? - Így aktiválhatja ez a program a PTT-t a rádión + + + FT Roundup messages + - - <html><head/><body><p>Use the RS-232 DTR control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The DTR control line of the CAT serial port may be used for this or a DTR control line on a different serial port may be used.</p></body></html> - <html><head/><body><p>Használja az RS-232 DTR vezérlővonalat a rádió PTT-jének kapcsolásához, a vonal csatlakoztatásához hardver szükséges.</p><p>Egyes kereskedelmi interfészegységek is használják ezt a módszert.</p><p>A CAT soros portjának DTR vezérlővonala használható erre a célra, vagy egy másik soros porton lévő DTR vezérlővonal is használható.</p></body></html> + + + FT Roundup exchange + - - <html><head/><body><p>Use the RS-232 RTS control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The RTS control line of the CAT serial port may be used for this or a RTS control line on a different serial port may be used. Note that this option is not available on the CAT serial port when hardware flow control is used.</p></body></html> - <html><head/><body><p>Használja az RS-232 RTS vezérlővonalat a rádió PTT-jének kapcsolásához, a vonal csatlakoztatásához hardver szükséges.</p><p>Egyes kereskedelmi interfészegységek is használják ezt a módszert.</p><p>A CAT soros portjának RTS vezérlővonala használható erre a célra, vagy egy másik soros porton lévő RTS vezérlővonal is használható. Vegye figyelembe, hogy ez az opció nem áll rendelkezésre a CAT soros porton, ha hardveres adatáramlás szabályozás (flow control) van használva.</p></body></html> + + FT RU Exch: + - - If this is available then it is usually the correct mode for this program. - Ha ez rendelkezésre áll, akkor általában ez a megfelelő üzemmód ehhez a programhoz. + + <html><head/><body><p>ARRL International Digital Contest</p></body></html> + - - <html><head/><body><p>The program can send your station details and all decoded signals with grid squares as spots to the http://pskreporter.info web site.</p><p>This is used for reverse beacon analysis which is very useful for assessing propagation and system performance.</p></body></html> - <html><head/><body><p>A program el tudja küldeni az Ön állomásának adatait és az összes dekódolt jelet a QRA négyzetekkel együtt spot-ként a http://pskreporter.info weboldalra.</p><p>Ez a fordított jeladóelemzésre (reverse beacon) szolgál, ami nagyon hasznos a terjedés és a rendszer hatékonyságának felméréséhez.</p></body></html> + + ARRL Digi Contest + - - <html><head/><body><p>Check this option if a reliable connection is needed</p><p>Most users do not need this, the default uses UDP which is more efficient. Only check this if you have evidence that UDP traffic from you to PSK Reporter is being lost.</p></body></html> - <html><head/><body><p>Jelölje be ezt az opciót, ha megbízható kapcsolatra van szükség.</p><p>A legtöbb felhasználónak erre nincs szüksége, az alapértelmezett UDP-t használja, ami hatékonyabb. Csak akkor jelölje be ezt, ha bizonyítéka van arra, hogy az Öntől a PSK Reporter felé irányuló UDP-forgalom elveszik.</p></body></html> + + <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> + - - Use TCP/IP connection - TCP/IP kapcsolat használat + + Q65 Pileup + - - Rescan ADIF Log - ADIF Log újra + + <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> + + - - Include extra WAE entities - Extra WAE entitások feltüntetése + + CQ with individual contest name + - - Check to for grid highlighting to only apply to unworked grid fields - Jelölje be, ha csak a nem megcsinált QRA lokátormezőkre szeretné alkalmazni a QRA kiemelten jelölést. + + + Contest name + - - Only grid Fields sought - Csak a QRA mezők keresettek + + Contest name: + - - <html><head/><body><p>Controls for Logbook of the World user lookup.</p></body></html> - <html><head/><body><p>A LoTW felhasználóinak keresésének vezérlő elemei.</p></body></html> + + Alerts + - - Logbook of the World User Validation - LoTW hiteles felhasználók + + Ensure that you have made meaningful settings on the Colors tab, so that you see which message triggered the alert. + - - Users CSV file URL: - Felhasználók CSV-fájl URL-e: + + NOTES + - - <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> - <html><head/><body><p>Az ARRL LotW felhasználók, utolsó feltöltési dátumát és időpontját tartalmazó adatfájljának URL-címe, amely azon állomások dekódolásainak kiemelésére szolgál, amelyekről tudható, hogy feltöltik naplófájljukat a LotW-be.</p></body></html> + + Ensure that your rig is NOT connected via "Default Device". + - - URL - URL + + Audio Alerts will be played on the default audio device (usually the loudspeaker of your PC). + - - https://lotw.arrl.org/lotw-user-activity.csv - + + "Wanted callsigns, grids, prefixes and directional calls" uses the entries from "Highlight orange" and "Highlight blue". + - - <html><head/><body><p>Push this button to fetch the latest LotW user's upload date and time data file.</p></body></html> - <html><head/><body><p>Nyomja meg ezt a gombot a LotW-felhasználók legutóbbi feltöltési dátum és idő adatfájljának letöltéséhez.</p></body></html> + + This requirement is fulfilled when your rig is connected via USB audio. + - - Fetch Now - Lekérés most + + Audio Alerts + - - Age of last upload less than: - Utolsó feltöltések ezen belül: + + + New Continent + Új Kontinens - - <html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html> - <html><head/><body><p>Állítsa be ezt a görgethető mezőt, az ezen időkorláton belül feltöltő LoTW felhasználók lesznek kiemelten jelölve.</p></body></html> + + My Call in message + Saját hívójel az üzenetben - - days - nap + + My Call + - - Advanced - Haladó + + + New CQ Zone + Új CQ Zóna - - <html><head/><body><p>User-selectable parameters for JT65 VHF/UHF/Microwave decoding.</p></body></html> - <html><head/><body><p>Felhasználó által választható paraméterek a JT65 VHF/UHF/Mikrohullámú dekódoláshoz.</p></body></html> + + Message received + - - JT65 VHF/UHF/Microwave decoding parameters - JT65 VHF/UHF/Mikrohullámú dekódolási paraméterek + + + DX Call or DX Grid in message + - - Random erasure patterns: - Véletlen törlési minták: + + <html><head/><body><p>Wanted callsigns, grids, prefixes and directional calls. This alert category uses the entries from &quot;Highlight orange&quot; and &quot;Highlight blue&quot;.</p></body></html> + - - <html><head/><body><p>Maximum number of erasure patterns for stochastic soft-decision Reed Solomon decoder is 10^(n/2).</p></body></html> - <html><head/><body><p>A törlési minták maximális száma a sztochasztikus (véletlenszerű) lágy döntési Reed Solomon dekóder esetén 10^(n/2).</p></body></html> + + Wanted callsigns, grids, prefixes and directional calls + - - Aggressive decoding level: - Agresszív dekódolási szint: + + + New DXCC on Band + Új DXCC a Sávban - - <html><head/><body><p>Higher levels will increase the probability of decoding, but will also increase probability of a false decode.</p></body></html> - <html><head/><body><p>A magasabb szintek növelik a dekódolás valószínűségét, de növelik a téves dekódolás valószínűségét is.</p></body></html> + + + New Continent on Band + Új Kontinens a Sávban - - Two-pass decoding - Kétmenetes dekódolás + + + New Grid on Band + Új QRA a Sávban - - Special operating activity: Generation of FT4, FT8, and MSK144 messages - Speciális működési tevékenység: FT4, FT8 és MSK144 üzenetek generálása + + + New Grid + Új QRA - - <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> - <html><head/><body><p>FT8 DXpedíció mód: Vadász operátor hívja a DX-et.</p></body></html> + + + New DXCC + Új DXCC - - - Hound - Vadász + + + New ITU Zone + Új ITU Zóna - - <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> - <html><head/><body><p>Észak-amerikai VHF/UHF/Mikrohullámú versenyek és egyéb olyan versenyek, amelyeken a 4 karakteres QRA lokátor a szükséges kontrol-szám.</p></body></html> + + + New ITU Zone on Band + Új ITU Zóna a Sávban - - - NA VHF Contest - NA VHF Contest + + + New CQ Zone on Band + Új CQ Zóna a Sávban - - <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> - <html><head/><body><p>FT8 DXpedíció mód: Fox (DXpedíció) operátor.</p></body></html> + + + CQ in message + CQ az üzenetben - - - Fox - Fox + + IMPORTANT + - - <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> - <html><head/><body><p>Európai VHF+ versenyek, amelyek jel-jellemzést, sorozatszámot és 6 karakteres lokátort igényelnek.</p></body></html> + + Voices: + - - - EU VHF Contest - EU VHF Contest + + default + - - - <html><head/><body><p>ARRL RTTY Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> - <html><head/><body><p>ARRL RTTY Roundup és hasonló versenyek. A kontrol-szám az US állam, kanadai tartomány, vagy &quot;DX&quot;.</p></body></html> + + <html><head/><body><p>Test the alert sounds.</p></body></html> + - - R T T Y Roundup - R T T Y Roundup + + Test + - - RTTY Roundup messages - + + Use of this feature requires that your computer is equipped with two sound cards. + - - RTTY Roundup exchange - RTTY Roundup exchange + + Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. + - - RTTY RU Exch: - RTTY RU Exch: + + Toggle Audio Alerts on/off. Alerts will be played on "DefaultAudioDevice". DON'T ENABLE AUDIO ALERTS WHEN YOUR RIG IS CONNECTED VIA THIS SOUNDCARD !!! + - - NJ - + + Enable Audio Alerts + - - - <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> - <html><head/><body><p>ARRL Field Day kontrol-szám: adók száma, Class, és ARRL/RAC szekció vagy &quot;DX&quot;.</p></body></html> + + Filters + - - A R R L Field Day - A R R L Field Day + + Territories 1-4 for the Hide checkboxes in the View menu + - - ARRL Field Day - ARRL Field Day + + Blacklist + - - Field Day exchange - Field Day exchange + + Filters for the Band Activity window + - - FD Exch: - FD Exch: + + Hide messages containing the following callsigns or keywords: + - - 6A SNJ - + + Show only messages containing the following callsigns or keywords: + - - <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> - <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> + + <html><head/><body><p>Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed).</p></body></html> + - - WW Digital Contest - WW Digital Contest + + Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed) + - - WW Digi Contest - WW Digi Contest + + Always pass messages with the following keywords: + - - Miscellaneous - Egyebek + + Whitelist + - - Degrade S/N of .wav file: - .wav fájl S/N rontás: + + <html><head/><body><p>Apply filters only to the callsigns of the calling stations. Usually the second word of the messages is analyzed, for directional calls the third word.</p></body></html> + - - - For offline sensitivity tests - Egyedi érzékenységi tesztekhez. + + Apply filters only to the callsigns of the calling stations + - - dB - dB + + Always Pass + - - Receiver bandwidth: - Vevő sávszélesség: + + <html><head/><body><p>Use “worked today and yesterday” instead of “worked today” for the 3 related Quick Filters.</p></body></html> + - - Hz - Hz + + Quick Filters: Hide/Ignore/Highlight "worked today and yesterday" instead of "worked today" (UTC) + - - Tx delay: - Tx késleltetés: + + <html><head/><body><p>Discard (Cancel) or apply (OK) configuration changes including</p><p>resetting the radio interface and applying any soundcard changes</p></body></html> + <html><head/><body><p>Vesse el (Mégse) vagy alkalmazza (OK) a konfigurációs módosításokat, beleértve</p><p>a rádióinterfész alaphelyzetbe állítását, és a hangkártya módosításainak végrehajtását</p></body></html> + + + main - - Minimum delay between assertion of PTT and start of Tx audio. - Minimális késleltetés a PTT aktívvá válása és a Tx hang indítása között. + + Lock file: %1 + - - s - s + + Owner process: %1 + - - - Tone spacing - Hangok közötti távolság + + Owner application: %1 + - - <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> - <html><head/><body><p>Tx hangot generál a normál hangtávolság kétszeresével. Olyan speciális LF/MF adókhoz szánták, amelyek 2-vel osztást használnak az RF generálása előtt.</p></body></html> + + Owner host: %1 + - - x 2 - x 2 + + Owner information is not available. + - - <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> - <html><head/><body><p>Tx hangot generál a normál hangtávolság négyszeresével. Olyan speciális LF/MF adókhoz szánták, amelyek 4-gyel osztást használnak az RF generálása előtt.</p></body></html> + + Remove error: %1 + - - x 4 - x 4 + + Another instance may be running + - - - Waterfall spectra - Vízesés spektrum + + WSJT-X could not lock its temporary instance file. + +If another WSJT-X window is still running, choose No. +Use a unique rig name to run more than one instance. + +If WSJT-X crashed or will not restart, choose Remove Lock File. +Choose Retry after closing the other instance. + - - Low sidelobes - Kis oldaljelek + + Remove Lock File + - - Most sensitive - Legérzékenyebb + + Unable to remove stale lock file + - - <html><head/><body><p>Discard (Cancel) or apply (OK) configuration changes including</p><p>resetting the radio interface and applying any soundcard changes</p></body></html> - <html><head/><body><p>Vesse el (Mégse) vagy alkalmazza (OK) a konfigurációs módosításokat, beleértve</p><p>a rádióinterfész alaphelyzetbe állítását, és a hangkártya módosításainak végrehajtását</p></body></html> + + Close any running WSJT-X instance or remove the lock file manually after confirming WSJT-X is not running. + - - - main - + Failed to create a temporary directory Nem sikerült létrehozni egy ideiglenes könyvtárat - - + + Path: "%1" Út: "%1" - + Failed to create a usable temporary directory Nem sikerült létrehozni egy használható ideiglenes könyvtárat - + Another application may be locking the directory Lehet, hogy egy másik alkalmazás zárolja a könyvtárat - + Failed to create data directory Az adatkönyvtár létrehozása sikertelen - + path: "%1" út: "%1" - + Shared memory error Megosztott memória hiba - + Unable to create shared memory segment Nem sikerült létrehozni megosztott memória szegmenst - + Sub-process error Al-folyamat hiba - + Failed to close orphaned jt9 process Nem sikerült bezárni az elárvult jt9 folyamatot diff --git a/translations/wsjtx_it.ts b/translations/wsjtx_it.ts index 7908510b..ef90db24 100644 --- a/translations/wsjtx_it.ts +++ b/translations/wsjtx_it.ts @@ -123,18 +123,17 @@ Stazioni Attive - - + Wanted only #Solo ricercato - + Message Messaggio - + My call only Solo.il.mio.call @@ -142,149 +141,178 @@ Astro - - + + Doppler tracking Tracciamento Doppler - + <html><head/><body><p>One station does all Doppler shift correction, their QSO partner receives and transmits on the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>Una stazione fa tutta tutta la correzione Doppler shift, il loro partner di QSO riceve e trasmette sulla frequenza di sked.</p><p>Se il rig not accetta i comandi CAT QSY mentre è in trasmissione viene applicata una singola correzione per l'intero periodo transmesso.</p></body></html> - + Full Doppler to DX Grid Doppler Pieno alla Griglia DX - + <html><head/><body><p>Transmit takes place on sked frequency and receive frequency is corrected for own echoes. </p><p>This mode can be used for calling CQ, or when using Echo mode.</p></body></html> <html><head/><body><p>La trasmissione ha luogo sulla frequenza di sked e la frequenza di ricezione viene corretta per i propri echi. </p><p>Questo modo può essere usato per chiamare CQ o quando si usa il modo Eco.</p></body></html> - + Own Echo Proprio Eco - + <html><head/><body><p>Both stations correct for Doppler shift such that they would be heard on the moon at the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p><p>Use this option also for Echo mode.</p></body></html> <html><head/><body><p>Entrambe le stazioni correggono per lo shift Doppler in modo che esse sarebbero ascoltate sulla luna alla frequenza di sked.</p><p>Se il rig non accetta i comandi CAT QSY durante la trasmissione una correzione singola viene applicata per l'intero periodo di trasmissione.</p><p>Usare questa opzione anche per il modo Eco.</p></body></html> - + Constant frequency on Moon Frequenza costante sulla Luna - + <html><head/><body><p>DX station announces their TX Freq, which is entered as the Sked Freq. Correction applied to RX and TX so you appear on the DX's station's own echo Freq.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>La stazione DX annuncia la sua TX Freq, la quale è inserita come frequenza di Sked La correzione à applicata a RX e TX così appari sulla propria frequenza di Eco della stazione DX</p><p>Se il rig non accetta i comandi CAT QSY durante la trasmissione una correzione singola viene applicata per l'intero periodo di trasmissione.</p></body></html> - + On DX Echo Su Eco DX - + <html><head/><body><p>Tune radio manually and select this mode to put your echo on the same frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>Sintonizza la radio manualmente e seleziona questo modoper mettere il tuo ecosulla stessa frequenza.</p><p>Se il rig non accetta i comandi CAT QSY durante la trasmissione una correzione singola viene applicata per l'intero periodo di trasmissione.</p></body></html> - + Call DX Chiama DX - + <html><head/><body><p>No Doppler shift correction is applied. This may be used when the QSO partner does full Doppler correction to your grid square.</p></body></html> <html><head/><body><p>Non è applicata correzione Doppler shift Questo può essere usato quando il partner in QSO esegue una correzione completa Doppler per il tuo quadrato di griglia.</p></body></html> - + None Nessuna - + Sked frequency Frequenza di Sked - - + + 0 0 - + + kHz + + + + + Set kHz + + + + + <html><head/><body><p>Tx shift relative to Rx sked frequency</p></body></html> + + + + + MHz + + + + + Tx Shift + + + + Rx: Rx: - + Tx: Tx: - <html><head/><body><p>Press and hold the CTRL key to adjust the sked frequency manually with the rig's VFO dial or enter frequency directly into the band entry field on the main window.</p></body></html> - <html><head/><body><p>Premi e mantieni premuto il tasto CTRL per aggiustare la frequenza di sked manualmente con la manopola del VFO del rig o inserisci la frequenza direttamente nel campo di inserimento banda nella finestra principale.</p></body></html> + <html><head/><body><p>Premi e mantieni premuto il tasto CTRL per aggiustare la frequenza di sked manualmente con la manopola del VFO del rig o inserisci la frequenza direttamente nel campo di inserimento banda nella finestra principale.</p></body></html> - + Echo Mode Modalità Eco - + Hz Hz - + RIT - Dither - Dithering + Dithering - Tx Shift relative to Rx Sked Freq - Spostamento Tx rispetto alla frequenza Rx.schedulata + Spostamento Tx rispetto alla frequenza Rx.schedulata - Enter large offset - Inserisci un offset elevato + Inserisci un offset elevato - MHz - MHz + MHz - Shift - Spostamento + Spostamento - + Enable Abilita - + + Dither + + + + + Ctl-Lock Sked Freq + + + + Astro Data Dati Astro - + Astronomical Data Dati Astronomici @@ -423,6 +451,166 @@ Nominativo + + Cloudlog + + + + QSO could not be sent to Cloudlog. + + + + + + QSO upload was rejected by Cloudlog. + + + + + HTTP status %1. Response was not JSON. + + + + + Cloudlog returned an unexpected upload response. + + + + + Cloudlog reported upload status: %1 + + + + + HTTP status %1. + + + + + Cloudlog::impl + + + Enter a Cloudlog or Wavelog URL. + + + + + The connection check needs a base URL before it can contact the API. + + + + + Cloudlog or Wavelog authentication endpoint was not found. + + + + + Tried /api/check_auth, /index.php/api/check_auth, and /index.php/api/auth. + + + + + API key is valid but read-only. + + + + + Generate a read/write API key before enabling QSO uploads. + + + + + API key is invalid. + + + + + Authentication response was not usable. + + + + + Station profile response was not JSON. + + + + + Configured station profile was not found. + + + + + No station profiles were returned by the server. + + + + + Available station profiles: %1 + + + + + Wavelog dry-run QSO endpoint was not found. + + + + + Tried /api/qso/true and /index.php/api/qso/true after Wavelog was identified. + + + + + Dry-run upload response was not usable. + + + + + + Connection check passed. + + + + + Writable API key, station profile, and dry-run QSO upload were validated. + + + + + Dry-run QSO upload was rejected. + + + + + + The QSO dry-run upload was rejected. + + + + + Dry-run QSO upload returned an unexpected response. + + + + + Writable API key and station profile were validated. No safe dry-run QSO endpoint was identified, so no test QSO was uploaded. + + + + + Network error while checking Cloudlog or Wavelog. + + + + + Cloudlog Error! + + + + + Reason: %1 + + + ColorHighlighting @@ -529,90 +717,327 @@ Configuration::impl - - - + + + &Delete &Elimina - - + + &Insert ... &Inserisci ... - + + Wanted territory %1 + + + + + Blacklist keyword %1 + + + + + Whitelist keyword %1 + + + + + Always pass keyword %1 + + + + + CAT control port + + + + + CAT baud rate + + + + + Default CAT data bits + + + + + Seven CAT data bits + + + + + Eight CAT data bits + + + + + Default CAT stop bits + + + + + One CAT stop bit + + + + + Two CAT stop bits + + + + + Default CAT handshake + + + + + No CAT handshake + + + + + XON/XOFF CAT handshake + + + + + Hardware CAT handshake + + + + + Force DTR control line + + + + + Force RTS control line + + + + + VOX PTT method + + + + + DTR PTT method + + + + + CAT PTT method + + + + + RTS PTT method + + + + + PTT control port + + + + + Rear or data transmit audio source + + + + + Front or mic transmit audio source + + + + + No radio mode control + + + + + USB radio mode + + + + + Data or packet radio mode + + + + + No split operation + + + + + Rig split operation + + + + + Fake It split operation + + + + + CAT poll interval + + + + + Frequency calibration slope + + + + + Frequency calibration intercept + + + + + Working frequencies table + + + + + Station information table + + + + + Decode highlighting rules + + + + + Highlighting rules and priorities for decoded messages. + + + + + Decode highlighting actions + + + + + Change or reset colors for the selected highlighting rule. + + + + + Move selected highlighting rule up + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move selected highlighting rule down + + + + + Move the selected highlighting rule later in priority order. + + + + + Orange highlight callsigns and grids + + + + + Blue highlight callsigns and grids + + + + Failed to create save directory Impossibile creare la directory di salvataggio - + path: "%1% percorso: "%1" - + Failed to create samples directory Impossibile creare la directory dei campioni - + path: "%1" Percorso: "%1" - + + Reset all decode highlighting and priorities to Default 1 values + + + + + Reset all decode highlighting and priorities to Default 2 values + + + API key OK - Chiave API OK + Chiave API OK - API key read-only - Chiave API di sola lettura + Chiave API di sola lettura - API key invalid - Chiave API non valida + Chiave API non valida - + &Load ... &Carica ... - + &Save as ... &Salva come ... - + &Merge ... &Unisci ... - + &Reset &Ripristina - + Serial Port: Porta Seriale: - + Serial port used for CAT control Porta Seriale usata per il controllo CAT - + TCI Server: Server TCI: - + Optional hostname and port of TCI service. Leave blank for a sensible default on this machine. Formats: @@ -627,12 +1052,12 @@ indirizzo IPv4:porta [indirizzo IPv6]:porta - + Network Server: Server di rete: - + Optional hostname and port of network service. Leave blank for a sensible default on this machine. Formats: @@ -647,12 +1072,12 @@ Formati: [IPv6-address]:porta - + USB Device: Dispositivo USB: - + Optional device identification. Leave blank for a sensible default for the rig. Format: @@ -663,87 +1088,85 @@ Formato: [VID[:PID[:VENDOR[:PRODOTTO]]]] - - + + Invalid audio input device Dispositivo di ingresso audio non valido - + Invalid audio output device Dispositivo di uscita audio non valido - + Invalid PTT method Metodo PTT non valido - + Invalid PTT port Porta PTT non valida - - + + Invalid Contest Exchange Scambio Contest non valido - + You must input a valid ARRL Field Day exchange È necessario inserire uno scambioField Day ARRL valido - + You must input a valid ARRL RTTY Roundup exchange È necessario inserire uno scambio Roundup RTTY ARRL valido - + Pending DNS lookup, please try again later In attesa della ricerca DNS, riprova più tardi - - + + Reset Decode Highlighting Ripristina l'evidenziazione della decodifica - - Reset all decode highlighting and priorities to default values - Ripristina tutti i valori di evidenziazione e priorità della decodifica sui valori predefiniti + Ripristina tutti i valori di evidenziazione e priorità della decodifica sui valori predefiniti - + Error Loading CTY.DAT Errore durante il caricamento di CTY.DAT - + Error Loading CALL3.TXT file Errore durante il caricamento del file CALL3.TXT - + WSJT-X Decoded Text Font Chooser Selezionatore font testo decodificato WSJT-X - - + + Hamlib update only available on Windows. Aggiornamento Hamlib disponibile solo su Windows. - + Error Loading libhamlib-4.dll Errore durante il caricamento di libhamlib-4.dll - + Hamlib Update successful New Hamlib will be used after restart @@ -752,7 +1175,7 @@ New Hamlib will be used after restart Il nuovo Hamlib verrà utilizzato dopo il riavvio - + Hamlib successfully reverted Reverted Hamlib will be used after restart @@ -761,34 +1184,34 @@ Reverted Hamlib will be used after restart Hamlib ripristinato verrà utilizzato dopo il riavvio - + No Hamlib update found that could be reverted Nessun aggiornamento Hamlib trovato che possa essere ripristinato - + Error in network address Errore nell'indirizzo di rete - + UDP server DNS lookup failed Ricerca DNS del server UDP non riuscita - + MAC-ambiguous multicast groups addresses not supported Indirizzi di gruppi multicast MAC ambigui non supportati - + Load Working Frequencies Carica frequenze di lavoro - - - + + + Frequency files (*.qrg *.qrg.json);;All files (*.*) File di frequenza (*.qrg *.qrg.json);;Tutti i file (*.*) @@ -797,99 +1220,99 @@ Hamlib ripristinato verrà utilizzato dopo il riavvio File di frequenza (*.qrg);;Tutti i file (*.*) - + Replace Working Frequencies Sostituisci le frequenze di lavoro - + Are you sure you want to discard your current working frequencies and replace them with the loaded ones? Sei sicuro di voler scartare le tue attuali frequenze di lavoro e sostituirle con quelle caricate? - + Merge Working Frequencies Unisci le frequenze di lavoro - + Error reading frequency file Errore leggendo il file di frequenze - - - + + + Not a valid frequencies file Non è un file di frequenze valido - + Incorrect file magic Magic file errato - + Version is too new La versione è troppo nuova - + Contents corrupt Contenuto corrotto - + Save Working Frequencies Salva frequenze di lavoro - + Only Save Selected Working Frequencies Salva solo le frequenze di lavoro selezionate - + Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. Sei sicuro di voler salvare solo le frequenze di lavoro che sono attualmente selezionate? Fai clic su No per salvare tutto. - + Reset Working Frequencies Ripristina frequenze di lavoro - + Are you sure you want to discard your current working frequencies and replace them with default ones? Sei sicuro di voler scartare le tue attuali frequenze di lavoro e sostituirle con quelle predefinite? - + Save Directory Salva il direttorio - + AzEl Directory AzEl Direttorio - + Rig control error Errore di controllo rig - + Failed to open connection to rig Impossibile aprire la connessione al rig - + Rig failure Rig fallito - + Not found audio device missing dispositivo audio mancante @@ -1013,33 +1436,33 @@ o contattare l'assistenza DXLab all'indirizzo DXLab@groups.io.&Colore di primo piano ... - + Choose %1 Foreground Color Scegli %1 colore di primo piano - + &Unset foreground color &Annullare colore di primo piano - + &Background color ... &Colore di sfondo ... - + Choose %1 Background Color Scegli %1 colore di sfondo Scegli.%1 colore di sfondo - + U&nset background color A&nnullare colore di sfondo - + &Reset this item to defaults &Reimposta questa voce ai valori predefiniti @@ -1127,17 +1550,17 @@ o contattare l'assistenza DXLab all'indirizzo DXLab@groups.io.Utente LoTW - + f/g unset f/g non impostato - + b/g unset b/g non impostato - + Highlight Type Evidenzia Tipo @@ -1145,36 +1568,51 @@ o contattare l'assistenza DXLab all'indirizzo DXLab@groups.io. Designer - + &Delete &Elimina - + &Insert ... &Inserisci ... - + Insert &after ... Inserisci &dopo ... - + Import Palette Importa Tavolozza - - + + Palettes (*.pal) Tavolozza (*.pal) + Import Palette Failed + + + + Export Palette Esporta Tavolozza + + + Export Palette Failed + + + + + Error writing waterfall palette file "%1": %2. + Errore scrittura del file della tavolozza del display a cascata "%1: %2. + Dialog @@ -1207,7 +1645,7 @@ o contattare l'assistenza DXLab all'indirizzo DXLab@groups.io.Solo Rx - + Gray time: Orario Grayline: @@ -1311,16 +1749,31 @@ Errore: %2 - %3 DisplayText - + &Erase &Cancellare + + + Return to live activity + + + + + Return to the live activity position + + + + + Live activity is paused while earlier entries are visible. + + EchoGraph - + Echo Graph Grafico Eco @@ -1394,7 +1847,7 @@ Errore: %2 - %3 EmulateSplitTransceiver - + Emulated split mode requires rig to be in simplex mode La modalità split emulato richiede che il rig sia in modalità simplex @@ -1481,12 +1934,12 @@ Errore: %2 - %3 ExistingNameDialog - + Configuration to Clone From Configurazione da cui clonare - + &Source Configuration Name: &Nome configurazione sorgente: @@ -1624,7 +2077,7 @@ Errore: %2 - %3 FastGraph - + Fast Graph Grafico veloce @@ -1678,6 +2131,157 @@ Errore: %2 - %3 %1 + + FixtureAudioInput + + + Synthetic audio input has no detector sink. + + + + + Synthetic FT8 audio input requires a downsample factor of 1 or 4. + + + + + Synthetic JTTY audio input requires a downsample factor of 1 or 4. + + + + + Synthetic audio input requires the mono input channel. + + + + + Unable to open synthetic audio fixture %1: %2 + + + + + Synthetic audio fixture must be mono, signed 16-bit little-endian PCM. + + + + + Synthetic audio fixture must be %1 Hz for downsample factor %2; found %3 Hz. + + + + + Synthetic FT8 audio fixture must contain exactly %1 frames; found %2. + + + + + Synthetic JTTY audio fixture must contain complete PCM frames. + + + + + Unable to read all PCM data from synthetic audio fixture. + + + + + Synthetic audio input does not yet support big-endian hosts. + + + + + Unable to initialize the detector for synthetic audio input. + + + + + Synthetic audio fixture ready + + + + + Synthetic audio input suspended + + + + + Synthetic audio input receiving + + + + + Detector accepted %1 of %2 synthetic PCM bytes. + + + + + Synthetic audio fixture exhausted + + + + + FixtureSoundOutput + + + Synthetic audio output requires a readable source. + + + + + Synthetic audio output requires a capture path. + + + + + Synthetic audio output does not yet support big-endian hosts. + + + + + Synthetic audio output received an unsupported source frame size. + + + + + Unable to open synthetic audio output capture %1: %2 + + + + + Synthetic audio output received a partial captured frame. + + + + + Synthetic FT8 audio output exceeded its 15-second capture period. + + + + + Synthetic audio output wrote %1 of %2 capture bytes: %3 + + + + + Synthetic audio output source disappeared during capture. + + + + + Synthetic FT8 audio output continued beyond its 15-second capture period. + + + + + Synthetic audio output received %1 of %2 source bytes. + + + + + Synthetic audio output received an invalid source byte count. + + + FoxLog::impl @@ -1793,68 +2397,100 @@ Errore: %2 - %3 - FrequencyDialog + FrequencyDeltaLineEdit - - Add Frequency + + Offset in MHz + + + + + Frequency offset in MHz + + + + + Enter a frequency offset in MHz. + + + + + FrequencyDialog + + + Add Frequency Aggiungi frequenza - + IARU &Region: &Regione IARU: - + &Mode: &Modo: - + &Frequency (MHz): &Frequenza (MHz): - + &Preferred for Band/Mode: &Preferita per Banda/Modo: - + &Description: &Descrizione: - + &Enable Date Range: &Abilita intervallo date: - + S&tart: Ini&zio: - + &End: Fi&ne: - + &Source: &Fonte: - + Invalid Date Range Intervallo delle date non validp - + Start date must be before end date La data iniziale deve essere prima della data finale + + FrequencyLineEdit + + + + Frequency in MHz + + + + + Enter a positive frequency in MHz. + + + FrequencyList_v2 @@ -1878,37 +2514,37 @@ Errore: %2 - %3 FrequencyList_v2_101 - + IARU Region Regione IARU - + Mode Modo - + Frequency Frequenza - + Frequency (MHz) Frequenza (MHz) - + Description Descrizione - + Source Fonte @@ -1924,129 +2560,241 @@ Errore: %2 - %3 - + Pref Pref - + Start Date/Time Data/Ora inizio - + End Date/Time Data/Ora fine - + Failed to parse JSON file Impossibile analizzare il file JSON - + Information Missing Informazioni mancanti - + No Frequencies were found Nessuna frequenza trovata - + Loaded Frequencies from %1 Frequenze caricate da %1 - + Entries Valid/Skipped %1 Voci valide/saltate %1 + + Ft8TxLoopbackTestController + + + Timed out after 60 seconds. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + The FT8 output stream did not start exactly once. + + + + + The FT8 Auto control was not found. + + + + + Disabling Auto stopped the active FT8 transmission. + + + + + Synthetic output reported non-silent FT8 audio more than once. + + + + + The FT8 capture did not stop exactly once at the requested path. + + + + + Synthetic audio output failed: %1 + + + + + A required FT8 transmit GUI control was not found. + + + + + The application did not enter FT8 mode. + + + + + Unable to configure the requested FT8 transmission. + + + + + The FT8 transmit controls disappeared before transmission. + + + + + Unable to start the synthetic FT8 transmission. + + + + + The FT8 Auto control disappeared before retry. + + + + + The FT8 output lifecycle was not one start, non-silent transmission, and natural stop. + + + + + FT8 audio began at frame %1; expected %2 +/- %3 frames. + + + + + The FT8 capture file was not created or is empty: %1 + + + + + Unable to reopen FT8 capture %1: %2 + + + + + The FT8 capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The FT8 capture must contain exactly %1 frames; file=%2 reported=%3. + + + + + Unexpected modal window: %1 + + + HRDTransceiver - - + + Failed to connect to Ham Radio Deluxe Impossibile connettersi a Ham Radio Deluxe - + Failed to open file "%1": %2. Impossibile aprire il file "%1":%2. - - + + Ham Radio Deluxe: no rig found Ham Radio Deluxe: nessun rig trovato - + Ham Radio Deluxe: rig doesn't support mode Ham Radio Deluxe: il rig non supporta la modalità - + Ham Radio Deluxe: sent an unrecognised mode Ham Radio Deluxe: ha inviato una modalità non riconosciuta - + Ham Radio Deluxe: item not found in %1 dropdown list Ham Radio Deluxe: elemento non trovato nell'elenco a discesa%1 - + Ham Radio Deluxe: button not available Ham Radio Deluxe: pulsante non disponibile - + Ham Radio Deluxe didn't respond as expected Ham Radio Deluxe non ha risposto come previsto - + Ham Radio Deluxe: rig has disappeared or changed Ham Radio Deluxe: il rig è scomparso o cambiato - + Ham Radio Deluxe send command "%1" failed %2 Ham Radio Deluxe comando di invio "%1" non riuscito%2 - - + + Ham Radio Deluxe: failed to write command "%1" Ham Radio Deluxe: impossibile scrivere il comando "%1" - + + Ham Radio Deluxe sent an invalid reply to our command "%1": %2 + + + Ham Radio Deluxe sent an invalid reply to our command "%1" - Ham Radio Deluxe ha inviato una risposta non valida al nostro comando "%1" + Ham Radio Deluxe ha inviato una risposta non valida al nostro comando "%1" - + Ham Radio Deluxe failed to reply to command "%1" %2 Ham Radio Deluxe non ha risposto al comando "%1"%2 - + Ham Radio Deluxe retries exhausted sending command "%1" Ham Radio Deluxe ritenta esaurito il comando di invio "%1" - + Ham Radio Deluxe didn't respond to command "%1" as expected Ham Radio Deluxe non ha risposto al comando "%1" come previsto @@ -2054,186 +2802,186 @@ Errore: %2 - %3 HamlibTransceiver - - + + Hamlib initialisation error Errore di inizializzazione di Hamlib - + Hamlib settings file error: %1 at character offset %2 Errore del file delle impostazioni di Hamlib:%1 all'offset del carattere %2 - + Hamlib settings file error: top level must be a JSON object Errore del file delle impostazioni di Hamlib: il livello principale deve essere un oggetto JSON - + Hamlib settings file error: config must be a JSON object Errore del file delle impostazioni di Hamlib: config deve essere un oggetto JSON - + Unsupported CAT type Tipo CAT non supportato - + Hamlib error: %1 while %2 Errore Hamlib: %1 mentre %2 - + opening connection to rig apertura connessione al rig - + getting current frequency ottenere la frequenza corrente - + getting current mode ottenere la modalità corrente - - + + exchanging VFOs scambio di VFO - - + + getting other VFO frequency ottenere altra frequenza VFO - + getting other VFO mode ottenere altra modalità VFO - - + + setting current VFO impostazione del VFO corrente - + getting frequency ottenere la frequenza - + getting mode ottenere il modo - - - + + + getting current VFO ottenere il VFO corrente - - - - + + + + getting current VFO frequency ottenere la frequenza del VFO corrente - - - - - - + + + + + + setting frequency impostazione della frequenza - - - - + + + + getting current VFO mode ottenere il modo del VFO corrente - - - - - + + + + + setting current VFO mode impostare il modo del VFO corrente - setting VFOB mode - impostazione della modalità VFOB + impostazione della modalità VFOB - - + + setting/unsetting split mode impostazione/disinserimento della modalità split - - + + setting split mode impostazione della modalità split - + setting split TX frequency and mode impostazione della frequenza e della modalità TX divise - + setting split TX frequency impostazione della frequenza Split TX - + getting split TX VFO mode ottenere la modalità split VFO TX - + setting split TX VFO mode impostazione della modalità VFO split TX - + getting PTT state ottenere lo stato PTT - + setting PTT on attivare PTT - - + + setting PTT off disattivare PTT - + setting a configuration item impostazione di un elemento di configurazione - + + getting a configuration item ottenere un elemento di configurazione @@ -2282,6 +3030,322 @@ Errore: %2 - %3 Regione IARU + + JttyTxLoopbackTestController + + + Timed out after 60 seconds. + + + + + JTTY request %1 was accepted more than once. + + + + + JTTY request %1 was rejected with reason %2. + + + + + JTTY request %1 completed more than once. + + + + + More than one JTTY transmit session drained. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + JTTY output stream restarted more than once. + + + + + Synthetic output reported non-silent playback more than once. + + + + + Synthetic output stopped the wrong capture path: %1 + + + + + JTTY output stream stopped more than once. + + + + + Synthetic audio output failed: %1 + + + + + The JTTY mode action was not found. + + + + + The application did not enter JTTY mode. + + + + + The JTTY encoder did not produce a valid test waveform extent. + + + + + The first JTTY text request was not accepted synchronously. + + + + + Non-silent playback began before the first request was accepted. + + + + + The output stream restarted or stopped before the gapless append. + + + + + The gapless append occurred before one second of real playback. + + + + + The second JTTY text request was not accepted during playback. + + + + + Appending the second JTTY message restarted or stopped playback. + + + + + The accepted-request set did not contain exactly both submitted messages. + + + + + JTTY text requests were not accepted in submission order. + + + + + The completed-request set did not contain exactly both submitted messages. + + + + + JTTY text requests did not complete in FIFO order. + + + + + The output stream lifecycle was not one start, one drain, and one stop. + + + + + The captured JTTY session contains an unexpected internal audio gap. + + + + + The JTTY capture file was not created or is empty: %1 + + + + + Unable to reopen JTTY capture %1: %2 + + + + + The JTTY capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The JTTY capture has an invalid PCM extent: file frames=%1, expected audio frames=%2, reported frames=%3. + + + + + Unexpected modal window: %1 + + + + + LiveAudioTestController + + + Timed out after 110 seconds. + + + + + Timed out after 100 seconds. + + + + + Decoder backend failed: %1 + + + + + JTTY display did not settle to the expected text after input ended. + + + + + Synthetic audio source failed: %1 + + + + + Unable to open expected decode file %1: %2 + + + + + Expected decode file %1 contains no messages. + + + + + Unable to open expected JTTY text file %1: %2 + + + + + Expected JTTY text file %1 contains no messages. + + + + + A required FT8 decoder or monitoring GUI control was not found. + + + + + Unable to configure the %1-%2 Hz waterfall decode range. + + + + + Unable to prepare the complete FT8 fixture decode. + + + + + Unable to configure the FT8 multithreaded decoder as requested. + + + + + Monitor did not enter the active state. + + + + + Synthetic input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic audio source. + + + + + A required JTTY mode, monitoring, or decode display control was not found. + + + + + The JTTY GUI action did not select JTTY mode. + + + + + Monitor did not enter the active state for JTTY. + + + + + Synthetic JTTY input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic JTTY audio source. + + + + + The expected early standard and final configured MTD decoder invocations were not both observed. + + + + + The configured MTD invocation produced no decoder output. + + + + + live MTD missing: %1 + + + + + processed missing: %1 + + + + + display missing: %1 + + + + + Reference-message validation failed: %1; live MTD output: %2; processed output: %3 + + + + + Decoder messages were processed but none reached the GUI display path. + + + + + The expected JTTY messages did not reach both panes in FIFO order. + + + + + The expected JTTY message reached both panes without an observed growing prefix. + + + + + Unexpected modal window: %1 + + + LogQSO @@ -2401,199 +3465,199 @@ Errore: %2 - %3 Frequenza RX - + Aircraft scatter Propagazione via riflessione Scatter su velivoli Diffusione Aerea - + Aurora-E Propagazione via Aurora-E Aurora-E - + Aurora Propagazione via Aurora Boreale Aurora - + Back scatter Propagazione Via Back Scatter Retro Diffusione - + Echolink Echolink - + Earth-moon-earth EME Terra Luna Terra - + Sporadic E Propagazione via Strato E Sporadico E Sporadico - + F2 Reflection Propagazione via Strato F2 Riflessione F2 - + Field aligned irregularities Propagazione via FAI Irregolarità allineate al campo - + Internet-assisted Internet Assistito - + Ionoscatter Propagazione via diffusione ionosferica Ionodiffusione - + IRLP Collegamento Internet Project Radio - + Meteor scatter Propagazione via Meteore Diffusione Meteore - + Non-satellite repeater or transponder Ripetitore non satellite o transponder - + Rain scatter Propagazione via pioggia (bande GHz) Diffusione pioggia - + Tropospheric ducting Condotti troposferici - + A A - + B B - + BS BS - + JA JA - + JD JD - + K K - + KA KA - + KT KT - + L L - + LS LS - + LU LU - + LX LX - + S S - + SX SX - + T T - + US US - + UV UV - + VS VS - + VU VU - + Satellite Satellite - + Trans-equatorial Propagazione tranequatoriale Trans-equatoriale @@ -2604,33 +3668,33 @@ Errore: %2 - %3 Canalizzazione troposferica - - + + Invalid QSO Data Dati QSO non validi - + Check exchange sent and received Controlla lo scambio inviato e ricevuto - + Check all fields Controlla tutti i campi - + Log file error Errore file di Log - + Cannot open "%1" for append Impossibile aprire "%1" per aggiungere - + Error: %1 Errore: %1 @@ -2681,62 +3745,61 @@ Errore (%2):%3 MainWindow - WSJT-X by K1JT - WSJT-X di K1JT - - - - - - - - - - - + WSJT-X di K1JT + + + + + + + + + + + Band Activity Attività di Banda - - + + UTC dB DT Freq Dr UTC dB DT Freq Dr - - - - - - - + + + + + + + Rx Frequency Frequenza Rx - + CQ only Solo CQ - + Enter this QSO in log Registrare questo QSO nel log - + Log &QSO Log &QSO - + Stop monitoring Interrompere il monitoraggio - + &Stop &Stop @@ -2745,82 +3808,82 @@ Errore (%2):%3 Attiva / disattiva il monitoraggio - + &Monitor &Monitor - + <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> <html><head/><body><p>Cancella la finestra a destra. Fare doppio clic per cancellare entrambe le finestre.</p></body></html> - + Erase right window. Double-click to erase both windows. Cancella la finestra a destra. Fare doppio clic per cancellare entrambe le finestre. - + &Erase &Cancella - + <html><head/><body><p>Clear the accumulating message average.</p></body></html> <html><head/><body><p>Cancella la media dei messaggi accumulati.</p></body></html> - + Clear the accumulating message average. Cancella la media dei messaggi accumulati. - + Clear Avg Cancella media - + Avg Media - + <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> <html><head/><body><p>Decodifica il periodo Rx più recente alla frequenza QSO</p></body></html> - + Decode most recent Rx period at QSO Frequency Decodifica il periodo Rx più recente alla frequenza QSO - + &Decode &Decodifica - + <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> <html><head/><body> <p> Attiva / Disattiva Auto-Tx </p> </body> </html> - + Toggle Auto-Tx On/Off Attiva / Disattiva Auto-Tx - + E&nable Tx &Abilita Tx - + Stop transmitting immediately Interrompere immediatamente la trasmissione - + &Halt Tx &Arresta Tx @@ -2829,33 +3892,34 @@ Errore (%2):%3 <html><head/><body><p>Attiva / disattiva un tono Tx puro</p></body></html> - + Toggle a pure Tx tone On/Off Attiva / disattiva un tono Tx puro - + &Tune &Accorda - + + Menus Menù - + <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> <html><head/><body><p>Attiva/disattiva Attendi e Chiama. Clic col tasto destro per pulire il riquadro nominativo DX.</p></body></html> - + Decode other Hounds calling above 1000 Hz audio offset Nota che in modo Hound, WSJT-X è normalmente configurato per ignorare i segnali sopra 1000 Hz. Se vuoi decodificare i segnali oltre la gamma totale del waterfall, per mantenere un tracciamento più vicino del pileup, spunta la casella Rx All Freqs Decodifica altri Hounds che chiamano con offset audio superiore a 1000 Hz Nota che in modo Hound, WSJT-X è normalmente configurato per ignorare i segnali sopra 1000 Hz. Se vuoi decodificare i segnali oltre la gamma totale del waterfall, per mantenereun tracciamento più vicino del pileup, spunta la casella Rx All Freqs - + Enable auto response to the first decode from a new DXCC or new call on the current band. Abilita la risposta automatica alla prima decodifica da un nuovo DXCC o una nuova chiamata sulla banda corrente. @@ -2869,196 +3933,196 @@ Errore (%2):%3 <html><head/><body><p>Selezionare per Tx in minuti o sequenze con numeri pari, iniziando da 0; deselezionare per sequenze dispari. Nel modo MSK144, clic col tasto destro per congelare lo stato della casella per evitare di iniziare un QSO con una stazione che opera nella stessa finestra temporale. Clic su qualsiasi pulsante di modo per scongelare.</p></body></html> - + F Low F Basso - + F High F Alto - + Maximum drift rate in units of symbol rate per transmission. Massima velocità di deriva in unità di symbol rate per trasmissione. - + Max Drift Massima Deriva - + Queue Coda - + In Progress In corso - + 15m FT8 - + 15m 15m - + 160m FT8 - + 160m 160m - - + + 17m FT4 - + 17m FT8 - + 17m 17m - + 30m FT8 - + 30m 30m - + 40m FT8 - + 40m 40m - + 20m FT8 - + 20m 20m - + 60m FT8 - + 60m 60m - - + + 20m FT4 - - + + 30m FT4 - - + + 40m FT4 - + 80m FT8 - + 80m 80m - + 12m FT8 - + 12m 12m - + 10m FT8 - + 10m 10m - + 6m FT8 - + 6m 6m - + 4m FT8 - + 4m 4m - + 2m FT8 - + 2m 2m - + 70cm FT8 70cm FT8 - + 70cm 70cm @@ -3079,30 +4143,30 @@ Errore (%2):%3 6m MSK - + 2m MSK144 2m MSK144 - + 2m MSK 2m MSK - - + + 15m FT4 15m FT4 - - + + 12m FT4 12m FT4 - - + + 10m FT4 10m FT4 @@ -3147,52 +4211,52 @@ Errore (%2):%3 Attiva/disattiva il band hopping. Il band hopping avviene ogni due minuti precisi. I cambiamenti alle caselle hanno effetto immediatamente. - + Band Hopping Band Hopping - + Percentage of minute sequences devoted to transmitting. Percentuale di sequenze minuti dedicate alla trasmissione. - + Prefer Type 1 messages Preferisci i messaggi di tipo 1 - + <html><head/><body><p>Transmit during the next sequence.</p></body></html> <html><head/><body><p>Trasmetti durante la sequenza successiva.</p></body></html> - + Band Buttons Pulsanti della banda - + Use Dark Style Usa lo stile scuro - + Reduce false decodes Riduci decodifiche false - + Default event logging Registrazione predefinita degli eventi - + Diagnostic mode Modalità diagnostica - + Disable event logging Disabilita la registrazione degli eventi @@ -3205,7 +4269,7 @@ Errore (%2):%3 Attiva/disattiva la modalità segugio FT8 - + H H @@ -3214,17 +4278,17 @@ Errore (%2):%3 Passa alla modalità FT8 - + Switch to FT4 mode Passa alla modalità FT4 - + Switch to MSK144 mode Passa alla modalità MSK144 - + MSK MSK @@ -3233,8 +4297,8 @@ Errore (%2):%3 Passa alla modalità Q65 - - + + Q65 Q65 @@ -3243,77 +4307,78 @@ Errore (%2):%3 Passa alla modalità JT65 - + SWL Mode Modo SWL - + Hide lower panel controls to maximize deocde windows Nascondi i controlli del pannello inferiore per massimizzare le finestre di decodifica - + Quick-Start Guide to Q65 Guida rapida a Q65 - + Auto Clear Avg after decode Cancella automaticamente la media dopo la decodifica - + Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 Guida rapida a WSJT-X 2.5.0 e MAP65 3.0 - + Don't split ALL.TXT Non dividere ALL.TXT - + Split ALL.TXT yearly Dividi ALL.TXT annualmente - + Split ALL.TXT monthly Dividi ALL.TXT mensilmente - + Disable writing of ALL.TXT Disabilita la scrittura di ALL.TXT - + Active Stations Stazioni Attive - + + USB dial frequency Frequenza di composizione USB - + 14.078 000 14.078 000 - + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> <html><head/><body><p>30dB consigliato quando è presente solo rumore<br/>Verde quando buono<br/>Rosso quando può verificarsi distorsione<br/>Giallo quando troppo basso</p></body></html> - + Rx Signal Segnale Rx - + 30dB recommended when only noise present Green when good Red when clipping may occur @@ -3324,17 +4389,17 @@ Rosso quando può verificarsi distorsione Giallo quando troppo basso - + DX Call Nominativo DX - + DX Grid Griglia DX - + Callsign of station to be worked Nominativo stazione da collegare @@ -3343,17 +4408,17 @@ Giallo quando troppo basso Ricerca nominativo nel database - + &Lookup &Ricerca - + Locator of station to be worked Localizzatore della stazione da lavorare - + Az: 251 16553 km Az: 251 16553 km @@ -3362,7 +4427,7 @@ Giallo quando troppo basso Aggiungi nominativo e localizzatore al database - + Add Aggiungi @@ -3371,183 +4436,195 @@ Giallo quando troppo basso Potenza - + <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> <html><head/><body><p>Se arancione o rosso si è verificato un errore nel controllo rig, fare clic per ripristinare e leggere la frequenza di sintonia. S implica la modalità split.</p></body></html> - + If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. Se arancione o rosso si è verificato un errore nel controllo rig, fare clic per ripristinare e leggere la frequenza di sintonia. S implica la modalità split. - + ? ? - + Adjust Tx audio level Regola il livello audio Tx - + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> <html><head/><body><p>Seleziona la banda operativa o inserisci la frequenza in MHz o inserisci l'incremento di kHz seguito da k.</p></body></html> - + Frequency entry Immetti la frequenza - + Select operating band or enter frequency in MHz or enter kHz increment followed by k. Seleziona la banda operativa o inserisci la frequenza in MHz o inserisci l'incremento di kHz seguito da k. - + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> <html><head/><body><p align="center"> 2015 Giu 17 </p><p align="center"> 01:23:45 </p></body></html> - + <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> <html><head/><body><p>Selezionare la casella per mantenere fissa la frequenza Tx quando si fa doppio clic sul testo decodificato.</p></body></html> - + Check to keep Tx frequency fixed when double-clicking on decoded text. Selezionare per mantenere fissa la frequenza Tx quando si fa doppio clic sul testo decodificato. - + Hold Tx Freq Blocca la Freq Tx Blocca la Freq Tx - + + Audio Rx frequency Frequenza audio Rx - - - - - - + + + + + + + + Hz Hz - - + + + Rx Rx - - + + + + Set Tx frequency to Rx Frequency Impostare la frequenza Tx su Frequenza Rx - + + ▲ ▲ - + + Frequency tolerance (Hz) Tolleranza di frequenza (Hz) - - + + + F Tol F Tol - - + + + + Set Rx frequency to Tx Frequency Impostare la frequenza Rx su Frequenza Tx - + + ▼ ▼ - + <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> <html><head/><body><p>Sincronizzazione della soglia. I numeri più bassi accettano segnali di sincronizzazione più deboli.</p></body></html> - + Synchronizing threshold. Lower numbers accept weaker sync signals. Sincronizzazione della soglia. I numeri più bassi accettano segnali di sincronizzazione più deboli. - + Sync Sinc - + <html><head/><body><p>Check to use short-format messages.</p></body></html> <html><head/><body><p>Selezionare per utilizzare i messaggi di formato breve.</p></body></html> - + Check to use short-format messages. Selezionare per utilizzare i messaggi di formato breve. - + Sh Sh - + <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> <html><head/><body><p>Selezionare per abilitare le modalità rapide JT9</p></body></html> - + Check to enable JT9 fast modes Selezionare per abilitare le modalità rapide JT9 - - + + Fast Veloce - + <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> <html><head/><body><p>Selezionare per abilitare il sequenziamento automatico dei messaggi Tx in base ai messaggi ricevuti.</p></body></html> - + Check to enable automatic sequencing of Tx messages based on received messages. Selezionare per abilitare il sequenziamento automatico dei messaggi Tx in base ai messaggi ricevuti. - + Auto Seq Auto Seq - + Check to generate "@1250 (SEND MSGS)" in Tx6. Selezionare per generare "@1250 (INVIO MSGS)" in Tx6. - + Tx6 Tx6 @@ -3560,90 +4637,90 @@ Giallo quando troppo basso Selezionare su Tx in minuti o sequenze di numero pari, iniziando da 0; deselezionare le sequenze dispari. - + Tx even/1st Tx pari/1º - + <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> <html><head/><body> <p> Frequenza di chiamata CQ in kHz sopra l'attuale MHz </p> </body> </html> - + Frequency to call CQ on in kHz above the current MHz Frequenza per chiamare CQ in kHz sopra l'attuale MHz - + Tx CQ Tx CQ - + <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> <html><head/><body><p>Spunta questo per chiamare CQ sulla frequenza &quot;Tx CQ&quot;.L' Rx sarà sulla frequenza corrente e il messaggio CQ includerà la frequenza Rx corrente in modo che i chiamanti sappiano su quale frequenza rispondere. Non disponibile per i possessori di nominativi non standard.</p></body></html> - + Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. Not available to nonstandard callsign holders. Spunta questo per chiamare CQ sulla frequenza "Tx CQ". Rx sarà sulla frequenza corrente e il messaggio CQ includerà la frequenza Rx corrente in modo che i chiamanti sappiano su quale frequenza rispondere. Non disponibile per i possessori di nominativi non standard. - + Rx All Freqs Rx Tutte le freq - + <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> <html><head/><body> <p> La modalità secondaria determina la spaziatura dei toni; A è il più stretto. </p> </body> </html> - + Submode determines tone spacing; A is narrowest. La modalità secondaria determina la spaziatura dei toni; A è il più stretto. - + Submode Modalità Secondaria - - + + Fox Fox - + <html><head/><body><p>Check to monitor Sh messages.</p></body></html> <html><head/><body><p>Spuntare per monitorare i messaggi Sh.</p></body></html> - + Check to monitor Sh messages. Spuntare per monitorare i messaggi Sh. - + SWL SWL - + Best S+P Migliore S+P - + <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> <html><head/><body><p>Selezionare questo per iniziare a registrare i dati di calibrazione.<br/>Durante la misurazione la correzione della calibrazione è disabilitata.</br>Se non selezionato è possibile visualizzare i risultati della calibrazione.</p></body></html> - + Check this to start recording calibration data. While measuring calibration correction is disabled. When not checked you can view the calibration results. @@ -3652,216 +4729,214 @@ Durante la misurazione, la correzione della calibrazione è disabilitata. Se non selezionato, è possibile visualizzare i risultati della calibrazione. - + Measure Misura - + <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> <html><head/><body><p>Rapporto segnale: rapporto segnale-rumore nella larghezza di banda di riferimento di 2500 Hz (dB).</p></body></html> - + Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). Rapporto segnale: rapporto segnale-rumore nella larghezza di banda di riferimento di 2500 Hz (dB). - + Report Rapporto - + <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> <html><head/><body><p>TX/RX o Lunghezza della sequenza di calibrazione della frequenza</p></body></html> - + Tx/Rx or Frequency calibration sequence length TX/RX o Lunghezza della sequenza di calibrazione della frequenza - - + + s s - - + + T/R T/R - + + Audio Tx frequency Frequenza Tx audio - - + + + Tx Tx - + Tx# Tx# - - - + + + 1 1 - - - + + + Send this message in next Tx interval Invia questo messaggio nel prossimo intervallo Tx - + Ctrl+2 Ctrl+2 - + <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> <html><head/><body><p>Invia questo messaggio nel prossimo intervallo Tx </p><p>Fare doppio clic per alternare l'uso del messaggio Tx1 per avviare un QSO con una stazione (non consentito per i detentori di chiamate composte di tipo 1)</p></body></html> - + Send this message in next Tx interval Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) Invia questo messaggio nel prossimo intervallo Tx Fare doppio clic per attivare / disattivare l'uso del messaggio Tx1 per avviare un QSO con una stazione (non consentito per i detentori di chiamate composte di tipo 1) - + Ctrl+1 Ctrl+1 - - - - + + + + Switch to this Tx message NOW Passa a questo messaggio Tx ADESSO - + Tx &2 Tx &2 - + Alt+2 Alt+2 - + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> <html><head/><body><p>Passa a questo messaggio Tx ORA</p><p>Fai doppio clic per attivare o disattivare l'uso del messaggio Tx1 per avviare un QSO con una stazione (non consentito per i detentori di chiamate composte di tipo 1)</p></body></html> - + Switch to this Tx message NOW Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) Passa a questo messaggio Tx ADESSO Fare doppio clic per attivare / disattivare l'uso del messaggio Tx1 per avviare un QSO con una stazione (non consentito per i detentori di chiamate composte di tipo 1) - + Tx &1 Tx &1 - + Alt+1 Alt+1 - + Ctrl+6 Ctrl+6 - + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> <html><head/><body><p>Invia questo messaggio nel prossimo intervallo Tx</p><p>Fare doppio clic per ripristinare il messaggio 73 standard</p></body></html> - + Send this message in next Tx interval Double-click to reset to the standard 73 message Invia questo messaggio nel prossimo intervallo Tx Fare doppio clic per ripristinare il messaggio 73 standard - + Ctrl+5 Ctrl+5 - + Ctrl+3 Ctrl+3 - + Tx &3 Tx &3 - + Alt+3 Alt+3 - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>Invia questo messaggio nel prossimo intervallo Tx</p><p>Fare doppio clic per alternare tra i messaggi RRR e RR73 in Tx4 (non consentito per i possessori di chiamate composte di tipo 2)</p><p>I messaggi RR73 devono essere utilizzati solo quando si è ragionevolmente sicuri che non saranno necessarie ripetizioni dei messaggi</p></body></html> + <html><head/><body><p>Invia questo messaggio nel prossimo intervallo Tx</p><p>Fare doppio clic per alternare tra i messaggi RRR e RR73 in Tx4 (non consentito per i possessori di chiamate composte di tipo 2)</p><p>I messaggi RR73 devono essere utilizzati solo quando si è ragionevolmente sicuri che non saranno necessarie ripetizioni dei messaggi</p></body></html> - Send this message in next Tx interval Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - Invia questo messaggio nel prossimo intervallo Tx + Invia questo messaggio nel prossimo intervallo Tx Fare doppio clic per alternare tra i messaggi RRR e RR73 in Tx4 (non consentito per i detentori di chiamate composte di tipo 2) I messaggi RR73 devono essere utilizzati solo quando si è ragionevolmente sicuri che non saranno necessarie ripetizioni dei messaggi - + Ctrl+4 Ctrl+4 - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>Passa a questo messaggio Tx ORA</p><p>Fai doppio clic per alternare tra i messaggi RRR e RR73 in Tx4 (non consentito per i possessori di chiamate composte di tipo2)</p><p>I messaggi RR73 devono essere utilizzati solo quando sei ragionevolmente sicuro che non sarà richiesta alcuna ripetizione del messaggio</p></body></html> + <html><head/><body><p>Passa a questo messaggio Tx ORA</p><p>Fai doppio clic per alternare tra i messaggi RRR e RR73 in Tx4 (non consentito per i possessori di chiamate composte di tipo2)</p><p>I messaggi RR73 devono essere utilizzati solo quando sei ragionevolmente sicuro che non sarà richiesta alcuna ripetizione del messaggio</p></body></html> - Switch to this Tx message NOW Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - Passa a questo messaggio Tx ADESSO + Passa a questo messaggio Tx ADESSO Fare doppio clic per alternare tra i messaggi RRR e RR73 in Tx4 (non consentito per i detentori di chiamate composte di tipo2) I messaggi RR73 devono essere utilizzati solo quando si è ragionevolmente sicuri che non saranno necessarie ripetizioni dei messaggi - + Tx &4 Tx &4 - + Alt+4 Alt+4 @@ -3876,42 +4951,42 @@ Double-click to reset to the standard 73 message Fare doppio clic per ripristinare il messaggio 73 standard - + Tx &5 Tx &5 - + Alt+5 Alt+5 - + Now Now - + Generate standard messages for minimal QSO Genera messaggi standard per un QSO minimo - + Generate Std Msgs Genera Std Msgs - + Tx &6 Tx &6 - + Alt+6 Alt+6 - + Enter a free text message (maximum 13 characters) or select a predefined macro from the dropdown list. Press ENTER to add the current text to the predefined @@ -3922,39 +4997,40 @@ Premere INVIO per aggiungere il testo corrente al predefinito elenco. L'elenco può essere gestito in Impostazioni (F2). - + Queue up the next Tx message Accoda il prossimo messaggio Tx - + Next Prossimo - - - - - - + + + + + + 2 2 - + FST4W FST4:Nuova famiglia di modalità digitali. FST4W:Messaggi simili al WSPR FST4W - - + + + CQ CQ - + Grid Griglia @@ -3963,1260 +5039,1517 @@ elenco. L'elenco può essere gestito in Impostazioni (F2). Max dB - + CQ AF CQ AF - + CQ AN CQ AN - + CQ AS CQ AS - + CQ EU CQ EU - + CQ NA CQ NA - + CQ OC CQ OC - + CQ SA CQ SA - + CQ 0 CQ 0 - + CQ 1 CQ 1 - + CQ 2 CQ 2 - + CQ 3 CQ 3 - + CQ 4 CQ 4 - + CQ 5 CQ 5 - + CQ 6 CQ 6 - + CQ 7 CQ 7 - + CQ 8 CQ 8 - + CQ 9 CQ 9 - + Reset Ripristina - + N List N List - + N Slots N Slots - - - - - - - + + + + + + + Random Casuale - + Call Nominativo - + S/N (dB) S/N (dB) - + Distance Distanza - + More CQs Più CQs - - + + % % - + Tx Pct Tx Pct - + Band Hopping Band Hopping - + Choose bands and times of day for band-hopping. Scegli le fasce e gli orari del giorno per il band-hopping. - + Schedule ... Programma ... - + 1/2 1/2 1/2 - + + WSJT-X by K1JT et al. + + + + + Band Activity decode pane title + + + + + Title for the Band Activity decoded messages pane. + + + + + Band Activity decoded messages headings + + + + + + Columns: UTC dB DT Freq Message. + + + + + Band Activity decoded messages + + + + + Decoded messages in the Band Activity pane. Columns: UTC dB DT Freq Message. + + + + + Rx Frequency decode pane title + + + + + Title for the Rx Frequency decoded messages pane. + + + + + Rx Frequency decoded messages headings + + + + + Rx Frequency decoded messages + + + + + Decoded messages in the Rx Frequency pane. Columns: UTC dB DT Freq Message. + + + + + Check to display received messages in lower case. + + + + + Lower case + + + + + Include Time + + + + + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the strongest station's reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the weakest station's reply to your CQ.</p><p>When CQ or QRZ is pending, Enable Tx may be armed before or during a receive period. Only eligible direct callers decoded after it is armed in that period can replace the pending transmission; earlier callers are not retained.</p></body></html> + + + + 2/2 2/2 2/2 - + 1/3 1/3 1/3 - + 2/3 2/3 2/3 - + 3/3 3/3 3/3 - + 1/4 1/4 1/4 - + 2/4 2/4 - + 3/4 3/4 - + 4/4 4/4 - + 1/5 1/5 - + 2/5 2/5 - + 3/5 3/5 - + 4/5 4/5 - + 5/5 5/5 - + 1/6 1/6 - + 2/6 2/6 - + 3/6 3/6 - + 4/6 4/6 - + 5/6 5/6 - + 6/6 6/6 - + Upload decoded messages to WSPRnet.org. Carica messaggi decodificati su WSPRnet.org. - + Upload spots Carica spot - + <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> <html><head/><body><p>I localizzatori a 6 cifre causano l'invio di 2 messaggi diversi, il secondo contiene il localizzatore completo ma solo un nominativo con hash, altre stazioni devono aver decodificato il primo una volta prima di poter decodificare la chiamata nel secondo. Selezionare questa opzione per inviare localizzatori a 4 cifre solo se si eviterà il protocollo a due messaggi.</p></body></html> - + 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. I localizzatori a 6 cifre causano l'invio di 2 messaggi diversi, il secondo contiene il localizzatore completo ma solo un nominativo con hash, altre stazioni devono aver decodificato il primo una volta prima di poter decodificare la chiamata nel secondo. Selezionare questa opzione per inviare localizzatori a 4 cifre solo se si eviterà il protocollo a due messaggi. - + + Alt+X + + + + Quick-Start Guide to FST4 and FST4W Guida Rapida al FST4 e FST4W - + FST4 FST4:Nuova famiglia di modalità digitali. FST4 - + No own call decodes Nessuna decodifica del proprio nominativo - + Tx Next Tx Successiva - + Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. Imposta la potenza Tx in dBm (dB sopra 1 mW) come parte del tuo messaggio WSPR. - + NB NB - + 40 40 - - - + + + 10 10 - + 17 17 - + 60 60 - - + + 12 12 - + 160 160 - + 20 20 - + 80 80 - - + + 70 70 - + 15 15 - + 30 30 - - - - + + + + 6 6 - + 24G 24G - + 10G 10G - + 5G 5G - - - + + + 9 9 - + 13 13 - + 23 23 - + 33 33 - + 1.25 1.25 - - + + 4 4 - - + + 8 8 - + CQ messages only. Solo messaggi CQ. - + Bypass Filters toggled via Settings or the Filters menu. Ignora i filtri attivati ​​tramite Impostazioni o il menu Filtri. - + BP BP - + <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> <html><head/><body><p>Attiva/disattiva il monitoraggio.<br>Giallo durante il salvataggio dei file .wav.</p></body></html> - + <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> <html><head/><body><p>Attiva/disattiva un tono Tx puro<br>Fare clic con il tasto destro del mouse per regolare il.rig</p></body></html> - + <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> <html><head/><body><p>Cerca il nominativo nel database.<br>Cerca con il tasto destro del mouse il nominativo di chiamata su QRZ.com.</p></body></html> - + <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> <html><head/><body><p>Aggiungere nominativo e localizzatore al database.<br>Cerca con il tasto destro del mouse il nominativo di chiamata su hamqth.com.</p></body></html> - + <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> <html><head/><body><p>Inserisci il nominativo nella lista degli ignorati.<br>Cerca con il tasto destro del mouse il nominativo di chiamata su qrzcq.com.</p></body></html> - + Ignore Ignorare - + Pwr Pwr - <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the the strongest station's reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the the weakest station's reply to your CQ. </p></body></html> - <html><head/><body><p>Seleziona <span style=" font-weight:600;">CQ: Nessuno</span> per scegliere manualmente i chiamanti.</p><p>Seleziona <span style=" font-weight:600;">CQ: Primo</span> per rispondere automaticamente alla prima risposta decodificata al tuo CQ. </p><p>Seleziona <span style=" font-weight:600;">CQ: Distanza massima</span> per rispondere automaticamente alla risposta che ha ottenuto più punti nell'ARRL International Digital Contest, o in generale alla stazione più distante, se il suo messaggio ha una griglia valida.</p><p>Seleziona <span style=" font-weight:600;">CQ: dB massimo</span> per rispondere automaticamente alla risposta della stazione più forte al tuo CQ. </p><p>Seleziona <span style=" font-weight:600;">CQ: dB minimo</span> per rispondere automaticamente alla risposta della stazione più debole al tuo CQ. </p></corpo></html> + <html><head/><body><p>Seleziona <span style=" font-weight:600;">CQ: Nessuno</span> per scegliere manualmente i chiamanti.</p><p>Seleziona <span style=" font-weight:600;">CQ: Primo</span> per rispondere automaticamente alla prima risposta decodificata al tuo CQ. </p><p>Seleziona <span style=" font-weight:600;">CQ: Distanza massima</span> per rispondere automaticamente alla risposta che ha ottenuto più punti nell'ARRL International Digital Contest, o in generale alla stazione più distante, se il suo messaggio ha una griglia valida.</p><p>Seleziona <span style=" font-weight:600;">CQ: dB massimo</span> per rispondere automaticamente alla risposta della stazione più forte al tuo CQ. </p><p>Seleziona <span style=" font-weight:600;">CQ: dB minimo</span> per rispondere automaticamente alla risposta della stazione più debole al tuo CQ. </p></corpo></html> - - + + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> <html><head/><body><p>Seleziona per trasmettere in minuti o sequenze pari, a partire da 0; deseleziona per sequenze dispari. Fai clic con il pulsante destro del mouse per bloccare lo stato della casella di controllo. Fai clic con il pulsante destro del mouse sul pulsante FT8 o MSK per sbloccare.</p></body></html> - + <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> <html><head/><body><p>Passa a T/R 15 s e sottomodalità C.</p></body></html> - + 15C 15C - + <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> <html><head/><body><p>Passa a T/R 15 s e sottomodalità A.</p></body></html> - + 15A 15A - + <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> <html><head/><body><p>Passa a T/R 30 s e sottomodalità B.</p></body></html> - + 30B 30B - + <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> - + 60C 60C - + <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> <html><head/><body><p>Passa a T/R 60 s e sottomodalità D.</p></body></html> - + 60D 60D - + <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> <html><head/><body><p>Passa a T/R 60 s e sottomodalità E.</p></body></html> - + 60E 60E - - + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> <html><head/><body><p>Passa a questo messaggio Tx ORA</p><p>Fai doppio clic per ripristinare il messaggio standard 73</p><p>Fai clic con il pulsante destro del mouse per mantenere il testo libero Tx5</p></body></html> - + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> <html><head/><body><p>Trasmetti un messaggio di testo libero alla prossima occasione.</p></body></html> - + Send msg Invia messaggio - + <html><head/><body><p>Enter a free text message.</p></body></html> <html><head/><body><p>Inserisci un messaggio di testo libero.</p></body></html> - + Free Text Testo libero - + <html><head/><body><p>Select a specific CQ message.</p></body></html> <html><head/><body><p>Seleziona un messaggio CQ specifico.</p></body></html> - + Allow Dupes Consenti duplicati - + <html><head/><body><p>Clear all queues.</p></body></html> <html><head/><body><p>Cancella tutte le code.</p></body></html> - + <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> <html><head/><body><p>Numero massimo di nominativi da visualizzare nella coda.</p></body></html> - + <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> <html><head/><body><p>Seleziona l'ordine desiderato per i nominativi nella coda.</p></body></html> - + Age Durata - + Continent Continente - + Score Punteggio - + <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> <html><head/><body><p>Includi un messaggio CQ insieme ad altri messaggi.</p></body></html> - + <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> <html><head/><body><p>Numero massimo di flussi contemporanei per le trasmissioni Fox.</p></body></html> - + <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> <html><head/><body><p>Attiva/Disattiva il band hopping. Il band hopping avviene ogni due minuti. Le modifiche alle caselle di controllo hanno effetto immediato.<br/>Fai clic con il pulsante destro del mouse per passare alla successiva frequenza di band hopping selezionata o per testare il dispositivo audio predefinito, quando il band hopping è disabilitato.</p></body></html> - - + + 80m FT4 80m FT4 - + FT8 QRG6 FT8 QRG6 - + FT8 QRG1 FT8 QRG1 - + FT8 QRG2 FT8 QRG2 - + FT8 QRG7 FT8 QRG7 - + FT8 QRG8 in kHz. FT8 QRG8 in kHz. - + FT8 QRG5 FT8 QRG5 - + FT8 QRG3 FT8 QRG3 - + FT8 QRG4 FT8 QRG4 - + FT8 QRG8 FT8 QRG8 - + FT8 QRG7 in kHz. FT8 QRG7 in kHz. - + FT8 QRG6 in kHz. FT8 QRG6 in kHz. - + FT8 QRG5 in kHz. FT8 QRG5 in kHz. - + FT8 QRG4 in kHz. FT8 QRG4 in kHz. - + FT8 QRG3 in kHz. FT8 QRG3 in kHz. - + FT8 QRG2 in kHz. FT8 QRG2 in kHz. - + FT8 QRG1 in kHz. FT8 QRG1 in kHz. - + + GroupBox + + + + + CQ %M CQ + + + + + %H 599 %N + + + + + %H TU CQ %M CQ + + + + + %M + + + + + %H + + + + + TU NOW %Q 599 %N + + + + + %H AGN? + + + + + 599 %N + + + + + F1 + F1 + + + + HisCall Exchange + + + + + TU CQ + + + + + F3 + F3 + + + + MyCall + + + + + F4 + F4 + + + + HisCall + + + + + F5 + F5 + + + + Now QueuedCall Exchange + + + + + F6 + F6 + + + + HisCall AGN ? + + + + + Exchange + + + + + Serial number of QSO for contest exchange. + + + + + Click to transmit a message. + + + + + Send message + + + + + Call next + + + + + Message to be transmitted + + + + + Serial Number + + + + + Callsign to be worked next. + + + + Spacing Spaziatura - + Fixed Tone Tono fisso - + K1JT K1JT - + CW CW - + Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. (Modalità Hound = cane da caccia) Attiva/disattiva la modalità hound FT8.<br>Fai clic con il pulsante destro del mouse per attivare o disattivare la modalità SuperFox. - + Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. Passa alla modalità FT8.<br>Fai clic con il pulsante destro del mouse per attivare/disattivare l'ultima modalità contest utilizzata. - + <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> <html><head/><body><p>Passa alla modalità Q65.<br> Fai clic con il pulsante destro del mouse per passare alla modalità Q65 Pileup.</p></body></html> - + <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> <html><head/><body><p>Passa alla modalità JT65. <br>Fai clic con il pulsante destro del mouse per passare alla modalità JT9.</p></body></html> - + <html><head/><body><p>Switch to Echo mode</p></body></html> <html><head/><body><p>Passa alla modalità Echo</p></body></html> - + File File - + View Vista - + Filters Filtri - + Decode Decodificare - + Parameters Parametri - + Decoder sensitivity Sensibilità del decoder - + Decoder start Avvio del decoder - + Number of threads Numero di thread - + QSO RX freq sensitivity Sensibilità della frequenza RX QSO - + Decoding cycles Cicli di decodifica - + Save Salva - + Help Aiuto - + + Mode Modo - + Configurations Configurazioni - + Tools Strumenti - + Exit Uscita - + About WSJT-X Informazioni su WSJT-X - + Waterfall Display a cascata - + Open Apri - + Ctrl+O Ctrl+O - + Open next in directory Apri successivo nella directory - + + Ctrl+X + + + + Decode remaining files in directory Decodifica i file rimanenti nella directory - + + Download EME Ephemeris Chart + + + + + Hide AP information + + + + + <html><head/><body><p>Hide AP information</p></body></html> + + + + + Highlight Whitelist entries + + + + + JTTY + + + Shift+F6 - Shift+F6 + Shift+F6 - + Delete all *.wav && *.c2 files in SaveDir Elimina tutti i file * .wav && * .c2 nel direttorio - + None Nessuno - + Save all Salva tutto - + Remove saved files after 30 days Rimuovi i file salvati dopo 30 giorni - + Online User Guide Guida per l'utente online - + Keyboard shortcuts Scorciatoie da tastiera - + Special mouse commands Comandi speciali mouse - + JT9 JT9 - + Save decoded Salva decodificato - - + + Normal Normale - + Deep Profondo - + Erase ALL.TXT Cancella ALL.TXT - + Erase wsjtx_log.adi Cancella wsjtx_log.adi - + Erase wsjtx.log Cancella il.log.wsjtx - + Erase Ignore List Cancella elenco ignorati - + F7 F7 - + Quick-Start Guide to WSJT-X 2.7 and QMAP Guida rapida a WSJT-X 2.7 e QMAP - - WSJT-X_improved Home Page - Pagina iniziale di WSJT-X.migliorato - - - - <html><head/><body><p>Go to the wsjt-x_improved home page.</p></body></html> - <html><head/><body><p>Vai alla homepage di wsjt-x.migliorato.</p></body></html> - - - - The additional features of wsjt-x_improved - Le funzionalità aggiuntive di wsjt-x_improved - - - - <html><head/><body><p>Overview on the additional features of wsjt-x_improved.</p></body></html> - <html><head/><body><p>Panoramica sulle funzionalità aggiuntive di wsjt-x_improved.</p></body></html> - - - Recommended audio settings - Impostazioni audio consigliate + Impostazioni audio consigliate - <html><head/><body><p>Recommended Audio Settings.</p></body></html> - <html><head/><body><p>Impostazioni audio consigliate.</p></body></html> + <html><head/><body><p>Impostazioni audio consigliate.</p></body></html> - + How to deal with rig control errors Come gestire gli errori di controllo del rig - + <html><head/><body><p>How to deal with rig control errors.</p></body></html> <html><head/><body><p>Come gestire gli errori di controllo del rig.</p></body></html> - + Erase list of Q65 callers Cancella l'elenco dei chiamanti Q65 - + SuperFox User Guide Guida utente SuperFox - + Message Creator Creatore di messaggi - + Hide stations worked before on band Nascondi le stazioni lavorate prima sulla banda - + Hide stations worked today or yesterday Nascondi le stazioni lavorate oggi o ieri - + Hide stations from Ignore List Nascondi le stazioni dall'elenco ignorati - + Ignore stations worked today or yesterday Ignora le stazioni lavorate oggi o ieri - + Ignore stations from Ignore List Ignora le stazioni dall'elenco ignorati - + Hide stations from Territory 1 Nascondi le stazioni dal Territorio 1 - + Hide stations from Territory 2 Nascondi le stazioni dal Territorio 2 - + Hide stations from Territory 3 Nascondi le stazioni dal Territorio 3 - + Hide stations from Territory 4 Nascondi le stazioni dal Territorio 4 - + Hide stations from Europe Nascondi le stazioni dall'Europa - + Hide stations from North America Nascondi le stazioni del Nord America - + Hide stations from South America Nascondi le stazioni del Sud America - + Hide stations from Asia Nascondi le stazioni dall'Asia - + Hide stations from Africa Nascondi le stazioni dall'Africa - + Hide stations from Oceania Nascondi le stazioni dall'Oceania - + Hide stations from Antarctica Nascondi le stazioni dall'Antartide - + Full Duplex Mode Modalità Full Duplex - + Highlight callsigns worked before on band Evidenzia i nominativi lavorati in precedenza sulla banda - + Highlight callsigns worked today or yesterday Evidenzia i nominativi lavorati oggi o ieri - + Highlight callsigns from Ignore List Evidenzia i nominativi dall'elenco ignorati - + Enable Message Popups Abilita i popup dei messaggi - + QSY Monitor Monitor QSY - + Ignore stations worked before on band Ignora le stazioni lavorate prima sulla banda - + Use multithreaded FT8 decoder Utilizzare il decoder FT8 multithread - + Auto Auto - - + + 5 5 - - + + 7 7 - - + + 11 11 - + Low Basso - + Medium Medio - + High Alto - + Minimum Minimo - + Use low thresholds Utilizzare soglie basse - + Use subpass Usa il sottopassaggio - + 2-Stage 2-Fasi - + 3-Stage 3-Fasi - + Early Presto - + Late Tardi - + Wideband DX Call search Ricerca di chiamate DX a banda larga - + Hide FT8 dupe messages Nascondi i messaggi duplicati di FT8 - + VHF / UHF Buttons Pulsanti VHF / UHF - + Highlight stations from Territory 1 Evidenzia le stazioni del Territorio 1 - + Highlight stations from Territory 2 Evidenzia le stazioni del Territorio 2 - + Highlight stations from Territory 3 Evidenzia le stazioni del Territorio 3 - + Highlight stations from Territory 4 Evidenzia le stazioni del Territorio 4 - + Disable clicks on waterfall Disabilita i clic sul waterfall @@ -5225,421 +6558,432 @@ elenco. L'elenco può essere gestito in Impostazioni (F2). Temporizzatore TX terminato - - + + JT65 JT65 - + Astronomical data Dati Astronomici - + List of Type 1 prefixes and suffixes Elenco di prefissi e suffissi di tipo 1 - + Settings... Impostazioni... - + Local User Guide Guida per l'utente locale - + Open log directory Apri il direttorio del Log - + JT4 JT4 - + Message averaging Media dei messaggi - + Enable averaging Abilita Media - + Enable deep search Abilita ricerca profonda - + WSPR WSPR - + Echo Graph Grafico Eco - + F8 F8 - - + + Echo Eco - + EME Echo mode Modo Eco EME - + ISCAT ISCAT - + Fast Graph Grafico Veloce - F9 - F9 + F9 - + &Download Samples ... &Scarica Campioni ... - + <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> <html><head/><body><p>Scarica file audio di esempio che dimostrano le varie modalità.</p></body></html> - + MSK144 MSK144 - + QRA64 QRA64 - + Release Notes Note di rilascio - + Enable AP for DX Call Abilita AP per DX Call - + FreqCal FreqCal - + Measure reference spectrum Misurare lo spettro di riferimento - + Measure phase response Misura la risposta di fase - + Erase reference spectrum Cancella spettro di riferimento - + Execute frequency calibration cycle Eseguire il ciclo di calibrazione della frequenza - + Equalization tools ... Strumenti di equalizzazione ... - - + + FT8 FT8 - - + + Enable AP Abilita AP - + Solve for calibration parameters Risolvi per i parametri di calibrazione - + Copyright notice Avviso sul copyright - + Shift+F1 Shift+F1 - + Fox log Fox log - + FT8 DXpedition Mode User Guide Traduzione di PY1ZRJ Marco (In caso di suggerimenti e o correzioni inviare un email per PY1ZRJ@outlook.com) Manuale Utente modo FT8 DXpedition - + Reset Cabrillo log ... Resetta Cabrillo log ... - + Color highlighting scheme Schema di evidenziazione del colore - + Export Cabrillo log ... Esporta Log Cabrillo ... - + Contest log Log del Contest - + Erase WSPR hashtable Cancella hashtable WSPR - - + + FT4 FT4 - + Rig Control Error Errore di controllo rig - - - + + + Receiving Ricevendo - + Do you want to reconfigure the radio interface? Vuoi riconfigurare l'interfaccia radio? - + Error Scanning ADIF Log Errore durante la scansione del registro ADIF - + Scanned ADIF log, %1 worked-before records created. CTY: %2 Log ADIF scansionato, %1 record elaborati prima della creazione. CTY: %2 - + Error Loading LotW Users Data Errore durante il caricamento dei dati degli utenti di LotW - + + + + Decoder Error + + + + + The decoder subprocess exited unexpectedly. + + + + + jt9 exited unexpectedly with code %1. + + + + + Error Writing WAV File Errore durante la scrittura del file WAV - + Enumerating audio devices Enumerazione dei dispositivi audio - + Configurations... Configurazioni... - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Message Messaggio - + Error Killing jt9.exe Process Errore durante l'uccisione del processo jt9.exe - + KillByName return code: %1 Codice di ritorno KillByName:%1 - + Error removing "%1" Errore durante la rimozione di "%1" - + Click OK to retry Fai clic su OK per riprovare - - + + Improper mode Modalità impropria - - + + File Open Error Errore apertura file - - - - - + + + + + Cannot open "%1" for append: %2 Impossibile aprire "%1" per aggiungere:%2 - + Error saving c2 file Errore salvataggio file c2 - + Error in Sound Input Errore nell'ingresso audio - + Error in Sound Output Errore nell'uscita audio - - + + Single-Period Decodes Decodifiche a periodo singolo - - + + Average Decodes Media Decodifiche - + Change Operator Cambio Operatore - + New operator: Nuovo operatore: - + Status File Error Errore del file di stato - - + + Cannot open "%1" for writing: %2 Impossibile aprire "%1" per la scrittura:%2 - + Decodes containing My Call Decodifiche contenente la mia chiamata - + Subprocess Error Errore sottoprocesso - + Subprocess failed with exit code %1 Il sottoprocesso non è riuscito con il codice di uscita%1 - - + + Running: %1 %2 In esecuzione: %1 %2 - + Subprocess error Errore sottoprocesso - Reference spectrum saved - Spettro di riferimento salvato + Spettro di riferimento salvato - It is very important to avoid audio harmonics and distorted audio signals. This is usually achieved by the following step-by-step approach: @@ -5663,7 +7007,7 @@ This is usually achieved by the following step-by-step approach: If possible, check your transmission from time to time with a webSDR to ensure the signal is clean and not distorted. - È molto importante evitare armoniche audio e segnali audio distorti. + È molto importante evitare armoniche audio e segnali audio distorti. Questo si ottiene solitamente con il seguente approccio passo-passo: 1. Seleziona "Fake it" nel menu Impostazioni/Radio come "Modalità Split". Se il tuo @@ -5687,22 +7031,21 @@ Se possibile, controlla la tua trasmissione di tanto in tanto con un webSDR per assicurarti che il segnale sia pulito e non distorto. - <b>Recommended Audio Settings</b> - <b>Impostazioni audio consigliate</b> + <b>Impostazioni audio consigliate</b> - + Invalid data in fmt.all at line %1 Dati non validi in fmt.all alla riga%1 - + Good Calibration Solution Buona soluzione di calibrazione - + <pre>%1%L2 ±%L3 ppm %4%L5 ±%L6 Hz @@ -5715,12 +7058,12 @@ per assicurarti che il segnale sia pulito e non distorto. %9%L10 Hz</pre> - + Delete Calibration Measurements Elimina misure di calibrazione - + The "fmt.all" file will be renamed as "fmt.bak" Il file "fmt.all" verrà rinominato come "fmt.bak" @@ -5826,7 +7169,7 @@ per assicurarti che il segnale sia pulito e non distorto. </table> - + Please choose another dial frequency. Must be 3Khz away from %1. WSJT-X will not operate in Fox mode @@ -5837,36 +7180,34 @@ WSJT-X non opera in modalità Fox sulle sottobande standard di FT8. - + No data read from disk. Wrong file format? Nessun dato letto dal disco. Formato file errato? - If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: "The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2025 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; and other members of the WSJT Development Group." - Se si fa un uso corretto di qualsiasi parte di WSJT-X secondo i termini della GNU General Public License, è necessario esporre la seguente nota di copyright in modo ben visibile nel proprio lavoro derivato: + Se si fa un uso corretto di qualsiasi parte di WSJT-X secondo i termini della GNU General Public License, è necessario esporre la seguente nota di copyright in modo ben visibile nel proprio lavoro derivato: "Gli algoritmi, il codice sorgente, l'aspetto grafico di WSJT-X e dei programmi correlati, e le specifiche di protocollo per le modalità FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 sono protetti da Copyright (C) 2001-2025 da uno o più dei seguenti autori: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; e altri membri del Gruppo di Sviluppo WSJT." - + Confirm Delete Conferma Eliminazione - + Are you sure you want to delete all *.wav and *.c2 files in "%1"? Sei sicuro di voler eliminare tutti i file * .wav e * .c2 in "%1"? - + Keyboard Shortcuts Scorciatoie da tastiera - <table cellspacing=1> <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> @@ -5917,7 +7258,7 @@ sulle sottobande standard di FT8. </table> Keyboard shortcuts help window contents - <table cellspacing=1> + <table cellspacing=1> <tr><td><b>Esc </b></td><td>Interrompi trasmissione, annulla QSO, cancella coda chiamata successiva</td></tr> <tr><td><b>F1 </b></td><td>Guida utente online (Alt: trasmetti Tx6)</td></tr> <tr><td><b>Maiusc+F1 </b></td><td>Informativa sul copyright</td></tr> @@ -5968,7 +7309,7 @@ sulle sottobande standard di FT8. </table> - + Special Mouse Commands Comandi speciali mouse @@ -6039,23 +7380,21 @@ sulle sottobande standard di FT8. </table> - + No more files to open. Niente più file da aprire. - - Spotting to PSK Reporter unavailable - Spotting su PSK Reporter non disponibile + Spotting su PSK Reporter non disponibile - + Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. Scegli un'altra frequenza Tx. WSJT-X non trasmetterà consapevolmente un'altra modalità nella sottobanda WSPR a 30 m. - + WSPR Guard Band Banda di guardia WSPR @@ -6064,13 +7403,12 @@ sulle sottobande standard di FT8. Scegli un'altra frequenza di composizione. WSJT-X non funzionerà in modalità Fox nelle sottobande FT8 standard. - - + Fox Mode warning Avviso modalità Fox - + Last Tx: %1 Ultimo Tx:%1 @@ -6092,7 +7430,6 @@ Fare clic sul pulsante MSK144 per ri-abilitare la casella Tx pari/primo, o scegliere un'altra stazione. - <table cellpadding=5> <tr> <th align="right">Click on</th> @@ -6206,7 +7543,7 @@ Tx pari/primo, o scegliere un'altra stazione. </table> Mouse commands help window contents Hound=Cane da Caccia - <table cellpadding=5> + <table cellpadding=5> <tr> <th align="right">Clicca su</th> <th align="left">Azione</th> @@ -6315,7 +7652,7 @@ Se è selezionato <b>Comportamento alternativo del pulsante Cancella</b </table> - + Please choose another dial frequency. WSJT-X will not operate in Fox mode overlapping the WSPR sub-bands. @@ -6324,7 +7661,7 @@ WSJT-X non funzionerà in modalità Fox sovrapponendosi alle sottobande WSPR. - + This station transmits in the same time slot as you do. You must not start a QSO if both stations Tx even/1st @@ -6341,7 +7678,7 @@ Cliccate sul pulsante della modalità MSK144 per riabilitare la casella di contr oppure scegliete un'altra stazione. - + Should you switch to EU VHF Contest mode? To do so, check 'Special operating activity' and @@ -6352,261 +7689,873 @@ Per fare ciò, selezionare "Attività operativa speciale" e "Contest VHF EU" sulle impostazioni | Scheda Avanzate. - + Should you switch to ARRL Field Day mode? Dovresti passare alla modalità Field Day di ARRL? - + Should you switch to RTTY contest mode? Dovresti passare alla modalità contest RTTY? - - - - + + + Decoder is starting; decode request skipped. + + + + + + + Add to CALL3.TXT Aggiungi a CALL3.TXT - + Please enter a valid grid locator Inserisci un localizzatore di griglia valido - + Cannot open "%1" for read/write: %2 Impossibile aprire "%1" per lettura / scrittura:%2 - + %1 is already in CALL3.TXT, do you wish to replace it? %1 è già in CALL3.TXT, desideri sostituirlo? - + Warning: DX Call field is empty. Avviso: il campo Chiamata DX è vuoto. - + + SuperFox free text may only contain spaces, digits, uppercase letters, and + - . / ?. + + + + Log file error Errore nel file di registro - + Cannot open "%1" Impossibile aprire "%1" - + Error sending log to N1MM Errore durante l'invio del Log a N1MM - + Write returned "%1" Scrivi ha restituito "%1" - + Stations calling DXpedition %1 Stazioni che chiamano la DXpedition %1 - + Show Already Worked Mostra già lavorato - + Super Fox Super.Fox - + Super Hound Super.Hound - + Hound (Hound=Cane da caccia) Hound - + Tx Messages Messaggi Tx - - - - - - + + + + + + Confirm Erase Conferma Cancella - + Are you sure you want to erase file ALL.TXT? Sei sicuro di voler cancellare il file ALL.TXT? - + Are you sure you want to erase the list of Q65 callers? Vuoi davvero cancellare l'elenco dei chiamanti Q65? - - + + Confirm Reset Conferma Ripristina - - Are you sure you want to erase your contest log? - Sei sicuro di voler cancellare il tuo Log del contest? + + The decoder subprocess could not be stopped. + - - Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. - In questo modo verranno rimossi tutti i record QSO per il contest corrente. Saranno conservati nel file di registro ADIF ma non saranno disponibili per l'esportazione nel registro Cabrillo. + + The decoder subprocess could not be restarted. + - - Cabrillo Log saved - Log Cabrillo salvato + + %1.wav: invalid sample count %2 + - - Are you sure you want to erase file wsjtx_log.adi? - Sei sicuro di voler cancellare il file wsjtx_log.adi? + + Application status + - - Are you sure you want to erase the WSPR hashtable? - Sei sicuro di voler cancellare la tabella hash WSPR? + + Current WSJT-X status messages and operating indicators. + - - %1 W - %1 W + + Transmit status + - - SWR > 2.5 !!! - -Transmission was stopped - -Check your antenna - ROS > 2,5!!! - -La trasmissione è stata interrotta - -Controlla l'antenna + + Decode count + - - Tune digital gain - Ottimizza il guadagno digitale + + Last transmitted message + - - Transmit digital gain - Trasmetti Guadagno digitale + + Power and SWR status + - - Prefixes - Prefissi + + Decode progress + - - Network Error - Errore di Rete + + Progress for the current decode operation. + - - Error: %1 -UDP server %2:%3 - Errore:%1 -Server UDP%2:%3 + + Transmit watchdog + - - File Error - Errore File + + The selected transmit message cannot be encoded. Enable Tx has been turned off. Edit the selected message or check station settings before trying again. + - - Phase Training Disabled - Fase di Allenamento Disabilitato + + Tx message cannot be encoded; Enable Tx is off + - - Phase Training Enabled - Fase di allenamento abilitato + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2026 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; Roger Rehr, W3SZ; John Nelson, G4KLA; Charlie Suckling, DL3WDG; Terrell Deppe, KJ5HST; and other members of the WSJT Development Group." + - - WD:0m - WD:0m + + EME Chart + - - Runaway Tx watchdog - Tx.watchdog.Sfuggito + + Select Year + - + + FT8 input completion was rejected: automated=%1 awaiting=%2 frames=%3. + + + + + Unable to flush the final FT8 downsampling block. + + + + + FT8 input completed with %1 of %2 samples in the decode buffer. + + + + + FT8 decoding is running behind; early passes are temporarily reduced. + + + + + FT8 decoding caught up; configured early passes restored. + + + + + + PSK Reporter spot queue full; oldest spot dropped + + + + + A QSO between two stations with nonstandard callsigns won't work. + +Auto Seq would get stuck in an endless loop. + + + + + %1 shorthand-message mode + + + + + RR73 is not available in %1. Tx4 uses RRR in this mode. + + + + + Wait & Pounce requires a CQ response mode. +Change CQ: None to another option. + + + + + DX call + + + + + Callsign of station to be worked. + + + + + DX grid + + + + + Locator of station to be worked. + + + + + Wait and Call + + + + + Lookup DX call + + + + + Add DX call + + + + + Ignore DX call + + + + + CQ response mode + + + + + Selects a station automatically from replies to your pending CQ after Enable Tx is armed in the current receive period, or from CQ messages for Wait & Pounce. + + + + + Transmit audio frequency + + + + + Receive audio frequency + + + + + Signal report + + + + + Operating band + + + + + Operating band text + + + + + Transmit power attenuation + + + + + Adjust Tx audio level attenuation. + + + + + Show or hide the menu bar. + + + + + Rig control status + + + + + Hound mode + + + + + Toggle FT8 hound mode. Right-click to toggle SuperFox mode. + + + + + Message panel selector + + + + + Switches between standard messages, Fox queue, and band hopping pages. Press 1, 2, or 3 while focused to select a page. + + + + + Standard messages + + + + + Fox queue + + + + + + Band hopping + + + + + Standard messages page + + + + + Fox queue page + + + + + Band hopping page + + + + + Hound queue + + + + + Queued Hound callers available for Fox transmissions. + + + + + Fox transmissions in progress + + + + + Hound callers currently in progress for Fox transmissions. + + + + + Hound queue sort order + + + + + Hound queue list size + + + + + Fox transmission slots + + + + + Fox CQ message + + + + + Reset Fox queues + + + + + Fox free text + + + + + Send Fox free text + + + + + Enable FT8 QRG 1 + + + + + Enable FT8 QRG 2 + + + + + Enable FT8 QRG 3 + + + + + Enable FT8 QRG 4 + + + + + Enable FT8 QRG 5 + + + + + Enable FT8 QRG 6 + + + + + Enable FT8 QRG 7 + + + + + Enable FT8 QRG 8 + + + + + FT8 QRG 1 frequency + + + + + FT8 QRG 2 frequency + + + + + FT8 QRG 3 frequency + + + + + FT8 QRG 4 frequency + + + + + FT8 QRG 5 frequency + + + + + FT8 QRG 6 frequency + + + + + FT8 QRG 7 frequency + + + + + FT8 QRG 8 frequency + + + + + Tx1 message + + + + + Tx2 message + + + + + Tx3 message + + + + + Tx4 message + + + + + Tx5 message macro + + + + + Tx6 message + + + + + Tx5 message macro text + + + + + Select Tx1 for next transmission + + + + + Select Tx2 for next transmission + + + + + Select Tx3 for next transmission + + + + + Select Tx4 for next transmission + + + + + Select Tx5 for next transmission + + + + + Select Tx6 for next transmission + + + + + Transmit Tx1 now + + + + + Transmit Tx2 now + + + + + Transmit Tx3 now + + + + + Transmit Tx4 now + + + + + Transmit Tx5 now + + + + + Transmit Tx6 now + + + + + All Decodes + + + + + QSO Frequency + + + + + Are you sure you want to erase your contest log? + Sei sicuro di voler cancellare il tuo Log del contest? + + + + Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. + In questo modo verranno rimossi tutti i record QSO per il contest corrente. Saranno conservati nel file di registro ADIF ma non saranno disponibili per l'esportazione nel registro Cabrillo. + + + + Cabrillo Log saved + Log Cabrillo salvato + + + + Are you sure you want to erase file wsjtx_log.adi? + Sei sicuro di voler cancellare il file wsjtx_log.adi? + + + + Are you sure you want to erase the WSPR hashtable? + Sei sicuro di voler cancellare la tabella hash WSPR? + + + + %1 W + %1 W + + + + SWR > 2.5 !!! + +Transmission was stopped + +Check your antenna + ROS > 2,5!!! + +La trasmissione è stata interrotta + +Controlla l'antenna + + + + Tune digital gain + Ottimizza il guadagno digitale + + + + Transmit digital gain + Trasmetti Guadagno digitale + + + + Prefixes + Prefissi + + + + Network Error + Errore di Rete + + + + Error: %1 +UDP server %2:%3 + Errore:%1 +Server UDP%2:%3 + + + + + File Error + Errore File + + + + + Stop transmitting or tuning before changing the dial frequency. + + + + + + Measuring reference spectrum: %1 s remaining + + + + + Reference spectrum measurement stopped; Ref Spec is available + + + + + Reference spectrum saved; Ref Spec is available + + + + + Reference spectrum measurement stopped; no reference spectrum is available + + + + + Phase Training Disabled + Fase di Allenamento Disabilitato + + + + Phase Training Enabled + Fase di allenamento abilitato + + + + Cannot remove "%1": %2 + + + + + WD:0m + WD:0m + + + + Runaway Tx watchdog + Tx.watchdog.Sfuggito + + + WD:%1m WD:%1m - - + + + Free Text Message Messaggio di testo libero - - + + Message: Messaggio: - + Directional calls not yet supported in SuperFox mode Le chiamate direzionali non sono ancora supportate in modalità SuperFox - + TOTP: No seed entered in fox configuration to generate verification code. TOTP: Nessun seed inserito nella configurazione Fox per generare il codice di verifica. - + + SuperFox cannot queue %1: unsupported callsign. + + + + TOTP SF: seed not long enough. TOTP SF: seed non abbastanza lungo. - + + SuperFox Tx stopped: invalid message tokens. + + + + + SuperFox Tx stopped: invalid verification code. + + + + + SuperFox Tx stopped: invalid CQ call or grid. + + + + + SuperFox Tx stopped: invalid callsign. + + + + + SuperFox Tx stopped: report is outside the SuperFox range. + + + + + SuperFox Tx stopped: free text contains unsupported characters. + + + + + SuperFox Tx stopped: message could not be packed. + + + + Are you sure you want to erase the Tx Log? Sei sicuro di voler cancellare il registro Tx? - + "%1" added to Ignore List "%1" aggiunto all'elenco degli ignorati - + Are you sure you want to erase the Ignore List? Sei sicuro di voler cancellare l'elenco degli ignorati? @@ -6615,13 +8564,13 @@ Server UDP%2:%3 WD:%1m - - + + Log File Error Errore file di Log - + Are you sure you want to clear the QSO queues? Sei sicuro di voler cancellare le code QSO? @@ -6722,10 +8671,10 @@ Server UDP%2:%3 Msg libero - - - - + + + + 3 3 @@ -6746,12 +8695,14 @@ Server UDP%2:%3 Trasmettere durante la sequenza di 2 minuti successiva. + Configuration - Configurazione + Configurazione + F2 - F2 + F2 Monitor OFF at startup @@ -6948,57 +8899,264 @@ Server UDP%2:%3 <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> </table> - Keyboard shortcuts help window contents - Scorciatoie da tastiera contenuto della finestra della guida - <table cellspacing = 1> - <tr><td> <b> Esc </b></td> <td> Ferma Tx, interrompi QSO, cancella la coda della chiamata successiva </td> </tr> - <tr><td> <b> F1 </b></td> <td> Guida in linea dell'utente (Alt: trasmissione Tx6) </td> </tr> - <tr><td> <b> Maiusc + F1 </b></td> <td> Avviso sul copyright </td> </tr> - <tr><td> <b> Ctrl + F1 </b></td> <td> Informazioni su WSJT-X </td> </tr> - <tr><td> <b> F2 </b></td> <td> Apri la finestra delle impostazioni (Alt: trasmissione Tx2) </td> </tr> - <tr><td> <b> F3 </b></td> <td> Visualizza scorciatoie da tastiera (Alt: trasmissione Tx3) </td> </tr> - <tr><td> <b> F4 </b></td> <td> Cancella chiamata DX, Griglia DX, messaggi Tx 1-4 (Alt: trasmissione Tx4) </td> </tr> - <tr><td> <b> Alt + F4 </b></td> <td> Esci dal programma </td> </tr> - <tr><td> <b> F5 </b></td> <td> Visualizza comandi speciali del mouse (Alt: trasmissione Tx5) </td> </tr> - <tr><td> <b> F6 </b></td> <td> Apri il file successivo nella directory (Alt: attiva / disattiva "Chiama 1º") </td> </tr> - <tr><td> <b> Maiusc + F6 </b></td> <td> Decodifica tutti i file rimanenti nella directory </td> </tr> - <tr><td> <b> F7 </b></td> <td> Visualizza finestra media messaggio </td> </tr> - <tr><td> <b> F11 </b></td> <td> Sposta la frequenza Rx verso il basso di 1 Hz </td> </tr> - <tr><td> <b> Ctrl + F11 </b></td> <td> Sposta frequenze Rx e Tx identiche verso il basso di 1 Hz </td> </tr> - <tr><td> <b> Maiusc + F11 </b></td> <td> Sposta la frequenza Tx verso il basso di 60 Hz (FT8) o 90 Hz (FT4) </td> </tr> - <tr><td> <b> Ctrl + Maiusc + F11 </b></td> <td> Sposta la frequenza di composizione verso il basso di 2000 Hz </td> </tr> - <tr><td> <b> F12 </b></td> <td> Sposta la frequenza Rx su 1 Hz </td> </tr> - <tr><td> <b> Ctrl + F12 </b></td> <td> Sposta frequenze Rx e Tx identiche su 1 Hz </td> </tr> - <tr><td> <b> Maiusc + F12 </b></td> <td> Sposta la frequenza Tx su 60 Hz (FT8) o 90 Hz (FT4) </td> </tr> - <tr><td> <b> Ctrl + Maiusc + F12 </b></td> <td> Sposta la frequenza di composizione verso l'alto di 2000 Hz </td> </tr> - <tr><td> <b> Alt + 1-6 </b></td> <td> Imposta ora la trasmissione a questo numero nella scheda 1 </td> </tr> - <tr><td> <b> Ctl + 1-6 </b></td> <td> Imposta la trasmissione successiva a questo numero nella scheda 1 </td> </tr> - <tr><td> <b> Alt + B </b></td> <td> Alterna lo stato "Migliore S + P" </td> </tr> - <tr><td> <b> Alt + C </b></td> <td> Attiva / disattiva la casella di controllo "Chiama 1º" </td> </tr> - <tr><td> <b> Alt + D </b></td> <td> Decodifica di nuovo alla frequenza QSO </td> </tr> - <tr><td> <b> Maiusc + D </b></td> <td> Decodifica completa (entrambe le finestre) </td> </tr> - <tr><td> <b> Ctrl + E </b></td> <td> Attiva TX pari / 1 ° </td> </tr> - <tr><td> <b> Maiusc + E </b></td> <td> Disattiva TX pari / 1 ° </td> </tr> - <tr><td> <b> Alt + E </b></td><td>Erase</td> </tr> - <tr><td> <b> Ctrl + F </b></td> <td> Modifica la casella del messaggio di testo libero </td> </tr> - <tr><td> <b> Alt + G </b></td> <td> Genera messaggi standard </td> </tr> - <tr><td> <b> Alt + H </b></td> <td> Interrompi trasmissione </td> </tr> - <tr><td> <b> Ctrl + L </b></td> <td> Cerca il nominativo nel database, genera messaggi standard </td> </tr> - <tr><td> <b> Alt + M </b></td><td>Monitor</td> </tr> - <tr><td> <b> Alt + N </b></td> <td> Abilita Tx </td> </tr> - <tr><td> <b> Ctrl + O </b></td> <td> Apri un file .wav </td> </tr> - <tr><td> <b> Alt + O </b></td> <td> Cambia operatore </td> </tr> - <tr><td> <b> Alt + Q </b></td> <td> Registra QSO </td> </tr> - <tr><td> <b> Ctrl + R </b></td> <td> Imposta messaggio Tx4 su RRR (non in FT4) </td> </tr> - <tr><td> <b> Alt + R </b></td> <td> Imposta messaggio Tx4 su RR73 </td> </tr> - <tr><td> <b> Alt + S </b></td> <td> Interrompi monitoraggio </td> </tr> - <tr><td> <b> Alt + T </b></td> <td> Attiva / disattiva stato di regolazione </td> </tr> - <tr><td> <b> Alt + Z </b></td> <td> Cancella stato decoder bloccato </td> </tr> -</table> + Keyboard shortcuts help window contents + Scorciatoie da tastiera contenuto della finestra della guida + <table cellspacing = 1> + <tr><td> <b> Esc </b></td> <td> Ferma Tx, interrompi QSO, cancella la coda della chiamata successiva </td> </tr> + <tr><td> <b> F1 </b></td> <td> Guida in linea dell'utente (Alt: trasmissione Tx6) </td> </tr> + <tr><td> <b> Maiusc + F1 </b></td> <td> Avviso sul copyright </td> </tr> + <tr><td> <b> Ctrl + F1 </b></td> <td> Informazioni su WSJT-X </td> </tr> + <tr><td> <b> F2 </b></td> <td> Apri la finestra delle impostazioni (Alt: trasmissione Tx2) </td> </tr> + <tr><td> <b> F3 </b></td> <td> Visualizza scorciatoie da tastiera (Alt: trasmissione Tx3) </td> </tr> + <tr><td> <b> F4 </b></td> <td> Cancella chiamata DX, Griglia DX, messaggi Tx 1-4 (Alt: trasmissione Tx4) </td> </tr> + <tr><td> <b> Alt + F4 </b></td> <td> Esci dal programma </td> </tr> + <tr><td> <b> F5 </b></td> <td> Visualizza comandi speciali del mouse (Alt: trasmissione Tx5) </td> </tr> + <tr><td> <b> F6 </b></td> <td> Apri il file successivo nella directory (Alt: attiva / disattiva "Chiama 1º") </td> </tr> + <tr><td> <b> Maiusc + F6 </b></td> <td> Decodifica tutti i file rimanenti nella directory </td> </tr> + <tr><td> <b> F7 </b></td> <td> Visualizza finestra media messaggio </td> </tr> + <tr><td> <b> F11 </b></td> <td> Sposta la frequenza Rx verso il basso di 1 Hz </td> </tr> + <tr><td> <b> Ctrl + F11 </b></td> <td> Sposta frequenze Rx e Tx identiche verso il basso di 1 Hz </td> </tr> + <tr><td> <b> Maiusc + F11 </b></td> <td> Sposta la frequenza Tx verso il basso di 60 Hz (FT8) o 90 Hz (FT4) </td> </tr> + <tr><td> <b> Ctrl + Maiusc + F11 </b></td> <td> Sposta la frequenza di composizione verso il basso di 2000 Hz </td> </tr> + <tr><td> <b> F12 </b></td> <td> Sposta la frequenza Rx su 1 Hz </td> </tr> + <tr><td> <b> Ctrl + F12 </b></td> <td> Sposta frequenze Rx e Tx identiche su 1 Hz </td> </tr> + <tr><td> <b> Maiusc + F12 </b></td> <td> Sposta la frequenza Tx su 60 Hz (FT8) o 90 Hz (FT4) </td> </tr> + <tr><td> <b> Ctrl + Maiusc + F12 </b></td> <td> Sposta la frequenza di composizione verso l'alto di 2000 Hz </td> </tr> + <tr><td> <b> Alt + 1-6 </b></td> <td> Imposta ora la trasmissione a questo numero nella scheda 1 </td> </tr> + <tr><td> <b> Ctl + 1-6 </b></td> <td> Imposta la trasmissione successiva a questo numero nella scheda 1 </td> </tr> + <tr><td> <b> Alt + B </b></td> <td> Alterna lo stato "Migliore S + P" </td> </tr> + <tr><td> <b> Alt + C </b></td> <td> Attiva / disattiva la casella di controllo "Chiama 1º" </td> </tr> + <tr><td> <b> Alt + D </b></td> <td> Decodifica di nuovo alla frequenza QSO </td> </tr> + <tr><td> <b> Maiusc + D </b></td> <td> Decodifica completa (entrambe le finestre) </td> </tr> + <tr><td> <b> Ctrl + E </b></td> <td> Attiva TX pari / 1 ° </td> </tr> + <tr><td> <b> Maiusc + E </b></td> <td> Disattiva TX pari / 1 ° </td> </tr> + <tr><td> <b> Alt + E </b></td><td>Erase</td> </tr> + <tr><td> <b> Ctrl + F </b></td> <td> Modifica la casella del messaggio di testo libero </td> </tr> + <tr><td> <b> Alt + G </b></td> <td> Genera messaggi standard </td> </tr> + <tr><td> <b> Alt + H </b></td> <td> Interrompi trasmissione </td> </tr> + <tr><td> <b> Ctrl + L </b></td> <td> Cerca il nominativo nel database, genera messaggi standard </td> </tr> + <tr><td> <b> Alt + M </b></td><td>Monitor</td> </tr> + <tr><td> <b> Alt + N </b></td> <td> Abilita Tx </td> </tr> + <tr><td> <b> Ctrl + O </b></td> <td> Apri un file .wav </td> </tr> + <tr><td> <b> Alt + O </b></td> <td> Cambia operatore </td> </tr> + <tr><td> <b> Alt + Q </b></td> <td> Registra QSO </td> </tr> + <tr><td> <b> Ctrl + R </b></td> <td> Imposta messaggio Tx4 su RRR (non in FT4) </td> </tr> + <tr><td> <b> Alt + R </b></td> <td> Imposta messaggio Tx4 su RR73 </td> </tr> + <tr><td> <b> Alt + S </b></td> <td> Interrompi monitoraggio </td> </tr> + <tr><td> <b> Alt + T </b></td> <td> Attiva / disattiva stato di regolazione </td> </tr> + <tr><td> <b> Alt + Z </b></td> <td> Cancella stato decoder bloccato </td> </tr> +</table> + + + VHF features warning + VHF presenta un avviso + + + + Band hopping has no selected frequencies. + + + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: cycle CQ response mode)</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Cycle CQ response mode</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Ctrl+X </b></td><td>Open next file in directory</td></tr> + <tr><td><b>Alt+x </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> + +</table> + + + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Right-click</b> to set Tx frequency.<br/> + <b>Double-right-click</b> to set Rx and Tx frequencies. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> + and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> + Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> + own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">Dial Frequency:</td> + <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> + <b>Right-click</b> to increase frequency by 1 kHz.<br/> + <b>Left-click</b> to decrease frequency by 1 kHz.<br/> + The mouse pointer must be over the Dial Frequency indicator. + </td> + </tr> + <tr> + <td align="right">H Button:</td> + <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to activate or deactivate SuperFox mode. + </td> + </tr> + <tr> + <td align="right">FT8 Button:</td> + <td><b>Click</b> to switch to FT8 Hound Mode.<br/> + <b>Right-click</b> to toggle last used Special Operating Activity On/Off. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> + <tr> + <td align="right">Tx5 Button:</td> + <td><b>Right-click</b> to retain Tx5 free text. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Right-click</b> to freeze the state of the checkbox.<br/> + <b>Right-click on the FT8 Button</b> to unfreeze. + </td> + </tr> + <tr> + <td align="right">Enable Tx Button:</td> + <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> + <b>Right-click</b> to toggle Wait & Pounce On/Off after selecting<br/> + any CQ response mode other than CQ: None. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> + If <b>Alternate Erase button behavior</b> is checked:<br/> + <b>Click</b> to erase Band Activity window.<br/> + <b>Right-click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">DX Call Button:</td> + <td><b>Click</b> to toggle Wait & Call On/Off.<br/> + <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. + </td> + </tr> + <tr> + <td align="right">Lookup Button:</td> + <td><b>Click</b> to search for callsign in database.<br/> + <b>Right-click</b> to search for Dx Call on qrz.com. + </td> + </tr> + <tr> + <td align="right">Add Button:</td> + <td><b>Click</b> to add callsign and locator to database.<br/> + <b>Right-click</b> to search for Dx Call on hamqth.com. + </td> + </tr> + <tr> + <td align="right">Ignore Button:</td> + <td><b>Click</b> to add callsign to the Ignore List.<br/> + <b>Right-click</b> to search for Dx Call on qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Band Buttons:</td> + <td><b>Click</b> to toggle band / mode default frequencies.<br/> + <b>Right-click</b> to toggle FT8 DXpedition frequencies. + </td> + </tr> +</table> + - VHF features warning - VHF presenta un avviso + + Type 1 Prefixes: + + 1A 1S 3A 3B6 3B8 3B9 3C 3C0 3D2 3D2C 3D2R 3DA 3V 3W 3X + 3Y 3YB 3YP 4J 4L 4S 4U1I 4U1U 4W 4X 5A 5B 5H 5N 5R + 5T 5U 5V 5W 5X 5Z 6W 6Y 7O 7P 7Q 7X 8P 8Q 8R + 9A 9G 9H 9J 9K 9L 9M2 9M6 9N 9Q 9U 9V 9X 9Y A2 + A3 A4 A5 A6 A7 A9 AP BS7 BV BV9 BY C2 C3 C5 C6 + C9 CE CE0X CE0Y CE0Z CE9 CM CN CP CT CT3 CU CX CY0 CY9 + D2 D4 D6 DL DU E3 E4 EA EA6 EA8 EA9 EI EK EL EP + ER ES ET EU EX EY EZ F FG FH FJ FK FKC FM FO + FOA FOC FOM FP FR FRG FRJ FRT FT5W FT5X FT5Z FW FY M MD + MI MJ MM MU MW H4 H40 HA HB HB0 HC HC8 HH HI HK + HK0A HK0M HL HM HP HR HS HV HZ I IS IS0 J2 J3 J5 + J6 J7 J8 JA JDM JDO JT JW JX JY K KG4 KH0 KH1 KH2 + KH3 KH4 KH5 KH5K KH6 KH7 KH8 KH9 KL KP1 KP2 KP4 KP5 LA LU + LX LY LZ OA OD OE OH OH0 OJ0 OK OM ON OX OY OZ + P2 P4 PA PJ2 PJ7 PY PY0F PT0S PY0T PZ R1F R1M S0 S2 S5 + S7 S9 SM SP ST SU SV SVA SV5 SV9 T2 T30 T31 T32 T33 + T5 T7 T8 T9 TA TF TG TI TI9 TJ TK TL TN TR TT + TU TY TZ UA UA2 UA9 UK UN UR V2 V3 V4 V5 V6 V7 + V8 VE VK VK0H VK0M VK9C VK9L VK9M VK9N VK9W VK9X VP2E VP2M VP2V VP5 + VP6 VP6D VP8 VP8G VP8H VP8O VP8S VP9 VQ9 VR VU VU4 VU7 XE XF4 + XT XU XW XX9 XZ YA YB YI YJ YK YL YN YO YS YU + YV YV0 Z2 Z3 ZA ZB ZC4 ZD7 ZD8 ZD9 ZF ZK1N ZK1S ZK2 ZK3 + ZL ZL7 ZL8 ZL9 ZP ZS ZS8 KC4 E5 + +Type 1 Suffixes: /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /P + @@ -7018,8 +9176,8 @@ Server UDP%2:%3 Modes - - + + Mode Modo @@ -7027,7 +9185,7 @@ Server UDP%2:%3 MultiSettings - + Default Default @@ -7035,62 +9193,62 @@ Server UDP%2:%3 MultiSettings::impl - + &Switch To &Passa a - + &Clone &Clona - + Clone &Into ... &Clona In ... - + R&eset &Ripristina - + &Rename ... &Rinomina ... - + &Delete &Elimina - + Clone Into Configuration Clona nella Configurazione - + Confirm overwrite of all values for configuration "%1" with values from "%2"? Conferma sovrascrittura di tutti i valori per la configurazione "%1" con i valori da "%2"? - + Reset Configuration Ripristina Configurazione - + Confirm reset to default values for configuration "%1"? Conferma ripristino ai valori predefiniti per la configurazione "%1"? - + Delete Configuration Cancella Configurazione - + Confirm deletion of configuration "%1"? Conferma cancellazione della configurazione "%1"? @@ -7098,17 +9256,17 @@ Server UDP%2:%3 NameDialog - + New Configuration Name Nuovo nome di configurazione - + Old name: Vecchio nome: - + &New name: &Nuovo nome: @@ -7134,12 +9292,12 @@ Server UDP%2:%3 Impossibile avviare il server COM OmniRig - + OmniRig: don't know how to set rig frequency OmniRig: non so come impostare la frequenza del rig - + OmniRig COM/OLE error: %1 at %2: %3 (%4) OmniRig errore COM/OLE: %1 a %2: %3 (%4) @@ -7169,34 +9327,33 @@ Server UDP%2:%3 OOB - + Too many colours in palette. Troppi colori nella tavolozza. - + Error reading waterfall palette file "%1:%2" too many colors. Errore lettura del file della tavolozza del display a cascata "%1:%2" troppi colori. - + Error reading waterfall palette file "%1:%2" invalid triplet. Errore lettura del file della tavolozza del display a cascata "%1:%2" terzina invalida. - + Error reading waterfall palette file "%1:%2" invalid color. Errore lettura del file della tavolozza del display a cascata "%1:%2" colore invalido. - + Error opening waterfall palette file "%1": %2. Errore apertura del file della tavolozza del display a cascata "%1: %2. - Error writing waterfall palette file "%1": %2. - Errore scrittura del file della tavolozza del display a cascata "%1: %2. + Errore scrittura del file della tavolozza del display a cascata "%1: %2. User Defined @@ -7604,7 +9761,7 @@ Messaggio Invia.Messaggio - + MessageCreator Creatore di messaggi @@ -7622,7 +9779,7 @@ Messaggio Cancella - + QSY Monitor MonitorQSY @@ -7763,62 +9920,62 @@ Errore (%2):%3 SoundInput - + An error opening the audio input device has occurred. Si è verificato un errore durante l'apertura del dispositivo di input audio. - + An error occurred during read from the audio input device. Si è verificato un errore durante la lettura dal dispositivo di ingresso audio. - + Non-recoverable error, audio input device not usable at this time. Errore non recuperabile, dispositivo di input audio non utilizzabile in questo momento. - + Requested input audio format is not valid. Il formato audio di input richiesto non è valido. - + Requested input audio format is not supported on device. Il formato audio di input richiesto non è supportato sul dispositivo. - + Failed to initialize audio sink device Impossibile inizializzare il dispositivo sink audio - + Idle Inattivo - + Receiving Ricevente - + Suspended Sospeso - + Interrupted Interrotto - + Error Errore - + Stopped Fermato @@ -7830,90 +9987,114 @@ Errore (%2):%3 SoundOutput - + An error opening the audio output device has occurred. Si è verificato un errore durante l'apertura del dispositivo di uscita audio. - + An error occurred during write to the audio output device. Si è verificato un errore durante la scrittura sul dispositivo di uscita audio. - + Audio data not being fed to the audio output device fast enough. I dati audio non vengono inviati al dispositivo di uscita audio abbastanza velocemente. - + Non-recoverable error, audio output device not usable at this time. Errore non recuperabile, dispositivo di uscita audio non utilizzabile in questo momento. - + Requested output audio format is not valid. Il formato audio di output richiesto non è valido. - + Requested output audio format is not supported on device. Il formato audio di output richiesto non è supportato sul dispositivo. - + + Audio output restart attempt failed. + + + + + No audio output device configured. Nessun dispositivo di uscita audio configurato. - + + No audio output stream is active. + + + + Idle Inattivo - + Sending Invio - + Suspended Sospeso - + Interrupted Interrotto - + Error Errore - + Stopped Fermato + + SplashScreen + + + WSJT-X — Welcome + + + + + WSJT-X startup information. Press Escape to close. + + + StationDialog - + Add Station Aggiungi Stazione - + &Band: &Banda: - + &Offset (MHz): &Offset (MHz): - + &Antenna: &Antenna: @@ -7954,184 +10135,206 @@ Errore (%2):%3 TCITransceiver - + ConnectionRefused Connessione rifiutata - + RemoteHostClosed Host remoto chiuso - + HostNotFound Host non trovato - + SocketAccess Accesso al Socket - + SocketResource Risorsa socket - + SocketTimeout Timeout del socket - + DatagramTooLarge Datagramma troppo grande - + Network Rete - + AddressInUse Indirizzo.In.Uso - + SocketAddressNotAvailable Indirizzo.Socket.Non.Disponibile - + UnsupportedSocketOperation Operazione.Socket.Non.Supportata - + UnfinishedSocketOperation Operazione socket non completata - + ProxyAuthenticationRequired Autenticazione proxy richiesta - + SslHandshakeFailed Handshake SSL non riuscito - + ProxyConnectionRefused Connessione proxy rifiutata - + ProxyConnectionClosed Connessione proxy chiusa - + ProxyConnectionTimeout Timeout.Connessione.proxy - + ProxyNotFound Proxy non trovato - + ProxyProtocol Protocollo.Proxy - + Operation Operazione - + SslInternal Ssl.Interno - + SslInvalidUserData Dati Utente Ssl.non validi - + Temporary Temporaneo - + UnknownSocket Socket.Sconosciuto - + + UnknownSocketError + + + + TCI websocket error: %1 Errore websocket TCI: %1 - + TCI SDR could not be switched on Non è stato possibile accendere TCI SDR - + TCI SDR is not switched on TCI SDR non è acceso - + TCI RX2 could not be enabled Non è stato possibile abilitare TCI RX2 - + TCI Audio could not be switched on Impossibile accendere l'audio TCI - - + + TCI could not be opened TCI non può essere aperto - - + + + + TCI sent an invalid VFO frequency + + + + + TCI failed to set ptt TCI non è riuscito a impostare il PTT - + TCI should use PTT via CAT Il TCI dovrebbe utilizzare PTT tramite CAT - - + + TCI failed set rxfreq TCI non è riuscito a impostare la freq RX - - + + TCI failed set mode TCI non è riuscito a impostare la modalità - + TCI modulator not Idle Modulatore TCI non inattivo + + + TCI source commitment; playout evidence is protocol-send dead reckoning, not DAC confirmation + + + + + TCI WebSocket send progress; no radio DAC or RF playback confirmation + + TransceiverBase @@ -8153,7 +10356,7 @@ Errore (%2):%3 Controlli - + Spectrum gain Guadagno Spettro @@ -8162,220 +10365,229 @@ Errore (%2):%3 Tavolozza - + <html><head/><body><p>Enter definition for a new color palette.</p></body></html> <html><head/><body><p>Inserisci la definizione per una nuova tavolozza di colori.</p></body></html> - + Adjust... Regola... - + Waterfall gain Guadagno Display a cascata - + <html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html> <html><head/><body><p>Imposta la dimensione frazionaria dello spettro in questa finestra.</p></body></html> - + % % - + Spec Spec - + <html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html> <html><head/><body><p>Appiattire la linea di base spettrale per l'intero intervallo visualizzato.</p></body></html> - + Flatten Appiattire - <html><head/><body><p>Compute and save a reference spectrum. (Not yet fully implemented.)</p></body></html> - <html><head/><body><p>Calcola e salva uno spettro di riferimento. (Non ancora completamente implementato.)</p></body></html> + <html><head/><body><p>Calcola e salva uno spettro di riferimento. (Non ancora completamente implementato.)</p></body></html> - + Ref Spec Ref Spec - + Smoothing of Linear Average spectrum Livellamento dello spettro medio lineare - + Smooth Liscio - + Compression factor for frequency scale Fattore di compressione per scala di frequenza - + + <html><head/><body><p>Controls</p></body></html> + + + + Bins/Pixel Bins/Pixel - - + + <html><head/><body><p>Position of time stamp above each interval line</p></body></html> <html><head/><body><p>Posizione del timestamp sopra ogni riga dell'intervallo</p></body></html> - + Time stamp Time stamp - - + + Off Spento - + Left Sinistro - + Right Destro - + Palette Tavolozza - + Select waterfall palette Seleziona Tavolozza Display a cascata - + + <html><head/><body><p>Apply a saved reference spectrum to flatten the received passband. Available after a reference spectrum has been measured. (Not yet fully implemented.)</p></body></html> + + + + <html><head/><body><p>Select data for spectral display</p></body></html> <html><head/><body><p>Seleziona i dati per la visualizzazione spettrale</p></body></html> - + Current Corrente - + Cumulative Cumulativo - + Linear Avg Media lineare - + Reference Riferimento - + Q65_Sync Q65_Sync - + Total power (dB) Potenza totale (dB) - + <html><head/><body><p>Frequency at left edge of waterfall</p></body></html> <html><head/><body><p>Frequenza sul bordo sinistro del display a cascata</p></body></html> - + Hz Hz - + Start Inizio - + Bars Barre - + Freq Freq - + <html><head/><body><p>Decode JT9 only above this frequency</p></body></html> <html><head/><body><p>Decodifica JT9 solo sopra questa frequenza</p></body></html> - + Hz Hz - + Split Split - + Number of FFTs averaged (controls waterfall scrolling rate) Numero medio di FFT (controlla la velocità di scorrimento del display a cascata) - + N Avg N Avg - + Waterfall zero Azzeramento Display a cascata - + Spectrum zero Azzeramento Spettro - + User Defined Definito dall' utente - + Wide Graph Grafico Ampio - - + + Read Palette Leggi Tavolozza @@ -8391,22 +10603,22 @@ Errore (%2):%3 WorkedBefore - + Invalid ADIF field %0: %1 Campo ADIF non valido%0:%1 - + Malformed ADIF field %0: %1 Campo ADIF malformato %0:%1 - + Invalid ADIF header Intestazione ADIF invalida - + Error opening ADIF log file for read: %0 Errore durante l'apertura del file di registro ADIF per la lettura:%0 @@ -8449,7 +10661,7 @@ Errore (%2):%3 &Mia Griglia: - + <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> <html><head/><body><p>Localizzatore Maidenhead, preferibilmente 6 caratteri.</p></body></html> @@ -8464,57 +10676,57 @@ Errore (%2):%3 Griglia Auto - + IARU Region: Regione IARU: - + <html><head/><body><p>Select your IARU region.</p></body></html> <html><head/><body><p>Seleziona la tua regione IARU.</p></body></html> - + Message generation for type 2 compound callsign holders: Generazione di messaggi per titolari di nominativi composti di tipo 2: - + <html><head/><body><p>Type 2 compound callsigns are those with prefixes or suffixes not included in the allowed shortlist (See Help-&gt;Add-on prefixes and suffixes).</p><p>This option determines which generated messages should contain your full type 2 compound call sign rather than your base callsign. It only applies if you have a type 2 compound callsign.</p><p>This option controls the way the messages that are used to answer CQ calls are generated. Generated messages 6 (CQ) and 5 (73) will always contain your full callsign. The JT65 and JT9 protocols allow for some standard messages with your full call at the expense of another piece of information such as the DX call or your locator.</p><p>Choosing message 1 omits the DX callsign which may be an issue when replying to CQ calls. Choosing message 3 also omits the DX callsign and many versions of this and other software will not extract the report. Choosing neither means that your full callsign only goes in your message 5 (73) so your QSO partner may log the wrong callsign.</p><p>None of these options are perfect, message 3 is usually best but be aware your QSO partner may not log the report you send them.</p></body></html> <html><head/><body><p>I nominativi composti di tipo 2 sono quelli con prefissi o suffissi non inclusi nella lista consentita (Vedi Aiuto-&gt; Prefissi e suffissi aggiuntivi).</p><p> Questa opzione determina quali messaggi generati devono contenere la chiamata composta completa di tipo 2 anziché il tuo nominativo di base. Si applica solo se si dispone di un nominativo composto di tipo 2.</p><p> Questa opzione controlla il modo in cui vengono generati i messaggi utilizzati per rispondere alle chiamate CQ. I messaggi generati 6 (CQ) e 5 (73) conterranno sempre il tuo nominativo completo. I protocolli JT65 e JT9 consentono alcuni messaggi standard con il tuo nominativo completo a spese di un'altra informazione come la chiamata DX o il tuo localizzatore. </p><p> La scelta del messaggio 1 omette il nominativo DX che potrebbe essere un problema quando si risponde alle chiamate CQ. La scelta del messaggio 3 omette anche il nominativo DX e molte versioni di questo e di altri software non estrarranno il rapporto. Scegliere nessuno dei due significa che il tuo nominativo completo va inserito solo nel tuo messaggio 5 (73), quindi il tuo partner del QSO potrebbe registrare un nominativo errato.</p><p>Nessuna di queste opzioni è perfetta, il messaggio 3 è in genere il migliore ma fai attenzione al tuo partner di QSO che potrebbe non registrare il rapporto che gli hai inviato.</p></body></html> - + Full call in Tx1 Chiamata completa in Tx1 - + Full call in Tx3 Chiamata completa in Tx3 - + Full call in Tx5 only Chiamata completa solo in Tx5 - + Display Display - + Show outgoing transmitted messages in the Rx frequency window. Mostra i messaggi trasmessi in uscita nella finestra Frequenza Rx. - + &Tx messages to Rx frequency window &Tx messaggi alla finestra della frequenza Rx - + Show if decoded stations are new DXCC entities or worked before. Mostra se le stazioni decodificate sono nuove entità DXCC o sono state lavorate prima. @@ -8523,12 +10735,12 @@ Errore (%2):%3 Mostra &DXCC, griglia e stato lavorato prima - + <html><head/><body><p>Check to have decodes for a new period start at the top of the Band Activity window and not scroll off the top when the window is full.</p><p>This is to aid selecting decodes to double-click while decoding is still in progress. Use the Band Activity vertical scroll bar to reveal decodes past the bottom of the window.</p></body></html> <html><head/><body><p>Verifica che la decodifica di un nuovo periodo inizi nella parte superiore della finestra Attività di banda e non scorra verso l'alto quando la finestra è piena.</p><p>Questo è di aiuto nella selezione di decodifiche da fare doppio clic mentre la decodifica è ancora in corso. Utilizza la barra di scorrimento verticale per rivelare decodifiche oltre la parte inferiore della finestra.</p></body></html> - + Start new period decodes at top Inizia nuovo periodo decodifiche in alto @@ -8537,52 +10749,52 @@ Errore (%2):%3 Mostra il prefisso principale anziché il nome del paese - + Set the font characteristics for the application. Imposta le caratteristiche del carattere per l'applicazione. - + Font... Tipo Carattere... - + Set the font characteristics for the Band Activity and Rx Frequency areas. Imposta le caratteristiche del carattere per le aree Attività banda e Frequenza Rx. - + Decoded Text Font... Carattere del testo decodificato... - + Include a separator line between periods in the band activity window. Includere una linea di separazione tra i periodi nella finestra dell'attività della banda. - + &Blank line between decoding periods &Riga vuota tra i periodi di decodifica - + Show distance to DX station in miles rather than kilometers. Mostra la distanza dalla stazione DX in miglia anziché in chilometri. - + Display dista&nce in miles Visualizza la dista&nza in miglia - + Behavior Comportamento - + Decode after EME delay Decodifica dopo il ritardo EME @@ -8591,79 +10803,77 @@ Errore (%2):%3 Tx watchdog: - + <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> <html><head/><body><p>Numero di minuti prima che le trasmissioni non presidiate vengano interrotte</p></body></html> - + Disabled Disabilitato - + minutes minuti - + Single decode Decodifica singola - <html><head/><body><p>Some rigs are not able to process CAT commands while transmitting. This means that if you are operating in split mode you may have to uncheck this option.</p></body></html> - <html><head/><body><p>Alcuni rig non sono in grado di elaborare i comandi CAT durante la trasmissione. Ciò significa che se stai operando in modalità split potresti dover deselezionare questa opzione. </p></body></html> + <html><head/><body><p>Alcuni rig non sono in grado di elaborare i comandi CAT durante la trasmissione. Ciò significa che se stai operando in modalità split potresti dover deselezionare questa opzione. </p></body></html> - Allow Tx frequency changes while transmitting - Consenti cambi di frequenza Tx durante la trasmissione + Consenti cambi di frequenza Tx durante la trasmissione - + Don't start decoding until the monitor button is clicked. Non iniziare la decodifica fino a quando non si fa clic sul pulsante monitor. - + Mon&itor off at startup Mon&itor spento all'avvio - + <html><head/><body><p>Check this if you wish to automatically return to the last monitored frequency when monitor is enabled, leave it unchecked if you wish to have the current rig frequency maintained.</p></body></html> <html><head/><body><p> Selezionare questa opzione se si desidera tornare automaticamente all'ultima frequenza monitorata quando il monitor è abilitato, lasciarlo deselezionato se si desidera mantenere la frequenza corrente del rig.</p></body></html> - + Monitor returns to last used frequency Il monitor ritorna all'ultima frequenza utilizzata - + Alternate F1-F6 bindings Attacchi F1-F6 alternati - + Turns off automatic transmissions after sending a 73 or any other free text message. Disattiva le trasmissioni automatiche dopo aver inviato un 73 o qualsiasi altro messaggio testuale libero. - + Di&sable Tx after sending 73 Di&sabilita Tx dopo l'invio 73 - + Send a CW ID after every 73 or free text message. Invia un ID CW dopo ogni 73 o messaggio di testo libero. - + CW ID a&fter 73 ID CW d&opo 73 @@ -8672,7 +10882,7 @@ messaggio testuale libero. Inter&vallo ID CW periodico: - + Send a CW ID periodically every few minutes. This might be required under your countries licence regulations. It will not interfere with other users as it is always sent in the @@ -8683,22 +10893,22 @@ Non interferirà con altri utenti in quanto viene sempre inviato in periodo di quiete al termine della decodifica. - + Automatic transmission mode. Modalità di trasmissione automatica. - + Doubl&e-click on call sets Tx enable Far&e doppio clic sul nominativo Abilita il Tx - + Calling CQ forces Call 1st Chiamando CQ forza Call 1º - + <html><head/><body><p>Disable the Tune watchdog.</p></body></html> <html><head/><body><p>Disabilita il watchdog di Accordo.</p></body></html> @@ -8707,17 +10917,17 @@ periodo di quiete al termine della decodifica. Disabilita il watchdog di Accordo - + Alternate Erase button behavior Comportamento alternativo del pulsante Cancella - + Additional features Funzionalità aggiuntive - + Set Rx frequency to Tx frequency after QSO Imposta la frequenza RX uguale alla frequenza TX dopo i QSO @@ -8726,7 +10936,7 @@ periodo di quiete al termine della decodifica. Cancella la finestra Attività di Banda dopo un cambiamento di banda - + Map Grid locator to U.S. State Mappare il locatore della griglia su uno stato USA @@ -8735,27 +10945,27 @@ periodo di quiete al termine della decodifica. Mappare gli stati USA in tutti i messaggi con griglia - + Clear DX Call after QSO Pulire il nominativo DX dopo un QSO - + Show principal prefix instead of country name Mostra il prefisso principale invece del nome del country - + Show &DXCC, grid, and worked-before status Mostra &DXCC, griglia e stato lavorato prima - + MSK144/Q65: Tx until 73 is received MSK144/Q65: Tx fino alla ricezione di 73 - + Clear DX Grid after QSO Pulire la griglia DX dopo un QSO @@ -8764,206 +10974,211 @@ periodo di quiete al termine della decodifica. Disabilita avviso Tx - + Enable Wait features Abilita le funzionalità di attesa - + <html><head/><body><p>If a station sends a valid Maidenhead locator, calculate and show the great-circle azimuth in Band Activity pane.</p></body></html> <html><head/><body><p>Se una stazione invia un localizzatore Maidenhead valido, calcola e mostra l'azimut del cerchio massimo nel riquadro Attività della banda.</p></body></html> - + Show azimuth in messages with grid Mostra l'azimut nei messaggi con griglia - + <html><head/><body><p>Increase or decrease the space between DXCC and distance/azimuth.</p></body></html> <html><head/><body><p>Aumenta o diminuisci lo spazio tra DXCC e distanza/azimut.</p></body></html> - + + Distance and azimuth alignment spacing + + + + Less button coloring (restart required) Meno colorazione dei pulsanti (riavvio richiesto) - + &Radio &Radio - + Radio interface configuration settings. Impostazioni di configurazione dell'interfaccia radio. - + Settings that control your CAT interface. Impostazioni che controllano l'interfaccia CAT. - + CAT Control Controllo CAT - - + + Port: Porta: - + Serial port used for CAT control. Porta seriale utilizzata per il controllo CAT. - - + + Serial Port Parameters Parametri Porta Seriale - + Baud Rate: Baud Rate: - + Serial port data rate which must match the setting of your radio. Velocità dati della porta seriale che deve corrispondere all'impostazione della radio. - + 1200 1200 - + 2400 2400 - + 4800 4800 - + 9600 9600 - + 19200 19200 - + 38400 38400 - + 57600 57600 - + 115200 115200 - + <html><head/><body><p>Number of data bits used to communicate with your radio's CAT interface (usually eight).</p></body></html> <html><head/><body><p>Numero di bit di dati utilizzati per comunicare con l'interfaccia CAT della radio (in genere otto). </p></body></html> - + Data bits Bit di dati - + Data Bits Bit di dati - + D&efault Pred&efinito - + Se&ven Se&tte - + E&ight O&tto - + <html><head/><body><p>Number of stop bits used when communicating with your radio's CAT interface</p><p>(consult you radio's manual for details).</p></body></html> <html><head/><body><p>Numero di bit di stop utilizzati durante la comunicazione con l'interfaccia CAT della radio</p><p>(consultare il manuale della radio per i dettagli).</p></body></html> - + Stop bits Bits di Stop - + Stop Bits Bits di Stop - - + + Default Predefinito - + On&e &Uno - + T&wo &Due - + <html><head/><body><p>Flow control protocol used between this computer and your radio's CAT interface (usually &quot;None&quot; but some require &quot;Hardware&quot;).</p></body></html> <html><head/><body><p>Protocollo di controllo del flusso utilizzato tra questo computer e l'interfaccia CAT della radio (in genere &quot;Nessuno&quot; ma qualcuno richiede &quot;Hardware&quot;).</p></body></html> - - + + Handshake Handshake - + &None &Nessuno - + Software flow control (very rare on CAT interfaces). Controllo del flusso del software (molto raro sulle interfacce CAT). - + XON/XOFF XON/XOFF - + Flow control using the RTS and CTS RS-232 control lines not often used but some radios have it as an option and a few, particularly some Kenwood rigs, require it). @@ -8972,75 +11187,74 @@ non usato spesso ma alcune radio lo hanno come opzione e alcuni, in particolare (alcuni rig Kenwood, lo richiedono). - + &Hardware &Hardware - + Special control of CAT port control lines. Controllo speciale delle linee di controllo della porta CAT. - - + + Force Control Lines Forza Linee di controllo - - + + High Alto - - + + Low Basso - + DTR: DTR: - + RTS: RTS: - How this program activates the PTT on your radio? - In che modo questo programma attiva il PTT sulla radio? + In che modo questo programma attiva il PTT sulla radio? - + PTT Method Metodo PTT - + <html><head/><body><p>No PTT activation, instead the radio's automatic VOX is used to key the transmitter.</p><p>Use this if you have no radio interface hardware.</p></body></html> <html><head/><body><p>Nessuna attivazione PTT, invece viene utilizzato il VOX automatico della radio per attivare il trasmettitore.</p><p>Usalo se non hai hardware di interfaccia radio.</p></body></html> - + VO&X VO&X - + <html><head/><body><p>Use the RS-232 DTR control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The DTR control line of the CAT serial port may be used for this or a DTR control line on a different serial port may be used.</p></body></html> <html><head/><body><p>Utilizzare la linea di controllo DTR RS-232 per attivare / disattivare il PTT della radio, richiede l'hardware per interfacciare la linea.</p><p>Anche alcune unità di interfaccia commerciale utilizzano questo metodo.</p><p>La linea di controllo DTR della porta seriale CAT può essere usata a questo scopo o una linea di controllo DTR su una porta seriale diversa.</p></body></html> - + &DTR &DTR - + Some radios support PTT via CAT commands, use this option if your radio supports it and you have no other hardware interface for PTT. @@ -9049,47 +11263,47 @@ usa questa opzione se la tua radio la supporta e non hai altra interfaccia hardware per PTT. - + C&AT C&AT - + <html><head/><body><p>Use the RS-232 RTS control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The RTS control line of the CAT serial port may be used for this or a RTS control line on a different serial port may be used. Note that this option is not available on the CAT serial port when hardware flow control is used.</p></body></html> <html><head/><body><p>Usa la linea di controllo RS-232 RTS per attivare / disattivare il PTT della tua radio, richiede hardware per interfacciare la linea. </p><p>Anche alcune unità di interfaccia commerciale usano questo metodo.</p><p>La linea di controllo RTS della porta seriale CAT può essere utilizzata per questa o una linea di controllo RTS su una porta seriale diversa. Questa opzione non è disponibile sulla porta seriale CAT quando viene utilizzato il controllo del flusso hardware.</p></body></html> - + R&TS R&TS - + <html><head/><body><p>Select the RS-232 serial port utilised for PTT control, this option is available when DTR or RTS is selected above as a transmit method.</p><p>This port can be the same one as the one used for CAT control.</p><p>For some interface types the special value CAT may be chosen, this is used for non-serial CAT interfaces that can control serial port control lines remotely (OmniRig for example).</p></body></html> <html><head/><body><p>Seleziona la porta seriale RS-232 utilizzata per il controllo PTT, questa opzione è disponibile quando DTR o RTS è selezionato sopra come metodo di trasmissione.</p><p>Questa porta può essere uguale a quello utilizzato per il controllo CAT.</p><p>Per alcuni tipi di interfaccia è possibile scegliere il valore speciale CAT, utilizzato per interfacce CAT non seriali che possono controllare da remoto le linee di controllo della porta seriale ( OmniRig per esempio).</p></body></html> - + Modulation mode selected on radio. Modalità di modulazione selezionata alla radio. - + Mode Modo - + <html><head/><body><p>USB is usually the correct modulation mode,</p><p>unless the radio has a special data or packet mode setting</p><p>for AFSK operation.</p></body></html> <html><head/><body><p>L'USB è di solito la modalità di modulazione corretta,</p><p>a meno che la radio non abbia un'impostazione di dati speciali o modalità pacchetto</p><p>per il funzionamento di AFSK.</p></body></html> - + US&B US&B - + Don't allow the program to set the radio mode (not recommended but use if the wrong mode or bandwidth is selected). @@ -9098,23 +11312,23 @@ or bandwidth is selected). o la larghezza di banda è selezionata). - - + + None Nessuno - + If this is available then it is usually the correct mode for this program. Se questo è disponibile, di solito è la modalità corretta per questo programma. - + Data/P&kt Data/P&kt - + Some radios can select the audio input using a CAT command, this setting allows you to select which audio input will be used (if it is available then generally the Rear/Data option is best). @@ -9123,52 +11337,52 @@ questa impostazione consente di selezionare quale ingresso audio verrà utilizza (se disponibile, in genere l'opzione Posteriore / Dati è la migliore). - + Transmit Audio Source Trasmettere la sorgente audio - + Rear&/Data Rear&/Data - + &Front/Mic &Front/Mic - + Rig: Rig: - + Poll Interval: Intervallo di Interrogazione: - + <html><head/><body><p>Interval to poll rig for status. Longer intervals will mean that changes to the rig will take longer to be detected.</p></body></html> <html><head/><body><p>Intervallo di interrogazione del rig per sapere lo status. Intervalli più lunghi significheranno che le modifiche al rig richiedono più tempo per essere rilevate.</p></body></html> - + s s - + <html><head/><body><p>Attempt to connect to the radio with these settings.</p><p>The button will turn green if the connection is successful or red if there is a problem.</p></body></html> <html><head/><body><p>Tenta di connettersi alla radio con queste impostazioni.</p><p>Il pulsante diventerà verde se la connessione ha esito positivo o rosso in caso di problemi. </p></body></html> - + Test CAT Test CAT - + Attempt to activate the transmitter. Click again to deactivate. Normally no power should be output since there is no audio being generated at this time. @@ -9181,62 +11395,67 @@ Verificare che qualsiasi indicazione Tx sulla radio e / o sulla propria interfaccia radio si comporti come previsto. - + Test PTT Prova-PTT - + Split Operation Operazione in Split - + <html><head/><body><p>Use only VFO A for split operation (the program temporarily changes the QRG of your rig during transmission).</p></body></html> <html><head/><body><p>Usa solo VFO A per operare in split (il programma cambia temporaneamente il QRG del rig durante la trasmissione).</p></body></html> - + Fake It Simula - + <html><head/><body><p>Use VFO A+B for split operation (works with many rigs, but requires the use of both VFOs).</p></body></html> <html><head/><body><p>Usa VFO A+B per operare in split (funziona con molti rig, ma richiede l'uso di entrambi i VFO).</p></body></html> - + Rig Rig - + <html><head/><body><p>Don't use split (not recommended).</p></body></html> <html><head/><body><p>Non usare lo split (non raccommandato).</p></body></html> - + + <html><head/><body><p>Download the latest libhamlib-4.dll file from Hamlib SourceForge snapshots. </p><p>Note: This function is only available on Windows.</p></body></html> + + + + A&udio A&udio - + Audio interface settings Impostazioni dell'interfaccia audio - + Souncard Scheda audio - + Soundcard Scheda audio - + Select the audio CODEC to use for transmitting. If this is your default device for system sounds then ensure that all system sounds are disabled otherwise @@ -9249,32 +11468,89 @@ trasmetterai qualsiasi suono di sistema generato durante periodi di trasmissione. - + + Delete Tx macro + + + + + Deletes the selected Tx macro, or the focused macro if no row is selected. + + + + + Move &Up + + + + + Move Tx macro up + + + + + Moves the selected Tx macro one position earlier in the list. + + + + + Move D&own + + + + + Move Tx macro down + + + + + Moves the selected Tx macro one position later in the list. + + + + + Drag and drop items to rearrange order +Right click for item specific actions +Click, SHIFT+Click and, CTRL+Click to select items + + + + + Saved Tx macro messages + + + + + Saved free-text messages for the main window Tx5 dropdown. Use Move Up and Move Down or drag and drop to reorder messages. + + + + <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> <html><head/><body><p>Immettere il numero di porta del servizio del server UDP a cui WSJT-X deve inviare gli aggiornamenti. Se questo è zero non verrà inviato alcun aggiornamento.</p></body></html> - + Outgoing interfaces: Interfacce di uscita: - + <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> <html><head/><body><p>Quando si inviano aggiornamenti a un indirizzo di gruppo multicast, è necessario specificare a quale interfaccia di rete inviarli. Se l'interfaccia di loop-back è compatibile con il multicast, verrà selezionata almeno quella. </p> <p> Per la maggior parte degli utenti l'interfaccia di loop-back è tutto ciò che è necessario, ciò consentirà a più altre applicazioni sulla stessa macchina di interoperare con WSJT-X. Se le applicazioni in esecuzione su altri host devono ricevere gli aggiornamenti di stato, è necessario utilizzare un'interfaccia di rete adatta. </p> <p> Su alcuni sistemi Linux potrebbe essere necessario abilitare il multicast sull'interfaccia di rete loop-back.</p></body></html> - + <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> <html><head/><body><p>Imposta il numero o gli hop del router che i datagrammi multicast possono effettuare. Quasi tutti dovrebbero impostarlo su 1 per mantenere il traffico multicast in uscita nella sottorete locale.</p></body></html> - + Multicast TTL: Multicast.TTL: - + Highlight also messages with 73 or RR73 Evidenziare anche i messaggi con 73 o RR73 @@ -9283,51 +11559,51 @@ periodi di trasmissione. Mostra informazioni sul country per tutti i messaggi - + Days since last upload Giorni dall'ultimo caricamento - + Select the audio CODEC to use for receiving. Seleziona l'audio CODEC da utilizzare per la ricezione. - + &Input: &Ingresso: - + Select the channel to use for receiving. Seleziona il canale da utilizzare per la ricezione. - - + + Mono Mono - - + + Left Sinistro - - + + Right Destro - - + + Both Entrambi - + Select the audio channel used for transmission. Unless you have multiple radios connected on different channels; then you will usually want to select mono or @@ -9338,425 +11614,493 @@ canali; quindi di solito si desidera selezionare mono o entrambi qui. - + Enable VHF and submode features Abilita le funzioni VHF e sottomodalità - + Highlight DX Grid in message Evidenzia Griglia DX nel messaggio - + Show DXCC for all messages Mostra DXCC per tutti i messaggi - + Show the separator line between periods with time stamp of the decode period. Mostra la linea di separazione tra i periodi con il timestamp del periodo di decodifica. - + Show blank line with time stamp Mostra riga vuota con timestamp - + Highlight DX Call in message Evidenzia Nominativo DX nel messaggio - + <html><head/><body><p>Open the Astronomical Data window automatically when switching to Q65 or JT65 mode and Decode after EME delay is enabled, and close it when no longer needed.</p><p>Open the QSYMessage Creator automatically if the VHF Features are enabled and such QSY messages are applicable.</p></body></html> <html><head/><body><p>Apri automaticamente la finestra Dati astronomici quando si passa alla modalità Q65 o JT65 e quando è abilitato il ritardo Decodifica dopo EME, e chiudila quando non è più necessaria.</p><p>Apri automaticamente il Creatore di messaggi QSY se le funzionalità VHF sono abilitate e tali messaggi QSY sono applicabili.</p></body></html> - + Auto-open/close Astronomical data window Apertura/chiusura automatica della finestra dei dati astronomici - + <html><head/><body><p>Tx until 73 is received when in MSK144 or Q65 mode. </p></body></html> <html><head/><body><p>Trasmettere fino alla ricezione di 73 in modalità MSK144 o Q65.</p></body></html> - + <html><head/><body><p>Allow kHz frequency offset entry without 'k' suffix.</p></body></html> <html><head/><body><p>Consenti l'inserimento dell'offset di frequenza kHz senza il suffisso 'k'.</p></body></html> - + kHz entry without k (restart required) ingresso kHz senza k (riavvio richiesto) - + + <html><head/><body><p>Allow automatic Doppler tracking and split/Fake It/XIT to correct the transmit frequency while transmitting, including corrections of tens of kHz on microwave bands.</p><p>This option does not allow nominal dial or band changes while transmitting or tuning. Leave it unchecked if your rig cannot accept frequency-setting CAT commands while transmitting; WSJT-X will then make one midpoint Doppler correction before transmission starts.</p></body></html> + + + + + Allow Tx-frequency corrections while transmitting + + + + Tune watchdog Regola il watchdog - + <html><head/><body><p>Number of seconds before Tune is aborted</p></body></html> <html><head/><body><p>Numero di secondi prima che Tune venga interrotto</p></body></html> - + + Tune watchdog timeout + + + + seconds secondi - + Tx watchdog: Tx watchdog: - + + Tx watchdog timeout + + + + ID Inter&val: Inter&vallo ID: - + + CW ID interval + + + + <html><head/><body><p>Turn the progress bar red while transmitting.</p></body></html> <html><head/><body><p>Rendi rossa la barra di avanzamento durante la trasmissione.</p></body></html> - + Turn progress bar red while transmitting Rendere rossa la barra di avanzamento durante la trasmissione - + <html><head/><body><p>If a station sends locator, calculate and show the distance in Band Activity pane.</p></body></html> <html><head/><body><p>Se una stazione invia un localizzatore, calcola e mostra la distanza nel riquadro Attività banda.</p></body></html> - + Show distance in messages with grid Mostra la distanza nei messaggi con la griglia - + <html><head/><body><p>Erase Band Activity and Rx frequency windows after band change.</p></body></html> <html><head/><body><p>Cancella le finestre di attività della banda e frequenza Rx dopo il cambio di banda.</p></body></html> - + Erase decodes after band change Cancella le decodificazioni dopo il cambio di banda - + Show U.S. States in messages with grid Mostra gli stati degli Stati Uniti nei messaggi con griglia - + <html><head/><body><p>Align the text for DXCC, distance and azimuth.</p></body></html> <html><head/><body><p>Allinea il testo per DXCC, distanza e azimut.</p></body></html> - + Align DXCC/distance/azimuth Allinea DXCC/distanza/azimut - + <html><head/><body><p>Increase or decrease the space between message text and DXCC.</p></body></html> <html><head/><body><p>Aumenta o diminuisci lo spazio tra il testo del messaggio e DXCC.</p></body></html> - - + + DXCC alignment spacing + + + + + Update Hamlib Aggiorna Hamlib - + 32-bit 32-bit - + <html><head/><body><p>Revert the last Hamlib update. </p><p>Note: This function is only available on Windows.</p></body></html> <html><head/><body><p>Ripristina l'ultimo aggiornamento di Hamlib. </p><p>Nota: questa funzione è disponibile solo su Windows.</p></body></html> - + Revert Update Ripristina aggiornamento - <html><head/><body><p>Download the latest libhamlib-4.dll file from https://n0nb.users.sourceforge.net/. </p><p>Note: This function is only available on Windows.</p></body></html> - <html><head/><body><p>Scarica l'ultimo file libhamlib-4.dll da https://n0nb.users.sourceforge.net/. </p><p>Nota: questa funzione è disponibile solo su Windows.</p></body></html> + <html><head/><body><p>Scarica l'ultimo file libhamlib-4.dll da https://n0nb.users.sourceforge.net/. </p><p>Nota: questa funzione è disponibile solo su Windows.</p></body></html> - + In use: In uso: - + Backed up: Backup eseguito: - + 64-bit 64-bit - + Rig Data Dati del RIG - + <html><head/><body><p>Stop transmitting immediately when SWR exceeds 2.5.</p></body></html> <html><head/><body><p>Interrompere immediatamente la trasmissione quando l'SWR supera 2,5.</p></body></html> - + Halt Tx when SWR > 2.5 Interrompere la trasmissione quando SWR > 2,5 - + <html><head/><body><p>Read and display transmit PWR and SWR of your rig.</p></body></html> <html><head/><body><p>Leggi e visualizza la potenza di trasmissione e l'SWR del tuo RTX.</p></body></html> - + Read and display PWR and SWR Leggere e visualizzare PWR e SWR - + Ou&tput: Usci&ta: - + + Output audio channel + + + + + Input audio channel + + + + <html><head/><body><p>Refresh audio device list.</p></body></html> <html><head/><body><p>Aggiorna l'elenco dei dispositivi audio.</p></body></html> - + Refresh Ricaricare - + <html><head/><body><p>Use TCI Audio when available.</p></body></html> <html><head/><body><p>Usa TCI Audio quando disponibile.</p></body></html> - + Use TCI Audio (restart required) Utilizzare TCI Audio (riavvio richiesto) - + <html><head/><body><p>Rx audio level</p></body></html> <html><head/><body><p>Livello audio Rx</p></body></html> - + + TCI receive audio level + + + + Rx Rx - + <html><head/><body><p>Sort audio device names alphabetically.</p></body></html> <html><head/><body><p>Ordina alfabeticamente i nomi dei dispositivi audio.</p></body></html> - + Sort alphabetically Ordina alfabeticamente - + <html><head/><body><p>Hide the usually unusable ALSA CARD subdevices on Linux.</p></body></html> <html><head/><body><p>Nascondi i sottodispositivi ALSA CARD solitamente inutilizzabili su Linux.</p></body></html> - + Hide ALSA CARD subdevices (Linux only) Nascondi i sottodispositivi ALSA CARD (solo Linux) - - + + Save Directory Salva directory - + Loc&ation: &Posizione: - + Path to which .WAV files are saved. Percorso in cui vengono salvati i file .WAV. - - + + TextLabel Etichetta di testo - + Click to select a different save directory for .WAV files. Fare clic per selezionare una directory di salvataggio diversa per i file .WAV. - + S&elect S&eleziona - - + + AzEl Directory AzEl Directory - + Location: Posizione: - + Select Seleziona - + <html><head/><body><p>Enables additional line in azel.dat for Dpol parameter.</p></body></html> <html><head/><body><p>Abilita una riga aggiuntiva in azel.dat per il parametro Dpol.</p></body></html> - + Enable extra line in azel.dat Abilita riga extra in azel.dat - + Power Memory By Band Memoria di Potenza per banda - + Remember power settings by band Ricorda le impostazioni di potenza per banda - + Enable power memory during transmit Abilita la memoria di potenza durante la trasmissione - + Transmit Trasmetti - + Enable power memory during tuning Abilita la memoria di potenza durante la sintonia - + Tune Accorda - + Tx &Macros Tx &Macros - + Canned free text messages setup Impostazione dei messaggi di testo libero - + + New &macro: + + + + &Add &Aggiungi - + + Add Tx macro + + + + + Adds the entered message to the saved Tx macro list. + + + + + New Tx macro message + + + + + Enter a saved free-text message for the Tx5 dropdown. Free-text messages are limited to 13 characters including spaces. + + + + &Delete &Elimina - Drag and drop items to rearrange order Right click for item specific actions Click, SHIFT+Click and, CRTL+Click to select items - Trascina e rilascia elementi per riorganizzare l'ordine + Trascina e rilascia elementi per riorganizzare l'ordine Fare clic con il tasto destro per azioni specifiche dell'oggetto Fare clic, MAIUSC + clic e, CRTL + clic per selezionare gli elementi - + Reportin&g &Segnalazione - + Reporting and logging settings Impostazioni di report e registrazione - + Logging Registrazione - + <html><head/><body><p>Check this option to note any Special Operating Activity in the comments field.</p></body></html> <html><head/><body><p>Seleziona questa opzione per annotare qualsiasi attività operativa speciale nel campo commenti.</p></body></html> - + Special operating activity to comments Attività operativa speciale ai commenti - + The program will pop up a partially completed Log QSO dialog when you send a 73 or free text message. Il programma aprirà una finestra di dialogo Log QSO parzialmente completata quando si invia un messaggio di testo libero o 73. - + Promp&t me to log QSO Avvisami di regis&trare il QSO - + <html><head/><body><p>Log 'ZZ00' as grid if the other station doesn't send you a grid.</p></body></html> <html><head/><body><p>Registra 'ZZ00' come griglia se l'altra stazione non ti invia una griglia.</p></body></html> - + Fill missing grids with 'ZZ00' Riempi le griglie mancanti con 'ZZ00' - + Op Call: Nominativo Op: - + Some logging programs will not accept the type of reports saved by this program. Check this option to save the sent and received reports in the @@ -9768,7 +12112,7 @@ Seleziona questa opzione per salvare i rapporti inviati e ricevuti nel campo commenti. - + d&B reports to comments Riporta d&B nei commenti @@ -9784,23 +12128,23 @@ e i campi della Griglia DX quando viene inviato un messaggio di testo libero o 7 Cancella chiamata &DX e la griglia dopo la registrazione - + <html><head/><body><p>Some logging programs will not accept WSJT-X mode names.</p></body></html> (Registrazione=Log) <html><head/><body><p>Alcuni programmi di registrazione non accettano i nomi della modalità WSJT-X.</p></body></html> - + Con&vert mode to RTTY Con&vertire la modalità in RTTY - + <html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html> <html><head/><body><p>Il nominativo dell'operatore, se diverso dal nominativo della stazione.</p></body></html> - + <html><head/><body><p>Check to have QSOs logged automatically, when complete.</p></body></html> <html><head/><body><p>Selezionare per registrare i QSO automaticamente, quando completi.</p></body></html> @@ -9810,209 +12154,232 @@ e i campi della Griglia DX quando viene inviato un messaggio di testo libero o 7 Registra automaticamente (solo in contest) - + Network Services Servizi di rete - + <html><head/><body><p>The program can send your station details and all decoded signals with grid squares as spots to the http://pskreporter.info web site.</p><p>This is used for reverse beacon analysis which is very useful for assessing propagation and system performance.</p></body></html> <html><head/><body> <p> Il programma può inviare i dettagli della stazione e tutti i segnali decodificati con quadrati della griglia come punti al sito web http://pskreporter.info. </p> <p> Questo è utilizzato per l'analisi del beacon inverso che è molto utile per valutare la propagazione e le prestazioni del sistema. </p> </body> </html> - + Enable &PSK Reporter Spotting Abilita rilevamento &PSK Reporter - + <html><head/><body><p>Check this option if a reliable connection is needed</p><p>Most users do not need this, the default uses UDP which is more efficient. Only check this if you have evidence that UDP traffic from you to PSK Reporter is being lost.</p></body></html> <html><head/><body> <p> Seleziona questa opzione se è necessaria una connessione affidabile </p> <p> La maggior parte degli utenti non ne ha bisogno, l'impostazione predefinita utilizza UDP che è più efficiente. Seleziona questa opzione solo se hai prove che il traffico UDP da te a PSK Reporter viene perso. </p> </body> </html> - + Use TCP/IP connection Usa la connessione TCP/IP - + UDP Server UDP Server - + UDP Server: UDP Server: - + <html><head/><body><p>Optional hostname of network service to receive decodes.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the broadcasting of UDP status updates.</p></body></html> <html><head/><body><p>Nome host facoltativo del servizio di rete per ricevere decodifiche.</p><p>Formati:</p><ul style="margin-top: 0px; margin-bottom: 0px; margine-sinistra: 0px; margine-destra: 0px; -qt-list-indent: 1;"><li style="margin-top: 12px; margin-bottom: 0px; margin-left: 0px; margin- right: 0px; -qt-block-indent: 0; text-indent: 0px;">hostname</li><li style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin -right: 0px; -qt-block-indent: 0; text-indent: 0px;">Indirizzo IPv4</li><li style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px ; margin-right: 0px; -qt-block-indent: 0; text-indent: 0px;">Indirizzo IPv6</li><li style="margin-top: 0px; margin-bottom: 0px; margin-left : 0px; margine-destra: 0px; -qt-block-indent: 0; text-indent: 0px;">Indirizzo gruppo multicast IPv4</li><li style="margin-top: 0px; margin-bottom: 0px ; margin-left: 0px; margin-right: 0px; -qt-block-indent: 0; text-indent: 0px;">Indirizzo gruppo multicast IPv6</li></ul><p>Deselezionando questo campo si disabilita la trasmissione di aggiornamenti di stato UDP.</p></Body></html> - + UDP Server port number: Porta del Server UDP: - + <html><head/><body><p>With this enabled WSJT-X will accept certain requests back from a UDP server that receives decode messages.</p></body></html> <html><head/><body><p>Con questo abilitato WSJT-X accetterà alcune richieste di ritorno da un server UDP che riceve messaggi di decodifica.</p></body></html> - + Accept UDP requests Accetta richieste UDP - + <html><head/><body><p>Indicate acceptance of an incoming UDP request. The effect of this option varies depending on the operating system and window manager, its intent is to notify the acceptance of an incoming UDP request even if this application is minimized or hidden.</p></body></html> <html><head/><body><p>Indica l'accettazione di una richiesta UDP in arrivo. L'effetto di questa opzione varia a seconda del sistema operativo e del gestore delle finestre, il suo intento è di notificare l'accettazione di una richiesta UDP in arrivo anche se questa applicazione è ridotta a icona o nascosta.</p></body></html> - + Notify on accepted UDP request Notifica su richiesta UDP accettata - + <html><head/><body><p>Restore the window from minimized if an UDP request is accepted.</p></body></html> <html><head/><body><p>Ripristina la finestra da minimizzata se viene accettata una richiesta UDP.</p></body></html> - + Accepted UDP request restores window Richieste UDP accettate ripristinano la finestra - + Secondary UDP Server (deprecated) Server UDP Secondario (obsoleto) - + <html><head/><body><p>When checked, WSJT-X will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html> <html><head/><body><p>Se selezionato, WSJT-X trasmetterà un contatto registrato in formato ADIF al nome host e alla porta configurati.</p></body></html> - + Enable logged contact ADIF broadcast Abilita trasmissione ADIF del contatto registrato - + Server name or IP address: Nome server o indirizzo IP: - + <html><head/><body><p>Optional host name of N1MM Logger+ program to receive ADIF UDP broadcasts. This is usually 'localhost' or ip address 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable broadcasting of ADIF information via UDP.</p></body></html> <html><head/><body><p>Nome host facoltativo del programma Logger + N1MM per ricevere trasmissioni UDP ADIF. Di solito si tratta di "localhost" o indirizzo IP 127.0.0.1</p><p>Formati:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Indirizzo IPv4</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Indirizzo IPv6</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Indirizzo di gruppo multicast IPv4</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Indirizzo di gruppo multicast IPv6</li></ul><p>La cancellazione di questo campo disabiliterà la trasmissione di informazioni ADIF tramite UDP.</p></body></html> - + Server port number: Numero porta Server: - + <html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html> <html><head/><body><p>Immettere il numero di porta che WSJT-X deve utilizzare per le trasmissioni UDP delle informazioni del registro ADIF. Per N1MM Logger +, questo valore dovrebbe essere 2333. Se questo è zero, non verrà trasmesso alcun aggiornamento.</p></body></html> - + Frequencies Frequenze - + Default frequencies and band specific station details setup Frequenze predefinite e impostazione specifiche dei dettagli della stazione per banda - + <html><head/><body><p>See &quot;Frequency Calibration&quot; in the WSJT-X User Guide for details of how to determine these parameters for your radio.</p></body></html> <html><head/><body><p>Vedere &quot;Calibrazione di Frequenza&quot;nella Guida dell'utente WSJT-X per i dettagli su come determinare questi parametri per la radio.</p></body></html> - + Frequency Calibration Calibrazione di Frequenza - + Slope: Inclinazione: - + ppm ppm - + Intercept: Intercetta: - + Hz Hz - + Working Frequencies Frequenze di Lavoro - + + + Insert, delete, load, save, merge, or reset working frequencies. + + + + + Working frequencies actions + + + + + + + Actions... + + + + <html><head/><body><p>Right click to maintain the working frequencies list.</p></body></html> <html><head/><body><p>Fare clic con il tasto destro per mantenere l'elenco delle frequenze di lavoro.</p></body></html> - + Station Information Informazioni Stazione - + + + Insert or delete station information rows. + + + + + Station information actions + + + + Items may be edited. Right click for insert and delete options. Gli articoli possono essere modificati. Fare clic con il tasto destro per inserire ed eliminare le opzioni. - + Colors Colori - + Decode Highlightling Evidenziazione Decodifica - Reset Highlighting to WSJT-X default - Ripristina l'evidenziazione al valore predefinito WSJT-X - - - - Reset Highlighting to WSJT-X Improved default - Ripristina l'evidenziazione predefinita su WSJT-X migliorato + Ripristina l'evidenziazione al valore predefinito WSJT-X - + <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> <html><head/><body><p>Fare clic per scansionare nuovamente il file ADIF wsjtx_log.adi alla ricerca di informazioni se collegato prima</p></body></html> - + Rescan ADIF Log Eseguire nuovamente la scansione del registro ADIF - + <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> <html><head/><body><p>Premere per ripristinare tutti gli elementi evidenziati sopra ai valori e alle priorità predefiniti.</p></body></html> @@ -10021,434 +12388,543 @@ Fare clic con il tasto destro per inserire ed eliminare le opzioni.Ripristina l'evidenziazione - + <html><head/><body><p>Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.</p><p>Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.</p></body></html> <html><head/><body><p>Abilitare o disabilitare utilizzando le caselle di controllo e fare clic con il pulsante destro del mouse su un elemento per modificare o annullare il colore di primo piano, il colore di sfondo o ripristinare l'elemento sui valori predefiniti. Trascina e rilascia gli elementi per cambiarne la priorità, più in alto nell'elenco ha una priorità più alta.</p><p>Nota che ogni colore di primo piano o di sfondo può essere impostato o non impostato, non impostato significa che non è assegnato per quello di quell'elemento possono essere applicati articoli di tipo e priorità inferiore.</p></body></html> - + <html><head/><body><p>Check to indicate new DXCC entities, grid squares, and callsigns per mode.</p></body></html> <html><head/><body><p>Selezionare per indicare nuove entità DXCC, quadrati della griglia e nominativi per modalità.</p></body></html> - + Highlight by Mode Evidenzia per modalità - + Include extra WAE entities Includi entità WAE extra - + Check to for grid highlighting to only apply to unworked grid fields Selezionare per applicare l'evidenziazione della griglia solo ai campi della griglia non lavorati - + Only grid Fields sought Solo Campi griglia ricercati - + <html><head/><body><p>Controls for Logbook of the World user lookup.</p></body></html> <html><head/><body><p>Controlli per la ricerca degli utenti di Logbook of the World.</p></body></html> - + Logbook of the World User Validation Convalida dell'utente Logbook of the World - + Users CSV file URL: URL del file CSV degli utenti: - + <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> <html><head/><body><p>URL del file di dati e date dell'ultimo caricamento dell'utente ARRL LotW utilizzato per evidenziare i decodificatori dalle stazioni note per caricare il loro file di registro su LotW.</p></body></html> - URL - URL + URL https://lotw.arrl.org/lotw-user-activity.csv https://lotw.arrl.org/lotw-user-activity.csv - + <html><head/><body><p>Push this button to fetch the latest LotW user's upload date and time data file.</p></body></html> <html><head/><body><p>Premere questo pulsante per recuperare l'ultimo file di dati di data e ora di caricamento dell'utente LotW.</p></body></html> - + Fetch Now Scarica ora - + Age of last upload less than: Periodo dell'ultimo caricamento inferiore a: - + <html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html> <html><head/><body><p>Regola questa casella di selezione per impostare la soglia del periodo dell'ultima data di caricamento dell'utente di LotW accettata come utente corrente di LotW.</p></body></html> - + Log automatically Registra automaticamente - + <html><head/><body><p>Use 'Log automatically' only for special operating activities.</p></body></html> <html><head/><body><p>Utilizzare 'Registra automaticamente' solo per attività operative speciali.</p></body></html> - + Contesting only Solo in Contest - + <html><head/><body><p>Shorten 6-digit grid entries and log 4-digit grids instead.</p></body></html> <html><head/><body><p>Accorcia le voci della griglia a 6 cifre e registra invece le griglie a 4 cifre.</p></body></html> - + Log 4-digit grids Registra griglie a 4 cifre - - <html><head/><body><p>Highlight callsigns or grids with orange background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - <html><head/><body><p>Evidenzia i nominativi o le griglie con uno sfondo arancione. I nominativi e/o le griglie devono essere separati da una virgola e deve esserci una virgola dopo ogni nominativo.</p></body></html> + <html><head/><body><p>Evidenzia i nominativi o le griglie con uno sfondo arancione. I nominativi e/o le griglie devono essere separati da una virgola e deve esserci una virgola dopo ogni nominativo.</p></body></html> - + Highlight orange: Evidenzia in arancione: - - <html><head/><body><p>Highlight callsigns or grids with blue background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - <html><head/><body><p>Evidenzia i nominativi o le griglie con uno sfondo blu. I nominativi e/o le griglie devono essere separati da una virgola e deve esserci una virgola dopo ogni nominativo.</p></body></html> + <html><head/><body><p>Evidenzia i nominativi o le griglie con uno sfondo blu. I nominativi e/o le griglie devono essere separati da una virgola e deve esserci una virgola dopo ogni nominativo.</p></body></html> - + Highlight blue: Evidenzia in blu: - + + LotW users CSV URL + + + + http://lotw.arrl.org/lotw-user-activity.csv http://lotw.arrl.org/lotw-user-activity.csv - + days giorni - + CTY File Download Scarica il file CTY - + CTY File Version: Versione del file CTY: - + Download Latest CTY.dat Scarica l'ultimo CTY.dat - + CALL3 File Download Scarica il file CALL3 - + CALL3 File Version: Versione del file CALL3: - + Dowload latest CALL3.TXT file. Scarica l'ultimo file CALL3.TXT. - + Download CALL3.TXT for terrestrial use Scarica CALL3.TXT per uso terrestre - + Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. Scarica l'ultimo file CALL3.TXT per EME. Questa versione è compatibile con JT65 Deep Search. - + Download CALL3.TXT for EME Scarica CALL3.TXT per EME - + Advanced Avanzate - + + + <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> + + + + + Cloudlog or Wavelog + + + + + + Upload QSOs to Cloudlog or Wavelog + + + + + + <html><head/><body><p>API URL for Cloudlog or Wavelog.</p></body></html> + + + + + + <html><head/><body><p>Your API key.</p></body></html> + + + + + + <html><head/><body><p>Your Cloudlog or Wavelog station profile.</p></body></html> + + + + + Station profile: + + + + + <html><head/><body><p>Check the Cloudlog or Wavelog connection, API key, station profile, and upload path where safe.</p><p>The button will turn green if the connection can upload QSOs, orange if the key is valid but read-only, and red if the configuration is unusable.</p></body></html> + + + + + Check Connection + + + + + 2x tone spacing + + + + + 4x tone spacing + + + + <html><head/><body><p>User-selectable parameters for JT65 VHF/UHF/Microwave decoding.</p></body></html> <html><head/><body><p>Parametri selezionabili dall'utente per la decodifica JT65 VHF/UHF/Microonde.</p></body></html> - + JT65 VHF/UHF/Microwave decoding parameters JT65 Parametri di decodifica VHF/UHF/Microonde - + Random erasure patterns: Schemi di cancellazione casuali: - + <html><head/><body><p>Maximum number of erasure patterns for stochastic soft-decision Reed Solomon decoder is 10^(n/2).</p></body></html> <html><head/><body><p>Il numero massimo di schemi di cancellazione per il decodificatore stocastico Reed Solomon a decisione morbida è 10^(n/2)</p></body></html> - + Aggressive decoding level: Livello di decodifica aggressivo: - + <html><head/><body><p>Higher levels will increase the probability of decoding, but will also increase probability of a false decode.</p></body></html> <html><head/><body><p>Livelli più alti aumenteranno la probabilità di decodifica, ma aumenteranno anche la probabilità di una decodifica falsa.</p></body></html> - + Two-pass decoding Decodifica a due passaggi - + + + <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> + + + + + eQSL.cc + + + + + + Upload QSOs to eQSL.cc + + + + + + <html><head/><body><p>Your username.</p></body></html> + + + + + Username: + + + + + + <html><head/><body><p>Your logon password.</p></body></html> + + + + + Password: + + + + + + <html><head/><body><p>Your QTH nickname, if you have more than one QTH.</p></body></html> + + + + + QTH: + + + + GUI tweaks for high-resolution monitors Modifiche all'interfaccia utente grafica per monitor ad alta risoluzione - + <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> <html><head/><body><p>Il ridimensionamento HighDPI consente una visualizzazione più ampia e proporzionalmente più corretta dei controlli sui monitor 4K (se supportati dal sistema operativo).</p></body></html> - + HighDPI scaling (restart required) Elevato ridimensionamento DPI (riavvio richiesto) - + <html><head/><body><p>Increased height of some control elements.</p></body></html> <html><head/><body><p>Altezza aumentata di alcuni elementi di controllo.</p></body></html> - + Increased height of the tab widget (restart required) <html><head/><body><p>Altezza aumentata di alcuni elementi di controllo.</p></body></html> - <html><head/><body><p>Test the Cloudlog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> - <html><head/><body><p>Prova la chiave API di Cloudlog.</p><p>Il pulsante diventerà verde se la chiave API è scrivibile. Diventerà arancione se la chiave API è di sola lettura. Se la chiave API non è valida, diventerà rosso.</p></body></html> + <html><head/><body><p>Prova la chiave API di Cloudlog.</p><p>Il pulsante diventerà verde se la chiave API è scrivibile. Diventerà arancione se la chiave API è di sola lettura. Se la chiave API non è valida, diventerà rosso.</p></body></html> - + <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> <html><head/><body><p>Attiva/disattiva il protocollo di messaggistica breve NCCC Sprint FT4.</p></body></html> - + NCCC Sprint NCCC Sprint - + <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> (Hound=Cane da caccia) <html><head/><body><p>FT8 DXpedition mode: l' operatore Hound chiama la stazione DX (Fox)</p></body></html> - - + + Hound Hound (Cane da caccia) - + <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> <html><head/><body><p>Seleziona questa casella per trasmettere (Fox) o ricevere (Hound) la forma d'onda SuperFox.</p></body></html> - + SuperFox mode Modalità.Super.Fox - + <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> <html><head/><body><p>Mostra i messaggi OTP nella finestra Attività della banda.</p></body></html> - + Show OTP messages Mostra messaggi OTP - + OTP URL: URL OTP: - + <html><head/><body><p>URL used to verify OTP codes.</p></body></html> <html><head/><body><p>URL utilizzato per verificare i codici OTP.</p></body></html> - + https://www.9dx.cc https://www.9dx.cc - + <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> <html><head/><body><p>Contests Nordamericani VHF/UHF/Microonde e altri in cui un localizzatore di griglia a 4 caratteri è lo scambio richiesto.</p></body></html> - + NA VHF Contest NA VHF Contest - + <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> <html><head/><body><p>Modalità FT8 DXpedition: operatore Fox (DXpedition).</p></body></html> - - + + Fox (Fox=Volpe) Fox - + <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> <html><head/><body><p>Contest VHF + Europei che richiedono un rapporto segnale, numero di serie e localizzatore a 6 caratteri.</p></body></html> - - + + EU VHF Contest EU VHF Contest - R T T Y Roundup R T T Y Riunione - R T T Y Roundup + R T T Y Roundup - RTTY Roundup exchange - Scambio di riunione in RTTY + Scambio di riunione in RTTY - + NJ NJ - - + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> <html><head/><body><p>Scambio di Field Day ARRL: numero di trasmettitori, classe e sezione ARRL / RAC o&quot;DX&quot;.</p></body></html> - + Special operating activity Attività operativa speciale - + NA VHF NA VHF - + + FT Roundup messages Messaggi Riunione FT - A R R L Field Day - A R R L Field Day + A R R L Field Day - + + ARRL Field Day ARRL Field Day - + + Field Day exchange Scambio Field Day - + FD Exch: Scambio FD: - + 6A SNJ 6A SNJ - + <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> <html><head/><body><p>Chiamata CQ con il nome specifico del contest invece di TEST, RU o WW (per esempio CQ PACC).</p></body></html> - + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> <html><head/><body><p>Contest Digi-Mode mondiale</p><p><br/></p></body></html> - WW Digital Contest Contest Digitale WW - WW Digital Contest + WW Digital Contest - + + WW Digi Contest WW Digi Contest - - + + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> <html><head/><body><p>Riunione FT e concorsi simili. Lo scambio è lo stato degli Stati Uniti, la provincia Canadese o &quot;DX&quot;.</p></body></html> @@ -10457,7 +12933,7 @@ Fare clic con il tasto destro per inserire ed eliminare le opzioni.Riunione FT - + FT RU Exch: Scambio FT RU: @@ -10466,156 +12942,244 @@ Fare clic con il tasto destro per inserire ed eliminare le opzioni.<html><head/><body><p>Riunione FT concorsi simili. Lo scambio è lo stato degli Stati Uniti, la provincia canadese o &quot;DX&quot;.</p></body></html> - + <html><head/><body><p>ARRL International Digital Contest</p></body></html> <html><head/><body><p>Concorso digitale internazionale ARRL</p></body></html> - + ARRL Digi Contest Concorso Digi ARRL - + Miscellaneous Miscellanea - + Degrade S/N of .wav file: Degrado S/N del file .wav: - - + + For offline sensitivity tests Per test di sensibilità offline - - + + dB dB - + <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> <html><head/><body><p>Clicca per abilitare il metodo OTP di verifica Fox. Richiede Internet.</p></body></html> - + OTP OTP - + Key: Key: - + <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> <html><head/><body><p>Chiave Fox per generare codici OTP.</p></body></html> - + M2ZUU5CW6EVOY2HU M2ZUU5CW6EVOY2HU - + Interval Intervallo - + <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> <html><head/><body><p>Intervallo di invio dei messaggi OTP. Selezionare 1 per firmare ogni messaggio.</p></body></html> - + <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> <html><head/><body><p>Scambia il localizzatore a 4 caratteri invece del rapporto del segnale. Fornisce all'operatore DX una sensibilità di livello q3. Particolarmente utile per le spedizioni DX EME in 6 metri.</p></body></html> - + Q65 Pileup Q65 Pileup - + Receiver bandwidth: Larghezza di banda ricevitore: - + + Change or reset colors for the selected highlighting rule. + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move Up + + + + + Move the selected highlighting rule later in priority order. + + + + + Move Down + + + + + Reset Highlighting to Default 1 + + + + + Reset Highlighting to Default 2 + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with orange background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with blue background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + Hz Hz - + Tx delay: Ritardo Tx: - + Minimum delay between assertion of PTT and start of Tx audio. Ritardo minimo tra l'asserzione del PTT e l'avvio dell'audio Tx. - + s s - - + + Tone spacing Spaziatura dei toni - + <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> <html><head/><body><p>Genera audio Tx con una spaziatura del doppio del tono normale. Destinato a trasmettitori speciali LF / MF che utilizzano un divisore per 2 prima di generare RF.</p></body></html> - + x 2 x 2 - + <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> <html><head/><body><p>Genera audio Tx con una spaziatura dei toni quattro volte superiore. Destinato a trasmettitori speciali LF / MF che utilizzano un divisore per 4 prima di generare RF.</p></body></html> - + x 4 x 4 - - + + Waterfall spectra Spettro Display a cascata - + Low sidelobes Lobi laterali bassi - + Most sensitive Più sensibile - + + + Enable special operating activity + + + + + Enable OTP verification + + + + + + OTP key + + + + + + OTP interval + + + + + + OTP URL + + + + + + FT Roundup exchange + + + + CQ with individual contest name CQ con nome specifico del contest - + + + Contest name + + + + Contest name: Nome del contest: @@ -10624,36 +13188,33 @@ Fare clic con il tasto destro per inserire ed eliminare le opzioni.PACC - Enable Cloudlog Features - Abilita le funzionalità di Cloudlog + Abilita le funzionalità di Cloudlog - + API URL: URL API: - + API Key: Chiave API: - Station ID: - ID statione: + ID statione: <html><head/><body><p>Test the Cloudlog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is inavalied it will turn red.</p></body></html> <html><head/><body><p>Testa la chiave API di Cloudlog.</p><p>Il pulsante diventa verde se la chiave API è scrivibile. Diventa arancione se la chiave API è in sola lettura. Se la chiave API non è valida diventa rosso.</p></body></html> - Test API Key - Testa chiave API + Testa chiave API - + Alerts Notifiche @@ -10662,129 +13223,173 @@ Fare clic con il tasto destro per inserire ed eliminare le opzioni.Assicurarsi che il rig NON collegato tramite "DefaultAudioDevice" !!! - + Audio Alerts Notifiche sonore - - + + New Grid Nuova Griglia - + My Call in message Il mio Nominativo nel messaggio - + My Call Il mio Nominativo - - + + New Continent Nuovo Continente - + Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. Per le categorie di avviso sopra la riga è necessario che la casella "Mostra DXCC, griglia e lavorato prima" nella scheda Generale sia selezionata. - THIS FEATURE IS FOR EXPERIENCED USERS ONLY - QUESTA FUNZIONE È RISERVATA SOLO A UTENTI ESPERTI + QUESTA FUNZIONE È RISERVATA SOLO A UTENTI ESPERTI - + Ensure that you have made meaningful settings on the Colors tab, so that you see which message triggered the alert. Assicurati di aver effettuato impostazioni significative nella scheda Colori, in modo da vedere quale messaggio ha attivato l'avviso. - + + NOTES + + + + Ensure that your rig is NOT connected via "Default Device". Assicurati che il tuo RTX NON sia connesso tramite "Dispositivo predefinito". - + + "Wanted callsigns, grids, prefixes and directional calls" uses the entries from "Highlight orange" and "Highlight blue". + + + + Message received Messaggio.ricevuto - - + + <html><head/><body><p>Wanted callsigns, grids, prefixes and directional calls. This alert category uses the entries from &quot;Highlight orange&quot; and &quot;Highlight blue&quot;.</p></body></html> + + + + + Wanted callsigns, grids, prefixes and directional calls + + + + + New ITU Zone Nuova Zona ITU - - + + New CQ Zone Nuova Zona CQ - - + + New DXCC Nuovo DXCC - - + + New DXCC on Band Nuovo DXCC sulla Banda - - + + New ITU Zone on Band Nuovo Zona ITU sulla Banda - - + + New Continent on Band Nuovo Continente sulla Banda - - + + New Grid on Band Nuova Griglia sulla Banda - - + + New CQ Zone on Band Nuova Zona CQ sulla Banda - - + + DX Call or DX Grid in message Chiamata DX o Griglia DX nel messaggio - + + IMPORTANT + + + + + Voices: + + + + + default + + + + + <html><head/><body><p>Test the alert sounds.</p></body></html> + + + + + Test + + + + Toggle Audio Alerts on/off. Alerts will be played on "DefaultAudioDevice". DON'T ENABLE AUDIO ALERTS WHEN YOUR RIG IS CONNECTED VIA THIS SOUNDCARD !!! Abilita/disabilita le notifiche sonore. Le notifiche saranno riprodotte sul "DefaultAudioDevice". NON ABILITARE LE NOTIFICHE SONORE QUANDO IL RIG È CONNESSO TRAMITE LA SCHEDA SONORA !!! - + Enable Audio Alerts Abilita Notifiche sonore - - + + CQ in message CQ nel messaggio - + Use of this feature requires that your computer is equipped with two sound cards. L'uso di questa funzionalità richiede che il computer sia equipaggiato con due schede audio. @@ -10793,7 +13398,7 @@ Fare clic con il tasto destro per inserire ed eliminare le opzioni.Questo requisito è soddisfatto quando il rig è connesso tramite audio USB (FT-991, IC-7300, ecc.). - + Audio Alerts will be played on the default audio device (usually the loudspeaker of your PC). Le notiiche sonore saranno riprodotte sul dispositivo audio predefinito (solitamente gli altoparlanti del PC). @@ -10806,92 +13411,91 @@ Fare clic con il tasto destro per inserire ed eliminare le opzioni.NOTA IMPORTANTE: Abilitare le notifiche sonore solo nel caso in cui il rig NON sia connesso tramite "DefaultAudioDevice" !!! - + Filters Filtri - + Hide messages containing the following callsigns or keywords: Nascondi i messaggi contenenti i nominativi o le parole chiave seguenti: - + Show only messages containing the following callsigns or keywords: Mostra solo i messaggi contenenti i nominativi o le parole chiave seguenti: - + Filters for the Band Activity window Filtri per la finestra Attività di Banda - + This requirement is fulfilled when your rig is connected via USB audio. Questo requisito è soddisfatto quando il tuo RTX è collegato tramite audio USB. - IMPORTANT NOTES - NOTE IMPORTANTI + NOTE IMPORTANTI - + Territories 1-4 for the Hide checkboxes in the View menu Territori 1-4 per le caselle di controllo Nascondi nel menu Visualizza - + Blacklist Rifiuta - + <html><head/><body><p>Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed).</p></body></html> <html><head/><body><p>Utilizza i filtri solo per Wait and Pounce, CQ: First, ecc. (tutti i messaggi vengono comunque visualizzati).</p></body></html> - + Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed) Utilizzare i filtri solo per Wait and Pounce, CQ: First, ecc. (tutti i messaggi vengono comunque visualizzati) - + Always pass messages with the following keywords: Trasmettere sempre messaggi con le seguenti parole chiave: - + Whitelist Accetta - + <html><head/><body><p>Apply filters only to the callsigns of the calling stations. Usually the second word of the messages is analyzed, for directional calls the third word.</p></body></html> <html><head/><body><p>Applica i filtri solo ai nominativi delle stazioni chiamanti. Solitamente viene analizzata la seconda parola dei messaggi, mentre per le chiamate direzionali viene analizzata la terza parola.</p></body></html> - + Apply filters only to the callsigns of the calling stations Applica i filtri solo ai nominativi delle stazioni chiamanti - + Always Pass Passa sempre - + <html><head/><body><p>Use “worked today and yesterday” instead of “worked today” for the 3 related Quick Filters.</p></body></html> <html><head/><body><p>Usa "lavorato oggi e ieri" invece di "lavorato oggi" per i 3 filtri rapidi correlati.</p></body></html> - + Quick Filters: Hide/Ignore/Highlight "worked today and yesterday" instead of "worked today" (UTC) Filtri rapidi: Nascondi/Ignora/Evidenzia "lavorato oggi e ieri" invece di "lavorato oggi" (UTC) - + <html><head/><body><p>Discard (Cancel) or apply (OK) configuration changes including</p><p>resetting the radio interface and applying any soundcard changes</p></body></html> <html><head/><body><p>Annulla (Annulla) o applica (OK) le modifiche alla configurazione incluso</p><p>ripristinando l'interfaccia radio e applicando eventuali modifiche alla scheda audio</p></body></html> @@ -10933,53 +13537,109 @@ per valutare la propagazione e le prestazioni del sistema. main - + + Lock file: %1 + + + + + Owner process: %1 + + + + + Owner application: %1 + + + + + Owner host: %1 + + + + + Owner information is not available. + + + + + Remove error: %1 + + + + + WSJT-X could not lock its temporary instance file. + +If another WSJT-X window is still running, choose No. +Use a unique rig name to run more than one instance. + +If WSJT-X crashed or will not restart, choose Remove Lock File. +Choose Retry after closing the other instance. + + + + + Remove Lock File + + + + + Unable to remove stale lock file + + + + + Close any running WSJT-X instance or remove the lock file manually after confirming WSJT-X is not running. + + + + Failed to create a temporary directory Impossibile creare una directory temporanea - - + + Path: "%1" Percorso: "%1" - + Failed to create a usable temporary directory Impossibile creare una directory temporanea utilizzabile - + Another application may be locking the directory Un'altra applicazione potrebbe bloccare la directory - + Failed to create data directory Impossibile creare la directory dei dati - + path: "%1" percorso: "%1" - + Shared memory error Errore di memoria condivisa - + Unable to create shared memory segment Impossibile creare il segmento di memoria condivisa - + Sub-process error Errore sottoprocesso - + Failed to close orphaned jt9 process Impossibile chiudere il processo jt9 orfano @@ -10992,8 +13652,9 @@ per valutare la propagazione e le prestazioni del sistema. Errore fatale inatteso + Another instance may be running - Un'altra istanza potrebbe essere in esecuzione + Un'altra istanza potrebbe essere in esecuzione try to remove stale lock file? diff --git a/translations/wsjtx_ja.ts b/translations/wsjtx_ja.ts index a940546f..fb6917f1 100644 --- a/translations/wsjtx_ja.ts +++ b/translations/wsjtx_ja.ts @@ -114,18 +114,17 @@ アクティブな局 - - + Wanted only Wantedのみ - + Message メッセージ - + My call only マイコールのみ @@ -133,149 +132,178 @@ Astro - - + + Doppler tracking ドップラー追跡 - + <html><head/><body><p>One station does all Doppler shift correction, their QSO partner receives and transmits on the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>片方の局がドップラーシフトを修正します.相手局はスケジュール通りの周波数で送受信します.</p><p>もし無線機が送信中にCAT QSYコマンドを受け付けない場合、一回の送信で一度だけ周波数調整が行われます.</p></body></html> - + Full Doppler to DX Grid DXのグリッドに対するフルドップラー補正 - + <html><head/><body><p>Transmit takes place on sked frequency and receive frequency is corrected for own echoes. </p><p>This mode can be used for calling CQ, or when using Echo mode.</p></body></html> <html><head/><body><p>送信はスケジュールされた周波数で行われ、受信周波数は自分のエコーを使って調整されます. </p><p>このモードはCQを出すとき、またはエコーモードで使うことができます.</p></body></html> - + Own Echo 自分のエコー - + <html><head/><body><p>Both stations correct for Doppler shift such that they would be heard on the moon at the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p><p>Use this option also for Echo mode.</p></body></html> <html><head/><body><p>双方の局とも、ちょうど月面上でスケジュール周波数にて交信するかのようなドップラー周波数調整が行われます.</p><p>もし送信中に無線機がCAT QSYコマンドを受け付けない場合は、一回の送信につき一度の周波数調整が行われます.</p><p>このオプションはエコーモードのときにも使ってください.</p></body></html> - + Constant frequency on Moon 月面で周波数を一定 - + <html><head/><body><p>DX station announces their TX Freq, which is entered as the Sked Freq. Correction applied to RX and TX so you appear on the DX's station's own echo Freq.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>DX局はスケジュール周波数として送信周波数をアナウンスします. あなたの信号がDX局の自分のエコー周波数に現れるように調整されます.</p><p>もし、無線機が送信中にCAT QSYコマンドを受け付けない場合、一回の送信には一度だけ周波数調整が行われます.</p></body></html> - + On DX Echo DXのエコー - + <html><head/><body><p>Tune radio manually and select this mode to put your echo on the same frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>手動で送信機を調整し、同じ周波数にエコーが来るようこのモードを選びます.</p><p>もし無線機が送信中にCAT QSYコマンドを受け付けない場合、周波数調整は一回の送信当たり、一度だけ行われます.</p></body></html> - + Call DX DXを呼ぶ - + <html><head/><body><p>No Doppler shift correction is applied. This may be used when the QSO partner does full Doppler correction to your grid square.</p></body></html> <html><head/><body><p>ドップラーシフト補正なし. 相手があなたのグリッドロケーターに合わせてくれる場合に使用.</p></body></html> - + None なし - + Sked frequency スケジュール周波数 - - + + 0 0 - + + kHz + + + + + Set kHz + + + + + <html><head/><body><p>Tx shift relative to Rx sked frequency</p></body></html> + + + + + MHz + + + + + Tx Shift + + + + Rx: Rx: - + Tx: Tx: - <html><head/><body><p>Press and hold the CTRL key to adjust the sked frequency manually with the rig's VFO dial or enter frequency directly into the band entry field on the main window.</p></body></html> - <html><head/><body><p>CTRLキーを押したまま無線機のVFOダイアルを回してスケジュール周波数を調整するか、あるいは主画面のバンド入力フィールドに直接周波数をセットします.</p></body></html> + <html><head/><body><p>CTRLキーを押したまま無線機のVFOダイアルを回してスケジュール周波数を調整するか、あるいは主画面のバンド入力フィールドに直接周波数をセットします.</p></body></html> - + Echo Mode Echoモード - + Hz Hz - + RIT RIT - Dither - Dither + Dither - Tx Shift relative to Rx Sked Freq - 受信スケージュール周波数からの送信周波数シフト + 受信スケージュール周波数からの送信周波数シフト - Enter large offset - 大きなオフセットを入力 + 大きなオフセットを入力 - MHz - MHz + MHz - Shift - Shift + Shift - + Enable 有効 - + + Dither + + + + + Ctl-Lock Sked Freq + + + + Astro Data 天文データ - + Astronomical Data 天文データ @@ -414,6 +442,166 @@ コールサイン + + Cloudlog + + + + QSO could not be sent to Cloudlog. + + + + + + QSO upload was rejected by Cloudlog. + + + + + HTTP status %1. Response was not JSON. + + + + + Cloudlog returned an unexpected upload response. + + + + + Cloudlog reported upload status: %1 + + + + + HTTP status %1. + + + + + Cloudlog::impl + + + Enter a Cloudlog or Wavelog URL. + + + + + The connection check needs a base URL before it can contact the API. + + + + + Cloudlog or Wavelog authentication endpoint was not found. + + + + + Tried /api/check_auth, /index.php/api/check_auth, and /index.php/api/auth. + + + + + API key is valid but read-only. + + + + + Generate a read/write API key before enabling QSO uploads. + + + + + API key is invalid. + + + + + Authentication response was not usable. + + + + + Station profile response was not JSON. + + + + + Configured station profile was not found. + + + + + No station profiles were returned by the server. + + + + + Available station profiles: %1 + + + + + Wavelog dry-run QSO endpoint was not found. + + + + + Tried /api/qso/true and /index.php/api/qso/true after Wavelog was identified. + + + + + Dry-run upload response was not usable. + + + + + + Connection check passed. + + + + + Writable API key, station profile, and dry-run QSO upload were validated. + + + + + Dry-run QSO upload was rejected. + + + + + + The QSO dry-run upload was rejected. + + + + + Dry-run QSO upload returned an unexpected response. + + + + + Writable API key and station profile were validated. No safe dry-run QSO endpoint was identified, so no test QSO was uploaded. + + + + + Network error while checking Cloudlog or Wavelog. + + + + + Cloudlog Error! + + + + + Reason: %1 + + + ColorHighlighting @@ -520,90 +708,317 @@ Configuration::impl - - - + + + &Delete 削除(&D) - - + + &Insert ... 挿入(&I)... - + + Wanted territory %1 + + + + + Blacklist keyword %1 + + + + + Whitelist keyword %1 + + + + + Always pass keyword %1 + + + + + CAT control port + + + + + CAT baud rate + + + + + Default CAT data bits + + + + + Seven CAT data bits + + + + + Eight CAT data bits + + + + + Default CAT stop bits + + + + + One CAT stop bit + + + + + Two CAT stop bits + + + + + Default CAT handshake + + + + + No CAT handshake + + + + + XON/XOFF CAT handshake + + + + + Hardware CAT handshake + + + + + Force DTR control line + + + + + Force RTS control line + + + + + VOX PTT method + + + + + DTR PTT method + + + + + CAT PTT method + + + + + RTS PTT method + + + + + PTT control port + + + + + Rear or data transmit audio source + + + + + Front or mic transmit audio source + + + + + No radio mode control + + + + + USB radio mode + + + + + Data or packet radio mode + + + + + No split operation + + + + + Rig split operation + + + + + Fake It split operation + + + + + CAT poll interval + + + + + Frequency calibration slope + + + + + Frequency calibration intercept + + + + + Working frequencies table + + + + + Station information table + + + + + Decode highlighting rules + + + + + Highlighting rules and priorities for decoded messages. + + + + + Decode highlighting actions + + + + + Change or reset colors for the selected highlighting rule. + + + + + Move selected highlighting rule up + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move selected highlighting rule down + + + + + Move the selected highlighting rule later in priority order. + + + + + Orange highlight callsigns and grids + + + + + Blue highlight callsigns and grids + + + + Failed to create save directory 保存のためのフォルダを作成できません - + path: "%1% パス: "%1% - + Failed to create samples directory サンプルフォルダを作成できません - + path: "%1" パス: "%1" - API key OK - API key OK + API key OK - API key read-only - API key read-only + API key read-only - API key invalid - API key 無効 + API key 無効 - + &Load ... 読み込み(&L)... - + &Save as ... 名前を付けて保存(&S)... - + &Merge ... 結合(&M)... - + &Reset リセット(&R) - + Serial Port: シリアルポート: - + Serial port used for CAT control CAT制御用シリアルポート - + TCI Server: TCI サーバ: - + Optional hostname and port of TCI service. Leave blank for a sensible default on this machine. Formats: @@ -618,12 +1033,12 @@ Formats: [IPv6-address]:port - + Network Server: ネットワークサーバ: - + Optional hostname and port of network service. Leave blank for a sensible default on this machine. Formats: @@ -638,12 +1053,12 @@ Formats: [IPv6-アドレス]:ポート番号 - + USB Device: USBデバイス: - + Optional device identification. Leave blank for a sensible default for the rig. Format: @@ -654,15 +1069,25 @@ Format: [VID[:PID[:VENDOR[:PRODUCT]]]] - - + + Invalid audio input device 無効なオーディオ入力デバイス - - - + + Reset all decode highlighting and priorities to Default 1 values + + + + + Reset all decode highlighting and priorities to Default 2 values + + + + + + Frequency files (*.qrg *.qrg.json);;All files (*.*) 周波数ファイル (*.qrg *.qrg.json);;全てのファイル (*.*) @@ -671,81 +1096,79 @@ Format: 無効なオーディオ出力デバイス - + Invalid audio output device 無効なオーディオ出力デバイス - + Invalid PTT method 無効なPTT方式 - + Invalid PTT port 無効なPTT用ポート - - + + Invalid Contest Exchange 無効なコンテストナンバー - + You must input a valid ARRL Field Day exchange 正しいARRLフィールドデーコンテストナンバーを入力しなければなりません - + You must input a valid ARRL RTTY Roundup exchange 正しいARRL RTTY ラウンドアップのコンテストナンバーを入力しなければなりません - + Pending DNS lookup, please try again later DNS参照できず、後で再度行ってください - - + + Reset Decode Highlighting デコードハイライトをリセット - - Reset all decode highlighting and priorities to default values - すべてのハイライトと優先順位設定をデフォルトへ戻す + すべてのハイライトと優先順位設定をデフォルトへ戻す - + Error Loading CTY.DAT CTY.DAT読み込みエラー - + Error Loading CALL3.TXT file CALL3.TXT読み込みエラー - + WSJT-X Decoded Text Font Chooser WSJT-Xのデコード出力用フォント選択 - - + + Hamlib update only available on Windows. HamlibのアップデートはWindows用のみ. - + Error Loading libhamlib-4.dll libhamlib-4.dll読み込みエラー - + Hamlib Update successful New Hamlib will be used after restart @@ -754,7 +1177,7 @@ New Hamlib will be used after restart 新しいHamlibが再起動後に使われます - + Hamlib successfully reverted Reverted Hamlib will be used after restart @@ -763,27 +1186,27 @@ Reverted Hamlib will be used after restart 復元されたHamlibが再起動後に使われます - + No Hamlib update found that could be reverted 復元可能なHamlibの更新が見つかりません - + Error in network address ネットワークアドレスにエラーあり - + UDP server DNS lookup failed UDPサーバーのDNS参照失敗 - + MAC-ambiguous multicast groups addresses not supported 曖昧なMACアドレスを使ったグループマルチキャストはサポートしていません - + Load Working Frequencies 使用周波数を読み込み @@ -792,99 +1215,99 @@ Reverted Hamlib will be used after restart 周波数ファイル (*.qrg);;全ファイル (*.*) - + Replace Working Frequencies 使用周波数を置き換え - + Are you sure you want to discard your current working frequencies and replace them with the loaded ones? 本当に現在の周波数を読み込んだ周波数で置き換えてもいいですか? - + Merge Working Frequencies 使用周波数を追加併合 - + Error reading frequency file 周波数ファイルの読み込みエラー - - - + + + Not a valid frequencies file 周波数ファイルが正しくない - + Incorrect file magic 不正なファイルマジック - + Version is too new バージョンが新しすぎます - + Contents corrupt 中身が壊れています - + Save Working Frequencies 使用周波数を保存 - + Only Save Selected Working Frequencies 選択した使用周波数のみ保存 - + Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. 選択した使用周波数だけを保存してもいいですか。全部を保存したいときはNoをクリックしてください。 - + Reset Working Frequencies 使用周波数をリセット - + Are you sure you want to discard your current working frequencies and replace them with default ones? 本当に現在の使用周波数を破棄してデフォルト周波数と置き換えてもよいですか? - + Save Directory フォルダーを保存 - + AzEl Directory AzElフォルダー - + Rig control error 無線機コントロールエラー - + Failed to open connection to rig 無線機へ接続できません - + Rig failure 無線機エラー - + Not found audio device missing 見つかりません @@ -1003,32 +1426,32 @@ DXLab@groups.ioに相談してください. 文字色(&F) ... - + Choose %1 Foreground Color 文字色 %1 を選択 - + &Unset foreground color 文字色指定を解除(&U) - + &Background color ... 背景色(&B) ... - + Choose %1 Background Color 背景色 %1 を選択 - + U&nset background color 背景色の指定を解除(&n) - + &Reset this item to defaults このアイテムをデフォルトへ戻す(&R) @@ -1116,17 +1539,17 @@ DXLab@groups.ioに相談してください. LoTWユーザー - + f/g unset 文字色指定なし - + b/g unset 背景色指定なし - + Highlight Type ハイライトタイプ @@ -1134,41 +1557,56 @@ DXLab@groups.ioに相談してください. Designer - + &Delete 削除(&D) - + &Insert ... 挿入(&I) ... - + Insert &after ... 後ろに挿入(&a) ... - + Import Palette パレットインポート - - + + Palettes (*.pal) パレット(*.pal) + Import Palette Failed + + + + Export Palette パレットエクスポート + + + Export Palette Failed + + + + + Error writing waterfall palette file "%1": %2. + ウォーターフォールパレットファイル "%1": %2 に書き込めません. + Dialog - + Gray time: グレータイム: @@ -1271,16 +1709,31 @@ Error: %2 - %3 DisplayText - + &Erase 消去(&E) + + + Return to live activity + + + + + Return to the live activity position + + + + + Live activity is paused while earlier entries are visible. + + EchoGraph - + Echo Graph エコーグラフ @@ -1353,7 +1806,7 @@ Error: %2 - %3 EmulateSplitTransceiver - + Emulated split mode requires rig to be in simplex mode スプリットモードエミュレーションを使う場合、無線機をシンプレックスモードにします @@ -1441,12 +1894,12 @@ Error: %2 - %3 ExistingNameDialog - + Configuration to Clone From コンフィグレーションの複製 - + &Source Configuration Name: 元のコンフィグレーション名(&S): @@ -1584,7 +2037,7 @@ Error: %2 - %3 FastGraph - + Fast Graph 高速グラフ @@ -1638,6 +2091,157 @@ Error: %2 - %3 %1 + + FixtureAudioInput + + + Synthetic audio input has no detector sink. + + + + + Synthetic FT8 audio input requires a downsample factor of 1 or 4. + + + + + Synthetic JTTY audio input requires a downsample factor of 1 or 4. + + + + + Synthetic audio input requires the mono input channel. + + + + + Unable to open synthetic audio fixture %1: %2 + + + + + Synthetic audio fixture must be mono, signed 16-bit little-endian PCM. + + + + + Synthetic audio fixture must be %1 Hz for downsample factor %2; found %3 Hz. + + + + + Synthetic FT8 audio fixture must contain exactly %1 frames; found %2. + + + + + Synthetic JTTY audio fixture must contain complete PCM frames. + + + + + Unable to read all PCM data from synthetic audio fixture. + + + + + Synthetic audio input does not yet support big-endian hosts. + + + + + Unable to initialize the detector for synthetic audio input. + + + + + Synthetic audio fixture ready + + + + + Synthetic audio input suspended + + + + + Synthetic audio input receiving + + + + + Detector accepted %1 of %2 synthetic PCM bytes. + + + + + Synthetic audio fixture exhausted + + + + + FixtureSoundOutput + + + Synthetic audio output requires a readable source. + + + + + Synthetic audio output requires a capture path. + + + + + Synthetic audio output does not yet support big-endian hosts. + + + + + Synthetic audio output received an unsupported source frame size. + + + + + Unable to open synthetic audio output capture %1: %2 + + + + + Synthetic audio output received a partial captured frame. + + + + + Synthetic FT8 audio output exceeded its 15-second capture period. + + + + + Synthetic audio output wrote %1 of %2 capture bytes: %3 + + + + + Synthetic audio output source disappeared during capture. + + + + + Synthetic FT8 audio output continued beyond its 15-second capture period. + + + + + Synthetic audio output received %1 of %2 source bytes. + + + + + Synthetic audio output received an invalid source byte count. + + + FoxLog::impl @@ -1752,68 +2356,100 @@ Error: %2 - %3 - FrequencyDialog + FrequencyDeltaLineEdit - - Add Frequency + + Offset in MHz + + + + + Frequency offset in MHz + + + + + Enter a frequency offset in MHz. + + + + + FrequencyDialog + + + Add Frequency 周波数を追加 - + IARU &Region: IARU地域(&R): - + &Mode: モード(&M): - + &Frequency (MHz): 周波数MHz(&F): - + &Preferred for Band/Mode: お気に入りのバンド/モード(&P): - + &Description: 詳細(&D)0: - + &Enable Date Range: 日時範囲をオン(&E): - + S&tart: S&tart: - + &End: &End: - + &Source: &Source: - + Invalid Date Range 不正な日時範囲 - + Start date must be before end date 開始日は終了日以前でなければなりません + + FrequencyLineEdit + + + + Frequency in MHz + + + + + Enter a positive frequency in MHz. + + + FrequencyList_v2_100 @@ -1837,37 +2473,37 @@ Error: %2 - %3 FrequencyList_v2_101 - + IARU Region IARU地域 - + Mode モード - + Frequency 周波数 - + Frequency (MHz) 周波数(MHz) - + Description 説明 - + Source ソース @@ -1883,129 +2519,241 @@ Error: %2 - %3 - + Pref Pref - + Start Date/Time 開始日時 - + End Date/Time 終了日時 - + Failed to parse JSON file JSONファイルを読み込み失敗 - + Information Missing 情報不足 - + No Frequencies were found 周波数が見つからない - + Loaded Frequencies from %1 %1から周波数を読み込み - + Entries Valid/Skipped %1 エンティティー 有効/スキップ %1 + + Ft8TxLoopbackTestController + + + Timed out after 60 seconds. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + The FT8 output stream did not start exactly once. + + + + + The FT8 Auto control was not found. + + + + + Disabling Auto stopped the active FT8 transmission. + + + + + Synthetic output reported non-silent FT8 audio more than once. + + + + + The FT8 capture did not stop exactly once at the requested path. + + + + + Synthetic audio output failed: %1 + + + + + A required FT8 transmit GUI control was not found. + + + + + The application did not enter FT8 mode. + + + + + Unable to configure the requested FT8 transmission. + + + + + The FT8 transmit controls disappeared before transmission. + + + + + Unable to start the synthetic FT8 transmission. + + + + + The FT8 Auto control disappeared before retry. + + + + + The FT8 output lifecycle was not one start, non-silent transmission, and natural stop. + + + + + FT8 audio began at frame %1; expected %2 +/- %3 frames. + + + + + The FT8 capture file was not created or is empty: %1 + + + + + Unable to reopen FT8 capture %1: %2 + + + + + The FT8 capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The FT8 capture must contain exactly %1 frames; file=%2 reported=%3. + + + + + Unexpected modal window: %1 + + + HRDTransceiver - - + + Failed to connect to Ham Radio Deluxe HamRadioDeluxeに接続できません - + Failed to open file "%1": %2. ファイルが開けません "%1": %2. - - + + Ham Radio Deluxe: no rig found HamRadioDeluxe: 無線機が見つかりません - + Ham Radio Deluxe: rig doesn't support mode HamRadioDeluxe: 無線機がそのモードに対応していません - + Ham Radio Deluxe: sent an unrecognised mode HamRadioDeluxe: 無効なモードです - + Ham Radio Deluxe: item not found in %1 dropdown list HamRadioDeluxe: %1ドロップダウンリストに項目がありません - + Ham Radio Deluxe: button not available HamRadioDeluxe: ボタンがありません - + Ham Radio Deluxe didn't respond as expected HamRadioDeluxe: 意図しないレスポンスが返ってきました - + Ham Radio Deluxe: rig has disappeared or changed HamRadioDeluxe: 無線機との接続が切れたか変更されました - + Ham Radio Deluxe send command "%1" failed %2 HamRadioDeluxe: コマンド"%1"が失敗しました%2 - - + + Ham Radio Deluxe: failed to write command "%1" HamRadioDeluxe: コマンド"%1"がエラーしました - + + Ham Radio Deluxe sent an invalid reply to our command "%1": %2 + + + Ham Radio Deluxe sent an invalid reply to our command "%1" - HamRadioDeluxe: コマンド"%1"に対し無効な返答が返ってきました + HamRadioDeluxe: コマンド"%1"に対し無効な返答が返ってきました - + Ham Radio Deluxe failed to reply to command "%1" %2 HamRadioDeluxe: コマンド"%1"に反応エラー%2 - + Ham Radio Deluxe retries exhausted sending command "%1" HamRadioDeluxe: コマンド"%1"が何度も失敗しました - + Ham Radio Deluxe didn't respond to command "%1" as expected HamRadioDeluxe: コマンド"%1"に対する返答が正しくありません @@ -2013,186 +2761,186 @@ Error: %2 - %3 HamlibTransceiver - - + + Hamlib initialisation error Hamlib初期化エラー - + Hamlib settings file error: %1 at character offset %2 Hamlib設定ファイルエラー: %2にて%1 - + Hamlib settings file error: top level must be a JSON object ファイルのトップレベルはJSONオブジェクトでなければいけません - + Hamlib settings file error: config must be a JSON object Hamlib設定エラー: JSONオブジェクトでなければなりません - + Unsupported CAT type サポートしていないCATタイプ - + Hamlib error: %1 while %2 Hamlibエラー: %1 %2 - + opening connection to rig 無線機へ接続中 - + getting current frequency 現周波数を取得中 - + getting current mode 現モードを取得 - - + + exchanging VFOs VFO入れ替え - - + + getting other VFO frequency もう一方のVFOの周波数を取得 - + getting other VFO mode もう一方のVFOのモードを取得 - - + + setting current VFO 現VFOを設定 - + getting frequency 周波数を取得 - + getting mode モードを取得 - - - + + + getting current VFO 現VFOを取得 - - - - + + + + getting current VFO frequency 現VFOの周波数を取得 - - - - - - + + + + + + setting frequency 周波数を設定 - - - - + + + + getting current VFO mode 現VFOのモードを取得 - - - - - + + + + + setting current VFO mode 現VFOモードを設定 - setting VFOB mode - VFOBモードセット + VFOBモードセット - - + + setting/unsetting split mode スプリットのオン/オフ - - + + setting split mode スプリットモードオン - + setting split TX frequency and mode スプリット送信周波数とモードをセット - + setting split TX frequency スプリット送信周波数をセット - + getting split TX VFO mode スプリットモードを取得 - + setting split TX VFO mode スプリット送信VFOのモードをセット - + getting PTT state PTT状態を取得 - + setting PTT on PTTオン - - + + setting PTT off PTTオフ - + setting a configuration item コンフィグレーション項目をセット - + + getting a configuration item コンフィグレーション項目を取得 @@ -2241,6 +2989,322 @@ Error: %2 - %3 IARU地域 + + JttyTxLoopbackTestController + + + Timed out after 60 seconds. + + + + + JTTY request %1 was accepted more than once. + + + + + JTTY request %1 was rejected with reason %2. + + + + + JTTY request %1 completed more than once. + + + + + More than one JTTY transmit session drained. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + JTTY output stream restarted more than once. + + + + + Synthetic output reported non-silent playback more than once. + + + + + Synthetic output stopped the wrong capture path: %1 + + + + + JTTY output stream stopped more than once. + + + + + Synthetic audio output failed: %1 + + + + + The JTTY mode action was not found. + + + + + The application did not enter JTTY mode. + + + + + The JTTY encoder did not produce a valid test waveform extent. + + + + + The first JTTY text request was not accepted synchronously. + + + + + Non-silent playback began before the first request was accepted. + + + + + The output stream restarted or stopped before the gapless append. + + + + + The gapless append occurred before one second of real playback. + + + + + The second JTTY text request was not accepted during playback. + + + + + Appending the second JTTY message restarted or stopped playback. + + + + + The accepted-request set did not contain exactly both submitted messages. + + + + + JTTY text requests were not accepted in submission order. + + + + + The completed-request set did not contain exactly both submitted messages. + + + + + JTTY text requests did not complete in FIFO order. + + + + + The output stream lifecycle was not one start, one drain, and one stop. + + + + + The captured JTTY session contains an unexpected internal audio gap. + + + + + The JTTY capture file was not created or is empty: %1 + + + + + Unable to reopen JTTY capture %1: %2 + + + + + The JTTY capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The JTTY capture has an invalid PCM extent: file frames=%1, expected audio frames=%2, reported frames=%3. + + + + + Unexpected modal window: %1 + + + + + LiveAudioTestController + + + Timed out after 110 seconds. + + + + + Timed out after 100 seconds. + + + + + Decoder backend failed: %1 + + + + + JTTY display did not settle to the expected text after input ended. + + + + + Synthetic audio source failed: %1 + + + + + Unable to open expected decode file %1: %2 + + + + + Expected decode file %1 contains no messages. + + + + + Unable to open expected JTTY text file %1: %2 + + + + + Expected JTTY text file %1 contains no messages. + + + + + A required FT8 decoder or monitoring GUI control was not found. + + + + + Unable to configure the %1-%2 Hz waterfall decode range. + + + + + Unable to prepare the complete FT8 fixture decode. + + + + + Unable to configure the FT8 multithreaded decoder as requested. + + + + + Monitor did not enter the active state. + + + + + Synthetic input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic audio source. + + + + + A required JTTY mode, monitoring, or decode display control was not found. + + + + + The JTTY GUI action did not select JTTY mode. + + + + + Monitor did not enter the active state for JTTY. + + + + + Synthetic JTTY input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic JTTY audio source. + + + + + The expected early standard and final configured MTD decoder invocations were not both observed. + + + + + The configured MTD invocation produced no decoder output. + + + + + live MTD missing: %1 + + + + + processed missing: %1 + + + + + display missing: %1 + + + + + Reference-message validation failed: %1; live MTD output: %2; processed output: %3 + + + + + Decoder messages were processed but none reached the GUI display path. + + + + + The expected JTTY messages did not reach both panes in FIFO order. + + + + + The expected JTTY message reached both panes without an observed growing prefix. + + + + + Unexpected modal window: %1 + + + LogQSO @@ -2360,188 +3424,188 @@ Error: %2 - %3 受信周波数 - + Aircraft scatter 飛行機スキャッター - + Aurora-E オーロラE - + Aurora オーロラ - + Back scatter バックスキャッター - + Echolink Echolink - + Earth-moon-earth EME - + Sporadic E Eスポ - + F2 Reflection F2層反射 - + Field aligned irregularities 沿磁力線不規則性 - + Internet-assisted インターネット経由 - + Ionoscatter イオン散乱 - + IRLP IRLP - + Meteor scatter 流星散乱 - + Non-satellite repeater or transponder 非衛星リピーター - + Rain scatter 雨散乱 - + Tropospheric ducting トロッポダクト - + A A - + B B - + BS BS - + JA JA - + JD JD - + K K - + KA KA - + KT KT - + L L - + LS LS - + LU LU - + LX LX - + S S - + SX SX - + T T - + US US - + UV UV - + VS VS - + VU VU - + Satellite 衛星 - + Trans-equatorial 赤道伝搬 @@ -2550,33 +3614,33 @@ Error: %2 - %3 ダクト - - + + Invalid QSO Data 無効なQSOデータ - + Check exchange sent and received 送受信したナンバーをチェック - + Check all fields すべての項目をチェック - + Log file error ログファイルエラー - + Cannot open "%1" for append "%1"に追加できません - + Error: %1 エラー: %1 @@ -2627,62 +3691,57 @@ Error(%2): %3 MainWindow - - WSJT-X by K1JT - - - - - - - - - - - - + + + + + + + + + Band Activity バンド状況 - - + + UTC dB DT Freq Dr UTC dB DT Freq Dr - - - - - - - + + + + + + + Rx Frequency 受信周波数 - + CQ only CQのみ - + Enter this QSO in log このQSOをログする - + Log &QSO QSOをログ(&Q) - + Stop monitoring モニター停止 - + &Stop 停止(&S) @@ -2691,77 +3750,77 @@ Error(%2): %3 モニターオン/オフ - + &Monitor モニター(&M) - + <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> <html><head/><body><p>右側ウィンドウを消去. ダブルクリックで両側ウィンドウを消去.</p></body></html> - + Erase right window. Double-click to erase both windows. 右側ウィンドウを消去. ダブルクリックで両側ウィンドウを消去. - + &Erase 消去(&E) - + <html><head/><body><p>Clear the accumulating message average.</p></body></html> <html><head/><body><p>累加メッセージ平均をクリア.</p></body></html> - + Clear the accumulating message average. 累加メッセージ平均をクリア. - + Clear Avg 平均をクリア - + <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> <html><head/><body><p>QSO周波数で最後に受信した信号をデコード</p></body></html> - + Decode most recent Rx period at QSO Frequency QSO周波数で最後に受信した信号をデコード - + &Decode デコード(&D) - + <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> <html><head/><body><p>自動送信をオン/オフ</p></body></html> - + Toggle Auto-Tx On/Off 自動送信をオン/オフ - + E&nable Tx 送信許可(&n) - + Stop transmitting immediately 直ちに送信停止 - + &Halt Tx 送信停止(&H) @@ -2770,92 +3829,94 @@ Error(%2): %3 <html><head/><body><p>シングルトーンのオン/オフ</p></body></html> - + Toggle a pure Tx tone On/Off シングルトーンのオン/オフ - + &Tune チューン(&T) - + + Menus メニュー - + Decode other Hounds calling above 1000 Hz audio offset 1000Hzより上で呼んでいるHoundsをデコード - + Enable auto response to the first decode from a new DXCC or new call on the current band. バンドの未交信DXCCまたは未交信局を自動的に応答. - + Maximum drift rate in units of symbol rate per transmission. 1回の送信のシンボルレートにおける最大ドリフトレート. - + Max Drift 最大ドリフト - + Percentage of minute sequences devoted to transmitting. 送信に費やされた時間のパーセンテージ. - + Prefer Type 1 messages タイプ1メッセージ優先 - + <html><head/><body><p>Transmit during the next sequence.</p></body></html> <html><head/><body><p>次回送信</p></body></html> - + Quick-Start Guide to Q65 Q65 クイックスタートガイド - + Auto Clear Avg after decode デコード後平均値を自動クリア - + Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 WSJT-X 2.5.0とMAP65 3.0のクイックスタートガイド - + + USB dial frequency USBダイアル周波数 - + 14.078 000 14.078 000 - + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> <html><head/><body><p>ノイズのみ受信のとき30dBが適当<br/>緑:適切<br/>赤:過大<br/>黄:過少</p></body></html> - + Rx Signal 受信信号 - + 30dB recommended when only noise present Green when good Red when clipping may occur @@ -2866,17 +3927,17 @@ Yellow when too low 黄:過少 - + DX Call DXコール - + DX Grid DXグリッド - + Callsign of station to be worked 交信相手コールサイン @@ -2885,17 +3946,17 @@ Yellow when too low データベース内でコールサイン検索 - + &Lookup 検索(&L) - + Locator of station to be worked 交信相手のロケータ - + Az: 251 16553 km Az: 251 16553 km @@ -2904,7 +3965,7 @@ Yellow when too low データベースへコールサインとロケータを追加 - + Add 追加 @@ -2913,172 +3974,184 @@ Yellow when too low 出力 - + <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> <html><head/><body><p>黄色か赤色の場合無線機制御にエラーあり. リセットを押しダイヤル周波数を読み込む. Sはスプリット.</p></body></html> - + If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. 黄色か赤色の場合無線機制御にエラーあり. リセットを押しダイヤル周波数を読み込む. Sはスプリット. - + ? ? - + Adjust Tx audio level 送信オーディオレベル調整 - + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> <html><head/><body><p>バンドを選びMHz単位で周波数を入力するか差分をkHz単位(最後にkをつける)で入力.</p></body></html> - + Frequency entry 周波数入力 - + Select operating band or enter frequency in MHz or enter kHz increment followed by k. バンドを選びMHz単位で周波数を入力するか差分をkHz単位(最後にkをつける)で入力. - + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> - + <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> <html><head/><body><p>デコードした文をダブルクリックしたときに送信周波数を動かさない.</p></body></html> - + Check to keep Tx frequency fixed when double-clicking on decoded text. デコードした文をダブルクリックしたときに送信周波数を動かさない. - + Hold Tx Freq 送信周波数固定 - + + Audio Rx frequency 受信オーディオ周波数 - - - - - - + + + + + + + + Hz Hz - - + + + Rx Rx - - + + + + Set Tx frequency to Rx Frequency 送信周波数を受信周波数へコピー - + + ▲ - + + Frequency tolerance (Hz) 許容周波数(Hz) - - + + + F Tol F Tol - - + + + + Set Rx frequency to Tx Frequency 受信周波数を送信周波数へコピー - + + ▼ - + <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> <html><head/><body><p>同期信号閾値. 小さい値ほど弱い同期信号を検出.</p></body></html> - + Synchronizing threshold. Lower numbers accept weaker sync signals. 同期信号閾値. 小さい値ほど弱い同期信号を検出. - + Sync 同期 - + <html><head/><body><p>Check to use short-format messages.</p></body></html> <html><head/><body><p>短いメッセージフォーマットを使うときはチェック.</p></body></html> - + Check to use short-format messages. 短いメッセージフォーマットを使うときはチェック. - + Sh Sh - + <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> <html><head/><body><p>JT9高速モードをオン</p></body></html> - + Check to enable JT9 fast modes JT9高速モードをオン - - + + Fast 高速 - + <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> <html><head/><body><p>チェックすることで受信したメッセージに基づき自動的に送信メッセージを生成する.</p></body></html> - + Check to enable automatic sequencing of Tx messages based on received messages. 受信メッセージに合わせて送信メッセージ自動生成. - + Auto Seq 自動シーケンス @@ -3095,12 +4168,12 @@ Yellow when too low コール 1st - + Check to generate "@1250 (SEND MSGS)" in Tx6. Tx6に "@1250 (SEND MSGS)" を生成. - + Tx6 Tx6 @@ -3113,90 +4186,90 @@ Yellow when too low チェックすると偶数分の0秒から送信開始.チェックを外すと奇数分. - + Tx even/1st Tx even/1st - + <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> <html><head/><body><p>現在の周波数からkHz上でCQをコール</p></body></html> - + Frequency to call CQ on in kHz above the current MHz 現在の周波数からkHz上でCQをコール - + Tx CQ Tx CQ - + <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> <html><head/><body><p>チェックすると &quot;Tx CQ&quot; 周波数でCQをコール. 受信は現在の周波数. 相手局がどの周波数で呼べばよいが分かるようにCQメッセージに現在の受信周波数を含める.</p><p>非標準コールには非対応.</p></body></html> - + Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. Not available to nonstandard callsign holders. チェックすると "Tx CQ" 周波数でCQをコール. 受信は現在の周波数. 相手局がどの周波数で呼べばよいが分かるようにCQメッセージに現在の受信周波数を含める. 非標準コールには非対応. - + Rx All Freqs - + <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> <html><head/><body><p>サブモードはトーン間隔を意味する.Aが一番狭い.</p></body></html> - + Submode determines tone spacing; A is narrowest. サブモードはトーン間隔を意味する.Aが一番狭い. - + Submode サブモード - - + + Fox Fox - + <html><head/><body><p>Check to monitor Sh messages.</p></body></html> <html><head/><body><p>Shメッセージをモニターする.</p></body></html> - + Check to monitor Sh messages. Shメッセージをモニターする. - + SWL SWL - + Best S+P Best S+P - + <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> <html><head/><body><p>ここをチェックして較正データを録音開始.<br/>測定中は較正処理は停止します.<br/>チェックをはずすと較正結果を見ることができます.</p></body></html> - + Check this to start recording calibration data. While measuring calibration correction is disabled. When not checked you can view the calibration results. @@ -3205,44 +4278,44 @@ When not checked you can view the calibration results. チェックしないと較正結果を表示. - + Measure 測定 - + <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> <html><head/><body><p>シグナルレポート: 2500Hzバンド幅におけるSN比(dB).</p></body></html> - + Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). シグナルレポート: 2500Hzパスバンド幅におけるSN比(dB). - + Report レポート - + <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> <html><head/><body><p>送信/受信または周波数較正の時間</p></body></html> - + Tx/Rx or Frequency calibration sequence length Tx/Rxまたは周波数較正時間長 - - + + s s - - + + T/R T/R @@ -3251,18 +4324,20 @@ When not checked you can view the calibration results. 送信モードをトグル - + + Audio Tx frequency 送信オーディオ周波数 - - + + + Tx Tx - + Tx# Tx# @@ -3271,12 +4346,12 @@ When not checked you can view the calibration results. <html><head/><body><p>ダブルクリックして次のQSOの待ち行列に加える.</p></body></html> - + F High - + F Low @@ -3289,156 +4364,152 @@ When not checked you can view the calibration results. 次のコール - - - + + + 1 1 - - - + + + Send this message in next Tx interval このメッセージを次回送信する - + Ctrl+2 - + <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> <html><head/><body><p>このメッセージを次回送信する</p><p>ダブルクリックしてTx1メッセージとしてQSOを開始のオンオフ(タイプ1複合コールサインでは使えません)</p></body></html> - + Send this message in next Tx interval Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) >このメッセージを次回送信する. ダブルクリックしてTx1メッセージとしてQSOを開始のオンオフ(タイプ1複合コールサインでは使えません) - + Ctrl+1 - - - - + + + + Switch to this Tx message NOW 直ちにこの送信メッセージに切り替え - + Tx &2 - + Alt+2 - + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> <html><head/><body><p>直ちにこの送信メッセージに切替</p><p>ダブルクリックすることでTx1メッセージを使うかどうか選択(タイプ1複合コールサインには使えません)</p></body></html> - + Switch to this Tx message NOW Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) 直ちにこの送信メッセージに切替. ダブルクリックすることでTx1メッセージを使うかどうか選択(タイプ1複合コールサインには使えません) - + Tx &1 - + Alt+1 - + Ctrl+6 - + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> <html><head/><body><p>このメッセージを次回送信</p><p>ダブルクリックして標準73メッセージにリセット</p></body></html> - + Send this message in next Tx interval Double-click to reset to the standard 73 message このメッセージを次回送信 ダブルクリックして標準73メッセージにリセット - + Ctrl+5 - + Ctrl+3 - + Tx &3 - + Alt+3 - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>このメッセージを次回送信</p><p>ダブルクリックするとTx4でRRRかRR73を送るかを切り替え(タイプ2複合コールサインでは使えません)</p><p>RR73 メッセージは、相手が確実にコピーしたと考えられるときに使ってください</p></body></html> + <html><head/><body><p>このメッセージを次回送信</p><p>ダブルクリックするとTx4でRRRかRR73を送るかを切り替え(タイプ2複合コールサインでは使えません)</p><p>RR73 メッセージは、相手が確実にコピーしたと考えられるときに使ってください</p></body></html> - Send this message in next Tx interval Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - このメッセージを次回送信 + このメッセージを次回送信 ダブルクリックするとTx4でRRRかRR73を送るかを切り替え(タイプ2複合コールサインでは使えません) RR73 メッセージは、相手が確実にコピーしたと考えられるときに使ってください - + Ctrl+4 - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>直ちにこの送信メッセージに切替</p><p>ダブルクリックしてTx4のRRRとRR73を交互切り替え(タイプ2の複合コールサインでは使えません)</p><p>RR73は、双方ともメッセージを確認し、繰り返しが必要ないと考えうるときにのみ使いましょう</p></body></html> + <html><head/><body><p>直ちにこの送信メッセージに切替</p><p>ダブルクリックしてTx4のRRRとRR73を交互切り替え(タイプ2の複合コールサインでは使えません)</p><p>RR73は、双方ともメッセージを確認し、繰り返しが必要ないと考えうるときにのみ使いましょう</p></body></html> - Switch to this Tx message NOW Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - 直ちにこの送信メッセージに切替 + 直ちにこの送信メッセージに切替 ダブルクリックするとTx4でRRRかRR73を送るかを切り替え(タイプ2複合コールサインでは使えません) RR73 メッセージは、相手が確実にコピーしたと考えられるときに使ってください - + Tx &4 - + Alt+4 @@ -3452,42 +4523,42 @@ Double-click to reset to the standard 73 message このメッセージをすぐに送信. ダブルクリックして標準73メッセージにリセット - + Tx &5 - + Alt+5 - + Now - + Generate standard messages for minimal QSO 最短QSO用メッセージを生成 - + Generate Std Msgs 標準メッセージ生成 - + Tx &6 - + Alt+6 - + Enter a free text message (maximum 13 characters) or select a predefined macro from the dropdown list. Press ENTER to add the current text to the predefined @@ -3498,53 +4569,53 @@ ENTERを押してテキストを登録リストに追加. リストは設定(F2)で変更可能. - + Queue up the next Tx message 次の送信メッセージを待ち行列に追加 - + Next 次 - - - - - - + + + + + + 2 - + Quick-Start Guide to FST4 and FST4W FST4とFST4Wのクイックスタートガイド - + FST4 FST4 - + FST4W FST4W - - + + Q65 Q65 - + SWL Mode SWLモード - + Hide lower panel controls to maximize deocde windows 下部制御パネルを非表示にしてデコードウィンドウを最大化 @@ -3557,8 +4628,9 @@ ENTERを押してテキストを登録リストに追加. CQメッセージ生成 - - + + + CQ CQ @@ -3579,7 +4651,7 @@ ENTERを押してテキストを登録リストに追加. CQに応答するメッセージを生成 - + Grid グリッド @@ -3612,133 +4684,133 @@ ENTERを押してテキストを登録リストに追加. 最大dB - + CQ AF - + CQ AN - + CQ AS - + CQ EU - + CQ NA - + CQ OC - + CQ SA - + CQ 0 - + CQ 1 - + CQ 2 - + CQ 3 - + CQ 4 - + CQ 5 - + CQ 6 - + CQ 7 - + CQ 8 - + CQ 9 - + Reset リセット - + N List リスト数 - + N Slots スロット数 - - - - - - - + + + + + + + Random ランダム - + Call - + S/N (dB) - + Distance 距離 - + More CQs これは何?チェックすると5回の送信に1回CQを出す CQ多め @@ -3748,1130 +4820,1311 @@ ENTERを押してテキストを登録リストに追加. 2分の送信に費やすパーセンテージ. - - + + % % - + Tx Pct Tx Pct - + Band Hopping バンドホッピング - + Choose bands and times of day for band-hopping. バンドホッピングためのバンドと時間を選択. - + Schedule ... スケジュール .... - + 1/2 1/2 - + 40 40 - - - + + + 10 10 - + 17 17 - + 60 60 - - + + 12 12 - + 160 160 - + 20 20 - + 80 80 - - + + 70 70 - + 15 15 - + 30 30 - - - - + + + + 6 6 - + 24G 24G - + 10G 10G - + 5G 5G - - - + + + 9 9 - + 13 13 - + 23 23 - + 33 33 - + 1.25 1.25 - - + + 4 4 - - + + 8 8 - + CQ messages only. CQメッセージのみ. - + Bypass Filters toggled via Settings or the Filters menu. 設定またはフィルタメニューによるバイパスフィルタがトグルされた。 - + BP BP - + <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> <html><head/><body><p>モニタのオン/オフ切り替え. <br>wavファイルに保存中は黄色.</p></body></html> - + Avg Avg - + <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> <html><head/><body><p>単一トーンのオンオフ切り替え<br>右クリックでリグのチューン</p></body></html> - + <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> <html><head/><body><p>Toggle Wait &amp; Call On/Off. 右クリックで DX Call boxクリア.</p></body></html> - + <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> <html><head/><body><p>データベース内コールサイン検索. <br>右クリックはQRZ.comでコールサイン検索.</p></body></html> - + <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> <html><head/><body><p>コールサインとロケータをデータベースへ追加. <br>右クリックでコールサインを hamqth.comで検索.</p></body></html> - + <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> <html><head/><body><p>コールサインを無視リストに登録.<br>右クリックでコールサインを qrzcq.com検索.</p></body></html> - + Ignore 無視 - + Pwr - <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the the strongest station's reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the the weakest station's reply to your CQ. </p></body></html> - <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> 相手局手動選択.</p><p>Select <span style=" font-weight:600;">CQ: First</span> CQに応答してきて最初にデコードできた局へ自動応答. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> ARRL International Digital Contestで一番得点の高い曲に自動応答, または、最も遠くのグリッドロケータをもった局.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> CQに応答してきた最も強い局へ自動応答. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> CQに応答してきた最も弱い局へ自動応答. </p></body></html> + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> 相手局手動選択.</p><p>Select <span style=" font-weight:600;">CQ: First</span> CQに応答してきて最初にデコードできた局へ自動応答. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> ARRL International Digital Contestで一番得点の高い曲に自動応答, または、最も遠くのグリッドロケータをもった局.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> CQに応答してきた最も強い局へ自動応答. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> CQに応答してきた最も弱い局へ自動応答. </p></body></html> - - + + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> <html><head/><body><p>チェックを入れると、0分から始まる偶数の分またはシーケンスで送信します. チェックを外すと奇数のシーケンスで送信します. 右クリックすると、このチェックボックスの状態を固定できます. 固定を解除するには、FT8 または MSK ボタンを右クリックしてください.</p></body></html> - + <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> <html><head/><body><p>T/R 15 s Submode Cへ切替.</p></body></html> - + 15C 15C - + <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> <html><head/><body><p>T/R 15 s Submode Aへ切替.</p></body></html> - + 15A 15A - + <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> <html><head/><body><p>T/R 30 s Submode Bへ切替.</p></body></html> - + 30B 30B - + <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> <html><head/><body><p>T/R 60 s Submode Cへ切替.</p></body></html> - + 60C 60C - + <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> <html><head/><body><p>T/R 60 s Submode Dへ切替.</p></body></html> - + 60D 60D - + <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> <html><head/><body><p>T/R 60 s Submode Eへ切替.</p></body></html> - + 60E 60E - - + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> <html><head/><body><p>即座にこの送信メッセージへ切替</p><p>ダブルクリックで標準73メッセージへリセット</p><p>右クリックで Tx5 フリーテキスト保持</p></body></html> - + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> <html><head/><body><p>次回送信時にフリーテキストを送出.</p></body></html> - + Send msg - + <html><head/><body><p>Enter a free text message.</p></body></html> <html><head/><body><p>フリーテキストメッセージを入力.</p></body></html> - + Free Text 任意のテキスト - + <html><head/><body><p>Select a specific CQ message.</p></body></html> <html><head/><body><p>送信したいCQメッセージを選択してください.</p></body></html> - + Queue 待ち - + Allow Dupes 重複を許す - + <html><head/><body><p>Clear all queues.</p></body></html> <html><head/><body><p>全ての待ち行列をクリア.</p></body></html> - + <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> <html><head/><body><p>順番待ちリストに表示されるコールサイン数の上限.</p></body></html> - + <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> <html><head/><body><p>待ちリスト中の局を表示する順番を選択.</p></body></html> - + Age - + Continent 大陸 - + Score スコア - + <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> <html><head/><body><p>CQを他のメッセージに含める.</p></body></html> - + In Progress 処理中 - + <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> <html><head/><body><p>Fox送信の最大同時ストリーム数.</p></body></html> - - - - + + + + 3 3 - + 70cm FT8 - + 70cm - + 30m FT8 - + 30m 30m - + <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> <html><head/><body><p>バンドホッピングのオン/オフを切り替えます. バンドホッピングは 2 分ごとに発生します. チェックボックスの変更は即座に有効になります.<br/>右クリックすると、バンドホッピングが無効になっている場合はデフォルトのオーディオデバイスをテストするか、または次に選択されたバンドホッピング周波数に切り替わります.</p></body></html> - + Band Hopping バンドホッピング - + 12m FT8 - + 12m 12m - + 40m FT8 - + 40m 40m - + 2m MSK144 - + 2m MSK - + 10m FT8 - + 10m 10m - + 6m FT8 - + 6m 6m - + 60m FT8 - + 60m 60m - + 160m FT8 - + 160m 160m - + 80m FT8 - + 80m 80m - + 20m FT8 - + 20m 20m - + 17m FT8 - + 17m 17m - + 4m FT8 - + 4m 4m - + 15m FT8 - + 15m 15m - + 2m FT8 - + 2m 2m - - + + 10m FT4 - - + + 12m FT4 - - + + 15m FT4 - - + + 17m FT4 - - + + 20m FT4 - - + + 30m FT4 - - + + 40m FT4 - - + + 80m FT4 - + FT8 QRG6 - + FT8 QRG1 - + FT8 QRG2 - + FT8 QRG7 - + FT8 QRG8 in kHz. - + FT8 QRG5 - + FT8 QRG3 - + FT8 QRG4 - + FT8 QRG8 - + FT8 QRG7 in kHz. - + FT8 QRG6 in kHz. - + FT8 QRG5 in kHz. - + FT8 QRG4 in kHz. - + FT8 QRG3 in kHz. - + FT8 QRG2 in kHz. - + FT8 QRG1 in kHz. - + + GroupBox + + + + + CQ %M CQ + + + + + %H 599 %N + + + + + %H TU CQ %M CQ + + + + + %M + + + + + %H + + + + + TU NOW %Q 599 %N + + + + + %H AGN? + + + + + 599 %N + + + + + F1 + + + + + HisCall Exchange + + + + + F2 + + + + + TU CQ + + + + + F3 + + + + + MyCall + + + + + F4 + + + + + HisCall + + + + + F5 + + + + + Now QueuedCall Exchange + + + + + F6 + + + + + HisCall AGN ? + + + + + Exchange + + + + + Serial number of QSO for contest exchange. + + + + + Click to transmit a message. + + + + + Send message + + + + + Call next + + + + + Message to be transmitted + + + + + Serial Number + + + + + Callsign to be worked next. + + + + 2/2 2/2 - + 1/3 1/3 - + 2/3 2/3 - + 3/3 3/3 - + 1/4 1/4 - + 2/4 2/4 - + 3/4 3/4 - + 4/4 4/4 - + 1/5 1/5 - + 2/5 2/5 - + 3/5 3/5 - + 4/5 4/5 - + 5/5 5/5 - + 1/6 1/6 - + 2/6 2/6 - + 3/6 3/6 - + 4/6 4/6 - + 5/6 5/6 - + 6/6 6/6 - + Upload decoded messages to WSPRnet.org. デコードしたメッセージをWSPRnet.orgへアップロード. - + Upload spots スポットをアップロード - + <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> <html><head/><body><p>6桁のグリッドロケーターは2回のメッセージで送られます, 2回目のメッセージで6桁全部送られますが、コールサインはハッシュになります, 相手局は1回目であなたのコールサインをコピーしていなければなりません.. このオプションをチェックすると4桁のグリッドロケーターしか送らず、6桁のグリッドロケーターを送るための2回のメッセージ送信は行いません.</p></body></html> - + 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. 6桁のグリッドロケーターは2回のメッセージで送られます, 2回目のメッセージで6桁全部送られますが、コールサインはハッシュになります, 相手局は1回目であなたのコールサインをコピーしていなければなりません.. このオプションをチェックすると4桁のグリッドロケーターしか送らず、6桁のグリッドロケーターを送るための2回のメッセージ送信は行いません. - + + Ctrl+X + + + + + Alt+X + + + + Don't split ALL.TXT ALL.TXTを分割しない - + Split ALL.TXT yearly ALL.TXTを年ごとに分割 - + Split ALL.TXT monthly ALL.TXTを月ごとに分割 - + Disable writing of ALL.TXT ALL.TXTへ書き込み中止 - + Active Stations アクティブな局 - + Band Buttons バンドボタン - + Use Dark Style ダークスタイルを使用 - + Reduce false decodes Falseデコードを軽減 - + Default event logging デフォルトイベント記録 - + Diagnostic mode 診断モード - + Disable event logging イベント記録をオフ - + Quick-Start Guide to WSJT-X 2.7 and QMAP WSJT-X 2.7 と QMAPのクイックスタートガイド - - WSJT-X_improved Home Page - WSJT-X_improvedのホームページ + + Download EME Ephemeris Chart + - - <html><head/><body><p>Go to the wsjt-x_improved home page.</p></body></html> - <html><head/><body><p>wsjt-x_improvedのホームページへ.</p></body></html> + + Hide AP information + - - The additional features of wsjt-x_improved - wsjt-x_improvedの追加機能 + + <html><head/><body><p>Hide AP information</p></body></html> + - - <html><head/><body><p>Overview on the additional features of wsjt-x_improved.</p></body></html> - <html><head/><body><p>wsjt-x_improvedの追加機能の概略.</p></body></html> + + Highlight Whitelist entries + + + + + JTTY + - Recommended audio settings - 推奨オーディオ設定 + 推奨オーディオ設定 - <html><head/><body><p>Recommended Audio Settings.</p></body></html> - <html><head/><body><p>推奨オーディオ設定.</p></body></html> + <html><head/><body><p>推奨オーディオ設定.</p></body></html> - + How to deal with rig control errors リグ制御エラーの対処方法 - + <html><head/><body><p>How to deal with rig control errors.</p></body></html> <html><head/><body><p>リグ制御エラーの対処方法.</p></body></html> - + Erase list of Q65 callers Q65 callersの削除リスト - + SuperFox User Guide SuperFoxユーザガイド - + Message Creator メッセージ生成機能 - + Hide stations worked before on band バンドで交信済みの局を隠す - + Hide stations worked today or yesterday 今日または昨日交信した局を隠す - + Hide stations from Ignore List 無視リストに載っている局を隠す - + Ignore stations worked today or yesterday 昨日または今日交信した局を無視 - + Ignore stations from Ignore List 無視リストに載っている局を無視 - + Hide stations from Territory 1 Territory 1の局を隠す - + Hide stations from Territory 2 Territory 2の局を隠す - + Hide stations from Territory 3 Territory 3の局を隠す - + Hide stations from Territory 4 Territory 4の局を隠す - + Hide stations from Europe ヨーロッパの局を隠す - + Hide stations from North America 北米の局を隠す - + Hide stations from South America 南米の局を隠す - + Hide stations from Asia アジアの局を隠す - + Hide stations from Africa アフリカの局を隠す - + Hide stations from Oceania オセアニアの局を隠す - + Hide stations from Antarctica 南極の局を隠す - + Full Duplex Mode フルデュープレックスモード - + Highlight callsigns worked before on band このバンドで交信済みの局をハイライト - + Highlight callsigns worked today or yesterday 今日または昨日交信した局をハイライト - + Highlight callsigns from Ignore List 無視リストの局をハイライト - + Enable Message Popups メッセージポップアップを許可 - + QSY Monitor QSYモニター - + Ignore stations worked before on band バンドで交信済みの局を無視 - + Use multithreaded FT8 decoder マルチスレッドFT8デコーダを使用 - + Auto - - + + 5 5 - - + + 7 7 - - + + 11 11 - + Low - + Medium - + High - + Minimum - + Use low thresholds 低閾値を使用 - + Use subpass サブパスを使用 - + 2-Stage 2ステージ - + 3-Stage 3ステージ - + Early - + Late - + Wideband DX Call search ワイドバンドDXコールサーチ - + Hide FT8 dupe messages FT8の重複メッセージを隠す - + VHF / UHF Buttons VHF / UHFボタン - + Highlight stations from Territory 1 Territory 1の局をハイライト - + Highlight stations from Territory 2 Territory 2の局をハイライト - + Highlight stations from Territory 3 Territory 3の局をハイライト - + Highlight stations from Territory 4 Territory 4の局をハイライト - + Disable clicks on waterfall ウォーターフォール上でのクリックをオフ @@ -4880,7 +6133,7 @@ ENTERを押してテキストを登録リストに追加. タイプ1メッセージを使う - + No own call decodes 自分のコールサインをデコードしない @@ -4889,152 +6142,149 @@ ENTERを押してテキストを登録リストに追加. 次の2分送信シーケンスの間に送信. - + Tx Next 次のTx - + Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. dBm単位の送信出力をWSPRメッセージに入れる. - + NB NB - + File ファイル - + View 表示 - + Decode デコード - + Save 保存 - + Help ヘルプ - + + Mode モード - + Configurations コンフィグレーション - + Tools ツール - + Exit 終了 + Configuration - コンフィグレーション + コンフィグレーション - + About WSJT-X WSJT-Xについて - + Waterfall ウォーターフォール - + Open 開く - + Ctrl+O - + Open next in directory ディレクトリ中の次のファイルを開く - + Decode remaining files in directory ディレクトリ中の残りのファイルをデコード - - Shift+F6 - - - - + Delete all *.wav && *.c2 files in SaveDir SaveDirのすべての*.wavと*.c2ファイルを削除 - + None 無し - + Save all すべて保存 - + Online User Guide オンラインユーザーガイド - + Keyboard shortcuts キーボードショートカット - + Special mouse commands 特別なマウス操作 - + JT9 - + Save decoded デコードしたメッセージを保存 - - + + Normal 標準 - + Deep ディープ @@ -5043,12 +6293,12 @@ ENTERを押してテキストを登録リストに追加. 起動時モニターオフ - + Erase ALL.TXT ALL.TXTを消去 - + Erase wsjtx_log.adi wsjtx_log.adiを消去 @@ -5081,7 +6331,7 @@ ENTERを押してテキストを登録リストに追加. コールサインをダブルクリックして送信オン - + F7 @@ -5102,8 +6352,8 @@ ENTERを押してテキストを登録リストに追加. 送信周波数を受信周波数にロック - - + + JT65 @@ -5116,263 +6366,339 @@ ENTERを押してテキストを登録リストに追加. DXCCエンティティと交信済みステータスを表示 - + Astronomical data 天文データ - + List of Type 1 prefixes and suffixes タイプ1プリフィックス、サフィックスのリスト - + Settings... 設定... - + Local User Guide 各国版ユーザーガイド - + Open log directory ログディレクトリを開く - + JT4 - + Message averaging メッセージ平均化 - + Enable averaging 平均化オン - + Enable deep search ディープサーチをオン - + WSPR WSPR - + Echo Graph エコーグラフ - + F8 - - + + Echo Echo - + Spacing スペース - + + WSJT-X by K1JT et al. + + + + + Band Activity decode pane title + + + + + Title for the Band Activity decoded messages pane. + + + + + Band Activity decoded messages headings + + + + + + Columns: UTC dB DT Freq Message. + + + + + Band Activity decoded messages + + + + + Decoded messages in the Band Activity pane. Columns: UTC dB DT Freq Message. + + + + + Rx Frequency decode pane title + + + + + Title for the Rx Frequency decoded messages pane. + + + + + Rx Frequency decoded messages headings + + + + + Rx Frequency decoded messages + + + + + Decoded messages in the Rx Frequency pane. Columns: UTC dB DT Freq Message. + + + + + Check to display received messages in lower case. + + + + + Lower case + + + + + Include Time + + + + + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the strongest station's reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the weakest station's reply to your CQ.</p><p>When CQ or QRZ is pending, Enable Tx may be armed before or during a receive period. Only eligible direct callers decoded after it is armed in that period can replace the pending transmission; earlier callers are not retained.</p></body></html> + + + + Fixed Tone 一定トーン - + K1JT - + CW - + Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. FT8 hound modeをオンオフ.<br>右クリックでSuperFoxモードをオンオフ. - + H - + Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. FT8 モードへ切替.<br>右クリックで最後に使ったコンテストモードをオンオフ. - + Switch to FT4 mode FT4モードへ変更 - + Switch to MSK144 mode MSK144モードへ変更 - + MSK - + <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> <html><head/><body><p>Q65モードへ切替.<br> 右クリックでQ65パイルアップモードへ切替.</p></body></html> - + <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> <html><head/><body><p>JT65モードへ切替.<br>右クリックでJT9モードへ切替.</p></body></html> - + <html><head/><body><p>Switch to Echo mode</p></body></html> <html><head/><body><p>Echoモードへ切替</p></body></html> - + Filters フィルタ - + Parameters パラメータ - + Decoder sensitivity デコーダ感度 - + Decoder start デコーダスタート - + Number of threads スレッド数 - + QSO RX freq sensitivity QSO受信周波数感度 - + Decoding cycles デコード回数 - + Remove saved files after 30 days 30日後に保存したファイルを消去 - + Erase wsjtx.log wsjtx.logを消去 - + Erase Ignore List 無視リストを消去 - + EME Echo mode EMEエコーモード - + ISCAT - + Fast Graph 高速グラフ - - F9 - - - - + &Download Samples ... サンプルをダウンロード(&D)... - + <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> <html><head/><body><p>いろいろなモードのオーディオファイルをダウンロード.</p></body></html> - + MSK144 - + QRA64 - + Release Notes リリースノート - + Enable AP for DX Call DXコールのAPをオン - + FreqCal - + Measure reference spectrum 参照スペクトラムを測定 - + Measure phase response 位相応答を測定 - + Erase reference spectrum 参照スペクトラムを消去 - + Execute frequency calibration cycle 周波数較正実行 - + Equalization tools ... イコライザー... @@ -5385,49 +6711,49 @@ ENTERを押してテキストを登録リストに追加. 実験的LF/MFモード - - + + FT8 - - + + Enable AP AP使用 - + Solve for calibration parameters 較正パラメータ計算 - + Copyright notice 著作権表示 - + Shift+F1 - + Fox log Foxログ - + FT8 DXpedition Mode User Guide FT8 DXペディションモードユーザーガイド - + Reset Cabrillo log ... Cabrilloログをリセット... - + Color highlighting scheme ハイライト設定 @@ -5436,7 +6762,7 @@ ENTERを押してテキストを登録リストに追加. コンテストログ - + Export Cabrillo log ... Cabrilloログをエクスポート... @@ -5445,35 +6771,35 @@ ENTERを押してテキストを登録リストに追加. WSJT-X 2.0クイックスタートガイド - + Contest log コンテストログ - + Erase WSPR hashtable WSPRハッシュテーブルを消去 - - + + FT4 - + Rig Control Error 無線機制御エラー - - - + + + Receiving 受信中 - + Do you want to reconfigure the radio interface? 無線機インターフェイスを再構成しますか? @@ -5498,184 +6824,201 @@ ENTERを押してテキストを登録リストに追加. サンプル大量欠落 - %3から始まる%1個(%2秒)のオーディオフレームが欠落 - + Error Scanning ADIF Log ADIFログスキャンエラー - + Scanned ADIF log, %1 worked-before records created. CTY: %2 ADIFログ検索結果, 記録作成前%1交信済み、CTY: %2 - + Error Loading LotW Users Data LotWユーザデータをロードできません - + + + + Decoder Error + + + + + The decoder subprocess exited unexpectedly. + + + + + jt9 exited unexpectedly with code %1. + + + + + Error Writing WAV File WAVファイルを書き込みできません - + Enumerating audio devices オーディオデバイスを列挙 - + Configurations... コンフィグレーション... - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Message メッセージ - + Error Killing jt9.exe Process jt9.exeプロセスを終了できません - + KillByName return code: %1 KillByNameリターンコード: %1 - + Error removing "%1" "%1"を削除できません - + Click OK to retry OKを押して再試行 - - + + %1.wav: invalid sample count %2 + + + + + Improper mode 不適切なモード - - + + File Open Error ファイルオープンエラー - - - - - + + + + + Cannot open "%1" for append: %2 "%2"を追加する"%1"が開けません - + Error saving c2 file c2ファイルを保存できません - + Error in Sound Input サウンド入力にエラー発生 - + Error in Sound Output サウンド出力にエラー発生 - - + + Single-Period Decodes シングルパスデコード - - + + Average Decodes 平均デコード - + Change Operator オペレータ交代 - + New operator: 新オペレータ: - + Status File Error ステータスファイルエラー - - + + Cannot open "%1" for writing: %2 %2を書き込むための"%1"が開けません - + Decodes containing My Call Not sure what exactly this means My Callをデコード - + Subprocess Error サブプロセスエラー - + Subprocess failed with exit code %1 サブプロセスエラー 終了コード %1 - - + + Running: %1 %2 実行中: %1 %2 - + Subprocess error サブプロセスエラー - Reference spectrum saved - 参照用スペクトラムを保存しました + 参照用スペクトラムを保存しました - It is very important to avoid audio harmonics and distorted audio signals. This is usually achieved by the following step-by-step approach: @@ -5699,7 +7042,7 @@ This is usually achieved by the following step-by-step approach: If possible, check your transmission from time to time with a webSDR to ensure the signal is clean and not distorted. - オーディオの高調波や歪みを発生させないことはとても重要です. + オーディオの高調波や歪みを発生させないことはとても重要です. 以下の手順を参考にしてください: 1. スプリットモードとして、Settings/RadioメニューのFake itを選択. もしあなたの @@ -5724,22 +7067,21 @@ to ensure the signal is clean and not distorted. 確かめるため、時々 webSDRでチェックしてください. - <b>Recommended Audio Settings</b> - <b>推奨オーディオ設定</b> + <b>推奨オーディオ設定</b> - + Invalid data in fmt.all at line %1 fmt.allの%1行目に無効なデータ - + Good Calibration Solution 較正良好 - + <pre>%1%L2 ±%L3 ppm %4%L5 ±%L6 Hz @@ -5748,26 +7090,24 @@ to ensure the signal is clean and not distorted. - + Delete Calibration Measurements 較正の測定結果を削除 - + The "fmt.all" file will be renamed as "fmt.bak" "fmt.all"は"fmt.bak"に名前が変わります - If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: "The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2025 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; and other members of the WSJT Development Group." - GNU General Public Licenseに準拠し、WSJT-Xコードのいかなる部分を利用するときは, あなたの二次的著作物には、以下の著作権表示を明確に表示しなければなりません: + GNU General Public Licenseに準拠し、WSJT-Xコードのいかなる部分を利用するときは, あなたの二次的著作物には、以下の著作権表示を明確に表示しなければなりません: "The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2025 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; and other members of the WSJT Development Group." - <table cellspacing=1> <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> @@ -5818,7 +7158,7 @@ to ensure the signal is clean and not distorted. </table> Keyboard shortcuts help window contents - <table cellspacing=1> + <table cellspacing=1> <tr><td><b>Esc </b></td><td>送信停止、QSO 中止、次のコールキューをクリア</td></tr> <tr><td><b>F1 </b></td><td>オンラインユーザーガイドを開く(Alt: Tx6 送信)</td></tr> <tr><td><b>Shift+F1 </b></td><td>著作権表示</td></tr> @@ -5869,7 +7209,6 @@ to ensure the signal is clean and not distorted. </table> - <table cellpadding=5> <tr> <th align="right">Click on</th> @@ -5982,7 +7321,7 @@ to ensure the signal is clean and not distorted. </tr> </table> Mouse commands help window contents - <table cellpadding=5> + <table cellpadding=5> <tr> <th align="right">マウスクリック</th> <th align="left">動作</th> @@ -6093,7 +7432,7 @@ to ensure the signal is clean and not distorted. </table> - + Please choose another dial frequency. Must be 3Khz away from %1. WSJT-X will not operate in Fox mode @@ -6104,12 +7443,414 @@ WSJT-XのFoxモードは標準FT8サブバンド と重なることはできません. - + + %1 shorthand-message mode + + + + + RR73 is not available in %1. Tx4 uses RRR in this mode. + + + + + Wait & Pounce requires a CQ response mode. +Change CQ: None to another option. + + + + + DX call + + + + + Callsign of station to be worked. + + + + + DX grid + + + + + Locator of station to be worked. + + + + + Wait and Call + + + + + Lookup DX call + + + + + Add DX call + + + + + Ignore DX call + + + + + CQ response mode + + + + + Selects a station automatically from replies to your pending CQ after Enable Tx is armed in the current receive period, or from CQ messages for Wait & Pounce. + + + + + Transmit audio frequency + + + + + Receive audio frequency + + + + + Signal report + + + + + Operating band + + + + + Operating band text + + + + + Transmit power attenuation + + + + + Adjust Tx audio level attenuation. + + + + + Show or hide the menu bar. + + + + + Rig control status + + + + + Hound mode + + + + + Toggle FT8 hound mode. Right-click to toggle SuperFox mode. + + + + + Message panel selector + + + + + Switches between standard messages, Fox queue, and band hopping pages. Press 1, 2, or 3 while focused to select a page. + + + + + Standard messages + + + + + Fox queue + + + + + + Band hopping + + + + + Standard messages page + + + + + Fox queue page + + + + + Band hopping page + + + + + Hound queue + + + + + Queued Hound callers available for Fox transmissions. + + + + + Fox transmissions in progress + + + + + Hound callers currently in progress for Fox transmissions. + + + + + Hound queue sort order + + + + + Hound queue list size + + + + + Fox transmission slots + + + + + Fox CQ message + + + + + Reset Fox queues + + + + + Fox free text + + + + + Send Fox free text + + + + + Enable FT8 QRG 1 + + + + + Enable FT8 QRG 2 + + + + + Enable FT8 QRG 3 + + + + + Enable FT8 QRG 4 + + + + + Enable FT8 QRG 5 + + + + + Enable FT8 QRG 6 + + + + + Enable FT8 QRG 7 + + + + + Enable FT8 QRG 8 + + + + + FT8 QRG 1 frequency + + + + + FT8 QRG 2 frequency + + + + + FT8 QRG 3 frequency + + + + + FT8 QRG 4 frequency + + + + + FT8 QRG 5 frequency + + + + + FT8 QRG 6 frequency + + + + + FT8 QRG 7 frequency + + + + + FT8 QRG 8 frequency + + + + + Tx1 message + + + + + Tx2 message + + + + + Tx3 message + + + + + Tx4 message + + + + + Tx5 message macro + + + + + Tx6 message + + + + + Tx5 message macro text + + + + + Select Tx1 for next transmission + + + + + Select Tx2 for next transmission + + + + + Select Tx3 for next transmission + + + + + Select Tx4 for next transmission + + + + + Select Tx5 for next transmission + + + + + Select Tx6 for next transmission + + + + + Transmit Tx1 now + + + + + Transmit Tx2 now + + + + + Transmit Tx3 now + + + + + Transmit Tx4 now + + + + + Transmit Tx5 now + + + + + Transmit Tx6 now + + + + + All Decodes + + + + + QSO Frequency + + + + %1 W - + SWR > 2.5 !!! Transmission was stopped @@ -6122,59 +7863,132 @@ Check your antenna アンテナをチェックしてください - + + + Stop transmitting or tuning before changing the dial frequency. + + + + + + Measuring reference spectrum: %1 s remaining + + + + + Reference spectrum measurement stopped; Ref Spec is available + + + + + Reference spectrum saved; Ref Spec is available + + + + + Reference spectrum measurement stopped; no reference spectrum is available + + + + + Cannot remove "%1": %2 + + + + WD:0m - + Runaway Tx watchdog 送信自動停止機能 - + WD:%1m - - + + + Free Text Message フリーテキストメッセージ - - + + Message: メッセージ: - + Directional calls not yet supported in SuperFox mode SuperFoxモードではまだ CQ JA や CQ NA のような地域指定呼出しに対応していません - + TOTP: No seed entered in fox configuration to generate verification code. TOTP: 認証コードを生成するためのシードがFox設定に入力されていません. - + + SuperFox cannot queue %1: unsupported callsign. + + + + TOTP SF: seed not long enough. TOTP SF: シードの長さが不十分です. - + + SuperFox Tx stopped: invalid message tokens. + + + + + SuperFox Tx stopped: invalid verification code. + + + + + SuperFox Tx stopped: invalid CQ call or grid. + + + + + SuperFox Tx stopped: invalid callsign. + + + + + SuperFox Tx stopped: report is outside the SuperFox range. + + + + + SuperFox Tx stopped: free text contains unsupported characters. + + + + + SuperFox Tx stopped: message could not be packed. + + + + Are you sure you want to erase the Tx Log? 本当にTx Logを消去してよいですか? - + "%1" added to Ignore List "%1" が無視リストに加えられました - + Are you sure you want to erase the Ignore List? 本当に無視リストを消去してもいいですか? @@ -6187,22 +8001,22 @@ Check your antenna "The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2021 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; and other members of the WSJT Development Group." - + No data read from disk. Wrong file format? ディスクからデータが読めません.フォーマットが合っていますか? - + Confirm Delete 削除確認 - + Are you sure you want to delete all *.wav and *.c2 files in "%1"? "%1"のすべての*.wavと*.c2ファイルを削除していいですか? - + Keyboard Shortcuts キーボードショートカット @@ -6393,7 +8207,7 @@ Check your antenna </table> - + Special Mouse Commands 特別なマウス操作 @@ -6463,23 +8277,21 @@ Check your antenna </table> - + No more files to open. これ以上開くファイルがありません. - - Spotting to PSK Reporter unavailable - 現在PSK Reporterにスポットできません + 現在PSK Reporterにスポットできません - + Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. 他の送信周波数を使ってください. WSJT-Xは30mバンドのWSPRサブバンド中の他のモードを受信せずに送信してしまいます. - + WSPR Guard Band WSPRガードバンド @@ -6488,13 +8300,12 @@ Check your antenna 他のダイヤル周波数を使ってください. WSJT-XはFT8の標準サブバンドでFoxモードを使えません。 - - + Fox Mode warning Foxモード警告 - + Please choose another dial frequency. WSJT-X will not operate in Fox mode overlapping the WSPR sub-bands. @@ -6503,12 +8314,132 @@ WSJT-X は、WSPR サブバンドと重なる周波数で Fox モードで動作しません. - + + The decoder subprocess could not be stopped. + + + + + The decoder subprocess could not be restarted. + + + + + Application status + + + + + Current WSJT-X status messages and operating indicators. + + + + + Transmit status + + + + + Decode count + + + + + Last transmitted message + + + + + Power and SWR status + + + + + Decode progress + + + + + Progress for the current decode operation. + + + + + Transmit watchdog + + + + + The selected transmit message cannot be encoded. Enable Tx has been turned off. Edit the selected message or check station settings before trying again. + + + + + Tx message cannot be encoded; Enable Tx is off + + + + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2026 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; Roger Rehr, W3SZ; John Nelson, G4KLA; Charlie Suckling, DL3WDG; Terrell Deppe, KJ5HST; and other members of the WSJT Development Group." + + + + + EME Chart + + + + + Select Year + + + + + FT8 input completion was rejected: automated=%1 awaiting=%2 frames=%3. + + + + + Unable to flush the final FT8 downsampling block. + + + + + FT8 input completed with %1 of %2 samples in the decode buffer. + + + + + FT8 decoding is running behind; early passes are temporarily reduced. + + + + + FT8 decoding caught up; configured early passes restored. + + + + + + PSK Reporter spot queue full; oldest spot dropped + + + + Last Tx: %1 最終送信: %1 - + + A QSO between two stations with nonstandard callsigns won't work. + +Auto Seq would get stuck in an endless loop. + + + + This station transmits in the same time slot as you do. You must not start a QSO if both stations Tx even/1st @@ -6525,7 +8456,7 @@ MSK144 モードボタンをクリックすると Tx even/1stチェックボッ もしくは、別の局を選んでください。 - + Should you switch to EU VHF Contest mode? To do so, check 'Special operating activity' and @@ -6535,143 +8466,154 @@ To do so, check 'Special operating activity' and 設定|詳細タブで設定変更してください. - + Should you switch to ARRL Field Day mode? ARRLフィールドデーモードに切り替えますか? - + Should you switch to RTTY contest mode? RTTYコンテストモードに切り替えますか? - - - - + + + Decoder is starting; decode request skipped. + + + + + + + Add to CALL3.TXT CALL3.TXTへ追加 - + Please enter a valid grid locator 有効なグリッドロケータを入力してください - + Cannot open "%1" for read/write: %2 %2を読み書きするための"%1"が開けません - + %1 is already in CALL3.TXT, do you wish to replace it? %1 がすでにCALL3.TXTにセットされています。置き換えますか? - + Warning: DX Call field is empty. 警告 DXコールが空白です. - + + SuperFox free text may only contain spaces, digits, uppercase letters, and + - . / ?. + + + + Log file error ログファイルエラー - + Cannot open "%1" "%1"を開けません - + Error sending log to N1MM N1MMへログを送れません - + Write returned "%1" 応答"%1"を書き込み - + Stations calling DXpedition %1 DXペディション %1を呼ぶ局 - + Show Already Worked 交信済みを表示 - + Super Fox - + Super Hound - + Hound Hound - + Tx Messages 送信メッセージ - - - - - - + + + + + + Confirm Erase 消去確認 - + Are you sure you want to erase file ALL.TXT? ALL.TXTファイルを消去してよいですか? - + Are you sure you want to erase the list of Q65 callers? 本当にQ65 callersのリストを消去してもいいですか? - - + + Confirm Reset リセット確認 - + Are you sure you want to erase your contest log? コンテストログを消去していいですか? - + Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. 現在のコンテストのQSO記録をすべて消去します。ADIFログには記録されますがCabrilloログにエクスポートすることはできません. - + Cabrillo Log saved Cabrilloログ保存しました - + Are you sure you want to erase file wsjtx_log.adi? wsjtx_log.adiを消してもよいですか? - + Are you sure you want to erase the WSPR hashtable? WSPRのハッシュテーブルを消してもよいですか? @@ -6680,44 +8622,45 @@ is already in CALL3.TXT, do you wish to replace it? VHF機能警告 - + Tune digital gain チューンのデジタルゲイン - + Transmit digital gain 送信デジタルゲイン - + Prefixes プリフィックス - + Network Error ネットワークエラー - + Error: %1 UDP server %2:%3 エラー %1 UDPサーバー %2:%3 - + + File Error ファイルエラー - + Phase Training Disabled 位相調整オフ - + Phase Training Enabled 位相調整オン @@ -6726,15 +8669,222 @@ UDPサーバー %2:%3 WD:%1m - - - Log File Error - ログファイルエラー + + + Log File Error + ログファイルエラー + + + + Are you sure you want to clear the QSO queues? + QSO待ち行列をクリアしてもいいですか? + + + + Band hopping has no selected frequencies. + + + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: cycle CQ response mode)</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Cycle CQ response mode</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Ctrl+X </b></td><td>Open next file in directory</td></tr> + <tr><td><b>Alt+x </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> + +</table> + + + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Right-click</b> to set Tx frequency.<br/> + <b>Double-right-click</b> to set Rx and Tx frequencies. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> + and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> + Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> + own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">Dial Frequency:</td> + <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> + <b>Right-click</b> to increase frequency by 1 kHz.<br/> + <b>Left-click</b> to decrease frequency by 1 kHz.<br/> + The mouse pointer must be over the Dial Frequency indicator. + </td> + </tr> + <tr> + <td align="right">H Button:</td> + <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to activate or deactivate SuperFox mode. + </td> + </tr> + <tr> + <td align="right">FT8 Button:</td> + <td><b>Click</b> to switch to FT8 Hound Mode.<br/> + <b>Right-click</b> to toggle last used Special Operating Activity On/Off. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> + <tr> + <td align="right">Tx5 Button:</td> + <td><b>Right-click</b> to retain Tx5 free text. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Right-click</b> to freeze the state of the checkbox.<br/> + <b>Right-click on the FT8 Button</b> to unfreeze. + </td> + </tr> + <tr> + <td align="right">Enable Tx Button:</td> + <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> + <b>Right-click</b> to toggle Wait & Pounce On/Off after selecting<br/> + any CQ response mode other than CQ: None. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> + If <b>Alternate Erase button behavior</b> is checked:<br/> + <b>Click</b> to erase Band Activity window.<br/> + <b>Right-click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">DX Call Button:</td> + <td><b>Click</b> to toggle Wait & Call On/Off.<br/> + <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. + </td> + </tr> + <tr> + <td align="right">Lookup Button:</td> + <td><b>Click</b> to search for callsign in database.<br/> + <b>Right-click</b> to search for Dx Call on qrz.com. + </td> + </tr> + <tr> + <td align="right">Add Button:</td> + <td><b>Click</b> to add callsign and locator to database.<br/> + <b>Right-click</b> to search for Dx Call on hamqth.com. + </td> + </tr> + <tr> + <td align="right">Ignore Button:</td> + <td><b>Click</b> to add callsign to the Ignore List.<br/> + <b>Right-click</b> to search for Dx Call on qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Band Buttons:</td> + <td><b>Click</b> to toggle band / mode default frequencies.<br/> + <b>Right-click</b> to toggle FT8 DXpedition frequencies. + </td> + </tr> +</table> + - - Are you sure you want to clear the QSO queues? - QSO待ち行列をクリアしてもいいですか? + + Type 1 Prefixes: + + 1A 1S 3A 3B6 3B8 3B9 3C 3C0 3D2 3D2C 3D2R 3DA 3V 3W 3X + 3Y 3YB 3YP 4J 4L 4S 4U1I 4U1U 4W 4X 5A 5B 5H 5N 5R + 5T 5U 5V 5W 5X 5Z 6W 6Y 7O 7P 7Q 7X 8P 8Q 8R + 9A 9G 9H 9J 9K 9L 9M2 9M6 9N 9Q 9U 9V 9X 9Y A2 + A3 A4 A5 A6 A7 A9 AP BS7 BV BV9 BY C2 C3 C5 C6 + C9 CE CE0X CE0Y CE0Z CE9 CM CN CP CT CT3 CU CX CY0 CY9 + D2 D4 D6 DL DU E3 E4 EA EA6 EA8 EA9 EI EK EL EP + ER ES ET EU EX EY EZ F FG FH FJ FK FKC FM FO + FOA FOC FOM FP FR FRG FRJ FRT FT5W FT5X FT5Z FW FY M MD + MI MJ MM MU MW H4 H40 HA HB HB0 HC HC8 HH HI HK + HK0A HK0M HL HM HP HR HS HV HZ I IS IS0 J2 J3 J5 + J6 J7 J8 JA JDM JDO JT JW JX JY K KG4 KH0 KH1 KH2 + KH3 KH4 KH5 KH5K KH6 KH7 KH8 KH9 KL KP1 KP2 KP4 KP5 LA LU + LX LY LZ OA OD OE OH OH0 OJ0 OK OM ON OX OY OZ + P2 P4 PA PJ2 PJ7 PY PY0F PT0S PY0T PZ R1F R1M S0 S2 S5 + S7 S9 SM SP ST SU SV SVA SV5 SV9 T2 T30 T31 T32 T33 + T5 T7 T8 T9 TA TF TG TI TI9 TJ TK TL TN TR TT + TU TY TZ UA UA2 UA9 UK UN UR V2 V3 V4 V5 V6 V7 + V8 VE VK VK0H VK0M VK9C VK9L VK9M VK9N VK9W VK9X VP2E VP2M VP2V VP5 + VP6 VP6D VP8 VP8G VP8H VP8O VP8S VP9 VQ9 VR VU VU4 VU7 XE XF4 + XT XU XW XX9 XZ YA YB YI YJ YK YL YN YO YS YU + YV YV0 Z2 Z3 ZA ZB ZC4 ZD7 ZD8 ZD9 ZF ZK1N ZK1S ZK2 ZK3 + ZL ZL7 ZL8 ZL9 ZP ZS ZS8 KC4 E5 + +Type 1 Suffixes: /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /P + @@ -6754,8 +8904,8 @@ UDPサーバー %2:%3 Modes - - + + Mode モード @@ -6763,7 +8913,7 @@ UDPサーバー %2:%3 MultiSettings - + Default デフォルト @@ -6771,62 +8921,62 @@ UDPサーバー %2:%3 MultiSettings::impl - + &Switch To 変更(&S) - + &Clone クローン(&C) - + Clone &Into ... 名前をつけてクローン(&I)... - + R&eset リセット(&R) - + &Rename ... 名前の変更(&R)... - + &Delete 削除(&D) - + Clone Into Configuration コンフィグレーションへクローン - + Confirm overwrite of all values for configuration "%1" with values from "%2"? コンフィグレーション%1のすべての項目を%2で置き換えていいですか? - + Reset Configuration コンフィグレーションをリセット - + Confirm reset to default values for configuration "%1"? コンフィグレーション"%1"をデフォルト値にリセットしてもいいですか? - + Delete Configuration コンフィグレーションを削除 - + Confirm deletion of configuration "%1"? コンフィグレーション"%1"を削除していいですか? @@ -6834,17 +8984,17 @@ UDPサーバー %2:%3 NameDialog - + New Configuration Name 新しいコンフィグレーション名 - + Old name: 元の名前: - + &New name: 新しい名前(&N): @@ -6870,7 +9020,7 @@ UDPサーバー %2:%3 OmniRig COMサーバーが開始できません - + OmniRig: don't know how to set rig frequency OmniRigが無線機周波数をセットできません @@ -6879,7 +9029,7 @@ UDPサーバー %2:%3 OmniRig: 無線機からの応答タイムアウト - + OmniRig COM/OLE error: %1 at %2: %3 (%4) OmniRig COM/OLEエラー: %1 at %2 %3 (%4) @@ -6913,34 +9063,33 @@ UDPサーバー %2:%3 - + Too many colours in palette. パレットに色の種類が多すぎます. - + Error reading waterfall palette file "%1:%2" too many colors. ウォーターフォールパレットファイル "%1:%2"から読み込めません.色が多すぎます. - + Error reading waterfall palette file "%1:%2" invalid triplet. ウォーターフォールパレットファイル "%1:%2"から読み込めません. 正しくないトリプレット. - + Error reading waterfall palette file "%1:%2" invalid color. ウォーターフォールパレットファイル "%1:%2"から読み込めません. 正しくない色. - + Error opening waterfall palette file "%1": %2. ウォーターフォールパレットファイル "%1": %2 が開けません. - Error writing waterfall palette file "%1": %2. - ウォーターフォールパレットファイル "%1": %2 に書き込めません. + ウォーターフォールパレットファイル "%1": %2 に書き込めません. @@ -7345,7 +9494,7 @@ Message メッセージを送ってください - + MessageCreator メッセージ生成機能 @@ -7363,7 +9512,7 @@ Message クリア - + QSY Monitor QSYモニタ @@ -7500,12 +9649,12 @@ Error(%2): %3 SoundInput - + An error opening the audio input device has occurred. オーディオ入力デバイスが開けません. - + An error occurred during read from the audio input device. オーディオ入力デバイスから読み込みエラー発生. @@ -7514,52 +9663,52 @@ Error(%2): %3 オーディオ入力デバイスにオーディオデータが入ってくる速度が遅すぎます. - + Non-recoverable error, audio input device not usable at this time. 回復不能エラー. 現在オーディオ入力デバイスが使えません. - + Requested input audio format is not valid. このオーディオフォーマットは無効です. - + Requested input audio format is not supported on device. このオーディオ入力フォーマットはオーディオ入力デバイスでサポートされていません. - + Failed to initialize audio sink device オーディオ出力デバイス初期化エラー - + Idle 待機中 - + Receiving 受信中 - + Suspended サスペンド中 - + Interrupted 割り込まれました - + Error エラー - + Stopped 停止中 @@ -7567,90 +9716,114 @@ Error(%2): %3 SoundOutput - + An error opening the audio output device has occurred. オーディオ出力デバイスが開けません. - + An error occurred during write to the audio output device. オーディオ出力デバイスへデータ書き込みエラー発生. - + Audio data not being fed to the audio output device fast enough. 十分な速度でオーディオデータを出力デバイスへ送れません. - + Non-recoverable error, audio output device not usable at this time. 回復不能エラー. 現在オーディオ出力デバイスが使えません. - + Requested output audio format is not valid. このオーディオフォーマットは無効です. - + Requested output audio format is not supported on device. このオーディオフォーマットはオーディオ出力デバイスでサポートされていません. - + + Audio output restart attempt failed. + + + + + No audio output device configured. オーディオ出力デバイスが設定されていません. - + + No audio output stream is active. + + + + Idle 待機中 - + Sending 送信中 - + Suspended サスペンド中 - + Interrupted 割り込まれました - + Error エラー - + Stopped 停止中 + + SplashScreen + + + WSJT-X — Welcome + + + + + WSJT-X startup information. Press Escape to close. + + + StationDialog - + Add Station 局を追加 - + &Band: バンド(&B): - + &Offset (MHz): オフセットMHz(&O): - + &Antenna: アンテナ(&A): @@ -7691,185 +9864,207 @@ Error(%2): %3 TCITransceiver - + ConnectionRefused 接続拒否 - + RemoteHostClosed リモートホスト切断 - + HostNotFound ホスト見つからず - + SocketAccess ソケットアクセス - + SocketResource ソケットリソース - + SocketTimeout ソケットタイムアウト - + DatagramTooLarge データグラムサイズ超過 - + Network ネットワーク - + AddressInUse 使用中アドレス - + SocketAddressNotAvailable ソケットアドレス利用不可 - + UnsupportedSocketOperation サポートされていないソケット操作 - + UnfinishedSocketOperation ソケット操作未完了 - + ProxyAuthenticationRequired ProxyAuthenticationが必要 - + SslHandshakeFailed SSLハンドシェイク失敗 - + ProxyConnectionRefused Proxy接続拒否 - + ProxyConnectionClosed Proxy接続切断 - + ProxyConnectionTimeout Proxy接続タイムアウト - + ProxyNotFound Proxy見つからず - + ProxyProtocol Proxyプロトコル - + Operation 操作 - + SslInternal Not sure what this means SslInternal - + SslInvalidUserData SSL無効ユーザデータ - + Temporary 一時的 - + UnknownSocket 不明なソケット - + + UnknownSocketError + + + + TCI websocket error: %1 TCI websocket エラー: %1 - + TCI SDR could not be switched on TCI SDRをオンにできず - + TCI SDR is not switched on TCI SDRがオンになっていない - + TCI RX2 could not be enabled TCI RX2を有効にできず - + TCI Audio could not be switched on TCI Audioをオンにできず - - + + TCI could not be opened TCIをオープンできず - - + + + + TCI sent an invalid VFO frequency + + + + + TCI failed to set ptt TCIがPTTをセット失敗 - + TCI should use PTT via CAT TCIはCAT経由でPTTを使うこと - - + + TCI failed set rxfreq TCIが周波数を設定できず - - + + TCI failed set mode TCIがモードを設定できず - + TCI modulator not Idle TCIモジュレータがアイドル状態でない + + + TCI source commitment; playout evidence is protocol-send dead reckoning, not DAC confirmation + + + + + TCI WebSocket send progress; no radio DAC or RF playback confirmation + + TransceiverBase @@ -7891,7 +10086,7 @@ Error(%2): %3 操作パネル - + Spectrum gain スペクトラムゲイン @@ -7900,185 +10095,194 @@ Error(%2): %3 パレット - + <html><head/><body><p>Enter definition for a new color palette.</p></body></html> <html><head/><body><p>新しいカラーパレットの定義を入力.</p></body></html> - + Adjust... 調整... - + Total power (dB) 総出力 (dB) - + Waterfall gain ウォーターフォールゲイン - + <html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html> <html><head/><body><p>このウィンドウにおけるスペクトラム表示占有率.</p></body></html> - + % % - + Spec スペクトラム - + <html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html> <html><head/><body><p>スペクトラム表示している周波数全体を平滑化.</p></body></html> - + Flatten 平滑化 - <html><head/><body><p>Compute and save a reference spectrum. (Not yet fully implemented.)</p></body></html> - 参照スペクトラムを計算して保存(一部未実装) + 参照スペクトラムを計算して保存(一部未実装) - + Ref Spec 日本語難しい - + Smoothing of Linear Average spectrum スペクトラム平滑化 - + Smooth 平滑化 - + Compression factor for frequency scale 周波数スケールの圧縮率 - + + <html><head/><body><p>Controls</p></body></html> + + + + Bins/Pixel Bin数/ピクセル - - + + <html><head/><body><p>Position of time stamp above each interval line</p></body></html> <html><head/><body><p>インターバル線の上側のタイムスタンプ位置</p></body></html> - + Time stamp タイムスタンプ - - + + Off Off - + Left 左 - + Right 右 - + Palette パレット - + Select waterfall palette ウォーターフォールパレットを選択 - + Bars Bars - + Freq Freq - + + <html><head/><body><p>Apply a saved reference spectrum to flatten the received passband. Available after a reference spectrum has been measured. (Not yet fully implemented.)</p></body></html> + + + + <html><head/><body><p>Select data for spectral display</p></body></html> <html><head/><body><p>スペクトラム表示データを選択</p></body></html> - + Current 標準 - + Cumulative 累加 - + Linear Avg 線形平均 - + Reference リファレンス - + Q65_Sync Q65_Sync - + <html><head/><body><p>Frequency at left edge of waterfall</p></body></html> <html><head/><body><p>ウォーターフォール左端の周波数</p></body></html> - + Hz Hz - + Start 開始 - + <html><head/><body><p>Decode JT9 only above this frequency</p></body></html> <html><head/><body><p>この周波数より上でのみJT9をデコード</p></body></html> - + Hz Hz - + Split スプリット @@ -8091,38 +10295,38 @@ Error(%2): %3 JT65 - + Number of FFTs averaged (controls waterfall scrolling rate) 平均するFFT数(ウォーターフォールのスクロール速度を調整) - + N Avg - + Waterfall zero ウォーターフォールゼロ - + Spectrum zero スペクトラムゼロ - + User Defined ユーサー定義 - + Wide Graph ワイドグラフ - - + + Read Palette パレット読み込み @@ -8130,22 +10334,22 @@ Error(%2): %3 WorkedBefore - + Invalid ADIF field %0: %1 無効なADIFフィールド %0: %1 - + Malformed ADIF field %0: %1 不正フォーマットADIFフィールド %0: %1 - + Invalid ADIF header 無効なADIFヘッダー - + Error opening ADIF log file for read: %0 ADIFログファイルを開けません: %0 @@ -8188,7 +10392,7 @@ Error(%2): %3 自局のグリッドロケーター(&y): - + <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> <html><head/><body><p>グリッドロケーター、できるだけ6桁.</p></body></html> @@ -8203,57 +10407,57 @@ Error(%2): %3 自動グリッドロケーター - + IARU Region: IARU地域: - + <html><head/><body><p>Select your IARU region.</p></body></html> <html><head/><body><p>自局のIARU地域を選択.</p></body></html> - + Message generation for type 2 compound callsign holders: タイプ2複合コールサインのとき、いつフルコールを送信するか: - + <html><head/><body><p>Type 2 compound callsigns are those with prefixes or suffixes not included in the allowed shortlist (See Help-&gt;Add-on prefixes and suffixes).</p><p>This option determines which generated messages should contain your full type 2 compound call sign rather than your base callsign. It only applies if you have a type 2 compound callsign.</p><p>This option controls the way the messages that are used to answer CQ calls are generated. Generated messages 6 (CQ) and 5 (73) will always contain your full callsign. The JT65 and JT9 protocols allow for some standard messages with your full call at the expense of another piece of information such as the DX call or your locator.</p><p>Choosing message 1 omits the DX callsign which may be an issue when replying to CQ calls. Choosing message 3 also omits the DX callsign and many versions of this and other software will not extract the report. Choosing neither means that your full callsign only goes in your message 5 (73) so your QSO partner may log the wrong callsign.</p><p>None of these options are perfect, message 3 is usually best but be aware your QSO partner may not log the report you send them.</p></body></html> <html><head/><body><p>タイプ2コールサインは、プリフィックスまたはサフィックスが短縮リストに載っていない場合使われます.</p><p>このオプションはあなたがタイプ2複合コールサインを使うとき、どのメッセージでそれを送信するかを決めます. </p><p>CQに応答するとき基本コールサインを使うかタイプ2複合コールサインを使うか選択できます. 6 (CQ) と 5 (73) はいつもフルコールサインを含みます. JT65 と JT9 プロトコルはDXコールやロケーターを送らない代わりにフルのタイプ2複合コールサインを送ることができます.</p><p>メッセージ1を選ぶと、DXコールが含まれませんのでCQに応答するとき問題になるかもしれません. メッセージ3を選ぶとDXコールを省きますが、WSJT-Xのバージョンによって、あるいは、別のアプリがレポートを受け取れません. どちらも選ばないとフルのコールサインはメッセージ5(73)だけに含まれ、相手が間違ったコールサインをログしかねません.</p><p>どのオプションも完璧ではありません, メッセージ3が一番よいと思いますが、相手がレポートを受け取れない可能性があります.</p></body></html> - + Full call in Tx1 - + Full call in Tx3 - + Full call in Tx5 only - + Display 表示 - + Show outgoing transmitted messages in the Rx frequency window. 受信周波数ウィンドウに送信するメッセージを表示. - + &Tx messages to Rx frequency window 送信メッセージを受信周波数ウィンドウに表示(&T) - + Show if decoded stations are new DXCC entities or worked before. 相手局が新しいDXCCかどうか表示. @@ -8262,12 +10466,12 @@ Error(%2): %3 DXCC、グリッド、交信済みを表示(&D) - + <html><head/><body><p>Check to have decodes for a new period start at the top of the Band Activity window and not scroll off the top when the window is full.</p><p>This is to aid selecting decodes to double-click while decoding is still in progress. Use the Band Activity vertical scroll bar to reveal decodes past the bottom of the window.</p></body></html> <html><head/><body><p>チェックすると新しいメッセージがバンド状況ウィンドウの一番上から表示され、ウィンドウがいっぱいになってもスクロールアウトされません. デコード中にダブルクリックしやすくなります. 縦のスクロールバーを使ってスクロールダウンすることで以前のメッセージを見てください.</p></body></html> - + Start new period decodes at top 新しいデコードメッセージはウィンドウの上から表示 @@ -8276,52 +10480,52 @@ Error(%2): %3 国名ではなく割り当てプリフィックスを表示 - + Set the font characteristics for the application. アプリのフォント設定. - + Font... フォント... - + Set the font characteristics for the Band Activity and Rx Frequency areas. バンド状況と受信周波数エリアのフォント設定. - + Decoded Text Font... デコードテキストフォント... - + Include a separator line between periods in the band activity window. バンド状況ウィンドウでデコードシーケンスの間に区切り線を表示. - + &Blank line between decoding periods デコードシーケンスの間に区切りを入れる(&B) - + Show distance to DX station in miles rather than kilometers. DX局までの距離をキロメートルではなくマイルで表示. - + Display dista&nce in miles 距離をマイルで表示(&n) - + Behavior 動作 - + Decode after EME delay EME遅延を考慮してデコード開始 @@ -8330,17 +10534,17 @@ Error(%2): %3 自動応答許可時間: - + <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> <html><head/><body><p>ユーサーが離れてから自動送信を解除するまでの分数</p></body></html> - + Disabled 解除 - + minutes 分 @@ -8349,64 +10553,62 @@ Error(%2): %3 VHF/UHF/Microwave機能をオン - + Single decode シングルデコード - <html><head/><body><p>Some rigs are not able to process CAT commands while transmitting. This means that if you are operating in split mode you may have to uncheck this option.</p></body></html> - <html><head/><body><p>無線機によっては、送信中にCATコマンドを受け付けません. スプリットモードのときはこのオプションを使えないかもしれません.</p></body></html> + <html><head/><body><p>無線機によっては、送信中にCATコマンドを受け付けません. スプリットモードのときはこのオプションを使えないかもしれません.</p></body></html> - Allow Tx frequency changes while transmitting - 送信中の送信周波数変更を許可 + 送信中の送信周波数変更を許可 - + Don't start decoding until the monitor button is clicked. モニターボタンを押すまでデコードを開始しない. - + Mon&itor off at startup 起動時にモニターをオフ(&i) - + <html><head/><body><p>Check this if you wish to automatically return to the last monitored frequency when monitor is enabled, leave it unchecked if you wish to have the current rig frequency maintained.</p></body></html> <html><head/><body><p>モニターをオンにしたとき、最後にモニターしていた周波数に戻りたいときはチェック. そのままの周波数を維持したいときはチェックをはずす.</p></body></html> - + Monitor returns to last used frequency 最後に使った周波数に戻る - + Alternate F1-F6 bindings 別のF1-F6キーセット設定を使う - + Turns off automatic transmissions after sending a 73 or any other free text message. 73またはフリーテキストを送った後、 自動送信をオフ. - + Di&sable Tx after sending 73 73を送った後、送信を停止(&s) - + Send a CW ID after every 73 or free text message. 73またはフリーテキスト送信後にCW IDを送信. - + CW ID a&fter 73 73の後にCW IDを送信(&f) @@ -8415,7 +10617,7 @@ text message. CW ID送信間隔(&v): - + Send a CW ID periodically every few minutes. This might be required under your countries licence regulations. It will not interfere with other users as it is always sent in the @@ -8426,411 +10628,446 @@ quiet period when decoding is done. 時間に送信されるようになっています. - + Automatic transmission mode. 自動送信モード. - + Show &DXCC, grid, and worked-before status &DXCC, グリッド, workedの状況を表示 - + Highlight DX Grid in message メッセージ中のDXグリッドをハイライト - + Show DXCC for all messages 全てのメッセージについてDXCCを表示 - + Show the separator line between periods with time stamp of the decode period. デコード期間を分ける線をタイムスタンプ入りで表示. - + Show blank line with time stamp 空白行をタイムスタンプ付きで表示 - + Show principal prefix instead of country name カントリー名の代わりに代表プリフィックスで表示 - + Highlight DX Call in message メッセージ内のDXコールサインをハイライト - + Doubl&e-click on call sets Tx enable コールサインをダブルクリックすると送信可にする(&e) - + <html><head/><body><p>Open the Astronomical Data window automatically when switching to Q65 or JT65 mode and Decode after EME delay is enabled, and close it when no longer needed.</p><p>Open the QSYMessage Creator automatically if the VHF Features are enabled and such QSY messages are applicable.</p></body></html> <html><head/><body><p>Q65 または JT65 モードに切り替えた際に、EME ディレイ後のデコードが有効になっている場合、自動的に天文データウィンドウを開き、不要になったら閉じます.</p><p>VHF 機能が有効で、該当する QSY メッセージがある場合、自動的に QSY メッセージ作成ウィンドウを開きます.</p></body></html> - + Auto-open/close Astronomical data window 天文データウィンドウを自動的に開いたり閉じたりします - + Calling CQ forces Call 1st コール 1stをセットしてCQを出す - + <html><head/><body><p>Tx until 73 is received when in MSK144 or Q65 mode. </p></body></html> <html><head/><body><p>MSK144またはQ65 モードで、73を受信するまで送信します. </p></body></html> - + MSK144/Q65: Tx until 73 is received MSK144/Q65: 73を受信するまで送信 - + <html><head/><body><p>Allow kHz frequency offset entry without 'k' suffix.</p></body></html> <html><head/><body><p>kを後に付けずにkHz周波数オフセット入力を可能にします</p></body></html> - + kHz entry without k (restart required) kを付けずにkHz入力(要リスタート) - + + <html><head/><body><p>Allow automatic Doppler tracking and split/Fake It/XIT to correct the transmit frequency while transmitting, including corrections of tens of kHz on microwave bands.</p><p>This option does not allow nominal dial or band changes while transmitting or tuning. Leave it unchecked if your rig cannot accept frequency-setting CAT commands while transmitting; WSJT-X will then make one midpoint Doppler correction before transmission starts.</p></body></html> + + + + + Allow Tx-frequency corrections while transmitting + + + + <html><head/><body><p>Disable the Tune watchdog.</p></body></html> <html><head/><body><p>チューンウォッチドッグをオフ.</p></body></html> - + Tune watchdog チューンウオッチドッグ - + <html><head/><body><p>Number of seconds before Tune is aborted</p></body></html> <html><head/><body><p>チューンを停止するまでの秒数</p></body></html> - + + Tune watchdog timeout + + + + seconds 秒 - + Tx watchdog: 送信ウオッチドッグ: - + + Tx watchdog timeout + + + + ID Inter&val: ID インターバル(&v): - + + CW ID interval + + + + <html><head/><body><p>Turn the progress bar red while transmitting.</p></body></html> <html><head/><body><p>送信中は進行表示バーを赤にする.</p></body></html> - + Turn progress bar red while transmitting 送信中は進行バーを赤にする - + Additional features 追加機能 - + Set Rx frequency to Tx frequency after QSO QSO後、受信周波数を送信周波数に合わせる - + <html><head/><body><p>If a station sends locator, calculate and show the distance in Band Activity pane.</p></body></html> <html><head/><body><p>もし相手局がロケーターを送信した場合、バンドアクティビティペインに距離を計算して表示します.</p></body></html> - + Show distance in messages with grid グリッド付きメッセージに距離を表示 - + <html><head/><body><p>Erase Band Activity and Rx frequency windows after band change.</p></body></html> <html><head/><body><p>バンドを変更した際、バンドアクティビティと受信周波数ウィンドウをクリア</p></body></html> - + Erase decodes after band change バンド変更時、デコードをクリア - + Clear DX Grid after QSO QSO終了後DXグリッドをクリア - + Show U.S. States in messages with grid グリッド付きメッセージに米国州を表示 - + Map Grid locator to U.S. State グリッドロケータを米国州に対応させる - + <html><head/><body><p>Align the text for DXCC, distance and azimuth.</p></body></html> <html><head/><body><p>DXCC、距離、方位のテキストを整列.</p></body></html> - + Align DXCC/distance/azimuth DXCC、距離、方位を整列 - + Alternate Erase button behavior Eraseボタンの働きを変更 - + Clear DX Call after QSO QSO完了後DXコールサインをクリア - + <html><head/><body><p>Increase or decrease the space between message text and DXCC.</p></body></html> <html><head/><body><p>メッセージテキストとDXCCの間のスペースを増減.</p></body></html> + DXCC alignment spacing + + + + Enable Wait features Wait機能をオン - + <html><head/><body><p>If a station sends a valid Maidenhead locator, calculate and show the great-circle azimuth in Band Activity pane.</p></body></html> <html><head/><body><p>もし局が有効なメイデンヘッドロケーターを送信した場合、バンドアクティビティペインに大円方位(グレートサークル方位)を計算して表示します.</p></body></html> - + Show azimuth in messages with grid グリッド付きのメッセージに方位(アジマス)を表示 - + <html><head/><body><p>Increase or decrease the space between DXCC and distance/azimuth.</p></body></html> <html><head/><body><p>DXCCと距離方位の間のスペースを増減.</p></body></html> - + + Distance and azimuth alignment spacing + + + + Less button coloring (restart required) ボタンカラーリングを少なくする(要再起動) - + &Radio 無線機(&R) - + Radio interface configuration settings. 無線機インターフェイス設定. - + <html><head/><body><p>Use only VFO A for split operation (the program temporarily changes the QRG of your rig during transmission).</p></body></html> <html><head/><body><p>スプリット運用では VFO A のみを使用します(送信中にプログラムが一時的に無線機の周波数を変更します).</p></body></html> - + <html><head/><body><p>Use VFO A+B for split operation (works with many rigs, but requires the use of both VFOs).</p></body></html> <html><head/><body><p>スプリットではVFO AとVFO Bを使用 (多くのリグで可能、ただし両VFOを使う).</p></body></html> - + <html><head/><body><p>Don't use split (not recommended).</p></body></html> <html><head/><body><p>スプリットを使わない(おすすめしません).</p></body></html> - + Settings that control your CAT interface. CATインターフェイス設定. - + CAT Control CAT制御 - - + + Port: ポート: - + Serial port used for CAT control. CAT制御用シリアルポート. - - + + Serial Port Parameters シリアルポートパラメーター - + Baud Rate: ボーレート: - + Serial port data rate which must match the setting of your radio. シリアルポートの速度(無線機と同じでなければなりません). - + 1200 - + 2400 - + 4800 - + 9600 - + 19200 - + 38400 - + 57600 - + 115200 - + <html><head/><body><p>Number of data bits used to communicate with your radio's CAT interface (usually eight).</p></body></html> <html><head/><body><p>CATインターフェイスのデータビット数(通常は8ビット).</p></body></html> - + Data bits データビット - + Data Bits データビット - + D&efault デフォルト(&e) - + Se&ven - + E&ight - + <html><head/><body><p>Number of stop bits used when communicating with your radio's CAT interface</p><p>(consult you radio's manual for details).</p></body></html> <html><head/><body><p>CATインターフェイスのストップビット数</p><p>(詳細は取扱説明書を参照のこと).</p></body></html> - + Stop bits ストップビット - + Stop Bits ストップビット - - + + Default デフォルト - + On&e - + T&wo - + <html><head/><body><p>Flow control protocol used between this computer and your radio's CAT interface (usually &quot;None&quot; but some require &quot;Hardware&quot;).</p></body></html> <html><head/><body><p>無線機のCATインターフェイスに使われるフロー制御(通常 &quot;None&quot; たまに &quot;Hardware&quot;).</p></body></html> - - + + Handshake ハンドシェイク - + &None なし(&N) - + Software flow control (very rare on CAT interfaces). ソフトウェアによるフロー制御(CATではほとんど使われません). - + XON/XOFF XON/XOFF - + Flow control using the RTS and CTS RS-232 control lines not often used but some radios have it as an option and a few, particularly some Kenwood rigs, require it). @@ -8839,75 +11076,74 @@ a few, particularly some Kenwood rigs, require it). またKenwoodのいくつかの無線機では必須です. - + &Hardware ハードウェア(&H) - + Special control of CAT port control lines. CAT用ポートの特別な設定. - - + + Force Control Lines 制御信号を強制設定 - - + + High - - + + Low - + DTR: - + RTS: - How this program activates the PTT on your radio? - このプログラムがどのようにして無線機のPTTを制御するか? + このプログラムがどのようにして無線機のPTTを制御するか? - + PTT Method PTT方式 - + <html><head/><body><p>No PTT activation, instead the radio's automatic VOX is used to key the transmitter.</p><p>Use this if you have no radio interface hardware.</p></body></html> <html><head/><body><p>無線機のVOXで送受信を切り替える.</p><p>無線機インターフェイスハードウェアが無いとき使用.</p></body></html> - + VO&X VO&X - + <html><head/><body><p>Use the RS-232 DTR control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The DTR control line of the CAT serial port may be used for this or a DTR control line on a different serial port may be used.</p></body></html> <html><head/><body><p>RS-232CのDTR信号をPTT制御に使う.</p><p>市販のCATインターフェイスのうち、いくつかはこの方法を使っています.</p><p>CATシリアルポートのDTRを使うか、または、別のポートのDTRを使うこともあります.</p></body></html> - + &DTR - + Some radios support PTT via CAT commands, use this option if your radio supports it and you have no other hardware interface for PTT. @@ -8916,47 +11152,47 @@ other hardware interface for PTT. 他のハードウェアインターフェイスが必要なくなります. - + C&AT - + <html><head/><body><p>Use the RS-232 RTS control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The RTS control line of the CAT serial port may be used for this or a RTS control line on a different serial port may be used. Note that this option is not available on the CAT serial port when hardware flow control is used.</p></body></html> <html><head/><body><p>RS-232CのRTS信号をPTT制御に使います.</p><p>市販のCATインターフェイスのうち、いくつかはこの方法を使っています.</p><p>CATシリアルポートのRTSを使う、または、別のポートのRTSを使うこともあります. CATポートのハードウェアフロー制御を使う場合、このオプションは使えないことに注意してください.</p></body></html> - + R&TS - + <html><head/><body><p>Select the RS-232 serial port utilised for PTT control, this option is available when DTR or RTS is selected above as a transmit method.</p><p>This port can be the same one as the one used for CAT control.</p><p>For some interface types the special value CAT may be chosen, this is used for non-serial CAT interfaces that can control serial port control lines remotely (OmniRig for example).</p></body></html> <html><head/><body><p>PTT制御に使うシリアルポートを選択. このオプションはDTRまたはRTSでPTTを制御する場合に有効となります.</p><p>CAT制御のシリアルポートと同じポートでも構いません.</p><p>いくつかの特殊なインターフェイスでは特別なCATを選択します。そればリモートコントロールに使われたりします(例:OmniRig).</p></body></html> - + Modulation mode selected on radio. 無線機の変調モード. - + Mode モード - + <html><head/><body><p>USB is usually the correct modulation mode,</p><p>unless the radio has a special data or packet mode setting</p><p>for AFSK operation.</p></body></html> <html><head/><body><p>通常はUSBを使います</p><p>(無線機がAFSK用に特別なデータやパケットモードを持っている場合以外).</p></body></html> - + US&B US&B - + Don't allow the program to set the radio mode (not recommended but use if the wrong mode or bandwidth is selected). @@ -8965,23 +11201,23 @@ or bandwidth is selected). セットされているときは使います). - - + + None 指定なし - + If this is available then it is usually the correct mode for this program. これが使えるときは正しいモード. - + Data/P&kt - + Some radios can select the audio input using a CAT command, this setting allows you to select which audio input will be used (if it is available then generally the Rear/Data option is best). @@ -8990,52 +11226,52 @@ this setting allows you to select which audio input will be used 後ろのコネクタかデータ端子を使うことをお勧めします. - + Transmit Audio Source 送信オーディオ入力端子 - + Rear&/Data 後面/データ端子(&/) - + &Front/Mic 前面/マイク端子(&F) - + Rig: 無線機: - + Poll Interval: ポーリング間隔: - + <html><head/><body><p>Interval to poll rig for status. Longer intervals will mean that changes to the rig will take longer to be detected.</p></body></html> <html><head/><body><p>無線機の状態を見に行く時間間隔. 長めに設定すると、無線機の状態がプログラムに反映されるのに長くかかります.</p></body></html> - + s - + <html><head/><body><p>Attempt to connect to the radio with these settings.</p><p>The button will turn green if the connection is successful or red if there is a problem.</p></body></html> <html><head/><body><p>これらの設定を使って無線機接続を試みます.</p><p>接続が確立されればボタンは緑に、失敗すれば赤になります.</p></body></html> - + Test CAT CATをテスト - + Attempt to activate the transmitter. Click again to deactivate. Normally no power should be output since there is no audio being generated at this time. @@ -9048,47 +11284,47 @@ radio interface behave as expected. インターフェイスが正しく動作するかどうかチェックしてください. - + Test PTT PTTテスト - + Split Operation スプリット - + Fake It 擬似スプリット - + Rig 無線機 - + A&udio オーディオ(&u) - + Audio interface settings オーディオインターフェース設定 - + Souncard サウンドカード - + Soundcard サウンドカード - + Select the audio CODEC to use for transmitting. If this is your default device for system sounds then ensure that all system sounds are disabled otherwise @@ -9100,77 +11336,77 @@ transmitting periods. さもないと、システム音が送信されてしまいます. - + <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> <html><head/><body><p>WSJT-Xがデータを送るUDPサーバーのポート番号を入力. もし0のときはデータを送らない.</p></body></html> - + Outgoing interfaces: データ送出インターフェイス: - + <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> <html><head/><body><p>マルチキャストグループアドレスにデータを送る場合はどのネットワークインターフェイスを使うかを指定する必要があります.</p><p>ほとんどのユーザーにはループバックインターフェイスだけ指定すれば問題ありません.そうすれば、同一PC上で走る他のアプリはWSJT-Xとデータをやり取りできます.もしほかのPCで走るアプリがデータを受信しなければならない場合は正しいネットワークインターフェイスを指定しなければなりません.</p><p> いくつかのLinuxシステムではループバックネットワークインターフェイスでマルチキャスト機能をオンにしなければならないかもしれません.</p></body></html> - + <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> <html><head/><body><p>マルチキャストパケットを配信するホップ数を設定.、マルチキャストパケットがローカルサブネット内だけに配信されるように、ほとんどのケースでここは1を設定すればよいでしょう.</p></body></html> - + Multicast TTL: マルチキャストTTL: - + Days since last upload 最後にアップロードしてから経過した日数 - + Select the audio CODEC to use for receiving. 受信用オーディオコーデックを選択. - + &Input: 入力(&I): - + Select the channel to use for receiving. 受信用チャンネルを選択. - - + + Mono モノラル - - + + Left 左 - - + + Right 右 - - + + Both 両方 - + Select the audio channel used for transmission. Unless you have multiple radios connected on different channels; then you will usually want to select mono or @@ -9180,300 +11416,338 @@ both here. モノラルまたはステレオをここで選びます. - + Enable VHF and submode features VHFとサブモード機能をオン - - + + Update Hamlib Hamlib更新 - + 32-bit - + <html><head/><body><p>Revert the last Hamlib update. </p><p>Note: This function is only available on Windows.</p></body></html> <html><head/><body><p>最後のHamlib更新を元に戻す. </p><p>注:この機能はWindowsのみ.</p></body></html> - + Revert Update 更新を戻す - <html><head/><body><p>Download the latest libhamlib-4.dll file from https://n0nb.users.sourceforge.net/. </p><p>Note: This function is only available on Windows.</p></body></html> - <html><head/><body><p>最新のlibhamlib-4.dllを https://n0nb.users.sourceforge.net/からダウンロード. </p><p>注:この機能はWindowsのみ.</p></body></html> + <html><head/><body><p>最新のlibhamlib-4.dllを https://n0nb.users.sourceforge.net/からダウンロード. </p><p>注:この機能はWindowsのみ.</p></body></html> - + In use: 使用中: - + Backed up: バックアップ: - + 64-bit - + Rig Data - + <html><head/><body><p>Stop transmitting immediately when SWR exceeds 2.5.</p></body></html> <html><head/><body><p>SWRが2.5を超えたら即座に送信停止.</p></body></html> - + Halt Tx when SWR > 2.5 SWR>2.5で送信停止 - + <html><head/><body><p>Read and display transmit PWR and SWR of your rig.</p></body></html> <html><head/><body><p>リグのPWRとSWRを読んで表示.</p></body></html> - + Read and display PWR and SWR リグのPWRとSWRを表示 - + Ou&tput: 出力(&t): - + + Output audio channel + + + + + Input audio channel + + + + <html><head/><body><p>Refresh audio device list.</p></body></html> <html><head/><body><p>オーディオデバイスリストを更新.</p></body></html> - + Refresh 更新 - + <html><head/><body><p>Use TCI Audio when available.</p></body></html> <html><head/><body><p>TCIが使える時は使う.</p></body></html> - + Use TCI Audio (restart required) TCIオーディオを使う(要再起動) - + <html><head/><body><p>Rx audio level</p></body></html> <html><head/><body><p>受信オーディオレベル</p></body></html> - + + TCI receive audio level + + + + Rx - + <html><head/><body><p>Sort audio device names alphabetically.</p></body></html> <html><head/><body><p>オーディオデバイスを名前順で並び替え.</p></body></html> - + Sort alphabetically 名前順で並び替え - + <html><head/><body><p>Hide the usually unusable ALSA CARD subdevices on Linux.</p></body></html> <html><head/><body><p>Linuxで大抵使えないALSAカードサブデバイスを隠す.</p></body></html> - + Hide ALSA CARD subdevices (Linux only) ALSA CARDサブデバイスを隠す(Linuxのみ) - - + + Save Directory 保存ディレクトリ - + Loc&ation: 場所(&a): - + Path to which .WAV files are saved. .WAVファイルを保存するパス. - - + + TextLabel テキストラベル - + Click to select a different save directory for .WAV files. ここをクリックして .WAVファイルを保存する別のディレクトリを選択. - + S&elect 選択(&e) - - + + AzEl Directory AzElディレクトリ - + Location: 場所: - + Select 選択 - + <html><head/><body><p>Enables additional line in azel.dat for Dpol parameter.</p></body></html> <html><head/><body><p>Dpol パラメータ用に azel.dat に追加行を有効にする.</p></body></html> - + Enable extra line in azel.dat azel.datに追加行を有効 - + Power Memory By Band バンドごとの出力 - + Remember power settings by band バンドごとに出力設定 - + Enable power memory during transmit 送信中に出力メモリを可能とする - + Transmit 送信 - + Enable power memory during tuning チューニング中に出力メモリを可能とする - + Tune チューン - + Tx &Macros Txマクロ(&M) - + Canned free text messages setup フリーテキストメッセージ設定 - + + New &macro: + + + + &Add 追加(&A) - + + Add Tx macro + + + + + Adds the entered message to the saved Tx macro list. + + + + + New Tx macro message + + + + + Enter a saved free-text message for the Tx5 dropdown. Free-text messages are limited to 13 characters including spaces. + + + + &Delete 削除(&D) - Drag and drop items to rearrange order Right click for item specific actions Click, SHIFT+Click and, CRTL+Click to select items - ドラッグアンドドロップで順番を変えます + ドラッグアンドドロップで順番を変えます 右クリックでそれぞれの設定を変更します SHIFT+クリック、CTRL+クリックで複数選択できます - + Reportin&g レポート(&g) - + Reporting and logging settings レポートとログの設定 - + Logging ログ - + <html><head/><body><p>Check this option to note any Special Operating Activity in the comments field.</p></body></html> <html><head/><body><p>このオプションをチェックすると、コメント欄にスペシャル運用を記載します.</p></body></html> - + Special operating activity to comments スペシャル運用をコメントに記載 - + The program will pop up a partially completed Log QSO dialog when you send a 73 or free text message. 73またはフリーテキストメッセージを送った後でQSOをログするかどうかたずねるダイアログがポップアップします. - + Promp&t me to log QSO QSOをログするよう促すメッセージを出す(&t) - + <html><head/><body><p>Log 'ZZ00' as grid if the other station doesn't send you a grid.</p></body></html> <html><head/><body><p>グリッドが送られてこなかった場合'ZZ00'をグリッドとして記録.</p></body></html> - + Fill missing grids with 'ZZ00' グリッド未受信時'ZZ00'を記載 - + Op Call: オペレータコール: - + Some logging programs will not accept the type of reports saved by this program. Check this option to save the sent and received reports in the @@ -9484,7 +11758,7 @@ comments field. コメントに付加します. - + d&B reports to comments dBレポートをコメントに追加(&B) @@ -9499,22 +11773,22 @@ and DX Grid fields when a 73 or free text message is sent. ログした後DXコールとDXグリッドをクリアする(&D) - + <html><head/><body><p>Some logging programs will not accept WSJT-X mode names.</p></body></html> <html><head/><body><p>いくつかのログプログラムはWSJT-Xのモード名を受け付けません.</p></body></html> - + Con&vert mode to RTTY モードをRTTYに変換(&v) - + <html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html> <html><head/><body><p>もしオペレータのコールサインが局のコールサインと違う場合、ここに指定.</p></body></html> - + <html><head/><body><p>Check to have QSOs logged automatically, when complete.</p></body></html> <html><head/><body><p>ここをチェックするとQSOが終了次第自動的にログに追加.されます.</p></body></html> @@ -9523,12 +11797,12 @@ and DX Grid fields when a 73 or free text message is sent. 自動ログ記録(コンテストのみ) - + Network Services ネットワークサービス - + <html><head/><body><p>The program can send your station details and all decoded signals with grid squares as spots to the http://pskreporter.info web site.</p><p>This is used for reverse beacon analysis which is very useful for assessing propagation and system performance.</p></body></html> <html><head/><body><p>貴局の詳細、及びグリッドスクエアを含む全てのデコードした信号を http://pskreporter.info web siteへスポットできます.</p><p>これは、リバースビーコンの解析に使用され、電波伝搬の評価に大変役立ちます.</p></body></html> @@ -9543,37 +11817,37 @@ for assessing propagation and system performance. リバースビーコンに使用されます. - + Enable &PSK Reporter Spotting PSK Reporterによるスポットをオン(&P) - + <html><head/><body><p>Check this option if a reliable connection is needed</p><p>Most users do not need this, the default uses UDP which is more efficient. Only check this if you have evidence that UDP traffic from you to PSK Reporter is being lost.</p></body></html> <html><head/><body><p>確実な通信が必要なときだけ、このオプションをチェックします</p><p>殆どのユーザー環境では、UDPで十分かつ効率がよいため、チェックする必要はありません. PSK ReporterへのUDPトラフィックが不安定であるという確信があるときのみチェックしてください.</p></body></html> - + Use TCP/IP connection TCP/IP接続を使用 - + UDP Server UDPサーバー - + UDP Server: UDPサーバー: - + <html><head/><body><p>Optional hostname of network service to receive decodes.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the broadcasting of UDP status updates.</p></body></html> <html><head/><body><p>ネットワークサービスのホスト名指定オプション.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">ホスト名</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 アドレス</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 アドレス</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 マルチキャストグループアドレス</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 マルチキャストグループアドレス</li></ul><p>空白の場合は、UDPブロードキャストがオフ.</p></body></html> - + UDP Server port number: UDPサーバーのポート番号: @@ -9582,164 +11856,187 @@ for assessing propagation and system performance. <html><head/><body><p>WSJT-Xがデータを送る先のUDPポート番号. ゼロの場合はデータを送りません.</p></body></html> - + <html><head/><body><p>With this enabled WSJT-X will accept certain requests back from a UDP server that receives decode messages.</p></body></html> <html><head/><body><p>オンにすると、WSJT-XはUDPサーバーからのデータを受け付けます.</p></body></html> - + Accept UDP requests UDP要求を受け付ける - + <html><head/><body><p>Indicate acceptance of an incoming UDP request. The effect of this option varies depending on the operating system and window manager, its intent is to notify the acceptance of an incoming UDP request even if this application is minimized or hidden.</p></body></html> <html><head/><body><p>UDPリクエストを受け付けたことを表示. OSやウィンドウマネージャによって動作が変わります. アプリウィンドウが最小化されていたり隠れていたりしていてもUDPリクエストが送られてきたことを知るために使うことができます.</p></body></html> - + Notify on accepted UDP request UDPリクエストが来たとき知らせる - + <html><head/><body><p>Restore the window from minimized if an UDP request is accepted.</p></body></html> <html><head/><body><p>UDPリクエストが来たとき、ウィンドウを最小化から元の大きさへ戻します.</p></body></html> - + Accepted UDP request restores window ウィンドウを元に戻すUDPリクエストを受け付ける - + Secondary UDP Server (deprecated) セカンドUDPサーバー(使わないことを推奨) - + <html><head/><body><p>When checked, WSJT-X will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html> <html><head/><body><p>ここをチェックすると、WSJT-XはADIFフォーマットのログ情報を指定のホストの指定のポートへブロードキャストします. </p></body></html> - + Enable logged contact ADIF broadcast ADIFログ情報をブロードキャスト - + Server name or IP address: サーバー名またはIPアドレス: - + <html><head/><body><p>Optional host name of N1MM Logger+ program to receive ADIF UDP broadcasts. This is usually 'localhost' or ip address 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable broadcasting of ADIF information via UDP.</p></body></html> <html><head/><body><p>ADIF UDP ブロードキャストを受けるN1MM Logger+のホスト名. 通常は 'localhost' または ip アドレス 127.0.0.1</p><p>フォーマット:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">ホスト名</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 マルチキャストグループアドレス</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 マルチキャストグループアドレス</li></ul><p>空白にすることで、UDP経由のADIF情報ブロードキャストを停止.</p></body></html> - + Server port number: サーバーのポート番号: - + <html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html> <html><head/><body><p>WSJT-XがADIF情報をブロードキャストする先のUDPポート番号. N1MM Logger+のときは2333. ゼロの場合はブロードキャスト停止.</p></body></html> - + Frequencies 周波数 - + Default frequencies and band specific station details setup デフォルト周波数及びバンドごとの局情報設定 - + <html><head/><body><p>See &quot;Frequency Calibration&quot; in the WSJT-X User Guide for details of how to determine these parameters for your radio.</p></body></html> <html><head/><body><p>あなたの無線機に合わせたパラメータ設定の詳細については、WSJT-Xユーザーガイドの &quot;Frequency Calibration&quot; セクションを参照のこと.</p></body></html> - + Frequency Calibration 周波数較正 - + Slope: スロープ: - + ppm - + Intercept: インターセプト: - + Hz - + Working Frequencies 運用周波数 - + + + Insert, delete, load, save, merge, or reset working frequencies. + + + + + Working frequencies actions + + + + + + + Actions... + + + + <html><head/><body><p>Right click to maintain the working frequencies list.</p></body></html> <html><head/><body><p>右クリックで周波数リストの管理.</p></body></html> - + Station Information 局情報 - + + + Insert or delete station information rows. + + + + + Station information actions + + + + Items may be edited. Right click for insert and delete options. 項目は編集できます. 右クリックで挿入や削除が選べます. - + Colors 色 - + Decode Highlightling デコードハイライト - Reset Highlighting to WSJT-X default - ハイライト設定をWSJT-Xデフォルトへリセット - - - - Reset Highlighting to WSJT-X Improved default - ハイライト設定をWSJT-X improvedデフォルトへリセット + ハイライト設定をWSJT-Xデフォルトへリセット - + <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> クリックすることでADIFファイル(wsjtx_log.adi)を読み直し、交信済みの情報を得る - + Rescan ADIF Log ADIFログを再読み込み - + <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> <html><head/><body><p>ここから上すべてのハイライト項目のデフォルト値と優先度をリセットする.</p></body></html> @@ -9748,122 +12045,121 @@ Right click for insert and delete options. ハイライトをリセット - + <html><head/><body><p>Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.</p><p>Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.</p></body></html> <html><head/><body><p>チェックボックスでオンオフを切り替え、右クリックで項目を編集、文字色、背景色を指定、あるいはデフォルト値へリセット. ドラッグアンドドロップで項目の優先順位を変更、リストの上にいくほど優先度高.</p><p>文字色と背景色はそれぞれ指定または解除が選択可能. 解除とはその項目では色指定されないが、より低い優先度の項目で指定されるかもしれないという意味.</p></body></html> - + <html><head/><body><p>Check to indicate new DXCC entities, grid squares, and callsigns per mode.</p></body></html> <html><head/><body><p>チェックするとモードごとに新DXCCエンティティ、新グリッドスクエア、新コールサインを表示します.</p></body></html> - + Highlight by Mode モードハイライト - + Include extra WAE entities WAEの特別エンティティを含む - + Check to for grid highlighting to only apply to unworked grid fields チェックするとグリッドハイライトは未交信グリッドのみに適用 - + Only grid Fields sought グリッドのみ検索 - + <html><head/><body><p>Controls for Logbook of the World user lookup.</p></body></html> <html><head/><body><p>LotWユーザー参照設定.</p></body></html> - + Logbook of the World User Validation LotWユーザー確認 - + Users CSV file URL: ユーザーのCSVファイルURL: - + <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> <html><head/><body><p>ARRL LotWのURL. QSO相手がLotWを使っているかどうかを判定しハイライトするために、相手がいつログデータをLotWへアップロードしたか調べます.</p></body></html> - URL - URL + URL - + <html><head/><body><p>Push this button to fetch the latest LotW user's upload date and time data file.</p></body></html> <html><head/><body><p>このボタンを押すとQSO相手が最近いつLotWへログをアップロードしたかという情報を取得します.</p></body></html> - + Fetch Now データ取り込み - + Age of last upload less than: 最終アップロード日がこの日数以内: - + <html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html> <html><head/><body><p>このスピンボックスを使ってLotWユーザが過去何日以内にLotWへログをアップデートしたらLotWを現在も使っていると判断するか指定します.</p></body></html> - + days 日 - + Advanced 詳細 - + <html><head/><body><p>User-selectable parameters for JT65 VHF/UHF/Microwave decoding.</p></body></html> <html><head/><body><p>JT65 VHF/UHF/Microwaveデコードのユーザパラメータ設定.</p></body></html> - + JT65 VHF/UHF/Microwave decoding parameters JT65 VHF/UHF/Microwave デコードパラメータ - + Random erasure patterns: ランダム消去パターン: - + <html><head/><body><p>Maximum number of erasure patterns for stochastic soft-decision Reed Solomon decoder is 10^(n/2).</p></body></html> <html><head/><body><p>確率的判定の最大ランダム消去パターン数 Reed Solomon デコーダーは 10^(n/2).</p></body></html> - + Aggressive decoding level: 積極的デコードレベル: - + <html><head/><body><p>Higher levels will increase the probability of decoding, but will also increase probability of a false decode.</p></body></html> <html><head/><body><p>大きな値にするとデコードする確率は高まりますが、同時に誤ったデータを出力する可能性も高まります.</p></body></html> - + Two-pass decoding 2パスデコード @@ -9872,45 +12168,45 @@ Right click for insert and delete options. 特別な運用 FT4, FT8, MSK144用のメッセージ生成 - + <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> <html><head/><body><p>FT8 DXペディションモード: DXを呼ぶHound オペレータ</p></body></html> - - + + Hound - + <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> <html><head/><body><p>北アメリカ VHF/UHF/Microwave コンテストなど、コンテストナンバーとして4桁のグリッドロケーター使う場合.</p></body></html> - + NA VHF Contest NA VHFコンテスト - + <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> <html><head/><body><p>FT8 DXペディションモード: Fox (DXペディションのオペレータ).</p></body></html> - - + + Fox - + <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> <html><head/><body><p>European VHF+ コンテスト, コンテストナンバーとしてシグナルレポート、シリアルナンバー、6桁のロケータを交換する場合.</p></body></html> - - + + EU VHF Contest EU VHFコンテスト @@ -9919,683 +12215,979 @@ Right click for insert and delete options. <html><head/><body><p>ARRL RTTY ラウンドアップなどのコンテスト. コンテストナンバーはアメリカ州、カナダ州、または &quot;DX&quot;.</p></body></html> - R T T Y Roundup - R T T Y ラウンドアップ + R T T Y ラウンドアップ RTTY Roundup messages RTTYラウンドアップメッセージ - RTTY Roundup exchange - RTTYラウンドアップコンテストナンバー + RTTYラウンドアップコンテストナンバー - + NJ - - + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> <html><head/><body><p>ARRL フィールドデーのコンテストナンバー、送信機, クラス, ARRL/RAC セクション または &quot;DX&quot;.</p></body></html> - A R R L Field Day - A R R L フィールドデー + A R R L フィールドデー - + + ARRL Field Day ARRLフィールドデー - + + Field Day exchange フィールドデーコンテストナンバー - + FD Exch: FD ナンバー: - + 6A SNJ - + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> <html><head/><body><p>World-Wide デジモードコンテスト</p><p><br/></p></body></html> - WW Digital Contest - WWデジタルコンテスト + WWデジタルコンテスト - + + WW Digi Contest WWデジタルコンテスト - + Miscellaneous その他 - + Degrade S/N of .wav file: wavファイルのSN比を落とす: - - + + For offline sensitivity tests オフライン感度テスト用 - - + + dB dB - + Log automatically 自動的にログ - + <html><head/><body><p>Use 'Log automatically' only for special operating activities.</p></body></html> <html><head/><body><p>「自動的にログ」は特別な運用時のみ使うこと.</p></body></html> - + Contesting only コンテストのみ - + <html><head/><body><p>Shorten 6-digit grid entries and log 4-digit grids instead.</p></body></html> <html><head/><body><p>6桁グリッドを4桁グリッドに変換してログ.</p></body></html> - + Log 4-digit grids 4桁グリッドをログ - + Highlight also messages with 73 or RR73 73とRR73を含むメッセージもハイライト - - <html><head/><body><p>Highlight callsigns or grids with orange background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - <html><head/><body><p>コールサインやグリッドをオレンジ色の背景でハイライトします. コールサインおよび/またはグリッドはカンマで区切り、各コールサインの後にもカンマを付ける必要があります.</p></body></html> + <html><head/><body><p>コールサインやグリッドをオレンジ色の背景でハイライトします. コールサインおよび/またはグリッドはカンマで区切り、各コールサインの後にもカンマを付ける必要があります.</p></body></html> - + Highlight orange: オレンジにハイライト: - - <html><head/><body><p>Highlight callsigns or grids with blue background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - <html><head/><body><p>コールサインやグリッドを青色の背景でハイライトします. コールサインやグリッドはカンマで区切り、各コールサインの後にもカンマを付ける必要があります.</p></body></html> + <html><head/><body><p>コールサインやグリッドを青色の背景でハイライトします. コールサインやグリッドはカンマで区切り、各コールサインの後にもカンマを付ける必要があります.</p></body></html> - + Highlight blue: 青くハイライト: - + http://lotw.arrl.org/lotw-user-activity.csv - + CTY File Download CTY File ダウンロード - + CTY File Version: CTY File バージョン: - + Download Latest CTY.dat 最新 CTY.datをダウンロード - + CALL3 File Download CALL3 File ダウンロード - + CALL3 File Version: CALL3 File バージョン: - + Dowload latest CALL3.TXT file. 最新CALL3.TXT fileダウンロード. - + Download CALL3.TXT for terrestrial use 陸上通信向けに CALL3.TXT をダウンロード - + Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. EME用に最新CALL3.TXTをダウンロード. このバージョンはJT65ディープサーチに適しています。 - + Download CALL3.TXT for EME EME用にCALL3.TXTをダウンロード - + GUI tweaks for high-resolution monitors 高解像度モニター向けGUI調整 - + <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> <html><head/><body><p>HighDPI スケーリングを有効にすると、4K モニター上でコントロールがより大きく、かつ正しい比率で表示されます(OS が対応している場合).</p></body></html> - + HighDPI scaling (restart required) High DPIスケーリング(要再起動) - + <html><head/><body><p>Increased height of some control elements.</p></body></html> <html><head/><body><p>いくつかのコントロールエレメントの表示高さを増やす.</p></body></html> - + Increased height of the tab widget (restart required) タブウィジェットの表示高さを増やす(要再起動) - Enable Cloudlog Features - Cloudlog機能をオン + Cloudlog機能をオン - + API URL: - + API Key: - - Station ID: - - - - <html><head/><body><p>Test the Cloudlog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> - <html><head/><body><p> Cloudlog API keyをテスト.</p><p>APIキーが書き込めるとボタンは緑色になります. Read-onlyの時はオレンジ色になります. APIキーが無効の時は赤色になります.</p></body></html> + <html><head/><body><p> Cloudlog API keyをテスト.</p><p>APIキーが書き込めるとボタンは緑色になります. Read-onlyの時はオレンジ色になります. APIキーが無効の時は赤色になります.</p></body></html> - Test API Key - API key テスト + API key テスト - + Special operating activity スペシャル運用 - + <html><head/><body><p>ARRL International Digital Contest</p></body></html> - + ARRL Digi Contest - + <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> <html><head/><body><p> NCCC Sprint FT4 ショートメッセージプロトコル On/Off.</p></body></html> - + NCCC Sprint - - + + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> <html><head/><body><p>FT Roundupと類似のコンテスト. コンテストナンバーは米国州、カナダ州, または &quot;DX&quot;.</p></body></html> - + + FT Roundup messages FT Roundup メッセージ - + FT RU Exch: - + <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> <html><head/><body><p>チェックするとSuperFox波形で送信(Fox)または受信(Hound).</p></body></html> - + SuperFox mode SuperFoxモード - + <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> <html><head/><body><p>OTPメッセージをバンドアクティビティウィンドウ内に表示.</p></body></html> - + Show OTP messages OTPメッセージを表示 - + OTP URL: - + <html><head/><body><p>URL used to verify OTP codes.</p></body></html> <html><head/><body><p>OTPコードを検証するためのURL.</p></body></html> - + https://www.9dx.cc - + NA VHF - + <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> <html><head/><body><p>クリックしてFox検証のOTPをオン. 要インターネット接続.</p></body></html> - + OTP - + Key: - + <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> <html><head/><body><p>OTPコードを生成するためのFoxキー.</p></body></html> - + M2ZUU5CW6EVOY2HU - + Interval インターバル - + <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> <html><head/><body><p>OTP メッセージを送信する間隔. すべてのメッセージに署名する場合は「1」を選択してください.</p></body></html> - + <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> <html><head/><body><p>TEST, RU, WW ではなく、コンテスト名をつけてCQを送信(例 CQ PACC).</p></body></html> - + CQ with individual contest name コンテスト名付きCQ - + Contest name: コンテスト名: - + <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> <html><head/><body><p>信号レポートの代わりに 4 文字のロケーターを交換します. DX オペレーターに q3 レベルの感度情報を提供します. 特に 6m EME DXpedition に便利です.</p></body></html> - + Q65 Pileup - + Receiver bandwidth: 受信バンド幅: - + + <html><head/><body><p>Download the latest libhamlib-4.dll file from Hamlib SourceForge snapshots. </p><p>Note: This function is only available on Windows.</p></body></html> + + + + + Delete Tx macro + + + + + Deletes the selected Tx macro, or the focused macro if no row is selected. + + + + + Move &Up + + + + + Move Tx macro up + + + + + Moves the selected Tx macro one position earlier in the list. + + + + + Move D&own + + + + + Move Tx macro down + + + + + Moves the selected Tx macro one position later in the list. + + + + + Drag and drop items to rearrange order +Right click for item specific actions +Click, SHIFT+Click and, CTRL+Click to select items + + + + + Saved Tx macro messages + + + + + Saved free-text messages for the main window Tx5 dropdown. Use Move Up and Move Down or drag and drop to reorder messages. + + + + + Change or reset colors for the selected highlighting rule. + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move Up + + + + + Move the selected highlighting rule later in priority order. + + + + + Move Down + + + + + Reset Highlighting to Default 1 + + + + + Reset Highlighting to Default 2 + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with orange background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with blue background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + LotW users CSV URL + + + + + + <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> + + + + + Cloudlog or Wavelog + + + + + + Upload QSOs to Cloudlog or Wavelog + + + + + + <html><head/><body><p>API URL for Cloudlog or Wavelog.</p></body></html> + + + + + + <html><head/><body><p>Your API key.</p></body></html> + + + + + + <html><head/><body><p>Your Cloudlog or Wavelog station profile.</p></body></html> + + + + + Station profile: + + + + + <html><head/><body><p>Check the Cloudlog or Wavelog connection, API key, station profile, and upload path where safe.</p><p>The button will turn green if the connection can upload QSOs, orange if the key is valid but read-only, and red if the configuration is unusable.</p></body></html> + + + + + Check Connection + + + + Hz Hz - + Tx delay: 送信遅延: - + Minimum delay between assertion of PTT and start of Tx audio. PTTをオンにしてからオーディオ信号を発生するまでの最小時間. - + s - - + + Tone spacing トーン間隔 - + <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> <html><head/><body><p>通常の2倍のトーン間隔を持った信号を送信. 電波を出す際に周波数を2分の1にする特別なLF/MF送信機用.</p></body></html> - + + 2x tone spacing + + + + x 2 x 2 - + <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> <html><head/><body><p>通常の4倍のトーン間隔を持った信号を送信. 電波を出す際に周波数を4分の1にする特別なLF/MF送信機用.</p></body></html> - + + 4x tone spacing + + + + x 4 x 4 - - + + Waterfall spectra ウォーターフォールスペクトラム - + Low sidelobes サイドローブ表示控え目 - + Most sensitive 最大感度 - + + + <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> + + + + + eQSL.cc + + + + + + Upload QSOs to eQSL.cc + + + + + + <html><head/><body><p>Your username.</p></body></html> + + + + + Username: + + + + + + <html><head/><body><p>Your logon password.</p></body></html> + + + + + Password: + + + + + + <html><head/><body><p>Your QTH nickname, if you have more than one QTH.</p></body></html> + + + + + QTH: + + + + + + Enable special operating activity + + + + + Enable OTP verification + + + + + + OTP key + + + + + + OTP interval + + + + + + OTP URL + + + + + + FT Roundup exchange + + + + + + Contest name + + + + Alerts - + + NOTES + + + + + "Wanted callsigns, grids, prefixes and directional calls" uses the entries from "Highlight orange" and "Highlight blue". + + + + + <html><head/><body><p>Wanted callsigns, grids, prefixes and directional calls. This alert category uses the entries from &quot;Highlight orange&quot; and &quot;Highlight blue&quot;.</p></body></html> + + + + + Wanted callsigns, grids, prefixes and directional calls + + + + + IMPORTANT + + + + + Voices: + + + + + default + + + + + <html><head/><body><p>Test the alert sounds.</p></body></html> + + + + + Test + + + + Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. ラインの上にアラートカテゴリを表示するには、[一般] タブで「DXCC、グリッド、および交信済みステータスを表示」チェックボックスがオンになっている必要があります. - THIS FEATURE IS FOR EXPERIENCED USERS ONLY - この機能は熟練ユーザ専用です + この機能は熟練ユーザ専用です - + Ensure that you have made meaningful settings on the Colors tab, so that you see which message triggered the alert. アラートを発生させたメッセージがどれか分かるように、[色] タブで適切な設定を行ってください. - + Ensure that your rig is NOT connected via "Default Device". リグがデフォルトデバイス経由で繋がっていないことを確認してください. - + Audio Alerts オーディオアラート - - + + New ITU Zone on Band バンドの新ITUゾーン - - + + New Continent 新大陸 - - + + DX Call or DX Grid in message メッセージ内のDXコールまたはDXグリッド - - + + New Grid 新グリッド - - + + New Continent on Band バンドの新大陸 - + Message received 受信メッセージ - - + + New ITU Zone 新ITUゾーン - - + + New CQ Zone 新CQゾーン - - + + New DXCC on Band バンドの新DXCC - + My Call in message メッセージ中のマイコール - + My Call - - + + New CQ Zone on Band バンドの新CQゾーン - - + + New DXCC 新DXCC - - + + New Grid on Band バンドの新グリッド - - + + CQ in message CQを含むメッセージ - + Toggle Audio Alerts on/off. Alerts will be played on "DefaultAudioDevice". DON'T ENABLE AUDIO ALERTS WHEN YOUR RIG IS CONNECTED VIA THIS SOUNDCARD !!! オーディオアラートのオン/オフを切り替えます. アラートは「DefaultAudioDevice」で再生されます. 無線機がこのサウンドカード経由で接続されている場合はオーディオアラートを有効にしないでください!!! - + Enable Audio Alerts オーディオアラートをオン - + This requirement is fulfilled when your rig is connected via USB audio. この要件は、無線機が USB オーディオ経由で接続されている場合に満たされます. - + Audio Alerts will be played on the default audio device (usually the loudspeaker of your PC). オーディオアラートは、デフォルトのオーディオデバイス(通常は PC のスピーカー)で再生されます. - IMPORTANT NOTES - 重要確認事項 + 重要確認事項 - + Use of this feature requires that your computer is equipped with two sound cards. この機能を使うためにはPCにサウンドデバイスが2つ以上装備されている必要があります。 - + Filters フィルタ - + Territories 1-4 for the Hide checkboxes in the View menu ビュー メニューにある「非表示」チェックボックス用のテリトリー 1~4 - + Blacklist ブラックリスト - + Filters for the Band Activity window バンドアクティビティウィンドウ用フィルタ - + Hide messages containing the following callsigns or keywords: 次のコールサインまたはキーワードを含むメッセージを隠す: - + Show only messages containing the following callsigns or keywords: 以下のコールサインまたはキーワードを含むメッセージのみを表示: - + <html><head/><body><p>Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed).</p></body></html> <html><head/><body><p>フィルタを『ウェイト&パウンス』や『CQ: First』などにのみ使用(すべてのメッセージは引き続き表示されます).</p></body></html> - + Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed) フィルタを『ウェイト&パウンス』や『CQ: First』などにのみ使用(すべてのメッセージは引き続き表示されます) - + Always pass messages with the following keywords: 以下のキーワードを含むメッセージはいつも透過させる: - + Whitelist ホワイトリスト - + <html><head/><body><p>Apply filters only to the callsigns of the calling stations. Usually the second word of the messages is analyzed, for directional calls the third word.</p></body></html> <html><head/><body><p>フィルタを呼び出し局のコールサインにのみ適用します。通常、メッセージの2番目の単語が解析され、選択的コールの場合は3番目の単語が解析されます.</p></body></html> - + Apply filters only to the callsigns of the calling stations 呼び出し局のコールサインにのみフィルタを適用 - + Always Pass 常に透過 - + <html><head/><body><p>Use “worked today and yesterday” instead of “worked today” for the 3 related Quick Filters.</p></body></html> <html><head/><body><p>3つの関連するクイックフィルターに対して「今日交信済み」の代わりに「今日および昨日交信済み」を使用します.</p></body></html> - + Quick Filters: Hide/Ignore/Highlight "worked today and yesterday" instead of "worked today" (UTC) クイックフィルター: 「今日交信済み(UTC)」の代わりに「今日および昨日交信済み(UTC)」を非表示/無視/強調表示 - + <html><head/><body><p>Discard (Cancel) or apply (OK) configuration changes including</p><p>resetting the radio interface and applying any soundcard changes</p></body></html> <html><head/><body><p>コンフィグレーション変更の破棄 (キャンセル) または 適用 (OK)</p><p>無線機インターフェイスのリセットとサウンドカードの変更を含む</p></body></html> @@ -10651,61 +13243,118 @@ Right click for insert and delete options. アプリのバージョン + Another instance may be running - おそらく他のインスタンスが動作中 + おそらく他のインスタンスが動作中 try to remove stale lock file? 古いロックファイルの削除を試みますか? - + + Lock file: %1 + + + + + Owner process: %1 + + + + + Owner application: %1 + + + + + Owner host: %1 + + + + + Owner information is not available. + + + + + Remove error: %1 + + + + + WSJT-X could not lock its temporary instance file. + +If another WSJT-X window is still running, choose No. +Use a unique rig name to run more than one instance. + +If WSJT-X crashed or will not restart, choose Remove Lock File. +Choose Retry after closing the other instance. + + + + + Remove Lock File + + + + + Unable to remove stale lock file + + + + + Close any running WSJT-X instance or remove the lock file manually after confirming WSJT-X is not running. + + + + Failed to create a temporary directory 一時的作業ディレクトリーが作成できません - - + + Path: "%1" パス:"%1" - + Failed to create a usable temporary directory 一時的作業ディレクトリが作成できません - + Another application may be locking the directory おそらく他のアプリがディレクトリをロックしています - + Failed to create data directory データ用ディレクトリの作成ができません - + path: "%1" パス: "%1" - + Shared memory error 共有メモリエラー - + Unable to create shared memory segment 共有メモリセグメントが作成できません - + Sub-process error サブプロセスエラー - + Failed to close orphaned jt9 process jt9の孤立したプロセスを終了できません diff --git a/translations/wsjtx_pl.ts b/translations/wsjtx_pl.ts new file mode 100644 index 00000000..5c8c7685 --- /dev/null +++ b/translations/wsjtx_pl.ts @@ -0,0 +1,10048 @@ + + + + AbstractLogWindow + + + &Delete ... + &Usuń ... + + + + AbstractLogWindow::impl + + + Confirm Delete + Potwierdź usunięcie + + + + Are you sure you want to delete the %n selected QSO(s) from the log? + + Czy na pewno chcesz usunąć %n zaznaczone QSO z logu? + Czy na pewno chcesz usunąć %n zaznaczone QSO z logu? + Czy na pewno chcesz usunąć %n zaznaczonych QSO z logu? + + + + + ActiveStations + + + Message Averaging + Uśrednianie wiadomości + + + + Band Changes: + Zmiany pasma: + + + + <html><head/><body><p>Total score accumulated since most recent reset of Cabrillo log.</p></body></html> + <html><head/><body><p>Łączny wynik zgromadzony od ostatniego wyzerowania logu Cabrillo.</p></body></html> + + + + + + 0 + 0 + + + + <html><head/><body><p>Points logged during the past hour.</p></body></html> + <html><head/><body><p>Punkty zalogowane w ciągu ostatniej godziny.</p></body></html> + + + + <html><head/><body><p>Check this box to show only stations ready to be called.</p></body></html> + <html><head/><body><p>Zaznacz to pole, aby wyświetlać tylko stacje gotowe do wywołania.</p></body></html> + + + + Ready only + Tylko gotowe + + + + # Wanted only + # Tylko poszukiwane + + + + Score: + Wynik: + + + + Rate: + Tempo: + + + + <html><head/><body><p>Set maximum elapsed number of T/R sequences.</p></body></html> + <html><head/><body><p>Ustaw maksymalną liczbę minionych sekwencji T/R.</p></body></html> + + + + Max Age + Maks. wiek + + + + <html><head/><body><p>Set maximum number of displayed lines.</p></body></html> + <html><head/><body><p>Ustaw maksymalną liczbę wyświetlanych wierszy.</p></body></html> + + + + Max N + Maks. N + + + + <html><head/><body><p>Number of band changes during the past hour.</p></body></html> + <html><head/><body><p>Liczba zmian pasma w ciągu ostatniej godziny.</p></body></html> + + + + <html><head/><body><p>Click on a line to call that station. </p><p>When using QMAP, single click to transfer QSO data and sked frequency to WSJT-X, and double click to call that station.</p></body></html> + <html><head/><body><p>Kliknij wiersz, aby wywołać tę stację. </p><p>Podczas używania QMAP pojedyncze kliknięcie przekazuje dane QSO i częstotliwość skedu do WSJT-X, a podwójne kliknięcie wywołuje tę stację.</p></body></html> + + + + Active Stations + Aktywne stacje + + + + + Wanted only + Tylko poszukiwane + + + + Message + Wiadomość + + + + My call only + Tylko mój znak + + + + Astro + + + + Doppler tracking + Śledzenie Dopplera + + + + <html><head/><body><p>One station does all Doppler shift correction, their QSO partner receives and transmits on the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> + <html><head/><body><p>Jedna stacja wykonuje całą korekcję przesunięcia Dopplera, a jej korespondent odbiera i nadaje na częstotliwości skedu.</p><p>Jeżeli radio nie przyjmuje poleceń CAT QSY podczas nadawania, jedna korekcja jest stosowana przez cały okres nadawania.</p></body></html> + + + + Full Doppler to DX Grid + Pełny Doppler do lokatora DX + + + + <html><head/><body><p>Transmit takes place on sked frequency and receive frequency is corrected for own echoes. </p><p>This mode can be used for calling CQ, or when using Echo mode.</p></body></html> + <html><head/><body><p>Nadawanie odbywa się na częstotliwości skedu, a częstotliwość odbioru jest korygowana dla własnych ech.</p><p>Trybu można używać do wywoływania CQ lub podczas pracy w trybie Echo.</p></body></html> + + + + Own Echo + Własne echo + + + + <html><head/><body><p>Both stations correct for Doppler shift such that they would be heard on the moon at the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p><p>Use this option also for Echo mode.</p></body></html> + <html><head/><body><p>Obie stacje korygują przesunięcie Dopplera tak, aby na Księżycu były słyszane na częstotliwości skedu.</p><p>Jeżeli radio nie przyjmuje poleceń CAT QSY podczas nadawania, jedna korekcja jest stosowana przez cały okres nadawania.</p><p>Użyj tej opcji również w trybie Echo.</p></body></html> + + + + Constant frequency on Moon + Stała częstotliwość na Księżycu + + + + <html><head/><body><p>DX station announces their TX Freq, which is entered as the Sked Freq. Correction applied to RX and TX so you appear on the DX's station's own echo Freq.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> + <html><head/><body><p>Stacja DX podaje swoją częstotliwość TX, którą należy wprowadzić jako częstotliwość skedu. Korekcja jest stosowana do RX i TX tak, aby Twój sygnał pojawiał się na częstotliwości własnego echa stacji DX.</p><p>Jeżeli radio nie przyjmuje poleceń CAT QSY podczas nadawania, jedna korekcja jest stosowana przez cały okres nadawania.</p></body></html> + + + + On DX Echo + Na echu DX + + + + <html><head/><body><p>Tune radio manually and select this mode to put your echo on the same frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> + <html><head/><body><p>Dostrój radio ręcznie i wybierz ten tryb, aby ustawić własne echo na tej samej częstotliwości.</p><p>Jeżeli radio nie przyjmuje poleceń CAT QSY podczas nadawania, jedna korekcja jest stosowana przez cały okres nadawania.</p></body></html> + + + + Call DX + Wywołaj DX + + + + <html><head/><body><p>No Doppler shift correction is applied. This may be used when the QSO partner does full Doppler correction to your grid square.</p></body></html> + <html><head/><body><p>Korekcja przesunięcia Dopplera nie jest stosowana. Można tego użyć, gdy korespondent wykonuje pełną korekcję Dopplera do Twojego lokatora.</p></body></html> + + + + None + Brak + + + + Sked frequency + Częstotliwość skedu + + + + + 0 + 0 + + + + Rx: + RX: + + + + Tx: + TX: + + + + <html><head/><body><p>Press and hold the CTRL key to adjust the sked frequency manually with the rig's VFO dial or enter frequency directly into the band entry field on the main window.</p></body></html> + <html><head/><body><p>Naciśnij i przytrzymaj klawisz CTRL, aby ręcznie regulować częstotliwość skedu pokrętłem VFO radia, albo wpisz częstotliwość bezpośrednio w polu pasma w głównym oknie.</p></body></html> + + + + Echo Mode + Tryb Echo + + + + Hz + Hz + + + + RIT + RIT + + + + Dither + Dithering + + + + Tx Shift relative to Rx Sked Freq + Przesunięcie TX względem częstotliwości skedu RX + + + + Enter large offset + Wprowadź duże przesunięcie + + + + MHz + MHz + + + + Shift + Przesunięcie + + + + Enable + Włącz + + + + Astro Data + Dane astronomiczne + + + + Astronomical Data + Dane astronomiczne + + + + Bands + + + Band name + Nazwa pasma + + + + Lower frequency limit + Dolna granica częstotliwości + + + + Upper frequency limit + Górna granica częstotliwości + + + + Band + Pasmo + + + + Lower Limit + Dolna granica + + + + Upper Limit + Górna granica + + + + CAboutDlg + + + About WSJT-X + O programie WSJT-X + + + + OK + OK + + + + CabrilloLog + + + Freq(MHz) + Częst. (MHz) + + + + Mode + Tryb + + + + Date & Time(UTC) + Data i czas (UTC) + + + + Call + Znak + + + + Sent + Wysłano + + + + Rcvd + Odebrano + + + + Band + Pasmo + + + + CabrilloLogWindow + + + Contest Log + Log zawodów + + + + <html><head/><body><p>Right-click here for available actions.</p></body></html> + <html><head/><body><p>Kliknij tutaj prawym przyciskiem, aby zobaczyć dostępne działania.</p></body></html> + + + + Right-click here for available actions. + Kliknij tutaj prawym przyciskiem, aby zobaczyć dostępne działania. + + + + 0 QSOs + 0 QSO + + + + CallsignDialog + + + Callsign + Znak wywoławczy + + + + ColorHighlighting + + + + + + + + + + + + + + + + + + K1ABC + K1ABC + + + + CQ in message + CQ w wiadomości + + + + My Call in message + Mój znak w wiadomości + + + + Transmitted message + Wysłana wiadomość + + + + New DXCC + Nowy DXCC + + + + New Grid + Nowy lokator + + + + New DXCC on Band + Nowy DXCC na paśmie + + + + New Call + Nowy znak + + + + New Grid on Band + Nowy lokator na paśmie + + + + New Call on Band + Nowy znak na paśmie + + + + Uploads to LotW + Wysyłanie do LoTW + + + + New Continent + Nowy kontynent + + + + New Continent on Band + Nowy kontynent na paśmie + + + + New CQ Zone + Nowa strefa CQ + + + + New CQ Zone on Band + Nowa strefa CQ na paśmie + + + + New ITU Zone + Nowa strefa ITU + + + + New ITU Zone on Band + Nowa strefa ITU na paśmie + + + + Configuration::impl + + + + + &Delete + &Usuń + + + + + &Insert ... + &Wstaw ... + + + + Failed to create save directory + Nie udało się utworzyć katalogu zapisu + + + + path: "%1% + ścieżka: "%1% + + + + Failed to create samples directory + Nie udało się utworzyć katalogu próbek + + + + path: "%1" + ścieżka: "%1" + + + + API key OK + Klucz API poprawny + + + + API key read-only + Klucz API tylko do odczytu + + + + API key invalid + Nieprawidłowy klucz API + + + + &Load ... + &Wczytaj ... + + + + &Save as ... + &Zapisz jako ... + + + + &Merge ... + &Scal ... + + + + &Reset + &Resetuj + + + + Serial Port: + Port szeregowy: + + + + Serial port used for CAT control + Port szeregowy używany do sterowania CAT + + + + TCI Server: + Serwer TCI: + + + + Optional hostname and port of TCI service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port + Opcjonalna nazwa hosta i port usługi TCI. +Pozostaw puste, aby użyć właściwych ustawień domyślnych dla tego komputera. +Formaty: + nazwa_hosta:port + adres-IPv4:port + [adres-IPv6]:port + + + + Network Server: + Serwer sieciowy: + + + + Optional hostname and port of network service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port + Opcjonalna nazwa hosta i port usługi sieciowej. +Pozostaw puste, aby użyć właściwych ustawień domyślnych dla tego komputera. +Formaty: + nazwa_hosta:port + adres-IPv4:port + [adres-IPv6]:port + + + + USB Device: + Urządzenie USB: + + + + Optional device identification. +Leave blank for a sensible default for the rig. +Format: + [VID[:PID[:VENDOR[:PRODUCT]]]] + Opcjonalna identyfikacja urządzenia. +Pozostaw puste, aby użyć właściwego ustawienia domyślnego dla radia. +Format: + [VID[:PID[:VENDOR[:PRODUCT]]]] + + + + + Invalid audio input device + Nieprawidłowe urządzenie wejścia audio + + + + Invalid audio output device + Nieprawidłowe urządzenie wyjścia audio + + + + Invalid PTT method + Nieprawidłowa metoda PTT + + + + Invalid PTT port + Nieprawidłowy port PTT + + + + + Invalid Contest Exchange + Nieprawidłowa wymiana konkursowa + + + + You must input a valid ARRL Field Day exchange + Musisz wprowadzić poprawną wymianę ARRL Field Day + + + + You must input a valid ARRL RTTY Roundup exchange + Musisz wprowadzić poprawną wymianę ARRL RTTY Roundup + + + + Pending DNS lookup, please try again later + Trwa wyszukiwanie DNS, spróbuj ponownie później + + + + + Reset Decode Highlighting + Resetuj podświetlanie dekodowanych wiadomości + + + + + Reset all decode highlighting and priorities to default values + Przywróć domyślne wartości całego podświetlania dekodowanych wiadomości i priorytetów + + + + Error Loading CTY.DAT + Błąd wczytywania CTY.DAT + + + + Error Loading CALL3.TXT file + Błąd wczytywania pliku CALL3.TXT + + + + WSJT-X Decoded Text Font Chooser + Wybór czcionki dekodowanego tekstu WSJT-X + + + + + Hamlib update only available on Windows. + Aktualizacja Hamlib jest dostępna tylko w Windows. + + + + Error Loading libhamlib-4.dll + Błąd wczytywania libhamlib-4.dll + + + + Hamlib Update successful + +New Hamlib will be used after restart + Aktualizacja Hamlib zakończona pomyślnie + +Nowa wersja Hamlib zostanie użyta po ponownym uruchomieniu + + + + Hamlib successfully reverted + +Reverted Hamlib will be used after restart + Pomyślnie przywrócono poprzednią wersję Hamlib + +Przywrócona wersja Hamlib zostanie użyta po ponownym uruchomieniu + + + + No Hamlib update found that could be reverted + Nie znaleziono aktualizacji Hamlib, którą można przywrócić + + + + Error in network address + Błąd adresu sieciowego + + + + UDP server DNS lookup failed + Nie udało się wyszukać DNS serwera UDP + + + + MAC-ambiguous multicast groups addresses not supported + Niejednoznaczne adresy grup multicast MAC nie są obsługiwane + + + + Load Working Frequencies + Wczytaj częstotliwości robocze + + + + + + Frequency files (*.qrg *.qrg.json);;All files (*.*) + Pliki częstotliwości (*.qrg *.qrg.json);;Wszystkie pliki (*.*) + + + + Replace Working Frequencies + Zastąp częstotliwości robocze + + + + Are you sure you want to discard your current working frequencies and replace them with the loaded ones? + Czy na pewno chcesz odrzucić bieżące częstotliwości robocze i zastąpić je wczytanymi? + + + + Merge Working Frequencies + Scal częstotliwości robocze + + + + Error reading frequency file + Błąd odczytu pliku częstotliwości + + + + + + Not a valid frequencies file + Nieprawidłowy plik częstotliwości + + + + Incorrect file magic + Nieprawidłowy nagłówek pliku + + + + Version is too new + Wersja jest zbyt nowa + + + + Contents corrupt + Uszkodzona zawartość + + + + Save Working Frequencies + Zapisz częstotliwości robocze + + + + Only Save Selected Working Frequencies + Zapisz tylko zaznaczone częstotliwości robocze + + + + Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. + Czy na pewno chcesz zapisać tylko aktualnie zaznaczone częstotliwości robocze? Kliknij Nie, aby zapisać wszystkie. + + + + Reset Working Frequencies + Resetuj częstotliwości robocze + + + + Are you sure you want to discard your current working frequencies and replace them with default ones? + Czy na pewno chcesz odrzucić bieżące częstotliwości robocze i zastąpić je domyślnymi? + + + + Save Directory + Katalog zapisu + + + + AzEl Directory + Katalog AzEl + + + + Rig control error + Błąd sterowania radiem + + + + Failed to open connection to rig + Nie udało się otworzyć połączenia z radiem + + + + Rig failure + Błąd radia + + + + Not found + audio device missing + Nie znaleziono + + + + DXLabSuiteCommanderTransceiver + + + Failed to connect to DX Lab Suite Commander + + Nie udało się połączyć z DX Lab Suite Commander + + + + + DX Lab Suite Commander didn't respond correctly reading frequency: + DX Lab Suite Commander nie odpowiedział prawidłowo podczas odczytu częstotliwości: + + + + DX Lab Suite Commander sent an unrecognised TX state: + DX Lab Suite Commander przesłał nierozpoznany stan TX: + + + + DX Lab Suite Commander didn't respond correctly polling TX status: + DX Lab Suite Commander nie odpowiedział prawidłowo podczas odpytywania stanu TX: + + + + Transceiver did not respond to PTT On/Off quickly enough; +reduce DX Lab Suite Commander's 'Command Interval' setting +or contact DXLab support at DXLab@groups.io. + Transceiver nie odpowiedział wystarczająco szybko na włączenie/wyłączenie PTT; +zmniejsz ustawienie „Command Interval” w DX Lab Suite Commander +lub skontaktuj się z pomocą DXLab pod adresem DXLab@groups.io. + + + + DX Lab Suite Commander didn't respond correctly polling frequency: + DX Lab Suite Commander nie odpowiedział prawidłowo podczas odpytywania częstotliwości: + + + + DX Lab Suite Commander didn't respond correctly polling TX frequency: + DX Lab Suite Commander nie odpowiedział prawidłowo podczas odpytywania częstotliwości TX: + + + + DX Lab Suite Commander sent an unrecognised split state: + DX Lab Suite Commander przesłał nierozpoznany stan split: + + + + DX Lab Suite Commander didn't respond correctly polling split status: + DX Lab Suite Commander nie odpowiedział prawidłowo podczas odpytywania stanu split: + + + + DX Lab Suite Commander sent an unrecognised mode: " + DX Lab Suite Commander przesłał nierozpoznany tryb: " + + + + DX Lab Suite Commander didn't respond correctly polling mode: + DX Lab Suite Commander nie odpowiedział prawidłowo podczas odpytywania trybu: + + + + DX Lab Suite Commander send command failed + + Nie udało się wysłać polecenia DX Lab Suite Commander + + + + + DX Lab Suite Commander send command failed "%1": %2 + + Nie udało się wysłać polecenia DX Lab Suite Commander "%1": %2 + + + + + DX Lab Suite Commander send command "%1" read reply failed: %2 + + Nie udało się odczytać odpowiedzi na polecenie DX Lab Suite Commander "%1": %2 + + + + + DX Lab Suite Commander retries exhausted sending command "%1" + Wyczerpano liczbę prób wysłania polecenia DX Lab Suite Commander "%1" + + + + DX Lab Suite Commander sent an unrecognized frequency + DX Lab Suite Commander przesłał nierozpoznaną częstotliwość + + + + DecodeHighlightingListView + + + &Foreground color ... + Kolor &tekstu ... + + + + Choose %1 Foreground Color + Wybierz kolor tekstu %1 + + + + &Unset foreground color + &Usuń kolor tekstu + + + + &Background color ... + Kolor &tła ... + + + + Choose %1 Background Color + Wybierz kolor tła %1 + + + + U&nset background color + U&suń kolor tła + + + + &Reset this item to defaults + &Przywróć ustawienia domyślne tego elementu + + + + DecodeHighlightingModel + + + CQ in message + CQ w wiadomości + + + + My Call in message + Mój znak w wiadomości + + + + Transmitted message + Wysłana wiadomość + + + + New DXCC + Nowy DXCC + + + + New DXCC on Band + Nowy DXCC na paśmie + + + + New Grid + Nowy lokator + + + + New Grid on Band + Nowy lokator na paśmie + + + + New Call + Nowy znak + + + + New Call on Band + Nowy znak na paśmie + + + + New Continent + Nowy kontynent + + + + New Continent on Band + Nowy kontynent na paśmie + + + + New CQ Zone + Nowa strefa CQ + + + + New CQ Zone on Band + Nowa strefa CQ na paśmie + + + + New ITU Zone + Nowa strefa ITU + + + + New ITU Zone on Band + Nowa strefa ITU na paśmie + + + + LoTW User + Użytkownik LoTW + + + + f/g unset + kolor tekstu nieustawiony + + + + b/g unset + kolor tła nieustawiony + + + + Highlight Type + Typ podświetlenia + + + + Designer + + + &Delete + &Usuń + + + + &Insert ... + &Wstaw ... + + + + Insert &after ... + Wstaw &po ... + + + + Import Palette + Importuj paletę + + + + + Palettes (*.pal) + Palety (*.pal) + + + + Export Palette + Eksportuj paletę + + + + Dialog + + + Gray time: + Czas szarej linii: + + + + Directory + + + File + Plik + + + + Progress + Postęp + + + + + URL Error + Błąd URL + + + + + Invalid URL: +"%1" + Nieprawidłowy URL: +"%1" + + + + + + + + + + JSON Error + Błąd JSON + + + + Contents file syntax error %1 at character offset %2 + Błąd składni pliku zawartości: %1 przy przesunięciu znaku %2 + + + + Contents file top level must be a JSON array + Najwyższy poziom pliku zawartości musi być tablicą JSON + + + + File System Error + Błąd systemu plików + + + + Failed to open "%1" +Error: %2 - %3 + Nie udało się otworzyć "%1" +Błąd: %2 - %3 + + + + Contents entries must be a JSON array + Wpisy zawartości muszą być tablicą JSON + + + + Contents entries must have a valid type + Wpisy zawartości muszą mieć prawidłowy typ + + + + Contents entries must have a valid name + Wpisy zawartości muszą mieć prawidłową nazwę + + + + Contents entries must be JSON objects + Wpisy zawartości muszą być obiektami JSON + + + + Contents directories must be relative and within "%1" + Katalogi zawartości muszą być względne i znajdować się w obrębie "%1" + + + + Network Error + Błąd sieci + + + + Authentication required + Wymagane uwierzytelnienie + + + + DisplayText + + + &Erase + &Wyczyść + + + + EchoGraph + + + + Echo Graph + Wykres echa + + + + <html><head/><body><p>Compression factor for frequency scale</p></body></html> + <html><head/><body><p>Współczynnik kompresji skali częstotliwości</p></body></html> + + + + Bins/Pixel + Przedziały/piksel + + + + Gain + Wzmocnienie + + + + <html><head/><body><p>Echo spectrum gain</p></body></html> + <html><head/><body><p>Wzmocnienie widma echa</p></body></html> + + + + Zero + Zero + + + + <html><head/><body><p>Echo spectrum zero</p></body></html> + <html><head/><body><p>Poziom zerowy widma echa</p></body></html> + + + + Baseline + Poziom bazowy + + + + <html><head/><body><p>Smoothing of echo spectrum</p></body></html> + <html><head/><body><p>Wygładzanie widma echa</p></body></html> + + + + Smooth + Wygładzanie + + + + <html><head/><body><p>Number of echo transmissions averaged</p></body></html> + <html><head/><body><p>Liczba uśrednianych transmisji echa</p></body></html> + + + + N: 0 + N: 0 + + + + <html><head/><body><p>Click to cycle through a sequence of colors and line widths.</p></body></html> + <html><head/><body><p>Kliknij, aby przełączać kolejno zestaw kolorów i grubości linii.</p></body></html> + + + + Colors + Kolory + + + + EmulateSplitTransceiver + + + Emulated split mode requires rig to be in simplex mode + Emulowany tryb split wymaga ustawienia radia w trybie simplex + + + + EqualizationToolsDialog::impl + + + Equalization Tools + Narzędzia korekcji + + + + Phase + Faza + + + + + Freq (Hz) + Częst. (Hz) + + + + Phase (Π) + Faza (Π) + + + + Delay (ms) + Opóźnienie (ms) + + + + Measured + Zmierzona + + + + Proposed + Proponowana + + + + Current + Bieżąca + + + + Group Delay + Opóźnienie grupowe + + + + Amplitude + Amplituda + + + + Relative Power (dB) + Moc względna (dB) + + + + Reference + Odniesienie + + + + Phase ... + Faza ... + + + + Refresh + Odśwież + + + + Discard Measured + Odrzuć pomiar + + + + ExistingNameDialog + + + Configuration to Clone From + Konfiguracja źródłowa do sklonowania + + + + &Source Configuration Name: + &Nazwa konfiguracji źródłowej: + + + + ExportCabrillo + + + Dialog + Okno dialogowe + + + + Location: + Lokalizacja: + + + + SNJ + SNJ + + + + Contest: + Zawody: + + + + ARRL-RTTY + ARRL-RTTY + + + + Callsign: + Znak wywoławczy: + + + + Category-Operator: + Kategoria operatora: + + + + SINGLE-OP + SINGLE-OP + + + + Category-Transmitter: + Kategoria nadajnika: + + + + ONE + ONE + + + + Category-Power: + Kategoria mocy: + + + + LOW + LOW + + + + Category-Assisted: + Kategoria wspomagania: + + + + NON-ASSISTED + NON-ASSISTED + + + + Category-Band: + Kategoria pasma: + + + + ALL + ALL + + + + Claimed-Score: + Deklarowany wynik: + + + + Operators: + Operatorzy: + + + + Club: + Klub: + + + + Name: + Nazwa: + + + + + Address: + Adres: + + + + Save Log File + Zapisz plik logu + + + + Cabrillo Log (*.cbr) + Log Cabrillo (*.cbr) + + + + Cannot open "%1" for writing: %2 + Nie można otworzyć "%1" do zapisu: %2 + + + + Export Cabrillo File Error + Błąd eksportu pliku Cabrillo + + + + FastGraph + + + + Fast Graph + Szybki wykres + + + + Waterfall gain + Wzmocnienie wodospadu + + + + Waterfall zero + Poziom zerowy wodospadu + + + + Spectrum zero + Poziom zerowy widma + + + + <html><head/><body><p>Set reasonable levels for gain and zero sliders.</p></body></html> + <html><head/><body><p>Ustaw rozsądne poziomy suwaków wzmocnienia i zera.</p></body></html> + + + + Auto Level + Automatyczny poziom + + + + FileDownload + + + Network Error - SSL/TLS support not installed, cannot fetch: +'%1' + Błąd sieci — obsługa SSL/TLS nie jest zainstalowana, nie można pobrać: +'%1' + + + + Network Error - Too many redirects: +'%1' + Błąd sieci — zbyt wiele przekierowań: +'%1' + + + + Network Error: +%1 + Błąd sieci: +%1 + + + + FoxLog::impl + + + Date & Time(UTC) + Data i czas (UTC) + + + + Call + Znak + + + + Grid + Lokator + + + + Sent + Wysłano + + + + Rcvd + Odebrano + + + + Band + Pasmo + + + + FoxLogWindow + + + Fox Log + Log Fox + + + + <html><head/><body><p>Right-click here for available actions.</p></body></html> + <html><head/><body><p>Kliknij tutaj prawym przyciskiem, aby zobaczyć dostępne działania.</p></body></html> + + + + Callers: + Wołające stacje: + + + + + + N + N + + + + In progress: + W trakcie: + + + + Rate: + Tempo: + + + + <html><head/><body><p>Last 10: Average rate (QSOs/hour) for the last 10 QSOs.<br/>Last 100: Average rate (QSOs/hour) for the last 100 QSOs. <br/>Last 60m: Average rate (QSOs/hour) for the last 60 minutes.</span></p></body></html> + <html><head/><body><p>Ostatnie 10: średnie tempo (QSO/godz.) dla ostatnich 10 QSO.<br/>Ostatnie 100: średnie tempo (QSO/godz.) dla ostatnich 100 QSO.<br/>Ostatnie 60 min: średnie tempo (QSO/godz.) dla ostatnich 60 minut.</span></p></body></html> + + + + &Export ADIF ... + &Eksportuj ADIF ... + + + + Export ADIF Log File + Eksportuj plik logu ADIF + + + + ADIF Log (*.adi) + Log ADIF (*.adi) + + + + Export ADIF File Error + Błąd eksportu pliku ADIF + + + + Cannot open "%1" for writing: %2 + Nie można otworzyć "%1" do zapisu: %2 + + + + &Reset ... + &Resetuj ... + + + + Confirm Reset + Potwierdź reset + + + + Are you sure you want to erase file FoxQSO.txt and start a new Fox log? + Czy na pewno chcesz skasować plik FoxQSO.txt i rozpocząć nowy log Fox? + + + + FrequencyDialog + + + Add Frequency + Dodaj częstotliwość + + + + IARU &Region: + &Region IARU: + + + + &Mode: + &Tryb: + + + + &Frequency (MHz): + &Częstotliwość (MHz): + + + + &Preferred for Band/Mode: + &Preferowana dla pasma/trybu: + + + + &Description: + &Opis: + + + + &Enable Date Range: + &Włącz zakres dat: + + + + S&tart: + &Początek: + + + + &End: + &Koniec: + + + + &Source: + &Źródło: + + + + Invalid Date Range + Nieprawidłowy zakres dat + + + + Start date must be before end date + Data początkowa musi być wcześniejsza niż data końcowa + + + + FrequencyList_v2_101 + + + + IARU Region + Region IARU + + + + + Mode + Tryb + + + + + Frequency + Częstotliwość + + + + + Frequency (MHz) + Częstotliwość (MHz) + + + + + Description + Opis + + + + + Source + Źródło + + + + Start Time + Czas rozpoczęcia + + + + End Time + Czas zakończenia + + + + + Pref + Pref. + + + + Start Date/Time + Data/czas rozpoczęcia + + + + End Date/Time + Data/czas zakończenia + + + + Failed to parse JSON file + Nie udało się przetworzyć pliku JSON + + + + Information Missing + Brakujące informacje + + + + No Frequencies were found + Nie znaleziono żadnych częstotliwości + + + + Loaded Frequencies from %1 + Wczytano częstotliwości z %1 + + + + Entries Valid/Skipped %1 + Wpisy poprawne/pominięte: %1 + + + + HRDTransceiver + + + + Failed to connect to Ham Radio Deluxe + + Nie udało się połączyć z Ham Radio Deluxe + + + + + Failed to open file "%1": %2. + Nie udało się otworzyć pliku "%1": %2. + + + + + Ham Radio Deluxe: no rig found + Ham Radio Deluxe: nie znaleziono radia + + + + Ham Radio Deluxe: rig doesn't support mode + Ham Radio Deluxe: radio nie obsługuje tego trybu + + + + Ham Radio Deluxe: sent an unrecognised mode + Ham Radio Deluxe: przesłano nierozpoznany tryb + + + + Ham Radio Deluxe: item not found in %1 dropdown list + Ham Radio Deluxe: nie znaleziono elementu na liście rozwijanej %1 + + + + Ham Radio Deluxe: button not available + Ham Radio Deluxe: przycisk jest niedostępny + + + + Ham Radio Deluxe didn't respond as expected + Ham Radio Deluxe nie odpowiedział zgodnie z oczekiwaniami + + + + Ham Radio Deluxe: rig has disappeared or changed + Ham Radio Deluxe: radio zniknęło lub zostało zmienione + + + + Ham Radio Deluxe send command "%1" failed %2 + + Nie udało się wysłać polecenia Ham Radio Deluxe "%1": %2 + + + + + + Ham Radio Deluxe: failed to write command "%1" + Ham Radio Deluxe: nie udało się zapisać polecenia "%1" + + + + Ham Radio Deluxe sent an invalid reply to our command "%1" + Ham Radio Deluxe przesłał nieprawidłową odpowiedź na nasze polecenie "%1" + + + + Ham Radio Deluxe failed to reply to command "%1" %2 + + Ham Radio Deluxe nie odpowiedział na polecenie "%1": %2 + + + + + Ham Radio Deluxe retries exhausted sending command "%1" + Wyczerpano liczbę prób wysłania polecenia Ham Radio Deluxe "%1" + + + + Ham Radio Deluxe didn't respond to command "%1" as expected + Ham Radio Deluxe nie odpowiedział na polecenie "%1" zgodnie z oczekiwaniami + + + + HamlibTransceiver + + + + Hamlib initialisation error + Błąd inicjalizacji Hamlib + + + + Hamlib settings file error: %1 at character offset %2 + Błąd pliku ustawień Hamlib: %1 przy przesunięciu znaku %2 + + + + Hamlib settings file error: top level must be a JSON object + Błąd pliku ustawień Hamlib: najwyższy poziom musi być obiektem JSON + + + + Hamlib settings file error: config must be a JSON object + Błąd pliku ustawień Hamlib: konfiguracja musi być obiektem JSON + + + + Unsupported CAT type + Nieobsługiwany typ CAT + + + + Hamlib error: %1 while %2 + Błąd Hamlib: %1 podczas: %2 + + + + opening connection to rig + otwierania połączenia z radiem + + + + getting current frequency + pobierania bieżącej częstotliwości + + + + getting current mode + pobierania bieżącego trybu + + + + + exchanging VFOs + zamiany VFO + + + + + getting other VFO frequency + pobierania częstotliwości drugiego VFO + + + + getting other VFO mode + pobierania trybu drugiego VFO + + + + + setting current VFO + ustawiania bieżącego VFO + + + + getting frequency + pobierania częstotliwości + + + + getting mode + pobierania trybu + + + + + + getting current VFO + pobierania bieżącego VFO + + + + + + + getting current VFO frequency + pobierania częstotliwości bieżącego VFO + + + + + + + + + setting frequency + ustawiania częstotliwości + + + + + + + getting current VFO mode + pobierania trybu bieżącego VFO + + + + + + + + setting current VFO mode + ustawiania trybu bieżącego VFO + + + + setting VFOB mode + ustawiania trybu VFOB + + + + + setting/unsetting split mode + włączania/wyłączania trybu split + + + + + setting split mode + ustawiania trybu split + + + + setting split TX frequency and mode + ustawiania częstotliwości i trybu TX dla split + + + + setting split TX frequency + ustawiania częstotliwości TX dla split + + + + getting split TX VFO mode + pobierania trybu VFO TX dla split + + + + setting split TX VFO mode + ustawiania trybu VFO TX dla split + + + + getting PTT state + pobierania stanu PTT + + + + setting PTT on + włączania PTT + + + + + setting PTT off + wyłączania PTT + + + + setting a configuration item + ustawiania elementu konfiguracji + + + + getting a configuration item + pobierania elementu konfiguracji + + + + IARURegions + + + All + Wszystkie + + + + Region 1 + Region 1 + + + + Region 2 + Region 2 + + + + Region 3 + Region 3 + + + + + IARU Region + Region IARU + + + + LogQSO + + + Click OK to confirm the following QSO: + Kliknij OK, aby potwierdzić następujące QSO: + + + + Call + Znak + + + + Start + Początek + + + + + dd/MM/yyyy HH:mm:ss + dd/MM/yyyy HH:mm:ss + + + + End + Koniec + + + + Mode + Tryb + + + + Band + Pasmo + + + + Rpt Sent + Raport wysłany + + + + Rpt Rcvd + Raport odebrany + + + + Grid + Lokator + + + + Name + Nazwa + + + + Tx power + Moc TX + + + + <html><head/><body><p>Add comment to the comments list.</p></body></html> + <html><head/><body><p>Dodaj komentarz do listy komentarzy.</p></body></html> + + + + Add + Dodaj + + + + + + + + + Retain + Zachowaj + + + + Comments + Komentarze + + + + Operator + Operator + + + + Exch sent + Wysłana wymiana + + + + Rcvd + Odebrano + + + + Prop Mode + Tryb propagacji + + + + Sat Mode + Tryb satelitarny + + + + RX Frequency + Częstotliwość RX + + + + Aircraft scatter + Rozpraszanie na samolotach + + + + Aurora-E + Aurora-E + + + + Aurora + Aurora + + + + Back scatter + Rozpraszanie wsteczne + + + + Echolink + Echolink + + + + Earth-moon-earth + Ziemia–Księżyc–Ziemia + + + + Sporadic E + Sporadyczna warstwa E + + + + F2 Reflection + Odbicie od warstwy F2 + + + + Field aligned irregularities + Nieregularności zorientowane względem pola + + + + Internet-assisted + Wspomagane przez Internet + + + + Ionoscatter + Rozpraszanie jonosferyczne + + + + IRLP + IRLP + + + + Meteor scatter + Rozpraszanie meteorowe + + + + Non-satellite repeater or transponder + Przemiennik lub transponder niesatelitarny + + + + Rain scatter + Rozpraszanie deszczowe + + + + Tropospheric ducting + Dukty troposferyczne + + + + A + A + + + + B + B + + + + BS + BS + + + + JA + JA + + + + JD + JD + + + + K + K + + + + KA + KA + + + + KT + KT + + + + L + L + + + + LS + LS + + + + LU + LU + + + + LX + LX + + + + S + S + + + + SX + SX + + + + T + T + + + + US + US + + + + UV + UV + + + + VS + VS + + + + VU + VU + + + + + Satellite + Satelita + + + + Trans-equatorial + Transrównikowe + + + + + Invalid QSO Data + Nieprawidłowe dane QSO + + + + Check exchange sent and received + Sprawdź wysłaną i odebraną wymianę + + + + Check all fields + Sprawdź wszystkie pola + + + + Log file error + Błąd pliku logu + + + + Cannot open "%1" for append + Nie można otworzyć "%1" w trybie dopisywania + + + + Error: %1 + Błąd: %1 + + + + MainWindow + + + WSJT-X by K1JT + WSJT-X autor: K1JT + + + + + + + + + + + + Band Activity + Aktywność pasma + + + + + UTC dB DT Freq Dr + UTC dB DT Częst. Dr + + + + + + + + + + Rx Frequency + Częstotliwość RX + + + + CQ only + Tylko CQ + + + + Enter this QSO in log + Zapisz to QSO w logu + + + + Log &QSO + Zapisz &QSO + + + + Stop monitoring + Zatrzymaj monitorowanie + + + + &Stop + &Zatrzymaj + + + + &Monitor + &Monitoruj + + + + <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> + <html><head/><body><p>Wyczyść prawe okno. Kliknij dwukrotnie, aby wyczyścić oba okna.</p></body></html> + + + + Erase right window. Double-click to erase both windows. + Wyczyść prawe okno. Kliknij dwukrotnie, aby wyczyścić oba okna. + + + + &Erase + &Wyczyść + + + + <html><head/><body><p>Clear the accumulating message average.</p></body></html> + <html><head/><body><p>Wyczyść narastającą średnią wiadomości.</p></body></html> + + + + Clear the accumulating message average. + Wyczyść narastającą średnią wiadomości. + + + + Clear Avg + Wyczyść średnią + + + + <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> + <html><head/><body><p>Dekoduj ostatni okres RX na częstotliwości QSO</p></body></html> + + + + Decode most recent Rx period at QSO Frequency + Dekoduj ostatni okres RX na częstotliwości QSO + + + + &Decode + &Dekoduj + + + + <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> + <html><head/><body><p>Włącz/wyłącz automatyczne TX</p></body></html> + + + + Toggle Auto-Tx On/Off + Włącz/wyłącz automatyczne TX + + + + E&nable Tx + Włącz &TX + + + + Stop transmitting immediately + Natychmiast zatrzymaj nadawanie + + + + &Halt Tx + &Zatrzymaj TX + + + + Toggle a pure Tx tone On/Off + Włącz/wyłącz czysty ton TX + + + + &Tune + &Strojenie + + + + Menus + Menu + + + + Decode other Hounds calling above 1000 Hz audio offset + Dekoduj inne stacje Hound wołające powyżej przesunięcia audio 1000 Hz + + + + Enable auto response to the first decode from a new DXCC or new call on the current band. + Włącz automatyczną odpowiedź na pierwszą dekodowaną wiadomość od nowego DXCC lub nowego znaku na bieżącym paśmie. + + + + F High + F górna + + + + F Low + F dolna + + + + 1/2 + 1/2 + + + + 2/2 + 2/2 + + + + 1/3 + 1/3 + + + + 2/3 + 2/3 + + + + 3/3 + 3/3 + + + + 1/4 + 1/4 + + + + 2/4 + 2/4 + + + + 3/4 + 3/4 + + + + 4/4 + 4/4 + + + + 1/5 + 1/5 + + + + 2/5 + 2/5 + + + + 3/5 + 3/5 + + + + 4/5 + 4/5 + + + + 5/5 + 5/5 + + + + 1/6 + 1/6 + + + + 2/6 + 2/6 + + + + 3/6 + 3/6 + + + + 4/6 + 4/6 + + + + 5/6 + 5/6 + + + + 6/6 + 6/6 + + + + Percentage of minute sequences devoted to transmitting. + Procent sekwencji minutowych przeznaczonych na nadawanie. + + + + Prefer Type 1 messages + Preferuj wiadomości typu 1 + + + + <html><head/><body><p>Transmit during the next sequence.</p></body></html> + <html><head/><body><p>Nadawaj podczas następnej sekwencji.</p></body></html> + + + + + Q65 + Q65 + + + + SWL Mode + Tryb SWL + + + + Hide lower panel controls to maximize deocde windows + Ukryj elementy sterowania dolnego panelu, aby zmaksymalizować okna dekodowania + + + + USB dial frequency + Częstotliwość pokrętła USB + + + + 14.078 000 + 14.078 000 + + + + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> + <html><head/><body><p>Przy samym szumie zalecane jest 30 dB<br/>Zielony — poziom prawidłowy<br/>Czerwony — może wystąpić przesterowanie<br/>Żółty — poziom zbyt niski</p></body></html> + + + + Rx Signal + Sygnał RX + + + + 30dB recommended when only noise present +Green when good +Red when clipping may occur +Yellow when too low + Przy samym szumie zalecane jest 30 dB +Zielony — poziom prawidłowy +Czerwony — może wystąpić przesterowanie +Żółty — poziom zbyt niski + + + + DX Call + Znak DX + + + + DX Grid + Lokator DX + + + + Callsign of station to be worked + Znak wywoławczy stacji, z którą ma być przeprowadzone QSO + + + + &Lookup + &Wyszukaj + + + + Locator of station to be worked + Lokator stacji, z którą ma być przeprowadzone QSO + + + + Az: 251 16553 km + Az: 251 16553 km + + + + Add + Dodaj + + + + <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> + <html><head/><body><p>Kolor pomarańczowy lub czerwony oznacza błąd sterowania radiem. Kliknij, aby zresetować stan i odczytać częstotliwość z radia. Litera S oznacza tryb split.</p></body></html> + + + + If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. + Kolor pomarańczowy lub czerwony oznacza błąd sterowania radiem. Kliknij, aby zresetować stan i odczytać częstotliwość z radia. Litera S oznacza tryb split. + + + + ? + ? + + + + Adjust Tx audio level + Reguluj poziom audio TX + + + + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> + <html><head/><body><p>Wybierz pasmo pracy, wpisz częstotliwość w MHz albo przyrost w kHz zakończony literą k.</p></body></html> + + + + Frequency entry + Wprowadzanie częstotliwości + + + + Select operating band or enter frequency in MHz or enter kHz increment followed by k. + Wybierz pasmo pracy, wpisz częstotliwość w MHz albo przyrost w kHz zakończony literą k. + + + + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> + + + + <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> + <html><head/><body><p>Zaznacz, aby częstotliwość TX pozostawała stała przy dwukrotnym kliknięciu zdekodowanego tekstu.</p></body></html> + + + + Check to keep Tx frequency fixed when double-clicking on decoded text. + Zaznacz, aby częstotliwość TX pozostawała stała przy dwukrotnym kliknięciu zdekodowanego tekstu. + + + + Hold Tx Freq + Stała częstotliwość TX + + + + Audio Rx frequency + Częstotliwość audio RX + + + + + + + + + Hz + Hz + + + + + Rx + RX + + + + + Set Tx frequency to Rx Frequency + Ustaw częstotliwość TX na częstotliwość RX + + + + ▲ + ▲ + + + + Frequency tolerance (Hz) + Tolerancja częstotliwości (Hz) + + + + + F Tol + Tol. F + + + + + Set Rx frequency to Tx Frequency + Ustaw częstotliwość RX na częstotliwość TX + + + + ▼ + ▼ + + + + <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> + <html><head/><body><p>Próg synchronizacji. Niższe wartości pozwalają przyjmować słabsze sygnały synchronizacji.</p></body></html> + + + + Synchronizing threshold. Lower numbers accept weaker sync signals. + Próg synchronizacji. Niższe wartości pozwalają przyjmować słabsze sygnały synchronizacji. + + + + Sync + Synch. + + + + <html><head/><body><p>Check to use short-format messages.</p></body></html> + <html><head/><body><p>Zaznacz, aby używać wiadomości w krótkim formacie.</p></body></html> + + + + Check to use short-format messages. + Zaznacz, aby używać wiadomości w krótkim formacie. + + + + Sh + Sh + + + + <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> + <html><head/><body><p>Zaznacz, aby włączyć szybkie tryby JT9.</p></body></html> + + + + Check to enable JT9 fast modes + Zaznacz, aby włączyć szybkie tryby JT9 + + + + + Fast + Szybki + + + + <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> + <html><head/><body><p>Zaznacz, aby włączyć automatyczne sekwencjonowanie wiadomości TX na podstawie odebranych wiadomości.</p></body></html> + + + + Check to enable automatic sequencing of Tx messages based on received messages. + Zaznacz, aby włączyć automatyczne sekwencjonowanie wiadomości TX na podstawie odebranych wiadomości. + + + + Auto Seq + Auto sekwencja + + + + Check to generate "@1250 (SEND MSGS)" in Tx6. + Zaznacz, aby generować „@1250 (SEND MSGS)” w Tx6. + + + + Tx6 + Tx6 + + + + Tx even/1st + TX parzyste/1. + + + + <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> + <html><head/><body><p>Częstotliwość wywołania CQ w kHz powyżej bieżącej pełnej wartości MHz.</p></body></html> + + + + Frequency to call CQ on in kHz above the current MHz + Częstotliwość wywołania CQ w kHz powyżej bieżącej pełnej wartości MHz + + + + Tx CQ + TX CQ + + + + <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> + <html><head/><body><p>Zaznacz, aby wywoływać CQ na częstotliwości „Tx CQ”. RX pozostanie na bieżącej częstotliwości, a wiadomość CQ będzie zawierać bieżącą częstotliwość RX, aby wołające stacje wiedziały, gdzie odpowiedzieć.</p><p>Opcja niedostępna dla posiadaczy niestandardowych znaków wywoławczych.</p></body></html> + + + + Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. +Not available to nonstandard callsign holders. + Zaznacz, aby wywoływać CQ na częstotliwości „Tx CQ”. RX pozostanie na bieżącej częstotliwości, a wiadomość CQ będzie zawierać bieżącą częstotliwość RX, aby wołające stacje wiedziały, gdzie odpowiedzieć. +Opcja niedostępna dla posiadaczy niestandardowych znaków wywoławczych. + + + + Rx All Freqs + RX wszystkie częstotliwości + + + + <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> + <html><head/><body><p>Podtryb określa odstęp tonów; A jest najwęższy.</p></body></html> + + + + Submode determines tone spacing; A is narrowest. + Podtryb określa odstęp tonów; A jest najwęższy. + + + + Submode + Podtryb + + + + + Fox + Fox + + + + <html><head/><body><p>Check to monitor Sh messages.</p></body></html> + <html><head/><body><p>Zaznacz, aby monitorować wiadomości Sh.</p></body></html> + + + + Check to monitor Sh messages. + Zaznacz, aby monitorować wiadomości Sh. + + + + SWL + SWL + + + + Best S+P + Najlepszy S+P + + + + <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> + <html><head/><body><p>Zaznacz, aby rozpocząć rejestrowanie danych kalibracyjnych.<br/>Podczas pomiaru korekcja kalibracyjna jest wyłączona.<br/>Gdy pole nie jest zaznaczone, możesz przeglądać wyniki kalibracji.</p></body></html> + + + + Check this to start recording calibration data. +While measuring calibration correction is disabled. +When not checked you can view the calibration results. + Zaznacz, aby rozpocząć rejestrowanie danych kalibracyjnych. +Podczas pomiaru korekcja kalibracyjna jest wyłączona. +Gdy pole nie jest zaznaczone, możesz przeglądać wyniki kalibracji. + + + + Measure + Pomiar + + + + <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> + <html><head/><body><p>Raport sygnału: stosunek sygnału do szumu w referencyjnym paśmie 2500 Hz (dB).</p></body></html> + + + + Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). + Raport sygnału: stosunek sygnału do szumu w referencyjnym paśmie 2500 Hz (dB). + + + + Report + Raport + + + + <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> + <html><head/><body><p>Długość sekwencji TX/RX lub kalibracji częstotliwości.</p></body></html> + + + + Tx/Rx or Frequency calibration sequence length + Długość sekwencji TX/RX lub kalibracji częstotliwości + + + + + s + s + + + + + T/R + T/R + + + + Audio Tx frequency + Częstotliwość audio TX + + + + + Tx + TX + + + + Tx# + TX# + + + + + + 1 + 1 + + + + + + Send this message in next Tx interval + Wyślij tę wiadomość w następnym interwale TX + + + + Ctrl+2 + Ctrl+2 + + + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + <html><head/><body><p>Wyślij tę wiadomość w następnym interwale TX.</p><p>Kliknij dwukrotnie, aby przełączyć używanie wiadomości Tx1 do rozpoczynania QSO ze stacją (niedozwolone dla posiadaczy złożonych znaków typu 1).</p></body></html> + + + + Send this message in next Tx interval +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + Wyślij tę wiadomość w następnym interwale TX. +Kliknij dwukrotnie, aby przełączyć używanie wiadomości Tx1 do rozpoczynania QSO ze stacją (niedozwolone dla posiadaczy złożonych znaków typu 1). + + + + Ctrl+1 + Ctrl+1 + + + + + + + Switch to this Tx message NOW + Przełącz TERAZ na tę wiadomość TX + + + + Tx &2 + Tx &2 + + + + Alt+2 + Alt+2 + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + <html><head/><body><p>Przełącz TERAZ na tę wiadomość TX.</p><p>Kliknij dwukrotnie, aby przełączyć używanie wiadomości Tx1 do rozpoczynania QSO ze stacją (niedozwolone dla posiadaczy złożonych znaków typu 1).</p></body></html> + + + + Switch to this Tx message NOW +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + Przełącz TERAZ na tę wiadomość TX. +Kliknij dwukrotnie, aby przełączyć używanie wiadomości Tx1 do rozpoczynania QSO ze stacją (niedozwolone dla posiadaczy złożonych znaków typu 1). + + + + Tx &1 + Tx &1 + + + + Alt+1 + Alt+1 + + + + Ctrl+6 + Ctrl+6 + + + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> + <html><head/><body><p>Wyślij tę wiadomość w następnym interwale TX.</p><p>Kliknij dwukrotnie, aby przywrócić standardową wiadomość 73.</p></body></html> + + + + Send this message in next Tx interval +Double-click to reset to the standard 73 message + Wyślij tę wiadomość w następnym interwale TX. +Kliknij dwukrotnie, aby przywrócić standardową wiadomość 73. + + + + Ctrl+5 + Ctrl+5 + + + + Ctrl+3 + Ctrl+3 + + + + Tx &3 + Tx &3 + + + + Alt+3 + Alt+3 + + + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + <html><head/><body><p>Wyślij tę wiadomość w następnym interwale TX.</p><p>Kliknij dwukrotnie, aby przełączać wiadomości RRR i RR73 w Tx4 (niedozwolone dla posiadaczy złożonych znaków typu 2).</p><p>Wiadomości RR73 powinny być używane tylko wtedy, gdy masz rozsądną pewność, że powtórzenia wiadomości nie będą potrzebne.</p></body></html> + + + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + Wyślij tę wiadomość w następnym interwale TX. +Kliknij dwukrotnie, aby przełączać wiadomości RRR i RR73 w Tx4 (niedozwolone dla posiadaczy złożonych znaków typu 2). +Wiadomości RR73 powinny być używane tylko wtedy, gdy masz rozsądną pewność, że powtórzenia wiadomości nie będą potrzebne. + + + + Ctrl+4 + Ctrl+4 + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + <html><head/><body><p>Przełącz TERAZ na tę wiadomość TX.</p><p>Kliknij dwukrotnie, aby przełączać wiadomości RRR i RR73 w Tx4 (niedozwolone dla posiadaczy złożonych znaków typu 2).</p><p>Wiadomości RR73 powinny być używane tylko wtedy, gdy masz rozsądną pewność, że powtórzenia wiadomości nie będą potrzebne.</p></body></html> + + + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + Przełącz TERAZ na tę wiadomość TX. +Kliknij dwukrotnie, aby przełączać wiadomości RRR i RR73 w Tx4 (niedozwolone dla posiadaczy złożonych znaków typu 2). +Wiadomości RR73 powinny być używane tylko wtedy, gdy masz rozsądną pewność, że powtórzenia wiadomości nie będą potrzebne. + + + + Tx &4 + Tx &4 + + + + Alt+4 + Alt+4 + + + + Tx &5 + Tx &5 + + + + Alt+5 + Alt+5 + + + + Now + Teraz + + + + Generate standard messages for minimal QSO + Generuj standardowe wiadomości dla minimalnego QSO + + + + Generate Std Msgs + Generuj standardowe wiadomości + + + + Tx &6 + Tx &6 + + + + Alt+6 + Alt+6 + + + + Enter a free text message (maximum 13 characters) +or select a predefined macro from the dropdown list. +Press ENTER to add the current text to the predefined +list. The list can be maintained in Settings (F2). + Wpisz wiadomość tekstową (maksymalnie 13 znaków) +lub wybierz zdefiniowane makro z listy rozwijanej. +Naciśnij ENTER, aby dodać bieżący tekst do listy zdefiniowanych +wiadomości. Listę można edytować w Ustawieniach (F2). + + + + Queue up the next Tx message + Ustaw następną wiadomość TX w kolejce + + + + Next + Następna + + + + + + + + + 2 + 2 + + + + Quick-Start Guide to FST4 and FST4W + Przewodnik szybkiego startu dla FST4 i FST4W + + + + FST4 + FST4 + + + + FST4W + FST4W + + + + + CQ + CQ + + + + Grid + Lokator + + + + CQ AF + CQ AF + + + + CQ AN + CQ AN + + + + CQ AS + CQ AS + + + + CQ EU + CQ EU + + + + CQ NA + CQ NA + + + + CQ OC + CQ OC + + + + CQ SA + CQ SA + + + + CQ 0 + CQ 0 + + + + CQ 1 + CQ 1 + + + + CQ 2 + CQ 2 + + + + CQ 3 + CQ 3 + + + + CQ 4 + CQ 4 + + + + CQ 5 + CQ 5 + + + + CQ 6 + CQ 6 + + + + CQ 7 + CQ 7 + + + + CQ 8 + CQ 8 + + + + CQ 9 + CQ 9 + + + + Reset + Resetuj + + + + N List + N lista + + + + N Slots + N slotów + + + + + + + + + + Random + Losowo + + + + Call + Znak + + + + S/N (dB) + S/N (dB) + + + + Distance + Odległość + + + + More CQs + Więcej CQ + + + + + % + % + + + + Tx Pct + Procent TX + + + + Band Hopping + Skakanie po pasmach + + + + Choose bands and times of day for band-hopping. + Wybierz pasma i pory dnia dla automatycznego skakania po pasmach. + + + + Schedule ... + Harmonogram ... + + + + Upload decoded messages to WSPRnet.org. + Wysyłaj zdekodowane wiadomości do WSPRnet.org. + + + + Upload spots + Wysyłaj spoty + + + + <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> + <html><head/><body><p>Lokatory 6-znakowe powodują wysłanie dwóch różnych wiadomości. Druga zawiera pełny lokator, ale tylko haszowany znak wywoławczy; inne stacje muszą wcześniej przynajmniej raz zdekodować pierwszą wiadomość, aby rozpoznać Twój znak w drugiej. Zaznacz tę opcję, aby wysyłać tylko lokatory 4-znakowe, jeśli pozwoli to uniknąć protokołu dwóch wiadomości.</p></body></html> + + + + 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. + Lokatory 6-znakowe powodują wysłanie dwóch różnych wiadomości. Druga zawiera pełny lokator, ale tylko haszowany znak wywoławczy; inne stacje muszą wcześniej przynajmniej raz zdekodować pierwszą wiadomość, aby rozpoznać Twój znak w drugiej. Zaznacz tę opcję, aby wysyłać tylko lokatory 4-znakowe, jeśli pozwoli to uniknąć protokołu dwóch wiadomości. + + + + No own call decodes + Nie dekoduj własnego znaku + + + + Tx Next + TX następny + + + + Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. + Ustaw moc TX w dBm (dB powyżej 1 mW) jako część wiadomości WSPR. + + + + NB + NB + + + + 40 + 40 + + + + + + 10 + 10 + + + + 17 + 17 + + + + 60 + 60 + + + + + 12 + 12 + + + + 160 + 160 + + + + 20 + 20 + + + + 80 + 80 + + + + + 70 + 70 + + + + 15 + 15 + + + + 30 + 30 + + + + + + + 6 + 6 + + + + 24G + 24G + + + + 10G + 10G + + + + 5G + 5G + + + + + + 9 + 9 + + + + 13 + 13 + + + + 23 + 23 + + + + 33 + 33 + + + + 1.25 + 1.25 + + + + + 4 + 4 + + + + + 8 + 8 + + + + CQ messages only. + Tylko wiadomości CQ. + + + + Bypass Filters toggled via Settings or the Filters menu. + Pomiń filtry przełączane w Ustawieniach lub menu Filtry. + + + + BP + BP + + + + <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> + <html><head/><body><p>Włącz/wyłącz monitorowanie.<br>Kolor żółty podczas zapisywania plików .wav.</p></body></html> + + + + Avg + Średnia + + + + <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> + <html><head/><body><p>Włącz/wyłącz czysty ton TX.<br>Kliknij prawym przyciskiem, aby dostroić radio.</p></body></html> + + + + <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> + <html><head/><body><p>Włącz/wyłącz funkcję Oczekuj i wywołaj. Kliknij prawym przyciskiem, aby wyczyścić pole Znak DX.</p></body></html> + + + + <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> + <html><head/><body><p>Wyszukaj znak wywoławczy w bazie danych.<br>Kliknięcie prawym przyciskiem wyszukuje znak na QRZ.com.</p></body></html> + + + + <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> + <html><head/><body><p>Dodaj znak wywoławczy i lokator do bazy danych.<br>Kliknięcie prawym przyciskiem wyszukuje znak na hamqth.com.</p></body></html> + + + + <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> + <html><head/><body><p>Dodaj znak wywoławczy do listy ignorowanych.<br>Kliknięcie prawym przyciskiem wyszukuje znak na qrzcq.com.</p></body></html> + + + + Ignore + Ignoruj + + + + Pwr + Moc + + + + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the the strongest station's reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the the weakest station's reply to your CQ. </p></body></html> + <html><head/><body><p>Wybierz <span style=" font-weight:600;">CQ: Brak</span>, aby wybierać wołające stacje ręcznie.</p><p>Wybierz <span style=" font-weight:600;">CQ: Pierwsza</span>, aby automatycznie odpowiadać na pierwszą zdekodowaną odpowiedź na Twoje CQ.</p><p>Wybierz <span style=" font-weight:600;">CQ: Maks. odległość</span>, aby automatycznie odpowiadać stacji dającej najwięcej punktów w ARRL International Digital Contest albo, ogólnie, najbardziej odległej stacji, jeśli jej wiadomość zawiera poprawny lokator.</p><p>Wybierz <span style=" font-weight:600;">CQ: Maks. dB</span>, aby automatycznie odpowiadać na odpowiedź najsilniejszej stacji.</p><p>Wybierz <span style=" font-weight:600;">CQ: Min. dB</span>, aby automatycznie odpowiadać na odpowiedź najsłabszej stacji.</p></body></html> + + + + + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> + <html><head/><body><p>Zaznacz, aby nadawać w parzystych minutach lub sekwencjach, zaczynając od 0; odznacz dla sekwencji nieparzystych. Kliknij prawym przyciskiem, aby zablokować stan pola wyboru. Kliknij prawym przyciskiem przycisk FT8 lub MSK, aby odblokować.</p></body></html> + + + + <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> + <html><head/><body><p>Przełącz na T/R 15 s i podtryb C.</p></body></html> + + + + 15C + 15C + + + + <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> + <html><head/><body><p>Przełącz na T/R 15 s i podtryb A.</p></body></html> + + + + 15A + 15A + + + + <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> + <html><head/><body><p>Przełącz na T/R 30 s i podtryb B.</p></body></html> + + + + 30B + 30B + + + + <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> + <html><head/><body><p>Przełącz na T/R 60 s i podtryb C.</p></body></html> + + + + 60C + 60C + + + + <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> + <html><head/><body><p>Przełącz na T/R 60 s i podtryb D.</p></body></html> + + + + 60D + 60D + + + + <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> + <html><head/><body><p>Przełącz na T/R 60 s i podtryb E.</p></body></html> + + + + 60E + 60E + + + + Maximum drift rate in units of symbol rate per transmission. + Maksymalna szybkość dryfu w jednostkach szybkości symboli na transmisję. + + + + Max Drift + Maks. dryf + + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> + <html><head/><body><p>Przełącz TERAZ na tę wiadomość TX.</p><p>Kliknij dwukrotnie, aby przywrócić standardową wiadomość 73.</p><p>Kliknij prawym przyciskiem, aby zachować tekst swobodny Tx5.</p></body></html> + + + + <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> + <html><head/><body><p>Wyślij wiadomość tekstową przy najbliższej możliwości.</p></body></html> + + + + Send msg + Wyślij wiadomość + + + + <html><head/><body><p>Enter a free text message.</p></body></html> + <html><head/><body><p>Wpisz wiadomość tekstową.</p></body></html> + + + + Free Text + Tekst swobodny + + + + <html><head/><body><p>Select a specific CQ message.</p></body></html> + <html><head/><body><p>Wybierz określoną wiadomość CQ.</p></body></html> + + + + Queue + Kolejka + + + + Allow Dupes + Zezwalaj na duplikaty + + + + <html><head/><body><p>Clear all queues.</p></body></html> + <html><head/><body><p>Wyczyść wszystkie kolejki.</p></body></html> + + + + <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> + <html><head/><body><p>Maksymalna liczba znaków wywoławczych wyświetlanych w kolejce.</p></body></html> + + + + <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> + <html><head/><body><p>Wybierz sposób sortowania znaków wywoławczych w kolejce.</p></body></html> + + + + Age + Wiek + + + + Continent + Kontynent + + + + Score + Wynik + + + + <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> + <html><head/><body><p>Dołącz wiadomość CQ wraz z innymi wiadomościami.</p></body></html> + + + + In Progress + W trakcie + + + + <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> + <html><head/><body><p>Maksymalna liczba równoległych strumieni transmisji Fox.</p></body></html> + + + + + + + 3 + 3 + + + + 70cm FT8 + 70cm FT8 + + + + 70cm + 70cm + + + + 30m FT8 + 30m FT8 + + + + 30m + 30m + + + + <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> + <html><head/><body><p>Włącz/wyłącz skakanie po pasmach. Zmiana pasma następuje co drugą pełną minutę. Zmiany pól wyboru obowiązują natychmiast.<br/>Kliknij prawym przyciskiem, aby przejść do następnej wybranej częstotliwości skakania po pasmach albo przetestować domyślne urządzenie audio, gdy skakanie po pasmach jest wyłączone.</p></body></html> + + + + Band Hopping + Skakanie po pasmach + + + + 12m FT8 + 12m FT8 + + + + 12m + 12m + + + + 40m FT8 + 40m FT8 + + + + 40m + 40m + + + + 2m MSK144 + 2m MSK144 + + + + 2m MSK + 2m MSK + + + + 10m FT8 + 10m FT8 + + + + 10m + 10m + + + + 6m FT8 + 6m FT8 + + + + 6m + 6m + + + + 60m FT8 + 60m FT8 + + + + 60m + 60m + + + + 160m FT8 + 160m FT8 + + + + 160m + 160m + + + + 80m FT8 + 80m FT8 + + + + 80m + 80m + + + + 20m FT8 + 20m FT8 + + + + 20m + 20m + + + + 17m FT8 + 17m FT8 + + + + 17m + 17m + + + + 4m FT8 + 4m FT8 + + + + 4m + 4m + + + + 15m FT8 + 15m FT8 + + + + 15m + 15m + + + + 2m FT8 + 2m FT8 + + + + 2m + 2m + + + + + 10m FT4 + 10m FT4 + + + + + 12m FT4 + 12m FT4 + + + + + 15m FT4 + 15m FT4 + + + + + 17m FT4 + 17m FT4 + + + + + 20m FT4 + 20m FT4 + + + + + 30m FT4 + 30m FT4 + + + + + 40m FT4 + 40m FT4 + + + + + 80m FT4 + 80m FT4 + + + + FT8 QRG6 + FT8 QRG6 + + + + FT8 QRG1 + FT8 QRG1 + + + + FT8 QRG2 + FT8 QRG2 + + + + FT8 QRG7 + FT8 QRG7 + + + + FT8 QRG8 in kHz. + FT8 QRG8 w kHz. + + + + FT8 QRG5 + FT8 QRG5 + + + + FT8 QRG3 + FT8 QRG3 + + + + FT8 QRG4 + FT8 QRG4 + + + + FT8 QRG8 + FT8 QRG8 + + + + FT8 QRG7 in kHz. + FT8 QRG7 w kHz. + + + + FT8 QRG6 in kHz. + FT8 QRG6 w kHz. + + + + FT8 QRG5 in kHz. + FT8 QRG5 w kHz. + + + + FT8 QRG4 in kHz. + FT8 QRG4 w kHz. + + + + FT8 QRG3 in kHz. + FT8 QRG3 w kHz. + + + + FT8 QRG2 in kHz. + FT8 QRG2 w kHz. + + + + FT8 QRG1 in kHz. + FT8 QRG1 w kHz. + + + + Spacing + Odstęp + + + + Fixed Tone + Stały ton + + + + K1JT + K1JT + + + + CW + CW + + + + Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. + Włącz/wyłącz tryb Hound FT8.<br>Kliknij prawym przyciskiem, aby włączyć lub wyłączyć tryb SuperFox. + + + + H + H + + + + Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. + Przełącz na tryb FT8.<br>Kliknij prawym przyciskiem, aby włączyć/wyłączyć ostatnio używany tryb zawodów. + + + + Switch to FT4 mode + Przełącz na tryb FT4 + + + + Switch to MSK144 mode + Przełącz na tryb MSK144 + + + + MSK + MSK + + + + <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> + <html><head/><body><p>Przełącz na tryb Q65.<br> Kliknij prawym przyciskiem, aby przełączyć na tryb Q65 Pileup.</p></body></html> + + + + <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> + <html><head/><body><p>Przełącz na tryb JT65.<br>Kliknij prawym przyciskiem, aby przełączyć na tryb JT9.</p></body></html> + + + + <html><head/><body><p>Switch to Echo mode</p></body></html> + <html><head/><body><p>Przełącz na tryb Echo.</p></body></html> + + + + File + Plik + + + + View + Widok + + + + Filters + Filtry + + + + Decode + Dekodowanie + + + + Parameters + Parametry + + + + Decoder sensitivity + Czułość dekodera + + + + Decoder start + Początek dekodowania + + + + Number of threads + Liczba wątków + + + + QSO RX freq sensitivity + Czułość częstotliwości RX QSO + + + + Decoding cycles + Cykle dekodowania + + + + Save + Zapis + + + + Help + Pomoc + + + + Mode + Tryb + + + + Configurations + Konfiguracje + + + + Tools + Narzędzia + + + + Exit + Zakończ + + + + About WSJT-X + O programie WSJT-X + + + + Waterfall + Wodospad + + + + Open + Otwórz + + + + Ctrl+O + Ctrl+O + + + + Open next in directory + Otwórz następny w katalogu + + + + Decode remaining files in directory + Dekoduj pozostałe pliki w katalogu + + + + Shift+F6 + Shift+F6 + + + + Delete all *.wav && *.c2 files in SaveDir + Usuń wszystkie pliki *.wav i *.c2 z katalogu zapisu + + + + None + Brak + + + + Save all + Zapisuj wszystkie + + + + Remove saved files after 30 days + Usuwaj zapisane pliki po 30 dniach + + + + Online User Guide + Internetowy podręcznik użytkownika + + + + Keyboard shortcuts + Skróty klawiaturowe + + + + Special mouse commands + Specjalne polecenia myszy + + + + JT9 + JT9 + + + + Save decoded + Zapisuj zdekodowane + + + + + Normal + Normalne + + + + Deep + Głębokie + + + + Erase ALL.TXT + Wyczyść ALL.TXT + + + + Erase wsjtx_log.adi + Wyczyść wsjtx_log.adi + + + + Erase wsjtx.log + Wyczyść wsjtx.log + + + + Erase Ignore List + Wyczyść listę ignorowanych + + + + F7 + F7 + + + + Don't split ALL.TXT + Nie dziel ALL.TXT + + + + Split ALL.TXT yearly + Dziel ALL.TXT według lat + + + + Split ALL.TXT monthly + Dziel ALL.TXT według miesięcy + + + + Disable writing of ALL.TXT + Wyłącz zapisywanie ALL.TXT + + + + Active Stations + Aktywne stacje + + + + Band Buttons + Przyciski pasm + + + + Use Dark Style + Użyj ciemnego stylu + + + + Reduce false decodes + Ogranicz fałszywe dekodowania + + + + Default event logging + Domyślne rejestrowanie zdarzeń + + + + Diagnostic mode + Tryb diagnostyczny + + + + Disable event logging + Wyłącz rejestrowanie zdarzeń + + + + Quick-Start Guide to WSJT-X 2.7 and QMAP + Przewodnik szybkiego startu WSJT-X 2.7 i QMAP + + + + WSJT-X_improved Home Page + Strona główna WSJT-X_improved + + + + <html><head/><body><p>Go to the wsjt-x_improved home page.</p></body></html> + <html><head/><body><p>Przejdź do strony głównej wsjt-x_improved.</p></body></html> + + + + The additional features of wsjt-x_improved + Dodatkowe funkcje wsjt-x_improved + + + + <html><head/><body><p>Overview on the additional features of wsjt-x_improved.</p></body></html> + <html><head/><body><p>Przegląd dodatkowych funkcji wsjt-x_improved.</p></body></html> + + + + Recommended audio settings + Zalecane ustawienia audio + + + + <html><head/><body><p>Recommended Audio Settings.</p></body></html> + <html><head/><body><p>Zalecane ustawienia audio.</p></body></html> + + + + How to deal with rig control errors + Jak postępować z błędami sterowania radiem + + + + <html><head/><body><p>How to deal with rig control errors.</p></body></html> + <html><head/><body><p>Jak postępować z błędami sterowania radiem.</p></body></html> + + + + Erase list of Q65 callers + Wyczyść listę wołających Q65 + + + + SuperFox User Guide + Podręcznik użytkownika SuperFox + + + + Message Creator + Kreator wiadomości + + + + Hide stations worked before on band + Ukryj stacje wcześniej zrobione na paśmie + + + + Hide stations worked today or yesterday + Ukryj stacje, z którymi była łączność dziś lub wczoraj + + + + Hide stations from Ignore List + Ukryj stacje z listy ignorowanych + + + + Ignore stations worked today or yesterday + Ignoruj stacje, z którymi była łączność dziś lub wczoraj + + + + Ignore stations from Ignore List + Ignoruj stacje z listy ignorowanych + + + + Hide stations from Territory 1 + Ukryj stacje z Terytorium 1 + + + + Hide stations from Territory 2 + Ukryj stacje z Terytorium 2 + + + + Hide stations from Territory 3 + Ukryj stacje z Terytorium 3 + + + + Hide stations from Territory 4 + Ukryj stacje z Terytorium 4 + + + + Hide stations from Europe + Ukryj stacje z Europy + + + + Hide stations from North America + Ukryj stacje z Ameryki Północnej + + + + Hide stations from South America + Ukryj stacje z Ameryki Południowej + + + + Hide stations from Asia + Ukryj stacje z Azji + + + + Hide stations from Africa + Ukryj stacje z Afryki + + + + Hide stations from Oceania + Ukryj stacje z Oceanii + + + + Hide stations from Antarctica + Ukryj stacje z Antarktydy + + + + Full Duplex Mode + Tryb pełnego dupleksu + + + + Highlight callsigns worked before on band + Podświetl znaki wcześniej zrobione na paśmie + + + + Highlight callsigns worked today or yesterday + Podświetl znaki, z którymi była łączność dziś lub wczoraj + + + + Highlight callsigns from Ignore List + Podświetl znaki z listy ignorowanych + + + + Enable Message Popups + Włącz wyskakujące wiadomości + + + + QSY Monitor + Monitor QSY + + + + Ignore stations worked before on band + Ignoruj stacje wcześniej zrobione na paśmie + + + + Use multithreaded FT8 decoder + Użyj wielowątkowego dekodera FT8 + + + + Auto + Auto + + + + + 5 + 5 + + + + + 7 + 7 + + + + + 11 + 11 + + + + Low + Niska + + + + Medium + Średnia + + + + High + Wysoka + + + + Minimum + Minimalna + + + + Use low thresholds + Użyj niskich progów + + + + Use subpass + Użyj podprzejścia + + + + 2-Stage + 2-etapowe + + + + 3-Stage + 3-etapowe + + + + Early + Wcześnie + + + + Late + Późno + + + + Wideband DX Call search + Szerokopasmowe wyszukiwanie znaku DX + + + + Hide FT8 dupe messages + Ukryj zduplikowane wiadomości FT8 + + + + VHF / UHF Buttons + Przyciski VHF / UHF + + + + Highlight stations from Territory 1 + Podświetl stacje z Terytorium 1 + + + + Highlight stations from Territory 2 + Podświetl stacje z Terytorium 2 + + + + Highlight stations from Territory 3 + Podświetl stacje z Terytorium 3 + + + + Highlight stations from Territory 4 + Podświetl stacje z Terytorium 4 + + + + Disable clicks on waterfall + Wyłącz kliknięcia na wodospadzie + + + + + JT65 + JT65 + + + + Astronomical data + Dane astronomiczne + + + + List of Type 1 prefixes and suffixes + Lista prefiksów i sufiksów typu 1 + + + + Settings... + Ustawienia... + + + + Local User Guide + Lokalny podręcznik użytkownika + + + + Open log directory + Otwórz katalog logów + + + + JT4 + JT4 + + + + Message averaging + Uśrednianie wiadomości + + + + Enable averaging + Włącz uśrednianie + + + + Enable deep search + Włącz głębokie wyszukiwanie + + + + WSPR + WSPR + + + + Echo Graph + Wykres echa + + + + F8 + F8 + + + + + Echo + Echo + + + + EME Echo mode + Tryb EME Echo + + + + ISCAT + ISCAT + + + + Fast Graph + Szybki wykres + + + + F9 + F9 + + + + &Download Samples ... + &Pobierz próbki ... + + + + <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> + <html><head/><body><p>Pobierz przykładowe pliki audio prezentujące różne tryby.</p></body></html> + + + + MSK144 + MSK144 + + + + QRA64 + QRA64 + + + + Release Notes + Informacje o wydaniu + + + + Enable AP for DX Call + Włącz AP dla znaku DX + + + + FreqCal + Kalibracja częstotliwości + + + + Measure reference spectrum + Zmierz widmo referencyjne + + + + Measure phase response + Zmierz odpowiedź fazową + + + + Erase reference spectrum + Usuń widmo referencyjne + + + + Execute frequency calibration cycle + Wykonaj cykl kalibracji częstotliwości + + + + Equalization tools ... + Narzędzia korekcji ... + + + + + FT8 + FT8 + + + + + Enable AP + Włącz AP + + + + Solve for calibration parameters + Wyznacz parametry kalibracji + + + + Copyright notice + Informacja o prawach autorskich + + + + Shift+F1 + Shift+F1 + + + + Fox log + Log Fox + + + + FT8 DXpedition Mode User Guide + Podręcznik trybu FT8 DXpedition + + + + Reset Cabrillo log ... + Resetuj log Cabrillo ... + + + + Color highlighting scheme + Schemat podświetlania kolorami + + + + Export Cabrillo log ... + Eksportuj log Cabrillo ... + + + + Contest log + Log zawodów + + + + Erase WSPR hashtable + Wyczyść tablicę skrótów WSPR + + + + + FT4 + FT4 + + + + Quick-Start Guide to Q65 + Przewodnik szybkiego startu Q65 + + + + Auto Clear Avg after decode + Automatycznie wyczyść średnią po dekodowaniu + + + + Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 + Przewodnik szybkiego startu WSJT-X 2.5.0 i MAP65 3.0 + + + + Rig Control Error + Błąd sterowania radiem + + + + + + Receiving + Odbieranie + + + + Do you want to reconfigure the radio interface? + Czy chcesz ponownie skonfigurować interfejs radia? + + + + Error Scanning ADIF Log + Błąd skanowania logu ADIF + + + + Scanned ADIF log, %1 worked-before records created. CTY: %2 + Przeskanowano log ADIF; utworzono %1 rekordów wcześniej zrobionych. CTY: %2 + + + + Error Loading LotW Users Data + Błąd wczytywania danych użytkowników LoTW + + + + Error Writing WAV File + Błąd zapisu pliku WAV + + + + Enumerating audio devices + Wykrywanie urządzeń audio + + + + Configurations... + Konfiguracje... + + + + + + + + + + + + + + + + + + + + + + + Message + Wiadomość + + + + Error Killing jt9.exe Process + Błąd zamykania procesu jt9.exe + + + + KillByName return code: %1 + Kod zwrotny KillByName: %1 + + + + Error removing "%1" + Błąd usuwania "%1" + + + + Click OK to retry + Kliknij OK, aby ponowić próbę + + + + + Improper mode + Nieprawidłowy tryb + + + + + File Open Error + Błąd otwierania pliku + + + + + + + + Cannot open "%1" for append: %2 + Nie można otworzyć "%1" w trybie dopisywania: %2 + + + + Error saving c2 file + Błąd zapisu pliku c2 + + + + Error in Sound Input + Błąd wejścia dźwięku + + + + Error in Sound Output + Błąd wyjścia dźwięku + + + + + Single-Period Decodes + Dekodowania z pojedynczego okresu + + + + + Average Decodes + Dekodowania uśrednione + + + + Change Operator + Zmień operatora + + + + New operator: + Nowy operator: + + + + Status File Error + Błąd pliku stanu + + + + + Cannot open "%1" for writing: %2 + Nie można otworzyć "%1" do zapisu: %2 + + + + Decodes containing My Call + Dekodowania zawierające mój znak + + + + Subprocess Error + Błąd podprocesu + + + + Subprocess failed with exit code %1 + Podproces zakończył się kodem wyjścia %1 + + + + + Running: %1 +%2 + Uruchomiono: %1 +%2 + + + + Subprocess error + Błąd podprocesu + + + + Reference spectrum saved + Zapisano widmo referencyjne + + + + It is very important to avoid audio harmonics and distorted audio signals. +This is usually achieved by the following step-by-step approach: + +1. Select 'Fake it' in the Settings/Radio menu as your 'Split mode'. If your + rig does not support this, select 'Rig'. But really try to avoid 'None'! + +2. Set the transmission power of your transceiver to maximum. + +3. Set the Pwr slider to the minimum and click on the 'Tune' button. + +4. Observe the actual transmission power of your rig as well as ALC. + +5. Carefully increase the Pwr slider until you have reached the + maximum transmit powe of your transceiver. + +6. VERY IMPORTANT: Now reduce the Pwr slider until you reach approx. + 90% of your max. Tx power. ALC should be close to zero. + +7. This is the maximum audio level permitted with your setup. + Always stay with the Pwr slider below this max. value. + +If possible, check your transmission from time to time with a webSDR +to ensure the signal is clean and not distorted. + Bardzo ważne jest unikanie harmonicznych audio i zniekształconych sygnałów audio. +Zwykle można to osiągnąć, wykonując następujące kroki: + +1. W menu Ustawienia/Radio wybierz „Fake it” jako „Tryb split”. Jeżeli Twoje + radio tego nie obsługuje, wybierz „Rig”. Naprawdę staraj się unikać opcji „None”! + +2. Ustaw moc nadawania transceivera na maksimum. + +3. Ustaw suwak Moc na minimum i kliknij przycisk „Strojenie”. + +4. Obserwuj rzeczywistą moc nadawania radia oraz ALC. + +5. Ostrożnie zwiększaj suwak Moc, aż osiągniesz maksymalną + moc nadawania transceivera. + +6. BARDZO WAŻNE: teraz zmniejsz suwak Moc, aż osiągniesz około + 90% maksymalnej mocy TX. ALC powinno być bliskie zeru. + +7. To jest maksymalny dozwolony poziom audio dla Twojej konfiguracji. + Zawsze utrzymuj suwak Moc poniżej tej maksymalnej wartości. + +Jeśli to możliwe, od czasu do czasu sprawdzaj swój sygnał przez webSDR, +aby upewnić się, że jest czysty i niezniekształcony. + + + + <b>Recommended Audio Settings</b> + <b>Zalecane ustawienia audio</b> + + + + Invalid data in fmt.all at line %1 + Nieprawidłowe dane w fmt.all w wierszu %1 + + + + Good Calibration Solution + Dobre rozwiązanie kalibracyjne + + + + <pre>%1%L2 ±%L3 ppm +%4%L5 ±%L6 Hz + +%7%L8 +%9%L10 Hz</pre> + <pre>%1%L2 ±%L3 ppm +%4%L5 ±%L6 Hz + +%7%L8 +%9%L10 Hz</pre> + + + + Delete Calibration Measurements + Usuń pomiary kalibracyjne + + + + The "fmt.all" file will be renamed as "fmt.bak" + Plik „fmt.all” zostanie przemianowany na „fmt.bak” + + + + No data read from disk. Wrong file format? + Nie odczytano danych z dysku. Nieprawidłowy format pliku? + + + + Confirm Delete + Potwierdź usunięcie + + + + Are you sure you want to delete all *.wav and *.c2 files in "%1"? + Czy na pewno chcesz usunąć wszystkie pliki *.wav i *.c2 z „%1”? + + + + Keyboard Shortcuts + Skróty klawiaturowe + + + + Special Mouse Commands + Specjalne polecenia myszy + + + + No more files to open. + Brak kolejnych plików do otwarcia. + + + + + Spotting to PSK Reporter unavailable + Wysyłanie spotów do PSK Reporter jest niedostępne + + + + Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. + Wybierz inną częstotliwość TX. WSJT-X nie będzie świadomie nadawać innym trybem w podpaśmie WSPR na 30 m. + + + + WSPR Guard Band + Pasmo ochronne WSPR + + + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2025 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; and other members of the WSJT Development Group." + Jeśli korzystasz z dowolnej części WSJT-X na zasadach dozwolonych przez Powszechną Licencję Publiczną GNU, musisz w widocznym miejscu swojego dzieła pochodnego umieścić następującą informację o prawach autorskich: + +„Algorytmy, kod źródłowy, wygląd i sposób działania WSJT-X oraz programów pokrewnych, a także specyfikacje protokołów trybów FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 są Copyright (C) 2001-2025 jednego lub kilku z następujących autorów: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; oraz innych członków WSJT Development Group.” + + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: toggle "Call 1st")</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Toggle "Call 1st" checkbox</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> + +</table> + Keyboard shortcuts help window contents + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Zatrzymaj TX, przerwij QSO, wyczyść kolejkę następnych wywołań</td></tr> + <tr><td><b>F1 </b></td><td>Internetowy podręcznik użytkownika (Alt: nadaj Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Informacja o prawach autorskich</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>O programie WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Otwórz okno ustawień (Alt: nadaj Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Wyświetl skróty klawiaturowe (Alt: nadaj Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Wyczyść Znak DX, Lokator DX i wiadomości TX 1-4 (Alt: nadaj Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Zakończ program</td></tr> + <tr><td><b>F5 </b></td><td>Wyświetl specjalne polecenia myszy (Alt: nadaj Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Otwórz następny plik w katalogu (Alt: przełącz „Wywołaj pierwszą”)</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Dekoduj wszystkie pozostałe pliki w katalogu</td></tr> + <tr><td><b>F7 </b></td><td>Wyświetl okno uśredniania wiadomości</td></tr> + <tr><td><b>F11 </b></td><td>Przesuń częstotliwość RX o 1 Hz w dół</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Przesuń jednakowe częstotliwości RX i TX o 1 Hz w dół</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Przesuń częstotliwość TX o 60 Hz (FT8) lub 90 Hz (FT4) w dół</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Przesuń częstotliwość pokrętła o 1000 Hz w dół</td></tr> + <tr><td><b>F12 </b></td><td>Przesuń częstotliwość RX o 1 Hz w górę</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Przesuń jednakowe częstotliwości RX i TX o 1 Hz w górę</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Przesuń częstotliwość TX o 60 Hz (FT8) lub 90 Hz (FT4) w górę</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Przesuń częstotliwość pokrętła o 1000 Hz w górę</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Ustaw bieżącą transmisję na ten numer na karcie 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Ustaw następną transmisję na ten numer na karcie 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Wyczyść Aktywne stacje dla QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Przełącz stan „Najlepszy S+P”</td></tr> + <tr><td><b>Alt+C </b></td><td>Przełącz pole „Wywołaj pierwszą”</td></tr> + <tr><td><b>Alt+D </b></td><td>Dekoduj ponownie na częstotliwości QSO</td></tr> + <tr><td><b>Shift+D </b></td><td>Pełne dekodowanie (oba okna)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Włącz TX parzyste/1.</td></tr> + <tr><td><b>Shift+E </b></td><td>Wyłącz TX parzyste/1.</td></tr> + <tr><td><b>Alt+E </b></td><td>Wyczyść</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edytuj pole tekstu swobodnego</td></tr> + <tr><td><b>Alt+G </b></td><td>Generuj standardowe wiadomości</td></tr> + <tr><td><b>Alt+H </b></td><td>Zatrzymaj TX</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Dodaj Znak DX do listy ignorowanych</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Wyszukaj znak w bazie i wygeneruj standardowe wiadomości</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitoruj</td></tr> + <tr><td><b>Alt+N </b></td><td>Przełącz „Włącz TX”</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Otwórz plik .wav</td></tr> + <tr><td><b>Alt+O </b></td><td>Zmień operatora</td></tr> + <tr><td><b>Alt+Q </b></td><td>Otwórz okno „Zapisz QSO”</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Ustaw wiadomość Tx4 na RRR (nie w FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Ustaw wiadomość Tx4 na RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Odśwież okno Aktywne stacje</td></tr> + <tr><td><b>Alt+S </b></td><td>Zatrzymaj monitorowanie</td></tr> + <tr><td><b>Alt+T </b></td><td>Przełącz stan Strojenie</td></tr> + <tr><td><b>Alt+Z </b></td><td>Wyczyść stan zawieszonego dekodera</td></tr> + +</table> + + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Right-click</b> to set Tx frequency.<br/> + <b>Double-right-click</b> to set Rx and Tx frequencies. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> + and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> + Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> + own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">Dial Frequency:</td> + <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> + <b>Right-click</b> to increase frequency by 1 kHz.<br/> + <b>Left-click</b> to decrease frequency by 1 kHz.<br/> + The mouse pointer must be over the Dial Frequency indicator. + </td> + </tr> + <tr> + <td align="right">H Button:</td> + <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to activate or deactivate SuperFox mode. + </td> + </tr> + <tr> + <td align="right">FT8 Button:</td> + <td><b>Click</b> to switch to FT8 Hound Mode.<br/> + <b>Right-click</b> to toggle last used Special Operating Activity On/Off. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> + <tr> + <td align="right">Tx5 Button:</td> + <td><b>Right-click</b> to retain Tx5 free text. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Right-click</b> to freeze the state of the checkbox.<br/> + <b>Right-click on the FT8 Button</b> to unfreeze. + </td> + </tr> + <tr> + <td align="right">Enable Tx Button:</td> + <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> + <b>Right-click</b> to toggle Wait & Pounce On/Off. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> + If <b>Alternate Erase button behavior</b> is checked:<br/> + <b>Click</b> to erase Band Activity window.<br/> + <b>Right-click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">DX Call Button:</td> + <td><b>Click</b> to toggle Wait & Call On/Off.<br/> + <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. + </td> + </tr> + <tr> + <td align="right">Lookup Button:</td> + <td><b>Click</b> to search for callsign in database.<br/> + <b>Right-click</b> to search for Dx Call on qrz.com. + </td> + </tr> + <tr> + <td align="right">Add Button:</td> + <td><b>Click</b> to add callsign and locator to database.<br/> + <b>Right-click</b> to search for Dx Call on hamqth.com. + </td> + </tr> + <tr> + <td align="right">Ignore Button:</td> + <td><b>Click</b> to add callsign to the Ignore List.<br/> + <b>Right-click</b> to search for Dx Call on qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Band Buttons:</td> + <td><b>Click</b> to toggle band / mode default frequencies.<br/> + <b>Right-click</b> to toggle FT8 DXpedition frequencies. + </td> + </tr> +</table> + Mouse commands help window contents + <table cellpadding=5> + <tr> + <th align="right">Kliknij</th> + <th align="left">Działanie</th> + </tr> + <tr> + <td align="right">Wodospad:</td> + <td><b>Kliknij</b>, aby ustawić częstotliwość RX.<br/> + <b>Kliknij prawym przyciskiem</b>, aby ustawić częstotliwość TX.<br/> + <b>Kliknij dwukrotnie prawym przyciskiem</b>, aby ustawić częstotliwości RX i TX. + </td> + </tr> + <tr> + <td align="right">Zdekodowany tekst:</td> + <td><b>Kliknij dwukrotnie</b>, aby skopiować drugi znak do pola Znak DX, lokator do Lokator DX, zmienić częstotliwość RX<br/> + i TX na częstotliwość zdekodowanego sygnału oraz wygenerować standardowe wiadomości.<br/> + Przytrzymaj <b>Alt</b>, aby zapobiec włączeniu TX po <b>dwukrotnym kliknięciu</b>.<br/> + Jeśli zaznaczono <b>Stała częstotliwość TX</b> albo pierwszy znak w wiadomości jest Twoim<br/> + własnym znakiem, częstotliwość TX nie zostanie zmieniona, chyba że przytrzymasz <b>Ctrl</b>. + </td> + </tr> + <tr> + <td align="right">Częstotliwość pokrętła:</td> + <td><b>Obracaj kółkiem myszy</b>, aby zmieniać wartości kHz, albo:<br/> + <b>Kliknij prawym przyciskiem</b>, aby zwiększyć częstotliwość o 1 kHz.<br/> + <b>Kliknij lewym przyciskiem</b>, aby zmniejszyć częstotliwość o 1 kHz.<br/> + Wskaźnik myszy musi znajdować się nad wskaźnikiem częstotliwości pokrętła. + </td> + </tr> + <tr> + <td align="right">Przycisk H:</td> + <td><b>Kliknij</b>, aby włączyć/wyłączyć tryb Hound FT8.<br/> + <b>Kliknij prawym przyciskiem</b>, aby włączyć lub wyłączyć tryb SuperFox. + </td> + </tr> + <tr> + <td align="right">Przycisk FT8:</td> + <td><b>Kliknij</b>, aby przełączyć na tryb Hound FT8.<br/> + <b>Kliknij prawym przyciskiem</b>, aby włączyć/wyłączyć ostatnio używaną specjalną aktywność operatorską. + </td> + </tr> + <tr> + <td align="right">Przycisk Q65:</td> + <td><b>Kliknij</b>, aby przełączyć na tryb Q65.<br/> + <b>Kliknij prawym przyciskiem</b>, aby przełączyć na tryb Q65 Pileup. + </td> + </tr> + <tr> + <td align="right">Przycisk JT65:</td> + <td><b>Kliknij</b>, aby przełączyć na tryb JT65.<br/> + <b>Kliknij prawym przyciskiem</b>, aby przełączyć na tryb JT9. + </td> + </tr> + <tr> + <td align="right">Przycisk Tx5:</td> + <td><b>Kliknij prawym przyciskiem</b>, aby zachować tekst swobodny Tx5. + </td> + </tr> + <tr> + <td align="right">TX parzyste/1.:</td> + <td><b>Kliknij prawym przyciskiem</b>, aby zablokować stan pola wyboru.<br/> + <b>Kliknij prawym przyciskiem przycisk FT8</b>, aby odblokować. + </td> + </tr> + <tr> + <td align="right">Przycisk Włącz TX:</td> + <td><b>Kliknij</b>, aby włączyć/wyłączyć tryb Auto-TX.<br/> + <b>Kliknij prawym przyciskiem</b>, aby włączyć/wyłączyć Oczekuj i przechwytuj. + </td> + </tr> + <tr> + <td align="right">Przycisk Wyczyść:</td> + <td><b>Kliknij</b>, aby wyczyścić okno Częstotliwość RX.<br/> + <b>Kliknij dwukrotnie</b>, aby wyczyścić okna Częstotliwość RX i Aktywność pasma.<br/> + Jeśli zaznaczono <b>Alternatywne działanie przycisku Wyczyść</b>:<br/> + <b>Kliknij</b>, aby wyczyścić okno Aktywność pasma.<br/> + <b>Kliknij prawym przyciskiem</b>, aby wyczyścić okno Częstotliwość RX.<br/> + <b>Kliknij dwukrotnie</b>, aby wyczyścić okna Częstotliwość RX i Aktywność pasma. + </td> + </tr> + <tr> + <td align="right">Przycisk Znak DX:</td> + <td><b>Kliknij</b>, aby włączyć/wyłączyć Oczekuj i wywołaj.<br/> + <b>Kliknij prawym przyciskiem</b>, aby wyczyścić Znak DX, Lokator DX i standardowe wiadomości. + </td> + </tr> + <tr> + <td align="right">Przycisk Wyszukaj:</td> + <td><b>Kliknij</b>, aby wyszukać znak w bazie danych.<br/> + <b>Kliknij prawym przyciskiem</b>, aby wyszukać Znak DX na qrz.com. + </td> + </tr> + <tr> + <td align="right">Przycisk Dodaj:</td> + <td><b>Kliknij</b>, aby dodać znak i lokator do bazy danych.<br/> + <b>Kliknij prawym przyciskiem</b>, aby wyszukać Znak DX na hamqth.com. + </td> + </tr> + <tr> + <td align="right">Przycisk Ignoruj:</td> + <td><b>Kliknij</b>, aby dodać znak do listy ignorowanych.<br/> + <b>Kliknij prawym przyciskiem</b>, aby wyszukać Znak DX na qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Przyciski pasm:</td> + <td><b>Kliknij</b>, aby przełączać domyślne częstotliwości pasmo/tryb.<br/> + <b>Kliknij prawym przyciskiem</b>, aby przełączać częstotliwości FT8 DXpedition. + </td> + </tr> +</table> + + + + Please choose another dial frequency. +Must be 3Khz away from %1. +WSJT-X will not operate in Fox mode +overlapping the standard FT8 sub-bands. + Wybierz inną częstotliwość pokrętła. +Musi znajdować się co najmniej 3 kHz od %1. +WSJT-X nie będzie pracować w trybie Fox, +jeśli nakłada się on na standardowe podpasma FT8. + + + + + Fox Mode warning + Ostrzeżenie trybu Fox + + + + Please choose another dial frequency. +WSJT-X will not operate in Fox mode +overlapping the WSPR sub-bands. + Wybierz inną częstotliwość pokrętła. +WSJT-X nie będzie pracować w trybie Fox, +jeśli nakłada się on na podpasma WSPR. + + + + Last Tx: %1 + Ostatni TX: %1 + + + + This station transmits in the same time slot as you do. + +You must not start a QSO if both stations Tx even/1st +or Tx odd/2nd, while the Tx even/1st checkbox is disabled. + +Click the MSK144 mode button to re-enable the Tx even/1st +checkbox, or choose another station. + Ta stacja nadaje w tym samym przedziale czasowym co Ty. + +Nie wolno rozpoczynać QSO, jeśli obie stacje nadają parzyste/1. +lub nieparzyste/2., gdy pole TX parzyste/1. jest wyłączone. + +Kliknij przycisk trybu MSK144, aby ponownie włączyć pole TX parzyste/1., +albo wybierz inną stację. + + + + Should you switch to EU VHF Contest mode? + +To do so, check 'Special operating activity' and +'EU VHF Contest' on the Settings | Advanced tab. + Czy chcesz przełączyć na tryb EU VHF Contest? + +Aby to zrobić, zaznacz „Specjalna aktywność operatorska” oraz +„EU VHF Contest” na karcie Ustawienia | Zaawansowane. + + + + Should you switch to ARRL Field Day mode? + Czy chcesz przełączyć na tryb ARRL Field Day? + + + + Should you switch to RTTY contest mode? + Czy chcesz przełączyć na tryb zawodów RTTY? + + + + + + + Add to CALL3.TXT + Dodaj do CALL3.TXT + + + + Please enter a valid grid locator + Wprowadź prawidłowy lokator + + + + Cannot open "%1" for read/write: %2 + Nie można otworzyć "%1" do odczytu/zapisu: %2 + + + + %1 +is already in CALL3.TXT, do you wish to replace it? + %1 +znajduje się już w CALL3.TXT. Czy chcesz go zastąpić? + + + + Warning: DX Call field is empty. + Ostrzeżenie: pole Znak DX jest puste. + + + + Log file error + Błąd pliku logu + + + + Cannot open "%1" + Nie można otworzyć "%1" + + + + Error sending log to N1MM + Błąd wysyłania logu do N1MM + + + + Write returned "%1" + Operacja zapisu zwróciła "%1" + + + + Stations calling DXpedition %1 + Stacje wołające DXpedition %1 + + + + Show Already Worked + Pokaż już zrobione + + + + Super Fox + Super Fox + + + + Super Hound + Super Hound + + + + Hound + Hound + + + + Tx Messages + Wiadomości TX + + + + + + + + + Confirm Erase + Potwierdź wyczyszczenie + + + + Are you sure you want to erase file ALL.TXT? + Czy na pewno chcesz wyczyścić plik ALL.TXT? + + + + Are you sure you want to erase the list of Q65 callers? + Czy na pewno chcesz wyczyścić listę wołających Q65? + + + + + Confirm Reset + Potwierdź reset + + + + Are you sure you want to erase your contest log? + Czy na pewno chcesz wyczyścić log zawodów? + + + + Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. + Spowoduje to usunięcie wszystkich rekordów QSO bieżących zawodów. Pozostaną one w pliku logu ADIF, ale nie będą dostępne do eksportu w logu Cabrillo. + + + + Cabrillo Log saved + Zapisano log Cabrillo + + + + Are you sure you want to erase file wsjtx_log.adi? + Czy na pewno chcesz wyczyścić plik wsjtx_log.adi? + + + + Are you sure you want to erase the WSPR hashtable? + Czy na pewno chcesz wyczyścić tablicę skrótów WSPR? + + + + %1 W + %1 W + + + + SWR > 2.5 !!! + +Transmission was stopped + +Check your antenna + SWR > 2,5 !!! + +Nadawanie zostało zatrzymane + +Sprawdź antenę + + + + Tune digital gain + Cyfrowe wzmocnienie strojenia + + + + Transmit digital gain + Cyfrowe wzmocnienie nadawania + + + + Prefixes + Prefiksy + + + + Network Error + Błąd sieci + + + + Error: %1 +UDP server %2:%3 + Błąd: %1 +Serwer UDP %2:%3 + + + + File Error + Błąd pliku + + + + Phase Training Disabled + Trening fazy wyłączony + + + + Phase Training Enabled + Trening fazy włączony + + + + WD:0m + WD:0m + + + + Runaway Tx watchdog + Watchdog niekontrolowanego TX + + + + WD:%1m + WD:%1m + + + + + Free Text Message + Wiadomość tekstowa + + + + + Message: + Wiadomość: + + + + Directional calls not yet supported in SuperFox mode + Wywołania kierunkowe nie są jeszcze obsługiwane w trybie SuperFox + + + + TOTP: No seed entered in fox configuration to generate verification code. + TOTP: w konfiguracji Fox nie podano ziarna do generowania kodu weryfikacyjnego. + + + + TOTP SF: seed not long enough. + TOTP SF: ziarno jest zbyt krótkie. + + + + Are you sure you want to erase the Tx Log? + Czy na pewno chcesz wyczyścić log TX? + + + + "%1" added to Ignore List + „%1” dodano do listy ignorowanych + + + + Are you sure you want to erase the Ignore List? + Czy na pewno chcesz wyczyścić listę ignorowanych? + + + + + Log File Error + Błąd pliku logu + + + + Are you sure you want to clear the QSO queues? + Czy na pewno chcesz wyczyścić kolejki QSO? + + + Download EME Ephemeris Chart + Pobierz wykres efemeryd EME + + + Highlight Whitelist entries + Podświetl wpisy z białej listy + + + + MessageAveraging + + + + Message Averaging + Uśrednianie wiadomości + + + + UTC Sync DT Freq + UTC Synch. DT Częst. + + + + Modes + + + + Mode + Tryb + + + + MultiSettings + + + Default + Domyślna + + + + MultiSettings::impl + + + &Switch To + &Przełącz na + + + + &Clone + &Klonuj + + + + Clone &Into ... + Klonuj &do ... + + + + R&eset + &Resetuj + + + + &Rename ... + &Zmień nazwę ... + + + + &Delete + &Usuń + + + + Clone Into Configuration + Klonuj do konfiguracji + + + + Confirm overwrite of all values for configuration "%1" with values from "%2"? + Potwierdź nadpisanie wszystkich wartości konfiguracji "%1" wartościami z "%2"? + + + + Reset Configuration + Resetuj konfigurację + + + + Confirm reset to default values for configuration "%1"? + Potwierdź przywrócenie wartości domyślnych konfiguracji "%1"? + + + + Delete Configuration + Usuń konfigurację + + + + Confirm deletion of configuration "%1"? + Potwierdź usunięcie konfiguracji "%1"? + + + + NameDialog + + + New Configuration Name + Nazwa nowej konfiguracji + + + + Old name: + Stara nazwa: + + + + &New name: + &Nowa nazwa: + + + + NetworkAccessManager + + + Network SSL/TLS Errors + Błędy sieci SSL/TLS + + + + OmniRigTransceiver + + + OmniRig: unrecognized mode + OmniRig: nierozpoznany tryb + + + + Failed to start OmniRig COM server + Nie udało się uruchomić serwera COM OmniRig + + + + OmniRig: don't know how to set rig frequency + OmniRig: nie wiadomo, jak ustawić częstotliwość radia + + + + OmniRig COM/OLE error: %1 at %2: %3 (%4) + Błąd COM/OLE OmniRig: %1 w %2: %3 (%4) + + + + PollingTransceiver + + + Unexpected rig error + Nieoczekiwany błąd radia + + + + QObject + + + Failed to open LotW users CSV file: '%1' + Nie udało się otworzyć pliku CSV użytkowników LoTW: '%1' + + + + OOB + OOB + + + + Too many colours in palette. + Zbyt wiele kolorów w palecie. + + + + Error reading waterfall palette file "%1:%2" too many colors. + Błąd odczytu pliku palety wodospadu "%1:%2": zbyt wiele kolorów. + + + + Error reading waterfall palette file "%1:%2" invalid triplet. + Błąd odczytu pliku palety wodospadu "%1:%2": nieprawidłowa trójka wartości. + + + + Error reading waterfall palette file "%1:%2" invalid color. + Błąd odczytu pliku palety wodospadu "%1:%2": nieprawidłowy kolor. + + + + Error opening waterfall palette file "%1": %2. + Błąd otwierania pliku palety wodospadu "%1": %2. + + + + Error writing waterfall palette file "%1": %2. + Błąd zapisu pliku palety wodospadu "%1": %2. + + + + QSYMessage + + + WSJT-X Popup + Okno komunikatu WSJT-X + + + + TextLabel + Etykieta tekstowa + + + + Reply +Yes + Odpowiedź +Tak + + + + Reply +No + Odpowiedź +Nie + + + + QSYMessageCreator + + + Message Creator + Kreator wiadomości + + + + HF + HF + + + + + SSB + SSB + + + + + + CW + CW + + + + + FM + FM + + + + FST4 + FST4 + + + + FT4 + FT4 + + + + + FT8 + FT8 + + + + JT9 + JT9 + + + + JT65 + JT65 + + + + + + + Message + Wiadomość + + + + 630 M + 630 M + + + + 160 M + 160 M + + + + 80 M + 80 M + + + + 60 M + 60 M + + + + 40 M + 40 M + + + + 30 M + 30 M + + + + 20 M + 20 M + + + + 17 M + 17 M + + + + 15 M + 15 M + + + + 12 M + 12 M + + + + 28 MHz + 28 MHz + + + + 29 MHz + 29 MHz + + + + + + Mode + Tryb + + + + + + Band + Pasmo + + + + + + SAVE + ZAPISZ + + + + + + kHz + kHz + + + + + + Send +Message + Wyślij +wiadomość + + + + VHF + VHF + + + + + 50 MHz + 50 MHz + + + + + 144 MHz + 144 MHz + + + + + 222 MHz + 222 MHz + + + + + 432 MHz + 432 MHz + + + + + 902 MHz + 902 MHz + + + + + 903 MHz + 903 MHz + + + + + 1296 MHz + 1296 MHz + + + + + 2304 MHz + 2304 MHz + + + + + 3400 MHz + 3400 MHz + + + + + 5760 MHz + 5760 MHz + + + + + 10368 MHz + 10368 MHz + + + + 24192 MHz + 24192 MHz + + + + 40 MHz + 40 MHz + + + + 70 MHz + 70 MHz + + + + MSK144 + MSK144 + + + + FM MHz + FM MHz + + + + EME + EME + + + + 24048 MHz + 24048 MHz + + + + Q65-30B + Q65-30B + + + + Q65-60C + Q65-60C + + + + Q65-60D + Q65-60D + + + + Q65-60E + Q65-60E + + + + Q65-120D + Q65-120D + + + + General + Ogólne + + + + Please call me by phone + Proszę zadzwoń do mnie + + + + Please check Ping Jockey + Sprawdź proszę Ping Jockey + + + + You are in the log + Jesteś w logu + + + + You are transmitting in the wrong time slot + Nadajesz w niewłaściwym przedziale czasowym + + + + You are not in Contest Mode + Nie pracujesz w trybie zawodów + + + + Your audio is distorted + Twoje audio jest zniekształcone + + + + Your transmitter is overmodulated + Twój nadajnik jest przesterowany + + + + Please check ON4KST + Sprawdź proszę ON4KST + + + + Please transmit above 1000 Hz + Nadaj proszę powyżej 1000 Hz + + + + Check your email + Sprawdź swoją pocztę e-mail + + + + Please check HB9Q Logger + Sprawdź proszę HB9Q Logger + + + + Please check your PC Clock + Sprawdź proszę zegar komputera + + + + You are transmitting on top of a rare DX station + Nadajesz na częstotliwości rzadkiej stacji DX + + + + Please QSL via LoTW + Proszę potwierdź QSL przez LoTW + + + + Send Message + Wyślij wiadomość + + + + MessageCreator + Kreator wiadomości + + + + QSYMonitor + + + QSYMonitor + Monitor QSY + + + + Clear + Wyczyść + + + + QSY Monitor + Monitor QSY + + + + RemoteFile + + + + + + + + File System Error + Błąd systemu plików + + + + Cannot rename file: +"%1" +to: "%2" +Error(%3): %4 + Nie można zmienić nazwy pliku: +"%1" +na: "%2" +Błąd(%3): %4 + + + + Cannot delete file: +"%1" + Nie można usunąć pliku: +"%1" + + + + + + Network Error + Błąd sieci + + + + Too many redirects: %1 + Zbyt wiele przekierowań: %1 + + + + Redirect not followed: %1 + Nie wykonano przekierowania: %1 + + + + Cannot commit changes to: +"%1" + Nie można zatwierdzić zmian w: +"%1" + + + + Cannot open file: +"%1" +Error(%2): %3 + Nie można otworzyć pliku: +"%1" +Błąd(%2): %3 + + + + Cannot make path: +"%1" + Nie można utworzyć ścieżki: +"%1" + + + + Cannot write to file: +"%1" +Error(%2): %3 + Nie można zapisać do pliku: +"%1" +Błąd(%2): %3 + + + + SampleDownloader::impl + + + + Download Samples + Pobierz próbki + + + + &Abort + &Przerwij + + + + &Refresh + &Odśwież + + + + &Details + &Szczegóły + + + + Base URL for samples: + Bazowy URL próbek: + + + + Only use HTTP: + Używaj tylko HTTP: + + + + Check this if you get SSL/TLS errors + Zaznacz, jeśli występują błędy SSL/TLS + + + + Input Error + Błąd danych wejściowych + + + + Invalid URL format + Nieprawidłowy format URL + + + + SoundInput + + + An error opening the audio input device has occurred. + Wystąpił błąd podczas otwierania urządzenia wejścia audio. + + + + An error occurred during read from the audio input device. + Wystąpił błąd podczas odczytu z urządzenia wejścia audio. + + + + Non-recoverable error, audio input device not usable at this time. + Błąd nieodwracalny — urządzenie wejścia audio nie może być teraz używane. + + + + Requested input audio format is not valid. + Żądany format wejściowego audio jest nieprawidłowy. + + + + Requested input audio format is not supported on device. + Żądany format wejściowego audio nie jest obsługiwany przez urządzenie. + + + + Failed to initialize audio sink device + Nie udało się zainicjalizować urządzenia docelowego audio + + + + Idle + Bezczynne + + + + Receiving + Odbieranie + + + + Suspended + Wstrzymane + + + + Interrupted + Przerwane + + + + Error + Błąd + + + + Stopped + Zatrzymane + + + + SoundOutput + + + An error opening the audio output device has occurred. + Wystąpił błąd podczas otwierania urządzenia wyjścia audio. + + + + An error occurred during write to the audio output device. + Wystąpił błąd podczas zapisu do urządzenia wyjścia audio. + + + + Audio data not being fed to the audio output device fast enough. + Dane audio nie są dostarczane do urządzenia wyjściowego wystarczająco szybko. + + + + Non-recoverable error, audio output device not usable at this time. + Błąd nieodwracalny — urządzenie wyjścia audio nie może być teraz używane. + + + + Requested output audio format is not valid. + Żądany format wyjściowego audio jest nieprawidłowy. + + + + Requested output audio format is not supported on device. + Żądany format wyjściowego audio nie jest obsługiwany przez urządzenie. + + + + No audio output device configured. + Nie skonfigurowano urządzenia wyjścia audio. + + + + Idle + Bezczynne + + + + Sending + Wysyłanie + + + + Suspended + Wstrzymane + + + + Interrupted + Przerwane + + + + Error + Błąd + + + + Stopped + Zatrzymane + + + + StationDialog + + + Add Station + Dodaj stację + + + + &Band: + &Pasmo: + + + + &Offset (MHz): + &Przesunięcie (MHz): + + + + &Antenna: + &Antena: + + + + StationList::impl + + + Band name + Nazwa pasma + + + + Frequency offset + Przesunięcie częstotliwości + + + + Antenna description + Opis anteny + + + + Band + Pasmo + + + + Offset + Przesunięcie + + + + Antenna Description + Opis anteny + + + + TCITransceiver + + + ConnectionRefused + Odmowa połączenia + + + + RemoteHostClosed + Zdalny host zamknął połączenie + + + + HostNotFound + Nie znaleziono hosta + + + + SocketAccess + Dostęp do gniazda + + + + SocketResource + Zasoby gniazda + + + + SocketTimeout + Przekroczono czas gniazda + + + + DatagramTooLarge + Datagram zbyt duży + + + + Network + Sieć + + + + AddressInUse + Adres jest już używany + + + + SocketAddressNotAvailable + Adres gniazda niedostępny + + + + UnsupportedSocketOperation + Nieobsługiwana operacja gniazda + + + + UnfinishedSocketOperation + Niedokończona operacja gniazda + + + + ProxyAuthenticationRequired + Wymagane uwierzytelnienie proxy + + + + SslHandshakeFailed + Nieudane uzgadnianie SSL + + + + ProxyConnectionRefused + Proxy odrzuciło połączenie + + + + ProxyConnectionClosed + Połączenie proxy zostało zamknięte + + + + ProxyConnectionTimeout + Przekroczono czas połączenia proxy + + + + ProxyNotFound + Nie znaleziono proxy + + + + ProxyProtocol + Błąd protokołu proxy + + + + Operation + Operacja + + + + SslInternal + Wewnętrzny błąd SSL + + + + SslInvalidUserData + Nieprawidłowe dane użytkownika SSL + + + + Temporary + Tymczasowy + + + + UnknownSocket + Nieznany błąd gniazda + + + + TCI websocket error: %1 + Błąd WebSocket TCI: %1 + + + + TCI SDR could not be switched on + Nie można było włączyć SDR przez TCI + + + + TCI SDR is not switched on + SDR TCI nie jest włączony + + + + TCI RX2 could not be enabled + Nie można było włączyć RX2 przez TCI + + + + TCI Audio could not be switched on + Nie można było włączyć audio TCI + + + + + TCI could not be opened + Nie można było otworzyć TCI + + + + + TCI failed to set ptt + TCI nie zdołał ustawić PTT + + + + TCI should use PTT via CAT + TCI powinien używać PTT przez CAT + + + + + TCI failed set rxfreq + TCI nie zdołał ustawić częstotliwości RX + + + + + TCI failed set mode + TCI nie zdołał ustawić trybu + + + + TCI modulator not Idle + Modulator TCI nie jest bezczynny + + + + TransceiverBase + + + Unexpected rig error + Nieoczekiwany błąd radia + + + + WideGraph + + + Dialog + Okno dialogowe + + + + Spectrum gain + Wzmocnienie widma + + + + <html><head/><body><p>Enter definition for a new color palette.</p></body></html> + <html><head/><body><p>Wprowadź definicję nowej palety kolorów.</p></body></html> + + + + Adjust... + Dostosuj... + + + + Total power (dB) + Moc całkowita (dB) + + + + Waterfall gain + Wzmocnienie wodospadu + + + + <html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html> + <html><head/><body><p>Ustaw względny rozmiar widma w tym oknie.</p></body></html> + + + + % + % + + + + Spec + Widmo + + + + <html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html> + <html><head/><body><p>Wyrównaj linię bazową widma w całym wyświetlanym zakresie.</p></body></html> + + + + Flatten + Wyrównaj + + + + <html><head/><body><p>Compute and save a reference spectrum. (Not yet fully implemented.)</p></body></html> + <html><head/><body><p>Oblicz i zapisz widmo referencyjne. (Funkcja nie jest jeszcze w pełni zaimplementowana.)</p></body></html> + + + + Ref Spec + Widmo ref. + + + + Smoothing of Linear Average spectrum + Wygładzanie widma średniej liniowej + + + + Smooth + Wygładzanie + + + + Compression factor for frequency scale + Współczynnik kompresji skali częstotliwości + + + + Bins/Pixel + Przedziały/piksel + + + + + <html><head/><body><p>Position of time stamp above each interval line</p></body></html> + <html><head/><body><p>Położenie znacznika czasu nad każdą linią interwału.</p></body></html> + + + + Time stamp + Znacznik czasu + + + + + Off + Wyłączony + + + + Left + Lewo + + + + Right + Prawo + + + + Palette + Paleta + + + + Select waterfall palette + Wybierz paletę wodospadu + + + + Bars + Słupki + + + + Freq + Częst. + + + + <html><head/><body><p>Select data for spectral display</p></body></html> + <html><head/><body><p>Wybierz dane do wyświetlania widma.</p></body></html> + + + + Current + Bieżąca + + + + Cumulative + Skumulowane + + + + Linear Avg + Średnia liniowa + + + + Reference + Odniesienie + + + + Q65_Sync + Q65_Sync + + + + <html><head/><body><p>Frequency at left edge of waterfall</p></body></html> + <html><head/><body><p>Częstotliwość przy lewej krawędzi wodospadu.</p></body></html> + + + + Hz + Hz + + + + Start + Początek + + + + <html><head/><body><p>Decode JT9 only above this frequency</p></body></html> + <html><head/><body><p>Dekoduj JT9 tylko powyżej tej częstotliwości.</p></body></html> + + + + Hz + Hz + + + + Split + Podział + + + + Number of FFTs averaged (controls waterfall scrolling rate) + Liczba uśrednianych FFT (steruje szybkością przewijania wodospadu) + + + + N Avg + N średnia + + + + Waterfall zero + Poziom zerowy wodospadu + + + + Spectrum zero + Poziom zerowy widma + + + + User Defined + Użytkownika + + + + Wide Graph + Szeroki wykres + + + + + Read Palette + Wczytaj paletę + + + + WorkedBefore + + + Invalid ADIF field %0: %1 + Nieprawidłowe pole ADIF %0: %1 + + + + Malformed ADIF field %0: %1 + Uszkodzone pole ADIF %0: %1 + + + + Invalid ADIF header + Nieprawidłowy nagłówek ADIF + + + + Error opening ADIF log file for read: %0 + Błąd otwierania pliku logu ADIF do odczytu: %0 + + + + configuration_dialog + + + Settings + Ustawienia + + + + Genera&l + &Ogólne + + + + General station details and settings. + Ogólne dane i ustawienia stacji. + + + + Station Details + Dane stacji + + + + My C&all: + Mój &znak: + + + + Station callsign. + Znak wywoławczy stacji. + + + + M&y Grid: + Mój &lokator: + + + + <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> + <html><head/><body><p>Lokator Maidenhead, najlepiej 6-znakowy.</p></body></html> + + + + Check to allow grid changes from external programs + Zaznacz, aby zezwolić programom zewnętrznym na zmianę lokatora + + + + AutoGrid + AutoGrid + + + + IARU Region: + Region IARU: + + + + <html><head/><body><p>Select your IARU region.</p></body></html> + <html><head/><body><p>Wybierz swój region IARU.</p></body></html> + + + + Message generation for type 2 compound callsign holders: + Generowanie wiadomości dla posiadaczy złożonych znaków typu 2: + + + + <html><head/><body><p>Type 2 compound callsigns are those with prefixes or suffixes not included in the allowed shortlist (See Help-&gt;Add-on prefixes and suffixes).</p><p>This option determines which generated messages should contain your full type 2 compound call sign rather than your base callsign. It only applies if you have a type 2 compound callsign.</p><p>This option controls the way the messages that are used to answer CQ calls are generated. Generated messages 6 (CQ) and 5 (73) will always contain your full callsign. The JT65 and JT9 protocols allow for some standard messages with your full call at the expense of another piece of information such as the DX call or your locator.</p><p>Choosing message 1 omits the DX callsign which may be an issue when replying to CQ calls. Choosing message 3 also omits the DX callsign and many versions of this and other software will not extract the report. Choosing neither means that your full callsign only goes in your message 5 (73) so your QSO partner may log the wrong callsign.</p><p>None of these options are perfect, message 3 is usually best but be aware your QSO partner may not log the report you send them.</p></body></html> + <html><head/><body><p>Złożone znaki wywoławcze typu 2 to znaki z prefiksami lub sufiksami spoza dozwolonej krótkiej listy (zobacz Pomoc → Dodatkowe prefiksy i sufiksy).</p><p>Ta opcja określa, które generowane wiadomości mają zawierać pełny złożony znak typu 2 zamiast znaku bazowego. Ma zastosowanie tylko wtedy, gdy używasz złożonego znaku typu 2.</p><p>Opcja steruje sposobem generowania wiadomości używanych do odpowiadania na wywołania CQ. Generowane wiadomości 6 (CQ) i 5 (73) zawsze zawierają pełny znak. Protokoły JT65 i JT9 pozwalają na część standardowych wiadomości z pełnym znakiem kosztem innej informacji, np. znaku DX lub lokatora.</p><p>Wybranie wiadomości 1 pomija znak DX, co może być problemem przy odpowiadaniu na CQ. Wybranie wiadomości 3 również pomija znak DX, a wiele wersji tego i innych programów nie odczyta raportu. Niewybranie żadnej oznacza, że pełny znak pojawi się tylko w wiadomości 5 (73), więc korespondent może zapisać błędny znak.</p><p>Żadna z tych opcji nie jest idealna. Zwykle najlepsza jest wiadomość 3, ale pamiętaj, że korespondent może nie zapisać wysłanego przez Ciebie raportu.</p></body></html> + + + + Full call in Tx1 + Pełny znak w Tx1 + + + + Full call in Tx3 + Pełny znak w Tx3 + + + + Full call in Tx5 only + Pełny znak tylko w Tx5 + + + + Display + Wyświetlanie + + + + Show outgoing transmitted messages in the Rx frequency window. + Pokazuj wychodzące wiadomości TX w oknie częstotliwości RX. + + + + &Tx messages to Rx frequency window + Wiadomości &TX w oknie częstotliwości RX + + + + Show if decoded stations are new DXCC entities or worked before. + Pokazuj, czy zdekodowane stacje są nowymi podmiotami DXCC albo były już zrobione. + + + + <html><head/><body><p>Check to have decodes for a new period start at the top of the Band Activity window and not scroll off the top when the window is full.</p><p>This is to aid selecting decodes to double-click while decoding is still in progress. Use the Band Activity vertical scroll bar to reveal decodes past the bottom of the window.</p></body></html> + <html><head/><body><p>Zaznacz, aby dekodowania nowego okresu rozpoczynały się u góry okna Aktywność pasma i nie przewijały poza górną krawędź, gdy okno jest pełne.</p><p>Ułatwia to wybieranie dekodowań do dwukrotnego kliknięcia, gdy dekodowanie nadal trwa. Użyj pionowego paska przewijania okna Aktywność pasma, aby zobaczyć dekodowania znajdujące się poniżej dolnej krawędzi.</p></body></html> + + + + Start new period decodes at top + Nowy okres dekodowania zaczynaj u góry + + + + Set the font characteristics for the application. + Ustaw właściwości czcionki aplikacji. + + + + Font... + Czcionka... + + + + Set the font characteristics for the Band Activity and Rx Frequency areas. + Ustaw właściwości czcionki obszarów Aktywność pasma i Częstotliwość RX. + + + + Decoded Text Font... + Czcionka dekodowanego tekstu... + + + + Include a separator line between periods in the band activity window. + Dodaj linię oddzielającą okresy w oknie aktywności pasma. + + + + &Blank line between decoding periods + &Pusta linia między okresami dekodowania + + + + Show distance to DX station in miles rather than kilometers. + Pokazuj odległość do stacji DX w milach zamiast w kilometrach. + + + + Display dista&nce in miles + Wyświetlaj odległość w &milach + + + + Behavior + Zachowanie + + + + Decode after EME delay + Dekoduj po opóźnieniu EME + + + + <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> + <html><head/><body><p>Liczba minut, po których nienadzorowane nadawanie zostanie przerwane.</p></body></html> + + + + Disabled + Wyłączone + + + + minutes + minuty + + + + Single decode + Pojedyncze dekodowanie + + + + <html><head/><body><p>Some rigs are not able to process CAT commands while transmitting. This means that if you are operating in split mode you may have to uncheck this option.</p></body></html> + <html><head/><body><p>Niektóre radia nie potrafią przetwarzać poleceń CAT podczas nadawania. Oznacza to, że podczas pracy w trybie split może być konieczne odznaczenie tej opcji.</p></body></html> + + + + Allow Tx frequency changes while transmitting + Zezwalaj na zmiany częstotliwości TX podczas nadawania + + + + Don't start decoding until the monitor button is clicked. + Nie rozpoczynaj dekodowania, dopóki nie zostanie kliknięty przycisk Monitoruj. + + + + Mon&itor off at startup + &Monitorowanie wyłączone przy uruchomieniu + + + + <html><head/><body><p>Check this if you wish to automatically return to the last monitored frequency when monitor is enabled, leave it unchecked if you wish to have the current rig frequency maintained.</p></body></html> + <html><head/><body><p>Zaznacz, jeśli po włączeniu monitorowania program ma automatycznie wracać do ostatnio monitorowanej częstotliwości. Pozostaw niezaznaczone, jeśli ma być zachowana bieżąca częstotliwość radia.</p></body></html> + + + + Monitor returns to last used frequency + Po włączeniu monitorowania wróć do ostatniej częstotliwości + + + + Alternate F1-F6 bindings + Alternatywne przypisania F1-F6 + + + + Turns off automatic transmissions after sending a 73 or any other free +text message. + Wyłącza automatyczne nadawanie po wysłaniu 73 lub dowolnej innej wiadomości +tekstowej. + + + + Di&sable Tx after sending 73 + Wyłącz &TX po wysłaniu 73 + + + + Send a CW ID after every 73 or free text message. + Wyślij identyfikator CW po każdym 73 lub wiadomości tekstowej. + + + + CW ID a&fter 73 + Identyfikator CW &po 73 + + + + Send a CW ID periodically every few minutes. +This might be required under your countries licence regulations. +It will not interfere with other users as it is always sent in the +quiet period when decoding is done. + Wysyłaj identyfikator CW okresowo co kilka minut. +Może to być wymagane przez przepisy licencyjne w Twoim kraju. +Nie będzie przeszkadzać innym użytkownikom, ponieważ jest zawsze wysyłany +w cichym okresie, w którym odbywa się dekodowanie. + + + + Automatic transmission mode. + Tryb automatycznego nadawania. + + + + Show &DXCC, grid, and worked-before status + Pokazuj &DXCC, lokator i stan „zrobione wcześniej” + + + + Highlight DX Grid in message + Podświetl Lokator DX w wiadomości + + + + Show DXCC for all messages + Pokazuj DXCC dla wszystkich wiadomości + + + + Show the separator line between periods with time stamp of the decode period. + Pokazuj linię oddzielającą okresy wraz ze znacznikiem czasu okresu dekodowania. + + + + Show blank line with time stamp + Pokazuj pustą linię ze znacznikiem czasu + + + + Show principal prefix instead of country name + Pokazuj główny prefiks zamiast nazwy kraju + + + + Highlight DX Call in message + Podświetl Znak DX w wiadomości + + + + Doubl&e-click on call sets Tx enable + Dwukrotne &kliknięcie znaku włącza TX + + + + <html><head/><body><p>Open the Astronomical Data window automatically when switching to Q65 or JT65 mode and Decode after EME delay is enabled, and close it when no longer needed.</p><p>Open the QSYMessage Creator automatically if the VHF Features are enabled and such QSY messages are applicable.</p></body></html> + <html><head/><body><p>Automatycznie otwieraj okno Danych astronomicznych po przełączeniu na Q65 lub JT65, gdy włączono „Dekoduj po opóźnieniu EME”, i zamykaj je, gdy nie jest już potrzebne.</p><p>Automatycznie otwieraj Kreator wiadomości QSY, jeśli włączono funkcje VHF i wiadomości QSY mają zastosowanie.</p></body></html> + + + + Auto-open/close Astronomical data window + Automatycznie otwieraj/zamykaj okno Danych astronomicznych + + + + Calling CQ forces Call 1st + Wywołanie CQ wymusza „Wywołaj pierwszą” + + + + <html><head/><body><p>Tx until 73 is received when in MSK144 or Q65 mode. </p></body></html> + <html><head/><body><p>W trybie MSK144 lub Q65 nadaj do chwili odebrania 73.</p></body></html> + + + + MSK144/Q65: Tx until 73 is received + MSK144/Q65: nadaj do odebrania 73 + + + + <html><head/><body><p>Allow kHz frequency offset entry without 'k' suffix.</p></body></html> + <html><head/><body><p>Zezwalaj na wpisywanie przesunięcia częstotliwości w kHz bez sufiksu „k”.</p></body></html> + + + + kHz entry without k (restart required) + Wpis kHz bez „k” (wymagany restart) + + + + <html><head/><body><p>Disable the Tune watchdog.</p></body></html> + <html><head/><body><p>Wyłącz watchdog strojenia.</p></body></html> + + + + Tune watchdog + Limit czasu strojenia + + + + <html><head/><body><p>Number of seconds before Tune is aborted</p></body></html> + <html><head/><body><p>Liczba sekund, po których strojenie zostanie przerwane.</p></body></html> + + + + seconds + sekundy + + + + Tx watchdog: + Limit czasu TX: + + + + ID Inter&val: + &Interwał ID: + + + + <html><head/><body><p>Turn the progress bar red while transmitting.</p></body></html> + <html><head/><body><p>Podczas nadawania ustaw pasek postępu na czerwono.</p></body></html> + + + + Turn progress bar red while transmitting + Podczas nadawania zmieniaj pasek postępu na czerwony + + + + Additional features + Dodatkowe funkcje + + + + Set Rx frequency to Tx frequency after QSO + Po QSO ustaw częstotliwość RX na częstotliwość TX + + + + <html><head/><body><p>If a station sends locator, calculate and show the distance in Band Activity pane.</p></body></html> + <html><head/><body><p>Jeśli stacja wysyła lokator, oblicz i pokaż odległość w panelu Aktywność pasma.</p></body></html> + + + + Show distance in messages with grid + Pokazuj odległość w wiadomościach z lokatorem + + + + <html><head/><body><p>Erase Band Activity and Rx frequency windows after band change.</p></body></html> + <html><head/><body><p>Po zmianie pasma wyczyść okna Aktywność pasma i Częstotliwość RX.</p></body></html> + + + + Erase decodes after band change + Po zmianie pasma wyczyść dekodowania + + + + Clear DX Grid after QSO + Po QSO wyczyść Lokator DX + + + + Show U.S. States in messages with grid + Pokazuj stany USA w wiadomościach z lokatorem + + + + Map Grid locator to U.S. State + Mapuj lokator na stan USA + + + + <html><head/><body><p>Align the text for DXCC, distance and azimuth.</p></body></html> + <html><head/><body><p>Wyrównaj tekst DXCC, odległości i azymutu.</p></body></html> + + + + Align DXCC/distance/azimuth + Wyrównaj DXCC/odległość/azymut + + + + Alternate Erase button behavior + Alternatywne działanie przycisku Wyczyść + + + + Clear DX Call after QSO + Po QSO wyczyść Znak DX + + + + <html><head/><body><p>Increase or decrease the space between message text and DXCC.</p></body></html> + <html><head/><body><p>Zwiększ lub zmniejsz odstęp między tekstem wiadomości a DXCC.</p></body></html> + + + + Enable Wait features + Włącz funkcje oczekiwania + + + + <html><head/><body><p>If a station sends a valid Maidenhead locator, calculate and show the great-circle azimuth in Band Activity pane.</p></body></html> + <html><head/><body><p>Jeśli stacja wysyła poprawny lokator Maidenhead, oblicz i pokaż azymut po wielkim kole w panelu Aktywność pasma.</p></body></html> + + + + Show azimuth in messages with grid + Pokazuj azymut w wiadomościach z lokatorem + + + + <html><head/><body><p>Increase or decrease the space between DXCC and distance/azimuth.</p></body></html> + <html><head/><body><p>Zwiększ lub zmniejsz odstęp między DXCC a odległością/azymutem.</p></body></html> + + + + Less button coloring (restart required) + Mniej kolorowania przycisków (wymagany restart) + + + + &Radio + &Radio + + + + Radio interface configuration settings. + Ustawienia interfejsu radia. + + + + <html><head/><body><p>Use only VFO A for split operation (the program temporarily changes the QRG of your rig during transmission).</p></body></html> + <html><head/><body><p>Używaj tylko VFO A do pracy split (program tymczasowo zmienia QRG radia podczas nadawania).</p></body></html> + + + + <html><head/><body><p>Use VFO A+B for split operation (works with many rigs, but requires the use of both VFOs).</p></body></html> + <html><head/><body><p>Używaj VFO A+B do pracy split (działa z wieloma radiami, ale wymaga używania obu VFO).</p></body></html> + + + + <html><head/><body><p>Don't use split (not recommended).</p></body></html> + <html><head/><body><p>Nie używaj split (niezalecane).</p></body></html> + + + + Settings that control your CAT interface. + Ustawienia sterujące interfejsem CAT. + + + + CAT Control + Sterowanie CAT + + + + + Port: + Port: + + + + Serial port used for CAT control. + Port szeregowy używany do sterowania CAT. + + + + + Serial Port Parameters + Parametry portu szeregowego + + + + Baud Rate: + Prędkość transmisji: + + + + Serial port data rate which must match the setting of your radio. + Prędkość transmisji portu szeregowego; musi odpowiadać ustawieniu radia. + + + + 1200 + 1200 + + + + 2400 + 2400 + + + + 4800 + 4800 + + + + 9600 + 9600 + + + + 19200 + 19200 + + + + 38400 + 38400 + + + + 57600 + 57600 + + + + 115200 + 115200 + + + + <html><head/><body><p>Number of data bits used to communicate with your radio's CAT interface (usually eight).</p></body></html> + <html><head/><body><p>Liczba bitów danych używana do komunikacji z interfejsem CAT radia (zwykle osiem).</p></body></html> + + + + Data Bits + Bity danych + + + + D&efault + &Domyślne + + + + Se&ven + &Siedem + + + + E&ight + &Osiem + + + + <html><head/><body><p>Number of stop bits used when communicating with your radio's CAT interface</p><p>(consult you radio's manual for details).</p></body></html> + <html><head/><body><p>Liczba bitów stopu używana podczas komunikacji z interfejsem CAT radia.</p><p>Szczegóły znajdziesz w instrukcji radia.</p></body></html> + + + + Stop Bits + Bity stopu + + + + + Default + Domyślna + + + + On&e + &Jeden + + + + T&wo + &Dwa + + + + <html><head/><body><p>Flow control protocol used between this computer and your radio's CAT interface (usually &quot;None&quot; but some require &quot;Hardware&quot;).</p></body></html> + <html><head/><body><p>Protokół sterowania przepływem między komputerem a interfejsem CAT radia (zwykle „Brak”, lecz niektóre urządzenia wymagają „Sprzętowe”).</p></body></html> + + + + + Handshake + Sterowanie przepływem + + + + &None + &Brak + + + + Software flow control (very rare on CAT interfaces). + Programowe sterowanie przepływem (bardzo rzadko używane w interfejsach CAT). + + + + XON/XOFF + XON/XOFF + + + + Flow control using the RTS and CTS RS-232 control lines +not often used but some radios have it as an option and +a few, particularly some Kenwood rigs, require it). + Sterowanie przepływem przy użyciu linii RTS i CTS standardu RS-232. +Nie jest często używane, ale niektóre radia mają taką opcję, +a kilka modeli, szczególnie niektóre radia Kenwood, jej wymaga. + + + + &Hardware + &Sprzętowe + + + + Special control of CAT port control lines. + Specjalne sterowanie liniami kontrolnymi portu CAT. + + + + + Force Control Lines + Wymuś linie sterujące + + + + + High + Wysoka + + + + + Low + Niska + + + + DTR: + DTR: + + + + RTS: + RTS: + + + + How this program activates the PTT on your radio? + W jaki sposób program aktywuje PTT radia? + + + + PTT Method + Metoda PTT + + + + <html><head/><body><p>No PTT activation, instead the radio's automatic VOX is used to key the transmitter.</p><p>Use this if you have no radio interface hardware.</p></body></html> + <html><head/><body><p>Bez aktywacji PTT — do kluczowania nadajnika używany jest automatyczny VOX radia.</p><p>Użyj tej opcji, jeśli nie masz sprzętowego interfejsu radia.</p></body></html> + + + + VO&X + VO&X + + + + <html><head/><body><p>Use the RS-232 DTR control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The DTR control line of the CAT serial port may be used for this or a DTR control line on a different serial port may be used.</p></body></html> + <html><head/><body><p>Użyj linii sterującej DTR RS-232 do przełączania PTT radia; wymaga sprzętowego interfejsu tej linii.</p><p>Niektóre komercyjne interfejsy również korzystają z tej metody.</p><p>Można użyć linii DTR portu szeregowego CAT albo linii DTR innego portu szeregowego.</p></body></html> + + + + &DTR + &DTR + + + + Some radios support PTT via CAT commands, +use this option if your radio supports it and you have no +other hardware interface for PTT. + Niektóre radia obsługują PTT przez polecenia CAT. +Użyj tej opcji, jeśli radio ją obsługuje i nie masz +innego sprzętowego interfejsu PTT. + + + + C&AT + C&AT + + + + <html><head/><body><p>Use the RS-232 RTS control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The RTS control line of the CAT serial port may be used for this or a RTS control line on a different serial port may be used. Note that this option is not available on the CAT serial port when hardware flow control is used.</p></body></html> + <html><head/><body><p>Użyj linii sterującej RTS RS-232 do przełączania PTT radia; wymaga sprzętowego interfejsu tej linii.</p><p>Niektóre komercyjne interfejsy również korzystają z tej metody.</p><p>Można użyć linii RTS portu szeregowego CAT albo linii RTS innego portu szeregowego. Ta opcja nie jest dostępna na porcie szeregowym CAT, gdy używane jest sprzętowe sterowanie przepływem.</p></body></html> + + + + R&TS + R&TS + + + + <html><head/><body><p>Select the RS-232 serial port utilised for PTT control, this option is available when DTR or RTS is selected above as a transmit method.</p><p>This port can be the same one as the one used for CAT control.</p><p>For some interface types the special value CAT may be chosen, this is used for non-serial CAT interfaces that can control serial port control lines remotely (OmniRig for example).</p></body></html> + <html><head/><body><p>Wybierz port szeregowy RS-232 używany do sterowania PTT. Opcja jest dostępna, gdy powyżej wybrano DTR lub RTS jako metodę nadawania.</p><p>Może to być ten sam port, który jest używany do sterowania CAT.</p><p>Dla niektórych typów interfejsów można wybrać specjalną wartość CAT. Służy ona do nieseregowych interfejsów CAT, które potrafią zdalnie sterować liniami portu szeregowego (np. OmniRig).</p></body></html> + + + + Modulation mode selected on radio. + Tryb modulacji wybrany w radiu. + + + + Mode + Tryb + + + + <html><head/><body><p>USB is usually the correct modulation mode,</p><p>unless the radio has a special data or packet mode setting</p><p>for AFSK operation.</p></body></html> + <html><head/><body><p>USB jest zwykle właściwym trybem modulacji,</p><p>chyba że radio ma specjalne ustawienie trybu danych lub packet</p><p>do pracy AFSK.</p></body></html> + + + + US&B + US&B + + + + Don't allow the program to set the radio mode +(not recommended but use if the wrong mode +or bandwidth is selected). + Nie pozwalaj programowi ustawiać trybu radia +(niezalecane, ale przydatne, jeśli wybierany jest niewłaściwy tryb +lub szerokość pasma). + + + + + None + Brak + + + + If this is available then it is usually the correct mode for this program. + Jeśli ta opcja jest dostępna, zwykle jest właściwym trybem dla tego programu. + + + + Data/P&kt + Dane/Pac&ket + + + + Some radios can select the audio input using a CAT command, +this setting allows you to select which audio input will be used +(if it is available then generally the Rear/Data option is best). + Niektóre radia pozwalają wybrać wejście audio poleceniem CAT. +To ustawienie umożliwia wybór używanego wejścia audio +(jeśli dostępne, zwykle najlepsza jest opcja Tył/Dane). + + + + Transmit Audio Source + Źródło audio TX + + + + Rear&/Data + Tył/&Dane + + + + &Front/Mic + &Przód/Mikrofon + + + + Rig: + Radio: + + + + Poll Interval: + Interwał odpytywania: + + + + <html><head/><body><p>Interval to poll rig for status. Longer intervals will mean that changes to the rig will take longer to be detected.</p></body></html> + <html><head/><body><p>Odstęp między odpytywaniem radia o stan. Dłuższy interwał oznacza, że zmiany w radiu będą wykrywane z większym opóźnieniem.</p></body></html> + + + + s + s + + + + <html><head/><body><p>Attempt to connect to the radio with these settings.</p><p>The button will turn green if the connection is successful or red if there is a problem.</p></body></html> + <html><head/><body><p>Spróbuj połączyć się z radiem przy użyciu tych ustawień.</p><p>Przycisk zmieni kolor na zielony, jeśli połączenie się powiedzie, albo na czerwony, jeśli wystąpi problem.</p></body></html> + + + + Test CAT + Test CAT + + + + Attempt to activate the transmitter. +Click again to deactivate. Normally no power should be +output since there is no audio being generated at this time. +Check that any Tx indication on your radio and/or your +radio interface behave as expected. + Spróbuj aktywować nadajnik. +Kliknij ponownie, aby go wyłączyć. Zwykle nie powinna być +generowana żadna moc, ponieważ w tej chwili nie jest generowany sygnał audio. +Sprawdź, czy wskaźnik TX w radiu i/lub interfejsie radia +zachowuje się zgodnie z oczekiwaniami. + + + + Test PTT + Test PTT + + + + Split Operation + Praca split + + + + Fake It + Fake It + + + + Rig + Radio + + + + A&udio + &Audio + + + + Audio interface settings + Ustawienia interfejsu audio + + + + Souncard + Karta dźwiękowa + + + + Soundcard + Karta dźwiękowa + + + + Select the audio CODEC to use for transmitting. +If this is your default device for system sounds then +ensure that all system sounds are disabled otherwise +you will broadcast any systems sounds generated during +transmitting periods. + Wybierz kodek audio używany do nadawania. +Jeśli jest to domyślne urządzenie dźwięków systemowych, +upewnij się, że wszystkie dźwięki systemowe są wyłączone, inaczej +każdy dźwięk systemowy wygenerowany podczas nadawania +zostanie wyemitowany. + + + + <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> + <html><head/><body><p>Wprowadź numer portu usługi serwera UDP, do którego WSJT-X ma wysyłać aktualizacje. Wartość zero oznacza brak wysyłania aktualizacji.</p></body></html> + + + + Outgoing interfaces: + Interfejsy wychodzące: + + + + <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> + <html><head/><body><p>Podczas wysyłania aktualizacji na adres grupy multicast należy określić interfejsy sieciowe, przez które mają być wysyłane. Jeśli interfejs pętli zwrotnej obsługuje multicast, zostanie wybrany co najmniej on.</p><p>Dla większości użytkowników wystarczy interfejs pętli zwrotnej — umożliwi to współpracę kilku innych aplikacji na tym samym komputerze z WSJT-X. Jeśli aktualizacje stanu mają odbierać aplikacje działające na innych hostach, należy wybrać odpowiedni interfejs sieciowy.</p><p>W niektórych systemach Linux może być konieczne włączenie multicast na interfejsie pętli zwrotnej.</p></body></html> + + + + <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> + <html><head/><body><p>Ustawia liczbę przeskoków routera dozwolonych dla datagramów multicast. Prawie każdy powinien ustawić 1, aby ruch multicast wychodzący pozostał w lokalnej podsieci.</p></body></html> + + + + Multicast TTL: + TTL multicast: + + + + Days since last upload + Dni od ostatniego wysłania + + + + Select the audio CODEC to use for receiving. + Wybierz kodek audio używany do odbioru. + + + + &Input: + &Wejście: + + + + Select the channel to use for receiving. + Wybierz kanał używany do odbioru. + + + + + Mono + Mono + + + + + Left + Lewo + + + + + Right + Prawo + + + + + Both + Oba + + + + Select the audio channel used for transmission. +Unless you have multiple radios connected on different +channels; then you will usually want to select mono or +both here. + Wybierz kanał audio używany do nadawania. +Jeśli nie masz kilku radii podłączonych do różnych kanałów, +zwykle wybierz tutaj mono lub oba. + + + + Enable VHF and submode features + Włącz funkcje VHF i podtrybów + + + + Data bits + Bity danych + + + + Stop bits + Bity stopu + + + + + Update Hamlib + Aktualizuj Hamlib + + + + 32-bit + 32-bit + + + + <html><head/><body><p>Revert the last Hamlib update. </p><p>Note: This function is only available on Windows.</p></body></html> + <html><head/><body><p>Przywróć ostatnią aktualizację Hamlib.</p><p>Uwaga: ta funkcja jest dostępna tylko w Windows.</p></body></html> + + + + Revert Update + Cofnij aktualizację + + + + <html><head/><body><p>Download the latest libhamlib-4.dll file from https://n0nb.users.sourceforge.net/. </p><p>Note: This function is only available on Windows.</p></body></html> + <html><head/><body><p>Pobierz najnowszy plik libhamlib-4.dll z https://n0nb.users.sourceforge.net/.</p><p>Uwaga: ta funkcja jest dostępna tylko w Windows.</p></body></html> + + + + In use: + W użyciu: + + + + Backed up: + Kopia zapasowa: + + + + 64-bit + 64-bit + + + + Rig Data + Dane radia + + + + <html><head/><body><p>Stop transmitting immediately when SWR exceeds 2.5.</p></body></html> + <html><head/><body><p>Natychmiast zatrzymaj nadawanie, gdy SWR przekroczy 2,5.</p></body></html> + + + + Halt Tx when SWR > 2.5 + Zatrzymaj TX, gdy SWR > 2,5 + + + + <html><head/><body><p>Read and display transmit PWR and SWR of your rig.</p></body></html> + <html><head/><body><p>Odczytuj i wyświetlaj moc TX (PWR) oraz SWR radia.</p></body></html> + + + + Read and display PWR and SWR + Odczytuj i wyświetlaj PWR oraz SWR + + + + Ou&tput: + &Wyjście: + + + + <html><head/><body><p>Refresh audio device list.</p></body></html> + <html><head/><body><p>Odśwież listę urządzeń audio.</p></body></html> + + + + Refresh + Odśwież + + + + <html><head/><body><p>Use TCI Audio when available.</p></body></html> + <html><head/><body><p>Używaj audio TCI, gdy jest dostępne.</p></body></html> + + + + Use TCI Audio (restart required) + Używaj audio TCI (wymagany restart) + + + + <html><head/><body><p>Rx audio level</p></body></html> + <html><head/><body><p>Poziom audio RX</p></body></html> + + + + Rx + RX + + + + <html><head/><body><p>Sort audio device names alphabetically.</p></body></html> + <html><head/><body><p>Sortuj nazwy urządzeń audio alfabetycznie.</p></body></html> + + + + Sort alphabetically + Sortuj alfabetycznie + + + + <html><head/><body><p>Hide the usually unusable ALSA CARD subdevices on Linux.</p></body></html> + <html><head/><body><p>Ukryj zwykle nieużyteczne podurządzenia ALSA CARD w systemie Linux.</p></body></html> + + + + Hide ALSA CARD subdevices (Linux only) + Ukryj podurządzenia ALSA CARD (tylko Linux) + + + + + Save Directory + Katalog zapisu + + + + Loc&ation: + &Lokalizacja: + + + + Path to which .WAV files are saved. + Ścieżka, w której zapisywane są pliki .WAV. + + + + + TextLabel + Etykieta tekstowa + + + + Click to select a different save directory for .WAV files. + Kliknij, aby wybrać inny katalog zapisu plików .WAV. + + + + S&elect + &Wybierz + + + + + AzEl Directory + Katalog AzEl + + + + Location: + Lokalizacja: + + + + Select + Wybierz + + + + <html><head/><body><p>Enables additional line in azel.dat for Dpol parameter.</p></body></html> + <html><head/><body><p>Włącza dodatkowy wiersz w azel.dat dla parametru Dpol.</p></body></html> + + + + Enable extra line in azel.dat + Włącz dodatkowy wiersz w azel.dat + + + + Power Memory By Band + Pamięć mocy według pasma + + + + Remember power settings by band + Zapamiętuj ustawienia mocy według pasma + + + + Enable power memory during transmit + Włącz pamięć mocy podczas nadawania + + + + Transmit + Nadawanie + + + + Enable power memory during tuning + Włącz pamięć mocy podczas strojenia + + + + Tune + Strojenie + + + + Tx &Macros + &Makra TX + + + + Canned free text messages setup + Konfiguracja gotowych wiadomości tekstowych + + + + &Add + &Dodaj + + + + &Delete + &Usuń + + + + Drag and drop items to rearrange order +Right click for item specific actions +Click, SHIFT+Click and, CRTL+Click to select items + Przeciągnij i upuść elementy, aby zmienić ich kolejność +Kliknij prawym przyciskiem, aby wyświetlić działania dotyczące elementu +Użyj kliknięcia, SHIFT+kliknięcia i CTRL+kliknięcia, aby zaznaczać elementy + + + + Reportin&g + &Raportowanie + + + + Reporting and logging settings + Ustawienia raportowania i logowania + + + + Logging + Logowanie + + + + <html><head/><body><p>Check this option to note any Special Operating Activity in the comments field.</p></body></html> + <html><head/><body><p>Zaznacz tę opcję, aby zapisywać specjalną aktywność operatorską w polu komentarzy.</p></body></html> + + + + Special operating activity to comments + Specjalna aktywność operatorska do komentarzy + + + + The program will pop up a partially completed Log QSO dialog when you send a 73 or free text message. + Program wyświetli częściowo wypełnione okno Zapisz QSO po wysłaniu 73 lub wiadomości tekstowej. + + + + Promp&t me to log QSO + &Pytaj o zapisanie QSO + + + + <html><head/><body><p>Log 'ZZ00' as grid if the other station doesn't send you a grid.</p></body></html> + <html><head/><body><p>Zapisuj „ZZ00” jako lokator, jeśli druga stacja nie prześle lokatora.</p></body></html> + + + + Fill missing grids with 'ZZ00' + Uzupełniaj brakujące lokatory wartością „ZZ00” + + + + Op Call: + Znak operatora: + + + + Some logging programs will not accept the type of reports +saved by this program. +Check this option to save the sent and received reports in the +comments field. + Niektóre programy logujące nie akceptują rodzaju raportów +zapisywanych przez ten program. +Zaznacz tę opcję, aby zapisywać wysłane i odebrane raporty +w polu komentarzy. + + + + d&B reports to comments + Raporty d&B do komentarzy + + + + <html><head/><body><p>Some logging programs will not accept WSJT-X mode names.</p></body></html> + <html><head/><body><p>Niektóre programy logujące nie akceptują nazw trybów WSJT-X.</p></body></html> + + + + Con&vert mode to RTTY + Kon&wertuj tryb na RTTY + + + + <html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html> + <html><head/><body><p>Znak wywoławczy operatora, jeśli różni się od znaku stacji.</p></body></html> + + + + <html><head/><body><p>Check to have QSOs logged automatically, when complete.</p></body></html> + <html><head/><body><p>Zaznacz, aby po ukończeniu QSO było ono automatycznie zapisywane.</p></body></html> + + + + Network Services + Usługi sieciowe + + + + <html><head/><body><p>The program can send your station details and all decoded signals with grid squares as spots to the http://pskreporter.info web site.</p><p>This is used for reverse beacon analysis which is very useful for assessing propagation and system performance.</p></body></html> + <html><head/><body><p>Program może wysyłać dane Twojej stacji i wszystkie zdekodowane sygnały z lokatorami jako spoty do serwisu http://pskreporter.info.</p><p>Dane są używane do analizy typu reverse beacon, bardzo przydatnej do oceny propagacji i działania systemu.</p></body></html> + + + + Enable &PSK Reporter Spotting + Włącz wysyłanie spotów do &PSK Reporter + + + + <html><head/><body><p>Check this option if a reliable connection is needed</p><p>Most users do not need this, the default uses UDP which is more efficient. Only check this if you have evidence that UDP traffic from you to PSK Reporter is being lost.</p></body></html> + <html><head/><body><p>Zaznacz tę opcję, jeśli potrzebne jest niezawodne połączenie.</p><p>Większość użytkowników jej nie potrzebuje; domyślnie używany jest UDP, który jest wydajniejszy. Włącz ją tylko wtedy, gdy masz dowody, że ruch UDP od Ciebie do PSK Reporter jest gubiony.</p></body></html> + + + + Use TCP/IP connection + Używaj połączenia TCP/IP + + + + UDP Server + Serwer UDP + + + + UDP Server: + Serwer UDP: + + + + <html><head/><body><p>Optional hostname of network service to receive decodes.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the broadcasting of UDP status updates.</p></body></html> + <html><head/><body><p>Opcjonalna nazwa hosta usługi sieciowej odbierającej dekodowania.</p><p>Formaty:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">nazwa hosta</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">adres IPv4</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">adres IPv6</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">adres grupy multicast IPv4</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">adres grupy multicast IPv6</li></ul><p>Wyczyszczenie tego pola wyłączy rozgłaszanie aktualizacji stanu przez UDP.</p></body></html> + + + + UDP Server port number: + Numer portu serwera UDP: + + + + <html><head/><body><p>With this enabled WSJT-X will accept certain requests back from a UDP server that receives decode messages.</p></body></html> + <html><head/><body><p>Po włączeniu tej opcji WSJT-X będzie przyjmować określone żądania zwrotne z serwera UDP odbierającego wiadomości dekodowania.</p></body></html> + + + + Accept UDP requests + Akceptuj żądania UDP + + + + <html><head/><body><p>Indicate acceptance of an incoming UDP request. The effect of this option varies depending on the operating system and window manager, its intent is to notify the acceptance of an incoming UDP request even if this application is minimized or hidden.</p></body></html> + <html><head/><body><p>Sygnalizuj zaakceptowanie przychodzącego żądania UDP. Działanie tej opcji zależy od systemu operacyjnego i menedżera okien; jej celem jest powiadomienie o zaakceptowaniu żądania UDP nawet wtedy, gdy aplikacja jest zminimalizowana lub ukryta.</p></body></html> + + + + Notify on accepted UDP request + Powiadamiaj o zaakceptowanym żądaniu UDP + + + + <html><head/><body><p>Restore the window from minimized if an UDP request is accepted.</p></body></html> + <html><head/><body><p>Przywróć okno ze stanu zminimalizowanego po zaakceptowaniu żądania UDP.</p></body></html> + + + + Accepted UDP request restores window + Zaakceptowane żądanie UDP przywraca okno + + + + Secondary UDP Server (deprecated) + Dodatkowy serwer UDP (przestarzałe) + + + + <html><head/><body><p>When checked, WSJT-X will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html> + <html><head/><body><p>Po zaznaczeniu WSJT-X będzie rozgłaszać zalogowaną łączność w formacie ADIF do skonfigurowanej nazwy hosta i portu.</p></body></html> + + + + Enable logged contact ADIF broadcast + Włącz rozgłaszanie zalogowanych QSO w ADIF + + + + Server name or IP address: + Nazwa serwera lub adres IP: + + + + <html><head/><body><p>Optional host name of N1MM Logger+ program to receive ADIF UDP broadcasts. This is usually 'localhost' or ip address 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable broadcasting of ADIF information via UDP.</p></body></html> + <html><head/><body><p>Opcjonalna nazwa hosta programu N1MM Logger+ odbierającego rozgłoszenia UDP ADIF. Zwykle jest to „localhost” lub adres IP 127.0.0.1.</p><p>Formaty:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">nazwa hosta</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">adres IPv4</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">adres IPv6</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">adres grupy multicast IPv4</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">adres grupy multicast IPv6</li></ul><p>Wyczyszczenie tego pola wyłączy rozgłaszanie informacji ADIF przez UDP.</p></body></html> + + + + Server port number: + Numer portu serwera: + + + + <html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html> + <html><head/><body><p>Wprowadź numer portu, którego WSJT-X ma używać do rozgłaszania przez UDP informacji logu ADIF. Dla N1MM Logger+ wartość powinna wynosić 2333. Wartość zero oznacza brak rozgłaszania aktualizacji.</p></body></html> + + + + Frequencies + Częstotliwości + + + + Default frequencies and band specific station details setup + Konfiguracja domyślnych częstotliwości i danych stacji zależnych od pasma + + + + <html><head/><body><p>See &quot;Frequency Calibration&quot; in the WSJT-X User Guide for details of how to determine these parameters for your radio.</p></body></html> + <html><head/><body><p>Szczegóły wyznaczania tych parametrów dla Twojego radia znajdziesz w rozdziale „Kalibracja częstotliwości” podręcznika WSJT-X.</p></body></html> + + + + Frequency Calibration + Kalibracja częstotliwości + + + + Slope: + Nachylenie: + + + + ppm + ppm + + + + Intercept: + Wyraz wolny: + + + + Hz + Hz + + + + Working Frequencies + Częstotliwości robocze + + + + <html><head/><body><p>Right click to maintain the working frequencies list.</p></body></html> + <html><head/><body><p>Kliknij prawym przyciskiem, aby zarządzać listą częstotliwości roboczych.</p></body></html> + + + + Station Information + Informacje o stacji + + + + Items may be edited. +Right click for insert and delete options. + Elementy można edytować. +Kliknij prawym przyciskiem, aby uzyskać opcje wstawiania i usuwania. + + + + Colors + Kolory + + + + Decode Highlightling + Podświetlanie dekodowań + + + + Reset Highlighting to WSJT-X default + Przywróć domyślne podświetlanie WSJT-X + + + + Reset Highlighting to WSJT-X Improved default + Przywróć ulepszone domyślne podświetlanie WSJT-X + + + + <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> + <html><head/><body><p>Kliknij, aby ponownie przeskanować plik ADIF wsjtx_log.adi w celu odświeżenia informacji o wcześniejszych łącznościach.</p></body></html> + + + + Rescan ADIF Log + Przeskanuj ponownie log ADIF + + + + <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> + <html><head/><body><p>Naciśnij, aby przywrócić wartości domyślne i priorytety wszystkich powyższych elementów podświetlania.</p></body></html> + + + + <html><head/><body><p>Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.</p><p>Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.</p></body></html> + <html><head/><body><p>Włączaj lub wyłączaj elementy za pomocą pól wyboru. Kliknij element prawym przyciskiem, aby zmienić lub usunąć kolor tekstu, kolor tła albo przywrócić ustawienia domyślne. Przeciągaj elementy, aby zmieniać ich priorytet — wyższa pozycja na liście oznacza wyższy priorytet.</p><p>Każdy kolor tekstu lub tła może być ustawiony albo nieustawiony. Nieustawiony oznacza, że nie jest przypisany do danego typu elementu i mogą zostać zastosowane elementy o niższym priorytecie.</p></body></html> + + + + <html><head/><body><p>Check to indicate new DXCC entities, grid squares, and callsigns per mode.</p></body></html> + <html><head/><body><p>Zaznacz, aby wskazywać nowe podmioty DXCC, lokatory i znaki wywoławcze oddzielnie dla każdego trybu.</p></body></html> + + + + Highlight by Mode + Podświetlaj według trybu + + + + Include extra WAE entities + Uwzględniaj dodatkowe podmioty WAE + + + + Check to for grid highlighting to only apply to unworked grid fields + Zaznacz, aby podświetlanie lokatorów dotyczyło tylko niezrobionych pól lokatorów + + + + Only grid Fields sought + Tylko poszukiwane pola lokatorów + + + + <html><head/><body><p>Controls for Logbook of the World user lookup.</p></body></html> + <html><head/><body><p>Ustawienia sprawdzania użytkowników Logbook of the World.</p></body></html> + + + + Logbook of the World User Validation + Weryfikacja użytkownika Logbook of the World + + + + Users CSV file URL: + URL pliku CSV użytkowników: + + + + <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> + <html><head/><body><p>Adres URL pliku danych ARRL zawierającego daty i godziny ostatniego wysłania logu przez użytkowników LoTW. Dane są używane do podświetlania dekodowań stacji, o których wiadomo, że wysyłają logi do LoTW.</p></body></html> + + + + URL + URL + + + + <html><head/><body><p>Push this button to fetch the latest LotW user's upload date and time data file.</p></body></html> + <html><head/><body><p>Naciśnij ten przycisk, aby pobrać najnowszy plik z datami i godzinami ostatnich wysłań użytkowników LoTW.</p></body></html> + + + + Fetch Now + Pobierz teraz + + + + Age of last upload less than: + Wiek ostatniego wysłania mniejszy niż: + + + + <html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html> + <html><head/><body><p>Ustaw próg wieku ostatniego wysłania logu użytkownika LoTW, aby określić, czy jest uznawany za aktualnego użytkownika LoTW.</p></body></html> + + + + days + dni + + + + Advanced + Zaawansowane + + + + <html><head/><body><p>User-selectable parameters for JT65 VHF/UHF/Microwave decoding.</p></body></html> + <html><head/><body><p>Parametry dekodowania JT65 VHF/UHF/Mikrofale wybierane przez użytkownika.</p></body></html> + + + + JT65 VHF/UHF/Microwave decoding parameters + Parametry dekodowania JT65 VHF/UHF/Mikrofale + + + + Random erasure patterns: + Losowe wzorce wymazywania: + + + + <html><head/><body><p>Maximum number of erasure patterns for stochastic soft-decision Reed Solomon decoder is 10^(n/2).</p></body></html> + <html><head/><body><p>Maksymalna liczba wzorców wymazywania dla stochastycznego dekodera Reed-Solomon z miękką decyzją wynosi 10^(n/2).</p></body></html> + + + + Aggressive decoding level: + Poziom agresywnego dekodowania: + + + + <html><head/><body><p>Higher levels will increase the probability of decoding, but will also increase probability of a false decode.</p></body></html> + <html><head/><body><p>Wyższe poziomy zwiększają prawdopodobieństwo dekodowania, ale także ryzyko fałszywego dekodowania.</p></body></html> + + + + Two-pass decoding + Dekodowanie dwuprzebiegowe + + + + <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> + <html><head/><body><p>Tryb FT8 DXpedition: operator Hound wołający stację DX.</p></body></html> + + + + + Hound + Hound + + + + <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> + <html><head/><body><p>Północnoamerykańskie zawody VHF/UHF/Mikrofale i inne, w których wymianą jest 4-znakowy lokator.</p></body></html> + + + + NA VHF Contest + Zawody NA VHF + + + + <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> + <html><head/><body><p>Tryb FT8 DXpedition: operator Fox (DXpedition).</p></body></html> + + + + + Fox + Fox + + + + <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> + <html><head/><body><p>Europejskie zawody VHF+ wymagające raportu sygnału, numeru kolejnego i 6-znakowego lokatora.</p></body></html> + + + + + EU VHF Contest + Zawody EU VHF + + + + R T T Y Roundup + R T T Y Roundup + + + + RTTY Roundup exchange + Wymiana RTTY Roundup + + + + NJ + NJ + + + + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> + <html><head/><body><p>Wymiana ARRL Field Day: liczba nadajników, klasa oraz sekcja ARRL/RAC lub „DX”.</p></body></html> + + + + A R R L Field Day + A R R L Field Day + + + + ARRL Field Day + ARRL Field Day + + + + Field Day exchange + Wymiana Field Day + + + + FD Exch: + Wymiana FD: + + + + 6A SNJ + 6A SNJ + + + + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> + <html><head/><body><p>Światowe zawody emisji cyfrowych</p><p><br/></p></body></html> + + + + WW Digital Contest + WW Digital Contest + + + + WW Digi Contest + WW Digi Contest + + + + Miscellaneous + Różne + + + + Degrade S/N of .wav file: + Pogorsz S/N pliku .wav: + + + + + For offline sensitivity tests + Do testów czułości offline + + + + + dB + dB + + + + Log automatically + Loguj automatycznie + + + + <html><head/><body><p>Use 'Log automatically' only for special operating activities.</p></body></html> + <html><head/><body><p>Używaj opcji „Loguj automatycznie” tylko dla specjalnych aktywności operatorskich.</p></body></html> + + + + Contesting only + Tylko zawody + + + + <html><head/><body><p>Shorten 6-digit grid entries and log 4-digit grids instead.</p></body></html> + <html><head/><body><p>Skracaj wpisy 6-znakowych lokatorów i zapisuj zamiast nich lokatory 4-znakowe.</p></body></html> + + + + Log 4-digit grids + Loguj lokatory 4-znakowe + + + + Highlight also messages with 73 or RR73 + Podświetlaj również wiadomości z 73 lub RR73 + + + + + <html><head/><body><p>Highlight callsigns or grids with orange background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> + <html><head/><body><p>Podświetlaj znaki lub lokatory pomarańczowym kolorem tła. Znaki i/lub lokatory muszą być oddzielone przecinkiem, a po każdym znaku musi znajdować się przecinek.</p></body></html> + + + + Highlight orange: + Podświetl na pomarańczowo: + + + + + <html><head/><body><p>Highlight callsigns or grids with blue background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> + <html><head/><body><p>Podświetlaj znaki lub lokatory niebieskim kolorem tła. Znaki i/lub lokatory muszą być oddzielone przecinkiem, a po każdym znaku musi znajdować się przecinek.</p></body></html> + + + + Highlight blue: + Podświetl na niebiesko: + + + + http://lotw.arrl.org/lotw-user-activity.csv + http://lotw.arrl.org/lotw-user-activity.csv + + + + CTY File Download + Pobieranie pliku CTY + + + + CTY File Version: + Wersja pliku CTY: + + + + Download Latest CTY.dat + Pobierz najnowszy CTY.dat + + + + CALL3 File Download + Pobieranie pliku CALL3 + + + + CALL3 File Version: + Wersja pliku CALL3: + + + + Dowload latest CALL3.TXT file. + Pobierz najnowszy plik CALL3.TXT. + + + + Download CALL3.TXT for terrestrial use + Pobierz CALL3.TXT do łączności naziemnych + + + + Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. + Pobierz najnowszy plik CALL3.TXT dla EME. Ta wersja jest odpowiednia dla głębokiego wyszukiwania JT65. + + + + Download CALL3.TXT for EME + Pobierz CALL3.TXT dla EME + + + + GUI tweaks for high-resolution monitors + Dostosowanie GUI do monitorów wysokiej rozdzielczości + + + + <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> + <html><head/><body><p>Skalowanie HighDPI zapewnia większy i bardziej proporcjonalny wygląd elementów sterujących na monitorach 4K (jeśli system operacyjny to obsługuje).</p></body></html> + + + + HighDPI scaling (restart required) + Skalowanie HighDPI (wymagany restart) + + + + <html><head/><body><p>Increased height of some control elements.</p></body></html> + <html><head/><body><p>Zwiększona wysokość niektórych elementów sterujących.</p></body></html> + + + + Increased height of the tab widget (restart required) + Zwiększona wysokość kart (wymagany restart) + + + + Enable Cloudlog Features + Włącz funkcje Cloudlog + + + + API URL: + Adres URL API: + + + + API Key: + Klucz API: + + + + Station ID: + ID stacji: + + + + <html><head/><body><p>Test the Cloudlog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> + <html><head/><body><p>Przetestuj klucz API Cloudlog.</p><p>Przycisk zmieni kolor na zielony, jeśli klucz API pozwala na zapis. Zmieni kolor na pomarańczowy, jeśli klucz jest tylko do odczytu. Nieprawidłowy klucz API spowoduje kolor czerwony.</p></body></html> + + + + Test API Key + Testuj klucz API + + + + Special operating activity + Specjalna aktywność operatorska + + + + <html><head/><body><p>ARRL International Digital Contest</p></body></html> + <html><head/><body><p>ARRL International Digital Contest</p></body></html> + + + + ARRL Digi Contest + ARRL Digi Contest + + + + <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> + <html><head/><body><p>Włącz/wyłącz protokół krótkich wiadomości NCCC Sprint FT4.</p></body></html> + + + + NCCC Sprint + NCCC Sprint + + + + + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> + <html><head/><body><p>FT Roundup i podobne zawody. Wymianą jest stan USA, prowincja Kanady lub „DX”.</p></body></html> + + + + FT Roundup messages + Wiadomości FT Roundup + + + + FT RU Exch: + Wymiana FT RU: + + + + <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> + <html><head/><body><p>Zaznacz to pole, aby nadawać (Fox) lub odbierać (Hound) przebieg SuperFox.</p></body></html> + + + + SuperFox mode + Tryb SuperFox + + + + <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> + <html><head/><body><p>Pokazuj wiadomości OTP w oknie Aktywność pasma.</p></body></html> + + + + Show OTP messages + Pokazuj wiadomości OTP + + + + OTP URL: + URL OTP: + + + + <html><head/><body><p>URL used to verify OTP codes.</p></body></html> + <html><head/><body><p>Adres URL używany do weryfikacji kodów OTP.</p></body></html> + + + + https://www.9dx.cc + https://www.9dx.cc + + + + NA VHF + NA VHF + + + + <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> + <html><head/><body><p>Kliknij, aby włączyć metodę OTP weryfikacji Fox. Wymaga połączenia z Internetem.</p></body></html> + + + + OTP + OTP + + + + Key: + Klucz: + + + + <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> + <html><head/><body><p>Klucz Fox używany do generowania kodów OTP.</p></body></html> + + + + M2ZUU5CW6EVOY2HU + M2ZUU5CW6EVOY2HU + + + + Interval + Interwał + + + + <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> + <html><head/><body><p>Interwał wysyłania wiadomości OTP. Wybierz 1, aby podpisywać każdą wiadomość.</p></body></html> + + + + <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> + + <html><head/><body><p>Wywołuj CQ z własną nazwą zawodów zamiast TEST, RU lub WW (np. CQ PACC).</p></body></html> + + + + + CQ with individual contest name + CQ z własną nazwą zawodów + + + + Contest name: + Nazwa zawodów: + + + + <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> + <html><head/><body><p>Wymieniaj 4-znakowy lokator zamiast raportu sygnału. Zapewnia czułość poziomu q3 dla operatora DX. Szczególnie przydatne podczas DXpedition EME na 6 m.</p></body></html> + + + + Q65 Pileup + Q65 Pileup + + + + Receiver bandwidth: + Szerokość pasma odbiornika: + + + + Hz + Hz + + + + Tx delay: + Opóźnienie TX: + + + + Minimum delay between assertion of PTT and start of Tx audio. + Minimalne opóźnienie między załączeniem PTT a rozpoczęciem audio TX. + + + + s + s + + + + + Tone spacing + Odstęp tonów + + + + <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> + <html><head/><body><p>Generuj audio TX z dwukrotnie większym niż normalny odstępem tonów. Przeznaczone dla specjalnych nadajników LF/MF używających dzielenia przez 2 przed generowaniem RF.</p></body></html> + + + + x 2 + x 2 + + + + <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> + <html><head/><body><p>Generuj audio TX z czterokrotnie większym niż normalny odstępem tonów. Przeznaczone dla specjalnych nadajników LF/MF używających dzielenia przez 4 przed generowaniem RF.</p></body></html> + + + + x 4 + x 4 + + + + + Waterfall spectra + Widma wodospadu + + + + Low sidelobes + Niskie listki boczne + + + + Most sensitive + Największa czułość + + + + Alerts + Alarmy + + + + Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. + Kategorie alarmów powyżej linii wymagają zaznaczenia na karcie Ogólne pola „Pokazuj DXCC, lokator i stan zrobione wcześniej”. + + + + THIS FEATURE IS FOR EXPERIENCED USERS ONLY + TA FUNKCJA JEST PRZEZNACZONA TYLKO DLA DOŚWIADCZONYCH UŻYTKOWNIKÓW + + + + Ensure that you have made meaningful settings on the Colors tab, so that you see which message triggered the alert. + Upewnij się, że na karcie Kolory masz ustawienia pozwalające rozpoznać, która wiadomość wywołała alarm. + + + + Ensure that your rig is NOT connected via "Default Device". + Upewnij się, że radio NIE jest podłączone przez „Urządzenie domyślne”. + + + + Audio Alerts + Alarmy dźwiękowe + + + + + New ITU Zone on Band + Nowa strefa ITU na paśmie + + + + + New Continent + Nowy kontynent + + + + + DX Call or DX Grid in message + Znak DX lub Lokator DX w wiadomości + + + + + New Grid + Nowy lokator + + + + + New Continent on Band + Nowy kontynent na paśmie + + + + Message received + Odebrano wiadomość + + + + + New ITU Zone + Nowa strefa ITU + + + + + New CQ Zone + Nowa strefa CQ + + + + + New DXCC on Band + Nowy DXCC na paśmie + + + + My Call in message + Mój znak w wiadomości + + + + My Call + Mój znak + + + + + New CQ Zone on Band + Nowa strefa CQ na paśmie + + + + + New DXCC + Nowy DXCC + + + + + New Grid on Band + Nowy lokator na paśmie + + + + + CQ in message + CQ w wiadomości + + + + Toggle Audio Alerts on/off. Alerts will be played on "DefaultAudioDevice". DON'T ENABLE AUDIO ALERTS WHEN YOUR RIG IS CONNECTED VIA THIS SOUNDCARD !!! + Włącza lub wyłącza alarmy dźwiękowe. Alarmy będą odtwarzane na „domyślnym urządzeniu audio”. NIE WŁĄCZAJ ALARMÓW DŹWIĘKOWYCH, GDY RADIO JEST PODŁĄCZONE DO TEJ KARTY DŹWIĘKOWEJ!!! + + + + Enable Audio Alerts + Włącz alarmy dźwiękowe + + + + This requirement is fulfilled when your rig is connected via USB audio. + Wymaganie jest spełnione, gdy radio jest podłączone przez audio USB. + + + + Audio Alerts will be played on the default audio device (usually the loudspeaker of your PC). + Alarmy dźwiękowe będą odtwarzane na domyślnym urządzeniu audio (zwykle głośniku komputera). + + + + IMPORTANT NOTES + WAŻNE UWAGI + + + + Use of this feature requires that your computer is equipped with two sound cards. + Korzystanie z tej funkcji wymaga, aby komputer był wyposażony w dwie karty dźwiękowe. + + + + Filters + Filtry + + + + Territories 1-4 for the Hide checkboxes in the View menu + Terytoria 1-4 dla pól Ukryj w menu Widok + + + + Blacklist + Czarna lista + + + + Filters for the Band Activity window + Filtry okna Aktywność pasma + + + + Hide messages containing the following callsigns or keywords: + Ukryj wiadomości zawierające następujące znaki lub słowa kluczowe: + + + + Show only messages containing the following callsigns or keywords: + Pokazuj tylko wiadomości zawierające następujące znaki lub słowa kluczowe: + + + + <html><head/><body><p>Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed).</p></body></html> + <html><head/><body><p>Używaj filtrów tylko dla funkcji Oczekuj i przechwytuj, CQ: Pierwsza itd. (wszystkie wiadomości nadal będą wyświetlane).</p></body></html> + + + + Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed) + Używaj filtrów tylko dla funkcji Oczekuj i przechwytuj, CQ: Pierwsza itd. (wszystkie wiadomości nadal będą wyświetlane) + + + + Always pass messages with the following keywords: + Zawsze przepuszczaj wiadomości z następującymi słowami kluczowymi: + + + + Whitelist + Biała lista + + + + <html><head/><body><p>Apply filters only to the callsigns of the calling stations. Usually the second word of the messages is analyzed, for directional calls the third word.</p></body></html> + <html><head/><body><p>Stosuj filtry tylko do znaków wywoławczych stacji wołających. Zwykle analizowane jest drugie słowo wiadomości, a w wywołaniach kierunkowych trzecie.</p></body></html> + + + + Apply filters only to the callsigns of the calling stations + Stosuj filtry tylko do znaków stacji wołających + + + + Always Pass + Zawsze przepuszczaj + + + + <html><head/><body><p>Use “worked today and yesterday” instead of “worked today” for the 3 related Quick Filters.</p></body></html> + <html><head/><body><p>Dla 3 powiązanych szybkich filtrów używaj „zrobione dzisiaj i wczoraj” zamiast „zrobione dzisiaj”.</p></body></html> + + + + Quick Filters: Hide/Ignore/Highlight "worked today and yesterday" instead of "worked today" (UTC) + Szybkie filtry: Ukryj/Ignoruj/Podświetl „zrobione dzisiaj i wczoraj” zamiast „zrobione dzisiaj” (UTC) + + + + <html><head/><body><p>Discard (Cancel) or apply (OK) configuration changes including</p><p>resetting the radio interface and applying any soundcard changes</p></body></html> + <html><head/><body><p>Odrzuć (Anuluj) lub zastosuj (OK) zmiany konfiguracji, w tym</p><p>reset interfejsu radia i zastosowanie zmian karty dźwiękowej.</p></body></html> + + + Upload QSOs to Cloudlog or Wavelog + Wysyłaj QSO do Cloudlog lub Wavelog + + + <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> + <html><head/><body><p>Wysyłaj zapisane QSO do Cloudlog lub Wavelog.</p></body></html> + + + <html><head/><body><p>API URL for Cloudlog or Wavelog.</p></body></html> + <html><head/><body><p>Adres URL API dla Cloudlog lub Wavelog.</p></body></html> + + + <html><head/><body><p>Your API key.</p></body></html> + <html><head/><body><p>Twój klucz API.</p></body></html> + + + <html><head/><body><p>Your Station ID.</p></body></html> + <html><head/><body><p>Twoje ID stacji.</p></body></html> + + + <html><head/><body><p>Test the Cloudlog or Wavelog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> + <html><head/><body><p>Przetestuj klucz API Cloudlog lub Wavelog.</p><p>Przycisk zmieni kolor na zielony, jeśli klucz API ma uprawnienia do zapisu. Zmieni kolor na pomarańczowy, jeśli klucz API ma tylko odczyt. Jeśli klucz API jest nieprawidłowy, przycisk zmieni kolor na czerwony.</p></body></html> + + + Upload QSOs to eQSL.cc + Wysyłaj QSO do eQSL.cc + + + <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> + <html><head/><body><p>Wysyłaj zapisane QSO do eQSL.cc.</p></body></html> + + + Username: + Nazwa użytkownika: + + + Password: + Hasło: + + + <html><head/><body><p>Your username.</p></body></html> + <html><head/><body><p>Twoja nazwa użytkownika.</p></body></html> + + + <html><head/><body><p>Your logon password.</p></body></html> + <html><head/><body><p>Twoje hasło logowania.</p></body></html> + + + Voices: + Głosy: + + + IMPORTANT + WAŻNE + + + NOTES + UWAGI + + + Wanted callsigns, grids, prefixes and directional calls + Poszukiwane znaki, lokatory, prefiksy i znaki kierunkowe + + + "Wanted callsigns, grids, prefixes and directional calls" uses the entries from "Highlight orange" and "Highlight blue". + „Poszukiwane znaki, lokatory, prefiksy i znaki kierunkowe” korzystają z wpisów z „Podświetl na pomarańczowo” i „Podświetl na niebiesko”. + + + <html><head/><body><p>Wanted callsigns, grids, prefixes and directional calls. This alert category uses the entries from &quot;Highlight orange&quot; and &quot;Highlight blue&quot;.</p></body></html> + <html><head/><body><p>Poszukiwane znaki, lokatory, prefiksy i znaki kierunkowe. Ta kategoria alarmów korzysta z wpisów z „Podświetl na pomarańczowo” i „Podświetl na niebiesko”.</p></body></html> + + + not available + niedostępna + + + + main + + + Failed to create a temporary directory + Nie udało się utworzyć katalogu tymczasowego + + + + + Path: "%1" + Ścieżka: "%1" + + + + Failed to create a usable temporary directory + Nie udało się utworzyć użytecznego katalogu tymczasowego + + + + Another application may be locking the directory + Inna aplikacja może blokować katalog + + + + Failed to create data directory + Nie udało się utworzyć katalogu danych + + + + path: "%1" + ścieżka: "%1" + + + + Shared memory error + Błąd pamięci współdzielonej + + + + Unable to create shared memory segment + Nie można utworzyć segmentu pamięci współdzielonej + + + + Sub-process error + Błąd podprocesu + + + + Failed to close orphaned jt9 process + Nie udało się zamknąć osieroconego procesu jt9 + + + + wf_palette_design_dialog + + + Palette Designer + Projektant palety + + + + <html><head/><body><p>Double click a color to edit it.</p><p>Right click to insert or delete colors.</p><p>Colors at the top represent weak signals</p><p>and colors at the bottom represent strong</p><p>signals. You can have up to 256 colors.</p></body></html> + <html><head/><body><p>Kliknij dwukrotnie kolor, aby go edytować.</p><p>Kliknij prawym przyciskiem, aby wstawiać lub usuwać kolory.</p><p>Kolory u góry odpowiadają słabym sygnałom,</p><p>a kolory u dołu silnym</p><p>sygnałom. Możesz użyć maksymalnie 256 kolorów.</p></body></html> + + + \ No newline at end of file diff --git a/translations/wsjtx_ru.ts b/translations/wsjtx_ru.ts index 012736cd..887a44a4 100644 --- a/translations/wsjtx_ru.ts +++ b/translations/wsjtx_ru.ts @@ -116,18 +116,17 @@ - - + Wanted only - + Message Сообщение - + My call only @@ -135,150 +134,159 @@ Astro - - + + Doppler tracking Отслеживание Доплера - + <html><head/><body><p>One station does all Doppler shift correction, their QSO partner receives and transmits on the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>Одна станция выполняет всю коррекцию доплеровского сдвига, ее партнер по QSO принимает и передает на запрашиваемой частоте.</p><p>Если трансивер не принимает команды CAT QSY во время передачи одна коррекция применяется ко всему периоду передачи.</p></body></html> - + Full Doppler to DX Grid Полный Доплер для DX локатора - + <html><head/><body><p>Transmit takes place on sked frequency and receive frequency is corrected for own echoes. </p><p>This mode can be used for calling CQ, or when using Echo mode.</p></body></html> <html><head/><body><p>Передача происходит на частоте скеда, а частота приема корректируется с учетом собственных эхо-сигналов. </p><p>Этот режим можно использовать для CQ или при использовании режима Echo.</p></body></html> - + Own Echo Свое эхо - + <html><head/><body><p>Both stations correct for Doppler shift such that they would be heard on the moon at the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p><p>Use this option also for Echo mode.</p></body></html> <html><head/><body><p>Обе станции корректируют доплеровский сдвиг таким образом, чтобы их можно было услышать на Луне на заданной частоте.</p><p>Если трансивер не принимает команды CAT QSY во время при передаче одна коррекция применяется ко всему периоду передачи.</p><p>Используйте эту опцию также для режима эха.</p></body></html> - + Constant frequency on Moon Постоянная частота для Луны - + <html><head/><body><p>DX station announces their TX Freq, which is entered as the Sked Freq. Correction applied to RX and TX so you appear on the DX's station's own echo Freq.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>DX-станция объявляет свою частоту передачи, которая вводится как частота скеда. Корректировка применяется к RX и TX, поэтому вы появляется на собственной частоте эха станции DX.</p><p>Если трансивер не принимает команды CAT QSY во время передачи, применяется одна коррекция для всего периода передачи.</p> </тело></html> - + On DX Echo Эхо DX - + <html><head/><body><p>Tune radio manually and select this mode to put your echo on the same frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>Настройте радио вручную и выберите этот режим, чтобы ваше эхо было на той же частоте.</p><p>Если nhfycbdth не принимает команды CAT QSY при передаче одной поправки применяется на весь период передачи.</p></body></html> - + Call DX Вызов DX - + <html><head/><body><p>No Doppler shift correction is applied. This may be used when the QSO partner does full Doppler correction to your grid square.</p></body></html> <html><head/><body><p>Коррекция доплеровского сдвига не применяется. Это может быть использовано, когда партнер по QSO выполняет полную доплеровскую коррекцию вашего квадрата.</p></body></html> - + None Нет - + Sked frequency Частота скеда - - + + 0 - - Rx: - + + kHz + - - Tx: - + + Set kHz + - - <html><head/><body><p>Press and hold the CTRL key to adjust the sked frequency manually with the rig's VFO dial or enter frequency directly into the band entry field on the main window.</p></body></html> - <html><head/><body><p>Нажмите и удерживайте клавишу CTRL, чтобы отрегулировать частоту скеда вручную с помощью ручки VFO трансивера или введите частоту непосредственно в поле ввода диапазона в главном окне.</p></ тело></html> + + <html><head/><body><p>Tx shift relative to Rx sked frequency</p></body></html> + - - Echo Mode + + MHz - - Hz + + Tx Shift - - RIT - + + Rx: + + + + + Tx: + + + + <html><head/><body><p>Press and hold the CTRL key to adjust the sked frequency manually with the rig's VFO dial or enter frequency directly into the band entry field on the main window.</p></body></html> + <html><head/><body><p>Нажмите и удерживайте клавишу CTRL, чтобы отрегулировать частоту скеда вручную с помощью ручки VFO трансивера или введите частоту непосредственно в поле ввода диапазона в главном окне.</p></ тело></html> - - Dither + + Echo Mode - - Tx Shift relative to Rx Sked Freq + + Hz - - Enter large offset + + RIT - - MHz + + Enable - - Shift + + Dither - - Enable + + Ctl-Lock Sked Freq - + Astro Data Астро данные - + Astronomical Data Астрономические данные @@ -418,6 +426,166 @@ + + Cloudlog + + + + QSO could not be sent to Cloudlog. + + + + + + QSO upload was rejected by Cloudlog. + + + + + HTTP status %1. Response was not JSON. + + + + + Cloudlog returned an unexpected upload response. + + + + + Cloudlog reported upload status: %1 + + + + + HTTP status %1. + + + + + Cloudlog::impl + + + Enter a Cloudlog or Wavelog URL. + + + + + The connection check needs a base URL before it can contact the API. + + + + + Cloudlog or Wavelog authentication endpoint was not found. + + + + + Tried /api/check_auth, /index.php/api/check_auth, and /index.php/api/auth. + + + + + API key is valid but read-only. + + + + + Generate a read/write API key before enabling QSO uploads. + + + + + API key is invalid. + + + + + Authentication response was not usable. + + + + + Station profile response was not JSON. + + + + + Configured station profile was not found. + + + + + No station profiles were returned by the server. + + + + + Available station profiles: %1 + + + + + Wavelog dry-run QSO endpoint was not found. + + + + + Tried /api/qso/true and /index.php/api/qso/true after Wavelog was identified. + + + + + Dry-run upload response was not usable. + + + + + + Connection check passed. + + + + + Writable API key, station profile, and dry-run QSO upload were validated. + + + + + Dry-run QSO upload was rejected. + + + + + + The QSO dry-run upload was rejected. + + + + + Dry-run QSO upload returned an unexpected response. + + + + + Writable API key and station profile were validated. No safe dry-run QSO endpoint was identified, so no test QSO was uploaded. + + + + + Network error while checking Cloudlog or Wavelog. + + + + + Cloudlog Error! + + + + + Reason: %1 + + + ColorHighlighting @@ -524,358 +692,581 @@ Configuration::impl - - - + + + &Delete Удалить - - + + &Insert ... Вставить ... - - Failed to create save directory - Ошибка создания папки для сохранения + + Wanted territory %1 + - - path: "%1% - путь: "%1% + + Blacklist keyword %1 + - - Failed to create samples directory - Не удалось создать папку примеров + + Whitelist keyword %1 + - - path: "%1" - путь: "%1" + + Always pass keyword %1 + - - API key OK + + CAT control port - - API key read-only + + CAT baud rate - - API key invalid + + Default CAT data bits - - &Load ... - Загрузить ... + + Seven CAT data bits + - - &Save as ... - Сохранить как ... + + Eight CAT data bits + - - &Merge ... - Обьединить ... + + Default CAT stop bits + - - &Reset - Сброс + + One CAT stop bit + - - Serial Port: - COM порт: + + Two CAT stop bits + - - Serial port used for CAT control - Com порт для управления CAT + + Default CAT handshake + - - TCI Server: + + No CAT handshake - - Optional hostname and port of TCI service. -Leave blank for a sensible default on this machine. -Formats: - hostname:port - IPv4-address:port - [IPv6-address]:port + + XON/XOFF CAT handshake - - Network Server: - Сетевой сервер: + + Hardware CAT handshake + - - Optional hostname and port of network service. -Leave blank for a sensible default on this machine. -Formats: - hostname:port - IPv4-address:port - [IPv6-address]:port - Опционально имя хоста и номер порта сервера. -Можно оставить поля пустыми чтобы использовать значения по умолчанию на этом компьютере. -Поддерживаемый формат: - имя_хоста:порт - IPv4-адрес:порт - [IPv6-адрес]:порт + + Force DTR control line + - - USB Device: - USB устройство: + + Force RTS control line + - - Optional device identification. -Leave blank for a sensible default for the rig. -Format: - [VID[:PID[:VENDOR[:PRODUCT]]]] - Опциональная идентификация устройства. -Оставьте пустым для использования значения по умолчанию для трансивера. -Формат: - [VID[:PID[:VENDOR[:PRODUCT]]]] + + VOX PTT method + - - - Invalid audio input device - Некорректный выбор звуковой карты для входа + + DTR PTT method + - - Invalid audio output device - Некорректный выбор звуковой карты для выхода + + CAT PTT method + - - Invalid PTT method - Некорректный метод PTT + + RTS PTT method + - - Invalid PTT port - Некорректный PTT порт + + PTT control port + - - - Invalid Contest Exchange - Некорректный контрольный номер + + Rear or data transmit audio source + - - You must input a valid ARRL Field Day exchange - Вы должны проводить обмен в соответствии с ARRL Field Day + + Front or mic transmit audio source + - - You must input a valid ARRL RTTY Roundup exchange - + + No radio mode control + - - Pending DNS lookup, please try again later - Ожидается поиск DNS. Повторите попытку позже. + + USB radio mode + - - - Reset Decode Highlighting - Сбросить подсветку декодирования + + Data or packet radio mode + - - - Reset all decode highlighting and priorities to default values - Сбросить всю подсветку и приоритеты декодирования на значения по умолчанию + + No split operation + - - Error Loading CTY.DAT + + Rig split operation - - Error Loading CALL3.TXT file + + Fake It split operation - - WSJT-X Decoded Text Font Chooser - Выбор шрифта декодированного текста WSJT-X + + CAT poll interval + - - - Hamlib update only available on Windows. + + Frequency calibration slope - - Error Loading libhamlib-4.dll + + Frequency calibration intercept - - Hamlib Update successful - -New Hamlib will be used after restart + + Working frequencies table - - Hamlib successfully reverted - -Reverted Hamlib will be used after restart + + Station information table - - No Hamlib update found that could be reverted + + Decode highlighting rules - - Error in network address + + Highlighting rules and priorities for decoded messages. - - UDP server DNS lookup failed - Ошибка DNS-запроса UDP-сервера + + Decode highlighting actions + - - MAC-ambiguous multicast groups addresses not supported - Адреса групп многоадресной рассылки с неоднозначным MAC-адресом не поддерживаются + + Change or reset colors for the selected highlighting rule. + - - Load Working Frequencies - Загрузить рабочие частоты + + Move selected highlighting rule up + - - - - Frequency files (*.qrg *.qrg.json);;All files (*.*) + + Move the selected highlighting rule earlier in priority order. - Frequency files (*.qrg);;All files (*.*) - Файл частот (*.qrg);;All files (*.*) + + Move selected highlighting rule down + - - Replace Working Frequencies - Заменить рабочие частоты + + Move the selected highlighting rule later in priority order. + - - Are you sure you want to discard your current working frequencies and replace them with the loaded ones? - Вы уверены, что хотите сбросить текущие рабочие частоты и заменить их загруженными? + + Orange highlight callsigns and grids + - - Merge Working Frequencies - Обьединить рабочие частоты + + Blue highlight callsigns and grids + - - Error reading frequency file + + Failed to create save directory + Ошибка создания папки для сохранения + + + + path: "%1% + путь: "%1% + + + + Failed to create samples directory + Не удалось создать папку примеров + + + + path: "%1" + путь: "%1" + + + + Reset all decode highlighting and priorities to Default 1 values + + + + + Reset all decode highlighting and priorities to Default 2 values + + + + + &Load ... + Загрузить ... + + + + &Save as ... + Сохранить как ... + + + + &Merge ... + Обьединить ... + + + + &Reset + Сброс + + + + Serial Port: + COM порт: + + + + Serial port used for CAT control + Com порт для управления CAT + + + + TCI Server: + + + + + Optional hostname and port of TCI service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port + + + + + Network Server: + Сетевой сервер: + + + + Optional hostname and port of network service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port + Опционально имя хоста и номер порта сервера. +Можно оставить поля пустыми чтобы использовать значения по умолчанию на этом компьютере. +Поддерживаемый формат: + имя_хоста:порт + IPv4-адрес:порт + [IPv6-адрес]:порт + + + + USB Device: + USB устройство: + + + + Optional device identification. +Leave blank for a sensible default for the rig. +Format: + [VID[:PID[:VENDOR[:PRODUCT]]]] + Опциональная идентификация устройства. +Оставьте пустым для использования значения по умолчанию для трансивера. +Формат: + [VID[:PID[:VENDOR[:PRODUCT]]]] + + + + + Invalid audio input device + Некорректный выбор звуковой карты для входа + + + + Invalid audio output device + Некорректный выбор звуковой карты для выхода + + + + Invalid PTT method + Некорректный метод PTT + + + + Invalid PTT port + Некорректный PTT порт + + + + + Invalid Contest Exchange + Некорректный контрольный номер + + + + You must input a valid ARRL Field Day exchange + Вы должны проводить обмен в соответствии с ARRL Field Day + + + + You must input a valid ARRL RTTY Roundup exchange + + + + + Pending DNS lookup, please try again later + Ожидается поиск DNS. Повторите попытку позже. + + + + + Reset Decode Highlighting + Сбросить подсветку декодирования + + + Reset all decode highlighting and priorities to default values + Сбросить всю подсветку и приоритеты декодирования на значения по умолчанию + + + + Error Loading CTY.DAT + + + + + Error Loading CALL3.TXT file + + + + + WSJT-X Decoded Text Font Chooser + Выбор шрифта декодированного текста WSJT-X + + + + + Hamlib update only available on Windows. + + + + + Error Loading libhamlib-4.dll + + + + + Hamlib Update successful + +New Hamlib will be used after restart + + + + + Hamlib successfully reverted + +Reverted Hamlib will be used after restart + + + + + No Hamlib update found that could be reverted + + + + + Error in network address + + + + + UDP server DNS lookup failed + Ошибка DNS-запроса UDP-сервера + + + + MAC-ambiguous multicast groups addresses not supported + Адреса групп многоадресной рассылки с неоднозначным MAC-адресом не поддерживаются + + + + Load Working Frequencies + Загрузить рабочие частоты + + + + + + Frequency files (*.qrg *.qrg.json);;All files (*.*) + + + + Frequency files (*.qrg);;All files (*.*) + Файл частот (*.qrg);;All files (*.*) + + + + Replace Working Frequencies + Заменить рабочие частоты + + + + Are you sure you want to discard your current working frequencies and replace them with the loaded ones? + Вы уверены, что хотите сбросить текущие рабочие частоты и заменить их загруженными? + + + + Merge Working Frequencies + Обьединить рабочие частоты + + + + Error reading frequency file - - - + + + Not a valid frequencies file Некорректный файл частот - + Incorrect file magic Неправильный формат файла - + Version is too new Версия в отработке - + Contents corrupt Контент обрезан - + Save Working Frequencies Сохранить рабочие частоты - + Only Save Selected Working Frequencies Сохранить только выбранные рабочие частоты - + Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. Вы уверены, что хотите сохранить только рабочие частоты, которые выбраны в данный момент? Нажмите Нет, чтобы сохранить все. - + Reset Working Frequencies Сброс рабочих частот - + Are you sure you want to discard your current working frequencies and replace them with default ones? Вы уверены, что хотите сбросить текущие рабочие частоты и заменить их значениями по умолчанию? - + Save Directory Сохранить папку - + AzEl Directory Папка AzEl - + Rig control error Ошибка управления трансивером - + Failed to open connection to rig Ошибка подключения к трансиверу - + Rig failure Трансивер не отвечает - + Not found audio device missing отсутствует аудиоустройство @@ -983,32 +1374,32 @@ or contact DXLab support at DXLab@groups.io. Цвет переднего плана... - + Choose %1 Foreground Color Выберите %1 цвет переднего плана - + &Unset foreground color Отменить основной цвет - + &Background color ... Фоновый цвет ... - + Choose %1 Background Color Выберите %1 фоновый цвет - + U&nset background color Отмена фонового цвета - + &Reset this item to defaults Сбросить значения по умолчанию @@ -1096,17 +1487,17 @@ or contact DXLab support at DXLab@groups.io. Пользователь LotW - + f/g unset - + b/g unset - + Highlight Type Тип выделения @@ -1114,41 +1505,56 @@ or contact DXLab support at DXLab@groups.io. Designer - + &Delete Удалить - + &Insert ... Вставить ... - + Insert &after ... Вставить после... - + Import Palette Импорт палитры - - + + Palettes (*.pal) Палитра (*.pal) + Import Palette Failed + + + + Export Palette Экспорт палитры + + + Export Palette Failed + + + + + Error writing waterfall palette file "%1": %2. + Ошибка записи файла палитры водопада "%1": %2. + Dialog - + Gray time: @@ -1251,16 +1657,31 @@ Error: %2 - %3 DisplayText - + &Erase Очистить + + + Return to live activity + + + + + Return to the live activity position + + + + + Live activity is paused while earlier entries are visible. + + EchoGraph - + Echo Graph Эхо-график @@ -1335,7 +1756,7 @@ Error: %2 - %3 EmulateSplitTransceiver - + Emulated split mode requires rig to be in simplex mode Эмуляция режима split требует, чтобы трансивер был в симплексном режиме. @@ -1422,12 +1843,12 @@ Error: %2 - %3 ExistingNameDialog - + Configuration to Clone From Конфигурация для клонирования - + &Source Configuration Name: Имя исходной конфигурации: @@ -1565,7 +1986,7 @@ Error: %2 - %3 FastGraph - + Fast Graph Быстрый график @@ -1620,48 +2041,199 @@ Error: %2 - %3 - FoxLog::impl + FixtureAudioInput - - Date & Time(UTC) - + + Synthetic audio input has no detector sink. + - - Call - + + Synthetic FT8 audio input requires a downsample factor of 1 or 4. + - - Grid - + + Synthetic JTTY audio input requires a downsample factor of 1 or 4. + - - Sent - + + Synthetic audio input requires the mono input channel. + - - Rcvd - + + Unable to open synthetic audio fixture %1: %2 + - - Band - + + Synthetic audio fixture must be mono, signed 16-bit little-endian PCM. + - - - FoxLogWindow - - Fox Log - Fox лог + + Synthetic audio fixture must be %1 Hz for downsample factor %2; found %3 Hz. + - - <html><head/><body><p>Right-click here for available actions.</p></body></html> + + Synthetic FT8 audio fixture must contain exactly %1 frames; found %2. + + + + + Synthetic JTTY audio fixture must contain complete PCM frames. + + + + + Unable to read all PCM data from synthetic audio fixture. + + + + + Synthetic audio input does not yet support big-endian hosts. + + + + + Unable to initialize the detector for synthetic audio input. + + + + + Synthetic audio fixture ready + + + + + Synthetic audio input suspended + + + + + Synthetic audio input receiving + + + + + Detector accepted %1 of %2 synthetic PCM bytes. + + + + + Synthetic audio fixture exhausted + + + + + FixtureSoundOutput + + + Synthetic audio output requires a readable source. + + + + + Synthetic audio output requires a capture path. + + + + + Synthetic audio output does not yet support big-endian hosts. + + + + + Synthetic audio output received an unsupported source frame size. + + + + + Unable to open synthetic audio output capture %1: %2 + + + + + Synthetic audio output received a partial captured frame. + + + + + Synthetic FT8 audio output exceeded its 15-second capture period. + + + + + Synthetic audio output wrote %1 of %2 capture bytes: %3 + + + + + Synthetic audio output source disappeared during capture. + + + + + Synthetic FT8 audio output continued beyond its 15-second capture period. + + + + + Synthetic audio output received %1 of %2 source bytes. + + + + + Synthetic audio output received an invalid source byte count. + + + + + FoxLog::impl + + + Date & Time(UTC) + + + + + Call + + + + + Grid + + + + + Sent + + + + + Rcvd + + + + + Band + + + + + FoxLogWindow + + + Fox Log + Fox лог + + + + <html><head/><body><p>Right-click here for available actions.</p></body></html> <html><head/><body><p>Нажмите здесь правой кнопкой мыши, чтобы просмотреть доступные действия.</p></body></html> @@ -1732,69 +2304,101 @@ Error: %2 - %3 Вы уверены, что хотите удалиить файл FoxQSO.txt и начать новый лог Fox? + + FrequencyDeltaLineEdit + + + Offset in MHz + + + + + Frequency offset in MHz + + + + + Enter a frequency offset in MHz. + + + FrequencyDialog - + Add Frequency Добавить частоту - + IARU &Region: IARU регион - + &Mode: Вид - + &Frequency (MHz): Частота (МГц) - + &Preferred for Band/Mode: - + &Description: - + &Enable Date Range: - + S&tart: - + &End: - + &Source: - + Invalid Date Range - + Start date must be before end date + + FrequencyLineEdit + + + + Frequency in MHz + + + + + Enter a positive frequency in MHz. + + + FrequencyList_v2 @@ -1818,37 +2422,37 @@ Error: %2 - %3 FrequencyList_v2_101 - + IARU Region IARU регион - + Mode - + Frequency Частота - + Frequency (MHz) Частота (МГц) - + Description - + Source @@ -1864,127 +2468,239 @@ Error: %2 - %3 - + Pref - + Start Date/Time - + End Date/Time - + Failed to parse JSON file - + Information Missing - + No Frequencies were found - + Loaded Frequencies from %1 - + Entries Valid/Skipped %1 + + Ft8TxLoopbackTestController + + + Timed out after 60 seconds. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + The FT8 output stream did not start exactly once. + + + + + The FT8 Auto control was not found. + + + + + Disabling Auto stopped the active FT8 transmission. + + + + + Synthetic output reported non-silent FT8 audio more than once. + + + + + The FT8 capture did not stop exactly once at the requested path. + + + + + Synthetic audio output failed: %1 + + + + + A required FT8 transmit GUI control was not found. + + + + + The application did not enter FT8 mode. + + + + + Unable to configure the requested FT8 transmission. + + + + + The FT8 transmit controls disappeared before transmission. + + + + + Unable to start the synthetic FT8 transmission. + + + + + The FT8 Auto control disappeared before retry. + + + + + The FT8 output lifecycle was not one start, non-silent transmission, and natural stop. + + + + + FT8 audio began at frame %1; expected %2 +/- %3 frames. + + + + + The FT8 capture file was not created or is empty: %1 + + + + + Unable to reopen FT8 capture %1: %2 + + + + + The FT8 capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The FT8 capture must contain exactly %1 frames; file=%2 reported=%3. + + + + + Unexpected modal window: %1 + + + HRDTransceiver - - + + Failed to connect to Ham Radio Deluxe Не удалось подключиться к Ham Radio Deluxe - + Failed to open file "%1": %2. Не удалось открыть файл "%1": %2. - - + + Ham Radio Deluxe: no rig found Ham Radio Deluxe: трансивер не обнаружен - + Ham Radio Deluxe: rig doesn't support mode Ham Radio Deluxe: трансивер не поддерживает't режим - + Ham Radio Deluxe: sent an unrecognised mode Ham Radio Deluxe: отправил неизвестный режим - + Ham Radio Deluxe: item not found in %1 dropdown list Ham Radio Deluxe: элемент не найден в выпадающем списке %1 - + Ham Radio Deluxe: button not available Ham Radio Deluxe: кнопка недоступна - + Ham Radio Deluxe didn't respond as expected Ham Radio Deluxe некорректно ответил - + Ham Radio Deluxe: rig has disappeared or changed Ham Radio Deluxe: трансивер выключен или изменился - + Ham Radio Deluxe send command "%1" failed %2 Ham Radio Deluxe отправить команду "%1" не удалось %2 - - + + Ham Radio Deluxe: failed to write command "%1" Ham Radio Deluxe: не удалось записать команду "%1" - + + Ham Radio Deluxe sent an invalid reply to our command "%1": %2 + + + Ham Radio Deluxe sent an invalid reply to our command "%1" - Ham Radio Deluxe отправил неверный ответ на команду "%1" + Ham Radio Deluxe отправил неверный ответ на команду "%1" - + Ham Radio Deluxe failed to reply to command "%1" %2 Ham Radio Deluxe не ответил на команду "%1" %2 - + Ham Radio Deluxe retries exhausted sending command "%1" Ham Radio Deluxe повторяет выданную команду "%1" - + Ham Radio Deluxe didn't respond to command "%1" as expected Ham Radio Deluxe не отвечает на команду "%1" как и ожидалось @@ -1992,187 +2708,183 @@ Error: %2 - %3 HamlibTransceiver - - + + Hamlib initialisation error Ошибка инициализации Hamlib - + Hamlib settings file error: %1 at character offset %2 Ошибка файла настроек Hamlib : %1 со смещением символа %2 - + Hamlib settings file error: top level must be a JSON object Ошибка файла настроек Hamlib: верхний уровень должен быть объектом JSON - + Hamlib settings file error: config must be a JSON object Ошибка файла настроек Hamlib: config должен быть объектом JSON - + Unsupported CAT type Не поддердерживаемый тип CAT - + Hamlib error: %1 while %2 Ошибка Hamlib %1 while %2 - + opening connection to rig текущее соединение с трансивером - + getting current frequency получение текущей частоты - + getting current mode получение текущего режима - - + + exchanging VFOs обмен VFOs - - + + getting other VFO frequency получение частоты другого VFO - + getting other VFO mode Получение режима другого VFO - - + + setting current VFO установка текущего VFO - + getting frequency получение частоты - + getting mode получение режима - - - + + + getting current VFO выбор текущего VFO - - - - + + + + getting current VFO frequency получение частоты текущего VFO - - - - - - + + + + + + setting frequency установка частоты - - - - + + + + getting current VFO mode получение режима текущего VFO - - - - - + + + + + setting current VFO mode установка тежима текущего VFO - - setting VFOB mode - - - - - + + setting/unsetting split mode установить/снять режим split - - + + setting split mode установить режим split - + setting split TX frequency and mode установка split для частоты и режима TX - + setting split TX frequency установка split для частоты TX - + getting split TX VFO mode получение режима split TX VFO - + setting split TX VFO mode установка режима split TX VFO - + getting PTT state получение статуса PTT - + setting PTT on активирование PTT - - + + setting PTT off деактивация PTT - + setting a configuration item настройка элементов конфигурации - + + getting a configuration item считывание элементов конфигурации @@ -2207,47 +2919,363 @@ Error: %2 - %3 - LogQSO + JttyTxLoopbackTestController - - Click OK to confirm the following QSO: - Нажмите OK, чтобы подтвердить следующее QSO: + + Timed out after 60 seconds. + - - Call - Позывной + + JTTY request %1 was accepted more than once. + - - Start - Начало + + JTTY request %1 was rejected with reason %2. + - - - dd/MM/yyyy HH:mm:ss - + + JTTY request %1 completed more than once. + - - End - Окончание + + More than one JTTY transmit session drained. + - - Mode - Вид + + Synthetic output opened the wrong capture path: %1 + - - Band - Диапазон + + JTTY output stream restarted more than once. + - - Rpt Sent - + + Synthetic output reported non-silent playback more than once. + + + + + Synthetic output stopped the wrong capture path: %1 + + + + + JTTY output stream stopped more than once. + + + + + Synthetic audio output failed: %1 + + + + + The JTTY mode action was not found. + + + + + The application did not enter JTTY mode. + + + + + The JTTY encoder did not produce a valid test waveform extent. + + + + + The first JTTY text request was not accepted synchronously. + + + + + Non-silent playback began before the first request was accepted. + + + + + The output stream restarted or stopped before the gapless append. + + + + + The gapless append occurred before one second of real playback. + + + + + The second JTTY text request was not accepted during playback. + + + + + Appending the second JTTY message restarted or stopped playback. + + + + + The accepted-request set did not contain exactly both submitted messages. + + + + + JTTY text requests were not accepted in submission order. + + + + + The completed-request set did not contain exactly both submitted messages. + + + + + JTTY text requests did not complete in FIFO order. + + + + + The output stream lifecycle was not one start, one drain, and one stop. + + + + + The captured JTTY session contains an unexpected internal audio gap. + + + + + The JTTY capture file was not created or is empty: %1 + + + + + Unable to reopen JTTY capture %1: %2 + + + + + The JTTY capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The JTTY capture has an invalid PCM extent: file frames=%1, expected audio frames=%2, reported frames=%3. + + + + + Unexpected modal window: %1 + + + + + LiveAudioTestController + + + Timed out after 110 seconds. + + + + + Timed out after 100 seconds. + + + + + Decoder backend failed: %1 + + + + + JTTY display did not settle to the expected text after input ended. + + + + + Synthetic audio source failed: %1 + + + + + Unable to open expected decode file %1: %2 + + + + + Expected decode file %1 contains no messages. + + + + + Unable to open expected JTTY text file %1: %2 + + + + + Expected JTTY text file %1 contains no messages. + + + + + A required FT8 decoder or monitoring GUI control was not found. + + + + + Unable to configure the %1-%2 Hz waterfall decode range. + + + + + Unable to prepare the complete FT8 fixture decode. + + + + + Unable to configure the FT8 multithreaded decoder as requested. + + + + + Monitor did not enter the active state. + + + + + Synthetic input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic audio source. + + + + + A required JTTY mode, monitoring, or decode display control was not found. + + + + + The JTTY GUI action did not select JTTY mode. + + + + + Monitor did not enter the active state for JTTY. + + + + + Synthetic JTTY input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic JTTY audio source. + + + + + The expected early standard and final configured MTD decoder invocations were not both observed. + + + + + The configured MTD invocation produced no decoder output. + + + + + live MTD missing: %1 + + + + + processed missing: %1 + + + + + display missing: %1 + + + + + Reference-message validation failed: %1; live MTD output: %2; processed output: %3 + + + + + Decoder messages were processed but none reached the GUI display path. + + + + + The expected JTTY messages did not reach both panes in FIFO order. + + + + + The expected JTTY message reached both panes without an observed growing prefix. + + + + + Unexpected modal window: %1 + + + + + LogQSO + + + Click OK to confirm the following QSO: + Нажмите OK, чтобы подтвердить следующее QSO: + + + + Call + Позывной + + + + Start + Начало + + + + + dd/MM/yyyy HH:mm:ss + + + + + End + Окончание + + + + Mode + Вид + + + + Band + Диапазон + + + + Rpt Sent + @@ -2325,188 +3353,188 @@ Error: %2 - %3 - + Aircraft scatter Рассеивание самолетом - + Aurora-E Аврора Е - + Aurora Аврора - + Back scatter Обратное рассеивание - + Echolink Эхолинк - + Earth-moon-earth Земля-Луна-Земля - + Sporadic E Спорадик Е - + F2 Reflection F2 Отражение - + Field aligned irregularities выравнивание по полю - + Internet-assisted с помощью Интернета - + Ionoscatter ионорасферное рассеяние - + IRLP - + Meteor scatter Разброс метеоров - + Non-satellite repeater or transponder Неспутниковый ретранслятор или транспондер - + Rain scatter Рассеяние дождя - + Tropospheric ducting - + A - + B - + BS - + JA - + JD - + K - + KA - + KT - + L - + LS - + LU - + LX - + S - + SX - + T - + US - + UV - + VS - + VU - + Satellite Спутник - + Trans-equatorial Транс-экваториальный @@ -2515,34 +3543,34 @@ Error: %2 - %3 Тропосферный воздуховод - - + + Invalid QSO Data Неверные данные QSO - + Check exchange sent and received Проверка отправленного и полученного обмена - + Check all fields Проверить все поля - + Log file error - + Cannot open "%1" for append Не удается открыть "%1" для добавления - + Error: %1 Ошибка: %1 @@ -2593,62 +3621,57 @@ Error(%2): %3 MainWindow - - WSJT-X by K1JT - - - - - - - - - - - - + + + + + + + + + Band Activity Декодирование в полосе обзора - - + + UTC dB DT Freq Dr - - - - - - - + + + + + + + Rx Frequency Декодировавние на частоте RX - + CQ only Только CQ - + Enter this QSO in log QSO в лог - + Log &QSO QSO в лог - + Stop monitoring Останов декодирования - + &Stop Стоп @@ -2657,79 +3680,79 @@ Error(%2): %3 Вкючение/Выключение декодирования - + &Monitor Монитор - + <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> <html><head/><body><p>Очистка правого окна.Двойной клик очистка правого и левого окна.</p></body></html> - + Erase right window. Double-click to erase both windows. Очистка правого окна.Двойной клик очистка правого и левого окна - + &Erase Очистка - + <html><head/><body><p>Clear the accumulating message average.</p></body></html> Очистка накопленного среднего числа сообщений <html><head/><body><p>Очистка накопленного среднего числа сообщений.</p></body></html> - + Clear the accumulating message average. Очистка накопленного среднего числа сообщений - + Clear Avg Очистить AVG - + <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> Повторно декодирует последний RX период или последний воспроизводимый звуковой файл (wav). <html><head/><body><p>Декодировать последний период на частоте QSO.</p></body></html> - + Decode most recent Rx period at QSO Frequency Декодировать последний период на частоте QSO. - + &Decode Декод. - + <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> Включить/Отключить разрешение на автопередачу - + Toggle Auto-Tx On/Off Включить/Отключить разрешение на автопередачу - + E&nable Tx Разреш. TX - + Stop transmitting immediately Немедленный останов TX - + &Halt Tx Стоп TX @@ -2739,194 +3762,282 @@ Error(%2): %3 <html><head/><body><p>Вкл/Выкл передачи тона для Настройки</p></body></html> - + Toggle a pure Tx tone On/Off Вкл/Выкл передачи тона для Настройки - + &Tune &Настройка - + + Menus Меню - + Decode other Hounds calling above 1000 Hz audio offset Декодировать другие гончие, вызывающие по звуку выше 1000 Гц - + Enable auto response to the first decode from a new DXCC or new call on the current band. Разрешить автоматический ответ на первое декодирование от нового DXCC или нового вызова на текущем диапазоне. - + F High - + F Low - + + WSJT-X by K1JT et al. + + + + + Band Activity decode pane title + + + + + Title for the Band Activity decoded messages pane. + + + + + Band Activity decoded messages headings + + + + + + Columns: UTC dB DT Freq Message. + + + + + Band Activity decoded messages + + + + + Decoded messages in the Band Activity pane. Columns: UTC dB DT Freq Message. + + + + + Rx Frequency decode pane title + + + + + Title for the Rx Frequency decoded messages pane. + + + + + Rx Frequency decoded messages headings + + + + + Rx Frequency decoded messages + + + + + Decoded messages in the Rx Frequency pane. Columns: UTC dB DT Freq Message. + + + + + Check to display received messages in lower case. + + + + + Lower case + + + + + Include Time + + + + + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the strongest station's reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the weakest station's reply to your CQ.</p><p>When CQ or QRZ is pending, Enable Tx may be armed before or during a receive period. Only eligible direct callers decoded after it is armed in that period can replace the pending transmission; earlier callers are not retained.</p></body></html> + + + + 1/2 - + 2/2 - + 1/3 - + 2/3 - + 3/3 - + 1/4 - + 2/4 - + 3/4 - + 4/4 - + 1/5 - + 2/5 - + 3/5 - + 4/5 - + 5/5 - + 1/6 - + 2/6 - + 3/6 - + 4/6 - + 5/6 - + 6/6 - + Percentage of minute sequences devoted to transmitting. Процент минутных интервалов, посвященных передаче. - + Prefer Type 1 messages Выбор сообщения типа 1 - + <html><head/><body><p>Transmit during the next sequence.</p></body></html> <html><head/><body><p>Передать во время следующего интервала .</p></body></html> - - + + Q65 - + + Alt+X + + + + SWL Mode - + Hide lower panel controls to maximize deocde windows Скрыть элементы управления нижней панели, чтобы максимизировать окно декодирования. - + + USB dial frequency Отображение частоты трансивера в режиме USB - + 14.078 000 - + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> <html><head/><body><p> рекомендуется 30 дБ, если присутствует только шум<br/>Зеленый, если все хорошо<br/>Красный, если может возникнуть перегрузка <br/>Желтый, если слишком низкий уровень</p></body ></html> - + Rx Signal - + 30dB recommended when only noise present Green when good Red when clipping may occur @@ -2937,17 +4048,17 @@ Yellow when too low Желтый, когда слишком низкий - + DX Call Позывной DX - + DX Grid QTH Локатор - + Callsign of station to be worked Позывной корреспондента @@ -2956,17 +4067,17 @@ Yellow when too low Поиск позывного в базе данных - + &Lookup Поиск - + Locator of station to be worked QTH локатор корреспондента - + Az: 251 16553 km @@ -2975,7 +4086,7 @@ Yellow when too low Добавить позывной и QTH квадрат в базе данных. - + Add Добавить @@ -2984,172 +4095,184 @@ Yellow when too low Мощн. - + <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> <html><head/><body><p>Если кружок отображается оранжевым или красным цветом - не работает CAT управление.Попробуйте синхронизировать управление трансивером нажав кнопкой мыши на кружке, проверьте корректность подключения трансивера к компьютеру,установки в трансивере, выполните заново настройку CAT в WSJT-X.</p></body></html> - + If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. Если кружок отображается оранжевым или красным цветом - не работает CAT управление. Попробуйте синхронизировать управление трансивером нажав кнопкой мыши на кружке, проверьте корректность подключения трансивера к компьютеру,установки в трансивере, выполните заново настройку CAT в JTDX. - + ? - + Adjust Tx audio level Регулировка уровня звука на передачу - + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> <html><head/><body><p>Выберите диапазон или введите частоту в МГц или введите приращение в кГц, после чего нажмите k.</p></body></html> - + Frequency entry - + Select operating band or enter frequency in MHz or enter kHz increment followed by k. Выбор рабочего диапазона или частоты в МГц - + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> - + <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> <html><head/><body><p>Установите этот флажок, чтобы при двойном щелчке по декодированному тексту частота Tx оставалась фиксированной.</p></body></html> - + Check to keep Tx frequency fixed when double-clicking on decoded text. Установите флажок, чтобы частота Tx оставалась фиксированной при двойном щелчке по декодированному тексту. - + Hold Tx Freq Удерживать частоту передачи - + + Audio Rx frequency Звуковая частота приема - - - - - - + + + + + + + + Hz Гц - - + + + Rx - - + + + + Set Tx frequency to Rx Frequency установить частоту передачи равной частоте приема - + + ▲ - + + Frequency tolerance (Hz) Допуск по частоте (Гц) - - + + + F Tol - - + + + + Set Rx frequency to Tx Frequency установить частоту приема равной частоте передачи - + + ▼ - + <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> <html><head/><body><p>Порог синхронизации. Меньшие числа принимают более слабые сигналы синхронизации.</p></body></html> - + Synchronizing threshold. Lower numbers accept weaker sync signals. Порог синхронизации. Меньшие числа принимают более слабые сигналы синхронизации. - + Sync - + <html><head/><body><p>Check to use short-format messages.</p></body></html> <html><head/><body><p>Отметьте, чтобы использовать короткие сообщения.</p></body></html - + Check to use short-format messages. Отметьте, чтобы использовать короткие сообщения. - + Sh - + <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> <html><head/><body><p>Отметьте, чтобы включить быстрые режимы JT9</p></body></html> - + Check to enable JT9 fast modes Отметьте, чтобы включить быстрые режимы JT9 - - + + Fast Быстрый - + <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> <html><head/><body><p>Отметьте, чтобы включить автоматическую последовательность Tx-сообщений на основе полученных сообщений.</p></body></html> - + Check to enable automatic sequencing of Tx messages based on received messages. Отметьте, чтобы включить автоматическую последовательность Tx-сообщений на основе полученных сообщений. - + Auto Seq АвтоВыбор @@ -3162,12 +4285,12 @@ Yellow when too low Отметьте для вызова первого декодированного корреспондента на мой CQ. - + Check to generate "@1250 (SEND MSGS)" in Tx6. Отметьте, чтобы сгенерировать "@1250 (SEND MSGS)" в Tx6 - + Tx6 @@ -3181,92 +4304,92 @@ Yellow when too low Проверка на Tx через четные минуты или последовательности, начиная с 0; снимите флажок для нечетных последовательностей. - + Tx even/1st Tx четный/1-й - + <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> <html><head/><body><p>Частота вызова CQ в кГц выше текущей частоты МГц</p></body></html> - + Frequency to call CQ on in kHz above the current MHz Частота для CQ в кГц выше текущей частоты МГц - + Tx CQ - + <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> <html><head/><body><p>Отметьте, чтобы вызывать CQ на &quot;Tx CQ&quot; частота. Rx будет на текущей частоте, а сообщение CQ будет включать текущую частоту Rx, чтобы вызывающие абоненты знали, на какой частоте отвечать.</p><p>Недоступно для владельцев нестандартных позывных.</p></body></ HTML - + Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. Not available to nonstandard callsign holders. Установите этот флажок, чтобы вызвать CQ на частоте «Tx CQ». Rx будет на текущей частоте, а сообщение CQ будет включать текущую частоту Rx, чтобы вызывающие абоненты знали, на какой частоте отвечать. Недоступно для владельцев нестандартных позывных. - + Rx All Freqs Rx всех частот - + <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> <html><head/><body><p>Подрежим определяет расстояние между тонами; A — самое узкое.</p></body></html> - + Submode determines tone spacing; A is narrowest. Подрежим определяет расстояние между тонами; А самый узкий. - + Submode - - + + Fox - + <html><head/><body><p>Check to monitor Sh messages.</p></body></html> <html><head/><body><p>Отметьте, чтобы отслеживать сообщения Sh.</p></body></html> - + Check to monitor Sh messages. Отметьте, чтобы отслеживать сообщения Sh. - + SWL - + Best S+P - + <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> <html><head/><body><p>Установите этот флажок, чтобы начать запись данных калибровки.<br/>При измерении коррекция калибровки отключена.<br/>Если флажок не установлен, вы можете просматривать результаты калибровки.</p> - + Check this to start recording calibration data. While measuring calibration correction is disabled. When not checked you can view the calibration results. @@ -3275,216 +4398,214 @@ When not checked you can view the calibration results. Если флажок не установлен, вы можете просмотреть результаты калибровки. - + Measure Измерение - + <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> <html><head/><body><p>Отчет о сигнале: отношение сигнал/шум в эталонной полосе пропускания 2 500 Гц (дБ).</p></body></html> - + Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). Отчет о сигнале: отношение сигнал-шум в эталонной полосе пропускания 2500 Гц (дБ). - + Report Рапорт - + <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> <html><head/><body><p>Длина последовательности калибровки Tx/Rx или частоты</p></body></html> - + Tx/Rx or Frequency calibration sequence length Tx/Rx или длина последовательности калибровки частоты - - + + s с - - + + T/R - + + Audio Tx frequency Частота передачи по звуку. - - + + + Tx - + Tx# - - - + + + 1 - - - + + + Send this message in next Tx interval Передать это сообщение в следующем интервале передачи - + Ctrl+2 - + <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> <html><head/><body><p>Отправить это сообщение в следующем интервале Tx</p><p>Дважды щелкните, чтобы переключить использование сообщения Tx1 для начала QSO со станцией (не разрешено для типа 1 держатели составных вызовов)</p></body></html> - + Send this message in next Tx interval Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) Отправить это сообщение в следующем интервале Tx Дважды щелкните, чтобы переключить использование сообщения Tx1 для начала QSO со станцией (не разрешено для составных вызовов типа 1) - + Ctrl+1 - - - - + + + + Switch to this Tx message NOW Переключиться на это Tx-сообщение СЕЙЧАС - + Tx &2 - + Alt+2 - + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> <html><head/><body><p>Переключиться на это сообщение Tx СЕЙЧАС</p><p>Дважды щелкните, чтобы переключить использование сообщения Tx1 для начала QSO со станцией (не разрешено для соединения типа 1 держатели звонков)</p></body></html> - + Switch to this Tx message NOW Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) Переключиться на это Tx-сообщение СЕЙЧАС Дважды щелкните, чтобы переключить использование сообщения Tx1 для начала QSO со станцией (не разрешено для держателей составных вызовов типа 1) - + Tx &1 - + Alt+1 - + Ctrl+6 - + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> <html><head/><body><p>Отправить это сообщение в следующем интервале Tx</p><p>Дважды щелкните, чтобы восстановить стандартное сообщение 73</p></body></html> - + Send this message in next Tx interval Double-click to reset to the standard 73 message Отправить это сообщение в следующем интервале Tx Дважды щелкните, чтобы вернуться к стандартному сообщению 73. - + Ctrl+5 - + Ctrl+3 - + Tx &3 - + Alt+3 - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>Отправить это сообщение в следующем интервале Tx</p><p>Дважды щелкните, чтобы переключиться между сообщениями RRR и RR73 в Tx4 (не разрешено для держателей составных вызовов типа 2)</p><p>Сообщения RR73 следует использовать только в том случае, если вы достаточно уверены, что повторение сообщений не потребуется</p></body></html> + <html><head/><body><p>Отправить это сообщение в следующем интервале Tx</p><p>Дважды щелкните, чтобы переключиться между сообщениями RRR и RR73 в Tx4 (не разрешено для держателей составных вызовов типа 2)</p><p>Сообщения RR73 следует использовать только в том случае, если вы достаточно уверены, что повторение сообщений не потребуется</p></body></html> - Send this message in next Tx interval Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - Отправить это сообщение в следующем интервале Tx + Отправить это сообщение в следующем интервале Tx Двойной щелчок для переключения между сообщениями RRR и RR73 в Tx4 (не разрешено для держателей составных вызовов типа 2) Сообщения RR73 следует использовать только в том случае, если вы достаточно уверены, что повторение сообщений не потребуется. - + Ctrl+4 - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>Переключиться на это сообщение Tx СЕЙЧАС</p><p>Дважды щелкните, чтобы переключиться между сообщениями RRR и RR73 в Tx4 (не разрешено для держателей составных вызовов type2)</p ><p>Сообщения RR73 следует использовать только в том случае, если вы достаточно уверены, что повторение сообщений не потребуется</p></body></html> + <html><head/><body><p>Переключиться на это сообщение Tx СЕЙЧАС</p><p>Дважды щелкните, чтобы переключиться между сообщениями RRR и RR73 в Tx4 (не разрешено для держателей составных вызовов type2)</p ><p>Сообщения RR73 следует использовать только в том случае, если вы достаточно уверены, что повторение сообщений не потребуется</p></body></html> - Switch to this Tx message NOW Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - Переключиться на это Tx-сообщение СЕЙЧАС + Переключиться на это Tx-сообщение СЕЙЧАС Двойной щелчок для переключения между сообщениями RRR и RR73 в Tx4 (не разрешено для держателей составных вызовов типа 2) Сообщения RR73 следует использовать только в том случае, если вы достаточно уверены, что повторение сообщений не потребуется. - + Tx &4 - + Alt+4 @@ -3499,42 +4620,42 @@ Double-click to reset to the standard 73 message Дважды щелкните, чтобы вернуться к стандартному сообщению 73. - + Tx &5 - + Alt+5 - + Now - + Generate standard messages for minimal QSO Генерировать стандартные сообщения для минимального QSO - + Generate Std Msgs Создан. стандарт. сообщ. - + Tx &6 - + Alt+6 - + Enter a free text message (maximum 13 characters) or select a predefined macro from the dropdown list. Press ENTER to add the current text to the predefined @@ -3545,49 +4666,50 @@ list. The list can be maintained in Settings (F2). список. Список можно сохранить в настройках (F2). - + Queue up the next Tx message Поставить в очередь следующее сообщение Tx - + Next Следующий - - - - - - + + + + + + 2 - + Quick-Start Guide to FST4 and FST4W Краткое руководство по FST4 и FST4W - + FST4 - + FST4W - - + + + CQ - + Grid Локатор @@ -3596,1929 +4718,2070 @@ list. The list can be maintained in Settings (F2). Max дБ - + CQ AF - + CQ AN - + CQ AS - + CQ EU - + CQ NA - + CQ OC - + CQ SA - + CQ 0 - + CQ 1 - + CQ 2 - + CQ 3 - + CQ 4 - + CQ 5 - + CQ 6 - + CQ 7 - + CQ 8 - + CQ 9 - + Reset Сброс - + N List - + N Slots - - - - - - - + + + + + + + Random Случайный - + Call - + S/N (dB) S/N (дБ) - + Distance Расстояние - + More CQs - - + + % - + Tx Pct - + Band Hopping Диапазон переходов - + Choose bands and times of day for band-hopping. Выберите диапазоны и время суток для смены диапазонов. - + Schedule ... Расписание ... - + Upload decoded messages to WSPRnet.org. Загрузка декодированные сообщения на WSPRnet.org. - + Upload spots Послать спот - + <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> <html><head/><body><p>6-значные локаторы вызывают отправку 2 разных сообщений, второе содержит полный локатор, но только хешированный позывной, другие станции должны декодировать первое один раз, прежде чем они смогут декодировать ваш позывной во-вторых. Установите этот флажок, чтобы отправлять только 4-значные локаторы, если это позволит избежать протокола с двумя сообщениями.</p></body></html> - + 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. 6-значные локаторы вызывают отправку 2 разных сообщений, второе содержит полный локатор, но только хешированный позывной, другие станции должны декодировать первое один раз, прежде чем они смогут декодировать ваш позывной во втором. Установите этот флажок, чтобы отправлять только 4-значные локаторы, если это позволит избежать протокола с двумя сообщениями. - + No own call decodes Нет своих декод. вызовов - + Tx Next Tx след. - + Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. Укажите мощность передатчика в дБм (относительно 1 мВт) для передачи в Вашем WSPR сообщении. - + NB - + 40 - - - + + + 10 - + 17 - + 60 - - + + 12 - + 160 - + 20 - + 80 - - + + 70 - + 15 - + 30 - - - - + + + + 6 - + 24G - + 10G - + 5G - - - + + + 9 - + 13 - + 23 - + 33 - + 1.25 - - + + 4 - - + + 8 - + CQ messages only. - + Bypass Filters toggled via Settings or the Filters menu. - + BP - + <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> - + Avg - + <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> - + <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> - + <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> - + <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> - + <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> - + Ignore - + Pwr - - <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the the strongest station's reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the the weakest station's reply to your CQ. </p></body></html> - - - - - + + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> - + <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> - + 15C - + <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> - + 15A - + <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> - + 30B - + <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> - + 60C - + <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> - + 60D - + <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> - + 60E - + Maximum drift rate in units of symbol rate per transmission. Максимальная скорость дрейфа в единицах скорости передачи символов на передачу. - + Max Drift Макс дрейф - - + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> - + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> - + Send msg - + <html><head/><body><p>Enter a free text message.</p></body></html> - + Free Text - + <html><head/><body><p>Select a specific CQ message.</p></body></html> - + Queue - + Allow Dupes - + <html><head/><body><p>Clear all queues.</p></body></html> - + <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> - + <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> - + Age - + Continent - + Score - + <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> - + In Progress - + <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> - - - - + + + + 3 - + 70cm FT8 - + 70cm - + 30m FT8 - + 30m - + <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> - + Band Hopping - + 12m FT8 - + 12m - + 40m FT8 - + 40m - + 2m MSK144 - + 2m MSK - + 10m FT8 - + 10m - + 6m FT8 - + 6m - + 60m FT8 - + 60m - + 160m FT8 - + 160m - + 80m FT8 - + 80m - + 20m FT8 - + 20m - + 17m FT8 - + 17m - + 4m FT8 - + 4m - + 15m FT8 - + 15m - + 2m FT8 - + 2m - - + + 10m FT4 - - + + 12m FT4 - - + + 15m FT4 - - + + 17m FT4 - - + + 20m FT4 - - + + 30m FT4 - - + + 40m FT4 - - + + 80m FT4 - + FT8 QRG6 - + FT8 QRG1 - + FT8 QRG2 - + FT8 QRG7 - + FT8 QRG8 in kHz. - + FT8 QRG5 - + FT8 QRG3 - + FT8 QRG4 - + FT8 QRG8 - + FT8 QRG7 in kHz. - + FT8 QRG6 in kHz. - + FT8 QRG5 in kHz. - + FT8 QRG4 in kHz. - + FT8 QRG3 in kHz. - + FT8 QRG2 in kHz. - + FT8 QRG1 in kHz. - + + GroupBox + + + + + CQ %M CQ + + + + + %H 599 %N + + + + + %H TU CQ %M CQ + + + + + %M + + + + + %H + + + + + TU NOW %Q 599 %N + + + + + %H AGN? + + + + + 599 %N + + + + + F1 + + + + + HisCall Exchange + + + + + F2 + + + + + TU CQ + + + + + F3 + + + + + MyCall + + + + + F4 + + + + + HisCall + + + + + F5 + + + + + Now QueuedCall Exchange + + + + + F6 + + + + + HisCall AGN ? + + + + + Exchange + + + + + Serial number of QSO for contest exchange. + + + + + Click to transmit a message. + + + + + Send message + + + + + Call next + + + + + Message to be transmitted + + + + + Serial Number + + + + + Callsign to be worked next. + + + + Spacing - + Fixed Tone - + K1JT - + CW - + Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. - + H - + Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. - + Switch to FT4 mode - + Switch to MSK144 mode - + MSK - + <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> - + <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> - + <html><head/><body><p>Switch to Echo mode</p></body></html> - + File Файл - + View Показывать - + Filters - + Decode Декод. - + Parameters - + Decoder sensitivity - + Decoder start - + Number of threads - + QSO RX freq sensitivity - + Decoding cycles - + Save Сохранить - + Help Помощь - + + Mode Модуляция - + Configurations Конфигурация - + Tools Инструменты - + Exit Выход - + About WSJT-X О WSJT-X - + Waterfall Водопад - + Open Открыть - + Ctrl+O - + Open next in directory Открыть следующий в папке - + + Ctrl+X + + + + Decode remaining files in directory Декодировать оставшиеся файлы в папке - - Shift+F6 - + + Download EME Ephemeris Chart + + + + + Hide AP information + + + + + <html><head/><body><p>Hide AP information</p></body></html> + + + + + Highlight Whitelist entries + + + + + JTTY + - + Delete all *.wav && *.c2 files in SaveDir - + None Нет - + Save all Сохранить все - + Remove saved files after 30 days - + Online User Guide Онлайн-руководство пользователя - + Keyboard shortcuts Горячие клавиши - + Special mouse commands Команды управления мышью - + JT9 - + Save decoded Сохранить декодированные - - + + Normal Нормальный - + Deep Глубокий - + Erase ALL.TXT Стереть ALL.TXT - + Erase wsjtx_log.adi Стереть wsjtx_log.adi - + Erase wsjtx.log - + Erase Ignore List - + F7 - + Don't split ALL.TXT - + Split ALL.TXT yearly - + Split ALL.TXT monthly - + Disable writing of ALL.TXT - + Active Stations - + Band Buttons - + Use Dark Style - + Reduce false decodes - + Default event logging - + Diagnostic mode - + Disable event logging - + Quick-Start Guide to WSJT-X 2.7 and QMAP - - WSJT-X_improved Home Page - - - - - <html><head/><body><p>Go to the wsjt-x_improved home page.</p></body></html> - - - - - The additional features of wsjt-x_improved - - - - - <html><head/><body><p>Overview on the additional features of wsjt-x_improved.</p></body></html> - - - - - Recommended audio settings - - - - - <html><head/><body><p>Recommended Audio Settings.</p></body></html> - - - - + How to deal with rig control errors - + <html><head/><body><p>How to deal with rig control errors.</p></body></html> - + Erase list of Q65 callers - + SuperFox User Guide - + Message Creator - + Hide stations worked before on band - + Hide stations worked today or yesterday - + Hide stations from Ignore List - + Ignore stations worked today or yesterday - + Ignore stations from Ignore List - + Hide stations from Territory 1 - + Hide stations from Territory 2 - + Hide stations from Territory 3 - + Hide stations from Territory 4 - + Hide stations from Europe - + Hide stations from North America - + Hide stations from South America - + Hide stations from Asia - + Hide stations from Africa - + Hide stations from Oceania - + Hide stations from Antarctica - + Full Duplex Mode - + Highlight callsigns worked before on band - + Highlight callsigns worked today or yesterday - + Highlight callsigns from Ignore List - + Enable Message Popups - + QSY Monitor - + Ignore stations worked before on band - + Use multithreaded FT8 decoder - + Auto - - + + 5 - - + + 7 - - + + 11 - + Low Низкий - + Medium - + High Высокий - + Minimum - + Use low thresholds - + Use subpass - + 2-Stage - + 3-Stage - + Early - + Late - + Wideband DX Call search - + Hide FT8 dupe messages - + VHF / UHF Buttons - + Highlight stations from Territory 1 - + Highlight stations from Territory 2 - + Highlight stations from Territory 3 - + Highlight stations from Territory 4 - + Disable clicks on waterfall - - + + JT65 - + Astronomical data Астрономические данные - + List of Type 1 prefixes and suffixes Список префиксов и суффиксов типа 1 - + Settings... Настройки... - + Local User Guide Локальное руководство пользователя - + Open log directory Открыть папку логов - + JT4 - + Message averaging Усреднение сообщений - + Enable averaging Включить усреднение - + Enable deep search - + WSPR - + Echo Graph Эхо-график - + F8 - - + + Echo Эхо - + EME Echo mode EME эхо режим - + ISCAT - + Fast Graph Быстрый график - - F9 - - - - + &Download Samples ... Скачать примеры... - + <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> <html><head/><body><p>Загрузите примеры аудиофайлов, демонстрирующие различные режимы.</p></body></html> - + MSK144 - + QRA64 - + Release Notes Примечания к выпуску - + Enable AP for DX Call Включить AP для DX Call - + FreqCal - + Measure reference spectrum Измерение эталонного спектра - + Measure phase response Измерение фазовой характеристики - + Erase reference spectrum Стереть эталонный спектр - + Execute frequency calibration cycle Выполнить цикл калибровки частоты - + Equalization tools ... Инструменты эквалайзера ... - - + + FT8 - - + + Enable AP Включить AP - + Solve for calibration parameters Решите для параметров калибровки - + Copyright notice Уведомление об авторских правах - + Shift+F1 - + Fox log Лог лисы - + FT8 DXpedition Mode User Guide Руководство пользователя режима DX-экспедиции FT8 - + Reset Cabrillo log ... Очистка Cabrillo лога ... - + Color highlighting scheme Схема выделения цветом - + Export Cabrillo log ... Экспорт Cabrillo лог... - + Contest log Контест лог - + Erase WSPR hashtable Стереть хеш-таблицу WSPR - - + + FT4 - + Quick-Start Guide to Q65 Краткое руководство по Q65 - + Auto Clear Avg after decode Автоматическая очистка среднего значения после декодирования - + Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 Краткое руководство по WSJT-X 2.5.0 и MAP65 3.0 - + Rig Control Error Ошибка управления трансивером - - - + + + Receiving Прием - + Do you want to reconfigure the radio interface? Хотите перенастроить радиоинтерфейс? - + Error Scanning ADIF Log Ошибка сканирования ADIF лога - + Scanned ADIF log, %1 worked-before records created. CTY: %2 Просканирован лог ADIF, %1 работал до создания записей - + Error Loading LotW Users Data Ошибка при загрузке данных пользователей LotW - + + + + Decoder Error + + + + + The decoder subprocess exited unexpectedly. + + + + + jt9 exited unexpectedly with code %1. + + + + + Error Writing WAV File Ошибка записи файла WAV - + Enumerating audio devices Перечисление аудиоустройств - + Configurations... Конфигурация ... - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Message Сообщение - + Error Killing jt9.exe Process Ошибка завершения jtdxjt9.exe процесса - + KillByName return code: %1 KillByName код возврата :%1 - + Error removing "%1" Ошибка удаления "%1" - + Click OK to retry Нажмите OK, чтобы повторить попытку. - - + + %1.wav: invalid sample count %2 + + + + + Improper mode Неправильный режим - - + + File Open Error Ошибка открытия файла - - - - - + + + + + Cannot open "%1" for append: %2 Не удается открыть "%1" для добавления: %2 - + Error saving c2 file Ошибка сохранения c2 файла - + Error in Sound Input Ошибка в SoundInput - + Error in Sound Output Ошибка в SoundOutput - - + + Single-Period Decodes Однопериодные декодирования - - + + Average Decodes Среднее декодирование - + Change Operator Изменить оператора - + New operator: Новый оператор - + Status File Error Ошибка файла состояния - - + + Cannot open "%1" for writing: %2 Невозможно открыть "%1" для записи: %2 - + Decodes containing My Call - + Subprocess Error Ошибка подпроцесса - + Subprocess failed with exit code %1 Сбой подпроцесса с кодом выхода %1 - - + + Running: %1 %2 Запуск: %1 %2 - + Subprocess error Ошибка подпроцесса - Reference spectrum saved - Сохраненный эталонный спектр - - - - It is very important to avoid audio harmonics and distorted audio signals. -This is usually achieved by the following step-by-step approach: - -1. Select 'Fake it' in the Settings/Radio menu as your 'Split mode'. If your - rig does not support this, select 'Rig'. But really try to avoid 'None'! - -2. Set the transmission power of your transceiver to maximum. - -3. Set the Pwr slider to the minimum and click on the 'Tune' button. - -4. Observe the actual transmission power of your rig as well as ALC. - -5. Carefully increase the Pwr slider until you have reached the - maximum transmit powe of your transceiver. - -6. VERY IMPORTANT: Now reduce the Pwr slider until you reach approx. - 90% of your max. Tx power. ALC should be close to zero. - -7. This is the maximum audio level permitted with your setup. - Always stay with the Pwr slider below this max. value. - -If possible, check your transmission from time to time with a webSDR -to ensure the signal is clean and not distorted. - - - - - <b>Recommended Audio Settings</b> - + Сохраненный эталонный спектр - + Invalid data in fmt.all at line %1 Неверные данные в fmt.all в строке %1 - + Good Calibration Solution Хорошее калибровочное решение - + <pre>%1%L2 ±%L3 ppm %4%L5 ±%L6 Hz @@ -5527,13 +6790,13 @@ to ensure the signal is clean and not distorted. - + Delete Calibration Measurements Удалить калибровочные измерения - + The "fmt.all" file will be renamed as "fmt.bak" Файл «fmt.all» будет переименован в «fmt.bak». @@ -5546,22 +6809,22 @@ to ensure the signal is clean and not distorted. «Алгоритмы, исходный код, внешний вид WSJT-X и связанных с ним программ, а также спецификации протоколов для режимов FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 защищены авторским правом ( C) 2001–2021 годы одним или несколькими из следующих авторов: Джозеф Тейлор, K1JT; Билл Сомервилль, G4WJS; Стивен Франке, K9AN; Нико Палермо, IV3NWV; Грег Бим, KI7MT; Майкл Блэк, W9MDB; Эдсон Перейра, PY2SDR; Филипп. Karn, KA9Q и другие члены группы разработчиков WSJT». - + No data read from disk. Wrong file format? Данные не считываются с диска. Неверный формат файла? - + Confirm Delete Подтвердите удаление - + Are you sure you want to delete all *.wav and *.c2 files in "%1"? Вы уверены, что хотите удалить все файлы *.wav и *.c2 в "%1"? - + Keyboard Shortcuts Горячие клавиши @@ -5659,7 +6922,7 @@ to ensure the signal is clean and not distorted. </table> - + Special Mouse Commands Специальные команды мыши @@ -5728,205 +6991,26 @@ to ensure the signal is clean and not distorted. </table> - + No more files to open. Нет больше файлов для открытия. - - Spotting to PSK Reporter unavailable - Споттинг для PSK Reporter недоступен + Споттинг для PSK Reporter недоступен - + Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. Пожалуйста, выберите другую частоту Tx. WSJT-X не будет сознательно передавать в другом режиме в поддиапазоне WSPR на 30 м. - + WSPR Guard Band WSPR участок, в нем заблокирована передача другими видами модуляции - - If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: - -"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2025 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; and other members of the WSJT Development Group." - - - - - <table cellspacing=1> - <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> - <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> - <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> - <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> - <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> - <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> - <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> - <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> - <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> - <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: toggle "Call 1st")</td></tr> - <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> - <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> - <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> - <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> - <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> - <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> - <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> - <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> - <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> - <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> - <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> - <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> - <tr><td><b>Alt+C </b></td><td>Toggle "Call 1st" checkbox</td></tr> - <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> - <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> - <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> - <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> - <tr><td><b>Alt+E </b></td><td>Erase</td></tr> - <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> - <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> - <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> - <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> - <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> - <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> - <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> - <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> - <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> - <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> - <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> - <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> - <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> - <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> - <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> - <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> - -</table> - Keyboard shortcuts help window contents - - - - - <table cellpadding=5> - <tr> - <th align="right">Click on</th> - <th align="left">Action</th> - </tr> - <tr> - <td align="right">Waterfall:</td> - <td><b>Click</b> to set Rx frequency.<br/> - <b>Right-click</b> to set Tx frequency.<br/> - <b>Double-right-click</b> to set Rx and Tx frequencies. - </td> - </tr> - <tr> - <td align="right">Decoded text:</td> - <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> - and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> - Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> - If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> - own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. - </td> - </tr> - <tr> - <td align="right">Dial Frequency:</td> - <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> - <b>Right-click</b> to increase frequency by 1 kHz.<br/> - <b>Left-click</b> to decrease frequency by 1 kHz.<br/> - The mouse pointer must be over the Dial Frequency indicator. - </td> - </tr> - <tr> - <td align="right">H Button:</td> - <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> - <b>Right-click</b> to activate or deactivate SuperFox mode. - </td> - </tr> - <tr> - <td align="right">FT8 Button:</td> - <td><b>Click</b> to switch to FT8 Hound Mode.<br/> - <b>Right-click</b> to toggle last used Special Operating Activity On/Off. - </td> - </tr> - <tr> - <td align="right">Q65 Button:</td> - <td><b>Click</b> to switch to Q65 Mode.<br/> - <b>Right-click</b> to switch to Q65 Pileup Mode. - </td> - </tr> - <tr> - <td align="right">JT65 Button:</td> - <td><b>Click</b> to switch to JT65 Mode.<br/> - <b>Right-click</b> to switch to JT9 Mode. - </td> - </tr> - <tr> - <td align="right">Tx5 Button:</td> - <td><b>Right-click</b> to retain Tx5 free text. - </td> - </tr> - <tr> - <td align="right">Tx Even/1st:</td> - <td><b>Right-click</b> to freeze the state of the checkbox.<br/> - <b>Right-click on the FT8 Button</b> to unfreeze. - </td> - </tr> - <tr> - <td align="right">Enable Tx Button:</td> - <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> - <b>Right-click</b> to toggle Wait & Pounce On/Off. - </td> - </tr> - <tr> - <td align="right">Erase button:</td> - <td><b>Click</b> to erase Rx Frequency window.<br/> - <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> - If <b>Alternate Erase button behavior</b> is checked:<br/> - <b>Click</b> to erase Band Activity window.<br/> - <b>Right-click</b> to erase Rx Frequency window.<br/> - <b>Double-click</b> to erase Rx Frequency and Band Activity windows. - </td> - </tr> - <tr> - <td align="right">DX Call Button:</td> - <td><b>Click</b> to toggle Wait & Call On/Off.<br/> - <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. - </td> - </tr> - <tr> - <td align="right">Lookup Button:</td> - <td><b>Click</b> to search for callsign in database.<br/> - <b>Right-click</b> to search for Dx Call on qrz.com. - </td> - </tr> - <tr> - <td align="right">Add Button:</td> - <td><b>Click</b> to add callsign and locator to database.<br/> - <b>Right-click</b> to search for Dx Call on hamqth.com. - </td> - </tr> - <tr> - <td align="right">Ignore Button:</td> - <td><b>Click</b> to add callsign to the Ignore List.<br/> - <b>Right-click</b> to search for Dx Call on qrzcq.com. - </td> - </tr> - <tr> - <td align="right">Band Buttons:</td> - <td><b>Click</b> to toggle band / mode default frequencies.<br/> - <b>Right-click</b> to toggle FT8 DXpedition frequencies. - </td> - </tr> -</table> - Mouse commands help window contents - - - - + Please choose another dial frequency. Must be 3Khz away from %1. WSJT-X will not operate in Fox mode @@ -5934,193 +7018,730 @@ overlapping the standard FT8 sub-bands. - - + Fox Mode warning Предупреждение о режиме лисы - + Please choose another dial frequency. WSJT-X will not operate in Fox mode overlapping the WSPR sub-bands. - - Last Tx: %1 - ПослдTx: + + The decoder subprocess could not be stopped. + - - This station transmits in the same time slot as you do. - -You must not start a QSO if both stations Tx even/1st -or Tx odd/2nd, while the Tx even/1st checkbox is disabled. - -Click the MSK144 mode button to re-enable the Tx even/1st -checkbox, or choose another station. + + The decoder subprocess could not be restarted. - - Should you switch to EU VHF Contest mode? - -To do so, check 'Special operating activity' and -'EU VHF Contest' on the Settings | Advanced tab. - Стоит ли переключаться в режим EU VHF Contest? - -Для этого установите флажок «Особая операционная деятельность» и -«EU VHF Contest» в настройках | Продвинутая вкладка. + + Application status + - - Should you switch to ARRL Field Day mode? - Стоит ли переключаться в режим ARRL Field Day? + + Current WSJT-X status messages and operating indicators. + - - Should you switch to RTTY contest mode? - Стоит ли переключаться в режим соревнований RTTY? + + Transmit status + - - - - - Add to CALL3.TXT - Добавить в CALL3.TXT + + Configuration + - - Please enter a valid grid locator - Пожалуйста, введите корректный локатор + + Decode count + - - Cannot open "%1" for read/write: %2 - Невозможно открыть "%1" для чтения/записи: %2 + + Last transmitted message + - - %1 -is already in CALL3.TXT, do you wish to replace it? - %1 -уже находится в CALL3.TXT, заменить его? + + Power and SWR status + - - Warning: DX Call field is empty. - Предупреждение: Поле DX Call пусто. + + Decode progress + + + + + Progress for the current decode operation. + + + + + Transmit watchdog + + + + + The selected transmit message cannot be encoded. Enable Tx has been turned off. Edit the selected message or check station settings before trying again. + + + + + Tx message cannot be encoded; Enable Tx is off + + + + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2026 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; Roger Rehr, W3SZ; John Nelson, G4KLA; Charlie Suckling, DL3WDG; Terrell Deppe, KJ5HST; and other members of the WSJT Development Group." + + + + + EME Chart + + + + + Select Year + + + + + FT8 input completion was rejected: automated=%1 awaiting=%2 frames=%3. + + + + + Unable to flush the final FT8 downsampling block. + + + + + FT8 input completed with %1 of %2 samples in the decode buffer. + + + + + FT8 decoding is running behind; early passes are temporarily reduced. + + + + + FT8 decoding caught up; configured early passes restored. + + + + + + PSK Reporter spot queue full; oldest spot dropped + + + + + Last Tx: %1 + ПослдTx: + + + + A QSO between two stations with nonstandard callsigns won't work. + +Auto Seq would get stuck in an endless loop. + + + + + This station transmits in the same time slot as you do. + +You must not start a QSO if both stations Tx even/1st +or Tx odd/2nd, while the Tx even/1st checkbox is disabled. + +Click the MSK144 mode button to re-enable the Tx even/1st +checkbox, or choose another station. + + + + + Should you switch to EU VHF Contest mode? + +To do so, check 'Special operating activity' and +'EU VHF Contest' on the Settings | Advanced tab. + Стоит ли переключаться в режим EU VHF Contest? + +Для этого установите флажок «Особая операционная деятельность» и +«EU VHF Contest» в настройках | Продвинутая вкладка. + + + + Should you switch to ARRL Field Day mode? + Стоит ли переключаться в режим ARRL Field Day? + + + + Should you switch to RTTY contest mode? + Стоит ли переключаться в режим соревнований RTTY? + + + + %1 shorthand-message mode + + + + + RR73 is not available in %1. Tx4 uses RRR in this mode. + + + + + Wait & Pounce requires a CQ response mode. +Change CQ: None to another option. + + + + + + Decoder is starting; decode request skipped. + + + + + + + + Add to CALL3.TXT + Добавить в CALL3.TXT + + + + Please enter a valid grid locator + Пожалуйста, введите корректный локатор + + + + Cannot open "%1" for read/write: %2 + Невозможно открыть "%1" для чтения/записи: %2 - + + %1 +is already in CALL3.TXT, do you wish to replace it? + %1 +уже находится в CALL3.TXT, заменить его? + + + + Warning: DX Call field is empty. + Предупреждение: Поле DX Call пусто. + + + + SuperFox free text may only contain spaces, digits, uppercase letters, and + - . / ?. + + + + Log file error Ошибка файла лога - + Cannot open "%1" Не удается открыть "%1" - + Error sending log to N1MM Ошибка отправки лога в N1MM - + Write returned "%1" Запись возвращает "%1" - + + DX call + + + + + Callsign of station to be worked. + + + + + DX grid + + + + + Locator of station to be worked. + + + + + Wait and Call + + + + + Lookup DX call + + + + + Add DX call + + + + + Ignore DX call + + + + + CQ response mode + + + + + Selects a station automatically from replies to your pending CQ after Enable Tx is armed in the current receive period, or from CQ messages for Wait & Pounce. + + + + + Transmit audio frequency + + + + + Receive audio frequency + + + + + Signal report + + + + + Operating band + + + + + Operating band text + + + + + Transmit power attenuation + + + + + Adjust Tx audio level attenuation. + + + + + Show or hide the menu bar. + + + + + Rig control status + + + + + Hound mode + + + + + Toggle FT8 hound mode. Right-click to toggle SuperFox mode. + + + + + Message panel selector + + + + + Switches between standard messages, Fox queue, and band hopping pages. Press 1, 2, or 3 while focused to select a page. + + + + + Standard messages + + + + + Fox queue + + + + + + Band hopping + + + + + Standard messages page + + + + + Fox queue page + + + + + Band hopping page + + + + + Hound queue + + + + + Queued Hound callers available for Fox transmissions. + + + + + Fox transmissions in progress + + + + + Hound callers currently in progress for Fox transmissions. + + + + + Hound queue sort order + + + + + Hound queue list size + + + + + Fox transmission slots + + + + + Fox CQ message + + + + + Reset Fox queues + + + + + Fox free text + + + + + Send Fox free text + + + + + Enable FT8 QRG 1 + + + + + Enable FT8 QRG 2 + + + + + Enable FT8 QRG 3 + + + + + Enable FT8 QRG 4 + + + + + Enable FT8 QRG 5 + + + + + Enable FT8 QRG 6 + + + + + Enable FT8 QRG 7 + + + + + Enable FT8 QRG 8 + + + + + FT8 QRG 1 frequency + + + + + FT8 QRG 2 frequency + + + + + FT8 QRG 3 frequency + + + + + FT8 QRG 4 frequency + + + + + FT8 QRG 5 frequency + + + + + FT8 QRG 6 frequency + + + + + FT8 QRG 7 frequency + + + + + FT8 QRG 8 frequency + + + + + Tx1 message + + + + + Tx2 message + + + + + Tx3 message + + + + + Tx4 message + + + + + Tx5 message macro + + + + + Tx6 message + + + + + Tx5 message macro text + + + + + Select Tx1 for next transmission + + + + + Select Tx2 for next transmission + + + + + Select Tx3 for next transmission + + + + + Select Tx4 for next transmission + + + + + Select Tx5 for next transmission + + + + + Select Tx6 for next transmission + + + + + Transmit Tx1 now + + + + + Transmit Tx2 now + + + + + Transmit Tx3 now + + + + + Transmit Tx4 now + + + + + Transmit Tx5 now + + + + + Transmit Tx6 now + + + + Stations calling DXpedition %1 Станции, вызывающие DXpedition %1 - + Show Already Worked - + + All Decodes + + + + + QSO Frequency + + + + Super Fox - + Super Hound - + Hound Гончая - + Tx Messages Tx-сообщения - - - - - - + + + + + + Confirm Erase Подтвердите очистку - + Are you sure you want to erase file ALL.TXT? Вы уверены, что хотите стереть файл ALL.TXT? - + Are you sure you want to erase the list of Q65 callers? - - + + Confirm Reset Подтвердите сброс - + Are you sure you want to erase your contest log? Вы уверены, что хотите стереть лог соревнований? - + Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. Это приведет к удалению всех записей QSO для текущего контеста. Они будут храниться в файле журнала ADIF, но не будут доступны для экспорта в лог Cabrillo. - + Cabrillo Log saved Лог Cabrillo сохранен - + Are you sure you want to erase file wsjtx_log.adi? Вы уверены, что хотите стереть файл wsjtx_log.adi? - + Are you sure you want to erase the WSPR hashtable? Вы уверены, что хотите стереть хеш-таблицу WSPR? - + %1 W - + SWR > 2.5 !!! Transmission was stopped @@ -6129,101 +7750,175 @@ Check your antenna - + Tune digital gain Уровень звука режима настройки - + Transmit digital gain Уровень звука передачи сообщения - + Prefixes Префиксы - + Network Error Ошибка сети - + Error: %1 UDP server %2:%3 Ошибка: %1 UDP-сервер %2:%3 - + + File Error Ошибка файла - + + + Stop transmitting or tuning before changing the dial frequency. + + + + + + Measuring reference spectrum: %1 s remaining + + + + + Reference spectrum measurement stopped; Ref Spec is available + + + + + Reference spectrum saved; Ref Spec is available + + + + + Reference spectrum measurement stopped; no reference spectrum is available + + + + Phase Training Disabled Фаза обучения отключена - + Phase Training Enabled Фаза обучения включена - + + Cannot remove "%1": %2 + + + + WD:0m - + Runaway Tx watchdog - - WD:%1m + + WD:%1m + + + + + + + Free Text Message + + + + + + Message: + + + + + Directional calls not yet supported in SuperFox mode + + + + + TOTP: No seed entered in fox configuration to generate verification code. + + + + + SuperFox cannot queue %1: unsupported callsign. + + + + + TOTP SF: seed not long enough. + + + + + SuperFox Tx stopped: invalid message tokens. + + + + + SuperFox Tx stopped: invalid verification code. - - - Free Text Message + + SuperFox Tx stopped: invalid CQ call or grid. - - - Message: + + SuperFox Tx stopped: invalid callsign. - - Directional calls not yet supported in SuperFox mode + + SuperFox Tx stopped: report is outside the SuperFox range. - - TOTP: No seed entered in fox configuration to generate verification code. + + SuperFox Tx stopped: free text contains unsupported characters. - - TOTP SF: seed not long enough. + + SuperFox Tx stopped: message could not be packed. - + Are you sure you want to erase the Tx Log? - + "%1" added to Ignore List - + Are you sure you want to erase the Ignore List? @@ -6232,16 +7927,223 @@ UDP-сервер %2:%3 WD:%1m - - + + Log File Error Ошибка файла лога - + Are you sure you want to clear the QSO queues? Вы уверены, что хотите очистить очередь QSO? + + + Band hopping has no selected frequencies. + + + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: cycle CQ response mode)</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Cycle CQ response mode</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Ctrl+X </b></td><td>Open next file in directory</td></tr> + <tr><td><b>Alt+x </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> + +</table> + + + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Right-click</b> to set Tx frequency.<br/> + <b>Double-right-click</b> to set Rx and Tx frequencies. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> + and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> + Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> + own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">Dial Frequency:</td> + <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> + <b>Right-click</b> to increase frequency by 1 kHz.<br/> + <b>Left-click</b> to decrease frequency by 1 kHz.<br/> + The mouse pointer must be over the Dial Frequency indicator. + </td> + </tr> + <tr> + <td align="right">H Button:</td> + <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to activate or deactivate SuperFox mode. + </td> + </tr> + <tr> + <td align="right">FT8 Button:</td> + <td><b>Click</b> to switch to FT8 Hound Mode.<br/> + <b>Right-click</b> to toggle last used Special Operating Activity On/Off. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> + <tr> + <td align="right">Tx5 Button:</td> + <td><b>Right-click</b> to retain Tx5 free text. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Right-click</b> to freeze the state of the checkbox.<br/> + <b>Right-click on the FT8 Button</b> to unfreeze. + </td> + </tr> + <tr> + <td align="right">Enable Tx Button:</td> + <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> + <b>Right-click</b> to toggle Wait & Pounce On/Off after selecting<br/> + any CQ response mode other than CQ: None. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> + If <b>Alternate Erase button behavior</b> is checked:<br/> + <b>Click</b> to erase Band Activity window.<br/> + <b>Right-click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">DX Call Button:</td> + <td><b>Click</b> to toggle Wait & Call On/Off.<br/> + <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. + </td> + </tr> + <tr> + <td align="right">Lookup Button:</td> + <td><b>Click</b> to search for callsign in database.<br/> + <b>Right-click</b> to search for Dx Call on qrz.com. + </td> + </tr> + <tr> + <td align="right">Add Button:</td> + <td><b>Click</b> to add callsign and locator to database.<br/> + <b>Right-click</b> to search for Dx Call on hamqth.com. + </td> + </tr> + <tr> + <td align="right">Ignore Button:</td> + <td><b>Click</b> to add callsign to the Ignore List.<br/> + <b>Right-click</b> to search for Dx Call on qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Band Buttons:</td> + <td><b>Click</b> to toggle band / mode default frequencies.<br/> + <b>Right-click</b> to toggle FT8 DXpedition frequencies. + </td> + </tr> +</table> + + + + + Type 1 Prefixes: + + 1A 1S 3A 3B6 3B8 3B9 3C 3C0 3D2 3D2C 3D2R 3DA 3V 3W 3X + 3Y 3YB 3YP 4J 4L 4S 4U1I 4U1U 4W 4X 5A 5B 5H 5N 5R + 5T 5U 5V 5W 5X 5Z 6W 6Y 7O 7P 7Q 7X 8P 8Q 8R + 9A 9G 9H 9J 9K 9L 9M2 9M6 9N 9Q 9U 9V 9X 9Y A2 + A3 A4 A5 A6 A7 A9 AP BS7 BV BV9 BY C2 C3 C5 C6 + C9 CE CE0X CE0Y CE0Z CE9 CM CN CP CT CT3 CU CX CY0 CY9 + D2 D4 D6 DL DU E3 E4 EA EA6 EA8 EA9 EI EK EL EP + ER ES ET EU EX EY EZ F FG FH FJ FK FKC FM FO + FOA FOC FOM FP FR FRG FRJ FRT FT5W FT5X FT5Z FW FY M MD + MI MJ MM MU MW H4 H40 HA HB HB0 HC HC8 HH HI HK + HK0A HK0M HL HM HP HR HS HV HZ I IS IS0 J2 J3 J5 + J6 J7 J8 JA JDM JDO JT JW JX JY K KG4 KH0 KH1 KH2 + KH3 KH4 KH5 KH5K KH6 KH7 KH8 KH9 KL KP1 KP2 KP4 KP5 LA LU + LX LY LZ OA OD OE OH OH0 OJ0 OK OM ON OX OY OZ + P2 P4 PA PJ2 PJ7 PY PY0F PT0S PY0T PZ R1F R1M S0 S2 S5 + S7 S9 SM SP ST SU SV SVA SV5 SV9 T2 T30 T31 T32 T33 + T5 T7 T8 T9 TA TF TG TI TI9 TJ TK TL TN TR TT + TU TY TZ UA UA2 UA9 UK UN UR V2 V3 V4 V5 V6 V7 + V8 VE VK VK0H VK0M VK9C VK9L VK9M VK9N VK9W VK9X VP2E VP2M VP2V VP5 + VP6 VP6D VP8 VP8G VP8H VP8O VP8S VP9 VQ9 VR VU VU4 VU7 XE XF4 + XT XU XW XX9 XZ YA YB YI YJ YK YL YN YO YS YU + YV YV0 Z2 Z3 ZA ZB ZC4 ZD7 ZD8 ZD9 ZF ZK1N ZK1S ZK2 ZK3 + ZL ZL7 ZL8 ZL9 ZP ZS ZS8 KC4 E5 + +Type 1 Suffixes: /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /P + + MessageAveraging @@ -6260,8 +8162,8 @@ UDP-сервер %2:%3 Modes - - + + Mode Вид @@ -6269,7 +8171,7 @@ UDP-сервер %2:%3 MultiSettings - + Default @@ -6277,62 +8179,62 @@ UDP-сервер %2:%3 MultiSettings::impl - + &Switch To Переключить на - + &Clone Клон - + Clone &Into ... Клонировать в ... - + R&eset Сброс - + &Rename ... Переименовать ... - + &Delete Удалить - + Clone Into Configuration Клонировать в конфигурацию - + Confirm overwrite of all values for configuration "%1" with values from "%2"? Подтвердить перезапись всех значений конфигурации "%1" значениями из "%2"? - + Reset Configuration Сброс конфигурации - + Confirm reset to default values for configuration "%1"? Подтвердить сброс значений по умолчанию для конфигурации "%1"? - + Delete Configuration Удалить конфигурацию - + Confirm deletion of configuration "%1"? Подтвердить удаление конфигурации "%1"? @@ -6340,17 +8242,17 @@ UDP-сервер %2:%3 NameDialog - + New Configuration Name Новое имя конфигурации - + Old name: Старое имя - + &New name: Новое имя: @@ -6376,12 +8278,12 @@ UDP-сервер %2:%3 Не удалось запустить COM-сервер OmniRig. - + OmniRig: don't know how to set rig frequency OmniRig: не знаю, как настроить частоту трансивера - + OmniRig COM/OLE error: %1 at %2: %3 (%4) Ошибка OmniRig COM/OLE: %1 в %2: %3 (%4) @@ -6407,34 +8309,33 @@ UDP-сервер %2:%3 - + Too many colours in palette. Слишком много цветов в палитре. - + Error reading waterfall palette file "%1:%2" too many colors. Ошибка чтения файла палитры водопада "%1:%2" слишком много цветов. - + Error reading waterfall palette file "%1:%2" invalid triplet. Ошибка чтения файла палитры водопада "%1:%2" неверный триплет. - + Error reading waterfall palette file "%1:%2" invalid color. Ошибка чтения файла палитры водопада "%1:%2" неверный цвет. - + Error opening waterfall palette file "%1": %2. Ошибка при открытии файла палитры водопада "%1": %2. - Error writing waterfall palette file "%1": %2. - Ошибка записи файла палитры водопада "%1": %2. + Ошибка записи файла палитры водопада "%1": %2. @@ -6835,7 +8736,7 @@ Message - + MessageCreator @@ -6853,7 +8754,7 @@ Message - + QSY Monitor @@ -6991,64 +8892,64 @@ Error(%2): %3 SoundInput - + An error opening the audio input device has occurred. Произошла ошибка при открытии звуковой карты. - + An error occurred during read from the audio input device. Произошла ошибка во время чтения со звуковой карты. - + Non-recoverable error, audio input device not usable at this time. Неисправимая ошибка, звуковая карта в настоящее время не используется - + Requested input audio format is not valid. Запрошенный входной аудиоформат недействителен. - + Requested input audio format is not supported on device. Запрошенный входной аудиоформат не поддерживается на устройстве. - + Failed to initialize audio sink device Не удалось инициализировать звуковую карту - + Idle Простой - + Receiving Прием - + Suspended Приостановленный - + Interrupted Прерывание - + Error Ошибка - + Stopped Остановлено @@ -7056,90 +8957,114 @@ Error(%2): %3 SoundOutput - + An error opening the audio output device has occurred. Произошла ошибка при открытии звуковой карты - + An error occurred during write to the audio output device. Произошла ошибка во время записи на звуковую карту - + Audio data not being fed to the audio output device fast enough. Аудиоданные недостаточно быстро передаются на звуковую карту. - + Non-recoverable error, audio output device not usable at this time. Неисправимая ошибка, звуковая карта в настоящее время не используется. - + Requested output audio format is not valid. Запрошенный выходной аудиоформат недействителен. - + Requested output audio format is not supported on device. Запрошенный выходной аудиоформат не поддерживается на устройстве. - + + Audio output restart attempt failed. + + + + + No audio output device configured. Звуковая карта не настроенаю - + + No audio output stream is active. + + + + Idle Простой - + Sending Отправка - + Suspended Приостановлено - + Interrupted Пррерывание - + Error Ошибка - + Stopped Остановлено + + SplashScreen + + + WSJT-X — Welcome + + + + + WSJT-X startup information. Press Escape to close. + + + StationDialog - + Add Station Добавить станцию - + &Band: Диапазон - + &Offset (MHz): Смещение (МГц) - + &Antenna: Антенна @@ -7180,184 +9105,206 @@ Error(%2): %3 TCITransceiver - + ConnectionRefused - + RemoteHostClosed - + HostNotFound - + SocketAccess - + SocketResource - + SocketTimeout - + DatagramTooLarge - + Network - + AddressInUse - + SocketAddressNotAvailable - + UnsupportedSocketOperation - + UnfinishedSocketOperation - + ProxyAuthenticationRequired - + SslHandshakeFailed - + ProxyConnectionRefused - + ProxyConnectionClosed - + ProxyConnectionTimeout - + ProxyNotFound - + ProxyProtocol - + Operation - + SslInternal - + SslInvalidUserData - + Temporary - + UnknownSocket - + + UnknownSocketError + + + + TCI websocket error: %1 - + TCI SDR could not be switched on - + TCI SDR is not switched on - + TCI RX2 could not be enabled - + TCI Audio could not be switched on - - + + TCI could not be opened - - + + + + TCI sent an invalid VFO frequency + + + + + TCI failed to set ptt - + TCI should use PTT via CAT - - + + TCI failed set rxfreq - - + + TCI failed set mode - + TCI modulator not Idle + + + TCI source commitment; playout evidence is protocol-send dead reckoning, not DAC confirmation + + + + + TCI WebSocket send progress; no radio DAC or RF playback confirmation + + TransceiverBase @@ -7379,7 +9326,7 @@ Error(%2): %3 Управл. - + Spectrum gain Уровень спектра @@ -7388,220 +9335,229 @@ Error(%2): %3 Палитра - + <html><head/><body><p>Enter definition for a new color palette.</p></body></html> <html><head/><body><p>Введите определение новой цветовой палитры.</p></body></html> - + Adjust... Настройка... - + Total power (dB) - + Waterfall gain Яркость водопада - + <html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html> <html><head/><body><p>Размер окна спектра.</p></body></html> - + % - + Spec - + <html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html> <html><head/><body><p>Сглаживание уровня спектра водопада по всему отображаемому диапазону частот.</p></body></html> - + Flatten Сглаживание - <html><head/><body><p>Compute and save a reference spectrum. (Not yet fully implemented.)</p></body></html> - <html><head/><body><p>Рассчитайте и сохраните эталонный спектр. (Еще не полностью реализовано.)</p></body></html> + <html><head/><body><p>Рассчитайте и сохраните эталонный спектр. (Еще не полностью реализовано.)</p></body></html> - + Ref Spec - + Smoothing of Linear Average spectrum Сглаживание линейного среднего спектра - + Smooth Гладкий - + Compression factor for frequency scale Коэффициент сжатия для частотной шкалы - + + <html><head/><body><p>Controls</p></body></html> + + + + Bins/Pixel - - + + <html><head/><body><p>Position of time stamp above each interval line</p></body></html> - + Time stamp - - + + Off - + Left Левый - + Right Правый - + Palette - + Select waterfall palette Выберите палитру водопада - + Bars - + Freq - + + <html><head/><body><p>Apply a saved reference spectrum to flatten the received passband. Available after a reference spectrum has been measured. (Not yet fully implemented.)</p></body></html> + + + + <html><head/><body><p>Select data for spectral display</p></body></html> <html><head/><body><p>Выбор данных для спектрального отображения</p></body></html> - + Current Текущий - + Cumulative Накопительный - + Linear Avg Линейное среднее - + Reference Эталон - + Q65_Sync - + <html><head/><body><p>Frequency at left edge of waterfall</p></body></html> <html><head/><body><p>Частота на левом краю водопада</p></body></html> - + Hz Гц - + Start Старт - + <html><head/><body><p>Decode JT9 only above this frequency</p></body></html> <html><head/><body><p>Декодировать JT9 только выше этой частоты</p></body></html> - + Hz Гц - + Split - + Number of FFTs averaged (controls waterfall scrolling rate) Количество усредненных FFT (контролирует скорость прокрутки водопада) - + N Avg - + Waterfall zero Контрастность водопада - + Spectrum zero Ноль спектра - + User Defined Определяемые пользователем - + Wide Graph - - + + Read Palette Чтение палитры @@ -7609,23 +9565,23 @@ Error(%2): %3 WorkedBefore - + Invalid ADIF field %0: %1 Недопустимое поле ADIF %0: %1 - + Malformed ADIF field %0: %1 Неверное поле ADIF %0: %1 - + Invalid ADIF header Недопустимый заголовок ADIF - + Error opening ADIF log file for read: %0 Ошибка открытия лога ADIF для чтения: %0 @@ -7668,7 +9624,7 @@ Error(%2): %3 Мо&й QTH локатор: - + <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> <html><head/><body><p>Ваш локатор, желательно 6 символов.</p></body></html> @@ -7684,57 +9640,57 @@ Error(%2): %3 АвтоЛокатор - + IARU Region: IARU регион: - + <html><head/><body><p>Select your IARU region.</p></body></html> <html><head/><body><p>Выберите свой регион IARU.</p></body></html> - + Message generation for type 2 compound callsign holders: Создание сообщений при испрользовании дробного позывного 2-ого типа : - + <html><head/><body><p>Type 2 compound callsigns are those with prefixes or suffixes not included in the allowed shortlist (See Help-&gt;Add-on prefixes and suffixes).</p><p>This option determines which generated messages should contain your full type 2 compound call sign rather than your base callsign. It only applies if you have a type 2 compound callsign.</p><p>This option controls the way the messages that are used to answer CQ calls are generated. Generated messages 6 (CQ) and 5 (73) will always contain your full callsign. The JT65 and JT9 protocols allow for some standard messages with your full call at the expense of another piece of information such as the DX call or your locator.</p><p>Choosing message 1 omits the DX callsign which may be an issue when replying to CQ calls. Choosing message 3 also omits the DX callsign and many versions of this and other software will not extract the report. Choosing neither means that your full callsign only goes in your message 5 (73) so your QSO partner may log the wrong callsign.</p><p>None of these options are perfect, message 3 is usually best but be aware your QSO partner may not log the report you send them.</p></body></html> <html><head/><body><p>Составные(дробные) позывные второго типа - это те, у которых есть префиксы или суффиксы, не включенные в разрешенный список (см. Помощь->Список дополнительных префиксов и суффиксов)</p><p>Эта опция определяет, какие созданные сообщения должны содержать Ваш полный составной позывной второго типа вместо Вашего основного(домашнего) позывного. Эта настройка применяется только если Вы используете составной позывной второго типа.</p><p>Этот опция определяет способ создания сообщений, которые используются для ответа на вызовы CQ. Сгенерированные сообщения Tx6 (CQ) и Tx5 ​​(73) всегда будут содержать Ваш полный составной позывной. Протоколы JT65 и JT9 позволяют использовать некоторые стандартные сообщения с Вашим полным составным позывным в ущерб другой информации, такой как позывной корреспондента или Ваш QTH квадрат.</p><p>При выбор сообщения Tx1 исключается позывной корреспондента, что может быть проблемой при ответе на сообщения CQ. Выбор сообщения Tx3 также исключает позывной корреспондента, и разные версии этого и другого программного обеспечения не будут извлекать из принятого сообщения рапорт. Выбрав Tx5, Ваш полный позывной будет передан только в сообщении 73, поэтому Ваш корреспондент может внести QSO в свой лог с Вашим неполным(домашним) позывным.</p><p>Среди этих вариантов нет идеального, лучше использовать сообщение Tx3, но помните что в этом случае Ваш корреспондент может забыть внести в лог принятый от Вас рапорт.</p></body></html> - + Full call in Tx1 Полный позывной в Tx1 - + Full call in Tx3 Полный позывной в Tx3 - + Full call in Tx5 only Полный позывной только в Tx5 - + Display Отображать - + Show outgoing transmitted messages in the Rx frequency window. Показать исходящие переданные сообщения в окне частоты приема. - + &Tx messages to Rx frequency window Показывать переданные сообщения в окне Rx - + Show if decoded stations are new DXCC entities or worked before. Показать, являются ли декодированные станции новыми объектами DXCC или работали ранее. @@ -7743,12 +9699,12 @@ Error(%2): %3 Показать &DXCC, локатор и B4 (работал ранее) - + <html><head/><body><p>Check to have decodes for a new period start at the top of the Band Activity window and not scroll off the top when the window is full.</p><p>This is to aid selecting decodes to double-click while decoding is still in progress. Use the Band Activity vertical scroll bar to reveal decodes past the bottom of the window.</p></body></html> <html><head/><body><p>Установите флажок, чтобы декодирование нового периода начиналось в верхней части окна «Декодирование в полосе обзора» и не прокручивалось вверх, когда окно заполнено.</p><p>Это предназначен для облегчения выбора декодирования двойным щелчком, когда декодирование все еще выполняется. Используйте вертикальную полосу прокрутки , чтобы показать декодирование за нижней частью окна.</p></body></html> - + Start new period decodes at top Начать декодирование нового периода сверху @@ -7757,53 +9713,53 @@ Error(%2): %3 Показывать основной префикс вместо названия страны - + Set the font characteristics for the application. Выберите шрифт для надписей программы. - + Font... Шрифт приложения - + Set the font characteristics for the Band Activity and Rx Frequency areas. Выберите шрифт для показа сообщений в полосе обзора и окне приемной частоты. - + Decoded Text Font... Шрифт декодированная... - + Include a separator line between periods in the band activity window. Разделительная линия между периодами декодирования - + &Blank line between decoding periods Разделительная строка между периодами декодирования - + Show distance to DX station in miles rather than kilometers. Показывать расстояние до корреспондента в милях вместо километров. - + Display dista&nce in miles Показывать расстояние в милях - + Behavior Режим - + Decode after EME delay Декодировать после задержки EME @@ -7813,81 +9769,79 @@ Error(%2): %3 при отсутствии активности пользователя - + <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> <html><head/><body><p>Количество минут до прерывания автоматической передачи</p></body></html> - + Disabled - + minutes минут - + Single decode Одиночное декодирование - <html><head/><body><p>Some rigs are not able to process CAT commands while transmitting. This means that if you are operating in split mode you may have to uncheck this option.</p></body></html> - <html><head/><body><p>Некоторые трансиверы не могут обрабатывать CAT-команды во время передачи. Это означает, что если вы работаете в режиме разделения, вам, возможно, придется снять этот флажок.</p></body></html> + <html><head/><body><p>Некоторые трансиверы не могут обрабатывать CAT-команды во время передачи. Это означает, что если вы работаете в режиме разделения, вам, возможно, придется снять этот флажок.</p></body></html> - Allow Tx frequency changes while transmitting - Разрешить изменение частоты Tx во время передачи + Разрешить изменение частоты Tx во время передачи - + Don't start decoding until the monitor button is clicked. Декодирование не начнется пока не будет включена кнопка Монитор. - + Mon&itor off at startup Отключ&ить прием сигналов при запуске - + <html><head/><body><p>Check this if you wish to automatically return to the last monitored frequency when monitor is enabled, leave it unchecked if you wish to have the current rig frequency maintained.</p></body></html> <html><head/><body><p>Отметьте этот флажок, если вы хотите автоматически возвращаться к последней отслеживаемой частоте при включении монитора, оставьте этот флажок снятым, если вы хотите сохранить текущую частоту установки.</p>< /тело></html> - + Monitor returns to last used frequency Монитор возвращается к последней использовавшейся частоте - + Alternate F1-F6 bindings Альтернативные привязки F1-F6 - + Turns off automatic transmissions after sending a 73 or any other free text message. Отключает передачу после отправки 73 или любого другого бесплатного текстовое сообщение. - + Di&sable Tx after sending 73 Отключает передачу после отправки 73 - + Send a CW ID after every 73 or free text message. JT65: Передать свой позывной в CW после сообщения 73 или свободного текстового сообщения. - + CW ID a&fter 73 CW ID после 73 @@ -7896,7 +9850,7 @@ text message. Периодический CW ID интер&вал: - + Send a CW ID periodically every few minutes. This might be required under your countries licence regulations. It will not interfere with other users as it is always sent in the @@ -7907,403 +9861,438 @@ quiet period when decoding is done. тихий период, когда декодирование сделано. - + Automatic transmission mode. Автоматический режим передачи. - + Show &DXCC, grid, and worked-before status - + Highlight DX Grid in message - + Show DXCC for all messages - + Show the separator line between periods with time stamp of the decode period. - + Show blank line with time stamp - + Show principal prefix instead of country name - + Highlight DX Call in message - + Doubl&e-click on call sets Tx enable Двойной клик на позывном разрешает вызов и активирует TX - + <html><head/><body><p>Open the Astronomical Data window automatically when switching to Q65 or JT65 mode and Decode after EME delay is enabled, and close it when no longer needed.</p><p>Open the QSYMessage Creator automatically if the VHF Features are enabled and such QSY messages are applicable.</p></body></html> - + Auto-open/close Astronomical data window - + Calling CQ forces Call 1st Вызов CQ заставляет Call 1st - + <html><head/><body><p>Tx until 73 is received when in MSK144 or Q65 mode. </p></body></html> - + MSK144/Q65: Tx until 73 is received - + <html><head/><body><p>Allow kHz frequency offset entry without 'k' suffix.</p></body></html> - + kHz entry without k (restart required) - + + <html><head/><body><p>Allow automatic Doppler tracking and split/Fake It/XIT to correct the transmit frequency while transmitting, including corrections of tens of kHz on microwave bands.</p><p>This option does not allow nominal dial or band changes while transmitting or tuning. Leave it unchecked if your rig cannot accept frequency-setting CAT commands while transmitting; WSJT-X will then make one midpoint Doppler correction before transmission starts.</p></body></html> + + + + + Allow Tx-frequency corrections while transmitting + + + + <html><head/><body><p>Disable the Tune watchdog.</p></body></html> - + Tune watchdog - + <html><head/><body><p>Number of seconds before Tune is aborted</p></body></html> - + + Tune watchdog timeout + + + + seconds - + Tx watchdog: - + + Tx watchdog timeout + + + + ID Inter&val: - + + CW ID interval + + + + <html><head/><body><p>Turn the progress bar red while transmitting.</p></body></html> - + Turn progress bar red while transmitting - + Additional features - + Set Rx frequency to Tx frequency after QSO - + <html><head/><body><p>If a station sends locator, calculate and show the distance in Band Activity pane.</p></body></html> - + Show distance in messages with grid - + <html><head/><body><p>Erase Band Activity and Rx frequency windows after band change.</p></body></html> - + Erase decodes after band change - + Clear DX Grid after QSO - + Show U.S. States in messages with grid - + Map Grid locator to U.S. State - + <html><head/><body><p>Align the text for DXCC, distance and azimuth.</p></body></html> - + Align DXCC/distance/azimuth - + Alternate Erase button behavior - + Clear DX Call after QSO - + <html><head/><body><p>Increase or decrease the space between message text and DXCC.</p></body></html> + DXCC alignment spacing + + + + Enable Wait features - + <html><head/><body><p>If a station sends a valid Maidenhead locator, calculate and show the great-circle azimuth in Band Activity pane.</p></body></html> - + Show azimuth in messages with grid - + <html><head/><body><p>Increase or decrease the space between DXCC and distance/azimuth.</p></body></html> - + + Distance and azimuth alignment spacing + + + + Less button coloring (restart required) - + &Radio &Радио - + Radio interface configuration settings. Настройки конфигурации радиоинтерфейса. - + <html><head/><body><p>Use only VFO A for split operation (the program temporarily changes the QRG of your rig during transmission).</p></body></html> - + <html><head/><body><p>Use VFO A+B for split operation (works with many rigs, but requires the use of both VFOs).</p></body></html> - + <html><head/><body><p>Don't use split (not recommended).</p></body></html> - + Settings that control your CAT interface. Настройки управления Вашим CAT интерфейсом. - + CAT Control Управление CAT - - + + Port: Порт: - + Serial port used for CAT control. COM порт для управления CAT. - - + + Serial Port Parameters Параметры COM порта - + Baud Rate: Скорость: - + Serial port data rate which must match the setting of your radio. Скорость COM порта . Должна соответствовать установленной скорости в трансивере. - + 1200 - + 2400 - + 4800 - + 9600 - + 19200 - + 38400 - + 57600 - + 115200 - + <html><head/><body><p>Number of data bits used to communicate with your radio's CAT interface (usually eight).</p></body></html> <html><head/><body><p>Количество битов данных, используемых для связи с CAT-интерфейсом трансивера (обычно восемь).</p></body></html> - + Data Bits Бит данных - + D&efault По умолчанию - + Se&ven Семь - + E&ight Восемь - + <html><head/><body><p>Number of stop bits used when communicating with your radio's CAT interface</p><p>(consult you radio's manual for details).</p></body></html> <html><head/><body><p>Количество стоповых битов, используемых при обмене данными с CAT-интерфейсом трансивера</p><p>(подробности см. в руководстве по радиостанции).</p></body>< /html> - + Stop Bits Стоп бит - - + + Default По умолчанию - + On&e Один - + T&wo Два - + <html><head/><body><p>Flow control protocol used between this computer and your radio's CAT interface (usually &quot;None&quot; but some require &quot;Hardware&quot;).</p></body></html> <html><head/><body><p>Протокол управления потоком данных, используемый между этим компьютером и CAT-интерфейсом радиостанции (обычно "Нет", но для некоторых требуется "Аппаратная поддержка").</p></body></ HTML> - - + + Handshake Управление потоком - + &None Отключено - + Software flow control (very rare on CAT interfaces). Программное управление потоком передачи данных через последовательный порт. Применяется крайне редко на CAT интерфейсе. - + XON/XOFF Программное - + Flow control using the RTS and CTS RS-232 control lines not often used but some radios have it as an option and a few, particularly some Kenwood rigs, require it). @@ -8314,75 +10303,74 @@ a few, particularly some Kenwood rigs, require it). некоторые Kenwood, требуют этого управления. - + &Hardware Аппаратное - + Special control of CAT port control lines. Управление линиями DTR/RTS CAT порта, уровень - - + + Force Control Lines Управление линиями DTR/RTS CAT порта. - - + + High Высокий - - + + Low Низкий - + DTR: - + RTS: - How this program activates the PTT on your radio? - Управление PTT + Управление PTT - + PTT Method Управление PTT - + <html><head/><body><p>No PTT activation, instead the radio's automatic VOX is used to key the transmitter.</p><p>Use this if you have no radio interface hardware.</p></body></html> <html><head/><body><p>Для управления передатчиком используется автоматический VOX трансивера.</p><p>Используйте это, если у вас нет аппаратного радиоинтерфейса.</p> </тело></html> - + VO&X - + <html><head/><body><p>Use the RS-232 DTR control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The DTR control line of the CAT serial port may be used for this or a DTR control line on a different serial port may be used.</p></body></html> <html><head/><body><p>Используйте линию управления RS-232 DTR для переключения PTT вашего радио, требуется аппаратное обеспечение интерфейса линии.</p><p>Некоторые коммерческие интерфейсные устройства также используют этот метод. </p><p>Для этого можно использовать линию управления DTR последовательного порта CAT или линию управления DTR на другом последовательном порту.</p></body></html> - + &DTR - + Some radios support PTT via CAT commands, use this option if your radio supports it and you have no other hardware interface for PTT. @@ -8392,72 +10380,72 @@ other hardware interface for PTT. интерфейса для управления PTT. - + C&AT - + <html><head/><body><p>Use the RS-232 RTS control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The RTS control line of the CAT serial port may be used for this or a RTS control line on a different serial port may be used. Note that this option is not available on the CAT serial port when hardware flow control is used.</p></body></html> <html><head/><body><p>Используйте управляющую линию RTS COM порта для переключения PTT вашего трансивера. Для реализации данного метода требуется аппаратная поддержка (COM порт компьютера). Некоторые коммерческие интерфейсы также используют этот метод. Для этого может использоваться линия управления RTS последовательного порта CAT, или может использоваться линия управления RTS другого COM порта. Обратите внимание, что эта опция недоступна на последовательном порту CAT при использовании аппаратного управления потоком. </p></body></html> - + R&TS - + <html><head/><body><p>Select the RS-232 serial port utilised for PTT control, this option is available when DTR or RTS is selected above as a transmit method.</p><p>This port can be the same one as the one used for CAT control.</p><p>For some interface types the special value CAT may be chosen, this is used for non-serial CAT interfaces that can control serial port control lines remotely (OmniRig for example).</p></body></html> <html><head/><body><p>Выберите последовательный порт RS-232, используемый для управления PTT. Этот параметр доступен, когда в качестве метода передачи выбран DTR или RTS.</p><p>Этот порт может быть тем же, что и для управления CAT.</p><p>Для некоторых типов интерфейсов может быть выбрано специальное значение CAT, которое используется для непоследовательных интерфейсов CAT, которые могут удаленно управлять линиями управления последовательного порта ( OmniRig, например).</p></body></html - + Modulation mode selected on radio. Режим модуляции, выбранный на трансивере. - + Mode Режим - + <html><head/><body><p>USB is usually the correct modulation mode,</p><p>unless the radio has a special data or packet mode setting</p><p>for AFSK operation.</p></body></html> <html><head/><body><p>Обычно режим USB является основным режимом модуляции,</p><p>если трансивер не имеет специального режима DATA или Packet</p><p>для работы AFSK.</p></body></html> - + US&B - + Don't allow the program to set the radio mode (not recommended but use if the wrong mode or bandwidth is selected). - - + + None Отключено - + If this is available then it is usually the correct mode for this program. Если это доступно, то обычно это правильный режим для этой программы. - + Data/P&kt - + Some radios can select the audio input using a CAT command, this setting allows you to select which audio input will be used (if it is available then generally the Rear/Data option is best). @@ -8465,52 +10453,52 @@ this setting allows you to select which audio input will be used если выбор доступен, то обычно лучше использовать параметр «Rear/Data». - + Transmit Audio Source Подключение звуковой карты к трансиверу - + Rear&/Data - + &Front/Mic - + Rig: Трансивер: - + Poll Interval: Интервал опроса: - + <html><head/><body><p>Interval to poll rig for status. Longer intervals will mean that changes to the rig will take longer to be detected.</p></body></html> <html><head/><body><p>Интервал для опроса состояния трансивера. Более длительные интервалы означают, что изменения в трансивере будут обнаружены дольше.</p></body></html> - + s c - + <html><head/><body><p>Attempt to connect to the radio with these settings.</p><p>The button will turn green if the connection is successful or red if there is a problem.</p></body></html> <html><head/><body><p>Попробуйте подключиться к трансиверу с этими настройками.</p><p>Кнопка станет зеленой, если подключение выполнено успешно, или красной, если возникла проблема.</ р></тело></html> - + Test CAT Тест CAT - + Attempt to activate the transmitter. Click again to deactivate. Normally no power should be output since there is no audio being generated at this time. @@ -8523,47 +10511,47 @@ radio interface behave as expected. радиоинтерфейс ведет себя так, как ожидалось. - + Test PTT Тест PTT - + Split Operation Разнос частот VFO - + Fake It - + Rig Трансивер - + A&udio Звук - + Audio interface settings Настройки звуковой карты - + Souncard Звуковая карта - + Soundcard Звуковая карта - + Select the audio CODEC to use for transmitting. If this is your default device for system sounds then ensure that all system sounds are disabled otherwise @@ -8577,76 +10565,76 @@ transmitting periods. любые системные звуки, генерируемые во время - + <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> <html><head/><body><p>Введите номер порта службы UDP-сервера, на который WSJT-X должен отправлять обновления. Если это значение равно нулю, обновления отправляться не будут.</p></body></html> - + Outgoing interfaces: Исходящие интерфейсы: - + <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> <html><head/><body><p>При отправке обновлений на групповой адрес многоадресной рассылки необходимо указать, на какие сетевые интерфейсы их отправлять. Если интерфейс обратной связи поддерживает многоадресную рассылку, то будет выбран как минимум этот интерфейс.</p><p>Для большинства пользователей интерфейс обратной связи — это все, что нужно, что позволит нескольким другим приложениям на одном компьютере взаимодействовать с WSJT-X. Если приложения, работающие на других хостах, должны получать обновления статуса, следует использовать подходящий сетевой интерфейс.</p><p>В некоторых системах Linux может потребоваться включить многоадресную рассылку на сетевом интерфейсе обратной связи.</p> </тело></html> - + <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> - + Multicast TTL: Многоадресный TTL: - + Days since last upload Дней с момента последней загрузки - + Select the audio CODEC to use for receiving. Выбор аудио кодека для приема. - + &Input: Вход - + Select the channel to use for receiving. Выбор канала для приема. - - + + Mono Моно - - + + Left Левый - - + + Right Правый - - + + Both Оба - + Select the audio channel used for transmission. Unless you have multiple radios connected on different channels; then you will usually want to select mono or @@ -8657,311 +10645,345 @@ both here. использовать левый и правый каналы. - + Enable VHF and submode features Включить функции VHF и подрежима - + Data bits Бит данных - + Stop bits Стоп бит - - + + Update Hamlib - + 32-bit - + <html><head/><body><p>Revert the last Hamlib update. </p><p>Note: This function is only available on Windows.</p></body></html> - + Revert Update - - <html><head/><body><p>Download the latest libhamlib-4.dll file from https://n0nb.users.sourceforge.net/. </p><p>Note: This function is only available on Windows.</p></body></html> - - - - + In use: - + Backed up: - + 64-bit - + Rig Data - + <html><head/><body><p>Stop transmitting immediately when SWR exceeds 2.5.</p></body></html> - + Halt Tx when SWR > 2.5 - + <html><head/><body><p>Read and display transmit PWR and SWR of your rig.</p></body></html> - + Read and display PWR and SWR - + Ou&tput: Выход: - + + Output audio channel + + + + + Input audio channel + + + + <html><head/><body><p>Refresh audio device list.</p></body></html> - + Refresh Обнловить - + <html><head/><body><p>Use TCI Audio when available.</p></body></html> - + Use TCI Audio (restart required) - + <html><head/><body><p>Rx audio level</p></body></html> - + + TCI receive audio level + + + + Rx - + <html><head/><body><p>Sort audio device names alphabetically.</p></body></html> - + Sort alphabetically - + <html><head/><body><p>Hide the usually unusable ALSA CARD subdevices on Linux.</p></body></html> - + Hide ALSA CARD subdevices (Linux only) - - + + Save Directory Сохранить папку - + Loc&ation: Расположение: - + Path to which .WAV files are saved. Путь для сохранения .WAV файлов. - - + + TextLabel - + Click to select a different save directory for .WAV files. Нажмите, чтобы выбрать другue. папку для сохранения файлов .WAV. Nazhmite, ch - + S&elect Выбор - - + + AzEl Directory AzEl папка - + Location: Расположение: - + Select Выбор - + <html><head/><body><p>Enables additional line in azel.dat for Dpol parameter.</p></body></html> - + Enable extra line in azel.dat - + Power Memory By Band Запомнить мощность по диапазонам - + Remember power settings by band Запомнить уровень сигнала на передачу по диапазонам и видам излучения - + Enable power memory during transmit Запомнить уровень звука при передаче сообщений - + Transmit Передача сообщений - + Enable power memory during tuning Запомнить уровень звука при настройке - + Tune Настройка передатчика - + Tx &Macros Tx макросы - + Canned free text messages setup Настройка готовых свободных текстовых сообщений - + + New &macro: + + + + &Add Добавить - + + Add Tx macro + + + + + Adds the entered message to the saved Tx macro list. + + + + + New Tx macro message + + + + + Enter a saved free-text message for the Tx5 dropdown. Free-text messages are limited to 13 characters including spaces. + + + + &Delete Удалить - Drag and drop items to rearrange order Right click for item specific actions Click, SHIFT+Click and, CRTL+Click to select items - Перетащите элементы, чтобы изменить порядок + Перетащите элементы, чтобы изменить порядок Щелкните правой кнопкой мыши для определенных действий с элементом Нажмите, SHIFT+щелчок и, CRTL+щелчок, чтобы выбрать элементы - + Reportin&g Лог - + Reporting and logging settings Настройка записи QSO в лог - + Logging Внtсенние в лог - + <html><head/><body><p>Check this option to note any Special Operating Activity in the comments field.</p></body></html> - + Special operating activity to comments - + The program will pop up a partially completed Log QSO dialog when you send a 73 or free text message. Программа выведет частично заполненное диалоговое окно Log QSO, когда вы отправляете 73 или произвольное текстовое сообщение. - + Promp&t me to log QSO Приглашение внести QSO в лог - + <html><head/><body><p>Log 'ZZ00' as grid if the other station doesn't send you a grid.</p></body></html> - + Fill missing grids with 'ZZ00' - + Op Call: - + Some logging programs will not accept the type of reports saved by this program. Check this option to save the sent and received reports in the @@ -8971,7 +10993,7 @@ comments field. и полученный рапорт в поле комментариев. - + d&B reports to comments Добавить рапорта дБ в комментарии @@ -8986,22 +11008,22 @@ and DX Grid fields when a 73 or free text message is sent. Очистить вызов DX и локатор после ввода в лог - + <html><head/><body><p>Some logging programs will not accept WSJT-X mode names.</p></body></html> <html><head/><body><p>Некоторые программы логов не принимают виды режимов WSJT-X.</p></body></html> - + Con&vert mode to RTTY Преобразовать моду в RTTY - + <html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html> <html><head/><body><p>Позывной оператора, если он отличается от позывного станции.</p></body></html> - + <html><head/><body><p>Check to have QSOs logged automatically, when complete.</p></body></html> <html><head/><body><p>Установите флажок, чтобы QSO регистрировались автоматически по завершении.</p></body></html> @@ -9010,174 +11032,203 @@ and DX Grid fields when a 73 or free text message is sent. Автотматиическая запись в лог - + Network Services Сетевой сервис - + <html><head/><body><p>The program can send your station details and all decoded signals with grid squares as spots to the http://pskreporter.info web site.</p><p>This is used for reverse beacon analysis which is very useful for assessing propagation and system performance.</p></body></html> <html><head/><body><p>Программа может отправлять информацию о вашей станции и все декодированные сигналы с локаторами как спот на веб-сайт http://psreporter.info.</p><p>Это используется для анализа обратного маяка, который очень полезен для оценки распространения и производительности системы.</p></body></html> - + Enable &PSK Reporter Spotting Отправлять споты на сервер &PSK Reporter - + <html><head/><body><p>Check this option if a reliable connection is needed</p><p>Most users do not need this, the default uses UDP which is more efficient. Only check this if you have evidence that UDP traffic from you to PSK Reporter is being lost.</p></body></html> <html><head/><body><p>Отметьте этот параметр, если требуется надежное соединение</p><p>Большинству пользователей это не нужно, по умолчанию используется более эффективный протокол UDP. Проверяйте это только в том случае, если у вас есть доказательства того, что трафик UDP от вас к PSK Reporter теряется.</p></body></html> - + Use TCP/IP connection Использовать соединение TCP/IP - + UDP Server UDP-сервер - + UDP Server: UDP-сервер: - + <html><head/><body><p>Optional hostname of network service to receive decodes.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the broadcasting of UDP status updates.</p></body></html> <html><head/><body><p>Необязательное имя хоста сетевой службы для получения декодирования.</p><p>Форматы:</p><ul style="margin-top: 0px; margin-bottom: 0px; поле-слева: 0px; поле-справа: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin- справа:0px; -qt-block-indent:0; text-indent:0px;">имя хоста</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin -right:0px; -qt-block-indent:0; text-indent:0px;">IPv4-адрес</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px ; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6-адрес</li><li style=" margin-top:0px; margin-bottom:0px; margin-left :0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">адрес многоадресной группы IPv4</li><li style=" margin-top:0px; margin-bottom:0px ; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Адрес многоадресной группы IPv6</li></ul><p>Очистка этого поля отключит широковещательная рассылка обновлений статуса UDP.</p ></body></html> - + UDP Server port number: Номер порта UDP сервера: - + <html><head/><body><p>With this enabled WSJT-X will accept certain requests back from a UDP server that receives decode messages.</p></body></html> <html><head/><body><p>Если эта функция включена, WSJT-X будет принимать определенные запросы от сервера UDP, который получает декодированные сообщения.</p></body></html> - + Accept UDP requests Разрешить принимать UDP-запросы - + <html><head/><body><p>Indicate acceptance of an incoming UDP request. The effect of this option varies depending on the operating system and window manager, its intent is to notify the acceptance of an incoming UDP request even if this application is minimized or hidden.</p></body></html> <html><head/><body><p>Указывает на принятие входящего запроса UDP. Действие этой опции зависит от операционной системы и оконного менеджера. Ее цель — уведомить о принятии входящего UDP-запроса, даже если это приложение свернуто или скрыто.</p></body></html> - + Notify on accepted UDP request Уведомить о получении UDP запроса - + <html><head/><body><p>Restore the window from minimized if an UDP request is accepted.</p></body></html> <html><head/><body><p>Восстановление окна из свернутого состояния, если принят запрос UDP.</p></body></html> - + Accepted UDP request restores window Восстановить окно при получении UDP запроса - + Secondary UDP Server (deprecated) Вторичный UDP-сервер (устарело) - + <html><head/><body><p>When checked, WSJT-X will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html> <html><head/><body><p>Если этот флажок установлен, WSJT-X будет транслировать зарегистрированный контакт в формате ADIF на настроенное имя хоста и порт. </p></body></html> - + Enable logged contact ADIF broadcast Разрешить передачу данных QSO в ADIF формате - + Server name or IP address: Имя сервера или IP-адрес: - + <html><head/><body><p>Optional host name of N1MM Logger+ program to receive ADIF UDP broadcasts. This is usually 'localhost' or ip address 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable broadcasting of ADIF information via UDP.</p></body></html> <html><head/><body><p>Необязательное имя хоста программы N1MM Logger+ для приема широковещательных сообщений ADIF UDP. Обычно это «localhost» или IP-адрес 127.0.0.1</p><p>Форматы:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin- справа: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent :0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block- отступ:0; text-indent:0px;">IPv4-адрес</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt- block-indent:0; text-indent:0px;">IPv6-адрес</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; - qt-block-indent:0; text-indent:0px;">адрес многоадресной группы IPv4</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right :0px; -qt-block-indent:0; text-indent:0px;">Адрес многоадресной группы IPv6</li></ul><p>Очистка этого поля отключит широковещательную передачу информации ADIF через UDP.</p ></body></html> - + Server port number: Номер порта сервера: - + <html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html> <html><head/><body><p>Введите номер порта, который WSJT-X должен использовать для UDP-трансляций информации журнала ADIF. Для N1MM Logger+ это значение должно быть равно 2333. Если оно равно нулю, обновления не будут транслироваться.</p></body></html> - + Frequencies Частоты - + Default frequencies and band specific station details setup Частоты по умолчанию и настройка параметров станции для конкретных диапазонов - + <html><head/><body><p>See &quot;Frequency Calibration&quot; in the WSJT-X User Guide for details of how to determine these parameters for your radio.</p></body></html> <html><head/><body><p>См. &quot;Калибровка частоты&quot;для получения подробной информации смотрите в Руководстве пользователя WSJT-X , как определить эти параметры для вашего nhfycbdthf.</p></body></html> - + Frequency Calibration Калибровка по частоте - + Slope: Наклон: - + ppm - + Intercept: Cмещение: - + Hz Гц - + Working Frequencies Рабочие частоты - + + + Insert, delete, load, save, merge, or reset working frequencies. + + + + + Working frequencies actions + + + + + + + Actions... + + + + <html><head/><body><p>Right click to maintain the working frequencies list.</p></body></html> <html><head/><body><p>Щелкните правой кнопкой мыши, чтобы сохранить список рабочих частот.</p></body></html> - + Station Information Информация о станции - + + + Insert or delete station information rows. + + + + + Station information actions + + + + Items may be edited. Right click for insert and delete options. Информация для отображения @@ -9187,37 +11238,27 @@ Right click for insert and delete options. для добавления/удаления строк. - + Colors Цвета - + Decode Highlightling Выделение цветом декодированных сообщений - - Reset Highlighting to WSJT-X default - - - - - Reset Highlighting to WSJT-X Improved default - - - - + <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> <html><head/><body><p>Нажмите, чтобы снова просмотреть ADIF-файл wsjtx_log.adi на предмет обработанной ранее информации</p></body></html> - + Rescan ADIF Log Пересканировать ADIF лог - + <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> <html><head/><body><p>Нажмите, чтобы сбросить все выделенные выше элементы до значений и приоритетов по умолчанию.</p></body></html> @@ -9226,122 +11267,117 @@ Right click for insert and delete options. Сбросить выделение - + <html><head/><body><p>Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.</p><p>Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.</p></body></html> <html><head/><body><p>Включите или отключите с помощью флажков и щелкните элемент правой кнопкой мыши, чтобы изменить или отключить цвет переднего плана, цвет фона или восстановить значения элемента по умолчанию. Перетащите элементы, чтобы изменить их приоритет. Чем выше в списке, тем выше приоритет.</p><p>Обратите внимание, что каждый цвет переднего плана или фона может быть либо установлен, либо не установлен. Не установлен означает, что он не назначен для этого элемента. могут применяться элементы типа и более низкого приоритета.</p></body></html> - + <html><head/><body><p>Check to indicate new DXCC entities, grid squares, and callsigns per mode.</p></body></html> <html><head/><body><p>Отметьте, чтобы указать новые объекты DXCC, локаторы и позывные для каждого режима.</p></body></html> - + Highlight by Mode Выделение по режимам - + Include extra WAE entities Включить дополнительные объекты WAE - + Check to for grid highlighting to only apply to unworked grid fields Отметьте, чтобы подсветка локатора применялась только к необработанным полям локатора. - + Only grid Fields sought Искомые поля только в локаторе - + <html><head/><body><p>Controls for Logbook of the World user lookup.</p></body></html> <html><head/><body><p>Элементы управления поиском пользователей в LotW.</p></body></html> - + Logbook of the World User Validation Мировой лог LotW - + Users CSV file URL: - + <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> <html><head/><body><p>URL файла данных о датах и ​​времени последней загрузки пользователя ARRL LotW, который используется для выделения декодирования со станций, которые, как известно, загружают свой файл журнала в LotW.</p>< /тело></html> - - URL - - - - + <html><head/><body><p>Push this button to fetch the latest LotW user's upload date and time data file.</p></body></html> <html><head/><body><p>Нажмите эту кнопку, чтобы получить последний файл данных о дате и времени загрузки пользователя LotW.</p></body></html> - + Fetch Now Скачать сейчас - + Age of last upload less than: Файл CSV загружен не ранее: - + <html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html> <html><head/><body><p>Настройте этот счетчик, чтобы установить дату последней загрузки пользователя LotW, которая принимается в качестве текущего пользователя LotW.</p></body></html> - + days день (дня) (дней) - + Advanced Расш. - + <html><head/><body><p>User-selectable parameters for JT65 VHF/UHF/Microwave decoding.</p></body></html> <html><head/><body><p>Выбираемые пользователем параметры для декодирования JT65 VHF/UHF/Microwave.</p></body></html> - + JT65 VHF/UHF/Microwave decoding parameters Параметры декодирования JT65 VHF/UHF/СВЧ - + Random erasure patterns: Выбранные стили декодера: - + <html><head/><body><p>Maximum number of erasure patterns for stochastic soft-decision Reed Solomon decoder is 10^(n/2).</p></body></html> <html><head/><body><p>Максимальное количество шаблонов стирания для стохастического декодера Рида-Соломона с мягким решением – 10^(n/2).</p></body></html> - + Aggressive decoding level: Уровень агрессивного декодирования: - + <html><head/><body><p>Higher levels will increase the probability of decoding, but will also increase probability of a false decode.</p></body></html> <html><head/><body><p>Более высокие уровни увеличивают вероятность декодирования, но также увеличивают вероятность ложного декодирования.</p></body></html> - + Two-pass decoding Двухпроходное декодирование @@ -9350,45 +11386,45 @@ Right click for insert and delete options. Специальная оперативная деятельность: Генерация сообщений FT4, FT8 и MSK144. - + <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> <html><head/><body><p>Режим DX-экспедиции FT8: оператор Hound, вызывающий DX.</p></body></html> - - + + Hound - + <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> <html><head/><body><p>Североамериканские соревнования VHF/UHF/Microwave и другие, в которых требуется обмен 4-символьным локатором.</p></body></html> - + NA VHF Contest - + <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> <html><head/><body><p>Режим DX-экспедиции FT8: оператор Fox (DX-экспедиция).</p></body></html> - - + + Fox - + <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> <html><head/><body><p>Европейские соревнования VHF+, в качестве контрольного номера требующие уровень сигнала, серийного номера и 6-значного локатора.</p></body></html> - - + + EU VHF Contest @@ -9397,404 +11433,524 @@ Right click for insert and delete options. <html><head/><body><p>ARRL RTTY Roundup и подобные конкурсы. Обмен — это штат США, провинция Канады или &quot;DX&quot;.</p></body></html> - - R T T Y Roundup - - - - RTTY Roundup exchange - Обмен RTTY Roundup + Обмен RTTY Roundup - + NJ - - + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> <html><head/><body><p>Обмен ARRL Field Day: количество передатчиков, секция ARRL/RAC или &quot;DX&quot;.</p></body></html> - - A R R L Field Day - - - - + + ARRL Field Day - + + Field Day exchange - + FD Exch: - + 6A SNJ - + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> - - WW Digital Contest - - - - + + WW Digi Contest - + Miscellaneous Разное - - Degrade S/N of .wav file: - Ухудшить S/N .wav файла + + Degrade S/N of .wav file: + Ухудшить S/N .wav файла + + + + + For offline sensitivity tests + Для автономных тестов чувствительности + + + + + dB + дБ + + + + Log automatically + + + + + <html><head/><body><p>Use 'Log automatically' only for special operating activities.</p></body></html> + + + + + Contesting only + + + + + <html><head/><body><p>Shorten 6-digit grid entries and log 4-digit grids instead.</p></body></html> + + + + + Log 4-digit grids + + + + + Highlight also messages with 73 or RR73 + + + + + Highlight orange: + + + + + Highlight blue: + + + + + http://lotw.arrl.org/lotw-user-activity.csv + + + + + CTY File Download + + + + + CTY File Version: + + + + + Download Latest CTY.dat + + + + + CALL3 File Download + + + + + CALL3 File Version: + + + + + Dowload latest CALL3.TXT file. + + + + + Download CALL3.TXT for terrestrial use + + + + + Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. + + + + + Download CALL3.TXT for EME + + + + + GUI tweaks for high-resolution monitors + + + + + <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> + + + + + HighDPI scaling (restart required) + + + + + <html><head/><body><p>Increased height of some control elements.</p></body></html> + - - - For offline sensitivity tests - Для автономных тестов чувствительности + + Increased height of the tab widget (restart required) + - - - dB - дБ + + API URL: + - - Log automatically + + API Key: - - <html><head/><body><p>Use 'Log automatically' only for special operating activities.</p></body></html> + + Special operating activity - - Contesting only + + <html><head/><body><p>ARRL International Digital Contest</p></body></html> - - <html><head/><body><p>Shorten 6-digit grid entries and log 4-digit grids instead.</p></body></html> + + ARRL Digi Contest - - Log 4-digit grids + + <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> - - Highlight also messages with 73 or RR73 + + NCCC Sprint - - - <html><head/><body><p>Highlight callsigns or grids with orange background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> + + + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> - - Highlight orange: + + + FT Roundup messages - - - <html><head/><body><p>Highlight callsigns or grids with blue background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> + + FT RU Exch: - - Highlight blue: + + <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> - - http://lotw.arrl.org/lotw-user-activity.csv + + SuperFox mode - - CTY File Download + + <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> - - CTY File Version: + + Show OTP messages - - Download Latest CTY.dat + + OTP URL: - - CALL3 File Download + + <html><head/><body><p>URL used to verify OTP codes.</p></body></html> - - CALL3 File Version: + + https://www.9dx.cc - - Dowload latest CALL3.TXT file. + + NA VHF - - Download CALL3.TXT for terrestrial use + + <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> - - Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. + + OTP - - Download CALL3.TXT for EME + + Key: - - GUI tweaks for high-resolution monitors + + <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> - - <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> + + M2ZUU5CW6EVOY2HU - - HighDPI scaling (restart required) + + Interval - - <html><head/><body><p>Increased height of some control elements.</p></body></html> + + <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> - - Increased height of the tab widget (restart required) + + <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> + - - Enable Cloudlog Features + + CQ with individual contest name - - API URL: + + Contest name: - - API Key: + + <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> - - Station ID: + + Q65 Pileup - - <html><head/><body><p>Test the Cloudlog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> + + Receiver bandwidth: + Полоса пропускания приемника + + + + <html><head/><body><p>Download the latest libhamlib-4.dll file from Hamlib SourceForge snapshots. </p><p>Note: This function is only available on Windows.</p></body></html> - - Test API Key + + Delete Tx macro - - Special operating activity + + Deletes the selected Tx macro, or the focused macro if no row is selected. - - <html><head/><body><p>ARRL International Digital Contest</p></body></html> + + Move &Up - - ARRL Digi Contest + + Move Tx macro up - - <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> + + Moves the selected Tx macro one position earlier in the list. - - NCCC Sprint + + Move D&own - - - <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> + + Move Tx macro down - - FT Roundup messages + + Moves the selected Tx macro one position later in the list. - - FT RU Exch: + + Drag and drop items to rearrange order +Right click for item specific actions +Click, SHIFT+Click and, CTRL+Click to select items - - <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> + + Saved Tx macro messages - - SuperFox mode + + Saved free-text messages for the main window Tx5 dropdown. Use Move Up and Move Down or drag and drop to reorder messages. - - <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> + + Change or reset colors for the selected highlighting rule. - - Show OTP messages + + Move the selected highlighting rule earlier in priority order. - - OTP URL: + + Move Up - - <html><head/><body><p>URL used to verify OTP codes.</p></body></html> + + Move the selected highlighting rule later in priority order. - - https://www.9dx.cc + + Move Down - - NA VHF + + Reset Highlighting to Default 1 - - <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> + + Reset Highlighting to Default 2 - - OTP + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with orange background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> - - Key: + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with blue background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> - - <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> + + LotW users CSV URL - - M2ZUU5CW6EVOY2HU + + + <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> - - Interval + + Cloudlog or Wavelog - - <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> + + + Upload QSOs to Cloudlog or Wavelog - - <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> - + + + <html><head/><body><p>API URL for Cloudlog or Wavelog.</p></body></html> - - CQ with individual contest name + + + <html><head/><body><p>Your API key.</p></body></html> - - Contest name: + + + <html><head/><body><p>Your Cloudlog or Wavelog station profile.</p></body></html> - - <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> + + Station profile: - - Q65 Pileup + + <html><head/><body><p>Check the Cloudlog or Wavelog connection, API key, station profile, and upload path where safe.</p><p>The button will turn green if the connection can upload QSOs, orange if the key is valid but read-only, and red if the configuration is unusable.</p></body></html> - - Receiver bandwidth: - Полоса пропускания приемника + + Check Connection + - + Hz Гц - + Tx delay: Задержка передачи: - + Minimum delay between assertion of PTT and start of Tx audio. Минимальная задержка между включением PTT и подачей звукового сигнала. Используется для @@ -9802,276 +11958,412 @@ Right click for insert and delete options. от 'горячего' включения. - + s c - - + + Tone spacing Расстояние между тонами - + <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> <html><head/><body><p>Создайте звук Tx с удвоенным расстоянием между тонами. Предназначен для специальных передатчиков НЧ/СЧ, которые перед генерацией РЧ используют деление на 2.</p></body></html> - + + 2x tone spacing + + + + x 2 - + <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> <html><head/><body><p>Создайте Tx с четырехкратным интервалом между тонами. Предназначен для специальных передатчиков НЧ/СЧ, которые перед генерацией РЧ используют деление на 4.</p></body></html> - + + 4x tone spacing + + + + x 4 - - + + Waterfall spectra Спектр водопада - + Low sidelobes Малый уровень - + Most sensitive Самый чувствительный - + + + <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> + + + + + eQSL.cc + + + + + + Upload QSOs to eQSL.cc + + + + + + <html><head/><body><p>Your username.</p></body></html> + + + + + Username: + + + + + + <html><head/><body><p>Your logon password.</p></body></html> + + + + + Password: + + + + + + <html><head/><body><p>Your QTH nickname, if you have more than one QTH.</p></body></html> + + + + + QTH: + + + + + + Enable special operating activity + + + + + Enable OTP verification + + + + + + OTP key + + + + + + OTP interval + + + + + + OTP URL + + + + + + FT Roundup exchange + + + + + + Contest name + + + + Alerts - - Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. + + NOTES + + + + + "Wanted callsigns, grids, prefixes and directional calls" uses the entries from "Highlight orange" and "Highlight blue". + + + + + <html><head/><body><p>Wanted callsigns, grids, prefixes and directional calls. This alert category uses the entries from &quot;Highlight orange&quot; and &quot;Highlight blue&quot;.</p></body></html> - - THIS FEATURE IS FOR EXPERIENCED USERS ONLY + + Wanted callsigns, grids, prefixes and directional calls - + + IMPORTANT + + + + + Voices: + + + + + default + + + + + <html><head/><body><p>Test the alert sounds.</p></body></html> + + + + + Test + + + + + Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. + + + + Ensure that you have made meaningful settings on the Colors tab, so that you see which message triggered the alert. - + Ensure that your rig is NOT connected via "Default Device". - + Audio Alerts - - + + New ITU Zone on Band Новая ITU зона на диапазоне - - + + New Continent Новый континент - - + + DX Call or DX Grid in message - - + + New Grid Новый локатор - - + + New Continent on Band - + Message received - - + + New ITU Zone Новая ITU зона - - + + New CQ Zone Новая CQ зона - - + + New DXCC on Band - + My Call in message Мой позывной в сообщении - + My Call - - + + New CQ Zone on Band Новая CQ зона на диапазоне - - + + New DXCC Новая DXCC - - + + New Grid on Band - - + + CQ in message CQ в сообщении - + Toggle Audio Alerts on/off. Alerts will be played on "DefaultAudioDevice". DON'T ENABLE AUDIO ALERTS WHEN YOUR RIG IS CONNECTED VIA THIS SOUNDCARD !!! - + Enable Audio Alerts - + This requirement is fulfilled when your rig is connected via USB audio. - + Audio Alerts will be played on the default audio device (usually the loudspeaker of your PC). - - IMPORTANT NOTES - - - - + Use of this feature requires that your computer is equipped with two sound cards. - + Filters - + Territories 1-4 for the Hide checkboxes in the View menu - + Blacklist - + Filters for the Band Activity window - + Hide messages containing the following callsigns or keywords: - + Show only messages containing the following callsigns or keywords: - + <html><head/><body><p>Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed).</p></body></html> - + Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed) - + Always pass messages with the following keywords: - + Whitelist - + <html><head/><body><p>Apply filters only to the callsigns of the calling stations. Usually the second word of the messages is analyzed, for directional calls the third word.</p></body></html> - + Apply filters only to the callsigns of the calling stations - + Always Pass - + <html><head/><body><p>Use “worked today and yesterday” instead of “worked today” for the 3 related Quick Filters.</p></body></html> - + Quick Filters: Hide/Ignore/Highlight "worked today and yesterday" instead of "worked today" (UTC) - + <html><head/><body><p>Discard (Cancel) or apply (OK) configuration changes including</p><p>resetting the radio interface and applying any soundcard changes</p></body></html> <html><head/><body><p>Отменить (Cancel) или применить (OK) изменения конфигурации, включая</p><p>сброс радиоинтерфейса и применение любых изменений звуковой карты</p></body>< /html> @@ -10079,54 +12371,115 @@ Right click for insert and delete options. main - + + Lock file: %1 + + + + + Owner process: %1 + + + + + Owner application: %1 + + + + + Owner host: %1 + + + + + Owner information is not available. + + + + + Remove error: %1 + + + + + Another instance may be running + + + + + WSJT-X could not lock its temporary instance file. + +If another WSJT-X window is still running, choose No. +Use a unique rig name to run more than one instance. + +If WSJT-X crashed or will not restart, choose Remove Lock File. +Choose Retry after closing the other instance. + + + + + Remove Lock File + + + + + Unable to remove stale lock file + + + + + Close any running WSJT-X instance or remove the lock file manually after confirming WSJT-X is not running. + + + + Failed to create a temporary directory Не удалось создать временную папку - - + + Path: "%1" Путь: "%1" - + Failed to create a usable temporary directory Не удалось создать пригодный для использования временную папку - + Another application may be locking the directory Другое приложение может блокировать папку - + Failed to create data directory Не удалось создать папкуг данных - + path: "%1" путь: "%1" - + Shared memory error Ошибка общей памяти - + Unable to create shared memory segment Не удалось создать сегмент общей памяти - + Sub-process error Ошибка подпроцесса - + Failed to close orphaned jt9 process Не удалось закрыть потерянный процесс jt9 diff --git a/translations/wsjtx_uk.ts b/translations/wsjtx_uk.ts new file mode 100644 index 00000000..1dbcde9f --- /dev/null +++ b/translations/wsjtx_uk.ts @@ -0,0 +1,12170 @@ + + + + + AbstractLogWindow + + + &Delete ... + &Видалити ... + + + + AbstractLogWindow::impl + + + Confirm Delete + Підтвердіть видалення + + + + Are you sure you want to delete the %n selected QSO(s) from the log? + + Ви впевнені, що хочете видалити %n позначених QSO з журналу? + Ви впевнені, що хочете видалити %n позначених QSO з журналу? + Ви впевнені, що хочете видалити %n позначених QSO з журналу? + + + + + ActiveStations + + + Message Averaging + Усереднення повідомлень + + + + Band Changes: + Зміни діапазону: + + + + <html><head/><body><p>Total score accumulated since most recent reset of Cabrillo log.</p></body></html> + <html><head/><body><p>Загальний рахунок, накопичений від останнього скидання журналу змагань.</p></body></html> + + + + + + 0 + + + + + <html><head/><body><p>Points logged during the past hour.</p></body></html> + <html><head/><body><p>Очки, записані за останню годину.</p></body></html> + + + + <html><head/><body><p>Check this box to show only stations ready to be called.</p></body></html> + <html><head/><body><p>Позначте, щоб показувати лише станції, готові до виклику.</p></body></html> + + + + Ready only + + + + + # Wanted only + # Лише потрібні + + + + Score: + Рахунок: + + + + Rate: + Темп: + + + + <html><head/><body><p>Set maximum elapsed number of T/R sequences.</p></body></html> + <html><head/><body><p>Задайте, скільки періодів прийому та передачі щонайбільше може минути.</p></body></html> + + + + Max Age + + + + + <html><head/><body><p>Set maximum number of displayed lines.</p></body></html> + <html><head/><body><p>Задайте, скільки рядків показувати щонайбільше.</p></body></html> + + + + Max N + + + + + <html><head/><body><p>Number of band changes during the past hour.</p></body></html> + <html><head/><body><p>Кількість змін діапазону за останню годину.</p></body></html> + + + + <html><head/><body><p>Click on a line to call that station. </p><p>When using QMAP, single click to transfer QSO data and sked frequency to WSJT-X, and double click to call that station.</p></body></html> + <html><head/><body><p>Клікніть на рядку, щоб викликати цю станцію.</p><p>Під час роботи з QMAP одинарний клік передає дані QSO та домовлену частоту до WSJT-X, а подвійний клік викликає цю станцію.</p></body></html> + + + + Active Stations + Активні станції + + + + Wanted only + Лише потрібні + + + + Message + Повідомлення + + + + My call only + Лише мій позивний + + + + Astro + + + + Doppler tracking + Стеження за доплерівським зсувом + + + + <html><head/><body><p>One station does all Doppler shift correction, their QSO partner receives and transmits on the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> + <html><head/><body><p>Одна станція виконує всю поправку на доплерівський зсув, і її сигнал чути на власній частоті зв'язку.</p><p>Якщо трансивер не приймає команди CAT QSY під час передачі, одну поправку застосовують на весь період передачі.</p></body></html> + + + + Full Doppler to DX Grid + Повна поправка на локатор DX + + + + <html><head/><body><p>Transmit takes place on sked frequency and receive frequency is corrected for own echoes. </p><p>This mode can be used for calling CQ, or when using Echo mode.</p></body></html> + <html><head/><body><p>Передача йде на домовленій частоті, а частота прийому виправляється на доплерівський зсув.</p><p>Цей режим можна використовувати для виклику CQ або в режимі Echo.</p></body></html> + + + + Own Echo + Власне відлуння + + + + <html><head/><body><p>Both stations correct for Doppler shift such that they would be heard on the moon at the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p><p>Use this option also for Echo mode.</p></body></html> + <html><head/><body><p>Обидві станції виправляють доплерівський зсув так, щоб їхні сигнали приходили на Місяць на сталій частоті.</p><p>Якщо трансивер не приймає команди CAT QSY під час передачі, одну поправку застосовують на весь період передачі.</p><p>Цей варіант також використовуйте для режиму Echo.</p></body></html> + + + + Constant frequency on Moon + Стала частота на Місяці + + + + <html><head/><body><p>DX station announces their TX Freq, which is entered as the Sked Freq. Correction applied to RX and TX so you appear on the DX's station's own echo Freq.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> + <html><head/><body><p>Станція DX оголошує свою частоту передачі, яку вводять як домовлену.</p><p>Якщо трансивер не приймає команди CAT QSY під час передачі, одну поправку застосовують на весь період передачі.</p></body></html> + + + + On DX Echo + На відлунні DX + + + + <html><head/><body><p>Tune radio manually and select this mode to put your echo on the same frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> + <html><head/><body><p>Налаштуйте трансивер вручну й оберіть цей режим, щоб ваше відлуння лишалося на сталій частоті.</p><p>Якщо трансивер не приймає команди CAT QSY під час передачі, одну поправку застосовують на весь період передачі.</p></body></html> + + + + Call DX + Викликати DX + + + + <html><head/><body><p>No Doppler shift correction is applied. This may be used when the QSO partner does full Doppler correction to your grid square.</p></body></html> + <html><head/><body><p>Поправка на доплерівський зсув не застосовується. Це може бути доречним, коли зсув малий.</p></body></html> + + + + None + Немає + + + + Sked frequency + Домовлена частота + + + + Rx: + + + + + + 0 + + + + + Tx: + + + + + kHz + + + + + Set kHz + Задати кГц + + + + <html><head/><body><p>Tx shift relative to Rx sked frequency</p></body></html> + <html><head/><body><p>Зсув передачі відносно домовленої частоти прийому</p></body></html> + + + + MHz + + + + + Tx Shift + Зсув передачі + + + + Enable + Увімкнути + + + + Echo Mode + Режим відлуння + + + + Hz + + + + + RIT + + + + + Dither + Розкид + + + + Ctl-Lock Sked Freq + Ctrl — зафіксувати домовлену частоту + + + + Astro Data + Астрономічні дані + + + + Astronomical Data + Астрономічні дані + + + + Bands + + + Band name + + + + + Lower frequency limit + Нижня межа частоти + + + + Upper frequency limit + Верхня межа частоти + + + + Band + Діапазон + + + + Lower Limit + Нижня межа + + + + Upper Limit + Верхня межа + + + + CAboutDlg + + + About WSJT-X + Про WSJT-X + + + + OK + Гаразд + + + + CabrilloLog + + + Freq(MHz) + Частота (МГц) + + + + Mode + Режим + + + + Date & Time(UTC) + Дата й &час (UTC) + + + + Call + Позивний + + + + Sent + + + + + Rcvd + Отримано + + + + Band + Діапазон + + + + CabrilloLogWindow + + + Contest Log + Журнал змагань + + + + <html><head/><body><p>Right-click here for available actions.</p></body></html> + <html><head/><body><p>Правий клік — доступні дії.</p></body></html> + + + + Right-click here for available actions. + Правий клік — доступні дії. + + + + 0 QSOs + + + + + CallsignDialog + + + Callsign + + + + + Cloudlog + + + + QSO could not be sent to Cloudlog. + + + + + + QSO upload was rejected by Cloudlog. + + + + + HTTP status %1. Response was not JSON. + + + + + Cloudlog returned an unexpected upload response. + + + + + Cloudlog reported upload status: %1 + + + + + HTTP status %1. + + + + + Cloudlog::impl + + + Enter a Cloudlog or Wavelog URL. + + + + + The connection check needs a base URL before it can contact the API. + + + + + Cloudlog or Wavelog authentication endpoint was not found. + + + + + Tried /api/check_auth, /index.php/api/check_auth, and /index.php/api/auth. + + + + + API key is valid but read-only. + + + + + Generate a read/write API key before enabling QSO uploads. + + + + + API key is invalid. + + + + + Authentication response was not usable. + + + + + Station profile response was not JSON. + + + + + Configured station profile was not found. + + + + + No station profiles were returned by the server. + + + + + Available station profiles: %1 + + + + + Wavelog dry-run QSO endpoint was not found. + + + + + Tried /api/qso/true and /index.php/api/qso/true after Wavelog was identified. + + + + + Dry-run upload response was not usable. + + + + + + Connection check passed. + + + + + Writable API key, station profile, and dry-run QSO upload were validated. + + + + + Dry-run QSO upload was rejected. + + + + + + The QSO dry-run upload was rejected. + + + + + Dry-run QSO upload returned an unexpected response. + + + + + Writable API key and station profile were validated. No safe dry-run QSO endpoint was identified, so no test QSO was uploaded. + + + + + Network error while checking Cloudlog or Wavelog. + + + + + Cloudlog Error! + + + + + Reason: %1 + + + + + ColorHighlighting + + + + + + + + + + + + + + + + + + K1ABC + + + + + CQ in message + CQ у повідомленні + + + + My Call in message + Мій позивний у повідомленні + + + + Transmitted message + Передане повідомлення + + + + New DXCC + Нова країна + + + + New Grid + Новий локатор + + + + New DXCC on Band + Нова країна на діапазоні + + + + New Call + Новий позивний + + + + New Grid on Band + Новий локатор на діапазоні + + + + New Call on Band + Новий позивний на діапазоні + + + + Uploads to LotW + Вивантажує в LotW + + + + New Continent + Новий континент + + + + New Continent on Band + Новий континент на діапазоні + + + + New CQ Zone + Нова зона CQ + + + + New CQ Zone on Band + Нова зона CQ на діапазоні + + + + New ITU Zone + Нова зона ITU + + + + New ITU Zone on Band + Нова зона ITU на діапазоні + + + + Configuration::impl + + + + + &Delete + &Видалити + + + + + &Insert ... + &Вставити ... + + + + Failed to create save directory + Не вдалося створити каталог збереження + + + + path: "%1% + + + + + Failed to create samples directory + Не вдалося створити каталог зразків + + + + path: "%1" + + + + + Wanted territory %1 + + + + + Blacklist keyword %1 + + + + + Whitelist keyword %1 + + + + + Always pass keyword %1 + + + + + CAT control port + + + + + CAT baud rate + + + + + Default CAT data bits + + + + + Seven CAT data bits + + + + + Eight CAT data bits + + + + + Default CAT stop bits + + + + + One CAT stop bit + + + + + Two CAT stop bits + + + + + Default CAT handshake + + + + + No CAT handshake + + + + + XON/XOFF CAT handshake + + + + + Hardware CAT handshake + + + + + Force DTR control line + + + + + Force RTS control line + + + + + VOX PTT method + + + + + DTR PTT method + + + + + CAT PTT method + + + + + RTS PTT method + + + + + PTT control port + + + + + Rear or data transmit audio source + + + + + Front or mic transmit audio source + + + + + No radio mode control + + + + + USB radio mode + + + + + Data or packet radio mode + + + + + No split operation + + + + + Rig split operation + + + + + Fake It split operation + + + + + CAT poll interval + + + + + Frequency calibration slope + + + + + Frequency calibration intercept + + + + + Working frequencies table + + + + + Station information table + + + + + Decode highlighting rules + + + + + Highlighting rules and priorities for decoded messages. + + + + + Decode highlighting actions + + + + + Change or reset colors for the selected highlighting rule. + + + + + Move selected highlighting rule up + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move selected highlighting rule down + + + + + Move the selected highlighting rule later in priority order. + + + + + Orange highlight callsigns and grids + + + + + Blue highlight callsigns and grids + + + + + &Load ... + &Завантажити ... + + + + &Save as ... + &Зберегти як ... + + + + &Merge ... + &Об'єднати ... + + + + &Reset + + + + + Serial Port: + Послідовний порт: + + + + Serial port used for CAT control + Послідовний порт для керування CAT + + + + TCI Server: + Сервер TCI: + + + + Optional hostname and port of TCI service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port + Необов'язкові ім'я вузла й порт служби TCI. +Лишіть порожнім, щоб узяти розумне значення для цієї машини. +Формати: + + + + Network Server: + Мережевий сервер: + + + + Optional hostname and port of network service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port + Необов'язкові ім'я вузла й порт мережевої служби. +Лишіть порожнім, щоб узяти розумне значення для цієї машини. +Формати: + + + + USB Device: + Пристрій USB: + + + + Optional device identification. +Leave blank for a sensible default for the rig. +Format: + [VID[:PID[:VENDOR[:PRODUCT]]]] + Необов'язкове визначення пристрою. +Лишіть порожнім, щоб узяти розумне значення для трансивера. +Формат: + + + + + Invalid audio input device + Хибний звуковий пристрій входу + + + + Invalid audio output device + Хибний звуковий пристрій виходу + + + + Invalid PTT method + Хибний спосіб керування передачею + + + + Invalid PTT port + Хибний порт керування передачею + + + + + Invalid Contest Exchange + Хибний обмін для змагань + + + + You must input a valid ARRL Field Day exchange + Потрібно ввести дійсний обмін ARRL Field Day + + + + You must input a valid ARRL RTTY Roundup exchange + Потрібно ввести дійсний обмін ARRL RTTY Roundup + + + + Pending DNS lookup, please try again later + Триває запит до DNS, спробуйте пізніше + + + + + Reset Decode Highlighting + Скинути виділення декодів + + + + Reset all decode highlighting and priorities to Default 1 values + Повернути всім виділенням і пріоритетам значення «Типове 1» + + + + Reset all decode highlighting and priorities to Default 2 values + Повернути всім виділенням і пріоритетам значення «Типове 2» + + + + Error Loading CTY.DAT + Помилка завантаження CTY.DAT + + + + Error Loading CALL3.TXT file + Помилка завантаження файлу CALL3.TXT + + + + WSJT-X Decoded Text Font Chooser + Вибір шрифту декодованого тексту WSJT-X + + + + + Hamlib update only available on Windows. + Оновлення Hamlib доступне лише у Windows. + + + + Error Loading libhamlib-4.dll + Помилка завантаження libhamlib-4.dll + + + + Hamlib Update successful + +New Hamlib will be used after restart + Hamlib оновлено + +Новий Hamlib буде задіяно після перезапуску + + + + Hamlib successfully reverted + +Reverted Hamlib will be used after restart + Оновлення Hamlib скасовано + +Попередній Hamlib буде задіяно після перезапуску + + + + No Hamlib update found that could be reverted + Не знайдено оновлення Hamlib, яке можна було б скасувати + + + + Cannot test PTT while TX inhibit is active + + + + + Wait for the current inhibit hold to clear before testing changed radio settings or changing PTT state. + + + + + Error in network address + Помилка в мережевій адресі + + + + UDP server DNS lookup failed + Не вдалося визначити адресу сервера UDP через DNS + + + + MAC-ambiguous multicast groups addresses not supported + Групові адреси з неоднозначним MAC не підтримуються + + + + Load Working Frequencies + Завантажити робочі частоти + + + + + + Frequency files (*.qrg *.qrg.json);;All files (*.*) + Файли частот (*.qrg *.qrg.json);;Усі файли (*.*) + + + + Replace Working Frequencies + Замінити робочі частоти + + + + Are you sure you want to discard your current working frequencies and replace them with the loaded ones? + Ви впевнені, що хочете відкинути поточні робочі частоти й замінити їх завантаженими? + + + + Merge Working Frequencies + Об'єднати робочі частоти + + + + Error reading frequency file + Помилка читання файлу частот + + + + + + Not a valid frequencies file + Це не файл частот + + + + Incorrect file magic + Хибна сигнатура файлу + + + + Version is too new + Версія занадто нова + + + + Contents corrupt + Вміст пошкоджено + + + + Save Working Frequencies + Зберегти робочі частоти + + + + Only Save Selected Working Frequencies + Зберегти лише позначені робочі частоти + + + + Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. + Ви впевнені, що хочете зберегти лише позначені робочі частоти? Натисніть «Ні», щоб зберегти всі. + + + + Reset Working Frequencies + Скинути робочі частоти + + + + Are you sure you want to discard your current working frequencies and replace them with default ones? + Ви впевнені, що хочете відкинути поточні робочі частоти й замінити їх типовими? + + + + Save Directory + Каталог збереження + + + + AzEl Directory + Каталог AzEl + + + + Rig control error + Помилка керування трансивером + + + + Failed to open connection to rig + Не вдалося встановити з'єднання з трансивером + + + + Cannot change radio settings while TX inhibit is active + + + + + Wait for the current inhibit hold to clear before applying settings that require restarting the radio. + + + + + Rig failure + Збій трансивера + + + + Not found + audio device missing + + + + + DXLabSuiteCommanderTransceiver + + + Failed to connect to DX Lab Suite Commander + + + + + + DX Lab Suite Commander didn't respond correctly reading frequency: + + + + + DX Lab Suite Commander sent an unrecognised TX state: + + + + + DX Lab Suite Commander didn't respond correctly polling TX status: + + + + + Transceiver did not respond to PTT On/Off quickly enough; +reduce DX Lab Suite Commander's 'Command Interval' setting +or contact DXLab support at DXLab@groups.io. + + + + + DX Lab Suite Commander didn't respond correctly polling frequency: + + + + + DX Lab Suite Commander didn't respond correctly polling TX frequency: + + + + + DX Lab Suite Commander sent an unrecognised split state: + + + + + DX Lab Suite Commander didn't respond correctly polling split status: + + + + + DX Lab Suite Commander sent an unrecognised mode: " + + + + + DX Lab Suite Commander didn't respond correctly polling mode: + + + + + DX Lab Suite Commander send command failed + + + + + + DX Lab Suite Commander send command failed "%1": %2 + + + + + + DX Lab Suite Commander send command "%1" read reply failed: %2 + + + + + + DX Lab Suite Commander retries exhausted sending command "%1" + + + + + DX Lab Suite Commander sent an unrecognized frequency + + + + + DecodeHighlightingListView + + + &Foreground color ... + Колір &тексту ... + + + + Choose %1 Foreground Color + Оберіть колір тексту для «%1» + + + + &Unset foreground color + &Скасувати колір тексту + + + + &Background color ... + Колір &тла ... + + + + Choose %1 Background Color + Оберіть колір тла для «%1» + + + + U&nset background color + С&касувати колір тла + + + + &Reset this item to defaults + &Повернути типові значення + + + + DecodeHighlightingModel + + + CQ in message + CQ у повідомленні + + + + My Call in message + Мій позивний у повідомленні + + + + Transmitted message + Передане повідомлення + + + + New DXCC + Нова країна + + + + New DXCC on Band + Нова країна на діапазоні + + + + New Grid + Новий локатор + + + + New Grid on Band + Новий локатор на діапазоні + + + + New Call + Новий позивний + + + + New Call on Band + Новий позивний на діапазоні + + + + New Continent + Новий континент + + + + New Continent on Band + Новий континент на діапазоні + + + + New CQ Zone + Нова зона CQ + + + + New CQ Zone on Band + Нова зона CQ на діапазоні + + + + New ITU Zone + Нова зона ITU + + + + New ITU Zone on Band + Нова зона ITU на діапазоні + + + + LoTW User + Користувач LoTW + + + + f/g unset + колір тексту не задано + + + + b/g unset + колір тла не задано + + + + Highlight Type + Вид виділення + + + + Designer + + + &Delete + &Видалити + + + + &Insert ... + &Вставити ... + + + + Insert &after ... + + + + + Import Palette + + + + + + Palettes (*.pal) + + + + + Import Palette Failed + + + + + Export Palette + + + + + Export Palette Failed + + + + + Error writing waterfall palette file "%1": %2. + + + + + Dialog + + + Gray time: + + + + + Directory + + + File + Файл + + + + Progress + + + + + + URL Error + + + + + + Invalid URL: +"%1" + + + + + + + + + + + JSON Error + + + + + Contents file syntax error %1 at character offset %2 + + + + + Contents file top level must be a JSON array + + + + + File System Error + + + + + Failed to open "%1" +Error: %2 - %3 + + + + + Contents entries must be a JSON array + + + + + Contents entries must have a valid type + + + + + Contents entries must have a valid name + + + + + Contents entries must be JSON objects + + + + + Contents directories must be relative and within "%1" + + + + + Network Error + Помилка мережі + + + + Authentication required + + + + + DisplayText + + + &Erase + &Очистити + + + + Return to live activity + + + + + Return to the live activity position + + + + + Live activity is paused while earlier entries are visible. + + + + + EchoGraph + + + + Echo Graph + Графік відлуння + + + + <html><head/><body><p>Compression factor for frequency scale</p></body></html> + <html><head/><body><p>Коефіцієнт стиснення шкали частот</p></body></html> + + + + Bins/Pixel + + + + + Gain + Підсилення + + + + <html><head/><body><p>Echo spectrum gain</p></body></html> + <html><head/><body><p>Підсилення спектра відлуння</p></body></html> + + + + Zero + Нуль + + + + <html><head/><body><p>Echo spectrum zero</p></body></html> + <html><head/><body><p>Нуль спектра відлуння</p></body></html> + + + + Baseline + Основа + + + + <html><head/><body><p>Smoothing of echo spectrum</p></body></html> + <html><head/><body><p>Згладжування спектра відлуння</p></body></html> + + + + Smooth + Згладж. + + + + <html><head/><body><p>Number of echo transmissions averaged</p></body></html> + <html><head/><body><p>Скільки передач відлуння усереднюється</p></body></html> + + + + N: 0 + + + + + <html><head/><body><p>Click to cycle through a sequence of colors and line widths.</p></body></html> + <html><head/><body><p>Клікніть, щоб перебрати послідовність кольорів і товщин ліній.</p></body></html> + + + + Colors + Кольори + + + + EmulateSplitTransceiver + + + Emulated split mode requires rig to be in simplex mode + + + + + EqualizationToolsDialog::impl + + + Equalization Tools + + + + + Phase + + + + + + Freq (Hz) + + + + + Phase (Π) + + + + + Delay (ms) + + + + + Measured + + + + + Proposed + + + + + Current + Поточний + + + + Group Delay + + + + + Amplitude + + + + + Relative Power (dB) + + + + + Reference + Опорний + + + + Phase ... + + + + + Refresh + Оновити + + + + Discard Measured + + + + + ExistingNameDialog + + + Configuration to Clone From + + + + + &Source Configuration Name: + + + + + ExportCabrillo + + + Dialog + Вікно + + + + Location: + Розташування: + + + + SNJ + + + + + Contest: + Змагання: + + + + ARRL-RTTY + + + + + Callsign: + Позивний: + + + + Category-Operator: + Категорія оператора: + + + + SINGLE-OP + + + + + Category-Transmitter: + Категорія передавача: + + + + ONE + + + + + Category-Power: + Категорія потужності: + + + + LOW + + + + + Category-Assisted: + Категорія допомоги: + + + + NON-ASSISTED + + + + + Category-Band: + Категорія діапазону: + + + + ALL + + + + + Claimed-Score: + Заявлений рахунок: + + + + Operators: + Оператори: + + + + Club: + Клуб: + + + + Name: + Ім'я: + + + + + Address: + Адреса: + + + + Save Log File + Зберегти файл журналу + + + + Cabrillo Log (*.cbr) + Журнал Cabrillo (*.cbr) + + + + Cannot open "%1" for writing: %2 + Не вдалося відкрити «%1» для запису: %2 + + + + Export Cabrillo File Error + Помилка експорту файлу Cabrillo + + + + FastGraph + + + + Fast Graph + Швидкий графік + + + + Waterfall gain + Підсилення водоспаду + + + + Waterfall zero + Нуль водоспаду + + + + Spectrum zero + Нуль спектра + + + + <html><head/><body><p>Set reasonable levels for gain and zero sliders.</p></body></html> + <html><head/><body><p>Встановити розумні значення повзунків підсилення та нуля.</p></body></html> + + + + Auto Level + + + + + FileDownload + + + Network Error - SSL/TLS support not installed, cannot fetch: +'%1' + Помилка мережі — підтримку SSL/TLS не встановлено, не вдалося отримати: +«%1» + + + + Network Error - Too many redirects: +'%1' + Помилка мережі — забагато переспрямувань: +«%1» + + + + Network Error: +%1 + Помилка мережі: +%1 + + + + FixtureAudioInput + + + Synthetic audio input has no detector sink. + + + + + Synthetic FT8 audio input requires a downsample factor of 1 or 4. + + + + + Synthetic JTTY audio input requires a downsample factor of 1 or 4. + + + + + Synthetic audio input requires the mono input channel. + + + + + Receive handoff fixture requires a downsample factor of 1. + + + + + Unable to initialize the detector for receive handoff input. + + + + + Synthetic receive handoff fixture ready + + + + + Unable to open synthetic audio fixture %1: %2 + + + + + Synthetic audio fixture must be mono, signed 16-bit little-endian PCM. + + + + + Synthetic audio fixture must be %1 Hz for downsample factor %2; found %3 Hz. + + + + + Synthetic FT8 audio fixture must contain exactly %1 frames; found %2. + + + + + Synthetic JTTY audio fixture must contain complete PCM frames. + + + + + Unable to read all PCM data from synthetic audio fixture. + + + + + Synthetic audio input does not yet support big-endian hosts. + + + + + Unable to initialize the detector for synthetic audio input. + + + + + Synthetic audio fixture ready + + + + + Synthetic audio input suspended + + + + + Synthetic audio input receiving + + + + + Invalid receive handoff checkpoint %1. + + + + + Receive handoff capture moved backwards: %1 to %2. + + + + + Detector did not accept handoff audio at %1. + + + + + Receive handoff sink is not a Detector. + + + + + FT8 rollover requires exhausted period A: frames=%1 emitting=%2. + + + + + FT8 rollover accepted %1 of %2 bytes. + + + + + Detector accepted %1 of %2 synthetic PCM bytes. + + + + + Synthetic audio fixture exhausted + + + + + FixtureSoundOutput + + + Synthetic audio output requires a readable source. + + + + + Synthetic audio output requires a capture path. + + + + + Synthetic audio output does not yet support big-endian hosts. + + + + + Synthetic audio output received an unsupported source frame size. + + + + + Unable to open synthetic audio output capture %1: %2 + + + + + Synthetic audio output received a partial captured frame. + + + + + Synthetic FT8 audio output exceeded its 15-second capture period. + + + + + Synthetic audio output wrote %1 of %2 capture bytes: %3 + + + + + Synthetic audio output source disappeared during capture. + + + + + Synthetic FT8 audio output continued beyond its 15-second capture period. + + + + + Synthetic audio output received %1 of %2 source bytes. + + + + + Synthetic audio output received an invalid source byte count. + + + + + FoxLog::impl + + + Date & Time(UTC) + Дата й &час (UTC) + + + + Call + Позивний + + + + Grid + Локатор + + + + Sent + + + + + Rcvd + Отримано + + + + Band + Діапазон + + + + FoxLogWindow + + + Fox Log + + + + + <html><head/><body><p>Right-click here for available actions.</p></body></html> + <html><head/><body><p>Правий клік — доступні дії.</p></body></html> + + + + Callers: + + + + + + + N + + + + + In progress: + У процесі: + + + + Rate: + Темп: + + + + <html><head/><body><p>Last 10: Average rate (QSOs/hour) for the last 10 QSOs.<br/>Last 100: Average rate (QSOs/hour) for the last 100 QSOs. <br/>Last 60m: Average rate (QSOs/hour) for the last 60 minutes.</span></p></body></html> + <html><head/><body><p>Останні 10: середній темп (QSO за годину) за останніми 10 зв'язками.</p></body></html> + + + + &Export ADIF ... + &Експорт ADIF ... + + + + Export ADIF Log File + Експорт файлу журналу ADIF + + + + ADIF Log (*.adi) + Журнал ADIF (*.adi) + + + + Export ADIF File Error + Помилка експорту файлу ADIF + + + + Cannot open "%1" for writing: %2 + Не вдалося відкрити «%1» для запису: %2 + + + + &Reset ... + &Скинути ... + + + + Confirm Reset + Підтвердіть скидання + + + + Are you sure you want to erase file FoxQSO.txt and start a new Fox log? + Ви впевнені, що хочете очистити файл FoxQSO.txt і почати новий журнал експедиції? + + + + FrequencyDeltaLineEdit + + + Offset in MHz + + + + + Frequency offset in MHz + + + + + Enter a frequency offset in MHz. + + + + + FrequencyDialog + + + Add Frequency + Додати частоту + + + + IARU &Region: + &Регіон IARU: + + + + &Mode: + + + + + &Frequency (MHz): + &Частота (МГц): + + + + &Preferred for Band/Mode: + &Бажана для діапазону й режиму: + + + + &Description: + &Опис: + + + + &Enable Date Range: + &Обмежити датами: + + + + S&tart: + &Початок: + + + + &End: + + + + + &Source: + &Джерело: + + + + Invalid Date Range + Хибний проміжок дат + + + + Start date must be before end date + Початкова дата має бути раніша за кінцеву + + + + FrequencyLineEdit + + + + Frequency in MHz + + + + + Enter a positive frequency in MHz. + + + + + FrequencyList_v2_101 + + + + IARU Region + Регіон IARU + + + + + Mode + Режим + + + + + Frequency + + + + + + Frequency (MHz) + Частота (МГц) + + + + + Description + Опис + + + + + Source + + + + + Start Time + + + + + End Time + + + + + + Pref + + + + + Start Date/Time + Дата й час початку + + + + End Date/Time + Дата й час завершення + + + + Failed to parse JSON file + Не вдалося розібрати файл JSON + + + + Information Missing + Бракує відомостей + + + + No Frequencies were found + Частот не знайдено + + + + Loaded Frequencies from %1 + Завантажено частоти з %1 + + + + Entries Valid/Skipped %1 + Записів дійсних/пропущено %1 + + + + Ft8TxLoopbackTestController + + + Timed out after 60 seconds. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + The FT8 output stream did not start exactly once. + + + + + The FT8 Auto control was not found. + + + + + Disabling Auto stopped the active FT8 transmission. + + + + + Synthetic output reported non-silent FT8 audio more than once. + + + + + The FT8 capture did not stop exactly once at the requested path. + + + + + Synthetic audio output failed: %1 + + + + + A required FT8 transmit GUI control was not found. + + + + + The application did not enter FT8 mode. + + + + + Unable to configure the requested FT8 transmission. + + + + + The FT8 transmit controls disappeared before transmission. + + + + + Unable to start the synthetic FT8 transmission. + + + + + The FT8 Auto control disappeared before retry. + + + + + The FT8 output lifecycle was not one start, non-silent transmission, and natural stop. + + + + + FT8 audio began at frame %1; expected %2 +/- %3 frames. + + + + + The FT8 capture file was not created or is empty: %1 + + + + + Unable to reopen FT8 capture %1: %2 + + + + + The FT8 capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The FT8 capture must contain exactly %1 frames; file=%2 reported=%3. + + + + + Unexpected modal window: %1 + + + + + HRDTransceiver + + + + Failed to connect to Ham Radio Deluxe + + + + + + Failed to open file "%1": %2. + + + + + + Ham Radio Deluxe: no rig found + + + + + Ham Radio Deluxe: rig doesn't support mode + + + + + Ham Radio Deluxe: sent an unrecognised mode + + + + + Ham Radio Deluxe: item not found in %1 dropdown list + + + + + Ham Radio Deluxe: button not available + + + + + Ham Radio Deluxe didn't respond as expected + + + + + Ham Radio Deluxe: rig has disappeared or changed + + + + + Ham Radio Deluxe send command "%1" failed %2 + + + + + + + Ham Radio Deluxe: failed to write command "%1" + + + + + Ham Radio Deluxe sent an invalid reply to our command "%1": %2 + + + + + Ham Radio Deluxe failed to reply to command "%1" %2 + + + + + + Ham Radio Deluxe retries exhausted sending command "%1" + + + + + Ham Radio Deluxe didn't respond to command "%1" as expected + + + + + HamlibTransceiver + + + Hamlib error: %1 while %2 + + + + + + + getting current VFO + + + + + + setting current VFO + + + + + setting a configuration item + + + + + + getting a configuration item + + + + + + Hamlib initialisation error + + + + + Unsupported CAT type + + + + + Hamlib settings file error: %1 at character offset %2 + + + + + Hamlib settings file error: top level must be a JSON object + + + + + Hamlib settings file error: config must be a JSON object + + + + + opening connection to rig + + + + + getting current frequency + + + + + getting current mode + + + + + + exchanging VFOs + + + + + + getting other VFO frequency + + + + + getting other VFO mode + + + + + getting frequency + + + + + getting mode + + + + + + + + getting current VFO frequency + + + + + + + + + + setting frequency + + + + + + + + getting current VFO mode + + + + + + + + + setting current VFO mode + + + + + + setting/unsetting split mode + + + + + + setting split mode + + + + + setting split TX frequency and mode + + + + + setting split TX frequency + + + + + getting split TX VFO mode + + + + + setting split TX VFO mode + + + + + getting PTT state + + + + + setting PTT on + + + + + + setting PTT off + + + + + IARURegions + + + All + + + + + Region 1 + + + + + Region 2 + + + + + Region 3 + + + + + + IARU Region + Регіон IARU + + + + JttyTxLoopbackTestController + + + Timed out after 60 seconds. + + + + + JTTY request %1 was accepted more than once. + + + + + JTTY request %1 was rejected with reason %2. + + + + + JTTY request %1 completed more than once. + + + + + More than one JTTY transmit session drained. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + JTTY output stream restarted more than once. + + + + + Synthetic output reported non-silent playback more than once. + + + + + Synthetic output stopped the wrong capture path: %1 + + + + + JTTY output stream stopped more than once. + + + + + Synthetic audio output failed: %1 + + + + + The JTTY mode action was not found. + + + + + The application did not enter JTTY mode. + + + + + The JTTY encoder did not produce a valid test waveform extent. + + + + + The first JTTY text request was not accepted synchronously. + + + + + Non-silent playback began before the first request was accepted. + + + + + The output stream restarted or stopped before the gapless append. + + + + + The gapless append occurred before one second of real playback. + + + + + The second JTTY text request was not accepted during playback. + + + + + Appending the second JTTY message restarted or stopped playback. + + + + + The accepted-request set did not contain exactly both submitted messages. + + + + + JTTY text requests were not accepted in submission order. + + + + + The completed-request set did not contain exactly both submitted messages. + + + + + JTTY text requests did not complete in FIFO order. + + + + + The output stream lifecycle was not one start, one drain, and one stop. + + + + + The captured JTTY session contains an unexpected internal audio gap. + + + + + The JTTY capture file was not created or is empty: %1 + + + + + Unable to reopen JTTY capture %1: %2 + + + + + The JTTY capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The JTTY capture has an invalid PCM extent: file frames=%1, expected audio frames=%2, reported frames=%3. + + + + + Unexpected modal window: %1 + + + + + LiveAudioTestController + + + Timed out after 110 seconds. + + + + + Timed out after 100 seconds. + + + + + Decoder backend restarted after FT8 publication. + + + + + Unexpected decoder cycle %1 after FT8 publication %2. + + + + + Decoder backend failed: %1 + + + + + Submitted FT8 completion mismatch: cycle=%1 expected=%2 count=%3 rollover=%4. + + + + + Submitted FT8 rollover rejected epoch=%1 range=[%2,%3). + + + + + Submitted FT8 rollover mismatch: epoch=%1 expected_epoch=%2 range=[%3,%4) expected_start=%5 generation=%6. + + + + + JTTY display did not settle to the expected text after input ended. + + + + + Synthetic audio source failed: %1 + + + + + FT8 rollover requires one final publication outside receive DSP. + + + + + FT8 final invocation has no committed decoder publication. + + + + + Unable to queue the FT8 rollover prefix. + + + + + Timed out awaiting FT8 rollover: generation=%1 previous_epoch=%2. + + + + + FT8 rollover did not preserve active publication: epoch=%1 accepted=%2 end=%3 rejected=%4 generation=%5 active=%6. + + + + + Unable to open expected decode file %1: %2 + + + + + Expected decode file %1 contains no messages. + + + + + Unable to open expected JTTY text file %1: %2 + + + + + Expected JTTY text file %1 contains no messages. + + + + + A required FT8 decoder or monitoring GUI control was not found. + + + + + Unable to configure the %1-%2 Hz waterfall decode range. + + + + + Unable to prepare the complete FT8 fixture decode. + + + + + Unable to configure the FT8 multithreaded decoder as requested. + + + + + Monitor did not enter the active state. + + + + + Synthetic input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic audio source. + + + + + A required JTTY mode, monitoring, or decode display control was not found. + + + + + The JTTY GUI action did not select JTTY mode. + + + + + Monitor did not enter the active state for JTTY. + + + + + Synthetic JTTY input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic JTTY audio source. + + + + + The expected early standard and final configured MTD decoder invocations were not both observed. + + + + + The configured MTD invocation produced no decoder output. + + + + + live MTD missing: %1 + + + + + processed missing: %1 + + + + + display missing: %1 + + + + + Reference-message validation failed: %1; live MTD output: %2; processed output: %3 + + + + + Decoder messages were processed but none reached the GUI display path. + + + + + The expected JTTY messages did not reach both panes in FIFO order. + + + + + The expected JTTY message reached both panes without an observed growing prefix. + + + + + Unexpected modal window: %1 + + + + + LogQSO + + + Click OK to confirm the following QSO: + Натисніть «Гаразд», щоб підтвердити зв'язок: + + + + Call + Позивний + + + + Start + Початок + + + + + dd/MM/yyyy HH:mm:ss + + + + + End + Кінець + + + + Mode + Режим + + + + Band + Діапазон + + + + Rpt Sent + Рапорт надано + + + + Rpt Rcvd + Рапорт отримано + + + + Grid + Локатор + + + + Name + Ім'я + + + + Tx power + Потужність + + + + <html><head/><body><p>Add comment to the comments list.</p></body></html> + <html><head/><body><p>Додати коментар до переліку коментарів.</p></body></html> + + + + Add + Додати + + + + + + + + + Retain + Зберігати + + + + Comments + Коментар + + + + Operator + Оператор + + + + Exch sent + Надіслано обмін + + + + Rcvd + Отримано + + + + Prop Mode + Вид проходження + + + + + Satellite + Супутник + + + + Sat Mode + Режим супутника + + + + RX Frequency + Частота прийому + + + + Aircraft scatter + Розсіяння на літаках + + + + Aurora-E + Полярне сяйво E + + + + Aurora + Полярне сяйво + + + + Back scatter + Зворотне розсіяння + + + + Echolink + + + + + Earth-moon-earth + Земля — Місяць — Земля + + + + Sporadic E + Спорадичний шар E + + + + F2 Reflection + Відбиття від шару F2 + + + + Field aligned irregularities + Неоднорідності вздовж магнітного поля + + + + Internet-assisted + За участю інтернету + + + + Ionoscatter + Іоносферне розсіяння + + + + IRLP + + + + + Meteor scatter + Метеорне розсіяння + + + + Non-satellite repeater or transponder + Несупутниковий ретранслятор або транспондер + + + + Rain scatter + Розсіяння на дощі + + + + Trans-equatorial + Трансекваторіальне проходження + + + + Tropospheric ducting + Тропосферний хвилевід + + + + A + + + + + B + + + + + BS + + + + + JA + + + + + JD + + + + + K + + + + + KA + + + + + KT + + + + + L + + + + + LS + + + + + LU + + + + + LX + + + + + S + + + + + SX + + + + + T + + + + + US + + + + + UV + + + + + VS + + + + + VU + + + + + + Invalid QSO Data + Хибні дані зв'язку + + + + Check exchange sent and received + Перевірте надісланий і отриманий обмін + + + + Check all fields + Перевірте всі поля + + + + Log file error + Помилка файлу журналу + + + + Cannot open "%1" for append + Не вдалося відкрити «%1» для дозапису + + + + Error: %1 + Помилка: %1 + + + + MainWindow + + + + + + + + + + + Band Activity + Активність на діапазоні + + + + + UTC dB DT Freq Dr + + + + + + + + + + + Rx Frequency + Частота прийому + + + + 40 + + + + + + + 10 + + + + + 17 + + + + + 60 + + + + + + 12 + + + + + 160 + + + + + 20 + + + + + 80 + + + + + + 70 + + + + + 15 + + + + + + + + + + 2 + + + + + 30 + + + + + + + + 6 + + + + + 24G + + + + + 10G + + + + + 5G + + + + + + + 9 + + + + + 13 + + + + + 23 + + + + + 33 + + + + + 1.25 + + + + + + 4 + + + + + + 8 + + + + + Adjust transmit drive level + + + + + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the strongest station's reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the weakest station's reply to your CQ.</p><p>When CQ or QRZ is pending, Enable Tx may be armed before or during a receive period. Only eligible direct callers decoded after it is armed in that period can replace the pending transmission; earlier callers are not retained.</p></body></html> + + + + + + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to toggle the checkbox enabled/disabled. Fox and Hound modes lock the required sequence.</p></body></html> + + + + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + + GroupBox + + + + + CQ %M CQ + + + + + %H 599 %N + + + + + %H TU CQ %M CQ + + + + + %M + + + + + %H + + + + + TU NOW %Q 599 %N + + + + + %H AGN? + + + + + 599 %N + + + + + F1 + + + + + HisCall Exchange + + + + + F2 + + + + + TU CQ + + + + + F3 + + + + + MyCall + + + + + F4 + + + + + HisCall + + + + + F5 + + + + + Now QueuedCall Exchange + + + + + F6 + + + + + HisCall AGN ? + + + + + Exchange + + + + + Serial number of QSO for contest exchange. + + + + + Send and clear the message. Press Enter in the field. + + + + + Send message + + + + + Call next + + + + + Press Enter to send and clear the message. + + + + + Serial Number + + + + + Callsign to be worked next. + + + + + CQ messages only. + Лише повідомлення CQ. + + + + CQ only + Лише CQ + + + + Bypass Filters toggled via Settings or the Filters menu. + Обхід фільтрів вмикається в налаштуваннях або в меню фільтрів. + + + + BP + + + + + Enter this QSO in log + Записати це QSO в журнал + + + + WSJT-X by K1JT et al. + + + + + Band Activity decode pane title + + + + + Title for the Band Activity decoded messages pane. + + + + + Band Activity decoded messages headings + + + + + + Columns: UTC dB DT Freq Message. + + + + + Band Activity decoded messages + + + + + Decoded messages in the Band Activity pane. Columns: UTC dB DT Freq Message. + + + + + Rx Frequency decode pane title + + + + + Title for the Rx Frequency decoded messages pane. + + + + + Rx Frequency decoded messages headings + + + + + Rx Frequency decoded messages + + + + + Decoded messages in the Rx Frequency pane. Columns: UTC dB DT Freq Message. + + + + + Check to display received messages in lower case. + + + + + Lower case + + + + + Include Time + + + + + Log &QSO + Записати &QSO + + + + Stop monitoring + Зупинити прослуховування + + + + &Stop + &Стоп + + + + <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> + <html><head/><body><p>Увімкнути або вимкнути прослуховування.<br>Жовтий — коли зберігаються файли .wav.</p></body></html> + + + + &Monitor + &Прослуховування + + + + <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> + <html><head/><body><p>Очистити праве вікно. Подвійний клік очищає обидва.</p></body></html> + + + + Erase right window. Double-click to erase both windows. + Очистити праве вікно. Подвійний клік очищає обидва. + + + + &Erase + &Очистити + + + + <html><head/><body><p>Clear the accumulating message average.</p></body></html> + <html><head/><body><p>Очистити накопичене усереднення повідомлень.</p></body></html> + + + + Clear the accumulating message average. + Очистити накопичене усереднення повідомлень. + + + + Clear Avg + Очистити усер. + + + + Avg + Усер. + + + + <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> + <html><head/><body><p>Декодувати останній період прийому на частоті зв'язку</p></body></html> + + + + Decode most recent Rx period at QSO Frequency + Декодувати останній період прийому на частоті зв'язку + + + + &Decode + &Декодувати + + + + <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> + <html><head/><body><p>Увімкнути або вимкнути автоматичну передачу</p></body></html> + + + + Toggle Auto-Tx On/Off + Увімкнути або вимкнути автоматичну передачу + + + + E&nable Tx + Доз&волити передачу + + + + Stop transmitting immediately + Негайно припинити передачу + + + + &Halt Tx + &Припинити передачу + + + + <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> + <html><head/><body><p>Увімкнути або вимкнути чистий тон передачі<br>Правий клік — налаштувати трансивер</p></body></html> + + + + Toggle a pure Tx tone On/Off + Увімкнути або вимкнути чистий тон передачі + + + + &Tune + &Налаштування тоном + + + + + Menus + Меню + + + + <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> + <html><head/><body><p>Увімкнути або вимкнути очікування й виклик. Правий клік очищає поле позивного DX.</p></body></html> + + + + DX Call + Позивний DX + + + + Callsign of station to be worked + Позивний станції, з якою проводиться зв'язок + + + + DX Grid + Локатор DX + + + + Locator of station to be worked + Локатор станції, з якою проводиться зв'язок + + + + Az: 251 16553 km + + + + + <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> + <html><head/><body><p>Шукати позивний у базі.<br>Правий клік шукає позивний в інтернеті.</p></body></html> + + + + &Lookup + &Пошук + + + + <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> + <html><head/><body><p>Додати позивний і локатор до бази.<br>Правий клік шукає позивний в інтернеті.</p></body></html> + + + + Add + Додати + + + + <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> + <html><head/><body><p>Додати позивний до списку ігнорованих.<br>Правий клік шукає позивний в інтернеті.</p></body></html> + + + + Ignore + Ігнорувати + + + + + Pwr + Пот. + + + + + % + + + + + NB + + + + + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> + <html><head/><body><p>Рекомендовано 30 дБ, коли є лише шум<br/>Зелений — добре<br/>Червоний — можливе обмеження<br/>Жовтий — замало</p></body></html> + + + + Rx Signal + Сигнал прийому + + + + 30dB recommended when only noise present +Green when good +Red when clipping may occur +Yellow when too low + Рекомендовано 30 дБ, коли є лише шум +Зелений — добре +Червоний — можливе обмеження +Жовтий — замало + + + + <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> + <html><head/><body><p>Частота для виклику CQ, у кілогерцях понад поточні мегагерци</p></body></html> + + + + Frequency to call CQ on in kHz above the current MHz + Частота для виклику CQ, у кілогерцях понад поточні мегагерци + + + + Tx CQ + + + + + <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> + <html><head/><body><p>Позначте, щоб викликати CQ на частоті «Tx CQ». Прийом лишатиметься на поточній частоті, а повідомлення CQ міститиме частоту прийому.</p><p>Недоступно для власників нестандартних позивних.</p></body></html> + + + + Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. +Not available to nonstandard callsign holders. + Позначте, щоб викликати CQ на частоті «Tx CQ». Прийом лишатиметься на поточній частоті, а повідомлення CQ міститиме частоту прийому. +Недоступно для власників нестандартних позивних. + + + + Decode other Hounds calling above 1000 Hz audio offset + Декодувати інших мисливців, що викликають вище 1000 Гц + + + + Rx All Freqs + Приймати всі частоти + + + + + Fox + + + + + <html><head/><body><p>Check to monitor Sh messages.</p></body></html> + <html><head/><body><p>Позначте, щоб приймати короткі повідомлення.</p></body></html> + + + + Check to monitor Sh messages. + Позначте, щоб приймати короткі повідомлення. + + + + SWL + + + + + Enable auto response to the first decode from a new DXCC or new call on the current band. + Автоматично відповідати на перший декод із нової країни або нового позивного на поточному діапазоні. + + + + Best S+P + + + + + <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> + <html><head/><body><p>Позначте, щоб почати запис даних калібрування.<br/>Під час вимірювання поправка калібрування не застосовується.</p></body></html> + + + + Check this to start recording calibration data. +While measuring calibration correction is disabled. +When not checked you can view the calibration results. + Позначте, щоб почати запис даних калібрування. +Під час вимірювання поправка калібрування не застосовується. +Якщо не позначено, поправка застосовується. + + + + Measure + Вимір + + + + <html><head/><body><p>Check to use short-format messages.</p></body></html> + <html><head/><body><p>Позначте, щоб використовувати короткі повідомлення.</p></body></html> + + + + Check to use short-format messages. + Позначте, щоб використовувати короткі повідомлення. + + + + Sh + + + + + <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> + <html><head/><body><p>Позначте, щоб увімкнути швидкі режими JT9</p></body></html> + + + + Check to enable JT9 fast modes + Позначте, щоб увімкнути швидкі режими JT9 + + + + + Fast + Швидкий + + + + <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> + <html><head/><body><p>Позначте, щоб повідомлення на передачу вибудовувалися автоматично за отриманими.</p></body></html> + + + + Check to enable automatic sequencing of Tx messages based on received messages. + Позначте, щоб повідомлення на передачу вибудовувалися автоматично за отриманими. + + + + Auto Seq + Автопосл. + + + + Check to generate "@1250 (SEND MSGS)" in Tx6. + Позначте, щоб створювати «@1250 (SEND MSGS)» у Tx6. + + + + Tx6 + + + + + Tx even/1st + Передача в парні/1-ші + + + + + Audio Tx frequency + Звукова частота передачі + + + + + + + + + + + Hz + + + + + + + + Tx + + + + + + + + Set Tx frequency to Rx Frequency + Встановити частоту передачі рівною частоті прийому + + + + + ▲ + + + + + + Frequency tolerance (Hz) + Допуск частоти (Гц) + + + + + + + F Tol + + + + + + + + Set Rx frequency to Tx Frequency + Встановити частоту прийому рівною частоті передачі + + + + + ▼ + + + + + + Audio Rx frequency + Звукова частота прийому + + + + + + + Rx + + + + + <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> + <html><head/><body><p>Рапорт: відношення сигнал/шум у смузі 2500 Гц (дБ).</p></body></html> + + + + Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). + Рапорт: відношення сигнал/шум у смузі 2500 Гц (дБ). + + + + + Report + Рапорт + + + + <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> + <html><head/><body><p>Довжина послідовності калібрування прийому, передачі або частоти</p></body></html> + + + + Tx/Rx or Frequency calibration sequence length + Довжина послідовності калібрування прийому, передачі або частоти + + + + + s + с + + + + + + T/R + + + + + <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> + <html><head/><body><p>Перемкнути на період 15 с і підрежим C.</p></body></html> + + + + 15C + + + + + <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> + <html><head/><body><p>Перемкнути на період 15 с і підрежим A.</p></body></html> + + + + 15A + + + + + <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> + <html><head/><body><p>Перемкнути на період 30 с і підрежим B.</p></body></html> + + + + 30B + + + + + <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> + <html><head/><body><p>Перемкнути на період 60 с і підрежим C.</p></body></html> + + + + 60C + + + + + <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> + <html><head/><body><p>Перемкнути на період 60 с і підрежим D.</p></body></html> + + + + 60D + + + + + <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> + <html><head/><body><p>Перемкнути на період 60 с і підрежим E.</p></body></html> + + + + 60E + + + + + <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> + <html><head/><body><p>Позначте, щоб частота передачі не змінювалася при подвійному кліку на декодованому тексті.</p></body></html> + + + + Check to keep Tx frequency fixed when double-clicking on decoded text. + Позначте, щоб частота передачі не змінювалася при подвійному кліку на декодованому тексті. + + + + Hold Tx Freq + Утримувати частоту передачі + + + + Tx# + + + + + F Low + + + + + F High + + + + + <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> + <html><head/><body><p>Підрежим задає крок між тонами; A — найвужчий.</p></body></html> + + + + Submode determines tone spacing; A is narrowest. + Підрежим задає крок між тонами; A — найвужчий. + + + + + Submode + Підрежим + + + + <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> + <html><head/><body><p>Поріг синхронізації. Менші значення приймають слабші сигнали синхронізації.</p></body></html> + + + + Synchronizing threshold. Lower numbers accept weaker sync signals. + Поріг синхронізації. Менші значення приймають слабші сигнали синхронізації. + + + + Sync + + + + + Maximum drift rate in units of symbol rate per transmission. + Найбільший дрейф частоти в символьних швидкостях за передачу. + + + + + Max Drift + Макс. дрейф + + + + + + 1 + + + + + + + Send this message in next Tx interval + Надіслати це повідомлення в наступному інтервалі передачі + + + + Ctrl+6 + + + + + Queue up the next Tx message + Поставити в чергу наступне повідомлення + + + + Next + Наступне + + + + Ctrl+4 + + + + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + <html><head/><body><p>Надіслати це повідомлення в наступному інтервалі передачі</p><p>Подвійний клік вмикає або вимикає початок QSO з повідомлення Tx1 (недоступно для складених позивних 2-го типу).</p></body></html> + + + + Send this message in next Tx interval +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + Надіслати це повідомлення в наступному інтервалі передачі +Подвійний клік вмикає або вимикає початок QSO з повідомлення Tx1 (недоступно для складених позивних 2-го типу). + + + + Ctrl+1 + + + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> + <html><head/><body><p>Перемкнутися на це повідомлення ЗАРАЗ</p><p>Подвійний клік повертає типове повідомлення.</p><p>Клік правою кнопкою зберігає вільний текст Tx5.</p></body></html> + + + + Tx &5 + + + + + Alt+5 + + + + + + + + Switch to this Tx message NOW + Перемкнутися на це повідомлення ЗАРАЗ + + + + Tx &2 + + + + + Alt+2 + + + + + Now + Зараз + + + + Ctrl+2 + + + + + Generate standard messages for minimal QSO + Створити стандартні повідомлення для мінімального QSO + + + + Generate Std Msgs + Стандартні повідомлення + + + + Tx &3 + + + + + Alt+3 + + + + + Tx &4 + + + + + Alt+4 + + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + <html><head/><body><p>Перемкнутися на це повідомлення ЗАРАЗ</p><p>Подвійний клік вмикає або вимикає початок QSO з повідомлення Tx1 (недоступно для складених позивних 2-го типу).</p></body></html> + + + + Switch to this Tx message NOW +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + Перемкнутися на це повідомлення ЗАРАЗ +Подвійний клік вмикає або вимикає початок QSO з повідомлення Tx1 (недоступно для складених позивних 2-го типу). + + + + Tx &1 + + + + + Alt+1 + + + + + Tx &6 + + + + + Alt+6 + + + + + Ctrl+3 + + + + + Enter a free text message (maximum 13 characters) +or select a predefined macro from the dropdown list. +Press ENTER to add the current text to the predefined +list. The list can be maintained in Settings (F2). + Введіть довільне повідомлення (не більше 13 символів) +або оберіть готовий макрос зі списку. +ENTER додає введене до списку макросів. + + + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> + <html><head/><body><p>Надіслати це повідомлення в наступному інтервалі передачі</p><p>Подвійний клік повертає стандартне повідомлення 73.</p></body></html> + + + + Send this message in next Tx interval +Double-click to reset to the standard 73 message + Надіслати це повідомлення в наступному інтервалі передачі +Подвійний клік повертає стандартне повідомлення 73 + + + + Ctrl+5 + + + + + <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> + <html><head/><body><p>Передати повідомлення довільним текстом за першої нагоди.</p></body></html> + + + + Send msg + Надіслати повідомлення + + + + <html><head/><body><p>Enter a free text message.</p></body></html> + <html><head/><body><p>Введіть повідомлення довільним текстом.</p></body></html> + + + + Free Text + Довільний текст + + + + <html><head/><body><p>Select a specific CQ message.</p></body></html> + <html><head/><body><p>Оберіть конкретне повідомлення CQ.</p></body></html> + + + + + + CQ + + + + + CQ AF + + + + + CQ AN + + + + + CQ AS + + + + + CQ EU + + + + + CQ NA + + + + + CQ OC + + + + + CQ SA + + + + + CQ 0 + + + + + CQ 1 + + + + + CQ 2 + + + + + CQ 3 + + + + + CQ 4 + + + + + CQ 5 + + + + + CQ 6 + + + + + CQ 7 + + + + + CQ 8 + + + + + CQ 9 + + + + + Queue + Черга + + + + Allow Dupes + Дозволити повтори + + + + <html><head/><body><p>Clear all queues.</p></body></html> + <html><head/><body><p>Очистити всі черги.</p></body></html> + + + + Reset + Скинути + + + + <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> + <html><head/><body><p>Скільки позивних показувати в черзі щонайбільше.</p></body></html> + + + + N List + + + + + <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> + <html><head/><body><p>Оберіть бажаний порядок сортування позивних у черзі.</p></body></html> + + + + + + Random + Випадково + + + + Call + Позивний + + + + Grid + Локатор + + + + S/N (dB) + + + + + Distance + Відстань + + + + Age + Вік + + + + Continent + Континент + + + + Score + Рахунок + + + + <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> + <html><head/><body><p>Додавати повідомлення CQ разом з іншими.</p></body></html> + + + + More CQs + Більше CQ + + + + In Progress + У процесі + + + + <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> + <html><head/><body><p>Скільки одночасних потоків передачі експедиції щонайбільше.</p></body></html> + + + + N Slots + + + + + + + + 3 + + + + + 70cm FT8 + + + + + 70cm + + + + + 30m FT8 + + + + + 30m + + + + + <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> + <html><head/><body><p>Увімкнути або вимкнути перехід між діапазонами. Перехід відбувається щохвилини через одну.</p></body></html> + + + + Band Hopping + Перехід діапазонами + + + + 12m FT8 + + + + + 12m + + + + + 40m FT8 + + + + + 40m + + + + + 2m MSK144 + + + + + 2m MSK + + + + + 10m FT8 + + + + + 10m + + + + + 6m FT8 + + + + + 6m + + + + + 60m FT8 + + + + + 60m + + + + + 160m FT8 + + + + + 160m + + + + + 80m FT8 + + + + + 80m + + + + + 20m FT8 + + + + + 20m + + + + + 17m FT8 + + + + + 17m + + + + + 4m FT8 + + + + + 4m + + + + + 15m FT8 + + + + + 15m + + + + + 2m FT8 + + + + + 2m + + + + + + 10m FT4 + + + + + + 12m FT4 + + + + + + 15m FT4 + + + + + + 17m FT4 + + + + + + 20m FT4 + + + + + + 30m FT4 + + + + + + 40m FT4 + + + + + + 80m FT4 + + + + + FT8 QRG6 + + + + + FT8 QRG1 + + + + + FT8 QRG2 + + + + + FT8 QRG7 + + + + + FT8 QRG8 in kHz. + Частота FT8 №8, кГц. + + + + FT8 QRG5 + + + + + FT8 QRG3 + + + + + FT8 QRG4 + + + + + FT8 QRG8 + + + + + FT8 QRG7 in kHz. + Частота FT8 №7, кГц. + + + + FT8 QRG6 in kHz. + Частота FT8 №6, кГц. + + + + FT8 QRG5 in kHz. + Частота FT8 №5, кГц. + + + + FT8 QRG4 in kHz. + Частота FT8 №4, кГц. + + + + FT8 QRG3 in kHz. + Частота FT8 №3, кГц. + + + + FT8 QRG2 in kHz. + Частота FT8 №2, кГц. + + + + FT8 QRG1 in kHz. + Частота FT8 №1, кГц. + + + + JTTY + + + + + Percentage of minute sequences devoted to transmitting. + Відсоток хвилинних періодів, відведених на передачу. + + + + Tx Pct + + + + + Band Hopping + Перехід діапазонами + + + + Choose bands and times of day for band-hopping. + Оберіть діапазони й час доби для переходу між діапазонами. + + + + Schedule ... + Розклад ... + + + + Upload decoded messages to WSPRnet.org. + Вивантажувати декодовані повідомлення на WSPRnet.org. + + + + Upload spots + Вивантажувати споти + + + + <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> + <html><head/><body><p>Шестизначні локатори призводять до надсилання двох різних повідомлень: друге містить повний локатор, але лише хешований позивний. Позначте, якщо надаєте перевагу повідомленням 1-го типу з чотиризначним локатором.</p></body></html> + + + + 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. + Шестизначні локатори призводять до надсилання двох різних повідомлень: друге містить повний локатор, але лише хешований позивний. Позначте, якщо надаєте перевагу повідомленням 1-го типу з чотиризначним локатором. + + + + Prefer Type 1 messages + Надавати перевагу повідомленням 1-го типу + + + + No own call decodes + Без декодів власного позивного + + + + <html><head/><body><p>Transmit during the next sequence.</p></body></html> + <html><head/><body><p>Передавати в наступному періоді.</p></body></html> + + + + Tx Next + + + + + Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. + Задайте потужність передачі в дБм (дБ понад 1 мВт) як частину повідомлення WSPR. + + + + + + + + + + + + + + + + + + + Message + Повідомлення + + + + Spacing + + + + + Fixed Tone + + + + + K1JT + + + + + CW + + + + + + USB dial frequency + Частота на шкалі, USB + + + + 14.078 000 + + + + + Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. + Увімкнути або вимкнути режим мисливця FT8.<br>Правий клік вмикає або вимикає режим SuperFox. + + + + H + + + + + Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. + Перемкнути в режим FT8.<br>Правий клік вмикає або вимикає останній використаний режим змагань. + + + + + FT8 + + + + + Switch to FT4 mode + Перемкнути в режим FT4 + + + + + FT4 + + + + + Switch to MSK144 mode + Перемкнути в режим MSK144 + + + + MSK + + + + + <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> + <html><head/><body><p>Перемкнути в режим Q65.<br> Правий клік перемикає в режим Q65 Pileup.</p></body></html> + + + + + Q65 + + + + + <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> + <html><head/><body><p>Перемкнути в режим JT65.<br>Правий клік перемикає в режим JT9.</p></body></html> + + + + + JT65 + + + + + <html><head/><body><p>Switch to Echo mode</p></body></html> + <html><head/><body><p>Перемкнути в режим Echo</p></body></html> + + + + + Echo + + + + + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> + + + + + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> + <html><head/><body><p>Оберіть робочий діапазон, або введіть частоту в мегагерцах, або введіть приріст у кілогерцах із літерою k.</p></body></html> + + + + Frequency entry + Введення частоти + + + + Select operating band or enter frequency in MHz or enter kHz increment followed by k. + Оберіть робочий діапазон, або введіть частоту в мегагерцах, або введіть приріст у кілогерцах із літерою k. + + + + <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> + <html><head/><body><p>Помаранчевий або червоний означає збій керування трансивером; натисніть, щоб скинути й зчитати частоту зі шкали. «S» означає рознесення частот.</p></body></html> + + + + If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. + Помаранчевий або червоний означає збій керування трансивером; натисніть, щоб скинути й зчитати частоту зі шкали. «S» означає рознесення частот. + + + + ? + + + + + File + Файл + + + + View + Вигляд + + + + Filters + Фільтри + + + + Decode + Декодування + + + + Parameters + Параметри + + + + Decoder sensitivity + Чутливість декодера + + + + Decoder start + Початок декодування + + + + Number of threads + Кількість потоків + + + + QSO RX freq sensitivity + Чутливість на частоті QSO + + + + Decoding cycles + Цикли декодування + + + + Save + Зберегти + + + + Help + Довідка + + + + + Mode + Режим + + + + Configurations + Конфігурації + + + + Tools + Інструменти + + + + Exit + Вихід + + + + About WSJT-X + Про WSJT-X + + + + Waterfall + Водоспад + + + + Open + Відкрити + + + + Ctrl+O + + + + + Open next in directory + Відкрити наступний у каталозі + + + + Ctrl+X + + + + + Decode remaining files in directory + Декодувати решту файлів у каталозі + + + + Delete all *.wav && *.c2 files in SaveDir + Видалити всі файли *.wav і *.c2 з каталогу збереження + + + + None + Немає + + + + Save all + Зберегти все + + + + Remove saved files after 30 days + Видаляти збережені файли через 30 днів + + + + Online User Guide + Посібник в інтернеті + + + + Keyboard shortcuts + Клавіатурні скорочення + + + + Special mouse commands + Особливі дії мишею + + + + JT9 + + + + + Save decoded + Зберегти декодовані + + + + + Normal + Звичайний + + + + Deep + Глибокий + + + + Erase ALL.TXT + Очистити ALL.TXT + + + + Erase wsjtx_log.adi + Очистити wsjtx_log.adi + + + + Erase wsjtx.log + Очистити wsjtx.log + + + + Erase Ignore List + Очистити список ігнорованих + + + + Astronomical data + Астрономічні дані + + + + List of Type 1 prefixes and suffixes + Перелік префіксів і суфіксів 1-го типу + + + + Settings... + Налаштування... + + + + Local User Guide + Посібник на цьому комп'ютері + + + + Open log directory + Відкрити каталог журналу + + + + JT4 + + + + + Message averaging + Усереднення повідомлень + + + + F7 + + + + + Alt+X + + + + + Enable averaging + Увімкнути усереднення + + + + Enable deep search + Увімкнути глибокий пошук + + + + WSPR + + + + + Echo Graph + Графік відлуння + + + + F8 + + + + + EME Echo mode + Режим відлуння EME + + + + ISCAT + + + + + Fast Graph + Швидкий графік + + + + &Download Samples ... + &Завантажити зразки ... + + + + <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> + <html><head/><body><p>Завантажити зразки звукових файлів для різних режимів.</p></body></html> + + + + MSK144 + + + + + QRA64 + + + + + Release Notes + Примітки до випуску + + + + Enable AP for DX Call + Увімкнути апріорне декодування для позивного DX + + + + FreqCal + + + + + Measure reference spectrum + Виміряти опорний спектр + + + + Measure phase response + Виміряти фазову характеристику + + + + Erase reference spectrum + Стерти опорний спектр + + + + Execute frequency calibration cycle + Виконати цикл калібрування частоти + + + + Equalization tools ... + Засоби вирівнювання ... + + + + + Enable AP + Апріорне декодування + + + + Solve for calibration parameters + Обчислити параметри калібрування + + + + Copyright notice + Відомості про авторські права + + + + Shift+F1 + + + + + Fox log + Журнал експедиції + + + + FT8 DXpedition Mode User Guide + Посібник із режиму експедиції FT8 + + + + Reset Cabrillo log ... + Скинути журнал Cabrillo ... + + + + Color highlighting scheme + Схема кольорового виділення + + + + Export Cabrillo log ... + Експортувати журнал Cabrillo ... + + + + Quick-Start Guide to FST4 and FST4W + Короткий вступ до FST4 і FST4W + + + + Contest log + Журнал змагань + + + + Erase WSPR hashtable + Очистити хеш-таблицю WSPR + + + + FST4 + + + + + FST4W + + + + + SWL Mode + Режим SWL + + + + Hide lower panel controls to maximize deocde windows + Приховати нижню панель, щоб збільшити вікна декодування + + + + Quick-Start Guide to Q65 + Короткий вступ до Q65 + + + + Auto Clear Avg after decode + Автоматично очищати усереднення після декодування + + + + Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 + Короткий вступ до WSJT-X 2.5.0 і MAP65 3.0 + + + + Don't split ALL.TXT + Не розділяти ALL.TXT + + + + Split ALL.TXT yearly + Розділяти ALL.TXT щороку + + + + Split ALL.TXT monthly + Розділяти ALL.TXT щомісяця + + + + Disable writing of ALL.TXT + Не вести ALL.TXT + + + + Active Stations + Активні станції + + + + Band Buttons + Кнопки діапазонів + + + + Use Dark Style + Темне оформлення + + + + Reduce false decodes + Менше хибних декодів + + + + Default event logging + Типове журналювання подій + + + + Diagnostic mode + Діагностичний режим + + + + Disable event logging + Вимкнути журналювання подій + + + + Quick-Start Guide to WSJT-X 2.7 and QMAP + Короткий вступ до WSJT-X 2.7 і QMAP + + + + How to deal with rig control errors + Що робити при збоях керування трансивером + + + + <html><head/><body><p>How to deal with rig control errors.</p></body></html> + <html><head/><body><p>Що робити при збоях керування трансивером.</p></body></html> + + + + Erase list of Q65 callers + Очистити перелік станцій, які викликали в Q65 + + + + SuperFox User Guide + Посібник із SuperFox + + + + Message Creator + Створювач повідомлень + + + + Hide stations worked before on band + Ховати станції, з якими вже був зв'язок на цьому діапазоні + + + + Hide stations worked today or yesterday + Ховати станції, з якими був зв'язок сьогодні або вчора + + + + Hide stations from Ignore List + Ховати станції зі списку ігнорованих + + + + Ignore stations worked today or yesterday + Ігнорувати станції, з якими був зв'язок сьогодні або вчора + + + + Ignore stations from Ignore List + Ігнорувати станції зі списку ігнорованих + + + + Hide stations from Territory 1 + Ховати станції з території 1 + + + + Hide stations from Territory 2 + Ховати станції з території 2 + + + + Hide stations from Territory 3 + Ховати станції з території 3 + + + + Hide stations from Territory 4 + Ховати станції з території 4 + + + + Hide stations from Europe + Ховати станції з Європи + + + + Hide stations from North America + Ховати станції з Північної Америки + + + + Hide stations from South America + Ховати станції з Південної Америки + + + + Hide stations from Asia + Ховати станції з Азії + + + + Hide stations from Africa + Ховати станції з Африки + + + + Hide stations from Oceania + Ховати станції з Океанії + + + + Hide stations from Antarctica + Ховати станції з Антарктиди + + + + Full Duplex Mode + Повнодуплексний режим + + + + Highlight callsigns worked before on band + Виділяти позивні, з якими вже був зв'язок на цьому діапазоні + + + + Highlight callsigns worked today or yesterday + Виділяти позивні, з якими був зв'язок сьогодні або вчора + + + + Highlight callsigns from Ignore List + Виділяти позивні зі списку ігнорованих + + + + Enable Message Popups + Показувати спливні повідомлення + + + + QSY Monitor + Спостереження за QSY + + + + Ignore stations worked before on band + Ігнорувати станції, з якими вже був зв'язок на цьому діапазоні + + + + Use multithreaded FT8 decoder + Багатопотоковий декодер FT8 + + + + Auto + Автоматично + + + + + 5 + + + + + + 7 + + + + + + 11 + + + + + Low + Низький + + + + Medium + Середній + + + + High + Високий + + + + Minimum + Найменший + + + + Use low thresholds + Знижені пороги + + + + Use subpass + Додатковий прохід декодування + + + + 2-Stage + 2 етапи + + + + 3-Stage + 3 етапи + + + + Early + Рано + + + + Late + Пізно + + + + Wideband DX Call search + Широкосмуговий пошук позивного DX + + + + Hide FT8 dupe messages + Ховати повторні повідомлення FT8 + + + + VHF / UHF Buttons + Кнопки УКХ і ДВЧ + + + + Highlight stations from Territory 1 + Виділяти станції з території 1 + + + + Highlight stations from Territory 2 + Виділяти станції з території 2 + + + + Highlight stations from Territory 3 + Виділяти станції з території 3 + + + + Highlight stations from Territory 4 + Виділяти станції з території 4 + + + + Disable clicks on waterfall + Вимкнути кліки по водоспаду + + + + Download EME Ephemeris Chart + Завантажити ефемериди для EME + + + + Hide AP information + Ховати відомості про апріорне декодування + + + + <html><head/><body><p>Hide AP information</p></body></html> + <html><head/><body><p>Ховати відомості про апріорне декодування</p></body></html> + + + + Highlight Whitelist entries + Виділяти записи з білого списку + + + + Rig Control Error + Збій керування трансивером + + + + + + Receiving + Прийом + + + + Do you want to reconfigure the radio interface? + Бажаєте змінити налаштування з'єднання з трансивером? + + + + Error Scanning ADIF Log + Помилка читання журналу ADIF + + + + Scanned ADIF log, %1 worked-before records created. CTY: %2 + Журнал ADIF прочитано, створено записів про попередні зв'язки: %1. CTY: %2 + + + + Error Loading LotW Users Data + Помилка завантаження даних про користувачів LotW + + + + + + Decoder Error + + + + + The decoder subprocess exited unexpectedly. + + + + + jt9 exited unexpectedly with code %1. + + + + + + Error Writing WAV File + Помилка запису файлу WAV + + + + Enumerating audio devices + Перелічування звукових пристроїв + + + + Configurations... + Конфігурації... + + + + The decoder subprocess could not be stopped. + + + + + The decoder subprocess could not be restarted. + + + + + CQ: None + + + + + CQ: First + + + + + CQ: Max Dist + + + + + CQ: Max dB + + + + + CQ: Min dB + + + + + Error Killing jt9.exe Process + Помилка завершення процесу jt9.exe + + + + KillByName return code: %1 + Код повернення KillByName: %1 + + + + Error removing "%1" + Помилка видалення «%1» + + + + Click OK to retry + Натисніть «Гаразд», щоб повторити + + + + + Improper mode + Невідповідний режим + + + + + File Open Error + Помилка відкриття файлу + + + + + + + + Cannot open "%1" for append: %2 + Не вдалося відкрити «%1» для дозапису: %2 + + + + Error saving c2 file + Помилка збереження файлу c2 + + + + Error in Sound Input + Помилка звукового входу + + + + Error in Sound Output + Помилка звукового виходу + + + + + Single-Period Decodes + Декоди за один період + + + + + Average Decodes + Усереднені декоди + + + + Change Operator + Змінити оператора + + + + New operator: + Новий оператор: + + + + Status File Error + Помилка файлу стану + + + + + Cannot open "%1" for writing: %2 + Не вдалося відкрити «%1» для запису: %2 + + + + Decodes containing My Call + Декоди з моїм позивним + + + + Subprocess Error + Помилка підпроцесу + + + + Subprocess failed with exit code %1 + Підпроцес завершився з кодом %1 + + + + + Running: %1 +%2 + Виконується: %1 +%2 + + + + Subprocess error + Помилка підпроцесу + + + + Invalid data in fmt.all at line %1 + Хибні дані у fmt.all, рядок %1 + + + + Good Calibration Solution + Калібрування вдале + + + + <pre>%1%L2 ±%L3 ppm +%4%L5 ±%L6 Hz + +%7%L8 +%9%L10 Hz</pre> + + + + + Delete Calibration Measurements + Видалити виміри калібрування + + + + The "fmt.all" file will be renamed as "fmt.bak" + Файл «fmt.all» буде перейменовано на «fmt.bak» + + + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2026 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; Roger Rehr, W3SZ; John Nelson, G4KLA; Charlie Suckling, DL3WDG; Terrell Deppe, KJ5HST; and other members of the WSJT Development Group." + Якщо ви користуєтеся будь-якою частиною WSJT-X на умовах GNU General Public License, ви маєте показувати відповідне повідомлення про авторські права. + + + + No data read from disk. Wrong file format? + З диска нічого не прочитано. Хибний формат файлу? + + + + Confirm Delete + Підтвердіть видалення + + + + Are you sure you want to delete all *.wav and *.c2 files in "%1"? + Ви впевнені, що хочете видалити всі файли *.wav і *.c2 з «%1»? + + + + EME Chart + Графік EME + + + + Select Year + Оберіть рік + + + + Keyboard Shortcuts + Клавіатурні скорочення + + + + Special Mouse Commands + Особливі дії мишею + + + + No more files to open. + Більше файлів для відкриття немає. + + + + Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. + Оберіть іншу частоту передачі. WSJT-X свідомо не передаватиме в піддіапазоні WSPR іншим режимом. + + + + WSPR Guard Band + Захисна смуга WSPR + + + + Please choose another dial frequency. +Must be 3Khz away from %1. +WSJT-X will not operate in Fox mode +overlapping the standard FT8 sub-bands. + Оберіть іншу частоту на шкалі. +Потрібно відійти на 3 кГц від %1. +WSJT-X не працюватиме в режимі експедиції +з перекриттям піддіапазонів WSPR. + + + + Fox Mode warning + Попередження про режим експедиції + + + + Please choose another dial frequency. +WSJT-X will not operate in Fox mode +overlapping the WSPR sub-bands. + Оберіть іншу частоту на шкалі. +WSJT-X не працюватиме в режимі експедиції +з перекриттям піддіапазонів WSPR. + + + + + Hz + + + + + s + с + + + + %1.wav: invalid sample count %2 + + + + + Application status + + + + + Current WSJT-X status messages and operating indicators. + + + + + Transmit status + + + + + Configuration + + + + + Decode count + + + + + Last transmitted message + + + + + Power and SWR status + + + + + Decode progress + + + + + Progress for the current decode operation. + + + + + Transmit watchdog + + + + + TX is inhibited by an external interlock controller. + + + + + TX is inhibited by %1. + + + + + The selected transmit message cannot be encoded. Enable Tx has been turned off. Edit the selected message or check station settings before trying again. + + + + + Tx message cannot be encoded; Enable Tx is off + + + + + + Decoder is starting; decode request skipped. + + + + + FT8 input completion was rejected: automated=%1 awaiting=%2 frames=%3. + + + + + Unable to flush the final FT8 audio block. + + + + + FT8 input completed with %1 of %2 samples in the decode buffer. + + + + + FT8 decoding is running behind; early passes are temporarily reduced. + + + + + FT8 decoding caught up; configured early passes restored. + + + + + + PSK Reporter spot queue full; oldest spot dropped + + + + + TX inhibited + + + + + Last Tx: %1 + Остання передача: %1 + + + + A QSO between two stations with nonstandard callsigns won't work. + +Auto Seq would get stuck in an endless loop. + + + + + This station transmits in the same time slot as you do. + +You must not start a QSO if both stations Tx even/1st +or Tx odd/2nd, while the Tx even/1st checkbox is disabled. + +Click the MSK144 mode button to re-enable the Tx even/1st +checkbox, or choose another station. + Ця станція передає в тому самому часовому проміжку, що й ви. + +Починати зв'язок не можна, якщо обидві станції передають в однакові періоди. + + + + Should you switch to EU VHF Contest mode? + +To do so, check 'Special operating activity' and +'EU VHF Contest' on the Settings | Advanced tab. + Перемкнутися в режим змагань EU VHF? + +Для цього позначте «Особлива активність» і оберіть відповідний варіант. + + + + Should you switch to ARRL Field Day mode? + Перемкнутися в режим ARRL Field Day? + + + + Should you switch to RTTY contest mode? + Перемкнутися в режим змагань RTTY? + + + + %1 shorthand-message mode + + + + + RR73 is not available in %1. Tx4 uses RRR in this mode. + + + + + Wait & Pounce requires a CQ response mode. +Change CQ: None to another option. + + + + + + + + Add to CALL3.TXT + Додати до CALL3.TXT + + + + Please enter a valid grid locator + Введіть дійсний локатор + + + + Cannot open "%1" for read/write: %2 + Не вдалося відкрити «%1» для читання та запису: %2 + + + + %1 +is already in CALL3.TXT, do you wish to replace it? + %1 +вже є в CALL3.TXT; замінити? + + + + Warning: DX Call field is empty. + Увага: поле позивного DX порожнє. + + + + SuperFox free text may only contain spaces, digits, uppercase letters, and + - . / ?. + + + + + Log file error + Помилка файлу журналу + + + + Cannot open "%1" + Не вдалося відкрити «%1» + + + + Error sending log to N1MM + Помилка надсилання журналу в N1MM + + + + Write returned "%1" + Запис повернув «%1» + + + + DX call + + + + + Callsign of station to be worked. + + + + + DX grid + + + + + Locator of station to be worked. + + + + + Wait and Call + + + + + Lookup DX call + + + + + Add DX call + + + + + Ignore DX call + + + + + CQ response mode + + + + + Selects a station automatically from replies to your pending CQ after Enable Tx is armed in the current receive period, or from CQ messages for Wait & Pounce. + + + + + Transmit audio frequency + + + + + Receive audio frequency + + + + + Frequency tolerance + + + + + Signal report + + + + + Transmit and receive period + + + + + Submode + + + + + Maximum drift + + + + + Operating band + + + + + Operating band text + + + + + Transmit power attenuation + + + + + Adjust transmit drive attenuation. + + + + + Show or hide the menu bar. + + + + + Rig control status + + + + + Hound mode + + + + + Toggle FT8 hound mode. Right-click to toggle SuperFox mode. + + + + + Message panel selector + + + + + Switches between standard messages, Fox queue, and band hopping pages. Press 1, 2, or 3 while focused to select a page. + + + + + Standard messages + + + + + Fox queue + + + + + + Band hopping + + + + + Standard messages page + + + + + Fox queue page + + + + + Band hopping page + + + + + Hound queue + + + + + Queued Hound callers available for Fox transmissions. + + + + + Fox transmissions in progress + + + + + Hound callers currently in progress for Fox transmissions. + + + + + Hound queue sort order + + + + + Hound queue list size + + + + + Fox transmission slots + + + + + Fox CQ message + + + + + Reset Fox queues + + + + + Fox free text + + + + + Send Fox free text + + + + + Enable FT8 QRG 1 + + + + + Enable FT8 QRG 2 + + + + + Enable FT8 QRG 3 + + + + + Enable FT8 QRG 4 + + + + + Enable FT8 QRG 5 + + + + + Enable FT8 QRG 6 + + + + + Enable FT8 QRG 7 + + + + + Enable FT8 QRG 8 + + + + + FT8 QRG 1 frequency + + + + + FT8 QRG 2 frequency + + + + + FT8 QRG 3 frequency + + + + + FT8 QRG 4 frequency + + + + + FT8 QRG 5 frequency + + + + + FT8 QRG 6 frequency + + + + + FT8 QRG 7 frequency + + + + + FT8 QRG 8 frequency + + + + + Tx1 message + + + + + Tx2 message + + + + + Tx3 message + + + + + Tx4 message + + + + + Tx5 message macro + + + + + Tx6 message + + + + + Tx5 message macro text + + + + + Select Tx1 for next transmission + + + + + Select Tx2 for next transmission + + + + + Select Tx3 for next transmission + + + + + Select Tx4 for next transmission + + + + + Select Tx5 for next transmission + + + + + Select Tx6 for next transmission + + + + + Transmit Tx1 now + + + + + Transmit Tx2 now + + + + + Transmit Tx3 now + + + + + Transmit Tx4 now + + + + + Transmit Tx5 now + + + + + Transmit Tx6 now + + + + + Stations calling DXpedition %1 + Станції, що викликають експедицію %1 + + + + Show Already Worked + Показувати вже опрацьованих + + + + All Decodes + + + + + QSO Frequency + + + + + Tune drive + + + + + Transmit drive + + + + + Super Fox + + + + + Super Hound + Супермисливець + + + + Hound + Мисливець + + + + Tx Messages + Повідомлення на передачу + + + + + + + + + Confirm Erase + Підтвердіть очищення + + + + Are you sure you want to erase file ALL.TXT? + Ви впевнені, що хочете очистити файл ALL.TXT? + + + + Are you sure you want to erase the list of Q65 callers? + Ви впевнені, що хочете очистити перелік станцій, які викликали в Q65? + + + + + Confirm Reset + Підтвердіть скидання + + + + Are you sure you want to erase your contest log? + Ви впевнені, що хочете очистити журнал змагань? + + + + Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. + Це прибере всі записи QSO поточних змагань. Вони лишаться у файлі журналу ADIF, але зникнуть із журналу змагань. + + + + Cabrillo Log saved + Журнал Cabrillo збережено + + + + Are you sure you want to erase file wsjtx_log.adi? + Ви впевнені, що хочете очистити файл wsjtx_log.adi? + + + + Are you sure you want to erase the WSPR hashtable? + Ви впевнені, що хочете очистити хеш-таблицю WSPR? + + + + %1 W + + + + + SWR > 2.5 !!! + +Transmission was stopped + +Check your antenna + КСХ > 2,5 !!! + +Передачу зупинено + +Перевірте антену + + + + Prefixes + Префікси + + + + Network Error + Помилка мережі + + + + Error: %1 +UDP server %2:%3 + Помилка: %1 +Сервер UDP %2:%3 + + + + + File Error + Помилка файлу + + + + + Stop transmitting or tuning before changing the dial frequency. + + + + + + Measuring reference spectrum: %1 s remaining + + + + + Reference spectrum measurement stopped; Ref Spec is available + + + + + Reference spectrum saved; Ref Spec is available + + + + + Reference spectrum measurement stopped; no reference spectrum is available + + + + + Phase Training Disabled + Навчання фази вимкнено + + + + Phase Training Enabled + Навчання фази ввімкнено + + + + Cannot remove "%1": %2 + Не вдалося видалити «%1»: %2 + + + + WD:0m + + + + + Runaway Tx watchdog + Сторож передачі спрацював + + + + WD:%1m + + + + + + Log File Error + Помилка файлу журналу + + + + Are you sure you want to clear the QSO queues? + Ви впевнені, що хочете очистити черги QSO? + + + + + + Free Text Message + Повідомлення довільним текстом + + + + + Message: + Повідомлення: + + + + Directional calls not yet supported in SuperFox mode + Спрямовані виклики в режимі SuperFox поки не підтримуються + + + + TOTP: No seed entered in fox configuration to generate verification code. + TOTP: у налаштуваннях експедиції не введено ключ для створення коду перевірки. + + + + SuperFox cannot queue %1: unsupported callsign. + + + + + TOTP SF: seed not long enough. + TOTP SF: ключ закороткий. + + + + SuperFox Tx stopped: invalid message tokens. + + + + + SuperFox Tx stopped: invalid verification code. + + + + + SuperFox Tx stopped: invalid CQ call or grid. + + + + + SuperFox Tx stopped: invalid callsign. + + + + + SuperFox Tx stopped: report is outside the SuperFox range. + + + + + SuperFox Tx stopped: free text contains unsupported characters. + + + + + SuperFox Tx stopped: message could not be packed. + + + + + Are you sure you want to erase the Tx Log? + Ви впевнені, що хочете очистити журнал передач? + + + + "%1" added to Ignore List + «%1» додано до списку ігнорованих + + + + Are you sure you want to erase the Ignore List? + Ви впевнені, що хочете очистити список ігнорованих? + + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: cycle CQ response mode)</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Cycle CQ response mode</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Ctrl+X </b></td><td>Open next file in directory</td></tr> + <tr><td><b>Alt+x </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> + +</table> + + + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Right-click</b> to set Tx frequency.<br/> + <b>Double-right-click</b> to set Rx and Tx frequencies. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> + and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> + Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> + own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">Dial Frequency:</td> + <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> + <b>Right-click</b> to increase frequency by 1 kHz.<br/> + <b>Left-click</b> to decrease frequency by 1 kHz.<br/> + The mouse pointer must be over the Dial Frequency indicator. + </td> + </tr> + <tr> + <td align="right">H Button:</td> + <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to activate or deactivate SuperFox mode. + </td> + </tr> + <tr> + <td align="right">FT8 Button:</td> + <td><b>Click</b> to switch to FT8 Hound Mode.<br/> + <b>Right-click</b> to toggle last used Special Operating Activity On/Off. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> + <tr> + <td align="right">Tx5 Button:</td> + <td><b>Right-click</b> to retain Tx5 free text. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Right-click</b> to toggle the checkbox enabled/disabled.<br/> + Fox and Hound modes lock the required sequence. + </td> + </tr> + <tr> + <td align="right">Enable Tx Button:</td> + <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> + <b>Right-click</b> to toggle Wait & Pounce On/Off after selecting<br/> + any CQ response mode other than CQ: None. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> + If <b>Alternate Erase button behavior</b> is checked:<br/> + <b>Click</b> to erase Band Activity window.<br/> + <b>Right-click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">DX Call Button:</td> + <td><b>Click</b> to toggle Wait & Call On/Off.<br/> + <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. + </td> + </tr> + <tr> + <td align="right">Lookup Button:</td> + <td><b>Click</b> to search for callsign in database.<br/> + <b>Right-click</b> to search for Dx Call on qrz.com. + </td> + </tr> + <tr> + <td align="right">Add Button:</td> + <td><b>Click</b> to add callsign and locator to database.<br/> + <b>Right-click</b> to search for Dx Call on hamqth.com. + </td> + </tr> + <tr> + <td align="right">Ignore Button:</td> + <td><b>Click</b> to add callsign to the Ignore List.<br/> + <b>Right-click</b> to search for Dx Call on qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Band Buttons:</td> + <td><b>Click</b> to toggle band / mode default frequencies.<br/> + <b>Right-click</b> to toggle FT8 DXpedition frequencies. + </td> + </tr> +</table> + + + + + Type 1 Prefixes: + + 1A 1S 3A 3B6 3B8 3B9 3C 3C0 3D2 3D2C 3D2R 3DA 3V 3W 3X + 3Y 3YB 3YP 4J 4L 4S 4U1I 4U1U 4W 4X 5A 5B 5H 5N 5R + 5T 5U 5V 5W 5X 5Z 6W 6Y 7O 7P 7Q 7X 8P 8Q 8R + 9A 9G 9H 9J 9K 9L 9M2 9M6 9N 9Q 9U 9V 9X 9Y A2 + A3 A4 A5 A6 A7 A9 AP BS7 BV BV9 BY C2 C3 C5 C6 + C9 CE CE0X CE0Y CE0Z CE9 CM CN CP CT CT3 CU CX CY0 CY9 + D2 D4 D6 DL DU E3 E4 EA EA6 EA8 EA9 EI EK EL EP + ER ES ET EU EX EY EZ F FG FH FJ FK FKC FM FO + FOA FOC FOM FP FR FRG FRJ FRT FT5W FT5X FT5Z FW FY M MD + MI MJ MM MU MW H4 H40 HA HB HB0 HC HC8 HH HI HK + HK0A HK0M HL HM HP HR HS HV HZ I IS IS0 J2 J3 J5 + J6 J7 J8 JA JDM JDO JT JW JX JY K KG4 KH0 KH1 KH2 + KH3 KH4 KH5 KH5K KH6 KH7 KH8 KH9 KL KP1 KP2 KP4 KP5 LA LU + LX LY LZ OA OD OE OH OH0 OJ0 OK OM ON OX OY OZ + P2 P4 PA PJ2 PJ7 PY PY0F PT0S PY0T PZ R1F R1M S0 S2 S5 + S7 S9 SM SP ST SU SV SVA SV5 SV9 T2 T30 T31 T32 T33 + T5 T7 T8 T9 TA TF TG TI TI9 TJ TK TL TN TR TT + TU TY TZ UA UA2 UA9 UK UN UR V2 V3 V4 V5 V6 V7 + V8 VE VK VK0H VK0M VK9C VK9L VK9M VK9N VK9W VK9X VP2E VP2M VP2V VP5 + VP6 VP6D VP8 VP8G VP8H VP8O VP8S VP9 VQ9 VR VU VU4 VU7 XE XF4 + XT XU XW XX9 XZ YA YB YI YJ YK YL YN YO YS YU + YV YV0 Z2 Z3 ZA ZB ZC4 ZD7 ZD8 ZD9 ZF ZK1N ZK1S ZK2 ZK3 + ZL ZL7 ZL8 ZL9 ZP ZS ZS8 KC4 E5 + +Type 1 Suffixes: /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /P + + + + + Band hopping has no selected frequencies. + + + + + MessageAveraging + + + + Message Averaging + Усереднення повідомлень + + + + UTC Sync DT Freq + + + + + Modes + + + + Mode + Режим + + + + MultiSettings + + + Default + За замовчуванням + + + + MultiSettings::impl + + + &Switch To + + + + + &Clone + + + + + Clone &Into ... + + + + + R&eset + + + + + &Rename ... + + + + + &Delete + &Видалити + + + + Clone Into Configuration + + + + + Confirm overwrite of all values for configuration "%1" with values from "%2"? + + + + + Reset Configuration + + + + + Confirm reset to default values for configuration "%1"? + + + + + Delete Configuration + + + + + Confirm deletion of configuration "%1"? + + + + + NameDialog + + + New Configuration Name + + + + + Old name: + + + + + &New name: + + + + + NetworkAccessManager + + + Network SSL/TLS Errors + Помилки SSL/TLS у мережі + + + + PollingTransceiver + + + Unexpected rig error + + + + + QObject + + + Failed to open LotW users CSV file: '%1' + Не вдалося відкрити файл CSV користувачів LotW: «%1» + + + + OOB + + + + + Too many colours in palette. + + + + + Error reading waterfall palette file "%1:%2" too many colors. + + + + + Error reading waterfall palette file "%1:%2" invalid triplet. + + + + + Error reading waterfall palette file "%1:%2" invalid color. + + + + + Error opening waterfall palette file "%1": %2. + + + + + QSYMessage + + + WSJT-X Popup + Повідомлення WSJT-X + + + + TextLabel + Напис + + + + Reply +Yes + Відповісти +Так + + + + Reply +No + Відповісти +Ні + + + + QSYMessageCreator + + + Message Creator + Створювач повідомлень + + + + HF + + + + + + SSB + + + + + + + CW + + + + + + FM + + + + + FST4 + + + + + FT4 + + + + + + FT8 + + + + + JT9 + + + + + JT65 + + + + + + + + Message + Повідомлення + + + + 630 M + + + + + 160 M + + + + + 80 M + + + + + 60 M + + + + + 40 M + + + + + 30 M + + + + + 20 M + + + + + 17 M + + + + + 15 M + + + + + 12 M + + + + + 28 MHz + + + + + 29 MHz + + + + + + + Mode + Режим + + + + + + Band + Діапазон + + + + + + SAVE + ЗБЕРЕГТИ + + + + + + kHz + + + + + + + Send +Message + Надіслати +повідомлення + + + + VHF + + + + + + 50 MHz + + + + + + 144 MHz + + + + + + 222 MHz + + + + + + 432 MHz + + + + + + 902 MHz + + + + + + 903 MHz + + + + + + 1296 MHz + + + + + + 2304 MHz + + + + + + 3400 MHz + + + + + + 5760 MHz + + + + + + 10368 MHz + + + + + 24192 MHz + + + + + 40 MHz + + + + + 70 MHz + + + + + MSK144 + + + + + FM MHz + + + + + EME + + + + + 24048 MHz + + + + + Q65-30B + + + + + Q65-60C + + + + + Q65-60D + + + + + Q65-60E + + + + + Q65-120D + + + + + General + Загальні + + + + Please call me by phone + Зателефонуйте мені + + + + Please check Ping Jockey + Загляньте на Ping Jockey + + + + You are in the log + Ви є в журналі + + + + You are transmitting in the wrong time slot + Ви передаєте в хибному часовому проміжку + + + + You are not in Contest Mode + Ви не в режимі змагань + + + + Your audio is distorted + Ваш звук спотворений + + + + Your transmitter is overmodulated + Ваш передавач перемодульовано + + + + Please check ON4KST + Загляньте на ON4KST + + + + Please transmit above 1000 Hz + Передавайте вище 1000 Гц + + + + Check your email + Перевірте свою пошту + + + + Please check HB9Q Logger + Загляньте в журнал HB9Q + + + + Please check your PC Clock + Перевірте годинник на комп'ютері + + + + You are transmitting on top of a rare DX station + Ви передаєте поверх рідкісної станції DX + + + + Please QSL via LoTW + Підтвердіть, будь ласка, через LoTW + + + + Send Message + Надіслати повідомлення + + + + MessageCreator + Створювач повідомлень + + + + QSYMonitor + + + QSYMonitor + + + + + Clear + + + + + QSY Monitor + Спостереження за QSY + + + + ReceiveHandoffTestController + + + Timed out waiting for the full receive handoff. + + + + + Required FT8 or monitoring control was not found. + + + + + Unable to configure ordinary FT8 final start. + + + + + GUI consumed audio during the withheld second. + + + + + Backlog did not commit losslessly with a partial tail. + + + + + Partial tail was not delivered exactly once. + + + + + Repeated flush duplicated the partial tail. + + + + + A was rejected or a final was submitted by 14.05 seconds. + + + + + Obsolete A entered DSP or submitted a final pass. + + + + + B did not begin with its first complete block at zero. + + + + + B stopped advancing after rollover. + + + + + Delayed A/B handoff did not reject A and commit B. + + + + + All three receive handoff stages passed. + + + + + scenario=%1 capture=%2 epoch=%3 obsolete=%4 committed=%5 accepted=%6 rejected=%7 rejected-end=%8 final-submissions=%9 generation=%10 + + + + + Unable to command the audio fixture. + + + + + Capture checkpoint failed: acknowledged=%1 error=%2 + + + + + %1 range=[%2,%3) epoch=%4 + + + + + Current-period audio was rejected. + + + + + Rejected A ranges lost their epoch or continuity. + + + + + Accepted ranges changed epoch, duplicated, or skipped samples. + + + + + Committed sample %1 was %2, expected %3. + + + + + RemoteFile + + + + + + + + File System Error + + + + + Cannot rename file: +"%1" +to: "%2" +Error(%3): %4 + + + + + Cannot delete file: +"%1" + + + + + + + Network Error + Помилка мережі + + + + Too many redirects: %1 + + + + + Redirect not followed: %1 + + + + + Cannot commit changes to: +"%1" + + + + + Cannot open file: +"%1" +Error(%2): %3 + + + + + Cannot make path: +"%1" + + + + + Cannot write to file: +"%1" +Error(%2): %3 + + + + + SampleDownloader::impl + + + + Download Samples + + + + + &Abort + + + + + &Refresh + + + + + &Details + + + + + Base URL for samples: + + + + + Only use HTTP: + + + + + Check this if you get SSL/TLS errors + + + + + Input Error + + + + + Invalid URL format + + + + + SoundInput + + + An error opening the audio input device has occurred. + + + + + An error occurred during read from the audio input device. + + + + + Non-recoverable error, audio input device not usable at this time. + + + + + Requested input audio format is not valid. + + + + + Requested input audio format is not supported on device. + + + + + Failed to initialize audio sink device + + + + + Idle + + + + + Receiving + Прийом + + + + Suspended + + + + + Interrupted + + + + + Error + + + + + Stopped + + + + + SoundOutput + + + An error opening the audio output device has occurred. + + + + + An error occurred during write to the audio output device. + + + + + Audio data not being fed to the audio output device fast enough. + + + + + Non-recoverable error, audio output device not usable at this time. + + + + + Requested output audio format is not valid. + + + + + Requested output audio format is not supported on device. + + + + + Audio output restart attempt failed. + + + + + + No audio output device configured. + + + + + No audio output stream is active. + + + + + Idle + + + + + Sending + + + + + Suspended + + + + + Interrupted + + + + + Error + + + + + Stopped + + + + + SplashScreen + + + WSJT-X — Welcome + + + + + WSJT-X startup information. Press Escape to close. + + + + + StationDialog + + + Add Station + Додати станцію + + + + &Band: + + + + + &Offset (MHz): + &Зсув (МГц): + + + + &Antenna: + &Антена: + + + + StationList::impl + + + Band name + + + + + Frequency offset + Зсув частоти + + + + Antenna description + Опис антени + + + + Band + Діапазон + + + + Offset + + + + + Antenna Description + Опис антени + + + + TCITransceiver + + + ConnectionRefused + + + + + RemoteHostClosed + + + + + HostNotFound + + + + + SocketAccess + + + + + SocketResource + + + + + SocketTimeout + + + + + DatagramTooLarge + + + + + Network + + + + + AddressInUse + + + + + SocketAddressNotAvailable + + + + + UnsupportedSocketOperation + + + + + UnfinishedSocketOperation + + + + + ProxyAuthenticationRequired + + + + + SslHandshakeFailed + + + + + ProxyConnectionRefused + + + + + ProxyConnectionClosed + + + + + ProxyConnectionTimeout + + + + + ProxyNotFound + + + + + ProxyProtocol + + + + + Operation + + + + + SslInternal + + + + + SslInvalidUserData + + + + + Temporary + + + + + UnknownSocket + + + + + UnknownSocketError + + + + + TCI websocket error: %1 + + + + + TCI SDR could not be switched on + + + + + TCI SDR is not switched on + + + + + TCI RX2 could not be enabled + + + + + TCI Audio could not be switched on + + + + + + TCI could not be opened + + + + + + + TCI sent an invalid VFO frequency + + + + + + TCI failed to set ptt + + + + + TCI should use PTT via CAT + + + + + + TCI failed set rxfreq + + + + + + TCI failed set mode + + + + + TCI modulator not Idle + + + + + TCI source commitment; playout evidence is protocol-send dead reckoning, not DAC confirmation + + + + + TCI WebSocket send progress; no radio DAC or RF playback confirmation + + + + + TransceiverBase + + + Unexpected rig error + + + + + WideGraph + + + Dialog + Вікно + + + + <html><head/><body><p>Controls</p></body></html> + <html><head/><body><p>Керування</p></body></html> + + + + <html><head/><body><p>Frequency at left edge of waterfall</p></body></html> + <html><head/><body><p>Частота на лівому краю водоспаду</p></body></html> + + + + Hz + + + + + Start + Початок + + + + Number of FFTs averaged (controls waterfall scrolling rate) + Скільки перетворень Фур'є усереднюється (задає швидкість прокрутки водоспаду) + + + + N Avg + Усер. N + + + + Compression factor for frequency scale + Коефіцієнт стиснення шкали частот + + + + Bins/Pixel + + + + + <html><head/><body><p>Decode JT9 only above this frequency</p></body></html> + <html><head/><body><p>Декодувати JT9 лише вище цієї частоти</p></body></html> + + + + Hz + + + + + Split + Розділ + + + + + <html><head/><body><p>Position of time stamp above each interval line</p></body></html> + <html><head/><body><p>Розташування позначки часу над лінією кожного інтервалу</p></body></html> + + + + Time stamp + Позначка часу + + + + + Off + Вимк. + + + + Left + Лівий + + + + Right + Правий + + + + Palette + Палітра + + + + <html><head/><body><p>Enter definition for a new color palette.</p></body></html> + <html><head/><body><p>Введіть визначення нової палітри кольорів.</p></body></html> + + + + Adjust... + Налаштувати... + + + + Select waterfall palette + Оберіть палітру водоспаду + + + + Bars + Смуги + + + + Freq + Частота + + + + <html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html> + <html><head/><body><p>Вирівняти основу спектра по всьому показаному інтервалу</p></body></html> + + + + Flatten + Вирівняти + + + + <html><head/><body><p>Apply a saved reference spectrum to flatten the received passband. Available after a reference spectrum has been measured. (Not yet fully implemented.)</p></body></html> + <html><head/><body><p>Застосувати збережений опорний спектр, щоб вирівняти прийнятий</p></body></html> + + + + Ref Spec + Опорний спектр + + + + <html><head/><body><p>Select data for spectral display</p></body></html> + <html><head/><body><p>Оберіть дані для показу спектра</p></body></html> + + + + Current + Поточний + + + + Cumulative + Накопичений + + + + Linear Avg + Лінійне усер. + + + + Reference + Опорний + + + + Q65_Sync + + + + + Total power (dB) + Загальна потужність (дБ) + + + + Waterfall gain + Підсилення водоспаду + + + + Spectrum gain + Підсилення спектра + + + + Waterfall zero + Нуль водоспаду + + + + Spectrum zero + Нуль спектра + + + + <html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html> + <html><head/><body><p>Задайте, яку частку вікна займає спектр.</p></body></html> + + + + % + + + + + Spec + Спектр + + + + Smoothing of Linear Average spectrum + Згладжування спектра лінійного усереднення + + + + Smooth + Згладж. + + + + User Defined + Власна + + + + Wide Graph + Широкий графік + + + + + Read Palette + Прочитати палітру + + + + WorkedBefore + + + Invalid ADIF field %0: %1 + Хибне поле ADIF %0: %1 + + + + Malformed ADIF field %0: %1 + Спотворене поле ADIF %0: %1 + + + + Invalid ADIF header + Хибний заголовок ADIF + + + + Error opening ADIF log file for read: %0 + Помилка відкриття файлу журналу ADIF для читання: %0 + + + + configuration_dialog + + + Settings + Налаштування + + + + Genera&l + Загал&ьні + + + + General station details and settings. + Загальні дані станції та налаштування. + + + + Station Details + Дані станції + + + + My C&all: + Мій &позивний: + + + + Station callsign. + Позивний станції. + + + + M&y Grid: + Мій &локатор: + + + + <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> + <html><head/><body><p>Локатор Maidenhead, бажано 6 символів.</p></body></html> + + + + Check to allow grid changes from external programs + Дозволити зовнішнім програмам змінювати локатор + + + + AutoGrid + Локатор автоматично + + + + IARU Region: + Регіон IARU: + + + + <html><head/><body><p>Select your IARU region.</p></body></html> + <html><head/><body><p>Оберіть свій регіон IARU.</p></body></html> + + + + Message generation for type 2 compound callsign holders: + Складання повідомлень для складених позивних 2-го типу: + + + + <html><head/><body><p>Type 2 compound callsigns are those with prefixes or suffixes not included in the allowed shortlist (See Help-&gt;Add-on prefixes and suffixes).</p><p>This option determines which generated messages should contain your full type 2 compound call sign rather than your base callsign. It only applies if you have a type 2 compound callsign.</p><p>This option controls the way the messages that are used to answer CQ calls are generated. Generated messages 6 (CQ) and 5 (73) will always contain your full callsign. The JT65 and JT9 protocols allow for some standard messages with your full call at the expense of another piece of information such as the DX call or your locator.</p><p>Choosing message 1 omits the DX callsign which may be an issue when replying to CQ calls. Choosing message 3 also omits the DX callsign and many versions of this and other software will not extract the report. Choosing neither means that your full callsign only goes in your message 5 (73) so your QSO partner may log the wrong callsign.</p><p>None of these options are perfect, message 3 is usually best but be aware your QSO partner may not log the report you send them.</p></body></html> + <html><head/><body><p>Складені позивні 2-го типу — це позивні з префіксами або суфіксами поза дозволеним переліком (див. Довідка → Add-on prefixes and suffixes).</p><p>Цей параметр визначає, у яких зі створених повідомлень має стояти ваш повний складений позивний, а не базовий. Він діє лише тоді, коли ваш позивний складений і належить до 2-го типу.</p><p>Повідомлення 6 (CQ) і 5 (73) завжди містять повний позивний. Протоколи JT65 і JT9 дозволяють умістити повний позивний лише коштом іншої частини повідомлення — позивного кореспондента або локатора.</p><p>Вибір повідомлення 1 прибирає позивний кореспондента, що заважає відповідати на CQ. Вибір повідомлення 3 теж прибирає його, і чимало програм не зможуть видобути рапорт. Якщо не обрати жодного, повний позивний піде лише в повідомленні 5 (73), і кореспондент може записати вас хибно.</p><p>Ідеального варіанта немає; зазвичай найкращий — повідомлення 3, але майте на увазі, що кореспондент може не записати надісланий вами рапорт.</p></body></html> + + + + Full call in Tx1 + Повний позивний у Tx1 + + + + Full call in Tx3 + Повний позивний у Tx3 + + + + Full call in Tx5 only + Повний позивний лише в Tx5 + + + + Display + Відображення + + + + Show if decoded stations are new DXCC entities or worked before. + Показувати, чи є декодована станція новою країною DXCC, чи зв'язок з нею вже був. + + + + Show &DXCC, grid, and worked-before status + Показувати &країну, локатор і чи був зв'язок раніше + + + + Include a separator line between periods in the band activity window. + Додавати рядок-роздільник між періодами у вікні активності діапазону. + + + + &Blank line between decoding periods + &Порожній рядок між періодами декодування + + + + Set the font characteristics for the application. + Обрати шрифт програми. + + + + Font... + Шрифт... + + + + Highlight DX Grid in message + Виділяти локатор DX у повідомленні + + + + Show DXCC for all messages + Показувати країну для всіх повідомлень + + + + Show distance to DX station in miles rather than kilometers. + Показувати відстань до кореспондента в милях, а не в кілометрах. + + + + Display dista&nce in miles + Показувати відста&нь у милях + + + + Set the font characteristics for the Band Activity and Rx Frequency areas. + Обрати шрифт для вікон активності діапазону та частоти прийому. + + + + Decoded Text Font... + Шрифт декодованого тексту... + + + + <html><head/><body><p>Check to have decodes for a new period start at the top of the Band Activity window and not scroll off the top when the window is full.</p><p>This is to aid selecting decodes to double-click while decoding is still in progress. Use the Band Activity vertical scroll bar to reveal decodes past the bottom of the window.</p></body></html> + <html><head/><body><p>Позначте, щоб декоди нового періоду починалися вгорі вікна активності діапазону й не зникали за верхнім краєм, коли вікно заповнене.</p><p>Це полегшує вибір декодів подвійним кліком, поки декодування ще триває. Щоб побачити декоди нижче краю вікна, скористайтеся смугою прокрутки.</p></body></html> + + + + Start new period decodes at top + Починати декоди нового періоду згори + + + + Show the separator line between periods with time stamp of the decode period. + Показувати в рядку-роздільнику час періоду декодування. + + + + Show blank line with time stamp + Порожній рядок із позначкою часу + + + + Show principal prefix instead of country name + Показувати основний префікс замість назви країни + + + + Show outgoing transmitted messages in the Rx frequency window. + Показувати власні передачі у вікні частоти прийому. + + + + &Tx messages to Rx frequency window + &Свої передачі — у вікно частоти прийому + + + + Highlight DX Call in message + Виділяти позивний DX у повідомленні + + + + Behavior + Поведінка + + + + Don't start decoding until the monitor button is clicked. + Не декодувати, доки не натиснуто кнопку прослуховування. + + + + Mon&itor off at startup + Про&слуховування вимкнене при запуску + + + + <html><head/><body><p>Check this if you wish to automatically return to the last monitored frequency when monitor is enabled, leave it unchecked if you wish to have the current rig frequency maintained.</p></body></html> + <html><head/><body><p>Позначте, щоб при вмиканні прослуховування автоматично повертатися на останню прослухану частоту; лишіть порожнім, щоб зберігати поточну частоту трансивера.</p></body></html> + + + + Monitor returns to last used frequency + Прослуховування повертається на останню частоту + + + + Enable VHF and submode features + Увімкнути можливості УКХ і підрежимів + + + + Alternate F1-F6 bindings + Інші призначення клавіш F1–F6 + + + + Automatic transmission mode. + Режим автоматичної передачі. + + + + Doubl&e-click on call sets Tx enable + Подвійний &клік на позивному вмикає передачу + + + + Turns off automatic transmissions after sending a 73 or any other free +text message. + Вимикає автоматичні передачі після надсилання 73 або будь-якого +повідомлення довільним текстом. + + + + Di&sable Tx after sending 73 + &Вимикати передачу після 73 + + + + <html><head/><body><p>Open the Astronomical Data window automatically when switching to Q65 or JT65 mode and Decode after EME delay is enabled, and close it when no longer needed.</p><p>Open the QSYMessage Creator automatically if the VHF Features are enabled and such QSY messages are applicable.</p></body></html> + <html><head/><body><p>Автоматично відкривати вікно астрономічних даних при переході в режим Q65 або JT65, якщо ввімкнено декодування після затримки EME, і закривати його, коли воно більше не потрібне.</p><p>Автоматично відкривати створювач повідомлень QSY, якщо ввімкнено можливості УКХ і такі повідомлення доречні.</p></body></html> + + + + Auto-open/close Astronomical data window + Автоматично відкривати вікно астрономічних даних + + + + Calling CQ forces Call 1st + Виклик CQ вмикає «відповідати першому» + + + + <html><head/><body><p>Tx until 73 is received when in MSK144 or Q65 mode. </p></body></html> + <html><head/><body><p>Передавати, доки не отримано 73, у режимах MSK144 та Q65.</p></body></html> + + + + MSK144/Q65: Tx until 73 is received + MSK144/Q65: передавати, доки не отримано 73 + + + + <html><head/><body><p>Allow kHz frequency offset entry without 'k' suffix.</p></body></html> + <html><head/><body><p>Дозволити введення зсуву частоти в кілогерцях без суфікса «k».</p></body></html> + + + + kHz entry without k (restart required) + Введення кГц без «k» (потрібен перезапуск) + + + + Decode after EME delay + Декодувати після затримки EME + + + + Single decode + Одне декодування + + + + <html><head/><body><p>Disable the Tune watchdog.</p></body></html> + <html><head/><body><p>Вимкнути сторожа налаштування тоном.</p></body></html> + + + + Tune watchdog + Сторож налаштування тоном + + + + <html><head/><body><p>Number of seconds before Tune is aborted</p></body></html> + <html><head/><body><p>Через скільки секунд перервати налаштування тоном</p></body></html> + + + + Tune watchdog timeout + + + + + seconds + секунд + + + + Tx watchdog: + Сторож передачі: + + + + <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> + <html><head/><body><p>Через скільки хвилин перервати передачу без нагляду</p></body></html> + + + + Tx watchdog timeout + + + + + Disabled + Вимкнено + + + + minutes + хвилин + + + + Send a CW ID after every 73 or free text message. + Надсилати ідентифікацію телеграфом після кожного 73 чи довільного тексту. + + + + CW ID a&fter 73 + Ідентифікація CW &після 73 + + + + ID Inter&val: + Інтер&вал ідентифікації: + + + + Send a CW ID periodically every few minutes. +This might be required under your countries licence regulations. +It will not interfere with other users as it is always sent in the +quiet period when decoding is done. + Періодично, раз на кілька хвилин, надсилати ідентифікацію телеграфом. +Цього може вимагати ліцензійне законодавство вашої країни. +Іншим вона не заважає, бо завжди надсилається в тиху паузу, +коли йде декодування. + + + + CW ID interval + + + + + <html><head/><body><p>Turn the progress bar red while transmitting.</p></body></html> + <html><head/><body><p>Робити смугу поступу червоною під час передачі.</p></body></html> + + + + Turn progress bar red while transmitting + Червона смуга поступу під час передачі + + + + Additional features + Додаткові можливості + + + + Set Rx frequency to Tx frequency after QSO + Після QSO прирівнювати частоту прийому до частоти передачі + + + + <html><head/><body><p>If a station sends locator, calculate and show the distance in Band Activity pane.</p></body></html> + <html><head/><body><p>Якщо станція надсилає локатор, обчислювати й показувати відстань у вікні активності діапазону.</p></body></html> + + + + Show distance in messages with grid + Показувати відстань у повідомленнях із локатором + + + + <html><head/><body><p>Erase Band Activity and Rx frequency windows after band change.</p></body></html> + <html><head/><body><p>Очищати вікна активності діапазону та частоти прийому після зміни діапазону.</p></body></html> + + + + Erase decodes after band change + Очищати декоди після зміни діапазону + + + + Clear DX Grid after QSO + Очищати локатор DX після QSO + + + + Show U.S. States in messages with grid + Показувати штати США в повідомленнях із локатором + + + + Map Grid locator to U.S. State + Зіставляти локатор зі штатом США + + + + <html><head/><body><p>Align the text for DXCC, distance and azimuth.</p></body></html> + <html><head/><body><p>Вирівнювати текст країни, відстані та азимута.</p></body></html> + + + + Align DXCC/distance/azimuth + Вирівнювати країну, відстань і азимут + + + + Alternate Erase button behavior + Інша поведінка кнопки «Очистити» + + + + Clear DX Call after QSO + Очищати позивний DX після QSO + + + + <html><head/><body><p>Increase or decrease the space between message text and DXCC.</p></body></html> + <html><head/><body><p>Збільшити або зменшити відстань між текстом повідомлення та країною.</p></body></html> + + + + DXCC alignment spacing + + + + + Enable Wait features + Увімкнути можливості очікування + + + + <html><head/><body><p>If a station sends a valid Maidenhead locator, calculate and show the great-circle azimuth in Band Activity pane.</p></body></html> + <html><head/><body><p>Якщо станція надсилає дійсний локатор Maidenhead, обчислювати й показувати азимут за великим колом у вікні активності діапазону.</p></body></html> + + + + Show azimuth in messages with grid + Показувати азимут у повідомленнях із локатором + + + + <html><head/><body><p>Increase or decrease the space between DXCC and distance/azimuth.</p></body></html> + <html><head/><body><p>Збільшити або зменшити відстань між країною та відстанню чи азимутом.</p></body></html> + + + + Distance and azimuth alignment spacing + + + + + Less button coloring (restart required) + Менше кольору на кнопках (потрібен перезапуск) + + + + &Radio + &Трансивер + + + + Radio interface configuration settings. + Налаштування з'єднання з трансивером. + + + + Split Operation + Рознесення частот + + + + <html><head/><body><p>Use only VFO A for split operation (the program temporarily changes the QRG of your rig during transmission).</p></body></html> + <html><head/><body><p>Використовувати для рознесення лише VFO A (програма тимчасово змінює частоту трансивера під час передачі).</p></body></html> + + + + Fake It + Імітувати + + + + <html><head/><body><p>Use VFO A+B for split operation (works with many rigs, but requires the use of both VFOs).</p></body></html> + <html><head/><body><p>Використовувати для рознесення VFO A+B (працює з багатьма трансиверами, але задіює обидва VFO).</p></body></html> + + + + Rig + Трансивер + + + + <html><head/><body><p>Don't use split (not recommended).</p></body></html> + <html><head/><body><p>Не використовувати рознесення (не рекомендовано).</p></body></html> + + + + + None + Немає + + + + Modulation mode selected on radio. + Вид модуляції, обраний у трансивері. + + + + Mode + Режим + + + + <html><head/><body><p>USB is usually the correct modulation mode,</p><p>unless the radio has a special data or packet mode setting</p><p>for AFSK operation.</p></body></html> + <html><head/><body><p>USB зазвичай і є правильним видом модуляції,</p><p>якщо тільки трансивер не має окремого режиму для даних або пакета</p><p>для роботи AFSK.</p></body></html> + + + + US&B + + + + + Don't allow the program to set the radio mode +(not recommended but use if the wrong mode +or bandwidth is selected). + Не дозволяти програмі задавати режим трансивера +(не рекомендовано; використовуйте, якщо обирається +хибний режим або смуга). + + + + If this is available then it is usually the correct mode for this program. + Якщо такий режим є, для цієї програми він зазвичай і є правильним. + + + + Data/P&kt + + + + + Settings that control your CAT interface. + Налаштування керування трансивером через CAT. + + + + CAT Control + Керування CAT + + + + + Port: + Порт: + + + + Serial port used for CAT control. + Послідовний порт для керування CAT. + + + + + Serial Port Parameters + Параметри послідовного порту + + + + Baud Rate: + + + + + Serial port data rate which must match the setting of your radio. + Швидкість послідовного порту; має збігатися з налаштуванням трансивера. + + + + 1200 + + + + + 2400 + + + + + 4800 + + + + + 9600 + + + + + 19200 + + + + + 38400 + + + + + 57600 + + + + + 115200 + + + + + <html><head/><body><p>Number of data bits used to communicate with your radio's CAT interface (usually eight).</p></body></html> + <html><head/><body><p>Кількість бітів даних для зв'язку з інтерфейсом CAT трансивера (зазвичай вісім).</p></body></html> + + + + Data bits + Біти даних + + + + Data Bits + Біти даних + + + + D&efault + За &замовчуванням + + + + Se&ven + &Сім + + + + E&ight + &Вісім + + + + <html><head/><body><p>Number of stop bits used when communicating with your radio's CAT interface</p><p>(consult you radio's manual for details).</p></body></html> + <html><head/><body><p>Кількість стопових бітів для зв'язку з інтерфейсом CAT трансивера</p><p>(подробиці шукайте в посібнику до трансивера).</p></body></html> + + + + Stop bits + Стопові біти + + + + Stop Bits + Стопові біти + + + + + Default + За замовчуванням + + + + On&e + &Один + + + + T&wo + &Два + + + + <html><head/><body><p>Flow control protocol used between this computer and your radio's CAT interface (usually &quot;None&quot; but some require &quot;Hardware&quot;).</p></body></html> + <html><head/><body><p>Протокол керування потоком між комп'ютером і інтерфейсом CAT трансивера (зазвичай «None», але деяким потрібен «Hardware»).</p></body></html> + + + + + Handshake + Керування потоком + + + + &None + &Немає + + + + Software flow control (very rare on CAT interfaces). + Програмне керування потоком (дуже рідко трапляється в CAT). + + + + XON/XOFF + + + + + Flow control using the RTS and CTS RS-232 control lines +not often used but some radios have it as an option and +a few, particularly some Kenwood rigs, require it). + Керування потоком лініями RTS і CTS RS-232 +(використовується нечасто, але деякі трансивери його мають, +а окремі, зокрема частина Kenwood, вимагають). + + + + &Hardware + &Апаратне + + + + Special control of CAT port control lines. + Особливе керування лініями порту CAT. + + + + + Force Control Lines + Примусові рівні ліній + + + + + High + Високий + + + + + Low + Низький + + + + DTR: + + + + + RTS: + + + + + <html><head/><body><p>Attempt to connect to the radio with these settings.</p><p>The button will turn green if the connection is successful or red if there is a problem.</p></body></html> + <html><head/><body><p>Спробувати з'єднатися з трансивером із цими налаштуваннями.</p><p>Кнопка позеленіє в разі успіху або почервоніє, якщо є проблема.</p></body></html> + + + + Test CAT + Перевірити CAT + + + + Attempt to activate the transmitter. +Click again to deactivate. Normally no power should be +output since there is no audio being generated at this time. +Check that any Tx indication on your radio and/or your +radio interface behave as expected. + Спробувати ввімкнути передавач. +Натисніть ще раз, щоб вимкнути. Зазвичай потужності на виході +бути не повинно, бо звук у цей момент не формується. +Перевірте, що індикація передачі на трансивері та у вашому +інтерфейсі поводиться як належить. + + + + Test PTT + Перевірити PTT + + + + PTT Method + Спосіб керування передачею + + + + <html><head/><body><p>No PTT activation, instead the radio's automatic VOX is used to key the transmitter.</p><p>Use this if you have no radio interface hardware.</p></body></html> + <html><head/><body><p>Без окремого керування PTT: передавач вмикає власний VOX трансивера.</p><p>Скористайтеся цим, якщо у вас немає апаратного інтерфейсу.</p></body></html> + + + + VO&X + + + + + <html><head/><body><p>Use the RS-232 DTR control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The DTR control line of the CAT serial port may be used for this or a DTR control line on a different serial port may be used.</p></body></html> + <html><head/><body><p>Використовувати лінію DTR інтерфейсу RS-232 для вмикання передачі; потрібен апаратний інтерфейс.</p><p>Так само працює частина промислових інтерфейсів.</p><p>Можна взяти лінію DTR того самого порту, що й для CAT, або іншого порту.</p></body></html> + + + + &DTR + + + + + Some radios support PTT via CAT commands, +use this option if your radio supports it and you have no +other hardware interface for PTT. + Деякі трансивери вміють вмикати передачу командами CAT. +Скористайтеся цим, якщо ваш трансивер таке підтримує +і апаратного інтерфейсу для PTT немає. + + + + C&AT + + + + + <html><head/><body><p>Use the RS-232 RTS control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The RTS control line of the CAT serial port may be used for this or a RTS control line on a different serial port may be used. Note that this option is not available on the CAT serial port when hardware flow control is used.</p></body></html> + <html><head/><body><p>Використовувати лінію RTS інтерфейсу RS-232 для вмикання передачі; потрібен апаратний інтерфейс.</p><p>Так само працює частина промислових інтерфейсів.</p><p>Можна взяти лінію RTS того самого порту, що й для CAT, або іншого. Зауважте: для порту CAT цей варіант недоступний, якщо ввімкнено апаратне керування потоком.</p></body></html> + + + + R&TS + + + + + <html><head/><body><p>Select the RS-232 serial port utilised for PTT control, this option is available when DTR or RTS is selected above as a transmit method.</p><p>This port can be the same one as the one used for CAT control.</p><p>For some interface types the special value CAT may be chosen, this is used for non-serial CAT interfaces that can control serial port control lines remotely (OmniRig for example).</p></body></html> + <html><head/><body><p>Оберіть послідовний порт для керування передачею; цей параметр доступний, якщо вище обрано DTR або RTS.</p><p>Це може бути той самий порт, що й для CAT.</p><p>Для деяких типів інтерфейсів можна обрати особливе значення CAT — воно для непослідовних інтерфейсів CAT, які вміють дистанційно керувати лініями порту (наприклад, OmniRig).</p></body></html> + + + + + Update Hamlib + Оновити Hamlib + + + + 32-bit + + + + + <html><head/><body><p>Revert the last Hamlib update. </p><p>Note: This function is only available on Windows.</p></body></html> + <html><head/><body><p>Скасувати останнє оновлення Hamlib.</p><p>Увага: доступно лише у Windows.</p></body></html> + + + + Revert Update + Скасувати оновлення + + + + In use: + Використовується: + + + + Backed up: + Резервна копія: + + + + 64-bit + + + + + Rig: + Трансивер: + + + + Poll Interval: + Інтервал опитування: + + + + <html><head/><body><p>Interval to poll rig for status. Longer intervals will mean that changes to the rig will take longer to be detected.</p></body></html> + <html><head/><body><p>Як часто опитувати трансивер про стан. Більший інтервал означає, що зміни в трансивері помічатимуться повільніше.</p></body></html> + + + + s + с + + + + Rig Data + Дані трансивера + + + + <html><head/><body><p>Stop transmitting immediately when SWR exceeds 2.5.</p></body></html> + <html><head/><body><p>Негайно припиняти передачу, коли КСХ перевищує 2,5.</p></body></html> + + + + Halt Tx when SWR > 2.5 + Припиняти передачу, коли КСХ > 2,5 + + + + <html><head/><body><p>Read and display transmit PWR and SWR of your rig.</p></body></html> + <html><head/><body><p>Зчитувати й показувати потужність передачі та КСХ вашого трансивера.</p></body></html> + + + + Read and display PWR and SWR + Зчитувати й показувати потужність і КСХ + + + + Some radios can select the audio input using a CAT command, +this setting allows you to select which audio input will be used +(if it is available then generally the Rear/Data option is best). + Деякі трансивери вміють обирати звуковий вхід командою CAT. +Цей параметр задає, який вхід буде використано +(якщо він доступний, зазвичай найкращий варіант — Rear/Data). + + + + Transmit Audio Source + Джерело звуку на передачу + + + + Rear&/Data + + + + + &Front/Mic + + + + + A&udio + &Звук + + + + Audio interface settings + Налаштування звукового інтерфейсу + + + + Souncard + Звукова карта + + + + Soundcard + Звукова карта + + + + &Input: + &Вхід: + + + + Ou&tput: + Ви&хід: + + + + Select the audio channel used for transmission. +Unless you have multiple radios connected on different +channels; then you will usually want to select mono or +both here. + Оберіть звуковий канал для передачі. +Якщо у вас не під'єднано кілька трансиверів на різних +каналах, тут зазвичай варто обрати моно або обидва. + + + + Output audio channel + + + + + + Mono + Моно + + + + + Left + Лівий + + + + + Right + Правий + + + + + Both + Обидва + + + + Select the channel to use for receiving. + Оберіть канал для прийому. + + + + Input audio channel + + + + + Select the audio CODEC to use for receiving. + Оберіть звуковий пристрій для прийому. + + + + Select the audio CODEC to use for transmitting. +If this is your default device for system sounds then +ensure that all system sounds are disabled otherwise +you will broadcast any systems sounds generated during +transmitting periods. + Оберіть звуковий пристрій для передачі. +Якщо це ваш типовий пристрій для системних звуків, +вимкніть усі системні звуки — інакше ви передаватимете +в ефір усе, що система відтворить під час передачі. + + + + <html><head/><body><p>Refresh audio device list.</p></body></html> + <html><head/><body><p>Оновити перелік звукових пристроїв.</p></body></html> + + + + Refresh + Оновити + + + + <html><head/><body><p>Use TCI Audio when available.</p></body></html> + <html><head/><body><p>Використовувати звук TCI, коли він доступний.</p></body></html> + + + + Use TCI Audio (restart required) + Використовувати звук TCI (потрібен перезапуск) + + + + <html><head/><body><p>Rx audio level</p></body></html> + <html><head/><body><p>Рівень звуку на прийом</p></body></html> + + + + TCI receive audio level + + + + + + dB + + + + + Rx + + + + + <html><head/><body><p>Sort audio device names alphabetically.</p></body></html> + <html><head/><body><p>Сортувати назви звукових пристроїв за абеткою.</p></body></html> + + + + Sort alphabetically + Сортувати за абеткою + + + + <html><head/><body><p>Hide the usually unusable ALSA CARD subdevices on Linux.</p></body></html> + <html><head/><body><p>Приховати зазвичай непридатні підпристрої ALSA CARD у Linux.</p></body></html> + + + + Hide ALSA CARD subdevices (Linux only) + Приховати підпристрої ALSA CARD (лише Linux) + + + + + Save Directory + Каталог збереження + + + + Loc&ation: + Розташу&вання: + + + + Path to which .WAV files are saved. + Шлях, за яким зберігаються файли .WAV. + + + + + TextLabel + Напис + + + + Click to select a different save directory for .WAV files. + Натисніть, щоб обрати інший каталог для файлів .WAV. + + + + S&elect + О&брати + + + + + AzEl Directory + Каталог AzEl + + + + Location: + Розташування: + + + + Select + Обрати + + + + <html><head/><body><p>Enables additional line in azel.dat for Dpol parameter.</p></body></html> + <html><head/><body><p>Додає в azel.dat додатковий рядок із параметром Dpol.</p></body></html> + + + + Enable extra line in azel.dat + Додатковий рядок у azel.dat + + + + Power Memory By Band + Пам'ять потужності за діапазонами + + + + Remember power settings by band + Запам'ятовувати потужність для кожного діапазону + + + + Enable power memory during transmit + Пам'ять потужності під час передачі + + + + Transmit + Передача + + + + Enable power memory during tuning + Пам'ять потужності під час налаштування тоном + + + + Tune + Налаштування тоном + + + + Tx &Macros + &Макроси передачі + + + + Canned free text messages setup + Налаштування заготовлених повідомлень довільним текстом + + + + New &macro: + + + + + &Add + &Додати + + + + Add Tx macro + + + + + Adds the entered message to the saved Tx macro list. + + + + + New Tx macro message + + + + + Enter a saved free-text message for the Tx5 dropdown. Free-text messages are limited to 13 characters including spaces. + + + + + &Delete + &Видалити + + + + Reportin&g + &Звітування + + + + Reporting and logging settings + Налаштування звітування та ведення журналу + + + + Logging + Ведення журналу + + + + <html><head/><body><p>Check this option to note any Special Operating Activity in the comments field.</p></body></html> + <html><head/><body><p>Позначте, щоб зазначати в коментарі особливу подію чи активність.</p></body></html> + + + + Special operating activity to comments + Особливу активність — у коментар + + + + The program will pop up a partially completed Log QSO dialog when you send a 73 or free text message. + Програма показуватиме частково заповнене вікно запису QSO, коли ви надсилаєте 73 або повідомлення довільним текстом. + + + + Promp&t me to log QSO + Пи&тати перед записом QSO + + + + <html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html> + <html><head/><body><p>Позивний оператора, якщо він відрізняється від позивного станції.</p></body></html> + + + + <html><head/><body><p>Log 'ZZ00' as grid if the other station doesn't send you a grid.</p></body></html> + <html><head/><body><p>Записувати локатор «ZZ00», якщо станція не надіслала свого.</p></body></html> + + + + Fill missing grids with 'ZZ00' + Заповнювати відсутні локатори як «ZZ00» + + + + Op Call: + Позивний оператора: + + + + Some logging programs will not accept the type of reports +saved by this program. +Check this option to save the sent and received reports in the +comments field. + Деякі журнальні програми не приймають рапорти того типу, +який зберігає ця програма. +Позначте, щоб зберігати надіслані й отримані рапорти +в полі коментаря. + + + + d&B reports to comments + Рапорти в д&Б — у коментар + + + + <html><head/><body><p>Check to have QSOs logged automatically, when complete.</p></body></html> + <html><head/><body><p>Позначте, щоб зв'язки записувалися автоматично після завершення.</p></body></html> + + + + Log automatically + Записувати автоматично + + + + <html><head/><body><p>Use 'Log automatically' only for special operating activities.</p></body></html> + <html><head/><body><p>Використовувати автоматичний запис лише для особливих подій.</p></body></html> + + + + Contesting only + Лише в змаганнях + + + + <html><head/><body><p>Some logging programs will not accept WSJT-X mode names.</p></body></html> + <html><head/><body><p>Деякі журнальні програми не приймають назви режимів WSJT-X.</p></body></html> + + + + Con&vert mode to RTTY + Записувати режим як &RTTY + + + + <html><head/><body><p>Shorten 6-digit grid entries and log 4-digit grids instead.</p></body></html> + <html><head/><body><p>Скорочувати шестизначні локатори й записувати чотиризначні.</p></body></html> + + + + Log 4-digit grids + Записувати 4-значні локатори + + + + Network Services + Мережеві служби + + + + <html><head/><body><p>The program can send your station details and all decoded signals with grid squares as spots to the http://pskreporter.info web site.</p><p>This is used for reverse beacon analysis which is very useful for assessing propagation and system performance.</p></body></html> + <html><head/><body><p>Програма може надсилати дані вашої станції та всі декодовані сигнали з локаторами як споти на pskreporter.info. Це допомагає бачити поширення радіохвиль і працездатність вашої станції.</p></body></html> + + + + Enable &PSK Reporter Spotting + Надсилати споти на &PSK Reporter + + + + <html><head/><body><p>Check this option if a reliable connection is needed</p><p>Most users do not need this, the default uses UDP which is more efficient. Only check this if you have evidence that UDP traffic from you to PSK Reporter is being lost.</p></body></html> + <html><head/><body><p>Позначте, якщо потрібне надійне з'єднання.</p><p>Більшості це не потрібно: типово використовується UDP, і він ефективніший. Вмикайте лише тоді, коли маєте підстави вважати, що ваші споти не доходять.</p></body></html> + + + + Use TCP/IP connection + З'єднання через TCP/IP + + + + UDP Server + Сервер UDP + + + + UDP Server: + Сервер UDP: + + + + <html><head/><body><p>Optional hostname of network service to receive decodes.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the broadcasting of UDP status updates.</p></body></html> + <html><head/><body><p>Необов'язкове ім'я вузла мережевої служби, яка прийматиме декоди.</p><p>Допустимі формати: ім'я вузла, адреса IPv4, адреса IPv6, групова адреса IPv4 multicast або групова адреса IPv6 multicast.</p><p>Очищення цього поля вимикає трансляцію оновлень стану UDP.</p></body></html> + + + + UDP Server port number: + Номер порту сервера UDP: + + + + <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> + <html><head/><body><p>Вкажіть номер порту сервера UDP, якому WSJT-X надсилатиме оновлення. Нуль означає, що нічого не надсилатиметься.</p></body></html> + + + + Outgoing interfaces: + Вихідні інтерфейси: + + + + <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> + <html><head/><body><p>Надсилаючи оновлення на групову (multicast) адресу, потрібно вказати, через які мережеві інтерфейси їх передавати. Якщо петльовий інтерфейс підтримує multicast, оберіть принаймні його.</p><p>Для більшості користувачів достатньо петльового інтерфейсу: це дає змогу кільком іншим програмам на тому самому комп'ютері взаємодіяти з WSJT-X. Якщо оновлення стану мають отримувати програми на інших вузлах, слід використовувати відповідний мережевий інтерфейс.</p><p>У деяких системах Linux може знадобитися увімкнути multicast на петльовому мережевому інтерфейсі.</p></body></html> + + + + Multicast TTL: + TTL для multicast: + + + + <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> + <html><head/><body><p>Задає, скільки маршрутизаторів дозволено пройти груповим датаграмам. Майже всім тут варто лишити 1, щоб вихідний груповий трафік не виходив за межі локальної мережі.</p></body></html> + + + + <html><head/><body><p>With this enabled WSJT-X will accept certain requests back from a UDP server that receives decode messages.</p></body></html> + <html><head/><body><p>З цим параметром WSJT-X прийматиме певні зворотні запити від сервера UDP, який отримує повідомлення про декоди.</p></body></html> + + + + Accept UDP requests + Приймати запити UDP + + + + <html><head/><body><p>Indicate acceptance of an incoming UDP request. The effect of this option varies depending on the operating system and window manager, its intent is to notify the acceptance of an incoming UDP request even if this application is minimized or hidden.</p></body></html> + <html><head/><body><p>Позначати прийняття вхідного запиту UDP. Дія цього параметра залежить від операційної системи та віконного менеджера; його призначення — повідомити, що запит прийнято.</p></body></html> + + + + Notify on accepted UDP request + Сповіщати про прийнятий запит UDP + + + + <html><head/><body><p>Restore the window from minimized if an UDP request is accepted.</p></body></html> + <html><head/><body><p>Відновлювати згорнуте вікно, якщо прийнято запит UDP.</p></body></html> + + + + Accepted UDP request restores window + Прийнятий запит UDP відновлює вікно + + + + Secondary UDP Server (deprecated) + Другий сервер UDP (застарілий) + + + + <html><head/><body><p>When checked, WSJT-X will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html> + <html><head/><body><p>Якщо позначено, WSJT-X розсилатиме записаний зв'язок у форматі ADIF на вказані вузол і порт.</p></body></html> + + + + Enable logged contact ADIF broadcast + Розсилати ADIF записаних зв'язків + + + + Server name or IP address: + Ім'я або IP-адреса сервера: + + + + <html><head/><body><p>Optional host name of N1MM Logger+ program to receive ADIF UDP broadcasts. This is usually 'localhost' or ip address 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable broadcasting of ADIF information via UDP.</p></body></html> + <html><head/><body><p>Необов'язкове ім'я вузла програми N1MM Logger+, яка прийматиме розсилку ADIF по UDP. Зазвичай це «localhost» або адреса 127.0.0.1.</p><p>Допустимі формати: ім'я вузла, адреса IPv4, адреса IPv6, групова адреса IPv4 multicast або групова адреса IPv6 multicast.</p><p>Очищення цього поля вимикає трансляцію даних ADIF через UDP.</p></body></html> + + + + Server port number: + Номер порту сервера: + + + + <html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html> + <html><head/><body><p>Вкажіть номер порту, який WSJT-X використовуватиме для розсилки даних журналу у форматі ADIF по UDP. Для N1MM Logger+ це значення має бути 2333. Нуль означає, що нічого не розсилатиметься.</p></body></html> + + + + Frequencies + Частоти + + + + Default frequencies and band specific station details setup + Налаштування типових частот і даних станції за діапазонами + + + + <html><head/><body><p>See &quot;Frequency Calibration&quot; in the WSJT-X User Guide for details of how to determine these parameters for your radio.</p></body></html> + <html><head/><body><p>Подробиці про те, як визначити ці параметри для вашого трансивера, шукайте в посібнику WSJT-X у розділі «Frequency Calibration».</p></body></html> + + + + Frequency Calibration + Калібрування частоти + + + + Slope: + Нахил: + + + + ppm + + + + + Intercept: + Зсув: + + + + Hz + + + + + Working Frequencies + Робочі частоти + + + + + Insert, delete, load, save, merge, or reset working frequencies. + + + + + Working frequencies actions + + + + + + + Actions... + + + + + <html><head/><body><p>Right click to maintain the working frequencies list.</p></body></html> + <html><head/><body><p>Правий клік — редагування переліку робочих частот.</p></body></html> + + + + Station Information + Дані станції + + + + + Insert or delete station information rows. + + + + + Station information actions + + + + + Items may be edited. +Right click for insert and delete options. + Рядки можна редагувати. +Правий клік — вставлення та видалення. + + + + Colors + Кольори + + + + Decode Highlightling + Виділення декодів + + + + Change or reset colors for the selected highlighting rule. + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move Up + + + + + Move the selected highlighting rule later in priority order. + + + + + Move Down + + + + + <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> + <html><head/><body><p>Натисніть, щоб повернути всім видам виділення типові кольори та пріоритети.</p></body></html> + + + + Reset Highlighting to Default 1 + Типове виділення 1 + + + + Reset Highlighting to Default 2 + Типове виділення 2 + + + + <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> + <html><head/><body><p>Натисніть, щоб ще раз переглянути файл wsjtx_log.adi і оновити відомості про попередні зв'язки.</p></body></html> + + + + Rescan ADIF Log + Перечитати журнал ADIF + + + + <html><head/><body><p>Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.</p><p>Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.</p></body></html> + <html><head/><body><p>Вмикайте й вимикайте прапорцями; правий клік на рядку змінює або скидає колір тексту чи тла та повертає типові значення. Перетягуванням змінюється пріоритет.</p><p>Колір тексту й колір тла можна окремо встановити або скасувати; скасування означає, що для цього типу елемента колір не призначено й може застосовуватися колір елементів з нижчим пріоритетом.</p></body></html> + + + + Check to for grid highlighting to only apply to unworked grid fields + Позначте, щоб виділення локаторів діяло лише для неопрацьованих полів + + + + Only grid Fields sought + Лише потрібні поля локатора + + + + Include extra WAE entities + Враховувати додаткові суб'єкти WAE + + + + Highlight also messages with 73 or RR73 + Виділяти також повідомлення з 73 або RR73 + + + + <html><head/><body><p>Check to indicate new DXCC entities, grid squares, and callsigns per mode.</p></body></html> + <html><head/><body><p>Позначте, щоб нові країни, локатори та позивні визначалися окремо для кожного режиму.</p></body></html> + + + + Highlight by Mode + Виділяти за режимом + + + + Highlight orange: + Виділяти помаранчевим: + + + + Highlight blue: + Виділяти синім: + + + + <html><head/><body><p>Controls for Logbook of the World user lookup.</p></body></html> + <html><head/><body><p>Налаштування перевірки користувачів Logbook of the World.</p></body></html> + + + + Logbook of the World User Validation + Перевірка користувачів Logbook of the World + + + + Users CSV file URL: + Адреса файлу CSV з користувачами: + + + + <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> + <html><head/><body><p>Адреса файлу ARRL LotW із датами й часом останніх вивантажень; за ним виділяються декоди станцій, які, як відомо, вивантажують свій журнал у LotW.</p></body></html> + + + + http://lotw.arrl.org/lotw-user-activity.csv + + + + + <html><head/><body><p>Push this button to fetch the latest LotW user's upload date and time data file.</p></body></html> + <html><head/><body><p>Натисніть, щоб отримати найновіший файл із датами вивантажень користувачів LotW.</p></body></html> + + + + Fetch Now + Отримати зараз + + + + <html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html> + <html><head/><body><p>Задайте, наскільки давнім може бути останнє вивантаження користувача в LotW, щоб його ще виділяти.</p></body></html> + + + + Days since last upload + Днів від останнього вивантаження + + + + days + днів + + + + Age of last upload less than: + Останнє вивантаження не давніше ніж: + + + + CTY File Download + Завантаження файлу CTY + + + + CTY File Version: + Версія файлу CTY: + + + + Download Latest CTY.dat + Завантажити найновіший CTY.dat + + + + CALL3 File Download + Завантаження файлу CALL3 + + + + CALL3 File Version: + Версія файлу CALL3: + + + + Dowload latest CALL3.TXT file. + Завантажити найновіший файл CALL3.TXT. + + + + Download CALL3.TXT for terrestrial use + Завантажити CALL3.TXT для наземних зв'язків + + + + Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. + Завантажити найновіший CALL3.TXT для EME. Ця версія придатна для глибокого пошуку JT65. + + + + Download CALL3.TXT for EME + Завантажити CALL3.TXT для EME + + + + Advanced + Додатково + + + + + <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> + <html><head/><body><p>Вивантажувати записані зв'язки в Cloudlog або Wavelog.</p></body></html> + + + + + Upload QSOs to Cloudlog or Wavelog + Вивантажувати QSO в Cloudlog або Wavelog + + + + + <html><head/><body><p>API URL for Cloudlog or Wavelog.</p></body></html> + <html><head/><body><p>Адреса API для Cloudlog або Wavelog.</p></body></html> + + + + API URL: + Адреса API: + + + + + <html><head/><body><p>Your API key.</p></body></html> + <html><head/><body><p>Ваш ключ API.</p></body></html> + + + + API Key: + Ключ API: + + + + Miscellaneous + Різне + + + + Degrade S/N of .wav file: + Погіршити співвідношення сигнал/шум у файлі .wav: + + + + + For offline sensitivity tests + Для перевірок чутливості без ефіру + + + + Receiver bandwidth: + Смуга приймача: + + + + Hz + + + + + Tx delay: + Затримка передачі: + + + + Minimum delay between assertion of PTT and start of Tx audio. + Найменша затримка між вмиканням передачі та початком звуку. + + + + s + с + + + + + Tone spacing + Крок між тонами + + + + <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> + <html><head/><body><p>Формувати звук передачі з подвоєним кроком між тонами. Призначено для особливих випадків, як-от вимірювання доплерівського розширення на EME.</p></body></html> + + + + x 2 + + + + + <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> + <html><head/><body><p>Формувати звук передачі з учетверенним кроком між тонами. Призначено для особливих випадків, як-от вимірювання доплерівського розширення на EME.</p></body></html> + + + + x 4 + + + + + + Waterfall spectra + Спектри водоспаду + + + + Low sidelobes + Низькі бічні пелюстки + + + + Most sensitive + Найбільша чутливість + + + + <html><head/><body><p>User-selectable parameters for JT65 VHF/UHF/Microwave decoding.</p></body></html> + <html><head/><body><p>Параметри декодування JT65 на УКХ, ДВЧ і НВЧ, які обирає користувач.</p></body></html> + + + + JT65 VHF/UHF/Microwave decoding parameters + Параметри декодування JT65 на УКХ / ДВЧ / НВЧ + + + + Random erasure patterns: + Випадкові шаблони стирання: + + + + <html><head/><body><p>Maximum number of erasure patterns for stochastic soft-decision Reed Solomon decoder is 10^(n/2).</p></body></html> + <html><head/><body><p>Найбільша кількість шаблонів стирання для стохастичного декодування Ріда — Соломона з м'якими рішеннями.</p></body></html> + + + + Aggressive decoding level: + Рівень агресивності декодування: + + + + <html><head/><body><p>Higher levels will increase the probability of decoding, but will also increase probability of a false decode.</p></body></html> + <html><head/><body><p>Вищі рівні збільшують імовірність декодування, але водночас і ймовірність хибних декодів.</p></body></html> + + + + Two-pass decoding + Декодування у два проходи + + + + + <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> + <html><head/><body><p>Вивантажувати записані зв'язки на eqsl.cc.</p></body></html> + + + + + Upload QSOs to eQSL.cc + Вивантажувати QSO на eQSL.cc + + + + + <html><head/><body><p>Your username.</p></body></html> + <html><head/><body><p>Ваше ім'я користувача.</p></body></html> + + + + Username: + Ім'я користувача: + + + + + <html><head/><body><p>Your logon password.</p></body></html> + <html><head/><body><p>Ваш пароль для входу.</p></body></html> + + + + Password: + Пароль: + + + + + <html><head/><body><p>Your QTH nickname, if you have more than one QTH.</p></body></html> + <html><head/><body><p>Позначка вашого QTH, якщо їх у вас кілька.</p></body></html> + + + + QTH: + + + + + Special operating activity + Особлива активність + + + + <html><head/><body><p>ARRL International Digital Contest</p></body></html> + <html><head/><body><p>Міжнародні цифрові змагання ARRL</p></body></html> + + + + ARRL Digi Contest + + + + + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> + <html><head/><body><p>Всесвітні змагання в цифрових режимах</p></body></html> + + + + + WW Digi Contest + + + + + <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> + <html><head/><body><p>Увімкнути або вимкнути протокол коротких повідомлень FT4 для NCCC Sprint.</p></body></html> + + + + NCCC Sprint + + + + + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> + <html><head/><body><p>Обмін для ARRL Field Day: кількість передавачів, клас і секція ARRL/RAC.</p></body></html> + + + + + ARRL Field Day + + + + + + Field Day exchange + Обмін Field Day + + + + FD Exch: + Обмін FD: + + + + 6A SNJ + + + + + <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> + <html><head/><body><p>Режим експедиції FT8: мисливець, який викликає експедицію.</p></body></html> + + + + + Hound + Мисливець + + + + + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> + <html><head/><body><p>FT Roundup і схожі змагання. Обмін — штат США, канадська провінція або «DX».</p></body></html> + + + + + FT Roundup messages + Повідомлення FT Roundup + + + + FT RU Exch: + + + + + NJ + + + + + <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> + <html><head/><body><p>Європейські змагання на УКХ і вище, де потрібні рапорт, порядковий номер і шестизначний локатор.</p></body></html> + + + + + EU VHF Contest + + + + + <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> + <html><head/><body><p>Позначте, щоб передавати (експедиція) або приймати (мисливець) сигнал SuperFox.</p></body></html> + + + + SuperFox mode + Режим SuperFox + + + + <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> + <html><head/><body><p>Показувати повідомлення OTP у вікні активності діапазону.</p></body></html> + + + + Show OTP messages + Показувати повідомлення OTP + + + + OTP URL: + + + + + <html><head/><body><p>URL used to verify OTP codes.</p></body></html> + <html><head/><body><p>Адреса, за якою перевіряються коди OTP.</p></body></html> + + + + https://www.9dx.cc + + + + + <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> + <html><head/><body><p>Північноамериканські змагання на УКХ, ДВЧ і НВЧ та інші, де обміном є чотиризначний локатор.</p></body></html> + + + + NA VHF Contest + + + + + NA VHF + + + + + <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> + <html><head/><body><p>Режим експедиції FT8: оператор експедиції.</p></body></html> + + + + + Fox + + + + + <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> + <html><head/><body><p>Натисніть, щоб увімкнути перевірку експедиції через OTP. Потрібен інтернет.</p></body></html> + + + + OTP + + + + + Key: + + + + + <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> + <html><head/><body><p>Ключ експедиції для створення кодів OTP.</p></body></html> + + + + M2ZUU5CW6EVOY2HU + + + + + Interval + + + + + <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> + <html><head/><body><p>Як часто надсилаються повідомлення OTP. Оберіть 1, щоб підписувати кожне.</p></body></html> + + + + <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> + + <html><head/><body><p>Викликати CQ із власною назвою змагань замість TEST, RU чи WW.</p></body></html> + + + + CQ with individual contest name + CQ із власною назвою змагань + + + + Contest name: + Назва змагань: + + + + <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> + <html><head/><body><p>Передавати в обміні чотиризначний локатор замість рапорту. Дає повідомлення типу q3.</p></body></html> + + + + <html><head/><body><p>Allow automatic Doppler tracking and split/Fake It/XIT to correct the transmit frequency while transmitting, including corrections of tens of kHz on microwave bands.</p><p>This option does not allow nominal dial or band changes while transmitting or tuning. Leave it unchecked if your rig cannot accept frequency-setting CAT commands while transmitting; WSJT-X will then make one midpoint Doppler correction before transmission starts.</p></body></html> + + + + + Allow Tx-frequency corrections while transmitting + + + + + <html><head/><body><p>Download the latest libhamlib-4.dll file from Hamlib SourceForge snapshots. </p><p>Note: This function is only available on Windows.</p></body></html> + + + + + Delete Tx macro + + + + + Deletes the selected Tx macro, or the focused macro if no row is selected. + + + + + Move &Up + + + + + Move Tx macro up + + + + + Moves the selected Tx macro one position earlier in the list. + + + + + Move D&own + + + + + Move Tx macro down + + + + + Moves the selected Tx macro one position later in the list. + + + + + Drag and drop items to rearrange order +Right click for item specific actions +Click, SHIFT+Click and, CTRL+Click to select items + + + + + Saved Tx macro messages + + + + + Saved free-text messages for the main window Tx5 dropdown. Use Move Up and Move Down or drag and drop to reorder messages. + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with orange background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with blue background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + LotW users CSV URL + + + + + Cloudlog or Wavelog + + + + + + <html><head/><body><p>Your Cloudlog or Wavelog station profile.</p></body></html> + + + + + Station profile: + + + + + <html><head/><body><p>Check the Cloudlog or Wavelog connection, API key, station profile, and upload path where safe.</p><p>The button will turn green if the connection can upload QSOs, orange if the key is valid but read-only, and red if the configuration is unusable.</p></body></html> + + + + + Check Connection + + + + + 2x tone spacing + + + + + 4x tone spacing + + + + + eQSL.cc + + + + + + Enable special operating activity + + + + + Enable OTP verification + + + + + + OTP key + + + + + + OTP interval + + + + + + OTP URL + + + + + + FT Roundup exchange + + + + + Q65 Pileup + + + + + + Contest name + + + + + Alerts + + + + + Ensure that you have made meaningful settings on the Colors tab, so that you see which message triggered the alert. + Переконайтеся, що на вкладці кольорів зроблено осмислені налаштування — тоді буде видно, яке саме повідомлення викликало звукове сповіщення. + + + + NOTES + + + + + Ensure that your rig is NOT connected via "Default Device". + Переконайтеся, що ваш трансивер НЕ під'єднано через «Пристрій за замовчуванням». + + + + Audio Alerts will be played on the default audio device (usually the loudspeaker of your PC). + Звукові сповіщення відтворюватимуться на типовому звуковому пристрої (зазвичай це динамік комп'ютера). + + + + "Wanted callsigns, grids, prefixes and directional calls" uses the entries from "Highlight orange" and "Highlight blue". + «Потрібні позивні, локатори, префікси й спрямовані виклики» бере записи з полів «Виділяти помаранчевим» і «Виділяти синім». + + + + This requirement is fulfilled when your rig is connected via USB audio. + Ця вимога виконується, якщо трансивер під'єднано через звук по USB. + + + + Audio Alerts + Звукові сповіщення + + + + + New Continent + Новий континент + + + + My Call in message + Мій позивний у повідомленні + + + + My Call + + + + + + New CQ Zone + Нова зона CQ + + + + Message received + Отримано повідомлення + + + + + DX Call or DX Grid in message + Позивний або локатор DX у повідомленні + + + + <html><head/><body><p>Wanted callsigns, grids, prefixes and directional calls. This alert category uses the entries from &quot;Highlight orange&quot; and &quot;Highlight blue&quot;.</p></body></html> + <html><head/><body><p>Потрібні позивні, локатори, префікси й спрямовані виклики. Це сповіщення бере записи з полів виділення помаранчевим і синім.</p></body></html> + + + + Wanted callsigns, grids, prefixes and directional calls + Потрібні позивні, локатори, префікси й спрямовані виклики + + + + + New DXCC on Band + Нова країна на діапазоні + + + + + New Continent on Band + Новий континент на діапазоні + + + + + New Grid on Band + Новий локатор на діапазоні + + + + + New Grid + Новий локатор + + + + + New DXCC + Нова країна + + + + + New ITU Zone + Нова зона ITU + + + + + New ITU Zone on Band + Нова зона ITU на діапазоні + + + + + New CQ Zone on Band + Нова зона CQ на діапазоні + + + + + CQ in message + CQ у повідомленні + + + + IMPORTANT + + + + + Voices: + + + + + default + + + + + <html><head/><body><p>Test the alert sounds.</p></body></html> + <html><head/><body><p>Перевірити звуки сповіщень.</p></body></html> + + + + Test + + + + + Use of this feature requires that your computer is equipped with two sound cards. + Ця можливість потребує двох звукових карт у комп'ютері. + + + + Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. + Категорії сповіщень вище лінії потребують увімкненого параметра «Показувати країну, локатор і чи був зв'язок раніше» на вкладці загальних налаштувань. + + + + Toggle Audio Alerts on/off. Alerts will be played on "DefaultAudioDevice". DON'T ENABLE AUDIO ALERTS WHEN YOUR RIG IS CONNECTED VIA THIS SOUNDCARD !!! + Увімкнути або вимкнути звукові сповіщення. Вони відтворюватимуться на типовому звуковому пристрої. НЕ ВМИКАЙТЕ ЗВУКОВІ СПОВІЩЕННЯ, якщо трансивер під'єднано саме до нього. + + + + Enable Audio Alerts + Увімкнути звукові сповіщення + + + + Filters + Фільтри + + + + Territories 1-4 for the Hide checkboxes in the View menu + Території 1–4 для галочок «Ховати» в меню «Вигляд» + + + + Blacklist + + + + + Filters for the Band Activity window + Фільтри для вікна активності діапазону + + + + Hide messages containing the following callsigns or keywords: + Ховати повідомлення з такими позивними або словами: + + + + Show only messages containing the following callsigns or keywords: + Показувати лише повідомлення з такими позивними або словами: + + + + <html><head/><body><p>Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed).</p></body></html> + <html><head/><body><p>Застосовувати фільтри лише до Wait and Pounce, CQ: First тощо (усі повідомлення при цьому показуються).</p></body></html> + + + + Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed) + Застосовувати фільтри лише до Wait and Pounce, CQ: First тощо (усі повідомлення показуються) + + + + Always pass messages with the following keywords: + Завжди пропускати повідомлення з такими словами: + + + + Whitelist + + + + + <html><head/><body><p>Apply filters only to the callsigns of the calling stations. Usually the second word of the messages is analyzed, for directional calls the third word.</p></body></html> + <html><head/><body><p>Застосовувати фільтри лише до позивних станцій, які викликають. Зазвичай саме це й потрібно.</p></body></html> + + + + Apply filters only to the callsigns of the calling stations + Застосовувати фільтри лише до позивних станцій, які викликають + + + + Always Pass + Завжди пропускати + + + + <html><head/><body><p>Use “worked today and yesterday” instead of “worked today” for the 3 related Quick Filters.</p></body></html> + <html><head/><body><p>Використовувати «сьогодні й учора» замість «сьогодні» у швидких фільтрах.</p></body></html> + + + + Quick Filters: Hide/Ignore/Highlight "worked today and yesterday" instead of "worked today" (UTC) + Швидкі фільтри: ховати, ігнорувати й виділяти за «сьогодні й учора» замість «сьогодні» + + + + <html><head/><body><p>Discard (Cancel) or apply (OK) configuration changes including</p><p>resetting the radio interface and applying any soundcard changes</p></body></html> + <html><head/><body><p>Скасувати («Скасувати») або застосувати («Гаразд») зміни налаштувань, зокрема</p><p>скидання інтерфейсу трансивера та застосування будь-яких змін звукової карти.</p></body></html> + + + + main + + + Lock file: %1 + + + + + Owner process: %1 + + + + + Owner application: %1 + + + + + Owner host: %1 + + + + + Owner information is not available. + + + + + Remove error: %1 + + + + + Another instance may be running + + + + + WSJT-X could not lock its temporary instance file. + +If another WSJT-X window is still running, choose No. +Use a unique rig name to run more than one instance. + +If WSJT-X crashed or will not restart, choose Remove Lock File. +Choose Retry after closing the other instance. + + + + + Remove Lock File + + + + + Unable to remove stale lock file + + + + + Close any running WSJT-X instance or remove the lock file manually after confirming WSJT-X is not running. + + + + + Failed to create a temporary directory + Не вдалося створити тимчасовий каталог + + + + + Path: "%1" + + + + + Failed to create a usable temporary directory + Не вдалося створити придатний тимчасовий каталог + + + + Another application may be locking the directory + Можливо, каталог зайнято іншою програмою + + + + Failed to create data directory + Не вдалося створити каталог даних + + + + path: "%1" + + + + + Shared memory error + Помилка спільної пам'яті + + + + Unable to create shared memory segment + Не вдалося створити сегмент спільної пам'яті + + + + Sub-process error + Помилка підпроцесу + + + + Failed to close orphaned jt9 process + Не вдалося завершити осиротілий процес jt9 + + + + wf_palette_design_dialog + + + Palette Designer + Конструктор палітри + + + + <html><head/><body><p>Double click a color to edit it.</p><p>Right click to insert or delete colors.</p><p>Colors at the top represent weak signals</p><p>and colors at the bottom represent strong</p><p>signals. You can have up to 256 colors.</p></body></html> + <html><head/><body><p>Подвійний клік на кольорі — редагувати його.</p><p>Клік правою кнопкою вставляє або видаляє кольори.</p><p>Кольори вгорі позначають слабкі сигнали,</p><p>а кольори внизу — сильні.</p><p>Можна використати до 256 кольорів.</p></body></html> + + + diff --git a/translations/wsjtx_zh.ts b/translations/wsjtx_zh.ts index f70f71f2..bca0c0cd 100644 --- a/translations/wsjtx_zh.ts +++ b/translations/wsjtx_zh.ts @@ -118,18 +118,17 @@ 活动电台 - - + Wanted only 仅渴望 - + Message 信息 - + My call only 仅我的呼号 @@ -137,149 +136,178 @@ Astro - - + + Doppler tracking 多普勒跟踪 - + <html><head/><body><p>One station does all Doppler shift correction, their QSO partner receives and transmits on the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>一个站执行所有多普勒换档校正, 他们的通联合作伙伴接收和传输 sked 频率.</p><p>如果无线电设备在传输单个校正时不接受 CAT QSY 命令则在整个传输期间应用.</p></body></html> - + Full Doppler to DX Grid 全多普勒到 DX 网格 - + <html><head/><body><p>Transmit takes place on sked frequency and receive frequency is corrected for own echoes. </p><p>This mode can be used for calling CQ, or when using Echo mode.</p></body></html> <html><head/><body><p>传输以 sked 频率进行, 接收频率被校正为自己的回波. </p><p>此模式可用于呼叫 CQ 或使用回波模式时.</p></body></html> - + Own Echo 自己的 Echo - + <html><head/><body><p>Both stations correct for Doppler shift such that they would be heard on the moon at the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p><p>Use this option also for Echo mode.</p></body></html> <html><head/><body><p>两个站都对多普勒移位进行校正, 这样它们就会在月球上以sked频率听到.</p><p>如果无线电设备在传输单个校正时不接受 CAT QSY 命令, 则在整个传输期间应用.</p><p>对于 Echo 模式也使用此选项.</p></body></html> - + Constant frequency on Moon 月球上的恒定频率 - + <html><head/><body><p>DX station announces their TX Freq, which is entered as the Sked Freq. Correction applied to RX and TX so you appear on the DX's station's own echo Freq.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>DX电台宣布其发射频率, 这是输入作为Sked频率修正应用于接收和发射, 所以你出现在DX电台自己的 Echo 频率.</p><p>如果无线电设备在传输单个校正时不接受 CAT QSY 命令则在整个传输期间应用.</p></body></html> - + On DX Echo 在 DX Echo - + <html><head/><body><p>Tune radio manually and select this mode to put your echo on the same frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>手动调谐无线电设备并选择此模式, 将 Echo 置于相同频率.</p><p>如果无线电设备在传输单个校正时不接受 CAT QSY 命令则在整个传输期间应用.</p></body></html> - + Call DX 呼叫 DX - + <html><head/><body><p>No Doppler shift correction is applied. This may be used when the QSO partner does full Doppler correction to your grid square.</p></body></html> <html><head/><body><p>未应用多普勒换文件校正. 当通联合作伙伴对网格方进行完全多普勒校正时可能会使用.</p></body></html> - + None 无 - + Sked frequency Sked 频率 - - + + 0 0 - + + kHz + + + + + Set kHz + + + + + <html><head/><body><p>Tx shift relative to Rx sked frequency</p></body></html> + + + + + MHz + + + + + Tx Shift + + + + Rx: 接收: - + Tx: 发射: - <html><head/><body><p>Press and hold the CTRL key to adjust the sked frequency manually with the rig's VFO dial or enter frequency directly into the band entry field on the main window.</p></body></html> - <html><head/><body><p>按住 CTRL 键使用手动 sked 频率与无线电设备 VFO 将频率直接拨入主窗口中的频段输入字段.</p></body></html> + <html><head/><body><p>按住 CTRL 键使用手动 sked 频率与无线电设备 VFO 将频率直接拨入主窗口中的频段输入字段.</p></body></html> - + Echo Mode Echo 模式 - + Hz 赫兹 - + RIT RIT - Dither - 抖动 + 抖动 - Tx Shift relative to Rx Sked Freq - 相对于接收 Sked 频率的发射偏移 + 相对于接收 Sked 频率的发射偏移 - Enter large offset - 输入大偏移量 + 输入大偏移量 - MHz - 兆赫 + 兆赫 - Shift - 偏移 + 偏移 - + Enable 启用 - + + Dither + + + + + Ctl-Lock Sked Freq + + + + Astro Data 天体数据 - + Astronomical Data 天文数据 @@ -399,6 +427,166 @@ 呼号 + + Cloudlog + + + + QSO could not be sent to Cloudlog. + + + + + + QSO upload was rejected by Cloudlog. + + + + + HTTP status %1. Response was not JSON. + + + + + Cloudlog returned an unexpected upload response. + + + + + Cloudlog reported upload status: %1 + + + + + HTTP status %1. + + + + + Cloudlog::impl + + + Enter a Cloudlog or Wavelog URL. + + + + + The connection check needs a base URL before it can contact the API. + + + + + Cloudlog or Wavelog authentication endpoint was not found. + + + + + Tried /api/check_auth, /index.php/api/check_auth, and /index.php/api/auth. + + + + + API key is valid but read-only. + + + + + Generate a read/write API key before enabling QSO uploads. + + + + + API key is invalid. + + + + + Authentication response was not usable. + + + + + Station profile response was not JSON. + + + + + Configured station profile was not found. + + + + + No station profiles were returned by the server. + + + + + Available station profiles: %1 + + + + + Wavelog dry-run QSO endpoint was not found. + + + + + Tried /api/qso/true and /index.php/api/qso/true after Wavelog was identified. + + + + + Dry-run upload response was not usable. + + + + + + Connection check passed. + + + + + Writable API key, station profile, and dry-run QSO upload were validated. + + + + + Dry-run QSO upload was rejected. + + + + + + The QSO dry-run upload was rejected. + + + + + Dry-run QSO upload returned an unexpected response. + + + + + Writable API key and station profile were validated. No safe dry-run QSO endpoint was identified, so no test QSO was uploaded. + + + + + Network error while checking Cloudlog or Wavelog. + + + + + Cloudlog Error! + + + + + Reason: %1 + + + ColorHighlighting @@ -505,90 +693,327 @@ Configuration::impl - - - + + + &Delete 删除(&D) - - + + &Insert ... 插入(&I) ... - + + Wanted territory %1 + + + + + Blacklist keyword %1 + + + + + Whitelist keyword %1 + + + + + Always pass keyword %1 + + + + + CAT control port + + + + + CAT baud rate + + + + + Default CAT data bits + + + + + Seven CAT data bits + + + + + Eight CAT data bits + + + + + Default CAT stop bits + + + + + One CAT stop bit + + + + + Two CAT stop bits + + + + + Default CAT handshake + + + + + No CAT handshake + + + + + XON/XOFF CAT handshake + + + + + Hardware CAT handshake + + + + + Force DTR control line + + + + + Force RTS control line + + + + + VOX PTT method + + + + + DTR PTT method + + + + + CAT PTT method + + + + + RTS PTT method + + + + + PTT control port + + + + + Rear or data transmit audio source + + + + + Front or mic transmit audio source + + + + + No radio mode control + + + + + USB radio mode + + + + + Data or packet radio mode + + + + + No split operation + + + + + Rig split operation + + + + + Fake It split operation + + + + + CAT poll interval + + + + + Frequency calibration slope + + + + + Frequency calibration intercept + + + + + Working frequencies table + + + + + Station information table + + + + + Decode highlighting rules + + + + + Highlighting rules and priorities for decoded messages. + + + + + Decode highlighting actions + + + + + Change or reset colors for the selected highlighting rule. + + + + + Move selected highlighting rule up + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move selected highlighting rule down + + + + + Move the selected highlighting rule later in priority order. + + + + + Orange highlight callsigns and grids + + + + + Blue highlight callsigns and grids + + + + Failed to create save directory 无法创建保存目录 - + path: "%1% 目录: "%1% - + Failed to create samples directory 无法创建示例目录 - + path: "%1" 目录: "%1" - + + Reset all decode highlighting and priorities to Default 1 values + + + + + Reset all decode highlighting and priorities to Default 2 values + + + API key OK - API密匙确认 + API密匙确认 - API key read-only - API密匙 唯读 + API密匙 唯读 - API key invalid - API密匙 无效 + API密匙 无效 - + &Load ... 加载(&L) ... - + &Save as ... 另存为(&S) ... - + &Merge ... 合并(&M) ... - + &Reset 重置(&R) - + Serial Port: 串行端口: - + Serial port used for CAT control 用于CAT控制的串行端口 - + TCI Server: TCI 服务器: - + Optional hostname and port of TCI service. Leave blank for a sensible default on this machine. Formats: @@ -603,12 +1028,12 @@ Formats: [IPv6-地址]:端口 - + Network Server: 网络服务器: - + Optional hostname and port of network service. Leave blank for a sensible default on this machine. Formats: @@ -623,12 +1048,12 @@ Formats: [IPv6-地址]:端口 - + USB Device: USB 设备: - + Optional device identification. Leave blank for a sensible default for the rig. Format: @@ -639,87 +1064,85 @@ Format: [VID[:PID[:供应商[:产品]]]] - - + + Invalid audio input device 无效的音频输入设备 - + Invalid audio output device 无效的音频输出设备 - + Invalid PTT method 无效的PTT方法 - + Invalid PTT port 无效的PTT端口 - - + + Invalid Contest Exchange 无效的竞赛交换数据 - + You must input a valid ARRL Field Day exchange 您必须输入有效的 ARRL Field Day交换数据 - + You must input a valid ARRL RTTY Roundup exchange 您必须输入有效的 ARRL RTTY Roundup 交换数据 - + Pending DNS lookup, please try again later 等待域名系统查找, 请稍后再试 - - + + Reset Decode Highlighting 重置解码突出显示 - - Reset all decode highlighting and priorities to default values - 将所有解码突出显示和优先级重置为默认值 + 将所有解码突出显示和优先级重置为默认值 - + Error Loading CTY.DAT 载入 CTY.DAT 错误 - + Error Loading CALL3.TXT file 载入 CALL3.TXT 错误 - + WSJT-X Decoded Text Font Chooser WSJT-X 解码文本字体选择 - - + + Hamlib update only available on Windows. Hamlib更新仅在Windows上可用. - + Error Loading libhamlib-4.dll 载入 libhamlib-4.dll 错误 - + Hamlib Update successful New Hamlib will be used after restart @@ -728,7 +1151,7 @@ New Hamlib will be used after restart 重新启动后将使用新的Hamlib - + Hamlib successfully reverted Reverted Hamlib will be used after restart @@ -737,131 +1160,131 @@ Reverted Hamlib will be used after restart 重新启动后将使用还原的 Hamlib - + No Hamlib update found that could be reverted 找不到可以还原的Hamlib更新 - + Error in network address 网络IP错误 - + UDP server DNS lookup failed UDP服务器域名系统查找失败 - + MAC-ambiguous multicast groups addresses not supported 不支持MAC不明确的多播组地址 - + Load Working Frequencies 载入工作频率 - - - + + + Frequency files (*.qrg *.qrg.json);;All files (*.*) 频率文件 (*.qrg);;所有文件 (*.*) - + Replace Working Frequencies 替换工作频率 - + Are you sure you want to discard your current working frequencies and replace them with the loaded ones? 是否确实要放弃当前工作频率, 并将其替换为加载的频率? - + Merge Working Frequencies 合并工作频率 - + Error reading frequency file 读取频率文件错误 - - - + + + Not a valid frequencies file 不是有效的频率文件 - + Incorrect file magic 不正确的文件内容 - + Version is too new 版本太新 - + Contents corrupt 内容已损坏 - + Save Working Frequencies 保存工作频率 - + Only Save Selected Working Frequencies 仅保存选定的工作频率 - + Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. 是否确实要仅保存当前选择的工作频率? 单击 否 可保存所有. - + Reset Working Frequencies 重置工作频率 - + Are you sure you want to discard your current working frequencies and replace them with default ones? 您确定要放弃您当前的工作频率并用默认值频率替换它们吗? - + Save Directory 保存目录 - + AzEl Directory AzEl 目录 - + Rig control error 无线电设备控制错误 - + Failed to open connection to rig 无法打开无线电设备的连接 - + Rig failure 无线电设备故障 - + Not found audio device missing 未找到音频设备 @@ -974,32 +1397,32 @@ or contact DXLab support at DXLab@groups.io. 字体颜色(&F) ... - + Choose %1 Foreground Color 选择 %1 字体颜色 - + &Unset foreground color 清除字体颜色(&U) - + &Background color ... 底色(&B) ... - + Choose %1 Background Color 选择 %1 底色 - + U&nset background color 未设置背景颜色(&n) - + &Reset this item to defaults 将此项重置为默认值(&R) @@ -1087,17 +1510,17 @@ or contact DXLab support at DXLab@groups.io. LoTW用户 - + f/g unset 字体颜色未设置 - + b/g unset 背景颜色未设置 - + Highlight Type 突出显示类型 @@ -1105,41 +1528,56 @@ or contact DXLab support at DXLab@groups.io. Designer - + &Delete 删除(&D) - + &Insert ... 插入(&I) ... - + Insert &after ... 插入之后(&a)... - + Import Palette 导入调色板 - - + + Palettes (*.pal) 调色板 (*.pal) + Import Palette Failed + + + + Export Palette 导出调色板 + + + Export Palette Failed + + + + + Error writing waterfall palette file "%1": %2. + 读取瀑布调色板文件时错误 "%1": %2. + Dialog - + Gray time: 灰线时间: @@ -1242,16 +1680,31 @@ Error: %2 - %3 DisplayText - + &Erase 擦除(&E) + + + Return to live activity + + + + + Return to the live activity position + + + + + Live activity is paused while earlier entries are visible. + + EchoGraph - + Echo Graph Echo 图 @@ -1324,7 +1777,7 @@ Error: %2 - %3 EmulateSplitTransceiver - + Emulated split mode requires rig to be in simplex mode 模拟异频模式要求无线电设备处于单工模式 @@ -1411,12 +1864,12 @@ Error: %2 - %3 ExistingNameDialog - + Configuration to Clone From 从克隆中的配置 - + &Source Configuration Name: 源配置名称(&S): @@ -1554,7 +2007,7 @@ Error: %2 - %3 FastGraph - + Fast Graph 快速图 @@ -1608,6 +2061,157 @@ Error: %2 - %3 %1 + + FixtureAudioInput + + + Synthetic audio input has no detector sink. + + + + + Synthetic FT8 audio input requires a downsample factor of 1 or 4. + + + + + Synthetic JTTY audio input requires a downsample factor of 1 or 4. + + + + + Synthetic audio input requires the mono input channel. + + + + + Unable to open synthetic audio fixture %1: %2 + + + + + Synthetic audio fixture must be mono, signed 16-bit little-endian PCM. + + + + + Synthetic audio fixture must be %1 Hz for downsample factor %2; found %3 Hz. + + + + + Synthetic FT8 audio fixture must contain exactly %1 frames; found %2. + + + + + Synthetic JTTY audio fixture must contain complete PCM frames. + + + + + Unable to read all PCM data from synthetic audio fixture. + + + + + Synthetic audio input does not yet support big-endian hosts. + + + + + Unable to initialize the detector for synthetic audio input. + + + + + Synthetic audio fixture ready + + + + + Synthetic audio input suspended + + + + + Synthetic audio input receiving + + + + + Detector accepted %1 of %2 synthetic PCM bytes. + + + + + Synthetic audio fixture exhausted + + + + + FixtureSoundOutput + + + Synthetic audio output requires a readable source. + + + + + Synthetic audio output requires a capture path. + + + + + Synthetic audio output does not yet support big-endian hosts. + + + + + Synthetic audio output received an unsupported source frame size. + + + + + Unable to open synthetic audio output capture %1: %2 + + + + + Synthetic audio output received a partial captured frame. + + + + + Synthetic FT8 audio output exceeded its 15-second capture period. + + + + + Synthetic audio output wrote %1 of %2 capture bytes: %3 + + + + + Synthetic audio output source disappeared during capture. + + + + + Synthetic FT8 audio output continued beyond its 15-second capture period. + + + + + Synthetic audio output received %1 of %2 source bytes. + + + + + Synthetic audio output received an invalid source byte count. + + + FoxLog::impl @@ -1722,103 +2326,135 @@ Error: %2 - %3 - FrequencyDialog + FrequencyDeltaLineEdit - - Add Frequency + + Offset in MHz + + + + + Frequency offset in MHz + + + + + Enter a frequency offset in MHz. + + + + + FrequencyDialog + + + Add Frequency 添加频率 - + IARU &Region: IA&RU 区域: - + &Mode: 模式(&M): - + &Frequency (MHz): 频率 (M&Hz): - + &Preferred for Band/Mode: 首选波段/模式(&P): - + &Description: 描述(&D): - + &Enable Date Range: 启用日期范围(&E): - + S&tart: 开始(&t): - + &End: 结束(&E): - + &Source: 来源(&S): - + Invalid Date Range 无效的日期范围 - + Start date must be before end date 开始日期必须在结束日期之前 + + FrequencyLineEdit + + + + Frequency in MHz + + + + + Enter a positive frequency in MHz. + + + FrequencyList_v2_101 - + IARU Region IARU 区域 - + Mode 模式 - + Frequency 频率 - + Frequency (MHz) 频率 (兆赫) - + Description 描述 - + Source 来源 @@ -1834,129 +2470,241 @@ Error: %2 - %3 - + Pref 优先 - + Start Date/Time 开始日期/时间 - + End Date/Time 结束日期/时间 - + Failed to parse JSON file 无法解析JSON文件 - + Information Missing 信息缺失 - + No Frequencies were found 找不到频率 - + Loaded Frequencies from %1 载入频率来自 %1 - + Entries Valid/Skipped %1 有效/跳过 的条目 %1 + + Ft8TxLoopbackTestController + + + Timed out after 60 seconds. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + The FT8 output stream did not start exactly once. + + + + + The FT8 Auto control was not found. + + + + + Disabling Auto stopped the active FT8 transmission. + + + + + Synthetic output reported non-silent FT8 audio more than once. + + + + + The FT8 capture did not stop exactly once at the requested path. + + + + + Synthetic audio output failed: %1 + + + + + A required FT8 transmit GUI control was not found. + + + + + The application did not enter FT8 mode. + + + + + Unable to configure the requested FT8 transmission. + + + + + The FT8 transmit controls disappeared before transmission. + + + + + Unable to start the synthetic FT8 transmission. + + + + + The FT8 Auto control disappeared before retry. + + + + + The FT8 output lifecycle was not one start, non-silent transmission, and natural stop. + + + + + FT8 audio began at frame %1; expected %2 +/- %3 frames. + + + + + The FT8 capture file was not created or is empty: %1 + + + + + Unable to reopen FT8 capture %1: %2 + + + + + The FT8 capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The FT8 capture must contain exactly %1 frames; file=%2 reported=%3. + + + + + Unexpected modal window: %1 + + + HRDTransceiver - - + + Failed to connect to Ham Radio Deluxe 无法连接到 Ham Radio Deluxe - + Failed to open file "%1": %2. 无法打开文件 "%1": %2. - - + + Ham Radio Deluxe: no rig found Ham Radio Deluxe: 未找到无线电设备 - + Ham Radio Deluxe: rig doesn't support mode Ham Radio Deluxe: 无线电设备不支持模式 - + Ham Radio Deluxe: sent an unrecognised mode Ham Radio Deluxe: 发送了一个无法识别的模式 - + Ham Radio Deluxe: item not found in %1 dropdown list Ham Radio Deluxe: 在 %1 下拉列表中找不到项目 - + Ham Radio Deluxe: button not available Ham Radio Deluxe: 按钮不可用 - + Ham Radio Deluxe didn't respond as expected Ham Radio Deluxe 没有如预期的那样响应 - + Ham Radio Deluxe: rig has disappeared or changed Ham Radio Deluxe: 无线电设备已经消失或改变 - + Ham Radio Deluxe send command "%1" failed %2 Ham Radio Deluxe 发送命令 "%1" 失败 %2 - - + + Ham Radio Deluxe: failed to write command "%1" Ham Radio Deluxe: 无法写入命令 "%1" - + + Ham Radio Deluxe sent an invalid reply to our command "%1": %2 + + + Ham Radio Deluxe sent an invalid reply to our command "%1" - Ham Radio Deluxe 对我们的命令发出了无效的回复 "%1" + Ham Radio Deluxe 对我们的命令发出了无效的回复 "%1" - + Ham Radio Deluxe failed to reply to command "%1" %2 Ham Radio Deluxe 无法回复命令 "%1" %2 - + Ham Radio Deluxe retries exhausted sending command "%1" Ham Radio Deluxe 发送命令重试失败 "%1" - + Ham Radio Deluxe didn't respond to command "%1" as expected Ham Radio Deluxe 没有回应预期的命令 "%1" @@ -1964,186 +2712,186 @@ Error: %2 - %3 HamlibTransceiver - - + + Hamlib initialisation error Hamlib 初始化错误 - + Hamlib settings file error: %1 at character offset %2 Hamlib 设置文件错误: %1 字符偏移量 %2 - + Hamlib settings file error: top level must be a JSON object Hamlib 设置文件错误: 顶层必须是 JSON 对象 - + Hamlib settings file error: config must be a JSON object Hamlib 设置文件错误: 配置必须是JSON对象 - + Unsupported CAT type 不支持 CAT 类型 - + Hamlib error: %1 while %2 Hamlib 错误: %1 当 %2 - + opening connection to rig 打开连接无线电设备 - + getting current frequency 获取当前频率 - + getting current mode 获取当前模式 - - + + exchanging VFOs 在 VFOs 之间切换 - - + + getting other VFO frequency 获取其他 VFO 频率 - + getting other VFO mode 获取其他 VFO 模式 - - + + setting current VFO 设置当前 VFO - + getting frequency 获取频率 - + getting mode 获取模式 - - - + + + getting current VFO 获取当前 VFO - - - - + + + + getting current VFO frequency 获取当前 VFO 频率 - - - - - - + + + + + + setting frequency 设置频率 - - - - + + + + getting current VFO mode 获取当前 VFO 模式 - - - - - + + + + + setting current VFO mode 设置当前 VFO 模式 - setting VFOB mode - 设置 VFOB 模式 + 设置 VFOB 模式 - - + + setting/unsetting split mode 设置/取消 设置异频模式 - - + + setting split mode 设置异频模式 - + setting split TX frequency and mode 设置异频发射频率和模式 - + setting split TX frequency 设置异频发射频率 - + getting split TX VFO mode 获得异频发射 VFO 模式 - + setting split TX VFO mode 设置异频发射 VFO 模式 - + getting PTT state 获取PTT 状态 - + setting PTT on 设置PTT 开启 - - + + setting PTT off 设置PTT 关闭 - + setting a configuration item 设置配置项目 - + + getting a configuration item 获取配置项目 @@ -2177,6 +2925,322 @@ Error: %2 - %3 IARU 区域 + + JttyTxLoopbackTestController + + + Timed out after 60 seconds. + + + + + JTTY request %1 was accepted more than once. + + + + + JTTY request %1 was rejected with reason %2. + + + + + JTTY request %1 completed more than once. + + + + + More than one JTTY transmit session drained. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + JTTY output stream restarted more than once. + + + + + Synthetic output reported non-silent playback more than once. + + + + + Synthetic output stopped the wrong capture path: %1 + + + + + JTTY output stream stopped more than once. + + + + + Synthetic audio output failed: %1 + + + + + The JTTY mode action was not found. + + + + + The application did not enter JTTY mode. + + + + + The JTTY encoder did not produce a valid test waveform extent. + + + + + The first JTTY text request was not accepted synchronously. + + + + + Non-silent playback began before the first request was accepted. + + + + + The output stream restarted or stopped before the gapless append. + + + + + The gapless append occurred before one second of real playback. + + + + + The second JTTY text request was not accepted during playback. + + + + + Appending the second JTTY message restarted or stopped playback. + + + + + The accepted-request set did not contain exactly both submitted messages. + + + + + JTTY text requests were not accepted in submission order. + + + + + The completed-request set did not contain exactly both submitted messages. + + + + + JTTY text requests did not complete in FIFO order. + + + + + The output stream lifecycle was not one start, one drain, and one stop. + + + + + The captured JTTY session contains an unexpected internal audio gap. + + + + + The JTTY capture file was not created or is empty: %1 + + + + + Unable to reopen JTTY capture %1: %2 + + + + + The JTTY capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The JTTY capture has an invalid PCM extent: file frames=%1, expected audio frames=%2, reported frames=%3. + + + + + Unexpected modal window: %1 + + + + + LiveAudioTestController + + + Timed out after 110 seconds. + + + + + Timed out after 100 seconds. + + + + + Decoder backend failed: %1 + + + + + JTTY display did not settle to the expected text after input ended. + + + + + Synthetic audio source failed: %1 + + + + + Unable to open expected decode file %1: %2 + + + + + Expected decode file %1 contains no messages. + + + + + Unable to open expected JTTY text file %1: %2 + + + + + Expected JTTY text file %1 contains no messages. + + + + + A required FT8 decoder or monitoring GUI control was not found. + + + + + Unable to configure the %1-%2 Hz waterfall decode range. + + + + + Unable to prepare the complete FT8 fixture decode. + + + + + Unable to configure the FT8 multithreaded decoder as requested. + + + + + Monitor did not enter the active state. + + + + + Synthetic input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic audio source. + + + + + A required JTTY mode, monitoring, or decode display control was not found. + + + + + The JTTY GUI action did not select JTTY mode. + + + + + Monitor did not enter the active state for JTTY. + + + + + Synthetic JTTY input unexpectedly selected the disk-data path. + + + + + Unable to arm the synthetic JTTY audio source. + + + + + The expected early standard and final configured MTD decoder invocations were not both observed. + + + + + The configured MTD invocation produced no decoder output. + + + + + live MTD missing: %1 + + + + + processed missing: %1 + + + + + display missing: %1 + + + + + Reference-message validation failed: %1; live MTD output: %2; processed output: %3 + + + + + Decoder messages were processed but none reached the GUI display path. + + + + + The expected JTTY messages did not reach both panes in FIFO order. + + + + + The expected JTTY message reached both panes without an observed growing prefix. + + + + + Unexpected modal window: %1 + + + LogQSO @@ -2296,88 +3360,88 @@ Error: %2 - %3 接收信息 - + Aircraft scatter 飞机反射 - + Aurora-E 极光-E - + Aurora 极光 - + Back scatter 背面反射 - + Echolink Echolink - + Earth-moon-earth 月球面反射通信 - + Sporadic E 零星 E - + F2 Reflection F2 反射 - + Field aligned irregularities 场对齐不规则性 - + Internet-assisted 互联网辅助 - + Ionoscatter 电离层反射 - + IRLP 互联网电台连接 - + Meteor scatter 流星反射 - + Non-satellite repeater or transponder 非卫星中继器或转发器 - + Rain scatter 雨水反射 - + Satellite 卫星 - + Trans-equatorial 跨赤道 @@ -2386,133 +3450,133 @@ Error: %2 - %3 对流层管道 - + Tropospheric ducting 对流层管道 - + A A - + B B - + BS BS - + JA JA - + JD JD - + K K - + KA KA - + KT KT - + L L - + LS LS - + LU LU - + LX LX - + S S - + SX SX - + T T - + US US - + UV UV - + VS VS - + VU VU - - + + Invalid QSO Data 无效的通联数据 - + Check exchange sent and received 选择已交换的发送和接收 - + Check all fields 检查所有字段 - + Log file error 日志文件错误 - + Cannot open "%1" for append 无法打开 "%1" 的追加 - + Error: %1 错误: %1 @@ -2520,114 +3584,113 @@ Error: %2 - %3 MainWindow - WSJT-X by K1JT - WSJT-X by K1JT - - - - - - - - - - - + WSJT-X by K1JT + + + + + + + + + + + Band Activity 波段活动 - - + + UTC dB DT Freq Dr UTC dB DT Freq Dr - - - - - - - + + + + + + + Rx Frequency 接收信息 - + 160 160 - + 80 80 - + 60 60 - + 40 40 - + 30 30 - + 20 20 - + 17 17 - + 15 15 - - + + 12 12 - - - + + + 10 10 - - - - + + + + 6 6 - - + + 70 70 - + CQ messages only. 仅CQ信息. - + CQ only 仅显示CQ @@ -2636,27 +3699,27 @@ Error: %2 - %3 通过设置或查看菜单切换的绕过过滤. - + BP 绕过 - + Enter this QSO in log 在日志中输入此通联记录 - + Log &QSO 记录通联(&Q) - + Stop monitoring 停止监听 - + &Stop 停止(&S) @@ -2665,7 +3728,7 @@ Error: %2 - %3 切换监听 启用/停用 - + &Monitor 监听(&M) @@ -2694,87 +3757,88 @@ Error: %2 - %3 切换到FST4模式 - + <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> <html><head/><body><p>擦除接收信息窗口. 双击可擦除波段活动窗口和接收信息窗口.</p></body></html> - + Erase right window. Double-click to erase both windows. 擦除右窗口. 双击可擦除两个窗口. - + &Erase 擦除(&E) - + <html><head/><body><p>Clear the accumulating message average.</p></body></html> <html><head/><body><p>清除累积信息平均值.</p></body></html> - + Clear the accumulating message average. 清除累积信息平均值. - + Clear Avg 清除平均 - + <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> <html><head/><body><p>在通联频率下解码最近的接收周期</p></body></html> - + Decode most recent Rx period at QSO Frequency 在通联频率下解码最近的接收周期 - + &Decode 解码(&D) - + <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> <html><head/><body><p>切换 启用/停用 自动发射</p></body></html> - + Toggle Auto-Tx On/Off 切换 启用/停用 自动发射 - + E&nable Tx 启用发射(&n) - + Stop transmitting immediately 立即停止发射 - + &Halt Tx 停止发射(&H) - + Toggle a pure Tx tone On/Off 切换 启用/停用 发射纯音调 - + &Tune 调谐(&T) - + + Menus 显示菜单 @@ -2787,637 +3851,911 @@ Error: %2 - %3 将主文字视窗複製到 WSJT-X.txt - Recommended audio settings - 推荐的音频设置 + 推荐的音频设置 - <html><head/><body><p>Recommended Audio Settings.</p></body></html> - <html><head/><body><p>推荐的音频设置.</p></body></html> + <html><head/><body><p>推荐的音频设置.</p></body></html> FT4 NS (NCCC Sprints) FT4 NS (NCCC 冲刺) - + SuperFox User Guide 超级狐狸用户指南 - + Hide stations worked before on band 隐藏在波段上曾经通联的呼号 - + Hide stations worked today or yesterday 隐藏今天或昨天曾经通联的呼号 - + Hide stations from Ignore List 从忽略列表中隐藏呼号 - + Ignore stations worked today or yesterday 忽略今天或昨天曾经通联的呼号 - + Ignore stations from Ignore List 从忽略列表中忽略呼号 - + Hide stations from Territory 1 隐藏区域中的电台1 - + Hide stations from Territory 2 隐藏区域中的电台2 - + Hide stations from Territory 3 隐藏区域中的电台3 - + Hide stations from Territory 4 隐藏区域中的电台4 - + Highlight callsigns worked today or yesterday 突出显示今天或昨天曾经通联的呼号 - + Highlight callsigns from Ignore List 从忽略列表中突出显示呼号 - + Enable auto response to the first decode from a new DXCC or new call on the current band. 启用对当前频带上新DXCC或新呼叫的第一个解码的自动响应. - + <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> <html><head/><body><p>切换到 T/R 30 s 和 Submode C.</p></body></html> - + 30B 30B - + <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> <html><head/><body><p>切换到 T/R 60 s 和 Submode C.</p></body></html> - + 60C 60C - + F High F 高 - + F Low F 低 - - - - + + + + 3 3 - + 2m FT8 2米 FT8 - + 2m 2米 - - + + 20m FT4 20米 FT4 - + 17m FT8 17米FT8 - + 17m 17米 - + 10m FT8 10米 FT8 - + 10m 10米 - + 2m MSK144 2米 MSK144 - - + + 17m FT4 17米 FT4 - + 30m FT8 30米 FT8 - + 30m 30米 - + 80m FT8 80米 FT8 - + 80m 80米 - + 4m FT8 4米 FT8 - + 4m 4米 - + 12m FT8 12米 FT8 - + 12m 12米 - + 160m FT8 160米 FT8 - + 160m 160米 - - + + 30m FT4 30米 FT4 - + 70cm FT8 70厘米 FT8 - + 70cm 70厘米 - + 60m FT8 60米 FT8 - + 60m 60米 - + 6m FT8 6米 FT8 - + 6m 6米 - - + + 40m FT4 40米 FT4 - + 15m FT8 15米 FT8 - + 15m 15米 - + 40m FT8 40米 FT8 - + 40m 40米 - + 20m FT8 20米 FT8 - + 20m 20米 - + Band Hopping 波段跳跃 - + 1/2 1/2 - + Avg 平均 - + 24G 24G - + 10G 10G - + 5G 5G - - - + + + 9 9 - + 13 13 - + 23 23 - + 33 33 - + 1.25 1.25 - - + + 4 4 - - + + WSJT-X by K1JT et al. + + + + + Band Activity decode pane title + + + + + Title for the Band Activity decoded messages pane. + + + + + Band Activity decoded messages headings + + + + + + Columns: UTC dB DT Freq Message. + + + + + Band Activity decoded messages + + + + + Decoded messages in the Band Activity pane. Columns: UTC dB DT Freq Message. + + + + + Rx Frequency decode pane title + + + + + Title for the Rx Frequency decoded messages pane. + + + + + Rx Frequency decoded messages headings + + + + + Rx Frequency decoded messages + + + + + Decoded messages in the Rx Frequency pane. Columns: UTC dB DT Freq Message. + + + + + Check to display received messages in lower case. + + + + + Lower case + + + + + Include Time + + + + + 8 8 - + Bypass Filters toggled via Settings or the Filters menu. 通过设置或查看菜单切换的绕过过滤. - + <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> <html><head/><body><p>打开/关闭监听. <br>保存 .wav文件时为黄色.</p></body></html> - + <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> <html><head/><body><p>切换等待 &amp; 呼叫 启用/停用. 右键单击清除DX呼叫框.</p></body></html> - + + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the strongest station's reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the weakest station's reply to your CQ.</p><p>When CQ or QRZ is pending, Enable Tx may be armed before or during a receive period. Only eligible direct callers decoded after it is armed in that period can replace the pending transmission; earlier callers are not retained.</p></body></html> + + + + <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> <html><head/><body><p>切换到 T/R 15 s 和 Submode C.</p></body></html> - + 15C 15C - + <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> <html><head/><body><p>切换到 T/R 15 s 和 Submode A.</p></body></html> - + 15A 15A - + <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> <html><head/><body><p>切换到 T/R 60 s 和 Submode D.</p></body></html> - + 60D 60D - + <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> <html><head/><body><p>切换到 T/R 60 s 和 Submode E.</p></body></html> - + 60E 60E - + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + + + + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + + + + Age 距今 - + Continent 大洲 - + Score 分数 - + <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> <html><head/><body><p>打开/关闭 波段跳跃. 每隔整整一分钟就跳一次波段. 对复选框的更改会立即生效.<br/>右键单击切换到下一个选定的频段跳跃频率, 或者在频段跳跃被禁用时测试默认的音频设备.</p></body></html> - + + GroupBox + + + + + CQ %M CQ + + + + + %H 599 %N + + + + + %H TU CQ %M CQ + + + + + %M + + + + + %H + + + + + TU NOW %Q 599 %N + + + + + %H AGN? + + + + + 599 %N + + + + + F1 + + + + + HisCall Exchange + + + + + F2 + + + + + TU CQ + + + + + F3 + + + + + MyCall + + + + + F4 + + + + + HisCall + + + + + F5 + + + + + Now QueuedCall Exchange + + + + + F6 + + + + + HisCall AGN ? + + + + + Exchange + + + + + Serial number of QSO for contest exchange. + + + + + Click to transmit a message. + + + + + Send message + + + + + Call next + + + + + Message to be transmitted + + + + + Serial Number + + + + + Callsign to be worked next. + + + + 2/2 2/2 - + 1/3 1/3 - + 2/3 2/3 - + 3/3 3/3 - + 1/4 1/4 - + 2/4 2/4 - + 3/4 3/4 - + 4/4 4/4 - + 1/5 1/5 - + 2/5 2/5 - + 3/5 3/5 - + 4/5 4/5 - + 5/5 5/5 - + 1/6 - + 2/6 - + 3/6 - + 4/6 - + 5/6 - + 6/6 - + Percentage of minute sequences devoted to transmitting. 用于传输的分钟序列的百分比. - + Prefer Type 1 messages 首选类型 1 信息 - + <html><head/><body><p>Transmit during the next sequence.</p></body></html> <html><head/><body><p>在下一个序列中传送.</p></body></html> + + + Download EME Ephemeris Chart + + + + + Hide AP information + + + + + <html><head/><body><p>Hide AP information</p></body></html> + + + + + Highlight Whitelist entries + + + + + JTTY + + Toggle FT8 hound mode On/Off 切换 FT8 猎犬模式 启用/停用 - + H 猎犬 - - + + Q65 - + Switch to MSK144 mode 切换到MSK144模式 - + MSK - + Switch to FT4 mode 切换到FT4模式 - + SWL Mode SWL模式 - + Hide lower panel controls to maximize deocde windows 隐藏下面板控件最大化解码窗口 - + Band Buttons 波段按钮 - + Reduce false decodes 减少错误解码 - + Don't split ALL.TXT 不分拆 ALL.TXT - + Split ALL.TXT yearly 分拆每年 ALL.TXT - + Split ALL.TXT monthly 分拆每月 ALL.TXT - + Disable writing of ALL.TXT 禁止写入 ALL.TXT - + + USB dial frequency 上边带频率 - + 14.078 000 - + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> <html><head/><body><p>当只存在噪音时建议30dB<br/>绿色范围好<br/>红色范围时可能发生削波<br/>黄色范围时太低</p></body></html> - + Rx Signal 接收信号 - + 30dB recommended when only noise present Green when good Red when clipping may occur @@ -3428,300 +4766,312 @@ Yellow when too low 黄色范围时太低 - + DX Call DX 呼号 - + DX Grid DX 网格 - + Callsign of station to be worked 正在通联的电台呼号 - + &Lookup 查找(&L) - + Locator of station to be worked 通联中的电台定位 - + Az: 251 16553 km 角度: 251 16553 公里 - + Add 增加 - + <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> <html><head/><body><p>如果橙色或红色出现表示无线电设备控制故障, 请单击以重置并读取频率. S 表示异频模式.</p></body></html> - + If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. 如果橙色或红色出现表示无线电设备控制故障, 请单击以重置并读取频率. S 表示异频模式. - + ? - + Adjust Tx audio level 调整发射音频电平 - + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> <html><head/><body><p>选择工作频段或输入兆赫频率或输入千赫增量,然后输入 k.</p></body></html> - + Frequency entry 输入频率 - + Select operating band or enter frequency in MHz or enter kHz increment followed by k. 选择工作频段或输入兆赫频率或输入千赫增量, 然后输入 k. - + <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> <html><head/><body><p>双击解码文本时, 选择以保持发射频率固定.</p></body></html> - + Check to keep Tx frequency fixed when double-clicking on decoded text. 双击解码文本时, 选择以保持发射频率固定. - + Hold Tx Freq 保持发射频率 - + + Audio Rx frequency 音频接收频率 - - - - - - + + + + + + + + Hz 赫兹 - - + + + Rx 接收 - - + + + + Set Tx frequency to Rx Frequency 将发射频率设置为接收频率 - + + ▲ - + + Frequency tolerance (Hz) 频率容差 (赫兹) - - + + + F Tol 容差 - - + + + + Set Rx frequency to Tx Frequency 将接收频率位置移往发射频率位置 - + + ▼ - + <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> <html><head/><body><p>同步阈值. 较低的数字接受较弱的同步信号.</p></body></html> - + Synchronizing threshold. Lower numbers accept weaker sync signals. 同步阈值. 较低的数字接受较弱的同步信号. - + Sync 同步 - + <html><head/><body><p>Check to use short-format messages.</p></body></html> <html><head/><body><p>选择以使用短格式信息.</p></body></html> - + Check to use short-format messages. 选择以使用短格式信息. - + Sh - + <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> <html><head/><body><p>选择以启用 JT9 快速模式</p></body></html> - + Check to enable JT9 fast modes 选择以启用 JT9 快速模式 - - + + Fast 快速 - + <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> <html><head/><body><p>选择以启用基于收到的信息自动排序发射信息.</p></body></html> - + Check to enable automatic sequencing of Tx messages based on received messages. 选择以启用基于收到的信息自动排序发射信息. - + Auto Seq 自动程序 - + Check to generate "@1250 (SEND MSGS)" in Tx6. 选择以生成 "@1250 (发送信息)" 在发射6. - + Tx6 发射6 - + Tx even/1st 发射偶数/第一 - + <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> <html><head/><body><p>呼叫 CQ 的频率以千赫高于当前的兆赫</p></body></html> - + Frequency to call CQ on in kHz above the current MHz 呼叫 CQ 的频率以千赫高于当前的兆赫 - + Tx CQ 发射 CQ - + <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> <html><head/><body><p>选中此项, 以发射CQ呼叫. 接收将在当前频率上, CQ信息将显示在当前的接收信息窗口, 以便呼叫者知道回复的频率.</p><p>不适用于非标准呼号持有者.</p></body></html> - + Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. Not available to nonstandard callsign holders. 选中此项, 以发射CQ呼叫. 接收将在当前频率上, CQ信息将显示在当前的接收信息窗口, 以便呼叫者知道回复的频率. 不适用于非标准呼号持有者. - + Rx All Freqs 接收全部频率 - + <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> <html><head/><body><p>子模式确定音调间距离; A 最窄.</p></body></html> - + Submode determines tone spacing; A is narrowest. 子模式确定音调间距离; A 最窄. - + Submode 子模式 - - + + Fox 狐狸 - + <html><head/><body><p>Check to monitor Sh messages.</p></body></html> <html><head/><body><p>选择以监视速记信息.</p></body></html> - + Check to monitor Sh messages. 选择以监视速记信息. - + SWL - + Best S+P 最佳 S+P - + <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> <html><head/><body><p>选中可开始记录校准数据.<br/>当测量校准校正被禁用时.<br/>未检查时您可以查看校准结果.</p></body></html> - + Check this to start recording calibration data. While measuring calibration correction is disabled. When not checked you can view the calibration results. @@ -3730,267 +5080,264 @@ When not checked you can view the calibration results. 未检查时您可以查看校准结果. - + Measure 测量 - <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the the strongest station's reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the the weakest station's reply to your CQ. </p></body></html> - <html><head/><body><p>选择<span style=" font-weight:600;">CQ: None</span> 手动选择呼叫者.</p><p>选择 <span style=" font-weight:600;">CQ: 第一</span> 自动回复您的CQ的第一个解码回复. </p><p>选择 <span style=" font-weight:600;">CQ: 最远</span> 自动响应在ARRL International Digita竞赛中产生最多分数的回复, 或者一般来说, 自动响应最远的台, 如果其信息具有有效的网格.</p><p>选择 <span style=" font-weight:600;">CQ: Max dB</span> 自动回复最强的台回复你的CQ. </p><p>选择 <span style=" font-weight:600;">CQ: Min dB</span> 自动回复最弱的台回复你的CQ. </p></body></html> + <html><head/><body><p>选择<span style=" font-weight:600;">CQ: None</span> 手动选择呼叫者.</p><p>选择 <span style=" font-weight:600;">CQ: 第一</span> 自动回复您的CQ的第一个解码回复. </p><p>选择 <span style=" font-weight:600;">CQ: 最远</span> 自动响应在ARRL International Digita竞赛中产生最多分数的回复, 或者一般来说, 自动响应最远的台, 如果其信息具有有效的网格.</p><p>选择 <span style=" font-weight:600;">CQ: Max dB</span> 自动回复最强的台回复你的CQ. </p><p>选择 <span style=" font-weight:600;">CQ: Min dB</span> 自动回复最弱的台回复你的CQ. </p></body></html> - - + + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> <html><head/><body><p>以偶数分钟或序列检查到Tx, 从0开始;取消选中奇数序列. 右键单击以冻结复选框的状态. 右键单击FT8或MSK按钮解冻.</p></body></html> - + <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> <html><head/><body><p>信号报告: 参考2500赫兹带宽 (分贝) 中的信噪比.</p></body></html> - + Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). 信号报告: 参考2500赫兹带宽 (分贝) 中的信噪比. - + Report 报告 - + <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> <html><head/><body><p>发射/接收 或频率校准序列长度</p></body></html> - + Tx/Rx or Frequency calibration sequence length 发射/接收 或频率校准序列长度 - - + + s 秒 - - + + T/R - + + Audio Tx frequency 音频发射频率 - - + + + Tx 发射 - + Tx# 发射# - - - + + + 1 - - - + + + Send this message in next Tx interval 在下一个发射间隔内发送此信息 - + Ctrl+2 - + <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> <html><head/><body><p>在下一个发射间隔内发送此信息</p><p>双击以切换使用 发射 1 信息以启动和电台的通联 (不允许 1 型复合呼叫持有者)</p></body></html> - + Send this message in next Tx interval Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) 在下一个发射间隔内发送此信息 双击以切换使用 发射 1 信息以启动和电台的通联 (不允许 1 型复合呼叫持有者) - + Ctrl+1 - - - - + + + + Switch to this Tx message NOW 立即切换到此发射信息 - + Tx &2 发射 &2 - + Alt+2 - + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> <html><head/><body><p>立即切换到此发射信息</p><p>双击以切换使用 发射 1 信息以启动和电台的通联 (不允许 1 型复合呼叫持有者)</p></body></html> - + Switch to this Tx message NOW Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) 立即切换到此发射信息 双击以切换使用 发射 1 信息以启动和电台的通联 (不允许 1 型复合呼叫持有者) - + Tx &1 发射 &1 - + Alt+1 - + Ctrl+6 - + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> <html><head/><body><p>在下一个发射间隔内发送此信息</p><p>双击可重置为标准 73 信息</p></body></html> - + Send this message in next Tx interval Double-click to reset to the standard 73 message 在下一个发射间隔内发送此信息 双击可重置为标准 73 信息 - + Ctrl+5 - + Ctrl+3 - + Tx &3 发射 &3 - + Alt+3 - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>在下一个发射间隔内发送此信息</p><p>双击可在 发射4 中的 RRR 和 RR73 信息之间切换 (不允许类型 2 复合呼叫持有者)</p><p>RR73 信息仅在您有理由相信不需要重复信息时才应使用</p></body></html> + <html><head/><body><p>在下一个发射间隔内发送此信息</p><p>双击可在 发射4 中的 RRR 和 RR73 信息之间切换 (不允许类型 2 复合呼叫持有者)</p><p>RR73 信息仅在您有理由相信不需要重复信息时才应使用</p></body></html> - Send this message in next Tx interval Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - 在下一个发射间隔内发送此信息 + 在下一个发射间隔内发送此信息 双击可在 发射4 中的 RRR 和 RR73 信息之间切换 (不允许类型 2 复合呼叫持有者) RR73 信息仅在您有理由相信不需要重复信息时才应使用 - + Ctrl+4 - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>立即切换到此发射信息</p><p>双击可在 发射 4 中的 RRR 和 RR73 信息之间切换 (不允许类型 2 复合呼叫持有者)</p><p>RR73 信息仅在您有理由相信不需要重复信息时才应使用</p></body></html> + <html><head/><body><p>立即切换到此发射信息</p><p>双击可在 发射 4 中的 RRR 和 RR73 信息之间切换 (不允许类型 2 复合呼叫持有者)</p><p>RR73 信息仅在您有理由相信不需要重复信息时才应使用</p></body></html> - Switch to this Tx message NOW Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - 立即切换到此发射信息 + 立即切换到此发射信息 双击可在 发射 4 中的 RRR 和 RR73 信息之间切换 (不允许类型 2 复合呼叫持有者) RR73 信息仅在您有理由相信不需要重复信息时才应使用 - + Tx &4 发射 &4 - + Alt+4 - + Tx &5 发射 &5 - + Alt+5 - + Now 现在 - + Generate standard messages for minimal QSO 生成标准信息用于通联 - + Generate Std Msgs 生成标准信息 - + Tx &6 发射 &6 - + Alt+6 - + Enter a free text message (maximum 13 characters) or select a predefined macro from the dropdown list. Press ENTER to add the current text to the predefined @@ -4001,48 +5348,49 @@ list. The list can be maintained in Settings (F2). 列表. 该列表可在设置(F2)中维护. - + Queue up the next Tx message 排队下一个发射信息 - + Next 下一个 - - - - - - + + + + + + 2 - + Quick-Start Guide to FST4 and FST4W FST4和FST4W快速入门指南 - + FST4 - + FST4W - - + + + CQ - + Grid 网格 @@ -4051,27 +5399,27 @@ list. The list can be maintained in Settings (F2). 最大分贝 - + CQ AF CQ 非洲 - + <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> <html><head/><body><p>在数据库中搜索呼号. <br>右键单击在 QRZ.com 上搜索呼号.</p></body></html> - + <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> <html><head/><body><p>将呼号列入忽略名单.<br>右键单击在 qrzcq.com 上搜索呼号.</p></body></html> - + Ignore 忽略 - + <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> <html><head/><body><p>打开/关闭 纯发射音调<br >右键单击以调整装备</p></body></html> @@ -4080,42 +5428,42 @@ list. The list can be maintained in Settings (F2). 接收 - + <html><head/><body><p>Enter a free text message.</p></body></html> <html><head/><body><p>输入自定义讯息.</p></body></html> - + Free Text 自定义信息 - + <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> <html><head/><body><p>下次发送自定义信息.</p></body></html> - + Send msg 发送信息 - + <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> <html><head/><body><p>狐狸传输的最大并发流数量.</p></body></html> - + <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> <html><head/><body><p>队列中显示的最大呼号数.</p></body></html> - + <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> <html><head/><body><p>包括CQ信息以及其他信息.</p></body></html> - + <html><head/><body><p>Select a specific CQ message.</p></body></html> <html><head/><body><p>选择特定的CQ信息.</p></body></html> @@ -4136,7 +5484,7 @@ list. The list can be maintained in Settings (F2). 功率 - + Decode other Hounds calling above 1000 Hz audio offset 解码高于1000赫兹音频偏移的其他猎犬呼叫 @@ -4153,7 +5501,7 @@ list. The list can be maintained in Settings (F2). 勾选偶数分钟发射或序列, 从0开始;取消选中奇数序列. - + Maximum drift rate in units of symbol rate per transmission. 最大偏移速率, 单位为每次传输的符号速率. @@ -4168,87 +5516,87 @@ Double-click to reset to the standard 73 message 双击以重置为标准73信息 - + CQ AN CQ 南极洲 - + CQ AS CQ 亚洲 - + CQ EU CQ 欧洲 - + CQ NA CQ 北美洲 - + CQ OC CQ 大洋洲 - + CQ SA CQ 南美洲 - + CQ 0 - + CQ 1 - + CQ 2 - + CQ 3 - + CQ 4 - + CQ 5 - + CQ 6 - + CQ 7 - + CQ 8 - + CQ 9 - + <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> <html><head/><body><p>为队列中的呼号选择所需的排序顺序.</p></body></html> @@ -4257,178 +5605,178 @@ Double-click to reset to the standard 73 message <html><head/><body><p>为要包括在队列中的呼叫者设置最大允许信噪比.</p></body></html> - + <html><head/><body><p>Clear all queues.</p></body></html> <html><head/><body><p>清除所有队列.</p></body></html> - + Reset 重置 - + N List N 列表 - + N Slots N 插槽 - - - - - - - + + + + + + + Random 随机 - + Call 呼号 - + S/N (dB) 信噪比(分贝) - + Distance 距离 - + More CQs 更多 CQ - - + + % - + Tx Pct 发射 Pct - + Band Hopping 切换波段 - + Choose bands and times of day for band-hopping. 选择波段在一天之中的时间进行切换波段. - + Schedule ... 时间流程 ... - + Upload decoded messages to WSPRnet.org. 将解码的信息上载到 WSPRnet.org. - + Upload spots 上传 spots - + <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> <html><head/><body><p>6 位定位器会导致发送 2 个不同的信息, 第二个包含完整定位器, 但只有哈希呼号. 其他电台必须解码第一个一次. 然后才能在第二个中解码您的呼叫. 如果此选项将避免两个信息协议. 则选中此选项仅发送 4 位定位器.</p></body></html> - + 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. 6 位定位器会导致发送 2 个不同的信息, 第二个包含完整定位器, 但只有哈希呼号. 其他电台必须解码第一个一次. 然后才能在第二个中解码您的呼叫. 如果此选项将避免两个信息协议. 则选中此选项仅发送 4 位定位器. - + No own call decodes 解码中没有自己的呼号 - + Tx Next 发射下一个信息 - + Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. 将发射功率设置为 dBm (dB 高于 1 mW) 作为 WSPR 信息的一部分. - + NB - + Max Drift 最大漂移率 - - + + 12m FT4 - - + + 15m FT4 - - + + 10m FT4 - + In Progress 正在进行中 - + Queue 队列 - + <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> <html><head/><body><p>将呼号和网格定位添加到数据库. <br>右击搜索 hamqth.com 上的呼号.</p></body></html> - + Pwr 功率 - - + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> <html><head/><body><p>立即切换到此Tx信息</p><p>双击以重置为标准的73信息</p><p>右键单击保留Tx5自定义信息</p></body></html> - + Allow Dupes 允许重複 - + 2m MSK @@ -4437,1007 +5785,1006 @@ Double-click to reset to the standard 73 message <html><head/><body><p>切换波段跳跃 开/关. 波段跳跃每隔一整分钟发生一次. 对复选框的更改会立即生效.<br>右键单击测试默认音频设备.</p></body></html> - - + + 80m FT4 - + FT8 QRG6 - + FT8 QRG1 - + FT8 QRG2 - + FT8 QRG7 - + FT8 QRG8 in kHz. - + FT8 QRG5 - + FT8 QRG3 - + FT8 QRG4 - + FT8 QRG8 - + FT8 QRG7 in kHz. - + FT8 QRG6 in kHz. - + FT8 QRG5 in kHz. - + FT8 QRG4 in kHz. - + FT8 QRG3 in kHz. - + FT8 QRG2 in kHz. - + FT8 QRG1 in kHz. - + Spacing 间隔 - + Fixed Tone 固定音调 - + K1JT - + CW - + Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. 打开/关闭 FT8猎犬模式.<br >右键单击 激活或取消激活 超级狐狸模式. - + Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. 切换到FT8模式.<br >右键单击 打开/关闭 上次使用的竞赛模式. - + <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> <html><head/><body><p>切换到 Q65 模式. <br>右键单击切换到 Q65 Pileup 模式.</p></body></html> - + <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> <html><head/><body><p>切换到 JT65 模式. <br>右键单击切换到 JT9 模式.</p></body></html> - + <html><head/><body><p>Switch to Echo mode</p></body></html> <html><head/><body><p>切换到 Echo 模式</p></body></html> - + File 文件 - + View 显示 - + Filters 过滤 - + Decode 解码 - + Parameters 参数 - + Decoder sensitivity 解码器灵敏度 - + Decoder start 开始解码 - + Number of threads 线数量 - + QSO RX freq sensitivity 通联 接收频率敏感性 - + Decoding cycles 解码周期 - + Save 保存 - + Help 帮助 - + + Mode 模式 - + Configurations 配置 - + Tools 工具 - + Exit 关闭软件 - + About WSJT-X 关于 WSJT-X - + Waterfall 瀑布图 - + Open 打开文件 - + Ctrl+O - + Open next in directory 打开下一个文件 - - Decode remaining files in directory - 打开余下文件 + + Ctrl+X + - - Shift+F6 - + + Decode remaining files in directory + 打开余下文件 - + Delete all *.wav && *.c2 files in SaveDir 删除所有在SaveDir目录内 *.wav && *.c2 - + None 不保存 - + Save all 保存所有文件 - + Remove saved files after 30 days 30天后删除保存的文件 - + Online User Guide 在线用户指南 - + Keyboard shortcuts 键盘快捷键 - + Special mouse commands 特殊鼠标动作 - + JT9 - + Save decoded 保存解码文件 - - + + Normal 正常 - + Deep 深度 - + Erase ALL.TXT 删除 ALL.TXT - + Erase wsjtx_log.adi 删除通联日志 wsjtx_log.adi - + Erase wsjtx.log 删除 wsjtx.log - + Erase Ignore List 删除忽略列表 - + How to deal with rig control errors 如何处理无线电设备控制错误 - + <html><head/><body><p>How to deal with rig control errors.</p></body></html> <html><head/><body><p>如何处理无线电设备控制错误.</p></body></html> - + Message Creator 信息创建器 - + Highlight callsigns worked before on band 突出显示在波段曾经通联的呼号 - + Enable Message Popups 启用信息弹出窗口 - + QSY Monitor QSY监听 - + Ignore stations worked before on band 忽略在这频段上曾经通联的电台 - + Use multithreaded FT8 decoder 使用多线程FT8解码器 - + Auto 自动 - - + + 5 - - + + 7 - - + + 11 - + Low 低 - + Medium 中等 - + High 高 - + Minimum 最少 - + Use low thresholds 使用低阈值 - + Use subpass 使用子通道 - + 2-Stage 阶段-2 - + 3-Stage 阶段-3 - + Early 早期 - + Late 最新 - + Wideband DX Call search 宽带DX呼号搜索 - + Hide FT8 dupe messages 隐藏 FT8 重複信息 - + VHF / UHF Buttons VHF / UHF 按钮 - + Highlight stations from Territory 1 突出显示区域 1 的电台 - + Highlight stations from Territory 2 突出显示区域 2 的电台 - + Highlight stations from Territory 3 突出显示区域 3 的电台 - + Highlight stations from Territory 4 突出显示区域 4 的电台 - + Disable clicks on waterfall 禁用在瀑布上点击 - + Full Duplex Mode 全双工模式 - + F7 - + Active Stations 活动电台 - + Quick-Start Guide to WSJT-X 2.7 and QMAP WSJT-X 2.7 和 QMAP 快速入门指南 - + Diagnostic mode 诊断模式 - + Default event logging 默认事件记录 - + Disable event logging 禁用事件记录 - + Use Dark Style 启用黑夜模式 - - WSJT-X_improved Home Page - WSJT-X _改进版主页 - - - - The additional features of wsjt-x_improved - WSJT-X _改进版的附加功能 - - - - <html><head/><body><p>Overview on the additional features of wsjt-x_improved.</p></body></html> - <html><head/><body><p>概述 WSJT-X _改进版的附加功能.</p></body></html> - - - - <html><head/><body><p>Go to the wsjt-x_improved home page.</p></body></html> - <html><head/><body><p>转到 WSJT-X _改进版主页.</p></body></html> - - - + Erase list of Q65 callers 清除Q65呼叫者列表 - + Hide stations from Europe 隐藏 欧洲 的电台 - + Hide stations from North America 隐藏 北美洲 的电台 - + Hide stations from South America 隐藏 南美洲 的电台 - + Hide stations from Asia 隐藏 亚洲 的电台 - + Hide stations from Africa 隐藏 非洲 的电台 - + Hide stations from Oceania 隐藏 大洋洲 的电台 - + Hide stations from Antarctica 隐藏 南极洲 的电台 - - + + JT65 - + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> - + + Alt+X + + + + Astronomical data 天文数据 - + List of Type 1 prefixes and suffixes 类型 1 前缀和后缀的列表 - + Settings... 设置... - + Local User Guide 本地用户指南 - + Open log directory 打开日志文件目录 - + JT4 - + Message averaging 信息平均值 - + Enable averaging 平均值 - + Enable deep search 启用深度搜索 - + WSPR - + Echo Graph Echo 图 - + F8 - - + + Echo - + EME Echo mode EME Echo 模式 - + ISCAT - + Fast Graph 快速图 - - F9 - - - - + &Download Samples ... 下载样本文件(&D) ... - + <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> <html><head/><body><p>下载演示各种模式的示例音频文件.</p></body></html> - + MSK144 - + QRA64 - + Release Notes 版本发行说明 - + Enable AP for DX Call 启用 AP 为 DX 呼叫 - + FreqCal - + Measure reference spectrum 测量参考频谱 - + Measure phase response 测量相位响应 - + Erase reference spectrum 擦除参考频谱 - + Execute frequency calibration cycle 执行频率校准周期 - + Equalization tools ... 均衡工具 ... - - + + FT8 - - + + Enable AP 启用 AP - + Solve for calibration parameters 校准参数的解算 - + Copyright notice 版权声明 - + Shift+F1 - + Fox log 狐狸日志 - + FT8 DXpedition Mode User Guide FT8 远征模式用户指南 - + Reset Cabrillo log ... 重置Cabrillo日志 ... - + Color highlighting scheme 颜色突出显示设定 - + Export Cabrillo log ... 导出Cabrillo日志 ... - + Contest log 竞赛日志 - + Erase WSPR hashtable 擦除 WSPR 哈希表 - - + + FT4 - + Quick-Start Guide to Q65 Q65 快速入门指南 - + Auto Clear Avg after decode 解码后自动清除平均值 - + Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 WSJT-X 2.5.0和MAP65 3.0快速入门指南 - + Rig Control Error 无线电设备控制错误 - - - + + + Receiving 接收 - + Do you want to reconfigure the radio interface? 是否要重新配置无线电设备接口? - + Error Scanning ADIF Log 扫描 ADIF 日志错误 - + Error Loading LotW Users Data 加载 LotW 用户数据错误 - + + + + Decoder Error + + + + + The decoder subprocess exited unexpectedly. + + + + + jt9 exited unexpectedly with code %1. + + + + + Error Writing WAV File 写入 WAV 文件时错误 - + Enumerating audio devices 列举音频设备 - + Configurations... 配置文件... - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + Message 信息 - + Error Killing jt9.exe Process 错误终止 jt9.exe 进程 - + KillByName return code: %1 按名称终止返回代码: %1 - + Error removing "%1" 删除时错误 "%1" - + Click OK to retry 单击 确定 重试 - - + + %1.wav: invalid sample count %2 + + + + + Improper mode 模式不正确 - - + + File Open Error 文件打开错误 - - - - - + + + + + Cannot open "%1" for append: %2 无法打开 "%1" 用于附加: %2 - + Error saving c2 file 保存 c2 文件错误 - + Error in Sound Input 声音输入错误 - + Error in Sound Output 声音输错误 - - + + Single-Period Decodes 单周期解码 - - + + Average Decodes 平均解码 - + Change Operator 改变操作员 - + New operator: 新操作员: - + Status File Error 状态文件错误 - - + + Cannot open "%1" for writing: %2 无法打开 "%1" 用于写入: %2 - + Decodes containing My Call 解码包含我的呼叫 - + Subprocess Error 子流程错误 - + Subprocess failed with exit code %1 子流程失败, 退出代码为 %1 - - + + Running: %1 %2 运行: %1 %2 - + Subprocess error 子进程错误 - Reference spectrum saved - 保存参考频谱 + 保存参考频谱 Runaway Tx watchdog @@ -5448,7 +6795,6 @@ Double-click to reset to the standard 73 message WD:%1分 - It is very important to avoid audio harmonics and distorted audio signals. This is usually achieved by the following step-by-step approach: @@ -5472,7 +6818,7 @@ This is usually achieved by the following step-by-step approach: If possible, check your transmission from time to time with a webSDR to ensure the signal is clean and not distorted. - 避免音频谐波和失真的音频信号非常重要. + 避免音频谐波和失真的音频信号非常重要. 通常通过以下逐步方法实现: 1.在 "电台设置" 中选择 "软件虚拟" 作为您的 "异频模式". 如果你的 @@ -5497,22 +6843,21 @@ to ensure the signal is clean and not distorted. 以确保信号干净且不失真. - <b>Recommended Audio Settings</b> - <b>推荐的音频设置</b> + <b>推荐的音频设置</b> - + Invalid data in fmt.all at line %1 在 %1 行中 fmt.all 的无效数据 - + Good Calibration Solution 良好的校准解决方案 - + <pre>%1%L2 ±%L3 ppm %4%L5 ±%L6 Hz @@ -5521,41 +6866,40 @@ to ensure the signal is clean and not distorted. - + Delete Calibration Measurements 删除校准测量值 - + The "fmt.all" file will be renamed as "fmt.bak" "fmt.all" 文件将重命名为 "fmt.bak" - If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: "The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2025 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; and other members of the WSJT Development Group." - 如果您根据GNU通用公共许可证的条款合理使用WSJT-X的任何部分, 您必须在您的衍生作品中突出显示以下版权声明: + 如果您根据GNU通用公共许可证的条款合理使用WSJT-X的任何部分, 您必须在您的衍生作品中突出显示以下版权声明: "WSJT-X和相关程序的算法 源代码 外观和感觉, 以及模式的协议规范 FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 版权所有(C) 2001-2024是由以下一个或多个作者拥有: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; 和WSJT发展小组的其他成员." - + No data read from disk. Wrong file format? 没有从磁盘读取数据. 文件格式出错误? - + Confirm Delete 确认删除 - + Are you sure you want to delete all *.wav and *.c2 files in "%1"? 是否确实要删除所有 *.wav 和 *.c2 文件在 "%1"? - + Keyboard Shortcuts 键盘快捷键 @@ -5657,7 +7001,6 @@ to ensure the signal is clean and not distorted. </table> - <table cellspacing=1> <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> @@ -5708,7 +7051,7 @@ to ensure the signal is clean and not distorted. </table> Keyboard shortcuts help window contents - <table cellspacing=1> + <table cellspacing=1> <tr><td><b>Esc </b></td><td>停止发送,中止通联,清除下一个呼叫序列</td></tr> <tr><td><b>F1 </b></td><td>线上用户指南 (Alt: 发送 Tx6)</td></tr> <tr><td><b>Shift+F1 </b></td><td>版权声明</td></tr> @@ -5759,12 +7102,11 @@ to ensure the signal is clean and not distorted. </table> - + Special Mouse Commands 特殊鼠标组合 - <table cellpadding=5> <tr> <th align="right">Click on</th> @@ -5877,7 +7219,7 @@ to ensure the signal is clean and not distorted. </tr> </table> Mouse commands help window contents - <table cellpadding=5> + <table cellpadding=5> <tr> <th align="right">点击</th> <th align="left">作用</th> @@ -5990,33 +7332,149 @@ to ensure the signal is clean and not distorted. </table> - + No more files to open. 没有要打开的文件. - - Spotting to PSK Reporter unavailable - 发送到 Pskreporter 不可用 + 发送到 Pskreporter 不可用 - + Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. 请选择另一个发射频率. WSJT-X 不会故意在 30m 的 WSPR 子频段中传输另一种模式. - + WSPR Guard Band WSPR保护波段 - + Scanned ADIF log, %1 worked-before records created. CTY: %2 扫描 ADIF 日志, %1 创建曾经通联记录. CTY: %2 - + + The decoder subprocess could not be stopped. + + + + + The decoder subprocess could not be restarted. + + + + + Application status + + + + + Current WSJT-X status messages and operating indicators. + + + + + Transmit status + + + + + Configuration + + + + + Decode count + + + + + Last transmitted message + + + + + Power and SWR status + + + + + Decode progress + + + + + Progress for the current decode operation. + + + + + Transmit watchdog + + + + + The selected transmit message cannot be encoded. Enable Tx has been turned off. Edit the selected message or check station settings before trying again. + + + + + Tx message cannot be encoded; Enable Tx is off + + + + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2026 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; Roger Rehr, W3SZ; John Nelson, G4KLA; Charlie Suckling, DL3WDG; Terrell Deppe, KJ5HST; and other members of the WSJT Development Group." + + + + + EME Chart + + + + + Select Year + + + + + FT8 input completion was rejected: automated=%1 awaiting=%2 frames=%3. + + + + + Unable to flush the final FT8 downsampling block. + + + + + FT8 input completed with %1 of %2 samples in the decode buffer. + + + + + FT8 decoding is running behind; early passes are temporarily reduced. + + + + + FT8 decoding caught up; configured early passes restored. + + + + + + PSK Reporter spot queue full; oldest spot dropped + + + + Please choose another dial frequency. Must be 3Khz away from %1. WSJT-X will not operate in Fox mode @@ -6027,13 +7485,35 @@ WSJT-X不会以狐狸模式工作 重叠标准FT8子频带. - - + Fox Mode warning 狐狸模式警告 - + + A QSO between two stations with nonstandard callsigns won't work. + +Auto Seq would get stuck in an endless loop. + + + + + %1 shorthand-message mode + + + + + RR73 is not available in %1. Tx4 uses RRR in this mode. + + + + + Wait & Pounce requires a CQ response mode. +Change CQ: None to another option. + + + + Please choose another dial frequency. WSJT-X will not operate in Fox mode overlapping the WSPR sub-bands. @@ -6042,7 +7522,7 @@ WSJT-X 不会操作在Fox模式下 与WSPR子带重叠. - + Last Tx: %1 最后发射: %1 @@ -6329,7 +7809,7 @@ WSJT-X 不会操作在Fox模式下 </table> - + This station transmits in the same time slot as you do. You must not start a QSO if both stations Tx even/1st @@ -6346,7 +7826,7 @@ checkbox, or choose another station. 复选框, 或选取另一个电台. - + Should you switch to EU VHF Contest mode? To do so, check 'Special operating activity' and @@ -6357,153 +7837,550 @@ To do so, check 'Special operating activity' and 设置高级选项卡上的 '欧洲 VHF 竞赛'. - + Should you switch to ARRL Field Day mode? 是否应切换到 ARRL Field Day 模式? - + Should you switch to RTTY contest mode? 是否应切换到 RTTY 竞赛模式? - - - - + + + Decoder is starting; decode request skipped. + + + + + + + Add to CALL3.TXT 添加到 CALL3.TXT - + Please enter a valid grid locator 请输入有效的网格定位 - + Cannot open "%1" for read/write: %2 无法打开 "%1" 用于读/写: %2 - + %1 is already in CALL3.TXT, do you wish to replace it? %1 CALL3.TXT已经存在, 你想替换它吗? - + Warning: DX Call field is empty. 警告: DX 呼号字段为空. - + + SuperFox free text may only contain spaces, digits, uppercase letters, and + - . / ?. + + + + Log file error 日志文件错误 - + Cannot open "%1" 无法打开 "%1" - + Error sending log to N1MM 将日志发送到 N1MM 时发生错误 - + Write returned "%1" 写入返回 "%1" - + + DX call + + + + + Callsign of station to be worked. + + + + + DX grid + + + + + Locator of station to be worked. + + + + + Wait and Call + + + + + Lookup DX call + + + + + Add DX call + + + + + Ignore DX call + + + + + CQ response mode + + + + + Selects a station automatically from replies to your pending CQ after Enable Tx is armed in the current receive period, or from CQ messages for Wait & Pounce. + + + + + Transmit audio frequency + + + + + Receive audio frequency + + + + + Signal report + + + + + Operating band + + + + + Operating band text + + + + + Transmit power attenuation + + + + + Adjust Tx audio level attenuation. + + + + + Show or hide the menu bar. + + + + + Rig control status + + + + + Hound mode + + + + + Toggle FT8 hound mode. Right-click to toggle SuperFox mode. + + + + + Message panel selector + + + + + Switches between standard messages, Fox queue, and band hopping pages. Press 1, 2, or 3 while focused to select a page. + + + + + Standard messages + + + + + Fox queue + + + + + + Band hopping + + + + + Standard messages page + + + + + Fox queue page + + + + + Band hopping page + + + + + Hound queue + + + + + Queued Hound callers available for Fox transmissions. + + + + + Fox transmissions in progress + + + + + Hound callers currently in progress for Fox transmissions. + + + + + Hound queue sort order + + + + + Hound queue list size + + + + + Fox transmission slots + + + + + Fox CQ message + + + + + Reset Fox queues + + + + + Fox free text + + + + + Send Fox free text + + + + + Enable FT8 QRG 1 + + + + + Enable FT8 QRG 2 + + + + + Enable FT8 QRG 3 + + + + + Enable FT8 QRG 4 + + + + + Enable FT8 QRG 5 + + + + + Enable FT8 QRG 6 + + + + + Enable FT8 QRG 7 + + + + + Enable FT8 QRG 8 + + + + + FT8 QRG 1 frequency + + + + + FT8 QRG 2 frequency + + + + + FT8 QRG 3 frequency + + + + + FT8 QRG 4 frequency + + + + + FT8 QRG 5 frequency + + + + + FT8 QRG 6 frequency + + + + + FT8 QRG 7 frequency + + + + + FT8 QRG 8 frequency + + + + + Tx1 message + + + + + Tx2 message + + + + + Tx3 message + + + + + Tx4 message + + + + + Tx5 message macro + + + + + Tx6 message + + + + + Tx5 message macro text + + + + + Select Tx1 for next transmission + + + + + Select Tx2 for next transmission + + + + + Select Tx3 for next transmission + + + + + Select Tx4 for next transmission + + + + + Select Tx5 for next transmission + + + + + Select Tx6 for next transmission + + + + + Transmit Tx1 now + + + + + Transmit Tx2 now + + + + + Transmit Tx3 now + + + + + Transmit Tx4 now + + + + + Transmit Tx5 now + + + + + Transmit Tx6 now + + + + Stations calling DXpedition %1 呼叫远征电台 %1 - + Show Already Worked 显示已经通联过的 - + + All Decodes + + + + + QSO Frequency + + + + Super Fox 超级狐狸 - + Super Hound 超级猎犬 - + Hound 猎犬 - + Tx Messages 发射信息 - - - - - - + + + + + + Confirm Erase 确认擦除 - + Are you sure you want to erase file ALL.TXT? 是否确实要擦除 ALL.TXT 文件? - + Are you sure you want to erase the list of Q65 callers? 是否确实要擦除 Q65呼叫者表? - - + + Confirm Reset 确认重置 - + Are you sure you want to erase your contest log? 是否确实要擦除竞赛日志? - + Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. 执行此操作将删除当前竞赛的所有通联记录. 它们将保留在 ADIF 日志文件中, 但无法导出到您的Cabrillo日志中. - + Cabrillo Log saved Cabrillo日志已保存 - + Are you sure you want to erase file wsjtx_log.adi? 是否确实要擦除 wsjtx_log.adi 文件? - + Are you sure you want to erase the WSPR hashtable? 是否确实要擦除 WSPR 哈希表? - + %1 W %1 瓦 - + SWR > 2.5 !!! Transmission was stopped @@ -6516,118 +8393,399 @@ Check your antenna 检查你的天线 - + Tune digital gain 调谐数码增益 - + Transmit digital gain 传输数码增益 - + Prefixes 前缀 - + Network Error 网络错误 - + Error: %1 UDP server %2:%3 错误: %1 UDP 服务器 %2:%3 - + + File Error 文件错误 - + + + Stop transmitting or tuning before changing the dial frequency. + + + + + + Measuring reference spectrum: %1 s remaining + + + + + Reference spectrum measurement stopped; Ref Spec is available + + + + + Reference spectrum saved; Ref Spec is available + + + + + Reference spectrum measurement stopped; no reference spectrum is available + + + + Phase Training Disabled 已禁用阶段训练 - + Phase Training Enabled 已启用阶段训练 - + + Cannot remove "%1": %2 + + + + WD:0m WD:溢出 - + Runaway Tx watchdog 发射监管计时器 - + WD:%1m WD:%1分 - - + + + Free Text Message 自定义信息 - - + + Message: 信息: - + Directional calls not yet supported in SuperFox mode SuperFox模式尚不支持定向呼叫 - + TOTP: No seed entered in fox configuration to generate verification code. TOTP: 没有在fox配置中输入种子来生成验证码. - + + SuperFox cannot queue %1: unsupported callsign. + + + + TOTP SF: seed not long enough. TOTP SF: 种子不够长. - + + SuperFox Tx stopped: invalid message tokens. + + + + + SuperFox Tx stopped: invalid verification code. + + + + + SuperFox Tx stopped: invalid CQ call or grid. + + + + + SuperFox Tx stopped: invalid callsign. + + + + + SuperFox Tx stopped: report is outside the SuperFox range. + + + + + SuperFox Tx stopped: free text contains unsupported characters. + + + + + SuperFox Tx stopped: message could not be packed. + + + + Are you sure you want to erase the Tx Log? 您确定要清除发射日志吗? - + "%1" added to Ignore List "%1" 已添加到忽略列表 - + Are you sure you want to erase the Ignore List? 您确定要删除忽略列表吗? - - + + Log File Error 日志文件错误 - - Are you sure you want to clear the QSO queues? - 是否确实要清除通联队列? + + Are you sure you want to clear the QSO queues? + 是否确实要清除通联队列? + + + QCustomPlot plot examples + QCustomPlot plot样本 + + + + Band hopping has no selected frequencies. + + + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: cycle CQ response mode)</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Cycle CQ response mode</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Ctrl+X </b></td><td>Open next file in directory</td></tr> + <tr><td><b>Alt+x </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> + +</table> + + + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Right-click</b> to set Tx frequency.<br/> + <b>Double-right-click</b> to set Rx and Tx frequencies. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> + and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> + Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> + own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">Dial Frequency:</td> + <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> + <b>Right-click</b> to increase frequency by 1 kHz.<br/> + <b>Left-click</b> to decrease frequency by 1 kHz.<br/> + The mouse pointer must be over the Dial Frequency indicator. + </td> + </tr> + <tr> + <td align="right">H Button:</td> + <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to activate or deactivate SuperFox mode. + </td> + </tr> + <tr> + <td align="right">FT8 Button:</td> + <td><b>Click</b> to switch to FT8 Hound Mode.<br/> + <b>Right-click</b> to toggle last used Special Operating Activity On/Off. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> + <tr> + <td align="right">Tx5 Button:</td> + <td><b>Right-click</b> to retain Tx5 free text. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Right-click</b> to freeze the state of the checkbox.<br/> + <b>Right-click on the FT8 Button</b> to unfreeze. + </td> + </tr> + <tr> + <td align="right">Enable Tx Button:</td> + <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> + <b>Right-click</b> to toggle Wait & Pounce On/Off after selecting<br/> + any CQ response mode other than CQ: None. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> + If <b>Alternate Erase button behavior</b> is checked:<br/> + <b>Click</b> to erase Band Activity window.<br/> + <b>Right-click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">DX Call Button:</td> + <td><b>Click</b> to toggle Wait & Call On/Off.<br/> + <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. + </td> + </tr> + <tr> + <td align="right">Lookup Button:</td> + <td><b>Click</b> to search for callsign in database.<br/> + <b>Right-click</b> to search for Dx Call on qrz.com. + </td> + </tr> + <tr> + <td align="right">Add Button:</td> + <td><b>Click</b> to add callsign and locator to database.<br/> + <b>Right-click</b> to search for Dx Call on hamqth.com. + </td> + </tr> + <tr> + <td align="right">Ignore Button:</td> + <td><b>Click</b> to add callsign to the Ignore List.<br/> + <b>Right-click</b> to search for Dx Call on qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Band Buttons:</td> + <td><b>Click</b> to toggle band / mode default frequencies.<br/> + <b>Right-click</b> to toggle FT8 DXpedition frequencies. + </td> + </tr> +</table> + - QCustomPlot plot examples - QCustomPlot plot样本 + + Type 1 Prefixes: + + 1A 1S 3A 3B6 3B8 3B9 3C 3C0 3D2 3D2C 3D2R 3DA 3V 3W 3X + 3Y 3YB 3YP 4J 4L 4S 4U1I 4U1U 4W 4X 5A 5B 5H 5N 5R + 5T 5U 5V 5W 5X 5Z 6W 6Y 7O 7P 7Q 7X 8P 8Q 8R + 9A 9G 9H 9J 9K 9L 9M2 9M6 9N 9Q 9U 9V 9X 9Y A2 + A3 A4 A5 A6 A7 A9 AP BS7 BV BV9 BY C2 C3 C5 C6 + C9 CE CE0X CE0Y CE0Z CE9 CM CN CP CT CT3 CU CX CY0 CY9 + D2 D4 D6 DL DU E3 E4 EA EA6 EA8 EA9 EI EK EL EP + ER ES ET EU EX EY EZ F FG FH FJ FK FKC FM FO + FOA FOC FOM FP FR FRG FRJ FRT FT5W FT5X FT5Z FW FY M MD + MI MJ MM MU MW H4 H40 HA HB HB0 HC HC8 HH HI HK + HK0A HK0M HL HM HP HR HS HV HZ I IS IS0 J2 J3 J5 + J6 J7 J8 JA JDM JDO JT JW JX JY K KG4 KH0 KH1 KH2 + KH3 KH4 KH5 KH5K KH6 KH7 KH8 KH9 KL KP1 KP2 KP4 KP5 LA LU + LX LY LZ OA OD OE OH OH0 OJ0 OK OM ON OX OY OZ + P2 P4 PA PJ2 PJ7 PY PY0F PT0S PY0T PZ R1F R1M S0 S2 S5 + S7 S9 SM SP ST SU SV SVA SV5 SV9 T2 T30 T31 T32 T33 + T5 T7 T8 T9 TA TF TG TI TI9 TJ TK TL TN TR TT + TU TY TZ UA UA2 UA9 UK UN UR V2 V3 V4 V5 V6 V7 + V8 VE VK VK0H VK0M VK9C VK9L VK9M VK9N VK9W VK9X VP2E VP2M VP2V VP5 + VP6 VP6D VP8 VP8G VP8H VP8O VP8S VP9 VQ9 VR VU VU4 VU7 XE XF4 + XT XU XW XX9 XZ YA YB YI YJ YK YL YN YO YS YU + YV YV0 Z2 Z3 ZA ZB ZC4 ZD7 ZD8 ZD9 ZF ZK1N ZK1S ZK2 ZK3 + ZL ZL7 ZL8 ZL9 ZP ZS ZS8 KC4 E5 + +Type 1 Suffixes: /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /P + @@ -6647,8 +8805,8 @@ UDP 服务器 %2:%3 Modes - - + + Mode 模式 @@ -6656,7 +8814,7 @@ UDP 服务器 %2:%3 MultiSettings - + Default 默认值 @@ -6664,62 +8822,62 @@ UDP 服务器 %2:%3 MultiSettings::impl - + &Switch To 切换到(&S) - + &Clone 克隆(&C) - + Clone &Into ... 克隆到(&I) ... - + R&eset 重置(&e) - + &Rename ... 重新命名(&R) ... - + &Delete 删除(&D) - + Clone Into Configuration 克隆到配置 - + Confirm overwrite of all values for configuration "%1" with values from "%2"? 确认覆盖配置 "%1" 的所有值, 以及来自 "%2"的值? - + Reset Configuration 重置配置 - + Confirm reset to default values for configuration "%1"? 确认重置为配置的默认值 "%1"? - + Delete Configuration 删除配置 - + Confirm deletion of configuration "%1"? 确认删除配置 "%1"? @@ -6727,17 +8885,17 @@ UDP 服务器 %2:%3 NameDialog - + New Configuration Name 新配置名称 - + Old name: 旧名称: - + &New name: 新名称(&N): @@ -6763,12 +8921,12 @@ UDP 服务器 %2:%3 无法启动 OmniRig COM 服务器 - + OmniRig: don't know how to set rig frequency OmniRig:不知道如何设置无线电设备频率 - + OmniRig COM/OLE error: %1 at %2: %3 (%4) OmniRig COM/OLE 错误: %1 at %2: %3 (%4) @@ -6794,34 +8952,33 @@ UDP 服务器 %2:%3 - + Too many colours in palette. 调色板中颜色太多. - + Error reading waterfall palette file "%1:%2" too many colors. 读取瀑布调色板文件时错误 "%1:%2" 太多颜色. - + Error reading waterfall palette file "%1:%2" invalid triplet. 读取瀑布调色板文件时错误 "%1:%2" 无效的三元组. - + Error reading waterfall palette file "%1:%2" invalid color. 读取瀑布调色板文件时错误 "%1:%2" 无效的颜色. - + Error opening waterfall palette file "%1": %2. 读取瀑布调色板文件时错误 "%1": %2. - Error writing waterfall palette file "%1": %2. - 读取瀑布调色板文件时错误 "%1": %2. + 读取瀑布调色板文件时错误 "%1": %2. @@ -7225,7 +9382,7 @@ Message 发送信息 - + MessageCreator 信息创建器 @@ -7243,7 +9400,7 @@ Message 清除 - + QSY Monitor QSY监听 @@ -7380,62 +9537,62 @@ Error(%2): %3 SoundInput - + An error opening the audio input device has occurred. 打开音频输入设备时错误. - + An error occurred during read from the audio input device. 从音频输入设备读取时错误. - + Non-recoverable error, audio input device not usable at this time. 不可恢复的错误, 音频输入设备此时不可用. - + Requested input audio format is not valid. 请求的输入音频格式无效. - + Requested input audio format is not supported on device. 设备不支持请求输入的音频格式. - + Failed to initialize audio sink device 无法初始化音频接收器设备 - + Idle 闲置 - + Receiving 接收 - + Suspended 暂停 - + Interrupted 中断 - + Error 错误 - + Stopped 停止 @@ -7443,90 +9600,114 @@ Error(%2): %3 SoundOutput - + An error opening the audio output device has occurred. 打开音频输出设备时错误. - + An error occurred during write to the audio output device. 写入音频输出设备期间错误. - + Audio data not being fed to the audio output device fast enough. 音频数据未以足够快的速度馈送到音频输出设备. - + Non-recoverable error, audio output device not usable at this time. 不可恢复的错误, 音频输出设备此时不可用. - + Requested output audio format is not valid. 请求的输出音频格式无效. - + Requested output audio format is not supported on device. 设备不支持请求输出的音频格式. - + + Audio output restart attempt failed. + + + + + No audio output device configured. 未配置音频输出设备. - + + No audio output stream is active. + + + + Idle 闲置 - + Sending 发送 - + Suspended 暂停 - + Interrupted 中断 - + Error 错误 - + Stopped 停止 + + SplashScreen + + + WSJT-X — Welcome + + + + + WSJT-X startup information. Press Escape to close. + + + StationDialog - + Add Station 添加电台 - + &Band: 波段(&B): - + &Offset (MHz): 偏移 (M&Hz): - + &Antenna: 天线(&A): @@ -7567,184 +9748,206 @@ Error(%2): %3 TCITransceiver - + ConnectionRefused 连接被拒绝 - + RemoteHostClosed 远程主机已关闭 - + HostNotFound 找不到主机 - + SocketAccess Socket接入 - + SocketResource Socket资源 - + SocketTimeout Socket超时 - + DatagramTooLarge 数据报文太大 - + Network 网络 - + AddressInUse 地址使用中 - + SocketAddressNotAvailable Socket 地址不可用 - + UnsupportedSocketOperation 不支持的Socket操作 - + UnfinishedSocketOperation 未完成的Socket操作 - + ProxyAuthenticationRequired 需要代理身份验证 - + SslHandshakeFailed SSL握手失败 - + ProxyConnectionRefused 代理连接被拒绝 - + ProxyConnectionClosed 代理连接关闭 - + ProxyConnectionTimeout 代理连接超时 - + ProxyNotFound 找不到代理 - + ProxyProtocol 代理协议 - + Operation 操作 - + SslInternal SSL内部 - + SslInvalidUserData SSL无效用户数据 - + Temporary 临时 - + UnknownSocket 未知的Socket - + + UnknownSocketError + + + + TCI websocket error: %1 TCI WebSocket 错误: %1 - + TCI SDR could not be switched on TCI SDR 无法打开 - + TCI SDR is not switched on TCI SDR 未打开 - + TCI RX2 could not be enabled TCI RX2无法启用 - + TCI Audio could not be switched on TCI音频无法打开 - - + + TCI could not be opened TCI无法打开 - - + + + + TCI sent an invalid VFO frequency + + + + + TCI failed to set ptt TCI未能设置PTT - + TCI should use PTT via CAT TCI应通过CAT使用PTT - - + + TCI failed set rxfreq TCI设置接收频率失败 - - + + TCI failed set mode TCI设置模式失败 - + TCI modulator not Idle TCI调制器被占用 + + + TCI source commitment; playout evidence is protocol-send dead reckoning, not DAC confirmation + + + + + TCI WebSocket send progress; no radio DAC or RF playback confirmation + + TransceiverBase @@ -7762,27 +9965,27 @@ Error(%2): %3 对话框 - + Spectrum gain 频谱增益 - + <html><head/><body><p>Enter definition for a new color palette.</p></body></html> <html><head/><body><p>输入新调色板的定义.</p></body></html> - + Adjust... 调整... - + Total power (dB) 总功率 (分贝) - + Waterfall gain 瀑布增益 @@ -7795,200 +9998,209 @@ Error(%2): %3 调色板 - + <html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html> <html><head/><body><p>在此窗口中设置频谱的大小.</p></body></html> - + % - + Spec 占高 - + <html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html> <html><head/><body><p>在完整显示的间隔内平展频谱基线.</p></body></html> - + Flatten 平坦化 - <html><head/><body><p>Compute and save a reference spectrum. (Not yet fully implemented.)</p></body></html> - <html><head/><body><p>计算并保存参考频谱. (尚未完全实现.)</p></body></html> + <html><head/><body><p>计算并保存参考频谱. (尚未完全实现.)</p></body></html> - + Ref Spec 参考规格 - + Smoothing of Linear Average spectrum 线性平均频谱的平滑 - + Smooth 平滑 - + Compression factor for frequency scale 频率刻度的压缩系数 - + + <html><head/><body><p>Controls</p></body></html> + + + + Bins/Pixel 点/像素 - - + + <html><head/><body><p>Position of time stamp above each interval line</p></body></html> <html><head/><body><p>时间戳在每个间隔线上方的位置</p></body></html> - + Time stamp 时间戳 - - + + Off 取消 - + Left 左边 - + Right 右边 - + Palette 调色板 - + Select waterfall palette 选择瀑布调色板 - + Bars 游标条 - + Freq 频率 - + + <html><head/><body><p>Apply a saved reference spectrum to flatten the received passband. Available after a reference spectrum has been measured. (Not yet fully implemented.)</p></body></html> + + + + <html><head/><body><p>Select data for spectral display</p></body></html> <html><head/><body><p>选择用于频谱显示的数据</p></body></html> - + Current 当前 - + Cumulative 累积 - + Linear Avg 线性平均 - + Reference 参考 - + Q65_Sync Q65_同步 - + <html><head/><body><p>Frequency at left edge of waterfall</p></body></html> <html><head/><body><p>波段在瀑布左边缘显示</p></body></html> - + Hz 赫兹 - + Start 开始 - + <html><head/><body><p>Decode JT9 only above this frequency</p></body></html> <html><head/><body><p>仅在此频率以上解码 JT9</p></body></html> - + Hz 赫兹 - + Split 异频 - + Number of FFTs averaged (controls waterfall scrolling rate) FFT 平均数(控制瀑布滚动速率) - + N Avg N 平均 - + Waterfall zero 瀑布零度 - + Spectrum zero 频谱零度 - + User Defined 用户定义 - + Wide Graph 频谱瀑布图 - - + + Read Palette 读取调色板 @@ -7996,22 +10208,22 @@ Error(%2): %3 WorkedBefore - + Invalid ADIF field %0: %1 无效的ADIF字段 %0: %1 - + Malformed ADIF field %0: %1 格式不正确的ADIF字段 %0: %1 - + Invalid ADIF header 无效的ADIF标头 - + Error opening ADIF log file for read: %0 打开ADIF日志文件进行读取时出错: %0 @@ -8054,7 +10266,7 @@ Error(%2): %3 我的网格(&y): - + <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> <html><head/><body><p>梅登黑德定位, 最好是 6 个字符.</p></body></html> @@ -8069,117 +10281,117 @@ Error(%2): %3 自动网格 - + IARU Region: IARU 区域: - + <html><head/><body><p>Select your IARU region.</p></body></html> <html><head/><body><p>选择您的 IARU 区域.</p></body></html> - + Message generation for type 2 compound callsign holders: 信息生成用于类型2复合呼号持有人: - + <html><head/><body><p>Type 2 compound callsigns are those with prefixes or suffixes not included in the allowed shortlist (See Help-&gt;Add-on prefixes and suffixes).</p><p>This option determines which generated messages should contain your full type 2 compound call sign rather than your base callsign. It only applies if you have a type 2 compound callsign.</p><p>This option controls the way the messages that are used to answer CQ calls are generated. Generated messages 6 (CQ) and 5 (73) will always contain your full callsign. The JT65 and JT9 protocols allow for some standard messages with your full call at the expense of another piece of information such as the DX call or your locator.</p><p>Choosing message 1 omits the DX callsign which may be an issue when replying to CQ calls. Choosing message 3 also omits the DX callsign and many versions of this and other software will not extract the report. Choosing neither means that your full callsign only goes in your message 5 (73) so your QSO partner may log the wrong callsign.</p><p>None of these options are perfect, message 3 is usually best but be aware your QSO partner may not log the report you send them.</p></body></html> <html><head/><body><p>复合呼号类型2是那些前缀或后缀不包括在允许的决选名单中 (请参阅帮助-& gt; 加载项前缀和后缀).<p><p>此选项确定哪些生成的信息应包含完整类型2复合呼号, 而不是基本呼号.它仅适用于类型为2的复合呼号.</p><p>此选项控制用于应答 CQ 呼叫的信息的生成方式.生成的信息 6 (CQ) 和 5 (73) 将始终包含您的完整呼号.jt65 和 jt9 协议允许在您的完整呼叫中使用一些标准信息, 而牺牲了另一条信息, 如 DX 呼叫或您的定位器.</p><p>选择信息1省略DX 呼号, 这在答复 CQ 呼叫时可能是一个问题.选择信息3也会省略 DX 呼号, 此软件和其他软件的许多版本都不会提取报告.选择这两个都意味着你的完整呼号只会出现在你的信息 5 (73) 中, 所以你的通联伙伴我的日志是错误的呼号.</p><p>这些选项都不是完美的, 信息3是最好的, 但请注意, 您的通联合作伙伴可能不会记录您发送的报告.</p></body></html> - + Full call in Tx1 完整呼号在 发射1 - + Full call in Tx3 完整呼号在 发射3 - + Full call in Tx5 only 完整呼号在 发射5 - + Display 显示 - + Show outgoing transmitted messages in the Rx frequency window. 在接收信息窗口中显示已发射的信息. - + &Tx messages to Rx frequency window 发出讯息在接收信息窗口显示(&T) - + Show if decoded stations are new DXCC entities or worked before. 显示解码的电台是新的 DXCC 实体还是以前曾经通联. - + <html><head/><body><p>Check to have decodes for a new period start at the top of the Band Activity window and not scroll off the top when the window is full.</p><p>This is to aid selecting decodes to double-click while decoding is still in progress. Use the Band Activity vertical scroll bar to reveal decodes past the bottom of the window.</p></body></html> <html><head/><body><p>新周期的解码信息在波段活动视窗的顶部开始向下滚动.</p><p>这有助于在解码仍在进行时选择要双击的解码.使波段活动垂直滚动条显示视窗底部的解码.</p></body></html> - + Start new period decodes at top 解码信息从上往下滚动 - + Set the font characteristics for the application. 设置应用程序的字体. - + Font... 软件字体... - + Set the font characteristics for the Band Activity and Rx Frequency areas. 设置波段活动和接收信息窗口的字体. - + Decoded Text Font... 解码字体... - + Include a separator line between periods in the band activity window. 在波段活动窗口中加入时间分隔行. - + &Blank line between decoding periods 每个解码周期插入间隔行(&B) - + Show distance to DX station in miles rather than kilometers. 以英里为单位显示 DX 站的距离而不是显示公里. - + Display dista&nce in miles 显示距离为英里(&n) - + Behavior 惯常方式 - + Decode after EME delay EME 延迟后解码 @@ -8188,79 +10400,77 @@ Error(%2): %3 发射监管计时器: - + <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> <html><head/><body><p>无人值守传输时到达设定分钟数中止发射</p></body></html> - + Disabled 停用 - + minutes 分钟 - + Single decode 单独解码 - <html><head/><body><p>Some rigs are not able to process CAT commands while transmitting. This means that if you are operating in split mode you may have to uncheck this option.</p></body></html> - <html><head/><body><p>某些无线电设备在发射时无法处理CAT 命令.这意味着, 如果您在异频模式下运行, 则可能必须取消选中此选项.</p></body></html> + <html><head/><body><p>某些无线电设备在发射时无法处理CAT 命令.这意味着, 如果您在异频模式下运行, 则可能必须取消选中此选项.</p></body></html> - Allow Tx frequency changes while transmitting - 允许发射期间改变频率 + 允许发射期间改变频率 - + Don't start decoding until the monitor button is clicked. 软件开启时, 关闭监听按钮. - + Mon&itor off at startup 开启时关闭监听(&i) - + <html><head/><body><p>Check this if you wish to automatically return to the last monitored frequency when monitor is enabled, leave it unchecked if you wish to have the current rig frequency maintained.</p></body></html> <html><head/><body><p>如果您希望在启用监听时自动返回到无线电设备最后一个监听频率.</p></body></html> - + Monitor returns to last used frequency 开始监听时使用上一次的频率 - + Alternate F1-F6 bindings 备用 F1-F6 绑定 - + Turns off automatic transmissions after sending a 73 or any other free text message. 发送 73 或任何其他自由文本消息后 关闭自动发射. - + Di&sable Tx after sending 73 发送 73 后关闭发射(&s) - + Send a CW ID after every 73 or free text message. 73或自定义信息发出后用CW模式发放你的呼号. - + CW ID a&fter 73 73发出后用CW模式发放你的呼号(&f) @@ -8269,7 +10479,7 @@ text message. 发射CW信息时间间隔(&v): - + Send a CW ID periodically every few minutes. This might be required under your countries licence regulations. It will not interfere with other users as it is always sent in the @@ -8280,42 +10490,42 @@ quiet period when decoding is done. 在解码完成后的安静期间发送. - + Automatic transmission mode. 自动发射模式. - + Doubl&e-click on call sets Tx enable 双击呼号集启用发射(&e) - + Calling CQ forces Call 1st CQ呼叫时强制呼叫第1 - + Show principal prefix instead of country name 显示前缀而不是国家或地区名称 - + Show &DXCC, grid, and worked-before status 显示 &DXCC, 网格和曾经通联状态 - + Show DXCC for all messages 所有信息显示DXCC - + <html><head/><body><p>Disable the Tune watchdog.</p></body></html> <html><head/><body><p>禁用调谐监察器.</p></body></html> - + MSK144/Q65: Tx until 73 is received MSK144/Q65: 发射直到接收到73 @@ -8324,32 +10534,32 @@ quiet period when decoding is done. 调谐监察器 - + <html><head/><body><p>Number of seconds before Tune is aborted</p></body></html> <html><head/><body><p>中止调谐前的秒数</p></body></html> - + seconds 秒 - + <html><head/><body><p>If a station sends locator, calculate and show the distance in Band Activity pane.</p></body></html> <html><head/><body><p>如果电台发送定位, 则计算并在波段活动窗中显示距离.</p></body></html> - + Show distance in messages with grid 在信息中带网格的显示距离 - + Show U.S. States in messages with grid 在信息中带有网格的显示美国各州 - + <html><head/><body><p>Align the text for DXCC, distance and azimuth.</p></body></html> <html><head/><body><p>对齐DXCC, 距离和方位的文本.</p></body></html> @@ -8358,7 +10568,7 @@ quiet period when decoding is done. 对齐DXCC, 距离和方位 - + Alternate Erase button behavior 备用擦除按钮行为 @@ -8367,22 +10577,22 @@ quiet period when decoding is done. <html><head/><body><p>增加或减少信息文本和DXCC之间的间距.</p></body></html> - + Enable Wait features 启用等待功能 - + <html><head/><body><p>If a station sends a valid Maidenhead locator, calculate and show the great-circle azimuth in Band Activity pane.</p></body></html> <html><head/><body><p>如果一个电台发送一个有效的梅登黑德定位, 计算并在波段活动窗格中显示大圆方位角.</p></body></html> - + Show azimuth in messages with grid 在信息中带网格的显示方位角 - + <html><head/><body><p>Increase or decrease the space between DXCC and distance/azimuth.</p></body></html> <html><head/><body><p>增加或减少DXCC和距离/方位角之间的间距.</p></body></html> @@ -8391,28 +10601,28 @@ quiet period when decoding is done. 禁用按钮颜色, 除非是强制 (需要重新启动) - + &Radio 电台(&R) - + Radio interface configuration settings. 设置无线电设备接口设置. - + Settings that control your CAT interface. 控制CAT界面的设置. - + CAT Control CAT控制 - - + + Port: 端口: @@ -8425,155 +10635,155 @@ quiet period when decoding is done. 显示 &DXCC, 网格和曾经通联状态 - + Serial port used for CAT control. 用于CAT控制的串行端口. - - + + Serial Port Parameters 串口参数 - + Baud Rate: 波特率: - + Serial port data rate which must match the setting of your radio. 串行端口数据速率必须与您的无线电设置相匹配. - + 1200 - + 2400 - + 4800 - + 9600 - + 19200 - + 38400 - + 57600 - + 115200 - + <html><head/><body><p>Number of data bits used to communicate with your radio's CAT interface (usually eight).</p></body></html> <html><head/><body><p>用于与无线电设备 CAT 接口通信的数据位元 (通常为 8 ).</p></body></html> - + Data bits 数据位元 - + Data Bits 数据位元 - + D&efault 默认值(&e) - + Se&ven Se&ven 7 - + E&ight E&ight 8 - + <html><head/><body><p>Number of stop bits used when communicating with your radio's CAT interface</p><p>(consult you radio's manual for details).</p></body></html> <html><head/><body><p>与无线电设备 CAT 接口通信时使用的停止位元</p><p>(详情请参阅无线电设备手册).</p></body></html> - + Stop bits 停止位元 - + Stop Bits 停止位元 - - + + Default 默认值 - + On&e On&e 1 - + T&wo T&wo 2 - + <html><head/><body><p>Flow control protocol used between this computer and your radio's CAT interface (usually &quot;None&quot; but some require &quot;Hardware&quot;).</p></body></html> <html><head/><body><p>电脑和无线电设备 CAT 接口 之间使用的流量控制协议 (通常是 "None",但有些要求"硬件").</p></body></html> - - + + Handshake 握手方式 - + &None 无(&N) - + Software flow control (very rare on CAT interfaces). 软件控制流 (在CAT接口上非常罕见). - + XON/XOFF - + Flow control using the RTS and CTS RS-232 control lines not often used but some radios have it as an option and a few, particularly some Kenwood rigs, require it). @@ -8582,75 +10792,74 @@ a few, particularly some Kenwood rigs, require it). 很少,特别是一些 健伍无线电设备,需要它). - + &Hardware 硬件(&H) - + Special control of CAT port control lines. 特殊控制的CAT控制线. - - + + Force Control Lines 强制控制线 - - + + High 高 - - + + Low 低 - + DTR: - + RTS: - How this program activates the PTT on your radio? - 此程序如何激活无线电设备上的 PTT? + 此程序如何激活无线电设备上的 PTT? - + PTT Method PTT 方法 - + <html><head/><body><p>No PTT activation, instead the radio's automatic VOX is used to key the transmitter.</p><p>Use this if you have no radio interface hardware.</p></body></html> <html><head/><body><p>如果您没有无线电设备接口硬件,没法PTT而是使用无线电设备的自动声控来发射,请使用此选项.</p></body></html> - + VO&X - + <html><head/><body><p>Use the RS-232 DTR control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The DTR control line of the CAT serial port may be used for this or a DTR control line on a different serial port may be used.</p></body></html> <html><head/><body><p>使用 RS-232 DTR 控制线路切换无线电设备的 PTT, 需要硬件来接口线路.</p><p>某些商业接口单元也使用此方法.</p><p>CAT 串行端口的 DTR 控制线路可用于此或可用于其他串行端口上的 DTR 控制线路.</p></body></html> - + &DTR - + Some radios support PTT via CAT commands, use this option if your radio supports it and you have no other hardware interface for PTT. @@ -8659,47 +10868,47 @@ other hardware interface for PTT. PTT的其它硬件接口. - + C&AT - + <html><head/><body><p>Use the RS-232 RTS control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The RTS control line of the CAT serial port may be used for this or a RTS control line on a different serial port may be used. Note that this option is not available on the CAT serial port when hardware flow control is used.</p></body></html> <html><head/><body><p>使用 RS-232 RTS 控制线路切换無線電設備的 PTT, 需要硬件来接口线路.</p><p>某些商业接口单元也使用此方法.</p><p>CAT 串行端口的 RTS 控制线路可用于此或可能用于其他串行端口上的 RTS 控制线路. 请注意, 使用硬件流控制时, CAT 串行端口上不可用此选项.</p></body></html> - + R&TS - + <html><head/><body><p>Select the RS-232 serial port utilised for PTT control, this option is available when DTR or RTS is selected above as a transmit method.</p><p>This port can be the same one as the one used for CAT control.</p><p>For some interface types the special value CAT may be chosen, this is used for non-serial CAT interfaces that can control serial port control lines remotely (OmniRig for example).</p></body></html> <html><head/><body><p>选择用于 PTT 控制的RS-232 串行端口,当选择上述DTR或RTS作为发射方法时,此选项可用.此端口可以与用于CAT控制的端口相同.对于某些接口类型,可以选择特殊值CAT,这用于可以远程控制串口控制线的非串行CAT接口 (例如 omnirig).</p></body></html> - + Modulation mode selected on radio. 在无线电设备上选择的调制模式. - + Mode 模式 - + <html><head/><body><p>USB is usually the correct modulation mode,</p><p>unless the radio has a special data or packet mode setting</p><p>for AFSK operation.</p></body></html> <html><head/><body><p>上边带通常是正确的调制模式,除非无线电设备具有用于AFSK操作的特殊数据或数据包模式设置.</p></body></html> - + US&B 上边带(&B) - + Don't allow the program to set the radio mode (not recommended but use if the wrong mode or bandwidth is selected). @@ -8708,23 +10917,23 @@ or bandwidth is selected). 或带宽). - - + + None 无 - + If this is available then it is usually the correct mode for this program. 如果这是可用的, 那么它通常是这个程序的正确模式. - + Data/P&kt 数据/封包(&k) - + Some radios can select the audio input using a CAT command, this setting allows you to select which audio input will be used (if it is available then generally the Rear/Data option is best). @@ -8733,52 +10942,52 @@ this setting allows you to select which audio input will be used (如果可用,则通常 后方/数据 选项是最佳选择). - + Transmit Audio Source 无线电设备音频源 - + Rear&/Data 后方&/数据口 - + &Front/Mic 前方/麦克风(&F) - + Rig: 无线电设备: - + Poll Interval: 轮询间隔: - + <html><head/><body><p>Interval to poll rig for status. Longer intervals will mean that changes to the rig will take longer to be detected.</p></body></html> <html><head/><body><p>软件与无线电设备沟通的时间间隔.时间间隔较长,意味着对无线电设备的更改需要更长的时间才能检测到.</p></body></html> - + s 秒 - + <html><head/><body><p>Attempt to connect to the radio with these settings.</p><p>The button will turn green if the connection is successful or red if there is a problem.</p></body></html> <html><head/><body><p>尝试使用这些设置连接到无线电设备.如果连接成功,该按钮将变为绿色; 如果有问题,则为红色.</p></body></html> - + Test CAT 测试 CAT - + Attempt to activate the transmitter. Click again to deactivate. Normally no power should be output since there is no audio being generated at this time. @@ -8791,62 +11000,62 @@ radio interface behave as expected. 的任何发射指示是否如预期的那样. - + Test PTT 测试 PTT - + Split Operation 异频操作 - + <html><head/><body><p>Use only VFO A for split operation (the program temporarily changes the QRG of your rig during transmission).</p></body></html> <html><head/><body><p>仅使用VFO A进行异频操作 (程序在传输过程中会暂时改变无线电设备的QRG).</p></body></html> - + Fake It 软件虚拟 - + <html><head/><body><p>Use VFO A+B for split operation (works with many rigs, but requires the use of both VFOs).</p></body></html> <html><head/><body><p>使用VFO A+B进行异频操作 (适用于许多无线电设备, 但需要使用两个VFO).</p></body></html> - + Rig 无线电设备 - + <html><head/><body><p>Don't use split (not recommended).</p></body></html> <html><head/><body><p>不要使用异频操作 (不推荐).</p></body></html> - + A&udio 音频(&u) - + Audio interface settings 音频接口设置 - + Souncard - + Soundcard 声效卡 - + Select the audio CODEC to use for transmitting. If this is your default device for system sounds then ensure that all system sounds are disabled otherwise @@ -8859,147 +11068,195 @@ transmitting periods. 向外发射输出. - + + Delete Tx macro + + + + + Deletes the selected Tx macro, or the focused macro if no row is selected. + + + + + Move &Up + + + + + Move Tx macro up + + + + + Moves the selected Tx macro one position earlier in the list. + + + + + Move D&own + + + + + Move Tx macro down + + + + + Moves the selected Tx macro one position later in the list. + + + + + Drag and drop items to rearrange order +Right click for item specific actions +Click, SHIFT+Click and, CTRL+Click to select items + + + + + Saved Tx macro messages + + + + + Saved free-text messages for the main window Tx5 dropdown. Use Move Up and Move Down or drag and drop to reorder messages. + + + + <html><head/><body><p>Check this option to note any Special Operating Activity in the comments field.</p></body></html> <html><head/><body><p>选中此选项可在注释字段中记录任何特殊操作活动.</p></body></html> - + Special operating activity to comments 特殊操作活动注释 - + Log automatically 日志自动记录 - + <html><head/><body><p>Use 'Log automatically' only for special operating activities.</p></body></html> <html><head/><body><p>仅在特殊操作活动中使用 "自动记录".</p></body></html> - + Contesting only 仅竞赛 - + <html><head/><body><p>Shorten 6-digit grid entries and log 4-digit grids instead.</p></body></html> <html><head/><body><p>缩短6位数网格条目, 改为记录4位数网格.</p></body></html> - + Log 4-digit grids 记录4位数网格 - + <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> <html><head/><body><p>输入WSJT-X应该向其发送更新的UDP服务器的服务端口号. 如果该值为零则不会发送任何更新.</p></body></html> - + Outgoing interfaces: 传出接口: - + <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> <html><head/><body><p>向多播组地址发送更新时需要指定将更新发送到哪个网络接口. 如果环回接口支持多播那么将至少选择该接口.</p><p>对于大多数用户来说环回接口是他们所需要的, 这将允许同一台机器上的多个其他应用程序与WSJT-X进行互操作. 如果运行在其他主机上的应用程序要接收状态更新则应使用合适的网络接口.</p><p>在某些Linux系统上可能需要在环回网络接口上启用多播.</p></body></html> - + <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> <html><head/><body><p>设置允许多点传送数据报的资料元或路由器资料元. 几乎每个人都应该将该值设置为 1 以保持出站多点传送流量在本地子网中.</p></body></html> - + Multicast TTL: 多点传送 TTL: - Reset Highlighting to WSJT-X default - 将高亮显示重置为 wsjt-x 默认值 - - - Reset Highlighting to wsjt-x_improved default - 将高亮显示重置为 wsjt-x_improved 默认值 + 将高亮显示重置为 wsjt-x 默认值 - + Highlight also messages with 73 or RR73 突出显示 73 或 RR73 信息 - - <html><head/><body><p>Highlight callsigns or grids with orange background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - <html><head/><body><p>用橙色背景色突出显示呼号或网格. 呼号 和/或 网格必须用逗号隔开, 每个呼号后面必须有一个逗号.</p></body></html> + <html><head/><body><p>用橙色背景色突出显示呼号或网格. 呼号 和/或 网格必须用逗号隔开, 每个呼号后面必须有一个逗号.</p></body></html> - + Highlight orange: 突出显示橙色: - - <html><head/><body><p>Highlight callsigns or grids with blue background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - <html><head/><body><p>用蓝色背景色突出显示呼号或网格. 呼号 和/或 网格必须用逗号隔开, 每个呼号后面必须有一个逗号.</p></body></html> + <html><head/><body><p>用蓝色背景色突出显示呼号或网格. 呼号 和/或 网格必须用逗号隔开, 每个呼号后面必须有一个逗号.</p></body></html> - + Highlight blue: 突出显示蓝色: - + Days since last upload 自上次上传以来的天数 - + Select the audio CODEC to use for receiving. 选择要用于接收的音频信号. - + &Input: 输入(&I): - + Select the channel to use for receiving. 选择要用于接收的通道. - - + + Mono 单声道 - - + + Left 左声道 - - + + Right 右声道 - - + + Both 双声道 - + Select the audio channel used for transmission. Unless you have multiple radios connected on different channels; then you will usually want to select mono or @@ -9010,12 +11267,12 @@ both here. 双声道. - + Enable VHF and submode features 启用甚高频和子模式功能 - + Additional features 附加功能 @@ -9024,299 +11281,378 @@ both here. 更换频段后抹掉频段活动窗口 - + Highlight DX Grid in message 突出显示信息中的DX网格 - + Highlight DX Call in message 突出显示信息中的DX呼号 - + Clear DX Call after QSO 通联后清除DX呼号 - + Set Rx frequency to Tx frequency after QSO 通联后将Rx频率设置为Tx频率 - + <html><head/><body><p>Open the Astronomical Data window automatically when switching to Q65 or JT65 mode and Decode after EME delay is enabled, and close it when no longer needed.</p><p>Open the QSYMessage Creator automatically if the VHF Features are enabled and such QSY messages are applicable.</p></body></html> <html><head/><body><p>启用EME延迟后, 切换到Q65或JT65模式并解码时, 自动打开天文数据窗口, 并在不再需要时将其关闭.</p><p>如果启用了VHF功能并且此类QSY消息适用,则自动打开QSY信息创建器.</p></body></html> - + Auto-open/close Astronomical data window 自动打开/关闭 天文数据窗口 - + + <html><head/><body><p>Allow automatic Doppler tracking and split/Fake It/XIT to correct the transmit frequency while transmitting, including corrections of tens of kHz on microwave bands.</p><p>This option does not allow nominal dial or band changes while transmitting or tuning. Leave it unchecked if your rig cannot accept frequency-setting CAT commands while transmitting; WSJT-X will then make one midpoint Doppler correction before transmission starts.</p></body></html> + + + + + Allow Tx-frequency corrections while transmitting + + + + Tune watchdog 调谐监察器 - + + Tune watchdog timeout + + + + Tx watchdog: 发射监管计时器: - + + Tx watchdog timeout + + + + ID Inter&val: 时间间隔(&v): - + + CW ID interval + + + + <html><head/><body><p>Erase Band Activity and Rx frequency windows after band change.</p></body></html> <html><head/><body><p>频段改变后擦除频段活动和接收频率窗口.</p></body></html> - + Erase decodes after band change 波段改变后擦除解码 - + Clear DX Grid after QSO 通联后清除DX网格 - + Map Grid locator to U.S. State 将格网定位映射到美国各州 - + Align DXCC/distance/azimuth 对齐DXCC, 距离和方位 - + <html><head/><body><p>Increase or decrease the space between message text and DXCC.</p></body></html> <html><head/><body><p>增加或减少信息文本和DXCC之间的间距.</p></body></html> - + + DXCC alignment spacing + + + + + Distance and azimuth alignment spacing + + + + Less button coloring (restart required) 减少按钮颜色 (需要重新启动) - + + <html><head/><body><p>Download the latest libhamlib-4.dll file from Hamlib SourceForge snapshots. </p><p>Note: This function is only available on Windows.</p></body></html> + + + + Ou&tput: 输出(&t): - + + Output audio channel + + + + + Input audio channel + + + + <html><head/><body><p>Refresh audio device list.</p></body></html> <html><head/><body><p>刷新音频设备列表.</p></body></html> - + Refresh 刷新 - + <html><head/><body><p>Use TCI Audio when available.</p></body></html> <html><head/><body><p>使用TCI音频 (如果可用).</p></body></html> - + Use TCI Audio (restart required) 使用TCI音频 (需要重新启动) - + <html><head/><body><p>Rx audio level</p></body></html> <html><head/><body><p>接收音频音量</p></body></html> - + + TCI receive audio level + + + + Rx 接收 - + <html><head/><body><p>Sort audio device names alphabetically.</p></body></html> <html><head/><body><p>按字母顺序排列音频设备名称.</p></body></html> - + Sort alphabetically 按字母顺序排列 - + <html><head/><body><p>Hide the usually unusable ALSA CARD subdevices on Linux.</p></body></html> <html><head/><body><p>在 Linux 上隐藏通常无法使用的 ALSA 音效卡子设备.</p></body></html> - + Hide ALSA CARD subdevices (Linux only) 隐藏 ALSA 音效卡子设备 (仅 Linux) - - + + Save Directory 保存目录 - + Loc&ation: 目录位置(&a): - + Path to which .WAV files are saved. .WAV 文件被保存到哪条目录. - - + + TextLabel - + Click to select a different save directory for .WAV files. 单击选择不同的保存目录 .WAV 文件. - + S&elect 选择(&e) - - + + AzEl Directory AzEl 目录 - + Location: 位置: - + Select 选择 - + <html><head/><body><p>Enables additional line in azel.dat for Dpol parameter.</p></body></html> <html><head/><body><p>在azel.dat中为Dpol参数启用额外的行.</p></body></html> - + Enable extra line in azel.dat 为 azel.dat 启用额外的行 - + Power Memory By Band 按频段存储功率 - + Remember power settings by band 按频段功率记忆设置 - + Enable power memory during transmit 在传输过程中启用功率记忆 - + Transmit 发射 - + Enable power memory during tuning 在调谐期间启用功率记忆 - + Tune 调谐 - + Tx &Macros 自定义文字(&M) - + Canned free text messages setup 设置自定义文字 - + + New &macro: + + + + &Add 增加(&A) - + + Add Tx macro + + + + + Adds the entered message to the saved Tx macro list. + + + + + New Tx macro message + + + + + Enter a saved free-text message for the Tx5 dropdown. Free-text messages are limited to 13 characters including spaces. + + + + &Delete 删除(&D) - Drag and drop items to rearrange order Right click for item specific actions Click, SHIFT+Click and, CRTL+Click to select items - 拖放项目以重新排列顺序 + 拖放项目以重新排列顺序 右键单击项目特定操作 单击, SHIFT+单击 和, CRTL+单击 以选择项目 - + Reportin&g 报告(&g) - + Reporting and logging settings 设置日志和报告 - + Logging 记录日志 - + The program will pop up a partially completed Log QSO dialog when you send a 73 or free text message. 当您发送73或自定义文字时,程序将弹出一个部分完成的日志通联对话框. - + Promp&t me to log QSO 提示我记录通联日志(&t) - + <html><head/><body><p>Log 'ZZ00' as grid if the other station doesn't send you a grid.</p></body></html> <html><head/><body><p>如果另一个电台没有给你发送坐标, 记录 'ZZ00' 为坐标.</p></body></html> - + Fill missing grids with 'ZZ00' 用 'ZZ00' 填充缺失的网格 - + Op Call: 操作员呼号: - + Some logging programs will not accept the type of reports saved by this program. Check this option to save the sent and received reports in the @@ -9327,7 +11663,7 @@ comments field. 注释字段. - + d&B reports to comments 把d&B信号报告写入备注栏 @@ -9342,37 +11678,37 @@ and DX Grid fields when a 73 or free text message is sent. 日志记录后清除 &DX 呼号和DX Grid 栏位 - + <html><head/><body><p>Some logging programs will not accept WSJT-X mode names.</p></body></html> <html><head/><body><p>某些日志记录程序不接受 WSJT-X 模式名称.</p></body></html> - + Con&vert mode to RTTY 把日志记录转成&RTTY模式 - + <html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html> <html><head/><body><p>操作员的呼号, 如果与电台呼号不同.</p></body></html> - + <html><head/><body><p>Check to have QSOs logged automatically, when complete.</p></body></html> <html><head/><body><p>选择当完成通联后, 自动记录.</p></body></html> - + Show the separator line between periods with time stamp of the decode period. 用解码周期的时间戳显示周期之间的分隔线. - + Show blank line with time stamp 显示带有时间戳的空行 - + <html><head/><body><p>Tx until 73 is received when in MSK144 or Q65 mode. </p></body></html> <html><head/><body><p>在MSK144或Q65模式下, 接收到73之前的Tx. </p></body></html> @@ -9385,88 +11721,87 @@ and DX Grid fields when a 73 or free text message is sent. 自动打开/关闭 天文数据窗口 - + <html><head/><body><p>Turn the progress bar red while transmitting.</p></body></html> <html><head/><body><p>发射时将进度条变为红色.</p></body></html> - + Turn progress bar red while transmitting 发射时将进度条变为红色 - + <html><head/><body><p>Allow kHz frequency offset entry without 'k' suffix.</p></body></html> <html><head/><body><p>允许输入没有 'k' 后缀的kHz频率偏移.</p></body></html> - + kHz entry without k (restart required) kHz 输入没有 'k' (需要重启) - - + + Update Hamlib 更新 Hamlib - + 32-bit 32-位元 - + <html><head/><body><p>Revert the last Hamlib update. </p><p>Note: This function is only available on Windows.</p></body></html> <html><head/><body><p>还原最后 Hamlib 更新. </p><p>注意: 此功能仅在Windows上可用.</p></body></html> - + Revert Update 还原更新 - <html><head/><body><p>Download the latest libhamlib-4.dll file from https://n0nb.users.sourceforge.net/. </p><p>Note: This function is only available on Windows.</p></body></html> - <html><head/><body><p>从 https://n0nb.users.sourceforge.net/ 下载最新的libhamlib-4.dll文件. </p><p>注意: 此功能仅在Windows上可用.</p></body></html> + <html><head/><body><p>从 https://n0nb.users.sourceforge.net/ 下载最新的libhamlib-4.dll文件. </p><p>注意: 此功能仅在Windows上可用.</p></body></html> - + In use: 在使用: - + Backed up: 已备份: - + 64-bit 64-位元 - + Rig Data 无线电设备数据 - + <html><head/><body><p>Stop transmitting immediately when SWR exceeds 2.5.</p></body></html> <html><head/><body><p>当驻波比大于 2.5 时立即停止发射.</p></body></html> - + Halt Tx when SWR > 2.5 当驻波比大于 2.5 时停止发射 - + <html><head/><body><p>Read and display transmit PWR and SWR of your rig.</p></body></html> <html><head/><body><p>读取并显示你的无线电设备的发射 功率和驻波比.</p></body></html> - + Read and display PWR and SWR 读取并显示 功率和驻波比 @@ -9475,204 +11810,263 @@ and DX Grid fields when a 73 or free text message is sent. 日志自动记录 (仅限竞赛) - + Network Services 网络服务 - + <html><head/><body><p>The program can send your station details and all decoded signals with grid squares as spots to the http://pskreporter.info web site.</p><p>This is used for reverse beacon analysis which is very useful for assessing propagation and system performance.</p></body></html> <html><head/><body><p>程序可以将你的电台详细信息和所有解码信号以网格发送到http://pskreporter.info网站.</p><p>这用于反向信标分析, 这对于评估传播和系统性能非常有用.</p></body></html> - + Enable &PSK Reporter Spotting 启用&PSK Reporter Spotting - + <html><head/><body><p>Check this option if a reliable connection is needed</p><p>Most users do not need this, the default uses UDP which is more efficient. Only check this if you have evidence that UDP traffic from you to PSK Reporter is being lost.</p></body></html> <html><head/><body><p>选择此选项需要可靠的连接</p><p>大多数用户不需要这个, 默认使用UDP, 效率更高. 只有当你有证据表明从你到PSK Reporter的UDP流量丢失时, 才选择这个.</p></body></html> - + Use TCP/IP connection 使用TCP/IP连接 - + UDP Server UDP服务器 - + UDP Server: UDP服务器: - + <html><head/><body><p>Optional hostname of network service to receive decodes.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the broadcasting of UDP status updates.</p></body></html> <html><head/><body><p>接收解码的网络服务的可选主机名称.</p><p>格式:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">主机名称</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 地址</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4多点传送组地址</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 多点传送组地址</li></ul><p>清除此字段将禁用UDP状态更新的广播.</p></body></html> - + UDP Server port number: UDP服务器端口: - + <html><head/><body><p>With this enabled WSJT-X will accept certain requests back from a UDP server that receives decode messages.</p></body></html> <html><head/><body><p>启用此功能后,WSJT-X 将接受来自接收解码消息的 UDP 服务器的某些请求.</p></body></html> - + Accept UDP requests 接受UDP请求 - + <html><head/><body><p>Indicate acceptance of an incoming UDP request. The effect of this option varies depending on the operating system and window manager, its intent is to notify the acceptance of an incoming UDP request even if this application is minimized or hidden.</p></body></html> <html><head/><body><p>指示接受传入的 UDP 请求.此选项的效果因操作系统和窗口管理器而异,其目的是通知接受传入的 UDP 请求,即使此应用程序最小化或隐藏</p></body></html> - + Notify on accepted UDP request 接受UDP的请求时通知 - + <html><head/><body><p>Restore the window from minimized if an UDP request is accepted.</p></body></html> <html><head/><body><p>如果接受 UDP 请求,则从最小化还原窗口.</p></body></html> - + Accepted UDP request restores window 接受UDP请求还原窗口 - + Secondary UDP Server (deprecated) 辅助 UDP 服务器 (已弃用) - + <html><head/><body><p>When checked, WSJT-X will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html> <html><head/><body><p>选中后,WSJT-X 将以 ADIF 格式将记录的联系广播到配置的主机名和端口. </p></body></html> - + Enable logged contact ADIF broadcast 启用记录联系 ADIF 广播 - + Server name or IP address: 服务器名称或 IP 地址: - + <html><head/><body><p>Optional host name of N1MM Logger+ program to receive ADIF UDP broadcasts. This is usually 'localhost' or ip address 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable broadcasting of ADIF information via UDP.</p></body></html> <html><head/><body><p>N1MM Logger+ 程序的可选电脑主机, 用于接收 ADIF UDP 广播. 这通常是 'localhost' 或 IP地址 127.0.0.1</p><p>格式:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">主机名称</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 地址</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 多播组地址</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 多播组地址</li></ul><p>清除此字段将禁用通过 UDP 广播 ADIF 信息.</p></body></html> - + Server port number: 服务器端口号: - + <html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html> <html><head/><body><p>输入 WSJT-X 应用于 ADIF 日志信息的 UDP 广播的端口号. 对于 N1MM Logger+, 此值应为 2333. 如果为零, 将不会广播任何更新.</p></body></html> - + Frequencies 频率 - + Default frequencies and band specific station details setup 设置默认值频率和带宽点特定的无线电设备详细信息 - + <html><head/><body><p>See &quot;Frequency Calibration&quot; in the WSJT-X User Guide for details of how to determine these parameters for your radio.</p></body></html> <html><head/><body><p>阅读 &quot;频率校准&quot; 在 WSJT-X 用户指南中, 有关如何确定无线电的这些参数的详细信息.</p></body></html> - + Frequency Calibration 频率校准 - + Slope: 倾斜率: - + ppm - + Intercept: 拦截: - + Hz 赫兹 - + Working Frequencies 工作频率 - + + + Insert, delete, load, save, merge, or reset working frequencies. + + + + + Working frequencies actions + + + + + + + Actions... + + + + <html><head/><body><p>Right click to maintain the working frequencies list.</p></body></html> <html><head/><body><p>右键单击以保持工作频率列表.</p></body></html> - + Station Information 电台信息 - + + + Insert or delete station information rows. + + + + + Station information actions + + + + Items may be edited. Right click for insert and delete options. 项目可以编辑. 右键单击以插入和删除选项. - + Colors 颜色 - + Decode Highlightling 解码突出显示 - - Reset Highlighting to WSJT-X Improved default - 将高亮显示重置为 wsjt-x_improved 默认值 + + Change or reset colors for the selected highlighting rule. + + + + + Move the selected highlighting rule earlier in priority order. + - + + Move Up + + + + + Move the selected highlighting rule later in priority order. + + + + + Move Down + + + + + Reset Highlighting to Default 1 + + + + + Reset Highlighting to Default 2 + + + + <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> <html><head/><body><p>单击以再次扫描wsjtx_log.adi ADIF文件,获取以前工作过的信息</p></body></html> - + Rescan ADIF Log 重新扫描 ADIF 日志 - + <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> <html><head/><body><p>将上述所有突出显示项重置为默认值和优先级.</p></body></html> @@ -9681,122 +12075,121 @@ Right click for insert and delete options. 重置突出显示 - + <html><head/><body><p>Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.</p><p>Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.</p></body></html> <html><head/><body><p>使用复选框启用或禁用项目,并右键单击项目以更改或取消设置前景颜色, 背景颜色, 或将项目重置为默认值. 拖放项目以更改其优先级, 列表中较高的优先级较高.</p><p>请注意, 每个前景或背景颜色都可以设置或取消设置, 取消设置意味着它未为该项分配, 其类型和低优先级项可能适用.</p></body></html> - + <html><head/><body><p>Check to indicate new DXCC entities, grid squares, and callsigns per mode.</p></body></html> <html><head/><body><p>选择以显示每个模式新的 DXCC 实体, 网格和呼号.</p></body></html> - + Highlight by Mode 按模式突出显示 - + Include extra WAE entities 包括额外的 WAE 实体 - + Check to for grid highlighting to only apply to unworked grid fields 突出显示网格突出显示仅应用于未通联的网格字段 - + Only grid Fields sought 仅寻求网格字段 - + <html><head/><body><p>Controls for Logbook of the World user lookup.</p></body></html> <html><head/><body><p>控制 LoTW 用户查找日志.</p></body></html> - + Logbook of the World User Validation LoTW 已验证用户 - + Users CSV file URL: 用户 CSV 文件 网址: - + <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> <html><head/><body><p>ARRL LoTW 用户上次上传日期和时间数据文件的网址, 该文件用于突出显示已知将日志文件上载到 LoTW 的电台的解码.</p></body></html> - URL - 网址 + 网址 - + <html><head/><body><p>Push this button to fetch the latest LotW user's upload date and time data file.</p></body></html> <html><head/><body><p>按下此按钮即可获取最新的 LoTW 用户的上传日期和时间数据文件.</p></body></html> - + Fetch Now 立即获取 - + Age of last upload less than: 上次上传的日期小于: - + <html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html> <html><head/><body><p>调整此旋转框以设置 LoTW 用户最后一个上传日期的日期阈值, 该日期被接受为当前 LoTW 用户.</p></body></html> - + days 天 - + Advanced 高级设置 - + <html><head/><body><p>User-selectable parameters for JT65 VHF/UHF/Microwave decoding.</p></body></html> <html><head/><body><p>用户可选参数用于 JT65 VHF/UHF/Microwave 的解码.</p></body></html> - + JT65 VHF/UHF/Microwave decoding parameters JT65 VHF/UHF/Microwave 解码参数 - + Random erasure patterns: 随机擦除模式: - + <html><head/><body><p>Maximum number of erasure patterns for stochastic soft-decision Reed Solomon decoder is 10^(n/2).</p></body></html> <html><head/><body><p>随机软判决 Reed Solomon 解码器的最大擦除模式数为 10^(n/2).</p></body></html> - + Aggressive decoding level: 主动解码级别: - + <html><head/><body><p>Higher levels will increase the probability of decoding, but will also increase probability of a false decode.</p></body></html> <html><head/><body><p>较高的水平会增加解码的概率, 但也会增加错误解码的概率.</p></body></html> - + Two-pass decoding 通过二次解码 @@ -9805,120 +12198,111 @@ Right click for insert and delete options. 特殊操作活动: 产生FT4, FT8 和 MSK144 信息 - + NA VHF - + <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> <html><head/><body><p>FT8 DX远征模式呼叫DX的猎犬操作员.</p></body></html> - - + + Hound 猎犬 - + <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> <html><head/><body><p>北美 VHF/UHF/Microwave 竞赛和其他需要交换的 4 个字符网格定位器的竞赛.</p></body></html> - + NA VHF Contest NA VHF 竞赛 - + <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> <html><head/><body><p>FT8 DX远征模式: 狐狸 (DX远征) 操作员.</p></body></html> - - + + Fox 狐狸 - + <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> <html><head/><body><p>欧洲 VHF+ 竞赛需要信号报告, 序列号和 6 个字符定位.</p></body></html> - - + + EU VHF Contest - - R T T Y Roundup - - - - + CTY File Download CTY 文件下载 - + CTY File Version: CTY 文件版本: - + Download Latest CTY.dat 下载最新的 CTY.dat - RTTY Roundup exchange - RTTY Roundup 交换 + RTTY Roundup 交换 <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> <html><head/><body><p>FT Roundup 和类似的竞赛. 交换是美国州, 加拿大省或 &quot;DX&quot;.</p></body></html> - + NJ - - + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> <html><head/><body><p>ARRL Field Day 交换: 发射机数量, 类別, 和 ARRL/RAC 部分或 &quot;DX&quot;.</p></body></html> - + Special operating activity 特殊操作活动 - - A R R L Field Day - - - - + + ARRL Field Day - + + Field Day exchange Field Day 交换 - + FD Exch: FD 交换: - + 6A SNJ @@ -9927,309 +12311,517 @@ Right click for insert and delete options. <html><head/><body><p>用一个单独的竞赛名称呼叫, 而不是CQ TEST, RU, 或 WW. </p></body></html> - + <html><head/><body><p>ARRL International Digital Contest</p></body></html> - + ARRL Digi Contest - + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> <html><head/><body><p>World-Wide Digi-mode 竞赛</p></body></html> - - WW Digital Contest - - - - + + WW Digi Contest - + <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> <html><head/><body><p>交换4字符的定位而不是信号报告. 为DX操作员提供 q3级 灵敏度. 对6m EME DX遠征特别有用.</p></body></html> - + Q65 Pileup Q65 堆叠 - + Miscellaneous 杂项 - + Degrade S/N of .wav file: 降低信噪比的 .wav文件: - - + + For offline sensitivity tests 用于离线灵敏度测试 - - + + dB 分贝 - + <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> <html><head/><body><p>在波段活动窗口中显示OTP信息.</p></body></html> - + Show OTP messages 显示OTP信息 - + OTP URL: OTP 网址: - + <html><head/><body><p>URL used to verify OTP codes.</p></body></html> <html><head/><body><p>用于验证 OTP 代码的网址.</p></body></html> - + https://www.9dx.cc https://www.9dx.cc - + <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> <html><head/><body><p>点击以启用狐狸验证 OTP 方法. 需要网络连接.</p></body></html> - + OTP OTP - + <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> <html><head/><body><p>狐狸生成 OTP 密码的密钥.</p></body></html> - + M2ZUU5CW6EVOY2HU M2ZUU5CW6EVOY2HU - + Interval 间隔 - + <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> <html><head/><body><p>发送OTP信息的时间间隔. 选择1为每个信息签署.</p></body></html> - + Receiver bandwidth: 接收器带宽: - + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with orange background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with blue background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + LotW users CSV URL + + + + + + <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> + + + + + Cloudlog or Wavelog + + + + + + Upload QSOs to Cloudlog or Wavelog + + + + + + <html><head/><body><p>API URL for Cloudlog or Wavelog.</p></body></html> + + + + + + <html><head/><body><p>Your API key.</p></body></html> + + + + + + <html><head/><body><p>Your Cloudlog or Wavelog station profile.</p></body></html> + + + + + Station profile: + + + + + <html><head/><body><p>Check the Cloudlog or Wavelog connection, API key, station profile, and upload path where safe.</p><p>The button will turn green if the connection can upload QSOs, orange if the key is valid but read-only, and red if the configuration is unusable.</p></body></html> + + + + + Check Connection + + + + Hz 赫兹 - + Tx delay: 发射延迟: - + Minimum delay between assertion of PTT and start of Tx audio. PTT 验证与发射音频启动之间的最小延迟. - + s 秒 - - + + Tone spacing 音调间距 - + <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> <html><head/><body><p>生成具有正常音调间距两倍的发射音频. 适用于在产生射频之前使用除以 2 的特殊 LF/MF 发射器.</p></body></html> - + + 2x tone spacing + + + + x 2 - + <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> <html><head/><body><p>具有正常音调间距四倍的发射音频. 适用于在产生射频之前使用除以 4 的特殊 LF/MF 发射器.</p></body></html> - + + 4x tone spacing + + + + x 4 - - + + Waterfall spectra 瀑布频谱 - + Low sidelobes 低侧边 - + Most sensitive 最敏感 - + + + <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> + + + + + eQSL.cc + + + + + + Upload QSOs to eQSL.cc + + + + + + <html><head/><body><p>Your username.</p></body></html> + + + + + Username: + + + + + + <html><head/><body><p>Your logon password.</p></body></html> + + + + + Password: + + + + + + <html><head/><body><p>Your QTH nickname, if you have more than one QTH.</p></body></html> + + + + + QTH: + + + + + + Enable special operating activity + + + + + Enable OTP verification + + + + + + OTP key + + + + + + OTP interval + + + + + + OTP URL + + + + + + FT Roundup exchange + + + + <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> <html><head/><body><p>用一个单独的竞赛名称称呼叫, 而不是CQ TEST, RU, or WW (例如 CQ PACC).</p></body></html> - - + + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> <html><head/><body><p>FT Roundup 和类似的竞赛. Exchange 是美国州, 加拿大省或 &quot;DX&quot;.</p></body></html> - + + FT Roundup messages - + FT RU Exch: - + CQ with individual contest name CQ 单独竞赛名称 - + + + Contest name + + + + Contest name: 竞赛名称: - + + NOTES + + + + + "Wanted callsigns, grids, prefixes and directional calls" uses the entries from "Highlight orange" and "Highlight blue". + + + + + <html><head/><body><p>Wanted callsigns, grids, prefixes and directional calls. This alert category uses the entries from &quot;Highlight orange&quot; and &quot;Highlight blue&quot;.</p></body></html> + + + + + Wanted callsigns, grids, prefixes and directional calls + + + + + IMPORTANT + + + + + Voices: + + + + + default + + + + + <html><head/><body><p>Test the alert sounds.</p></body></html> + + + + + Test + + + + Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. 线上的警报类别要求选中常规选项卡上的 "显示DXCC, 网格和曾通联状态" 框. - THIS FEATURE IS FOR EXPERIENCED USERS ONLY - 此功能仅供有经验的用户使用 + 此功能仅供有经验的用户使用 - + Ensure that you have made meaningful settings on the Colors tab, so that you see which message triggered the alert. 请确保您在 "颜色" 选项卡上进行了有意义的设置, 以便您可以看到哪条消息触发了警报. - + Ensure that your rig is NOT connected via "Default Device". 确保您的无线电设备不是通过 "默认音频设备" 连接. - + Message received 信息已接收 - + This requirement is fulfilled when your rig is connected via USB audio. 当您的无线电设备通过USB音频连接时,即已满足此要求. - IMPORTANT NOTES - 重要注意事项 + 重要注意事项 - + Filters 过滤 - + Hide messages containing the following callsigns or keywords: 隐藏包含以下呼号或关键字的消息: - + Show only messages containing the following callsigns or keywords: 仅显示包含以下呼号或关键字的消息: - + http://lotw.arrl.org/lotw-user-activity.csv - + CALL3 File Download CALL3 文件下载 - + CALL3 File Version: CALL3 文件版本: - + Dowload latest CALL3.TXT file. 下载最新的 CALL3.TXT 文件. - + Download CALL3.TXT for terrestrial use 下载 CALL3.TXT 供 IARU 分区使用 - + Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. 为EME下载最新 CALL3.TXT 文件. 该版本适用于 JT65 深度搜索. - + Download CALL3.TXT for EME 下载 CALL3.TXT 供 EME 使用 - + <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> <html><head/><body><p>启用/停用 NCCC Sprint FT4短信息协议.</p></body></html> - + NCCC Sprint @@ -10242,47 +12834,43 @@ Right click for insert and delete options. 为缺少的网格自动填充 'ZZ00' - Enable Cloudlog Features - 启用Cloudlog功能 + 启用Cloudlog功能 - + API URL: API网址: - + API Key: API密匙: - Station ID: - 电台 ID: + 电台 ID: - <html><head/><body><p>Test the Cloudlog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> - <html><head/><body><p>测试 API密匙.</p><p>如果API密钥是可写的, 该按钮将变为绿色. 如果API密钥是只读的, 它将变为橙色. 如果API密钥无效, 它将变成红色.</p></body></html> + <html><head/><body><p>测试 API密匙.</p><p>如果API密钥是可写的, 该按钮将变为绿色. 如果API密钥是只读的, 它将变为橙色. 如果API密钥无效, 它将变成红色.</p></body></html> - Test API Key - 测试 API密匙 + 测试 API密匙 - + <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> <html><head/><body><p>勾选此框以发送 (狐狸) 或接收 (猎犬) 超级狐狸 波形.</p></body></html> - + SuperFox mode 超级狐狸模式 - + Key: 密钥: @@ -10291,32 +12879,32 @@ Right click for insert and delete options. <html><head/><body><p>超级狐狸操作员必须输入有效的密钥才能启用发送.</p></body></html> - + GUI tweaks for high-resolution monitors 针对高分辨率显示器的用户介面调整 - + <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> <html><head/><body><p>高DPI 缩放 允许在 4K 监视器上显示更大比例更正确的控件 (如果操作系统支持).</p></body></html> - + HighDPI scaling (restart required) 高DPI缩放 (需要重启) - + <html><head/><body><p>Increased height of some control elements.</p></body></html> <html><head/><body><p>增加了一些控件元素的高度.</p></body></html> - + Increased height of the tab widget (restart required) 增加了选项卡小部件的高度 (需要重新启动) - + Alerts 警报 @@ -10325,104 +12913,104 @@ Right click for insert and delete options. 确保您的无线电设备不是通过 "默认音频设备" 连接的 !!! - + Audio Alerts 音频警报 - - + + New Grid 新网格 - + My Call in message 我呼号在信息内 - + My Call 我的呼号 - - + + New Continent 新大洲 - - + + New ITU Zone 新ITU区 - - + + New CQ Zone 新CQ区 - - + + New DXCC 新DXCC - - + + New DXCC on Band 新DXCC 波段 - - + + New ITU Zone on Band 新ITU 区 波段 - - + + New Continent on Band 新大洲 波段 - - + + New Grid on Band 新网格 波段 - - + + New CQ Zone on Band 新CQ区 波段 - - + + DX Call or DX Grid in message DX呼号或DX网格在信息内 - + Toggle Audio Alerts on/off. Alerts will be played on "DefaultAudioDevice". DON'T ENABLE AUDIO ALERTS WHEN YOUR RIG IS CONNECTED VIA THIS SOUNDCARD !!! 切換 启用/停用 音频警报. 警报将在 "默认音频设备" 上播放. 当您的无线电设备通过此声卡连接时, 不要启用音频警报 !!! - + Enable Audio Alerts 启用 音频警报 - - + + CQ in message CQ 信息 - + Use of this feature requires that your computer is equipped with two sound cards. 使用此功能您的计算机需要配备两个声卡. @@ -10431,7 +13019,7 @@ Right click for insert and delete options. 当您的无线电设备通过USB音频 (FT-991, IC-7300, 等) 连接时, 此要求即已满足. - + Audio Alerts will be played on the default audio device (usually the loudspeaker of your PC). 音频警报将在默认的音频设备 (通常是电脑的扬声器) 上播放. @@ -10444,67 +13032,67 @@ Right click for insert and delete options. 重要提示: 仅当您的无线电设备没有通过 "默认音频设备" 连接时才启用音频警报!!! - + Always pass messages with the following keywords: 总是通过带有以下关键字的讯息: - + Filters for the Band Activity window 波段活动窗口的过滤器 - + Territories 1-4 for the Hide checkboxes in the View menu 查看菜单中隐藏复选框的区域1-4 - + <html><head/><body><p>Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed).</p></body></html> <html><head/><body><p>使用过滤器 等待和突袭, CQ:第一, 等. 仅 (仍显示所有消息).</p></body></html> - + Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed) 使用过滤器 等待和突袭, CQ:第一, 等. 仅 (仍显示所有消息) - + <html><head/><body><p>Apply filters only to the callsigns of the calling stations. Usually the second word of the messages is analyzed, for directional calls the third word.</p></body></html> <html><head/><body><p>只对呼叫电台的呼号使用过滤. 通常分析消息的第二个字, 对于定向呼叫, 分析第三个字.</p></body></html> - + Apply filters only to the callsigns of the calling stations 应用过滤仅对呼叫电台的呼号 - + Blacklist 黑名单 - + Whitelist 白名单 - + Always Pass 总是通过 - + <html><head/><body><p>Use “worked today and yesterday” instead of “worked today” for the 3 related Quick Filters.</p></body></html> <html><head/><body><p>对于3个相关的快速筛选, 请使用 "今天和昨天曾通联" 而不是 "今天曾通联".</p></body></html> - + Quick Filters: Hide/Ignore/Highlight "worked today and yesterday" instead of "worked today" (UTC) 快速筛选:隐藏/忽略/突出显示 "今天和昨天曾通联" 而不是 "今天曾通联" (UTC) - + <html><head/><body><p>Discard (Cancel) or apply (OK) configuration changes including</p><p>resetting the radio interface and applying any soundcard changes</p></body></html> <html><head/><body><p>放弃 (取消) 或应用 (确定) 配置更改, 包括</p><p>重置无线电接口并应用任何声卡更改</p></body></html> @@ -10512,53 +13100,114 @@ Right click for insert and delete options. main - + + Lock file: %1 + + + + + Owner process: %1 + + + + + Owner application: %1 + + + + + Owner host: %1 + + + + + Owner information is not available. + + + + + Remove error: %1 + + + + + Another instance may be running + + + + + WSJT-X could not lock its temporary instance file. + +If another WSJT-X window is still running, choose No. +Use a unique rig name to run more than one instance. + +If WSJT-X crashed or will not restart, choose Remove Lock File. +Choose Retry after closing the other instance. + + + + + Remove Lock File + + + + + Unable to remove stale lock file + + + + + Close any running WSJT-X instance or remove the lock file manually after confirming WSJT-X is not running. + + + + Failed to create a temporary directory 无法创建临时目录 - - + + Path: "%1" 目录: "%1" - + Failed to create a usable temporary directory 无法创建可用的临时目录 - + Another application may be locking the directory 另一个应用程序可能正在锁定目录 - + Failed to create data directory 无法创建数据目录 - + path: "%1" 目录: "%1" - + Shared memory error 共享内存错误 - + Unable to create shared memory segment 无法创建共享内存段 - + Sub-process error 子进程错误 - + Failed to close orphaned jt9 process 无法关闭遗留的jt9进程 diff --git a/translations/wsjtx_zh_TW.ts b/translations/wsjtx_zh_TW.ts index 5e1328c3..3ecfa126 100644 --- a/translations/wsjtx_zh_TW.ts +++ b/translations/wsjtx_zh_TW.ts @@ -68,6 +68,11 @@ Max Age 最長時間 + + + <html><head/><body><p>Click on a line to call that station. </p><p>When using QMAP, single click to transfer QSO data and sked frequency to WSJT-X, and double click to call that station.</p></body></html> + + Score: @@ -104,137 +109,189 @@ <html><head/><body><p>過去一小時內的波段變更次數.</p></body></html> - <html><head/><body><p>Click on a line to call that station.</p></body></html> - <html><head/><body><p>按一下一條線呼叫該電臺.</p></body></html> + <html><head/><body><p>按一下一條線呼叫該電臺.</p></body></html> Active Stations 活動電臺 + + + Wanted only + + + + + Message + 訊息 + + + + My call only + + Astro - - + + Doppler tracking 多普勒追蹤 - + <html><head/><body><p>One station does all Doppler shift correction, their QSO partner receives and transmits on the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>一個站執行所有多普勒換檔校正, 他們的通聯合作夥伴接收和傳輸 sked 頻率.</p><p>如果無線電設備在傳輸單校正時不接受 CAT QSY 命令則在整個傳輸期間應用.</p></body></html> - + Full Doppler to DX Grid 全多普勒到 DX 網格 - + <html><head/><body><p>Transmit takes place on sked frequency and receive frequency is corrected for own echoes. </p><p>This mode can be used for calling CQ, or when using Echo mode.</p></body></html> <html><head/><body><p>傳輸以 sked 頻率進行, 接收頻率被校正為自己的 Echo. </p><p>此模式可用於呼叫 CQ 或使用 Echo 模式時.</p></body></html> - + Own Echo 自己的 Echo - + <html><head/><body><p>Both stations correct for Doppler shift such that they would be heard on the moon at the sked frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p><p>Use this option also for Echo mode.</p></body></html> <html><head/><body><p>兩個站都對多普勒移位進行校正, 這樣它們就會在月球上以sked頻率聽到.</p><p>如果無線電設備在傳輸單校正時不接受 CAT QSY 命令, 則在整個傳輸期間應用.</p><p>對於 Echo 模式也使用此選項</p></body></html> - + Constant frequency on Moon 月球上的恆定頻率 - + <html><head/><body><p>DX station announces their TX Freq, which is entered as the Sked Freq. Correction applied to RX and TX so you appear on the DX's station's own echo Freq.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>DX電臺宣佈其發送頻率, 這是輸入作為Sked頻率修正應用於接收和發送, 所以你出現在DX電臺自己的 Echo 頻率.</p><p>如果無線電設備在傳輸單個校正時不接受 CAT QSY 命令則在整個傳輸期間應用.</p></body></html> - + On DX Echo 在 DX Echo - + <html><head/><body><p>Tune radio manually and select this mode to put your echo on the same frequency.</p><p>If the rig does not accept CAT QSY commands while transmitting a single correction is applied for the whole transmit period.</p></body></html> <html><head/><body><p>手動調諧無線電設備並選擇此模式, 將 Echo 置於相同頻率.</p><p>如果無線電設備在傳輸單個校正時不接受 CAT QSY 命令則在整個傳輸期間應用.</p></body></html> - + Call DX 呼叫 DX - + <html><head/><body><p>No Doppler shift correction is applied. This may be used when the QSO partner does full Doppler correction to your grid square.</p></body></html> <html><head/><body><p>未應用多普勒換檔校正. 當通聯合作夥伴對網格方進行完全多普勒校正時可能會使用.</p></body></html> - + None 無 - + Sked frequency Sked 頻率 - - + + 0 - + + kHz + + + + + Set kHz + + + + + <html><head/><body><p>Tx shift relative to Rx sked frequency</p></body></html> + + + + + MHz + + + + + Tx Shift + + + + + Enable + + + + + Dither + + + + + Ctl-Lock Sked Freq + + + + Rx: 接收: - + Tx: 發送: - <html><head/><body><p>Press and hold the CTRL key to adjust the sked frequency manually with the rig's VFO dial or enter frequency directly into the band entry field on the main window.</p></body></html> - <html><head/><body><p>按住 CTRL 鍵使用手動 sked 頻率與無線電設備 VFO 將頻率直接撥入主視窗中的頻段輸入欄位.</p></body></html> + <html><head/><body><p>按住 CTRL 鍵使用手動 sked 頻率與無線電設備 VFO 將頻率直接撥入主視窗中的頻段輸入欄位.</p></body></html> - + Echo Mode Echo 模式 - + Hz 赫茲 - + RIT - Dither - 抖動 + 抖動 - + Astro Data 天體資料 - + Astronomical Data 天文資料 @@ -354,6 +411,166 @@ 呼號 + + Cloudlog + + + + QSO could not be sent to Cloudlog. + + + + + + QSO upload was rejected by Cloudlog. + + + + + HTTP status %1. Response was not JSON. + + + + + Cloudlog returned an unexpected upload response. + + + + + Cloudlog reported upload status: %1 + + + + + HTTP status %1. + + + + + Cloudlog::impl + + + Enter a Cloudlog or Wavelog URL. + + + + + The connection check needs a base URL before it can contact the API. + + + + + Cloudlog or Wavelog authentication endpoint was not found. + + + + + Tried /api/check_auth, /index.php/api/check_auth, and /index.php/api/auth. + + + + + API key is valid but read-only. + + + + + Generate a read/write API key before enabling QSO uploads. + + + + + API key is invalid. + + + + + Authentication response was not usable. + + + + + Station profile response was not JSON. + + + + + Configured station profile was not found. + + + + + No station profiles were returned by the server. + + + + + Available station profiles: %1 + + + + + Wavelog dry-run QSO endpoint was not found. + + + + + Tried /api/qso/true and /index.php/api/qso/true after Wavelog was identified. + + + + + Dry-run upload response was not usable. + + + + + + Connection check passed. + + + + + Writable API key, station profile, and dry-run QSO upload were validated. + + + + + Dry-run QSO upload was rejected. + + + + + + The QSO dry-run upload was rejected. + + + + + Dry-run QSO upload returned an unexpected response. + + + + + Writable API key and station profile were validated. No safe dry-run QSO endpoint was identified, so no test QSO was uploaded. + + + + + Network error while checking Cloudlog or Wavelog. + + + + + Cloudlog Error! + + + + + Reason: %1 + + + ColorHighlighting @@ -460,90 +677,342 @@ Configuration::impl - - - + + + &Delete 刪除(&D) - - + + &Insert ... 插入(&I) ... - + + Wanted territory %1 + + + + + Blacklist keyword %1 + + + + + Whitelist keyword %1 + + + + + Always pass keyword %1 + + + + + CAT control port + + + + + CAT baud rate + + + + + Default CAT data bits + + + + + Seven CAT data bits + + + + + Eight CAT data bits + + + + + Default CAT stop bits + + + + + One CAT stop bit + + + + + Two CAT stop bits + + + + + Default CAT handshake + + + + + No CAT handshake + + + + + XON/XOFF CAT handshake + + + + + Hardware CAT handshake + + + + + Force DTR control line + + + + + Force RTS control line + + + + + VOX PTT method + + + + + DTR PTT method + + + + + CAT PTT method + + + + + RTS PTT method + + + + + PTT control port + + + + + Rear or data transmit audio source + + + + + Front or mic transmit audio source + + + + + No radio mode control + + + + + USB radio mode + + + + + Data or packet radio mode + + + + + No split operation + + + + + Rig split operation + + + + + Fake It split operation + + + + + CAT poll interval + + + + + Frequency calibration slope + + + + + Frequency calibration intercept + + + + + Working frequencies table + + + + + Station information table + + + + + Decode highlighting rules + + + + + Highlighting rules and priorities for decoded messages. + + + + + Decode highlighting actions + + + + + Change or reset colors for the selected highlighting rule. + + + + + Move selected highlighting rule up + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move selected highlighting rule down + + + + + Move the selected highlighting rule later in priority order. + + + + + Orange highlight callsigns and grids + + + + + Blue highlight callsigns and grids + + + + Failed to create save directory 無法建立儲存目錄 - + path: "%1% 路徑: "%1% - + Failed to create samples directory 無法建立範例目錄 - + path: "%1" 路徑: "%1" - + + Reset all decode highlighting and priorities to Default 1 values + + + + + Reset all decode highlighting and priorities to Default 2 values + + + API key OK - API密匙確認 + API密匙確認 - API key read-only - API密匙 唯讀 + API密匙 唯讀 - API key invalid - API密匙 無效 + API密匙 無效 - + &Load ... 載入(&L)... - + &Save as ... 另存為(&S) ... - + &Merge ... 合併(&M) ... - + &Reset 重置(&R) - + Serial Port: 串口: - + Serial port used for CAT control 用於CAT控制的序列埠 - + + TCI Server: + + + + + Optional hostname and port of TCI service. +Leave blank for a sensible default on this machine. +Formats: + hostname:port + IPv4-address:port + [IPv6-address]:port + + + + Network Server: 網路伺服器: - + Optional hostname and port of network service. Leave blank for a sensible default on this machine. Formats: @@ -558,12 +1027,12 @@ Formats: [IPv6-地址]:埠號 - + USB Device: USB設備: - + Optional device identification. Leave blank for a sensible default for the rig. Format: @@ -574,87 +1043,85 @@ Format: [VID[:PID[:供應商[:產品]]]] - - + + Invalid audio input device 無效的音頻輸入設備 - + Invalid audio output device 無效的音頻輸出設備 - + Invalid PTT method 無效的PTT方法 - + Invalid PTT port 無效的PTT埠號 - - + + Invalid Contest Exchange 無效的競賽交換數據 - + You must input a valid ARRL Field Day exchange 您必須輸入有效的 ARRL Field Day交換數據 - + You must input a valid ARRL RTTY Roundup exchange 您必須輸入有效的 ARRL RTTY Roundup 交換數據 - + Pending DNS lookup, please try again later 等待域名系統查找, 請稍後再試 - - + + Reset Decode Highlighting 重置解碼突出顯示 - - Reset all decode highlighting and priorities to default values - 將所有解碼突出顯示和優先順序重置為預設值 + 將所有解碼突出顯示和優先順序重置為預設值 - + Error Loading CTY.DAT 載入 CTY.DAT 錯誤 - + Error Loading CALL3.TXT file 載入 CALL3.TXT 錯誤 - + WSJT-X Decoded Text Font Chooser WSJT-X 解碼文本字型選擇 - - + + Hamlib update only available on Windows. Hamlib更新僅在Windows上可用. - + Error Loading libhamlib-4.dll 載入 libhamlib-4.dll 錯誤 - + Hamlib Update successful New Hamlib will be used after restart @@ -663,7 +1130,7 @@ New Hamlib will be used after restart 重新啟動後將使用新的Hamlib - + Hamlib successfully reverted Reverted Hamlib will be used after restart @@ -672,131 +1139,131 @@ Reverted Hamlib will be used after restart 重新啟動後將使用恢復的 Hamlib - + No Hamlib update found that could be reverted 未找到可以恢復的Hamlib更新 - + Error in network address 網絡IP錯誤 - + UDP server DNS lookup failed UDP 伺服器 DNS 尋找失敗 - + MAC-ambiguous multicast groups addresses not supported 不支援MAC不明確的多播組地址 - + Load Working Frequencies 載入工作頻率 - - - + + + Frequency files (*.qrg *.qrg.json);;All files (*.*) 頻率檔案 (*.qrg);;所有檔案 (*.*) - + Replace Working Frequencies 替換工作頻率 - + Are you sure you want to discard your current working frequencies and replace them with the loaded ones? 是否確實要放棄當前工作頻率, 並將其替換為載入的頻率? - + Merge Working Frequencies 合併工作頻率 - + Error reading frequency file 讀取頻率檔案錯誤 - - - + + + Not a valid frequencies file 不是有效的頻率檔案 - + Incorrect file magic 不正確的檔案內容 - + Version is too new 版本太新 - + Contents corrupt 內容已損壞 - + Save Working Frequencies 儲存工作頻率 - + Only Save Selected Working Frequencies 只儲存選取的工作頻率 - + Are you sure you want to save only the working frequencies that are currently selected? Click No to save all. 是否確定要只儲存目前選擇的工作頻率? 按一下 否 可儲存所有. - + Reset Working Frequencies 重置工作頻率 - + Are you sure you want to discard your current working frequencies and replace them with default ones? 您確定要放棄您當前的工作頻率並用預設值頻率替換它們嗎? - + Save Directory 儲存目錄 - + AzEl Directory AzEl 目錄 - + Rig control error 無線電設備控制錯誤 - + Failed to open connection to rig 無法開啟無線電設備的連接 - + Rig failure 無線電設備故障 - + Not found audio device missing 未找到音訊設備 @@ -827,68 +1294,74 @@ Reverted Hamlib will be used after restart DX Lab Suite Commander 沒有測試正確響應輪詢發送狀態: - DX Lab Suite Commander rig did not respond to PTT: - DX Lab Suite Commander 未響應無線電設備發送PTT: + DX Lab Suite Commander 未響應無線電設備發送PTT: + + + + Transceiver did not respond to PTT On/Off quickly enough; +reduce DX Lab Suite Commander's 'Command Interval' setting +or contact DXLab support at DXLab@groups.io. + - + DX Lab Suite Commander didn't respond correctly polling frequency: DX Lab Suite Commander 沒有正確響應輪詢頻率: - + DX Lab Suite Commander didn't respond correctly polling TX frequency: DX Lab Suite Commander 沒有正確響應輪詢發送頻率: - + DX Lab Suite Commander sent an unrecognised split state: DX Lab Suite Commander 發送了一個無法識別的異頻狀態: - + DX Lab Suite Commander didn't respond correctly polling split status: DX Lab Suite Commander 沒有正確響應輪詢異頻狀態: - + DX Lab Suite Commander sent an unrecognised mode: " DX Lab Suite Commander 發送了一個無法識別的模式: " - + DX Lab Suite Commander didn't respond correctly polling mode: DX Lab Suite Commander 沒有正確響應輪詢模式: - + DX Lab Suite Commander send command failed DX Lab Suite Commander 發送命令失敗 - + DX Lab Suite Commander send command failed "%1": %2 DX Lab Suite Commander 發送命令失敗 "%1": %2 - + DX Lab Suite Commander send command "%1" read reply failed: %2 DX Lab Suite Commander 發送命令 "%1" 讀取回復失敗: %2 - + DX Lab Suite Commander retries exhausted sending command "%1" DX Lab Suite Commander 發送命令重試失敗 "%1" - + DX Lab Suite Commander sent an unrecognized frequency DX Lab Suite Commander 發送了無法識別的頻率 @@ -901,32 +1374,32 @@ Reverted Hamlib will be used after restart 字型顏色(&F) ... - + Choose %1 Foreground Color 選擇 %1 字型顏色 - + &Unset foreground color 清除字型顏色(&U) - + &Background color ... 底色(&B) ... - + Choose %1 Background Color 選擇 %1 底色 - + U&nset background color 清除底色(&n) - + &Reset this item to defaults 將此項重置為預設值(&R) @@ -1014,17 +1487,17 @@ Reverted Hamlib will be used after restart LoTW用戶 - + f/g unset 字型顏色未設定 - + b/g unset 背景顏色未設定 - + Highlight Type 突出顯示類型 @@ -1032,41 +1505,56 @@ Reverted Hamlib will be used after restart Designer - + &Delete 刪除(&D) - + &Insert ... 插入(&I) ... - + Insert &after ... 插入之後(&a)... - + Import Palette 導入主題 - - + + Palettes (*.pal) 調色板 (*.pal) + Import Palette Failed + + + + Export Palette 匯出調色板 + + + Export Palette Failed + + + + + Error writing waterfall palette file "%1": %2. + 讀取瀑布調色板檔案時錯誤 "%1": %2. + Dialog - + Gray time: 灰線時間: @@ -1169,16 +1657,31 @@ Error: %2 - %3 DisplayText - + &Erase 清除(&E) + + + Return to live activity + + + + + Return to the live activity position + + + + + Live activity is paused while earlier entries are visible. + + EchoGraph - + Echo Graph Echo 圖 @@ -1251,7 +1754,7 @@ Error: %2 - %3 EmulateSplitTransceiver - + Emulated split mode requires rig to be in simplex mode 模擬異頻模式要求無線電設備處於單工模式 @@ -1338,12 +1841,12 @@ Error: %2 - %3 ExistingNameDialog - + Configuration to Clone From 從複製中的設定 - + &Source Configuration Name: 來源設定名稱(&S): @@ -1481,7 +1984,7 @@ Error: %2 - %3 FastGraph - + Fast Graph 快速圖 @@ -1512,65 +2015,237 @@ Error: %2 - %3 - FoxLog::impl + FileDownload - - Date & Time(UTC) - 日期與時間(UTC) + + Network Error - SSL/TLS support not installed, cannot fetch: +'%1' + - - Call - 呼號 + + Network Error - Too many redirects: +'%1' + - - Grid - 網格 + + Network Error: +%1 + + + + FixtureAudioInput - - Sent - 發出 + + Synthetic audio input has no detector sink. + - - Rcvd - 接收 + + Synthetic FT8 audio input requires a downsample factor of 1 or 4. + - - Band - 波段 + + Synthetic JTTY audio input requires a downsample factor of 1 or 4. + - - - FoxLogWindow - - Fox Log - 狐狸日誌 + + Synthetic audio input requires the mono input channel. + - - <html><head/><body><p>Right-click here for available actions.</p></body></html> - <html><head/><body><p>按右鍵此處查看可用操作.</p></body></html> + + Unable to open synthetic audio fixture %1: %2 + - - Callers: - 呼叫者: + + Synthetic audio fixture must be mono, signed 16-bit little-endian PCM. + - - - - N - + + Synthetic audio fixture must be %1 Hz for downsample factor %2; found %3 Hz. + - - In progress: + + Synthetic FT8 audio fixture must contain exactly %1 frames; found %2. + + + + + Synthetic JTTY audio fixture must contain complete PCM frames. + + + + + Unable to read all PCM data from synthetic audio fixture. + + + + + Synthetic audio input does not yet support big-endian hosts. + + + + + Unable to initialize the detector for synthetic audio input. + + + + + Synthetic audio fixture ready + + + + + Synthetic audio input suspended + + + + + Synthetic audio input receiving + + + + + Detector accepted %1 of %2 synthetic PCM bytes. + + + + + Synthetic audio fixture exhausted + + + + + FixtureSoundOutput + + + Synthetic audio output requires a readable source. + + + + + Synthetic audio output requires a capture path. + + + + + Synthetic audio output does not yet support big-endian hosts. + + + + + Synthetic audio output received an unsupported source frame size. + + + + + Unable to open synthetic audio output capture %1: %2 + + + + + Synthetic audio output received a partial captured frame. + + + + + Synthetic FT8 audio output exceeded its 15-second capture period. + + + + + Synthetic audio output wrote %1 of %2 capture bytes: %3 + + + + + Synthetic audio output source disappeared during capture. + + + + + Synthetic FT8 audio output continued beyond its 15-second capture period. + + + + + Synthetic audio output received %1 of %2 source bytes. + + + + + Synthetic audio output received an invalid source byte count. + + + + + FoxLog::impl + + + Date & Time(UTC) + 日期與時間(UTC) + + + + Call + 呼號 + + + + Grid + 網格 + + + + Sent + 發出 + + + + Rcvd + 接收 + + + + Band + 波段 + + + + FoxLogWindow + + + Fox Log + 狐狸日誌 + + + + <html><head/><body><p>Right-click here for available actions.</p></body></html> + <html><head/><body><p>按右鍵此處查看可用操作.</p></body></html> + + + + Callers: + 呼叫者: + + + + + + N + + + + + In progress: 正在處理中: @@ -1624,104 +2299,136 @@ Error: %2 - %3 是否確實要清除 FoxQSO.txt 檔案並使用新的狐狸日誌? + + FrequencyDeltaLineEdit + + + Offset in MHz + + + + + Frequency offset in MHz + + + + + Enter a frequency offset in MHz. + + + FrequencyDialog - + Add Frequency 新增頻率 - + IARU &Region: IA&RU 區域: - + &Mode: 模式(&M): - + &Frequency (MHz): 頻率 (M&Hz): - + &Preferred for Band/Mode: 首選波段/模式(&P): - + &Description: 描述(&D): - + &Enable Date Range: 啟用日期範圍(&E): - + S&tart: 開始(&t): - + &End: 結束(&E): - + &Source: 來源(&S): - + Invalid Date Range 無效的日期範圍 - + Start date must be before end date 開始日期必須在結束日期之前 + + FrequencyLineEdit + + + + Frequency in MHz + + + + + Enter a positive frequency in MHz. + + + FrequencyList_v2_101 - + IARU Region IARU 區域 - + Mode 模式 - + Frequency 頻率 - + Frequency (MHz) 頻率 (兆赫) - + Description 描述 - + Source 來源 @@ -1737,129 +2444,241 @@ Error: %2 - %3 - + Pref 優先 - + Start Date/Time 開始日期和時間 - + End Date/Time 結束日期/時間 - + Failed to parse JSON file 無法解析JSON檔案 - + Information Missing 缺少資訊 - + No Frequencies were found 未找到頻率 - + Loaded Frequencies from %1 載入頻率來自 %1 - + Entries Valid/Skipped %1 有效/跳過 的條目 %1 + + Ft8TxLoopbackTestController + + + Timed out after 60 seconds. + + + + + Synthetic output opened the wrong capture path: %1 + + + + + The FT8 output stream did not start exactly once. + + + + + The FT8 Auto control was not found. + + + + + Disabling Auto stopped the active FT8 transmission. + + + + + Synthetic output reported non-silent FT8 audio more than once. + + + + + The FT8 capture did not stop exactly once at the requested path. + + + + + Synthetic audio output failed: %1 + + + + + A required FT8 transmit GUI control was not found. + + + + + The application did not enter FT8 mode. + + + + + Unable to configure the requested FT8 transmission. + + + + + The FT8 transmit controls disappeared before transmission. + + + + + Unable to start the synthetic FT8 transmission. + + + + + The FT8 Auto control disappeared before retry. + + + + + The FT8 output lifecycle was not one start, non-silent transmission, and natural stop. + + + + + FT8 audio began at frame %1; expected %2 +/- %3 frames. + + + + + The FT8 capture file was not created or is empty: %1 + + + + + Unable to reopen FT8 capture %1: %2 + + + + + The FT8 capture is not 48 kHz mono signed 16-bit little-endian PCM. + + + + + The FT8 capture must contain exactly %1 frames; file=%2 reported=%3. + + + + + Unexpected modal window: %1 + + + HRDTransceiver - - + + Failed to connect to Ham Radio Deluxe 無法連接到 Ham Radio Deluxe - + Failed to open file "%1": %2. 無法開啟檔案 "%1": %2. - - + + Ham Radio Deluxe: no rig found Ham Radio Deluxe: 未找到無線電設備 - + Ham Radio Deluxe: rig doesn't support mode Ham Radio Deluxe: 無線電設備不支援模式 - + Ham Radio Deluxe: sent an unrecognised mode Ham Radio Deluxe: 發送了一個無法識別的模式 - + Ham Radio Deluxe: item not found in %1 dropdown list Ham Radio Deluxe: 在 %1 下拉清單中找不到項目 - + Ham Radio Deluxe: button not available Ham Radio Deluxe: 按鈕不可用 - + Ham Radio Deluxe didn't respond as expected Ham Radio Deluxe 沒有如預期的那樣響應 - + Ham Radio Deluxe: rig has disappeared or changed Ham Radio Deluxe: 無線電設備已經消失或改變 - + Ham Radio Deluxe send command "%1" failed %2 Ham Radio Deluxe 發送命令 "%1" 失敗 %2 - - + + Ham Radio Deluxe: failed to write command "%1" Ham Radio Deluxe: 無法寫入命令 "%1" - + + Ham Radio Deluxe sent an invalid reply to our command "%1": %2 + + + Ham Radio Deluxe sent an invalid reply to our command "%1" - Ham Radio Deluxe 對我們的命令發出了無效的回復 "%1" + Ham Radio Deluxe 對我們的命令發出了無效的回復 "%1" - + Ham Radio Deluxe failed to reply to command "%1" %2 Ham Radio Deluxe 無法回復命令 "%1" %2 - + Ham Radio Deluxe retries exhausted sending command "%1" Ham Radio Deluxe 發送命令重試失敗 "%1" - + Ham Radio Deluxe didn't respond to command "%1" as expected Ham Radio Deluxe 沒有回應預期的命令 "%1" @@ -1867,186 +2686,186 @@ Error: %2 - %3 HamlibTransceiver - - + + Hamlib initialisation error Hamlib 初始化錯誤 - + Hamlib settings file error: %1 at character offset %2 Hamlib 設定檔案錯誤: %1 字符偏移量 %2 - + Hamlib settings file error: top level must be a JSON object Hamlib 設定檔案錯誤: 頂層必須是 JSON 對象 - + Hamlib settings file error: config must be a JSON object Hamlib 設定檔案錯誤: 配置必須是JSON對象 - + Unsupported CAT type 不支援 CAT 類型 - + Hamlib error: %1 while %2 Hamlib 錯誤: %1 當 %2 - + opening connection to rig 開啟連接無線電設備 - + getting current frequency 取得當前頻率 - + getting current mode 取得當前模式 - - + + exchanging VFOs 在 VFOs 之間切換 - - + + getting other VFO frequency 取得其他 VFO 頻率 - + getting other VFO mode 取得其他 VFO 模式 - - + + setting current VFO 設定當前 VFO - + getting frequency 取得頻率 - + getting mode 取得模式 - - - + + + getting current VFO 取得當前 VFO - - - - + + + + getting current VFO frequency 取得當前 VFO 頻率 - - - - - - + + + + + + setting frequency 設定頻率 - - - - + + + + getting current VFO mode 取得當前 VFO 模式 - - - - - + + + + + setting current VFO mode 設定當前 VFO 模式 - setting VFOB mode - 設定 VFOB 模式 + 設定 VFOB 模式 - - + + setting/unsetting split mode 設定/取消 設定異頻模式 - - + + setting split mode 設定異頻模式 - + setting split TX frequency and mode 設定異頻發送頻率和模式 - + setting split TX frequency 設定異頻發送頻率 - + getting split TX VFO mode 獲得異頻發送 VFO 模式 - + setting split TX VFO mode 設定異頻發送 VFO 模式 - + getting PTT state 取得PTT 狀態 - + setting PTT on 設定PTT 開啟 - - + + setting PTT off 設定PTT 關閉 - + setting a configuration item 設定配置項目 - + + getting a configuration item 取得配置項目 @@ -2081,3401 +2900,5482 @@ Error: %2 - %3 - LogQSO + JttyTxLoopbackTestController - - Click OK to confirm the following QSO: - 單擊確定來確認以下通聯: + + Timed out after 60 seconds. + - - Call - 呼號 + + JTTY request %1 was accepted more than once. + - - Start - 開始日期/時間 + + JTTY request %1 was rejected with reason %2. + - - - dd/MM/yyyy HH:mm:ss - + + JTTY request %1 completed more than once. + - - End - 結束日期/時間 + + More than one JTTY transmit session drained. + - - Mode - 模式 + + Synthetic output opened the wrong capture path: %1 + - - Band - 波段 + + JTTY output stream restarted more than once. + - - Rpt Sent - 發出報告 + + Synthetic output reported non-silent playback more than once. + - - Rpt Rcvd - 接收報告 + + Synthetic output stopped the wrong capture path: %1 + - - Grid - 網格 + + JTTY output stream stopped more than once. + - - Name - 姓名 + + Synthetic audio output failed: %1 + - - Tx power - 發送功率 + + The JTTY mode action was not found. + - - - - - - - Retain - 保留 + + The application did not enter JTTY mode. + - - Comments - 注釋 + + The JTTY encoder did not produce a valid test waveform extent. + - - <html><head/><body><p>Add comment to the comments list.</p></body></html> - <html><head/><body><p>將評論添加到評論清單.</p></body></html> + + The first JTTY text request was not accepted synchronously. + - - Add - 新增 + + Non-silent playback began before the first request was accepted. + - - Operator - 操作員 + + The output stream restarted or stopped before the gapless append. + - - Exch sent - 交換發送 + + The gapless append occurred before one second of real playback. + - - Rcvd - 接收 + + The second JTTY text request was not accepted during playback. + - - Prop Mode - 傳播模式 + + Appending the second JTTY message restarted or stopped playback. + - - Sat Mode - 衛星模式 + + The accepted-request set did not contain exactly both submitted messages. + - - RX Frequency - 接收信息 + + JTTY text requests were not accepted in submission order. + - - Aircraft scatter - 飛機反射 + + The completed-request set did not contain exactly both submitted messages. + - - Aurora-E - 極光-E + + JTTY text requests did not complete in FIFO order. + - - Aurora - 極光 + + The output stream lifecycle was not one start, one drain, and one stop. + - - Back scatter - 背面反射 + + The captured JTTY session contains an unexpected internal audio gap. + - - Echolink - + + The JTTY capture file was not created or is empty: %1 + - - Earth-moon-earth - 月球面反射通信 + + Unable to reopen JTTY capture %1: %2 + - - Sporadic E - 零星 E + + The JTTY capture is not 48 kHz mono signed 16-bit little-endian PCM. + - - F2 Reflection - F2 反射 + + The JTTY capture has an invalid PCM extent: file frames=%1, expected audio frames=%2, reported frames=%3. + - - Field aligned irregularities - 場對齊不規則性 + + Unexpected modal window: %1 + + + + LiveAudioTestController - - Internet-assisted - 互聯網輔助 + + Timed out after 110 seconds. + - - Ionoscatter - 電離層反射 + + Timed out after 100 seconds. + - - IRLP - 互聯網電台連接 + + Decoder backend failed: %1 + - - Meteor scatter - 流星反射 + + JTTY display did not settle to the expected text after input ended. + - - Non-satellite repeater or transponder - 非衛星中繼器或轉發器 + + Synthetic audio source failed: %1 + - - Rain scatter - 雨水反射 + + Unable to open expected decode file %1: %2 + - - - Satellite - 衛星 + + Expected decode file %1 contains no messages. + - - Trans-equatorial - 跨赤道 + + Unable to open expected JTTY text file %1: %2 + - - Troposheric ducting - 對流層管道 + + Expected JTTY text file %1 contains no messages. + - - A - + + A required FT8 decoder or monitoring GUI control was not found. + - - B - + + Unable to configure the %1-%2 Hz waterfall decode range. + - - BS - + + Unable to prepare the complete FT8 fixture decode. + - - JA - + + Unable to configure the FT8 multithreaded decoder as requested. + - - JD - + + Monitor did not enter the active state. + - - K - + + Synthetic input unexpectedly selected the disk-data path. + - - KA - + + Unable to arm the synthetic audio source. + - - KT - + + A required JTTY mode, monitoring, or decode display control was not found. + - - L - + + The JTTY GUI action did not select JTTY mode. + - - LS - + + Monitor did not enter the active state for JTTY. + - - LU - + + Synthetic JTTY input unexpectedly selected the disk-data path. + - - LX - + + Unable to arm the synthetic JTTY audio source. + - - S - + + The expected early standard and final configured MTD decoder invocations were not both observed. + - - SX - + + The configured MTD invocation produced no decoder output. + - - T - + + live MTD missing: %1 + - - US - + + processed missing: %1 + - - UV - + + display missing: %1 + - - VS - + + Reference-message validation failed: %1; live MTD output: %2; processed output: %3 + - - VU - + + Decoder messages were processed but none reached the GUI display path. + - - - Invalid QSO Data - 無效的通聯資料 + + The expected JTTY messages did not reach both panes in FIFO order. + - - Check exchange sent and received - 選擇已交換的發出及接收 + + The expected JTTY message reached both panes without an observed growing prefix. + - - Check all fields - 檢查所有欄位 + + Unexpected modal window: %1 + + + + LogQSO - - Log file error - 日誌檔案錯誤 + + Click OK to confirm the following QSO: + 單擊確定來確認以下通聯: - - Cannot open "%1" for append - 無法開啟 "%1" 的附加 + + Call + 呼號 - - Error: %1 - 錯誤: %1 + + Start + 開始日期/時間 - - - MainWindow - - WSJT-X by K1JT + + + dd/MM/yyyy HH:mm:ss - - - - - - - - - - Band Activity - 波段內訊息 + + End + 結束日期/時間 - - - UTC dB DT Freq Dr - + + Mode + 模式 - - - - - - - - Rx Frequency - 通聯解碼訊息 + + Band + 波段 - - 160 - + + Rpt Sent + 發出報告 - - 80 - + + Rpt Rcvd + 接收報告 - - 60 - + + Grid + 網格 - - 40 - + + Name + 姓名 - - 30 - + + Tx power + 發送功率 - - 20 - + + + + + + + Retain + 保留 - - 17 - + + Comments + 注釋 - - 15 - + + <html><head/><body><p>Add comment to the comments list.</p></body></html> + <html><head/><body><p>將評論添加到評論清單.</p></body></html> - - 12 - + + Add + 新增 - - 10 - + + Operator + 操作員 - - 6 - + + Exch sent + 交換發送 - - 70 - + + Rcvd + 接收 - - CQ messages only. - 僅CQ信息. + + Prop Mode + 傳播模式 - - CQ only - 只顯示CQ + + Sat Mode + 衛星模式 - - Bypass Filters toggled via Settings or the View menu. - 通過設置或查看菜單切換的繞過篩檢. + + RX Frequency + 接收信息 - - BP - 繞過 + + Aircraft scatter + 飛機反射 - - Enter this QSO in log - 在日誌中輸入此通聯紀錄 + + Aurora-E + 極光-E - - Log &QSO - 記錄通聯(&Q) + + Aurora + 極光 - - Stop monitoring - 停止監聽 + + Back scatter + 背面反射 - - &Stop - 停止(&S) + + Echolink + - - Toggle monitoring On/Off - 切換監聽 啟用/停用 + + Earth-moon-earth + 月球面反射通信 - - &Monitor - 監聽(&M) + + Sporadic E + 零星 E - - <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> - <html><head/><body><p>清除 訊息視窗. 點擊兩次按鈕可清除接收及波段活動訊息視窗.</p></body></html> + + F2 Reflection + F2 反射 - - Erase right window. Double-click to erase both windows. - 清除接收訊息視窗. 點擊兩次按鈕可清除接收及波段活動訊息視窗. + + Field aligned irregularities + 場對齊不規則性 - - &Erase - 清除(&E) + + Internet-assisted + 互聯網輔助 - - <html><head/><body><p>Clear the accumulating message average.</p></body></html> - <html><head/><body><p>清除累積訊息平均值.</p></body></html> + + Ionoscatter + 電離層反射 - - Clear the accumulating message average. - 清除累積訊息平均值. + + IRLP + 互聯網電台連接 - - Clear Avg - 清除平均 + + Meteor scatter + 流星反射 - - <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> - <html><head/><body><p>在通聯頻率下解碼訊息</p></body></html> + + Non-satellite repeater or transponder + 非衛星中繼器或轉發器 - - Decode most recent Rx period at QSO Frequency - 在通聯頻率下解碼訊息 + + Rain scatter + 雨水反射 - - &Decode - 解碼(&D) + + + Satellite + 衛星 - - <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> - <html><head/><body><p>切換 啟用/停用 自動發送</p></body></html> + + Trans-equatorial + 跨赤道 - - Toggle Auto-Tx On/Off - 切換 啟用/停用 自動發送 + Troposheric ducting + 對流層管道 - - E&nable Tx - 啟用發送(&n) + + Tropospheric ducting + - - Stop transmitting immediately - 立即停止發送 + + A + - - &Halt Tx - 停止發送(&H) + + B + - - <html><head/><body><p>Toggle a pure Tx tone On/Off</p></body></html> - <html><head/><body><p>打開/關閉 純發射音調</p></body></html> + + BS + - - Toggle a pure Tx tone On/Off - 切換 啟用/停用 發射純音調 + + JA + - - &Tune - 調諧(&T) + + JD + - - Menus - 顯示工具列 + + K + - - Recommended audio settings - 推薦的音訊設置 + + KA + - - <html><head/><body><p>Recommended Audio Settings.</p></body></html> - <html><head/><body><p>推薦的音訊設置.</p></body></html> + + KT + - - SuperFox User Guide - 超級狐狸使用者指南 + + L + - - Hide stations worked before on band - 隱藏在波段上曾通聯的呼號 + + LS + - - Hide stations worked today or yesterday - 隱藏今天或昨天曾經通聯的呼號 + + LU + - - Hide stations from Ignore List - 從忽略清單中隱藏呼號 + + LX + - - Ignore stations worked today or yesterday - 忽略今天或昨天曾經通聯的呼號 + + S + - - Ignore stations from Ignore List - 從忽略清單中忽略呼號 + + SX + - - Hide stations from Territory 1 - 隱藏區域中的呼號1 + + T + - - Hide stations from Territory 2 - 隱藏區域中的呼號2 + + US + - - Hide stations from Territory 3 - 隱藏區域中的呼號3 + + UV + - - Hide stations from Territory 4 - 隱藏區域中的呼號4 + + VS + - - Highlight callsigns worked today or yesterday - 突出顯示今天或昨天曾經通聯的呼號 + + VU + - - Highlight callsigns from Ignore List - 從忽略清單中突出顯示呼號 + + + Invalid QSO Data + 無效的通聯資料 - - <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> - <html><head/><body><p>將呼號和網格定位添加到資料庫. <br>右鍵搜索 hamqth.com 上的呼號.</p></body></html> + + Check exchange sent and received + 選擇已交換的發出及接收 - - <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> - <html><head/><body><p>將呼號放在忽略清單中.<br>右鍵按下在 qrzcq.com 上搜索呼號.</p></body></html> + + Check all fields + 檢查所有欄位 - - Ignore - 忽略 + + Log file error + 日誌檔案錯誤 - - Pwr - 功率 + + Cannot open "%1" for append + 無法開啟 "%1" 的附加 - - Enable auto response to the first decode from a new DXCC or new call on the current band. - 啟用對當前頻段上新 DXCC 或新呼叫的第一個解碼的自動回應. + + Error: %1 + 錯誤: %1 + + + MainWindow - - <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> - <html><head/><body><p>切換到 T/R 30 s 和 Submode B.</p></body></html> + + + + + + + + + + Band Activity + 波段內訊息 - - 30B + + + UTC dB DT Freq Dr - - <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> - <html><head/><body><p>切換到 T/R 60 s 和 Submode B.</p></body></html> + + + + + + + + Rx Frequency + 通聯解碼訊息 - - 60C + + 160 - - - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> - <html><head/><body><p>立即切換到此Tx訊息</p><p>雙擊重置為標準的73訊息</p><p>右鍵單擊以保留Tx5自定義訊息</p></body></html> + + 80 + - - FT8 QRG6 + + 60 - - FT8 QRG1 + + 40 - - FT8 QRG2 + + 30 - - FT8 QRG7 + + 20 - - FT8 QRG8 in kHz. + + 17 - - FT8 QRG5 + + 15 - - FT8 QRG3 + + + 12 - - FT8 QRG4 + + + + 10 - - FT8 QRG8 + + + + + 6 - - FT8 QRG7 in kHz. + + + 70 - - FT8 QRG6 in kHz. - + + CQ messages only. + 僅CQ信息. - - FT8 QRG5 in kHz. - + + CQ only + 只顯示CQ - - FT8 QRG4 in kHz. - + Bypass Filters toggled via Settings or the View menu. + 通過設置或查看菜單切換的繞過篩檢. - - FT8 QRG3 in kHz. - + + BP + 繞過 - - FT8 QRG2 in kHz. - + + Enter this QSO in log + 在日誌中輸入此通聯紀錄 - - FT8 QRG1 in kHz. - + + Log &QSO + 記錄通聯(&Q) - - <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> - + + Stop monitoring + 停止監聽 - - <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> - <html><head/><body><p>切換至 JT65 模式. <br>右鍵單擊切換到 JT9 模式.</p></body></html> + + &Stop + 停止(&S) - - Remove saved files after 30 days - 30天后刪除保存的檔案 + Toggle monitoring On/Off + 切換監聽 啟用/停用 - - Active Stations - 活動電臺 + + &Monitor + 監聽(&M) - - Full Duplex Mode - 全雙工模式 + + <html><head/><body><p>Erase right window. Double-click to erase both windows.</p></body></html> + <html><head/><body><p>清除 訊息視窗. 點擊兩次按鈕可清除接收及波段活動訊息視窗.</p></body></html> - - F High - F 高 + + Erase right window. Double-click to erase both windows. + 清除接收訊息視窗. 點擊兩次按鈕可清除接收及波段活動訊息視窗. - - Avg - 平均 + + &Erase + 清除(&E) - - <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> - <html><head/><body><p>切換等待 &amp; 呼叫 啟用/停用. 按右鍵以清除DX呼叫框.</p></body></html> + + <html><head/><body><p>Clear the accumulating message average.</p></body></html> + <html><head/><body><p>清除累積訊息平均值.</p></body></html> - - F Low - F 低 + + Clear the accumulating message average. + 清除累積訊息平均值. - - Tol - 容差 + + Clear Avg + 清除平均 - - 1/2 - + + <html><head/><body><p>Decode most recent Rx period at QSO Frequency</p></body></html> + <html><head/><body><p>在通聯頻率下解碼訊息</p></body></html> - - 2/2 - + + Decode most recent Rx period at QSO Frequency + 在通聯頻率下解碼訊息 - - 1/3 - + + &Decode + 解碼(&D) - - 2/3 - + + <html><head/><body><p>Toggle Auto-Tx On/Off</p></body></html> + <html><head/><body><p>切換 啟用/停用 自動發送</p></body></html> - - 3/3 - + + Toggle Auto-Tx On/Off + 切換 啟用/停用 自動發送 - - 1/4 - + + E&nable Tx + 啟用發送(&n) - - 2/4 - + + Stop transmitting immediately + 立即停止發送 - - 3/4 - + + &Halt Tx + 停止發送(&H) - - 4/4 - + <html><head/><body><p>Toggle a pure Tx tone On/Off</p></body></html> + <html><head/><body><p>打開/關閉 純發射音調</p></body></html> - - 1/5 - + + Toggle a pure Tx tone On/Off + 切換 啟用/停用 發射純音調 - - 2/5 - + + &Tune + 調諧(&T) - - 3/5 - + + + Menus + 顯示工具列 - - 4/5 - + Recommended audio settings + 推薦的音訊設置 - - 5/5 - + <html><head/><body><p>Recommended Audio Settings.</p></body></html> + <html><head/><body><p>推薦的音訊設置.</p></body></html> - - 1/6 - + + SuperFox User Guide + 超級狐狸使用者指南 - - 2/6 - + + Hide stations worked before on band + 隱藏在波段上曾通聯的呼號 - - 3/6 - + + Hide stations worked today or yesterday + 隱藏今天或昨天曾經通聯的呼號 - - 4/6 - + + Hide stations from Ignore List + 從忽略清單中隱藏呼號 - - 5/6 - + + Ignore stations worked today or yesterday + 忽略今天或昨天曾經通聯的呼號 - - 6/6 - + + Ignore stations from Ignore List + 從忽略清單中忽略呼號 - - Percentage of minute sequences devoted to transmitting. - 用於傳輸的分鐘序列的百分比. + + Hide stations from Territory 1 + 隱藏區域中的呼號1 - - Prefer Type 1 messages - 首選類型 1 資訊 + + Hide stations from Territory 2 + 隱藏區域中的呼號2 - - <html><head/><body><p>No own call decodes.</p></body></html> - <html><head/><body><p>解碼中沒有自己的呼號.</p></body></html> + + Hide stations from Territory 3 + 隱藏區域中的呼號3 - - <html><head/><body><p>Transmit during the next sequence.</p></body></html> - <html><head/><body><p>在下一個序列中傳送.</p></body></html> + + Hide stations from Territory 4 + 隱藏區域中的呼號4 - - - Q65 - + + Highlight callsigns worked today or yesterday + 突出顯示今天或昨天曾經通聯的呼號 - - SWL Mode - SWL 模式 + + Highlight callsigns from Ignore List + 從忽略清單中突出顯示呼號 - - Hide lower panel controls to maximize deocde windows - 隱藏下面板控制項以最大化解碼視窗 + + <html><head/><body><p>Add callsign and locator to database. <br>Right-click searches for callsign on hamqth.com.</p></body></html> + <html><head/><body><p>將呼號和網格定位添加到資料庫. <br>右鍵搜索 hamqth.com 上的呼號.</p></body></html> - - USB dial frequency - 上邊帶頻率 + + WSJT-X by K1JT et al. + - - 14.078 000 - + + Band Activity decode pane title + - - <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> - <html><head/><body><p>綠色範圍為最好<br/>紅色範圍可能發生訊號剪裁<br/>黃色範圍為太低</p></body></html> + + Title for the Band Activity decoded messages pane. + - - Rx Signal - 接收信號 + + Band Activity decoded messages headings + - - 30dB recommended when only noise present -Green when good -Red when clipping may occur -Yellow when too low - 當只存在噪音時建議30dB -綠色範圍為最好 -紅色範圍可能發生訊號剪裁 -黃色範圍為太低 + + + Columns: UTC dB DT Freq Message. + - - DX Call - DX 呼號 + + Band Activity decoded messages + - - DX Grid - DX 網格 + + Decoded messages in the Band Activity pane. Columns: UTC dB DT Freq Message. + - - Callsign of station to be worked - 正在通聯的電臺呼號 + + Rx Frequency decode pane title + - - &Lookup - 檢索(&L) + + Title for the Rx Frequency decoded messages pane. + - - Locator of station to be worked - 通聯中的電臺定位 + + Rx Frequency decoded messages headings + - - Az: 251 16553 km - 角度: 251 16553 公里 + + Rx Frequency decoded messages + - - Add - 新增 + + Decoded messages in the Rx Frequency pane. Columns: UTC dB DT Freq Message. + - - <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> - <html><head/><body><p>橙色或紅色表示無線電設備控制異常. S 表示異頻模式.</p></body></html> + + Check to display received messages in lower case. + - - If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. - 橙色或紅色表示無線電設備控制異常. S 表示異頻模式. + + Lower case + - - ? - + + Include Time + - - Adjust Tx audio level - 調整發送音效電平 + + 23 + - - <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> - <html><head/><body><p>選擇工作頻段或輸入兆赫頻率或輸入千赫增量,然後輸入 k.</p></body></html> + + 33 + - - Frequency entry - 輸入頻率 + + 10G + - - Select operating band or enter frequency in MHz or enter kHz increment followed by k. - 選擇工作頻段或輸入兆赫頻率或輸入千赫增量,然後輸入 k. + + 13 + - - <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> - <html><head/><body><p>點擊兩下解碼文字時, 保持固定發送頻率.</p></body></html> + + 24G + - - Check to keep Tx frequency fixed when double-clicking on decoded text. - 點擊兩下解碼文字時, 保持固定發送頻率. + + + 4 + - - Hold Tx Freq - 保持發送頻率 + + + 8 + - - Audio Rx frequency - 音頻接收頻率 + + 1.25 + - - - - - - Hz - 赫茲 + + 5G + - - - Rx - 接收 + + + + 9 + - - - Set Tx frequency to Rx Frequency - 將發送頻率設定為接收頻率 + + Bypass Filters toggled via Settings or the Filters menu. + - - ▲ - + + <html><head/><body><p>Toggle monitoring On/Off. <br>Yellow when saving .wav files.</p></body></html> + - - Frequency tolerance (Hz) - 頻率容差值 (赫茲) + + <html><head/><body><p>Put callsign on the Ignore List.<br>Right-click searches for callsign on qrzcq.com.</p></body></html> + <html><head/><body><p>將呼號放在忽略清單中.<br>右鍵按下在 qrzcq.com 上搜索呼號.</p></body></html> - - F Tol - 容差 + + Ignore + 忽略 - - - Set Rx frequency to Tx Frequency - 將接收頻率位置移往發送頻率位置 + + Pwr + 功率 - - ▼ - + + Enable auto response to the first decode from a new DXCC or new call on the current band. + 啟用對當前頻段上新 DXCC 或新呼叫的第一個解碼的自動回應. - - <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> - <html><head/><body><p>同步閾值. 較低的數位接受較弱的同步訊號.</p></body></html> + + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the strongest station's reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the weakest station's reply to your CQ.</p><p>When CQ or QRZ is pending, Enable Tx may be armed before or during a receive period. Only eligible direct callers decoded after it is armed in that period can replace the pending transmission; earlier callers are not retained.</p></body></html> + - - Synchronizing threshold. Lower numbers accept weaker sync signals. - 同步閾值. 較低的數位接受較弱的同步訊號. + + <html><head/><body><p>Switch to T/R 15 s and Submode C.</p></body></html> + <html><head/><body><p>切換到 T/R 60 s 和 Submode B.</p></body></html> {15 ?} - - Sync - 同步 + + 15C + - - <html><head/><body><p>Check to use short-format messages.</p></body></html> - <html><head/><body><p>選擇以使用短格式訊息.</p></body></html> + + <html><head/><body><p>Switch to T/R 15 s and Submode A.</p></body></html> + - - ` - + + 15A + - - Search for callsign in database - 在資料庫中搜索呼號 + + <html><head/><body><p>Switch to T/R 30 s and Submode B.</p></body></html> + <html><head/><body><p>切換到 T/R 30 s 和 Submode B.</p></body></html> - - Add callsign and locator to database - 將呼號和網格定位添加到資料庫 + + 30B + - - Pwr - 功率 + + <html><head/><body><p>Switch to T/R 60 s and Submode C.</p></body></html> + <html><head/><body><p>切換到 T/R 60 s 和 Submode B.</p></body></html> - - Decode other Hounds calling above 1000 Hz audio offset - 解碼高於1000赫茲音頻偏移的其他獵犬呼叫 + + 60C + - - Check to use short-format messages. - 選擇使用短格式訊息. + + <html><head/><body><p>Switch to T/R 60 s and Submode D.</p></body></html> + - - Sh - + + 60D + - - <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> - <html><head/><body><p>選擇以開啟 JT9 快速模式</p></body></html> + + <html><head/><body><p>Switch to T/R 60 s and Submode E.</p></body></html> + - - Check to enable JT9 fast modes - 選擇以開啟 JT9 快速模式 + + 60E + - - - Fast - 快速 + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + - - <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> - <html><head/><body><p>選擇以開啟接收到訊息自動排序發送訊息.</p></body></html> + + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + - - Check to enable automatic sequencing of Tx messages based on received messages. - 選擇以開啟接收到訊息自動排序發送訊息. + + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> + <html><head/><body><p>立即切換到此Tx訊息</p><p>雙擊重置為標準的73訊息</p><p>右鍵單擊以保留Tx5自定義訊息</p></body></html> - - Auto Seq - 自動完成通聯 + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + - - <html><head/><body><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest.</p><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p></body></html> - <html><head/><body><p>選擇<span style=" font-weight:600;">CQ: 第一</span> 自動回覆您的CQ的第一個解碼回覆. </p><p>選擇 <span style=" font-weight:600;">CQ: 最遠</span> 自動響應在ARRL International Digita競賽中產生最多分數的回覆, 或者一般來說, 自動響應最遠的台, 如果其信息具有有效的網格.</p><p>選擇 <span style=" font-weight:600;">CQ: None</span>手動選擇呼叫者.</p></body></html> + + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + - - Check to generate "@1250 (SEND MSGS)" in Tx6. - 選擇以產生 "@1250 (傳送訊息)" 在發送6. + + Age + - - Tx6 - 發送6 + + Continent + - - <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences.</p></body></html> - <html><head/><body><p>勾選偶數分鐘發射或序列, 從0開始;取消選中奇數序列.</p></body></html> + + Score + - - Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. - 勾選偶數分鐘發射或序列, 從0開始;取消選中奇數序列. + + <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br/>Right-click to switch to the next selected band hopping frequency, or to test the default audio device, when band hopping is disabled.</p></body></html> + - - Tx even/1st - 發送偶數/奇數 + + FT8 QRG6 + - - <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> - <html><head/><body><p>呼叫CQ 的頻率以千赫高於目前的兆赫</p></body></html> + + FT8 QRG1 + - - Frequency to call CQ on in kHz above the current MHz - 呼叫 CQ 的頻率以千赫高於目前的兆赫 + + FT8 QRG2 + - - Tx CQ - 發送 CQ + + FT8 QRG7 + - - <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> - <html><head/><body><p>勾選此項, 以發送CQ呼叫. 接收將在當前頻率上,CQ訊息將顯示在當前的接收資訊視窗, 以便呼叫者知道回覆的頻率.</p><p> 不適用於非標準呼號持有者.</p></body></html> + + FT8 QRG8 in kHz. + - - Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. -Not available to nonstandard callsign holders. - 勾選此項, 以發送CQ呼叫. 接收將在當前頻率上,CQ訊息將顯示在當前的接器資訊視窗, 以便呼叫者知道回覆的頻率. -不適用於非標準呼號持有者. + + FT8 QRG5 + - - Rx All Freqs - 接收所有頻率 + + FT8 QRG3 + - - <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> - <html><head/><body><p>子模式確定音調間距; A 最窄.</p></body></html> + + FT8 QRG4 + - - Submode determines tone spacing; A is narrowest. - 子模式確定音調間距; A 最窄. + + FT8 QRG8 + - - Submode - 子模式 + + FT8 QRG7 in kHz. + - - - Fox - 狐狸 + + FT8 QRG6 in kHz. + - - <html><head/><body><p>Check to monitor Sh messages.</p></body></html> - <html><head/><body><p>選擇以監視速記訊息.</p></body></html> + + FT8 QRG5 in kHz. + - - Check to monitor Sh messages. - 選擇以監視速記訊息. + + FT8 QRG4 in kHz. + - - SWL + + FT8 QRG3 in kHz. - - Best S+P - 最佳 S+P + + FT8 QRG2 in kHz. + - - <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> - <html><head/><body><p>勾選可開始記錄校準資料.<br/>當測量校準校正被禁用時.<br/>未檢查時您可以檢視校準結果.</p></body></html> + + FT8 QRG1 in kHz. + - - Check this to start recording calibration data. -While measuring calibration correction is disabled. -When not checked you can view the calibration results. - 勾選可開始記錄校準資料. -當測量校準校正被禁用時. -未檢查時您可以檢視校準結果. + + GroupBox + - - Measure - 測量 + + CQ %M CQ + - - <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the the strongest station's reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the the weakest station's reply to your CQ. </p></body></html> - <html><head/><body><p>選擇<span style=" font-weight:600;">CQ: None</span> 手動選擇呼叫者.</p><p>選擇 <span style=" font-weight:600;">CQ: 第一</span> 自動回覆您的CQ的第一個解碼回覆. </p><p>選擇 <span style=" font-weight:600;">CQ: 最遠</span> 自動響應在ARRL International Digita競賽中產生最多分數的回覆, 或者一般來說, 自動響應最遠的台, 如果其信息具有有效的網格.</p><p>選擇 <span style=" font-weight:600;">CQ: Max dB</span> 自動回覆最強的台回覆你的CQ. </p><p>選擇 <span style=" font-weight:600;">CQ: Min dB</span> 自動回覆最弱的台回覆你的CQ. </p></body></html> + + %H 599 %N + - - - <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> - <html><head/><body><p>以偶數分鐘或序列檢查到Tx, 從0開始;取消選中奇數序列. 右鍵單擊以凍結覆選框的狀態. 右鍵單擊FT8或MSK按鈕解凍.</p></body></html> + + %H TU CQ %M CQ + - - <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> - <html><head/><body><p>信號報告: 參考2500赫茲頻寬 (dB) 中的信噪比.</p></body></html> + + %M + - - Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). - 信號報告: 參考2500赫茲頻寬 (dB) 中的信噪比. + + %H + - - Report - 報告 + + TU NOW %Q 599 %N + - - <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> - <html><head/><body><p>發送/接收 或頻率校準序列長度</p></body></html> + + %H AGN? + - - Tx/Rx or Frequency calibration sequence length - 發送/接收 或頻率校準序列長度 + + 599 %N + - - - s - 秒 + + F1 + - - - T/R - + + HisCall Exchange + - - Audio Tx frequency - 音訊發送頻率 + + F2 + - - - Tx - 發送 + + TU CQ + - - Tx# - 發送# + + F3 + - - 1 - + + MyCall + - - - - Send this message in next Tx interval - 在下一個發送間隔內發送此訊息 + + F4 + - - Ctrl+2 - + + HisCall + - - <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> - <html><head/><body><p>在下一個發送間隔中傳送此訊息</p><p>按兩下以切換使用 發送 1 訊息以啟動電臺的通聯 (不允許 1 型複合呼叫持有者)<</p></body></html> + + F5 + - - Send this message in next Tx interval -Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) - 在下一個發送間隔中傳送此訊息 -按兩下以切換使用 發送 1 訊息以啟動電臺的通聯 (不允許 1 型複合呼叫持有者) + + Now QueuedCall Exchange + - - Ctrl+1 - + + F6 + - - - - - Switch to this Tx message NOW - 立即切換到此發送訊息 + + HisCall AGN ? + - - Tx &2 - 發送 &2 + + Exchange + - - Alt+2 - + + Serial number of QSO for contest exchange. + - - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> - <html><head/><body><p>立即切換到此發送訊息</p><p>按兩下以切換使用 發送 1 訊息以啟動電臺的通聯 (不允許 1 型複合呼叫持有者)</p></body></html> + + Click to transmit a message. + - - Switch to this Tx message NOW -Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) - 立即切換到此發送訊息 -按兩下以切換使用 發送 1 訊息以啟動電臺的通聯 (不允許 1 型複合呼叫持有者) + + Send message + - - Tx &1 - 發送 &1 + + Call next + - - Alt+1 - + + Message to be transmitted + - - Ctrl+6 - + + Serial Number + - - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> - <html><head/><body><p>在下一個發送間隔內傳送此訊息</p><p>雙擊可重置為標準 73 訊息</p></body></html> + + Callsign to be worked next. + - - Send this message in next Tx interval -Double-click to reset to the standard 73 message - 在下一個發送間隔內傳送此訊息 -雙擊可重置為標準 73 訊息 + + Spacing + - - Ctrl+5 - + + Fixed Tone + - - Ctrl+3 - + + K1JT + - - Tx &3 - 發送 &3 + + CW + - - Alt+3 - + + Toggle FT8 hound mode On/Off.<br>Right-click to activate or deactivate SuperFox mode. + - - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>在下一個發送間隔內傳送此訊息</p><p>按兩下可在 發送4 中的 RRR 和 RR73 訊息之間切換 (不允許類型 2 複合呼叫持有者)</p><p>RR73 訊息僅在您有理由相信不需要重複訊息時才應使用</p></body></html> + + Switch to FT8 mode.<br>Right-click to toggle last used contest mode On/Off. + - - Send this message in next Tx interval -Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) -RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - 在下一個發送間隔內傳送此訊息 -按兩下可在 發送4 中的 RRR 和 RR73 訊息之間切換 (不允許類型 2 複合呼叫持有者) -RR73 訊息僅在您有理由相信不需要重複訊息時才應使用 + + <html><head/><body><p>Switch to Q65 mode.<br> Right-click to switch to Q65 Pileup mode.</p></body></html> + - - Ctrl+4 - + + <html><head/><body><p>Switch to JT65 mode. <br>Right-click to switch to JT9 mode.</p></body></html> + <html><head/><body><p>切換至 JT65 模式. <br>右鍵單擊切換到 JT9 模式.</p></body></html> - - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> - <html><head/><body><p>立即切換到此發送訊息</p><p>按兩下可在 發送 4 中的 RRR 和 RR73 訊息之間切換 (不允許類型 2 複合呼叫持有者)</p><p>RR73 訊息僅在您有理由相信不需要重複訊息時才應使用</p></body></html> + + <html><head/><body><p>Switch to Echo mode</p></body></html> + - - Switch to this Tx message NOW -Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) -RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - 立即切換到此發送訊息 -按兩下可在 發送 4 中的 RRR 和 RR73 訊息之間切換 (不允許類型 2 複合呼叫持有者) -RR73 訊息僅在您有理由相信不需要重複訊息時才應使用 + + Parameters + - - Tx &4 - 發送 &4 + + Decoder sensitivity + - - Alt+4 - + + Decoder start + - - Tx &5 - 發送 &5 + + Number of threads + - - Alt+5 - + + QSO RX freq sensitivity + - - Now - 現在 + + Decoding cycles + - - Generate standard messages for minimal QSO - 產生標準通聯用訊息 + + Ctrl+X + - - Generate Std Msgs - 產生標準訊息 + + Alt+X + - - Tx &6 - 發送 &6 + + Remove saved files after 30 days + 30天后刪除保存的檔案 - - Alt+6 - + + Active Stations + 活動電臺 - - Enter a free text message (maximum 13 characters) -or select a predefined macro from the dropdown list. -Press ENTER to add the current text to the predefined -list. The list can be maintained in Settings (F2). - 輸入自訂義文字資訊(最多13個字元) -或從下拉清單中選擇預定義的巨集. -按Enter將目前的文字加入預先定義的 -清單. 該清單可在設定(F2)中維護. + + How to deal with rig control errors + - - Queue up the next Tx message - 排到下一個發送訊息 + + <html><head/><body><p>How to deal with rig control errors.</p></body></html> + - - Next - 下一個 + + Message Creator + - - - 2 - + + Full Duplex Mode + 全雙工模式 - - Quick-Start Guide to FST4 and FST4W - FST4和FST4W快速入門指南 + + Enable Message Popups + - - - FST4 - + + QSY Monitor + - - FST4W - + + Ignore stations worked before on band + - - - CQ - - - - - Grid - 網格 - - - - Max dB - 最大分貝 - - - - CQ AF - CQ 非洲 - - - - <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> - <html><head/><body><p>在資料庫中搜索呼號. <br>右鍵按下在 QRZ.com 上搜索呼號.</p></body></html> - - - - CQ AN - CQ 南極 + + Use multithreaded FT8 decoder + - - CQ AS - CQ 亞洲 + + Auto + - - CQ EU - CQ 歐洲 + + + 5 + - - CQ NA - CQ 北美洲 + + + 7 + - - CQ OC - CQ 大洋洲 + + + 11 + - - CQ SA - CQ 南美洲 + + Low + 低 - - CQ 0 - + + Medium + - - CQ 1 - + + High + 高 - - CQ 2 - + + Minimum + - - CQ 3 - + + Use low thresholds + - - CQ 4 - + + Use subpass + - - CQ 5 - + + 2-Stage + - - CQ 6 - + + 3-Stage + - - CQ 7 - + + Early + - - CQ 8 - + + Late + - - CQ 9 - + + Wideband DX Call search + - - Reset - 重置 + + Hide FT8 dupe messages + - - N List - N 清單 + + VHF / UHF Buttons + - - N Slots - N 插槽 + + Highlight stations from Territory 1 + - - - - - - - - Random - 隨機 + + Highlight stations from Territory 2 + - - Call - 呼號 + + Highlight stations from Territory 3 + - - S/N (dB) - 信噪比(分貝) + + Highlight stations from Territory 4 + - - Distance - 距離 + + Disable clicks on waterfall + - - More CQs - 更多 CQ + + Download EME Ephemeris Chart + - - - 12m FT4 - + + Hide AP information + - - - 15m FT4 - + + <html><head/><body><p>Hide AP information</p></body></html> + - - - 10m FT4 - + + Highlight Whitelist entries + - - - % - + + JTTY + - - Maximum drift rate in units of symbol rate per transmission. - 最大偏移速率, 單位為每次傳輸的符號速率. + + F High + F 高 - - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p></body></html> - <html><head/><body><p>立即切換到此發射訊息</p><p>按兩下重置為標準73訊息</p></body></html> + + Avg + 平均 - - Switch to this Tx message NOW -Double-click to reset to the standard 73 message - 立即切換到此發射訊息 -按兩下重置為標準73訊息 + + <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> + <html><head/><body><p>切換等待 &amp; 呼叫 啟用/停用. 按右鍵以清除DX呼叫框.</p></body></html> - - Tx Pct - 發送 Pct + + F Low + F 低 - - Band Hopping - 波段跳躍 + Tol + 容差 - - Choose bands and times of day for band-hopping. - 選擇波段和一天之中的時間進行波段跳躍. + + 1/2 + - - Schedule ... - 時間排程 ... + + 2/2 + - - Upload decoded messages to WSPRnet.org. - 將解碼的訊息上傳至 WSPRnet.org. + + 1/3 + - - Upload spots - 上傳 spots + + 2/3 + - - <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> - <html><head/><body><p>6 位定位器會導致發送 2 個不同的訊息, 第二個包含完整定位器, 但只有哈希呼號,其他電臺必須解碼第一個一次, 然後才能在第二個中解碼您的呼叫. 如果此選項將避免兩個訊息協定, 則選中此選項僅發送 4 位定位器.</p></body></html> + + 3/3 + - - 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. - 6 位定位器會導致發送 2 個不同的訊息, 第二個包含完整定位器, 但只有哈希呼號,其他電臺必須解碼第一個一次, 然後才能在第二個中解碼您的呼叫. 如果此選項將避免兩個訊息協定, 則選中此選項僅發送 4 位定位器. + + 1/4 + - - No own call decodes - 解碼中沒有自己的呼號 + + 2/4 + - - Tx Next - 發送下一個訊息 + + 3/4 + - - Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. - 將發送功率設定為 dBm (dB 高於 1 mW) 作為 WSPR 訊息的一部分. + + 4/4 + - - NB + + 1/5 - - Max Drift - 最大漂移率 + + 2/5 + - - 3 + + 3/5 - - 2m FT8 + + 4/5 - - 2m + + 5/5 - - - 20m FT4 + + 1/6 - - 17m FT8 + + 2/6 - - 17m + + 3/6 - - 10m FT8 + + 4/6 - - 10m + + 5/6 - - 2m MSK144 + + 6/6 - - - 17m FT4 - + + Percentage of minute sequences devoted to transmitting. + 用於傳輸的分鐘序列的百分比. - - 30m FT8 - + + Prefer Type 1 messages + 首選類型 1 資訊 - - 30m - + <html><head/><body><p>No own call decodes.</p></body></html> + <html><head/><body><p>解碼中沒有自己的呼號.</p></body></html> - - 80m FT8 - + + <html><head/><body><p>Transmit during the next sequence.</p></body></html> + <html><head/><body><p>在下一個序列中傳送.</p></body></html> - - 80m + + + Q65 - - 4m FT8 - + + SWL Mode + SWL 模式 - - 4m - + + Hide lower panel controls to maximize deocde windows + 隱藏下面板控制項以最大化解碼視窗 - - 12m FT8 - + + + USB dial frequency + 上邊帶頻率 - - 12m + + 14.078 000 - - 160m FT8 - + + <html><head/><body><p>30dB recommended when only noise present<br/>Green when good<br/>Red when clipping may occur<br/>Yellow when too low</p></body></html> + <html><head/><body><p>綠色範圍為最好<br/>紅色範圍可能發生訊號剪裁<br/>黃色範圍為太低</p></body></html> - - 160m - + + Rx Signal + 接收信號 - - - 30m FT4 - + + 30dB recommended when only noise present +Green when good +Red when clipping may occur +Yellow when too low + 當只存在噪音時建議30dB +綠色範圍為最好 +紅色範圍可能發生訊號剪裁 +黃色範圍為太低 - - 70cm FT8 - + + DX Call + DX 呼號 - - 70cm - + + DX Grid + DX 網格 - - 60m FT8 - + + Callsign of station to be worked + 正在通聯的電臺呼號 - - 60m - + + &Lookup + 檢索(&L) - - 6m FT8 - + + Locator of station to be worked + 通聯中的電臺定位 - - 6m - + + Az: 251 16553 km + 角度: 251 16553 公里 - - - 40m FT4 - + + Add + 新增 - - 15m FT8 - + + <html><head/><body><p>If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode.</p></body></html> + <html><head/><body><p>橙色或紅色表示無線電設備控制異常. S 表示異頻模式.</p></body></html> - - 15m - + + If orange or red there has been a rig control failure, click to reset and read the dial frequency. S implies split mode. + 橙色或紅色表示無線電設備控制異常. S 表示異頻模式. - - 40m FT8 + + ? - - 40m - + + Adjust Tx audio level + 調整發送音效電平 - - 20m FT8 - + + <html><head/><body><p>Select operating band or enter frequency in MHz or enter kHz increment followed by k.</p></body></html> + <html><head/><body><p>選擇工作頻段或輸入兆赫頻率或輸入千赫增量,然後輸入 k.</p></body></html> - - 20m - + + Frequency entry + 輸入頻率 - - Band Hopping - 波段跳躍 + + Select operating band or enter frequency in MHz or enter kHz increment followed by k. + 選擇工作頻段或輸入兆赫頻率或輸入千赫增量,然後輸入 k. - - H - 獵犬 + + <html><head/><body><p>Check to keep Tx frequency fixed when double-clicking on decoded text.</p></body></html> + <html><head/><body><p>點擊兩下解碼文字時, 保持固定發送頻率.</p></body></html> - - Switch to MSK144 mode - 切換到MSK14模式 + + Check to keep Tx frequency fixed when double-clicking on decoded text. + 點擊兩下解碼文字時, 保持固定發送頻率. - - MSK - + + Hold Tx Freq + 保持發送頻率 - - Switch to FT4 mode - 切換到FT4模式 + + + Audio Rx frequency + 音頻接收頻率 - - Rx - 接收 + + + + + + + + + Hz + 赫茲 - - In Progress - 正在處理中 + + + + Rx + 接收 - - Queue - 隊列 + + + + + Set Tx frequency to Rx Frequency + 將發送頻率設定為接收頻率 - - <html><head/><body><p align="center"> 01:23:45 </p></body></html> + + + ▲ - - <html><head/><body><p>Toggle FT8 hound mode On/Off.<br> Right-click to toggle last used contest mode On/Off.</p></body></html> - <html><head/><body><p>啟用/停用 FT8獵犬模式.<br> 右鍵單擊可 啟用/停用 上次使用的競賽模式.</p></body></html> + + + Frequency tolerance (Hz) + 頻率容差值 (赫茲) - - Switch to FT8 mode.<br> Right-click to toggle SuperFox mode On/Off. - 切換到FT8模式.<br> 右鍵單擊以 打開/關閉 超級狐狸模式. + + + + F Tol + 容差 - - <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> - <html><head/><body><p>打開/關閉 純發射音調<br >右鍵單擊以調整裝備</p></body></html> + + + + + Set Rx frequency to Tx Frequency + 將接收頻率位置移往發送頻率位置 - - <html><head/><body><p>Enter a free text message.</p></body></html> - <html><head/><body><p>輸入自定義訊息.</p></body></html> + + + ▼ + - - Free Text - 自定義訊息 + + <html><head/><body><p>Synchronizing threshold. Lower numbers accept weaker sync signals.</p></body></html> + <html><head/><body><p>同步閾值. 較低的數位接受較弱的同步訊號.</p></body></html> - - <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> - <html><head/><body><p>下次發送自定義信息.</p></body></html> + + Synchronizing threshold. Lower numbers accept weaker sync signals. + 同步閾值. 較低的數位接受較弱的同步訊號. - - Send msg - 發送訊息 + + Sync + 同步 - - <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> - <html><head/><body><p>狐狸傳輸的最大並發流數量.</p></body></html> + + <html><head/><body><p>Check to use short-format messages.</p></body></html> + <html><head/><body><p>選擇以使用短格式訊息.</p></body></html> - - <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> - <html><head/><body><p>隊列中顯示的最大呼號數.</p></body></html> + Search for callsign in database + 在資料庫中搜索呼號 - - <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> - <html><head/><body><p>包括CQ訊息以及其他訊息.</p></body></html> + Add callsign and locator to database + 將呼號和網格定位添加到資料庫 - - <html><head/><body><p>Select a specific CQ message.</p></body></html> - <html><head/><body><p>選擇特定的CQ訊息.</p></body></html> + Pwr + 功率 - - <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> - <html><head/><body><p>為隊列中的呼號選擇所需的排序順序.</p></body></html> + + Decode other Hounds calling above 1000 Hz audio offset + 解碼高於1000赫茲音頻偏移的其他獵犬呼叫 - - <html><head/><body><p>Set the maximum permitted SNR for callers to be included in the queue.</p></body></html> - <html><head/><body><p>為要包括在隊列中的呼叫者設置最大允許信噪比.</p></body></html> + + Check to use short-format messages. + 選擇使用短格式訊息. - - <html><head/><body><p>Clear all queues.</p></body></html> - <html><head/><body><p>清除所有隊列.</p></body></html> + + Sh + - - Allow Dupes - 允許重複 + + <html><head/><body><p>Check to enable JT9 fast modes</p></body></html> + <html><head/><body><p>選擇以開啟 JT9 快速模式</p></body></html> - - 2m MSK - + + Check to enable JT9 fast modes + 選擇以開啟 JT9 快速模式 - - <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br>Right-click to test the default audio device.</p></body></html> - <html><head/><body><p>切換波段跳躍 開/關. 波段跳躍每隔一整分鐘發生一次. 對核取方塊的更改將立即生效.<br>單撃右鍵以測試默認音訊設備.</p></body></html> + + + Fast + 快速 - - - 80m FT4 - + + <html><head/><body><p>Check to enable automatic sequencing of Tx messages based on received messages.</p></body></html> + <html><head/><body><p>選擇以開啟接收到訊息自動排序發送訊息.</p></body></html> - - File - 檔案 + + Check to enable automatic sequencing of Tx messages based on received messages. + 選擇以開啟接收到訊息自動排序發送訊息. - - View - 檢視 + + Auto Seq + 自動完成通聯 - - Filters - 過濾 + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest.</p><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p></body></html> + <html><head/><body><p>選擇<span style=" font-weight:600;">CQ: 第一</span> 自動回覆您的CQ的第一個解碼回覆. </p><p>選擇 <span style=" font-weight:600;">CQ: 最遠</span> 自動響應在ARRL International Digita競賽中產生最多分數的回覆, 或者一般來說, 自動響應最遠的台, 如果其信息具有有效的網格.</p><p>選擇 <span style=" font-weight:600;">CQ: None</span>手動選擇呼叫者.</p></body></html> - - Decode - 解碼 + + Check to generate "@1250 (SEND MSGS)" in Tx6. + 選擇以產生 "@1250 (傳送訊息)" 在發送6. - - Save - 儲存 + + Tx6 + 發送6 - - Help - 說明 + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences.</p></body></html> + <html><head/><body><p>勾選偶數分鐘發射或序列, 從0開始;取消選中奇數序列.</p></body></html> - - Mode - 模式 + Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. + 勾選偶數分鐘發射或序列, 從0開始;取消選中奇數序列. - - Configurations - 設定 + + Tx even/1st + 發送偶數/奇數 - - Tools - 工具 + + <html><head/><body><p>Frequency to call CQ on in kHz above the current MHz</p></body></html> + <html><head/><body><p>呼叫CQ 的頻率以千赫高於目前的兆赫</p></body></html> - - Exit - 關閉程式 + + Frequency to call CQ on in kHz above the current MHz + 呼叫 CQ 的頻率以千赫高於目前的兆赫 - - About WSJT-X - 關於 WSJT-X + + Tx CQ + 發送 CQ - - Waterfall - 頻譜瀑布圖 + + <html><head/><body><p>Check this to call CQ on the &quot;Tx CQ&quot; frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on.</p><p>Not available to nonstandard callsign holders.</p></body></html> + <html><head/><body><p>勾選此項, 以發送CQ呼叫. 接收將在當前頻率上,CQ訊息將顯示在當前的接收資訊視窗, 以便呼叫者知道回覆的頻率.</p><p> 不適用於非標準呼號持有者.</p></body></html> - - Open - 開啟檔案 + + Check this to call CQ on the "Tx CQ" frequency. Rx will be on the current frequency and the CQ message wiill include the current Rx frequency so callers know which frequency to reply on. +Not available to nonstandard callsign holders. + 勾選此項, 以發送CQ呼叫. 接收將在當前頻率上,CQ訊息將顯示在當前的接器資訊視窗, 以便呼叫者知道回覆的頻率. +不適用於非標準呼號持有者. - - Ctrl+O - + + Rx All Freqs + 接收所有頻率 - - Open next in directory - 開啟下一個檔案 + + <html><head/><body><p>Submode determines tone spacing; A is narrowest.</p></body></html> + <html><head/><body><p>子模式確定音調間距; A 最窄.</p></body></html> - - Decode remaining files in directory - 開啟剩餘檔案 + + Submode determines tone spacing; A is narrowest. + 子模式確定音調間距; A 最窄. - - Shift+F6 - + + Submode + 子模式 - - Delete all *.wav && *.c2 files in SaveDir - 刪除所有 SaveDir目錄內 *.wav && *.c2 檔案 + + + Fox + 狐狸 - - None - 不儲存 + + <html><head/><body><p>Check to monitor Sh messages.</p></body></html> + <html><head/><body><p>選擇以監視速記訊息.</p></body></html> - - Save all - 儲存全部檔案 + + Check to monitor Sh messages. + 選擇以監視速記訊息. - - Online User Guide - 線上使用者指南 + + SWL + - - Keyboard shortcuts - 鍵盤快速鍵指南 + + Best S+P + 最佳 S+P - - Special mouse commands - 滑鼠快速鍵指南 + + <html><head/><body><p>Check this to start recording calibration data.<br/>While measuring calibration correction is disabled.<br/>When not checked you can view the calibration results.</p></body></html> + <html><head/><body><p>勾選可開始記錄校準資料.<br/>當測量校準校正被禁用時.<br/>未檢查時您可以檢視校準結果.</p></body></html> - - JT9 - + + Check this to start recording calibration data. +While measuring calibration correction is disabled. +When not checked you can view the calibration results. + 勾選可開始記錄校準資料. +當測量校準校正被禁用時. +未檢查時您可以檢視校準結果. - - Save decoded - 儲存解碼檔案 + + Measure + 測量 - - Normal - 正常 + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the the strongest station's reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the the weakest station's reply to your CQ. </p></body></html> + <html><head/><body><p>選擇<span style=" font-weight:600;">CQ: None</span> 手動選擇呼叫者.</p><p>選擇 <span style=" font-weight:600;">CQ: 第一</span> 自動回覆您的CQ的第一個解碼回覆. </p><p>選擇 <span style=" font-weight:600;">CQ: 最遠</span> 自動響應在ARRL International Digita競賽中產生最多分數的回覆, 或者一般來說, 自動響應最遠的台, 如果其信息具有有效的網格.</p><p>選擇 <span style=" font-weight:600;">CQ: Max dB</span> 自動回覆最強的台回覆你的CQ. </p><p>選擇 <span style=" font-weight:600;">CQ: Min dB</span> 自動回覆最弱的台回覆你的CQ. </p></body></html> - - Deep - 深度 + + + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> + <html><head/><body><p>以偶數分鐘或序列檢查到Tx, 從0開始;取消選中奇數序列. 右鍵單擊以凍結覆選框的狀態. 右鍵單擊FT8或MSK按鈕解凍.</p></body></html> - - Erase ALL.TXT - 刪除 ALL.TXT + + <html><head/><body><p>Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB).</p></body></html> + <html><head/><body><p>信號報告: 參考2500赫茲頻寬 (dB) 中的信噪比.</p></body></html> - - Erase wsjtx_log.adi - 刪除通聯日誌 wsjtx_log.adi + + Signal report: Signal-to-noise ratio in 2500 Hz reference bandwidth (dB). + 信號報告: 參考2500赫茲頻寬 (dB) 中的信噪比. - - Erase wsjtx.log - 刪除 wsjtx.log + + Report + 報告 - - Erase Ignore List - 刪除忽略清單 + + <html><head/><body><p>Tx/Rx or Frequency calibration sequence length</p></body></html> + <html><head/><body><p>發送/接收 或頻率校準序列長度</p></body></html> - - JT9+JT65 - + + Tx/Rx or Frequency calibration sequence length + 發送/接收 或頻率校準序列長度 - - F7 - - - - - Write ALL.TXT - 寫入 ALL.TXT + + + s + 秒 - - - Reduce false decodes - 减少錯誤解碼 + + + T/R + - - Don't split ALL.TXT - 不分折 ALL.TXT + + + Audio Tx frequency + 音訊發送頻率 - - Split ALL.TXT yearly - 分折每年 ALL.TXT + + + + Tx + 發送 - - Band Buttons - 波段按鈕 + + Tx# + 發送# - - Quick-Start Guide to WSJT-X 2.7 and QMAP - WSJT-X 2.7 和 QMAP 快速入門指南 + + + + 1 + - - Diagnostic mode - 診斷模式 + + + + Send this message in next Tx interval + 在下一個發送間隔內發送此訊息 - - Default event logging - 默認事件記錄 + + Ctrl+2 + - - Disable event logging - 禁用事件記錄 + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + <html><head/><body><p>在下一個發送間隔中傳送此訊息</p><p>按兩下以切換使用 發送 1 訊息以啟動電臺的通聯 (不允許 1 型複合呼叫持有者)<</p></body></html> - - Copy main text window to WSJT-X.txt - 將主文字視窗複製到 WSJT-X.txt + + Send this message in next Tx interval +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + 在下一個發送間隔中傳送此訊息 +按兩下以切換使用 發送 1 訊息以啟動電臺的通聯 (不允許 1 型複合呼叫持有者) - - Use Dark Style - 開啟黑夜模式 + + Ctrl+1 + - - WSJT-X_improved Home Page - WSJT-X_改進版主頁 + + + + + Switch to this Tx message NOW + 立即切換到此發送訊息 - - The additional features of wsjt-x_improved - WSJT-X_改進版的附加功能 + + Tx &2 + 發送 &2 - - <html><head/><body><p>Overview on the additional features of wsjt-x_improved.</p></body></html> - <html><head/><body><p>概述 WSJT-X_改進版的附加功能.</p></body></html> + + Alt+2 + - - <html><head/><body><p>Go to the wsjt-x_improved home page.</p></body></html> - <html><head/><body><p>轉到 WSJT-X_改進版主頁.</p></body></html> + + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders)</p></body></html> + <html><head/><body><p>立即切換到此發送訊息</p><p>按兩下以切換使用 發送 1 訊息以啟動電臺的通聯 (不允許 1 型複合呼叫持有者)</p></body></html> - - Erase list of Q65 callers - 删除Q65呼叫者清單 + + Switch to this Tx message NOW +Double click to toggle the use of the Tx1 message to start a QSO with a station (not allowed for type 1 compound call holders) + 立即切換到此發送訊息 +按兩下以切換使用 發送 1 訊息以啟動電臺的通聯 (不允許 1 型複合呼叫持有者) - - FT4 NS (NCCC Sprints) - FT4 NS (NCCC 冲刺) + + Tx &1 + 發送 &1 - - Highlight callsigns worked before on band - 突出顯示在波段曾經通聯的呼號 + + Alt+1 + - - Hide stations from Europe - 隱藏 歐洲 的電台 + + Ctrl+6 + - - Hide stations from North America - 隱藏 北美洲 的電台 + + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to reset to the standard 73 message</p></body></html> + <html><head/><body><p>在下一個發送間隔內傳送此訊息</p><p>雙擊可重置為標準 73 訊息</p></body></html> - - Hide stations from South America - 隱藏 南美洲 的電台 + + Send this message in next Tx interval +Double-click to reset to the standard 73 message + 在下一個發送間隔內傳送此訊息 +雙擊可重置為標準 73 訊息 - - Hide stations from Asia - 隱藏 亞洲 的電台 + + Ctrl+5 + - - Hide stations from Africa - 隱藏 非洲 的電台 + + Ctrl+3 + - - Hide stations from Oceania - 隱藏 大洋洲 的電台 + + Tx &3 + 發送 &3 - - Hide stations from Antarctica - 隱藏 南極洲 的電台 + + Alt+3 + - - Split ALL.TXT monthly - 分折每月 ALL.TXT + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + <html><head/><body><p>在下一個發送間隔內傳送此訊息</p><p>按兩下可在 發送4 中的 RRR 和 RR73 訊息之間切換 (不允許類型 2 複合呼叫持有者)</p><p>RR73 訊息僅在您有理由相信不需要重複訊息時才應使用</p></body></html> - - Disable writing of ALL.TXT - 禁止寫入 ALL.TXT + Send this message in next Tx interval +Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + 在下一個發送間隔內傳送此訊息 +按兩下可在 發送4 中的 RRR 和 RR73 訊息之間切換 (不允許類型 2 複合呼叫持有者) +RR73 訊息僅在您有理由相信不需要重複訊息時才應使用 - - - JT65 + + Ctrl+4 - - Astronomical data - 天文數據 + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + <html><head/><body><p>立即切換到此發送訊息</p><p>按兩下可在 發送 4 中的 RRR 和 RR73 訊息之間切換 (不允許類型 2 複合呼叫持有者)</p><p>RR73 訊息僅在您有理由相信不需要重複訊息時才應使用</p></body></html> - - List of Type 1 prefixes and suffixes - 型態 1 前置與後綴清單 + Switch to this Tx message NOW +Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) +RR73 messages should only be used when you are reasonably confident that no message repetitions will be required + 立即切換到此發送訊息 +按兩下可在 發送 4 中的 RRR 和 RR73 訊息之間切換 (不允許類型 2 複合呼叫持有者) +RR73 訊息僅在您有理由相信不需要重複訊息時才應使用 - - Settings... - 設定... + + Tx &4 + 發送 &4 - - Local User Guide - 本地使用者指南 + + Alt+4 + - - Open log directory - 開啟日誌檔案目錄 + + Tx &5 + 發送 &5 - - JT4 + + Alt+5 - - Message averaging - 訊息平均值 + + Now + 現在 - - Enable averaging - 平均值 + + Generate standard messages for minimal QSO + 產生標準通聯用訊息 - - Enable deep search - 開啟深度搜尋 + + Generate Std Msgs + 產生標準訊息 - - - WSPR - + + Tx &6 + 發送 &6 - - Switch to FST4 mode - 切換到FST4模式 + + Alt+6 + - - Switch to WSPR mode - 切換到WSPR模式 + + Enter a free text message (maximum 13 characters) +or select a predefined macro from the dropdown list. +Press ENTER to add the current text to the predefined +list. The list can be maintained in Settings (F2). + 輸入自訂義文字資訊(最多13個字元) +或從下拉清單中選擇預定義的巨集. +按Enter將目前的文字加入預先定義的 +清單. 該清單可在設定(F2)中維護. - - Echo Graph - 回波圖 + + Queue up the next Tx message + 排到下一個發送訊息 - - F8 - + + Next + 下一個 - - Echo + + + + + + + 2 - - EME Echo mode - EME Echo 模式 + + Quick-Start Guide to FST4 and FST4W + FST4和FST4W快速入門指南 - - ISCAT + + FST4 - - Fast Graph - 快速圖 + + FST4W + - - F9 + + + + CQ - - &Download Samples ... - 下載範例檔(&D) ... + + Grid + 網格 - - <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> - <html><head/><body><p>下載演示各種模式的示例音頻檔案.</p></body></html> + Max dB + 最大分貝 - - MSK144 - + + CQ AF + CQ 非洲 - - QRA64 - + + <html><head/><body><p>Search for callsign in database. <br>Right-click searches for callsign on QRZ.com.</p></body></html> + <html><head/><body><p>在資料庫中搜索呼號. <br>右鍵按下在 QRZ.com 上搜索呼號.</p></body></html> - - Release Notes - 版本發行說明 + + CQ AN + CQ 南極 - - Enable AP for DX Call - 開啟 AP 為 DX 呼叫 + + CQ AS + CQ 亞洲 - - FreqCal - + + CQ EU + CQ 歐洲 - - Measure reference spectrum - 測量參考頻譜 + + CQ NA + CQ 北美洲 - - Measure phase response - 測量相位回應 + + CQ OC + CQ 大洋洲 - - Erase reference spectrum - 清除參考頻譜 + + CQ SA + CQ 南美洲 - - Execute frequency calibration cycle - 執行頻率校準週期 + + CQ 0 + - - Equalization tools ... - 均衡工具 ... + + CQ 1 + - - - FT8 + + CQ 2 - - Toggle FT8 hound mode On/Off - 切換 FT8 獵犬模式 啟用/停用 + + CQ 3 + - - <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> + + CQ 4 - - - Enable AP - 啟用 AP + + CQ 5 + - - Solve for calibration parameters - 修正校準參數 + + CQ 6 + - - Copyright notice - 版權聲明 + + CQ 7 + - - Shift+F1 + + CQ 8 - - Fox log - 狐狸日誌 + + CQ 9 + - - FT8 DXpedition Mode User Guide - FT8 遠征模式使用者指南 + + Reset + 重置 - - Reset Cabrillo log ... - 重置Cabrillo日誌 ... + + N List + N 清單 - - Color highlighting scheme - 提示顏色 + + N Slots + N 插槽 - - Export Cabrillo log ... - 匯出Cabrillo日誌 ... + + + + + + + + Random + 隨機 - - Contest log - 競賽日誌 + + Call + 呼號 - - Erase WSPR hashtable - 清除 WSPR 哈希表 + + S/N (dB) + 信噪比(分貝) - - - FT4 - + + Distance + 距離 - - Quick-Start Guide to Q65 - Q65 快速入門指南 + + More CQs + 更多 CQ - - Auto Clear Avg after decode - 解碼後自動清除平均值 + + + 12m FT4 + - - Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 - WSJT-X 2.5.0和MAP65 3.0快速入門指南 + + + 15m FT4 + - - Rig Control Error - 無線電設備控制錯誤 + + + 10m FT4 + - - - - Receiving - 接收 + + + % + - - Do you want to reconfigure the radio interface? - 是否要重新配置無線電設備介面? + + Maximum drift rate in units of symbol rate per transmission. + 最大偏移速率, 單位為每次傳輸的符號速率. - - Error Scanning ADIF Log - 掃描 ADIF 紀錄錯誤 + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p></body></html> + <html><head/><body><p>立即切換到此發射訊息</p><p>按兩下重置為標準73訊息</p></body></html> - - Error Loading LotW Users Data - 載入 LotW 使用者資料錯誤 + Switch to this Tx message NOW +Double-click to reset to the standard 73 message + 立即切換到此發射訊息 +按兩下重置為標準73訊息 - - Error Writing WAV File - 寫入 WAV 檔案時錯誤 + + Tx Pct + 發送 Pct - - Enumerating audio devices - 列出音訊設備 + + Band Hopping + 波段跳躍 - - Configurations... - 設定檔案... + + Choose bands and times of day for band-hopping. + 選擇波段和一天之中的時間進行波段跳躍. - - - - - - - - - - - - - - - - - - - - Message - 訊息 + + Schedule ... + 時間排程 ... - - Error Killing jt9.exe Process - 錯誤終止 jt9.exe 程序 + + Upload decoded messages to WSPRnet.org. + 將解碼的訊息上傳至 WSPRnet.org. - - KillByName return code: %1 - 按結束名稱返回代碼: %1 + + Upload spots + 上傳 spots - - Error removing "%1" - 刪除時錯誤 "%1" + + <html><head/><body><p>6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol.</p></body></html> + <html><head/><body><p>6 位定位器會導致發送 2 個不同的訊息, 第二個包含完整定位器, 但只有哈希呼號,其他電臺必須解碼第一個一次, 然後才能在第二個中解碼您的呼叫. 如果此選項將避免兩個訊息協定, 則選中此選項僅發送 4 位定位器.</p></body></html> - - Click OK to retry - 單擊 確定 重試 + + 6 digit locators cause 2 different messages to be sent, the second contains the full locator but only a hashed callsign, other stations must have decoded the first once before they can decode your call in the second. Check this option to only send 4 digit locators if it will avoid the two message protocol. + 6 位定位器會導致發送 2 個不同的訊息, 第二個包含完整定位器, 但只有哈希呼號,其他電臺必須解碼第一個一次, 然後才能在第二個中解碼您的呼叫. 如果此選項將避免兩個訊息協定, 則選中此選項僅發送 4 位定位器. - - - Improper mode - 模式不正確 + + No own call decodes + 解碼中沒有自己的呼號 - - - File Open Error - 檔案開啟錯誤 + + Tx Next + 發送下一個訊息 - - - - - - Cannot open "%1" for append: %2 - 無法開啟 "%1" 用於附加: %2 + + Set Tx power in dBm (dB above 1 mW) as part of your WSPR message. + 將發送功率設定為 dBm (dB 高於 1 mW) 作為 WSPR 訊息的一部分. - - Error saving c2 file - 保存c2檔案錯誤 + + NB + - - Error in Sound Input - 聲音輸入錯誤 + + Max Drift + 最大漂移率 - - Error in Sound Output - 聲音輸出錯誤 + + + + + 3 + - - - Single-Period Decodes - 單週期解碼 + + 2m FT8 + - - - Average Decodes - 平均解碼 + + 2m + - - Change Operator - 變更操作員 + + + 20m FT4 + - - New operator: - 新操作員: + + 17m FT8 + - - Status File Error - 狀態檔案錯誤 + + 17m + - - - Cannot open "%1" for writing: %2 - 無法開啟 "%1" 用於寫入: %2 + + 10m FT8 + - - Decodes containing My Call - 解碼包含我的呼號 + + 10m + - - Subprocess Error - 子流程錯誤 + + 2m MSK144 + - - Subprocess failed with exit code %1 - 子流程失敗, 退出代碼為 %1 + + + 17m FT4 + - - - Running: %1 -%2 - 運行: %1 -%2 + + 30m FT8 + - - Subprocess error - 子進程錯誤 + + 30m + - - Reference spectrum saved - 儲存參考頻譜 + + 80m FT8 + - - Runaway Tx watchdog - 發射監管計時器 + + 80m + - - WD:%1m - WD:%1分 + + 4m FT8 + - - It is very important to avoid audio harmonics and distorted audio signals. -This is usually achieved by the following step-by-step approach: - -1. Select 'Fake it' in the Settings/Radio menu as your 'Split mode'. If your - rig does not support this, select 'Rig'. But really try to avoid 'None'! - -2. Set the transmission power of your transceiver to maximum. - -3. Set the Pwr slider to the minimum and click on the 'Tune' button. - -4. Observe the actual transmission power of your rig as well as ALC. - -5. Carefully increase the Pwr slider until you have reached the - maximum transmit powe of your transceiver. - -6. VERY IMPORTANT: Now reduce the Pwr slider until you reach approx. - 90% of your max. Tx power. ALC should be close to zero. - -7. This is the maximum audio level permitted with your setup. - Always stay with the Pwr slider below this max. value. - -If possible, check your transmission from time to time with a webSDR -to ensure the signal is clean and not distorted. - 避免音頻諧波和失真的音頻信號非常重要. -通常通過以下逐步方法實現: - -1.在 "電台設置" 中選擇 "軟體虛擬" 作為您的 "異頻模式". 如果你的 - 設置不支持此功能, 請選擇 "設備". 但是真的盡量避免 "無"! - -2.將設備的發射功率設置為最大. - -3.將功率滑塊設置為最小值, 然後單擊 "調諧" 按鈕. - -4.觀察你的設備和ALC的實際傳輸功率. - -5.小心地增加功率滑塊, 直到達到 - 你設備的最大發射功率. - -6.非常重要: 現在減少功率滑塊, 直到你達到大約. - 最大值的90%. 發射功率. ALC應該接近於零. - -7.這是您的設置允許的最大音量. - 始終保持功率滑塊低於此最大值. - -如果可能的話, 不時用網絡SDR檢查你的傳輸 -以確保信號幹凈且不失真. + + 4m + - - <b>Recommended Audio Settings</b> - <b>推薦的音訊設置</b> + + 12m FT8 + - - Invalid data in fmt.all at line %1 - 在 %1 行中 fmt.all 的錯誤資料 + + 12m + - - Good Calibration Solution - 良好的校準解決方案 + + 160m FT8 + - - <pre>%1%L2 ±%L3 ppm -%4%L5 ±%L6 Hz - -%7%L8 -%9%L10 Hz</pre> + + 160m - - Delete Calibration Measurements - 刪除校準測量值 + + + 30m FT4 + - - The "fmt.all" file will be renamed as "fmt.bak" - "fmt.all" 檔案將重新命名為 "fmt.bak" + + 70cm FT8 + - - No data read from disk. Wrong file format? - 沒有資料從磁碟讀取. 檔案格式錯誤? + + 70cm + - - Confirm Delete - 確認刪除 + + 60m FT8 + - - Are you sure you want to delete all *.wav and *.c2 files in "%1"? - 是否確認刪除所有 *.wav 和 *.c2 檔案在 "%1"? + + 60m + - - Keyboard Shortcuts - 鍵盤快速鍵 + + 6m FT8 + - - <table cellspacing=1> - <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> - <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> - <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> - <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> - <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> - <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> - <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> - <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> - <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> - <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: toggle "Call 1st")</td></tr> - <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> - <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> - <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> - <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> - <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> - <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> - <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> - <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> - <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> - <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> - <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> - <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> - <tr><td><b>Alt+C </b></td><td>Toggle "Call 1st" checkbox</td></tr> - <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> - <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> - <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> - <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> - <tr><td><b>Alt+E </b></td><td>Erase</td></tr> - <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> - <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> - <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> - <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> - <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> - <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> - <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> - <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> - <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> - <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> - <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> - <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> - <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> - <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> - <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> -</table> - Keyboard shortcuts help window contents - <table cellspacing=1> - <tr><td><b>Esc </b></td><td>停止發送,中止通聯,清除下一個呼叫隊列</td></tr> - <tr><td><b>F1 </b></td><td>在線用戶指南 (Alt: 發射 Tx6)</td></tr> - <tr><td><b>Shift+F1 </b></td><td>版權聲明</td></tr> - <tr><td><b>Ctrl+F1 </b></td><td>關於 WSJT-X</td></tr> - <tr><td><b>F2 </b></td><td>打開設置視窗 (Alt: 發射 Tx2)</td></tr> - <tr><td><b>F3 </b></td><td>顯示鍵盤快捷鍵 (Alt: 發射 Tx3)</td></tr> - <tr><td><b>F4 </b></td><td>清除DX呼號, DX網格, 發射信息 1-4 (Alt: 發射 Tx4)</td></tr> - <tr><td><b>Alt+F4 </b></td><td>退出程序</td></tr> - <tr><td><b>F5 </b></td><td>顯示特殊鼠標命令 (Alt: transmit Tx5)</td></tr> - <tr><td><b>F6 </b></td><td>打開目錄中下一個文件 (Alt: toggle "呼叫第 1")</td></tr> - <tr><td><b>Shift+F6 </b></td><td>直接解碼所有剩餘檔</td></tr> - <tr><td><b>F7 </b></td><td>顯示信息平均視窗</td></tr> - <tr><td><b>F11 </b></td><td>將發射頻率向下移動 1 赫茲</td></tr> - <tr><td><b>Ctrl+F11 </b></td><td>移動相同的 接收 和 發射頻率向下移動 1 赫茲</td></tr> - <tr><td><b>Shift+F11 </b></td><td>將發射頻率向下移動 60 赫茲 (FT8) 或 90 赫茲 (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F11 </b></td><td>將頻率向下移動 2000 赫茲</td></tr> - <tr><td><b>F12 </b></td><td>將接收頻率向上移動 1 赫茲</td></tr> - <tr><td><b>Ctrl+F12 </b></td><td>相同的接收和發射頻率向上 1 赫茲</td></tr> - <tr><td><b>Shift+F12 </b></td><td>將發射頻率向上移動 60 赫茲(FT8) or 90 赫茲 (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F12 </b></td><td>將頻率調高 2000 赫茲</td></tr> - <tr><td><b>Alt+1-6 </b></td><td>現在將傳輸設置為選項卡 1 上的此號碼</td></tr> - <tr><td><b>Ctl+1-6 </b></td><td>在選項卡 1 上將下一個傳輸設置為此號碼</td></tr> - <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> - <tr><td><b>Alt+B </b></td><td>切換 "最佳 S+P" 狀態</td></tr> - <tr><td><b>Alt+C </b></td><td>切換 "呼叫 CQ 強制呼叫第 1" 複選框</td></tr> - <tr><td><b>Alt+D </b></td><td>在通聯頻率再次解碼</td></tr> - <tr><td><b>Shift+D </b></td><td>全部解碼(兩個視窗)</td></tr> - <tr><td><b>Ctrl+E </b></td><td>打開 TX even/1st</td></tr> - <tr><td><b>Shift+E </b></td><td>關閉 TX even/1st</td></tr> - <tr><td><b>Alt+E </b></td><td>擦除</td></tr> - <tr><td><b>Ctrl+F </b></td><td>編輯自訂義文字資訊</td></tr> - <tr><td><b>Alt+G </b></td><td>生成標準訊息</td></tr> - <tr><td><b>Alt+H </b></td><td>停止發射</td></tr> - <tr><td><b>Ctrl+L </b></td><td>在資料庫中尋找呼號, 生成標準信息</td></tr> - <tr><td><b>Alt+M </b></td><td>監聽</td></tr> - <tr><td><b>Alt+N </b></td><td>切換 "啟用發射"視窗</td></tr> - <tr><td><b>Ctrl+O </b></td><td>打開 .wav 檔案</td></tr> - <tr><td><b>Alt+O </b></td><td>更換操作員</td></tr> - <tr><td><b>Alt+Q </b></td><td>開啟 "記錄通聯" 視窗</td></tr> - <tr><td><b>Ctrl+R </b></td><td>將 Tx4 訊息設定為 RRR(不在 FT4 中)</td></tr> - <tr><td><b>Alt+R </b></td><td>將 Tx4 信息設置為 RR73</td></tr> - <tr><td><b>Ctrl+Shift+R </b></td><td>刷新活動電臺視窗</td></tr> - <tr><td><b>Alt+S </b></td><td>停止監聽</td></tr> - <tr><td><b>Alt+T </b></td><td>切換調諧狀態</td></tr> - <tr><td><b>Alt+Z </b></td><td>清除掛起解碼器狀態</td></tr> -</table> + + 6m + - - Special Mouse Commands - 特殊滑鼠組合 + + + 40m FT4 + - - No more files to open. - 沒有要開啟的檔案. + + 15m FT8 + - - - Spotting to PSK Reporter unavailable - 無法發送報告至PSK Reporter + + 15m + - - Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. - 請選擇其他發送頻率. WSJT-X 不會故意傳輸另一個模式在 WSPR 30米子波段上. + + 40m FT8 + - - WSPR Guard Band - WSPR護衛頻帶 + + 40m + - - Scanned ADIF log, %1 worked-before records created. CTY: %2 - 掃描 ADIF 紀錄, %1 建立曾經通聯紀錄. CTY: %2 + + 20m FT8 + - - Please choose another dial frequency. -Must be 3Khz away from %1. -WSJT-X will not operate in Fox mode -overlapping the standard FT8 sub-bands. - 請選擇其他頻率. -必須3Khz距離%1. -WSJT-X 不會運行狐狸模式在 -重疊標準FT8 子頻帶. + + 20m + - - Fox Mode warning - 狐狸模式警告 + + Band Hopping + 波段跳躍 - - Last Tx: %1 - 最後發送: %1 + + H + 獵犬 - - If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: - -"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2024 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; and other members of the WSJT Development Group." - 如果您根據 GNU 通用公共許可證的條款合理使用 WSJT-X 的任何部分, 您必須在衍生作品的顯著位置顯示以下版權聲明: - -"WSJT-X 和相關程式的算法 原始程式碼 外觀和感覺, 以及 FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144模式的協定規範版權所有 (C) 2001-2023由以下一位或多位作者: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; 和WSJT開發組的其他成員." {441,?} {4,?} {8,?} {4,?} {6M?} {9,?} {65,?} {64,?} {65,?} {144 ?} {2001-2024 ?} {1J?} {4W?} {9A?} {3N?} {7M?} {9M?} {2S?} {9Q?} {2Y?} {9A?} + + Switch to MSK144 mode + 切換到MSK14模式 - - <table cellspacing=1> - <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> - <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> - <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> - <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> - <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> - <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> - <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> - <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> - <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> - <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: toggle "Call 1st")</td></tr> - <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> - <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> - <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> - <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> - <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> - <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> - <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> - <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> - <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> - <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> - <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> - <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> - <tr><td><b>Alt+C </b></td><td>Toggle "Call 1st" checkbox</td></tr> - <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> - <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> - <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> - <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> - <tr><td><b>Alt+E </b></td><td>Erase</td></tr> - <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> - <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> - <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> - <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> - <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> - <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> - <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> - <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> - <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> - <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> - <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> - <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> - <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> - <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> - <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> - <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> - -</table> - Keyboard shortcuts help window contents - <table cellspacing=1> - <tr><td><b>Esc </b></td><td>停止發送,中止通聯,清除下一個呼叫隊列</td></tr> - <tr><td><b>F1 </b></td><td>在線用戶指南 (Alt: 發射 Tx6)</td></tr> - <tr><td><b>Shift+F1 </b></td><td>版權聲明</td></tr> - <tr><td><b>Ctrl+F1 </b></td><td>關於 WSJT-X</td></tr> - <tr><td><b>F2 </b></td><td>打開設置視窗 (Alt: 發射 Tx2)</td></tr> - <tr><td><b>F3 </b></td><td>顯示鍵盤快捷鍵 (Alt: 發射 Tx3)</td></tr> - <tr><td><b>F4 </b></td><td>清除DX呼號, DX網格, 發射信息 1-4 (Alt: 發射 Tx4)</td></tr> - <tr><td><b>Alt+F4 </b></td><td>退出程序</td></tr> - <tr><td><b>F5 </b></td><td>顯示特殊鼠標命令 (Alt: transmit Tx5)</td></tr> - <tr><td><b>F6 </b></td><td>打開目錄中下一個文件 (Alt: toggle "呼叫第 1")</td></tr> - <tr><td><b>Shift+F6 </b></td><td>直接解碼所有剩餘檔</td></tr> - <tr><td><b>F7 </b></td><td>顯示信息平均視窗</td></tr> - <tr><td><b>F11 </b></td><td>將發射頻率向下移動 1 赫茲</td></tr> - <tr><td><b>Ctrl+F11 </b></td><td>移動相同的 接收 和 發射頻率向下移動 1 赫茲</td></tr> - <tr><td><b>Shift+F11 </b></td><td>將發射頻率向下移動 60 赫茲 (FT8) 或 90 赫茲 (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F11 </b></td><td>將頻率向下移動 2000 赫茲</td></tr> - <tr><td><b>F12 </b></td><td>將接收頻率向上移動 1 赫茲</td></tr> - <tr><td><b>Ctrl+F12 </b></td><td>相同的接收和發射頻率向上 1 赫茲</td></tr> - <tr><td><b>Shift+F12 </b></td><td>將發射頻率向上移動 60 赫茲(FT8) or 90 赫茲 (FT4)</td></tr> - <tr><td><b>Ctrl+Shift+F12 </b></td><td>將頻率調高 2000 赫茲</td></tr> - <tr><td><b>Alt+1-6 </b></td><td>現在將傳輸設置為選項卡 1 上的此號碼</td></tr> - <tr><td><b>Ctl+1-6 </b></td><td>在選項卡 1 上將下一個傳輸設置為此號碼</td></tr> - <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> - <tr><td><b>Alt+B </b></td><td>切換 "最佳 S+P" 狀態</td></tr> - <tr><td><b>Alt+C </b></td><td>切換 "呼叫 CQ 強制呼叫第 1" 複選框</td></tr> - <tr><td><b>Alt+D </b></td><td>在通聯頻率再次解碼</td></tr> - <tr><td><b>Shift+D </b></td><td>全部解碼(兩個視窗)</td></tr> - <tr><td><b>Ctrl+E </b></td><td>打開 TX even/1st</td></tr> - <tr><td><b>Shift+E </b></td><td>關閉 TX even/1st</td></tr> - <tr><td><b>Alt+E </b></td><td>擦除</td></tr> - <tr><td><b>Ctrl+F </b></td><td>編輯自訂義文字資訊</td></tr> - <tr><td><b>Alt+G </b></td><td>生成標準訊息</td></tr> - <tr><td><b>Alt+H </b></td><td>停止發射</td></tr> - <tr><td><b>Ctrl+I </b></td><td>將DX呼號添加到忽略清單</td></tr> - <tr><td><b>Ctrl+L </b></td><td>在資料庫中尋找呼號, 生成標準信息</td></tr> - <tr><td><b>Alt+M </b></td><td>監聽</td></tr> - <tr><td><b>Alt+N </b></td><td>切換 "啟用發射"視窗</td></tr> - <tr><td><b>Ctrl+O </b></td><td>打開 .wav 檔案</td></tr> - <tr><td><b>Alt+O </b></td><td>更換操作員</td></tr> - <tr><td><b>Alt+Q </b></td><td>開啟 "記錄通聯" 視窗</td></tr> - <tr><td><b>Ctrl+R </b></td><td>將 Tx4 訊息設定為 RRR(不在 FT4 中)</td></tr> - <tr><td><b>Alt+R </b></td><td>將 Tx4 信息設置為 RR73</td></tr> - <tr><td><b>Ctrl+Shift+R </b></td><td>刷新活動電臺視窗</td></tr> - <tr><td><b>Alt+S </b></td><td>停止監聽</td></tr> - <tr><td><b>Alt+T </b></td><td>切換調諧狀態</td></tr> - <tr><td><b>Alt+Z </b></td><td>清除掛起解碼器狀態</td></tr> -</table> - + + MSK + + + + + Switch to FT4 mode + 切換到FT4模式 + + + Rx + 接收 + + + + In Progress + 正在處理中 + + + + Queue + 隊列 + + + <html><head/><body><p>Toggle FT8 hound mode On/Off.<br> Right-click to toggle last used contest mode On/Off.</p></body></html> + <html><head/><body><p>啟用/停用 FT8獵犬模式.<br> 右鍵單擊可 啟用/停用 上次使用的競賽模式.</p></body></html> + + + Switch to FT8 mode.<br> Right-click to toggle SuperFox mode On/Off. + 切換到FT8模式.<br> 右鍵單擊以 打開/關閉 超級狐狸模式. + + + + <html><head/><body><p>Toggle a pure Tx tone On/Off <br>Right-click to tune rig</p></body></html> + <html><head/><body><p>打開/關閉 純發射音調<br >右鍵單擊以調整裝備</p></body></html> + + + + <html><head/><body><p>Enter a free text message.</p></body></html> + <html><head/><body><p>輸入自定義訊息.</p></body></html> + + + + Free Text + 自定義訊息 + + + + <html><head/><body><p>Transmit free text message at the next opportunity.</p></body></html> + <html><head/><body><p>下次發送自定義信息.</p></body></html> + + + + Send msg + 發送訊息 + + + + <html><head/><body><p>Maximum number of concurrent streams for Fox transmissions.</p></body></html> + <html><head/><body><p>狐狸傳輸的最大並發流數量.</p></body></html> + + + + <html><head/><body><p>Maximum number of callsigns to be displayed in the queue.</p></body></html> + <html><head/><body><p>隊列中顯示的最大呼號數.</p></body></html> + + + + <html><head/><body><p>Include a CQ message along with other messages.</p></body></html> + <html><head/><body><p>包括CQ訊息以及其他訊息.</p></body></html> + + + + <html><head/><body><p>Select a specific CQ message.</p></body></html> + <html><head/><body><p>選擇特定的CQ訊息.</p></body></html> + + + + <html><head/><body><p>Select a desired sort order for callsigns in the queue.</p></body></html> + <html><head/><body><p>為隊列中的呼號選擇所需的排序順序.</p></body></html> + + + <html><head/><body><p>Set the maximum permitted SNR for callers to be included in the queue.</p></body></html> + <html><head/><body><p>為要包括在隊列中的呼叫者設置最大允許信噪比.</p></body></html> + + + + <html><head/><body><p>Clear all queues.</p></body></html> + <html><head/><body><p>清除所有隊列.</p></body></html> + + + + Allow Dupes + 允許重複 + + + + 2m MSK + + + + <html><head/><body><p>Toggle band hopping On/Off. Band hopping occurs every other full minute. Changes to the checkboxes take effect immediately.<br>Right-click to test the default audio device.</p></body></html> + <html><head/><body><p>切換波段跳躍 開/關. 波段跳躍每隔一整分鐘發生一次. 對核取方塊的更改將立即生效.<br>單撃右鍵以測試默認音訊設備.</p></body></html> + + + + + 80m FT4 + + + + + File + 檔案 + + + + View + 檢視 + + + + Filters + 過濾 + + + + Decode + 解碼 + + + + Save + 儲存 + + + + Help + 說明 + + + + + Mode + 模式 + + + + Configurations + 設定 + + + + Tools + 工具 + + + + Exit + 關閉程式 + + + + About WSJT-X + 關於 WSJT-X + + + + Waterfall + 頻譜瀑布圖 + + + + Open + 開啟檔案 + + + + Ctrl+O + + + + + Open next in directory + 開啟下一個檔案 + + + + Decode remaining files in directory + 開啟剩餘檔案 + + + + Delete all *.wav && *.c2 files in SaveDir + 刪除所有 SaveDir目錄內 *.wav && *.c2 檔案 + + + + None + 不儲存 + + + + Save all + 儲存全部檔案 + + + + Online User Guide + 線上使用者指南 + + + + Keyboard shortcuts + 鍵盤快速鍵指南 + + + + Special mouse commands + 滑鼠快速鍵指南 + + + + JT9 + + + + + Save decoded + 儲存解碼檔案 + + + + + Normal + 正常 + + + + Deep + 深度 + + + + Erase ALL.TXT + 刪除 ALL.TXT + + + + Erase wsjtx_log.adi + 刪除通聯日誌 wsjtx_log.adi + + + + Erase wsjtx.log + 刪除 wsjtx.log + + + + Erase Ignore List + 刪除忽略清單 + + + + F7 + + + + Write ALL.TXT + 寫入 ALL.TXT + + + + Reduce false decodes + 减少錯誤解碼 + + + + Don't split ALL.TXT + 不分折 ALL.TXT + + + + Split ALL.TXT yearly + 分折每年 ALL.TXT + + + + Band Buttons + 波段按鈕 + + + + Quick-Start Guide to WSJT-X 2.7 and QMAP + WSJT-X 2.7 和 QMAP 快速入門指南 + + + + Diagnostic mode + 診斷模式 + + + + Default event logging + 默認事件記錄 + + + + Disable event logging + 禁用事件記錄 + + + Copy main text window to WSJT-X.txt + 將主文字視窗複製到 WSJT-X.txt + + + + Use Dark Style + 開啟黑夜模式 + + + + Erase list of Q65 callers + 删除Q65呼叫者清單 + + + FT4 NS (NCCC Sprints) + FT4 NS (NCCC 冲刺) + + + + Highlight callsigns worked before on band + 突出顯示在波段曾經通聯的呼號 + + + + Hide stations from Europe + 隱藏 歐洲 的電台 + + + + Hide stations from North America + 隱藏 北美洲 的電台 + + + + Hide stations from South America + 隱藏 南美洲 的電台 + + + + Hide stations from Asia + 隱藏 亞洲 的電台 + + + + Hide stations from Africa + 隱藏 非洲 的電台 + + + + Hide stations from Oceania + 隱藏 大洋洲 的電台 + + + + Hide stations from Antarctica + 隱藏 南極洲 的電台 + + + + Split ALL.TXT monthly + 分折每月 ALL.TXT + + + + Disable writing of ALL.TXT + 禁止寫入 ALL.TXT + + + + + JT65 + + + + + Astronomical data + 天文數據 + + + + List of Type 1 prefixes and suffixes + 型態 1 前置與後綴清單 + + + + Settings... + 設定... + + + + Local User Guide + 本地使用者指南 + + + + Open log directory + 開啟日誌檔案目錄 + + + + JT4 + + + + + Message averaging + 訊息平均值 + + + + Enable averaging + 平均值 + + + + Enable deep search + 開啟深度搜尋 + + + + WSPR + + + + Switch to FST4 mode + 切換到FST4模式 + + + Switch to WSPR mode + 切換到WSPR模式 + + + + Echo Graph + 回波圖 + + + + F8 + + + + + + Echo + + + + + EME Echo mode + EME Echo 模式 + + + + ISCAT + + + + + Fast Graph + 快速圖 + + + + &Download Samples ... + 下載範例檔(&D) ... + + + + <html><head/><body><p>Download sample audio files demonstrating the various modes.</p></body></html> + <html><head/><body><p>下載演示各種模式的示例音頻檔案.</p></body></html> + + + + MSK144 + + + + + QRA64 + + + + + Release Notes + 版本發行說明 + + + + Enable AP for DX Call + 開啟 AP 為 DX 呼叫 + + + + FreqCal + + + + + Measure reference spectrum + 測量參考頻譜 + + + + Measure phase response + 測量相位回應 + + + + Erase reference spectrum + 清除參考頻譜 + + + + Execute frequency calibration cycle + 執行頻率校準週期 + + + + Equalization tools ... + 均衡工具 ... + + + + + FT8 + + + + Toggle FT8 hound mode On/Off + 切換 FT8 獵犬模式 啟用/停用 + + + + <html><head/><body><p align="center"> 2015 Jun 17 </p><p align="center"> 01:23:45 </p></body></html> + + + + + + Enable AP + 啟用 AP + + + + Solve for calibration parameters + 修正校準參數 + + + + Copyright notice + 版權聲明 + + + + Shift+F1 + + + + + Fox log + 狐狸日誌 + + + + FT8 DXpedition Mode User Guide + FT8 遠征模式使用者指南 + + + + Reset Cabrillo log ... + 重置Cabrillo日誌 ... + + + + Color highlighting scheme + 提示顏色 + + + + Export Cabrillo log ... + 匯出Cabrillo日誌 ... + + + + Contest log + 競賽日誌 + + + + Erase WSPR hashtable + 清除 WSPR 哈希表 + + + + + FT4 + + + + + Quick-Start Guide to Q65 + Q65 快速入門指南 + + + + Auto Clear Avg after decode + 解碼後自動清除平均值 + + + + Quick-Start Guide to WSJT-X 2.5.0 and MAP65 3.0 + WSJT-X 2.5.0和MAP65 3.0快速入門指南 + + + + Rig Control Error + 無線電設備控制錯誤 + + + + + + Receiving + 接收 + + + + Do you want to reconfigure the radio interface? + 是否要重新配置無線電設備介面? + + + + Error Scanning ADIF Log + 掃描 ADIF 紀錄錯誤 + + + + Error Loading LotW Users Data + 載入 LotW 使用者資料錯誤 + + + + + + Decoder Error + + + + + The decoder subprocess exited unexpectedly. + + + + + jt9 exited unexpectedly with code %1. + + + + + + Error Writing WAV File + 寫入 WAV 檔案時錯誤 + + + + Enumerating audio devices + 列出音訊設備 + + + + Configurations... + 設定檔案... + + + + + + + + + + + + + + + + + + + Message + 訊息 + + + + Error Killing jt9.exe Process + 錯誤終止 jt9.exe 程序 + + + + KillByName return code: %1 + 按結束名稱返回代碼: %1 + + + + Error removing "%1" + 刪除時錯誤 "%1" + + + + Click OK to retry + 單擊 確定 重試 + + + + %1.wav: invalid sample count %2 + + + + + + Improper mode + 模式不正確 + + + + + File Open Error + 檔案開啟錯誤 + + + + + + + + Cannot open "%1" for append: %2 + 無法開啟 "%1" 用於附加: %2 + + + + Error saving c2 file + 保存c2檔案錯誤 + + + + Error in Sound Input + 聲音輸入錯誤 + + + + Error in Sound Output + 聲音輸出錯誤 + + + + + Single-Period Decodes + 單週期解碼 + + + + + Average Decodes + 平均解碼 + + + + Change Operator + 變更操作員 + + + + New operator: + 新操作員: + + + + Status File Error + 狀態檔案錯誤 + + + + + Cannot open "%1" for writing: %2 + 無法開啟 "%1" 用於寫入: %2 + + + + Decodes containing My Call + 解碼包含我的呼號 + + + + Subprocess Error + 子流程錯誤 + + + + Subprocess failed with exit code %1 + 子流程失敗, 退出代碼為 %1 + + + + + Running: %1 +%2 + 運行: %1 +%2 + + + + Subprocess error + 子進程錯誤 + + + Reference spectrum saved + 儲存參考頻譜 + + + Runaway Tx watchdog + 發射監管計時器 + + + WD:%1m + WD:%1分 + + + It is very important to avoid audio harmonics and distorted audio signals. +This is usually achieved by the following step-by-step approach: + +1. Select 'Fake it' in the Settings/Radio menu as your 'Split mode'. If your + rig does not support this, select 'Rig'. But really try to avoid 'None'! + +2. Set the transmission power of your transceiver to maximum. + +3. Set the Pwr slider to the minimum and click on the 'Tune' button. + +4. Observe the actual transmission power of your rig as well as ALC. + +5. Carefully increase the Pwr slider until you have reached the + maximum transmit powe of your transceiver. + +6. VERY IMPORTANT: Now reduce the Pwr slider until you reach approx. + 90% of your max. Tx power. ALC should be close to zero. + +7. This is the maximum audio level permitted with your setup. + Always stay with the Pwr slider below this max. value. + +If possible, check your transmission from time to time with a webSDR +to ensure the signal is clean and not distorted. + 避免音頻諧波和失真的音頻信號非常重要. +通常通過以下逐步方法實現: + +1.在 "電台設置" 中選擇 "軟體虛擬" 作為您的 "異頻模式". 如果你的 + 設置不支持此功能, 請選擇 "設備". 但是真的盡量避免 "無"! + +2.將設備的發射功率設置為最大. + +3.將功率滑塊設置為最小值, 然後單擊 "調諧" 按鈕. + +4.觀察你的設備和ALC的實際傳輸功率. + +5.小心地增加功率滑塊, 直到達到 + 你設備的最大發射功率. + +6.非常重要: 現在減少功率滑塊, 直到你達到大約. + 最大值的90%. 發射功率. ALC應該接近於零. + +7.這是您的設置允許的最大音量. + 始終保持功率滑塊低於此最大值. + +如果可能的話, 不時用網絡SDR檢查你的傳輸 +以確保信號幹凈且不失真. + + + <b>Recommended Audio Settings</b> + <b>推薦的音訊設置</b> + + + + Invalid data in fmt.all at line %1 + 在 %1 行中 fmt.all 的錯誤資料 + + + + Good Calibration Solution + 良好的校準解決方案 + + + + <pre>%1%L2 ±%L3 ppm +%4%L5 ±%L6 Hz + +%7%L8 +%9%L10 Hz</pre> + + + + + Delete Calibration Measurements + 刪除校準測量值 + + + + The "fmt.all" file will be renamed as "fmt.bak" + "fmt.all" 檔案將重新命名為 "fmt.bak" + + + + No data read from disk. Wrong file format? + 沒有資料從磁碟讀取. 檔案格式錯誤? + + + + Confirm Delete + 確認刪除 + + + + Are you sure you want to delete all *.wav and *.c2 files in "%1"? + 是否確認刪除所有 *.wav 和 *.c2 檔案在 "%1"? + + + + Keyboard Shortcuts + 鍵盤快速鍵 + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: toggle "Call 1st")</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Toggle "Call 1st" checkbox</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> +</table> + Keyboard shortcuts help window contents + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>停止發送,中止通聯,清除下一個呼叫隊列</td></tr> + <tr><td><b>F1 </b></td><td>在線用戶指南 (Alt: 發射 Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>版權聲明</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>關於 WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>打開設置視窗 (Alt: 發射 Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>顯示鍵盤快捷鍵 (Alt: 發射 Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>清除DX呼號, DX網格, 發射信息 1-4 (Alt: 發射 Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>退出程序</td></tr> + <tr><td><b>F5 </b></td><td>顯示特殊鼠標命令 (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>打開目錄中下一個文件 (Alt: toggle "呼叫第 1")</td></tr> + <tr><td><b>Shift+F6 </b></td><td>直接解碼所有剩餘檔</td></tr> + <tr><td><b>F7 </b></td><td>顯示信息平均視窗</td></tr> + <tr><td><b>F11 </b></td><td>將發射頻率向下移動 1 赫茲</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>移動相同的 接收 和 發射頻率向下移動 1 赫茲</td></tr> + <tr><td><b>Shift+F11 </b></td><td>將發射頻率向下移動 60 赫茲 (FT8) 或 90 赫茲 (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>將頻率向下移動 2000 赫茲</td></tr> + <tr><td><b>F12 </b></td><td>將接收頻率向上移動 1 赫茲</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>相同的接收和發射頻率向上 1 赫茲</td></tr> + <tr><td><b>Shift+F12 </b></td><td>將發射頻率向上移動 60 赫茲(FT8) or 90 赫茲 (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>將頻率調高 2000 赫茲</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>現在將傳輸設置為選項卡 1 上的此號碼</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>在選項卡 1 上將下一個傳輸設置為此號碼</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>切換 "最佳 S+P" 狀態</td></tr> + <tr><td><b>Alt+C </b></td><td>切換 "呼叫 CQ 強制呼叫第 1" 複選框</td></tr> + <tr><td><b>Alt+D </b></td><td>在通聯頻率再次解碼</td></tr> + <tr><td><b>Shift+D </b></td><td>全部解碼(兩個視窗)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>打開 TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>關閉 TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>擦除</td></tr> + <tr><td><b>Ctrl+F </b></td><td>編輯自訂義文字資訊</td></tr> + <tr><td><b>Alt+G </b></td><td>生成標準訊息</td></tr> + <tr><td><b>Alt+H </b></td><td>停止發射</td></tr> + <tr><td><b>Ctrl+L </b></td><td>在資料庫中尋找呼號, 生成標準信息</td></tr> + <tr><td><b>Alt+M </b></td><td>監聽</td></tr> + <tr><td><b>Alt+N </b></td><td>切換 "啟用發射"視窗</td></tr> + <tr><td><b>Ctrl+O </b></td><td>打開 .wav 檔案</td></tr> + <tr><td><b>Alt+O </b></td><td>更換操作員</td></tr> + <tr><td><b>Alt+Q </b></td><td>開啟 "記錄通聯" 視窗</td></tr> + <tr><td><b>Ctrl+R </b></td><td>將 Tx4 訊息設定為 RRR(不在 FT4 中)</td></tr> + <tr><td><b>Alt+R </b></td><td>將 Tx4 信息設置為 RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>刷新活動電臺視窗</td></tr> + <tr><td><b>Alt+S </b></td><td>停止監聽</td></tr> + <tr><td><b>Alt+T </b></td><td>切換調諧狀態</td></tr> + <tr><td><b>Alt+Z </b></td><td>清除掛起解碼器狀態</td></tr> +</table> + + + + Special Mouse Commands + 特殊滑鼠組合 + + + + No more files to open. + 沒有要開啟的檔案. + + + Spotting to PSK Reporter unavailable + 無法發送報告至PSK Reporter + + + + Please choose another Tx frequency. WSJT-X will not knowingly transmit another mode in the WSPR sub-band on 30m. + 請選擇其他發送頻率. WSJT-X 不會故意傳輸另一個模式在 WSPR 30米子波段上. + + + + WSPR Guard Band + WSPR護衛頻帶 + + + + Scanned ADIF log, %1 worked-before records created. CTY: %2 + 掃描 ADIF 紀錄, %1 建立曾經通聯紀錄. CTY: %2 + + + + The decoder subprocess could not be stopped. + + + + + The decoder subprocess could not be restarted. + + + + + Application status + + + + + Current WSJT-X status messages and operating indicators. + + + + + Transmit status + + + + + Configuration + + + + + Decode count + + + + + Last transmitted message + + + + + Power and SWR status + + + + + Decode progress + + + + + Progress for the current decode operation. + + + + + Transmit watchdog + + + + + The selected transmit message cannot be encoded. Enable Tx has been turned off. Edit the selected message or check station settings before trying again. + + + + + Tx message cannot be encoded; Enable Tx is off + + + + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2026 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; Roger Rehr, W3SZ; John Nelson, G4KLA; Charlie Suckling, DL3WDG; Terrell Deppe, KJ5HST; and other members of the WSJT Development Group." + + + + + EME Chart + + + + + Select Year + + + + + FT8 input completion was rejected: automated=%1 awaiting=%2 frames=%3. + + + + + Unable to flush the final FT8 downsampling block. + + + + + FT8 input completed with %1 of %2 samples in the decode buffer. + + + + + FT8 decoding is running behind; early passes are temporarily reduced. + + + + + FT8 decoding caught up; configured early passes restored. + + + + + + PSK Reporter spot queue full; oldest spot dropped + + + + + Please choose another dial frequency. +Must be 3Khz away from %1. +WSJT-X will not operate in Fox mode +overlapping the standard FT8 sub-bands. + 請選擇其他頻率. +必須3Khz距離%1. +WSJT-X 不會運行狐狸模式在 +重疊標準FT8 子頻帶. + + + + Please choose another dial frequency. +WSJT-X will not operate in Fox mode +overlapping the WSPR sub-bands. + + + + + Fox Mode warning + 狐狸模式警告 + + + + Last Tx: %1 + 最後發送: %1 + + + + A QSO between two stations with nonstandard callsigns won't work. + +Auto Seq would get stuck in an endless loop. + + + + + %1 shorthand-message mode + + + + + RR73 is not available in %1. Tx4 uses RRR in this mode. + + + + + Wait & Pounce requires a CQ response mode. +Change CQ: None to another option. + + + + If you make fair use of any part of WSJT-X under terms of the GNU General Public License, you must display the following copyright notice prominently in your derivative work: + +"The algorithms, source code, look-and-feel of WSJT-X and related programs, and protocol specifications for the modes FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) 2001-2024 by one or more of the following authors: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; and other members of the WSJT Development Group." + 如果您根據 GNU 通用公共許可證的條款合理使用 WSJT-X 的任何部分, 您必須在衍生作品的顯著位置顯示以下版權聲明: + +"WSJT-X 和相關程式的算法 原始程式碼 外觀和感覺, 以及 FSK441, FST4, FT8, JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144模式的協定規範版權所有 (C) 2001-2023由以下一位或多位作者: Joseph Taylor, K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; 和WSJT開發組的其他成員." {441,?} {4,?} {8,?} {4,?} {6M?} {9,?} {65,?} {64,?} {65,?} {144 ?} {2001-2024 ?} {1J?} {4W?} {9A?} {3N?} {7M?} {9M?} {2S?} {9Q?} {2Y?} {9A?} + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: toggle "Call 1st")</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Toggle "Call 1st" checkbox</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> + +</table> + Keyboard shortcuts help window contents + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>停止發送,中止通聯,清除下一個呼叫隊列</td></tr> + <tr><td><b>F1 </b></td><td>在線用戶指南 (Alt: 發射 Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>版權聲明</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>關於 WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>打開設置視窗 (Alt: 發射 Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>顯示鍵盤快捷鍵 (Alt: 發射 Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>清除DX呼號, DX網格, 發射信息 1-4 (Alt: 發射 Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>退出程序</td></tr> + <tr><td><b>F5 </b></td><td>顯示特殊鼠標命令 (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>打開目錄中下一個文件 (Alt: toggle "呼叫第 1")</td></tr> + <tr><td><b>Shift+F6 </b></td><td>直接解碼所有剩餘檔</td></tr> + <tr><td><b>F7 </b></td><td>顯示信息平均視窗</td></tr> + <tr><td><b>F11 </b></td><td>將發射頻率向下移動 1 赫茲</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>移動相同的 接收 和 發射頻率向下移動 1 赫茲</td></tr> + <tr><td><b>Shift+F11 </b></td><td>將發射頻率向下移動 60 赫茲 (FT8) 或 90 赫茲 (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>將頻率向下移動 2000 赫茲</td></tr> + <tr><td><b>F12 </b></td><td>將接收頻率向上移動 1 赫茲</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>相同的接收和發射頻率向上 1 赫茲</td></tr> + <tr><td><b>Shift+F12 </b></td><td>將發射頻率向上移動 60 赫茲(FT8) or 90 赫茲 (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>將頻率調高 2000 赫茲</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>現在將傳輸設置為選項卡 1 上的此號碼</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>在選項卡 1 上將下一個傳輸設置為此號碼</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>切換 "最佳 S+P" 狀態</td></tr> + <tr><td><b>Alt+C </b></td><td>切換 "呼叫 CQ 強制呼叫第 1" 複選框</td></tr> + <tr><td><b>Alt+D </b></td><td>在通聯頻率再次解碼</td></tr> + <tr><td><b>Shift+D </b></td><td>全部解碼(兩個視窗)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>打開 TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>關閉 TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>擦除</td></tr> + <tr><td><b>Ctrl+F </b></td><td>編輯自訂義文字資訊</td></tr> + <tr><td><b>Alt+G </b></td><td>生成標準訊息</td></tr> + <tr><td><b>Alt+H </b></td><td>停止發射</td></tr> + <tr><td><b>Ctrl+I </b></td><td>將DX呼號添加到忽略清單</td></tr> + <tr><td><b>Ctrl+L </b></td><td>在資料庫中尋找呼號, 生成標準信息</td></tr> + <tr><td><b>Alt+M </b></td><td>監聽</td></tr> + <tr><td><b>Alt+N </b></td><td>切換 "啟用發射"視窗</td></tr> + <tr><td><b>Ctrl+O </b></td><td>打開 .wav 檔案</td></tr> + <tr><td><b>Alt+O </b></td><td>更換操作員</td></tr> + <tr><td><b>Alt+Q </b></td><td>開啟 "記錄通聯" 視窗</td></tr> + <tr><td><b>Ctrl+R </b></td><td>將 Tx4 訊息設定為 RRR(不在 FT4 中)</td></tr> + <tr><td><b>Alt+R </b></td><td>將 Tx4 信息設置為 RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>刷新活動電臺視窗</td></tr> + <tr><td><b>Alt+S </b></td><td>停止監聽</td></tr> + <tr><td><b>Alt+T </b></td><td>切換調諧狀態</td></tr> + <tr><td><b>Alt+Z </b></td><td>清除掛起解碼器狀態</td></tr> +</table> + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Shift-click</b> to set Tx frequency.<br/> + <b>Ctrl-click</b> or <b>Right-click</b> to set Rx and Tx frequencies.<br/> + <b>Double-click</b> to also decode at Rx frequency. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call,<br/> + locator to Dx Grid, change Rx and Tx frequency to<br/> + decoded signal's frequency, and generate standard<br/> + messages.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message<br/> + is your own call, Tx frequency is not changed unless <br/> + <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase QSO window.<br/> + <b>Double-click</b> to erase QSO and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> +</table> + Mouse commands help window contents + <table cellpadding=5> + <tr> + <th align="right">點擊</th> + <th align="left">行動</th> + </tr> + <tr> + <td align="right">瀑布圖:</td> + <td><b>Click</b> 設定接收頻率.<br/> + <b>Shift-click</b> 設定發送頻率.<br/> + <b>Ctrl-click</b> or <b>右鍵單擊</b> 設定接收和發送頻率.<br/> + <b>Double-click</b> 在接收頻率解碼.<br/> + </td> + </tr> + <tr> + <td align="right">解碼文字:</td> + <td><b>Double-click</b> 解碼的文字將第二個呼號複製到 Dx 呼號,<br/> + 定位器到 Dx 網格,將接收和發送頻率更改為<br/> + 解碼信號的頻率, 並生成<br/> + 標準訊息.<br/> + 如果 <b>保持發送頻率</b> 已選中或在消息中顯示第一個呼號<br/> + 是你自己的呼叫, 發送頻率不更改,除非 <br/> + <b>Ctrl</b> 鍵被按下.<br/> + </td> + </tr> + <tr> + <td align="right">清除按鈕:</td> + <td><b>點擊</b> 清除通聯視窗.<br/> + <b>按兩下</b> 清除通聯視窗和波段活動視窗. + </td> + </tr> +</table> + + + <table cellpadding=5> + <tr> + <th align="right">Click on</th> + <th align="left">Action</th> + </tr> + <tr> + <td align="right">Waterfall:</td> + <td><b>Click</b> to set Rx frequency.<br/> + <b>Right-click</b> to set Tx frequency.<br/> + <b>Double-right-click</b> to set Rx and Tx frequencies. + </td> + </tr> + <tr> + <td align="right">Decoded text:</td> + <td><b>Double-click</b> to copy second callsign to Dx Call, locator to Dx Grid, change Rx<br/> + and Tx frequency to decoded signal's frequency, and generate standard messages.<br/> + Hold down <b>Alt</b> to prevent Tx from being enabled on <b>double-click</b>.<br/> + If <b>Hold Tx Freq</b> is checked or first callsign in message is your<br/> + own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. + </td> + </tr> + <tr> + <td align="right">H Button:</td> + <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to toggle last used Special Operating Activity On/Off. + </td> + </tr> + <tr> + <td align="right">Q65 Button:</td> + <td><b>Click</b> to switch to Q65 Mode.<br/> + <b>Right-click</b> to switch to Q65 Pileup Mode. + </td> + </tr> + <tr> + <td align="right">JT65 Button:</td> + <td><b>Click</b> to switch to JT65 Mode.<br/> + <b>Right-click</b> to switch to JT9 Mode. + </td> + </tr> + <tr> + <td align="right">Tx5 Button:</td> + <td><b>Right-click</b> to retain Tx5 free text. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>Right-click</b> to freeze the state of the checkbox.<br/> + <b>Right-click on the FT8 Button</b> to unfreeze. + </td> + </tr> + <tr> + <td align="right">Enable Tx Button:</td> + <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> + <b>Right-click</b> to toggle Wait & Pounce On/Off. + </td> + </tr> + <tr> + <td align="right">Erase button:</td> + <td><b>Click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows.<br/> + If <b>Alternate Erase button behavior</b> is checked:<br/> + <b>Click</b> to erase Band Activity window.<br/> + <b>Right-click</b> to erase Rx Frequency window.<br/> + <b>Double-click</b> to erase Rx Frequency and Band Activity windows. + </td> + </tr> + <tr> + <td align="right">DX Call Button:</td> + <td><b>Click</b> to toggle Wait & Call On/Off.<br/> + <b>Right-click</b> to clear the Dx Call, Dx Grid and Std Msgs. + </td> + </tr> + <tr> + <td align="right">Lookup Button:</td> + <td><b>Click</b> to search for callsign in database.<br/> + <b>Right-click</b> to search for Dx Call on qrz.com. + </td> + </tr> + <tr> + <td align="right">Add Button:</td> + <td><b>Click</b> to add callsign and locator to database.<br/> + <b>Right-click</b> to search for Dx Call on hamqth.com. + </td> + </tr> + <tr> + <td align="right">Ignore Button:</td> + <td><b>Click</b> to add callsign to the Ignore List.<br/> + <b>Right-click</b> to search for Dx Call on qrzcq.com. + </td> + </tr> + <tr> + <td align="right">Band Buttons:</td> + <td><b>Click</b> to toggle band / mode default frequencies.<br/> + <b>Right-click</b> to toggle FT8 DXpedition frequencies. + </td> + </tr> +</table> + Mouse commands help window contents + <table cellpadding=5> + <tr> + <th align="right">點擊</th> + <th align="left">作用</th> + </tr> + <tr> + <td align="right">瀑布:</td> + <td><b>Click</b> 設置接收頻率.<br/> + <b>右鍵單擊</b> 設置發射頻率.<br/> + <b>右鍵雙擊</b> 設置接收和發射頻率. + </td> + </tr> + <tr> + <td align="right">解碼文本:</td> + <td><b>雙擊</b> 將第二個呼號覆制到Dx呼號, 將網格定位覆制到Dx網格,<br/> + 請更改接收和發射頻率轉換為解碼信號的頻率, 並生成標準消息.<br/> + 按住 <b>Alt</b> 鍵可防止 <b>雙擊</b> 時啟用發射.<br/> + 如果 <b>保持發射頻率</b> 被選中或者第一個回答您的呼叫<br/> + 自己呼叫l, 除非按住 <b>Ctrl</b> 否則不改變發射頻率. + </td> + </tr> + <tr> + <td align="right">H 按鈕:</td> + <td><b>單擊</b> 切換 FT8 獵犬模式 啟用/停用.<br/> + <b>右鍵單擊</b> 切換上次使用的特殊操作活動 啟用/停用. + </td> + </tr> + <tr> + <td align="right">Q65 按鈕:</td> + <td><b>單擊</b> 切換到 Q65 模式.<br/> + <b>右鍵單擊</b> 切換到 Q65 堆積模式. + </td> + </tr> + <tr> + <td align="right">JT65 按鈕:</td> + <td><b>單擊</b>切換到 JT65 模式.<br/> + <b>右鍵單擊</b> 切換到 JT9 模式. + </td> + </tr> + <tr> + <td align="right">Tx5 按鈕n:</td> + <td><b>右鍵</b> 要保留Tx5自定義文本. + </td> + </tr> + <tr> + <td align="right">Tx Even/1st:</td> + <td><b>右鍵</b>凍結覆選框的狀態.<br/> + <b>右鍵單擊 FT8 按鈕</b> 解凍. + </td> + </tr> + <tr> + <td align="right">啟用發射按鈕:</td> + <td><b>單擊</b>切換 啟用/停用 自動發射模式.<br/> + <b>右鍵單擊</b> 切換 啟用/停用 等待和突襲. + </td> + </tr> + <tr> + <td align="right">擦除 按鈕:</td> + <td><b>單擊</b> 擦除接收信息窗.<br/> + <b>雙擊</b> 擦除接收信息窗 和 波段活動窗.<br/> + 如果 <b>替代擦除按鈕行為</b> 已選:<br/> + <b>單擊</b> 擦除 波段活動窗.<br/> + <b>右鍵單擊</b> 擦除接收信息窗.<br/> + <b>雙擊</b> 擦除接收信息窗 和 波段活動窗. + </td> + </tr> + <tr> + <td align="right">DX 呼號 按鈕:</td> + <td><b>單擊</b> 切換等待和呼叫 啟用/停用.<br/> + <b>右鍵單擊</b> 要清除Dx呼號、Dx網格 和 標準消息. + </td> + </tr> + <tr> + <td align="right">查找 按鈕:</td> + <td><b>右鍵單擊</b> 或 <b>雙擊</b> 在 QRZ.com 上搜索DX 呼號.<br/> + <b>Crtl + 右鍵單擊</b> 在 hamqth.com 上搜索DX 呼號.<br/> + <b>Alt + 右鍵單擊</b> 在 qrzcq.com 上搜索DX 呼號. + </td> + </tr> + <tr> + <td align="right">增加按鈕:</td> + <td><b>右鍵</b> 在 hamqth.com 上搜索 DX 呼號. + </td> + </tr> + <tr> + <td align="right">忽略按鈕:</td> + <td><b>單擊</b> 將呼號添加到忽略清單.<br/> + <b>右鍵</b> 在 qrzcq.com 上搜索 Dx 呼號. + </td> + </tr> + <tr> + <td align="right">波段按鈕:</td> + <td><b>單擊</b> 切換 波段/模式 默認頻率.<br/> + <b>右鍵</b> 切換 FT8 DX遠征頻率. + </td> + </tr> +</table> + + + + This station transmits in the same time slot as you do. + +You must not start a QSO if both stations Tx even/1st +or Tx odd/2nd, while the Tx even/1st checkbox is disabled. + +Click the MSK144 mode button to re-enable the Tx even/1st +checkbox, or choose another station. + 這個電臺和你在同一個時隙發射. + +如果兩個電臺都發送偶數/第一, 則不能開始QSO +或者發射 奇數/第二, 同時禁用發射 偶數第一 核取方塊 + +點擊MSK144按鈕, 重新啟用 發射 偶數/第一 +核取方塊, 或選擇其他電臺. + + + + Should you switch to EU VHF Contest mode? + +To do so, check 'Special operating activity' and +'EU VHF Contest' on the Settings | Advanced tab. + 是否應切換到 歐洲 VHF 競賽模式? + +為此, 請檢查 '特殊操作活動' 和 +設定高級選項卡上的 '歐洲 VHF 競賽'. + + + + Should you switch to ARRL Field Day mode? + 是否切換至 ARRL Field Day 模式? + + + + Should you switch to RTTY contest mode? + 是否切換至 RTTY 競賽模式? + + + + + Decoder is starting; decode request skipped. + + + + + + + + Add to CALL3.TXT + 新增到 CALL3.TXT + + + + Please enter a valid grid locator + 請輸入有效的網格定位 + + + + Cannot open "%1" for read/write: %2 + 無法開啟 "%1" 用於讀/寫: %2 + + + + %1 +is already in CALL3.TXT, do you wish to replace it? + %1 +CALL3.TXT已存在, 要替換檔案嗎? + + + + Warning: DX Call field is empty. + 警告: DX 呼號欄位為空. + + + + SuperFox free text may only contain spaces, digits, uppercase letters, and + - . / ?. + + + + + Log file error + 日誌檔案錯誤 + + + + Cannot open "%1" + 無法開啟 "%1" + + + + Error sending log to N1MM + 將日誌傳送至 N1MM 時發生錯誤 + + + + Write returned "%1" + 寫入返回 "%1" + + + + DX call + + + + + Callsign of station to be worked. + + + + + DX grid + + + + + Locator of station to be worked. + + + + + Wait and Call + + + + + Lookup DX call + + + + + Add DX call + + + + + Ignore DX call + + + + + CQ response mode + + + + + Selects a station automatically from replies to your pending CQ after Enable Tx is armed in the current receive period, or from CQ messages for Wait & Pounce. + + + + + Transmit audio frequency + + + + + Receive audio frequency + + + + + Signal report + + + + + Operating band + + + + + Operating band text + + + + + Transmit power attenuation + + + + + Adjust Tx audio level attenuation. + + + + + Show or hide the menu bar. + + + + + Rig control status + + + + + Hound mode + + + + + Toggle FT8 hound mode. Right-click to toggle SuperFox mode. + + + + + Message panel selector + + + + + Switches between standard messages, Fox queue, and band hopping pages. Press 1, 2, or 3 while focused to select a page. + + + + + Standard messages + + + + + Fox queue + + + + + + Band hopping + + + + + Standard messages page + + + + + Fox queue page + + + + + Band hopping page + + + + + Hound queue + + + + + Queued Hound callers available for Fox transmissions. + + + + + Fox transmissions in progress + + + + + Hound callers currently in progress for Fox transmissions. + + + + + Hound queue sort order + + + + + Hound queue list size + + + + + Fox transmission slots + + + + + Fox CQ message + + + + + Reset Fox queues + + + + + Fox free text + + + + + Send Fox free text + + + + + Enable FT8 QRG 1 + + + + + Enable FT8 QRG 2 + + + + + Enable FT8 QRG 3 + + + + + Enable FT8 QRG 4 + + + + + Enable FT8 QRG 5 + + + + + Enable FT8 QRG 6 + + + + + Enable FT8 QRG 7 + + + + + Enable FT8 QRG 8 + + + + + FT8 QRG 1 frequency + + + + + FT8 QRG 2 frequency + + + + + FT8 QRG 3 frequency + + + + + FT8 QRG 4 frequency + + - - <table cellpadding=5> - <tr> - <th align="right">Click on</th> - <th align="left">Action</th> - </tr> - <tr> - <td align="right">Waterfall:</td> - <td><b>Click</b> to set Rx frequency.<br/> - <b>Shift-click</b> to set Tx frequency.<br/> - <b>Ctrl-click</b> or <b>Right-click</b> to set Rx and Tx frequencies.<br/> - <b>Double-click</b> to also decode at Rx frequency. - </td> - </tr> - <tr> - <td align="right">Decoded text:</td> - <td><b>Double-click</b> to copy second callsign to Dx Call,<br/> - locator to Dx Grid, change Rx and Tx frequency to<br/> - decoded signal's frequency, and generate standard<br/> - messages.<br/> - If <b>Hold Tx Freq</b> is checked or first callsign in message<br/> - is your own call, Tx frequency is not changed unless <br/> - <b>Ctrl</b> is held down. - </td> - </tr> - <tr> - <td align="right">Erase button:</td> - <td><b>Click</b> to erase QSO window.<br/> - <b>Double-click</b> to erase QSO and Band Activity windows. - </td> - </tr> - <tr> - <td align="right">Q65 Button:</td> - <td><b>Click</b> to switch to Q65 Mode.<br/> - <b>Right-click</b> to switch to Q65 Pileup Mode. - </td> - </tr> - <tr> - <td align="right">JT65 Button:</td> - <td><b>Click</b> to switch to JT65 Mode.<br/> - <b>Right-click</b> to switch to JT9 Mode. - </td> - </tr> + + FT8 QRG 5 frequency + + + + + FT8 QRG 6 frequency + + + + + FT8 QRG 7 frequency + + + + + FT8 QRG 8 frequency + + + + + Tx1 message + + + + + Tx2 message + + + + + Tx3 message + + + + + Tx4 message + + + + + Tx5 message macro + + + + + Tx6 message + + + + + Tx5 message macro text + + + + + Select Tx1 for next transmission + + + + + Select Tx2 for next transmission + + + + + Select Tx3 for next transmission + + + + + Select Tx4 for next transmission + + + + + Select Tx5 for next transmission + + + + + Select Tx6 for next transmission + + + + + Transmit Tx1 now + + + + + Transmit Tx2 now + + + + + Transmit Tx3 now + + + + + Transmit Tx4 now + + + + + Transmit Tx5 now + + + + + Transmit Tx6 now + + + + + Stations calling DXpedition %1 + 呼叫遠征電臺 %1 + + + + Show Already Worked + + + + + All Decodes + + + + + QSO Frequency + + + + + Directional calls not yet supported in SuperFox mode + + + + + TOTP: No seed entered in fox configuration to generate verification code. + + + + + SuperFox cannot queue %1: unsupported callsign. + + + + + TOTP SF: seed not long enough. + + + + + SuperFox Tx stopped: invalid message tokens. + + + + + SuperFox Tx stopped: invalid verification code. + + + + + SuperFox Tx stopped: invalid CQ call or grid. + + + + + SuperFox Tx stopped: invalid callsign. + + + + + SuperFox Tx stopped: report is outside the SuperFox range. + + + + + SuperFox Tx stopped: free text contains unsupported characters. + + + + + SuperFox Tx stopped: message could not be packed. + + + + + Super Fox + 超級狐狸 + + + + Super Hound + 超級獵犬 + + + + Hound + 獵犬 + + + + Tx Messages + 發送訊息 + + + + + + + + + Confirm Erase + 確認清除 + + + + Are you sure you want to erase file ALL.TXT? + 是否確實要清除 ALL.Txt 檔案? + + + + Are you sure you want to erase the list of Q65 callers? + 是否確定要清除 Q65呼叫者表? + + + + + Confirm Reset + 確認重置 + + + + Are you sure you want to erase your contest log? + 是否確實要清除競賽日誌? + + + + Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. + 執行此動作將移除目前競賽的所有通聯紀錄. 它們將保留在 ADIF 日誌檔案中, 但無法匯出到您的Cabrillo Log中. + + + + Cabrillo Log saved + Cabrillo日誌已儲存 + + + + Are you sure you want to erase file wsjtx_log.adi? + 是否確定要清除 wsjtx_log.adi 檔案? + + + + Are you sure you want to erase the WSPR hashtable? + 是否確定要清除 WSPR 哈希表? + + + + %1 W + %1 瓦 + + + + SWR > 2.5 !!! + +Transmission was stopped + +Check your antenna + 駐波比大於 2.5 !!! + +發射已停止 + +檢查你的天線 + + + + Tune digital gain + 調諧數位增益 + + + + Transmit digital gain + 傳輸數位增益 + + + + Prefixes + 前綴 + + + + Network Error + 網路錯誤 + + + + Error: %1 +UDP server %2:%3 + 錯誤: %1 +UDP 伺服器 %2:%3 + + + + + File Error + 檔案錯誤 + + + + + Stop transmitting or tuning before changing the dial frequency. + + + + + + Measuring reference spectrum: %1 s remaining + + + + + Reference spectrum measurement stopped; Ref Spec is available + + + + + Reference spectrum saved; Ref Spec is available + + + + + Reference spectrum measurement stopped; no reference spectrum is available + + + + + Phase Training Disabled + 關閉階段訓練 + + + + Phase Training Enabled + 開啟階段訓練 + + + + Cannot remove "%1": %2 + + + + + WD:0m + WD:溢出 + + + + Runaway Tx watchdog + 發射監管計時器 + + + + WD:%1m + WD:%1分 + + + + + Log File Error + 日誌檔案錯誤 + + + + Are you sure you want to clear the QSO queues? + 是否要清除通聯佇列? + + + + + + Free Text Message + 自定義訊息 + + + + + Message: + 訊息: + + + + Are you sure you want to erase the Tx Log? + 您確定要刪除發射紀錄嗎? + + + + "%1" added to Ignore List + "%1" 已増加到忽略清單 + + + + Are you sure you want to erase the Ignore List? + 是否確實要清除忽略清單? + + + QCustomPlot plot examples + QCustomPlot plot範例 + + + + Band hopping has no selected frequencies. + + + + + <table cellspacing=1> + <tr><td><b>Esc </b></td><td>Stop Tx, abort QSO, clear next-call queue</td></tr> + <tr><td><b>F1 </b></td><td>Online User's Guide (Alt: transmit Tx6)</td></tr> + <tr><td><b>Shift+F1 </b></td><td>Copyright Notice</td></tr> + <tr><td><b>Ctrl+F1 </b></td><td>About WSJT-X</td></tr> + <tr><td><b>F2 </b></td><td>Open settings window (Alt: transmit Tx2)</td></tr> + <tr><td><b>F3 </b></td><td>Display keyboard shortcuts (Alt: transmit Tx3)</td></tr> + <tr><td><b>F4 </b></td><td>Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)</td></tr> + <tr><td><b>Alt+F4 </b></td><td>Exit program</td></tr> + <tr><td><b>F5 </b></td><td>Display special mouse commands (Alt: transmit Tx5)</td></tr> + <tr><td><b>F6 </b></td><td>Open next file in directory (Alt: cycle CQ response mode)</td></tr> + <tr><td><b>Shift+F6 </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>F7 </b></td><td>Display Message Averaging window</td></tr> + <tr><td><b>F11 </b></td><td>Move Rx frequency down 1 Hz</td></tr> + <tr><td><b>Ctrl+F11 </b></td><td>Move identical Rx and Tx frequencies down 1 Hz</td></tr> + <tr><td><b>Shift+F11 </b></td><td>Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F11 </b></td><td>Move dial frequency down 1000 Hz</td></tr> + <tr><td><b>F12 </b></td><td>Move Rx frequency up 1 Hz</td></tr> + <tr><td><b>Ctrl+F12 </b></td><td>Move identical Rx and Tx frequencies up 1 Hz</td></tr> + <tr><td><b>Shift+F12 </b></td><td>Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)</td></tr> + <tr><td><b>Ctrl+Shift+F12 </b></td><td>Move dial frequency up 1000 Hz</td></tr> + <tr><td><b>Alt+1-6 </b></td><td>Set now transmission to this number on Tab 1</td></tr> + <tr><td><b>Ctl+1-6 </b></td><td>Set next transmission to this number on Tab 1</td></tr> + <tr><td><b>Alt+A </b></td><td>Clear Active Stations for QMAP</td></tr> + <tr><td><b>Alt+B </b></td><td>Toggle "Best S+P" status</td></tr> + <tr><td><b>Alt+C </b></td><td>Cycle CQ response mode</td></tr> + <tr><td><b>Alt+D </b></td><td>Decode again at QSO frequency</td></tr> + <tr><td><b>Shift+D </b></td><td>Full decode (both windows)</td></tr> + <tr><td><b>Ctrl+E </b></td><td>Turn on TX even/1st</td></tr> + <tr><td><b>Shift+E </b></td><td>Turn off TX even/1st</td></tr> + <tr><td><b>Alt+E </b></td><td>Erase</td></tr> + <tr><td><b>Ctrl+F </b></td><td>Edit the free text message box</td></tr> + <tr><td><b>Alt+G </b></td><td>Generate standard messages</td></tr> + <tr><td><b>Alt+H </b></td><td>Halt Tx</td></tr> + <tr><td><b>Ctrl+I </b></td><td>Add Dx Call to the Ignore List</td></tr> + <tr><td><b>Ctrl+L </b></td><td>Lookup callsign in database, generate standard messages</td></tr> + <tr><td><b>Alt+M </b></td><td>Monitor</td></tr> + <tr><td><b>Alt+N </b></td><td>Toggle "Enable Tx"</td></tr> + <tr><td><b>Ctrl+O </b></td><td>Open a .wav file</td></tr> + <tr><td><b>Alt+O </b></td><td>Change operator</td></tr> + <tr><td><b>Alt+Q </b></td><td>Open "Log QSO" window</td></tr> + <tr><td><b>Ctrl+R </b></td><td>Set Tx4 message to RRR (not in FT4)</td></tr> + <tr><td><b>Alt+R </b></td><td>Set Tx4 message to RR73</td></tr> + <tr><td><b>Ctrl+Shift+R </b></td><td>Refresh Active Stations window</td></tr> + <tr><td><b>Alt+S </b></td><td>Stop monitoring</td></tr> + <tr><td><b>Alt+T </b></td><td>Toggle Tune status</td></tr> + <tr><td><b>Ctrl+X </b></td><td>Open next file in directory</td></tr> + <tr><td><b>Alt+x </b></td><td>Decode all remaining files in directory</td></tr> + <tr><td><b>Alt+Z </b></td><td>Clear hung decoder status</td></tr> + </table> - Mouse commands help window contents - <table cellpadding=5> - <tr> - <th align="right">點擊</th> - <th align="left">行動</th> - </tr> - <tr> - <td align="right">瀑布圖:</td> - <td><b>Click</b> 設定接收頻率.<br/> - <b>Shift-click</b> 設定發送頻率.<br/> - <b>Ctrl-click</b> or <b>右鍵單擊</b> 設定接收和發送頻率.<br/> - <b>Double-click</b> 在接收頻率解碼.<br/> - </td> - </tr> - <tr> - <td align="right">解碼文字:</td> - <td><b>Double-click</b> 解碼的文字將第二個呼號複製到 Dx 呼號,<br/> - 定位器到 Dx 網格,將接收和發送頻率更改為<br/> - 解碼信號的頻率, 並生成<br/> - 標準訊息.<br/> - 如果 <b>保持發送頻率</b> 已選中或在消息中顯示第一個呼號<br/> - 是你自己的呼叫, 發送頻率不更改,除非 <br/> - <b>Ctrl</b> 鍵被按下.<br/> - </td> - </tr> - <tr> - <td align="right">清除按鈕:</td> - <td><b>點擊</b> 清除通聯視窗.<br/> - <b>按兩下</b> 清除通聯視窗和波段活動視窗. - </td> - </tr> -</table> + - + <table cellpadding=5> <tr> <th align="right">Click on</th> @@ -5497,9 +8397,23 @@ WSJT-X 不會運行狐狸模式在 own call, Tx frequency is not changed unless <b>Ctrl</b> is held down. </td> </tr> + <tr> + <td align="right">Dial Frequency:</td> + <td><b>Turn the mouse wheel</b> to change the kHz values, or:<br/> + <b>Right-click</b> to increase frequency by 1 kHz.<br/> + <b>Left-click</b> to decrease frequency by 1 kHz.<br/> + The mouse pointer must be over the Dial Frequency indicator. + </td> + </tr> <tr> <td align="right">H Button:</td> <td><b>Click</b> to toggle FT8 Hound Mode On/Off.<br/> + <b>Right-click</b> to activate or deactivate SuperFox mode. + </td> + </tr> + <tr> + <td align="right">FT8 Button:</td> + <td><b>Click</b> to switch to FT8 Hound Mode.<br/> <b>Right-click</b> to toggle last used Special Operating Activity On/Off. </td> </tr> @@ -5529,7 +8443,8 @@ WSJT-X 不會運行狐狸模式在 <tr> <td align="right">Enable Tx Button:</td> <td><b>Click</b> to toggle Auto-Tx mode On/Off.<br/> - <b>Right-click</b> to toggle Wait & Pounce On/Off. + <b>Right-click</b> to toggle Wait & Pounce On/Off after selecting<br/> + any CQ response mode other than CQ: None. </td> </tr> <tr> @@ -5573,579 +8488,652 @@ WSJT-X 不會運行狐狸模式在 </td> </tr> </table> - Mouse commands help window contents - <table cellpadding=5> - <tr> - <th align="right">點擊</th> - <th align="left">作用</th> - </tr> - <tr> - <td align="right">瀑布:</td> - <td><b>Click</b> 設置接收頻率.<br/> - <b>右鍵單擊</b> 設置發射頻率.<br/> - <b>右鍵雙擊</b> 設置接收和發射頻率. - </td> - </tr> - <tr> - <td align="right">解碼文本:</td> - <td><b>雙擊</b> 將第二個呼號覆制到Dx呼號, 將網格定位覆制到Dx網格,<br/> - 請更改接收和發射頻率轉換為解碼信號的頻率, 並生成標準消息.<br/> - 按住 <b>Alt</b> 鍵可防止 <b>雙擊</b> 時啟用發射.<br/> - 如果 <b>保持發射頻率</b> 被選中或者第一個回答您的呼叫<br/> - 自己呼叫l, 除非按住 <b>Ctrl</b> 否則不改變發射頻率. - </td> - </tr> - <tr> - <td align="right">H 按鈕:</td> - <td><b>單擊</b> 切換 FT8 獵犬模式 啟用/停用.<br/> - <b>右鍵單擊</b> 切換上次使用的特殊操作活動 啟用/停用. - </td> - </tr> - <tr> - <td align="right">Q65 按鈕:</td> - <td><b>單擊</b> 切換到 Q65 模式.<br/> - <b>右鍵單擊</b> 切換到 Q65 堆積模式. - </td> - </tr> - <tr> - <td align="right">JT65 按鈕:</td> - <td><b>單擊</b>切換到 JT65 模式.<br/> - <b>右鍵單擊</b> 切換到 JT9 模式. - </td> - </tr> - <tr> - <td align="right">Tx5 按鈕n:</td> - <td><b>右鍵</b> 要保留Tx5自定義文本. - </td> - </tr> - <tr> - <td align="right">Tx Even/1st:</td> - <td><b>右鍵</b>凍結覆選框的狀態.<br/> - <b>右鍵單擊 FT8 按鈕</b> 解凍. - </td> - </tr> - <tr> - <td align="right">啟用發射按鈕:</td> - <td><b>單擊</b>切換 啟用/停用 自動發射模式.<br/> - <b>右鍵單擊</b> 切換 啟用/停用 等待和突襲. - </td> - </tr> - <tr> - <td align="right">擦除 按鈕:</td> - <td><b>單擊</b> 擦除接收信息窗.<br/> - <b>雙擊</b> 擦除接收信息窗 和 波段活動窗.<br/> - 如果 <b>替代擦除按鈕行為</b> 已選:<br/> - <b>單擊</b> 擦除 波段活動窗.<br/> - <b>右鍵單擊</b> 擦除接收信息窗.<br/> - <b>雙擊</b> 擦除接收信息窗 和 波段活動窗. - </td> - </tr> - <tr> - <td align="right">DX 呼號 按鈕:</td> - <td><b>單擊</b> 切換等待和呼叫 啟用/停用.<br/> - <b>右鍵單擊</b> 要清除Dx呼號、Dx網格 和 標準消息. - </td> - </tr> - <tr> - <td align="right">查找 按鈕:</td> - <td><b>右鍵單擊</b> 或 <b>雙擊</b> 在 QRZ.com 上搜索DX 呼號.<br/> - <b>Crtl + 右鍵單擊</b> 在 hamqth.com 上搜索DX 呼號.<br/> - <b>Alt + 右鍵單擊</b> 在 qrzcq.com 上搜索DX 呼號. - </td> - </tr> - <tr> - <td align="right">增加按鈕:</td> - <td><b>右鍵</b> 在 hamqth.com 上搜索 DX 呼號. - </td> - </tr> - <tr> - <td align="right">忽略按鈕:</td> - <td><b>單擊</b> 將呼號添加到忽略清單.<br/> - <b>右鍵</b> 在 qrzcq.com 上搜索 Dx 呼號. - </td> - </tr> - <tr> - <td align="right">波段按鈕:</td> - <td><b>單擊</b> 切換 波段/模式 默認頻率.<br/> - <b>右鍵</b> 切換 FT8 DX遠征頻率. - </td> - </tr> -</table> + + + + + Type 1 Prefixes: + + 1A 1S 3A 3B6 3B8 3B9 3C 3C0 3D2 3D2C 3D2R 3DA 3V 3W 3X + 3Y 3YB 3YP 4J 4L 4S 4U1I 4U1U 4W 4X 5A 5B 5H 5N 5R + 5T 5U 5V 5W 5X 5Z 6W 6Y 7O 7P 7Q 7X 8P 8Q 8R + 9A 9G 9H 9J 9K 9L 9M2 9M6 9N 9Q 9U 9V 9X 9Y A2 + A3 A4 A5 A6 A7 A9 AP BS7 BV BV9 BY C2 C3 C5 C6 + C9 CE CE0X CE0Y CE0Z CE9 CM CN CP CT CT3 CU CX CY0 CY9 + D2 D4 D6 DL DU E3 E4 EA EA6 EA8 EA9 EI EK EL EP + ER ES ET EU EX EY EZ F FG FH FJ FK FKC FM FO + FOA FOC FOM FP FR FRG FRJ FRT FT5W FT5X FT5Z FW FY M MD + MI MJ MM MU MW H4 H40 HA HB HB0 HC HC8 HH HI HK + HK0A HK0M HL HM HP HR HS HV HZ I IS IS0 J2 J3 J5 + J6 J7 J8 JA JDM JDO JT JW JX JY K KG4 KH0 KH1 KH2 + KH3 KH4 KH5 KH5K KH6 KH7 KH8 KH9 KL KP1 KP2 KP4 KP5 LA LU + LX LY LZ OA OD OE OH OH0 OJ0 OK OM ON OX OY OZ + P2 P4 PA PJ2 PJ7 PY PY0F PT0S PY0T PZ R1F R1M S0 S2 S5 + S7 S9 SM SP ST SU SV SVA SV5 SV9 T2 T30 T31 T32 T33 + T5 T7 T8 T9 TA TF TG TI TI9 TJ TK TL TN TR TT + TU TY TZ UA UA2 UA9 UK UN UR V2 V3 V4 V5 V6 V7 + V8 VE VK VK0H VK0M VK9C VK9L VK9M VK9N VK9W VK9X VP2E VP2M VP2V VP5 + VP6 VP6D VP8 VP8G VP8H VP8O VP8S VP9 VQ9 VR VU VU4 VU7 XE XF4 + XT XU XW XX9 XZ YA YB YI YJ YK YL YN YO YS YU + YV YV0 Z2 Z3 ZA ZB ZC4 ZD7 ZD8 ZD9 ZF ZK1N ZK1S ZK2 ZK3 + ZL ZL7 ZL8 ZL9 ZP ZS ZS8 KC4 E5 + +Type 1 Suffixes: /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /P + + + + + MessageAveraging + + + + Message Averaging + 訊息平均值 + + + + UTC Sync DT Freq + + + + + Modes + + + + Mode + 模式 + + + + MultiSettings + + + Default + 預設值 + + + + MultiSettings::impl + + + &Switch To + 切換至(&S) + + + + &Clone + 複製(&C) + + + + Clone &Into ... + 複製到(&I) ... + + + + R&eset + 恢復到預設(&e) - - This station transmits in the same time slot as you do. - -You must not start a QSO if both stations Tx even/1st -or Tx odd/2nd, while the Tx even/1st checkbox is disabled. - -Click the MSK144 mode button to re-enable the Tx even/1st -checkbox, or choose another station. - 這個電臺和你在同一個時隙發射. - -如果兩個電臺都發送偶數/第一, 則不能開始QSO -或者發射 奇數/第二, 同時禁用發射 偶數第一 核取方塊 - -點擊MSK144按鈕, 重新啟用 發射 偶數/第一 -核取方塊, 或選擇其他電臺. + + &Rename ... + 重新命名(&R) ... - - Should you switch to EU VHF Contest mode? - -To do so, check 'Special operating activity' and -'EU VHF Contest' on the Settings | Advanced tab. - 是否應切換到 歐洲 VHF 競賽模式? - -為此, 請檢查 '特殊操作活動' 和 -設定高級選項卡上的 '歐洲 VHF 競賽'. + + &Delete + 刪除(&D) - - Should you switch to ARRL Field Day mode? - 是否切換至 ARRL Field Day 模式? + + Clone Into Configuration + 複製到設定 - - Should you switch to RTTY contest mode? - 是否切換至 RTTY 競賽模式? + + Confirm overwrite of all values for configuration "%1" with values from "%2"? + 確認覆蓋設定 "%1" 的設定值, 以及來自 "%2"的設定值? - - - - - Add to CALL3.TXT - 新增到 CALL3.TXT + + Reset Configuration + 重置設定 - - Please enter a valid grid locator - 請輸入有效的網格定位 + + Confirm reset to default values for configuration "%1"? + 確認重置為設定預設值 "%1"? - - Cannot open "%1" for read/write: %2 - 無法開啟 "%1" 用於讀/寫: %2 + + Delete Configuration + 刪除設定 - - %1 -is already in CALL3.TXT, do you wish to replace it? - %1 -CALL3.TXT已存在, 要替換檔案嗎? + + Confirm deletion of configuration "%1"? + 確認刪除設定 "%1"? + + + NameDialog - - Warning: DX Call field is empty. - 警告: DX 呼號欄位為空. + + New Configuration Name + 新設定檔名稱 - - Log file error - 日誌檔案錯誤 + + Old name: + 舊設定檔名稱: - - Cannot open "%1" - 無法開啟 "%1" + + &New name: + 新設定檔名稱(&N): + + + NetworkAccessManager - - Error sending log to N1MM - 將日誌傳送至 N1MM 時發生錯誤 + + Network SSL/TLS Errors + SSL/TLS 網路錯誤 + + + OmniRigTransceiver - - Write returned "%1" - 寫入返回 "%1" + + OmniRig: unrecognized mode + OmniRig: 無法辨識的模式 - - Stations calling DXpedition %1 - 呼叫遠征電臺 %1 + + Failed to start OmniRig COM server + 無法啟動 OmniRig COM 伺服器 - - Super Fox - 超級狐狸 + + OmniRig: don't know how to set rig frequency + OmniRig:無法設置無線電設備頻率 - - Super Hound - 超級獵犬 + + OmniRig COM/OLE error: %1 at %2: %3 (%4) + OmniRig COM/OLE 錯誤: %1 at %2: %3 (%4) + + + PollingTransceiver - - Hound - 獵犬 + + Unexpected rig error + 無線電設備意外錯誤 + + + QObject - - Tx Messages - 發送訊息 + + Failed to open LotW users CSV file: '%1' + 無法開啟 LotW 使用者 CSV 檔案: '%1' - - - - - - - Confirm Erase - 確認清除 + + OOB + - - Are you sure you want to erase file ALL.TXT? - 是否確實要清除 ALL.Txt 檔案? + + Too many colours in palette. + 調色板中顏色過多. - - Are you sure you want to erase the list of Q65 callers? - 是否確定要清除 Q65呼叫者表? + + Error reading waterfall palette file "%1:%2" too many colors. + 讀取瀑布調色板檔案時錯誤 "%1:%2" 過多顏色. - - - Confirm Reset - 確認重置 + + Error reading waterfall palette file "%1:%2" invalid triplet. + 讀取瀑布調色板檔案時錯誤 "%1:%2" 無效的檔案. - - Are you sure you want to erase your contest log? - 是否確實要清除競賽日誌? + + Error reading waterfall palette file "%1:%2" invalid color. + 讀取瀑布調色板檔案時錯誤 "%1:%2" 無效的顏色. - - Doing this will remove all QSO records for the current contest. They will be kept in the ADIF log file but will not be available for export in your Cabrillo log. - 執行此動作將移除目前競賽的所有通聯紀錄. 它們將保留在 ADIF 日誌檔案中, 但無法匯出到您的Cabrillo Log中. + + Error opening waterfall palette file "%1": %2. + 讀取瀑布調色板檔案時錯誤 "%1": %2. - - Cabrillo Log saved - Cabrillo日誌已儲存 + Error writing waterfall palette file "%1": %2. + 讀取瀑布調色板檔案時錯誤 "%1": %2. + + + QSYMessage - - Are you sure you want to erase file wsjtx_log.adi? - 是否確定要清除 wsjtx_log.adi 檔案? + + WSJT-X Popup + - - Are you sure you want to erase the WSPR hashtable? - 是否確定要清除 WSPR 哈希表? + + TextLabel + - - %1 W - %1 瓦 + + Reply +Yes + - - SWR > 2.5 !!! - -Transmission was stopped - -Check your antenna - 駐波比大於 2.5 !!! - -發射已停止 - -檢查你的天線 + + Reply +No + + + + QSYMessageCreator - - Tune digital gain - 調諧數位增益 + + Message Creator + - - Transmit digital gain - 傳輸數位增益 + + HF + - - Prefixes - 前綴 + + + SSB + - - Network Error - 網路錯誤 + + + + CW + - - Error: %1 -UDP server %2:%3 - 錯誤: %1 -UDP 伺服器 %2:%3 + + + FM + - - File Error - 檔案錯誤 + + FST4 + - - Phase Training Disabled - 關閉階段訓練 + + FT4 + - - Phase Training Enabled - 開啟階段訓練 + + + FT8 + - - WD:0m - WD:溢出 + + JT9 + - - Runaway Tx watchdog - 發射監管計時器 + + JT65 + - - WD:%1m - WD:%1分 + + + + + Message + 訊息 - - - Log File Error - 日誌檔案錯誤 + + 630 M + - - Are you sure you want to clear the QSO queues? - 是否要清除通聯佇列? + + 160 M + - - Free Text Message - 自定義訊息 + + 80 M + - - Message: - 訊息: + + 60 M + - - Are you sure you want to erase the Tx Log? - 您確定要刪除發射紀錄嗎? + + 40 M + - - "%1" added to Ignore List - "%1" 已増加到忽略清單 + + 30 M + - - Are you sure you want to erase the Ignore List? - 是否確實要清除忽略清單? + + 20 M + - - QCustomPlot plot examples - QCustomPlot plot範例 + + 17 M + - - - MessageAveraging - - - Message Averaging - 訊息平均值 + + 15 M + - - UTC Sync DT Freq - + + 12 M + + + + + 28 MHz + + + + + 29 MHz + + + + + + + Mode + + + + + + + Band + 波段 + + + + + + SAVE + + + + + + + kHz + + + + + + + Send +Message + + + + + VHF + + + + + + 50 MHz + + + + + + 144 MHz + + + + + + 222 MHz + + + + + + 432 MHz + + + + + + 902 MHz + + + + + + 903 MHz + + + + + + 1296 MHz + + + + + + 2304 MHz + + + + + + 3400 MHz + + + + + + 5760 MHz + + + + + + 10368 MHz + - - - Modes - - - Mode - 模式 + + 24192 MHz + - - - MultiSettings - - Default - 預設值 + + 40 MHz + - - - MultiSettings::impl - - &Switch To - 切換至(&S) + + 70 MHz + - - &Clone - 複製(&C) + + MSK144 + - - Clone &Into ... - 複製到(&I) ... + + FM MHz + - - R&eset - 恢復到預設(&e) + + EME + - - &Rename ... - 重新命名(&R) ... + + 24048 MHz + - - &Delete - 刪除(&D) + + Q65-30B + - - Clone Into Configuration - 複製到設定 + + Q65-60C + - - Confirm overwrite of all values for configuration "%1" with values from "%2"? - 確認覆蓋設定 "%1" 的設定值, 以及來自 "%2"的設定值? + + Q65-60D + - - Reset Configuration - 重置設定 + + Q65-60E + - - Confirm reset to default values for configuration "%1"? - 確認重置為設定預設值 "%1"? + + Q65-120D + - - Delete Configuration - 刪除設定 + + General + - - Confirm deletion of configuration "%1"? - 確認刪除設定 "%1"? + + Please call me by phone + - - - NameDialog - - New Configuration Name - 新設定檔名稱 + + Please check Ping Jockey + - - Old name: - 舊設定檔名稱: + + You are in the log + - - &New name: - 新設定檔名稱(&N): + + You are transmitting in the wrong time slot + - - - NetworkAccessManager - - Network SSL/TLS Errors - SSL/TLS 網路錯誤 + + You are not in Contest Mode + - - - OmniRigTransceiver - - OmniRig: unrecognized mode - OmniRig: 無法辨識的模式 + + Your audio is distorted + - - Failed to start OmniRig COM server - 無法啟動 OmniRig COM 伺服器 + + Your transmitter is overmodulated + - - - OmniRig: don't know how to set rig frequency - OmniRig:無法設置無線電設備頻率 + + Please check ON4KST + - - OmniRig COM/OLE error: %1 at %2: %3 (%4) - OmniRig COM/OLE 錯誤: %1 at %2: %3 (%4) + + Please transmit above 1000 Hz + - - - PollingTransceiver - - Unexpected rig error - 無線電設備意外錯誤 + + Check your email + - - - QObject - - Failed to open LotW users CSV file: '%1' - 無法開啟 LotW 使用者 CSV 檔案: '%1' + + Please check HB9Q Logger + - - OOB - + + Please check your PC Clock + - - Too many colours in palette. - 調色板中顏色過多. + + You are transmitting on top of a rare DX station + - - Error reading waterfall palette file "%1:%2" too many colors. - 讀取瀑布調色板檔案時錯誤 "%1:%2" 過多顏色. + + Please QSL via LoTW + - - Error reading waterfall palette file "%1:%2" invalid triplet. - 讀取瀑布調色板檔案時錯誤 "%1:%2" 無效的檔案. + + Send Message + - - Error reading waterfall palette file "%1:%2" invalid color. - 讀取瀑布調色板檔案時錯誤 "%1:%2" 無效的顏色. + + MessageCreator + + + + QSYMonitor - - Error opening waterfall palette file "%1": %2. - 讀取瀑布調色板檔案時錯誤 "%1": %2. + + QSYMonitor + - - Error writing waterfall palette file "%1": %2. - 讀取瀑布調色板檔案時錯誤 "%1": %2. + + Clear + + + + + QSY Monitor + @@ -6280,188 +9268,416 @@ Error(%2): %3 SoundInput - + An error opening the audio input device has occurred. 開啟音頻輸入設備時錯誤. - + An error occurred during read from the audio input device. 從音頻輸入設備讀取時錯誤. - + Non-recoverable error, audio input device not usable at this time. 不可恢復的錯誤, 音頻輸入設備此時不可用. - + Requested input audio format is not valid. 請求輸入的音頻格式無效. - + Requested input audio format is not supported on device. 設備不支援請求輸入的音頻格式. - + Failed to initialize audio sink device 無法初始化音頻接收設備 - + + Idle + 閒置 + + + + Receiving + 接收 + + + + Suspended + 暫停 + + + + Interrupted + 中斷 + + + + Error + 錯誤 + + + + Stopped + 停止 + + + + SoundOutput + + + An error opening the audio output device has occurred. + 開啟音頻輸出設備時錯誤. + + + + An error occurred during write to the audio output device. + 寫入音頻輸出設備期間錯誤. + + + + Audio data not being fed to the audio output device fast enough. + 音頻數據未以足夠快的速度饋送到音頻輸出設備. + + + + Non-recoverable error, audio output device not usable at this time. + 不可恢復錯誤, 音頻輸出設備此時不可用. + + + + Requested output audio format is not valid. + 請求的輸出音頻格式無效. + + + + Requested output audio format is not supported on device. + 設備不支援請求輸出的音頻格式. + + + + Audio output restart attempt failed. + + + + + + No audio output device configured. + 未設定音訊輸出裝置. + + + + No audio output stream is active. + + + + Idle 閒置 - - Receiving - 接收 + + Sending + 發送 + + + + Suspended + 暫停 + + + + Interrupted + 中斷 + + + + Error + 錯誤 + + + + Stopped + 停止 + + + + SplashScreen + + + WSJT-X — Welcome + + + + + WSJT-X startup information. Press Escape to close. + + + + + StationDialog + + + Add Station + 新增電臺 + + + + &Band: + 波段(&B): + + + + &Offset (MHz): + 偏移 (M&Hz): + + + + &Antenna: + 天線(&A): + + + + StationList::impl + + + Band name + 波段名稱 + + + + Frequency offset + 頻率偏移 + + + + Antenna description + 天線描述 + + + + Band + 波段 + + + + Offset + 偏移 + + + + Antenna Description + 天線描述 + + + + TCITransceiver + + + ConnectionRefused + + + + + RemoteHostClosed + + + + + HostNotFound + + + + + SocketAccess + + + + + SocketResource + + + + + SocketTimeout + + + + + DatagramTooLarge + + + + + Network + + + + + AddressInUse + + + + + SocketAddressNotAvailable + + + + + UnsupportedSocketOperation + + + + + UnfinishedSocketOperation + - - Suspended - 暫停 + + ProxyAuthenticationRequired + - - Interrupted - 中斷 + + SslHandshakeFailed + - - Error - 錯誤 + + ProxyConnectionRefused + - - Stopped - 停止 + + ProxyConnectionClosed + - - - SoundOutput - - An error opening the audio output device has occurred. - 開啟音頻輸出設備時錯誤. + + ProxyConnectionTimeout + - - An error occurred during write to the audio output device. - 寫入音頻輸出設備期間錯誤. + + ProxyNotFound + - - Audio data not being fed to the audio output device fast enough. - 音頻數據未以足夠快的速度饋送到音頻輸出設備. + + ProxyProtocol + - - Non-recoverable error, audio output device not usable at this time. - 不可恢復錯誤, 音頻輸出設備此時不可用. + + Operation + - - Requested output audio format is not valid. - 請求的輸出音頻格式無效. + + SslInternal + - - Requested output audio format is not supported on device. - 設備不支援請求輸出的音頻格式. + + SslInvalidUserData + - - No audio output device configured. - 未設定音訊輸出裝置. + + Temporary + - - Idle - 閒置 + + UnknownSocket + - - Sending - 發送 + + UnknownSocketError + - - Suspended - 暫停 + + TCI websocket error: %1 + - - Interrupted - 中斷 + + TCI SDR could not be switched on + - - Error - 錯誤 + + TCI SDR is not switched on + - - Stopped - 停止 + + TCI RX2 could not be enabled + - - - StationDialog - - Add Station - 新增電臺 + + TCI Audio could not be switched on + - - &Band: - 波段(&B): + + + TCI could not be opened + - - &Offset (MHz): - 偏移 (M&Hz): + + + + TCI sent an invalid VFO frequency + - - &Antenna: - 天線(&A): + + + TCI failed to set ptt + - - - StationList::impl - - Band name - 波段名稱 + + TCI should use PTT via CAT + - - Frequency offset - 頻率偏移 + + + TCI failed set rxfreq + - - Antenna description - 天線描述 + + + TCI failed set mode + - - Band - 波段 + + TCI modulator not Idle + - - Offset - 偏移 + + TCI source commitment; playout evidence is protocol-send dead reckoning, not DAC confirmation + - - Antenna Description - 天線描述 + + TCI WebSocket send progress; no radio DAC or RF playback confirmation + @@ -6480,27 +9696,27 @@ Error(%2): %3 對話框 - + Spectrum gain 頻譜增益 - + <html><head/><body><p>Enter definition for a new color palette.</p></body></html> <html><head/><body><p>輸入新調色板的定義.</p></body></html> - + Adjust... 調整... - + Total power (dB) 總功率 (分貝) - + Waterfall gain 瀑布增益 @@ -6513,200 +9729,209 @@ Error(%2): %3 頻譜色板 - + <html><head/><body><p>Set fractional size of spectrum in this window.</p></body></html> <html><head/><body><p>在此視窗中設定頻譜的大小.</p></body></html> - + % - + Spec 高度 - + <html><head/><body><p>Flatten spectral baseline over the full displayed interval.</p></body></html> <html><head/><body><p>在完整顯示的間隔內平展頻譜基線.</p></body></html> - + Flatten 平坦化 - <html><head/><body><p>Compute and save a reference spectrum. (Not yet fully implemented.)</p></body></html> - <html><head/><body><p>計算並保存參考頻譜. (尚未完全實現.)</p></body></html> + <html><head/><body><p>計算並保存參考頻譜. (尚未完全實現.)</p></body></html> - + Ref Spec 參考規格 - + Smoothing of Linear Average spectrum 線性平均頻譜的平滑 - + Smooth 平滑 - + Compression factor for frequency scale 頻率刻度系數 - + + <html><head/><body><p>Controls</p></body></html> + + + + Bins/Pixel 頻譜刻度 - - + + <html><head/><body><p>Position of time stamp above each interval line</p></body></html> <html><head/><body><p>時間戳在每條間隔線上的位置</p></body></html> - + Time stamp 時間戳 - - + + Off 取消 - + Left 左邊 - + Right 右邊 - + Palette 調色板 - + Select waterfall palette 選擇瀑布圖色板 - + Bars 標注條 - + Freq 頻率 - + + <html><head/><body><p>Apply a saved reference spectrum to flatten the received passband. Available after a reference spectrum has been measured. (Not yet fully implemented.)</p></body></html> + + + + <html><head/><body><p>Select data for spectral display</p></body></html> <html><head/><body><p>選擇用於頻譜顯示的數據</p></body></html> - + Current 當前 - + Cumulative 累積 - + Linear Avg 線性平均 - + Reference 參考 - + Q65_Sync Q65_同步 - + <html><head/><body><p>Frequency at left edge of waterfall</p></body></html> <html><head/><body><p>波段在瀑布左邊緣顯示</p></body></html> - + Hz 赫茲 - + Start 開始 - + <html><head/><body><p>Decode JT9 only above this frequency</p></body></html> <html><head/><body><p>僅在此頻率以上解碼 JT9</p></body></html> - + Hz 赫茲 - + Split 異頻 - + Number of FFTs averaged (controls waterfall scrolling rate) FFT 平均數(控制瀑布滾動速率) - + N Avg N 平均 - + Waterfall zero 瀑布零度 - + Spectrum zero 頻譜零度 - + User Defined 用戶定義 - + Wide Graph 頻譜瀑布圖 - - + + Read Palette 讀取調色盤 @@ -6714,22 +9939,22 @@ Error(%2): %3 WorkedBefore - + Invalid ADIF field %0: %1 無效的ADIF欄位 %0: %1 - + Malformed ADIF field %0: %1 格式不正確的ADIF欄位 %0: %1 - + Invalid ADIF header 無效的 ADIF 標頭 - + Error opening ADIF log file for read: %0 開啟ADIF紀錄檔進行讀取時發生錯誤: %0 @@ -6772,7 +9997,7 @@ Error(%2): %3 我的網格(&y): - + <html><head/><body><p>Maidenhead locator, preferably 6 characters.</p></body></html> <html><head/><body><p>梅登黑德定位器, 最好是 6 個字元.</p></body></html> @@ -6787,97 +10012,97 @@ Error(%2): %3 自動網格 - + IARU Region: IARU 區域: - + <html><head/><body><p>Select your IARU region.</p></body></html> <html><head/><body><p>選擇您的 IARU 區域.</p></body></html> - + Message generation for type 2 compound callsign holders: 發送呼號前綴或後綴方式: - + <html><head/><body><p>Type 2 compound callsigns are those with prefixes or suffixes not included in the allowed shortlist (See Help-&gt;Add-on prefixes and suffixes).</p><p>This option determines which generated messages should contain your full type 2 compound call sign rather than your base callsign. It only applies if you have a type 2 compound callsign.</p><p>This option controls the way the messages that are used to answer CQ calls are generated. Generated messages 6 (CQ) and 5 (73) will always contain your full callsign. The JT65 and JT9 protocols allow for some standard messages with your full call at the expense of another piece of information such as the DX call or your locator.</p><p>Choosing message 1 omits the DX callsign which may be an issue when replying to CQ calls. Choosing message 3 also omits the DX callsign and many versions of this and other software will not extract the report. Choosing neither means that your full callsign only goes in your message 5 (73) so your QSO partner may log the wrong callsign.</p><p>None of these options are perfect, message 3 is usually best but be aware your QSO partner may not log the report you send them.</p></body></html> <html><head/><body><p>複合呼號類型2是那些前綴或後綴不包括在允許的決選名單中 (請參閱說明-& gt; 載入項目前綴和後綴).<p><p>這個選項確定哪些產生的資訊應包含完整類型2複合呼號, 而不是基本呼號.它僅適用於類型為2的複合呼號.</p><p>這個選項控制用於應答 CQ 呼叫的資訊產生方式.產生的資訊 6 (CQ) 和 5 (73) 將始終包含您的完整呼號.jt65 和 jt9 協定允許在您的完整呼叫中使用一些標準資訊, 而犧牲了另一條資訊, 如 DX 呼叫或您的定位.</p><p>選擇資訊1省略 DX 呼號, 這在答覆 CQ 呼叫時可能是一個問題.選擇資訊3也會省略 DX 呼號, 此軟體和其他軟體的許多版本都不會提取報告.選擇這兩個都意味著你的完整呼號只會出現在你的資訊 5 (73) 中, 所以你的通聯夥伴我的日誌是錯誤的呼號.</p><p>這些選項都不是完美的, 資訊 3 是最好的, 但請注意, 您的通聯合作夥伴可能不會記錄您傳送的報告.</p></body></html> - + Full call in Tx1 完整呼號在 發送1 - + Full call in Tx3 完整呼號在 發送3 - + Full call in Tx5 only 完整呼號在 發送5 - + Display 顯示設定 - + Show outgoing transmitted messages in the Rx frequency window. 在接收訊息視窗中顯示已發送的訊息. - + &Tx messages to Rx frequency window 發出訊息在接收訊息視窗顯示(&T) - + Show if decoded stations are new DXCC entities or worked before. 顯示解碼的電臺是新的 DXCC 實體還是以前曾經通聯. - + <html><head/><body><p>Check to have decodes for a new period start at the top of the Band Activity window and not scroll off the top when the window is full.</p><p>This is to aid selecting decodes to double-click while decoding is still in progress. Use the Band Activity vertical scroll bar to reveal decodes past the bottom of the window.</p></body></html> <html><head/><body><p>檢查新週期的解碼從 波段活動 視窗的頂部開始,而不是在視窗已滿時從頂部滾動.</p><p>這是為了幫助選擇解碼, 以按兩下, 而解碼仍在進行中. 使用 波段活動 垂直滾動條顯示視窗底部的解碼.</p></body></html> - + Start new period decodes at top 保持新訊息於波段視窗頂部 - + Set the font characteristics for the application. 設置應用程序的字型. - + Font... 程序字型... - + Set the font characteristics for the Band Activity and Rx Frequency areas. 設定波段活動和接收訊息視窗字型. - + Decoded Text Font... 解碼字型... - + Include a separator line between periods in the band activity window. 在波段活動視窗中加入時間分隔行. - + &Blank line between decoding periods 解碼過程中插入分隔線(&B) @@ -6892,103 +10117,99 @@ Error(%2): %3 顯示距離單位為英里(&n) - + Behavior 偏好設定 - + Decode after EME delay EME 延遲後解碼 - Tx watchdog: - 發送時間看門狗: + 發送時間看門狗: - + <html><head/><body><p>Number of minutes before unattended transmissions are aborted</p></body></html> <html><head/><body><p>無線電設備發送到達設定分鐘數後,停止發送</p></body></html> - + Disabled 停用 - + minutes 分鐘 - + Single decode 單獨解碼 - <html><head/><body><p>Some rigs are not able to process CAT commands while transmitting. This means that if you are operating in split mode you may have to uncheck this option.</p></body></html> - <html><head/><body><p>某些無線電設備在發送時無法處理CAT 命令.如果在異頻模式下運行,則可能必須取消選中此選項.</p></body></html> + <html><head/><body><p>某些無線電設備在發送時無法處理CAT 命令.如果在異頻模式下運行,則可能必須取消選中此選項.</p></body></html> - Allow Tx frequency changes while transmitting - 允許發送期間改變頻率 + 允許發送期間改變頻率 - + Don't start decoding until the monitor button is clicked. 軟體開啟時, 關閉監聽按鈕. - + Mon&itor off at startup 開啟軟體時關閉監聽(&i) - + <html><head/><body><p>Check this if you wish to automatically return to the last monitored frequency when monitor is enabled, leave it unchecked if you wish to have the current rig frequency maintained.</p></body></html> <html><head/><body><p>如果您希望在啟用監聽時自動返回到無線電設備最後一個監聽頻率.</p></body></html> - + Monitor returns to last used frequency 開始監聽時使用上一次的頻率 - + Alternate F1-F6 bindings 競賽模式時綁定F1-F6功能 - + Turns off automatic transmissions after sending a 73 or any other free text message. 傳送73後關閉發送. - + Di&sable Tx after sending 73 傳送 73 後關閉發送(&s) - + Send a CW ID after every 73 or free text message. 73或自定義訊息發送後,使用CW模式發送呼號. - + CW ID a&fter 73 發送73後,使用CW模式發送呼號(&f) - Periodic CW ID Inter&val: - 發送CW訊息時間間隔(&v): + 發送CW訊息時間間隔(&v): - + Send a CW ID periodically every few minutes. This might be required under your countries licence regulations. It will not interfere with other users as it is always sent in the @@ -6999,251 +10220,248 @@ quiet period when decoding is done. 在解碼完成後的安靜期間發送. - + Automatic transmission mode. 雙擊呼號即可直接發送訊息. - + Doubl&e-click on call sets Tx enable 雙擊呼號立即啟用發送(&e) - + Calling CQ forces Call 1st CQ呼叫時強制第1 - + Additional features 附加功能 - Erase Band Activity window after band change - 更換波段後清除波段活動視窗 + 更換波段後清除波段活動視窗 - + Highlight DX Grid in message 在消息中突出顯示DX網格 - + Highlight DX Call in message 在訊息中突出顯示DX呼號 - + Clear DX Call after QSO QSO後清除DX呼號 - + Set Rx frequency to Tx frequency after QSO QSO後將Rx頻率設定為Tx頻率 - + Clear DX Grid after QSO 通聯後清除DX網格 - + Map Grid locator to U.S. State 將網格定位映射到美國各州 - + <html><head/><body><p>Disable the Tune watchdog.</p></body></html> <html><head/><body><p>禁用調諧監察器.</p></body></html> - + &Radio 電臺(&R) - + Radio interface configuration settings. 設定無線電設備介面設定. - + Settings that control your CAT interface. 控制CAT界面的設定. - + CAT Control CAT控制 - - + + Port: 串口: - Show principal prefix instead of country name - 顯示前綴而非國家或地區名稱 + 顯示前綴而非國家或地區名稱 - Show &DXCC, grid, and worked-before status - 顯示 &DXCC、網格與曾經通聯狀態 + 顯示 &DXCC、網格與曾經通聯狀態 - + Serial port used for CAT control. 用於CAT控制的序列埠. - - + + Serial Port Parameters 連接埠設定 - + Baud Rate: 每秒位元數: - + Serial port data rate which must match the setting of your radio. 序列埠位元數必須與您的無線電設備設定相匹配. - + 1200 - + 2400 - + 4800 - + 9600 - + 19200 - + 38400 - + 57600 - + 115200 - + <html><head/><body><p>Number of data bits used to communicate with your radio's CAT interface (usually eight).</p></body></html> <html><head/><body><p>用於與無線電設備 CAT 介面通信的數據位元 (通常為 8 ).</p></body></html> - + Data bits 資料位元 - + Data Bits 資料位元 - + D&efault 預設值(&e) - + Se&ven Se&ven 7 - + E&ight E&ight 8 - + <html><head/><body><p>Number of stop bits used when communicating with your radio's CAT interface</p><p>(consult you radio's manual for details).</p></body></html> <html><head/><body><p>與無線電設備 CAT 介面通信時使用的停止位元</p><p>(詳情請參閱無線電設備手冊).</p></body></html> - + Stop bits 停止位元 - + Stop Bits 停止位元 - - + + Default 預設值 - + On&e On&e 1 - + T&wo T&wo 2 - + <html><head/><body><p>Flow control protocol used between this computer and your radio's CAT interface (usually &quot;None&quot; but some require &quot;Hardware&quot;).</p></body></html> <html><head/><body><p>電腦和無線電設備 CAT 介面 之間使用的流量控制協議 (通常是 "None",但有些要求"硬件").</p></body></html> - - + + Handshake 流量控制 - + &None - + Software flow control (very rare on CAT interfaces). 軟體控制流 (在CAT介面上非常罕見). - + XON/XOFF - + Flow control using the RTS and CTS RS-232 control lines not often used but some radios have it as an option and a few, particularly some Kenwood rigs, require it). @@ -7252,75 +10470,74 @@ a few, particularly some Kenwood rigs, require it). 很少,特別是一些 健伍無線電設備,需要它). - + &Hardware 硬體(&H) - + Special control of CAT port control lines. 特殊控制的CAT控制線. - - + + Force Control Lines 硬體流量控制 - - + + High 高 - - + + Low 低 - + DTR: - + RTS: - How this program activates the PTT on your radio? - 如何啟動無線電設備上的 PTT? + 如何啟動無線電設備上的 PTT? - + PTT Method PTT 方式 - + <html><head/><body><p>No PTT activation, instead the radio's automatic VOX is used to key the transmitter.</p><p>Use this if you have no radio interface hardware.</p></body></html> <html><head/><body><p>如果您沒有無線電設備介面硬件,沒法PTT而是使用無線電設備的自動聲控來發送,請使用此選項.</p></body></html> - + VO&X - + <html><head/><body><p>Use the RS-232 DTR control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The DTR control line of the CAT serial port may be used for this or a DTR control line on a different serial port may be used.</p></body></html> <html><head/><body><p>使用 RS-232 DTR 控制線路切換無線電設備的 PTT, 需要硬體來介面線路.</p><p>某些商業介面單元也使用此方法.</p><p>CAT 串列埠的 DTR 控制線路可用於此或可用於其他串行埠上的 DTR 控制線路.</p></body></html> - + &DTR - + Some radios support PTT via CAT commands, use this option if your radio supports it and you have no other hardware interface for PTT. @@ -7329,47 +10546,47 @@ other hardware interface for PTT. PTT的其它硬體介面. - + C&AT - + <html><head/><body><p>Use the RS-232 RTS control line to toggle your radio's PTT, requires hardware to interface the line.</p><p>Some commercial interface units also use this method.</p><p>The RTS control line of the CAT serial port may be used for this or a RTS control line on a different serial port may be used. Note that this option is not available on the CAT serial port when hardware flow control is used.</p></body></html> <html><head/><body><p>使用 RS-232 RTS 控制線路切換無線電設備的 PTT, 需要硬體來介面線路.</p><p>某些商業介面單元也使用此方法.</p><p>CAT 串列埠的 RTS 控制線路可用於此或可能用於其他串行埠上的 RTS 控制線路. 請注意,使用硬體流控制時, CAT 串行埠上不可用此選項.</p></body></html> - + R&TS - + <html><head/><body><p>Select the RS-232 serial port utilised for PTT control, this option is available when DTR or RTS is selected above as a transmit method.</p><p>This port can be the same one as the one used for CAT control.</p><p>For some interface types the special value CAT may be chosen, this is used for non-serial CAT interfaces that can control serial port control lines remotely (OmniRig for example).</p></body></html> <html><head/><body><p>選擇用於 PTT 控制的RS-232 序列埠,當選擇上述DTR或RTS作為發送方法時,此選項可用.此埠號可以與用於CAT控制的埠號相同.對於某些介面類型,可以選擇特殊值CAT,這用於可以遠程控制串口控制線的非串行CAT介面 (例如 omnirig).</p></body></html> - + Modulation mode selected on radio. 在無線電設備上選擇的操作模式. - + Mode 無線電操作模式 - + <html><head/><body><p>USB is usually the correct modulation mode,</p><p>unless the radio has a special data or packet mode setting</p><p>for AFSK operation.</p></body></html> <html><head/><body><p>上邊帶通常是正確的調制模式,除非無線電設備具有用於AFSK操作的特殊數據或數據包模式設定.</p></body></html> - + US&B 上邊帶USB(&B) - + Don't allow the program to set the radio mode (not recommended but use if the wrong mode or bandwidth is selected). @@ -7378,23 +10595,23 @@ or bandwidth is selected). 或帶寬). - - + + None 無 - + If this is available then it is usually the correct mode for this program. 如果這是可用的, 那麼它通常是這個程式的正確模式. - + Data/P&kt 數據/封包(&k) - + Some radios can select the audio input using a CAT command, this setting allows you to select which audio input will be used (if it is available then generally the Rear/Data option is best). @@ -7403,52 +10620,52 @@ this setting allows you to select which audio input will be used (如果可用,則通常 後方/數據 選項是最佳選擇). - + Transmit Audio Source 無線電設備音訊來源 - + Rear&/Data 後方&/數據埠 - + &Front/Mic 前方/麥克風(&F) - + Rig: 無線電設備型號: - + Poll Interval: 詢問間隔: - + <html><head/><body><p>Interval to poll rig for status. Longer intervals will mean that changes to the rig will take longer to be detected.</p></body></html> <html><head/><body><p>軟體與無線電設備溝通的時間間隔.時間間隔較長對無線電設備需更改更長的時間才能檢測到.</p></body></html> - + s 秒 - + <html><head/><body><p>Attempt to connect to the radio with these settings.</p><p>The button will turn green if the connection is successful or red if there is a problem.</p></body></html> <html><head/><body><p>嘗試使用這些設定連接到無線電設備.如果連接成功,該按鈕將變為綠色; 如果有問題,則為紅色.</p></body></html> - + Test CAT 測試 CAT - + Attempt to activate the transmitter. Click again to deactivate. Normally no power should be output since there is no audio being generated at this time. @@ -7461,62 +10678,62 @@ radio interface behave as expected. 的任何發送指示是否如預期的那樣. - + Test PTT 測試 PTT - + Split Operation 異頻操作 - + <html><head/><body><p>Use only VFO A for split operation (the program temporarily changes the QRG of your rig during transmission).</p></body></html> <html><head/><body><p>僅使用VFO A進行異頻操作 (程式在傳輸期間臨時更改無線電設備的QRG).</p></body></html> - + Fake It 軟體虛擬 - + <html><head/><body><p>Use VFO A+B for split operation (works with many rigs, but requires the use of both VFOs).</p></body></html> <html><head/><body><p>使用VFO A+B進行異頻操作 (適用於許多無線電設備, 但需要同時使用兩個VFO).</p></body></html> - + Rig 無線電設備控制 - + <html><head/><body><p>Don't use split (not recommended).</p></body></html> <html><head/><body><p>不使用異頻操作 (不推薦).</p></body></html> - + A&udio 音效(&u) - + Audio interface settings 音效裝置裝置設定 - + Souncard 音效裝置 - + Soundcard 音效裝置 - + Select the audio CODEC to use for transmitting. If this is your default device for system sounds then ensure that all system sounds are disabled otherwise @@ -7529,123 +10746,205 @@ transmitting periods. 向外發送輸出. - + + Delete Tx macro + + + + + Deletes the selected Tx macro, or the focused macro if no row is selected. + + + + + Move &Up + + + + + Move Tx macro up + + + + + Moves the selected Tx macro one position earlier in the list. + + + + + Move D&own + + + + + Move Tx macro down + + + + + Moves the selected Tx macro one position later in the list. + + + + + Drag and drop items to rearrange order +Right click for item specific actions +Click, SHIFT+Click and, CTRL+Click to select items + + + + + Saved Tx macro messages + + + + + Saved free-text messages for the main window Tx5 dropdown. Use Move Up and Move Down or drag and drop to reorder messages. + + + + <html><head/><body><p>Check this option to note any Special Operating Activity in the comments field.</p></body></html> <html><head/><body><p>選中此選項可在注釋欄位中注明任何特殊操作活動.</p></body></html> - + Special operating activity to comments 特殊操作活動注釋 - + + <html><head/><body><p>Log 'ZZ00' as grid if the other station doesn't send you a grid.</p></body></html> + + + + + Fill missing grids with 'ZZ00' + + + + + Log automatically + + + + + <html><head/><body><p>Use 'Log automatically' only for special operating activities.</p></body></html> + + + + + Contesting only + + + + + <html><head/><body><p>Shorten 6-digit grid entries and log 4-digit grids instead.</p></body></html> + + + + + Log 4-digit grids + + + + <html><head/><body><p>Enter the service port number of the UDP server that WSJT-X should send updates to. If this is zero no updates will be sent.</p></body></html> <html><head/><body><p>輸入 WSJT-X 應向其發送更新的 UDP 伺服器的服務埠號. 如果這是零將不發送任何更新.</p></body></html> - + Outgoing interfaces: 傳出介面: - + <html><head/><body><p>When sending updates to a multicast group address it is necessary to specify which network interface(s) to send them to. If the loop-back interface is multicast capable then at least that one will be selected.</p><p>For most users the loop-back interface is all that is needed, that will allow multiple other applications on the same machine to interoperate with WSJT-X. If applications running on other hosts are to receive status updates then a suitable network interface should be used.</p><p>On some Linux systems it may be necessary to enable multicast on the loop-back network interface.</p></body></html> <html><head/><body><p>向組播組地址發送更新時需要指定要將其發送到哪個網路介面. 如果環回介面支援組播則至少將選擇該介面.</p><p>對於大多數用戶來說迴圈回式介面是所有需要的, 將允許同一台電腦上的多個其他應用程式與 WSJT-X 進行互通. 如果在其他主機上運行的應用程式要接收狀態更新則應使用合適的網路介面.</p><p>在某些 Linux 系統上可能需要在環回網路介面上啟用組播.</p></body></html> - + <html><head/><body><p>Sets the number or router hops that multicast datagrams are allowed to make. Almost everyone should set this to 1 to keep outgoing multicast traffic withn the local subnet.</p></body></html> <html><head/><body><p>設定允許組播數據報進行的數位或路由器躍點. 幾乎每個人都應該將此設定為 1 以保持傳出的組播流量與本地子網.</p></body></html> - + Multicast TTL: 組播 TTL : - Reset Highlighting to WSJT-X default - 將高亮顯示重置為 wsjt-x 默認值 - - - - Reset Highlighting to wsjt-x_improved default - 將高亮顯示重置為 wsjt-x_improved 默認值 + 將高亮顯示重置為 wsjt-x 默認值 - + Highlight also messages with 73 or RR73 突出顯示 73 或 RR73 訊息 - - <html><head/><body><p>Highlight callsigns or grids with orange background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - <html><head/><body><p>用橙色背景色突出顯示呼號或網格. 呼號 和/或 網格必須用逗號隔開, 每個呼號後面必須有一個逗號.</p></body></html> + <html><head/><body><p>用橙色背景色突出顯示呼號或網格. 呼號 和/或 網格必須用逗號隔開, 每個呼號後面必須有一個逗號.</p></body></html> - + Highlight orange: 突出顯示橙色: - - <html><head/><body><p>Highlight callsigns or grids with blue background color. Callsigns and/or grids must be separated by a comma, and there must be a comma after each callsign.</p></body></html> - <html><head/><body><p>用藍色背景色突出顯示呼號或網格. 呼號 和/或 網格必須用逗號隔開, 每個呼號後面必須有一個逗號.</p></body></html> + <html><head/><body><p>用藍色背景色突出顯示呼號或網格. 呼號 和/或 網格必須用逗號隔開, 每個呼號後面必須有一個逗號.</p></body></html> - + Highlight blue: 突出顯示藍色: - + Days since last upload 自上次上傳以來的天數 - + Select the audio CODEC to use for receiving. 選擇音效裝置聲道. - + &Input: 輸入(&I): - + Select the channel to use for receiving. 選擇音效裝置聲道. - - + + Mono 單聲道 - - + + Left 左聲道 - - + + Right 右聲道 - - + + Both 雙聲道 - + Select the audio channel used for transmission. Unless you have multiple radios connected on different channels; then you will usually want to select mono or @@ -7655,154 +10954,343 @@ both here. 是否選擇正確. - + Enable VHF and submode features 啟用甚高頻和子功能 - + + <html><head/><body><p>Open the Astronomical Data window automatically when switching to Q65 or JT65 mode and Decode after EME delay is enabled, and close it when no longer needed.</p><p>Open the QSYMessage Creator automatically if the VHF Features are enabled and such QSY messages are applicable.</p></body></html> + + + + + Auto-open/close Astronomical data window + + + + + <html><head/><body><p>Allow automatic Doppler tracking and split/Fake It/XIT to correct the transmit frequency while transmitting, including corrections of tens of kHz on microwave bands.</p><p>This option does not allow nominal dial or band changes while transmitting or tuning. Leave it unchecked if your rig cannot accept frequency-setting CAT commands while transmitting; WSJT-X will then make one midpoint Doppler correction before transmission starts.</p></body></html> + + + + + Allow Tx-frequency corrections while transmitting + + + + + Tune watchdog + + + + + Tune watchdog timeout + + + + + Tx watchdog: + + + + + Tx watchdog timeout + + + + + ID Inter&val: + + + + + CW ID interval + + + + + <html><head/><body><p>Erase Band Activity and Rx frequency windows after band change.</p></body></html> + + + + + Erase decodes after band change + + + + + Align DXCC/distance/azimuth + + + + + <html><head/><body><p>Increase or decrease the space between message text and DXCC.</p></body></html> + + + + + DXCC alignment spacing + + + + + Distance and azimuth alignment spacing + + + + + Less button coloring (restart required) + + + + + <html><head/><body><p>Download the latest libhamlib-4.dll file from Hamlib SourceForge snapshots. </p><p>Note: This function is only available on Windows.</p></body></html> + + + + Ou&tput: 輸出(&t): - - + + Output audio channel + + + + + Input audio channel + + + + + <html><head/><body><p>Refresh audio device list.</p></body></html> + + + + + Refresh + 更新 + + + + <html><head/><body><p>Use TCI Audio when available.</p></body></html> + + + + + Use TCI Audio (restart required) + + + + + <html><head/><body><p>Rx audio level</p></body></html> + + + + + TCI receive audio level + + + + + Rx + + + + + <html><head/><body><p>Sort audio device names alphabetically.</p></body></html> + + + + + Sort alphabetically + + + + + <html><head/><body><p>Hide the usually unusable ALSA CARD subdevices on Linux.</p></body></html> + + + + + Hide ALSA CARD subdevices (Linux only) + + + + + Save Directory 儲存目錄 - + Loc&ation: WAV目錄位置(&a): - + Path to which .WAV files are saved. .WAV 檔案被儲存到那條路徑. - - + + TextLabel - + Click to select a different save directory for .WAV files. 選擇儲存路徑. - + S&elect 選擇(&e) - - + + AzEl Directory AzEl 目錄 - + Location: AzEl儲存路徑: - + Select 選擇 - + + <html><head/><body><p>Enables additional line in azel.dat for Dpol parameter.</p></body></html> + + + + + Enable extra line in azel.dat + + + + Power Memory By Band 依頻段記憶功率 - + Remember power settings by band 依頻段功率記憶設定 - + Enable power memory during transmit 在傳輸過程中啟用功率記憶 - + Transmit 發送 - + Enable power memory during tuning 在調諧期間開啟功率記憶 - + Tune 調諧 - + Tx &Macros 自定義訊息(&M) - + Canned free text messages setup 設定自定義訊息 - + + New &macro: + + + + &Add 新增(&A) - + + Add Tx macro + + + + + Adds the entered message to the saved Tx macro list. + + + + + New Tx macro message + + + + + Enter a saved free-text message for the Tx5 dropdown. Free-text messages are limited to 13 characters including spaces. + + + + &Delete 刪除(&D) - Drag and drop items to rearrange order Right click for item specific actions Click, SHIFT+Click and, CRTL+Click to select items - 拖拉項目可重新排列順序 + 拖拉項目可重新排列順序 可使用SHIFT+單擊滑鼠左鍵多選項目或Ctrl+單擊滑鼠左鍵 跳躍選擇 - + Reportin&g 報告(&g) - + Reporting and logging settings 設定日誌和報告 - + Logging 記錄日誌 - + The program will pop up a partially completed Log QSO dialog when you send a 73 or free text message. 當您發送73或自定義訊息時,程式將自動彈出完成通聯紀錄對話框. - + Promp&t me to log QSO 提示記錄通聯日誌(&t) - + Op Call: 操作員呼號: - + Some logging programs will not accept the type of reports saved by this program. Check this option to save the sent and received reports in the @@ -7813,1194 +11301,1519 @@ comments field. 注釋字段. - + d&B reports to comments 將d&B報告寫入備註欄 - Check this option to force the clearing of the DX Call and DX Grid fields when a 73 or free text message is sent. - 選中此選項, 當發送一個 73或自訂義文字, + 選中此選項, 當發送一個 73或自訂義文字, 可強制清除 DX 呼號和DX Grid 欄位. - Clear &DX call and grid after logging - 日志記錄後清除 &DX 呼號和DX Grid 欄位 + 日志記錄後清除 &DX 呼號和DX Grid 欄位 - + <html><head/><body><p>Some logging programs will not accept WSJT-X mode names.</p></body></html> <html><head/><body><p>某些日誌紀錄程式不接受 WSJT-X 模式名稱.</p></body></html> - + Con&vert mode to RTTY 將日誌紀錄轉成&RTTY模式 - + <html><head/><body><p>The callsign of the operator, if different from the station callsign.</p></body></html> <html><head/><body><p>操作員的呼號 (如果與電臺呼號不同).</p></body></html> - + <html><head/><body><p>Check to have QSOs logged automatically, when complete.</p></body></html> <html><head/><body><p>選擇當完成通聯後, 自動記錄.</p></body></html> - + Show principal prefix instead of country name 顯示前綴而非國家或地區名稱 - + Show &DXCC, grid, and worked-before status 顯示 &DXCC、網格與曾經通聯狀態 - + Show DXCC for all messages 所有訊息顯示DXCC - + MSK144/Q65: Tx until 73 is received MSK144/Q65: 發送直到接收到73 - + <html><head/><body><p>If a station sends locator, calculate and show the distance in Band Activity pane.</p></body></html> <html><head/><body><p>如果電臺發送定位, 則計算並在波段活動窗中顯示距離.</p></body></html> - + Show distance in messages with grid 在信息中帶網格的顯示距離 - + Show U.S. States in messages with grid 在信息中帶有網格的顯示美國各州 - + <html><head/><body><p>Align the text for DXCC, distance and azimuth.</p></body></html> <html><head/><body><p>對齊DXCC, 距離和方位的文字.</p></body></html> - Align DXCC / distance / azimuth - 對齊DXCC, 距離和方位 + 對齊DXCC, 距離和方位 - + Alternate Erase button behavior 備用擦除按鈕行為 - <html><head/><body><p>Increase or decrease the space between massage text and DXCC.</p></body></html> - <html><head/><body><p>新增或减少信息文本和DXCC之間的空間.</p></body></html> + <html><head/><body><p>新增或减少信息文本和DXCC之間的空間.</p></body></html> - + Enable Wait features 啟用等待功能 - + <html><head/><body><p>If a station sends a valid Maidenhead locator, calculate and show the great-circle azimuth in Band Activity pane.</p></body></html> <html><head/><body><p>如果一個電台發送了一個有效的梅登黑德定位, 則計算並在波段活動窗格中顯示大圓方位角.</p></body></html> - + Show azimuth in messages with grid 在信息中帶網格的顯示方位角 - + <html><head/><body><p>Increase or decrease the space between DXCC and distance/azimuth.</p></body></html> <html><head/><body><p>新增或减少DXCC與距離/方位之間的間距.</p></body></html> - Log automatically (contesting only) - 日誌自動記錄 (僅限競賽) + 日誌自動記錄 (僅限競賽) - + Network Services 網路服務 - + <html><head/><body><p>The program can send your station details and all decoded signals with grid squares as spots to the http://pskreporter.info web site.</p><p>This is used for reverse beacon analysis which is very useful for assessing propagation and system performance.</p></body></html> <html><head/><body><p>該程式可以將你的電臺詳細資訊和所有解碼信號以網格發送到http://pskreporter.info網站.</p><p>這用於反向信標分析,這對於評估傳播和系統性能非常有用.</p></body></html> - + Enable &PSK Reporter Spotting 啟用&PSK Reporter Spotting - + <html><head/><body><p>Check this option if a reliable connection is needed</p><p>Most users do not need this, the default uses UDP which is more efficient. Only check this if you have evidence that UDP traffic from you to PSK Reporter is being lost.</p></body></html> <html><head/><body><p>如果需要可靠的連接, 請勾選此選項</p><p>大多數使用者不需要勾選, 預設使用UDP 效率較高. .</p></body></html> - + Use TCP/IP connection 使用TCP/IP連接 - + UDP Server UDP伺服器 - + UDP Server: UDP伺服器: - + <html><head/><body><p>Optional hostname of network service to receive decodes.</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable the broadcasting of UDP status updates.</p></body></html> <html><head/><body><p>接收解碼的網路服務的可選主機名稱.</p><p>格式:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">主機名稱</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 地址</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4多點傳送組地址</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 多點傳送組地址</li></ul><p>清除此字段將禁用UDP狀態更新的廣播.</p></body></html> - + UDP Server port number: UDP伺服器埠號: - + <html><head/><body><p>With this enabled WSJT-X will accept certain requests back from a UDP server that receives decode messages.</p></body></html> <html><head/><body><p>啟用此功能後,WSJT-X 將接受來自接收解碼消息的 UDP 伺服器的某些請求.</p></body></html> - + Accept UDP requests 接受UDP請求 - + <html><head/><body><p>Indicate acceptance of an incoming UDP request. The effect of this option varies depending on the operating system and window manager, its intent is to notify the acceptance of an incoming UDP request even if this application is minimized or hidden.</p></body></html> <html><head/><body><p>指示接受傳入的 UDP 請求.此選項的效果因操作系統和視窗管理器而異,其目的是通知接受傳入的 UDP 請求,即使此應用程序最小化或隱藏</p></body></html> - + Notify on accepted UDP request 在接受UDP的請求時通知 - + <html><head/><body><p>Restore the window from minimized if an UDP request is accepted.</p></body></html> <html><head/><body><p>如果接受 UDP 請求,則從最小化還原視窗.</p></body></html> - + Accepted UDP request restores window 接受UDP請求還原視窗 - + Secondary UDP Server (deprecated) 次要UDP伺服器 - + <html><head/><body><p>When checked, WSJT-X will broadcast a logged contact in ADIF format to the configured hostname and port. </p></body></html> <html><head/><body><p>選擇後, WSJT-X 將以 ADIF 格式將紀錄的聯絡廣播到設定的主機名稱和埠. </p></body></html> - + Enable logged contact ADIF broadcast 啟用 ADIF 紀錄廣播 - + Server name or IP address: 伺服器名稱或 IP 位址: - + <html><head/><body><p>Optional host name of N1MM Logger+ program to receive ADIF UDP broadcasts. This is usually 'localhost' or ip address 127.0.0.1</p><p>Formats:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">hostname</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 multicast group address</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 multicast group address</li></ul><p>Clearing this field will disable broadcasting of ADIF information via UDP.</p></body></html> <html><head/><body><p>N1MM Logger+ 程式可選電腦主機用於接收 ADIF UDP 廣播. 這通常是 'localhost' 或 IP 地址 127.0.0.1</p><p>格式:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">主機名稱</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 地址</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 地址</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv4 多播組地址</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">IPv6 多播組地址</li></ul><p>清除此欄位將停用透過UDP廣播ADIF資訊.</p></body></html> - + Server port number: 伺服器連接埠號: - + <html><head/><body><p>Enter the port number that WSJT-X should use for UDP broadcasts of ADIF log information. For N1MM Logger+, this value should be 2333. If this is zero, no updates will be broadcast.</p></body></html> <html><head/><body><p>輸入 WSJT-X 應用於 ADIF 日誌資訊的 UDP 廣播的埠號. 對於 N1MM Logger+, 此值應為 2333. 如果為零, 將不會廣播任何資料.</p></body></html> - + Frequencies 頻率 - + Default frequencies and band specific station details setup 設定預設頻率和波段等特定電臺詳細資訊 - + <html><head/><body><p>See &quot;Frequency Calibration&quot; in the WSJT-X User Guide for details of how to determine these parameters for your radio.</p></body></html> <html><head/><body><p>參閱 &quot;頻率校準&quot; 在 WSJT-X 使用者指南中, 有關如何確定無線電的這些參數的詳細資訊.</p></body></html> - + Frequency Calibration 頻率校準 - + Slope: 斜率: - + ppm - + Intercept: 攔截: - + Hz 赫茲 - + Working Frequencies 操作頻率 - + + + Insert, delete, load, save, merge, or reset working frequencies. + + + + + Working frequencies actions + + + + + + + Actions... + + + + <html><head/><body><p>Right click to maintain the working frequencies list.</p></body></html> <html><head/><body><p>點選右鍵保持工作頻率清單.</p></body></html> - + Station Information 電臺相關資料 - + + + Insert or delete station information rows. + + + + + Station information actions + + + + Items may be edited. Right click for insert and delete options. 專案可以編輯 右鍵按下以插入與刪除選項. - + Colors 顏色 - + Decode Highlightling 解碼醒目提示 - + + Change or reset colors for the selected highlighting rule. + + + + + Move the selected highlighting rule earlier in priority order. + + + + + Move Up + + + + + Move the selected highlighting rule later in priority order. + + + + + Move Down + + + + + Reset Highlighting to Default 1 + + + + + Reset Highlighting to Default 2 + + + + <html><head/><body><p>Click to scan the wsjtx_log.adi ADIF file again for worked before information</p></body></html> <html><head/><body><p>按一下再次掃描wsjtx_log.adi ADIF檔,取得歷史資訊</p></body></html> - + Rescan ADIF Log 重新掃描 ADIF 日誌 - + <html><head/><body><p>Push to reset all highlight items above to default values and priorities.</p></body></html> <html><head/><body><p>推送將上述所有突出顯示項重置為預設值和優先順序.</p></body></html> - Reset Highlighting - 重置突出顯示 + 重置突出顯示 - + <html><head/><body><p>Enable or disable using the check boxes and right-click an item to change or unset the foreground color, background color, or reset the item to default values. Drag and drop the items to change their priority, higher in the list is higher in priority.</p><p>Note that each foreground or background color may be either set or unset, unset means that it is not allocated for that item's type and lower priority items may apply.</p></body></html> <html><head/><body><p>使用複選框啟用或停用專案, 並右鍵單擊專案以更改或取消設定前景顏色, 背景顏色, 或將專案重置為預設值. 拖放專案以更改其優先順序, 清單中較高的優先順序較高.</p><p> 請注意,每個前景或背景顏色都可以設定或取消設定, 未設定意味著未為該專案分配該類型, 低優先順序項可能適用.</p></body></html> - + <html><head/><body><p>Check to indicate new DXCC entities, grid squares, and callsigns per mode.</p></body></html> <html><head/><body><p>選擇以指示每個模式新的 DXCC 實體, 網格和呼號.</p></body></html> - + Highlight by Mode 依模式醒目提示顯示 - + Include extra WAE entities 包括額外的 WAE 實體 - + Check to for grid highlighting to only apply to unworked grid fields 檢查到網格突出顯示僅套用於未通聯的網格欄位 - + Only grid Fields sought 僅尋求網格欄位 - + <html><head/><body><p>Controls for Logbook of the World user lookup.</p></body></html> <html><head/><body><p>控制 LoTW 使用者尋找日誌.</p></body></html> - + Logbook of the World User Validation LoTW 已驗證使用者 - + Users CSV file URL: 使用者 CSV 檔案網址: - + <html><head/><body><p>URL of the ARRL LotW user's last upload dates and times data file which is used to highlight decodes from stations that are known to upload their log file to LotW.</p></body></html> <html><head/><body><p>ARRL LoTW 使用者上次上傳日期和時間資料檔案的網址, 該檔案用於突出顯示已知將紀錄檔上載到 LoTW 的電臺的解碼.</p></body></html> - URL - 網址 + 網址 - + <html><head/><body><p>Push this button to fetch the latest LotW user's upload date and time data file.</p></body></html> <html><head/><body><p>按下此按鈕即可取得最新的 LoRW 使用者的上傳日期和時間資料檔.</p></body></html> - + Fetch Now 立即取得 - + Age of last upload less than: 上次上傳的日期小於: - + <html><head/><body><p>Adjust this spin box to set the age threshold of LotW user's last upload date that is accepted as a current LotW user.</p></body></html> <html><head/><body><p>調整此旋轉框以設定 LoTW 使用者最後一個上傳日期的日期閾值,該日期被接受為當前 LoTW 使用者.</p></body></html> - + days 天 - + Advanced 進階設定 - + <html><head/><body><p>User-selectable parameters for JT65 VHF/UHF/Microwave decoding.</p></body></html> <html><head/><body><p>使用者可選參數用於JT65 VHF/UHF/Microwave 的解碼.</p></body></html> - + JT65 VHF/UHF/Microwave decoding parameters JT65 VHF/UHF/Microwave 解碼參數 - + Random erasure patterns: 隨機清除模式: - + <html><head/><body><p>Maximum number of erasure patterns for stochastic soft-decision Reed Solomon decoder is 10^(n/2).</p></body></html> <html><head/><body><p>隨機軟決策 Reed Solomon 解碼器的最大清除模式數為 10^(n/2).</p></body></html> - + Aggressive decoding level: 主動解碼等級: - + <html><head/><body><p>Higher levels will increase the probability of decoding, but will also increase probability of a false decode.</p></body></html> <html><head/><body><p>較高的水準會增加解碼的概率,但也會增加錯誤解碼的概率.</p></body></html> - + Two-pass decoding 使用二次解碼 - Special operating activity: Generation of FT4, FT8, and MSK144 messages - 特殊競賽模式: 產生FT4, FT8 和 MSK144 訊息 + 特殊競賽模式: 產生FT4, FT8 和 MSK144 訊息 - + NA VHF - + <html><head/><body><p>FT8 DXpedition mode: Hound operator calling the DX.</p></body></html> <html><head/><body><p>FT8 DX遠征模式呼叫DX的獵犬操作員.</p></body></html> - - + + Hound 獵犬 - + <html><head/><body><p>North American VHF/UHF/Microwave contests and others in which a 4-character grid locator is the required exchange.</p></body></html> <html><head/><body><p>北美 VHF/UHF/Microwave 競賽和其他需要交換的 4 個字元網格定位的競賽.</p></body></html> - + NA VHF Contest NA VHF 競賽 - + <html><head/><body><p>FT8 DXpedition mode: Fox (DXpedition) operator.</p></body></html> <html><head/><body><p>FT8 DX遠征模式: 狐狸 (DX遠征) 操作員.</p></body></html> - - + + Fox 狐狸 - + <html><head/><body><p>European VHF+ contests requiring a signal report, serial number, and 6-character locator.</p></body></html> <html><head/><body><p>歐洲 VHF+ 競賽需要信號報告, 序列號和 6 個字元定位.</p></body></html> - - + + EU VHF Contest - - R T T Y Roundup - - - - + CTY File Download CTY 文件下載 - + CTY File Version: CTY 文件版本: - + Download Latest CTY.dat 下載最新的 CTY.dat - - FT Roundup - - - - RTTY Roundup exchange - RTTY Roundup 交換 + RTTY Roundup 交換 - <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> - <html><head/><body><p>FT Roundup 和類似的競賽. 交換是美國州, 加拿大省或 &quot;DX&quot;.</p></body></html> + <html><head/><body><p>FT Roundup 和類似的競賽. 交換是美國州, 加拿大省或 &quot;DX&quot;.</p></body></html> - + NJ - - + + <html><head/><body><p>ARRL Field Day exchange: number of transmitters, Class, and ARRL/RAC section or &quot;DX&quot;.</p></body></html> <html><head/><body><p>ARRL Field Day 交換: 發送機數量, 類別別, 和 ARRL/RAC 部份或 &quot;DX&quot;.</p></body></html> - + Special operating activity 特殊操作活動 - - A R R L Field Day - - - - + + ARRL Field Day - + + Field Day exchange Field Day 交換 - + FD Exch: FD 交換: - + 6A SNJ - <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW. </p></body></html> - <html><head/><body><p>用一個單獨競賽名稱呼叫, 而不是CQ TEST, RU, 或 WW. </p></body></html> + <html><head/><body><p>用一個單獨競賽名稱呼叫, 而不是CQ TEST, RU, 或 WW. </p></body></html> - + <html><head/><body><p>ARRL International Digital Contest</p></body></html> - + ARRL Digi Contest - + <html><head/><body><p>World-Wide Digi-mode contest</p><p><br/></p></body></html> - - WW Digital Contest - - - - + + WW Digi Contest - + <html><head/><body><p>Exchange 4-character locator instead of signal report. Provides q3-level sensitivities for the DX operator. Especially useful for 6m EME DXpeditions.</p></body></html> <html><head/><body><p>交換4個字元的定位而不是訊號報告. 為DX操作員提供 q3級 靈敏度. 特別適用於6m EME DX遠征特别有用.</p></body></html> - + Q65 Pileup Q65 堆叠 - + Miscellaneous 雜項 - + Degrade S/N of .wav file: 降低信噪比的 .wav文件: - - + + For offline sensitivity tests 用於離線靈敏度測試 - + + dB 分貝 - + Receiver bandwidth: 接收頻寬: - + Hz 赫茲 - + Tx delay: 發送延遲: - + Minimum delay between assertion of PTT and start of Tx audio. PTT 驗證與發送音訊啟動之間的最小延遲. - + s 秒 - - + + Tone spacing 音調間距 - + <html><head/><body><p>Generate Tx audio with twice the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-2 before generating RF.</p></body></html> <html><head/><body><p>產生具有正常音調間距兩倍的發送音頻. 適用於在產生射頻之前使用除以 2 的特殊 LF/MF 發送器.</p></body></html> - + x 2 - + <html><head/><body><p>Generate Tx audio with four times the normal tone spacing. Intended for special LF/MF transmitters that use a divide-by-4 before generating RF.</p></body></html> <html><head/><body><p>具有正常音調間距四倍的發送音頻. 適用於在產生射頻之前使用除以 4 的特殊 LF/MF 發送器.</p></body></html> - + x 4 - - + + Waterfall spectra 瀑布頻譜 - + Low sidelobes 低側邊 - + Most sensitive 最敏銳 - + + + FT Roundup exchange + + + + <html><head/><body><p>Call CQ with an individual contest name instead of TEST, RU, or WW (for example CQ PACC).</p></body></html> <html><head/><body><p>使用單一個競賽名稱呼叫, 而不是CQ TEST, RU, or WW (例如 CQ PACC).</p></body></html> - - + + <html><head/><body><p>FT Roundup and similar contests. Exchange is US state, Canadian province, or &quot;DX&quot;.</p></body></html> <html><head/><body><p>FT Roundup 和類似比賽. Exchange 為美國州, 加拿大省或 &quot;DX&quot;.</p></body></html> - + + FT Roundup messages - + FT RU Exch: - + CQ with individual contest name CQ 單獨競賽名稱 - + + + Contest name + + + + Contest name: 競賽名稱: - + + Ensure that you have made meaningful settings on the Colors tab, so that you see which message triggered the alert. + + + + + NOTES + + + + + Ensure that your rig is NOT connected via "Default Device". + + + + + "Wanted callsigns, grids, prefixes and directional calls" uses the entries from "Highlight orange" and "Highlight blue". + + + + + This requirement is fulfilled when your rig is connected via USB audio. + + + + + Message received + + + + + <html><head/><body><p>Wanted callsigns, grids, prefixes and directional calls. This alert category uses the entries from &quot;Highlight orange&quot; and &quot;Highlight blue&quot;.</p></body></html> + + + + + Wanted callsigns, grids, prefixes and directional calls + + + + + IMPORTANT + + + + + Voices: + + + + + default + + + + + <html><head/><body><p>Test the alert sounds.</p></body></html> + + + + + Test + + + + + Alert categories above the line require to have the box "Show DXCC, grid, and worked-before status" on the General tab checked. + + + + Filters 過濾 - + Hide messages containing the following callsigns or keywords: 隱藏包含以下呼號或關鍵字的消息: - + Show only messages containing the following callsigns or keywords: 僅顯示包含以下呼號或關鍵字的消息: - + Show the separator line between periods with time stamp of the decode period. 用解碼週期的時間戳顯示週期之間的分隔線. - + Show blank line with time stamp 顯示帶有時間戳的空行 - + <html><head/><body><p>Tx until 73 is received when in MSK144 or Q65 mode. </p></body></html> <html><head/><body><p>在MSK144或Q65模式下, 继续发射直到接收到73. </p></body></html> - <html><head/><body><p>Open the Astronomical Data window automatically when switching to Q65 or JT65 mode and Decode after EME delay is enabled, and close it when no longer needed.</p></body></html> - <html><head/><body><p>當切換到Q65或JT 65模式自動打開天文數據窗口, 並在啟用EME延遲後解碼, 當不再需要時關閉它.</p></body></html> + <html><head/><body><p>當切換到Q65或JT 65模式自動打開天文數據窗口, 並在啟用EME延遲後解碼, 當不再需要時關閉它.</p></body></html> - Auto-open/close Astronomical Data window - 自動打開/關閉 天文數據窗口 + 自動打開/關閉 天文數據窗口 - + <html><head/><body><p>Turn the progress bar red while transmitting.</p></body></html> <html><head/><body><p>發射時將進度條變為紅色.</p></body></html> - + Turn progress bar red while transmitting 發射時將進度條變為紅色 - + <html><head/><body><p>Allow kHz frequency offset entry without 'k' suffix.</p></body></html> <html><head/><body><p>允許不帶 'k' 後綴的 kHz 頻率偏移輸入.</p></body></html> - + kHz entry without k (restart required) kHz 輸入不帶 'k' (需要重啟) - Disable button coloring unless mandatory (restart required) - 禁用按鈕顏色, 除非是強制 (需要重新啟動) + 禁用按鈕顏色, 除非是強制 (需要重新啟動) - - + + Update Hamlib 更新 Hamlib - + 32-bit 32-位元 - + <html><head/><body><p>Revert the last Hamlib update. </p><p>Note: This function is only available on Windows.</p></body></html> <html><head/><body><p>還原最後 Hamlib 更新. </p><p>注意: 此功能僅在Windows上可用.</p></body></html> - + Revert Update 還原更新 - <html><head/><body><p>Download the latest libhamlib-4.dll file from https://n0nb.users.sourceforge.net/. </p><p>Note: This function is only available on Windows.</p></body></html> - <html><head/><body><p>從 https://n0nb.users.sourceforge.net/ 下載最新的libhamlib-4.dll檔案. </p><p>注意: 此功能僅在Windows上可用.</p></body></html> + <html><head/><body><p>從 https://n0nb.users.sourceforge.net/ 下載最新的libhamlib-4.dll檔案. </p><p>注意: 此功能僅在Windows上可用.</p></body></html> - + In use: 在使用: - + Backed up: 已備份: - + 64-bit 64-位元 - + Rig Data 無線電設備數據 - + <html><head/><body><p>Stop transmitting immediately when SWR exceeds 2.5.</p></body></html> <html><head/><body><p>當駐波比大於 2.5 時立即停止發射.</p></body></html> - + Halt Tx when SWR > 2.5 當駐波比大於 2.5 時停止發射 - + <html><head/><body><p>Read and display transmit PWR and SWR of your rig.</p></body></html> <html><head/><body><p>讀取並顯示您的無線電設備的發射 功率和駐波比.</p></body></html> - + Read and display PWR and SWR 讀取並顯示 功率和駐波比 - + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with orange background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + + <html><head/><body><p>Highlight callsigns, grids, prefixes, or directional CQ calls with blue background color. Separate callsigns, grids, and directional calls with commas; spaces after commas are allowed. Include a trailing comma after each callsign or grid, and end each prefix with a semicolon. A leading comma is not required, and a single directional call needs no comma. Wildcards (*) are allowed after single-character prefixes to match compound-prefix entities too (e.g. ;K*;); without the wildcard, a single-character prefix only matches calls whose 2nd character is a digit. To exclude a 2- or 3-character prefix even when a wildcard would otherwise match it, place an exclamation mark before and after it (e.g. ;K*;!KH6!KL!KP!).</p></body></html> + + + + + LotW users CSV URL + + + + http://lotw.arrl.org/lotw-user-activity.csv - + CALL3 File Download CALL3 文件下載 - + CALL3 File Version: CALL3 文件版本: - + Dowload latest CALL3.TXT file. 下載最新的 CALL3.TXT 文件. - + Download CALL3.TXT for terrestrial use 下載 CALL3.TXT 供 IARU 分區使用 - + Dowload latest CALL3.TXT file for EME. This version is suitable for JT65 Deep Search. 為EME下載最新 CALL3.TXT 檔案. 該版本適用於 JT65 深度搜索. - + Download CALL3.TXT for EME 下載 CALL3.TXT 供 EME 使用 - + + + <html><head/><body><p>Upload logged QSOs to Cloudlog or Wavelog.</p></body></html> + + + + + Cloudlog or Wavelog + + + + + + Upload QSOs to Cloudlog or Wavelog + + + + + + <html><head/><body><p>API URL for Cloudlog or Wavelog.</p></body></html> + + + + + + <html><head/><body><p>Your API key.</p></body></html> + + + + + + <html><head/><body><p>Your Cloudlog or Wavelog station profile.</p></body></html> + + + + + Station profile: + + + + + <html><head/><body><p>Check the Cloudlog or Wavelog connection, API key, station profile, and upload path where safe.</p><p>The button will turn green if the connection can upload QSOs, orange if the key is valid but read-only, and red if the configuration is unusable.</p></body></html> + + + + + Check Connection + + + + + 2x tone spacing + + + + + 4x tone spacing + + + + + + <html><head/><body><p>Upload logged QSOs to eqsl.cc.</p></body></html> + + + + + eQSL.cc + + + + + + Upload QSOs to eQSL.cc + + + + + + <html><head/><body><p>Your username.</p></body></html> + + + + + Username: + + + + + + <html><head/><body><p>Your logon password.</p></body></html> + + + + + Password: + + + + + + <html><head/><body><p>Your QTH nickname, if you have more than one QTH.</p></body></html> + + + + + QTH: + + + + + + Enable special operating activity + + + + + <html><head/><body><p>Click to enable OTP method of Fox verification. Requires internet.</p></body></html> + + + + + Enable OTP verification + + + + + OTP + + + + + + OTP key + + + + + <html><head/><body><p>Fox's key to generate OTP Codes.</p></body></html> + + + + + M2ZUU5CW6EVOY2HU + + + + + + OTP interval + + + + + Interval + + + + + <html><head/><body><p>Interval at which the OTP messages are sent. Select 1 to sign every message.</p></body></html> + + + + + <html><head/><body><p>Show OTP messages in the Band Activity window.</p></body></html> + + + + + Show OTP messages + + + + + + OTP URL + + + + + OTP URL: + + + + + <html><head/><body><p>URL used to verify OTP codes.</p></body></html> + + + + + https://www.9dx.cc + + + + <html><head/><body><p>Toggle the NCCC Sprint FT4 short message protocol On/Off.</p></body></html> <html><head/><body><p>啟用/停用 NCCC Sprint FT4短信息協議.</p></body></html> - + NCCC Sprint - <html><head/><body><p>Autofill 'ZZ00' in the logbook if the other station doesn't send you a grid.</p></body></html> - <html><head/><body><p>如果另一個電台沒有向您發送格網, 則在日誌中自動填充 'ZZ00'.</p></body></html> + <html><head/><body><p>如果另一個電台沒有向您發送格網, 則在日誌中自動填充 'ZZ00'.</p></body></html> - Autofill 'ZZ00' for missing Grid - 為缺少的網格自動填充 'ZZ00' + 為缺少的網格自動填充 'ZZ00' - Enable Cloudlog Features - 啟用Cloudlog功能 + 啟用Cloudlog功能 - Tune watchdog - 調諧監察器 + 調諧監察器 - + <html><head/><body><p>Number of seconds before Tune is aborted</p></body></html> <html><head/><body><p>中止調諧前的秒數</p></body></html> - + seconds 秒 - + API URL: API網址: - + API Key: API密匙: - Station ID: - 電臺 ID: + 電臺 ID: - <html><head/><body><p>Test the Cloudlog API key.</p><p>The button will turn green if the API key is writable. It will turn orange if the API key is read-only. If the API key is invalid it will turn red.</p></body></html> - <html><head/><body><p>測試 API密匙.</p><p>如果API金鑰可寫, 則按鈕將變為綠色. 如果API金鑰是只讀的, 它將變為橙色. 如果API金鑰無效, 它將變為紅色.</p></body></html> + <html><head/><body><p>測試 API密匙.</p><p>如果API金鑰可寫, 則按鈕將變為綠色. 如果API金鑰是只讀的, 它將變為橙色. 如果API金鑰無效, 它將變為紅色.</p></body></html> - Test API Key - 測試 API密匙 + 測試 API密匙 - + <html><head/><body><p>Check this box to transmit (Fox) or receive (Hound) the SuperFox waveform.</p></body></html> <html><head/><body><p>勾選此框以發送 (狐狸) 或接收 (獵犬) 超級狐狸 波形.</p></body></html> - + SuperFox mode 超級狐狸模式 - + Key: 密鑰: - <html><head/><body><p>SuperFox operator must enter a valid key to enable transmission.</p></body></html> - <html><head/><body><p>超級狐貍操作員必須輸入有效的密鑰才能啟用發送.</p></body></html> + <html><head/><body><p>超級狐貍操作員必須輸入有效的密鑰才能啟用發送.</p></body></html> - + GUI tweaks for high-resolution monitors 高解析度顯示器的用戶介面調整 - + <html><head/><body><p>HighDPI scaling enables a larger and more proportionally correct display of the controls on 4K monitors (if supported by the OS).</p></body></html> <html><head/><body><p>高DPI 縮放 可在 4K 顯示器上更大更正確地顯示控件 (如果操作系統支援).</p></body></html> - + HighDPI scaling (restart required) 高DPI 縮放 (需要重啟) - + <html><head/><body><p>Increased height of some control elements.</p></body></html> <html><head/><body><p>增加了某些控制元件的高度.</p></body></html> - + Increased height of the tab widget (restart required) 增加了選項卡小部件的高度 (需要重新啟動) - + Alerts 警報 - Ensure that your rig is NOT connected via "DefaultAudioDevice" !!! - 確保無線電設備不是通過 "默認音訊設備" 連接 !!! + 確保無線電設備不是通過 "默認音訊設備" 連接 !!! - + Audio Alerts 音訊警報 - - + + New Grid 新網格 - + My Call in message 我呼號在訊息內 - + My Call 我的呼號 - - + + New Continent 新大洲 - - + + New ITU Zone 新ITU區 - - + + New CQ Zone 新CQ區 - - + + New DXCC 新DXCC - - + + New DXCC on Band 新DXCC 波段 - - + + New ITU Zone on Band 新ITU 區 波段 - - + + New Continent on Band 新大洲 波段 - - + + New Grid on Band 新網格 波段 - - + + New CQ Zone on Band 新CQ區 波段 - - + + DX Call or DX Grid in message DX呼號或DX網格在信息內 - + Toggle Audio Alerts on/off. Alerts will be played on "DefaultAudioDevice". DON'T ENABLE AUDIO ALERTS WHEN YOUR RIG IS CONNECTED VIA THIS SOUNDCARD !!! 切換 啟用/停用 音訊警報. 警報將在 "默認音訊設備" 上播放. 當你的無線電設備通過這個聲卡連接時, 不要啟用音訊警報 !!! - + Enable Audio Alerts 開啟 音訊警報 - - + + CQ in message CQ 訊息 - + Use of this feature requires that your computer is equipped with two sound cards. 使用此功能您的電腦需要配備兩個聲卡. - This requirement is fulfilled when your rig is connected via USB audio (FT-991, IC-7300, etc.). - 當您的無線電設備通過USB音訊 (FT-991, IC-7300, 等) 連接時, 即可滿足此要求. + 當您的無線電設備通過USB音訊 (FT-991, IC-7300, 等) 連接時, 即可滿足此要求. - + Audio Alerts will be played on the default audio device (usually the loudspeaker of your PC). 音訊警報將在默認音訊設備 (通常是電腦的揚聲器) 上播放. - WARNING: THIS FEATURE IS FOR EXPERIENCED USERS ONLY !!! - 警告: 此功能僅適用於有經驗的用戶 !!! + 警告: 此功能僅適用於有經驗的用戶 !!! - IMPORTANT NOTE: Enable Audio Alerts only in case your rig is NOT connected via "DefaultAudioDevice" !!! - 重要提示: 僅當您的設備未通過 "默認音訊設備" 連接時才啟用音訊警報!!! + 重要提示: 僅當您的設備未通過 "默認音訊設備" 連接時才啟用音訊警報!!! - + Always pass messages with the following keywords: 始終通過帶有以下關鍵字的訊息: - + Filters for the Band Activity window 波段活動視窗的篩檢程式 - + Territories 1-4 for the Hide checkboxes in the View menu 查看菜單中隱藏覆選框的區域1-4 - + <html><head/><body><p>Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed).</p></body></html> <html><head/><body><p>使用過濾器 等待和突襲, CQ:第一, 等. 僅 (仍顯示所有消息).</p></body></html> - + Use filters for Wait and Pounce, CQ: First, etc. only (all messages are still displayed) 使用過濾器 等待和突襲, CQ:第一, 等. 僅 (仍顯示所有消息) - + <html><head/><body><p>Apply filters only to the callsigns of the calling stations. Usually the second word of the messages is analyzed, for directional calls the third word.</p></body></html> <html><head/><body><p>只對呼叫電台的呼號使用過濾. 通常分析消息的第二個字, 對於定向呼叫, 分析第三個字.</p></body></html> - + Apply filters only to the callsigns of the calling stations 應用過濾僅對呼叫電台的呼號 - + Blacklist 黑名單 - + Whitelist 白名單 - + Always Pass 始終通過 - + + <html><head/><body><p>Use “worked today and yesterday” instead of “worked today” for the 3 related Quick Filters.</p></body></html> + + + + + Quick Filters: Hide/Ignore/Highlight "worked today and yesterday" instead of "worked today" (UTC) + + + + <html><head/><body><p>Discard (Cancel) or apply (OK) configuration changes including</p><p>resetting the radio interface and applying any soundcard changes</p></body></html> <html><head/><body><p>放棄 (取消) 或應用 (確定) 設定更改, 包括</p><p>重置無線電介面並套用任何音效卡變更</p></body></html> @@ -9008,53 +12821,114 @@ Right click for insert and delete options. main - + + Lock file: %1 + + + + + Owner process: %1 + + + + + Owner application: %1 + + + + + Owner host: %1 + + + + + Owner information is not available. + + + + + Remove error: %1 + + + + + Another instance may be running + + + + + WSJT-X could not lock its temporary instance file. + +If another WSJT-X window is still running, choose No. +Use a unique rig name to run more than one instance. + +If WSJT-X crashed or will not restart, choose Remove Lock File. +Choose Retry after closing the other instance. + + + + + Remove Lock File + + + + + Unable to remove stale lock file + + + + + Close any running WSJT-X instance or remove the lock file manually after confirming WSJT-X is not running. + + + + Failed to create a temporary directory 無法建立暫存目錄 - - + + Path: "%1" 路徑: "%1" - + Failed to create a usable temporary directory 無法建立可用的暫存目錄 - + Another application may be locking the directory 另一個應用程式可能正在鎖定目錄 - + Failed to create data directory 無法建立資料目錄 - + path: "%1" 路徑: "%1" - + Shared memory error 共用記憶體錯誤 - + Unable to create shared memory segment 無法建立共用記憶體區段 - + Sub-process error 子程式錯誤 - + Failed to close orphaned jt9 process 無法關閉佔留的JT9程序 diff --git a/validators/CallsignValidator.cpp b/validators/CallsignValidator.cpp index d6aba538..5fbebfe4 100644 --- a/validators/CallsignValidator.cpp +++ b/validators/CallsignValidator.cpp @@ -6,6 +6,17 @@ CallsignValidator::CallsignValidator (QObject * parent, bool allow_compound) { } +QString CallsignValidator::normalizeStoredInput (QString input, int max_length, + bool allow_compound) +{ + input = input.trimmed (); + input.truncate (max_length); + CallsignValidator validator {nullptr, allow_compound}; + auto pos = input.size (); + if (Invalid == validator.validate (input, pos)) input.clear (); + return input; +} + auto CallsignValidator::validate (QString& input, int& pos) const -> State { input = input.toUpper (); diff --git a/validators/CallsignValidator.hpp b/validators/CallsignValidator.hpp index f38bc3e3..ef061b01 100644 --- a/validators/CallsignValidator.hpp +++ b/validators/CallsignValidator.hpp @@ -12,6 +12,8 @@ class CallsignValidator final { public: CallsignValidator (QObject * parent = nullptr, bool allow_compound = true); + static QString normalizeStoredInput (QString input, int max_length, + bool allow_compound = true); // QValidator implementation State validate (QString& input, int& pos) const override; diff --git a/validators/LiveCQCallsign.cpp b/validators/LiveCQCallsign.cpp new file mode 100644 index 00000000..14f151bf --- /dev/null +++ b/validators/LiveCQCallsign.cpp @@ -0,0 +1,64 @@ +#include "LiveCQCallsign.hpp" + +#include +#include + +namespace LiveCQ +{ + bool isValidCallsign (QString const& callsign) + { + auto callsignWithoutMarkers = callsign; + if (callsignWithoutMarkers.contains('.') + || callsignWithoutMarkers.contains('+') + || callsignWithoutMarkers.contains('-') + || callsignWithoutMarkers.contains('?')) { + return false; + } + callsignWithoutMarkers.remove('<'); + callsignWithoutMarkers.remove('>'); + if (callsignWithoutMarkers.length() > 11) { + return false; + } + + auto const parts = callsignWithoutMarkers.split('/'); + auto baseCall = callsignWithoutMarkers; + if (parts.size() > 1) { + baseCall = parts.at(0).length() > parts.at(1).length() + ? parts.at(0) : parts.at(1); + } + baseCall = baseCall.trimmed(); + auto const baseLength = baseCall.length(); + if (baseLength < 3 || baseLength > 8) { + return false; + } + + if (!baseCall.at(0).isLetter() && !baseCall.at(1).isLetter()) { + return false; + } + if (baseCall.at(0) == 'Q' && baseCall.mid(0, 5) != "QU1RK") { + return false; + } + + int digitPosition = 0; + for (int i = 1; i < qMin(static_cast (baseLength), 4); ++i) { + if (baseCall.at(i).isDigit()) { + digitPosition = i; + } + } + if (digitPosition == 0 || digitPosition == baseLength) { + return false; + } + + auto const suffixLength = baseLength - digitPosition - 1; + if (suffixLength < 1 || suffixLength > 4) { + return false; + } + for (int i = digitPosition + 1; i < baseLength; ++i) { + auto const character = baseCall.at(i); + if (character < QChar {'A'} || character > QChar {'Z'}) { + return false; + } + } + return true; + } +} diff --git a/validators/LiveCQCallsign.hpp b/validators/LiveCQCallsign.hpp new file mode 100644 index 00000000..489e1857 --- /dev/null +++ b/validators/LiveCQCallsign.hpp @@ -0,0 +1,11 @@ +#ifndef LIVE_CQ_CALLSIGN_HPP__ +#define LIVE_CQ_CALLSIGN_HPP__ + +#include + +namespace LiveCQ +{ + bool isValidCallsign (QString const& callsign); +} + +#endif diff --git a/validators/LiveFrequencyValidator.cpp b/validators/LiveFrequencyValidator.cpp index 4a15daf2..11b35654 100644 --- a/validators/LiveFrequencyValidator.cpp +++ b/validators/LiveFrequencyValidator.cpp @@ -36,6 +36,8 @@ LiveFrequencyValidator::LiveFrequencyValidator (QComboBox * combo_box , combo_box_ {combo_box} , kHz_without_k_ {kHz_without_k} { + connect (combo_box_->lineEdit (), &QLineEdit::textEdited, this, + [this] (QString const&) {user_edited_ = true;}); } auto LiveFrequencyValidator::validate (QString& input, int& pos) const -> State @@ -48,6 +50,10 @@ auto LiveFrequencyValidator::validate (QString& input, int& pos) const -> State void LiveFrequencyValidator::fixup (QString& input) const { + auto const user_edited = user_edited_; + user_edited_ = false; + Frequency requested_frequency {0}; + bool has_requested_frequency {false}; QRegExpValidator::fixup (input); if (!bands_->oob ().startsWith (input)) { @@ -65,7 +71,8 @@ void LiveFrequencyValidator::fixup (QString& input) const } if (!frequencies.isEmpty ()) { - Q_EMIT valid (frequencies.first ().value ()); + requested_frequency = frequencies.first ().value (); + has_requested_frequency = true; } else { @@ -78,14 +85,16 @@ void LiveFrequencyValidator::fixup (QString& input) const auto f = Radio::frequency (input.remove (QChar {'k'}, Qt::CaseInsensitive), 3); f += *nominal_frequency_ / 1000000u * 1000000u; input = bands_->find (f); - Q_EMIT valid (f); + requested_frequency = f; + has_requested_frequency = true; } else { // frequency input auto f = Radio::frequency (input.remove (QChar {'M'}, Qt::CaseSensitive), 6); input = bands_->find (f); - Q_EMIT valid (f); + requested_frequency = f; + has_requested_frequency = true; } if (bands_->oob () == input) @@ -97,5 +106,6 @@ void LiveFrequencyValidator::fixup (QString& input) const combo_box_->lineEdit ()->setStyleSheet ({}); } combo_box_->setCurrentText (input); + if (user_edited && has_requested_frequency) Q_EMIT valid (requested_frequency); } } diff --git a/validators/LiveFrequencyValidator.hpp b/validators/LiveFrequencyValidator.hpp index f0ab05fb..9a70327c 100644 --- a/validators/LiveFrequencyValidator.hpp +++ b/validators/LiveFrequencyValidator.hpp @@ -52,6 +52,7 @@ private: Frequency const * nominal_frequency_; QComboBox * combo_box_; bool kHz_without_k_ = false; + mutable bool user_edited_ = false; }; #endif diff --git a/validators/validators.pri b/validators/validators.pri deleted file mode 100644 index b8adf226..00000000 --- a/validators/validators.pri +++ /dev/null @@ -1,7 +0,0 @@ -SOURCES += \ - validators/LiveFrequencyValidator.cpp \ - validators/CallsignValidator.cpp - -HEADERS += \ - validators/LiveFrequencyValidator.hpp \ - validators/CallsignValidator.hpp diff --git a/widgets/BandHopping.cpp b/widgets/BandHopping.cpp new file mode 100644 index 00000000..867511d7 --- /dev/null +++ b/widgets/BandHopping.cpp @@ -0,0 +1,18 @@ +#include "widgets/BandHopping.hpp" + +int next_band_hop_index (std::vector const& selected, int start_index) +{ + auto const entry_count = static_cast (selected.size ()); + if (0 == entry_count) return -1; + + auto normalized_start = start_index % entry_count; + if (normalized_start < 0) normalized_start += entry_count; + + for (int offset = 0; offset < entry_count; ++offset) + { + auto const index = (normalized_start + offset) % entry_count; + if (selected[index]) return index; + } + + return -1; +} diff --git a/widgets/BandHopping.hpp b/widgets/BandHopping.hpp new file mode 100644 index 00000000..f8a43bbe --- /dev/null +++ b/widgets/BandHopping.hpp @@ -0,0 +1,8 @@ +#ifndef BAND_HOPPING_HPP +#define BAND_HOPPING_HPP + +#include + +int next_band_hop_index (std::vector const& selected, int start_index); + +#endif diff --git a/widgets/CompactButtonSize.hpp b/widgets/CompactButtonSize.hpp new file mode 100644 index 00000000..d9455456 --- /dev/null +++ b/widgets/CompactButtonSize.hpp @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +#ifndef COMPACT_BUTTON_SIZE_HPP +#define COMPACT_BUTTON_SIZE_HPP + +#include +#include +#include + +// Measure the label and native decoration without the style's recommended +// dialog-button width (75 logical pixels on Windows). Painting stays native. +inline QSize compactButtonSize (QPushButton const * button) +{ + QStyleOptionButton option; + option.initFrom (button); + if (button->autoDefault ()) option.features |= QStyleOptionButton::AutoDefaultButton; + auto contents = button->fontMetrics ().size (Qt::TextShowMnemonic, button->text ()); + // The text is already measured above. An empty option text avoids the + // Windows style's dialog-width floor without discarding its frame margins. + return button->style ()->sizeFromContents (QStyle::CT_PushButton, &option, contents, button); +} + +#endif diff --git a/widgets/CurrentPageHeightStackedWidget.hpp b/widgets/CurrentPageHeightStackedWidget.hpp new file mode 100644 index 00000000..e205e047 --- /dev/null +++ b/widgets/CurrentPageHeightStackedWidget.hpp @@ -0,0 +1,38 @@ +// SPDX-License-Identifier: GPL-3.0-or-later +#ifndef CURRENT_PAGE_HEIGHT_STACKED_WIDGET_HPP +#define CURRENT_PAGE_HEIGHT_STACKED_WIDGET_HPP + +#include + +class CurrentPageHeightStackedWidget final : public QStackedWidget +{ +public: + explicit CurrentPageHeightStackedWidget (QWidget * parent = nullptr) + : QStackedWidget {parent} + { + connect (this, &QStackedWidget::currentChanged, this, [this] {updateGeometry ();}); + } + + QSize sizeHint () const override + { + return withCurrentPageHeight (QStackedWidget::sizeHint (), false); + } + + QSize minimumSizeHint () const override + { + return withCurrentPageHeight (QStackedWidget::minimumSizeHint (), true); + } + +private: + QSize withCurrentPageHeight (QSize hint, bool minimum) const + { + if (auto * page = currentWidget ()) + { + auto const pageHint = minimum ? page->minimumSizeHint () : page->sizeHint (); + if (pageHint.isValid ()) hint.setHeight (pageHint.height ()); + } + return hint; + } +}; + +#endif diff --git a/widgets/DecodeHighlightingListView.cpp b/widgets/DecodeHighlightingListView.cpp index cfb14fc5..2997017a 100644 --- a/widgets/DecodeHighlightingListView.cpp +++ b/widgets/DecodeHighlightingListView.cpp @@ -15,6 +15,10 @@ DecodeHighlightingListView::DecodeHighlightingListView (QWidget * parent) addAction (fg_colour_action); connect (fg_colour_action, &QAction::triggered, [this] (bool /*checked*/) { auto const& index = currentIndex (); + if (!model () || !index.isValid ()) + { + return; + } auto colour = QColorDialog::getColor (model ()->data (index, Qt::ForegroundRole).value ().color () , this , tr ("Choose %1 Foreground Color") @@ -28,13 +32,21 @@ DecodeHighlightingListView::DecodeHighlightingListView (QWidget * parent) auto * unset_fg_colour_action = new QAction {tr ("&Unset foreground color"), this}; addAction (unset_fg_colour_action); connect (unset_fg_colour_action, &QAction::triggered, [this] (bool /*checked*/) { - model ()->setData (currentIndex (), QBrush {}, Qt::ForegroundRole); + auto const& index = currentIndex (); + if (model () && index.isValid ()) + { + model ()->setData (index, QBrush {}, Qt::ForegroundRole); + } }); auto * bg_colour_action = new QAction {tr ("&Background color ..."), this}; addAction (bg_colour_action); connect (bg_colour_action, &QAction::triggered, [this] (bool /*checked*/) { auto const& index = currentIndex (); + if (!model () || !index.isValid ()) + { + return; + } auto colour = QColorDialog::getColor (model ()->data (index, Qt::BackgroundRole).value ().color () , this , tr ("Choose %1 Background Color") @@ -48,13 +60,21 @@ DecodeHighlightingListView::DecodeHighlightingListView (QWidget * parent) auto * unset_bg_colour_action = new QAction {tr ("U&nset background color"), this}; addAction (unset_bg_colour_action); connect (unset_bg_colour_action, &QAction::triggered, [this] (bool /*checked*/) { - model ()->setData (currentIndex (), QBrush {}, Qt::BackgroundRole); + auto const& index = currentIndex (); + if (model () && index.isValid ()) + { + model ()->setData (index, QBrush {}, Qt::BackgroundRole); + } }); auto * defaults_action = new QAction {tr ("&Reset this item to defaults"), this}; addAction (defaults_action); connect (defaults_action, &QAction::triggered, [this] (bool /*checked*/) { auto const& index = currentIndex (); + if (!model () || !index.isValid ()) + { + return; + } model ()->setData (index, model ()->data (index, DecodeHighlightingModel::EnabledDefaultRole).toBool () ? Qt::Checked : Qt::Unchecked, Qt::CheckStateRole); model ()->setData (index, model ()->data (index, DecodeHighlightingModel::ForegroundDefaultRole), Qt::ForegroundRole); model ()->setData (index, model ()->data (index, DecodeHighlightingModel::BackgroundDefaultRole), Qt::BackgroundRole); diff --git a/widgets/FrequencyDeltaLineEdit.cpp b/widgets/FrequencyDeltaLineEdit.cpp index 59ae9bc9..aeeec2a7 100644 --- a/widgets/FrequencyDeltaLineEdit.cpp +++ b/widgets/FrequencyDeltaLineEdit.cpp @@ -2,6 +2,7 @@ #include +#include #include #include #include @@ -10,6 +11,9 @@ namespace { + double constexpr MHz_factor {1.e6}; + QColor const invalid_text_color {180, 0, 0}; + class MHzValidator : public QDoubleValidator { @@ -38,17 +42,46 @@ namespace FrequencyDeltaLineEdit::FrequencyDeltaLineEdit (QWidget * parent) : QLineEdit (parent) + , default_palette_ {palette ()} { - setValidator (new MHzValidator {static_cast(std::numeric_limits::min ()) / 10.e6, - static_cast(std::numeric_limits::max ()) / 10.e6, this}); + setValidator (new MHzValidator {static_cast(std::numeric_limits::min ()) / MHz_factor, + static_cast(std::numeric_limits::max ()) / MHz_factor, this}); + setPlaceholderText (tr ("Offset in MHz")); + connect (this, &QLineEdit::textChanged, this, [this] {update_input_feedback ();}); + update_input_feedback (); } auto FrequencyDeltaLineEdit::frequency_delta () const -> FrequencyDelta { - return Radio::frequency_delta (text (), 6); + return frequency_delta (nullptr); +} + +auto FrequencyDeltaLineEdit::frequency_delta (bool * ok) const -> FrequencyDelta +{ + if (!hasAcceptableInput ()) + { + if (ok) *ok = false; + return 0; + } + return Radio::frequency_delta (text (), 6, ok); } void FrequencyDeltaLineEdit::frequency_delta (FrequencyDelta d) { setText (Radio::frequency_MHz_string (d)); } + +void FrequencyDeltaLineEdit::update_input_feedback () +{ + auto palette = default_palette_; + if (hasAcceptableInput ()) + { + setToolTip (tr ("Frequency offset in MHz")); + } + else + { + palette.setColor (QPalette::Text, invalid_text_color); + setToolTip (tr ("Enter a frequency offset in MHz.")); + } + setPalette (palette); +} diff --git a/widgets/FrequencyDeltaLineEdit.hpp b/widgets/FrequencyDeltaLineEdit.hpp index caa00ecb..6b0aa8a9 100644 --- a/widgets/FrequencyDeltaLineEdit.hpp +++ b/widgets/FrequencyDeltaLineEdit.hpp @@ -2,6 +2,7 @@ #define FREQUENCY_DELTA_LINE_EDIT_HPP_ #include +#include #include "Radio.hpp" @@ -23,7 +24,13 @@ public: // Property frequency_delta implementation FrequencyDelta frequency_delta () const; + FrequencyDelta frequency_delta (bool *) const; void frequency_delta (FrequencyDelta); + +private: + void update_input_feedback (); + + QPalette default_palette_; }; #endif diff --git a/widgets/FrequencyLineEdit.cpp b/widgets/FrequencyLineEdit.cpp index 8e74c7db..9be31644 100644 --- a/widgets/FrequencyLineEdit.cpp +++ b/widgets/FrequencyLineEdit.cpp @@ -2,6 +2,7 @@ #include +#include #include #include #include @@ -10,6 +11,10 @@ namespace { + double constexpr MHz_factor {1.e6}; + double constexpr minimum_frequency_MHz {1. / MHz_factor}; + QColor const invalid_text_color {180, 0, 0}; + class MHzValidator : public QDoubleValidator { @@ -38,16 +43,45 @@ namespace FrequencyLineEdit::FrequencyLineEdit (QWidget * parent) : QLineEdit (parent) + , default_palette_ {palette ()} { - setValidator (new MHzValidator {0., static_cast(std::numeric_limits::max ()) / 10.e6, this}); + setValidator (new MHzValidator {minimum_frequency_MHz, static_cast(std::numeric_limits::max ()) / MHz_factor, this}); + setPlaceholderText (tr ("Frequency in MHz")); + connect (this, &QLineEdit::textChanged, this, [this] {update_input_feedback ();}); + update_input_feedback (); } auto FrequencyLineEdit::frequency () const -> Frequency { - return Radio::frequency (text (), 6); + return frequency (nullptr); +} + +auto FrequencyLineEdit::frequency (bool * ok) const -> Frequency +{ + if (!hasAcceptableInput ()) + { + if (ok) *ok = false; + return 0; + } + return Radio::frequency (text (), 6, ok); } void FrequencyLineEdit::frequency (Frequency f) { setText (Radio::frequency_MHz_string (f)); } + +void FrequencyLineEdit::update_input_feedback () +{ + auto palette = default_palette_; + if (hasAcceptableInput ()) + { + setToolTip (tr ("Frequency in MHz")); + } + else + { + palette.setColor (QPalette::Text, invalid_text_color); + setToolTip (tr ("Enter a positive frequency in MHz.")); + } + setPalette (palette); +} diff --git a/widgets/FrequencyLineEdit.hpp b/widgets/FrequencyLineEdit.hpp index 7e535f5a..9a4dfe9d 100644 --- a/widgets/FrequencyLineEdit.hpp +++ b/widgets/FrequencyLineEdit.hpp @@ -2,6 +2,7 @@ #define FREQUENCY_LINE_EDIT_HPP_ #include +#include #include "Radio.hpp" @@ -23,7 +24,13 @@ public: // Property frequency implementation Frequency frequency () const; + Frequency frequency (bool *) const; void frequency (Frequency); + +private: + void update_input_feedback (); + + QPalette default_palette_; }; #endif diff --git a/widgets/JttyDraftAcceptanceTracker.hpp b/widgets/JttyDraftAcceptanceTracker.hpp new file mode 100644 index 00000000..2263831f --- /dev/null +++ b/widgets/JttyDraftAcceptanceTracker.hpp @@ -0,0 +1,56 @@ +#ifndef JTTY_DRAFT_ACCEPTANCE_TRACKER_HPP_ +#define JTTY_DRAFT_ACCEPTANCE_TRACKER_HPP_ + +#include + +class JttyDraftAcceptanceTracker +{ +public: + void noteDraftChanged () noexcept + { + ++revision_; + } + + void trackSubmission (qint64 requestId) + { + submissions_.insert (requestId, revision_); + } + + bool hasPendingSubmissionForCurrentDraft () const + { + for (auto it = submissions_.cbegin (); it != submissions_.cend (); ++it) { + if (it.value () == revision_) { + return true; + } + } + return false; + } + + bool isPending (qint64 requestId) const + { + return submissions_.contains (requestId); + } + + bool accept (qint64 requestId) + { + auto const it = submissions_.find (requestId); + if (it == submissions_.end ()) { + return false; + } + + auto const submittedRevision = it.value (); + submissions_.erase (it); + return submittedRevision == revision_; + } + + void reject (qint64 requestId) + { + submissions_.remove (requestId); + } + +private: + quint64 revision_ {0}; + QHash submissions_; +}; + +#endif diff --git a/widgets/JttyMessages.hpp b/widgets/JttyMessages.hpp new file mode 100644 index 00000000..2a1f4162 --- /dev/null +++ b/widgets/JttyMessages.hpp @@ -0,0 +1,950 @@ +// -*- Mode: C++ -*- +#ifndef JTTY_MESSAGES_HPP +#define JTTY_MESSAGES_HPP + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace Jtty +{ + struct ParsedDecodeLine + { + int frequency {0}; + QString message; + bool valid {false}; + }; + + struct PreparedTransmitText + { + QString text; + bool substituted {false}; + bool truncated {false}; + + bool changed () const + { + return substituted || truncated; + } + }; + + enum class NativeAtomKind : qint8 + { + Call = 0, + ExchangeNumber = 1, + ExchangeLocation = 2, + ExchangePair = 3, + ExchangeNumberTime = 4, + Control = 5, + Grid4 = 6, + Text5 = 7 + }; + + enum class CallAction : qint8 + { + Cq = 0, + Call = 1, + TuCq = 2, + CallTu = 3, + CallAgn = 4, + TuNowCall = 5 + }; + + enum class ExchangeRole : qint8 + { + FieldOnly = 0, + Full = 1 + }; + + enum class NumberKind : qint8 + { + Serial = 0, + CqZone = 1, + ItuZone = 2, + Age = 3, + Power = 4, + Check = 5, + FirstLicenseYear = 6, + Generic = 7 + }; + + enum class LocationKind : qint8 + { + StateProvince = 0, + ArrlRacSection = 1, + CountryPrefix = 2, + Qth = 3, + LocalAdministrativeCode = 4 + }; + + enum class PairSchema : qint8 + { + ZoneLocation = 0, + ClassSection = 1 + }; + + enum class NativeExchangeProfile + { + // Shared with the Fortran text packer; None leaves text inference unprofiled. + None = 0, + FieldDay = 1, + RttyRoundup = 2 + }; + + struct NativeAtomDescriptor + { + qint8 kind {}; + qint8 subtype {}; + qint8 role {}; + qint8 reserved {}; + qint32 value {}; + char text[9] {}; + }; + + static_assert (std::is_standard_layout::value, + "NativeAtomDescriptor must remain C-compatible"); + static_assert (offsetof (NativeAtomDescriptor, kind) == 0, "atom ABI mismatch"); + static_assert (offsetof (NativeAtomDescriptor, subtype) == 1, "atom ABI mismatch"); + static_assert (offsetof (NativeAtomDescriptor, role) == 2, "atom ABI mismatch"); + static_assert (offsetof (NativeAtomDescriptor, reserved) == 3, "atom ABI mismatch"); + static_assert (offsetof (NativeAtomDescriptor, value) == 4, "atom ABI mismatch"); + static_assert (offsetof (NativeAtomDescriptor, text) == 8, "atom ABI mismatch"); + static_assert (sizeof (NativeAtomDescriptor) == 20, "atom ABI mismatch"); + + enum class NativeEncodeStatus + { + Ok = 0, + InvalidDescriptor = 1, + UnknownSection = 2 + }; + + enum class NativeMacroStatus + { + Native, + LiteralFallback, + InvalidRuntime + }; + + struct NativeMacroContext + { + QString myCall; + QString hisCall; + int serialNumber {}; + NativeExchangeProfile exchangeProfile {NativeExchangeProfile::None}; + QString configuredExchange; + QString grid; + + NativeMacroContext () = default; + + NativeMacroContext (QString const& myCallValue, QString const& hisCallValue, + int serialNumberValue, + NativeExchangeProfile profile = NativeExchangeProfile::None, + QString const& exchangeValue = {}, QString const& gridValue = {}) + : myCall {myCallValue} + , hisCall {hisCallValue} + , serialNumber {serialNumberValue} + , exchangeProfile {profile} + , configuredExchange {exchangeValue} + , grid {gridValue} + { + } + }; + + struct NativeMacroCompilation + { + NativeMacroStatus status {NativeMacroStatus::LiteralFallback}; + QVector atoms; + QString text; + QString error; + + bool isNative () const + { + return status == NativeMacroStatus::Native; + } + }; + + inline QString sourceAlphabet () + { + // Keep in sync with ALPHABET in lib/jtty/jtty_source_codec.f90. + return QStringLiteral ("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ +-./?!\"#$%,&*()_'=[]{}<>|:;"); + } + + inline bool isSourceCharacter (QChar c) + { + return sourceAlphabet ().contains (c) + || (c >= QLatin1Char {'a'} && c <= QLatin1Char {'z'}); + } + + // Fixed width of a JTTY transmit frame; genjtty_ (lib/jtty/genjtty.f90) + // expects exactly this many characters. + inline constexpr int maxMessageLength = 80; + inline constexpr int maxTransmitLength = maxMessageLength; + + inline PreparedTransmitText prepareTransmitText (QString const& message) + { + PreparedTransmitText result; + int const maxLength {maxTransmitLength}; + result.truncated = message.size () > maxLength; + QString const bounded = message.left (maxLength); + result.text.reserve (bounded.size ()); + + for (QChar c : bounded) { + if (c == QChar::Null || c == QLatin1Char {'~'}) { + result.text.append (QLatin1Char {' '}); + result.substituted = true; + } else if (isSourceCharacter (c)) { + result.text.append (c); + } else { + result.text.append (QLatin1Char {'#'}); + result.substituted = true; + } + } + + return result; + } + + // A message being queued behind one still transmitting (FIFO chaining, + // see MainWindow::execute_jtty_tx) gets a leading space inserted, since + // the user is unlikely to remember (or want) to type one themselves, + // and unlikely to hit Return mid-word. Re-bounds to maxTransmitLength + // in case the message was already at prepareTransmitText's limit. + // No-op (returns message unchanged) when isChained is false. + inline QString withChainedSpacing (QString const& message, bool isChained) + { + if (!isChained) return message; + return (QLatin1Char {' '} + message).left (maxTransmitLength); + } + + // Builds the fixed-width frame passed to genjtty_. The chained leading space + // is transport-only spacing, so it belongs here rather than in the logical + // message that is logged, displayed, and checked for contest serials. + inline QString transmitFrame (QString const& message, bool isChained) + { + QString const spaced = withChainedSpacing (message, isChained); + return spaced + QString (maxTransmitLength - spaced.size (), QLatin1Char {' '}); + } + + // Number of receive samples in one complete JTTY frame: 59 symbols of 384 + // samples (lib/jtty/jtty.f90). Anything shorter is not a decodable interval. + inline constexpr qint32 jttyFrameSamples = 59 * 384; + + // m_k0 starts at this sentinel and is only replaced once fastSink has real + // audio, so it marks "nothing captured yet". + inline constexpr qint32 invalidCaptureSamples = 9999999; + + // True when k0 describes a captured JTTY receive buffer worth saving: at + // least one full frame, and not the uninitialised sentinel. + inline bool wavCaptureValid (qint32 k0) + { + return k0 > jttyFrameSamples && k0 < invalidCaptureSamples; + } + + inline QString formatSerialNumber (int serialNumber) + { + return QString {"%1"}.arg (serialNumber, 3, 10, QLatin1Char {'0'}); + } + + inline QString nativeMacroTemplate (int functionKey) + { + static QString const templates[] { + QStringLiteral ("CQ %M CQ"), + QStringLiteral ("%H %E"), + QStringLiteral ("%H TU CQ %M CQ"), + QStringLiteral ("%M"), + QStringLiteral ("%H"), + QStringLiteral ("TU NOW %Q %E"), + QStringLiteral ("%H AGN?"), + QStringLiteral ("%E") + }; + if (functionKey < 1 || functionKey > 8) return {}; + return templates[functionKey - 1]; + } + + inline QString legacyNativeMacroTemplate (int functionKey) + { + static QString const templates[] { + QStringLiteral ("CQ %M CQ"), + QStringLiteral ("%H 599 %N"), + QStringLiteral ("%H TU CQ %M CQ"), + QStringLiteral ("%M"), + QStringLiteral ("%H"), + QStringLiteral ("TU NOW %Q 599 %N"), + QStringLiteral ("%H AGN?"), + QStringLiteral ("599 %N") + }; + if (functionKey < 1 || functionKey > 8) return {}; + return templates[functionKey - 1]; + } + + inline QString nativeGridMacroTemplate (int functionKey) + { + switch (functionKey) { + case 2: return QStringLiteral ("%H %G"); + case 6: return QStringLiteral ("TU NOW %Q %G"); + case 8: return QStringLiteral ("%G"); + default: return {}; + } + } + + inline QString normalizedMacroTemplate (QString const& macroTemplate) + { + return macroTemplate.simplified ().toUpper (); + } + + inline int nativeMacroFunctionKey (QString const& macroTemplate) + { + QString const normalized = normalizedMacroTemplate (macroTemplate); + if (normalized == QStringLiteral ("599 %G")) return 8; + for (int functionKey = 1; functionKey <= 8; ++functionKey) { + QString const gridTemplate = nativeGridMacroTemplate (functionKey); + if (normalized == nativeMacroTemplate (functionKey) + || macroTemplate == legacyNativeMacroTemplate (functionKey) + || (!gridTemplate.isEmpty () && normalized == gridTemplate)) { + return functionKey; + } + } + return 0; + } + + inline bool isNativeMacroTemplate (QString const& macroTemplate) + { + return nativeMacroFunctionKey (macroTemplate) != 0; + } + + inline QString nativeExchangeFieldText (NativeMacroContext const& context) + { + QString const configured = context.configuredExchange.simplified ().toUpper (); + if (context.exchangeProfile == NativeExchangeProfile::None + || (context.exchangeProfile == NativeExchangeProfile::RttyRoundup + && (configured == QStringLiteral ("DX") || configured == QStringLiteral ("#")))) { + return formatSerialNumber (context.serialNumber); + } + return configured; + } + + inline QString expandLiteralMacro (QString macroTemplate, + NativeMacroContext const& context) + { + macroTemplate.replace (QStringLiteral ("%M"), context.myCall); + macroTemplate.replace (QStringLiteral ("%H"), context.hisCall); + macroTemplate.replace (QStringLiteral ("%Q"), context.hisCall); + macroTemplate.replace (QStringLiteral ("%N"), formatSerialNumber (context.serialNumber)); + macroTemplate.replace (QStringLiteral ("%E"), nativeExchangeFieldText (context)); + macroTemplate.replace (QStringLiteral ("%G"), context.grid); + return macroTemplate; + } + + inline QString migratedNativeMacroTemplate (int functionKey, QString const& savedValue) + { + if ((functionKey == 2 || functionKey == 6 || functionKey == 8) + && savedValue == legacyNativeMacroTemplate (functionKey)) { + return nativeMacroTemplate (functionKey); + } + return savedValue; + } + + inline QString normalizedNativeCall (QString const& call) + { + return call.trimmed ().toUpper (); + } + + inline bool isNativeCall (QString const& rawCall) + { + QString const call = normalizedNativeCall (rawCall); + if (call.size () < 3 || call.size () > 6 || call.startsWith (QLatin1Char {'Q'})) { + return false; + } + + int area = -1; + for (int i = call.size () - 1; i >= 1; --i) { + QChar const c = call.at (i); + if (c >= QLatin1Char {'0'} && c <= QLatin1Char {'9'}) { + area = i; + break; + } + } + if (area != 1 && area != 2) return false; + + bool prefixHasLetter {false}; + for (int i = 0; i < area; ++i) { + QChar const c = call.at (i); + bool const isLetter = c >= QLatin1Char {'A'} && c <= QLatin1Char {'Z'}; + bool const isDigit = c >= QLatin1Char {'0'} && c <= QLatin1Char {'9'}; + if (!isLetter && !isDigit) return false; + prefixHasLetter = prefixHasLetter || isLetter; + } + if (!prefixHasLetter || area == call.size () - 1) return false; + + for (int i = area + 1; i < call.size (); ++i) { + QChar const c = call.at (i); + if (c < QLatin1Char {'A'} || c > QLatin1Char {'Z'}) return false; + } + return call.size () - area - 1 <= 3; + } + + inline NativeAtomDescriptor nativeCallAtom (CallAction action, QString const& rawCall) + { + NativeAtomDescriptor atom; + atom.kind = static_cast (NativeAtomKind::Call); + atom.subtype = static_cast (action); + QByteArray const call = normalizedNativeCall (rawCall).toLatin1 (); + std::copy_n (call.cbegin (), std::min (call.size (), 8), atom.text); + return atom; + } + + inline NativeAtomDescriptor nativeSerialAtom (int serialNumber) + { + NativeAtomDescriptor atom; + atom.kind = static_cast (NativeAtomKind::ExchangeNumber); + atom.subtype = static_cast (NumberKind::Serial); + atom.role = static_cast (ExchangeRole::Full); + atom.value = serialNumber; + return atom; + } + + inline void setNativeAtomText (NativeAtomDescriptor& atom, QString const& value) + { + QByteArray const text = value.toLatin1 (); + std::copy_n (text.cbegin (), std::min (text.size (), 8), atom.text); + } + + inline NativeAtomDescriptor nativeLocationAtom (ExchangeRole role, LocationKind kind, + QString const& token) + { + NativeAtomDescriptor atom; + atom.kind = static_cast (NativeAtomKind::ExchangeLocation); + atom.subtype = static_cast (kind); + atom.role = static_cast (role); + setNativeAtomText (atom, token); + return atom; + } + + inline NativeAtomDescriptor nativeClassSectionAtom (int count, QChar classLetter, + QString const& section) + { + NativeAtomDescriptor atom; + atom.kind = static_cast (NativeAtomKind::ExchangePair); + atom.subtype = static_cast (PairSchema::ClassSection); + atom.role = static_cast (classLetter.unicode () - QLatin1Char {'A'}.unicode ()); + atom.value = count; + setNativeAtomText (atom, section); + return atom; + } + + inline NativeAtomDescriptor nativeControlAtom (int phraseId) + { + NativeAtomDescriptor atom; + atom.kind = static_cast (NativeAtomKind::Control); + atom.subtype = static_cast (phraseId); + return atom; + } + + inline NativeAtomDescriptor nativeGridAtom (ExchangeRole role, QString const& grid) + { + NativeAtomDescriptor atom; + atom.kind = static_cast (NativeAtomKind::Grid4); + atom.role = static_cast (role); + setNativeAtomText (atom, grid); + return atom; + } + + inline bool isDecimal (QString const& value) + { + if (value.isEmpty ()) return false; + for (QChar const c : value) { + if (c < QLatin1Char {'0'} || c > QLatin1Char {'9'}) return false; + } + return true; + } + + inline QString normalizedFieldDayExchange (QString const& value) + { + QString exchange = value.simplified ().toUpper (); + if (exchange.contains (QLatin1Char {' '})) return exchange; + + int classPosition {0}; + while (classPosition < exchange.size () + && exchange.at (classPosition) >= QLatin1Char {'0'} + && exchange.at (classPosition) <= QLatin1Char {'9'}) { + ++classPosition; + } + if (classPosition > 0 && classPosition + 1 < exchange.size () + && exchange.at (classPosition) >= QLatin1Char {'A'} + && exchange.at (classPosition) <= QLatin1Char {'F'}) { + exchange.insert (classPosition + 1, QLatin1Char {' '}); + } + return exchange; + } + + inline bool isCanonicalBase36Token (QString const& value) + { + if (value.size () != 2 && value.size () != 3) return false; + if (value.size () == 3 && value.startsWith (QLatin1Char {'0'})) return false; + for (QChar const c : value) { + bool const digit = c >= QLatin1Char {'0'} && c <= QLatin1Char {'9'}; + bool const letter = c >= QLatin1Char {'A'} && c <= QLatin1Char {'Z'}; + if (!digit && !letter) return false; + } + return true; + } + + inline bool isGrid4 (QString const& value) + { + if (value.size () != 4) return false; + return value.at (0) >= QLatin1Char {'A'} && value.at (0) <= QLatin1Char {'R'} + && value.at (1) >= QLatin1Char {'A'} && value.at (1) <= QLatin1Char {'R'} + && value.at (2) >= QLatin1Char {'0'} && value.at (2) <= QLatin1Char {'9'} + && value.at (3) >= QLatin1Char {'0'} && value.at (3) <= QLatin1Char {'9'}; + } + + inline QString controlPhrase (int phraseId) + { + static QString const phrases[] { + QStringLiteral ("AGN?"), + QStringLiteral ("CALL?"), + QStringLiteral ("AGN CALL"), + QStringLiteral ("NR?"), + QStringLiteral ("AGN NR"), + QStringLiteral ("EXCH?"), + QStringLiteral ("STATE?"), + QStringLiteral ("SECTION?"), + QStringLiteral ("ZONE?"), + QStringLiteral ("GRID?"), + QStringLiteral ("RPRT?"), + QStringLiteral ("QSL TU"), + QStringLiteral ("TU"), + QStringLiteral ("QRZ?"), + QStringLiteral ("QSO B4"), + QStringLiteral ("WAIT"), + QStringLiteral ("NIL?"), + QStringLiteral ("OK?") + }; + if (phraseId < 0 || phraseId >= 18) return {}; + return phrases[phraseId]; + } + + inline int controlPhraseId (QString const& macroTemplate) + { + QString const normalized = normalizedMacroTemplate (macroTemplate); + for (int phraseId = 0; phraseId < 18; ++phraseId) { + if (normalized == controlPhrase (phraseId)) return phraseId; + } + return -1; + } + + struct NativeExchangeCompilation + { + bool valid {false}; + NativeAtomDescriptor atom; + QString text; + QString error; + }; + + inline NativeExchangeCompilation nativeExchange (NativeMacroContext const& context) + { + NativeExchangeCompilation result; + auto invalid = [&result] (QString const& error) { + result.error = error; + return result; + }; + auto serial = [&result] (int value) { + if (value < 0 || value >= (1 << 17)) return false; + result.valid = true; + result.atom = nativeSerialAtom (value); + result.text = QStringLiteral ("599 %1").arg (formatSerialNumber (value)); + return true; + }; + + QString const configured = context.configuredExchange.simplified ().toUpper (); + switch (context.exchangeProfile) { + case NativeExchangeProfile::None: + if (!serial (context.serialNumber)) { + return invalid (QStringLiteral ("Serial number must be between 0 and 131071")); + } + return result; + + case NativeExchangeProfile::FieldDay: { + QStringList const fields = configured.split (QLatin1Char {' '}); + if (fields.size () != 2 || fields.at (0).size () < 2) { + return invalid (QStringLiteral ("Field Day exchange must be COUNTCLASS SECTION")); + } + QString const countClass = fields.at (0); + QChar const classLetter = countClass.back (); + QString const countText = countClass.left (countClass.size () - 1); + bool countOk {false}; + int const count = countText.toInt (&countOk); + if (!countOk || !isDecimal (countText) || count < 1 || count > 32) { + return invalid (QStringLiteral ("Field Day transmitter count must be between 1 and 32")); + } + if (classLetter < QLatin1Char {'A'} || classLetter > QLatin1Char {'F'}) { + return invalid (QStringLiteral ("Field Day class must be A through F")); + } + QString const section = fields.at (1); + if (!isCanonicalBase36Token (section)) { + return invalid (QStringLiteral ("Field Day section must be a canonical 2-3 character code")); + } + result.valid = true; + result.atom = nativeClassSectionAtom (count, classLetter, section); + result.text = QStringLiteral ("%1%2 %3").arg (count).arg (classLetter).arg (section); + return result; + } + + case NativeExchangeProfile::RttyRoundup: + if (configured == QStringLiteral ("DX") || configured == QStringLiteral ("#")) { + if (!serial (context.serialNumber)) { + return invalid (QStringLiteral ("Serial number must be between 0 and 131071")); + } + return result; + } + if (isDecimal (configured)) { + bool valueOk {false}; + int const value = configured.toInt (&valueOk); + if (!valueOk || !serial (value)) { + return invalid (QStringLiteral ("Configured serial must be between 0 and 131071")); + } + return result; + } + if (!isCanonicalBase36Token (configured)) { + return invalid (QStringLiteral ( + "RTTY exchange must be DX, #, a decimal serial, or a canonical 2-3 character state/province")); + } + result.valid = true; + result.atom = nativeLocationAtom ( + ExchangeRole::Full, LocationKind::StateProvince, configured); + result.text = QStringLiteral ("599 %1").arg (configured); + return result; + } + + return invalid (QStringLiteral ("Unsupported exchange profile")); + } + + inline NativeExchangeCompilation nativeGridExchange (NativeMacroContext const& context, + ExchangeRole role) + { + NativeExchangeCompilation result; + QString const locator = context.grid.trimmed ().toUpper (); + static QRegularExpression const locatorPattern { + QStringLiteral ("^[A-R]{2}[0-9]{2}(?:[A-X]{2}(?:[0-9]{2})?)?$")}; + if (!locatorPattern.match (locator).hasMatch ()) { + result.error = QStringLiteral ("Grid must be a valid four-, six-, or eight-character Maidenhead locator"); + return result; + } + QString const grid = locator.left (4); + result.valid = true; + result.atom = nativeGridAtom (role, grid); + result.text = role == ExchangeRole::Full + ? QStringLiteral ("599 %1").arg (grid) : grid; + return result; + } + + inline NativeMacroCompilation compileNativeMacro ( + QString const& macroTemplate, NativeMacroContext const& context) + { + NativeMacroCompilation result; + QString const normalized = normalizedMacroTemplate (macroTemplate); + int const phraseId = controlPhraseId (normalized); + if (phraseId >= 0) { + result.status = NativeMacroStatus::Native; + result.atoms.append (nativeControlAtom (phraseId)); + result.text = controlPhrase (phraseId); + return result; + } + + int const functionKey = nativeMacroFunctionKey (macroTemplate); + if (functionKey == 0) { + result.text = expandLiteralMacro (macroTemplate, context); + return result; + } + + QString const myCall = normalizedNativeCall (context.myCall); + QString const hisCall = normalizedNativeCall (context.hisCall); + auto invalid = [&result] (QString const& error) { + result.status = NativeMacroStatus::InvalidRuntime; + result.atoms.clear (); + result.text.clear (); + result.error = error; + return result; + }; + auto appendCall = [&result] (CallAction action, QString const& call) { + result.atoms.append (nativeCallAtom (action, call)); + }; + auto appendSerial = [&result, &context] { + result.atoms.append (nativeSerialAtom (context.serialNumber)); + }; + auto appendExchange = [&result, &context, &normalized] { + NativeExchangeCompilation exchange; + if (normalized.contains (QStringLiteral ("%G"))) { + ExchangeRole const role = normalized == QStringLiteral ("599 %G") + ? ExchangeRole::Full : ExchangeRole::FieldOnly; + exchange = nativeGridExchange (context, role); + } else { + exchange = nativeExchange (context); + } + if (exchange.valid) result.atoms.append (exchange.atom); + return exchange; + }; + + switch (functionKey) { + case 1: + if (!isNativeCall (myCall)) return invalid (QStringLiteral ("Configured callsign is not a native Call8 callsign")); + appendCall (CallAction::Cq, myCall); + result.text = QStringLiteral ("CQ %1 CQ").arg (myCall); + break; + case 2: + if (!isNativeCall (hisCall)) return invalid (QStringLiteral ("DX callsign is not a native Call8 callsign")); + appendCall (CallAction::Call, hisCall); + if (macroTemplate == legacyNativeMacroTemplate (2)) { + if (context.serialNumber < 0 || context.serialNumber >= (1 << 17)) { + return invalid (QStringLiteral ("Serial number must be between 0 and 131071")); + } + appendSerial (); + result.text = QStringLiteral ("%1 599 %2").arg ( + hisCall, formatSerialNumber (context.serialNumber)); + } else { + auto const exchange = appendExchange (); + if (!exchange.valid) return invalid (exchange.error); + result.text = QStringLiteral ("%1 %2").arg (hisCall, exchange.text); + } + break; + case 3: + if (!isNativeCall (hisCall)) return invalid (QStringLiteral ("DX callsign is not a native Call8 callsign")); + if (!isNativeCall (myCall)) return invalid (QStringLiteral ("Configured callsign is not a native Call8 callsign")); + appendCall (CallAction::CallTu, hisCall); + appendCall (CallAction::Cq, myCall); + result.text = QStringLiteral ("%1 TU CQ %2 CQ").arg (hisCall, myCall); + break; + case 4: + if (!isNativeCall (myCall)) return invalid (QStringLiteral ("Configured callsign is not a native Call8 callsign")); + appendCall (CallAction::Call, myCall); + result.text = myCall; + break; + case 5: + if (!isNativeCall (hisCall)) return invalid (QStringLiteral ("DX callsign is not a native Call8 callsign")); + appendCall (CallAction::Call, hisCall); + result.text = hisCall; + break; + case 6: + if (!isNativeCall (hisCall)) return invalid (QStringLiteral ("Queued callsign is not a native Call8 callsign")); + appendCall (CallAction::TuNowCall, hisCall); + if (macroTemplate == legacyNativeMacroTemplate (6)) { + if (context.serialNumber < 0 || context.serialNumber >= (1 << 17)) { + return invalid (QStringLiteral ("Serial number must be between 0 and 131071")); + } + appendSerial (); + result.text = QStringLiteral ("TU NOW %1 599 %2").arg ( + hisCall, formatSerialNumber (context.serialNumber)); + } else { + auto const exchange = appendExchange (); + if (!exchange.valid) return invalid (exchange.error); + result.text = QStringLiteral ("TU NOW %1 %2").arg (hisCall, exchange.text); + } + break; + case 7: + if (!isNativeCall (hisCall)) return invalid (QStringLiteral ("DX callsign is not a native Call8 callsign")); + appendCall (CallAction::CallAgn, hisCall); + result.text = QStringLiteral ("%1 AGN?").arg (hisCall); + break; + case 8: + if (macroTemplate == legacyNativeMacroTemplate (8)) { + if (context.serialNumber < 0 || context.serialNumber >= (1 << 17)) { + return invalid (QStringLiteral ("Serial number must be between 0 and 131071")); + } + appendSerial (); + result.text = QStringLiteral ("599 %1").arg (formatSerialNumber (context.serialNumber)); + } else { + auto const exchange = appendExchange (); + if (!exchange.valid) return invalid (exchange.error); + result.text = exchange.text; + } + break; + default: + return invalid (QStringLiteral ("Unsupported native macro")); + } + + result.status = NativeMacroStatus::Native; + return result; + } + + inline NativeMacroCompilation compileNativeMacro ( + int functionKey, QString const& macroTemplate, NativeMacroContext const& context) + { + (void) functionKey; + return compileNativeMacro (macroTemplate, context); + } + + // Resolve a JTTY message start from the WAV anchor, preserving the raw-time fallback for test-generated files. + inline QDateTime jttyLineStartTimeUtc (QDateTime const& diskDateTime, + qint32 utcDiskRaw, float tsyncSeconds) + { + QDateTime anchor = diskDateTime; + if (!anchor.isValid ()) { + QTime const t = QTime::fromString ( + QString {"%1"}.arg (utcDiskRaw, 6, 10, QLatin1Char {'0'}), "hhmmss"); + if (!t.isValid ()) return {}; + anchor = QDateTime {QDate {2000, 1, 1}, t, Qt::UTC}; + } + return anchor.addMSecs (qRound64 (1000.0 * tsyncSeconds)).toUTC (); + } + + inline QString jttyLineTimeLabel (QDateTime const& timestampUtc) + { + return timestampUtc.isValid () + ? timestampUtc.toUTC ().toString ("hhmmss") : QString {}; + } + + // "Include Time" label; falls back to utcDiskRaw as a bare time-of-day when diskDateTime doesn't parse (e.g. sjtty's dummy-date filenames). + inline QString jttyLineTimeLabel (QDateTime const& diskDateTime, + qint32 utcDiskRaw, float tsyncSeconds) + { + return jttyLineTimeLabel (jttyLineStartTimeUtc (diskDateTime, utcDiskRaw, + tsyncSeconds)); + } + + inline ParsedDecodeLine parseDecodeLine (QString const& line) + { + ParsedDecodeLine result; + QString const trimmed = line.trimmed (); + result.message = trimmed; + + int separator = 0; + while (separator < trimmed.size () && !trimmed.at (separator).isSpace ()) { + ++separator; + } + if (separator == 0) return result; + + bool frequencyOk {false}; + int const frequency = trimmed.left (separator).toInt (&frequencyOk); + if (!frequencyOk) return result; + + result.frequency = frequency; + result.message = separator < trimmed.size () + ? trimmed.mid (separator).trimmed () : QString {}; + result.valid = true; + return result; + } + + inline constexpr int maxDisplayWidth = 40; + + inline QString wrapMessage (QString const& text, int maxWidth = maxDisplayWidth) + { + if (text.size () <= maxWidth) return text; + + QString result; + int start = 0; + while (text.size () - start > maxWidth) { + int breakAt = -1; + for (int i = maxWidth; i > 0; --i) { + if (text.at (start + i) == QLatin1Char {' '}) { + breakAt = i; + break; + } + } + if (breakAt < 0) { + result += text.mid (start, maxWidth) + QLatin1String {"\n "}; + start += maxWidth; + } else { + result += text.mid (start, breakAt) + QLatin1String {"\n "}; + start += breakAt + 1; + } + } + result += text.mid (start); + return result; + } + + struct DecodeLineChange + { + bool messageChanged {false}; + bool extendsMessage {false}; + bool startsMessage {false}; + QString appendedText; + }; + + inline DecodeLineChange compareMessages (QString const& previous, + QString const& current) + { + DecodeLineChange change; + change.messageChanged = previous != current; + change.extendsMessage = change.messageChanged + && current.startsWith (previous); + change.startsMessage = previous.isEmpty () && !current.isEmpty (); + if (change.extendsMessage) { + change.appendedText = current.mid (previous.size ()); + } + return change; + } + + struct MessageUpdate + { + qint64 messageId {0}; + float frequency {0.f}; + QString text; + float sequenceStart {0.f}; + bool complete {false}; + }; + + inline bool shouldApplyToQsoHistory (bool alreadyPresent, float frequency, + float rxFrequency, float tolerance) + { + // Later frames retain their admitted message identity despite decoder frequency drift. + return alreadyPresent || std::abs (frequency - rxFrequency) < tolerance; + } + + template + bool mergeMessageUpdates (QVector& history, + QVector const& updates, + Factory makeLine) + { + if (updates.isEmpty ()) return false; + + bool changed {false}; + bool orderChanged {false}; + for (auto const& update : updates) { + auto const known = std::find_if (history.begin (), history.end (), + [&update] (HistoryLine const& line) { + return line.messageId == update.messageId; + }); + if (known == history.end ()) { + history.append (makeLine (update)); + changed = true; + orderChanged = true; + } else { + bool const complete = known->complete || update.complete; + if (known->text != update.text || known->frequency != update.frequency + || known->complete != complete) { + changed = true; + } + known->text = update.text; + known->frequency = update.frequency; + known->complete = complete; + } + } + + if (orderChanged) { + std::sort (history.begin (), history.end (), [] (HistoryLine const& lhs, + HistoryLine const& rhs) { + if (lhs.sequenceStart != rhs.sequenceStart) { + return lhs.sequenceStart < rhs.sequenceStart; + } + return lhs.messageId < rhs.messageId; + }); + } + return changed; + } + + inline bool mergeMessageUpdates (QVector& history, + QVector const& updates) + { + return mergeMessageUpdates (history, updates, + [] (MessageUpdate const& update) { return update; }); + } +} + +#endif diff --git a/widgets/JttyN1mm.hpp b/widgets/JttyN1mm.hpp new file mode 100644 index 00000000..6975eb40 --- /dev/null +++ b/widgets/JttyN1mm.hpp @@ -0,0 +1,247 @@ +// -*- Mode: C++ -*- +#ifndef JTTY_N1MM_HPP +#define JTTY_N1MM_HPP + +#include +#include +#include + +#include "JttyMessages.hpp" + +namespace Jtty +{ + enum class N1mmCompileStatus + { + Literal, + Native, + Error + }; + + struct N1mmCompilation + { + N1mmCompileStatus status {N1mmCompileStatus::Literal}; + QVector atoms; + QString literalText; + QString canonicalText; + QString error; + + bool isNative () const { return status == N1mmCompileStatus::Native; } + }; + + namespace N1mmDetail + { + inline N1mmCompilation failure (QString const& reason) + { + N1mmCompilation result; + result.status = N1mmCompileStatus::Error; + result.error = reason; + return result; + } + + inline bool appendCall (QVector& atoms, CallAction action, + QString const& call, QString& error) + { + if (!isNativeCall (call)) { + error = QStringLiteral ("invalid callsign in tagged payload"); + return false; + } + atoms.append (nativeCallAtom (action, call)); + return true; + } + + inline bool parseSerial (QString const& payload, int& serial) + { + if (!isDecimal (payload)) return false; + bool ok {false}; + serial = payload.toInt (&ok); + return ok && serial >= 0 && serial < (1 << 17); + } + + inline NativeExchangeCompilation expandedExchange ( + QString const& payload, NativeExchangeProfile profile) + { + NativeMacroContext context; + context.exchangeProfile = profile; + context.configuredExchange = payload; + + int serial {0}; + if (profile == NativeExchangeProfile::None) { + if (!parseSerial (payload, serial)) { + NativeExchangeCompilation result; + result.error = QStringLiteral ( + "serial exchange must be a decimal value between 0 and 131071"); + return result; + } + context.serialNumber = serial; + } else if (profile == NativeExchangeProfile::RttyRoundup) { + if (parseSerial (payload, serial)) { + context.serialNumber = serial; + } else if (isCanonicalBase36Token (payload)) { + NativeExchangeCompilation result; + result.valid = true; + result.atom = nativeLocationAtom ( + ExchangeRole::Full, LocationKind::StateProvince, payload); + result.text = QStringLiteral ("599 %1").arg (payload); + return result; + } else { + NativeExchangeCompilation result; + result.error = QStringLiteral ( + "tagged RTTY exchange must contain a decimal serial or state/province"); + return result; + } + } + return nativeExchange (context); + } + } + + // A tag is recognized only at the first non-space character. Its payload is + // the value text already expanded by N1MM, never N1MM macro syntax. + inline N1mmCompilation compileN1mmMessage ( + QString const& message, NativeExchangeProfile profile = NativeExchangeProfile::None) + { + int first {0}; + while (first < message.size () && message.at (first).isSpace ()) ++first; + QString const marker = QStringLiteral ("[[JTTY:"); + if (message.mid (first, marker.size ()).compare (marker, Qt::CaseInsensitive) != 0) { + QString const tagStem = QStringLiteral ("[[JTTY"); + if (message.mid (first, tagStem.size ()).compare ( + tagStem, Qt::CaseInsensitive) == 0) { + return N1mmDetail::failure (QStringLiteral ("malformed JTTY action tag")); + } + N1mmCompilation result; + result.literalText = message; + return result; + } + + int const close = message.indexOf (QStringLiteral ("]]"), first + marker.size ()); + if (close < 0) return N1mmDetail::failure (QStringLiteral ("malformed JTTY action tag")); + QString const action = message.mid (first + marker.size (), + close - first - marker.size ()).toUpper (); + if (action.isEmpty () || action.contains (QLatin1Char {'['}) + || action.contains (QLatin1Char {']'}) || action.contains (QLatin1Char {' '}) + || action.contains (QLatin1Char {'\t'})) { + return N1mmDetail::failure (QStringLiteral ("malformed JTTY action tag")); + } + + static QStringList const actions { + QStringLiteral ("CQ"), QStringLiteral ("CALL_EXCH"), + QStringLiteral ("CALL_TU_CQ"), QStringLiteral ("MYCALL"), + QStringLiteral ("HISCALL"), QStringLiteral ("TU_NOW_EXCH"), + QStringLiteral ("CALL_MY"), QStringLiteral ("CALL_TU_MY"), + QStringLiteral ("EXCH"), QStringLiteral ("GRID"), QStringLiteral ("CONTROL") + }; + if (!actions.contains (action)) { + return N1mmDetail::failure (QStringLiteral ("unknown JTTY action: %1").arg (action)); + } + + QString const payload = message.mid (close + 2).simplified ().toUpper (); + if (payload.isEmpty ()) return N1mmDetail::failure (QStringLiteral ("tagged payload is empty")); + QStringList const fields = payload.split (QLatin1Char {' '}, Qt::SkipEmptyParts); + N1mmCompilation result; + result.status = N1mmCompileStatus::Native; + QString error; + + if (action == QStringLiteral ("CQ")) { + if (fields.size () != 1 + || !N1mmDetail::appendCall (result.atoms, CallAction::Cq, + fields.value (0), error)) { + if (error.isEmpty ()) error = QStringLiteral ("CQ payload must contain one callsign"); + } else { + result.canonicalText = QStringLiteral ("CQ %1 CQ").arg (fields.first ()); + } + } else if (action == QStringLiteral ("CALL_EXCH") + || action == QStringLiteral ("TU_NOW_EXCH")) { + if (fields.size () < 2) { + error = QStringLiteral ("call/exchange payload is incomplete"); + } else { + QString const call = fields.first (); + CallAction const callAction = action == QStringLiteral ("CALL_EXCH") + ? CallAction::Call : CallAction::TuNowCall; + if (N1mmDetail::appendCall (result.atoms, callAction, call, error)) { + auto const exchange = N1mmDetail::expandedExchange ( + fields.mid (1).join (QLatin1Char {' '}), profile); + if (!exchange.valid) { + error = exchange.error; + result.atoms.clear (); + } else { + result.atoms.append (exchange.atom); + result.canonicalText = action == QStringLiteral ("CALL_EXCH") + ? call + QLatin1Char {' '} + exchange.text + : QStringLiteral ("TU NOW %1 %2").arg (call, exchange.text); + } + } + } + } else if (action == QStringLiteral ("CALL_TU_CQ")) { + if (fields.size () != 2 + || !N1mmDetail::appendCall (result.atoms, CallAction::CallTu, + fields.value (0), error) + || !N1mmDetail::appendCall (result.atoms, CallAction::Cq, + fields.value (1), error)) { + if (error.isEmpty ()) { + error = QStringLiteral ("CALL_TU_CQ payload must contain two callsigns"); + } + } else { + result.canonicalText = QStringLiteral ("%1 TU CQ %2 CQ").arg ( + fields.at (0), fields.at (1)); + } + } else if (action == QStringLiteral ("MYCALL") || action == QStringLiteral ("HISCALL")) { + if (fields.size () != 1 + || !N1mmDetail::appendCall (result.atoms, CallAction::Call, + fields.value (0), error)) { + if (error.isEmpty ()) error = QStringLiteral ("call payload must contain one callsign"); + } else { + result.canonicalText = fields.first (); + } + } else if (action == QStringLiteral ("CALL_MY") + || action == QStringLiteral ("CALL_TU_MY")) { + bool const withTu = action == QStringLiteral ("CALL_TU_MY"); + if (fields.size () != 2 + || !N1mmDetail::appendCall (result.atoms, + withTu ? CallAction::CallTu : CallAction::Call, + fields.value (0), error) + || !N1mmDetail::appendCall (result.atoms, CallAction::Call, + fields.value (1), error)) { + if (error.isEmpty ()) error = QStringLiteral ("two-call payload must contain two callsigns"); + } else { + result.canonicalText = withTu + ? QStringLiteral ("%1 TU %2").arg (fields.at (0), fields.at (1)) + : QStringLiteral ("%1 %2").arg (fields.at (0), fields.at (1)); + } + } else if (action == QStringLiteral ("EXCH")) { + auto const exchange = N1mmDetail::expandedExchange (payload, profile); + if (!exchange.valid) { + error = exchange.error; + } else { + result.atoms.append (exchange.atom); + result.canonicalText = exchange.text; + } + } else if (action == QStringLiteral ("GRID")) { + if (fields.size () != 1 || !isGrid4 (fields.first ())) { + error = QStringLiteral ("GRID payload must contain one valid four-character grid"); + } else { + result.atoms.append (nativeGridAtom (ExchangeRole::FieldOnly, fields.first ())); + result.canonicalText = fields.first (); + } + } else if (action == QStringLiteral ("CONTROL")) { + int const phraseId = controlPhraseId (payload); + if (phraseId < 0) { + error = QStringLiteral ("unknown CONTROL phrase"); + } else { + result.atoms.append (nativeControlAtom (phraseId)); + result.canonicalText = controlPhrase (phraseId); + } + } + + if (!error.isEmpty ()) return N1mmDetail::failure (error); + if (result.atoms.isEmpty ()) return N1mmDetail::failure (QStringLiteral ("tag produced no atoms")); + return result; + } + + inline N1mmCompilation compileN1mmMessage ( + QString const& message, NativeMacroContext const& context) + { + return compileN1mmMessage (message, context.exchangeProfile); + } +} + +#endif diff --git a/widgets/JttyN1mmOutput.hpp b/widgets/JttyN1mmOutput.hpp new file mode 100644 index 00000000..ad92fc23 --- /dev/null +++ b/widgets/JttyN1mmOutput.hpp @@ -0,0 +1,57 @@ +// -*- Mode: C++ -*- +#ifndef JTTY_N1MM_OUTPUT_HPP +#define JTTY_N1MM_OUTPUT_HPP + +#include +#include + +namespace Jtty +{ + class N1mmOutput + { + public: + void submit (qint64 requestId) + { + requests_.insert (requestId); + completionPending_ = true; + } + + bool accept (qint64 requestId) + { + if (!requests_.contains (requestId)) return false; + acceptedAudio_ = true; + return true; + } + bool resolve (qint64 requestId) { return requests_.remove (requestId) != 0; } + bool pending () const { return completionPending_; } + bool finishRequested () const { return finishRequested_; } + bool startRequested () const { return startRequested_; } + void start () { finishRequested_ = false; startRequested_ = true; } + void started () { startRequested_ = false; } + void finish () + { + if (completionPending_) finishRequested_ = true; + if (requests_.isEmpty ()) startRequested_ = false; + } + void abort () { *this = N1mmOutput {}; } + + bool takeCompletion (bool audioActive, bool drained = false) + { + // Rejections can precede more TXTEXT in the same transaction. OFF + // closes an empty transaction; accepted audio completes only at drain. + if (!completionPending_ || !requests_.isEmpty () || audioActive + || (!finishRequested_ && !(drained && acceptedAudio_))) return false; + abort (); + return true; + } + + private: + QSet requests_; + bool completionPending_ {false}; + bool finishRequested_ {false}; + bool startRequested_ {false}; + bool acceptedAudio_ {false}; + }; +} + +#endif diff --git a/widgets/MMTTYIF.cpp b/widgets/MMTTYIF.cpp new file mode 100644 index 00000000..1745db56 --- /dev/null +++ b/widgets/MMTTYIF.cpp @@ -0,0 +1,257 @@ +#include "MMTTYIF.hpp" +#include +#include +#include +#include + +namespace +{ + int constexpr maximum_header_bytes {64}; + int constexpr maximum_payload_bytes {64 * 1024}; + int constexpr maximum_frame_bytes {maximum_header_bytes + maximum_payload_bytes}; + + bool resynchronizeAt (QByteArray * buffer, int next) + { + if (next < 0) { + buffer->clear (); + return false; + } + + buffer->remove (0, next); + return true; + } + + bool resynchronize (QByteArray * buffer) + { + return resynchronizeAt (buffer, buffer->indexOf ('<', 1)); + } + + bool hasCompleteTrailingPayload (QByteArray const& command, + QByteArray const& buffer, + int payloadStart) + { + int const payloadSize = buffer.size () - payloadStart; + return payloadSize == command.size () + && buffer.mid (payloadStart, payloadSize).compare (command, Qt::CaseInsensitive) == 0; + } +} + +MMTTYIF::MMTTYIF(QObject *parent) : QObject(parent), + m_socket(new QTcpSocket(this)), + m_retryTimer(new QTimer(this)) { + m_retryTimer->setSingleShot(true); + m_socket->setReadBufferSize(maximum_frame_bytes); + + connect(m_socket, &QTcpSocket::readyRead, this, &MMTTYIF::onReadyRead); + connect(m_socket, &QTcpSocket::connected, this, &MMTTYIF::onConnected); + connect(m_socket, &QTcpSocket::disconnected, this, &MMTTYIF::onDisconnected); +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) + connect(m_socket, &QTcpSocket::errorOccurred, this, &MMTTYIF::onError); +#else + connect(m_socket, QOverload::of(&QAbstractSocket::error), this, &MMTTYIF::onError); +#endif + + connect(m_retryTimer, &QTimer::timeout, this, &MMTTYIF::onRetryTimeout); +} + +MMTTYIF::~MMTTYIF() { + shutdown(); +} + +void MMTTYIF::initialize(quint16 port) { + m_port = port; + m_connectionRetries = 0; + + QString logStr = QString("[INIT] Starting TCP connection to 127.0.0.1:%1").arg(m_port); + emit log_message(logStr); + + m_socket->connectToHost("127.0.0.1", m_port); +} + +void MMTTYIF::onConnected() { + m_connectionRetries = 0; + QString logStr = QString("[TCP] Connected to N1MM Logger+ on port %1").arg(m_port); + emit log_message(logStr); +} + +void MMTTYIF::onDisconnected() { + QString logStr = QString("[TCP] Disconnected from N1MM Logger+"); + emit log_message(logStr); +} + +void MMTTYIF::onError(QAbstractSocket::SocketError socketError) { + Q_UNUSED(socketError) + if (m_connectionRetries < 5) { + m_connectionRetries++; + QString logStr = QString("[TCP] Connection error, retrying (%1/5) in 1s...").arg(m_connectionRetries); + emit log_message(logStr); + m_retryTimer->start(1000); + } else { + QString logStr = QString("[TCP] Failed to connect after 5 retries."); + emit log_message(logStr); + emit connection_failed(); + } +} + +void MMTTYIF::onRetryTimeout() { + m_socket->connectToHost("127.0.0.1", m_port); +} + +void MMTTYIF::onReadyRead() { + QByteArray data = m_socket->readAll(); + m_rxBuffer.append(data); + + QString logStr = QString("[TCP RCVD] %1").arg(QString::fromLatin1(data)); + emit log_message(logStr); + emit message_received(); + + parseBufferedCommands(); +} + +void MMTTYIF::parseBufferedCommands() { + while (!m_rxBuffer.isEmpty()) { + int const open = m_rxBuffer.indexOf('<'); + if (open < 0) { + emit log_message(QString("[TCP WARN] Dropping unframed data: %1") + .arg(QString::fromLatin1(m_rxBuffer))); + m_rxBuffer.clear(); + return; + } + + if (open > 0) { + emit log_message(QString("[TCP WARN] Dropping data before command: %1") + .arg(QString::fromLatin1(m_rxBuffer.left(open)))); + m_rxBuffer.remove(0, open); + } + + int const close = m_rxBuffer.indexOf('>'); + if (close < 0) { + if (m_rxBuffer.size() < maximum_header_bytes) return; + + emit log_message(QString("[TCP WARN] Command header exceeds %1-byte limit") + .arg(maximum_header_bytes)); + if (!resynchronize(&m_rxBuffer)) return; + continue; + } + + if (close + 1 > maximum_header_bytes) { + emit log_message(QString("[TCP WARN] Command header exceeds %1-byte limit") + .arg(maximum_header_bytes)); + if (!resynchronize(&m_rxBuffer)) return; + continue; + } + + QByteArray const header = m_rxBuffer.mid(1, close - 1); + int const colon = header.indexOf(':'); + QByteArray const command = (colon >= 0 ? header.left(colon) : header).toUpper(); + int payloadLength = -1; + if (colon >= 0) { + bool ok = false; + payloadLength = header.mid(colon + 1).toInt(&ok); + if (!ok || payloadLength < 0) { + emit log_message(QString("[TCP WARN] Invalid command length in <%1>") + .arg(QString::fromLatin1(header))); + if (!resynchronize (&m_rxBuffer)) return; + continue; + } + if (payloadLength > maximum_payload_bytes) { + emit log_message(QString("[TCP WARN] Command payload length exceeds %1-byte limit in <%2>") + .arg(maximum_payload_bytes) + .arg(QString::fromLatin1(header))); + if (!resynchronize (&m_rxBuffer)) return; + continue; + } + } + + int payloadStart = close + 1; + int payloadEnd = payloadStart; + if (payloadLength >= 0) { + int const availablePayload = m_rxBuffer.size() - payloadStart; + if (availablePayload < payloadLength) return; + payloadEnd = payloadStart + payloadLength; + } else { + int const next = m_rxBuffer.indexOf('<', payloadStart); + payloadEnd = next >= 0 ? next : m_rxBuffer.size(); + if (payloadEnd - payloadStart > maximum_payload_bytes) { + emit log_message(QString("[TCP WARN] Command payload exceeds %1-byte limit") + .arg(maximum_payload_bytes)); + if (!resynchronizeAt (&m_rxBuffer, next)) return; + continue; + } + if (next < 0 + && !hasCompleteTrailingPayload (command, m_rxBuffer, payloadStart)) return; + } + + QByteArray const payload = m_rxBuffer.mid(payloadStart, payloadEnd - payloadStart); + m_rxBuffer.remove(0, payloadEnd); + dispatchCommand(command, payload); + } +} + +void MMTTYIF::dispatchCommand(QByteArray const& command, QByteArray const& payload) { + QString const content = QString::fromLatin1(payload); + + if (command == "TXTEXT") { + emit app_tx_string(content.toUpper()); + } else if (command == "XMIT") { + if (content.startsWith("ON", Qt::CaseInsensitive)) { + emit app_start_tx(); + } else if (content.startsWith("OFF", Qt::CaseInsensitive)) { + emit app_stop_tx(); + } + } else if (command == "ABORT") { + emit app_abort_tx(); + } else if (command == "CLOSE") { + emit app_is_quitting(); + } else { + emit log_message(QString("[TCP WARN] Ignoring unknown command <%1>") + .arg(QString::fromLatin1(command))); + } +} + + +void MMTTYIF::shutdown() { + QString logStr = "[EXIT] MMTTYIF shutting down"; + emit log_message(logStr); + + if (m_socket && m_socket->isOpen()) { + m_socket->disconnectFromHost(); + } +} + +bool MMTTYIF::isConnected() const { + return m_socket->state() == QAbstractSocket::ConnectedState; +} + +void MMTTYIF::echo_message_to_n1mm(const QString &message) { + if (isConnected()) { + if (message.isEmpty()) { + QString logStr = QString("MMTTYIF::echo_message_to_n1mm - Ignoring Empty message"); + emit log_message(logStr); + return; + } + QString msgToSend = QString("%2").arg(message.length()).arg(message); + m_socket->write(msgToSend.toLatin1()); + m_socket->flush(); + + QString logStr = QString("[TCP SENT] %1").arg(msgToSend); + emit log_message(logStr); + } +} + +void MMTTYIF::report_output_complete() { + if (isConnected()) { + QString msgToSend = ""; + m_socket->write(msgToSend.toLatin1()); + m_socket->flush(); + + QString logStr = QString("[TCP SENT] %1").arg(msgToSend); + emit log_message(logStr); + } +} + +void MMTTYIF::report_ptt_state(bool is_on) { + if (isConnected() && !is_on) { + emit log_message("[TCP INFO] PTT off; OUTPUTCOMPLETE is sent from JTTY drain"); + } +} diff --git a/widgets/MMTTYIF.hpp b/widgets/MMTTYIF.hpp new file mode 100644 index 00000000..f29adc0d --- /dev/null +++ b/widgets/MMTTYIF.hpp @@ -0,0 +1,63 @@ +#ifndef MMTTYIF_HPP +#define MMTTYIF_HPP + +#include +#include +#include +#include +#include + +class MMTTYIF : public QObject { + Q_OBJECT + +public: + explicit MMTTYIF(QObject *parent = nullptr); + ~MMTTYIF(); + + void initialize(quint16 port); + bool isConnected() const; + +signals: + void inactivity_timeout(); + void app_is_quitting(); + void app_tx_string(QString str); + void app_start_tx(); + void app_stop_tx(); + void app_abort_tx(); + + void message_received(); + void log_message(const QString &msg); + void connection_failed(); + +public slots: + void echo_message_to_n1mm(const QString &message); + void report_output_complete(); + void report_ptt_state(bool is_on); + void shutdown(); + +private slots: + void onConnected(); + void onDisconnected(); +#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) + void onError(QAbstractSocket::SocketError socketError); +#else + void onError(QAbstractSocket::SocketError socketError); +#endif + void onRetryTimeout(); + void onReadyRead(); + +private: + void parseBufferedCommands(); + void dispatchCommand(QByteArray const& command, QByteArray const& payload); + + QTcpSocket *m_socket; + QTimer *m_retryTimer; + QByteArray m_rxBuffer; + int m_connectionRetries; + quint16 m_port; + + quint32 m_baudRate = 0; + quint32 m_heightWidth = 0; +}; + +#endif // MMTTYIF_HPP diff --git a/widgets/QSYMessage.cpp b/widgets/QSYMessage.cpp index 9078c774..1dac0313 100644 --- a/widgets/QSYMessage.cpp +++ b/widgets/QSYMessage.cpp @@ -5,6 +5,7 @@ #include "SettingsGroup.hpp" #include "Configuration.hpp" #include "QSYMessage.h" +#include "widgets/QSYMessageParser.h" #include "ui_QSYMessage.h" QSYMessage::QSYMessage(const QString& message,const QString& theCall, QSettings * settings, Configuration const * configuration, QWidget *parent) : @@ -59,307 +60,23 @@ void QSYMessage::on_noButton_clicked() void QSYMessage::getBandModeFreq() { - if(receivedMessage.at(0) =='$' && receivedMessage.size() >= 5) - { -#if QT_VERSION >= QT_VERSION_CHECK (5, 15, 0) - QStringList bhList = receivedMessage.split(" ",Qt::SkipEmptyParts); -#else - QStringList bhList = receivedMessage.split(" ",QString::SkipEmptyParts); -#endif - ui->label->setText(bhList[1] + " replied " +bhList[2].mid(0,2)); - ui->yesButton->hide(); - ui->noButton->hide(); - } - else if(receivedMessage.at(0) =='Z' && receivedMessage.at(1) =='A' && receivedMessage.size() >= 5) { - QString messageContent = ""; - QString text1 = ""; - QString msgNum =receivedMessage.mid(2,3); - if(msgNum == "001") { - text1 = "You are in the log"; - } else if(msgNum =="002") { - text1 = "Please call me by phone"; - } else if(msgNum =="003") { - text1 = "Check your email"; - } else if(msgNum =="004") { - text1 = "You are not in Contest Mode"; - } else if(msgNum =="005") { - text1 = "Please check your PC Clock"; - } else if(msgNum =="006") { - text1 = "You are transmitting in the wrong time slot"; - } else if(msgNum =="007") { - text1 = "Please transmit above 1000 Hz"; - } else if(msgNum =="008") { - text1 = "Your transmitter is overmodulated"; - } else if(msgNum =="009") { - text1 = "Your audio is distorted"; - } else if(msgNum =="010") { - text1 = "You are transmitting on top of a rare DX station"; - } else if(msgNum =="011") { - text1 = "Please check HB9Q Logger"; - } else if(msgNum =="012") { - text1 = "Please check Ping Jockey"; - } else if(msgNum =="013") { - text1 = "Please check ON4KST"; - } else if(msgNum =="014") { - text1 = "Please QSL via LoTW"; - } - ui->noButton->setHidden(true); - ui->yesButton->setText("OK"); - ui->label->setText(text1); - } - else if(receivedMessage.at(0).isLetter() || receivedMessage.at(0) == '9' || receivedMessage.at(0) == '4' || receivedMessage.at(0) == '7') - { - QString bandParam = ""; - QString modeParam = receivedMessage.at(0); - QString freqParam = ""; - bandParam = receivedMessage.mid(0,1); - modeParam = receivedMessage.at(1); - freqParam = receivedMessage.mid(2, 3); - QString band = ""; - QString mode = ""; - QString freq = ""; - - if (bandParam == "A") { - if (modeParam.at(0).isLetter()) { - freq = "50."; - } else { - if (modeParam =="0") { - freq = "50."; - } else if (modeParam =="1") { - freq = "51."; - } else if (modeParam =="2") { - freq = "52."; - } else if (modeParam =="3") { - freq = "53."; - } - } - } - else if (bandParam == "B") { - if (modeParam.at(0).isLetter()) { - freq = "144."; - } else { - if (modeParam =="4") { - freq = "144."; - } else if (modeParam =="5") { - freq = "145."; - } else if (modeParam =="6") { - freq = "146."; - } else if (modeParam =="7") { - freq = "147."; - } - } - } - else if (bandParam == "C") { - if (modeParam.at(0).isLetter()) { - freq = "222."; - } else { - if (modeParam =="2") { - freq = "222."; - } else if (modeParam =="3") { - freq = "223."; - } - } - } - else if (bandParam == "D") { - if (modeParam.at(0).isLetter()) { - freq = "432."; - } else { - if (configuration_->region()==2) { - if (modeParam =="0") { - freq = "440."; - } else if (modeParam =="1") { - freq = "441."; - } else if (modeParam =="2") { - freq = "442."; - } else if (modeParam =="3") { - freq = "443."; - } else if (modeParam =="4") { - freq = "444."; - } else if (modeParam =="5") { - freq = "445."; - } else if (modeParam =="6") { - freq = "446."; - } else if (modeParam =="7") { - freq = "447."; - } else if (modeParam =="8") { - freq = "448."; - } else if (modeParam =="9") { - freq = "449."; - } - } else { //not region 2 - if (modeParam =="0") { - freq = "430."; - } else if (modeParam =="1") { - freq = "431."; - } else if (modeParam =="2") { - freq = "432."; - } else if (modeParam =="3") { - freq = "433."; - } else if (modeParam =="4") { - freq = "434."; - } else if (modeParam =="5") { - freq = "435."; - } else if (modeParam =="6") { - freq = "436."; - } else if (modeParam =="7") { - freq = "437."; - } else if (modeParam =="8") { - freq = "438."; - } else if (modeParam =="9") { - freq = "439."; - } - } - } - } - else if (bandParam == "E") { - if (modeParam.at(0).isLetter()) { - freq = "1296."; - } else { - if (modeParam =="0") { - freq = "1290."; - } else if (modeParam =="1") { - freq = "1291."; - } else if (modeParam =="2") { - freq = "1292."; - } else if (modeParam =="3") { - freq = "1293."; - } else if (modeParam =="4") { - freq = "1294."; - } else if (modeParam =="5") { - freq = "1295."; - } else if (modeParam =="6") { - freq = "1296."; - } else if (modeParam =="7") { - freq = "1297."; - } else if (modeParam =="8") { - freq = "1298."; - } else if (modeParam =="9") { - freq = "1299."; - } - } - } - else if (bandParam == "F") { - freq = "2304."; - } - else if (bandParam == "G") { - freq = "3400."; - } - else if (bandParam == "H") { - freq = "5760."; - } - else if (bandParam == "I") { - freq = "10368."; - } - else if (bandParam == "J") { - if (configuration_->region()==2) { - freq = "24192."; - } else { - freq = "24048."; - } - } - else if (bandParam == "9") { - freq = "902."; - } - else if (bandParam == "K") { - freq = "903."; - } - else if (bandParam == "J") { - freq = "24192."; - } - else if (bandParam == "X") { - freq = "24048."; - } - else if (bandParam == "4") { - freq = "40."; - } - else if (bandParam == "7") { - freq = "70."; - } - else if (bandParam == "L") { - freq = "0."; - } - else if (bandParam == "M") { - freq = "1."; - } - else if (bandParam == "N") { - freq = "3."; - } - else if (bandParam == "O") { - freq = "5."; - } - else if (bandParam == "P") { - freq = "7."; - } - else if (bandParam == "Q") { - freq = "10."; - } - else if (bandParam == "R") { - freq = "14."; - } - else if (bandParam == "S") { - freq = "18."; - } - else if (bandParam == "T") { - freq = "21."; - } - else if (bandParam == "U") { - freq = "24."; - } - else if (bandParam == "V") { - freq = "28."; - } - else if (bandParam == "W") { - freq = "29."; - } else { - freq = ""; - } - - freq = freq + freqParam; - if(!modeParam.at(0).isLetter()) { - mode = "FM"; - } - else if (modeParam == 'V') { - mode = "SSB"; - } - else if (modeParam == 'J') { - mode = "FT4"; - } - else if (modeParam == 'L') { - mode = "FT8"; - } - else if (modeParam == 'K') { - mode = "MSK144"; - } - else if (modeParam == 'W') { - mode = "CW"; - } - else if (modeParam == 'A') { - mode = "JT9"; - } - else if (modeParam == 'B') { - mode = "JT65"; - } - else if (modeParam == 'C') { - mode = "FST4"; - } - else if (modeParam == 'D') { - mode = "Q65-30B"; - } - else if (modeParam == 'E') { - mode = "Q65-60C"; - } - else if (modeParam == 'F') { - mode = "Q65-60D"; - } - else if (modeParam == 'G') { - mode = "Q65-60E"; - } - else if (modeParam == 'H') { - mode = "Q65-120D"; - } - else { - mode = ""; - } - ui->label->setText("QSY to\n" + freq + " MHz\n" + "mode " + mode); + QSYMessageParser::Message const message = + QSYMessageParser::decode (receivedMessage, configuration_->region ()); + switch (message.type) { + case QSYMessageParser::Type::Reply: + ui->label->setText (message.call + " replied " + message.response); + ui->yesButton->hide (); + ui->noButton->hide (); + break; + case QSYMessageParser::Type::General: + ui->noButton->setHidden (true); + ui->yesButton->setText ("OK"); + ui->label->setText (message.text); + break; + case QSYMessageParser::Type::Frequency: + ui->label->setText ("QSY to\n" + message.frequency_mhz + " MHz\n" + "mode " + message.mode); + break; + case QSYMessageParser::Type::Invalid: + break; } } diff --git a/widgets/QSYMessageCreator.cpp b/widgets/QSYMessageCreator.cpp index 0529c876..f0e79bab 100644 --- a/widgets/QSYMessageCreator.cpp +++ b/widgets/QSYMessageCreator.cpp @@ -22,6 +22,7 @@ #include "SettingsGroup.hpp" #include "Configuration.hpp" #include "qt_helpers.hpp" +#include "widgets/QSYMessageParser.h" #include "QSYMessageCreator.h" #include "ui_QSYMessageCreator.h" @@ -859,22 +860,24 @@ void QSYMessageCreator::on_genButton_clicked() } QString QSYMessageCreator::getGenMessage() { - QString message; - if (ui->message1->isChecked()) message = "001"; - else if (ui->message2->isChecked()) message = "002"; - else if (ui->message3->isChecked()) message = "003"; - else if (ui->message4->isChecked()) message = "004"; - else if (ui->message5->isChecked()) message = "005"; - else if (ui->message6->isChecked()) message = "006"; - else if (ui->message7->isChecked()) message = "007"; - else if (ui->message8->isChecked()) message = "008"; - else if (ui->message9->isChecked()) message = "009"; - else if (ui->message10->isChecked()) message = "010"; - else if (ui->message11->isChecked()) message = "011"; - else if (ui->message12->isChecked()) message = "012"; - else if (ui->message13->isChecked()) message = "013"; - else if (ui->message14->isChecked()) message = "014"; - message = ui->DxBaseLabel->text() + ".ZA" + message; + int code = 0; + if (ui->message1->isChecked()) code = 1; + else if (ui->message2->isChecked()) code = 2; + else if (ui->message3->isChecked()) code = 3; + else if (ui->message4->isChecked()) code = 4; + else if (ui->message5->isChecked()) code = 5; + else if (ui->message6->isChecked()) code = 6; + else if (ui->message7->isChecked()) code = 7; + else if (ui->message8->isChecked()) code = 8; + else if (ui->message9->isChecked()) code = 9; + else if (ui->message10->isChecked()) code = 10; + else if (ui->message11->isChecked()) code = 11; + else if (ui->message12->isChecked()) code = 12; + else if (ui->message13->isChecked()) code = 13; + else if (ui->message14->isChecked()) code = 14; + + QString const payload = QSYMessageParser::encodeGeneral (code); + QString const message = payload.isEmpty () ? QString {} : ui->DxBaseLabel->text() + "." + payload; ui->messageLabel4->setText(message); return message; } @@ -1019,25 +1022,27 @@ void QSYMessageCreator::read_settings () QString QSYMessageCreator::WriteMessage (QString hisCall, QString band, QChar mode) { - QString message = ""; + int kHzFreq = 0; + QLabel * label = nullptr; if(ui->tabWidget->currentIndex() == 1) { - qint16 kHzFreq = ui->kHzBox->value(); - QString kHzStr = QStringLiteral("%1").arg(kHzFreq,3,10,QLatin1Char('0')); - message = hisCall + "." + band + mode + kHzStr; - ui->messageLabel->setText(message); + kHzFreq = ui->kHzBox->value(); + label = ui->messageLabel; } else if(ui->tabWidget->currentIndex() == 0) { - qint16 kHzFreq = ui->kHzBox2->value(); - QString kHzStr = QStringLiteral("%1").arg(kHzFreq,3,10,QLatin1Char('0')); - message = hisCall + "." + band + mode + kHzStr; - ui->messageLabel2->setText(message); + kHzFreq = ui->kHzBox2->value(); + label = ui->messageLabel2; } else if(ui->tabWidget->currentIndex() == 2) { - qint16 kHzFreq = ui->kHzBox3->value(); - QString kHzStr = QStringLiteral("%1").arg(kHzFreq,3,10,QLatin1Char('0')); - message = hisCall + "." + band + mode + kHzStr; - ui->messageLabel3->setText(message); + kHzFreq = ui->kHzBox3->value(); + label = ui->messageLabel3; } + + if (!label) return QString {}; + + QChar const bandChar = band.isEmpty () ? QChar {} : band.at (0); + QString const payload = QSYMessageParser::encodeFrequency (bandChar, mode, kHzFreq, configuration_->region ()); + QString const message = payload.isEmpty () ? QString {} : hisCall + "." + payload; + label->setText(message); return message; } diff --git a/widgets/QSYMessageParser.cpp b/widgets/QSYMessageParser.cpp new file mode 100644 index 00000000..f51cba7f --- /dev/null +++ b/widgets/QSYMessageParser.cpp @@ -0,0 +1,250 @@ +#include "widgets/QSYMessageParser.h" + +#include +#include +#include + +namespace +{ + QStringList split_ws (QString const& s) + { +#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) + return s.split (' ', QString::SkipEmptyParts); +#else + return s.split (' ', Qt::SkipEmptyParts); +#endif + } + + bool all_digits (QString const& s) + { + if (s.isEmpty ()) return false; + for (int i = 0; i < s.size (); ++i) + if (!s.at (i).isDigit ()) return false; + return true; + } + + QString pad3 (int n) + { + return QString {"%1"}.arg (n, 3, 10, QLatin1Char ('0')); + } + + struct ModeRow { char ch; char const* name; }; + ModeRow const kModes[] = { + {'V', "SSB"}, {'W', "CW"}, {'L', "FT8"}, {'K', "MSK144"}, + {'J', "FT4"}, {'A', "JT9"}, {'B', "JT65"}, {'C', "FST4"}, + {'D', "Q65-30B"}, {'E', "Q65-60C"}, {'F', "Q65-60D"}, + {'G', "Q65-60E"}, {'H', "Q65-120D"}, + }; + + bool mode_name (QChar m, QString * out) + { + if (m.isDigit ()) { if (out) *out = QStringLiteral ("FM"); return true; } + if (!m.isLetter ()) return false; + char const c = m.toLatin1 (); + for (ModeRow const& r : kModes) + if (r.ch == c) { if (out) *out = QString::fromLatin1 (r.name); return true; } + return false; + } + + char const* const kGeneral[] = { + "You are in the log", + "Please call me by phone", + "Check your email", + "You are not in Contest Mode", + "Please check your PC Clock", + "You are transmitting in the wrong time slot", + "Please transmit above 1000 Hz", + "Your transmitter is overmodulated", + "Your audio is distorted", + "You are transmitting on top of a rare DX station", + "Please check HB9Q Logger", + "Please check Ping Jockey", + "Please check ON4KST", + "Please QSL via LoTW", + }; + int const kGeneralCount = int (sizeof kGeneral / sizeof kGeneral[0]); // 14 + + bool is_vhf_subband (char b) + { + return b == 'A' || b == 'B' || b == 'C' || b == 'D' || b == 'E'; + } + + bool fm_digit_prefix (char band, QChar m, int region, QString * out) + { + int const d = m.digitValue (); + if (d < 0) return false; + int mhz; + switch (band) + { + case 'A': if (d > 3) return false; mhz = 50 + d; break; // 50..53 + case 'B': if (d < 4 || d > 7) return false; mhz = 140 + d; break; // 144..147 + case 'C': + if (region == 2) + { + if (d < 2 || d > 3) return false; + mhz = 220 + d; + } + else + { + if (d != 0) return false; + mhz = 222; + } + break; + case 'D': mhz = (region == 2 ? 440 : 430) + d; break; // 0..9 + case 'E': mhz = 1290 + d; break; // 0..9 + default: return false; + } + if (out) *out = QString::number (mhz) + "."; + return true; + } + + bool simple_prefix (char band, int region, QString * out) + { + if (band == 'J') { if (out) *out = (region == 2 ? "24192." : "24048."); return true; } + struct Row { char ch; char const* p; }; + static Row const simple[] = { + {'F', "2304."}, {'G', "3400."}, {'H', "5760."}, {'I', "10368."}, + {'K', "903."}, {'X', "24048."},{'9', "902."}, {'4', "40."}, {'7', "70."}, + {'L', "0."}, {'M', "1."}, {'N', "3."}, {'O', "5."}, {'P', "7."}, + {'Q', "10."}, {'R', "14."}, {'S', "18."}, {'T', "21."}, {'U', "24."}, + {'V', "28."}, {'W', "29."}, + }; + for (Row const& r : simple) + if (r.ch == band) { if (out) *out = QString::fromLatin1 (r.p); return true; } + return false; + } + + bool band_prefix (QChar band, QChar mode, int region, QString * out) + { + char const b = band.toLatin1 (); + if (is_vhf_subband (b)) + { + if (mode.isLetter ()) // letter (digital) mode -> base of the band + { + int const base = (b == 'A' ? 50 : b == 'B' ? 144 : b == 'C' ? 222 + : b == 'D' ? 432 : 1296); + if (out) *out = QString::number (base) + "."; + return true; + } + return fm_digit_prefix (b, mode, region, out); + } + return simple_prefix (b, region, out); + } + + QSYMessageParser::Message decode_reply (QString const& p) + { + QSYMessageParser::Message m; + if (!p.startsWith (QLatin1Char ('$'))) return m; + QStringList const f = split_ws (p); + if (f.size () != 3) return m; + if (f.at (0) != QLatin1String ("$")) return m; + if (f.at (2) != QLatin1String ("OKQSY") && f.at (2) != QLatin1String ("NOQSY")) return m; + m.type = QSYMessageParser::Type::Reply; + m.call = f.at (1); + m.response = f.at (2).left (2); + return m; + } + + QSYMessageParser::Message decode_general (QString const& p) + { + QSYMessageParser::Message m; + if (p.size () != 5) return m; // "ZA" + exactly 3 digits + if (p.at (0) != QLatin1Char ('Z') || p.at (1) != QLatin1Char ('A')) return m; + QString const digits = p.mid (2, 3); + if (!all_digits (digits)) return m; + int const code = digits.toInt (); + if (code < 1 || code > kGeneralCount) return m; + m.type = QSYMessageParser::Type::General; + m.code = code; + m.text = QString::fromLatin1 (kGeneral[code - 1]); + return m; + } + + QSYMessageParser::Message decode_frequency (QString const& p, int region) + { + QSYMessageParser::Message m; + if (p.size () != 5) return m; // band + mode + exactly 3 digits + QChar const band = p.at (0); + QChar const mode = p.at (1); + QString const digits = p.mid (2, 3); + if (!all_digits (digits)) return m; // freq field must be numeric + QString mode_str; + if (!mode_name (mode, &mode_str)) return m; // reject non-modes (I, R, ...) + QString prefix; + if (!band_prefix (band, mode, region, &prefix)) return m; // reject bad band / combo + m.type = QSYMessageParser::Type::Frequency; + m.band = band; + m.mode_char = mode; + m.kHz = digits.toInt (); + m.frequency_mhz = prefix + digits; + m.mode = mode_str; + return m; + } +} + +namespace QSYMessageParser +{ + Message decode (QString const& payload, int region) + { + if (payload.startsWith (QLatin1Char ('$'))) return decode_reply (payload); + if (payload.startsWith (QLatin1String ("ZA"))) return decode_general (payload); + return decode_frequency (payload, region); + } + + QString encode (Message const& m) + { + switch (m.type) + { + case Type::Frequency: return QString {m.band} + m.mode_char + pad3 (m.kHz); + case Type::General: return QStringLiteral ("ZA") + pad3 (m.code); + case Type::Reply: + case Type::Invalid: break; + } + return QString {}; + } + + QString encodeFrequency (QChar band, QChar mode, int kHz, int region) + { + if (kHz < 0 || kHz > 999) return QString {}; + QString scratch; + if (!mode_name (mode, &scratch)) return QString {}; + if (!band_prefix (band, mode, region, &scratch)) return QString {}; + return QString {band} + mode + pad3 (kHz); + } + + QString encodeGeneral (int code) + { + if (code < 1 || code > kGeneralCount) return QString {}; + return QStringLiteral ("ZA") + pad3 (code); + } + + QString encodeReplyWire (bool ok) + { + return ok ? QStringLiteral ("OKQSY") : QStringLiteral ("NOQSY"); + } + + bool mightContainMessage (QString const& line) + { + return line.contains (QLatin1Char ('.')); + } + + LineResult decodeLine (QString const& line, int region) + { + LineResult result; + for (QString const& token : split_ws (line)) + { + int const dot = token.indexOf (QLatin1Char ('.')); + if (dot <= 0 || dot >= token.size () - 1) continue; + QString const payload = token.mid (dot + 1); + Message const m = decode (payload, region); + if (m) + { + result.call = token.left (dot); + result.payload = payload; + result.message = m; + return result; + } + } + return result; + } +} diff --git a/widgets/QSYMessageParser.h b/widgets/QSYMessageParser.h new file mode 100644 index 00000000..b45b5109 --- /dev/null +++ b/widgets/QSYMessageParser.h @@ -0,0 +1,62 @@ +// -*- Mode: C++ -*- +#ifndef QSYMESSAGEPARSER_H +#define QSYMESSAGEPARSER_H + +#include +// Table-driven codec for the WSJT-X QSY Message wire language. decode() is the +// single source of truth for whether a payload is valid. +// +// Payload grammar: +// payload = freq | general | reply-display +// freq = band mode-or-fmdigit kHz3 e.g. "AL125", "B5550" +// general = "ZA" NNN (NNN in 001..014) e.g. "ZA007" +// reply = "$ " CALL " " ("OKQSY"|"NOQSY") synthesized locally on RX +namespace QSYMessageParser +{ + enum class Type { Invalid, Reply, General, Frequency }; + + struct Message + { + Type type; + + // Reply + QString call; // station that replied + QString response; // "OK" | "NO" + + // General + int code; // 1..14 + QString text; // canned-message text + + // Retain wire components so aliases such as J and X still round-trip. + QChar band; // e.g. 'A' + QChar mode_char; // mode letter, or FM sub-band digit + int kHz; // 0..999 + QString frequency_mhz; // e.g. "50.125" + QString mode; // e.g. "FT8" | "FM" + + Message () : type (Type::Invalid), code (0), kHz (0) {} + bool isValid () const { return type != Type::Invalid; } + explicit operator bool () const { return isValid (); } + }; + + Message decode (QString const& payload, int region); + + // Empty QString means invalid input. encode(Message) expects a Message + // returned by decode(), or an equivalently valid table-backed Message. + QString encode (Message const& message); + QString encodeFrequency (QChar band, QChar mode, int kHz, int region); + QString encodeGeneral (int code); + QString encodeReplyWire (bool ok); + + // Cheap, high-recall pre-filter for the RX hot path. NOT authoritative: every + // real QSY line passes, but some non-QSY lines may pass too. Use only as a + // fast early-exit; decode() / decodeLine() is the source of truth. + bool mightContainMessage (QString const& line); + + // Locate a "CALL.PAYLOAD" token in a decoded line and decode the payload. + // Returns the first token whose payload decodes; message.type==Invalid if none. + struct LineResult { QString call; QString payload; Message message; }; + LineResult decodeLine (QString const& line, int region); +} + +#endif diff --git a/widgets/RoundRobinSelection.cpp b/widgets/RoundRobinSelection.cpp new file mode 100644 index 00000000..d231e7ee --- /dev/null +++ b/widgets/RoundRobinSelection.cpp @@ -0,0 +1,48 @@ +#include "RoundRobinSelection.hpp" + +#include +#include + +namespace +{ + int constexpr minimumPresetSlotCount {2}; + int constexpr maximumPresetSlotCount {6}; +} + +namespace RoundRobinSelection +{ + void initialize (QComboBox& combo, QString const& randomLabel) + { + QSignalBlocker const blocker {&combo}; + combo.clear (); + combo.addItem (randomLabel, QStringLiteral ("random")); + // Keep the standard 2–6 presets while allowing larger custom schedules. + for (int count = minimumPresetSlotCount; count <= maximumPresetSlotCount; ++count) + { + for (int slot = 0; slot < count; ++slot) + { + auto const canonical = QString::fromStdString ( + BeaconTx::formatRoundRobinPolicy (BeaconTx::RoundRobinPolicy::fixed (slot, count))); + combo.addItem (canonical, canonical); + } + } + } + + BeaconTx::RoundRobinPolicy policy (QComboBox const& combo) + { + auto const index = combo.currentIndex (); + auto const text = combo.currentText (); + // Editing a preset leaves its index selected until the edit is committed. + auto const value = index >= 0 && text == combo.itemText (index) + && combo.itemData (index).isValid () ? combo.itemData (index).toString () : text; + return BeaconTx::parseRoundRobinPolicy (value.toStdString ()); + } + + void setPolicy (QComboBox& combo, BeaconTx::RoundRobinPolicy const& policy) + { + auto const canonical = QString::fromStdString (BeaconTx::formatRoundRobinPolicy (policy)); + auto const index = combo.findData (canonical); + if (index >= 0) combo.setCurrentIndex (index); + else combo.setEditText (canonical); + } +} diff --git a/widgets/RoundRobinSelection.hpp b/widgets/RoundRobinSelection.hpp new file mode 100644 index 00000000..8412e150 --- /dev/null +++ b/widgets/RoundRobinSelection.hpp @@ -0,0 +1,16 @@ +#ifndef ROUNDROBINSELECTION_HPP +#define ROUNDROBINSELECTION_HPP + +#include "BeaconTxController.hpp" + +class QComboBox; +class QString; + +namespace RoundRobinSelection +{ + void initialize (QComboBox& combo, QString const& randomLabel); + BeaconTx::RoundRobinPolicy policy (QComboBox const& combo); + void setPolicy (QComboBox& combo, BeaconTx::RoundRobinPolicy const& policy); +} + +#endif diff --git a/widgets/SettingsDialogLayout.cpp b/widgets/SettingsDialogLayout.cpp new file mode 100644 index 00000000..6da2ba65 --- /dev/null +++ b/widgets/SettingsDialogLayout.cpp @@ -0,0 +1,264 @@ +#include "SettingsDialogLayout.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ui_Configuration.h" + +namespace +{ + char const scroll_area_marker[] = "wsjtxSettingsPageScrollArea"; + char const wheel_forwarder_marker[] = "wsjtxSettingsWheelForwarder"; + + class WheelEventForwarder final : public QObject + { + public: + WheelEventForwarder (QWidget * source, QScrollArea * target) + : QObject {source} + , target_ {target} + { + source->installEventFilter (this); + } + + protected: + bool eventFilter (QObject * watched, QEvent * event) override + { + if (event->type () == QEvent::Wheel && target_ + && (target_->horizontalScrollBar ()->maximum () + > target_->horizontalScrollBar ()->minimum () + || target_->verticalScrollBar ()->maximum () + > target_->verticalScrollBar ()->minimum ())) + { + event->ignore (); + QApplication::sendEvent (target_->viewport (), event); + return true; + } + + return QObject::eventFilter (watched, event); + } + + private: + QPointer target_; + }; + + QScrollArea * findPageScrollArea (QWidget * page) + { + if (!page) + { + return nullptr; + } + + for (auto * scroll_area : page->findChildren (QString {}, Qt::FindDirectChildrenOnly)) + { + if (scroll_area->property (scroll_area_marker).toBool ()) + { + return scroll_area; + } + } + + return nullptr; + } + + QScrollArea * createScrollArea (QWidget * page, QWidget * content) + { + auto * scroll_area = new QScrollArea {page}; + scroll_area->setObjectName (page->objectName () + "_scroll_area"); + scroll_area->setProperty (scroll_area_marker, true); + scroll_area->setFrameShape (QFrame::NoFrame); + scroll_area->setFocusPolicy (Qt::NoFocus); + scroll_area->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding); + scroll_area->setSizeAdjustPolicy (QAbstractScrollArea::AdjustIgnored); + scroll_area->setHorizontalScrollBarPolicy (Qt::ScrollBarAsNeeded); + scroll_area->setVerticalScrollBarPolicy (Qt::ScrollBarAsNeeded); + scroll_area->setWidgetResizable (true); + scroll_area->setWidget (content); + scroll_area->viewport ()->setFocusPolicy (Qt::NoFocus); + scroll_area->viewport ()->setBackgroundRole (page->backgroundRole ()); + scroll_area->viewport ()->setAutoFillBackground (true); + scroll_area->horizontalScrollBar ()->setFocusPolicy (Qt::NoFocus); + scroll_area->verticalScrollBar ()->setFocusPolicy (Qt::NoFocus); + + QObject::connect (qApp, &QApplication::focusChanged, scroll_area, + [scroll_area, content] (QWidget *, QWidget * focused) { + if (focused && (focused == content || content->isAncestorOf (focused))) + { + QPointer target {focused}; + QTimer::singleShot (0, scroll_area, [scroll_area, content, target] { + if (target && (target == content || content->isAncestorOf (target))) + { + auto const margin = qMax (4, scroll_area->fontMetrics ().height () / 2); + scroll_area->ensureWidgetVisible (target, margin, margin); + } + }); + } + }); + + return scroll_area; + } + + QWidget * createContent (QWidget * page) + { + auto * content = new QWidget; + content->setObjectName (page->objectName () + "_scroll_content"); + content->setFocusPolicy (Qt::NoFocus); + content->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding); + content->setBackgroundRole (page->backgroundRole ()); + content->setAutoFillBackground (true); + return content; + } + + QScrollArea * installPageScrollArea (QWidget * page) + { + if (!page) + { + return nullptr; + } + + if (auto * scroll_area = findPageScrollArea (page)) + { + return scroll_area; + } + + auto * content_layout = page->layout (); + if (!content_layout) + { + return nullptr; + } + + auto * content = createContent (page); + content->setLayout (content_layout); + content_layout->setSizeConstraint (QLayout::SetMinAndMaxSize); + + auto * scroll_area = createScrollArea (page, content); + + auto * page_layout = new QVBoxLayout {page}; + page_layout->setContentsMargins (0, 0, 0, 0); + page_layout->setSpacing (0); + page_layout->addWidget (scroll_area); + + return scroll_area; + } + + void keepOneTableRowVisible (QTableView * table) + { + if (!table) + { + return; + } + + auto const header_height = table->horizontalHeader ()->sizeHint ().height (); + auto const row_height = table->fontMetrics ().height () + 4; + table->setMinimumHeight (header_height + row_height + 2 * table->frameWidth ()); + } + + void forwardWheelEvents (QWidget * source, QScrollArea * target) + { + if (!source || !target || source->property (wheel_forwarder_marker).toBool ()) + { + return; + } + + source->setProperty (wheel_forwarder_marker, true); + new WheelEventForwarder {source, target}; + } +} + +void SettingsDialogLayout::install (Ui::configuration_dialog const& ui) +{ + for (auto * page : { + ui.general_tab, + ui.radio_tab, + ui.audio_tab, + ui.reporting_tab, + ui.colors_tab, + ui.advanced_tab, + ui.alerts_tab, + ui.filters_tab, + }) + { + installPageScrollArea (page); + } + + keepOneTableRowVisible (ui.frequencies_table_view); + keepOneTableRowVisible (ui.stations_table_view); + forwardWheelEvents (ui.highlighting_list_view->viewport (), + findPageScrollArea (ui.colors_tab)); + ui.configuration_tabs->tabBar ()->setUsesScrollButtons (true); +} + +QScrollArea * SettingsDialogLayout::pageScrollArea (QWidget * page) +{ + return findPageScrollArea (page); +} + +QSize SettingsDialogLayout::preferredWindowSize (QDialog& dialog, + Ui::configuration_dialog const& ui) +{ + dialog.ensurePolished (); + dialog.layout ()->activate (); + auto required_size = dialog.sizeHint (); + auto * selected_page = ui.configuration_tabs->currentWidget (); + int tallest_page = 0; + int next_tallest_page = 0; + + for (auto * page : { + ui.general_tab, + ui.radio_tab, + ui.audio_tab, + ui.reporting_tab, + ui.colors_tab, + ui.advanced_tab, + ui.alerts_tab, + ui.filters_tab, + }) + { + ui.configuration_tabs->setCurrentWidget (page); + dialog.layout ()->activate (); + auto * scroll_area = findPageScrollArea (page); + auto const chrome_size = dialog.size () - scroll_area->viewport ()->size (); + auto const page_size = scroll_area->widget ()->minimumSizeHint () + chrome_size; + required_size.setWidth (qMax (required_size.width (), + page_size.width () + + scroll_area->verticalScrollBar ()->sizeHint ().width ())); + if (page_size.height () > tallest_page) + { + next_tallest_page = tallest_page; + tallest_page = page_size.height (); + } + else + { + next_tallest_page = qMax (next_tallest_page, page_size.height ()); + } + } + + ui.configuration_tabs->setCurrentWidget (selected_page); + // The tallest page can scroll without making every other tab waste that height. + required_size.setHeight (qMax (required_size.height (), next_tallest_page)); + return required_size; +} + +QSize SettingsDialogLayout::boundedWindowSize (QSize requested, QSize available, + QMargins frame_margins) +{ + available.rwidth () -= frame_margins.left () + frame_margins.right (); + available.rheight () -= frame_margins.top () + frame_margins.bottom (); + available.setWidth (qMax (1, available.width ())); + available.setHeight (qMax (1, available.height ())); + return requested.boundedTo (available); +} diff --git a/widgets/SettingsDialogLayout.hpp b/widgets/SettingsDialogLayout.hpp new file mode 100644 index 00000000..567875a5 --- /dev/null +++ b/widgets/SettingsDialogLayout.hpp @@ -0,0 +1,24 @@ +#ifndef SETTINGS_DIALOG_LAYOUT_HPP_ +#define SETTINGS_DIALOG_LAYOUT_HPP_ + +#include +#include + +class QScrollArea; +class QDialog; +class QWidget; + +namespace Ui +{ + class configuration_dialog; +} + +namespace SettingsDialogLayout +{ + void install (Ui::configuration_dialog const& ui); + QScrollArea * pageScrollArea (QWidget * page); + QSize preferredWindowSize (QDialog& dialog, Ui::configuration_dialog const& ui); + QSize boundedWindowSize (QSize requested, QSize available, QMargins frame_margins); +} + +#endif diff --git a/widgets/SpecOpLabel.cpp b/widgets/SpecOpLabel.cpp new file mode 100644 index 00000000..c869262e --- /dev/null +++ b/widgets/SpecOpLabel.cpp @@ -0,0 +1,27 @@ +#include "widgets/SpecOpLabel.h" + +#include + +namespace SpecOpLabel +{ + QString label (SpecialOperatingActivity specialOperation, bool ncccSprint, bool superFox) + { + if (SpecialOperatingActivity::FOX == specialOperation) { + return superFox ? QCoreApplication::translate("MainWindow", "Super Fox") + : QCoreApplication::translate("MainWindow", "Fox"); + } + if (SpecialOperatingActivity::HOUND == specialOperation) { + return superFox ? QCoreApplication::translate("MainWindow", "Super Hound") + : QCoreApplication::translate("MainWindow", "Hound"); + } + if (SpecialOperatingActivity::NA_VHF == specialOperation && ncccSprint) return "NCCC Sprint"; + if (SpecialOperatingActivity::NA_VHF == specialOperation) return "NA VHF"; + if (SpecialOperatingActivity::EU_VHF == specialOperation) return "EU VHF"; + if (SpecialOperatingActivity::FIELD_DAY == specialOperation) return "Field Day"; + if (SpecialOperatingActivity::RTTY == specialOperation) return "FT RU"; + if (SpecialOperatingActivity::WW_DIGI == specialOperation) return "WW Digi"; + if (SpecialOperatingActivity::ARRL_DIGI == specialOperation) return "ARRL Digi"; + if (SpecialOperatingActivity::Q65_PILEUP == specialOperation) return "Q65 Pileup"; + return {}; + } +} diff --git a/widgets/SpecOpLabel.h b/widgets/SpecOpLabel.h new file mode 100644 index 00000000..9777e778 --- /dev/null +++ b/widgets/SpecOpLabel.h @@ -0,0 +1,13 @@ +#ifndef SPECOPLABEL_H +#define SPECOPLABEL_H + +#include + +#include "SpecialOperatingActivity.hpp" + +namespace SpecOpLabel +{ + QString label (SpecialOperatingActivity specialOperation, bool ncccSprint, bool superFox = false); +} + +#endif diff --git a/widgets/SplashScreen.cpp b/widgets/SplashScreen.cpp index 827153dc..365fbafa 100644 --- a/widgets/SplashScreen.cpp +++ b/widgets/SplashScreen.cpp @@ -4,6 +4,8 @@ #include #include #include +#include +#include #include "revision_utils.hpp" #include "pimpl_impl.hpp" @@ -28,7 +30,24 @@ SplashScreen::SplashScreen () : QSplashScreen {QPixmap {":/splash.png"}, Qt::WindowStaysOnTopHint} { setLayout (&m_->main_layout_); - showMessage ("

" + QString {"WSJT-X v" + + + setObjectName ("SplashScreen"); + setWindowTitle (QCoreApplication::translate ("SplashScreen", "WSJT-X™ — Welcome")); + setAccessibleName (windowTitle ()); + setAccessibleDescription ( + QCoreApplication::translate ("SplashScreen", + "WSJT-X startup information. Press Escape to close.")); + m_->checkbox_.setObjectName ("doNotShowSplashAgain"); + m_->checkbox_.setAccessibleName (m_->checkbox_.text ()); + + // A QSplashScreen is a non-activating window and never becomes the key + // window, so a key press event override would never fire. Filter the + // application instead so Escape dismisses the splash regardless of which + // window holds focus, giving keyboard and assistive-tech users a dismiss + // path that the mouse-only click-to-dismiss does not. + QCoreApplication::instance ()->installEventFilter (this); + + showMessage ("

" + QString {"WSJT-X™ v" + QCoreApplication::applicationVersion() + " " + revision ()}.simplified () + "

" "Send issue reports to https://wsjtx.groups.io, and be sure to save .wav
" @@ -44,3 +63,14 @@ SplashScreen::SplashScreen () SplashScreen::~SplashScreen () { } + +bool SplashScreen::eventFilter (QObject * object, QEvent * event) +{ + if (isVisible () && QEvent::KeyPress == event->type () + && Qt::Key_Escape == static_cast (event)->key ()) + { + close (); + return true; + } + return QSplashScreen::eventFilter (object, event); +} diff --git a/widgets/SplashScreen.hpp b/widgets/SplashScreen.hpp index 2ec3238c..9c7e9771 100644 --- a/widgets/SplashScreen.hpp +++ b/widgets/SplashScreen.hpp @@ -5,6 +5,8 @@ #include "pimpl_h.hpp" +class QEvent; + class SplashScreen final : public QSplashScreen { @@ -16,6 +18,9 @@ public: Q_SIGNAL void disabled (); +protected: + bool eventFilter (QObject *, QEvent *) override; + private: class impl; pimpl m_; diff --git a/widgets/TxDriveSlider.cpp b/widgets/TxDriveSlider.cpp new file mode 100644 index 00000000..d568b89a --- /dev/null +++ b/widgets/TxDriveSlider.cpp @@ -0,0 +1,132 @@ +#include "TxDriveSlider.hpp" + +#include +#include +#include +#include + +namespace +{ + constexpr int minor_tick_interval = 50; +} + +TxDriveSlider::TxDriveSlider (QWidget * parent) + : QSlider {parent} +{ +#if defined(Q_OS_WIN) || defined(Q_OS_MACOS) + // One-sided ticks preserve the native ticked handle and matching hit geometry. + setTickPosition (QSlider::TicksRight); + setTickInterval (minor_tick_interval); +#endif +} + +QSize TxDriveSlider::sizeHint () const +{ + auto size = QSlider::sizeHint (); +#if !defined(Q_OS_WIN) && !defined(Q_OS_MACOS) + size.rwidth () += 12; +#endif + return size; +} + +QSize TxDriveSlider::minimumSizeHint () const +{ + auto size = QSlider::minimumSizeHint (); +#if !defined(Q_OS_WIN) && !defined(Q_OS_MACOS) + size.rwidth () += 12; +#endif + return size; +} + +void TxDriveSlider::paintEvent (QPaintEvent * event) +{ +#ifdef Q_OS_WIN + if (!property ("wsjtxDarkStyle").toBool ()) + { + QSlider::paintEvent (event); + return; + } +#endif + constexpr int major_tick_interval = 100; + if (orientation () != Qt::Vertical || maximum () <= minimum ()) + { + QSlider::paintEvent (event); + return; + } + + QStyleOptionSlider option; + initStyleOption (&option); + + auto const groove = style ()->subControlRect (QStyle::CC_Slider, &option, QStyle::SC_SliderGroove, this); +#if defined(Q_OS_WIN) || defined(Q_OS_MACOS) + // Style-reported handle endpoints keep painting aligned with interaction geometry. + auto endpoint = option; + endpoint.sliderPosition = endpoint.sliderValue = minimum (); + auto const minimum_y = style ()->subControlRect (QStyle::CC_Slider, &endpoint, QStyle::SC_SliderHandle, this).center ().y (); + endpoint.sliderPosition = endpoint.sliderValue = maximum (); + auto const maximum_y = style ()->subControlRect (QStyle::CC_Slider, &endpoint, QStyle::SC_SliderHandle, this).center ().y (); + auto const groove_top = qMin (minimum_y, maximum_y); + auto const span = qAbs (maximum_y - minimum_y); +#else + auto const handle = style ()->subControlRect (QStyle::CC_Slider, &option, QStyle::SC_SliderHandle, this); + auto const span = qMax (0, groove.height () - handle.height ()); + auto const groove_top = groove.top () + handle.height () / 2; +#endif + if (span == 0) + { + QSlider::paintEvent (event); + return; + } + + auto const groove_x = groove.center ().x (); + auto const groove_bottom = groove_top + span; + auto const tick_gap = 4; + + QPainter painter {this}; + + auto const palette_mid = palette ().color (QPalette::Mid); + // Some application styles use an accent color for Mid. This scale conveys + // attenuation positions, not a filled level, so retain its lightness while + // removing hue and saturation. + auto const neutral_mid = QColor::fromHsl (0, 0, palette_mid.lightness ()); + auto groove_color = neutral_mid; + groove_color.setAlpha (120); + painter.setRenderHint (QPainter::Antialiasing, true); + painter.setPen (QPen {groove_color, 3, Qt::SolidLine, Qt::RoundCap}); + painter.drawLine (groove_x, groove_top, groove_x, groove_bottom); + + auto tick_color = neutral_mid; + tick_color.setAlpha (190); + painter.setRenderHint (QPainter::Antialiasing, false); + painter.setPen (QPen {tick_color, 1}); + + for (auto value = minimum (); value <= maximum (); value += minor_tick_interval) + { + auto const position = QStyle::sliderPositionFromValue (minimum (), maximum (), value, span, option.upsideDown); + auto const y = groove_top + position; + auto const is_major_tick = value % major_tick_interval == 0; + auto const tick_length = is_major_tick ? 5 : 3; + painter.drawLine (groove_x - tick_gap - tick_length, y, groove_x - tick_gap, y); +#if !defined(Q_OS_WIN) && !defined(Q_OS_MACOS) + painter.drawLine (groove_x + tick_gap, y, groove_x + tick_gap + tick_length, y); +#endif + } + + option.subControls = QStyle::SC_SliderHandle; +#if !defined(Q_OS_MACOS) + // QStyleSheetStyle may paint its highlighted add/sub-page even when only the + // handle subcontrol is requested. Keep that painting inside the handle so it + // cannot cover the neutral attenuation scale. + auto const handle_rect = style ()->subControlRect ( + QStyle::CC_Slider, &option, QStyle::SC_SliderHandle, this); + painter.setClipRect (handle_rect, Qt::IntersectClip); +#else + if (property ("wsjtxDarkStyle").toBool ()) + { + auto const handle_rect = style ()->subControlRect ( + QStyle::CC_Slider, &option, QStyle::SC_SliderHandle, this); + painter.setClipRect (handle_rect, Qt::IntersectClip); + } +#endif + style ()->drawComplexControl (QStyle::CC_Slider, &option, &painter, this); +} diff --git a/widgets/TxDriveSlider.hpp b/widgets/TxDriveSlider.hpp new file mode 100644 index 00000000..73815f31 --- /dev/null +++ b/widgets/TxDriveSlider.hpp @@ -0,0 +1,21 @@ +// -*- Mode: C++ -*- +#ifndef TXDRIVESLIDER_HPP +#define TXDRIVESLIDER_HPP + +#include + +class TxDriveSlider final + : public QSlider +{ + Q_OBJECT + +public: + explicit TxDriveSlider (QWidget * parent = nullptr); + QSize sizeHint () const override; + QSize minimumSizeHint () const override; + +protected: + void paintEvent (QPaintEvent * event) override; +}; + +#endif // TXDRIVESLIDER_HPP diff --git a/widgets/WaterfallScale.hpp b/widgets/WaterfallScale.hpp new file mode 100644 index 00000000..99125d96 --- /dev/null +++ b/widgets/WaterfallScale.hpp @@ -0,0 +1,129 @@ +#ifndef WATERFALL_SCALE_HPP_ +#define WATERFALL_SCALE_HPP_ + +#include +#include + +#include +#include + +class WaterfallScale +{ +public: + struct GridLayout + { + int majorSpacingHz; + double pixelsPerDivision; + int overlayDivisionCount; + int scaleDivisionCount; + double firstMajorDivisionOffset; + int verticalGridOffsetPixels; + int minorDivisionCount; + QVector labels; + }; + + int width() const { return m_width; } + void setWidth(int width) { m_width = std::max(0, width); } + + int startHz() const { return m_startHz; } + void setStartHz(int startHz) { m_startHz = startHz; } + + int binsPerPixel() const { return m_binsPerPixel; } + void setBinsPerPixel(int binsPerPixel) + { + m_binsPerPixel = std::max(1, binsPerPixel); + } + + double fftBinWidthHz() const { return m_fftBinWidthHz; } + void setFftBinWidthHz(double fftBinWidthHz) + { + m_fftBinWidthHz = fftBinWidthHz; + } + + double hzPerPixel() const + { + return m_binsPerPixel * m_fftBinWidthHz; + } + + float spanHz() const + { + return float(m_width * hzPerPixel()); + } + + int xFromFreqHz(float frequencyHz) const + { + auto const span = spanHz(); + if(!(span > 0.0f)) return 0; + + int x = int(m_width * (frequencyHz - m_startHz) / span + 0.5); + if(x < 0) return 0; + if(x > m_width) return m_width; + return x; + } + + float freqHzFromX(int x) const + { + return float(m_startHz + x * m_binsPerPixel * m_fftBinWidthHz); + } + + int maxFreqHz() const + { + return freqHzFromX(xFromFreqHz(5000.0f)); + } + + GridLayout gridLayout() const + { + auto const span = spanHz(); + int majorSpacingHz = 10; + if(span > 100) majorSpacingHz = 20; + if(span > 250) majorSpacingHz = 50; + if(span > 500) majorSpacingHz = 100; + if(span > 1000) majorSpacingHz = 200; + if(span > 2500) majorSpacingHz = 500; + + double const pixelsPerDivision = majorSpacingHz / hzPerPixel(); + int const scaleDivisionCount = divisionCount( + m_width * hzPerPixel() / majorSpacingHz); + int const overlayDivisionCount = scaleDivisionCount + 1; + + double startDivision = double(m_startHz) / majorSpacingHz; + startDivision -= int(startDivision); + int const verticalGridOffsetPixels = + startDivision * pixelsPerDivision + 0.5; + + int labelFrequency = + (m_startHz + majorSpacingHz - 1) / majorSpacingHz; + labelFrequency *= majorSpacingHz; + double const firstMajorDivisionOffset = + double(labelFrequency - m_startHz) / majorSpacingHz; + + QVector labels(scaleDivisionCount + 1); + for(int i = 0; i <= scaleDivisionCount; ++i) { + labels[i].setNum(labelFrequency); + labelFrequency += majorSpacingHz; + } + + return {majorSpacingHz, + pixelsPerDivision, + overlayDivisionCount, + scaleDivisionCount, + firstMajorDivisionOffset, + verticalGridOffsetPixels, + majorSpacingHz == 200 ? 4 : 5, + labels}; + } + +private: + static int divisionCount(double divisions) + { + constexpr double tolerance = 0.0001; + return int(std::ceil(divisions - tolerance)); + } + + int m_width {0}; + int m_startHz {0}; + int m_binsPerPixel {1}; + double m_fftBinWidthHz {1500.0 / 2048.0}; +}; + +#endif diff --git a/widgets/about.cpp b/widgets/about.cpp index 85366124..adf3ab91 100644 --- a/widgets/about.cpp +++ b/widgets/about.cpp @@ -13,23 +13,24 @@ CAboutDlg::CAboutDlg(QWidget *parent) : { ui->setupUi(this); - ui->labelTxt->setText ("

" + QString {"WSJT-X v" + ui->labelTxt->setText ("

" + QString {"WSJT-X™ v" + QCoreApplication::applicationVersion () - + " " + display_revision ()}.simplified () + "
" + + " " + display_revision ()}.simplified () + "

" - "WSJT-X implements a number of digital modes designed for
" + "WSJT-X™ implements a number of digital modes designed for
" "weak-signal Amateur Radio communication.

" "© 2001-2026 by Joe Taylor, K1JT, Bill Somerville, G4WJS,
" "Steve Franke, K9AN, Nico Palermo, IV3NWV,
" "Uwe Risse, DG2YCB, Brian Moran, N9ADG,
" "Roger Rehr, W3SZ, John Nelson, G4KLA,
" - "Charlie Suckling, DL3WDG, and Terrell Deppe, KJ5HST

" + "Charlie Suckling, DL3WDG, Terrell Deppe, KJ5HST,
" + "and David Christle, KD0BTO

" "We gratefully acknowledge contributions from AC6SL, AE4JY,
" "DF2ET, DJ0OT, DL3WDG, EA4AC, G4KLA, IW3RAB, JA7UDE,
" "K3WYC, KA1GT, KA6MAL, KA9Q, KB1ZMX, KD6EKQ, KG4IYS, KI7MT,
" "KK1D, ND0B, PY1ZRJ, PY2SDR, VE1SKY, VK3ACF, VK4BDJ,
" "VK7MO, VR2UPU, W3DJS, W4TI, W4TV, and W9MDB.

" - "WSJT-X is licensed under the terms of Version 3
" + "WSJT-X™ is licensed under the terms of Version 3
" "of the GNU General Public License (GPL)

" "
" "" diff --git a/widgets/about.ui b/widgets/about.ui index 84157c4d..47b19451 100644 --- a/widgets/about.ui +++ b/widgets/about.ui @@ -6,7 +6,7 @@ Qt::NonModal - About WSJT-X + About WSJT-X™ diff --git a/widgets/activeStations.cpp b/widgets/activeStations.cpp index 067d36b5..8d7946bb 100644 --- a/widgets/activeStations.cpp +++ b/widgets/activeStations.cpp @@ -22,7 +22,7 @@ ActiveStations::ActiveStations(QSettings * settings, QFont const& font, QWidget ui->RecentStationsPlainTextEdit->setReadOnly (true); changeFont (font); read_settings (); - ui->header_label2->setText(" N Call Grid Az S/N Freq Tx Age Pts"); + setupUi(DisplayMode::Standard); connect(ui->cbReadyOnly, SIGNAL(toggled(bool)), this, SLOT(on_cbReadyOnly_toggled(bool))); connect(ui->cbWantedOnly, SIGNAL(toggled(bool)), this, SLOT(on_cbWantedOnly_toggled(bool))); connect(ui->RecentStationsPlainTextEdit, SIGNAL(cursorPositionChanged()), this, SLOT(on_textEdit_clicked())); @@ -57,7 +57,7 @@ void ActiveStations::addLine(QString line) { m_textbuffer.append(i.value()); ++i; } - this->displayRecentStations(m_mode, m_textbuffer); + this->displayRecentStations(m_displayMode, m_textbuffer); } void ActiveStations::read_settings () @@ -67,7 +67,7 @@ void ActiveStations::read_settings () ui->sbMaxRecent->setValue(settings_->value("MaxRecent",10).toInt()); ui->sbMaxAge->setValue(settings_->value("MaxAge",10).toInt()); ui->cbReadyOnly->setChecked(settings_->value("ReadyOnly",false).toBool()); - ui->cbWantedOnly->setChecked(settings_->value("# WantedOnly",false).toBool()); + ui->cbWantedOnly->setChecked(settings_->value("WantedOnly",false).toBool()); } void ActiveStations::write_settings () @@ -80,44 +80,39 @@ void ActiveStations::write_settings () settings_->setValue("WantedOnly",ui->cbWantedOnly->isChecked()); } -void ActiveStations::setupUi(QString mode) { - if(mode!=m_mode) { - m_mode=mode; - ui->cbReadyOnly->setText(" Ready only"); - if(m_mode=="Q65") { - ui->header_label2->setText(" N Frx Fsked S/N Q65 Call Grid Tx Age"); - ui->label->setText("QSOs:"); - ui->cbReadyOnly->setText("* CQ only"); - } else if(m_mode=="Q65-pileup") { - ui->header_label2->setText(" N Freq Call Grid El Age(h)"); - ui->cbWantedOnly->setText(QCoreApplication::translate("ActiveStations", "Wanted only", nullptr)); - } else if(m_mode=="Fox Mode" || m_mode=="SuperFox Mode" ) { - ui->header_label2->setText(" UTC dB DT Freq " + tr("Message")); - ui->cbWantedOnly->setText(QCoreApplication::translate("ActiveStations", "My call only", nullptr)); - this->setClickOK(true); - } else { - ui->header_label2->setText(" N Call Grid Az S/N Freq Tx Age Pts"); - ui->label->setText("Rate:"); - ui->cbWantedOnly->setText(QCoreApplication::translate("ActiveStations", "Wanted only", nullptr)); - } - bool b=(m_mode.left(3)=="Q65"); - bool is_fox_mode =(m_mode=="Fox Mode"); - ui->bandChanges->setVisible(!b && !is_fox_mode); - ui->cbReadyOnly->setVisible(m_mode != "Q65-pileup" && !is_fox_mode); - ui->cbWantedOnly->setVisible(m_mode != "Q65-pileup"); // this is used for "My call only" in Fox mode - ui->label_2->setVisible(!b && !is_fox_mode); - ui->label_3->setVisible(!b && !is_fox_mode); - ui->score->setVisible(!b && !is_fox_mode); - ui->sbMaxRecent->setVisible(!b && !is_fox_mode); - - b=(m_mode!="Q65-pileup" && !is_fox_mode); - ui->sbMaxAge->setVisible(b); - ui->label->setVisible(b); - ui->rate->setVisible(b); +void ActiveStations::setupUi(DisplayMode mode) { + if (mode != m_displayMode && mode == DisplayMode::Fox) setClickOK(true); + m_displayMode=mode; + ui->cbReadyOnly->setText(" Ready only"); + ui->cbWantedOnly->setText(tr("# Wanted only")); + ui->label->setText("Rate:"); + if(mode==DisplayMode::Q65) { + ui->header_label2->setText(" N Frx Fsked S/N Q65 Call Grid Tx Age"); + ui->label->setText("QSOs:"); + ui->cbReadyOnly->setText("* CQ only"); + } else if(mode==DisplayMode::Q65Pileup) { + ui->header_label2->setText(" N Freq Call Grid El Age(h)"); + } else if(mode==DisplayMode::Fox) { + ui->header_label2->setText(" UTC dB DT Freq " + tr("Message")); + ui->cbWantedOnly->setText(tr("My call only")); + } else { + ui->header_label2->setText(" N Call Grid Az S/N Freq Tx Age Pts"); } -} - -void ActiveStations::displayRecentStations(QString mode, QString const& t) + bool const standard = mode == DisplayMode::Standard; + bool const numbered = standard || mode == DisplayMode::Q65; + ui->bandChanges->setVisible(standard); + ui->cbReadyOnly->setVisible(numbered); + ui->cbWantedOnly->setVisible(mode != DisplayMode::Q65Pileup); + ui->label_2->setVisible(standard); + ui->label_3->setVisible(standard); + ui->score->setVisible(standard); + ui->sbMaxRecent->setVisible(standard); + ui->sbMaxAge->setVisible(numbered); + ui->label->setVisible(numbered); + ui->rate->setVisible(numbered); +} + +void ActiveStations::displayRecentStations(DisplayMode mode, QString const& t) { setupUi(mode); @@ -181,7 +176,7 @@ void ActiveStations::on_textEdit_clicked() if(text!="") { int nline=text.left(2).toInt(); if(QGuiApplication::keyboardModifiers().testFlag(Qt::ControlModifier)) nline=-nline; - if ("Fox Mode" != m_mode && "SuperFox Mode" != m_mode) + if (DisplayMode::Fox != m_displayMode) emit callSandP(nline); else emit queueActiveWindowHound(text); diff --git a/widgets/activeStations.h b/widgets/activeStations.h index 60cdc700..6e3cd53c 100644 --- a/widgets/activeStations.h +++ b/widgets/activeStations.h @@ -18,10 +18,12 @@ class ActiveStations Q_OBJECT public: + enum class DisplayMode { Standard, Q65, Q65Pileup, Fox }; + explicit ActiveStations(QSettings *, QFont const&, QWidget * parent = 0); ~ActiveStations(); - void displayRecentStations(QString mode, QString const&); - void setupUi(QString display_mode); + void displayRecentStations(DisplayMode, QString const&); + void setupUi(DisplayMode); void changeFont (QFont const&); int maxRecent(); int maxAge(); @@ -51,7 +53,7 @@ private: Q_SLOT void on_cbWantedOnly_toggled(bool b); Q_SLOT void on_textEdit_clicked(); - QString m_mode=""; + DisplayMode m_displayMode = DisplayMode::Standard; QSettings * settings_; QString m_textbuffer=""; // F/H mode band decodes QMap m_decodes_by_frequency; // store decodes for F/H band awareness by frequency diff --git a/widgets/astro.cpp b/widgets/astro.cpp index c96eee6e..dcdbac44 100644 --- a/widgets/astro.cpp +++ b/widgets/astro.cpp @@ -1,7 +1,5 @@ #include "astro.h" -#include - #include #include #include @@ -13,8 +11,6 @@ #include #include -#include "commons.h" -#include "MessageBox.hpp" #include "Configuration.hpp" #include "SettingsGroup.hpp" #include "qt_helpers.hpp" @@ -32,7 +28,15 @@ extern "C" { int * ndop, int * ndop00, double * ramoon, double * decmoon, double * dgrd, double * poloffset, double * xnr, bool extraazel, double * techo, double * width1, double * width2, bool bTx, const char * AzElFileName, - const char * jpleph); + const char * jpleph, int * ephemeris_result); +} + +namespace +{ + constexpr int ephemeris_jpl = 0; + constexpr int ephemeris_analytic_fallback = 1; + constexpr int ephemeris_invalid_input = 2; + constexpr int ephemeris_unavailable = 3; } Astro::Astro(QSettings * settings, Configuration const * configuration, QWidget * parent) @@ -110,7 +114,7 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const Frequency freq_moon {freq}; double azsun,elsun,azmoon,elmoon,azmoondx,elmoondx; double ramoon,decmoon,dgrd,poloffset,xnr,techo,width1,width2; - int ntsky; + int ntsky, ephemeris_result; QString date {t.date().toString("yyyy MMM dd").trimmed ()}; QString utc {t.time().toString().trimmed ()}; int nyear {t.date().year()}; @@ -125,15 +129,56 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const auto const& jpleph = configuration_->data_dir ().absoluteFilePath ("JPLEPH"); SettingsGroup g (settings_, "Configuration"); bool extraazel=settings_->value("AzElExtraLines",false).toBool(); + + // changed argument from &dgrd to &m_dgrd added for Bob KA1GT astrosub(nyear, month, nday, uth, static_cast (freq_moon), mygrid.toLatin1 ().data (), hisgrid.toLatin1().data(), &azsun, &elsun, &azmoon, &elmoon, &azmoondx, &elmoondx, &ntsky, &m_dop, &m_dop00, &ramoon, &decmoon, - &dgrd, &poloffset, &xnr, extraazel, &techo, &width1, &width2, + &m_dgrd, &poloffset, &xnr, extraazel, &techo, &width1, &width2, bTx, AzElFileName.toLocal8Bit ().constData (), - jpleph.toLocal8Bit ().constData ()); + jpleph.toLocal8Bit ().constData (), &ephemeris_result); + + auto report_ephemeris_transition = [this] (int result) + { + if (result == m_ephemeris_result) + { + return; + } + if (result == ephemeris_analytic_fallback) + { + qWarning () << "JPL ephemeris unavailable; using analytic fallback"; + } + else if (result == ephemeris_invalid_input) + { + qWarning () << "Invalid astronomical date or time"; + } + else if (result == ephemeris_unavailable) + { + qWarning () << "No valid lunar ephemeris result"; + } + else if (result == ephemeris_jpl && m_ephemeris_result >= 0) + { + qInfo () << "JPL ephemeris available again"; + } + m_ephemeris_result = result; + }; + + report_ephemeris_transition (ephemeris_result); + if (ephemeris_result == ephemeris_invalid_input) + { + ui_->text_label->setText (" " + date + "\nUTC: " + utc + + "\nEphem: Invalid input"); + return {}; + } + if (ephemeris_result == ephemeris_unavailable) + { + ui_->text_label->setText (" " + date + "\nUTC: " + utc + + "\nEphem: Unavailable"); + return {}; + } QString message; { @@ -162,12 +207,16 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const "SunAz: " << azsun << "\n" "SunEl: " << elsun << "\n" "Freq: " << freq / 1.e6 << "\n"; + if (ephemeris_result == ephemeris_analytic_fallback) + { + out << "Ephem: Analytic fallback\n"; + } if(freq>=5000000ull) { //Suppress data not relevant below VHF out << "Tsky: " << ntsky << "\n" "Dpol: " << poloffset << "\n" "MNR: " << xnr << "\n" "Dist: " << int((techo*149896)) << "\n" //wdg - "Dgrd: " << dgrd; + "Dgrd: " << m_dgrd; //changed dgrd to m_dgrd added for Bob KA1GT } } ui_->text_label->setText(message); @@ -265,7 +314,14 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const &dgrd, &poloffset, &xnr, extraazel, &techo, &width1, &width2, bTx, nullptr, // don't overwrite azel.dat - jpleph.toLocal8Bit ().constData ()); + jpleph.toLocal8Bit ().constData (), &ephemeris_result); + + report_ephemeris_transition (ephemeris_result); + if (ephemeris_result == ephemeris_invalid_input + || ephemeris_result == ephemeris_unavailable) + { + return {}; + } FrequencyDelta offset {0}; switch (m_DopplerMethod) @@ -303,6 +359,12 @@ auto Astro::astroUpdate(QDateTime const& t, QString const& mygrid, QString const return correction; } +//added for Bob KA1GT +double Astro::getDgrd() const +{ + return m_dgrd; +} + void Astro::check_split () { /* TEMPORARILY DISABLE diff --git a/widgets/astro.h b/widgets/astro.h index f9d09154..e8caf79e 100644 --- a/widgets/astro.h +++ b/widgets/astro.h @@ -26,7 +26,8 @@ public: explicit Astro(QSettings * settings, Configuration const *, QWidget * parent = nullptr); ~Astro (); - + double getDgrd() const; // added for Bob KA1GT + struct Correction { Correction () @@ -99,13 +100,15 @@ private: Configuration const * configuration_; QScopedPointer ui_; - double m_skedFreq; + double m_skedFreq {1296.065}; qint32 m_DopplerMethod; int m_dop; int m_dop00; + int m_ephemeris_result {-1}; int ibShift; //int m_dx_two_way_dop; bool astroStart = true; + double m_dgrd = 0.0; // added for Bob KA1GT }; inline diff --git a/widgets/displaytext.cpp b/widgets/displaytext.cpp index 5c8e4233..f4b4fcba 100644 --- a/widgets/displaytext.cpp +++ b/widgets/displaytext.cpp @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include "Configuration.hpp" #include "Decoder/decodedtext.h" @@ -44,14 +46,29 @@ bool play_ITUZ = false; bool play_ITUZOB = false; bool muted = false; +namespace +{ + QRegularExpression const message_73_regexp {"^(73|RR73)$"}; + QRegularExpression const grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"}; + // Trailing #? matches Q65's "copied last Tx" flag marker (e.g. "q3#"), + // appended after the usual AP-type/averaging-count qualifier. + QRegularExpression const ap_regexp {R"((?:\?\s)?(?:a[0-9]|q[0-9][0-9*]?#?)$)"}; +} + using SpecOp = Configuration::SpecialOperatingActivity; DisplayText::DisplayText(QWidget *parent) : QTextEdit(parent) , m_config {nullptr} , erase_action_ {new QAction {tr ("&Erase"), this}} + , pressed_button_ {Qt::NoButton} + , click_state_ {ClickState::None} , high_volume_ {false} + , sticky_scroll_enabled_ {false} + , following_live_activity_ {true} , modified_vertical_scrollbar_max_ {-1} + , return_to_live_button_ {new QToolButton {viewport ()}} + , live_scroll_position_ {0} { setReadOnly (true); setUndoRedoEnabled (false); @@ -70,6 +87,49 @@ DisplayText::DisplayText(QWidget *parent) delete menu; }); connect (erase_action_, &QAction::triggered, this, &DisplayText::erase); + + return_to_live_button_->setObjectName (QStringLiteral ("returnToLiveActivityButton")); + return_to_live_button_->setText (tr ("Return to live activity")); + return_to_live_button_->setToolButtonStyle (Qt::ToolButtonTextOnly); + return_to_live_button_->setAutoRaise (false); + return_to_live_button_->setFocusPolicy (Qt::StrongFocus); + return_to_live_button_->setCursor (Qt::ArrowCursor); + return_to_live_button_->setToolTip (tr ("Return to the live activity position")); + return_to_live_button_->setAccessibleDescription ( + tr ("Live activity is paused while earlier entries are visible.")); + return_to_live_button_->hide (); + connect (return_to_live_button_, &QToolButton::clicked, this, &DisplayText::scrollToLiveActivity); + connect (verticalScrollBar (), &QScrollBar::sliderMoved, this, &DisplayText::userScrolledTo); + connect (verticalScrollBar (), &QScrollBar::actionTriggered, this, [this] (int) { + userScrolledTo (verticalScrollBar ()->sliderPosition ()); + }); + connect (verticalScrollBar (), &QScrollBar::valueChanged, this, [this] (int) { + updateReturnToLiveButton (); + }); + connect (verticalScrollBar (), &QScrollBar::rangeChanged, this, &DisplayText::scrollRangeChanged); +} + +void DisplayText::set_configuration (Configuration const * configuration, bool high_volume) +{ + disconnect (vertical_scroll_connection_); + m_config = configuration; + high_volume_ = high_volume; + sticky_scroll_enabled_ = true; + following_live_activity_ = true; + live_scroll_position_ = verticalScrollBar ()->value (); + updateReturnToLiveButton (); +} + +void DisplayText::clear () +{ + if (click_state_ == ClickState::Captured) + { + click_state_ = ClickState::Canceled; + } + following_live_activity_ = true; + live_scroll_position_ = 0; + QTextEdit::clear (); + updateReturnToLiveButton (); } void DisplayText::erase () @@ -78,11 +138,95 @@ void DisplayText::erase () Q_EMIT erased (); } +bool DisplayText::decodesFromTop () const +{ + return high_volume_ && m_config && m_config->decodes_from_top (); +} + +void DisplayText::userScrolledTo (int position) +{ + if (sticky_scroll_enabled_) + { + following_live_activity_ = position == live_scroll_position_; + updateReturnToLiveButton (); + } +} + +void DisplayText::scrollRangeChanged (int minimum, int maximum) +{ + if (sticky_scroll_enabled_) + { + if (decodesFromTop ()) + { + live_scroll_position_ = qBound (minimum, live_scroll_position_, maximum); + } + else + { + live_scroll_position_ = maximum; + if (following_live_activity_) + { + verticalScrollBar ()->setValue (live_scroll_position_); + } + } + } + updateReturnToLiveButton (); +} + +void DisplayText::scrollToLiveActivity () +{ + auto * vertical_scroll_bar = verticalScrollBar (); + live_scroll_position_ = qBound (vertical_scroll_bar->minimum (), live_scroll_position_ + , vertical_scroll_bar->maximum ()); + following_live_activity_ = true; + vertical_scroll_bar->setValue (live_scroll_position_); + updateReturnToLiveButton (); +} + +void DisplayText::updateReturnToLiveButton () +{ + auto const * vertical_scroll_bar = verticalScrollBar (); + auto const hint = return_to_live_button_->sizeHint (); + auto const margin = 3; + auto const available_width = qMax (0, viewport ()->width () - 2 * margin); + auto const available_height = qMax (0, viewport ()->height () - 2 * margin); + auto const button_height = qMin (qMax (hint.height (), qMax (20, vertical_scroll_bar->sizeHint ().width ())) + , available_height); + auto const button_width = qMin (hint.width () + 8, available_width); + return_to_live_button_->resize (button_width, button_height); + return_to_live_button_->move (qMax (margin, viewport ()->width () - button_width - margin) + , qMax (margin, viewport ()->height () - button_height - margin)); + auto const wanted = sticky_scroll_enabled_ + && vertical_scroll_bar->maximum () > vertical_scroll_bar->minimum () + && !following_live_activity_ + && button_width > 0 + && button_height > 0; + if (wanted) + { + return_to_live_button_->raise (); + } + return_to_live_button_->setVisible (wanted); +} + +void DisplayText::resizeEvent (QResizeEvent * e) +{ + QTextEdit::resizeEvent (e); + updateReturnToLiveButton (); +} + void DisplayText::setContentFont(QFont const& font) { + auto const preserve_view = sticky_scroll_enabled_ && !following_live_activity_; + QTextCursor view_anchor; + int anchor_offset {0}; + if (preserve_view) + { + view_anchor = cursorForPosition (QPoint {1, 1}); + anchor_offset = cursorRect (view_anchor).top (); + } + char_font_ = font; - selectAll (); - auto cursor = textCursor (); + QTextCursor cursor {document ()}; + cursor.select (QTextCursor::Document); cursor.beginEditBlock (); auto char_format = cursor.charFormat (); char_format.setFont (char_font_); @@ -95,16 +239,66 @@ void DisplayText::setContentFont(QFont const& font) cursor.movePosition (QTextCursor::StartOfLine); cursor.endEditBlock (); - if (!high_volume_ || !m_config || !m_config->decodes_from_top ()) + auto * vertical_scroll_bar = verticalScrollBar (); + if (!sticky_scroll_enabled_ || following_live_activity_) { - setTextCursor (cursor); - ensureCursorVisible (); + if (!decodesFromTop ()) + { + setTextCursor (cursor); + ensureCursorVisible (); + } + if (sticky_scroll_enabled_) + { + live_scroll_position_ = vertical_scroll_bar->value (); + } + } + else + { + vertical_scroll_bar->setValue (vertical_scroll_bar->value () + + cursorRect (view_anchor).top () - anchor_offset); + if (!decodesFromTop ()) + { + live_scroll_position_ = vertical_scroll_bar->maximum (); + } } + updateReturnToLiveButton (); +} + +void DisplayText::captureClick (QMouseEvent const * event) +{ + auto cursor = cursorForPosition (event->pos ()); + pressed_line_ = cursor.block ().text (); + cursor.select (QTextCursor::WordUnderCursor); + pressed_word_ = cursor.selectedText (); + pressed_button_ = event->button (); + click_state_ = ClickState::Captured; } -void DisplayText::mouseDoubleClickEvent(QMouseEvent *e) +void DisplayText::mousePressEvent (QMouseEvent * event) { - Q_EMIT selectCallsign(e->modifiers ()); + captureClick (event); + QTextEdit::mousePressEvent (event); +} + +void DisplayText::mouseDoubleClickEvent (QMouseEvent * event) +{ + if (click_state_ == ClickState::Canceled) + { + pressed_button_ = Qt::NoButton; + click_state_ = ClickState::None; + return; + } + + if (click_state_ == ClickState::None || pressed_button_ != event->button ()) + { + captureClick (event); + } + + auto const line = pressed_line_; + auto const word = pressed_word_; + pressed_button_ = Qt::NoButton; + click_state_ = ClickState::None; + Q_EMIT selectCallsign (line, word, event->modifiers ()); } void DisplayText::insertLineSpacer(QString const& line) @@ -149,6 +343,15 @@ namespace void DisplayText::insertText(QString const& text, QColor bg, QColor fg , QString const& call1, QString const& call2, QTextCursor::MoveOperation location) { + auto const preserve_view = sticky_scroll_enabled_ && !following_live_activity_; + QTextCursor view_anchor; + int anchor_offset {0}; + if (preserve_view) + { + view_anchor = cursorForPosition (QPoint {1, 1}); + anchor_offset = cursorRect (view_anchor).top (); + } + auto cursor = textCursor (); cursor.movePosition (location); auto block_format = cursor.blockFormat (); @@ -225,12 +428,31 @@ void DisplayText::insertText(QString const& text, QColor bg, QColor fg // position so viewport scrolled to left cursor.movePosition (QTextCursor::StartOfLine); - if (!high_volume_ || !m_config || !m_config->decodes_from_top ()) + if ((!sticky_scroll_enabled_ || following_live_activity_) && !decodesFromTop ()) { setTextCursor (cursor); ensureCursorVisible (); } document ()->setMaximumBlockCount (document ()->maximumBlockCount ()); + auto * vertical_scroll_bar = verticalScrollBar (); + if (preserve_view) + { + vertical_scroll_bar->setValue (vertical_scroll_bar->value () + + cursorRect (view_anchor).top () - anchor_offset); + } + if (sticky_scroll_enabled_) + { + if (decodesFromTop ()) + { + live_scroll_position_ = qBound (vertical_scroll_bar->minimum (), live_scroll_position_ + , vertical_scroll_bar->maximum ()); + } + else + { + live_scroll_position_ = vertical_scroll_bar->maximum (); + } + } + updateReturnToLiveButton (); } void DisplayText::extend_vertical_scrollbar (int min, int max) @@ -252,6 +474,15 @@ void DisplayText::extend_vertical_scrollbar (int min, int max) void DisplayText::new_period () { + auto const preserve_view = sticky_scroll_enabled_ && !following_live_activity_; + QTextCursor view_anchor; + int anchor_offset {0}; + if (preserve_view) + { + view_anchor = cursorForPosition (QPoint {0, 0}); + anchor_offset = cursorRect (view_anchor).top (); + } + if (m_config->decodes_from_top ()) { document ()->setMaximumBlockCount (4800); document ()->setMaximumBlockCount (5000); @@ -275,13 +506,31 @@ void DisplayText::new_period () extend_vertical_scrollbar (min, max ); }); } - verticalScrollBar ()->setSliderPosition (verticalScrollBar ()->maximum ()); + auto * vertical_scroll_bar = verticalScrollBar (); + if (sticky_scroll_enabled_) + { + live_scroll_position_ = vertical_scroll_bar->maximum (); + } + if (!sticky_scroll_enabled_ || following_live_activity_) + { + vertical_scroll_bar->setSliderPosition (vertical_scroll_bar->maximum ()); + if (sticky_scroll_enabled_) + { + live_scroll_position_ = vertical_scroll_bar->value (); + } + } + else + { + vertical_scroll_bar->setValue (vertical_scroll_bar->value () + + cursorRect (view_anchor).top () - anchor_offset); + } + updateReturnToLiveButton (); } QString DisplayText::appendWorkedB4 (QString message, QString call, QString const& grid, QColor * bg, QColor * fg, LogBook const& logBook, QString const& currentBand, QString const& currentMode, - QString extra) + QString extra, QString const& state, bool entityMismatch) { QString countryName; bool callB4; @@ -413,30 +662,25 @@ QString DisplayText::appendWorkedB4 (QString message, QString call, QString cons { extra += looked_up.primary_prefix; } + else if (!state.isEmpty () || entityMismatch) + { + // A grid-derived U.S. state overrides the callsign's own DXCC + // entity name here: KL7YY operating from DM78 should be shown + // with "U.S.A." (matching the state that follows when GridMap() + // is on), not "Alaska" -- the entity his callsign happens to be + // licensed under, not where he's actually transmitting from. + // entityMismatch catches this even with GridMap() off (no state + // code follows, but the entity name itself still shouldn't lie); + // state alone catches it whenever GridMap() is on, including the + // case where the call genuinely is in its home entity (KL7UW + // really in Alaska still reads "U.S.A. AK", not "Alaska AK"). + // Worked-before/DXCC credit above is unaffected; this only + // changes what's shown. + extra += "U.S.A."; + } else { - auto countryName = looked_up.entity_name; - - // do some obvious abbreviations - countryName.replace ("Islands", "Is."); - countryName.replace ("Island", "Is."); - countryName.replace ("North ", "N. "); - countryName.replace ("Northern ", "N. "); - countryName.replace ("South ", "S. "); - countryName.replace ("East ", "E. "); - countryName.replace ("Eastern ", "E. "); - countryName.replace ("West ", "W. "); - countryName.replace ("Western ", "W. "); - countryName.replace ("Central ", "C. "); - countryName.replace (" and ", " & "); - countryName.replace ("Republic", "Rep."); - countryName.replace ("United States of America", "U.S.A."); - countryName.replace ("United States", "U.S.A."); - countryName.replace ("Fed. Rep. of ", ""); - countryName.replace ("French ", "Fr."); - countryName.replace ("Asiatic", "AS"); - countryName.replace ("European", "EU"); - countryName.replace ("African", "AF"); + auto countryName = looked_up.abbreviated_entity_name; // assign WAE entities to the correct DXCC when "Include extra WAE entities" is not selected if (!(m_config->include_WAE_entities())) { @@ -448,7 +692,6 @@ QString DisplayText::appendWorkedB4 (QString message, QString call, QString cons countryName.replace ("AF Turkey", "Turkey"); countryName.replace ("EU Turkey", "Turkey"); } - extra += countryName; } } @@ -483,7 +726,7 @@ QString DisplayText::leftJustifyAppendage (QString message, QString const& appen return message; } -void DisplayText::displayDecodedText(DecodedText const& decodedText, QString const& myCall, +bool DisplayText::displayDecodedText(DecodedText const& decodedText, QString const& myCall, QString const& mode, bool displayDXCCEntity, LogBook const& logBook, QString const& currentBand, bool ppfx, bool bCQonly, @@ -497,7 +740,7 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con QColor bg; QColor fg; bool CQcall = false; - auto is_73 = decodedText.messageWords().filter (QRegularExpression {"^(73|RR73)$"}).size(); + auto is_73 = decodedText.messageWords().filter (message_73_regexp).size(); if (decodedText.string ().contains (" CQ ")) { if (m_config->alert_CQ()) { if (!muted) play_CQ = true; @@ -512,24 +755,66 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con } else { - if (bCQonly) return; + if (bCQonly) return false; } auto message = decodedText.string(); QString dxCall; QString dxGrid; decodedText.deCallAndGrid (/*out*/ dxCall, dxGrid); - QRegularExpression grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"}; if(!dxGrid.contains(grid_regexp)) dxGrid=""; message = message.left (message.indexOf (QChar::Nbsp)).trimmed (); // strip appended info QString extra; - QString state; // NJ0A + QString state; // NJ0A -- populated only when GridMap() is enabled; drives + // both the entity-name override below and the trailing + // state code appended at the end of this function. - if (displayDXCCEntity && dxGrid.length() > 0 && logBook.countries ()->lookup (dxCall).primary_prefix == "K") { - //std::cout << dxCall << " -> " << dxGrid << " " << logBook.countries ()->lookup (dxCall).primary_prefix <<"\n"; - if (m_config->GridMap()) { - if (CQcall || is_73 || m_config->GridMapAll()) { - state = logBook.countries ()->findState(dxGrid); - } + // K (contiguous US), KL (Alaska), KH6 (Hawaii), KH0 (Mariana Is.), + // KH2 (Guam), KH8 (American Samoa), KP2 (US Virgin Is.), KP4 (Puerto + // Rico), and KG4 (Guantanamo Bay) are all separate DXCC entities that + // license under the same K/N/W/A callsign blocks (e.g. a WP3 call + // resolves to the KP4 entity via lookup() below, same as KP4 itself). + // cty.dat already exact-matches ordinary stateside KG4-suffix calls back + // to primary_prefix "K", so primary_prefix "KG4" here only ever means a + // genuine Guantanamo Bay call. Any of these can genuinely be transmitting + // from one of the 50 states (e.g. KL7YY portable from Colorado, or KP4 + // portable from Nebraska), so all are eligible for grid-based state + // mapping, not just plain "K" calls. The remaining K/N/W/A-administered + // entities (Baker & Howland, Palmyra & Jarvis, Wake, Navassa, Desecheo, + // Swains, plus the deleted Johnston and Midway) are intentionally + // omitted: they have no resident ham population, so they're never + // genuinely "home" to a callsign the way the entities above are -- + // activations are DXpeditions using calls issued for the trip. + static QStringList const us_family_prefixes { + "K", "KL", "KH6", "KH0", "KH2", "KH8", "KP2", "KP4", "KG4"}; + // KL and KH6 are the only entities in that set with their own recognized + // "state" code in grid.dat (Alaska and Hawaii are modelled there like + // states). If a KL/KH6 call's grid resolves to exactly that code, the + // call really is where its callsign says -- no entity-name mismatch, even + // with GridMap() off. The other entities (KH0/KH2/KH8/KP2/KP4) have no + // such code, since their home territories aren't in grid.dat at all, + // so any resolved state for one of those always indicates the operator + // is actually transmitting from the mainland. + static QHash const home_state_for_entity { + {"KL", "AK"}, {"KH6", "HI"}}; + auto const& dxRecord = logBook.countries ()->lookup (dxCall); + bool const usFamilyEntity = us_family_prefixes.contains (dxRecord.primary_prefix); + + // entityMismatch answers "does this call's grid contradict its own DXCC + // entity" independently of GridMap()/GridMapAll(), so the entity-name + // choice below can be corrected (KL7YY operating from DM78 should not be + // labelled "Alaska") even when the operator hasn't enabled the separate + // "show the state code too" feature that state/GridMap() controls. + QString rawState; + bool entityMismatch = false; + if (dxGrid.length() > 0 && usFamilyEntity) { + rawState = logBook.countries ()->findState (dxGrid); + if (rawState == "**") rawState.clear (); + entityMismatch = !rawState.isEmpty () + && rawState != home_state_for_entity.value (dxRecord.primary_prefix); + } + if (dxGrid.length() > 0 && usFamilyEntity && m_config->GridMap()) { + if (CQcall || is_73 || m_config->GridMapAll()) { + state = rawState; } } //NJ0A @@ -538,7 +823,7 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con { extra += QString {"%1"}.arg (fSpread, 5, 'f', fSpread < 0.95 ? 3 : 2) + QChar {' '}; } - auto ap_pos = message.lastIndexOf (QRegularExpression {R"((?:\?\s)?(?:a[0-9]|q[0-9][0-9*]?)$)"}); + auto ap_pos = message.lastIndexOf (ap_regexp); if (ap_pos >= 0) { extra += message.mid (ap_pos) + QChar {' '}; @@ -554,7 +839,7 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con // preformated text line t1 auto currentMode = mode; message = appendWorkedB4 (message, dxCall, dxGrid, &bg, &fg - , logBook, currentBand, currentMode, extra); + , logBook, currentBand, currentMode, extra, state, entityMismatch); } else { @@ -572,32 +857,15 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con if (m_config->show_country_names()) { auto const& looked_up = logBook.countries ()->lookup (dxCall); - auto countryName = looked_up.entity_name; + auto countryName = looked_up.abbreviated_entity_name; if (m_bPrincipalPrefix) { extra += looked_up.primary_prefix; + } else if (!state.isEmpty () || entityMismatch) { + // Same reasoning as the CQ-line case above: a grid-derived + // U.S. state overrides the callsign's own DXCC entity name. + extra += "U.S.A."; } else { - // do some obvious abbreviations - countryName.replace ("Islands", "Is."); - countryName.replace ("Island", "Is."); - countryName.replace ("North ", "N. "); - countryName.replace ("Northern ", "N. "); - countryName.replace ("South ", "S. "); - countryName.replace ("East ", "E. "); - countryName.replace ("Eastern ", "E. "); - countryName.replace ("West ", "W. "); - countryName.replace ("Western ", "W. "); - countryName.replace ("Central ", "C. "); - countryName.replace (" and ", " & "); - countryName.replace ("Republic", "Rep."); - countryName.replace ("United States of America", "U.S.A."); - countryName.replace ("United States", "U.S.A."); - countryName.replace ("Fed. Rep. of ", ""); - countryName.replace ("French ", "Fr."); - countryName.replace ("Asiatic", "AS"); - countryName.replace ("European", "EU"); - countryName.replace ("African", "AF"); - // assign WAE entities to the correct DXCC when "Include extra WAE entities" is not selected if (!(m_config->include_WAE_entities())) { countryName.replace ("Bear Is.", "Svalbard"); @@ -694,6 +962,7 @@ void DisplayText::displayDecodedText(DecodedText const& decodedText, QString con } insertText (message.trimmed (), bg, fg, decodedText.call (), dxCall); + return true; } void DisplayText::displayTransmittedText(QString text, QString modeTx, qint32 txFreq, @@ -918,7 +1187,7 @@ void DisplayText::AudioAlerts() #ifdef WIN32 if(m_config->alert_Enabled()) { QAudioOutput info(QAudioDeviceInfo::defaultOutputDevice()); - QString audioPath = app_sounds_directory (m_config->voicesPath()); + QString audioPath = m_config->voice_directory ().absolutePath () + QChar {'/'}; QAudioFormat format; format.setCodec("audio/pcm"); format.setSampleRate (48000); @@ -930,8 +1199,9 @@ void DisplayText::AudioAlerts() connect(audio, SIGNAL(stateChanged(QAudio::State)), this, SLOT(handleStateChanged(QAudio::State))); #else if(m_config->alert_Enabled()) { - QString audioPath = app_sounds_directory (m_config->voicesPath()); + QString audioPath = m_config->voice_directory ().absolutePath () + QChar {'/'}; #endif +#ifdef WIN32 QFile *effect2 = new QFile(this); QFile *effect3 = new QFile(this); QFile *effect4 = new QFile(this); @@ -956,6 +1226,7 @@ void DisplayText::AudioAlerts() effect11->setFileName(QString("%1/%2").arg(audioPath, "Grid.wav")); effect12->setFileName(QString("%1/%2").arg(audioPath, "GridOnBand.wav")); effect13->setFileName(QString("%1/%2").arg(audioPath, "CQ.wav")); +#endif static int startIndex = 0; int nextStartIndex = startIndex +1; switch (startIndex) { diff --git a/widgets/displaytext.h b/widgets/displaytext.h index 26b3b2a8..8a948b6c 100644 --- a/widgets/displaytext.h +++ b/widgets/displaytext.h @@ -10,6 +10,8 @@ #include class QAction; +class QResizeEvent; +class QToolButton; class Configuration; class LogBook; class DecodedText; @@ -20,15 +22,11 @@ class DisplayText Q_OBJECT public: explicit DisplayText(QWidget *parent = nullptr); - void set_configuration (Configuration const * configuration, bool high_volume = false) - { - disconnect (vertical_scroll_connection_); - m_config = configuration; - high_volume_ = high_volume; - } + void set_configuration (Configuration const * configuration, bool high_volume = false); void setContentFont (QFont const&); + QFont contentFont () const {return char_font_;} void insertLineSpacer(QString const&); - void displayDecodedText(DecodedText const& decodedText, QString const& myCall, QString const& mode, + bool displayDecodedText(DecodedText const& decodedText, QString const& myCall, QString const& mode, bool displayDXCCEntity, LogBook const& logBook, QString const& currentBand=QString {}, bool ppfx=false, bool bCQonly=false, bool haveFSpread = false, float fSpread = 0.0, bool bDisplayPoints=false, @@ -43,21 +41,30 @@ public: qint32 m_points; bool m_bDisplayPoints; - Q_SIGNAL void selectCallsign (Qt::KeyboardModifiers); + Q_SIGNAL void selectCallsign (QString const& line, QString const& word, Qt::KeyboardModifiers); Q_SIGNAL void erased (); Q_SLOT void insertText (QString const& text, QColor bg = QColor {}, QColor fg = QColor {} , QString const& call1 = QString {}, QString const& call2 = QString {}, QTextCursor::MoveOperation location=QTextCursor::End); + Q_SLOT void clear (); Q_SLOT void erase (); + Q_SLOT void scrollToLiveActivity (); Q_SLOT void highlight_callsign (QString const& callsign, QColor const& bg, QColor const& fg, bool last_period_only); private: void AudioAlerts(); QTimer alertsTimer; QString leftJustifyAppendage (QString message, QString const& appendage) const; + void captureClick (QMouseEvent const *); + void mousePressEvent (QMouseEvent *) override; void mouseDoubleClickEvent (QMouseEvent *) override; + void resizeEvent (QResizeEvent *) override; + bool decodesFromTop () const; void extend_vertical_scrollbar (int min, int max); + void scrollRangeChanged (int minimum, int maximum); + void userScrolledTo (int position); + void updateReturnToLiveButton (); Configuration const * m_config; bool m_bPrincipalPrefix; @@ -65,14 +72,30 @@ private: QString appendWorkedB4(QString message, QString callsign , QString const& grid, QColor * bg, QColor * fg , LogBook const& logBook, QString const& currentBand - , QString const& currentMode, QString extra); + , QString const& currentMode, QString extra + , QString const& state = QString {} + , bool entityMismatch = false); QFont char_font_; QAction * erase_action_; + enum class ClickState + { + None, + Captured, + Canceled, + }; + QString pressed_line_; + QString pressed_word_; + Qt::MouseButton pressed_button_; + ClickState click_state_; QHash> highlighted_calls_; bool high_volume_; + bool sticky_scroll_enabled_; + bool following_live_activity_; QMetaObject::Connection vertical_scroll_connection_; long long modified_vertical_scrollbar_max_; + QToolButton * return_to_live_button_; + int live_scroll_position_; }; #endif // DISPLAYTEXT_H diff --git a/widgets/echograph.cpp b/widgets/echograph.cpp index 94ccb7aa..d39cbc3c 100644 --- a/widgets/echograph.cpp +++ b/widgets/echograph.cpp @@ -6,6 +6,7 @@ #include "echoplot.h" #include "ui_echograph.h" #include "moc_echograph.cpp" +#include "PerformanceTrace.hpp" #define NSMAX2 1366 @@ -14,6 +15,7 @@ EchoGraph::EchoGraph(QSettings * settings, QWidget *parent) : m_settings (settings), ui(new Ui::EchoGraph) { + PerformanceTrace::Phase construction {"echograph.construct"}; ui->setupUi(this); setWindowTitle (QApplication::applicationName () + " - " + tr ("Echo Graph")); installEventFilter(parent); //Installing the filter diff --git a/widgets/echoplot.cpp b/widgets/echoplot.cpp index 65feb7a8..039c9e5f 100644 --- a/widgets/echoplot.cpp +++ b/widgets/echoplot.cpp @@ -1,13 +1,13 @@ #include "echoplot.h" #include "commons.h" +#include #include #include #include +#include #include #include "moc_echoplot.cpp" -#define MAX_SCREENSIZE 2048 - EPlotter::EPlotter(QWidget *parent) : //EPlotter Constructor QFrame(parent) @@ -33,6 +33,7 @@ EPlotter::EPlotter(QWidget *parent) : //EPlotter Constructor m_TxFreq = 1500; m_line = 0; m_dBStepSize=10; + m_bBaseline=false; } EPlotter::~EPlotter() { } // Destructor @@ -81,7 +82,7 @@ void EPlotter::paintEvent(QPaintEvent *) // paintEvent() void EPlotter::draw() //draw() { int i,j,y; - float blue[4096],red[4096]; + float blue[4096] {},red[4096] {}; float gain = pow(10.0,(m_plotGain/20.0)); QPen penBlue(QColor(0,255,255),1); QPen penRed(Qt::red,1); @@ -100,13 +101,10 @@ void EPlotter::draw() //draw() painter2D.drawLine(0,0,m_w,0); } - QPoint LineBuf[MAX_SCREENSIZE]; - - if(m_binsPerPixel==0) m_binsPerPixel=1; + m_binsPerPixel=std::max(1,std::min(4096,m_binsPerPixel)); + int compressedCount=4096/m_binsPerPixel; j=0; - for(i=0; i<4096/m_binsPerPixel; i++) { - blue[i]=0.0; - red[i]=0.0; + for(i=0; i0) { for(i=0; i #include "fastplot.h" #include "SettingsGroup.hpp" +#include "PerformanceTrace.hpp" #include "ui_fastgraph.h" #include "moc_fastgraph.cpp" @@ -20,6 +21,7 @@ FastGraph::FastGraph(QSettings * settings, QWidget *parent) : m_ave {40}, ui {new Ui::FastGraph} { + PerformanceTrace::Phase construction {"fastgraph.construct"}; ui->setupUi(this); setWindowTitle (QApplication::applicationName () + " - " + tr ("Fast Graph")); installEventFilter(parent); //Installing the filter diff --git a/widgets/logqso.cpp b/widgets/logqso.cpp index 35f04b13..5a81f145 100644 --- a/widgets/logqso.cpp +++ b/widgets/logqso.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include @@ -16,6 +15,8 @@ #include "models/Bands.hpp" #include "models/CabrilloLog.hpp" #include "validators/MaidenheadLocatorValidator.hpp" +#include "qt_helpers.hpp" +#include "PerformanceTrace.hpp" #include "ui_logqso.h" #include "moc_logqso.cpp" @@ -88,12 +89,12 @@ LogQSO::LogQSO(QString const& programTitle, QSettings * settings , m_config {config} , m_log {log} { + PerformanceTrace::Phase construction {"logqso.construct"}; ui->setupUi(this); setWindowTitle(programTitle + " - Log QSO"); ui->comboBoxSatellite->addItem ("", ""); - QString sat_file_location; - QDir dataPath {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}; - sat_file_location = dataPath.exists(sat_file_name) ? dataPath.absoluteFilePath(sat_file_name) : m_config->data_dir ().absoluteFilePath (sat_file_name); + auto const& sat_file_location = writable_override_or_installed_file_path (m_config->writeable_data_dir (), + m_config->data_dir (), sat_file_name); QFile file {sat_file_location}; QStringList wordList; QTextStream stream(&file); @@ -169,8 +170,8 @@ void LogQSO::loadSettings () ui->cbFreqRx->setChecked (m_settings->value ("SaveFreqRx", false).toBool ()); QString comments_location; // load the content of comments.txt file to the comments combo box - QDir dataPath {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}; - comments_location = dataPath.exists("comments.txt") ? dataPath.absoluteFilePath("comments.txt") : m_config->data_dir ().absoluteFilePath ("comments.txt"); + comments_location = writable_override_or_installed_file_path (m_config->writeable_data_dir (), + m_config->data_dir (), "comments.txt"); QFile file2 {comments_location}; QTextStream stream2(&file2); if(file2.open (QIODevice::ReadOnly | QIODevice::Text)) { @@ -216,8 +217,8 @@ void LogQSO::initLogQSO(QString const& hisCall, QString const& hisGrid, QString QDateTime const& dateTimeOn, QDateTime const& dateTimeOff, Radio::Frequency dialFreq, bool noSuffix, QString xSent, QString xRcvd) { - if(!isHidden()) return; + if(!isHidden()) return; QPushButton* okBtn = ui->buttonBox->button(QDialogButtonBox::Ok); okBtn->setAutoDefault(true); okBtn->setDefault(true); @@ -376,8 +377,8 @@ void LogQSO::accept() m_txPower = ui->txPower->text (); auto strDialFreq = QString::number (m_dialFreq / 1.e6,'f',6); auto operator_call = ui->loggedOperator->text (); - auto xsent = ui->exchSent->text (); - auto xrcvd = ui->exchRcvd->text (); + auto xsent = ui->exchSent->text ().trimmed (); + auto xrcvd = ui->exchRcvd->text ().trimmed (); using SpOp = Configuration::SpecialOperatingActivity; auto special_op = m_config->special_op_id (); @@ -387,20 +388,22 @@ void LogQSO::accept() } if ((special_op == SpOp::RTTY and xsent!="" and xrcvd!="")) { - if(rptSent=="" or !xsent.contains(rptSent+" ")) rptSent=xsent.split(" " + auto xsent_words = xsent.split(" " #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) - , QString::SkipEmptyParts + , QString::SkipEmptyParts #else - , Qt::SkipEmptyParts + , Qt::SkipEmptyParts #endif - ).at(0); - if(rptRcvd=="" or !xrcvd.contains(rptRcvd+" ")) rptRcvd=xrcvd.split(" " + ); + auto xrcvd_words = xrcvd.split(" " #if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) - , QString::SkipEmptyParts + , QString::SkipEmptyParts #else - , Qt::SkipEmptyParts + , Qt::SkipEmptyParts #endif - ).at(0); + ); + if(rptSent=="" or !xsent.contains(rptSent+" ")) rptSent=xsent_words.at(0); + if(rptRcvd=="" or !xrcvd.contains(rptRcvd+" ")) rptRcvd=xrcvd_words.at(0); } // validate @@ -433,7 +436,8 @@ void LogQSO::accept() } m_freqRx = ui->freqRx->text (); //Log this QSO to file "wsjtx.log" - static QFile f {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath ("wsjtx.log")}; + QFile f {writable_file_path (m_config->writeable_data_dir (), "wsjtx.log")}; + ensure_parent_directory (f.fileName ()); if(!f.open(QIODevice::Text | QIODevice::Append)) { MessageBox::warning_message (this, tr ("Log file error"), tr ("Cannot open \"%1\" for append").arg (f.fileName ()), diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index dc7e1d2d..596cb0e0 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -1,31 +1,38 @@ //---------------------------------------------------------- MainWindow #include "mainwindow.h" +#include "RoundRobinSelection.hpp" +#include "FastDecode.hpp" +#include #include #include #include #include -#include #include #include +#include #include #include -#include -#include #include #include -#include // TCI #include #include #include #include +#include #include #include #include #include #include #include +#include #include +#include +#include +#include +#include +#include #include #include #include @@ -38,14 +45,19 @@ #include #include #include -#include #include +#include #include #include #include #include #include #include +#include +#include +#include +#include +#include #include #include #include @@ -56,18 +68,33 @@ #include #endif +#include +#include + #include "itoneAndicw.h" // TCI #include "helper_functions.h" +#include "PerformanceTrace.hpp" #include "revision_utils.hpp" #include "qt_helpers.hpp" +#include "CompactButtonSize.hpp" #include "Network/NetworkAccessManager.hpp" +#include "Network/DecodedTime.hpp" #include "Audio/soundout.h" #include "Audio/soundin.h" +#include "Audio/AudioInputSource.hpp" #include "Modulator/Modulator.hpp" #include "Detector/Detector.hpp" +#include "DecDataMutex.hpp" +#include "DecoderIpc.hpp" +#include "qmap/qmap_ipc.h" +#include "qmap/qmap_decode_record.h" +#include "qmap/qmap_click_policy.h" +#include "TxStartPolicy.hpp" +#include "WaitFeaturePolicy.hpp" +#include "ActiveStationList.hpp" +#include "widgets/SpecOpLabel.h" #include "plotter.h" -#include "echoplot.h" #include "echograph.h" #include "fastplot.h" #include "fastgraph.h" @@ -77,7 +104,6 @@ #include "activeStations.h" #include "colorhighlighting.h" #include "widegraph.h" -#include "sleep.h" #include "logqso.h" #include "Decoder/decodedtext.h" #include "Radio.hpp" @@ -91,10 +117,10 @@ #include "signalmeter.h" #include "HelpTextWindow.hpp" #include "SampleDownloader.hpp" -#include "Audio/BWFFile.hpp" #include "MultiSettings.hpp" #include "validators/MaidenheadLocatorValidator.hpp" #include "validators/CallsignValidator.hpp" +#include "validators/LiveCQCallsign.hpp" #include "EqualizationToolsDialog.hpp" #include "Network/LotWUsers.hpp" #include "logbook/AD1CCty.hpp" @@ -105,17 +131,184 @@ #include "ExportCabrillo.h" #include "Network/Cloudlog.hpp" #include "ui_mainwindow.h" +#include "qmap/decode_ipc.h" +#include "qmap/shared_memory_key.h" #include "moc_mainwindow.cpp" +#include "MessageFilter.hpp" +#include "MessageFilterLogic.hpp" +#include "JttyMessages.hpp" +#include "PrefixSuffix.hpp" +#include "HelpText.hpp" +#include "HighlightingRules.hpp" +#include "Rr73Policy.hpp" +#include "Audio/WavInputLoader.hpp" +#include "Audio/WavFile.hpp" +#include "WSJTXLogging.hpp" #include "Logger.hpp" +#include "FoxGuardBands.hpp" +#include "FoxOperatorActions.hpp" +#include "DecodedMessageReaction.hpp" +#include "DecodeOutputPlan.hpp" +#include "SuperFoxTxPlanner.h" #include "widgets/QSYMessage.h" #include "widgets/QSYMessageCreator.h" +#include "widgets/QSYMessageParser.h" #include "widgets/qsymonitor.h" #include "Network/eqsl.h" #define FCL fortran_charlen_t +extern "C" { + void sfox_pack_(char* line, char* ckey, bool* more_cqs, bool* send_msg, + char* free_text_msg, qint8 xin[], int* pack_error, + FCL line_len, FCL ckey_len, FCL free_text_msg_len); +} + +namespace { + int const ReferenceSpectrumMeasureSeconds = 7; + // Bit 7 is unused by the legacy nexp_decode contest packing. + int constexpr q65PileupDecodeFlag = 1 << 7; + + QString decodeHeadingText(QString const& headings) + { + return headings.simplified(); + } + + QString decodeLineDescription(QString const& headings) + { + if (headings.isEmpty ()) return QString {"No column headings are shown."}; + return QString {"Columns: %1."}.arg (headings); + } + + void set_style_sheet_if_changed(QWidget * widget, QString const& style_sheet) + { + if (widget->styleSheet() != style_sheet) widget->setStyleSheet(style_sheet); + } + + void set_style_sheet_if_changed(QWidget& widget, QString const& style_sheet) + { + set_style_sheet_if_changed(&widget, style_sheet); + } + + void set_button_style_state_if_changed(QWidget * widget, char const * state) + { + if (widget->property("wsjtxState").toString() != QLatin1String {state}) + { + widget->setProperty("wsjtxState", state); + widget->style()->unpolish(widget); + widget->style()->polish(widget); + widget->update(); + } + } + + QRegularExpression const four_digit_regexp {"\\d\\d\\d\\d"}; + QRegularExpression const cq_or_qrz_message_regexp {"^(CQ|QRZ) "}; + QRegularExpression const leading_r_report_regexp {"^R(?!R73|RR)"}; + QRegularExpression const roger_ack_regexp {"^RR(?:R|73)$"}; + QRegularExpression const reply_cq_or_qrz_regexp {R"(^(CQ |CQDX |QRZ ))"}; + + void clearFoxTxMessages() + { + foxcom_.nslots = 0; + std::memset(foxcom_.i3bit, 0, sizeof foxcom_.i3bit); + std::memset(foxcom_.cmsg, 0, sizeof foxcom_.cmsg); + } + + struct SuperFoxTxMessage + { + int slot; + QString text; + }; + + QVector superFoxTxMessages() + { + int constexpr maxFoxTxMessages = 5; + int constexpr foxTxMessageChars = 37; + // C index 38 is Fortran cmsg(n)(39:39), the SuperFox free-text flag. + int constexpr superFoxFreeTextFlagIndex = 38; + // foxgen_() appends SuperFox free text as an extra slot by mutating nslots. + int const nslots = qBound(0, foxcom_.nslots, maxFoxTxMessages); + QVector messages; + messages.reserve(nslots); + + for(int i = 0; i < nslots; i++) { + char const * const row=foxcom_.cmsg[i]; + bool const freeTextRow = foxcom_.bSendMsg && i == nslots - 1 && + row[superFoxFreeTextFlagIndex] == '1'; + if(freeTextRow) continue; + + QString const text = QString::fromLatin1(row, foxTxMessageChars) + .trimmed(); + if(text.isEmpty()) continue; + messages.push_back({i + 1, text}); + } + + return messages; + } + + int const SuperFoxReportMin = -18; + int const SuperFoxReportMax = 12; + int const SuperFoxHoundCallMax = 6; + + // Must match the SFOX_PACK_* parameters in lib/superfox/sfox_pack.f90. + enum SuperFoxPackError { + SuperFoxPackOk = 0, + SuperFoxPackBadToken = 1, + SuperFoxPackBadOtp = 2, + SuperFoxPackBadCq = 3, + SuperFoxPackBadCall = 4, + SuperFoxPackBadReport = 5, + SuperFoxPackBadFreeText = 6, + }; + + QString superFoxTxReport(QString report) + { + bool ok {false}; + int value = report.toInt(&ok); + if(ok) { + report=QString::number(qBound(SuperFoxReportMin,value, + SuperFoxReportMax)); + } + if(report.mid(0,1) != "-" and report.mid(0,1) != "+") report="+" + report; + if(report.length()==2) report=report.mid(0,1) + "0" + report.mid(1,1); + return report; + } + + int superFoxPackError(QString const& message) + { + QByteArray line = message.left(120).leftJustified(120, ' ').toLatin1(); + QByteArray ckey = QByteArray {"0000000000"}; + QByteArray freeTextMsg(26, ' '); + std::array xin {}; + bool moreCqs {false}; + bool sendMsg {false}; + int packError {0}; + + sfox_pack_(line.data(), ckey.data(), &moreCqs, &sendMsg, + freeTextMsg.data(), xin.data(), &packError, + (FCL)line.size(), (FCL)ckey.size(), (FCL)freeTextMsg.size()); + return packError; + } + + bool superFoxQueueableHound(QString const& foxBaseCall, + QString const& houndCall, + QString const& report) + { + // SuperFox Fox replies are staged through foxgen2/sfox_assemble, which + // transmits the Hound as a 6-character base call in a c28 slot. + QString const houndBaseCall = Radio::base_callsign(houndCall); + if(houndBaseCall.length() > SuperFoxHoundCallMax) return false; + QString const message = QString {"%1 %2 %3"}.arg(foxBaseCall, + houndBaseCall, superFoxTxReport(report)); + return superFoxPackError(message) == SuperFoxPackOk; + } +} + extern "C" { //----------------------------------------------------- C and Fortran routines + + bool stdmsg_(char const * msg, fortran_charlen_t); + void symspec_(struct dec_data *, int* k, int* nsps, int* ingain, bool* bLowSidelobes, int* minw, float* px, float s[], float* df3, int* nhsym, int* npts8, float *m_pxmax, int* npct); @@ -127,6 +320,11 @@ extern "C" { float s[], int* jh, float *pxmax, float *rmsNoGain, char line[], fortran_charlen_t, fortran_charlen_t, fortran_charlen_t, fortran_charlen_t); + void genjtty_(char const * msg, int itone[], int* nsym, fortran_charlen_t); + + void gen_jttywave_(int itone[], int* nsym, int* nsps, float* bt, float* fsample, float* f0, + float xjunk[], float wave[], int* icmplx, int* nwave); + void gen_echocall_(char* basecall, int itone[], fortran_charlen_t); void genft8_(char* msg, int* i3, int* n3, char* msgsent, char ft8msgbits[], @@ -161,10 +359,10 @@ extern "C" { void gen65(char* msg, int* ichk, char msgsent[], int itone[], int* itext); - void gen_cw_wave_(char* msg, int* ifreq, float wave[], fortran_charlen_t); + void gen_cw_wave_(char const * msg, int* ifreq, float wave[], fortran_charlen_t); void genq65_(char* msg, int* ichk, char* msgsent, int itone[], - int* i3, int* n3, fortran_charlen_t, fortran_charlen_t); + int* i3, int* n3, int* iflag, fortran_charlen_t, fortran_charlen_t); void genwspr_(char* msg, char* msgsent, int itone[], fortran_charlen_t, fortran_charlen_t); @@ -181,19 +379,14 @@ extern "C" { void save_echo_params_(int* ndoptotal, int* ndop, int* nfrit, float* f1, float* fspread, int* toneSpacing, volatile int itone[], short id2[], int* idir); - void avecho_( short id2[], int* dop, int* nfrit, int* nauto, int* ndf, int* navg, + void avecho_( short id2[], int* dop, int* nfrit, int* nauto, int* navg, int* nqual, float* f1, float* level, float* sigdb, float* snr, float* dfreq, float* width, bool* bDiskData, bool* bEchoCall, char const * txcall, char rxcall[], FCL len1, FCL len2); - void fast_decode_(short id2[], int narg[], double * trperiod, - char msg[], char mycall[], char hiscall[], - fortran_charlen_t, fortran_charlen_t, fortran_charlen_t); void degrade_snr_(short d2[], int* n, float* db, float* bandwidth); - void wav12_(short d2[], short d1[], int* nbytes, short* nbitsam2); - - void refspectrum_(short int d2[], bool* bclearrefspec, + void refspectrum_(short int d2[], int* ninput, bool* bclearrefspec, bool* brefspec, bool* buseref, const char* c_fname, fortran_charlen_t); void freqcal_(short d2[], int* k, int* nkhz,int* noffset, int* ntol, @@ -206,16 +399,12 @@ extern "C" { void sfox_wave_gfsk_(); - void sftx_sub_(char const * otp_key, FCL len1); + void sftx_sub_(char const * otp_key, int* pack_error, FCL len1); void plotsave_(float swide[], int* m_w , int* m_h1, int* irow); void chk_samples_(int* m_ihsym,int* k, int* m_hsymStop); - void save_dxbase_(char* dxbase, FCL len); - - void indexx_(float arr[], int* n, int indx[]); - void get_q3list_(char* fname, bool* bDiskData, int* nlist, char* list, FCL len1, FCL len2); void rm_q3list_(char* callsign, FCL len); @@ -226,7 +415,8 @@ QList m_verifications; int volatile itone[MAX_NUM_SYMBOLS]; //Audio tones for all Tx symbols int volatile itone0[MAX_NUM_SYMBOLS]; //Dummy array, data not actually used int volatile icw[NUM_CW_SYMBOLS]; //Dits for CW ID -dec_data_t dec_data; //For sharing with Fortran +dec_data_t& dec_data = *new dec_data_t{}; + int outBufSize; int rc; qint32 g_iptt {0}; @@ -243,7 +433,6 @@ QVector g_ColorTbl; using SpecOp = Configuration::SpecialOperatingActivity; -bool verified = false; bool blocked = false; bool m_displayBand = false; bool wait_and_call = false; @@ -259,16 +448,9 @@ bool not_erase = false; bool first_Fox_alert = true; bool second_Fox_alert = true; bool no_Fox_alert = false; -int Dpoints=0; -int maxDPoints=0; -int dBpoints=-28; -int dBpoints2=99; -int maxdBPoints=-28; -int mindBPoints=99; bool pounce = false; bool filtered = false; bool ignored = false; -bool selected = false; bool keepTx5 = false; bool no_logging = false; bool BlankLineInserted = false; @@ -288,29 +470,23 @@ QString ALLCALL7 = ""; QString m_hisCall0 = ""; QString earlyDecodes = ""; //ft8md -QSharedMemory mem_qmap("mem_qmap"); //Memory segment to be shared (optionally) with QMAP -struct { - int ndecodes; //Number of QMAP decodes available (so far) - int ncand; //Number of QMAP candidates considered for decoding - int nQDecoderDone; //QMAP decoder is finished (0 or 1) - int nWDecoderBusy; //WSJT-X decoder is busy (0 or 1) - int nWTransmitting; //WSJT-X is transmitting (0 or 1) - int kHzRequested; //Integer kHz dial frequency requested from QMAP - char result[50][72]; //Decodes as character*72 arrays -} qmapcom; -int* ipc_qmap; +QSharedMemory mem_qmap; //Memory segment to be shared (optionally) with QMAP +QMapDecodeBlock qmapcom {}; +QMapSharedMemory * ipc_qmap {nullptr}; +bool qmap_decoder_region_available {false}; +bool qmap_click_mailbox_available {false}; namespace { Radio::Frequency constexpr default_frequency {14074000}; - QRegExp message_alphabet {"[- @A-Za-z0-9+./?#<>;$]*"}; - // grid exact match excluding RR73 - QRegularExpression grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"}; - QRegularExpression non_r_db_regexp {"\\A[-+]{1}[0-9]{1,2}\\z"}; auto quint32_max = std::numeric_limits::max (); - constexpr int N_WIDGETS {38}; + constexpr int standard_messages_tab_index {0}; + constexpr int fox_queue_tab_index {1}; constexpr int default_rx_audio_buffer_frames {-1}; // lets Qt decide constexpr int default_tx_audio_buffer_frames {-1}; // lets Qt decide + // Type 5 EU VHF messages carry an 11-bit serial number. + constexpr int eu_vhf_type5_serial_max {2047}; + constexpr int default_serial_number_max {4095}; bool message_is_73 (int type, QStringList const& msg_parts) { @@ -329,27 +505,43 @@ namespace } } +QRegExp const MainWindow::message_alphabet {"[- @A-Za-z0-9+./?#<>;$]*"}; +QRegularExpression const MainWindow::grid_regexp {"\\A(?![Rr]{2}73)[A-Ra-r]{2}[0-9]{2}([A-Xa-x]{2}){0,1}\\z"}; +QRegularExpression const MainWindow::non_r_db_regexp {"\\A[-+]{1}[0-9]{1,2}\\z"}; +constexpr int MainWindow::MaxActiveStationRows; +constexpr int MainWindow::MaxQ65PileupCallers; + //--------------------------------------------------- MainWindow constructor MainWindow::MainWindow(QDir const& temp_directory, bool multiple, MultiSettings * multi_settings, QSharedMemory *shdmem, unsigned downSampleFactor, - QSplashScreen * splash, QProcessEnvironment const& env, QWidget *parent) : + QSplashScreen * splash, QProcessEnvironment const& env, + bool automated_test, + QString base_style_sheet, + std::unique_ptr audio_input_source, + std::unique_ptr sound_output, + QString decoder_data_path, + QWidget *parent) : MultiGeometryWidget {parent}, + m_startup_trace_run {PerformanceTrace::current_run ()}, m_env {env}, m_network_manager {this}, m_valid {true}, m_splash {splash}, m_revision {revision ()}, m_multiple {multiple}, + m_automated_test {automated_test}, m_multi_settings {multi_settings}, m_configurations_button {0}, m_settings {multi_settings->settings ()}, + m_base_style_sheet {std::move (base_style_sheet)}, ui(new Ui::MainWindow), m_config {&m_network_manager, temp_directory, m_settings, &m_logBook, this}, + m_decoderDataDir {decoder_data_path.isEmpty () + ? m_config.data_dir () : QDir {decoder_data_path}}, m_logBook {&m_config}, m_cloudlog {&m_config, &m_network_manager}, m_WSPR_band_hopping {m_settings, &m_config, this}, - m_WSPR_tx_next {false}, m_rigErrorMessageBox {MessageBox::Critical, tr ("Rig Control Error") , MessageBox::Cancel | MessageBox::Ok | MessageBox::Retry}, m_wideGraph (new WideGraph(m_settings)), @@ -361,17 +553,20 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_dialFreqRxWSPR {0}, m_detector {new Detector {RX_SAMPLE_RATE, double(NTMAX), downSampleFactor}}, m_FFTSize {6192 / 2}, // conservative value to avoid buffer overruns - m_soundInput {new SoundInput}, + m_soundInput {audio_input_source + ? audio_input_source.release () + : static_cast (new SoundInput)}, m_modulator {new Modulator {TX_SAMPLE_RATE, NTMAX}}, - m_soundOutput {new SoundOutput}, + m_jttyTxQueue {new TxAudioQueue}, + m_jttyTxStream {new JttyTxStream {*m_jttyTxQueue}}, + m_soundOutput {sound_output ? sound_output.release () : new SoundOutput}, m_rx_audio_buffer_frames {0}, m_tx_audio_buffer_frames {0}, m_msErase {0}, m_secBandChanged {0}, m_msDecStarted {0}, //ft8md - m_freqNominal {0}, + m_operatingFrequency {default_frequency}, m_freqNominalPeriod {0}, - m_freqTxNominal {0}, m_mslastTX {0}, //ft8md m_nlasttx {0}, //ft8md m_lapmyc {0}, //ft8md @@ -395,7 +590,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_sec0 {-1}, m_RxLog {1}, //Write Date and Time to RxLog m_nutc0 {999999}, - m_ntr {0}, m_tx {0}, m_mslastMon {0}, m_delay {0}, @@ -416,6 +610,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_txFirst {false}, m_auto {false}, m_restart {false}, + m_generated_message_error {false}, m_startAnother {false}, m_skipTx1 {false}, //ft8md m_filter {false}, //ft8md @@ -431,7 +626,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_saveAll {false}, m_widebandDecode {false}, m_dataAvailable {false}, - m_decodedText2 {false}, + m_bDecoded {false}, m_sentFirst73 {false}, m_tci_mod_active {false}, // TCI m_tci {false}, // TCI @@ -440,15 +635,13 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_lastMessageType {-1}, m_bShMsgs {false}, m_bSWL {false}, - m_uploading {false}, m_grid6 {false}, - m_tuneup {false}, m_bTxTime {false}, - m_rxDone {true}, m_bSimplex {false}, m_bEchoTxOK {false}, m_bTransmittedEcho {false}, m_bEchoTxed {false}, + m_bFast9 {false}, m_bFastDecodeCalled {false}, m_bDoubleClickAfterCQnnn {false}, m_bRefSpec {false}, @@ -473,61 +666,9 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_cqStr {""}, m_palette {"Linrad"}, m_mode {"FT8"}, - m_modeTx {"FT8"}, m_rpt {"-15"}, - m_pfx { - "1A", "1S", - "3A", "3B6", "3B8", "3B9", "3C", "3C0", "3D2", "3D2C", - "3D2R", "3DA", "3V", "3W", "3X", "3Y", "3YB", "3YP", - "4J", "4L", "4S", "4U1I", "4U1U", "4W", "4X", - "5A", "5B", "5H", "5N", "5R", "5T", "5U", "5V", "5W", "5X", "5Z", - "6W", "6Y", - "7O", "7P", "7Q", "7X", - "8P", "8Q", "8R", - "9A", "9G", "9H", "9J", "9K", "9L", "9M2", "9M6", "9N", - "9Q", "9U", "9V", "9X", "9Y", - "A2", "A3", "A4", "A5", "A6", "A7", "A9", "AP", - "BS7", "BV", "BV9", "BY", - "C2", "C3", "C5", "C6", "C9", "CE", "CE0X", "CE0Y", - "CE0Z", "CE9", "CM", "CN", "CP", "CT", "CT3", "CU", - "CX", "CY0", "CY9", - "D2", "D4", "D6", "DL", "DU", - "E3", "E4", "E5", "EA", "EA6", "EA8", "EA9", "EI", "EK", - "EL", "EP", "ER", "ES", "ET", "EU", "EX", "EY", "EZ", - "F", "FG", "FH", "FJ", "FK", "FKC", "FM", "FO", "FOA", - "FOC", "FOM", "FP", "FR", "FRG", "FRJ", "FRT", "FT5W", - "FT5X", "FT5Z", "FW", "FY", - "M", "MD", "MI", "MJ", "MM", "MU", "MW", - "H4", "H40", "HA", "HB", "HB0", "HC", "HC8", "HH", - "HI", "HK", "HK0", "HK0M", "HL", "HM", "HP", "HR", - "HS", "HV", "HZ", - "I", "IS", "IS0", - "J2", "J3", "J5", "J6", "J7", "J8", "JA", "JDM", - "JDO", "JT", "JW", "JX", "JY", - "K", "KC4", "KG4", "KH0", "KH1", "KH2", "KH3", "KH4", "KH5", - "KH5K", "KH6", "KH7", "KH8", "KH9", "KL", "KP1", "KP2", - "KP4", "KP5", - "LA", "LU", "LX", "LY", "LZ", - "OA", "OD", "OE", "OH", "OH0", "OJ0", "OK", "OM", "ON", - "OX", "OY", "OZ", - "P2", "P4", "PA", "PJ2", "PJ7", "PY", "PY0F", "PT0S", "PY0T", "PZ", - "R1F", "R1M", - "S0", "S2", "S5", "S7", "S9", "SM", "SP", "ST", "SU", - "SV", "SVA", "SV5", "SV9", - "T2", "T30", "T31", "T32", "T33", "T5", "T7", "T8", "T9", "TA", - "TF", "TG", "TI", "TI9", "TJ", "TK", "TL", "TN", "TR", "TT", - "TU", "TY", "TZ", - "UA", "UA2", "UA9", "UK", "UN", "UR", - "V2", "V3", "V4", "V5", "V6", "V7", "V8", "VE", "VK", "VK0H", - "VK0M", "VK9C", "VK9L", "VK9M", "VK9N", "VK9W", "VK9X", "VP2E", - "VP2M", "VP2V", "VP5", "VP6", "VP6D", "VP8", "VP8G", "VP8H", - "VP8O", "VP8S", "VP9", "VQ9", "VR", "VU", "VU4", "VU7", - "XE", "XF4", "XT", "XU", "XW", "XX9", "XZ", - "YA", "YB", "YI", "YJ", "YK", "YL", "YN", "YO", "YS", "YU", "YV", "YV0", - "Z2", "Z3", "ZA", "ZB", "ZC4", "ZD7", "ZD8", "ZD9", "ZF", "ZK1N", - "ZK1S", "ZK2", "ZK3", "ZL", "ZL7", "ZL8", "ZL9", "ZP", "ZS", "ZS8" - }, - m_sfx {"P", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A"}, + m_pfx {Radio::PrefixSuffix::type1Prefixes()}, + m_sfx {Radio::PrefixSuffix::type1Suffixes()}, mem_jt9 {shdmem}, m_downSampleFactor (downSampleFactor), m_audioThreadPriority (QThread::HighPriority), @@ -538,46 +679,85 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_transmitting {false}, m_tune {false}, m_tx_watchdog {false}, + m_jttyTxActive {false}, + m_jttyTxUsesTciAudio {false}, + m_jttyTxQueueEpoch {}, + m_jttyTxQueueProgress {}, + m_jttyTxRequestId {0}, + m_jttyTciEnqueueId {0}, m_block_pwr_tooltip {false}, m_PwrBandSetOK {true}, - m_lastMonitoredFrequency {default_frequency}, m_toneSpacing {0.}, - m_firstDecode {0}, - m_optimizingProgress {"Optimizing decoder FFTs for your CPU.\n" - "Please be patient,\n" - "this may take a few minutes", QString {}, 0, 1, this}, m_messageClient {new MessageClient {QApplication::applicationName (), version (), revision (), m_config.udp_server_name (), m_config.udp_server_port (), m_config.udp_interface_names (), m_config.udp_TTL (), this}}, - m_psk_Reporter {&m_config, QString {"WSJT-X v" + version()}.simplified()}, + m_psk_Reporter {&m_config, QString {"WSJT-X v" + version() + " " + m_revision}.simplified()}, m_manual {&m_network_manager}, m_block_udp_status_updates {false}, m_useDarkStyle {false} { + PerformanceTrace::milestone (m_startup_trace_run, "mainwindow.members_ready"); + PerformanceTrace::Phase ui_initialize {m_startup_trace_run, "mainwindow.ui_initialize"}; + programStart = true; + qApp->setFont (m_config.text_font ()); ui->setupUi(this); + configureModeControlsLayout (); + connect (ui->Tx_Message, &QLineEdit::textChanged, this, + [this] { m_jttyDraftAcceptanceTracker.noteDraftChanged (); }); + connect (this, &MainWindow::jttyTextAccepted, this, [this] (qint64 requestId) { + if (m_jttyDraftAcceptanceTracker.accept (requestId)) { + ui->Tx_Message->clear (); + } + }); + connect (this, &MainWindow::jttyTextRejected, this, + [this] (qint64 requestId, JttyTxRejectReason) { + m_jttyDraftAcceptanceTracker.reject (requestId); + }); + m_tx_message_button_group = new QButtonGroup {this}; + m_tx_message_button_group->addButton (ui->txrb1, 1); + m_tx_message_button_group->addButton (ui->txrb2, 2); + m_tx_message_button_group->addButton (ui->txrb3, 3); + m_tx_message_button_group->addButton (ui->txrb4, 4); + m_tx_message_button_group->addButton (ui->txrb5, 5); + m_tx_message_button_group->addButton (ui->txrb6, 6); + m_main_window_focus_frame = new QFocusFrame {this}; + m_main_window_focus_frame->hide (); + m_message_selector_focus_frame = new QFrame {ui->tabWidget->tabBar ()}; + m_message_selector_focus_frame->setAttribute (Qt::WA_TransparentForMouseEvents); + m_message_selector_focus_frame->setStyleSheet ( + "QFrame { border: 2px solid #0a84ff; border-radius: 4px; background: transparent; }"); + m_message_selector_focus_frame->setGeometry (ui->tabWidget->tabBar ()->rect ()); + m_message_selector_focus_frame->hide (); setUnifiedTitleAndToolBarOnMac (true); createStatusBar(); + updateMainWindowAccessibility(); + registerMainWindowFocusControls(); + m_event_filter_ready = true; add_child_to_event_filter (this); ui->dxGridEntry->setValidator (new MaidenheadLocatorValidator {this}); ui->dxCallEntry->setValidator (new CallsignValidator {this}); + ui->leEchoMessage->setValidator (new CallsignValidator {this, false}); ui->sbTR->values ({5, 10, 15, 30, 60, 120, 300, 900, 1800}); ui->sbTR_FST4W->values ({120, 300, 900, 1800}); ui->decodedTextBrowser->set_configuration (&m_config, true); ui->decodedTextBrowser2->set_configuration (&m_config); - m_optimizingProgress.setWindowModality (Qt::WindowModal); - m_optimizingProgress.setAutoReset (false); - m_optimizingProgress.setMinimumDuration (15000); // only show after 15s delay - //Attach or create a memory segment to be shared with QMAP. - int memSize=4096; + auto const memSize=static_cast(QMapSharedMemorySize); + mem_qmap.setKey (qmap_decode_ipc::shared_memory_key ()); if(!mem_qmap.attach()) mem_qmap.create(memSize); - ipc_qmap = (int*)mem_qmap.data(); - mem_qmap.lock(); - memset(ipc_qmap,0,memSize); //Zero all of QMAP shared memory - mem_qmap.unlock(); + auto const mappedSize = mem_qmap.isAttached () + ? static_cast (mem_qmap.size ()) : 0u; + qmap_decoder_region_available = qmapDecoderRegionAvailable (mappedSize); + qmap_click_mailbox_available = qmapClickMailboxAvailable (mappedSize); + ipc_qmap = qmap_decoder_region_available + ? static_cast (mem_qmap.data ()) : nullptr; + if (ipc_qmap && mem_qmap.lock ()) { + clearQMapSharedMemory (ipc_qmap, mappedSize); + mem_qmap.unlock (); + } // Closedown. connect (ui->actionExit, &QAction::triggered, this, &QMainWindow::close); @@ -589,8 +769,10 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, // start audio thread and hook up slots & signals for shutdown management // these objects need to be in the audio thread so that invoking // their slots is done in a thread safe way + Q_ASSERT (!m_soundInput->parent ()); m_soundOutput->moveToThread (&m_audioThread); m_modulator->moveToThread (&m_audioThread); + m_jttyTxStream->moveToThread (&m_audioThread); m_soundInput->moveToThread (&m_audioThread); m_detector->moveToThread (&m_audioThread); bool ok; @@ -611,31 +793,136 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, connect (this, &MainWindow::transmitFrequency, m_modulator, &Modulator::setFrequency); connect (this, &MainWindow::endTransmitMessage, m_modulator, &Modulator::stop); connect (this, &MainWindow::tune, m_modulator, &Modulator::tune); - connect (this, &MainWindow::sendMessage, m_modulator, &Modulator::start); + connect (this, &MainWindow::sendMessage, m_modulator, &Modulator::start, + Qt::QueuedConnection); + connect (m_modulator, &Modulator::txSourceCommitted, + this, &MainWindow::recordTxSourceCommit, Qt::QueuedConnection); +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) + connect (m_modulator, &Modulator::constrainedStartDecided, + this, [this] (qint64 sessionId, qint64 generation, + qint64 windowOpenMs, + bool accepted, qint64 actualStartMs) { + if (sessionId != m_liveAudioTestFt8StartSessionId + || generation != m_liveAudioTestFt8StartGeneration) + { + return; + } + m_liveAudioTestFt8StartSessionId = -1; + m_liveAudioTestFt8StartGeneration = -1; + if (!accepted) + { + m_tx_when_ready = false; + ptt1Timer.stop (); + stopTx (); + } + Q_EMIT liveAudioTestFt8TransmitStartDecided ( + sessionId, generation, windowOpenMs, accepted, actualStartMs); + }, Qt::QueuedConnection); +#endif + connect (m_soundOutput, &SoundOutput::rawTxPlayoutSnapshot, + this, &MainWindow::recordRawTxPlayout, Qt::QueuedConnection); connect (&m_audioThread, &QThread::finished, m_modulator, &QObject::deleteLater); + // hook up the JTTY async transmit stream slots and disposal + connect (this, &MainWindow::startJttyStream, m_jttyTxStream, &JttyTxStream::start, + Qt::QueuedConnection); + connect (m_jttyTxStream, &JttyTxStream::txSourceCommitted, + this, &MainWindow::recordTxSourceCommit, Qt::QueuedConnection); + connect (this, &MainWindow::endJttyStream, m_jttyTxStream, &JttyTxStream::stop); + connect (m_jttyTxStream, &JttyTxStream::drained, this, &MainWindow::onJttyBackendDrained); + connect (&m_audioThread, &QThread::finished, m_jttyTxStream, &QObject::deleteLater); + // hook up the audio input stream signals, slots and disposal - connect (this, &MainWindow::startAudioInputStream, m_soundInput, &SoundInput::start); - connect (this, &MainWindow::suspendAudioInputStream, m_soundInput, &SoundInput::suspend); - connect (this, &MainWindow::resumeAudioInputStream, m_soundInput, &SoundInput::resume); - connect (this, &MainWindow::reset_audio_input_stream, m_soundInput, &SoundInput::reset); - connect (this, &MainWindow::finished, m_soundInput, &SoundInput::stop); - connect(m_soundInput, &SoundInput::error, this, &MainWindow::showSoundInError); - connect(m_soundInput, &SoundInput::error, &m_config, &Configuration::invalidate_audio_input_device); - // connect(m_soundInput, &SoundInput::status, this, &MainWindow::showStatusMessage); + connect (this, &MainWindow::startAudioInputStream, m_soundInput, &AudioInputSource::start); + connect (this, &MainWindow::suspendAudioInputStream, m_soundInput, &AudioInputSource::suspend); + connect (this, &MainWindow::resumeAudioInputStream, m_soundInput, &AudioInputSource::resume); + connect (this, &MainWindow::stopAudioInputStream, m_soundInput, &AudioInputSource::stop); + connect (this, &MainWindow::reset_audio_input_stream, m_soundInput, &AudioInputSource::reset); + connect (this, &MainWindow::finished, m_soundInput, &AudioInputSource::stop); + connect (m_soundInput, &AudioInputSource::streamDescriptorChanged, + m_detector, &Detector::setStreamDescriptor); + connect (m_soundInput, &AudioInputSource::streamDescriptorChanged, this, + [this] (AudioStreamDescriptor const&) { + if (!m_startup_audio_reported) + { + m_startup_audio_reported = true; + PerformanceTrace::milestone (m_startup_trace_run, "audio.input_ready"); + } + }); + if (!m_automated_test) + { + connect(m_soundInput, &AudioInputSource::error, this, &MainWindow::showSoundInError); + } + connect(m_soundInput, &AudioInputSource::error, &m_config, &Configuration::invalidate_audio_input_device); + // connect(m_soundInput, &AudioInputSource::status, this, &MainWindow::showStatusMessage); connect (&m_audioThread, &QThread::finished, m_soundInput, &QObject::deleteLater); connect (this, &MainWindow::finished, this, &MainWindow::close); // hook up the detector signals, slots and disposal connect (this, &MainWindow::FFTSize, m_detector, &Detector::setBlockSize); - connect(m_detector, &Detector::framesWritten, this, &MainWindow::dataSink); + auto const live_data_sink = [this] (ReceiveAudio audio) { + m_receiveQueue.enqueue (std::move (audio)); + // decode() may dispatch GUI events. Queue nested deliveries until the + // current DSP invocation has finished using its consumer-owned samples. + if (m_receivingAudio) return; + m_receivingAudio = true; + while (!m_receiveQueue.isEmpty ()) + { + auto const block = m_receiveQueue.dequeue (); +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) + if (m_automated_test) Q_EMIT liveAudioTestReceiveBlock (block); +#endif + if (m_wav_load_coordinator.isLoading () || m_diskData) + { + m_receiveConsumer.invalidate (); + continue; + } + auto const previousEpoch = m_receiveConsumer.epoch (); + if (!m_receiveConsumer.accept (block, dec_data)) + { +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) + if (m_automated_test) + { + Q_EMIT liveAudioTestReceiveRejected (block->end ()); + Q_EMIT liveAudioTestReceiveRange (block->epoch, block->start, block->end (), false); + } +#endif + continue; + } + if (previousEpoch != m_receiveConsumer.epoch ()) m_referenceInput.reset (); + auto const frames = block->end (); +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) + if (m_automated_test) + Q_EMIT liveAudioTestReceiveRange (block->epoch, block->start, frames, true); + if (m_automated_test && frames > 0 + && isSignalConnected (QMetaMethod::fromSignal ( + &MainWindow::liveAudioTestReceiveCallback))) + { + QMutexLocker lock {&dec_data_mutex ()}; + auto const currentFrames = qint64 {block->sourceFrames ()}; + auto const sample = frames <= currentFrames + ? dec_data.d2[frames - 1] : qint16 {0}; + Q_EMIT liveAudioTestReceiveCallback (frames, currentFrames, sample); + } +#endif + m_activeReceiveAudio = block; + dataSink (frames); + m_activeReceiveAudio.reset (); + } + m_receivingAudio = false; + }; + connect (m_detector, &Detector::audioBlock, this, + [this, live_data_sink] (ReceiveAudio audio) { + if (!m_tci_audio) live_data_sink (std::move (audio)); + }); connect (&m_audioThread, &QThread::finished, m_detector, &QObject::deleteLater); // setup the waterfall connect(m_wideGraph.data (), SIGNAL(freezeDecode2(int)),this,SLOT(freezeDecode(int))); connect(m_wideGraph.data (), SIGNAL(f11f12(int)),this,SLOT(bumpFqso(int))); connect(m_wideGraph.data (), SIGNAL(setXIT2(int)),this,SLOT(setXIT(int))); + connect(m_wideGraph.data (), SIGNAL(jttyDecodeAgainAt2(float)),this,SLOT(jttyDecodeAgainAt(float))); m_wideGraph->setReferenceSpectrumAvailable( QFile::exists(m_config.writeable_data_dir ().absoluteFilePath ("refspec.dat"))); @@ -651,6 +938,14 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, // hook up the log book connect (&m_logBook, &LogBook::finished_loading, [this] (int record_count, QString cty_version, QString const& error) { + if (!m_startup_logbook_reported) + { + m_startup_logbook_reported = true; + PerformanceTrace::milestone ( + m_startup_trace_run, "logbook.ready", + QString {"status=%1 unique_entries=%2"} + .arg (error.isEmpty () ? "ok" : "error").arg (record_count)); + } if (error.size ()) { MessageBox::warning_message (this, tr ("Error Scanning ADIF Log"), error); @@ -664,6 +959,10 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, // Network message handlers m_messageClient->enable (m_config.accept_udp_requests ()); + connect (m_messageClient, &MessageClient::tx_inhibit_command, + &m_config, &Configuration::tx_inhibit_command); + connect (m_messageClient, &MessageClient::tx_inhibit_invalid, + &m_config, &Configuration::tx_inhibit_invalid); connect (m_messageClient, &MessageClient::clear_decodes, [this] (quint8 window) { ++window; if (window & 1) @@ -690,13 +989,17 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, }); connect (m_messageClient, &MessageClient::error, this, &MainWindow::networkError); connect (m_messageClient, &MessageClient::free_text, [this] (QString const& text, bool send) { + if (!MainWindow::message_alphabet.exactMatch (text)) { + qWarning () << "Ignoring UDP FreeText request with invalid message characters"; + return; + } tx_watchdog (false); // send + non-empty text means set and send the free text // message, !send + non-empty text means set the current free // text message, send + empty text means send the current free // text message without change, !send + empty text means clear // the current free text message - if (0 == ui->tabWidget->currentIndex ()) { + if (standard_messages_tab_index == ui->tabWidget->currentIndex ()) { if (!text.isEmpty ()) { ui->tx5->setCurrentText (text); } @@ -731,6 +1034,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, ui->actionJT4->setActionGroup(modeGroup); ui->actionWSPR->setActionGroup(modeGroup); ui->actionEcho->setActionGroup(modeGroup); + ui->actionJTTY->setActionGroup(modeGroup); ui->actionMSK144->setActionGroup(modeGroup); ui->actionQ65->setActionGroup(modeGroup); ui->actionFreqCal->setActionGroup(modeGroup); @@ -793,6 +1097,28 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, ui->actionMT11->setActionGroup(FT8threadsGroup); ui->actionMT12->setActionGroup(FT8threadsGroup); + auto resetFt8Backpressure = [this] (QAction *) { + cancelPendingFt8Decode ("decoder setting changed"); + }; + connect (DepthGroup, &QActionGroup::triggered, this, resetFt8Backpressure); + connect (FT8CyclesGroup, &QActionGroup::triggered, this, resetFt8Backpressure); + connect (FT8RXfreqSensitivityGroup, &QActionGroup::triggered, + this, resetFt8Backpressure); + connect (FT8DecoderSensitivityGroup, &QActionGroup::triggered, + this, resetFt8Backpressure); + connect (FT8DecoderStartGroup, &QActionGroup::triggered, + this, resetFt8Backpressure); + connect (FT8threadsGroup, &QActionGroup::triggered, + this, resetFt8Backpressure); + connect (ui->actionUse_multithreaded_FT8_decoder, &QAction::toggled, + this, [this] {cancelPendingFt8Decode ("FT8 decoder changed");}); + connect (ui->actionFT8WidebandDXCallSearch, &QAction::toggled, + this, [this] {cancelPendingFt8Decode ("FT8 decoder changed");}); + connect (ui->actionHide_FT8_dupe_messages, &QAction::toggled, + this, [this] {cancelPendingFt8Decode ("FT8 decoder changed");}); + connect (ui->actionEnable_AP_FT8, &QAction::toggled, + this, [this] {cancelPendingFt8Decode ("FT8 decoder changed");}); + connect (ui->download_samples_action, &QAction::triggered, [this] () { if (!m_sampleDownloader) { @@ -817,15 +1143,8 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, MessageBox::warning_message (this, tr ("Error Loading LotW Users Data"), reason); }, Qt::QueuedConnection); - QButtonGroup* txMsgButtonGroup = new QButtonGroup {this}; - txMsgButtonGroup->addButton(ui->txrb1,1); - txMsgButtonGroup->addButton(ui->txrb2,2); - txMsgButtonGroup->addButton(ui->txrb3,3); - txMsgButtonGroup->addButton(ui->txrb4,4); - txMsgButtonGroup->addButton(ui->txrb5,5); - txMsgButtonGroup->addButton(ui->txrb6,6); set_dateTimeQSO(-1); - connect(txMsgButtonGroup,SIGNAL(buttonClicked(int)),SLOT(set_ntx(int))); + connect (m_tx_message_button_group, SIGNAL (buttonClicked (int)), SLOT (set_ntx (int))); connect (ui->decodedTextBrowser, &DisplayText::selectCallsign, this, &MainWindow::doubleClickOnCall2); connect (ui->decodedTextBrowser2, &DisplayText::selectCallsign, this, &MainWindow::doubleClickOnCall); connect (ui->houndQueueTextBrowser, &DisplayText::selectCallsign, this, &MainWindow::doubleClickOnFoxQueue); @@ -834,10 +1153,8 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, connect (ui->decodedTextBrowser2, &DisplayText::erased, this, &MainWindow::rx_frequency_activity_cleared); connect (ui->decodedTextBrowser->horizontalScrollBar(),SIGNAL(sliderMoved(int)),SLOT(ScrollBarPosition(int))); - // initialize decoded text font and hook up font change signals - // defer initialization until after construction otherwise menu fonts do not get set - // with 50 ms delay we are on the safe side - QTimer::singleShot (50, this, SLOT (initialize_fonts ())); + // Native menu fonts require a refresh after main window construction. + QTimer::singleShot (0, this, SLOT (initialize_fonts ())); connect (&m_config, &Configuration::text_font_changed, [this] (QFont const& font) { set_application_font (font); }); @@ -845,23 +1162,86 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, setDecodedTextFont (font); }); - setWindowTitle (program_title ()); + setWindowTitle (branded_program_title ()); + connect(&proc_jt9, &QProcess::started, this, [this] { + if (!m_startup_decoder_reported) + { + m_startup_decoder_reported = true; + PerformanceTrace::milestone (m_startup_trace_run, "decoder.process_started"); + } + if (Jt9ProcessPhase::InitialStarting == m_jt9ProcessPhase + || Jt9ProcessPhase::ReplacementStarting == m_jt9ProcessPhase) + { + m_decoderStartTimer.stop (); + m_decoderCompletedSinceStart = false; + m_jt9ProcessPhase = Jt9ProcessPhase::Ready; + updateDecodeControls (); + QTimer::singleShot (0, this, [this] { + auto const pendingResult = publishPendingFt8Decode (); + if (DecodePublishResult::Failed == pendingResult) + { + requestDecoderRestart ( + "pending FT8 decode publication failed after restart"); + } + }); + } + }); connect(&proc_jt9, &QProcess::readyReadStandardOutput, this, &MainWindow::readFromStdout); + connect(&proc_jt9, &QProcess::started, this, &MainWindow::decoderBackendStarted); #if QT_VERSION < QT_VERSION_CHECK (5, 6, 0) connect(&proc_jt9, static_cast (&QProcess::error), [this] (QProcess::ProcessError error) { + if ((Jt9ProcessPhase::StopRequested == m_jt9ProcessPhase + || Jt9ProcessPhase::Terminating == m_jt9ProcessPhase + || Jt9ProcessPhase::Killing == m_jt9ProcessPhase) + && QProcess::Crashed == error) return; + Q_EMIT decoderBackendFailed (proc_jt9.errorString ()); subProcessError (&proc_jt9, error); }); #else connect(&proc_jt9, &QProcess::errorOccurred, [this] (QProcess::ProcessError error) { + if ((Jt9ProcessPhase::StopRequested == m_jt9ProcessPhase + || Jt9ProcessPhase::Terminating == m_jt9ProcessPhase + || Jt9ProcessPhase::Killing == m_jt9ProcessPhase) + && QProcess::Crashed == error) return; + Q_EMIT decoderBackendFailed (proc_jt9.errorString ()); subProcessError (&proc_jt9, error); }); #endif connect(&proc_jt9, static_cast (&QProcess::finished), [this] (int exitCode, QProcess::ExitStatus status) { - if (subProcessFailed (&proc_jt9, exitCode, status)) + if (m_closing) return; + if (decoderRestartInProgress ()) + { + m_decoderShutdownTimer.stop (); + m_decoderTerminateTimer.stop (); + m_decoderKillTimer.stop (); + m_decoderStartTimer.stop (); + proc_jt9.readAllStandardOutput (); + proc_jt9.readAllStandardError (); + if (!initializeDecoderSharedMemory ()) + { + m_valid = false; + QTimer::singleShot (0, this, SLOT (close ())); + return; + } + m_jt9PayloadValid = false; + m_activeJt9Decode = {}; + m_decoderOutputFramer.reset (); + startDecoderProcess (); + return; + } + auto const failed = subProcessFailed (&proc_jt9, exitCode, status); + if (!failed && m_valid) { + MessageBox::critical_message (this, tr ("Decoder Error"), + tr ("The decoder subprocess exited unexpectedly.")); + } + if (m_valid) + { + Q_EMIT decoderBackendFailed ( + tr ("jt9 exited unexpectedly with code %1.").arg (exitCode)); m_valid = false; // ensures exit if still // constructing QTimer::singleShot (0, this, SLOT (close ())); @@ -930,7 +1310,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, }); // hook up save WAV file exit handling - connect (&m_saveWAVWatcher, &QFutureWatcher::finished, [this] { + connect (&m_saveWAVWatcher, &QFutureWatcher::finished, this, [this] { // extract the promise from the future auto const& result = m_saveWAVWatcher.future ().result (); if (!result.isEmpty ()) // error @@ -947,20 +1327,33 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, auto band_validator = new LiveFrequencyValidator {ui->bandComboBox , m_config.bands () , m_config.frequencies () - , &m_freqNominal + , &m_operatingFrequency.rx () , m_config.kHz_without_k () , this}; ui->bandComboBox->setValidator (band_validator); // Hook up signals. - connect (band_validator, &LiveFrequencyValidator::valid, this, &MainWindow::band_changed); + connect (band_validator, &LiveFrequencyValidator::valid, this, [this] (Frequency frequency) { + requestBandChange (frequency, FrequencyRequestOrigin::User); + }); connect (ui->bandComboBox->lineEdit (), &QLineEdit::textEdited, [this] (QString const&) {m_bandEdited = true;}); // hook up configuration signals connect (&m_config, &Configuration::leavingSettings, this, &MainWindow::handle_leavingSettings); connect (&m_config, &Configuration::transceiver_update, this, &MainWindow::handle_transceiver_update); - connect (&m_config, &Configuration::transceiver_TCIframesWritten, this, &MainWindow::dataSink); + connect (&m_config, &Configuration::transceiverReceiveAudio, this, + [this, live_data_sink] (ReceiveAudio audio) { + if (m_tci_audio) live_data_sink (std::move (audio)); + }); connect (&m_config, &Configuration::transceiver_TCImodActive, this, &MainWindow::tci_mod_active); + connect (&m_config, &Configuration::txSourceCommitted, + this, &MainWindow::recordTxSourceCommit, Qt::QueuedConnection); + connect (&m_config, &Configuration::rawTxPlayoutSnapshot, + this, &MainWindow::recordRawTxPlayout, Qt::QueuedConnection); + connect (&m_config, &Configuration::transceiver_jtty_drained, this, &MainWindow::onJttyBackendDrained); + connect (&m_config, &Configuration::transceiver_jtty_enqueue_accepted, this, &MainWindow::onJttyBackendEnqueueAccepted); + connect (&m_config, &Configuration::transceiver_jtty_enqueue_failed, this, &MainWindow::onJttyBackendEnqueueFailed); + connect (&m_config, &Configuration::transceiver_closing, this, &MainWindow::handle_transceiver_closing); connect (&m_config, &Configuration::transceiver_failure, this, &MainWindow::handle_transceiver_failure); connect (&m_config, &Configuration::udp_server_changed, m_messageClient, &MessageClient::set_server); connect (&m_config, &Configuration::udp_server_port_changed, m_messageClient, &MessageClient::set_server_port); @@ -981,13 +1374,16 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, } if (!programStart) { // set programStart to true for 2 seconds when changing Configurations programStart = true; - QTimer::singleShot (2000, [=] {programStart=false;}); + QTimer::singleShot (2000, this, [=] {programStart=false;}); } statusUpdate (); #if defined(Q_OS_WIN) - QTimer::singleShot (250, [=] { - setRig (m_lastMonitoredFrequency); // This is needed for Hamradio Deluxe - m_msk144basefreq = m_lastMonitoredFrequency; // This is needed for Hamradio Deluxe + QTimer::singleShot (250, this, [=] { + if (requestNominalFrequencyChange ( + m_operatingFrequency.remembered (), FrequencyRequestOrigin::Automatic)) + { + m_msk144basefreq = m_operatingFrequency.remembered (); // This is needed for Hamradio Deluxe + } }); #endif }); @@ -996,12 +1392,12 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, , QMessageBox::ActionRole); // set up message text validators - ui->tx1->setValidator (new QRegExpValidator {message_alphabet, this}); - ui->tx2->setValidator (new QRegExpValidator {message_alphabet, this}); - ui->tx3->setValidator (new QRegExpValidator {message_alphabet, this}); - ui->tx4->setValidator (new QRegExpValidator {message_alphabet, this}); - ui->tx5->setValidator (new QRegExpValidator {message_alphabet, this}); - ui->tx6->setValidator (new QRegExpValidator {message_alphabet, this}); + ui->tx1->setValidator (new QRegExpValidator {MainWindow::message_alphabet, this}); + ui->tx2->setValidator (new QRegExpValidator {MainWindow::message_alphabet, this}); + ui->tx3->setValidator (new QRegExpValidator {MainWindow::message_alphabet, this}); + ui->tx4->setValidator (new QRegExpValidator {MainWindow::message_alphabet, this}); + ui->tx5->setValidator (new QRegExpValidator {MainWindow::message_alphabet, this}); + ui->tx6->setValidator (new QRegExpValidator {MainWindow::message_alphabet, this}); // Free text macros model to widget hook up. ui->tx5->setModel (m_config.macros ()); @@ -1010,6 +1406,41 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, connect(&m_guiTimer, &QTimer::timeout, this, &MainWindow::guiUpdate); m_guiTimer.start(100); //### Don't change the 100 ms! ### + m_decoderShutdownTimer.setSingleShot (true); + connect (&m_decoderShutdownTimer, &QTimer::timeout, this, [this] { + if (Jt9ProcessPhase::StopRequested != m_jt9ProcessPhase + || QProcess::NotRunning == proc_jt9.state ()) return; + m_jt9ProcessPhase = Jt9ProcessPhase::Terminating; + proc_jt9.terminate (); + m_decoderTerminateTimer.start (1000); + }); + m_decoderTerminateTimer.setSingleShot (true); + connect (&m_decoderTerminateTimer, &QTimer::timeout, this, [this] { + if (Jt9ProcessPhase::Terminating != m_jt9ProcessPhase + || QProcess::NotRunning == proc_jt9.state ()) return; + m_jt9ProcessPhase = Jt9ProcessPhase::Killing; + proc_jt9.kill (); + m_decoderKillTimer.start (2000); + }); + m_decoderKillTimer.setSingleShot (true); + connect (&m_decoderKillTimer, &QTimer::timeout, this, [this] { + if (Jt9ProcessPhase::Killing != m_jt9ProcessPhase + || QProcess::NotRunning == proc_jt9.state ()) return; + MessageBox::critical_message (this, tr ("Decoder Error"), + tr ("The decoder subprocess could not be stopped.")); + m_valid = false; + QTimer::singleShot (0, this, SLOT (close ())); + }); + m_decoderStartTimer.setSingleShot (true); + connect (&m_decoderStartTimer, &QTimer::timeout, this, [this] { + if (Jt9ProcessPhase::ReplacementStarting != m_jt9ProcessPhase + || QProcess::Running == proc_jt9.state ()) return; + MessageBox::critical_message (this, tr ("Decoder Error"), + tr ("The decoder subprocess could not be restarted.")); + m_valid = false; + QTimer::singleShot (0, this, SLOT (close ())); + }); + stopWRTimer.setSingleShot(true); connect(&stopWRTimer, &QTimer::timeout, this, &MainWindow::stopWRTimeout); @@ -1022,6 +1453,12 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, ptt1Timer.setSingleShot(true); connect(&ptt1Timer, &QTimer::timeout, this, &MainWindow::startTx2); + m_jttyTxWatchdog.setSingleShot(true); + connect(&m_jttyTxWatchdog, &QTimer::timeout, this, &MainWindow::handleJttyTxWatchdog); + + m_refSpecTimer.setInterval(1000); + connect(&m_refSpecTimer, &QTimer::timeout, this, &MainWindow::updateReferenceSpectrumCountdown); + p1Timer.setSingleShot(true); connect(&p1Timer, &QTimer::timeout, this, &MainWindow::startP1); @@ -1031,14 +1468,21 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, tuneButtonTimer.setSingleShot(true); connect(&tuneButtonTimer, &QTimer::timeout, this, &MainWindow::end_tuning); + rigTuneTimer.setSingleShot (true); + connect (&rigTuneTimer, &QTimer::timeout, this, [this] { + m_config.transceiver_tune (false); + ui->tuneButton->setChecked (false); + ui->tuneButton->setText ("Tune"); + }); + tuneATU_Timer.setSingleShot(true); connect(&tuneATU_Timer, &QTimer::timeout, this, &MainWindow::stopTuneATU); killFileTimer.setSingleShot(true); - connect(&killFileTimer, &QTimer::timeout, this, &MainWindow::killFile); + connect(&killFileTimer, &QTimer::timeout, this, &MainWindow::killWaveFile); uploadTimer.setSingleShot(true); - connect(&uploadTimer, &QTimer::timeout, [this] () {uploadWSPRSpots ();}); + connect(&uploadTimer, &QTimer::timeout, [this] () {uploadWSPRSpots ("FST4W" == m_mode);}); TxAgainTimer.setSingleShot(true); connect(&TxAgainTimer, SIGNAL(timeout()), this, SLOT(TxAgain())); @@ -1046,7 +1490,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, connect(m_wideGraph.data (), SIGNAL(setFreq3(int,int)),this, SLOT(setFreq4(int,int))); - decodeBusy(false); + updateDecodeControls (); m_msg[0][0]=0; @@ -1056,11 +1500,13 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, auto dBm = int ((10. * i / 3.) + .5); ui->TxPowerComboBox->addItem (QString {"%1 dBm %2"}.arg (dBm).arg (power[i]), dBm); } - ui->respondComboBox->addItem("CQ: None"); - ui->respondComboBox->addItem("CQ: First"); - ui->respondComboBox->addItem("CQ: Max Dist"); - ui->respondComboBox->addItem("CQ: Max dB"); - ui->respondComboBox->addItem("CQ: Min dB"); + ui->respondComboBox->addItem(tr ("CQ: None"), static_cast (AutoRespondPolicy::None)); + ui->respondComboBox->addItem(tr ("CQ: First"), static_cast (AutoRespondPolicy::First)); + ui->respondComboBox->addItem(tr ("CQ: Max Dist"), static_cast (AutoRespondPolicy::MaxDistance)); + ui->respondComboBox->addItem(tr ("CQ: Max dB"), static_cast (AutoRespondPolicy::MaxSignal)); + ui->respondComboBox->addItem(tr ("CQ: Min dB"), static_cast (AutoRespondPolicy::MinSignal)); + + RoundRobinSelection::initialize (*ui->RoundRobin, tr ("Random")); m_dateTimeRcvdRR73=QDateTime::currentDateTimeUtc(); m_dateTimeSentTx3=QDateTime::currentDateTimeUtc(); @@ -1068,9 +1514,19 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, ui->labAz->setStyleSheet("border: 0px;"); ui->labAz->setText(""); auto t = "UTC dB DT Freq " + tr ("Message"); - ui->lh_decodes_headings_label->setText(t); - ui->rh_decodes_headings_label->setText(t); + setDecodeHeadings(t, t); + ui_initialize.finish (); + PerformanceTrace::Phase settings_restore {m_startup_trace_run, "mainwindow.settings_restore"}; readSettings(); //Restore user's setup parameters + settings_restore.finish (); + PerformanceTrace::Phase runtime_initialize {m_startup_trace_run, "mainwindow.runtime_initialize"}; + connect (ui->respondComboBox, QOverload::of (&QComboBox::currentIndexChanged), this, + [this] (int) { + if (AutoRespondPolicy::None == autoRespondPolicy()) { + m_autoRespondPeriodState.disarm(); + } + check_button_color(); + }); if(m_mode=="Q65") { m_score=0; read_log(); @@ -1107,76 +1563,71 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, } } - to_jt9(0,0,0); //initialize IPC variables - - QStringList jt9_args { - "-s", QApplication::applicationName () // shared memory key, - // includes rig -#ifdef NDEBUG - , "-w", "1" //FFTW patience - release -#else - , "-w", "1" //FFTW patience - debug builds for speed -#endif - // The number of threads for FFTW specified here is chosen as - // three because that gives the best throughput of the large - // FFTs used in jt9. The count is the minimum of (the number - // available CPU threads less one) and three. This ensures that - // there is always at least one free CPU thread to run the other - // mode decoder in parallel. - , "-m", QString::number (qMin (qMax (QThread::idealThreadCount () - 1, 1), 3)) //FFTW threads - - , "-e", QDir::toNativeSeparators (m_appDir) - , "-a", QDir::toNativeSeparators (m_config.writeable_data_dir ().absolutePath ()) - , "-t", QDir::toNativeSeparators (m_config.temp_dir ().absolutePath ()) - // -r: read-only shipped-data dir (cty.dat, ALLCALL7.TXT, ...) for the - // Fortran decoder; resolves to Contents/Resources/wsjtx on macOS. - , "-r", QDir::toNativeSeparators (m_config.data_dir ().absolutePath ()) - }; - QProcessEnvironment new_env {m_env}; - new_env.insert ("OMP_STACKSIZE", "10M"); - proc_jt9.setProcessEnvironment (new_env); - proc_jt9.start(QDir::toNativeSeparators (m_appDir) + QDir::separator () + - "jt9", jt9_args, QIODevice::ReadWrite | QIODevice::Unbuffered); + { + PerformanceTrace::Phase decoder_start {m_startup_trace_run, "decoder.start_request"}; + startDecoderProcess (); + } - auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir ().absoluteFilePath ("wsjtx_wisdom.dat"))}; - fftwf_import_wisdom_from_filename (fname.toLocal8Bit ()); + { + PerformanceTrace::Phase wisdom_import {m_startup_trace_run, "fft_wisdom.import"}; + auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir ().absoluteFilePath ("wsjtx_wisdom.dat"))}; + fftwf_import_wisdom_from_filename (fname.toLocal8Bit ()); + } m_ntx = 6; ui->txrb6->setChecked(true); - connect (&m_wav_future_watcher, &QFutureWatcher::finished, this, &MainWindow::diskDat); - - connect(&watcher3, SIGNAL(finished()),this,SLOT(fast_decode_done())); + connect (&m_wav_load_coordinator, &WavLoadCoordinator::loadingChanged, + this, [this] (bool) { + updateDecodeControls (); + }); + connect (&m_wav_load_coordinator, &WavLoadCoordinator::resultReady, + this, &MainWindow::wav_file_loaded); + + connect (&watcher3, &QFutureWatcher::finished, this, [this] { + auto const result = watcher3.result (); + std::copy (result.arguments.begin (), result.arguments.end (), narg); + std::memcpy (m_msg, result.messages.data (), sizeof m_msg); + m_fastDecodePending = false; + fast_decode_done (); + }); m_tci = m_config.is_tci(); m_tci_audio = (m_config.tci_audio() && m_config.is_tci()); - if (!m_tci_audio) { - if (!m_config.audio_input_device ().isNull ()) - { - Q_EMIT startAudioInputStream (m_config.audio_input_device () - , m_rx_audio_buffer_frames - , m_detector, m_downSampleFactor, m_config.audio_input_channel ()); - } - if (!m_config.audio_output_device ().isNull ()) - { - Q_EMIT initializeAudioOutputStream (m_config.audio_output_device () - , AudioDevice::Mono == m_config.audio_output_channel () ? 1 : 2 - , m_tx_audio_buffer_frames); - } - Q_EMIT transmitFrequency (ui->TxFreqSpinBox->value () - m_XIT); + { + PerformanceTrace::Phase audio_start {m_startup_trace_run, "audio.start_request"}; + if (!m_tci_audio) { + Q_EMIT startAudioInputStream (m_config.audio_input_device () + , m_rx_audio_buffer_frames + , m_detector, m_downSampleFactor, m_config.audio_input_channel ()); + if (!m_config.audio_output_device ().isNull ()) + { + Q_EMIT initializeAudioOutputStream (m_config.audio_output_device () + , AudioDevice::Mono == m_config.audio_output_channel () ? 1 : 2 + , m_tx_audio_buffer_frames); + } + Q_EMIT transmitFrequency (ui->TxFreqSpinBox->value () - m_XIT); + } } - enable_DXCC_entity (m_config.DXCC ()); // sets text window proportions and (re)inits the logbook + { + PerformanceTrace::Phase logbook_initialize {m_startup_trace_run, "logbook.initialize_request"}; + enable_DXCC_entity (m_config.DXCC ()); // sets text window proportions and (re)inits the logbook + } // this must be done before initializing the mode as some modes need // to turn off split on the rig e.g. WSPR - m_config.transceiver_online (); + { + PerformanceTrace::Phase rig_start {m_startup_trace_run, "rig.start_request"}; + m_config.transceiver_online (); + } bool vhf {m_config.enable_VHF_features ()}; ui->txFirstCheckBox->setChecked(m_txFirst); morse_(const_cast (m_config.my_callsign ().toLatin1().constData()), const_cast (icw), &m_ncw, (FCL)m_config.my_callsign().length()); + PerformanceTrace::Phase mode_initialize {m_startup_trace_run, "mode.initialize"}; on_actionWide_Waterfall_triggered(); ui->cbShMsgs->setChecked(m_bShMsgs); ui->cbSWL->setChecked(m_bSWL); @@ -1188,10 +1639,15 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, // Ensure that the correct frequency is set and displayed if(m_mode=="Echo") { - QTimer::singleShot (5000, [=] { - auto const& row = m_config.frequencies ()->best_working_frequency (m_freqNominal); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); + QTimer::singleShot (5000, this, [=] { + auto const& row = m_config.frequencies ()->best_working_frequency (m_operatingFrequency.rx ()); + Frequency frequency; + if (workingFrequencyAt (row, frequency) + && nominalFrequencyChangeAllowed (FrequencyRequestOrigin::Automatic)) + { + ui->bandComboBox->setCurrentIndex (row); + requestBandChange (frequency, FrequencyRequestOrigin::Automatic); + } if (m_monitoring) ui->monitorButton->click(); }); } @@ -1200,7 +1656,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, if(m_mode=="MSK144") { if (m_tci_audio) { - QTimer::singleShot (5000, [=] { + QTimer::singleShot (5000, this, [=] { if (ui->bandComboBox->currentText()!="OOB") { Q_EMIT m_config.transceiver_trfrequency(1000.0); } else { @@ -1212,7 +1668,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, } } else { if (m_tci_audio) { - QTimer::singleShot (5000, [=] { + QTimer::singleShot (5000, this, [=] { if (ui->bandComboBox->currentText()!="OOB") { Q_EMIT m_config.transceiver_trfrequency(ui->TxFreqSpinBox->value () - m_XIT); } else { @@ -1226,27 +1682,9 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, if(m_tci_audio) { - QTimer::singleShot (5000, [=] { - int attVal = ui->outAttenuation->value(); - ui->outAttenuation->setValue(0); - ui->outAttenuation->setValue(attVal); + QTimer::singleShot (5000, this, [=] { + sync_tci_tx_volume (true); Q_EMIT m_config.transceiver_volume(m_config.volume()); - // set_mode() in the constructor emits transceiver_period() while the TCI - // rig is still offline, so TransceiverBase::set() skips do_period() and - // TCITransceiver's m_period stays at its 15.0 s default. For any mode - // whose TR period != 15 s (FT4, MSK144, Q65-15, FST4-15, ...) the - // modulator then computes against 15000 ms and readAudioData emits - // silence for the whole transmission (panadapter shows energy, no audio - // reaches the air). Re-emit the period here, now that TCI is connected. - // That same offline set_mode() also left m_TRperiod cached in - // Configuration even though the rig never applied it, so force=true - // bypasses Configuration's period de-dup and guarantees the resync - // regardless of TCI bring-up timing. - // OOB guard matches on_actionFT4_triggered() and the other mode handlers. - // Hardens public PR WSJTX/wsjtx#21 (Ramon Martinez, rampa069) for the - // Configuration de-dup cache. - if (ui->bandComboBox->currentText()!="OOB") - Q_EMIT m_config.transceiver_period(m_TRperiod, true); }); } @@ -1270,7 +1708,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_bNoMoreFiles=false; m_bDoubleClicked=false; m_bCallingCQ=false; - m_bCheckedContest=false; + m_contestModeHintShown=false; m_bDisplayedOnce=false; m_wait=0; m_isort=-3; @@ -1286,6 +1724,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, m_fastGraph->setMode(m_mode); m_wideGraph->setMode(m_mode); + mode_initialize.finish (); connect (&minuteTimer, &QTimer::timeout, this, &MainWindow::bandHoppingTimer); connect (&minuteTimer, &QTimer::timeout, this, &MainWindow::on_the_minute); @@ -1298,11 +1737,6 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, splashTimer.setSingleShot (true); splashTimer.start (20 * 1000); - if(QCoreApplication::applicationVersion().contains("-devel") or - QCoreApplication::applicationVersion().contains("-rc")) { -// QTimer::singleShot (0, this, SLOT (not_GA_warning_message ())); - } - m_bMyCallStd=stdCall(m_config.my_callsign ()); //ft8md m_bHisCallStd=stdCall(m_hisCall); //ft8md @@ -1311,24 +1745,39 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, // Starting in FT8 Hound mode needs this initialization if (m_specOp==SpecOp::HOUND) { on_ft8Button_clicked(); - QTimer::singleShot (50, [=] {ui->houndButton->click();}); + QTimer::singleShot (50, this, [=] {ui->houndButton->click();}); } - ui->labDXped->setVisible(SpecOp::NONE != m_specOp); - ui->labDXped->setStyleSheet("QLabel {background-color: red; color: white;}"); + auto const activityLabel = specOpLabel(); + ui->labDXped->setText(activityLabel); + ui->labDXped->setVisible(!activityLabel.isEmpty()); + updateHoundVerificationStyle (); ui->pbBestSP->setVisible(m_mode=="FT4"); update_foxLogWindow_rate(); // update the rate on the window check_button_color(); - read_txLog(); - read_ignoreList(); - read_ALLCALL7(); + { + PerformanceTrace::Phase tx_log_load {m_startup_trace_run, "tx_log.load"}; + read_txLog(); + } + { + PerformanceTrace::Phase ignore_list_load {m_startup_trace_run, "ignore_list.load"}; + read_ignoreList(); + } + { + PerformanceTrace::Phase allcall_load {m_startup_trace_run, "allcall.load"}; + read_ALLCALL7(); + } if (ui->actionRemove_after_30days->isChecked ()) { + PerformanceTrace::Phase saved_audio_cleanup {m_startup_trace_run, "saved_audio.cleanup"}; remove_old_files(m_config.save_directory().absolutePath(), 30); // remove saved audio files after 30 days } - QString jpleph = m_config.data_dir().absoluteFilePath("JPLEPH"); - jpl_setup_(const_cast(jpleph.toLocal8Bit().constData()),256); + { + PerformanceTrace::Phase ephemeris_initialize {m_startup_trace_run, "jpl_ephemeris.initialize"}; + QString jpleph = m_config.data_dir().absoluteFilePath("JPLEPH"); + jpl_setup_(const_cast(jpleph.toLocal8Bit().constData()),256); + } #ifdef WIN32 // backup libhamlib-4.dll file, so it is still available after the next program update @@ -1336,7 +1785,7 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, QFile f {dataPath.absolutePath() + "/" + "libhamlib-4_old.dll"}; if (!f.exists()) { QFile::copy(dataPath.absolutePath() + "/" + "libhamlib-4.dll", dataPath.absolutePath() + "/" + "libhamlib-4_old.dll"); - QTimer::singleShot (5000, [=] { //wait until hamlib has been started + QTimer::singleShot (5000, this, [=] { //wait until hamlib has been started extern char* hamlib_version2; QString hamlib = QString(QLatin1String(hamlib_version2)); m_settings->beginGroup("Configuration"); @@ -1345,26 +1794,14 @@ MainWindow::MainWindow(QDir const& temp_directory, bool multiple, }); } #endif - ui->sbToneSpacing->values({10, 15, 20, 25, 30}); - QTimer::singleShot (4000, [=] {programStart=false;}); + QTimer::singleShot (4000, this, [=] {programStart=false;}); // this must be the last statement of constructor + runtime_initialize.finish (); if (!m_valid) throw std::runtime_error {"Fatal initialization exception"}; } -void MainWindow::not_GA_warning_message () -{ - MessageBox::critical_message (this, - "This is a pre-release version of WSJT-X " + version (false) + " made\n" - "available for testing purposes. By design it will\n" - "be nonfunctional after Jan 15, 2025."); - auto now = QDateTime::currentDateTimeUtc (); - if (now >= QDateTime {{2025, 01, 15}, {23, 59, 59, 999}, Qt::UTC}) { - Q_EMIT finished (); - } -} - void MainWindow::handle_leavingSettings () { inSettings = false; @@ -1413,259 +1850,302 @@ void MainWindow::on_the_minute () tx_watchdog (false); } update_foxLogWindow_rate(); // update the rate on the window - if ((!verified && ui->labDXped->isVisible()) or !ui->labDXped->text().contains("Hound")) - ui->labDXped->setStyleSheet("QLabel {background-color: red; color: white;}"); - verified = false; + updateHoundVerificationStyle (); + m_houndVerified = false; if(!m_transmitting && m_mode=="FT8" && (QDateTime::currentMSecsSinceEpoch()-m_mslastTX) > 120000) m_lapmyc=0; } + + //--------------------------------------------------- MainWindow destructor MainWindow::~MainWindow() { + PerformanceTrace::Phase destructor {"mainwindow.destructor_body"}; + // wav12 shares FFT state that main() releases after this window is destroyed. + { + PerformanceTrace::Phase wav_load_wait {"wav_load.shutdown_wait"}; + m_wav_load_coordinator.waitForFinished (); + } if(m_astroWidget) m_astroWidget.reset (); if(m_QSYMessageCreatorWidget) m_QSYMessageCreatorWidget.reset (); if(m_QSYMessageWidget) m_QSYMessageWidget.reset (); if(m_qsymonitorWidget) m_qsymonitorWidget.reset (); - auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir ().absoluteFilePath ("wsjtx_wisdom.dat"))}; - fftwf_export_wisdom_to_filename (fname.toLocal8Bit ()); - m_audioThread.quit (); - m_audioThread.wait (); + { + PerformanceTrace::Phase wisdom_export {"fft_wisdom.export"}; + auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir ().absoluteFilePath ("wsjtx_wisdom.dat"))}; + fftwf_export_wisdom_to_filename (fname.toLocal8Bit ()); + } + { + PerformanceTrace::Phase audio_shutdown {"audio_thread.shutdown"}; + m_audioThread.quit (); + m_audioThread.wait (); + } + { + PerformanceTrace::Phase wav_save_wait {"wav_save.shutdown_wait"}; + m_saveWAVSynchronizer.waitForFinished (); + } + m_saveWAVSynchronizer.clearFutures (); remove_child_from_event_filter (this); - memset(ipc_qmap,0,4096); //Zero all of QMAP shared memory -} - -//-------------------------------------------------------- writeSettings() -void MainWindow::writeSettings() -{ - m_settings->beginGroup("MainWindow"); - if (ui->actionSWL_Mode->isChecked ()) + if (ipc_qmap && mem_qmap.isAttached () && mem_qmap.lock ()) { + clearQMapSharedMemory (ipc_qmap, + static_cast (mem_qmap.size ())); + mem_qmap.unlock (); + } +// Force linking of Fortran function stdmsg(). + QString t="1234567890123456789012345678901234567"; + if(stdmsg_(const_cast (t.toLatin1().constData()),(FCL)37)) return; +} + +void MainWindow::configureModeControlsLayout() +{ + ui->lower_panel_widget->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Maximum); + ui->horizontalLayout_6->setStretch (0, 0); + ui->horizontalLayout_6->setStretch (1, 1); + ui->tabWidget->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding); + + QPushButton * compactButtons[] = { + ui->lookupButton, ui->addButton, ui->ignoreButton, + ui->txb1, ui->txb2, ui->txb3, ui->txb4, ui->txb5, ui->txb6 + }; + for (auto * button : compactButtons) button->setProperty ("wsjtxCompact", true); + + // A designer minimum of 32 overrides the font/style minimumSizeHint and + // clips FT8/JT65 at larger fonts. Let the layout use the real label hints. + for (auto * button : {ui->houndButton, ui->ft8Button, ui->ft4Button, + ui->msk144Button, ui->q65Button, ui->jt65Button}) + button->setMinimumWidth (0); + + ui->horizontalLayout_2->setSpacing (2); + ui->gridLayout_5->removeWidget (ui->label); + ui->gridLayout_5->removeWidget (ui->outAttenuation); + auto * driveLayout = new QVBoxLayout; + driveLayout->setContentsMargins (0, 0, 0, 0); + driveLayout->addWidget (ui->label, 0, Qt::AlignHCenter); + driveLayout->addWidget (ui->outAttenuation, 1); + ui->gridLayout_5->addLayout (driveLayout, 0, 7, 3, 1); + for (auto * widget : {static_cast (ui->logQSOButton), + static_cast (ui->stopButton), + static_cast (ui->monitorButton), + static_cast (ui->EraseButton), + static_cast (ui->ClrAvgButton), + static_cast (ui->sbEchoAvg), + static_cast (ui->DecodeButton), + static_cast (ui->autoButton), + static_cast (ui->stopTxButton), + static_cast (ui->tuneButton), + static_cast (ui->cbMenus)}) { - m_settings->setValue ("SWLView", true); - m_settings->setValue ("ShowMenus", ui->cbMenus->isChecked ()); - m_settings->setValue ("geometry", geometries ()[0]); - m_settings->setValue ("SWLModeGeometry", saveGeometry ()); - m_settings->setValue ("geometryNoControls", geometries ()[2]); - } - else + ui->horizontalLayout_2->setAlignment (widget, Qt::AlignVCenter); + } + + ui->gridLayout_3->removeItem (ui->verticalLayout_14); + ui->gridLayout_3->removeItem (ui->verticalLayout_13); + + ui->verticalLayout_14->removeWidget (ui->txFirstCheckBox); + ui->verticalLayout_14->removeWidget (ui->TxFreqSpinBox); + ui->verticalLayout_14->removeItem (ui->horizontalLayout_4); + ui->verticalLayout_14->removeWidget (ui->RxFreqSpinBox); + ui->verticalLayout_14->removeWidget (ui->rptSpinBox); + ui->verticalLayout_14->removeWidget (ui->sbTR); + + ui->verticalLayout_13->removeItem (ui->submode_gridLayout); + ui->verticalLayout_13->removeWidget (ui->cbHoldTxFreq); + ui->verticalLayout_13->removeWidget (ui->opt_controls_stack); + ui->verticalLayout_13->removeWidget (ui->sbSubmode); + ui->verticalLayout_13->removeWidget (ui->syncSpinBox); + ui->verticalLayout_13->removeWidget (ui->sbMaxDrift); + + auto * panel = new QWidget {ui->QSO_controls_widget}; + panel->setObjectName (QStringLiteral ("modeParameterPanel")); + panel->setSizePolicy (QSizePolicy::Minimum, QSizePolicy::Preferred); + auto * panelLayout = new QVBoxLayout {panel}; + panelLayout->setContentsMargins (0, 0, 0, 0); + + auto * checkboxRow = m_modeCheckboxRow = new QHBoxLayout; + checkboxRow->setContentsMargins (0, 0, 0, 0); + checkboxRow->setSpacing (12); + checkboxRow->addWidget (ui->txFirstCheckBox); + checkboxRow->addWidget (ui->cbHoldTxFreq); + checkboxRow->addStretch (1); + + auto * formPanel = new QWidget {panel}; + formPanel->setSizePolicy (QSizePolicy::Maximum, QSizePolicy::Preferred); + auto * form = new QGridLayout {formPanel}; + form->setContentsMargins (0, 0, 0, 0); + auto makeLabel = [panel] (QString const& text, QWidget * buddy, char const * objectName) { - if (ui->cbMenus->isChecked()) - { - m_settings->setValue ("SWLView", ui->actionSWL_Mode->isChecked ()); - m_settings->setValue ("ShowMenus", true); - m_settings->setValue ("geometry", saveGeometry ()); - m_settings->setValue ("SWLModeGeometry", geometries ()[1]); - m_settings->setValue ("geometryNoControls", geometries ()[2]); - } - else - { - m_settings->setValue ("SWLView", ui->actionSWL_Mode->isChecked ()); - m_settings->setValue ("ShowMenus", false); - m_settings->setValue ("geometry", geometries ()[0]); - m_settings->setValue ("SWLModeGeometry", geometries ()[1]); - m_settings->setValue ("geometryNoControls", saveGeometry ()); - } + auto * label = new QLabel {text, panel}; + label->setObjectName (QString::fromLatin1 (objectName)); + label->setAlignment (Qt::AlignLeft | Qt::AlignVCenter); + label->setBuddy (buddy); + return label; + }; + + m_txFrequencyLabel = makeLabel ( + tr ("Tx ").trimmed (), ui->TxFreqSpinBox, "txFrequencyLabel"); + m_frequencyToleranceLabel = makeLabel ( + tr ("F Tol ").trimmed (), ui->sbFtol, "frequencyToleranceLabel"); + m_rxFrequencyLabel = makeLabel ( + tr ("Rx ").trimmed (), ui->RxFreqSpinBox, "rxFrequencyLabel"); + m_reportLabel = makeLabel ( + tr (" Report ").trimmed (), ui->rptSpinBox, "reportLabel"); + m_trPeriodLabel = makeLabel ( + tr ("T/R ").trimmed (), ui->sbTR, "trPeriodLabel"); + m_submodeLabel = makeLabel ( + tr ("Submode ").trimmed (), ui->sbSubmode, "submodeLabel"); + m_maxDriftLabel = makeLabel ( + tr ("Max Drift ").trimmed (), ui->sbMaxDrift, "maxDriftLabel"); + + auto makeControlRow = [] (QWidget * label, QWidget * control) + { + auto * row = new QHBoxLayout; + row->setContentsMargins (0, 0, 0, 0); + row->setSpacing (4); + row->addWidget (label); + row->addWidget (control); + return row; + }; + + m_frequencyToleranceRow = new QHBoxLayout; + m_frequencyToleranceRow->setContentsMargins (0, 0, 0, 0); + m_frequencyToleranceRow->setSpacing (4); + m_frequencyToleranceRow->addWidget (m_frequencyToleranceLabel); + m_frequencyToleranceRow->addLayout (ui->horizontalLayout_4); + m_frequencyToleranceRow->addStretch (1); + + ui->TxFreqSpinBox->setPrefix ({}); + ui->TxFreqSpinBox->setSuffix (tr (" Hz")); + ui->RxFreqSpinBox->setPrefix ({}); + ui->RxFreqSpinBox->setSuffix (tr (" Hz")); + ui->sbFtol->setPrefix ({}); + ui->rptSpinBox->setPrefix ({}); + ui->sbTR->setPrefix ({}); + ui->sbTR->setSuffix (tr (" s")); + ui->sbSubmode->setPrefix ({}); + ui->sbMaxDrift->setPrefix ({}); + + for (auto * spinBox : { + static_cast (ui->TxFreqSpinBox), + static_cast (ui->sbFtol), + static_cast (ui->RxFreqSpinBox), + static_cast (ui->rptSpinBox), + static_cast (ui->sbTR), + static_cast (ui->sbSubmode), + static_cast (ui->sbMaxDrift)}) + { + spinBox->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed); + } + + form->addLayout (makeControlRow (m_txFrequencyLabel, ui->TxFreqSpinBox), 0, 0, Qt::AlignLeft); + form->addLayout (makeControlRow (m_submodeLabel, ui->sbSubmode), 0, 1, Qt::AlignLeft); + form->addLayout (m_frequencyToleranceRow, 1, 0, 1, 2, Qt::AlignLeft); + form->addLayout (makeControlRow (m_maxDriftLabel, ui->sbMaxDrift), 2, 1, Qt::AlignLeft); + form->addLayout (makeControlRow (m_rxFrequencyLabel, ui->RxFreqSpinBox), 2, 0, Qt::AlignLeft); + form->addLayout (makeControlRow (m_reportLabel, ui->rptSpinBox), 3, 0, Qt::AlignLeft); + form->addWidget (ui->opt_controls_stack, 3, 1, Qt::AlignLeft); + form->addLayout (makeControlRow (m_trPeriodLabel, ui->sbTR), 4, 0, Qt::AlignLeft); + form->addWidget (ui->syncSpinBox, 4, 1, Qt::AlignLeft); + form->setAlignment (Qt::AlignLeft | Qt::AlignTop); + + panelLayout->addLayout (checkboxRow); + panelLayout->addWidget (formPanel, 0, Qt::AlignLeft); + panelLayout->addLayout (ui->submode_gridLayout); + panelLayout->addStretch (1); + ui->gridLayout_3->addWidget (panel, 0, 0, 1, 2); + + ui->gridLayout_3->removeItem (ui->horizontalLayout_5); + ui->horizontalLayout_5->removeWidget (ui->respondComboBox); + auto * sequencingLayout = new QVBoxLayout; + sequencingLayout->setContentsMargins (0, 0, 0, 0); + sequencingLayout->addLayout (ui->horizontalLayout_5); + ui->respondComboBox->setSizeAdjustPolicy (QComboBox::AdjustToContents); + sequencingLayout->addWidget (ui->respondComboBox, 0, Qt::AlignLeft); + ui->gridLayout_3->addLayout (sequencingLayout, 2, 0, 1, 2); + + for (auto * button : {ui->pb15A, ui->pb15C, ui->pb30B, ui->pb60C, ui->pb60D, ui->pb60E}) + { + button->setMinimumWidth (0); + button->setSizePolicy (QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); } - m_settings->setValue ("state", saveState ()); - m_settings->setValue("MRUdir", m_path); - m_settings->setValue("TxFirst",m_txFirst); - m_settings->setValue("DXcall",ui->dxCallEntry->text()); - m_settings->setValue("DXgrid",ui->dxGridEntry->text()); - m_settings->setValue("AstroDisplayed", m_astroWidget && m_astroWidget->isVisible()); - m_settings->setValue("MsgAvgDisplayed", m_msgAvgWidget && m_msgAvgWidget->isVisible ()); - m_settings->setValue("FoxLogDisplayed", m_foxLogWindow && m_foxLogWindow->isVisible ()); - m_settings->setValue("ContestLogDisplayed", m_contestLogWindow && m_contestLogWindow->isVisible ()); - m_settings->setValue("ActiveStationsDisplayed", m_ActiveStationsWidget && m_ActiveStationsWidget->isVisible ()); - m_settings->setValue("QSYMessageCreatorDisplayed", m_QSYMessageCreatorWidget && m_QSYMessageCreatorWidget->isVisible ()); - m_settings->setValue("ShowQSYMessages", ui->actionEnable_QSY_Popups->isChecked()); - m_settings->setValue("QSYMonitorDisplayed", m_qsymonitorWidget && m_qsymonitorWidget->isVisible ()); - m_settings->setValue("RespondCQ",ui->respondComboBox->currentIndex()); - m_settings->setValue("HoundSort",ui->comboBoxHoundSort->currentIndex()); - m_settings->setValue("FoxNlist",ui->sbNlist->value()); - m_settings->setValue("FoxNslots",m_Nslots0); - m_settings->setValue("SerialNumber",ui->sbSerialNumber->value ()); - m_settings->setValue("FoxTextMsg", m_freeTextMsg0); - m_settings->setValue("WorkDupes", ui->cbWorkDupes->isChecked()); - m_settings->endGroup(); - - // do this in the General group because we save the parameters from various places - if(m_mode=="JT9") { - m_settings->setValue("SubMode",ui->sbSubmode->value()); - m_settings->setValue("TRPeriod", ui->sbTR->value()); - } - if(m_mode=="MSK144") m_settings->setValue("ShMsgs_MSK144",m_bShMsgs); - if(m_mode=="Q65") m_settings->setValue("ShMsgs_Q65",m_bShMsgs); - if(m_mode=="JT65") m_settings->setValue("ShMsgs_JT65",m_bShMsgs); - if(m_mode=="JT4") m_settings->setValue("ShMsgs_JT4",m_bShMsgs); - - m_settings->beginGroup("Common"); - m_settings->setValue("Mode",m_mode); - m_settings->setValue("SaveNone",ui->actionNone->isChecked()); - m_settings->setValue("SaveDecoded",ui->actionSave_decoded->isChecked()); - m_settings->setValue("SaveAll",ui->actionSave_all->isChecked()); - m_settings->setValue("RemoveAudioFiles",ui->actionRemove_after_30days->isChecked()); - m_settings->setValue("NDepth",m_ndepth); +} - //ft8md - m_settings->setValue ("MultithreadedFT8decoder",ui->actionUse_multithreaded_FT8_decoder->isChecked() ); - m_settings->setValue("NFT8Cycles",m_nFT8Cycles); - m_settings->setValue("NFT8QSORXfreqSensitivity",m_nFT8RXfSens); - m_settings->setValue("FT8threads",m_ft8threads); - m_settings->setValue("FT8Sensitivity",m_ft8Sensitivity); - m_settings->setValue("FT8DecoderStart",m_ft8DecoderStart); - m_settings->setValue("FT8WideDXCallSearch",m_FT8WideDxCallSearch); - m_settings->setValue("HideFT8Dupes",ui->actionHide_FT8_dupe_messages->isChecked()); - //ft8md +void MainWindow::updateModeControlsLayout () +{ + if (!m_modeCheckboxRow || ui->tabWidget->currentIndex () != 0) return; + auto const bothVisible = !ui->txFirstCheckBox->isHidden () && !ui->cbHoldTxFreq->isHidden (); + auto const checkboxWidth = ui->txFirstCheckBox->sizeHint ().width () + + ui->cbHoldTxFreq->sizeHint ().width () + m_modeCheckboxRow->spacing (); + // Preserve the message editor's preferred width before reserving a single + // checkbox row. The remaining width includes tabs, Next/Now and native buttons. + auto const messageChrome = qMax (0, ui->tabWidget->width () - ui->tx1->width ()); + auto const requiredWidth = checkboxWidth + ui->horizontalLayout_6->spacing () + + messageChrome + ui->tx1->sizeHint ().width (); + auto const availableCheckboxWidth = m_modeCheckboxRow->parentWidget ()->contentsRect ().width (); + auto const direction = bothVisible && (ui->QSO_controls_widget->width () < requiredWidth + || availableCheckboxWidth < checkboxWidth) + ? QBoxLayout::TopToBottom : QBoxLayout::LeftToRight; + if (m_modeCheckboxRow->direction () != direction) + m_modeCheckboxRow->setDirection (direction); +} - m_settings->setValue("RxFreq",ui->RxFreqSpinBox->value()); - if(m_specOp!=SpecOp::FOX) m_settings->setValue("TxFreq",ui->TxFreqSpinBox->value()); - m_settings->setValue("TxFreqFox",m_TxFreqFox); - m_settings->setValue("WSPRfreq",ui->WSPRfreqSpinBox->value()); - m_settings->setValue("FST4W_RxFreq",ui->sbFST4W_RxFreq->value()); - m_settings->setValue("FST4W_FTol",ui->sbFST4W_FTol->value()); - m_settings->setValue("FST4_FLow",ui->sbF_Low->value()); - m_settings->setValue("FST4_FHigh",ui->sbF_High->value()); - m_settings->setValue("EchoToneSpacing",ui->sbToneSpacing->value()); - m_settings->setValue("EchoFixedTone",ui->rbFixedTone->isChecked()); - m_settings->setValue("EchoMessageRB",ui->rbEchoMessage->isChecked()); - m_settings->setValue("EchoCW",ui->rbEchoCW->isChecked()); - m_settings->setValue("EchoMessage",ui->leEchoMessage->text()); - m_settings->setValue("DTtol",m_DTtol); - m_settings->setValue("MinSync",m_minSync); - m_settings->setValue ("AutoSeq", ui->cbAutoSeq->isChecked ()); - m_settings->setValue ("RxAll", ui->cbRxAll->isChecked ()); -// m_settings->setValue("ShMsgs",m_bShMsgs); - m_settings->setValue("SWL",ui->cbSWL->isChecked()); - if(m_mode=="MSK144" && m_msk144basefreq > 0) { - m_settings->setValue ("DialFreq", QVariant::fromValue(m_msk144basefreq)); // MSK144 QSY - } else { - m_settings->setValue ("DialFreq", QVariant::fromValue(m_lastMonitoredFrequency)); - } - m_settings->setValue("SkedFreq",m_skedFreq); - m_settings->setValue("OutAttenuation", ui->outAttenuation->value ()); - m_settings->setValue("NoSuffix",m_noSuffix); - m_settings->setValue("GUItab",ui->tabWidget->currentIndex()); - m_settings->setValue("OutBufSize",outBufSize); - m_settings->setValue ("HoldTxFreq", ui->cbHoldTxFreq->isChecked ()); - m_settings->setValue ("CQonly", ui->cbCQonly->isChecked ()); - m_settings->setValue ("BypassFilters", ui->cbBypass->isChecked ()); - m_settings->setValue("PctTx", ui->sbTxPercent->value ()); - m_settings->setValue("RoundRobin",ui->RoundRobin->currentText()); - m_settings->setValue("dBm",m_dBm); - m_settings->setValue("RR73",m_send_RR73); - m_settings->setValue ("WSPRPreferType1", ui->WSPR_prefer_type_1_check_box->isChecked ()); - m_settings->setValue("UploadSpots",m_uploadWSPRSpots); - m_settings->setValue("NoOwnCall",ui->cbNoOwnCall->isChecked()); - m_settings->setValue ("BandHopping", ui->band_hopping_group_box->isChecked ()); - m_settings->setValue ("MaxDrift", ui->sbMaxDrift->value()); - m_settings->setValue ("TRPeriod_FST4W", ui->sbTR_FST4W->value ()); - m_settings->setValue("FastMode",m_bFastMode); - m_settings->setValue("Fast9",m_bFast9); - m_settings->setValue ("CQTxfreq", ui->sbCQTxFreq->value ()); - m_settings->setValue("pwrBandTxMemory",m_pwrBandTxMemory); - m_settings->setValue("pwrBandTuneMemory",m_pwrBandTuneMemory); - m_settings->setValue ("FT8AP", ui->actionEnable_AP_FT8->isChecked ()); - m_settings->setValue ("JT65AP", ui->actionEnable_AP_JT65->isChecked ()); - m_settings->setValue ("AutoClearAvg", ui->actionAuto_Clear_Avg->isChecked ()); - m_settings->setValue ("DisableClicksOnWaterfall", ui->actionDisable_clicks_on_waterfall->isChecked ()); - m_settings->setValue("SplitterState",ui->decodes_splitter->saveState()); - m_settings->setValue("Blanker",ui->sbNB->value()); - m_settings->setValue("Score",m_score); - m_settings->setValue("labDXpedText",ui->labDXped->text()); - m_settings->setValue("EchoAvg",ui->sbEchoAvg->value()); +bool MainWindow::decoderBackendRunning () const +{ + return proc_jt9.state () == QProcess::Running; +} + +void MainWindow::save_wave_file(QString const& name, int samples, Frequency frequency, + QString const& dgrd) +{ + int const sample_capacity = static_cast (sizeof (dec_data.d2) / sizeof (dec_data.d2[0])); + if (samples <= 0 || samples > sample_capacity) { + MessageBox::critical_message (this, tr ("Error Writing WAV File"), + tr ("%1.wav: invalid sample count %2").arg (name).arg (samples)); + return; + } + + auto data = std::make_shared > (samples); { - QList coeffs; // suitable for QSettings - for (auto const& coeff : m_phaseEqCoefficients) - { - coeffs << coeff; - } - m_settings->setValue ("PhaseEqualizationCoefficients", QVariant {coeffs}); - } - m_settings->setValue ("bh_160m", ui->cb160m->isChecked() ); - m_settings->setValue ("bh_80m", ui->cb80m->isChecked() ); - m_settings->setValue ("bh_60m", ui->cb60m->isChecked() ); - m_settings->setValue ("bh_40m", ui->cb40m->isChecked() ); - m_settings->setValue ("bh_30m", ui->cb30m->isChecked() ); - m_settings->setValue ("bh_20m", ui->cb20m->isChecked() ); - m_settings->setValue ("bh_17m", ui->cb17m->isChecked() ); - m_settings->setValue ("bh_15m", ui->cb15m->isChecked() ); - m_settings->setValue ("bh_12m", ui->cb12m->isChecked() ); - m_settings->setValue ("bh_10m", ui->cb10m->isChecked() ); - m_settings->setValue ("bh_6m", ui->cb6m->isChecked() ); - m_settings->setValue ("bh_4m", ui->cb4m->isChecked() ); - m_settings->setValue ("bh_2m", ui->cb2m->isChecked() ); - m_settings->setValue ("bh_70cm", ui->cb70cm->isChecked() ); - m_settings->setValue ("bh_2mMSK", ui->cb2mMSK->isChecked() ); - m_settings->setValue ("bh_80mFT4", ui->cb80mFT4->isChecked() ); - m_settings->setValue ("bh_40mFT4", ui->cb40mFT4->isChecked() ); - m_settings->setValue ("bh_30mFT4", ui->cb30mFT4->isChecked() ); - m_settings->setValue ("bh_20mFT4", ui->cb20mFT4->isChecked() ); - m_settings->setValue ("bh_17mFT4", ui->cb17mFT4->isChecked() ); - m_settings->setValue ("bh_15mFT4", ui->cb15mFT4->isChecked() ); - m_settings->setValue ("bh_12mFT4", ui->cb12mFT4->isChecked() ); - m_settings->setValue ("bh_10mFT4", ui->cb10mFT4->isChecked() ); - m_settings->setValue ("bh_QRG1", ui->cbQRG1->isChecked() ); - m_settings->setValue ("bh_QRG2", ui->cbQRG2->isChecked() ); - m_settings->setValue ("bh_QRG3", ui->cbQRG3->isChecked() ); - m_settings->setValue ("bh_QRG4", ui->cbQRG4->isChecked() ); - m_settings->setValue ("bh_QRG5", ui->cbQRG5->isChecked() ); - m_settings->setValue ("bh_QRG6", ui->cbQRG6->isChecked() ); - m_settings->setValue ("bh_QRG7", ui->cbQRG7->isChecked() ); - m_settings->setValue ("bh_QRG8", ui->cbQRG8->isChecked() ); - m_settings->setValue ("QRG1", ui->sbQRG1->value ()); - m_settings->setValue ("QRG2", ui->sbQRG2->value ()); - m_settings->setValue ("QRG3", ui->sbQRG3->value ()); - m_settings->setValue ("QRG4", ui->sbQRG4->value ()); - m_settings->setValue ("QRG5", ui->sbQRG5->value ()); - m_settings->setValue ("QRG6", ui->sbQRG6->value ()); - m_settings->setValue ("QRG7", ui->sbQRG7->value ()); - m_settings->setValue ("QRG8", ui->sbQRG8->value ()); - m_settings->setValue ("reduceFalseDecodes", ui->actionReduce_false_decodes->isChecked() ); - m_settings->setValue ("HideAPInfo", ui->actionHide_AP_info->isChecked() ); - m_settings->setValue ("FullDuplexMode", ui->actionFull_Duplex_Mode->isChecked() ); - m_settings->setValue ("actionDontSplitALLTXT", ui->actionDon_t_split_ALL_TXT->isChecked() ); - m_settings->setValue ("splitAllTxtYearly", ui->actionSplit_ALL_TXT_yearly->isChecked() ); - m_settings->setValue ("splitAllTxtMonthly", ui->actionSplit_ALL_TXT_monthly->isChecked() ); - m_settings->setValue ("disableWritingOfAllTxt", ui->actionDisable_writing_of_ALL_TXT->isChecked() ); - m_settings->setValue ("DisableEventLogging", ui->actionDisable_event_logging->isChecked() ); - m_settings->setValue ("DarkStyle", ui->actionUse_Dark_Style->isChecked() ); - m_settings->setValue ("BandButtons", ui->actionBand_Buttons->isChecked() ); - m_settings->setValue ("VHFUHFButtons", ui->actionVHF_UHF_Buttons->isChecked() ); - m_settings->setValue ("tx1State", ui->tx1->isEnabled() ); - m_settings->setValue ("HighlightB4", ui->actionHighlightB4->isChecked() ); - m_settings->setValue ("HighlightToday", ui->actionHighlightToday->isChecked() ); - m_settings->setValue ("HighlightIgnored", ui->actionHighlightIgnored->isChecked() ); - m_settings->setValue ("HideB4", ui->actionHideB4->isChecked() ); - m_settings->setValue ("HideToday", ui->actionHideToday->isChecked() ); - m_settings->setValue ("HideIgnored", ui->actionHideIgnored->isChecked() ); - m_settings->setValue ("IgnoreB4", ui->actionIgnoreB4->isChecked() ); - m_settings->setValue ("IgnoreToday", ui->actionIgnoreToday->isChecked() ); - m_settings->setValue ("IgnoreIgnored", ui->actionIgnoreIgnored->isChecked() ); - m_settings->setValue ("HideTerritory1", ui->actionHideTerritory1->isChecked() ); - m_settings->setValue ("HideTerritory2", ui->actionHideTerritory2->isChecked() ); - m_settings->setValue ("HideTerritory3", ui->actionHideTerritory3->isChecked() ); - m_settings->setValue ("HideTerritory4", ui->actionHideTerritory4->isChecked() ); - m_settings->setValue ("HighlightTerritory1", ui->actionHighlightTerritory1->isChecked() ); - m_settings->setValue ("HighlightTerritory2", ui->actionHighlightTerritory2->isChecked() ); - m_settings->setValue ("HighlightTerritory3", ui->actionHighlightTerritory3->isChecked() ); - m_settings->setValue ("HighlightTerritory4", ui->actionHighlightTerritory4->isChecked() ); - m_settings->setValue ("HideEU", ui->actionHideEU->isChecked() ); - m_settings->setValue ("HideNA", ui->actionHideNA->isChecked() ); - m_settings->setValue ("HideSA", ui->actionHideSA->isChecked() ); - m_settings->setValue ("HideAS", ui->actionHideAS->isChecked() ); - m_settings->setValue ("HideAF", ui->actionHideAF->isChecked() ); - m_settings->setValue ("HideOC", ui->actionHideOC->isChecked() ); - m_settings->setValue ("HideAN", ui->actionHideAN->isChecked() ); - m_settings->setValue ("HighlightWhitelistEntries", ui->actionHighlight_Whitelist_entries->isChecked() ); - m_settings->endGroup(); + QMutexLocker lock {&dec_data_mutex ()}; + std::copy (dec_data.d2, dec_data.d2 + samples, data->begin ()); + } + + QString const file_name = name; + QString const my_callsign = m_config.my_callsign (); + QString const my_grid = m_config.my_grid (); + QString const mode = m_mode; + qint32 const sub_mode = m_nSubMode; + QString const his_call = m_hisCall; + QString const his_grid = m_hisGrid; + + auto const futures = m_saveWAVSynchronizer.futures (); + bool all_finished = true; + for (auto const& future : futures) { + if (!future.isFinished ()) { + all_finished = false; + break; + } + } + if (all_finished) { + m_saveWAVSynchronizer.clearFutures (); + } + + auto const future = QtConcurrent::run ([file_name, data, samples, my_callsign, my_grid, + mode, sub_mode, frequency, his_call, his_grid, dgrd] { + return Radio::WavFile::save (file_name, data->data (), samples, my_callsign, my_grid, + mode, sub_mode, frequency, his_call, his_grid, dgrd); + }); + m_saveWAVSynchronizer.addFuture (future); + m_saveWAVWatcher.setFuture (future); } +//-------------------------------------------------------- writeSettings() + void MainWindow::update_tx5(const QString &qsy_text) { if (m_hisCall=="") { QMessageBox::warning(this, "WSJT-X","There must be a callsign in the\n DX Call Box to send QSY Request"); } else { - QString text = qsy_text; - ui->tx6->setText(text.replace("$DX",m_hisCall)); + ui->tx6->setText(expandTxMacros(qsy_text)); ui->txb6->click(); stopWRTimer.stop(); if(!m_auto) { @@ -1690,361 +2170,6 @@ void MainWindow::setQSYMessageCreatorStatus(const bool &QSYMessageCreatorValue) } //---------------------------------------------------------- readSettings() -void MainWindow::readSettings() -{ - ui->cbAutoSeq->setVisible(false); - ui->respondComboBox->setVisible(false); - - m_settings->beginGroup("MainWindow"); - std::array the_geometries; - the_geometries[0] = m_settings->value ("geometry", saveGeometry ()).toByteArray (); - the_geometries[1] = m_settings->value ("SWLModeGeometry", saveGeometry ()).toByteArray (); - the_geometries[2] = m_settings->value ("geometryNoControls", saveGeometry ()).toByteArray (); - auto SWL_mode = m_settings->value ("SWLView", false).toBool (); - auto show_menus = m_settings->value ("ShowMenus", true).toBool (); - ui->actionSWL_Mode->setChecked (SWL_mode); - ui->cbMenus->setChecked (show_menus); - auto current_view_mode = SWL_mode ? 1 : show_menus ? 0 : 2; - change_layout (current_view_mode); - geometries (current_view_mode, the_geometries); - restoreState (m_settings->value ("state", saveState ()).toByteArray ()); - ui->dxCallEntry->setText (m_settings->value ("DXcall", QString {}).toString ()); - ui->dxGridEntry->setText (m_settings->value ("DXgrid", QString {}).toString ()); - m_path = m_settings->value("MRUdir", m_config.save_directory ().absolutePath ()).toString (); - m_txFirst = m_settings->value("TxFirst",false).toBool(); - auto displayAstro = m_settings->value ("AstroDisplayed", false).toBool (); - auto displayMsgAvg = m_settings->value ("MsgAvgDisplayed", false).toBool (); - auto displayFoxLog = m_settings->value ("FoxLogDisplayed", false).toBool (); - auto displayContestLog = m_settings->value ("ContestLogDisplayed", false).toBool (); - bool displayActiveStations = m_settings->value ("ActiveStationsDisplayed", false).toBool (); - bool displayQSYMessageCreator = m_settings->value ("QSYMessageCreatorDisplayed", false).toBool (); - bool displayQSYMonitor = m_settings->value("QSYMonitorDisplayed", false).toBool (); - bool enableQSYpopups = m_settings->value("ShowQSYMessages", true).toBool (); - ui->respondComboBox->setCurrentIndex(m_settings->value("RespondCQ",0).toInt()); - ui->comboBoxHoundSort->setCurrentIndex(m_settings->value("HoundSort",3).toInt()); - ui->sbNlist->setValue(m_settings->value("FoxNlist",12).toInt()); - m_Nslots=m_settings->value("FoxNslots",3).toInt(); - m_Nslots0=m_Nslots; - if(!m_config.superFox()) ui->sbNslots->setValue(m_Nslots); - ui->sbSerialNumber->setValue (m_settings->value ("SerialNumber", 1).toInt ()); - m_freeTextMsg0=m_settings->value("FoxTextMsg","").toString(); - m_freeTextMsg=m_freeTextMsg0; - ui->cbWorkDupes->setChecked(m_settings->value("WorkDupes",false).toBool()); - m_settings->endGroup(); - - m_settings->beginGroup("Common"); - m_mode=m_settings->value("Mode","FT8").toString(); - m_settings->endGroup(); - - // do this outside of settings group because it uses groups internally - ui->actionAstronomical_data->setChecked (displayAstro); - ui->actionEnable_QSY_Popups->setChecked (enableQSYpopups); - - // do this in the General group because we save the parameters from various places - if(m_mode=="JT9") { - blocked=true; - m_nSubMode=m_settings->value("SubMode",0).toInt(); - ui->sbSubmode->setValue(m_nSubMode); - ui->sbFtol->setValue (m_settings->value("Ftol_JT9", 50).toInt()); - ui->sbTR->setValue (m_settings->value ("TRPeriod", 15).toInt()); - QTimer::singleShot (50, [=] {blocked = false;}); - } - if (m_mode=="FT8") { - ui->sbFtol->setValue (m_settings->value("Ftol_SF", 50).toInt()); - } - if (m_mode=="Q65") { - m_nSubMode=m_settings->value("SubMode_Q65",0).toInt(); - ui->sbSubmode->setValue(m_nSubMode); - ui->sbFtol->setValue (m_settings->value("Ftol_Q65", 50).toInt()); - ui->sbTR->setValue (m_settings->value ("TRPeriod_Q65", 30).toInt()); - } - if (m_mode=="JT65") { - m_nSubMode=m_settings->value("SubMode_JT65",0).toInt(); - ui->sbSubmode->setValue(m_nSubMode); - ui->sbFtol->setValue (m_settings->value("Ftol_JT65", 50).toInt()); - } - if (m_mode=="JT4") { - m_nSubMode=m_settings->value("SubMode_JT4",0).toInt(); - ui->sbSubmode->setValue(m_nSubMode); - ui->sbFtol->setValue (m_settings->value("Ftol_JT4", 50).toInt()); - ui->sbTR->setValue (m_settings->value ("TRPeriod_FST4", 60).toInt()); - } - if (m_mode=="MSK144") { - ui->sbFtol->setValue (m_settings->value("Ftol_MSK144",50).toInt()); - m_msk144_tr2=m_settings->value ("TRPeriod_MSK144_2m", 30).toInt(); - m_msk144_tr6=m_settings->value ("TRPeriod_MSK144_6m", 15).toInt(); - m_msk144_tr=m_settings->value ("TRPeriod_MSK144", 30).toInt(); - QTimer::singleShot (3000, [=] { - if (m_currentBand=="2m") ui->sbTR->setValue (m_msk144_tr2); - else if (m_currentBand=="6m" or m_currentBand=="4m") ui->sbTR->setValue (m_msk144_tr6); - else ui->sbTR->setValue (m_msk144_tr); - }); - } - if (m_mode=="MSK144") m_bShMsgs=m_settings->value("ShMsgs_MSK144",false).toBool(); - if (m_mode=="Q65") m_bShMsgs=m_settings->value("ShMsgs_Q65",false).toBool(); - if (m_mode=="JT65") m_bShMsgs=m_settings->value("ShMsgs_JT65",false).toBool(); - if (m_mode=="JT4") m_bShMsgs=m_settings->value("ShMsgs_JT4",false).toBool(); - - m_settings->beginGroup("Common"); - ui->cb160m->setChecked(m_settings->value("bh_160m", false).toBool()); - ui->cb80m->setChecked(m_settings->value("bh_80m", false).toBool()); - ui->cb60m->setChecked(m_settings->value("bh_60m", false).toBool()); - ui->cb40m->setChecked(m_settings->value("bh_40m", false).toBool()); - ui->cb30m->setChecked(m_settings->value("bh_30m", false).toBool()); - ui->cb20m->setChecked(m_settings->value("bh_20m", false).toBool()); - ui->cb17m->setChecked(m_settings->value("bh_17m", false).toBool()); - ui->cb15m->setChecked(m_settings->value("bh_15m", false).toBool()); - ui->cb12m->setChecked(m_settings->value("bh_12m", false).toBool()); - ui->cb10m->setChecked(m_settings->value("bh_10m", false).toBool()); - ui->cb6m->setChecked(m_settings->value("bh_6m", false).toBool()); - ui->cb4m->setChecked(m_settings->value("bh_4m", false).toBool()); - ui->cb2m->setChecked(m_settings->value("bh_2m", false).toBool()); - ui->cb70cm->setChecked(m_settings->value("bh_70cm", false).toBool()); - ui->cb2mMSK->setChecked(m_settings->value("bh_2mMSK", false).toBool()); - ui->cb80mFT4->setChecked(m_settings->value("bh_80mFT4", false).toBool()); - ui->cb40mFT4->setChecked(m_settings->value("bh_40mFT4", false).toBool()); - ui->cb30mFT4->setChecked(m_settings->value("bh_30mFT4", false).toBool()); - ui->cb20mFT4->setChecked(m_settings->value("bh_20mFT4", false).toBool()); - ui->cb17mFT4->setChecked(m_settings->value("bh_17mFT4", false).toBool()); - ui->cb15mFT4->setChecked(m_settings->value("bh_15mFT4", false).toBool()); - ui->cb12mFT4->setChecked(m_settings->value("bh_12mFT4", false).toBool()); - ui->cb10mFT4->setChecked(m_settings->value("bh_10mFT4", false).toBool()); - ui->cbQRG1->setChecked(m_settings->value("bh_QRG1", false).toBool()); - ui->cbQRG2->setChecked(m_settings->value("bh_QRG2", false).toBool()); - ui->cbQRG3->setChecked(m_settings->value("bh_QRG3", false).toBool()); - ui->cbQRG4->setChecked(m_settings->value("bh_QRG4", false).toBool()); - ui->cbQRG5->setChecked(m_settings->value("bh_QRG5", false).toBool()); - ui->cbQRG6->setChecked(m_settings->value("bh_QRG6", false).toBool()); - ui->cbQRG7->setChecked(m_settings->value("bh_QRG7", false).toBool()); - ui->cbQRG8->setChecked(m_settings->value("bh_QRG8", false).toBool()); - ui->sbQRG1->setValue (m_settings->value ("QRG1", 3567).toInt ()); - ui->sbQRG2->setValue (m_settings->value ("QRG2", 7056).toInt ()); - ui->sbQRG3->setValue (m_settings->value ("QRG3", 10131).toInt ()); - ui->sbQRG4->setValue (m_settings->value ("QRG4", 14090).toInt ()); - ui->sbQRG5->setValue (m_settings->value ("QRG5", 18095).toInt ()); - ui->sbQRG6->setValue (m_settings->value ("QRG6", 21091).toInt ()); - ui->sbQRG7->setValue (m_settings->value ("QRG7", 24911).toInt ()); - ui->sbQRG8->setValue (m_settings->value ("QRG8", 28091).toInt ()); - ui->actionReduce_false_decodes->setChecked(m_settings->value("reduceFalseDecodes", false).toBool()); - ui->actionHide_AP_info->setChecked(m_settings->value("HideAPInfo", false).toBool()); - ui->actionFull_Duplex_Mode->setChecked(m_settings->value("FullDuplexMode", false).toBool()); - ui->labDXped->setText(m_settings->value("labDXpedText",QString {}).toString ()); - ui->actionDon_t_split_ALL_TXT->setChecked(m_settings->value("actionDontSplitALLTXT", true).toBool()); - ui->actionSplit_ALL_TXT_yearly->setChecked(m_settings->value("splitAllTxtYearly", false).toBool()); - ui->actionSplit_ALL_TXT_monthly->setChecked(m_settings->value("splitAllTxtMonthly", false).toBool()); - ui->actionDisable_writing_of_ALL_TXT->setChecked(m_settings->value("disableWritingOfAllTxt", false).toBool()); - ui->actionDisable_event_logging->setChecked(m_settings->value("DisableEventLogging", false).toBool()); - ui->actionUse_Dark_Style->setChecked(m_settings->value("DarkStyle", false).toBool()); - ui->actionBand_Buttons->setChecked(m_settings->value("BandButtons", true).toBool()); - ui->actionVHF_UHF_Buttons->setChecked(m_settings->value("VHFUHFButtons", false).toBool()); - ui->tx1->setEnabled(m_settings->value("tx1State", true).toBool()); - ui->actionHighlightB4->setChecked(m_settings->value("HighlightB4", false).toBool()); - ui->actionHighlightToday->setChecked(m_settings->value("HighlightToday", false).toBool()); - ui->actionHighlightIgnored->setChecked(m_settings->value("HighlightIgnored", false).toBool()); - ui->actionHideB4->setChecked(m_settings->value("HideB4", false).toBool()); - ui->actionHideToday->setChecked(m_settings->value("HideToday", false).toBool()); - ui->actionHideIgnored->setChecked(m_settings->value("HideIgnored", false).toBool()); - ui->actionIgnoreB4->setChecked(m_settings->value("IgnoreB4", false).toBool()); - ui->actionIgnoreToday->setChecked(m_settings->value("IgnoreToday", false).toBool()); - ui->actionIgnoreIgnored->setChecked(m_settings->value("IgnoreIgnored", false).toBool()); - ui->actionHideTerritory1->setChecked(m_settings->value("HideTerritory1", false).toBool()); - ui->actionHideTerritory2->setChecked(m_settings->value("HideTerritory2", false).toBool()); - ui->actionHideTerritory3->setChecked(m_settings->value("HideTerritory3", false).toBool()); - ui->actionHideTerritory4->setChecked(m_settings->value("HideTerritory4", false).toBool()); - ui->actionHighlightTerritory1->setChecked(m_settings->value("HighlightTerritory1", false).toBool()); - ui->actionHighlightTerritory2->setChecked(m_settings->value("HighlightTerritory2", false).toBool()); - ui->actionHighlightTerritory3->setChecked(m_settings->value("HighlightTerritory3", false).toBool()); - ui->actionHighlightTerritory4->setChecked(m_settings->value("HighlightTerritory4", false).toBool()); - ui->actionHideEU->setChecked(m_settings->value("HideEU", false).toBool()); - ui->actionHideNA->setChecked(m_settings->value("HideNA", false).toBool()); - ui->actionHideSA->setChecked(m_settings->value("HideSA", false).toBool()); - ui->actionHideAS->setChecked(m_settings->value("HideAS", false).toBool()); - ui->actionHideAF->setChecked(m_settings->value("HideAF", false).toBool()); - ui->actionHideOC->setChecked(m_settings->value("HideOC", false).toBool()); - ui->actionHideAN->setChecked(m_settings->value("HideAN", false).toBool()); - ui->actionHighlight_Whitelist_entries->setChecked(m_settings->value("HighlightWhitelistEntries", false).toBool()); -// m_mode=m_settings->value("Mode","FT8").toString(); - ui->actionNone->setChecked(m_settings->value("SaveNone",true).toBool()); - ui->actionSave_decoded->setChecked(m_settings->value("SaveDecoded",false).toBool()); - ui->actionSave_all->setChecked(m_settings->value("SaveAll",false).toBool()); - ui->actionRemove_after_30days->setChecked(m_settings->value("RemoveAudioFiles",false).toBool()); - ui->RxFreqSpinBox->setValue(0); // ensure a change is signaled - ui->RxFreqSpinBox->setValue(m_settings->value("RxFreq",1500).toInt()); - ui->sbFST4W_RxFreq->setValue(0); - ui->sbFST4W_RxFreq->setValue(m_settings->value("FST4W_RxFreq",1500).toInt()); - ui->sbF_Low->setValue(m_settings->value("FST4_FLow",600).toInt()); - ui->sbF_High->setValue(m_settings->value("FST4_FHigh",1400).toInt()); - ui->sbFST4W_FTol->setValue(m_settings->value("FST4W_FTol",100).toInt()); - ui->sbToneSpacing->setValue(m_settings->value("EchoToneSpacing",10).toInt()); - ui->rbFixedTone->setChecked(m_settings->value("EchoFixedTone",true).toBool()); - ui->rbEchoMessage->setChecked(m_settings->value("EchoMessageRB",false).toBool()); - ui->rbEchoCW->setChecked(m_settings->value("EchoCW",false).toBool()); - ui->leEchoMessage->setText(m_settings->value("EchoMessage",QString {}).toString()); - m_minSync=m_settings->value("MinSync",0).toInt(); - ui->syncSpinBox->setValue(m_minSync); - ui->cbAutoSeq->setChecked (m_settings->value ("AutoSeq", false).toBool()); - ui->cbRxAll->setChecked (m_settings->value ("RxAll", false).toBool()); -// m_bShMsgs=m_settings->value("ShMsgs",false).toBool(); - m_bSWL=m_settings->value("SWL",false).toBool(); - m_bFast9=m_settings->value("Fast9",false).toBool(); - m_bFastMode=m_settings->value("FastMode",false).toBool(); - ui->sbMaxDrift->setValue (m_settings->value ("MaxDrift",0).toInt()); - ui->sbTR_FST4W->setValue (m_settings->value ("TRPeriod_FST4W", 15).toInt()); - m_lastMonitoredFrequency = m_settings->value ("DialFreq", - QVariant::fromValue (default_frequency)).value (); - m_skedFreq=m_settings->value("SkedFreq",1296.065).toDouble(); - QTimer::singleShot (1000, [=] {if (m_astroWidget) m_astroWidget->setSkedFreq(m_skedFreq);}); - if(m_mode=="MSK144") m_msk144basefreq = m_lastMonitoredFrequency; // MSK144 QSY - ui->WSPRfreqSpinBox->setValue(0); // ensure a change is signaled - ui->WSPRfreqSpinBox->setValue(m_settings->value("WSPRfreq",1500).toInt()); - ui->TxFreqSpinBox->setValue(0); // ensure a change is signaled - if(m_specOp!=SpecOp::FOX) ui->TxFreqSpinBox->setValue(m_settings->value("TxFreq",1500).toInt()); - m_TxFreqFox=m_settings->value("TxFreqFox",300).toInt(); - if(m_specOp==SpecOp::FOX && !m_config.superFox()) ui->TxFreqSpinBox->setValue(m_TxFreqFox); - m_ndepth=m_settings->value("NDepth",3).toInt(); - - //ft8md - ui->actionUse_multithreaded_FT8_decoder->setChecked(m_settings->value("MultithreadedFT8decoder", false).toBool()); - m_multithreadFT8 = ui->actionUse_multithreaded_FT8_decoder->isChecked(); - dec_data.params.lmultift8 = m_multithreadFT8; - - m_nFT8Cycles=m_settings->value("NFT8Cycles",3).toInt(); if(!(m_nFT8Cycles>=1 && m_nFT8Cycles<=3)) m_nFT8Cycles=3; - if(m_nFT8Cycles==1) ui->actionDecFT8cycles1->setChecked(true); - else if(m_nFT8Cycles==2) ui->actionDecFT8cycles2->setChecked(true); - else if(m_nFT8Cycles==3) ui->actionDecFT8cycles3->setChecked(true); - - m_nFT8RXfSens=m_settings->value("NFT8QSORXfreqSensitivity",3).toInt(); if(!(m_nFT8RXfSens>=1 && m_nFT8RXfSens<=3)) m_nFT8RXfSens=3; - if(m_nFT8RXfSens==1) ui->actionRXfLow->setChecked(true); - else if(m_nFT8RXfSens==2) ui->actionRXfMedium->setChecked(true); - else if(m_nFT8RXfSens==3) ui->actionRXfHigh->setChecked(true); - - m_ft8threads=m_settings->value("FT8threads",0).toInt(); - if(!(m_ft8threads>=0 && m_ft8threads<25)) m_ft8threads=0; - if(m_ft8threads==0) ui->actionMTAuto->setChecked(true); - else if(m_ft8threads==1) ui->actionMT1->setChecked(true); - else if(m_ft8threads==2) ui->actionMT2->setChecked(true); - else if(m_ft8threads==3) ui->actionMT3->setChecked(true); - else if(m_ft8threads==4) ui->actionMT4->setChecked(true); - else if(m_ft8threads==5) ui->actionMT5->setChecked(true); - else if(m_ft8threads==6) ui->actionMT6->setChecked(true); - else if(m_ft8threads==7) ui->actionMT7->setChecked(true); - else if(m_ft8threads==8) ui->actionMT8->setChecked(true); - else if(m_ft8threads==9) ui->actionMT9->setChecked(true); - else if(m_ft8threads==10) ui->actionMT10->setChecked(true); - else if(m_ft8threads==11) ui->actionMT11->setChecked(true); - else if(m_ft8threads==12) ui->actionMT12->setChecked(true); - qDebug() << "m_ft8threads is " << m_ft8threads; - dec_data.params.nmt = m_ft8threads; - - ui->actionHide_FT8_dupe_messages->setChecked(m_settings->value("HideFT8Dupes",true).toBool()); - - m_ft8Sensitivity=m_settings->value("FT8Sensitivity",3).toInt(); - if(!(m_ft8Sensitivity>0 && m_ft8Sensitivity<=3)) m_ft8Sensitivity=3; - if(m_ft8Sensitivity==1) ui->actionFT8SensMin->setChecked(true); - else if(m_ft8Sensitivity==2) ui->actionlowFT8thresholds->setChecked(true); - else if(m_ft8Sensitivity==3) ui->actionFT8subpass->setChecked(true); - - m_ft8DecoderStart=m_settings->value("FT8DecoderStart",3).toInt(); - if(!(m_ft8DecoderStart>=0 && m_ft8DecoderStart<=4)) m_ft8DecoderStart=3; - if(m_ft8DecoderStart==0) ui->actionStartTwoStage->setChecked(true); - else if(m_ft8DecoderStart==1) ui->actionStartThreeStage->setChecked(true); - else if(m_ft8DecoderStart==2) ui->actionStartEarly->setChecked(true); - else if(m_ft8DecoderStart==3) ui->actionStartNormal->setChecked(true); - else if(m_ft8DecoderStart==4) ui->actionStartLate->setChecked(true); - - m_FT8WideDxCallSearch=m_settings->value("FT8WideDXCallSearch",true).toBool(); - ui->actionFT8WidebandDXCallSearch->setChecked(m_FT8WideDxCallSearch); - //ft8md - - ui->sbTxPercent->setValue (m_settings->value ("PctTx", 20).toInt ()); - on_sbTxPercent_valueChanged (ui->sbTxPercent->value ()); - ui->RoundRobin->setCurrentText(m_settings->value("RoundRobin",tr("Random")).toString()); - m_dBm=m_settings->value("dBm",37).toInt(); - m_send_RR73=m_settings->value("RR73",false).toBool(); - m_score=m_settings->value("Score",0).toInt(); - if(m_send_RR73) { - m_send_RR73=false; - on_txrb4_doubleClicked(); - } - ui->WSPR_prefer_type_1_check_box->setChecked (m_settings->value ("WSPRPreferType1", true).toBool ()); - m_uploadWSPRSpots=m_settings->value("UploadSpots",false).toBool(); - ui->cbNoOwnCall->setChecked(m_settings->value("NoOwnCall",false).toBool()); - ui->band_hopping_group_box->setChecked (m_settings->value ("BandHopping", false).toBool()); - // setup initial value of tx attenuator - m_block_pwr_tooltip = true; - ui->outAttenuation->setValue (m_settings->value ("OutAttenuation", 0).toInt ()); - m_block_pwr_tooltip = false; - ui->sbCQTxFreq->setValue (m_settings->value ("CQTxFreq", 260).toInt()); - m_noSuffix=m_settings->value("NoSuffix",false).toBool(); - int n=m_settings->value("GUItab",0).toInt(); - if (SpecOp::FOX==m_specOp) { - ui->tabWidget->setCurrentIndex(n); - } else { - // We need this to initialize the height of tab 1 correctly - ui->pbFreeText->setVisible(false); - ui->cbSendMsg->setVisible(false); - ui->tabWidget->setCurrentIndex(1); - ui->tabWidget->setCurrentIndex(n); - } - outBufSize=m_settings->value("OutBufSize",4096).toInt(); - ui->cbHoldTxFreq->setChecked (m_settings->value ("HoldTxFreq", false).toBool ()); - HoldTxFreqStatus = m_settings->value ("HoldTxFreq", false).toBool (); - ui->cbCQonly->setChecked (m_settings->value ("CQonly", false).toBool ()); - ui->cbBypass->setChecked (m_settings->value ("BypassFilters", false).toBool ()); - m_pwrBandTxMemory=m_settings->value("pwrBandTxMemory").toHash(); - m_pwrBandTuneMemory=m_settings->value("pwrBandTuneMemory").toHash(); - ui->actionEnable_AP_FT8->setChecked (m_settings->value ("FT8AP", false).toBool()); - ui->actionEnable_AP_JT65->setChecked (m_settings->value ("JT65AP", false).toBool()); - ui->actionAuto_Clear_Avg->setChecked (m_settings->value ("AutoClearAvg", false).toBool()); - ui->actionDisable_clicks_on_waterfall->setChecked (m_settings->value ("DisableClicksOnWaterfall", false).toBool()); - ui->decodes_splitter->restoreState(m_settings->value("SplitterState").toByteArray()); - ui->sbNB->setValue(m_settings->value("Blanker",0).toInt()); - ui->sbEchoAvg->setValue(m_settings->value("EchoAvg",10).toInt()); - { - auto const& coeffs = m_settings->value ("PhaseEqualizationCoefficients" - , QList {0., 0., 0., 0., 0.}).toList (); - m_phaseEqCoefficients.clear (); - for (auto const& coeff : coeffs) - { - m_phaseEqCoefficients.append (coeff.value ()); - } - } - m_settings->endGroup(); - - // use these initialisation settings to tune the audio o/p buffer - // size and audio thread priority - m_settings->beginGroup ("Tune"); - m_audioThreadPriority = static_cast (m_settings->value ("Audio/ThreadPriority", QThread::TimeCriticalPriority).toInt () % 8); - m_settings->endGroup (); - - m_specOp=m_config.special_op_id(); - checkMSK144ContestType(); - if (displayMsgAvg) on_actionMessage_averaging_triggered(); - if (displayFoxLog) on_fox_log_action_triggered (); - if (displayContestLog) on_contest_log_action_triggered (); - if (displayActiveStations) on_actionActiveStations_triggered(); - if (displayQSYMessageCreator) on_actionQSYMessage_Creator_triggered(); - if (displayQSYMonitor) on_actionQSY_Monitor_triggered(); - -#ifdef WIN32 - if (m_config.alert_Enabled()) { // testing and initializing the default audio device for playing audible alerts - QAudioOutput info(QAudioDeviceInfo::defaultOutputDevice()); - QString audioPath = app_sounds_directory (m_config.voicesPath()); - QAudioFormat format; - format.setCodec("audio/pcm"); - format.setSampleRate (48000); - format.setChannelCount (1); - format.setSampleSize (16); - format.setSampleType(QAudioFormat::SignedInt); - QAudioOutput* audio; - audio = new QAudioOutput(format, this); - QFile *effect = new QFile(this); - effect->setFileName(QString("%1/%2").arg(audioPath, "Testing123.wav")); - effect->open(QIODevice::ReadOnly); - audio->start(effect); - } -#endif -} void MainWindow::checkMSK144ContestType() { @@ -2061,105 +2186,208 @@ void MainWindow::checkMSK144ContestType() void MainWindow::set_application_font (QFont const& font) { - // check if dark style is enabled, this check is also effective during the program start - if (ui->actionUse_Dark_Style->isChecked()) { - QFile f(":qdarkstyle/style.qss"); - if (!f.exists()) { - printf("Unable to set stylesheet, file not found\n"); - } else { - qApp->setFont (font); - QString ss; - f.open(QFile::ReadOnly | QFile::Text); - QTextStream ts(&f); - qApp->setStyleSheet(ts.readAll() + "* {" + font_as_stylesheet (font) + '}'); - m_useDarkStyle = true; - m_wideGraph->setDarkStyle(m_useDarkStyle); - check_button_color(); - ui->tabWidget->setTabShape(QTabWidget::Rounded); - } - } else { - m_useDarkStyle = false; - m_wideGraph->setDarkStyle(m_useDarkStyle); - check_button_color(); - ui->tabWidget->setTabShape(QTabWidget::Triangular); - qApp->setFont (font); - // set font in the application style sheet as well in case it has - // been modified in the style sheet which has priority - QString ss; - if (qApp->styleSheet ().size ()) { - auto sheet = qApp->styleSheet (); - sheet.remove ("file:///"); - QFile sf {sheet}; - if (sf.open (QFile::ReadOnly | QFile::Text)) - { - QString tmp = sf.readAll(); - if (tmp != NULL) ss = sf.readAll () + tmp; - else qDebug() << "tmp==NULL at sf.readAll"; - } - } - qApp->setStyleSheet (ss + "* {" + font_as_stylesheet (font) + '}'); - } - - // ensure a balanced layout + applyApplicationStyle (font, ui->actionUse_Dark_Style->isChecked ()); qreal pointSize = m_config.text_font().pointSizeF(); if (m_config.PWR_and_SWR()) { ui->label->setMinimumWidth (2.8*pointSize + 8); ui->label->setAlignment(Qt::AlignCenter); ui->outAttenuation->setMinimumWidth (2.8*pointSize + 8); } - if (pointSize < 11) { -// ui->tabWidget->setMaximumHeight(210); // UR for AL - if (ui->actionUse_Dark_Style->isChecked()) { -// ui->tabWidget->setMaximumHeight(225); // UR for normal + widescreen - ui->houndButton->setMinimumWidth(50); // UR for normal + widescreen - ui->ft8Button->setMinimumWidth(50); // UR for normal + widescreen - ui->ft4Button->setMinimumWidth(50); // UR for normal + widescreen - ui->msk144Button->setMinimumWidth(50); // UR for normal + widescreen - ui->q65Button->setMinimumWidth(50); // UR for normal + widescreen - ui->jt65Button->setMinimumWidth(50); // UR for normal + widescreen - } else { -// ui->tabWidget->setMaximumHeight(225); // UR for normal + widescreen - ui->houndButton->setMaximumWidth(40); // UR for normal + widescreen - ui->ft8Button->setMaximumWidth(40); // UR for normal + widescreen - ui->ft4Button->setMaximumWidth(40); // UR for normal + widescreen - ui->msk144Button->setMaximumWidth(40); // UR for normal + widescreen - ui->q65Button->setMaximumWidth(40); // UR for normal + widescreen - ui->jt65Button->setMaximumWidth(40); // UR for normal + widescreen - ui->houndButton->setMinimumWidth(0); // UR for normal + widescreen - ui->ft8Button->setMinimumWidth(0); // UR for normal + widescreen - ui->ft4Button->setMinimumWidth(0); // UR for normal + widescreen - ui->msk144Button->setMinimumWidth(0); // UR for normal + widescreen - ui->q65Button->setMinimumWidth(0); // UR for normal + widescreen - ui->jt65Button->setMinimumWidth(0); // UR for normal + widescreen - } - } else { -// ui->tabWidget->setMaximumHeight(255); // UR for AL -// ui->tabWidget->setMaximumHeight(500); // UR for normal + widescreen - ui->houndButton->setMinimumWidth(50); // UR for normal + widescreen - ui->ft8Button->setMinimumWidth(50); // UR for normal + widescreen - ui->ft4Button->setMinimumWidth(50); // UR for normal + widescreen - ui->msk144Button->setMinimumWidth(50); // UR for normal + widescreen - ui->q65Button->setMinimumWidth(50); // UR for normal + widescreen - ui->jt65Button->setMinimumWidth(50); // UR for normal + widescreen - } - if (m_config.largerTabWidget()) ui->tabWidget->setMaximumHeight(1000); - for (auto& widget : qApp->topLevelWidgets ()) +} + +void MainWindow::applyApplicationStyle (QFont const& font, bool dark) +{ + QString darkStyleSheet; + if (dark) + { + QFile file {":qdarkstyle/style.qss"}; + if (!file.open (QFile::ReadOnly | QFile::Text)) + { + qWarning () << "Unable to load dark stylesheet"; + return; + } + QTextStream stream {&file}; + darkStyleSheet = stream.readAll (); + } + + QFont prominentFont {font}; + if (font.pointSizeF () > 0.) prominentFont.setPointSizeF (font.pointSizeF () * 1.6); + else if (font.pixelSize () > 0) prominentFont.setPixelSize (qRound (font.pixelSize () * 1.6)); + auto styleSheet = application_style_sheet ( + m_base_style_sheet, darkStyleSheet, dark, font) + + "\nQLabel#labDialFreq, QLabel#labUTC {" + font_as_stylesheet (prominentFont) + '}'; +#ifdef Q_OS_MAC + if (!dark) + { + styleSheet += "\nQPushButton[wsjtxCompact=\"true\"] {" + "border: 1px solid palette(mid); border-radius: 4px; padding: 3px 6px; " + "background-color: palette(button); color: palette(button-text);}" + "\nQPushButton[wsjtxCompact=\"true\"]:focus {border-color: palette(highlight);}" + "\nQPushButton[wsjtxCompact=\"true\"]:pressed {background-color: palette(midlight);}" + "\nQPushButton[wsjtxCompact=\"true\"]:disabled {color: palette(mid);}"; + } +#endif + if (qApp->font () != font) qApp->setFont (font); + ui->outAttenuation->setProperty ("wsjtxDarkStyle", dark); + if (qApp->styleSheet () != styleSheet) qApp->setStyleSheet (styleSheet); + m_useDarkStyle = dark; + m_wideGraph->setDarkStyle (dark); + ui->tabWidget->setTabShape (dark ? QTabWidget::Rounded : QTabWidget::Triangular); + check_button_color (); + updateMainWindowControlSizes (); + for (auto * widget : qApp->topLevelWidgets ()) widget->updateGeometry (); +} + +void MainWindow::updateMainWindowControlSizes() +{ + auto setMinimumHintWidth = [] (QWidget * widget) + { + widget->setMinimumWidth (0); + widget->ensurePolished (); + widget->setMinimumWidth (widget->minimumSizeHint ().width ()); + }; + for (auto * widget : {static_cast (ui->cbCQonly), + static_cast (ui->cbBypass), + static_cast (ui->lookupButton), + static_cast (ui->addButton), + static_cast (ui->ignoreButton), + static_cast (ui->genStdMsgsPushButton)}) + { + setMinimumHintWidth (widget); + } + + ui->sbFtol_2->setMinimumWidth (0); + ui->sbFtol_2->setMaximumWidth (QWIDGETSIZE_MAX); + ui->sbFtol_2->ensurePolished (); + auto const toleranceText = ui->sbFtol_2->prefix () + + QString::number (ui->sbFtol_2->maximum ()) + ui->sbFtol_2->suffix (); + auto const toleranceChrome = ui->sbFtol_2->style ()->pixelMetric ( + QStyle::PM_ScrollBarExtent, nullptr, ui->sbFtol_2) + + 2 * ui->sbFtol_2->style ()->pixelMetric ( + QStyle::PM_SpinBoxFrameWidth, nullptr, ui->sbFtol_2) + 4; + ui->sbFtol_2->setMinimumWidth (qMax ( + ui->sbFtol_2->sizeHint ().width (), + ui->sbFtol_2->fontMetrics ().horizontalAdvance (toleranceText) + toleranceChrome)); + +#if defined (Q_OS_WIN) || defined (Q_OS_LINUX) + // These short action labels are not dialog confirmation buttons. Keep their + // native decoration, but give the message editors the otherwise reserved space. + for (auto * button : {static_cast (ui->lookupButton), + static_cast (ui->addButton), + static_cast (ui->ignoreButton)}) + { + button->ensurePolished (); + // Share the callsign row without imposing the style's dialog-button size + // hint on its parent or reserving space from the message editors. + button->setMinimumWidth (compactButtonSize (button).width ()); + button->setMaximumWidth (QWIDGETSIZE_MAX); + button->setSizePolicy (QSizePolicy::Ignored, button->sizePolicy ().verticalPolicy ()); + ui->lookup_control_layout->setStretchFactor (button, 1); + } +#endif + for (auto * button : {static_cast (ui->txb1), + static_cast (ui->txb2), + static_cast (ui->txb3), + static_cast (ui->txb4), + static_cast (ui->txb5), + static_cast (ui->txb6)}) + { + button->ensurePolished (); + button->setFixedWidth (compactButtonSize (button).width ()); + } + + for (auto * button : {ui->monitorButton, ui->autoButton}) + { + button->setMinimumWidth (0); + button->ensurePolished (); + auto text = button->text (); + text.remove (QLatin1Char ('&')); + auto const horizontalRoom = 4 * button->fontMetrics ().horizontalAdvance (QStringLiteral ("M")); + button->setMinimumWidth (qMax (button->minimumSizeHint ().width (), + button->fontMetrics ().horizontalAdvance (text) + horizontalRoom)); + } + + auto const actionTextHeight = ui->DecodeButton->fontMetrics ().height (); + auto const compactActionHeight = actionTextHeight + actionTextHeight / 2; + auto const prominentActionHeight = compactActionHeight + actionTextHeight / 4; + auto setActionHeight = [] (QWidget * button, int preferredHeight) + { + button->setMinimumHeight (0); + button->setMaximumHeight (QWIDGETSIZE_MAX); + button->ensurePolished (); + button->setMinimumHeight (preferredHeight); + }; + for (auto * button : {ui->logQSOButton, ui->stopButton, ui->EraseButton, + ui->ClrAvgButton, ui->DecodeButton, ui->stopTxButton, + ui->tuneButton}) + { + setActionHeight (button, compactActionHeight); + } + for (auto * button : {ui->monitorButton, ui->autoButton}) + { + setActionHeight (button, prominentActionHeight); + } + + ui->cbHoldTxFreq->setMinimumWidth (0); + ui->cbHoldTxFreq->setMinimumHeight (0); + ui->cbHoldTxFreq->ensurePolished (); + ui->cbHoldTxFreq->setMinimumWidth ( + ui->cbHoldTxFreq->minimumSizeHint ().width ()); + ui->cbHoldTxFreq->setMinimumHeight (ui->cbHoldTxFreq->minimumSizeHint ().height ()); + + constexpr int formControlSpacing = 4; + struct FormRow + { + QLabel * label; + QWidget * control; + int extraWidth; + }; + FormRow rows[] = { + {m_txFrequencyLabel, ui->TxFreqSpinBox, 0}, + {m_rxFrequencyLabel, ui->RxFreqSpinBox, 0}, + {m_reportLabel, ui->rptSpinBox, + ui->rptSpinBox->fontMetrics ().horizontalAdvance (QStringLiteral ("M"))}, + {m_trPeriodLabel, ui->sbTR, 0} + }; + + int commonRowWidth = 0; + for (auto const& row : rows) { - widget->updateGeometry (); + row.label->ensurePolished (); + row.control->setMinimumWidth (0); + row.control->setMaximumWidth (QWIDGETSIZE_MAX); + row.control->ensurePolished (); + commonRowWidth = qMax (commonRowWidth, + row.label->sizeHint ().width () + formControlSpacing + + row.control->minimumSizeHint ().width () + row.extraWidth); + } + for (auto const& row : rows) + { + row.control->setFixedWidth (commonRowWidth - row.label->sizeHint ().width () + - formControlSpacing); } + updateFrequencyToleranceRowAlignment (); +} + +void MainWindow::updateFrequencyToleranceRowAlignment() +{ + auto const leftMargin = m_frequencyToleranceLabel->isHidden () + ? m_txFrequencyLabel->sizeHint ().width () + 4 : 0; + m_frequencyToleranceRow->setContentsMargins (leftMargin, 0, 0, 0); } void MainWindow::setDecodedTextFont (QFont const& font) { ui->decodedTextBrowser->setContentFont (font); ui->decodedTextBrowser2->setContentFont (font); + ui->Tx_Message->setFont (font); ui->houndQueueTextBrowser->setContentFont(font); ui->houndQueueTextBrowser->displayHoundToBeCalled(" "); - ui->houndQueueTextBrowser->setText(""); + ui->houndQueueTextBrowser->clear(); ui->foxTxListTextBrowser->setContentFont(font); ui->foxTxListTextBrowser->displayHoundToBeCalled(" "); - ui->foxTxListTextBrowser->setText(""); + ui->foxTxListTextBrowser->clear(); auto style_sheet = "QLabel {" + font_as_stylesheet (font) + '}'; ui->lh_decodes_headings_label->setStyleSheet (ui->lh_decodes_headings_label->styleSheet () + style_sheet); @@ -2209,7 +2437,7 @@ void MainWindow::fixStop() } else if (m_mode=="FreqCal"){ m_hsymStop=((int(m_TRperiod/0.288))/8)*8; } else if (m_mode=="FT8") { - if (m_multithreadFT8 && !(m_specOp==SpecOp::HOUND && m_config.superFox())) { + if (usesFt8MtdFinal ()) { if (m_ft8DecoderStart==0) m_hsymStop=49; else if (m_ft8DecoderStart==1) { m_hsymStop=50; @@ -2239,6 +2467,8 @@ void MainWindow::fixStop() } else { m_hsymStop=stop[i]; } + } else if(m_mode=="JTTY") { + m_hsymStop=620; } } @@ -2259,9 +2489,18 @@ void MainWindow::dataSink(qint64 frames) m_bUseRef=m_wideGraph->useRef(); if(!m_diskData) { - refspectrum_(&dec_data.d2[k-m_nsps/2],&m_bClearRefSpec,&m_bRefSpec, - &m_bUseRef, fname.constData (), (FCL)fname.size ()); + if (m_bClearRefSpec) + { + int count = 0; + refspectrum_ (dec_data.d2, &count, &m_bClearRefSpec, &m_bRefSpec, + &m_bUseRef, fname.constData (), (FCL) fname.size ()); + } m_bClearRefSpec=false; + m_referenceInput.consume (dec_data.d2, k, m_bRefSpec ? 1 : m_bUseRef ? 2 : 0, + [&] (short * samples, int count) { + refspectrum_ (samples, &count, &m_bClearRefSpec, &m_bRefSpec, + &m_bUseRef, fname.constData (), (FCL) fname.size ()); + }); } if(m_mode=="MSK144" or m_bFast9) { @@ -2269,6 +2508,8 @@ void MainWindow::dataSink(qint64 frames) if(m_bFastMode) return; } + if(m_mode=="JTTY") fastSink(frames); + // Get power, spectrum, and ihsym dec_data.params.nfa=m_wideGraph->nStartFreq(); dec_data.params.nfb=m_wideGraph->Fmax(); @@ -2291,6 +2532,14 @@ void MainWindow::dataSink(qint64 frames) m_wideGraph->dataSink2(s,m_df3,m_ihsym,m_diskData,m_px); } if(m_mode=="MSK144") return; + if(m_mode=="JTTY") { + if(m_ihsym >= m_hsymStop and (m_saveAll or m_saveDecoded)) { + monitor(false); + jtty_save_wav(); + if(!m_diskData) monitor(true); + } + return; + } fixStop(); if (m_mode == "FreqCal" @@ -2298,7 +2547,7 @@ void MainWindow::dataSink(qint64 frames) // changed frequency && !(m_ihsym % 8) && m_ihsym > 8 && m_ihsym <= m_hsymStop) { int RxFreq=ui->RxFreqSpinBox->value (); - int nkhz=(m_freqNominal+RxFreq)/1000; + int nkhz=(m_operatingFrequency.rx ()+RxFreq)/1000; int ftol = ui->sbFtol->value (); freqcal_(&dec_data.d2[0], &k, &nkhz, &RxFreq, &ftol, &line[0], (FCL)80); QString t=QString::fromLatin1(line); @@ -2331,14 +2580,12 @@ void MainWindow::dataSink(qint64 frames) } if(m_ihsym==3*m_hsymStop/4) { - m_dialFreqRxWSPR=m_freqNominal; + m_dialFreqRxWSPR=m_operatingFrequency.rx (); } if(m_mode=="FT8") { - to_jt9(m_ihsym,-1,-1); //Allow jt9 to bail out early, if necessary - if(m_ihsym==40 and m_decoderBusy) { - qDebug() << "Clearing hung decoder status"; - decodeDone(); //Clear a hung decoder status + if(m_ihsym==40 and decoderBusy ()) { + recoverDecoderAtBoundary ("FT8 symbol-40 boundary", false); } } @@ -2373,6 +2620,7 @@ void MainWindow::dataSink(qint64 frames) // end of ft8md bool bCallDecoder=false; + auto ft8Stage = Ft8MtdDecodeCoordinator::Stage::None; if(m_multithreadFT8 && m_ft8DecoderStart==1) m_earlyDecode2 = 46; // ft8md @@ -2381,6 +2629,13 @@ void MainWindow::dataSink(qint64 frames) if(m_ihsym==m_earlyDecode) bCallDecoder=true; if(m_ihsym==m_earlyDecode2 && !(m_multithreadFT8 && m_ft8DecoderStart!=1)) bCallDecoder=true; } + // Standard FT8 passes share subtraction state; only an independent MTD final can be deferred. + if (m_mode == "FT8" && !m_diskData && bCallDecoder && usesFt8MtdFinal ()) + { + if (m_ihsym == m_hsymStop) ft8Stage = Ft8MtdDecodeCoordinator::Stage::Final; + else if (m_ihsym == m_earlyDecode) ft8Stage = Ft8MtdDecodeCoordinator::Stage::EarlyOne; + else if (m_ihsym == m_earlyDecode2) ft8Stage = Ft8MtdDecodeCoordinator::Stage::EarlyTwo; + } if(bCallDecoder) { if(m_mode=="Echo") { @@ -2403,20 +2658,24 @@ void MainWindow::dataSink(qint64 frames) int ndf=0; int idir=1; if(!ui->rbFixedTone->isChecked() and !m_diskData) { - ndf=ui->sbToneSpacing->value(); + if(ui->rbEchoMessage->isChecked()) ndf=ui->sbToneSpacing->value(); save_echo_params_(&nDopTotal,&nDop,&nfrit,&f1,&width,&ndf,&itone[0],dec_data.d2,&idir); } if(m_diskData) { idir=-1; save_echo_params_(&nDopTotal,&nDop,&nfrit,&f1,&width,&ndf,&itone[0],dec_data.d2,&idir); - if(ndf==0 and ui->rbEchoMessage->isChecked()) ui->rbFixedTone->setChecked(true); + if(ndf>=10 and ndf<=30) { + ui->rbEchoMessage->setChecked(true); + } else { + ui->rbFixedTone->setChecked(true); + } } bool bEchoCall=ui->rbEchoMessage->isChecked(); - QString txcall=ui->leEchoMessage->text(); + auto const txcall = ui->leEchoMessage->text().toLatin1().leftJustified(6, ' ', true); static char crxcall[7]; - avecho_(dec_data.d2,&nDop,&nfrit,&nauto,&ndf,&navg,&nqual,&f1,&xlevel,&sigdb, - &dBerr,&dfreq,&width,&m_diskData,&bEchoCall,txcall.toLatin1().constData(), + avecho_(dec_data.d2,&nDop,&nfrit,&nauto,&navg,&nqual,&f1,&xlevel,&sigdb, + &dBerr,&dfreq,&width,&m_diskData,&bEchoCall,txcall.constData(), &crxcall[0],(FCL)6,(FCL)6); crxcall[6]=0; QString rxcall {QString::fromLatin1(crxcall)}; @@ -2448,10 +2707,23 @@ void MainWindow::dataSink(qint64 frames) m_echoRunning=true; if(ndf<0 or ndf>30) ndf=0; QString t; - t = t.asprintf("%7.4f %5.2f %7d %7.1f %5d %5d %6d %6.1f %7.1f %3d",hour,xlevel, - nDopTotal,width,echocom_.nsum,nqual,qRound(dfreq),sigdb,dBerr,ndf); - t = t0 + t + " " + rxcall; - if(!bEchoCall) t=t.left(78); + if (!m_diskData) { + if (m_astroWidget) { + auto const dgrd = QByteArray::number(m_astroWidget->getDgrd(), 'f', 1); + t = t.asprintf("%7.4f %5.2f %7d %7.1f %5s %5d %5d %6d %6.1f %7.1f %3d",hour,xlevel, + nDopTotal,width,dgrd.constData(),echocom_.nsum,nqual,qRound(dfreq),sigdb,dBerr,ndf); + t = t0 + t + " " + rxcall; + } else { + t = t.asprintf("%7.4f %5.2f",hour,xlevel); + t = t0 + t + " Astronomical Data off; Level only"; + } + } else { + t = t.asprintf("%7.4f %5.2f %7d %7.1f %5d %5d %6d %6.1f %7.1f %3d",hour,xlevel, + nDopTotal,width,echocom_.nsum,nqual,qRound(dfreq),sigdb,dBerr,ndf); + t = t0 + t + " " + rxcall; + } + + if(!bEchoCall) t=t.left(84); if(ui) ui->decodedTextBrowser->insertText(t); t=t1 + t; write_all("Rx",t); @@ -2470,7 +2742,7 @@ void MainWindow::dataSink(qint64 frames) if(m_mode=="FreqCal") return; - if(m_dialFreqRxWSPR==0) m_dialFreqRxWSPR=m_freqNominal; + if(m_dialFreqRxWSPR==0) m_dialFreqRxWSPR=m_operatingFrequency.rx (); m_dataAvailable=true; dec_data.params.npts8=(m_ihsym*m_nsps)/16; dec_data.params.newdat=1; @@ -2483,7 +2755,29 @@ void MainWindow::dataSink(qint64 frames) m_dateTime = now.toString ("yyyy-MMM-dd hh:mm"); if(m_mode!="WSPR") { if (m_mode=="FT8" && m_multithreadFT8 && m_ihsym>47) last=now; // ft8md - decode(); //Start decoder + bool deferLiveAudioTestFinal {false}; + qint64 liveAudioTestFinalPeriod {-1}; +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) + deferLiveAudioTestFinal = m_automated_test + && m_liveAudioTestAwaitFt8InputCompletion + && Ft8MtdDecodeCoordinator::Stage::Final == ft8Stage; + if (deferLiveAudioTestFinal) + { + m_liveAudioTestPendingFt8FinalPeriod = currentFt8DecodePeriod (); + if (m_liveAudioTestFt8InputComplete) + { + liveAudioTestFinalPeriod = m_liveAudioTestPendingFt8FinalPeriod; + m_liveAudioTestPendingFt8FinalPeriod = -1; + m_liveAudioTestAwaitFt8InputCompletion = false; + m_liveAudioTestFt8InputComplete = false; + deferLiveAudioTestFinal = false; + } + } +#endif + if (!deferLiveAudioTestFinal) + { + decode (ft8Stage, liveAudioTestFinalPeriod); //Start decoder + } } if(m_mode=="FT8" and !(m_diskData or (m_multithreadFT8 && m_ft8DecoderStart<2)) and (m_ihsym==m_earlyDecode or m_ihsym==m_earlyDecode2)) return; @@ -2505,16 +2799,20 @@ void MainWindow::dataSink(qint64 frames) } int samples=m_TRperiod*12000; if(m_mode=="FT4") samples=21*3456; - // the following is potential a threading hazard - not a good - // idea to pass pointer to be processed in another thread - m_saveWAVWatcher.setFuture (QtConcurrent::run (std::bind (&MainWindow::save_wave_file, - this, m_fnameWE, &dec_data.d2[0], samples, m_config.my_callsign(), - m_config.my_grid(), m_mode, m_nSubMode, m_freqNominalPeriod, m_hisCall, m_hisGrid))); + double dgrd_value = 0.0; + QString dgrd; + if(m_astroWidget) { + dgrd_value = m_astroWidget->getDgrd(); + dgrd = QString("%1").arg(dgrd_value, 0, 'f', 1); + } else { + dgrd = "NoVal"; + } + save_wave_file (m_fnameWE, samples, m_freqNominalPeriod, dgrd); if (m_mode=="WSPR") { auto c2name {(m_fnameWE + ".c2").toLocal8Bit ()}; int nsec=120; int nbfo=1500; - double f0m1500=m_freqNominal/1000000.0 + nbfo - 1500; + double f0m1500=m_operatingFrequency.rx ()/1000000.0 + nbfo - 1500; int err = savec2_(c2name.constData (),&nsec,&f0m1500, (FCL)c2name.size()); if (err!=0) MessageBox::warning_message (this, tr ("Error saving c2 file"), c2name); } @@ -2537,12 +2835,16 @@ void MainWindow::dataSink(qint64 frames) << QDir::toNativeSeparators (m_config.writeable_data_dir ().absolutePath()) << t2 << m_fnameWE + ".wav"; } - if (ui) ui->DecodeButton->setChecked (true); - p1Timer.start(1000); - m_decoderBusy = true; - statusUpdate (); + if (beginDecode (DecodeOwner::Wsprd)) + { + if (ui) ui->DecodeButton->setChecked (true); + p1Timer.start(1000); + } } - m_rxDone=true; + if (!m_diskData && m_beaconTxController.active ()) + { + processBeaconActions (m_beaconTxController.receiveCompleted ()); + } } } @@ -2551,49 +2853,6 @@ void MainWindow::startP1() p1.start (QDir::toNativeSeparators (QDir {QApplication::applicationDirPath ()}.absoluteFilePath ("wsprd")), m_cmndP1); } -QString MainWindow::save_wave_file (QString const& name, short const * data, int samples, - QString const& my_callsign, QString const& my_grid, QString const& mode, qint32 sub_mode, - Frequency frequency, QString const& his_call, QString const& his_grid) const -{ - // - // This member function runs in a thread and should not access - // members that may be changed in the GUI thread or any other thread - // without suitable synchronization. - // - QAudioFormat format; - format.setCodec ("audio/pcm"); - format.setSampleRate (12000); - format.setChannelCount (1); - format.setSampleSize (16); - format.setSampleType (QAudioFormat::SignedInt); - auto source = QString {"%1; %2"}.arg (my_callsign).arg (my_grid); - auto comment = QString {"Mode=%1%2; Freq=%3%4"} - .arg (mode) - .arg (QString {(mode.contains ('J') && !mode.contains ('+')) - || mode.startsWith ("FST4") || mode.startsWith ('Q') - ? QString {"; Sub Mode="} + QString::number (int (samples / 12000)) + QChar {'A' + sub_mode} - : QString {}}) - .arg (Radio::frequency_MHz_string (frequency)) - .arg (QString {mode!="WSPR" ? QString {"; DXCall=%1; DXGrid=%2"} - .arg (his_call) - .arg (his_grid).toLocal8Bit () : ""}); - BWFFile::InfoDictionary list_info { - {{{'I','S','R','C'}}, source.toLocal8Bit ()}, - {{{'I','S','F','T'}}, program_title (revision ()).simplified ().toLocal8Bit ()}, - {{{'I','C','R','D'}}, QDateTime::currentDateTimeUtc () - .toString ("yyyy-MM-ddTHH:mm:ss.zzzZ").toLocal8Bit ()}, - {{{'I','C','M','T'}}, comment.toLocal8Bit ()}, - }; - auto file_name = name + ".wav"; - BWFFile wav {format, file_name, list_info}; - if (!wav.open (BWFFile::WriteOnly) - || 0 > wav.write (reinterpret_cast (data) - , sizeof (short) * samples)) - { - return file_name + ": " + wav.errorString (); - } - return QString {}; -} //-------------------------------------------------------------- fastSink() void MainWindow::fastSink(qint64 frames) @@ -2603,14 +2862,15 @@ void MainWindow::fastSink(qint64 frames) filtered = false; ignored = false; m_muted = false; + if(k < m_k0) { //New sequence ? memcpy(fast_green2,fast_green,4*703); //Copy fast_green[] to fast_green2[] memcpy(fast_s2,fast_s,4*703*64); //Copy fast_s[] into fast_s2[] fast_jh2=fast_jh; - if(!m_diskData) memset(dec_data.d2,0,2*30*12000); //Zero the d2[] array m_bFastDecodeCalled=false; m_bDecoded=false; } + m_k0 = k; QDateTime tnow=QDateTime::currentDateTimeUtc(); int ihr=tnow.toString("hh").toInt(); @@ -2649,6 +2909,25 @@ void MainWindow::fastSink(qint64 frames) ui->signal_meter_widget->setValue(rmsNoGain,pxmax); // Update thermometer m_fastGraph->plotSpec(m_diskData,m_UTCdisk); + if(m_mode=="JTTY") { + jtty_decode(k); +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) + if (m_automated_test) + { + Q_EMIT liveAudioTestJttyFramesConsumed (k); + } +#endif + int detectorFrames = dec_data.params.kin; + if (!m_diskData) + { + QMutexLocker lock {&dec_data_mutex ()}; + detectorFrames = m_activeReceiveAudio + ? m_activeReceiveAudio->sourceFrames () : k; + } + if(detectorFrames - k < 10240) fast_decode_done(); + return; + } + if(bmsk144 and (line[0]!=0)) { QString message {QString::fromLatin1 (line)}; DecodedText decodedtext {message.replace (QChar::LineFeed, "")}; @@ -2656,318 +2935,42 @@ void MainWindow::fastSink(qint64 frames) QString text = decodedtext.string().replace("<","").replace(">",""); // for Wait features // Filtering for MSK144 - QString text2 = ""; - QStringList tw=text.mid(24).split(" ",SkipEmptyParts); - if (m_config.filters_for_word2()) { - if (tw.size () < 2) { - text2 = "___"; // prevent segfault errors with free text messages - } else if (tw[1].length() == 2 && tw[1].contains(QRegularExpression{"\\w\\w"})) { // directional calls - if (tw.size () > 2) { - text2 = tw[2]; // for directional calls analyze word 3 for filtering - } else { - text2 = "___"; // prevent segfault errors with free text messages - } - } else { - text2 = tw[1]; // otherwise analyze word 2 for filtering - } - if (!(SpecOp::NONE==m_specOp && m_config.AlwaysPass () // Always pass messages with keywords from Always Pass list - && ( - (text2.startsWith(m_config.Pass1()) && (m_config.Pass1()!="")) - || (text2.startsWith(m_config.Pass2()) && (m_config.Pass2()!="")) - || (text2.startsWith(m_config.Pass3()) && (m_config.Pass3()!="")) - || (text2.startsWith(m_config.Pass4()) && (m_config.Pass4()!="")) - || (text2.startsWith(m_config.Pass5()) && (m_config.Pass5()!="")) - || (text2.startsWith(m_config.Pass6()) && (m_config.Pass6()!="")) - || (text2.startsWith(m_config.Pass7()) && (m_config.Pass7()!="")) - || (text2.startsWith(m_config.Pass8()) && (m_config.Pass8()!="")) - || (text2.startsWith(m_config.Pass9()) && (m_config.Pass9()!="")) - || (text2.startsWith(m_config.Pass10()) && (m_config.Pass10()!="")) - || (text2.startsWith(m_config.Pass11()) && (m_config.Pass11()!="")) - || (text2.startsWith(m_config.Pass12()) && (m_config.Pass12()!="")) - ))) { - - // Filtering out messages with keywords from Blacklist - if (SpecOp::NONE==m_specOp && m_config.Blacklisted () - && ( - (text2.startsWith(m_config.Blacklist1()) && (m_config.Blacklist1()!="")) - || (text2.startsWith(m_config.Blacklist2()) && (m_config.Blacklist2()!="")) - || (text2.startsWith(m_config.Blacklist3()) && (m_config.Blacklist3()!="")) - || (text2.startsWith(m_config.Blacklist4()) && (m_config.Blacklist4()!="")) - || (text2.startsWith(m_config.Blacklist5()) && (m_config.Blacklist5()!="")) - || (text2.startsWith(m_config.Blacklist6()) && (m_config.Blacklist6()!="")) - || (text2.startsWith(m_config.Blacklist7()) && (m_config.Blacklist7()!="")) - || (text2.startsWith(m_config.Blacklist8()) && (m_config.Blacklist8()!="")) - || (text2.startsWith(m_config.Blacklist9()) && (m_config.Blacklist9()!="")) - || (text2.startsWith(m_config.Blacklist10()) && (m_config.Blacklist10()!="")) - || (text2.startsWith(m_config.Blacklist11()) && (m_config.Blacklist11()!="")) - || (text2.startsWith(m_config.Blacklist12()) && (m_config.Blacklist12()!="")) - )) { - if (!ui->cbBypass->isChecked()) filtered = true; - if (!(m_config.filters_for_Wait_and_Pounce_only() or ui->cbBypass->isChecked())) return; - // reset dB score when filtered - if (pounce && (ui->respondComboBox->currentText()=="CQ: Max Dist" - or ui->respondComboBox->currentText()=="CQ: Max dB" - or ui->respondComboBox->currentText()=="CQ: Min dB")) { - Dpoints=0; - maxDPoints=0; - dBpoints=-28; - dBpoints2=99; - maxdBPoints=-28; - mindBPoints=99; - } - - // Filtering out everything but messages with keywords from Whitelist - } else if (SpecOp::NONE==m_specOp && m_config.Whitelisted () - && !(text2.startsWith(m_config.Whitelist1()) && (m_config.Whitelist1()!="")) - && !(text2.startsWith(m_config.Whitelist2()) && (m_config.Whitelist2()!="")) - && !(text2.startsWith(m_config.Whitelist3()) && (m_config.Whitelist3()!="")) - && !(text2.startsWith(m_config.Whitelist4()) && (m_config.Whitelist4()!="")) - && !(text2.startsWith(m_config.Whitelist5()) && (m_config.Whitelist5()!="")) - && !(text2.startsWith(m_config.Whitelist6()) && (m_config.Whitelist6()!="")) - && !(text2.startsWith(m_config.Whitelist7()) && (m_config.Whitelist7()!="")) - && !(text2.startsWith(m_config.Whitelist8()) && (m_config.Whitelist8()!="")) - && !(text2.startsWith(m_config.Whitelist9()) && (m_config.Whitelist9()!="")) - && !(text2.startsWith(m_config.Whitelist10()) && (m_config.Whitelist10()!="")) - && !(text2.startsWith(m_config.Whitelist11()) && (m_config.Whitelist11()!="")) - && !(text2.startsWith(m_config.Whitelist12()) && (m_config.Whitelist12()!="")) - ) { - if (!ui->cbBypass->isChecked()) filtered = true; - if (!(m_config.filters_for_Wait_and_Pounce_only() or ui->cbBypass->isChecked())) return; - // reset dB score when filtered - if (pounce && (ui->respondComboBox->currentText()=="CQ: Max Dist" - or ui->respondComboBox->currentText()=="CQ: Max dB" - or ui->respondComboBox->currentText()=="CQ: Min dB")) { - Dpoints=0; - maxDPoints=0; - dBpoints=-28; - dBpoints2=99; - maxdBPoints=-28; - mindBPoints=99; - } - } - - // search logbook for filtering - if (ui->actionHideTerritory1->isChecked() or ui->actionHideTerritory2->isChecked() or - ui->actionHideTerritory3->isChecked() or ui->actionHideTerritory4->isChecked() or - ui->actionHideB4->isChecked() or ui->actionHideEU->isChecked() or ui->actionHideAS->isChecked() or - ui->actionHideNA->isChecked() or ui->actionHideSA->isChecked() or ui->actionHideAF->isChecked() or - ui->actionHideOC->isChecked() or ui->actionHideAN->isChecked()) { - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(/*out*/deCall,deGrid); - // search for country names - if (ui->actionHideTerritory1->isChecked() or ui->actionHideTerritory2->isChecked() or - ui->actionHideTerritory3->isChecked() or ui->actionHideTerritory4->isChecked()) { - auto const& looked_up = m_logBook.countries ()->lookup (deCall); - auto countryName = looked_up.entity_name; - // do some obvious abbreviations - countryName.replace ("Islands", "Is."); - countryName.replace ("Island", "Is."); - countryName.replace ("North ", "N. "); - countryName.replace ("Northern ", "N. "); - countryName.replace ("South ", "S. "); - countryName.replace ("East ", "E. "); - countryName.replace ("Eastern ", "E. "); - countryName.replace ("West ", "W. "); - countryName.replace ("Western ", "W. "); - countryName.replace ("Central ", "C. "); - countryName.replace (" and ", " & "); - countryName.replace ("Republic", "Rep."); - countryName.replace ("United States of America", "U.S.A."); - countryName.replace ("United States", "U.S.A."); - countryName.replace ("Fed. Rep. of ", ""); - countryName.replace ("French ", "Fr."); - countryName.replace ("Asiatic", "AS"); - countryName.replace ("European", "EU"); - countryName.replace ("African", "AF"); - if (ui->actionHideTerritory1->isChecked() && countryName.contains(m_config.Territory1()) - && (m_config.Territory1()!="") && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideTerritory2->isChecked() && countryName.contains(m_config.Territory2()) - && (m_config.Territory2()!="") && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideTerritory3->isChecked() && countryName.contains(m_config.Territory3()) - && (m_config.Territory3()!="") && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideTerritory4->isChecked() && countryName.contains(m_config.Territory4()) - && (m_config.Territory4()!="") && !ui->cbBypass->isChecked()) filtered = true; - } - // search for callsigns worked B4 on band - if (ui->actionHideB4->isChecked()) { - bool callB4onBand; - bool countryB4onBand; - bool gridB4onBand; - bool continentB4onBand; - bool CQZoneB4onBand; - bool ITUZoneB4onBand; - auto const& looked_up = m_logBook.countries ()->lookup (deCall); - m_logBook.match (deCall, m_mode, deGrid, looked_up, callB4onBand, countryB4onBand, gridB4onBand, - continentB4onBand, CQZoneB4onBand, ITUZoneB4onBand, m_currentBand); - if (callB4onBand && ui->actionHideB4->isChecked() && !ui->cbBypass->isChecked()) filtered = true; - } - // search for continents - if (ui->actionHideEU->isChecked() or ui->actionHideAS->isChecked() or ui->actionHideNA->isChecked() - or ui->actionHideSA->isChecked() or ui->actionHideAF->isChecked() or ui->actionHideOC->isChecked() - or ui->actionHideAN->isChecked()) { - auto const& looked_up = m_logBook.countries ()->lookup (deCall); - QString continent = AD1CCty::continent (looked_up.continent); - if (ui->actionHideEU->isChecked() && continent == "EU" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideAS->isChecked() && continent == "AS" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideNA->isChecked() && continent == "NA" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideSA->isChecked() && continent == "SA" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideAF->isChecked() && continent == "AF" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideOC->isChecked() && continent == "OC" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideAN->isChecked() && continent == "AN" && !ui->cbBypass->isChecked()) filtered = true; - } - } - } - } else { - if (!(SpecOp::NONE==m_specOp && m_config.AlwaysPass () // Always pass messages with keywords from Always Pass list - && ( - (text.contains(m_config.Pass1()) && (m_config.Pass1()!="")) - || (text.contains(m_config.Pass2()) && (m_config.Pass2()!="")) - || (text.contains(m_config.Pass3()) && (m_config.Pass3()!="")) - || (text.contains(m_config.Pass4()) && (m_config.Pass4()!="")) - || (text.contains(m_config.Pass5()) && (m_config.Pass5()!="")) - || (text.contains(m_config.Pass6()) && (m_config.Pass6()!="")) - || (text.contains(m_config.Pass7()) && (m_config.Pass7()!="")) - || (text.contains(m_config.Pass8()) && (m_config.Pass8()!="")) - || (text.contains(m_config.Pass9()) && (m_config.Pass9()!="")) - || (text.contains(m_config.Pass10()) && (m_config.Pass10()!="")) - || (text.contains(m_config.Pass11()) && (m_config.Pass11()!="")) - || (text.contains(m_config.Pass12()) && (m_config.Pass12()!="")) - ))) { - - // Filtering out messages with keywords from Blacklist - if (SpecOp::NONE==m_specOp && m_config.Blacklisted () - && ( - (text.contains(m_config.Blacklist1()) && (m_config.Blacklist1()!="")) - || (text.contains(m_config.Blacklist2()) && (m_config.Blacklist2()!="")) - || (text.contains(m_config.Blacklist3()) && (m_config.Blacklist3()!="")) - || (text.contains(m_config.Blacklist4()) && (m_config.Blacklist4()!="")) - || (text.contains(m_config.Blacklist5()) && (m_config.Blacklist5()!="")) - || (text.contains(m_config.Blacklist6()) && (m_config.Blacklist6()!="")) - || (text.contains(m_config.Blacklist7()) && (m_config.Blacklist7()!="")) - || (text.contains(m_config.Blacklist8()) && (m_config.Blacklist8()!="")) - || (text.contains(m_config.Blacklist9()) && (m_config.Blacklist9()!="")) - || (text.contains(m_config.Blacklist10()) && (m_config.Blacklist10()!="")) - || (text.contains(m_config.Blacklist11()) && (m_config.Blacklist11()!="")) - || (text.contains(m_config.Blacklist12()) && (m_config.Blacklist12()!="")) - )) { - if (!ui->cbBypass->isChecked()) filtered = true; - if (!(m_config.filters_for_Wait_and_Pounce_only() or ui->cbBypass->isChecked())) return; - // reset dB score when filtered - if (pounce && (ui->respondComboBox->currentText()=="CQ: Max Dist" - or ui->respondComboBox->currentText()=="CQ: Max dB" - or ui->respondComboBox->currentText()=="CQ: Min dB")) { - Dpoints=0; - maxDPoints=0; - dBpoints=-28; - dBpoints2=99; - maxdBPoints=-28; - mindBPoints=99; - } - - // Filtering out everything but messages with keywords from Whitelist - } else if (SpecOp::NONE==m_specOp && m_config.Whitelisted () - && !(text.contains(m_config.Whitelist1()) && (m_config.Whitelist1()!="")) - && !(text.contains(m_config.Whitelist2()) && (m_config.Whitelist2()!="")) - && !(text.contains(m_config.Whitelist3()) && (m_config.Whitelist3()!="")) - && !(text.contains(m_config.Whitelist4()) && (m_config.Whitelist4()!="")) - && !(text.contains(m_config.Whitelist5()) && (m_config.Whitelist5()!="")) - && !(text.contains(m_config.Whitelist6()) && (m_config.Whitelist6()!="")) - && !(text.contains(m_config.Whitelist7()) && (m_config.Whitelist7()!="")) - && !(text.contains(m_config.Whitelist8()) && (m_config.Whitelist8()!="")) - && !(text.contains(m_config.Whitelist9()) && (m_config.Whitelist9()!="")) - && !(text.contains(m_config.Whitelist10()) && (m_config.Whitelist10()!="")) - && !(text.contains(m_config.Whitelist11()) && (m_config.Whitelist11()!="")) - && !(text.contains(m_config.Whitelist12()) && (m_config.Whitelist12()!="")) - ) { - if (!ui->cbBypass->isChecked()) filtered = true; - if (!(m_config.filters_for_Wait_and_Pounce_only() or ui->cbBypass->isChecked())) return; - // reset dB score when filtered - if (pounce && (ui->respondComboBox->currentText()=="CQ: Max Dist" - or ui->respondComboBox->currentText()=="CQ: Max dB" - or ui->respondComboBox->currentText()=="CQ: Min dB")) { - Dpoints=0; - maxDPoints=0; - dBpoints=-28; - dBpoints2=99; - maxdBPoints=-28; - mindBPoints=99; - } - } - - // search logbook for filtering - if (ui->actionHideTerritory1->isChecked() or ui->actionHideTerritory2->isChecked() or - ui->actionHideTerritory3->isChecked() or ui->actionHideTerritory4->isChecked() or - ui->actionHideB4->isChecked() or ui->actionHideEU->isChecked() or ui->actionHideAS->isChecked() or - ui->actionHideNA->isChecked() or ui->actionHideSA->isChecked() or ui->actionHideAF->isChecked() or - ui->actionHideOC->isChecked() or ui->actionHideAN->isChecked()) { - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(/*out*/deCall,deGrid); - // search for country names - if (ui->actionHideTerritory1->isChecked() or ui->actionHideTerritory2->isChecked() or - ui->actionHideTerritory3->isChecked() or ui->actionHideTerritory4->isChecked()) { - auto const& looked_up = m_logBook.countries ()->lookup (deCall); - auto countryName = looked_up.entity_name; - // do some obvious abbreviations - countryName.replace ("Islands", "Is."); - countryName.replace ("Island", "Is."); - countryName.replace ("North ", "N. "); - countryName.replace ("Northern ", "N. "); - countryName.replace ("South ", "S. "); - countryName.replace ("East ", "E. "); - countryName.replace ("Eastern ", "E. "); - countryName.replace ("West ", "W. "); - countryName.replace ("Western ", "W. "); - countryName.replace ("Central ", "C. "); - countryName.replace (" and ", " & "); - countryName.replace ("Republic", "Rep."); - countryName.replace ("United States of America", "U.S.A."); - countryName.replace ("United States", "U.S.A."); - countryName.replace ("Fed. Rep. of ", ""); - countryName.replace ("French ", "Fr."); - countryName.replace ("Asiatic", "AS"); - countryName.replace ("European", "EU"); - countryName.replace ("African", "AF"); - if (ui->actionHideTerritory1->isChecked() && countryName.contains(m_config.Territory1()) - && (m_config.Territory1()!="") && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideTerritory2->isChecked() && countryName.contains(m_config.Territory2()) - && (m_config.Territory2()!="") && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideTerritory3->isChecked() && countryName.contains(m_config.Territory3()) - && (m_config.Territory3()!="") && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideTerritory4->isChecked() && countryName.contains(m_config.Territory4()) - && (m_config.Territory4()!="") && !ui->cbBypass->isChecked()) filtered = true; - } - // search for callsigns worked B4 on band - if (ui->actionHideB4->isChecked()) { - bool callB4onBand; - bool countryB4onBand; - bool gridB4onBand; - bool continentB4onBand; - bool CQZoneB4onBand; - bool ITUZoneB4onBand; - auto const& looked_up = m_logBook.countries ()->lookup (deCall); - m_logBook.match (deCall, m_mode, deGrid, looked_up, callB4onBand, countryB4onBand, gridB4onBand, - continentB4onBand, CQZoneB4onBand, ITUZoneB4onBand, m_currentBand); - if (callB4onBand && ui->actionHideB4->isChecked() && !ui->cbBypass->isChecked()) filtered = true; - } - // search for continents - if (ui->actionHideEU->isChecked() or ui->actionHideAS->isChecked() or ui->actionHideNA->isChecked() - or ui->actionHideSA->isChecked() or ui->actionHideAF->isChecked() or ui->actionHideOC->isChecked() - or ui->actionHideAN->isChecked()) { - auto const& looked_up = m_logBook.countries ()->lookup (deCall); - QString continent = AD1CCty::continent (looked_up.continent); - if (ui->actionHideEU->isChecked() && continent == "EU" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideAS->isChecked() && continent == "AS" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideNA->isChecked() && continent == "NA" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideSA->isChecked() && continent == "SA" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideAF->isChecked() && continent == "AF" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideOC->isChecked() && continent == "OC" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideAN->isChecked() && continent == "AN" && !ui->cbBypass->isChecked()) filtered = true; - } - } - } - } + MessageFilterLogic::FilterContext ctx; + ctx.specOp = m_specOp; + ctx.bypass = ui->cbBypass->isChecked(); + ctx.filtersForWord2 = m_config.filters_for_word2(); + ctx.filtersForWaitAndPounceOnly = m_config.filters_for_Wait_and_Pounce_only(); + ctx.alwaysPass = m_config.AlwaysPass(); + ctx.blacklisted = m_config.Blacklisted(); + ctx.whitelisted = m_config.Whitelisted(); + ctx.passKeywords = m_config.pass_keywords(); + ctx.blacklistKeywords = m_config.blacklist_keywords(); + ctx.whitelistKeywords = m_config.whitelist_keywords(); + ctx.hideTerritory1 = ui->actionHideTerritory1->isChecked(); + ctx.hideTerritory2 = ui->actionHideTerritory2->isChecked(); + ctx.hideTerritory3 = ui->actionHideTerritory3->isChecked(); + ctx.hideTerritory4 = ui->actionHideTerritory4->isChecked(); + ctx.hideB4 = ui->actionHideB4->isChecked(); + ctx.hideEU = ui->actionHideEU->isChecked(); + ctx.hideAS = ui->actionHideAS->isChecked(); + ctx.hideNA = ui->actionHideNA->isChecked(); + ctx.hideSA = ui->actionHideSA->isChecked(); + ctx.hideAF = ui->actionHideAF->isChecked(); + ctx.hideOC = ui->actionHideOC->isChecked(); + ctx.hideAN = ui->actionHideAN->isChecked(); + ctx.territory1 = m_config.Territory1(); + ctx.territory2 = m_config.Territory2(); + ctx.territory3 = m_config.Territory3(); + ctx.territory4 = m_config.Territory4(); + ctx.currentBand = m_currentBand; + ctx.mode = m_mode; + ctx.pounce = pounce; + ctx.respondPolicy = autoRespondPolicy (); + + auto filterResult = MessageFilterLogic::evaluateMSK144(decodedtext, ctx, &m_logBook); + if (filterResult.filtered) filtered = true; + if (filterResult.resetPoints) m_autoRespondScores.reset(); + if (filterResult.shouldReturn) return; // hide or ignore callsigns for MSK144 if (ui->actionHideIgnored->isChecked() or ui->actionHideToday->isChecked() or ui->actionIgnoreIgnored->isChecked() or ui->actionIgnoreToday->isChecked()) { @@ -3011,157 +3014,18 @@ void MainWindow::fastSink(qint64 frames) } } - // Stop Wait & Call timeout when in QSO with this station for MSK144 - if (ui->DX_Call_Button->isChecked() && m_hisCall!="" && text.contains(" " + m_config.my_callsign() + " " + m_hisCall)) { - stopWCTimer.stop(); // stop any Wait & Call timeout - if (ui->DX_Call_Button->isChecked()) ui->DX_Call_Button->click (); // disable Wait & Call - no_wait_and_call = false; // reset Wait & Call - } - - // Wait & Reply for MSK144 - if (text.contains(" " + m_config.my_callsign() + " " + m_hisCall) && m_hisCall!="" && - !text.contains("73 ") && m_mode=="MSK144" && m_config.Wait_features_enabled() - && !ui->autoButton->isChecked() - && (!(ui->actionFull_Duplex_Mode->isChecked() && m_txing))) { - tx_watchdog (false); - m_bDoubleClicked = true; - processMessage(decodedtext); - auto_tx_mode(true); - stopWRTimer.start(int(12000.0*m_TRperiod)); // Wait & Reply Tx max 12*TRperiod - } - - // Wait & Call for MSK144 - if (m_mode=="MSK144" && wait_and_call && m_specOp!=SpecOp::FOX && ui->cbAutoSeq->isChecked() && - m_hisCall!="" && (text.contains("CQ " + m_hisCall) or text.contains("CQ DX " + m_hisCall) or text.contains(m_hisCall + " RR73") - or text.contains(m_hisCall + " RRR") or text.contains(m_hisCall + " 73")) && m_config.Wait_features_enabled() - && (!(ui->actionFull_Duplex_Mode->isChecked() && m_txing))) { - m_bDoubleClicked = true; - processMessage(decodedtext); - auto_tx_mode(true); - no_wait_and_call = true; - stopWCTimer.start(int(6200.0*m_TRperiod)); // Wait & Call Tx max 6*TRperiod - } - - // CQ: First for MSK144 - if(((pounce && text.contains(" CQ ") && m_config.Wait_features_enabled()) - or (m_auto && m_bCallingCQ && text.contains(" " + m_config.my_callsign() + " "))) && !ignored - && !filtered && !selected && ui->respondComboBox->isVisible() && ui->respondComboBox->currentText()=="CQ: First" - && (!(ui->actionFull_Duplex_Mode->isChecked() && m_txing))) { - m_bDoubleClicked=true; - selected = true; - auto_tx_mode(true); - processMessage(decodedtext); - auto now = QDateTime::currentDateTimeUtc(); - m_dateTimeQSOOn = now.addSecs (-(m_ntx - 1) * int(m_TRperiod) - int(fmod(double(now.time().second()),m_TRperiod))); - QTimer::singleShot (6000, [=] {selected = false;}); - if (pounce) stopWCTimer.start(int(6200.0*m_TRperiod)); // Tx max 6*TRperiod - } - - // CQ: Max Dist for MSK144 - if((pounce or m_auto) && ui->respondComboBox->isVisible() && ui->respondComboBox->currentText()=="CQ: Max Dist" - && (!(ui->actionFull_Duplex_Mode->isChecked() && m_txing))) { - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(/*out*/deCall,deGrid); - if (!filtered && !ignored && (deGrid.contains(grid_regexp) or m_bCallingCQ) && ( - (pounce && text.contains(" CQ ") && !txLog.contains(deCall) && m_config.Wait_features_enabled()) or - (m_bCallingCQ && text.contains(" " + m_config.my_callsign() + " ") && !text.contains("73 ")) - )) { - double utch=0.0; - int nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter; - azdist_(const_cast ((m_config.my_grid () + " ").left (6).toLatin1().constData()), - const_cast ((deGrid + " ").left (6).toLatin1().constData()),&utch, - &nAz,&nEl,&nDmiles,&nDkm,&nHotAz,&nHotABetter,6,6); - Dpoints=nDkm; - if (!deGrid.contains(grid_regexp)) Dpoints=1; - if(Dpoints>maxDPoints) { - maxDPoints=Dpoints; - m_deCall=deCall; - m_bDoubleClicked=true; - if ((pounce && text.contains(" CQ ") && m_config.Wait_features_enabled()) or m_auto) { - auto_tx_mode(true); - processMessage(decodedtext); - if (pounce) stopWCTimer.start(int(6200.0*m_TRperiod)); // Tx max 6*TRperiod - } - ui->dxCallEntry->setText(deCall); - genStdMsgs(QString::number(decodedtext.snr())); - ui->RxFreqSpinBox->setValue(decodedtext.frequencyOffset()); - setTxMsg(m_ntx); - m_currentMessageType=m_ntx; - auto now = QDateTime::currentDateTimeUtc(); - m_dateTimeQSOOn = now.addSecs (-(m_ntx - 1) * int(m_TRperiod) - int(fmod(double(now.time().second()),m_TRperiod))); - } - } - } - - // CQ: Max dB for MSK144 - if((pounce or m_auto) && ui->respondComboBox->isVisible() && ui->respondComboBox->currentText()=="CQ: Max dB" - && (!(ui->actionFull_Duplex_Mode->isChecked() && m_txing))) { - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(/*out*/deCall,deGrid); - if (!filtered && !ignored && ( - (pounce && text.contains(" CQ ") && !txLog.contains(deCall) && m_config.Wait_features_enabled()) or - (m_bCallingCQ && text.contains(" " + m_config.my_callsign() + " ") && !text.contains("73 ")) - )) { - dBpoints=decodedtext.string().mid(7,3).toInt(); - if(dBpoints>maxdBPoints) { - maxdBPoints=dBpoints; - m_deCall=deCall; - m_bDoubleClicked=true; - if ((pounce && text.contains(" CQ ") && m_config.Wait_features_enabled()) or m_auto) { - auto_tx_mode(true); - processMessage(decodedtext); - if (pounce) stopWCTimer.start(int(6200.0*m_TRperiod)); // Tx max 6*TRperiod - } - ui->dxCallEntry->setText(deCall); - genStdMsgs(QString::number(decodedtext.snr())); - ui->RxFreqSpinBox->setValue(decodedtext.frequencyOffset()); - setTxMsg(m_ntx); - m_currentMessageType=m_ntx; - auto now = QDateTime::currentDateTimeUtc(); - m_dateTimeQSOOn = now.addSecs (-(m_ntx - 1) * int(m_TRperiod) - int(fmod(double(now.time().second()),m_TRperiod))); - } - } - } + if (processWaitReplyCall( + decodedtext, DecodedMessageReaction::WaitDecodeSource::Msk144FastDecoder) + == DecodedMessageReaction::ReactionDisposition::IgnoreDecode) return; - // CQ: Min dB for MSK144 - if((pounce or m_auto) && ui->respondComboBox->isVisible() && ui->respondComboBox->currentText()=="CQ: Min dB" - && (!(ui->actionFull_Duplex_Mode->isChecked() && m_txing))) { - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(/*out*/deCall,deGrid); - if (!filtered && !ignored && ( - (pounce && text.contains(" CQ ") && !txLog.contains(deCall) && m_config.Wait_features_enabled()) or - (m_bCallingCQ && text.contains(" " + m_config.my_callsign() + " ") && !text.contains("73 ")) - )) { - dBpoints2=decodedtext.string().mid(7,3).toInt(); - if(dBpoints2dxCallEntry->setText(deCall); - genStdMsgs(QString::number(decodedtext.snr())); - ui->RxFreqSpinBox->setValue(decodedtext.frequencyOffset()); - setTxMsg(m_ntx); - m_currentMessageType=m_ntx; - auto now = QDateTime::currentDateTimeUtc(); - m_dateTimeQSOOn = now.addSecs (-(m_ntx - 1) * int(m_TRperiod) - int(fmod(double(now.time().second()),m_TRperiod))); - } - } - } + updateRespondTarget(decodedtext, text, pounce, m_dateTimeSeqStart, m_diskData); // show distance and bearing for MSK144 if (!filtered or m_config.filters_for_Wait_and_Pounce_only()) { QString distance; QString deCall; QString deGrid; decodedtext.deCallAndGrid(deCall,deGrid); - if ((m_config.showDistance() || m_config.showAzimuth()) && deGrid.contains(grid_regexp)) { + if ((m_config.showDistance() || m_config.showAzimuth()) && deGrid.contains(MainWindow::grid_regexp)) { double utch=0.0; int nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter; QString my_Grid = m_config.my_grid(); @@ -3188,12 +3052,12 @@ void MainWindow::fastSink(qint64 frames) // insert blank line for MSK144 int ntime=6; - if ((m_config.insert_blank() or m_config.alert_Enabled()) && !BlankLineInserted && (text.left(ntime) != m_tBlankLine) && text.left(4).contains(QRegularExpression {"\\d\\d\\d\\d"}) && !m_diskData) { + if ((m_config.insert_blank() or m_config.alert_Enabled()) && !BlankLineInserted && (text.left(ntime) != m_tBlankLine) && text.left(4).contains(four_digit_regexp) && !m_diskData) { ui->decodedTextBrowser->new_period (); if (m_config.insert_blank () && (!filtered or m_config.filters_for_Wait_and_Pounce_only())) { QString band; if(((QDateTime::currentMSecsSinceEpoch() / 1000 - m_secBandChanged) > 4*int(m_TRperiod)/4) or m_displayBand) { - band = ' ' + m_config.bands ()->find (m_freqNominal); + band = ' ' + m_config.bands ()->find (m_operatingFrequency.rx ()); } if (m_config.insert_blank ()) { if (ui->actionUse_Dark_Style->isChecked()) { @@ -3239,12 +3103,13 @@ void MainWindow::fastSink(qint64 frames) if (m_mode=="MSK144" && text.mid(22).contains(m_baseCall + " " + m_hisCall + " 73")) { ui->decodedTextBrowser2->displayDecodedText (decodedtext, m_config.my_callsign (), m_mode, m_config.DXCC (), m_logBook, m_currentBand, m_config.ppfx (), false, false, 0.0, false, -99, "", m_muted); + applyHighlighting(decodedtext, ui->decodedTextBrowser2, false, play_Wanted, play_DXcall); } } // Ensure that Tx stops when "73" is received and repeat_Tx is enabled for MSK144 - if (m_config.repeat_Tx() && m_mode=="MSK144" && m_hisCall!="" && text.contains(m_baseCall) && text.contains(m_hisCall + " 73") && m_send_RR73) - QTimer::singleShot (int(750*m_TRperiod), [=] {cease_auto_Tx_after_QSO();}); + if (m_config.repeat_Tx() && m_mode=="MSK144" && m_hisCall!="" && text.contains(m_baseCall) && text.contains(m_hisCall + " 73") && send_rr73_for_tx4 ()) + QTimer::singleShot (int(750*m_TRperiod), this, [=] {cease_auto_Tx_after_QSO();}); // highlight orange and blue callsigns for MSK144 if(m_config.highlight_orange() or (m_config.highlight_blue()) or ui->actionHighlight_Whitelist_entries->isChecked()) { @@ -3253,8 +3118,8 @@ void MainWindow::fastSink(qint64 frames) decodedtext.deCallAndGrid(/*out*/deCall,deGrid); QStringList tw; tw=text.mid(22).split(" ",SkipEmptyParts); - if (m_config.highlight_orange() && deCall.size()>2 && (m_config.highlight_orange_callsigns().contains(deCall + ",") - or m_config.highlight_orange_callsigns().contains(deCall.left(3) + ";") or m_config.highlight_orange_callsigns().contains(deCall.left(2) + ";"))) { + if (m_config.highlight_orange() && deCall.size()>2 + && HighlightingRules::matchesCallsignPrefix(m_config.highlight_orange_callsigns(), deCall)) { ui->decodedTextBrowser->highlight_callsign(deCall, QColor(225,75,0), QColor(255,255,255), true); if (m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted) play_Wanted = true; } @@ -3262,8 +3127,8 @@ void MainWindow::fastSink(qint64 frames) ui->decodedTextBrowser->highlight_callsign(deGrid, QColor(225,75,0), QColor(255,255,255), true); if (m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted) play_Wanted = true; } - if (m_config.highlight_blue() && deCall.size()>2 && (m_config.highlight_blue_callsigns().contains(deCall + ",") - or m_config.highlight_blue_callsigns().contains(deCall.left(3) + ";") or m_config.highlight_blue_callsigns().contains(deCall.left(2) + ";"))) { + if (m_config.highlight_blue() && deCall.size()>2 + && HighlightingRules::matchesCallsignPrefix(m_config.highlight_blue_callsigns(), deCall)) { ui->decodedTextBrowser->highlight_callsign(deCall, QColor(0,100,255), QColor(255,255,255), true); if (m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted) play_Wanted = true; } @@ -3273,29 +3138,20 @@ void MainWindow::fastSink(qint64 frames) } // highlight directional calls if (tw.size () > 2) { - if (m_config.highlight_orange() && tw[0]=="CQ" && m_config.highlight_orange_callsigns().contains("," + tw[1] + ",")) { + if (m_config.highlight_orange() && tw[0]=="CQ" + && HighlightingRules::matchesDirectionalCall(m_config.highlight_orange_callsigns(), tw[1])) { ui->decodedTextBrowser->highlight_callsign(tw[1], QColor(225,75,0), QColor(255,255,255), true); if (m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted && tw[1]!="") play_Wanted = true; } - if (m_config.highlight_blue() && tw[0]=="CQ" && m_config.highlight_blue_callsigns().contains("," + tw[1] + ",")) { + if (m_config.highlight_blue() && tw[0]=="CQ" + && HighlightingRules::matchesDirectionalCall(m_config.highlight_blue_callsigns(), tw[1])) { ui->decodedTextBrowser->highlight_callsign(tw[1], QColor(0,100,255), QColor(255,255,255), true); if (m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted && tw[1]!="") play_Wanted = true; } } // highlight Whitelist entries if (ui->actionHighlight_Whitelist_entries->isChecked() && deCall.size()>2 && - ((deCall.contains(m_config.Whitelist1()) && m_config.Whitelist1() != "") - or (deCall.contains(m_config.Whitelist2()) && m_config.Whitelist2() != "") - or (deCall.contains(m_config.Whitelist3()) && m_config.Whitelist3() != "") - or (deCall.contains(m_config.Whitelist4()) && m_config.Whitelist4() != "") - or (deCall.contains(m_config.Whitelist5()) && m_config.Whitelist5() != "") - or (deCall.contains(m_config.Whitelist6()) && m_config.Whitelist6() != "") - or (deCall.contains(m_config.Whitelist7()) && m_config.Whitelist7() != "") - or (deCall.contains(m_config.Whitelist8()) && m_config.Whitelist8() != "") - or (deCall.contains(m_config.Whitelist9()) && m_config.Whitelist9() != "") - or (deCall.contains(m_config.Whitelist10()) && m_config.Whitelist10() != "") - or (deCall.contains(m_config.Whitelist11()) && m_config.Whitelist11() != "") - or (deCall.contains(m_config.Whitelist12()) && m_config.Whitelist12() != ""))) { + MessageFilter::containsAny(deCall, m_config.whitelist_keywords())) { ui->decodedTextBrowser->highlight_callsign(deCall, QColor(170,0,127), QColor(255,255,255), true); if (m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted) play_Wanted = true; } @@ -3334,27 +3190,7 @@ void MainWindow::fastSink(qint64 frames) if (ui->actionHighlightTerritory1->isChecked() or ui->actionHighlightTerritory2->isChecked() or ui->actionHighlightTerritory3->isChecked() or ui->actionHighlightTerritory4->isChecked()) { auto const& looked_up = m_logBook.countries ()->lookup (deCall); - auto countryName = looked_up.entity_name; - // do some obvious abbreviations - countryName.replace ("Islands", "Is."); - countryName.replace ("Island", "Is."); - countryName.replace ("North ", "N. "); - countryName.replace ("Northern ", "N. "); - countryName.replace ("South ", "S. "); - countryName.replace ("East ", "E. "); - countryName.replace ("Eastern ", "E. "); - countryName.replace ("West ", "W. "); - countryName.replace ("Western ", "W. "); - countryName.replace ("Central ", "C. "); - countryName.replace (" and ", " & "); - countryName.replace ("Republic", "Rep."); - countryName.replace ("United States of America", "U.S.A."); - countryName.replace ("United States", "U.S.A."); - countryName.replace ("Fed. Rep. of ", ""); - countryName.replace ("French ", "Fr."); - countryName.replace ("Asiatic", "AS"); - countryName.replace ("European", "EU"); - countryName.replace ("African", "AF"); + auto countryName =looked_up.abbreviated_entity_name; if (ui->actionHighlightTerritory1->isChecked() && countryName.contains(m_config.Territory1()) && (m_config.Territory1()!="") && !ui->cbBypass->isChecked()) ui->decodedTextBrowser->highlight_callsign(deCall, QColor(115,43,245), QColor(255,255,255), true); if (ui->actionHighlightTerritory2->isChecked() && countryName.contains(m_config.Territory2()) @@ -3373,43 +3209,17 @@ void MainWindow::fastSink(qint64 frames) if (m_config.highlight_DXcall()) { // repeated highlighting to override JTAlert ui->decodedTextBrowser->highlight_callsign(m_hisCall, QColor(255,0,0), QColor(255,255,255), true); - QTimer::singleShot (500, [=] {ui->decodedTextBrowser->highlight_callsign(m_hisCall, QColor(255,0,0), QColor(255,255,255), true);}); - QTimer::singleShot (1000, [=] {ui->decodedTextBrowser->highlight_callsign(m_hisCall, QColor(255,0,0), QColor(255,255,255), true);}); - QTimer::singleShot (2500, [=] {ui->decodedTextBrowser->highlight_callsign(m_hisCall, QColor(255,0,0), QColor(255,255,255), true);}); + QTimer::singleShot (500, this, [=] {ui->decodedTextBrowser->highlight_callsign(m_hisCall, QColor(255,0,0), QColor(255,255,255), true);}); + QTimer::singleShot (1000, this, [=] {ui->decodedTextBrowser->highlight_callsign(m_hisCall, QColor(255,0,0), QColor(255,255,255), true);}); + QTimer::singleShot (2500, this, [=] {ui->decodedTextBrowser->highlight_callsign(m_hisCall, QColor(255,0,0), QColor(255,255,255), true);}); } } if (!pounce && (m_config.highlight_DXgrid () or m_config.alert_Enabled()) && (m_hisGrid!="") && (decodedtext.string().contains(m_hisGrid.left(4)))) { if (m_config.highlight_DXgrid()) ui->decodedTextBrowser->highlight_callsign(m_hisGrid.left(4), QColor(0,0,200), QColor(255,255,255), true); if (m_config.alert_Enabled() && m_config.alert_DXcall() && !m_muted) play_DXcall = true; } - QTimer::singleShot (100, [=] { - if (m_config.alert_Enabled() && ((m_config.alert_DXcall() && play_DXcall && m_hisCall!="") or (m_config.alert_Wanted() && play_Wanted))) { -#ifdef WIN32 - QAudioOutput info(QAudioDeviceInfo::defaultOutputDevice()); - QString audioPath = app_sounds_directory (m_config.voicesPath()); - QAudioFormat format; - format.setCodec("audio/pcm"); - format.setSampleRate (48000); - format.setChannelCount (1); - format.setSampleSize (16); - format.setSampleType(QAudioFormat::SignedInt); - QAudioOutput* audio; - audio = new QAudioOutput(format, this); - connect(audio, SIGNAL(stateChanged(QAudio::State)), this, SLOT(handleStateChanged(QAudio::State))); - QFile *effect1 = new QFile(this); - if (m_config.alert_DXcall() && play_DXcall) effect1->setFileName(QString("%1/%2").arg(audioPath, "DXcall.wav")); - else if (m_config.alert_Wanted() && play_Wanted) effect1->setFileName(QString("%1/%2").arg(audioPath, "Wanted.wav")); - effect1->open(QIODevice::ReadOnly); - audio->start(effect1); -#else - QString audioPath = app_sounds_directory (m_config.voicesPath()); - if (m_config.alert_DXcall() && play_DXcall) QSound::play(audioPath + "DXcall.wav"); // for Linux and macOS - else if (m_config.alert_Wanted() && play_Wanted) QSound::play(audioPath + "Wanted.wav"); // for Linux and macOS -#endif - play_DXcall = false; - play_Wanted = false; - } - }); + playDecodeAlertSound(play_Wanted, play_DXcall); + play_Wanted = play_DXcall = false; m_bDecoded=true; auto_sequence (decodedtext, ui->sbFtol->value (), std::numeric_limits::max ()); @@ -3430,7 +3240,6 @@ void MainWindow::fastSink(qint64 frames) m_bFastDone=true; } - m_k0=k; if(m_diskData and m_k0 >= dec_data.params.kin - 7 * 512) decodeNow=true; if(!m_diskData and m_tRemaining<0.35 and !m_bFastDecodeCalled) decodeNow=true; if(m_mode=="MSK144") decodeNow=false; @@ -3441,7 +3250,7 @@ void MainWindow::fastSink(qint64 frames) m_t1=k/12000.0; m_kdone=k; dec_data.params.newdat=1; - if(!m_decoderBusy) { + if(!decoderBusy ()) { m_bFastDecodeCalled=true; decode(); } @@ -3456,11 +3265,15 @@ void MainWindow::fastSink(qint64 frames) m_fnameWE = m_config.save_directory ().absoluteFilePath (period_start.toString ("yyMMdd_hhmmss")); if(m_saveAll or m_bAltV or (m_bDecoded and m_saveDecoded) or (m_mode!="MSK144")) { m_bAltV=false; - // the following is potential a threading hazard - not a good - // idea to pass pointer to be processed in another thread - m_saveWAVWatcher.setFuture (QtConcurrent::run (std::bind (&MainWindow::save_wave_file, - this, m_fnameWE, &dec_data.d2[0], int(m_TRperiod*12000.0), m_config.my_callsign(), - m_config.my_grid(), m_mode, m_nSubMode, m_freqNominal, m_hisCall, m_hisGrid))); + double dgrd_value = 0.0; + QString dgrd; + if(m_astroWidget) { + dgrd_value = m_astroWidget->getDgrd(); + dgrd = QString("%1").arg(dgrd_value, 0, 'f', 1); + } else { + dgrd = "NoVal"; + } + save_wave_file (m_fnameWE, int (m_TRperiod * 12000.0), m_operatingFrequency.rx (), dgrd); } if(m_mode!="MSK144") { killFileTimer.start (int(750.0*m_TRperiod)); //Kill 3/4 period from now @@ -3472,62 +3285,32 @@ void MainWindow::fastSink(qint64 frames) m_fCPUmskrtd=0.9*m_fCPUmskrtd + 0.1*tsec; } -void MainWindow::showSoundInError(const QString& errorMsg) -{ - if (m_splash && m_splash->isVisible ()) m_splash->hide (); - MessageBox::critical_message (this, tr ("Error in Sound Input"), errorMsg); -} - -void MainWindow::showSoundOutError(const QString& errorMsg) -{ - if (m_splash && m_splash->isVisible ()) m_splash->hide (); - MessageBox::critical_message (this, tr ("Error in Sound Output"), errorMsg); -} - -void MainWindow::showStatusMessage(const QString& statusMsg) -{ - statusBar()->showMessage(statusMsg, 5000); -} void MainWindow::showQSYMessage(QString message) { QString the_line = message; QString qCall = QString(Radio::base_callsign(m_config.my_callsign ())); QString qDXCall = QString(Radio::base_callsign(ui->dxCallEntry->text())); - if(the_line.mid(22).contains(QString("."))) { + if(QSYMessageParser::mightContainMessage(the_line.mid(22))) { if(!(the_line.contains("OKQSY") || the_line.contains("NOQSY"))) { QStringList bhList = the_line.split(" ",SkipEmptyParts); - QString the_message = ""; - QString the_call = ""; - for (const QString &element : bhList) { - if(element.contains(QString("."))) { - the_message = element.mid(element.indexOf("." ) + 1); - the_call = element.mid(0,element.indexOf("." )); - if(the_message.length() > 0) { - QString finalMatch = ""; - QRegularExpression re1("[A-Z479][V0123456789ABCDEFGHIJKLRW][0-9]{3}"); - QRegularExpressionMatch match = re1.match(the_message); - if(match.hasMatch()) { - finalMatch = match.captured(); - if(the_call == qCall && ui->actionEnable_QSY_Popups->isChecked()) { - if(m_QSYMessageWidget) m_QSYMessageWidget->write_settings(); - m_QSYMessageWidget.reset (new QSYMessage(finalMatch, qCall, m_settings, &m_config)); - - //connect to signal finish - connect (this, &MainWindow::finished, &QSYMessage::close); - - //connect to signal from QSYMessage - connect (m_QSYMessageWidget.data (), &QSYMessage::sendReply, this, &MainWindow::reply_tx5,static_cast(Qt::UniqueConnection)); - m_QSYMessageWidget->setWindowFlags(m_QSYMessageWidget->windowFlags() | Qt::WindowStaysOnTopHint); - m_QSYMessageWidget->show(); - m_QSYMessageWidget->raise(); - m_QSYMessageWidget->activateWindow(); - } - if(m_qsymonitorWidget && finalMatch.mid(0,1) !='Z') m_qsymonitorWidget->getQSYData(QString(bhList[0]) + " " + the_call + " " + finalMatch); - if (m_config.alert_Enabled() && m_config.alert_QSYmessage() && (the_line.contains(qCall) or the_line.contains(qDXCall))) alertQSYmessage(); - } - } + QSYMessageParser::LineResult const qsy = QSYMessageParser::decodeLine (the_line, m_config.region ()); + if (qsy.message) { + QString const the_call = qsy.call; + QString const finalMatch = qsy.payload; + if(the_call == qCall && ui->actionEnable_QSY_Popups->isChecked()) { + if(m_QSYMessageWidget) m_QSYMessageWidget->write_settings(); + m_QSYMessageWidget.reset (new QSYMessage(finalMatch, qCall, m_settings, &m_config)); + + connect (this, &MainWindow::finished, m_QSYMessageWidget.data (), &QSYMessage::close); + connect (m_QSYMessageWidget.data (), &QSYMessage::sendReply, this, &MainWindow::reply_tx5,static_cast(Qt::UniqueConnection)); + m_QSYMessageWidget->setWindowFlags(m_QSYMessageWidget->windowFlags() | Qt::WindowStaysOnTopHint); + m_QSYMessageWidget->show(); + m_QSYMessageWidget->raise(); + m_QSYMessageWidget->activateWindow(); } + if(m_qsymonitorWidget && qsy.message.type == QSYMessageParser::Type::Frequency) m_qsymonitorWidget->getQSYData(QString(bhList[0]) + " " + the_call + " " + finalMatch); + if (m_config.alert_Enabled() && m_config.alert_QSYmessage() && (the_line.contains(qCall) or the_line.contains(qDXCall))) alertQSYmessage(); } } else if (((the_line.mid(22).contains(qDXCall + QString(".") + "OKQSY") || the_line.mid(22).contains(qDXCall +QString(".") + "NOQSY"))) && ui->actionEnable_QSY_Popups->isChecked()) { @@ -3542,8 +3325,7 @@ void MainWindow::showQSYMessage(QString message) if(m_QSYMessageWidget) m_QSYMessageWidget->write_settings(); m_QSYMessageWidget.reset (new QSYMessage(qNewMessage, qDXCall, m_settings, &m_config)); - //connect to signal finish - connect (this, &MainWindow::finished, &QSYMessage::close); + connect (this, &MainWindow::finished, m_QSYMessageWidget.data (), &QSYMessage::close); m_QSYMessageWidget->show(); m_QSYMessageWidget->raise(); m_QSYMessageWidget->activateWindow(); @@ -3563,6 +3345,7 @@ void MainWindow::on_actionSettings_triggered() // Setup Dialog (Settin SpecOp nContest0=m_specOp; auto psk_on = m_config.spot_to_psk_reporter (); if (QDialog::Accepted == m_config.exec ()) { + cancelPendingFt8Decode ("settings changed"); checkMSK144ContestType(); if (m_config.my_callsign () != callsign) { m_baseCall = Radio::base_callsign (m_config.my_callsign ()); @@ -3584,11 +3367,23 @@ void MainWindow::on_actionSettings_triggered() // Setup Dialog (Settin m_psk_Reporter.sendReport (true); } - m_tci_audio = (m_config.tci_audio() && m_config.is_tci()); // update m_tci_audio + bool const next_tci_audio = m_config.tci_audio () && m_config.is_tci (); + bool const receive_source_changed = next_tci_audio != m_tci_audio; bool was_monitoring = m_monitoring; - if (m_monitoring && (m_config.restart_tci () or !m_tci_audio)) on_monitorButton_clicked (false); + if (m_monitoring && (receive_source_changed || m_config.restart_tci () + || !next_tci_audio)) + on_monitorButton_clicked (false); + if (receive_source_changed && !m_tci_audio) Q_EMIT stopAudioInputStream (); + if (receive_source_changed && next_tci_audio) + Q_EMIT m_config.transceiver_audio (false); + m_tci_audio = next_tci_audio; + if (receive_source_changed) + { + m_receiveConsumer.invalidate (); + m_receiveQueue.clear (); + } if (!m_tci_audio) { - if(m_config.restart_audio_input () && !m_config.audio_input_device ().isNull ()) { + if(receive_source_changed || m_config.restart_audio_input ()) { Q_EMIT startAudioInputStream (m_config.audio_input_device () , m_rx_audio_buffer_frames , m_detector, m_downSampleFactor @@ -3601,7 +3396,11 @@ void MainWindow::on_actionSettings_triggered() // Setup Dialog (Settin , m_tx_audio_buffer_frames); } } - if (was_monitoring && (m_config.restart_tci () or !m_tci_audio) && !m_monitoring && !m_transmitting && g_iptt!=1) { + if (!was_monitoring && receive_source_changed && !m_tci_audio) + Q_EMIT suspendAudioInputStream (); + if (was_monitoring && (receive_source_changed || m_config.restart_tci () + || !m_tci_audio) + && !m_monitoring && !m_transmitting && g_iptt!=1) { if(m_mode=="MSK144") { if (m_tci_audio) { if (ui->bandComboBox->currentText()!="OOB") { @@ -3641,10 +3440,10 @@ void MainWindow::on_actionSettings_triggered() // Setup Dialog (Settin } m_config.transceiver_online (); + sync_tci_tx_volume (true); if(!m_bFastMode) setXIT (ui->TxFreqSpinBox->value ()); if ((m_config.single_decode () && !m_mode.startsWith ("FST4")) || m_mode=="JT4") { - ui->lh_decodes_title_label->setText(tr ("Single-Period Decodes")); - ui->rh_decodes_title_label->setText(tr ("Average Decodes")); + setDecodeTitles(tr ("Single-Period Decodes"), tr ("Average Decodes")); } update_watchdog_label (); @@ -3662,6 +3461,8 @@ void MainWindow::on_actionSettings_triggered() // Setup Dialog (Settin } m_specOp=m_config.special_op_id(); if(m_specOp!=nContest0) { + m_q65PileupCopiedLastRxCall.clear(); + m_q65PileupCopiedCallers.clear(); ui->tx1->setEnabled(true); ui->txb1->setEnabled(true); set_mode(m_mode); @@ -3698,32 +3499,6 @@ void MainWindow::on_actionSettings_triggered() // Setup Dialog (Settin } } -void MainWindow::on_monitorButton_clicked (bool checked) -{ - if (!m_transmitting) { - auto prior = m_monitoring; - monitor (checked); - if (checked && !prior) { - if (m_config.monitor_last_used () && m_mode!="Echo") { - // put rig back where it was when last in control - setRig (m_lastMonitoredFrequency); - setXIT (ui->TxFreqSpinBox->value ()); - } - // ensure FreqCal triggers - if(m_mode=="FST4W") { - on_sbFST4W_RxFreq_valueChanged(ui->sbFST4W_RxFreq->value()); - } else { - on_RxFreqSpinBox_valueChanged (ui->RxFreqSpinBox->value ()); - } - } - //Get Configuration in/out of strict split and mode checking - m_config.sync_transceiver (true, checked); - } else { - ui->monitorButton->setChecked (false); // disallow - } - if(m_mode=="Echo") m_echoRunning=false; - check_button_color(); -} void MainWindow::monitor (bool state) { @@ -3731,12 +3506,18 @@ void MainWindow::monitor (bool state) if (state) { m_diskData = false; // no longer reading WAV files if (!m_monitoring) { - float t_rxdelay=0.001*(QDateTime::currentMSecsSinceEpoch() - m_msEchoTxStart); - int ms=int(1000*(m_tEcho-t_rxdelay)); + int ms=0; + if(m_mode=="Echo") { + float t_rxdelay=0.001*(QDateTime::currentMSecsSinceEpoch() - m_msEchoTxStart); + if(t_rxdelay > 2.3 && t_rxdelay < 2.8 && m_tEcho > t_rxdelay) ms=int(1000*(m_tEcho-t_rxdelay)); + } if (m_tci_audio) { if (ui->bandComboBox->currentText()!="OOB") { if(ms>=10) { - QTimer::singleShot (ms, [=] {Q_EMIT m_config.transceiver_audio(true);}); + QTimer::singleShot (ms, this, [this] { + if (m_monitoring && m_tci_audio) + Q_EMIT m_config.transceiver_audio (true); + }); } else { Q_EMIT m_config.transceiver_audio(true); } @@ -3745,7 +3526,9 @@ void MainWindow::monitor (bool state) } } else { if(ms>=10) { - QTimer::singleShot (ms, [=] {resumeAudioInputStream();}); + QTimer::singleShot (ms, this, [this] { + if (m_monitoring && !m_tci_audio) Q_EMIT resumeAudioInputStream (); + }); } else { Q_EMIT resumeAudioInputStream (); } @@ -3763,6 +3546,7 @@ void MainWindow::monitor (bool state) } } m_monitoring = state; + if (!state) cancelPendingFt8Decode ("monitoring stopped"); check_button_color(); } @@ -3771,53 +3555,6 @@ void MainWindow::on_actionAbout_triggered() //Display "About" CAboutDlg {this}.exec (); } -void MainWindow::on_autoButton_clicked (bool checked) -{ - if (ui->DX_Call_Button->isChecked() && m_specOp==SpecOp::HOUND && m_config.superFox() && !m_bDoubleClicked) return; // for Wait & Call - m_config.transceiver_tune (false); // reset rig tuning - if (checked && ui->tuneButton->isChecked() && !(m_mode=="WSPR" || m_mode=="FST4W")) return; // not allowed while tuning - stopWRTimer.stop(); // stop any Wait & Reply timeout - if (!checked && ui->DX_Call_Button->isChecked()) { - stopWCTimer.stop(); // stop any Wait & Call timeout - ui->DX_Call_Button->click (); // disable Wait & Call - no_wait_and_call = false; // reset Wait & Call - } - m_specOp=m_config.special_op_id(); - ui->pbBandHopping->setChecked(false); // disable band hopping when Tx is enabled - if (checked) { - m_auto = checked; - QTimer::singleShot (3000, [=] {pounce = false;}); // ensure to select only CQ messages - } else { - pounce = false; - m_auto = false; - m_bCallingCQ = false; - ui->autoButton->setChecked(false); // ensure autoButton is unchecked - filtered = false; - ignored = false; - m_muted = false; - Dpoints=0; // reset points - maxDPoints=0; // reset points - dBpoints=-28; // reset points - dBpoints2=99; // reset points - maxdBPoints=-28; // reset points - mindBPoints=99; // reset points - } - m_maxPoints=-1; - if (checked && ui->respondComboBox->isVisible() && ui->respondComboBox->currentText() != "CQ: None" - && CALLING == m_QSOProgress) { - m_bAutoReply = false; // ready for next - m_bCallingCQ = true; // allows tail-enders to be picked up - } - statusUpdate (); - m_bEchoTxOK=false; - if(m_mode=="Echo" and m_auto) { - m_nclearave=1; - echocom_.nsum=0; - } - m_tAutoOn=QDateTime::currentMSecsSinceEpoch()/1000; - if(m_mode=="Echo") m_echoRunning=false; - check_button_color(); -} void MainWindow::on_sbTxPercent_valueChanged (int n) { @@ -3835,10 +3572,9 @@ void MainWindow::keyPressEvent (QKeyEvent * e) if(SpecOp::FOX == m_specOp) { switch (e->key()) { case Qt::Key_Return: - doubleClickOnCall2(Qt::KeyboardModifier(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier)); - return; case Qt::Key_Enter: - doubleClickOnCall2(Qt::KeyboardModifier(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier)); + doubleClickOnCall2(ui->decodedTextBrowser->document()->firstBlock().text(), QString {}, + Qt::KeyboardModifier(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier)); return; case Qt::Key_Backspace: qDebug() << "Key Backspace"; @@ -3851,20 +3587,10 @@ void MainWindow::keyPressEvent (QKeyEvent * e) } QMainWindow::keyPressEvent (e); } - - // Why shall RETURN switch Tx on when in Hound mode? Makes little sense and confuses many OMs! -// if(SpecOp::HOUND == m_specOp) { -// switch (e->key()) { -// case Qt::Key_Return: -// auto_tx_mode(true); -// return; -// case Qt::Key_Enter: -// auto_tx_mode(true); -// return; -// } -// QMainWindow::keyPressEvent (e); -// } - + if(m_mode=="JTTY") { + bool handled = jtty_key_struck(e); + if(handled) return; + } int n; bool bAltF1F6=m_config.alternate_bindings(); switch(e->key()) @@ -3883,14 +3609,12 @@ void MainWindow::keyPressEvent (QKeyEvent * e) return; case Qt::Key_C: if(e->modifiers() & Qt::AltModifier) { - int n=ui->respondComboBox->currentIndex()+1; - if(n>2) n=0; - ui->respondComboBox->setCurrentIndex(n); + cycleRespondMode(); } return; case Qt::Key_D: if(m_mode != "WSPR" && e->modifiers() & Qt::ShiftModifier) { - if(!m_decoderBusy) { + if(!decoderBusy ()) { dec_data.params.newdat=0; dec_data.params.nagain=0; decode(); @@ -3946,9 +3670,7 @@ void MainWindow::keyPressEvent (QKeyEvent * e) } case Qt::Key_F6: if(bAltF1F6) { - int n=ui->respondComboBox->currentIndex()+1; - if(n>2) n=0; - ui->respondComboBox->setCurrentIndex(n); + cycleRespondMode(); } else { if(e->modifiers() & Qt::ShiftModifier) { on_actionDecode_remaining_files_in_directory_triggered(); @@ -3959,8 +3681,7 @@ void MainWindow::keyPressEvent (QKeyEvent * e) return; case Qt::Key_F11: if((e->modifiers() & Qt::ControlModifier) and (e->modifiers() & Qt::ShiftModifier)) { - m_bandEdited = true; - band_changed(m_freqNominal-1000); + requestBandChange (m_operatingFrequency.rx () - 1000, FrequencyRequestOrigin::User); } else { n=11; if(e->modifiers() & Qt::ControlModifier) n+=100; @@ -3975,8 +3696,7 @@ void MainWindow::keyPressEvent (QKeyEvent * e) return; case Qt::Key_F12: if((e->modifiers() & Qt::ControlModifier) and (e->modifiers() & Qt::ShiftModifier)) { - m_bandEdited = true; - band_changed(m_freqNominal+1000); + requestBandChange (m_operatingFrequency.rx () + 1000, FrequencyRequestOrigin::User); } else { n=12; if(e->modifiers() & Qt::ControlModifier) n+=100; @@ -4006,7 +3726,7 @@ void MainWindow::keyPressEvent (QKeyEvent * e) break; case Qt::Key_F: if(e->modifiers() & Qt::ControlModifier) { - if(ui->tabWidget->currentIndex()==0) { + if(ui->tabWidget->currentIndex()==standard_messages_tab_index) { ui->tx5->clearEditText(); ui->tx5->setFocus(); } @@ -4065,11 +3785,11 @@ void MainWindow::keyPressEvent (QKeyEvent * e) return; } if(e->modifiers() & Qt::AltModifier) { - if(!m_send_RR73) on_txrb4_doubleClicked(); - return; + set_rr73_tx4 (true); + return; } if(e->modifiers() & Qt::ControlModifier) { - if(m_send_RR73) on_txrb4_doubleClicked(); + set_rr73_tx4 (false); return; } break; @@ -4079,11 +3799,19 @@ void MainWindow::keyPressEvent (QKeyEvent * e) //foxTest(); return; } + break; + case Qt::Key_Z: + if(e->modifiers() & Qt::AltModifier) { + clearHungDecoderStatus("Alt+Z"); + return; + } + break; } QMainWindow::keyPressEvent (e); } + void MainWindow::handleVerifyMsg(int status, QDateTime ts, QString callsign, QString code, unsigned int hz, QString const &response) { (void)status; @@ -4092,9 +3820,9 @@ void MainWindow::handleVerifyMsg(int status, QDateTime ts, QString callsign, QSt QString msg = FoxVerifier::formatDecodeMessage(ts, callsign, hz, response); if (msg.length() > 0) { // Hound label - if ((ui->labDXped->text().contains("Hound") && msg.contains(" verified"))) { - verified = true; - ui->labDXped->setStyleSheet("QLabel {background-color: #00ff00; color: black;}"); + if (isHoundOperation () && msg.contains(" verified")) { + m_houndVerified = true; + updateHoundVerificationStyle (); } ui->decodedTextBrowser->displayDecodedText(DecodedText{msg}, m_config.my_callsign(), m_mode, m_config.DXCC(), m_logBook, m_currentBand, m_config.ppfx(), false, false, 0.0, false, -99, "", true); @@ -4104,16 +3832,6 @@ void MainWindow::handleVerifyMsg(int status, QDateTime ts, QString callsign, QSt LOG_INFO(QString("FoxVerifier response for [%1]: - [%2]").arg(callsign).arg(response).toStdString()); } -QString MainWindow::userAgent() { - // see User-Agent format definition https://www.rfc-editor.org/rfc/rfc9110#name-user-agent - // - QString platform = "(" + QSysInfo::prettyProductName()+"; "+QSysInfo::productType() + " " + QSysInfo::productVersion() + "; " + - QSysInfo::currentCpuArchitecture() + "; " + - QString("rv:%1").arg(QSysInfo::kernelVersion()) + ")"; - QString userAgent = QString{"WSJT-X/" + version() + "_" + m_revision}.simplified() + " " +platform; - return userAgent; - } - void MainWindow::bumpFqso(int n) //bumpFqso() { int i; @@ -4138,12 +3856,14 @@ void MainWindow::bumpFqso(int n) //bumpFqso() void MainWindow::displayDialFrequency () { if (ui->actionUse_Dark_Style->isChecked()) ui->bandComboBox->setStyleSheet("QLineEdit {background-color: #31363b}"); // initialize dark style at startup - Frequency dial_frequency {m_rigState.ptt () && m_rigState.split () ? - m_rigState.tx_frequency () : m_rigState.frequency ()}; + Frequency dial_frequency {m_rigState.ptt () ? + (m_rigState.split () ? m_operatingFrequency.correctedTx (m_astroCorrection.tx) + : m_operatingFrequency.tx ()) : + m_operatingFrequency.correctedRx (m_astroCorrection.rx)}; // lookup band auto const& band_name = m_config.bands ()->find (dial_frequency); - if (m_lastBand != band_name or m_freqNominalPeriod != m_freqNominal) + if (m_lastBand != band_name or m_freqNominalPeriod != m_operatingFrequency.rx ()) { // only change this when necessary as we get called a lot and it // would trash any user input to the band combo box line edit @@ -4151,13 +3871,13 @@ void MainWindow::displayDialFrequency () ui->bandComboBox->setCurrentText (band_name.size () ? band_name : m_config.bands ()->oob ()); m_wideGraph->setRxBand (band_name); m_lastBand = band_name; - band_changed(dial_frequency); + band_changed (dial_frequency); } // prevent wrong frequencies for all.txt, PSK Reporter and highlighting for late decodes after band changes m_displayBand = false; no_decodes_to_UDP = true; // prevent wrong frequencies for devices connected via UDP - QTimer::singleShot ((int(600.0*m_TRperiod)), [=] { - m_freqNominalPeriod = m_freqNominal; + QTimer::singleShot ((int(600.0*m_TRperiod)), this, [=] { + m_freqNominalPeriod = m_operatingFrequency.rx (); m_currentBandPeriod = m_currentBand; m_displayBand = true; no_decodes_to_UDP = false; // prevent wrong frequencies for devices connected via UDP @@ -4209,13 +3929,26 @@ void MainWindow::stopWCTimeout() void MainWindow::statusChanged() { + auto const prior_spec_op = m_specOp; m_specOp=m_config.special_op_id(); // update m_specOp + if (m_specOp != prior_spec_op) { + m_q65PileupCopiedLastRxCall.clear(); + m_q65PileupCopiedCallers.clear(); + } if (m_specOp==SpecOp::Q65_PILEUP && m_mode != "Q65") on_actionQ65_triggered(); - QTimer::singleShot (50, [=] { // only allow Wait & Call where it is appropriate - if((m_mode.startsWith("JT") or m_mode=="WSPR" or m_mode=="Echo" or m_mode=="FST4W" - or (m_specOp!=SpecOp::NONE and m_specOp!=SpecOp::HOUND) - or !ui->cbAutoSeq->isChecked() or m_hisCall=="") && ui->DX_Call_Button->isChecked()) - ui->DX_Call_Button->click (); + QTimer::singleShot (50, this, [=] { + WaitFeatureContext const waitContext { + m_mode, + m_specOp, + m_config.Wait_features_enabled(), + ui->cbAutoSeq->isChecked(), + !m_hisCall.isEmpty(), + m_config.NCCC_Sprint() + }; + if (ui->DX_Call_Button->isChecked() + && !wait_and_call_arming_eligible (waitContext)) { + ui->DX_Call_Button->click (); + } }); statusUpdate (); QFile f {m_config.temp_dir ().absoluteFilePath ("wsjtx_status.txt")}; @@ -4223,7 +3956,7 @@ void MainWindow::statusChanged() QTextStream out(&f); QString tmpGrid = m_hisGrid; if (!tmpGrid.size ()) tmpGrid="n/a"; // Not Available - out << qSetRealNumberPrecision (12) << (m_freqNominal / 1.e6) + out << qSetRealNumberPrecision (12) << (m_operatingFrequency.rx () / 1.e6) << ";" << m_mode << ";" << m_hisCall << ";" << ui->rptSpinBox->value() << ";" << m_mode << ";" << tmpGrid #if QT_VERSION >= QT_VERSION_CHECK (5, 15, 0) @@ -4241,14 +3974,7 @@ void MainWindow::statusChanged() } on_dxGridEntry_textChanged(m_hisGrid); if (m_specOp!=SpecOp::HOUND) { - ui->txb2->setEnabled(true); - ui->txrb2->setEnabled(true); - ui->txb4->setEnabled(true); - ui->txrb4->setEnabled(true); - ui->txb5->setEnabled(true); - ui->txrb5->setEnabled(true); - ui->txb6->setEnabled(true); - ui->txrb6->setEnabled(true); + setTxButtonsEnabled(true); ui->houndButton->setChecked(false); } if (m_specOp==SpecOp::FOX) { @@ -4268,15 +3994,12 @@ void MainWindow::statusChanged() } if (m_mode=="JT4" or m_mode=="Q65" or m_mode=="JT65") { if (ui->actionInclude_averaging->isVisible() && ui->actionInclude_averaging->isChecked()) { - ui->lh_decodes_title_label->setText(tr ("Single-Period Decodes")); - ui->rh_decodes_title_label->setText(tr ("Average Decodes")); + setDecodeTitles(tr ("Single-Period Decodes"), tr ("Average Decodes")); } else { if (m_config.enable_VHF_features()) { - ui->lh_decodes_title_label->setText(tr ("Band Activity")); - ui->rh_decodes_title_label->setText(tr ("Decodes containing My Call")); + setDecodeTitles(tr ("Band Activity"), tr ("Decodes containing My Call")); } else { - ui->lh_decodes_title_label->setText(tr ("Band Activity")); - ui->rh_decodes_title_label->setText(tr ("Rx Frequency")); + setDecodeTitles(tr ("Band Activity"), tr ("Rx Frequency")); } } } @@ -4336,26 +4059,121 @@ void MainWindow::statusChanged() bool MainWindow::eventFilter (QObject * object, QEvent * event) { + if (!m_event_filter_ready) + { + return QObject::eventFilter (object, event); + } + + if ((object == ui->QSO_controls_widget + || (m_modeCheckboxRow && object == m_modeCheckboxRow->parentWidget ())) + && (event->type () == QEvent::Resize || event->type () == QEvent::LayoutRequest)) + QTimer::singleShot (0, this, &MainWindow::updateModeControlsLayout); + switch (event->type()) { - case QEvent::KeyPress: - // fall through - case QEvent::MouseButtonPress: - // reset the Tx watchdog - tx_watchdog (false); - break; + case QEvent::FocusIn: + { + auto const focus_reason = static_cast (event)->reason (); + if (focus_reason == Qt::MouseFocusReason) + { + m_keyboard_focus_active = false; + } + else if (focus_reason == Qt::TabFocusReason + || focus_reason == Qt::BacktabFocusReason + || focus_reason == Qt::ShortcutFocusReason) + { + m_keyboard_focus_active = true; + } - case QEvent::ChildAdded: - // ensure our child widgets get added to our event filter - add_child_to_event_filter (static_cast (event)->child ()); - break; + auto *widget = qobject_cast (object); + auto const indicator_widgets = focusIndicatorWidgets (); + auto const is_focus_indicator_target = std::find (indicator_widgets.cbegin (), indicator_widgets.cend (), widget) + != indicator_widgets.cend (); + if (is_focus_indicator_target) + { + if (m_keyboard_focus_active) + { + showMainWindowFocusIndicator (widget); + } + else + { + hideMainWindowFocusIndicators (); + } + } + break; + } - case QEvent::ChildRemoved: - // ensure our child widgets get d=removed from our event filter - remove_child_from_event_filter (static_cast (event)->child ()); + case QEvent::FocusOut: + if (object == ui->tabWidget->tabBar ()) + { + m_message_selector_focus_frame->hide (); + } + if (m_main_window_focus_frame->widget () == object) + { + m_main_window_focus_frame->hide (); + m_main_window_focus_frame->setWidget (nullptr); + } break; - default: break; + case QEvent::KeyPress: + { + m_keyboard_focus_active = true; + auto *widget = qobject_cast (object); + auto const indicator_widgets = focusIndicatorWidgets (); + if (std::find (indicator_widgets.cbegin (), indicator_widgets.cend (), widget) + != indicator_widgets.cend ()) + { + showMainWindowFocusIndicator (widget); + } + + auto const key_event = static_cast (event); + auto const handled = switchMainWindowTab (key_event) || switchTxNextMessage (key_event); + tx_watchdog (false); + if (handled) return true; + break; + } + + case QEvent::EnabledChange: + { + auto const buttons = txNextButtons (); + if (std::find (buttons.cbegin (), buttons.cend (), qobject_cast (object)) + != buttons.cend ()) + { + QTimer::singleShot (0, this, &MainWindow::updateTxNextFocusPolicies); + } + break; + } + + case QEvent::MouseButtonPress: + m_keyboard_focus_active = false; + hideMainWindowFocusIndicators (); + // reset the Tx watchdog + tx_watchdog (false); + if (object == ui->txFirstCheckBox + && static_cast (event)->button () == Qt::RightButton) + { + if (m_tx_first_mode_enabled) + { + // Disabling a focused widget advances focus to the next widget. + ui->txFirstCheckBox->clearFocus (); + m_tx_first_user_enabled = !m_tx_first_user_enabled; + updateTxFirstEnabledState (); + } + return true; + } + break; + + case QEvent::ChildAdded: + // ensure our child widgets get added to our event filter + add_child_to_event_filter (static_cast (event)->child ()); + break; + + case QEvent::ChildRemoved: + // ensure our child widgets get d=removed from our event filter + remove_child_from_event_filter (static_cast (event)->child ()); + break; + + default: break; } return QObject::eventFilter(object, event); } @@ -4367,6 +4185,8 @@ void MainWindow::createStatusBar() //createStatusBar tx_status_label.setStyleSheet ("QLabel{color: #000000; background-color: #00ff00}"); tx_status_label.setFrameStyle (QFrame::Panel | QFrame::Sunken); statusBar()->addWidget (&tx_status_label); + connect (&m_config, &Configuration::tx_inhibit_status_changed, + this, &MainWindow::handleTxInhibitStatus); config_label.setAlignment (Qt::AlignHCenter); config_label.setMinimumSize (QSize {80, 18}); @@ -4399,6 +4219,89 @@ void MainWindow::createStatusBar() //createStatusBar statusBar ()->addPermanentWidget (&watchdog_label); update_watchdog_label (); + + statusBar ()->setAccessibleName (tr ("Application status")); + statusBar ()->setAccessibleDescription (tr ("Current WSJT-X status messages and operating indicators.")); + + tx_status_label.setAccessibleName (tr ("Transmit status")); + config_label.setAccessibleName (tr ("Configuration")); + mode_label.setAccessibleName (tr ("Mode")); + ndecodes_label.setAccessibleName (tr ("Decode count")); + last_tx_label.setAccessibleName (tr ("Last transmitted message")); + band_hopping_label.setAccessibleName (tr ("Power and SWR status")); + progressBar.setAccessibleName (tr ("Decode progress")); + progressBar.setAccessibleDescription (tr ("Progress for the current decode operation.")); + watchdog_label.setAccessibleName (tr ("Transmit watchdog")); +} + +void MainWindow::handleTxInhibitStatus (bool supported, bool inhibited, + QString const& holder, quint32 hold_rx, + quint32 release_rx, quint32 expiries, + quint32 invalid) +{ + m_tx_inhibited = inhibited; + + if (!inhibited) + { + tx_status_label.setToolTip ({}); + tx_status_label.setAccessibleDescription ({}); + } + else + { + auto const description = holder.isEmpty () + ? tr ("TX is inhibited by an external interlock controller.") + : tr ("TX is inhibited by %1.").arg (holder); + tx_status_label.setToolTip (description); + tx_status_label.setAccessibleDescription (description); + } + + if (inhibited) startTxAudioAfterPttDelay (); + if (m_messageClient) + { + m_messageClient->inhibit_status (supported, inhibited, holder, hold_rx, + release_rx, expiries, invalid); + } +} + +void MainWindow::startTxAudioAfterPttDelay () +{ + if (!m_tx_when_ready || !g_iptt) return; + + auto delay_ms = static_cast (1000 * m_config.txDelay ()); + if (m_mode == "FT4") delay_ms = 20; + ptt1Timer.start (delay_ms); + m_tx_when_ready = false; +} + +void MainWindow::show_generated_message_error () +{ + m_generated_message_error = true; + if (!m_tx_watchdog) update_generated_message_error (); +} + +void MainWindow::clear_generated_message_error () +{ + if (!m_generated_message_error) return; + + m_generated_message_error = false; + tx_status_label.setToolTip (QString {}); + tx_status_label.setAccessibleDescription (QString {}); + if (!m_transmitting && !m_tx_watchdog) { + tx_status_label.setStyleSheet (""); + tx_status_label.setText (""); + } +} + +void MainWindow::update_generated_message_error () +{ + auto const details = tr ("The selected transmit message cannot be encoded. " + "Enable Tx has been turned off. Edit the selected " + "message or check station settings before trying again."); + tx_status_label.setStyleSheet ( + "QLabel{color: #000000; background-color: #ffff00}"); + tx_status_label.setText (tr ("Tx message cannot be encoded; Enable Tx is off")); + tx_status_label.setToolTip (details); + tx_status_label.setAccessibleDescription (details); } void MainWindow::setup_status_bar (bool vhf) @@ -4421,6 +4324,8 @@ void MainWindow::setup_status_bar (bool vhf) mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #66ff66}"); } else if ("Q65" == m_mode) { mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #99ff33}"); + } else if ("JTTY" == m_mode) { + mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #9999ff}"); } else if ("MSK144" == m_mode) { mode_label.setStyleSheet ("QLabel{color: #000000; background-color: #ff6666}"); } else if ("FT4" == m_mode) { @@ -4450,53 +4355,42 @@ void MainWindow::setup_status_bar (bool vhf) } } -bool MainWindow::subProcessFailed (QProcess * process, int exit_code, QProcess::ExitStatus status) -{ - if (m_valid && (exit_code || QProcess::NormalExit != status)) - { - QStringList arguments; - for (auto argument: process->arguments ()) - { - if (argument.contains (' ')) argument = '"' + argument + '"'; - arguments << argument; - } - if (m_splash && m_splash->isVisible ()) m_splash->hide (); - MessageBox::critical_message (this, tr ("Subprocess Error") - , tr ("Subprocess failed with exit code %1") - .arg (exit_code) - , tr ("Running: %1\n%2") - .arg (process->program () + ' ' + arguments.join (' ')) - .arg (QString {process->readAllStandardError()})); - return true; - } - return false; -} -void MainWindow::subProcessError (QProcess * process, QProcess::ProcessError) +void MainWindow::paintEvent (QPaintEvent * event) { - if (m_valid) + MultiGeometryWidget::paintEvent (event); + if (!m_startup_paint_reported) { - QStringList arguments; - for (auto argument: process->arguments ()) - { - if (argument.contains (' ')) argument = '"' + argument + '"'; - arguments << argument; - } - if (m_splash && m_splash->isVisible ()) m_splash->hide (); - MessageBox::critical_message (this, tr ("Subprocess error") - , tr ("Running: %1\n%2") - .arg (process->program () + ' ' + arguments.join (' ')) - .arg (process->errorString ())); - m_valid = false; // ensures exit if still constructing - QTimer::singleShot (0, this, SLOT (close ())); + m_startup_paint_reported = true; + PerformanceTrace::finish_run (m_startup_trace_run, "ui.first_paint"); } } void MainWindow::closeEvent(QCloseEvent * e) { + auto const active_run = PerformanceTrace::current_run (); + if (active_run == m_startup_trace_run) + { + auto const shutdown_run = PerformanceTrace::begin_run ("shutdown", "application_exit"); + PerformanceTrace::milestone (shutdown_run, "shutdown.requested"); + } + PerformanceTrace::Phase close {"window.close"}; + cancelPendingFt8Decode ("application closing"); + m_closing = true; + m_jt9ProcessPhase = Jt9ProcessPhase::Closing; + m_decoderShutdownTimer.stop (); + m_decoderTerminateTimer.stop (); + m_decoderKillTimer.stop (); + m_decoderStartTimer.stop (); m_valid = false; // suppresses subprocess errors - m_config.transceiver_offline (); - writeSettings (); + { + PerformanceTrace::Phase rig_shutdown {"rig.shutdown_request"}; + m_config.transceiver_offline (); + } + { + PerformanceTrace::Phase settings_write {"mainwindow.settings_write"}; + writeSettings (); + } if(m_astroWidget) m_astroWidget.reset (); if(m_QSYMessageCreatorWidget) { QCloseEvent closeEvent; @@ -4518,60 +4412,38 @@ void MainWindow::closeEvent(QCloseEvent * e) m_shortcuts.reset (); m_mouseCmnds.reset (); m_colorHighlighting.reset (); - if(m_mode!="MSK144" and m_mode!="FT8") killFile(); + if(m_mode!="MSK144" and m_mode!="FT8") killWaveFile(); float sw=0.0; int nw=400; int nh=100; int irow=-99; plotsave_(&sw,&nw,&nh,&irow); - to_jt9(m_ihsym,999,-1); //Tell jt9 to terminate - if (!proc_jt9.waitForFinished(1000)) proc_jt9.close(); + { + PerformanceTrace::Phase decoder_shutdown {"decoder.shutdown"}; + if (DecoderIpc::hasUsableSize (mem_jt9->size ()) + && mem_jt9->data ()) + { + auto * shared = reinterpret_cast (mem_jt9->data ()); + DecoderIpc::shutdown (*shared); + } + if (proc_jt9.state() != QProcess::NotRunning) { + if (!proc_jt9.waitForFinished(5000)) { + proc_jt9.terminate(); + if (!proc_jt9.waitForFinished(1000)) { + proc_jt9.kill(); + proc_jt9.waitForFinished(1000); + } + } + } + proc_jt9.close(); + } mem_jt9->detach(); Q_EMIT finished (); QMainWindow::closeEvent (e); + close.finish (); } -void MainWindow::on_stopButton_clicked() //stopButton -{ - ui->pbBandHopping->setChecked(false); // disable band hopping - monitor (false); - m_loopall=false; - if(m_bRefSpec) { - MessageBox::information_message (this, tr ("Reference spectrum saved")); - m_wideGraph->setReferenceSpectrumAvailable( - QFile::exists(m_config.writeable_data_dir ().absoluteFilePath ("refspec.dat"))); - m_bRefSpec=false; - } - if (ui->DX_Call_Button->isChecked()) ui->DX_Call_Button->click (); - stopWRTimer.stop(); // Stop any Wait & Reply timeout - stopWCTimer.stop(); // Stop any Wait & Call timeout - no_wait_and_call = false; - m_specOp=m_config.special_op_id(); - if (ui->respondComboBox->isVisible() and ui->respondComboBox->currentIndex()!=0 and !m_diskData) { - Dpoints=0; // reset points - maxDPoints=0; // reset points - dBpoints=-28; // reset points - dBpoints2=99; // reset points - maxdBPoints=-28; // reset points - mindBPoints=99; // reset points - if (!(m_mode=="Q65" or m_mode=="JT65")) { - clearDX(); // clear dxCallEntry - ui->dxGridEntry->clear (); // clear dxGridEntry - if (!keepTx5) ui->tx5->setCurrentText(""); // clear tx5 - } - } - pounce = false; - ui->autoButton->setChecked(false); // ensure auoButton is unchecked - filtered = false; - ignored = false; - m_muted = false; - check_button_color(); -} -void MainWindow::on_pbBandHopping_clicked() -{ - if (m_auto) ui->pbBandHopping->setChecked(false); // don't allow band hopping when in QSO -} void MainWindow::on_actionRelease_Notes_triggered () { @@ -4608,32 +4480,14 @@ void MainWindow::on_actionQuick_Start_Guide_to_WSJT_X_2_7_and_QMAP_triggered() QDesktopServices::openUrl (QUrl {"https://wsjt.sourceforge.io/Quick_Start_WSJT-X_2.7_QMAP.pdf"}); } -void MainWindow::on_actionRecommended_Audio_Settings_triggered() -{ - auto const& message = tr("It is very important to avoid audio harmonics and distorted audio signals.\n" - "This is usually achieved by the following step-by-step approach:\n\n" - "1. Select 'Fake it' in the Settings/Radio menu as your 'Split mode'. If your\n" - " rig does not support this, select 'Rig'. But really try to avoid 'None'!\n\n" - "2. Set the transmission power of your transceiver to maximum.\n\n" - "3. Set the Pwr slider to the minimum and click on the 'Tune' button.\n\n" - "4. Observe the actual transmission power of your rig as well as ALC.\n\n" - "5. Carefully increase the Pwr slider until you have reached the\n" - " maximum transmit powe of your transceiver.\n\n" - "6. VERY IMPORTANT: Now reduce the Pwr slider until you reach approx. \n" - " 90% of your max. Tx power. ALC should be close to zero.\n\n" - "7. This is the maximum audio level permitted with your setup.\n" - " Always stay with the Pwr slider below this max. value.\n\n" - "If possible, check your transmission from time to time with a webSDR\n" - "to ensure the signal is clean and not distorted."); - QTimer::singleShot (0, [=] { // don't block guiUpdate - MessageBox::warning_message(this, tr ("Recommended Audio Settings"), message); }); -} - void MainWindow::on_actionOnline_User_Guide_triggered() //Display manual { - QDesktopServices::openUrl (QUrl {"https://wsjt.sourceforge.io/wsjtx-main_en.html"}); + QDesktopServices::openUrl (QUrl {"https://wsjtx.github.io/wsjtx/guide-full.html"}); + } + + //Display local copy of manual void MainWindow::on_actionLocal_User_Guide_triggered() { @@ -4701,19 +4555,12 @@ void MainWindow::on_actionSolve_FreqCal_triggered() void MainWindow::on_actionCopyright_Notice_triggered() { - auto const& message = tr("If you make fair use of any part of WSJT-X under terms of the GNU " - "General Public License, you must display the following copyright " - "notice prominently in your derivative work:\n\n" - "\"The algorithms, source code, look-and-feel of WSJT-X and related " - "programs, and protocol specifications for the modes FSK441, FST4, FT8, " - "JT4, JT6M, JT9, JT65, JTMS, QRA64, Q65, MSK144 are Copyright (C) " - "2001-2026 by one or more of the following authors: Joseph Taylor, " - "K1JT; Bill Somerville, G4WJS; Steven Franke, K9AN; Nico Palermo, " - "IV3NWV; Greg Beam, KI7MT; Michael Black, W9MDB; Edson Pereira, PY2SDR; " - "Philip Karn, KA9Q; Uwe Risse, DG2YCB; Brian Moran, N9ADG; Roger Rehr, " - "W3SZ; John Nelson, G4KLA; Charlie Suckling, DL3WDG; Terrell Deppe, " - "KJ5HST; and other members of the WSJT Development Group.\""); - MessageBox::warning_message(this, message); + MessageBox::warning_message (this, copyright_notice_text ()); +} + +void MainWindow::on_actionTrademark_Policy_triggered() +{ + QDesktopServices::openUrl (QUrl {"https://wsjtx.github.io/wsjtx/trademark.html"}); } // Implement the MultiGeometryWidget::change_layout() operation. @@ -4741,16 +4588,92 @@ void MainWindow::change_layout (std::size_t n) } } +void MainWindow::cycleRespondMode() +{ + ui->respondComboBox->setCurrentIndex ( + next_cyclic_index (ui->respondComboBox->currentIndex (), ui->respondComboBox->count ())); +} + +QString MainWindow::selectedTxMessage() const +{ + switch (m_ntx) { + case 1: return ui->tx1->text(); + case 2: return ui->tx2->text(); + case 3: return ui->tx3->text(); + case 4: return ui->tx4->text(); + case 5: return ui->tx5->currentText(); + case 6: return ui->tx6->text(); + default: return {}; + } +} + +AutoRespondPolicy MainWindow::autoRespondPolicy() const +{ + bool ok; + auto const value = ui->respondComboBox->currentData ().toInt (&ok); + if (!ok) return AutoRespondPolicy::None; + + switch (static_cast (value)) + { + case AutoRespondPolicy::None: + case AutoRespondPolicy::First: + case AutoRespondPolicy::MaxDistance: + case AutoRespondPolicy::MaxSignal: + case AutoRespondPolicy::MinSignal: + return static_cast (value); + } + return AutoRespondPolicy::None; +} + +bool MainWindow::pendingCqAutoRespondIntent() const +{ + return m_auto + && !m_diskData + && !m_tune + && SpecOp::FOX != m_specOp + && SpecOp::HOUND != m_specOp + && CALLING == m_QSOProgress + && ui->cbAutoSeq->isVisible() + && ui->cbAutoSeq->isEnabled() + && ui->cbAutoSeq->isChecked() + && ui->respondComboBox->isVisible() + && AutoRespondPolicy::None != autoRespondPolicy() + && selectedTxMessage().contains(cq_or_qrz_message_regexp); +} + void MainWindow::on_actionSWL_Mode_triggered (bool checked) { select_geometry (checked ? 1 : ui->cbMenus->isChecked () ? 0 : 2); } -// This allows the window to shrink by removing certain things -// and reducing space used by controls void MainWindow::trim_view (bool checked) { - int spacing = checked ? 1 : 6; + auto const spacing = checked ? 1 : 6; + std::array const compactLayouts {{ + ui->gridLayout_5, + ui->horizontalLayout_2, + ui->horizontalLayout_5, + ui->horizontalLayout_6, + ui->horizontalLayout_7, + ui->horizontalLayout_8, + ui->horizontalLayout_9, + ui->horizontalLayout_10, + ui->horizontalLayout_11, + ui->horizontalLayout_12, + ui->horizontalLayout_13, + ui->horizontalLayout_14, + ui->rh_decodes_widget->layout (), + ui->verticalLayout_2, + ui->verticalLayout_3, + ui->verticalLayout_5, + ui->verticalLayout_7, + ui->verticalLayout_8, + ui->tab->layout () + }}; + for (auto * layout : compactLayouts) layout->setSpacing (spacing); + ui->horizontalLayout_5->setSpacing (qMax (spacing, 4)); + if (!checked) ui->horizontalLayout_2->setSpacing (2); + if (checked) { statusBar ()->removeWidget (&auto_tx_label); } else { @@ -4762,25 +4685,6 @@ void MainWindow::trim_view (bool checked) } ui->lh_decodes_headings_label->setVisible(!checked); ui->rh_decodes_headings_label->setVisible(!checked); - ui->gridLayout_5->layout()->setSpacing(spacing); - ui->horizontalLayout_2->layout()->setSpacing(spacing); - ui->horizontalLayout_5->layout()->setSpacing(spacing); - ui->horizontalLayout_6->layout()->setSpacing(spacing); - ui->horizontalLayout_7->layout()->setSpacing(spacing); - ui->horizontalLayout_8->layout()->setSpacing(spacing); - ui->horizontalLayout_9->layout()->setSpacing(spacing); - ui->horizontalLayout_10->layout()->setSpacing(spacing); - ui->horizontalLayout_11->layout()->setSpacing(spacing); - ui->horizontalLayout_12->layout()->setSpacing(spacing); - ui->horizontalLayout_13->layout()->setSpacing(spacing); - ui->horizontalLayout_14->layout()->setSpacing(spacing); - ui->rh_decodes_widget->layout()->setSpacing(spacing); - ui->verticalLayout_2->layout()->setSpacing(spacing); - ui->verticalLayout_3->layout()->setSpacing(spacing); - ui->verticalLayout_5->layout()->setSpacing(spacing); - ui->verticalLayout_7->layout()->setSpacing(spacing); - ui->verticalLayout_8->layout()->setSpacing(spacing); - ui->tab->layout()->setSpacing(spacing); } void MainWindow::on_actionAstronomical_data_toggled (bool checked) @@ -4793,7 +4697,7 @@ void MainWindow::on_actionAstronomical_data_toggled (bool checked) connect (this, &MainWindow::finished, m_astroWidget.data (), &Astro::close); connect (m_astroWidget.data (), &Astro::tracking_update, [this] { m_astroCorrection = {}; - setRig (); + reapplyCurrentRigFrequencyCorrection (); setXIT (ui->TxFreqSpinBox->value ()); displayDialFrequency (); }); @@ -4802,7 +4706,7 @@ void MainWindow::on_actionAstronomical_data_toggled (bool checked) m_astroWidget->showNormal(); m_astroWidget->raise (); m_astroWidget->activateWindow (); - m_astroWidget->nominal_frequency (m_freqNominal, m_freqTxNominal); + m_astroWidget->nominal_frequency (m_operatingFrequency.rx (), m_operatingFrequency.tx ()); if (!programStart) m_astroWidget->setSkedFreq(m_skedFreq); } else { @@ -4812,10 +4716,15 @@ void MainWindow::on_actionAstronomical_data_toggled (bool checked) void MainWindow::skedFreq(double freqMHz) { - m_skedFreq=freqMHz; - m_bandEdited=true; Frequency f=qRound64(1000000.0*freqMHz); - band_changed(f); + if (requestBandChange (f, FrequencyRequestOrigin::User)) + { + m_skedFreq=freqMHz; + } + else if (m_astroWidget) + { + m_astroWidget->setSkedFreq (m_skedFreq); + } } void MainWindow::on_actionQSYMessage_Creator_triggered() @@ -4823,7 +4732,7 @@ void MainWindow::on_actionQSYMessage_Creator_triggered() if (!m_QSYMessageCreatorWidget) { m_QSYMessageCreatorWidget.reset (new QSYMessageCreator {m_settings, &m_config}); // hook up termination signal - connect (this, &MainWindow::finished, &QSYMessageCreator::close); + connect (this, &MainWindow::finished, m_QSYMessageCreatorWidget.data (), &QSYMessageCreator::close); //connect to signal from QSYMessageCreator connect (m_QSYMessageCreatorWidget.data (), &QSYMessageCreator::sendMessage, this, &MainWindow::update_tx5); connect (m_QSYMessageCreatorWidget.data (), &QSYMessageCreator::sendQSYMessageCreatorStatus, this, &MainWindow::setQSYMessageCreatorStatus); @@ -4842,7 +4751,7 @@ void MainWindow::on_actionQSY_Monitor_triggered() if (!m_qsymonitorWidget) { m_qsymonitorWidget.reset (new QSYMonitor {m_settings, m_config.decoded_text_font (), &m_config}); // hook up termination signal - connect (this, &MainWindow::finished, &QSYMonitor::close); + connect (this, &MainWindow::finished, m_qsymonitorWidget.data (), &QSYMonitor::close); } m_qsymonitorValue = true; m_qsymonitorWidget->showNormal(); @@ -4926,13 +4835,11 @@ void MainWindow::on_actionActiveStations_triggered() connect(m_ActiveStationsWidget.data(), SIGNAL(activeStationsDisplay()),this,SLOT(ARRL_Digi_Display())); m_ActiveStationsWidget->setScore(m_score); if(m_mode=="Q65") m_ActiveStationsWidget->setRate(m_score); - QString as_mode = m_mode; - if(m_mode=="FT8" && SpecOp::FOX==m_specOp) as_mode="Fox Mode"; // TODO - active stations for hound mode? - m_ActiveStationsWidget->setupUi(as_mode); } void MainWindow::on_actionOpen_triggered() //Open File { + if (decoderBusy () || m_wav_load_coordinator.isLoading ()) return; monitor (false); QString fname; @@ -4940,7 +4847,9 @@ void MainWindow::on_actionOpen_triggered() //Open File "WSJT Files (*.wav)"); if(!fname.isEmpty ()) { m_path=fname; - int i1=fname.lastIndexOf("/"); + // Native dialogs on Windows can return backslash-separated paths; + // check both so baseName strips the directory either way. + int i1=qMax(fname.lastIndexOf("/"), fname.lastIndexOf("\\")); QString baseName=fname.mid(i1+1); tx_status_label.setStyleSheet("QLabel{color: #000000; background-color: #99ffff}"); tx_status_label.setText(" " + baseName + " "); @@ -4952,7 +4861,9 @@ void MainWindow::on_actionOpen_triggered() //Open File void MainWindow::read_wav_file (QString const& fname) { - if (m_mode=="FT8" && (m_multithreadFT8 or m_freqNominal>45000000)) { + if (m_wav_load_coordinator.isLoading ()) return; + + if (m_mode=="FT8" && (m_multithreadFT8 or m_operatingFrequency.rx ()>45000000)) { m_nDecodes=0; // reset the decodes counter ndecodes_label.setText(""); earlyDecodes = ""; // reset dupe check @@ -4960,13 +4871,21 @@ void MainWindow::read_wav_file (QString const& fname) // call diskDat() when done int i0=fname.lastIndexOf("_"); int i1=fname.indexOf(".wav"); - int i3=fname.lastIndexOf("/"); + // Native dialogs on Windows can return backslash-separated paths; check + // both so baseName (and so m_UTCdiskDateTime below) is derived from just + // the filename either way. + int i3=qMax(fname.lastIndexOf("/"), fname.lastIndexOf("\\")); QString baseName=fname.mid(i3+1); int i4=baseName.indexOf(".wav"); m_nutc0=m_UTCdisk; if (i1-i3 > 13) { m_UTCdisk=baseName.mid(7, 6).toInt(); - if (i4-i3 > 6) { + // i4 is already an index into baseName (not fname), so compare it + // against a plain threshold rather than subtracting i3 (an fname- + // relative index) from it -- that mismatch made this check fail for + // any file whose directory path was longer than a few characters, + // even though baseName itself was perfectly valid. + if (i4 > 6) { m_UTCdiskDateTime = QDateTime::fromString("20" + baseName.mid(0, 13) + "Z", "yyyyMMdd_hhmmsst").toUTC(); } else { m_UTCdiskDateTime = QDateTime{}; @@ -4990,57 +4909,57 @@ void MainWindow::read_wav_file (QString const& fname) } } - m_wav_future_watcher.setFuture (QtConcurrent::run ([this, fname] { - auto basename = fname.mid (fname.lastIndexOf ('/') + 1); - auto pos = fname.indexOf (".wav", 0, Qt::CaseInsensitive); - int i1=fname.indexOf(".wav"); - int i3=fname.lastIndexOf("/"); - // global variables and threads do not mix well, this needs changing - dec_data.params.nutc = 0; - if (pos > 0) { - if (i1-i3 > 13) { - dec_data.params.nutc = basename.mid(7, 6).toInt(); - m_fileDateTime=basename.mid(0, 13); - } else { - if (pos == fname.indexOf ('_', -11) + 7) { - dec_data.params.nutc = fname.mid (pos - 6, 6).toInt (); - m_fileDateTime=fname.mid(pos-13,13); - } else { - dec_data.params.nutc = 100 * fname.mid (pos - 4, 4).toInt (); - m_fileDateTime=fname.mid(pos-11,11); - } - } - } - BWFFile file {QAudioFormat {}, fname}; - bool ok=file.open (BWFFile::ReadOnly); - if(ok) { - auto bytes_per_frame = file.format ().bytesPerFrame (); - int nsamples=m_TRperiod * RX_SAMPLE_RATE; - qint64 max_bytes = std::min (std::size_t (nsamples), - sizeof (dec_data.d2) / sizeof (dec_data.d2[0]))* bytes_per_frame; - auto n = file.read (reinterpret_cast (dec_data.d2), - std::min (max_bytes, file.size ())); - int frames_read = n / bytes_per_frame; - // zero unfilled remaining sample space - std::memset(&dec_data.d2[frames_read],0,max_bytes - n); - if (11025 == file.format ().sampleRate ()) { - short sample_size = file.format ().sampleSize (); - wav12_ (dec_data.d2, dec_data.d2, &frames_read, &sample_size); - } - dec_data.params.kin = frames_read; - dec_data.params.newdat = 1; + int const nsamples=m_TRperiod * RX_SAMPLE_RATE; + int const sample_capacity=sizeof (dec_data.d2) / sizeof (dec_data.d2[0]); + int const sample_limit=std::min (nsamples, sample_capacity); + m_wav_load_coordinator.start ([fname, sample_limit] { + return std::make_shared ( + Radio::load_wav_input (fname, sample_limit)); + }); +} + +void MainWindow::wav_file_loaded () +{ + if (!m_valid) return; + + auto const result=m_wav_load_coordinator.result (); + if (!result) return; + m_receiveConsumer.invalidate (); + m_referenceInput.reset (); + + { + QMutexLocker lock {&dec_data_mutex ()}; + dec_data.params.nutc=result->nutc; + dec_data.params.yymmdd=result->yymmdd; + if (result->valid) { + std::copy (result->samples.cbegin (), result->samples.cend (), dec_data.d2); + dec_data.params.kin=result->frames; + dec_data.params.newdat=1; } else { - dec_data.params.kin = 0; - dec_data.params.newdat = 0; + dec_data.params.kin=0; + dec_data.params.newdat=0; } + } + m_fileDateTime=result->fileDateTime; + diskDat (); + if (!m_valid) return; +} - dec_data.params.yymmdd=basename.left(6).toInt(); - })); +void MainWindow::update_wav_file_actions () +{ + auto const backendReady = !usesJt9Process () + || Jt9ProcessPhase::Ready == m_jt9ProcessPhase; + bool const enabled=!decoderBusy () && backendReady + && !m_wav_load_coordinator.isLoading (); + ui->actionOpen->setEnabled(enabled); + ui->actionOpen_next_in_directory->setEnabled(enabled); + ui->actionDecode_remaining_files_in_directory->setEnabled(enabled); + ui->monitorButton->setEnabled(!m_wav_load_coordinator.isLoading ()); } void MainWindow::on_actionOpen_next_in_directory_triggered() //Open Next { - if(m_decoderBusy) return; + if(decoderBusy () || m_wav_load_coordinator.isLoading ()) return; monitor (false); int i,len; QFileInfo fi(m_path); @@ -5052,7 +4971,9 @@ void MainWindow::on_actionOpen_next_in_directory_triggered() //Open Next int n=m_path.length(); QString fname=m_path.replace(n-len,len,list.at(i+1)); m_path=fname; - int i1=fname.lastIndexOf("/"); + // Native dialogs on Windows can return backslash-separated paths; + // check both so baseName strips the directory either way. + int i1=qMax(fname.lastIndexOf("/"), fname.lastIndexOf("\\")); QString baseName=fname.mid(i1+1); tx_status_label.setStyleSheet("QLabel{color: #000000; background-color: #99ffff}"); tx_status_label.setText(" " + baseName + " "); @@ -5069,7 +4990,7 @@ void MainWindow::on_actionOpen_next_in_directory_triggered() //Open Next //Open all remaining files void MainWindow::on_actionDecode_remaining_files_in_directory_triggered() { - if(m_decoderBusy) return; + if(decoderBusy () || m_wav_load_coordinator.isLoading ()) return; m_loopall=true; on_actionOpen_next_in_directory_triggered(); } @@ -5085,12 +5006,12 @@ void MainWindow::diskDat() //diskDat() float bw=m_config.RxBandwidth(); if(db > 0.0) degrade_snr_(dec_data.d2,&dec_data.params.kin,&db,&bw); for(int n=1; n<=m_hsymStop; n++) { // Do the waterfall spectra -// k=(n+1)*kstep; //### Why was this (n+1) ??? ### k=n*kstep; if(k > dec_data.params.kin) break; dec_data.params.npts8=k/8; dataSink(k); qApp->processEvents(); //Update the waterfall + if (!m_valid) return; } } else { MessageBox::information_message(this, tr("No data read from disk. Wrong file format?")); @@ -5151,56 +5072,7 @@ void MainWindow::on_actionKeyboard_shortcuts_triggered() QFont font; font.setPointSize (10); m_shortcuts.reset (new HelpTextWindow {tr ("Keyboard Shortcuts"), - //: Keyboard shortcuts help window contents - tr (R"( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Esc Stop Tx, abort QSO, clear next-call queue
F1 Online User's Guide (Alt: transmit Tx6)
Shift+F1 Copyright Notice
Ctrl+F1 About WSJT-X
F2 Open settings window (Alt: transmit Tx2)
F3 Display keyboard shortcuts (Alt: transmit Tx3)
F4 Clear DX Call, DX Grid, Tx messages 1-4 (Alt: transmit Tx4)
Alt+F4 Exit program
F5 Display special mouse commands (Alt: transmit Tx5)
F6 Open next file in directory (Alt: toggle "Call 1st")
Shift+F6 Decode all remaining files in directory
F7 Display Message Averaging window
F11 Move Rx frequency down 1 Hz
Ctrl+F11 Move identical Rx and Tx frequencies down 1 Hz
Shift+F11 Move Tx frequency down 60 Hz (FT8) or 90 Hz (FT4)
Ctrl+Shift+F11 Move dial frequency down 1000 Hz
F12 Move Rx frequency up 1 Hz
Ctrl+F12 Move identical Rx and Tx frequencies up 1 Hz
Shift+F12 Move Tx frequency up 60 Hz (FT8) or 90 Hz (FT4)
Ctrl+Shift+F12 Move dial frequency up 1000 Hz
Alt+1-6 Set now transmission to this number on Tab 1
Ctl+1-6 Set next transmission to this number on Tab 1
Alt+A Clear Active Stations for QMAP
Alt+B Toggle "Best S+P" status
Alt+C Toggle "Call 1st" checkbox
Alt+D Decode again at QSO frequency
Shift+D Full decode (both windows)
Ctrl+E Turn on TX even/1st
Shift+E Turn off TX even/1st
Alt+E Erase
Ctrl+F Edit the free text message box
Alt+G Generate standard messages
Alt+H Halt Tx
Ctrl+I Add Dx Call to the Ignore List
Ctrl+L Lookup callsign in database, generate standard messages
Alt+M Monitor
Alt+N Toggle "Enable Tx"
Ctrl+O Open a .wav file
Alt+O Change operator
Alt+Q Open "Log QSO" window
Ctrl+R Set Tx4 message to RRR (not in FT4)
Alt+R Set Tx4 message to RR73
Ctrl+Shift+R Refresh Active Stations window
Alt+S Stop monitoring
Alt+T Toggle Tune status
Alt+Z Clear hung decoder status
)"), font}); + Radio::HelpText::keyboardShortcuts(), font}); } m_shortcuts->showNormal (); m_shortcuts->raise (); @@ -5213,136 +5085,12 @@ void MainWindow::on_actionSpecial_mouse_commands_triggered() QFont font; font.setPointSize (10); m_mouseCmnds.reset (new HelpTextWindow {tr ("Special Mouse Commands"), - //: Mouse commands help window contents - tr (R"( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Click onAction
Waterfall:Click to set Rx frequency.
- Right-click to set Tx frequency.
- Double-right-click to set Rx and Tx frequencies. -
Decoded text:Double-click to copy second callsign to Dx Call, locator to Dx Grid, change Rx
- and Tx frequency to decoded signal's frequency, and generate standard messages.
- Hold down Alt to prevent Tx from being enabled on double-click.
- If Hold Tx Freq is checked or first callsign in message is your
- own call, Tx frequency is not changed unless Ctrl is held down. -
Dial Frequency:Turn the mouse wheel to change the kHz values, or:
- Right-click to increase frequency by 1 kHz.
- Left-click to decrease frequency by 1 kHz.
- The mouse pointer must be over the Dial Frequency indicator. -
H Button:Click to toggle FT8 Hound Mode On/Off.
- Right-click to activate or deactivate SuperFox mode. -
FT8 Button:Click to switch to FT8 Hound Mode.
- Right-click to toggle last used Special Operating Activity On/Off. -
Q65 Button:Click to switch to Q65 Mode.
- Right-click to switch to Q65 Pileup Mode. -
JT65 Button:Click to switch to JT65 Mode.
- Right-click to switch to JT9 Mode. -
Tx5 Button:Right-click to retain Tx5 free text. -
Tx Even/1st:Right-click to freeze the state of the checkbox.
- Right-click on the FT8 Button to unfreeze. -
Enable Tx Button:Click to toggle Auto-Tx mode On/Off.
- Right-click to toggle Wait & Pounce On/Off. -
Erase button:Click to erase Rx Frequency window.
- Double-click to erase Rx Frequency and Band Activity windows.
- If Alternate Erase button behavior is checked:
- Click to erase Band Activity window.
- Right-click to erase Rx Frequency window.
- Double-click to erase Rx Frequency and Band Activity windows. -
DX Call Button:Click to toggle Wait & Call On/Off.
- Right-click to clear the Dx Call, Dx Grid and Std Msgs. -
Lookup Button:Click to search for callsign in database.
- Right-click to search for Dx Call on qrz.com. -
Add Button:Click to add callsign and locator to database.
- Right-click to search for Dx Call on hamqth.com. -
Ignore Button:Click to add callsign to the Ignore List.
- Right-click to search for Dx Call on qrzcq.com. -
Band Buttons:Click to toggle band / mode default frequencies.
- Right-click to toggle FT8 DXpedition frequencies. -
)"), font}); + Radio::HelpText::specialMouseCommands(), font}); } m_mouseCmnds->showNormal (); m_mouseCmnds->raise (); } -void MainWindow::on_DecodeButton_clicked (bool /* checked */) //Decode request -{ - if(m_mode=="MSK144") { - ui->DecodeButton->setChecked(false); - } else { - if(m_mode!="WSPR" && !m_decoderBusy) { - m_manualDecode=true; - dec_data.params.newdat=0; - dec_data.params.nagain=1; - decode(); - } - } -} void MainWindow::freezeDecode(int n) //freezeDecode() { @@ -5352,20 +5100,6 @@ void MainWindow::freezeDecode(int n) //freezeDecode() } } -void MainWindow::on_ClrAvgButton_clicked() -{ - m_nclearave=1; - if(m_mode=="Echo") { - echocom_.nsum=0; - m_echoGraph->clearAvg(); - m_wideGraph->restartTotalPower(); - } else { - if(m_msgAvgWidget != NULL) { - if(m_msgAvgWidget->isVisible()) m_msgAvgWidget->displayAvg(""); - } - if(m_mode=="Q65") ndecodes_label.setText("0 0"); - } -} void MainWindow::msgAvgDecode2() { @@ -5374,7 +5108,51 @@ void MainWindow::msgAvgDecode2() void MainWindow::decode() //decode() { - if(m_decoderBusy) return; //Don't start decoder if it's already busy. + decode (Ft8MtdDecodeCoordinator::Stage::None); +} + +void MainWindow::decode (Ft8MtdDecodeCoordinator::Stage ft8Stage, + qint64 ft8Period) +{ + if (ft8Period < 0) ft8Period = currentFt8DecodePeriod (); + auto const scheduledFt8 = Ft8MtdDecodeCoordinator::Stage::None != ft8Stage; + Ft8MtdDecodeCoordinator::Decision ft8Decision; + if (scheduledFt8) + { + ft8Decision = m_ft8MtdDecodeCoordinator.request ( + ft8Stage, ft8Period, configuredFt8MtdEarlyStageCount (), decoderBusy ()); + reportFt8BackpressureDecision (ft8Decision, ft8Period); + if (Ft8MtdDecodeCoordinator::Action::SkipEarly == ft8Decision.action) + { + ui->DecodeButton->setChecked (false); + return; + } + } + + auto const deferFt8Final = scheduledFt8 + && (Ft8MtdDecodeCoordinator::Action::DeferFinal == ft8Decision.action + || Ft8MtdDecodeCoordinator::Action::ReplaceFinal == ft8Decision.action); + if(decoderBusy () && !deferFt8Final) { + recoverDecoderAtBoundary ("decode cycle boundary", false); + if (decoderBusy ()) { + logDecoderBusyRequest("decode request"); + return; //Don't start decoder if it's already busy. + } + } + if (usesJt9Process () + && (Jt9ProcessPhase::Ready != m_jt9ProcessPhase + || QProcess::Running != proc_jt9.state ()) + && Ft8MtdDecodeCoordinator::Stage::Final != ft8Stage) + { + ui->DecodeButton->setChecked (false); + showStatusMessage (tr ("Decoder is starting; decode request skipped.")); + return; + } + if (usesJt9Process () && !dec_data.params.newdat && !m_jt9PayloadValid) + { + dec_data.params.newdat = true; + dec_data.params.nagain = false; + } m_fetched=0; QDateTime now = QDateTime::currentDateTimeUtc (); if( m_dateTimeLastTX.isValid () ) { @@ -5395,6 +5173,9 @@ void MainWindow::decode() //decode() dec_data.params.nutc=dec_data.params.nutc/100; } if(dec_data.params.nagain==0 && dec_data.params.newdat==1 && (!m_diskData)) { + if(m_mode=="Q65" and m_specOp==SpecOp::Q65_PILEUP) { + m_q65PileupCopiedLastRxCall.clear(); // starting a decode pass over fresh audio + } m_dateTimeSeqStart = qt_truncate_date_time_to (QDateTime::currentDateTimeUtc (), m_TRperiod * 1.e3); auto t = m_dateTimeSeqStart.time (); dec_data.params.nutc = t.hour () * 100 + t.minute (); @@ -5413,7 +5194,7 @@ void MainWindow::decode() //decode() dec_data.params.nutc=10000*ihr + 100*imin + isec; } if(m_nPick==2) dec_data.params.nutc=m_nutc0; - dec_data.params.nQSOProgress = m_QSOProgress; + dec_data.params.nQSOProgress = static_cast (m_QSOProgress); dec_data.params.nfqso=m_wideGraph->rxFreq(); dec_data.params.nftx = ui->TxFreqSpinBox->value (); qint32 depth {m_ndepth}; @@ -5493,6 +5274,9 @@ void MainWindow::decode() //decode() if(dec_data.params.nexp_decode==5) dec_data.params.nexp_decode=1; //NA VHF, WW Digi, ARRL Digi contests if(dec_data.params.nexp_decode==8) dec_data.params.nexp_decode=1; //and Q65 Pileup all use 4-character if(dec_data.params.nexp_decode==9) dec_data.params.nexp_decode=1; //grid exchange + if(m_mode=="Q65" && m_specOp==SpecOp::Q65_PILEUP) { + dec_data.params.nexp_decode |= q65PileupDecodeFlag; + } if(m_config.single_decode()) dec_data.params.nexp_decode += 32; if(m_config.enable_VHF_features()) dec_data.params.nexp_decode += 64; if(m_mode.startsWith("FST4")) dec_data.params.nexp_decode += 256*(ui->sbNB->value()+3); @@ -5506,10 +5290,10 @@ void MainWindow::decode() //decode() { //FT8 block of parameters for multithreaded FT8 decoder dec_data.params.nstophint = 0; // stophint should be false to avoid truncating decode process - dec_data.params.nQSOProgress = m_QSOProgress; + dec_data.params.nQSOProgress = static_cast (m_QSOProgress); dec_data.params.nftx = ui->TxFreqSpinBox->value (); - if(m_freqNominal < 30000000) dec_data.params.napwid=5; // FT8AP decoding bandwidth for 'mycall hiscall ???' and RRR,RR73,73 messages - else if(m_freqNominal < 100000000) dec_data.params.napwid=15; + if(m_operatingFrequency.rx () < 30000000) dec_data.params.napwid=5; // FT8AP decoding bandwidth for 'mycall hiscall ???' and RRR,RR73,73 messages + else if(m_operatingFrequency.rx () < 100000000) dec_data.params.napwid=15; else dec_data.params.napwid=50; dec_data.params.nmt=m_ft8threads; dec_data.params.ncandthin=m_ncandthin; @@ -5560,7 +5344,7 @@ void MainWindow::decode() //decode() dec_data.params.lmultift8 = false; // use the standard FT8 decoder for early decoding step if (m_ihsym==m_earlyDecode2) dec_data.params.ndepth=2; } - qDebug() << "dec_data.params.lmultift8 is" << dec_data.params.lmultift8; //ft8md +// qDebug() << "dec_data.params.lmultift8 is" << dec_data.params.lmultift8; //ft8md dec_data.params.ndiskdat=0; if(m_diskData) dec_data.params.ndiskdat=1; dec_data.params.nfa=m_wideGraph->nStartFreq(); @@ -5591,55 +5375,84 @@ void MainWindow::decode() //decode() if(!hisCall.isEmpty() && !m_auto && hisCall != m_lastloggedcall) dec_data.params.lenabledxcsearch=true; //ft8md was && !m_enableTx else dec_data.params.lenabledxcsearch=false; - if (auto * to = reinterpret_cast (mem_jt9->data())) + if(m_mode=="MSK144" or m_bFast9) { + float t0=m_t0; + float t1=m_t1; + m_fastDecodePending = true; + qApp->processEvents(); //Update the waterfall + if(m_nPick > 0) { + t0=m_t0Pick; + t1=m_t1Pick; + } + narg[0]=dec_data.params.nutc; + if(m_kdone>int(12000.0*m_TRperiod)) { + m_kdone=int(12000.0*m_TRperiod); + } + narg[1]=m_kdone; + narg[2]=m_nSubMode; + narg[3]=dec_data.params.newdat; + narg[4]=dec_data.params.minSync; + narg[5]=m_nPick; + narg[6]=1000.0*t0; + narg[7]=1000.0*t1; + narg[8]=2; //Max decode lines per decode attempt + if(dec_data.params.minSync<0) narg[8]=50; + if(m_mode=="JT9") narg[9]=102; //Fast JT9 + if(m_mode=="MSK144") narg[9]=104; //MSK144 + narg[10]=ui->RxFreqSpinBox->value(); + narg[11]=ui->sbFtol->value (); + narg[12]=0; + narg[13]=-1; + narg[14]=m_config.aggressive(); + watcher3.setFuture (startFastDecode (dec_data.d2, &narg[0], m_TRperiod, + dec_data.params.mycall, dec_data.params.hiscall)); + } else { + decoder_params_t decoderParams; { - char *from = (char*) dec_data.ipc; - int size=sizeof(struct dec_data); - if(dec_data.params.newdat==0) { - int noffset {offsetof (struct dec_data, params.nutc)}; - to += noffset; - from += noffset; - size -= noffset; + QMutexLocker lock {&dec_data_mutex ()}; + decoderParams = dec_data.params; + } + if (deferFt8Final) + { + auto pending = capturePendingFt8MtdDecode (ft8Period); + auto const action = m_ft8MtdDecodeCoordinator.deferFinal (std::move (pending)); + qWarning () << (Ft8MtdDecodeCoordinator::Action::ReplaceFinal == action + ? "Replacing pending FT8 final decode" + : "Deferring FT8 final decode") + << "period:" << ft8Period + << "backoffPeriods:" << m_ft8MtdDecodeCoordinator.skippedPeriods (); + ui->DecodeButton->setChecked (false); + updateDecodeControls (); + return; } - if(m_mode=="MSK144" or m_bFast9) { - float t0=m_t0; - float t1=m_t1; - qApp->processEvents(); //Update the waterfall - if(m_nPick > 0) { - t0=m_t0Pick; - t1=m_t1Pick; - } - static short int d2b[360000]; - narg[0]=dec_data.params.nutc; - if(m_kdone>int(12000.0*m_TRperiod)) { - m_kdone=int(12000.0*m_TRperiod); - } - narg[1]=m_kdone; - narg[2]=m_nSubMode; - narg[3]=dec_data.params.newdat; - narg[4]=dec_data.params.minSync; - narg[5]=m_nPick; - narg[6]=1000.0*t0; - narg[7]=1000.0*t1; - narg[8]=2; //Max decode lines per decode attempt - if(dec_data.params.minSync<0) narg[8]=50; - if(m_mode=="JT9") narg[9]=102; //Fast JT9 - if(m_mode=="MSK144") narg[9]=104; //MSK144 - narg[10]=ui->RxFreqSpinBox->value(); - narg[11]=ui->sbFtol->value (); - narg[12]=0; - narg[13]=-1; - narg[14]=m_config.aggressive(); - memcpy(d2b,dec_data.d2,2*360000); - watcher3.setFuture (QtConcurrent::run (std::bind (fast_decode_, &d2b[0], - &narg[0],&m_TRperiod, &m_msg[0][0], dec_data.params.mycall, - dec_data.params.hiscall, (FCL)8000, (FCL)12, (FCL)12))); - } else { - mem_jt9->lock (); - memcpy(to, from, qMin(mem_jt9->size(), size)); - mem_jt9->unlock (); - to_jt9(m_ihsym,1,-1); //Send m_ihsym to jt9[.exe] and start decoding - decodeBusy(true); + + auto const publishResult = publishDecodeRequest ( + decoderParams.newdat, ft8Stage, ft8Period); + if (DecodePublishResult::Published == publishResult && scheduledFt8) + { + if (m_ft8MtdDecodeCoordinator.published (ft8Stage, ft8Period)) + { + reportFt8BackpressureRecovery (ft8Period); + } + emitFt8DecoderInvocation (decoderParams); + } + if (DecodePublishResult::Published != publishResult) + { + ui->DecodeButton->setChecked (false); + if (DecodePublishResult::Unavailable == publishResult + && Ft8MtdDecodeCoordinator::Stage::Final == ft8Stage) + { + auto pending = capturePendingFt8MtdDecode (ft8Period); + m_ft8MtdDecodeCoordinator.deferFinal (std::move (pending)); + qWarning () << "Deferring FT8 final decode while decoder starts" + << "period:" << ft8Period; + updateDecodeControls (); + } + if (DecodePublishResult::Failed == publishResult) + { + m_ft8MtdDecodeCoordinator.publicationFailed (ft8Stage, ft8Period); + requestDecoderRestart ("decode publication failed"); + } } } if((m_mode=="FT4" or (m_mode=="FT8" and m_ihsym==41) or m_diskData) and @@ -5648,14 +5461,173 @@ void MainWindow::decode() //decode() } } +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) +bool MainWindow::configureLiveAudioTestDecodeRange () +{ + // FT8's 1500/2048 Hz bins make 956 pixels at 4 bins/pixel span 200-3000 Hz. + m_wideGraph->setFrequencyScale (liveAudioTestDecodeLowFrequency (), 4, 956); + return m_wideGraph->nStartFreq () == liveAudioTestDecodeLowFrequency () + && m_wideGraph->Fmax () == liveAudioTestDecodeHighFrequency (); +} + +bool MainWindow::prepareLiveAudioTestFt8InputCompletion () +{ + if (!m_automated_test || m_mode != QStringLiteral ("FT8")) return false; + m_liveAudioTestPendingFt8FinalPeriod = -1; + m_liveAudioTestAwaitFt8InputCompletion = true; + m_liveAudioTestFt8InputComplete = false; + return true; +} + +bool MainWindow::configureLiveAudioTestHandoff () +{ + if (!m_automated_test || m_mode != "FT8") return false; + m_multithreadFT8 = true; + m_ft8DecoderStart = 3; + m_delay = 0; + fixStop (); + return m_hsymStop == 49; +} + +QString MainWindow::completeLiveAudioTestFt8Input (qint64 frames) +{ + auto const expectedInputFrames = + static_cast (DecoderIpc::Ft8SampleCount) + * static_cast (m_downSampleFactor); + if (!m_automated_test || !m_liveAudioTestAwaitFt8InputCompletion + || frames != expectedInputFrames) + { + return tr ("FT8 input completion was rejected: automated=%1 awaiting=%2 frames=%3.") + .arg (m_automated_test) + .arg (m_liveAudioTestAwaitFt8InputCompletion) + .arg (frames); + } + + if (!QMetaObject::invokeMethod ( + m_detector, "flushBufferedFrames", Qt::BlockingQueuedConnection, + Q_ARG (qint64, DecoderIpc::Ft8SampleCount))) + { + return tr ("Unable to flush the final FT8 audio block."); + } + + // The flush transfers its final owned block through the ordinary queued + // handoff. Complete that delivery before this test-only completeness check. + QCoreApplication::sendPostedEvents (this, QEvent::MetaCall); + + { + QMutexLocker lock {&dec_data_mutex ()}; + if (dec_data.params.kin != DecoderIpc::Ft8SampleCount) + { + return tr ("FT8 input completed with %1 of %2 samples in the decode buffer.") + .arg (dec_data.params.kin) + .arg (DecoderIpc::Ft8SampleCount); + } + } + + m_liveAudioTestFt8InputComplete = true; + if (m_liveAudioTestPendingFt8FinalPeriod >= 0) + { + auto const period = m_liveAudioTestPendingFt8FinalPeriod; + m_liveAudioTestPendingFt8FinalPeriod = -1; + m_liveAudioTestAwaitFt8InputCompletion = false; + m_liveAudioTestFt8InputComplete = false; + decode (Ft8MtdDecodeCoordinator::Stage::Final, period); + } + return {}; +} + +MainWindow::LiveAudioTestFt8TransmitRequest +MainWindow::startLiveAudioTestFt8Transmit (qint64 targetPeriodStartMs) +{ + if (!m_automated_test || m_mode != QStringLiteral ("FT8")) + { + std::cerr << "FT8 TX loopback trigger rejected: automated=" + << m_automated_test << " mode=" << m_mode.toStdString () + << std::endl; + return {}; + } + + if (!m_transmitting) + { + g_iptt = 1; + m_iptt0 = 0; + guiUpdate (); + } + if (!m_transmitting) + { + std::cerr << "FT8 TX loopback could not arm transmission: g_iptt=" + << g_iptt << " m_iptt0=" << m_iptt0 + << " message=" << m_currentMessage.toStdString () + << " generated_error=" << m_generated_message_error + << std::endl; + return {}; + } + + // The fixture has no rig backend, so release the generated waveform at the + // same seam normally reached after the rig acknowledges PTT. + m_liveAudioTestFt8StartWindowOpenMs = targetPeriodStartMs; + m_liveAudioTestFt8StartWindowCloseMs = targetPeriodStartMs + 499; + m_liveAudioTestFt8StartSessionId = -1; + m_liveAudioTestFt8StartGeneration = -1; + m_tx_when_ready = false; + ptt1Timer.stop (); + auto const dispatched = startTx2 (); + m_liveAudioTestFt8StartWindowOpenMs = -1; + m_liveAudioTestFt8StartWindowCloseMs = -1; + if (!dispatched) + { + return {}; + } + return {m_liveAudioTestFt8StartSessionId, + m_liveAudioTestFt8StartGeneration}; +} + +QString MainWindow::liveAudioTestFt8BackpressureDiagnostics () const +{ + qint32 ipcState {-1}; + qint32 ipcGeneration {-1}; + qint32 ipcProgress {-1}; + if (DecoderIpc::hasUsableSize (mem_jt9->size ()) && mem_jt9->data ()) + { + auto const * shared = reinterpret_cast ( + mem_jt9->constData ()); + if (DECODER_IPC_VERSION == DecoderIpc::protocolVersion (*shared)) + { + ipcState = DecoderIpc::state (*shared); + ipcGeneration = DecoderIpc::generation (*shared); + ipcProgress = DecoderIpc::progress (*shared); + } + } + + return QString {"degraded=%1 pending_final=%2 backoff_periods=%3 " + "next_probe_period=%4 owner=%5 process_phase=%6 " + "active_generation=%7 ipc_state=%8 ipc_generation=%9 " + "ipc_progress=%10 decoder_elapsed_ms=%11 " + "decoder_idle_ms=%12"} + .arg (m_ft8MtdDecodeCoordinator.degraded ()) + .arg (m_ft8MtdDecodeCoordinator.hasPending ()) + .arg (m_ft8MtdDecodeCoordinator.skippedPeriods ()) + .arg (m_ft8MtdDecodeCoordinator.nextProbePeriod ()) + .arg (static_cast (m_decodeOwner)) + .arg (static_cast (m_jt9ProcessPhase)) + .arg (m_activeJt9Decode.generation) + .arg (ipcState) + .arg (ipcGeneration) + .arg (ipcProgress) + .arg (decoderDiagnosticElapsedMs ()) + .arg (decoderDiagnosticIdleMs ()); +} +#endif + void::MainWindow::fast_decode_done() { + if (m_fastDecodePending) return; float t,tmax=-99.0; dec_data.params.nagain=false; dec_data.params.ndiskdat=false; -// if(m_msg[0][0]==0) m_bDecoded=false; - for(int i=0; m_msg[i][0] && i<100; i++) { - QString message=QString::fromLatin1(m_msg[i]); + if(m_mode=="JTTY" && m_diskData) flushJttyDecodeLines(); + for(int i=0; i<100 && m_msg[i][0]; i++) { + QString message=QString::fromLatin1(m_msg[i], 80); m_msg[i][0]=0; if(message.length()>80) message=message.left (80); if(narg[13]/8==narg[12]) message=message.trimmed().replace("<...>",m_calls); @@ -5692,28 +5664,680 @@ void::MainWindow::fast_decode_done() m_bFastDone=false; } -void MainWindow::to_jt9(qint32 n, qint32 istart, qint32 idone) -{ - if (auto * dd = reinterpret_cast (mem_jt9->data())) +void MainWindow::startDecoderProcess () +{ + auto const replacement = decoderRestartInProgress (); + m_jt9ProcessPhase = replacement ? Jt9ProcessPhase::ReplacementStarting + : Jt9ProcessPhase::InitialStarting; + m_activeJt9Decode = {}; + m_decoderOutputFramer.reset (); + QStringList jt9Args { + "-s", QApplication::applicationName (), // shared memory key, includes rig + "-w", "1", // FFTW planning patience + // The number of threads for FFTW specified here is chosen as + // three because that gives the best throughput of the large + // FFTs used in jt9. The count is the minimum of (the number + // available CPU threads less one) and three. This ensures that + // there is always at least one free CPU thread to run the other + // mode decoder in parallel. + "-m", QString::number (qMin (qMax (QThread::idealThreadCount () - 1, 1), 3)), + "-e", QDir::toNativeSeparators (m_appDir), + "-a", QDir::toNativeSeparators (m_config.writeable_data_dir ().absolutePath ()), + "-t", QDir::toNativeSeparators (m_config.temp_dir ().absolutePath ()), + // -r: read-only shipped-data dir (cty.dat, ALLCALL7.TXT, ...) for the + // Fortran decoder; resolves to Contents/Resources/wsjtx on macOS. + "-r", QDir::toNativeSeparators (m_decoderDataDir.absolutePath ()) + }; + QProcessEnvironment environment {m_env}; + environment.insert ("OMP_STACKSIZE", "10M"); + proc_jt9.setProcessEnvironment (environment); + proc_jt9.start (QDir::toNativeSeparators (QDir {m_appDir}.filePath ("jt9")), + jt9Args, QIODevice::ReadWrite | QIODevice::Unbuffered); + if (replacement) m_decoderStartTimer.start (5000); + updateDecodeControls (); +} + +bool MainWindow::initializeDecoderSharedMemory () +{ + if (!DecoderIpc::hasUsableSize (mem_jt9->size ()) + || !mem_jt9->data ()) { - mem_jt9->lock (); - dd->ipc[0]=n; - if(istart>=0) dd->ipc[1]=istart; - if(idone>=0) dd->ipc[2]=idone; - mem_jt9->unlock (); + return false; } + auto * shared = reinterpret_cast (mem_jt9->data ()); + DecoderIpc::initialize (*shared); + return true; } -void MainWindow::decodeDone () +DecodeOperatingContext MainWindow::currentDecodeOperatingContext () const { - if(m_mode=="Q65") m_wideGraph->drawRed(0,0); - if ("FST4W" == m_mode) - { - if (m_uploadWSPRSpots - && m_config.is_transceiver_online ()) { // need working rig control -#if QT_VERSION >= QT_VERSION_CHECK (5, 15, 0) - uploadTimer.start(QRandomGenerator::global ()->bounded (0, 20000)); // Upload delay -#else + auto const periodFrequency = m_freqNominalPeriod ? m_freqNominalPeriod + : m_operatingFrequency.rx (); + auto const periodBand = m_currentBandPeriod.isEmpty () + ? m_config.bands ()->find (periodFrequency) : m_currentBandPeriod; + DecodeOperatingContext context; + context.mode = m_mode; + context.specOp = m_specOp; + context.periodFrequency = periodFrequency; + context.band = periodBand; + context.sequenceStart = m_dateTimeSeqStart; + context.trPeriod = m_TRperiod; + context.submode = m_nSubMode; + context.diskData = m_diskData; + context.multithreadFt8 = m_multithreadFT8; + context.ft8DecoderStart = m_ft8DecoderStart; + context.ft8ThreadCount = m_ft8threads; + context.decodeDepth = m_ndepth; + context.ft8Cycles = m_nFT8Cycles; + context.ft8Sensitivity = m_ft8Sensitivity; + context.ft8RxFrequencySensitivity = m_nFT8RXfSens; + context.decodeLowFrequency = m_wideGraph->nStartFreq (); + context.decodeHighFrequency = m_wideGraph->Fmax (); + context.ft8WideDxCallSearch = m_FT8WideDxCallSearch; + context.hideFt8DuplicateMessages = ui->actionHide_FT8_dupe_messages->isChecked (); + context.ft8ApEnabled = ui->actionEnable_AP_FT8->isChecked (); + context.superFox = m_config.superFox (); + context.myCall = m_config.my_callsign (); + return context; +} + +bool MainWindow::activeDecodeOperatingContextMatchesCurrent () const +{ + return decodeOperatingContextMatchesCurrent (m_activeJt9Decode.context); +} + +bool MainWindow::decodeOperatingContextMatchesCurrent ( + DecodeOperatingContext const& context) const +{ + auto current = currentDecodeOperatingContext (); + current.periodFrequency = m_operatingFrequency.rx (); + current.band = m_config.bands ()->find (m_operatingFrequency.rx ()); + return context.hasSameDecodeIdentity (current); +} + +bool MainWindow::pendingFt8DecodeOperatingContextMatchesCurrent ( + DecodeOperatingContext const& context) const +{ + auto current = currentDecodeOperatingContext (); + current.periodFrequency = m_operatingFrequency.rx (); + current.band = m_config.bands ()->find (m_operatingFrequency.rx ()); + return context.hasSameFt8PendingIdentity (current); +} + +qint64 MainWindow::currentFt8DecodePeriod () const +{ + auto const periodMs = qMax (1, qRound64 (m_TRperiod * 1000.0)); + return QDateTime::currentMSecsSinceEpoch () / periodMs; +} + +bool MainWindow::usesFt8MtdFinal () const +{ + auto const standardFinalRequired = + SpecOp::HOUND == m_specOp && m_config.superFox (); + return m_mode == "FT8" + && Ft8MtdDecodeScheduler::supportsBackpressure ( + m_multithreadFT8, standardFinalRequired); +} + +int MainWindow::configuredFt8MtdEarlyStageCount () const +{ + Q_ASSERT (usesFt8MtdFinal ()); + if (0 == m_ft8DecoderStart) return 1; + if (1 == m_ft8DecoderStart) return 2; + return 0; +} + +std::unique_ptr +MainWindow::capturePendingFt8MtdDecode (qint64 period) const +{ + auto pending = std::make_unique (); + pending->period = period; + pending->context = currentDecodeOperatingContext (); + { + QMutexLocker payloadLock {&dec_data_mutex ()}; + pending->payload.params = dec_data.params; + Q_ASSERT (8 == pending->payload.params.nmode); + Q_ASSERT (pending->payload.params.lmultift8); + std::copy_n (dec_data.d2, DecoderIpc::Ft8SampleCount, + pending->payload.samples.begin ()); + } + return pending; +} + +void MainWindow::reportFt8BackpressureDecision ( + Ft8MtdDecodeCoordinator::Decision const& decision, qint64 period) +{ + if (decision.enteredDegraded) + { + showStatusMessage (tr ( + "FT8 decoding is running behind; early passes are temporarily reduced.")); + qWarning () << "FT8 decoder entered bounded backpressure" + << "period:" << period + << "backoffPeriods:" << decision.skippedPeriods; + } + else if (Ft8MtdDecodeCoordinator::Action::SkipEarly == decision.action) + { + qInfo () << "Skipping FT8 early decode during backpressure" + << "period:" << period + << "backoffPeriods:" << decision.skippedPeriods + << "nextProbePeriod:" << m_ft8MtdDecodeCoordinator.nextProbePeriod (); + } +} + +void MainWindow::reportFt8BackpressureRecovery (qint64 period) +{ + showStatusMessage (tr ("FT8 decoding caught up; configured early passes restored.")); + qInfo () << "FT8 decoder recovered from bounded backpressure" + << "period:" << period; +} + +void MainWindow::emitFt8DecoderInvocation (decoder_params_t const& params) const +{ +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) + if (m_automated_test) + { + Q_EMIT ft8DecoderInvocation ( + params.lmultift8, params.nmt, params.ndepth & 7, + params.nft8cycles, params.lft8subpass, params.ndecoderstart, + params.nzhsym, params.kin, params.nfa, params.nfb); + } +#else + Q_UNUSED (params); +#endif +} + +MainWindow::DecodePublishResult MainWindow::publishDecodeRequest ( + bool copySamples, Ft8MtdDecodeCoordinator::Stage ft8Stage, qint64 ft8Period) +{ + if (Jt9ProcessPhase::Ready != m_jt9ProcessPhase + || QProcess::Running != proc_jt9.state () + || decoderBusy ()) + { + return DecodePublishResult::Unavailable; + } + if ((!copySamples && !m_jt9PayloadValid) + || !DecoderIpc::hasUsableSize (mem_jt9->size ()) + || !mem_jt9->data ()) + { + return DecodePublishResult::Failed; + } + + if (!m_freqNominalPeriod) + { + m_freqNominalPeriod = m_operatingFrequency.rx (); + m_currentBandPeriod = m_config.bands ()->find (m_operatingFrequency.rx ()); + } + + auto const generation = DecoderIpc::nextGeneration (m_nextDecoderGeneration); + if (!beginDecode (DecodeOwner::Jt9)) + { + return DecodePublishResult::Failed; + } + m_activeJt9Decode = {}; + m_activeJt9Decode.generation = generation; + m_activeJt9Decode.context = currentDecodeOperatingContext (); + m_activeJt9Decode.copiedSamples = copySamples; + m_activeJt9Decode.ft8Stage = ft8Stage; + m_activeJt9Decode.ft8Period = ft8Period; + bool published {false}; + { + QMutexLocker payloadLock {&dec_data_mutex ()}; + auto * shared = reinterpret_cast (mem_jt9->data ()); + published = DecoderIpc::publish (*shared, dec_data, copySamples, generation); + } + if (!published) + { + logDecoderAbnormalClear ("decode publication failed"); + m_activeJt9Decode = {}; + endDecode (DecodeOwner::Jt9, DecodeEndState::Aborted); + return DecodePublishResult::Failed; + } + + m_nextDecoderGeneration = generation; + return DecodePublishResult::Published; +} + +MainWindow::DecodePublishResult MainWindow::publishPendingFt8Decode () +{ + using DrainResult = Ft8MtdDecodeCoordinator::DrainResult; + using PendingPublishResult = Ft8MtdDecodeCoordinator::PendingPublishResult; + + auto const outcome = m_ft8MtdDecodeCoordinator.drainPending ( + [this] (Ft8MtdDecodeCoordinator::PendingMtdDecode const& pending) { + return m_monitoring + && pendingFt8DecodeOperatingContextMatchesCurrent (pending.context); + }, + [this] (Ft8MtdDecodeCoordinator::PendingMtdDecode const& pending) { + if (Jt9ProcessPhase::Ready != m_jt9ProcessPhase + || QProcess::Running != proc_jt9.state ()) + { + return PendingPublishResult::Unavailable; + } + if (!DecoderIpc::hasUsableSize (mem_jt9->size ()) || !mem_jt9->data ()) + { + return PendingPublishResult::Failed; + } + + auto const generation = DecoderIpc::nextGeneration ( + m_nextDecoderGeneration); + if (!beginDecode (DecodeOwner::Jt9, &pending.payload.params, + &pending.context)) + { + return PendingPublishResult::Unavailable; + } + m_activeJt9Decode = {}; + m_activeJt9Decode.generation = generation; + m_activeJt9Decode.context = pending.context; + m_activeJt9Decode.copiedSamples = true; + m_activeJt9Decode.ft8Stage = Ft8MtdDecodeCoordinator::Stage::Final; + m_activeJt9Decode.ft8Period = pending.period; + + auto * shared = reinterpret_cast (mem_jt9->data ()); + if (!DecoderIpc::publishFt8Mtd (*shared, pending.payload, generation)) + { + logDecoderAbnormalClear ("pending FT8 decode publication failed"); + m_activeJt9Decode = {}; + endDecode (DecodeOwner::Jt9, DecodeEndState::Aborted); + return PendingPublishResult::Failed; + } + + m_nextDecoderGeneration = generation; + emitFt8DecoderInvocation (pending.payload.params); + qInfo () << "Published pending FT8 final decode" + << "period:" << pending.period + << "generation:" << generation; + return PendingPublishResult::Published; + }); + + if (DrainResult::Obsolete == outcome.result) + { + qInfo () << "Canceling obsolete pending FT8 final decode" + << "period:" << outcome.period; + updateDecodeControls (); + } + if (outcome.recovered) reportFt8BackpressureRecovery (outcome.period); + if (DrainResult::Published == outcome.result) + { + return DecodePublishResult::Published; + } + if (DrainResult::Failed == outcome.result) return DecodePublishResult::Failed; + return DecodePublishResult::Unavailable; +} + +void MainWindow::cancelPendingFt8Decode (QString const& reason) +{ + if (m_ft8MtdDecodeCoordinator.hasPending () || m_ft8MtdDecodeCoordinator.degraded ()) + { + qInfo () << "Resetting FT8 decode backpressure" << "reason:" << reason; + } + m_ft8MtdDecodeCoordinator.cancel (); + updateDecodeControls (); +} + +void MainWindow::requestDecoderRestart (QString const& reason) +{ + if (m_closing || decoderRestartInProgress ()) return; + if (DecodeOwner::Wsprd == m_decodeOwner) return; + + logDecoderAbnormalClear (reason); + m_jt9ProcessPhase = Jt9ProcessPhase::StopRequested; + abortJt9Transaction (); + updateDecodeControls (); + + if (DecoderIpc::hasUsableSize (mem_jt9->size ()) + && mem_jt9->data ()) + { + auto * shared = reinterpret_cast (mem_jt9->data ()); + DecoderIpc::shutdown (*shared); + } + + if (QProcess::NotRunning == proc_jt9.state ()) + { + if (!initializeDecoderSharedMemory ()) + { + m_valid = false; + QTimer::singleShot (0, this, SLOT (close ())); + return; + } + startDecoderProcess (); + return; + } + m_decoderShutdownTimer.start (250); +} + +bool MainWindow::decoderRestartInProgress () const +{ + return Jt9ProcessPhase::StopRequested == m_jt9ProcessPhase + || Jt9ProcessPhase::Terminating == m_jt9ProcessPhase + || Jt9ProcessPhase::Killing == m_jt9ProcessPhase + || Jt9ProcessPhase::ReplacementStarting == m_jt9ProcessPhase; +} + +bool MainWindow::usesJt9Process () const +{ + return "WSPR" != m_mode && "JTTY" != m_mode + && "MSK144" != m_mode && !m_bFast9; +} + +bool MainWindow::beginDecode ( + DecodeOwner owner, decoder_params_t const * diagnosticParams, + DecodeOperatingContext const * diagnosticContext) +{ + if (DecodeOwner::None == owner || DecodeOwner::None != m_decodeOwner) return false; + m_decodeOwner = owner; + Q_EMIT decodeCycleStarted (++m_decodeCycleGeneration); + if (DecodeOwner::Jt9 == owner) + { + beginDecoderDiagnostic (diagnosticParams, diagnosticContext); + } + updateDecodeControls (); + return true; +} + +void MainWindow::endDecode (DecodeOwner owner, DecodeEndState state) +{ + if (owner != m_decodeOwner) + { + qWarning () << "Ignoring decode completion from a non-owning decoder"; + return; + } + if (DecodeOwner::Jt9 == owner) + { + finishDecoderDiagnostic (); + } + m_decodeOwner = DecodeOwner::None; + if (DecodeEndState::Completed == state) + { + Q_EMIT decodeCycleCompleted (m_decodeCycleGeneration); + } + else + { + Q_EMIT decodeCycleAborted (m_decodeCycleGeneration); + } + updateDecodeControls (); +} + +void MainWindow::updateDecodeControls () +{ + auto const backendReady = !usesJt9Process () + || Jt9ProcessPhase::Ready == m_jt9ProcessPhase; + auto const enabled = !decoderBusy () && backendReady + && !m_wav_load_coordinator.isLoading (); + ui->DecodeButton->setEnabled (enabled && "WSPR" != m_mode + && "FST4W" != m_mode && "Echo" != m_mode); + update_wav_file_actions (); + statusUpdate (); +} + +void MainWindow::abortJt9Transaction () +{ + m_decoderOutputFramer.reset (); + m_ft8MtdDecodeCoordinator.publicationFailed ( + m_activeJt9Decode.ft8Stage, m_activeJt9Decode.ft8Period); + m_activeJt9Decode = {}; + m_jt9PayloadValid = false; + dec_data.params.nagain = false; + dec_data.params.ndiskdat = false; + m_nclearave = 0; + m_RxLog = 0; + m_nDecodes = 0; + m_bDecoded = false; + m_manualDecode = false; + m_startAnother = false; + m_loopall = false; + m_bNoMoreFiles = false; + ui->DecodeButton->setChecked (false); + ndecodes_label.setText ("Q65" == m_mode ? "0 0" : "0"); + if (DecodeOwner::Jt9 == m_decodeOwner) + { + endDecode (DecodeOwner::Jt9, DecodeEndState::Aborted); + } + else updateDecodeControls (); +} + +qint64 MainWindow::decoderDiagnosticElapsedMs() const +{ + if(!m_decoderDiagActive || !m_decoderDiagElapsedTimer.isValid()) return -1; + return m_decoderDiagElapsedTimer.elapsed(); +} + +qint64 MainWindow::decoderDiagnosticIdleMs() const +{ + if(!m_decoderDiagActive || !m_decoderDiagProgressTimer.isValid()) return -1; + return m_decoderDiagProgressTimer.elapsed(); +} + +qint64 MainWindow::decoderRequestDeadlineMs() const +{ + auto const automaticLiveDecode = m_decoderCompletedSinceStart + && !m_decoderDiagStartNdiskdat + && m_decoderDiagStartNewdat + && !m_decoderDiagStartNagain; + if (automaticLiveDecode && "FT4" == m_decoderDiagStartMode) return 6000; + if (automaticLiveDecode && "FT8" == m_decoderDiagStartMode) return 10000; + + auto const minimum = m_decoderCompletedSinceStart ? 60000 : 300000; + return std::max ( + minimum, static_cast (4.0 * m_decoderDiagStartTRperiod * 1000.0)); +} + +bool MainWindow::decoderRequestDeadlineExpired() const +{ + auto const idle = decoderDiagnosticIdleMs (); + return idle >= 0 && idle >= decoderRequestDeadlineMs (); +} + +void MainWindow::beginDecoderDiagnostic( + decoder_params_t const * params, DecodeOperatingContext const * context) +{ + auto const& diagnosticParams = params ? *params : dec_data.params; + m_decoderDiagActive=true; + m_decoderDiagActiveSequence=++m_decoderDiagSequence; + m_decoderDiagElapsedTimer.start(); + m_decoderDiagProgressTimer.start(); + m_decoderDiagStartMode=context ? context->mode : m_mode; + m_decoderDiagStartTRperiod=context ? context->trPeriod : m_TRperiod; + m_decoderDiagStartIhsym=params ? diagnosticParams.nzhsym : m_ihsym; + m_decoderDiagStartHsymStop=params ? diagnosticParams.nzhsym : m_hsymStop; + m_decoderDiagStartNzhsym=diagnosticParams.nzhsym; + m_decoderDiagStartNewdat=diagnosticParams.newdat; + m_decoderDiagStartNagain=diagnosticParams.nagain; + m_decoderDiagStartNdiskdat=diagnosticParams.ndiskdat; + m_decoderDiagProgressCount=0; + m_decoderDiagBusyRequestLogged=false; + m_decoderDiagOverrunLogged=false; + m_decoderDiagHardHangLogged=false; + m_decoderDiagAbnormalClear=false; +} + +void MainWindow::markDecoderProgress() +{ + if(m_decoderDiagActive) m_decoderDiagProgressTimer.restart(); +} + +void MainWindow::logDecoderBusyRequest(QString const& reason) +{ + if(!m_decoderDiagActive || m_decoderDiagBusyRequestLogged) return; + + qWarning() << "Decoder busy; decode request skipped" + << "reason:" << reason + << "seq:" << m_decoderDiagActiveSequence + << "mode:" << m_decoderDiagStartMode + << "elapsedMs:" << decoderDiagnosticElapsedMs() + << "currentMode:" << m_mode + << "currentIhsym:" << m_ihsym + << "startIhsym:" << m_decoderDiagStartIhsym + << "hsymStop:" << m_decoderDiagStartHsymStop + << "nzhsym:" << m_decoderDiagStartNzhsym; + m_decoderDiagBusyRequestLogged=true; +} + +void MainWindow::logDecoderProgress() +{ + if(DecodeOwner::Jt9 != m_decodeOwner || !m_decoderDiagActive) return; + + if (DecoderIpc::hasUsableSize (mem_jt9->size ()) && mem_jt9->data ()) + { + auto const * shared = reinterpret_cast ( + mem_jt9->constData ()); + if (DECODER_IPC_VERSION == DecoderIpc::protocolVersion (*shared) + && m_activeJt9Decode.generation == DecoderIpc::generation (*shared)) + { + auto const progress = DecoderIpc::progress (*shared); + if (progress != m_decoderDiagProgressCount) + { + m_decoderDiagProgressCount = progress; + markDecoderProgress (); + } + } + } + + auto const elapsedMs = decoderDiagnosticElapsedMs(); + if(elapsedMs < 0) return; + + auto const overrunMs = static_cast(1.25 * m_decoderDiagStartTRperiod * 1000.0); + if(!m_decoderDiagOverrunLogged && overrunMs > 0 && elapsedMs >= overrunMs) { + qWarning() << "Decoder overrun" + << "seq:" << m_decoderDiagActiveSequence + << "mode:" << m_decoderDiagStartMode + << "elapsedMs:" << elapsedMs + << "thresholdMs:" << overrunMs + << "TRperiod:" << m_decoderDiagStartTRperiod + << "currentIhsym:" << m_ihsym + << "startIhsym:" << m_decoderDiagStartIhsym + << "hsymStop:" << m_decoderDiagStartHsymStop + << "nzhsym:" << m_decoderDiagStartNzhsym; + m_decoderDiagOverrunLogged=true; + } + + auto const hardHangMs = decoderRequestDeadlineMs (); + auto const idleMs = decoderDiagnosticIdleMs (); + if(!m_decoderDiagHardHangLogged && idleMs >= hardHangMs) { + qWarning() << "Decoder hard-hang candidate" + << "seq:" << m_decoderDiagActiveSequence + << "mode:" << m_decoderDiagStartMode + << "elapsedMs:" << elapsedMs + << "idleMs:" << idleMs + << "thresholdMs:" << hardHangMs + << "TRperiod:" << m_decoderDiagStartTRperiod + << "currentMode:" << m_mode + << "currentIhsym:" << m_ihsym + << "startIhsym:" << m_decoderDiagStartIhsym + << "hsymStop:" << m_decoderDiagStartHsymStop + << "nzhsym:" << m_decoderDiagStartNzhsym; + if (proc_jt9.canReadLine ()) + { + readFromStdout (); + if (DecodeOwner::Jt9 != m_decodeOwner || !m_decoderDiagActive) return; + if (!decoderRequestDeadlineExpired ()) return; + } + m_decoderDiagHardHangLogged=true; + requestDecoderRestart ("decoder hard timeout"); + } +} + +void MainWindow::logDecoderAbnormalClear(QString const& reason) +{ + if(!m_decoderDiagActive) return; + + qWarning() << "Clearing decoder busy status" + << "reason:" << reason + << "seq:" << m_decoderDiagActiveSequence + << "mode:" << m_decoderDiagStartMode + << "elapsedMs:" << decoderDiagnosticElapsedMs() + << "overrunLogged:" << m_decoderDiagOverrunLogged + << "hardHangLogged:" << m_decoderDiagHardHangLogged + << "currentMode:" << m_mode + << "currentIhsym:" << m_ihsym + << "startIhsym:" << m_decoderDiagStartIhsym + << "hsymStop:" << m_decoderDiagStartHsymStop + << "nzhsym:" << m_decoderDiagStartNzhsym; + m_decoderDiagAbnormalClear=true; +} + +void MainWindow::finishDecoderDiagnostic() +{ + if(!m_decoderDiagActive) return; + + auto const now = QDateTime::currentDateTimeUtc(); + auto const elapsedMs = decoderDiagnosticElapsedMs(); + auto const lastSample = m_decoderDiagLastSampleUtc.value(m_decoderDiagStartMode); + auto const delayed = m_decoderDiagBusyRequestLogged || m_decoderDiagOverrunLogged || m_decoderDiagHardHangLogged; + if(!m_decoderDiagAbnormalClear && delayed) { + qWarning() << "Delayed decoder completed" + << "seq:" << m_decoderDiagActiveSequence + << "mode:" << m_decoderDiagStartMode + << "elapsedMs:" << elapsedMs + << "decodes:" << m_nDecodes + << "decoded:" << m_bDecoded + << "busyRequestLogged:" << m_decoderDiagBusyRequestLogged + << "overrunLogged:" << m_decoderDiagOverrunLogged + << "hardHangLogged:" << m_decoderDiagHardHangLogged + << "TRperiod:" << m_decoderDiagStartTRperiod + << "currentMode:" << m_mode + << "currentIhsym:" << m_ihsym + << "startIhsym:" << m_decoderDiagStartIhsym + << "hsymStop:" << m_decoderDiagStartHsymStop + << "nzhsym:" << m_decoderDiagStartNzhsym; + } else if(!m_decoderDiagAbnormalClear && + (!lastSample.isValid() || lastSample.msecsTo(now) >= 5 * 60 * 1000)) { + qInfo() << "Decoder completion sample" + << "seq:" << m_decoderDiagActiveSequence + << "mode:" << m_decoderDiagStartMode + << "elapsedMs:" << elapsedMs + << "decodes:" << m_nDecodes + << "decoded:" << m_bDecoded + << "TRperiod:" << m_decoderDiagStartTRperiod + << "currentMode:" << m_mode + << "currentIhsym:" << m_ihsym + << "startIhsym:" << m_decoderDiagStartIhsym + << "hsymStop:" << m_decoderDiagStartHsymStop + << "nzhsym:" << m_decoderDiagStartNzhsym + << "newdat:" << m_decoderDiagStartNewdat + << "nagain:" << m_decoderDiagStartNagain + << "ndiskdat:" << m_decoderDiagStartNdiskdat; + m_decoderDiagLastSampleUtc[m_decoderDiagStartMode]=now; + } + + m_decoderDiagActive=false; + m_decoderDiagBusyRequestLogged=false; + m_decoderDiagOverrunLogged=false; + m_decoderDiagHardHangLogged=false; + m_decoderDiagAbnormalClear=false; +} + +void MainWindow::clearHungDecoderStatus(QString const& reason) +{ + if(DecodeOwner::Jt9 != m_decodeOwner) return; + recoverDecoderAtBoundary (reason, true); +} + +void MainWindow::recoverDecoderAtBoundary (QString const& reason, bool manual) +{ + if (DecodeOwner::Jt9 != m_decodeOwner) return; + if (!manual && !decoderRequestDeadlineExpired ()) + { + logDecoderBusyRequest (reason); + return; + } + if (proc_jt9.canReadLine ()) + { + readFromStdout (); + if (DecodeOwner::Jt9 != m_decodeOwner) return; + } + requestDecoderRestart (reason); +} + +void MainWindow::finishDecodeUi () +{ + if(m_mode=="Q65") m_wideGraph->drawRed(0,0); + if ("FST4W" == m_mode) + { + if (m_uploadWSPRSpots + && m_config.is_transceiver_online ()) { // need working rig control +#if QT_VERSION >= QT_VERSION_CHECK (5, 15, 0) + uploadTimer.start(QRandomGenerator::global ()->bounded (0, 20000)); // Upload delay +#else uploadTimer.start(20000 * qrand()/((double)RAND_MAX + 1.0)); // Upload delay #endif } @@ -5737,14 +6361,11 @@ void MainWindow::decodeDone () dec_data.params.ndiskdat=0; m_nclearave=0; ui->DecodeButton->setChecked (false); - decodeBusy(false); m_RxLog=0; if(SpecOp::FOX == m_specOp) { houndCallers(); - if(ui->cbWorkDupes->isChecked()) QTimer::singleShot (5000, [=] {band_activity_cleared();}); + if(ui->cbWorkDupes->isChecked()) QTimer::singleShot (5000, this, [=] {band_activity_cleared();}); } - to_jt9(m_ihsym,-1,1); //Tell jt9 we know it has finished - m_startAnother=m_loopall; if(m_bNoMoreFiles) { MessageBox::information_message(this, tr("No more files to open.")); @@ -5775,27 +6396,35 @@ void MainWindow::refreshPileupList() // Update the ActiveStations display for Q65 pileup situation... int nlist=0; char list[2000]; - char line[36]; + char line[37]; list[0]=0; auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("tsil.3q"))}; get_q3list_(const_cast (fname.toLatin1().constData()), &m_diskData, &nlist, &list[0], (FCL)fname.length(), (FCL)2000); QString t=""; QString t0=""; - for(int i=0; isetClickOK(false); - m_ActiveStationsWidget->displayRecentStations("Q65-pileup",t); + m_ActiveStationsWidget->displayRecentStations(ActiveStations::DisplayMode::Q65Pileup,t); m_ActiveStationsWidget->setClickOK(true); } void MainWindow::read_log() { - static QFile f {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath ("wsjtx.log")}; + QFile f {writable_file_path (m_config.writeable_data_dir (), "wsjtx.log")}; f.open(QIODevice::ReadOnly); if(f.isOpen()) { QTextStream in(&f); @@ -5817,161 +6446,6 @@ void MainWindow::read_log() } } -void MainWindow::ARRL_Digi_Update(DecodedText dt) -{ - if(m_mode=="Q65") { - m_fetched=0; - readWidebandDecodes(); - return; - } - - // Extract information relevant for the ARRL Digi contest - QString deCall; - QString deGrid; - dt.deCallAndGrid(/*out*/deCall,deGrid); - ActiveCall ac; - RecentCall rc; - - if(deGrid.contains(grid_regexp)) { - if(!m_activeCall.contains(deCall) or deGrid!=m_activeCall.value(deCall).grid4) { - // Transmitting station's call is not already in QMap "m_activeCall", or grid has changed. - // Insert the call, grid, and associated fixed data into the list. - - double utch=0.0; - int nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter; - QString my_Grid = m_config.my_grid(); - if (my_Grid.length() < 5) my_Grid = m_config.my_grid().left(4)+"mm"; - QString de_Grid= deGrid.left(4)+"mm"; - azdist_(const_cast (my_Grid.toLatin1().constData()), - const_cast (de_Grid.toLatin1().constData()),&utch, - &nAz,&nEl,&nDmiles,&nDkm,&nHotAz,&nHotABetter,(FCL)6,(FCL)6); - int points=nDkm/500; - if(nDkm > 500*points) points += 1; - points += 1; - ac.grid4=deGrid; - ac.bands="......."; - ac.az=nAz; - ac.points=points; - m_activeCall[deCall]=ac; - } - } - - m_points=-1; - if(m_activeCall.contains(deCall)) { - -// Don't display stations we already worked on this band. - QString band=m_config.bands()->find(m_freqNominal); - if(band=="160m" and m_activeCall[deCall].bands.indexOf("a")>=0) {m_recentCall.remove(deCall); return;} - if(band=="80m" and m_activeCall[deCall].bands.indexOf("b")>=0) {m_recentCall.remove(deCall); return;} - if(band=="40m" and m_activeCall[deCall].bands.indexOf("c")>=0) {m_recentCall.remove(deCall); return;} - if(band=="20m" and m_activeCall[deCall].bands.indexOf("d")>=0) {m_recentCall.remove(deCall); return;} - if(band=="15m" and m_activeCall[deCall].bands.indexOf("e")>=0) {m_recentCall.remove(deCall); return;} - if(band=="10m" and m_activeCall[deCall].bands.indexOf("f")>=0) {m_recentCall.remove(deCall); return;} - if(band=="6m" and m_activeCall[deCall].bands.indexOf("g")>=0) {m_recentCall.remove(deCall); return;} - - // Update the variable data for this deCall - rc.dialFreq=m_freqNominal; - rc.audioFreq=dt.frequencyOffset(); - rc.snr=dt.snr(); - m_latestDecodeTime=dt.timeInSeconds(); - rc.txEven = (m_latestDecodeTime % int(2*m_TRperiod)) > 0; - rc.ready2call=false; - bool bCQ=dt.messageWords()[0].left(3)=="CQ "; - if(bCQ or deGrid=="RR73" or deGrid=="73") rc.ready2call=true; - rc.decodeTime=m_latestDecodeTime; - m_recentCall[deCall]=rc; - m_points=m_activeCall.value(deCall).points; - } - updateRate(); -} - -void MainWindow::ARRL_Digi_Display() -{ - if(m_mode=="Q65") { - m_fetched=0; - readWidebandDecodes(); - return; - } - if (m_mode == "Fox Mode") { // ARRL_Digi_Display can be shown for other modes - if (m_ActiveStationsWidget != NULL) { - m_ActiveStationsWidget->setClickOK(true); - } - return; - } - QMutableMapIterator icall(m_recentCall); - QString deCall,deGrid; - int age=0; - int i=0; - int maxAge=m_ActiveStationsWidget->maxAge(); - int points=0; - int maxPoints=0; - int indx[1000]; - float pts[1000]; - QStringList list; - - while (icall.hasNext()) { - icall.next(); - deCall=icall.key(); - age=int((m_latestDecodeTime - icall.value().decodeTime)/m_TRperiod + 0.5); - if(age<0) age=age + int(86400/m_TRperiod); - int itx=1; - if(icall.value().txEven) itx=0; - int snr=icall.value().snr; - int freq=icall.value().audioFreq; - if(age>maxAge) { - icall.remove(); - } else { - bool bReady=false; - if(age==0 and m_recentCall.value(deCall).ready2call) bReady=true; - - QString bands=m_activeCall[deCall].bands; - bool bWorkedOnBand=false; - if(m_currentBand=="160m" and bands.mid(0,1)!=".") bWorkedOnBand=true; - if(m_currentBand=="80m" and bands.mid(1,1)!=".") bWorkedOnBand=true; - if(m_currentBand=="40m" and bands.mid(2,1)!=".") bWorkedOnBand=true; - if(m_currentBand=="20m" and bands.mid(3,1)!=".") bWorkedOnBand=true; - if(m_currentBand=="15m" and bands.mid(4,1)!=".") bWorkedOnBand=true; - if(m_currentBand=="10m" and bands.mid(5,1)!=".") bWorkedOnBand=true; - if(m_currentBand=="6m" and bands.mid(6,1)!=".") bWorkedOnBand=true; - - if((bReady or !m_ActiveStationsWidget->readyOnly()) and !bWorkedOnBand) { - i++; - int az=m_activeCall[deCall].az; - deGrid=m_activeCall[deCall].grid4; - points=m_activeCall[deCall].points; - if(points>maxPoints) maxPoints=points; - float x=float(age)/(maxAge+1); - if(x>1.0) x=0; - pts[i-1]=points - x; - QString t1; - if(!bReady) t1 = t1.asprintf(" %3d %+2.2d %4d %1d %2d %4d",az,snr,freq,itx,age,points); - if(bReady) t1 = t1.asprintf(" %3d %+2.2d %4d %1d %2d*%4d",az,snr,freq,itx,age,points); -// t1 = (deCall + " ").left(6) + " " + m_activeCall[deCall].grid4 + t1 + " " + bands; - t1 = (deCall + " ").left(6) + " " + m_activeCall[deCall].grid4 + t1; - list.append(t1); - } - } - } - if(i==0) return; - int jz=i; - m_ActiveStationsWidget->setClickOK(false); - int maxRecent=qMin(i,m_ActiveStationsWidget->maxRecent()); - indexx_(pts,&jz,indx); - QString t; - i=0; - for(int j=jz-1; j>=0; j--) { - int k=indx[j]-1; - m_ready2call[i]=list[k]; - i++; - QString t1=QString::number(i) + ". "; - if(i<10) t1=" " + t1; - t += (t1 + list[k] + "\n"); - if(i>=maxRecent) break; - } - bool is_fox_mode = (m_mode=="FT8" && m_specOp == SpecOp::FOX); - if(m_ActiveStationsWidget!=NULL && !is_fox_mode) m_ActiveStationsWidget->displayRecentStations(m_mode,t); - m_ActiveStationsWidget->setClickOK(true); -} void MainWindow::queueActiveWindowHound2(QString line) { // Active Window shows what's going on outside of current F/H display rules (calling below 1000Hz e.g.) @@ -5982,15 +6456,15 @@ void MainWindow::queueActiveWindowHound2(QString line) { // make sure our call is the first in the list, or the station is CQing (not a directed CQ) if ( (w.size() > 7) && (w[5] == m_config.my_callsign() || w[5] == "<"+m_config.my_callsign()+">" || w[5]=="CQ") && - ( w[7].contains(grid_regexp) || w[7].contains(non_r_db_regexp) )){ + ( w[7].contains(MainWindow::grid_regexp) || w[7].contains(MainWindow::non_r_db_regexp) )){ QString caller = w[6]; QString grid = ""; QString db = w[1]; int db_i = w[1].toInt(); db = (db_i >=0 ? "+":"") + QStringLiteral("%1").arg(db_i, (db_i >=0 ? 2:3), 10, QLatin1Char('0')); // +00, -01 etc. // houndcall rpt grid - if (w[7].contains(grid_regexp)) grid = w[7]; - if (w[7].contains(non_r_db_regexp)) { + if (w[7].contains(MainWindow::grid_regexp)) grid = w[7]; + if (w[7].contains(MainWindow::non_r_db_regexp)) { LOG_INFO(QString("ActiveStations Window click: %1 called with signal report %2").arg(caller).arg(w[7])); } if (caller.length() > 2) { @@ -6027,11 +6501,13 @@ void MainWindow::callSandP2(int n) m_specOp=m_config.special_op_id(); bool bCtrl = (n<0); n=qAbs(n)-1; + if(n<0 || n>=int(m_ready2call.size())) return; if(m_mode!="Q65" and m_ready2call[n]=="") return; QStringList w=m_ready2call[n].split(' ', SkipEmptyParts); - if(m_mode=="Q65" and m_specOp==SpecOp::Q65_PILEUP and n < 40) { + if(m_mode=="Q65" and m_specOp==SpecOp::Q65_PILEUP and n < MaxQ65PileupCallers) { // This code is for 6m EME DXpedition operator w=m_callers[n].split(' ', SkipEmptyParts); + if(w.size() < 4) return; m_deCall=w[2]; if(bCtrl) { // Remove this call from q3list. @@ -6040,10 +6516,9 @@ void MainWindow::callSandP2(int n) return; } m_deGrid=w[3]; - m_bDoubleClicked=true; //### needed? + m_bDoubleClicked=true; m_txFirst=true; - ui->dxCallEntry->setText(m_deCall); - ui->dxGridEntry->setText(m_deGrid); + setDXInfo(m_deCall, m_deGrid); ui->txFirstCheckBox->setChecked(m_txFirst); genStdMsgs("-22"); setTxMsg(3); @@ -6052,46 +6527,39 @@ void MainWindow::callSandP2(int n) return; } + bool frequency_changed = false; if(m_mode=="Q65") { - if(!bCtrl) { //Do not reset m_freqNominal if CTRL was down + if(w.size() < 7) return; + if(!bCtrl) { //Do not reset m_operatingFrequency.rx () if CTRL was down double kHz=w[1].toDouble(); - int nMHz=m_freqNominal/1000000; - m_freqNominal=(nMHz*1000 + kHz)* 1000; + int nMHz=m_operatingFrequency.rx ()/1000000; + frequency_changed = requestNominalFrequencyChange ( + (nMHz*1000 + kHz)* 1000, FrequencyRequestOrigin::User); } - m_deCall=w[4]; - m_deGrid=w[5]; - m_txFirst=(w[6]=="0"); -// ui->TxFreqSpinBox->setValue(1500); + applyQ65StationSelection ({w[4], w[5], w[3], w[2], w[6]=="0"}); } else { + if(w.size() < 6) return; m_deCall=w[0]; m_deGrid=w[1]; ui->RxFreqSpinBox->setValue(w[4].toInt()); m_txFirst = (w[5]=="0"); - } - - if(w[3].left(2)=="30") { - ui->sbTR->setValue(30); - } else { - ui->sbTR->setValue(60); - } - if(w[3].right(1)=="A") ui->sbSubmode->setValue(0); - if(w[3].right(1)=="B") ui->sbSubmode->setValue(1); - if(w[3].right(1)=="C") ui->sbSubmode->setValue(2); - if(w[3].right(1)=="D") ui->sbSubmode->setValue(3); - if(w[3].right(1)=="E") ui->sbSubmode->setValue(4); - if(w[3].right(1)=="F") ui->sbSubmode->setValue(5); - - m_bDoubleClicked=true; //### needed? - ui->dxCallEntry->setText(m_deCall); - ui->dxGridEntry->setText(m_deGrid); - if(m_mode=="Q65") { - ui->rptSpinBox->setValue(w[2].toInt()); - genStdMsgs(w[2]); - } else { + if(w[3].left(2)=="30") { + ui->sbTR->setValue(30); + } else { + ui->sbTR->setValue(60); + } + if(w[3].right(1)=="A") ui->sbSubmode->setValue(0); + if(w[3].right(1)=="B") ui->sbSubmode->setValue(1); + if(w[3].right(1)=="C") ui->sbSubmode->setValue(2); + if(w[3].right(1)=="D") ui->sbSubmode->setValue(3); + if(w[3].right(1)=="E") ui->sbSubmode->setValue(4); + if(w[3].right(1)=="F") ui->sbSubmode->setValue(5); + m_bDoubleClicked=true; + setDXInfo(m_deCall, m_deGrid); genStdMsgs(w[3]); + setTxMsg(1); + ui->txFirstCheckBox->setChecked(m_txFirst); } - setTxMsg(1); - ui->txFirstCheckBox->setChecked(m_txFirst); static qint64 ms0=0; qint64 ms=QDateTime::currentMSecsSinceEpoch(); if(SpecOp::NONE==m_specOp) { @@ -6101,8 +6569,10 @@ void MainWindow::callSandP2(int n) ui->autoButton->click(); // Enable Tx again, on double click } if(m_mode=="Q65" && m_ActiveStationsWidget!=NULL) { - setRig (m_freqNominal); - setXIT (ui->TxFreqSpinBox->value ()); + if (frequency_changed || (bCtrl && reapplyCurrentRigFrequencyCorrection ())) + { + setXIT (ui->TxFreqSpinBox->value ()); + } } } else { if(ui->autoButton->isChecked()) { @@ -6115,10 +6585,64 @@ void MainWindow::callSandP2(int n) if(m_transmitting) m_restart=true; } +void MainWindow::applyQ65StationSelection (Q65StationSelection const& selection) +{ + m_deCall=selection.call; + m_deGrid=selection.grid; + m_txFirst=selection.txFirst; + ui->sbTR->setValue (selection.submode.startsWith ("30") ? 30 : 60); + auto const submode = QString {"ABCDEF"}.indexOf (selection.submode.right (1)); + if (submode >= 0) ui->sbSubmode->setValue (submode); + + m_bDoubleClicked=true; + setDXInfo(m_deCall, m_deGrid); + ui->rptSpinBox->setValue(selection.report.toInt()); + genStdMsgs(selection.report); + setTxMsg(1); + ui->txFirstCheckBox->setChecked(m_txFirst); +} + +void MainWindow::qmapCallSandP(QMapDecodeRecord const& record, bool doubleClick) +{ + if (m_mode!="Q65" || SpecOp::NONE!=m_specOp + || !LiveCQ::isValidCallsign (record.callsign)) return; + + auto const clickPolicy = qmapClickPolicy ( + doubleClick, false, ui->autoButton->isChecked (), m_transmitting); + if (clickPolicy.disarmBeforeQsy) { + ui->autoButton->click(); + } + + int nMHz=m_operatingFrequency.rx ()/1000000; + Frequency const frequency = (nMHz*1000 + record.scheduledFrequencyKHz)*1000; + bool const frequency_changed = requestNominalFrequencyChange ( + frequency, FrequencyRequestOrigin::User); + auto const completedClickPolicy = qmapClickPolicy ( + doubleClick, frequency_changed, ui->autoButton->isChecked (), m_transmitting); + QString submode=record.submode; + int odd=0; + if(submode.left(2)=="30" and (record.secondsSinceMidnight%60)==0) odd=1; + if(submode.left(2)=="60" and (record.secondsSinceMidnight%120)==0) odd=1; + auto grid = record.grid; + if(grid.isEmpty ()) grid = m_EMECall.value (record.callsign).grid4; + applyQ65StationSelection ({record.callsign, grid, submode, + QString::number (record.snr), odd==0}); + + if (frequency_changed) setXIT(ui->TxFreqSpinBox->value()); + + if(completedClickPolicy.enableAutoTx) { + if(!ui->autoButton->isChecked()) ui->autoButton->click(); + } else if(completedClickPolicy.disableAutoTx && ui->autoButton->isChecked()) { + // Never carry an active transmission over to a newly selected station. + ui->autoButton->click(); + } + if(completedClickPolicy.restartTransmission) m_restart=true; +} + void MainWindow::activeWorked(QString call, QString band) { - QString bands=m_activeCall[call].bands; - QByteArray ba=bands.toLatin1(); + auto& activeCall = m_activeCall[call]; + QByteArray ba=activeCall.bands.toLatin1().leftJustified(7, '.'); if(band=="160m") ba[0]='a'; if(band=="80m") ba[1]='b'; if(band=="40m") ba[2]='c'; @@ -6126,212 +6650,235 @@ void MainWindow::activeWorked(QString call, QString band) if(band=="15m") ba[4]='e'; if(band=="10m") ba[5]='f'; if(band=="6m") ba[6]='g'; - m_activeCall[call].bands=QString::fromLatin1(ba); + activeCall.bands=QString::fromLatin1(ba); } -void MainWindow::readFromStdout() //readFromStdout +bool MainWindow::handleDecoderOutputEvent (DecoderOutputFramer::Event const& event, + bool& decodeCompleted) { - bool bDisplayPoints = false; - filtered = false; - ignored = false; - m_muted = false; - QString all_decodes; - if(m_ActiveStationsWidget!=NULL) { - bDisplayPoints=(m_mode=="FT4" or m_mode=="FT8") and - (m_specOp==SpecOp::ARRL_DIGI or m_ActiveStationsWidget->isVisible()); - } - while(proc_jt9.canReadLine()) { - auto line_read = proc_jt9.readLine (); - - QString the_line = QString(line_read); - if(ui->actionEnable_QSY_Popups->isChecked() || m_qsymonitorWidget) showQSYMessage(the_line); - - if (m_mode == "FT8" and m_specOp == SpecOp::FOX and m_ActiveStationsWidget != NULL) { // see if we should add this to ActiveStations window - if (!m_ActiveStationsWidget->wantedOnly() || - (the_line.contains(" " + m_config.my_callsign() + " ") || - the_line.contains(" <" + m_config.my_callsign() + "> "))) - all_decodes.append(line_read); - } - if (auto p = std::strpbrk (line_read.constData (), "\n\r")) { - // truncate before line ending chars - line_read = line_read.left (p - line_read.constData ()); + if (DecoderOutputFramer::EventType::Record == event.type) + { + if (DecodeOwner::Jt9 != m_decodeOwner + || !m_activeJt9Decode.generation + || event.generation != m_activeJt9Decode.generation) + { + return true; + } + markDecoderProgress (); + if (!m_activeJt9Decode.obsolete + && !activeDecodeOperatingContextMatchesCurrent ()) + { + m_activeJt9Decode.obsolete = true; + qInfo () << "Discarding obsolete decoder output" + << "generation:" << event.generation; + } + return m_activeJt9Decode.obsolete; } - if(bDisplayPoints) line_read=line_read.replace("a7"," "); - bool haveFSpread {false}; - bool blockUDP {false}; // allow udp spotting (JTAlert) for all non-filtered messages - bool block_right_display {false}; - float fSpread {0.}; - if (m_mode.startsWith ("FST4")) - { - auto text = line_read.mid (64, 6).trimmed (); - if (text.size ()) - { - fSpread = text.toFloat (&haveFSpread); - line_read = line_read.left (64); - } - auto const& cs = m_config.my_callsign ().toLocal8Bit (); - if ("FST4W" == m_mode && ui->cbNoOwnCall->isChecked () - && (line_read.contains (" " + cs + " ") - || line_read.contains ("<" + cs + ">"))) { - continue; - } - } - QString message0 {QString::fromUtf8(line_read.constData())}; - DecodedText decodedtext0 {QString::fromUtf8(line_read.constData())}; - DecodedText decodedtext {QString::fromUtf8(line_read.constData()).remove("TU; ")}; - - // Don't allow a7 decodes during the first period and for non-contest messages when in any contest mode - if ((!((no_a7_decodes && line_read.contains("a7") && !m_diskData) or (line_read.contains("a7") && SpecOp::NONE!=m_specOp - && !m_diskData && !(line_read.contains(" R ") or line_read.contains("RR73") or line_read.contains("CQ "))))) - - // Filtering out some false decodes, and don't write all.txt for such - // FDR step 1 - and (!((SpecOp::NONE==m_specOp or (m_multithreadFT8 && m_ft8DecoderStart<2)) && - ((m_mode=="FT8" && ((m_multithreadFT8 && m_ft8DecoderStart<2) or m_freqNominal>45000000) && earlyDecodes.contains(line_read.mid(23,19))) // MTD or a7/a8 dupes - or ((SpecOp::NONE==m_specOp && decodedtext.snr() < -12) && (message0.contains("> <") // two hashes - || message0.contains(QRegularExpression {"(\\w+)/P (\\w+)/P "}) // two /P calls - || message0.contains(QRegularExpression {"(\\w+)/R (\\w+)/R "}) // two /R calls - || (message0.contains("/R ") && message0.contains("?")) // insecure /R decodes - || (message0.contains(";") && message0.contains(" R "))))))) // invalid combination - // FDR step 2 - and (!(SpecOp::NONE==m_specOp && ui->actionReduce_false_decodes->isChecked() && m_mode=="FT8" && - ((((message0.contains("/P ") && message0.contains(" R ")) // /P and R - || (message0.contains(";") && message0.contains("/R ")) // ; and /R - || (message0.contains(";") && message0.contains("/P ")) // ; and /P - || (message0.contains("<...>") && message0.contains(" R ")) // hash and R - || (message0.contains("<...>") && message0.contains("/P ")) // hash and /P - || (message0.contains("<...>") && message0.contains(";")) // hash and ; - || message0.contains(QRegularExpression {"\\w\\w\\w\\w\\w\\w\\w\\w"}) // likely invalid callsigns - || message0.contains(QRegularExpression {"\\d\\d\\d \\d\\d\\d"}) // contest messages - || message0.contains("3.") || message0.contains("2.")) // -1.9 < dt < 1.9 - && (decodedtext.snr() < -15)) // for such SNRmin = -15 - or ((message0.contains("/R ") or message0.contains(" R ")) && decodedtext.snr() < -18) // for /R or contest calls SNRmin = -18 - or (((message0.contains("<...>") || message0.contains(";") // unresolved hash and F/H messages - || message0.contains("? a") // ap decodes of low confidence - || message0.contains("/R ") || message0.contains(" R ") // rover and contest callsigns - || decodedtext.snr() < -20) // SNR < -20 - && (message0.contains("3.") || message0.contains("2."))))))) // for such -1.9 < dt < 1.9 - ) + if (DecoderOutputFramer::EventType::Malformed == event.type) { - if (m_mode!="FT8" and m_mode!="FT4" and !m_mode.startsWith ("FST4") and m_mode!="Q65") { - //Pad 22-char msg to at least 37 chars - line_read = line_read.left(44) + " " + line_read.mid(44); - } - bool bAvgMsg=false; - int navg=0; - - if(line_read.indexOf("") >= 0) { - m_bDecoded = line_read.mid(20).trimmed().toInt() > 0; - int n=line_read.trimmed().size(); - int n2=line_read.trimmed().mid(n-7).toInt(); - int n0=n2/1000; - int n1=n2%1000; - if(m_mode=="Q65") { - ndecodes_label.setText(QString {"%1 %2"}.arg (n0).arg (n1)); - } else { - if(m_nDecodes==0 && !(m_multithreadFT8 && m_diskData)) ndecodes_label.setText("0"); - } - decodeDone (); - return; - } else { - m_nDecodes+=1; - if(m_mode!="Q65") ndecodes_label.setText(QString::number(m_nDecodes)); - if(m_mode=="JT4" or m_mode=="JT65" or m_mode=="Q65") { - //### Do something about Q65 here ? ### - int nf=line_read.indexOf("f"); - if(nf>0) { - navg=line_read.mid(nf+1,1).toInt(); - if(line_read.indexOf("f*")>0) navg=10; + qWarning () << "Ignoring malformed or unframed decoder output:" + << event.rawLine.trimmed (); + if (event.rawLine.startsWith ("") + || event.rawLine.startsWith ("")) + { + if (Jt9ProcessPhase::Ready == m_jt9ProcessPhase + && DecodeOwner::Jt9 == m_decodeOwner) + { + requestDecoderRestart ("malformed decoder output frame"); + } } - int nd=-1; - if(nf<0) nd=line_read.indexOf("d"); - if(nd>0) { - navg=line_read.mid(nd+2,1).toInt(); - if(line_read.mid(nd+2,1)=="*") navg=10; + else + { + markDecoderProgress (); } - int na=-1; - if(nf<0 and nd<0) na=line_read.indexOf("a"); - if(na>0) { - navg=line_read.mid(na+2,1).toInt(); - if(line_read.mid(na+2,1)=="*") navg=10; + return true; + } + + if (DecoderOutputFramer::EventType::Started == event.type) + { + auto const authoritative = Jt9ProcessPhase::Ready == m_jt9ProcessPhase + && DecodeOwner::Jt9 == m_decodeOwner + && m_activeJt9Decode.generation + && event.generation == m_activeJt9Decode.generation; + if (!authoritative) + { + qWarning () << "Quarantining stale decoder output" + << "generation:" << event.generation + << "activeGeneration:" << m_activeJt9Decode.generation; + if (Jt9ProcessPhase::Ready == m_jt9ProcessPhase + && DecodeOwner::Jt9 == m_decodeOwner) + { + requestDecoderRestart ("decoder output generation mismatch"); + } } - int nq=-1; - if(nf<0 and nd<0 and na<0) nq=line_read.indexOf("q"); - if(nq>0) { - navg=line_read.mid(nq+2,1).toInt(); - if(line_read.mid(nq+2,1)=="*") navg=10; + else + { + markDecoderProgress (); } - if(navg>=2) bAvgMsg=true; - } - write_all("Rx", line_read.trimmed()); - } // Filtering out some false decodes, and don't write all.txt for such + return true; + } + + auto const completion = event.completion; + auto const authoritative = DecodeOwner::Jt9 == m_decodeOwner + && m_activeJt9Decode.generation + && event.generation == m_activeJt9Decode.generation; + if (!authoritative) + { + qWarning () << "Ignoring stale decoder completion" + << "generation:" << completion.generation; + return true; + } - if ("FST4W" == m_mode) + if (!m_activeJt9Decode.obsolete + && !activeDecodeOperatingContextMatchesCurrent ()) + { + m_activeJt9Decode.obsolete = true; + qInfo () << "Discarding obsolete decoder completion" + << "generation:" << event.generation; + } + + bool consumed {false}; + int state {-1}; + if (DecoderIpc::hasUsableSize (mem_jt9->size ()) + && mem_jt9->data ()) + { + auto * shared = reinterpret_cast (mem_jt9->data ()); + if (DECODER_IPC_VERSION == DecoderIpc::protocolVersion (*shared) + && completion.generation == DecoderIpc::generation (*shared)) { - uploadWSPRSpots (true, line_read); + state = DecoderIpc::state (*shared); + consumed = DecoderIpc::consume (*shared, completion.generation); } + } + if (!consumed) + { + qWarning () << "Unable to consume matching decoder completion" + << "generation:" << completion.generation + << "state:" << state; + requestDecoderRestart ("matching decoder completion could not be consumed"); + return true; + } - // Check validity of callsigns if "Reduce false decodes" is checked // EXPERIMENTAL FOR NOW - if (m_mode=="FT8" && !m_multithreadFT8 && ui->actionReduce_false_decodes->isChecked() && decodedtext.snr() < -20) { - bool notInALLCALL7 = false; - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(/*out*/deCall,deGrid); - QStringList word; - word=decodedtext.string().mid(24).replace("<","").replace(">","").replace("/P","").replace("/R","").replace("/QRP","").replace("/5W","").split(" ",SkipEmptyParts); - - // check file ALLCALL7.TXT - if (deCall!="TNX" && deCall!="73" && deCall!="GL" && deCall!="HNY" && deCall!="TU" && !deCall.left(4).contains("/") - && !decodedtext.string().contains("<...>") && !ALLCALL7.contains(deCall)) { - notInALLCALL7 = true; -// ui->decodedTextBrowser->insertText("deCall not in ALLCALL7.TXT"); - } - if (!ALLCALL7.contains(word[0]) && !(decodedtext.string().contains(" CQ ") or decodedtext.string().contains("TNX") - or decodedtext.string().contains("...") or decodedtext.string().contains("HNY") or decodedtext.string().contains("QSY") - or decodedtext.string().contains("73 ") or decodedtext.string().contains("GL ") or decodedtext.string().contains("PSE") - or decodedtext.string().contains("/") or decodedtext.string().contains("<...>"))) { - notInALLCALL7 = true; -// ui->decodedTextBrowser->insertText("word0 not in ALLCALL7.TXT"); - } + if (!m_activeJt9Decode.obsolete) + { + m_bDecoded = completion.decoded > 0; + auto const& context = m_activeJt9Decode.context; + if(context.mode=="Q65") { + auto const n0 = completion.average / 1000; + auto const n1 = completion.average % 1000; + ndecodes_label.setText(QString {"%1 %2"}.arg (n0).arg (n1)); + } else if(m_nDecodes==0 && !(context.multithreadFt8 && context.diskData)) { + ndecodes_label.setText("0"); + } + } + m_activeJt9Decode.generation = 0; + decodeCompleted = true; + return true; +} - // check syntax of the two callsigns before we hide such messages - if (notInALLCALL7) { - deCall=deCall.replace("<","").replace(">","").replace("/P","").replace("/R","").replace("/QRP","").replace("/5W",""); - if (deCall!="TNX" && deCall!="73" && deCall!="GL" && deCall!="HNY" && - !(deCall.left(3).contains(QRegularExpression {"\\w\\d\\w"}) or - deCall.left(3).contains(QRegularExpression {"\\d\\w\\d"}) or - deCall.left(3).contains(QRegularExpression {"\\w\\w\\d"}) or - deCall.left(4).contains("/") or decodedtext.string().contains("<...>"))) { -// ui->decodedTextBrowser->insertText("deCall has false syntax"); - filtered = true; - } - if (word[0]!="CQ" && word[0]!="TNX" && word[0]!="73 " && word[0]!="HNY" && word[0]!="QSY" && word[0]!="PSE" && - !(word[0].left(3).contains(QRegularExpression {"\\w\\d\\w"}) or - word[0].left(3).contains(QRegularExpression {"\\d\\w\\d"}) or - word[0].left(3).contains(QRegularExpression {"\\w\\w\\d"}) or - decodedtext.string().contains("/")or decodedtext.string().contains("<...>"))) { -// ui->decodedTextBrowser->insertText("word0 has false syntax"); - filtered = true; - } - } - notInALLCALL7 = false; +void MainWindow::readFromStdout() //readFromStdout +{ + bool decodeCompleted {false}; + auto const decodeContext = m_activeJt9Decode.context; + bool bDisplayPoints = false; + QString all_decodes; + if(m_ActiveStationsWidget!=NULL) { + bDisplayPoints=(decodeContext.mode=="FT4" or decodeContext.mode=="FT8") and + (decodeContext.specOp==SpecOp::ARRL_DIGI or m_ActiveStationsWidget->isVisible()); + } + extern bool no_a7_decodes; + extern QString earlyDecodes; + DecodeOutputPlan::PreparationContext preparationContext; + preparationContext.mode = decodeContext.mode; + preparationContext.specOp = decodeContext.specOp; + preparationContext.myCall = decodeContext.myCall; + preparationContext.qsyEnabled = ui->actionEnable_QSY_Popups->isChecked() || m_qsymonitorWidget; + preparationContext.activeStationsAvailable = m_ActiveStationsWidget != nullptr; + preparationContext.activeStationsWantedOnly = m_ActiveStationsWidget && m_ActiveStationsWidget->wantedOnly(); + preparationContext.displayPoints = bDisplayPoints; + preparationContext.noOwnCall = ui->cbNoOwnCall->isChecked (); + preparationContext.diskData = decodeContext.diskData; + preparationContext.noA7Decodes = no_a7_decodes; + preparationContext.multithreadFt8 = decodeContext.multithreadFt8; + preparationContext.ft8DecoderStart = decodeContext.ft8DecoderStart; + preparationContext.nominalFrequency = decodeContext.periodFrequency; + preparationContext.reduceFalseDecodes = ui->actionReduce_false_decodes->isChecked(); + m_decoderOutputFramer.drain ( + proc_jt9, [this, &all_decodes, &preparationContext, &decodeCompleted, + &decodeContext, bDisplayPoints] + (DecoderOutputFramer::Event const& event) { + if (handleDecoderOutputEvent (event, decodeCompleted)) return; + filtered = false; + ignored = false; + m_muted = false; + auto const raw_line = event.rawLine; +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) + Q_EMIT decoderOutputLine (raw_line); +#endif + // earlyDecodes grows as lines are displayed within this batch + preparationContext.earlyDecodes = earlyDecodes; + auto const prepared = DecodeOutputPlan::prepareLine (raw_line, preparationContext); + + bool updateArrlActivity = false; + // Apply raw-line actions before terminal dispositions; accepted-line + // persistence actions run only after Ignore and Finish are handled. + for (auto const& action : prepared.actions) { + if (action.kind == DecodeOutputPlan::ActionKind::ShowQsyMessage) { + showQSYMessage (action.text); + } else if (action.kind == DecodeOutputPlan::ActionKind::AccumulateFoxActivity) { + all_decodes.append (action.text); + } else if (action.kind == DecodeOutputPlan::ActionKind::UpdateArrlActivity) { + updateArrlActivity = true; } + } + if (prepared.disposition != DecodeOutputPlan::LineDisposition::Decode) return; - if(m_mode=="FT8" and SpecOp::FOX == m_specOp and - (decodedtext.string().contains("R+") or decodedtext.string().contains("R-"))) { - auto for_us = decodedtext.string().contains(" " + m_config.my_callsign() + " ") or - decodedtext.string().contains(" "+m_baseCall) or - decodedtext.string().contains(m_baseCall+" ") or - decodedtext.string().contains(" <" + m_config.my_callsign() + "> "); - if(decodedtext.string().contains(" DE ")) for_us=true; //Hound with compound callsign - if(for_us) { - QString houndCall,houndGrid; - decodedtext.deCallAndGrid(/*out*/houndCall,houndGrid); - foxRxSequencer(decodedtext.string(),houndCall,houndGrid); + auto line_read = prepared.normalizedLine; + bool haveFSpread = prepared.haveFrequencySpread; + bool block_right_display {false}; + float fSpread = prepared.frequencySpread; + QString const message0 = prepared.decodedOriginal; + DecodedText decodedtext0 {prepared.decodedOriginal}; + DecodedText const& decodedtext {prepared.logicMessage}; + Q_EMIT decodedMessageProcessed (decodedtext.message ().simplified ()); + + if (m_mode=="Q65" && m_specOp==SpecOp::Q65_PILEUP) { + auto const fields = parseDecodedMessage (decodedtext.message ()); + + // Keep the Active Stations '#' indication current: a later decode from the same caller without '#' removes it. + if (!fields.sender.isEmpty ()) { + if (raw_line.trimmed ().endsWith ('#')) { + m_q65PileupCopiedCallers.insert (fields.sender); + } else { + m_q65PileupCopiedCallers.remove (fields.sender); } } + auto const dx_base_call = Radio::base_callsign (ui->dxCallEntry->text ()); + if (!dx_base_call.isEmpty () && fields.sender == dx_base_call) { + m_q65PileupCopiedLastRxCall = dx_base_call; + } + } + + { + bool const bAvgMsg = prepared.averaged; + + for (auto const& action : prepared.actions) { + if (action.kind == DecodeOutputPlan::ActionKind::IncrementDecodeCount) { + m_nDecodes += 1; + if(decodeContext.mode!="Q65") ndecodes_label.setText(QString::number(m_nDecodes)); + } else if (action.kind == DecodeOutputPlan::ActionKind::WriteAll) { + write_all("Rx", action.text, &decodeContext); + } else if (action.kind == DecodeOutputPlan::ActionKind::UploadWsprSpot) { + uploadWSPRSpots (true, action.text); + } + } + + applyExperimentalFT8Filter(decodedtext, filtered); + + processFoxSignals(decodedtext); + //Left (Band activity) window if(!bAvgMsg) { if(m_mode=="FT8" and SpecOp::FOX == m_specOp) { @@ -6354,508 +6901,42 @@ void MainWindow::readFromStdout() //readFromStdout } #endif DecodedText decodedtext1=decodedtext0; - if ((m_mode=="FT4" or m_mode=="FT8") and bDisplayPoints and decodedtext1.isStandardMessage()) { + if (updateArrlActivity) { ARRL_Digi_Update(decodedtext1); } -#ifdef FOX_OTP - if (SpecOp::HOUND == m_specOp) - { - // Payload formats (from column 24 onward): - // Standard: CALL.OTP e.g. "K8R.920749" - // SuperFox: $VERIFY$ CALL OTP e.g. "$VERIFY$ VP2X/K1JT 920749" - // Callsigns may include '/' and decoder output may contain variable spacing. - static const QRegularExpression stdPayloadRe{ - QStringLiteral("^([A-Z0-9]{2,6})\\.([0-9]{6})$")}; - static const QRegularExpression verifyPayloadRe{ - QStringLiteral("^\\$VERIFY\\$\\s+([A-Z0-9/]{2,13})\\s+([0-9]{6})$")}; + processSFoxVerification(decodedtext0, filtered); - QString const payload = decodedtext0.mid(24, -1).trimmed(); - QString callsign, otp; - unsigned int hz = 0; + QString text = decodedtext.string().replace("<", "").replace(">", ""); - QRegularExpressionMatch payloadMatch = stdPayloadRe.match(payload); - if (payloadMatch.hasMatch()) { - callsign = payloadMatch.captured(1); - otp = payloadMatch.captured(2); - hz = static_cast(decodedtext0.frequencyOffset()); - } else if (m_config.superFox() && - (payloadMatch = verifyPayloadRe.match(payload)).hasMatch()) { - callsign = payloadMatch.captured(1); - otp = payloadMatch.captured(2); - hz = 750; - } - - if (!callsign.isEmpty()) { - if (!m_config.ShowOTP() || otp == QLatin1String("000000")) - filtered = true; - - QDateTime verifyDateTime; - if (m_diskData) { - verifyDateTime = m_UTCdiskDateTime; - } else { - verifyDateTime = QDateTime(QDateTime::currentDateTimeUtc().date(), - QTime::fromString(decodedtext0.left(6), "hhmmss")); - } - if (otp != QLatin1String("000000")) { - FoxVerifier *fv = new FoxVerifier(MainWindow::userAgent(), - &m_network_manager, - m_config.OTPUrl(), - callsign, - verifyDateTime, - otp, - hz); - connect(fv, &FoxVerifier::verifyComplete, this, &MainWindow::handleVerifyMsg); - m_verifications << fv; - } - } - } -#endif - - QString text = decodedtext.string().replace("<","").replace(">",""); // for Wait & Reply/Call and filtering + if (processWaitReplyCall(decodedtext0, DecodedMessageReaction::WaitDecodeSource::SlowDecoder, + &block_right_display) + == DecodedMessageReaction::ReactionDisposition::IgnoreDecode) return; - // FT4 NS (NCCC Sprints): Log QSO after receiving "mycall hiscall R hisgrid" - if (m_mode=="FT4" && SpecOp::NA_VHF==m_specOp && m_config.NCCC_Sprint() && m_hisCall!="" && m_hisGrid!="" && - text.contains(" " + m_config.my_callsign() + " " + m_hisCall + " R " + m_hisGrid.left(4))) { - if (m_config.prompt_to_log() || m_config.autoLog()) logQSOTimer.start(0); - QTimer::singleShot (500, [=] { - on_stopTxButton_clicked(); - }); - } + if (!applyFiltering(decodedtext, filtered)) return; - // Stop Wait & Call timeout when in QSO with this station - if (ui->DX_Call_Button->isChecked() && m_hisCall!="" && text.contains(" " + m_config.my_callsign() + " " + m_hisCall)) { - stopWCTimer.stop(); // stop any Wait & Call timeout - if (ui->DX_Call_Button->isChecked()) ui->DX_Call_Button->click (); // disable Wait & Call - no_wait_and_call = false; // reset Wait & Call - } - - // Wait & Reply + FT4 NS (NCCC Sprints) reply to incoming RR73 messages - if ((m_mode=="FT8" or m_mode=="FT4" or m_mode=="Q65" or m_mode=="FST4" or m_mode=="JT65" or m_mode=="JT9" or m_mode=="JT4") && m_hisCall!="" - && text.contains(" " + m_config.my_callsign() + " " + m_hisCall) && ((!text.contains("73 ") - && m_config.Wait_features_enabled() && !ui->autoButton->isChecked()) - or (m_mode=="FT4" && SpecOp::NA_VHF==m_specOp && m_config.NCCC_Sprint()))) { - if (SpecOp::HOUND==m_specOp && (text.mid(4,2).contains("15") or text.mid(4,2).contains("45"))) return; // ignore stations calling in the wrong time slot - tx_watchdog (false); - m_bDoubleClicked = true; - processMessage(decodedtext0); - auto_tx_mode(true); - if (m_mode=="FT4" && SpecOp::NA_VHF==m_specOp && m_config.NCCC_Sprint()) { - if (!no_logging) logQSOTimer.start(0); // logging of stations not in contest mode - } else { - if (m_config.Wait_features_enabled()) stopWRTimer.start(int(8000.0*m_TRperiod)); // Wait & Reply Tx max 8*TRperiod - } - } - - // Wait & Call - if (wait_and_call && (m_mode=="FT8" or m_mode=="FT4" or m_mode=="Q65" or m_mode=="FST4" or m_mode=="JT65" or m_mode=="JT9" or m_mode=="JT4") && - m_specOp!=SpecOp::FOX && ui->cbAutoSeq->isChecked() && m_hisCall!="" && !no_wait_and_call && - (text.contains("CQ " + m_hisCall) or text.contains("CQ DX " + m_hisCall) or text.contains(m_hisCall + " RR73") - or text.contains(m_hisCall + " RRR") or text.contains(m_hisCall + " 73")) - && m_config.Wait_features_enabled()) { - if (!text.contains(" " + m_config.my_callsign() + " " + m_hisCall)) - block_right_display = true; // prevent display of first message twice - m_bDoubleClicked = true; - processMessage(decodedtext0); - auto_tx_mode(true); - no_wait_and_call = true; - stopWCTimer.start(int(6200.0*m_TRperiod)); // Wait & Call Tx max 8*TRperiod - } - - // Filtering - QString text2 = ""; - QStringList tw; - if (m_mode == "FT8" or m_mode == "FT4" or m_mode == "Q65" or m_mode == "FST4") { - tw=text.mid(24).split(" ",SkipEmptyParts); - } else { - tw=text.mid(22).split(" ",SkipEmptyParts); - } - if (m_config.filters_for_word2()) { - if (tw.size () < 2) { - text2 = "___"; // prevent segfault errors with free text messages - } else if (tw[1].length() == 2 && tw[1].contains(QRegularExpression{"\\w\\w"})) { // directional calls - if (tw.size () > 2) { - text2 = tw[2]; // for directional calls analyze word 3 for filtering - } else { - text2 = "___"; // prevent segfault errors with free text messages - } - } else { - if (text.contains(";")) { - text2 = tw[3]; // analyze word 4 for filtering of combined messages - } else { - text2 = tw[1]; // otherwise analyze word 2 for filtering - } - } - if (!(SpecOp::NONE==m_specOp && m_config.AlwaysPass () // Always pass messages with keywords from Always Pass list - && ( - (text2.startsWith(m_config.Pass1()) && (m_config.Pass1()!="")) - || (text2.startsWith(m_config.Pass2()) && (m_config.Pass2()!="")) - || (text2.startsWith(m_config.Pass3()) && (m_config.Pass3()!="")) - || (text2.startsWith(m_config.Pass4()) && (m_config.Pass4()!="")) - || (text2.startsWith(m_config.Pass5()) && (m_config.Pass5()!="")) - || (text2.startsWith(m_config.Pass6()) && (m_config.Pass6()!="")) - || (text2.startsWith(m_config.Pass7()) && (m_config.Pass7()!="")) - || (text2.startsWith(m_config.Pass8()) && (m_config.Pass8()!="")) - || (text2.startsWith(m_config.Pass9()) && (m_config.Pass9()!="")) - || (text2.startsWith(m_config.Pass10()) && (m_config.Pass10()!="")) - || (text2.startsWith(m_config.Pass11()) && (m_config.Pass11()!="")) - || (text2.startsWith(m_config.Pass12()) && (m_config.Pass12()!="")) - ))) { - - // Filtering out messages with keywords from Blacklist - if ((SpecOp::NONE==m_specOp or SpecOp::HOUND==m_specOp) && m_config.Blacklisted () - && ( - (text2.startsWith(m_config.Blacklist1()) && (m_config.Blacklist1()!="")) - || (text2.startsWith(m_config.Blacklist2()) && (m_config.Blacklist2()!="")) - || (text2.startsWith(m_config.Blacklist3()) && (m_config.Blacklist3()!="")) - || (text2.startsWith(m_config.Blacklist4()) && (m_config.Blacklist4()!="")) - || (text2.startsWith(m_config.Blacklist5()) && (m_config.Blacklist5()!="")) - || (text2.startsWith(m_config.Blacklist6()) && (m_config.Blacklist6()!="")) - || (text2.startsWith(m_config.Blacklist7()) && (m_config.Blacklist7()!="")) - || (text2.startsWith(m_config.Blacklist8()) && (m_config.Blacklist8()!="")) - || (text2.startsWith(m_config.Blacklist9()) && (m_config.Blacklist9()!="")) - || (text2.startsWith(m_config.Blacklist10()) && (m_config.Blacklist10()!="")) - || (text2.startsWith(m_config.Blacklist11()) && (m_config.Blacklist11()!="")) - || (text2.startsWith(m_config.Blacklist12()) && (m_config.Blacklist12()!="")) - )) { - if (!ui->cbBypass->isChecked()) filtered = true; - if (!(m_config.filters_for_Wait_and_Pounce_only() or ui->cbBypass->isChecked())) return; - // reset dB score when filtered - if (pounce && (ui->respondComboBox->currentText()=="CQ: Max Dist" - or ui->respondComboBox->currentText()=="CQ: Max dB" - or ui->respondComboBox->currentText()=="CQ: Min dB")) { - Dpoints=0; - maxDPoints=0; - dBpoints=-28; - dBpoints2=99; - maxdBPoints=-28; - mindBPoints=99; - } - - // Filtering out everything but messages with keywords from Whitelist - } else if ((SpecOp::NONE==m_specOp or SpecOp::HOUND==m_specOp) && m_config.Whitelisted () - && !(text2.startsWith(m_config.Whitelist1()) && (m_config.Whitelist1()!="")) - && !(text2.startsWith(m_config.Whitelist2()) && (m_config.Whitelist2()!="")) - && !(text2.startsWith(m_config.Whitelist3()) && (m_config.Whitelist3()!="")) - && !(text2.startsWith(m_config.Whitelist4()) && (m_config.Whitelist4()!="")) - && !(text2.startsWith(m_config.Whitelist5()) && (m_config.Whitelist5()!="")) - && !(text2.startsWith(m_config.Whitelist6()) && (m_config.Whitelist6()!="")) - && !(text2.startsWith(m_config.Whitelist7()) && (m_config.Whitelist7()!="")) - && !(text2.startsWith(m_config.Whitelist8()) && (m_config.Whitelist8()!="")) - && !(text2.startsWith(m_config.Whitelist9()) && (m_config.Whitelist9()!="")) - && !(text2.startsWith(m_config.Whitelist10()) && (m_config.Whitelist10()!="")) - && !(text2.startsWith(m_config.Whitelist11()) && (m_config.Whitelist11()!="")) - && !(text2.startsWith(m_config.Whitelist12()) && (m_config.Whitelist12()!="")) - ) { - if (!ui->cbBypass->isChecked()) filtered = true; - if (!(m_config.filters_for_Wait_and_Pounce_only() or ui->cbBypass->isChecked())) return; - // reset dB score when filtered - if (pounce && (ui->respondComboBox->currentText()=="CQ: Max Dist" - or ui->respondComboBox->currentText()=="CQ: Max dB" - or ui->respondComboBox->currentText()=="CQ: Min dB")) { - Dpoints=0; - maxDPoints=0; - dBpoints=-28; - dBpoints2=99; - maxdBPoints=-28; - mindBPoints=99; - } - } - - // search logbook for filtering - if (ui->actionHideTerritory1->isChecked() or ui->actionHideTerritory2->isChecked() or - ui->actionHideTerritory3->isChecked() or ui->actionHideTerritory4->isChecked() or - ui->actionHideB4->isChecked() or ui->actionHideEU->isChecked() or ui->actionHideAS->isChecked() or - ui->actionHideNA->isChecked() or ui->actionHideSA->isChecked() or ui->actionHideAF->isChecked() or - ui->actionHideOC->isChecked() or ui->actionHideAN->isChecked()) { - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(/*out*/deCall,deGrid); - // search for country names - if (ui->actionHideTerritory1->isChecked() or ui->actionHideTerritory2->isChecked() or - ui->actionHideTerritory3->isChecked() or ui->actionHideTerritory4->isChecked()) { - auto const& looked_up = m_logBook.countries ()->lookup (deCall); - auto countryName = looked_up.entity_name; - // do some obvious abbreviations - countryName.replace ("Islands", "Is."); - countryName.replace ("Island", "Is."); - countryName.replace ("North ", "N. "); - countryName.replace ("Northern ", "N. "); - countryName.replace ("South ", "S. "); - countryName.replace ("East ", "E. "); - countryName.replace ("Eastern ", "E. "); - countryName.replace ("West ", "W. "); - countryName.replace ("Western ", "W. "); - countryName.replace ("Central ", "C. "); - countryName.replace (" and ", " & "); - countryName.replace ("Republic", "Rep."); - countryName.replace ("United States of America", "U.S.A."); - countryName.replace ("United States", "U.S.A."); - countryName.replace ("Fed. Rep. of ", ""); - countryName.replace ("French ", "Fr."); - countryName.replace ("Asiatic", "AS"); - countryName.replace ("European", "EU"); - countryName.replace ("African", "AF"); - if (ui->actionHideTerritory1->isChecked() && countryName.contains(m_config.Territory1()) - && (m_config.Territory1()!="") && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideTerritory2->isChecked() && countryName.contains(m_config.Territory2()) - && (m_config.Territory2()!="") && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideTerritory3->isChecked() && countryName.contains(m_config.Territory3()) - && (m_config.Territory3()!="") && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideTerritory4->isChecked() && countryName.contains(m_config.Territory4()) - && (m_config.Territory4()!="") && !ui->cbBypass->isChecked()) filtered = true; - } - // search for callsigns worked B4 on band - if (ui->actionHideB4->isChecked()) { - bool callB4onBand; - bool countryB4onBand; - bool gridB4onBand; - bool continentB4onBand; - bool CQZoneB4onBand; - bool ITUZoneB4onBand; - auto const& looked_up = m_logBook.countries ()->lookup (deCall); - m_logBook.match (deCall, m_mode, deGrid, looked_up, callB4onBand, countryB4onBand, gridB4onBand, - continentB4onBand, CQZoneB4onBand, ITUZoneB4onBand, m_currentBand); - if (callB4onBand && ui->actionHideB4->isChecked() && !ui->cbBypass->isChecked()) filtered = true; - } - // search for continents - if (ui->actionHideEU->isChecked() or ui->actionHideAS->isChecked() or ui->actionHideNA->isChecked() - or ui->actionHideSA->isChecked() or ui->actionHideAF->isChecked() or ui->actionHideOC->isChecked() - or ui->actionHideAN->isChecked()) { - auto const& looked_up = m_logBook.countries ()->lookup (deCall); - QString continent = AD1CCty::continent (looked_up.continent); - if (ui->actionHideEU->isChecked() && continent == "EU" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideAS->isChecked() && continent == "AS" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideNA->isChecked() && continent == "NA" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideSA->isChecked() && continent == "SA" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideAF->isChecked() && continent == "AF" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideOC->isChecked() && continent == "OC" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideAN->isChecked() && continent == "AN" && !ui->cbBypass->isChecked()) filtered = true; - } - } - } - } else { - if (!(SpecOp::NONE==m_specOp && m_config.AlwaysPass () // Always pass messages with keywords from Always Pass list - && ( - (text.contains(m_config.Pass1()) && (m_config.Pass1()!="")) - || (text.contains(m_config.Pass2()) && (m_config.Pass2()!="")) - || (text.contains(m_config.Pass3()) && (m_config.Pass3()!="")) - || (text.contains(m_config.Pass4()) && (m_config.Pass4()!="")) - || (text.contains(m_config.Pass5()) && (m_config.Pass5()!="")) - || (text.contains(m_config.Pass6()) && (m_config.Pass6()!="")) - || (text.contains(m_config.Pass7()) && (m_config.Pass7()!="")) - || (text.contains(m_config.Pass8()) && (m_config.Pass8()!="")) - || (text.contains(m_config.Pass9()) && (m_config.Pass9()!="")) - || (text.contains(m_config.Pass10()) && (m_config.Pass10()!="")) - || (text.contains(m_config.Pass11()) && (m_config.Pass11()!="")) - || (text.contains(m_config.Pass12()) && (m_config.Pass12()!="")) - ))) { - - // Filtering out messages with keywords from Blacklist - if ((SpecOp::NONE==m_specOp or SpecOp::HOUND==m_specOp) && m_config.Blacklisted () - && ( - (text.contains(m_config.Blacklist1()) && (m_config.Blacklist1()!="")) - || (text.contains(m_config.Blacklist2()) && (m_config.Blacklist2()!="")) - || (text.contains(m_config.Blacklist3()) && (m_config.Blacklist3()!="")) - || (text.contains(m_config.Blacklist4()) && (m_config.Blacklist4()!="")) - || (text.contains(m_config.Blacklist5()) && (m_config.Blacklist5()!="")) - || (text.contains(m_config.Blacklist6()) && (m_config.Blacklist6()!="")) - || (text.contains(m_config.Blacklist7()) && (m_config.Blacklist7()!="")) - || (text.contains(m_config.Blacklist8()) && (m_config.Blacklist8()!="")) - || (text.contains(m_config.Blacklist9()) && (m_config.Blacklist9()!="")) - || (text.contains(m_config.Blacklist10()) && (m_config.Blacklist10()!="")) - || (text.contains(m_config.Blacklist11()) && (m_config.Blacklist11()!="")) - || (text.contains(m_config.Blacklist12()) && (m_config.Blacklist12()!="")) - )) { - if (!ui->cbBypass->isChecked()) filtered = true; - if (!(m_config.filters_for_Wait_and_Pounce_only() or ui->cbBypass->isChecked())) return; - // reset dB score when filtered - if (pounce && (ui->respondComboBox->currentText()=="CQ: Max Dist" - or ui->respondComboBox->currentText()=="CQ: Max dB" - or ui->respondComboBox->currentText()=="CQ: Min dB")) { - Dpoints=0; - maxDPoints=0; - dBpoints=-28; - dBpoints2=99; - maxdBPoints=-28; - mindBPoints=99; - } - - // Filtering out everything but messages with keywords from Whitelist - } else if ((SpecOp::NONE==m_specOp or SpecOp::HOUND==m_specOp) && m_config.Whitelisted () - && !(text.contains(m_config.Whitelist1()) && (m_config.Whitelist1()!="")) - && !(text.contains(m_config.Whitelist2()) && (m_config.Whitelist2()!="")) - && !(text.contains(m_config.Whitelist3()) && (m_config.Whitelist3()!="")) - && !(text.contains(m_config.Whitelist4()) && (m_config.Whitelist4()!="")) - && !(text.contains(m_config.Whitelist5()) && (m_config.Whitelist5()!="")) - && !(text.contains(m_config.Whitelist6()) && (m_config.Whitelist6()!="")) - && !(text.contains(m_config.Whitelist7()) && (m_config.Whitelist7()!="")) - && !(text.contains(m_config.Whitelist8()) && (m_config.Whitelist8()!="")) - && !(text.contains(m_config.Whitelist9()) && (m_config.Whitelist9()!="")) - && !(text.contains(m_config.Whitelist10()) && (m_config.Whitelist10()!="")) - && !(text.contains(m_config.Whitelist11()) && (m_config.Whitelist11()!="")) - && !(text.contains(m_config.Whitelist12()) && (m_config.Whitelist12()!="")) - ) { - if (!ui->cbBypass->isChecked()) filtered = true; - if (!(m_config.filters_for_Wait_and_Pounce_only() or ui->cbBypass->isChecked())) return; - // reset dB score when filtered - if (pounce && (ui->respondComboBox->currentText()=="CQ: Max Dist" - or ui->respondComboBox->currentText()=="CQ: Max dB" - or ui->respondComboBox->currentText()=="CQ: Min dB")) { - Dpoints=0; - maxDPoints=0; - dBpoints=-28; - dBpoints2=99; - maxdBPoints=-28; - mindBPoints=99; - } - } - - // search logbook for filtering - if (ui->actionHideTerritory1->isChecked() or ui->actionHideTerritory2->isChecked() or - ui->actionHideTerritory3->isChecked() or ui->actionHideTerritory4->isChecked() or - ui->actionHideB4->isChecked() or ui->actionHideEU->isChecked() or ui->actionHideAS->isChecked() or - ui->actionHideNA->isChecked() or ui->actionHideSA->isChecked() or ui->actionHideAF->isChecked() or - ui->actionHideOC->isChecked() or ui->actionHideAN->isChecked()) { - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(/*out*/deCall,deGrid); - // search for country names - if (ui->actionHideTerritory1->isChecked() or ui->actionHideTerritory2->isChecked() or - ui->actionHideTerritory3->isChecked() or ui->actionHideTerritory4->isChecked()) { - auto const& looked_up = m_logBook.countries ()->lookup (deCall); - auto countryName = looked_up.entity_name; - // do some obvious abbreviations - countryName.replace ("Islands", "Is."); - countryName.replace ("Island", "Is."); - countryName.replace ("North ", "N. "); - countryName.replace ("Northern ", "N. "); - countryName.replace ("South ", "S. "); - countryName.replace ("East ", "E. "); - countryName.replace ("Eastern ", "E. "); - countryName.replace ("West ", "W. "); - countryName.replace ("Western ", "W. "); - countryName.replace ("Central ", "C. "); - countryName.replace (" and ", " & "); - countryName.replace ("Republic", "Rep."); - countryName.replace ("United States of America", "U.S.A."); - countryName.replace ("United States", "U.S.A."); - countryName.replace ("Fed. Rep. of ", ""); - countryName.replace ("French ", "Fr."); - countryName.replace ("Asiatic", "AS"); - countryName.replace ("European", "EU"); - countryName.replace ("African", "AF"); - if (ui->actionHideTerritory1->isChecked() && countryName.contains(m_config.Territory1()) - && (m_config.Territory1()!="") && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideTerritory2->isChecked() && countryName.contains(m_config.Territory2()) - && (m_config.Territory2()!="") && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideTerritory3->isChecked() && countryName.contains(m_config.Territory3()) - && (m_config.Territory3()!="") && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideTerritory4->isChecked() && countryName.contains(m_config.Territory4()) - && (m_config.Territory4()!="") && !ui->cbBypass->isChecked()) filtered = true; - } - // search for callsigns worked B4 on band - if (ui->actionHideB4->isChecked()) { - bool callB4onBand; - bool countryB4onBand; - bool gridB4onBand; - bool continentB4onBand; - bool CQZoneB4onBand; - bool ITUZoneB4onBand; - auto const& looked_up = m_logBook.countries ()->lookup (deCall); - m_logBook.match (deCall, m_mode, deGrid, looked_up, callB4onBand, countryB4onBand, gridB4onBand, - continentB4onBand, CQZoneB4onBand, ITUZoneB4onBand, m_currentBand); - if (callB4onBand && ui->actionHideB4->isChecked() && !ui->cbBypass->isChecked()) filtered = true; - } - // search for continents - if (ui->actionHideEU->isChecked() or ui->actionHideAS->isChecked() or ui->actionHideNA->isChecked() - or ui->actionHideSA->isChecked() or ui->actionHideAF->isChecked() or ui->actionHideOC->isChecked() - or ui->actionHideAN->isChecked()) { - auto const& looked_up = m_logBook.countries ()->lookup (deCall); - QString continent = AD1CCty::continent (looked_up.continent); - if (ui->actionHideEU->isChecked() && continent == "EU" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideAS->isChecked() && continent == "AS" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideNA->isChecked() && continent == "NA" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideSA->isChecked() && continent == "SA" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideAF->isChecked() && continent == "AF" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideOC->isChecked() && continent == "OC" && !ui->cbBypass->isChecked()) filtered = true; - if (ui->actionHideAN->isChecked() && continent == "AN" && !ui->cbBypass->isChecked()) filtered = true; - } - } - } - } - - // mute audible alerts when callsign is on the Ignored List - if (m_config.alert_Enabled() && !ui->cbBypass->isChecked()) { - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(deCall,deGrid); - if (deCall!="" && ignoreList.contains(deCall + ",")) m_muted = true; - } - - // hide or ignore callsigns - if (ui->actionHideIgnored->isChecked() or ui->actionHideToday->isChecked() or ui->actionIgnoreIgnored->isChecked() or ui->actionIgnoreToday->isChecked()) { - QString today = QDateTime::currentDateTimeUtc().toString ("yyyy-MM-dd"); - QString yesterday = QDateTime::currentDateTimeUtc().addDays(-1).toString ("yyyy-MM-dd"); - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(/*out*/deCall,deGrid); - if (ui->actionHideIgnored->isChecked() && !ui->cbBypass->isChecked() && ignoreList.contains(deCall + ",")) filtered = true; - if (ui->actionHideToday->isChecked() && !ui->cbBypass->isChecked() && ( - txLog.contains(QRegularExpression{today + ",[0-9][0-9]:[0-9][0-9]:[0-9][0-9]," + (deCall + ",")}) - or (m_config.twoDays() && txLog.contains(QRegularExpression{yesterday + ",[0-9][0-9]:[0-9][0-9]:[0-9][0-9]," + (deCall + ",")})))) { - filtered = true; - } - if (ui->actionIgnoreIgnored->isChecked() && ignoreList.contains(deCall + ",")) { - ignored = true; - m_muted = true; - } - if (ui->actionIgnoreToday->isChecked() && (txLog.contains(QRegularExpression{today + ",[0-9][0-9]:[0-9][0-9]:[0-9][0-9]," + (deCall + ",")}) - or (m_config.twoDays() && txLog.contains(QRegularExpression{yesterday + ",[0-9][0-9]:[0-9][0-9]:[0-9][0-9]," + (deCall + ",")})))) { - ignored = true; - m_muted = true; - } - } - if (ui->actionIgnoreB4->isChecked() && (pounce or m_auto)) { - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(/*out*/deCall,deGrid); - bool callB4onBand; - bool countryB4onBand; - bool gridB4onBand; - bool continentB4onBand; - bool CQZoneB4onBand; - bool ITUZoneB4onBand; - auto const& looked_up = m_logBook.countries ()->lookup (deCall); - m_logBook.match (deCall, m_mode, deGrid, looked_up, callB4onBand, countryB4onBand, gridB4onBand, - continentB4onBand, CQZoneB4onBand, ITUZoneB4onBand, m_currentBand); - if (callB4onBand && ui->actionIgnoreB4->isChecked() && !ui->cbBypass->isChecked()) { - ignored = true; - m_muted = true; - } - } // insert blank line, but only if not filtered and no decodes int ntime=6; - if (m_TRperiod>=60) ntime=4; - if ((m_config.insert_blank () or m_config.alert_Enabled()) && (line_read.left(ntime) != m_tBlankLine) && message0.left(4).contains(QRegularExpression {"\\d\\d\\d\\d"}) && !m_diskData) { + if (decodeContext.trPeriod>=60) ntime=4; + if ((m_config.insert_blank () or m_config.alert_Enabled()) && (line_read.left(ntime) != m_tBlankLine) && message0.left(4).contains(four_digit_regexp) && !decodeContext.diskData) { ui->decodedTextBrowser->new_period (); if (m_specOp == SpecOp::FOX and m_ActiveStationsWidget != NULL && m_config.insert_blank ()) { // clear the ActiveStations window m_ActiveStationsWidget->clearStations(); - m_ActiveStationsWidget->displayRecentStations("Fox Mode", ""); + m_ActiveStationsWidget->displayRecentStations(ActiveStations::DisplayMode::Fox, ""); } if (SpecOp::FOX != m_specOp && (!filtered or m_config.filters_for_Wait_and_Pounce_only()) && m_config.insert_blank ()) { QString band; if(((QDateTime::currentMSecsSinceEpoch() / 1000 - m_secBandChanged) > 4*int(m_TRperiod)/4) or m_displayBand) { - band = ' ' + m_config.bands ()->find (m_freqNominal); + band = ' ' + decodeContext.band; } if (m_config.insert_blank ()) { if (ui->actionUse_Dark_Style->isChecked()) { if (m_config.detailed_blank()) { if (m_config.DXCC()) { - ui->decodedTextBrowser->insertText(("------ " + m_dateTimeSeqStart.toString("yyyy-MM-dd - hh:mm:ss' UTC - '") + m_currentBandPeriod + " - " + m_mode + " ------"), "#a2a2a2", "#000000"); + ui->decodedTextBrowser->insertText(("------ " + decodeContext.sequenceStart.toString("yyyy-MM-dd - hh:mm:ss' UTC - '") + decodeContext.band + " - " + decodeContext.mode + " ------"), "#a2a2a2", "#000000"); } else { - ui->decodedTextBrowser->insertText(("------ " + m_dateTimeSeqStart.toString("yyyy-MM-dd - hh:mm:ss' UTC - '") + m_currentBandPeriod + " - " + m_mode), "#a2a2a2", "#000000"); + ui->decodedTextBrowser->insertText(("------ " + decodeContext.sequenceStart.toString("yyyy-MM-dd - hh:mm:ss' UTC - '") + decodeContext.band + " - " + decodeContext.mode), "#a2a2a2", "#000000"); } } else { ui->decodedTextBrowser->insertText(band.rightJustified(40, '-'), "#a2a2a2", "#000000"); @@ -6863,9 +6944,9 @@ void MainWindow::readFromStdout() //readFromStdout } else { if (m_config.detailed_blank()) { if (m_config.DXCC()) { - ui->decodedTextBrowser->insertLineSpacer ("------ " + m_dateTimeSeqStart.toString("yyyy-MM-dd - hh:mm:ss' UTC - '") + m_currentBandPeriod + " - " + m_mode + " ------"); + ui->decodedTextBrowser->insertLineSpacer ("------ " + decodeContext.sequenceStart.toString("yyyy-MM-dd - hh:mm:ss' UTC - '") + decodeContext.band + " - " + decodeContext.mode + " ------"); } else { - ui->decodedTextBrowser->insertLineSpacer ("------ " + m_dateTimeSeqStart.toString("yyyy-MM-dd - hh:mm:ss' UTC - '") + m_currentBandPeriod + " - " + m_mode); + ui->decodedTextBrowser->insertLineSpacer ("------ " + decodeContext.sequenceStart.toString("yyyy-MM-dd - hh:mm:ss' UTC - '") + decodeContext.band + " - " + decodeContext.mode); } } else { ui->decodedTextBrowser->insertLineSpacer (band.rightJustified (40, '-')); @@ -6877,137 +6958,19 @@ void MainWindow::readFromStdout() //readFromStdout } // SuperHound label - if (ui->labDXped->text().contains("Hound") && decodedtext0.mid(3,18).contains(" verified")) { - verified = true; - write_all("Vf",decodedtext0.string()); - ui->labDXped->setStyleSheet("QLabel {background-color: #00ff00; color: black;}"); - } else { -#ifndef FOX_OTP - if (m_specOp==SpecOp::HOUND && m_config.superFox() && (decodedtext0.mid(4,2).contains("00") or decodedtext0.mid(4,2).contains("30"))) verified = false; -#endif - } - if ((!verified && ui->labDXped->isVisible()) or !ui->labDXped->text().contains("Hound")) - ui->labDXped->setStyleSheet("QLabel {background-color: red; color: white;}"); + processSuperHoundVerification(decodedtext0); // show distance and bearing - if (!filtered or m_config.filters_for_Wait_and_Pounce_only()) { // show decodes if not filtered - QString distance; - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(deCall,deGrid); - if ((m_config.showDistance() || m_config.showAzimuth()) && deGrid.contains(grid_regexp)) { - double utch=0.0; - int nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter; - QString my_Grid = m_config.my_grid(); - if (my_Grid.length() < 5) my_Grid = m_config.my_grid().left(4)+"mm"; - QString de_Grid= deGrid.left(4)+"mm"; - azdist_(const_cast (my_Grid.toLatin1().constData()), - const_cast (de_Grid.toLatin1().constData()),&utch, - &nAz,&nEl,&nDmiles,&nDkm,&nHotAz,&nHotABetter,(FCL)6,(FCL)6); - if (m_config.showDistance()) { - int nd=nDkm; - if(m_config.miles()) nd=nDmiles; - distance = QString::number(nd); - if(m_config.miles()) distance += " mi"; - if(!m_config.miles()) distance += " km"; - } - if (m_config.showAzimuth()) { - if (distance.length()) distance += " / "; - distance += QString::number(nAz) + "°"; - } - } - - // display country names for JT65 and JT9 like for FT8 - if ((m_mode == "JT65" or m_mode == "JT9" or m_mode == "JT4") && m_config.DXCC()) { - DecodedText decodedtextJT {((QString::fromUtf8(line_read.left(44).constData())) + (QString::fromUtf8(line_read.mid(62, 2).constData())))}; - ui->decodedTextBrowser->displayDecodedText (decodedtextJT, m_config.my_callsign (), m_mode, m_config.DXCC (), - m_logBook, m_currentBandPeriod, m_config.ppfx (), - ui->cbCQonly->isVisible() && ui->cbCQonly->isChecked(), - haveFSpread, fSpread, bDisplayPoints, m_points, distance, m_muted); - } else { - if (ui->actionHide_AP_info->isVisible() && ui->actionHide_AP_info->isChecked()) { - // Hide FT8 AP information - DecodedText decodedtext2 {(QString::fromUtf8(line_read.replace("a1","").replace("a2","").replace("a3","").replace("a4","") - .replace("a5","").replace("a6","").replace("a7","").replace("a8","").replace("a9","").replace("?","")))}; - ui->decodedTextBrowser->displayDecodedText (decodedtext2, m_config.my_callsign (), m_mode, m_config.DXCC (), - m_logBook, m_currentBandPeriod, m_config.ppfx (), - ui->cbCQonly->isVisible() && ui->cbCQonly->isChecked(), - haveFSpread, fSpread, bDisplayPoints, m_points, distance, m_muted); - } else { - ui->decodedTextBrowser->displayDecodedText (decodedtext1, m_config.my_callsign (), m_mode, m_config.DXCC (), - m_logBook, m_currentBandPeriod, m_config.ppfx (), - ui->cbCQonly->isVisible() && ui->cbCQonly->isChecked(), - haveFSpread, fSpread, bDisplayPoints, m_points, distance, m_muted); - } - } + if (DecodeOutputPlan::shouldDisplayLeft(bAvgMsg, decodeContext.mode, + decodeContext.specOp, filtered, + m_config.filters_for_Wait_and_Pounce_only())) { + QString distance = calculateDistanceAndBearing(decodedtext); + displayDecodedTextLine(decodedtext1, line_read, distance, haveFSpread, fSpread, bDisplayPoints); if(m_position != 0) ui->decodedTextBrowser->horizontalScrollBar()->setValue(m_position); } - if (m_mode=="FT8" && ((m_multithreadFT8 && m_ft8DecoderStart<2) or m_freqNominal>45000000)) earlyDecodes.append(line_read); //ft8md - - // highlight callsigns worked B4 on band or worked today - if(ui->actionHighlightB4->isChecked() or ui->actionHighlightToday->isChecked() or ui->actionHighlightIgnored->isChecked() - or ui->actionHighlightTerritory1->isChecked() or ui->actionHighlightTerritory2->isChecked() - or ui->actionHighlightTerritory3->isChecked() or ui->actionHighlightTerritory4->isChecked()) { - QString today = QDateTime::currentDateTimeUtc().toString ("yyyy-MM-dd"); - QString yesterday = QDateTime::currentDateTimeUtc().addDays(-1).toString ("yyyy-MM-dd"); - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(/*out*/deCall,deGrid); - bool callB4onBand; - bool countryB4onBand; - bool gridB4onBand; - bool continentB4onBand; - bool CQZoneB4onBand; - bool ITUZoneB4onBand; - if (ui->actionHighlightB4->isChecked()) { - auto const& looked_up = m_logBook.countries ()->lookup (deCall); - m_logBook.match (deCall, m_mode, deGrid, looked_up, callB4onBand, countryB4onBand, gridB4onBand, - continentB4onBand, CQZoneB4onBand, ITUZoneB4onBand, m_currentBand); - if (callB4onBand) ui->decodedTextBrowser->highlight_callsign(deCall, QColor(195,195,195), QColor(0,0,0), true); - } - if (ui->actionHighlightToday->isChecked() && ( - txLog.contains(QRegularExpression{today + ",[0-9][0-9]:[0-9][0-9]:[0-9][0-9]," + (deCall + ",")}) - or (m_config.twoDays() && txLog.contains(QRegularExpression{yesterday + ",[0-9][0-9]:[0-9][0-9]:[0-9][0-9]," + (deCall + ",")})))) { - ui->decodedTextBrowser->highlight_callsign(deCall, QColor(100,100,100), QColor(255,255,0), true); - } - if (ui->actionHighlightIgnored->isChecked() && ignoreList.contains(deCall + ",")) { - ui->decodedTextBrowser->highlight_callsign(deCall, QColor(85,0,0), QColor(255,255,0), true); - } - // search for country names - if (ui->actionHighlightTerritory1->isChecked() or ui->actionHighlightTerritory2->isChecked() or - ui->actionHighlightTerritory3->isChecked() or ui->actionHighlightTerritory4->isChecked()) { - auto const& looked_up = m_logBook.countries ()->lookup (deCall); - auto countryName = looked_up.entity_name; - // do some obvious abbreviations - countryName.replace ("Islands", "Is."); - countryName.replace ("Island", "Is."); - countryName.replace ("North ", "N. "); - countryName.replace ("Northern ", "N. "); - countryName.replace ("South ", "S. "); - countryName.replace ("East ", "E. "); - countryName.replace ("Eastern ", "E. "); - countryName.replace ("West ", "W. "); - countryName.replace ("Western ", "W. "); - countryName.replace ("Central ", "C. "); - countryName.replace (" and ", " & "); - countryName.replace ("Republic", "Rep."); - countryName.replace ("United States of America", "U.S.A."); - countryName.replace ("United States", "U.S.A."); - countryName.replace ("Fed. Rep. of ", ""); - countryName.replace ("French ", "Fr."); - countryName.replace ("Asiatic", "AS"); - countryName.replace ("European", "EU"); - countryName.replace ("African", "AF"); - if (ui->actionHighlightTerritory1->isChecked() && countryName.contains(m_config.Territory1()) - && (m_config.Territory1()!="") && !ui->cbBypass->isChecked()) ui->decodedTextBrowser->highlight_callsign(deCall, QColor(115,43,245), QColor(255,255,255), true); - if (ui->actionHighlightTerritory2->isChecked() && countryName.contains(m_config.Territory2()) - && (m_config.Territory2()!="") && !ui->cbBypass->isChecked()) ui->decodedTextBrowser->highlight_callsign(deCall, QColor(115,43,245), QColor(255,255,255), true); - if (ui->actionHighlightTerritory3->isChecked() && countryName.contains(m_config.Territory3()) - && (m_config.Territory3()!="") && !ui->cbBypass->isChecked()) ui->decodedTextBrowser->highlight_callsign(deCall, QColor(115,43,245), QColor(255,255,255), true); - if (ui->actionHighlightTerritory4->isChecked() && countryName.contains(m_config.Territory4()) - && (m_config.Territory4()!="") && !ui->cbBypass->isChecked()) ui->decodedTextBrowser->highlight_callsign(deCall, QColor(115,43,245), QColor(255,255,255), true); - } - } + if (m_mode=="FT8" && ((m_multithreadFT8 && m_ft8DecoderStart<2) or m_operatingFrequency.rx ()>45000000)) earlyDecodes.append(line_read); //ft8md + + applyHighlighting(decodedtext, ui->decodedTextBrowser, true, play_Wanted, play_DXcall); if((m_mode=="FT4" or m_mode=="FT8") and bDisplayPoints and decodedtext1.isStandardMessage()) { QString deCall,deGrid; @@ -7016,121 +6979,8 @@ void MainWindow::readFromStdout() //readFromStdout if(bWorkedOnBand) activeWorked(deCall,m_currentBand); } - // CQ: First - if(((pounce && text.contains(" CQ ") && m_config.Wait_features_enabled()) - or (m_auto && m_bCallingCQ && text.contains(" " + m_config.my_callsign() + " "))) && !ignored - && !filtered && !selected && ui->respondComboBox->isVisible() && ui->respondComboBox->currentText()=="CQ: First" - && (!(ui->actionFull_Duplex_Mode->isChecked() && m_txing))) { - m_bDoubleClicked=true; - selected = true; - auto_tx_mode(true); - processMessage(decodedtext0); - auto now = QDateTime::currentDateTimeUtc(); - m_dateTimeQSOOn = now.addSecs (-(m_ntx - 1) * int(m_TRperiod) - int(fmod(double(now.time().second()),m_TRperiod))); - QTimer::singleShot (6000, [=] {selected = false;}); - if (pounce) stopWCTimer.start(int(6200.0*m_TRperiod)); // Tx max 6*TRperiod - } - - // CQ: Max Dist - if((pounce or m_auto) && ui->respondComboBox->isVisible() && ui->respondComboBox->currentText()=="CQ: Max Dist" - && (!(ui->actionFull_Duplex_Mode->isChecked() && m_txing))) { - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(/*out*/deCall,deGrid); - if (!filtered && !ignored && (deGrid.contains(grid_regexp) or m_bCallingCQ) && ( - (pounce && text.contains(" CQ ") && !txLog.contains(deCall) && m_config.Wait_features_enabled()) or - (m_bCallingCQ && text.contains(" " + m_config.my_callsign() + " ") && !text.contains("73 ")) - )) { - double utch=0.0; - int nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter; - azdist_(const_cast ((m_config.my_grid () + " ").left (6).toLatin1().constData()), - const_cast ((deGrid + " ").left (6).toLatin1().constData()),&utch, - &nAz,&nEl,&nDmiles,&nDkm,&nHotAz,&nHotABetter,6,6); - Dpoints=nDkm; - if (!deGrid.contains(grid_regexp)) Dpoints=1; - if(Dpoints>maxDPoints) { - maxDPoints=Dpoints; - m_deCall=deCall; - m_bDoubleClicked=true; - if ((pounce && text.contains(" CQ ") && m_config.Wait_features_enabled()) or m_auto) { - auto_tx_mode(true); - processMessage(decodedtext0); - if (pounce) stopWCTimer.start(int(6200.0*m_TRperiod)); // Tx max 6*TRperiod - } - ui->dxCallEntry->setText(deCall); - genStdMsgs(QString::number(decodedtext.snr())); - ui->RxFreqSpinBox->setValue(decodedtext.frequencyOffset()); - setTxMsg(m_ntx); - m_currentMessageType=m_ntx; - auto now = QDateTime::currentDateTimeUtc(); - m_dateTimeQSOOn = now.addSecs (-(m_ntx - 1) * int(m_TRperiod) - int(fmod(double(now.time().second()),m_TRperiod))); - } - } - } - - // CQ: Max dB - if((pounce or m_auto) && ui->respondComboBox->isVisible() && ui->respondComboBox->currentText()=="CQ: Max dB" - && (!(ui->actionFull_Duplex_Mode->isChecked() && m_txing))) { - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(/*out*/deCall,deGrid); - if (!filtered && !ignored && ( - (pounce && text.contains(" CQ ") && !txLog.contains(deCall) && m_config.Wait_features_enabled()) or - (m_bCallingCQ && text.contains(" " + m_config.my_callsign() + " ") && !text.contains("73 ")) - )) { - dBpoints=decodedtext.string().mid(7,3).toInt(); - if(dBpoints>maxdBPoints) { - maxdBPoints=dBpoints; - m_deCall=deCall; - m_bDoubleClicked=true; - if ((pounce && text.contains(" CQ ") && m_config.Wait_features_enabled()) or m_auto) { - auto_tx_mode(true); - processMessage(decodedtext0); - if (pounce) stopWCTimer.start(int(6200.0*m_TRperiod)); // Tx max 6*TRperiod - } - ui->dxCallEntry->setText(deCall); - genStdMsgs(QString::number(decodedtext.snr())); - ui->RxFreqSpinBox->setValue(decodedtext.frequencyOffset()); - setTxMsg(m_ntx); - m_currentMessageType=m_ntx; - auto now = QDateTime::currentDateTimeUtc(); - m_dateTimeQSOOn = now.addSecs (-(m_ntx - 1) * int(m_TRperiod) - int(fmod(double(now.time().second()),m_TRperiod))); - QTimer::singleShot (6000, [=] {selected = false;}); - } - } - } - - // CQ: Min dB - if((pounce or m_auto) && ui->respondComboBox->isVisible() && ui->respondComboBox->currentText()=="CQ: Min dB" - && (!(ui->actionFull_Duplex_Mode->isChecked() && m_txing))) { - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(/*out*/deCall,deGrid); - if (!filtered && !ignored && ( - (pounce && text.contains(" CQ ") && !txLog.contains(deCall) && m_config.Wait_features_enabled()) or - (m_bCallingCQ && text.contains(" " + m_config.my_callsign() + " ") && !text.contains("73 ")) - )) { - dBpoints2=decodedtext.string().mid(7,3).toInt(); - if(dBpoints2dxCallEntry->setText(deCall); - genStdMsgs(QString::number(decodedtext.snr())); - ui->RxFreqSpinBox->setValue(decodedtext.frequencyOffset()); - setTxMsg(m_ntx); - m_currentMessageType=m_ntx; - auto now = QDateTime::currentDateTimeUtc(); - m_dateTimeQSOOn = now.addSecs (-(m_ntx - 1) * int(m_TRperiod) - int(fmod(double(now.time().second()),m_TRperiod))); - QTimer::singleShot (6000, [=] {selected = false;}); - } - } - } + updateRespondTarget(decodedtext0, text, pounce, decodeContext.sequenceStart, + decodeContext.diskData); // Ensure that Tx stops and QSO is logged when repeat_Tx is enabled and "73" is received if(m_config.repeat_Tx() && m_mode=="Q65" && m_hisCall!="" && text.contains(m_baseCall) && text.contains(m_hisCall + " 73 ")) { @@ -7138,107 +6988,8 @@ void MainWindow::readFromStdout() //readFromStdout cease_auto_Tx_after_QSO(); } - // highlight orange and blue callsigns - if (m_config.highlight_orange() or (m_config.highlight_blue()) or ui->actionHighlight_Whitelist_entries->isChecked()) { - QString deCall; - QString deGrid; - decodedtext.deCallAndGrid(/*out*/deCall,deGrid); - if (m_config.highlight_orange() && deCall.size()>2 && (m_config.highlight_orange_callsigns().contains(deCall + ",") - or m_config.highlight_orange_callsigns().contains(deCall.left(3) + ";") or m_config.highlight_orange_callsigns().contains(deCall.left(2) + ";"))) { - ui->decodedTextBrowser->highlight_callsign(deCall, QColor(225,75,0), QColor(255,255,255), true); - if (m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted) play_Wanted = true; - } - if (m_config.highlight_orange() && deGrid.size()>3 && m_config.highlight_orange_callsigns().contains(deGrid)) { - ui->decodedTextBrowser->highlight_callsign(deGrid, QColor(225,75,0), QColor(255,255,255), true); - if (m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted) play_Wanted = true; - } - if (m_config.highlight_blue() && deCall.size()>2 && (m_config.highlight_blue_callsigns().contains(deCall + ",") - or m_config.highlight_blue_callsigns().contains(deCall.left(3) + ";") or m_config.highlight_blue_callsigns().contains(deCall.left(2) + ";"))) { - ui->decodedTextBrowser->highlight_callsign(deCall, QColor(0,100,255), QColor(255,255,255), true); - if (m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted) play_Wanted = true; - } - if (m_config.highlight_blue() && deGrid.size()>3 && m_config.highlight_blue_callsigns().contains(deGrid)) { - ui->decodedTextBrowser->highlight_callsign(deGrid, QColor(0,100,255), QColor(255,255,255), true); - if (m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted) play_Wanted = true; - } - // highlight directional calls - if (tw.size () > 2) { - if (m_config.highlight_orange() && tw[0]=="CQ" && m_config.highlight_orange_callsigns().contains("," + tw[1] + ",")) { - ui->decodedTextBrowser->highlight_callsign(tw[1], QColor(225,75,0), QColor(255,255,255), true); - if (m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted && tw[1]!="") play_Wanted = true; - } - if (m_config.highlight_blue() && tw[0]=="CQ" && m_config.highlight_blue_callsigns().contains("," + tw[1] + ",")) { - ui->decodedTextBrowser->highlight_callsign(tw[1], QColor(0,100,255), QColor(255,255,255), true); - if (m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted && tw[1]!="") play_Wanted = true; - } - } - // highlight Whitelist entries - if (ui->actionHighlight_Whitelist_entries->isChecked() && deCall.size()>2 && - ((deCall.contains(m_config.Whitelist1()) && m_config.Whitelist1() != "") - or (deCall.contains(m_config.Whitelist2()) && m_config.Whitelist2() != "") - or (deCall.contains(m_config.Whitelist3()) && m_config.Whitelist3() != "") - or (deCall.contains(m_config.Whitelist4()) && m_config.Whitelist4() != "") - or (deCall.contains(m_config.Whitelist5()) && m_config.Whitelist5() != "") - or (deCall.contains(m_config.Whitelist6()) && m_config.Whitelist6() != "") - or (deCall.contains(m_config.Whitelist7()) && m_config.Whitelist7() != "") - or (deCall.contains(m_config.Whitelist8()) && m_config.Whitelist8() != "") - or (deCall.contains(m_config.Whitelist9()) && m_config.Whitelist9() != "") - or (deCall.contains(m_config.Whitelist10()) && m_config.Whitelist10() != "") - or (deCall.contains(m_config.Whitelist11()) && m_config.Whitelist11() != "") - or (deCall.contains(m_config.Whitelist12()) && m_config.Whitelist12() != ""))) { - ui->decodedTextBrowser->highlight_callsign(deCall, QColor(170,0,127), QColor(255,255,255), true); - if (m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted) play_Wanted = true; - } - } - - // Highlight DX Call/Grid - if (!pounce && (m_config.highlight_DXcall() or m_config.alert_Enabled()) && (m_hisCall != "") && - ((decodedtext.string().contains(QRegularExpression{"(\\w+) " + m_hisCall})) - || (decodedtext.string().contains(QRegularExpression{"(\\w+) <" + m_hisCall + ">"})) - || (decodedtext.string().contains(QRegularExpression{"<(\\w+)> " + m_hisCall})) - || (decodedtext.string().contains(QRegularExpression{"<...> " + m_hisCall})))) { - if (m_config.alert_Enabled() && m_config.alert_DXcall() && !m_muted) play_DXcall = true; - if (m_config.highlight_DXcall()) { - // repeated highlighting to override JTAlert - ui->decodedTextBrowser->highlight_callsign(m_hisCall, QColor(255,0,0), QColor(255,255,255), true); - QTimer::singleShot (500, [=] {ui->decodedTextBrowser->highlight_callsign(m_hisCall, QColor(255,0,0), QColor(255,255,255), true);}); - QTimer::singleShot (1000, [=] {ui->decodedTextBrowser->highlight_callsign(m_hisCall, QColor(255,0,0), QColor(255,255,255), true);}); - QTimer::singleShot (2500, [=] {ui->decodedTextBrowser->highlight_callsign(m_hisCall, QColor(255,0,0), QColor(255,255,255), true);}); - } - } - if (!pounce && (m_config.highlight_DXgrid () or m_config.alert_Enabled()) && (m_hisGrid!="") && - (decodedtext.string().contains(m_hisGrid.left(4)))) { - if (m_config.highlight_DXgrid()) ui->decodedTextBrowser->highlight_callsign(m_hisGrid.left(4), QColor(0,0,200), QColor(255,255,255), true); - if (m_config.alert_Enabled() && m_config.alert_DXcall() && !m_muted) play_DXcall = true; - } - QTimer::singleShot (100, [=] { - if (m_config.alert_Enabled() && ((m_config.alert_DXcall() && play_DXcall && m_hisCall!="") or (m_config.alert_Wanted() && play_Wanted))) { -#ifdef WIN32 - QAudioOutput info(QAudioDeviceInfo::defaultOutputDevice()); - QString audioPath = app_sounds_directory (m_config.voicesPath()); - QAudioFormat format; - format.setCodec("audio/pcm"); - format.setSampleRate (48000); - format.setChannelCount (1); - format.setSampleSize (16); - format.setSampleType(QAudioFormat::SignedInt); - QAudioOutput* audio; - audio = new QAudioOutput(format, this); - connect(audio, SIGNAL(stateChanged(QAudio::State)), this, SLOT(handleStateChanged(QAudio::State))); - QFile *effect1 = new QFile(this); - if (m_config.alert_DXcall() && play_DXcall) effect1->setFileName(QString("%1/%2").arg(audioPath, "DXcall.wav")); - else if (m_config.alert_Wanted() && play_Wanted) effect1->setFileName(QString("%1/%2").arg(audioPath, "Wanted.wav")); - effect1->open(QIODevice::ReadOnly); - audio->start(effect1); -#else - QString audioPath = app_sounds_directory (m_config.voicesPath()); - if (m_config.alert_DXcall() && play_DXcall) QSound::play(audioPath + "DXcall.wav"); // for Linux and macOS - else if (m_config.alert_Wanted() && play_Wanted) QSound::play(audioPath + "Wanted.wav"); // for Linux and macOS -#endif - play_DXcall = false; - play_Wanted = false; - } - }); + playDecodeAlertSound(play_Wanted, play_DXcall); + play_Wanted = play_DXcall = false; if (m_bBestSPArmed && m_mode=="FT4" && CALLING == m_QSOProgress && !ignored && !filtered) { QString messagePriority=ui->decodedTextBrowser->CQPriority(); @@ -7249,7 +7000,7 @@ void MainWindow::readFromStdout() //readFromStdout and (!(ui->actionFull_Duplex_Mode->isChecked() && m_txing))) { m_BestCQpriority="New Call on Band"; m_bDoubleClicked = true; - processMessage(decodedtext0); + processSyntheticMessage(decodedtext0); } if (messagePriority=="New DXCC" and m_BestCQpriority!="New DXCC" @@ -7257,7 +7008,7 @@ void MainWindow::readFromStdout() //readFromStdout and (!(ui->actionFull_Duplex_Mode->isChecked() && m_txing))) { m_BestCQpriority="New DXCC"; m_bDoubleClicked = true; - processMessage(decodedtext0); + processSyntheticMessage(decodedtext0); } } } @@ -7265,101 +7016,76 @@ void MainWindow::readFromStdout() //readFromStdout } //Right (Rx Frequency) window - bool bDisplayRight=bAvgMsg; - int audioFreq=decodedtext.frequencyOffset(); - if(m_mode=="FT8" or m_mode=="FT4" or m_mode=="FST4" or m_mode=="Q65") { - int ftol=10; - if(m_mode=="Q65") ftol=ui->sbFtol->value(); - auto const& parts = decodedtext.string().remove("<").remove(">") - .split (' ', SkipEmptyParts); - if (parts.size() > 6) { - auto for_us = parts[5].contains (m_baseCall) - || ("DE" == parts[5] && qAbs (ui->RxFreqSpinBox->value () - audioFreq) <= ftol); - if(m_baseCall == m_config.my_callsign()) { - if (m_baseCall != parts[5]) for_us=false; - } else { - if (m_config.my_callsign () != parts[5]) { -// Same base call as ours but different prefix or suffix. Rare but can happen with -// multi-station special events. - for_us = false; - } - } - - // Reply also to averaged messages that are only displayed in the right window - if(m_bCallingCQ && !m_bAutoReply && for_us && m_specOp!=SpecOp::FOX && m_specOp!=SpecOp::HOUND - && ui->actionInclude_averaging->isVisible() && ui->actionInclude_averaging->isChecked()) { - bool bProcessMsgNormally=ui->respondComboBox->currentText()!="CQ: None" or - (m_ActiveStationsWidget!=NULL and !m_ActiveStationsWidget->isVisible()); - if (decodedtext.messageWords().length() >= 3) { - QString t=decodedtext.messageWords()[2]; - if(t.contains("R+") or t.contains("R-") or t=="R" or t=="RRR" or t=="RR73") bProcessMsgNormally=true; - } else { - bProcessMsgNormally=true; - } - if(bProcessMsgNormally) { - m_bDoubleClicked=true; - m_bAutoReply = true; - processMessage (decodedtext); - } - } - - if(SpecOp::FOX==m_specOp and decodedtext.string().contains(" DE ")) for_us=true; //Hound with compound callsign - if(SpecOp::FOX==m_specOp and for_us and decodedtext.string().contains(QRegularExpression{" R\\W\\d"})) bDisplayRight=true; - if(SpecOp::FOX!=m_specOp and (for_us or (abs(audioFreq - m_wideGraph->rxFreq()) <= 10))) bDisplayRight=true; - if(SpecOp::HOUND==m_specOp and !for_us) bDisplayRight=false; - - // Give the Fox a warning when there is probably another Fox on the frequency - if(SpecOp::FOX==m_specOp and audioFreq<1000 and !for_us and decodedtext.string().contains(QRegularExpression{" R\\W\\d"})) { - if (first_Fox_alert) { - first_Fox_alert = false; - QTimer::singleShot (120000, [=] {first_Fox_alert = true;}); // Reset after 2 minutes - } else { - if (second_Fox_alert) { - second_Fox_alert = false; - QTimer::singleShot (300000, [=] {second_Fox_alert = true;}); // Reset after 5 minutes - } else { - if (!no_Fox_alert) { - MessageBox::warning_message (this, - "Looks like another fox is working on this frequency.\n\n" - "Stop transmitting, exit Fox mode for a few minutes,\n" - "and check the incoming FT8 messages."); - no_Fox_alert = true; - QTimer::singleShot (3600000, [=] { // No further Fox warnings for 60 minutes - no_Fox_alert = false; - first_Fox_alert = true; - second_Fox_alert = true; - }); - } - } - } - } - - } - } else { - if((abs(audioFreq - m_wideGraph->rxFreq()) <= 10) and - !m_config.enable_VHF_features()) bDisplayRight=true; - } - if(m_mode=="Q65" and !bAvgMsg and !decodedtext.string().contains(m_baseCall)) bDisplayRight=false; - if((m_mode=="JT4" or m_mode=="Q65" or m_mode=="JT65") and decodedtext.string().contains(m_baseCall) && ui->actionInclude_averaging->isVisible() && !ui->actionInclude_averaging->isChecked()) bDisplayRight=true; - if((m_mode=="FT8" or m_mode=="FT4") and SpecOp::FOX!=m_specOp && decodedtext0.string().replace("<","").replace(">","").contains(m_baseCall + " " + m_hisCall)) bDisplayRight=true; // really all messages for us - - // AutoSeq for JT65/JT4 short messages - if ((m_mode=="JT65" or m_mode=="JT4") && m_auto && m_config.enable_VHF_features() && ui->cbShMsgs->isChecked() && ui->cbAutoSeq->isChecked () && (abs(audioFreq - m_wideGraph->rxFreq()) <= 15)) { - if (decodedtext.string().contains(" " + m_config.my_callsign() + " ") && decodedtext.string().contains(" OOO")) { - setTxMsg(3); - } - if (decodedtext.string().contains(" RO")) { - setTxMsg(4); + DecodeOutputPlan::RoutingContext routingContext; + routingContext.mode = decodeContext.mode; + routingContext.specOp = decodeContext.specOp; + routingContext.myCall = decodeContext.myCall; + routingContext.baseCall = Radio::base_callsign (decodeContext.myCall); + routingContext.hisCall = m_hisCall; + routingContext.rxFrequency = ui->RxFreqSpinBox->value(); + routingContext.wideGraphRxFrequency = m_wideGraph->rxFreq(); + routingContext.q65Tolerance = ui->sbFtol->value(); + routingContext.enableVhfFeatures = m_config.enable_VHF_features(); + routingContext.includeAveragingVisible = ui->actionInclude_averaging->isVisible(); + routingContext.includeAveraging = ui->actionInclude_averaging->isChecked(); + routingContext.blockRightDisplay = block_right_display; + auto const routingDecision = + DecodeOutputPlan::decideRouting(decodedtext0, decodedtext, bAvgMsg, routingContext); + bool const bDisplayRight = routingDecision.displayRight; + bool const for_us = routingDecision.forUs; + + // Reply also to averaged messages that are only displayed in the right window + if(m_bCallingCQ && !m_bAutoReply && for_us && m_specOp!=SpecOp::FOX && m_specOp!=SpecOp::HOUND + && ui->actionInclude_averaging->isVisible() && ui->actionInclude_averaging->isChecked()) { + bool bProcessMsgNormally=autoRespondPolicy () != AutoRespondPolicy::None or + (m_ActiveStationsWidget!=NULL and !m_ActiveStationsWidget->isVisible()); + if (decodedtext.messageWords().length() >= 3) { + QString t=decodedtext.messageWords()[2]; + if(t.contains("R+") or t.contains("R-") or t=="R" or t=="RRR" or t=="RR73") bProcessMsgNormally=true; + } else { + bProcessMsgNormally=true; } - if (decodedtext.string().contains(" RRR")) { - setTxMsg(5); + if(bProcessMsgNormally) { + m_bDoubleClicked=true; + m_bAutoReply = true; + processSyntheticMessage(decodedtext); } - if (decodedtext.string().contains(" 73")) { - setTxMsg(5); + } + + // Give the Fox a warning when there is probably another Fox on the frequency + if (routingDecision.competingFoxReport) { + if (first_Fox_alert) { + first_Fox_alert = false; + QTimer::singleShot (120000, this, [=] {first_Fox_alert = true;}); + } else if (second_Fox_alert) { + second_Fox_alert = false; + QTimer::singleShot (300000, this, [=] {second_Fox_alert = true;}); + } else if (!no_Fox_alert) { + MessageBox::warning_message (this, + "Looks like another fox is working on this frequency.\n\n" + "Stop transmitting, exit Fox mode for a few minutes,\n" + "and check the incoming FT8 messages."); + no_Fox_alert = true; + QTimer::singleShot (3600000, this, [=] { + no_Fox_alert = false; + first_Fox_alert = true; + second_Fox_alert = true; + }); } } + if ((m_mode == "JT65" || m_mode == "JT4") && m_auto + && m_config.enable_VHF_features() && ui->cbShMsgs->isChecked() + && ui->cbAutoSeq->isChecked()) { + auto shortMessageSnapshot = qsoReactionSnapshot(); + shortMessageSnapshot.rxFrequency = m_wideGraph->rxFreq(); + applyQsoReactionPlan( + DecodedMessageReaction::planAutoSequence( + decodedtext, shortMessageSnapshot, + DecodedMessageReaction::AutoSequencePhase::LegacyShortMessage, 15, 15), + decodedtext); + } - if (bDisplayRight && !block_right_display) { + if (bDisplayRight) { // This msg is within 10 hertz of our tuned frequency, or a JT4 or JT65 avg, or contains MyCall if(!pounce && (!m_bBestSPArmed or m_mode!="FT4")) { @@ -7375,29 +7101,28 @@ void MainWindow::readFromStdout() //readFromStdout if (m_config.alert_Enabled() && ui->actionInclude_averaging->isVisible() && ui->actionInclude_averaging->isChecked()) ui->decodedTextBrowser->new_period (); // ensure alerts are played ui->decodedTextBrowser2->displayDecodedText (decodedtext0, m_config.my_callsign (), m_mode, m_config.DXCC (), m_logBook, m_currentBand, m_config.ppfx (), false, false, 0.0, bDisplayPoints, m_points, "", m_muted); + applyHighlighting(decodedtext, ui->decodedTextBrowser2, false, play_Wanted, play_DXcall); } m_QSOText = decodedtext.string ().trimmed (); } - if (!blockUDP) // block udp spotting for false decodes (JTAlert) postDecode (true, decodedtext.string ()); if(m_mode=="FT8" and SpecOp::HOUND==m_specOp) { if(decodedtext.string().contains(";")) { QString text = decodedtext.string().remove("<").remove(">"); // needed for MSHV multistream messages QStringList w=text.mid(24).split(" ",SkipEmptyParts); - QString foxCall=w.at(3); - if(w.at(0)==m_config.my_callsign() or w.at(0)==Radio::base_callsign(m_config.my_callsign())) { - //### Check for ui->dxCallEntry->text()==foxCall before logging! ### - ui->stopTxButton->click (); - logQSOTimer.start(0); - } - if((w.at(2)==m_config.my_callsign() or w.at(2)==Radio::base_callsign(m_config.my_callsign())) - and ui->tx3->text().length()>0) { - m_rptRcvd=w.at(4); - m_rptSent=decodedtext.string().mid(7,3); - m_nFoxFreq=decodedtext.string().mid(16,4).toInt(); - hound_reply (); + if(w.size() >= 5) { + if(w.at(0)==m_config.my_callsign() or w.at(0)==Radio::base_callsign(m_config.my_callsign())) { + ui->stopTxButton->click (); + logQSOTimer.start(0); + } + if((w.at(2)==m_config.my_callsign() or w.at(2)==Radio::base_callsign(m_config.my_callsign())) + and ui->tx3->text().length()>0) { + m_rptRcvd=w.at(4); + m_rptSent=decodedtext.string().mid(7,3); + hound_reply (decodedtext.string().mid(16,4).toInt()); + } } } else { QString text = decodedtext.string().remove("<").remove(">"); // needed for MSHV multistream messages @@ -7415,11 +7140,10 @@ void MainWindow::readFromStdout() //readFromStdout (w.at(2).mid(0,1)=="+" or w.at(2).mid(0,1)=="-")) { m_rptRcvd=w.at(2); m_rptSent=decodedtext.string().mid(7,3); - m_nFoxFreq=decodedtext.string().mid(16,4).toInt(); - hound_reply (); + hound_reply (decodedtext.string().mid(16,4).toInt()); } else { - if (SpecOp::HOUND==m_specOp && (text.mid(4,2).contains("15") or text.mid(4,2).contains("45"))) return; // ignore stations calling in the wrong time slot - if (text.contains(" " + m_config.my_callsign() + " " + m_hisCall) && !text.contains("73 ")) processMessage(decodedtext0); // needed for MSHV multistream messages + if (SpecOp::HOUND==m_specOp && (text.mid(4,2).contains("15") or text.mid(4,2).contains("45"))) return; + if (text.contains(" " + m_config.my_callsign() + " " + m_hisCall) && !text.contains("73 ")) processSyntheticMessage(decodedtext0); // needed for MSHV multistream messages } } } @@ -7455,34 +7179,63 @@ void MainWindow::readFromStdout() //readFromStdout } } // extract details and send to PSKreporter - int nsec=QDateTime::currentMSecsSinceEpoch()/1000-m_secBandChanged; - bool okToPost=(nsec > int(4*m_TRperiod)/5); - if(m_mode=="FST4W" and okToPost) { - line_read=line_read.left(22) + " CQ " + line_read.trimmed().mid(22); - auto p = line_read.lastIndexOf (' '); - DecodedText FST4W_post {QString::fromUtf8 (line_read.left (p).constData ())}; - pskPost(FST4W_post); - } else { - if (stdMsg && okToPost) pskPost(decodedtext); + bool const okToPost = + QDateTime::currentMSecsSinceEpoch()/1000-m_secBandChanged > int(4*m_TRperiod)/5; + if (DecodeOutputPlan::shouldPostPsk(decodeContext.mode, decodeContext.specOp, + decodeContext.superFox, + stdMsg, okToPost)) { + if(m_mode=="FST4W") { + line_read=line_read.left(22) + " CQ " + line_read.trimmed().mid(22); + auto p = line_read.lastIndexOf (' '); + DecodedText FST4W_post {QString::fromUtf8 (line_read.left (p).constData ())}; + pskPost(FST4W_post, decodeContext); + } else { + pskPost(decodedtext, decodeContext); + } } - if((m_mode=="JT4" or m_mode=="JT65" or m_mode=="Q65") and - m_msgAvgWidget!=NULL) { - if(m_msgAvgWidget->isVisible()) { - QFile f(m_config.temp_dir ().absoluteFilePath ("avemsg.txt")); - if(f.open(QIODevice::ReadOnly | QIODevice::Text)) { - QTextStream s(&f); - QString t=s.readAll(); - if (t != NULL) m_msgAvgWidget->displayAvg(t); - else qDebug() << "tmp==NULL at s.readAll"; - } + if((m_mode=="JT4" or m_mode=="JT65" or m_mode=="Q65") + and m_msgAvgWidget and m_msgAvgWidget->isVisible()) { + QFile f(m_config.temp_dir ().absoluteFilePath ("avemsg.txt")); + if(f.open(QIODevice::ReadOnly | QIODevice::Text)) { + QTextStream s(&f); + QString t=s.readAll(); + if (t != NULL) m_msgAvgWidget->displayAvg(t); + else qDebug() << "tmp==NULL at s.readAll"; } } } } + }); + auto const batchActions = DecodeOutputPlan::finishBatchActions( + decodeContext.mode, decodeContext.specOp, + m_ActiveStationsWidget != nullptr, all_decodes); + for (auto const& action : batchActions) { + if (action.kind == DecodeOutputPlan::ActionKind::FlushFoxActivity) { + m_ActiveStationsWidget->addLine(action.text); + } } - if (m_mode == "FT8" and m_specOp == SpecOp::FOX and m_ActiveStationsWidget != NULL) { - m_ActiveStationsWidget->addLine(all_decodes); - } + if (decodeCompleted && DecodeOwner::Jt9 == m_decodeOwner) + { + if (m_activeJt9Decode.obsolete) + { + abortJt9Transaction (); + } + else + { + m_ft8MtdDecodeCoordinator.completed ( + m_activeJt9Decode.ft8Stage, m_activeJt9Decode.ft8Period); + m_decoderCompletedSinceStart = true; + m_jt9PayloadValid = m_jt9PayloadValid || m_activeJt9Decode.copiedSamples; + m_activeJt9Decode = {}; + finishDecodeUi (); + endDecode (DecodeOwner::Jt9); + } + auto const pendingResult = publishPendingFt8Decode (); + if (DecodePublishResult::Failed == pendingResult) + { + requestDecoderRestart ("pending FT8 decode publication failed"); + } + } } // @@ -7493,142 +7246,55 @@ void MainWindow::readFromStdout() //readFromStdout // another caller and we are going to transmit within // +/- this value of the reply to another caller // -void MainWindow::auto_sequence (DecodedText const& message, unsigned start_tolerance, unsigned stop_tolerance) -{ - auto const& message_words = message.messageWords (); - auto is_73 = message_words.filter (QRegularExpression {"^(73|RR73)$"}).size(); - auto msg_no_hash = message.clean_string(); - msg_no_hash = msg_no_hash.mid(22).remove("<").remove(">"); - bool is_OK=false; - if(m_mode=="MSK144" && msg_no_hash.indexOf(ui->dxCallEntry->text()+" R ")>0) is_OK=true; - if (message_words.size () > 3 && (message.isStandardMessage() || (is_73 or is_OK))) { - auto df = message.frequencyOffset (); - auto within_tolerance = (qAbs (ui->RxFreqSpinBox->value () - df) <= int (start_tolerance) - || qAbs (ui->TxFreqSpinBox->value () - df) <= int (start_tolerance)); - bool acceptable_73 = is_73 - && m_QSOProgress >= ROGER_REPORT - && ((message.isStandardMessage () - && (message_words.contains (m_baseCall) - || message_words.contains (m_config.my_callsign ()) - || message_words.contains (ui->dxCallEntry->text ()) - || message_words.contains (Radio::base_callsign (ui->dxCallEntry->text ())) - || message_words.contains ("DE"))) - || (!message.isStandardMessage () && m_mode != "MSK144")); // free text 73/RR73 except for MSK - - auto const& w = msg_no_hash.split(" ",SkipEmptyParts); - QString w2; - int nrpt=0; - if (w.size () > 2) - { - w2=w.at(2); - if(w.size()>3) { - nrpt=w2.toInt(); - if(w2=="R") nrpt=w.at(3).toInt(); - } - } - bool bEU_VHF=(nrpt>=520001 and nrpt<=594000); - if(bEU_VHF and message.clean_string ().contains("<"+m_config.my_callsign() + "> ")) { - m_xRcvd=message.clean_string ().trimmed().right(13); - } - if (m_auto - && (m_QSOProgress==REPLYING or (!ui->tx1->isEnabled () and m_QSOProgress==REPORT)) - && SpecOp::HOUND != m_specOp && qAbs (ui->TxFreqSpinBox->value () - df) <= int (stop_tolerance) // - && message_words.at (2) != "DE" - && !message_words.at (2).contains (QRegularExpression {"(^(CQ|QRZ))|" + m_baseCall}) - && message_words.at (3).contains (Radio::base_callsign (ui->dxCallEntry->text ()))) { - // auto stop to avoid accidental QRM - ui->stopTxButton->click (); // halt any transmission - LOG_INFO("STOPPED!"); - } else if (m_auto // transmit allowed - && ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isEnabled () && ui->cbAutoSeq->isChecked () // auto-sequencing allowed - && ((!m_bCallingCQ // not calling CQ/QRZ - && !m_sentFirst73 // not finished QSO - && ((message_words.at (2).contains (m_baseCall) - // being called and not already in a QSO - && (message_words.at(3).contains(Radio::base_callsign(ui->dxCallEntry->text())) - or bEU_VHF)) - || message_words.at(1) == m_baseCall // RR73; ... - // type 2 compound replies - || (within_tolerance && - (acceptable_73 || - ("DE" == message_words.at (2) && - w2.contains(Radio::base_callsign (m_hisCall))))))) - || (m_bCallingCQ && m_bAutoReply - // look for type 2 compound call replies on our Tx and Rx offsets - && ((within_tolerance && "DE" == message_words.at (2)) - || message_words.at (2).contains (m_baseCall))))) { - if(SpecOp::FOX != m_specOp) processMessage (message); - } - } +void MainWindow::auto_sequence(DecodedText const& message, unsigned start_tolerance, + unsigned stop_tolerance) +{ + auto const snapshot = qsoReactionSnapshot(); + applyQsoReactionPlan( + DecodedMessageReaction::planAutoSequence( + message, snapshot, DecodedMessageReaction::AutoSequencePhase::StandardDecode, + start_tolerance, stop_tolerance), + message); } - void MainWindow::pskPost (DecodedText const& decodedtext) { - if (m_diskData || !m_config.spot_to_psk_reporter() || decodedtext.isLowConfidence () - || (decodedtext.string().contains(m_baseCall) && decodedtext.string().contains(m_config.my_grid().left(4)))) return; // prevent self-spotting when running multiple instances - int h=decodedtext.string().mid(0,2).toInt(); - int m=decodedtext.string().mid(2,2).toInt(); - int s=decodedtext.string().mid(4,2).toInt(); - int sTimeString = decodedtext.string().mid(0,6).toInt(); - QTime time2(h, m, s); - QDateTime qSpotTime; - if (sTimeString + m_TRperiod < 236000) { - qSpotTime = QDateTime(QDateTime::currentDateTimeUtc().date(), time2, Qt::UTC); - } - else { - qSpotTime = QDateTime((QDateTime::currentDateTimeUtc().addDays(-1)).date(), time2, Qt::UTC); - } - QString msgmode=m_mode; + pskPost (decodedtext, currentDecodeOperatingContext ()); +} + +void MainWindow::pskPost (DecodedText const& decodedtext, + DecodeOperatingContext const& context) +{ + auto const baseCall = Radio::base_callsign (context.myCall); + if (context.diskData || !m_config.spot_to_psk_reporter() || decodedtext.isLowConfidence () + || (decodedtext.string().contains(baseCall) && decodedtext.string().contains(m_config.my_grid().left(4)))) return; // prevent self-spotting when running multiple instances + auto const qSpotTime = DecodedTime::spotTime( + decodedtext.string().section(' ', 0, 0), + QDateTime::currentDateTimeUtc(), context.trPeriod); + if (!qSpotTime.isValid()) return; + QString msgmode=context.mode; QString deCall; QString grid; decodedtext.deCallAndGrid(/*out*/deCall,grid); int audioFrequency = decodedtext.frequencyOffset(); - if(m_mode=="FT8" or m_mode=="MSK144" or m_mode=="FT4") { + if(context.mode=="FT8" or context.mode=="MSK144" or context.mode=="FT4") { audioFrequency=decodedtext.string().mid(16,4).toInt(); } int snr = decodedtext.snr(); - Frequency frequency = m_freqNominalPeriod + audioFrequency; // prevent spotting wrong band - if(grid.contains (grid_regexp) || decodedtext.string().contains(" CQ ")) { + Frequency frequency = context.periodFrequency + audioFrequency; + if(grid.contains (MainWindow::grid_regexp) || decodedtext.string().contains(" CQ ")) { // qDebug() << "To PSKreporter:" << deCall << grid << frequency << msgmode << snr; if (!m_psk_Reporter.addRemoteStation (deCall, grid, frequency, msgmode, snr, qSpotTime)) { - showStatusMessage (tr ("Spotting to PSK Reporter unavailable")); + showStatusMessage (tr ("PSK Reporter spot queue full; oldest spot dropped")); } } } -void MainWindow::killFile () +void MainWindow::killWaveFile () { - if (m_fnameWE.size () && !(m_saveAll || (m_saveDecoded && m_bDecoded))) { - QFile f1 {m_fnameWE + ".wav"}; - if(f1.exists()) f1.remove(); - if(m_mode=="WSPR" or m_mode=="FST4W") { - QFile f2 {m_fnameWE + ".c2"}; - if(f2.exists()) f2.remove(); - } - } + Radio::WavFile::killWaveFile (m_fnameWE, m_saveAll, m_saveDecoded, m_bDecoded, m_mode); } -void MainWindow::on_EraseButton_clicked () -{ - qint64 ms=QDateTime::currentMSecsSinceEpoch(); - if (m_config.alternate_erase_button()) { - ui->decodedTextBrowser->erase (); - if((ms-m_msErase)<500) { - ui->decodedTextBrowser2->erase (); - } - } else { - ui->decodedTextBrowser2->erase (); - if(m_mode=="WSPR" or m_mode=="Echo" or m_mode=="FST4W") { - ui->decodedTextBrowser->erase (); - } else { - if((ms-m_msErase)<500) { - ui->decodedTextBrowser->erase (); - } - } - } - m_msErase=ms; -} void MainWindow::band_activity_cleared () { @@ -7641,20 +7307,10 @@ void MainWindow::rx_frequency_activity_cleared () { m_QSOText.clear(); set_dateTimeQSO(-1); // G4WJS: why do we do this? -} - -void MainWindow::decodeBusy(bool b) //decodeBusy() -{ - if (!b) { - m_optimizingProgress.reset (); - } - m_decoderBusy=b; - ui->DecodeButton->setEnabled(!b); - ui->actionOpen->setEnabled(!b); - ui->actionOpen_next_in_directory->setEnabled(!b); - ui->actionDecode_remaining_files_in_directory->setEnabled(!b); - - statusUpdate (); + // decodedTextBrowser2's document just lost every block; drop our cached + // JTTY per-transmission QTextBlock handles along with it. + m_jttyQsoLines.clear(); + m_jttyQsoGroupEndPosition = -1; } //------------------------------------------------------------- //guiUpdate() @@ -7678,7 +7334,8 @@ void MainWindow::guiUpdate() tx2 += m_TRperiod; } - qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000; + auto const nowUtc = QDateTime::currentDateTimeUtc(); + qint64 ms = nowUtc.toMSecsSinceEpoch() % 86400000; int nsec=ms/1000; double tsec=0.001*ms; double t2p=fmod(tsec,2*m_TRperiod); @@ -7694,21 +7351,7 @@ void MainWindow::guiUpdate() } if(m_mode=="WSPR" or m_mode=="FST4W") { - if(nseq==0 and m_ntr==0) { //Decide whether to Tx or Rx - m_tuneup=false; //This is not an ATU tuneup - bool btx = m_auto && m_WSPR_tx_next; // To Tx, we need m_auto and - // scheduled transmit - m_WSPR_tx_next = false; - if(btx) { - m_ntr=-1; //This says we will have transmitted - ui->pbTxNext->setChecked (false); - m_bTxTime=true; //Start a WSPR or FST4W Tx sequence - } else { - // This will be a WSPR or FST4W Rx sequence. - m_ntr=1; //This says we will have received - m_bTxTime=false; //Start a WSPR or FST4W Rx sequence - } - } + processBeaconActions (m_beaconTxController.observeUtc (nowUtc.toMSecsSinceEpoch ())); } else { // For all modes other than WSPR and FST4W @@ -7724,6 +7367,13 @@ void MainWindow::guiUpdate() } if(m_tune) m_bTxTime=true; //"Tune" takes precedence + bool const nominalTransmitPeriod = m_txFirst ? t2p < m_TRperiod : t2p >= m_TRperiod; + auto const periodStart = qt_truncate_date_time_to(nowUtc, qRound(m_TRperiod * 1000.0)); + if (m_autoRespondPeriodState.observePeriod(periodStart, !nominalTransmitPeriod, + pendingCqAutoRespondIntent(), autoRespondPolicy())) { + m_autoRespondScores.reset(); + } + if(m_transmitting or m_auto or m_tune) { m_dateTimeLastTX = QDateTime::currentDateTimeUtc (); @@ -7732,7 +7382,7 @@ void MainWindow::guiUpdate() if(f.exists() and fmod(tsec,m_TRperiod) < (0.5 + 105.0*576.0/12000.0)) m_bTxTime=true; // Don't transmit another mode in the 30 m WSPR sub-band - Frequency onAirFreq = m_freqNominal + ui->TxFreqSpinBox->value(); + Frequency onAirFreq = m_operatingFrequency.rx () + ui->TxFreqSpinBox->value(); if ((onAirFreq > 10139900 and onAirFreq < 10140320) and m_mode!="WSPR" and m_mode!="FST4W") { m_bTxTime=false; if (m_auto) auto_tx_mode (false); @@ -7741,47 +7391,34 @@ void MainWindow::guiUpdate() auto const& message = tr ("Please choose another Tx frequency." " WSJT-X will not knowingly transmit another" " mode in the WSPR sub-band on 30m."); - QTimer::singleShot (0, [=] { // don't block guiUpdate + QTimer::singleShot (0, this, [=] { // don't block guiUpdate MessageBox::warning_message (this, tr ("WSPR Guard Band"), message); }); } } if(m_mode=="FT8" and SpecOp::FOX==m_specOp) { -// Don't allow Fox mode in any of the default FT8 sub-bands. - QVector ft8Freq = {1840000,3573000,7074000,10136000,14074000,18100000,21074000,24915000,28074000,50313000,70154000}; - for(int i=0; i wsprFreq = {1836600,5364700,3568600,7038600,10138700,14095600,18104600,21094600,24924600,28124600}; - for(int i=0; i -3500 && kHzdiff < 300) { - m_bTxTime=false; - if (m_auto) auto_tx_mode (false); - if (m_tune) stop_tuning(); - auto const& message = tr ("Please choose another dial frequency.\n" - "WSJT-X will not operate in Fox mode\n" - "overlapping the WSPR sub-bands.").arg(ft8Freq[i]); - QTimer::singleShot (0, [=] { // don't block guiUpdate - MessageBox::warning_message (this, tr ("Fox Mode warning"), message); - }); - break; + auto const guard = FoxGuardBands::check (m_operatingFrequency.rx ()); + if (guard.blocked) { + m_bTxTime=false; + if (m_auto) auto_tx_mode (false); + if (m_tune) stop_tuning(); + + QString message; + if (guard.kind == FoxGuardBands::GuardKind::StandardFT8) { + message = tr ("Please choose another dial frequency.\n" + "Must be 3Khz away from %1.\n" + "WSJT-X will not operate in Fox mode\n" + "overlapping the standard FT8 sub-bands.").arg (guard.guard_frequency); + } else { + message = tr ("Please choose another dial frequency.\n" + "WSJT-X will not operate in Fox mode\n" + "overlapping the WSPR sub-bands."); } + + QTimer::singleShot (0, this, [=] { // don't block guiUpdate + MessageBox::warning_message (this, tr ("Fox Mode warning"), message); + }); } } @@ -7800,13 +7437,18 @@ void MainWindow::guiUpdate() if(m_ntx == 5) txMsg=ui->tx5->currentText(); if(m_ntx == 6) txMsg=ui->tx6->text(); int msgLength=txMsg.trimmed().length(); - if(msgLength==0 and !m_tune) on_stopTxButton_clicked(); + if(should_stop_for_missing_tx_payload (m_mode, msgLength, m_tune)) on_stopTxButton_clicked(); - if(g_iptt==0 and ((m_bTxTime and (fTR < 0.75) and (msgLength>0)) or m_tune)) { + if(g_iptt==0 and can_start_transmit (m_mode, m_bTxTime, fTR, msgLength, m_tune)) { //### Allow late starts + m_autoRespondPeriodState.close(); icw[0]=m_ncw; g_iptt = 1; - setRig (); + if (m_beaconTxController.txLifecycle () == BeaconTx::TxLifecycle::Decided) + { + processBeaconActions (m_beaconTxController.txStartRequested ()); + } + reapplyCurrentRigFrequencyCorrection (); if(m_mode=="FT8") { if (SpecOp::FOX == m_specOp) { if(m_config.superFox()) { @@ -7818,25 +7460,26 @@ void MainWindow::guiUpdate() } } else if (SpecOp::HOUND == m_specOp && !m_config.superFox()) { - if(m_auto && !m_tune) { - if (ui->TxFreqSpinBox->value() < 999 && m_ntx != 3) { + HoundTransmissionPolicy::ClassicTxStartInput input; + input.autoEnabled = m_auto; + input.tune = m_tune; + input.selectedTxMessage = m_ntx; + input.currentTxFrequency = ui->TxFreqSpinBox->value(); + auto const plan = HoundTransmissionPolicy::planClassicTxStart ( + m_houndTransmissionState, input); + if (HoundTransmissionPolicy::FrequencyAction::RandomizeCalling + == plan.frequencyDecision.action) { // Hound randomized range: 1000-3000 Hz #if QT_VERSION >= QT_VERSION_CHECK (5, 15, 0) ui->TxFreqSpinBox->setValue (QRandomGenerator::global ()->bounded (1000, 2999)); #else ui->TxFreqSpinBox->setValue ((qrand () % 2000) + 1000); #endif - } - } - if (m_nSentFoxRrpt==2 and m_ntx==3) { - // move off the original Fox frequency on subsequent tries of Tx3 - int nfreq=m_nFoxFreq + 300; - if(m_nFoxFreq>600) nfreq=m_nFoxFreq - 300; //keep nfreq below 900 Hz - ui->TxFreqSpinBox->setValue(nfreq); - } - if (m_nSentFoxRrpt == 1) { - ++m_nSentFoxRrpt; + } else if (HoundTransmissionPolicy::FrequencyAction::Set + == plan.frequencyDecision.action) { + ui->TxFreqSpinBox->setValue (plan.frequencyDecision.frequency); } + m_houndTransmissionState = plan.nextState; } } @@ -7852,28 +7495,16 @@ void MainWindow::guiUpdate() } setXIT (ui->TxFreqSpinBox->value ()); - m_config.transceiver_ptt (true); //Assert the PTT - m_tx_when_ready = true; } -// if(!m_bTxTime and !m_tune and m_mode!="FT4") m_btxok=false; //Time to stop transmitting - if(!m_bTxTime and !m_tune) m_btxok=false; //Time to stop transmitting + if(!m_bTxTime and !m_tune and (m_mode != "JTTY")) m_btxok=false; //Time to stop transmitting } - if((m_mode=="WSPR" or m_mode=="FST4W") and - ((m_ntr==1 and m_rxDone) or (m_ntr==-1 and nseq>tx2))) { - if(m_monitoring) { - m_rxDone=false; - } - if(m_transmitting) { - WSPR_history(m_freqNominal,-1); - m_bTxTime=false; //Time to stop a WSPR or FST4W transmission + if ((m_mode=="WSPR" or m_mode=="FST4W") + && m_beaconTxController.transmitWindow () && nseq > tx2) + { + processBeaconActions (m_beaconTxController.transmitWindowEnded ()); m_btxok=false; } - else if (m_ntr != -1) { - WSPR_scheduling (); - m_ntr=0; //This WSPR or FST4W Rx sequence is complete - } - } // Calculate Tx tones when needed @@ -7890,38 +7521,33 @@ void MainWindow::guiUpdate() ui->txrb1->setChecked(true); } - if(m_mode=="FT4" and m_bBestSPArmed) { - m_BestCQpriority=""; - m_bBestSPArmed=false; - ui->pbBestSP->setStyleSheet (""); - } - - if(m_ntx == 1) ba=ui->tx1->text().toLocal8Bit(); - if(m_ntx == 2) ba=ui->tx2->text().toLocal8Bit(); - if(m_ntx == 3) ba=ui->tx3->text().toLocal8Bit(); - if(m_ntx == 4) ba=ui->tx4->text().toLocal8Bit(); - if(m_ntx == 5) ba=ui->tx5->currentText().toLocal8Bit(); - if(m_ntx == 6) ba=ui->tx6->text().toLocal8Bit(); + QString txText; + if(m_ntx == 1) txText=ui->tx1->text(); + if(m_ntx == 2) txText=ui->tx2->text(); + if(m_ntx == 3) txText=ui->tx3->text(); + if(m_ntx == 4) txText=ui->tx4->text(); + if(m_ntx == 5) txText=ui->tx5->currentText(); + if(m_ntx == 6) txText=ui->tx6->text(); + ba=expandTxMacros(txText).toLocal8Bit(); } ba2msg(ba,message); int ichk=0; - if (m_lastMessageSent != m_currentMessage - || m_lastMessageType != m_currentMessageType) - { - m_lastMessageSent = m_currentMessage; - m_lastMessageType = m_currentMessageType; - } + int msgsent_length=37; + std::fill_n(msgsent, sizeof msgsent, ' '); + msgsent[37]=0; + auto const previous_message = m_currentMessage; + auto const previous_message_type = m_currentMessageType; m_currentMessageType = 0; if(m_tune or m_mode=="Echo") { itone[0]=0; + auto const generated_label = m_tune ? QByteArrayLiteral("TUNE") : QByteArrayLiteral("ECHO"); + std::copy(generated_label.cbegin(), generated_label.cend(), msgsent); if(ui->rbEchoMessage->isChecked() or ui->rbEchoCW->isChecked()) { QString echoMsg=(ui->leEchoMessage->text()+" ").left(6); gen_echocall_(const_cast (echoMsg.toLatin1().constData()),const_cast(itone),(FCL)6); } } else { - if(m_QSOProgress==REPORT || m_QSOProgress==ROGER_REPORT) m_bSentReport=true; - if(m_bSentReport and (m_QSOProgressROGER_REPORT)) m_bSentReport=false; if(m_mode=="JT4") gen4_(message, &ichk , msgsent, const_cast (itone), &m_currentMessageType, (FCL)22, (FCL)22); if(m_mode=="JT9") gen9_(message, &ichk, msgsent, const_cast (itone), @@ -7930,12 +7556,14 @@ void MainWindow::guiUpdate() &m_currentMessageType); if(m_mode=="WSPR") genwspr_(message, msgsent, const_cast (itone), (FCL)22, (FCL)22); + if(m_mode=="JT4" or m_mode=="JT9" or m_mode=="JT65" or m_mode=="WSPR") msgsent_length=22; if(m_mode=="MSK144" or m_mode=="FT8" or m_mode=="FT4" or m_mode=="FST4" or m_mode=="FST4W" || "Q65" == m_mode) { if(m_mode=="MSK144") { genmsk_128_90_(message, &ichk, msgsent, const_cast (itone), &m_currentMessageType, (FCL)37, (FCL)37); - if(m_restart) { + if(m_restart && !should_block_generated_transmit ( + QString::fromLatin1 (msgsent), m_tune)) { int nsym=144; if(itone[40]==-40) nsym=40; m_modulator->set_nsym(nsym); @@ -7943,41 +7571,46 @@ void MainWindow::guiUpdate() } if(m_mode=="FT8") { - if(SpecOp::FOX==m_specOp and ui->tabWidget->currentIndex()==1) { - foxTxSequencer(); + if(SpecOp::FOX==m_specOp and ui->tabWidget->currentIndex()==fox_queue_tab_index) { + if (!foxTxSequencer()) return; } else { int i3=0; int n3=0; - char ft8msgbits[77]; - genft8_(message, &i3, &n3, msgsent, const_cast (ft8msgbits), - const_cast (itone), (FCL)37, (FCL)37); - int nsym=79; - int nsps=4*1920; - float fsample=48000.0; - float bt=2.0; - float f0=ui->TxFreqSpinBox->value() - m_XIT; - int icmplx=0; - int nwave=nsym*nsps; - gen_ft8wave_(const_cast(itone),&nsym,&nsps,&bt,&fsample,&f0,foxcom_.wave, - foxcom_.wave,&icmplx,&nwave); - if(SpecOp::FOX == m_specOp) { - //Fox must generate the full Tx waveform, not just an itone[] array. - QString fm = QString::fromStdString(message).trimmed(); - foxGenWaveform(0,fm); - foxcom_.nslots=1; - foxcom_.nfreq=ui->TxFreqSpinBox->value(); - if(m_config.split_mode()) foxcom_.nfreq = foxcom_.nfreq - m_XIT; //Fox Tx freq - QString foxCall=m_config.my_callsign() + " "; - ::memcpy(foxcom_.mycall, foxCall.toLatin1(), sizeof foxcom_.mycall); //Copy Fox callsign into foxcom_ - bool bSuperFox=m_config.superFox(); - auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_1.dat")).toLocal8Bit()}; - foxcom_.bMoreCQs=ui->cbMoreCQs->isChecked(); - foxcom_.bSendMsg=ui->cbSendMsg->isChecked(); - memcpy(foxcom_.textMsg, m_freeTextMsg.leftJustified(26,' ').toLatin1(),26); - foxgen_(&bSuperFox, fname.constData(), (FCL)fname.size()); - if(bSuperFox) { - writeFoxTxMsgs(); - sfox_tx(); + char ft8msgbits[77]; + genft8_(message, &i3, &n3, msgsent, const_cast (ft8msgbits), + const_cast (itone), (FCL)37, (FCL)37); + if (!should_block_generated_transmit (QString::fromLatin1 (msgsent), m_tune)) { + int nsym=79; + int nsps=4*1920; + float fsample=48000.0; + float bt=2.0; + float f0=ui->TxFreqSpinBox->value() - m_XIT; + int icmplx=0; + int nwave=nsym*nsps; + gen_ft8wave_(const_cast(itone),&nsym,&nsps,&bt,&fsample,&f0,foxcom_.wave, + foxcom_.wave,&icmplx,&nwave); + if(SpecOp::FOX == m_specOp) { + //Fox must generate the full Tx waveform, not just an itone[] array. + QString fm = QString::fromStdString(message).trimmed(); + clearFoxTxMessages(); + foxGenWaveform(0,fm); + foxcom_.nslots=1; + foxcom_.nfreq=ui->TxFreqSpinBox->value(); + if(m_config.split_mode()) foxcom_.nfreq = foxcom_.nfreq - m_XIT; //Fox Tx freq + QString foxCall=m_config.my_callsign() + " "; + ::memcpy(foxcom_.mycall, foxCall.toLatin1(), sizeof foxcom_.mycall); //Copy Fox callsign into foxcom_ + bool bSuperFox=m_config.superFox(); + auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_1.dat")).toLocal8Bit()}; + foxcom_.bMoreCQs=ui->cbMoreCQs->isChecked(); + foxcom_.bSendMsg=ui->cbSendMsg->isChecked(); + memcpy(foxcom_.textMsg, m_freeTextMsg.leftJustified(26,' ').toLatin1(),26); + foxgen_(&bSuperFox, fname.constData(), (FCL)fname.size()); + if(bSuperFox) { + if(sfox_tx()) { + displayFoxTxMsgs(); + writeFoxTxMsgs(); + } + } } } } @@ -7987,14 +7620,16 @@ void MainWindow::guiUpdate() char ft4msgbits[77]; genft4_(message, &ichk, msgsent, const_cast (ft4msgbits), const_cast(itone), (FCL)37, (FCL)37); - int nsym=103; - int nsps=4*576; - float fsample=48000.0; - float f0=ui->TxFreqSpinBox->value() - m_XIT; - int nwave=(nsym+2)*nsps; - int icmplx=0; - gen_ft4wave_(const_cast(itone),&nsym,&nsps,&fsample,&f0,foxcom_.wave, - foxcom_.wave,&icmplx,&nwave); + if (!should_block_generated_transmit (QString::fromLatin1 (msgsent), m_tune)) { + int nsym=103; + int nsps=4*576; + float fsample=48000.0; + float f0=ui->TxFreqSpinBox->value() - m_XIT; + int nwave=(nsym+2)*nsps; + int icmplx=0; + gen_ft4wave_(const_cast(itone),&nsym,&nsps,&fsample,&f0,foxcom_.wave, + foxcom_.wave,&icmplx,&nwave); + } } if(m_mode=="FST4" or m_mode=="FST4W") { int ichk=0; @@ -8009,84 +7644,136 @@ void MainWindow::guiUpdate() } genfst4_(message,&ichk,msgsent,const_cast (fst4msgbits), const_cast(itone), &iwspr, (FCL)37, (FCL)37); - int hmod=1; - if(m_config.x2ToneSpacing()) hmod=2; - if(m_config.x4ToneSpacing()) hmod=4; - int nsps=720; - if(m_TRperiod==30) nsps=1680; - if(m_TRperiod==60) nsps=3888; - if(m_TRperiod==120) nsps=8200; - if(m_TRperiod==300) nsps=21504; - if(m_TRperiod==900) nsps=66560; - if(m_TRperiod==1800) nsps=134400; - nsps=4*nsps; //48000 Hz sampling - int nsym=160; - float fsample=48000.0; - float dfreq=hmod*fsample/nsps; - float f0=ui->TxFreqSpinBox->value() - m_XIT + 1.5*dfreq; - if(m_mode=="FST4W") f0=ui->WSPRfreqSpinBox->value() - m_XIT + 1.5*dfreq; - int nwave=(nsym+2)*nsps; - int icmplx=0; - gen_fst4wave_(const_cast(itone),&nsym,&nsps,&nwave, - &fsample,&hmod,&f0,&icmplx,foxcom_.wave,foxcom_.wave); - - QString t = QString::fromStdString(message).trimmed(); + if (!should_block_generated_transmit (QString::fromLatin1 (msgsent), m_tune)) { + int hmod=1; + if(m_config.x2ToneSpacing()) hmod=2; + if(m_config.x4ToneSpacing()) hmod=4; + int nsps=720; + if(m_TRperiod==30) nsps=1680; + if(m_TRperiod==60) nsps=3888; + if(m_TRperiod==120) nsps=8200; + if(m_TRperiod==300) nsps=21504; + if(m_TRperiod==900) nsps=66560; + if(m_TRperiod==1800) nsps=134400; + nsps=4*nsps; //48000 Hz sampling + int nsym=160; + float fsample=48000.0; + float dfreq=hmod*fsample/nsps; + float f0=ui->TxFreqSpinBox->value() - m_XIT + 1.5*dfreq; + if(m_mode=="FST4W") f0=ui->WSPRfreqSpinBox->value() - m_XIT + 1.5*dfreq; + int nwave=(nsym+2)*nsps; + int icmplx=0; + gen_fst4wave_(const_cast(itone),&nsym,&nsps,&nwave, + &fsample,&hmod,&f0,&icmplx,foxcom_.wave,foxcom_.wave); + } } if(m_mode=="Q65") { int i3=-1; int n3=-1; - genq65_(message, &ichk,msgsent, const_cast(itone), &i3, &n3, (FCL)37, (FCL)37); - int nsps=1800; - if(m_TRperiod==30) nsps=3600; - if(m_TRperiod==60) nsps=7200; - if(m_TRperiod==120) nsps=16000; - if(m_TRperiod==300) nsps=41472; - int nsps4=4*nsps; //48000 Hz sampling - int nsym=85; - float fsample=48000.0; - int nwave=(nsym+2)*nsps4; - int icmplx=0; - float f0=ui->TxFreqSpinBox->value()-m_XIT; - double toneSpacing=fsample/nsps4; - genwave_(const_cast(itone),&nsym,&nsps4,&nwave, - &fsample,&toneSpacing,&f0,&icmplx,foxcom_.wave,foxcom_.wave); - } - - if(SpecOp::EU_VHF==m_specOp) { - if(m_ntx==2) m_xSent=ui->tx2->text().right(13); - if(m_ntx==3) m_xSent=ui->tx3->text().right(13); + int iflag=0; + if(m_specOp==SpecOp::Q65_PILEUP && !m_q65PileupCopiedLastRxCall.isEmpty () && + m_q65PileupCopiedLastRxCall == Radio::base_callsign (ui->dxCallEntry->text ())) { + iflag=1; + } + m_q65PileupCopiedLastRxCall.clear(); // single-consume: don't let a stale match ride a later Tx + genq65_(message, &ichk,msgsent, const_cast(itone), &i3, &n3, &iflag, (FCL)37, (FCL)37); + if (!should_block_generated_transmit (QString::fromLatin1 (msgsent), m_tune)) { + int nsps=1800; + if(m_TRperiod==30) nsps=3600; + if(m_TRperiod==60) nsps=7200; + if(m_TRperiod==120) nsps=16000; + if(m_TRperiod==300) nsps=41472; + int nsps4=4*nsps; //48000 Hz sampling + int nsym=85; + float fsample=48000.0; + int nwave=(nsym+2)*nsps4; + int icmplx=0; + float f0=ui->TxFreqSpinBox->value()-m_XIT; + double toneSpacing=fsample/nsps4; + genwave_(const_cast(itone),&nsym,&nsps4,&nwave, + &fsample,&toneSpacing,&f0,&icmplx,foxcom_.wave,foxcom_.wave); + } } + } + msgsent[msgsent_length]=0; + } - if(SpecOp::FIELD_DAY==m_specOp or SpecOp::RTTY==m_specOp) { - if(m_ntx==2 or m_ntx==3) { - QStringList t=ui->tx2->text().split(' ', SkipEmptyParts); - int n=t.size(); - if (n > 3) m_xSent=t.at(n-2) + " " + t.at(n-1); - } + QString const generated_message = QString::fromLatin1(msgsent); + if (should_block_generated_transmit (generated_message, m_tune)) { + m_currentMessageType = previous_message_type; + m_tx_when_ready = false; + ptt1Timer.stop (); + m_btxok = false; + m_bTxTime = false; + m_restart = false; + if (m_beaconTxController.txLifecycle () == BeaconTx::TxLifecycle::StartRequested) + { + auto const failedPlanId = m_beaconTxController.txPlanId (); + processBeaconActions (m_beaconTxController.txStartResult ( + failedPlanId, false)); + processBeaconActions (m_beaconTxController.txStopped (failedPlanId)); } + show_generated_message_error (); + if (m_auto) auto_tx_mode (false); + if (m_transmitting) { + stopTx (); + } else { + g_iptt = 0; } - msgsent[37]=0; + statusUpdate (); + return; } - { - auto temp = m_currentMessage; - m_currentMessage = QString::fromLatin1(msgsent); - if (m_currentMessage != temp) // check if tx message changed + clear_generated_message_error (); + if (m_lastMessageSent != previous_message + || m_lastMessageType != previous_message_type) { - statusUpdate (); + m_lastMessageSent = previous_message; + m_lastMessageType = previous_message_type; + } + m_currentMessage = generated_message; + if (m_currentMessage != previous_message) statusUpdate (); + + if(m_QSOProgress==REPORT || m_QSOProgress==ROGER_REPORT) m_bSentReport=true; + if(m_bSentReport and (m_QSOProgressROGER_REPORT)) m_bSentReport=false; + if(m_mode=="FT4" and m_bBestSPArmed) { + m_BestCQpriority=""; + m_bBestSPArmed=false; + ui->pbBestSP->setStyleSheet (""); + } + if(SpecOp::EU_VHF==m_specOp) { + if(m_ntx==2) m_xSent=ui->tx2->text().right(13); + if(m_ntx==3) m_xSent=ui->tx3->text().right(13); + } + if(SpecOp::FIELD_DAY==m_specOp or SpecOp::RTTY==m_specOp) { + if(m_ntx==2 or m_ntx==3) { + QStringList t=ui->tx2->text().split(' ', SkipEmptyParts); + int n=t.size(); + if (n > 3) m_xSent=t.at(n-2) + " " + t.at(n-1); + } + } + if (g_iptt == 1 && m_iptt0 == 0) { + if (m_mode != "JTTY") + { + beginTxEvidenceSession (); } + m_config.transceiver_ptt (true); + m_tx_when_ready = true; + if (m_tx_inhibited) startTxAudioAfterPttDelay (); } + m_bCallingCQ = 6 == m_ntx - || m_currentMessage.contains (QRegularExpression {"^(CQ|QRZ) "}); + || m_currentMessage.contains (cq_or_qrz_message_regexp); m_maxPoints=-1; if (m_tune) { m_currentMessage = "TUNE"; m_currentMessageType = -1; } + bool const superFoxFoxTx = m_mode=="FT8" && m_config.superFox() && m_specOp==SpecOp::FOX; if(m_restart) { - write_all("Tx",m_currentMessage); - if (m_config.TX_messages () and m_mode!="Echo") { + if(!superFoxFoxTx && m_mode!="JTTY") write_all("Tx",m_currentMessage); + if (m_config.TX_messages () and m_mode!="Echo" and !superFoxFoxTx) { ui->decodedTextBrowser2->displayTransmittedText(m_currentMessage.trimmed(),m_mode, ui->TxFreqSpinBox->value(),m_bFastMode,m_TRperiod,m_config.superFox()); } @@ -8193,11 +7880,13 @@ void MainWindow::guiUpdate() if (m_mode != "FST4W" && m_mode != "WSPR" && m_mode!="Echo") { - if(!m_tune) write_all("Tx",m_currentMessage); - if (m_config.TX_messages () && !m_tune && SpecOp::FOX!=m_specOp) - { - ui->decodedTextBrowser2->displayTransmittedText(current_message.trimmed(), - m_mode,ui->TxFreqSpinBox->value(),m_bFastMode,m_TRperiod,m_config.superFox()); + bool const superFoxFoxTx = m_mode=="FT8" && m_config.superFox() && m_specOp==SpecOp::FOX; + if(!m_tune && !superFoxFoxTx && m_mode!="JTTY") { + write_all("Tx",m_currentMessage); + } + if (m_config.TX_messages () && !m_tune && SpecOp::FOX!=m_specOp && m_mode != "JTTY") { + ui->decodedTextBrowser2->displayTransmittedText(current_message.trimmed(), + m_mode,ui->TxFreqSpinBox->value(),m_bFastMode,m_TRperiod,m_config.superFox()); } } @@ -8216,7 +7905,7 @@ void MainWindow::guiUpdate() statusUpdate (); } - if(!m_btxok && m_btxok0 && g_iptt==1) { + if((!m_btxok && m_btxok0 && g_iptt==1)) { stopTx(); if ("1" == m_env.value ("WSJT_TX_BOTH", "0")) { m_txFirst = !m_txFirst; @@ -8224,7 +7913,7 @@ void MainWindow::guiUpdate() } } - if(m_startAnother) { + if(m_startAnother && !m_wav_load_coordinator.isLoading ()) { if(m_mode=="MSK144") { m_wait++; } @@ -8256,35 +7945,78 @@ void MainWindow::guiUpdate() if(m_mode=="Echo" and !m_monitoring and !m_auto and !m_diskData) m_echoRunning=false; if(m_mode=="Q65") { - mem_qmap.lock(); - int n=0; - if(m_decoderBusy) n=1; - ipc_qmap[3]=n; - n=0; - if(m_transmitting) n=m_TRperiod; - ipc_qmap[4]=n; - if(ipc_qmap[0] > 0) { //ndecodes - memcpy(&qmapcom, (char*)ipc_qmap, sizeof(qmapcom)); //Fetch the new decode(s) - readWidebandDecodes(); + bool qmap_hasDecodes=false; + bool qmap_batchComplete=false; + int qmap_requestedKHz=0; + if (qmap_decoder_region_available && ipc_qmap && mem_qmap.lock ()) { + int n=0; + if(decoderBusy ()) n=1; + ipc_qmap->decodes.nWDecoderBusy=n; + n=0; + if(m_transmitting) n=m_TRperiod; + ipc_qmap->decodes.nWTransmitting=n; + if(ipc_qmap->decodes.ndecodes > 0) { + memcpy(&qmapcom, &ipc_qmap->decodes, sizeof(qmapcom)); //Fetch the new decode(s) + qmap_hasDecodes=true; + } + qmap_batchComplete=acknowledgeQMapDecodeBatch(ipc_qmap->decodes); + if(ipc_qmap->decodes.kHzRequested>0) { + qmap_requestedKHz=ipc_qmap->decodes.kHzRequested; + ipc_qmap->decodes.kHzRequested=0; + } + mem_qmap.unlock(); + } + if(qmap_hasDecodes) readWidebandDecodes(); + if(qmap_batchComplete) m_fetched=0; + if(qmap_requestedKHz>0) { + requestNominalFrequencyChange ( + (m_operatingFrequency.rx ()/1000000)*1000000 + 1000*qmap_requestedKHz, + FrequencyRequestOrigin::Automatic); + } + } else { + if (qmap_decoder_region_available && ipc_qmap && mem_qmap.lock ()) { + ipc_qmap->decodes.kHzRequested=0; + mem_qmap.unlock (); + } + } + + { + QByteArray qmap_decodeRow; + QMapClickAction qmap_clickAction=QMapClickAction::None; + bool qmap_hasClickRequest=false; + if (qmap_click_mailbox_available && ipc_qmap && mem_qmap.lock ()) { + if (ipc_qmap->click.action != QMapClickAction::None) { + qmap_decodeRow = QByteArray {ipc_qmap->click.selectedDecode, + static_cast (QMapDecodeRowSize)}; + qmap_clickAction = ipc_qmap->click.action; + ipc_qmap->click.action = QMapClickAction::None; + qmap_hasClickRequest = true; + } + mem_qmap.unlock (); } - if(ipc_qmap[5]>0) { - setRig((m_freqNominal/1000000)*1000000 + 1000*ipc_qmap[5]); - ipc_qmap[5]=0; + // UI and rig updates must not hold the shared-memory lock used by QMAP's decoder. + if (qmap_clickAction == QMapClickAction::Disarm) { + if(m_mode=="Q65" && SpecOp::NONE==m_specOp && ui->autoButton->isChecked()) { + ui->autoButton->click(); + } + } else if (qmap_hasClickRequest) { + auto const record = parseQMapDecodeRecord (qmap_decodeRow); + if (record) qmapCallSandP (*record, + qmap_clickAction == QMapClickAction::SelectAndEnableTx); } - mem_qmap.unlock(); } //Once per second (onesec) if(nsec != m_sec0) { - + logDecoderProgress(); + // qDebug() << "AAA" << nsec % 60; // reset earlyDecodes for 2-stage or 3-stage decoding, or if QRG > 45 MHz - if (m_mode=="FT8" && !m_diskData && ((m_multithreadFT8 && m_ft8DecoderStart<2) or m_freqNominal>45000000)) { + if (m_mode=="FT8" && !m_diskData && ((m_multithreadFT8 && m_ft8DecoderStart<2) or m_operatingFrequency.rx ()>45000000)) { QDateTime now = QDateTime::currentDateTimeUtc(); int s = now.time().toString("ss").toInt(); - if (m_ft8DecoderStart<2 or m_freqNominal>45000000) { - if ((s == 7 || s == 22 ||s == 37 || s == 52) && m_decoderBusy) { - to_jt9(m_ihsym,-1,-1); //Allow jt9 to bail out early, if necessary - decodeDone(); //We better clear a hung decoder status at this point + if (m_ft8DecoderStart<2 or m_operatingFrequency.rx ()>45000000) { + if ((s == 7 || s == 22 ||s == 37 || s == 52) && decoderBusy ()) { + recoverDecoderAtBoundary ("FT8 early-decode boundary", false); } if (s == 10 || s == 25 ||s == 40 || s == 55) earlyDecodes = ""; } @@ -8317,12 +8049,12 @@ void MainWindow::guiUpdate() } if(m_mode=="FST4") chk_FST4_freq_range(); - m_currentBand=m_config.bands()->find(m_freqNominal); + m_currentBand=m_config.bands()->find(m_operatingFrequency.rx ()); if( SpecOp::HOUND == m_specOp ) { qint32 tHound=QDateTime::currentMSecsSinceEpoch()/1000 - m_tAutoOn; //To keep calling Fox, Hound must reactivate Enable Tx at least once every 2 minutes if(m_ntx==1 and m_auto) { - if(tHound >= 180 and tHound < 240 and watchdog_label.text() != " WD:1m ") { + if(tHound >= 180 and tHound < 240 and !normalWatchdogWarningActive ()) { watchdog_label.setText (" HWD:2m "); } if(tHound >= 240 and tHound < 300) { @@ -8408,7 +8140,7 @@ void MainWindow::guiUpdate() if(m_transmitting) { char s[42]; - if(SpecOp::FOX==m_specOp and ui->tabWidget->currentIndex()==1) { + if(SpecOp::FOX==m_specOp and ui->tabWidget->currentIndex()==fox_queue_tab_index) { snprintf(s,sizeof(s),"Tx: %d Slots",foxcom_.nslots); } else { snprintf(s,sizeof(s),"Tx: %s",msgsent); @@ -8430,13 +8162,15 @@ void MainWindow::guiUpdate() } else { s[40]=0; QString t{QString::fromLatin1(s)}; - if(SpecOp::FOX==m_specOp and ui->tabWidget->currentIndex()==1 and foxcom_.nslots==1) { + if(SpecOp::FOX==m_specOp and ui->tabWidget->currentIndex()==fox_queue_tab_index and foxcom_.nslots==1) { t=m_fm1.trimmed(); } - if(m_mode=="FT4") t="Tx: "+ m_currentMessage; + if(m_mode=="FT4" or m_mode == "JTTY") t="Tx: "+ m_currentMessage; tx_status_label.setText(t.trimmed()); } } + } else if(m_generated_message_error && !m_tx_watchdog) { + update_generated_message_error (); } else if(m_monitoring) { if (!m_tx_watchdog) { tx_status_label.setStyleSheet("QLabel{color: #000000; background-color: #00ff00}"); @@ -8479,6 +8213,11 @@ void MainWindow::guiUpdate() tx_status_label.setStyleSheet(""); tx_status_label.setText(""); } + if (m_tx_inhibited && !m_tx_watchdog && !m_generated_message_error) { + tx_status_label.setStyleSheet ( + "QLabel{color: #ffffff; background-color: #cc0000; font-weight: bold}"); + tx_status_label.setText (tr ("TX inhibited")); + } QDateTime t = QDateTime::currentDateTimeUtc(); QString utc = t.date().toString("yyyy MMM dd") + "\n " + @@ -8497,22 +8236,25 @@ void MainWindow::guiUpdate() Q_EMIT m_config.transceiver_volume(m_config.volume()); } + QString const cqOnlyText = m_config.highlight_73() ? QStringLiteral ("CQ/73") : QStringLiteral ("CQ only"); + if (ui->cbCQonly->text () != cqOnlyText) + { + ui->cbCQonly->setText (cqOnlyText); + updateMainWindowControlSizes (); + } if (m_config.highlight_73()) { - ui->cbCQonly->setText("CQ/73"); ui->cbCQonly->setToolTip("CQ or 73 messages only."); } else { - ui->cbCQonly->setText("CQ only"); ui->cbCQonly->setToolTip("CQ messages only."); } check_button_color(); - } //End of guiUpdate void MainWindow::useNextCall() { ui->dxCallEntry->setText(m_nextCall); m_nextCall=""; - if(m_nextGrid.contains(grid_regexp)) { + if(m_nextGrid.contains(MainWindow::grid_regexp)) { ui->dxGridEntry->setText(m_nextGrid); m_ntx=2; ui->txrb2->setChecked(true); @@ -8523,13 +8265,19 @@ void MainWindow::useNextCall() genStdMsgs(m_nextRpt); } -void MainWindow::startTx2() -{ +bool MainWindow::startTx2() +{ + if (m_mode == "JTTY" && !m_tune + && (!m_jttyTxActive || jttyTxCommittedSamples () <= 0)) { + return false; + } bool modulator_active; - bool tci_active = m_tci_audio; + bool const tci_active = (m_mode == "JTTY" && m_jttyTxActive) + ? m_jttyTxUsesTciAudio + : m_tci_audio; if (tci_active) modulator_active=m_tci_mod_active; else modulator_active=m_modulator->isActive (); - if (!modulator_active) { // TODO - not thread safe + if (!modulator_active) { // TODO - not thread safe double fSpread=0.0; double snr=99.0; QString t=ui->tx5->currentText(); @@ -8540,50 +8288,220 @@ void MainWindow::startTx2() if(t.mid(0,1)=="#") snr=t.mid(1,5).toDouble(); if(snr>0.0 or snr < -50.0) snr=99.0; if((m_ntx==6 or m_ntx==7) and m_config.force_call_1st() and - ui->respondComboBox->currentIndex()==0) { + autoRespondPolicy () == AutoRespondPolicy::None) { ui->cbAutoSeq->setChecked(true); - ui->respondComboBox->setCurrentIndex(1); + ui->respondComboBox->setCurrentIndex ( + ui->respondComboBox->findData (static_cast (AutoRespondPolicy::First))); } + auto const beaconPlanId = m_beaconTxController.txPlanId (); + auto const beaconMessage = !m_tune + && m_beaconTxController.txLifecycle () == BeaconTx::TxLifecycle::StartRequested; transmit (snr); + if (beaconMessage) + { + processBeaconActions (m_beaconTxController.txStartResult (beaconPlanId, true)); + } ui->signal_meter_widget->setValue(0,0); if(m_mode=="Echo" and !m_tune) m_bTransmittedEcho=true; if((m_mode=="WSPR" or m_mode=="FST4W") and !m_tune) { if (m_config.TX_messages ()) { t = " Transmitting " + m_mode + " ----------------------- " + - m_config.bands ()->find (m_freqNominal); + m_config.bands ()->find (m_operatingFrequency.rx ()); t=beacon_start_time (m_TRperiod / 2) + ' ' + t.rightJustified (66, '-'); ui->decodedTextBrowser->insertText(t); } write_all("Tx",m_currentMessage); if(m_position != 0) ui->decodedTextBrowser->horizontalScrollBar()->setValue(m_position); } + return true; } + if (m_beaconTxController.txLifecycle () == BeaconTx::TxLifecycle::StartRequested) + { + processBeaconActions (m_beaconTxController.txStartResult ( + m_beaconTxController.txPlanId (), false)); + if (m_transmitting) stopTx (); + } + return false; +} + +void MainWindow::beginTxEvidenceSession () +{ + m_txEvidenceSession = TxEvidence::TxPlaybackDiagnostics::allocateSessionId (); + m_pendingTxStopReason = TxEvidence::TxStopReason::NormalEnd; +} + +void MainWindow::beginTxEvidenceGeneration (qint64 committedEndSample, bool targetKnown) +{ + if (!m_txEvidenceSession.isValid ()) + { + beginTxEvidenceSession (); + } + if (m_txEvidenceSourceSession == m_txEvidenceSession && + m_txEvidenceGeneration.isValid ()) + { + m_txPlaybackDiagnostics.stop (m_txEvidenceSourceSession, + m_txEvidenceGeneration, + TxEvidence::TxStopReason::NormalEnd, 0); + } + m_txEvidenceSourceSession = m_txEvidenceSession; + m_txEvidenceGeneration = TxEvidence::TxPlaybackDiagnostics::allocateGeneration (); + TxEvidence::TxStartSnapshot snapshot; + snapshot.session_id = m_txEvidenceSourceSession; + snapshot.generation = m_txEvidenceGeneration; + snapshot.mode = m_mode; + snapshot.sample_rate_hz = TX_SAMPLE_RATE; + snapshot.committed_end_sample = committedEndSample; + snapshot.target_known = targetKnown; + snapshot.diagnostic = QStringLiteral ("awaiting backend source commit"); + m_txPlaybackDiagnostics.commitStart (snapshot); + auto const sessionId = m_txEvidenceSourceSession; + auto const generation = m_txEvidenceGeneration; + auto const mode = m_mode; + QTimer::singleShot (0, this, [this, sessionId, generation, mode] { + LOG_INFO (QString ("TX playout evidence begin session=%1 generation=%2 mode=%3\n%4") + .arg (sessionId.value ()).arg (generation.value ()).arg (mode) + .arg (m_txPlaybackDiagnostics.diagnosticDump ())); + }); +} + +void MainWindow::recordTxSourceCommit (TxEvidence::TxStartSnapshot const& snapshot) +{ + if (!snapshot.session_id.isValid () || !snapshot.generation.isValid ()) return; + if (!m_txPlaybackDiagnostics.commitStart (snapshot)) + { + m_txPlaybackDiagnostics.commitTarget (snapshot.session_id, snapshot.generation, + snapshot.committed_end_sample, + snapshot.target_known, + snapshot.diagnostic); + } + if ((snapshot.mode == "WSPR" || snapshot.mode == "FST4W") + && snapshot.session_id == m_txEvidenceSourceSession + && snapshot.generation == m_txEvidenceGeneration) + { + processBeaconActions (m_beaconTxController.messageStarted ( + m_beaconTxController.txPlanId ())); + } + LOG_INFO (QString ("TX playout evidence source commit session=%1 generation=%2\n%3") + .arg (snapshot.session_id.value ()).arg (snapshot.generation.value ()) + .arg (m_txPlaybackDiagnostics.diagnosticDump ())); +} + +void MainWindow::recordRawTxPlayout (TxEvidence::TxRawPlayoutSnapshot const& snapshot) +{ + if (m_txEvidenceSourceSession.isValid () && m_txEvidenceGeneration.isValid ()) + { + m_txPlaybackDiagnostics.observe (m_txEvidenceSourceSession, + m_txEvidenceGeneration, snapshot); + } +} + +void MainWindow::noteTxStopReason (TxEvidence::TxStopReason reason) +{ + if (m_pendingTxStopReason == TxEvidence::TxStopReason::NormalEnd && + reason != TxEvidence::TxStopReason::NormalEnd) + { + m_pendingTxStopReason = reason; + } +} + +void MainWindow::noteTxModeChange (QString const& mode) +{ + if (mode != m_mode) cancelPendingFt8Decode ("mode changed"); + if (mode != m_mode && m_beaconTxController.active ()) + { + processBeaconActions (m_beaconTxController.exitMode ()); + } + if (mode != m_mode && (m_transmitting || g_iptt == 1 || m_jttyTxActive)) + { + noteTxStopReason (TxEvidence::TxStopReason::ModeChange); + } +} + +int MainWindow::txStopTailMs (bool tciAudio) const +{ + return TxEvidence::TxPlaybackDiagnostics::decisionFor ( + m_pendingTxStopReason, tciAudio || m_mode == "JTTY").tail_ms; +} + +void MainWindow::stopTxEvidence (int tailMs) +{ + if (!m_txEvidenceSession.isValid ()) return; + if (!m_txEvidenceGeneration.isValid () || + m_txEvidenceSourceSession != m_txEvidenceSession) + { + beginTxEvidenceGeneration (); + } + m_txPlaybackDiagnostics.stop (m_txEvidenceSession, m_txEvidenceGeneration, + m_pendingTxStopReason, tailMs); + auto const sessionId = m_txEvidenceSession; + auto const generation = m_txEvidenceGeneration; + QTimer::singleShot (tailMs + 1, this, [this, sessionId, generation] { + LOG_INFO (QString ("TX playout evidence stop session=%1 generation=%2\n%3") + .arg (sessionId.value ()).arg (generation.value ()) + .arg (m_txPlaybackDiagnostics.diagnosticDump ())); + }); + m_txEvidenceSession = TxEvidence::TxSessionId::invalid (); +} + +void MainWindow::captureJttyTxEvidenceTotals (qint64 servedSamples, + qint64 totalSamples, + QString const& diagnostic) +{ + if (!m_txEvidenceSourceSession.isValid () || !m_txEvidenceGeneration.isValid ()) return; + if (servedSamples >= 0) + { + m_txPlaybackDiagnostics.observeSourceProgress (m_txEvidenceSourceSession, + m_txEvidenceGeneration, + servedSamples, totalSamples, + diagnostic); + } + m_txPlaybackDiagnostics.commitTarget (m_txEvidenceSourceSession, + m_txEvidenceGeneration, + totalSamples > 0 ? totalSamples - 1 : -1, + totalSamples > 0, + servedSamples < 0 ? diagnostic : QString ()); } void MainWindow::stopTx() { - if (m_tci_audio) Q_EMIT m_config.transceiver_modulator_stop(); + bool const tciAudio = (m_mode == "JTTY" && m_transmitting) + ? m_jttyTxUsesTciAudio + : m_tci_audio; + int const stopTxDelayMs = txStopTailMs (tciAudio); + if (m_mode == "JTTY" && m_jttyTxActive) { + interruptJttyTx(); + } + if (tciAudio) Q_EMIT m_config.transceiver_modulator_stop(); else Q_EMIT endTransmitMessage (); + if (m_mode == "JTTY" && !tciAudio) { + Q_EMIT endJttyStream (); + } m_btxok = false; m_transmitting = false; g_iptt=0; - if (!m_tx_watchdog) { + if (!m_tx_watchdog && !m_generated_message_error) { tx_status_label.setStyleSheet(""); tx_status_label.setText(""); } - if (m_tci_audio) { - ptt0Timer.start(0); + if (tciAudio) { + ptt0Timer.start(stopTxDelayMs); } else { - ptt0Timer.start(200); //end-of-transmission sequencer delay + ptt0Timer.start(stopTxDelayMs); monitor (true); statusUpdate (); } + stopTxEvidence (stopTxDelayMs); } void MainWindow::stopTx2() { - if (m_tci_audio) { + // Preserve the originating plan IDs for delayed PTT-off completion; the live + // mode may no longer be the mode that started Tx or Tune. + auto const beaconTxPlanId = m_beaconTxController.txPlanId (); + auto const beaconTunePlanId = m_beaconTxController.tunePlanId (); + bool const tciAudio = (m_mode == "JTTY") ? m_jttyTxUsesTciAudio : m_tci_audio; + if (tciAudio) { Q_EMIT m_config.transceiver_ptt (false); //Lower PTT monitor (true); statusUpdate (); @@ -8596,15 +8514,34 @@ void MainWindow::stopTx2() on_stopTxButton_clicked (); m_nTx73 = 0; } - if(((m_mode=="WSPR" or m_mode=="FST4W") and m_ntr==-1) and !m_tuneup) { - m_wideGraph->setWSPRtransmitted(); - WSPR_scheduling (); - m_ntr=0; - } + processBeaconActions (m_beaconTxController.txStopped (beaconTxPlanId)); + if (m_beaconTxController.tuneKind () != BeaconTx::TuneKind::None) + { + processBeaconActions (m_beaconTxController.tuneCompleted (beaconTunePlanId)); + } keep_last_tx_label = true; last_tx_label.setText(tr ("Last Tx: %1").arg (m_currentMessage.trimmed())); } +QString MainWindow::expandTxMacros(QString const& message) const +{ + auto const parts = message.split (' ', SkipEmptyParts); + if (parts.isEmpty () || + (parts.front ().compare ("$DX", Qt::CaseInsensitive) != 0 && + parts.front ().compare ("$DXCALL", Qt::CaseInsensitive) != 0)) { + return message; + } + + auto const dxBase = Radio::base_callsign (m_hisCall); + if (dxBase.isEmpty ()) { + return message; + } + + auto const macroIndex = message.indexOf (parts.front ()); + auto const rest = message.mid (macroIndex + parts.front ().size ()).trimmed (); + return rest.isEmpty () ? dxBase : dxBase + " " + rest; +} + void MainWindow::ba2msg(QByteArray ba, char message[]) //ba2msg() { int iz=ba.length(); @@ -8648,6 +8585,7 @@ void MainWindow::set_dateTimeQSO(int m_ntx) void MainWindow::set_ntx(int n) //set_ntx() { + if (n != m_ntx) clear_generated_message_error (); m_ntx=n; } @@ -8655,6 +8593,7 @@ void MainWindow::on_txrb1_toggled (bool status) { if (status) { if (ui->tx1->isEnabled ()) { + clear_generated_message_error (); m_ntx = 1; set_dateTimeQSO (-1); // we reset here as tx2/tx3 is used for start times } @@ -8674,9 +8613,15 @@ bool MainWindow::elide_tx1_not_allowed () const || (my_callsign != m_baseCall && !shortList (my_callsign)); } -void MainWindow::on_txrb1_doubleClicked () +void MainWindow::toggle_tx1_enabled_preference () { ui->tx1->setEnabled (elide_tx1_not_allowed () || !ui->tx1->isEnabled ()); + m_tx1_enabled_preference = ui->tx1->isEnabled (); +} + +void MainWindow::on_txrb1_doubleClicked () +{ + toggle_tx1_enabled_preference (); if (!ui->tx1->isEnabled ()) { // leave time for clicks to complete before setting txrb2 QTimer::singleShot (500, ui->txrb2, SLOT (click ())); @@ -8687,6 +8632,7 @@ void MainWindow::on_txrb2_toggled (bool status) { // Tx 2 means we already have CQ'd so good reference if (status) { + clear_generated_message_error (); m_ntx=2; set_dateTimeQSO (m_ntx); } @@ -8696,6 +8642,7 @@ void MainWindow::on_txrb3_toggled(bool status) { // Tx 3 means we should have already have done Tx 1 so good reference if (status) { + clear_generated_message_error (); m_ntx=3; set_dateTimeQSO(m_ntx); } @@ -8704,23 +8651,20 @@ void MainWindow::on_txrb3_toggled(bool status) void MainWindow::on_txrb4_toggled (bool status) { if (status) { + clear_generated_message_error (); m_ntx=4; } } void MainWindow::on_txrb4_doubleClicked () { - // RR73 only allowed if not a type 2 compound callsign - auto const& my_callsign = m_config.my_callsign (); - auto is_compound = my_callsign != m_baseCall; - m_send_RR73 = !((is_compound && !shortList (my_callsign)) || m_send_RR73); - if(m_mode=="FT4") m_send_RR73=true; - genStdMsgs (m_rpt); + set_rr73_tx4 (!send_rr73_for_tx4 ()); } void MainWindow::on_txrb5_toggled (bool status) { if (status) { + clear_generated_message_error (); m_ntx = 5; } } @@ -8733,123 +8677,78 @@ void MainWindow::on_txrb5_doubleClicked () void MainWindow::on_txrb6_toggled(bool status) { if (status) { + clear_generated_message_error (); m_ntx=6; - if (ui->txrb6->text().contains (QRegularExpression {"^(CQ|QRZ) "})) set_dateTimeQSO(-1); + if (ui->txrb6->text().contains (cq_or_qrz_message_regexp)) set_dateTimeQSO(-1); } - if(m_mode=="MSK144" && !keep_msk144_frequency && m_msk144basefreq > 0 && !programStart && !m_band_changed) { - setRig(m_msk144basefreq); // reset MSK144 QSY - msk144qsy = false; + if(m_mode=="MSK144" && !programStart && !m_band_changed && !keep_msk144_frequency + && hasMsk144BaseFrequency ()) { + if (requestNominalFrequencyChange (m_msk144basefreq, FrequencyRequestOrigin::User)) + { + msk144qsy = false; + } } } -void MainWindow::on_txb1_clicked() -{ - if (ui->tx1->isEnabled ()) { - m_ntx=1; - m_QSOProgress = REPLYING; - ui->txrb1->setChecked(true); - if(m_transmitting) m_restart=true; - } - else { - on_txb2_clicked (); - } -} void MainWindow::on_txb1_doubleClicked() { - ui->tx1->setEnabled (elide_tx1_not_allowed () || !ui->tx1->isEnabled ()); + toggle_tx1_enabled_preference (); } -void MainWindow::on_txb2_clicked() -{ - m_ntx=2; - m_QSOProgress = REPORT; - ui->txrb2->setChecked(true); - if(m_transmitting) m_restart=true; -} -void MainWindow::on_txb3_clicked() -{ - m_ntx=3; - m_QSOProgress = ROGER_REPORT; - ui->txrb3->setChecked(true); - if(m_transmitting) m_restart=true; -} -void MainWindow::on_txb4_clicked() -{ - m_ntx=4; - m_QSOProgress = ROGERS; - ui->txrb4->setChecked(true); - if(m_transmitting) m_restart=true; -} void MainWindow::on_txb4_doubleClicked() { - // RR73 only allowed if not a type 2 compound callsign - auto const& my_callsign = m_config.my_callsign (); - auto is_compound = my_callsign != m_baseCall; - m_send_RR73 = !((is_compound && !shortList (my_callsign)) || m_send_RR73); - if(m_mode=="FT4") m_send_RR73=true; - genStdMsgs (m_rpt); + set_rr73_tx4 (!send_rr73_for_tx4 ()); } -void MainWindow::on_txb5_clicked() -{ - m_ntx=5; - m_QSOProgress = SIGNOFF; - ui->txrb5->setChecked(true); - if(m_transmitting) m_restart=true; -} void MainWindow::on_txb5_doubleClicked() { genStdMsgs (m_rpt, true); } -void MainWindow::on_txb6_clicked() + +void MainWindow::doubleClickOnCall2(QString const& line, QString const& word, Qt::KeyboardModifiers modifiers) { - m_ntx=6; - m_QSOProgress = CALLING; - set_dateTimeQSO(-1); - ui->txrb6->setChecked(true); - if(m_transmitting) m_restart=true; - if(m_mode=="MSK144" && !keep_msk144_frequency && m_msk144basefreq > 0 && !programStart && !m_band_changed) { - setRig(m_msk144basefreq); // reset MSK144 QSY - msk144qsy = false; - } + handleDecodeSelection(line, word, modifiers, + DecodedMessageReaction::SelectionOrigin::ManualLeftPane); } -void MainWindow::doubleClickOnCall2(Qt::KeyboardModifiers modifiers) +void MainWindow::doubleClickOnCall(QString const& line, QString const& word, Qt::KeyboardModifiers modifiers) { -//Confusing: come here after double-click on left text window, not right window. - m_decodedText2=true; - doubleClickOnCall(modifiers); - m_decodedText2=false; + handleDecodeSelection(line, word, modifiers, + DecodedMessageReaction::SelectionOrigin::ManualRightPane); } -void MainWindow::doubleClickOnCall(Qt::KeyboardModifiers modifiers) +void MainWindow::handleDecodeSelection( + QString const& line, QString const& word, Qt::KeyboardModifiers modifiers, + DecodedMessageReaction::SelectionOrigin selection_origin) { m_bMyCallStd=stdCall(m_config.my_callsign()); //ft8md m_bHisCallStd=stdCall(m_hisCall); //ft8md set_dateTimeQSO(-1); // reset our QSO start time - QTextCursor cursor; if(m_mode=="FST4W") { MessageBox::information_message (this, "Double-click not available for FST4W mode"); return; } - if(m_decodedText2) { - cursor=ui->decodedTextBrowser->textCursor(); - } else { - cursor=ui->decodedTextBrowser2->textCursor(); + if(m_mode=="JTTY") { + m_deCall = word; + ui->dxCallEntry->setText(m_deCall); + return; + } + DecodedText message {line.trimmed().left(61).remove("TU; ")}; + if(SpecOp::HOUND==m_specOp && (message.string().mid(4,2).contains("15") or message.string().mid(4,2).contains("45"))) { + statusBar()->showMessage(tr("Hound: select a Fox at :00 or :30."), 5000); + return; } - DecodedText message {cursor.block().text().trimmed().left(61).remove("TU; ")}; - if(SpecOp::HOUND==m_specOp && (message.string().mid(4,2).contains("15") or message.string().mid(4,2).contains("45"))) return; // ignore stations calling in the wrong time slot // if(message.string().contains(";") && message.string().contains("<")) { // QVector Freq = {1840000,3573000,7074000,10136000,14074000,18100000,21074000,24915000,28074000,50313000,70154000,3575000,7047500,10140000,14080000,18104000,21140000,24919000,28180000,50318000}; // for(int i=0; i0) { - QString t=cursor.block().text(); - selectHound(t, modifiers==(Qt::AltModifier)); // alt double-click gets put at top of queue - } - return; - } - int nmod = fmod(double(message.timeInSeconds()),2.0*m_TRperiod); - if(ui->txFirstCheckBox->isVisible() && !ui->txFirstCheckBox->isEnabled() && ( - (nmod!=0 && !ui->txFirstCheckBox->isChecked()) or - (nmod==0 && ui->txFirstCheckBox->isChecked()))) { - auto const& msg = tr("This station transmits in the same time slot as you do.\n\n" - "You must not start a QSO if both stations Tx even/1st\n" - "or Tx odd/2nd, while the Tx even/1st checkbox is disabled.\n\n" - "Click the MSK144 mode button to re-enable the Tx even/1st\n" - "checkbox, or choose another station."); - if(m_mode=="MSK144") MessageBox::warning_message (this, msg); - return; // don't allow a QSO when both stations Tx 1st or Tx 2nd, and the Tx 1st checkbox is frozen - } else { - m_muted = true; // Don't play alert sounds again - m_bDoubleClicked = true; - m_hisCall0 = m_hisCall; - processMessage (message, modifiers); - // pressing ALT while double-clicking on a call only adds the callsign to DX Call Box - if(SpecOp::FOX!=m_specOp && modifiers==Qt::AltModifier) { - m_bDoubleClicked = false; - if (m_auto) auto_tx_mode (false); - } - // MSK144 QSY: set RF freq so next received MSK144 signal is at 1500 Hz - if(m_mode=="MSK144" && message.frequencyOffset() > 0 && (modifiers==Qt::ControlModifier or modifiers==(Qt::ControlModifier+Qt::AltModifier))) { - Frequency dial_frequency = m_msk144basefreq + (message.frequencyOffset() - 1500); - keep_msk144_frequency = true; - monitor (true); - setRig(dial_frequency); - ui->labDialFreq->setText (Radio::pretty_frequency_MHz_string (dial_frequency)); - msk144qsy = true; - if(modifiers==Qt::AltModifier or modifiers==(Qt::ControlModifier+Qt::AltModifier)) { - m_bDoubleClicked = false; - if (m_auto) auto_tx_mode (false); - } - keep_msk144_frequency = false; - } - m_muted = false; - } -} - -void MainWindow::processMessage (DecodedText const& message, Qt::KeyboardModifiers modifiers) -{ - // decode keyboard modifiers we are interested in - auto shift = modifiers.testFlag (Qt::ShiftModifier); - auto ctrl = modifiers.testFlag (Qt::ControlModifier); - auto auto_seq = ui->cbAutoSeq->isVisible () && ui->cbAutoSeq->isEnabled () && ui->cbAutoSeq->isChecked (); - // basic mode sanity checks - auto const& parts = message.clean_string ().split (' ', SkipEmptyParts); - if (parts.size () < 5) return; - - auto const& mode = parts.at (4).left (1); - if (("JT65" == m_mode && mode != "#") - || ("JT9" == m_mode && mode != "@") - || ("MSK144" == m_mode && !("&" == mode || "^" == mode)) - || ("Q65" == m_mode && mode.left (1) != ":")) { - return; //Currently we do auto-sequencing only in FT4, FT8, MSK144, FST4, and Q65 - } - - //Skip the rest if no decoded text extracted - int frequency = message.frequencyOffset(); - if (message.isTX()) { - if (!m_config.enable_VHF_features()) { - if(!shift) ui->RxFreqSpinBox->setValue(frequency); //Set Rx freq - if((ctrl or shift) and !ui->cbHoldTxFreq->isChecked ()) { - ui->TxFreqSpinBox->setValue(frequency); //Set Tx freq - } - } - return; - } - - // check for CQ with listening frequency - if (parts.size () >= 7 - && m_bFastMode - && "CQ" == parts[5] - && m_config.is_transceiver_online ()) { - bool ok; - auto kHz = parts[6].toUInt (&ok); - if (ok && kHz >= 10 && 3 == parts[6].size ()) { - // QSY Freq for answering CQ nnn - setRig (m_freqNominal / 1000000 * 1000000 + 1000 * kHz); - ui->decodedTextBrowser2->displayQSY (QString {"QSY %1"}.arg (m_freqNominal / 1e6, 7, 'f', 3)); - if(m_mode=="MSK144") m_msk144basefreq = m_freqNominal / 1000000 * 1000000 + 1000 * kHz; // MSK144 QSY - } - } - - int nmod = fmod(double(message.timeInSeconds()),2.0*m_TRperiod); - m_txFirst=(nmod!=0); - if(SpecOp::HOUND == m_specOp) m_txFirst=false; //Hound must not transmit first - if(SpecOp::FOX == m_specOp) m_txFirst=true; //Fox must always transmit first - ui->txFirstCheckBox->setChecked(m_txFirst); - - auto const& message_words = message.messageWords (); - if (message_words.size () < 3) return; - - QString hiscall; - QString hisgrid; - message.deCallAndGrid(/*out*/hiscall,hisgrid); - - // prevent starting a QSO with yourself - if (m_bDoubleClicked && hiscall==m_baseCall) return; - - // don't call CQ when double-clicking on the final "73" message of your QSO - if (m_bDoubleClicked && message.clean_string().remove("<").remove(">").contains((" " + m_baseCall + " ")) - && message.clean_string().remove("<").remove(">").contains(" " + hiscall + " ") && message.clean_string().mid(22).contains(" 73")) return; - - if(message.clean_string ().contains(hiscall+"/R")) { - hiscall+="/R"; - ui->dxCallEntry->setText(hiscall); - } - if(message.clean_string ().contains(hiscall+"/P")) { - hiscall+="/P"; - ui->dxCallEntry->setText(hiscall); - } - - QStringList w=message.clean_string ().mid(22).remove("<").remove(">").split(" ",SkipEmptyParts); - int nw=w.size(); - if(nw>=4) { - if(message_words.size()<4) return; - int n=w.at(nw-2).toInt(); - if(n>=520001 and n<=592047) { - hiscall=w.at(1); - hisgrid=w.at(nw-1); - } - } - - bool is_73 = message_words.filter (QRegularExpression {"^(73|RR73)$"}).size (); - if (!is_73 and !message.isStandardMessage() and !message.clean_string ().contains("<")) { - qDebug () << "Not processing message - hiscall:" << hiscall << "hisgrid:" << hisgrid - << message.clean_string () << message.isStandardMessage(); - return; - } - - if ((message.isJT9 () and m_mode != "JT9" and m_mode != "JT4") or - (message.isJT65 () and m_mode != "JT65" and m_mode != "JT4")) { - // We are not allowing mode change, so don't process decode - return; - } - - // ignore calls by other hounds - if (SpecOp::HOUND == m_specOp - && message.messageWords ().indexOf (QRegularExpression {R"(R\+-[0-9]+)"}) >= 1) - { - return; - } - - QString firstcall = message.call(); - if(firstcall.length()>=4 and firstcall.mid(0,3)=="CQ ") firstcall="CQ"; - if(!m_bFastMode and (!m_config.enable_VHF_features() or m_mode=="FT8" or m_mode=="FT4" or m_mode=="FST4")) { - // Don't change Tx freq if in a fast mode, or VHF features enabled; also not if a - // station is calling me, unless CTRL or SHIFT is held down. - if ((Radio::is_callsign (firstcall) - && firstcall != m_config.my_callsign () && firstcall != m_baseCall - && firstcall != "DE") - || "CQ" == firstcall || "QRZ" == firstcall || ctrl || shift) { - if (((SpecOp::HOUND != m_specOp) || m_mode != "FT8") - && (!ui->cbHoldTxFreq->isChecked () || shift || ctrl)) { - ui->TxFreqSpinBox->setValue(frequency); - } - if(m_mode != "JT4" && m_mode != "JT65" && !m_mode.startsWith ("JT9") && - m_mode != "Q65" && m_mode!="FT8" && m_mode!="FT4" && m_mode!="FST4") { - return; - } +// return; +// } +// } +// } + if(SpecOp::FOX==m_specOp + && selection_origin == DecodedMessageReaction::SelectionOrigin::ManualLeftPane) { + if(m_houndQueue.count()<10 and m_nSortedHounds>0) { + auto const hound_line = modifiers==(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier) + ? ui->decodedTextBrowser->document()->firstBlock().text() + : line; + selectHound(hound_line, modifiers==(Qt::AltModifier)); // alt double-click gets put at top of queue } + return; } - - // prior DX call (possible QSO partner) - auto qso_partner_base_call = Radio::base_callsign (ui->dxCallEntry->text ()); - auto base_call = Radio::base_callsign (hiscall); - -// Determine appropriate response to received message - auto dtext = " " + message.clean_string () + " "; - dtext=dtext.remove("<").remove(">"); - if(dtext.contains (" " + m_baseCall + " ") - || dtext.contains ("<" + m_baseCall + "> ") -//###??? || dtext.contains ("<" + m_baseCall + " " + hiscall + "> ") - || dtext.contains ("/" + m_baseCall + " ") - || dtext.contains (" " + m_baseCall + "/") - || (firstcall == "DE")) { - - QString w2; - int nw=w.size(); - if(nw>=3) w2=w.at(2); - int nrpt=w2.toInt(); - QString w34; - if(nw>=4) { -// w34=w.at(nw-2); - nrpt=w.at(nw-2).toInt(); - w34=w.at(nw-1); - } - bool bRTTY = (nrpt>=529 and nrpt<=599); - bool bEU_VHF_w2=(nrpt>=520001 and nrpt<=594000); - if(bEU_VHF_w2 and SpecOp::EU_VHF!=m_specOp) { - auto const& msg = tr("Should you switch to EU VHF Contest mode?\n\n" - "To do so, check 'Special operating activity' and\n" - "'EU VHF Contest' on the Settings | Advanced tab."); - MessageBox::information_message (this, msg); - } - - QStringList t=message.clean_string ().split(' ', SkipEmptyParts); - int n=t.size(); - QString t0=t.at(n-2); - QString t1=t0.right(1); - bool bFieldDay_msg = (t1>="A" and t1<="F" and t0.size()<=3 and n>=9); - int m=t0.remove(t1).toInt(); - if(m < 1) bFieldDay_msg=false; - if(bFieldDay_msg) { - m_xRcvd=t.at(n-2) + " " + t.at(n-1); - t0=t.at(n-3); - } - if(bFieldDay_msg and SpecOp::FIELD_DAY!=m_specOp) { - // ### Should be in ARRL Field Day mode ??? ### - MessageBox::information_message (this, tr ("Should you switch to ARRL Field Day mode?")); - } - - if(bRTTY and SpecOp::RTTY != m_specOp) { - // ### Should be in RTTY contest mode ??? ### - MessageBox::information_message (this, tr ("Should you switch to RTTY contest mode?")); - } - - // This is necessary to prevent crashes caused by double-clicking messages with <...> in certain QSO situations. - if((SpecOp::EU_VHF==m_specOp or SpecOp::RTTY==m_specOp or SpecOp::FIELD_DAY==m_specOp) - and message.string().contains("<...>")) return; - - if(SpecOp::EU_VHF==m_specOp and message_words.at(2).contains(m_baseCall) and - (!message_words.at(3).contains(qso_partner_base_call)) and (!m_bDoubleClicked)) { - return; + QString hiscall; + QString hisgrid; + message.deCallAndGrid(/*out*/hiscall,hisgrid); + if (is77BitMode () && modifiers!=Qt::AltModifier + && Radio::is_77bit_nonstandard_callsign (m_config.my_callsign ()) + && Radio::is_77bit_nonstandard_callsign (hiscall)) { + auto const& msg = tr ("A QSO between two stations with nonstandard callsigns won't work.\n\n" + "Auto Seq would get stuck in an endless loop."); + MessageBox::information_message (this, msg); + return; + } + int nmod = fmod(double(message.timeInSeconds()),2.0*m_TRperiod); + if(ui->txFirstCheckBox->isVisible() && !ui->txFirstCheckBox->isEnabled() && ( + (nmod!=0 && !ui->txFirstCheckBox->isChecked()) or + (nmod==0 && ui->txFirstCheckBox->isChecked()))) { + auto const& msg = tr("This station transmits in the same time slot as you do.\n\n" + "You must not start a QSO if both stations Tx even/1st\n" + "or Tx odd/2nd, while the Tx even/1st checkbox is disabled.\n\n" + "Click the MSK144 mode button to re-enable the Tx even/1st\n" + "checkbox, or choose another station."); + if(m_mode=="MSK144") MessageBox::warning_message (this, msg); + return; // don't allow a QSO when both stations Tx 1st or Tx 2nd, and the Tx 1st checkbox is frozen + } else { + m_muted = true; // Don't play alert sounds again + m_bDoubleClicked = true; + m_hisCall0 = m_hisCall; + processMessage (message, modifiers, selection_origin); + // pressing ALT while double-clicking on a call only adds the callsign to DX Call Box + if(SpecOp::FOX!=m_specOp && modifiers==Qt::AltModifier) { + m_bDoubleClicked = false; + if (m_auto) auto_tx_mode (false); } - - bool bContestOK=(m_mode=="FT4" or m_mode=="FT8" or m_mode=="Q65" or m_mode=="MSK144"); - if(message_words.size () > 4 // enough fields for a normal message - && (message_words.at(2).contains(m_baseCall) || "DE" == message_words.at(2)) - && (message_words.at(3).contains(qso_partner_base_call) or m_bDoubleClicked - or bEU_VHF_w2 or (m_QSOProgress==CALLING))) { - if(message_words.at(4).contains(grid_regexp) and SpecOp::EU_VHF!=m_specOp) { - if((SpecOp::NA_VHF==m_specOp or SpecOp::WW_DIGI==m_specOp or - SpecOp::ARRL_DIGI==m_specOp or SpecOp::Q65_PILEUP==m_specOp) - and bContestOK) { - setTxMsg(3); - m_QSOProgress=ROGER_REPORT; - // FT4 NS (NCCC Sprints): Log QSO after sending "hiscall mycall R mygrid" - if (SpecOp::NA_VHF==m_specOp && m_mode=="FT4" && m_config.NCCC_Sprint()) { - if (m_auto && (m_config.prompt_to_log() || m_config.autoLog())) logQSOTimer.start(0); - QTimer::singleShot (int(850.0*m_TRperiod), [=] { - auto_tx_mode(false); - if (m_auto) ui->autoButton->click(); - }); - if (m_config.prompt_to_log() || m_config.autoLog()) { // prevent dupe logbook entries - no_logging = true; - QTimer::singleShot (20000, [=] {no_logging = false;}); - } - } - } else { - if(m_mode=="JT65" and message_words.size()>5 and message_words.at(5)=="OOO") { - setTxMsg(3); - m_QSOProgress=ROGER_REPORT; - } else { - setTxMsg(2); - m_QSOProgress=REPORT; - } - } - } else if(w34.contains(grid_regexp) and SpecOp::EU_VHF==m_specOp) { - - if(nrpt==0) { - setTxMsg(2); - m_QSOProgress=REPORT; - } else { - if(w2=="R") { - setTxMsg(4); - m_QSOProgress=ROGERS; - } else { - setTxMsg(3); - m_QSOProgress=ROGER_REPORT; - } - } - } else if(SpecOp::RTTY == m_specOp and bRTTY) { - if(w2=="R") { - setTxMsg(4); - m_QSOProgress=ROGERS; - } else { - setTxMsg(3); - m_QSOProgress=ROGER_REPORT; - } - m_xRcvd=t[n-2] + " " + t[n-1]; - } else if(SpecOp::FIELD_DAY==m_specOp and bFieldDay_msg) { - if(t0=="R") { - setTxMsg(4); - m_QSOProgress=ROGERS; - } else { - setTxMsg(3); - m_QSOProgress=ROGER_REPORT; - } - } else { // no grid on end of msg - auto const& word_3 = message_words.at (4); - auto word_3_as_number = word_3.toInt (); - if (("RRR" == word_3 - || (word_3_as_number == 73 && ROGERS == m_QSOProgress) - || "RR73" == word_3 - || ("R" == word_3 && m_QSOProgress != REPORT))) { - if(m_mode=="FT4" and "RR73" == word_3) m_dateTimeRcvdRR73=QDateTime::currentDateTimeUtc(); - m_bTUmsg=false; - m_nextCall=""; //### Temporary: disable use of "TU;" message - if(SpecOp::RTTY == m_specOp and m_nextCall!="") { - // We're in RTTY contest and have "nextCall" queued up: send a "TU; ..." message - if (m_config.prompt_to_log() || m_config.autoLog()) { - logQSOTimer.start(0); - } - else { - cease_auto_Tx_after_QSO (); - } - ui->tx3->setText(ui->tx3->text().remove("TU; ")); - useNextCall(); - QString t="TU; " + ui->tx3->text(); - ui->tx3->setText(t); - m_bTUmsg=true; - } else { - if (false) // Always Send 73 after receiving RRR or RR73, even in contest mode. - { - if (m_config.prompt_to_log() || m_config.autoLog()) { - if (!(m_mode=="FT4" && SpecOp::NA_VHF==m_specOp && m_config.NCCC_Sprint())) logQSOTimer.start(0); - } - else { - cease_auto_Tx_after_QSO (); - } - m_ntx=6; - ui->txrb6->setChecked(true); - } - else if (word_3.contains (QRegularExpression {"^R(?!R73|RR)"}) - && m_QSOProgress != ROGER_REPORT) - { - m_ntx=4; - ui->txrb4->setChecked(true); - } - else if ((m_QSOProgress > CALLING && m_QSOProgress < ROGERS) - || word_3.contains (QRegularExpression {"^RR(?:R|73)$"})) - { - m_ntx=5; - ui->txrb5->setChecked(true); - } - else if (ROGERS == m_QSOProgress) - { - if (m_config.prompt_to_log() || m_config.autoLog()) { - if (!(m_mode=="FT4" && SpecOp::NA_VHF==m_specOp && m_config.NCCC_Sprint())) logQSOTimer.start(0); - } - else { - cease_auto_Tx_after_QSO (); - } - if ((m_mode=="MSK144" or (m_mode=="Q65" && m_config.repeat_Tx())) && !m_send_RR73) { // ensure that 73 is sent when using RRR - ui->txrb5->click(); - QTimer::singleShot (int(1000*m_TRperiod), [=] {m_auto=false;}); - } else { - m_ntx=6; - ui->txrb6->setChecked(true); - } - } - else - { - // just work them (again) - if (ui->tx1->isEnabled ()) { - m_ntx = 1; - m_QSOProgress = REPLYING; - ui->txrb1->setChecked (true); - } else { - m_ntx=2; - m_QSOProgress = REPORT; - ui->txrb2->setChecked (true); - } - } - } - if (m_QSOProgress >= ROGER_REPORT) + // MSK144 QSY: set RF freq so next received MSK144 signal is at 1500 Hz + if(m_mode=="MSK144" && hasMsk144BaseFrequency () && message.frequencyOffset() > 0 + && (modifiers==Qt::ControlModifier or modifiers==(Qt::ControlModifier+Qt::AltModifier))) { + Frequency dial_frequency = m_msk144basefreq + (message.frequencyOffset() - 1500); + if (nominalFrequencyChangeAllowed (FrequencyRequestOrigin::User)) + { + keep_msk144_frequency = true; + monitor (true); + if (requestNominalFrequencyChange (dial_frequency, FrequencyRequestOrigin::User)) { - m_QSOProgress = SIGNOFF; + ui->labDialFreq->setText (Radio::pretty_frequency_MHz_string (dial_frequency)); + msk144qsy = true; } - } else if((m_QSOProgress >= REPORT - || (m_QSOProgress >= REPLYING && - (m_mode=="MSK144" or m_mode=="FT8" or m_mode=="FT4" || "Q65" == m_mode))) - && word_3.startsWith ('R')) { - m_ntx=4; - m_QSOProgress = ROGERS; - if(SpecOp::RTTY == m_specOp) { - int n=t.size(); - int nRpt=t[n-2].toInt(); - if(nRpt>=529 and nRpt<=599) m_xRcvd=t[n-2] + " " + t[n-1]; - } - ui->txrb4->setChecked(true); - } else if (m_QSOProgress >= CALLING) - { - if ((word_3_as_number >= -50 && word_3_as_number <= 49) - || (word_3_as_number >= 529 && word_3_as_number <= 599)) - { - if(SpecOp::EU_VHF==m_specOp or - SpecOp::FIELD_DAY==m_specOp or - SpecOp::RTTY==m_specOp) - { - setTxMsg(2); - m_QSOProgress=REPORT; - } - else - { - if (word_3.startsWith ("R-") || word_3.startsWith ("R+")) - { - setTxMsg(4); - m_QSOProgress=ROGERS; - } - else - { - setTxMsg (3); - m_QSOProgress = ROGER_REPORT; - } - } - } - } - else - { // nothing for us - return; - } - } - } - else if (5 == message_words.size () - && m_baseCall == message_words.at (1)) { - // dual Fox style message, possibly from MSHV - if (m_config.prompt_to_log() || m_config.autoLog()) { - logQSOTimer.start(0); - } - else { - cease_auto_Tx_after_QSO (); - } - m_ntx=6; - ui->txrb6->setChecked(true); - } - else if (m_QSOProgress >= ROGERS - && message_words.size () > 3 && message_words.at (2).contains (m_baseCall) - && message_words.at (3) == "73") { - // 73 back to compound call holder - m_ntx=5; - ui->txrb5->setChecked(true); - m_QSOProgress = SIGNOFF; - } - else if (!(m_bAutoReply && (m_QSOProgress > CALLING))) { - if ((message_words.size () > 5 && message_words.at (2).contains (m_baseCall) - && message_words.at (5) == "OOO")) { - // EME short code report or MSK144/FT8 contest mode reply, send back Tx3 - m_ntx=3; - m_QSOProgress = ROGER_REPORT; - ui->txrb3->setChecked (true); - } else if (!is_73) { // don't respond to sign off messages - m_ntx=2; - m_QSOProgress = REPORT; - ui->txrb2->setChecked(true); - if (m_bDoubleClickAfterCQnnn and m_transmitting) { - on_stopTxButton_clicked(); - TxAgainTimer.start(1500); + keep_msk144_frequency = false; } - m_bDoubleClickAfterCQnnn=false; - } - else { - return; // nothing we need to respond to + if(modifiers==Qt::AltModifier or modifiers==(Qt::ControlModifier+Qt::AltModifier)) { + m_bDoubleClicked = false; + if (m_auto) auto_tx_mode (false); } } - else { // nothing for us - return; - } + m_muted = false; } - else if (firstcall == "DE" && message_words.size () > 4 && message_words.at (4) == "73") { - if (m_QSOProgress >= ROGERS && base_call == qso_partner_base_call && m_currentMessageType) { - // 73 back to compound call holder - m_ntx=5; - ui->txrb5->setChecked(true); - m_QSOProgress = SIGNOFF; - } else { - // treat like a CQ/QRZ - if (ui->tx1->isEnabled ()) { - m_ntx = 1; - m_QSOProgress = REPLYING; - ui->txrb1->setChecked (true); - } else { - m_ntx=2; - m_QSOProgress = REPORT; - ui->txrb2->setChecked (true); +} + +DecodedMessageReaction::QsoReactionSnapshot MainWindow::qsoReactionSnapshot( + Qt::KeyboardModifiers modifiers) const +{ + return qsoReactionSnapshot(modifiers, DecodedMessageReaction::SelectionOrigin::None); +} + +DecodedMessageReaction::QsoReactionSnapshot MainWindow::qsoReactionSnapshot( + Qt::KeyboardModifiers modifiers, + DecodedMessageReaction::SelectionOrigin selection_origin) const +{ + DecodedMessageReaction::QsoReactionSnapshot snapshot; + snapshot.mode = m_mode; + snapshot.specOp = m_specOp; + snapshot.myCall = m_config.my_callsign(); + snapshot.baseCall = m_baseCall; + snapshot.dxCall = ui->dxCallEntry->text(); + snapshot.hisCall = m_hisCall; + snapshot.hisGrid = m_hisGrid; + snapshot.respondPolicy = autoRespondPolicy (); + snapshot.trPeriod = m_TRperiod; + snapshot.nominalFrequency = m_operatingFrequency.rx (); + snapshot.rxFrequency = ui->RxFreqSpinBox->value(); + snapshot.txFrequency = ui->TxFreqSpinBox->value(); + snapshot.qsoProgress = m_QSOProgress; + snapshot.selectedTxMessage = m_ntx; + snapshot.currentMessageType = m_currentMessageType; + snapshot.sentReport = m_bSentReport; + snapshot.shortMessages = m_bShMsgs; + snapshot.sendRr73 = send_rr73_for_tx4 (); + snapshot.transmitting = m_transmitting; + snapshot.transmittingSignoff = m_transmitting + && message_is_73(m_currentMessageType, m_currentMessage.split(' ', SkipEmptyParts)); + snapshot.doubleClicked = m_bDoubleClicked; + snapshot.doubleClickAfterCqFrequency = m_bDoubleClickAfterCQnnn; + snapshot.selectionOrigin = selection_origin != DecodedMessageReaction::SelectionOrigin::None + ? selection_origin + : (m_bDoubleClicked ? DecodedMessageReaction::SelectionOrigin::ManualLeftPane + : DecodedMessageReaction::SelectionOrigin::None); + snapshot.modifiers.shift = modifiers.testFlag(Qt::ShiftModifier); + snapshot.modifiers.ctrl = modifiers.testFlag(Qt::ControlModifier); + snapshot.modifiers.alt = modifiers.testFlag(Qt::AltModifier); + snapshot.fastMode = m_bFastMode; + snapshot.transceiverOnline = m_config.is_transceiver_online(); + snapshot.nominalQsyAllowed = rigFrequencyChangeDecision ( + RigFrequencyChangePolicy::ChangeKind::NominalQsy).allowed; + snapshot.enableVhfFeatures = m_config.enable_VHF_features(); + snapshot.holdTxFrequency = ui->cbHoldTxFreq->isChecked(); + snapshot.rxFrequencyEnabled = ui->RxFreqSpinBox->isEnabled(); + snapshot.tx1Enabled = ui->tx1->isEnabled(); + snapshot.autoEnabled = m_auto; + snapshot.autoButtonChecked = ui->autoButton->isChecked(); + snapshot.autoReply = m_bAutoReply; + snapshot.callingCq = m_bCallingCQ; + snapshot.sentFirst73 = m_sentFirst73; + snapshot.autoSequenceChecked = ui->cbAutoSeq->isChecked(); + snapshot.autoSequenceEnabled = ui->cbAutoSeq->isVisible() + && ui->cbAutoSeq->isEnabled() && ui->cbAutoSeq->isChecked(); + snapshot.quickCall = m_config.quick_call(); + snapshot.repeatTx = m_config.repeat_Tx(); + snapshot.loggingEnabled = m_config.prompt_to_log() || m_config.autoLog(); + snapshot.contestHintShown = m_contestModeHintShown; + snapshot.ncccSprint = m_config.NCCC_Sprint(); + snapshot.tx73Count = m_nTx73; + snapshot.waitFeaturesEnabled = m_config.Wait_features_enabled(); + snapshot.waitAndCall = wait_and_call; + snapshot.noWaitAndCall = no_wait_and_call; + snapshot.waitAndCallControlChecked = ui->DX_Call_Button->isChecked(); + snapshot.fullDuplexEnabled = ui->actionFull_Duplex_Mode->isChecked(); + snapshot.txing = m_txing; + return snapshot; +} + +void MainWindow::applyQsoReactionPlan(DecodedMessageReaction::QsoReactionPlan const& plan, + DecodedText const& message, bool * block_right_display) +{ + bool contestHintQueued = false; + DecodedMessageReaction::ContestHint contestHint {}; + for (auto const& effect : plan.effects) { + if (effect.kind == DecodedMessageReaction::QsoReactionEffect::Kind::QueueContestHint) { + m_contestModeHintShown = true; + if (!contestHintQueued) { + contestHint = effect.contestHint; + contestHintQueued = true; } + continue; } + applyQsoReactionEffect(effect, message, block_right_display); } - else if (is_73 && !message.isStandardMessage ()) { - m_ntx=5; - ui->txrb5->setChecked(true); - m_QSOProgress = SIGNOFF; - } else if (!(m_auto && m_ntx == 3 && message.string().contains("73 "))) { // don't interrupt Tx3 transmissions - // just work them - if (ui->tx1->isEnabled ()) { - m_ntx = 1; - m_QSOProgress = REPLYING; - ui->txrb1->setChecked (true); - } else { - m_ntx=2; - m_QSOProgress = REPORT; - ui->txrb2->setChecked (true); - } - } - // if we get here then we are reacting to the message - if (m_bAutoReply) m_bCallingCQ = CALLING == m_QSOProgress; - m_maxPoints=-1; - if (ui->RxFreqSpinBox->isEnabled () and m_mode != "MSK144" and !shift) { - ui->RxFreqSpinBox->setValue (frequency); //Set Rx freq + if (contestHintQueued) { + QTimer::singleShot(0, this, [this, contestHint] {showContestHint(contestHint);}); } +} - QString s1 = m_QSOText.trimmed (); - QString s2 = message.clean_string ().trimmed(); - if (s1!=s2 and !message.isTX()) { - // insert blank line in decodedTextBrowser2 when band was changed for MSK144 - if (m_mode=="MSK144" && m_config.insert_blank () && m_band_changed && (m_currentBandPeriod == m_currentBand) && !BlankLineInserted) { - if (ui->actionUse_Dark_Style->isChecked()) { - ui->decodedTextBrowser2->insertText(("------------------- " + m_currentBandPeriod + " -----------------"), "#a2a2a2", "#000000"); - } else { - ui->decodedTextBrowser2->insertLineSpacer ("------------------- " + m_currentBandPeriod + " -----------------"); - } - BlankLineInserted = true; - m_band_changed = false; - } - if (!s2.contains(m_baseCall) or m_mode=="MSK144") { // Taken care of elsewhere if for_us and slow mode - ui->decodedTextBrowser2->displayDecodedText (message, m_config.my_callsign (), m_mode, m_config.DXCC (), - m_logBook, m_currentBand, m_config.ppfx (), false, false, 0.0, false, -99, "", m_muted); - } - m_QSOText = s2; +void MainWindow::applyQsoReactionEffect(DecodedMessageReaction::QsoReactionEffect const& effect, + DecodedText const& message, bool * block_right_display) +{ + using Effect = DecodedMessageReaction::QsoReactionEffect; + switch (effect.kind) { + case Effect::Kind::SetRxFrequency: + ui->RxFreqSpinBox->setValue(effect.intValue); + break; + case Effect::Kind::SetTxFrequency: + ui->TxFreqSpinBox->setValue(effect.intValue); + break; + case Effect::Kind::ApplyFastCqQsy: + RigFrequencyChangePolicy::commitIfAccepted ( + [this, &effect] { + return requestNominalFrequencyChange ( + effect.frequency, + effect.userInitiated ? FrequencyRequestOrigin::User : FrequencyRequestOrigin::Automatic); + }, + [this, &effect] { + ui->decodedTextBrowser2->displayQSY (effect.text); + if (effect.boolValue) m_msk144basefreq = effect.frequency; + }); + break; + case Effect::Kind::RejectNominalQsy: + nominalFrequencyChangeAllowed (FrequencyRequestOrigin::User); + break; + case Effect::Kind::SetTxFirst: + m_txFirst = effect.boolValue; + ui->txFirstCheckBox->setChecked(m_txFirst); + break; + case Effect::Kind::SetTxMessage: + setTxMsg(effect.intValue); + break; + case Effect::Kind::SetTxMessageIndex: + m_ntx = effect.intValue; + break; + case Effect::Kind::CheckTxMessage: + txNextButtons().at(effect.intValue - 1)->setChecked(true); + break; + case Effect::Kind::ClickTxMessage: + txNextButtons().at(effect.intValue - 1)->click(); + break; + case Effect::Kind::SetQsoProgress: + m_QSOProgress = effect.progress; + break; + case Effect::Kind::SetDxCall: + ui->dxCallEntry->setText(effect.text); + break; + case Effect::Kind::ClearDxGrid: + ui->dxGridEntry->clear(); + break; + case Effect::Kind::SetDxGrid: + if (ui->dxGridEntry->text().mid(0, 4) != effect.text) ui->dxGridEntry->setText(effect.text); + break; + case Effect::Kind::SetReport: + ui->rptSpinBox->setValue(effect.intValue); + break; + case Effect::Kind::SetReceivedExchange: + m_xRcvd = effect.text; + break; + case Effect::Kind::SetCallingCq: + m_bCallingCQ = effect.boolValue; + break; + case Effect::Kind::SetMaxPoints: + m_maxPoints = effect.intValue; + break; + case Effect::Kind::SetRestart: + m_restart = effect.boolValue; + break; + case Effect::Kind::SetDoubleClicked: + m_bDoubleClicked = effect.boolValue; + break; + case Effect::Kind::SetDoubleClickAfterCqFrequency: + m_bDoubleClickAfterCQnnn = effect.boolValue; + break; + case Effect::Kind::SetTuMessage: + m_bTUmsg = effect.boolValue; + break; + case Effect::Kind::SetNextCall: + m_nextCall = effect.text; + break; + case Effect::Kind::SetNoLogging: + no_logging = effect.boolValue; + break; + case Effect::Kind::SetNoWaitAndCall: + no_wait_and_call = effect.boolValue; + break; + case Effect::Kind::SetBlockRightDisplay: + if (block_right_display) *block_right_display = effect.boolValue; + break; + case Effect::Kind::SetAutoEnabled: + auto_tx_mode(effect.boolValue); + break; + case Effect::Kind::RefreshQsoPaneIfChanged: + refreshQsoPane(message); + break; + case Effect::Kind::Lookup: + lookup(); + break; + case Effect::Kind::CaptureHisGrid: + m_hisGrid = ui->dxGridEntry->text(); + break; + case Effect::Kind::ExtractReceivedReport: + message.report(m_baseCall, Radio::base_callsign(ui->dxCallEntry->text()), m_rptRcvd); + break; + case Effect::Kind::GenerateStandardMessages: + genStdMsgs(QString::number(ui->rptSpinBox->value())); + break; + case Effect::Kind::RecordRr73Received: + m_dateTimeRcvdRR73 = QDateTime::currentDateTimeUtc(); + break; + case Effect::Kind::RequestLogQso: + logQSOTimer.start(0); + break; + case Effect::Kind::RequestLogQsoUnlessSuppressed: + if (!no_logging) logQSOTimer.start(0); + break; + case Effect::Kind::CeaseAutoTx: + cease_auto_Tx_after_QSO(); + break; + case Effect::Kind::StopTx: + on_stopTxButton_clicked(); + break; + case Effect::Kind::ClickStopTx: + ui->stopTxButton->click(); + break; + case Effect::Kind::LogStopped: + LOG_INFO("STOPPED!"); + break; + case Effect::Kind::StartTxAgainTimer: + TxAgainTimer.start(effect.intValue); + break; + case Effect::Kind::ResetWatchdog: + tx_watchdog(false); + break; + case Effect::Kind::StopWaitCallTimer: + stopWCTimer.stop(); + break; + case Effect::Kind::DisableWaitAndCallControl: + if (ui->DX_Call_Button->isChecked()) ui->DX_Call_Button->click(); + break; + case Effect::Kind::StartWaitReplyTimer: + stopWRTimer.start(effect.intValue); + break; + case Effect::Kind::StartWaitCallTimer: + stopWCTimer.start(effect.intValue); + break; + case Effect::Kind::ScheduleStopTx: + QTimer::singleShot(effect.intValue, this, [this] {on_stopTxButton_clicked();}); + break; + case Effect::Kind::ScheduleNcccAutoReset: + QTimer::singleShot(effect.intValue, this, [this] { + auto_tx_mode(false); + if (m_auto) ui->autoButton->click(); + }); + break; + case Effect::Kind::ScheduleNoLoggingReset: + QTimer::singleShot(effect.intValue, this, [=] {no_logging = false;}); + break; + case Effect::Kind::ScheduleAutoFlagOff: + QTimer::singleShot(effect.intValue, this, [=] {m_auto = false;}); + break; + case Effect::Kind::QueueContestHint: + break; + case Effect::Kind::ProcessSyntheticMessageNow: + processSyntheticMessage(message); + break; } +} - if (Radio::is_callsign (hiscall) - && (base_call != qso_partner_base_call || base_call != hiscall)) { - if (qso_partner_base_call != base_call) { - // clear the DX grid if the base call of his call is different - // from the current DX call - ui->dxGridEntry->clear (); - } - // his base call different or his call more qualified - // i.e. compound version of same base call - if (!((s2.contains(" " + m_config.my_callsign() + " ") && s2.mid(22).contains(" 73")) && (ui->respondComboBox->currentText()=="CQ: Max dB" - or ui->respondComboBox->currentText()=="CQ: Max dB"))) ui->dxCallEntry->setText (hiscall); - } - if (hisgrid.contains (grid_regexp)) { - if(ui->dxGridEntry->text().mid(0,4) != hisgrid) ui->dxGridEntry->setText(hisgrid); +void MainWindow::showContestHint(DecodedMessageReaction::ContestHint hint) +{ + if (hint == DecodedMessageReaction::ContestHint::EuVhf) { + MessageBox::information_message(this, tr( + "Should you switch to EU VHF Contest mode?\n\n" + "To do so, check 'Special operating activity' and\n" + "'EU VHF Contest' on the Settings | Advanced tab.")); + } else if (hint == DecodedMessageReaction::ContestHint::FieldDay) { + MessageBox::information_message(this, tr("Should you switch to ARRL Field Day mode?")); + } else { + MessageBox::information_message(this, tr("Should you switch to RTTY contest mode?")); } - lookup(); - m_hisGrid = ui->dxGridEntry->text(); +} - if (m_bDoubleClicked) - { - // extract our report if present - message.report (m_baseCall, Radio::base_callsign(ui->dxCallEntry->text()), m_rptRcvd); - } +void MainWindow::refreshQsoPane(DecodedText const& message) +{ + QString const previous = m_QSOText.trimmed(); + QString const current = message.clean_string().trimmed(); + if (previous == current || message.isTX()) return; - if (!m_bSentReport || base_call != qso_partner_base_call || m_mode == "FT8" || m_mode == "FT4" - || m_mode == "FST4") // Change report within a QSO - { - auto n = message.report ().toInt (); - if(m_mode=="MSK144" and m_bShMsgs) { - if(n<=-2) n=-3; - if(n>=-1 and n<=1) n=0; - if(n>=2 and n<=4) n=3; - if(n>=5 and n<=7) n=6; - if(n>=8 and n<=11) n=10; - if(n>=12 and n<=14) n=13; - if(n>=15) n=16; - } - ui->rptSpinBox->setValue (n); + if (m_mode == "MSK144" && m_config.insert_blank() && m_band_changed + && m_currentBandPeriod == m_currentBand && !BlankLineInserted) { + if (ui->actionUse_Dark_Style->isChecked()) { + ui->decodedTextBrowser2->insertText( + "------------------- " + m_currentBandPeriod + " -----------------", "#a2a2a2", "#000000"); + } else { + ui->decodedTextBrowser2->insertLineSpacer( + "------------------- " + m_currentBandPeriod + " -----------------"); } -// Don't genStdMsgs if we're already sending 73, or a "TU; " msg is queued. - m_bTUmsg=false; //### Temporary: disable use of "TU;" messages - if (!m_nTx73 and !m_bTUmsg) { - genStdMsgs (QString::number (ui->rptSpinBox->value ())); + BlankLineInserted = true; + m_band_changed = false; } - if(m_transmitting) m_restart=true; - if (auto_seq && !m_bDoubleClicked && m_mode!="FT4") { - return; + if (!current.contains(m_baseCall) || m_mode == "MSK144") { + ui->decodedTextBrowser2->displayDecodedText( + message, m_config.my_callsign(), m_mode, m_config.DXCC(), m_logBook, m_currentBand, + m_config.ppfx(), false, false, 0.0, false, -99, "", m_muted); } - if(m_config.quick_call() && m_bDoubleClicked) auto_tx_mode(true); - m_bDoubleClicked=false; + m_QSOText = current; +} +void MainWindow::processMessage(DecodedText const& message, Qt::KeyboardModifiers modifiers, + DecodedMessageReaction::SelectionOrigin selection_origin) +{ + auto const snapshot = qsoReactionSnapshot(modifiers, selection_origin); + applyQsoReactionPlan(DecodedMessageReaction::planProcessMessage(message, snapshot), message); } +void MainWindow::processSyntheticMessage(DecodedText const& message) +{ + auto snapshot = qsoReactionSnapshot(); + snapshot.selectionOrigin = DecodedMessageReaction::SelectionOrigin::Synthetic; + applyQsoReactionPlan(DecodedMessageReaction::planProcessMessage(message, snapshot), message); +} void MainWindow::setTxMsg(int n) { m_ntx=n; @@ -9474,13 +9166,13 @@ void MainWindow::genCQMsg () if(stdCall (my_callsign) || is_type_two) { msgtype (QString {"CQ %1 %2 %3"} - .arg (m_freqNominal / 1000 - m_freqNominal / 1000000 * 1000, 3, 10, QChar {'0'}) + .arg (m_operatingFrequency.rx () / 1000 - m_operatingFrequency.rx () / 1000000 * 1000, 3, 10, QChar {'0'}) .arg (my_callsign) .arg (grid.left (4)), ui->tx6); } else { msgtype (QString {"CQ %1 %2"} - .arg (m_freqNominal / 1000 - m_freqNominal / 1000000 * 1000, 3, 10, QChar {'0'}) + .arg (m_operatingFrequency.rx () / 1000 - m_operatingFrequency.rx () / 1000000 * 1000, 3, 10, QChar {'0'}) .arg (my_callsign), ui->tx6); } @@ -9557,6 +9249,30 @@ bool MainWindow::is77BitMode () const || "FST4" == m_mode || "Q65" == m_mode; } +bool MainWindow::rr73_tx4_allowed () const +{ + return Rr73Policy::tx4AllowsRr73 (m_mode, m_bShMsgs); +} + +bool MainWindow::send_rr73_for_tx4 () const +{ + return rr73_tx4_allowed () && ("FT4" == m_mode || m_send_RR73); +} + +void MainWindow::set_rr73_tx4 (bool enabled) +{ + if (enabled && !rr73_tx4_allowed ()) { + auto mode = m_bShMsgs ? tr ("%1 shorthand-message mode").arg (m_mode) : m_mode; + MessageBox::information_message (this, tr ( + "RR73 is not available in %1. Tx4 uses RRR in this mode.").arg (mode)); + return; + } + + m_send_RR73 = enabled; + if ("FT4" == m_mode) m_send_RR73 = true; + genStdMsgs (m_rpt); +} + void MainWindow::ScrollBarPosition(int n) { m_position=n; } @@ -9581,7 +9297,6 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) auto is_type_one = !is77BitMode () && is_compound && shortList (my_callsign); auto const& my_grid = m_config.my_grid ().left (4); auto const& hisBase = Radio::base_callsign (hisCall); - save_dxbase_(const_cast ((hisBase + " ").left(6).toLatin1().constData()), (FCL)6); auto eme_short_codes = m_config.enable_VHF_features () && ui->cbShMsgs->isChecked () && m_mode == "JT65"; @@ -9642,7 +9357,7 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) t1 = t1.asprintf("%4.4d",ui->sbSerialNumber->value()); sent=rst + t1; } - if(t1.contains(QRegularExpression {"\\d\\d\\d\\d"})) { + if(t1.contains(four_digit_regexp)) { t1 = m_config.RTTY_Exchange(); } } @@ -9693,13 +9408,13 @@ void MainWindow::genStdMsgs(QString rpt, bool unconditional) t=t0 + "R" + rpt; msgtype(t, ui->tx3); } - m_send_RR73=false; } - t=t0 + (m_send_RR73 ? "RR73" : "RRR"); + auto send_rr73 = send_rr73_for_tx4 (); + t=t0 + (send_rr73 ? "RR73" : "RRR"); if((m_mode=="MSK144" and !m_bShMsgs) or m_mode=="FT8" or m_mode=="FT4" || m_mode == "FST4" || m_mode == "Q65") { - if(!bHisCall and bMyCall) t=hisCall + " <" + my_callsign + "> " + (m_send_RR73 ? "RR73" : "RRR"); - if(bHisCall and !bMyCall) t="<" + hisCall + "> " + my_callsign + " " + (m_send_RR73 ? "RR73" : "RRR"); + if(!bHisCall and bMyCall) t=hisCall + " <" + my_callsign + "> " + (send_rr73 ? "RR73" : "RRR"); + if(bHisCall and !bMyCall) t="<" + hisCall + "> " + my_callsign + " " + (send_rr73 ? "RR73" : "RRR"); } if ((m_mode=="JT4" || m_mode=="Q65") && m_bShMsgs) t="@1500 (RRR)"; msgtype(t, ui->tx4); @@ -9814,12 +9529,7 @@ void MainWindow::clearDX () if (m_config.clear_DXgrid () or (SpecOp::HOUND == m_specOp && m_config.superFox())) ui->dxGridEntry->clear (); if (!keepTx5) ui->tx5->setCurrentText(""); // clear tx5 if (ui->respondComboBox->isVisible()) { - Dpoints=0; // reset points - maxDPoints=0; // reset points - dBpoints=-28; // reset points - dBpoints2=99; // reset points - maxdBPoints=-28; // reset points - mindBPoints=99; // reset points + m_autoRespondScores.reset(); } m_lastCallsign.clear (); m_rptSent.clear (); @@ -9853,7 +9563,7 @@ void MainWindow::lookup() for(int i=0; i<999999; i++) { n=f.readLine(c,sizeof(c)); if(n <= 0) { - if(!hisgrid0.contains(grid_regexp)) { + if(!hisgrid0.contains(MainWindow::grid_regexp)) { ui->dxGridEntry->clear(); } break; @@ -9878,116 +9588,8 @@ void MainWindow::lookup() } } -void MainWindow::on_lookupButton_clicked() //Lookup button -{ - qint64 ms=QDateTime::currentMSecsSinceEpoch(); - lookup(); - if((ms-m_msErase)<500) { - QString hisCall=ui->dxCallEntry->text(); - if (hisCall !="") QDesktopServices::openUrl (QUrl {"https://www.qrz.com/db/" + hisCall}); - } - m_msErase=ms; -} - -void MainWindow::on_addButton_clicked() //Add button -{ - if(!ui->dxGridEntry->text ().size ()) { - MessageBox::warning_message (this, tr ("Add to CALL3.TXT") - , tr ("Please enter a valid grid locator")); - return; - } - m_call3Modified=false; - QString hisCall=ui->dxCallEntry->text(); - QString hisgrid=ui->dxGridEntry->text(); - QString newEntry=hisCall + "," + hisgrid; - - // int ret = MessageBox::query_message(this, tr ("Add to CALL3.TXT"), - // tr ("Is %1 known to be active on EME?").arg (newEntry)); - // if(ret==MessageBox::Yes) { - // newEntry += ",EME,,"; - // } else { - newEntry += ",,,"; - // } - - QFile f1 {m_config.writeable_data_dir ().absoluteFilePath ("CALL3.TXT")}; - if(!f1.open(QIODevice::ReadWrite | QIODevice::Text)) { - MessageBox::warning_message (this, tr ("Add to CALL3.TXT") - , tr ("Cannot open \"%1\" for read/write: %2") - .arg (f1.fileName ()).arg (f1.errorString ())); - return; - } - if(f1.size()==0) { - QTextStream out(&f1); - out << "ZZZZZZ" -#if QT_VERSION >= QT_VERSION_CHECK (5, 15, 0) - << Qt::endl -#else - << endl -#endif - ; - f1.seek (0); - } - QFile f2 {m_config.writeable_data_dir ().absoluteFilePath ("CALL3.TMP")}; - if(!f2.open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text)) { - MessageBox::warning_message (this, tr ("Add to CALL3.TXT") - , tr ("Cannot open \"%1\" for writing: %2") - .arg (f2.fileName ()).arg (f2.errorString ())); - return; - } - { - QTextStream in(&f1); //Read from CALL3.TXT - QTextStream out(&f2); //Copy into CALL3.TMP - QString hc=hisCall; - QString hc1=""; - QString hc2="000000"; - QString s; - do { - s=in.readLine(); - hc1=hc2; - if(s.mid(0,2)=="//") { - out << s + QChar::LineFeed; //Copy all comment lines - } else { - int i1=s.indexOf(","); - hc2=s.mid(0,i1); - if(hc>hc1 && hchc1 && !m_call3Modified) out << newEntry + QChar::LineFeed; - } - if(m_call3Modified) { - auto const& old_path = m_config.writeable_data_dir ().absoluteFilePath ("CALL3.OLD"); - QFile f0 {old_path}; - if (f0.exists ()) f0.remove (); - f1.copy (old_path); // copying as we want to - // preserve symlinks - f1.open (QFile::WriteOnly | QFile::Text); // truncates - f2.seek (0); - QByteArray tmp = f2.readAll(); - if (tmp != (const char*)NULL) f1.write (tmp); // copy contents - else qDebug() << "tmp==NULL at f1.write"; - f2.remove (); - } -} -void MainWindow::on_ignoreButton_clicked() //Ignore button -{ - addCallsignToignoreList(); -} void MainWindow::msgtype(QString t, QLineEdit* tx) //msgtype() { @@ -10037,6 +9639,7 @@ void MainWindow::msgtype(QString t, QLineEdit* tx) //msgtype() void MainWindow::on_tx1_editingFinished() //tx1 edited { + if (m_ntx==1) clear_generated_message_error (); if (SpecOp::HOUND==m_specOp && m_config.superFox() && !m_bDoubleClicked) { clearDX(); return; @@ -10049,10 +9652,12 @@ void MainWindow::on_tx2_editingFinished() //tx2 edited { QString t=ui->tx2->text(); msgtype(t, ui->tx2); + if (m_ntx==2) clear_generated_message_error (); } void MainWindow::on_tx3_editingFinished() //tx3 edited { + if (m_ntx==3) clear_generated_message_error (); if (SpecOp::HOUND==m_specOp && m_config.superFox() && !m_bDoubleClicked) { clearDX(); return; @@ -10065,11 +9670,13 @@ void MainWindow::on_tx4_editingFinished() //tx4 edited { QString t=ui->tx4->text(); msgtype(t, ui->tx4); + if (m_ntx==4) clear_generated_message_error (); } void MainWindow::on_tx5_currentTextChanged (QString const& text) //tx5 edited { msgtype(text, ui->tx5->lineEdit ()); + if (m_ntx==5) clear_generated_message_error (); } void MainWindow::on_tx6_editingFinished() //tx6 edited @@ -10084,77 +9691,66 @@ void MainWindow::on_tx6_editingFinished() //tx6 edited if(t1.size()<=3 and t1.contains(NN3)) m_CQtype="CQ " + t1; } msgtype(t, ui->tx6); + if (m_ntx==6) clear_generated_message_error (); } -void MainWindow::on_RoundRobin_currentTextChanged(QString text) +void MainWindow::on_RoundRobin_currentTextChanged(QString) { - ui->sbTxPercent->setEnabled (text == tr ("Random")); + ui->sbTxPercent->setEnabled ( + configuredRoundRobinPolicy ().kind == BeaconTx::RoundRobinPolicy::Kind::Random); + m_beaconTxController.setRoundRobinPolicy (beaconRoundRobinPolicy ()); } -void MainWindow::on_DX_Call_Button_clicked (bool checked) -{ - if((m_mode=="FT8" or m_mode=="FT4" or m_mode=="Q65" or m_mode=="FST4" or m_mode=="MSK144") && - (m_specOp==SpecOp::NONE or m_specOp==SpecOp::HOUND) && ui->cbAutoSeq->isChecked() && checked - && (m_hisCall!="" or (m_mode=="FT8" && m_specOp==SpecOp::HOUND))) { - wait_and_call = true; // toggle Wait & Call on when allowed - } else { - wait_and_call = false; // toggle Wait & Call off in any other case - ui->DX_Call_Button->setChecked (false); - if (m_specOp==SpecOp::HOUND && m_config.superFox() && !m_auto) clearDX(); - } - check_button_color(); -} void MainWindow::wheelEvent(QWheelEvent *event) // mouse wheel events { - if(ui->labDialFreq->hasFocus() && !m_transmitting) { // kHz + or - - Frequency dial_frequency {m_rigState.ptt () && m_rigState.split () ? - m_rigState.tx_frequency () : m_rigState.frequency ()}; + if(ui->labDialFreq->hasFocus()) { // kHz + or - + Frequency dial_frequency {m_rigState.ptt () ? + (m_rigState.split () ? m_operatingFrequency.correctedTx (m_astroCorrection.tx) + : m_operatingFrequency.tx ()) : + m_operatingFrequency.correctedRx (m_astroCorrection.rx)}; if (event->angleDelta().x() > 2 or event->angleDelta().y() > 2) { dial_frequency = dial_frequency + 1000; - ui->labDialFreq->setText (Radio::pretty_frequency_MHz_string (dial_frequency)); } else if (event->angleDelta().x() < -2 or event->angleDelta().y() < -2) { dial_frequency = dial_frequency - 1000; + } + Frequency requested_frequency = dial_frequency; + if (m_astroWidget && m_astroWidget->doppler_tracking() + && m_astroWidget->DopplerMethod()!=0) { + requested_frequency -= m_astroCorrection.rx; + } + if (requestNominalFrequencyChange (requested_frequency, FrequencyRequestOrigin::User)) { ui->labDialFreq->setText (Radio::pretty_frequency_MHz_string (dial_frequency)); + setXIT (ui->TxFreqSpinBox->value ()); } - if (m_astroWidget && m_astroWidget->doppler_tracking() && m_astroWidget->DopplerMethod()!=0) { - setRig(dial_frequency - m_astroCorrection.rx); - } else { - setRig(dial_frequency); - } - setXIT (ui->TxFreqSpinBox->value ()); - ui->labDialFreq->clearFocus(); + ui->labDialFreq->clearFocus(); } } void MainWindow::mousePressEvent(QMouseEvent *event) // mouse press events { - if(ui->labDialFreq->hasFocus() && !m_transmitting) { // kHz + or - + if(ui->labDialFreq->hasFocus()) { // kHz + or - if (event->button() & Qt::RightButton) { - m_bandEdited = true; - band_changed(m_freqNominal+1000); + requestBandChange (m_operatingFrequency.rx () + 1000, FrequencyRequestOrigin::User); } else if (event->button() & Qt::LeftButton) { - m_bandEdited = true; - band_changed(m_freqNominal-1000); + requestBandChange (m_operatingFrequency.rx () - 1000, FrequencyRequestOrigin::User); } ui->labDialFreq->clearFocus(); } if(ui->tuneButton->hasFocus() && (event->button() & Qt::RightButton)) { // Tune button - m_config.transceiver_tune (false); // reset any prior rig tuning - blocked=true; - m_config.transceiver_tune (true); // toggle rig tuning - blocked=false; - if(ui->tuneButton->text()=="Tuning") { // reset Tune button by another right-click + if (rigTuneTimer.isActive ()) { + rigTuneTimer.stop (); ui->tuneButton->setChecked(false); ui->tuneButton->setText("Tune"); m_config.transceiver_tune (false); // reset rig tuning } else { + m_config.transceiver_tune (false); // reset any prior rig tuning + blocked=true; + m_config.transceiver_tune (true); + blocked=false; ui->tuneButton->setChecked(true); ui->tuneButton->setText("Tuning"); - QTimer::singleShot (6000, [=] { // reset Tune button after 6 seconds - ui->tuneButton->setChecked(false); - ui->tuneButton->setText("Tune"); - }); + rigTuneTimer.start (6000); } ui->tuneButton->clearFocus(); } @@ -10163,12 +9759,7 @@ void MainWindow::mousePressEvent(QMouseEvent *event) // mouse press events ui->dxGridEntry->clear (); // clear dxGridEntry if (!keepTx5) ui->tx5->setCurrentText(""); // clear tx5 if (ui->respondComboBox->isVisible()) { - Dpoints=0; // reset points - maxDPoints=0; // reset points - dBpoints=-28; // reset points - dBpoints2=99; // reset points - maxdBPoints=-28; // reset points - mindBPoints=99; // reset points + m_autoRespondScores.reset(); } ui->DX_Call_Button->clearFocus(); } @@ -10176,16 +9767,11 @@ void MainWindow::mousePressEvent(QMouseEvent *event) // mouse press events ui->decodedTextBrowser2->erase (); ui->EraseButton->clearFocus(); } - if(ui->txFirstCheckBox->isVisible() && ui->txFirstCheckBox->hasFocus() && (event->button() & Qt::RightButton)) { - ui->txFirstCheckBox->setEnabled(false); // freeze txFirstCheckBox - ui->txFirstCheckBox->clearFocus(); - } - if(ui->msk144Button->hasFocus() && (event->button() & Qt::RightButton)) { - ui->txFirstCheckBox->setEnabled(true); // unfreeze txFirstCheckBox - ui->ft8Button->clearFocus(); - ui->msk144Button->clearFocus(); - } if(ui->q65Button->hasFocus() && (event->button() & Qt::RightButton)) { // switch to Q65_Pileup mode + if (m_specOp != SpecOp::Q65_PILEUP) { + m_q65PileupCopiedLastRxCall.clear(); + m_q65PileupCopiedCallers.clear(); + } m_config.setSpecial_Q65_Pileup(); m_specOp=m_config.special_op_id(); on_actionQ65_triggered(); @@ -10199,14 +9785,13 @@ void MainWindow::mousePressEvent(QMouseEvent *event) // mouse press events keep_frequency = true; not_erase = true; // prevent erasing the decodedTextBrowser m_config.toggle_SF(); - QTimer::singleShot (250, [=] { + QTimer::singleShot (250, this, [=] { keep_frequency = false; not_erase = false; }); on_actionFT8_triggered(); ui->houndButton->clearFocus(); - ui->labDXped->setStyleSheet("QLabel {background-color: red; color: white;}"); - QTimer::singleShot (250, [=] {keep_frequency = false;}); + QTimer::singleShot (250, this, [=] {keep_frequency = false;}); } // Search callsign on qrz.com, qrzcq.com or hamqth.com if(ui->lookupButton->hasFocus() && (event->button() & Qt::RightButton)) { // search callsign on QRZ.com @@ -10225,7 +9810,16 @@ void MainWindow::mousePressEvent(QMouseEvent *event) // mouse press events ui->ignoreButton->clearFocus(); } // Wait & Pounce - if(ui->autoButton->hasFocus() && (event->button() & Qt::RightButton) && ui->respondComboBox->currentText()!="CQ: None") { + if(ui->autoButton->hasFocus() && (event->button() & Qt::RightButton)) { + if (!pounce && autoRespondPolicy () == AutoRespondPolicy::None) { + auto const message = tr ("Wait & Pounce requires a CQ response mode.\n" + "Change CQ: None to another option."); + ui->respondComboBox->setFocus(Qt::OtherFocusReason); + QTimer::singleShot (100, this, [this, message] { + QToolTip::showText(ui->respondComboBox->mapToGlobal(ui->respondComboBox->rect().bottomLeft()), + message, ui->respondComboBox, QRect {}, 5000); + }); + } else { if (!pounce && !m_auto && m_config.Wait_features_enabled() && SpecOp::FOX!=m_specOp) { pounce = true; check_button_color(); @@ -10236,18 +9830,16 @@ void MainWindow::mousePressEvent(QMouseEvent *event) // mouse press events check_button_color(); } ui->autoButton->clearFocus(); + } } if(ui->DecodeButton->hasFocus() && (event->button() & Qt::RightButton)) { // Decode button - if(m_decoderBusy) { - to_jt9(m_ihsym,-1,-1); //Allow jt9 to bail out early, if necessary - decodeDone(); //Clear a hung decoder status - } + clearHungDecoderStatus("Decode button right-click"); ui->DecodeButton->clearFocus(); } if(ui->ft8Button->hasFocus() && (event->button() & Qt::RightButton)) { // Switch contest mode on/off keep_frequency = true; not_erase = true; // prevent erasing the decodedTextBrowser - QTimer::singleShot (350, [=] {not_erase = false;}); + QTimer::singleShot (350, this, [=] {not_erase = false;}); m_specOp=m_config.special_op_id(); if (!m_config.bSpecialOp()) { m_config.setSpecial_On(); @@ -10285,14 +9877,14 @@ void MainWindow::mousePressEvent(QMouseEvent *event) // mouse press events "Fox-and-Hound operation is available only in FT8 mode.\nGo back and change your selection."); } ui->labDXped->setVisible(SpecOp::NONE != m_specOp); - if ((!verified && ui->labDXped->isVisible()) or ui->labDXped->text()!="Super Hound") - ui->labDXped->setStyleSheet("QLabel {background-color: red; color: white;}"); + if (!isSuperHoundOperation ()) m_houndVerified = false; + updateHoundVerificationStyle (); set_mode(m_mode); configActiveStations(); check_button_color(); ui->ft8Button->clearFocus(); statusChanged(); - QTimer::singleShot (250, [=] {keep_frequency = false;}); + QTimer::singleShot (250, this, [=] {keep_frequency = false;}); } // freeze the Tx5 text if(ui->txb5->hasFocus() && (event->button() & Qt::RightButton)) { @@ -10307,66 +9899,39 @@ void MainWindow::mousePressEvent(QMouseEvent *event) // mouse press events } // Toggle FT8 DXp frequencies if(ui->pb80->hasFocus() && (event->button() & Qt::RightButton) && (m_mode=="FT8" || m_mode=="FT4")) { - keep_frequency = true; - setRig(3567000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setXIT (ui->TxFreqSpinBox->value ()); + requestAlternateBandFrequency (3567000); ui->pb80->clearFocus(); } if(ui->pb40->hasFocus() && (event->button() & Qt::RightButton) && (m_mode=="FT8" || m_mode=="FT4")) { - keep_frequency = true; - setRig(7056000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setXIT (ui->TxFreqSpinBox->value ()); + requestAlternateBandFrequency (7056000); ui->pb40->clearFocus(); } if(ui->pb30->hasFocus() && (event->button() & Qt::RightButton) && (m_mode=="FT8" || m_mode=="FT4")) { - keep_frequency = true; - setRig(10131000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setXIT (ui->TxFreqSpinBox->value ()); + requestAlternateBandFrequency (10131000); ui->pb30->clearFocus(); } if(ui->pb20->hasFocus() && (event->button() & Qt::RightButton) && (m_mode=="FT8" || m_mode=="FT4")) { - keep_frequency = true; - setRig(14090000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setXIT (ui->TxFreqSpinBox->value ()); + requestAlternateBandFrequency (14090000); ui->pb20->clearFocus(); } if(ui->pb17->hasFocus() && (event->button() & Qt::RightButton) && (m_mode=="FT8" || m_mode=="FT4")) { - keep_frequency = true; - setRig(18095000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setXIT (ui->TxFreqSpinBox->value ()); + requestAlternateBandFrequency (18095000); ui->pb17->clearFocus(); } if(ui->pb15->hasFocus() && (event->button() & Qt::RightButton) && (m_mode=="FT8" || m_mode=="FT4")) { - keep_frequency = true; - setRig(21091000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setXIT (ui->TxFreqSpinBox->value ()); + requestAlternateBandFrequency (21091000); ui->pb15->clearFocus(); } if(ui->pb12->hasFocus() && (event->button() & Qt::RightButton) && (m_mode=="FT8" || m_mode=="FT4")) { - keep_frequency = true; - setRig(24911000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setXIT (ui->TxFreqSpinBox->value ()); + requestAlternateBandFrequency (24911000); ui->pb12->clearFocus(); } if(ui->pb10->hasFocus() && (event->button() & Qt::RightButton) && (m_mode=="FT8" || m_mode=="FT4")) { - keep_frequency = true; - setRig(28091000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setXIT (ui->TxFreqSpinBox->value ()); + requestAlternateBandFrequency (28091000); ui->pb10->clearFocus(); } if(ui->pb6->hasFocus() && (event->button() & Qt::RightButton) && m_mode=="FT8") { - keep_frequency = true; - setRig(50323000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setXIT (ui->TxFreqSpinBox->value ()); + requestAlternateBandFrequency (50323000); ui->pb6->clearFocus(); } if(ui->pb2->hasFocus() && (event->button() & Qt::RightButton)) { @@ -10375,45 +9940,44 @@ void MainWindow::mousePressEvent(QMouseEvent *event) // mouse press events f = 222174000; } else { f = 70154000; - if (m_mode=="MSK144") { + if (m_mode=="MSK144" + && nominalFrequencyChangeAllowed (FrequencyRequestOrigin::User)) { ui->sbTR->setValue (m_msk144_tr6); programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); + QTimer::singleShot (250, this, [=] {programStart = false;}); } } - auto const& row = m_config.frequencies ()->best_working_frequency (f); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(f); - QTimer::singleShot (250, [=] {keep_frequency = false;}); + if (nominalFrequencyChangeAllowed (FrequencyRequestOrigin::User)) { + auto const row = m_config.frequencies ()->best_working_frequency (f); + if (row >= 0) { + ui->bandComboBox->setCurrentIndex (row); + on_bandComboBox_activated (row); + } else { + requestAlternateBandFrequency (f); + } } - setXIT (ui->TxFreqSpinBox->value ()); ui->pb2->clearFocus(); } if(ui->pb70->hasFocus() && (event->button() & Qt::RightButton)) { - auto const& row = m_config.frequencies ()->best_working_frequency (1296174000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(1296174000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); + if (nominalFrequencyChangeAllowed (FrequencyRequestOrigin::User)) { + auto const row = m_config.frequencies ()->best_working_frequency (1296174000); + if (row >= 0) { + ui->bandComboBox->setCurrentIndex (row); + on_bandComboBox_activated (row); + } else { + requestAlternateBandFrequency (1296174000); + } } - setXIT (ui->TxFreqSpinBox->value ()); ui->pb70->clearFocus(); } if (ui->pbBandHopping->hasFocus() && event->button() & Qt::RightButton) { // Band Hopping button if(ui->pbBandHopping->isChecked()) { - bandHopping(); // Force band hopping to switch to the next selected frequency + bandHopping(true); // Force band hopping to switch to the next selected frequency } else { // Testing the default audio device #ifdef WIN32 QAudioOutput info(QAudioDeviceInfo::defaultOutputDevice()); - QString audioPath = app_sounds_directory (m_config.voicesPath()); + QString audioPath = m_config.voice_directory ().absolutePath (); QAudioFormat format; format.setCodec("audio/pcm"); format.setSampleRate (48000); @@ -10427,8 +9991,7 @@ void MainWindow::mousePressEvent(QMouseEvent *event) // mouse press events effect->open(QIODevice::ReadOnly); audio->start(effect); #else - QString audioPath = app_sounds_directory (m_config.voicesPath()); - QSound::play(audioPath + "Testing_long.wav"); // for Linux and macOS + QSound::play (m_config.voice_directory ().absoluteFilePath ("Testing_long.wav")); // for Linux and macOS #endif } ui->pbBandHopping->clearFocus(); @@ -10437,6 +10000,7 @@ void MainWindow::mousePressEvent(QMouseEvent *event) // mouse press events void MainWindow::on_dxCallEntry_textChanged (QString const& call) { + m_q65PileupCopiedLastRxCall.clear(); if (SpecOp::HOUND==m_specOp && m_config.superFox() && !(m_bDoubleClicked or (m_hisCall0 != "" && (call.left(6).contains(m_hisCall0) or call.right(6).contains(m_hisCall0)))) && !ui->DX_Call_Button->isChecked()) { // allow Wait & Call @@ -10456,7 +10020,6 @@ void MainWindow::on_dxCallEntry_textChanged (QString const& call) void MainWindow::on_dxCallEntry_editingFinished() { auto const& dxBase = Radio::base_callsign (m_hisCall); - save_dxbase_(const_cast ((dxBase + " ").left (6).toLatin1().constData()), (FCL)6); if(m_QSYMessageCreatorWidget) m_QSYMessageCreatorWidget->getDxBase(QString(dxBase)); } @@ -10499,21 +10062,6 @@ void MainWindow::on_dxGridEntry_textChanged (QString const& grid) } } -void MainWindow::on_genStdMsgsPushButton_clicked() //genStdMsgs button -{ - ui->pbBandHopping->setChecked(false); // disable band hopping - genStdMsgs(m_rpt); - if (!m_bDoubleClicked && m_hisCall!="") { - if (ui->tx1->isEnabled ()) { - QTimer::singleShot (0, ui->txrb1, SLOT (click ())); // Go to Tx1 - } else { - QTimer::singleShot (0, ui->txrb2, SLOT (click ())); // Go to Tx2 if Tx1 is disabled - } - m_bMyCallStd=stdCall(m_config.my_callsign()); //ft8md - m_bHisCallStd=stdCall(m_hisCall); //ft8md - - } -} void MainWindow::cease_auto_Tx_after_QSO () { @@ -10527,94 +10075,6 @@ void MainWindow::cease_auto_Tx_after_QSO () } } -void MainWindow::on_logQSOButton_clicked() //Log QSO button -{ - if (!((m_config.repeat_Tx() or !m_send_RR73) && (m_mode=="MSK144" or m_mode=="Q65"))) { - if (SpecOp::NA_VHF==m_specOp && m_mode=="FT4" && m_config.NCCC_Sprint()) { - QTimer::singleShot (int(850.0*m_TRperiod), [=] {cease_auto_Tx_after_QSO ();}); - } else { - cease_auto_Tx_after_QSO (); - } - } - - if (!m_hisCall.size ()) { - MessageBox::warning_message (this, tr ("Warning: DX Call field is empty.")); - if ((SpecOp::NA_VHF == m_specOp or SpecOp::WW_DIGI == m_specOp) && m_config.autoLog()) return; // prevent program crash - } - // m_dateTimeQSOOn should really already be set but we'll ensure it gets set to something just in case - if (!m_dateTimeQSOOn.isValid ()) { - auto now = QDateTime::currentDateTimeUtc(); - m_dateTimeQSOOn = now.addSecs (-(m_ntx - 2) * int(m_TRperiod) - - int(fmod(double(now.time().second()),m_TRperiod))); - } - auto dateTimeQSOOff = QDateTime::currentDateTimeUtc(); - if (dateTimeQSOOff < m_dateTimeQSOOn) dateTimeQSOOff = m_dateTimeQSOOn; - QString grid=m_hisGrid; - if(grid=="....") grid=""; - - // Optionally replace empty grids by "ZZ00" - if(m_config.ZZ00() && m_hisGrid=="" && m_specOp!=SpecOp::NONE && m_specOp!=SpecOp::FOX && m_specOp!=SpecOp::HOUND) m_hisGrid = "ZZ00"; - - switch( m_specOp ) - { - case SpecOp::NA_VHF: - m_xSent=m_config.my_grid().left(4); - m_xRcvd=m_hisGrid.left(4); - break; - case SpecOp::EU_VHF: - m_rptSent=m_xSent.split(" ").at(0).left(2); - m_rptRcvd=m_xRcvd.split(" ").at(0).left(2); - if(m_xRcvd.split(" ").size()>=2) m_hisGrid=m_xRcvd.split(" ").at(1); - grid=m_hisGrid; - ui->dxGridEntry->setText(grid); - break; - case SpecOp::FIELD_DAY: - m_rptSent=m_xSent.split(" ").at(0); - m_rptRcvd=m_xRcvd.split(" ").at(0); - break; - case SpecOp::RTTY: - m_rptSent=m_xSent.split(" ").at(0); - m_rptRcvd=m_xRcvd.split(" ").at(0); - break; - case SpecOp::WW_DIGI: - m_xSent=m_config.my_grid().left(4); - m_xRcvd=m_hisGrid.left(4); - break; - case SpecOp::ARRL_DIGI: - m_xSent=m_config.my_grid().left(4); - m_xRcvd=m_hisGrid.left(4); - break; - case SpecOp::Q65_PILEUP: - m_xSent=m_config.my_grid().left(4); - m_xRcvd=m_hisGrid; - break; - default: break; - } - - m_logDlg->initLogQSO (m_hisCall, grid, m_mode, m_rptSent, m_rptRcvd, - m_dateTimeQSOOn, dateTimeQSOOff, m_freqNominal + - ui->TxFreqSpinBox->value(), m_noSuffix, m_xSent, m_xRcvd); - m_inQSOwith=""; - if (ui->respondComboBox->isVisible() && ui->respondComboBox->currentText() != "CQ: None") { - Dpoints=0; // reset points - maxDPoints=0; // reset points - dBpoints=-28; // reset points - dBpoints2=99; // reset points - maxdBPoints=-28; // reset points - mindBPoints=99; // reset points - } - QTimer::singleShot (2000, [=] { - pounce = false; - filtered = false; - read_txLog(); - check_button_color(); - }); - QTimer::singleShot (7000, [=] { - read_txLog(); - }); - stopWRTimer.stop(); // Stop any Wait & Reply timeout - stopWCTimer.stop(); // Stop any Wait & Call timeout -} void MainWindow::acceptQSO (QDateTime const& QSO_date_off, QString const& call, QString const& grid , Frequency dial_freq, QString const& mode @@ -10665,7 +10125,7 @@ void MainWindow::acceptQSO (QDateTime const& QSO_date_off, QString const& call, blocked=true; // needed to clear DXgrid only optionally if (m_config.clear_DXcall ()) clearDX (); if (m_config.clear_DXgrid ()) ui->dxGridEntry->clear (); - QTimer::singleShot (50, [=] {blocked = false;}); // needed to clear DXgrid only optionally + QTimer::singleShot (50, this, [=] {blocked = false;}); // needed to clear DXgrid only optionally m_dateTimeQSOOn = QDateTime {}; if(m_specOp!=SpecOp::NONE and m_specOp!=SpecOp::FOX and m_specOp!=SpecOp::HOUND) { ui->sbSerialNumber->setValue(ui->sbSerialNumber->value() + 1); @@ -10717,78 +10177,75 @@ void MainWindow::updateRate() m_ActiveStationsWidget->setBandChanges(nbc); } -qint64 MainWindow::nWidgets(QString t) -{ - Q_ASSERT(t.length()==N_WIDGETS); - qint64 n=0; - for(int i=0; itxFirstCheckBox->setVisible(b); - if(i==1) ui->TxFreqSpinBox->setVisible(b); - if(i==2) ui->RxFreqSpinBox->setVisible(b); - if(i==3) ui->sbFtol->setVisible(b); - if(i==4) ui->rptSpinBox->setVisible(b); - if(i==5) ui->sbTR->setVisible(b); - if(i==6) { - ui->sbCQTxFreq->setVisible (b); - ui->cbCQTx->setVisible (b); - auto is_compound = m_config.my_callsign () != m_baseCall; - ui->cbCQTx->setEnabled (b && (!is_compound || shortList (m_config.my_callsign ()))); - } - if(i==7) ui->cbShMsgs->setVisible(b); - if(i==8) ui->cbFast9->setVisible(b); - if(i==9) ui->cbAutoSeq->setVisible(b); - if(i==10) ui->cbTx6->setVisible(b); - // if(i==11) ui->pbTxMode->setVisible(b); - if(i==12) ui->pbR2T->setVisible(b); - if(i==13) ui->pbT2R->setVisible(b); - if(i==14) ui->cbHoldTxFreq->setVisible(b); - if(i==15) ui->sbSubmode->setVisible(b); - if(i==16) ui->syncSpinBox->setVisible(b); - if(i==17) ui->WSPR_controls_widget->setVisible(b); - if(i==18) ui->ClrAvgButton->setVisible(b); - if(i==19) ui->actionQuickDecode->setEnabled(b); - if(i==19) ui->actionMediumDecode->setEnabled(b); - if(i==19) ui->actionDeepestDecode->setEnabled(b); - if(i==20) ui->actionInclude_averaging->setVisible (b); - if(i==21) ui->actionInclude_correlation->setVisible (b); - if(i==22) { - if(!b && m_echoGraph->isVisible()) m_echoGraph->hide(); - } - if(i==23) ui->cbSWL->setVisible(b); - if(i==24) ui->actionEnable_AP_FT8->setVisible (b); - if(i==24) ui->actionHide_AP_info->setVisible (b); - if(i==25) ui->actionEnable_AP_JT65->setVisible (b); - if(i==26) ui->actionEnable_AP_DXcall->setVisible (b); - if(i==27) ui->respondComboBox->setVisible(b); - if(i==29) ui->measure_check_box->setVisible(b); - if(i==30) ui->labDXped->setVisible(b); - if(i==31) ui->cbRxAll->setVisible(b); - if(i==32) ui->cbCQonly->setVisible(b); - if(i==33) ui->sbTR_FST4W->setVisible(b); - if (34 == i) // adjust the stacked widget - { - ui->opt_controls_stack->setCurrentIndex (b ? 1 : 0); - ui->sbF_Low->setVisible(b); - } - if(i==35) ui->sbF_High->setVisible(b); - if(i==36) ui->actionAuto_Clear_Avg->setVisible (b); - if(i==37) ui->sbMaxDrift->setVisible(b); - j=j>>1; - } +void MainWindow::applyModeUiState(ModeUiState state) +{ + auto visible = [state] (ModeUiControl control) { + return std::find(state.begin(), state.end(), control) != state.end(); + }; + auto setLabeledControlVisible = [&visible] (ModeUiControl control, QWidget * widget, QLabel * label) { + auto const show = visible(control); + widget->setVisible(show); + label->setVisible(show); + }; + + ui->txFirstCheckBox->setVisible(visible(ModeUiControl::TxFirst)); + setLabeledControlVisible(ModeUiControl::TxFrequency, ui->TxFreqSpinBox, m_txFrequencyLabel); + setLabeledControlVisible(ModeUiControl::RxFrequency, ui->RxFreqSpinBox, m_rxFrequencyLabel); + setLabeledControlVisible(ModeUiControl::FrequencyTolerance, ui->sbFtol, m_frequencyToleranceLabel); + updateFrequencyToleranceRowAlignment (); + setLabeledControlVisible(ModeUiControl::Report, ui->rptSpinBox, m_reportLabel); + setTrPeriodVisible(visible(ModeUiControl::TrPeriod)); + + auto const showCqTxFrequency = visible(ModeUiControl::CqTxFrequency); + ui->sbCQTxFreq->setVisible(showCqTxFrequency); + ui->cbCQTx->setVisible(showCqTxFrequency); + auto const isCompoundCall = m_config.my_callsign() != m_baseCall; + ui->cbCQTx->setEnabled(showCqTxFrequency && (!isCompoundCall || shortList(m_config.my_callsign()))); + + ui->cbShMsgs->setVisible(visible(ModeUiControl::ShortMessages)); + ui->cbFast9->setVisible(visible(ModeUiControl::Fast9)); + ui->cbAutoSeq->setVisible(visible(ModeUiControl::AutoSequence)); + ui->cbTx6->setVisible(visible(ModeUiControl::Tx6)); + ui->pbR2T->setVisible(visible(ModeUiControl::CopyRxToTx)); + ui->pbT2R->setVisible(visible(ModeUiControl::CopyTxToRx)); + ui->cbHoldTxFreq->setVisible(visible(ModeUiControl::HoldTxFrequency)); + setLabeledControlVisible(ModeUiControl::Submode, ui->sbSubmode, m_submodeLabel); + ui->syncSpinBox->setVisible(visible(ModeUiControl::Sync)); + ui->WSPR_controls_widget->setVisible(visible(ModeUiControl::WsprControls)); + ui->ClrAvgButton->setVisible(visible(ModeUiControl::ClearAverage)); + + auto const decodeDepthEnabled = visible(ModeUiControl::DecodeDepth); + ui->actionQuickDecode->setEnabled(decodeDepthEnabled); + ui->actionMediumDecode->setEnabled(decodeDepthEnabled); + ui->actionDeepestDecode->setEnabled(decodeDepthEnabled); + ui->actionInclude_averaging->setVisible(visible(ModeUiControl::IncludeAveraging)); + ui->actionInclude_correlation->setVisible(visible(ModeUiControl::IncludeCorrelation)); + if (!visible(ModeUiControl::EchoGraph) && m_echoGraph->isVisible()) m_echoGraph->hide(); + ui->cbSWL->setVisible(visible(ModeUiControl::Swl)); + + auto const showFt8Ap = visible(ModeUiControl::ApFt8); + ui->actionEnable_AP_FT8->setVisible(showFt8Ap); + ui->actionHide_AP_info->setVisible(showFt8Ap); + ui->actionEnable_AP_JT65->setVisible(visible(ModeUiControl::ApJt65)); + ui->actionEnable_AP_DXcall->setVisible(visible(ModeUiControl::ApDxCall)); + ui->respondComboBox->setVisible(visible(ModeUiControl::Respond)); + ui->measure_check_box->setVisible(visible(ModeUiControl::Measure)); + ui->labDXped->setVisible(visible(ModeUiControl::DxpedLabel)); + ui->cbRxAll->setVisible(visible(ModeUiControl::RxAll)); + ui->cbCQonly->setVisible(visible(ModeUiControl::CqOnly)); + ui->sbTR_FST4W->setVisible(visible(ModeUiControl::Fst4wTrPeriod)); + + auto const showLowFrequency = visible(ModeUiControl::LowFrequency); + auto const showHighFrequency = visible(ModeUiControl::HighFrequency); + ui->opt_controls_stack->setCurrentIndex(showLowFrequency ? 1 : 0); + ui->sbF_Low->setVisible(showLowFrequency); + ui->sbF_High->setVisible(showHighFrequency); + ui->actionAuto_Clear_Avg->setVisible(visible(ModeUiControl::AutoClearAverage)); + setLabeledControlVisible(ModeUiControl::MaxDrift, ui->sbMaxDrift, m_maxDriftLabel); + if (visible(ModeUiControl::FoxQueueTab)) ui->tabWidget->setCurrentIndex(fox_queue_tab_index); + ui->pbBestSP->setVisible(m_mode=="FT4"); - b=false; + bool b=false; if(m_mode=="FT4" or m_mode=="FT8" || "Q65" == m_mode) { b=SpecOp::EU_VHF==m_specOp or ( SpecOp::RTTY==m_specOp and @@ -10796,17 +10253,440 @@ void MainWindow::displayWidgets(qint64 n) } if(m_mode=="MSK144") b=SpecOp::EU_VHF==m_specOp; ui->sbEchoAvg->setVisible(m_mode=="Echo"); + ui->sbSerialNumber->setMaximum(SpecOp::EU_VHF==m_specOp ? eu_vhf_type5_serial_max : default_serial_number_max); ui->sbSerialNumber->setVisible(b); + ui->opt_controls_stack->setVisible (b || showLowFrequency || showHighFrequency); m_lastCallsign.clear (); // ensures Tx5 is updated for new modes b=m_mode.startsWith("FST4"); ui->sbNB->setVisible(b); genStdMsgs (m_rpt, true); configActiveStations(); + updateDecodeAccessibility(); +} + +QString MainWindow::specOpLabel() const +{ + if (m_mode == "MSK144" && m_specOp != SpecOp::EU_VHF + && !(m_specOp == SpecOp::NA_VHF && !m_config.NCCC_Sprint ())) return {}; + return SpecOpLabel::label (m_specOp, m_config.NCCC_Sprint (), m_config.superFox ()); +} + +void MainWindow::initializeFFT(int nsps) +{ + m_nsps = nsps; + m_FFTSize = m_nsps / 2; + if (m_tci_audio) Q_EMIT m_config.transceiver_blocksize(m_FFTSize); + else Q_EMIT FFTSize(m_FFTSize); +} + +void MainWindow::initializeFFT(int nsps, int fftSize) +{ + m_nsps = nsps; + m_FFTSize = fftSize; + if (m_tci_audio) Q_EMIT m_config.transceiver_blocksize(m_FFTSize); + else Q_EMIT FFTSize(m_FFTSize); +} + +void MainWindow::setTxButtonsEnabled(bool enabled) +{ + ui->txrb2->setEnabled(enabled); + ui->txrb4->setEnabled(enabled); + ui->txrb5->setEnabled(enabled); + ui->txrb6->setEnabled(enabled); + ui->txb2->setEnabled(enabled); + ui->txb4->setEnabled(enabled); + ui->txb5->setEnabled(enabled); + ui->txb6->setEnabled(enabled); +} + +void MainWindow::setDXInfo(QString const& call, QString const& grid) +{ + ui->dxCallEntry->setText(call); + ui->dxGridEntry->setText(grid); +} + +void MainWindow::updateMainWindowAccessibility() +{ + auto const tooltipDescription = [] (QWidget *widget) + { + if (widget && widget->accessibleDescription ().isEmpty ()) widget->setAccessibleDescription (widget->toolTip ()); + }; + + ui->dxCallEntry->setAccessibleName (tr ("DX call")); + ui->dxCallEntry->setAccessibleDescription (tr ("Callsign of station to be worked.")); + ui->dxGridEntry->setAccessibleName (tr ("DX grid")); + ui->dxGridEntry->setAccessibleDescription (tr ("Locator of station to be worked.")); + ui->DX_Call_Button->setAccessibleName (tr ("Wait and Call")); + ui->DX_Call_Button->setAccessibleDescription (ui->DX_Call_Button->toolTip ()); + ui->lookupButton->setAccessibleName (tr ("Lookup DX call")); + ui->addButton->setAccessibleName (tr ("Add DX call")); + ui->ignoreButton->setAccessibleName (tr ("Ignore DX call")); + + ui->respondComboBox->setAccessibleName (tr ("CQ response mode")); + ui->respondComboBox->setAccessibleDescription (tr ("Selects a station automatically from replies to your pending CQ after Enable Tx is armed in the current receive period, or from CQ messages for Wait & Pounce.")); + ui->TxFreqSpinBox->setAccessibleName (tr ("Transmit audio frequency")); + ui->RxFreqSpinBox->setAccessibleName (tr ("Receive audio frequency")); + ui->sbFtol->setAccessibleName (tr ("Frequency tolerance")); + ui->rptSpinBox->setAccessibleName (tr ("Signal report")); + ui->sbTR->setAccessibleName (tr ("Transmit and receive period")); + ui->sbSubmode->setAccessibleName (tr ("Submode")); + ui->sbMaxDrift->setAccessibleName (tr ("Maximum drift")); + ui->bandComboBox->setAccessibleName (tr ("Operating band")); + if (ui->bandComboBox->lineEdit ()) ui->bandComboBox->lineEdit ()->setAccessibleName (tr ("Operating band text")); + ui->outAttenuation->setAccessibleName (tr ("Transmit power attenuation")); + ui->outAttenuation->setAccessibleDescription (tr ("Adjust transmit drive attenuation.")); + ui->cbMenus->setAccessibleName (tr ("Menus")); + ui->cbMenus->setAccessibleDescription (tr ("Show or hide the menu bar.")); + ui->readFreq->setAccessibleName (tr ("Rig control status")); + ui->labDialFreq->setAccessibleName (tr ("USB dial frequency")); + ui->houndButton->setAccessibleName (tr ("Hound mode")); + ui->houndButton->setAccessibleDescription (tr ("Toggle FT8 hound mode. Right-click to toggle SuperFox mode.")); + + auto const message_selector_name = tr ("Message panel selector"); + auto const message_selector_description = tr ("Switches between standard messages, Fox queue, and band hopping pages. Press 1, 2, or 3 while focused to select a page."); + ui->tabWidget->setAccessibleName (message_selector_name); + ui->tabWidget->setAccessibleDescription (message_selector_description); + if (ui->tabWidget->tabBar ()) + { + auto *tab_bar = ui->tabWidget->tabBar (); + tab_bar->setAccessibleName (message_selector_name); + tab_bar->setAccessibleDescription (message_selector_description); + tab_bar->setFocusPolicy (Qt::StrongFocus); + } + ui->tabWidget->setTabToolTip (0, tr ("Standard messages")); + ui->tabWidget->setTabToolTip (1, tr ("Fox queue")); + ui->tabWidget->setTabToolTip (2, tr ("Band hopping")); + ui->tabWidget->widget (0)->setAccessibleName (tr ("Standard messages page")); + ui->tabWidget->widget (1)->setAccessibleName (tr ("Fox queue page")); + ui->tabWidget->widget (2)->setAccessibleName (tr ("Band hopping page")); + ui->houndQueueTextBrowser->setAccessibleName (tr ("Hound queue")); + ui->houndQueueTextBrowser->setAccessibleDescription (tr ("Queued Hound callers available for Fox transmissions.")); + ui->foxTxListTextBrowser->setAccessibleName (tr ("Fox transmissions in progress")); + ui->foxTxListTextBrowser->setAccessibleDescription (tr ("Hound callers currently in progress for Fox transmissions.")); + ui->comboBoxHoundSort->setAccessibleName (tr ("Hound queue sort order")); + ui->sbNlist->setAccessibleName (tr ("Hound queue list size")); + ui->sbNslots->setAccessibleName (tr ("Fox transmission slots")); + ui->comboBoxCQ->setAccessibleName (tr ("Fox CQ message")); + ui->pbFoxReset->setAccessibleName (tr ("Reset Fox queues")); + ui->pbFreeText->setAccessibleName (tr ("Fox free text")); + ui->cbSendMsg->setAccessibleName (tr ("Send Fox free text")); + ui->pbBandHopping->setAccessibleName (tr ("Band hopping")); + ui->cbQRG1->setAccessibleName (tr ("Enable FT8 QRG 1")); + ui->cbQRG2->setAccessibleName (tr ("Enable FT8 QRG 2")); + ui->cbQRG3->setAccessibleName (tr ("Enable FT8 QRG 3")); + ui->cbQRG4->setAccessibleName (tr ("Enable FT8 QRG 4")); + ui->cbQRG5->setAccessibleName (tr ("Enable FT8 QRG 5")); + ui->cbQRG6->setAccessibleName (tr ("Enable FT8 QRG 6")); + ui->cbQRG7->setAccessibleName (tr ("Enable FT8 QRG 7")); + ui->cbQRG8->setAccessibleName (tr ("Enable FT8 QRG 8")); + ui->sbQRG1->setAccessibleName (tr ("FT8 QRG 1 frequency")); + ui->sbQRG2->setAccessibleName (tr ("FT8 QRG 2 frequency")); + ui->sbQRG3->setAccessibleName (tr ("FT8 QRG 3 frequency")); + ui->sbQRG4->setAccessibleName (tr ("FT8 QRG 4 frequency")); + ui->sbQRG5->setAccessibleName (tr ("FT8 QRG 5 frequency")); + ui->sbQRG6->setAccessibleName (tr ("FT8 QRG 6 frequency")); + ui->sbQRG7->setAccessibleName (tr ("FT8 QRG 7 frequency")); + ui->sbQRG8->setAccessibleName (tr ("FT8 QRG 8 frequency")); + + ui->tx1->setAccessibleName (tr ("Tx1 message")); + ui->tx2->setAccessibleName (tr ("Tx2 message")); + ui->tx3->setAccessibleName (tr ("Tx3 message")); + ui->tx4->setAccessibleName (tr ("Tx4 message")); + ui->tx5->setAccessibleName (tr ("Tx5 message macro")); + ui->tx6->setAccessibleName (tr ("Tx6 message")); + if (ui->tx5->lineEdit ()) ui->tx5->lineEdit ()->setAccessibleName (tr ("Tx5 message macro text")); + + ui->txrb1->setAccessibleName (tr ("Select Tx1 for next transmission")); + ui->txrb2->setAccessibleName (tr ("Select Tx2 for next transmission")); + ui->txrb3->setAccessibleName (tr ("Select Tx3 for next transmission")); + ui->txrb4->setAccessibleName (tr ("Select Tx4 for next transmission")); + ui->txrb5->setAccessibleName (tr ("Select Tx5 for next transmission")); + ui->txrb6->setAccessibleName (tr ("Select Tx6 for next transmission")); + ui->txb1->setAccessibleName (tr ("Transmit Tx1 now")); + ui->txb2->setAccessibleName (tr ("Transmit Tx2 now")); + ui->txb3->setAccessibleName (tr ("Transmit Tx3 now")); + ui->txb4->setAccessibleName (tr ("Transmit Tx4 now")); + ui->txb5->setAccessibleName (tr ("Transmit Tx5 now")); + ui->txb6->setAccessibleName (tr ("Transmit Tx6 now")); + + std::array const tooltip_widgets {{ + ui->tx1, ui->tx2, ui->tx3, ui->tx4, ui->tx5, ui->tx6, + ui->txrb1, ui->txrb2, ui->txrb3, ui->txrb4, ui->txrb5, ui->txrb6, + ui->txb1, ui->txb2, ui->txb3, ui->txb4, ui->txb5, ui->txb6, + ui->comboBoxHoundSort, ui->sbNlist, ui->sbNslots, ui->comboBoxCQ, + ui->pbFoxReset, ui->pbFreeText, ui->cbSendMsg, ui->pbBandHopping + }}; + for (auto *widget : tooltip_widgets) + { + tooltipDescription (widget); + } + +} + +void MainWindow::registerMainWindowFocusControls() +{ + ui->tabWidget->setFocusProxy (ui->tabWidget->tabBar ()); + QList const tab_controls { + ui->decodedTextBrowser, ui->decodedTextBrowser2, ui->cbCQonly, ui->cbBypass, + ui->logQSOButton, ui->stopButton, ui->monitorButton, ui->EraseButton, + ui->ClrAvgButton, ui->DecodeButton, ui->autoButton, ui->stopTxButton, + ui->tuneButton, ui->cbMenus, ui->sbNB, ui->bandComboBox, + ui->pb160, ui->pb80, ui->pb60, ui->pb40, ui->pb30, ui->pb20, + ui->pb17, ui->pb15, ui->pb12, ui->pb10, ui->pb8, ui->pb6, + ui->pb4, ui->pb2, ui->pb70, ui->pb50, ui->pb144, ui->pb220, + ui->pb432, ui->pb902, ui->pb23, ui->pb13, ui->pb9, ui->pb5G, + ui->pb10G, ui->pb24G, ui->labDialFreq, ui->readFreq, + ui->houndButton, ui->ft8Button, ui->ft4Button, ui->msk144Button, + ui->q65Button, ui->jt65Button, ui->dxCallEntry, ui->dxGridEntry, + ui->DX_Call_Button, ui->lookupButton, ui->addButton, ui->ignoreButton, + ui->txFirstCheckBox, ui->cbHoldTxFreq, ui->TxFreqSpinBox, ui->sbSubmode, + ui->pbR2T, ui->sbFtol, ui->pbT2R, ui->sbMaxDrift, + ui->RxFreqSpinBox, ui->rptSpinBox, ui->sbSerialNumber, + ui->sbF_Low, ui->sbF_High, ui->sbTR, ui->syncSpinBox, + ui->sbCQTxFreq, ui->cbCQTx, ui->cbRxAll, + ui->cbShMsgs, ui->cbFast9, ui->cbAutoSeq, ui->respondComboBox, + ui->cbTx6, ui->cbSWL, ui->pbBestSP, ui->measure_check_box, + ui->tabWidget->tabBar (), + ui->genStdMsgsPushButton, + ui->txb1, ui->txb2, ui->txb3, ui->txb4, ui->txb5, ui->txb6, + ui->tx1, ui->tx2, ui->tx3, ui->tx4, ui->tx5, ui->tx6, + ui->houndQueueTextBrowser, ui->foxTxListTextBrowser, ui->comboBoxHoundSort, + ui->sbNlist, ui->sbNslots, ui->comboBoxCQ, ui->cbWorkDupes, ui->cbMoreCQs, + ui->pbFoxReset, ui->pbFreeText, ui->cbSendMsg, + ui->cb160m, ui->cb80m, ui->cb40m, ui->cb30m, ui->cb20m, ui->cb17m, + ui->cb15m, ui->cb12m, ui->cb10m, ui->cb6m, ui->cb4m, ui->cb2m, ui->cb70cm, + ui->cb80mFT4, ui->cb40mFT4, ui->cb30mFT4, ui->cb20mFT4, ui->cb17mFT4, + ui->cb15mFT4, ui->cb12mFT4, ui->cb10mFT4, ui->cb2mMSK, + ui->cbQRG1, ui->sbQRG1, ui->cbQRG2, ui->sbQRG2, ui->cbQRG3, ui->sbQRG3, + ui->cbQRG4, ui->sbQRG4, ui->cbQRG5, ui->sbQRG5, ui->cbQRG6, ui->sbQRG6, + ui->cbQRG7, ui->sbQRG7, ui->cbQRG8, ui->sbQRG8, ui->pbBandHopping, + ui->WSPRfreqSpinBox, ui->sbFST4W_RxFreq, ui->sbFST4W_FTol, + ui->RoundRobin, ui->sbTxPercent, ui->sbTR_FST4W, + ui->band_hopping_group_box, ui->band_hopping_schedule_push_button, + ui->cbUploadWSPR_Spots, ui->WSPR_prefer_type_1_check_box, ui->cbNoOwnCall, + ui->pbTxNext, ui->TxPowerComboBox, ui->outAttenuation + }; + + for (auto *widget : tab_controls) + { + if (!widget) continue; + widget->setFocusPolicy (Qt::StrongFocus); + } + + for (auto *widget : focusIndicatorWidgets ()) + { + widget->installEventFilter (this); + } + + // A disabled widget never gets its mouse-press event propagated to any + // ancestor's mousePressEvent() -- Qt swallows it at the widget itself, so + // this can only be caught by a filter installed directly on the checkbox. + ui->txFirstCheckBox->installEventFilter (this); + + for (auto *button : txNextButtons ()) + { + connect (button, &QRadioButton::toggled, this, [this] (bool checked) { + if (checked) updateTxNextFocusPolicies (); + }); + } + updateTxNextFocusPolicies (); +} + +bool MainWindow::switchMainWindowTab(QKeyEvent const *key_event) +{ + auto *focus_widget = QApplication::focusWidget (); + if (focus_widget != ui->tabWidget && focus_widget != ui->tabWidget->tabBar ()) + { + return false; + } + + auto const modifiers = key_event->modifiers () + & (Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier); + if (modifiers != Qt::NoModifier) return false; + + int next_index = ui->tabWidget->currentIndex (); + switch (key_event->key ()) + { + case Qt::Key_1: next_index = 0; break; + case Qt::Key_2: next_index = 1; break; + case Qt::Key_3: next_index = 2; break; + case Qt::Key_Left: + case Qt::Key_Up: + next_index = (next_index + ui->tabWidget->count () - 1) % ui->tabWidget->count (); + break; + case Qt::Key_Right: + case Qt::Key_Down: + next_index = (next_index + 1) % ui->tabWidget->count (); + break; + default: + return false; + } + + ui->tabWidget->setCurrentIndex (next_index); + auto *tab_bar = ui->tabWidget->tabBar (); + QTimer::singleShot (0, tab_bar, [tab_bar] { + tab_bar->setFocus (Qt::OtherFocusReason); + }); + return true; +} + +std::array MainWindow::txNextButtons() const +{ + return {{qobject_cast (m_tx_message_button_group->button (1)), + qobject_cast (m_tx_message_button_group->button (2)), + qobject_cast (m_tx_message_button_group->button (3)), + qobject_cast (m_tx_message_button_group->button (4)), + qobject_cast (m_tx_message_button_group->button (5)), + qobject_cast (m_tx_message_button_group->button (6))}}; +} + +std::array MainWindow::focusIndicatorWidgets() const +{ + auto const buttons = txNextButtons (); + return {{ui->tabWidget->tabBar (), + buttons[0], buttons[1], buttons[2], buttons[3], buttons[4], buttons[5], + ui->txb1, ui->txb2, ui->txb3, ui->txb4, ui->txb5, ui->txb6}}; +} + +void MainWindow::showMainWindowFocusIndicator(QWidget *widget) +{ + if (widget == ui->tabWidget->tabBar ()) + { + m_message_selector_focus_frame->setGeometry (widget->rect ()); + m_message_selector_focus_frame->raise (); + m_message_selector_focus_frame->show (); + return; + } + + m_main_window_focus_frame->setWidget (widget); + m_main_window_focus_frame->raise (); + m_main_window_focus_frame->show (); +} + +void MainWindow::hideMainWindowFocusIndicators() +{ + m_message_selector_focus_frame->hide (); + m_main_window_focus_frame->hide (); + m_main_window_focus_frame->setWidget (nullptr); +} + +void MainWindow::updateTxNextFocusPolicies() +{ + auto const buttons = txNextButtons (); + QRadioButton *tab_button = nullptr; + for (auto *button : buttons) + { + if (button->isChecked () && button->isEnabled () && !button->isHidden ()) + { + tab_button = button; + break; + } + } + if (!tab_button) + { + for (auto *button : buttons) + { + if (button->isEnabled () && !button->isHidden ()) + { + tab_button = button; + break; + } + } + } + + for (auto *button : buttons) + { + button->setFocusPolicy (button == tab_button ? Qt::StrongFocus : Qt::ClickFocus); + } +} + +void MainWindow::updateTxFirstEnabledState() +{ + ui->txFirstCheckBox->setEnabled (m_tx_first_user_enabled && m_tx_first_mode_enabled); +} + +void MainWindow::setTxFirstModeEnabled(bool enabled) +{ + m_tx_first_mode_enabled = enabled; + updateTxFirstEnabledState (); +} + +bool MainWindow::switchTxNextMessage(QKeyEvent const *key_event) +{ + auto const buttons = txNextButtons (); + auto *focus_button = qobject_cast (QApplication::focusWidget ()); + auto const current = std::find (buttons.cbegin (), buttons.cend (), focus_button); + if (current == buttons.cend ()) return false; + auto const current_index = static_cast (std::distance (buttons.cbegin (), current)); + + auto const modifiers = key_event->modifiers () + & (Qt::ShiftModifier | Qt::ControlModifier | Qt::AltModifier | Qt::MetaModifier); + if (modifiers != Qt::NoModifier) return false; + + int direction = 0; + switch (key_event->key ()) + { + case Qt::Key_Left: + case Qt::Key_Up: direction = -1; break; + case Qt::Key_Right: + case Qt::Key_Down: direction = 1; break; + default: return false; + } + + auto const button_count = static_cast (buttons.size ()); + for (int offset = 1; offset < button_count; ++offset) + { + auto const next_index = (current_index + direction * offset + button_count) % button_count; + auto *button = buttons[next_index]; + if (button->isEnabledTo (this) && button->isVisibleTo (this)) + { + button->click (); + button->setFocus (direction < 0 ? Qt::BacktabFocusReason : Qt::TabFocusReason); + return true; + } + } + return false; +} + +void MainWindow::updateDecodeAccessibility() +{ + auto const updatePane = [] (QLabel *titleLabel, QLabel *headingsLabel, DisplayText *pane) + { + auto const title = titleLabel->text(); + auto const headings = decodeHeadingText(headingsLabel->text()); + + titleLabel->setAccessibleName(QString {"%1 decode pane title"}.arg (title)); + titleLabel->setAccessibleDescription(QString {"Title for the %1 decoded messages pane."}.arg (title)); + + headingsLabel->setAccessibleName(QString {"%1 decoded messages headings"}.arg (title)); + headingsLabel->setAccessibleDescription(decodeLineDescription(headings)); + + pane->setAccessibleName(QString {"%1 decoded messages"}.arg (title)); + pane->setAccessibleDescription(QString {"Decoded messages in the %1 pane. %2"} + .arg (title) + .arg (decodeLineDescription(headings))); + }; + + updatePane (ui->lh_decodes_title_label, ui->lh_decodes_headings_label, ui->decodedTextBrowser); + updatePane (ui->rh_decodes_title_label, ui->rh_decodes_headings_label, ui->decodedTextBrowser2); +} + +void MainWindow::setDecodeTitles(QString const& lh, QString const& rh) +{ + ui->lh_decodes_title_label->setText(lh); + ui->rh_decodes_title_label->setText(rh); +} + +void MainWindow::setDecodeHeadings(QString const& lh, QString const& rh) +{ + ui->lh_decodes_headings_label->setText(lh); + ui->rh_decodes_headings_label->setText(rh); } void MainWindow::on_actionFST4_triggered() { - QTimer::singleShot (50, [=] { + noteTxModeChange (QStringLiteral ("FST4")); + QTimer::singleShot (50, this, [=] { ui->TxFreqSpinBox->setValue(m_settings->value("TxFreq_old",1500).toInt()); ui->RxFreqSpinBox->setValue(m_settings->value("RxFreq_old",1500).toInt()); on_sbSubmode_valueChanged(ui->sbSubmode->value()); @@ -10824,19 +10704,25 @@ void MainWindow::on_actionFST4_triggered() m_wideGraph->show(); if (m_tci_audio && ui->bandComboBox->currentText()!="OOB") Q_EMIT m_config.transceiver_period(m_TRperiod); - m_nsps=6912; //For symspec only - m_FFTSize = m_nsps / 2; - if (m_tci_audio) Q_EMIT m_config.transceiver_blocksize (m_FFTSize); - else Q_EMIT FFTSize (m_FFTSize); - ui->lh_decodes_title_label->setText(tr ("Band Activity")); - ui->rh_decodes_title_label->setText(tr ("Rx Frequency")); + initializeFFT(6912); + setDecodeTitles(tr ("Band Activity"), tr ("Rx Frequency")); WSPR_config(false); if(m_config.single_decode()) { -// 01234567890123456789012345678901234567 - displayWidgets(nWidgets("11111100010011100001000000010000000000")); + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::TxFrequency, + ModeUiControl::RxFrequency, ModeUiControl::FrequencyTolerance, + ModeUiControl::Report, ModeUiControl::TrPeriod, + ModeUiControl::AutoSequence, ModeUiControl::CopyRxToTx, + ModeUiControl::CopyTxToRx, ModeUiControl::HoldTxFrequency, + ModeUiControl::DecodeDepth, ModeUiControl::Respond}); m_wideGraph->setSingleDecode(true); } else { - displayWidgets(nWidgets("11101100010011100001000000010000001100")); + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::TxFrequency, + ModeUiControl::RxFrequency, ModeUiControl::Report, + ModeUiControl::TrPeriod, ModeUiControl::AutoSequence, + ModeUiControl::CopyRxToTx, ModeUiControl::CopyTxToRx, + ModeUiControl::HoldTxFrequency, ModeUiControl::DecodeDepth, + ModeUiControl::Respond, ModeUiControl::LowFrequency, + ModeUiControl::HighFrequency}); m_wideGraph->setSingleDecode(false); ui->sbFtol->setValue(20); } @@ -10853,8 +10739,8 @@ void MainWindow::on_actionFST4_triggered() m_wideGraph->setMode(m_mode); ui->sbTR->values ({15, 30, 60, 120, 300, 900, 1800}); ui->sbTR->setValue (m_settings->value ("TRPeriod_FST4", 60).toInt()); // remember sbTR settings by mode - QTimer::singleShot (50, [=] {on_sbTR_valueChanged (ui->sbTR->value());}); - ui->txFirstCheckBox->setEnabled(true); + QTimer::singleShot (50, this, [=] {on_sbTR_valueChanged (ui->sbTR->value());}); + setTxFirstModeEnabled (true); statusChanged(); m_bOK_to_chk=true; chk_FST4_freq_range(); @@ -10862,6 +10748,7 @@ void MainWindow::on_actionFST4_triggered() void MainWindow::on_actionFST4W_triggered() { + noteTxModeChange (QStringLiteral ("FST4W")); m_mode="FST4W"; if(m_specOp==SpecOp::HOUND) { m_config.setSpecial_None(); @@ -10874,13 +10761,10 @@ void MainWindow::on_actionFST4W_triggered() m_wideGraph->show(); if (m_tci_audio && ui->bandComboBox->currentText()!="OOB") Q_EMIT m_config.transceiver_period(m_TRperiod); - m_nsps=6912; //For symspec only - m_FFTSize = m_nsps / 2; - if (m_tci_audio) Q_EMIT m_config.transceiver_blocksize (m_FFTSize); - else Q_EMIT FFTSize (m_FFTSize); + initializeFFT(6912); WSPR_config(true); -// 01234567890123456789012345678901234567 - displayWidgets(nWidgets("00000000000000000101000000000000010000")); + applyModeUiState({ModeUiControl::WsprControls, ModeUiControl::DecodeDepth, + ModeUiControl::Fst4wTrPeriod}); setup_status_bar(false); ui->band_hopping_group_box->setChecked(false); ui->band_hopping_group_box->setVisible(false); @@ -10899,8 +10783,9 @@ void MainWindow::on_actionFST4W_triggered() void MainWindow::on_actionFT4_triggered() { - if (m_mode=="MSK144") QTimer::singleShot (75, [=] {on_actionFT4_triggered();}); - QTimer::singleShot (50, [=] { + noteTxModeChange (QStringLiteral ("FT4")); + if (m_mode=="MSK144") QTimer::singleShot (75, this, [=] {on_actionFT4_triggered();}); + QTimer::singleShot (50, this, [=] { ui->TxFreqSpinBox->setValue(m_settings->value("TxFreq_old",1500).toInt()); ui->RxFreqSpinBox->setValue(m_settings->value("RxFreq_old",1500).toInt()); on_sbSubmode_valueChanged(ui->sbSubmode->value()); @@ -10917,10 +10802,7 @@ void MainWindow::on_actionFT4_triggered() m_bFastMode=false; WSPR_config(false); switch_mode (Modes::FT4); - m_nsps=6912; - m_FFTSize = m_nsps/2; - if (m_tci_audio) Q_EMIT m_config.transceiver_blocksize (m_FFTSize); - else Q_EMIT FFTSize (m_FFTSize); + initializeFFT(6912); m_hsymStop=21; setup_status_bar (bVHF); m_toneSpacing=12000.0/576.0; @@ -10931,36 +10813,32 @@ void MainWindow::on_actionFT4_triggered() ui->cbAutoSeq->setChecked(true); m_fastGraph->hide(); m_wideGraph->show(); - ui->rh_decodes_headings_label->setText(" UTC dB DT Freq " + tr ("Message")); m_wideGraph->setPeriod(m_TRperiod,m_nsps); if (m_tci_audio && ui->bandComboBox->currentText()!="OOB") Q_EMIT m_config.transceiver_period(m_TRperiod); if (!m_tci_audio) { m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe - m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe - } - ui->rh_decodes_title_label->setText(tr ("Rx Frequency")); - ui->lh_decodes_title_label->setText(tr ("Band Activity")); - ui->lh_decodes_headings_label->setText( " UTC dB DT Freq " + tr ("Message")); -// 01234567890123456789012345678901234567 - displayWidgets(nWidgets("11101000010011100001000000011000100000")); - ui->txrb2->setEnabled(true); - ui->txrb4->setEnabled(true); - ui->txrb5->setEnabled(true); - ui->txrb6->setEnabled(true); - ui->txb2->setEnabled(true); - ui->txb4->setEnabled(true); - ui->txb5->setEnabled(true); - ui->txb6->setEnabled(true); - ui->txFirstCheckBox->setEnabled(true); + m_detector->setTRPeriod(m_TRperiod); // marshals to the audio thread + } + setDecodeTitles(tr ("Band Activity"), tr ("Rx Frequency")); + setDecodeHeadings(" UTC dB DT Freq " + tr ("Message"), " UTC dB DT Freq " + tr ("Message")); + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::TxFrequency, + ModeUiControl::RxFrequency, ModeUiControl::Report, + ModeUiControl::AutoSequence, ModeUiControl::CopyRxToTx, + ModeUiControl::CopyTxToRx, ModeUiControl::HoldTxFrequency, + ModeUiControl::DecodeDepth, ModeUiControl::Respond, + ModeUiControl::CqOnly}); + setTxButtonsEnabled(true); + setTxFirstModeEnabled (true); chkFT4(); statusChanged(); } void MainWindow::on_actionFT8_triggered() { - if (m_mode=="MSK144") QTimer::singleShot (75, [=] {on_actionFT8_triggered();}); - QTimer::singleShot (50, [=] { + noteTxModeChange (QStringLiteral ("FT8")); + if (m_mode=="MSK144") QTimer::singleShot (75, this, [=] {on_actionFT8_triggered();}); + QTimer::singleShot (50, this, [=] { if(m_specOp!=SpecOp::FOX) ui->TxFreqSpinBox->setValue(m_settings->value("TxFreq_old",1500).toInt()); if(m_specOp==SpecOp::FOX && !m_config.superFox()) ui->TxFreqSpinBox->setValue(m_TxFreqFox); if(SpecOp::HOUND == m_specOp && m_config.superFox()) { @@ -10981,10 +10859,7 @@ void MainWindow::on_actionFT8_triggered() m_bFast9=false; m_bFastMode=false; WSPR_config(false); - m_nsps=6912; - m_FFTSize = m_nsps / 2; - if (m_tci_audio) Q_EMIT m_config.transceiver_blocksize (m_FFTSize); - else Q_EMIT FFTSize (m_FFTSize); + initializeFFT(6912); if (m_multithreadFT8 && !(m_specOp==SpecOp::HOUND && m_config.superFox())) { if (m_ft8DecoderStart==0) m_hsymStop=49; else if (m_ft8DecoderStart==1) { @@ -11014,7 +10889,7 @@ void MainWindow::on_actionFT8_triggered() Q_EMIT m_config.transceiver_period(m_TRperiod); if (!m_tci_audio) { m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe - m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe + m_detector->setTRPeriod(m_TRperiod); // marshals to the audio thread } ui->rh_decodes_title_label->setText(tr ("Rx Frequency")); if(SpecOp::FOX==m_specOp) { @@ -11024,25 +10899,21 @@ void MainWindow::on_actionFT8_triggered() ui->lh_decodes_title_label->setText(tr ("Band Activity")); ui->lh_decodes_headings_label->setText( " UTC dB DT Freq " + tr ("Message")); } - -// 01234567890123456789012345678901234567 - displayWidgets(nWidgets("11101000010011100001000010011000100000")); - ui->txrb2->setEnabled(true); - ui->txrb4->setEnabled(true); - ui->txrb5->setEnabled(true); - ui->txrb6->setEnabled(true); - ui->txb2->setEnabled(true); - ui->txb4->setEnabled(true); - ui->txb5->setEnabled(true); - ui->txb6->setEnabled(true); - ui->txFirstCheckBox->setEnabled(true); + + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::TxFrequency, + ModeUiControl::RxFrequency, ModeUiControl::Report, + ModeUiControl::AutoSequence, ModeUiControl::CopyRxToTx, + ModeUiControl::CopyTxToRx, ModeUiControl::HoldTxFrequency, + ModeUiControl::DecodeDepth, ModeUiControl::ApFt8, + ModeUiControl::Respond, ModeUiControl::CqOnly}); + setTxButtonsEnabled(true); + setTxFirstModeEnabled (true); ui->cbAutoSeq->setEnabled(true); if(SpecOp::FOX==m_specOp) { ui->txFirstCheckBox->setChecked(true); - ui->txFirstCheckBox->setEnabled(false); + setTxFirstModeEnabled (false); ui->cbHoldTxFreq->setChecked(true); ui->cbAutoSeq->setEnabled(false); - ui->tabWidget->setCurrentIndex(1); m_wideGraph->setSuperFox(false); if(m_config.superFox()) { ui->TxFreqSpinBox->setValue(750); //SuperFox transmits at 750 Hz @@ -11050,29 +10921,34 @@ void MainWindow::on_actionFT8_triggered() } else { ui->TxFreqSpinBox->setValue(500); } - // 01234567890123456789012345678901234567 - displayWidgets(nWidgets("11101000010011100001000000000011000000")); + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::TxFrequency, + ModeUiControl::RxFrequency, ModeUiControl::Report, + ModeUiControl::AutoSequence, ModeUiControl::CopyRxToTx, + ModeUiControl::CopyTxToRx, ModeUiControl::HoldTxFrequency, + ModeUiControl::DecodeDepth, ModeUiControl::DxpedLabel, + ModeUiControl::RxAll, ModeUiControl::FoxQueueTab}); ui->cbRxAll->setText(tr("Show Already Worked")); - if(m_config.superFox()) { - ui->labDXped->setText(tr ("Super Fox")); - } else { - ui->labDXped->setText(tr ("Fox")); - } + ui->labDXped->setText(specOpLabel()); on_fox_log_action_triggered(); if (m_ActiveStationsWidget) m_ActiveStationsWidget->setClickOK(true); // allow clicks } if(SpecOp::HOUND == m_specOp) { ui->houndButton->setChecked(true); ui->txFirstCheckBox->setChecked(false); - ui->txFirstCheckBox->setEnabled(false); + setTxFirstModeEnabled (false); ui->cbAutoSeq->setEnabled(false); - ui->tabWidget->setCurrentIndex(0); + if(ui->tabWidget->currentIndex() == fox_queue_tab_index) { + ui->tabWidget->setCurrentIndex(standard_messages_tab_index); + } ui->cbHoldTxFreq->setChecked(true); m_wideGraph->setSuperHound(false); if(m_config.superFox()) { - // 01234567890123456789012345678901234567 - displayWidgets(nWidgets("11111000010011000001000000000011000000")); - ui->labDXped->setText(tr ("Super Hound")); + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::TxFrequency, + ModeUiControl::RxFrequency, ModeUiControl::FrequencyTolerance, + ModeUiControl::Report, ModeUiControl::AutoSequence, + ModeUiControl::CopyRxToTx, ModeUiControl::CopyTxToRx, + ModeUiControl::DecodeDepth, ModeUiControl::DxpedLabel, + ModeUiControl::RxAll}); ui->cbRxAll->setEnabled(false); m_wideGraph->setRxFreq(ui->RxFreqSpinBox->value()); m_wideGraph->setTol(ui->sbFtol->value()); @@ -11081,22 +10957,18 @@ void MainWindow::on_actionFT8_triggered() if(ui->RxFreqSpinBox->value() < 700 or ui->RxFreqSpinBox->value() > 800) ui->RxFreqSpinBox->setValue(750); } else { - // 01234567890123456789012345678901234567 - displayWidgets(nWidgets("11101000010011000001000000000011000000")); - ui->labDXped->setText(tr ("Hound")); + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::TxFrequency, + ModeUiControl::RxFrequency, ModeUiControl::Report, + ModeUiControl::AutoSequence, ModeUiControl::CopyRxToTx, + ModeUiControl::CopyTxToRx, ModeUiControl::DecodeDepth, + ModeUiControl::DxpedLabel, ModeUiControl::RxAll}); ui->cbRxAll->setEnabled(true); m_wideGraph->setSuperHound(false); ui->RxFreqSpinBox->setValue(m_settings->value("RxFreq_old",1500).toInt()); } + ui->labDXped->setText(specOpLabel()); ui->txrb1->setChecked(true); - ui->txrb2->setEnabled(false); - ui->txrb4->setEnabled(false); - ui->txrb5->setEnabled(false); - ui->txrb6->setEnabled(false); - ui->txb2->setEnabled(false); - ui->txb4->setEnabled(false); - ui->txb5->setEnabled(false); - ui->txb6->setEnabled(false); + setTxButtonsEnabled(false); if (m_ActiveStationsWidget) m_ActiveStationsWidget->setClickOK(false); } else { switch_mode (Modes::FT8); @@ -11108,15 +10980,8 @@ void MainWindow::on_actionFT8_triggered() m_specOp=m_config.special_op_id(); if(m_specOp!=SpecOp::NONE and m_specOp!=SpecOp::FOX and m_specOp!=SpecOp::HOUND) { - QString t0=""; - if(SpecOp::NA_VHF==m_specOp) t0="NA VHF"; - if(SpecOp::EU_VHF==m_specOp) t0="EU VHF"; - if(SpecOp::FIELD_DAY==m_specOp) t0="Field Day"; - if(SpecOp::RTTY==m_specOp) t0="FT RU"; - if(SpecOp::WW_DIGI==m_specOp) t0="WW Digi"; - if(SpecOp::ARRL_DIGI==m_specOp) t0="ARRL Digi"; - if(SpecOp::Q65_PILEUP==m_specOp) t0="Q65 Pileup"; - if(t0=="") { + QString t0 = specOpLabel(); + if(t0.isEmpty()) { ui->labDXped->setVisible(false); } else { ui->labDXped->setVisible(true); @@ -11134,14 +10999,16 @@ void MainWindow::on_actionFT8_triggered() "the *Settings | Radio* tab.)", errorMsg); m_bWarnedSplit=true; } - if (ui->labDXped->isVisible()) ui->labDXped->setStyleSheet("QLabel {background-color: red; color: white;}"); + m_houndVerified = false; + updateHoundVerificationStyle (); statusChanged(); configActiveStations(); } void MainWindow::on_actionJT4_triggered() { - QTimer::singleShot (50, [=] { + noteTxModeChange (QStringLiteral ("JT4")); + QTimer::singleShot (50, this, [=] { ui->TxFreqSpinBox->setValue(m_settings->value("TxFreq_old",1500).toInt()); ui->RxFreqSpinBox->setValue(m_settings->value("RxFreq_old",1500).toInt()); }); @@ -11158,12 +11025,9 @@ void MainWindow::on_actionJT4_triggered() Q_EMIT m_config.transceiver_period(m_TRperiod); if (!m_tci_audio) { m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe - m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe + m_detector->setTRPeriod(m_TRperiod); // marshals to the audio thread } - m_nsps=6912; //For symspec only - m_FFTSize = m_nsps / 2; - if (m_tci_audio) Q_EMIT m_config.transceiver_blocksize (m_FFTSize); - else Q_EMIT FFTSize (m_FFTSize); + initializeFFT(6912); m_hsymStop=176; if(m_config.decode_at_52s()) m_hsymStop=184; m_toneSpacing=0.0; @@ -11175,32 +11039,43 @@ void MainWindow::on_actionJT4_triggered() m_bFast9=false; setup_status_bar (bVHF); ui->sbSubmode->setMaximum(6); - ui->lh_decodes_headings_label->setText("UTC dB DT Freq " + tr ("Message")); - ui->rh_decodes_headings_label->setText("UTC dB DT Freq " + tr ("Message")); + setDecodeHeadings("UTC dB DT Freq " + tr ("Message"), "UTC dB DT Freq " + tr ("Message")); if(bVHF) { // restore last used parameters ui->sbFtol->setValue (m_settings->value ("Ftol_JT4", 50).toInt()); m_nSubMode=m_settings->value("SubMode_JT4",0).toInt(); ui->sbSubmode->setValue(m_settings->value("SubMode_JT4",0).toInt()); - QTimer::singleShot (50, [=] {on_sbSubmode_valueChanged(ui->sbSubmode->value());}); + QTimer::singleShot (50, this, [=] {on_sbSubmode_valueChanged(ui->sbSubmode->value());}); m_bShMsgs=m_settings->value("ShMsgs_JT4",false).toBool(); ui->cbShMsgs->setChecked(m_bShMsgs); } else { ui->sbSubmode->setValue(0); } if(bVHF) { - // 01234567890123456789012345678901234567 - displayWidgets(nWidgets("11111001011011011011110000010000000000")); + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::TxFrequency, + ModeUiControl::RxFrequency, ModeUiControl::FrequencyTolerance, + ModeUiControl::Report, ModeUiControl::ShortMessages, + ModeUiControl::AutoSequence, ModeUiControl::Tx6, + ModeUiControl::CopyRxToTx, ModeUiControl::CopyTxToRx, + ModeUiControl::Submode, ModeUiControl::Sync, + ModeUiControl::ClearAverage, ModeUiControl::DecodeDepth, + ModeUiControl::IncludeAveraging, + ModeUiControl::IncludeCorrelation, ModeUiControl::Respond}); } else { - displayWidgets(nWidgets("11101000010011000011000000010000000000")); + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::TxFrequency, + ModeUiControl::RxFrequency, ModeUiControl::Report, + ModeUiControl::AutoSequence, ModeUiControl::CopyRxToTx, + ModeUiControl::CopyTxToRx, ModeUiControl::ClearAverage, + ModeUiControl::DecodeDepth, ModeUiControl::Respond}); } fast_config(false); - ui->txFirstCheckBox->setEnabled(true); + setTxFirstModeEnabled (true); statusChanged(); } void MainWindow::on_actionJT9_triggered() { + noteTxModeChange (QStringLiteral ("JT9")); m_mode="JT9"; if(m_specOp==SpecOp::HOUND) { m_config.setSpecial_None(); @@ -11215,7 +11090,7 @@ void MainWindow::on_actionJT9_triggered() ui->sbFtol->setValue (m_settings->value ("Ftol_JT9", 50).toInt()); m_nSubMode=m_settings->value("SubMode",0).toInt(); ui->sbSubmode->setValue(m_nSubMode); - QTimer::singleShot (50, [=] { + QTimer::singleShot (50, this, [=] { on_sbTR_valueChanged (ui->sbTR->value()); on_sbSubmode_valueChanged(ui->sbSubmode->value()); }); @@ -11224,10 +11099,7 @@ void MainWindow::on_actionJT9_triggered() m_bFastMode=m_bFast9; WSPR_config(false); switch_mode (Modes::JT9); - m_nsps=6912; - m_FFTSize = m_nsps / 2; - if (m_tci_audio) Q_EMIT m_config.transceiver_blocksize (m_FFTSize); - else Q_EMIT FFTSize (m_FFTSize); + initializeFFT(6912); m_hsymStop=173; if(m_config.decode_at_52s()) m_hsymStop=179; setup_status_bar (bVHF); @@ -11250,15 +11122,13 @@ void MainWindow::on_actionJT9_triggered() m_fastGraph->showNormal(); ui->TxFreqSpinBox->setValue(700); ui->RxFreqSpinBox->setValue(700); - ui->lh_decodes_headings_label->setText(" UTC dB T Freq " + tr ("Message")); - ui->rh_decodes_headings_label->setText(" UTC dB T Freq " + tr ("Message")); + setDecodeHeadings(" UTC dB T Freq " + tr ("Message"), " UTC dB T Freq " + tr ("Message")); } else { // ui->cbAutoSeq->setChecked(false); if (m_mode != "FST4") { m_TRperiod=60.0; - ui->lh_decodes_headings_label->setText("UTC dB DT Freq " + tr ("Message")); - ui->rh_decodes_headings_label->setText("UTC dB DT Freq " + tr ("Message")); + setDecodeHeadings("UTC dB DT Freq " + tr ("Message"), "UTC dB DT Freq " + tr ("Message")); } } m_wideGraph->setPeriod(m_TRperiod,m_nsps); @@ -11266,26 +11136,37 @@ void MainWindow::on_actionJT9_triggered() Q_EMIT m_config.transceiver_period(m_TRperiod); if (!m_tci_audio) { m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe - m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe + m_detector->setTRPeriod(m_TRperiod); // marshals to the audio thread } - ui->lh_decodes_title_label->setText(tr ("Band Activity")); - ui->rh_decodes_title_label->setText(tr ("Rx Frequency")); + setDecodeTitles(tr ("Band Activity"), tr ("Rx Frequency")); if(bVHF) { - // 01234567890123456789012345678901234567 - displayWidgets(nWidgets("11111010110011111001000000010000000000")); + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::TxFrequency, + ModeUiControl::RxFrequency, ModeUiControl::FrequencyTolerance, + ModeUiControl::Report, ModeUiControl::CqTxFrequency, + ModeUiControl::Fast9, ModeUiControl::AutoSequence, + ModeUiControl::CopyRxToTx, ModeUiControl::CopyTxToRx, + ModeUiControl::HoldTxFrequency, ModeUiControl::Submode, + ModeUiControl::Sync, ModeUiControl::DecodeDepth, + ModeUiControl::Respond}); } else { - displayWidgets(nWidgets("11101000010011100001000000010000100000")); + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::TxFrequency, + ModeUiControl::RxFrequency, ModeUiControl::Report, + ModeUiControl::AutoSequence, ModeUiControl::CopyRxToTx, + ModeUiControl::CopyTxToRx, ModeUiControl::HoldTxFrequency, + ModeUiControl::DecodeDepth, ModeUiControl::Respond, + ModeUiControl::CqOnly}); } fast_config(m_bFastMode); // ui->cbAutoSeq->setVisible(m_bFast9); - ui->txFirstCheckBox->setEnabled(true); + setTxFirstModeEnabled (true); statusChanged(); } void MainWindow::on_actionJT65_triggered() { - if (m_mode=="MSK144") QTimer::singleShot (75, [=] {on_actionJT65_triggered();}); - QTimer::singleShot (50, [=] { + noteTxModeChange (QStringLiteral ("JT65")); + if (m_mode=="MSK144") QTimer::singleShot (75, this, [=] {on_actionJT65_triggered();}); + QTimer::singleShot (50, this, [=] { ui->TxFreqSpinBox->setValue(m_settings->value("TxFreq_old",1500).toInt()); ui->RxFreqSpinBox->setValue(m_settings->value("RxFreq_old",1500).toInt()); }); @@ -11303,12 +11184,9 @@ void MainWindow::on_actionJT65_triggered() Q_EMIT m_config.transceiver_period(m_TRperiod); if (!m_tci_audio) { m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe - m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe + m_detector->setTRPeriod(m_TRperiod); // marshals to the audio thread } - m_nsps=6912; //For symspec only - m_FFTSize = m_nsps / 2; - if (m_tci_audio) Q_EMIT m_config.transceiver_blocksize (m_FFTSize); - else Q_EMIT FFTSize (m_FFTSize); + initializeFFT(6912); m_hsymStop=174; if(m_config.decode_at_52s()) m_hsymStop=183; m_toneSpacing=0.0; @@ -11328,19 +11206,30 @@ void MainWindow::on_actionJT65_triggered() ui->sbFtol->setValue (m_settings->value ("Ftol_JT65", 50).toInt()); m_nSubMode=m_settings->value("SubMode_JT65",0).toInt(); ui->sbSubmode->setValue(m_settings->value("SubMode_JT65",0).toInt()); - QTimer::singleShot (50, [=] {on_sbSubmode_valueChanged(ui->sbSubmode->value());}); + QTimer::singleShot (50, this, [=] {on_sbSubmode_valueChanged(ui->sbSubmode->value());}); m_bShMsgs=m_settings->value("ShMsgs_JT65",false).toBool(); ui->cbShMsgs->setChecked(m_bShMsgs); } else { ui->sbSubmode->setValue(0); - ui->lh_decodes_title_label->setText(tr ("Band Activity")); - ui->rh_decodes_title_label->setText(tr ("Rx Frequency")); + setDecodeTitles(tr ("Band Activity"), tr ("Rx Frequency")); } if(bVHF) { - // 01234567890123456789012345678901234567 - displayWidgets(nWidgets("11111001010011011010110001010000000000")); + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::TxFrequency, + ModeUiControl::RxFrequency, ModeUiControl::FrequencyTolerance, + ModeUiControl::Report, ModeUiControl::ShortMessages, + ModeUiControl::AutoSequence, ModeUiControl::CopyRxToTx, + ModeUiControl::CopyTxToRx, ModeUiControl::Submode, + ModeUiControl::Sync, ModeUiControl::ClearAverage, + ModeUiControl::IncludeAveraging, + ModeUiControl::IncludeCorrelation, ModeUiControl::ApJt65, + ModeUiControl::Respond}); } else { - displayWidgets(nWidgets("11101000010011100001000000010000100000")); + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::TxFrequency, + ModeUiControl::RxFrequency, ModeUiControl::Report, + ModeUiControl::AutoSequence, ModeUiControl::CopyRxToTx, + ModeUiControl::CopyTxToRx, ModeUiControl::HoldTxFrequency, + ModeUiControl::DecodeDepth, ModeUiControl::Respond, + ModeUiControl::CqOnly}); } fast_config(false); // if(ui->cbShMsgs->isChecked()) { @@ -11349,14 +11238,15 @@ void MainWindow::on_actionJT65_triggered() // } if (m_config.decode_at_52s() && m_config.auto_astro() && !ui->actionAstronomical_data->isChecked()) ui->actionAstronomical_data->setChecked (true); - ui->txFirstCheckBox->setEnabled(true); + setTxFirstModeEnabled (true); statusChanged(); } void MainWindow::on_actionQ65_triggered() { - if (m_mode=="MSK144") QTimer::singleShot (75, [=] {on_actionQ65_triggered();}); - QTimer::singleShot (50, [=] { + noteTxModeChange (QStringLiteral ("Q65")); + if (m_mode=="MSK144") QTimer::singleShot (75, this, [=] {on_actionQ65_triggered();}); + QTimer::singleShot (50, this, [=] { ui->TxFreqSpinBox->setValue(m_settings->value("TxFreq_old",1500).toInt()); ui->RxFreqSpinBox->setValue(m_settings->value("RxFreq_old",1500).toInt()); }); @@ -11373,10 +11263,7 @@ void MainWindow::on_actionQ65_triggered() setup_status_bar(true); m_bFastMode=false; m_bFast9=false; - m_nsps=6912; //For symspec only - m_FFTSize = m_nsps / 2; - if (m_tci_audio) Q_EMIT m_config.transceiver_blocksize (m_FFTSize); - else Q_EMIT FFTSize (m_FFTSize); + initializeFFT(6912); m_hsymStop=49; ui->sbTR->values ({15, 30, 60, 120, 300}); // restore last used parameters @@ -11384,7 +11271,7 @@ void MainWindow::on_actionQ65_triggered() ui->sbFtol->setValue (m_settings->value ("Ftol_Q65", 50).toInt()); m_nSubMode=m_settings->value("SubMode_Q65",0).toInt(); ui->sbSubmode->setValue(m_settings->value("SubMode_Q65",0).toInt()); - QTimer::singleShot (50, [=] { + QTimer::singleShot (50, this, [=] { on_sbTR_valueChanged (ui->sbTR->value()); on_sbSubmode_valueChanged(ui->sbSubmode->value()); }); @@ -11398,24 +11285,24 @@ void MainWindow::on_actionQ65_triggered() m_wideGraph->setRxFreq(ui->RxFreqSpinBox->value()); m_wideGraph->setTxFreq(ui->TxFreqSpinBox->value()); switch_mode (Modes::Q65); -// 01234567890123456789012345678901234567 - displayWidgets(nWidgets("11111101011011010011100000010000000011")); - ui->lh_decodes_headings_label->setText("UTC dB DT Freq " + tr ("Message")); - ui->rh_decodes_headings_label->setText("UTC dB DT Freq " + tr ("Message")); + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::TxFrequency, + ModeUiControl::RxFrequency, ModeUiControl::FrequencyTolerance, + ModeUiControl::Report, ModeUiControl::TrPeriod, + ModeUiControl::ShortMessages, ModeUiControl::AutoSequence, + ModeUiControl::Tx6, ModeUiControl::CopyRxToTx, + ModeUiControl::CopyTxToRx, ModeUiControl::Submode, + ModeUiControl::ClearAverage, ModeUiControl::DecodeDepth, + ModeUiControl::IncludeAveraging, + ModeUiControl::Respond, ModeUiControl::AutoClearAverage, + ModeUiControl::MaxDrift}); + setDecodeHeadings("UTC dB DT Freq " + tr ("Message"), "UTC dB DT Freq " + tr ("Message")); if (m_tci_audio && ui->bandComboBox->currentText()!="OOB") Q_EMIT m_config.transceiver_period(m_TRperiod); m_specOp=m_config.special_op_id(); if(m_specOp!=SpecOp::NONE and m_specOp!=SpecOp::FOX and m_specOp!=SpecOp::HOUND) { - QString t0=""; - if(SpecOp::NA_VHF==m_specOp) t0="NA VHF"; - if(SpecOp::EU_VHF==m_specOp) t0="EU VHF"; - if(SpecOp::FIELD_DAY==m_specOp) t0="Field Day"; - if(SpecOp::RTTY==m_specOp) t0="FT RU"; - if(SpecOp::WW_DIGI==m_specOp) t0="WW Digi"; - if(SpecOp::ARRL_DIGI==m_specOp) t0="ARRL Digi"; - if(SpecOp::Q65_PILEUP==m_specOp) t0="Q65 Pileup"; - if(t0=="") { + QString t0 = specOpLabel(); + if(t0.isEmpty()) { ui->labDXped->setVisible(false); } else { ui->labDXped->setVisible(true); @@ -11431,10 +11318,60 @@ void MainWindow::on_actionQ65_triggered() } if (m_config.decode_at_52s() && m_config.auto_astro() && !ui->actionAstronomical_data->isChecked()) ui->actionAstronomical_data->setChecked (true); - ui->txFirstCheckBox->setEnabled(true); + setTxFirstModeEnabled (true); statusChanged(); } +void MainWindow::on_actionJTTY_triggered() +{ + noteTxModeChange (QStringLiteral ("JTTY")); + on_stopButton_clicked(); + m_mode = "JTTY"; + ui->actionJTTY->setChecked(true); + switch_mode (Modes::JTTY); + WSPR_config(false); + VHF_features_enabled(false); + m_wideGraph->setMode(m_mode); + ui->cbAutoSeq->setChecked(false); + m_bFastMode=false; + m_bFast9=false; + m_nsps=6912; + initializeFFT(m_nsps); + m_FFTSize = m_nsps / 2; + if (m_tci_audio) Q_EMIT m_config.transceiver_blocksize (m_FFTSize); + else Q_EMIT FFTSize (m_FFTSize); + m_TRperiod=180; //We need a nonzero setting for WideGraph plotter to work. + m_hsymStop=620; + m_wideGraph->setPeriod(m_TRperiod,m_nsps); + m_detector->setTRPeriod(m_TRperiod); // marshals to the audio thread + ui->TxFreqSpinBox_2->setValue(1500); + ui->RxFreqSpinBox_2->setValue(1500); +// ui->RxFreqSpinBox_2->setSingleStep(200); + ui->sbFtol_2->values ({2, 5, 10, 20, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500}); + // setValue() above is a no-op (no valueChanged signal) if the spinbox + // already held this value from a prior JTTY session, so set the plotter + // state directly rather than relying on that signal to reach it. + m_wideGraph->setRxFreq(ui->RxFreqSpinBox_2->value()); + m_wideGraph->setTol(ui->sbFtol_2->value()); + setDecodeHeadings("", ""); + updateJttyDecodeHeadings(); + setDecodeTitles(tr ("All Decodes"), tr ("QSO Frequency")); + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::TxFrequency, + ModeUiControl::RxFrequency, ModeUiControl::FrequencyTolerance, + ModeUiControl::Report, ModeUiControl::TrPeriod, + ModeUiControl::AutoSequence, ModeUiControl::CopyRxToTx, + ModeUiControl::CopyTxToRx, ModeUiControl::HoldTxFrequency, + ModeUiControl::DecodeDepth, ModeUiControl::Respond}); + // JTTY's decoder has no Fast/Deep behavior to select -- force Normal and + // disable the other two rather than offer a choice that does nothing. + ui->actionMediumDecode->setChecked(true); + ui->actionQuickDecode->setEnabled(false); + ui->actionDeepestDecode->setEnabled(false); + setup_status_bar (false); + monitor(true); +} + + void MainWindow::on_actionMSK144_triggered() { m_hsymStop=105; @@ -11457,6 +11394,7 @@ void MainWindow::on_actionMSK144_triggered() "MSK144 not available if Fox, Hound, Field Day, FT Roundup, WW Digi. or ARRL Digi contest is selected."); return; } + noteTxModeChange (QStringLiteral ("MSK144")); m_mode="MSK144"; if(m_specOp==SpecOp::HOUND) { m_config.setSpecial_None(); @@ -11464,10 +11402,7 @@ void MainWindow::on_actionMSK144_triggered() } ui->actionMSK144->setChecked(true); switch_mode (Modes::MSK144); - m_nsps=6; - m_FFTSize = 7 * 512; - if (m_tci_audio) Q_EMIT m_config.transceiver_blocksize (m_FFTSize); - else Q_EMIT FFTSize (m_FFTSize); + initializeFFT(6, 7 * 512); setup_status_bar (true); m_toneSpacing=0.0; WSPR_config(false); @@ -11482,8 +11417,8 @@ void MainWindow::on_actionMSK144_triggered() else if (m_currentBand=="6m" or m_currentBand=="4m") ui->sbTR->setValue (m_msk144_tr6); else ui->sbTR->setValue (m_msk144_tr); } - ui->txFirstCheckBox->setEnabled(true); - QTimer::singleShot (50, [=] {on_sbTR_valueChanged (ui->sbTR->value());}); + setTxFirstModeEnabled (true); + QTimer::singleShot (50, this, [=] {on_sbTR_valueChanged (ui->sbTR->value());}); ui->sbFtol->setValue (m_settings->value ("Ftol_MSK144", 50).toInt()); // restore last used parameter m_bShMsgs=m_settings->value("ShMsgs_MSK144",false).toBool(); ui->cbShMsgs->setChecked(m_bShMsgs); @@ -11494,43 +11429,44 @@ void MainWindow::on_actionMSK144_triggered() ui->RxFreqSpinBox->setMinimum(1400); ui->RxFreqSpinBox->setMaximum(1600); ui->RxFreqSpinBox->setSingleStep(10); - ui->lh_decodes_headings_label->setText(" UTC dB T Freq " + tr ("Message")); - ui->rh_decodes_headings_label->setText(" UTC dB T Freq " + tr ("Message")); + setDecodeHeadings(" UTC dB T Freq " + tr ("Message"), " UTC dB T Freq " + tr ("Message")); if (m_tci_audio && ui->bandComboBox->currentText()!="OOB") Q_EMIT m_config.transceiver_period(m_TRperiod); if (!m_tci_audio) { m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe - m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe + m_detector->setTRPeriod(m_TRperiod); // marshals to the audio thread } m_fastGraph->setTRPeriod(m_TRperiod); - ui->lh_decodes_title_label->setText(tr ("Band Activity")); - ui->rh_decodes_title_label->setText(tr ("Tx Messages")); + setDecodeTitles(tr ("Band Activity"), tr ("Tx Messages")); ui->actionMSK144->setChecked(true); ui->rptSpinBox->setMinimum(-8); ui->rptSpinBox->setMaximum(24); ui->rptSpinBox->setValue(0); ui->rptSpinBox->setSingleStep(1); ui->sbFtol->values ({20, 50, 100, 150, 200, 250, 300, 350, 400, 450, 500}); - // 01234567890123456789012345678901234567 - displayWidgets(nWidgets("10111111010000000001000100011000000000")); + applyModeUiState({ModeUiControl::TxFirst, ModeUiControl::RxFrequency, + ModeUiControl::FrequencyTolerance, ModeUiControl::Report, + ModeUiControl::TrPeriod, ModeUiControl::CqTxFrequency, + ModeUiControl::ShortMessages, ModeUiControl::AutoSequence, + ModeUiControl::DecodeDepth, ModeUiControl::Swl, + ModeUiControl::Respond}); fast_config(m_bFastMode); statusChanged(); - QString t0=""; - if(SpecOp::NA_VHF==m_specOp) t0="NA VHF"; - if(SpecOp::EU_VHF==m_specOp) t0="EU VHF"; - if(t0=="") { + QString t0 = specOpLabel(); + if(t0.isEmpty()) { ui->labDXped->setVisible(false); } else { ui->labDXped->setVisible(true); ui->labDXped->setText(t0); on_contest_log_action_triggered(); } - if(!(programStart or m_freqNominal == 0)) m_msk144basefreq = m_freqNominal; // MSK144 QSY + if(!(programStart or m_operatingFrequency.rx () == 0)) m_msk144basefreq = m_operatingFrequency.rx (); // MSK144 QSY } void MainWindow::on_actionWSPR_triggered() { + noteTxModeChange (QStringLiteral ("WSPR")); m_mode="WSPR"; if(m_specOp==SpecOp::HOUND) { m_config.setSpecial_None(); @@ -11543,12 +11479,9 @@ void MainWindow::on_actionWSPR_triggered() Q_EMIT m_config.transceiver_period(m_TRperiod); if (!m_tci_audio) { m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe - m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe + m_detector->setTRPeriod(m_TRperiod); // marshals to the audio thread } - m_nsps=6912; //For symspec only - m_FFTSize = m_nsps / 2; - if (m_tci_audio) Q_EMIT m_config.transceiver_blocksize (m_FFTSize); - else Q_EMIT FFTSize (m_FFTSize); + initializeFFT(6912); m_hsymStop=396; m_toneSpacing=12000.0/8192.0; setup_status_bar (false); @@ -11561,14 +11494,15 @@ void MainWindow::on_actionWSPR_triggered() m_bFastMode=false; m_bFast9=false; ui->TxFreqSpinBox->setValue(ui->WSPRfreqSpinBox->value()); - // 01234567890123456789012345678901234567 - displayWidgets(nWidgets("00000000000000000101000000000000000000")); + applyModeUiState({ModeUiControl::WsprControls, ModeUiControl::DecodeDepth}); fast_config(false); + enterBeaconMode (); statusChanged(); } void MainWindow::on_actionEcho_triggered() { + noteTxModeChange (QStringLiteral ("Echo")); int nd=int(m_ndepth&3); on_actionJT4_triggered(); // Don't allow decoding depth to be changed just because Echo mode was entered: @@ -11587,12 +11521,9 @@ void MainWindow::on_actionEcho_triggered() Q_EMIT m_config.transceiver_period(m_TRperiod); if (!m_tci_audio) { m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe - m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe + m_detector->setTRPeriod(m_TRperiod); // marshals to the audio thread } - m_nsps=6912; //For symspec only - m_FFTSize = m_nsps / 2; - if (m_tci_audio) Q_EMIT m_config.transceiver_blocksize (m_FFTSize); - else Q_EMIT FFTSize (m_FFTSize); + initializeFFT(6912); m_hsymStop=9; m_toneSpacing=1.0; switch_mode(Modes::Echo); @@ -11607,25 +11538,30 @@ void MainWindow::on_actionEcho_triggered() m_bFastMode=false; m_bFast9=false; WSPR_config(true); - ui->lh_decodes_headings_label->setText(" UTC Hour Level Doppler Width N Q DF SNR dBerr TS EchoMsg"); - // 01234567890123456789012345678901234567 - displayWidgets(nWidgets("00000000000000000010001000000000000000")); + ui->lh_decodes_headings_label->setText(" UTC Hour Level Doppler Width Dgrd N Q DF SNR dBerr TS EchoMsg"); + applyModeUiState({ModeUiControl::ClearAverage, ModeUiControl::EchoGraph}); fast_config(false); ui->sbEchoAvg->values ({1, 2, 5, 10, 20, 50, 100}); statusChanged(); monitor(false); //Don't auto-start Monitor in Echo mode. // Ensure that the correct frequency is set and displayed - QTimer::singleShot (500, [=] { - auto const& row = m_config.frequencies ()->best_working_frequency (m_freqNominal); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); + QTimer::singleShot (500, this, [=] { + auto const& row = m_config.frequencies ()->best_working_frequency (m_operatingFrequency.rx ()); + Frequency frequency; + if (workingFrequencyAt (row, frequency) + && nominalFrequencyChangeAllowed (FrequencyRequestOrigin::Automatic)) + { + ui->bandComboBox->setCurrentIndex (row); + requestBandChange (frequency, FrequencyRequestOrigin::Automatic); + } if (m_monitoring) ui->monitorButton->click(); }); } void MainWindow::on_actionFreqCal_triggered() { + noteTxModeChange (QStringLiteral ("FreqCal")); on_actionJT9_triggered(); m_mode="FreqCal"; if(m_specOp==SpecOp::HOUND) { @@ -11641,12 +11577,9 @@ void MainWindow::on_actionFreqCal_triggered() Q_EMIT m_config.transceiver_period(m_TRperiod); if (!m_tci_audio) { m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe - m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe + m_detector->setTRPeriod(m_TRperiod); // marshals to the audio thread } - m_nsps=6912; //For symspec only - m_FFTSize = m_nsps / 2; - if (m_tci_audio) Q_EMIT m_config.transceiver_blocksize (m_FFTSize); - else Q_EMIT FFTSize (m_FFTSize); + initializeFFT(6912); m_hsymStop=((int(m_TRperiod/0.288))/8)*8; m_frequency_list_fcal_iter = m_config.frequencies ()->begin (); ui->RxFreqSpinBox->setValue(1500); @@ -11654,16 +11587,27 @@ void MainWindow::on_actionFreqCal_triggered() // 18:15:47 0 1 1500 1550.349 0.100 3.5 10.2 ui->lh_decodes_headings_label->setText(" UTC Freq CAL Offset fMeas DF Level S/N"); ui->measure_check_box->setChecked (false); - // 01234567890123456789012345678901234567 - displayWidgets(nWidgets("00110100000000000000000000000100000000")); + applyModeUiState({ModeUiControl::RxFrequency, ModeUiControl::FrequencyTolerance, + ModeUiControl::TrPeriod, ModeUiControl::Measure}); statusChanged(); } void MainWindow::switch_mode (Mode mode) { + clear_generated_message_error (); + if (m_mode != "Q65" || mode != Modes::Q65) { + m_q65PileupCopiedLastRxCall.clear(); + m_q65PileupCopiedCallers.clear(); + } + // Sit just under the decoded-text panes, outside the per-mode + // displayWidgets()/ModeUiControl mechanism -- only meaningful for JTTY. + bool const jtty = m_mode=="JTTY"; + ui->cbLowerCase->setVisible(jtty); + ui->cbIncludeTime->setVisible(jtty); + if (mode != Modes::MSK144) m_msk144basefreq = 0; no_a7_decodes = true; // Don't allow a7 decodes during the first period because they can be leftovers from the previous mode msk144qsy = false; // MSK144 QSY - QTimer::singleShot ((int(1500.0*m_TRperiod)), [=] {no_a7_decodes = false;}); + QTimer::singleShot ((int(1500.0*m_TRperiod)), this, [=] {no_a7_decodes = false;}); if (m_mode != "Q65" && m_specOp==SpecOp::Q65_PILEUP) { m_config.setSpecial_None(); m_specOp=m_config.special_op_id(); @@ -11672,12 +11616,12 @@ void MainWindow::switch_mode (Mode mode) } m_fastGraph->setMode(m_mode); m_config.frequencies ()->filter (m_config.region (), mode, true); // filter on current time - auto const& row = m_config.frequencies ()->best_working_frequency (m_freqNominal); - if (!keep_frequency) { + auto const& row = m_config.frequencies ()->best_working_frequency (m_operatingFrequency.rx ()); + Frequency frequency; + if (!keep_frequency && workingFrequencyAt (row, frequency) + && nominalFrequencyChangeAllowed (FrequencyRequestOrigin::Automatic)) { ui->bandComboBox->setCurrentIndex (row); - if (row >= 0 ) { - on_bandComboBox_activated (row); - } + requestBandChange (frequency, FrequencyRequestOrigin::Automatic); } ui->rptSpinBox->setSingleStep(1); ui->rptSpinBox->setMinimum(-50); @@ -11700,26 +11644,30 @@ void MainWindow::switch_mode (Mode mode) ui->rh_decodes_widget->setVisible (false); // UR disable for AL + widescreen versions ui->lh_decodes_title_label->setVisible(false); } - QTimer::singleShot (500, [=] { + QTimer::singleShot (500, this, [=] { if (!(m_mode=="Echo" or ((m_mode=="Q65" or m_mode=="JT65") && m_config.decode_at_52s())) && ui->actionAstronomical_data->isChecked () && m_config.auto_astro()) ui->actionAstronomical_data->setChecked (false); }); check_button_color(); + ui->autoButton->setEnabled(m_mode != "JTTY"); + ui->autoButton->setVisible(m_mode != "JTTY"); + updateDecodeControls (); } void MainWindow::WSPR_config(bool b) { ui->rh_decodes_widget->setVisible(!b); // UR disable for AL + widescreen version - ui->controls_stack_widget->setCurrentIndex (b && m_mode != "Echo" ? 1 : 0); - if(m_mode=="Echo") ui->controls_stack_widget->setCurrentIndex(2); + ui->controls_stack_widget->setCurrentIndex (b && m_mode != "Echo" ? 2 : 0); + if(m_mode=="Echo") ui->controls_stack_widget->setCurrentIndex(3); + if(m_mode=="JTTY") ui->controls_stack_widget->setCurrentIndex(1); ui->QSO_controls_widget->setVisible (!b); ui->DX_controls_widget->setVisible (!b or (m_mode=="Echo")); - ui->WSPR_controls_widget->setVisible (b); ui->lh_decodes_title_label->setVisible(!b and ui->cbMenus->isChecked()); ui->logQSOButton->setVisible(!b); ui->DecodeButton->setEnabled(!b); bool bFST4W=(m_mode=="FST4W"); - ui->sbTxPercent->setEnabled(!bFST4W or (tr("Random") == ui->RoundRobin->currentText())); + ui->sbTxPercent->setEnabled(!bFST4W + or configuredRoundRobinPolicy ().kind == BeaconTx::RoundRobinPolicy::Kind::Random); ui->band_hopping_group_box->setVisible(true); ui->RoundRobin->setVisible(bFST4W); ui->sbFST4W_RxFreq->setVisible(bFST4W); @@ -11731,7 +11679,8 @@ void MainWindow::WSPR_config(bool b) if(!m_config.miles()) t += " km"; ui->lh_decodes_headings_label->setText(t); if (m_config.is_transceiver_online ()) { - m_config.transceiver_tx_frequency (0); // turn off split + m_config.transceiver_tx_frequency ( + 0, RigFrequencyChangePolicy::ChangeKind::TxPathCorrection); // turn off split } m_bSimplex = true; } else @@ -11745,7 +11694,7 @@ void MainWindow::fast_config(bool b) { m_bFastMode=b; ui->TxFreqSpinBox->setEnabled(!b); - ui->sbTR->setVisible(b); + setTrPeriodVisible(b); if(b and (m_bFast9 or m_mode=="MSK144")) { m_wideGraph->hide(); m_fastGraph->showNormal(); @@ -11755,8 +11704,15 @@ void MainWindow::fast_config(bool b) } } +void MainWindow::setTrPeriodVisible(bool visible) +{ + ui->sbTR->setVisible(visible); + m_trPeriodLabel->setVisible(visible); +} + void MainWindow::on_TxFreqSpinBox_valueChanged(int n) { + ui->TxFreqSpinBox_2->setValue(n); if (m_config.superFox() && m_specOp==SpecOp::FOX && n!=750) { ui->TxFreqSpinBox->setValue(750); m_wideGraph->setTxFreq(750); @@ -11766,8 +11722,7 @@ void MainWindow::on_TxFreqSpinBox_valueChanged(int n) m_wideGraph->setTxFreq(n); // if (ui->cbHoldTxFreq->isChecked ()) ui->RxFreqSpinBox->setValue(n); if(m_mode!="MSK144") { - if (m_tci_audio) Q_EMIT m_config.transceiver_trfrequency(n - m_XIT); - else Q_EMIT transmitFrequency (n - m_XIT); + setXIT (n); } if(m_mode=="Q65") { @@ -11780,27 +11735,16 @@ void MainWindow::on_TxFreqSpinBox_valueChanged(int n) } if (m_mode != "MSK144" && m_mode != "FST4W" && m_mode != "WSPR" && m_mode != "Echo" && m_mode != "FreqCal" && m_specOp!=SpecOp::FOX) { - QTimer::singleShot (200, [=] {m_settings->setValue("TxFreq_old",ui->TxFreqSpinBox->value());}); - } - if(m_specOp==SpecOp::FOX && !m_config.superFox()) QTimer::singleShot (50, [=] {m_TxFreqFox=n;}); - - // UK stations must transmit below 5358 kHz on 60m - if((m_config.my_callsign().startsWith("G") or m_config.my_callsign().startsWith("M") - or m_config.my_callsign().startsWith("2")) && (m_freqNominal + ui->TxFreqSpinBox->value()) > 5357950) { - QString band=m_config.bands()->find(m_freqNominal); - if(band=="60m") { - ui->TxFreqSpinBox->setValue(5357950 - m_freqNominal); - m_wideGraph->setTxFreq(5357950 - m_freqNominal); - QTimer::singleShot (0, [=] { // don't block guiUpdate - MessageBox::information_message (this, tr ("UK stations must transmit below 5358 kHz on 60m.")); - }); - } + QTimer::singleShot (200, this, [=] {m_settings->setValue("TxFreq_old",ui->TxFreqSpinBox->value());}); } + if(m_specOp==SpecOp::FOX && !m_config.superFox()) QTimer::singleShot (50, this, [=] {m_TxFreqFox=n;}); + statusUpdate (); } void MainWindow::on_RxFreqSpinBox_valueChanged(int n) { + ui->RxFreqSpinBox_2->setValue(n); if (m_config.superFox() && m_specOp==SpecOp::HOUND) { if (ui->RxFreqSpinBox->value() < 200) { ui->RxFreqSpinBox->setValue(200); @@ -11813,11 +11757,25 @@ void MainWindow::on_RxFreqSpinBox_valueChanged(int n) } m_wideGraph->setRxFreq(n); if (m_mode == "FreqCal") { - setRig (); + if (m_frequency_list_fcal_iter != m_config.frequencies ()->end ()) + { + if (!requestNominalFrequencyChange ( + m_frequency_list_fcal_iter->frequency_ - n, + FrequencyRequestOrigin::User)) + { + auto const accepted_rx_frequency = static_cast ( + m_frequency_list_fcal_iter->frequency_ - m_operatingFrequency.rx ()); + QSignalBlocker const rx_blocker {ui->RxFreqSpinBox}; + QSignalBlocker const rx_copy_blocker {ui->RxFreqSpinBox_2}; + ui->RxFreqSpinBox->setValue (accepted_rx_frequency); + ui->RxFreqSpinBox_2->setValue (accepted_rx_frequency); + m_wideGraph->setRxFreq (accepted_rx_frequency); + } + } } if (m_mode != "MSK144" && m_mode != "FST4W" && m_mode != "WSPR" && m_mode != "Echo" && m_mode != "FreqCal" && !(SpecOp::HOUND == m_specOp && m_config.superFox())) { - QTimer::singleShot (200, [=] {m_settings->setValue("RxFreq_old",ui->RxFreqSpinBox->value());}); + QTimer::singleShot (200, this, [=] {m_settings->setValue("RxFreq_old",ui->RxFreqSpinBox->value());}); } statusUpdate (); } @@ -11893,8 +11851,8 @@ void MainWindow::on_actionUse_multithreaded_FT8_decoder_triggered(bool checked) { m_multithreadFT8 = checked; dec_data.params.lmultift8 = m_multithreadFT8; - qDebug() << "m_multithreadFT8 is" << m_multithreadFT8; - qDebug() << "dec_data.params.lmultift8 is" << dec_data.params.lmultift8; +// qDebug() << "m_multithreadFT8 is" << m_multithreadFT8; +// qDebug() << "dec_data.params.lmultift8 is" << dec_data.params.lmultift8; if (checked && !(m_specOp==SpecOp::HOUND && m_config.superFox())) { if (m_ft8DecoderStart==0) m_hsymStop=49; else if (m_ft8DecoderStart==1) { @@ -12025,9 +11983,15 @@ void MainWindow::on_actionOpen_log_directory_triggered () void MainWindow::on_bandComboBox_currentIndexChanged (int index) { + if (keep_frequency) + { + restoreNominalFrequencySelection (); + return; + } + auto const& frequencies = m_config.frequencies (); auto const& source_index = frequencies->mapToSource (frequencies->index (index, FrequencyList_v2_101::frequency_column)); - Frequency frequency {m_freqNominal}; + Frequency frequency {m_operatingFrequency.rx ()}; if (source_index.isValid ()) { frequency = frequencies->frequency_list ()[source_index.row ()].frequency_; @@ -12036,7 +12000,6 @@ void MainWindow::on_bandComboBox_currentIndexChanged (int index) // Lookup band auto const& band = m_config.bands ()->find (frequency); ui->bandComboBox->setCurrentText (band.size () ? band : m_config.bands ()->oob ()); - setXIT (ui->TxFreqSpinBox->value ()); displayDialFrequency (); } @@ -12056,28 +12019,138 @@ void MainWindow::on_bandComboBox_activated (int index) { auto const& frequencies = m_config.frequencies (); auto const& source_index = frequencies->mapToSource (frequencies->index (index, FrequencyList_v2_101::frequency_column)); - Frequency frequency {m_freqNominal}; + Frequency frequency {m_operatingFrequency.rx ()}; if (source_index.isValid ()) { frequency = frequencies->frequency_list ()[source_index.row ()].frequency_; } - m_bandEdited = true; - band_changed (frequency); - m_wideGraph->setRxBand (m_config.bands ()->find (frequency)); + if (requestBandChange (frequency, FrequencyRequestOrigin::User)) + { + setXIT (ui->TxFreqSpinBox->value ()); + m_wideGraph->setRxBand (m_config.bands ()->find (frequency)); + } // m_specOp=m_config.special_op_id(); // if (m_specOp==SpecOp::HOUND) auto_tx_mode(false); // only required if RETURN intiates TXing } -void MainWindow::band_changed (Frequency f) +bool MainWindow::requestBandChange (Frequency frequency, FrequencyRequestOrigin origin) +{ + if (!nominalFrequencyChangeAllowed (origin)) + { + restoreNominalFrequencySelection (); + return false; + } + auto const previous_frequency = m_operatingFrequency.rx (); + if (!RigFrequencyChangePolicy::requestWhileMonitoring ( + m_monitoring, + [this] (bool state) {monitor (state);}, + [this, frequency, origin] { + return requestNominalFrequencyChange (frequency, origin); + })) + { + restoreNominalFrequencySelection (); + return false; + } + + m_bandEdited = true; + applyBandChange (frequency, previous_frequency); + return true; +} + +bool MainWindow::workingFrequencyAt (int row, Frequency& frequency) const +{ + if (row < 0) return false; + + auto const& frequencies = m_config.frequencies (); + auto const source_index = frequencies->mapToSource ( + frequencies->index (row, FrequencyList_v2_101::frequency_column)); + if (!source_index.isValid ()) return false; + + frequency = frequencies->frequency_list ()[source_index.row ()].frequency_; + return true; +} + +bool MainWindow::requestBandButtonFrequency (Frequency lookup_frequency, + Frequency fallback_frequency, + double msk144_tr_period) +{ + if (!nominalFrequencyChangeAllowed (FrequencyRequestOrigin::User)) return false; + + if (m_mode == "MSK144") + { + ui->sbTR->setValue (msk144_tr_period); + programStart = true; + QTimer::singleShot (250, [=] {programStart = false;}); + } + + auto const row = m_config.frequencies ()->best_working_frequency (lookup_frequency); + if (row >= 0) + { + Frequency frequency; + if (!workingFrequencyAt (row, frequency)) return false; + ui->bandComboBox->setCurrentIndex (row); + if (!requestBandChange (frequency, FrequencyRequestOrigin::User)) return false; + setXIT (ui->TxFreqSpinBox->value ()); + m_wideGraph->setRxBand (m_config.bands ()->find (frequency)); + } + else + { + keep_frequency = true; + if (!requestNominalFrequencyChange (fallback_frequency, FrequencyRequestOrigin::User)) + { + keep_frequency = false; + restoreNominalFrequencySelection (); + return false; + } + QTimer::singleShot (250, [=] {keep_frequency = false;}); + setXIT (ui->TxFreqSpinBox->value ()); + } + return true; +} + +bool MainWindow::requestAlternateBandFrequency (Frequency frequency) +{ + if (!nominalFrequencyChangeAllowed (FrequencyRequestOrigin::User)) return false; + + keep_frequency = true; + if (!requestNominalFrequencyChange (frequency, FrequencyRequestOrigin::User)) + { + keep_frequency = false; + restoreNominalFrequencySelection (); + return false; + } + QTimer::singleShot (250, this, [=] {keep_frequency = false;}); + setXIT (ui->TxFreqSpinBox->value ()); + return true; +} + +void MainWindow::restoreNominalFrequencySelection () { + m_bandEdited = false; + QSignalBlocker const blocker {ui->bandComboBox}; + auto const band = m_config.bands ()->find (m_operatingFrequency.rx ()); + ui->bandComboBox->setCurrentText (band.size () ? band : m_config.bands ()->oob ()); + displayDialFrequency (); +} + +void MainWindow::band_changed (Frequency frequency) +{ + applyBandChange (frequency, m_operatingFrequency.rx ()); +} + +void MainWindow::applyBandChange (Frequency f, Frequency previous_frequency) +{ + if (f != previous_frequency) cancelPendingFt8Decode ("dial frequency changed"); + m_autoRespondPeriodState.disarm(); msk144qsy = false; // MSK144 QSY // Don't allow a7 decodes during the first period because they can be leftovers from the previous band no_a7_decodes = true; - QTimer::singleShot ((int(1500.0*m_TRperiod)), [=] {no_a7_decodes = false;}); + QTimer::singleShot ((int(1500.0*m_TRperiod)), this, [=] {no_a7_decodes = false;}); // Set the attenuation value if options are checked if (m_config.pwrBandTxMemory() && !m_tune) { - auto const&curBand = ui->bandComboBox->currentText(); + auto curBand = m_config.bands()->find(f); + if (curBand.isEmpty()) curBand = m_config.bands()->oob(); if (m_pwrBandTxMemory.contains(curBand)) { ui->outAttenuation->setValue(m_pwrBandTxMemory[curBand].toInt()); } @@ -12088,9 +12161,9 @@ void MainWindow::band_changed (Frequency f) if (m_bandEdited && !keep_frequency) { if (m_mode!="WSPR" && !ui->pbBandHopping->isChecked() && !ui->DX_Call_Button->isChecked()) { // preserves auto Tx - if (f + m_wideGraph->nStartFreq () > m_freqNominal + ui->TxFreqSpinBox->value () + if (f + m_wideGraph->nStartFreq () > previous_frequency + ui->TxFreqSpinBox->value () || f + m_wideGraph->nStartFreq () + m_wideGraph->fSpan () <= - m_freqNominal + ui->TxFreqSpinBox->value ()) { + previous_frequency + ui->TxFreqSpinBox->value ()) { // qDebug () << "start f:" << m_wideGraph->nStartFreq () << "span:" << m_wideGraph->fSpan () << "DF:" << ui->TxFreqSpinBox->value (); // disable auto Tx if "blind" QSY outside of waterfall ui->stopTxButton->click (); // halt any transmission @@ -12110,16 +12183,11 @@ void MainWindow::band_changed (Frequency f) { m_frequency_list_fcal_iter = m_config.frequencies ()->find (f); } - if(m_tci) { - m_freqNominal = f; - m_freqTxNominal = m_freqNominal; - } - setRig (f); setXIT (ui->TxFreqSpinBox->value ()); m_specOp=m_config.special_op_id(); if (m_specOp==SpecOp::FOX) FoxReset("BandChange"); // when changing bands, don't preserve the Fox queues m_lastloggedcall.clear(); //ft8md - if (m_mode=="MSK144" && !(programStart or m_freqNominal == 0)) m_msk144basefreq = m_freqNominal; // MSK144 QSY + if (m_mode=="MSK144" && !(programStart or m_operatingFrequency.rx () == 0)) m_msk144basefreq = m_operatingFrequency.rx (); // MSK144 QSY } // Erase the decodedTextBrowsers only if the band really changed @@ -12132,26 +12200,13 @@ void MainWindow::band_changed (Frequency f) m_skedFreq=0.000001*f; } if (m_mode=="MSK144" && !programStart) { // restore MSK144 TRperiods by band - QTimer::singleShot (750, [=] { + QTimer::singleShot (750, this, [=] { if (m_currentBand=="2m" && m_msk144_tr2!=ui->sbTR->value()) ui->sbTR->setValue (m_msk144_tr2); else if ((m_currentBand=="6m" or m_currentBand=="4m") && m_msk144_tr6!=ui->sbTR->value()) ui->sbTR->setValue (m_msk144_tr6); else ui->sbTR->setValue (m_msk144_tr); }); } - // UK stations must transmit below 5358 kHz on 60m - if((m_config.my_callsign().startsWith("G") or m_config.my_callsign().startsWith("M") - or m_config.my_callsign().startsWith("2")) && (m_freqNominal + ui->TxFreqSpinBox->value()) > 5357950) { - QString band=m_config.bands()->find(m_freqNominal); - if(band=="60m") { - ui->TxFreqSpinBox->setValue(5357950 - m_freqNominal); - m_wideGraph->setTxFreq(5357950 - m_freqNominal); - QTimer::singleShot (0, [=] { // don't block guiUpdate - MessageBox::information_message (this, tr ("UK stations must transmit below 5358 kHz on 60m.")); - }); - } - } - /* //ft8md qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000; @@ -12205,62 +12260,20 @@ void MainWindow::on_rptSpinBox_valueChanged(int n) statusChanged(); } -void MainWindow::on_tuneButton_clicked (bool checked) -{ - ui->pbBandHopping->setChecked(false); // disable band hopping - // prevent tuning on top of a SuperFox message - if (SpecOp::HOUND==m_specOp && m_config.superFox() && !m_tune) { - QDateTime now = QDateTime::currentDateTimeUtc(); - int s = now.time().toString("ss").toInt(); - if ((s >= 0 && s < 15) || (s >= 30 && s < 45)) { - ui->tuneButton->setChecked (false); - m_config.transceiver_tune (false); // reset rig tuning - return; - } - } - m_config.transceiver_tune (false); // reset rig tuning - if (blocked) return; - if (m_auto && !(m_mode=="WSPR" || m_mode=="FST4W")) ui->autoButton->click(); // stop any other transmission - stopWRTimer.stop(); // stop any Wait & Reply timeout - stopWCTimer.stop(); // stop any Wait & Call timeout - if (checked && m_config.tune_watchdog() && !(m_mode=="WSPR" || m_mode=="FST4W")) { - tuneATU_Timer.start (m_config.tune_watchdog_time()*1000); // tune watchdog - } - if (!checked) { - tuneATU_Timer.stop (); // stop tune watchdog when stopping Tune manually - ui->tuneButton->setText("Tune"); - } - static bool lastChecked = false; - if (lastChecked == checked) return; - lastChecked = checked; - if (checked && m_tune==false) { // we're starting tuning so remember Tx and change pwr to Tune value - if (m_config.pwrBandTuneMemory ()) { - auto const& curBand = ui->bandComboBox->currentText(); - m_pwrBandTxMemory[curBand] = ui->outAttenuation->value(); // remember our Tx pwr - m_PwrBandSetOK = false; - if (m_pwrBandTuneMemory.contains(curBand)) { - ui->outAttenuation->setValue(m_pwrBandTuneMemory[curBand].toInt()); // set to Tune pwr - } - m_PwrBandSetOK = true; - } - } - if (m_tune) { - tuneButtonTimer.start(250); - } else { - m_sentFirst73=false; - itone[0]=0; - on_monitorButton_clicked (true); - m_tune=true; - } - if (m_tci_audio) Q_EMIT m_config.transceiver_tune(checked); - else Q_EMIT tune (checked); -} void MainWindow::end_tuning () { tuneATU_Timer.stop (); // stop tune watchdog when stopping Tune manually - on_stopTxButton_clicked (); + if (m_mode == "WSPR" || m_mode == "FST4W") + { + if (m_tune) stop_tuning (); + reset_transmit_controls_after_stop (); + } + else + { + on_stopTxButton_clicked (); + } // we're turning off so remember our Tune pwr setting and reset to Tx pwr if (m_config.pwrBandTuneMemory() || m_config.pwrBandTxMemory()) { auto const& curBand = ui->bandComboBox->currentText(); @@ -12282,42 +12295,13 @@ void MainWindow::stop_tuning () void MainWindow::stopTuneATU() { + noteTxStopReason (TxEvidence::TxStopReason::Watchdog); tuneATU_Timer.stop (); // stop tune watchdog when stopping Tune manually on_tuneButton_clicked(false); m_bTxTime=false; ui->tuneButton->setText("Tune"); } -void MainWindow::on_stopTxButton_clicked() // Stop Tx -{ - ui->pbBandHopping->setChecked(false); // disable band hopping - if (m_tune) stop_tuning (); - if (m_auto and !m_tuneup) auto_tx_mode (false); - m_btxok=false; - m_bCallingCQ = false; - m_bAutoReply = false; // ready for next - m_maxPoints=-1; - if (ui->DX_Call_Button->isChecked()) ui->DX_Call_Button->click (); - stopWRTimer.stop(); // Stop any Wait & Reply timeout - stopWCTimer.stop(); // Stop any Wait & Call timeout - tuneATU_Timer.stop (); // stop tune watchdog when stopping Tune manually - no_wait_and_call = false; - m_specOp=m_config.special_op_id(); - if (ui->respondComboBox->isVisible() && ui->respondComboBox->currentText() != "CQ: None") { - Dpoints=0; // reset points - maxDPoints=0; // reset points - dBpoints=-28; // reset points - dBpoints2=99; // reset points - maxdBPoints=-28; // reset points - mindBPoints=99; // reset points - } - pounce = false; - ui->autoButton->setChecked(false); // ensure auoButton is unchecked - filtered = false; - ignored = false; - m_muted = false; - check_button_color(); -} void MainWindow::rigOpen () { @@ -12328,33 +12312,14 @@ void MainWindow::rigOpen () m_config.sync_transceiver (true, true); } -void MainWindow::on_pbR2T_clicked() -{ - ui->TxFreqSpinBox->setValue(ui->RxFreqSpinBox->value ()); -} - -void MainWindow::on_pbT2R_clicked() -{ - if (ui->RxFreqSpinBox->isEnabled ()) - { - ui->RxFreqSpinBox->setValue (ui->TxFreqSpinBox->value ()); - } -} -void MainWindow::on_readFreq_clicked() -{ - if (m_transmitting) return; - if (m_config.transceiver_online ()) - { - m_config.sync_transceiver (true, true); - } -} void MainWindow::setXIT(int n, Frequency base) { - if (m_transmitting && !m_config.tx_QSY_allowed ()) return; + auto const kind = RigFrequencyChangePolicy::ChangeKind::TxPathCorrection; + if (!rigFrequencyChangeDecision (kind).allowed) return; // If "CQ nnn ..." feature is active, set the proper Tx frequency if(m_config.split_mode () && ui->cbCQTx->isEnabled () && ui->cbCQTx->isVisible () && ui->cbCQTx->isChecked()) @@ -12362,17 +12327,19 @@ void MainWindow::setXIT(int n, Frequency base) if (6 == m_ntx || (7 == m_ntx && m_gen_message_is_cq)) { // All conditions are met, use calling frequency - base = m_freqNominal / 1000000 * 1000000 + 1000 * ui->sbCQTxFreq->value () + m_XIT; + base = m_operatingFrequency.rx () / 1000000 * 1000000 + 1000 * ui->sbCQTxFreq->value () + m_XIT; } - } - if (!base) base = m_freqNominal; - m_XIT = 0; + } + if (!base) base = m_operatingFrequency.rx (); + FrequencyDelta requested_xit = 0; + Frequency requested_tx_nominal = base; + bool update_tx_nominal = false; if (!(m_bSimplex || (SpecOp::FOX==m_specOp && m_config.superFox()))) { // m_bSimplex is false, so we can use split mode if requested if (m_config.split_mode () && (!m_config.enable_VHF_features () || m_mode=="FT4" || m_mode == "FT8" || m_mode=="FST4")) { // Don't use XIT for VHF & up - m_XIT=(n/500)*500 - 1500; + requested_xit=(n/500)*500 - 1500; } if ((m_monitoring || m_transmitting) @@ -12381,9 +12348,10 @@ void MainWindow::setXIT(int n, Frequency base) { // All conditions are met, reset the transceiver Tx dial // frequency - m_freqTxNominal = base + m_XIT; - if (m_astroWidget) m_astroWidget->nominal_frequency (m_freqNominal, m_freqTxNominal); - m_config.transceiver_tx_frequency (m_freqTxNominal + m_astroCorrection.tx); + requested_tx_nominal = base + requested_xit; + if (!m_config.transceiver_tx_frequency ( + requested_tx_nominal + m_astroCorrection.tx, kind)) return; + update_tx_nominal = true; } } if (SpecOp::FOX==m_specOp && m_config.superFox() @@ -12392,11 +12360,22 @@ void MainWindow::setXIT(int n, Frequency base) { // the transceiver Tx dial frequency must be consistent with // zero m_XIT for SuperFox - m_freqTxNominal = base; - if (m_astroWidget) m_astroWidget->nominal_frequency (m_freqNominal, m_freqTxNominal); - m_config.transceiver_tx_frequency (m_freqTxNominal + m_astroCorrection.tx); + requested_tx_nominal = base; + if (!m_config.transceiver_tx_frequency ( + requested_tx_nominal + m_astroCorrection.tx, kind)) return; + update_tx_nominal = true; } + m_XIT = requested_xit; + if (update_tx_nominal) + { + m_operatingFrequency.commitAcceptedTx (requested_tx_nominal); + if (m_astroWidget) + { + m_astroWidget->nominal_frequency (m_operatingFrequency.rx (), m_operatingFrequency.tx ()); + } + } + //Now set the audio Tx freq if (m_tci_audio) Q_EMIT m_config.transceiver_trfrequency(ui->TxFreqSpinBox->value () - m_XIT); else Q_EMIT transmitFrequency (ui->TxFreqSpinBox->value () - m_XIT); @@ -12406,8 +12385,12 @@ void MainWindow::setFreq4(int rxFreq, int txFreq) { if (m_mode=="Q65" && ui->actionDisable_clicks_on_waterfall->isVisible() && ui->actionDisable_clicks_on_waterfall->isChecked() && !(Qt::AltModifier & QApplication::keyboardModifiers ())) return; - if (m_mode=="ECHO") return; // we do not adjust rx/tx for echo mode -- always 1500Hz - if (ui->RxFreqSpinBox->isEnabled () && !(SpecOp::HOUND==m_specOp && m_config.superFox() && + if (m_mode == Modes::name(Modes::Echo)) return; // Echo uses a fixed 1500 Hz audio frequency. + bool const vhf_dial_adjustment = !ui->TxFreqSpinBox->isEnabled () + && m_config.enable_VHF_features () + && (Qt::ControlModifier & QApplication::keyboardModifiers ()); + if (!vhf_dial_adjustment && ui->RxFreqSpinBox->isEnabled () + && !(SpecOp::HOUND==m_specOp && m_config.superFox() && (rxFreq < 700 or rxFreq > 800))) ui->RxFreqSpinBox->setValue(rxFreq); if(m_mode=="WSPR" or m_mode=="FST4W") { ui->WSPRfreqSpinBox->setValue(txFreq); @@ -12421,31 +12404,61 @@ void MainWindow::setFreq4(int rxFreq, int txFreq) if (m_transmitting) m_restart = true; } } - else if (m_config.enable_VHF_features () - && (Qt::ControlModifier & QApplication::keyboardModifiers ())) { + else if (vhf_dial_adjustment) { // for VHF & up we adjust Tx dial frequency to equalize Tx to Rx // when user CTRL+clicks on waterfall auto temp = ui->TxFreqSpinBox->value (); - ui->RxFreqSpinBox->setValue (temp); - setRig (m_freqNominal + txFreq - temp); - setXIT (ui->TxFreqSpinBox->value ()); + if (requestNominalFrequencyChange ( + m_operatingFrequency.rx () + txFreq - temp, FrequencyRequestOrigin::User)) + { + ui->RxFreqSpinBox->setValue (temp); + setXIT (ui->TxFreqSpinBox->value ()); + } } } } +void MainWindow::applyOperatingFrequencyTransition (OperatingFrequency::Transition const& transition) +{ + if (transition.before.rx != transition.after.rx) + { + cancelPendingFt8Decode ("dial frequency changed"); + genCQMsg (); + } + if (m_lastDialFreq != transition.after.rx && transition.after.rx + && (m_mode != "MSK144" + || !(ui->cbCQTx->isEnabled () && ui->cbCQTx->isVisible () && ui->cbCQTx->isChecked ()))) + { + if (m_ActiveStationsWidget) + { + m_recentCall.clear (); + if (m_mode != "Q65") m_ActiveStationsWidget->erase (); + } + m_lastDialFreq = transition.after.rx; + m_secBandChanged = QDateTime::currentMSecsSinceEpoch () / 1000; + statusChanged (); + m_wideGraph->setDialFreq (transition.after.rx / 1.e6); + } + if (m_astroWidget) + m_astroWidget->nominal_frequency (transition.after.rx, transition.after.tx); + displayDialFrequency (); +} + void MainWindow::handle_transceiver_update (Transceiver::TransceiverState const& s) { + if (!m_startup_rig_reported) + { + m_startup_rig_reported = true; + PerformanceTrace::milestone ( + m_startup_trace_run, "rig.first_update", + QString {"online=%1"}.arg (s.online () ? "true" : "false")); + } Transceiver::TransceiverState old_state {m_rigState}; //transmitDisplay (s.ptt ()); if (s.ptt () // && !m_rigState.ptt () ) { // safe to start audio // (caveat - DX Lab Suite Commander) - if (m_tx_when_ready && g_iptt) { // waiting to Tx and still needed - int ms_delay=1000*m_config.txDelay(); - if(m_mode=="FT4") ms_delay=20; - ptt1Timer.start(ms_delay); //Start-of-transmission sequencer delay - m_tx_when_ready = false; - } + startTxAudioAfterPttDelay (); } // Display PWR and SWR @@ -12464,7 +12477,7 @@ void MainWindow::handle_transceiver_update (Transceiver::TransceiverState const& ui->outAttenuation->setMinimumWidth (2.8*pointSize + 16); } } else { - ui->label->setText("Pwr"); + ui->label->setText(tr ("Pwr")); } if (m_rigState.swr() != s.swr()) { static bool s_alreadyShowingSWRAlert = false; @@ -12496,69 +12509,78 @@ void MainWindow::handle_transceiver_update (Transceiver::TransceiverState const& } m_rigState = s; - auto old_freqNominal = m_freqNominal; - if (!old_freqNominal) + auto const transition = m_operatingFrequency.reconcile ( + {old_state.online (), old_state.ptt (), m_splitMode, old_state.frequency (), old_state.tx_frequency ()}, + {s.online (), s.ptt (), s.split (), s.frequency (), s.tx_frequency ()}, + operatingFrequencyContext (), [this] (Frequency corrected) { + return dispatchNominalFrequency (corrected, FrequencyRequestOrigin::User, true); + }); + m_splitMode = s.split (); + applyOperatingFrequencyTransition (transition); + if (transition.monitor) { - // always take initial rig frequency to avoid start up problems - // with bogus Tx frequencies - m_freqNominal = s.frequency (); + applyMonitorEffects (*transition.monitor, transition.restorationAccepted); } - if (old_state.online () == false && s.online () == true) + else if (!old_state.online () && s.online ()) { - // initializing - on_monitorButton_clicked (!(m_config.monitor_off_at_startup() or m_mode=="Echo")); + ui->monitorButton->setChecked (false); } - if (s.frequency () != old_state.frequency () || s.split () != m_splitMode) + if (s.online () && s.frequency () && !s.ptt () + && s.frequency () != old_state.frequency () && !transition.restorationAccepted) { - m_splitMode = s.split (); - if (!s.ptt ()) - { - m_freqNominal = s.frequency () - m_astroCorrection.rx; - if (old_freqNominal != m_freqNominal) - { - m_freqTxNominal = m_freqNominal; - genCQMsg (); - } - - if (m_monitoring) - { - m_lastMonitoredFrequency = m_freqNominal; - } - if (m_lastDialFreq != m_freqNominal && - (m_mode != "MSK144" - || !(ui->cbCQTx->isEnabled () && ui->cbCQTx->isVisible () && ui->cbCQTx->isChecked()))) { - - if (m_lastDialFreq != m_freqNominal and m_ActiveStationsWidget != NULL) { - m_recentCall.clear(); - if(m_mode!="Q65") m_ActiveStationsWidget->erase(); - } - - m_lastDialFreq = m_freqNominal; - m_secBandChanged=QDateTime::currentMSecsSinceEpoch()/1000; -// pskSetLocal (); // better be done after a band change - statusChanged(); - m_wideGraph->setDialFreq(m_freqNominal / 1.e6); - } - } else { - m_freqTxNominal = s.split () ? s.tx_frequency () - m_astroCorrection.tx : s.frequency (); - } - if (m_astroWidget) m_astroWidget->nominal_frequency (m_freqNominal, m_freqTxNominal); - } + setXIT (ui->TxFreqSpinBox->value ()); + } // ensure frequency display is correct - if (m_astroWidget && old_state.ptt () != s.ptt ()) setRig (); + if (m_astroWidget && old_state.ptt () != s.ptt ()) + { + reapplyCurrentRigFrequencyCorrection (); + } - displayDialFrequency (); update_dynamic_property (ui->readFreq, "state", "ok"); ui->readFreq->setEnabled (false); ui->readFreq->setText (s.split () ? "S" : ""); } +void MainWindow::handle_transceiver_closing (bool failed) +{ + if (m_tci_audio) + { + m_receiveConsumer.invalidate (); + m_receiveQueue.clear (); + } + if (m_closing || m_mode != "JTTY" || !m_jttyTxActive + || !m_jttyTxUsesTciAudio) + { + return; + } + + noteTxStopReason (failed ? TxEvidence::TxStopReason::Error + : TxEvidence::TxStopReason::UserHalt); + stopTx (); +} + void MainWindow::handle_transceiver_failure (QString const& reason) { + noteTxStopReason (TxEvidence::TxStopReason::Error); + m_beaconTxController.setAutoEnabled (false); + if (m_beaconTxController.txLifecycle () == BeaconTx::TxLifecycle::Decided + || m_beaconTxController.txLifecycle () == BeaconTx::TxLifecycle::StartRequested) + { + m_tx_when_ready = false; + ptt1Timer.stop (); + processBeaconActions (m_beaconTxController.transmitWindowEnded ()); + } + if (m_beaconTxController.tuneKind () != BeaconTx::TuneKind::None) + { + processBeaconActions (m_beaconTxController.tuneCompleted ( + m_beaconTxController.tunePlanId ())); + } update_dynamic_property (ui->readFreq, "state", "error"); ui->readFreq->setEnabled (true); - on_stopTxButton_clicked (); - qDebug() << "MainWindow::handle_transceiver_failure fired"; + // tune carrier isn't gated by m_btxok, so stop it explicitly; messages self-stop via guiUpdate + if (m_tune) Q_EMIT tune (false); + m_auto = false; + reset_transmit_controls_after_stop (); rigFailure (reason); rigFailed = true; } @@ -12613,28 +12635,77 @@ void MainWindow::rigFailure (QString const& reason) } } +void MainWindow::dispatchTxRequest (TxEvidence::TxRequest const& request) +{ + bool const useTciAudio = request.mode == QStringLiteral ("JTTY") + ? m_jttyTxUsesTciAudio : m_tci_audio; + if (useTciAudio) + { + if (!request.tuning && rigTuneTimer.isActive ()) + { + rigTuneTimer.stop (); + m_config.transceiver_tune (false); + ui->tuneButton->setChecked (false); + ui->tuneButton->setText ("Tune"); + } + Q_EMIT m_config.transceiver_modulator_start (request); + } + else if (request.mode == QStringLiteral ("JTTY") && !request.tuning) + { + Q_EMIT startJttyStream (request, m_soundOutput); + } + else + { + auto localRequest = request; + // The local modulator historically receives an integer period; TCI retains the full value. + localRequest.tr_period_s = static_cast (localRequest.tr_period_s); + Q_EMIT sendMessage (localRequest, m_soundOutput); + } +} + void MainWindow::transmit (double snr) { + qint64 const jttyCommittedSamples = jttyTxCommittedSamples (); + beginTxEvidenceGeneration (m_mode == "JTTY" && jttyCommittedSamples > 0 + ? jttyCommittedSamples - 1 : -1, + false); + auto const txSessionId = m_txEvidenceSourceSession; + auto const txGeneration = m_txEvidenceGeneration; + TxEvidence::TxRequest request; + request.mode = m_mode; + request.channel = m_config.audio_output_channel (); + request.snr_db = snr; + request.tr_period_s = m_TRperiod; + request.session_id = txSessionId; + request.generation = txGeneration; + request.queue_epoch = m_jttyTxQueueEpoch; + request.tuning = m_tune; + int const cwSymbols = qBound (0, int (icw[0]), NUM_CW_SYMBOLS - 1); + request.cw_id.reserve (cwSymbols); + for (int i = 1; i <= cwSymbols; ++i) request.cw_id.append (int (icw[i])); +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) + request.start_window_open_ms = m_liveAudioTestFt8StartWindowOpenMs; + request.start_window_close_ms = m_liveAudioTestFt8StartWindowCloseMs; + if (request.start_window_open_ms >= 0) + { + m_liveAudioTestFt8StartSessionId = txSessionId.value (); + m_liveAudioTestFt8StartGeneration = txGeneration.value (); + } +#endif double toneSpacing=0.0; if (m_mode == "JT65") { if(m_nSubMode==0) toneSpacing=11025.0/4096.0; if(m_nSubMode==1) toneSpacing=2*11025.0/4096.0; if(m_nSubMode==2) toneSpacing=4*11025.0/4096.0; - if (m_tci_audio) { - Q_EMIT m_config.transceiver_modulator_start(m_mode, NUM_JT65_SYMBOLS, - 4096.0*12000.0/11025.0, ui->TxFreqSpinBox->value () - m_XIT, - toneSpacing,true,false,snr,m_TRperiod); - } else { - Q_EMIT sendMessage (m_mode, NUM_JT65_SYMBOLS, - 4096.0*12000.0/11025.0, ui->TxFreqSpinBox->value () - m_XIT, - toneSpacing, m_soundOutput, m_config.audio_output_channel (), - true, false, snr, m_TRperiod); - } + request.symbols_length = NUM_JT65_SYMBOLS; + request.frames_per_symbol = 4096.0*12000.0/11025.0; + request.frequency_hz = ui->TxFreqSpinBox->value () - m_XIT; + request.tone_spacing = toneSpacing; + dispatchTxRequest (request); } if((m_mode=="FT4" or m_mode=="FT8") and m_maxPoints>0 and SpecOp::ARRL_DIGI==m_specOp) { - ui->dxCallEntry->setText(m_deCall); - ui->dxGridEntry->setText(m_deGrid); + setDXInfo(m_deCall, m_deGrid); genStdMsgs("-10"); } @@ -12645,43 +12716,38 @@ void MainWindow::transmit (double snr) if(m_config.x4ToneSpacing()) toneSpacing=4*12000.0/1920.0; if(SpecOp::FOX==m_specOp and !m_tune) toneSpacing=-1; if(SpecOp::FOX==m_specOp and m_config.superFox()) { - if (m_tci_audio) { - Q_EMIT m_config.transceiver_modulator_start(m_mode, NUM_SUPERFOX_SYMBOLS, - 1024.0,ui->TxFreqSpinBox->value()-m_XIT, - toneSpacing,true,false,snr,m_TRperiod); - } else { - Q_EMIT sendMessage (m_mode, NUM_SUPERFOX_SYMBOLS, - 1024.0, ui->TxFreqSpinBox->value () - m_XIT, - toneSpacing, m_soundOutput, m_config.audio_output_channel (), - true, false, snr, m_TRperiod); - } + request.symbols_length = NUM_SUPERFOX_SYMBOLS; + request.frames_per_symbol = 1024.0; } else { - if (m_tci_audio) { - Q_EMIT m_config.transceiver_modulator_start(m_mode, NUM_FT8_SYMBOLS, - 1920.0,ui->TxFreqSpinBox->value()-m_XIT, - toneSpacing,true,false,snr,m_TRperiod); - } else { - Q_EMIT sendMessage (m_mode, NUM_FT8_SYMBOLS, - 1920.0, ui->TxFreqSpinBox->value () - m_XIT, - toneSpacing, m_soundOutput, m_config.audio_output_channel (), - true, false, snr, m_TRperiod); - } + request.symbols_length = NUM_FT8_SYMBOLS; + request.frames_per_symbol = 1920.0; } + request.frequency_hz = ui->TxFreqSpinBox->value () - m_XIT; + request.tone_spacing = toneSpacing; + dispatchTxRequest (request); } if (m_mode == "FT4") { m_dateTimeSentTx3=QDateTime::currentDateTimeUtc(); toneSpacing=-2.0; //Transmit a pre-computed, filtered waveform. - if (m_tci_audio) { - Q_EMIT m_config.transceiver_modulator_start(m_mode, NUM_FT4_SYMBOLS, - 576.0,ui->TxFreqSpinBox->value()-m_XIT, - toneSpacing,true,false,snr,m_TRperiod); - } else { - Q_EMIT sendMessage (m_mode, NUM_FT4_SYMBOLS, - 576.0, ui->TxFreqSpinBox->value() - m_XIT, - toneSpacing, m_soundOutput, m_config.audio_output_channel(), - true, false, snr, m_TRperiod); - } + request.symbols_length = NUM_FT4_SYMBOLS; + request.frames_per_symbol = 576.0; + request.frequency_hz = ui->TxFreqSpinBox->value() - m_XIT; + request.tone_spacing = toneSpacing; + dispatchTxRequest (request); + } + + if (m_mode == "JTTY") { + m_dateTimeSentTx3=QDateTime::currentDateTimeUtc(); + toneSpacing=-2.0; //Transmit a pre-computed, filtered waveform. + double txt=m_nsym_jtty*384.0/12000.0; + request.symbols_length = m_nsym_jtty; + request.frames_per_symbol = 384.0; + request.frequency_hz = 1500.0; + request.tone_spacing = toneSpacing; + request.synchronize = false; + request.tr_period_s = txt; + dispatchTxRequest (request); } if (m_mode == "FST4" or m_mode == "FST4W") { @@ -12701,14 +12767,11 @@ void MainWindow::transmit (double snr) double f0=ui->WSPRfreqSpinBox->value() - m_XIT; if(m_mode=="FST4") f0=ui->TxFreqSpinBox->value() - m_XIT; if(!m_tune) f0 += 1.5*dfreq; - if (m_tci_audio) { - Q_EMIT m_config.transceiver_modulator_start(m_mode, NUM_FST4_SYMBOLS,double(nsps),f0,toneSpacing, - true,false,snr,m_TRperiod); - } else { - Q_EMIT sendMessage (m_mode, NUM_FST4_SYMBOLS,double(nsps),f0,toneSpacing, - m_soundOutput,m_config.audio_output_channel(), - true, false, snr, m_TRperiod); - } + request.symbols_length = NUM_FST4_SYMBOLS; + request.frames_per_symbol = double(nsps); + request.frequency_hz = f0; + request.tone_spacing = toneSpacing; + dispatchTxRequest (request); } if (m_mode == "Q65") { @@ -12720,16 +12783,11 @@ void MainWindow::transmit (double snr) int mode65=pow(2.0,double(m_nSubMode)); toneSpacing=mode65*12000.0/nsps; // toneSpacing=-4.0; - if (m_tci_audio) { - Q_EMIT m_config.transceiver_modulator_start(m_mode, NUM_Q65_SYMBOLS, - double(nsps),ui->TxFreqSpinBox->value()-m_XIT, - toneSpacing,true,false,snr,m_TRperiod); - } else { - Q_EMIT sendMessage (m_mode, NUM_Q65_SYMBOLS, - double(nsps), ui->TxFreqSpinBox->value () - m_XIT, - toneSpacing, m_soundOutput, m_config.audio_output_channel (), - true, false, snr, m_TRperiod); - } + request.symbols_length = NUM_Q65_SYMBOLS; + request.frames_per_symbol = double(nsps); + request.frequency_hz = ui->TxFreqSpinBox->value () - m_XIT; + request.tone_spacing = toneSpacing; + dispatchTxRequest (request); } if (m_mode == "JT9") { @@ -12745,16 +12803,12 @@ void MainWindow::transmit (double snr) sps=nsps[m_nSubMode-4]; m_toneSpacing=12000.0/sps; } - if (m_tci_audio) { - Q_EMIT m_config.transceiver_modulator_start(m_mode, NUM_JT9_SYMBOLS,sps, - ui->TxFreqSpinBox->value()-m_XIT, - m_toneSpacing,true,fastmode,snr,m_TRperiod); - } else { - Q_EMIT sendMessage (m_mode, NUM_JT9_SYMBOLS, sps, - ui->TxFreqSpinBox->value() - m_XIT, m_toneSpacing, - m_soundOutput, m_config.audio_output_channel (), - true, fastmode, snr, m_TRperiod); - } + request.symbols_length = NUM_JT9_SYMBOLS; + request.frames_per_symbol = sps; + request.frequency_hz = ui->TxFreqSpinBox->value() - m_XIT; + request.tone_spacing = m_toneSpacing; + request.fast_mode = fastmode; + dispatchTxRequest (request); } if (m_mode == "MSK144") { @@ -12771,14 +12825,12 @@ void MainWindow::transmit (double snr) int nsym; nsym=NUM_MSK144_SYMBOLS; if(itone[40] < 0) nsym=40; - if (m_tci_audio) { - Q_EMIT m_config.transceiver_modulator_start(m_mode, nsym,double(m_nsps),f0, m_toneSpacing, - true,true,snr,m_TRperiod); - } else { - Q_EMIT sendMessage (m_mode, nsym, double(m_nsps), f0, m_toneSpacing, - m_soundOutput, m_config.audio_output_channel (), - true, true, snr, m_TRperiod); - } + request.symbols_length = nsym; + request.frames_per_symbol = double(m_nsps); + request.frequency_hz = f0; + request.tone_spacing = m_toneSpacing; + request.fast_mode = true; + dispatchTxRequest (request); } if (m_mode == "JT4") { @@ -12789,34 +12841,22 @@ void MainWindow::transmit (double snr) if(m_nSubMode==4) toneSpacing=18*4.375; if(m_nSubMode==5) toneSpacing=36*4.375; if(m_nSubMode==6) toneSpacing=72*4.375; - if (m_tci_audio) { - Q_EMIT m_config.transceiver_modulator_start(m_mode, NUM_JT4_SYMBOLS, - 2520.0*12000.0/11025.0,ui->TxFreqSpinBox->value()-m_XIT, - toneSpacing,true,false,snr,m_TRperiod); - } else { - Q_EMIT sendMessage (m_mode, NUM_JT4_SYMBOLS, - 2520.0*12000.0/11025.0, ui->TxFreqSpinBox->value () - m_XIT, - toneSpacing, m_soundOutput, m_config.audio_output_channel (), - true, false, snr, m_TRperiod); - } + request.symbols_length = NUM_JT4_SYMBOLS; + request.frames_per_symbol = 2520.0*12000.0/11025.0; + request.frequency_hz = ui->TxFreqSpinBox->value () - m_XIT; + request.tone_spacing = toneSpacing; + dispatchTxRequest (request); } if (m_mode=="WSPR") { int nToneSpacing=1; if(m_config.x2ToneSpacing()) nToneSpacing=2; if(m_config.x4ToneSpacing()) nToneSpacing=4; - if (m_tci_audio) { - Q_EMIT m_config.transceiver_modulator_start(m_mode, NUM_WSPR_SYMBOLS,8192.0, - ui->TxFreqSpinBox->value() - 1.5 * 12000 / 8192, - m_toneSpacing*nToneSpacing,true,false,snr, - m_TRperiod); - } else { - Q_EMIT sendMessage (m_mode, NUM_WSPR_SYMBOLS, 8192.0, - ui->TxFreqSpinBox->value() - 1.5 * 12000 / 8192, - m_toneSpacing*nToneSpacing, m_soundOutput, - m_config.audio_output_channel(),true, false, snr, - m_TRperiod); - } + request.symbols_length = NUM_WSPR_SYMBOLS; + request.frames_per_symbol = 8192.0; + request.frequency_hz = ui->TxFreqSpinBox->value() - 1.5 * 12000 / 8192; + request.tone_spacing = m_toneSpacing*nToneSpacing; + dispatchTxRequest (request); } if(m_mode=="Echo") { @@ -12837,9 +12877,8 @@ void MainWindow::transmit (double snr) if(ui->rbEchoCW->isChecked()) { freq=1500.0; int ifreq=freq; - int n=ui->leEchoMessage->text().length(); - gen_cw_wave_(const_cast (ui->leEchoMessage->text().toLatin1().constData()), &ifreq, - foxcom_.wave, (FCL)n); + auto const message = ui->leEchoMessage->text().toLatin1(); + gen_cw_wave_(message.constData(), &ifreq, foxcom_.wave, (FCL)message.size()); } else { toneSpacing=ui->sbToneSpacing->value(); int nsps4=4*framesPerSymbol; //48000 Hz sampling @@ -12855,13 +12894,12 @@ void MainWindow::transmit (double snr) } m_msEchoTxStart=QDateTime::currentMSecsSinceEpoch(); - if (m_tci_audio) { - Q_EMIT m_config.transceiver_modulator_start(m_mode,numEchoSymbols,framesPerSymbol,freq,toneSpacing, - false,false,snr,m_TRperiod); - } else { - Q_EMIT sendMessage (m_mode,numEchoSymbols,framesPerSymbol,freq,toneSpacing,m_soundOutput, - m_config.audio_output_channel(), false, false, snr, m_TRperiod); - } + request.symbols_length = numEchoSymbols; + request.frames_per_symbol = framesPerSymbol; + request.frequency_hz = freq; + request.tone_spacing = toneSpacing; + request.synchronize = false; + dispatchTxRequest (request); } // In auto-sequencing mode, stop after 5 transmissions of "73" message. @@ -12879,13 +12917,13 @@ void MainWindow::transmit (double snr) void MainWindow::on_outAttenuation_valueChanged (int a) { QString tt_str; - qreal dBAttn {a / 10.}; // slider interpreted as dB / 100 + qreal dBAttn {a / 10.}; if (m_tune && m_config.pwrBandTuneMemory()) { - tt_str = tr ("Tune digital gain "); + tt_str = tr ("Tune drive "); } else { - tt_str = tr ("Transmit digital gain "); + tt_str = tr ("Transmit drive "); } - tt_str += (a ? QString::number (-dBAttn, 'f', 1) : "0") + "dB"; + tt_str += (a ? QString::number (-dBAttn, 'f', 1) : "0.0") + " dB"; if (ui->outAttenuation->hasFocus() && !m_block_pwr_tooltip) { QToolTip::showText (QCursor::pos (), tt_str, ui->outAttenuation); } @@ -12898,43 +12936,24 @@ void MainWindow::on_outAttenuation_valueChanged (int a) } // Updating attenuation for tuning is done in stop_tuning if (m_tci_audio) { - Q_EMIT m_config.transceiver_txvolume(dBAttn); + sync_tci_tx_volume (); } else { Q_EMIT outAttenuationChanged (dBAttn); } } +void MainWindow::sync_tci_tx_volume (bool force) +{ + if (m_tci_audio) { + Q_EMIT m_config.transceiver_txvolume (ui->outAttenuation->value () / 10., force); + } +} + void MainWindow::on_actionShort_list_of_add_on_prefixes_and_suffixes_triggered() { if (!m_prefixes) { m_prefixes.reset (new HelpTextWindow {tr ("Prefixes") - , R"(Type 1 Prefixes: - - 1A 1S 3A 3B6 3B8 3B9 3C 3C0 3D2 3D2C 3D2R 3DA 3V 3W 3X - 3Y 3YB 3YP 4J 4L 4S 4U1I 4U1U 4W 4X 5A 5B 5H 5N 5R - 5T 5U 5V 5W 5X 5Z 6W 6Y 7O 7P 7Q 7X 8P 8Q 8R - 9A 9G 9H 9J 9K 9L 9M2 9M6 9N 9Q 9U 9V 9X 9Y A2 - A3 A4 A5 A6 A7 A9 AP BS7 BV BV9 BY C2 C3 C5 C6 - C9 CE CE0X CE0Y CE0Z CE9 CM CN CP CT CT3 CU CX CY0 CY9 - D2 D4 D6 DL DU E3 E4 EA EA6 EA8 EA9 EI EK EL EP - ER ES ET EU EX EY EZ F FG FH FJ FK FKC FM FO - FOA FOC FOM FP FR FRG FRJ FRT FT5W FT5X FT5Z FW FY M MD - MI MJ MM MU MW H4 H40 HA HB HB0 HC HC8 HH HI HK - HK0A HK0M HL HM HP HR HS HV HZ I IS IS0 J2 J3 J5 - J6 J7 J8 JA JDM JDO JT JW JX JY K KG4 KH0 KH1 KH2 - KH3 KH4 KH5 KH5K KH6 KH7 KH8 KH9 KL KP1 KP2 KP4 KP5 LA LU - LX LY LZ OA OD OE OH OH0 OJ0 OK OM ON OX OY OZ - P2 P4 PA PJ2 PJ7 PY PY0F PT0S PY0T PZ R1F R1M S0 S2 S5 - S7 S9 SM SP ST SU SV SVA SV5 SV9 T2 T30 T31 T32 T33 - T5 T7 T8 T9 TA TF TG TI TI9 TJ TK TL TN TR TT - TU TY TZ UA UA2 UA9 UK UN UR V2 V3 V4 V5 V6 V7 - V8 VE VK VK0H VK0M VK9C VK9L VK9M VK9N VK9W VK9X VP2E VP2M VP2V VP5 - VP6 VP6D VP8 VP8G VP8H VP8O VP8S VP9 VQ9 VR VU VU4 VU7 XE XF4 - XT XU XW XX9 XZ YA YB YI YJ YK YL YN YO YS YU - YV YV0 Z2 Z3 ZA ZB ZC4 ZD7 ZD8 ZD9 ZF ZK1N ZK1S ZK2 ZK3 - ZL ZL7 ZL8 ZL9 ZP ZS ZS8 KC4 E5 - -Type 1 Suffixes: /0 /1 /2 /3 /4 /5 /6 /7 /8 /9 /A /P)", {"Courier", 10}}); + , Radio::HelpText::prefixes(), {"Courier", 10}}); } m_prefixes->showNormal(); m_prefixes->raise (); @@ -12985,11 +13004,11 @@ void MainWindow::transmitDisplay (bool transmitting) ui->signal_meter_widget->setValue(0,0); if (m_monitoring && !ui->actionFull_Duplex_Mode->isChecked()) monitor (false); m_txing=true; - QTimer::singleShot ((int(1000.0*m_TRperiod)), [=] {m_txing=false;}); + QTimer::singleShot ((int(1000.0*m_TRperiod)), this, [=] {m_txing=false;}); m_btxok=true; } - auto QSY_allowed = !transmitting or m_config.tx_QSY_allowed () or + auto QSY_allowed = !transmitting or m_config.tx_frequency_corrections_allowed () or !m_config.split_mode (); if (ui->cbHoldTxFreq->isChecked ()) { ui->TxFreqSpinBox->setEnabled (QSY_allowed); @@ -13007,7 +13026,7 @@ void MainWindow::transmitDisplay (bool transmitting) } // the following are always disallowed in transmit - ui->menuMode->setEnabled (!transmitting); + ui->menuMode->setEnabled (!transmitting && !m_modeLocked); } } @@ -13020,7 +13039,7 @@ void MainWindow::on_sbFtol_valueChanged(int value) m_wideGraph->setTol (value); statusUpdate (); // save last used parameters - QTimer::singleShot (200, [=] { + QTimer::singleShot (200, this, [=] { if (m_mode=="FT8") m_settings->setValue ("Ftol_SF", ui->sbFtol->value()); if (m_mode=="Q65") m_settings->setValue ("Ftol_Q65", ui->sbFtol->value()); if (m_mode=="MSK144") m_settings->setValue ("Ftol_MSK144", ui->sbFtol->value()); @@ -13089,7 +13108,7 @@ void MainWindow::on_sbTR_valueChanged(int value) Q_EMIT m_config.transceiver_period(m_TRperiod); if (!m_tci_audio) { m_modulator->setTRPeriod(m_TRperiod); // TODO - not thread safe - m_detector->setTRPeriod(m_TRperiod); // TODO - not thread safe + m_detector->setTRPeriod(m_TRperiod); // marshals to the audio thread } m_wideGraph->setPeriod (value, m_nsps); progressBar.setMaximum (value); @@ -13099,7 +13118,7 @@ void MainWindow::on_sbTR_valueChanged(int value) on_sbSubmode_valueChanged(ui->sbSubmode->value()); statusUpdate (); check_button_color(); - if (!programStart) QTimer::singleShot (1000, [=] { + if (!programStart) QTimer::singleShot (1000, this, [=] { if (m_mode=="Q65") m_settings->setValue ("TRPeriod_Q65", ui->sbTR->value ()); if (m_mode=="MSK144") { if (m_currentBand=="2m") { @@ -13121,6 +13140,18 @@ void MainWindow::on_sbTR_valueChanged(int value) void MainWindow::on_sbTR_FST4W_valueChanged(int value) { on_sbTR_valueChanged(value); + if (m_mode == "FST4W") + { + if (m_beaconTxController.active ()) + { + processBeaconActions (m_beaconTxController.setPeriod ( + qRound64 (1000.0 * m_TRperiod))); + } + else + { + enterBeaconMode (); + } + } } QChar MainWindow::current_submode () const @@ -13159,12 +13190,12 @@ void MainWindow::on_sbSubmode_valueChanged(int n) ui->cbFast9->setChecked(false); on_cbFast9_clicked(false); ui->cbFast9->setEnabled(false); - ui->sbTR->setVisible(false); + setTrPeriodVisible(false); m_TRperiod=60.0; } else { if(!blocked) ui->cbFast9->setEnabled(true); } - ui->sbTR->setVisible(m_bFast9); + setTrPeriodVisible(m_bFast9); if(m_bFast9) ui->TxFreqSpinBox->setValue(700); } if(m_transmitting and m_bFast9 and m_nSubMode>=4) transmit (99.0); @@ -13172,7 +13203,7 @@ void MainWindow::on_sbSubmode_valueChanged(int n) statusUpdate (); check_button_color(); // save last used parameters - QTimer::singleShot (200, [=] { + QTimer::singleShot (200, this, [=] { if (m_mode=="Q65") m_settings->setValue("SubMode_Q65",ui->sbSubmode->value()); if (m_mode=="JT65") m_settings->setValue("SubMode_JT65",ui->sbSubmode->value()); if (m_mode=="JT4") m_settings->setValue("SubMode_JT4",ui->sbSubmode->value()); @@ -13180,29 +13211,6 @@ void MainWindow::on_sbSubmode_valueChanged(int n) }); } -void MainWindow::on_cbFast9_clicked(bool b) -{ - if(m_mode=="JT9") { - m_bFast9=b; -// ui->cbAutoSeq->setVisible(b); - blocked=true; // needed to prevent a loop - on_actionJT9_triggered(); - QTimer::singleShot (50, [=] {blocked = false;}); // needed to prevent a loop - QTimer::singleShot (200, [=] { - if(m_mode=="JT9") m_settings->setValue("JT9_Fast",m_bFast9); - }); - } - - if(b) { - m_TRperiod = ui->sbTR->value (); - } else { - m_TRperiod=60.0; - } - progressBar.setMaximum(int(m_TRperiod)); - m_wideGraph->setPeriod(m_TRperiod,m_nsps); - fast_config(b); - statusChanged (); -} void MainWindow::on_cbSendMsg_toggled(bool b) { @@ -13234,7 +13242,7 @@ void MainWindow::on_cbShMsgs_toggled(bool b) if(ntx==4) ui->txrb4->setChecked(true); if(ntx==5) ui->txrb5->setChecked(true); if(ntx==6) ui->txrb6->setChecked(true); - QTimer::singleShot (200, [=] { + QTimer::singleShot (200, this, [=] { if(m_mode=="MSK144") m_settings->setValue("ShMsgs_MSK144",m_bShMsgs); if(m_mode=="Q65") m_settings->setValue("ShMsgs_Q65",m_bShMsgs); if(m_mode=="JT65") m_settings->setValue("ShMsgs_JT65",m_bShMsgs); @@ -13280,67 +13288,37 @@ void MainWindow::replyToCQ (QTime time, qint32 snr, float delta_time, quint32 de , QString const& mode, QString const& message_text , bool /*low_confidence*/, quint8 modifiers) { - QString format_string {"%1 %2 %3 %4 %5 %6"}; auto const& time_string = time.toString ("~" == mode || "&" == mode || "+" == mode || (m_TRperiod < 60. && ("`" == mode || ":" == mode)) ? "hhmmss" : "hhmm"); - auto text = message_text; - auto ap_pos = text.lastIndexOf (QRegularExpression {R"((?:\?\s)?(?:a[0-9]|q[0-9][0-9]?)$)"}); - if (ap_pos >= 0) - { - // beware of decodes ending on shorter version of wanted call so - // add a space - text = text.left (ap_pos).trimmed () + ' '; - } - auto message_line = format_string + auto message_line = QString {"%1 %2 %3 %4 %5 %6"} .arg (time_string) .arg (snr, 3) .arg (delta_time, 4, 'f', 1) .arg (delta_frequency, 4) .arg (mode, -2) - .arg (text); - QTextCursor start {ui->decodedTextBrowser->document ()}; - start.movePosition (QTextCursor::End); - auto cursor = ui->decodedTextBrowser->document ()->find (message_line, start, QTextDocument::FindBackward); - if (cursor.isNull ()) - { - // try again with with -0.0 delta time - cursor = ui->decodedTextBrowser->document ()->find (format_string - .arg (time_string) - .arg (snr, 3) - .arg ('-' + QString::number (delta_time, 'f', 1), 4) - .arg (delta_frequency, 4) - .arg (mode, -2) - .arg (text), start, QTextDocument::FindBackward); - } - if (!cursor.isNull ()) + .arg (message_text); + if (m_config.udpWindowToFront ()) { - if (m_config.udpWindowToFront ()) - { - show (); - raise (); - activateWindow (); - } - if (m_config.udpWindowRestore () && isMinimized ()) - { - showNormal (); - raise (); - } - if ((text.contains (QRegularExpression {R"(^(CQ |CQDX |QRZ ))"})) - || text.contains("73 ") || (ui->cbHoldTxFreq->isChecked ())) { - // a message we are willing to accept and auto reply to - m_bDoubleClicked = true; - } - DecodedText message {message_line}; - Qt::KeyboardModifiers kbmod {modifiers << 24}; - processMessage (message, kbmod); - tx_watchdog (false); - QApplication::alert (this); + show (); + raise (); + activateWindow (); } - else + if (m_config.udpWindowRestore () && isMinimized ()) { - qDebug () << "process reply message ignored, decode not found:" << message_line; + showNormal (); + raise (); } + if ((message_text.contains (reply_cq_or_qrz_regexp)) + || message_text.contains("73 ") || (ui->cbHoldTxFreq->isChecked ())) { + // a message we are willing to accept and auto reply to + m_bDoubleClicked = true; + } + DecodedText message {message_line}; + Qt::KeyboardModifiers kbmod {modifiers << 24}; + processMessage (message, kbmod, DecodedMessageReaction::SelectionOrigin::Udp); + tx_watchdog (false); + QApplication::alert (this); } void MainWindow::locationChange (QString const& location) @@ -13359,7 +13337,7 @@ void MainWindow::locationChange (QString const& location) } } if (MaidenheadLocatorValidator::Acceptable == MaidenheadLocatorValidator ().validate (grid, len)) { - qDebug() << "locationChange: Grid supplied is " << grid; +// qDebug() << "locationChange: Grid supplied is " << grid; if (m_config.my_grid () != grid) { m_config.set_location (grid); genStdMsgs (m_rpt, false); @@ -13376,6 +13354,11 @@ void MainWindow::replayDecodes () // we accept this request even if the setting to accept UDP requests // is not checked + if (!m_messageClient->begin_replay ()) + { + return; + } + // attempt to parse the decoded text for (QTextBlock block = ui->decodedTextBrowser->document ()->firstBlock (); block.isValid (); block = block.next ()) { @@ -13394,6 +13377,7 @@ void MainWindow::replayDecodes () } } statusChanged (); + m_messageClient->end_replay (); } void MainWindow::postDecode (bool is_new, QString const& message) @@ -13486,8 +13470,7 @@ void MainWindow::p1ReadFromStdout() //p1readFromStdout } m_RxLog=0; m_startAnother=m_loopall; - m_decoderBusy = false; - statusUpdate (); + endDecode (DecodeOwner::Wsprd); } else { int n=t.length(); t=t.mid(0,n-2) + " "; @@ -13623,18 +13606,13 @@ void MainWindow::uploadWSPRSpots (bool direct_post, QString const& decode_text) { // do not spot if disabled, replays, or if rig control not working if(!m_uploadWSPRSpots || m_diskData || !m_config.is_transceiver_online ()) return; - if(m_uploading && !decode_text.size ()) { - qDebug() << "Previous upload has not completed, spots were lost"; - wsprNet->abortOutstandingRequests (); - m_uploading = false; - } QString rfreq = QString("%1").arg((m_dialFreqRxWSPR + 1500) / 1e6, 0, 'f', 6); QString tfreq = QString("%1").arg((m_dialFreqRxWSPR + ui->TxFreqSpinBox->value()) / 1e6, 0, 'f', 6); auto pct = QString::number (ui->autoButton->isChecked () ? ui->sbTxPercent->value () : 0); if (direct_post) { - // queues one FST4W spot + // Queue an FST4W spot, or flush queued FST4W spots after the decode cycle. wsprNet->post (m_config.my_callsign (), m_config.my_grid (), rfreq, tfreq, m_mode, m_TRperiod, pct, QString::number (m_dBm), version (), decode_text); @@ -13647,21 +13625,11 @@ void MainWindow::uploadWSPRSpots (bool direct_post, QString const& decode_text) QString::number (m_dBm), version (), m_config.writeable_data_dir ().absoluteFilePath ("wspr_spots.txt")); } - // trigger upload of any queued spots - if (!decode_text.size ()) - { - m_uploading = true; - } } void MainWindow::uploadResponse(QString const& response) { - if (response == "done") { - m_uploading=false; - } else { - if (response.startsWith ("Upload Failed")) { - m_uploading=false; - } + if (response != "done") { qDebug () << "WSPRnet.org status:" << response; } } @@ -13694,89 +13662,125 @@ void MainWindow::on_sbFST4W_FTol_valueChanged(int n) statusUpdate (); } -void MainWindow::on_pbTxNext_clicked(bool b) + +BeaconTx::RoundRobinPolicy MainWindow::beaconRoundRobinPolicy () const { - if (b && !ui->autoButton->isChecked ()) - { - ui->autoButton->click (); // make sure Tx is possible - } + if (m_mode != "FST4W") return BeaconTx::RoundRobinPolicy::random (); + return configuredRoundRobinPolicy (); } -void MainWindow::WSPR_scheduling () +BeaconTx::RoundRobinPolicy MainWindow::configuredRoundRobinPolicy () const { - if (ui->pbTxNext->isEnabled () && ui->pbTxNext->isChecked ()) - { - // Tx Next button overrides all scheduling - m_WSPR_tx_next = true; - return; - } - QString t=ui->RoundRobin->currentText(); - if(m_mode=="FST4W" and t != tr ("Random")) { - bool ok; - int i=t.left (1).toInt (&ok) - 1; - if (!ok) return; - int n=t.right (1).toInt (&ok); - if (!ok || 0 == n) return; - - qint64 ms = QDateTime::currentMSecsSinceEpoch() % 86400000; - int nsec=ms/1000; - int ntr=m_TRperiod; - int j=((nsec+ntr-1) % (n*ntr))/ntr; - m_WSPR_tx_next = i == j; - return; - } - m_WSPR_tx_next = false; - if (!ui->sbTxPercent->isEnabled ()) + return RoundRobinSelection::policy (*ui->RoundRobin); +} + +void MainWindow::enterBeaconMode () +{ + processBeaconActions (m_beaconTxController.enterMode ( + qRound64 (1000.0 * m_TRperiod), beaconRoundRobinPolicy ())); + m_beaconTxController.setAutoEnabled (m_auto, false); + processBeaconActions (m_beaconTxController.setTxNext ( + ui->pbTxNext->isEnabled () && ui->pbTxNext->isChecked ())); +} + +BeaconTx::ScheduleProposal MainWindow::beaconScheduleProposal () +{ + auto const bandHopping = m_config.is_transceiver_online () + && !m_config.is_dummy_rig () && ui->band_hopping_group_box->isChecked (); + if (bandHopping) { - return; // don't schedule if %age disabled - } - if (m_config.is_transceiver_online () // need working rig control for hopping - && !m_config.is_dummy_rig () - && ui->band_hopping_group_box->isChecked ()) { - auto hop_data = m_WSPR_band_hopping.next_hop (m_auto); - qDebug () << "hop data: period:" << hop_data.period_name_ - << "frequencies index:" << hop_data.frequencies_index_ - << "tune:" << hop_data.tune_required_ - << "tx:" << hop_data.tx_next_; - m_WSPR_tx_next = hop_data.tx_next_; - if (hop_data.frequencies_index_ >= 0) { // new band - ui->bandComboBox->setCurrentIndex (hop_data.frequencies_index_); - on_bandComboBox_activated (hop_data.frequencies_index_); - // Execute user's hardware controller - auto band = m_config.bands ()->find (m_freqNominal).remove ('m'); + BeaconTx::ScheduleProposal proposal; + auto const hop = m_WSPR_band_hopping.next_hop (m_auto); + proposal.disposition = hop.tx_next_ + ? BeaconTx::Disposition::Transmit : BeaconTx::Disposition::Receive; + proposal.source = BeaconTx::PlanSource::BandHop; + proposal.hasHoppingProposal = true; + proposal.hopping.frequenciesIndex = hop.frequencies_index_; + proposal.hopping.tuneRequired = hop.tune_required_; + proposal.hopping.periodName = hop.period_name_.toStdString (); + return proposal; + } + BeaconTx::ScheduleProposal proposal; + proposal.disposition = m_WSPR_band_hopping.next_is_tx (m_mode=="FST4W") + ? BeaconTx::Disposition::Transmit : BeaconTx::Disposition::Receive; + proposal.source = BeaconTx::PlanSource::Percentage; + return proposal; +} + +bool MainWindow::applyBeaconBandChange (BeaconTx::HoppingProposal const& proposal) +{ + band_hopping_label.setText (QString::fromStdString (proposal.periodName)); + if (proposal.frequenciesIndex < 0) return true; + if (!nominalFrequencyChangeAllowed (FrequencyRequestOrigin::Automatic)) return false; + + Frequency frequency; + if (!workingFrequencyAt (proposal.frequenciesIndex, frequency)) return false; + ui->bandComboBox->setCurrentIndex (proposal.frequenciesIndex); + if (!requestBandChange (frequency, FrequencyRequestOrigin::Automatic)) return false; + + setXIT (ui->TxFreqSpinBox->value ()); + m_wideGraph->setRxBand (m_config.bands ()->find (frequency)); + auto band = m_config.bands ()->find (m_operatingFrequency.rx ()).remove ('m'); #if defined(Q_OS_WIN) - // On windows we use CMD.EXE to find and execute the - // user_hardware executable. This means that the first matching - // file extension on the PATHEXT environment variable found on - // the PATH environment variable path list. This give maximum - // flexibility for users to write user_hardware in their - // language of choice, and place the file anywhere on the PATH - // environment variable. Equivalent to typing user_hardware - // without any path or extension at the CMD.EXE prompt. - p3.start("CMD", QStringList {"/C", "user_hardware", band}); + p3.start("CMD", QStringList {"/C", "user_hardware", band}); #else - // On non-Windows systems we expect the user_hardware executable - // to be anywhere in the paths specified in the PATH environment - // variable path list, and executable. Equivalent to typing - // user_hardware without any path at the shell prompt. - p3.start("/bin/sh", QStringList {"-c", "user_hardware " + band}); + p3.start("/bin/sh", QStringList {"-c", "user_hardware \"$1\"", "sh", band}); #endif + return true; +} - // Produce a short tuneup signal - m_tuneup = false; - if (hop_data.tune_required_) { - m_tuneup = true; - on_tuneButton_clicked (true); - tuneATU_Timer.start (2500); - } +// Applies controller intents at the UI/rig boundary. Follow-up actions are +// appended so each external result re-enters the controller before another +// effect is applied. +void MainWindow::processBeaconActions (BeaconTx::Controller::Actions actions) +{ + for (std::size_t index = 0; index < actions.size (); ++index) + { + auto const action = actions[index]; + BeaconTx::Controller::Actions followup; + switch (action.kind) + { + case BeaconTx::ActionKind::SetTransmitWindow: + m_bTxTime = action.enabled; + break; + case BeaconTx::ActionKind::RequestScheduleProposal: + followup = m_beaconTxController.proposalDelivered ( + action.planId, beaconScheduleProposal ()); + break; + case BeaconTx::ActionKind::ApplyBandChange: + followup = m_beaconTxController.bandChangeOutcome ( + action.planId, applyBeaconBandChange (action.hopping)); + break; + case BeaconTx::ActionKind::StartAutomaticTune: + followup = m_beaconTxController.tuneStarted ( + BeaconTx::TuneKind::Automatic, action.planId); + if (m_beaconTxController.tuneKind () == BeaconTx::TuneKind::Automatic + && m_beaconTxController.tunePlanId () == action.planId) + { + on_tuneButton_clicked (true); + tuneATU_Timer.start (2500); + } + break; + case BeaconTx::ActionKind::RestoreAuto: + { + QSignalBlocker const blocker {ui->autoButton}; + ui->autoButton->setChecked (true); + m_auto = true; + } + break; + case BeaconTx::ActionKind::ClearTxNextUi: + { + QSignalBlocker const blocker {ui->pbTxNext}; + ui->pbTxNext->setChecked (false); + } + break; + case BeaconTx::ActionKind::RecordBeaconTransmission: + WSPR_history (m_operatingFrequency.rx (), -1); + m_wideGraph->setWSPRtransmitted (); + break; + } + actions.insert (actions.end (), followup.begin (), followup.end ()); } - - // Display grayline status - band_hopping_label.setText (hop_data.period_name_); - } - else { - m_WSPR_tx_next = m_WSPR_band_hopping.next_is_tx(m_mode=="FST4W"); - } } void MainWindow::astroUpdate () @@ -13785,18 +13789,18 @@ void MainWindow::astroUpdate () // no Doppler correction while CTRL pressed allows manual tuning if (Qt::ControlModifier & QApplication::queryKeyboardModifiers ()) return; if (m_tci && (ui->bandComboBox->currentText()=="OOB")) { - qDebug() << "TCI Mode and OOB so MainWindow::setRig returning at top\n"; + qDebug() << "TCI Mode and OOB so rig-frequency correction is skipped\n"; return; } auto correction = m_astroWidget->astroUpdate(QDateTime::currentDateTimeUtc (), - m_config.my_grid(), m_hisGrid,m_freqNominal,"Echo" == m_mode, - m_transmitting,m_auto,!m_config.tx_QSY_allowed (),m_TRperiod); + m_config.my_grid(), m_hisGrid,m_operatingFrequency.rx (),"Echo" == m_mode, + m_transmitting,m_auto,!m_config.tx_frequency_corrections_allowed (),m_TRperiod); m_fDop=correction.dop; m_fSpread=correction.width; m_tEcho=correction.techo; - if (m_transmitting && !m_config.tx_QSY_allowed ()) return; // No Tx Doppler correction if rig can't do it + if (m_transmitting && !m_config.tx_frequency_corrections_allowed ()) return; // No Tx Doppler correction if rig can't do it if (!m_astroWidget->doppler_tracking() or m_astroWidget->DopplerMethod()==0) { // We are not using RF Doppler correction m_fAudioShift=m_fDop; @@ -13807,7 +13811,7 @@ void MainWindow::astroUpdate () } if ((m_monitoring || m_transmitting) - && m_freqNominal >= 21000000 // No Doppler correction below 15m + && m_operatingFrequency.rx () >= 21000000 // No Doppler correction below 15m && m_config.split_mode ()) // Doppler correcion needs split mode { // adjust for rig resolution @@ -13846,30 +13850,96 @@ void MainWindow::astroUpdate () } else { m_astroCorrection = {}; } - if(!(m_tci && inSettings)) setRig (); + if(!(m_tci && inSettings)) reapplyCurrentRigFrequencyCorrection (); m_fAudioShift=m_fDop - correction.rx; } } -void MainWindow::setRig (Frequency f) +RigFrequencyChangePolicy::Activity MainWindow::rigFrequencyActivity () const { - if (f) { - m_freqNominal = f; - genCQMsg (); - m_freqTxNominal = m_freqNominal; - if (m_astroWidget) m_astroWidget->nominal_frequency (m_freqNominal, m_freqTxNominal); - } - if (m_mode == "FreqCal" && m_frequency_list_fcal_iter != m_config.frequencies ()->end ()) { - m_freqNominal = m_frequency_list_fcal_iter->frequency_ - ui->RxFreqSpinBox->value (); - } - if (m_transmitting && !m_config.tx_QSY_allowed ()) return; + return { + g_iptt == 1, + m_tx_when_ready, + m_transmitting, + m_tune, + m_jttyTxActive, + ptt1Timer.isActive (), + ptt0Timer.isActive (), + m_rigState.ptt (), + m_rigState.tune () + }; +} + +RigFrequencyChangePolicy::Decision MainWindow::rigFrequencyChangeDecision ( + RigFrequencyChangePolicy::ChangeKind kind) const +{ + return RigFrequencyChangePolicy::evaluate ( + kind, rigFrequencyActivity (), m_config.tx_frequency_corrections_allowed ()); +} + +bool MainWindow::nominalFrequencyChangeAllowed (FrequencyRequestOrigin origin) +{ + auto const decision = rigFrequencyChangeDecision ( + RigFrequencyChangePolicy::ChangeKind::NominalQsy); + if (!decision.allowed && origin == FrequencyRequestOrigin::User) + { + statusBar ()->showMessage ( + tr ("Stop transmitting or tuning before changing the dial frequency."), 5000); + } + return decision.allowed; +} + +OperatingFrequency::Context MainWindow::operatingFrequencyContext () const +{ + return {m_monitoring, !m_transmitting && !m_wav_load_coordinator.isLoading (), + !m_config.monitor_off_at_startup (), m_config.monitor_last_used (), m_mode == "Echo", + m_astroCorrection.rx, m_astroCorrection.tx}; +} + +bool MainWindow::dispatchNominalFrequency (Frequency corrected, + FrequencyRequestOrigin origin, + bool monitoring) +{ + if (!nominalFrequencyChangeAllowed (origin)) return false; + auto const accepted = !((monitoring || m_transmitting) && m_config.transceiver_online ()) + || m_config.transceiver_frequency ( + corrected, RigFrequencyChangePolicy::ChangeKind::NominalQsy); + if (!accepted && origin == FrequencyRequestOrigin::User) + { + statusBar ()->showMessage ( + tr ("Stop transmitting or tuning before changing the dial frequency."), 5000); + } + return accepted; +} + +bool MainWindow::requestNominalFrequencyChange (Frequency frequency, + FrequencyRequestOrigin origin) +{ + if (!m_operatingFrequency.requestNominal (frequency, m_astroCorrection.rx, + [this, origin] (Frequency corrected) { + return dispatchNominalFrequency (corrected, origin, m_monitoring); + })) return false; + + genCQMsg (); + if (m_astroWidget) + { + m_astroWidget->nominal_frequency (m_operatingFrequency.rx (), m_operatingFrequency.tx ()); + } + return true; +} + +bool MainWindow::reapplyCurrentRigFrequencyCorrection () +{ + auto const kind = RigFrequencyChangePolicy::ChangeKind::TxPathCorrection; + if (!rigFrequencyChangeDecision (kind).allowed) return false; if ((m_monitoring || m_transmitting) && m_config.transceiver_online ()) { if (m_transmitting && m_config.split_mode () && !(m_config.superFox() && m_specOp==SpecOp::FOX)) { - m_config.transceiver_tx_frequency (m_freqTxNominal + m_astroCorrection.tx); + return m_config.transceiver_tx_frequency (m_operatingFrequency.correctedTx (m_astroCorrection.tx), kind); } else { - m_config.transceiver_frequency (m_freqNominal + m_astroCorrection.rx); + return m_config.transceiver_frequency (m_operatingFrequency.correctedRx (m_astroCorrection.rx), kind); } } + return true; } void MainWindow::fastPick(int x0, int x1, int y) @@ -13877,7 +13947,7 @@ void MainWindow::fastPick(int x0, int x1, int y) float pixPerSecond=12000.0/512.0; if(m_TRperiod<30.0) pixPerSecond=12000.0/256.0; if(m_mode!="MSK144") return; - if(!m_decoderBusy) { + if(!decoderBusy ()) { dec_data.params.newdat=0; dec_data.params.nagain=1; m_nPick=1; @@ -13893,6 +13963,52 @@ void MainWindow::on_actionMeasure_reference_spectrum_triggered() { if(!m_monitoring) on_monitorButton_clicked (true); m_bRefSpec=true; + m_refSpecSecondsRemaining=ReferenceSpectrumMeasureSeconds; + statusBar()->showMessage(tr("Measuring reference spectrum: %1 s remaining") + .arg(m_refSpecSecondsRemaining)); + m_refSpecTimer.start(); +} + +void MainWindow::finishReferenceSpectrumMeasurement(bool notify) +{ + if(!m_bRefSpec) return; + + m_refSpecTimer.stop(); + m_refSpecSecondsRemaining=0; + bool const refspec_available { + QFile::exists(m_config.writeable_data_dir ().absoluteFilePath ("refspec.dat"))}; + m_wideGraph->setReferenceSpectrumAvailable(refspec_available); + m_bRefSpec=false; + + QString const message { + refspec_available + ? (notify + ? tr("Reference spectrum measurement stopped; Ref Spec is available") + : tr("Reference spectrum saved; Ref Spec is available")) + : tr("Reference spectrum measurement stopped; no reference spectrum is available")}; + statusBar()->showMessage(message, 5000); + + if(notify) { + MessageBox::information_message (this, message); + } +} + +void MainWindow::updateReferenceSpectrumCountdown() +{ + if(!m_bRefSpec) { + m_refSpecTimer.stop(); + m_refSpecSecondsRemaining=0; + return; + } + + --m_refSpecSecondsRemaining; + if(m_refSpecSecondsRemaining <= 0) { + finishReferenceSpectrumMeasurement(false); + return; + } + + statusBar()->showMessage(tr("Measuring reference spectrum: %1 s remaining") + .arg(m_refSpecSecondsRemaining)); } void MainWindow::on_actionMeasure_phase_response_triggered() @@ -13923,14 +14039,17 @@ void MainWindow::on_actionErase_reference_spectrum_triggered() void MainWindow::freqCalStep() { - if (m_frequency_list_fcal_iter == m_config.frequencies ()->end () - || ++m_frequency_list_fcal_iter == m_config.frequencies ()->end ()) { - m_frequency_list_fcal_iter = m_config.frequencies ()->begin (); + auto next = m_frequency_list_fcal_iter; + if (next == m_config.frequencies ()->end () + || ++next == m_config.frequencies ()->end ()) { + next = m_config.frequencies ()->begin (); } // allow for empty list - if (m_frequency_list_fcal_iter != m_config.frequencies ()->end ()) { - setRig (m_frequency_list_fcal_iter->frequency_ - ui->RxFreqSpinBox->value ()); + if (next != m_config.frequencies ()->end () + && requestNominalFrequencyChange ( + next->frequency_ - ui->RxFreqSpinBox->value (), FrequencyRequestOrigin::Automatic)) { + m_frequency_list_fcal_iter = next; } } @@ -13948,7 +14067,7 @@ void MainWindow::on_cbCQTx_toggled(bool b) m_ntx=6; m_QSOProgress = CALLING; } - setRig (); + reapplyCurrentRigFrequencyCorrection (); setXIT (ui->TxFreqSpinBox->value ()); } @@ -13976,10 +14095,10 @@ void MainWindow::statusUpdate () const { tr_period = quint32_max; } - m_messageClient->status_update (m_freqNominal, m_mode, m_hisCall, + m_messageClient->status_update (m_operatingFrequency.rx (), m_mode, m_hisCall, QString::number (ui->rptSpinBox->value ()), m_mode, ui->autoButton->isChecked (), - m_transmitting, m_decoderBusy, + m_transmitting, decoderBusy (), rx_frequency, ui->TxFreqSpinBox->value (), m_config.my_callsign (), m_config.my_grid (), m_hisGrid, m_tx_watchdog, @@ -14038,6 +14157,7 @@ void MainWindow::tx_watchdog (bool triggered) m_tx_watchdog = triggered; if (triggered) { + noteTxStopReason (TxEvidence::TxStopReason::Watchdog); m_bTxTime=false; if (m_tune) stop_tuning (); if (m_auto) auto_tx_mode (false); @@ -14067,7 +14187,7 @@ void MainWindow::update_watchdog_label () watchdog_label.setText (tr (" WD:%1m ").arg (m_config.watchdog () - m_idleMinutes)); watchdog_label.setVisible (true); // Highlight watchdog label yellow when there is less than one minute left - if ((m_config.watchdog() - m_idleMinutes == 1) && (m_auto or m_tune)) + if (normalWatchdogWarningActive ()) watchdog_label.setStyleSheet ("QLabel{color: #000000; background-color: #ffff00}"); if (m_config.watchdog() - m_idleMinutes > 1) watchdog_label.setStyleSheet (""); } @@ -14078,19 +14198,42 @@ void MainWindow::update_watchdog_label () } } -void MainWindow::on_cbMenus_toggled(bool b) +bool MainWindow::normalWatchdogWarningActive () const { - select_geometry (!b ? 2 : ui->actionSWL_Mode->isChecked () ? 1 : 0); + return m_config.watchdog () && m_mode != "WSPR" && m_mode != "FST4W" + && m_config.watchdog () - m_idleMinutes == 1 && (m_auto || m_tune); +} + +bool MainWindow::isHoundOperation () const +{ + return SpecOp::HOUND == m_specOp; +} + +bool MainWindow::isSuperHoundOperation () const +{ + return isHoundOperation () && m_config.superFox (); +} + +void MainWindow::updateHoundVerificationStyle () +{ + if (isHoundOperation () && m_houndVerified) + { + ui->labDXped->setStyleSheet ("QLabel {background-color: #00ff00; color: black;}"); + } + else + { + ui->labDXped->setStyleSheet ("QLabel {background-color: red; color: white;}"); + } } -void MainWindow::on_cbCQonly_toggled(bool) -{ //Fix this -- no decode here? - to_jt9(m_ihsym,1,-1); //Send m_ihsym to jt9[.exe] and start decoding - decodeBusy(true); +void MainWindow::on_cbMenus_toggled(bool b) +{ + select_geometry (!b ? 2 : ui->actionSWL_Mode->isChecked () ? 1 : 0); } void MainWindow::on_cbAutoSeq_toggled(bool b) { + if (!b) m_autoRespondPeriodState.disarm(); ui->respondComboBox->setVisible((m_mode=="FT8" or m_mode=="FT4" or m_mode=="FST4" or m_mode=="Q65" or m_mode=="MSK144" or m_mode=="JT65" or m_mode=="JT9") and b); check_button_color(); @@ -14098,6 +14241,13 @@ void MainWindow::on_cbAutoSeq_toggled(bool b) void MainWindow::on_measure_check_box_stateChanged (int state) { + if (!nominalFrequencyChangeAllowed (FrequencyRequestOrigin::User)) + { + QSignalBlocker const blocker {ui->measure_check_box}; + ui->measure_check_box->setCheckState ( + Qt::Checked == state ? Qt::Unchecked : Qt::Checked); + return; + } m_config.enable_calibration (Qt::Checked != state); } @@ -14110,7 +14260,7 @@ void MainWindow::write_transmit_entry (QString const& file_name) auto time = QDateTime::currentDateTimeUtc (); time = time.addSecs (-fmod(double(time.time().second()),m_TRperiod)); out << time.toString("yyMMdd_hhmmss") - << " Transmitting " << qSetRealNumberPrecision (12) << (m_freqNominal / 1.e6) + << " Transmitting " << qSetRealNumberPrecision (12) << (m_operatingFrequency.rx () / 1.e6) << " MHz " << m_mode << ": " << m_currentMessage #if QT_VERSION >= QT_VERSION_CHECK (5, 15, 0) @@ -14125,7 +14275,7 @@ void MainWindow::write_transmit_entry (QString const& file_name) { auto const& message = tr ("Cannot open \"%1\" for append: %2") .arg (f.fileName ()).arg (f.errorString ()); - QTimer::singleShot (0, [=] { // don't block guiUpdate + QTimer::singleShot (0, this, [=] { // don't block guiUpdate MessageBox::warning_message (this, tr ("Log File Error"), message); }); } @@ -14133,52 +14283,49 @@ void MainWindow::write_transmit_entry (QString const& file_name) void MainWindow::readWidebandDecodes() { - if(m_ActiveStationsWidget==NULL) return; int nhr=0; int nmin=0; int nsec=0; int nsnr=0; - while(m_fetched < qmapcom.ndecodes) { + int const max_qmap_decodes = sizeof qmapcom.result / sizeof qmapcom.result[0]; + int const qmap_decodes = qBound(0, qmapcom.ndecodes, max_qmap_decodes); + while(m_fetched < qmap_decodes) { // Recover and parse each decoded line. - QString line=QString::fromLatin1(qmapcom.result[m_fetched]); + auto const& row=qmapcom.result[m_fetched]; + QString line=QString::fromLatin1(row, + static_cast(qmap_decode_ipc::text_length(row))); m_fetched++; - nhr=line.mid(0,2).toInt(); - nmin=line.mid(2,2).toInt(); - nsec=line.mid(4,2).toInt(); - int sTimeString = line.mid(0,6).toInt(); - QTime time2(nhr, nmin, nsec); - QDateTime qSpotTime; - if (sTimeString + m_TRperiod < 236000) { - qSpotTime = QDateTime(QDateTime::currentDateTimeUtc().date(), time2, Qt::UTC); - } - else { - qSpotTime = QDateTime((QDateTime::currentDateTimeUtc().addDays(-1)).date(), time2, Qt::UTC); - } - double frx=line.mid(6,9).toDouble(); - double fsked=line.mid(16,7).toDouble(); - QString submode=line.mid(36,3); - QString msg=line.mid(41,-1); - int i1=msg.indexOf(" "); - int i2=i1 +1 + msg.mid(i1+1,-1).indexOf(" "); - QString dxcall=msg.mid(i1+1,i2-i1-1); - if(stdCall(dxcall)) { - QString w3=msg.mid(i2+1,-1); - nsnr=line.mid(31,3).toInt(); + auto const record = parseQMapDecodeRecord ( + QByteArray {row, static_cast (QMapDecodeRowSize)}); + if (!record) continue; + nhr=record->secondsSinceMidnight/3600; + nmin=(record->secondsSinceMidnight/60)%60; + nsec=record->secondsSinceMidnight%60; + auto const qSpotTime = DecodedTime::spotTime( + line.left(6), QDateTime::currentDateTimeUtc(), m_TRperiod); + if (!qSpotTime.isValid()) continue; + double frx=record->receiveFrequencyKHz; + double fsked=record->scheduledFrequencyKHz; + QString const& submode=record->submode; + QString const& dxcall=record->callsign; + if(stdCall (dxcall)) { + nsnr=record->snr; m_EMECall[dxcall].frx=frx; m_EMECall[dxcall].fsked=fsked; m_EMECall[dxcall].nsnr=nsnr; m_EMECall[dxcall].t=3600*nhr + 60*nmin + nsec; m_EMECall[dxcall].submode=submode; - if(w3.contains(grid_regexp)) m_EMECall[dxcall].grid4=w3; - bool bCQ=line.contains(" CQ "); + if(!record->grid.isEmpty ()) m_EMECall[dxcall].grid4=record->grid; + bool bCQ=record->cq; // m_EMECall[dxcall].ready2call=(bCQ or line.contains(" 73") or line.contains(" RR73")); m_EMECall[dxcall].ready2call=(bCQ); - Frequency frequency = (m_freqNominal/1000000) * 1000000 + int(fsked*1000.0); + Frequency frequency = (m_operatingFrequency.rx ()/1000000) * 1000000 + int(fsked*1000.0); bool bFromDisk=qmapcom.nQDecoderDone==2; - if(!bFromDisk and (m_EMECall[dxcall].grid4.contains(grid_regexp) or bCQ)) { + if(!bFromDisk && m_config.spot_to_psk_reporter () + && (m_EMECall[dxcall].grid4.contains(MainWindow::grid_regexp) or bCQ)) { qDebug() << "To PSKreporter:" << dxcall << m_EMECall[dxcall].grid4 << frequency << m_mode << nsnr; if (!m_psk_Reporter.addRemoteStation (dxcall, m_EMECall[dxcall].grid4, frequency, m_mode, nsnr, qSpotTime)) { - showStatusMessage (tr ("Spotting to PSK Reporter unavailable")); + showStatusMessage (tr ("PSK Reporter spot queue full; oldest spot dropped")); } } } @@ -14188,19 +14335,19 @@ void MainWindow::readWidebandDecodes() m_psk_Reporter.sendReport(); // Upload any queued spots } -// Update "m_wEMECall" by reading qmap_decodes.txt + if(m_ActiveStationsWidget==NULL) return; + +// Displayed row numbers index m_ready2call, so the rendered QMAP list must +// stay within the same capacity as its click-target storage. QMap::iterator i; QString t=""; QString t1; QString dxcall; QString dxgrid4; - QStringList list; - float f[100]; - int indx[100]; + QVector rows; int maxAge=m_ActiveStationsWidget->maxAge(); m_ActiveStationsWidget->setClickOK(false); - int k=0; for(i=m_EMECall.begin(); i!=m_EMECall.end(); i++) { bool bSkip=false; @@ -14223,52 +14370,63 @@ void MainWindow::readWidebandDecodes() t1=t1.asprintf("%7.3f %5.1f %+03d %3s %8s %4s %3d %3d %2s\n",i->frx,i->fsked,snr, submode.toLatin1().constData(),dxcall.toLatin1().constData(), dxgrid4.toLatin1().constData(),odd,age,c2); - f[k]=i->fsked; - list.append(t1); - k++; + rows.append({float(i->fsked), t1}); } m_ActiveStationsWidget->setClickOK(true); } } - if(k>0) { + std::fill(m_ready2call.begin(), m_ready2call.end(), QString {}); + rows=sorted_limited_active_station_items(rows, MaxActiveStationRows, false); + if(!rows.isEmpty()) { t1=""; - int kz=k; - indexx_(f,&kz,indx); - for(int k=0; kerase(); - m_ActiveStationsWidget->displayRecentStations(m_mode,t); + m_ActiveStationsWidget->displayRecentStations(ActiveStations::DisplayMode::Q65,t); m_ActiveStationsWidget->setClickOK(true); } - if(ipc_qmap[2]!=0) { - m_fetched=0; - ipc_qmap[0]=0; - ipc_qmap[2]=0; - } } // -------------------------- Code for FT8 DXpedition Mode --------------------------- -void MainWindow::hound_reply () -{ - if (!m_tune) { - // Select Tx3, set TxFreq to FoxFreq, and Force Auto ON. - ui->txrb3->setChecked (true); - m_nSentFoxRrpt = 1; - ui->rptSpinBox->setValue(m_rptSent.toInt()); - if (!m_auto) auto_tx_mode(true); - if (!m_config.superFox()) ui->TxFreqSpinBox->setValue (m_nFoxFreq); - stopWRTimer.start(int(11000.0*m_TRperiod)); // Tx3 timeout when in Hound mode - } +void MainWindow::hound_reply (int foxFrequency) +{ + HoundTransmissionPolicy::ReplyInput input; + input.protocol = m_config.superFox () ? HoundTransmissionPolicy::Protocol::SuperFox + : HoundTransmissionPolicy::Protocol::Classic; + input.tune = m_tune; + input.autoEnabled = m_auto; + input.sentReport = m_rptSent.toInt (); + input.decodedFoxFrequency = foxFrequency; + input.trPeriod = m_TRperiod; + auto const plan = HoundTransmissionPolicy::planFoxReportReply ( + m_houndTransmissionState, input); + if (!plan.applyReply) + { + m_houndTransmissionState = plan.nextState; + return; + } + + if (HoundTransmissionPolicy::TxMessage::Tx3 == plan.txMessage) + { + ui->txrb3->setChecked (true); + } + m_houndTransmissionState = plan.nextState; + ui->rptSpinBox->setValue (plan.report); + if (plan.enableAuto) auto_tx_mode (true); + if (HoundTransmissionPolicy::FrequencyAction::Set == plan.frequencyDecision.action) + { + ui->TxFreqSpinBox->setValue (plan.frequencyDecision.frequency); + } + stopWRTimer.start (plan.timeoutMilliseconds); } void MainWindow::on_sbNlist_valueChanged(int n) @@ -14292,9 +14450,9 @@ void MainWindow::FoxReset(QString reason="") { QFile f(m_config.temp_dir().absoluteFilePath("houndcallers.txt")); f.remove(); - ui->decodedTextBrowser->setText(""); - ui->houndQueueTextBrowser->setText(""); - ui->foxTxListTextBrowser->setText(""); + ui->decodedTextBrowser->clear(); + ui->houndQueueTextBrowser->clear(); + ui->foxTxListTextBrowser->clear(); m_houndQueue.clear(); m_foxQSO.clear(); @@ -14304,31 +14462,7 @@ void MainWindow::FoxReset(QString reason="") writeFoxQSO(" Reset"); } -void MainWindow::on_pbFoxReset_clicked() -{ - if(m_specOp!=SpecOp::FOX) return; - auto button = MessageBox::query_message (this, tr ("Confirm Reset"), - tr ("Are you sure you want to clear the QSO queues?")); - if(button == MessageBox::Yes) { - FoxReset(); - } -} -void MainWindow::on_pbFreeText_clicked() -{ - bool ok; - if(m_config.superFox()) { - m_freeTextMsg = QInputDialog::getText (this, tr("Free Text Message"), - tr("Message:"), QLineEdit::Normal, m_freeTextMsg0, &ok).left(26); - } else { - m_freeTextMsg = QInputDialog::getText (this, tr("Free Text Message"), - tr("Message:"), QLineEdit::Normal, m_freeTextMsg0, &ok).left(13); - } - if(ok) { - m_freeTextMsg=m_freeTextMsg.toUpper(); - m_freeTextMsg0=m_freeTextMsg; - } -} void MainWindow::on_comboBoxHoundSort_activated(int index) { @@ -14339,7 +14473,7 @@ void MainWindow::on_comboBoxCQ_activated() { if(m_config.superFox()) { ui->comboBoxCQ->setCurrentIndex(0); // No directional calls supported yet for SuperFox mode - QTimer::singleShot (0, [=] { // don't block guiUpdate + QTimer::singleShot (0, this, [=] { // don't block guiUpdate MessageBox::information_message(this, tr ("Directional calls not yet supported in SuperFox mode")); }); } @@ -14489,7 +14623,7 @@ QString MainWindow::sortHoundCalls(QString t, int isort, int max_dB) int nn=lines2.length(); if(isort==0) { // shuffle Hound calls to random order - int a[nn]; + int *a = new int[nn]; for(i=0; ihoundQueueTextBrowser->toPlainText().indexOf(houndCall) >= 0) return; - QString houndGrid=line.split(" ",SkipEmptyParts).at(1); // Hound caller's grid - QString rpt=line.split(" ",SkipEmptyParts).at(2); // Hound SNR + QString houndGrid=houndFields.at(1); // Hound caller's grid + QString rpt=houndFields.at(2); // Hound SNR + QString t1=houndCall + " "; + QString t2=m_config.superFox() ? superFoxTxReport(rpt) : rpt; + QString t1_with_grid; + if(!m_config.superFox()) { + bool ok=false; + int snr=rpt.toInt(&ok); + if(ok) { + snr=qBound(-30,snr,32); + snr=2*((snr+30)/2)-30; + t2=QString::asprintf("%+03d",snr); + } else { + if(t2.mid(0,1) != "-" and t2.mid(0,1) != "+") t2="+" + t2; + if(t2.length()==2) t2=t2.mid(0,1) + "0" + t2.mid(1,1); + } + } + if(m_config.superFox() && !superFoxQueueableHound(m_baseCall,houndCall,t2)) + { + removeHoundFromCallingList(houndCall); + showStatusMessage(tr("SuperFox cannot queue %1: unsupported callsign.") + .arg(houndCall)); + writeFoxQSO(" Reject: " + houndCall + " unsupported SuperFox callsign"); + return; + } m_houndCallers=m_houndCallers.remove(line+"\n"); // Remove t from sorted Hound list m_nSortedHounds--; ui->decodedTextBrowser->setHighlightedHoundText(m_houndCallers); // Populate left window with Hound callers - QString t1=houndCall + " "; - QString t2=rpt; - QString t1_with_grid; - if(rpt.mid(0,1) != "-" and rpt.mid(0,1) != "+") t2="+" + rpt; - if(t2.length()==2) t2=t2.mid(0,1) + "0" + t2.mid(1,1); t1=t1.mid(0,12) + t2; // display the callers, highlighting calls if necessary ui->houndQueueTextBrowser->insertText(bTopQueue ? t1 + "\n" : t1, QColor{}, QColor{}, houndCall, "", bTopQueue ? QTextCursor::Start : QTextCursor::End); @@ -14572,7 +14728,7 @@ void MainWindow::selectHound(QString line, bool bTopQueue) //------------------------------------------------------------------------------ void MainWindow::houndCallers() { -/* Called from decodeDone(), in DXpedition Fox mode. Reads decodes from file +/* Called from finishDecodeUi(), in DXpedition Fox mode. Reads decodes from file * "houndcallers.txt", ignoring any that are not addressed to MyCall, are already * in the stack, or with whom a QSO has been started. Others are considered to * be Hounds eager for a QSO. We add caller information (Call, Grid, SNR, Freq, @@ -14701,7 +14857,22 @@ void MainWindow::updateFoxQSOsInProgressDisplay() } } -void MainWindow::foxTxSequencer() +void MainWindow::clearSuperFoxPreparedTx() +{ + clearFoxTxMessages(); + std::memset(foxcom_.wave, 0, sizeof foxcom_.wave); +} + +void MainWindow::abortSuperFoxTxStart() +{ + clearSuperFoxPreparedTx(); + m_btxok = false; + m_tx_when_ready = false; + if (g_iptt == 1 || m_transmitting) stopTx(); + auto_tx_mode(false); +} + +bool MainWindow::foxTxSequencer() { /* Called from guiUpdate at the point where an FT8 Fox-mode transmission * is to be started. @@ -14724,6 +14895,192 @@ void MainWindow::foxTxSequencer() m_tFoxTxSinceOTP++; m_tFoxTx++; //Increment Fox Tx cycle counter + clearFoxTxMessages(); + + if (m_config.superFox()) { + qint32 const previousFoxTx0 = m_tFoxTx0; + qint32 const previousFoxTxSinceCQ = m_tFoxTxSinceCQ; + qint64 const previousFullFoxCallTime = m_fullFoxCallTime; + QString const previousFirstMessage = m_fm1; + bool const sendFreeText = ui->cbSendMsg->isChecked(); + QVector qsos; + qsos.reserve(m_foxQSO.size()); + for (auto it = m_foxQSO.constBegin(); it != m_foxQSO.constEnd(); ++it) { + auto const& call = it.key(); + auto const& foxQSO = it.value(); + SuperFoxTxPlanner::QsoState qso; + qso.call = call; + qso.grid = foxQSO.grid; + qso.sent = foxQSO.sent; + qso.rcvd = foxQSO.rcvd; + qso.ncall = foxQSO.ncall; + qso.nRR73 = foxQSO.nRR73; + qso.tFoxRrpt = foxQSO.tFoxRrpt; + qso.tFoxTxRR73 = foxQSO.tFoxTxRR73; + qsos.push_back(qso); + } + + QVector queuedHounds; + queuedHounds.reserve(m_houndQueue.size()); + for (auto const& line : m_houndQueue) { + queuedHounds.push_back(SuperFoxTxPlanner::parseQueuedHound(line)); + } + + auto const plan = SuperFoxTxPlanner::plan(qsos, m_foxQSOinProgress, + queuedHounds, m_maxStrikes, + sendFreeText); + QVector rr73Records; + QVector reportRecords; + for (auto const& record : plan.records) { + if (record.kind == SuperFoxTxPlanner::RecordKind::RR73) { + rr73Records.push_back(record); + } else { + reportRecords.push_back(record); + } + } + + auto logCompletedQSO = [this] (QString const& houndCall) { + auto alreadyLogged = m_loggedByFox[houndCall].contains(m_lastBand + " "); + auto const& qso = m_foxQSO[houndCall]; + if (!alreadyLogged) { + auto QSO_time = QDateTime::currentDateTimeUtc(); + m_hisCall = houndCall; + m_hisGrid = qso.grid; + m_rptSent = qso.sent; + m_rptRcvd = qso.rcvd; + if (!m_foxLogWindow) on_fox_log_action_triggered(); + if (m_logBook.fox_log()->add_QSO(QSO_time, m_hisCall, m_hisGrid, + m_rptSent, m_rptRcvd, m_lastBand)) { + writeFoxQSO(QString {" Log: %1 %2 %3 %4 %5"}.arg(m_hisCall).arg(m_hisGrid) + .arg(m_rptSent).arg(m_rptRcvd).arg(m_lastBand)); + on_logQSOButton_clicked(); + QTimer::singleShot(13000, [=] { + m_foxQSOinProgress.removeOne(houndCall); + updateFoxQSOsInProgressDisplay(); + }); + } + m_loggedByFox[houndCall] += (m_lastBand + " "); + } else { + writeFoxQSO(QString {" Dup: %1 %2 %3 %4 %5"}.arg(houndCall) + .arg(qso.grid).arg(qso.sent) + .arg(qso.rcvd).arg(m_lastBand)); + } + }; + + auto commitPlan = [this, &rr73Records, &reportRecords, &logCompletedQSO] { + for (auto const& record : rr73Records) { + auto& qso = m_foxQSO[record.call]; + qso.tFoxTxRR73 = m_tFoxTx; + qso.nRR73++; + logCompletedQSO(record.call); + } + + int queuedReportsToRemove = 0; + for (auto const& record : reportRecords) { + auto& qso = m_foxQSO[record.call]; + if (record.fromQueue) { + m_foxQSOinProgress.enqueue(record.call); + qso.grid = record.grid; + qso.sent = record.report; + qso.ncall = 0; + qso.nRR73 = 0; + qso.rcvd = -99; + qso.tFoxRrpt = -1; + qso.tFoxTxRR73 = -1; + queuedReportsToRemove++; + } + qso.ncall++; + } + + for (int i = 0; i < queuedReportsToRemove && !m_houndQueue.isEmpty(); ++i) { + m_houndQueue.dequeue(); + } + if (queuedReportsToRemove > 0) refreshHoundQueueDisplay(); + }; + + int const maxRows = sendFreeText ? 4 : 5; + int const rowCount = qMin(maxRows, qMax(rr73Records.size(), reportRecords.size())); + for (int i = 0; i < rowCount; ++i) { + bool const hasRR73 = i < rr73Records.size(); + bool const hasReport = i < reportRecords.size(); + fm.clear(); + if (hasRR73 && hasReport) { + auto const& rr73 = rr73Records.at(i); + auto const& report = reportRecords.at(i); + fm = Radio::base_callsign(rr73.call) + " RR73; " + + Radio::base_callsign(report.call) + " <" + m_config.my_callsign() + "> " + + report.report; + } else if (hasRR73) { + auto const& rr73 = rr73Records.at(i); + fm = Radio::base_callsign(rr73.call) + " " + m_baseCall + " RR73"; + } else if (hasReport) { + auto const& report = reportRecords.at(i); + fm = Radio::base_callsign(report.call) + " " + m_baseCall + " " + report.report; + } + islot++; + foxGenWaveform(islot - 1, fm); + } + + if (islot == 0) { + fm = ui->comboBoxCQ->currentText() + " " + m_config.my_callsign(); + if (!fm.contains("/")) { + fm += " " + m_config.my_grid().mid(0, 4); + m_fullFoxCallTime = now; + } + m_tFoxTx0 = m_tFoxTx; + islot++; + foxGenWaveform(islot - 1, fm); + } + + foxcom_.nslots = islot; + foxcom_.nfreq = ui->TxFreqSpinBox->value(); + if (m_config.split_mode()) foxcom_.nfreq = foxcom_.nfreq - m_XIT; + QString foxCall = m_config.my_callsign() + " "; + ::memcpy(foxcom_.mycall, foxCall.toLatin1(), sizeof foxcom_.mycall); + bool bSuperFox = true; + foxcom_.bMoreCQs = ui->cbMoreCQs->isChecked(); + foxcom_.bSendMsg = sendFreeText; + ::memcpy(foxcom_.textMsg, m_freeTextMsg0.leftJustified(26, ' ').toLatin1(), 26); + auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_1.dat")).toLocal8Bit()}; + foxgen_(&bSuperFox, fname.constData(), (FCL)fname.size()); + if (!sfox_tx()) { + --m_tFoxTx; + --m_tFoxTxSinceOTP; + m_tFoxTx0 = previousFoxTx0; + m_tFoxTxSinceCQ = previousFoxTxSinceCQ; + m_fullFoxCallTime = previousFullFoxCallTime; + m_fm1 = previousFirstMessage; + abortSuperFoxTxStart(); + return false; + } + + commitPlan(); + displayFoxTxMsgs(); + writeFoxTxMsgs(); + m_tFoxTxSinceCQ++; + + for (QString houndCall: m_foxQSO.keys()) { + auto& qso = m_foxQSO[houndCall]; + if (qso.ncall >= m_maxStrikes) qso.ncall++; + bool b1 = ((m_tFoxTx - qso.tFoxRrpt) > 2 * m_maxFoxWait) && + (qso.tFoxRrpt > 0); + bool b2 = ((m_tFoxTx - qso.tFoxTxRR73) > m_maxFoxWait) && + (qso.tFoxTxRR73 > 0); + bool b3 = (qso.ncall >= m_maxStrikes + m_maxFoxWait); + bool b4 = (qso.nRR73 >= m_maxStrikes); + if (b1 or b2 or b3 or b4) { + m_foxQSO.remove(houndCall); + m_foxQSOinProgress.removeOne(houndCall); + } + } + + if (m_foxLogWindow) { + update_foxLogWindow_rate(); + m_foxLogWindow->queued(m_foxQSOinProgress.count()); + } + updateFoxQSOsInProgressDisplay(); + return true; + } // Is it time for a stand-alone CQ? if(m_tFoxTxSinceCQ >= m_foxCQtime and ui->cbMoreCQs->isChecked()) { @@ -14867,7 +15224,7 @@ list2Done: writeFoxQSO (QString {" Log: %1 %2 %3 %4 %5"}.arg (m_hisCall).arg (m_hisGrid) .arg (m_rptSent).arg (m_rptRcvd).arg (m_lastBand)); on_logQSOButton_clicked (); - QTimer::singleShot (13000, [=] { + QTimer::singleShot (13000, this, [=] { m_foxQSOinProgress.removeOne(hc1); //Remove from In Progress window updateFoxQSOsInProgressDisplay(); //Update InProgress display after Tx is complete }); @@ -14920,8 +15277,10 @@ Transmit: auto fname {QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_1.dat")).toLocal8Bit()}; foxgen_(&bSuperFox, fname.constData(), (FCL)fname.size()); if(bSuperFox) { - writeFoxTxMsgs(); - sfox_tx(); + if(sfox_tx()) { + displayFoxTxMsgs(); + writeFoxTxMsgs(); + } } m_tFoxTxSinceCQ++; @@ -14945,6 +15304,7 @@ Transmit: m_foxLogWindow->queued (m_foxQSOinProgress.count ()); } updateFoxQSOsInProgressDisplay(); + return true; } void MainWindow::update_foxLogWindow_rate() @@ -14963,62 +15323,42 @@ void MainWindow::refreshHoundQueueDisplay() } } -void MainWindow::doubleClickOnFoxQueue(Qt::KeyboardModifiers modifiers) +void MainWindow::doubleClickOnFoxQueue(QString const& houndLine, QString const&, Qt::KeyboardModifiers modifiers) { - if(modifiers==9999) return; //Silence compiler warning - QTextCursor cursor=ui->houndQueueTextBrowser->textCursor(); - cursor.setPosition(cursor.selectionStart()); - QString houndLine=cursor.block().text(); QString houndCall=houndLine.mid(0,12).trimmed(); if (modifiers == (Qt::AltModifier)) { //Alt-click on a Fox queue entry - put on top of queue - // remove - for(auto i=0; i tmpQueue; - while (!m_houndQueue.isEmpty()) + if (FoxOperatorActions::removeQueuedHound (m_houndQueue, houndLine)) { - QString t = m_houndQueue.dequeue(); - QString hc = t.mid(0, 12).trimmed(); - if (hc != houndCall) tmpQueue.enqueue(t); + writeFoxQSO(" Del: " + houndCall); + refreshHoundQueueDisplay(); } - m_houndQueue.swap(tmpQueue); - refreshHoundQueueDisplay(); } } -void MainWindow::doubleClickOnFoxInProgress(Qt::KeyboardModifiers modifiers) +void MainWindow::doubleClickOnFoxInProgress(QString const& houndLine, QString const&, Qt::KeyboardModifiers modifiers) { - if (modifiers == 9999) return; //Silence compiler warning - QTextCursor cursor = ui->foxTxListTextBrowser->textCursor(); - cursor.setPosition(cursor.selectionStart()); - QString houndLine = cursor.block().text(); - QString houndCall = houndLine.mid(0, 12).trimmed(); - if (modifiers == 0) { - m_foxQSO[houndCall].ncall = m_maxStrikes + 1; // time them out - updateFoxQSOsInProgressDisplay(); + if (FoxOperatorActions::timeoutIfActive (m_foxQSOinProgress, m_foxQSO, houndLine, + m_maxStrikes + 1)) + { + updateFoxQSOsInProgressDisplay(); + } } } void MainWindow::foxQueueTopCallCommand() { - m_decodedText2 = true; - if(SpecOp::FOX==m_specOp && m_decodedText2 && m_houndQueue.count() < MAX_HOUNDS_IN_QUEUE) + if(SpecOp::FOX==m_specOp && m_houndQueue.count() < MAX_HOUNDS_IN_QUEUE) { QTextCursor cursor = ui->decodedTextBrowser->textCursor(); @@ -15040,36 +15380,47 @@ void MainWindow::foxGenWaveform(int i,QString fm) QString txModeArg; txModeArg = txModeArg.asprintf("FT8fox %d",i+1); int nfreq=ui->TxFreqSpinBox->value()+60*i; + bool const superFoxTx = m_config.superFox() && SpecOp::FOX==m_specOp; - if(m_config.superFox() && SpecOp::FOX==m_specOp) { - nfreq=750; - if(i==0 && ui->cbSendMsg->isChecked()) { - ui->decodedTextBrowser2->displayTransmittedText(m_freeTextMsg0, txModeArg, - nfreq,m_bFastMode,m_TRperiod,m_config.superFox()); - } - } - - ui->decodedTextBrowser2->displayTransmittedText(fm.trimmed(), txModeArg, - nfreq,m_bFastMode,m_TRperiod,m_config.superFox()); foxcom_.i3bit[i]=0; if(fm.indexOf("<")>0) foxcom_.i3bit[i]=1; strncpy(&foxcom_.cmsg[i][0],fm.toLatin1(),40); //Copy this message into cmsg[i] if(i==0) m_fm1=fm; + + if(superFoxTx) return; + + ui->decodedTextBrowser2->displayTransmittedText(fm.trimmed(), txModeArg, + nfreq,m_bFastMode,m_TRperiod,m_config.superFox()); QString t; t = t.asprintf(" Tx%d: ",i+1); writeFoxQSO(t + fm.trimmed()); } -void MainWindow::writeFoxTxMsgs() { - // references extern struct foxcom_ - QString t; - for (int i = 0; i < 5; i++) { - t = QString::fromLatin1(foxcom_.cmsg[i]).left(40); - if (t.length() > 0) { - write_all("Tx", t); +void MainWindow::displayFoxTxMsgs() +{ + for(auto const& message: superFoxTxMessages()) { + QString txModeArg; + txModeArg = txModeArg.asprintf("FT8fox %d",message.slot); + if(message.slot==1 && foxcom_.bSendMsg) { + QString const freeText = QString::fromLatin1(foxcom_.textMsg, + sizeof foxcom_.textMsg).trimmed(); + ui->decodedTextBrowser2->displayTransmittedText(freeText, txModeArg, + 750,m_bFastMode,m_TRperiod,m_config.superFox()); } + ui->decodedTextBrowser2->displayTransmittedText(message.text, txModeArg, + 750,m_bFastMode,m_TRperiod,m_config.superFox()); + + QString prefix; + prefix = prefix.asprintf(" Tx%d: ",message.slot); + writeFoxQSO(prefix + message.text); + } +} + +void MainWindow::writeFoxTxMsgs() { + for(auto const& message: superFoxTxMessages()) { + write_all("Tx", message.text); } - t = QString::fromLatin1(foxcom_.textMsg).left(38); + QString const t = QString::fromLatin1(foxcom_.textMsg, sizeof foxcom_.textMsg).trimmed(); if (foxcom_.bSendMsg) { write_all("Tx", "-Free Text- "+t); } @@ -15090,7 +15441,7 @@ void MainWindow::writeFoxTxMsgs() { #else << fixed #endif - << qSetRealNumberPrecision (3) << (m_freqNominal/1.e6) + << qSetRealNumberPrecision (3) << (m_operatingFrequency.rx ()/1.e6) << t << msg #if QT_VERSION >= QT_VERSION_CHECK (5, 15, 0) << Qt::endl @@ -15193,7 +15544,7 @@ void MainWindow::foxTest() } } if(line.contains("Tx1:")) { - foxTxSequencer(); + if (!foxTxSequencer()) return; } else { t = t.asprintf("%3d %3d %3d %3d %5d ",m_houndQueue.count(), m_foxQSOinProgress.count(),m_foxQSO.count(), @@ -15208,7 +15559,8 @@ void MainWindow::foxTest() } } -void MainWindow::write_all(QString txRx, QString message) +void MainWindow::write_all(QString txRx, QString message, + DecodeOperatingContext const * context) { if (!(ui->actionDisable_writing_of_ALL_TXT->isChecked())) { QString line; @@ -15216,9 +15568,15 @@ void MainWindow::write_all(QString txRx, QString message) QString msg; QString mode_string; QString file_name="ALL.TXT"; + auto const mode = context ? context->mode : m_mode; + auto const specOp = context ? context->specOp : m_specOp; + auto const superFox = context ? context->superFox : m_config.superFox (); + auto const diskData = context ? context->diskData : m_diskData; + auto const periodFrequency = context ? context->periodFrequency : m_freqNominalPeriod; + auto const sequenceStart = context ? context->sequenceStart : m_dateTimeSeqStart; QRegularExpression verified_call_regex {"[A-Z0-9/]+\\sverified\\s*"}; - if(m_mode!="Echo") { + if(mode!="Echo") { if (message.size () > 5 && message[4]==' ') { msg=message.mid(4,-1); } else { @@ -15229,17 +15587,19 @@ void MainWindow::write_all(QString txRx, QString message) mode_string="JT65 "; } else if (message.size () > 19 && message[19]=='@') { mode_string="JT9 "; - } else if(m_mode=="Q65") { - mode_string=mode_label.text(); + } else if(mode=="Q65") { + auto const period = context ? context->trPeriod : m_TRperiod; + auto const submode = context ? context->submode : m_nSubMode; + mode_string = "Q65-" + QString::number(period) + QChar('A' + submode); } else { - mode_string=m_mode.leftJustified(6,' '); + mode_string=mode.leftJustified(6,' '); } - if(mode_string=="FT8 " and txRx=="Tx" and m_config.superFox() and - m_specOp==SpecOp::FOX) mode_string="FT8_SF"; + if(mode_string=="FT8 " and txRx=="Tx" and superFox and + specOp==SpecOp::FOX) mode_string="FT8_SF"; - if(mode_string=="FT8 " and m_config.superFox() and - m_specOp==SpecOp::HOUND) mode_string="FT8_SH"; + if(mode_string=="FT8 " and superFox and + specOp==SpecOp::HOUND) mode_string="FT8_SH"; if (mode_string == "FT8_SH" && verified_call_regex.match(message).hasMatch()) { msg = " "+message; @@ -15247,17 +15607,26 @@ void MainWindow::write_all(QString txRx, QString message) msg = msg.mid(0, 15) + msg.mid(18, -1); } - t = t.asprintf("%5d",ui->TxFreqSpinBox->value()); + int const txFrequency = mode=="JTTY" + ? ui->TxFreqSpinBox_2->value() : ui->TxFreqSpinBox->value(); + t = t.asprintf("%5d",txFrequency); if (txRx=="Tx") msg=" 0 0.0" + t + " " + message; + if (mode=="JTTY" and txRx=="Rx") { + auto const decoded = Jtty::parseDecodeLine(message); + int const frequency = decoded.valid + ? decoded.frequency : ui->RxFreqSpinBox_2->value(); + t = t.asprintf("%5d", frequency); + msg=" 0 0.0" + t + " " + decoded.message; + } auto time = QDateTime::currentDateTimeUtc (); - if( (txRx=="Rx" || txRx=="Ck") && !m_bFastMode ) time=m_dateTimeSeqStart; + if( (txRx=="Rx" || txRx=="Ck") && (context || !m_bFastMode) ) time=sequenceStart; if (txRx=="Rx") { - t = t.asprintf("%10.3f ",m_freqNominalPeriod/1.e6); // prevent writing of wrong frequencies + t = t.asprintf("%10.3f ",periodFrequency/1.e6); } else { - t = t.asprintf("%10.3f ",m_freqNominal/1.e6); + t = t.asprintf("%10.3f ",m_operatingFrequency.rx ()/1.e6); } - if (m_diskData) { + if (diskData and !(mode=="JTTY" and txRx=="Tx")) { if (m_fileDateTime.size()==11) { line=m_fileDateTime + " " + t + txRx + " " + mode_string + msg; } else { @@ -15269,7 +15638,7 @@ void MainWindow::write_all(QString txRx, QString message) if (ui->actionSplit_ALL_TXT_yearly->isChecked()) file_name=(time.toString("yyyy") + "-" + "ALL.TXT"); if (ui->actionSplit_ALL_TXT_monthly->isChecked()) file_name=(time.toString("yyyy-MM") + "-" + "ALL.TXT"); - if (m_mode=="WSPR") file_name="ALL_WSPR.TXT"; + if (mode=="WSPR") file_name="ALL_WSPR.TXT"; } else { file_name="all_echo.txt"; line=message; @@ -15289,7 +15658,7 @@ void MainWindow::write_all(QString txRx, QString message) } else { auto const& message2 = tr ("Cannot open \"%1\" for append: %2") .arg (f.fileName ()).arg (f.errorString ()); - QTimer::singleShot (0, [=] { // don't block guiUpdate + QTimer::singleShot (0, this, [=] { // don't block guiUpdate MessageBox::warning_message(this, tr ("Log File Error"), message2); }); } } @@ -15306,16 +15675,8 @@ void MainWindow::chkFT4() m_specOp=m_config.special_op_id(); if(m_specOp!=SpecOp::NONE and m_specOp!=SpecOp::FOX and m_specOp!=SpecOp::HOUND) { - QString t0=""; - if(SpecOp::NA_VHF==m_specOp && m_config.NCCC_Sprint()) t0="NCCC Sprint"; - if(SpecOp::NA_VHF==m_specOp && !m_config.NCCC_Sprint()) t0="NA VHF"; - if(SpecOp::EU_VHF==m_specOp) t0="EU VHF"; - if(SpecOp::FIELD_DAY==m_specOp) t0="Field Day"; - if(SpecOp::RTTY==m_specOp) t0="FT RU"; - if(SpecOp::WW_DIGI==m_specOp) t0="WW Digi"; - if(SpecOp::ARRL_DIGI==m_specOp) t0="ARRL Digi"; - if(SpecOp::Q65_PILEUP==m_specOp) t0="Q65 Pileup"; - if(t0=="") { + QString t0 = specOpLabel(); + if(t0.isEmpty()) { ui->labDXped->setVisible(false); } else { ui->labDXped->setVisible(true); @@ -15329,16 +15690,10 @@ void MainWindow::chkFT4() } -void MainWindow::on_pbBestSP_clicked() -{ - m_bBestSPArmed = !m_bBestSPArmed; - if(m_bBestSPArmed and !m_transmitting) ui->pbBestSP->setStyleSheet ("QPushButton{color:red}"); - if(!m_bBestSPArmed) ui->pbBestSP->setStyleSheet (""); - if(m_bBestSPArmed) m_dateTimeBestSP=QDateTime::currentDateTimeUtc(); -} void MainWindow::set_mode (QString const& mode) { + m_autoRespondPeriodState.disarm(); if ("FT4" == mode) on_actionFT4_triggered (); else if ("FST4" == mode) on_actionFST4_triggered (); else if ("FST4W" == mode) on_actionFST4W_triggered (); @@ -15348,6 +15703,7 @@ void MainWindow::set_mode (QString const& mode) else if ("JT65" == mode) on_actionJT65_triggered (); else if ("Q65" == mode) on_actionQ65_triggered (); else if ("FreqCal" == mode) on_actionFreqCal_triggered (); + else if ("JTTY" == mode) on_actionJTTY_triggered (); else if ("MSK144" == mode) on_actionMSK144_triggered (); else if ("WSPR" == mode) on_actionWSPR_triggered (); else if ("Echo" == mode) on_actionEcho_triggered (); @@ -15355,18 +15711,15 @@ void MainWindow::set_mode (QString const& mode) void MainWindow::configActiveStations() { - if (m_ActiveStationsWidget != NULL and (m_mode == "Q65" or m_mode == "FT4" or m_mode == "FT8")) { - if (m_specOp == SpecOp::Q65_PILEUP) { - m_ActiveStationsWidget->displayRecentStations("Q65-pileup", ""); - } else { - if (m_specOp == SpecOp::FOX) - if (m_config.superFox()) - m_ActiveStationsWidget->displayRecentStations("SuperFox Mode", ""); - else - m_ActiveStationsWidget->displayRecentStations("Fox Mode", ""); - else - m_ActiveStationsWidget->displayRecentStations(m_mode, ""); + if (m_ActiveStationsWidget) { + auto displayMode = ActiveStations::DisplayMode::Standard; + if (m_mode == "Q65") { + displayMode = m_specOp == SpecOp::Q65_PILEUP + ? ActiveStations::DisplayMode::Q65Pileup : ActiveStations::DisplayMode::Q65; + } else if (m_mode == "FT8" && m_specOp == SpecOp::FOX) { + displayMode = ActiveStations::DisplayMode::Fox; } + m_ActiveStationsWidget->displayRecentStations(displayMode, ""); } } @@ -15479,70 +15832,18 @@ QString MainWindow::WSPR_message() return msg2; } -void MainWindow::on_houndButton_clicked (bool checked) -{ - if (checked) { - HoldTxFreqStatus = ui->cbHoldTxFreq->isChecked(); // save state of the Hold Tx Freq checkbox - m_config.setSpecial_Hound(); - ui->tx1->setVisible(true); - ui->tx1->setEnabled(true); - ui->txb1->setEnabled(true); - } else { - m_config.setSpecial_None(); - keep_frequency = true; - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - m_specOp=m_config.special_op_id(); - on_actionFT8_triggered(); - check_button_color(); -} - -void MainWindow::on_cbHoldTxFreq_clicked (bool) -{ - HoldTxFreqStatus = ui->cbHoldTxFreq->isChecked(); // save state of the Hold Tx Freq checkbox -} -void MainWindow::on_ft8Button_clicked() -{ - if (m_specOp==SpecOp::HOUND or m_specOp==SpecOp::FOX) { - m_config.setSpecial_None(); - m_specOp=m_config.special_op_id(); - } - on_actionFT8_triggered(); -} -void MainWindow::on_ft4Button_clicked() -{ - on_actionFT4_triggered(); -} -void MainWindow::on_msk144Button_clicked() -{ - on_actionMSK144_triggered(); -} -void MainWindow::on_q65Button_clicked() -{ - if (m_specOp==SpecOp::Q65_PILEUP) { - m_config.setSpecial_None(); - m_specOp=m_config.special_op_id(); - } - on_actionQ65_triggered(); -} -void MainWindow::on_jt65Button_clicked() -{ - on_actionJT65_triggered(); -} -void MainWindow::on_echoButton_clicked() -{ - on_actionEcho_triggered(); -} -void MainWindow::sfox_tx() { + +bool MainWindow::sfox_tx() { auto fname{QDir::toNativeSeparators(m_config.writeable_data_dir().absoluteFilePath("sfox_1.dat")).toLocal8Bit()}; QString ckey{"OTP:000000"}; + int pack_error {0}; LOG_INFO(QString("sfox_tx: OTP code is %1").arg(foxOTPcode())); #ifdef FOX_OTP qint32 otp_key = 0; @@ -15568,488 +15869,48 @@ void MainWindow::sfox_tx() { } } #endif - sftx_sub_(ckey.toLatin1().constData(), (FCL)ckey.size()); + sftx_sub_(ckey.toLatin1().constData(), &pack_error, (FCL)ckey.size()); + if(pack_error != 0) { + QString message; + switch(pack_error) { + case SuperFoxPackBadToken: + message = tr ("SuperFox Tx stopped: invalid message tokens."); + break; + case SuperFoxPackBadOtp: + message = tr ("SuperFox Tx stopped: invalid verification code."); + break; + case SuperFoxPackBadCq: + message = tr ("SuperFox Tx stopped: invalid CQ call or grid."); + break; + case SuperFoxPackBadCall: + message = tr ("SuperFox Tx stopped: invalid callsign."); + break; + case SuperFoxPackBadReport: + message = tr ("SuperFox Tx stopped: report is outside the " + "SuperFox range."); + break; + case SuperFoxPackBadFreeText: + message = tr ("SuperFox Tx stopped: free text contains unsupported " + "characters."); + break; + default: + message = tr ("SuperFox Tx stopped: message could not be packed."); + break; + } + showStatusMessage (message); + LOG_WARN(QString("%1 Error code: %2").arg(message).arg(pack_error)); + return false; + } sfox_wave_gfsk_(); + return true; } -void MainWindow::on_pb15A_clicked() -{ - ui->sbTR->setValue(15); - ui->sbSubmode->setValue(0); -} - -void MainWindow::on_pb15C_clicked() -{ - ui->sbTR->setValue(15); - ui->sbSubmode->setValue(2); - ui->TxFreqSpinBox->setValue(700); -} -void MainWindow::on_pb30B_clicked() -{ - ui->sbTR->setValue(30); - ui->sbSubmode->setValue(1); -} -void MainWindow::on_pb60C_clicked() -{ - ui->sbTR->setValue(60); - ui->sbSubmode->setValue(2); -} -void MainWindow::on_pb60D_clicked() -{ - ui->sbTR->setValue(60); - ui->sbSubmode->setValue(3); -} -void MainWindow::on_pb60E_clicked() -{ - ui->sbTR->setValue(60); - ui->sbSubmode->setValue(4); - ui->TxFreqSpinBox->setValue(700); -} -void MainWindow::bandHoppingTimer() -{ - if(ui->pbBandHopping->isChecked()) { - static int startIndex = 0; - int nextStartIndex = startIndex +1; - switch (startIndex){ - case 0: - startIndex = nextStartIndex; // band hopping every other minute - return; - case 1: - m_displayBand = false; - bandHopping(); - startIndex = 0; - return; - } - } -} -void MainWindow::bandHopping() -{ - if(ui->pbBandHopping->isChecked() && !ui->autoButton->isChecked() && !ui->tuneButton->isChecked()) { - static int startIndex = 0; - int nextStartIndex = startIndex +1; - switch (startIndex){ - case 0: - if (ui->cb160m->isChecked()) { - on_actionFT8_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (1840000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 1: - if (ui->cb80m->isChecked()) { - on_actionFT8_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (3573000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 2: - if (ui->cb60m->isChecked()) { - on_actionFT8_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (5357000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 3: - if (ui->cb40m->isChecked()) { - on_actionFT8_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (7074000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 4: - if (ui->cb30m->isChecked()) { - on_actionFT8_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (10136000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 5: - if (ui->cb20m->isChecked()) { - on_actionFT8_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (14074000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 6: - if (ui->cb17m->isChecked()) { - on_actionFT8_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (18100000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 7: - if (ui->cb15m->isChecked()) { - on_actionFT8_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (21074000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 8: - if (ui->cb12m->isChecked()) { - on_actionFT8_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (24915000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 9: - if (ui->cb10m->isChecked()) { - on_actionFT8_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (28074000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 10: - if (ui->cb6m->isChecked()) { - on_actionFT8_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (50313000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 11: - if (ui->cb4m->isChecked()) { - on_actionFT8_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (70154000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 12: - if (ui->cb2m->isChecked()) { - on_actionFT8_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (144174000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 13: - if (ui->cb70cm->isChecked()) { - on_actionFT8_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (432174000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 14: - if (ui->cb80mFT4->isChecked()) { - on_actionFT4_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (3575000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 15: - if (ui->cb40mFT4->isChecked()) { - on_actionFT4_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (7047500); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 16: - if (ui->cb30mFT4->isChecked()) { - on_actionFT4_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (10140000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 17: - if (ui->cb20mFT4->isChecked()) { - on_actionFT4_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (14080000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 18: - if (ui->cb17mFT4->isChecked()) { - on_actionFT4_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (18104000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - - case 19: - if (ui->cb15mFT4->isChecked()) { - on_actionFT4_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (21140000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 20: - if (ui->cb12mFT4->isChecked()) { - on_actionFT4_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (24919000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 21: - if (ui->cb10mFT4->isChecked()) { - on_actionFT4_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (28180000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 22: - if (ui->cb2mMSK->isChecked()) { - on_actionMSK144_triggered(); - auto const& row = m_config.frequencies ()->best_working_frequency (144360000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) on_bandComboBox_activated (row); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 23: - if (ui->cbQRG1->isChecked()) { - int f1 = ui->sbQRG1->value()*1000; - keep_frequency = true; - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setRig (f1); - on_actionFT8_triggered(); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 24: - if (ui->cbQRG2->isChecked()) { - int f2 = ui->sbQRG2->value()*1000; - keep_frequency = true; - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setRig (f2); - on_actionFT8_triggered(); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 25: - if (ui->cbQRG3->isChecked()) { - int f3 = ui->sbQRG3->value()*1000; - keep_frequency = true; - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setRig (f3); - on_actionFT8_triggered(); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 26: - if (ui->cbQRG4->isChecked()) { - int f4 = ui->sbQRG4->value()*1000; - keep_frequency = true; - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setRig (f4); - on_actionFT8_triggered(); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 27: - if (ui->cbQRG5->isChecked()) { - int f5 = ui->sbQRG5->value()*1000; - keep_frequency = true; - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setRig (f5); - on_actionFT8_triggered(); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 28: - if (ui->cbQRG6->isChecked()) { - int f6 = ui->sbQRG6->value()*1000; - keep_frequency = true; - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setRig (f6); - on_actionFT8_triggered(); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 29: - if (ui->cbQRG7->isChecked()) { - int f7 = ui->sbQRG7->value()*1000; - keep_frequency = true; - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setRig (f7); - on_actionFT8_triggered(); - ui->pbBandHopping->setChecked(true); - startIndex = nextStartIndex; - return; - } else { - nextStartIndex++; - } - Q_FALLTHROUGH(); - case 30: - if (ui->cbQRG8->isChecked()) { - int f8 = ui->sbQRG8->value()*1000; - keep_frequency = true; - QTimer::singleShot (250, [=] {keep_frequency = false;}); - setRig (f8); - on_actionFT8_triggered(); - ui->pbBandHopping->setChecked(true); - startIndex = 0; - return; - bandHopping(); - } else { - startIndex = 0; - bandHopping(); - } - } - } -} void MainWindow::on_actionDefault_event_logging_triggered() { @@ -16077,7 +15938,7 @@ void MainWindow::on_actionDiagnostic_mode_triggered() QString path = QStandardPaths::writableLocation (QStandardPaths::DataLocation); QStringList tw; if (path.contains("/WSJT-X")) tw=path.split("/WSJT-X"); - if (tw.size () > 0 && tw[1].remove(" - ") != "") instance = tw[1].remove(" - ") + "/"; + if (tw.size () > 1 && tw[1].remove(" - ") != "") instance = tw[1].remove(" - ") + "/"; QString EventConfig = ( "\[Sinks.SYSLOG]\n" "Destination=TextFile\n" @@ -16086,7 +15947,7 @@ void MainWindow::on_actionDiagnostic_mode_triggered() "FileName=\"${DesktopLocation}/logs/" + instance + "wsjtx_syslog.log\"\n" "Append=true\n" "Format=\"[%Channel%][%TimeStamp(format=\\\"%Y-%m-%d %H:%M:%S.%f\\\")%][%Uptime(format=\\\"%O:%M:%S.%f\\\")%][%Severity%] %Message%\"\n" - "Filter=\"%Channel% matches \\\"SYSLOG\\\" | %Severity% >= info\"\n" + "Filter=\"%Channel% matches \\\"SYSLOG\\\" & %Severity% >= info\"\n" "\n" "\[Sinks.RIGCTRL]\n" "Destination=TextFile\n" @@ -16095,7 +15956,7 @@ void MainWindow::on_actionDiagnostic_mode_triggered() "FileName=\"${DesktopLocation}/logs/" + instance + "WSJT-X_RigControl.log\"\n" "Append=true\n" "Format=\"[%TimeStamp(format=\\\"%Y-%m-%d %H:%M:%S.%f\\\")%][%Uptime(format=\\\"%O:%M:%S.%f\\\")%][%Channel%:%Severity%] %Message%\"\n" - "Filter=\"%Channel% matches \\\"RIGCTRL\\\" | %Severity% >= info\"" + "Filter=\"%Channel% matches \\\"RIGCTRL\\\" & %Severity% >= info\"" ); QTextStream out(&f); out << EventConfig; @@ -16145,56 +16006,7 @@ void MainWindow::on_actionDisable_event_logging_triggered() void MainWindow::on_actionUse_Dark_Style_triggered (bool checked) { - QFont font = m_config.text_font(); - if (checked) { - QFile f(":qdarkstyle/style.qss"); - if (!f.exists()) { - printf("Unable to set stylesheet, file not found\n"); - } else { - qApp->setFont (font); - QString ss; - f.open(QFile::ReadOnly | QFile::Text); - QTextStream ts(&f); - qApp->setStyleSheet(ts.readAll() + "* {" + font_as_stylesheet (font) + '}'); - m_useDarkStyle = true; - m_wideGraph->setDarkStyle(m_useDarkStyle); - check_button_color(); - ui->tabWidget->setTabShape(QTabWidget::Rounded); - } - } else { - m_useDarkStyle = false; - m_wideGraph->setDarkStyle(m_useDarkStyle); - check_button_color(); - ui->tabWidget->setTabShape(QTabWidget::Triangular); - qApp->setFont (font); - QString ss; - if (qApp->styleSheet ().size ()) { - auto sheet = qApp->styleSheet (); - sheet.remove ("file:///"); - QFile sf {sheet}; - if (sf.open (QFile::ReadOnly | QFile::Text)) ss = sf.readAll () + ss; - } - qApp->setStyleSheet (ss + "* {" + font_as_stylesheet (font) + '}'); - } - // ensure a balanced layout - qreal pointSize = m_config.text_font().pointSizeF(); -// if (pointSize < 9) ui->controls_stack_widget->setMaximumWidth(180); // UR for AL -// if (pointSize == 9) ui->controls_stack_widget->setMaximumWidth(200); // UR for AL -// if (pointSize == 10) ui->controls_stack_widget->setMaximumWidth(220); // UR for AL -// if (pointSize > 10) ui->controls_stack_widget->setMaximumWidth(240); // UR for AL - if (pointSize < 11) { -// ui->tabWidget->setMaximumHeight(210); // UR for AL -// ui->controls_stack_widget->setMaximumHeight(200); // UR for AL - if (ui->actionUse_Dark_Style->isChecked()) ui->tabWidget->setMaximumHeight(225); // UR for normal + widescreen - } else { -// ui->tabWidget->setMaximumHeight(255); // UR for AL -// ui->controls_stack_widget->setMaximumHeight(225); // UR for AL - ui->tabWidget->setMaximumHeight(500); // UR for normal + widescreen - } - for (auto& widget : qApp->topLevelWidgets ()) - { - widget->updateGeometry (); - } + applyApplicationStyle (m_config.text_font (), checked); statusChanged(); guiUpdate(); } @@ -16215,62 +16027,118 @@ void MainWindow:: on_actionVHF_UHF_Buttons_triggered () void MainWindow::check_button_color() { - // Yellow background for the DX Call and Enable Tx buttons when the rig is allowed to Tx automatically - if((((m_mode=="FT8" or m_mode=="FT4" or m_mode=="Q65" or m_mode=="FST4" or m_mode=="MSK144" or m_mode=="JT65" or m_mode=="JT9" or m_mode=="JT4") && - m_specOp==SpecOp::NONE && ui->cbAutoSeq->isChecked() && ui->cbAutoSeq->isChecked() - && m_config.Wait_features_enabled()) or m_specOp==SpecOp::HOUND) && (m_hisCall!="" or (m_mode=="FT8" && m_specOp==SpecOp::HOUND))) { - if (ui->DX_Call_Button->isChecked()) { - ui->DX_Call_Button->setStyleSheet("QPushButton {background-color: #ff0000; color: #ffffff; border-style: outset; border-width: 1px; border-radius: 5px; border-color: black; min-width: 5em; padding: 3px;}"); - } else { - if (m_mode=="FT8" && m_specOp==SpecOp::HOUND && m_hisCall=="") { - if (m_useDarkStyle) { - ui->DX_Call_Button->setStyleSheet("QPushButton {background-color: #505F69; color: #ffffff; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); - } else { - ui->DX_Call_Button->setStyleSheet("QPushButton {background-color: #9fafd5; border: none;}"); - } - } else { - ui->DX_Call_Button->setStyleSheet("QPushButton {background-color: #ffff00; color: #000000; border: 1px solid #32414B; border-radius: 4px; padding: 3px; outline: none;}"); - } - } - if (!m_auto) { - if (m_mode=="FT8" && m_specOp==SpecOp::HOUND && m_hisCall=="") { - if (m_useDarkStyle) { - ui->autoButton->setStyleSheet("QPushButton {background-color: #505F69; color: #ffffff; border: 1px solid #32414B; color: #F0F0F0; border-radius: 5px; padding: 3px; outline: none; min-width: 5em;}"); - } else { - ui->autoButton->setStyleSheet(""); - ui->autoButton->setStyleSheet("QPushButton {min-width: 5em;}"); - } - } else { - ui->autoButton->setStyleSheet("QPushButton {background-color: #ffff00; color: #000000; border: 1px solid #32414B; border-radius: 4px; padding: 3px; outline: none; min-width: 5em;}"); - } - } - if (m_auto) ui->autoButton->setStyleSheet("QPushButton {background-color: #ff0000; color: #ffffff; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none; min-width: 5em;}"); + WaitFeatureContext const waitContext { + m_mode, + m_specOp, + m_config.Wait_features_enabled(), + ui->cbAutoSeq->isChecked(), + !m_hisCall.isEmpty(), + m_config.NCCC_Sprint() + }; + auto const waitAndCallEligible = wait_and_call_arming_eligible (waitContext); + auto const enableTxWarning = enable_tx_warning (waitContext); + + if (!waitAndCallEligible) { + ui->DX_Call_Button->setChecked (false); + wait_and_call = false; + } else if (!ui->DX_Call_Button->isChecked()) { + wait_and_call = false; + } + + static QString const dx_call_button_style { + "QPushButton {border: 1px solid #32414B; border-radius: 4px; padding: 3px; " +#ifdef Q_OS_MAC + "margin-left: 6px; margin-right: 6px; " +#endif + "outline: none;}" + "QPushButton[wsjtxState=\"active\"] {background-color: #ff0000; color: #ffffff;}" + "QPushButton[wsjtxState=\"warning\"] {background-color: #ffff00; color: #000000;}" + "QPushButton[wsjtxState=\"dark\"] {background-color: #505F69; color: #F0F0F0;}" + "QPushButton[wsjtxState=\"idle\"] {background-color: #e1e1e1; color: #000000; " + "border-color: #adadad;}"}; + set_style_sheet_if_changed(ui->DX_Call_Button, dx_call_button_style); + + if (wait_and_call) { + set_button_style_state_if_changed(ui->DX_Call_Button, "active"); + } else if (wait_and_call_warning_eligible (waitContext)) { + set_button_style_state_if_changed(ui->DX_Call_Button, "warning"); + } else if (m_useDarkStyle) { + set_button_style_state_if_changed(ui->DX_Call_Button, "dark"); } else { - ui->DX_Call_Button->setChecked(false); - if (m_useDarkStyle) { - ui->DX_Call_Button->setStyleSheet("QPushButton {background-color: #505F69; color: #ffffff; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); - if (!m_auto) ui->autoButton->setStyleSheet("QPushButton {background-color: #505F69; color: #ffffff; border: 1px solid #32414B; color: #F0F0F0; border-radius: 5px; padding: 3px; outline: none; min-width: 5em;}"); - if (m_auto) ui->autoButton->setStyleSheet("QPushButton {background-color: #ff0000; color: #ffffff; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none; min-width: 5em;}"); - } else { - ui->DX_Call_Button->setStyleSheet("QPushButton {background-color: #9fafd5; border: none;}"); - if (!m_auto) { - ui->autoButton->setStyleSheet(""); - ui->autoButton->setStyleSheet("QPushButton {min-width: 5em;}"); - } - if (m_auto) ui->autoButton->setStyleSheet("QPushButton {background-color: #ff0000; color: #ffffff; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none; min-width: 5em;}"); - } + set_button_style_state_if_changed(ui->DX_Call_Button, "idle"); + } + + if (m_auto) { + set_style_sheet_if_changed(ui->autoButton, "QPushButton {background-color: #ff0000; color: #ffffff; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + } else if (EnableTxWarning::NONE != enableTxWarning) { + set_style_sheet_if_changed(ui->autoButton, "QPushButton {background-color: #ffff00; color: #000000; border: 1px solid #32414B; border-radius: 4px; padding: 3px; outline: none;}"); + } else if (m_useDarkStyle) { + set_style_sheet_if_changed(ui->autoButton, "QPushButton {background-color: #505F69; color: #ffffff; border: 1px solid #32414B; color: #F0F0F0; border-radius: 5px; padding: 3px; outline: none;}"); + } else { + set_style_sheet_if_changed(ui->autoButton, ""); } - ui->autoButton->setToolTip("Toggle Auto-Tx On/Off"); + auto const respondMode = ui->respondComboBox->currentText(); + auto const respondPolicy = autoRespondPolicy (); if (m_config.Wait_features_enabled()) { - ui->DX_Call_Button->setToolTip("Toggle Wait & Call On/Off.\n" - "Right-click to clear the DX Call box."); - ui->autoButton->setToolTip("Toggle Auto-Tx On/Off.\n" - "Right-click to toggle Wait & Pounce On/Off."); + if (waitAndCallEligible) { + ui->DX_Call_Button->setToolTip("Toggle Wait & Call On/Off.\n" + "Right-click to clear the DX Call box."); + } else if (!ui->cbAutoSeq->isChecked()) { + ui->DX_Call_Button->setToolTip("Wait & Call requires Auto-Seq.\n" + "Right-click to clear the DX Call box."); + } else if (!wait_and_call_mode_supported (m_mode) + || (SpecOp::HOUND == m_specOp && "FT8" != m_mode)) { + ui->DX_Call_Button->setToolTip("Wait & Call is unavailable in this mode.\n" + "Right-click to clear the DX Call box."); + } else if (SpecOp::NONE != m_specOp && SpecOp::HOUND != m_specOp) { + ui->DX_Call_Button->setToolTip("Wait & Call is unavailable for this special operation.\n" + "Right-click to clear the DX Call box."); + } else { + ui->DX_Call_Button->setToolTip("Enter a DX call to enable Wait & Call.\n" + "Right-click to clear the DX Call box."); + } } else { ui->DX_Call_Button->setToolTip("Right-click to clear the DX Call box"); - ui->autoButton->setToolTip("Toggle Auto-Tx On/Off"); } + + QString autoButtonToolTip {"Toggle Auto-Tx On/Off"}; + if (pounce) { + autoButtonToolTip = "Toggle Auto-Tx On/Off.\n" + "Wait & Pounce is On.\n" + "Right-click to turn Wait & Pounce Off."; + } else if (!m_auto && EnableTxWarning::HOUND_AUTO_REPLY == enableTxWarning) { + autoButtonToolTip = "Toggle Auto-Tx On/Off.\n" + "Hound mode can enable Auto-Tx when the selected Fox replies."; + } else if (!m_auto && EnableTxWarning::NCCC_SPRINT == enableTxWarning) { + autoButtonToolTip = "Toggle Auto-Tx On/Off.\n" + "NCCC Sprint can enable Auto-Tx when the selected station replies."; + } else if (!m_auto && EnableTxWarning::WAIT_AND_REPLY == enableTxWarning) { + autoButtonToolTip = "Toggle Auto-Tx On/Off.\n" + "Wait & Reply can enable Auto-Tx when the selected station replies."; + } else if (m_config.Wait_features_enabled()) { + if (respondPolicy == AutoRespondPolicy::None) { + autoButtonToolTip = "Toggle Auto-Tx On/Off.\n" + "Wait & Pounce requires a CQ response mode.\n" + "Change CQ: None to another option."; + } else if (m_auto) { + autoButtonToolTip = "Toggle Auto-Tx On/Off.\n" + "Turn Auto-Tx Off before enabling Wait & Pounce."; + } else if (SpecOp::FOX==m_specOp) { + autoButtonToolTip = "Toggle Auto-Tx On/Off.\n" + "Wait & Pounce is unavailable in Fox mode."; + } else { + autoButtonToolTip = QString {"Toggle Auto-Tx On/Off.\n" + "Right-click to enable Wait & Pounce using %1."}.arg(respondMode); + } + } + if (ui->cbAutoSeq->isChecked() + && AutoRespondPolicy::None != autoRespondPolicy()) { + autoButtonToolTip += "\nA direct caller may replace a pending CQ or QRZ."; + } + ui->autoButton->setToolTip(autoButtonToolTip); + ui->DX_Call_Button->setAccessibleDescription(ui->DX_Call_Button->toolTip()); + ui->autoButton->setAccessibleDescription(ui->autoButton->toolTip()); if (m_config.alternate_erase_button()) { ui->EraseButton->setToolTip("Left-click to erase left window.\n" "Right-click to erase right window."); @@ -16279,7 +16147,7 @@ void MainWindow::check_button_color() "Double-click to erase both windows."); } if (pounce && !m_auto) { - ui->autoButton->setStyleSheet("QPushButton {background-color: #ff7a05; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none; min-width: 5em;}"); + set_style_sheet_if_changed(ui->autoButton, "QPushButton {background-color: #ff7a05; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); ui->autoButton->setChecked(false); // ensure auoButton is unchecked } if (m_config.Territory1()=="") { @@ -16323,124 +16191,124 @@ void MainWindow::check_button_color() if (!m_config.button_coloring_disabled()) { if (m_mode=="Q65" && m_config.enable_VHF_features() && m_TRperiod==15 && m_nSubMode==0) { - ui->pb15A->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb15A, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb15A->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb15A, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb15A->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb15A, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (m_mode=="Q65" && m_config.enable_VHF_features() && m_TRperiod==15 && m_nSubMode==2) { - ui->pb15C->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb15C, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb15C->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb15C, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb15C->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb15C, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (m_mode=="Q65" && m_config.enable_VHF_features() && m_TRperiod==30 && m_nSubMode==1) { - ui->pb30B->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb30B, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb30B->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb30B, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb30B->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb30B, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (m_mode=="Q65" && m_config.enable_VHF_features() && m_TRperiod==60 && m_nSubMode==2) { - ui->pb60C->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb60C, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb60C->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb60C, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb60C->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb60C, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (m_mode=="Q65" && m_config.enable_VHF_features() && m_TRperiod==60 && m_nSubMode==3) { - ui->pb60D->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb60D, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb60D->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb60D, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb60D->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb60D, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (m_mode=="Q65" && m_config.enable_VHF_features() && m_TRperiod==60 && m_nSubMode==4) { - ui->pb60E->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb60E, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb60E->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb60E, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb60E->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb60E, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (ui->houndButton->isChecked() && !m_config.button_coloring_disabled()) { - ui->houndButton->setStyleSheet("QPushButton {background-color: #ff0000; color: #ffffff; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->houndButton, "QPushButton {background-color: #ff0000; color: #ffffff; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (SpecOp::FOX==m_specOp && !m_config.button_coloring_disabled()) { - ui->houndButton->setStyleSheet("QPushButton {background-color: #ffff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->houndButton, "QPushButton {background-color: #ffff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->houndButton->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->houndButton, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->houndButton->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->houndButton, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } } if (m_mode=="FT8") { - ui->ft8Button->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->ft8Button, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->ft8Button->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->ft8Button, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->ft8Button->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->ft8Button, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (m_mode=="FT4") { - ui->ft4Button->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->ft4Button, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->ft4Button->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->ft4Button, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->ft4Button->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->ft4Button, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (m_mode=="MSK144") { - ui->msk144Button->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->msk144Button, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->msk144Button->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->msk144Button, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->msk144Button->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->msk144Button, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (m_mode=="Q65") { - ui->q65Button->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->q65Button, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->q65Button->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->q65Button, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->q65Button->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->q65Button, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (m_mode=="JT65") { - ui->jt65Button->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->jt65Button, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->jt65Button->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->jt65Button, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->jt65Button->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->jt65Button, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (m_mode=="Echo" && ui->echoButton->isVisible()) { - ui->echoButton->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->echoButton, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->echoButton->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->echoButton, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->echoButton->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none; min-width: 3em;}"); + set_style_sheet_if_changed(ui->echoButton, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } } @@ -16450,16 +16318,16 @@ void MainWindow::check_button_color() ui->echoButton->setVisible (false); } if (m_mode=="JT65" && m_config.enable_VHF_features() && ui->cbShMsgs->isChecked()) { - ui->tx3->setStyleSheet("color: #000000; background-color: #66ffff"); - ui->tx4->setStyleSheet("color: #000000; background-color: #66ffff"); - if (!keepTx5) ui->tx5->setStyleSheet("color: #000000; background-color: #66ffff"); + set_style_sheet_if_changed(ui->tx3, "color: #000000; background-color: #66ffff"); + set_style_sheet_if_changed(ui->tx4, "color: #000000; background-color: #66ffff"); + if (!keepTx5) set_style_sheet_if_changed(ui->tx5, "color: #000000; background-color: #66ffff"); } else { - ui->tx3->setStyleSheet(""); - ui->tx4->setStyleSheet(""); - if (!keepTx5) ui->tx5->setStyleSheet(""); + set_style_sheet_if_changed(ui->tx3, ""); + set_style_sheet_if_changed(ui->tx4, ""); + if (!keepTx5) set_style_sheet_if_changed(ui->tx5, ""); } if (ui->actionBand_Buttons->isChecked()) { - QString band=m_config.bands()->find(m_freqNominal); + QString band=m_config.bands()->find(m_operatingFrequency.rx ()); if (ui->actionVHF_UHF_Buttons->isChecked()) { ui->pb160->setVisible(false); ui->pb80->setVisible(false); @@ -16488,120 +16356,120 @@ void MainWindow::check_button_color() ui->pb10G->setVisible(true); ui->pb24G->setVisible(true); if (band=="8m") { - ui->pb8->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb8, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb8->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb8, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb8->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb8, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="6m") { - ui->pb50->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb50, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb50->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb50, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb50->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb50, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="4m") { - ui->pb4->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb4, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb4->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb4, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb4->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb4, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="2m") { - ui->pb144->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb144, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb144->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb144, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb144->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb144, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="1.25m") { - ui->pb220->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb220, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb220->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb220, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb220->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb220, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="70cm") { - ui->pb432->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb432, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb432->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb432, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb432->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb432, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="33cm") { - ui->pb902->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb902, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb902->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb902, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb902->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb902, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="23cm") { - ui->pb23->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb23, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb23->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb23, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb23->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb23, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="13cm") { - ui->pb13->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb13, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb13->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb13, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb13->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb13, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="9cm") { - ui->pb9->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb9, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb9->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb9, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb9->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb9, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="6cm") { - ui->pb5G->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb5G, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb5G->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb5G, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb5G->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb5G, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="3cm") { - ui->pb10G->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb10G, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb10G->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb10G, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb10G->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb10G, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="1.25cm") { - ui->pb24G->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb24G, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb24G->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb24G, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb24G->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb24G, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } } else { @@ -16632,127 +16500,127 @@ void MainWindow::check_button_color() ui->pb10G->setVisible(false); ui->pb24G->setVisible(false); if (band=="160m") { - ui->pb160->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb160, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb160->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb160, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb160->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb160, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="80m") { - ui->pb80->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb80, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb80->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb80, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb80->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb80, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="60m") { - ui->pb60->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb60, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb60->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb60, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb60->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb60, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="40m") { - ui->pb40->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb40, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb40->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb40, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb40->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb40, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="30m") { - ui->pb30->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb30, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb30->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb30, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb30->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb30, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="20m") { - ui->pb20->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb20, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb20->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb20, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb20->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb20, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="17m") { - ui->pb17->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb17, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb17->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb17, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb17->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb17, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="15m") { - ui->pb15->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb15, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb15->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb15, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb15->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb15, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="12m") { - ui->pb12->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb12, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb12->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb12, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb12->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb12, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="10m") { - ui->pb10->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb10, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb10->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb10, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb10->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb10, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="6m") { - ui->pb6->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb6, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb6->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb6, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb6->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb6, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } if (band=="4m" or band=="1.25m" ) { - ui->pb2->setStyleSheet("QPushButton {background-color: #ffff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb2, "QPushButton {background-color: #ffff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (band=="2m") { - ui->pb2->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb2, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb2->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb2, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb2->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb2, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } } if (band=="23cm") { - ui->pb70->setStyleSheet("QPushButton {background-color: #ffff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb70, "QPushButton {background-color: #ffff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (band=="70cm") { - ui->pb70->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb70, "QPushButton {background-color: #00ff00; color: #000000; border: 1px solid #32414B; border-radius: 5px; padding: 3px; outline: none;}"); } else { if (m_useDarkStyle) { - ui->pb70->setStyleSheet("QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb70, "QPushButton {background-color: #505F69; border: 1px solid #32414B; color: #F0F0F0; border-radius: 4px; padding: 3px; outline: none;}"); } else { - ui->pb70->setStyleSheet("QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); + set_style_sheet_if_changed(ui->pb70, "QPushButton {background-color: #e1e1e1; border: 1px solid #adadad; border-radius: 0px; padding: 3px; outline: none;}"); } } } @@ -16785,526 +16653,62 @@ void MainWindow::check_button_color() ui->pb10G->setVisible(false); ui->pb24G->setVisible(false); } - if (ui->monitorButton->isChecked()) { - if (m_saveAll or m_saveDecoded) { - ui->monitorButton->setStyleSheet("QPushButton {background-color: #ffff00; color: #000000; border-style: outset; border-width: 1px; border-radius: 5px; border-color: black; min-width: 5em; padding: 3px;}"); - } else { - ui->monitorButton->setStyleSheet("QPushButton {background-color: #00ff00; color: #000000; border-style: outset; border-width: 1px; border-radius: 5px; border-color: black; min-width: 5em; padding: 3px;}"); - } - } else { - ui->monitorButton->setStyleSheet(""); - } + static QString const monitor_button_style { + "QPushButton {border: 1px solid palette(mid); border-radius: 5px; padding: 3px; " + "background-color: palette(button); color: palette(button-text);}" + "QPushButton[wsjtxState=\"active\"] {background-color: #00ff00; color: #000000; border-color: black;}" + "QPushButton[wsjtxState=\"saving\"] {background-color: #ffff00; color: #000000; border-color: black;}" + "QPushButton[wsjtxState=\"dark\"] {background-color: #505F69; color: #F0F0F0; border-color: #32414B;}" + "QPushButton:focus {border-color: palette(highlight);}" + "QPushButton:pressed {background-color: palette(midlight);}" + "QPushButton:disabled {color: palette(mid);}"}; + set_style_sheet_if_changed(ui->monitorButton, monitor_button_style); + set_button_style_state_if_changed(ui->monitorButton, + ui->monitorButton->isChecked() ? (m_saveAll or m_saveDecoded ? "saving" : "active") + : (m_useDarkStyle ? "dark" : "idle")); if (ui->pbBandHopping->isChecked()) { keep_last_tx_label = false; - ui->pbBandHopping->setStyleSheet("QPushButton {background-color: #ff0000; color: #ffffff; border-style: outset; border-width: 1px; border-radius: 5px; border-color: black; min-width: 5em; padding: 3px;}"); + set_style_sheet_if_changed(ui->pbBandHopping, "QPushButton {background-color: #ff0000; color: #ffffff; border-style: outset; border-width: 1px; border-radius: 5px; border-color: black; padding: 3px;}"); last_tx_label.setText(" Band Hopping On "); - last_tx_label.setStyleSheet ("QLabel{color: #ffffff; background-color: #ff0000}"); - ui->genStdMsgsPushButton->setStyleSheet("QPushButton {background-color: #ffff00; color: #000000; border-style: outset; border-width: 1px; border-radius: 5px; border-color: black; min-width: 5em; padding: 3px;}"); + set_style_sheet_if_changed(last_tx_label, "QLabel{color: #ffffff; background-color: #ff0000}"); + set_style_sheet_if_changed(ui->genStdMsgsPushButton, "QPushButton {background-color: #ffff00; color: #000000; border-style: outset; border-width: 1px; border-radius: 5px; border-color: black; padding: 3px;}"); } else { - ui->pbBandHopping->setStyleSheet (""); + set_style_sheet_if_changed(ui->pbBandHopping, ""); if (!keep_last_tx_label) last_tx_label.setText (""); - last_tx_label.setStyleSheet (""); - ui->genStdMsgsPushButton->setStyleSheet (""); + set_style_sheet_if_changed(last_tx_label, ""); + set_style_sheet_if_changed(ui->genStdMsgsPushButton, ""); } } -void MainWindow::on_pb160_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (1840000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(1837000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} - -void MainWindow::on_pb80_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (3573000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(3576000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} - -void MainWindow::on_pb60_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (5357000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(5357000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} - -void MainWindow::on_pb40_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (7074000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(7077000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} - -void MainWindow::on_pb30_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (10136000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(10139000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} - -void MainWindow::on_pb20_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (14074000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(14077000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb17_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (18100000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(18103000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb15_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (21074000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(21077000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb12_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (24915000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(24918000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb10_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (28074000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(28077000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb6_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr6); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (50313000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(50316000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb2_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr2); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (144074000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(144077000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb70_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (432074000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(432077000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb8_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (40680000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(40680000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb50_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr6); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (50313000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(50316000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb4_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr6); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (70154000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(70154000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb144_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr2); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (144074000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(144077000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb220_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (222174000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(222177000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb432_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (432174000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(432177000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb902_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (902174000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(902177000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb23_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (1296065000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(1296065000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb13_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (2304065000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(2304065000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb9_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (3400065000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(3400065000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb5G_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (5760200000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(5760200000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb10G_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (10368200000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(10368200000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} -void MainWindow::on_pb24G_clicked() -{ - if (m_mode=="MSK144") { - ui->sbTR->setValue (m_msk144_tr); - programStart = true; - QTimer::singleShot (250, [=] {programStart = false;}); - } - auto const& row = m_config.frequencies ()->best_working_frequency (24048200000); - ui->bandComboBox->setCurrentIndex (row); - if (row >= 0) { - on_bandComboBox_activated (row); - } else { - keep_frequency = true; - setRig(24048200000); - QTimer::singleShot (250, [=] {keep_frequency = false;}); - } - setXIT (ui->TxFreqSpinBox->value ()); -} + + + + + void MainWindow::read_txLog() { - static QFile logfile {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath ("wsjtx.log")}; + QFile logfile {writable_file_path (m_config.writeable_data_dir (), "wsjtx.log")}; QTextStream logstream(&logfile); if(logfile.open(QIODevice::ReadOnly | QIODevice::Text)) { while (!logstream.atEnd()) { @@ -17320,7 +16724,7 @@ void MainWindow::on_actionErase_Tx_Log_triggered() int ret = MessageBox::query_message (this, tr ("Confirm Erase"), tr ("Are you sure you want to erase the Tx Log?")); if(ret==MessageBox::Yes) { - static QFile logFile {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath ("wsjtx.log")}; + QFile logFile {writable_file_path (m_config.writeable_data_dir (), "wsjtx.log")}; logFile.remove(); txLog = ""; } @@ -17329,7 +16733,8 @@ void MainWindow::on_actionErase_Tx_Log_triggered() void MainWindow::addCallsignToignoreList() { if (m_hisCall!="") { - static QFile ignoreFile {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath ("ignore.list")}; + QFile ignoreFile {writable_file_path (m_config.writeable_data_dir (), "ignore.list")}; + ensure_parent_directory (ignoreFile.fileName ()); if(ignoreFile.open(QIODevice::Text | QIODevice::Append)) { QString ignoreEntry= (m_hisCall + ","); QTextStream out(&ignoreFile); @@ -17341,8 +16746,8 @@ void MainWindow::addCallsignToignoreList() #endif ; ignoreFile.close(); - QTimer::singleShot (2000, [=] {read_ignoreList();}); - QTimer::singleShot (7000, [=] {read_ignoreList();}); + QTimer::singleShot (2000, this, [=] {read_ignoreList();}); + QTimer::singleShot (7000, this, [=] {read_ignoreList();}); MessageBox::information_message (this, tr ("\"%1\" added to Ignore List").arg (m_hisCall)); } } @@ -17350,7 +16755,7 @@ void MainWindow::addCallsignToignoreList() void MainWindow::read_ignoreList() { - static QFile ignoreFile {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath ("ignore.list")}; + QFile ignoreFile {writable_file_path (m_config.writeable_data_dir (), "ignore.list")}; QTextStream ignoreStream(&ignoreFile); if(ignoreFile.open(QIODevice::ReadOnly | QIODevice::Text)) { while (!ignoreStream.atEnd()) { @@ -17366,7 +16771,7 @@ void MainWindow::on_actionErase_Ignore_List_triggered() int ret = MessageBox::query_message (this, tr ("Confirm Erase"), tr ("Are you sure you want to erase the Ignore List?")); if(ret==MessageBox::Yes) { - static QFile ignoreFile {QDir {QStandardPaths::writableLocation (QStandardPaths::DataLocation)}.absoluteFilePath ("ignore.list")}; + QFile ignoreFile {writable_file_path (m_config.writeable_data_dir (), "ignore.list")}; ignoreFile.remove(); ignoreList = ""; } @@ -17374,18 +16779,14 @@ void MainWindow::on_actionErase_Ignore_List_triggered() void MainWindow::read_ALLCALL7() { - // Read the shipped read-only ALLCALL7.TXT from the data dir where it installs - // (Contents/Resources/wsjtx on macOS, share/wsjtx on Linux/Windows), mirroring - // the JPLEPH idiom (m_config.data_dir()). The function-local static is built on - // the first call, after Configuration is constructed, so m_config is valid. - static QFile AllCall7File {m_config.data_dir ().absoluteFilePath ("ALLCALL7.TXT")}; + static QFile AllCall7File {m_decoderDataDir.absoluteFilePath ("ALLCALL7.TXT")}; QTextStream AllCall7Stream(&AllCall7File); if(AllCall7File.open(QIODevice::ReadOnly | QIODevice::Text)) { while (!AllCall7Stream.atEnd()) { ALLCALL7 = AllCall7Stream.readAll(); } - AllCall7Stream.flush(); - AllCall7File.close(); + AllCall7Stream.flush(); + AllCall7File.close(); } } @@ -17424,10 +16825,603 @@ void MainWindow::alertQSYmessage () audio = new QAudioOutput(format, this); connect(audio, SIGNAL(stateChanged(QAudio::State)), this, SLOT(handleStateChanged(QAudio::State))); QFile *effect1 = new QFile(this); - effect1->setFileName(app_sounds_directory () + "Message.wav"); + effect1->setFileName (app_sounds_directory ().absoluteFilePath ("Message.wav")); + effect1->open(QIODevice::ReadOnly); + audio->start(effect1); +#else + QSound::play (app_sounds_directory ().absoluteFilePath ("Message.wav")); // for Linux and macOS +#endif +} + +void MainWindow::applyExperimentalFT8Filter(const DecodedText& decodedtext, bool& filtered) +{ + DecodeOutputPlan::ExperimentalFilterContext context; + context.mode = m_mode; + context.multithreadFt8 = m_multithreadFT8; + context.reduceFalseDecodes = ui->actionReduce_false_decodes->isChecked(); + context.allCallsigns = ALLCALL7; + context.alreadyFiltered = filtered; + filtered = DecodeOutputPlan::decideExperimentalFilter(decodedtext, context).filtered; +} + +void MainWindow::processFoxSignals(const DecodedText& decodedtext) +{ + if(m_mode=="FT8" and SpecOp::FOX == m_specOp and + (decodedtext.string().contains("R+") or decodedtext.string().contains("R-"))) { + auto for_us = decodedtext.string().contains(" " + m_config.my_callsign() + " ") or + decodedtext.string().contains(" "+m_baseCall) or + decodedtext.string().contains(m_baseCall+" ") or + decodedtext.string().contains(" <" + m_config.my_callsign() + "> "); + if(decodedtext.string().contains(" DE ")) for_us=true; + if(for_us) { + QString houndCall,houndGrid; + decodedtext.deCallAndGrid(/*out*/houndCall,houndGrid); + foxRxSequencer(decodedtext.string(),houndCall,houndGrid); + } + } +} + +void MainWindow::processSFoxVerification(const DecodedText& decodedtext0, bool& filtered) +{ +#ifdef FOX_OTP + if (SpecOp::HOUND == m_specOp) + { + // Payload formats (from column 24 onward): + // Standard: CALL.OTP e.g. "K8R.920749" + // SuperFox: $VERIFY$ CALL OTP e.g. "$VERIFY$ VP2X/K1JT 920749" + // Callsigns may include '/' and decoder output may contain variable spacing. + static const QRegularExpression stdPayloadRe{ + QStringLiteral("^([A-Z0-9]{2,6})\\.([0-9]{6})$")}; + static const QRegularExpression verifyPayloadRe{ + QStringLiteral("^\\$VERIFY\\$\\s+([A-Z0-9/]{2,13})\\s+([0-9]{6})$")}; + + QString const payload = decodedtext0.mid(24, -1).trimmed(); + QString callsign, otp; + unsigned int hz = 0; + + QRegularExpressionMatch payloadMatch = stdPayloadRe.match(payload); + if (payloadMatch.hasMatch()) { + callsign = payloadMatch.captured(1); + otp = payloadMatch.captured(2); + hz = static_cast(decodedtext0.frequencyOffset()); + } else if (m_config.superFox() && + (payloadMatch = verifyPayloadRe.match(payload)).hasMatch()) { + callsign = payloadMatch.captured(1); + otp = payloadMatch.captured(2); + hz = 750; + } + + if (!callsign.isEmpty()) { + if (!m_config.ShowOTP() || otp == QLatin1String("000000")) + filtered = true; + + QDateTime verifyDateTime; + if (m_diskData) { + verifyDateTime = m_UTCdiskDateTime; + } else { + verifyDateTime = QDateTime(QDateTime::currentDateTimeUtc().date(), + QTime::fromString(decodedtext0.left(6), "hhmmss")); + } + if (otp != QLatin1String("000000")) { + FoxVerifier *fv = new FoxVerifier(http_user_agent (), + &m_network_manager, + m_config.OTPUrl(), + callsign, + verifyDateTime, + otp, + hz); + connect(fv, &FoxVerifier::verifyComplete, this, &MainWindow::handleVerifyMsg); + m_verifications << fv; + } + } + } +#endif +} + +DecodedMessageReaction::ReactionDisposition MainWindow::processWaitReplyCall( + DecodedText const& message, DecodedMessageReaction::WaitDecodeSource source, + bool * block_right_display) +{ + if (m_hisCall.isEmpty()) return DecodedMessageReaction::ReactionDisposition::NoReaction; + + bool const waitFeaturesEnabled = m_config.Wait_features_enabled(); + WaitFeatureContext const waitContext { + m_mode, + m_specOp, + waitFeaturesEnabled, + ui->cbAutoSeq->isChecked(), + !m_hisCall.isEmpty(), + m_config.NCCC_Sprint() + }; + bool eligible = false; + if (source == DecodedMessageReaction::WaitDecodeSource::SlowDecoder) { + bool const slowMode = slow_wait_feature_mode_supported (m_mode); + bool const nccc = nccc_sprint_auto_reply (waitContext); + bool const waitReply = waitFeaturesEnabled && !ui->autoButton->isChecked(); + bool const waitCall = wait_and_call && wait_and_call_arming_eligible (waitContext) + && !no_wait_and_call; + eligible = slowMode && (nccc || waitReply || waitCall); + } else { + bool const waitReply = waitFeaturesEnabled && !ui->autoButton->isChecked(); + bool const waitCall = wait_and_call && wait_and_call_arming_eligible (waitContext); + eligible = m_mode == "MSK144" + && (waitReply || waitCall || ui->DX_Call_Button->isChecked()); + } + if (!eligible) return DecodedMessageReaction::ReactionDisposition::NoReaction; + + auto const plan = DecodedMessageReaction::planWaitReplyCall( + message, qsoReactionSnapshot(), source); + applyQsoReactionPlan(plan, message, block_right_display); + return plan.disposition; +} +bool MainWindow::applyFiltering(const DecodedText& decodedtext, bool& filtered) +{ + DecodeOutputPlan::KeywordFilterContext keywordContext; + keywordContext.mode = m_mode; + keywordContext.specOp = m_specOp; + keywordContext.alreadyFiltered = filtered; + keywordContext.filterBySecondWord = m_config.filters_for_word2(); + keywordContext.alwaysPass = m_config.AlwaysPass(); + keywordContext.passKeywords = m_config.pass_keywords(); + keywordContext.blacklistEnabled = m_config.Blacklisted(); + keywordContext.blacklistKeywords = m_config.blacklist_keywords(); + keywordContext.whitelistEnabled = m_config.Whitelisted(); + keywordContext.whitelistKeywords = m_config.whitelist_keywords(); + keywordContext.waitAndPounceOnly = m_config.filters_for_Wait_and_Pounce_only(); + keywordContext.bypass = ui->cbBypass->isChecked(); + keywordContext.pounce = pounce; + keywordContext.respondPolicy = autoRespondPolicy (); + auto const keywordDecision = DecodeOutputPlan::decideKeywordFilter(decodedtext, keywordContext); + filtered = keywordDecision.filtered; + if (keywordDecision.resetPounceScores) m_autoRespondScores.reset(); + if (!keywordDecision.continueProcessing) return false; + + DecodeOutputPlan::VisibilityFilterContext visibilityContext; + visibilityContext.alreadyFiltered = filtered; + visibilityContext.alwaysPassed = keywordDecision.alwaysPassed; + visibilityContext.bypass = keywordContext.bypass; + visibilityContext.hideTerritory1 = ui->actionHideTerritory1->isChecked(); + visibilityContext.hideTerritory2 = ui->actionHideTerritory2->isChecked(); + visibilityContext.hideTerritory3 = ui->actionHideTerritory3->isChecked(); + visibilityContext.hideTerritory4 = ui->actionHideTerritory4->isChecked(); + visibilityContext.territory1 = m_config.Territory1(); + visibilityContext.territory2 = m_config.Territory2(); + visibilityContext.territory3 = m_config.Territory3(); + visibilityContext.territory4 = m_config.Territory4(); + visibilityContext.hideWorkedBefore = ui->actionHideB4->isChecked(); + visibilityContext.hideEurope = ui->actionHideEU->isChecked(); + visibilityContext.hideAsia = ui->actionHideAS->isChecked(); + visibilityContext.hideNorthAmerica = ui->actionHideNA->isChecked(); + visibilityContext.hideSouthAmerica = ui->actionHideSA->isChecked(); + visibilityContext.hideAfrica = ui->actionHideAF->isChecked(); + visibilityContext.hideOceania = ui->actionHideOC->isChecked(); + visibilityContext.hideAntarctica = ui->actionHideAN->isChecked(); + visibilityContext.hideIgnored = ui->actionHideIgnored->isChecked(); + visibilityContext.ignoreList = ignoreList; + visibilityContext.hideWorkedToday = ui->actionHideToday->isChecked(); + visibilityContext.includeYesterday = m_config.twoDays(); + visibilityContext.txLog = txLog; + if (visibilityContext.hideWorkedToday) { + visibilityContext.today = QDateTime::currentDateTimeUtc().toString("yyyy-MM-dd"); + visibilityContext.yesterday = QDateTime::currentDateTimeUtc().addDays(-1).toString("yyyy-MM-dd"); + } + visibilityContext.countryName = [this] (QString const& deCall) { + return m_logBook.countries()->lookup(deCall).abbreviated_entity_name; + }; + visibilityContext.continent = [this] (QString const& deCall) { + return AD1CCty::continent(m_logBook.countries()->lookup(deCall).continent); + }; + visibilityContext.workedBeforeOnBand = [this] (QString const& deCall, QString const& deGrid) { + bool callWorked {false}; + bool countryWorked; + bool gridWorked; + bool continentWorked; + bool cqZoneWorked; + bool ituZoneWorked; + auto const& lookedUp = m_logBook.countries()->lookup(deCall); + m_logBook.match(deCall, m_mode, deGrid, lookedUp, callWorked, countryWorked, + gridWorked, continentWorked, cqZoneWorked, ituZoneWorked, m_currentBand); + return callWorked; + }; + filtered = DecodeOutputPlan::decideVisibilityFilter(decodedtext, visibilityContext).filtered; + return true; +} + +void MainWindow::applyHighlighting(const DecodedText& decodedtext, DisplayText * decodePane, bool updateAlertState, + bool& play_Wanted, bool& play_DXcall) +{ + if (!decodePane) return; + + QString text = decodedtext.string().replace("<","").replace(">",""); + if(ui->actionHighlightB4->isChecked() or ui->actionHighlightToday->isChecked() or ui->actionHighlightIgnored->isChecked() + or ui->actionHighlightTerritory1->isChecked() or ui->actionHighlightTerritory2->isChecked() + or ui->actionHighlightTerritory3->isChecked() or ui->actionHighlightTerritory4->isChecked()) { + QString today = QDateTime::currentDateTimeUtc().toString ("yyyy-MM-dd"); + QString yesterday = QDateTime::currentDateTimeUtc().addDays(-1).toString ("yyyy-MM-dd"); + QString deCall; + QString deGrid; + decodedtext.deCallAndGrid(/*out*/deCall,deGrid); + bool callB4onBand; + bool countryB4onBand; + bool gridB4onBand; + bool continentB4onBand; + bool CQZoneB4onBand; + bool ITUZoneB4onBand; + if (ui->actionHighlightB4->isChecked()) { + auto const& looked_up = m_logBook.countries ()->lookup (deCall); + m_logBook.match (deCall, m_mode, deGrid, looked_up, callB4onBand, countryB4onBand, gridB4onBand, + continentB4onBand, CQZoneB4onBand, ITUZoneB4onBand, m_currentBand); + if (callB4onBand) decodePane->highlight_callsign(deCall, QColor(195,195,195), QColor(0,0,0), true); + } + if (ui->actionHighlightToday->isChecked() && ( + txLog.contains(QRegularExpression{today + ",[0-9][0-9]:[0-9][0-9]:[0-9][0-9]," + (deCall + ",")}) + or (m_config.twoDays() && txLog.contains(QRegularExpression{yesterday + ",[0-9][0-9]:[0-9][0-9]:[0-9][0-9]," + (deCall + ",")})))) { + decodePane->highlight_callsign(deCall, QColor(100,100,100), QColor(255,255,0), true); + } + if (ui->actionHighlightIgnored->isChecked() && ignoreList.contains(deCall + ",")) { + decodePane->highlight_callsign(deCall, QColor(85,0,0), QColor(255,255,0), true); + } + if (ui->actionHighlightTerritory1->isChecked() or ui->actionHighlightTerritory2->isChecked() or + ui->actionHighlightTerritory3->isChecked() or ui->actionHighlightTerritory4->isChecked()) { + auto const& looked_up = m_logBook.countries ()->lookup (deCall); + auto countryName = looked_up.abbreviated_entity_name; + if (ui->actionHighlightTerritory1->isChecked() && countryName.contains(m_config.Territory1()) + && (m_config.Territory1()!="") && !ui->cbBypass->isChecked()) decodePane->highlight_callsign(deCall, QColor(115,43,245), QColor(255,255,255), true); + if (ui->actionHighlightTerritory2->isChecked() && countryName.contains(m_config.Territory2()) + && (m_config.Territory2()!="") && !ui->cbBypass->isChecked()) decodePane->highlight_callsign(deCall, QColor(115,43,245), QColor(255,255,255), true); + if (ui->actionHighlightTerritory3->isChecked() && countryName.contains(m_config.Territory3()) + && (m_config.Territory3()!="") && !ui->cbBypass->isChecked()) decodePane->highlight_callsign(deCall, QColor(115,43,245), QColor(255,255,255), true); + if (ui->actionHighlightTerritory4->isChecked() && countryName.contains(m_config.Territory4()) + && (m_config.Territory4()!="") && !ui->cbBypass->isChecked()) decodePane->highlight_callsign(deCall, QColor(115,43,245), QColor(255,255,255), true); + } + } + + // highlight orange and blue callsigns + if (m_config.highlight_orange() or (m_config.highlight_blue()) or ui->actionHighlight_Whitelist_entries->isChecked()) { + QString deCall; + QString deGrid; + decodedtext.deCallAndGrid(/*out*/deCall,deGrid); + if (m_config.highlight_orange() && deCall.size()>2 + && HighlightingRules::matchesCallsignPrefix(m_config.highlight_orange_callsigns(), deCall)) { + decodePane->highlight_callsign(deCall, QColor(225,75,0), QColor(255,255,255), true); + if (updateAlertState && m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted) play_Wanted = true; + } + if (m_config.highlight_orange() && deGrid.size()>3 && m_config.highlight_orange_callsigns().contains(deGrid)) { + decodePane->highlight_callsign(deGrid, QColor(225,75,0), QColor(255,255,255), true); + if (updateAlertState && m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted) play_Wanted = true; + } + if (m_config.highlight_blue() && deCall.size()>2 + && HighlightingRules::matchesCallsignPrefix(m_config.highlight_blue_callsigns(), deCall)) { + decodePane->highlight_callsign(deCall, QColor(0,100,255), QColor(255,255,255), true); + if (updateAlertState && m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted) play_Wanted = true; + } + if (m_config.highlight_blue() && deGrid.size()>3 && m_config.highlight_blue_callsigns().contains(deGrid)) { + decodePane->highlight_callsign(deGrid, QColor(0,100,255), QColor(255,255,255), true); + if (updateAlertState && m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted) play_Wanted = true; + } + // highlight directional calls + QStringList tw; + if (m_mode == "FT8" or m_mode == "FT4" or m_mode == "Q65" or m_mode == "FST4") { + tw=text.mid(24).split(" ",SkipEmptyParts); + } else { + tw=text.mid(22).split(" ",SkipEmptyParts); + } + if (tw.size() > 2) { + if (m_config.highlight_orange() && tw[0]=="CQ" + && HighlightingRules::matchesDirectionalCall(m_config.highlight_orange_callsigns(), tw[1])) { + decodePane->highlight_callsign(tw[1], QColor(225,75,0), QColor(255,255,255), true); + if (updateAlertState && m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted && tw[1]!="") play_Wanted = true; + } + if (m_config.highlight_blue() && tw[0]=="CQ" + && HighlightingRules::matchesDirectionalCall(m_config.highlight_blue_callsigns(), tw[1])) { + decodePane->highlight_callsign(tw[1], QColor(0,100,255), QColor(255,255,255), true); + if (updateAlertState && m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted && tw[1]!="") play_Wanted = true; + } + } + // highlight Whitelist entries + if (ui->actionHighlight_Whitelist_entries->isChecked() && deCall.size()>2 && + MessageFilter::containsAny(deCall, m_config.whitelist_keywords())) { + decodePane->highlight_callsign(deCall, QColor(170,0,127), QColor(255,255,255), true); + if (updateAlertState && m_config.alert_Enabled() && m_config.alert_Wanted() && !m_muted) play_Wanted = true; + } + } + + // Highlight DX Call/Grid + if (!pounce && (m_config.highlight_DXcall() or (updateAlertState && m_config.alert_Enabled())) && (m_hisCall != "") && + ((decodedtext.string().contains(QRegularExpression{"(\\w+) " + m_hisCall})) + || (decodedtext.string().contains(QRegularExpression{"(\\w+) <" + m_hisCall + ">"})) + || (decodedtext.string().contains(QRegularExpression{"<(\\w+)> " + m_hisCall})) + || (decodedtext.string().contains(QRegularExpression{"<...> " + m_hisCall})))) { + if (updateAlertState && m_config.alert_Enabled() && m_config.alert_DXcall() && !m_muted) play_DXcall = true; + if (m_config.highlight_DXcall()) { + decodePane->highlight_callsign(m_hisCall, QColor(255,0,0), QColor(255,255,255), true); + if (updateAlertState) { + auto pane = QPointer {decodePane}; + auto call = m_hisCall; + // Repeated highlighting keeps the Band Activity marking visible when external clients update it. + QTimer::singleShot (500, this, [pane, call] {if (pane) pane->highlight_callsign(call, QColor(255,0,0), QColor(255,255,255), true);}); + QTimer::singleShot (1000, this, [pane, call] {if (pane) pane->highlight_callsign(call, QColor(255,0,0), QColor(255,255,255), true);}); + QTimer::singleShot (2500, this, [pane, call] {if (pane) pane->highlight_callsign(call, QColor(255,0,0), QColor(255,255,255), true);}); + } + } + } + if (!pounce && (m_config.highlight_DXgrid () or (updateAlertState && m_config.alert_Enabled())) && (m_hisGrid!="") && + (decodedtext.string().contains(m_hisGrid.left(4)))) { + if (m_config.highlight_DXgrid()) decodePane->highlight_callsign(m_hisGrid.left(4), QColor(0,0,200), QColor(255,255,255), true); + if (updateAlertState && m_config.alert_Enabled() && m_config.alert_DXcall() && !m_muted) play_DXcall = true; + } +} + +void MainWindow::playDecodeAlertSound(bool play_Wanted, bool play_DXcall) +{ + QTimer::singleShot (100, this, [this, play_Wanted, play_DXcall] { + auto const sound = selectDecodeAlertSound(m_config.alert_Enabled(), m_config.alert_DXcall(), m_config.alert_Wanted(), + play_Wanted, play_DXcall, !m_hisCall.isEmpty()); + playDecodeAlertSound(sound); + }); +} + +void MainWindow::playDecodeAlertSound(DecodeAlertSound sound) +{ + if (sound == DecodeAlertSound::None) return; + +#ifdef WIN32 + QAudioOutput info(QAudioDeviceInfo::defaultOutputDevice()); + QString audioPath = m_config.voice_directory ().absolutePath (); + QAudioFormat format; + format.setCodec("audio/pcm"); + format.setSampleRate (48000); + format.setChannelCount (1); + format.setSampleSize (16); + format.setSampleType(QAudioFormat::SignedInt); + QAudioOutput* audio; + audio = new QAudioOutput(format, this); + connect(audio, SIGNAL(stateChanged(QAudio::State)), this, SLOT(handleStateChanged(QAudio::State))); + QFile *effect1 = new QFile(this); + if (sound == DecodeAlertSound::DXcall) effect1->setFileName(QString("%1/%2").arg(audioPath, "DXcall.wav")); + else if (sound == DecodeAlertSound::Wanted) effect1->setFileName(QString("%1/%2").arg(audioPath, "Wanted.wav")); effect1->open(QIODevice::ReadOnly); audio->start(effect1); #else - QSound::play(app_sounds_directory () + "Message.wav"); // for Linux and macOS + if (sound == DecodeAlertSound::DXcall) QSound::play (m_config.voice_directory ().absoluteFilePath ("DXcall.wav")); // for Linux and macOS + else if (sound == DecodeAlertSound::Wanted) QSound::play (m_config.voice_directory ().absoluteFilePath ("Wanted.wav")); // for Linux and macOS +#endif +} + +MainWindow::DecodeAlertSound MainWindow::selectDecodeAlertSound(bool alertsEnabled, bool dxCallAlertEnabled, + bool wantedAlertEnabled, bool play_Wanted, + bool play_DXcall, bool hasDXCall) +{ + if (!alertsEnabled) return DecodeAlertSound::None; + if (dxCallAlertEnabled && play_DXcall && hasDXCall) return DecodeAlertSound::DXcall; + if (wantedAlertEnabled && play_Wanted) return DecodeAlertSound::Wanted; + return DecodeAlertSound::None; +} + +void MainWindow::updateRespondTarget(const DecodedText& decodedtext, const QString& text, bool pounce, + QDateTime const& decodePeriodStart, bool diskData) +{ + bool const fullDuplexBlocked = ui->actionFull_Duplex_Mode->isChecked() && m_txing; + bool const currentPeriodCaller = !diskData + && !filtered + && !ignored + && !fullDuplexBlocked + && m_autoRespondPeriodState.accepts(decodePeriodStart) + && isDirectAutoRespondCandidate(decodedtext, m_config.my_callsign()); + auto const periodPolicy = m_autoRespondPeriodState.policy(); + auto const pouncePolicy = autoRespondPolicy (); + bool const pounceCq = pounce + && text.contains(" CQ ") + && m_config.Wait_features_enabled(); + + bool const selectPounceFirst = pounceCq + && !filtered + && !ignored + && !fullDuplexBlocked + && !m_autoRespondSelectionLatch.isSelected() + && ui->respondComboBox->isVisible() + && pouncePolicy == AutoRespondPolicy::First; + bool const selectCurrentFirst = currentPeriodCaller + && AutoRespondPolicy::First == periodPolicy + && m_autoRespondPeriodState.claimFirst(decodePeriodStart); + if (selectPounceFirst || selectCurrentFirst) { + m_bDoubleClicked=true; + if (selectPounceFirst) m_autoRespondSelectionLatch.selectFor(); + auto_tx_mode(true); + processSyntheticMessage(decodedtext); + auto now = QDateTime::currentDateTimeUtc(); + m_dateTimeQSOOn = now.addSecs (-(m_ntx - 1) * int(m_TRperiod) - int(fmod(double(now.time().second()),m_TRperiod))); + if (pounce) stopWCTimer.start(int(6200.0*m_TRperiod)); + } + + QString deCall; + QString deGrid; + decodedtext.deCallAndGrid(/*out*/deCall,deGrid); + + bool const selectPounceDistance = pounceCq + && !filtered + && !ignored + && !fullDuplexBlocked + && !txLog.contains(deCall) + && deGrid.contains(MainWindow::grid_regexp) + && ui->respondComboBox->isVisible() + && pouncePolicy == AutoRespondPolicy::MaxDistance; + bool const selectCurrentDistance = currentPeriodCaller + && AutoRespondPolicy::MaxDistance == periodPolicy; + if (selectPounceDistance || selectCurrentDistance) { + double utch=0.0; + int nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter; + azdist_(const_cast ((m_config.my_grid () + " ").left (6).toLatin1().constData()), + const_cast ((deGrid + " ").left (6).toLatin1().constData()),&utch, + &nAz,&nEl,&nDmiles,&nDkm,&nHotAz,&nHotABetter,6,6); + int distancePoints=nDkm; + if (!deGrid.contains(MainWindow::grid_regexp)) distancePoints=1; + if(m_autoRespondScores.considerDistance(distancePoints)) { + m_deCall=deCall; + m_bDoubleClicked=true; + auto_tx_mode(true); + processSyntheticMessage(decodedtext); + if (pounce) stopWCTimer.start(int(6200.0*m_TRperiod)); + ui->dxCallEntry->setText(deCall); + genStdMsgs(QString::number(decodedtext.snr())); + ui->RxFreqSpinBox->setValue(decodedtext.frequencyOffset()); + setTxMsg(m_ntx); + m_currentMessageType=m_ntx; + auto now = QDateTime::currentDateTimeUtc(); + m_dateTimeQSOOn = now.addSecs (-(m_ntx - 1) * int(m_TRperiod) - int(fmod(double(now.time().second()),m_TRperiod))); + } + } + + bool const selectPounceMaximum = pounceCq + && !filtered + && !ignored + && !fullDuplexBlocked + && !txLog.contains(deCall) + && ui->respondComboBox->isVisible() + && pouncePolicy == AutoRespondPolicy::MaxSignal; + bool const selectCurrentMaximum = currentPeriodCaller + && AutoRespondPolicy::MaxSignal == periodPolicy; + if ((selectPounceMaximum || selectCurrentMaximum) + && m_autoRespondScores.considerMaximumDb(decodedtext.snr())) { + m_deCall=deCall; + m_bDoubleClicked=true; + auto_tx_mode(true); + processSyntheticMessage(decodedtext); + if (pounce) stopWCTimer.start(int(6200.0*m_TRperiod)); + ui->dxCallEntry->setText(deCall); + genStdMsgs(QString::number(decodedtext.snr())); + ui->RxFreqSpinBox->setValue(decodedtext.frequencyOffset()); + setTxMsg(m_ntx); + m_currentMessageType=m_ntx; + auto now = QDateTime::currentDateTimeUtc(); + m_dateTimeQSOOn = now.addSecs (-(m_ntx - 1) * int(m_TRperiod) - int(fmod(double(now.time().second()),m_TRperiod))); + } + + bool const selectPounceMinimum = pounceCq + && !filtered + && !ignored + && !fullDuplexBlocked + && !txLog.contains(deCall) + && ui->respondComboBox->isVisible() + && pouncePolicy == AutoRespondPolicy::MinSignal; + bool const selectCurrentMinimum = currentPeriodCaller + && AutoRespondPolicy::MinSignal == periodPolicy; + if ((selectPounceMinimum || selectCurrentMinimum) + && m_autoRespondScores.considerMinimumDb(decodedtext.snr())) { + m_deCall=deCall; + m_bDoubleClicked=true; + auto_tx_mode(true); + processSyntheticMessage(decodedtext); + if (pounce) stopWCTimer.start(int(6200.0*m_TRperiod)); + ui->dxCallEntry->setText(deCall); + genStdMsgs(QString::number(decodedtext.snr())); + ui->RxFreqSpinBox->setValue(decodedtext.frequencyOffset()); + setTxMsg(m_ntx); + m_currentMessageType=m_ntx; + auto now = QDateTime::currentDateTimeUtc(); + m_dateTimeQSOOn = now.addSecs (-(m_ntx - 1) * int(m_TRperiod) - int(fmod(double(now.time().second()),m_TRperiod))); + } +} + +void MainWindow::processSuperHoundVerification(const DecodedText& decodedtext0) +{ + if (isHoundOperation () && decodedtext0.mid(3,18).contains(" verified")) { + m_houndVerified = true; + write_all("Vf",decodedtext0.string()); + } else { +#ifndef FOX_OTP + if (isSuperHoundOperation () && (decodedtext0.mid(4,2).contains("00") or decodedtext0.mid(4,2).contains("30"))) m_houndVerified = false; #endif + } + updateHoundVerificationStyle (); +} + +QString MainWindow::calculateDistanceAndBearing(const DecodedText& decodedtext) +{ + QString distance; + QString deCall; + QString deGrid; + decodedtext.deCallAndGrid(deCall,deGrid); + if ((m_config.showDistance() || m_config.showAzimuth()) && deGrid.contains(MainWindow::grid_regexp)) { + double utch=0.0; + int nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter; + QString my_Grid = m_config.my_grid(); + if (my_Grid.length() < 5) my_Grid = m_config.my_grid().left(4)+"mm"; + QString de_Grid= deGrid.left(4)+"mm"; + azdist_(const_cast (my_Grid.toLatin1().constData()), + const_cast (de_Grid.toLatin1().constData()),&utch, + &nAz,&nEl,&nDmiles,&nDkm,&nHotAz,&nHotABetter,(FCL)6,(FCL)6); + if (m_config.showDistance()) { + int nd=nDkm; + if(m_config.miles()) nd=nDmiles; + distance = QString::number(nd); + if(m_config.miles()) distance += " mi"; + if(!m_config.miles()) distance += " km"; + } + if (m_config.showAzimuth()) { + if (distance.length()) distance += " / "; + distance += QString::number(nAz) + "°"; + } + } + return distance; +} + +void MainWindow::displayDecodedTextLine(const DecodedText& decodedtext, const QByteArray& line_read, const QString& distance, bool haveFSpread, float fSpread, bool bDisplayPoints) +{ + bool displayed; + if ((m_mode == "JT65" or m_mode == "JT9" or m_mode == "JT4") && m_config.DXCC()) { + DecodedText decodedtextJT {((QString::fromUtf8(line_read.left(44).constData())) + (QString::fromUtf8(line_read.mid(62, 2).constData())))}; + displayed = ui->decodedTextBrowser->displayDecodedText ( + decodedtextJT, m_config.my_callsign (), m_mode, m_config.DXCC (), + m_logBook, m_currentBandPeriod, m_config.ppfx (), + ui->cbCQonly->isVisible() && ui->cbCQonly->isChecked(), + haveFSpread, fSpread, bDisplayPoints, m_points, distance, m_muted); + } else { + if (ui->actionHide_AP_info->isVisible() && ui->actionHide_AP_info->isChecked()) { + // Hide FT8 AP information + QByteArray line = line_read; + DecodedText decodedtext2 {(QString::fromUtf8(line.replace("a1","").replace("a2","").replace("a3","").replace("a4","") + .replace("a5","").replace("a6","").replace("a7","").replace("a8","").replace("a9","").replace("?","")))}; + displayed = ui->decodedTextBrowser->displayDecodedText ( + decodedtext2, m_config.my_callsign (), m_mode, m_config.DXCC (), + m_logBook, m_currentBandPeriod, m_config.ppfx (), + ui->cbCQonly->isVisible() && ui->cbCQonly->isChecked(), + haveFSpread, fSpread, bDisplayPoints, m_points, distance, m_muted); + } else { + displayed = ui->decodedTextBrowser->displayDecodedText ( + decodedtext, m_config.my_callsign (), m_mode, m_config.DXCC (), + m_logBook, m_currentBandPeriod, m_config.ppfx (), + ui->cbCQonly->isVisible() && ui->cbCQonly->isChecked(), + haveFSpread, fSpread, bDisplayPoints, m_points, distance, m_muted); + } + } + if (displayed) + { + Q_EMIT decodedMessageDisplayed (decodedtext.message ().simplified ()); + } +} + +void MainWindow::set_mode_from_command_line(const QString& mode, bool lock_mode) +{ + QString m = mode.toLower(); + if (m == "ft8") { + on_actionFT8_triggered(); + } else if (m == "ft4") { + on_actionFT4_triggered(); + } else if (m == "jtty") { + on_actionJTTY_triggered(); + } else { + LOG_INFO("Invalid or unsupported mode specified via command line: " << mode); + } + + if (lock_mode) { + m_modeLocked = true; + ui->menuMode->setEnabled(false); + ui->ft8Button->setEnabled(false); + ui->ft4Button->setEnabled(false); + ui->msk144Button->setEnabled(false); + ui->q65Button->setEnabled(false); + ui->jt65Button->setEnabled(false); + ui->houndButton->setEnabled(false); + } } diff --git a/widgets/mainwindow.h b/widgets/mainwindow.h index 7aee7db6..fdc0d444 100644 --- a/widgets/mainwindow.h +++ b/widgets/mainwindow.h @@ -12,31 +12,51 @@ #include #include #include +#include +#include +#include +#include #include #include #include #include #include -#include #include #include #include #include +#include #include #include +#include #include #include +#include #include #include +#include +#include +#include + +class QHBoxLayout; #include "MultiGeometryWidget.hpp" #include "NonInheritingProcess.hpp" #include "Audio/AudioDevice.hpp" +#include "Audio/TxIdentity.hpp" +#include "Audio/TxPlaybackDiagnostics.hpp" +#include "Audio/TxPlaybackEvidence.hpp" +#include "Audio/TxRequest.hpp" +#include "Audio/WavLoadCoordinator.hpp" #include "commons.h" +#include "FastDecode.hpp" +#include "ReferenceSpectrum.hpp" #include "Radio.hpp" +#include "OperatingFrequency.hpp" #include "models/Modes.hpp" #include "models/FrequencyList.hpp" #include "Configuration.hpp" +#include "JttyN1mmOutput.hpp" #include "WSPR/WSPRBandHopping.hpp" #include "Transceiver/Transceiver.hpp" #include "DisplayManual.hpp" @@ -44,11 +64,24 @@ #include "Network/Cloudlog.hpp" #include "logbook/logbook.h" #include "astro.h" +#include "qtextbrowser.h" #include "widgets/QSYMessageCreator.h" #include "widgets/QSYMessage.h" +#include "widgets/displaytext.h" #include "widgets/qsymonitor.h" #include "MessageBox.hpp" #include "Network/NetworkAccessManager.hpp" +#include "AutoRespondSelectionLatch.hpp" +#include "AutoRespondScoring.hpp" +#include "AutoRespondPeriod.hpp" +#include "HoundTransmissionPolicy.hpp" +#include "JttyDraftAcceptanceTracker.hpp" +#include "QsoProgress.hpp" +#include "DecodeOperatingContext.hpp" +#include "DecoderOutputFramer.hpp" +#include "Ft8MtdDecodeCoordinator.hpp" +#include "RigFrequencyChangePolicy.hpp" +#include "BeaconTxController.hpp" #define NUM_JT4_SYMBOLS 206 //(72+31)*2, embedded sync #define NUM_JT65_SYMBOLS 126 //63 data + 63 sync @@ -74,7 +107,15 @@ namespace Ui { class MainWindow; } +class QWidget; +class QRadioButton; +struct QMapDecodeRecord; +class QFocusFrame; +class QFrame; +class QButtonGroup; + class QProcessEnvironment; +class QPaintEvent; class QSharedMemory; class QSplashScreen; class QSettings; @@ -99,14 +140,32 @@ class EQSL; class WSPRNet; class SoundOutput; class Modulator; -class SoundInput; +class AudioInputSource; class Detector; class SampleDownloader; class MultiSettings; + +namespace DecodedMessageReaction +{ + enum class ContestHint; + enum class ReactionDisposition; + enum class SelectionOrigin; + enum class WaitDecodeSource; + struct QsoReactionEffect; + struct QsoReactionPlan; + struct QsoReactionSnapshot; +} class EqualizationToolsDialog; class DecodedText; class Cloudlog; +#include "Audio/TxAudioQueue.hpp" +#include "Modulator/JttyTxStream.hpp" + +#ifdef WIN32 +class MMTTYIF; +#endif + class MainWindow : public MultiGeometryWidget<3, QMainWindow> { @@ -118,28 +177,128 @@ public: using Mode = Modes::Mode; using SpecOp = Configuration::SpecialOperatingActivity; + enum class JttyTxRejectReason + { + Empty, + EncodingFailed, + QueueFull, + BackendRejected, + Aborted, + NotAvailable + }; + Q_ENUM(JttyTxRejectReason) + + static QRegExp const message_alphabet; + static QRegularExpression const grid_regexp; + static QRegularExpression const non_r_db_regexp; + explicit MainWindow(QDir const& temp_directory, bool multiple, MultiSettings *, QSharedMemory *shdmem, unsigned downSampleFactor, - QSplashScreen *, QProcessEnvironment const&, + QSplashScreen *, QProcessEnvironment const&, bool automated_test, + QString base_style_sheet, + std::unique_ptr audio_input_source = {}, + std::unique_ptr sound_output = {}, + QString decoder_data_path = {}, QWidget *parent = nullptr); ~MainWindow(); - int decoderBusy () const {return m_decoderBusy;} +#ifdef WIN32 + void initMMTTY(quint16 port); + MMTTYIF *getMmttyIf() const; +#endif + + bool decoderBusy () const + {return m_fastDecodePending || DecodeOwner::None != m_decodeOwner || m_ft8MtdDecodeCoordinator.hasPending ();} + void set_mode_from_command_line(const QString& mode, bool lock_mode = false); + bool decoderBackendRunning () const; + bool diskDataActive () const {return m_diskData;} + bool monitoringActive () const {return m_monitoring;} +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) + struct LiveAudioTestFt8TransmitRequest + { + qint64 session_id {-1}; + qint64 generation {-1}; + }; + + bool liveAudioTestMultithreadedFt8Enabled () const {return m_multithreadFT8;} + int liveAudioTestFt8ThreadCount () const {return m_ft8threads;} + int liveAudioTestDecodeDepth () const {return m_ndepth & 7;} + int liveAudioTestFt8Cycles () const {return m_nFT8Cycles;} + int liveAudioTestFt8Sensitivity () const {return m_ft8Sensitivity;} + int liveAudioTestFt8DecoderStart () const {return m_ft8DecoderStart;} + QString liveAudioTestFt8BackpressureDiagnostics () const; + static constexpr int liveAudioTestDecodeLowFrequency () {return 200;} + static constexpr int liveAudioTestDecodeHighFrequency () {return 3000;} + bool configureLiveAudioTestDecodeRange (); + bool prepareLiveAudioTestFt8InputCompletion (); + QString completeLiveAudioTestFt8Input (qint64 frames); + bool configureLiveAudioTestHandoff (); + quint64 liveAudioTestPublishedDecoderGeneration () const + { + return m_automated_test && DecodeOwner::Jt9 == m_decodeOwner + && m_activeJt9Decode.generation == m_nextDecoderGeneration + ? m_activeJt9Decode.generation : 0; + } + quint64 liveAudioTestDecodeCycleGeneration () const {return m_decodeCycleGeneration;} + quint64 liveAudioTestReceiveEpoch () const {return m_receiveConsumer.epoch ();} + bool liveAudioTestReceivingAudio () const {return m_receivingAudio;} + LiveAudioTestFt8TransmitRequest startLiveAudioTestFt8Transmit ( + qint64 targetPeriodStartMs); +#endif -public slots: + Q_SIGNALS: + void decoderBackendStarted () const; + void decoderBackendFailed (QString reason) const; + void decodeCycleStarted (quint64 generation) const; + void decodeCycleCompleted (quint64 generation) const; + void decodeCycleAborted (quint64 generation) const; +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) + void ft8DecoderInvocation (bool multithreaded, int threadCount, int depth, + int cycles, bool subpass, int decoderStart, + int halfSymbols, int sampleCount, + int lowFrequency, int highFrequency) const; + void decoderOutputLine (QByteArray line) const; + void liveAudioTestJttyFramesConsumed (qint64 frames) const; + void liveAudioTestReceiveRejected (qint64 notifiedFrames) const; + void liveAudioTestReceiveRange (quint64 epoch, int start, int end, bool accepted) const; + void liveAudioTestReceiveBlock (ReceiveAudio block) const; + void liveAudioTestReceiveCallback (qint64 notifiedFrames, + qint64 currentFrames, + qint16 observedLastSample) const; + void liveAudioTestFt8TransmitStartDecided (qint64 sessionId, + qint64 generation, + qint64 targetPeriodStartMs, + bool accepted, + qint64 actualStartMs) const; +#endif + void decodedMessageProcessed (QString message) const; + void decodedMessageDisplayed (QString message) const; + void jttyTextAccepted(qint64 requestId) const; + void jttyTextRejected(qint64 requestId, JttyTxRejectReason reason) const; + void jttyTextCompleted(qint64 requestId) const; + void jttySessionDrained(qint64 sessionId) const; + + public slots: void showSoundInError(const QString& errorMsg); void showSoundOutError(const QString& errorMsg); void showStatusMessage(const QString& statusMsg); + // JTTY text submission is asynchronous. The returned request id is completed + // by accepted/rejected signals; accepted means queued for backend transmit, + // not finished on RF. Graceful external OFF commands should stop submitting + // new text and let the JTTY drain path stop TX; use abort_jtty_tx() for hard + // abort. + qint64 submitJttyText(QString message); + void updateJttyDecodeHeadings(); void dataSink(qint64 frames); void fastSink(qint64 frames); void tci_mod_active(bool on) {m_tci_mod_active = on;} void diskDat(); void freezeDecode(int n); void guiUpdate(); - void doubleClickOnCall (Qt::KeyboardModifiers); - void doubleClickOnCall2(Qt::KeyboardModifiers); - void doubleClickOnFoxQueue(Qt::KeyboardModifiers); - void doubleClickOnFoxInProgress(Qt::KeyboardModifiers modifiers); + void doubleClickOnCall (QString const& line, QString const& word, Qt::KeyboardModifiers); + void doubleClickOnCall2(QString const& line, QString const& word, Qt::KeyboardModifiers); + void doubleClickOnFoxQueue(QString const& line, QString const& word, Qt::KeyboardModifiers); + void doubleClickOnFoxInProgress(QString const& line, QString const& word, Qt::KeyboardModifiers modifiers); void readFromStdout(); void p1ReadFromStdout(); void setXIT(int n, Frequency base = 0u); @@ -147,14 +306,63 @@ public slots: void msgAvgDecode2(); void fastPick(int x0, int x1, int y); void skedFreq(double sf); + void jttyDecodeAgainAt(float secondsAgo); private: + enum class DecodeOwner + { + None, + Jt9, + Wsprd + }; + + enum class DecodeEndState + { + Completed, + Aborted + }; + + enum class Jt9ProcessPhase + { + InitialStarting, + Ready, + StopRequested, + Terminating, + Killing, + ReplacementStarting, + Closing + }; + + enum class DecodePublishResult + { + Published, + Unavailable, + Failed + }; + + struct ActiveJt9Decode + { + qint32 generation {0}; + DecodeOperatingContext context; + bool copiedSamples {false}; + bool obsolete {false}; + Ft8MtdDecodeCoordinator::Stage ft8Stage {Ft8MtdDecodeCoordinator::Stage::None}; + qint64 ft8Period {-1}; + }; + + static constexpr int MaxActiveStationRows = 50; + // Keep this matched with MAX_CALLERS in the Q65 q3list Fortran helpers. + static constexpr int MaxQ65PileupCallers = 50; + void change_layout (std::size_t) override; void keyPressEvent (QKeyEvent *) override; void closeEvent(QCloseEvent *) override; + void paintEvent(QPaintEvent *) override; void childEvent(QChildEvent *) override; bool eventFilter(QObject *, QEvent *) override; void showQSYMessage(QString message); + void save_wave_file(QString const& name, int samples, Frequency frequency, + QString const& dgrd); private slots: void initialize_fonts (); @@ -189,10 +397,11 @@ private slots: void on_pb10G_clicked(); void on_pb24G_clicked(); void check_button_color(); + void reset_transmit_controls_after_stop (); void stopWRTimeout(); void stopWCTimeout(); void bandHoppingTimer(); - void bandHopping(); + void bandHopping(bool user_requested = false); void on_houndButton_clicked(bool checked); void on_cbHoldTxFreq_clicked (bool); void on_ft8Button_clicked(); @@ -227,7 +436,6 @@ private slots: void on_actionQSG_Q65_triggered(); void on_actionQSG_X250_M3_triggered(); void on_actionQuick_Start_Guide_to_WSJT_X_2_7_and_QMAP_triggered(); - void on_actionRecommended_Audio_Settings_triggered(); void on_actionOnline_User_Guide_triggered(); void on_actionLocal_User_Guide_triggered(); void on_actionWide_Waterfall_triggered(); @@ -246,10 +454,10 @@ private slots: void on_actionSpecial_mouse_commands_triggered(); void on_actionSolve_FreqCal_triggered(); void on_actionCopyright_Notice_triggered(); + void on_actionTrademark_Policy_triggered(); void on_actionSWL_Mode_triggered (bool checked); void on_DecodeButton_clicked (bool); void decode(); - void decodeBusy(bool b); void on_EraseButton_clicked(); void band_activity_cleared (); void rx_frequency_activity_cleared (); @@ -302,6 +510,7 @@ private slots: void on_actionFST4_triggered(); void on_actionFST4W_triggered(); void on_TxFreqSpinBox_valueChanged(int arg1); + void on_TxFreqSpinBox_2_valueChanged(int arg1); void on_actionSave_decoded_triggered(); void on_actionQuickDecode_toggled (bool); void on_actionMediumDecode_toggled (bool); @@ -337,7 +546,6 @@ private slots: void on_actionStartLate_toggled(bool checked); void on_actionFT8WidebandDXCallSearch_toggled(bool checked); void on_actionUse_multithreaded_FT8_decoder_triggered(bool checked); - //ft8md void bumpFqso(int n); void on_actionErase_ALL_TXT_triggered(); @@ -346,15 +554,17 @@ private slots: void on_actionErase_WSPR_hashtable_triggered(); void on_actionErase_list_of_Q65_callers_triggered(); void on_actionExport_Cabrillo_log_triggered(); - void startTx2(); + bool startTx2(); void startP1(); void stopTx(); void stopTx2(); void on_rptSpinBox_valueChanged(int n); - void killFile(); + void killWaveFile(); void on_tuneButton_clicked (bool); void on_pbR2T_clicked(); + void on_pbR2T_2_clicked(); void on_pbT2R_clicked(); + void on_pbT2R_2_clicked(); void acceptQSO (QDateTime const&, QString const& call, QString const& grid , Frequency dial_freq, QString const& mode , QString const& rpt_sent, QString const& rpt_received @@ -370,9 +580,11 @@ private slots: void on_bandComboBox_activated (int index); void on_readFreq_clicked(); void on_RxFreqSpinBox_valueChanged(int n); + void on_RxFreqSpinBox_2_valueChanged(int n); void on_outAttenuation_valueChanged (int); void rigOpen (); void handle_transceiver_update (Transceiver::TransceiverState const&); + void handle_transceiver_closing (bool failed); void handle_transceiver_failure (QString const& reason); void handle_leavingSettings(); void on_actionAstronomical_data_toggled (bool); @@ -382,6 +594,9 @@ private slots: void on_actionShort_list_of_add_on_prefixes_and_suffixes_triggered(); void band_changed (Frequency); void monitor (bool); + void applyMonitorEffects (bool checked, bool restored); + void applyOperatingFrequencyTransition (OperatingFrequency::Transition const&); + OperatingFrequency::Context operatingFrequencyContext () const; void end_tuning (); void stop_tuning (); void stopTuneATU(); @@ -402,8 +617,8 @@ private slots: void on_cbSWL_toggled(bool b); void on_cbTx6_toggled(bool b); void on_cbMenus_toggled(bool b); - void on_cbCQonly_toggled(bool b); void on_cbAutoSeq_toggled(bool b); + void on_cbIncludeTime_toggled(bool b); void networkError (QString const&); void on_ClrAvgButton_clicked(); void on_actionWSPR_triggered(); @@ -429,10 +644,12 @@ private slots: void on_sbTR_valueChanged (int); void on_sbTR_FST4W_valueChanged (int); void on_sbFtol_valueChanged (int); + void on_sbFtol_2_valueChanged (int); void on_cbFast9_clicked(bool b); void on_sbCQTxFreq_valueChanged(int n); void on_cbCQTx_toggled(bool b); void on_actionMSK144_triggered(); + void on_actionJTTY_triggered(); void on_actionQ65_triggered(); void on_actionFreqCal_triggered(); void splash_done (); @@ -446,16 +663,16 @@ private slots: void on_pbFreeText_clicked(); void FoxReset(QString reason); void on_comboBoxHoundSort_activated (int index); - void not_GA_warning_message (); void checkMSK144ContestType(); void on_pbBestSP_clicked(); - void on_RoundRobin_currentTextChanged(QString text); + void on_RoundRobin_currentTextChanged(QString); void setTxMsg(int n); bool stdCall(QString const& w); void remote_configure (QString const& mode, quint32 frequency_tolerance, QString const& submode , bool fast_mode, quint32 tr_period, quint32 rx_df, QString const& dx_call , QString const& dx_grid, bool generate_messages); void callSandP2(int nline); + void qmapCallSandP(QMapDecodeRecord const& record, bool doubleClick); void refreshHoundQueueDisplay(); void queueActiveWindowHound2(QString text); void update_tx5(const QString &qsy_text); @@ -465,6 +682,62 @@ private slots: void on_rbEchoMessage_toggled(bool b); void on_rbEchoCW_toggled(bool b); void on_leEchoMessage_textChanged(); + void on_pbSendMessage_clicked(); + void on_Tx_Message_returnPressed(); + + void on_pbF1_clicked(); + void on_pbF2_clicked(); + void on_pbF3_clicked(); + void on_pbF4_clicked(); + void on_pbF5_clicked(); + void on_pbF6_clicked(); + void on_pbF7_clicked(); + void on_pbF8_clicked(); +#ifdef WIN32 + void logText(const QString &text); +#endif + +private: + enum class FrequencyRequestOrigin + { + User, + Automatic + }; + + enum class DecodeAlertSound { None, DXcall, Wanted }; + + struct Q65StationSelection + { + QString call; + QString grid; + QString submode; + QString report; + bool txFirst; + }; + + void applyExperimentalFT8Filter(const DecodedText& dt, bool& filtered); + void applyQ65StationSelection (Q65StationSelection const& selection); + void processFoxSignals(const DecodedText& dt); + void processSFoxVerification(const DecodedText& dt, bool& filtered); + DecodedMessageReaction::ReactionDisposition processWaitReplyCall( + DecodedText const& dt, DecodedMessageReaction::WaitDecodeSource source, + bool * block_right_display = nullptr); + bool applyFiltering(const DecodedText& dt, bool& filtered); + void applyHighlighting(const DecodedText& dt, DisplayText * decodePane, bool updateAlertState, + bool& play_Wanted, bool& play_DXcall); + void cycleRespondMode(); + static DecodeAlertSound selectDecodeAlertSound(bool alertsEnabled, bool dxCallAlertEnabled, bool wantedAlertEnabled, + bool play_Wanted, bool play_DXcall, bool hasDXCall); + void playDecodeAlertSound(bool play_Wanted, bool play_DXcall); + void playDecodeAlertSound(DecodeAlertSound sound); + void updateRespondTarget(const DecodedText& dt, const QString& text, bool pounce, + QDateTime const& decodePeriodStart, bool diskData); + QString selectedTxMessage() const; + AutoRespondPolicy autoRespondPolicy() const; + bool pendingCqAutoRespondIntent() const; + void displayDecodedTextLine(const DecodedText& dt, const QByteArray& line_read, const QString& distance, bool haveFSpread, float fSpread, bool bDisplayPoints); + QString calculateDistanceAndBearing(const DecodedText& dt); + void processSuperHoundVerification(const DecodedText& dt); private: Q_SIGNAL void initializeAudioOutputStream (QAudioDeviceInfo, @@ -475,6 +748,7 @@ private: unsigned downSampleFactor, AudioDevice::Channel) const; Q_SIGNAL void suspendAudioInputStream () const; Q_SIGNAL void resumeAudioInputStream () const; + Q_SIGNAL void stopAudioInputStream () const; Q_SIGNAL void startDetector (AudioDevice::Channel) const; Q_SIGNAL void FFTSize (unsigned) const; Q_SIGNAL void detectorClose () const; @@ -482,17 +756,27 @@ private: Q_SIGNAL void transmitFrequency (double) const; Q_SIGNAL void endTransmitMessage (bool quick = false) const; Q_SIGNAL void tune (bool = true) const; - Q_SIGNAL void sendMessage (QString mode, unsigned symbolsLength, - double framesPerSymbol, double frequency, double toneSpacing, - SoundOutput *, AudioDevice::Channel = AudioDevice::Mono, - bool synchronize = true, bool fastMode = false, double dBSNR = 99., - int TRperiod=60) const; + Q_SIGNAL void sendMessage (TxEvidence::TxRequest, SoundOutput *) const; + Q_SIGNAL void startJttyStream (TxEvidence::TxRequest, SoundOutput *); + Q_SIGNAL void endJttyStream () const; Q_SIGNAL void outAttenuationChanged (qreal) const; Q_SIGNAL void toggleShorthand () const; Q_SIGNAL void reset_audio_input_stream (bool report_dropped_frames) const; private: void set_mode (QString const& mode); + void dispatchTxRequest (TxEvidence::TxRequest const& request); + void beginTxEvidenceSession (); + void beginTxEvidenceGeneration (qint64 committedEndSample = -1, + bool targetKnown = false); + void recordTxSourceCommit (TxEvidence::TxStartSnapshot const& snapshot); + void recordRawTxPlayout (TxEvidence::TxRawPlayoutSnapshot const& snapshot); + void noteTxStopReason (TxEvidence::TxStopReason reason); + void noteTxModeChange (QString const& mode); + int txStopTailMs (bool tciAudio) const; + void stopTxEvidence (int tailMs); + void captureJttyTxEvidenceTotals (qint64 servedSamples, qint64 totalSamples, + QString const& diagnostic); void astroUpdate (); void writeAllTxt(QString message); void auto_sequence (DecodedText const& message, unsigned start_tolerance, unsigned stop_tolerance); @@ -501,29 +785,117 @@ private: void setColorHighlighting(); void chkFT4(); bool elide_tx1_not_allowed () const; + void toggle_tx1_enabled_preference (); + bool rr73_tx4_allowed () const; + bool send_rr73_for_tx4 () const; + void set_rr73_tx4 (bool enabled); void readWidebandDecodes(); void configActiveStations(); - void sfox_tx(); + bool sfox_tx(); + void clearSuperFoxPreparedTx(); + void abortSuperFoxTxStart(); + void displayFoxTxMsgs(); + void jtty_tx(QString message); + void submitJttyDraft(QString message); +#ifdef WIN32 + void handleMmttyTxString(QString message); + void handleMmttyStartTx(); + void handleMmttyStopTx(); + void handleMmttyAbortTx(); + void handleMmttyJttyAccepted(qint64 requestId); + void handleMmttyJttyRejected(qint64 requestId, JttyTxRejectReason reason); + void handleMmttyJttyCompleted(qint64 requestId); + void handleMmttyJttySessionDrained(qint64 sessionId); + void completeMmttyJttyOutput(bool drained = false); + void startPendingMmttyJttyTx(); + QString jttyRejectReasonText(JttyTxRejectReason reason) const; +#endif + void execute_jtty_tx(qint64 requestId, QString message); + void execute_jtty_tones(qint64 requestId, QString const& message, + int const itone[], int nsym); + void advanceJttyTxQueueEpoch(); + qint64 jttyTxCommittedSamples() const; + void completeJttyTxEnqueue(qint64 requestId, QString const& message, + TxAudioQueueProgress progress, bool newSession, + bool useTciAudio); + void recordAcceptedJttyTextRequest(qint64 requestId, qint64 endSample); + QVector takeCompletedJttyTextRequests(TxAudioQueueEpoch epoch, + qint64 totalAtDrain); + void clearAcceptedJttyTextRequests(TxAudioQueueEpoch epoch); + void handleJttyContestSerial(QString const& message); + void abort_jtty_tx(); + void interruptJttyTx(); + void rejectPendingJttyTciMessages(JttyTxRejectReason reason); + void sync_tci_tx_volume (bool force = false); + void onJttyBackendDrained(TxAudioQueueDrainState drain); + void onJttyBackendEnqueueAccepted(qint64 enqueueId, qint64 sampleCount, + TxAudioQueueProgress progress); + void onJttyBackendEnqueueFailed(TxAudioQueueEpoch epoch, qint64 enqueueId); + void handleJttyTxWatchdog(); + void resetJttyTxState(); + void startJttyTxWatchdog(int durationMs); + void jtty_save_wav(); + bool jtty_key_struck(QKeyEvent * e); + bool sendJttyFunctionKey(int index); + // istart0/istop (sample indices into dec_data.d2) bound the Fortran scan + // to a window instead of the whole buffer; -1/-1 (the default) means + // unwindowed, matching the original behavior exactly. Returns true when + // this call delivers a completed message admitted to the QSO history. + bool jtty_decode(int k, int istart0 = -1, int istop = -1); + void renderJttyAllFreqLines(); + void renderJttyQsoLines(); + void jtty_again(); + void flushJttyDecodeLines(); + QString jtty_msg_expand(QString msg); + QString specOpLabel() const; + void initializeFFT(int nsps); + void initializeFFT(int nsps, int fftSize); + void setTxButtonsEnabled(bool enabled); + void setDXInfo(QString const& call, QString const& grid); + void setDecodeTitles(QString const& lh, QString const& rh); + void setDecodeHeadings(QString const& lh, QString const& rh); + void updateDecodeAccessibility(); + bool play_DXcall = false; bool play_Wanted = false; bool inSettings = false; + quint64 m_startup_trace_run {0}; + bool m_startup_paint_reported {false}; + bool m_startup_decoder_reported {false}; + bool m_startup_audio_reported {false}; + bool m_startup_logbook_reported {false}; + bool m_startup_rig_reported {false}; + bool m_event_filter_ready {false}; QProcessEnvironment const& m_env; NetworkAccessManager m_network_manager; bool m_valid; QSplashScreen * m_splash; QString m_revision; bool m_multiple; + bool m_automated_test; MultiSettings * m_multi_settings; QPushButton * m_configurations_button; QSettings * m_settings; + QString m_base_style_sheet; QScopedPointer ui; + QButtonGroup * m_tx_message_button_group {nullptr}; + QFocusFrame * m_main_window_focus_frame {nullptr}; + QFrame * m_message_selector_focus_frame {nullptr}; + bool m_keyboard_focus_active {false}; + bool m_tx_first_user_enabled {true}; + bool m_tx_first_mode_enabled {true}; + +#ifdef WIN32 + MMTTYIF * m_mmttyif {nullptr}; +#endif Configuration m_config; + QDir m_decoderDataDir; LogBook m_logBook; // must be after Configuration construction Cloudlog m_cloudlog; WSPRBandHopping m_WSPR_band_hopping; - bool m_WSPR_tx_next; + BeaconTx::Controller m_beaconTxController; MessageBox m_rigErrorMessageBox; QScopedPointer m_sampleDownloader; QScopedPointer m_equalizationToolsDialog; @@ -554,8 +926,11 @@ private: Detector * m_detector; unsigned m_FFTSize; - SoundInput * m_soundInput; + AudioInputSource * m_soundInput; + quint64 m_decodeCycleGeneration {0}; Modulator * m_modulator; + QScopedPointer m_jttyTxQueue; + JttyTxStream * m_jttyTxStream; SoundOutput * m_soundOutput; int m_rx_audio_buffer_frames; int m_tx_audio_buffer_frames; @@ -568,11 +943,9 @@ private: qint64 m_fullFoxCallTime; qint64 m_msEchoTxStart=0; - Frequency m_freqNominal; + OperatingFrequency m_operatingFrequency; Frequency m_freqNominalPeriod; - Frequency m_freqTxNominal; - quint64 m_msk144basefreq; - quint64 m_msk144oldfreq; + Frequency m_msk144basefreq {0}; quint64 m_mslastTX; //ft8md qint32 m_nlasttx; //ft8md qint32 m_lapmyc; //ft8md @@ -581,11 +954,11 @@ private: double m_tRemaining; double m_TRperiod; - double m_fSpread; + double m_fSpread {0.}; double m_s6; - double m_fDither; - double m_fAudioShift; - double m_skedFreq; + double m_fDither {0.}; + double m_fAudioShift {0.}; + double m_skedFreq {1296.065}; float m_DTtol; float m_t0; @@ -614,12 +987,12 @@ private: qint32 m_ft8DecoderStart; qint32 m_nsecBandChanged; qint32 m_nFT4depth; + qint32 m_nsym_jtty; //ft8md qint32 m_sec0; qint32 m_RxLog; qint32 m_nutc0; - qint32 m_ntr; qint32 m_tx; quint64 m_mslastMon; int m_addtx; @@ -660,8 +1033,7 @@ private: qint32 m_maxFoxWait=3; //Max wait time for expected Hound replies qint32 m_foxCQtime=10; //CQs at least every 5 minutes qint32 m_tFoxTxSinceCQ=999; //Fox Tx cycles since most recent CQ - qint32 m_nFoxFreq; //Audio freq at which Hound received a call from Fox - qint32 m_nSentFoxRrpt=0; //Serial number for next R+rpt Hound will send to Fox + HoundTransmissionPolicy::State m_houndTransmissionState; qint32 m_kin0=0; qint32 m_earlyDecode=41; qint32 m_earlyDecode2=47; @@ -674,15 +1046,50 @@ private: qint32 m_echoSec0=0; qint32 m_fetched=0; qint32 m_position; + qint64 m_decoderDiagSequence=0; + qint64 m_decoderDiagActiveSequence=0; + qint32 m_nextDecoderGeneration=0; + qint32 m_decoderDiagStartIhsym=0; + qint32 m_decoderDiagStartHsymStop=0; + qint32 m_decoderDiagStartNzhsym=0; + qint32 m_decoderDiagStartNewdat=0; + qint32 m_decoderDiagStartNagain=0; + qint32 m_decoderDiagStartNdiskdat=0; + qint32 m_decoderDiagProgressCount=0; + double m_decoderDiagStartTRperiod=0.0; + QElapsedTimer m_decoderDiagElapsedTimer; + QElapsedTimer m_decoderDiagProgressTimer; + QString m_decoderDiagStartMode; + QMap m_decoderDiagLastSampleUtc; bool m_btxok; //True if OK to transmit bool m_diskData; bool m_loopall; - bool m_decoderBusy; + DecodeOwner m_decodeOwner=DecodeOwner::None; + Jt9ProcessPhase m_jt9ProcessPhase=Jt9ProcessPhase::InitialStarting; + bool m_modeLocked = false; + bool m_decoderDiagActive=false; + bool m_decoderDiagBusyRequestLogged=false; + bool m_decoderDiagOverrunLogged=false; + bool m_decoderDiagHardHangLogged=false; + bool m_decoderDiagAbnormalClear=false; + bool m_decoderCompletedSinceStart=false; + bool m_jt9PayloadValid=false; + bool m_closing=false; bool m_txFirst; + bool m_tx1_enabled_preference {true}; bool m_auto; bool m_restart; + bool m_generated_message_error; bool m_startAnother; + ActiveJt9Decode m_activeJt9Decode; + DecoderOutputFramer m_decoderOutputFramer; + Ft8MtdDecodeCoordinator m_ft8MtdDecodeCoordinator; +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) + qint64 m_liveAudioTestPendingFt8FinalPeriod {-1}; + bool m_liveAudioTestAwaitFt8InputCompletion {false}; + bool m_liveAudioTestFt8InputComplete {false}; +#endif // start ft8md bool m_FT8EarlyStart; @@ -711,7 +1118,6 @@ private: bool m_dataAvailable; bool m_bDecoded; bool m_noSuffix; - bool m_decodedText2; bool m_sentFirst73; bool m_tci_mod_active; bool m_tci; @@ -724,16 +1130,13 @@ private: bool m_bShMsgs; bool m_bSWL; bool m_uploadWSPRSpots; - bool m_uploading; bool m_grid6; - bool m_tuneup; bool m_bTxTime; - bool m_rxDone; bool m_bSimplex; // not using split even if it is available bool m_bEchoTxOK; bool m_bTransmittedEcho; bool m_bEchoTxed; - bool m_bFastMode; + bool m_bFastMode=false; bool m_bFast9; bool m_bFastDecodeCalled; bool m_bDoubleClickAfterCQnnn; @@ -748,26 +1151,24 @@ private: bool m_bCallingCQ; bool m_bAutoReply; QString m_lastloggedcall; //ft8md - bool m_bCheckedContest; + bool m_contestModeHintShown; bool m_bWarnedSplit=false; bool m_bTUmsg; bool m_bBestSPArmed=false; bool m_bOK_to_chk=false; bool m_bSentReport=false; bool m_discard_decoded_hounds_this_cycle=false; // if something changes, like frequency, discard decoded messages that may be in-flight. + bool m_houndVerified=false; SpecOp m_specOp; - enum - { - CALLING, - REPLYING, - REPORT, - ROGER_REPORT, - ROGERS, - SIGNOFF - } - m_QSOProgress; //State machine counter + static constexpr QsoProgress CALLING {QsoProgress::Calling}; + static constexpr QsoProgress REPLYING {QsoProgress::Replying}; + static constexpr QsoProgress REPORT {QsoProgress::Report}; + static constexpr QsoProgress ROGER_REPORT {QsoProgress::RogerReport}; + static constexpr QsoProgress ROGERS {QsoProgress::Rogers}; + static constexpr QsoProgress SIGNOFF {QsoProgress::Signoff}; + QsoProgress m_QSOProgress; enum {CALL, GRID, DXCC, MULT}; @@ -787,6 +1188,7 @@ private: // labels in status bar QLabel tx_status_label; + bool m_tx_inhibited {false}; QLabel config_label; QLabel mode_label; QLabel last_tx_label; @@ -795,10 +1197,24 @@ private: QLabel ndecodes_label; QProgressBar progressBar; QLabel watchdog_label; - - QFuture m_wav_future; - QFutureWatcher m_wav_future_watcher; - QFutureWatcher watcher3; + QLabel * m_txFrequencyLabel {}; + QLabel * m_frequencyToleranceLabel {}; + QLabel * m_rxFrequencyLabel {}; + QLabel * m_reportLabel {}; + QLabel * m_trPeriodLabel {}; + QLabel * m_submodeLabel {}; + QLabel * m_maxDriftLabel {}; + QHBoxLayout * m_frequencyToleranceRow {}; + QHBoxLayout * m_modeCheckboxRow {}; + WavLoadCoordinator m_wav_load_coordinator; + QFutureWatcher watcher3; + bool m_fastDecodePending = false; + ReferenceSpectrumInput m_referenceInput; + ReceiveAudioConsumer m_receiveConsumer; + QQueue m_receiveQueue; + ReceiveAudio m_activeReceiveAudio; + bool m_receivingAudio = false; + QFutureSynchronizer m_saveWAVSynchronizer; QFutureWatcher m_saveWAVWatcher; NonInheritingProcess proc_jt9; @@ -812,6 +1228,10 @@ private: EQSL *Eqsl; QTimer m_guiTimer; + QTimer m_decoderShutdownTimer; + QTimer m_decoderTerminateTimer; + QTimer m_decoderKillTimer; + QTimer m_decoderStartTimer; QTimer stopWRTimer; //Wait & Reply QTimer stopWCTimer; //Wait & Call QTimer ptt1Timer; //StartTx delay @@ -819,12 +1239,19 @@ private: QTimer logQSOTimer; QTimer killFileTimer; QTimer tuneButtonTimer; + QTimer rigTuneTimer; QTimer uploadTimer; QTimer tuneATU_Timer; QTimer TxAgainTimer; QTimer minuteTimer; QTimer splashTimer; QTimer p1Timer; + QTimer m_jttyTxWatchdog; + QTimer m_refSpecTimer; + AutoRespondSelectionLatch m_autoRespondSelectionLatch; + AutoRespondScores m_autoRespondScores; + AutoRespondPeriodState m_autoRespondPeriodState; + int m_refSpecSecondsRemaining = 0; QString m_path; QString m_baseCall; @@ -835,7 +1262,6 @@ private: QString m_palette; QString m_dateTime; QString m_mode; - QString m_modeTx;//ft8md QString m_fnameWE; // save path without extension QString m_rpt; QString m_nextRpt; @@ -864,8 +1290,13 @@ private: QString m_deGrid; QString m_freeTextMsg; QString m_freeTextMsg0; - QString m_ready2call[50]; - QString m_callers[50]; + std::array m_ready2call; + std::array m_callers; + // Q65 Pileup mode: selected DX call whose last Tx was copied by a decode. + // The value is consumed by the next matching Q65 Tx message. + QString m_q65PileupCopiedLastRxCall; + // Q65 Pileup mode: callers whose latest decode carried the copied flag ('#'); a standing display annotation, cleared only on leaving the Pileup context, not per decode pass. + QSet m_q65PileupCopiedCallers; QSet m_pfx; QSet m_sfx; @@ -959,13 +1390,77 @@ private: bool m_transmitting; bool m_tune; bool m_tx_watchdog; // true when watchdog triggered + TxEvidence::TxPlaybackDiagnostics m_txPlaybackDiagnostics; + TxEvidence::TxSessionId m_txEvidenceSession; + TxEvidence::TxSessionId m_txEvidenceSourceSession; + TxEvidence::TxGeneration m_txEvidenceGeneration; + TxEvidence::TxStopReason m_pendingTxStopReason {TxEvidence::TxStopReason::NormalEnd}; +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) + qint64 m_liveAudioTestFt8StartWindowOpenMs {-1}; + qint64 m_liveAudioTestFt8StartWindowCloseMs {-1}; + qint64 m_liveAudioTestFt8StartSessionId {-1}; + qint64 m_liveAudioTestFt8StartGeneration {-1}; +#endif + bool m_jttyTxActive; + bool m_jttyTxUsesTciAudio; + TxAudioQueueEpoch m_jttyTxQueueEpoch; + TxAudioQueueProgress m_jttyTxQueueProgress; + struct PendingJttyTciMessage + { + TxAudioQueueEpoch epoch; + qint64 enqueueId; + qint64 requestId; + qint64 sampleCount; + QString message; + bool newSession; + }; + QVector m_pendingJttyTciMessages; + struct AcceptedJttyTxRequest + { + TxAudioQueueEpoch epoch; + qint64 requestId; + qint64 endSample; + }; + QVector m_acceptedJttyTxRequests; + JttyDraftAcceptanceTracker m_jttyDraftAcceptanceTracker; + qint64 m_jttyTxRequestId; + qint64 m_jttyTciEnqueueId; + struct JttyQsoLine + { + qint64 messageId {0}; + float frequency {0.f}; + QString text; + float sequenceStart {0.f}; + QDateTime messageStartUtc; + }; + QVector m_jttyQsoLines; + QTextBlock m_jttyQsoGroupStart; + QTextBlock m_jttyQsoGroupEnd; + int m_jttyQsoGroupEndPosition {-1}; + bool m_jttyQsoRenderedLowerCase {false}; + bool m_jttyQsoRenderedIncludeTime {false}; + struct JttyDecodeLine + { + qint64 messageId {0}; + float frequency {0.f}; + QString text; + float sequenceStart {0.f}; + QDateTime messageStartUtc; + bool complete {false}; + bool written {false}; + DecodeOperatingContext context; + }; + QVector m_jttyAllFreqLines; + int m_jttyLastAllFreqsK = -1; // detects a restarted decode (new WAV, or "decode again") + qint32 m_jttyLastSavedWavK0 = -1; // m_k0 at last JTTY WAV save; skips saving unchanged audio again + QTextBlock m_jttyAllFreqsGroupStart; // start of decodedTextBrowser's currently-growing group +#ifdef WIN32 + Jtty::N1mmOutput m_mmttyJttyOutput; +#endif bool m_block_pwr_tooltip; bool m_PwrBandSetOK; bool m_bDisplayedOnce; - Frequency m_lastMonitoredFrequency; double m_toneSpacing; - int m_firstDecode; - QProgressDialog m_optimizingProgress; QTimer m_heartbeat; MessageClient * m_messageClient; PSKReporter m_psk_Reporter; @@ -979,28 +1474,73 @@ private: //---------------------------------------------------- private functions void readSettings(); + void configureModeControlsLayout(); + void updateModeControlsLayout(); + void applyApplicationStyle(QFont const&, bool dark); + void setTrPeriodVisible(bool); void set_application_font (QFont const&); + void updateMainWindowControlSizes(); + void updateFrequencyToleranceRowAlignment(); void setDecodedTextFont (QFont const&); void writeSettings(); void createStatusBar(); + void handleTxInhibitStatus (bool supported, bool inhibited, QString const& holder, + quint32 hold_rx, quint32 release_rx, + quint32 expiries, quint32 invalid); + void startTxAudioAfterPttDelay (); void updateStatusBar(); + void updateMainWindowAccessibility(); + void registerMainWindowFocusControls(); + std::array txNextButtons() const; + std::array focusIndicatorWidgets() const; + void showMainWindowFocusIndicator(QWidget *widget); + void hideMainWindowFocusIndicators(); + void updateTxNextFocusPolicies(); + void updateTxFirstEnabledState(); + void setTxFirstModeEnabled(bool enabled); + bool switchTxNextMessage(QKeyEvent const *key_event); + bool switchMainWindowTab(QKeyEvent const *key_event); void genStdMsgs(QString rpt, bool unconditional = false); void genCQMsg(); void clearDX (); void lookup(); + QString expandTxMacros(QString const& message) const; void ba2msg(QByteArray ba, char* message); void msgtype(QString t, QLineEdit* tx); + void show_generated_message_error (); + void clear_generated_message_error (); + void update_generated_message_error (); void stub(); void statusChanged(); void fixStop(); + void finishReferenceSpectrumMeasurement(bool notify); + void updateReferenceSpectrumCountdown(); bool shortList(QString callsign) const; void transmit (double snr = 99.); void rigFailure (QString const& reason); void pskSetLocal (); void pskPost(DecodedText const& decodedtext); + void pskPost(DecodedText const& decodedtext, + DecodeOperatingContext const& context); void displayDialFrequency (); void transmitDisplay (bool); - void processMessage(DecodedText const& message, Qt::KeyboardModifiers = Qt::NoModifier); + void handleDecodeSelection(QString const& line, QString const& word, + Qt::KeyboardModifiers modifiers, + DecodedMessageReaction::SelectionOrigin selection_origin); + void processMessage(DecodedText const& message, Qt::KeyboardModifiers modifiers, + DecodedMessageReaction::SelectionOrigin selection_origin); + void processSyntheticMessage(DecodedText const& message); + DecodedMessageReaction::QsoReactionSnapshot qsoReactionSnapshot( + Qt::KeyboardModifiers modifiers = Qt::NoModifier) const; + DecodedMessageReaction::QsoReactionSnapshot qsoReactionSnapshot( + Qt::KeyboardModifiers modifiers, + DecodedMessageReaction::SelectionOrigin selection_origin) const; + void applyQsoReactionPlan(DecodedMessageReaction::QsoReactionPlan const& plan, + DecodedText const& message, bool * block_right_display = nullptr); + void applyQsoReactionEffect(DecodedMessageReaction::QsoReactionEffect const& effect, + DecodedText const& message, bool * block_right_display); + void showContestHint(DecodedMessageReaction::ContestHint hint); + void refreshQsoPane(DecodedText const& message); void replyToCQ (QTime, qint32 snr, float delta_time, quint32 delta_frequency, QString const& mode, QString const& message_text, bool low_confidence, quint8 modifiers); void locationChange(QString const& location); void replayDecodes (); @@ -1008,9 +1548,28 @@ private: void postWSPRDecode (bool is_new, QStringList message_parts); void enable_DXCC_entity (bool on); void switch_mode (Mode); - void WSPR_scheduling (); + bool hasMsk144BaseFrequency () const {return m_msk144basefreq > 0;} + BeaconTx::RoundRobinPolicy beaconRoundRobinPolicy () const; + BeaconTx::RoundRobinPolicy configuredRoundRobinPolicy () const; + void enterBeaconMode (); + void processBeaconActions (BeaconTx::Controller::Actions actions); + BeaconTx::ScheduleProposal beaconScheduleProposal (); + bool applyBeaconBandChange (BeaconTx::HoppingProposal const& proposal); void freqCalStep(); - void setRig (Frequency = 0); // zero frequency means no change + RigFrequencyChangePolicy::Activity rigFrequencyActivity () const; + RigFrequencyChangePolicy::Decision rigFrequencyChangeDecision ( + RigFrequencyChangePolicy::ChangeKind) const; + bool nominalFrequencyChangeAllowed (FrequencyRequestOrigin); + bool requestNominalFrequencyChange (Frequency, FrequencyRequestOrigin); + bool dispatchNominalFrequency (Frequency corrected, FrequencyRequestOrigin, bool monitoring); + bool requestBandChange (Frequency, FrequencyRequestOrigin); + bool workingFrequencyAt (int row, Frequency&) const; + void applyBandChange (Frequency, Frequency previous_frequency); + bool requestBandButtonFrequency (Frequency lookup_frequency, Frequency fallback_frequency, + double msk144_tr_period = 0.); + bool requestAlternateBandFrequency (Frequency); + bool reapplyCurrentRigFrequencyCorrection (); + void restoreNominalFrequencySelection (); void WSPR_history(Frequency dialFreq, int ndecodes); QString beacon_start_time (int n = 0); QString WSPR_message(); @@ -1019,36 +1578,73 @@ private: void useNextCall(); void abortQSO(); void updateRate(); - void write_all(QString txRx, QString message); + void write_all(QString txRx, QString message, + DecodeOperatingContext const * context = nullptr); bool isWorked(int itype, QString key, float fMHz=0, QString=""); - QString save_wave_file (QString const& name - , short const * data - , int samples - , QString const& my_callsign - , QString const& my_grid - , QString const& mode - , qint32 sub_mode - , Frequency frequency - , QString const& his_call - , QString const& his_grid) const; - void hound_reply (); + void hound_reply (int foxFrequency); QString sortHoundCalls(QString t, int isort, int max_dB); void rm_tb4(QString houndCall); void read_wav_file (QString const& fname); - void decodeDone (); + void wav_file_loaded (); + void update_wav_file_actions (); + void finishDecodeUi (); bool subProcessFailed (QProcess *, int exit_code, QProcess::ExitStatus); void subProcessError (QProcess *, QProcess::ProcessError); void statusUpdate () const; void update_watchdog_label (); + bool normalWatchdogWarningActive () const; + bool isHoundOperation () const; + bool isSuperHoundOperation () const; + void updateHoundVerificationStyle (); void invalidate_frequencies_filter (); void on_the_minute (); void add_child_to_event_filter (QObject *); void remove_child_from_event_filter (QObject *); void setup_status_bar (bool vhf); void tx_watchdog (bool triggered); - qint64 nWidgets(QString t); - void displayWidgets(qint64 n); + enum class ModeUiControl + { + TxFirst, + TxFrequency, + RxFrequency, + FrequencyTolerance, + Report, + TrPeriod, + CqTxFrequency, + ShortMessages, + Fast9, + AutoSequence, + Tx6, + CopyRxToTx, + CopyTxToRx, + HoldTxFrequency, + Submode, + Sync, + WsprControls, + ClearAverage, + DecodeDepth, + IncludeAveraging, + IncludeCorrelation, + EchoGraph, + Swl, + ApFt8, + ApJt65, + ApDxCall, + Respond, + Measure, + DxpedLabel, + RxAll, + CqOnly, + Fst4wTrPeriod, + LowFrequency, + HighFrequency, + AutoClearAverage, + MaxDrift, + FoxQueueTab + }; + using ModeUiState = std::initializer_list; + void applyModeUiState(ModeUiState); QChar current_submode () const; // returns QChar {0} if submode is not appropriate void write_transmit_entry (QString const& file_name); void selectHound(QString t, bool bTopQueue); @@ -1057,11 +1653,60 @@ private: void updateFoxQSOsInProgressDisplay(); void foxQueueTopCallCommand(); void foxRxSequencer(QString msg, QString houndCall, QString rptRcvd); - void foxTxSequencer(); + bool foxTxSequencer(); void foxGenWaveform(int i,QString fm); void writeFoxQSO (QString const& msg); void update_foxLogWindow_rate(); - void to_jt9(qint32 n, qint32 istart, qint32 idone); + DecodePublishResult publishDecodeRequest( + bool copySamples, + Ft8MtdDecodeCoordinator::Stage ft8Stage = Ft8MtdDecodeCoordinator::Stage::None, + qint64 ft8Period = -1); + DecodePublishResult publishPendingFt8Decode (); + void decode (Ft8MtdDecodeCoordinator::Stage stage, qint64 ft8Period = -1); + qint64 currentFt8DecodePeriod () const; + bool usesFt8MtdFinal () const; + int configuredFt8MtdEarlyStageCount () const; + std::unique_ptr + capturePendingFt8MtdDecode (qint64 period) const; + void cancelPendingFt8Decode (QString const& reason); + void reportFt8BackpressureDecision ( + Ft8MtdDecodeCoordinator::Decision const& decision, qint64 period); + void reportFt8BackpressureRecovery (qint64 period); + void emitFt8DecoderInvocation (decoder_params_t const& params) const; + bool handleDecoderOutputEvent(DecoderOutputFramer::Event const& event, + bool& decodeCompleted); + DecodeOperatingContext currentDecodeOperatingContext() const; + bool decodeOperatingContextMatchesCurrent( + DecodeOperatingContext const& context) const; + bool pendingFt8DecodeOperatingContextMatchesCurrent( + DecodeOperatingContext const& context) const; + bool activeDecodeOperatingContextMatchesCurrent() const; + bool initializeDecoderSharedMemory(); + void startDecoderProcess(); + bool beginDecode( + DecodeOwner owner, decoder_params_t const * diagnosticParams = nullptr, + DecodeOperatingContext const * diagnosticContext = nullptr); + void endDecode(DecodeOwner owner, + DecodeEndState state = DecodeEndState::Completed); + void updateDecodeControls(); + bool usesJt9Process() const; + bool decoderRestartInProgress() const; + void abortJt9Transaction(); + void recoverDecoderAtBoundary(QString const& reason, bool manual); + void requestDecoderRestart(QString const& reason); + qint64 decoderDiagnosticElapsedMs() const; + qint64 decoderDiagnosticIdleMs() const; + qint64 decoderRequestDeadlineMs() const; + bool decoderRequestDeadlineExpired() const; + void beginDecoderDiagnostic( + decoder_params_t const * params = nullptr, + DecodeOperatingContext const * context = nullptr); + void markDecoderProgress(); + void logDecoderBusyRequest(QString const& reason); + void logDecoderProgress(); + void logDecoderAbnormalClear(QString const& reason); + void finishDecoderDiagnostic(); + void clearHungDecoderStatus(QString const& reason); bool is77BitMode () const; void cease_auto_Tx_after_QSO (); Q_SLOT void ARRL_Digi_Display(); @@ -1069,7 +1714,6 @@ private: void activeWorked(QString call, QString band); void read_log(); void refreshPileupList(); - QString userAgent(); void handleVerifyMsg(int status, QDateTime ts, QString callsign, QString code, unsigned int hz, QString const &response); void writeFoxTxMsgs(); #ifdef FOX_OTP diff --git a/widgets/mainwindow.ui b/widgets/mainwindow.ui index d9d83bac..0353de83 100644 --- a/widgets/mainwindow.ui +++ b/widgets/mainwindow.ui @@ -6,8 +6,8 @@ 0 0 - 880 - 685 + 876 + 688 @@ -17,7 +17,7 @@ - WSJT-X by K1JT + WSJT-X™ by K1JT et al. @@ -26,7 +26,7 @@ - + @@ -42,11 +42,11 @@ 16777215 - - - 10 - false - + + Band Activity decode pane title + + + Title for the Band Activity decoded messages pane. Band Activity @@ -134,6 +134,12 @@ + + Band Activity decoded messages headings + + + Columns: UTC dB DT Freq Message. + true @@ -150,6 +156,12 @@ + + Band Activity decoded messages + + + Decoded messages in the Band Activity pane. Columns: UTC dB DT Freq Message. + QFrame::StyledPanel @@ -185,11 +197,11 @@ - - - 10 - false - + + Rx Frequency decode pane title + + + Title for the Rx Frequency decoded messages pane. Rx Frequency @@ -277,6 +289,12 @@ + + Rx Frequency decoded messages headings + + + Columns: UTC dB DT Freq Message. + true @@ -296,6 +314,12 @@ true + + Rx Frequency decoded messages + + + Decoded messages in the Rx Frequency pane. Columns: UTC dB DT Freq Message. + Qt::ScrollBarAlwaysOn @@ -311,6 +335,43 @@ + + + + + + Check to display received messages in lower case. + + + Lower case + + + false + + + + + + + Include Time + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + @@ -337,8 +398,8 @@ 3 - - + + 20 @@ -349,12 +410,12 @@ Qt::StrongFocus - 40 + 15 - - + + 20 @@ -365,15 +426,15 @@ Qt::StrongFocus - 10 + 17 - - + + - 20 + 15 0 @@ -381,102 +442,93 @@ Qt::StrongFocus - 17 + 2 - - + + - 20 + 25 0 - 60 + 23 - - + + - 20 + 25 0 - - Qt::StrongFocus - - 12 + 2 - - + + - 25 + 20 0 + + Qt::StrongFocus + - 160 + 10 - - + + - 20 + 25 0 - - Qt::StrongFocus - - 20 + 6 - - + + - 20 + 25 0 - - Qt::StrongFocus - - 80 + 33 - - + + - 20 + 25 0 - - Qt::StrongFocus - 70 - - + + 20 @@ -487,28 +539,25 @@ Qt::StrongFocus - 15 + 80 - - + + - 15 + 25 0 - - Qt::StrongFocus - - 2 + 10G - - + + 20 @@ -519,28 +568,25 @@ Qt::StrongFocus - 30 + 40 - - + + - 15 + 20 0 - - Qt::StrongFocus - - 6 + 60 - - + + 25 @@ -548,12 +594,12 @@ - 24G + 13 - - + + 25 @@ -561,12 +607,12 @@ - 10G + 24G - - + + 25 @@ -574,12 +620,12 @@ - 5G + 4 - - + + 25 @@ -587,12 +633,12 @@ - 9 + 8 - - + + 25 @@ -600,38 +646,44 @@ - 13 + 1.25 - - + + - 25 + 20 0 + + Qt::StrongFocus + - 23 + 70 - - + + - 25 + 20 0 + + Qt::StrongFocus + - 33 + 30 - - + + 25 @@ -639,25 +691,28 @@ - 70 + 160 - - + + - 25 + 20 0 + + Qt::StrongFocus + - 1.25 + 20 - - + + 25 @@ -665,12 +720,12 @@ - 2 + 5G - - + + 25 @@ -678,60 +733,46 @@ - 4 + 9 - - + + - 25 + 15 0 + + Qt::StrongFocus + 6 - - + + - 25 + 20 0 + + Qt::StrongFocus + - 8 + 12
- - - - - CQ messages only. - - - CQ only - - - - - - - Bypass Filters toggled via Settings or the Filters menu. - - - BP - - - + @@ -783,7 +824,6 @@ border-width: 1px; border-radius: 5px; border-color: black; - min-width: 5em; padding: 3px; }
@@ -883,7 +923,6 @@ border-width: 1px; border-radius: 5px; border-color: black; - min-width: 5em; padding: 3px; }
@@ -920,7 +959,6 @@ border-width: 1px; border-radius: 5px; border-color: black; - min-width: 5em; padding: 3px; }
@@ -973,7 +1011,6 @@ border-width: 1px; border-radius: 5px; border-color: black; - min-width: 5em; padding: 3px; }
@@ -1009,7 +1046,7 @@ - 114 + 154 0 @@ -1031,7 +1068,7 @@ - + 0 0 @@ -1048,12 +1085,6 @@ <html><head/><body><p>Toggle Wait &amp; Call On/Off. Right-click to clear the DX Call box.</p></body></html> - - QPushButton { - background-color: #9fafd5; - border: none; -} - DX Call @@ -1062,10 +1093,10 @@ - - + + - Callsign of station to be worked + Locator of station to be worked @@ -1083,73 +1114,6 @@ 0 - - - - - - - 252 - 252 - 252 - - - - - - - 159 - 175 - 213 - - - - - - - - - 252 - 252 - 252 - - - - - - - 159 - 175 - 213 - - - - - - - - - 159 - 175 - 213 - - - - - - - 159 - 175 - 213 - - - - - - - - true - DX Grid @@ -1167,10 +1131,10 @@ - - + + - Locator of station to be worked + Callsign of station to be worked @@ -1272,9 +1236,9 @@ - + - Adjust Tx audio level + Adjust transmit drive level 450 @@ -1291,12 +1255,6 @@ true - - QSlider::TicksBelow - - - 50 - @@ -1408,7 +1366,7 @@ Yellow when too low
- + 0 @@ -1416,7 +1374,7 @@ Yellow when too low
- 0 + 1 @@ -1561,7 +1519,6 @@ Not available to nonstandard callsign holders.
border-width: 1px; border-radius: 5px; border-color: black; - min-width: 5em; padding: 3px; }
@@ -1634,7 +1591,7 @@ When not checked you can view the calibration results. - <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the the strongest station's reply to your CQ. </p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the the weakest station's reply to your CQ. </p></body></html> + <html><head/><body><p>Select <span style=" font-weight:600;">CQ: None</span> to choose callers manually.</p><p>Select <span style=" font-weight:600;">CQ: First</span> to respond automatically to the first decoded reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Max Dist</span> to respond automatically to the reply yielding most points in the ARRL International Digital Contest, or in general to the most distant station, if its message has a valid grid.</p><p>Select <span style=" font-weight:600;">CQ: Max dB</span> to respond automatically to the strongest station's reply to your CQ.</p><p>Select <span style=" font-weight:600;">CQ: Min dB</span> to respond automatically to the weakest station's reply to your CQ.</p><p>When CQ or QRZ is pending, Enable Tx may be armed before or during a receive period. Only eligible direct callers decoded after it is armed in that period can replace the pending transmission; earlier callers are not retained.</p></body></html> @@ -1670,10 +1627,10 @@ When not checked you can view the calibration results. Qt::StrongFocus - <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to toggle the checkbox enabled/disabled. Fox and Hound modes lock the required sequence.</p></body></html> - <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to freeze the state of the checkbox. Right-click either the FT8 or MSK button to unfreeze.</p></body></html> + <html><head/><body><p>Check to Tx in even-numbered minutes or sequences, starting at 0; uncheck for odd sequences. Right-click to toggle the checkbox enabled/disabled. Fox and Hound modes lock the required sequence.</p></body></html> Tx even/1st @@ -2013,7 +1970,7 @@ When not checked you can view the calibration results. - 1 + 0 @@ -2217,6 +2174,12 @@ When not checked you can view the calibration results. 1 + + 4 + + + 4 + @@ -2264,11 +2227,11 @@ When not checked you can view the calibration results. - <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + <html><head/><body><p>Send this message in next Tx interval</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> Send this message in next Tx interval -Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type 2 compound call holders) +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode RR73 messages should only be used when you are reasonably confident that no message repetitions will be required @@ -2323,9 +2286,6 @@ Double click to toggle the use of the Tx1 message to start a QSO with a station <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to reset to the standard 73 message</p><p>Right-click to retain Tx5 free text</p></body></html> - - padding-left: 15%; padding-right: 15%; padding-top: 3%; padding-bottom: 3% - Tx &5 @@ -2339,9 +2299,6 @@ Double click to toggle the use of the Tx1 message to start a QSO with a station Switch to this Tx message NOW - - padding-left: 15%; padding-right: 15%; padding-top: 3%; padding-bottom: 3% - Tx &2 @@ -2424,9 +2381,6 @@ Double click to toggle the use of the Tx1 message to start a QSO with a station Switch to this Tx message NOW - - padding-left: 15%; padding-right: 15%; padding-top: 3%; padding-bottom: 3% - Tx &3 @@ -2438,16 +2392,13 @@ Double click to toggle the use of the Tx1 message to start a QSO with a station - <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders)</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> + <html><head/><body><p>Switch to this Tx message NOW</p><p>Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode</p><p>RR73 messages should only be used when you are reasonably confident that no message repetitions will be required</p></body></html> Switch to this Tx message NOW -Double-click to toggle between RRR and RR73 messages in Tx4 (not allowed for type2 compound call holders) +Double-click to toggle between RRR and RR73 messages in Tx4 when supported by the current mode RR73 messages should only be used when you are reasonably confident that no message repetitions will be required - - padding-left: 15%; padding-right: 15%; padding-top: 3%; padding-bottom: 3% - Tx &4 @@ -2468,9 +2419,6 @@ Double click to toggle the use of the Tx1 message to start a QSO with a station Qt::LeftToRight - - padding-left: 15%; padding-right: 15%; padding-top: 3%; padding-bottom: 3% - Tx &1 @@ -2484,9 +2432,6 @@ Double click to toggle the use of the Tx1 message to start a QSO with a station Switch to this Tx message NOW - - padding-left: 15%; padding-right: 15%; padding-top: 3%; padding-bottom: 3% - Tx &6 @@ -2701,11 +2646,6 @@ Double-click to reset to the standard 73 message - - - 9 - - Queue @@ -3032,7 +2972,6 @@ Double-click to reset to the standard 73 message border-width: 1px; border-radius: 5px; border-color: black; - min-width: 5em; padding: 3px; } @@ -3696,6 +3635,479 @@ Double-click to reset to the standard 73 message + + + + + + + 0 + 0 + + + + + + + + 16777215 + 16777215 + + + + Audio Tx frequency + + + Qt::AlignCenter + + + Hz + + + Tx + + + 200 + + + 5000 + + + 1500 + + + + + + + + 0 + 0 + + + + Frequency tolerance (Hz) + + + Qt::AlignCenter + + + F Tol + + + 1 + + + 1000 + + + 10 + + + + + + + + 0 + 0 + + + + + 15 + 0 + + + + + 35 + 16777215 + + + + Set Tx frequency to Rx Frequency + + + Set Tx frequency to Rx Frequency + + + ▲ + + + + + + + + 16777215 + 16777215 + + + + Audio Rx frequency + + + Qt::AlignCenter + + + Hz + + + Rx + + + 200 + + + 5000 + + + 1500 + + + + + + + + 0 + 0 + + + + + 15 + 0 + + + + + 35 + 16777215 + + + + Set Rx frequency to Tx Frequency + + + Set Rx frequency to Tx Frequency + + + ▼ + + + + + + + + + + GroupBox + + + + + + + + CQ %M CQ + + + Qt::AlignCenter + + + + + + + %H 599 %N + + + Qt::AlignCenter + + + + + + + %H TU CQ %M CQ + + + Qt::AlignCenter + + + + + + + %M + + + Qt::AlignCenter + + + + + + + %H + + + Qt::AlignCenter + + + + + + + TU NOW %Q 599 %N + + + Qt::AlignCenter + + + + + + + %H AGN? + + + Qt::AlignCenter + + + + + + + 599 %N + + + Qt::AlignCenter + + + + + + + CQ + + + F1 + + + + + + + HisCall Exchange + + + F2 + + + + + + + TU CQ + + + F3 + + + + + + + MyCall + + + F4 + + + + + + + HisCall + + + F5 + + + + + + + Now QueuedCall Exchange + + + F6 + + + + + + + HisCall AGN ? + + + F7 + + + + + + + Exchange + + + F8 + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 300 + 20 + + + + + + + + + 75 + 0 + + + + + 100 + 16777215 + + + + Serial number of QSO for contest exchange. + + + Qt::AlignCenter + + + 1 + + + 5000 + + + 1 + + + + + + + + 0 + 0 + + + + Send and clear the message. Press Enter in the field. + + + Send message + + + + + + + + 0 + 0 + + + + + 100 + 16777215 + + + + Call next + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Press Enter to send and clear the message. + + + + + + + Serial Number + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 100 + 16777215 + + + + Callsign to be worked next. + + + + + + + @@ -3848,111 +4260,6 @@ Double-click to reset to the standard 73 message 0 - - - Random - - - - - 1/2 - - - - - 2/2 - - - - - 1/3 - - - - - 2/3 - - - - - 3/3 - - - - - 1/4 - - - - - 2/4 - - - - - 3/4 - - - - - 4/4 - - - - - 1/5 - - - - - 2/5 - - - - - 3/5 - - - - - 4/5 - - - - - 5/5 - - - - - 1/6 - - - - - 2/6 - - - - - 3/6 - - - - - 4/6 - - - - - 5/6 - - - - - 6/6 - - @@ -4085,7 +4392,6 @@ Double-click to reset to the standard 73 message border-width: 1px; border-radius: 5px; border-color: black; - min-width: 5em; padding: 3px; } @@ -4284,6 +4590,9 @@ Double-click to reset to the standard 73 message K1JT + + 6 + Qt::AlignCenter @@ -4361,8 +4670,6 @@ Double-click to reset to the standard 73 message QLabel { - font-family: MS Shell Dlg 2; - font-size: 16pt; color : yellow; background-color : black; } @@ -4382,7 +4689,20 @@ QLabel[oob="true"] { - + + + + 0 + + + 0 + + + 0 + + + 0 + @@ -4549,7 +4869,8 @@ QLabel[oob="true"] { - + + @@ -4561,8 +4882,6 @@ QLabel[oob="true"] { QLabel { - font-family: MS Shell Dlg 2; - font-size: 16pt; background-color : black; color : yellow; } @@ -4591,7 +4910,77 @@ QLabel[oob="true"] { - + + + + 0 + 0 + + + + + 2 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 12 + + + 8 + + + + + CQ messages only. + + + CQ only + + + + + + + Bypass Filters toggled via Settings or the Filters menu. + + + BP + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 0 + 0 + + + + + + + + @@ -4677,7 +5066,10 @@ QPushButton[state="ok"] { - + + + + @@ -4691,8 +5083,8 @@ QPushButton[state="ok"] { 0 0 - 880 - 17 + 876 + 22 @@ -4898,13 +5290,13 @@ QPushButton[state="ok"] { - + @@ -4920,6 +5312,7 @@ QPushButton[state="ok"] { + @@ -4968,7 +5361,7 @@ QPushButton[state="ok"] {
- About WSJT-X + About WSJT-X™ QAction::AboutRole @@ -4991,13 +5384,16 @@ QPushButton[state="ok"] { Open next in directory + + Ctrl+X + Decode remaining files in directory - Shift+F6 + Alt+X @@ -5173,9 +5569,6 @@ QPushButton[state="ok"] { Message averaging - - F7 - @@ -5205,9 +5598,6 @@ QPushButton[state="ok"] { Echo Graph - - F8 - @@ -5232,9 +5622,6 @@ QPushButton[state="ok"] { Fast Graph - - F9 - @@ -5349,6 +5736,11 @@ QPushButton[state="ok"] { Shift+F1 + + + Trademark policy + + false @@ -5552,14 +5944,6 @@ QPushButton[state="ok"] { Quick-Start Guide to WSJT-X 2.7 and QMAP - - - Recommended audio settings - - - <html><head/><body><p>Recommended Audio Settings.</p></body></html> - - How to deal with rig control errors @@ -6124,9 +6508,23 @@ QPushButton[state="ok"] { Highlight Whitelist entries + + + true + + + JTTY + + + + CurrentPageHeightStackedWidget + QStackedWidget +
widgets/CurrentPageHeightStackedWidget.hpp
+ 1 +
DisplayText QTextBrowser @@ -6143,6 +6541,11 @@ QPushButton[state="ok"] {
widgets/signalmeter.h
1
+ + TxDriveSlider + QSlider +
widgets/TxDriveSlider.hpp
+
HintedSpinBox QSpinBox @@ -6172,7 +6575,6 @@ QPushButton[state="ok"] { decodedTextBrowser decodedTextBrowser2 - cbCQonly logQSOButton stopButton monitorButton @@ -6183,21 +6585,64 @@ QPushButton[state="ok"] { stopTxButton tuneButton cbMenus + cbCQonly + cbBypass sbNB + bandComboBox + pb160 + pb80 + pb60 + pb40 + pb30 + pb20 + pb17 + pb15 + pb12 + pb10 + pb8 + pb6 + pb4 + pb2 + pb70 + pb50 + pb144 + pb220 + pb432 + pb902 + pb23 + pb13 + pb9 + pb5G + pb10G + pb24G + labDialFreq + readFreq + houndButton + ft8Button + ft4Button + msk144Button + q65Button + jt65Button dxCallEntry dxGridEntry + DX_Call_Button + lookupButton + addButton + ignoreButton txFirstCheckBox + cbHoldTxFreq TxFreqSpinBox + sbSubmode pbR2T sbFtol pbT2R + sbMaxDrift RxFreqSpinBox rptSpinBox - sbTR - cbHoldTxFreq + sbSerialNumber sbF_Low sbF_High - sbSubmode + sbTR syncSpinBox sbCQTxFreq cbCQTx @@ -6205,30 +6650,81 @@ QPushButton[state="ok"] { cbShMsgs cbFast9 cbAutoSeq + respondComboBox cbTx6 cbSWL pbBestSP measure_check_box tabWidget - genStdMsgsPushButton - tx1 txrb1 - txb1 - tx2 txrb2 - txb2 - tx3 txrb3 - txb3 - tx4 txrb4 - txb4 - tx5 txrb5 - txb5 - tx6 txrb6 + txb1 + txb2 + txb3 + txb4 + txb5 txb6 + genStdMsgsPushButton + tx1 + tx2 + tx3 + tx4 + tx5 + tx6 + houndQueueTextBrowser + foxTxListTextBrowser + comboBoxHoundSort + sbNlist + sbNslots + comboBoxCQ + cbWorkDupes + cbMoreCQs + pbFoxReset + pbFreeText + cbSendMsg + cb160m + cb80m + cb40m + cb30m + cb20m + cb17m + cb15m + cb12m + cb10m + cb6m + cb4m + cb2m + cb70cm + cb80mFT4 + cb40mFT4 + cb30mFT4 + cb20mFT4 + cb17mFT4 + cb15mFT4 + cb12mFT4 + cb10mFT4 + cb2mMSK + cbQRG1 + sbQRG1 + cbQRG2 + sbQRG2 + cbQRG3 + sbQRG3 + cbQRG4 + sbQRG4 + cbQRG5 + sbQRG5 + cbQRG6 + sbQRG6 + cbQRG7 + sbQRG7 + cbQRG8 + sbQRG8 + pbBandHopping WSPRfreqSpinBox sbFST4W_RxFreq sbFST4W_FTol @@ -6243,8 +6739,6 @@ QPushButton[state="ok"] { pbTxNext TxPowerComboBox outAttenuation - sbSerialNumber - DX_Call_Button diff --git a/widgets/mainwindow_arrl_digi.cpp b/widgets/mainwindow_arrl_digi.cpp new file mode 100644 index 00000000..616ccdf0 --- /dev/null +++ b/widgets/mainwindow_arrl_digi.cpp @@ -0,0 +1,160 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" +#include "activeStations.h" +#include "ActiveStationList.hpp" +#include "Decoder/decodedtext.h" +#include "models/Bands.hpp" +#include +#include +#include +#include "commons.h" + +extern "C" { + void azdist_(char* MyGrid, char* HisGrid, double* utch, int* nAz, int* nEl, + int* nDmiles, int* nDkm, int* nHotAz, int* nHotABetter, fortran_charlen_t n1, fortran_charlen_t n2); +} + +void MainWindow::ARRL_Digi_Update(DecodedText dt) +{ + if(m_mode=="Q65") { + m_fetched=0; + readWidebandDecodes(); + return; + } + + // Extract information relevant for the ARRL Digi contest + QString deCall; + QString deGrid; + dt.deCallAndGrid(/*out*/deCall,deGrid); + ActiveCall ac; + RecentCall rc; + + if(deGrid.contains(MainWindow::grid_regexp)) { + if(!m_activeCall.contains(deCall) or deGrid!=m_activeCall.value(deCall).grid4) { + // Transmitting station's call is not already in QMap "m_activeCall", or grid has changed. + // Insert the call, grid, and associated fixed data into the list. + + double utch=0.0; + int nAz,nEl,nDmiles,nDkm,nHotAz,nHotABetter; + QString my_Grid = m_config.my_grid(); + if (my_Grid.length() < 5) my_Grid = m_config.my_grid().left(4)+"mm"; + QString de_Grid= deGrid.left(4)+"mm"; + azdist_(const_cast (my_Grid.toLatin1().constData()), + const_cast (de_Grid.toLatin1().constData()),&utch, + &nAz,&nEl,&nDmiles,&nDkm,&nHotAz,&nHotABetter,(fortran_charlen_t)6,(fortran_charlen_t)6); + int points=nDkm/500; + if(nDkm > 500*points) points += 1; + points += 1; + ac.grid4=deGrid; + ac.bands="......."; + ac.az=nAz; + ac.points=points; + m_activeCall[deCall]=ac; + } + } + + m_points=-1; + if(m_activeCall.contains(deCall)) { + +// Don't display stations we already worked on this band. + QString band=m_config.bands()->find(m_operatingFrequency.rx ()); + if(band=="160m" and m_activeCall[deCall].bands.indexOf("a")>=0) {m_recentCall.remove(deCall); return;} + if(band=="80m" and m_activeCall[deCall].bands.indexOf("b")>=0) {m_recentCall.remove(deCall); return;} + if(band=="40m" and m_activeCall[deCall].bands.indexOf("c")>=0) {m_recentCall.remove(deCall); return;} + if(band=="20m" and m_activeCall[deCall].bands.indexOf("d")>=0) {m_recentCall.remove(deCall); return;} + if(band=="15m" and m_activeCall[deCall].bands.indexOf("e")>=0) {m_recentCall.remove(deCall); return;} + if(band=="10m" and m_activeCall[deCall].bands.indexOf("f")>=0) {m_recentCall.remove(deCall); return;} + if(band=="6m" and m_activeCall[deCall].bands.indexOf("g")>=0) {m_recentCall.remove(deCall); return;} + + // Update the variable data for this deCall + rc.dialFreq=m_operatingFrequency.rx (); + rc.audioFreq=dt.frequencyOffset(); + rc.snr=dt.snr(); + m_latestDecodeTime=dt.timeInSeconds(); + rc.txEven = (m_latestDecodeTime % int(2*m_TRperiod)) > 0; + rc.ready2call=false; + auto const words = dt.messageWords(); + bool bCQ=!words.isEmpty() && words.at(0).left(3)=="CQ "; + if(bCQ or deGrid=="RR73" or deGrid=="73") rc.ready2call=true; + rc.decodeTime=m_latestDecodeTime; + m_recentCall[deCall]=rc; + m_points=m_activeCall.value(deCall).points; + } + updateRate(); +} + +void MainWindow::ARRL_Digi_Display() +{ + if(m_mode=="Q65") { + m_fetched=0; + readWidebandDecodes(); + return; + } + if (m_mode == "FT8" && m_specOp == SpecOp::FOX) { + if (m_ActiveStationsWidget != NULL) { + m_ActiveStationsWidget->setClickOK(true); + } + return; + } + QMutableMapIterator icall(m_recentCall); + QString deCall,deGrid; + int age=0; + int maxAge=m_ActiveStationsWidget->maxAge(); + int points=0; + QVector rows; + + while (icall.hasNext()) { + icall.next(); + deCall=icall.key(); + age=int((m_latestDecodeTime - icall.value().decodeTime)/m_TRperiod + 0.5); + if(age<0) age=age + int(86400/m_TRperiod); + int itx=1; + if(icall.value().txEven) itx=0; + int snr=icall.value().snr; + int freq=icall.value().audioFreq; + if(age>maxAge) { + icall.remove(); + } else { + bool bReady=false; + if(age==0 and m_recentCall.value(deCall).ready2call) bReady=true; + + QString bands=m_activeCall[deCall].bands; + bool bWorkedOnBand=false; + if(m_currentBand=="160m" and bands.mid(0,1)!=".") bWorkedOnBand=true; + if(m_currentBand=="80m" and bands.mid(1,1)!=".") bWorkedOnBand=true; + if(m_currentBand=="40m" and bands.mid(2,1)!=".") bWorkedOnBand=true; + if(m_currentBand=="20m" and bands.mid(3,1)!=".") bWorkedOnBand=true; + if(m_currentBand=="15m" and bands.mid(4,1)!=".") bWorkedOnBand=true; + if(m_currentBand=="10m" and bands.mid(5,1)!=".") bWorkedOnBand=true; + if(m_currentBand=="6m" and bands.mid(6,1)!=".") bWorkedOnBand=true; + + if((bReady or !m_ActiveStationsWidget->readyOnly()) and !bWorkedOnBand) { + int az=m_activeCall[deCall].az; + deGrid=m_activeCall[deCall].grid4; + points=m_activeCall[deCall].points; + float x=float(age)/(maxAge+1); + if(x>1.0) x=0; + QString t1; + if(!bReady) t1 = t1.asprintf(" %3d %+2.2d %4d %1d %2d %4d",az,snr,freq,itx,age,points); + if(bReady) t1 = t1.asprintf(" %3d %+2.2d %4d %1d %2d*%4d",az,snr,freq,itx,age,points); +// t1 = (deCall + " ").left(6) + " " + m_activeCall[deCall].grid4 + t1 + " " + bands; + t1 = (deCall + " ").left(6) + " " + m_activeCall[deCall].grid4 + t1; + rows.append({points - x, t1}); + } + } + } + if(rows.isEmpty()) return; + m_ActiveStationsWidget->setClickOK(false); + int maxRecent=qMin(m_ActiveStationsWidget->maxRecent(), MaxActiveStationRows); + rows=sorted_limited_active_station_items(rows, maxRecent, true); + std::fill(m_ready2call.begin(), m_ready2call.end(), QString {}); + QString t; + for(int i=0; idisplayRecentStations(ActiveStations::DisplayMode::Standard,t); + m_ActiveStationsWidget->setClickOK(true); +} diff --git a/widgets/mainwindow_bandhopping.cpp b/widgets/mainwindow_bandhopping.cpp new file mode 100644 index 00000000..c04b93cc --- /dev/null +++ b/widgets/mainwindow_bandhopping.cpp @@ -0,0 +1,236 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" +#include "Configuration.hpp" +#include "models/Bands.hpp" +#include "models/FrequencyList.hpp" +#include "models/Modes.hpp" +#include "widgets/BandHopping.hpp" +#include "widegraph.h" + +#include +#include +#include + +#include +#include + +extern bool m_displayBand; +extern bool keep_frequency; + +namespace +{ + enum class BandHopMode + { + FT8, + FT4, + MSK144, + CustomQRG + }; + + struct BandHopEntry + { + QAbstractButton * checkbox_; + BandHopMode mode_; + int frequency_; + QSpinBox * custom_frequency_; + }; + + Radio::Frequency resolveBandHopFrequency (FrequencyList_v2_101 const& frequencies, + Bands const& bands, + Radio::Frequency requested, + IARURegions::Region region, + Modes::Mode mode) + { + auto const target_band = bands.find (requested); + if (target_band.isEmpty ()) return 0; + + auto const now = QDateTime::currentDateTimeUtc (); + Radio::Frequency result {0}; + Radio::FrequencyDelta delta {std::numeric_limits::max ()}; + for (auto const& candidate : frequencies.frequency_list ()) + { + if (region != IARURegions::ALL + && candidate.region_ != IARURegions::ALL + && candidate.region_ != region) continue; + if (candidate.mode_ != Modes::ALL && candidate.mode_ != mode) continue; + if (candidate.start_time_.isValid () && candidate.start_time_ > now) continue; + if (candidate.end_time_.isValid () && candidate.end_time_ < now) continue; + if (bands.find (candidate.frequency_) != target_band) continue; + if (candidate.preferred_) return candidate.frequency_; + + Radio::FrequencyDelta const candidate_delta = + static_cast (requested) + - static_cast (candidate.frequency_); + if (std::abs (candidate_delta) < std::abs (delta)) + { + delta = candidate_delta; + result = candidate.frequency_; + } + } + return result; + } +} + +void MainWindow::bandHoppingTimer() +{ + if(ui->pbBandHopping->isChecked()) { + static int startIndex = 0; + int nextStartIndex = startIndex +1; + switch (startIndex){ + case 0: + startIndex = nextStartIndex; // band hopping every other minute + return; + case 1: + bandHopping(); + startIndex = 0; + return; + } + } +} + +void MainWindow::bandHopping(bool user_requested) +{ + if (!ui->pbBandHopping->isChecked()) return; + bool const schedule_blocked = ui->autoButton->isChecked() || ui->tuneButton->isChecked (); + + static int startIndex = 0; + + BandHopEntry entries[] = + { + {ui->cb160m, BandHopMode::FT8, 1840000, nullptr}, + {ui->cb80m, BandHopMode::FT8, 3573000, nullptr}, + {ui->cb60m, BandHopMode::FT8, 5357000, nullptr}, + {ui->cb40m, BandHopMode::FT8, 7074000, nullptr}, + {ui->cb30m, BandHopMode::FT8, 10136000, nullptr}, + {ui->cb20m, BandHopMode::FT8, 14074000, nullptr}, + {ui->cb17m, BandHopMode::FT8, 18100000, nullptr}, + {ui->cb15m, BandHopMode::FT8, 21074000, nullptr}, + {ui->cb12m, BandHopMode::FT8, 24915000, nullptr}, + {ui->cb10m, BandHopMode::FT8, 28074000, nullptr}, + {ui->cb6m, BandHopMode::FT8, 50313000, nullptr}, + {ui->cb4m, BandHopMode::FT8, 70154000, nullptr}, + {ui->cb2m, BandHopMode::FT8, 144174000, nullptr}, + {ui->cb70cm, BandHopMode::FT8, 432174000, nullptr}, + {ui->cb80mFT4, BandHopMode::FT4, 3575000, nullptr}, + {ui->cb40mFT4, BandHopMode::FT4, 7047500, nullptr}, + {ui->cb30mFT4, BandHopMode::FT4, 10140000, nullptr}, + {ui->cb20mFT4, BandHopMode::FT4, 14080000, nullptr}, + {ui->cb17mFT4, BandHopMode::FT4, 18104000, nullptr}, + {ui->cb15mFT4, BandHopMode::FT4, 21140000, nullptr}, + {ui->cb12mFT4, BandHopMode::FT4, 24919000, nullptr}, + {ui->cb10mFT4, BandHopMode::FT4, 28180000, nullptr}, + {ui->cb2mMSK, BandHopMode::MSK144, 144360000, nullptr}, + {ui->cbQRG1, BandHopMode::CustomQRG, 0, ui->sbQRG1}, + {ui->cbQRG2, BandHopMode::CustomQRG, 0, ui->sbQRG2}, + {ui->cbQRG3, BandHopMode::CustomQRG, 0, ui->sbQRG3}, + {ui->cbQRG4, BandHopMode::CustomQRG, 0, ui->sbQRG4}, + {ui->cbQRG5, BandHopMode::CustomQRG, 0, ui->sbQRG5}, + {ui->cbQRG6, BandHopMode::CustomQRG, 0, ui->sbQRG6}, + {ui->cbQRG7, BandHopMode::CustomQRG, 0, ui->sbQRG7}, + {ui->cbQRG8, BandHopMode::CustomQRG, 0, ui->sbQRG8}, + }; + + auto const entry_count = sizeof entries / sizeof entries[0]; + std::vector selected (entry_count); + for (std::size_t index = 0; index < entry_count; ++index) + { + selected[index] = entries[index].checkbox_->isChecked (); + } + + // Checkboxes are live controls; a user can leave the active set empty while + // band hopping remains on, so the scan must terminate without recursive wrap. + auto const hop_index = next_band_hop_index (selected, startIndex); + if (hop_index < 0) + { + startIndex = 0; + showStatusMessage (tr ("Band hopping has no selected frequencies.")); + return; + } + + auto const& entry = entries[hop_index]; + auto const frequency = BandHopMode::CustomQRG == entry.mode_ + ? entry.custom_frequency_->value () * 1000 + : entry.frequency_; + + auto const origin = user_requested + ? FrequencyRequestOrigin::User + : FrequencyRequestOrigin::Automatic; + auto const skip_hop = [&] { + if (!user_requested) startIndex = hop_index + 1; + }; + if (!nominalFrequencyChangeAllowed (origin)) + { + skip_hop (); + return; + } + if (schedule_blocked) + { + skip_hop (); + return; + } + if (entry.mode_ == BandHopMode::CustomQRG) + { + keep_frequency = true; + if (!RigFrequencyChangePolicy::requestWhileMonitoring ( + m_monitoring, + [this] (bool state) {monitor (state);}, + [this, frequency, origin] { + return requestNominalFrequencyChange (frequency, origin); + })) + { + keep_frequency = false; + skip_hop (); + return; + } + m_displayBand = false; + QTimer::singleShot (250, [=] {keep_frequency = false;}); + setXIT (ui->TxFreqSpinBox->value ()); + on_actionFT8_triggered (); + ui->pbBandHopping->setChecked (true); + startIndex = hop_index + 1; + return; + } + + Modes::Mode mode {Modes::FT8}; + if (entry.mode_ == BandHopMode::FT4) mode = Modes::FT4; + if (entry.mode_ == BandHopMode::MSK144) mode = Modes::MSK144; + auto const requested_frequency = resolveBandHopFrequency ( + *m_config.frequencies (), *m_config.bands (), frequency, m_config.region (), mode); + if (!requested_frequency) + { + skip_hop (); + return; + } + + auto const previous_frequency = m_operatingFrequency.rx (); + if (!RigFrequencyChangePolicy::requestWhileMonitoring ( + m_monitoring, + [this] (bool state) {monitor (state);}, + [this, requested_frequency, origin] { + return requestNominalFrequencyChange (requested_frequency, origin); + })) + { + skip_hop (); + return; + } + + m_displayBand = false; + keep_frequency = true; + switch (entry.mode_) + { + case BandHopMode::FT8: on_actionFT8_triggered (); break; + case BandHopMode::FT4: on_actionFT4_triggered (); break; + case BandHopMode::MSK144: on_actionMSK144_triggered (); break; + case BandHopMode::CustomQRG: Q_UNREACHABLE (); + } + keep_frequency = false; + + auto const& row = m_config.frequencies ()->best_working_frequency (requested_frequency); + if (row >= 0) ui->bandComboBox->setCurrentIndex (row); + m_bandEdited = true; + applyBandChange (requested_frequency, previous_frequency); + setXIT (ui->TxFreqSpinBox->value ()); + m_wideGraph->setRxBand (m_config.bands ()->find (requested_frequency)); + ui->pbBandHopping->setChecked (true); + startIndex = hop_index + 1; +} diff --git a/widgets/mainwindow_jtty.cpp b/widgets/mainwindow_jtty.cpp new file mode 100644 index 00000000..91058f4d --- /dev/null +++ b/widgets/mainwindow_jtty.cpp @@ -0,0 +1,1176 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" +#include "widegraph.h" +#include "commons.h" +#include "JttyMessages.hpp" +#include "JttyN1mm.hpp" +#include "JttyReplay.hpp" +#include "Logger.hpp" +#include +#include +#include "Modulator/Modulator.hpp" +#include +#include +#include +#include +#ifdef WIN32 +#include "MMTTYIF.hpp" +#undef MessageBox +#endif + + +extern dec_data_t& dec_data; +extern qint32 g_iptt; + +namespace +{ + Jtty::NativeExchangeProfile jttyExchangeProfile(Configuration const& configuration) + { + switch (configuration.special_op_id()) { + case Configuration::SpecialOperatingActivity::FIELD_DAY: + return Jtty::NativeExchangeProfile::FieldDay; + case Configuration::SpecialOperatingActivity::RTTY: + return Jtty::NativeExchangeProfile::RttyRoundup; + default: + return Jtty::NativeExchangeProfile::None; + } + } + + Jtty::NativeMacroContext jttyNativeMacroContext( + Configuration const& configuration, QString const& hisCall, int serialNumber) + { + Jtty::NativeMacroContext context; + context.myCall = configuration.my_callsign(); + context.hisCall = hisCall; + context.serialNumber = serialNumber; + context.grid = configuration.my_grid(); + context.exchangeProfile = jttyExchangeProfile(configuration); + + switch (context.exchangeProfile) { + case Jtty::NativeExchangeProfile::FieldDay: + context.configuredExchange = Jtty::normalizedFieldDayExchange( + configuration.Field_Day_Exchange()); + break; + case Jtty::NativeExchangeProfile::RttyRoundup: + context.configuredExchange = configuration.RTTY_Exchange(); + break; + default: + break; + } + return context; + } + + QString jttyNativeEncodeError(int status) + { + if (status == static_cast(Jtty::NativeEncodeStatus::UnknownSection)) { + return QStringLiteral("Field Day section is not registered in the ARRL/RAC table"); + } + return QStringLiteral("native atom encoding failed"); + } +} + +#define FCL fortran_charlen_t + +namespace +{ + constexpr int jttyMaxUpdates = 30; + constexpr int jttyMessageSize = Jtty::maxMessageLength; + constexpr int jttyUpdateBufferSize = jttyMaxUpdates * jttyMessageSize; + + QString formatJttyDecodeLine (float frequency, QString const& message) + { + QString const frequencyText = QStringLiteral("%1").arg(qRound(frequency), 4); + return message.isEmpty() ? frequencyText : frequencyText + QStringLiteral(" ") + message; + } +} + +extern "C" { + void rjtty_sub_(short int d2[], int* k, int* nsps, int* nfa, int*nfb, + float* f0, float* ftol); + + // Bounds the scan to [istart0,istop] (sample indices into d2) instead of + // the whole buffer -- see MainWindow::jtty_decode_windowed(). + void rjtty_sub_windowed_(short int d2[], int* k, int* nsps, int* nfa, int*nfb, + float* f0, float* ftol, int* istart0, int* istop); + + void jtty_get_updates_(char text_blocks[], qint64 message_ids[], + float frequencies[], float start_tsync[], bool eom[], + int* count, fortran_charlen_t); + + void genjtty_profile_(char * msg, int const* exchange_profile, + int itone[], int* nsym, fortran_charlen_t); + void genjtty_atoms_c(Jtty::NativeAtomDescriptor const atoms[], int natoms, + int itone[], int* nsym, int* status); + + void gen_jttywave_(int itone[], int* nsym, int* nsps, float* bt, float* fsample, float* f0, + float xjunk[], float wave[], int* icmplx, int* nwave); +} + +#ifdef WIN32 +static QString append_separator(QString message) { + if (!message.isEmpty()) { + QChar lastChar = message.at(message.length() - 1); + if (lastChar != '\r' && lastChar != '\n' && lastChar != ' ') { + message += "\r\n"; + } + } + return message; +} +#endif + +void MainWindow::jtty_save_wav() +{ + // Reject callers that arrive before a real JTTY capture exists; m_k0 is + // still the initial sentinel, or is stale from an earlier interval. + if (!Jtty::wavCaptureValid (m_k0)) return; + if (m_k0 == m_jttyLastSavedWavK0) return; //Guard against re-saving same audio under a new timestamp + m_jttyLastSavedWavK0 = m_k0; + + //Save JTTY data to a .wav file + QDateTime now {QDateTime::currentDateTimeUtc ()}; + qint64 ms = m_k0/12; + auto const& tstart=now.addMSecs(-ms); + m_fnameWE=m_config.save_directory().absoluteFilePath (tstart.toString("yyMMdd_hhmmss")); + int samples=m_k0; + QString dgrd = "jtty"; + save_wave_file (m_fnameWE, samples, m_freqNominalPeriod, dgrd); + // "Save decoded" keeps the file only if something was decoded; give the + // decoder a further 3 seconds to finish before killWaveFile() decides. + if (m_saveDecoded) killFileTimer.start (3000); +} + +void MainWindow::updateJttyDecodeHeadings() +{ + QString const prefix = ui->cbIncludeTime->isChecked() + ? QStringLiteral(" UTC Freq ") : QStringLiteral("Freq "); + ui->lh_decodes_headings_label->setText(prefix + tr ("Message")); + ui->rh_decodes_headings_label->setText(prefix + tr ("Message")); +} + +void MainWindow::on_cbIncludeTime_toggled(bool) +{ + if (m_mode == "JTTY") { + updateJttyDecodeHeadings(); + renderJttyAllFreqLines(); + renderJttyQsoLines(); + } +} + +void MainWindow::renderJttyAllFreqLines() +{ + if (m_jttyAllFreqLines.isEmpty()) return; + + QStringList displayLines; + for (auto const& line : m_jttyAllFreqLines) { + QString displayLine = formatJttyDecodeLine ( + line.frequency, Jtty::wrapMessage (line.text)); + if (ui->cbLowerCase->isChecked ()) displayLine = displayLine.toLower (); + if (ui->cbIncludeTime->isChecked ()) { + QString const time = Jtty::jttyLineTimeLabel (line.messageStartUtc); + if (!time.isEmpty ()) displayLine = time + " " + displayLine; + } + displayLines.append (displayLine); + } + + QTextCharFormat format; + format.setFont (ui->decodedTextBrowser->contentFont ()); + + QTextCursor cursor = ui->decodedTextBrowser->textCursor (); + if (m_jttyAllFreqsGroupStart.isValid ()) { + cursor.setPosition (m_jttyAllFreqsGroupStart.position ()); + cursor.movePosition (QTextCursor::End, QTextCursor::KeepAnchor); + cursor.removeSelectedText (); + } else { + cursor.movePosition (QTextCursor::End); + if (cursor.position () > 0) cursor.insertBlock (); + } + m_jttyAllFreqsGroupStart = cursor.block (); + cursor.insertText (displayLines.join (QChar {'\n'}), format); + ui->decodedTextBrowser->setTextCursor (cursor); + ui->decodedTextBrowser->ensureCursorVisible (); +} + +void MainWindow::renderJttyQsoLines() +{ + if (m_jttyQsoLines.isEmpty ()) { + m_jttyQsoRenderedLowerCase = ui->cbLowerCase->isChecked (); + m_jttyQsoRenderedIncludeTime = ui->cbIncludeTime->isChecked (); + return; + } + + QTextCursor cursor = ui->decodedTextBrowser2->textCursor (); + if (m_jttyQsoGroupStart.isValid () && m_jttyQsoGroupEnd.isValid () + && m_jttyQsoGroupEndPosition >= m_jttyQsoGroupStart.position ()) { + cursor.setPosition (m_jttyQsoGroupStart.position ()); + cursor.setPosition (m_jttyQsoGroupEndPosition, QTextCursor::KeepAnchor); + cursor.removeSelectedText (); + } else { + cursor.movePosition (QTextCursor::End); + if (cursor.position () > 0) cursor.insertBlock (); + } + + QTextCharFormat format; + format.setFont (ui->decodedTextBrowser2->contentFont ()); + m_jttyQsoGroupStart = cursor.block (); + QStringList renderedLines; + for (auto const& line : m_jttyQsoLines) { + QString display = formatJttyDecodeLine ( + line.frequency, Jtty::wrapMessage (line.text)); + if (ui->cbLowerCase->isChecked ()) display = display.toLower (); + if (ui->cbIncludeTime->isChecked ()) { + QString const time = Jtty::jttyLineTimeLabel (line.messageStartUtc); + if (!time.isEmpty ()) display = time + " " + display; + } + renderedLines.append (display); + } + cursor.insertText (renderedLines.join (QChar {'\n'}), format); + m_jttyQsoGroupEnd = cursor.block (); + m_jttyQsoGroupEndPosition = cursor.position (); + ui->decodedTextBrowser2->setTextCursor (cursor); + m_jttyQsoRenderedLowerCase = ui->cbLowerCase->isChecked (); + m_jttyQsoRenderedIncludeTime = ui->cbIncludeTime->isChecked (); +} + +bool MainWindow::jtty_decode(int k, int istart0, int istop) +{ + auto jttyLineDateTimeUtc = [this, k] (float tsync) -> QDateTime { + if (m_diskData && m_UTCdiskDateTime.isValid()) { + return m_UTCdiskDateTime.addMSecs(qRound64(1000.0 * tsync)).toUTC(); + } + double const elapsed = qMax(0.0, double(k) / 12000.0 - double(tsync)); + return QDateTime::currentDateTimeUtc().addMSecs(-qRound64(1000.0 * elapsed)); + }; + auto jttyLineDisplayDateTimeUtc = [this, &jttyLineDateTimeUtc] (float tsync) -> QDateTime { + if (m_diskData) { + return Jtty::jttyLineStartTimeUtc (m_UTCdiskDateTime, m_UTCdisk, tsync); + } + return jttyLineDateTimeUtc (tsync); + }; + int nsps=384; + // A non-advancing sample position starts a distinct displayed decode session. + bool const newAllFreqsSession = (k <= m_jttyLastAllFreqsK); + m_jttyLastAllFreqsK = k; + if (newAllFreqsSession) { + flushJttyDecodeLines(); + m_jttyAllFreqsGroupStart = QTextBlock(); + m_jttyQsoGroupStart = QTextBlock(); + m_jttyQsoGroupEnd = QTextBlock(); + m_jttyQsoGroupEndPosition = -1; + m_jttyQsoLines.clear(); + m_jttyAllFreqLines.clear(); + m_bDecoded = false; + m_jttyLastSavedWavK0 = -1; + } + float f0 = ui->RxFreqSpinBox_2->value(); + float ftol = ui->sbFtol_2->value(); + int nfa = m_wideGraph->nStartFreq(); + int nfb = m_wideGraph->Fmax(); + + if (istart0 < 0) { + rjtty_sub_(dec_data.d2,&k,&nsps,&nfa,&nfb,&f0,&ftol); + } else { + rjtty_sub_windowed_(dec_data.d2,&k,&nsps,&nfa,&nfb,&f0,&ftol,&istart0,&istop); + } + + QVector updates; + int updateCount {0}; + do { + std::array textBlocks {}; + std::array messageIds {}; + std::array frequencies {}; + std::array sequenceStarts {}; + std::array complete {}; + jtty_get_updates_(textBlocks.data(), messageIds.data(), frequencies.data(), + sequenceStarts.data(), complete.data(), &updateCount, + (FCL)jttyUpdateBufferSize); + for (int i = 0; i < updateCount; ++i) { + QString const text = QString::fromLatin1( + textBlocks.data() + i * jttyMessageSize, jttyMessageSize).trimmed(); + if (messageIds[i] <= 0) continue; + updates.append({messageIds[i], frequencies[i], text, + sequenceStarts[i], complete[i]}); + } + } while (updateCount == jttyMaxUpdates); + + bool const allHistoryChanged = Jtty::mergeMessageUpdates( + m_jttyAllFreqLines, updates, + [this, &jttyLineDateTimeUtc, &jttyLineDisplayDateTimeUtc] (Jtty::MessageUpdate const& update) { + JttyDecodeLine decodeLine; + decodeLine.messageId = update.messageId; + decodeLine.frequency = update.frequency; + decodeLine.text = update.text; + decodeLine.sequenceStart = update.sequenceStart; + decodeLine.messageStartUtc = jttyLineDisplayDateTimeUtc (update.sequenceStart); + decodeLine.complete = update.complete; + decodeLine.context = currentDecodeOperatingContext(); + decodeLine.context.sequenceStart = jttyLineDateTimeUtc(update.sequenceStart); + return decodeLine; + }); + + if (allHistoryChanged) renderJttyAllFreqLines (); + + for (auto& known : m_jttyAllFreqLines) { + if (known.complete && !known.written) { + write_all("Rx", formatJttyDecodeLine(known.frequency, known.text), &known.context); + known.written = true; + } + } + + bool const qsoDisplayOptionsChanged = !m_jttyQsoLines.isEmpty() + && (m_jttyQsoRenderedLowerCase != ui->cbLowerCase->isChecked() + || m_jttyQsoRenderedIncludeTime != ui->cbIncludeTime->isChecked()); + bool anyEom {false}; + bool anyLineChanged {false}; + for (auto const& update : updates) { + auto known = std::find_if(m_jttyQsoLines.begin(), m_jttyQsoLines.end(), + [&update] (JttyQsoLine const& line) { + return line.messageId == update.messageId; + }); + bool const alreadyPresent = known != m_jttyQsoLines.end(); + if (!Jtty::shouldApplyToQsoHistory( + alreadyPresent, update.frequency, f0, ftol)) { + continue; + } + if (update.complete) anyEom = true; + + QString delta; +#ifdef WIN32 + bool startNew{false}; //Set to "true" when N1MM should start display of text on a new line +#endif + if (alreadyPresent) { + auto const change = Jtty::compareMessages(known->text, update.text); + bool const frequencyChanged = known->frequency != update.frequency; + if (!change.messageChanged && !frequencyChanged) continue; + if (change.messageChanged) { + if (change.extendsMessage) { + delta = change.appendedText; +#ifdef WIN32 + startNew = change.startsMessage; +#endif + } else { + delta = update.text; +#ifdef WIN32 + startNew = true; +#endif + } + } + known->frequency = update.frequency; + known->text = update.text; + } else { +#ifdef WIN32 + startNew = true; +#endif + delta = update.text; + auto const allLine = std::find_if ( + m_jttyAllFreqLines.cbegin (), m_jttyAllFreqLines.cend (), + [&update] (JttyDecodeLine const& line) { + return line.messageId == update.messageId; + }); + QDateTime const messageStartUtc = allLine != m_jttyAllFreqLines.cend () + ? allLine->messageStartUtc + : jttyLineDisplayDateTimeUtc (update.sequenceStart); + m_jttyQsoLines.append({update.messageId, update.frequency, update.text, + update.sequenceStart, messageStartUtc}); + } + anyLineChanged = true; + m_bDecoded = true; + +#ifdef WIN32 + if (m_mmttyif && !delta.isEmpty()) { +// m_mmttyif->echo_message_to_n1mm(append_separator(delta)); + if(ui->cbLowerCase->isChecked()) delta = delta.toLower(); + if(startNew) delta = "\r\n" + delta; + m_mmttyif->echo_message_to_n1mm(delta); + } +#endif + } + + if (anyLineChanged || qsoDisplayOptionsChanged) renderJttyQsoLines (); + return anyEom; +} + +void MainWindow::jtty_tx(QString message) +{ + // Render and enqueue immediately; the shared transmit buffer chains messages + // gaplessly while playback is underway. + submitJttyText(message); +} + +qint64 MainWindow::submitJttyText(QString message) +{ + qint64 const requestId = ++m_jttyTxRequestId; + execute_jtty_tx(requestId, message); + return requestId; +} + +void MainWindow::submitJttyDraft(QString message) +{ + if (m_jttyDraftAcceptanceTracker.hasPendingSubmissionForCurrentDraft ()) { + ui->Tx_Message->selectAll (); + return; + } + + qint64 const requestId = ++m_jttyTxRequestId; + m_jttyDraftAcceptanceTracker.trackSubmission (requestId); + execute_jtty_tx (requestId, message); + if (m_jttyDraftAcceptanceTracker.isPending (requestId)) { + ui->Tx_Message->selectAll (); + } +} + +void MainWindow::execute_jtty_tx(qint64 requestId, QString message) +{ + int itone[944]; + // Captured before anything below can change m_jttyTxActive: true means + // this message is being queued behind one still transmitting, not + // starting a fresh session. + bool const isChainedMessage = m_jttyTxActive; + if(ui->cbLowerCase->isChecked()) message = message.toLower(); + + auto const preparedMessage = Jtty::prepareTransmitText(message); + if (preparedMessage.changed()) { + LOG_WARN("JTTY transmit message was normalized or shortened before encoding"); + } + message = preparedMessage.text; + if (message.isEmpty()) { + Q_EMIT jttyTextRejected(requestId, JttyTxRejectReason::Empty); + return; + } + + // Keep message as the logical text; the chained leading space is only + // transport spacing and must not leak into logging, display, or the contest + // serial check in completeJttyTxEnqueue. + auto transmitFrame = Jtty::transmitFrame(message, isChainedMessage).toLatin1(); + + int nsym=0; + int const exchangeProfile = static_cast(jttyExchangeProfile(m_config)); + genjtty_profile_(transmitFrame.data(), &exchangeProfile, + &itone[0], &nsym, (FCL)80); + if (nsym <= 0) { + LOG_WARN("JTTY transmit message could not be encoded"); + Q_EMIT jttyTextRejected(requestId, JttyTxRejectReason::EncodingFailed); + return; + } + + message = QString::fromLatin1(transmitFrame).trimmed(); + execute_jtty_tones(requestId, message, itone, nsym); +} + +void MainWindow::execute_jtty_tones(qint64 requestId, QString const& message, + int const itone[], int nsym) +{ + m_nsym_jtty=nsym; + + int nsps4=4*384; + float bt=2.0; + float fsample=48000.0; + float f0=ui->TxFreqSpinBox_2->value (); + int icmplx=0; + int nwave=nsps4*m_nsym_jtty; + + bool const newSession = !m_jttyTxActive; + if (newSession) { + advanceJttyTxQueueEpoch(); + m_jttyTxUsesTciAudio = m_tci_audio; + } + bool const useTciAudio = m_jttyTxUsesTciAudio; + + std::vector wave(nwave > 0 ? nwave : 1); + gen_jttywave_(const_cast(itone), &m_nsym_jtty, &nsps4, &bt, &fsample, &f0, + wave.data(), wave.data(), &icmplx, &nwave); + + QVector samples; + samples.reserve(nwave); + for(int i=0; i 32767.0f) v = 32767.0f; + if(v < -32768.0f) v = -32768.0f; + samples.append(static_cast(qRound(v))); + } + if (samples.isEmpty()) { + Q_EMIT jttyTextRejected(requestId, JttyTxRejectReason::EncodingFailed); + return; + } + + if (newSession) { + // A fresh JTTY session starts a new FIFO accounting baseline even after a + // natural drain, so drain totals remain session-relative. + if (useTciAudio) { + Q_EMIT m_config.transceiver_clear_jtty_pcm(m_jttyTxQueueEpoch); + } else { + m_jttyTxQueue->clear(m_jttyTxQueueEpoch); + } + } + + bool enqueued {false}; + TxAudioQueueProgress enqueueProgress; + if(useTciAudio) { + // TCI enqueue is asynchronous. MainWindow can reject a message that can + // never fit; backend occupancy failures reject only the submitted enqueue. + if (samples.size () <= TxAudioQueue::defaultCapacity ()) { + QByteArray bytes(reinterpret_cast (samples.constData ()), + samples.size () * int (sizeof (qint16))); + qint64 const enqueueId = ++m_jttyTciEnqueueId; + m_pendingJttyTciMessages.append(PendingJttyTciMessage { + m_jttyTxQueueEpoch, + enqueueId, + requestId, + samples.size (), + message, + newSession + }); + m_jttyTxActive = true; + Q_EMIT m_config.transceiver_enqueue_jtty_pcm(bytes, m_jttyTxQueueEpoch, + enqueueId); + return; + } else { + LOG_WARN("JTTY TCI transmit FIFO capacity precheck failed; rejecting PCM enqueue"); + Q_EMIT jttyTextRejected(requestId, JttyTxRejectReason::QueueFull); + } + } else { + auto const result = m_jttyTxQueue->enqueue(samples, m_jttyTxQueueEpoch); + enqueued = result.accepted; + enqueueProgress = result.progress; + if (!enqueued) { + LOG_WARN("JTTY transmit FIFO overflow; rejecting PCM enqueue"); + } + } + + if (!enqueued) { + if (!useTciAudio) { + Q_EMIT jttyTextRejected(requestId, JttyTxRejectReason::QueueFull); + } + if (newSession) { + advanceJttyTxQueueEpoch(); + } + return; + } + + completeJttyTxEnqueue(requestId, message, enqueueProgress, newSession, useTciAudio); +} + +void MainWindow::advanceJttyTxQueueEpoch() +{ + m_jttyTxQueueEpoch = TxAudioQueueEpoch {m_jttyTxQueueEpoch.value () + 1}; + m_jttyTxQueueProgress = {}; + m_jttyTxQueueProgress.epoch = m_jttyTxQueueEpoch; +} + +qint64 MainWindow::jttyTxCommittedSamples() const +{ + return m_jttyTxQueueProgress.total_samples; +} + +void MainWindow::completeJttyTxEnqueue(qint64 requestId, QString const& message, + TxAudioQueueProgress progress, + bool newSession, bool useTciAudio) +{ + if (newSession) { + beginTxEvidenceSession (); + } + m_currentMessage = message; + qint64 const endSample = progress.total_samples; + recordAcceptedJttyTextRequest(requestId, endSample); + m_jttyTxQueueProgress = progress; + if (m_txEvidenceGeneration.isValid () && + m_txEvidenceSourceSession == m_txEvidenceSession) { + m_txPlaybackDiagnostics.commitTarget (m_txEvidenceSession, + m_txEvidenceGeneration, + progress.total_samples - 1, false); + auto const sessionId = m_txEvidenceSession; + auto const generation = m_txEvidenceGeneration; + auto const totalSamples = progress.total_samples; + QTimer::singleShot (0, this, [this, sessionId, generation, totalSamples] { + LOG_INFO (QString ("TX playout evidence JTTY target commit session=%1 generation=%2 total=%3\n%4") + .arg (sessionId.value ()).arg (generation.value ()) + .arg (totalSamples).arg (m_txPlaybackDiagnostics.diagnosticDump ())); + }); + } + m_jttyTxActive = true; + m_transmitting = true; + write_all("Tx", message); + Q_EMIT jttyTextAccepted(requestId); + + ui->decodedTextBrowser2->insertText(" "); + QTextCursor cursor = ui->decodedTextBrowser2->textCursor(); + QTextCharFormat format = cursor.charFormat(); + format.setBackground(QBrush(QColor(Qt::yellow))); + cursor.setCharFormat(format); + cursor.insertText(Jtty::wrapMessage(message)); + format.setBackground(QBrush(QColor(Qt::white))); + cursor.setCharFormat(format); + + handleJttyContestSerial(message); + + // Fault-detector watchdog: generous margin over all audio still to play (the + // whole queued session, not just this message). The happy path completes via + // the backend drain signal well before this fires. + qint64 const pendingSamples = useTciAudio + ? progress.total_samples : progress.queued_samples; + int pendingMs = int(pendingSamples / 48); + startJttyTxWatchdog(pendingMs + 1000 * m_config.txDelay() + 10000); + + monitor(false); + if(!m_diskData && (m_saveAll || m_saveDecoded) && Jtty::wavCaptureValid (m_k0)) { + jtty_save_wav(); + } + +#ifdef WIN32 + if (m_mmttyif) { + m_mmttyif->report_ptt_state(true); + } +#endif + +#ifdef WIN32 + if (m_mmttyif) { + m_mmttyif->echo_message_to_n1mm(append_separator(message)); + } +#endif + + // Only a new session starts transmit; a message appended to an already-active + // session chains gaplessly (soundcard) via the enqueue above. When PTT is not + // yet up, guiUpdate keys it and ptt1Timer -> startTx2 -> transmit starts the + // stream with the normal lead. + if (newSession && g_iptt == 1 && !m_modulator->isActive()) { + startTx2(); + } +} + +void MainWindow::recordAcceptedJttyTextRequest(qint64 requestId, qint64 endSample) +{ + m_acceptedJttyTxRequests.append(AcceptedJttyTxRequest { + m_jttyTxQueueEpoch, + requestId, + endSample + }); +} + +QVector MainWindow::takeCompletedJttyTextRequests( + TxAudioQueueEpoch epoch, qint64 totalAtDrain) +{ + // Backends report only final drain, so per-text completion is observed when + // the accepted text's containing JTTY session has drained. + QVector completedRequestIds; + for (int i = 0; i < m_acceptedJttyTxRequests.size ();) { + auto const accepted = m_acceptedJttyTxRequests.at (i); + if (accepted.epoch == epoch && accepted.endSample <= totalAtDrain) { + completedRequestIds.append(accepted.requestId); + m_acceptedJttyTxRequests.remove (i); + } else { + ++i; + } + } + return completedRequestIds; +} + +void MainWindow::clearAcceptedJttyTextRequests(TxAudioQueueEpoch epoch) +{ + for (int i = 0; i < m_acceptedJttyTxRequests.size ();) { + if (m_acceptedJttyTxRequests.at (i).epoch == epoch) { + m_acceptedJttyTxRequests.remove (i); + } else { + ++i; + } + } +} + +void MainWindow::handleJttyContestSerial(QString const& message) +{ + if(message.left(3).compare("TU ", Qt::CaseInsensitive) == 0) { + logQSOTimer.start(0); + int nr = ui->sbSerialNumber_2->value(); + m_xSent = QString::number(nr); + ui->sbSerialNumber_2->setValue(nr+1); + } +} + +void MainWindow::abort_jtty_tx() +{ + noteTxStopReason (TxEvidence::TxStopReason::UserHalt); + interruptJttyTx(); + +#ifdef WIN32 + if (m_mmttyif) { + m_mmttyif->report_ptt_state(false); + } +#endif + + stopTx(); +} + +void MainWindow::interruptJttyTx() +{ + if (m_mode != "JTTY" || !m_jttyTxActive) { + return; + } + + auto const interruptedEpoch = m_jttyTxQueueEpoch; + if (!m_jttyTxUsesTciAudio) { + auto const progress = m_jttyTxQueue->progress (); + captureJttyTxEvidenceTotals (progress.served_samples, + progress.total_samples, + QStringLiteral ("JTTY source totals captured before abort")); + } else { + captureJttyTxEvidenceTotals (-1, m_jttyTxQueueProgress.total_samples, + QStringLiteral ("TCI JTTY committed total captured before abort")); + } + advanceJttyTxQueueEpoch(); + clearAcceptedJttyTextRequests(interruptedEpoch); + rejectPendingJttyTciMessages(JttyTxRejectReason::Aborted); + m_pendingJttyTciMessages.clear(); + if (m_jttyTxUsesTciAudio) { + Q_EMIT m_config.transceiver_clear_jtty_pcm(m_jttyTxQueueEpoch); + } else { + m_jttyTxQueue->clear(m_jttyTxQueueEpoch); + } + resetJttyTxState(); +} + +void MainWindow::onJttyBackendDrained(TxAudioQueueDrainState drain) +{ + if (m_mode != "JTTY" || !m_jttyTxActive) { + return; + } + + if (drain.epoch != m_jttyTxQueueEpoch + || drain.total_at_drain != jttyTxCommittedSamples ()) { + return; + } + + qint64 const servedAtDrain = m_jttyTxUsesTciAudio + ? drain.total_at_drain : m_jttyTxQueue->progress ().served_samples; + captureJttyTxEvidenceTotals (servedAtDrain, drain.total_at_drain, + QStringLiteral ("JTTY source totals captured at drain")); + + auto const completedRequestIds = takeCompletedJttyTextRequests( + drain.epoch, drain.total_at_drain); + resetJttyTxState(); + stopTx(); + for (auto const requestId : completedRequestIds) { + Q_EMIT jttyTextCompleted(requestId); + } + Q_EMIT jttySessionDrained(drain.epoch.value ()); +} + +void MainWindow::onJttyBackendEnqueueAccepted(qint64 enqueueId, qint64 sampleCount, + TxAudioQueueProgress progress) +{ + if (m_mode != "JTTY" || !m_jttyTxActive + || progress.epoch != m_jttyTxQueueEpoch) { + return; + } + + for (int i = 0; i < m_pendingJttyTciMessages.size (); ++i) { + auto const pending = m_pendingJttyTciMessages.at (i); + if (pending.epoch != progress.epoch || pending.enqueueId != enqueueId) { + continue; + } + + m_pendingJttyTciMessages.remove (i); + if (sampleCount != pending.sampleCount) { + LOG_WARN("JTTY transmit backend accepted unexpected PCM sample count"); + } + bool const startsSession = pending.newSession + || m_jttyTxQueueProgress.total_samples <= 0; + completeJttyTxEnqueue(pending.requestId, pending.message, progress, + startsSession, true); + return; + } +} + +void MainWindow::onJttyBackendEnqueueFailed(TxAudioQueueEpoch epoch, + qint64 enqueueId) +{ + if (m_mode != "JTTY" || !m_jttyTxActive + || epoch != m_jttyTxQueueEpoch) { + return; + } + + LOG_WARN("JTTY transmit backend rejected PCM enqueue"); + for (int i = 0; i < m_pendingJttyTciMessages.size (); ++i) { + auto const pending = m_pendingJttyTciMessages.at (i); + if (pending.epoch != epoch || pending.enqueueId != enqueueId) { + continue; + } + m_pendingJttyTciMessages.remove (i); + Q_EMIT jttyTextRejected(pending.requestId, JttyTxRejectReason::QueueFull); + if (pending.newSession && m_jttyTxQueueProgress.total_samples <= 0) { + for (int j = 0; j < m_pendingJttyTciMessages.size (); ++j) { + if (m_pendingJttyTciMessages[j].epoch == epoch) { + m_pendingJttyTciMessages[j].newSession = true; + return; + } + } + resetJttyTxState(); + } + return; + } +} + +void MainWindow::rejectPendingJttyTciMessages(JttyTxRejectReason reason) +{ + for (auto const& pending : m_pendingJttyTciMessages) { + Q_EMIT jttyTextRejected(pending.requestId, reason); + } +} + +void MainWindow::handleJttyTxWatchdog() +{ + if (m_mode != "JTTY" || !m_jttyTxActive) { + return; + } + + LOG_WARN("JTTY transmit completion watchdog expired"); + noteTxStopReason (TxEvidence::TxStopReason::Watchdog); + interruptJttyTx(); +#ifdef WIN32 + if (m_mmttyif) { + m_mmttyif->report_ptt_state(false); + } +#endif + stopTx(); +} + +void MainWindow::resetJttyTxState() +{ + m_jttyTxWatchdog.stop(); + m_jttyTxActive = false; + m_jttyTxQueueProgress = {}; + m_jttyTxQueueProgress.epoch = m_jttyTxQueueEpoch; + m_pendingJttyTciMessages.clear(); + m_acceptedJttyTxRequests.clear(); +} + +void MainWindow::startJttyTxWatchdog(int durationMs) +{ + if (durationMs > 0) { + m_jttyTxWatchdog.start(durationMs); + } +} + +void MainWindow::jtty_again() +{ + ui->DecodeButton->setChecked (true); + qApp->processEvents(); //Update the DecodeButton highlight + replayJttyFrames (dec_data.params.kin, [this] (int k) { + jtty_decode(k); + return false; + }); + flushJttyDecodeLines(); + finishDecodeUi(); +} + +// Triggered by double-clicking WideGraph's waterfall in JTTY mode: starts +// the rescan jttyPickLookbackSecs before the clicked time (a message can +// start just before the click) and stops as soon as jtty_decode reports a +// completed (EOM) message, rather than scanning a fixed window. A safety +// cap (jttyPickSafetyCapSecs forward of istart0) bounds how long it keeps +// looking if nothing ever completes -- e.g. the click landed on noise, or +// sync was lost partway through. secondsAgo is relative to m_k0 (the +// buffer position at the last processed block, i.e. "now"). Calls where k +// hasn't yet reached istart0 are cheap no-ops on the Fortran side, so the +// outer loop doesn't need to special-case its own starting point. +void MainWindow::jttyDecodeAgainAt(float secondsAgo) +{ + constexpr int jttyPickLookbackSecs = 5; + constexpr int jttyPickSafetyCapSecs = 40; + qint64 const center = qint64(m_k0) - qint64(qMax(0.0f, secondsAgo) * 12000.0f); + int const istart0 = int(qMax(qint64(1), center - qint64(jttyPickLookbackSecs) * 12000)); + int const frames = snapshotJttyFrames (dec_data.params.kin); + int const istop = int(qMin(qint64(frames), + qint64(istart0) + qint64(jttyPickSafetyCapSecs) * 12000)); + if (istop < istart0) return; // clicked time is no longer in the buffer at all + + ui->DecodeButton->setChecked (true); + qApp->processEvents(); //Update the DecodeButton highlight + replayJttyFrames (frames, [this, istart0, istop] (int k) { + bool const eom = jtty_decode(k, istart0, istop); + return eom || k >= istop; + }); + flushJttyDecodeLines(); + finishDecodeUi(); +} + +void MainWindow::flushJttyDecodeLines() +{ + // Called at a definite session end (new session starting, or true end of file); unconditional. + for (auto& line : m_jttyAllFreqLines) { + if (line.written) continue; + QString const text = line.text.trimmed(); + if (text.isEmpty()) continue; + write_all("Rx", formatJttyDecodeLine(line.frequency, text), &line.context); + line.written = true; + } +} + +bool MainWindow::jtty_key_struck(QKeyEvent * e) +{ + if(e->key() == Qt::Key_Escape) { + abort_jtty_tx(); + return true; + } + int const functionKey=e->key()-Qt::Key_F1+1; + if(functionKey < 1 || functionKey > 8) return false; + return sendJttyFunctionKey(functionKey); +} + +bool MainWindow::sendJttyFunctionKey(int index) +{ + QString macro; + switch(index) { + case 1: macro=ui->msg1->text(); break; + case 2: macro=ui->msg2->text(); break; + case 3: macro=ui->msg3->text(); break; + case 4: macro=ui->msg4->text(); break; + case 5: macro=ui->msg5->text(); break; + case 6: macro=ui->msg6->text(); break; + case 7: macro=ui->msg7->text(); break; + case 8: macro=ui->msg8->text(); break; + default: return false; + } + if(macro.simplified().isEmpty()) return false; + + auto const context = jttyNativeMacroContext( + m_config, m_hisCall, ui->sbSerialNumber_2->value()); + auto const compiled=Jtty::compileNativeMacro(macro,context); + if(compiled.status == Jtty::NativeMacroStatus::LiteralFallback) { + jtty_tx(compiled.text); + return true; + } + + qint64 const requestId=++m_jttyTxRequestId; + if(compiled.status == Jtty::NativeMacroStatus::InvalidRuntime) { + LOG_WARN(QStringLiteral("JTTY native macro rejected: %1").arg(compiled.error)); + Q_EMIT jttyTextRejected(requestId,JttyTxRejectReason::EncodingFailed); + return true; + } + + int itone[944]; + int nsym=0; + int encodeStatus=static_cast(Jtty::NativeEncodeStatus::InvalidDescriptor); + genjtty_atoms_c(compiled.atoms.constData(),compiled.atoms.size(),itone,&nsym, + &encodeStatus); + if(nsym <= 0) { + LOG_WARN(QStringLiteral("JTTY native macro rejected: %1") + .arg(jttyNativeEncodeError(encodeStatus))); + Q_EMIT jttyTextRejected(requestId,JttyTxRejectReason::EncodingFailed); + return true; + } + execute_jtty_tones(requestId,compiled.text,itone,nsym); + return true; +} + +QString MainWindow::jtty_msg_expand(QString t) +{ + auto const context = jttyNativeMacroContext( + m_config, m_hisCall, ui->sbSerialNumber_2->value()); + return Jtty::expandLiteralMacro(t, context); +} + +void MainWindow::on_RxFreqSpinBox_2_valueChanged(int n) +{ + ui->RxFreqSpinBox->setValue(n); +} + +void MainWindow::on_TxFreqSpinBox_2_valueChanged(int n) +{ + ui->TxFreqSpinBox->setValue(n); +} + +void MainWindow::on_sbFtol_2_valueChanged (int n) +{ + m_wideGraph->setTol(n); +} + +#ifdef WIN32 +void MainWindow::logText(const QString &text) { + LOG_INFO(text); +} + +QString MainWindow::jttyRejectReasonText(JttyTxRejectReason reason) const +{ + switch (reason) { + case JttyTxRejectReason::Empty: return QStringLiteral("empty"); + case JttyTxRejectReason::EncodingFailed: return QStringLiteral("encoding failed"); + case JttyTxRejectReason::QueueFull: return QStringLiteral("queue full"); + case JttyTxRejectReason::BackendRejected: return QStringLiteral("backend rejected"); + case JttyTxRejectReason::Aborted: return QStringLiteral("aborted"); + case JttyTxRejectReason::NotAvailable: return QStringLiteral("not available"); + } + return QStringLiteral("unknown"); +} + +void MainWindow::handleMmttyTxString(QString message) +{ + auto const context = jttyNativeMacroContext( + m_config, m_hisCall, ui->sbSerialNumber_2->value()); + auto const compiled = Jtty::compileN1mmMessage(message, context); + if (m_mode != "JTTY") { + if (compiled.status == Jtty::N1mmCompileStatus::Literal) { + jtty_tx(compiled.literalText); + return; + } + + qint64 const requestId = ++m_jttyTxRequestId; + m_mmttyJttyOutput.submit(requestId); + QString const reason = compiled.status == Jtty::N1mmCompileStatus::Error + ? compiled.error : QStringLiteral("tagged JTTY actions require JTTY mode"); + logText(QStringLiteral("MMTTY/N1MM tagged JTTY request %1 rejected: %2") + .arg(requestId).arg(reason)); + Q_EMIT jttyTextRejected(requestId, JttyTxRejectReason::NotAvailable); + return; + } + + if (m_mmttyJttyOutput.finishRequested()) { + logText(QStringLiteral("MMTTY/N1MM JTTY text ignored after graceful OFF")); + return; + } + + qint64 const requestId = ++m_jttyTxRequestId; + m_mmttyJttyOutput.submit(requestId); + if (compiled.status == Jtty::N1mmCompileStatus::Literal) { + execute_jtty_tx(requestId, compiled.literalText); + return; + } + if (compiled.status == Jtty::N1mmCompileStatus::Error) { + logText(QStringLiteral("MMTTY/N1MM tagged JTTY request %1 rejected: %2") + .arg(requestId).arg(compiled.error)); + Q_EMIT jttyTextRejected(requestId, JttyTxRejectReason::EncodingFailed); + return; + } + + int itone[944]; + int nsym = 0; + int encodeStatus = static_cast(Jtty::NativeEncodeStatus::InvalidDescriptor); + genjtty_atoms_c(compiled.atoms.constData(), compiled.atoms.size(), itone, &nsym, + &encodeStatus); + if (nsym <= 0) { + logText(QStringLiteral("MMTTY/N1MM tagged JTTY request %1 rejected: %2") + .arg(requestId).arg(jttyNativeEncodeError(encodeStatus))); + Q_EMIT jttyTextRejected(requestId, JttyTxRejectReason::EncodingFailed); + return; + } + execute_jtty_tones(requestId, compiled.canonicalText, itone, nsym); +} + +void MainWindow::handleMmttyStartTx() +{ + if (m_mode != "JTTY" && !m_mmttyJttyOutput.pending()) { + startTx2(); + return; + } + + m_mmttyJttyOutput.start(); + startPendingMmttyJttyTx(); +} + +void MainWindow::handleMmttyStopTx() +{ + if (m_mode != "JTTY") { + noteTxStopReason (TxEvidence::TxStopReason::UserHalt); + stopTx(); + if (!m_mmttyJttyOutput.pending()) return; + } + + m_mmttyJttyOutput.finish(); + logText(QStringLiteral("MMTTY/N1MM JTTY OFF requested; waiting for backend drain")); + completeMmttyJttyOutput(); +} + +void MainWindow::handleMmttyAbortTx() +{ + m_mmttyJttyOutput.abort(); + abort_jtty_tx(); +} + +void MainWindow::handleMmttyJttyAccepted(qint64 requestId) +{ + if (!m_mmttyJttyOutput.accept(requestId)) return; + + logText(QStringLiteral("MMTTY/N1MM JTTY request %1 accepted").arg(requestId)); + startPendingMmttyJttyTx(); +} + +void MainWindow::handleMmttyJttyRejected(qint64 requestId, JttyTxRejectReason reason) +{ + if (!m_mmttyJttyOutput.resolve(requestId)) return; + + logText(QStringLiteral("MMTTY/N1MM JTTY request %1 rejected: %2") + .arg(requestId) + .arg(jttyRejectReasonText(reason))); + // Backend rejection may reset the audio session after emitting this signal. + QTimer::singleShot(0, this, [this] { completeMmttyJttyOutput(); }); +} + +void MainWindow::handleMmttyJttyCompleted(qint64 requestId) +{ + if (!m_mmttyJttyOutput.resolve(requestId)) return; + + logText(QStringLiteral("MMTTY/N1MM JTTY request %1 completed").arg(requestId)); +} + +void MainWindow::handleMmttyJttySessionDrained(qint64 sessionId) +{ + Q_UNUSED(sessionId) + completeMmttyJttyOutput(true); +} + +void MainWindow::completeMmttyJttyOutput(bool drained) +{ + if (m_mmttyJttyOutput.takeCompletion(m_jttyTxActive, drained) && m_mmttyif) { + m_mmttyif->report_output_complete(); + } +} + +void MainWindow::startPendingMmttyJttyTx() +{ + if (m_mode != "JTTY" || !m_mmttyJttyOutput.startRequested()) return; + + if (!m_jttyTxActive || jttyTxCommittedSamples () <= 0) { + logText(QStringLiteral("MMTTY/N1MM JTTY start deferred until text is accepted")); + return; + } + + if (g_iptt == 1) { + logText(QStringLiteral("MMTTY/N1MM JTTY start ignored; transmitter is already keyed")); + m_mmttyJttyOutput.started(); + return; + } + + m_mmttyJttyOutput.started(); + startTx2(); +} + +void MainWindow::initMMTTY(quint16 port) { + if (!m_mmttyif) { + m_mmttyif = new MMTTYIF(this); + } + + m_mmttyif->initialize(port); + + connect(m_mmttyif, &MMTTYIF::log_message, this, &MainWindow::logText); + connect(m_mmttyif, &MMTTYIF::app_tx_string, this, &MainWindow::handleMmttyTxString); + connect(m_mmttyif, &MMTTYIF::app_start_tx, this, &MainWindow::handleMmttyStartTx); + connect(m_mmttyif, &MMTTYIF::app_stop_tx, this, &MainWindow::handleMmttyStopTx); + connect(m_mmttyif, &MMTTYIF::app_abort_tx, this, &MainWindow::handleMmttyAbortTx); + connect(this, &MainWindow::jttyTextAccepted, this, &MainWindow::handleMmttyJttyAccepted); + connect(this, &MainWindow::jttyTextRejected, this, &MainWindow::handleMmttyJttyRejected); + connect(this, &MainWindow::jttyTextCompleted, this, &MainWindow::handleMmttyJttyCompleted); + connect(this, &MainWindow::jttySessionDrained, this, &MainWindow::handleMmttyJttySessionDrained); + + connect(m_mmttyif, &MMTTYIF::inactivity_timeout, qApp, &QCoreApplication::quit); + connect(m_mmttyif, &MMTTYIF::app_is_quitting, this, [this]() { + abort_jtty_tx(); + close(); + }); + + // Auto-switch to JTTY mode after MMTTY connects + QTimer::singleShot(3000, this, [this]() { + set_mode("JTTY"); + }); +} + +MMTTYIF *MainWindow::getMmttyIf() const { + return m_mmttyif; +} +#endif diff --git a/widgets/mainwindow_settings.cpp b/widgets/mainwindow_settings.cpp new file mode 100644 index 00000000..f7a99450 --- /dev/null +++ b/widgets/mainwindow_settings.cpp @@ -0,0 +1,637 @@ +#include "mainwindow.h" +#include "RoundRobinSelection.hpp" +#include "ui_mainwindow.h" +#include "widegraph.h" +#include "commons.h" +#include "MessageBox.hpp" +#include "widgets/messageaveraging.h" +#include "widgets/activeStations.h" +#include "widgets/FoxLogWindow.hpp" +#include "widgets/CabrilloLogWindow.hpp" +#include "widgets/QSYMessageCreator.h" +#include "widgets/qsymonitor.h" +#include "validators/CallsignValidator.hpp" +#include "qt_helpers.hpp" +#include "JttyMessages.hpp" + +#include +#include +#include +#include +#include +#include + +extern dec_data_t& dec_data; +extern int outBufSize; +extern bool blocked; +extern int m_TxFreqFox; +extern bool HoldTxFreqStatus; +extern int m_msk144_tr; +extern int m_msk144_tr2; +extern int m_msk144_tr6; + +namespace { + Radio::Frequency constexpr default_frequency {14074000}; + constexpr int standard_messages_tab_index {0}; + constexpr int fox_queue_tab_index {1}; +} + +void MainWindow::writeSettings() +{ + m_settings->beginGroup("MainWindow"); + if (ui->actionSWL_Mode->isChecked ()) + { + m_settings->setValue ("SWLView", true); + m_settings->setValue ("ShowMenus", ui->cbMenus->isChecked ()); + m_settings->setValue ("geometry", geometries ()[0]); + m_settings->setValue ("SWLModeGeometry", saveGeometry ()); + m_settings->setValue ("geometryNoControls", geometries ()[2]); + } + else + { + if (ui->cbMenus->isChecked()) + { + m_settings->setValue ("SWLView", ui->actionSWL_Mode->isChecked ()); + m_settings->setValue ("ShowMenus", true); + m_settings->setValue ("geometry", saveGeometry ()); + m_settings->setValue ("SWLModeGeometry", geometries ()[1]); + m_settings->setValue ("geometryNoControls", geometries ()[2]); + } + else + { + m_settings->setValue ("SWLView", ui->actionSWL_Mode->isChecked ()); + m_settings->setValue ("ShowMenus", false); + m_settings->setValue ("geometry", geometries ()[0]); + m_settings->setValue ("SWLModeGeometry", geometries ()[1]); + m_settings->setValue ("geometryNoControls", saveGeometry ()); + } + } + m_settings->setValue ("state", saveState ()); + m_settings->setValue("MRUdir", m_path); + m_settings->setValue("TxFirst",m_txFirst); + m_settings->setValue("DXcall",ui->dxCallEntry->text()); + m_settings->setValue("DXgrid",ui->dxGridEntry->text()); + m_settings->setValue("AstroDisplayed", m_astroWidget && m_astroWidget->isVisible()); + m_settings->setValue("MsgAvgDisplayed", m_msgAvgWidget && m_msgAvgWidget->isVisible ()); + m_settings->setValue("FoxLogDisplayed", m_foxLogWindow && m_foxLogWindow->isVisible ()); + m_settings->setValue("ContestLogDisplayed", m_contestLogWindow && m_contestLogWindow->isVisible ()); + m_settings->setValue("ActiveStationsDisplayed", m_ActiveStationsWidget && m_ActiveStationsWidget->isVisible ()); + m_settings->setValue("QSYMessageCreatorDisplayed", m_QSYMessageCreatorWidget && m_QSYMessageCreatorWidget->isVisible ()); + m_settings->setValue("ShowQSYMessages", ui->actionEnable_QSY_Popups->isChecked()); + m_settings->setValue("QSYMonitorDisplayed", m_qsymonitorWidget && m_qsymonitorWidget->isVisible ()); + m_settings->setValue("RespondCQ",static_cast (autoRespondPolicy ())); + m_settings->setValue("HoundSort",ui->comboBoxHoundSort->currentIndex()); + m_settings->setValue("FoxNlist",ui->sbNlist->value()); + m_settings->setValue("FoxNslots",m_Nslots0); + m_settings->setValue("SerialNumber",ui->sbSerialNumber->value ()); + m_settings->setValue("SerialNumberJTTY",ui->sbSerialNumber_2->value ()); + m_settings->setValue("JTTY_msg1",ui->msg1->text()); + m_settings->setValue("JTTY_msg2",ui->msg2->text()); + m_settings->setValue("JTTY_msg3",ui->msg3->text()); + m_settings->setValue("JTTY_msg4",ui->msg4->text()); + m_settings->setValue("JTTY_msg5",ui->msg5->text()); + m_settings->setValue("JTTY_msg6",ui->msg6->text()); + m_settings->setValue("JTTY_msg7",ui->msg7->text()); + m_settings->setValue("JTTY_msg8",ui->msg8->text()); + m_settings->setValue("FoxTextMsg", m_freeTextMsg0); + m_settings->setValue("WorkDupes", ui->cbWorkDupes->isChecked()); + m_settings->setValue("JTTY_LowerCase",ui->cbLowerCase->isChecked()); + m_settings->setValue("JTTY_IncludeTime",ui->cbIncludeTime->isChecked()); + m_settings->endGroup(); + + // do this in the General group because we save the parameters from various places + if(m_mode=="JT9") { + m_settings->setValue("SubMode",ui->sbSubmode->value()); + m_settings->setValue("TRPeriod", ui->sbTR->value()); + } + if(m_mode=="MSK144") m_settings->setValue("ShMsgs_MSK144",m_bShMsgs); + if(m_mode=="Q65") m_settings->setValue("ShMsgs_Q65",m_bShMsgs); + if(m_mode=="JT65") m_settings->setValue("ShMsgs_JT65",m_bShMsgs); + if(m_mode=="JT4") m_settings->setValue("ShMsgs_JT4",m_bShMsgs); + + m_settings->beginGroup("Common"); + m_settings->setValue("Mode",m_mode); + m_settings->setValue("SaveNone",ui->actionNone->isChecked()); + m_settings->setValue("SaveDecoded",ui->actionSave_decoded->isChecked()); + m_settings->setValue("SaveAll",ui->actionSave_all->isChecked()); + m_settings->setValue("RemoveAudioFiles",ui->actionRemove_after_30days->isChecked()); + m_settings->setValue("NDepth",m_ndepth); + + //ft8md + m_settings->setValue ("MultithreadedFT8decoder",ui->actionUse_multithreaded_FT8_decoder->isChecked() ); + m_settings->setValue("NFT8Cycles",m_nFT8Cycles); + m_settings->setValue("NFT8QSORXfreqSensitivity",m_nFT8RXfSens); + m_settings->setValue("FT8threads",m_ft8threads); + m_settings->setValue("FT8Sensitivity",m_ft8Sensitivity); + m_settings->setValue("FT8DecoderStart",m_ft8DecoderStart); + m_settings->setValue("FT8WideDXCallSearch",m_FT8WideDxCallSearch); + m_settings->setValue("HideFT8Dupes",ui->actionHide_FT8_dupe_messages->isChecked()); + //ft8md + + m_settings->setValue("RxFreq",ui->RxFreqSpinBox->value()); + if(m_specOp!=SpecOp::FOX) m_settings->setValue("TxFreq",ui->TxFreqSpinBox->value()); + m_settings->setValue("TxFreqFox",m_TxFreqFox); + m_settings->setValue("WSPRfreq",ui->WSPRfreqSpinBox->value()); + m_settings->setValue("FST4W_RxFreq",ui->sbFST4W_RxFreq->value()); + m_settings->setValue("FST4W_FTol",ui->sbFST4W_FTol->value()); + m_settings->setValue("JTTY_FTol",ui->sbFtol_2->value()); + m_settings->setValue("FST4_FLow",ui->sbF_Low->value()); + m_settings->setValue("FST4_FHigh",ui->sbF_High->value()); + m_settings->setValue("EchoToneSpacing",ui->sbToneSpacing->value()); + m_settings->setValue("EchoFixedTone",ui->rbFixedTone->isChecked()); + m_settings->setValue("EchoMessageRB",ui->rbEchoMessage->isChecked()); + m_settings->setValue("EchoCW",ui->rbEchoCW->isChecked()); + m_settings->setValue("EchoMessage",ui->leEchoMessage->text()); + m_settings->setValue("DTtol",m_DTtol); + m_settings->setValue("MinSync",m_minSync); + m_settings->setValue ("AutoSeq", ui->cbAutoSeq->isChecked ()); + m_settings->setValue ("RxAll", ui->cbRxAll->isChecked ()); +// m_settings->setValue("ShMsgs",m_bShMsgs); + m_settings->setValue("SWL",ui->cbSWL->isChecked()); + if(m_mode=="MSK144" && hasMsk144BaseFrequency ()) { + m_settings->setValue ("DialFreq", QVariant::fromValue(m_msk144basefreq)); // MSK144 QSY + } else { + m_settings->setValue ("DialFreq", QVariant::fromValue(m_operatingFrequency.remembered ())); + } + m_settings->setValue("SkedFreq",m_skedFreq); + m_settings->setValue("OutAttenuation", ui->outAttenuation->value ()); + m_settings->setValue("NoSuffix",m_noSuffix); + m_settings->setValue("GUItab",ui->tabWidget->currentIndex()); + m_settings->setValue("OutBufSize",outBufSize); + m_settings->setValue ("HoldTxFreq", ui->cbHoldTxFreq->isChecked ()); + m_settings->setValue ("CQonly", ui->cbCQonly->isChecked ()); + m_settings->setValue ("BypassFilters", ui->cbBypass->isChecked ()); + m_settings->setValue("PctTx", ui->sbTxPercent->value ()); + m_settings->setValue( + "RoundRobin", QString::fromStdString (BeaconTx::formatRoundRobinPolicy (configuredRoundRobinPolicy ()))); + m_settings->setValue("dBm",m_dBm); + m_settings->setValue("RR73",m_send_RR73); + m_settings->setValue ("WSPRPreferType1", ui->WSPR_prefer_type_1_check_box->isChecked ()); + m_settings->setValue("UploadSpots",m_uploadWSPRSpots); + m_settings->setValue("NoOwnCall",ui->cbNoOwnCall->isChecked()); + m_settings->setValue ("BandHopping", ui->band_hopping_group_box->isChecked ()); + m_settings->setValue ("MaxDrift", ui->sbMaxDrift->value()); + m_settings->setValue ("TRPeriod_FST4W", ui->sbTR_FST4W->value ()); + m_settings->setValue("FastMode",m_bFastMode); + m_settings->setValue("Fast9",m_bFast9); + m_settings->setValue ("CQTxfreq", ui->sbCQTxFreq->value ()); + m_settings->setValue("pwrBandTxMemory",m_pwrBandTxMemory); + m_settings->setValue("pwrBandTuneMemory",m_pwrBandTuneMemory); + m_settings->setValue ("FT8AP", ui->actionEnable_AP_FT8->isChecked ()); + m_settings->setValue ("JT65AP", ui->actionEnable_AP_JT65->isChecked ()); + m_settings->setValue ("AutoClearAvg", ui->actionAuto_Clear_Avg->isChecked ()); + m_settings->setValue ("DisableClicksOnWaterfall", ui->actionDisable_clicks_on_waterfall->isChecked ()); + m_settings->setValue("SplitterState",ui->decodes_splitter->saveState()); + m_settings->setValue("Blanker",ui->sbNB->value()); + m_settings->setValue("Score",m_score); + m_settings->setValue("EchoAvg",ui->sbEchoAvg->value()); + { + QList coeffs; // suitable for QSettings + for (auto const& coeff : m_phaseEqCoefficients) + { + coeffs << coeff; + } + m_settings->setValue ("PhaseEqualizationCoefficients", QVariant {coeffs}); + } + m_settings->setValue ("bh_160m", ui->cb160m->isChecked() ); + m_settings->setValue ("bh_80m", ui->cb80m->isChecked() ); + m_settings->setValue ("bh_60m", ui->cb60m->isChecked() ); + m_settings->setValue ("bh_40m", ui->cb40m->isChecked() ); + m_settings->setValue ("bh_30m", ui->cb30m->isChecked() ); + m_settings->setValue ("bh_20m", ui->cb20m->isChecked() ); + m_settings->setValue ("bh_17m", ui->cb17m->isChecked() ); + m_settings->setValue ("bh_15m", ui->cb15m->isChecked() ); + m_settings->setValue ("bh_12m", ui->cb12m->isChecked() ); + m_settings->setValue ("bh_10m", ui->cb10m->isChecked() ); + m_settings->setValue ("bh_6m", ui->cb6m->isChecked() ); + m_settings->setValue ("bh_4m", ui->cb4m->isChecked() ); + m_settings->setValue ("bh_2m", ui->cb2m->isChecked() ); + m_settings->setValue ("bh_70cm", ui->cb70cm->isChecked() ); + m_settings->setValue ("bh_2mMSK", ui->cb2mMSK->isChecked() ); + m_settings->setValue ("bh_80mFT4", ui->cb80mFT4->isChecked() ); + m_settings->setValue ("bh_40mFT4", ui->cb40mFT4->isChecked() ); + m_settings->setValue ("bh_30mFT4", ui->cb30mFT4->isChecked() ); + m_settings->setValue ("bh_20mFT4", ui->cb20mFT4->isChecked() ); + m_settings->setValue ("bh_17mFT4", ui->cb17mFT4->isChecked() ); + m_settings->setValue ("bh_15mFT4", ui->cb15mFT4->isChecked() ); + m_settings->setValue ("bh_12mFT4", ui->cb12mFT4->isChecked() ); + m_settings->setValue ("bh_10mFT4", ui->cb10mFT4->isChecked() ); + m_settings->setValue ("bh_QRG1", ui->cbQRG1->isChecked() ); + m_settings->setValue ("bh_QRG2", ui->cbQRG2->isChecked() ); + m_settings->setValue ("bh_QRG3", ui->cbQRG3->isChecked() ); + m_settings->setValue ("bh_QRG4", ui->cbQRG4->isChecked() ); + m_settings->setValue ("bh_QRG5", ui->cbQRG5->isChecked() ); + m_settings->setValue ("bh_QRG6", ui->cbQRG6->isChecked() ); + m_settings->setValue ("bh_QRG7", ui->cbQRG7->isChecked() ); + m_settings->setValue ("bh_QRG8", ui->cbQRG8->isChecked() ); + m_settings->setValue ("QRG1", ui->sbQRG1->value ()); + m_settings->setValue ("QRG2", ui->sbQRG2->value ()); + m_settings->setValue ("QRG3", ui->sbQRG3->value ()); + m_settings->setValue ("QRG4", ui->sbQRG4->value ()); + m_settings->setValue ("QRG5", ui->sbQRG5->value ()); + m_settings->setValue ("QRG6", ui->sbQRG6->value ()); + m_settings->setValue ("QRG7", ui->sbQRG7->value ()); + m_settings->setValue ("QRG8", ui->sbQRG8->value ()); + m_settings->setValue ("reduceFalseDecodes", ui->actionReduce_false_decodes->isChecked() ); + m_settings->setValue ("HideAPInfo", ui->actionHide_AP_info->isChecked() ); + m_settings->setValue ("FullDuplexMode", ui->actionFull_Duplex_Mode->isChecked() ); + m_settings->setValue ("actionDontSplitALLTXT", ui->actionDon_t_split_ALL_TXT->isChecked() ); + m_settings->setValue ("splitAllTxtYearly", ui->actionSplit_ALL_TXT_yearly->isChecked() ); + m_settings->setValue ("splitAllTxtMonthly", ui->actionSplit_ALL_TXT_monthly->isChecked() ); + m_settings->setValue ("disableWritingOfAllTxt", ui->actionDisable_writing_of_ALL_TXT->isChecked() ); + m_settings->setValue ("DisableEventLogging", ui->actionDisable_event_logging->isChecked() ); + m_settings->setValue ("DarkStyle", ui->actionUse_Dark_Style->isChecked() ); + m_settings->setValue ("BandButtons", ui->actionBand_Buttons->isChecked() ); + m_settings->setValue ("VHFUHFButtons", ui->actionVHF_UHF_Buttons->isChecked() ); + m_settings->setValue ("tx1State", m_tx1_enabled_preference); + m_settings->setValue ("HighlightB4", ui->actionHighlightB4->isChecked() ); + m_settings->setValue ("HighlightToday", ui->actionHighlightToday->isChecked() ); + m_settings->setValue ("HighlightIgnored", ui->actionHighlightIgnored->isChecked() ); + m_settings->setValue ("HideB4", ui->actionHideB4->isChecked() ); + m_settings->setValue ("HideToday", ui->actionHideToday->isChecked() ); + m_settings->setValue ("HideIgnored", ui->actionHideIgnored->isChecked() ); + m_settings->setValue ("IgnoreB4", ui->actionIgnoreB4->isChecked() ); + m_settings->setValue ("IgnoreToday", ui->actionIgnoreToday->isChecked() ); + m_settings->setValue ("IgnoreIgnored", ui->actionIgnoreIgnored->isChecked() ); + m_settings->setValue ("HideTerritory1", ui->actionHideTerritory1->isChecked() ); + m_settings->setValue ("HideTerritory2", ui->actionHideTerritory2->isChecked() ); + m_settings->setValue ("HideTerritory3", ui->actionHideTerritory3->isChecked() ); + m_settings->setValue ("HideTerritory4", ui->actionHideTerritory4->isChecked() ); + m_settings->setValue ("HighlightTerritory1", ui->actionHighlightTerritory1->isChecked() ); + m_settings->setValue ("HighlightTerritory2", ui->actionHighlightTerritory2->isChecked() ); + m_settings->setValue ("HighlightTerritory3", ui->actionHighlightTerritory3->isChecked() ); + m_settings->setValue ("HighlightTerritory4", ui->actionHighlightTerritory4->isChecked() ); + m_settings->setValue ("HideEU", ui->actionHideEU->isChecked() ); + m_settings->setValue ("HideNA", ui->actionHideNA->isChecked() ); + m_settings->setValue ("HideSA", ui->actionHideSA->isChecked() ); + m_settings->setValue ("HideAS", ui->actionHideAS->isChecked() ); + m_settings->setValue ("HideAF", ui->actionHideAF->isChecked() ); + m_settings->setValue ("HideOC", ui->actionHideOC->isChecked() ); + m_settings->setValue ("HideAN", ui->actionHideAN->isChecked() ); + m_settings->setValue ("HighlightWhitelistEntries", ui->actionHighlight_Whitelist_entries->isChecked() ); + m_settings->endGroup(); +} + +void MainWindow::readSettings() +{ + ui->cbAutoSeq->setVisible(false); + ui->respondComboBox->setVisible(false); + + m_settings->beginGroup("MainWindow"); + std::array the_geometries; + the_geometries[0] = m_settings->value ("geometry", saveGeometry ()).toByteArray (); + the_geometries[1] = m_settings->value ("SWLModeGeometry", saveGeometry ()).toByteArray (); + the_geometries[2] = m_settings->value ("geometryNoControls", saveGeometry ()).toByteArray (); + auto SWL_mode = m_settings->value ("SWLView", false).toBool (); + auto show_menus = m_settings->value ("ShowMenus", true).toBool (); + ui->actionSWL_Mode->setChecked (SWL_mode); + ui->cbMenus->setChecked (show_menus); + ui->cbLowerCase->setChecked(m_settings->value("JTTY_LowerCase",false).toBool()); + ui->cbIncludeTime->setChecked(m_settings->value("JTTY_IncludeTime",false).toBool()); + auto current_view_mode = SWL_mode ? 1 : show_menus ? 0 : 2; + change_layout (current_view_mode); + geometries (current_view_mode, the_geometries); + restoreState (m_settings->value ("state", saveState ()).toByteArray ()); + setDXInfo(m_settings->value ("DXcall", QString {}).toString (), + m_settings->value ("DXgrid", QString {}).toString ()); + m_path = m_settings->value("MRUdir", m_config.save_directory ().absolutePath ()).toString (); + m_txFirst = m_settings->value("TxFirst",false).toBool(); + auto displayAstro = m_settings->value ("AstroDisplayed", false).toBool (); + auto displayMsgAvg = m_settings->value ("MsgAvgDisplayed", false).toBool (); + auto displayFoxLog = m_settings->value ("FoxLogDisplayed", false).toBool (); + auto displayContestLog = m_settings->value ("ContestLogDisplayed", false).toBool (); + bool displayActiveStations = m_settings->value ("ActiveStationsDisplayed", false).toBool (); + bool displayQSYMessageCreator = m_settings->value ("QSYMessageCreatorDisplayed", false).toBool (); + bool displayQSYMonitor = m_settings->value("QSYMonitorDisplayed", false).toBool (); + bool enableQSYpopups = m_settings->value("ShowQSYMessages", true).toBool (); + auto const respondPolicy = m_settings->value( + "RespondCQ", static_cast (AutoRespondPolicy::None)).toInt(); + auto const respondIndex = ui->respondComboBox->findData (respondPolicy); + ui->respondComboBox->setCurrentIndex (respondIndex >= 0 ? respondIndex : 0); + ui->comboBoxHoundSort->setCurrentIndex(m_settings->value("HoundSort",3).toInt()); + ui->sbNlist->setValue(m_settings->value("FoxNlist",12).toInt()); + m_Nslots=m_settings->value("FoxNslots",3).toInt(); + m_Nslots0=m_Nslots; + if(!m_config.superFox()) ui->sbNslots->setValue(m_Nslots); + ui->sbSerialNumber->setValue (m_settings->value ("SerialNumber", 1).toInt ()); + ui->sbSerialNumber_2->setValue (m_settings->value ("SerialNumberJTTY", 1).toInt ()); + auto const jttyTemplate = [this] (int functionKey) { + QString const key = QStringLiteral("JTTY_msg%1").arg(functionKey); + QString const saved = m_settings->value( + key, Jtty::nativeMacroTemplate(functionKey)).toString(); + QString const migrated = Jtty::migratedNativeMacroTemplate(functionKey, saved); + if (m_settings->contains(key) && migrated != saved) { + m_settings->setValue(key, migrated); + } + return migrated; + }; + ui->msg1->setText(jttyTemplate(1)); + ui->msg2->setText(jttyTemplate(2)); + ui->msg3->setText(jttyTemplate(3)); + ui->msg4->setText(jttyTemplate(4)); + ui->msg5->setText(jttyTemplate(5)); + ui->msg6->setText(jttyTemplate(6)); + ui->msg7->setText(jttyTemplate(7)); + ui->msg8->setText(jttyTemplate(8)); + m_freeTextMsg0=m_settings->value("FoxTextMsg","").toString(); + m_freeTextMsg=m_freeTextMsg0; + ui->cbWorkDupes->setChecked(m_settings->value("WorkDupes",false).toBool()); + m_settings->endGroup(); + + m_settings->beginGroup("Common"); + m_mode=m_settings->value("Mode","FT8").toString(); + m_settings->endGroup(); + + // do this outside of settings group because it uses groups internally + ui->actionAstronomical_data->setChecked (displayAstro); + ui->actionEnable_QSY_Popups->setChecked (enableQSYpopups); + + // do this in the General group because we save the parameters from various places + if(m_mode=="JT9") { + blocked=true; + m_nSubMode=m_settings->value("SubMode",0).toInt(); + ui->sbSubmode->setValue(m_nSubMode); + ui->sbFtol->setValue (m_settings->value("Ftol_JT9", 50).toInt()); + ui->sbTR->setValue (m_settings->value ("TRPeriod", 15).toInt()); + QTimer::singleShot (50, [=] {blocked = false;}); + } + if (m_mode=="FT8") { + ui->sbFtol->setValue (m_settings->value("Ftol_SF", 50).toInt()); + } + if (m_mode=="Q65") { + m_nSubMode=m_settings->value("SubMode_Q65",0).toInt(); + ui->sbSubmode->setValue(m_nSubMode); + ui->sbFtol->setValue (m_settings->value("Ftol_Q65", 50).toInt()); + ui->sbTR->setValue (m_settings->value ("TRPeriod_Q65", 30).toInt()); + } + if (m_mode=="JT65") { + m_nSubMode=m_settings->value("SubMode_JT65",0).toInt(); + ui->sbSubmode->setValue(m_nSubMode); + ui->sbFtol->setValue (m_settings->value("Ftol_JT65", 50).toInt()); + } + if (m_mode=="JT4") { + m_nSubMode=m_settings->value("SubMode_JT4",0).toInt(); + ui->sbSubmode->setValue(m_nSubMode); + ui->sbFtol->setValue (m_settings->value("Ftol_JT4", 50).toInt()); + ui->sbTR->setValue (m_settings->value ("TRPeriod_FST4", 60).toInt()); + } + if (m_mode=="MSK144") { + ui->sbFtol->setValue (m_settings->value("Ftol_MSK144",50).toInt()); + m_msk144_tr2=m_settings->value ("TRPeriod_MSK144_2m", 30).toInt(); + m_msk144_tr6=m_settings->value ("TRPeriod_MSK144_6m", 15).toInt(); + m_msk144_tr=m_settings->value ("TRPeriod_MSK144", 30).toInt(); + QTimer::singleShot (3000, [=] { + if (m_currentBand=="2m") ui->sbTR->setValue (m_msk144_tr2); + else if (m_currentBand=="6m" or m_currentBand=="4m") ui->sbTR->setValue (m_msk144_tr6); + else ui->sbTR->setValue (m_msk144_tr); + }); + } + if (m_mode=="MSK144") m_bShMsgs=m_settings->value("ShMsgs_MSK144",false).toBool(); + if (m_mode=="Q65") m_bShMsgs=m_settings->value("ShMsgs_Q65",false).toBool(); + if (m_mode=="JT65") m_bShMsgs=m_settings->value("ShMsgs_JT65",false).toBool(); + if (m_mode=="JT4") m_bShMsgs=m_settings->value("ShMsgs_JT4",false).toBool(); + + m_settings->beginGroup("Common"); + ui->cb160m->setChecked(m_settings->value("bh_160m", false).toBool()); + ui->cb80m->setChecked(m_settings->value("bh_80m", false).toBool()); + ui->cb60m->setChecked(m_settings->value("bh_60m", false).toBool()); + ui->cb40m->setChecked(m_settings->value("bh_40m", false).toBool()); + ui->cb30m->setChecked(m_settings->value("bh_30m", false).toBool()); + ui->cb20m->setChecked(m_settings->value("bh_20m", false).toBool()); + ui->cb17m->setChecked(m_settings->value("bh_17m", false).toBool()); + ui->cb15m->setChecked(m_settings->value("bh_15m", false).toBool()); + ui->cb12m->setChecked(m_settings->value("bh_12m", false).toBool()); + ui->cb10m->setChecked(m_settings->value("bh_10m", false).toBool()); + ui->cb6m->setChecked(m_settings->value("bh_6m", false).toBool()); + ui->cb4m->setChecked(m_settings->value("bh_4m", false).toBool()); + ui->cb2m->setChecked(m_settings->value("bh_2m", false).toBool()); + ui->cb70cm->setChecked(m_settings->value("bh_70cm", false).toBool()); + ui->cb2mMSK->setChecked(m_settings->value("bh_2mMSK", false).toBool()); + ui->cb80mFT4->setChecked(m_settings->value("bh_80mFT4", false).toBool()); + ui->cb40mFT4->setChecked(m_settings->value("bh_40mFT4", false).toBool()); + ui->cb30mFT4->setChecked(m_settings->value("bh_30mFT4", false).toBool()); + ui->cb20mFT4->setChecked(m_settings->value("bh_20mFT4", false).toBool()); + ui->cb17mFT4->setChecked(m_settings->value("bh_17mFT4", false).toBool()); + ui->cb15mFT4->setChecked(m_settings->value("bh_15mFT4", false).toBool()); + ui->cb12mFT4->setChecked(m_settings->value("bh_12mFT4", false).toBool()); + ui->cb10mFT4->setChecked(m_settings->value("bh_10mFT4", false).toBool()); + ui->cbQRG1->setChecked(m_settings->value("bh_QRG1", false).toBool()); + ui->cbQRG2->setChecked(m_settings->value("bh_QRG2", false).toBool()); + ui->cbQRG3->setChecked(m_settings->value("bh_QRG3", false).toBool()); + ui->cbQRG4->setChecked(m_settings->value("bh_QRG4", false).toBool()); + ui->cbQRG5->setChecked(m_settings->value("bh_QRG5", false).toBool()); + ui->cbQRG6->setChecked(m_settings->value("bh_QRG6", false).toBool()); + ui->cbQRG7->setChecked(m_settings->value("bh_QRG7", false).toBool()); + ui->cbQRG8->setChecked(m_settings->value("bh_QRG8", false).toBool()); + ui->sbQRG1->setValue (m_settings->value ("QRG1", 3567).toInt ()); + ui->sbQRG2->setValue (m_settings->value ("QRG2", 7056).toInt ()); + ui->sbQRG3->setValue (m_settings->value ("QRG3", 10131).toInt ()); + ui->sbQRG4->setValue (m_settings->value ("QRG4", 14090).toInt ()); + ui->sbQRG5->setValue (m_settings->value ("QRG5", 18095).toInt ()); + ui->sbQRG6->setValue (m_settings->value ("QRG6", 21091).toInt ()); + ui->sbQRG7->setValue (m_settings->value ("QRG7", 24911).toInt ()); + ui->sbQRG8->setValue (m_settings->value ("QRG8", 28091).toInt ()); + ui->actionReduce_false_decodes->setChecked(m_settings->value("reduceFalseDecodes", false).toBool()); + ui->actionHide_AP_info->setChecked(m_settings->value("HideAPInfo", false).toBool()); + ui->actionFull_Duplex_Mode->setChecked(m_settings->value("FullDuplexMode", false).toBool()); + ui->actionDon_t_split_ALL_TXT->setChecked(m_settings->value("actionDontSplitALLTXT", true).toBool()); + ui->actionSplit_ALL_TXT_yearly->setChecked(m_settings->value("splitAllTxtYearly", false).toBool()); + ui->actionSplit_ALL_TXT_monthly->setChecked(m_settings->value("splitAllTxtMonthly", false).toBool()); + ui->actionDisable_writing_of_ALL_TXT->setChecked(m_settings->value("disableWritingOfAllTxt", false).toBool()); + ui->actionDisable_event_logging->setChecked(m_settings->value("DisableEventLogging", false).toBool()); + ui->actionUse_Dark_Style->setChecked(m_settings->value("DarkStyle", false).toBool()); + ui->actionBand_Buttons->setChecked(m_settings->value("BandButtons", true).toBool()); + ui->actionVHF_UHF_Buttons->setChecked(m_settings->value("VHFUHFButtons", false).toBool()); + m_tx1_enabled_preference = m_settings->value("tx1State", true).toBool(); + ui->tx1->setEnabled(m_tx1_enabled_preference); + ui->actionHighlightB4->setChecked(m_settings->value("HighlightB4", false).toBool()); + ui->actionHighlightToday->setChecked(m_settings->value("HighlightToday", false).toBool()); + ui->actionHighlightIgnored->setChecked(m_settings->value("HighlightIgnored", false).toBool()); + ui->actionHideB4->setChecked(m_settings->value("HideB4", false).toBool()); + ui->actionHideToday->setChecked(m_settings->value("HideToday", false).toBool()); + ui->actionHideIgnored->setChecked(m_settings->value("HideIgnored", false).toBool()); + ui->actionIgnoreB4->setChecked(m_settings->value("IgnoreB4", false).toBool()); + ui->actionIgnoreToday->setChecked(m_settings->value("IgnoreToday", false).toBool()); + ui->actionIgnoreIgnored->setChecked(m_settings->value("IgnoreIgnored", false).toBool()); + ui->actionHideTerritory1->setChecked(m_settings->value("HideTerritory1", false).toBool()); + ui->actionHideTerritory2->setChecked(m_settings->value("HideTerritory2", false).toBool()); + ui->actionHideTerritory3->setChecked(m_settings->value("HideTerritory3", false).toBool()); + ui->actionHideTerritory4->setChecked(m_settings->value("HideTerritory4", false).toBool()); + ui->actionHighlightTerritory1->setChecked(m_settings->value("HighlightTerritory1", false).toBool()); + ui->actionHighlightTerritory2->setChecked(m_settings->value("HighlightTerritory2", false).toBool()); + ui->actionHighlightTerritory3->setChecked(m_settings->value("HighlightTerritory3", false).toBool()); + ui->actionHighlightTerritory4->setChecked(m_settings->value("HighlightTerritory4", false).toBool()); + ui->actionHideEU->setChecked(m_settings->value("HideEU", false).toBool()); + ui->actionHideNA->setChecked(m_settings->value("HideNA", false).toBool()); + ui->actionHideSA->setChecked(m_settings->value("HideSA", false).toBool()); + ui->actionHideAS->setChecked(m_settings->value("HideAS", false).toBool()); + ui->actionHideAF->setChecked(m_settings->value("HideAF", false).toBool()); + ui->actionHideOC->setChecked(m_settings->value("HideOC", false).toBool()); + ui->actionHideAN->setChecked(m_settings->value("HideAN", false).toBool()); + ui->actionHighlight_Whitelist_entries->setChecked(m_settings->value("HighlightWhitelistEntries", false).toBool()); +// m_mode=m_settings->value("Mode","FT8").toString(); + ui->actionNone->setChecked(m_settings->value("SaveNone",true).toBool()); + ui->actionSave_decoded->setChecked(m_settings->value("SaveDecoded",false).toBool()); + ui->actionSave_all->setChecked(m_settings->value("SaveAll",false).toBool()); + ui->actionRemove_after_30days->setChecked(m_settings->value("RemoveAudioFiles",false).toBool()); + ui->RxFreqSpinBox->setValue(0); // ensure a change is signaled + ui->RxFreqSpinBox->setValue(m_settings->value("RxFreq",1500).toInt()); + ui->sbFST4W_RxFreq->setValue(0); + ui->sbFST4W_RxFreq->setValue(m_settings->value("FST4W_RxFreq",1500).toInt()); + ui->sbF_Low->setValue(m_settings->value("FST4_FLow",600).toInt()); + ui->sbF_High->setValue(m_settings->value("FST4_FHigh",1400).toInt()); + ui->sbFST4W_FTol->setValue(m_settings->value("FST4W_FTol",100).toInt()); + ui->sbFtol_2->setValue(m_settings->value("JTTY_FTol",20).toInt()); + ui->sbToneSpacing->setValue(m_settings->value("EchoToneSpacing",10).toInt()); + ui->rbFixedTone->setChecked(m_settings->value("EchoFixedTone",true).toBool()); + ui->rbEchoMessage->setChecked(m_settings->value("EchoMessageRB",false).toBool()); + ui->rbEchoCW->setChecked(m_settings->value("EchoCW",false).toBool()); + ui->leEchoMessage->setText (CallsignValidator::normalizeStoredInput ( + m_settings->value ("EchoMessage", QString {}).toString (), + ui->leEchoMessage->maxLength (), false)); + m_minSync=m_settings->value("MinSync",0).toInt(); + ui->syncSpinBox->setValue(m_minSync); + ui->cbAutoSeq->setChecked (m_settings->value ("AutoSeq", false).toBool()); + ui->cbRxAll->setChecked (m_settings->value ("RxAll", false).toBool()); +// m_bShMsgs=m_settings->value("ShMsgs",false).toBool(); + m_bSWL=m_settings->value("SWL",false).toBool(); + m_bFast9=m_settings->value("Fast9",false).toBool(); + m_bFastMode=m_settings->value("FastMode",false).toBool(); + ui->sbMaxDrift->setValue (m_settings->value ("MaxDrift",0).toInt()); + ui->sbTR_FST4W->setValue (m_settings->value ("TRPeriod_FST4W", 15).toInt()); + m_operatingFrequency.loadRemembered (m_settings->value ("DialFreq", + QVariant::fromValue (default_frequency)).value ()); + m_skedFreq=m_settings->value("SkedFreq",1296.065).toDouble(); + QTimer::singleShot (1000, [=] {if (m_astroWidget) m_astroWidget->setSkedFreq(m_skedFreq);}); + if(m_mode=="MSK144") m_msk144basefreq = m_operatingFrequency.remembered (); // MSK144 QSY + ui->WSPRfreqSpinBox->setValue(0); // ensure a change is signaled + ui->WSPRfreqSpinBox->setValue(m_settings->value("WSPRfreq",1500).toInt()); + ui->TxFreqSpinBox->setValue(0); // ensure a change is signaled + if(m_specOp!=SpecOp::FOX) ui->TxFreqSpinBox->setValue(m_settings->value("TxFreq",1500).toInt()); + m_TxFreqFox=m_settings->value("TxFreqFox",300).toInt(); + if(m_specOp==SpecOp::FOX && !m_config.superFox()) ui->TxFreqSpinBox->setValue(m_TxFreqFox); + m_ndepth=m_settings->value("NDepth",3).toInt(); + + //ft8md + ui->actionUse_multithreaded_FT8_decoder->setChecked(m_settings->value("MultithreadedFT8decoder", false).toBool()); + m_multithreadFT8 = ui->actionUse_multithreaded_FT8_decoder->isChecked(); + dec_data.params.lmultift8 = m_multithreadFT8; + + m_nFT8Cycles=m_settings->value("NFT8Cycles",3).toInt(); if(!(m_nFT8Cycles>=1 && m_nFT8Cycles<=3)) m_nFT8Cycles=3; + if(m_nFT8Cycles==1) ui->actionDecFT8cycles1->setChecked(true); + else if(m_nFT8Cycles==2) ui->actionDecFT8cycles2->setChecked(true); + else if(m_nFT8Cycles==3) ui->actionDecFT8cycles3->setChecked(true); + + m_nFT8RXfSens=m_settings->value("NFT8QSORXfreqSensitivity",3).toInt(); if(!(m_nFT8RXfSens>=1 && m_nFT8RXfSens<=3)) m_nFT8RXfSens=3; + if(m_nFT8RXfSens==1) ui->actionRXfLow->setChecked(true); + else if(m_nFT8RXfSens==2) ui->actionRXfMedium->setChecked(true); + else if(m_nFT8RXfSens==3) ui->actionRXfHigh->setChecked(true); + + m_ft8threads=m_settings->value("FT8threads",0).toInt(); + if(!(m_ft8threads>=0 && m_ft8threads<25)) m_ft8threads=0; + if(m_ft8threads==0) ui->actionMTAuto->setChecked(true); + else if(m_ft8threads==1) ui->actionMT1->setChecked(true); + else if(m_ft8threads==2) ui->actionMT2->setChecked(true); + else if(m_ft8threads==3) ui->actionMT3->setChecked(true); + else if(m_ft8threads==4) ui->actionMT4->setChecked(true); + else if(m_ft8threads==5) ui->actionMT5->setChecked(true); + else if(m_ft8threads==6) ui->actionMT6->setChecked(true); + else if(m_ft8threads==7) ui->actionMT7->setChecked(true); + else if(m_ft8threads==8) ui->actionMT8->setChecked(true); + else if(m_ft8threads==9) ui->actionMT9->setChecked(true); + else if(m_ft8threads==10) ui->actionMT10->setChecked(true); + else if(m_ft8threads==11) ui->actionMT11->setChecked(true); + else if(m_ft8threads==12) ui->actionMT12->setChecked(true); +// qDebug() << "m_ft8threads is " << m_ft8threads; + dec_data.params.nmt = m_ft8threads; + + ui->actionHide_FT8_dupe_messages->setChecked(m_settings->value("HideFT8Dupes",true).toBool()); + + m_ft8Sensitivity=m_settings->value("FT8Sensitivity",3).toInt(); + if(!(m_ft8Sensitivity>0 && m_ft8Sensitivity<=3)) m_ft8Sensitivity=3; + if(m_ft8Sensitivity==1) ui->actionFT8SensMin->setChecked(true); + else if(m_ft8Sensitivity==2) ui->actionlowFT8thresholds->setChecked(true); + else if(m_ft8Sensitivity==3) ui->actionFT8subpass->setChecked(true); + + m_ft8DecoderStart=m_settings->value("FT8DecoderStart",3).toInt(); + if(!(m_ft8DecoderStart>=0 && m_ft8DecoderStart<=4)) m_ft8DecoderStart=3; + if(m_ft8DecoderStart==0) ui->actionStartTwoStage->setChecked(true); + else if(m_ft8DecoderStart==1) ui->actionStartThreeStage->setChecked(true); + else if(m_ft8DecoderStart==2) ui->actionStartEarly->setChecked(true); + else if(m_ft8DecoderStart==3) ui->actionStartNormal->setChecked(true); + else if(m_ft8DecoderStart==4) ui->actionStartLate->setChecked(true); + + m_FT8WideDxCallSearch=m_settings->value("FT8WideDXCallSearch",true).toBool(); + ui->actionFT8WidebandDXCallSearch->setChecked(m_FT8WideDxCallSearch); + //ft8md + + ui->sbTxPercent->setValue (m_settings->value ("PctTx", 20).toInt ()); + on_sbTxPercent_valueChanged (ui->sbTxPercent->value ()); + auto const roundRobinPolicy = BeaconTx::parseRoundRobinPolicy ( + m_settings->value("RoundRobin", "random").toString ().toStdString ()); + RoundRobinSelection::setPolicy (*ui->RoundRobin, roundRobinPolicy); + m_dBm=m_settings->value("dBm",37).toInt(); + m_send_RR73=m_settings->value("RR73",false).toBool(); + m_score=m_settings->value("Score",0).toInt(); + if (m_send_RR73) genStdMsgs (m_rpt); + ui->WSPR_prefer_type_1_check_box->setChecked (m_settings->value ("WSPRPreferType1", true).toBool ()); + m_uploadWSPRSpots=m_settings->value("UploadSpots",false).toBool(); + ui->cbNoOwnCall->setChecked(m_settings->value("NoOwnCall",false).toBool()); + ui->band_hopping_group_box->setChecked (m_settings->value ("BandHopping", false).toBool()); + // setup initial value of tx attenuator + m_block_pwr_tooltip = true; + ui->outAttenuation->setValue (m_settings->value ("OutAttenuation", 0).toInt ()); + m_block_pwr_tooltip = false; + ui->sbCQTxFreq->setValue (m_settings->value ("CQTxFreq", 260).toInt()); + m_noSuffix=m_settings->value("NoSuffix",false).toBool(); + int n=m_settings->value("GUItab",standard_messages_tab_index).toInt(); + if (SpecOp::FOX==m_specOp) { + ui->tabWidget->setCurrentIndex(n); + } else { + // The Fox queue tab must be shown once so Qt initializes its height. + ui->pbFreeText->setVisible(false); + ui->cbSendMsg->setVisible(false); + ui->tabWidget->setCurrentIndex(fox_queue_tab_index); + ui->tabWidget->setCurrentIndex(n); + } + outBufSize=m_settings->value("OutBufSize",4096).toInt(); + ui->cbHoldTxFreq->setChecked (m_settings->value ("HoldTxFreq", false).toBool ()); + HoldTxFreqStatus = m_settings->value ("HoldTxFreq", false).toBool (); + ui->cbCQonly->setChecked (m_settings->value ("CQonly", false).toBool ()); + ui->cbBypass->setChecked (m_settings->value ("BypassFilters", false).toBool ()); + m_pwrBandTxMemory=m_settings->value("pwrBandTxMemory").toHash(); + m_pwrBandTuneMemory=m_settings->value("pwrBandTuneMemory").toHash(); + ui->actionEnable_AP_FT8->setChecked (m_settings->value ("FT8AP", false).toBool()); + ui->actionEnable_AP_JT65->setChecked (m_settings->value ("JT65AP", false).toBool()); + ui->actionAuto_Clear_Avg->setChecked (m_settings->value ("AutoClearAvg", false).toBool()); + ui->actionDisable_clicks_on_waterfall->setChecked (m_settings->value ("DisableClicksOnWaterfall", false).toBool()); + ui->decodes_splitter->restoreState(m_settings->value("SplitterState").toByteArray()); + ui->sbNB->setValue(m_settings->value("Blanker",0).toInt()); + ui->sbEchoAvg->setValue(m_settings->value("EchoAvg",10).toInt()); + { + auto const& coeffs = m_settings->value ("PhaseEqualizationCoefficients" + , QList {0., 0., 0., 0., 0.}).toList (); + m_phaseEqCoefficients.clear (); + for (auto const& coeff : coeffs) + { + m_phaseEqCoefficients.append (coeff.value ()); + } + } + m_settings->endGroup(); + + // use these initialisation settings to tune the audio o/p buffer + // size and audio thread priority + m_settings->beginGroup ("Tune"); + m_audioThreadPriority = static_cast (m_settings->value ("Audio/ThreadPriority", QThread::TimeCriticalPriority).toInt () % 8); + m_settings->endGroup (); + + m_specOp=m_config.special_op_id(); + checkMSK144ContestType(); + if (displayMsgAvg) on_actionMessage_averaging_triggered(); + if (displayFoxLog) on_fox_log_action_triggered (); + if (displayContestLog) on_contest_log_action_triggered (); + if (displayActiveStations) on_actionActiveStations_triggered(); + if (displayQSYMessageCreator) on_actionQSYMessage_Creator_triggered(); + if (displayQSYMonitor) on_actionQSY_Monitor_triggered(); + +} diff --git a/widgets/mainwindow_show_messages.cpp b/widgets/mainwindow_show_messages.cpp new file mode 100644 index 00000000..6e7236d7 --- /dev/null +++ b/widgets/mainwindow_show_messages.cpp @@ -0,0 +1,67 @@ +#include "mainwindow.h" +#include "MessageBox.hpp" +#include +#include +#include +#include +#include + +void MainWindow::showSoundInError(const QString& errorMsg) +{ + if (m_splash && m_splash->isVisible ()) m_splash->hide (); + MessageBox::critical_message (this, tr ("Error in Sound Input"), errorMsg); +} + +void MainWindow::showSoundOutError(const QString& errorMsg) +{ + noteTxStopReason (TxEvidence::TxStopReason::Error); + if (m_splash && m_splash->isVisible ()) m_splash->hide (); + MessageBox::critical_message (this, tr ("Error in Sound Output"), errorMsg); +} + +void MainWindow::showStatusMessage(const QString& statusMsg) +{ + statusBar()->showMessage(statusMsg, 5000); +} + +bool MainWindow::subProcessFailed (QProcess * process, int exit_code, QProcess::ExitStatus status) +{ + if (m_valid && (exit_code || QProcess::NormalExit != status)) + { + QStringList arguments; + for (auto argument: process->arguments ()) + { + if (argument.contains (' ')) argument = '"' + argument + '"'; + arguments << argument; + } + if (m_splash && m_splash->isVisible ()) m_splash->hide (); + MessageBox::critical_message (this, tr ("Subprocess Error") + , tr ("Subprocess failed with exit code %1") + .arg (exit_code) + , tr ("Running: %1\n%2") + .arg (process->program () + ' ' + arguments.join (' ')) + .arg (QString {process->readAllStandardError()})); + return true; + } + return false; +} + +void MainWindow::subProcessError (QProcess * process, QProcess::ProcessError) +{ + if (m_valid) + { + QStringList arguments; + for (auto argument: process->arguments ()) + { + if (argument.contains (' ')) argument = '"' + argument + '"'; + arguments << argument; + } + if (m_splash && m_splash->isVisible ()) m_splash->hide (); + MessageBox::critical_message (this, tr ("Subprocess error") + , tr ("Running: %1\n%2") + .arg (process->program () + ' ' + arguments.join (' ')) + .arg (process->errorString ())); + m_valid = false; // ensures exit if still constructing + QTimer::singleShot (0, this, SLOT (close ())); + } +} diff --git a/widgets/mainwindow_slots.cpp b/widgets/mainwindow_slots.cpp new file mode 100644 index 00000000..2ff97b42 --- /dev/null +++ b/widgets/mainwindow_slots.cpp @@ -0,0 +1,1093 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "MessageBox.hpp" +#include "DecodedMessageReaction.hpp" +#include "WaitFeaturePolicy.hpp" +#include "commons.h" +#include "echograph.h" +#include "widegraph.h" +#include "messageaveraging.h" +#include "logqso.h" + +using SpecOp = Configuration::SpecialOperatingActivity; + +extern dec_data_t& dec_data; +extern int volatile itone[MAX_NUM_SYMBOLS]; +extern int volatile itone0[MAX_NUM_SYMBOLS]; +extern int volatile icw[NUM_CW_SYMBOLS]; +extern int outBufSize; +extern int rc; +extern qint32 g_iptt; +extern QVector g_ColorTbl; +extern bool blocked; +extern bool m_displayBand; +extern bool wait_and_call; +extern bool no_wait_and_call; +extern bool no_a7_decodes; +extern bool keep_frequency; +extern bool keep_msk144_frequency; +extern bool msk144qsy; +extern bool keep_last_tx_label; +extern int m_Nslots0; +extern int m_TxFreqFox; +extern bool not_erase; +extern bool first_Fox_alert; +extern bool second_Fox_alert; +extern bool no_Fox_alert; +extern bool pounce; +extern bool filtered; +extern bool ignored; +extern bool keepTx5; +extern bool no_logging; +extern bool BlankLineInserted; +extern bool m_txing; +extern bool HoldTxFreqStatus; +extern bool m_band_changed; +extern bool m_muted; +extern bool no_decodes_to_UDP; +extern bool rigFailed; +extern bool programStart; +extern int m_msk144_tr; +extern int m_msk144_tr2; +extern int m_msk144_tr6; +extern QString txLog; +extern QString ignoreList; +extern QString ALLCALL7; +extern QString m_hisCall0; +extern QString earlyDecodes; + + +extern "C" { + void genjtty_(char const * msg, int itone[], int* nsym, fortran_charlen_t); + void gen_jttywave_(int itone[], int* nsym, int* nsps, float* bt, float* fsample, float* f0, + float xjunk[], float wave[], int* icmplx, int* nwave); +} + +void MainWindow::on_monitorButton_clicked (bool checked) +{ + if (m_wav_load_coordinator.isLoading ()) { + ui->monitorButton->setChecked (false); + return; + } + + if (!m_transmitting) { + if (checked) + { + auto const transition = m_operatingFrequency.enableMonitor ( + operatingFrequencyContext (), [this] (Frequency corrected) { + return dispatchNominalFrequency (corrected, FrequencyRequestOrigin::User, true); + }); + applyOperatingFrequencyTransition (transition); + applyMonitorEffects (true, transition.restorationAccepted); + } + else + { + applyMonitorEffects (false, false); + } + } else { + ui->monitorButton->setChecked (false); // disallow + } + if(m_mode=="Echo") m_echoRunning=false; + check_button_color(); +} + +void MainWindow::applyMonitorEffects (bool checked, bool restored) +{ + auto const prior = m_monitoring; + monitor (checked); + if (restored) setXIT (ui->TxFreqSpinBox->value ()); + if (checked && !prior) + { + if (m_mode == "FST4W") + on_sbFST4W_RxFreq_valueChanged (ui->sbFST4W_RxFreq->value ()); + else + on_RxFreqSpinBox_valueChanged (ui->RxFreqSpinBox->value ()); + } + m_config.sync_transceiver (true, checked); + if (m_mode == "Echo") m_echoRunning = false; + check_button_color (); +} + +void MainWindow::on_autoButton_clicked (bool checked) +{ + if (ui->DX_Call_Button->isChecked() && m_specOp==SpecOp::HOUND && m_config.superFox() && !m_bDoubleClicked) return; // for Wait & Call + m_config.transceiver_tune (false); // reset rig tuning + if (checked && ui->tuneButton->isChecked() && !(m_mode=="WSPR" || m_mode=="FST4W")) return; // not allowed while tuning + stopWRTimer.stop(); // stop any Wait & Reply timeout + if (!checked && ui->DX_Call_Button->isChecked()) { + stopWCTimer.stop(); // stop any Wait & Call timeout + ui->DX_Call_Button->click (); // disable Wait & Call + no_wait_and_call = false; // reset Wait & Call + } + m_specOp=m_config.special_op_id(); + ui->pbBandHopping->setChecked(false); // disable band hopping when Tx is enabled + if (checked) { + m_auto = checked; + QTimer::singleShot (3000, [=] {pounce = false;}); // ensure to select only CQ messages + } else { + pounce = false; + m_auto = false; + m_bCallingCQ = false; + ui->autoButton->setChecked(false); // ensure autoButton is unchecked + filtered = false; + ignored = false; + m_muted = false; + m_autoRespondScores.reset(); + } + if (m_mode=="WSPR" || m_mode=="FST4W") + { + m_beaconTxController.setAutoEnabled (checked); + } + bool const enableTxChanged = m_autoRespondPeriodState.setEnableTx(checked); + if (checked && enableTxChanged && m_autoRespondPeriodState.armCurrentReceivePeriod( + pendingCqAutoRespondIntent(), autoRespondPolicy())) { + m_autoRespondScores.reset(); + } + m_maxPoints=-1; + if (checked && ui->respondComboBox->isVisible() && autoRespondPolicy () != AutoRespondPolicy::None + && CALLING == m_QSOProgress) { + m_bAutoReply = false; // ready for next + } + statusUpdate (); + m_bEchoTxOK=false; + if(m_mode=="Echo" and m_auto) { + m_nclearave=1; + echocom_.nsum=0; + } + m_tAutoOn=QDateTime::currentMSecsSinceEpoch()/1000; + if(m_mode=="Echo") m_echoRunning=false; + check_button_color(); +} + +void MainWindow::on_stopButton_clicked() //stopButton +{ + ui->pbBandHopping->setChecked(false); // disable band hopping + monitor (false); + if(m_mode=="JTTY" and m_saveAll and !m_diskData) { + jtty_save_wav(); + } + m_loopall=false; + finishReferenceSpectrumMeasurement(true); + if (ui->DX_Call_Button->isChecked()) ui->DX_Call_Button->click (); + stopWRTimer.stop(); // Stop any Wait & Reply timeout + stopWCTimer.stop(); // Stop any Wait & Call timeout + no_wait_and_call = false; + m_specOp=m_config.special_op_id(); + if (ui->respondComboBox->isVisible() and autoRespondPolicy () != AutoRespondPolicy::None and !m_diskData) { + m_autoRespondScores.reset(); + if (!(m_mode=="Q65" or m_mode=="JT65")) { + clearDX(); // clear dxCallEntry + ui->dxGridEntry->clear (); // clear dxGridEntry + if (!keepTx5) ui->tx5->setCurrentText(""); // clear tx5 + } + } + pounce = false; + ui->autoButton->setChecked(false); // ensure auoButton is unchecked + filtered = false; + ignored = false; + m_muted = false; + check_button_color(); +} + +void MainWindow::on_pbBandHopping_clicked() +{ + if (m_auto) ui->pbBandHopping->setChecked(false); // don't allow band hopping when in QSO +} + +void MainWindow::on_DecodeButton_clicked (bool /* checked */) //Decode request +{ + if (m_wav_load_coordinator.isLoading ()) { + ui->DecodeButton->setChecked (false); + return; + } + + if(m_mode=="MSK144") { + ui->DecodeButton->setChecked(false); + } else if(m_mode=="JTTY") { + jtty_again(); + } else { + if(m_mode!="WSPR" && !decoderBusy ()) { + if (usesJt9Process () + && (Jt9ProcessPhase::Ready != m_jt9ProcessPhase + || QProcess::Running != proc_jt9.state ())) + { + ui->DecodeButton->setChecked (false); + showStatusMessage (tr ("Decoder is starting; decode request skipped.")); + return; + } + m_manualDecode=true; + dec_data.params.newdat=0; + dec_data.params.nagain=1; + decode(); + } + } +} + +void MainWindow::on_ClrAvgButton_clicked() +{ + m_nclearave=1; + if(m_mode=="Echo") { + echocom_.nsum=0; + m_echoGraph->clearAvg(); + m_wideGraph->restartTotalPower(); + } else { + if(m_msgAvgWidget != NULL) { + if(m_msgAvgWidget->isVisible()) m_msgAvgWidget->displayAvg(""); + } + if(m_mode=="Q65") ndecodes_label.setText("0 0"); + } +} + +void MainWindow::on_EraseButton_clicked () +{ + qint64 ms=QDateTime::currentMSecsSinceEpoch(); + if (m_config.alternate_erase_button()) { + ui->decodedTextBrowser->erase (); + if((ms-m_msErase)<500) { + ui->decodedTextBrowser2->erase (); + } + } else { + ui->decodedTextBrowser2->erase (); + if(m_mode=="WSPR" or m_mode=="Echo" or m_mode=="FST4W") { + ui->decodedTextBrowser->erase (); + } else { + if((ms-m_msErase)<500) { + ui->decodedTextBrowser->erase (); + } + } + } + m_msErase=ms; +} + +void MainWindow::on_txb1_clicked() +{ + m_autoRespondPeriodState.disarm(); + if (ui->tx1->isEnabled ()) { + m_ntx=1; + m_QSOProgress = REPLYING; + ui->txrb1->setChecked(true); + if(m_transmitting) m_restart=true; + } + else { + on_txb2_clicked (); + } +} + +void MainWindow::on_txb2_clicked() +{ + m_autoRespondPeriodState.disarm(); + m_ntx=2; + m_QSOProgress = REPORT; + ui->txrb2->setChecked(true); + if(m_transmitting) m_restart=true; +} + +void MainWindow::on_txb3_clicked() +{ + m_autoRespondPeriodState.disarm(); + m_ntx=3; + m_QSOProgress = ROGER_REPORT; + ui->txrb3->setChecked(true); + if(m_transmitting) m_restart=true; +} + +void MainWindow::on_txb4_clicked() +{ + m_autoRespondPeriodState.disarm(); + m_ntx=4; + m_QSOProgress = ROGERS; + ui->txrb4->setChecked(true); + if(m_transmitting) m_restart=true; +} + +void MainWindow::on_txb5_clicked() +{ + m_autoRespondPeriodState.disarm(); + m_ntx=5; + m_QSOProgress = SIGNOFF; + ui->txrb5->setChecked(true); + if(m_transmitting) m_restart=true; +} + +void MainWindow::on_txb6_clicked() +{ + m_autoRespondPeriodState.disarm(); + m_ntx=6; + m_QSOProgress = CALLING; + set_dateTimeQSO(-1); + ui->txrb6->setChecked(true); + if(m_transmitting) m_restart=true; + if(m_mode=="MSK144" && !programStart && !m_band_changed && !keep_msk144_frequency + && hasMsk144BaseFrequency ()) { + if (requestNominalFrequencyChange (m_msk144basefreq, FrequencyRequestOrigin::User)) + { + msk144qsy = false; + } + } +} + +void MainWindow::on_lookupButton_clicked() //Lookup button +{ + qint64 ms=QDateTime::currentMSecsSinceEpoch(); + lookup(); + if((ms-m_msErase)<500) { + QString hisCall=ui->dxCallEntry->text(); + if (hisCall !="") QDesktopServices::openUrl (QUrl {"https://www.qrz.com/db/" + hisCall}); + } + m_msErase=ms; +} + +void MainWindow::on_addButton_clicked() //Add button +{ + if(!ui->dxGridEntry->text ().size ()) { + MessageBox::warning_message (this, tr ("Add to CALL3.TXT") + , tr ("Please enter a valid grid locator")); + return; + } + m_call3Modified=false; + QString hisCall=ui->dxCallEntry->text(); + QString hisgrid=ui->dxGridEntry->text(); + QString newEntry=hisCall + "," + hisgrid; + + // int ret = MessageBox::query_message(this, tr ("Add to CALL3.TXT"), + // tr ("Is %1 known to be active on EME?").arg (newEntry)); + // if(ret==MessageBox::Yes) { + // newEntry += ",EME,,"; + // } else { + newEntry += ",,,"; + // } + + QFile f1 {m_config.writeable_data_dir ().absoluteFilePath ("CALL3.TXT")}; + if(!f1.open(QIODevice::ReadWrite | QIODevice::Text)) { + MessageBox::warning_message (this, tr ("Add to CALL3.TXT") + , tr ("Cannot open \"%1\" for read/write: %2") + .arg (f1.fileName ()).arg (f1.errorString ())); + return; + } + if(f1.size()==0) { + QTextStream out(&f1); + out << "ZZZZZZ" +#if QT_VERSION >= QT_VERSION_CHECK (5, 15, 0) + << Qt::endl +#else + << endl +#endif + ; + f1.seek (0); + } + QFile f2 {m_config.writeable_data_dir ().absoluteFilePath ("CALL3.TMP")}; + if(!f2.open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text)) { + MessageBox::warning_message (this, tr ("Add to CALL3.TXT") + , tr ("Cannot open \"%1\" for writing: %2") + .arg (f2.fileName ()).arg (f2.errorString ())); + return; + } + { + QTextStream in(&f1); //Read from CALL3.TXT + QTextStream out(&f2); //Copy into CALL3.TMP + QString hc=hisCall; + QString hc1=""; + QString hc2="000000"; + QString s; + do { + s=in.readLine(); + hc1=hc2; + if(s.mid(0,2)=="//") { + out << s + QChar::LineFeed; //Copy all comment lines + } else { + int i1=s.indexOf(","); + hc2=s.mid(0,i1); + if(hc>hc1 && hchc1 && !m_call3Modified) out << newEntry + QChar::LineFeed; + } + + if(m_call3Modified) { + auto const& old_path = m_config.writeable_data_dir ().absoluteFilePath ("CALL3.OLD"); + QFile f0 {old_path}; + if (f0.exists ()) f0.remove (); + f1.copy (old_path); // copying as we want to + // preserve symlinks + f1.open (QFile::WriteOnly | QFile::Text); // truncates + f2.seek (0); + QByteArray tmp = f2.readAll(); + if (tmp != (const char*)NULL) f1.write (tmp); // copy contents + else qDebug() << "tmp==NULL at f1.write"; + f2.remove (); + } +} + +void MainWindow::on_ignoreButton_clicked() //Ignore button +{ + addCallsignToignoreList(); +} + +void MainWindow::on_DX_Call_Button_clicked (bool checked) +{ + WaitFeatureContext const waitContext { + m_mode, + m_specOp, + m_config.Wait_features_enabled(), + ui->cbAutoSeq->isChecked(), + !m_hisCall.isEmpty(), + m_config.NCCC_Sprint() + }; + if (checked && wait_and_call_arming_eligible (waitContext)) { + wait_and_call = true; // toggle Wait & Call on when allowed + } else { + wait_and_call = false; // toggle Wait & Call off in any other case + ui->DX_Call_Button->setChecked (false); + if (m_specOp==SpecOp::HOUND && m_config.superFox() && !m_auto) clearDX(); + } + check_button_color(); +} + +void MainWindow::on_genStdMsgsPushButton_clicked() //genStdMsgs button +{ + ui->pbBandHopping->setChecked(false); // disable band hopping + genStdMsgs(m_rpt); + if (!m_bDoubleClicked && m_hisCall!="") { + if (ui->tx1->isEnabled ()) { + QTimer::singleShot (0, ui->txrb1, SLOT (click ())); // Go to Tx1 + } else { + QTimer::singleShot (0, ui->txrb2, SLOT (click ())); // Go to Tx2 if Tx1 is disabled + } + m_bMyCallStd=stdCall(m_config.my_callsign()); //ft8md + m_bHisCallStd=stdCall(m_hisCall); //ft8md + + } +} + +void MainWindow::on_logQSOButton_clicked() //Log QSO button +{ + auto stopAutoTx = [this] { + if (SpecOp::NA_VHF==m_specOp && m_mode=="FT4" && m_config.NCCC_Sprint()) { + QTimer::singleShot (int(850.0*m_TRperiod), [this] {cease_auto_Tx_after_QSO ();}); + } else { + cease_auto_Tx_after_QSO (); + } + }; + DecodedMessageReaction::applyAutoTxStopAfterLogging( + m_mode, m_config.repeat_Tx(), send_rr73_for_tx4 (), stopAutoTx); + + if (!m_hisCall.size ()) { + MessageBox::warning_message (this, tr ("Warning: DX Call field is empty.")); + if ((SpecOp::NA_VHF == m_specOp or SpecOp::WW_DIGI == m_specOp) && m_config.autoLog()) return; // prevent program crash + } + // m_dateTimeQSOOn should really already be set but we'll ensure it gets set to something just in case + if (!m_dateTimeQSOOn.isValid ()) { + auto now = QDateTime::currentDateTimeUtc(); + m_dateTimeQSOOn = now.addSecs (-(m_ntx - 2) * int(m_TRperiod) - + int(fmod(double(now.time().second()),m_TRperiod))); + } + auto dateTimeQSOOff = QDateTime::currentDateTimeUtc(); + if (dateTimeQSOOff < m_dateTimeQSOOn) dateTimeQSOOff = m_dateTimeQSOOn; + QString grid=m_hisGrid; + if(grid=="....") grid=""; + + // Optionally replace empty grids by "ZZ00" + if(m_config.ZZ00() && m_hisGrid=="" && m_specOp!=SpecOp::NONE && m_specOp!=SpecOp::FOX && m_specOp!=SpecOp::HOUND) m_hisGrid = "ZZ00"; + + switch( m_specOp ) + { + case SpecOp::NA_VHF: + m_xSent=m_config.my_grid().left(4); + m_xRcvd=m_hisGrid.left(4); + break; + case SpecOp::EU_VHF: + m_rptSent=m_xSent.split(" ").at(0).left(2); + m_rptRcvd=m_xRcvd.split(" ").at(0).left(2); + if(m_xRcvd.split(" ").size()>=2) m_hisGrid=m_xRcvd.split(" ").at(1); + grid=m_hisGrid; + ui->dxGridEntry->setText(grid); + break; + case SpecOp::FIELD_DAY: + m_rptSent=m_xSent.split(" ").at(0); + m_rptRcvd=m_xRcvd.split(" ").at(0); + break; + case SpecOp::RTTY: + m_rptSent=m_xSent.split(" ").at(0); + m_rptRcvd=m_xRcvd.split(" ").at(0); + break; + case SpecOp::WW_DIGI: + m_xSent=m_config.my_grid().left(4); + m_xRcvd=m_hisGrid.left(4); + break; + case SpecOp::ARRL_DIGI: + m_xSent=m_config.my_grid().left(4); + m_xRcvd=m_hisGrid.left(4); + break; + case SpecOp::Q65_PILEUP: + m_xSent=m_config.my_grid().left(4); + m_xRcvd=m_hisGrid; + break; + default: break; + } + + m_logDlg->initLogQSO (m_hisCall, grid, m_mode, m_rptSent, m_rptRcvd, + m_dateTimeQSOOn, dateTimeQSOOff, m_operatingFrequency.rx () + + ui->TxFreqSpinBox->value(), m_noSuffix, m_xSent, m_xRcvd); + m_inQSOwith=""; + if (ui->respondComboBox->isVisible() && autoRespondPolicy () != AutoRespondPolicy::None) { + m_autoRespondScores.reset(); + } + QTimer::singleShot (2000, [=] { + pounce = false; + filtered = false; + read_txLog(); + check_button_color(); + }); + QTimer::singleShot (7000, [=] { + read_txLog(); + }); + stopWRTimer.stop(); // Stop any Wait & Reply timeout + stopWCTimer.stop(); // Stop any Wait & Call timeout +} + +void MainWindow::on_tuneButton_clicked (bool checked) +{ + if (checked) m_autoRespondPeriodState.disarm(); + rigTuneTimer.stop (); + ui->pbBandHopping->setChecked(false); // disable band hopping + // prevent tuning on top of a SuperFox message + if (SpecOp::HOUND==m_specOp && m_config.superFox() && !m_tune) { + QDateTime now = QDateTime::currentDateTimeUtc(); + int s = now.time().toString("ss").toInt(); + if ((s >= 0 && s < 15) || (s >= 30 && s < 45)) { + ui->tuneButton->setChecked (false); + m_config.transceiver_tune (false); // reset rig tuning + return; + } + } + m_config.transceiver_tune (false); // reset rig tuning + if (blocked) return; + if (checked && (m_mode=="WSPR" || m_mode=="FST4W") + && m_beaconTxController.tuneKind () == BeaconTx::TuneKind::None) + { + processBeaconActions (m_beaconTxController.tuneStarted (BeaconTx::TuneKind::Manual)); + } + if (m_auto && !(m_mode=="WSPR" || m_mode=="FST4W")) ui->autoButton->click(); // stop any other transmission + stopWRTimer.stop(); // stop any Wait & Reply timeout + stopWCTimer.stop(); // stop any Wait & Call timeout + if (checked && m_config.tune_watchdog() && !(m_mode=="WSPR" || m_mode=="FST4W")) { + tuneATU_Timer.start (m_config.tune_watchdog_time()*1000); // tune watchdog + } + if (!checked) { + tuneATU_Timer.stop (); // stop tune watchdog when stopping Tune manually + ui->tuneButton->setText("Tune"); + } + static bool lastChecked = false; + if (lastChecked == checked) return; + lastChecked = checked; + if (checked && m_tune==false) { // we're starting tuning so remember Tx and change pwr to Tune value + if (m_config.pwrBandTuneMemory ()) { + auto const& curBand = ui->bandComboBox->currentText(); + m_pwrBandTxMemory[curBand] = ui->outAttenuation->value(); // remember our Tx pwr + m_PwrBandSetOK = false; + if (m_pwrBandTuneMemory.contains(curBand)) { + ui->outAttenuation->setValue(m_pwrBandTuneMemory[curBand].toInt()); // set to Tune pwr + } + m_PwrBandSetOK = true; + } + } + if (m_tune) { + tuneButtonTimer.start(250); + } else { + m_sentFirst73=false; + itone[0]=0; + on_monitorButton_clicked (true); + m_tune=true; + } + if (m_tci_audio) Q_EMIT m_config.transceiver_tune(checked); + else Q_EMIT tune (checked); +} + +void MainWindow::reset_transmit_controls_after_stop () +{ + m_autoRespondPeriodState.setEnableTx(false); + ui->pbBandHopping->setChecked(false); // disable band hopping + m_btxok=false; + m_bCallingCQ = false; + m_bAutoReply = false; // ready for next + m_maxPoints=-1; + if (ui->DX_Call_Button->isChecked()) ui->DX_Call_Button->click (); + stopWRTimer.stop(); // Stop any Wait & Reply timeout + stopWCTimer.stop(); // Stop any Wait & Call timeout + tuneATU_Timer.stop (); // stop tune watchdog when stopping Tune manually + no_wait_and_call = false; + m_specOp=m_config.special_op_id(); + if (ui->respondComboBox->isVisible() && autoRespondPolicy () != AutoRespondPolicy::None) { + m_autoRespondScores.reset(); + } + pounce = false; + ui->autoButton->setChecked(false); // ensure autoButton is unchecked + ui->tuneButton->setChecked (false); + ui->tuneButton->setText("Tune"); + m_tune=false; + m_bTxTime=false; + filtered = false; + ignored = false; + m_muted = false; + check_button_color(); +} + +void MainWindow::on_stopTxButton_clicked() // Stop Tx +{ + noteTxStopReason (TxEvidence::TxStopReason::UserHalt); + if (m_beaconTxController.txLifecycle () == BeaconTx::TxLifecycle::Decided + || m_beaconTxController.txLifecycle () == BeaconTx::TxLifecycle::StartRequested) + { + m_tx_when_ready = false; + ptt1Timer.stop (); + processBeaconActions (m_beaconTxController.transmitWindowEnded ()); + if (g_iptt == 1 || m_transmitting) stopTx (); + else g_iptt = 0; + } + if (m_beaconTxController.active ()) + { + m_beaconTxController.setAutoEnabled (false); + } + if (m_tune) stop_tuning (); + if (m_auto) auto_tx_mode (false); + reset_transmit_controls_after_stop (); +} + +void MainWindow::on_pbR2T_clicked() +{ + ui->TxFreqSpinBox->setValue(ui->RxFreqSpinBox->value ()); +} + +void MainWindow::on_pbT2R_clicked() +{ + if (ui->RxFreqSpinBox->isEnabled ()) + { + ui->RxFreqSpinBox->setValue (ui->TxFreqSpinBox->value ()); + } +} + +void MainWindow::on_pbR2T_2_clicked() +{ + ui->TxFreqSpinBox_2->setValue(ui->RxFreqSpinBox_2->value ()); +} + +void MainWindow::on_pbT2R_2_clicked() +{ + ui->RxFreqSpinBox_2->setValue (ui->TxFreqSpinBox_2->value ()); +} + +void MainWindow::on_readFreq_clicked() +{ + if (m_transmitting) return; + + if (m_config.transceiver_online ()) + { + m_config.sync_transceiver (true, true); + } +} + +void MainWindow::on_cbFast9_clicked(bool b) +{ + if(m_mode=="JT9") { + m_bFast9=b; +// ui->cbAutoSeq->setVisible(b); + blocked=true; // needed to prevent a loop + on_actionJT9_triggered(); + QTimer::singleShot (50, [=] {blocked = false;}); // needed to prevent a loop + QTimer::singleShot (200, [=] { + if(m_mode=="JT9") m_settings->setValue("JT9_Fast",m_bFast9); + }); + } + + if(b) { + m_TRperiod = ui->sbTR->value (); + } else { + m_TRperiod=60.0; + } + progressBar.setMaximum(int(m_TRperiod)); + m_wideGraph->setPeriod(m_TRperiod,m_nsps); + fast_config(b); + statusChanged (); +} + +void MainWindow::on_pbTxNext_clicked(bool b) +{ + if (m_mode=="WSPR" || m_mode=="FST4W") + { + auto const pendingStart = m_beaconTxController.txLifecycle () + == BeaconTx::TxLifecycle::StartRequested; + auto const planId = m_beaconTxController.txPlanId (); + processBeaconActions (m_beaconTxController.setTxNext (b)); + if (!b && pendingStart && !m_beaconTxController.transmitWindow ()) + { + m_tx_when_ready = false; + ptt1Timer.stop (); + if (m_transmitting) stopTx (); + else + { + g_iptt = 0; + processBeaconActions (m_beaconTxController.txStopped (planId)); + } + } + } + if (b && !ui->autoButton->isChecked ()) + { + ui->autoButton->click (); // make sure Tx is possible + } +} + +void MainWindow::on_pbFoxReset_clicked() +{ + if(m_specOp!=SpecOp::FOX) return; + auto button = MessageBox::query_message (this, tr ("Confirm Reset"), + tr ("Are you sure you want to clear the QSO queues?")); + if(button == MessageBox::Yes) { + FoxReset("Manual Reset"); + } +} + +void MainWindow::on_pbFreeText_clicked() +{ + bool ok; + QString freeTextMsg; + if(m_config.superFox()) { + freeTextMsg = QInputDialog::getText (this, tr("Free Text Message"), + tr("Message:"), QLineEdit::Normal, m_freeTextMsg0, &ok).left(26); + } else { + freeTextMsg = QInputDialog::getText (this, tr("Free Text Message"), + tr("Message:"), QLineEdit::Normal, m_freeTextMsg0, &ok).left(13); + } + if(!ok) return; + + freeTextMsg=freeTextMsg.toUpper(); + if(m_config.superFox()) { + // Mirrors valid_sfox_free_text in lib/superfox/sfox_pack.f90. + QString const validChars {" 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ+-./?"}; + for(QChar const ch: freeTextMsg) { + if(!validChars.contains(ch)) { + QString const message = tr ("SuperFox free text may only contain " + "spaces, digits, uppercase letters, and + - . / ?."); + MessageBox::warning_message (this, tr ("Free Text Message"), message); + return; + } + } + } + + m_freeTextMsg=freeTextMsg; + m_freeTextMsg0=m_freeTextMsg; +} + +void MainWindow::on_pbBestSP_clicked() +{ + m_bBestSPArmed = !m_bBestSPArmed; + if(m_bBestSPArmed and !m_transmitting) ui->pbBestSP->setStyleSheet ("QPushButton{color:red}"); + if(!m_bBestSPArmed) ui->pbBestSP->setStyleSheet (""); + if(m_bBestSPArmed) m_dateTimeBestSP=QDateTime::currentDateTimeUtc(); +} + +void MainWindow::on_houndButton_clicked (bool checked) +{ + if (checked) { + HoldTxFreqStatus = ui->cbHoldTxFreq->isChecked(); // save state of the Hold Tx Freq checkbox + m_config.setSpecial_Hound(); + ui->tx1->setVisible(true); + ui->tx1->setEnabled(true); + ui->txb1->setEnabled(true); + } else { + m_config.setSpecial_None(); + keep_frequency = true; + QTimer::singleShot (250, [=] {keep_frequency = false;}); + } + m_specOp=m_config.special_op_id(); + on_actionFT8_triggered(); + check_button_color(); +} + +void MainWindow::on_cbHoldTxFreq_clicked (bool) +{ + HoldTxFreqStatus = ui->cbHoldTxFreq->isChecked(); // save state of the Hold Tx Freq checkbox +} + +void MainWindow::on_ft8Button_clicked() +{ + if (m_specOp==SpecOp::HOUND or m_specOp==SpecOp::FOX) { + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } + on_actionFT8_triggered(); +} + +void MainWindow::on_ft4Button_clicked() +{ + on_actionFT4_triggered(); +} + +void MainWindow::on_msk144Button_clicked() +{ + on_actionMSK144_triggered(); +} + +void MainWindow::on_q65Button_clicked() +{ + if (m_specOp==SpecOp::Q65_PILEUP) { + m_q65PileupCopiedLastRxCall.clear(); + m_q65PileupCopiedCallers.clear(); + m_config.setSpecial_None(); + m_specOp=m_config.special_op_id(); + } + on_actionQ65_triggered(); +} + +void MainWindow::on_jt65Button_clicked() +{ + on_actionJT65_triggered(); +} + +void MainWindow::on_echoButton_clicked() +{ + on_actionEcho_triggered(); +} + +void MainWindow::on_pb15A_clicked() +{ + ui->sbTR->setValue(15); + ui->sbSubmode->setValue(0); +} + +void MainWindow::on_pb15C_clicked() +{ + ui->sbTR->setValue(15); + ui->sbSubmode->setValue(2); + ui->TxFreqSpinBox->setValue(700); +} + +void MainWindow::on_pb30B_clicked() +{ + ui->sbTR->setValue(30); + ui->sbSubmode->setValue(1); +} + +void MainWindow::on_pb60C_clicked() +{ + ui->sbTR->setValue(60); + ui->sbSubmode->setValue(2); +} + +void MainWindow::on_pb60D_clicked() +{ + ui->sbTR->setValue(60); + ui->sbSubmode->setValue(3); +} + +void MainWindow::on_pb60E_clicked() +{ + ui->sbTR->setValue(60); + ui->sbSubmode->setValue(4); + ui->TxFreqSpinBox->setValue(700); +} + +void MainWindow::on_pb160_clicked() +{ + requestBandButtonFrequency (1840000, 1837000, m_msk144_tr); +} + +void MainWindow::on_pb80_clicked() +{ + requestBandButtonFrequency (3573000, 3576000, m_msk144_tr); +} + +void MainWindow::on_pb60_clicked() +{ + requestBandButtonFrequency (5357000, 5357000, m_msk144_tr); +} + +void MainWindow::on_pb40_clicked() +{ + requestBandButtonFrequency (7074000, 7077000, m_msk144_tr); +} + +void MainWindow::on_pb30_clicked() +{ + requestBandButtonFrequency (10136000, 10139000, m_msk144_tr); +} + +void MainWindow::on_pb20_clicked() +{ + requestBandButtonFrequency (14074000, 14077000, m_msk144_tr); +} + +void MainWindow::on_pb17_clicked() +{ + requestBandButtonFrequency (18100000, 18103000, m_msk144_tr); +} + +void MainWindow::on_pb15_clicked() +{ + requestBandButtonFrequency (21074000, 21077000, m_msk144_tr); +} + +void MainWindow::on_pb12_clicked() +{ + requestBandButtonFrequency (24915000, 24918000, m_msk144_tr); +} + +void MainWindow::on_pb10_clicked() +{ + requestBandButtonFrequency (28074000, 28077000, m_msk144_tr); +} + +void MainWindow::on_pb6_clicked() +{ + requestBandButtonFrequency (50313000, 50316000, m_msk144_tr6); +} + +void MainWindow::on_pb2_clicked() +{ + requestBandButtonFrequency (144074000, 144077000, m_msk144_tr2); +} + +void MainWindow::on_pb70_clicked() +{ + requestBandButtonFrequency (432074000, 432077000, m_msk144_tr); +} + +void MainWindow::on_pb8_clicked() +{ + requestBandButtonFrequency (40680000, 40680000, m_msk144_tr); +} + +void MainWindow::on_pb50_clicked() +{ + requestBandButtonFrequency (50313000, 50316000, m_msk144_tr6); +} + +void MainWindow::on_pb4_clicked() +{ + requestBandButtonFrequency (70154000, 70154000, m_msk144_tr6); +} + +void MainWindow::on_pb144_clicked() +{ + requestBandButtonFrequency (144074000, 144077000, m_msk144_tr2); +} + +void MainWindow::on_pb220_clicked() +{ + requestBandButtonFrequency (222174000, 222177000, m_msk144_tr); +} + +void MainWindow::on_pb432_clicked() +{ + requestBandButtonFrequency (432174000, 432177000, m_msk144_tr); +} + +void MainWindow::on_pb902_clicked() +{ + requestBandButtonFrequency (902174000, 902177000, m_msk144_tr); +} + +void MainWindow::on_pb23_clicked() +{ + requestBandButtonFrequency (1296065000, 1296065000, m_msk144_tr); +} + +void MainWindow::on_pb13_clicked() +{ + requestBandButtonFrequency (2304065000, 2304065000, m_msk144_tr); +} + +void MainWindow::on_pb9_clicked() +{ + requestBandButtonFrequency (3400065000, 3400065000, m_msk144_tr); +} + +void MainWindow::on_pb5G_clicked() +{ + requestBandButtonFrequency (5760200000, 5760200000, m_msk144_tr); +} + +void MainWindow::on_pb10G_clicked() +{ + requestBandButtonFrequency (10368200000, 10368200000, m_msk144_tr); +} + +void MainWindow::on_pb24G_clicked() +{ + requestBandButtonFrequency (24048200000, 24048200000, m_msk144_tr); +} + +void MainWindow::on_pbSendMessage_clicked() +{ + submitJttyDraft (ui->Tx_Message->text ().toUpper ()); +} + +void MainWindow::on_Tx_Message_returnPressed() +{ + on_pbSendMessage_clicked(); +} + +void MainWindow::on_pbF1_clicked() +{ + sendJttyFunctionKey(1); +} + +void MainWindow::on_pbF2_clicked() +{ + sendJttyFunctionKey(2); +} + +void MainWindow::on_pbF3_clicked() +{ + sendJttyFunctionKey(3); +} + +void MainWindow::on_pbF4_clicked() +{ + sendJttyFunctionKey(4); +} + +void MainWindow::on_pbF5_clicked() +{ + sendJttyFunctionKey(5); +} + +void MainWindow::on_pbF6_clicked() +{ + sendJttyFunctionKey(6); +} + +void MainWindow::on_pbF7_clicked() +{ + sendJttyFunctionKey(7); +} + +void MainWindow::on_pbF8_clicked() +{ + sendJttyFunctionKey(8); +} diff --git a/widgets/plotter.cpp b/widgets/plotter.cpp index 263566d4..aaef1384 100644 --- a/widgets/plotter.cpp +++ b/widgets/plotter.cpp @@ -10,17 +10,31 @@ #include "qt_helpers.hpp" #include "commons.h" #include "moc_plotter.cpp" +#include #include #include #define MAX_SCREENSIZE 8192 +namespace +{ + // Matches WideGraph's m_swide capacity and dialog width limit. + constexpr int kWaterfallStorageWidth = 2048; + + int drawablePixel(int x, int extent) + { + if(extent <= 1) return 0; + if(x < 0) return 0; + if(x >= extent) return extent - 1; + return x; + } +} extern "C" { void flat4_(float swide[], int* iz, int* nflatten); void plotsave_(float swide[], int* m_w , int* m_h1, int* irow); } -extern dec_data dec_data; +extern dec_data_t& dec_data; CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor QFrame {parent}, @@ -28,7 +42,6 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor m_bScaleOK {false}, m_bReference {false}, m_bReference0 {false}, - m_fSpan {2000.0}, m_plotZero {0}, m_plotGain {0}, m_plot2dGain {0}, @@ -36,12 +49,9 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor m_nSubMode {0}, m_Running {false}, m_paintEventBusy {false}, - m_fftBinWidth {1500.0/2048.0}, m_dialFreq {0.}, m_sum {}, m_dBStepSize {10}, - m_FreqUnits {1}, - m_hdivs {HORZ_DIVS}, m_line {0}, m_fSample {12000}, m_nsps {6912}, @@ -49,7 +59,6 @@ CPlotter::CPlotter(QWidget *parent) : //CPlotter Constructor m_Percent2DScreen0 {0}, m_rxFreq {1020}, m_txFreq {0}, - m_startFreq {0}, m_lastMouseX {-1}, m_lastPaintedX {-1} // m_tol {100} @@ -95,7 +104,7 @@ void CPlotter::resizeEvent(QResizeEvent* ) //resizeEvent() if( m_Size != size() or (m_bReference != m_bReference0) or m_Percent2DScreen != m_Percent2DScreen0) { m_Size = size(); - m_w = m_Size.width(); + m_scale.setWidth(m_Size.width()); m_h = m_Size.height(); m_h2 = m_Percent2DScreen*m_h/100.0; if(m_h2>m_h-30) m_h2=m_h-30; @@ -109,12 +118,11 @@ void CPlotter::resizeEvent(QResizeEvent* ) //resizeEvent() m_HoverOverlayPixmap.fill(Qt::transparent); m_2DPixmap = QPixmap(m_Size.width(), m_h2); m_2DPixmap.fill(Qt::black); - m_WaterfallPixmap = QPixmap(m_Size.width(), m_h1); + m_WaterfallPixmap = QPixmap(kWaterfallStorageWidth, m_h1); + m_WaterfallPixmap.fill(Qt::black); m_OverlayPixmap = QPixmap(m_Size.width(), m_h2); m_OverlayPixmap.fill(Qt::black); - m_WaterfallPixmap.fill(Qt::black); - m_2DPixmap.fill(Qt::black); - m_ScalePixmap = QPixmap(m_w,30); + m_ScalePixmap = QPixmap(m_scale.width(),30); m_ScalePixmap.fill(Qt::white); m_Percent2DScreen0 = m_Percent2DScreen; m_bResized = true; @@ -122,6 +130,7 @@ void CPlotter::resizeEvent(QResizeEvent* ) //resizeEvent() m_x=0; } DrawOverlay(); + if(m_bScaleOK) drawSavedWaterfall(); } void CPlotter::paintEvent(QPaintEvent *) // paintEvent() @@ -130,7 +139,7 @@ void CPlotter::paintEvent(QPaintEvent *) // paint m_paintEventBusy=true; QPainter painter(this); painter.drawPixmap(0,0,m_ScalePixmap); - painter.drawPixmap(0,30,m_WaterfallPixmap); + painter.drawPixmap(0,30,m_WaterfallPixmap,0,0,m_scale.width(),m_h1); painter.drawPixmap(0,m_h1,m_2DPixmap); int x = XfromFreq(m_rxFreq); if (m_bars) { @@ -148,19 +157,26 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) if (!m_TRperiod) return; // not ready to plot yet int j,j0; float y,y2,ymin; - double fac = sqrt(m_binsPerPixel*m_waterfallAvg/15.0); + bool const drawWaterfall = bScroll or bRed or m_bReplot; + double fac = sqrt(m_scale.binsPerPixel()*m_waterfallAvg/15.0); double gain = fac*pow(10.0,0.015*m_plotGain); double gain2d = pow(10.0,0.02*(m_plot2dGain)); - if(m_bReference != m_bReference0) resizeEvent(NULL); - m_bReference0=m_bReference; + if(m_bReference != m_bReference0) { + m_bReference0=m_bReference; + resizeEvent(NULL); + } //move current data down one line (must do this before attaching a QPainter object) - if(bScroll and !m_bReplot) m_WaterfallPixmap.scroll(0,1,0,0,m_w,m_h1); + int waterfallWidth = m_WaterfallPixmap.width(); + if(waterfallWidth<1) return; + if(bScroll and !m_bReplot) { + m_WaterfallPixmap.scroll(0,1,0,0,waterfallWidth,m_h1); + } QPainter painter1(&m_WaterfallPixmap); if(m_bFirst or bRed or !m_bQ65_Sync or m_mode!=m_mode0 or m_bResized or m_rxFreq!=m_rxFreq0) { - m_2DPixmap = m_OverlayPixmap.copy(0,0,m_w,m_h2); + m_2DPixmap = m_OverlayPixmap.copy(0,0,m_scale.width(),m_h2); m_bFirst=false; m_bResized=false; m_rxFreq0=m_rxFreq; @@ -185,59 +201,84 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) static QPoint LineBuf3[MAX_SCREENSIZE]; static QPoint LineBuf4[MAX_SCREENSIZE]; j=0; - j0=int(m_startFreq/m_fftBinWidth + 0.5); - int iz=XfromFreq(5000.0); - int jz=iz*m_binsPerPixel; - m_fMax=FreqfromX(iz); - if(bScroll and swide[0]<1.e29) { - flat4_(swide,&iz,&m_Flatten); - if(!m_bReplot) flat4_(&dec_data.savg[j0],&jz,&m_Flatten); - } + j0=int(m_scale.startHz()/m_scale.fftBinWidthHz() + 0.5); + int izVisible=XfromFreq(5000.0); + if(izVisible>waterfallWidth) izVisible=waterfallWidth; + if(izVisible<0) izVisible=0; + int jz=izVisible*m_scale.binsPerPixel(); - ymin=1.e30; - if(swide[0]>1.e29 and swide[0]< 1.5e30) painter1.setPen(Qt::green); - if(swide[0]>1.4e30) painter1.setPen(Qt::red); - if(!m_bReplot) { + if(bScroll and !m_bReplot) { m_j=0; int irow=-1; - plotsave_(swide,&m_w,&m_h1,&irow); + plotsave_(swide,&waterfallWidth,&m_h1,&irow); } + + m_swideDisplay.resize(waterfallWidth); + std::copy(swide, swide + waterfallWidth, m_swideDisplay.data()); + float *swidePlot = m_swideDisplay.data(); + if(swidePlot[0]<1.e29 and izVisible>0) { + flat4_(swidePlot,&izVisible,&m_Flatten); + } + + m_savgDisplay.clear(); + if(bScroll and !m_bReplot) { + int savgBins = jz; + int availableBins = NSMAX - j0; + if(savgBins > availableBins) savgBins = availableBins; + if(savgBins > 0) { + m_savgDisplay.resize(savgBins); + std::copy(&dec_data.savg[j0], &dec_data.savg[j0] + savgBins, m_savgDisplay.data()); + flat4_(m_savgDisplay.data(),&savgBins,&m_Flatten); + } + } + + ymin=1.e30; + if(swidePlot[0]>1.e29 and swidePlot[0]< 1.5e30) painter1.setPen(Qt::green); + if(swidePlot[0]>1.4e30) painter1.setPen(Qt::red); ymin = 0; - for(int i=0; i254) y1=254; - if (swide[i]<1.e29) painter1.setPen(g_ColorTbl[y1]); - painter1.drawPoint(i,m_j); + if(drawWaterfall) { + for(int i=0; i254.0) y=254.0; + int y1 = y; + if (swidePlot[i]<1.e29) painter1.setPen(g_ColorTbl[y1]); + painter1.drawPoint(i,m_j); + } } - m_line++; + if(drawWaterfall) m_line++; + + if(m_bReplot and m_mode!="Q65") return; float y2min=1.e30; float y2max=-1.e30; - for(int i=0; i0) y2=2.0*gain2d*sum/n + m_plot2dZero; } if(m_bReference) { //Reference (red) @@ -248,7 +289,7 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) } - if(i==iz-1 and !m_bQ65_Sync and !m_bTotalPower) { + if(i==izVisible-1 and !m_bQ65_Sync and !m_bTotalPower) { painter2D.drawPolyline(LineBuf,j); } LineBuf[j].setX(i); @@ -257,9 +298,14 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) if(y2>y2max) y2max=y2; j++; } - if(m_bReplot and m_mode!="Q65") return; - if(swide[0]>1.0e29) m_line=0; + if(!drawWaterfall) { + update(); + m_bScaleOK=true; + return; + } + + if(swidePlot[0]>1.0e29) m_line=0; if(m_mode=="FT4" and m_line==34) m_line=0; if(m_line == painter1.fontMetrics ().height () && m_timestamp!=0) { painter1.setPen(Qt::white); @@ -271,10 +317,10 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) } else { auto hr = m_nUTC / 10000; auto start = QTime {hr, (m_nUTC - 10000 * hr) / 100, m_nUTC % 100} - .toString (m_TRperiod < 60. ? "hh:mm:ss" : "hh:mm"); + .toString ((m_TRperiod < 60.0) or (m_mode=="JTTY") ? "hh:mm:ss" : "hh:mm"); t = QString {"%1 %2"}.arg (start).arg (m_rxBand); } - QRect rect{5, -2, m_w-10, painter1.fontMetrics().ascent()}; + QRect rect{5, -2, m_scale.width()-10, painter1.fontMetrics().ascent()}; QRect boundingRect; painter1.drawText(rect, m_timestamp==2?0x0082:0x0081,t, &boundingRect); } @@ -337,23 +383,23 @@ void CPlotter::draw(float swide[], bool bScroll, bool bRed) painter2D.setPen(Qt::white); Font.setWeight(QFont::Bold); painter2D.setFont(Font); - painter2D.drawText(m_w-100,m_h2/2,t); + painter2D.drawText(m_scale.width()-100,m_h2/2,t); } } if(m_bTotalPower and m_pdB>1.0) { painter2D.setPen(Qt::green); - if(m_x==m_w-1) { - for (int i=0; i100) m_freqPerDiv=20; - if(m_fSpan>250) m_freqPerDiv=50; - if(m_fSpan>500) m_freqPerDiv=100; - if(m_fSpan>1000) m_freqPerDiv=200; - if(m_fSpan>2500) m_freqPerDiv=500; - if(!m_bTotalPower) { - pixperdiv = m_freqPerDiv/df; - m_hdivs = w*df/m_freqPerDiv + 1.9999; - float xx0=float(m_startFreq)/float(m_freqPerDiv); - xx0=xx0-int(xx0); - int x0=xx0*pixperdiv+0.5; - for( int i=1; i= 0 and x<=m_w) { + for( int i=1; i= 0 and x<=m_scale.width()) { painter.setPen(QPen(Qt::white, 1,Qt::DotLine)); - painter.drawLine(x, 0, x , m_h2); + x = drawablePixel(x, m_OverlayPixmap.width()); + painter.drawLine(x, 0, x , overlayBottom); } } } @@ -435,9 +475,9 @@ void CPlotter::DrawOverlay() //DrawOverlay() for( int i=1; i 0) { y = int(0.2*i*m_vpixperdiv); - painter.drawLine(0, y, w, y); + painter.drawLine(0, y, overlayRight, y); } } } @@ -462,6 +502,8 @@ void CPlotter::DrawOverlay() //DrawOverlay() QRect rect0; QPainter painter0(&m_ScalePixmap); painter0.setBackground (palette ().brush (backgroundRole ())); + int const scaleRight = drawablePixel(m_scale.width(), m_ScalePixmap.width()); + int const scaleBottom = drawablePixel(m_ScalePixmap.height(), m_ScalePixmap.height()); //create Font to use for scales QFont Font("Arial"); @@ -474,42 +516,38 @@ void CPlotter::DrawOverlay() //DrawOverlay() painter0.setPen(Qt::black); } - if(m_binsPerPixel < 1) m_binsPerPixel=1; - m_hdivs = w*df/m_freqPerDiv + 0.9999; - if (m_useDarkStyle) { m_ScalePixmap.fill(Qt::black); } else { m_ScalePixmap.fill(Qt::white); } - painter0.drawRect(0, 0, w, 30); - MakeFrequencyStrs(); - + painter0.drawRect(0, 0, scaleRight, scaleBottom); //draw tick marks on upper scale - pixperdiv = m_freqPerDiv/df; - for( int i=0; i 70) { - rect0.setRect(x,0, (int)pixperdiv, 20); - painter0.drawText(rect0, Qt::AlignHCenter|Qt::AlignVCenter,m_HDivText[i]); + for( int i=0; i<=grid.scaleDivisionCount; i++) { + x = (int)((grid.firstMajorDivisionOffset+i)*grid.pixelsPerDivision + - grid.pixelsPerDivision/2); + if(int(x+grid.pixelsPerDivision/2) > 70) { + rect0.setRect(x,0, (int)grid.pixelsPerDivision, 20); + painter0.drawText(rect0, Qt::AlignHCenter|Qt::AlignVCenter,grid.labels[i]); } } float bw=9.0*12000.0/m_nsps; //JT9 if(m_mode=="FT4") bw=3*12000.0/576.0; //FT4 ### (3x, or 4x???) ### if(m_mode=="FT8") bw=7*12000.0/1920.0; //FT8 + if(m_mode=="JTTY") bw=3*12000.0/384.0; //JTTY if(m_mode.startsWith("FST4")) { int h=int(pow(2.0,m_nSubMode)); int nsps=800; @@ -534,17 +572,20 @@ void CPlotter::DrawOverlay() //DrawOverlay() painter0.setPen(penGreen); x1=XfromFreq(m_rxFreq-m_tol); x2=XfromFreq(m_rxFreq+m_tol); - painter0.drawLine(x1,29,x2,29); + painter0.drawLine(drawablePixel(x1, m_ScalePixmap.width()), scaleBottom, + drawablePixel(x2, m_ScalePixmap.width()), scaleBottom); for(int i=0; i<4; i++) { x1=XfromFreq(m_rxFreq+bw*i/3.0); int j=24; if(i==0) j=18; - painter0.drawLine(x1,j,x1,30); + painter0.drawLine(drawablePixel(x1, m_ScalePixmap.width()), j, + drawablePixel(x1, m_ScalePixmap.width()), scaleBottom); } painter0.setPen(penRed); for(int i=0; i<4; i++) { x1=XfromFreq(m_txFreq+bw*i/3.0); - painter0.drawLine(x1,12,x1,18); + painter0.drawLine(drawablePixel(x1, m_ScalePixmap.width()), 12, + drawablePixel(x1, m_ScalePixmap.width()), 18); } } @@ -579,72 +620,91 @@ void CPlotter::DrawOverlay() //DrawOverlay() if(m_mode=="WSPR") { x1=XfromFreq(1400); x2=XfromFreq(1600); - painter0.drawLine(x1,26,x2,26); + painter0.drawLine(drawablePixel(x1, m_ScalePixmap.width()), 26, + drawablePixel(x2, m_ScalePixmap.width()), 26); } if(m_mode=="FST4W") { x1=XfromFreq(m_rxFreq-m_tol); x2=XfromFreq(m_rxFreq+m_tol); - painter0.drawLine(x1,26,x2,26); + painter0.drawLine(drawablePixel(x1, m_ScalePixmap.width()), 26, + drawablePixel(x2, m_ScalePixmap.width()), 26); } if(m_mode=="FreqCal") { //FreqCal x1=XfromFreq(m_rxFreq-m_tol); x2=XfromFreq(m_rxFreq+m_tol); - painter0.drawLine(x1,29,x2,29); + painter0.drawLine(drawablePixel(x1, m_ScalePixmap.width()), scaleBottom, + drawablePixel(x2, m_ScalePixmap.width()), scaleBottom); x1=XfromFreq(m_rxFreq); - painter0.drawLine(x1,24,x1,30); + painter0.drawLine(drawablePixel(x1, m_ScalePixmap.width()), 24, + drawablePixel(x1, m_ScalePixmap.width()), scaleBottom); } int yh=5; int yTxTop=12; int yRxBottom=yTxTop + 2*yh + 4; if(m_mode=="JT9" or m_mode=="JT65" or m_mode=="Q65" or m_mode=="FT8" - or m_mode=="FT4" or m_mode.startsWith("FST4")) { + or m_mode=="FT4" or m_mode.startsWith("FST4") or m_mode=="JTTY") { if(m_mode=="FST4" and !m_bSingleDecode) { x1=XfromFreq(m_nfa); x2=XfromFreq(m_nfb); - painter0.drawLine(x1,25,x1+5,30); // Mark FST4 F_Low - painter0.drawLine(x1,25,x1+5,20); - painter0.drawLine(x2,25,x2-5,30); // Mark FST4 F_High - painter0.drawLine(x2,25,x2-5,20); + painter0.drawLine(drawablePixel(x1, m_ScalePixmap.width()), 25, + drawablePixel(x1 + 5, m_ScalePixmap.width()), scaleBottom); + painter0.drawLine(drawablePixel(x1, m_ScalePixmap.width()), 25, + drawablePixel(x1 + 5, m_ScalePixmap.width()), 20); + painter0.drawLine(drawablePixel(x2, m_ScalePixmap.width()), 25, + drawablePixel(x2 - 5, m_ScalePixmap.width()), scaleBottom); + painter0.drawLine(drawablePixel(x2, m_ScalePixmap.width()), 25, + drawablePixel(x2 - 5, m_ScalePixmap.width()), 20); } - if(m_mode=="Q65" or (m_mode=="JT65" and m_bVHF) or (m_mode=="FT8" and m_bSuperHound)) { + if(m_mode=="Q65" or m_mode=="JTTY" or (m_mode=="JT65" and m_bVHF) or + (m_mode=="FT8" and m_bSuperHound)) { painter0.setPen(penGreen); x1=XfromFreq(m_rxFreq-m_tol); x2=XfromFreq(m_rxFreq+m_tol); - painter0.drawLine(x1,26,x2,26); + painter0.drawLine(drawablePixel(x1, m_ScalePixmap.width()), 26, + drawablePixel(x2, m_ScalePixmap.width()), 26); x1=XfromFreq(m_rxFreq); - painter0.drawLine(x1,20,x1,26); + painter0.drawLine(drawablePixel(x1, m_ScalePixmap.width()), 20, + drawablePixel(x1, m_ScalePixmap.width()), 26); if(m_mode=="JT65") { painter0.setPen(penOrange); x3=XfromFreq(m_rxFreq+20.0*bw/65.0); //RO - painter0.drawLine(x3,20,x3,26); + painter0.drawLine(drawablePixel(x3, m_ScalePixmap.width()), 20, + drawablePixel(x3, m_ScalePixmap.width()), 26); x4=XfromFreq(m_rxFreq+30.0*bw/65.0); //RRR - painter0.drawLine(x4,20,x4,26); + painter0.drawLine(drawablePixel(x4, m_ScalePixmap.width()), 20, + drawablePixel(x4, m_ScalePixmap.width()), 26); x5=XfromFreq(m_rxFreq+40.0*bw/65.0); //73 - painter0.drawLine(x5,20,x5,26); + painter0.drawLine(drawablePixel(x5, m_ScalePixmap.width()), 20, + drawablePixel(x5, m_ScalePixmap.width()), 26); } painter0.setPen(penGreen); x6=XfromFreq(m_rxFreq+bw); //Highest tone if(m_mode=="FT8" and m_bSuperHound) x6=XfromFreq(m_rxFreq+1500.0); - painter0.drawLine(x6,20,x6,26); + painter0.drawLine(drawablePixel(x6, m_ScalePixmap.width()), 20, + drawablePixel(x6, m_ScalePixmap.width()), 26); } else { // Draw the green goal post painter0.setPen(penGreen); x1=XfromFreq(m_rxFreq); x2=XfromFreq(m_rxFreq+bw); - painter0.drawLine(x1,yRxBottom-yh,x1,yRxBottom); - painter0.drawLine(x1,yRxBottom,x2,yRxBottom); - painter0.drawLine(x2,yRxBottom-yh,x2,yRxBottom); + painter0.drawLine(drawablePixel(x1, m_ScalePixmap.width()), yRxBottom-yh, + drawablePixel(x1, m_ScalePixmap.width()), yRxBottom); + painter0.drawLine(drawablePixel(x1, m_ScalePixmap.width()), yRxBottom, + drawablePixel(x2, m_ScalePixmap.width()), yRxBottom); + painter0.drawLine(drawablePixel(x2, m_ScalePixmap.width()), yRxBottom-yh, + drawablePixel(x2, m_ScalePixmap.width()), yRxBottom); if(m_mode.startsWith("FST4")) { x1=XfromFreq(m_rxFreq-m_tol); x2=XfromFreq(m_rxFreq+m_tol); - painter0.drawLine(x1,26,x2,26); // Mark the Tol range + painter0.drawLine(drawablePixel(x1, m_ScalePixmap.width()), 26, + drawablePixel(x2, m_ScalePixmap.width()), 26); } } } @@ -665,14 +725,19 @@ void CPlotter::DrawOverlay() //DrawOverlay() } if (m_bars) { overPainter.setPen(Qt::green); // Rx bars - overPainter.drawLine(x1,0,x1,m_h); overPainter.drawLine(x2,0,x2,m_h); + int const overlayBottom = drawablePixel(m_h, m_h); + overPainter.drawLine(drawablePixel(x1, m_DialOverlayPixmap.width()), 0, + drawablePixel(x1, m_DialOverlayPixmap.width()), overlayBottom); + overPainter.drawLine(drawablePixel(x2, m_DialOverlayPixmap.width()), 0, + drawablePixel(x2, m_DialOverlayPixmap.width()), overlayBottom); } } // red bars if(m_mode.startsWith("FT") or m_mode.startsWith("JT") or m_mode=="Q65" or m_mode.startsWith("FST4") or m_mode.mid(0,4)=="WSPR") { - x1=XfromFreq(m_txFreq); x2=XfromFreq(m_txFreq+bw); + x1=XfromFreq(m_txFreq); + x2=XfromFreq(m_txFreq+bw); if(m_mode=="FT8" and m_bSuperFox) x2=XfromFreq(m_txFreq+1500.0); if(m_mode=="WSPR") { bw=4*12000.0/8192.0; //WSPR @@ -680,13 +745,17 @@ void CPlotter::DrawOverlay() //DrawOverlay() } if (m_bars) { overPainter.setPen(Qt::red); // Tx bars - overPainter.drawLine(x1,0,x1,m_h); overPainter.drawLine(x2,0,x2,m_h); + int const overlayBottom = drawablePixel(m_h, m_h); + overPainter.drawLine(drawablePixel(x1, m_DialOverlayPixmap.width()), 0, + drawablePixel(x1, m_DialOverlayPixmap.width()), overlayBottom); + overPainter.drawLine(drawablePixel(x2, m_DialOverlayPixmap.width()), 0, + drawablePixel(x2, m_DialOverlayPixmap.width()), overlayBottom); } } // red goal post if(m_mode=="JT9" or m_mode=="JT65" or m_mode.mid(0,4)=="WSPR" or m_mode=="Q65" - or m_mode=="FT8" or m_mode=="FT4" or m_mode.startsWith("FST4")) { + or m_mode=="FT8" or m_mode=="FT4" or m_mode.startsWith("FST4") or m_mode=="JTTY") { painter0.setPen(penRed); x1=XfromFreq(m_txFreq); if(m_mode=="FT8" and m_bSuperFox) { @@ -700,6 +769,8 @@ void CPlotter::DrawOverlay() //DrawOverlay() x2=XfromFreq(m_txFreq+0.5*bw); } // Draw the red goal post + x1 = drawablePixel(x1, m_ScalePixmap.width()); + x2 = drawablePixel(x2, m_ScalePixmap.width()); painter0.drawLine(x1,yTxTop,x1,yTxTop+yh); painter0.drawLine(x1,yTxTop,x2,yTxTop); painter0.drawLine(x2,yTxTop,x2,yTxTop+yh); @@ -713,8 +784,10 @@ void CPlotter::DrawOverlay() //DrawOverlay() hoverPainter.setCompositionMode(QPainter::CompositionMode_Source); hoverPainter.fillRect(0, 0, m_Size.width(), m_h, Qt::transparent); hoverPainter.setPen(QPen(Qt::white)); // white bars - hoverPainter.drawLine(0, 30, 0, m_h); // first slot, left line hover - hoverPainter.drawLine(fwidth, 30, fwidth, m_h); // first slot, right line hover + int const hoverBottom = drawablePixel(m_h, m_HoverOverlayPixmap.height()); + hoverPainter.drawLine(0, 30, 0, hoverBottom); // first slot, left line hover + hoverPainter.drawLine(drawablePixel(fwidth, m_HoverOverlayPixmap.width()), 30, + drawablePixel(fwidth, m_HoverOverlayPixmap.width()), hoverBottom); } if(m_dialFreq>10.13 and m_dialFreq< 10.15 and m_mode.mid(0,4)!="WSPR" and m_mode!="FST4W") { @@ -722,35 +795,22 @@ void CPlotter::DrawOverlay() //DrawOverlay() float f2=f1+200.0; x1=XfromFreq(f1); x2=XfromFreq(f2); - if(x1<=m_w and x2>=0) { + if(x1<=m_scale.width() and x2>=0) { painter0.setPen(penOrange); //Mark WSPR sub-band orange - painter0.drawLine(x1,9,x2,9); + painter0.drawLine(drawablePixel(x1, m_ScalePixmap.width()), 9, + drawablePixel(x2, m_ScalePixmap.width()), 9); } } } -void CPlotter::MakeFrequencyStrs() //MakeFrequencyStrs -{ - int f=(m_startFreq+m_freqPerDiv-1)/m_freqPerDiv; - f*=m_freqPerDiv; - m_xOffset=float(f-m_startFreq)/m_freqPerDiv; - for(int i=0; i<=m_hdivs; i++) { - m_HDivText[i].setNum(f); - f+=m_freqPerDiv; - } -} - int CPlotter::XfromFreq(float f) //XfromFreq() { - int x = int(m_w * (f - m_startFreq)/m_fSpan + 0.5); - if(x<0 ) return 0; - if(x>m_w) return m_w; - return x; + return m_scale.xFromFreqHz(f); } float CPlotter::FreqfromX(int x) //FreqfromX() { - return float(m_startFreq + x*m_binsPerPixel*m_fftBinWidth); + return m_scale.freqHzFromX(x); } void CPlotter::SetRunningState(bool running) //SetRunningState() @@ -801,8 +861,7 @@ void CPlotter::setPlot2dZero(int plot2dZero) //setPlot2dZero void CPlotter::setStartFreq(int f) //SetStartFreq() { - m_startFreq=f; - m_fMax=FreqfromX(XfromFreq(5000.0)); + m_scale.setStartHz(f); resizeEvent(NULL); DrawOverlay(); update(); @@ -810,29 +869,23 @@ void CPlotter::setStartFreq(int f) //SetStartFreq() int CPlotter::startFreq() //startFreq() { - return m_startFreq; + return m_scale.startHz(); } -int CPlotter::plotWidth(){return m_WaterfallPixmap.width();} //plotWidth +int CPlotter::plotWidth(){return m_scale.width();} //plotWidth void CPlotter::UpdateOverlay() {DrawOverlay();} //UpdateOverlay void CPlotter::setDataFromDisk(bool b) {m_dataFromDisk=b;} //setDataFromDisk -void CPlotter::setRxRange(int fMin) //setRxRange -{ - m_fMin=fMin; -} - void CPlotter::setBinsPerPixel(int n) //setBinsPerPixel { - m_binsPerPixel = n; - m_fMax=FreqfromX(XfromFreq(5000.0)); + m_scale.setBinsPerPixel(n); DrawOverlay(); //Redraw scales and ticks update(); //trigger a new paintEvent} } int CPlotter::binsPerPixel() //binsPerPixel { - return m_binsPerPixel; + return m_scale.binsPerPixel(); } void CPlotter::setWaterfallAvg(int n) //setNavg @@ -868,16 +921,16 @@ void CPlotter::mouseMoveEvent (QMouseEvent * event) event->ignore(); if(m_freq) { if (!m_bTotalPower){ - QToolTip::showText(event->globalPos(),QString::number(int(FreqfromX(x)))); + QToolTip::showText(event->globalPos(),QString::number(int(FreqfromX(x))),this); } else { int y=event->y(); float pdB=10.0*(m_h-y)/m_vpixperdiv + 20.0; if(y<(m_h-m_h2)) { - QToolTip::showText(event->globalPos(),QString::number(int(FreqfromX(x)))); + QToolTip::showText(event->globalPos(),QString::number(int(FreqfromX(x))),this); } else { QString t; t=t.asprintf("%4.1f dB",pdB); - QToolTip::showText(event->globalPos(),t); + QToolTip::showText(event->globalPos(),t,this); } } } @@ -925,7 +978,17 @@ void CPlotter::mouseDoubleClickEvent (QMouseEvent * event) bool rightbutton = (event->button() & Qt::RightButton); bool leftbutton = (event->button() & Qt::LeftButton); bool ctrl = (event->modifiers() & Qt::ControlModifier); - if (leftbutton) { + if (leftbutton and m_mode=="JTTY" and !ctrl) { + // Waterfall region is screen y in [30,30+m_h1); row 0 (newest) is at + // the top, growing downward -- see the m_j=0 draw + scroll(0,1,...) in + // draw(). Ctrl+double-click still falls through below for the old, + // unbounded full-buffer rescan. + int const row = event->y() - 30; + if (row >= 0 and row < m_h1) { + float const secondsAgo = row * m_waterfallAvg * 3456.0f/12000.0f; + emit jttyDecodeAgainAt(secondsAgo); + } + } else if (leftbutton) { int n=2; if(ctrl) n+=100; emit freezeDecode1(n); @@ -947,11 +1010,12 @@ void CPlotter::setNsps(double trperiod, int nsps) //setNsps { m_TRperiod=trperiod; m_nsps=nsps; - m_fftBinWidth=1500.0/2048.0; - if(m_nsps==15360) m_fftBinWidth=1500.0/2048.0; - if(m_nsps==40960) m_fftBinWidth=1500.0/6144.0; - if(m_nsps==82944) m_fftBinWidth=1500.0/12288.0; - if(m_nsps==252000) m_fftBinWidth=1500.0/32768.0; + double fftBinWidth=1500.0/2048.0; + if(m_nsps==15360) fftBinWidth=1500.0/2048.0; + if(m_nsps==40960) fftBinWidth=1500.0/6144.0; + if(m_nsps==82944) fftBinWidth=1500.0/12288.0; + if(m_nsps==252000) fftBinWidth=1500.0/32768.0; + m_scale.setFftBinWidthHz(fftBinWidth); DrawOverlay(); //Redraw scales and ticks update(); //trigger a new paintEvent} } @@ -975,7 +1039,7 @@ void CPlotter::setSubMode(int n) //setSubMode int CPlotter::Fmax() { - return m_fMax; + return m_scale.maxFreqHz(); } void CPlotter::setDialFreq(double d) diff --git a/widgets/plotter.h b/widgets/plotter.h index 1f3b8c42..af2ec36c 100644 --- a/widgets/plotter.h +++ b/widgets/plotter.h @@ -15,8 +15,9 @@ #include #include +#include "WaterfallScale.hpp" + #define VERT_DIVS 7 //specify grid screen divisions -#define HORZ_DIVS 20 extern bool g_single_decode; @@ -50,7 +51,6 @@ public: int plotWidth(); void UpdateOverlay(); void setDataFromDisk(bool b); - void setRxRange(int fMin); void setBinsPerPixel(int n); int binsPerPixel(); void setWaterfallAvg(int n); @@ -71,9 +71,9 @@ public: bool cumulative() const {return m_bCumulative;} void setLinearAvg(bool b) {m_bLinearAvg = b;} bool linearAvg() const {return m_bLinearAvg;} - void setBreadth(qint32 w) {m_w = w;} - qint32 breadth() const {return m_w;} - float fSpan() const {return m_fSpan;} + void setBreadth(qint32 w) {m_scale.setWidth(w);} + qint32 breadth() const {return m_scale.width();} + float fSpan() const {return m_scale.spanHz();} void setColours(QVector const& cl); void setTimestamp(int n); void setBars(bool b); @@ -102,6 +102,7 @@ public: signals: void freezeDecode1(int n); void setFreq1(int rxFreq, int txFreq); + void jttyDecodeAgainAt(float secondsAgo); protected: //re-implemented widget event handlers @@ -113,9 +114,9 @@ protected: private: - void MakeFrequencyStrs(); int XfromFreq(float f); float FreqfromX(int x); + void drawSavedWaterfall(); QAction * m_set_freq_action; @@ -126,7 +127,7 @@ private: bool m_bReference; bool m_bReference0; bool m_bQ65_Sync; - bool m_bTotalPower; + bool m_bTotalPower=false; bool m_bVHF; bool m_bSingleDecode; bool m_bFirst=true; @@ -134,8 +135,7 @@ private: bool m_bSuperFox=false; bool m_bSuperHound=false; bool m_bars; - bool m_freq; - float m_fSpan; + bool m_freq=false; float m_pdB=0.0; float m_vpixperdiv; bool m_useDarkStyle=false; @@ -144,9 +144,7 @@ private: qint32 m_plotGain; qint32 m_plot2dGain; qint32 m_plot2dZero; - qint32 m_binsPerPixel; qint32 m_waterfallAvg; - qint32 m_w; qint32 m_Flatten; qint32 m_nSubMode; qint32 m_ia; @@ -166,7 +164,9 @@ private: QPoint m_pos; QSize m_Size; QString m_Str; - QString m_HDivText[483]; + QVector m_swideDisplay; + QVector m_savgDisplay; + QVector m_replotRow; QString m_mode; QString m_mode0; QString m_rxBand; @@ -177,20 +177,15 @@ private: bool m_dataFromDisk; bool m_bReplot; - double m_fftBinWidth; double m_dialFreq; - double m_xOffset; double m_TRperiod; float m_sum[2048]; qint32 m_dBStepSize; - qint32 m_FreqUnits; - qint32 m_hdivs; qint32 m_line; qint32 m_fSample; qint32 m_xClick; - qint32 m_freqPerDiv; qint32 m_nsps; qint32 m_Percent2DScreen; qint32 m_Percent2DScreen0; @@ -200,15 +195,14 @@ private: qint32 m_rxFreq; qint32 m_rxFreq0=0; qint32 m_txFreq; - qint32 m_fMin; - qint32 m_fMax; - qint32 m_startFreq; qint32 m_tol; qint32 m_lastMouseX; qint32 m_lastPaintedX; qint32 m_j; char m_sutc[6]; + WaterfallScale m_scale; + private slots: void leaveEvent(QEvent *event) override; diff --git a/widgets/qsymonitor.cpp b/widgets/qsymonitor.cpp index efe9181a..0d04e766 100644 --- a/widgets/qsymonitor.cpp +++ b/widgets/qsymonitor.cpp @@ -2,6 +2,7 @@ #include "ui_qsymonitor.h" #include "SettingsGroup.hpp" #include "Configuration.hpp" +#include "widgets/QSYMessageParser.h" #include "qt_helpers.hpp" #include "commons.h" #include @@ -71,7 +72,7 @@ void QSYMonitor::on_clearButton_clicked() void QSYMonitor::createQSYLine(QString value) { - QStringList qsySpot = value.split(' '); + QStringList qsySpot = value.split(' ', SkipEmptyParts); if(qsySpot.length() == 3) { QString theTime = qsySpot[0]; QString theCall = qsySpot[1]; @@ -81,267 +82,16 @@ void QSYMonitor::createQSYLine(QString value) void QSYMonitor::getBandModeFreq(QString theTime, QString theCall, QString value) { - if(value.at(0).isLetter() || value.at(0) == '9' || value.at(0) == '4' || value.at(0) == '7') { - QString bandParam = ""; - QString modeParam = value.at(0); - QString freqParam = ""; - bandParam = value.mid(0,1); - modeParam = value.at(1); - freqParam = value.mid(2, 3); - QString band = ""; - QString mode = ""; - QString freq = ""; + QSYMessageParser::Message const message = + QSYMessageParser::decode (value, configuration_->region ()); + if (message.type != QSYMessageParser::Type::Frequency) return; - if (bandParam == "A") { - if (modeParam.at(0).isLetter()) { - freq = "50."; - } else { - if (modeParam =="0") { - freq = "50."; - } else if (modeParam =="1") { - freq = "51."; - } else if (modeParam =="2") { - freq = "52."; - } else if (modeParam =="3") { - freq = "53."; - } - } - } - else if (bandParam == "B") { - if (modeParam.at(0).isLetter()) { - freq = "144."; - } else { - if (modeParam =="4") { - freq = "144."; - } else if (modeParam =="5") { - freq = "145."; - } else if (modeParam =="6") { - freq = "146."; - } else if (modeParam =="7") { - freq = "147."; - } - } - } - else if (bandParam == "C") { - if (modeParam.at(0).isLetter()) { - freq = "222."; - } else { - if (modeParam =="2") { - freq = "222."; - } else if (modeParam =="3") { - freq = "223."; - } - } - } - else if (bandParam == "D") { - if (modeParam.at(0).isLetter()) { - freq = "432."; - } else { - if (configuration_->region()==2) { - if (modeParam =="0") { - freq = "440."; - } else if (modeParam =="1") { - freq = "441."; - } else if (modeParam =="2") { - freq = "442."; - } else if (modeParam =="3") { - freq = "443."; - } else if (modeParam =="4") { - freq = "444."; - } else if (modeParam =="5") { - freq = "445."; - } else if (modeParam =="6") { - freq = "446."; - } else if (modeParam =="7") { - freq = "447."; - } else if (modeParam =="8") { - freq = "448."; - } else if (modeParam =="9") { - freq = "449."; - } - } - else { //not region 2 - if (modeParam =="0") { - freq = "430."; - } else if (modeParam =="1") { - freq = "431."; - } else if (modeParam =="2") { - freq = "432."; - } else if (modeParam =="3") { - freq = "433."; - } else if (modeParam =="4") { - freq = "434."; - } else if (modeParam =="5") { - freq = "435."; - } else if (modeParam =="6") { - freq = "436."; - } else if (modeParam =="7") { - freq = "437."; - } else if (modeParam =="8") { - freq = "438."; - } else if (modeParam =="9") { - freq = "439."; - } - } - } - } - else if (bandParam == "E") { - if (modeParam.at(0).isLetter()) { - freq = "1296."; - } else { - if (modeParam =="0") { - freq = "1290."; - } else if (modeParam =="1") { - freq = "1291."; - } else if (modeParam =="2") { - freq = "1292."; - } else if (modeParam =="3") { - freq = "1293."; - } else if (modeParam =="4") { - freq = "1294."; - } else if (modeParam =="5") { - freq = "1295."; - } else if (modeParam =="6") { - freq = "1296."; - } else if (modeParam =="7") { - freq = "1297."; - } else if (modeParam =="8") { - freq = "1298."; - } else if (modeParam =="9") { - freq = "1299."; - } - } - } - else if (bandParam == "F") { - freq = "2304."; - } - else if (bandParam == "G") { - freq = "3400."; - } - else if (bandParam == "H") { - freq = "5760."; - } - else if (bandParam == "I") { - freq = "10368."; - } - else if (bandParam == "J") { - if (configuration_->region()==2) { - freq = "24192."; - } else { - freq = "24048."; - } - } - else if (bandParam == "9") { - freq = "902."; - } - else if (bandParam == "K") { - freq = "903."; - } - else if (bandParam == "J") { - freq = "24192."; - } - else if (bandParam == "X") { - freq = "24048."; - } - else if (bandParam == "4") { - freq = "40."; - } - else if (bandParam == "7") { - freq = "70."; - } - else if (bandParam == "L") { - freq = "0."; - } - else if (bandParam == "M") { - freq = "1."; - } - else if (bandParam == "N") { - freq = "3."; - } - else if (bandParam == "O") { - freq = "5."; - } - else if (bandParam == "P") { - freq = "7."; - } - else if (bandParam == "Q") { - freq = "10."; - } - else if (bandParam == "R") { - freq = "14."; - } - else if (bandParam == "S") { - freq = "18."; - } - else if (bandParam == "T") { - freq = "21."; - } - else if (bandParam == "U") { - freq = "24."; - } - else if (bandParam == "V") { - freq = "28."; - } - else if (bandParam == "W") { - freq = "29."; - } else { - freq = ""; - } - - freq = freq + freqParam; - if(!modeParam.at(0).isLetter()) { - mode = "FM"; - } - else if (modeParam == 'V') { - mode = "SSB"; - } - else if (modeParam == 'J') { - mode = "FT4"; - } - else if (modeParam == 'L') { - mode = "FT8"; - } - else if (modeParam == 'K') { - mode = "MSK144"; - } - else if (modeParam == 'W') { - mode = "CW"; - } - else if (modeParam == 'A') { - mode = "JT9"; - } - else if (modeParam == 'B') { - mode = "JT65"; - } - else if (modeParam == 'C') { - mode = "FST4"; - } - else if (modeParam == 'D') { - mode = "Q65-30B"; - } - else if (modeParam == 'E') { - mode = "Q65-60C"; - } - else if (modeParam == 'F') { - mode = "Q65-60D"; - } - else if (modeParam == 'G') { - mode = "Q65-60E"; - } - else if (modeParam == 'H') { - mode = "Q65-120D"; - } - else { - mode = ""; - } - int numSpaces1 = 2; - int numSpaces2 = 10 - theCall.length(); - int numSpaces3 = 11 - freq.length(); - QString spaces1_theCall = QString(numSpaces1, ' ').append(theCall); - QString spaces2_theFreq = QString(numSpaces2, ' ').append(freq); - QString spaces3_theMode = QString(numSpaces3, ' ').append(mode); - QString qsyMessageString = theTime + spaces1_theCall + spaces2_theFreq + spaces3_theMode; - ui->QSYMonitorTextBrowser->append(qsyMessageString); - } + int numSpaces1 = 2; + int numSpaces2 = 10 - theCall.length(); + int numSpaces3 = 11 - message.frequency_mhz.length(); + QString spaces1_theCall = QString(numSpaces1, ' ').append(theCall); + QString spaces2_theFreq = QString(numSpaces2, ' ').append(message.frequency_mhz); + QString spaces3_theMode = QString(numSpaces3, ' ').append(message.mode); + QString qsyMessageString = theTime + spaces1_theCall + spaces2_theFreq + spaces3_theMode; + ui->QSYMonitorTextBrowser->append(qsyMessageString); } - diff --git a/widgets/widegraph.cpp b/widgets/widegraph.cpp index 4aa2ea10..f33b570c 100644 --- a/widgets/widegraph.cpp +++ b/widgets/widegraph.cpp @@ -11,6 +11,7 @@ #include "Configuration.hpp" #include "MessageBox.hpp" #include "SettingsGroup.hpp" +#include "PerformanceTrace.hpp" #include "moc_widegraph.cpp" WideGraph::WideGraph(QSettings * settings, QWidget *parent) : @@ -23,6 +24,7 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) : m_bHaveTransmitted {false}, m_user_defined {tr ("User Defined")} { + PerformanceTrace::Phase construction {"widegraph.construct"}; ui->setupUi(this); setWindowTitle (QApplication::applicationName () + " - " + tr ("Wide Graph")); @@ -42,6 +44,9 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) : connect(ui->widePlot, SIGNAL(setFreq1(int,int)),this, SLOT(setFreq2(int,int))); + connect(ui->widePlot, SIGNAL(jttyDecodeAgainAt(float)),this, + SLOT(wideJttyDecodeAgainAt(float))); + { //Restore user's settings SettingsGroup g {m_settings, "WideGraph"}; @@ -98,7 +103,6 @@ WideGraph::WideGraph(QSettings * settings, QWidget *parent) : m_waterfallPalette=m_settings->value("WaterfallPalette","Default").toString(); m_userPalette = WFPalette {m_settings->value("UserPalette").value ()}; m_fMinPerBand = m_settings->value ("FminPerBand").toHash (); - setRxRange (); ui->controls_widget->setVisible(!m_settings->value("HideControls",false).toBool()); ui->cbControls->setChecked(!m_settings->value("HideControls",false).toBool()); } @@ -193,7 +197,7 @@ void WideGraph::dataSink2(float s[], float df3, int ihsym, int ndiskdata, float for (int j=0; jwidePlot->setRxRange (Fmin ()); - ui->widePlot->DrawOverlay(); - ui->widePlot->update(); + emit jttyDecodeAgainAt2(secondsAgo); } int WideGraph::Fmin() //Fmin @@ -295,6 +297,17 @@ int WideGraph::fSpan() return ui->widePlot->fSpan (); } +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) +void WideGraph::setFrequencyScale(int startFrequency, int binsPerPixel, int plotWidth) +{ + ui->widePlot->setFixedWidth(plotWidth); + ui->widePlot->setStartFreq(startFrequency); + ui->widePlot->setBinsPerPixel(binsPerPixel); + ui->fStartSpinBox->setValue(startFrequency); + ui->bppSpinBox->setValue(binsPerPixel); +} +#endif + void WideGraph::setPeriod(double trperiod, int nsps) //SetPeriod { m_TRperiod=trperiod; @@ -365,7 +378,6 @@ void WideGraph::on_spec2dComboBox_currentIndexChanged(int index) void WideGraph::on_fSplitSpinBox_valueChanged(int n) //fSplit { if (m_rxBand != "60m") m_fMinPerBand[m_rxBand] = n; - setRxRange (); } void WideGraph::setFreq2(int rxFreq, int txFreq) //setFreq2 @@ -392,7 +404,6 @@ void WideGraph::setRxBand (QString const& band) ui->fSplitSpinBox->setEnabled (m_mode.startsWith("FST4")); } ui->widePlot->setRxBand(band); - setRxRange (); } @@ -518,7 +529,10 @@ void WideGraph::clearReferenceSpectrum(bool reference_spectrum_available) void WideGraph::replot() { - if(ui->widePlot->scaleOK()) ui->widePlot->replot(); + if(ui->widePlot->scaleOK()) { + ui->widePlot->replot(); + ui->widePlot->draw(m_swide,false,false); + } } void WideGraph::on_gainSlider_valueChanged(int value) //Gain diff --git a/widgets/widegraph.h b/widgets/widegraph.h index ff1daf72..d4d2d839 100644 --- a/widgets/widegraph.h +++ b/widgets/widegraph.h @@ -33,6 +33,9 @@ public: int Fmin(); int Fmax(); int fSpan(); +#if defined (WSJT_ENABLE_LIVE_AUDIO_TEST) + void setFrequencyScale(int startFrequency, int binsPerPixel, int plotWidth); +#endif void saveSettings(); void setFsample(int n); void setPeriod(double trperiod, int nsps); @@ -63,11 +66,13 @@ signals: void f11f12(int n); void setXIT2(int n); void setFreq3(int rxFreq, int txFreq); + void jttyDecodeAgainAt2(float secondsAgo); public slots: void wideFreezeDecode(int n); void setFreq2(int rxFreq, int txFreq); void setDialFreq(double d); + void wideJttyDecodeAgainAt(float secondsAgo); protected: void keyPressEvent (QKeyEvent *e) override; @@ -96,7 +101,6 @@ private slots: private: void readPalette (); - void setRxRange (); void replot(); QScopedPointer ui; diff --git a/widgets/widegraph.ui b/widgets/widegraph.ui index a4ee7695..5eaf8b39 100644 --- a/widgets/widegraph.ui +++ b/widgets/widegraph.ui @@ -42,7 +42,7 @@ - 400 + 200 100 diff --git a/widgets/widgets.pri b/widgets/widgets.pri deleted file mode 100644 index e82bfbbe..00000000 --- a/widgets/widgets.pri +++ /dev/null @@ -1,48 +0,0 @@ -SOURCES += \ - widgets/astro.cpp widgets/LettersSpinBox.cpp \ - widgets/logqso.cpp widgets/displaytext.cpp \ - widgets/meterwidget.cpp widgets/signalmeter.cpp \ - widgets/plotter.cpp widgets/widegraph.cpp widgets/about.cpp \ - widgets/mainwindow.cpp widgets/messageaveraging.cpp \ - widgets/activeStations.cpp \ - widgets/echoplot.cpp widgets/echograph.cpp widgets/fastgraph.cpp \ - widgets/fastplot.cpp widgets/MessageBox.cpp \ - widgets/colorhighlighting.cpp widgets/ExportCabrillo.cpp \ - widgets/AbstractLogWindow.cpp \ - widgets/FrequencyLineEdit.cpp widgets/FrequencyDeltaLineEdit.cpp \ - widgets/FoxLogWindow.cpp widgets/CabrilloLogWindow.cpp \ - widgets/HelpTextWindow.cpp widgets/RestrictedSpinBox.cpp \ - widgets/LazyFillComboBox.cpp widgets/CheckableItemComboBox.cpp \ - widgets/QSYMessage.cpp \ - widgets/QSYMessageCreator.cpp \ - widgets/qsymonitor.cpp - -HEADERS += \ - widgets/mainwindow.h widgets/plotter.h \ - widgets/about.h widgets/widegraph.h \ - widgets/displaytext.h widgets/logqso.h widgets/LettersSpinBox.hpp \ - widgets/FrequencyLineEdit.hpp widgets/FrequencyDeltaLineEdit.hpp widgets/signalmeter.h \ - widgets/meterwidget.h widgets/messageaveraging.h \ - widgets/activeStations.h \ - widgets/echoplot.h widgets/echograph.h widgets/fastgraph.h \ - widgets/fastplot.h widgets/MessageBox.hpp widgets/colorhighlighting.h \ - widgets/ExportCabrillo.h widgets/AbstractLogWindow.hpp \ - widgets/FoxLogWindow.hpp widgets/CabrilloLogWindow.hpp \ - widgets/DateTimeEdit.hpp widgets/HelpTextWindow.hpp \ - widgets/RestrictedSpinBox.hpp \ - widgets/LazyFillComboBox.hpp widgets/CheckableItemComboBox.hpp \ - widgets/QSYMessage.h \ - widgets/QSYMessageCreator.h \ - widgets/qsymonitor.h - -FORMS += \ - widgets/mainwindow.ui widgets/about.ui \ - widgets/widegraph.ui widgets/astro.ui \ - widgets/logqso.ui widgets/messageaveraging.ui \ - widgets/activeStations.ui \ - widgets/echograph.ui widgets/fastgraph.ui \ - widgets/colorhighlighting.ui widgets/ExportCabrillo.ui \ - widgets/FoxLogWindow.ui widgets/CabrilloLogWindow.ui \ - widgets/QSYMessage.ui \ - widgets/QSYMessageCreator.ui \ - widgets/qsymonitor.ui diff --git a/wsjtx.iss b/wsjtx.iss deleted file mode 100644 index bcfef70f..00000000 --- a/wsjtx.iss +++ /dev/null @@ -1,30 +0,0 @@ -[Setup] -AppName=wsjtx -AppVerName=wsjtx Version 1.3 r3673 -AppCopyright=Copyright (C) 2001-2014 by Joe Taylor, K1JT -DefaultDirName=c:\wsjtx_w -DefaultGroupName=wsjtx_w - -[Files] -Source: "c:\Users\joe\wsjt\wsjtx_install\wsjtx.exe"; DestDir: "{app}" -Source: "c:\Users\joe\wsjt\wsjtx_install\jt9.exe"; DestDir: "{app}" -Source: "c:\Users\joe\wsjt\wsjtx_install\jt9code.exe"; DestDir: "{app}" -Source: "c:\Users\joe\wsjt\wsjtx_install\kvasd.exe"; DestDir: "{app}" -Source: "c:\Users\joe\wsjt\wsjtx_install\*.dll"; DestDir: "{app}"; -Source: "c:\Users\joe\wsjt\wsjtx\cty.dat"; DestDir: "{app}"; -Source: "c:\Users\joe\wsjt\wsjtx\kvasd.dat"; DestDir: "{app}"; -Source: "c:\Users\joe\wsjt\wsjtx\wsjt.ico"; DestDir: "{app}"; -Source: "c:\Users\joe\wsjt\wsjtx\qt.conf"; DestDir: "{app}"; -Source: "c:\Users\joe\wsjt\wsjtx\CALL3.TXT"; DestDir: "{app}"; Flags: onlyifdoesntexist -Source: "c:\Users\joe\wsjt\wsjtx\shortcuts.txt"; DestDir: "{app}" -Source: "c:\Users\joe\wsjt\wsjtx\mouse_commands.txt"; DestDir: "{app}" -Source: "c:\Users\joe\wsjt\wsjtx\prefixes.txt"; DestDir: "{app}" -Source: "c:\Users\joe\wsjt\wsjtx_install\save\Samples\130418_1742.wav"; DestDir: "{app}\save\Samples"; -Source: "c:\Users\joe\wsjt\wsjtx_install\save\Samples\130610_2343.wav"; DestDir: "{app}\save\Samples"; -Source: "c:\Users\joe\wsjt\wsjtx_install\platforms\qwindows.dll"; DestDir: "{app}\platforms"; -Source: "c:\Users\joe\wsjt\wsjtx_install\Palettes\*.pal"; DestDir: "{app}\Palettes"; - -[Icons] -Name: "{group}\wsjtx_w"; Filename: "{app}\wsjtx.exe"; WorkingDir: {app}; IconFilename: {app}\wsjt.ico -Name: "{userdesktop}\wsjtx_w"; Filename: "{app}\wsjtx.exe"; WorkingDir: {app}; IconFilename: {app}\wsjt.ico - diff --git a/wsjtx.pro b/wsjtx.pro deleted file mode 100644 index db6b3610..00000000 --- a/wsjtx.pro +++ /dev/null @@ -1,142 +0,0 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2011-07-07T08:39:24 -# -#------------------------------------------------- - -QT += network multimedia -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets sql -CONFIG += thread -#CONFIG += console - -TARGET = wsjtx -VERSION = "Not for Release" -TEMPLATE = app -DEFINES = QT5 -QMAKE_CXXFLAGS += -std=c++11 -DEFINES += PROJECT_MANUAL="'\"http://www.physics.princeton.edu/pulsar/K1JT/wsjtx-doc/wsjtx-main.html\"'" - -isEmpty (DESTDIR) { -DESTDIR = ../wsjtx_exp_install -} - -isEmpty (HAMLIB_DIR) { -HAMLIB_DIR = ../../hamlib3/mingw32 -} - -isEmpty (FFTW3_DIR) { -FFTW3_DIR = . -} - -F90 = gfortran -gfortran.output = ${QMAKE_FILE_BASE}.o -gfortran.commands = $$F90 -c -O2 -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_NAME} -gfortran.input = F90_SOURCES -QMAKE_EXTRA_COMPILERS += gfortran - -win32 { -DEFINES += WIN32 -QT += axcontainer -TYPELIBS = $$system(dumpcpp -getfile {4FE359C5-A58F-459D-BE95-CA559FB4F270}) -} - -unix { -DEFINES += UNIX -} - -# -# Order matters here as the link is in this order so referrers need to be after referred -# -include(models/models.pri) -include(validators/validators.pri) -include(item_delegates/item_delegates.pri) -include(logbook/logbook.pri) -include(widgets/widgets.pri) -include(Decoder/decodedtext.pri) -include(Detector/Detector.pri) -include(Modulator/Modulator.pri) -include(Audio/Audio.pri) -include(Transceiver/Transceiver.pri) -include(Network/Network.pri) - -SOURCES += \ - ExceptionCatchingApplication.cpp Logger.cpp WSJTXLogging.cpp \ - Radio.cpp NetworkServerLookup.cpp revision_utils.cpp \ - Configuration.cpp PSK_Reporter.cpp NonInheritingProcess.cpp \ - Transceiver/DXLabSuiteCommanderTransceiver.cpp \ - Transceiver/EmulateSplitTransceiver.cpp \ - Transceiver/HRDTransceiver.cpp \ - Transceiver/HamlibTransceiver.cpp \ - Transceiver/OmniRigTransceiver.cpp \ - Transceiver/PollingTransceiver.cpp \ - Transceiver/TCITransceiver.cpp \ - Transceiver/Transceiver.cpp \ - Transceiver/TransceiverBase.cpp \ - Transceiver/TransceiverFactory.cpp \ - getfile.cpp \ - WFPalette.cpp \ - WsprTxScheduler.cpp \ - helper_functions.cpp \ - main.cpp decodedtext.cpp wsprnet.cpp \ - WSPRBandHopping.cpp MessageAggregator.cpp SampleDownloader.cpp qt_helpers.cpp\ - MultiSettings.cpp PhaseEqualizationDialog.cpp \ - EqualizationToolsDialog.cpp \ - LotWUsers.cpp TraceFile.cpp - -HEADERS += qt_helpers.hpp qt_db_helpers.hpp \ - Transceiver/DXLabSuiteCommanderTransceiver.hpp \ - Transceiver/EmulateSplitTransceiver.hpp \ - Transceiver/HRDTransceiver.hpp \ - Transceiver/HamlibTransceiver.hpp \ - Transceiver/OmniRigTransceiver.hpp \ - Transceiver/PollingTransceiver.hpp \ - Transceiver/TCITransceiver.hpp \ - Transceiver/TCITransceiver_modified_but_not_yet_working.hpp \ - Transceiver/Transceiver.hpp \ - Transceiver/TransceiverBase.hpp \ - Transceiver/TransceiverFactory.hpp \ - helper_functions.h \ - pimpl_h.hpp pimpl_impl.hpp \ - ExceptionCatchingApplication.hpp Logger.hpp WSJTXLogging.hpp \ - Radio.hpp NetworkServerLookup.hpp revision_utils.hpp \ - WFPalette.hpp getfile.h decodedtext.h \ - commons.h sleep.h \ - PSK_Reporter.hpp \ - Configuration.hpp wsprnet.h \ - WSPRBandHopping.hpp \ - WsprTxScheduler.h SampleDownloader.hpp MultiSettings.hpp PhaseEqualizationDialog.hpp \ - EqualizationToolsDialog.hpp \ - LotWUsers.h TraceFile.hpp NonInheritingProcess.hpp - -INCLUDEPATH += qmake_only - -win32 { -SOURCES += killbyname.cpp OmniRigTransceiver.cpp -HEADERS += OmniRigTransceiver.hpp -} - -FORMS += \ - Configuration.ui \ - wf_palette_design_dialog.ui - -RC_FILE = wsjtx.rc -RESOURCES = wsjtx.qrc - -unix { -LIBS += -L lib -ljt9 -LIBS += -lhamlib -LIBS += -lfftw3f $$system($$F90 -print-file-name=libgfortran.so) -} - -win32 { -INCLUDEPATH += $${HAMLIB_DIR}/include -INCLUDEPATH += C:\JTSDK\wsjtx_exp\build\Release -INCLUDEPATH += C:\JTSDK\hamlib3\include -INCLUDEPATH += C:\JTSDK\qt5\5.2.1\mingw48_32\include\QtSerialPort - -LIBS += -L$${HAMLIB_DIR}/lib -lhamlib -LIBS += -L./lib -lastro -ljt9 -LIBS += -L$${FFTW3_DIR} -lfftw3f-3 -LIBS += -lws2_32 -LIBS += $$system($$F90 -print-file-name=libgfortran.a) -} diff --git a/wsjtx_config.h.in b/wsjtx_config.h.in index 75c5455e..b99d0931 100644 --- a/wsjtx_config.h.in +++ b/wsjtx_config.h.in @@ -19,6 +19,7 @@ extern "C" { #cmakedefine CMAKE_INSTALL_DATAROOTDIR "@CMAKE_INSTALL_DATAROOTDIR@" #cmakedefine CMAKE_INSTALL_DOCDIR "@CMAKE_INSTALL_DOCDIR@" #cmakedefine CMAKE_INSTALL_DATADIR "@CMAKE_INSTALL_DATADIR@" +#cmakedefine WSJT_DATA_DESTINATION "@WSJT_DATA_DESTINATION@" #cmakedefine CMAKE_PROJECT_NAME "@CMAKE_PROJECT_NAME@" #cmakedefine PROJECT_VENDOR "@PROJECT_VENDOR@" #cmakedefine PROJECT_NAME "@PROJECT_NAME@" @@ -32,6 +33,7 @@ extern "C" { #cmakedefine01 HAVE_HAMLIB_OLD_CACHING #cmakedefine01 HAVE_HAMLIB_CACHING +#cmakedefine01 HAVE_HAMLIB_GET_CONF2 #cmakedefine HAVE_STDIO_H 1 #cmakedefine STDC_HEADERS 1 diff --git a/wsjtx_icon.webp b/wsjtx_icon.webp new file mode 100644 index 00000000..8952fa54 Binary files /dev/null and b/wsjtx_icon.webp differ diff --git a/wsjtx_opti.iss b/wsjtx_opti.iss deleted file mode 100644 index fbe3c342..00000000 --- a/wsjtx_opti.iss +++ /dev/null @@ -1,23 +0,0 @@ -[Setup] -AppName=wsjtx -AppVerName=wsjtx Version 1.1.0 r3478 -AppCopyright=Copyright (C) 2001-2013 by Joe Taylor, K1JT -DefaultDirName=c:\wsjtx2 -DefaultGroupName=wsjtx2 - -[Files] -Source: "c:\Users\joe\wsjt\wsjtx_install\*.exe"; DestDir: "{app}" -Source: "c:\Users\joe\wsjt\wsjtx_install\*.dll"; DestDir: "{app}"; -Source: "c:\Users\joe\wsjt\wsjtx_install\*.dat"; DestDir: "{app}"; -Source: "c:\Users\joe\wsjt\wsjtx_install\wsjt.ico"; DestDir: "{app}"; -Source: "c:\Users\joe\wsjt\wsjtx_install\CALL3.TXT"; DestDir: "{app}"; Flags: onlyifdoesntexist -Source: "c:\Users\joe\wsjt\wsjtx\shortcuts.txt"; DestDir: "{app}" -Source: "c:\Users\joe\wsjt\wsjtx\mouse_commands.txt"; DestDir: "{app}" -Source: "c:\Users\joe\wsjt\wsjtx\WSJT-X_Users_Guide_v1.1.pdf"; DestDir: "{app}" -Source: "c:\Users\joe\wsjt\wsjtx_install\save\Samples\130418_1742.wav"; DestDir: "{app}\save\Samples"; -Source: "c:\Users\joe\wsjt\wsjtx_install\save\Samples\130610_2343.wav"; DestDir: "{app}\save\Samples"; - -[Icons] -Name: "{group}\wsjtx2"; Filename: "{app}\wsjtx.exe"; WorkingDir: {app}; IconFilename: {app}\wsjt.ico -Name: "{userdesktop}\wsjtx2"; Filename: "{app}\wsjtx.exe"; WorkingDir: {app}; IconFilename: {app}\wsjt.ico - diff --git a/wsjtx_update.iss b/wsjtx_update.iss deleted file mode 100644 index a80f3019..00000000 --- a/wsjtx_update.iss +++ /dev/null @@ -1,18 +0,0 @@ -[Setup] -AppName=wsjtx -AppVerName=wsjtx Version 1.2 r3537 -AppCopyright=Copyright (C) 2001-2013 by Joe Taylor, K1JT -DefaultDirName=c:\wsjtx1.2 -DefaultGroupName=wsjtx1.2 - -[Files] -Source: "c:\Users\joe\wsjt\wsjtx_install\wsjtx.exe"; DestDir: "{app}" -Source: "c:\Users\joe\wsjt\wsjtx_install\jt9.exe"; DestDir: "{app}" -Source: "c:\Users\joe\wsjt\wsjtx\shortcuts.txt"; DestDir: "{app}" -Source: "c:\Users\joe\wsjt\wsjtx\mouse_commands.txt"; DestDir: "{app}" -Source: "c:\Users\joe\wsjt\wsjtx\WSJT-X_Users_Guide_v1.2.pdf"; DestDir: "{app}" - -[Icons] -Name: "{group}\wsjtx1.2"; Filename: "{app}\wsjtx.exe"; WorkingDir: {app}; IconFilename: {app}\wsjt.ico -Name: "{userdesktop}\wsjtx1.2"; Filename: "{app}\wsjtx.exe"; WorkingDir: {app}; IconFilename: {app}\wsjt.ico - -- cgit v1.2.3